/*! For license information please see 350.js.LICENSE.txt */ (self.webpackChunkgrafana_pyroscope_app=self.webpackChunkgrafana_pyroscope_app||[]).push([[350],{7945:(e,t,r)=>{"use strict";r.d(t,{Tp:()=>i});const n={RadioButton:{container:"data-testid radio-button"},Breadcrumbs:{breadcrumb:e=>`data-testid ${e} breadcrumb`},TimePicker:{openButton:"data-testid TimePicker Open Button",overlayContent:"data-testid TimePicker Overlay Content",fromField:"data-testid Time Range from field",toField:"data-testid Time Range to field",applyTimeRange:"data-testid TimePicker submit button",copyTimeRange:"data-testid TimePicker copy button",pasteTimeRange:"data-testid TimePicker paste button",calendar:{label:"data-testid Time Range calendar",openButton:"data-testid Open time range calendar",closeButton:"data-testid Close time range Calendar"},absoluteTimeRangeTitle:"data-testid-absolute-time-range-narrow"},DataSourcePermissions:{form:()=>'form[name="addPermission"]',roleType:"Role to add new permission to",rolePicker:"Built-in role picker",permissionLevel:"Permission Level"},DateTimePicker:{input:"data-testid date-time-input"},DataSource:{TestData:{QueryTab:{scenarioSelectContainer:"Test Data Query scenario select container",scenarioSelect:"Test Data Query scenario select",max:"TestData max",min:"TestData min",noise:"TestData noise",seriesCount:"TestData series count",spread:"TestData spread",startValue:"TestData start value",drop:"TestData drop values"}},DataSourceHttpSettings:{urlInput:"data-testid Datasource HTTP settings url"},Jaeger:{traceIDInput:"Trace ID"},Prometheus:{configPage:{connectionSettings:"Data source connection URL",manageAlerts:"prometheus-alerts-manager",scrapeInterval:"data-testid scrape interval",queryTimeout:"data-testid query timeout",defaultEditor:"data-testid default editor",disableMetricLookup:"disable-metric-lookup",prometheusType:"data-testid prometheus type",prometheusVersion:"data-testid prometheus version",cacheLevel:"data-testid cache level",incrementalQuerying:"prometheus-incremental-querying",queryOverlapWindow:"data-testid query overlap window",disableRecordingRules:"disable-recording-rules",customQueryParameters:"data-testid custom query parameters",httpMethod:"data-testid http method",exemplarsAddButton:"data-testid Add exemplar config button",internalLinkSwitch:"data-testid Internal link switch"},queryEditor:{explain:"data-testid prometheus explain switch wrapper",editorToggle:"data-testid QueryEditorModeToggle",options:"data-testid prometheus options",legend:"data-testid prometheus legend wrapper",format:"data-testid prometheus format",step:"prometheus-step",type:"data-testid prometheus type",exemplars:"prometheus-exemplars",builder:{metricSelect:"data-testid metric select",hints:"data-testid prometheus hints",metricsExplorer:"data-testid metrics explorer",queryAdvisor:"data-testid query advisor"},code:{queryField:"data-testid prometheus query field",metricsBrowser:{openButton:"data-testid open metrics browser",selectMetric:"data-testid select a metric",metricList:"data-testid metric list",labelNamesFilter:"data-testid label names filter",labelValuesFilter:"data-testid label values filter",useQuery:"data-testid use query",useAsRateQuery:"data-testid use as rate query",validateSelector:"data-testid validate selector",clear:"data-testid clear"}}},exemplarMarker:"data-testid Exemplar marker",variableQueryEditor:{queryType:"data-testid query type",labelnames:{metricRegex:"data-testid label names metric regex"},labelValues:{labelSelect:"data-testid label values label select"},metricNames:{metricRegex:"data-testid metric names metric regex"},varQueryResult:"data-testid variable query result",seriesQuery:"data-testid prometheus series query",classicQuery:"data-testid prometheus classic query"},annotations:{minStep:"prometheus-annotation-min-step",title:"data-testid prometheus annotation title",tags:"data-testid prometheus annotation tags",text:"data-testid prometheus annotation text",seriesValueAsTimestamp:"data-testid prometheus annotation series value as timestamp"}}},Menu:{MenuComponent:e=>`${e} menu`,MenuGroup:e=>`${e} menu group`,MenuItem:e=>`${e} menu item`,SubMenu:{container:"data-testid SubMenu container",icon:"data-testid SubMenu icon"}},Panels:{Panel:{title:e=>`data-testid Panel header ${e}`,headerItems:e=>`data-testid Panel header item ${e}`,menuItems:e=>`data-testid Panel menu item ${e}`,menu:e=>`data-testid Panel menu ${e}`,containerByTitle:e=>`${e} panel`,headerCornerInfo:e=>`Panel header ${e}`,status:e=>`data-testid Panel status ${e}`,loadingBar:()=>"Panel loading bar",HoverWidget:{container:"data-testid hover-header-container",dragIcon:"data-testid drag-icon"},PanelDataErrorMessage:"data-testid Panel data error message"},Visualization:{Graph:{container:"Graph container",VisualizationTab:{legendSection:"Legend section"},Legend:{legendItemAlias:e=>`gpl alias ${e}`,showLegendSwitch:"gpl show legend"},xAxis:{labels:()=>"div.flot-x-axis > div.flot-tick-label"}},BarGauge:{value:"Bar gauge value",valueV2:"data-testid Bar gauge value"},PieChart:{svgSlice:"data testid Pie Chart Slice"},Text:{container:()=>".markdown-html"},Table:{header:"table header",footer:"table-footer",body:"data-testid table body"}}},VizLegend:{seriesName:e=>`data-testid VizLegend series ${e}`},Drawer:{General:{title:e=>`Drawer title ${e}`,expand:"Drawer expand",contract:"Drawer contract",close:"data-testid Drawer close",rcContentWrapper:()=>".rc-drawer-content-wrapper",subtitle:"data-testid drawer subtitle"}},PanelEditor:{General:{content:"Panel editor content"},OptionsPane:{content:"Panel editor option pane content",select:"Panel editor option pane select",fieldLabel:e=>`${e} field property editor`},DataPane:{content:"Panel editor data pane content"},applyButton:"data-testid Apply changes and go back to dashboard",toggleVizPicker:"data-testid toggle-viz-picker",toggleVizOptions:"data-testid toggle-viz-options",toggleTableView:"toggle-table-view",showZoomField:"Map controls Show zoom control field property editor",showAttributionField:"Map controls Show attribution field property editor",showScaleField:"Map controls Show scale field property editor",showMeasureField:"Map controls Show measure tools field property editor",showDebugField:"Map controls Show debug field property editor",measureButton:"show measure tools"},PanelInspector:{Data:{content:"Panel inspector Data content"},Stats:{content:"Panel inspector Stats content"},Json:{content:"Panel inspector Json content"},Query:{content:"Panel inspector Query content",refreshButton:"Panel inspector Query refresh button",jsonObjectKeys:()=>".json-formatter-key"}},Tab:{title:e=>`Tab ${e}`,active:()=>'[class*="-activeTabStyle"]'},RefreshPicker:{runButton:"RefreshPicker run button",intervalButton:"RefreshPicker interval button",runButtonV2:"data-testid RefreshPicker run button",intervalButtonV2:"data-testid RefreshPicker interval button"},QueryTab:{content:"Query editor tab content",queryInspectorButton:"Query inspector button",queryHistoryButton:"data-testid query-history-button",addQuery:"data-testid query-tab-add-query"},QueryHistory:{queryText:"Query text"},QueryEditorRows:{rows:"Query editor row"},QueryEditorRow:{actionButton:e=>`data-testid ${e}`,title:e=>`Query editor row title ${e}`,container:e=>`Query editor row ${e}`},AlertTab:{content:"data-testid Alert editor tab content"},Alert:{alert:e=>`Alert ${e}`,alertV2:e=>`data-testid Alert ${e}`},TransformTab:{content:"data-testid Transform editor tab content",newTransform:e=>`data-testid New transform ${e}`,transformationEditor:e=>`data-testid Transformation editor ${e}`,transformationEditorDebugger:e=>`data-testid Transformation editor debugger ${e}`},Transforms:{card:e=>`data-testid New transform ${e}`,disableTransformationButton:"data-testid Disable transformation button",Reduce:{modeLabel:"data-testid Transform mode label",calculationsLabel:"data-testid Transform calculations label"},SpatialOperations:{actionLabel:"root Action field property editor",locationLabel:"root Location Mode field property editor",location:{autoOption:"Auto location option",coords:{option:"Coords location option",latitudeFieldLabel:"root Latitude field field property editor",longitudeFieldLabel:"root Longitude field field property editor"},geohash:{option:"Geohash location option",geohashFieldLabel:"root Geohash field field property editor"},lookup:{option:"Lookup location option",lookupFieldLabel:"root Lookup field field property editor",gazetteerFieldLabel:"root Gazetteer field property editor"}}},searchInput:"data-testid search transformations",noTransformationsMessage:"data-testid no transformations message",addTransformationButton:"data-testid add transformation button",removeAllTransformationsButton:"data-testid remove all transformations button"},NavBar:{Configuration:{button:"Configuration"},Toggle:{button:"data-testid Toggle menu"},Reporting:{button:"Reporting"}},NavMenu:{Menu:"data-testid navigation mega-menu",item:"data-testid Nav menu item"},NavToolbar:{container:"data-testid Nav toolbar"},PageToolbar:{container:()=>".page-toolbar",item:e=>`${e}`,itemButton:e=>`data-testid ${e}`},QueryEditorToolbarItem:{button:e=>`QueryEditor toolbar item button ${e}`},BackButton:{backArrow:"data-testid Go Back"},OptionsGroup:{group:e=>e?`Options group ${e}`:"Options group",toggle:e=>e?`Options group ${e} toggle`:"Options group toggle"},PluginVisualization:{item:e=>`Plugin visualization item ${e}`,current:()=>'[class*="-currentVisualizationItem"]'},Select:{option:"Select option",input:()=>'input[id*="time-options-input"]',singleValue:()=>'div[class*="-singleValue"]'},FieldConfigEditor:{content:"Field config editor content"},OverridesConfigEditor:{content:"Field overrides editor content"},FolderPicker:{container:"Folder picker select container",containerV2:"data-testid Folder picker select container",input:"data-testid folder-picker-input"},ReadonlyFolderPicker:{container:"data-testid Readonly folder picker select container"},DataSourcePicker:{container:"data-testid Data source picker select container",input:()=>'input[id="data-source-picker"]',inputV2:"data-testid Select a data source",dataSourceList:"data-testid Data source list dropdown",advancedModal:{dataSourceList:"data-testid Data source list",builtInDataSourceList:"data-testid Built in data source list"}},TimeZonePicker:{container:"Time zone picker select container",containerV2:"data-testid Time zone picker select container"},WeekStartPicker:{container:"Choose starting day of the week",containerV2:"data-testid Choose starting day of the week",placeholder:"Choose starting day of the week"},TraceViewer:{spanBar:"data-testid SpanBar--wrapper"},QueryField:{container:"data-testid Query field"},QueryBuilder:{queryPatterns:"data-testid Query patterns",labelSelect:"data-testid Select label",valueSelect:"data-testid Select value",matchOperatorSelect:"data-testid Select match operator"},ValuePicker:{button:e=>`data-testid Value picker button ${e}`,select:e=>`data-testid Value picker select ${e}`},Search:{section:"Search section",sectionV2:"data-testid Search section",items:"Search items",itemsV2:"data-testid Search items",cards:"data-testid Search cards",collapseFolder:e=>`data-testid Collapse folder ${e}`,expandFolder:e=>`data-testid Expand folder ${e}`,dashboardItem:e=>`${n.Search.dashboardItems} ${e}`,dashboardCard:e=>`data-testid Search card ${e}`,folderHeader:e=>`data-testid Folder header ${e}`,folderContent:e=>`data-testid Folder content ${e}`,dashboardItems:"data-testid Dashboard search item"},DashboardLinks:{container:"data-testid Dashboard link container",dropDown:"data-testid Dashboard link dropdown",link:"data-testid Dashboard link"},LoadingIndicator:{icon:"data-testid Loading indicator"},CallToActionCard:{button:e=>`Call to action button ${e}`,buttonV2:e=>`data-testid Call to action button ${e}`},DataLinksContextMenu:{singleLink:"data-testid Data link"},CodeEditor:{container:"data-testid Code editor container"},DashboardImportPage:{textarea:"data-testid-import-dashboard-textarea",submit:"data-testid-load-dashboard"},ImportDashboardForm:{name:"data-testid-import-dashboard-title",submit:"data-testid-import-dashboard-submit"},PanelAlertTabContent:{content:"data-testid Unified alert editor tab content"},VisualizationPreview:{card:e=>`data-testid suggestion-${e}`},ColorSwatch:{name:"data-testid-colorswatch"},DashboardRow:{title:e=>`data-testid dashboard-row-title-${e}`},UserProfile:{profileSaveButton:"data-testid-user-profile-save",preferencesSaveButton:"data-testid-shared-prefs-save",orgsTable:"data-testid-user-orgs-table",sessionsTable:"data-testid-user-sessions-table",extensionPointTabs:"data-testid-extension-point-tabs",extensionPointTab:e=>`data-testid-extension-point-tab-${e}`},FileUpload:{inputField:"data-testid-file-upload-input-field",fileNameSpan:"data-testid-file-upload-file-name"},DebugOverlay:{wrapper:"debug-overlay"},OrgRolePicker:{input:"Role"},AnalyticsToolbarButton:{button:"Dashboard insights"},Variables:{variableOption:"data-testid variable-option"},Annotations:{annotationsTypeInput:"annotations-type-input",annotationsChoosePanelInput:"choose-panels-input"},Tooltip:{container:"data-testid tooltip"}},i={pages:{Login:{url:"/login",username:"data-testid Username input field",password:"data-testid Password input field",submit:"data-testid Login button",skip:"data-testid Skip change password button"},Home:{url:"/"},DataSource:{name:"data-testid Data source settings page name input field",delete:"Data source settings page Delete button",readOnly:"data-testid Data source settings page read only message",saveAndTest:"data-testid Data source settings page Save and Test button",alert:"data-testid Data source settings page Alert"},DataSources:{url:"/datasources",dataSources:e=>`Data source list item ${e}`},EditDataSource:{url:e=>`/datasources/edit/${e}`,settings:"Datasource settings page basic settings"},AddDataSource:{url:"/datasources/new",dataSourcePlugins:e=>`Data source plugin item ${e}`,dataSourcePluginsV2:e=>`Add new data source ${e}`},ConfirmModal:{delete:"data-testid Confirm Modal Danger Button"},AddDashboard:{url:"/dashboard/new",itemButton:e=>`data-testid ${e}`,addNewPanel:"Add new panel",addNewRow:"Add new row",addNewPanelLibrary:"Add new panel from panel library"},Dashboard:{url:e=>`/d/${e}`,DashNav:{nav:"Dashboard navigation",navV2:"data-testid Dashboard navigation",publicDashboardTag:"data-testid public dashboard tag",shareButton:"data-testid share-button"},SubMenu:{submenu:"Dashboard submenu",submenuItem:"data-testid template variable",submenuItemLabels:e=>`data-testid Dashboard template variables submenu Label ${e}`,submenuItemValueDropDownValueLinkTexts:e=>`data-testid Dashboard template variables Variable Value DropDown value link text ${e}`,submenuItemValueDropDownDropDown:"Variable options",submenuItemValueDropDownOptionTexts:e=>`data-testid Dashboard template variables Variable Value DropDown option text ${e}`,Annotations:{annotationsWrapper:"data-testid annotation-wrapper",annotationLabel:e=>`data-testid Dashboard annotations submenu Label ${e}`,annotationToggle:e=>`data-testid Dashboard annotations submenu Toggle ${e}`}},Settings:{Actions:{close:"data-testid dashboard-settings-close"},General:{deleteDashBoard:"Dashboard settings page delete dashboard button",sectionItems:e=>`Dashboard settings section item ${e}`,saveDashBoard:"Dashboard settings aside actions Save button",saveAsDashBoard:"Dashboard settings aside actions Save As button",timezone:"Time zone picker select container",title:"Tab General"},Annotations:{List:{addAnnotationCTA:n.CallToActionCard.button("Add annotation query"),addAnnotationCTAV2:n.CallToActionCard.buttonV2("Add annotation query"),annotations:"data-testid list-annotations"},Settings:{name:"Annotations settings name input"},NewAnnotation:{panelFilterSelect:"data-testid annotations-panel-filter",showInLabel:"show-in-label",previewInDashboard:"data-testid annotations-preview",delete:"data-testid annotations-delete",apply:"data-testid annotations-apply",enable:"data-testid annotation-enable",hide:"data-testid annotation-hide"}},Variables:{List:{addVariableCTA:n.CallToActionCard.button("Add variable"),addVariableCTAV2:n.CallToActionCard.buttonV2("Add variable"),newButton:"Variable editor New variable button",table:"Variable editor Table",tableRowNameFields:e=>`Variable editor Table Name field ${e}`,tableRowDefinitionFields:e=>`Variable editor Table Definition field ${e}`,tableRowArrowUpButtons:e=>`Variable editor Table ArrowUp button ${e}`,tableRowArrowDownButtons:e=>`Variable editor Table ArrowDown button ${e}`,tableRowDuplicateButtons:e=>`Variable editor Table Duplicate button ${e}`,tableRowRemoveButtons:e=>`Variable editor Table Remove button ${e}`},Edit:{General:{headerLink:"Variable editor Header link",modeLabelNew:"Variable editor Header mode New",modeLabelEdit:"Variable editor Header mode Edit",generalNameInput:"Variable editor Form Name field",generalNameInputV2:"data-testid Variable editor Form Name field",generalTypeSelect:"Variable editor Form Type select",generalTypeSelectV2:"data-testid Variable editor Form Type select",generalLabelInput:"Variable editor Form Label field",generalLabelInputV2:"data-testid Variable editor Form Label field",generalHideSelect:"Variable editor Form Hide select",generalHideSelectV2:"data-testid Variable editor Form Hide select",selectionOptionsMultiSwitch:"data-testid Variable editor Form Multi switch",selectionOptionsIncludeAllSwitch:"data-testid Variable editor Form IncludeAll switch",selectionOptionsCustomAllInput:"data-testid Variable editor Form IncludeAll field",previewOfValuesOption:"data-testid Variable editor Preview of Values option",submitButton:"data-testid Variable editor Run Query button",applyButton:"data-testid Variable editor Apply button"},QueryVariable:{queryOptionsDataSourceSelect:n.DataSourcePicker.inputV2,queryOptionsRefreshSelect:"Variable editor Form Query Refresh select",queryOptionsRefreshSelectV2:"data-testid Variable editor Form Query Refresh select",queryOptionsRegExInput:"Variable editor Form Query RegEx field",queryOptionsRegExInputV2:"data-testid Variable editor Form Query RegEx field",queryOptionsSortSelect:"Variable editor Form Query Sort select",queryOptionsSortSelectV2:"data-testid Variable editor Form Query Sort select",queryOptionsQueryInput:"data-testid Variable editor Form Default Variable Query Editor textarea",valueGroupsTagsEnabledSwitch:"Variable editor Form Query UseTags switch",valueGroupsTagsTagsQueryInput:"Variable editor Form Query TagsQuery field",valueGroupsTagsTagsValuesQueryInput:"Variable editor Form Query TagsValuesQuery field"},ConstantVariable:{constantOptionsQueryInput:"Variable editor Form Constant Query field",constantOptionsQueryInputV2:"data-testid Variable editor Form Constant Query field"},DatasourceVariable:{datasourceSelect:"data-testid datasource variable datasource type"},TextBoxVariable:{textBoxOptionsQueryInput:"Variable editor Form TextBox Query field",textBoxOptionsQueryInputV2:"data-testid Variable editor Form TextBox Query field"},CustomVariable:{customValueInput:"data-testid custom-variable-input"},IntervalVariable:{intervalsValueInput:"data-testid interval variable intervals input",autoEnabledCheckbox:"data-testid interval variable auto value checkbox",stepCountIntervalSelect:"data-testid interval variable step count input",minIntervalInput:"data-testid interval variable mininum interval input"},GroupByVariable:{dataSourceSelect:n.DataSourcePicker.inputV2,infoText:"data-testid group by variable info text",modeToggle:"data-testid group by variable mode toggle"},AdHocFiltersVariable:{datasourceSelect:n.DataSourcePicker.inputV2,infoText:"data-testid ad-hoc filters variable info text"}}}},Annotations:{marker:"data-testid annotation-marker"},Rows:{Repeated:{ConfigSection:{warningMessage:"data-testid Repeated rows warning message"}}}},Dashboards:{url:"/dashboards",dashboards:e=>`Dashboard search item ${e}`},SaveDashboardAsModal:{newName:"Save dashboard title field",save:"Save dashboard button"},SaveDashboardModal:{save:"Dashboard settings Save Dashboard Modal Save button",saveVariables:"Dashboard settings Save Dashboard Modal Save variables checkbox",saveTimerange:"Dashboard settings Save Dashboard Modal Save timerange checkbox"},SharePanelModal:{linkToRenderedImage:"Link to rendered image"},ShareDashboardModal:{PublicDashboard:{Tab:"Tab Public dashboard",WillBePublicCheckbox:"data-testid public dashboard will be public checkbox",LimitedDSCheckbox:"data-testid public dashboard limited datasources checkbox",CostIncreaseCheckbox:"data-testid public dashboard cost may increase checkbox",PauseSwitch:"data-testid public dashboard pause switch",EnableAnnotationsSwitch:"data-testid public dashboard on off switch for annotations",CreateButton:"data-testid public dashboard create button",DeleteButton:"data-testid public dashboard delete button",CopyUrlInput:"data-testid public dashboard copy url input",CopyUrlButton:"data-testid public dashboard copy url button",SettingsDropdown:"data-testid public dashboard settings dropdown",TemplateVariablesWarningAlert:"data-testid public dashboard disabled template variables alert",UnsupportedDataSourcesWarningAlert:"data-testid public dashboard unsupported data sources alert",NoUpsertPermissionsWarningAlert:"data-testid public dashboard no upsert permissions alert",EnableTimeRangeSwitch:"data-testid public dashboard on off switch for time range",EmailSharingConfiguration:{Container:"data-testid email sharing config container",ShareType:"data-testid public dashboard share type",EmailSharingInput:"data-testid public dashboard email sharing input",EmailSharingInviteButton:"data-testid public dashboard email sharing invite button",EmailSharingList:"data-testid public dashboard email sharing list",DeleteEmail:"data-testid public dashboard delete email button",ReshareLink:"data-testid public dashboard reshare link button"}}},PublicDashboard:{page:"public-dashboard-page",NotAvailable:{container:"public-dashboard-not-available",title:"public-dashboard-title",pausedDescription:"public-dashboard-paused-description"}},RequestViewAccess:{form:"request-view-access-form",recipientInput:"request-view-access-recipient-input",submitButton:"request-view-access-submit-button"},PublicDashboardConfirmAccess:{submitButton:"data-testid confirm-access-submit-button"},Explore:{url:"/explore",General:{container:"data-testid Explore",graph:"Explore Graph",table:"Explore Table",scrollView:"data-testid explorer scroll view"}},SoloPanel:{url:e=>`/d-solo/${e}`},PluginsList:{page:"Plugins list page",list:"Plugins list",listItem:"Plugins list item",signatureErrorNotice:"data-testid Unsigned plugins notice"},PluginPage:{page:"Plugin page",signatureInfo:"data-testid Plugin signature info",disabledInfo:"data-testid Plugin disabled info"},PlaylistForm:{name:"Playlist name",interval:"Playlist interval",itemDelete:"data-testid playlist-form-delete-item"},BrowseDashboards:{table:{body:"data-testid browse-dashboards-table",row:e=>`data-testid browse dashboards row ${e}`,checkbox:e=>`data-testid ${e} checkbox`},NewFolderForm:{form:"data-testid new folder form",nameInput:"data-testid new-folder-name-input",createButton:"data-testid new-folder-create-button"}},Search:{url:"/?search=openn",FolderView:{url:"/?search=open&layout=folders"}},PublicDashboards:{ListItem:{linkButton:"public-dashboard-link-button",configButton:"public-dashboard-configuration-button",trashcanButton:"public-dashboard-remove-button",pauseSwitch:"data-testid public dashboard pause switch"}},UserListPage:{tabs:{allUsers:"data-testid all-users-tab",orgUsers:"data-testid org-users-tab",anonUserDevices:"data-testid anon-user-devices-tab",publicDashboardsUsers:"data-testid public-dashboards-users-tab",users:"data-testid users-tab"},org:{url:"/org/users"},admin:{url:"/admin/users"},publicDashboards:{container:"data-testid public-dashboards-users-list"},UserListAdminPage:{container:"data-testid user-list-admin-page"},UsersListPage:{container:"data-testid users-list-page"},UserAnonListPage:{container:"data-testid user-anon-list-page"},UsersListPublicDashboardsPage:{container:"data-testid users-list-public-dashboards-page",DashboardsListModal:{listItem:e=>`data-testid dashboards-list-item-${e}`}}},ProfilePage:{url:"/profile"}},components:n}},3890:(e,t,r)=>{"use strict";r.d(t,{x:()=>n});const n="Error"},1717:(e,t,r)=>{"use strict";r.d(t,{y:()=>n});const n="unknown"},9402:(e,t,r)=>{"use strict";r.d(t,{H:()=>a});var n=r(8964),i=r(8578);class a{constructor(){this.unpatchedConsole=i.Z,this.internalLogger=n.vc,this.config={},this.metas={}}logDebug(...e){this.internalLogger.debug(`${this.name}\n`,...e)}logInfo(...e){this.internalLogger.info(`${this.name}\n`,...e)}logWarn(...e){this.internalLogger.warn(`${this.name}\n`,...e)}logError(...e){this.internalLogger.error(`${this.name}\n`,...e)}}},5004:(e,t,r)=>{"use strict";r.d(t,{J:()=>n});const n="undefined"!=typeof globalThis?globalThis:void 0!==r.g?r.g:"undefined"!=typeof self?self:void 0},8964:(e,t,r)=>{"use strict";r.d(t,{vI:()=>o,vc:()=>a,wK:()=>n});var n,i=r(8203);!function(e){e[e.OFF=0]="OFF",e[e.ERROR=1]="ERROR",e[e.WARN=2]="WARN",e[e.INFO=3]="INFO",e[e.VERBOSE=4]="VERBOSE"}(n||(n={}));const a={debug:i.l,error:i.l,info:i.l,prefix:"Faro",warn:i.l},o=n.ERROR},9552:(e,t,r)=>{"use strict";r.d(t,{rI:()=>o,N2:()=>a});var n=r(5004);const i="_faroInternal";function a(e){e.config.isolate?e.internalLogger.debug("Skipping registering internal Faro instance on global object"):(e.internalLogger.debug("Registering internal Faro instance on global object"),Object.defineProperty(n.J,i,{configurable:!1,enumerable:!1,writable:!1,value:e}))}function o(){return i in n.J}},259:(e,t,r)=>{"use strict";r.d(t,{P:()=>a,A:()=>o});var n=r(5004);var i=r(9552);let a={};function o(e,t,r,o,s,l,u){return t.debug("Initializing Faro"),a={api:l,config:r,instrumentations:u,internalLogger:t,metas:o,pause:s.pause,transports:s,unpatchedConsole:e,unpause:s.unpause},(0,i.N2)(a),function(e){if(e.config.preventGlobalExposure)e.internalLogger.debug("Skipping registering public Faro instance in the global scope");else{if(e.internalLogger.debug(`Registering public faro reference in the global scope using "${e.config.globalObjectKey}" key`),e.config.globalObjectKey in n.J)return void e.internalLogger.warn(`Skipping global registration due to key "${e.config.globalObjectKey}" being used already. Please set "globalObjectKey" to something else or set "preventGlobalExposure" to "true"`);Object.defineProperty(n.J,e.config.globalObjectKey,{configurable:!1,writable:!1,value:e})}}(a),a}},8578:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});const n=Object.assign({},console)},9607:(e,t,r)=>{"use strict";function n(){return Date.now()}function i(){return(new Date).toISOString()}function a(e){return new Date(e).toISOString()}r.d(t,{mI:()=>i,q5:()=>a,x3:()=>n})},2019:(e,t,r)=>{"use strict";function n(e,t){return typeof e===t}function i(e,t){return Object.prototype.toString.call(e)===`[object ${t}]`}function a(e,t){try{return e instanceof t}catch(e){return!1}}r.d(t,{Ed:()=>n,Et:()=>l,Gv:()=>u,Kg:()=>s,T2:()=>v,Tn:()=>c,bJ:()=>g,cy:()=>d,kZ:()=>o,pp:()=>y,sO:()=>h,wX:()=>b,xH:()=>f});const o=e=>n(e,"null"),s=e=>n(e,"string"),l=e=>n(e,"number")&&!isNaN(e)||n(e,"bigint"),u=e=>!o(e)&&n(e,"object"),c=e=>n(e,"function"),d=e=>i(e,"Array"),h=e=>!u(e)&&!c(e),p="undefined"!=typeof Event,f=e=>p&&a(e,Event),m="undefined"!=typeof Error,g=e=>m&&a(e,Error),v=e=>i(e,"ErrorEvent"),y=e=>i(e,"DOMError"),b=e=>i(e,"DOMException")},5438:(e,t,r)=>{"use strict";var n;r.d(t,{$b:()=>n,HT:()=>a,Ic:()=>i}),function(e){e.TRACE="trace",e.DEBUG="debug",e.INFO="info",e.LOG="log",e.WARN="warn",e.ERROR="error"}(n||(n={}));const i=n.LOG,a=[n.TRACE,n.DEBUG,n.INFO,n.LOG,n.WARN,n.ERROR]},8203:(e,t,r)=>{"use strict";function n(){}r.d(t,{l:()=>n})},152:(e,t,r)=>{"use strict";r.d(t,{S:()=>i});const n="abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ0123456789";function i(e=10){return Array.from(Array(e)).map((()=>n[Math.floor(Math.random()*n.length)])).join("")}},1685:(e,t,r)=>{"use strict";r.d(t,{x:()=>n});const n="1.10.0"},4812:(e,t,r)=>{"use strict";r.d(t,{w:()=>er});var n=r(9402);class i extends n.H{constructor(){super(...arguments),this.api={},this.transports={}}}var a=r(1685),o=r(2019);const s="DOMError",l="DOMException",u="Non-Error exception captured with keys:",c=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;var d=r(4151);function h(e){let t,r,n,i,a=[];if((0,o.T2)(e)&&e.error)t=e.error.message,r=e.error.name,a=(0,d.D)(e.error);else if((n=(0,o.pp)(e))||(0,o.wX)(e)){const{name:i,message:a}=e;r=null!=i?i:n?s:l,t=a?`${r}: ${a}`:r}else(0,o.bJ)(e)?(t=e.message,a=(0,d.D)(e)):((0,o.Gv)(e)||(i=(0,o.xH)(e)))&&(r=i?e.constructor.name:void 0,t=`${u} ${Object.keys(e)}`);return[t,r,a]}var p=r(3890);var f=r(3867);function m(e){const t=window.onerror;window.onerror=(...r)=>{try{const[t,n,i,a,s]=r;let l,u,d=[];const m=(0,o.Kg)(t),g=(0,f.S)(n,"?",i,a);s||!m?([l,u,d]=h(null!=s?s:t),0===d.length&&(d=[g])):m&&([l,u]=function(e){var t,r;const n=e.match(c),i=null!==(t=null==n?void 0:n[1])&&void 0!==t?t:p.x;return[null!==(r=null==n?void 0:n[2])&&void 0!==r?r:e,i]}(t),d=[g]),l&&e.pushError(new Error(l),{type:u,stackFrames:d})}finally{null==t||t.apply(window,r)}}}class g extends i{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-errors",this.version=a.x}initialize(){var e;this.logDebug("Initializing"),m(this.api),e=this.api,window.addEventListener("unhandledrejection",(t=>{var r,n;let i,a,s=t;s.reason?s=t.reason:(null===(r=t.detail)||void 0===r?void 0:r.reason)&&(s=null===(n=t.detail)||void 0===n?void 0:n.reason);let l=[];(0,o.sO)(s)?(i=`Non-Error promise rejection captured with value: ${String(s)}`,a="UnhandledRejection"):[i,a,l]=h(s),i&&e.pushError(new Error(i),{type:a,stackFrames:l})}))}}var v,y,b,w,S,x=-1,O=function(e){addEventListener("pageshow",(function(t){t.persisted&&(x=t.timeStamp,e(t))}),!0)},_=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart=0?n="back-forward-cache":r&&(document.prerendering||E()>0?n="prerender":document.wasDiscarded?n="restore":r.type&&(n=r.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:n}},C=function(e,t,r){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var n=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return n.observe(Object.assign({type:e,buffered:!0},r||{})),n}}catch(e){}},T=function(e,t,r,n){var i,a;return function(o){t.value>=0&&(o||n)&&((a=t.value-(i||0))||void 0===i)&&(i=t.value,t.delta=a,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,r),e(t))}},A=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},R=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},D=function(e){var t=!1;return function(){t||(e(),t=!0)}},P=-1,j=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},I=function(e){"hidden"===document.visibilityState&&P>-1&&(P="visibilitychange"===e.type?e.timeStamp:0,M())},L=function(){addEventListener("visibilitychange",I,!0),addEventListener("prerenderingchange",I,!0)},M=function(){removeEventListener("visibilitychange",I,!0),removeEventListener("prerenderingchange",I,!0)},N=function(){return P<0&&(P=j(),L(),O((function(){setTimeout((function(){P=j(),L()}),0)}))),{get firstHiddenTime(){return P}}},F=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},V=[1800,3e3],z=function(e,t){t=t||{},F((function(){var r,n=N(),i=k("FCP"),a=C("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(a.disconnect(),e.startTimet.latency){if(r)e.duration>r.latency?(r.entries=[e],r.latency=e.duration):e.duration===r.latency&&e.startTime===r.entries[0].startTime&&r.entries.push(e);else{var n={id:e.interactionId,latency:e.duration,entries:[e]};Q.set(n.id,n),G.push(n)}G.sort((function(e,t){return t.latency-e.latency})),G.length>10&&G.splice(10).forEach((function(e){return Q.delete(e.id)}))}}},Z=function(e){var t=self.requestIdleCallback||self.setTimeout,r=-1;return e=D(e),"hidden"===document.visibilityState?e():(r=t(e),R(e)),r},ee=[200,500],te=[2500,4e3],re={},ne=[800,1800],ie=function e(t){document.prerendering?F((function(){return e(t)})):"complete"!==document.readyState?addEventListener("load",(function(){return e(t)}),!0):setTimeout(t,0)},ae={passive:!0,capture:!0},oe=new Date,se=function(e,t){y||(y=t,b=e,w=new Date,ce(removeEventListener),le())},le=function(){if(b>=0&&b1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var r=function(){se(e,t),i()},n=function(){i()},i=function(){removeEventListener("pointerup",r,ae),removeEventListener("pointercancel",n,ae)};addEventListener("pointerup",r,ae),addEventListener("pointercancel",n,ae)}(t,e):se(t,e)}},ce=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,ue,ae)}))},de=[100,300];class he{constructor(e){this.pushMeasurement=e}initialize(){Object.entries(he.mapping).forEach((([e,t])=>{t((t=>{this.pushMeasurement({type:"web-vitals",values:{[e]:t.value}})}))}))}}he.mapping={cls:function(e,t){t=t||{},z(D((function(){var r,n=k("CLS",0),i=0,a=[],o=function(e){e.forEach((function(e){if(!e.hadRecentInput){var t=a[0],r=a[a.length-1];i&&e.startTime-r.startTime<1e3&&e.startTime-t.startTime<5e3?(i+=e.value,a.push(e)):(i=e.value,a=[e])}})),i>n.value&&(n.value=i,n.entries=a,r())},s=C("layout-shift",o);s&&(r=T(e,n,B,t.reportAllChanges),R((function(){o(s.takeRecords()),r(!0)})),O((function(){i=0,n=k("CLS",0),r=T(e,n,B,t.reportAllChanges),A((function(){return r()}))})),setTimeout(r,0))})))},fcp:z,fid:function(e,t){t=t||{},F((function(){var r,n=N(),i=k("FID"),a=function(e){e.startTime0&&e.responseStart(t||100)-1)return r||i;if(r=r?i+">"+r:i,n.id)break;e=n.parentNode}}catch(e){}return r},we=-1,Se=function(){return we},xe=function(e){addEventListener("pageshow",(function(t){t.persisted&&(we=t.timeStamp,e(t))}),!0)},Oe=function(){var e=ge();return e&&e.activationStart||0},_e=function(e,t){var r=ge(),n="navigate";return Se()>=0?n="back-forward-cache":r&&(document.prerendering||Oe()>0?n="prerender":document.wasDiscarded?n="restore":r.type&&(n=r.type.replace(/_/g,"-"))),{name:e,value:void 0===t?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:n}},Ee=function(e,t,r){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var n=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return n.observe(Object.assign({type:e,buffered:!0},r||{})),n}}catch(e){}},ke=function(e,t,r,n){var i,a;return function(o){t.value>=0&&(o||n)&&((a=t.value-(i||0))||void 0===i)&&(i=t.value,t.delta=a,t.rating=function(e,t){return e>t[1]?"poor":e>t[0]?"needs-improvement":"good"}(t.value,r),e(t))}},Ce=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},Te=function(e){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e()}))},Ae=function(e){var t=!1;return function(){t||(e(),t=!0)}},Re=-1,De=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},Pe=function(e){"hidden"===document.visibilityState&&Re>-1&&(Re="visibilitychange"===e.type?e.timeStamp:0,Ie())},je=function(){addEventListener("visibilitychange",Pe,!0),addEventListener("prerenderingchange",Pe,!0)},Ie=function(){removeEventListener("visibilitychange",Pe,!0),removeEventListener("prerenderingchange",Pe,!0)},Le=function(){return Re<0&&(Re=De(),je(),xe((function(){setTimeout((function(){Re=De(),je()}),0)}))),{get firstHiddenTime(){return Re}}},Me=function(e){document.prerendering?addEventListener("prerenderingchange",(function(){return e()}),!0):e()},Ne=[1800,3e3],Fe=function(e,t){t=t||{},Me((function(){var r,n=Le(),i=_e("FCP"),a=Ee("paint",(function(e){e.forEach((function(e){"first-contentful-paint"===e.name&&(a.disconnect(),e.startTimet.latency){if(r)e.duration>r.latency?(r.entries=[e],r.latency=e.duration):e.duration===r.latency&&e.startTime===r.entries[0].startTime&&r.entries.push(e);else{var n={id:e.interactionId,latency:e.duration,entries:[e]};He.set(n.id,n),qe.push(n)}qe.sort((function(e,t){return t.latency-e.latency})),qe.length>10&&qe.splice(10).forEach((function(e){return He.delete(e.id)}))}}},Ke=function(e){var t=self.requestIdleCallback||self.setTimeout,r=-1;return e=Ae(e),"hidden"===document.visibilityState?e():(r=t(e),Te(e)),r},Xe=[200,500],Je=function(e,t){"PerformanceEventTiming"in self&&"interactionId"in PerformanceEventTiming.prototype&&(t=t||{},Me((function(){var r;"interactionCount"in performance||pe||(pe=Ee("event",Ue,{type:"event",buffered:!0,durationThreshold:0}));var n,i=_e("INP"),a=function(e){Ke((function(){e.forEach(Qe);var t,r=(t=Math.min(qe.length-1,Math.floor(((pe?ze:performance.interactionCount||0)-We)/50)),qe[t]);r&&r.latency!==i.value&&(i.value=r.latency,i.entries=r.entries,n())}))},o=Ee("event",a,{durationThreshold:null!==(r=t.durationThreshold)&&void 0!==r?r:40});n=ke(e,i,Xe,t.reportAllChanges),o&&(o.observe({type:"first-input",buffered:!0}),Te((function(){a(o.takeRecords()),n(!0)})),xe((function(){We=0,qe.length=0,He.clear(),i=_e("INP"),n=ke(e,i,Xe,t.reportAllChanges)})))})))},Ye=[],Ze=[],et=new WeakMap,tt=new Map,rt=-1,nt=function(e){Ye=Ye.concat(e),it()},it=function(){rt<0&&(rt=Ke(at))},at=function(){tt.size>10&&tt.forEach((function(e,t){He.has(t)||tt.delete(t)}));var e=qe.map((function(e){return et.get(e.entries[0])})),t=Ze.length-50;Ze=Ze.filter((function(r,n){return n>=t||e.includes(r)}));for(var r=new Set,n=0;n=0;n--){var i=Ze[n];if(Math.abs(r-i.renderTime)<=8){(t=i).startTime=Math.min(e.startTime,t.startTime),t.processingStart=Math.min(e.processingStart,t.processingStart),t.processingEnd=Math.max(e.processingEnd,t.processingEnd),t.entries.push(e);break}}t||(t={startTime:e.startTime,processingStart:e.processingStart,processingEnd:e.processingEnd,renderTime:r,entries:[e]},Ze.push(t)),(e.interactionId||"first-input"===e.entryType)&&et.set(e,t),it()}));var ot,st,lt,ut,ct=function(e,t){for(var r,n=[],i=0;r=Ye[i];i++)if(!(r.startTime+r.durationt)break;n.push(r)}return n},dt=[2500,4e3],ht={},pt=[800,1800],ft=function e(t){document.prerendering?Me((function(){return e(t)})):"complete"!==document.readyState?addEventListener("load",(function(){return e(t)}),!0):setTimeout(t,0)},mt=function(e,t){t=t||{};var r=_e("TTFB"),n=ke(e,r,pt,t.reportAllChanges);ft((function(){var i=ge();i&&(r.value=Math.max(i.responseStart-Oe(),0),r.entries=[i],n(!0),xe((function(){r=_e("TTFB",0),(n=ke(e,r,pt,t.reportAllChanges))(!0)})))}))},gt={passive:!0,capture:!0},vt=new Date,yt=function(e,t){ot||(ot=t,st=e,lt=new Date,St(removeEventListener),bt())},bt=function(){if(st>=0&&st1e12?new Date:performance.now())-e.timeStamp;"pointerdown"==e.type?function(e,t){var r=function(){yt(e,t),i()},n=function(){i()},i=function(){removeEventListener("pointerup",r,gt),removeEventListener("pointercancel",n,gt)};addEventListener("pointerup",r,gt),addEventListener("pointercancel",n,gt)}(t,e):yt(t,e)}},St=function(e){["mousedown","keydown","touchstart","pointerdown"].forEach((function(t){return e(t,wt,gt)}))},xt=[100,300],Ot=function(e,t){!function(e,t){t=t||{},Me((function(){var r,n=Le(),i=_e("FID"),a=function(e){e.startTimen.value&&(n.value=i,n.entries=a,r())},s=Ee("layout-shift",o);s&&(r=ke(e,n,Ve,t.reportAllChanges),Te((function(){o(s.takeRecords()),r(!0)})),xe((function(){i=0,n=_e("CLS",0),r=ke(e,n,Ve,t.reportAllChanges),Ce((function(){return r()}))})),setTimeout(r,0))})))}((function(t){var r=function(e){var t,r={};if(e.entries.length){var n=e.entries.reduce((function(e,t){return e&&e.value>t.value?e:t}));if(n&&n.sources&&n.sources.length){var i=(t=n.sources).find((function(e){return e.node&&1===e.node.nodeType}))||t[0];i&&(r={largestShiftTarget:be(i.node),largestShiftTime:n.startTime,largestShiftValue:n.value,largestShiftSource:i,largestShiftEntry:n,loadState:ve(n.startTime)})}}return Object.assign(e,{attribution:r})}(t);e(r)}),t)}((e=>{const{loadState:t,largestShiftValue:r,largestShiftTime:n,largestShiftTarget:i}=e.attribution,a=this.buildInitialValues(e);this.addIfPresent(a,"largest_shift_value",r),this.addIfPresent(a,"largest_shift_time",n);const o=this.buildInitialContext(e);this.addIfPresent(o,Ct,t),this.addIfPresent(o,"largest_shift_target",i),this.pushMeasurement(a,o)}))}measureFCP(){!function(e,t){Fe((function(t){var r=function(e){var t={timeToFirstByte:0,firstByteToFCP:e.value,loadState:ve(Se())};if(e.entries.length){var r=ge(),n=e.entries[e.entries.length-1];if(r){var i=r.activationStart||0,a=Math.max(0,r.responseStart-i);t={timeToFirstByte:a,firstByteToFCP:e.value-a,loadState:ve(e.entries[0].startTime),navigationEntry:r,fcpEntry:n}}}return Object.assign(e,{attribution:t})}(t);e(r)}),t)}((e=>{const{firstByteToFCP:t,timeToFirstByte:r,loadState:n}=e.attribution,i=this.buildInitialValues(e);this.addIfPresent(i,"first_byte_to_fcp",t),this.addIfPresent(i,Tt,r);const a=this.buildInitialContext(e);this.addIfPresent(a,Ct,n),this.pushMeasurement(i,a)}))}measureFID(){Ot((e=>{const{eventTime:t,eventTarget:r,eventType:n,loadState:i}=e.attribution,a=this.buildInitialValues(e);this.addIfPresent(a,"event_time",t);const o=this.buildInitialContext(e);this.addIfPresent(o,"event_target",r),this.addIfPresent(o,"event_type",n),this.addIfPresent(o,Ct,i),this.pushMeasurement(a,o)}))}measureINP(){!function(e,t){fe||(fe=Ee("long-animation-frame",nt)),Je((function(t){var r=function(e){var t=e.entries[0],r=et.get(t),n=t.processingStart,i=r.processingEnd,a=r.entries.sort((function(e,t){return e.processingStart-t.processingStart})),o=ct(t.startTime,i),s=e.entries.find((function(e){return e.target})),l=s&&s.target||tt.get(t.interactionId),u=[t.startTime+t.duration,i].concat(o.map((function(e){return e.startTime+e.duration}))),c=Math.max.apply(Math,u),d={interactionTarget:be(l),interactionTargetElement:l,interactionType:t.name.startsWith("key")?"keyboard":"pointer",interactionTime:t.startTime,nextPaintTime:c,processedEventEntries:a,longAnimationFrameEntries:o,inputDelay:n-t.startTime,processingDuration:i-n,presentationDelay:Math.max(c-i,0),loadState:ve(t.startTime)};return Object.assign(e,{attribution:d})}(t);e(r)}),t)}((e=>{const{interactionTime:t,presentationDelay:r,inputDelay:n,processingDuration:i,nextPaintTime:a,loadState:o,interactionTarget:s,interactionType:l}=e.attribution,u=this.buildInitialValues(e);this.addIfPresent(u,"interaction_time",t),this.addIfPresent(u,"presentation_delay",r),this.addIfPresent(u,"input_delay",n),this.addIfPresent(u,"processing_duration",i),this.addIfPresent(u,"next_paint_time",a);const c=this.buildInitialContext(e);this.addIfPresent(c,Ct,o),this.addIfPresent(c,"interaction_target",s),this.addIfPresent(c,"interaction_type",l),this.pushMeasurement(u,c)}))}measureLCP(){!function(e,t){!function(e,t){t=t||{},Me((function(){var r,n=Le(),i=_e("LCP"),a=function(e){t.reportAllChanges||(e=e.slice(-1)),e.forEach((function(e){e.startTime{const{elementRenderDelay:t,resourceLoadDelay:r,resourceLoadDuration:n,timeToFirstByte:i,element:a}=e.attribution,o=this.buildInitialValues(e);this.addIfPresent(o,"element_render_delay",t),this.addIfPresent(o,"resource_load_delay",r),this.addIfPresent(o,"resource_load_duration",n),this.addIfPresent(o,Tt,i);const s=this.buildInitialContext(e);this.addIfPresent(s,"element",a),this.pushMeasurement(o,s)}))}measureTTFB(){!function(e,t){mt((function(t){var r=function(e){var t={waitingDuration:0,cacheDuration:0,dnsDuration:0,connectionDuration:0,requestDuration:0};if(e.entries.length){var r=e.entries[0],n=r.activationStart||0,i=Math.max((r.workerStart||r.fetchStart)-n,0),a=Math.max(r.domainLookupStart-n,0),o=Math.max(r.connectStart-n,0),s=Math.max(r.connectEnd-n,0);t={waitingDuration:i,cacheDuration:a-i,dnsDuration:o-a,connectionDuration:s-o,requestDuration:e.value-s,navigationEntry:r}}return Object.assign(e,{attribution:t})}(t);e(r)}),t)}((e=>{const{dnsDuration:t,connectionDuration:r,requestDuration:n,waitingDuration:i,cacheDuration:a}=e.attribution,o=this.buildInitialValues(e);this.addIfPresent(o,"dns_duration",t),this.addIfPresent(o,"connection_duration",r),this.addIfPresent(o,"request_duration",n),this.addIfPresent(o,"waiting_duration",i),this.addIfPresent(o,"cache_duration",a);const s=this.buildInitialContext(e);this.pushMeasurement(o,s)}))}buildInitialValues(e){const t=e.name.toLowerCase();return{[t]:e.value,delta:e.delta}}buildInitialContext(e){var t;const r=null!==(t=(0,Et.Gq)(kt,Et.Uy.session))&&void 0!==t?t:_t.y;return{id:e.id,rating:e.rating,navigation_type:e.navigationType,navigation_entry_id:r}}pushMeasurement(e,t){this.corePushMeasurement({type:"web-vitals",values:e},{context:t})}addIfPresent(e,t,r){r&&(e[t]=r)}}class Rt extends i{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-web-vitals",this.version=a.x}initialize(){this.logDebug("Initializing");this.intializeWebVitalsInstrumentation().initialize()}intializeWebVitalsInstrumentation(){return this.config.trackWebVitalsAttribution?new At(this.api.pushMeasurement):new he(this.api.pushMeasurement)}}const Dt="session_start",Pt="session_resume";var jt=r(9607),It=r(259),Lt=r(152);var Mt=r(3881),Nt=r(6493),Ft=r(4273),Vt=r(6854);class zt extends i{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-session",this.version=a.x}sendSessionStartEvent(e){var t,r;const n=e.session;if(n&&n.id!==(null===(t=this.notifiedSession)||void 0===t?void 0:t.id)){if(this.notifiedSession&&this.notifiedSession.id===(null===(r=n.attributes)||void 0===r?void 0:r.previousSession))return this.api.pushEvent("session_extend",{},void 0,{skipDedupe:!0}),void(this.notifiedSession=n);this.notifiedSession=n,this.api.pushEvent(Dt,{},void 0,{skipDedupe:!0})}}createInitialSession(e,t){var r,n,i,a,o;let s,l,u=e.fetchUserSession();if(t.persistent&&t.maxSessionPersistenceTime&&u){const e=(0,jt.x3)();u.lastActivity{var t,n,i;r();const a=null===(t=e.meta.session)||void 0===t?void 0:t.attributes;if(a&&"true"===(null==a?void 0:a.isSampled)){let t=JSON.parse(JSON.stringify(e));const r=null===(n=t.meta.session)||void 0===n?void 0:n.attributes;return null==r||delete r.isSampled,0===Object.keys(null!=r?r:{}).length&&(null===(i=t.meta.session)||void 0===i||delete i.attributes),t}return null}))}initialize(){this.logDebug("init session instrumentation");const e=this.config.sessionTracking;if(null==e?void 0:e.enabled){const t=(0,Nt.R)(e);this.registerBeforeSendHook(t);const{initialSession:r,lifecycleType:n}=this.createInitialSession(t,e);t.storeUserSession(r);const i=r.sessionMeta;this.notifiedSession=i,this.api.setSession(i),n===Dt&&this.api.pushEvent(Dt,{},void 0,{skipDedupe:!0}),n===Pt&&this.api.pushEvent(Pt,{},void 0,{skipDedupe:!0})}this.metas.addListener(this.sendSessionStartEvent.bind(this))}}class Bt extends i{constructor(){super(...arguments),this.name="@grafana/faro-web-sdk:instrumentation-view",this.version=a.x}sendViewChangedEvent(e){var t,r,n,i;const a=e.view;a&&a.name!==(null===(t=this.notifiedView)||void 0===t?void 0:t.name)&&(this.api.pushEvent("view_changed",{fromView:null!==(n=null===(r=this.notifiedView)||void 0===r?void 0:r.name)&&void 0!==n?n:_t.y,toView:null!==(i=a.name)&&void 0!==i?i:_t.y},void 0,{skipDedupe:!0}),this.notifiedView=a)}initialize(){this.metas.addListener(this.sendViewChangedEvent.bind(this))}}const $t=/^00-[a-f0-9]{32}-[a-f0-9]{16}-[0-9]{1,2}$/;function Ut(e=[]){for(const t of e)if("traceparent"===t.name){if(!$t.test(t.description))continue;const[,e,r]=t.description.split("-");if(null!=e&&null!=r)return{traceId:e,spanId:r};break}}function qt(e=[],t){return e.some((e=>e&&null!=t.match(e)))}function Ht(e,t={}){for(const[r,n]of Object.entries(t)){const t=e[r];return null!=t&&((0,o.cy)(n)?n.includes(t):t===n)}return!0}function Wt(e){const{connectEnd:t,connectStart:r,decodedBodySize:n,domainLookupEnd:i,domainLookupStart:a,duration:o,encodedBodySize:s,fetchStart:l,initiatorType:u,name:c,nextHopProtocol:d,redirectEnd:h,redirectStart:p,renderBlockingStatus:f,requestStart:m,responseEnd:g,responseStart:v,responseStatus:y,secureConnectionStart:b,transferSize:w,workerStart:S}=e;return{name:c,duration:Qt(o),tcpHandshakeTime:Qt(t-r),dnsLookupTime:Qt(i-a),tlsNegotiationTime:Qt(m-b),responseStatus:Qt(y),redirectTime:Qt(h-p),requestTime:Qt(v-m),responseTime:Qt(g-v),fetchTime:Qt(g-l),serviceWorkerTime:Qt(l-S),decodedBodySize:Qt(n),encodedBodySize:Qt(s),cacheHitStatus:function(){let e="fullLoad";0===w?n>0&&(e="cache"):null!=y?304===y&&(e="conditionalFetch"):s>0&&w{"complete"===document.readyState&&(e(),document.removeEventListener("readystatechange",t))};document.addEventListener("readystatechange",t)}}((()=>Xt(this,void 0,void 0,(function*(){const e=this.api.pushEvent,t=this.getIgnoreUrls(),{faroNavigationId:r}=yield function(e,t){let r;const n=new Promise((e=>{r=e}));return new PerformanceObserver((n=>{var i;const[a]=n.getEntries();if(null==a||qt(t,a.name))return;const o=a.toJSON();let s=Ut(null==o?void 0:o.serverTiming);const l=null!==(i=(0,Et.Gq)(kt,Et.Uy.session))&&void 0!==i?i:_t.y,u=Object.assign(Object.assign({},Gt(o)),{faroNavigationId:(0,Lt.S)(),faroPreviousNavigationId:l});(0,Et.SO)(kt,u.faroNavigationId,Et.Uy.session),e("faro.performance.navigation",u,void 0,{spanContext:s,timestampOverwriteMs:performance.timeOrigin+o.startTime}),r(u)})).observe({type:"navigation",buffered:!0}),n}(e,t);null!=r&&function(e,t,r){const n=It.P.config.trackResources;new PerformanceObserver((i=>{const a=i.getEntries();for(const i of a){if(qt(r,i.name))return;const a=i.toJSON();let o=Ut(null==a?void 0:a.serverTiming);if(null==n&&Ht(a,Kt)||n){const r=Object.assign(Object.assign({},Wt(a)),{faroNavigationId:e,faroResourceId:(0,Lt.S)()});t("faro.performance.resource",r,void 0,{spanContext:o,timestampOverwriteMs:performance.timeOrigin+a.startTime})}}})).observe({type:"resource",buffered:!0})}(r,e,t)})))):this.logDebug("performance observer not supported. Disable performance instrumentation.")}getIgnoreUrls(){var e;return null===(e=this.transports.transports)||void 0===e?void 0:e.flatMap((e=>e.getIgnoreUrls()))}}var Yt=r(5438);class Zt extends i{constructor(e={}){super(),this.options=e,this.name="@grafana/faro-web-sdk:instrumentation-console",this.version=a.x}initialize(){this.logDebug("Initializing\n",this.options),Yt.HT.filter((e=>{var t;return!(null!==(t=this.options.disabledLevels)&&void 0!==t?t:Zt.defaultDisabledLevels).includes(e)})).forEach((e=>{console[e]=(...t)=>{try{this.api.pushLog(t,{level:e})}catch(e){this.logError(e)}finally{this.unpatchedConsole[e](...t)}}}))}}function er(e={}){const t=[new g,new Rt,new zt,new Bt];return!1!==e.enablePerformanceInstrumentation&&t.unshift(new Jt),!1!==e.captureConsole&&t.push(new Zt({disabledLevels:e.captureConsoleDisabledLevels})),t}Zt.defaultDisabledLevels=[Yt.$b.DEBUG,Yt.$b.TRACE,Yt.$b.LOG]},9094:(e,t,r)=>{"use strict";var n;r.d(t,{p:()=>Q}),function(e){e.EXCEPTION="exception",e.LOG="log",e.MEASUREMENT="measurement",e.TRACE="trace",e.EVENT="event"}(n||(n={}));const i={[n.EXCEPTION]:"exceptions",[n.LOG]:"logs",[n.MEASUREMENT]:"measurements",[n.TRACE]:"traces",[n.EVENT]:"events"};var a=r(9607),o=r(2019);function s(e,t){if(e===t)return!0;if((0,o.Ed)(e,"number")&&isNaN(e))return(0,o.Ed)(t,"number")&&isNaN(t);const r=(0,o.cy)(e),n=(0,o.cy)(t);if(r!==n)return!1;if(r&&n){const r=e.length;if(r!==t.length)return!1;for(let n=r;0!=n--;)if(!s(e[n],t[n]))return!1;return!0}const i=(0,o.Gv)(e),a=(0,o.Gv)(t);if(i!==a)return!1;if(e&&t&&i&&a){const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let e of r)if(!n.includes(e))return!1;for(let n of r)if(!s(e[n],t[n]))return!1;return!0}return!1}var l=r(3890);let u;var c=r(5438);const d=e=>e.map((e=>{try{return String(e)}catch(e){return""}})).join(" ");function h(e,t,r,i,h){t.debug("Initializing API");const p=function(e,t,r,i,a){let o;return t.debug("Initializing traces API"),{getOTEL:()=>o,getTraceContext:()=>{const e=null==o?void 0:o.trace.getSpanContext(o.context.active());return e?{trace_id:e.traceId,span_id:e.spanId}:void 0},initOTEL:(e,r)=>{t.debug("Initializing OpenTelemetry"),o={trace:e,context:r}},isOTELInitialized:()=>!!o,pushTraces:e=>{try{const r={type:n.TRACE,payload:e,meta:i.value};t.debug("Pushing trace\n",r),a.execute(r)}catch(e){t.error("Error pushing trace\n",e)}}}}(0,t,0,i,h);return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},p),function(e,t,r,i,c,d){var h;t.debug("Initializing exceptions API");let p=null;u=null!==(h=r.parseStacktrace)&&void 0!==h?h:u;const f=e=>{t.debug("Changing stacktrace parser"),u=null!=e?e:u};return f(r.parseStacktrace),{changeStacktraceParser:f,getStacktraceParser:()=>u,pushError:(e,{skipDedupe:h,stackFrames:f,type:m,context:g,spanContext:v,timestampOverwriteMs:y}={})=>{m=m||e.name||l.x;const b={meta:i.value,payload:{type:m,value:e.message,timestamp:y?(0,a.q5)(y):(0,a.mI)(),trace:v?{trace_id:v.traceId,span_id:v.spanId}:d.getTraceContext(),context:null!=g?g:{}},type:n.EXCEPTION};(null==(f=null!=f?f:e.stack?null==u?void 0:u(e).frames:void 0)?void 0:f.length)&&(b.payload.stacktrace={frames:f});const w={type:b.payload.type,value:b.payload.value,stackTrace:b.payload.stacktrace,context:b.payload.context};h||!r.dedupe||(0,o.kZ)(p)||!s(w,p)?(p=w,t.debug("Pushing exception\n",b),c.execute(b)):t.debug("Skipping error push because it is the same as the last one\n",b.payload)}}}(0,t,r,i,h,p)),function(e,t,r,n,i){let a,o,s;t.debug("Initializing meta API");const l=e=>{o&&n.remove(o),o={user:e},n.add(o)},u=e=>{a&&n.remove(a),a={session:e},n.add(a)};return{setUser:l,resetUser:l,setSession:u,resetSession:u,getSession:()=>n.value.session,setView:e=>{var t;if((null===(t=null==s?void 0:s.view)||void 0===t?void 0:t.name)===(null==e?void 0:e.name))return;const r=s;s={view:e},n.add(s),r&&n.remove(r)},getView:()=>n.value.view}}(0,t,0,i)),function(e,t,r,i,l,u){var h;t.debug("Initializing logs API");let p=null;const f=null!==(h=r.logArgsSerializer)&&void 0!==h?h:d;return{pushLog:(e,{context:d,level:h,skipDedupe:m,spanContext:g,timestampOverwriteMs:v}={})=>{try{const y={type:n.LOG,payload:{message:f(e),level:null!=h?h:c.Ic,context:null!=d?d:{},timestamp:v?(0,a.q5)(v):(0,a.mI)(),trace:g?{trace_id:g.traceId,span_id:g.spanId}:u.getTraceContext()},meta:i.value},b={message:y.payload.message,level:y.payload.level,context:y.payload.context};if(!m&&r.dedupe&&!(0,o.kZ)(p)&&s(b,p))return void t.debug("Skipping log push because it is the same as the last one\n",y.payload);p=b,t.debug("Pushing log\n",y),l.execute(y)}catch(e){t.error("Error pushing log\n",e)}}}}(0,t,r,i,h,p)),function(e,t,r,i,l,u){t.debug("Initializing measurements API");let c=null;return{pushMeasurement:(e,{skipDedupe:d,context:h,spanContext:p,timestampOverwriteMs:f}={})=>{try{const m={type:n.MEASUREMENT,payload:Object.assign(Object.assign({},e),{trace:p?{trace_id:p.traceId,span_id:p.spanId}:u.getTraceContext(),timestamp:f?(0,a.q5)(f):(0,a.mI)(),context:null!=h?h:{}}),meta:i.value},g={type:m.payload.type,values:m.payload.values,context:m.payload.context};if(!d&&r.dedupe&&!(0,o.kZ)(c)&&s(g,c))return void t.debug("Skipping measurement push because it is the same as the last one\n",m.payload);c=g,t.debug("Pushing measurement\n",m),l.execute(m)}catch(e){t.error("Error pushing measurement\n",e)}}}}(0,t,r,i,h,p)),function(e,t,r,i,l,u){let c=null;return{pushEvent:(e,d,h,{skipDedupe:p,spanContext:f,timestampOverwriteMs:m}={})=>{try{const g={meta:i.value,payload:{name:e,domain:null!=h?h:r.eventDomain,attributes:d,timestamp:m?(0,a.q5)(m):(0,a.mI)(),trace:f?{trace_id:f.traceId,span_id:f.spanId}:u.getTraceContext()},type:n.EVENT},v={name:g.payload.name,attributes:g.payload.attributes,domain:g.payload.domain};if(!p&&r.dedupe&&!(0,o.kZ)(c)&&s(v,c))return void t.debug("Skipping event push because it is the same as the last one\n",g.payload);c=v,t.debug("Pushing event\n",g),l.execute(g)}catch(e){t.error("Error pushing event",e)}}}}(0,t,r,i,h,p))}var p=r(8964),f=r(8578),m=r(8203);function g(e=f.Z,t=p.vI){const r=p.vc;return t>p.wK.OFF&&(r.error=t>=p.wK.ERROR?function(...t){e.error(`${r.prefix}\n`,...t)}:m.l,r.warn=t>=p.wK.WARN?function(...t){e.warn(`${r.prefix}\n`,...t)}:m.l,r.info=t>=p.wK.INFO?function(...t){e.info(`${r.prefix}\n`,...t)}:m.l,r.debug=t>=p.wK.VERBOSE?function(...t){e.debug(`${r.prefix}\n`,...t)}:m.l),r}let v=p.vc;function y(e,t){return v=g(e,t.internalLoggerLevel),v}var b=r(5004);var w=r(1685);var S=r(9552),x=r(259);class O{constructor(e,t){var r,n;this.signalBuffer=[],this.itemLimit=null!==(r=null==t?void 0:t.itemLimit)&&void 0!==r?r:50,this.sendTimeout=null!==(n=null==t?void 0:t.sendTimeout)&&void 0!==n?n:250,this.paused=(null==t?void 0:t.paused)||!1,this.sendFn=e,this.flushInterval=-1,this.paused||this.start(),document.addEventListener("visibilitychange",(()=>{"hidden"===document.visibilityState&&this.flush()}))}addItem(e){this.paused||(this.signalBuffer.push(e),this.signalBuffer.length>=this.itemLimit&&this.flush())}start(){this.paused=!1,this.sendTimeout>0&&(this.flushInterval=window.setInterval((()=>this.flush()),this.sendTimeout))}pause(){this.paused=!0,clearInterval(this.flushInterval)}groupItems(e){const t=new Map;return e.forEach((e=>{const r=JSON.stringify(e.meta);let n=t.get(r);n=void 0===n?[e]:[...n,e],t.set(r,n)})),Array.from(t.values())}flush(){if(this.paused||0===this.signalBuffer.length)return;this.groupItems(this.signalBuffer).forEach(this.sendFn),this.signalBuffer=[]}}function _(e){return t=>{if(t.type===n.EXCEPTION&&t.payload){const r=t.payload,n=`${r.type}: ${r.value}`;if(function(e,t){return e.some((e=>(0,o.Kg)(e)?t.includes(e):!!t.match(e)))}(e,n))return null}return t}}function E(e,t,r,n){var i;t.debug("Initializing transports");const a=[];let o=r.paused,s=[];const l=e=>{let t=e;for(const e of s){const r=t.map(e).filter(Boolean);if(0===r.length)return[];t=r}return t},u=e=>{const r=l(e);if(0!==r.length)for(const e of a)t.debug(`Transporting item using ${e.name}\n`,r),e.isBatched()&&e.send(r)};let c;(null===(i=r.batching)||void 0===i?void 0:i.enabled)&&(c=new O(u,{sendTimeout:r.batching.sendTimeout,itemLimit:r.batching.itemLimit,paused:o}));return{add:(...i)=>{t.debug("Adding transports"),i.forEach((i=>{t.debug(`Adding "${i.name}" transport`);a.some((e=>e===i))?t.warn(`Transport ${i.name} is already added`):(i.unpatchedConsole=e,i.internalLogger=t,i.config=r,i.metas=n,a.push(i))}))},addBeforeSendHooks:(...e)=>{t.debug("Adding beforeSendHooks\n",s),e.forEach((e=>{e&&s.push(e)}))},addIgnoreErrorsPatterns:(...e)=>{t.debug("Adding ignoreErrorsPatterns\n",e),e.forEach((e=>{e&&s.push(_(e))}))},getBeforeSendHooks:()=>[...s],execute:e=>{var n;o||((null===(n=r.batching)||void 0===n?void 0:n.enabled)&&(null==c||c.addItem(e)),(e=>{var n,i;if((null===(n=r.batching)||void 0===n?void 0:n.enabled)&&a.every((e=>e.isBatched())))return;const[o]=l([e]);if(void 0!==o)for(const e of a)t.debug(`Transporting item using ${e.name}\n`,o),e.isBatched()?(null===(i=r.batching)||void 0===i?void 0:i.enabled)||e.send([o]):e.send(o)})(e))},isPaused:()=>o,pause:()=>{t.debug("Pausing transports"),null==c||c.pause(),o=!0},remove:(...e)=>{t.debug("Removing transports"),e.forEach((e=>{t.debug(`Removing "${e.name}" transport`);const r=a.indexOf(e);-1!==r?a.splice(r,1):t.warn(`Transport "${e.name}" is not added`)}))},removeBeforeSendHooks:(...e)=>{s.filter((t=>!e.includes(t)))},get transports(){return[...a]},unpause:()=>{t.debug("Unpausing transports"),null==c||c.start(),o=!1}}}let k=f.Z;function C(e){var t;return k=null!==(t=e.unpatchedConsole)&&void 0!==t?t:k,k}function T(e){const t=C(e),r=y(t,e);if((0,S.rI)()&&!e.isolate)return void r.error('Faro is already registered. Either add instrumentations, transports etc. to the global faro instance or use the "isolate" property');r.debug("Initializing");const n=function(e,t,r){let n=[],i=[];const a=()=>n.reduce(((e,t)=>Object.assign(e,(0,o.Tn)(t)?t():t)),{}),s=()=>{if(i.length){const e=a();i.forEach((t=>t(e)))}};return{add:(...e)=>{t.debug("Adding metas\n",e),n.push(...e),s()},remove:(...e)=>{t.debug("Removing metas\n",e),n=n.filter((t=>!e.includes(t))),s()},addListener:e=>{t.debug("Adding metas listener\n",e),i.push(e)},removeListener:e=>{t.debug("Removing metas listener\n",e),i=i.filter((t=>t!==e))},get value(){return a()}}}(0,r),i=E(t,r,e,n),a=h(0,r,e,n,i),s=function(e,t,r,n,i,a){t.debug("Initializing instrumentations");const o=[];return{add:(...s)=>{t.debug("Adding instrumentations"),s.forEach((s=>{t.debug(`Adding "${s.name}" instrumentation`),o.some((e=>e.name===s.name))?t.warn(`Instrumentation ${s.name} is already added`):(s.unpatchedConsole=e,s.internalLogger=t,s.config=r,s.metas=n,s.transports=i,s.api=a,o.push(s),s.initialize())}))},get instrumentations(){return[...o]},remove:(...e)=>{t.debug("Removing instrumentations"),e.forEach((e=>{var r,n;t.debug(`Removing "${e.name}" instrumentation`);const i=o.reduce(((t,r,n)=>null===t&&r.name===e.name?n:null),null);i?(null===(n=(r=o[i]).destroy)||void 0===n||n.call(r),o.splice(i,1)):t.warn(`Instrumentation "${e.name}" is not added`)}))}}}(t,r,e,n,i,a),l=(0,x.A)(t,r,e,n,i,a,s);return function(e){var t,r;const n={sdk:{version:w.x},app:{bundleId:e.config.app.name&&(i=e.config.app.name,null===b.J||void 0===b.J?void 0:b.J[`__faroBundleId_${i}`])}};var i;const a=null===(t=e.config.sessionTracking)||void 0===t?void 0:t.session;a&&e.api.setSession(a),e.config.app&&(n.app=Object.assign(Object.assign({},e.config.app),n.app)),e.config.user&&(n.user=e.config.user),e.config.view&&(n.view=e.config.view),e.metas.add(n,...null!==(r=e.config.metas)&&void 0!==r?r:[])}(l),function(e){e.transports.add(...e.config.transports),e.transports.addBeforeSendHooks(e.config.beforeSend),e.transports.addIgnoreErrorsPatterns(e.config.ignoreErrors)}(l),function(e){e.instrumentations.add(...e.config.instrumentations)}(l),l}const A="faro",R={enabled:!0,sendTimeout:250,itemLimit:50},D="browser";var P=r(4151);function j(e){return{frames:(0,P.D)(e)}}var I=r(409),L=r(6660),M=r(1717);const N=[()=>{const e=new L.UAParser,{name:t,version:r}=e.getBrowser(),{name:n,version:i}=e.getOS(),a=e.getUA(),o=navigator.language,s=navigator.userAgent.includes("Mobi"),l=function(){if(!t||!r)return;if("userAgentData"in navigator&&navigator.userAgentData)return navigator.userAgentData.brands;return}();return{browser:{name:null!=t?t:M.y,version:null!=r?r:M.y,os:`${null!=n?n:M.y} ${null!=i?i:M.y}`,userAgent:null!=a?a:M.y,language:null!=o?o:M.y,mobile:s,brands:null!=l?l:M.y,viewportWidth:`${window.innerWidth}`,viewportHeight:`${window.innerHeight}`}}},()=>({page:{url:location.href}})],F=()=>{const e=window.k6;return{k6:Object.assign({isK6Browser:!0},(null==e?void 0:e.testRunId)&&{testRunId:null==e?void 0:e.testRunId})}};var V=r(9402);class z extends V.H{isBatched(){return!1}getIgnoreUrls(){return[]}}function B(e,t){var r,n;if(void 0===t)return e;if(void 0===e)return{resourceSpans:t};const i=null===(r=e.resourceSpans)||void 0===r?void 0:r[0];if(void 0===i)return e;const a=(null==i?void 0:i.scopeSpans)||[],o=(null===(n=null==t?void 0:t[0])||void 0===n?void 0:n.scopeSpans)||[];return Object.assign(Object.assign({},e),{resourceSpans:[Object.assign(Object.assign({},i),{scopeSpans:[...a,...o]})]})}var $=r(6493),U=r(6854),q=function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{l(n.next(e))}catch(e){a(e)}}function s(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}l((n=n.apply(e,t||[])).next())}))},H=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);iDate.now(),this.promiseBuffer=function(e){const{size:t,concurrency:r}=e,n=[];let i=0;const a=()=>{if(i{i--,a(),t(e)}),(e=>{i--,a(),r(e)}))}};return{add:e=>{if(n.length+i>=t)throw new Error("Task buffer full");return new Promise(((t,r)=>{n.push({producer:e,resolve:t,reject:r}),a()}))}}}({size:null!==(n=e.bufferSize)&&void 0!==n?n:30,concurrency:null!==(i=e.concurrency)&&void 0!==i?i:5})}send(e){return q(this,void 0,void 0,(function*(){try{if(this.disabledUntil>new Date(this.getNow()))return this.logWarn(`Dropping transport item due to too many requests. Backoff until ${this.disabledUntil}`),Promise.resolve();yield this.promiseBuffer.add((()=>{const t=JSON.stringify(function(e){let t={meta:{}};return void 0!==e[0]&&(t.meta=e[0].meta),e.forEach((e=>{switch(e.type){case n.LOG:case n.EVENT:case n.EXCEPTION:case n.MEASUREMENT:const r=i[e.type],a=t[r];t=Object.assign(Object.assign({},t),{[r]:void 0===a?[e.payload]:[...a,e.payload]});break;case n.TRACE:t=Object.assign(Object.assign({},t),{traces:B(t.traces,e.payload.resourceSpans)})}})),t}(e)),{url:r,requestOptions:a,apiKey:o}=this.options,s=null!=a?a:{},{headers:l}=s,u=H(s,["headers"]);let c;const d=this.metas.value.session;return null!=d&&(c=d.id),fetch(r,Object.assign({method:"POST",headers:Object.assign(Object.assign(Object.assign({"Content-Type":"application/json"},null!=l?l:{}),o?{"x-api-key":o}:{}),c?{"x-faro-session-id":c}:{}),body:t,keepalive:t.length<=6e4},null!=u?u:{})).then((e=>q(this,void 0,void 0,(function*(){if(202===e.status){"invalid"===e.headers.get("X-Faro-Session-Status")&&this.extendFaroSession(this.config,this.logDebug)}return 429===e.status&&(this.disabledUntil=this.getRetryAfterDate(e),this.logWarn(`Too many requests, backing off until ${this.disabledUntil}`)),e.text().catch(m.l),e})))).catch((e=>{this.logError("Failed sending payload to the receiver\n",JSON.parse(t),e)}))}))}catch(e){this.logError(e)}}))}getIgnoreUrls(){var e;return[this.options.url].concat(null!==(e=this.config.ignoreUrls)&&void 0!==e?e:[])}isBatched(){return!0}getRetryAfterDate(e){const t=this.getNow(),r=e.headers.get("Retry-After");if(r){const e=Number(r);if(!isNaN(e))return new Date(1e3*e+t);const n=Date.parse(r);if(!isNaN(n))return new Date(n)}return new Date(t+this.rateLimitBackoffMs)}extendFaroSession(e,t){const r="Session expired",n=e.sessionTracking;if(null==n?void 0:n.enabled){const{fetchUserSession:e,storeUserSession:i}=(0,$.R)(n);(0,U.vP)({fetchUserSession:e,storeUserSession:i})({forceSessionExtend:!0}),t(`${r} created new session.`)}else t(`${r}.`)}}var G=r(4812);function Q(e){const t=function(e){var t,r,n,i,a,s,l,u,c;const h=[],m=g(e.unpatchedConsole,e.internalLoggerLevel);return e.transports?((e.url||e.apiKey)&&m.error('if "transports" is defined, "url" and "apiKey" should not be defined'),h.push(...e.transports)):e.url?h.push(new W({url:e.url,apiKey:e.apiKey})):m.error('either "url" or "transports" must be defined'),{app:e.app,batching:Object.assign(Object.assign({},R),e.batching),dedupe:null===(t=e.dedupe)||void 0===t||t,globalObjectKey:e.globalObjectKey||A,instrumentations:null!==(r=e.instrumentations)&&void 0!==r?r:(0,G.w)(),internalLoggerLevel:null!==(n=e.internalLoggerLevel)&&void 0!==n?n:p.vI,isolate:null!==(i=e.isolate)&&void 0!==i&&i,logArgsSerializer:null!==(a=e.logArgsSerializer)&&void 0!==a?a:d,metas:function(){const t=N;return e.metas&&t.push(...e.metas),(0,o.Gv)(window.k6)?[...t,F]:t}(),parseStacktrace:j,paused:null!==(s=e.paused)&&void 0!==s&&s,preventGlobalExposure:null!==(l=e.preventGlobalExposure)&&void 0!==l&&l,transports:h,unpatchedConsole:null!==(u=e.unpatchedConsole)&&void 0!==u?u:f.Z,beforeSend:e.beforeSend,eventDomain:null!==(c=e.eventDomain)&&void 0!==c?c:D,ignoreErrors:e.ignoreErrors,ignoreUrls:e.ignoreUrls,sessionTracking:Object.assign(Object.assign({},I.Fm),e.sessionTracking),user:e.user,view:e.view,trackResources:e.trackResources,trackWebVitalsAttribution:e.trackWebVitalsAttribution}}(e);if(t)return T(t)}},3867:(e,t,r)=>{"use strict";r.d(t,{S:()=>i});var n=r(8189);function i(e,t,r,i){const a={filename:e||document.location.href,function:t||n.iC};return void 0!==r&&(a.lineno=r),void 0!==i&&(a.colno=i),a}},8189:(e,t,r)=>{"use strict";r.d(t,{HS:()=>g,Lo:()=>p,N9:()=>h,Sy:()=>l,Wf:()=>i,Wo:()=>u,bz:()=>d,cB:()=>s,iC:()=>a,k4:()=>n,ld:()=>m,mZ:()=>v,rD:()=>f,tE:()=>c,xQ:()=>o});const n="\n",i="eval",a="?",o="@",s=/^\s*at (?:(.*\).*?|.*?) ?\((?:address at )?)?((?:file|https?|blob|chrome-extension|address|native|eval|webpack||[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,l=/\((\S*)(?::(\d+))(?::(\d+))\)/,u="eval",c="address at ",d=c.length,h=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|safari-extension|safari-web-extension|capacitor)?:\/.*?|\[native code]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,p=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,f=" > eval",m="safari-extension",g="safari-web-extension",v=/Minified React error #\d+;/i},4151:(e,t,r)=>{"use strict";r.d(t,{D:()=>s});var n=r(2019),i=r(3867),a=r(8189);function o(e,t){const r=null==e?void 0:e.includes(a.ld),n=!r&&(null==e?void 0:e.includes(a.HS));return r||n?[(null==e?void 0:e.includes(a.xQ))?e.split(a.xQ)[0]:e,r?`${a.ld}:${t}`:`${a.HS}:${t}`]:[e,t]}function s(e){let t=[];e.stacktrace?t=e.stacktrace.split(a.k4).filter(((e,t)=>t%2==0)):e.stack&&(t=e.stack.split(a.k4));const r=t.reduce(((t,r,s)=>{let l,u,c,d,h;if(l=a.cB.exec(r)){if(u=l[1],c=l[2],d=l[3],h=l[4],null==c?void 0:c.startsWith(a.Wo)){const e=a.Sy.exec(c);e&&(c=e[1],d=e[2],h=e[3])}c=(null==c?void 0:c.startsWith(a.tE))?c.substring(a.bz):c,[u,c]=o(u,c)}else if(l=a.N9.exec(r)){if(u=l[1],c=l[3],d=l[4],h=l[5],c&&c.includes(a.rD)){const e=a.Lo.exec(c);e&&(u=u||a.Wf,c=e[1],d=e[2])}else 0===s&&!h&&(0,n.Et)(e.columnNumber)&&(h=String(e.columnNumber+1));[u,c]=o(u,c)}return(c||u)&&t.push((0,i.S)(c,u,d?Number(d):void 0,h?Number(h):void 0)),t}),[]);return a.mZ.test(e.message)?r.slice(1):r}},4273:(e,t,r)=>{"use strict";r.d(t,{G:()=>u});var n=r(259),i=r(6633),a=r(550),o=r(3881),s=r(409),l=r(6854);class u{constructor(){this.updateSession=(0,i.n)((()=>this.updateUserSession()),s.MM),this.updateUserSession=(0,l.vP)({fetchUserSession:u.fetchUserSession,storeUserSession:u.storeUserSession}),this.init()}static removeUserSession(){(0,a.Ai)(s.AQ,u.storageTypeLocal)}static storeUserSession(e){(0,a.SO)(s.AQ,JSON.stringify(e),u.storageTypeLocal)}static fetchUserSession(){const e=(0,a.Gq)(s.AQ,u.storageTypeLocal);return e?JSON.parse(e):null}init(){document.addEventListener("visibilitychange",(()=>{"visible"===document.visibilityState&&this.updateSession()})),n.P.metas.addListener((function(e){const t=e.session,r=u.fetchUserSession();if(t&&t.id!==(null==r?void 0:r.sessionId)){const e=(0,l.jo)((0,l.Bc)({sessionId:t.id,isSampled:(0,o.$)()}),r);u.storeUserSession(e),n.P.api.setSession(e.sessionMeta)}}))}}u.storageTypeLocal=a.Uy.local},6493:(e,t,r)=>{"use strict";r.d(t,{R:()=>d});var n=r(4273),i=r(259),a=r(6633),o=r(550),s=r(3881),l=r(409),u=r(6854);class c{constructor(){this.updateSession=(0,a.n)((()=>this.updateUserSession()),l.MM),this.updateUserSession=(0,u.vP)({fetchUserSession:c.fetchUserSession,storeUserSession:c.storeUserSession}),this.init()}static removeUserSession(){(0,o.Ai)(l.AQ,c.storageTypeSession)}static storeUserSession(e){(0,o.SO)(l.AQ,JSON.stringify(e),c.storageTypeSession)}static fetchUserSession(){const e=(0,o.Gq)(l.AQ,c.storageTypeSession);return e?JSON.parse(e):null}init(){document.addEventListener("visibilitychange",(()=>{"visible"===document.visibilityState&&this.updateSession()})),i.P.metas.addListener((function(e){const t=e.session,r=c.fetchUserSession();if(t&&t.id!==(null==r?void 0:r.sessionId)){const e=(0,u.jo)((0,u.Bc)({sessionId:t.id,isSampled:(0,s.$)()}),r);c.storeUserSession(e),i.P.api.setSession(e.sessionMeta)}}))}}function d(e){return(null==e?void 0:e.persistent)?n.G:c}c.storageTypeSession=o.Uy.session},3881:(e,t,r)=>{"use strict";r.d(t,{$:()=>i});var n=r(259);function i(){var e,t,r;const i=n.P.config.sessionTracking;let a=null!==(r=null!==(t=null===(e=null==i?void 0:i.sampler)||void 0===e?void 0:e.call(i,{metas:n.P.metas.value}))&&void 0!==t?t:null==i?void 0:i.samplingRate)&&void 0!==r?r:1;if("number"!=typeof a){a=0}return Math.random(){"use strict";r.d(t,{AQ:()=>n,Fm:()=>s,MM:()=>o,Zl:()=>i,gG:()=>a});const n="com.grafana.faro.session",i=144e5,a=9e5,o=1e3,s={enabled:!0,persistent:!1,maxSessionPersistenceTime:a}},6854:(e,t,r)=>{"use strict";r.d(t,{Bc:()=>u,OW:()=>c,jo:()=>h,vP:()=>d});var n=r(9607),i=r(259),a=r(152),o=r(550),s=r(3881),l=r(409);function u({sessionId:e,started:t,lastActivity:r,isSampled:o=!0}={}){var s,l;const u=(0,n.x3)(),c=null===(l=null===(s=i.P.config)||void 0===s?void 0:s.sessionTracking)||void 0===l?void 0:l.generateSessionId;return null==e&&(e="function"==typeof c?c():(0,a.S)()),{sessionId:e,lastActivity:null!=r?r:u,started:null!=t?t:u,isSampled:o}}function c(e){if(null==e)return!1;const t=(0,n.x3)();if(!(t-e.started{"use strict";function n(e,t){let r,n=!1;const i=()=>{null!=r?(e(...r),r=null,setTimeout(i,t)):n=!1};return(...a)=>{n?r=a:(e(...a),n=!0,setTimeout(i,t))}}r.d(t,{n:()=>n})},550:(e,t,r)=>{"use strict";r.d(t,{Ai:()=>l,Gq:()=>o,OE:()=>u,SO:()=>s,Uy:()=>i,Vv:()=>c});var n=r(259);const i={session:"sessionStorage",local:"localStorage"};function a(e){var t;try{let t;t=window[e];const r="__faro_storage_test__";return t.setItem(r,r),t.removeItem(r),!0}catch(r){return null===(t=n.P.internalLogger)||void 0===t||t.info(`Web storage of type ${e} is not available. Reason: ${r}`),!1}}function o(e,t){return d(t)?window[t].getItem(e):null}function s(e,t,r){if(d(r))try{window[r].setItem(e,t)}catch(e){}}function l(e,t){d(t)&&window[t].removeItem(e)}const u=a(i.local),c=a(i.session);function d(e){return e===i.local?u:e===i.session&&c}},6063:(e,t,r)=>{"use strict";r.d(t,{mN:()=>i,oL:()=>a});r(8531);var n=r(6977);const i="grafana-llm-app",a=`/api/plugins/${i}`;new n.SemVer("0.2.0")},3752:(e,t,r)=>{"use strict";r.d(t,{qA:()=>x,qH:()=>O});var n=r(7781),i=r(8531),a=(r(5959),r(1269)),o=r(5096),s=r(4370);function l(e,t){return(0,o.N)((function(r,n){var i=0;r.subscribe((0,s._)(n,(function(r){return e.call(t,r,i++)&&n.next(r)})))}))}var u=r(7708);function c(e,t){return(0,o.N)(function(e,t,r,n,i){return function(a,o){var l=r,u=t,c=0;a.subscribe((0,s._)(o,(function(t){var r=c++;u=l?e(u,t,r):(l=!0,t),n&&o.next(u)}),i&&function(){l&&o.next(u),o.complete()}))}}(e,t,arguments.length>=2,!0))}var d=r(1693),h=r(3887);const p={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let f;const m=new Uint8Array(16);const g=[];for(let e=0;e<256;++e)g.push((e+256).toString(16).slice(1));function v(e,t=0){return(g[e[t+0]]+g[e[t+1]]+g[e[t+2]]+g[e[t+3]]+"-"+g[e[t+4]]+g[e[t+5]]+"-"+g[e[t+6]]+g[e[t+7]]+"-"+g[e[t+8]]+g[e[t+9]]+"-"+g[e[t+10]]+g[e[t+11]]+g[e[t+12]]+g[e[t+13]]+g[e[t+14]]+g[e[t+15]]).toLowerCase()}const y=function(e,t,r){if(p.randomUUID&&!t&&!e)return p.randomUUID();const n=(e=e||{}).random??e.rng?.()??function(){if(!f){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");f=crypto.getRandomValues.bind(crypto)}return f(m)}();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){if((r=r||0)<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[r+e]=n[e];return t}return v(n)};var b=r(6063);const w="llm/v1/chat/completions";function S(e){return"error"in e}function x(){return(0,a.pipe)((0,a.pipe)(l((e=>"content"in e.choices[0].delta)),(0,u.T)((e=>e.choices[0].delta.content))),c(((e,t)=>e+t),""))}function O(e){const t={scope:n.LiveChannelScope.Plugin,namespace:b.mN,path:w+"/"+y(),data:e};return(0,i.getGrafanaLiveSrv)().getStream(t).pipe(l((e=>(0,n.isLiveChannelMessageEvent)(e)))).pipe(l((e=>!!e.message.choices)),function(e,t,r){var n=(0,d.T)(e)||t||r?{next:e,error:t,complete:r}:e;return n?(0,o.N)((function(e,t){var r;null===(r=n.subscribe)||void 0===r||r.call(n);var i=!0;e.subscribe((0,s._)(t,(function(e){var r;null===(r=n.next)||void 0===r||r.call(n,e),t.next(e)}),(function(){var e;i=!1,null===(e=n.complete)||void 0===e||e.call(n),t.complete()}),(function(e){var r;i=!1,null===(r=n.error)||void 0===r||r.call(n,e),t.error(e)}),(function(){var e,t;i&&(null===(e=n.unsubscribe)||void 0===e||e.call(n)),null===(t=n.finalize)||void 0===t||t.call(n)})))})):h.D}((e=>{if(S(e.message))throw new Error(e.message.error)})),(r=e=>!(!S(e.message)&&(e.message.choices&&e.message.choices[0].delta&&"done"in e.message.choices[0].delta&&!0===e.message.choices[0].delta.done||e.message.choices&&"finish_reason"in e.message.choices[0]&&"stop"===e.message.choices[0].finish_reason)),void 0===a&&(a=!1),(0,o.N)((function(e,t){var n=0;e.subscribe((0,s._)(t,(function(e){var i=r(e,n++);(i||a)&&t.next(e),!i&&t.complete()})))}))),(0,u.T)((e=>e.message)));var r,a}},6030:(e,t,r)=>{"use strict";r.d(t,{Sn:()=>a});var n=r(8531),i=r(6063);const a=async()=>{try{if(!(await(0,n.getBackendSrv)().get(`${i.oL}/settings`)).enabled)return!1;const e=(await(0,n.getBackendSrv)().get(`${i.oL}/health`)).details;return e.llmProvider?e.llmProvider.configured&&e.llmProvider.ok:!!e.openAI&&(e.openAI.configured&&e.openAI.ok)}catch(e){return!1}}},404:(e,t,r)=>{const n=Symbol("SemVer ANY");class i{static get ANY(){return n}constructor(e,t){if(t=a(t),e instanceof i){if(e.loose===!!t.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),u("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===n?this.value="":this.value=this.operator+this.semver.version,u("comp",this)}parse(e){const t=this.options.loose?o[s.COMPARATORLOOSE]:o[s.COMPARATOR],r=e.match(t);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new c(r[2],this.options.loose):this.semver=n}toString(){return this.value}test(e){if(u("Comparator.test",e,this.options.loose),this.semver===n||e===n)return!0;if("string"==typeof e)try{e=new c(e,this.options)}catch(e){return!1}return l(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof i))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new d(e.value,t).test(this.value):""===e.operator?""===e.value||new d(this.value,t).test(e.semver):(!(t=a(t)).includePrerelease||"<0.0.0-0"!==this.value&&"<0.0.0-0"!==e.value)&&(!(!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&(!(!this.operator.startsWith(">")||!e.operator.startsWith(">"))||(!(!this.operator.startsWith("<")||!e.operator.startsWith("<"))||(!(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))||(!!(l(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))||!!(l(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))))))}}e.exports=i;const a=r(9287),{safeRe:o,t:s}=r(978),l=r(6323),u=r(116),c=r(8152),d=r(1451)},1451:(e,t,r)=>{const n=/\s+/g;class i{constructor(e,t){if(t=o(t),e instanceof i)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new i(e.raw,t);if(e instanceof s)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(n," "),this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!v(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const e of this.set)if(1===e.length&&y(e[0])){this.set=[e];break}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e0&&(this.formatted+="||");const t=this.set[e];for(let e=0;e0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){const t=((this.options.includePrerelease&&m)|(this.options.loose&&g))+":"+e,r=a.get(t);if(r)return r;const n=this.options.loose,i=n?c[d.HYPHENRANGELOOSE]:c[d.HYPHENRANGE];e=e.replace(i,R(this.options.includePrerelease)),l("hyphen replace",e),e=e.replace(c[d.COMPARATORTRIM],h),l("comparator trim",e),e=e.replace(c[d.TILDETRIM],p),l("tilde trim",e),e=e.replace(c[d.CARETTRIM],f),l("caret trim",e);let o=e.split(" ").map((e=>w(e,this.options))).join(" ").split(/\s+/).map((e=>A(e,this.options)));n&&(o=o.filter((e=>(l("loose invalid filter",e,this.options),!!e.match(c[d.COMPARATORLOOSE]))))),l("range list",o);const u=new Map,y=o.map((e=>new s(e,this.options)));for(const e of y){if(v(e))return[e];u.set(e.value,e)}u.size>1&&u.has("")&&u.delete("");const b=[...u.values()];return a.set(t,b),b}intersects(e,t){if(!(e instanceof i))throw new TypeError("a Range is required");return this.set.some((r=>b(r,t)&&e.set.some((e=>b(e,t)&&r.every((r=>e.every((e=>r.intersects(e,t)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new u(e,this.options)}catch(e){return!1}for(let t=0;t"<0.0.0-0"===e.value,y=e=>""===e.value,b=(e,t)=>{let r=!0;const n=e.slice();let i=n.pop();for(;r&&n.length;)r=n.every((e=>i.intersects(e,t))),i=n.pop();return r},w=(e,t)=>(l("comp",e,t),e=_(e,t),l("caret",e),e=x(e,t),l("tildes",e),e=k(e,t),l("xrange",e),e=T(e,t),l("stars",e),e),S=e=>!e||"x"===e.toLowerCase()||"*"===e,x=(e,t)=>e.trim().split(/\s+/).map((e=>O(e,t))).join(" "),O=(e,t)=>{const r=t.loose?c[d.TILDELOOSE]:c[d.TILDE];return e.replace(r,((t,r,n,i,a)=>{let o;return l("tilde",e,t,r,n,i,a),S(r)?o="":S(n)?o=`>=${r}.0.0 <${+r+1}.0.0-0`:S(i)?o=`>=${r}.${n}.0 <${r}.${+n+1}.0-0`:a?(l("replaceTilde pr",a),o=`>=${r}.${n}.${i}-${a} <${r}.${+n+1}.0-0`):o=`>=${r}.${n}.${i} <${r}.${+n+1}.0-0`,l("tilde return",o),o}))},_=(e,t)=>e.trim().split(/\s+/).map((e=>E(e,t))).join(" "),E=(e,t)=>{l("caret",e,t);const r=t.loose?c[d.CARETLOOSE]:c[d.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,((t,r,i,a,o)=>{let s;return l("caret",e,t,r,i,a,o),S(r)?s="":S(i)?s=`>=${r}.0.0${n} <${+r+1}.0.0-0`:S(a)?s="0"===r?`>=${r}.${i}.0${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.0${n} <${+r+1}.0.0-0`:o?(l("replaceCaret pr",o),s="0"===r?"0"===i?`>=${r}.${i}.${a}-${o} <${r}.${i}.${+a+1}-0`:`>=${r}.${i}.${a}-${o} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${a}-${o} <${+r+1}.0.0-0`):(l("no pr"),s="0"===r?"0"===i?`>=${r}.${i}.${a}${n} <${r}.${i}.${+a+1}-0`:`>=${r}.${i}.${a}${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${a} <${+r+1}.0.0-0`),l("caret return",s),s}))},k=(e,t)=>(l("replaceXRanges",e,t),e.split(/\s+/).map((e=>C(e,t))).join(" ")),C=(e,t)=>{e=e.trim();const r=t.loose?c[d.XRANGELOOSE]:c[d.XRANGE];return e.replace(r,((r,n,i,a,o,s)=>{l("xRange",e,r,n,i,a,o,s);const u=S(i),c=u||S(a),d=c||S(o),h=d;return"="===n&&h&&(n=""),s=t.includePrerelease?"-0":"",u?r=">"===n||"<"===n?"<0.0.0-0":"*":n&&h?(c&&(a=0),o=0,">"===n?(n=">=",c?(i=+i+1,a=0,o=0):(a=+a+1,o=0)):"<="===n&&(n="<",c?i=+i+1:a=+a+1),"<"===n&&(s="-0"),r=`${n+i}.${a}.${o}${s}`):c?r=`>=${i}.0.0${s} <${+i+1}.0.0-0`:d&&(r=`>=${i}.${a}.0${s} <${i}.${+a+1}.0-0`),l("xRange return",r),r}))},T=(e,t)=>(l("replaceStars",e,t),e.trim().replace(c[d.STAR],"")),A=(e,t)=>(l("replaceGTE0",e,t),e.trim().replace(c[t.includePrerelease?d.GTE0PRE:d.GTE0],"")),R=e=>(t,r,n,i,a,o,s,l,u,c,d,h)=>`${r=S(n)?"":S(i)?`>=${n}.0.0${e?"-0":""}`:S(a)?`>=${n}.${i}.0${e?"-0":""}`:o?`>=${r}`:`>=${r}${e?"-0":""}`} ${l=S(u)?"":S(c)?`<${+u+1}.0.0-0`:S(d)?`<${u}.${+c+1}.0-0`:h?`<=${u}.${c}.${d}-${h}`:e?`<${u}.${c}.${+d+1}-0`:`<=${l}`}`.trim(),D=(e,t,r)=>{for(let r=0;r0){const n=e[r].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0}},8152:(e,t,r)=>{const n=r(116),{MAX_LENGTH:i,MAX_SAFE_INTEGER:a}=r(3486),{safeRe:o,safeSrc:s,t:l}=r(978),u=r(9287),{compareIdentifiers:c}=r(175);class d{constructor(e,t){if(t=u(t),e instanceof d){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>i)throw new TypeError(`version is longer than ${i} characters`);n("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;const r=e.trim().match(t.loose?o[l.LOOSE]:o[l.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>a||this.major<0)throw new TypeError("Invalid major version");if(this.minor>a||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>a||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);if(-1===n){if(t===this.prerelease.join(".")&&!1===r)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let n=[t,e];!1===r&&(n=[t]),0===c(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=d},5466:(e,t,r)=>{const n=r(8948);e.exports=(e,t)=>{const r=n(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null}},6323:(e,t,r)=>{const n=r(957),i=r(6619),a=r(1888),o=r(4333),s=r(4647),l=r(5428);e.exports=(e,t,r,u)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return n(e,r,u);case"!=":return i(e,r,u);case">":return a(e,r,u);case">=":return o(e,r,u);case"<":return s(e,r,u);case"<=":return l(e,r,u);default:throw new TypeError(`Invalid operator: ${t}`)}}},3494:(e,t,r)=>{const n=r(8152),i=r(8948),{safeRe:a,t:o}=r(978);e.exports=(e,t)=>{if(e instanceof n)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){const n=t.includePrerelease?a[o.COERCERTLFULL]:a[o.COERCERTL];let i;for(;(i=n.exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&i.index+i[0].length===r.index+r[0].length||(r=i),n.lastIndex=i.index+i[1].length+i[2].length;n.lastIndex=-1}else r=e.match(t.includePrerelease?a[o.COERCEFULL]:a[o.COERCE]);if(null===r)return null;const s=r[2],l=r[3]||"0",u=r[4]||"0",c=t.includePrerelease&&r[5]?`-${r[5]}`:"",d=t.includePrerelease&&r[6]?`+${r[6]}`:"";return i(`${s}.${l}.${u}${c}${d}`,t)}},9329:(e,t,r)=>{const n=r(8152);e.exports=(e,t,r)=>{const i=new n(e,r),a=new n(t,r);return i.compare(a)||i.compareBuild(a)}},6175:(e,t,r)=>{const n=r(7956);e.exports=(e,t)=>n(e,t,!0)},7956:(e,t,r)=>{const n=r(8152);e.exports=(e,t,r)=>new n(e,r).compare(new n(t,r))},5316:(e,t,r)=>{const n=r(8948);e.exports=(e,t)=>{const r=n(e,null,!0),i=n(t,null,!0),a=r.compare(i);if(0===a)return null;const o=a>0,s=o?r:i,l=o?i:r,u=!!s.prerelease.length;if(!!l.prerelease.length&&!u){if(!l.patch&&!l.minor)return"major";if(0===l.compareMain(s))return l.minor&&!l.patch?"minor":"patch"}const c=u?"pre":"";return r.major!==i.major?c+"major":r.minor!==i.minor?c+"minor":r.patch!==i.patch?c+"patch":"prerelease"}},957:(e,t,r)=>{const n=r(7956);e.exports=(e,t,r)=>0===n(e,t,r)},1888:(e,t,r)=>{const n=r(7956);e.exports=(e,t,r)=>n(e,t,r)>0},4333:(e,t,r)=>{const n=r(7956);e.exports=(e,t,r)=>n(e,t,r)>=0},643:(e,t,r)=>{const n=r(8152);e.exports=(e,t,r,i,a)=>{"string"==typeof r&&(a=i,i=r,r=void 0);try{return new n(e instanceof n?e.version:e,r).inc(t,i,a).version}catch(e){return null}}},4647:(e,t,r)=>{const n=r(7956);e.exports=(e,t,r)=>n(e,t,r)<0},5428:(e,t,r)=>{const n=r(7956);e.exports=(e,t,r)=>n(e,t,r)<=0},6038:(e,t,r)=>{const n=r(8152);e.exports=(e,t)=>new n(e,t).major},9922:(e,t,r)=>{const n=r(8152);e.exports=(e,t)=>new n(e,t).minor},6619:(e,t,r)=>{const n=r(7956);e.exports=(e,t,r)=>0!==n(e,t,r)},8948:(e,t,r)=>{const n=r(8152);e.exports=(e,t,r=!1)=>{if(e instanceof n)return e;try{return new n(e,t)}catch(e){if(!r)return null;throw e}}},2481:(e,t,r)=>{const n=r(8152);e.exports=(e,t)=>new n(e,t).patch},6877:(e,t,r)=>{const n=r(8948);e.exports=(e,t)=>{const r=n(e,t);return r&&r.prerelease.length?r.prerelease:null}},2862:(e,t,r)=>{const n=r(7956);e.exports=(e,t,r)=>n(t,e,r)},5601:(e,t,r)=>{const n=r(9329);e.exports=(e,t)=>e.sort(((e,r)=>n(r,e,t)))},5034:(e,t,r)=>{const n=r(1451);e.exports=(e,t,r)=>{try{t=new n(t,r)}catch(e){return!1}return t.test(e)}},987:(e,t,r)=>{const n=r(9329);e.exports=(e,t)=>e.sort(((e,r)=>n(e,r,t)))},4109:(e,t,r)=>{const n=r(8948);e.exports=(e,t)=>{const r=n(e,t);return r?r.version:null}},6977:(e,t,r)=>{const n=r(978),i=r(3486),a=r(8152),o=r(175),s=r(8948),l=r(4109),u=r(5466),c=r(643),d=r(5316),h=r(6038),p=r(9922),f=r(2481),m=r(6877),g=r(7956),v=r(2862),y=r(6175),b=r(9329),w=r(987),S=r(5601),x=r(1888),O=r(4647),_=r(957),E=r(6619),k=r(4333),C=r(5428),T=r(6323),A=r(3494),R=r(404),D=r(1451),P=r(5034),j=r(8427),I=r(2432),L=r(5210),M=r(1505),N=r(6950),F=r(6055),V=r(3519),z=r(9914),B=r(344),$=r(8921),U=r(1428);e.exports={parse:s,valid:l,clean:u,inc:c,diff:d,major:h,minor:p,patch:f,prerelease:m,compare:g,rcompare:v,compareLoose:y,compareBuild:b,sort:w,rsort:S,gt:x,lt:O,eq:_,neq:E,gte:k,lte:C,cmp:T,coerce:A,Comparator:R,Range:D,satisfies:P,toComparators:j,maxSatisfying:I,minSatisfying:L,minVersion:M,validRange:N,outside:F,gtr:V,ltr:z,intersects:B,simplifyRange:$,subset:U,SemVer:a,re:n.re,src:n.src,tokens:n.t,SEMVER_SPEC_VERSION:i.SEMVER_SPEC_VERSION,RELEASE_TYPES:i.RELEASE_TYPES,compareIdentifiers:o.compareIdentifiers,rcompareIdentifiers:o.rcompareIdentifiers}},3486:e=>{const t=Number.MAX_SAFE_INTEGER||9007199254740991;e.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:t,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},116:e=>{const t="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=t},175:e=>{const t=/^[0-9]+$/,r=(e,r)=>{const n=t.test(e),i=t.test(r);return n&&i&&(e=+e,r=+r),e===r?0:n&&!i?-1:i&&!n?1:er(t,e)}},3974:e=>{e.exports=class{constructor(){this.max=1e3,this.map=new Map}get(e){const t=this.map.get(e);return void 0===t?void 0:(this.map.delete(e),this.map.set(e,t),t)}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}},9287:e=>{const t=Object.freeze({loose:!0}),r=Object.freeze({});e.exports=e=>e?"object"!=typeof e?t:e:r},978:(e,t,r)=>{const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:a}=r(3486),o=r(116),s=(t=e.exports={}).re=[],l=t.safeRe=[],u=t.src=[],c=t.safeSrc=[],d=t.t={};let h=0;const p="[a-zA-Z0-9-]",f=[["\\s",1],["\\d",a],[p,i]],m=(e,t,r)=>{const n=(e=>{for(const[t,r]of f)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e})(t),i=h++;o(e,i,t),d[e]=i,u[i]=t,c[i]=n,s[i]=new RegExp(t,r?"g":void 0),l[i]=new RegExp(n,r?"g":void 0)};m("NUMERICIDENTIFIER","0|[1-9]\\d*"),m("NUMERICIDENTIFIERLOOSE","\\d+"),m("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${p}*`),m("MAINVERSION",`(${u[d.NUMERICIDENTIFIER]})\\.(${u[d.NUMERICIDENTIFIER]})\\.(${u[d.NUMERICIDENTIFIER]})`),m("MAINVERSIONLOOSE",`(${u[d.NUMERICIDENTIFIERLOOSE]})\\.(${u[d.NUMERICIDENTIFIERLOOSE]})\\.(${u[d.NUMERICIDENTIFIERLOOSE]})`),m("PRERELEASEIDENTIFIER",`(?:${u[d.NUMERICIDENTIFIER]}|${u[d.NONNUMERICIDENTIFIER]})`),m("PRERELEASEIDENTIFIERLOOSE",`(?:${u[d.NUMERICIDENTIFIERLOOSE]}|${u[d.NONNUMERICIDENTIFIER]})`),m("PRERELEASE",`(?:-(${u[d.PRERELEASEIDENTIFIER]}(?:\\.${u[d.PRERELEASEIDENTIFIER]})*))`),m("PRERELEASELOOSE",`(?:-?(${u[d.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[d.PRERELEASEIDENTIFIERLOOSE]})*))`),m("BUILDIDENTIFIER",`${p}+`),m("BUILD",`(?:\\+(${u[d.BUILDIDENTIFIER]}(?:\\.${u[d.BUILDIDENTIFIER]})*))`),m("FULLPLAIN",`v?${u[d.MAINVERSION]}${u[d.PRERELEASE]}?${u[d.BUILD]}?`),m("FULL",`^${u[d.FULLPLAIN]}$`),m("LOOSEPLAIN",`[v=\\s]*${u[d.MAINVERSIONLOOSE]}${u[d.PRERELEASELOOSE]}?${u[d.BUILD]}?`),m("LOOSE",`^${u[d.LOOSEPLAIN]}$`),m("GTLT","((?:<|>)?=?)"),m("XRANGEIDENTIFIERLOOSE",`${u[d.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),m("XRANGEIDENTIFIER",`${u[d.NUMERICIDENTIFIER]}|x|X|\\*`),m("XRANGEPLAIN",`[v=\\s]*(${u[d.XRANGEIDENTIFIER]})(?:\\.(${u[d.XRANGEIDENTIFIER]})(?:\\.(${u[d.XRANGEIDENTIFIER]})(?:${u[d.PRERELEASE]})?${u[d.BUILD]}?)?)?`),m("XRANGEPLAINLOOSE",`[v=\\s]*(${u[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[d.XRANGEIDENTIFIERLOOSE]})(?:${u[d.PRERELEASELOOSE]})?${u[d.BUILD]}?)?)?`),m("XRANGE",`^${u[d.GTLT]}\\s*${u[d.XRANGEPLAIN]}$`),m("XRANGELOOSE",`^${u[d.GTLT]}\\s*${u[d.XRANGEPLAINLOOSE]}$`),m("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),m("COERCE",`${u[d.COERCEPLAIN]}(?:$|[^\\d])`),m("COERCEFULL",u[d.COERCEPLAIN]+`(?:${u[d.PRERELEASE]})?`+`(?:${u[d.BUILD]})?(?:$|[^\\d])`),m("COERCERTL",u[d.COERCE],!0),m("COERCERTLFULL",u[d.COERCEFULL],!0),m("LONETILDE","(?:~>?)"),m("TILDETRIM",`(\\s*)${u[d.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",m("TILDE",`^${u[d.LONETILDE]}${u[d.XRANGEPLAIN]}$`),m("TILDELOOSE",`^${u[d.LONETILDE]}${u[d.XRANGEPLAINLOOSE]}$`),m("LONECARET","(?:\\^)"),m("CARETTRIM",`(\\s*)${u[d.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",m("CARET",`^${u[d.LONECARET]}${u[d.XRANGEPLAIN]}$`),m("CARETLOOSE",`^${u[d.LONECARET]}${u[d.XRANGEPLAINLOOSE]}$`),m("COMPARATORLOOSE",`^${u[d.GTLT]}\\s*(${u[d.LOOSEPLAIN]})$|^$`),m("COMPARATOR",`^${u[d.GTLT]}\\s*(${u[d.FULLPLAIN]})$|^$`),m("COMPARATORTRIM",`(\\s*)${u[d.GTLT]}\\s*(${u[d.LOOSEPLAIN]}|${u[d.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",m("HYPHENRANGE",`^\\s*(${u[d.XRANGEPLAIN]})\\s+-\\s+(${u[d.XRANGEPLAIN]})\\s*$`),m("HYPHENRANGELOOSE",`^\\s*(${u[d.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[d.XRANGEPLAINLOOSE]})\\s*$`),m("STAR","(<|>)?=?\\s*\\*"),m("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),m("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},3519:(e,t,r)=>{const n=r(6055);e.exports=(e,t,r)=>n(e,t,">",r)},344:(e,t,r)=>{const n=r(1451);e.exports=(e,t,r)=>(e=new n(e,r),t=new n(t,r),e.intersects(t,r))},9914:(e,t,r)=>{const n=r(6055);e.exports=(e,t,r)=>n(e,t,"<",r)},2432:(e,t,r)=>{const n=r(8152),i=r(1451);e.exports=(e,t,r)=>{let a=null,o=null,s=null;try{s=new i(t,r)}catch(e){return null}return e.forEach((e=>{s.test(e)&&(a&&-1!==o.compare(e)||(a=e,o=new n(a,r)))})),a}},5210:(e,t,r)=>{const n=r(8152),i=r(1451);e.exports=(e,t,r)=>{let a=null,o=null,s=null;try{s=new i(t,r)}catch(e){return null}return e.forEach((e=>{s.test(e)&&(a&&1!==o.compare(e)||(a=e,o=new n(a,r)))})),a}},1505:(e,t,r)=>{const n=r(8152),i=r(1451),a=r(1888);e.exports=(e,t)=>{e=new i(e,t);let r=new n("0.0.0");if(e.test(r))return r;if(r=new n("0.0.0-0"),e.test(r))return r;r=null;for(let t=0;t{const t=new n(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":o&&!a(t,o)||(o=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})),!o||r&&!a(r,o)||(r=o)}return r&&e.test(r)?r:null}},6055:(e,t,r)=>{const n=r(8152),i=r(404),{ANY:a}=i,o=r(1451),s=r(5034),l=r(1888),u=r(4647),c=r(5428),d=r(4333);e.exports=(e,t,r,h)=>{let p,f,m,g,v;switch(e=new n(e,h),t=new o(t,h),r){case">":p=l,f=c,m=u,g=">",v=">=";break;case"<":p=u,f=d,m=l,g="<",v="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(s(e,t,h))return!1;for(let r=0;r{e.semver===a&&(e=new i(">=0.0.0")),o=o||e,s=s||e,p(e.semver,o.semver,h)?o=e:m(e.semver,s.semver,h)&&(s=e)})),o.operator===g||o.operator===v)return!1;if((!s.operator||s.operator===g)&&f(e,s.semver))return!1;if(s.operator===v&&m(e,s.semver))return!1}return!0}},8921:(e,t,r)=>{const n=r(5034),i=r(7956);e.exports=(e,t,r)=>{const a=[];let o=null,s=null;const l=e.sort(((e,t)=>i(e,t,r)));for(const e of l){n(e,t,r)?(s=e,o||(o=e)):(s&&a.push([o,s]),s=null,o=null)}o&&a.push([o,null]);const u=[];for(const[e,t]of a)e===t?u.push(e):t||e!==l[0]?t?e===l[0]?u.push(`<=${t}`):u.push(`${e} - ${t}`):u.push(`>=${e}`):u.push("*");const c=u.join(" || "),d="string"==typeof t.raw?t.raw:String(t);return c.length{const n=r(1451),i=r(404),{ANY:a}=i,o=r(5034),s=r(7956),l=[new i(">=0.0.0-0")],u=[new i(">=0.0.0")],c=(e,t,r)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===a){if(1===t.length&&t[0].semver===a)return!0;e=r.includePrerelease?l:u}if(1===t.length&&t[0].semver===a){if(r.includePrerelease)return!0;t=u}const n=new Set;let i,c,p,f,m,g,v;for(const t of e)">"===t.operator||">="===t.operator?i=d(i,t,r):"<"===t.operator||"<="===t.operator?c=h(c,t,r):n.add(t.semver);if(n.size>1)return null;if(i&&c){if(p=s(i.semver,c.semver,r),p>0)return null;if(0===p&&(">="!==i.operator||"<="!==c.operator))return null}for(const e of n){if(i&&!o(e,String(i),r))return null;if(c&&!o(e,String(c),r))return null;for(const n of t)if(!o(e,String(n),r))return!1;return!0}let y=!(!c||r.includePrerelease||!c.semver.prerelease.length)&&c.semver,b=!(!i||r.includePrerelease||!i.semver.prerelease.length)&&i.semver;y&&1===y.prerelease.length&&"<"===c.operator&&0===y.prerelease[0]&&(y=!1);for(const e of t){if(v=v||">"===e.operator||">="===e.operator,g=g||"<"===e.operator||"<="===e.operator,i)if(b&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===b.major&&e.semver.minor===b.minor&&e.semver.patch===b.patch&&(b=!1),">"===e.operator||">="===e.operator){if(f=d(i,e,r),f===e&&f!==i)return!1}else if(">="===i.operator&&!o(i.semver,String(e),r))return!1;if(c)if(y&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===y.major&&e.semver.minor===y.minor&&e.semver.patch===y.patch&&(y=!1),"<"===e.operator||"<="===e.operator){if(m=h(c,e,r),m===e&&m!==c)return!1}else if("<="===c.operator&&!o(c.semver,String(e),r))return!1;if(!e.operator&&(c||i)&&0!==p)return!1}return!(i&&g&&!c&&0!==p)&&(!(c&&v&&!i&&0!==p)&&(!b&&!y))},d=(e,t,r)=>{if(!e)return t;const n=s(e.semver,t.semver,r);return n>0?e:n<0||">"===t.operator&&">="===e.operator?t:e},h=(e,t,r)=>{if(!e)return t;const n=s(e.semver,t.semver,r);return n<0?e:n>0||"<"===t.operator&&"<="===e.operator?t:e};e.exports=(e,t,r={})=>{if(e===t)return!0;e=new n(e,r),t=new n(t,r);let i=!1;e:for(const n of e.set){for(const e of t.set){const t=c(n,e,r);if(i=i||null!==t,t)continue e}if(i)return!1}return!0}},8427:(e,t,r)=>{const n=r(1451);e.exports=(e,t)=>new n(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")))},6950:(e,t,r)=>{const n=r(1451);e.exports=(e,t)=>{try{return new n(e,t).range||"*"}catch(e){return null}}},3342:(e,t,r)=>{"use strict";r.d(t,{H9:()=>sn,yP:()=>Lo,mI:()=>Bo,d0:()=>_d,fS:()=>ms,UU:()=>de,xK:()=>$u,gF:()=>Bu,Es:()=>xo,vA:()=>Iu,G1:()=>ju,Bs:()=>ee,So:()=>ke,dt:()=>En,WM:()=>fu,KE:()=>nu,JZ:()=>Le,Pj:()=>Co,n1:()=>rc,Sh:()=>Dt,Eb:()=>Bi,Lw:()=>zs,Gg:()=>n,Is:()=>Ns,jh:()=>Tt,Go:()=>Ed});var n={};r.r(n),r.d(n,{K2:()=>Gn});var i={};r.r(i);var a=r(5959),o=r.n(a),s=r(1159),l=r(7781),u=r(8531),c=Object.defineProperty,d=Object.getOwnPropertySymbols,h=Object.prototype.hasOwnProperty,p=Object.prototype.propertyIsEnumerable,f=(e,t,r)=>t in e?c(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,m=(e,t)=>{for(var r in t||(t={}))h.call(t,r)&&f(e,r,t[r]);if(d)for(var r of d(t))p.call(t,r)&&f(e,r,t[r]);return e};function g(e,t){const r=m({},u.locationService.getSearchObject());if(t)for(const e of Object.keys(r))t.includes(e)||delete r[e];return l.urlUtil.renderUrl(l.locationUtil.assureBaseUrl(e),r)}function v(e,t){return o().createElement(e.Component,{model:e,routeProps:t})}var y=Object.defineProperty,b=Object.defineProperties,w=Object.getOwnPropertyDescriptors,S=Object.getOwnPropertySymbols,x=Object.prototype.hasOwnProperty,O=Object.prototype.propertyIsEnumerable,_=(e,t,r)=>t in e?y(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;const E=new Map;var k=r(1269);const C={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let T;const A=new Uint8Array(16);function R(){if(!T&&(T="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!T))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return T(A)}const D=[];for(let e=0;e<256;++e)D.push((e+256).toString(16).slice(1));function P(e,t=0){return D[e[t+0]]+D[e[t+1]]+D[e[t+2]]+D[e[t+3]]+"-"+D[e[t+4]]+D[e[t+5]]+"-"+D[e[t+6]]+D[e[t+7]]+"-"+D[e[t+8]]+D[e[t+9]]+"-"+D[e[t+10]]+D[e[t+11]]+D[e[t+12]]+D[e[t+13]]+D[e[t+14]]+D[e[t+15]]}const j=function(e,t,r){if(C.randomUUID&&!t&&!e)return C.randomUUID();const n=(e=e||{}).random||(e.rng||R)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(let e=0;e<16;++e)t[r+e]=n[e];return t}return P(n)};var I=Object.defineProperty,L=Object.defineProperties,M=Object.getOwnPropertyDescriptors,N=Object.getOwnPropertySymbols,F=Object.prototype.hasOwnProperty,V=Object.prototype.propertyIsEnumerable,z=(e,t,r)=>t in e?I(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;const B=o().memo((function(e){var t,r=e,{model:n}=r,i=((e,t)=>{var r={};for(var n in e)F.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&N)for(var n of N(e))t.indexOf(n)<0&&V.call(e,n)&&(r[n]=e[n]);return r})(r,["model"]);const s=null!=(t=n.constructor.Component)?t:$,[l,u]=(0,a.useState)(0);return(0,a.useEffect)((()=>{const e=n.activate();return u((e=>e+1)),e}),[n]),n.isActive?o().createElement(s,(c=((e,t)=>{for(var r in t||(t={}))F.call(t,r)&&z(e,r,t[r]);if(N)for(var r of N(t))V.call(t,r)&&z(e,r,t[r]);return e})({},i),L(c,M({model:n})))):null;var c}));function $(e){return null}class U extends l.BusEventWithPayload{}U.type="scene-object-state-change";class q extends l.BusEventWithPayload{}q.type="scene-object-user-action";var H,W=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)};class G{constructor(e){var t,r,n,i;((e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)})(this,H,void 0),n=e,W(t=this,r=H,"write to private field"),i?i.call(t,n):r.set(t,n)}resolve(){return W(e=this,t=H,"read from private field"),r?r.call(e):t.get(e);var e,t,r}}H=new WeakMap;var Q=Object.defineProperty,K=Object.getOwnPropertySymbols,X=Object.prototype.hasOwnProperty,J=Object.prototype.propertyIsEnumerable,Y=(e,t,r)=>t in e?Q(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Z=(e,t)=>{for(var r in t||(t={}))X.call(t,r)&&Y(e,r,t[r]);if(K)for(var r of K(t))J.call(t,r)&&Y(e,r,t[r]);return e};class ee{constructor(e){this._isActive=!1,this._activationHandlers=[],this._deactivationHandlers=new Map,this._subs=new k.Subscription,this._refCount=0,e.key||(e.key=j()),this._events=new l.EventBusSrv,this._state=Object.freeze(e),this._setParent(this._state)}get state(){return this._state}get isActive(){return this._isActive}get parent(){return this._parent}get variableDependency(){return this._variableDependency}get urlSync(){return this._urlSync}get Component(){return B}_setParent(e){re(e,(e=>{e._parent&&e._parent!==this&&console.warn("SceneObject already has a parent set that is different from the new parent. You cannot share the same SceneObject instance in multiple scenes or in multiple different places of the same scene graph. Use SceneObject.clone() to duplicate a SceneObject or store a state key reference and use sceneGraph.findObject to locate it.",e,this),e._parent=this}))}subscribeToState(e){return this._events.subscribe(U,(t=>{t.payload.changedObject===this&&e(t.payload.newState,t.payload.prevState)}))}subscribeToEvent(e,t){return this._events.subscribe(e,t)}setState(e){const t=this._state,r=Z(Z({},this._state),e);this._state=Object.freeze(r),this._setParent(e),this._handleActivationOfChangedStateProps(t,r),this.publishEvent(new U({prevState:t,newState:r,partialUpdate:e,changedObject:this}),!0)}_handleActivationOfChangedStateProps(e,t){this.isActive&&(e.$behaviors!==t.$behaviors&&this._handleChangedBehaviors(e.$behaviors,t.$behaviors),e.$data!==t.$data&&this._handleChangedStateActivation(e.$data,t.$data),e.$variables!==t.$variables&&this._handleChangedStateActivation(e.$variables,t.$variables),e.$timeRange!==t.$timeRange&&this._handleChangedStateActivation(e.$timeRange,t.$timeRange))}_handleChangedStateActivation(e,t){if(e){const t=this._deactivationHandlers.get(e);t&&(t(),this._deactivationHandlers.delete(e))}t&&this._deactivationHandlers.set(t,t.activate())}_handleChangedBehaviors(e,t){if(e)for(const r of e)if(!t||!t.includes(r)){const e=this._deactivationHandlers.get(r);e&&(e(),this._deactivationHandlers.delete(r))}if(t)for(const r of t)e&&e.includes(r)||this._activateBehavior(r)}publishEvent(e,t){this._events.publish(e),t&&this.parent&&this.parent.publishEvent(e,t)}getRoot(){return this._parent?this._parent.getRoot():this}_internalActivate(){this._isActive=!0;const{$data:e,$variables:t,$timeRange:r,$behaviors:n}=this.state;if(this._activationHandlers.forEach((e=>{const t=e();t&&this._deactivationHandlers.set(t,t)})),r&&!r.isActive&&this._deactivationHandlers.set(r,r.activate()),t&&!t.isActive&&this._deactivationHandlers.set(t,t.activate()),e&&!e.isActive&&this._deactivationHandlers.set(e,e.activate()),n)for(const e of n)this._activateBehavior(e)}_activateBehavior(e){if(e instanceof ee)this._deactivationHandlers.set(e,e.activate());else if("function"==typeof e){const t=e(this);t&&this._deactivationHandlers.set(e,t)}}activate(){this.isActive||this._internalActivate(),this._refCount++;let e=!1;return()=>{if(this._refCount--,e){throw new Error("SceneObject cancelation handler returned by activate() called a second time")}e=!0,0===this._refCount&&this._internalDeactivate()}}_internalDeactivate(){this._isActive=!1;for(let e of this._deactivationHandlers.values())e();this._deactivationHandlers.clear(),this._events.removeAllListeners(),this._subs.unsubscribe(),this._subs=new k.Subscription}useState(){return te(this)}forceRender(){this.setState({})}clone(e){return function(e,t){const r=ue(e.state,t);return new e.constructor(r)}(this,e)}addActivationHandler(e){this._activationHandlers.push(e)}forEachChild(e){re(this.state,e)}getRef(){return this._ref||(this._ref=new G(this)),this._ref}}function te(e,t){var r;const[n,i]=(0,a.useState)(e.state),o=e.state,s=null!=(r=null==t?void 0:t.shouldActivateOrKeepAlive)&&r;return(0,a.useEffect)((()=>{let t;s&&(t=e.activate());const r=e.subscribeToState((e=>{i(e)}));return e.state!==o&&i(e.state),()=>{r.unsubscribe(),t&&t()}}),[e,s]),e.state}function re(e,t){for(const r of Object.values(e))if(r instanceof ee&&t(r),Array.isArray(r))for(const e of r)e instanceof ee&&t(e)}var ne=Object.defineProperty,ie=Object.getOwnPropertySymbols,ae=Object.prototype.hasOwnProperty,oe=Object.prototype.propertyIsEnumerable,se=(e,t,r)=>t in e?ne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,le=(e,t)=>{for(var r in t||(t={}))ae.call(t,r)&&se(e,r,t[r]);if(ie)for(var r of ie(t))oe.call(t,r)&&se(e,r,t[r]);return e};function ue(e,t){const r=le({},e);for(const e in r){const t=r[e];if(t instanceof ee&&(r[e]=t.clone()),t instanceof G)throw new Error("Cannot clone a SceneObject with a SceneObjectRef in state");if(Array.isArray(t)){const n=[];for(const e of t)e instanceof ee?n.push(e.clone()):n.push(e);r[e]=n}}return Object.assign(r,t),r}function ce(e,t){let r,n=e;for(;n&&!r;)r=t(n),n=n.parent;return r}class de extends l.DataSourceApi{constructor(e,t){super({name:"RuntimeDataSource-"+e,uid:t,type:e,id:1,readOnly:!0,jsonData:{},access:"direct",meta:{id:e,name:"RuntimeDataSource-"+e,type:l.PluginType.datasource,info:{author:{name:""},description:"",links:[],logos:{large:"",small:""},screenshots:[],updated:"",version:""},module:"",baseUrl:""}})}testDatasource(){return Promise.resolve({})}}const he=new Map;var pe=r(3241);class fe{constructor(){this.index=new Map}getUniqueKey(e,t){const r=this.index.get(e);if(!r)throw new Error("Cannot find any scene object that uses the key '"+e+"'");const n=r.findIndex((e=>e.sceneObject===t));return n>0?`${e}-${n+1}`:e}rebuildIndex(e){this.index.clear(),this.buildIndex(e,0)}buildIndex(e,t){if(e.urlSync)for(const r of e.urlSync.getKeys()){const n=this.index.get(r);n?(n.push({sceneObject:e,depth:t}),n.sort(((e,t)=>e.depth-t.depth))):this.index.set(r,[{sceneObject:e,depth:t}])}e.forEachChild((e=>this.buildIndex(e,t+1)))}}function me(e){const t=new fe;t.rebuildIndex(e);const r={},n=e=>{if(e.urlSync){const n=e.urlSync.getUrlState();for(const[i,a]of Object.entries(n))if(null!=a){const n=t.getUniqueKey(i,e);r[n]=a}}e.forEachChild(n)};return n(e),r}function ge(e,t,r){if(e.urlSync){const n={},i=e.urlSync.getUrlState();for(const a of e.urlSync.getKeys()){const o=r.getUniqueKey(a,e),s=t.getAll(o),l=i[a];ve(s,l)||(s.length>0?Array.isArray(l)?n[a]=s:n[a]=s[0]:n[a]=null)}Object.keys(n).length>0&&e.urlSync.updateFromUrl(n)}e.forEachChild((e=>ge(e,t,r)))}function ve(e,t){return 0===e.length&&null==t||(Array.isArray(t)||1!==(null==e?void 0:e.length)?0===(null==t?void 0:t.length)&&null===e||(0,pe.isEqual)(e,t):t===e[0])}var ye=r(1625);ye.ob.Auto;var be=(e=>(e.NotStarted="NotStarted",e.Loading="Loading",e.Streaming="Streaming",e.Done="Done",e.Error="Error",e))(be||{}),we=Object.defineProperty,Se=Object.getOwnPropertySymbols,xe=Object.prototype.hasOwnProperty,Oe=Object.prototype.propertyIsEnumerable,_e=(e,t,r)=>t in e?we(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;const Ee={state:be.Done,series:[],timeRange:(0,l.getDefaultTimeRange)()};class ke{constructor(e,t){this._sceneObject=e,this._keys=t.keys}getKeys(){return"function"==typeof this._keys?this._keys():this._keys}getUrlState(){return this._sceneObject.getUrlState()}updateFromUrl(e){this._sceneObject.updateFromUrl(e)}}const Ce=/^\d+[yYmMsSwWhHdD]$/;function Te(e){if("string"!=typeof e)return null;if(-1!==e.indexOf("now"))return e;if(Ce.test(e))return e;if(8===e.length){const t=(0,l.toUtc)(e,"YYYYMMDD");if(t.isValid())return t.toISOString()}else if(15===e.length){const t=(0,l.toUtc)(e,"YYYYMMDDTHHmmss");if(t.isValid())return t.toISOString()}else if(24===e.length){return(0,l.toUtc)(e).toISOString()}const t=parseInt(e,10);return isNaN(t)?null:(0,l.toUtc)(t).toISOString()}function Ae(e,t,r,n,i){const a=i&&"now"===t;return{from:l.dateMath.parse(e,!1,r,n),to:l.dateMath.parse(a?"now-"+i:t,!0,r,n),raw:{from:e,to:t}}}var Re=Object.defineProperty,De=Object.getOwnPropertySymbols,Pe=Object.prototype.hasOwnProperty,je=Object.prototype.propertyIsEnumerable,Ie=(e,t,r)=>t in e?Re(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;class Le extends ee{constructor(e={}){var t,r;const n=null!=(t=e.from)?t:"now-6h",i=null!=(r=e.to)?r:"now",a=e.timeZone;super(((e,t)=>{for(var r in t||(t={}))Pe.call(t,r)&&Ie(e,r,t[r]);if(De)for(var r of De(t))je.call(t,r)&&Ie(e,r,t[r]);return e})({from:n,to:i,timeZone:a,value:Ae(n,i,a||(0,l.getTimeZone)(),e.fiscalYearStartMonth,e.UNSAFE_nowDelay)},e)),this._urlSync=new ke(this,{keys:["from","to","timezone"]}),this.onTimeRangeChange=e=>{const t={},r={};"string"==typeof e.raw.from?(t.from=e.raw.from,r.from=e.raw.from):(t.from=e.raw.from.toISOString(),r.from=e.raw.from.toISOString(!0)),"string"==typeof e.raw.to?(t.to=e.raw.to,r.to=e.raw.to):(t.to=e.raw.to.toISOString(),r.to=e.raw.to.toISOString(!0)),t.value=Ae(r.from,r.to,this.getTimeZone(),this.state.fiscalYearStartMonth,this.state.UNSAFE_nowDelay),t.from===this.state.from&&t.to===this.state.to||this.setState(t)},this.onTimeZoneChange=e=>{this.setState({timeZone:e})},this.onRefresh=()=>{this.setState({value:Ae(this.state.from,this.state.to,this.getTimeZone(),this.state.fiscalYearStartMonth,this.state.UNSAFE_nowDelay)})},this.addActivationHandler(this._onActivate.bind(this))}_onActivate(){if(!this.state.timeZone){const e=this.getTimeZoneSource();e!==this&&this._subs.add(e.subscribeToState(((t,r)=>{void 0!==t.timeZone&&t.timeZone!==r.timeZone&&this.setState({value:Ae(this.state.from,this.state.to,e.getTimeZone(),this.state.fiscalYearStartMonth,this.state.UNSAFE_nowDelay)})})))}return this.state.weekStart&&(0,l.setWeekStart)(this.state.weekStart),()=>{this.state.weekStart&&(0,l.setWeekStart)(u.config.bootData.user.weekStart)}}getTimeZoneSource(){if(!this.parent||!this.parent.parent)return this;const e=ce(this.parent.parent,(e=>{if(e.state.$timeRange&&e.state.$timeRange.state.timeZone)return e.state.$timeRange}));return e||this}getTimeZone(){if(this.state.timeZone)return this.state.timeZone;const e=this.getTimeZoneSource();return e!==this?e.state.timeZone:(0,l.getTimeZone)()}getUrlState(){const e={from:this.state.from,to:this.state.to};return this.state.timeZone&&(e.timezone=this.state.timeZone),e}updateFromUrl(e){var t,r,n;if(!e.to&&!e.from)return;const i={},a=Te(e.from);a&&(i.from=a);const o=Te(e.to);o&&(i.to=o),"string"==typeof e.timezone&&(i.timeZone=""!==e.timezone?e.timezone:void 0),i.value=Ae(null!=(t=i.from)?t:this.state.from,null!=(r=i.to)?r:this.state.to,null!=(n=i.timeZone)?n:this.getTimeZone(),this.state.fiscalYearStartMonth,this.state.UNSAFE_nowDelay),this.setState(i)}}const Me=new class extends ee{constructor(e){super(((e,t)=>{for(var r in t||(t={}))xe.call(t,r)&&_e(e,r,t[r]);if(Se)for(var r of Se(t))Oe.call(t,r)&&_e(e,r,t[r]);return e})({data:Ee},e))}getResultsStream(){const e={origin:this,data:this.state.data};return(0,k.of)(e)}},Ne=new Le;const Fe=new class extends ee{constructor(){super({variables:[]})}getByName(e){}isVariableLoadingOrWaitingToUpdate(e){return!1}};function Ve(e){var t;return null!=(t=ce(e,(e=>e.state.$timeRange)))?t:Ne}class ze extends l.BusEventWithPayload{}function Be(e){return"object"==typeof e&&"formatter"in e}ze.type="scene-variable-changed-value";let $e,Ue={};function qe(e){const t=Ue[e];return t||(Ue[e]=(0,pe.property)(e))}class He{constructor(e,t){this.state={name:e,value:t,type:"scopedvar"}}getValue(e){let{value:t}=this.state,r=t.value;return r=e?qe(e)(t.value):t.value,"string"===r||"number"===r||"boolean"===r?r:String(r)}getValueText(){const{value:e}=this.state;return null!=e.text?String(e.text):String(e)}}const We=new l.Registry((()=>[{id:ye.$m.Lucene,name:"Lucene",description:"Values are lucene escaped and multi-valued variables generate an OR expression",formatter:e=>{if("string"==typeof e)return Ge(e);if(Array.isArray(e)){if(0===e.length)return"__empty__";return"("+(0,pe.map)(e,(e=>'"'+Ge(e)+'"')).join(" OR ")+")"}return Ge(`${e}`)}},{id:ye.$m.Raw,name:"raw",description:"Keep value as is",formatter:e=>String(e)},{id:ye.$m.Regex,name:"Regex",description:"Values are regex escaped and multi-valued variables generate a (|) expression",formatter:e=>{if("string"==typeof e)return(0,l.escapeRegex)(e);if(Array.isArray(e)){const t=e.map((e=>"string"==typeof e?(0,l.escapeRegex)(e):(0,l.escapeRegex)(String(e))));return 1===t.length?t[0]:"("+t.join("|")+")"}return(0,l.escapeRegex)(`${e}`)}},{id:ye.$m.Pipe,name:"Pipe",description:"Values are separated by | character",formatter:e=>"string"==typeof e?e:Array.isArray(e)?e.join("|"):`${e}`},{id:ye.$m.Distributed,name:"Distributed",description:"Multiple values are formatted like variable=value",formatter:(e,t,r)=>"string"==typeof e?e:Array.isArray(e)?(e=(0,pe.map)(e,((e,t)=>0!==t?r.state.name+"="+e:e))).join(","):`${e}`},{id:ye.$m.CSV,name:"Csv",description:"Comma-separated values",formatter:e=>"string"==typeof e?e:(0,pe.isArray)(e)?e.join(","):String(e)},{id:ye.$m.HTML,name:"HTML",description:"HTML escaping of values",formatter:e=>"string"==typeof e?l.textUtil.escapeHtml(e):(0,pe.isArray)(e)?l.textUtil.escapeHtml(e.join(", ")):l.textUtil.escapeHtml(String(e))},{id:ye.$m.JSON,name:"JSON",description:"JSON stringify value",formatter:e=>"string"==typeof e?e:JSON.stringify(e)},{id:ye.$m.PercentEncode,name:"Percent encode",description:"Useful for URL escaping values",formatter:e=>(0,pe.isArray)(e)?Qe("{"+e.join(",")+"}"):Qe(e)},{id:ye.$m.SingleQuote,name:"Single quote",description:"Single quoted values",formatter:e=>{const t=new RegExp("'","g");if((0,pe.isArray)(e))return(0,pe.map)(e,(e=>`'${(0,pe.replace)(e,t,"\\'")}'`)).join(",");let r="string"==typeof e?e:String(e);return`'${(0,pe.replace)(r,t,"\\'")}'`}},{id:ye.$m.DoubleQuote,name:"Double quote",description:"Double quoted values",formatter:e=>{const t=new RegExp('"',"g");if((0,pe.isArray)(e))return(0,pe.map)(e,(e=>`"${(0,pe.replace)(e,t,'\\"')}"`)).join(",");let r="string"==typeof e?e:String(e);return`"${(0,pe.replace)(r,t,'\\"')}"`}},{id:ye.$m.SQLString,name:"SQL string",description:"SQL string quoting and commas for use in IN statements and other scenarios",formatter:Ze},{id:ye.$m.Date,name:"Date",description:"Format date in different ways",formatter:(e,t)=>{var r;let n=NaN;if("number"==typeof e?n=e:"string"==typeof e&&(n=parseInt(e,10)),isNaN(n))return"NaN";const i=null!=(r=t[0])?r:"iso";switch(i){case"ms":return String(e);case"seconds":return`${Math.round(n/1e3)}`;case"iso":return(0,l.dateTime)(n).toISOString();default:return(t||[]).length>1?(0,l.dateTime)(n).format(t.join(":")):(0,l.dateTime)(n).format(i)}}},{id:ye.$m.Glob,name:"Glob",description:"Format multi-valued variables using glob syntax, example {value1,value2}",formatter:e=>(0,pe.isArray)(e)&&e.length>1?"{"+e.join(",")+"}":String(e)},{id:ye.$m.Text,name:"Text",description:"Format variables in their text representation. Example in multi-variable scenario A + B + C.",formatter:(e,t,r)=>r.getValueText?r.getValueText():String(e)},{id:ye.$m.QueryParam,name:"Query parameter",description:"Format variables as URL parameters. Example in multi-variable scenario A + B + C => var-foo=A&var-foo=B&var-foo=C.",formatter:(e,t,r)=>Array.isArray(e)?e.map((e=>Je(r.state.name,e))).join("&"):Je(r.state.name,e)},{id:ye.$m.UriEncode,name:"Percent encode as URI",description:"Useful for URL escaping values, taking into URI syntax characters",formatter:e=>(0,pe.isArray)(e)?Ke("{"+e.join(",")+"}"):Ke(e)}]));function Ge(e){return!1===isNaN(+e)?e:e.replace(/([\!\*\+\-\=<>\s\&\|\(\)\[\]\{\}\^\~\?\:\\/"])/g,"\\$1")}function Qe(e){return"object"==typeof e&&(e=String(e)),Xe(encodeURIComponent(e))}const Ke=e=>Xe(encodeURI(String(e))),Xe=e=>e.replace(/[!'()*]/g,(e=>"%"+e.charCodeAt(0).toString(16).toUpperCase()));function Je(e,t){return`var-${e}=${Qe(t)}`}const Ye={"'":"''",'"':'\\"'};function Ze(e){const t=new RegExp("'|\"","g");if((0,pe.isArray)(e))return(0,pe.map)(e,(e=>`'${(0,pe.replace)(e,t,(e=>{var t;return null!=(t=Ye[e])?t:""}))}'`)).join(",");let r="string"==typeof e?e:String(e);return`'${(0,pe.replace)(r,t,(e=>{var t;return null!=(t=Ye[e])?t:""}))}'`}const et="All",tt="$__all",rt="$__auto",nt=/\$(\w+)|\[\[(\w+?)(?::(\w+))?\]\]|\${(\w+)(?:\.([^:^\}]+))?(?::([^\}]+))?}/g,it="__searchFilter";function at(e,t){const r=t.state.$variables;if(!r)return t.parent?at(e,t.parent):null;const n=r.getByName(e);return n||(t.parent?at(e,t.parent):null)}function ot(e,t,r,n,i){return t?(nt.lastIndex=0,t.replace(nt,((t,a,o,s,l,u,c)=>{const d=a||o||l,h=s||c||n,p=function(e,t,r,n){if(r&&r.hasOwnProperty(e)){const t=r[e];if(t)return function(e,t){return $e?($e.state.name=e,$e.state.value=t):$e=new He(e,t),$e}(e,t)}const i=at(e,n);if(i)return i;const a=Ct.get(e);if(a)return new a(e,n,t,r);return null}(d,t,r,e);if(!p)return i&&i.push({match:t,variableName:d,fieldPath:u,format:h,value:t,found:!1}),t;const f=function(e,t,r,n){if(null==r)return"";if(Be(r))return ot(e,r.formatter(n));Array.isArray(r)||"object"!=typeof r||(r=`${r}`);if("function"==typeof n)return n(r,{name:t.state.name,type:t.state.type,multi:t.state.isMulti,includeAll:t.state.includeAll});let i=[];n?(i=n.split(":"),i.length>1?(n=i[0],i=i.slice(1)):i=[]):n=ye.$m.Glob;let a=We.getIfExists(n);a||(console.error(`Variable format ${n} not found. Using glob format as fallback.`),a=We.get(ye.$m.Glob));return a.formatter(r,i,t)}(e,p,p.getValue(u),h);return i&&i.push({match:t,variableName:d,fieldPath:u,format:h,value:f,found:f!==t}),f}))):null!=t?t:""}function st(e){return void 0!==e.useState}function lt(e){return"enrichDataRequest"in e}function ut(e){return"isDataLayer"in e}function ct(e){var t;return null!=(t=ce(e,(e=>e.state.$data)))?t:Me}function dt(e,t,r,n){if(t(e))return e;let i=null;return e.forEachChild((e=>{if(e===r)return;let n=dt(e,t);n&&(i=n)})),i||(n&&e.parent?dt(e.parent,t,e,!0):null)}function ht(e,t){return dt(e,t,void 0,!0)}new WeakMap;class pt{constructor(e){this._value=e}formatter(){return this._value}}class ft{constructor(e,t){this.state={name:e,type:"time_macro"},this._sceneObject=t}getValue(){const e=Ve(this._sceneObject);return"__from"===this.state.name?e.state.value.from.valueOf():e.state.value.to.valueOf()}getValueText(){const e=Ve(this._sceneObject);return"__from"===this.state.name?(0,l.dateTimeFormat)(e.state.value.from,{timeZone:e.getTimeZone()}):(0,l.dateTimeFormat)(e.state.value.to,{timeZone:e.getTimeZone()})}}class mt{constructor(e,t,r){this.state={name:e,type:"time_macro",match:r},this._sceneObject=t}getValue(){var e;const t=ct(this._sceneObject);if(t){const r=null==(e=t.state.data)?void 0:e.request;return r?"__interval_ms"===this.state.name?r.intervalMs:r.interval:this.state.match}return this.state.match}}function gt(e,t={}){if(e.state.$variables)for(const r of e.state.$variables.state.variables)r.state.skipUrlSync||t[r.state.name]||(t[r.state.name]=r);return e.parent&>(e.parent,t),t}var vt=Object.defineProperty,yt=Object.defineProperties,bt=Object.getOwnPropertyDescriptors,wt=Object.getOwnPropertySymbols,St=Object.prototype.hasOwnProperty,xt=Object.prototype.propertyIsEnumerable,Ot=(e,t,r)=>t in e?vt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;function _t(e,t,r){return new Proxy({},{get:(n,i)=>{return"name"===i?e.name:"displayName"===i?(0,l.getFieldDisplayName)(e,t,r):"labels"===i||"formattedLabels"===i?e.labels?(a=((e,t)=>{for(var r in t||(t={}))St.call(t,r)&&Ot(e,r,t[r]);if(wt)for(var r of wt(t))xt.call(t,r)&&Ot(e,r,t[r]);return e})({},e.labels),o={__values:Object.values(e.labels).sort().join(", "),toString:()=>(0,l.formatLabels)(e.labels,"",!0)},yt(a,bt(o))):"":void 0;var a,o}})}const Et=(0,l.getDisplayProcessor)();class kt{constructor(e){this._urlQueryParams=e}formatter(e){if(!e)return this._urlQueryParams;const t=e.split(":");if("exclude"===t[0]&&t.length>1){const e=new URLSearchParams(this._urlQueryParams);for(const r of t[1].split(","))e.delete(r);return`?${e}`}if("include"===t[0]&&t.length>1){const e=new URLSearchParams(this._urlQueryParams),r=t[1].split(",");for(const t of e.keys())r.includes(t)||e.delete(t);return`?${e}`}return this._urlQueryParams}}const Ct=new Map([[l.DataLinkBuiltInVars.includeVars,class{constructor(e,t){this.state={name:e,type:"url_variable"},this._sceneObject=t}getValue(){const e=gt(this._sceneObject),t=We.get(ye.$m.QueryParam),r=[];for(const n of Object.keys(e)){const i=e[n],a=i.getValue();a&&(Be(a)?r.push(a.formatter(ye.$m.QueryParam)):r.push(t.formatter(a,[],i)))}return new pt(r.join("&"))}getValueText(){return""}}],[l.DataLinkBuiltInVars.keepTime,class{constructor(e,t){this.state={name:e,type:"url_variable"},this._sceneObject=t}getValue(){var e;const t=null==(e=Ve(this._sceneObject).urlSync)?void 0:e.getUrlState();return new pt(l.urlUtil.toUrlParams(t))}getValueText(){return""}}],["__value",class{constructor(e,t,r,n){this._match=r,this._scopedVars=n,this.state={name:e,type:"__value"}}getValue(e){var t,r;const n=null==(t=this._scopedVars)?void 0:t.__dataContext;if(!n)return this._match;const{frame:i,rowIndex:a,field:o,calculatedValue:s}=n.value;if(s)switch(e){case"numeric":case"raw":return s.numeric;case"time":return"";default:return(0,l.formattedValueToString)(s)}if(null==a)return this._match;if("time"===e){const e=i.fields.find((e=>e.type===l.FieldType.time));return e?e.values.get(a):void 0}if(!o)return this._match;const u=o.values.get(a);if("raw"===e)return u;const c=(null!=(r=o.display)?r:Et)(u);return"numeric"===e?c.numeric:(0,l.formattedValueToString)(c)}getValueText(){return""}}],["__data",class{constructor(e,t,r,n){this._match=r,this._scopedVars=n,this.state={name:e,type:"__data"}}getValue(e){var t,r;const n=null==(t=this._scopedVars)?void 0:t.__dataContext;if(!n||!e)return this._match;const{frame:i,rowIndex:a}=n.value;if(void 0===a||void 0===e)return this._match;const o={name:i.name,refId:i.refId,fields:(0,l.getFieldDisplayValuesProxy)({frame:i,rowIndex:a})};return null!=(r=qe(e)(o))?r:""}getValueText(){return""}}],["__series",class{constructor(e,t,r,n){this._match=r,this._scopedVars=n,this.state={name:e,type:"__series"}}getValue(e){var t;const r=null==(t=this._scopedVars)?void 0:t.__dataContext;if(!r||!e)return this._match;if("name"!==e)return this._match;const{frame:n,frameIndex:i}=r.value;return(0,l.getFrameDisplayName)(n,i)}getValueText(){return""}}],["__field",class{constructor(e,t,r,n){this._match=r,this._scopedVars=n,this.state={name:e,type:"__field"}}getValue(e){var t,r;const n=null==(t=this._scopedVars)?void 0:t.__dataContext;if(!n||!e)return this._match;if(void 0===e||""===e)return this._match;const{frame:i,field:a,data:o}=n.value,s=_t(a,i,o);return null!=(r=qe(e)(s))?r:""}getValueText(){return""}}],["__url",class{constructor(e,t){this.state={name:e,type:"url_macro"}}getValue(e){var t;const r=u.locationService.getLocation(),n=null!=(t=u.config.appSubUrl)?t:"";switch(null!=e?e:""){case"params":return new kt(r.search);case"path":return n+r.pathname;default:return n+r.pathname+r.search}}getValueText(){return""}}],["__from",ft],["__to",ft],["__timezone",class{constructor(e,t){this.state={name:e,type:"time_macro"},this._sceneObject=t}getValue(){const e=Ve(this._sceneObject).getTimeZone();return"browser"===e?Intl.DateTimeFormat().resolvedOptions().timeZone:e}getValueText(){return this.getValue()}}],["__user",class{constructor(e,t){this.state={name:e,type:"user_macro"}}getValue(e){const t=u.config.bootData.user;switch(e){case"login":return t.login;case"email":return t.email;default:return String(t.id)}}getValueText(){return""}}],["__org",class{constructor(e,t){this.state={name:e,type:"org_macro"}}getValue(e){const t=u.config.bootData.user;return"name"===e?t.orgName:String(t.orgId)}getValueText(){return""}}],["__interval",mt],["__interval_ms",mt]]);const Tt={getVariables:function(e){var t;return null!=(t=ce(e,(e=>e.state.$variables)))?t:Fe},getData:ct,getTimeRange:Ve,getLayout:function(e){const t=ce(e,(e=>function(e){return"isDraggable"in e}(e)?e:void 0));return t||null},getDataLayers:function(e,t=!1){let r=e,n=[];for(;r;){const e=r.state.$data;if(e){if(ut(e)?n=n.concat(e):e.state.$data&&ut(e.state.$data)&&(n=n.concat(e.state.$data)),t&&n.length>0)break;r=r.parent}else r=r.parent}return n},interpolate:function(e,t,r,n,i){return""===t||null==t?"":ot(e,t,r,n,i)},lookupVariable:at,hasVariableDependencyInLoadingState:function(e){if(!e.variableDependency)return!1;for(const t of e.variableDependency.getNames()){const r=at(t,e);if(!r)continue;if(r.parent.isVariableLoadingOrWaitingToUpdate(r))return!0}return!1},findByKey:function(e,t){const r=ht(e,(e=>e.state.key===t));if(!r)throw new Error("Unable to find scene with key "+t);return r},findByKeyAndType:function(e,t,r){const n=ht(e,(e=>e.state.key===t));if(!n)throw new Error("Unable to find scene with key "+t);if(!(n instanceof r))throw new Error(`Found scene object with key ${t} does not match type ${r.name}`);return n},findObject:ht,findAllObjects:function e(t,r){const n=[];return t.forEachChild((t=>{r(t)&&n.push(t),n.push(...e(t,r))})),n},getAncestor:function(e,t){let r=e;for(;r;){if(r instanceof t)return r;r=r.parent}if(!r)throw new Error("Unable to find parent of type "+t.name);return r},getQueryController:function(e){let t=e;for(;t;){if(t.state.$behaviors)for(const e of t.state.$behaviors)if("isQueryController"in e)return e;t=t.parent}}};async function At(e,t){if(null==e?void 0:e.uid){const t=he.get(e.uid);if(t)return t}return e&&e.query?e:await(0,u.getDataSourceSrv)().get(e,t)}function Rt(e,t,...r){let n=!1;"undefined"!=typeof window&&(n="true"===localStorage.getItem("grafana.debug.scenes"))}class Dt{constructor(e,t){this._sceneObject=e,this._options=t,this._dependencies=new Set,this._isWaitingForVariables=!1,this.scanCount=0,this._statePaths=t.statePaths}hasDependencyOn(e){return this.getNames().has(e)}variableUpdateCompleted(e,t){const r=this.getNames();let n=!1;(r.has(e.state.name)||r.has(l.DataLinkBuiltInVars.includeVars))&&t&&(n=!0),Rt(0,0,e.state.name,this._isWaitingForVariables),this._options.onAnyVariableChanged&&this._options.onAnyVariableChanged(e),this._options.onVariableUpdateCompleted&&(this._isWaitingForVariables||n)&&this._options.onVariableUpdateCompleted(),n&&(this._options.onReferencedVariableValueChanged&&this._options.onReferencedVariableValueChanged(e),this._options.onReferencedVariableValueChanged||this._options.onVariableUpdateCompleted||this._sceneObject.forceRender())}hasDependencyInLoadingState(){return Tt.hasVariableDependencyInLoadingState(this._sceneObject)?(this._isWaitingForVariables=!0,!0):(this._isWaitingForVariables=!1,!1)}getNames(){const e=this._state,t=this._state=this._sceneObject.state;if(!e)return this.scanStateForDependencies(this._state),this._dependencies;if(t!==e)if(this._statePaths){for(const r of this._statePaths)if("*"===r||t[r]!==e[r]){this.scanStateForDependencies(t);break}}else this.scanStateForDependencies(t);return this._dependencies}setVariableNames(e){this._options.variableNames=e,this.scanStateForDependencies(this._state)}setPaths(e){this._statePaths=e}scanStateForDependencies(e){if(this._dependencies.clear(),this.scanCount+=1,this._options.variableNames)for(const e of this._options.variableNames)this._dependencies.add(e);if(this._statePaths)for(const t of this._statePaths){if("*"===t){this.extractVariablesFrom(e);break}{const r=e[t];r&&this.extractVariablesFrom(r)}}}extractVariablesFrom(e){nt.lastIndex=0;const t=("string"!=typeof e?An(e):e).matchAll(nt);if(t)for(const e of t){const[,t,r,,n]=e,i=t||r||n;this._dependencies.add(i)}}}class Pt{constructor(){this._values=new Map}recordCurrentDependencyValuesForSceneObject(e){if(this.clearValues(),e.variableDependency)for(const t of e.variableDependency.getNames()){const r=Tt.lookupVariable(t,e);r&&this._values.set(r.state.name,r.getValue())}}cloneAndRecordCurrentValuesForSceneObject(e){const t=new Pt;return t.recordCurrentDependencyValuesForSceneObject(e),t}clearValues(){this._values.clear()}hasValues(){return!!this._values}recordCurrentValue(e){this._values.set(e.state.name,e.getValue())}hasRecordedValue(e){return this._values.has(e.state.name)}hasValueChanged(e){if(this._values.has(e.state.name)){if(!Tn(this._values.get(e.state.name),e.getValue()))return!0}return!1}hasDependenciesChanged(e){if(!this._values)return!1;if(!e.variableDependency)return!1;for(const t of e.variableDependency.getNames()){const r=Tt.lookupVariable(t,e);if(!r)continue;const n=r.state.name;if(r&&this._values.has(n)){if(!Tn(this._values.get(n),r.getValue()))return!0}}return!1}}function jt(e){return"object"==typeof e&&"getExtraQueries"in e}var It=Object.defineProperty,Lt=Object.defineProperties,Mt=Object.getOwnPropertyDescriptors,Nt=Object.getOwnPropertySymbols,Ft=Object.prototype.hasOwnProperty,Vt=Object.prototype.propertyIsEnumerable,zt=(e,t,r)=>t in e?It(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;const Bt=(e,t)=>(0,k.of)(t),$t=e=>t=>t.pipe((0,k.mergeMap)((([t,...r])=>{const n=r.flatMap((r=>{var n,i;return null!=(i=null==(n=e.get(r.request.requestId))?void 0:n(t,r))?i:(0,k.of)(r)}));return(0,k.forkJoin)([(0,k.of)(t),...n])})),(0,k.map)((([e,...t])=>{var r,n,i;return n=((e,t)=>{for(var r in t||(t={}))Ft.call(t,r)&&zt(e,r,t[r]);if(Nt)for(var r of Nt(t))Vt.call(t,r)&&zt(e,r,t[r]);return e})({},e),i={series:[...e.series,...t.flatMap((e=>e.series))],annotations:[...null!=(r=e.annotations)?r:[],...t.flatMap((e=>{var t;return null!=(t=e.annotations)?t:[]}))]},Lt(n,Mt(i))})));var Ut=Object.defineProperty,qt=Object.defineProperties,Ht=Object.getOwnPropertyDescriptors,Wt=Object.getOwnPropertySymbols,Gt=Object.prototype.hasOwnProperty,Qt=Object.prototype.propertyIsEnumerable,Kt=(e,t,r)=>t in e?Ut(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Xt=(e,t)=>{for(var r in t||(t={}))Gt.call(t,r)&&Kt(e,r,t[r]);if(Wt)for(var r of Wt(t))Qt.call(t,r)&&Kt(e,r,t[r]);return e},Jt=(e,t)=>qt(e,Ht(t));function Yt(e){const t=e.getRoot();return lt(t)?t.enrichDataRequest(e):null}let Zt,er=new Set;function tr(e){return t=>{const r=Tt.getQueryController(e.origin);return r?new k.Observable((n=>{e.cancel||(e.cancel=()=>n.complete()),r.queryStarted(e);let i=!1;const a=t.subscribe({next:t=>{i||t.state===be.Loading||(i=!0,r.queryCompleted(e)),n.next(t)},error:e=>n.error(e),complete:()=>{n.complete()}});return()=>{a.unsubscribe(),i||r.queryCompleted(e)}})):t}}const rr=new Set;function nr(e,t){e.setState(t)}class ir extends ee{constructor(){super(...arguments),this._urlSync=new ar(this)}validateAndUpdate(){return this.getValueOptions({}).pipe((0,k.map)((e=>(this.updateValueGivenNewOptions(e),{}))))}onCancel(){this.setStateHelper({loading:!1});const e=this.parent;null==e||e.cancel(this)}updateValueGivenNewOptions(e){const{value:t,text:r}=this.state,n=this.getStateUpdateGivenNewOptions(e,t,r);this.interceptStateUpdateAfterValidation(n),this.setStateHelper(n),(n.value!==t||n.text!==r||this.hasAllValue())&&this.publishEvent(new ze(this),!0)}getStateUpdateGivenNewOptions(e,t,r){const n={options:e,loading:!1,value:t,text:r};if(0===e.length)return this.state.defaultToAll||this.state.includeAll?(n.value=tt,n.text=et):this.state.isMulti?(n.value=[],n.text=[]):(n.value="",n.text=""),n;if(this.hasAllValue())return this.state.includeAll||(n.value=e[0].value,n.text=e[0].label,this.state.isMulti&&(n.value=[n.value],n.text=[n.text])),n;if(this.state.isMulti){const i=(Array.isArray(t)?t:[t]).filter((t=>e.find((e=>e.value===t)))),a=i.map((t=>e.find((e=>e.value===t)).label));if(0===i.length){const t=this.getDefaultMultiState(e);n.value=t.value,n.text=t.text}else(0,pe.isEqual)(i,t)||(n.value=i),(0,pe.isEqual)(a,r)||(n.text=a);return n}let i=function(e,t,r){let n;for(const i of r){if(i.value===e)return i;i.label===t&&(n=i)}return n}(t,r,e);return i?(n.text=i.label,n.value=i.value):this.state.defaultToAll?(n.value=tt,n.text=et):(n.value=e[0].value,n.text=e[0].label),n}interceptStateUpdateAfterValidation(e){const t=e.value===tt&&this.state.text===et;this.skipNextValidation&&e.value!==this.state.value&&!t&&(e.value=this.state.value,e.text=this.state.text),this.skipNextValidation=!1}getValue(){return this.hasAllValue()?this.state.allValue?new or(this.state.allValue,this):this.state.options.map((e=>e.value)):this.state.value}getValueText(){return this.hasAllValue()?et:Array.isArray(this.state.text)?this.state.text.join(" + "):String(this.state.text)}hasAllValue(){const e=this.state.value;return e===tt||Array.isArray(e)&&e[0]===tt}getDefaultMultiState(e){return this.state.defaultToAll?{value:[tt],text:[et]}:e.length>0?{value:[e[0].value],text:[e[0].label]}:{value:[],text:[]}}changeValueTo(e,t){if(e!==this.state.value||t!==this.state.text){if(t||(t=Array.isArray(e)?e.map((e=>this.findLabelTextForValue(e))):this.findLabelTextForValue(e)),Array.isArray(e)){if(0===e.length){const r=this.getDefaultMultiState(this.state.options);e=r.value,t=r.text}e[e.length-1]===tt?(e=[tt],t=[et]):e[0]===tt&&e.length>1&&(e.shift(),Array.isArray(t)&&t.shift())}(0,pe.isEqual)(e,this.state.value)&&(0,pe.isEqual)(t,this.state.text)||(this.setStateHelper({value:e,text:t,loading:!1}),this.publishEvent(new ze(this),!0))}}findLabelTextForValue(e){if(e===tt)return et;const t=this.state.options.find((t=>t.value===e));if(t)return t.label;const r=this.state.options.find((t=>t.label===e));return r?r.label:e}setStateHelper(e){nr(this,e)}getOptionsForSelect(){let e=this.state.options;if(this.state.includeAll&&(e=[{value:tt,label:et},...e]),!Array.isArray(this.state.value)){e.find((e=>e.value===this.state.value))||(e=[{value:this.state.value,label:String(this.state.text)},...e])}return e}}class ar{constructor(e){this._sceneObject=e}getKey(){return`var-${this._sceneObject.state.name}`}getKeys(){return this._sceneObject.state.skipUrlSync?[]:[this.getKey()]}getUrlState(){if(this._sceneObject.state.skipUrlSync)return{};let e=null,t=this._sceneObject.state.value;return e=Array.isArray(t)?t.map(String):this._sceneObject.state.isMulti?[String(t)]:String(t),{[this.getKey()]:e}}updateFromUrl(e){let t=e[this.getKey()];null!=t&&(this._sceneObject.state.includeAll&&(t=function(e){if((0,pe.isArray)(e)&&e[0]===et)return[tt];if(e===et)return tt;return e}(t)),this._sceneObject.state.allValue&&this._sceneObject.state.allValue===t&&(t=tt),this._sceneObject.isActive||(this._sceneObject.skipNextValidation=!0),this._sceneObject.changeValueTo(t))}}class or{constructor(e,t){this._value=e,this._variable=t}formatter(e){return e===ye.$m.Text?et:e===ye.$m.PercentEncode?We.get(ye.$m.PercentEncode).formatter(this._value,[],this._variable):e===ye.$m.QueryParam?We.get(ye.$m.QueryParam).formatter(et,[],this._variable):this._value}}var sr=r(2007);const lr={RadioButton:{container:"data-testid radio-button"},Breadcrumbs:{breadcrumb:e=>`data-testid ${e} breadcrumb`},TimePicker:{openButton:"data-testid TimePicker Open Button",overlayContent:"data-testid TimePicker Overlay Content",fromField:"data-testid Time Range from field",toField:"data-testid Time Range to field",applyTimeRange:"data-testid TimePicker submit button",copyTimeRange:"data-testid TimePicker copy button",pasteTimeRange:"data-testid TimePicker paste button",calendar:{label:"data-testid Time Range calendar",openButton:"data-testid Open time range calendar",closeButton:"data-testid Close time range Calendar"},absoluteTimeRangeTitle:"data-testid-absolute-time-range-narrow"},DataSourcePermissions:{form:()=>'form[name="addPermission"]',roleType:"Role to add new permission to",rolePicker:"Built-in role picker",permissionLevel:"Permission Level"},DateTimePicker:{input:"data-testid date-time-input"},DataSource:{TestData:{QueryTab:{scenarioSelectContainer:"Test Data Query scenario select container",scenarioSelect:"Test Data Query scenario select",max:"TestData max",min:"TestData min",noise:"TestData noise",seriesCount:"TestData series count",spread:"TestData spread",startValue:"TestData start value",drop:"TestData drop values"}},DataSourceHttpSettings:{urlInput:"data-testid Datasource HTTP settings url"},Jaeger:{traceIDInput:"Trace ID"},Prometheus:{configPage:{connectionSettings:"Data source connection URL",manageAlerts:"prometheus-alerts-manager",scrapeInterval:"data-testid scrape interval",queryTimeout:"data-testid query timeout",defaultEditor:"data-testid default editor",disableMetricLookup:"disable-metric-lookup",prometheusType:"data-testid prometheus type",prometheusVersion:"data-testid prometheus version",cacheLevel:"data-testid cache level",incrementalQuerying:"prometheus-incremental-querying",queryOverlapWindow:"data-testid query overlap window",disableRecordingRules:"disable-recording-rules",customQueryParameters:"data-testid custom query parameters",httpMethod:"data-testid http method",exemplarsAddButton:"data-testid Add exemplar config button",internalLinkSwitch:"data-testid Internal link switch",codeModeMetricNamesSuggestionLimit:"data-testid code mode metric names suggestion limit"},queryEditor:{explain:"data-testid prometheus explain switch wrapper",editorToggle:"data-testid QueryEditorModeToggle",options:"data-testid prometheus options",legend:"data-testid prometheus legend wrapper",format:"data-testid prometheus format",step:"prometheus-step",type:"data-testid prometheus type",exemplars:"prometheus-exemplars",builder:{metricSelect:"data-testid metric select",hints:"data-testid prometheus hints",metricsExplorer:"data-testid metrics explorer",queryAdvisor:"data-testid query advisor"},code:{queryField:"data-testid prometheus query field",metricsCountInfo:"data-testid metrics count disclaimer",metricsBrowser:{openButton:"data-testid open metrics browser",selectMetric:"data-testid select a metric",seriesLimit:"data-testid series limit",metricList:"data-testid metric list",labelNamesFilter:"data-testid label names filter",labelValuesFilter:"data-testid label values filter",useQuery:"data-testid use query",useAsRateQuery:"data-testid use as rate query",validateSelector:"data-testid validate selector",clear:"data-testid clear"}}},exemplarMarker:"data-testid Exemplar marker",variableQueryEditor:{queryType:"data-testid query type",labelnames:{metricRegex:"data-testid label names metric regex"},labelValues:{labelSelect:"data-testid label values label select"},metricNames:{metricRegex:"data-testid metric names metric regex"},varQueryResult:"data-testid variable query result",seriesQuery:"data-testid prometheus series query",classicQuery:"data-testid prometheus classic query"},annotations:{minStep:"prometheus-annotation-min-step",title:"data-testid prometheus annotation title",tags:"data-testid prometheus annotation tags",text:"data-testid prometheus annotation text",seriesValueAsTimestamp:"data-testid prometheus annotation series value as timestamp"}}},Menu:{MenuComponent:e=>`${e} menu`,MenuGroup:e=>`${e} menu group`,MenuItem:e=>`${e} menu item`,SubMenu:{container:"data-testid SubMenu container",icon:"data-testid SubMenu icon"}},Panels:{Panel:{title:e=>`data-testid Panel header ${e}`,content:"data-testid panel content",headerItems:e=>`data-testid Panel header item ${e}`,menuItems:e=>`data-testid Panel menu item ${e}`,menu:e=>`data-testid Panel menu ${e}`,containerByTitle:e=>`${e} panel`,headerCornerInfo:e=>`Panel header ${e}`,status:e=>`data-testid Panel status ${e}`,loadingBar:()=>"Panel loading bar",HoverWidget:{container:"data-testid hover-header-container",dragIcon:"data-testid drag-icon"},PanelDataErrorMessage:"data-testid Panel data error message"},Visualization:{Graph:{container:"Graph container",VisualizationTab:{legendSection:"Legend section"},Legend:{legendItemAlias:e=>`gpl alias ${e}`,showLegendSwitch:"gpl show legend"},xAxis:{labels:()=>"div.flot-x-axis > div.flot-tick-label"}},BarGauge:{value:"Bar gauge value",valueV2:"data-testid Bar gauge value"},PieChart:{svgSlice:"data testid Pie Chart Slice"},Text:{container:()=>".markdown-html"},Table:{header:"table header",footer:"table-footer",body:"data-testid table body"}}},VizLegend:{seriesName:e=>`data-testid VizLegend series ${e}`},Drawer:{General:{title:e=>`Drawer title ${e}`,expand:"Drawer expand",contract:"Drawer contract",close:"data-testid Drawer close",rcContentWrapper:()=>".rc-drawer-content-wrapper",subtitle:"data-testid drawer subtitle"},DashboardSaveDrawer:{saveButton:"data-testid Save dashboard drawer button",saveAsButton:"data-testid Save as dashboard drawer button",saveAsTitleInput:"Save dashboard title field"}},PanelEditor:{General:{content:"data-testid Panel editor content"},OptionsPane:{content:"data-testid Panel editor option pane content",select:"Panel editor option pane select",fieldLabel:e=>`${e} field property editor`,fieldInput:e=>`data-testid Panel editor option pane field input ${e}`},DataPane:{content:"data-testid Panel editor data pane content"},applyButton:"data-testid Apply changes and go back to dashboard",toggleVizPicker:"data-testid toggle-viz-picker",toggleVizOptions:"data-testid toggle-viz-options",toggleTableView:"data-testid toggle-table-view",showZoomField:"Map controls Show zoom control field property editor",showAttributionField:"Map controls Show attribution field property editor",showScaleField:"Map controls Show scale field property editor",showMeasureField:"Map controls Show measure tools field property editor",showDebugField:"Map controls Show debug field property editor",measureButton:"show measure tools"},PanelInspector:{Data:{content:"Panel inspector Data content"},Stats:{content:"Panel inspector Stats content"},Json:{content:"data-testid Panel inspector Json content"},Query:{content:"Panel inspector Query content",refreshButton:"Panel inspector Query refresh button",jsonObjectKeys:()=>".json-formatter-key"}},Tab:{title:e=>`data-testid Tab ${e}`,active:()=>'[class*="-activeTabStyle"]'},RefreshPicker:{runButton:"RefreshPicker run button",intervalButton:"RefreshPicker interval button",runButtonV2:"data-testid RefreshPicker run button",intervalButtonV2:"data-testid RefreshPicker interval button"},QueryTab:{content:"Query editor tab content",queryInspectorButton:"Query inspector button",queryHistoryButton:"data-testid query-history-button",addQuery:"data-testid query-tab-add-query",queryGroupTopSection:"data-testid query group top section",addExpression:"data-testid query-tab-add-expression"},QueryHistory:{queryText:"Query text"},QueryEditorRows:{rows:"Query editor row"},QueryEditorRow:{actionButton:e=>`data-testid ${e}`,title:e=>`Query editor row title ${e}`,container:e=>`Query editor row ${e}`},AlertTab:{content:"data-testid Alert editor tab content"},AlertRules:{groupToggle:"data-testid group-collapse-toggle",toggle:"data-testid collapse-toggle",expandedContent:"data-testid expanded-content",previewButton:"data-testid alert-rule preview-button",ruleNameField:"data-testid alert-rule name-field",newFolderButton:"data-testid alert-rule new-folder-button",newFolderNameField:"data-testid alert-rule name-folder-name-field",newFolderNameCreateButton:"data-testid alert-rule name-folder-name-create-button",newEvaluationGroupButton:"data-testid alert-rule new-evaluation-group-button",newEvaluationGroupName:"data-testid alert-rule new-evaluation-group-name",newEvaluationGroupInterval:"data-testid alert-rule new-evaluation-group-interval",newEvaluationGroupCreate:"data-testid alert-rule new-evaluation-group-create-button"},Alert:{alert:e=>`Alert ${e}`,alertV2:e=>`data-testid Alert ${e}`},TransformTab:{content:"data-testid Transform editor tab content",newTransform:e=>`data-testid New transform ${e}`,transformationEditor:e=>`data-testid Transformation editor ${e}`,transformationEditorDebugger:e=>`data-testid Transformation editor debugger ${e}`},Transforms:{card:e=>`data-testid New transform ${e}`,disableTransformationButton:"data-testid Disable transformation button",Reduce:{modeLabel:"data-testid Transform mode label",calculationsLabel:"data-testid Transform calculations label"},SpatialOperations:{actionLabel:"root Action field property editor",locationLabel:"root Location Mode field property editor",location:{autoOption:"Auto location option",coords:{option:"Coords location option",latitudeFieldLabel:"root Latitude field field property editor",longitudeFieldLabel:"root Longitude field field property editor"},geohash:{option:"Geohash location option",geohashFieldLabel:"root Geohash field field property editor"},lookup:{option:"Lookup location option",lookupFieldLabel:"root Lookup field field property editor",gazetteerFieldLabel:"root Gazetteer field property editor"}}},searchInput:"data-testid search transformations",noTransformationsMessage:"data-testid no transformations message",addTransformationButton:"data-testid add transformation button",removeAllTransformationsButton:"data-testid remove all transformations button"},NavBar:{Configuration:{button:"Configuration"},Toggle:{button:"data-testid Toggle menu"},Reporting:{button:"Reporting"}},NavMenu:{Menu:"data-testid navigation mega-menu",item:"data-testid Nav menu item"},NavToolbar:{container:"data-testid Nav toolbar",shareDashboard:"data-testid Share dashboard",markAsFavorite:"data-testid Mark as favorite",editDashboard:{editButton:"data-testid Edit dashboard button",saveButton:"data-testid Save dashboard button",exitButton:"data-testid Exit edit mode button",settingsButton:"data-testid Dashboard settings",addRowButton:"data-testid Add row button",addLibraryPanelButton:"data-testid Add a panel from the panel library button",addVisualizationButton:"data-testid Add new visualization menu item",pastePanelButton:"data-testid Paste panel button",discardChangesButton:"data-testid Discard changes button",discardLibraryPanelButton:"data-testid Discard library panel button",unlinkLibraryPanelButton:"data-testid Unlink library panel button",saveLibraryPanelButton:"data-testid Save library panel button",backToDashboardButton:"data-testid Back to dashboard button"}},PageToolbar:{container:()=>".page-toolbar",item:e=>`${e}`,itemButton:e=>`data-testid ${e}`},QueryEditorToolbarItem:{button:e=>`QueryEditor toolbar item button ${e}`},BackButton:{backArrow:"data-testid Go Back"},OptionsGroup:{group:e=>e?`data-testid Options group ${e}`:"data-testid Options group",toggle:e=>e?`data-testid Options group ${e} toggle`:"data-testid Options group toggle"},PluginVisualization:{item:e=>`Plugin visualization item ${e}`,current:()=>'[class*="-currentVisualizationItem"]'},Select:{option:"data-testid Select option",toggleAllOptions:"data-testid toggle all options",input:()=>'input[id*="time-options-input"]',singleValue:()=>'div[class*="-singleValue"]'},FieldConfigEditor:{content:"Field config editor content"},OverridesConfigEditor:{content:"Field overrides editor content"},FolderPicker:{container:"Folder picker select container",containerV2:"data-testid Folder picker select container",input:"data-testid folder-picker-input"},ReadonlyFolderPicker:{container:"data-testid Readonly folder picker select container"},DataSourcePicker:{container:"data-testid Data source picker select container",input:()=>'input[id="data-source-picker"]',inputV2:"data-testid Select a data source",dataSourceList:"data-testid Data source list dropdown",advancedModal:{dataSourceList:"data-testid Data source list",builtInDataSourceList:"data-testid Built in data source list"}},TimeZonePicker:{container:"Time zone picker select container",containerV2:"data-testid Time zone picker select container",changeTimeSettingsButton:"data-testid Time zone picker Change time settings button"},WeekStartPicker:{container:"Choose starting day of the week",containerV2:"data-testid Choose starting day of the week",placeholder:"Choose starting day of the week"},TraceViewer:{spanBar:"data-testid SpanBar--wrapper"},QueryField:{container:"data-testid Query field"},QueryBuilder:{queryPatterns:"data-testid Query patterns",labelSelect:"data-testid Select label",inputSelect:"data-testid Select label-input",valueSelect:"data-testid Select value",matchOperatorSelect:"data-testid Select match operator"},ValuePicker:{button:e=>`data-testid Value picker button ${e}`,select:e=>`data-testid Value picker select ${e}`},Search:{section:"Search section",sectionV2:"data-testid Search section",items:"Search items",itemsV2:"data-testid Search items",cards:"data-testid Search cards",collapseFolder:e=>`data-testid Collapse folder ${e}`,expandFolder:e=>`data-testid Expand folder ${e}`,dashboardItem:e=>`${lr.Search.dashboardItems} ${e}`,dashboardCard:e=>`data-testid Search card ${e}`,folderHeader:e=>`data-testid Folder header ${e}`,folderContent:e=>`data-testid Folder content ${e}`,dashboardItems:"data-testid Dashboard search item"},DashboardLinks:{container:"data-testid Dashboard link container",dropDown:"data-testid Dashboard link dropdown",link:"data-testid Dashboard link"},LoadingIndicator:{icon:"data-testid Loading indicator"},CallToActionCard:{button:e=>`Call to action button ${e}`,buttonV2:e=>`data-testid Call to action button ${e}`},DataLinksContextMenu:{singleLink:"data-testid Data link"},CodeEditor:{container:"data-testid Code editor container"},ReactMonacoEditor:{editorLazy:"data-testid ReactMonacoEditor editorLazy"},DashboardImportPage:{textarea:"data-testid-import-dashboard-textarea",submit:"data-testid-load-dashboard"},ImportDashboardForm:{name:"data-testid-import-dashboard-title",submit:"data-testid-import-dashboard-submit"},PanelAlertTabContent:{content:"data-testid Unified alert editor tab content"},VisualizationPreview:{card:e=>`data-testid suggestion-${e}`},ColorSwatch:{name:"data-testid-colorswatch"},DashboardRow:{title:e=>`data-testid dashboard-row-title-${e}`},UserProfile:{profileSaveButton:"data-testid-user-profile-save",preferencesSaveButton:"data-testid-shared-prefs-save",orgsTable:"data-testid-user-orgs-table",sessionsTable:"data-testid-user-sessions-table",extensionPointTabs:"data-testid-extension-point-tabs",extensionPointTab:e=>`data-testid-extension-point-tab-${e}`},FileUpload:{inputField:"data-testid-file-upload-input-field",fileNameSpan:"data-testid-file-upload-file-name"},DebugOverlay:{wrapper:"debug-overlay"},OrgRolePicker:{input:"Role"},AnalyticsToolbarButton:{button:"Dashboard insights"},Variables:{variableOption:"data-testid variable-option",variableLinkWrapper:"data-testid variable-link-wrapper"},Annotations:{annotationsTypeInput:"data-testid annotations-type-input",annotationsChoosePanelInput:"data-testid choose-panels-input",editor:{testButton:"data-testid annotations-test-button",resultContainer:"data-testid annotations-query-result-container"}},Tooltip:{container:"data-testid tooltip"},ReturnToPrevious:{buttonGroup:"data-testid dismissable button group",backButton:"data-testid back",dismissButton:"data-testid dismiss"},SQLQueryEditor:{selectColumn:"data-testid select-column",selectAggregation:"data-testid select-aggregation",selectAlias:"data-testid select-alias",filterConjunction:"data-testid filter-conjunction",filterField:"data-testid filter-field",filterOperator:"data-testid filter-operator",headerTableSelector:"data-testid header-table-selector",headerFilterSwitch:"data-testid header-filter-switch",headerGroupSwitch:"data-testid header-group-switch",headerOrderSwitch:"data-testid header-order-switch",headerPreviewSwitch:"data-testid header-preview-switch"},EntityNotFound:{container:"data-testid entity-not-found"}},ur={pages:{Login:{url:"/login",username:"data-testid Username input field",password:"data-testid Password input field",submit:"data-testid Login button",skip:"data-testid Skip change password button"},Home:{url:"/"},DataSource:{name:"data-testid Data source settings page name input field",delete:"Data source settings page Delete button",readOnly:"data-testid Data source settings page read only message",saveAndTest:"data-testid Data source settings page Save and Test button",alert:"data-testid Data source settings page Alert"},DataSources:{url:"/datasources",dataSources:e=>`Data source list item ${e}`},EditDataSource:{url:e=>`/datasources/edit/${e}`,settings:"Datasource settings page basic settings"},AddDataSource:{url:"/datasources/new",dataSourcePlugins:e=>`Data source plugin item ${e}`,dataSourcePluginsV2:e=>`Add new data source ${e}`},ConfirmModal:{delete:"data-testid Confirm Modal Danger Button"},AddDashboard:{url:"/dashboard/new",itemButton:e=>`data-testid ${e}`,addNewPanel:"data-testid Add new panel",addNewRow:"data-testid Add new row",addNewPanelLibrary:"data-testid Add new panel from panel library"},Dashboard:{url:e=>`/d/${e}`,DashNav:{nav:"Dashboard navigation",navV2:"data-testid Dashboard navigation",publicDashboardTag:"data-testid public dashboard tag",shareButton:"data-testid share-button",scrollContainer:"data-testid Dashboard canvas scroll container",newShareButton:{container:"data-testid new share button",shareLink:"data-testid new share link-button",arrowMenu:"data-testid new share button arrow menu",menu:{container:"data-testid new share button menu",shareInternally:"data-testid new share button share internally",shareExternally:"data-testid new share button share externally",shareSnapshot:"data-testid new share button share snapshot"}},NewExportButton:{container:"data-testid new export button",arrowMenu:"data-testid new export button arrow menu",Menu:{container:"data-testid new export button menu",exportAsJson:"data-testid new export button export as json"}},playlistControls:{prev:"data-testid playlist previous dashboard button",stop:"data-testid playlist stop dashboard button",next:"data-testid playlist next dashboard button"}},Controls:"data-testid dashboard controls",SubMenu:{submenu:"Dashboard submenu",submenuItem:"data-testid template variable",submenuItemLabels:e=>`data-testid Dashboard template variables submenu Label ${e}`,submenuItemValueDropDownValueLinkTexts:e=>`data-testid Dashboard template variables Variable Value DropDown value link text ${e}`,submenuItemValueDropDownDropDown:"Variable options",submenuItemValueDropDownOptionTexts:e=>`data-testid Dashboard template variables Variable Value DropDown option text ${e}`,Annotations:{annotationsWrapper:"data-testid annotation-wrapper",annotationLabel:e=>`data-testid Dashboard annotations submenu Label ${e}`,annotationToggle:e=>`data-testid Dashboard annotations submenu Toggle ${e}`}},Settings:{Actions:{close:"data-testid dashboard-settings-close"},General:{deleteDashBoard:"data-testid Dashboard settings page delete dashboard button",sectionItems:e=>`Dashboard settings section item ${e}`,saveDashBoard:"Dashboard settings aside actions Save button",saveAsDashBoard:"Dashboard settings aside actions Save As button",timezone:"Time zone picker select container",title:"General"},Annotations:{List:{addAnnotationCTA:lr.CallToActionCard.button("Add annotation query"),addAnnotationCTAV2:lr.CallToActionCard.buttonV2("Add annotation query"),annotations:"data-testid list-annotations"},Settings:{name:"data-testid Annotations settings name input"},NewAnnotation:{panelFilterSelect:"data-testid annotations-panel-filter",showInLabel:"data-testid show-in-label",previewInDashboard:"data-testid annotations-preview",delete:"data-testid annotations-delete",apply:"data-testid annotations-apply",enable:"data-testid annotation-enable",hide:"data-testid annotation-hide"}},Variables:{List:{addVariableCTA:lr.CallToActionCard.button("Add variable"),addVariableCTAV2:lr.CallToActionCard.buttonV2("Add variable"),newButton:"Variable editor New variable button",table:"Variable editor Table",tableRowNameFields:e=>`Variable editor Table Name field ${e}`,tableRowDefinitionFields:e=>`Variable editor Table Definition field ${e}`,tableRowArrowUpButtons:e=>`Variable editor Table ArrowUp button ${e}`,tableRowArrowDownButtons:e=>`Variable editor Table ArrowDown button ${e}`,tableRowDuplicateButtons:e=>`Variable editor Table Duplicate button ${e}`,tableRowRemoveButtons:e=>`Variable editor Table Remove button ${e}`},Edit:{General:{headerLink:"Variable editor Header link",modeLabelNew:"Variable editor Header mode New",modeLabelEdit:"Variable editor Header mode Edit",generalNameInput:"Variable editor Form Name field",generalNameInputV2:"data-testid Variable editor Form Name field",generalTypeSelect:"Variable editor Form Type select",generalTypeSelectV2:"data-testid Variable editor Form Type select",generalLabelInput:"Variable editor Form Label field",generalLabelInputV2:"data-testid Variable editor Form Label field",generalHideSelect:"Variable editor Form Hide select",generalHideSelectV2:"data-testid Variable editor Form Hide select",selectionOptionsMultiSwitch:"data-testid Variable editor Form Multi switch",selectionOptionsIncludeAllSwitch:"data-testid Variable editor Form IncludeAll switch",selectionOptionsCustomAllInput:"data-testid Variable editor Form IncludeAll field",previewOfValuesOption:"data-testid Variable editor Preview of Values option",submitButton:"data-testid Variable editor Run Query button",applyButton:"data-testid Variable editor Apply button"},QueryVariable:{queryOptionsDataSourceSelect:lr.DataSourcePicker.inputV2,queryOptionsRefreshSelect:"Variable editor Form Query Refresh select",queryOptionsRefreshSelectV2:"data-testid Variable editor Form Query Refresh select",queryOptionsRegExInput:"Variable editor Form Query RegEx field",queryOptionsRegExInputV2:"data-testid Variable editor Form Query RegEx field",queryOptionsSortSelect:"Variable editor Form Query Sort select",queryOptionsSortSelectV2:"data-testid Variable editor Form Query Sort select",queryOptionsQueryInput:"data-testid Variable editor Form Default Variable Query Editor textarea",valueGroupsTagsEnabledSwitch:"Variable editor Form Query UseTags switch",valueGroupsTagsTagsQueryInput:"Variable editor Form Query TagsQuery field",valueGroupsTagsTagsValuesQueryInput:"Variable editor Form Query TagsValuesQuery field"},ConstantVariable:{constantOptionsQueryInput:"Variable editor Form Constant Query field",constantOptionsQueryInputV2:"data-testid Variable editor Form Constant Query field"},DatasourceVariable:{datasourceSelect:"data-testid datasource variable datasource type"},TextBoxVariable:{textBoxOptionsQueryInput:"Variable editor Form TextBox Query field",textBoxOptionsQueryInputV2:"data-testid Variable editor Form TextBox Query field"},CustomVariable:{customValueInput:"data-testid custom-variable-input"},IntervalVariable:{intervalsValueInput:"data-testid interval variable intervals input",autoEnabledCheckbox:"data-testid interval variable auto value checkbox",stepCountIntervalSelect:"data-testid interval variable step count input",minIntervalInput:"data-testid interval variable mininum interval input"},GroupByVariable:{dataSourceSelect:lr.DataSourcePicker.inputV2,infoText:"data-testid group by variable info text",modeToggle:"data-testid group by variable mode toggle"},AdHocFiltersVariable:{datasourceSelect:lr.DataSourcePicker.inputV2,infoText:"data-testid ad-hoc filters variable info text",modeToggle:"data-testid ad-hoc filters variable mode toggle"}}}},Annotations:{marker:"data-testid annotation-marker"},Rows:{Repeated:{ConfigSection:{warningMessage:"data-testid Repeated rows warning message"}}}},Dashboards:{url:"/dashboards",dashboards:e=>`Dashboard search item ${e}`},SaveDashboardAsModal:{newName:"Save dashboard title field",save:"Save dashboard button"},SaveDashboardModal:{save:"Dashboard settings Save Dashboard Modal Save button",saveVariables:"Dashboard settings Save Dashboard Modal Save variables checkbox",saveTimerange:"Dashboard settings Save Dashboard Modal Save timerange checkbox",saveRefresh:"Dashboard settings Save Dashboard Modal Save refresh checkbox"},SharePanelModal:{linkToRenderedImage:"Link to rendered image"},ShareDashboardModal:{PublicDashboard:{WillBePublicCheckbox:"data-testid public dashboard will be public checkbox",LimitedDSCheckbox:"data-testid public dashboard limited datasources checkbox",CostIncreaseCheckbox:"data-testid public dashboard cost may increase checkbox",PauseSwitch:"data-testid public dashboard pause switch",EnableAnnotationsSwitch:"data-testid public dashboard on off switch for annotations",CreateButton:"data-testid public dashboard create button",DeleteButton:"data-testid public dashboard delete button",CopyUrlInput:"data-testid public dashboard copy url input",CopyUrlButton:"data-testid public dashboard copy url button",SettingsDropdown:"data-testid public dashboard settings dropdown",TemplateVariablesWarningAlert:"data-testid public dashboard disabled template variables alert",UnsupportedDataSourcesWarningAlert:"data-testid public dashboard unsupported data sources alert",NoUpsertPermissionsWarningAlert:"data-testid public dashboard no upsert permissions alert",EnableTimeRangeSwitch:"data-testid public dashboard on off switch for time range",EmailSharingConfiguration:{Container:"data-testid email sharing config container",ShareType:"data-testid public dashboard share type",EmailSharingInput:"data-testid public dashboard email sharing input",EmailSharingInviteButton:"data-testid public dashboard email sharing invite button",EmailSharingList:"data-testid public dashboard email sharing list",DeleteEmail:"data-testid public dashboard delete email button",ReshareLink:"data-testid public dashboard reshare link button"}},SnapshotScene:{url:e=>`/dashboard/snapshot/${e}`,PublishSnapshot:"data-testid publish snapshot button",CopyUrlButton:"data-testid snapshot copy url button",CopyUrlInput:"data-testid snapshot copy url input"}},ShareDashboardDrawer:{ShareInternally:{container:"data-testid share internally drawer container",lockTimeRangeSwitch:"data-testid share internally lock time range switch",shortenUrlSwitch:"data-testid share internally shorten url switch",copyUrlButton:"data-testid share internally copy url button"},ShareExternally:{container:"data-testid share externally drawer container",publicAlert:"data-testid public share alert",emailSharingAlert:"data-testid email share alert",shareTypeSelect:"data-testid share externally share type select",Creation:{PublicShare:{createButton:"data-testid public share dashboard create button",cancelButton:"data-testid public share dashboard cancel button"},EmailShare:{createButton:"data-testid email share dashboard create button",cancelButton:"data-testid email share dashboard cancel button"},willBePublicCheckbox:"data-testid share dashboard will be public checkbox"},Configuration:{enableTimeRangeSwitch:"data-testid share externally enable time range switch",enableAnnotationsSwitch:"data-testid share externally enable annotations switch",copyUrlButton:"data-testid share externally copy url button",revokeAccessButton:"data-testid share externally revoke access button",toggleAccessButton:"data-testid share externally pause or resume access button"}},ShareSnapshot:{url:e=>`/dashboard/snapshot/${e}`,container:"data-testid share snapshot drawer container",publishSnapshot:"data-testid share snapshot publish button",copyUrlButton:"data-testid share snapshot copy url button"}},ExportDashboardDrawer:{ExportAsJson:{container:"data-testid export as json drawer container",codeEditor:"data-testid export as json code editor",exportExternallyToggle:"data-testid export as json externally switch",saveToFileButton:"data-testid export as json save to file button",copyToClipboardButton:"data-testid export as json copy to clipboard button",cancelButton:"data-testid export as json cancel button"}},PublicDashboard:{page:"public-dashboard-page",NotAvailable:{container:"public-dashboard-not-available",title:"public-dashboard-title",pausedDescription:"public-dashboard-paused-description"},footer:"public-dashboard-footer"},PublicDashboardScene:{loadingPage:"public-dashboard-scene-loading-page",page:"public-dashboard-scene-page",controls:"public-dashboard-controls"},RequestViewAccess:{form:"request-view-access-form",recipientInput:"request-view-access-recipient-input",submitButton:"request-view-access-submit-button"},PublicDashboardConfirmAccess:{submitButton:"data-testid confirm-access-submit-button"},Explore:{url:"/explore",General:{container:"data-testid Explore",graph:"Explore Graph",table:"Explore Table",scrollView:"data-testid explorer scroll view"},QueryHistory:{container:"data-testid QueryHistory"}},SoloPanel:{url:e=>`/d-solo/${e}`},PluginsList:{page:"Plugins list page",list:"Plugins list",listItem:"Plugins list item",signatureErrorNotice:"data-testid Unsigned plugins notice"},PluginPage:{page:"Plugin page",signatureInfo:"data-testid Plugin signature info",disabledInfo:"data-testid Plugin disabled info"},PlaylistForm:{name:"Playlist name",interval:"Playlist interval",itemDelete:"data-testid playlist-form-delete-item"},BrowseDashboards:{table:{body:"data-testid browse-dashboards-table",row:e=>`data-testid browse dashboards row ${e}`,checkbox:e=>`data-testid ${e} checkbox`},NewFolderForm:{form:"data-testid new folder form",nameInput:"data-testid new-folder-name-input",createButton:"data-testid new-folder-create-button"}},Search:{url:"/?search=openn",FolderView:{url:"/?search=open&layout=folders"}},PublicDashboards:{ListItem:{linkButton:"public-dashboard-link-button",configButton:"public-dashboard-configuration-button",trashcanButton:"public-dashboard-remove-button",pauseSwitch:"data-testid public dashboard pause switch"}},UserListPage:{tabs:{allUsers:"data-testid all-users-tab",orgUsers:"data-testid org-users-tab",anonUserDevices:"data-testid anon-user-devices-tab",publicDashboardsUsers:"data-testid public-dashboards-users-tab",users:"data-testid users-tab"},org:{url:"/org/users"},admin:{url:"/admin/users"},publicDashboards:{container:"data-testid public-dashboards-users-list"},UserListAdminPage:{container:"data-testid user-list-admin-page"},UsersListPage:{container:"data-testid users-list-page"},UserAnonListPage:{container:"data-testid user-anon-list-page"},UsersListPublicDashboardsPage:{container:"data-testid users-list-public-dashboards-page",DashboardsListModal:{listItem:e=>`data-testid dashboards-list-item-${e}`}}},ProfilePage:{url:"/profile"}},components:lr};var cr=r(6089),dr=r(7993);function hr(e,t){const r=new dr.A;let n=e;const i=[],a=1e4;return t&&(n=[{value:tt,label:et},...n]),e=>{if(""===e)return n.length>a?n.slice(0,a):n;if(0===i.length)for(let e=0;ea)return o;return o}return n.length>a?n.slice(0,a):n}}var pr=Object.defineProperty,fr=Object.defineProperties,mr=Object.getOwnPropertyDescriptors,gr=Object.getOwnPropertySymbols,vr=Object.prototype.hasOwnProperty,yr=Object.prototype.propertyIsEnumerable,br=(e,t,r)=>t in e?pr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;const wr=()=>!0;function Sr({model:e}){const{value:t,text:r,key:n,options:i,includeAll:s,isReadOnly:l}=e.useState(),[u,c]=(0,a.useState)(""),[d,h]=(0,a.useState)(!1),p=function(e,t){return{value:e,label:null!=t?t:String(e)}}(t,String(r)),f=(0,a.useMemo)((()=>hr(i,s)),[i,s])(u);return o().createElement(sr.Select,{id:n,isValidNewOption:e=>e.trim().length>0,placeholder:"Select value",width:"auto",disabled:l,value:p,inputValue:u,allowCustomValue:!0,virtualized:!0,filterOption:wr,tabSelectsValue:!1,onInputChange:(t,{action:r})=>"input-change"===r?(c(t),e.onSearchChange&&e.onSearchChange(t),t):t,onOpenMenu:()=>{d&&c(String(r))},onCloseMenu:()=>{c("")},options:f,"data-testid":ur.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts(`${t}`),onChange:t=>{e.changeValueTo(t.value,t.label),d!==t.__isNew__&&h(t.__isNew__)}})}function xr({model:e}){const{value:t,options:r,key:n,maxVisibleValues:i,noValueOnClear:s,includeAll:l,isReadOnly:u}=e.useState(),c=(0,a.useMemo)((()=>(0,pe.isArray)(t)?t:[t]),[t]),[d,h]=(0,a.useState)(c),[p,f]=(0,a.useState)(""),m=(0,a.useMemo)((()=>hr(r,l)),[r,l]);(0,a.useEffect)((()=>{h(c)}),[c]);const g=r.length>0?"Select value":"",v=m(p);return o().createElement(sr.MultiSelect,{id:n,placeholder:g,width:"auto",inputValue:p,disabled:u,value:d,noMultiValueWrap:!0,maxVisibleValues:null!=i?i:5,tabSelectsValue:!1,virtualized:!0,allowCustomValue:!0,options:v,closeMenuOnSelect:!1,components:{Option:Or},isClearable:!0,hideSelectedOptions:!1,onInputChange:(t,{action:r})=>"input-change"===r?(f(t),e.onSearchChange&&e.onSearchChange(t),t):"input-blur"===r?(f(""),""):p,onBlur:()=>{e.changeValueTo(d)},filterOption:wr,"data-testid":ur.pages.Dashboard.SubMenu.submenuItemValueDropDownValueLinkTexts(`${d}`),onChange:(t,r)=>{"clear"===r.action&&s&&e.changeValueTo([]),h(t.map((e=>e.value)))}})}const Or=({children:e,data:t,innerProps:r,innerRef:n,isFocused:i,isSelected:a,renderOptionLabel:s})=>{var l;const u=((e,t)=>{var r={};for(var n in e)vr.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&gr)for(var n of gr(e))t.indexOf(n)<0&&yr.call(e,n)&&(r[n]=e[n]);return r})(r,["onMouseMove","onMouseOver"]),c=(0,sr.useTheme2)(),d=(0,sr.getSelectStyles)(c),h=(0,sr.useStyles2)(_r);return o().createElement("div",(p=((e,t)=>{for(var r in t||(t={}))vr.call(t,r)&&br(e,r,t[r]);if(gr)for(var r of gr(t))yr.call(t,r)&&br(e,r,t[r]);return e})({ref:n,className:(0,cr.cx)(d.option,i&&d.optionFocused)},u),f={"data-testid":ur.components.Select.option,title:t.title},fr(p,mr(f))),o().createElement("div",{className:h.checkbox},o().createElement(sr.Checkbox,{value:a})),o().createElement("div",{className:d.optionBody,"data-testid":ur.pages.Dashboard.SubMenu.submenuItemValueDropDownOptionTexts(null!=(l=t.label)?l:String(t.value))},o().createElement("span",null,e)));var p,f};Or.displayName="SelectMenuOptions";const _r=e=>({checkbox:(0,cr.css)({marginRight:e.spacing(2)})});function Er(e){return e.state.isMulti?o().createElement(xr,{model:e}):o().createElement(Sr,{model:e})}class kr{constructor(e){this._sceneObject=e}getKey(){return`var-${this._sceneObject.state.name}`}getKeys(){return this._sceneObject.state.skipUrlSync?[]:[this.getKey()]}getUrlState(){return this._sceneObject.state.skipUrlSync?{}:{[this.getKey()]:Cr(this._sceneObject.state.value,this._sceneObject.state.text)}}updateFromUrl(e){let t=e[this.getKey()];if(null!=t){this._sceneObject.isActive||(this._sceneObject.skipNextValidation=!0);const{values:e,texts:n}=(r=t,(r=Array.isArray(r)?r:[r]).reduce(((e,t)=>{const[r,n]=(null!=t?t:"").split(",");return e.values.push(Mn(r)),e.texts.push(Mn(null!=n?n:r)),e}),{values:[],texts:[]}));this._sceneObject.changeValueTo(e,n)}var r}}function Cr(e,t){return e=Array.isArray(e)?e:[e],t=Array.isArray(t)?t:[t],e.map(((e,r)=>{if(null==e)return"";e=String(e);let n=t[r];return n=null==n?e:String(n),Nn(e,n)}))}function Tr(e){const t=e.getRoot();return"enrichFiltersRequest"in t?t.enrichFiltersRequest(e):null}var Ar=Object.defineProperty,Rr=Object.defineProperties,Dr=Object.getOwnPropertyDescriptors,Pr=Object.getOwnPropertySymbols,jr=Object.prototype.hasOwnProperty,Ir=Object.prototype.propertyIsEnumerable,Lr=(e,t,r)=>t in e?Ar(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Mr=(e,t)=>{for(var r in t||(t={}))jr.call(t,r)&&Lr(e,r,t[r]);if(Pr)for(var r of Pr(t))Ir.call(t,r)&&Lr(e,r,t[r]);return e};class Nr extends ir{constructor(e){var t;super((t=Mr({isMulti:!0,name:"",value:[],text:[],options:[],datasource:null,baseFilters:[],applyMode:"auto",layout:"horizontal",type:"groupby"},e),Rr(t,Dr({noValueOnClear:!0})))),this.isLazy=!0,this._urlSync=new kr(this),this._getKeys=async e=>{var t,r,n;const i=await(null==(r=(t=this.state).getTagKeysProvider)?void 0:r.call(t,this,null));if(i&&i.replace)return i.values;if(this.state.defaultOptions)return this.state.defaultOptions.concat(null!=(n=null==i?void 0:i.values)?n:[]);if(!e.getTagKeys)return[];const a=jn(this),o=this.state.baseFilters||[],s=Tt.getTimeRange(this).state.value;let l=await e.getTagKeys(Mr({filters:o,queries:a,timeRange:s},Tr(this)));i&&(l=l.concat(i.values));const u=this.state.tagKeyRegexFilter;return u&&(l=l.filter((e=>e.text.match(u)))),l},this.addActivationHandler((()=>(rr.add(this),()=>rr.delete(this))))}validateAndUpdate(){return this.getValueOptions({}).pipe((0,k.map)((e=>(this._updateValueGivenNewOptions(e),{}))))}_updateValueGivenNewOptions(e){const{value:t,text:r}=this.state,n={options:e,loading:!1,value:null!=t?t:[],text:null!=r?r:[]};this.setState(n)}getValueOptions(e){return this.state.defaultOptions?(0,k.of)(this.state.defaultOptions.map((e=>({label:e.text,value:String(e.value)})))):(this.setState({loading:!0,error:null}),(0,k.from)(At(this.state.datasource,{__sceneObject:{text:"__sceneObject",value:this}})).pipe((0,k.mergeMap)((e=>(0,k.from)(this._getKeys(e)).pipe((0,k.take)(1),(0,k.mergeMap)((e=>{const t=e.map((e=>({label:e.text,value:e.value?String(e.value):e.text})));return(0,k.of)(t)})))))))}getDefaultMultiState(e){return{value:[],text:[]}}}Nr.Component=function({model:e}){const{value:t,text:r,key:n,maxVisibleValues:i,noValueOnClear:s,options:l,includeAll:u}=e.useState(),c=(0,a.useMemo)((()=>{const e=(0,pe.isArray)(t)?t:[t],n=(0,pe.isArray)(r)?r:[r];return e.map(((e,t)=>{var r;return{value:e,label:String(null!=(r=n[t])?r:e)}}))}),[t,r]),[d,h]=(0,a.useState)(!1),[p,f]=(0,a.useState)(!1),[m,g]=(0,a.useState)(""),[v,y]=(0,a.useState)(c),b=(0,a.useMemo)((()=>hr(l,u)),[l,u]);(0,a.useEffect)((()=>{y(c)}),[c]);const w=b(m);return o().createElement(sr.MultiSelect,{"data-testid":`GroupBySelect-${n}`,id:n,placeholder:"Select value",width:"auto",inputValue:m,value:v,noMultiValueWrap:!0,maxVisibleValues:null!=i?i:5,tabSelectsValue:!1,virtualized:!0,options:w,filterOption:Fr,closeMenuOnSelect:!1,isOpen:p,isClearable:!0,hideSelectedOptions:!1,isLoading:d,components:{Option:Or},onInputChange:(t,{action:r})=>"input-change"===r?(g(t),e.onSearchChange&&e.onSearchChange(t),t):"input-blur"===r?(g(""),""):m,onBlur:()=>{e.changeValueTo(v.map((e=>e.value)),v.map((e=>e.label)))},onChange:(t,r)=>{"clear"===r.action&&s&&e.changeValueTo([]),y(t)},onOpenMenu:async()=>{h(!0),await(0,k.lastValueFrom)(e.validateAndUpdate()),h(!1),f(!0)},onCloseMenu:()=>{f(!1)}})};const Fr=()=>!0;function Vr(e){return o().createElement(sr.Tooltip,{content:"Cancel query"},o().createElement(sr.Icon,{className:"spin-clockwise",name:"sync",size:"xs",role:"button",onMouseDown:t=>{e.onCancel(t)}}))}function zr(e){const t=(0,sr.useStyles2)(Br),r=(0,sr.useTheme2)(),n="vertical"===e.layout,i=Boolean(e.isLoading)?o().createElement("div",{style:{marginLeft:r.spacing(1),marginTop:"-1px"},"aria-label":ur.components.LoadingIndicator.icon},o().createElement(Vr,{onCancel:t=>{var r;t.preventDefault(),t.stopPropagation(),null==(r=e.onCancel)||r.call(e)}})):null;let a=null;e.error&&(a=o().createElement(sr.Tooltip,{content:e.error,placement:"bottom"},o().createElement(sr.Icon,{className:t.errorIcon,name:"exclamation-triangle"})));let s=null;e.description&&(s=o().createElement(sr.Tooltip,{content:e.description,placement:n?"top":"bottom"},o().createElement(sr.Icon,{className:t.normalIcon,name:"info-circle"})));const l="string"==typeof e.label?ur.pages.Dashboard.SubMenu.submenuItemLabels(e.label):"";let u;return u=n?o().createElement("label",{className:t.verticalLabel,"data-testid":l,htmlFor:e.htmlFor},e.label,s,a,e.icon&&o().createElement(sr.Icon,{name:e.icon,className:t.normalIcon}),i,e.onRemove&&o().createElement(sr.IconButton,{variant:"secondary",size:"xs",name:"times",onClick:e.onRemove,tooltip:"Remove"})):o().createElement("label",{className:t.horizontalLabel,"data-testid":l,htmlFor:e.htmlFor},a,e.icon&&o().createElement(sr.Icon,{name:e.icon,className:t.normalIcon}),e.label,s,i),u}const Br=e=>({horizontalLabel:(0,cr.css)({background:e.isDark?e.colors.background.primary:e.colors.background.secondary,display:"flex",alignItems:"center",padding:e.spacing(0,1),fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.bodySmall.fontSize,height:e.spacing(e.components.height.md),lineHeight:e.spacing(e.components.height.md),borderRadius:e.shape.borderRadius(1),border:`1px solid ${e.components.input.borderColor}`,position:"relative",right:-1,whiteSpace:"nowrap",gap:e.spacing(.5)}),verticalLabel:(0,cr.css)({display:"flex",alignItems:"center",fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.bodySmall.fontSize,lineHeight:e.typography.bodySmall.lineHeight,whiteSpace:"nowrap",marginBottom:e.spacing(.5),gap:e.spacing(1)}),errorIcon:(0,cr.css)({color:e.colors.error.text}),normalIcon:(0,cr.css)({color:e.colors.text.secondary})});function $r(e){var t;return{label:null!=(t=e.label)?t:String(e.value),value:e.value}}function Ur(e,t){return""!==e?{value:e,label:t||e}:null}const qr=()=>!0;function Hr({filter:e,model:t}){var r,n;const i=(0,sr.useStyles2)(Wr),[s,l]=(0,a.useState)([]),[u,c]=(0,a.useState)([]),[d,h]=(0,a.useState)(!1),[p,f]=(0,a.useState)(!1),[m,g]=(0,a.useState)(!1),[v,y]=(0,a.useState)(!1),[b,w]=(0,a.useState)(""),[S,x]=(0,a.useState)(!1),O=Ur(e.key,e.keyLabel),_=Ur(e.value,e.valueLabel),E=(0,a.useMemo)((()=>hr(u.map($r),void 0)),[u])(b),k=o().createElement(sr.Select,{virtualized:!0,allowCustomValue:!0,isValidNewOption:e=>e.trim().length>0,allowCreateWhileLoading:!0,formatCreateLabel:e=>`Use custom value: ${e}`,disabled:t.state.readOnly,className:(0,cr.cx)(i.value,m?i.widthWhenOpen:void 0),width:"auto",value:_,filterOption:qr,placeholder:"Select value",options:E,inputValue:b,onInputChange:(e,{action:t})=>("input-change"===t&&w(e),e),onChange:r=>{t._updateFilter(e,"value",r),S!==r.__isNew__&&x(r.__isNew__)},isOpen:v&&!p,isLoading:p,autoFocus:""!==e.key&&""===e.value,openMenuOnFocus:!0,onOpenMenu:async()=>{var r;f(!0),y(!0);const n=await t._getValuesFor(e);f(!1),c(n),S&&w(null!=(r=null==_?void 0:_.label)?r:"")},onCloseMenu:()=>{y(!1),w("")}}),C=o().createElement(sr.Select,{key:""+(p?"loading":"loaded"),disabled:t.state.readOnly,className:(0,cr.cx)(i.key,m?i.widthWhenOpen:void 0),width:"auto",value:O,placeholder:"Select label",options:s,onChange:r=>t._updateFilter(e,"key",r),autoFocus:""===e.key,isOpen:m&&!d,isLoading:d,onOpenMenu:async()=>{g(!0),h(!0);const r=await t._getKeys(e.key);h(!1),l(r)},onCloseMenu:()=>{g(!1)},onBlur:()=>{""===e.key&&t._removeFilter(e)},openMenuOnFocus:!0});if("vertical"===t.state.layout){if(e.key){const n=o().createElement(zr,{layout:"vertical",label:null!=(r=e.key)?r:"",onRemove:()=>t._removeFilter(e)});return o().createElement(sr.Field,{label:n,"data-testid":`AdHocFilter-${e.key}`,className:i.field},o().createElement("div",{className:i.wrapper},o().createElement(sr.Select,{className:i.operator,value:e.operator,disabled:t.state.readOnly,options:t._getOperators(),width:"auto",onChange:r=>t._updateFilter(e,"operator",r)}),k))}return o().createElement(sr.Field,{label:"Select label","data-testid":`AdHocFilter-${e.key}`,className:i.field},C)}return o().createElement("div",{className:i.wrapper,"data-testid":`AdHocFilter-${e.key}`},C,o().createElement(sr.Select,{className:i.operator,value:e.operator,disabled:t.state.readOnly,options:t._getOperators(),width:"auto",onChange:r=>t._updateFilter(e,"operator",r)}),k,o().createElement(sr.Button,{variant:"secondary","aria-label":"Remove filter",title:"Remove filter",className:i.removeButton,icon:"times","data-testid":`AdHocFilter-remove-${null!=(n=e.key)?n:""}`,onClick:()=>t._removeFilter(e)}))}const Wr=e=>({field:(0,cr.css)({marginBottom:0}),wrapper:(0,cr.css)({display:"flex","> *":{"&:not(:first-child)":{marginLeft:-1},"&:first-child":{borderTopRightRadius:0,borderBottomRightRadius:0},"&:last-child":{borderTopLeftRadius:0,borderBottomLeftRadius:0},"&:not(:first-child):not(:last-child)":{borderRadius:0},position:"relative",zIndex:0,"&:hover":{zIndex:1},"&:focus-within":{zIndex:2}}}),widthWhenOpen:(0,cr.css)({minWidth:e.spacing(16)}),value:(0,cr.css)({flexShrink:1}),key:(0,cr.css)({minWidth:"90px",flexShrink:1}),operator:(0,cr.css)({flexShrink:0}),removeButton:(0,cr.css)({paddingLeft:e.spacing(1.5),paddingRight:e.spacing(1.5),borderLeft:"none",width:e.spacing(3),marginRight:e.spacing(1),boxSizing:"border-box",position:"relative",left:"1px"})});function Gr({model:e,addFilterButtonText:t}){const{_wip:r}=e.useState();return r?o().createElement(Hr,{filter:r,model:e}):o().createElement(sr.Button,{variant:"secondary",icon:"plus",title:"Add filter","aria-label":"Add filter","data-testid":"AdHocFilter-add",onClick:()=>e._addWip()},t)}class Qr{constructor(e){this._variable=e}getKey(){return`var-${this._variable.state.name}`}getKeys(){return[this.getKey()]}getUrlState(){const e=this._variable.state.filters;if(0===e.length)return{[this.getKey()]:[""]};const t=e.filter(dn).map((e=>function(e){return[Nn(e.key,e.keyLabel),e.operator,Nn(e.value,e.valueLabel)]}(e).map(In).join("|")));return{[this.getKey()]:t}}updateFromUrl(e){const t=e[this.getKey()];if(null==t)return;const r=function(e){if(Array.isArray(e)){return e.map(Kr).filter(Xr)}const t=Kr(e);return null===t?[]:[t]}(t);this._variable.setState({filters:r})}}function Kr(e){if("string"!=typeof e||0===e.length)return null;const[t,r,n,i,a,o]=e.split("|").reduce(((e,t)=>{const[r,n]=t.split(",");return e.push(r,null!=n?n:r),e}),[]).map(Mn);return{key:t,keyLabel:r,operator:n,value:a,valueLabel:o,condition:""}}function Xr(e){return null!==e&&"string"==typeof e.key&&"string"==typeof e.value}var Jr=Object.defineProperty,Yr=Object.defineProperties,Zr=Object.getOwnPropertyDescriptors,en=Object.getOwnPropertySymbols,tn=Object.prototype.hasOwnProperty,rn=Object.prototype.propertyIsEnumerable,nn=(e,t,r)=>t in e?Jr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,an=(e,t)=>{for(var r in t||(t={}))tn.call(t,r)&&nn(e,r,t[r]);if(en)for(var r of en(t))rn.call(t,r)&&nn(e,r,t[r]);return e},on=(e,t)=>Yr(e,Zr(t));class sn extends ee{constructor(e){var t,r;super(an({type:"adhoc",name:null!=(t=e.name)?t:"Filters",filters:[],datasource:null,applyMode:"auto",filterExpression:null!=(r=e.filterExpression)?r:ln(e.expressionBuilder,e.filters)},e)),this._scopedVars={__sceneObject:{value:this}},this._dataSourceSrv=(0,u.getDataSourceSrv)(),this._urlSync=new Qr(this),"auto"===this.state.applyMode&&function(e){if(e.addActivationHandler((()=>(er.add(e),()=>er.delete(e)))),Zt)return;const t=(0,u.getTemplateSrv)();(null==t?void 0:t.getAdhocFilters)&&(Zt=t.getAdhocFilters,t.getAdhocFilters=function(e){var r;if(0===er.size)return Zt.call(t);const n=(0,u.getDataSourceSrv)().getInstanceSettings(e);if(!n)return[];for(const e of er.values())if((null==(r=e.state.datasource)?void 0:r.uid)===n.uid)return e.state.filters;return[]}.bind(t))}(this)}setState(e){let t=!1;e.filters&&e.filters!==this.state.filters&&!e.filterExpression&&(e.filterExpression=ln(this.state.expressionBuilder,e.filters),t=e.filterExpression!==this.state.filterExpression),super.setState(e),t&&this.publishEvent(new ze(this),!0)}getValue(){return this.state.filterExpression}_updateFilter(e,t,{value:r,label:n}){if(null==r)return;const{filters:i,_wip:a}=this.state,o=`${t}Label`;if(e===a)return void("value"===t?this.setState({filters:[...i,on(an({},a),{[t]:r,[o]:n})],_wip:void 0}):this.setState({_wip:on(an({},e),{[t]:r,[o]:n})}));const s=this.state.filters.map((i=>{if(i===e){const a=on(an({},i),{[t]:r,[o]:n});return"key"===t&&e[t]!==r&&(a.value="",a.valueLabel=""),a}return i}));this.setState({filters:s})}_removeFilter(e){e!==this.state._wip?this.setState({filters:this.state.filters.filter((t=>t!==e))}):this.setState({_wip:void 0})}async _getKeys(e){var t,r,n;const i=await(null==(r=(t=this.state).getTagKeysProvider)?void 0:r.call(t,this,e));if(i&&i.replace)return i.values.map(cn);if(this.state.defaultKeys)return this.state.defaultKeys.map(cn);const a=await this._dataSourceSrv.get(this.state.datasource,this._scopedVars);if(!a||!a.getTagKeys)return[];const o=this.state.filters.filter((t=>t.key!==e)).concat(null!=(n=this.state.baseFilters)?n:[]),s=Tt.getTimeRange(this).state.value,l=this.state.useQueriesAsFilterForOptions?jn(this):void 0;let u=await a.getTagKeys(an({filters:o,queries:l,timeRange:s},Tr(this)));i&&(u=u.concat(i.values));const c=this.state.tagKeyRegexFilter;return c&&(u=u.filter((e=>e.text.match(c)))),u.map(cn)}async _getValuesFor(e){var t,r,n;const i=await(null==(r=(t=this.state).getTagValuesProvider)?void 0:r.call(t,this,e));if(i&&i.replace)return hn(i.values);const a=await this._dataSourceSrv.get(this.state.datasource,this._scopedVars);if(!a||!a.getTagValues)return[];const o=this.state.filters.filter((t=>t.key!==e.key)).concat(null!=(n=this.state.baseFilters)?n:[]),s=Tt.getTimeRange(this).state.value,l=this.state.useQueriesAsFilterForOptions?jn(this):void 0;let u=await a.getTagValues(an({key:e.key,filters:o,timeRange:s,queries:l},Tr(this)));return i&&(u=u.concat(i.values)),hn(u)}_addWip(){this.setState({_wip:{key:"",keyLabel:"",value:"",valueLabel:"",operator:"=",condition:""}})}_getOperators(){return["=","!=","<",">","=~","!~"].map((e=>({label:e,value:e})))}}function ln(e,t){return(null!=e?e:Rn)(null!=t?t:[])}sn.Component=function({model:e}){const{filters:t,readOnly:r,addFilterButtonText:n}=e.useState(),i=(0,sr.useStyles2)(un);return o().createElement("div",{className:i.wrapper},t.map(((t,r)=>o().createElement(o().Fragment,{key:r},o().createElement(Hr,{filter:t,model:e})))),!r&&o().createElement(Gr,{model:e,key:"'builder",addFilterButtonText:n}))};const un=e=>({wrapper:(0,cr.css)({display:"flex",flexWrap:"wrap",alignItems:"flex-end",columnGap:e.spacing(2),rowGap:e.spacing(1)}),filterIcon:(0,cr.css)({color:e.colors.text.secondary,paddingRight:e.spacing(.5)})});function cn({text:e,value:t}){return{label:e,value:String(null!=t?t:e)}}function dn(e){return""!==e.key&&""!==e.operator&&""!==e.value}function hn(e){const t=[],r=new Map;for(const n of e){const e=n.group;if(e){let i=r.get(e);i||(i=[],r.set(e,i),t.push({label:e,options:i})),i.push(cn(n))}else t.push(cn(n))}return t}class pn{constructor(){this._resultsMap=new Map,this._prevLayers=[]}getMergedStream(e){(function(e,t){if(e.length!==t.length)return!0;for(let r=0;re.getResultsStream())),r=[];for(const t of e)r.push(t.activate());return(0,k.merge)(t).pipe((0,k.mergeAll)(),(0,k.filter)((e=>this._resultsMap.get(e.origin.state.key)!==e)),(0,k.map)((e=>(this._resultsMap.set(e.origin.state.key,e),this._resultsMap.values()))),(0,k.finalize)((()=>{r.forEach((e=>e()))})))}}var fn=Object.defineProperty,mn=Object.defineProperties,gn=Object.getOwnPropertyDescriptors,vn=Object.getOwnPropertySymbols,yn=Object.prototype.hasOwnProperty,bn=Object.prototype.propertyIsEnumerable,wn=(e,t,r)=>t in e?fn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Sn=(e,t)=>{for(var r in t||(t={}))yn.call(t,r)&&wn(e,r,t[r]);if(vn)for(var r of vn(t))bn.call(t,r)&&wn(e,r,t[r]);return e},xn=(e,t)=>mn(e,gn(t));let On=100;function _n(){return"SQR"+On++}class En extends ee{constructor(e){super(e),this._dataLayersMerger=new pn,this._variableValueRecorder=new Pt,this._results=new k.ReplaySubject(1),this._scopedVars={__sceneObject:{value:this,text:"__sceneObject"}},this._variableDependency=new Dt(this,{statePaths:["queries","datasource"],onVariableUpdateCompleted:this.onVariableUpdatesCompleted.bind(this),onAnyVariableChanged:this.onAnyVariableChanged.bind(this)}),this.onDataReceived=e=>{const t=(0,l.preProcessPanelData)(e,this.state.data);this._resultAnnotations=e.annotations;const r=this._combineDataLayers(t);let n=this.state._hasFetchedData;n||t.state===be.Loading||(n=!0),this.setState({data:r,_hasFetchedData:n}),this._results.next({origin:this,data:r})},this.addActivationHandler((()=>this._onActivate()))}getResultsStream(){return this._results}_onActivate(){const e=Tt.getTimeRange(this),t=this.getClosestExtraQueryProviders();for(const e of t)this._subs.add(e.subscribeToState(((t,r)=>{e.shouldRerun(r,t)&&this.runQueries()})));return this.subscribeToTimeRangeChanges(e),this.shouldRunQueriesOnActivate()&&this.runQueries(),this._dataLayersSub||this._handleDataLayers(),()=>this._onDeactivate()}_handleDataLayers(){const e=Tt.getDataLayers(this);0!==e.length&&(this._dataLayersSub=this._dataLayersMerger.getMergedStream(e).subscribe(this._onLayersReceived.bind(this)))}_onLayersReceived(e){var t,r,n,i,a;const o=Tt.getTimeRange(this),{dataLayerFilter:s}=this.state;let u,c=[],d=[];for(const n of e)for(let e of n.data.series)(null==(t=e.meta)?void 0:t.dataTopic)===l.DataTopic.Annotations&&(c=c.concat(e)),(null==(r=e.meta)?void 0:r.dataTopic)===l.DataTopic.AlertStates&&(d=d.concat(e));if((null==s?void 0:s.panelId)&&(c.length>0&&(c=function(e,t){var r;if(!Array.isArray(e)||0===e.length)return e;const n=Array.from({length:e.length},(()=>new Set));let i=0;for(const a of e){for(let e=0;e"panelId"===e.name)),l=a.fields.find((e=>"source"===e.name));if(l){s&&"dashboard"===l.values[e].type&&(o=s.values[e]===t.panelId);const n=l.values[e].filter;if(n){const e=(null!=(r=n.ids)?r:[]).includes(t.panelId);n.exclude?e&&(o=!1):e||(o=!1)}}o&&n[i].add(e)}i++}const a=[];i=0;for(const t of e){const e=n[i].size,r=[];for(const e of t.fields){const a=[];for(let r=0;r0))for(const e of d){const t=new l.DataFrameView(e);for(const e of t)if(e.panelId===s.panelId){u=e;break}}if(Cn(c)&&Cn(this._layerAnnotations)&&(0,pe.isEqual)(u,null==(n=this.state.data)?void 0:n.alertState))return;this._layerAnnotations=c;const h=this.state.data?this.state.data:xn(Sn({},Ee),{timeRange:o.state.value});this.setState({data:xn(Sn({},h),{annotations:[...null!=(i=this._resultAnnotations)?i:[],...c],alertState:null!=u?u:null==(a=this.state.data)?void 0:a.alertState})})}onVariableUpdatesCompleted(){this.runQueries()}onAnyVariableChanged(e){this._adhocFiltersVar!==e&&this._groupByVar!==e&&(e instanceof sn&&this._isRelevantAutoVariable(e)&&this.runQueries(),e instanceof Nr&&this._isRelevantAutoVariable(e)&&this.runQueries())}_isRelevantAutoVariable(e){var t,r;const n=null!=(t=this.state.datasource)?t:kn(this.state.queries);return"auto"===e.state.applyMode&&(null==n?void 0:n.uid)===(null==(r=e.state.datasource)?void 0:r.uid)}shouldRunQueriesOnActivate(){return this._variableValueRecorder.hasDependenciesChanged(this)?(Rt(),!0):!this.state.data||!!this._isDataTimeRangeStale(this.state.data)}_isDataTimeRangeStale(e){const t=Tt.getTimeRange(this).state.value,r=e.timeRange;return(t.from.unix()!==r.from.unix()||t.to.unix()!==r.to.unix())&&(Rt(),!0)}_onDeactivate(){var e;this._querySub&&(this._querySub.unsubscribe(),this._querySub=void 0),this._dataLayersSub&&(this._dataLayersSub.unsubscribe(),this._dataLayersSub=void 0),null==(e=this._timeSub)||e.unsubscribe(),this._timeSub=void 0,this._timeSubRange=void 0,this._adhocFiltersVar=void 0,this._groupByVar=void 0,this._variableValueRecorder.recordCurrentDependencyValuesForSceneObject(this)}setContainerWidth(e){!this._containerWidth&&e>0?(this._containerWidth=e,this.state.maxDataPointsFromWidth&&!this.state.maxDataPoints&&setTimeout((()=>{this.isActive&&!this.state._hasFetchedData&&this.runQueries()}),0)):e>0&&(this._containerWidth=e)}isDataReadyToDisplay(){return Boolean(this.state._hasFetchedData)}subscribeToTimeRangeChanges(e){this._timeSubRange!==e&&(this._timeSub&&this._timeSub.unsubscribe(),this._timeSubRange=e,this._timeSub=e.subscribeToState((()=>{this.runWithTimeRange(e)})))}runQueries(){const e=Tt.getTimeRange(this);this.subscribeToTimeRangeChanges(e),this.runWithTimeRange(e)}getMaxDataPoints(){var e;return this.state.maxDataPoints?this.state.maxDataPoints:this.state.maxDataPointsFromWidth&&null!=(e=this._containerWidth)?e:500}cancelQuery(){var e;null==(e=this._querySub)||e.unsubscribe(),this._dataLayersSub&&(this._dataLayersSub.unsubscribe(),this._dataLayersSub=void 0),this.setState({data:xn(Sn({},this.state.data),{state:be.Done})})}async runWithTimeRange(e){var t,r;if(!this.state.maxDataPoints&&this.state.maxDataPointsFromWidth&&!this._containerWidth)return;if(this._dataLayersSub||this._handleDataLayers(),null==(t=this._querySub)||t.unsubscribe(),this._variableDependency.hasDependencyInLoadingState())return Rt(),void this.setState({data:xn(Sn({},this.state.data),{state:be.Loading})});const{queries:n}=this.state;if(null==n?void 0:n.length)try{const t=null!=(r=this.state.datasource)?r:kn(n),i=await At(t,this._scopedVars);this.findAndSubscribeToAdHocFilters(null==t?void 0:t.uid);const a=(0,u.getRunRequest)(),{primary:o,secondaries:s,processors:l}=this.prepareRequests(e,i);Rt(0,0,this.state.key);let c=a(i,o);if(s.length>0){const e=s.map((e=>a(i,e))),t=$t(l);c=(0,k.forkJoin)([c,...e]).pipe(t)}c=c.pipe(tr({type:"data",request:o,origin:this,cancel:()=>this.cancelQuery()})),this._querySub=c.subscribe(this.onDataReceived)}catch(e){console.error("PanelQueryRunner Error",e),this.onDataReceived(xn(Sn(Sn({},Ee),this.state.data),{state:be.Error,errors:[(0,u.toDataQueryError)(e)]}))}else this._setNoDataState()}clone(e){var t;const r=super.clone(e);return this._resultAnnotations&&(r._resultAnnotations=this._resultAnnotations.map((e=>Sn({},e)))),this._layerAnnotations&&(r._layerAnnotations=this._layerAnnotations.map((e=>Sn({},e)))),r._variableValueRecorder=this._variableValueRecorder.cloneAndRecordCurrentValuesForSceneObject(this),r._containerWidth=this._containerWidth,r._results.next({origin:this,data:null!=(t=this.state.data)?t:Ee}),r}prepareRequests(e,t){var r;const{minInterval:n,queries:i}=this.state;let a=Sn({app:"scenes",requestId:_n(),timezone:e.getTimeZone(),range:e.state.value,interval:"1s",intervalMs:1e3,targets:(0,pe.cloneDeep)(i),maxDataPoints:this.getMaxDataPoints(),scopedVars:this._scopedVars,startTime:Date.now(),liveStreaming:this.state.liveStreaming,rangeRaw:{from:e.state.from,to:e.state.to},cacheTimeout:this.state.cacheTimeout,queryCachingTTL:this.state.queryCachingTTL},Yt(this));this._adhocFiltersVar&&(a.filters=this._adhocFiltersVar.state.filters.filter(dn)),this._groupByVar&&(a.groupByKeys=this._groupByVar.state.value),a.targets=a.targets.map((e=>{var r;return e.datasource&&(e.datasource.uid===t.uid||(null==(r=t.meta)?void 0:r.mixed)||!u.isExpressionReference||(0,u.isExpressionReference)(e.datasource))||(e.datasource=t.getRef()),e}));const o=n||t.interval,s=l.rangeUtil.calculateInterval(e.state.value,a.maxDataPoints,o);a.scopedVars=Object.assign({},a.scopedVars,{__interval:{text:s.interval,value:s.interval},__interval_ms:{text:s.intervalMs.toString(),value:s.intervalMs}}),a.interval=s.interval,a.intervalMs=s.intervalMs;const c=e.state.value;let d=[],h=new Map;for(const e of null!=(r=this.getClosestExtraQueryProviders())?r:[])for(const{req:t,processor:r}of e.getExtraQueries(a)){const e=_n();d.push(xn(Sn({},t),{requestId:e})),h.set(e,null!=r?r:Bt)}return a.range=c,{primary:a,secondaries:d,processors:h}}_combineDataLayers(e){return this._layerAnnotations&&this._layerAnnotations.length>0&&(e.annotations=(e.annotations||[]).concat(this._layerAnnotations)),this.state.data&&this.state.data.alertState&&(e.alertState=this.state.data.alertState),e}_setNoDataState(){this.state.data!==Ee&&this.setState({data:Ee})}getClosestExtraQueryProviders(){const e=new Map;return this.parent?(ce(this.parent,(t=>(jt(t)&&!e.has(t.constructor)&&e.set(t.constructor,t),t.forEachChild((t=>{jt(t)&&!e.has(t.constructor)&&e.set(t.constructor,t)})),null))),Array.from(e.values())):[]}findAndSubscribeToAdHocFilters(e){const t=function(e){var t;for(const r of er.values())if((null==(t=r.state.datasource)?void 0:t.uid)===e)return r}(e);this._adhocFiltersVar!==t&&(this._adhocFiltersVar=t,this._updateExplicitVariableDependencies());const r=function(e){var t;for(const r of rr.values())if((null==(t=r.state.datasource)?void 0:t.uid)===e)return r}(e);this._groupByVar!==r&&(this._groupByVar=r,this._updateExplicitVariableDependencies())}_updateExplicitVariableDependencies(){const e=[];this._adhocFiltersVar&&e.push(this._adhocFiltersVar.state.name),this._groupByVar&&e.push(this._groupByVar.state.name),this._variableDependency.setVariableNames(e)}}function kn(e){var t,r;return null!=(r=null==(t=e.find((e=>null!==e.datasource)))?void 0:t.datasource)?r:void 0}function Cn(e){if(!e)return!0;for(let t=0;t0)return!1;return!0}function Tn(e,t){return e===t||(0,pe.isEqual)(e,t)}function An(e){try{return JSON.stringify(e,(()=>{const e=new WeakSet;return(t,r)=>{if("object"==typeof r&&null!==r){if(e.has(r))return;e.add(r)}return r}})())}catch(e){console.error(e)}return""}function Rn(e){return e.map((e=>function(e){let t="";t="=~"===e.operator||"!~¨"===e.operator?Dn(function(e){return e.replace(Pn,"\\$&")}(e.value)):Dn(e.value);return`${e.key}${e.operator}"${t}"`}(e))).join(",")}function Dn(e){return e.replace(/\\/g,"\\\\").replace(/\n/g,"\\n").replace(/"/g,'\\"')}const Pn=/[*+?()|\\.\[\]{}^$]/g;function jn(e){const t=function(e){const t={};for(const r of e)r.state.key&&(r.state.key in t||(t[r.state.key]=[]),t[r.state.key].push(r));return Object.values(t).flatMap((e=>{const t=e.filter((e=>e.isActive));return 0===t.length&&1===e.length?e:t}))}(Tt.findAllObjects(e.getRoot(),(e=>e instanceof En))).filter((t=>{var r,n;return(null==(r=t.state.datasource)?void 0:r.uid)===(null==(n=e.state.datasource)?void 0:n.uid)}));if(0===t.length)return[];const r=[];return t.forEach((e=>{r.push(...e.state.queries)})),r}function In(e){return null==e?"":/\|/g[Symbol.replace](e,"__gfp__")}function Ln(e){return null==e?"":/,/g[Symbol.replace](e,"__gfc__")}function Mn(e){return null==e?"":(e=/__gfp__/g[Symbol.replace](e,"|"),e=/__gfc__/g[Symbol.replace](e,","))}function Nn(e,t){return t&&e!==t?[e,t].map(Ln).join(","):Ln(e)}var Fn=(e=>(e[e.never=0]="never",e[e.onDashboardLoad=1]="onDashboardLoad",e[e.onTimeRangeChanged=2]="onTimeRangeChanged",e))(Fn||{});var Vn=(e=>(e[e.Crosshair=1]="Crosshair",e[e.Off=0]="Off",e[e.Tooltip=2]="Tooltip",e))(Vn||{});var zn=Object.defineProperty,Bn=Object.defineProperties,$n=Object.getOwnPropertyDescriptors,Un=Object.getOwnPropertySymbols,qn=Object.prototype.hasOwnProperty,Hn=Object.prototype.propertyIsEnumerable,Wn=(e,t,r)=>t in e?zn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;class Gn extends ee{constructor(e){var t,r;super((t=((e,t)=>{for(var r in t||(t={}))qn.call(t,r)&&Wn(e,r,t[r]);if(Un)for(var r of Un(t))Hn.call(t,r)&&Wn(e,r,t[r]);return e})({},e),r={sync:e.sync||Vn.Off},Bn(t,$n(r)))),this.getEventsBus=e=>{if(!this.parent)throw new Error("EnableCursorSync cannot be used as a standalone scene object");return new Qn(this.parent,e)}}getEventsScope(){if(!this.parent)throw new Error("EnableCursorSync cannot be used as a standalone scene object");return this.state.key}}class Qn{constructor(e,t){this._source=e,this._eventsOrigin=t}publish(e){e.origin=this,this._eventsOrigin.publishEvent(e,!0)}getStream(e){return new k.Observable((t=>{const r=this._source.subscribeToEvent(e,(e=>{t.next(e)}));return()=>r.unsubscribe()}))}subscribe(e,t){return this.getStream(e).pipe().subscribe(t)}removeAllListeners(){}newScopedBus(e,t){throw new Error("For internal use only")}}var Kn=function(){};var Xn="undefined"!=typeof window;const Jn=Xn?a.useLayoutEffect:a.useEffect;var Yn={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};const Zn=Xn&&void 0!==window.ResizeObserver?function(){var e=(0,a.useState)(null),t=e[0],r=e[1],n=(0,a.useState)(Yn),i=n[0],o=n[1],s=(0,a.useMemo)((function(){return new window.ResizeObserver((function(e){if(e[0]){var t=e[0].contentRect,r=t.x,n=t.y,i=t.width,a=t.height,s=t.top,l=t.left,u=t.bottom,c=t.right;o({x:r,y:n,width:i,height:a,top:s,left:l,bottom:u,right:c})}}))}),[]);return Jn((function(){if(t)return s.observe(t),function(){s.disconnect()}}),[t]),[r,i]}:function(){return[Kn,Yn]};function ei(e,t){if(t)return t;let r=e.error?e.error.message:void 0;return e.errors&&(r=e.errors.map((e=>e.message)).join(", ")),r}const ti=(0,cr.css)({position:"relative",width:"100%",height:"100%"}),ri=(0,cr.css)({position:"absolute",width:"100%",height:"100%"}),ni=e=>({ok:(0,cr.css)({color:e.colors.success.text}),pending:(0,cr.css)({color:e.colors.warning.text}),alerting:(0,cr.css)({color:e.colors.error.text})});var ii=Object.defineProperty,ai=Object.defineProperties,oi=Object.getOwnPropertyDescriptors,si=Object.getOwnPropertySymbols,li=Object.prototype.hasOwnProperty,ui=Object.prototype.propertyIsEnumerable,ci=(e,t,r)=>t in e?ii(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,di=(e,t)=>{for(var r in t||(t={}))li.call(t,r)&&ci(e,r,t[r]);if(si)for(var r of si(t))ui.call(t,r)&&ci(e,r,t[r]);return e},hi=(e,t)=>ai(e,oi(t));const pi="hideSeriesFrom",fi=(0,l.isSystemOverrideWithRef)(pi);function mi(e,t=l.ByNamesMatcherMode.exclude,r){return r=null!=r?r:{id:"custom.hideFrom",value:{viz:!0,legend:!1,tooltip:!1}},{__systemRef:pi,matcher:{id:l.FieldMatcherID.byNames,options:{mode:t,names:e,prefix:t===l.ByNamesMatcherMode.exclude?"All except:":void 0,readOnly:!0}},properties:[hi(di({},r),{value:{viz:!0,legend:!1,tooltip:!1}})]}}const gi=(e,t,r=l.ByNamesMatcherMode.exclude)=>{const n=e.properties.find((e=>"custom.hideFrom"===e.id)),i=vi(e),a=i.findIndex((e=>e===t));return a<0?i.push(t):i.splice(a,1),mi(i,r,n)},vi=e=>{var t;const r=null==(t=e.matcher.options)?void 0:t.names;return Array.isArray(r)?[...r]:[]},yi=(e,t)=>vi(e).length===bi(t).length,bi=(e,t)=>{const r=new Set;for(const n of e)for(const i of n.fields){if(i.type!==l.FieldType.number)continue;const a=(0,l.getFieldDisplayName)(i,n,e);a!==t&&r.add(a)}return Array.from(r)},wi=(e,t)=>{var r;let n=[];for(const i of e){const e=i.properties.find((e=>"custom.hideFrom"===e.id));if(void 0!==e&&!0===(null==(r=e.value)?void 0:r.legend)){const e=l.fieldMatchers.get(i.matcher.id).get(i.matcher.options);for(const r of t)for(const i of r.fields){if(i.type!==l.FieldType.number)continue;const a=(0,l.getFieldDisplayName)(i,r,t);e(i,r,t)&&n.push(a)}}}return n};var Si=Object.defineProperty,xi=Object.defineProperties,Oi=Object.getOwnPropertyDescriptors,_i=Object.getOwnPropertySymbols,Ei=Object.prototype.hasOwnProperty,ki=Object.prototype.propertyIsEnumerable,Ci=(e,t,r)=>t in e?Si(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ti=(e,t)=>{for(var r in t||(t={}))Ei.call(t,r)&&Ci(e,r,t[r]);if(_i)for(var r of _i(t))ki.call(t,r)&&Ci(e,r,t[r]);return e},Ai=(e,t)=>xi(e,Oi(t));const Ri=(e,t)=>({matcher:{id:l.FieldMatcherID.byName,options:e},properties:[Di(t)]}),Di=e=>({id:"color",value:{mode:l.FieldColorModeId.Fixed,fixedColor:e}});var Pi=Object.defineProperty,ji=Object.defineProperties,Ii=Object.getOwnPropertyDescriptors,Li=Object.getOwnPropertySymbols,Mi=Object.prototype.hasOwnProperty,Ni=Object.prototype.propertyIsEnumerable,Fi=(e,t,r)=>t in e?Pi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Vi=(e,t)=>{for(var r in t||(t={}))Mi.call(t,r)&&Fi(e,r,t[r]);if(Li)for(var r of Li(t))Ni.call(t,r)&&Fi(e,r,t[r]);return e},zi=(e,t)=>ji(e,Ii(t));class Bi extends ee{constructor(e){var t;super(Vi({options:{},fieldConfig:{defaults:{},overrides:[]},title:"Title",pluginId:"timeseries"},e)),this._variableDependency=new Dt(this,{statePaths:["title","options","fieldConfig"]}),this._structureRev=0,this.onTimeRangeChange=e=>{Tt.getTimeRange(this).onTimeRangeChange({raw:{from:(0,l.toUtc)(e.from),to:(0,l.toUtc)(e.to)},from:(0,l.toUtc)(e.from),to:(0,l.toUtc)(e.to)})},this.getTimeRange=e=>{const t=Tt.findObject(this,(e=>e instanceof Ui)),r=Tt.getTimeRange(this);if(t instanceof Ui&&t.isEnabled)return Ae(r.state.from,r.state.to,r.getTimeZone(),r.state.fiscalYearStartMonth,r.state.UNSAFE_nowDelay);const n=this.getPlugin();return n&&!n.meta.skipDataQuery&&e&&e.timeRange?e.timeRange:r.state.value},this.onTitleChange=e=>{this.setState({title:e})},this.onDescriptionChange=e=>{this.setState({description:e})},this.onDisplayModeChange=e=>{this.setState({displayMode:e})},this.onOptionsChange=(e,t=!1)=>{const{fieldConfig:r,options:n}=this.state,i=t?e:(0,pe.mergeWith)((0,pe.cloneDeep)(n),e,((e,t)=>{if((0,pe.isArray)(t))return t})),a=(0,l.getPanelOptionsWithDefaults)({plugin:this._plugin,currentOptions:i,currentFieldConfig:r,isAfterPluginChange:!1});this.setState({options:a.options})},this.onFieldConfigChange=(e,t)=>{const{fieldConfig:r,options:n}=this.state,i=t?e:(0,pe.merge)((0,pe.cloneDeep)(r),e),a=(0,l.getPanelOptionsWithDefaults)({plugin:this._plugin,currentOptions:n,currentFieldConfig:i,isAfterPluginChange:!1});this._dataWithFieldConfig=void 0,this.setState({fieldConfig:a.fieldConfig})},this.interpolate=(e,t,r)=>Tt.interpolate(this,e,t,r),this.getDescription=()=>{this.publishEvent(new q({origin:this,interaction:"panel-description-shown"}),!0);const{description:e}=this.state;if(e){const t=this.interpolate(e);return(0,l.renderMarkdown)(t)}return""},this.onCancelQuery=()=>{var e;this.publishEvent(new q({origin:this,interaction:"panel-cancel-query-clicked"}),!0);const t=Tt.getData(this);null==(e=t.cancelQuery)||e.call(t)},this.onStatusMessageClick=()=>{this.publishEvent(new q({origin:this,interaction:"panel-status-message-clicked"}),!0)},this._onSeriesColorChange=(e,t)=>{this.onFieldConfigChange(((e,t,r)=>{const{overrides:n}=r,i=r.overrides.findIndex((t=>t.matcher.id===l.FieldMatcherID.byName&&t.matcher.options===e));if(i<0)return Ai(Ti({},r),{overrides:[...r.overrides,Ri(e,t)]});const a=Array.from(n),o=a[i],s=o.properties.findIndex((e=>"color"===e.id));if(s<0)return a[i]=Ai(Ti({},o),{properties:[...o.properties,Di(t)]}),Ai(Ti({},r),{overrides:a});const u=Array.from(o.properties);return u[s]=Di(t),a[i]=Ai(Ti({},o),{properties:u}),Ai(Ti({},r),{overrides:a})})(e,t,this.state.fieldConfig))},this._onSeriesVisibilityChange=(e,t)=>{this._dataWithFieldConfig&&this.onFieldConfigChange(function(e,t,r,n){const{overrides:i}=r,a=e,o=i.findIndex(fi);if(o<0){if(t===sr.SeriesVisibilityChangeMode.ToggleSelection){const e=mi([a,...wi(i,n)]);return hi(di({},r),{overrides:[...r.overrides,e]})}const e=mi(bi(n,a));return hi(di({},r),{overrides:[...r.overrides,e]})}const s=Array.from(i),[l]=s.splice(o,1);if(t===sr.SeriesVisibilityChangeMode.ToggleSelection){let e=vi(l);const t=wi(s,n);if(t.length>0&&(e=e.filter((e=>t.indexOf(e)<0))),e[0]===a&&1===e.length)return hi(di({},r),{overrides:s});const i=mi([a,...t]);return hi(di({},r),{overrides:[...s,i]})}const u=gi(l,a);return yi(u,n)?hi(di({},r),{overrides:s}):hi(di({},r),{overrides:[...s,u]})}(e,t,this.state.fieldConfig,this._dataWithFieldConfig.series),!0)},this._onInstanceStateChange=e=>{this._panelContext&&(this._panelContext=zi(Vi({},this._panelContext),{instanceState:e})),this.setState({_pluginInstanceState:e})},this._onToggleLegendSort=e=>{const t=this.state.options.legend;if(!t)return;let r=t.sortDesc,n=t.sortBy;e!==n&&(r=void 0),!1===r?(n=void 0,r=void 0):(r=!r,n=e),this.onOptionsChange(zi(Vi({},this.state.options),{legend:zi(Vi({},t),{sortBy:n,sortDesc:r})}),!0)},this.addActivationHandler((()=>{this._onActivate()})),null==(t=e.menu)||t.addActivationHandler((()=>{this.publishEvent(new q({origin:this,interaction:"panel-menu-shown"}),!0)}))}_onActivate(){this._plugin||this._loadPlugin(this.state.pluginId)}async _loadPlugin(e){const t=function(e){var t;const{getPanelPluginFromCache:r}=(0,u.getPluginImportUtils)();return null!=(t=r(e))?t:E.get(e)}(e);if(t)this._pluginLoaded(t);else{const{importPanelPlugin:t}=(0,u.getPluginImportUtils)();try{const r=await t(e);this._pluginLoaded(r)}catch(t){this._pluginLoaded(function(e){const t=new l.PanelPlugin((()=>null));return t.meta={id:e,name:e,sort:100,type:l.PluginType.panel,module:"",baseUrl:"",info:{author:{name:""},description:"",links:[],logos:{large:"",small:"public/img/grafana_icon.svg"},screenshots:[],updated:"",version:""}},t}(e)),t instanceof Error&&this.setState({_pluginLoadError:t.message})}}}getLegacyPanelId(){const e=parseInt(this.state.key.replace("panel-",""),10);return isNaN(e)?0:e}async _pluginLoaded(e){const{options:t,fieldConfig:r,title:n,pluginVersion:i,_UNSAFE_customMigrationHandler:a}=this.state,o={title:n,options:t,fieldConfig:r,id:this.getLegacyPanelId(),type:e.meta.id,pluginVersion:i},s=this._getPluginVersion(e);null==a||a(o,e),e.onPanelMigration&&s!==this.state.pluginVersion&&(o.options=await e.onPanelMigration(o));const u=(0,l.getPanelOptionsWithDefaults)({plugin:e,currentOptions:o.options,currentFieldConfig:o.fieldConfig,isAfterPluginChange:!1});if(this._plugin=e,this.setState({options:u.options,fieldConfig:u.fieldConfig,pluginVersion:s}),e.meta.skipDataQuery){const e=Tt.getTimeRange(this);this._subs.add(e.subscribeToState((()=>this.forceRender())))}}_getPluginVersion(e){return e&&e.meta.info.version?e.meta.info.version:u.config.buildInfo.version}getPlugin(){return this._plugin}getPanelContext(){return null!=this._panelContext||(this._panelContext=this.buildPanelContext()),this._panelContext}clearFieldConfigCache(){this._dataWithFieldConfig=void 0}applyFieldConfig(e){var t,r,n,i;const a=this._plugin;if(!a||a.meta.skipDataQuery||!e)return Ee;if(this._prevData===e&&this._dataWithFieldConfig)return this._dataWithFieldConfig;const o=a.dataSupport||{alertStates:!1,annotations:!1},s=a.fieldConfigRegistry,c=null!=(r=null==(t=this._dataWithFieldConfig)?void 0:t.series)?r:[],d=(0,l.applyFieldOverrides)({data:e.series,fieldConfig:this.state.fieldConfig,fieldConfigRegistry:s,replaceVariables:this.interpolate,theme:u.config.theme2,timeZone:null==(n=e.request)?void 0:n.timezone});return(0,l.compareArrayValues)(d,c,l.compareDataFrameStructures)||this._structureRev++,this._dataWithFieldConfig=zi(Vi({},e),{structureRev:this._structureRev,series:d}),this._dataWithFieldConfig.annotations&&(this._dataWithFieldConfig.annotations=(0,l.applyFieldOverrides)({data:this._dataWithFieldConfig.annotations,fieldConfig:{defaults:{},overrides:[]},fieldConfigRegistry:s,replaceVariables:this.interpolate,theme:u.config.theme2,timeZone:null==(i=e.request)?void 0:i.timezone})),o.alertStates||(this._dataWithFieldConfig.alertState=void 0),o.annotations||(this._dataWithFieldConfig.annotations=void 0),this._prevData=e,this._dataWithFieldConfig}buildPanelContext(){const e=(t=this,Tt.findObject(t,(e=>e instanceof Gn)));var t;const r={eventsScope:e?e.getEventsScope():"__global_",eventBus:e?e.getEventsBus(this):(0,u.getAppEvents)(),app:l.CoreApp.Unknown,sync:()=>e?e.state.sync:l.DashboardCursorSync.Off,onSeriesColorChange:this._onSeriesColorChange,onToggleSeriesVisibility:this._onSeriesVisibilityChange,onToggleLegendSort:this._onToggleLegendSort,onInstanceStateChange:this._onInstanceStateChange};return this.state.extendPanelContext&&this.state.extendPanelContext(this,r),r}}Bi.Component=function({model:e}){var t;const{title:r,options:n,fieldConfig:i,_pluginLoadError:s,displayMode:c,hoverHeader:d,hoverHeaderOffset:h,menu:p,headerActions:f,titleItems:m,description:g}=e.useState(),[v,{width:y,height:b}]=Zn(),w=(0,a.useMemo)((()=>(0,u.getAppEvents)()),[]),S=(0,a.useCallback)((()=>w.publish(new l.SetPanelAttentionEvent({panelId:e.state.key}))),[e.state.key,w]),x=(0,a.useMemo)((()=>(0,pe.debounce)(S,100)),[S]),O=e.getPlugin(),{dragClass:_,dragClassCancel:E}=function(e){var t,r;const n=Tt.getLayout(e),i=null==n?void 0:n.isDraggable();if(!n||!i||function(e,t){let r=e.parent;for(;r&&r!==t;){if("isDraggable"in r.state&&!1===r.state.isDraggable)return!0;r=r.parent}return!1}(e,n))return{dragClass:"",dragClassCancel:""};return{dragClass:null==(t=n.getDragClass)?void 0:t.call(n),dragClassCancel:null==(r=null==n?void 0:n.getDragClassCancel)?void 0:r.call(n)}}(e),k=Tt.getData(e),C=k.useState(),T=e.applyFieldConfig(C.data),A=Tt.getTimeRange(e).getTimeZone(),R=e.getTimeRange(T),D=e.interpolate(r,void 0,"text"),P=(0,sr.useStyles2)(ni);if(!O)return o().createElement("div",null,"Loading plugin panel...");if(!O.panel)return o().createElement("div",null,"Panel plugin has no panel component");const j=O.panel;k&&k.setContainerWidth&&k.setContainerWidth(Math.round(y));let I,L,M=[];m&&(Array.isArray(m)?M=M.concat(m.map((e=>o().createElement(e.Component,{model:e,key:`${e.state.key}`})))):st(m)?M.push(o().createElement(m.Component,{model:m})):M.push(m)),e.state.$timeRange&&M.push(o().createElement(e.state.$timeRange.Component,{model:e.state.$timeRange,key:e.state.key})),T.alertState&&M.push(o().createElement(sr.Tooltip,{content:null!=(t=T.alertState.state)?t:"unknown",key:`alert-states-icon-${e.state.key}`},o().createElement(sr.PanelChrome.TitleItem,{className:(0,cr.cx)({[P.ok]:T.alertState.state===l.AlertState.OK,[P.pending]:T.alertState.state===l.AlertState.Pending,[P.alerting]:T.alertState.state===l.AlertState.Alerting})},o().createElement(sr.Icon,{name:"alerting"===T.alertState.state?"heart-break":"heart",className:"panel-alert-icon",size:"md"})))),p&&(I=o().createElement(p.Component,{model:p})),f&&(L=Array.isArray(f)?o().createElement(o().Fragment,null,f.map((e=>o().createElement(e.Component,{model:e,key:`${e.state.key}`})))):st(f)?o().createElement(f.Component,{model:f}):f);const N=T,F=!k.isDataReadyToDisplay||k.isDataReadyToDisplay(),V=e.getPanelContext(),z=e.getLegacyPanelId();return o().createElement("div",{className:ti},o().createElement("div",{ref:v,className:ri,"data-viz-panel-key":e.state.key},y>0&&b>0&&o().createElement(sr.PanelChrome,{title:D,description:(null==g?void 0:g.trim())?e.getDescription:void 0,loadingState:N.state,statusMessage:ei(N,s),statusMessageOnClick:e.onStatusMessageClick,width:y,height:b,displayMode:c,hoverHeader:d,hoverHeaderOffset:h,titleItems:M,dragClass:_,actions:L,dragClassCancel:E,padding:O.noPadding?"none":"md",menu:I,onCancelQuery:e.onCancelQuery,onFocus:S,onMouseMove:x},((t,a)=>o().createElement(o().Fragment,null,o().createElement(sr.ErrorBoundaryAlert,{dependencies:[O,N]},o().createElement(l.PluginContextProvider,{meta:O.meta},o().createElement(sr.PanelContextProvider,{value:V},F&&o().createElement(j,{id:z,data:N,title:r,timeRange:R,timeZone:A,options:n,fieldConfig:i,transparent:!1,width:t,height:a,renderCounter:0,replaceVariables:e.interpolate,onOptionsChange:e.onOptionsChange,onFieldConfigChange:e.onFieldConfigChange,onChangeTimeRange:e.onTimeRangeChange,eventBus:w})))))))))};const $i=class extends ee{constructor({enabled:e=!1}){super({enabled:e}),this.timerId=void 0,this._activationHandler=()=>(this.state.enabled&&this.enable(),()=>{window.clearInterval(this.timerId),this.timerId=void 0}),this.addActivationHandler(this._activationHandler)}enable(){window.clearInterval(this.timerId),this.timerId=void 0,this.timerId=window.setInterval((()=>{const e=Tt.findAllObjects(this.getRoot(),(e=>e instanceof Bi));for(const t of e)t.forceRender()}),$i.REFRESH_RATE),this.setState({enabled:!0})}disable(){window.clearInterval(this.timerId),this.timerId=void 0,this.setState({enabled:!1})}get isEnabled(){return this.state.enabled}};let Ui=$i;function qi(e){if("string"==typeof e)return e;if(e){if(e instanceof Error)return e.message;if((0,u.isFetchError)(e)){if(e.data&&e.data.message)return e.data.message;if(e.statusText)return e.statusText}else if(e.hasOwnProperty("message"))return e.message}return JSON.stringify(e)}Ui.REFRESH_RATE=100;var Hi=Object.defineProperty,Wi=Object.getOwnPropertySymbols,Gi=Object.prototype.hasOwnProperty,Qi=Object.prototype.propertyIsEnumerable,Ki=(e,t,r)=>t in e?Hi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;class Xi extends ee{constructor(e,t=[]){super(((e,t)=>{for(var r in t||(t={}))Gi.call(t,r)&&Ki(e,r,t[r]);if(Wi)for(var r of Wi(t))Qi.call(t,r)&&Ki(e,r,t[r]);return e})({isEnabled:!0},e)),this._results=new k.ReplaySubject(1),this.isDataLayer=!0,this._variableValueRecorder=new Pt,this._variableDependency=new Dt(this,{onVariableUpdateCompleted:this.onVariableUpdateCompleted.bind(this)}),this._variableDependency.setPaths(t),this.addActivationHandler((()=>this.onActivate()))}onActivate(){return this.state.isEnabled&&this.onEnable(),this.shouldRunLayerOnActivate()&&this.runLayer(),this.subscribeToState(((e,t)=>{!e.isEnabled&&this.querySub&&(this.querySub.unsubscribe(),this.querySub=void 0,this.onDisable(),this._results.next({origin:this,data:Ee}),this.setStateHelper({data:Ee})),e.isEnabled&&!t.isEnabled&&(this.onEnable(),this.runLayer())})),()=>{this.onDeactivate()}}onDeactivate(){this.querySub&&(this.querySub.unsubscribe(),this.querySub=void 0),this.onDisable(),this._variableValueRecorder.recordCurrentDependencyValuesForSceneObject(this)}onVariableUpdateCompleted(){this.runLayer()}cancelQuery(){this.querySub&&(this.querySub.unsubscribe(),this.querySub=void 0,this.publishResults(Ee))}publishResults(e){this.state.isEnabled&&(this._results.next({origin:this,data:e}),this.setStateHelper({data:e}))}getResultsStream(){return this._results}shouldRunLayerOnActivate(){return this._variableValueRecorder.hasDependenciesChanged(this)?(Rt(),!0):!this.state.data}setStateHelper(e){nr(this,e)}}function Ji({layer:e}){var t,r;const n=`data-layer-${e.state.key}`,{data:i,isEnabled:a}=e.useState(),s=Boolean(i&&i.state===be.Loading);return o().createElement("div",{className:Yi},o().createElement(zr,{htmlFor:n,isLoading:s,onCancel:()=>{var t;return null==(t=e.cancelQuery)?void 0:t.call(e)},label:e.state.name,description:e.state.description,error:null==(r=null==(t=e.state.data)?void 0:t.errors)?void 0:r[0].message}),o().createElement(sr.InlineSwitch,{id:n,value:a,onChange:()=>e.setState({isEnabled:!a})}))}(class extends ee{constructor(){super({})}}).Component=function({model:e}){const t=Tt.getDataLayers(e,!0);if(0===t.length)return null;return o().createElement(o().Fragment,null,t.map((e=>o().createElement(e.Component,{model:e,key:e.state.key}))))};const Yi=(0,cr.css)({display:"flex"});var Zi=r(7708),ea=r(4120),ta=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e},ra=r(1693);var na=r(8353),ia=r(3449),aa="function"==typeof Symbol&&Symbol.observable||"@@observable",oa=r(3887);function sa(e){return 0===e.length?oa.D:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}var la=r(2236),ua=r(3004),ca=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(e,t,r){var n,i=this,a=(n=e)&&n instanceof na.vU||function(e){return e&&(0,ra.T)(e.next)&&(0,ra.T)(e.error)&&(0,ra.T)(e.complete)}(n)&&(0,ia.Uv)(n)?e:new na.Ms(e,t,r);return(0,ua.Y)((function(){var e=i,t=e.operator,r=e.source;a.add(t?t.call(a,r):r?i._subscribe(a):i._trySubscribe(a))})),a},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var r=this;return new(t=da(t))((function(t,n){var i=new na.Ms({next:function(t){try{e(t)}catch(e){n(e),i.unsubscribe()}},error:n,complete:t});r.subscribe(i)}))},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[aa]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;tt in e?ba(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;const ka={prepareAnnotation:e=>{if((0,pe.isString)(null==e?void 0:e.query)){const r=e,{query:n}=r,i=((e,t)=>{var r={};for(var n in e)Oa.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&xa)for(var n of xa(e))t.indexOf(n)<0&&_a.call(e,n)&&(r[n]=e[n]);return r})(r,["query"]);return t=((e,t)=>{for(var r in t||(t={}))Oa.call(t,r)&&Ea(e,r,t[r]);if(xa)for(var r of xa(t))_a.call(t,r)&&Ea(e,r,t[r]);return e})({},i),wa(t,Sa({target:{refId:"annotation_query",query:n},mappings:{}}))}var t;return e},prepareQuery:e=>e.target,processEvents:(e,t)=>function(e,t){return(0,k.of)(e).pipe((e=>e.pipe(ya((e=>{if(!(null==e?void 0:e.length))return(0,k.of)(void 0);if(1===e.length)return(0,k.of)(e[0]);const t={interpolate:e=>e};return(0,k.of)(e).pipe(l.standardTransformers.mergeTransformer.operator({},t),(0,Zi.T)((e=>e[0])))})))),(0,Zi.T)((e=>{if(!(null==e?void 0:e.length))return[];let r=!1,n=!1;const i={};for(const t of e.fields){i[(0,l.getFieldDisplayName)(t,e).toLowerCase()]=t}t||(t={});const a=[];for(const o of Ta){const s=t[o.key]||{};if(s.source===l.AnnotationEventFieldSource.Skip)continue;const u={key:o.key,split:o.split};if(s.source===l.AnnotationEventFieldSource.Text)u.text=s.value;else{const t=(s.value||o.key).toLowerCase();u.field=i[t],!u.field&&o.field&&(u.field=o.field(e))}(u.field||u.text)&&(a.push(u),"time"===u.key?r=!0:"text"===u.key&&(n=!0))}if(!r||!n)return console.error("Cannot process annotation fields. No time or text present."),[];const o=[];for(let t=0;te.fields.find((e=>e.type===l.FieldType.time)),placeholder:"time, or the first time field"},{key:"timeEnd",help:"When this field is defined, the annotation will be treated as a range"},{key:"title"},{key:"text",field:e=>e.fields.find((e=>e.type===l.FieldType.string)),placeholder:"text, or the first text field"},{key:"tags",split:",",help:"The results will be split on comma (,)"},{key:"id"}],Ta=[...u.config.publicDashboardAccessToken?[{key:"color"},{key:"isRegion"},{key:"source"}]:[],...Ca,{key:"userId"},{key:"login"},{key:"email"},{key:"prevState"},{key:"newState"},{key:"data"},{key:"panelId"},{key:"alertId"},{key:"dashboardId"},{key:"dashboardUID"}];const Aa=["prometheus","loki","elasticsearch","grafana-opensearch-datasource"];var Ra=Object.defineProperty,Da=Object.defineProperties,Pa=Object.getOwnPropertyDescriptors,ja=Object.getOwnPropertySymbols,Ia=Object.prototype.hasOwnProperty,La=Object.prototype.propertyIsEnumerable,Ma=(e,t,r)=>t in e?Ra(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Na=(e,t)=>{for(var r in t||(t={}))Ia.call(t,r)&&Ma(e,r,t[r]);if(ja)for(var r of ja(t))La.call(t,r)&&Ma(e,r,t[r]);return e},Fa=(e,t)=>Da(e,Pa(t));let Va=100;function za(e,t,r,n){var i;if(e.annotationQuery&&function(e){const{type:t}=e;return!e.annotations||Aa.includes(t)}(e))return console.warn("Using deprecated annotationQuery method, please upgrade your datasource"),(0,k.from)(e.annotationQuery({range:t.state.value,rangeRaw:t.state.value.raw,annotation:r,dashboard:{}})).pipe((0,Zi.T)((e=>({state:be.Done,events:e}))));const a=Na(Na({},ka),e.annotations),o=Na(Na({},null==(i=a.getDefaultQuery)?void 0:i.call(a)),r),s=a.prepareAnnotation(o);if(!s)return(0,k.of)({state:be.Done,events:[]});const c=a.prepareQuery(s);if(!c)return(0,k.of)({state:be.Done,events:[]});const d=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,h=l.rangeUtil.calculateInterval(t.state.value,d,e.interval),p={__interval:{text:h.interval,value:h.interval},__interval_ms:{text:h.intervalMs.toString(),value:h.intervalMs},__annotation:{text:s.name,value:s},__sceneObject:{text:"__sceneObject",value:n}},f=Na(Fa(Na({startTime:Date.now(),requestId:"AQ"+Va++,range:t.state.value,maxDataPoints:d,scopedVars:p},h),{app:l.CoreApp.Dashboard,timezone:t.getTimeZone(),targets:[Fa(Na({},c),{refId:"Anno"})]}),Yt(n));return(0,u.getRunRequest)()(e,f).pipe(ya((e=>{const t=(null==e?void 0:e.series.length)?e.series:e.annotations;return(null==t?void 0:t.length)?(t.forEach((e=>{var t;(null==(t=e.meta)?void 0:t.dataTopic)||(e.meta=Fa(Na({},e.meta||{}),{dataTopic:l.DataTopic.Annotations}))})),a.processEvents(s,t).pipe((0,Zi.T)((t=>({state:e.state,events:t||[]}))))):(0,k.of)({state:e.state,events:[]})})))}var Ba=Object.defineProperty,$a=Object.getOwnPropertySymbols,Ua=Object.prototype.hasOwnProperty,qa=Object.prototype.propertyIsEnumerable,Ha=(e,t,r)=>t in e?Ba(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;function Wa(e,t){e.snapshotData&&delete(e=(0,pe.cloneDeep)(e)).snapshotData;return t.map((t=>{var r;const n=((e,t)=>{for(var r in t||(t={}))Ua.call(t,r)&&Ha(e,r,t[r]);if($a)for(var r of $a(t))qa.call(t,r)&&Ha(e,r,t[r]);return e})({},t);switch(n.source=e,n.color=u.config.theme2.visualization.getColorByName(e.iconColor),n.type=e.name,n.isRegion=Boolean(n.timeEnd&&n.time!==n.timeEnd),null==(r=n.newState)?void 0:r.toLowerCase()){case"pending":n.color="yellow";break;case"alerting":n.color="red";break;case"ok":case"normal":n.color="green";break;case"no_data":case"nodata":n.color="gray"}return n}))}function Ga(e){return"panel-alert"===e.eventType}var Qa=Object.defineProperty,Ka=Object.defineProperties,Xa=Object.getOwnPropertyDescriptors,Ja=Object.getOwnPropertySymbols,Ya=Object.prototype.hasOwnProperty,Za=Object.prototype.propertyIsEnumerable,eo=(e,t,r)=>t in e?Qa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,to=(e,t)=>{for(var r in t||(t={}))Ya.call(t,r)&&eo(e,r,t[r]);if(Ja)for(var r of Ja(t))Za.call(t,r)&&eo(e,r,t[r]);return e},ro=(e,t)=>Ka(e,Xa(t));(class extends Xi{constructor(e){super(to({isEnabled:!0},e),["query"]),this._scopedVars={__sceneObject:{value:this,text:"__sceneObject"}}}onEnable(){const e=Tt.getTimeRange(this);this._timeRangeSub=e.subscribeToState((()=>{this.runWithTimeRange(e)}))}onDisable(){var e;null==(e=this._timeRangeSub)||e.unsubscribe()}runLayer(){Rt();const e=Tt.getTimeRange(this);this.runWithTimeRange(e)}async runWithTimeRange(e){const{query:t}=this.state;if(this.querySub&&this.querySub.unsubscribe(),this._variableDependency.hasDependencyInLoadingState())Rt();else try{let r=za(await this.resolveDataSource(t),e,t,this).pipe(tr({type:"annotations",origin:this,cancel:()=>this.cancelQuery()}),(0,k.map)((e=>this.processEvents(t,e))));this.querySub=r.subscribe((e=>{this.publishResults(e)}))}catch(e){this.publishResults(ro(to({},Ee),{state:be.Error,errors:[{message:qi(e)}]})),console.error("AnnotationsDataLayer error",e)}}async resolveDataSource(e){return await At(e.datasource||void 0,this._scopedVars)}processEvents(e,t){let r=Wa(e,t.events||[]);r=function(e){let t=[];const r=(0,pe.partition)(e,"id"),n=(0,pe.groupBy)(r[0],"id");return t=(0,pe.map)(n,(e=>e.length>1&&!(0,pe.every)(e,Ga)?(0,pe.find)(e,(e=>"panel-alert"!==e.eventType)):(0,pe.head)(e))),t=(0,pe.concat)(t,r[1]),t}(r);const n=ro(to({},Ee),{state:t.state}),i=(0,l.arrayToDataFrame)(r);return i.meta=ro(to({},i.meta),{dataTopic:l.DataTopic.Annotations}),n.series=[i],n}}).Component=function({model:e}){const{isHidden:t}=e.useState();if(t)return null;return o().createElement(Ji,{layer:e})};Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;var no=Object.defineProperty,io=Object.defineProperties,ao=Object.getOwnPropertyDescriptors,oo=Object.getOwnPropertySymbols,so=Object.prototype.hasOwnProperty,lo=Object.prototype.propertyIsEnumerable,uo=(e,t,r)=>t in e?no(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;class co extends ee{constructor(){super(...arguments),this.isDataLayer=!0,this._results=new k.ReplaySubject(1),this._dataLayersMerger=new pn}subscribeToAllLayers(e){e.length>0?this.querySub=this._dataLayersMerger.getMergedStream(e).subscribe(this._onLayerUpdateReceived.bind(this)):(this._results.next({origin:this,data:Ee}),this.setStateHelper({data:Ee}))}_onLayerUpdateReceived(e){var t;let r=[];for(const n of e)(null==(t=n.data)?void 0:t.series)&&(r=r.concat(n.data.series));const n=(i=((e,t)=>{for(var r in t||(t={}))so.call(t,r)&&uo(e,r,t[r]);if(oo)for(var r of oo(t))lo.call(t,r)&&uo(e,r,t[r]);return e})({},Ee),io(i,ao({series:r})));var i;this._results.next({origin:this,data:n}),this.setStateHelper({data:n})}getResultsStream(){return this._results}cancelQuery(){var e;null==(e=this.querySub)||e.unsubscribe()}setStateHelper(e){nr(this,e)}}class ho extends co{constructor(e){var t,r;super({name:null!=(t=e.name)?t:"Data layers",layers:null!=(r=e.layers)?r:[]}),this.addActivationHandler((()=>this._onActivate()))}_onActivate(){return this._subs.add(this.subscribeToState(((e,t)=>{var r;e.layers!==t.layers&&(null==(r=this.querySub)||r.unsubscribe(),this.subscribeToAllLayers(e.layers))}))),this.subscribeToAllLayers(this.state.layers),()=>{var e;null==(e=this.querySub)||e.unsubscribe()}}}ho.Component=({model:e})=>{const{layers:t}=e.useState();return o().createElement(o().Fragment,null,t.map((e=>o().createElement(e.Component,{model:e,key:e.state.key}))))};var po=Object.defineProperty,fo=Object.defineProperties,mo=Object.getOwnPropertyDescriptors,go=Object.getOwnPropertySymbols,vo=Object.prototype.hasOwnProperty,yo=Object.prototype.propertyIsEnumerable,bo=(e,t,r)=>t in e?po(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,wo=(e,t)=>{for(var r in t||(t={}))vo.call(t,r)&&bo(e,r,t[r]);if(go)for(var r of go(t))yo.call(t,r)&&bo(e,r,t[r]);return e},So=(e,t)=>fo(e,mo(t));class xo extends ee{constructor(e){super(e),this._results=new k.ReplaySubject(1),this._variableDependency=new Dt(this,{statePaths:["transformations"],onReferencedVariableValueChanged:()=>this.reprocessTransformations()}),this.addActivationHandler((()=>this.activationHandler()))}activationHandler(){const e=this.getSourceData();return this._subs.add(e.subscribeToState((e=>this.transform(e.data)))),e.state.data&&this.transform(e.state.data),()=>{this._transformSub&&this._transformSub.unsubscribe()}}getSourceData(){if(this.state.$data){if(this.state.$data instanceof ho)throw new Error("SceneDataLayerSet can not be used as data provider for SceneDataTransformer.");return this.state.$data}if(!this.parent||!this.parent.parent)throw new Error("SceneDataTransformer must either have $data set on it or have a parent.parent with $data");return Tt.getData(this.parent.parent)}setContainerWidth(e){this.state.$data&&this.state.$data.setContainerWidth&&this.state.$data.setContainerWidth(e)}isDataReadyToDisplay(){const e=this.getSourceData();return!e.isDataReadyToDisplay||e.isDataReadyToDisplay()}reprocessTransformations(){this.transform(this.getSourceData().state.data,!0)}cancelQuery(){var e,t;null==(t=(e=this.getSourceData()).cancelQuery)||t.call(e)}getResultsStream(){return this._results}clone(e){const t=super.clone(e);return this._prevDataFromSource&&(t._prevDataFromSource=this._prevDataFromSource),t}haveAlreadyTransformedData(e){if(!this._prevDataFromSource)return!1;if(e===this._prevDataFromSource)return!0;const{series:t,annotations:r}=this._prevDataFromSource;return e.series===t&&e.annotations===r&&(this.state.data&&e.state!==this.state.data.state&&this.setState({data:So(wo({},this.state.data),{state:e.state})}),!0)}transform(e,t=!1){var r;if(0===this.state.transformations.length||!e)return this._prevDataFromSource=e,this.setState({data:e}),void(e&&this._results.next({origin:this,data:e}));if(!t&&this.haveAlreadyTransformedData(e))return;const n=this.state.transformations.filter((e=>!("options"in e)&&!("topic"in e)||(null==e.topic||e.topic===l.DataTopic.Series))).map((e=>"operator"in e?e.operator:e)),i=this.state.transformations.filter((e=>("options"in e||"topic"in e)&&e.topic===l.DataTopic.Annotations)).map((e=>"operator"in e?e.operator:e));this._transformSub&&this._transformSub.unsubscribe();const a={interpolate:t=>{var r;return Tt.interpolate(this,t,null==(r=e.request)?void 0:r.scopedVars)}};let o=[(0,l.transformDataFrame)(n,e.series,a)];e.annotations&&e.annotations.length>0&&i.length>0&&o.push((0,l.transformDataFrame)(i,null!=(r=e.annotations)?r:[])),this._transformSub=(0,k.forkJoin)(o).pipe((0,k.map)((t=>{const r=t[0],n=t[1];return So(wo({},e),{series:r,annotations:null!=n?n:e.annotations})})),(0,k.catchError)((t=>{var r;console.error("Error transforming data: ",t);const n=(null==(r=this.getSourceData().state.data)?void 0:r.errors)||[],i=(0,u.toDataQueryError)(t);i.message=`Error transforming data: ${i.message}`;const a=So(wo({},e),{state:l.LoadingState.Error,errors:[...n,i]});return(0,k.of)(a)}))).subscribe((t=>{this.setState({data:t}),this._results.next({origin:this,data:t}),this._prevDataFromSource=e}))}}function Oo({variable:e,layout:t,showAlways:r,hideLabel:n}){return te(e,{shouldActivateOrKeepAlive:!0}).hide!==l.VariableHide.hideVariable||r?"vertical"===t?o().createElement("div",{className:ko,"data-testid":ur.pages.Dashboard.SubMenu.submenuItem},o().createElement(_o,{variable:e,layout:t,hideLabel:n}),o().createElement(e.Component,{model:e})):o().createElement("div",{className:Eo,"data-testid":ur.pages.Dashboard.SubMenu.submenuItem},o().createElement(_o,{variable:e,hideLabel:n}),o().createElement(e.Component,{model:e})):null}function _o({variable:e,layout:t,hideLabel:r}){var n,i;const{state:a}=e;if(e.state.hide===l.VariableHide.hideLabel||r)return null;const s=`var-${a.key}`,u=null!=(n=a.label)?n:a.name;return o().createElement(zr,{htmlFor:s,isLoading:a.loading,onCancel:()=>{var t;return null==(t=e.onCancel)?void 0:t.call(e)},label:u,error:a.error,layout:t,description:null!=(i=a.description)?i:void 0})}(class extends ee{}).Component=function({model:e}){const t=Tt.getVariables(e).useState();return o().createElement(o().Fragment,null,t.variables.map((t=>o().createElement(Oo,{key:t.state.key,variable:t,layout:e.state.layout}))))};const Eo=(0,cr.css)({display:"flex"}),ko=(0,cr.css)({display:"flex",flexDirection:"column"});(class extends ee{}).Component=function({model:e}){const t=Tt.lookupVariable(e.state.variableName,e);if(!t)return null;return o().createElement(Oo,{key:t.state.key,variable:t,layout:e.state.layout,showAlways:!0})};class Co extends ee{constructor(e){super(e),this._variablesThatHaveChanged=new Set,this._variablesToUpdate=new Set,this._updating=new Map,this._variableValueRecorder=new Pt,this._variableDependency=new Ao(this._handleParentVariableUpdatesCompleted.bind(this)),this._onActivate=()=>{const e=Tt.getTimeRange(this);this._subs.add(this.subscribeToEvent(ze,(e=>this._handleVariableValueChanged(e.payload)))),this._subs.add(e.subscribeToState((()=>{this._refreshTimeRangeBasedVariables()}))),this._subs.add(this.subscribeToState(this._onStateChanged)),this._checkForVariablesThatChangedWhileInactive();for(const e of this.state.variables)this._variableNeedsUpdate(e)&&this._variablesToUpdate.add(e);return this._updateNextBatch(),this._onDeactivate},this._onDeactivate=()=>{var e;for(const t of this._updating.values())null==(e=t.subscription)||e.unsubscribe();for(const e of this.state.variables)this._variablesToUpdate.has(e)||this._updating.has(e)||this._variableValueRecorder.recordCurrentValue(e);this._variablesToUpdate.clear(),this._updating.clear()},this._onStateChanged=(e,t)=>{const r=this._variablesToUpdate.size;for(const r of t.variables)if(!e.variables.includes(r)){const e=this._updating.get(r);(null==e?void 0:e.subscription)&&e.subscription.unsubscribe(),this._updating.delete(r),this._variablesToUpdate.delete(r)}for(const r of e.variables)t.variables.includes(r)||this._variableNeedsUpdate(r)&&this._variablesToUpdate.add(r);0===r&&this._variablesToUpdate.size>0&&this._updateNextBatch()},this.addActivationHandler(this._onActivate)}getByName(e){return this.state.variables.find((t=>t.state.name===e))}_refreshTimeRangeBasedVariables(){for(const e of this.state.variables)"refresh"in e.state&&e.state.refresh===l.VariableRefresh.onTimeRangeChanged&&this._variablesToUpdate.add(e);this._updateNextBatch()}_checkForVariablesThatChangedWhileInactive(){if(this._variableValueRecorder.hasValues())for(const e of this.state.variables)this._variableValueRecorder.hasValueChanged(e)&&(To(e,"Changed while in-active"),this._addDependentVariablesToUpdateQueue(e))}_variableNeedsUpdate(e){return!e.isLazy&&(!!e.validateAndUpdate&&(!this._variableValueRecorder.hasRecordedValue(e)||(To(e,"Skipping updateAndValidate current value valid"),!1)))}_updateNextBatch(){for(const e of this._variablesToUpdate){if(!e.validateAndUpdate)throw new Error("Variable added to variablesToUpdate but does not have validateAndUpdate");if(this._updating.has(e))continue;if(Tt.hasVariableDependencyInLoadingState(e))continue;const t={variable:e};this._updating.set(e,t),To(e,"updateAndValidate started"),t.subscription=e.validateAndUpdate().subscribe({next:()=>this._validateAndUpdateCompleted(e),complete:()=>this._validateAndUpdateCompleted(e),error:t=>this._handleVariableError(e,t)})}}_validateAndUpdateCompleted(e){var t;if(!this._updating.has(e))return;const r=this._updating.get(e);null==(t=null==r?void 0:r.subscription)||t.unsubscribe(),this._updating.delete(e),this._variablesToUpdate.delete(e),To(e,"updateAndValidate completed"),this._notifyDependentSceneObjects(e),this._updateNextBatch()}cancel(e){var t;const r=this._updating.get(e);null==(t=null==r?void 0:r.subscription)||t.unsubscribe(),this._updating.delete(e),this._variablesToUpdate.delete(e)}_handleVariableError(e,t){var r;const n=this._updating.get(e);null==(r=null==n?void 0:n.subscription)||r.unsubscribe(),this._updating.delete(e),this._variablesToUpdate.delete(e),e.setState({loading:!1,error:t.message}),console.error("SceneVariableSet updateAndValidate error",t),To(e,"updateAndValidate error",t)}_handleVariableValueChanged(e){this._variablesThatHaveChanged.add(e),this._addDependentVariablesToUpdateQueue(e),this._updating.has(e)||(this._updateNextBatch(),this._notifyDependentSceneObjects(e))}_handleParentVariableUpdatesCompleted(e,t){t&&this._addDependentVariablesToUpdateQueue(e),this._variablesToUpdate.size>0&&0===this._updating.size&&this._updateNextBatch()}_addDependentVariablesToUpdateQueue(e){for(const t of this.state.variables)t.variableDependency&&t.variableDependency.hasDependencyOn(e.state.name)&&(To(t,"Added to update queue, dependant variable value changed"),this._updating.has(t)&&t.onCancel&&t.onCancel(),this._variablesToUpdate.add(t))}_notifyDependentSceneObjects(e){this.parent&&(this._traverseSceneAndNotify(this.parent,e,this._variablesThatHaveChanged.has(e)),this._variablesThatHaveChanged.delete(e))}_traverseSceneAndNotify(e,t,r){if(this!==e&&e.isActive){if(e.state.$variables&&e.state.$variables!==this){if(e.state.$variables.getByName(t.state.name))return}e.variableDependency&&e.variableDependency.variableUpdateCompleted(t,r),e.forEachChild((e=>this._traverseSceneAndNotify(e,t,r)))}}isVariableLoadingOrWaitingToUpdate(e){return!(!e.isAncestorLoading||!e.isAncestorLoading())||(!(!this._variablesToUpdate.has(e)&&!this._updating.has(e))||Tt.hasVariableDependencyInLoadingState(e))}}function To(e,t,r){Rt(0,e.state.name)}class Ao{constructor(e){this._variableUpdatesCompleted=e,this._emptySet=new Set}getNames(){return this._emptySet}hasDependencyOn(e){return!1}variableUpdateCompleted(e,t){this._variableUpdatesCompleted(e,t)}}Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;var Ro=Object.defineProperty,Do=Object.getOwnPropertySymbols,Po=Object.prototype.hasOwnProperty,jo=Object.prototype.propertyIsEnumerable,Io=(e,t,r)=>t in e?Ro(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;class Lo extends ir{constructor(e){super(((e,t)=>{for(var r in t||(t={}))Po.call(t,r)&&Io(e,r,t[r]);if(Do)for(var r of Do(t))jo.call(t,r)&&Io(e,r,t[r]);return e})({type:"custom",query:"",value:"",text:"",options:[],name:""},e)),this._variableDependency=new Dt(this,{statePaths:["query"]})}getValueOptions(e){var t;const r=(null!=(t=Tt.interpolate(this,this.state.query).match(/(?:\\,|[^,])+/g))?t:[]).map((e=>{var t;e=e.replace(/\\,/g,",");const r=null!=(t=/^(.+)\s:\s(.+)$/g.exec(e))?t:[];if(3===r.length){const[,e,t]=r;return{label:e.trim(),value:t.trim()}}return{label:e.trim(),value:e.trim()}}));return(0,k.of)(r)}}Lo.Component=({model:e})=>Er(e);var Mo=Object.defineProperty,No=Object.getOwnPropertySymbols,Fo=Object.prototype.hasOwnProperty,Vo=Object.prototype.propertyIsEnumerable,zo=(e,t,r)=>t in e?Mo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;class Bo extends ir{constructor(e){super(((e,t)=>{for(var r in t||(t={}))Fo.call(t,r)&&zo(e,r,t[r]);if(No)for(var r of No(t))Vo.call(t,r)&&zo(e,r,t[r]);return e})({type:"datasource",value:"",text:"",options:[],name:"",regex:"",pluginId:""},e)),this._variableDependency=new Dt(this,{statePaths:["regex"]})}getValueOptions(e){if(!this.state.pluginId)return(0,k.of)([]);const t=(0,u.getDataSourceSrv)().getList({metrics:!0,variables:!1,pluginId:this.state.pluginId});let r;if(this.state.regex){const e=Tt.interpolate(this,this.state.regex,void 0,"regex");r=(0,l.stringToJsRegex)(e)}const n=[];for(let e=0;eEr(e);const qo=e=>Boolean(e.metricFindQuery)&&!Boolean(e.variables),Ho=e=>{if(!e.variables)return!1;if(e.variables.getType()!==l.VariableSupportType.Standard)return!1;const t=e.variables;return"toDataQuery"in t&&Boolean(t.toDataQuery)},Wo=e=>{if(!e.variables)return!1;if(e.variables.getType()!==l.VariableSupportType.Custom)return!1;const t=e.variables;return"query"in t&&"editor"in t&&Boolean(t.query)&&Boolean(t.editor)};var Go=Object.defineProperty,Qo=Object.defineProperties,Ko=Object.getOwnPropertyDescriptors,Xo=Object.getOwnPropertySymbols,Jo=Object.prototype.hasOwnProperty,Yo=Object.prototype.propertyIsEnumerable,Zo=(e,t,r)=>t in e?Go(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,es=(e,t)=>{for(var r in t||(t={}))Jo.call(t,r)&&Zo(e,r,t[r]);if(Xo)for(var r of Xo(t))Yo.call(t,r)&&Zo(e,r,t[r]);return e},ts=(e,t)=>Qo(e,Ko(t));class rs{constructor(e,t=(0,u.getRunRequest)()){this.datasource=e,this._runRequest=t}getTarget(e){if(Ho(this.datasource))return this.datasource.variables.toDataQuery(function(e){var t;const r=null!=(t=e.state.query)?t:"";if("string"==typeof r)return{query:r,refId:`variable-${e.state.name}`};if(null==r.refId)return ts(es({},r),{refId:`variable-${e.state.name}`});return e.state.query}(e));throw new Error("Couldn't create a target with supplied arguments.")}runRequest(e,t){return Ho(this.datasource)?this.datasource.variables.query?this._runRequest(this.datasource,t,this.datasource.variables.query.bind(this.datasource.variables)):this._runRequest(this.datasource,t):as()}}class ns{constructor(e){this.datasource=e}getTarget(e){if(qo(this.datasource))return e.state.query;throw new Error("Couldn't create a target with supplied arguments.")}runRequest({variable:e,searchFilter:t},r){return qo(this.datasource)?(0,k.from)(this.datasource.metricFindQuery(e.state.query,ts(es({},r),{variable:{name:e.state.name,type:e.state.type},searchFilter:t}))).pipe((0,k.mergeMap)((e=>{if(!e||!e.length)return as();const t=e;return(0,k.of)({series:t,state:l.LoadingState.Done,timeRange:r.range})}))):as()}}class is{constructor(e,t=(0,u.getRunRequest)()){this.datasource=e,this._runRequest=t}getTarget(e){if(Wo(this.datasource))return e.state.query;throw new Error("Couldn't create a target with supplied arguments.")}runRequest(e,t){return Wo(this.datasource)?this.datasource.variables.query?this._runRequest(this.datasource,t,this.datasource.variables.query.bind(this.datasource.variables)):this._runRequest(this.datasource,t):as()}}function as(){return(0,k.of)({state:l.LoadingState.Done,series:[],timeRange:(0,l.getDefaultTimeRange)()})}let os=function(e){if(Ho(e))return new rs(e,(0,u.getRunRequest)());if(qo(e))return new ns(e);if(Wo(e))return new is(e);throw new Error(`Couldn't create a query runner for datasource ${e.type}`)};const ss=(e,t)=>{const r=[];let n=null;t.lastIndex=0;do{n=t.exec(e),n&&r.push(n)}while(t.global&&n&&""!==n[0]&&void 0!==n[0]);return r},ls=(e,t)=>{if(t===l.VariableSort.disabled)return e;const r=e=>{if(!e.text)return-1;const t=e.text.match(/.*?(\d+).*/);return!t||t.length<2?-1:parseInt(t[1],10)},n=e=>e.sort(((e,t)=>e.text?t.text?e.text.localeCompare(t.text,void 0,{numeric:!0}):1:-1));switch(t){case l.VariableSort.alphabeticalAsc:e=(0,pe.sortBy)(e,"label");break;case l.VariableSort.alphabeticalDesc:e=(0,pe.sortBy)(e,"label").reverse();break;case l.VariableSort.numericalAsc:e=(0,pe.sortBy)(e,r);break;case l.VariableSort.numericalDesc:e=(e=(0,pe.sortBy)(e,r)).reverse();break;case l.VariableSort.alphabeticalCaseInsensitiveAsc:e=(0,pe.sortBy)(e,(e=>(0,pe.toLower)(e.label)));break;case l.VariableSort.alphabeticalCaseInsensitiveDesc:e=(e=(0,pe.sortBy)(e,(e=>(0,pe.toLower)(e.label)))).reverse();break;case l.VariableSort.naturalAsc||7:e=n(e);break;case l.VariableSort.naturalDesc||8:e=(e=n(e)).reverse()}return e};function us(){return e=>e.pipe((0,k.map)((e=>{const t=e.series;if(!t||!t.length)return[];if(function(e){if(!e)return!1;if(!e.length)return!0;const t=e[0];if((0,l.isDataFrame)(t))return!1;for(const e in t){if(!t.hasOwnProperty(e))continue;if(null!==t[e]&&"string"!=typeof t[e]&&"number"!=typeof t[e])continue;const r=e.toLowerCase();if("text"===r||"value"===r)return!0}return!1}(t))return t;if(0===t[0].fields.length)return[];const r=(0,l.getProcessedDataFrames)(t),n=[];let i=-1,a=-1,o=-1,s=-1;for(const e of r)for(let r=0;rt in e?cs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;class ms extends ir{constructor(e){super(((e,t)=>{for(var r in t||(t={}))hs.call(t,r)&&fs(e,r,t[r]);if(ds)for(var r of ds(t))ps.call(t,r)&&fs(e,r,t[r]);return e})({type:"query",name:"",value:"",text:"",options:[],datasource:null,regex:"",query:{refId:"A"},refresh:l.VariableRefresh.onDashboardLoad,sort:l.VariableSort.disabled},e)),this._variableDependency=new Dt(this,{statePaths:["regex","query","datasource"]}),this.onSearchChange=e=>{An(this.state.query).indexOf(it)>-1&&this._updateOptionsBasedOnSearchFilter(e)},this._updateOptionsBasedOnSearchFilter=(0,pe.debounce)((async e=>{const t=await(0,k.lastValueFrom)(this.getValueOptions({searchFilter:e}));this.setState({options:t,loading:!1})}),400)}getValueOptions(e){return this.state.query?(this.setState({loading:!0,error:null}),(0,k.from)(At(this.state.datasource,{__sceneObject:{text:"__sceneObject",value:this}})).pipe((0,k.mergeMap)((t=>{const r=os(t),n=r.getTarget(this),i=this.getRequest(n,e.searchFilter);return r.runRequest({variable:this,searchFilter:e.searchFilter},i).pipe(tr({type:"variable",request:i,origin:this}),(0,k.filter)((e=>e.state===l.LoadingState.Done||e.state===l.LoadingState.Error)),(0,k.take)(1),(0,k.mergeMap)((e=>e.state===l.LoadingState.Error?(0,k.throwError)((()=>e.error)):(0,k.of)(e))),us(),(0,k.mergeMap)((e=>{let t="";return this.state.regex&&(t=Tt.interpolate(this,this.state.regex,void 0,"regex")),(0,k.of)(((e,t,r)=>{var n,i,a,o,s,u;let c,d=[];e&&(c=(0,l.stringToJsRegex)(e));for(let e=0;ee.groups&&e.groups.value)),r=e.find((e=>e.groups&&e.groups.text)),p=e.find((e=>e.length>1)),f=e.length>1&&p;if(t||r)h=null!=(a=null==(n=null==t?void 0:t.groups)?void 0:n.value)?a:null==(i=null==r?void 0:r.groups)?void 0:i.text,l=null!=(u=null==(o=null==r?void 0:r.groups)?void 0:o.text)?u:null==(s=null==t?void 0:t.groups)?void 0:s.value;else{if(f){for(let t=0;te.cancelled?(0,k.of)([]):(0,k.throwError)((()=>e)))))})))):(0,k.of)([])}getRequest(e,t){const r={__sceneObject:{text:"__sceneObject",value:this}};t&&(r.__searchFilter={value:t,text:t});const n=Tt.getTimeRange(this).state.value;return{app:l.CoreApp.Dashboard,requestId:j(),timezone:"",range:n,interval:"",intervalMs:0,targets:[e],scopedVars:r,startTime:Date.now()}}}function gs(e,t){const r=["A","B","C","D","E","F","G","H"],n=[];if(t>5)return[];for(const i of r){const r=`${e}${i}`;n.push({name:r,children:gs(r,t+1)})}return n}function vs(e,t,r){if(r>=t.length)return e;if("*"===t[r])return e;const n=t[r];let i=[],a=[n];n.startsWith("{")&&(a=n.replace(/\{|\}/g,"").split(","));for(const n of e)for(const e of a)if(-1!==e.indexOf("*")){const a=e.replace("*","");new RegExp(`^${a}.*`,"gi").test(n.name)&&(i=i.concat(vs([n],t,r+1)))}else n.name===e&&(i=i.concat(vs(n.children,t,r+1)));return i}function ys(e){if(0===e.indexOf("value"))return[{name:e,children:[]}];return vs(gs("",0),e.split("."),0)}ms.Component=({model:e})=>Er(e);var bs=Object.defineProperty,ws=Object.getOwnPropertySymbols,Ss=Object.prototype.hasOwnProperty,xs=Object.prototype.propertyIsEnumerable,Os=(e,t,r)=>t in e?bs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;function _s({model:e}){const{value:t,key:r,loading:n}=e.useState(),i=(0,a.useCallback)((t=>{e.setValue(t.currentTarget.value)}),[e]),s=(0,a.useCallback)((t=>{"Enter"===t.key&&e.setValue(t.currentTarget.value)}),[e]);return o().createElement(sr.AutoSizeInput,{id:r,placeholder:"Enter value",minWidth:15,defaultValue:t,loading:n,onBlur:i,onKeyDown:s})}(class extends ir{constructor(e,t=!1){super(((e,t)=>{for(var r in t||(t={}))Ss.call(t,r)&&Os(e,r,t[r]);if(ws)for(var r of ws(t))xs.call(t,r)&&Os(e,r,t[r]);return e})({type:"custom",name:"Test",value:"Value",text:"Text",query:"Query",options:[],refresh:l.VariableRefresh.onDashboardLoad},e)),this.completeUpdate=new k.Subject,this.isGettingValues=!0,this.getValueOptionsCount=0,this.isLazy=!1,this._variableDependency=new Dt(this,{statePaths:["query"]}),this.isLazy=t}getValueOptions(e){const{delayMs:t}=this.state;this.getValueOptionsCount+=1;const r=Tt.getQueryController(this);return new k.Observable((e=>{const n={type:"variable",origin:this,cancel:()=>e.complete()};if(r&&r.queryStarted(n),this.setState({loading:!0}),this.state.throwError)throw new Error(this.state.throwError);const i=Tt.interpolate(this,this.state.query),a=this.getOptions(i),o=this.completeUpdate.subscribe({next:()=>{this.setState({issuedQuery:i,options:a,loading:!1}),e.next(a),e.complete()}});let s;return t?s=window.setTimeout((()=>this.signalUpdateCompleted()),t):0===t&&this.signalUpdateCompleted(),this.isGettingValues=!0,()=>{o.unsubscribe(),window.clearTimeout(s),this.isGettingValues=!1,this.state.loading&&this.setState({loading:!1}),r&&r.queryCompleted(n)}}))}cancel(){const e=ce(this,(e=>e instanceof Co?e:void 0));null==e||e.cancel(this)}getOptions(e){return this.state.optionsToReturn?this.state.optionsToReturn:ys(e).map((e=>({label:e.name,value:e.name})))}signalUpdateCompleted(){this.completeUpdate.next(1)}}).Component=({model:e})=>Er(e);var Es=Object.defineProperty,ks=Object.getOwnPropertySymbols,Cs=Object.prototype.hasOwnProperty,Ts=Object.prototype.propertyIsEnumerable,As=(e,t,r)=>t in e?Es(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;(class extends ee{constructor(e){super(((e,t)=>{for(var r in t||(t={}))Cs.call(t,r)&&As(e,r,t[r]);if(ks)for(var r of ks(t))Ts.call(t,r)&&As(e,r,t[r]);return e})({type:"textbox",value:"",name:""},e)),this._urlSync=new ke(this,{keys:()=>[this.getKey()]})}getValue(){return this.state.value}setValue(e){e!==this.state.value&&(this.setState({value:e}),this.publishEvent(new ze(this),!0))}getKey(){return`var-${this.state.name}`}getUrlState(){return{[this.getKey()]:this.state.value}}updateFromUrl(e){const t={},r=e[this.getKey()];"string"==typeof r&&(t.value=r),this.setState(t)}}).Component=({model:e})=>o().createElement(_s,{model:e});Object.defineProperty,Object.defineProperties,Object.getOwnPropertyDescriptors,Object.getOwnPropertySymbols,Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;var Rs=Object.defineProperty,Ds=Object.getOwnPropertySymbols,Ps=Object.prototype.hasOwnProperty,js=Object.prototype.propertyIsEnumerable,Is=(e,t,r)=>t in e?Rs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;(class extends ee{constructor(e){super(((e,t)=>{for(var r in t||(t={}))Ps.call(t,r)&&Is(e,r,t[r]);if(Ds)for(var r of Ds(t))js.call(t,r)&&Is(e,r,t[r]);return e})({type:"interval",value:"",intervals:["1m","10m","30m","1h","6h","12h","1d","7d","14d","30d"],name:"",autoStepCount:30,autoMinInterval:"10s",autoEnabled:!1,refresh:Fn.onTimeRangeChanged},e)),this._onChange=e=>{this.setState({value:e.value}),this.publishEvent(new ze(this),!0)},this._urlSync=new ke(this,{keys:()=>[this.getKey()]})}getKey(){return`var-${this.state.name}`}getUrlState(){return{[this.getKey()]:this.state.value}}updateFromUrl(e){const t={},r=e[this.getKey()];"string"==typeof r&&(r.startsWith("$__auto_interval_")?t.value=rt:t.value=r),this.setState(t)}getOptionsForSelect(){const{value:e,intervals:t,autoEnabled:r}=this.state;let n=t.map((e=>({value:e,label:e})));return r&&(n=[{value:rt,label:"Auto"},...n]),e&&!n.some((t=>t.value===e))&&n.push({value:e,label:e}),n}getValue(){const{value:e,autoStepCount:t,autoMinInterval:r}=this.state;return e===rt?this.getAutoRefreshInteval(t,r):e}getAutoRefreshInteval(e,t){const r=Tt.getTimeRange(this).state.value;return l.rangeUtil.calculateInterval(r,e,t).interval}validateAndUpdate(){const{value:e,intervals:t}=this.state;let r=!1;if(e===rt)r=!0;else if(!e&&t.length>0){const e=t[0];this.setState({value:e}),r=!0}return r&&this.publishEvent(new ze(this),!0),(0,k.of)({})}}).Component=({model:e})=>{const{key:t,value:r}=e.useState();return o().createElement(sr.Select,{id:t,placeholder:"Select value",width:"auto",value:r,tabSelectsValue:!1,options:e.getOptionsForSelect(),onChange:e._onChange})};class Ls{constructor(){this._urlKeyMapper=new fe,this._stateSub=null,this._locationSub=null,this._ignoreNextLocationUpdate=!1,this._onLocationUpdate=e=>{if(this._ignoreNextLocationUpdate)return void(this._ignoreNextLocationUpdate=!1);if(this._lastPath!==e.pathname)return;const t=new URLSearchParams(e.search);this._urlKeyMapper.rebuildIndex(this._sceneRoot),ge(this._sceneRoot,t,this._urlKeyMapper),this._lastPath=e.pathname},this._onStateChanged=({payload:e})=>{const t=e.changedObject;if(t.urlSync){const e=t.urlSync.getUrlState(),r=u.locationService.getSearch(),n={};this._urlKeyMapper.rebuildIndex(this._sceneRoot);for(const[i,a]of Object.entries(e)){const e=this._urlKeyMapper.getUniqueKey(i,t);ve(r.getAll(e),a)||(n[e]=a)}Object.keys(n).length>0&&(this._ignoreNextLocationUpdate=!0,u.locationService.partial(n,!0))}}}initSync(e){this._locationSub||(Rt(),this._locationSub=u.locationService.getHistory().listen(this._onLocationUpdate)),this._stateSub&&(Rt(0,0,this._sceneRoot.state.key),this._stateSub.unsubscribe()),this._sceneRoot=e,this._lastPath=u.locationService.getLocation().pathname,this._stateSub=e.subscribeToEvent(U,this._onStateChanged),this.syncFrom(this._sceneRoot)}cleanUp(e){this._sceneRoot===e&&(Rt(),this._locationSub&&(this._locationSub(),Rt(),this._locationSub=null),this._stateSub&&(this._stateSub.unsubscribe(),this._stateSub=null,Rt(0,0,(this._sceneRoot.state.key,e.state.key))))}syncFrom(e){const t=u.locationService.getSearch();this._urlKeyMapper.rebuildIndex(this._sceneRoot),ge(e,t,this._urlKeyMapper)}getUrlState(e){return me(e)}}let Ms;function Ns(){return Ms||(Ms=new Ls),Ms}class Fs extends ee{constructor(e){super(e),this.addActivationHandler((()=>{const e=function(e){const t=window.__grafanaSceneContext;return Rt(),window.__grafanaSceneContext=e,()=>{window.__grafanaSceneContext===e&&(Rt(),window.__grafanaSceneContext=t)}}(this);return()=>{e(),Ns().cleanUp(this)}}))}initUrlSync(){Ns().initSync(this)}}Fs.Component=function({model:e}){const{body:t,controls:r}=e.useState(),n=(0,sr.useStyles2)(Vs);return o().createElement("div",{className:n.container},r&&o().createElement("div",{className:n.controls},r.map((e=>o().createElement(e.Component,{key:e.state.key,model:e})))),o().createElement("div",{className:n.body},o().createElement(t.Component,{model:t})))};const Vs=e=>({container:(0,cr.css)({flexGrow:1,display:"flex",gap:e.spacing(2),minHeight:"100%",flexDirection:"column"}),body:(0,cr.css)({flexGrow:1,display:"flex",gap:e.spacing(1)}),controls:(0,cr.css)({display:"flex",gap:e.spacing(2),alignItems:"flex-end",flexWrap:"wrap"})});class zs extends ee{addItem(e){this.setState({items:this.state.items?[...this.state.items,e]:[e]})}setItems(e){this.setState({items:e})}}zs.Component=function({model:e}){const{items:t=[]}=e.useState(),r=o().useRef(null);(0,a.useEffect)((()=>{r.current&&r.current.focus()}),[]);const n=e=>e.map((e=>{switch(e.type){case"divider":return o().createElement(sr.Menu.Divider,{key:e.text});case"group":return o().createElement(sr.Menu.Group,{key:e.text,label:e.text},e.subMenu?n(e.subMenu):void 0);default:return o().createElement(sr.Menu.Item,{key:e.text,label:e.text,icon:e.iconClassName,childItems:e.subMenu?n(e.subMenu):void 0,url:e.href,onClick:e.onClick,shortcut:e.shortcut,testId:ur.components.Panels.Panel.menuItems(e.text)})}}));return o().createElement(sr.Menu,{ref:r},n(t))};function Bs(e){return e instanceof eu}(class extends ee{}).Component=function({model:e}){const{body:t}=e.useState(),r=e.parent;if(r&&(n=r,!(n instanceof ql))&&!Bs(r))throw new Error("SceneGridItem must be a child of SceneGridLayout or SceneGridRow");var n;if(!t)return null;return o().createElement(t.Component,{model:t})};var $s=r(2548),Us=r.n($s),qs=function(){function e(e,t){for(var r=0;r div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',a=r.head||r.getElementsByTagName("head")[0],o=r.createElement("style");o.id="detectElementResize",o.type="text/css",null!=e&&o.setAttribute("nonce",e),o.styleSheet?o.styleSheet.cssText=n:o.appendChild(r.createTextNode(n)),a.appendChild(o)}}(c),a.__resizeLast__={},a.__resizeListeners__=[],(a.__resizeTriggers__=c.createElement("div")).className="resize-triggers";var h=c.createElement("div");h.className="expand-trigger",h.appendChild(c.createElement("div"));var p=c.createElement("div");p.className="contract-trigger",a.__resizeTriggers__.appendChild(h),a.__resizeTriggers__.appendChild(p),a.appendChild(a.__resizeTriggers__),o(a),a.addEventListener("scroll",s,!0),n&&(a.__resizeTriggers__.__animationListener__=function(e){e.animationName===r&&o(a)},a.__resizeTriggers__.addEventListener(n,a.__resizeTriggers__.__animationListener__))}a.__resizeListeners__.push(u)}},removeResizeListener:function(e,t){if(l)e.detachEvent("onresize",t);else if(e.__resizeListeners__.splice(e.__resizeListeners__.indexOf(t),1),!e.__resizeListeners__.length){e.removeEventListener("scroll",s,!0),e.__resizeTriggers__.__animationListener__&&(e.__resizeTriggers__.removeEventListener(n,e.__resizeTriggers__.__animationListener__),e.__resizeTriggers__.__animationListener__=null);try{e.__resizeTriggers__=!e.removeChild(e.__resizeTriggers__)}catch(e){}}}}}null==Zs||null==el?(Ks=Js,Xs=function(e){return Ys(e,20)}):(Ks=function(e){var t=Gs(e,2),r=t[0],n=t[1];Zs(r),Js(n)},Xs=function(e){var t=el((function(){Js(r),e()})),r=Ys((function(){Zs(t),e()}),20);return[t,r]});var rl=function(e){function t(){var e,r,n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var i=arguments.length,a=Array(i),o=0;ot in e?al(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;function cl(){const e=(0,a.useRef)(void 0);return null!=e.current||(e.current=(0,pe.uniqueId)()),e.current}const dl=o().forwardRef(((e,t)=>{var r=e,{children:n,onLoad:i,onChange:s}=r,l=((e,t)=>{var r={};for(var n in e)sl.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&ol)for(var n of ol(e))t.indexOf(n)<0&&ll.call(e,n)&&(r[n]=e[n]);return r})(r,["children","onLoad","onChange"]);const u=cl(),[c,d]=(0,a.useState)(!1),[h,p]=(0,a.useState)(!1),f=(0,a.useRef)(null);return(0,a.useImperativeHandle)(t,(()=>f.current)),il((()=>{dl.addCallback(u,(e=>{!c&&e.isIntersecting&&(d(!0),null==i||i()),p(e.isIntersecting),null==s||s(e.isIntersecting)}));const e=f.current;return e&&dl.observer.observe(e),()=>{delete dl.callbacks[u],e&&dl.observer.unobserve(e),0===Object.keys(dl.callbacks).length&&dl.observer.disconnect()}})),o().createElement("div",((e,t)=>{for(var r in t||(t={}))sl.call(t,r)&&ul(e,r,t[r]);if(ol)for(var r of ol(t))ll.call(t,r)&&ul(e,r,t[r]);return e})({id:u,ref:f},l),c&&("function"==typeof n?n({isInView:h}):n))}));dl.displayName="LazyLoader",dl.callbacks={},dl.addCallback=(e,t)=>dl.callbacks[e]=t,dl.observer=new IntersectionObserver((e=>{for(const t of e)dl.callbacks[t.target.id](t)}),{rootMargin:"100px"});var hl=Object.defineProperty,pl=Object.defineProperties,fl=Object.getOwnPropertyDescriptors,ml=Object.getOwnPropertySymbols,gl=Object.prototype.hasOwnProperty,vl=Object.prototype.propertyIsEnumerable,yl=(e,t,r)=>t in e?hl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,bl=(e,t)=>{for(var r in t||(t={}))gl.call(t,r)&&yl(e,r,t[r]);if(ml)for(var r of ml(t))vl.call(t,r)&&yl(e,r,t[r]);return e},wl=(e,t)=>pl(e,fl(t)),Sl=(e,t)=>{var r={};for(var n in e)gl.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&ml)for(var n of ml(e))t.indexOf(n)<0&&vl.call(e,n)&&(r[n]=e[n]);return r};const xl=o().forwardRef(((e,t)=>{var r;const n=e,{grid:i,layoutItem:a,index:s,totalCount:l,isLazy:u,style:c,onLoad:d,onChange:h,children:p}=n,f=Sl(n,["grid","layoutItem","index","totalCount","isLazy","style","onLoad","onChange","children"]),m=i.getSceneLayoutChild(a.i),g=null==(r=m.getClassName)?void 0:r.call(m),v=o().createElement(m.Component,{model:m,key:m.state.key});return u?o().createElement(dl,wl(bl({},f),{key:m.state.key,"data-griditem-key":m.state.key,className:(0,cr.cx)(g,e.className),style:c,ref:t}),v,p):o().createElement("div",wl(bl({},f),{ref:t,key:m.state.key,"data-griditem-key":m.state.key,className:(0,cr.cx)(g,e.className),style:c}),v,p)}));function Ol(e,t,r){e.current?t?e.current.classList.add("react-grid-layout--enable-move-animations"):e.current.classList.remove("react-grid-layout--enable-move-animations"):r||setTimeout((()=>Ol(e,t,!0)),50)}xl.displayName="GridItemWrapper";const _l=o().forwardRef(((e,t)=>{var r=Sl(e,["handleAxis"]);const n=(0,sr.useStyles2)(El);return o().createElement("div",wl(bl({ref:t},r),{className:`${n} scene-resize-handle`}),o().createElement("svg",{width:"16px",height:"16px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o().createElement("path",{d:"M21 15L15 21M21 8L8 21",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})))}));function El(e){return(0,cr.css)({position:"absolute",bottom:0,right:0,zIndex:999,padding:e.spacing(1.5,0,0,1.5),color:e.colors.border.strong,cursor:"se-resize","&:hover":{color:e.colors.text.link},svg:{display:"block"},".react-resizable-hide &":{display:"none"}})}_l.displayName="ResizeHandle";var kl=Object.defineProperty,Cl=Object.defineProperties,Tl=Object.getOwnPropertyDescriptors,Al=Object.getOwnPropertySymbols,Rl=Object.prototype.hasOwnProperty,Dl=Object.prototype.propertyIsEnumerable,Pl=(e,t,r)=>t in e?kl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;function jl(e,t){const r=t-32,n=Math.max(...e.map((e=>e.h+e.y)))/Math.floor(r/38);return e.map((e=>{return t=((e,t)=>{for(var r in t||(t={}))Rl.call(t,r)&&Pl(e,r,t[r]);if(Al)for(var r of Al(t))Dl.call(t,r)&&Pl(e,r,t[r]);return e})({},e),r={y:Math.round(e.y/n)||0,h:Math.round(e.h/n)||1},Cl(t,Tl(r));var t,r}))}var Il=Object.defineProperty,Ll=Object.defineProperties,Ml=Object.getOwnPropertyDescriptors,Nl=Object.getOwnPropertySymbols,Fl=Object.prototype.hasOwnProperty,Vl=Object.prototype.propertyIsEnumerable,zl=(e,t,r)=>t in e?Il(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Bl=(e,t)=>{for(var r in t||(t={}))Fl.call(t,r)&&zl(e,r,t[r]);if(Nl)for(var r of Nl(t))Vl.call(t,r)&&zl(e,r,t[r]);return e},$l=(e,t)=>Ll(e,Ml(t));const Ul=class extends ee{constructor(e){super($l(Bl({},e),{children:Hl(e.children)})),this._skipOnLayoutChange=!1,this._oldLayout=[],this._loadOldLayout=!1,this.onLayoutChange=e=>{if(this._skipOnLayoutChange)this._skipOnLayoutChange=!1;else{this._loadOldLayout&&(e=[...this._oldLayout],this._loadOldLayout=!1);for(const n of e){const e=this.getSceneLayoutChild(n.i),i={x:n.x,y:n.y,width:n.w,height:n.h};t=e.state,r=i,(t.x!==r.x||t.y!==r.y||t.width!==r.width||t.height!==r.height)&&e.setState(Bl({},i))}var t,r;this.setState({children:Hl(this.state.children)})}},this.onResizeStop=(e,t,r)=>{this.getSceneLayoutChild(r.i).setState({width:r.w,height:r.h})},this.onDragStart=e=>{this._oldLayout=[...e]},this.onDragStop=(e,t,r)=>{const n=this.getSceneLayoutChild(r.i);e=Wl(e);for(let t=0;te.i===r.i));let a=this.findGridItemSceneParent(e,i-1),o=this.state.children;n instanceof eu&&a instanceof eu&&(this.isRowDropValid(e,r,i)||(this._loadOldLayout=!0),a=this),a!==n.parent&&(o=this.moveChildTo(n,a)),this.setState({children:Hl(o)}),this._skipOnLayoutChange=!0}}isDraggable(){var e;return null!=(e=this.state.isDraggable)&&e}getDragClass(){return`grid-drag-handle-${this.state.key}`}getDragClassCancel(){return"grid-drag-cancel"}toggleRow(e){var t,r;if(!e.state.isCollapsed)return e.setState({isCollapsed:!0}),void this.setState({});const n=e.state.children;if(0===n.length)return e.setState({isCollapsed:!1}),void this.setState({});const i=e.state.y,a=(null!=(t=n[0].state.y)?t:i)-(i+1);let o=i;for(const e of n){const t=Bl({},e.state);t.y=null!=(r=t.y)?r:i,t.y-=a,t.y!==e.state.y&&e.setState(t),o=Math.max(o,Number(t.y)+Number(t.height))}const s=o-i-1;for(const t of this.state.children)if(t.state.y>i&&this.pushChildDown(t,s),Bs(t)&&t!==e)for(const e of t.state.children)e.state.y>i&&this.pushChildDown(e,s);e.setState({isCollapsed:!1}),this.setState({})}getSceneLayoutChild(e){for(const t of this.state.children){if(t.state.key===e)return t;if(t instanceof eu)for(const r of t.state.children)if(r.state.key===e)return r}throw new Error("Scene layout child not found for GridItem")}pushChildDown(e,t){e.setState({y:e.state.y+t})}findGridItemSceneParent(e,t){for(let r=t;r>=0;r--){const t=e[r],n=this.getSceneLayoutChild(t.i);if(n instanceof eu)return n.state.isCollapsed?this:n}return this}isRowDropValid(e,t,r){if(e[e.length-1].i===t.i)return!0;const n=this.getSceneLayoutChild(e[r+1].i);return n instanceof eu||n.parent instanceof Ul}moveChildTo(e,t){const r=e.parent;let n=this.state.children;const i=e.clone({key:e.state.key});if(r instanceof eu){const a=r.clone();if(a.setState({children:a.state.children.filter((t=>t.state.key!==e.state.key))}),n=n.map((e=>e===r?a:e)),t instanceof eu){const e=t.clone();e.setState({children:[...e.state.children,i]}),n=n.map((r=>r===t?e:r))}else n=[...n,i]}else if(!(t instanceof Ul)){n=n.filter((t=>t.state.key!==e.state.key));const r=t.clone();r.setState({children:[...r.state.children,i]}),n=n.map((e=>e===t?r:e))}return n}toGridCell(e){var t,r;const n=e.state;let i=null!=(t=n.x)?t:0,a=null!=(r=n.y)?r:0;const o=Number.isInteger(Number(n.width))?Number(n.width):4,s=Number.isInteger(Number(n.height))?Number(n.height):4;let l=e.state.isDraggable,u=e.state.isResizable;return e instanceof eu&&(l=!!e.state.isCollapsed,u=!1),{i:e.state.key,x:i,y:a,h:s,w:o,isResizable:u,isDraggable:l}}buildGridLayout(e,t){let r=[];for(const e of this.state.children)if(r.push(this.toGridCell(e)),e instanceof eu&&!e.state.isCollapsed)for(const t of e.state.children)r.push(this.toGridCell(t));return r=Wl(r),this.state.UNSAFE_fitPanels&&(r=jl(r,t)),e<768?(this._skipOnLayoutChange=!0,r.map((e=>$l(Bl({},e),{w:24})))):(this._skipOnLayoutChange=!1,r)}};let ql=Ul;function Hl(e){return e.forEach((e=>{e instanceof eu&&e.setState({children:Hl(e.state.children)})})),[...e].sort(((e,t)=>e.state.y-t.state.y||e.state.x-t.state.x))}function Wl(e){return[...e].sort(((e,t)=>e.y-t.y||e.x-t.x))}ql.Component=function({model:e}){const{children:t,isLazy:r,isDraggable:n,isResizable:i}=e.useState(),s=(0,a.useRef)(null);return(0,a.useEffect)((()=>{Ol(s,!!n)}),[n]),function(e){if(e.some((e=>void 0===e.state.height||void 0===e.state.width||void 0===e.state.x||void 0===e.state.y)))throw new Error("All children must have a size specified")}(t),o().createElement(nl,null,(({width:t,height:a})=>{if(0===t)return null;const l=e.buildGridLayout(t,a);return o().createElement("div",{ref:s,style:{width:`${t}px`,height:"100%",position:"relative",zIndex:1},className:"react-grid-layout"},o().createElement(Us(),{width:t,isDraggable:n&&t>768,isResizable:null!=i&&i,containerPadding:[0,0],useCSSTransforms:!0,margin:[8,8],cols:24,rowHeight:30,draggableHandle:`.grid-drag-handle-${e.state.key}`,draggableCancel:".grid-drag-cancel",layout:l,onDragStart:e.onDragStart,onDragStop:e.onDragStop,onResizeStop:e.onResizeStop,onLayoutChange:e.onLayoutChange,isBounded:!1,resizeHandle:o().createElement(_l,null)},l.map(((t,n)=>o().createElement(xl,{key:t.i,grid:e,layoutItem:t,index:n,isLazy:r,totalCount:l.length})))))}))};var Gl=Object.defineProperty,Ql=Object.defineProperties,Kl=Object.getOwnPropertyDescriptors,Xl=Object.getOwnPropertySymbols,Jl=Object.prototype.hasOwnProperty,Yl=Object.prototype.propertyIsEnumerable,Zl=(e,t,r)=>t in e?Gl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;class eu extends ee{constructor(e){var t;super((t=((e,t)=>{for(var r in t||(t={}))Jl.call(t,r)&&Zl(e,r,t[r]);if(Xl)for(var r of Xl(t))Yl.call(t,r)&&Zl(e,r,t[r]);return e})({children:e.children||[],isCollapsible:e.isCollapsible||!0,title:e.title||""},e),Ql(t,Kl({x:0,height:1,width:24})))),this.onCollapseToggle=()=>{this.state.isCollapsible&&this.getGridLayout().toggleRow(this)}}getGridLayout(){const e=this.parent;if(!(e&&e instanceof ql))throw new Error("SceneGridRow must be a child of SceneGridLayout");return e}getUrlState(){return{rowc:this.state.isCollapsed?"1":"0"}}updateFromUrl(e){null!=e.rowc&&e.rowc!==this.getUrlState().rowc&&this.onCollapseToggle()}}eu.Component=function({model:e}){const t=(0,sr.useStyles2)(tu),{isCollapsible:r,isCollapsed:n,title:i,actions:a,children:s}=e.useState(),l=e.getGridLayout(),u=l.getDragClass(),c=l.isDraggable(),d=s?s.length:0,h=1===d?"panel":"panels";return o().createElement("div",{className:(0,cr.cx)(t.row,n&&t.rowCollapsed)},o().createElement("div",{className:t.rowTitleAndActionsGroup},o().createElement("button",{onClick:e.onCollapseToggle,className:t.rowTitleButton,"aria-label":n?"Expand row":"Collapse row","data-testid":ur.components.DashboardRow.title(Tt.interpolate(e,i,void 0,"text"))},r&&o().createElement(sr.Icon,{name:n?"angle-right":"angle-down"}),o().createElement("span",{className:t.rowTitle,role:"heading"},Tt.interpolate(e,i,void 0,"text"))),o().createElement("span",{className:(0,cr.cx)(t.panelCount,n&&t.panelCountCollapsed)},"(",d," ",h,")"),a&&o().createElement("div",{className:t.rowActions},o().createElement(a.Component,{model:a}))),c&&n&&o().createElement("div",{className:(0,cr.cx)(t.dragHandle,u)},o().createElement(sr.Icon,{name:"draggabledots"})))};const tu=e=>({row:(0,cr.css)({width:"100%",height:"30px",display:"flex",justifyContent:"space-between",gap:e.spacing(1)}),rowTitleButton:(0,cr.css)({display:"flex",alignItems:"center",cursor:"pointer",background:"transparent",border:"none",gap:e.spacing(1)}),rowCollapsed:(0,cr.css)({borderBottom:`1px solid ${e.colors.border.weak}`}),rowTitle:(0,cr.css)({fontSize:e.typography.h5.fontSize,fontWeight:e.typography.fontWeightMedium}),collapsedInfo:(0,cr.css)({fontSize:e.typography.bodySmall.fontSize,color:e.colors.text.secondary,display:"flex",alignItems:"center",flexGrow:1}),rowTitleAndActionsGroup:(0,cr.css)({display:"flex","&:hover, &:focus-within":{"& > div":{opacity:1}}}),rowActions:(0,cr.css)({display:"flex",opacity:0,transition:"200ms opacity ease-in 200ms","&:hover, &:focus-within":{opacity:1}}),dragHandle:(0,cr.css)({display:"flex",padding:e.spacing(0,1),alignItems:"center",justifyContent:"flex-end",cursor:"move",color:e.colors.text.secondary,"&:hover":{color:e.colors.text.primary}}),panelCount:(0,cr.css)({paddingLeft:e.spacing(2),color:e.colors.text.secondary,fontStyle:"italic",fontSize:e.typography.size.sm,fontWeight:"normal",display:"none",lineHeight:"30px"}),panelCountCollapsed:(0,cr.css)({display:"inline-block"})});(class extends ee{constructor(){super(...arguments),this.onToggle=()=>{this.setState({isCollapsed:!this.state.isCollapsed})},this.onRemove=()=>{const e=this.parent;"body"in e.state&&e.setState({body:void 0})}}}).Component=function({model:e}){const{title:t,isCollapsed:r,canCollapse:n,canRemove:i,body:a,controls:s}=e.useState(),l=(0,sr.useStyles2)(tu),u=(0,sr.useStyles2)(ru),c=(null!=s?s:[]).map((e=>o().createElement(e.Component,{key:e.state.key,model:e})));i&&c.push(o().createElement(sr.ToolbarButton,{icon:"times",variant:"default",onClick:e.onRemove,key:"remove-button","aria-label":"Remove scene"}));return o().createElement("div",{className:u.wrapper},o().createElement("div",{className:(0,cr.cx)(u.row,r&&u.rowCollapsed)},o().createElement("button",{onClick:e.onToggle,className:l.rowTitleButton,"aria-label":r?"Expand scene":"Collapse scene"},n&&o().createElement(sr.Icon,{name:r?"angle-right":"angle-down"}),o().createElement("span",{className:l.rowTitle,role:"heading"},Tt.interpolate(e,t,void 0,"text"))),o().createElement("div",{className:u.actions},c)),!r&&o().createElement(a.Component,{model:a}))};const ru=e=>({wrapper:(0,cr.css)({display:"flex",flexDirection:"column",flexGrow:1,gap:e.spacing(1)}),row:(0,cr.css)({width:"100%",display:"flex",justifyContent:"space-between",gap:e.spacing(1)}),rowCollapsed:(0,cr.css)({borderBottom:`1px solid ${e.colors.border.weak}`,paddingBottom:e.spacing(1)}),actions:(0,cr.css)({display:"flex",alignItems:"center",gap:e.spacing(1),justifyContent:"flex-end",flexGrow:1})});(class extends ee{constructor(){super(...arguments),this._variableDependency=new Dt(this,{statePaths:["text"]})}}).Component=({model:e})=>{const{text:t,fontSize:r=20,align:n="left",key:i,spacing:a}=e.useState(),s=(0,sr.useTheme2)(),l=(0,cr.css)({fontSize:r,display:"flex",flexGrow:1,alignItems:"center",padding:a?s.spacing(a,0):void 0,justifyContent:n});return o().createElement("div",{className:l,"data-testid":i},Tt.interpolate(e,t))};(class extends ee{}).Component=({model:e})=>{const t=e.useState();return o().createElement(sr.ToolbarButton,{onClick:t.onClick,icon:t.icon})};(class extends ee{}).Component=({model:e})=>{const t=e.useState();return o().createElement("div",{style:{display:"flex"}},t.label&&o().createElement(zr,{label:t.label}),o().createElement(sr.Input,{defaultValue:t.value,width:8,onBlur:t=>{e.state.onChange(parseInt(t.currentTarget.value,10))}}))};class nu extends ee{constructor(){super(...arguments),this.onZoom=()=>{const e=Tt.getTimeRange(this),t=function(e,t){const r=e.to.valueOf()-e.from.valueOf(),n=e.to.valueOf()-r/2,i=0===r?3e4:r*t,a=n+i/2,o=n-i/2;return{from:(0,l.toUtc)(o),to:(0,l.toUtc)(a),raw:{from:(0,l.toUtc)(o),to:(0,l.toUtc)(a)}}}(e.state.value,2);e.onTimeRangeChange(t)},this.onChangeFiscalYearStartMonth=e=>{Tt.getTimeRange(this).setState({fiscalYearStartMonth:e})},this.onMoveBackward=()=>{const e=Tt.getTimeRange(this),{state:{value:t}}=e;e.onTimeRangeChange(au(iu.Backward,t,Date.now()))},this.onMoveForward=()=>{const e=Tt.getTimeRange(this),{state:{value:t}}=e;e.onTimeRangeChange(au(iu.Forward,t,Date.now()))}}}nu.Component=function({model:e}){const{hidePicker:t,isOnCanvas:r}=e.useState(),n=Tt.getTimeRange(e),i=n.getTimeZone(),a=n.useState();if(t)return null;return o().createElement(sr.TimeRangePicker,{isOnCanvas:null==r||r,value:a.value,onChange:n.onTimeRangeChange,timeZone:i,fiscalYearStartMonth:a.fiscalYearStartMonth,onMoveBackward:e.onMoveBackward,onMoveForward:e.onMoveForward,onZoom:e.onZoom,onChangeTimeZone:n.onTimeZoneChange,onChangeFiscalYearStartMonth:e.onChangeFiscalYearStartMonth})};var iu=(e=>(e[e.Backward=0]="Backward",e[e.Forward=1]="Forward",e))(iu||{});function au(e,t,r){const n=t.to.valueOf(),i=t.from.valueOf(),a=(n-i)/2;let o,s;0===e?(o=i-a,s=n-a):(o=i+a,s=n+a,s>r&&nt in e?ou(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;const pu=["5s","10s","30s","1m","5m","15m","30m","1h","2h","1d"];class fu extends ee{constructor(e){var t,r,n,i,a;super((i=((e,t)=>{for(var r in t||(t={}))cu.call(t,r)&&hu(e,r,t[r]);if(uu)for(var r of uu(t))du.call(t,r)&&hu(e,r,t[r]);return e})({refresh:""},e),a={autoValue:void 0,autoEnabled:null==(t=e.autoEnabled)||t,autoMinInterval:null!=(r=e.autoMinInterval)?r:u.config.minRefreshInterval,intervals:null!=(n=e.intervals)?n:pu},su(i,lu(a)))),this._urlSync=new ke(this,{keys:["refresh"]}),this.onRefresh=()=>{const e=Tt.getQueryController(this);if(null==e?void 0:e.state.isRunning)return void e.cancelAll();const t=Tt.getTimeRange(this);this._intervalTimer&&clearInterval(this._intervalTimer),t.onRefresh(),this.setupIntervalTimer()},this.onIntervalChanged=e=>{this.setState({refresh:e}),this.setupIntervalTimer()},this.setupAutoTimeRangeListener=()=>Tt.getTimeRange(this).subscribeToState(((e,t)=>{e.from===t.from&&e.to===t.to||this.setupIntervalTimer()})),this.calculateAutoRefreshInterval=()=>{var e;const t=Tt.getTimeRange(this),r=null!=(e=null==window?void 0:window.innerWidth)?e:2e3;return l.rangeUtil.calculateInterval(t.state.value,r,this.state.autoMinInterval)},this.setupIntervalTimer=()=>{var e;const t=Tt.getTimeRange(this),{refresh:r,intervals:n}=this.state;if((this._intervalTimer||""===r)&&clearInterval(this._intervalTimer),""===r)return;if(r!==sr.RefreshPicker.autoOption.value&&n&&!n.includes(r))return;let i;if(null==(e=this._autoTimeRangeListener)||e.unsubscribe(),r===sr.RefreshPicker.autoOption.value){const e=this.calculateAutoRefreshInterval();i=e.intervalMs,this._autoTimeRangeListener=this.setupAutoTimeRangeListener(),e.interval!==this.state.autoValue&&this.setState({autoValue:e.interval})}else i=l.rangeUtil.intervalToMs(r);this._intervalTimer=setInterval((()=>{t.onRefresh()}),i)},this.addActivationHandler((()=>(this.setupIntervalTimer(),()=>{var e;this._intervalTimer&&clearInterval(this._intervalTimer),null==(e=this._autoTimeRangeListener)||e.unsubscribe()})))}getUrlState(){return{refresh:""!==this.state.refresh?this.state.refresh:void 0}}updateFromUrl(e){const t=e.refresh;"string"==typeof t?this.setState({refresh:t}):null==t&&this.setState({refresh:""})}}fu.Component=function({model:e}){var t;const{refresh:r,intervals:n,autoEnabled:i,autoValue:a,isOnCanvas:s,primary:l,withText:u}=e.useState(),c=function(e){const t=Tt.getQueryController(e);if(!t)return!1;return t.useState().isRunning}(e);let d,h,p=r===(null==(t=sr.RefreshPicker.autoOption)?void 0:t.value)?a:u?"Refresh":void 0;c&&(d="Cancel all queries",u&&(p="Cancel"));u&&(h="96px");return o().createElement(sr.RefreshPicker,{showAutoInterval:i,value:r,intervals:n,tooltip:d,width:h,text:p,onRefresh:e.onRefresh,primary:l,onIntervalChanged:e.onIntervalChanged,isLoading:c,isOnCanvas:null==s||s})};const mu=e=>`${e}-compare`;var gu=Object.defineProperty,vu=Object.defineProperties,yu=Object.getOwnPropertyDescriptors,bu=Object.getOwnPropertySymbols,wu=Object.prototype.hasOwnProperty,Su=Object.prototype.propertyIsEnumerable,xu=(e,t,r)=>t in e?gu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ou=(e,t)=>{for(var r in t||(t={}))wu.call(t,r)&&xu(e,r,t[r]);if(bu)for(var r of bu(t))Su.call(t,r)&&xu(e,r,t[r]);return e},_u=(e,t)=>vu(e,yu(t));const Eu="__previousPeriod",ku="__noPeriod",Cu={label:"Previous period",value:Eu},Tu={label:"No comparison",value:ku},Au=[{label:"Day before",value:"24h"},{label:"Week before",value:"1w"},{label:"Month before",value:"1M"}];(class extends ee{constructor(e){super(Ou({compareOptions:Au},e)),this._urlSync=new ke(this,{keys:["compareWith"]}),this._onActivate=()=>{const e=Tt.getTimeRange(this);this.setState({compareOptions:this.getCompareOptions(e.state.value)}),this._subs.add(e.subscribeToState((e=>{const t=this.getCompareOptions(e.value),r={compareOptions:t};Boolean(this.state.compareWith)&&!t.find((({value:e})=>e===this.state.compareWith))&&(r.compareWith=Eu),this.setState(r)})))},this.getCompareOptions=e=>{const t=Math.ceil(e.to.diff(e.from)),r=Au.findIndex((({value:e})=>l.rangeUtil.intervalToMs(e)>=t));return[Tu,Cu,...Au.slice(r).map((({label:e,value:t})=>({label:e,value:t})))]},this.onCompareWithChanged=e=>{e===ku?this.onClearCompare():this.setState({compareWith:e})},this.onClearCompare=()=>{this.setState({compareWith:void 0})},this.addActivationHandler(this._onActivate)}getExtraQueries(e){const t=[],r=this.getCompareTimeRange(e.range);if(!r)return t;const n=e.targets.filter((e=>!1!==e.timeRangeCompare));return n.length&&t.push({req:_u(Ou({},e),{targets:n,range:r}),processor:Ru}),t}shouldRerun(e,t){return e.compareWith!==t.compareWith}getCompareTimeRange(e){let t,r;if(this.state.compareWith){if(this.state.compareWith===Eu){const n=e.to.diff(e.from);t=(0,l.dateTime)(e.from).subtract(n),r=(0,l.dateTime)(e.to).subtract(n)}else t=(0,l.dateTime)(e.from).subtract(l.rangeUtil.intervalToMs(this.state.compareWith)),r=(0,l.dateTime)(e.to).subtract(l.rangeUtil.intervalToMs(this.state.compareWith));return{from:t,to:r,raw:{from:t,to:r}}}}getUrlState(){return{compareWith:this.state.compareWith}}updateFromUrl(e){if(!e.compareWith)return;const t=Te(e.compareWith);if(t){this.getCompareOptions(Tt.getTimeRange(this).state.value).find((({value:e})=>e===t))?this.setState({compareWith:t}):this.setState({compareWith:"__previousPeriod"})}}}).Component=function({model:e}){var t;const r=(0,sr.useStyles2)(Du),{compareWith:n,compareOptions:i}=e.useState(),[a,s]=o().useState(n),l=null!=(t=i.find((({value:e})=>e===a)))?t:Cu,u=i.find((({value:e})=>e===n)),c=Boolean(u),d=()=>{c?(s(n),e.onClearCompare()):c||e.onCompareWithChanged(l.value)};return o().createElement(sr.ButtonGroup,null,o().createElement(sr.ToolbarButton,{variant:"canvas",tooltip:"Enable time frame comparison",onClick:e=>{e.stopPropagation(),e.preventDefault(),d()}},o().createElement(sr.Checkbox,{label:" ",value:c,onClick:d}),"Comparison"),c?o().createElement(sr.ButtonSelect,{variant:"canvas",value:u,options:i,onChange:t=>{e.onCompareWithChanged(t.value)}}):o().createElement(sr.ToolbarButton,{className:r.previewButton,disabled:!0,variant:"canvas",isOpen:!1},l.label))};const Ru=(e,t)=>{const r=t.timeRange.from.diff(e.timeRange.from);return t.series.forEach((e=>{e.refId=mu(e.refId||""),e.meta=_u(Ou({},e.meta),{timeCompare:{diffMs:r,isTimeShiftQuery:!0}}),e.fields.forEach((e=>(e.type===l.FieldType.time&&(e.values=e.values.map((e=>r<0?e-r:e+r))),e.config=_u(Ou({},e.config),{color:{mode:"fixed",fixedColor:u.config.theme.palette.gray60}}),e)))})),(0,k.of)(t)};function Du(e){return{previewButton:(0,cr.css)({"&:disabled":{border:`1px solid ${e.colors.secondary.border}`,color:e.colors.text.disabled,opacity:1}})}}(class extends ee{constructor(e){super(e),this.addActivationHandler((()=>{const e=Tt.getData(this);this._subs.add(e.subscribeToState((e=>{var t;(null==(t=e.data)?void 0:t.state)===l.LoadingState.Done&&this.performRepeat(e.data)}))),e.state.data&&this.performRepeat(e.state.data)}))}performRepeat(e){const t=[];for(let r=0;r{const{body:t}=e.useState();return o().createElement(t.Component,{model:t})};(class extends ee{constructor(e){super(e),this._variableDependency=new Dt(this,{variableNames:[this.state.variableName],onVariableUpdateCompleted:()=>this.performRepeat()}),this.addActivationHandler((()=>this.performRepeat()))}performRepeat(){if(this._variableDependency.hasDependencyInLoadingState())return;const e=Tt.lookupVariable(this.state.variableName,this);if(!(e instanceof ir))return void console.error("SceneByVariableRepeater: variable is not a MultiValueVariable");const t=function(e){const{value:t,text:r,options:n}=e.state;if(e.hasAllValue())return n;if(Array.isArray(t)&&Array.isArray(r))return t.map(((e,t)=>({value:e,label:r[t]})));return[{value:t,label:r}]}(e),r=[];for(const e of t){const t=this.state.getLayoutChild(e);r.push(t)}this.state.body.setState({children:r})}}).Component=({model:e})=>{const{body:t}=e.useState();return o().createElement(t.Component,{model:t})};const Pu=class extends ee{constructor(){super({})}get Component(){return Pu.Component}};Pu.Component=e=>o().createElement("div",{style:{flexGrow:1}});class ju extends ee{toggleDirection(){this.setState({direction:"row"===this.state.direction?"column":"row"})}isDraggable(){return!1}}ju.Component=function({model:e,parentState:t}){const{children:r,isHidden:n}=e.useState(),i=function(e,t){return(0,a.useMemo)((()=>{var r,n,i,a,o,s,l,c,d,h;const{direction:p="row",wrap:f}=e,m=u.config.theme2,g={};return t?Lu(g,e,t):(g.display="flex",g.flexGrow=1,g.minWidth=e.minWidth,g.minHeight=e.minHeight),g.flexDirection=p,g.gap="8px",g.flexWrap=f||"nowrap",g.alignContent="baseline",g.minWidth=g.minWidth||0,g.minHeight=g.minHeight||0,g[m.breakpoints.down("md")]={flexDirection:null!=(n=null==(r=e.md)?void 0:r.direction)?n:"column",maxWidth:null!=(a=null==(i=e.md)?void 0:i.maxWidth)?a:"unset",maxHeight:null!=(s=null==(o=e.md)?void 0:o.maxHeight)?s:"unset",height:null!=(c=null==(l=e.md)?void 0:l.height)?c:"unset",width:null!=(h=null==(d=e.md)?void 0:d.width)?h:"unset"},(0,cr.css)(g)}),[t,e])}(e.state,t);if(n)return null;return o().createElement("div",{className:i},r.map((t=>{const r=t.Component;return o().createElement(r,{key:t.state.key,model:t,parentState:e.state})})))};class Iu extends ee{}function Lu(e,t,r){var n,i,a;const o=null!=(n=r.direction)?n:"row",{xSizing:s="fill",ySizing:l="fill"}=t;return e.display="flex",e.position="relative",e.flexDirection=o,"column"===o?(t.height?e.height=t.height:e.flexGrow="fill"===l?1:0,t.width?e.width=t.width:e.alignSelf="fill"===s?"stretch":"flex-start"):(t.height?e.height=t.height:e.alignSelf="fill"===l?"stretch":"flex-start",t.width?e.width=t.width:e.flexGrow="fill"===s?1:0),e.minWidth=t.minWidth,e.maxWidth=t.maxWidth,e.maxHeight=t.maxHeight,e.minHeight=null!=(i=t.minHeight)?i:r.minHeight,e.height=null!=(a=t.height)?a:r.height,e}Iu.Component=function({model:e,parentState:t}){if(!t)throw new Error("SceneFlexItem must be a child of SceneFlexLayout");const{body:r,isHidden:n}=e.useState(),i=function(e,t){return(0,a.useMemo)((()=>{var r,n,i,a,o,s,l,c,d,h;const p=u.config.theme2,f=Lu({},e,t);return f[p.breakpoints.down("md")]={maxWidth:null!=(n=null==(r=e.md)?void 0:r.maxWidth)?n:"unset",maxHeight:null!=(a=null==(i=e.md)?void 0:i.maxHeight)?a:"unset",height:null!=(l=null==(o=e.md)?void 0:o.height)?l:null==(s=t.md)?void 0:s.height,width:null!=(h=null==(c=e.md)?void 0:c.width)?h:null==(d=t.md)?void 0:d.width},(0,cr.css)(f)}),[e,t])}(e.state,t);if(!r||n)return null;return o().createElement("div",{className:i},o().createElement(r.Component,{model:r}))};var Mu=Object.defineProperty,Nu=Object.getOwnPropertySymbols,Fu=Object.prototype.hasOwnProperty,Vu=Object.prototype.propertyIsEnumerable,zu=(e,t,r)=>t in e?Mu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;class Bu extends ee{constructor(e){var t,r;super(((e,t)=>{for(var r in t||(t={}))Fu.call(t,r)&&zu(e,r,t[r]);if(Nu)for(var r of Nu(t))Vu.call(t,r)&&zu(e,r,t[r]);return e})({rowGap:1,columnGap:1,templateColumns:"repeat(auto-fit, minmax(400px, 1fr))",autoRows:null!=(t=e.autoRows)?t:"320px",children:null!=(r=e.children)?r:[]},e))}isDraggable(){return!1}}Bu.Component=function({model:e}){const{children:t,isHidden:r,isLazy:n}=e.useState(),i=(s=e.state,(0,a.useMemo)((()=>{var e,t,r,n,i,a,o,l,c,d,h;const p={},f=u.config.theme2;return p.display="grid",p.gridTemplateColumns=s.templateColumns,p.gridTemplateRows=s.templateRows||"unset",p.gridAutoRows=s.autoRows||"unset",p.rowGap=f.spacing(null!=(e=s.rowGap)?e:1),p.columnGap=f.spacing(null!=(t=s.columnGap)?t:1),p.justifyItems=s.justifyItems||"unset",p.alignItems=s.alignItems||"unset",p.justifyContent=s.justifyContent||"unset",p.flexGrow=1,s.md&&(p[f.breakpoints.down("md")]={gridTemplateRows:null==(r=s.md)?void 0:r.templateRows,gridTemplateColumns:null==(n=s.md)?void 0:n.templateColumns,rowGap:s.md.rowGap?f.spacing(null!=(a=null==(i=s.md)?void 0:i.rowGap)?a:1):void 0,columnGap:s.md.columnGap?f.spacing(null!=(l=null==(o=s.md)?void 0:o.rowGap)?l:1):void 0,justifyItems:null==(c=s.md)?void 0:c.justifyItems,alignItems:null==(d=s.md)?void 0:d.alignItems,justifyContent:null==(h=s.md)?void 0:h.justifyContent}),(0,cr.css)(p)}),[s]));var s;if(r)return null;return o().createElement("div",{className:i},t.map((t=>{const r=t.Component;return n?o().createElement(dl,{key:t.state.key,className:i},o().createElement(r,{key:t.state.key,model:t,parentState:e.state})):o().createElement(r,{key:t.state.key,model:t,parentState:e.state})})))};class $u extends ee{}$u.Component=function({model:e,parentState:t}){if(!t)throw new Error("SceneCSSGridItem must be a child of SceneCSSGridLayout");const{body:r,isHidden:n}=e.useState(),i=(s=e.state,(0,a.useMemo)((()=>{const e={};return e.gridColumn=s.gridColumn||"unset",e.gridRow=s.gridRow||"unset",e.position="relative",(0,cr.css)(e)}),[s]));var s;if(!r||n)return null;return o().createElement("div",{className:i},o().createElement(r.Component,{model:r}))};var Uu=Object.defineProperty,qu=Object.getOwnPropertySymbols,Hu=Object.prototype.hasOwnProperty,Wu=Object.prototype.propertyIsEnumerable,Gu=(e,t,r)=>t in e?Uu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Qu=(e,t)=>{for(var r in t||(t={}))Hu.call(t,r)&&Gu(e,r,t[r]);if(qu)for(var r of qu(t))Wu.call(t,r)&&Gu(e,r,t[r]);return e};const Ku=.3,Xu=new Set(["ArrowUp","ArrowDown"]),Ju=new Set(["ArrowLeft","ArrowRight"]),Yu={row:{dim:"width",axis:"clientX",min:"minWidth",max:"maxWidth"},column:{dim:"height",axis:"clientY",min:"minHeight",max:"maxHeight"}};function Zu({direction:e="row",handleSize:t=32,initialSize:r="auto",primaryPaneStyles:n,secondaryPaneStyles:i,onDragFinished:s,children:l}){const u=o().Children.toArray(l),c=(0,a.useRef)(null),d=(0,a.useRef)(null),h=(0,a.useRef)(null),p=(0,a.useRef)(null),f=(0,a.useRef)(null),m=(0,a.useRef)("1fr"),g=(0,a.useRef)(void 0),v=(0,a.useRef)(void 0),y=Yu[e].dim,b=Yu[e].axis,w=Yu[e].min,S=Yu[e].max;!function(e,t,r=0,n){const i=(0,pe.throttle)(t,r);(0,a.useLayoutEffect)((()=>{if(!e)return;const t=new ResizeObserver(i);return t.observe(e,{box:"device-pixel-content-box"}),()=>t.disconnect()}),n)}(p.current,(e=>{for(const t of e){if(!t.target.isSameNode(p.current))return;const e=d.current.getBoundingClientRect()[y],r=tc(d.current);c.current.ariaValueNow=`${(0,pe.clamp)((e-r[w])/(r[S]-r[w])*100,0,100)}`}}),500,[S,w,e,y]);const x=(0,a.useRef)(null),O=(0,a.useCallback)((e=>{m.current=d.current.getBoundingClientRect()[y],f.current=p.current.getBoundingClientRect()[y],x.current=e[b],c.current.setPointerCapture(e.pointerId),g.current=tc(d.current),v.current=void 0}),[y,b]),_=(0,a.useCallback)((e=>{if(null!==x.current&&"1fr"!==m.current){const r=e[b]-x.current,n=g.current,i=(0,pe.clamp)(m.current+r,n[w],n[S]),a=i/(f.current-t);d.current.style.flexGrow=`${a}`,h.current.style.flexGrow=""+(1-a);const o=(0,pe.clamp)((i-n[w])/(n[S]-n[w])*100,0,100);c.current.ariaValueNow=`${o}`}}),[t,b,w,S]),E=(0,a.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),c.current.releasePointerCapture(e.pointerId),x.current=null,null==s||s(parseFloat(d.current.style.flexGrow))}),[s]),k=(0,a.useRef)(new Set),C=(0,a.useRef)(null),T=(0,a.useCallback)((r=>{var n;if(0===k.current.size)return void(C.current=null);if("1fr"===m.current)return;const i=(r-(null!=(n=C.current)?n:r))*Ku;let a=0;"row"===e?(k.current.has("ArrowLeft")&&(a-=i),k.current.has("ArrowRight")&&(a+=i)):(k.current.has("ArrowUp")&&(a-=i),k.current.has("ArrowDown")&&(a+=i));const o=g.current,s=d.current.getBoundingClientRect()[y],l=(0,pe.clamp)(s+a,o[w],o[S]),u=l/(f.current-t);d.current.style.flexGrow=`${u}`,h.current.style.flexGrow=""+(1-u);const p=(l-o[w])/(o[S]-o[w])*100;c.current.ariaValueNow=`${(0,pe.clamp)(p,0,100)}`,C.current=r,window.requestAnimationFrame(T)}),[e,t,w,S,y]),A=(0,a.useCallback)((r=>{if("Enter"===r.key)return void(void 0===v.current?(v.current=d.current.style.flexGrow,d.current.style.flexGrow="0",h.current.style.flexGrow="1"):(d.current.style.flexGrow=v.current,h.current.style.flexGrow=""+(1-parseFloat(v.current)),v.current=void 0));if("Home"===r.key){g.current=tc(d.current),f.current=p.current.getBoundingClientRect()[y];const e=g.current[w]/(f.current-t);return d.current.style.flexGrow=`${e}`,h.current.style.flexGrow=""+(1-e),void(c.current.ariaValueNow="0")}if("End"===r.key){g.current=tc(d.current),f.current=p.current.getBoundingClientRect()[y];const e=g.current[S]/(f.current-t);return d.current.style.flexGrow=`${e}`,h.current.style.flexGrow=""+(1-e),void(c.current.ariaValueNow="100")}if(!("column"===e&&Xu.has(r.key)||"row"===e&&Ju.has(r.key))||k.current.has(r.key))return;v.current=void 0,r.preventDefault(),r.stopPropagation(),m.current=d.current.getBoundingClientRect()[y],f.current=p.current.getBoundingClientRect()[y],g.current=tc(d.current);if(!k.current.has(r.key)){const e=0===k.current.size;k.current.add(r.key),e&&window.requestAnimationFrame(T)}}),[e,T,t,S,y,w]),R=(0,a.useCallback)((t=>{"row"===e&&!Ju.has(t.key)||"column"===e&&!Xu.has(t.key)||(k.current.delete(t.key),null==s||s(parseFloat(d.current.style.flexGrow)))}),[e,s]),D=(0,a.useCallback)((()=>{d.current.style.flexGrow="0.5",h.current.style.flexGrow="0.5";const e=tc(d.current);g.current=e,m.current=d.current.getBoundingClientRect()[y],c.current.ariaValueNow=""+(m.current-e[w])/(e[S]-e[w])*100}),[S,y,w]),P=(0,a.useCallback)((()=>{k.current.size>0&&(k.current.clear(),x.current=null,null==s||s(parseFloat(d.current.style.flexGrow)))}),[s]),j=(0,sr.useStyles2)(ec),I=cl(),L=2===u.length?"visible":"hidden";return o().createElement("div",{ref:p,className:j.container,style:{flexDirection:e}},o().createElement("div",{ref:d,className:j.panel,style:Qu({flexGrow:"auto"===r?.5:(0,pe.clamp)(r,0,1),[w]:"min-content"},n),id:`start-panel-${I}`},u[0]),u[1]&&o().createElement(o().Fragment,null,o().createElement("div",{ref:c,style:{[y]:`${t}px`},className:(0,cr.cx)(j.handle,{[j.handleHorizontal]:"column"===e}),onPointerUp:E,onPointerDown:O,onPointerMove:_,onKeyDown:A,onKeyUp:R,onDoubleClick:D,onBlur:P,role:"separator","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":50,"aria-controls":`start-panel-${I}`,"aria-label":"Pane resize widget",tabIndex:0}),o().createElement("div",{ref:h,className:j.panel,style:Qu({flexGrow:"auto"===r?.5:(0,pe.clamp)(1-r,0,1),[w]:"min-content",visibility:`${L}`},i),id:`end-panel-${I}`},u[1])))}function ec(e){return{handle:(0,cr.css)({cursor:"col-resize",position:"relative",flexShrink:0,userSelect:"none","&::before":{content:'""',position:"absolute",backgroundColor:e.colors.primary.main,left:"50%",transform:"translate(-50%)",top:0,height:"100%",width:"1px",opacity:0,transition:"opacity ease-in-out 0.2s"},"&::after":{content:'""',width:"4px",borderRadius:"4px",backgroundColor:e.colors.border.weak,transition:"background-color ease-in-out 0.2s",height:"50%",top:"calc(50% - (50%) / 2)",transform:"translateX(-50%)",position:"absolute",left:"50%"},"&:hover, &:focus-visible":{outline:"none","&::before":{opacity:1},"&::after":{backgroundColor:e.colors.primary.main}}}),handleHorizontal:(0,cr.css)({cursor:"row-resize","&::before":{left:"inherit",transform:"translateY(-50%)",top:"50%",height:"1px",width:"100%"},"&::after":{width:"50%",height:"4px",top:"50%",transform:"translateY(-50%)",left:"calc(50% - (50%) / 2)"}}),container:(0,cr.css)({display:"flex",width:"100%",flexGrow:1,overflow:"hidden"}),panel:(0,cr.css)({display:"flex",position:"relative",flexBasis:0})}}function tc(e){if(null===e)return;const t=document.body.style.overflow,r=e.style.width,n=e.style.height,i=e.style.flexGrow;document.body.style.overflow="hidden",e.style.flexGrow="0";const{width:a,height:o}=e.getBoundingClientRect();e.style.flexGrow="100";const{width:s,height:l}=e.getBoundingClientRect();return document.body.style.overflow=t,e.style.width=r,e.style.height=n,e.style.flexGrow=i,{minWidth:a,maxWidth:s,minHeight:o,maxHeight:l}}class rc extends ee{toggleDirection(){this.setState({direction:"row"===this.state.direction?"column":"row"})}isDraggable(){return!1}}rc.Component=function({model:e}){const{primary:t,secondary:r,direction:n,isHidden:i,initialSize:a,primaryPaneStyles:s,secondaryPaneStyles:l}=e.useState();if(i)return null;const u=t.Component,c=null==r?void 0:r.Component;let d=r?a:1;return o().createElement(Zu,{direction:n,initialSize:null!=d?d:.5,primaryPaneStyles:s,secondaryPaneStyles:l},o().createElement(u,{key:t.state.key,model:t,parentState:e.state}),c&&r&&o().createElement(c,{key:r.state.key,model:r,parentState:e.state}))};var nc=r(8398);new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);try{window.__reactRouterVersion="6"}catch(e){}new Map;a.startTransition,nc.flushSync,a.useId;"undefined"!=typeof window&&void 0!==window.document&&window.document.createElement;var ic,ac;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(ic||(ic={})),function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(ac||(ac={}));(class extends ee{enrichDataRequest(){return{app:this.state.name||"app"}}}).Component=({model:e})=>{const{pages:t}=e.useState();return o().createElement(i.Switch,null,t.map((e=>o().createElement(s.Route,{key:e.state.url,exact:!1,path:e.state.url,render:t=>v(e,t)}))))};var oc=Object.defineProperty,sc=Object.getOwnPropertySymbols,lc=Object.prototype.hasOwnProperty,uc=Object.prototype.propertyIsEnumerable,cc=(e,t,r)=>t in e?oc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;class dc extends ee{}function hc({node:e}){const t=e.useState(),r=(0,sr.useStyles2)(pc);return o().createElement("div",{className:r.container},Object.keys(t).map((n=>o().createElement("div",{className:r.row,key:n},o().createElement("div",{className:r.keyName},n),o().createElement("div",{className:r.value},function(e,t,r){if(null===t)return"null";switch(typeof t){case"number":return o().createElement(sr.Input,{type:"number",defaultValue:t,onBlur:t=>r.setState({[e]:t.currentTarget.valueAsNumber})});case"string":return o().createElement(sr.Input,{type:"text",defaultValue:t,onBlur:t=>r.setState({[e]:t.currentTarget.value})});case"object":return st(t)?t.constructor.name:(0,pe.isPlainObject)(t)||(0,pe.isArray)(t)?o().createElement(sr.JSONFormatter,{json:t,open:0}):String(t);default:return typeof t}}(n,t[n],e))))))}function pc(e){return{container:(0,cr.css)({flexGrow:1,display:"flex",gap:e.spacing(.5),flexDirection:"column"}),row:(0,cr.css)({display:"flex",gap:e.spacing(2)}),keyName:(0,cr.css)({display:"flex",flexGrow:"0",width:120,alignItems:"center",height:e.spacing(e.components.height.md)}),value:(0,cr.css)({flexGrow:1,minHeight:e.spacing(e.components.height.md),display:"flex",alignItems:"center"})}}function fc({node:e,selectedObject:t,onSelect:r}){const n=(0,sr.useStyles2)(mc),i=[],a=e===t;return e.forEachChild((e=>{i.push(o().createElement(fc,{node:e,key:e.state.key,selectedObject:t,onSelect:r}))})),o().createElement("div",{className:n.container},o().createElement("div",{className:(0,cr.cx)(n.name,a&&n.selected),onClick:()=>r(e)},e.constructor.name),o().createElement("div",{className:n.children},i))}function mc(e){return{container:(0,cr.css)({flexGrow:1,display:"flex",gap:e.spacing(.5),flexDirection:"column"}),name:(0,cr.css)({flexGrow:1,display:"flex",gap:e.spacing(1),fontSize:e.typography.bodySmall.fontSize,cursor:"pointer",padding:e.spacing(0,1),borderRadius:e.shape.borderRadius(2),position:"relative","&:hover":{background:e.colors.background.secondary}}),selected:(0,cr.css)({"&::before":{display:"block",content:"' '",position:"absolute",left:0,width:4,bottom:2,top:2,borderRadius:e.shape.radius.default,backgroundImage:e.colors.gradients.brandVertical}}),children:(0,cr.css)({flexGrow:1,display:"flex",flexDirection:"column",paddingLeft:e.spacing(1)})}}function gc({scene:e}){const t=(0,sr.useStyles2)(vc),[r,n]=(0,a.useState)(!1),[i,s]=(0,a.useState)();return o().createElement(o().Fragment,null,o().createElement(sr.ToolbarButton,{variant:"canvas",icon:"bug",onClick:()=>n(!0)}),r&&o().createElement(sr.Drawer,{title:"Scene debugger",onClose:()=>n(!1),size:"lg"},o().createElement("div",{className:t.panes},o().createElement("div",{className:t.pane1},o().createElement("div",{className:t.paneHeading},"Scene graph"),o().createElement(sr.CustomScrollbar,{autoHeightMin:"100%"},o().createElement("div",{className:t.treeWrapper},o().createElement(fc,{node:e,selectedObject:i,onSelect:s})))),o().createElement("div",{className:t.pane2},o().createElement("div",{className:t.paneHeading},"Object details"),i&&o().createElement(hc,{node:i})))))}function vc(e){return{panes:(0,cr.css)({flexGrow:1,display:"flex",height:"100%",flexDirection:"row",marginTop:e.spacing(-2)}),pane1:(0,cr.css)({flexGrow:0,display:"flex",height:"100%",flexDirection:"column",borderRight:`1px solid ${e.colors.border.weak}`}),pane2:(0,cr.css)({flexGrow:1,display:"flex",minHeight:"100%",flexDirection:"column",paddingLeft:e.spacing(2)}),treeWrapper:(0,cr.css)({paddingRight:e.spacing(2),height:"100%",marginLeft:e.spacing(-1)}),paneHeading:(0,cr.css)({padding:e.spacing(1,0),fontWeight:e.typography.fontWeightMedium})}}function yc({page:e,routeProps:t}){const r=function(e){if(e.parent instanceof Sc)return e.parent;return e}(e),n=r.useState(),i=function(){const e=(0,s.useLocation)();return(0,u.locationSearchToObject)(e.search||"")}(),l=e.getScene(t.match),c=n.initializedScene===l;if((0,a.useLayoutEffect)((()=>{c||r.initializeScene(l)}),[l,r,c]),(0,a.useEffect)((()=>()=>r.setState({initializedScene:void 0})),[r]),!c)return null;const d={text:n.title,img:n.titleImg,icon:n.titleIcon,url:g(n.url,n.preserveUrlKeys),hideFromBreadcrumbs:n.hideFromBreadcrumbs,parentItem:bc(n.getParentPage?n.getParentPage():r.parent)};n.tabs&&(d.children=n.tabs.map((t=>({text:t.state.title,icon:t.state.titleIcon,tabSuffix:t.state.tabSuffix,active:e===t,url:g(t.state.url,t.state.preserveUrlKeys),parentItem:d}))));let h=[];return n.controls&&(h=n.controls.map((e=>o().createElement(e.Component,{model:e,key:e.state.key})))),i["scene-debugger"]&&h.push(o().createElement(gc,{scene:r,key:"scene-debugger"})),o().createElement(u.PluginPage,{pageNav:d,actions:h,renderTitle:n.renderTitle,subTitle:n.subTitle},o().createElement(l.Component,{model:l}))}function bc(e,t){if(e instanceof Sc)return{text:e.state.title,url:g(e.state.url,e.state.preserveUrlKeys),hideFromBreadcrumbs:e.state.hideFromBreadcrumbs,parentItem:bc(e.state.getParentPage?e.state.getParentPage():e.parent)}}function wc({drilldown:e,parent:t,routeProps:r}){return v(t.getDrilldownPage(e,r.match),r)}dc.Component=({model:e})=>{const{component:t,props:r,reactNode:n}=e.useState();return t?o().createElement(t,((e,t)=>{for(var r in t||(t={}))lc.call(t,r)&&cc(e,r,t[r]);if(sc)for(var r of sc(t))uc.call(t,r)&&cc(e,r,t[r]);return e})({},r)):n||null};class Sc extends ee{constructor(e){super(e),this._sceneCache=new Map,this._drilldownCache=new Map,this.addActivationHandler((()=>()=>Ns().cleanUp(this)))}initializeScene(e){this.setState({initializedScene:e}),Ns().initSync(this)}getScene(e){let t=this._sceneCache.get(e.url);if(t)return t;if(!this.state.getScene)throw new Error("Missing getScene on SceneAppPage "+this.state.title);return t=this.state.getScene(e),this._sceneCache.set(e.url,t),t}getDrilldownPage(e,t){let r=this._drilldownCache.get(t.url);return r||(r=e.getPage(t,this),this._drilldownCache.set(t.url,r),r)}enrichDataRequest(e){if(this.state.getParentPage)return this.state.getParentPage().enrichDataRequest(e);if(!this.parent)return null;const t=this.getRoot();return lt(t)?t.enrichDataRequest(e):null}}Sc.Component=function({model:e,routeProps:t}){var r,n;const{tabs:a,drilldowns:l}=e.useState(),u=[];if(a&&a.length>0)for(let t=0;tv(i,e)})),u.push(o().createElement(s.Route,{exact:!0,key:i.state.url,path:null!=(n=i.state.routePath)?n:i.state.url,render:e=>v(i,e)})),i.state.drilldowns)for(const e of i.state.drilldowns)u.push(o().createElement(s.Route,{exact:!1,key:e.routePath,path:e.routePath,render:t=>o().createElement(wc,{drilldown:e,parent:i,routeProps:t})}))}if(l)for(const t of l)u.push(o().createElement(s.Route,{key:t.routePath,exact:!1,path:t.routePath,render:r=>o().createElement(wc,{drilldown:t,parent:e,routeProps:r})}));if(!a&&function(e,t){if(!t.isExact)return!1;if(t.url===e.state.url)return!0;if(e.parent instanceof Sc&&e.parent.state.tabs[0]===e&&e.parent.state.url===t.url)return!0;return!1}(e,t.match))return o().createElement(yc,{page:e,routeProps:t});return u.push(function(e,t){return o().createElement(s.Route,{key:"fallback route",render:r=>{var n,i,a;const s=null!=(a=null==(i=(n=e.state).getFallbackPage)?void 0:i.call(n))?a:new Sc({url:"",title:"Not found",subTitle:"The url did not match any page",getScene:()=>new Fs({body:new ju({direction:"column",children:[new Iu({body:new dc({component:()=>o().createElement("div",{"data-testid":"default-fallback-content"},"If you found your way here using a link then there might be a bug in this application.")})})]})})});return o().createElement(yc,{page:s,routeProps:t})}})}(e,t)),o().createElement(i.Switch,null,u)};var xc=(e=>(e.Always="always",e.Auto="auto",e.Never="never",e))(xc||{}),Oc=(e=>(e.Hue="hue",e.None="none",e.Opacity="opacity",e.Scheme="scheme",e))(Oc||{}),_c=(e=>(e.None="none",e.Normal="normal",e.Percent="percent",e))(_c||{}),Ec=(e=>(e.Auto="auto",e.Horizontal="horizontal",e.Vertical="vertical",e))(Ec||{}),kc=(e=>(e.Background="background",e.BackgroundSolid="background_solid",e.None="none",e.Value="value",e))(kc||{}),Cc=(e=>(e.Area="area",e.Line="line",e.None="none",e))(Cc||{}),Tc=(e=>(e.Auto="auto",e.Center="center",e))(Tc||{}),Ac=(e=>(e.Auto="auto",e.Name="name",e.None="none",e.Value="value",e.ValueAndName="value_and_name",e))(Ac||{}),Rc=(e=>(e.Inverted="inverted",e.SameAsValue="same_as_value",e.Standard="standard",e))(Rc||{}),Dc=(e=>(e.Multi="multi",e.None="none",e.Single="single",e))(Dc||{}),Pc=(e=>(e.Basic="basic",e.Gradient="gradient",e.Lcd="lcd",e))(Pc||{}),jc=(e=>(e.Color="color",e.Hidden="hidden",e.Text="text",e))(jc||{}),Ic=(e=>(e.Auto="auto",e.Hidden="hidden",e.Left="left",e.Top="top",e))(Ic||{}),Lc=(e=>(e.Auto="auto",e.Manual="manual",e))(Lc||{}),Mc=(e=>(e.Auto="auto",e.Lg="lg",e.Md="md",e.Sm="sm",e))(Mc||{});const Nc={barRadius:0,barWidth:.97,fullHighlight:!1,groupWidth:.7,orientation:Ec.Auto,showValue:xc.Auto,stacking:_c.None,xTickLabelRotation:0,xTickLabelSpacing:0},Fc={fillOpacity:80,gradientMode:Oc.None,lineWidth:1},Vc={displayMode:Pc.Gradient,maxVizHeight:300,minVizHeight:16,minVizWidth:8,namePlacement:Ic.Auto,showUnfilled:!0,sizing:Lc.Auto,valueMode:jc.Color},zc={selectedSeries:0},Bc={minVizHeight:75,minVizWidth:75,showThresholdLabels:!1,showThresholdMarkers:!0,sizing:Lc.Auto},$c={layers:[]};const Uc={calculate:!1,cellGap:1,cellValues:{},color:{scheme:"Oranges",fill:"dark-orange",reverse:!1,exponent:.5,steps:64},exemplars:{color:"rgba(255,0,255,0.7)"},filterValues:{le:1e-9},legend:{show:!0},selectionMode:"x",showValue:xc.Auto,tooltip:{mode:Dc.Single,yHistogram:!1,showColorScale:!1}},qc={bucketCount:30,bucketOffset:0},Hc={fillOpacity:80,gradientMode:Oc.None,lineWidth:1},Wc={showImage:!0};const Gc={displayLabels:[]},Qc={colorMode:kc.Value,graphMode:Cc.Area,justifyMode:Tc.Auto,percentChangeColorMode:Rc.Standard,showPercentChange:!1,textMode:Ac.Auto,wideLayout:!0},Kc={alignValue:"left",mergeValues:!0,perPage:20,rowHeight:.9,showValue:xc.Auto},Xc={fillOpacity:70,lineWidth:0},Jc={colWidth:.9,perPage:20,rowHeight:.9,showValue:xc.Auto},Yc={fillOpacity:70,lineWidth:1},Zc={cellHeight:Mc.Sm,footer:{show:!1,countRows:!1,reducer:[]},frameIndex:0,showHeader:!0,showTypeIcons:!1,sortBy:[]};const ed={content:"# Title\n\nFor markdown syntax help: [commonmark.org/help](https://commonmark.org/help/)",mode:"markdown"};const td={fillOpacity:50,show:"points"},rd={series:[]};class nd{constructor(){this._overrides=[]}overrideColor(e){return this._overrides[this._overrides.length-1].properties.push({id:"color",value:e}),this}overrideDecimals(e){return this._overrides[this._overrides.length-1].properties.push({id:"decimals",value:e}),this}overrideDisplayName(e){return this._overrides[this._overrides.length-1].properties.push({id:"displayName",value:e}),this}overrideFilterable(e){return this._overrides[this._overrides.length-1].properties.push({id:"filterable",value:e}),this}overrideLinks(e){return this._overrides[this._overrides.length-1].properties.push({id:"links",value:e}),this}overrideMappings(e){return this._overrides[this._overrides.length-1].properties.push({id:"mappings",value:e}),this}overrideMax(e){return this._overrides[this._overrides.length-1].properties.push({id:"max",value:e}),this}overrideMin(e){return this._overrides[this._overrides.length-1].properties.push({id:"min",value:e}),this}overrideNoValue(e){return this._overrides[this._overrides.length-1].properties.push({id:"noValue",value:e}),this}overrideThresholds(e){return this._overrides[this._overrides.length-1].properties.push({id:"thresholds",value:e}),this}overrideUnit(e){return this._overrides[this._overrides.length-1].properties.push({id:"unit",value:e}),this}}class id extends nd{match(e){return this._overrides.push({matcher:e,properties:[]}),this}matchFieldsWithName(e){return this._overrides.push({matcher:{id:l.FieldMatcherID.byName,options:e},properties:[]}),this}matchFieldsWithNameByRegex(e){return this._overrides.push({matcher:{id:l.FieldMatcherID.byRegexp,options:e},properties:[]}),this}matchFieldsByType(e){return this._overrides.push({matcher:{id:l.FieldMatcherID.byType,options:e},properties:[]}),this}matchFieldsByQuery(e){return this._overrides.push({matcher:{id:l.FieldMatcherID.byFrameRefID,options:e},properties:[]}),this}matchFieldsByValue(e){return this._overrides.push({matcher:{id:l.FieldMatcherID.byValue,options:e},properties:[]}),this}matchComparisonQuery(e){return this.matchFieldsByQuery(mu(e))}overrideCustomFieldConfig(e,t){const r=`custom.${String(e)}`;return this._overrides[this._overrides.length-1].properties.push({id:r,value:t}),this}build(){return this._overrides}}var ad=Object.defineProperty,od=Object.defineProperties,sd=Object.getOwnPropertyDescriptors,ld=Object.getOwnPropertySymbols,ud=Object.prototype.hasOwnProperty,cd=Object.prototype.propertyIsEnumerable,dd=(e,t,r)=>t in e?ad(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,hd=(e,t)=>{for(var r in t||(t={}))ud.call(t,r)&&dd(e,r,t[r]);if(ld)for(var r of ld(t))cd.call(t,r)&&dd(e,r,t[r]);return e},pd=(e,t)=>od(e,sd(t));class fd{constructor(e){this.defaultFieldConfig=e,this._fieldConfig={defaults:{},overrides:[]},this._overridesBuilder=new id,this.setDefaults()}setDefaults(){const e={defaults:{custom:this.defaultFieldConfig?(0,pe.cloneDeep)(this.defaultFieldConfig()):{}},overrides:[]};this._fieldConfig=e}setColor(e){return this.setFieldConfigDefaults("color",e)}setDecimals(e){return this.setFieldConfigDefaults("decimals",e)}setDisplayName(e){return this.setFieldConfigDefaults("displayName",e)}setFilterable(e){return this.setFieldConfigDefaults("filterable",e)}setLinks(e){return this.setFieldConfigDefaults("links",e)}setMappings(e){return this.setFieldConfigDefaults("mappings",e)}setMax(e){return this.setFieldConfigDefaults("max",e)}setMin(e){return this.setFieldConfigDefaults("min",e)}setNoValue(e){return this.setFieldConfigDefaults("noValue",e)}setThresholds(e){return this.setFieldConfigDefaults("thresholds",e)}setUnit(e){return this.setFieldConfigDefaults("unit",e)}setCustomFieldConfig(e,t){return this._fieldConfig.defaults=pd(hd({},this._fieldConfig.defaults),{custom:(0,pe.merge)(this._fieldConfig.defaults.custom,{[e]:t})}),this}setOverrides(e){return e(this._overridesBuilder),this}setFieldConfigDefaults(e,t){return this._fieldConfig.defaults=pd(hd({},this._fieldConfig.defaults),{[e]:t}),this}build(){return{defaults:this._fieldConfig.defaults,overrides:this._overridesBuilder.build()}}}class md{constructor(e){this.defaultOptions=e,this._options={},this.setDefaults()}setDefaults(){this._options=this.defaultOptions?(0,pe.cloneDeep)(this.defaultOptions()):{}}setOption(e,t){return this._options=(0,pe.merge)(this._options,{[e]:t}),this}build(){return this._options}}var gd=Object.defineProperty,vd=Object.defineProperties,yd=Object.getOwnPropertyDescriptors,bd=Object.getOwnPropertySymbols,wd=Object.prototype.hasOwnProperty,Sd=Object.prototype.propertyIsEnumerable,xd=(e,t,r)=>t in e?gd(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;class Od{constructor(e,t,r,n){this._state={},this._state.title="",this._state.description="",this._state.displayMode="default",this._state.hoverHeader=!1,this._state.pluginId=e,this._state.pluginVersion=t,this._fieldConfigBuilder=new fd(n),this._panelOptionsBuilder=new md(r)}setTitle(e){return this._state.title=e,this}setDescription(e){return this._state.description=e,this}setDisplayMode(e){return this._state.displayMode=e,this}setHoverHeader(e){return this._state.hoverHeader=e,this}setMenu(e){return this._state.menu=e,this}setHeaderActions(e){return this._state.headerActions=e,this}setColor(e){return this._fieldConfigBuilder.setColor(e),this}setDecimals(e){return this._fieldConfigBuilder.setDecimals(e),this}setDisplayName(e){return this._fieldConfigBuilder.setDisplayName(e),this}setFilterable(e){return this._fieldConfigBuilder.setFilterable(e),this}setLinks(e){return this._fieldConfigBuilder.setLinks(e),this}setMappings(e){return this._fieldConfigBuilder.setMappings(e),this}setMax(e){return this._fieldConfigBuilder.setMax(e),this}setMin(e){return this._fieldConfigBuilder.setMin(e),this}setNoValue(e){return this._fieldConfigBuilder.setNoValue(e),this}setThresholds(e){return this._fieldConfigBuilder.setThresholds(e),this}setUnit(e){return this._fieldConfigBuilder.setUnit(e),this}setCustomFieldConfig(e,t){return this._fieldConfigBuilder.setCustomFieldConfig(e,t),this}setOverrides(e){return this._fieldConfigBuilder.setOverrides(e),this}setOption(e,t){return this._panelOptionsBuilder.setOption(e,t),this}setData(e){return this._state.$data=e,this}setTimeRange(e){return this._state.$timeRange=e,this}setVariables(e){return this._state.$variables=e,this}setBehaviors(e){return this._state.$behaviors=e,this}build(){const e=new Bi((t=((e,t)=>{for(var r in t||(t={}))wd.call(t,r)&&xd(e,r,t[r]);if(bd)for(var r of bd(t))Sd.call(t,r)&&xd(e,r,t[r]);return e})({},this._state),r={options:this._panelOptionsBuilder.build(),fieldConfig:this._fieldConfigBuilder.build()},vd(t,yd(r))));var t,r;return e}}const _d={barchart:()=>new Od("barchart","10.0.0",(()=>Nc),(()=>Fc)),bargauge:()=>new Od("bargauge","10.0.0",(()=>Vc)),datagrid:()=>new Od("datagrid","10.0.0",(()=>zc)),flamegraph:()=>new Od("flamegraph","10.0.0"),gauge:()=>new Od("gauge","10.0.0",(()=>Bc)),geomap:()=>new Od("geomap","10.0.0",(()=>$c)),heatmap:()=>new Od("heatmap","10.0.0",(()=>Uc)),histogram:()=>new Od("histogram","10.0.0",(()=>qc),(()=>Hc)),logs:()=>new Od("logs","10.0.0"),news:()=>new Od("news","10.0.0",(()=>Wc)),nodegraph:()=>new Od("nodeGraph","10.0.0"),piechart:()=>new Od("piechart","10.0.0",(()=>Gc)),stat:()=>new Od("stat","10.0.0",(()=>Qc)),statetimeline:()=>new Od("state-timeline","10.0.0",(()=>Kc),(()=>Xc)),statushistory:()=>new Od("status-history","10.0.0",(()=>Jc),(()=>Yc)),table:()=>new Od("table","10.0.0",(()=>Zc)),text:()=>new Od("text","10.0.0",(()=>ed)),timeseries:()=>new Od("timeseries","10.0.0"),trend:()=>new Od("trend","10.0.0"),traces:()=>new Od("traces","10.0.0"),xychart:()=>new Od("xychart","10.0.0",(()=>rd),(()=>td))};const Ed={getUrlWithAppState:g,registerRuntimePanelPlugin:function({pluginId:e,plugin:t}){if(E.has(e))throw new Error(`A runtime panel plugin with id ${e} has already been registered`);var r;t.meta=(r=((e,t)=>{for(var r in t||(t={}))x.call(t,r)&&_(e,r,t[r]);if(S)for(var r of S(t))O.call(t,r)&&_(e,r,t[r]);return e})({},t.meta),b(r,w({id:e,name:e,module:"runtime plugin",baseUrl:"runtime plugin",info:{author:{name:"Runtime plugin "+e},description:"",links:[],logos:{large:"",small:""},screenshots:[],updated:"",version:""}}))),E.set(e,t)},registerRuntimeDataSource:function({dataSource:e}){if(he.has(e.uid))throw new Error(`A runtime data source with uid ${e.uid} has already been registered`);he.set(e.uid,e)},registerVariableMacro:function(e,t){if(Ct.get(e))throw new Error(`Macro already registered ${e}`);return Ct.set(e,t),()=>{Ct.delete(e)}},cloneSceneObjectState:ue,syncStateFromSearchParams:function(e,t){const r=new fe;r.rebuildIndex(e),ge(e,t,r)},getUrlState:me,renderPrometheusLabelFilters:Rn,isAdHocVariable:function(e){return"adhoc"===e.state.type},isConstantVariable:function(e){return"constant"===e.state.type},isCustomVariable:function(e){return"custom"===e.state.type},isDataSourceVariable:function(e){return"datasource"===e.state.type},isIntervalVariable:function(e){return"interval"===e.state.type},isQueryVariable:function(e){return"query"===e.state.type},isTextBoxVariable:function(e){return"textbox"===e.state.type},isGroupByVariable:function(e){return"groupby"===e.state.type}}},6233:e=>{"use strict";e.exports=function(e,t){var r=new Array(arguments.length-1),n=0,i=2,a=!0;for(;i{"use strict";var r=t;r.length=function(e){var t=e.length;if(!t)return 0;for(var r=0;--t%4>1&&"="===e.charAt(t);)++r;return Math.ceil(3*e.length)/4-r};for(var n=new Array(64),i=new Array(123),a=0;a<64;)i[n[a]=a<26?a+65:a<52?a+71:a<62?a-4:a-59|43]=a++;r.encode=function(e,t,r){for(var i,a=null,o=[],s=0,l=0;t>2],i=(3&u)<<4,l=1;break;case 1:o[s++]=n[i|u>>4],i=(15&u)<<2,l=2;break;case 2:o[s++]=n[i|u>>6],o[s++]=n[63&u],l=0}s>8191&&((a||(a=[])).push(String.fromCharCode.apply(String,o)),s=0)}return l&&(o[s++]=n[i],o[s++]=61,1===l&&(o[s++]=61)),a?(s&&a.push(String.fromCharCode.apply(String,o.slice(0,s))),a.join("")):String.fromCharCode.apply(String,o.slice(0,s))};var o="invalid encoding";r.decode=function(e,t,r){for(var n,a=r,s=0,l=0;l1)break;if(void 0===(u=i[u]))throw Error(o);switch(s){case 0:n=u,s=1;break;case 1:t[r++]=n<<2|(48&u)>>4,n=u,s=2;break;case 2:t[r++]=(15&n)<<4|(60&u)>>2,n=u,s=3;break;case 3:t[r++]=(3&n)<<6|u,s=0}}if(1===s)throw Error(o);return r-a},r.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},7669:e=>{"use strict";function t(e,r){"string"==typeof e&&(r=e,e=void 0);var n=[];function i(e){if("string"!=typeof e){var r=a();if(t.verbose,r="return "+r,e){for(var o=Object.keys(e),s=new Array(o.length+1),l=new Array(o.length),u=0;u{"use strict";function t(){this._listeners={}}e.exports=t,t.prototype.on=function(e,t,r){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:r||this}),this},t.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var r=this._listeners[e],n=0;n{"use strict";e.exports=a;var n=r(6233),i=r(1925)("fs");function a(e,t,r){return"function"==typeof t?(r=t,t={}):t||(t={}),r?!t.xhr&&i&&i.readFile?i.readFile(e,(function(n,i){return n&&"undefined"!=typeof XMLHttpRequest?a.xhr(e,t,r):n?r(n):r(null,t.binary?i:i.toString("utf8"))})):a.xhr(e,t,r):n(a,this,e,t)}a.xhr=function(e,t,r){var n=new XMLHttpRequest;n.onreadystatechange=function(){if(4===n.readyState){if(0!==n.status&&200!==n.status)return r(Error("status "+n.status));if(t.binary){var e=n.response;if(!e){e=[];for(var i=0;i{"use strict";function t(e){return"undefined"!=typeof Float32Array?function(){var t=new Float32Array([-0]),r=new Uint8Array(t.buffer),n=128===r[3];function i(e,n,i){t[0]=e,n[i]=r[0],n[i+1]=r[1],n[i+2]=r[2],n[i+3]=r[3]}function a(e,n,i){t[0]=e,n[i]=r[3],n[i+1]=r[2],n[i+2]=r[1],n[i+3]=r[0]}function o(e,n){return r[0]=e[n],r[1]=e[n+1],r[2]=e[n+2],r[3]=e[n+3],t[0]}function s(e,n){return r[3]=e[n],r[2]=e[n+1],r[1]=e[n+2],r[0]=e[n+3],t[0]}e.writeFloatLE=n?i:a,e.writeFloatBE=n?a:i,e.readFloatLE=n?o:s,e.readFloatBE=n?s:o}():function(){function t(e,t,r,n){var i=t<0?1:0;if(i&&(t=-t),0===t)e(1/t>0?0:2147483648,r,n);else if(isNaN(t))e(2143289344,r,n);else if(t>34028234663852886e22)e((i<<31|2139095040)>>>0,r,n);else if(t<11754943508222875e-54)e((i<<31|Math.round(t/1401298464324817e-60))>>>0,r,n);else{var a=Math.floor(Math.log(t)/Math.LN2);e((i<<31|a+127<<23|8388607&Math.round(t*Math.pow(2,-a)*8388608))>>>0,r,n)}}function o(e,t,r){var n=e(t,r),i=2*(n>>31)+1,a=n>>>23&255,o=8388607&n;return 255===a?o?NaN:i*(1/0):0===a?1401298464324817e-60*i*o:i*Math.pow(2,a-150)*(o+8388608)}e.writeFloatLE=t.bind(null,r),e.writeFloatBE=t.bind(null,n),e.readFloatLE=o.bind(null,i),e.readFloatBE=o.bind(null,a)}(),"undefined"!=typeof Float64Array?function(){var t=new Float64Array([-0]),r=new Uint8Array(t.buffer),n=128===r[7];function i(e,n,i){t[0]=e,n[i]=r[0],n[i+1]=r[1],n[i+2]=r[2],n[i+3]=r[3],n[i+4]=r[4],n[i+5]=r[5],n[i+6]=r[6],n[i+7]=r[7]}function a(e,n,i){t[0]=e,n[i]=r[7],n[i+1]=r[6],n[i+2]=r[5],n[i+3]=r[4],n[i+4]=r[3],n[i+5]=r[2],n[i+6]=r[1],n[i+7]=r[0]}function o(e,n){return r[0]=e[n],r[1]=e[n+1],r[2]=e[n+2],r[3]=e[n+3],r[4]=e[n+4],r[5]=e[n+5],r[6]=e[n+6],r[7]=e[n+7],t[0]}function s(e,n){return r[7]=e[n],r[6]=e[n+1],r[5]=e[n+2],r[4]=e[n+3],r[3]=e[n+4],r[2]=e[n+5],r[1]=e[n+6],r[0]=e[n+7],t[0]}e.writeDoubleLE=n?i:a,e.writeDoubleBE=n?a:i,e.readDoubleLE=n?o:s,e.readDoubleBE=n?s:o}():function(){function t(e,t,r,n,i,a){var o=n<0?1:0;if(o&&(n=-n),0===n)e(0,i,a+t),e(1/n>0?0:2147483648,i,a+r);else if(isNaN(n))e(0,i,a+t),e(2146959360,i,a+r);else if(n>17976931348623157e292)e(0,i,a+t),e((o<<31|2146435072)>>>0,i,a+r);else{var s;if(n<22250738585072014e-324)e((s=n/5e-324)>>>0,i,a+t),e((o<<31|s/4294967296)>>>0,i,a+r);else{var l=Math.floor(Math.log(n)/Math.LN2);1024===l&&(l=1023),e(4503599627370496*(s=n*Math.pow(2,-l))>>>0,i,a+t),e((o<<31|l+1023<<20|1048576*s&1048575)>>>0,i,a+r)}}}function o(e,t,r,n,i){var a=e(n,i+t),o=e(n,i+r),s=2*(o>>31)+1,l=o>>>20&2047,u=4294967296*(1048575&o)+a;return 2047===l?u?NaN:s*(1/0):0===l?5e-324*s*u:s*Math.pow(2,l-1075)*(u+4503599627370496)}e.writeDoubleLE=t.bind(null,r,0,4),e.writeDoubleBE=t.bind(null,n,4,0),e.readDoubleLE=o.bind(null,i,0,4),e.readDoubleBE=o.bind(null,a,4,0)}(),e}function r(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}function n(e,t,r){t[r]=e>>>24,t[r+1]=e>>>16&255,t[r+2]=e>>>8&255,t[r+3]=255&e}function i(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function a(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=t(t)},1925:module=>{"use strict";function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}module.exports=inquire},2459:(e,t)=>{"use strict";var r=t,n=r.isAbsolute=function(e){return/^(?:\/|\w+:)/.test(e)},i=r.normalize=function(e){var t=(e=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/")).split("/"),r=n(e),i="";r&&(i=t.shift()+"/");for(var a=0;a0&&".."!==t[a-1]?t.splice(--a,2):r?t.splice(a,1):++a:"."===t[a]?t.splice(a,1):++a;return i+t.join("/")};r.resolve=function(e,t,r){return r||(t=i(t)),n(t)?t:(r||(e=i(e)),(e=e.replace(/(?:\/|^)[^/]+$/,"")).length?i(e+"/"+t):t)}},4226:e=>{"use strict";e.exports=function(e,t,r){var n=r||8192,i=n>>>1,a=null,o=n;return function(r){if(r<1||r>i)return e(r);o+r>n&&(a=e(n),o=0);var s=t.call(a,o,o+=r);return 7&o&&(o=1+(7|o)),s}}},2971:(e,t)=>{"use strict";var r=t;r.length=function(e){for(var t=0,r=0,n=0;n191&&n<224?a[o++]=(31&n)<<6|63&e[t++]:n>239&&n<365?(n=((7&n)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,a[o++]=55296+(n>>10),a[o++]=56320+(1023&n)):a[o++]=(15&n)<<12|(63&e[t++])<<6|63&e[t++],o>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,a)),o=0);return i?(o&&i.push(String.fromCharCode.apply(String,a.slice(0,o))),i.join("")):String.fromCharCode.apply(String,a.slice(0,o))},r.write=function(e,t,r){for(var n,i,a=r,o=0;o>6|192,t[r++]=63&n|128):55296==(64512&n)&&56320==(64512&(i=e.charCodeAt(o+1)))?(n=65536+((1023&n)<<10)+(1023&i),++o,t[r++]=n>>18|240,t[r++]=n>>12&63|128,t[r++]=n>>6&63|128,t[r++]=63&n|128):(t[r++]=n>>12|224,t[r++]=n>>6&63|128,t[r++]=63&n|128);return r-a}},7951:(e,t,r)=>{const n=r(2880),i={};for(const e of Object.keys(n))i[n[e]]=e;const a={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};e.exports=a;for(const e of Object.keys(a)){if(!("channels"in a[e]))throw new Error("missing channels property: "+e);if(!("labels"in a[e]))throw new Error("missing channel labels property: "+e);if(a[e].labels.length!==a[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:t,labels:r}=a[e];delete a[e].channels,delete a[e].labels,Object.defineProperty(a[e],"channels",{value:t}),Object.defineProperty(a[e],"labels",{value:r})}a.rgb.hsl=function(e){const t=e[0]/255,r=e[1]/255,n=e[2]/255,i=Math.min(t,r,n),a=Math.max(t,r,n),o=a-i;let s,l;a===i?s=0:t===a?s=(r-n)/o:r===a?s=2+(n-t)/o:n===a&&(s=4+(t-r)/o),s=Math.min(60*s,360),s<0&&(s+=360);const u=(i+a)/2;return l=a===i?0:u<=.5?o/(a+i):o/(2-a-i),[s,100*l,100*u]},a.rgb.hsv=function(e){let t,r,n,i,a;const o=e[0]/255,s=e[1]/255,l=e[2]/255,u=Math.max(o,s,l),c=u-Math.min(o,s,l),d=function(e){return(u-e)/6/c+.5};return 0===c?(i=0,a=0):(a=c/u,t=d(o),r=d(s),n=d(l),o===u?i=n-r:s===u?i=1/3+t-n:l===u&&(i=2/3+r-t),i<0?i+=1:i>1&&(i-=1)),[360*i,100*a,100*u]},a.rgb.hwb=function(e){const t=e[0],r=e[1];let n=e[2];const i=a.rgb.hsl(e)[0],o=1/255*Math.min(t,Math.min(r,n));return n=1-1/255*Math.max(t,Math.max(r,n)),[i,100*o,100*n]},a.rgb.cmyk=function(e){const t=e[0]/255,r=e[1]/255,n=e[2]/255,i=Math.min(1-t,1-r,1-n);return[100*((1-t-i)/(1-i)||0),100*((1-r-i)/(1-i)||0),100*((1-n-i)/(1-i)||0),100*i]},a.rgb.keyword=function(e){const t=i[e];if(t)return t;let r,a=1/0;for(const t of Object.keys(n)){const i=n[t],l=(s=i,((o=e)[0]-s[0])**2+(o[1]-s[1])**2+(o[2]-s[2])**2);l.04045?((t+.055)/1.055)**2.4:t/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92;return[100*(.4124*t+.3576*r+.1805*n),100*(.2126*t+.7152*r+.0722*n),100*(.0193*t+.1192*r+.9505*n)]},a.rgb.lab=function(e){const t=a.rgb.xyz(e);let r=t[0],n=t[1],i=t[2];r/=95.047,n/=100,i/=108.883,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;return[116*n-16,500*(r-n),200*(n-i)]},a.hsl.rgb=function(e){const t=e[0]/360,r=e[1]/100,n=e[2]/100;let i,a,o;if(0===r)return o=255*n,[o,o,o];i=n<.5?n*(1+r):n+r-n*r;const s=2*n-i,l=[0,0,0];for(let e=0;e<3;e++)a=t+1/3*-(e-1),a<0&&a++,a>1&&a--,o=6*a<1?s+6*(i-s)*a:2*a<1?i:3*a<2?s+(i-s)*(2/3-a)*6:s,l[e]=255*o;return l},a.hsl.hsv=function(e){const t=e[0];let r=e[1]/100,n=e[2]/100,i=r;const a=Math.max(n,.01);n*=2,r*=n<=1?n:2-n,i*=a<=1?a:2-a;return[t,100*(0===n?2*i/(a+i):2*r/(n+r)),100*((n+r)/2)]},a.hsv.rgb=function(e){const t=e[0]/60,r=e[1]/100;let n=e[2]/100;const i=Math.floor(t)%6,a=t-Math.floor(t),o=255*n*(1-r),s=255*n*(1-r*a),l=255*n*(1-r*(1-a));switch(n*=255,i){case 0:return[n,l,o];case 1:return[s,n,o];case 2:return[o,n,l];case 3:return[o,s,n];case 4:return[l,o,n];case 5:return[n,o,s]}},a.hsv.hsl=function(e){const t=e[0],r=e[1]/100,n=e[2]/100,i=Math.max(n,.01);let a,o;o=(2-r)*n;const s=(2-r)*i;return a=r*i,a/=s<=1?s:2-s,a=a||0,o/=2,[t,100*a,100*o]},a.hwb.rgb=function(e){const t=e[0]/360;let r=e[1]/100,n=e[2]/100;const i=r+n;let a;i>1&&(r/=i,n/=i);const o=Math.floor(6*t),s=1-n;a=6*t-o,1&o&&(a=1-a);const l=r+a*(s-r);let u,c,d;switch(o){default:case 6:case 0:u=s,c=l,d=r;break;case 1:u=l,c=s,d=r;break;case 2:u=r,c=s,d=l;break;case 3:u=r,c=l,d=s;break;case 4:u=l,c=r,d=s;break;case 5:u=s,c=r,d=l}return[255*u,255*c,255*d]},a.cmyk.rgb=function(e){const t=e[0]/100,r=e[1]/100,n=e[2]/100,i=e[3]/100;return[255*(1-Math.min(1,t*(1-i)+i)),255*(1-Math.min(1,r*(1-i)+i)),255*(1-Math.min(1,n*(1-i)+i))]},a.xyz.rgb=function(e){const t=e[0]/100,r=e[1]/100,n=e[2]/100;let i,a,o;return i=3.2406*t+-1.5372*r+-.4986*n,a=-.9689*t+1.8758*r+.0415*n,o=.0557*t+-.204*r+1.057*n,i=i>.0031308?1.055*i**(1/2.4)-.055:12.92*i,a=a>.0031308?1.055*a**(1/2.4)-.055:12.92*a,o=o>.0031308?1.055*o**(1/2.4)-.055:12.92*o,i=Math.min(Math.max(0,i),1),a=Math.min(Math.max(0,a),1),o=Math.min(Math.max(0,o),1),[255*i,255*a,255*o]},a.xyz.lab=function(e){let t=e[0],r=e[1],n=e[2];t/=95.047,r/=100,n/=108.883,t=t>.008856?t**(1/3):7.787*t+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,n=n>.008856?n**(1/3):7.787*n+16/116;return[116*r-16,500*(t-r),200*(r-n)]},a.lab.xyz=function(e){let t,r,n;r=(e[0]+16)/116,t=e[1]/500+r,n=r-e[2]/200;const i=r**3,a=t**3,o=n**3;return r=i>.008856?i:(r-16/116)/7.787,t=a>.008856?a:(t-16/116)/7.787,n=o>.008856?o:(n-16/116)/7.787,t*=95.047,r*=100,n*=108.883,[t,r,n]},a.lab.lch=function(e){const t=e[0],r=e[1],n=e[2];let i;i=360*Math.atan2(n,r)/2/Math.PI,i<0&&(i+=360);return[t,Math.sqrt(r*r+n*n),i]},a.lch.lab=function(e){const t=e[0],r=e[1],n=e[2]/360*2*Math.PI;return[t,r*Math.cos(n),r*Math.sin(n)]},a.rgb.ansi16=function(e,t=null){const[r,n,i]=e;let o=null===t?a.rgb.hsv(e)[2]:t;if(o=Math.round(o/50),0===o)return 30;let s=30+(Math.round(i/255)<<2|Math.round(n/255)<<1|Math.round(r/255));return 2===o&&(s+=60),s},a.hsv.ansi16=function(e){return a.rgb.ansi16(a.hsv.rgb(e),e[2])},a.rgb.ansi256=function(e){const t=e[0],r=e[1],n=e[2];if(t===r&&r===n)return t<8?16:t>248?231:Math.round((t-8)/247*24)+232;return 16+36*Math.round(t/255*5)+6*Math.round(r/255*5)+Math.round(n/255*5)},a.ansi16.rgb=function(e){let t=e%10;if(0===t||7===t)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const r=.5*(1+~~(e>50));return[(1&t)*r*255,(t>>1&1)*r*255,(t>>2&1)*r*255]},a.ansi256.rgb=function(e){if(e>=232){const t=10*(e-232)+8;return[t,t,t]}let t;e-=16;return[Math.floor(e/36)/5*255,Math.floor((t=e%36)/6)/5*255,t%6/5*255]},a.rgb.hex=function(e){const t=(((255&Math.round(e[0]))<<16)+((255&Math.round(e[1]))<<8)+(255&Math.round(e[2]))).toString(16).toUpperCase();return"000000".substring(t.length)+t},a.hex.rgb=function(e){const t=e.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!t)return[0,0,0];let r=t[0];3===t[0].length&&(r=r.split("").map((e=>e+e)).join(""));const n=parseInt(r,16);return[n>>16&255,n>>8&255,255&n]},a.rgb.hcg=function(e){const t=e[0]/255,r=e[1]/255,n=e[2]/255,i=Math.max(Math.max(t,r),n),a=Math.min(Math.min(t,r),n),o=i-a;let s,l;return s=o<1?a/(1-o):0,l=o<=0?0:i===t?(r-n)/o%6:i===r?2+(n-t)/o:4+(t-r)/o,l/=6,l%=1,[360*l,100*o,100*s]},a.hsl.hcg=function(e){const t=e[1]/100,r=e[2]/100,n=r<.5?2*t*r:2*t*(1-r);let i=0;return n<1&&(i=(r-.5*n)/(1-n)),[e[0],100*n,100*i]},a.hsv.hcg=function(e){const t=e[1]/100,r=e[2]/100,n=t*r;let i=0;return n<1&&(i=(r-n)/(1-n)),[e[0],100*n,100*i]},a.hcg.rgb=function(e){const t=e[0]/360,r=e[1]/100,n=e[2]/100;if(0===r)return[255*n,255*n,255*n];const i=[0,0,0],a=t%1*6,o=a%1,s=1-o;let l=0;switch(Math.floor(a)){case 0:i[0]=1,i[1]=o,i[2]=0;break;case 1:i[0]=s,i[1]=1,i[2]=0;break;case 2:i[0]=0,i[1]=1,i[2]=o;break;case 3:i[0]=0,i[1]=s,i[2]=1;break;case 4:i[0]=o,i[1]=0,i[2]=1;break;default:i[0]=1,i[1]=0,i[2]=s}return l=(1-r)*n,[255*(r*i[0]+l),255*(r*i[1]+l),255*(r*i[2]+l)]},a.hcg.hsv=function(e){const t=e[1]/100,r=t+e[2]/100*(1-t);let n=0;return r>0&&(n=t/r),[e[0],100*n,100*r]},a.hcg.hsl=function(e){const t=e[1]/100,r=e[2]/100*(1-t)+.5*t;let n=0;return r>0&&r<.5?n=t/(2*r):r>=.5&&r<1&&(n=t/(2*(1-r))),[e[0],100*n,100*r]},a.hcg.hwb=function(e){const t=e[1]/100,r=t+e[2]/100*(1-t);return[e[0],100*(r-t),100*(1-r)]},a.hwb.hcg=function(e){const t=e[1]/100,r=1-e[2]/100,n=r-t;let i=0;return n<1&&(i=(r-n)/(1-n)),[e[0],100*n,100*i]},a.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]},a.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]},a.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]},a.gray.hsl=function(e){return[0,0,e[0]]},a.gray.hsv=a.gray.hsl,a.gray.hwb=function(e){return[0,100,e[0]]},a.gray.cmyk=function(e){return[0,0,0,e[0]]},a.gray.lab=function(e){return[e[0],0,0]},a.gray.hex=function(e){const t=255&Math.round(e[0]/100*255),r=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".substring(r.length)+r},a.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]}},8666:(e,t,r)=>{const n=r(7951),i=r(1247),a={};Object.keys(n).forEach((e=>{a[e]={},Object.defineProperty(a[e],"channels",{value:n[e].channels}),Object.defineProperty(a[e],"labels",{value:n[e].labels});const t=i(e);Object.keys(t).forEach((r=>{const n=t[r];a[e][r]=function(e){const t=function(...t){const r=t[0];if(null==r)return r;r.length>1&&(t=r);const n=e(t);if("object"==typeof n)for(let e=n.length,t=0;t1&&(t=r),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}(n)}))})),e.exports=a},1247:(e,t,r)=>{const n=r(7951);function i(e){const t=function(){const e={},t=Object.keys(n);for(let r=t.length,n=0;n{"use strict";e.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},6250:(e,t,r)=>{var n=r(2880),i=r(6852),a=Object.hasOwnProperty,o=Object.create(null);for(var s in n)a.call(n,s)&&(o[n[s]]=s);var l=e.exports={to:{},get:{}};function u(e,t,r){return Math.min(Math.max(t,e),r)}function c(e){var t=Math.round(e).toString(16).toUpperCase();return t.length<2?"0"+t:t}l.get=function(e){var t,r;switch(e.substring(0,3).toLowerCase()){case"hsl":t=l.get.hsl(e),r="hsl";break;case"hwb":t=l.get.hwb(e),r="hwb";break;default:t=l.get.rgb(e),r="rgb"}return t?{model:r,value:t}:null},l.get.rgb=function(e){if(!e)return null;var t,r,i,o=[0,0,0,1];if(t=e.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(i=t[2],t=t[1],r=0;r<3;r++){var s=2*r;o[r]=parseInt(t.slice(s,s+2),16)}i&&(o[3]=parseInt(i,16)/255)}else if(t=e.match(/^#([a-f0-9]{3,4})$/i)){for(i=(t=t[1])[3],r=0;r<3;r++)o[r]=parseInt(t[r]+t[r],16);i&&(o[3]=parseInt(i+i,16)/255)}else if(t=e.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(r=0;r<3;r++)o[r]=parseInt(t[r+1],0);t[4]&&(t[5]?o[3]=.01*parseFloat(t[4]):o[3]=parseFloat(t[4]))}else{if(!(t=e.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(t=e.match(/^(\w+)$/))?"transparent"===t[1]?[0,0,0,0]:a.call(n,t[1])?((o=n[t[1]])[3]=1,o):null:null;for(r=0;r<3;r++)o[r]=Math.round(2.55*parseFloat(t[r+1]));t[4]&&(t[5]?o[3]=.01*parseFloat(t[4]):o[3]=parseFloat(t[4]))}for(r=0;r<3;r++)o[r]=u(o[r],0,255);return o[3]=u(o[3],0,1),o},l.get.hsl=function(e){if(!e)return null;var t=e.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(t){var r=parseFloat(t[4]);return[(parseFloat(t[1])%360+360)%360,u(parseFloat(t[2]),0,100),u(parseFloat(t[3]),0,100),u(isNaN(r)?1:r,0,1)]}return null},l.get.hwb=function(e){if(!e)return null;var t=e.match(/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d\.]+)%\s*,\s*([+-]?[\d\.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(t){var r=parseFloat(t[4]);return[(parseFloat(t[1])%360+360)%360,u(parseFloat(t[2]),0,100),u(parseFloat(t[3]),0,100),u(isNaN(r)?1:r,0,1)]}return null},l.to.hex=function(){var e=i(arguments);return"#"+c(e[0])+c(e[1])+c(e[2])+(e[3]<1?c(Math.round(255*e[3])):"")},l.to.rgb=function(){var e=i(arguments);return e.length<4||1===e[3]?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"},l.to.rgb.percent=function(){var e=i(arguments),t=Math.round(e[0]/255*100),r=Math.round(e[1]/255*100),n=Math.round(e[2]/255*100);return e.length<4||1===e[3]?"rgb("+t+"%, "+r+"%, "+n+"%)":"rgba("+t+"%, "+r+"%, "+n+"%, "+e[3]+")"},l.to.hsl=function(){var e=i(arguments);return e.length<4||1===e[3]?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"},l.to.hwb=function(){var e=i(arguments),t="";return e.length>=4&&1!==e[3]&&(t=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"},l.to.keyword=function(e){return o[e.slice(0,3)]}},4308:(e,t,r)=>{const n=r(6250),i=r(8666),a=["keyword","gray","hex"],o={};for(const e of Object.keys(i))o[[...i[e].labels].sort().join("")]=e;const s={};function l(e,t){if(!(this instanceof l))return new l(e,t);if(t&&t in a&&(t=null),t&&!(t in i))throw new Error("Unknown model: "+t);let r,u;if(null==e)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(e instanceof l)this.model=e.model,this.color=[...e.color],this.valpha=e.valpha;else if("string"==typeof e){const t=n.get(e);if(null===t)throw new Error("Unable to parse color from string: "+e);this.model=t.model,u=i[this.model].channels,this.color=t.value.slice(0,u),this.valpha="number"==typeof t.value[u]?t.value[u]:1}else if(e.length>0){this.model=t||"rgb",u=i[this.model].channels;const r=Array.prototype.slice.call(e,0,u);this.color=h(r,u),this.valpha="number"==typeof e[u]?e[u]:1}else if("number"==typeof e)this.model="rgb",this.color=[e>>16&255,e>>8&255,255&e],this.valpha=1;else{this.valpha=1;const t=Object.keys(e);"alpha"in e&&(t.splice(t.indexOf("alpha"),1),this.valpha="number"==typeof e.alpha?e.alpha:0);const n=t.sort().join("");if(!(n in o))throw new Error("Unable to parse color from object: "+JSON.stringify(e));this.model=o[n];const{labels:a}=i[this.model],s=[];for(r=0;r(e%360+360)%360)),saturationl:c("hsl",1,d(100)),lightness:c("hsl",2,d(100)),saturationv:c("hsv",1,d(100)),value:c("hsv",2,d(100)),chroma:c("hcg",1,d(100)),gray:c("hcg",2,d(100)),white:c("hwb",1,d(100)),wblack:c("hwb",2,d(100)),cyan:c("cmyk",0,d(100)),magenta:c("cmyk",1,d(100)),yellow:c("cmyk",2,d(100)),black:c("cmyk",3,d(100)),x:c("xyz",0,d(95.047)),y:c("xyz",1,d(100)),z:c("xyz",2,d(108.833)),l:c("lab",0,d(100)),a:c("lab",1),b:c("lab",2),keyword(e){return void 0!==e?new l(e):i[this.model].keyword(this.color)},hex(e){return void 0!==e?new l(e):n.to.hex(this.rgb().round().color)},hexa(e){if(void 0!==e)return new l(e);const t=this.rgb().round().color;let r=Math.round(255*this.valpha).toString(16).toUpperCase();return 1===r.length&&(r="0"+r),n.to.hex(t)+r},rgbNumber(){const e=this.rgb().color;return(255&e[0])<<16|(255&e[1])<<8|255&e[2]},luminosity(){const e=this.rgb().color,t=[];for(const[r,n]of e.entries()){const e=n/255;t[r]=e<=.04045?e/12.92:((e+.055)/1.055)**2.4}return.2126*t[0]+.7152*t[1]+.0722*t[2]},contrast(e){const t=this.luminosity(),r=e.luminosity();return t>r?(t+.05)/(r+.05):(r+.05)/(t+.05)},level(e){const t=this.contrast(e);return t>=7?"AAA":t>=4.5?"AA":""},isDark(){const e=this.rgb().color;return(2126*e[0]+7152*e[1]+722*e[2])/1e4<128},isLight(){return!this.isDark()},negate(){const e=this.rgb();for(let t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten(e){const t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken(e){const t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate(e){const t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate(e){const t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten(e){const t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken(e){const t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale(){const e=this.rgb().color,t=.3*e[0]+.59*e[1]+.11*e[2];return l.rgb(t,t,t)},fade(e){return this.alpha(this.valpha-this.valpha*e)},opaquer(e){return this.alpha(this.valpha+this.valpha*e)},rotate(e){const t=this.hsl();let r=t.color[0];return r=(r+e)%360,r=r<0?360+r:r,t.color[0]=r,t},mix(e,t){if(!e||!e.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof e);const r=e.rgb(),n=this.rgb(),i=void 0===t?.5:t,a=2*i-1,o=r.alpha()-n.alpha(),s=((a*o==-1?a:(a+o)/(1+a*o))+1)/2,u=1-s;return l.rgb(s*r.red()+u*n.red(),s*r.green()+u*n.green(),s*r.blue()+u*n.blue(),r.alpha()*i+n.alpha()*(1-i))}};for(const e of Object.keys(i)){if(a.includes(e))continue;const{channels:t}=i[e];l.prototype[e]=function(...t){return this.model===e?new l(this):t.length>0?new l(t,e):new l([...(r=i[this.model][e].raw(this.color),Array.isArray(r)?r:[r]),this.valpha],e);var r},l[e]=function(...r){let n=r[0];return"number"==typeof n&&(n=h(r,t)),new l(n,e)}}function u(e){return function(t){return function(e,t){return Number(e.toFixed(t))}(t,e)}}function c(e,t,r){e=Array.isArray(e)?e:[e];for(const n of e)(s[n]||(s[n]=[]))[t]=r;return e=e[0],function(n){let i;return void 0!==n?(r&&(n=r(n)),i=this[e](),i.color[t]=n,i):(i=this[e]().color[t],r&&(i=r(i)),i)}}function d(e){return function(t){return Math.max(0,Math.min(e,t))}}function h(e,t){for(let r=0;r=t.status}function a(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(r){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var o="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof r.g&&r.g.global===r.g?r.g:void 0,s=o.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=o.saveAs||("object"!=typeof window||window!==o?function(){}:"download"in HTMLAnchorElement.prototype&&!s?function(e,t,r){var s=o.URL||o.webkitURL,l=document.createElement("a");t=t||e.name||"download",l.download=t,l.rel="noopener","string"==typeof e?(l.href=e,l.origin===location.origin?a(l):i(l.href)?n(e,t,r):a(l,l.target="_blank")):(l.href=s.createObjectURL(e),setTimeout((function(){s.revokeObjectURL(l.href)}),4e4),setTimeout((function(){a(l)}),0))}:"msSaveOrOpenBlob"in navigator?function(e,r,o){if(r=r||e.name||"download","string"!=typeof e)navigator.msSaveOrOpenBlob(t(e,o),r);else if(i(e))n(e,r,o);else{var s=document.createElement("a");s.href=e,s.target="_blank",setTimeout((function(){a(s)}))}}:function(e,t,r,i){if((i=i||open("","_blank"))&&(i.document.title=i.document.body.innerText="downloading..."),"string"==typeof e)return n(e,t,r);var a="application/octet-stream"===e.type,l=/constructor/i.test(o.HTMLElement)||o.safari,u=/CriOS\/[\d]+/.test(navigator.userAgent);if((u||a&&l||s)&&"undefined"!=typeof FileReader){var c=new FileReader;c.onloadend=function(){var e=c.result;e=u?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),i?i.location.href=e:location=e,i=null},c.readAsDataURL(e)}else{var d=o.URL||o.webkitURL,h=d.createObjectURL(e);i?i.location=h:location.href=h,i=null,setTimeout((function(){d.revokeObjectURL(h)}),4e4)}});o.saveAs=l.saveAs=l,e.exports=l})?n.apply(t,i):n)||(e.exports=a)},7842:(e,t,r)=>{e=r.nmd(e);var n="__lodash_hash_undefined__",i=1,a=2,o=9007199254740991,s="[object Arguments]",l="[object Array]",u="[object AsyncFunction]",c="[object Boolean]",d="[object Date]",h="[object Error]",p="[object Function]",f="[object GeneratorFunction]",m="[object Map]",g="[object Number]",v="[object Null]",y="[object Object]",b="[object Promise]",w="[object Proxy]",S="[object RegExp]",x="[object Set]",O="[object String]",_="[object Symbol]",E="[object Undefined]",k="[object WeakMap]",C="[object ArrayBuffer]",T="[object DataView]",A=/^\[object .+?Constructor\]$/,R=/^(?:0|[1-9]\d*)$/,D={};D["[object Float32Array]"]=D["[object Float64Array]"]=D["[object Int8Array]"]=D["[object Int16Array]"]=D["[object Int32Array]"]=D["[object Uint8Array]"]=D["[object Uint8ClampedArray]"]=D["[object Uint16Array]"]=D["[object Uint32Array]"]=!0,D[s]=D[l]=D[C]=D[c]=D[T]=D[d]=D[h]=D[p]=D[m]=D[g]=D[y]=D[S]=D[x]=D[O]=D[k]=!1;var P="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,j="object"==typeof self&&self&&self.Object===Object&&self,I=P||j||Function("return this")(),L=t&&!t.nodeType&&t,M=L&&e&&!e.nodeType&&e,N=M&&M.exports===L,F=N&&P.process,V=function(){try{return F&&F.binding&&F.binding("util")}catch(e){}}(),z=V&&V.isTypedArray;function B(e,t){for(var r=-1,n=null==e?0:e.length;++ru))return!1;var d=s.get(e);if(d&&s.get(t))return d==t;var h=-1,p=!0,f=r&a?new Ce:void 0;for(s.set(e,t),s.set(t,e);++h-1},Ee.prototype.set=function(e,t){var r=this.__data__,n=Re(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},ke.prototype.clear=function(){this.size=0,this.__data__={hash:new _e,map:new(he||Ee),string:new _e}},ke.prototype.delete=function(e){var t=Fe(this,e).delete(e);return this.size-=t?1:0,t},ke.prototype.get=function(e){return Fe(this,e).get(e)},ke.prototype.has=function(e){return Fe(this,e).has(e)},ke.prototype.set=function(e,t){var r=Fe(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},Ce.prototype.add=Ce.prototype.push=function(e){return this.__data__.set(e,n),this},Ce.prototype.has=function(e){return this.__data__.has(e)},Te.prototype.clear=function(){this.__data__=new Ee,this.size=0},Te.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Te.prototype.get=function(e){return this.__data__.get(e)},Te.prototype.has=function(e){return this.__data__.has(e)},Te.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Ee){var n=r.__data__;if(!he||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new ke(n)}return r.set(e,t),this.size=r.size,this};var ze=le?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var r=-1,n=null==e?0:e.length,i=0,a=[];++r-1&&e%1==0&&e-1&&e%1==0&&e<=o}function Xe(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Je(e){return null!=e&&"object"==typeof e}var Ye=z?function(e){return function(t){return e(t)}}(z):function(e){return Je(e)&&Ke(e.length)&&!!D[De(e)]};function Ze(e){return null!=(t=e)&&Ke(t.length)&&!Qe(t)?Ae(e):Le(e);var t}e.exports=function(e,t){return je(e,t)}},1664:e=>{"use strict";var t=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(e){n[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(e){return!1}}()?Object.assign:function(e,i){for(var a,o,s=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),l=1;l{"use strict";var n=r(6441);function i(){}function a(){}a.resetWarningCache=i,e.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:a,resetWarningCache:i};return r.PropTypes=r,r}},2688:(e,t,r)=>{e.exports=r(362)()},6441:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},585:(e,t,r)=>{"use strict";e.exports=r(5481)},3804:(e,t,r)=>{"use strict";var n=t,i=r(2775),a=r(6866);function o(e,t,r,n){var a=!1;if(t.resolvedType)if(t.resolvedType instanceof i){e("switch(d%s){",n);for(var o=t.resolvedType.values,s=Object.keys(o),l=0;l>>0",n,n);break;case"int32":case"sint32":case"sfixed32":e("m%s=d%s|0",n,n);break;case"uint64":u=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",n,n,u)('else if(typeof d%s==="string")',n)("m%s=parseInt(d%s,10)",n,n)('else if(typeof d%s==="number")',n)("m%s=d%s",n,n)('else if(typeof d%s==="object")',n)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",n,n,n,u?"true":"");break;case"bytes":e('if(typeof d%s==="string")',n)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",n,n,n)("else if(d%s.length >= 0)",n)("m%s=d%s",n,n);break;case"string":e("m%s=String(d%s)",n,n);break;case"bool":e("m%s=Boolean(d%s)",n,n)}}return e}function s(e,t,r,n){if(t.resolvedType)t.resolvedType instanceof i?e("d%s=o.enums===String?(types[%i].values[m%s]===undefined?m%s:types[%i].values[m%s]):m%s",n,r,n,n,r,n,n):e("d%s=types[%i].toObject(m%s,o)",n,r,n);else{var a=!1;switch(t.type){case"double":case"float":e("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",n,n,n,n);break;case"uint64":a=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e('if(typeof m%s==="number")',n)("d%s=o.longs===String?String(m%s):m%s",n,n,n)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",n,n,n,n,a?"true":"",n);break;case"bytes":e("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",n,n,n,n,n);break;default:e("d%s=m%s",n,n)}}return e}n.fromObject=function(e){var t=e.fieldsArray,r=a.codegen(["d"],e.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!t.length)return r("return new this.ctor");r("var m=new this.ctor");for(var n=0;n{"use strict";e.exports=function(e){var t=a.codegen(["r","l"],e.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(e.fieldsArray.filter((function(e){return e.map})).length?",k,value":""))("while(r.pos>>3){");for(var r=0;r>>3){")("case 1: k=r.%s(); break",s.keyType)("case 2:"),void 0===i.basic[l]?t("value=types[%i].decode(r,r.uint32())",r):t("value=r.%s()",l),t("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),void 0!==i.long[s.keyType]?t('%s[typeof k==="object"?util.longToHash(k):k]=value',u):t("%s[k]=value",u)):s.repeated?(t("if(!(%s&&%s.length))",u,u)("%s=[]",u),void 0!==i.packed[l]&&t("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos{"use strict";e.exports=function(e){for(var t,r=a.codegen(["m","w"],e.name+"$encode")("if(!w)")("w=Writer.create()"),s=e.fieldsArray.slice().sort(a.compareFieldsById),l=0;l>>0,8|i.mapKey[u.keyType],u.keyType),void 0===h?r("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",c,t):r(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|h,d,t),r("}")("}")):u.repeated?(r("if(%s!=null&&%s.length){",t,t),u.packed&&void 0!==i.packed[d]?r("w.uint32(%i).fork()",(u.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",t)("w.%s(%s[i])",d,t)("w.ldelim()"):(r("for(var i=0;i<%s.length;++i)",t),void 0===h?o(r,u,c,t+"[i]"):r("w.uint32(%i).%s(%s[i])",(u.id<<3|h)>>>0,d,t)),r("}")):(u.optional&&r("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",t,u.name),void 0===h?o(r,u,c,t):r("w.uint32(%i).%s(%s)",(u.id<<3|h)>>>0,d,t))}return r("return w")};var n=r(2775),i=r(1517),a=r(6866);function o(e,t,r,n){return t.resolvedType.group?e("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",r,n,(t.id<<3|3)>>>0,(t.id<<3|4)>>>0):e("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",r,n,(t.id<<3|2)>>>0)}},2775:(e,t,r)=>{"use strict";e.exports=o;var n=r(4349);((o.prototype=Object.create(n.prototype)).constructor=o).className="Enum";var i=r(2815),a=r(6866);function o(e,t,r,i,a,o){if(n.call(this,e,r),t&&"object"!=typeof t)throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=i,this.comments=a||{},this.valuesOptions=o,this.reserved=void 0,t)for(var s=Object.keys(t),l=0;l{"use strict";e.exports=u;var n=r(4349);((u.prototype=Object.create(n.prototype)).constructor=u).className="Field";var i,a=r(2775),o=r(1517),s=r(6866),l=/^required|optional|repeated$/;function u(e,t,r,i,a,u,c){if(s.isObject(i)?(c=a,u=i,i=a=void 0):s.isObject(a)&&(c=u,u=a,a=void 0),n.call(this,e,u),!s.isInteger(t)||t<0)throw TypeError("id must be a non-negative integer");if(!s.isString(r))throw TypeError("type must be a string");if(void 0!==i&&!l.test(i=i.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(void 0!==a&&!s.isString(a))throw TypeError("extend must be a string");"proto3_optional"===i&&(i="optional"),this.rule=i&&"optional"!==i?i:void 0,this.type=r,this.id=t,this.extend=a||void 0,this.required="required"===i,this.optional=!this.required,this.repeated="repeated"===i,this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=!!s.Long&&void 0!==o.long[r],this.bytes="bytes"===r,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this._packed=null,this.comment=c}u.fromJSON=function(e,t){return new u(e,t.id,t.type,t.rule,t.extend,t.options,t.comment)},Object.defineProperty(u.prototype,"packed",{get:function(){return null===this._packed&&(this._packed=!1!==this.getOption("packed")),this._packed}}),u.prototype.setOption=function(e,t,r){return"packed"===e&&(this._packed=null),n.prototype.setOption.call(this,e,t,r)},u.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return s.toObject(["rule","optional"!==this.rule&&this.rule||void 0,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},u.prototype.resolve=function(){if(this.resolved)return this;if(void 0===(this.typeDefault=o.defaults[this.type])?(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof i?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]):this.options&&this.options.proto3_optional&&(this.typeDefault=null),this.options&&null!=this.options.default&&(this.typeDefault=this.options.default,this.resolvedType instanceof a&&"string"==typeof this.typeDefault&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&(!0!==this.options.packed&&(void 0===this.options.packed||!this.resolvedType||this.resolvedType instanceof a)||delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=s.Long.fromNumber(this.typeDefault,"u"===this.type.charAt(0)),Object.freeze&&Object.freeze(this.typeDefault);else if(this.bytes&&"string"==typeof this.typeDefault){var e;s.base64.test(this.typeDefault)?s.base64.decode(this.typeDefault,e=s.newBuffer(s.base64.length(this.typeDefault)),0):s.utf8.write(this.typeDefault,e=s.newBuffer(s.utf8.length(this.typeDefault)),0),this.typeDefault=e}return this.map?this.defaultValue=s.emptyObject:this.repeated?this.defaultValue=s.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof i&&(this.parent.ctor.prototype[this.name]=this.defaultValue),n.prototype.resolve.call(this)},u.d=function(e,t,r,n){return"function"==typeof t?t=s.decorateType(t).name:t&&"object"==typeof t&&(t=s.decorateEnum(t).name),function(i,a){s.decorateType(i.constructor).add(new u(a,e,t,r,{default:n}))}},u._configure=function(e){i=e}},5481:(e,t,r)=>{"use strict";var n=e.exports=r(7134);n.build="light",n.load=function(e,t,r){return"function"==typeof t?(r=t,t=new n.Root):t||(t=new n.Root),t.load(e,r)},n.loadSync=function(e,t){return t||(t=new n.Root),t.loadSync(e)},n.encoder=r(8852),n.decoder=r(9980),n.verifier=r(3040),n.converter=r(3804),n.ReflectionObject=r(4349),n.Namespace=r(2815),n.Root=r(8038),n.Enum=r(2775),n.Type=r(6),n.Field=r(3796),n.OneOf=r(8957),n.MapField=r(9504),n.Service=r(6467),n.Method=r(3055),n.Message=r(9e3),n.wrappers=r(6942),n.types=r(1517),n.util=r(6866),n.ReflectionObject._configure(n.Root),n.Namespace._configure(n.Type,n.Service,n.Enum),n.Root._configure(n.Type),n.Field._configure(n.Type)},7134:(e,t,r)=>{"use strict";var n=t;function i(){n.util._configure(),n.Writer._configure(n.BufferWriter),n.Reader._configure(n.BufferReader)}n.build="minimal",n.Writer=r(4301),n.BufferWriter=r(8422),n.Reader=r(1137),n.BufferReader=r(4010),n.util=r(5382),n.rpc=r(9691),n.roots=r(381),n.configure=i,i()},9504:(e,t,r)=>{"use strict";e.exports=o;var n=r(3796);((o.prototype=Object.create(n.prototype)).constructor=o).className="MapField";var i=r(1517),a=r(6866);function o(e,t,r,i,o,s){if(n.call(this,e,t,i,void 0,void 0,o,s),!a.isString(r))throw TypeError("keyType must be a string");this.keyType=r,this.resolvedKeyType=null,this.map=!0}o.fromJSON=function(e,t){return new o(e,t.id,t.keyType,t.type,t.options,t.comment)},o.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return a.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},o.prototype.resolve=function(){if(this.resolved)return this;if(void 0===i.mapKey[this.keyType])throw Error("invalid key type: "+this.keyType);return n.prototype.resolve.call(this)},o.d=function(e,t,r){return"function"==typeof r?r=a.decorateType(r).name:r&&"object"==typeof r&&(r=a.decorateEnum(r).name),function(n,i){a.decorateType(n.constructor).add(new o(i,e,t,r))}}},9e3:(e,t,r)=>{"use strict";e.exports=i;var n=r(5382);function i(e){if(e)for(var t=Object.keys(e),r=0;r{"use strict";e.exports=a;var n=r(4349);((a.prototype=Object.create(n.prototype)).constructor=a).className="Method";var i=r(6866);function a(e,t,r,a,o,s,l,u,c){if(i.isObject(o)?(l=o,o=s=void 0):i.isObject(s)&&(l=s,s=void 0),void 0!==t&&!i.isString(t))throw TypeError("type must be a string");if(!i.isString(r))throw TypeError("requestType must be a string");if(!i.isString(a))throw TypeError("responseType must be a string");n.call(this,e,l),this.type=t||"rpc",this.requestType=r,this.requestStream=!!o||void 0,this.responseType=a,this.responseStream=!!s||void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=u,this.parsedOptions=c}a.fromJSON=function(e,t){return new a(e,t.type,t.requestType,t.responseType,t.requestStream,t.responseStream,t.options,t.comment,t.parsedOptions)},a.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return i.toObject(["type","rpc"!==this.type&&this.type||void 0,"requestType",this.requestType,"requestStream",this.requestStream,"responseType",this.responseType,"responseStream",this.responseStream,"options",this.options,"comment",t?this.comment:void 0,"parsedOptions",this.parsedOptions])},a.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),n.prototype.resolve.call(this))}},2815:(e,t,r)=>{"use strict";e.exports=d;var n=r(4349);((d.prototype=Object.create(n.prototype)).constructor=d).className="Namespace";var i,a,o,s=r(3796),l=r(6866),u=r(8957);function c(e,t){if(e&&e.length){for(var r={},n=0;nt)return!0;return!1},d.isReservedName=function(e,t){if(e)for(var r=0;r0;){var n=e.shift();if(r.nested&&r.nested[n]){if(!((r=r.nested[n])instanceof d))throw Error("path conflicts with non-namespace objects")}else r.add(r=new d(n))}return t&&r.addJSON(t),r},d.prototype.resolveAll=function(){for(var e=this.nestedArray,t=0;t-1)return n}else if(n instanceof d&&(n=n.lookup(e.slice(1),t,!0)))return n}else for(var i=0;i{"use strict";e.exports=a,a.className="ReflectionObject";var n,i=r(6866);function a(e,t){if(!i.isString(e))throw TypeError("name must be a string");if(t&&!i.isObject(t))throw TypeError("options must be an object");this.options=t,this.parsedOptions=null,this.name=e,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}Object.defineProperties(a.prototype,{root:{get:function(){for(var e=this;null!==e.parent;)e=e.parent;return e}},fullName:{get:function(){for(var e=[this.name],t=this.parent;t;)e.unshift(t.name),t=t.parent;return e.join(".")}}}),a.prototype.toJSON=function(){throw Error()},a.prototype.onAdd=function(e){this.parent&&this.parent!==e&&this.parent.remove(this),this.parent=e,this.resolved=!1;var t=e.root;t instanceof n&&t._handleAdd(this)},a.prototype.onRemove=function(e){var t=e.root;t instanceof n&&t._handleRemove(this),this.parent=null,this.resolved=!1},a.prototype.resolve=function(){return this.resolved||this.root instanceof n&&(this.resolved=!0),this},a.prototype.getOption=function(e){if(this.options)return this.options[e]},a.prototype.setOption=function(e,t,r){return r&&this.options&&void 0!==this.options[e]||((this.options||(this.options={}))[e]=t),this},a.prototype.setParsedOption=function(e,t,r){this.parsedOptions||(this.parsedOptions=[]);var n=this.parsedOptions;if(r){var a=n.find((function(t){return Object.prototype.hasOwnProperty.call(t,e)}));if(a){var o=a[e];i.setProperty(o,r,t)}else(a={})[e]=i.setProperty({},r,t),n.push(a)}else{var s={};s[e]=t,n.push(s)}return this},a.prototype.setOptions=function(e,t){if(e)for(var r=Object.keys(e),n=0;n{"use strict";e.exports=o;var n=r(4349);((o.prototype=Object.create(n.prototype)).constructor=o).className="OneOf";var i=r(3796),a=r(6866);function o(e,t,r,i){if(Array.isArray(t)||(r=t,t=void 0),n.call(this,e,r),void 0!==t&&!Array.isArray(t))throw TypeError("fieldNames must be an Array");this.oneof=t||[],this.fieldsArray=[],this.comment=i}function s(e){if(e.parent)for(var t=0;t-1&&this.oneof.splice(t,1),e.partOf=null,this},o.prototype.onAdd=function(e){n.prototype.onAdd.call(this,e);for(var t=0;t{"use strict";e.exports=l;var n,i=r(5382),a=i.LongBits,o=i.utf8;function s(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function l(e){this.buf=e,this.pos=0,this.len=e.length}var u,c="undefined"!=typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new l(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new l(e);throw Error("illegal buffer")},d=function(){return i.Buffer?function(e){return(l.create=function(e){return i.Buffer.isBuffer(e)?new n(e):c(e)})(e)}:c};function h(){var e=new a(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw s(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw s(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function p(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function f(){if(this.pos+8>this.len)throw s(this,8);return new a(p(this.buf,this.pos+=4),p(this.buf,this.pos+=4))}l.create=d(),l.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,l.prototype.uint32=(u=4294967295,function(){if(u=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return u;if(u=(u|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return u;if((this.pos+=5)>this.len)throw this.pos=this.len,s(this,10);return u}),l.prototype.int32=function(){return 0|this.uint32()},l.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)},l.prototype.bool=function(){return 0!==this.uint32()},l.prototype.fixed32=function(){if(this.pos+4>this.len)throw s(this,4);return p(this.buf,this.pos+=4)},l.prototype.sfixed32=function(){if(this.pos+4>this.len)throw s(this,4);return 0|p(this.buf,this.pos+=4)},l.prototype.float=function(){if(this.pos+4>this.len)throw s(this,4);var e=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},l.prototype.double=function(){if(this.pos+8>this.len)throw s(this,4);var e=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},l.prototype.bytes=function(){var e=this.uint32(),t=this.pos,r=this.pos+e;if(r>this.len)throw s(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(t,r);if(t===r){var n=i.Buffer;return n?n.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,t,r)},l.prototype.string=function(){var e=this.bytes();return o.read(e,0,e.length)},l.prototype.skip=function(e){if("number"==typeof e){if(this.pos+e>this.len)throw s(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw s(this)}while(128&this.buf[this.pos++]);return this},l.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!=(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},l._configure=function(e){n=e,l.create=d(),n._configure();var t=i.Long?"toLong":"toNumber";i.merge(l.prototype,{int64:function(){return h.call(this)[t](!1)},uint64:function(){return h.call(this)[t](!0)},sint64:function(){return h.call(this).zzDecode()[t](!1)},fixed64:function(){return f.call(this)[t](!0)},sfixed64:function(){return f.call(this)[t](!1)}})}},4010:(e,t,r)=>{"use strict";e.exports=a;var n=r(1137);(a.prototype=Object.create(n.prototype)).constructor=a;var i=r(5382);function a(e){n.call(this,e)}a._configure=function(){i.Buffer&&(a.prototype._slice=i.Buffer.prototype.slice)},a.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},a._configure()},8038:(e,t,r)=>{"use strict";e.exports=d;var n=r(2815);((d.prototype=Object.create(n.prototype)).constructor=d).className="Root";var i,a,o,s=r(3796),l=r(2775),u=r(8957),c=r(6866);function d(e){n.call(this,"",e),this.deferred=[],this.files=[]}function h(){}d.fromJSON=function(e,t){return t||(t=new d),e.options&&t.setOptions(e.options),t.addJSON(e.nested)},d.prototype.resolvePath=c.path.resolve,d.prototype.fetch=c.fetch,d.prototype.load=function e(t,r,n){"function"==typeof r&&(n=r,r=void 0);var i=this;if(!n)return c.asPromise(e,i,t,r);var s=n===h;function l(e,t){if(n){if(s)throw e;var r=n;n=null,r(e,t)}}function u(e){var t=e.lastIndexOf("google/protobuf/");if(t>-1){var r=e.substring(t);if(r in o)return r}return null}function d(e,t){try{if(c.isString(t)&&"{"===t.charAt(0)&&(t=JSON.parse(t)),c.isString(t)){a.filename=e;var n,o=a(t,i,r),d=0;if(o.imports)for(;d-1))if(i.files.push(e),e in o)s?d(e,o[e]):(++f,setTimeout((function(){--f,d(e,o[e])})));else if(s){var r;try{r=c.fs.readFileSync(e).toString("utf8")}catch(e){return void(t||l(e))}d(e,r)}else++f,i.fetch(e,(function(r,a){--f,n&&(r?t?f||l(null,i):l(r):d(e,a))}))}var f=0;c.isString(t)&&(t=[t]);for(var m,g=0;g-1&&this.deferred.splice(t,1)}}else if(e instanceof l)p.test(e.name)&&delete e.parent[e.name];else if(e instanceof n){for(var r=0;r{"use strict";e.exports={}},9691:(e,t,r)=>{"use strict";t.Service=r(4447)},4447:(e,t,r)=>{"use strict";e.exports=i;var n=r(5382);function i(e,t,r){if("function"!=typeof e)throw TypeError("rpcImpl must be a function");n.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(r)}(i.prototype=Object.create(n.EventEmitter.prototype)).constructor=i,i.prototype.rpcCall=function e(t,r,i,a,o){if(!a)throw TypeError("request must be specified");var s=this;if(!o)return n.asPromise(e,s,t,r,i,a);if(s.rpcImpl)try{return s.rpcImpl(t,r[s.requestDelimited?"encodeDelimited":"encode"](a).finish(),(function(e,r){if(e)return s.emit("error",e,t),o(e);if(null!==r){if(!(r instanceof i))try{r=i[s.responseDelimited?"decodeDelimited":"decode"](r)}catch(e){return s.emit("error",e,t),o(e)}return s.emit("data",r,t),o(null,r)}s.end(!0)}))}catch(e){return s.emit("error",e,t),void setTimeout((function(){o(e)}),0)}else setTimeout((function(){o(Error("already ended"))}),0)},i.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},6467:(e,t,r)=>{"use strict";e.exports=s;var n=r(2815);((s.prototype=Object.create(n.prototype)).constructor=s).className="Service";var i=r(3055),a=r(6866),o=r(9691);function s(e,t){n.call(this,e,t),this.methods={},this._methodsArray=null}function l(e){return e._methodsArray=null,e}s.fromJSON=function(e,t){var r=new s(e,t.options);if(t.methods)for(var n=Object.keys(t.methods),a=0;a{"use strict";e.exports=y;var n=r(2815);((y.prototype=Object.create(n.prototype)).constructor=y).className="Type";var i=r(2775),a=r(8957),o=r(3796),s=r(9504),l=r(6467),u=r(9e3),c=r(1137),d=r(4301),h=r(6866),p=r(8852),f=r(9980),m=r(3040),g=r(3804),v=r(6942);function y(e,t){n.call(this,e,t),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this._fieldsById=null,this._fieldsArray=null,this._oneofsArray=null,this._ctor=null}function b(e){return e._fieldsById=e._fieldsArray=e._oneofsArray=null,delete e.encode,delete e.decode,delete e.verify,e}Object.defineProperties(y.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var e=Object.keys(this.fields),t=0;t{"use strict";var n=t,i=r(6866),a=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function o(e,t){var r=0,n={};for(t|=0;r{"use strict";var n,i,a=e.exports=r(5382),o=r(381);a.codegen=r(7669),a.fetch=r(9240),a.path=r(2459),a.fs=a.inquire("fs"),a.toArray=function(e){if(e){for(var t=Object.keys(e),r=new Array(t.length),n=0;n0)t[i]=e(t[i]||{},r,n);else{var a=t[i];a&&(n=[].concat(a).concat(n)),t[i]=n}return t}(e,t=t.split("."),r)},Object.defineProperty(a,"decorateRoot",{get:function(){return o.decorated||(o.decorated=new(r(8038)))}})},5003:(e,t,r)=>{"use strict";e.exports=i;var n=r(5382);function i(e,t){this.lo=e>>>0,this.hi=t>>>0}var a=i.zero=new i(0,0);a.toNumber=function(){return 0},a.zzEncode=a.zzDecode=function(){return this},a.length=function(){return 1};var o=i.zeroHash="\0\0\0\0\0\0\0\0";i.fromNumber=function(e){if(0===e)return a;var t=e<0;t&&(e=-e);var r=e>>>0,n=(e-r)/4294967296>>>0;return t&&(n=~n>>>0,r=~r>>>0,++r>4294967295&&(r=0,++n>4294967295&&(n=0))),new i(r,n)},i.from=function(e){if("number"==typeof e)return i.fromNumber(e);if(n.isString(e)){if(!n.Long)return i.fromNumber(parseInt(e,10));e=n.Long.fromString(e)}return e.low||e.high?new i(e.low>>>0,e.high>>>0):a},i.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,r=~this.hi>>>0;return t||(r=r+1>>>0),-(t+4294967296*r)}return this.lo+4294967296*this.hi},i.prototype.toLong=function(e){return n.Long?new n.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var s=String.prototype.charCodeAt;i.fromHash=function(e){return e===o?a:new i((s.call(e,0)|s.call(e,1)<<8|s.call(e,2)<<16|s.call(e,3)<<24)>>>0,(s.call(e,4)|s.call(e,5)<<8|s.call(e,6)<<16|s.call(e,7)<<24)>>>0)},i.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},i.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},i.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},i.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,r=this.hi>>>24;return 0===r?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:r<128?9:10}},5382:function(e,t,r){"use strict";var n=t;function i(e,t,r){for(var n=Object.keys(t),i=0;i0)},n.Buffer=function(){try{var e=n.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(e){return null}}(),n._Buffer_from=null,n._Buffer_allocUnsafe=null,n.newBuffer=function(e){return"number"==typeof e?n.Buffer?n._Buffer_allocUnsafe(e):new n.Array(e):n.Buffer?n._Buffer_from(e):"undefined"==typeof Uint8Array?e:new Uint8Array(e)},n.Array="undefined"!=typeof Uint8Array?Uint8Array:Array,n.Long=n.global.dcodeIO&&n.global.dcodeIO.Long||n.global.Long||n.inquire("long"),n.key2Re=/^true|false|0|1$/,n.key32Re=/^-?(?:0|[1-9][0-9]*)$/,n.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,n.longToHash=function(e){return e?n.LongBits.from(e).toHash():n.LongBits.zeroHash},n.longFromHash=function(e,t){var r=n.LongBits.fromHash(e);return n.Long?n.Long.fromBits(r.lo,r.hi,t):r.toNumber(Boolean(t))},n.merge=i,n.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},n.newError=a,n.ProtocolError=a("ProtocolError"),n.oneOfGetter=function(e){for(var t={},r=0;r-1;--r)if(1===t[e[r]]&&void 0!==this[e[r]]&&null!==this[e[r]])return e[r]}},n.oneOfSetter=function(e){return function(t){for(var r=0;r{"use strict";e.exports=function(e){var t=i.codegen(["m"],e.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),r=e.oneofsArray,n={};r.length&&t("var p={}");for(var l=0;l{"use strict";var n=t,i=r(9e3);n[".google.protobuf.Any"]={fromObject:function(e){if(e&&e["@type"]){var t=e["@type"].substring(e["@type"].lastIndexOf("/")+1),r=this.lookup(t);if(r){var n="."===e["@type"].charAt(0)?e["@type"].slice(1):e["@type"];return-1===n.indexOf("/")&&(n="/"+n),this.create({type_url:n,value:r.encode(r.fromObject(e)).finish()})}}return this.fromObject(e)},toObject:function(e,t){var r="",n="";if(t&&t.json&&e.type_url&&e.value){n=e.type_url.substring(e.type_url.lastIndexOf("/")+1),r=e.type_url.substring(0,e.type_url.lastIndexOf("/")+1);var a=this.lookup(n);a&&(e=a.decode(e.value))}if(!(e instanceof this.ctor)&&e instanceof i){var o=e.$type.toObject(e,t);return""===r&&(r="type.googleapis.com/"),n=r+("."===e.$type.fullName[0]?e.$type.fullName.slice(1):e.$type.fullName),o["@type"]=n,o}return this.toObject(e,t)}}},4301:(e,t,r)=>{"use strict";e.exports=d;var n,i=r(5382),a=i.LongBits,o=i.base64,s=i.utf8;function l(e,t,r){this.fn=e,this.len=t,this.next=void 0,this.val=r}function u(){}function c(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function d(){this.len=0,this.head=new l(u,0,0),this.tail=this.head,this.states=null}var h=function(){return i.Buffer?function(){return(d.create=function(){return new n})()}:function(){return new d}};function p(e,t,r){t[r]=255&e}function f(e,t){this.len=e,this.next=void 0,this.val=t}function m(e,t,r){for(;e.hi;)t[r++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[r++]=127&e.lo|128,e.lo=e.lo>>>7;t[r++]=e.lo}function g(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}d.create=h(),d.alloc=function(e){return new i.Array(e)},i.Array!==Array&&(d.alloc=i.pool(d.alloc,i.Array.prototype.subarray)),d.prototype._push=function(e,t,r){return this.tail=this.tail.next=new l(e,t,r),this.len+=t,this},f.prototype=Object.create(l.prototype),f.prototype.fn=function(e,t,r){for(;e>127;)t[r++]=127&e|128,e>>>=7;t[r]=e},d.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new f((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},d.prototype.int32=function(e){return e<0?this._push(m,10,a.fromNumber(e)):this.uint32(e)},d.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},d.prototype.uint64=function(e){var t=a.from(e);return this._push(m,t.length(),t)},d.prototype.int64=d.prototype.uint64,d.prototype.sint64=function(e){var t=a.from(e).zzEncode();return this._push(m,t.length(),t)},d.prototype.bool=function(e){return this._push(p,1,e?1:0)},d.prototype.fixed32=function(e){return this._push(g,4,e>>>0)},d.prototype.sfixed32=d.prototype.fixed32,d.prototype.fixed64=function(e){var t=a.from(e);return this._push(g,4,t.lo)._push(g,4,t.hi)},d.prototype.sfixed64=d.prototype.fixed64,d.prototype.float=function(e){return this._push(i.float.writeFloatLE,4,e)},d.prototype.double=function(e){return this._push(i.float.writeDoubleLE,8,e)};var v=i.Array.prototype.set?function(e,t,r){t.set(e,r)}:function(e,t,r){for(var n=0;n>>0;if(!t)return this._push(p,1,0);if(i.isString(e)){var r=d.alloc(t=o.length(e));o.decode(e,r,0),e=r}return this.uint32(t)._push(v,t,e)},d.prototype.string=function(e){var t=s.length(e);return t?this.uint32(t)._push(s.write,t,e):this._push(p,1,0)},d.prototype.fork=function(){return this.states=new c(this),this.head=this.tail=new l(u,0,0),this.len=0,this},d.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new l(u,0,0),this.len=0),this},d.prototype.ldelim=function(){var e=this.head,t=this.tail,r=this.len;return this.reset().uint32(r),r&&(this.tail.next=e.next,this.tail=t,this.len+=r),this},d.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),r=0;e;)e.fn(e.val,t,r),r+=e.len,e=e.next;return t},d._configure=function(e){n=e,d.create=h(),n._configure()}},8422:(e,t,r)=>{"use strict";e.exports=a;var n=r(4301);(a.prototype=Object.create(n.prototype)).constructor=a;var i=r(5382);function a(){n.call(this)}function o(e,t,r){e.length<40?i.utf8.write(e,t,r):t.utf8Write?t.utf8Write(e,r):t.write(e,r)}a._configure=function(){a.alloc=i._Buffer_allocUnsafe,a.writeBytesBuffer=i.Buffer&&i.Buffer.prototype instanceof Uint8Array&&"set"===i.Buffer.prototype.set.name?function(e,t,r){t.set(e,r)}:function(e,t,r){if(e.copy)e.copy(t,r,0,e.length);else for(var n=0;n>>0;return this.uint32(t),t&&this._push(a.writeBytesBuffer,t,e),this},a.prototype.string=function(e){var t=i.Buffer.byteLength(e);return this.uint32(t),t&&this._push(o,t,e),this},a._configure()},9111:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"DraggableCore",{enumerable:!0,get:function(){return c.default}}),t.default=void 0;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=p(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(n,a,o):n[a]=e[a]}n.default=e,r&&r.set(e,n);return n}(r(5959)),i=h(r(2688)),a=h(r(8398)),o=h(r(8262)),s=r(2837),l=r(402),u=r(6732),c=h(r(1060)),d=h(r(7988));function h(e){return e&&e.__esModule?e:{default:e}}function p(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(p=function(e){return e?r:t})(e)}function f(){return f=Object.assign?Object.assign.bind():function(e){for(var t=1;t{(0,d.default)("Draggable: onDragStart: %j",t);if(!1===this.props.onStart(e,(0,l.createDraggableData)(this,t)))return!1;this.setState({dragging:!0,dragged:!0})})),m(this,"onDrag",((e,t)=>{if(!this.state.dragging)return!1;(0,d.default)("Draggable: onDrag: %j",t);const r=(0,l.createDraggableData)(this,t),n={x:r.x,y:r.y,slackX:0,slackY:0};if(this.props.bounds){const{x:e,y:t}=n;n.x+=this.state.slackX,n.y+=this.state.slackY;const[i,a]=(0,l.getBoundPosition)(this,n.x,n.y);n.x=i,n.y=a,n.slackX=this.state.slackX+(e-n.x),n.slackY=this.state.slackY+(t-n.y),r.x=n.x,r.y=n.y,r.deltaX=n.x-this.state.x,r.deltaY=n.y-this.state.y}if(!1===this.props.onDrag(e,r))return!1;this.setState(n)})),m(this,"onDragStop",((e,t)=>{if(!this.state.dragging)return!1;if(!1===this.props.onStop(e,(0,l.createDraggableData)(this,t)))return!1;(0,d.default)("Draggable: onDragStop: %j",t);const r={dragging:!1,slackX:0,slackY:0};if(Boolean(this.props.position)){const{x:e,y:t}=this.props.position;r.x=e,r.y=t}this.setState(r)})),this.state={dragging:!1,dragged:!1,x:e.position?e.position.x:e.defaultPosition.x,y:e.position?e.position.y:e.defaultPosition.y,prevPropsPosition:{...e.position},slackX:0,slackY:0,isElementSVG:!1},!e.position||e.onDrag||e.onStop||console.warn("A `position` was applied to this , without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){void 0!==window.SVGElement&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var e,t;return null!==(e=null===(t=this.props)||void 0===t||null===(t=t.nodeRef)||void 0===t?void 0:t.current)&&void 0!==e?e:a.default.findDOMNode(this)}render(){const{axis:e,bounds:t,children:r,defaultPosition:i,defaultClassName:a,defaultClassNameDragging:u,defaultClassNameDragged:d,position:h,positionOffset:p,scale:m,...g}=this.props;let v={},y=null;const b=!Boolean(h)||this.state.dragging,w=h||i,S={x:(0,l.canDragX)(this)&&b?this.state.x:w.x,y:(0,l.canDragY)(this)&&b?this.state.y:w.y};this.state.isElementSVG?y=(0,s.createSVGTransform)(S,p):v=(0,s.createCSSTransform)(S,p);const x=(0,o.default)(r.props.className||"",a,{[u]:this.state.dragging,[d]:this.state.dragged});return n.createElement(c.default,f({},g,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),n.cloneElement(n.Children.only(r),{className:x,style:{...r.props.style,...v},transform:y}))}}t.default=g,m(g,"displayName","Draggable"),m(g,"propTypes",{...c.default.propTypes,axis:i.default.oneOf(["both","x","y","none"]),bounds:i.default.oneOfType([i.default.shape({left:i.default.number,right:i.default.number,top:i.default.number,bottom:i.default.number}),i.default.string,i.default.oneOf([!1])]),defaultClassName:i.default.string,defaultClassNameDragging:i.default.string,defaultClassNameDragged:i.default.string,defaultPosition:i.default.shape({x:i.default.number,y:i.default.number}),positionOffset:i.default.shape({x:i.default.oneOfType([i.default.number,i.default.string]),y:i.default.oneOfType([i.default.number,i.default.string])}),position:i.default.shape({x:i.default.number,y:i.default.number}),className:u.dontSetMe,style:u.dontSetMe,transform:u.dontSetMe}),m(g,"defaultProps",{...c.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})},1060:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=d(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(n,a,o):n[a]=e[a]}n.default=e,r&&r.set(e,n);return n}(r(5959)),i=c(r(2688)),a=c(r(8398)),o=r(2837),s=r(402),l=r(6732),u=c(r(7988));function c(e){return e&&e.__esModule?e:{default:e}}function d(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(d=function(e){return e?r:t})(e)}function h(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const p={start:"touchstart",move:"touchmove",stop:"touchend"},f={start:"mousedown",move:"mousemove",stop:"mouseup"};let m=f;class g extends n.Component{constructor(){super(...arguments),h(this,"dragging",!1),h(this,"lastX",NaN),h(this,"lastY",NaN),h(this,"touchIdentifier",null),h(this,"mounted",!1),h(this,"handleDragStart",(e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&"number"==typeof e.button&&0!==e.button)return!1;const t=this.findDOMNode();if(!t||!t.ownerDocument||!t.ownerDocument.body)throw new Error(" not mounted on DragStart!");const{ownerDocument:r}=t;if(this.props.disabled||!(e.target instanceof r.defaultView.Node)||this.props.handle&&!(0,o.matchesSelectorAndParentsTo)(e.target,this.props.handle,t)||this.props.cancel&&(0,o.matchesSelectorAndParentsTo)(e.target,this.props.cancel,t))return;"touchstart"===e.type&&e.preventDefault();const n=(0,o.getTouchIdentifier)(e);this.touchIdentifier=n;const i=(0,s.getControlPosition)(e,n,this);if(null==i)return;const{x:a,y:l}=i,c=(0,s.createCoreData)(this,a,l);(0,u.default)("DraggableCore: handleDragStart: %j",c),(0,u.default)("calling",this.props.onStart);!1!==this.props.onStart(e,c)&&!1!==this.mounted&&(this.props.enableUserSelectHack&&(0,o.addUserSelectStyles)(r),this.dragging=!0,this.lastX=a,this.lastY=l,(0,o.addEvent)(r,m.move,this.handleDrag),(0,o.addEvent)(r,m.stop,this.handleDragStop))})),h(this,"handleDrag",(e=>{const t=(0,s.getControlPosition)(e,this.touchIdentifier,this);if(null==t)return;let{x:r,y:n}=t;if(Array.isArray(this.props.grid)){let e=r-this.lastX,t=n-this.lastY;if([e,t]=(0,s.snapToGrid)(this.props.grid,e,t),!e&&!t)return;r=this.lastX+e,n=this.lastY+t}const i=(0,s.createCoreData)(this,r,n);(0,u.default)("DraggableCore: handleDrag: %j",i);if(!1!==this.props.onDrag(e,i)&&!1!==this.mounted)this.lastX=r,this.lastY=n;else try{this.handleDragStop(new MouseEvent("mouseup"))}catch(e){const t=document.createEvent("MouseEvents");t.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(t)}})),h(this,"handleDragStop",(e=>{if(!this.dragging)return;const t=(0,s.getControlPosition)(e,this.touchIdentifier,this);if(null==t)return;let{x:r,y:n}=t;if(Array.isArray(this.props.grid)){let e=r-this.lastX||0,t=n-this.lastY||0;[e,t]=(0,s.snapToGrid)(this.props.grid,e,t),r=this.lastX+e,n=this.lastY+t}const i=(0,s.createCoreData)(this,r,n);if(!1===this.props.onStop(e,i)||!1===this.mounted)return!1;const a=this.findDOMNode();a&&this.props.enableUserSelectHack&&(0,o.removeUserSelectStyles)(a.ownerDocument),(0,u.default)("DraggableCore: handleDragStop: %j",i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&((0,u.default)("DraggableCore: Removing handlers"),(0,o.removeEvent)(a.ownerDocument,m.move,this.handleDrag),(0,o.removeEvent)(a.ownerDocument,m.stop,this.handleDragStop))})),h(this,"onMouseDown",(e=>(m=f,this.handleDragStart(e)))),h(this,"onMouseUp",(e=>(m=f,this.handleDragStop(e)))),h(this,"onTouchStart",(e=>(m=p,this.handleDragStart(e)))),h(this,"onTouchEnd",(e=>(m=p,this.handleDragStop(e))))}componentDidMount(){this.mounted=!0;const e=this.findDOMNode();e&&(0,o.addEvent)(e,p.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const e=this.findDOMNode();if(e){const{ownerDocument:t}=e;(0,o.removeEvent)(t,f.move,this.handleDrag),(0,o.removeEvent)(t,p.move,this.handleDrag),(0,o.removeEvent)(t,f.stop,this.handleDragStop),(0,o.removeEvent)(t,p.stop,this.handleDragStop),(0,o.removeEvent)(e,p.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,o.removeUserSelectStyles)(t)}}findDOMNode(){var e,t;return null!==(e=this.props)&&void 0!==e&&e.nodeRef?null===(t=this.props)||void 0===t||null===(t=t.nodeRef)||void 0===t?void 0:t.current:a.default.findDOMNode(this)}render(){return n.cloneElement(n.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}}t.default=g,h(g,"displayName","DraggableCore"),h(g,"propTypes",{allowAnyClick:i.default.bool,children:i.default.node.isRequired,disabled:i.default.bool,enableUserSelectHack:i.default.bool,offsetParent:function(e,t){if(e[t]&&1!==e[t].nodeType)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:i.default.arrayOf(i.default.number),handle:i.default.string,cancel:i.default.string,nodeRef:i.default.object,onStart:i.default.func,onDrag:i.default.func,onStop:i.default.func,onMouseDown:i.default.func,scale:i.default.number,className:l.dontSetMe,style:l.dontSetMe,transform:l.dontSetMe}),h(g,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1})},8230:(e,t,r)=>{"use strict";const{default:n,DraggableCore:i}=r(9111);e.exports=n,e.exports.default=n,e.exports.DraggableCore=i},2837:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addClassName=u,t.addEvent=function(e,t,r,n){if(!e)return;const i={capture:!0,...n};e.addEventListener?e.addEventListener(t,r,i):e.attachEvent?e.attachEvent("on"+t,r):e["on"+t]=r},t.addUserSelectStyles=function(e){if(!e)return;let t=e.getElementById("react-draggable-style-el");t||(t=e.createElement("style"),t.type="text/css",t.id="react-draggable-style-el",t.innerHTML=".react-draggable-transparent-selection *::-moz-selection {all: inherit;}\n",t.innerHTML+=".react-draggable-transparent-selection *::selection {all: inherit;}\n",e.getElementsByTagName("head")[0].appendChild(t));e.body&&u(e.body,"react-draggable-transparent-selection")},t.createCSSTransform=function(e,t){const r=l(e,t,"px");return{[(0,i.browserPrefixToKey)("transform",i.default)]:r}},t.createSVGTransform=function(e,t){return l(e,t,"")},t.getTouch=function(e,t){return e.targetTouches&&(0,n.findInArray)(e.targetTouches,(e=>t===e.identifier))||e.changedTouches&&(0,n.findInArray)(e.changedTouches,(e=>t===e.identifier))},t.getTouchIdentifier=function(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier},t.getTranslation=l,t.innerHeight=function(e){let t=e.clientHeight;const r=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,n.int)(r.paddingTop),t-=(0,n.int)(r.paddingBottom),t},t.innerWidth=function(e){let t=e.clientWidth;const r=e.ownerDocument.defaultView.getComputedStyle(e);return t-=(0,n.int)(r.paddingLeft),t-=(0,n.int)(r.paddingRight),t},t.matchesSelector=s,t.matchesSelectorAndParentsTo=function(e,t,r){let n=e;do{if(s(n,t))return!0;if(n===r)return!1;n=n.parentNode}while(n);return!1},t.offsetXYFromParent=function(e,t,r){const n=t===t.ownerDocument.body?{left:0,top:0}:t.getBoundingClientRect(),i=(e.clientX+t.scrollLeft-n.left)/r,a=(e.clientY+t.scrollTop-n.top)/r;return{x:i,y:a}},t.outerHeight=function(e){let t=e.clientHeight;const r=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,n.int)(r.borderTopWidth),t+=(0,n.int)(r.borderBottomWidth),t},t.outerWidth=function(e){let t=e.clientWidth;const r=e.ownerDocument.defaultView.getComputedStyle(e);return t+=(0,n.int)(r.borderLeftWidth),t+=(0,n.int)(r.borderRightWidth),t},t.removeClassName=c,t.removeEvent=function(e,t,r,n){if(!e)return;const i={capture:!0,...n};e.removeEventListener?e.removeEventListener(t,r,i):e.detachEvent?e.detachEvent("on"+t,r):e["on"+t]=null},t.removeUserSelectStyles=function(e){if(!e)return;try{if(e.body&&c(e.body,"react-draggable-transparent-selection"),e.selection)e.selection.empty();else{const t=(e.defaultView||window).getSelection();t&&"Caret"!==t.type&&t.removeAllRanges()}}catch(e){}};var n=r(6732),i=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=a(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=e[o]}n.default=e,r&&r.set(e,n);return n}(r(7350));function a(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(a=function(e){return e?r:t})(e)}let o="";function s(e,t){return o||(o=(0,n.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],(function(t){return(0,n.isFunction)(e[t])}))),!!(0,n.isFunction)(e[o])&&e[o](t)}function l(e,t,r){let{x:n,y:i}=e,a="translate(".concat(n).concat(r,",").concat(i).concat(r,")");if(t){const e="".concat("string"==typeof t.x?t.x:t.x+r),n="".concat("string"==typeof t.y?t.y:t.y+r);a="translate(".concat(e,", ").concat(n,")")+a}return a}function u(e,t){e.classList?e.classList.add(t):e.className.match(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)")))||(e.className+=" ".concat(t))}function c(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(?:^|\\s)".concat(t,"(?!\\S)"),"g"),"")}},7350:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.browserPrefixToKey=i,t.browserPrefixToStyle=function(e,t){return t?"-".concat(t.toLowerCase(),"-").concat(e):e},t.default=void 0,t.getPrefix=n;const r=["Moz","Webkit","O","ms"];function n(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"transform";if("undefined"==typeof window)return"";const n=null===(e=window.document)||void 0===e||null===(e=e.documentElement)||void 0===e?void 0:e.style;if(!n)return"";if(t in n)return"";for(let e=0;e{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){0}},402:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.canDragX=function(e){return"both"===e.props.axis||"x"===e.props.axis},t.canDragY=function(e){return"both"===e.props.axis||"y"===e.props.axis},t.createCoreData=function(e,t,r){const i=!(0,n.isNum)(e.lastX),o=a(e);return i?{node:o,deltaX:0,deltaY:0,lastX:t,lastY:r,x:t,y:r}:{node:o,deltaX:t-e.lastX,deltaY:r-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:r}},t.createDraggableData=function(e,t){const r=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/r,y:e.state.y+t.deltaY/r,deltaX:t.deltaX/r,deltaY:t.deltaY/r,lastX:e.state.x,lastY:e.state.y}},t.getBoundPosition=function(e,t,r){if(!e.props.bounds)return[t,r];let{bounds:o}=e.props;o="string"==typeof o?o:function(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}(o);const s=a(e);if("string"==typeof o){const{ownerDocument:e}=s,t=e.defaultView;let r;if(r="parent"===o?s.parentNode:e.querySelector(o),!(r instanceof t.HTMLElement))throw new Error('Bounds selector "'+o+'" could not find an element.');const a=r,l=t.getComputedStyle(s),u=t.getComputedStyle(a);o={left:-s.offsetLeft+(0,n.int)(u.paddingLeft)+(0,n.int)(l.marginLeft),top:-s.offsetTop+(0,n.int)(u.paddingTop)+(0,n.int)(l.marginTop),right:(0,i.innerWidth)(a)-(0,i.outerWidth)(s)-s.offsetLeft+(0,n.int)(u.paddingRight)-(0,n.int)(l.marginRight),bottom:(0,i.innerHeight)(a)-(0,i.outerHeight)(s)-s.offsetTop+(0,n.int)(u.paddingBottom)-(0,n.int)(l.marginBottom)}}(0,n.isNum)(o.right)&&(t=Math.min(t,o.right));(0,n.isNum)(o.bottom)&&(r=Math.min(r,o.bottom));(0,n.isNum)(o.left)&&(t=Math.max(t,o.left));(0,n.isNum)(o.top)&&(r=Math.max(r,o.top));return[t,r]},t.getControlPosition=function(e,t,r){const n="number"==typeof t?(0,i.getTouch)(e,t):null;if("number"==typeof t&&!n)return null;const o=a(r),s=r.props.offsetParent||o.offsetParent||o.ownerDocument.body;return(0,i.offsetXYFromParent)(n||e,s,r.props.scale)},t.snapToGrid=function(e,t,r){const n=Math.round(t/e[0])*e[0],i=Math.round(r/e[1])*e[1];return[n,i]};var n=r(6732),i=r(2837);function a(e){const t=e.findDOMNode();if(!t)throw new Error(": Unmounted during event!");return t}},6732:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.dontSetMe=function(e,t,r){if(e[t])return new Error("Invalid prop ".concat(t," passed to ").concat(r," - do not set this, set it on the child."))},t.findInArray=function(e,t){for(let r=0,n=e.length;r{"use strict";function n(e){var t,r,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;ti,default:()=>a});const a=i},7383:e=>{var t="undefined"!=typeof Element,r="function"==typeof Map,n="function"==typeof Set,i="function"==typeof ArrayBuffer&&!!ArrayBuffer.isView;function a(e,o){if(e===o)return!0;if(e&&o&&"object"==typeof e&&"object"==typeof o){if(e.constructor!==o.constructor)return!1;var s,l,u,c;if(Array.isArray(e)){if((s=e.length)!=o.length)return!1;for(l=s;0!=l--;)if(!a(e[l],o[l]))return!1;return!0}if(r&&e instanceof Map&&o instanceof Map){if(e.size!==o.size)return!1;for(c=e.entries();!(l=c.next()).done;)if(!o.has(l.value[0]))return!1;for(c=e.entries();!(l=c.next()).done;)if(!a(l.value[1],o.get(l.value[0])))return!1;return!0}if(n&&e instanceof Set&&o instanceof Set){if(e.size!==o.size)return!1;for(c=e.entries();!(l=c.next()).done;)if(!o.has(l.value[0]))return!1;return!0}if(i&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(o)){if((s=e.length)!=o.length)return!1;for(l=s;0!=l--;)if(e[l]!==o[l])return!1;return!0}if(e.constructor===RegExp)return e.source===o.source&&e.flags===o.flags;if(e.valueOf!==Object.prototype.valueOf&&"function"==typeof e.valueOf&&"function"==typeof o.valueOf)return e.valueOf()===o.valueOf();if(e.toString!==Object.prototype.toString&&"function"==typeof e.toString&&"function"==typeof o.toString)return e.toString()===o.toString();if((s=(u=Object.keys(e)).length)!==Object.keys(o).length)return!1;for(l=s;0!=l--;)if(!Object.prototype.hasOwnProperty.call(o,u[l]))return!1;if(t&&e instanceof Element)return!1;for(l=s;0!=l--;)if(("_owner"!==u[l]&&"__v"!==u[l]&&"__o"!==u[l]||!e.$$typeof)&&!a(e[u[l]],o[u[l]]))return!1;return!0}return e!=e&&o!=o}e.exports=function(e,t){try{return a(e,t)}catch(e){if((e.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw e}}},8100:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=h(r(5959)),a=h(r(2688)),o=r(8230),s=r(936),l=r(414),u=r(906),c=r(7222),d=h(r(7256));function h(e){return e&&e.__esModule?e:{default:e}}function p(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 f(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:this.props;return{cols:e.cols,containerPadding:e.containerPadding,containerWidth:e.containerWidth,margin:e.margin,maxRows:e.maxRows,rowHeight:e.rowHeight}}},{key:"createStyle",value:function(e){var t,r=this.props,n=r.usePercentages,i=r.containerWidth;return r.useCSSTransforms?t=(0,l.setTransform)(e):(t=(0,l.setTopLeft)(e),n&&(t.left=(0,l.perc)(e.left/i),t.width=(0,l.perc)(e.width/i))),t}},{key:"mixinDraggable",value:function(e,t){return i.default.createElement(o.DraggableCore,{disabled:!t,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,handle:this.props.handle,cancel:".react-resizable-handle"+(this.props.cancel?","+this.props.cancel:""),scale:this.props.transformScale,nodeRef:this.elementRef},e)}},{key:"mixinResizable",value:function(e,t,r){var n=this.props,a=n.cols,o=n.x,l=n.minW,c=n.minH,d=n.maxW,h=n.maxH,p=n.transformScale,f=n.resizeHandles,m=n.resizeHandle,g=this.getPositionParams(),v=(0,u.calcGridItemPosition)(g,0,0,a-o,0).width,y=(0,u.calcGridItemPosition)(g,0,0,l,c),b=(0,u.calcGridItemPosition)(g,0,0,d,h),w=[y.width,y.height],S=[Math.min(b.width,v),Math.min(b.height,1/0)];return i.default.createElement(s.Resizable,{draggableOpts:{disabled:!r},className:r?void 0:"react-resizable-hide",width:t.width,height:t.height,minConstraints:w,maxConstraints:S,onResizeStop:this.onResizeStop,onResizeStart:this.onResizeStart,onResize:this.onResize,transformScale:p,resizeHandles:f,handle:m},e)}},{key:"onResizeHandler",value:function(e,t,r){var n=t.node,i=t.size,a=this.props[r];if(a){var o=this.props,s=o.cols,l=o.x,c=o.y,d=o.i,h=o.maxH,p=o.minH,f=this.props,m=f.minW,g=f.maxW,v=(0,u.calcWH)(this.getPositionParams(),i.width,i.height,l,c),y=v.w,b=v.h;m=Math.max(m,1),g=Math.min(g,s-l),y=(0,u.clamp)(y,m,g),b=(0,u.clamp)(b,p,h),this.setState({resizing:"onResizeStop"===r?null:i}),a.call(this,d,y,b,{e,node:n,size:i})}}},{key:"render",value:function(){var e=this.props,t=e.x,r=e.y,n=e.w,a=e.h,o=e.isDraggable,s=e.isResizable,l=e.droppingPosition,c=e.useCSSTransforms,h=(0,u.calcGridItemPosition)(this.getPositionParams(),t,r,n,a,this.state),p=i.default.Children.only(this.props.children),m=i.default.cloneElement(p,{ref:this.elementRef,className:(0,d.default)("react-grid-item",p.props.className,this.props.className,{static:this.props.static,resizing:Boolean(this.state.resizing),"react-draggable":o,"react-draggable-dragging":Boolean(this.state.dragging),dropping:Boolean(l),cssTransforms:c}),style:f(f(f({},this.props.style),p.props.style),this.createStyle(h))});return m=this.mixinResizable(m,h,s),m=this.mixinDraggable(m,o)}}],r&&m(t.prototype,r),n&&m(t,n),Object.defineProperty(t,"prototype",{writable:!1}),c}(i.default.Component);t.default=S,w(S,"propTypes",{children:a.default.element,cols:a.default.number.isRequired,containerWidth:a.default.number.isRequired,rowHeight:a.default.number.isRequired,margin:a.default.array.isRequired,maxRows:a.default.number.isRequired,containerPadding:a.default.array.isRequired,x:a.default.number.isRequired,y:a.default.number.isRequired,w:a.default.number.isRequired,h:a.default.number.isRequired,minW:function(e,t){var r=e[t];return"number"!=typeof r?new Error("minWidth not Number"):r>e.w||r>e.maxW?new Error("minWidth larger than item width/maxWidth"):void 0},maxW:function(e,t){var r=e[t];return"number"!=typeof r?new Error("maxWidth not Number"):re.h||r>e.maxH?new Error("minHeight larger than item height/maxHeight"):void 0},maxH:function(e,t){var r=e[t];return"number"!=typeof r?new Error("maxHeight not Number"):r{"use strict";function n(e){return n="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},n(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var r=h(t);if(r&&r.has(e))return r.get(e);var i={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=a?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(i,o,s):i[o]=e[o]}i.default=e,r&&r.set(e,i);return i}(r(5959)),a=d(r(7842)),o=d(r(7256)),s=r(414),l=r(906),u=d(r(8100)),c=d(r(7222));function d(e){return e&&e.__esModule?e:{default:e}}function h(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(h=function(e){return e?r:t})(e)}function p(e){return function(e){if(Array.isArray(e))return y(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||v(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(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 m(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r0){var a=1/0,o=1/0;i.forEach((function(t){t.x>e.x&&(a=Math.min(a,t.x)),t.y>e.y&&(o=Math.min(o,t.y))})),Number.isFinite(a)&&(e.w=a-e.x),Number.isFinite(o)&&(e.h=o-e.y)}}return t||(e.w=r,e.h=n),e})),y=g(v,2),b=y[0],w=y[1];if(w){var S={w:w.w,h:w.h,x:w.x,y:w.y,static:!0,i:t};e.props.onResize(b,c,w,S,a,o),e.setState({layout:f?b:(0,s.compact)(b,(0,s.compactType)(e.props),h),activeDrag:S})}})),_(x(e),"onResizeStop",(function(t,r,n,i){var a=i.e,o=i.node,l=e.state,u=l.layout,c=l.oldResizeItem,d=e.props,h=d.cols,p=d.allowOverlap,f=(0,s.getLayoutItem)(u,t);e.props.onResizeStop(u,c,f,null,a,o);var m=p?u:(0,s.compact)(u,(0,s.compactType)(e.props),h),g=e.state.oldLayout;e.setState({activeDrag:null,layout:m,oldResizeItem:null,oldLayout:null}),e.onLayoutMaybeChanged(m,g)})),_(x(e),"onDragOver",(function(t){var r;if(t.preventDefault(),t.stopPropagation(),k&&(null===(r=t.nativeEvent.target)||void 0===r||!r.classList.contains(E)))return!1;var n=e.props,a=n.droppingItem,o=n.onDropDragOver,s=n.margin,u=n.cols,c=n.rowHeight,d=n.maxRows,h=n.width,f=n.containerPadding,g=n.transformScale,v=null==o?void 0:o(t);if(!1===v)return e.state.droppingDOMNode&&e.removeDroppingPlaceholder(),!1;var y=m(m({},a),v),b=e.state.layout,w=t.nativeEvent,S=w.layerX,x=w.layerY,O={left:S/g,top:x/g,e:t};if(e.state.droppingDOMNode){if(e.state.droppingPosition){var _=e.state.droppingPosition,C=_.left,T=_.top;(C!=S||T!=x)&&e.setState({droppingPosition:O})}}else{var A={cols:u,margin:s,maxRows:d,rowHeight:c,containerWidth:h,containerPadding:f||s},R=(0,l.calcXY)(A,x,S,y.w,y.h);e.setState({droppingDOMNode:i.createElement("div",{key:y.i}),droppingPosition:O,layout:[].concat(p(b),[m(m({},y),{},{x:R.x,y:R.y,static:!1,isDraggable:!0})])})}})),_(x(e),"removeDroppingPlaceholder",(function(){var t=e.props,r=t.droppingItem,n=t.cols,i=e.state.layout,a=(0,s.compact)(i.filter((function(e){return e.i!==r.i})),(0,s.compactType)(e.props),n);e.setState({layout:a,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})})),_(x(e),"onDragLeave",(function(t){t.preventDefault(),t.stopPropagation(),e.dragEnterCounter--,0===e.dragEnterCounter&&e.removeDroppingPlaceholder()})),_(x(e),"onDragEnter",(function(t){t.preventDefault(),t.stopPropagation(),e.dragEnterCounter++})),_(x(e),"onDrop",(function(t){t.preventDefault(),t.stopPropagation();var r=e.props.droppingItem,n=e.state.layout,i=n.find((function(e){return e.i===r.i}));e.dragEnterCounter=0,e.removeDroppingPlaceholder(),e.props.onDrop(n,i,t)})),e}return t=d,n=[{key:"getDerivedStateFromProps",value:function(e,t){var r;return t.activeDrag?null:((0,a.default)(e.layout,t.propsLayout)&&e.compactType===t.compactType?(0,s.childrenEqual)(e.children,t.children)||(r=t.layout):r=e.layout,r?{layout:(0,s.synchronizeLayoutWithChildren)(r,e.children,e.cols,(0,s.compactType)(e),e.allowOverlap),compactType:e.compactType,children:e.children,propsLayout:e.layout}:null)}}],(r=[{key:"componentDidMount",value:function(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}},{key:"shouldComponentUpdate",value:function(e,t){return this.props.children!==e.children||!(0,s.fastRGLPropsEqual)(this.props,e,a.default)||this.state.activeDrag!==t.activeDrag||this.state.mounted!==t.mounted||this.state.droppingPosition!==t.droppingPosition}},{key:"componentDidUpdate",value:function(e,t){if(!this.state.activeDrag){var r=this.state.layout,n=t.layout;this.onLayoutMaybeChanged(r,n)}}},{key:"containerHeight",value:function(){if(this.props.autoSize){var e=(0,s.bottom)(this.state.layout),t=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return e*this.props.rowHeight+(e-1)*this.props.margin[1]+2*t+"px"}}},{key:"onLayoutMaybeChanged",value:function(e,t){t||(t=this.state.layout),(0,a.default)(t,e)||this.props.onLayoutChange(e)}},{key:"placeholder",value:function(){var e=this.state.activeDrag;if(!e)return null;var t=this.props,r=t.width,n=t.cols,a=t.margin,o=t.containerPadding,s=t.rowHeight,l=t.maxRows,c=t.useCSSTransforms,d=t.transformScale;return i.createElement(u.default,{w:e.w,h:e.h,x:e.x,y:e.y,i:e.i,className:"react-grid-placeholder",containerWidth:r,cols:n,margin:a,containerPadding:o||a,maxRows:l,rowHeight:s,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:c,transformScale:d},i.createElement("div",null))}},{key:"processGridItem",value:function(e,t){if(e&&e.key){var r=(0,s.getLayoutItem)(this.state.layout,String(e.key));if(!r)return null;var n=this.props,a=n.width,o=n.cols,l=n.margin,c=n.containerPadding,d=n.rowHeight,h=n.maxRows,p=n.isDraggable,f=n.isResizable,m=n.isBounded,g=n.useCSSTransforms,v=n.transformScale,y=n.draggableCancel,b=n.draggableHandle,w=n.resizeHandles,S=n.resizeHandle,x=this.state,O=x.mounted,_=x.droppingPosition,E="boolean"==typeof r.isDraggable?r.isDraggable:!r.static&&p,k="boolean"==typeof r.isResizable?r.isResizable:!r.static&&f,C=r.resizeHandles||w,T=E&&m&&!1!==r.isBounded;return i.createElement(u.default,{containerWidth:a,cols:o,margin:l,containerPadding:c||l,maxRows:h,rowHeight:d,cancel:y,handle:b,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:E,isResizable:k,isBounded:T,useCSSTransforms:g&&O,usePercentages:!O,transformScale:v,w:r.w,h:r.h,x:r.x,y:r.y,i:r.i,minH:r.minH,minW:r.minW,maxH:r.maxH,maxW:r.maxW,static:r.static,droppingPosition:t?_:void 0,resizeHandles:C,resizeHandle:S},e)}}},{key:"render",value:function(){var e=this,t=this.props,r=t.className,n=t.style,a=t.isDroppable,l=t.innerRef,u=(0,o.default)(E,r),c=m({height:this.containerHeight()},n);return i.createElement("div",{ref:l,className:u,style:c,onDrop:a?this.onDrop:s.noop,onDragLeave:a?this.onDragLeave:s.noop,onDragEnter:a?this.onDragEnter:s.noop,onDragOver:a?this.onDragOver:s.noop},i.Children.map(this.props.children,(function(t){return e.processGridItem(t)})),a&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}}])&&b(t.prototype,r),n&&b(t,n),Object.defineProperty(t,"prototype",{writable:!1}),d}(i.Component);t.default=C,_(C,"displayName","ReactGridLayout"),_(C,"propTypes",c.default),_(C,"defaultProps",{autoSize:!0,cols:12,className:"",style:{},draggableHandle:"",draggableCancel:"",containerPadding:null,rowHeight:150,maxRows:1/0,layout:[],margin:[10,10],isBounded:!1,isDraggable:!0,isResizable:!0,allowOverlap:!1,isDroppable:!1,useCSSTransforms:!0,transformScale:1,verticalCompact:!0,compactType:"vertical",preventCollision:!1,droppingItem:{i:"__dropping-elem__",h:1,w:1},resizeHandles:["se"],onLayoutChange:s.noop,onDragStart:s.noop,onDrag:s.noop,onDragStop:s.noop,onResizeStart:s.noop,onResize:s.noop,onResizeStop:s.noop,onDrop:s.noop,onDropDragOver:s.noop})},7222:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resizeHandleType=t.resizeHandleAxesType=t.default=void 0;var n=a(r(2688)),i=a(r(5959));function a(e){return e&&e.__esModule?e:{default:e}}var o=n.default.arrayOf(n.default.oneOf(["s","w","e","n","sw","nw","se","ne"]));t.resizeHandleAxesType=o;var s=n.default.oneOfType([n.default.node,n.default.func]);t.resizeHandleType=s;var l={className:n.default.string,style:n.default.object,width:n.default.number,autoSize:n.default.bool,cols:n.default.number,draggableCancel:n.default.string,draggableHandle:n.default.string,verticalCompact:function(e){e.verticalCompact,0},compactType:n.default.oneOf(["vertical","horizontal"]),layout:function(e){var t=e.layout;void 0!==t&&r(414).validateLayout(t,"layout")},margin:n.default.arrayOf(n.default.number),containerPadding:n.default.arrayOf(n.default.number),rowHeight:n.default.number,maxRows:n.default.number,isBounded:n.default.bool,isDraggable:n.default.bool,isResizable:n.default.bool,allowOverlap:n.default.bool,preventCollision:n.default.bool,useCSSTransforms:n.default.bool,transformScale:n.default.number,isDroppable:n.default.bool,resizeHandles:o,resizeHandle:s,onLayoutChange:n.default.func,onDragStart:n.default.func,onDrag:n.default.func,onDragStop:n.default.func,onResizeStart:n.default.func,onResize:n.default.func,onResizeStop:n.default.func,onDrop:n.default.func,droppingItem:n.default.shape({i:n.default.string.isRequired,w:n.default.number.isRequired,h:n.default.number.isRequired}),children:function(e,t){var r=e[t],n={};i.default.Children.forEach(r,(function(e){if(null!=(null==e?void 0:e.key)){if(n[e.key])throw new Error('Duplicate child key "'+e.key+'" found! This will cause problems in ReactGridLayout.');n[e.key]=!0}}))},innerRef:n.default.any};t.default=l},4636:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}t.default=void 0;var i=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var r=h(t);if(r&&r.has(e))return r.get(e);var i={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=a?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(i,o,s):i[o]=e[o]}i.default=e,r&&r.set(e,i);return i}(r(5959)),a=d(r(2688)),o=d(r(7842)),s=r(414),l=r(544),u=d(r(9482)),c=["breakpoint","breakpoints","cols","layouts","margin","containerPadding","onBreakpointChange","onLayoutChange","onWidthChange"];function d(e){return e&&e.__esModule?e:{default:e}}function h(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(h=function(e){return e?r:t})(e)}function p(){return p=Object.assign||function(e){for(var t=1;t=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function m(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 g(e){for(var t=1;t{"use strict";function r(e){var t=e.margin,r=e.containerPadding,n=e.containerWidth,i=e.cols;return(n-t[0]*(i-1)-2*r[0])/i}function n(e,t,r){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*r):e}function i(e,t,r){return Math.max(Math.min(e,r),t)}Object.defineProperty(t,"__esModule",{value:!0}),t.calcGridColWidth=r,t.calcGridItemPosition=function(e,t,i,a,o,s){var l=e.margin,u=e.containerPadding,c=e.rowHeight,d=r(e),h={};s&&s.resizing?(h.width=Math.round(s.resizing.width),h.height=Math.round(s.resizing.height)):(h.width=n(a,d,l[0]),h.height=n(o,c,l[1]));s&&s.dragging?(h.top=Math.round(s.dragging.top),h.left=Math.round(s.dragging.left)):(h.top=Math.round((c+l[1])*i+u[1]),h.left=Math.round((d+l[0])*t+u[0]));return h},t.calcGridItemWHPx=n,t.calcWH=function(e,t,n,a,o){var s=e.margin,l=e.maxRows,u=e.cols,c=e.rowHeight,d=r(e),h=Math.round((t+s[0])/(d+s[0])),p=Math.round((n+s[1])/(c+s[1]));return h=i(h,0,u-a),p=i(p,0,l-o),{w:h,h:p}},t.calcXY=function(e,t,n,a,o){var s=e.margin,l=e.cols,u=e.rowHeight,c=e.maxRows,d=r(e),h=Math.round((n-s[0])/(d+s[0])),p=Math.round((t-s[1])/(u+s[1]));return h=i(h,0,l-a),p=i(p,0,c-o),{x:h,y:p}},t.clamp=i},6805:(e,t,r)=>{"use strict";function n(e){return n="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},n(e)}t.default=function(e){var t;return t=function(t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&h(e,t)}(u,t);var r,a,l=(r=u,a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=f(r);if(a){var i=f(this).constructor;e=Reflect.construct(t,arguments,i)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return p(e)}(this,e)});function u(){var e;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u);for(var t=arguments.length,r=new Array(t),n=0;n=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}(t,s);return r&&!this.mounted?i.createElement("div",{className:(0,o.default)(this.props.className,g),style:this.props.style,ref:this.elementRef}):i.createElement(e,c({innerRef:this.elementRef},n,this.state))}}]),u}(i.Component),m(t,"defaultProps",{measureBeforeMount:!1}),m(t,"propTypes",{measureBeforeMount:a.default.bool}),t};var i=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==n(e)&&"function"!=typeof e)return{default:e};var r=u(t);if(r&&r.has(e))return r.get(e);var i={},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=a?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(i,o,s):i[o]=e[o]}i.default=e,r&&r.set(e,i);return i}(r(5959)),a=l(r(2688)),o=l(r(7256)),s=["measureBeforeMount"];function l(e){return e&&e.__esModule?e:{default:e}}function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(u=function(e){return e?r:t})(e)}function c(){return c=Object.assign||function(e){for(var t=1;t{e.exports=function(e,t,r){return e===t||e.className===t.className&&r(e.style,t.style)&&e.width===t.width&&e.autoSize===t.autoSize&&e.cols===t.cols&&e.draggableCancel===t.draggableCancel&&e.draggableHandle===t.draggableHandle&&r(e.verticalCompact,t.verticalCompact)&&r(e.compactType,t.compactType)&&r(e.layout,t.layout)&&r(e.margin,t.margin)&&r(e.containerPadding,t.containerPadding)&&e.rowHeight===t.rowHeight&&e.maxRows===t.maxRows&&e.isBounded===t.isBounded&&e.isDraggable===t.isDraggable&&e.isResizable===t.isResizable&&e.allowOverlap===t.allowOverlap&&e.preventCollision===t.preventCollision&&e.useCSSTransforms===t.useCSSTransforms&&e.transformScale===t.transformScale&&e.isDroppable===t.isDroppable&&r(e.resizeHandles,t.resizeHandles)&&r(e.resizeHandle,t.resizeHandle)&&e.onLayoutChange===t.onLayoutChange&&e.onDragStart===t.onDragStart&&e.onDrag===t.onDrag&&e.onDragStop===t.onDragStop&&e.onResizeStart===t.onResizeStart&&e.onResize===t.onResize&&e.onResizeStop===t.onResizeStop&&e.onDrop===t.onDrop&&r(e.droppingItem,t.droppingItem)&&r(e.innerRef,t.innerRef)}},544:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findOrGenerateResponsiveLayout=function(e,t,r,a,o,s){if(e[r])return(0,n.cloneLayout)(e[r]);for(var l=e[a],u=i(t),c=u.slice(u.indexOf(r)),d=0,h=c.length;de[s]&&(n=s)}return n},t.getColsFromBreakpoint=function(e,t){if(!t[e])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+e+" is missing!");return t[e]},t.sortBreakpoints=i;var n=r(414);function i(e){return Object.keys(e).sort((function(t,r){return e[t]-e[r]}))}},414:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bottom=d,t.childrenEqual=function(e,t){return(0,n.default)(i.default.Children.map(e,(function(e){return null==e?void 0:e.key})),i.default.Children.map(t,(function(e){return null==e?void 0:e.key})))},t.cloneLayout=h,t.cloneLayoutItem=f,t.collides=g,t.compact=v,t.compactItem=w,t.compactType=function(e){var t=e||{},r=t.verticalCompact,n=t.compactType;return!1===r?null:n},t.correctBounds=S,t.fastPositionEqual=function(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height},t.fastRGLPropsEqual=void 0,t.getAllCollisions=_,t.getFirstCollision=O,t.getLayoutItem=x,t.getStatics=E,t.modifyLayout=p,t.moveElement=k,t.moveElementAwayFromCollision=C,t.noop=void 0,t.perc=function(e){return 100*e+"%"},t.setTopLeft=function(e){var t=e.top,r=e.left,n=e.width,i=e.height;return{top:"".concat(t,"px"),left:"".concat(r,"px"),width:"".concat(n,"px"),height:"".concat(i,"px"),position:"absolute"}},t.setTransform=function(e){var t=e.top,r=e.left,n=e.width,i=e.height,a="translate(".concat(r,"px,").concat(t,"px)");return{transform:a,WebkitTransform:a,MozTransform:a,msTransform:a,OTransform:a,width:"".concat(n,"px"),height:"".concat(i,"px"),position:"absolute"}},t.sortLayoutItems=T,t.sortLayoutItemsByColRow=R,t.sortLayoutItemsByRowCol=A,t.synchronizeLayoutWithChildren=function(e,t,r,n,a){e=e||[];var o=[];i.default.Children.forEach(t,(function(t){if(null!=(null==t?void 0:t.key)){var r=x(e,String(t.key));if(r)o.push(f(r));else{!u&&t.props._grid&&console.warn("`_grid` properties on children have been deprecated as of React 15.2. Please use `data-grid` or add your properties directly to the `layout`.");var n=t.props["data-grid"]||t.props._grid;n?(u||D([n],"ReactGridLayout.children"),o.push(f(s(s({},n),{},{i:t.key})))):o.push(f({w:1,h:1,x:0,y:d(o),i:String(t.key)}))}}}));var l=S(o,{cols:r});return a?l:v(l,n,r)},t.validateLayout=D,t.withLayoutItem=function(e,t,r){var n=x(e,t);return n?(n=r(f(n)),[e=p(e,n),n]):[e,null]};var n=a(r(7842)),i=a(r(5959));function a(e){return e&&e.__esModule?e:{default:e}}function o(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 s(e){for(var t=1;tr&&(r=t);return r}function h(e){for(var t=Array(e.length),r=0,n=e.length;r=t.x+t.w)&&(!(e.y+e.h<=t.y)&&!(e.y>=t.y+t.h))))}function v(e,t,r){for(var n=E(e),i=T(e,t),a=Array(e.length),o=0,s=i.length;ot.y+t.h)break;g(t,o)&&b(e,o,r+t[i],n)}}t[n]=r}function w(e,t,r,n,i){var a,o="horizontal"===r;if("vertical"===r)for(t.y=Math.min(d(e),t.y);t.y>0&&!O(e,t);)t.y--;else if(o)for(;t.x>0&&!O(e,t);)t.x--;for(;a=O(e,t);)o?b(i,t,a.x+a.w,"x"):b(i,t,a.y+a.h,"y"),o&&t.x+t.w>n&&(t.x=n-t.w,t.y++);return t.y=Math.max(t.y,0),t.x=Math.max(t.x,0),t}function S(e,t){for(var r=E(e),n=0,i=e.length;nt.cols&&(a.x=t.cols-a.w),a.x<0&&(a.x=0,a.w=t.cols),a.static)for(;O(r,a);)a.y++;else r.push(a)}return e}function x(e,t){for(var r=0,n=e.length;r=n:"horizontal"===o&&"number"==typeof r&&u>=r)&&(d=d.reverse());var p=_(d,t),f=p.length>0;if(f&&l)return h(e);if(f&&a)return P("Collision prevented on ".concat(t.i,", reverting.")),t.x=u,t.y=c,t.moved=!1,e;for(var m=0,g=p.length;mt.y||e.y===t.y&&e.x>t.x?1:e.y===t.y&&e.x===t.x?0:-1}))}function R(e){return e.slice(0).sort((function(e,t){return e.x>t.x||e.x===t.x&&e.y>t.y?1:-1}))}function D(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Layout",r=["x","y","w","h"];if(!Array.isArray(e))throw new Error(t+" must be an array!");for(var n=0,i=e.length;n{e.exports=r(9482).default,e.exports.utils=r(414),e.exports.Responsive=r(4636).default,e.exports.Responsive.utils=r(544),e.exports.WidthProvider=r(6805).default},7256:(e,t,r)=>{"use strict";function n(e){var t,r,i="";if("string"==typeof e||"number"==typeof e)i+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;ti,default:()=>a});const a=i},9814:(e,t,r)=>{"use strict";r.d(t,{m:()=>fe});var n,i,a,o,s=r(2688),l=r.n(s),u=r(9406),c=r.n(u),d=r(7383),h=r.n(d),p=r(5959),f=r.n(p),m=r(1664),g=r.n(m),v="bodyAttributes",y="htmlAttributes",b="titleAttributes",w={BASE:"base",BODY:"body",HEAD:"head",HTML:"html",LINK:"link",META:"meta",NOSCRIPT:"noscript",SCRIPT:"script",STYLE:"style",TITLE:"title"},S=(Object.keys(w).map((function(e){return w[e]})),"charset"),x="cssText",O="href",_="http-equiv",E="innerHTML",k="itemprop",C="name",T="property",A="rel",R="src",D="target",P={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},j="defaultTitle",I="defer",L="encodeSpecialCharacters",M="onChangeClientState",N="titleTemplate",F=Object.keys(P).reduce((function(e,t){return e[P[t]]=t,e}),{}),V=[w.NOSCRIPT,w.SCRIPT,w.STYLE],z="data-react-helmet",B="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},$=function(){function e(e,t){for(var r=0;r=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r},H=function(e){return!1===(!(arguments.length>1&&void 0!==arguments[1])||arguments[1])?String(e):String(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")},W=function(e){var t=J(e,w.TITLE),r=J(e,N);if(r&&t)return r.replace(/%s/g,(function(){return Array.isArray(t)?t.join(""):t}));var n=J(e,j);return t||n||void 0},G=function(e){return J(e,M)||function(){}},Q=function(e,t){return t.filter((function(t){return void 0!==t[e]})).map((function(t){return t[e]})).reduce((function(e,t){return U({},e,t)}),{})},K=function(e,t){return t.filter((function(e){return void 0!==e[w.BASE]})).map((function(e){return e[w.BASE]})).reverse().reduce((function(t,r){if(!t.length)for(var n=Object.keys(r),i=0;i=0;r--){var n=e[r];if(n.hasOwnProperty(t))return n[t]}return null},Y=(n=Date.now(),function(e){var t=Date.now();t-n>16?(n=t,e(t)):setTimeout((function(){Y(e)}),0)}),Z=function(e){return clearTimeout(e)},ee="undefined"!=typeof window?window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||Y:r.g.requestAnimationFrame||Y,te="undefined"!=typeof window?window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||Z:r.g.cancelAnimationFrame||Z,re=function(e){return console&&"function"==typeof console.warn&&console.warn(e)},ne=null,ie=function(e,t){var r=e.baseTag,n=e.bodyAttributes,i=e.htmlAttributes,a=e.linkTags,o=e.metaTags,s=e.noscriptTags,l=e.onChangeClientState,u=e.scriptTags,c=e.styleTags,d=e.title,h=e.titleAttributes;se(w.BODY,n),se(w.HTML,i),oe(d,h);var p={baseTag:le(w.BASE,r),linkTags:le(w.LINK,a),metaTags:le(w.META,o),noscriptTags:le(w.NOSCRIPT,s),scriptTags:le(w.SCRIPT,u),styleTags:le(w.STYLE,c)},f={},m={};Object.keys(p).forEach((function(e){var t=p[e],r=t.newTags,n=t.oldTags;r.length&&(f[e]=r),n.length&&(m[e]=p[e].oldTags)})),t&&t(),l(e,f,m)},ae=function(e){return Array.isArray(e)?e.join(""):e},oe=function(e,t){void 0!==e&&document.title!==e&&(document.title=ae(e)),se(w.TITLE,t)},se=function(e,t){var r=document.getElementsByTagName(e)[0];if(r){for(var n=r.getAttribute(z),i=n?n.split(","):[],a=[].concat(i),o=Object.keys(t),s=0;s=0;d--)r.removeAttribute(a[d]);i.length===a.length?r.removeAttribute(z):r.getAttribute(z)!==o.join(",")&&r.setAttribute(z,o.join(","))}},le=function(e,t){var r=document.head||document.querySelector(w.HEAD),n=r.querySelectorAll(e+"["+z+"]"),i=Array.prototype.slice.call(n),a=[],o=void 0;return t&&t.length&&t.forEach((function(t){var r=document.createElement(e);for(var n in t)if(t.hasOwnProperty(n))if(n===E)r.innerHTML=t.innerHTML;else if(n===x)r.styleSheet?r.styleSheet.cssText=t.cssText:r.appendChild(document.createTextNode(t.cssText));else{var s=void 0===t[n]?"":t[n];r.setAttribute(n,s)}r.setAttribute(z,"true"),i.some((function(e,t){return o=t,r.isEqualNode(e)}))?i.splice(o,1):a.push(r)})),i.forEach((function(e){return e.parentNode.removeChild(e)})),a.forEach((function(e){return r.appendChild(e)})),{oldTags:i,newTags:a}},ue=function(e){return Object.keys(e).reduce((function(t,r){var n=void 0!==e[r]?r+'="'+e[r]+'"':""+r;return t?t+" "+n:n}),"")},ce=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(e).reduce((function(t,r){return t[P[r]||r]=e[r],t}),t)},de=function(e,t,r){switch(e){case w.TITLE:return{toComponent:function(){return e=t.title,r=t.titleAttributes,(n={key:e})[z]=!0,i=ce(r,n),[f().createElement(w.TITLE,i,e)];var e,r,n,i},toString:function(){return function(e,t,r,n){var i=ue(r),a=ae(t);return i?"<"+e+" "+z+'="true" '+i+">"+H(a,n)+"":"<"+e+" "+z+'="true">'+H(a,n)+""}(e,t.title,t.titleAttributes,r)}};case v:case y:return{toComponent:function(){return ce(t)},toString:function(){return ue(t)}};default:return{toComponent:function(){return function(e,t){return t.map((function(t,r){var n,i=((n={key:r})[z]=!0,n);return Object.keys(t).forEach((function(e){var r=P[e]||e;if(r===E||r===x){var n=t.innerHTML||t.cssText;i.dangerouslySetInnerHTML={__html:n}}else i[r]=t[e]})),f().createElement(e,i)}))}(e,t)},toString:function(){return function(e,t,r){return t.reduce((function(t,n){var i=Object.keys(n).filter((function(e){return!(e===E||e===x)})).reduce((function(e,t){var i=void 0===n[t]?t:t+'="'+H(n[t],r)+'"';return e?e+" "+i:i}),""),a=n.innerHTML||n.cssText||"",o=-1===V.indexOf(e);return t+"<"+e+" "+z+'="true" '+i+(o?"/>":">"+a+"")}),"")}(e,t,r)}}}},he=function(e){var t=e.baseTag,r=e.bodyAttributes,n=e.encode,i=e.htmlAttributes,a=e.linkTags,o=e.metaTags,s=e.noscriptTags,l=e.scriptTags,u=e.styleTags,c=e.title,d=void 0===c?"":c,h=e.titleAttributes;return{base:de(w.BASE,t,n),bodyAttributes:de(v,r,n),htmlAttributes:de(y,i,n),link:de(w.LINK,a,n),meta:de(w.META,o,n),noscript:de(w.NOSCRIPT,s,n),script:de(w.SCRIPT,l,n),style:de(w.STYLE,u,n),title:de(w.TITLE,{title:d,titleAttributes:h},n)}},pe=c()((function(e){return{baseTag:K([O,D],e),bodyAttributes:Q(v,e),defer:J(e,I),encode:J(e,L),htmlAttributes:Q(y,e),linkTags:X(w.LINK,[A,O],e),metaTags:X(w.META,[C,S,_,T,k],e),noscriptTags:X(w.NOSCRIPT,[E],e),onChangeClientState:G(e),scriptTags:X(w.SCRIPT,[R,E],e),styleTags:X(w.STYLE,[x],e),title:W(e),titleAttributes:Q(b,e)}}),(function(e){ne&&te(ne),e.defer?ne=ee((function(){ie(e,(function(){ne=null}))})):(ie(e),ne=null)}),he)((function(){return null})),fe=(i=pe,o=a=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.shouldComponentUpdate=function(e){return!h()(this.props,e)},t.prototype.mapNestedChildrenToProps=function(e,t){if(!t)return null;switch(e.type){case w.SCRIPT:case w.NOSCRIPT:return{innerHTML:t};case w.STYLE:return{cssText:t}}throw new Error("<"+e.type+" /> elements are self-closing and can not contain children. Refer to our API for more information.")},t.prototype.flattenArrayTypeChildren=function(e){var t,r=e.child,n=e.arrayTypeChildren,i=e.newChildProps,a=e.nestedChildren;return U({},n,((t={})[r.type]=[].concat(n[r.type]||[],[U({},i,this.mapNestedChildrenToProps(r,a))]),t))},t.prototype.mapObjectTypeChildren=function(e){var t,r,n=e.child,i=e.newProps,a=e.newChildProps,o=e.nestedChildren;switch(n.type){case w.TITLE:return U({},i,((t={})[n.type]=o,t.titleAttributes=U({},a),t));case w.BODY:return U({},i,{bodyAttributes:U({},a)});case w.HTML:return U({},i,{htmlAttributes:U({},a)})}return U({},i,((r={})[n.type]=U({},a),r))},t.prototype.mapArrayTypeChildrenToProps=function(e,t){var r=U({},t);return Object.keys(e).forEach((function(t){var n;r=U({},r,((n={})[t]=e[t],n))})),r},t.prototype.warnOnInvalidChildren=function(e,t){return!0},t.prototype.mapChildrenToProps=function(e,t){var r=this,n={};return f().Children.forEach(e,(function(e){if(e&&e.props){var i=e.props,a=i.children,o=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Object.keys(e).reduce((function(t,r){return t[F[r]||r]=e[r],t}),t)}(q(i,["children"]));switch(r.warnOnInvalidChildren(e,a),e.type){case w.LINK:case w.META:case w.NOSCRIPT:case w.SCRIPT:case w.STYLE:n=r.flattenArrayTypeChildren({child:e,arrayTypeChildren:n,newChildProps:o,nestedChildren:a});break;default:t=r.mapObjectTypeChildren({child:e,newProps:t,newChildProps:o,nestedChildren:a})}}})),t=this.mapArrayTypeChildrenToProps(n,t)},t.prototype.render=function(){var e=this.props,t=e.children,r=q(e,["children"]),n=U({},r);return t&&(n=this.mapChildrenToProps(t,n)),f().createElement(i,n)},$(t,null,[{key:"canUseDOM",set:function(e){i.canUseDOM=e}}]),t}(f().Component),a.propTypes={base:l().object,bodyAttributes:l().object,children:l().oneOfType([l().arrayOf(l().node),l().node]),defaultTitle:l().string,defer:l().bool,encodeSpecialCharacters:l().bool,htmlAttributes:l().object,link:l().arrayOf(l().object),meta:l().arrayOf(l().object),noscript:l().arrayOf(l().object),onChangeClientState:l().func,script:l().arrayOf(l().object),style:l().arrayOf(l().object),title:l().string,titleAttributes:l().object,titleTemplate:l().string},a.defaultProps={defer:!0,encodeSpecialCharacters:!0},a.peek=i.peek,a.rewind=function(){var e=i.rewind();return e||(e=he({baseTag:[],bodyAttributes:{},encodeSpecialCharacters:!0,htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}})),e},o);fe.renderStatic=fe.rewind},1794:(e,t,r)=>{"use strict";t.__esModule=!0,t.default=void 0;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=l(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(n,a,o):n[a]=e[a]}n.default=e,r&&r.set(e,n);return n}(r(5959)),i=r(8230),a=r(9954),o=r(6333),s=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function l(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(l=function(e){return e?r:t})(e)}function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;tMath.abs(l*o)?t=e/o:e=t*o}var u=e,c=t,d=this.slack||[0,0],h=d[0],p=d[1];return e+=h,t+=p,n&&(e=Math.max(n[0],e),t=Math.max(n[1],t)),i&&(e=Math.min(i[0],e),t=Math.min(i[1],t)),this.slack=[h+(u-e),p+(c-t)],[e,t]},l.resizeHandler=function(e,t){var r=this;return function(n,i){var a=i.node,o=i.deltaX,s=i.deltaY;"onResizeStart"===e&&r.resetData();var l=("both"===r.props.axis||"x"===r.props.axis)&&"n"!==t&&"s"!==t,u=("both"===r.props.axis||"y"===r.props.axis)&&"e"!==t&&"w"!==t;if(l||u){var c=t[0],d=t[t.length-1],h=a.getBoundingClientRect();if(null!=r.lastHandleRect){if("w"===d)o+=h.left-r.lastHandleRect.left;if("n"===c)s+=h.top-r.lastHandleRect.top}r.lastHandleRect=h,"w"===d&&(o=-o),"n"===c&&(s=-s);var p=r.props.width+(l?o/r.props.transformScale:0),f=r.props.height+(u?s/r.props.transformScale:0),m=r.runConstraints(p,f);p=m[0],f=m[1];var g=p!==r.props.width||f!==r.props.height,v="function"==typeof r.props[e]?r.props[e]:null;v&&!("onResize"===e&&!g)&&(null==n.persist||n.persist(),v(n,{node:a,size:{width:p,height:f},handle:t})),"onResizeStop"===e&&r.resetData()}}},l.renderResizeHandle=function(e,t){var r=this.props.handle;if(!r)return n.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+e,ref:t});if("function"==typeof r)return r(e,t);var i=d({ref:t},"string"==typeof r.type?{}:{handleAxis:e});return n.cloneElement(r,i)},l.render=function(){var e=this,t=this.props,r=t.children,o=t.className,l=t.draggableOpts,c=(t.width,t.height,t.handle,t.handleSize,t.lockAspectRatio,t.axis,t.minConstraints,t.maxConstraints,t.onResize,t.onResizeStop,t.onResizeStart,t.resizeHandles),h=(t.transformScale,function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n=0||(i[r]=e[r]);return i}(t,s));return(0,a.cloneElement)(r,d(d({},h),{},{className:(o?o+" ":"")+"react-resizable",children:[].concat(r.props.children,c.map((function(t){var r,a=null!=(r=e.handleRefs[t])?r:e.handleRefs[t]=n.createRef();return n.createElement(i.DraggableCore,u({},l,{nodeRef:a,key:"resizableHandle-"+t,onStop:e.resizeHandler("onResizeStop",t),onStart:e.resizeHandler("onResizeStart",t),onDrag:e.resizeHandler("onResize",t)}),e.renderResizeHandle(t,a))})))}))},o}(n.Component);t.default=f,f.propTypes=o.resizableProps,f.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1}},6609:(e,t,r)=>{"use strict";t.default=void 0;var n=function(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var r=u(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var a in e)if("default"!==a&&Object.prototype.hasOwnProperty.call(e,a)){var o=i?Object.getOwnPropertyDescriptor(e,a):null;o&&(o.get||o.set)?Object.defineProperty(n,a,o):n[a]=e[a]}n.default=e,r&&r.set(e,n);return n}(r(5959)),i=l(r(2688)),a=l(r(1794)),o=r(6333),s=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function l(e){return e&&e.__esModule?e:{default:e}}function u(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(u=function(e){return e?r:t})(e)}function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(i[r]=e[r]);return i}(e,s);return n.createElement(a.default,{axis:f,draggableOpts:l,handle:t,handleSize:r,height:this.state.height,lockAspectRatio:p,maxConstraints:d,minConstraints:u,onResizeStart:i,onResize:this.onResize,onResizeStop:o,resizeHandles:m,transformScale:v,width:this.state.width},n.createElement("div",c({},y,{style:h(h({},g),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},i}(n.Component);t.default=m,m.propTypes=h(h({},o.resizableProps),{},{children:i.default.element})},6333:(e,t,r)=>{"use strict";t.__esModule=!0,t.resizableProps=void 0;var n,i=(n=r(2688))&&n.__esModule?n:{default:n};r(8230);var a={axis:i.default.oneOf(["both","x","y","none"]),className:i.default.string,children:i.default.element.isRequired,draggableOpts:i.default.shape({allowAnyClick:i.default.bool,cancel:i.default.string,children:i.default.node,disabled:i.default.bool,enableUserSelectHack:i.default.bool,offsetParent:i.default.node,grid:i.default.arrayOf(i.default.number),handle:i.default.string,nodeRef:i.default.object,onStart:i.default.func,onDrag:i.default.func,onStop:i.default.func,onMouseDown:i.default.func,scale:i.default.number}),height:function(){for(var e=arguments.length,t=new Array(e),r=0;r{"use strict";t.__esModule=!0,t.cloneElement=function(e,t){t.style&&e.props.style&&(t.style=o(o({},e.props.style),t.style));t.className&&e.props.className&&(t.className=e.props.className+" "+t.className);return i.default.cloneElement(e,t)};var n,i=(n=r(5959))&&n.__esModule?n:{default:n};function a(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 o(e){for(var t=1;t{"use strict";e.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},e.exports.Resizable=r(1794).default,e.exports.ResizableBox=r(6609).default},9406:(e,t,r)=>{"use strict";var n,i=r(5959),a=(n=i)&&"object"==typeof n&&"default"in n?n.default:n;function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var s=!("undefined"==typeof window||!window.document||!window.document.createElement);e.exports=function(e,t,r){if("function"!=typeof e)throw new Error("Expected reducePropsToState to be a function.");if("function"!=typeof t)throw new Error("Expected handleStateChangeOnClient to be a function.");if(void 0!==r&&"function"!=typeof r)throw new Error("Expected mapStateOnServer to either be undefined or a function.");return function(n){if("function"!=typeof n)throw new Error("Expected WrappedComponent to be a React component.");var l,u=[];function c(){l=e(u.map((function(e){return e.props}))),d.canUseDOM?t(l):r&&(l=r(l))}var d=function(e){var t,r;function i(){return e.apply(this,arguments)||this}r=e,(t=i).prototype=Object.create(r.prototype),t.prototype.constructor=t,t.__proto__=r,i.peek=function(){return l},i.rewind=function(){if(i.canUseDOM)throw new Error("You may only call rewind() on the server. Call peek() to read the current state.");var e=l;return l=void 0,u=[],e};var o=i.prototype;return o.UNSAFE_componentWillMount=function(){u.push(this),c()},o.componentDidUpdate=function(){c()},o.componentWillUnmount=function(){var e=u.indexOf(this);u.splice(e,1),c()},o.render=function(){return a.createElement(n,this.props)},i}(i.PureComponent);return o(d,"displayName","SideEffect("+function(e){return e.displayName||e.name||"Component"}(n)+")"),o(d,"canUseDOM",s),d}}},9800:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var n=r(5959);function i(e,t,r){void 0===t&&(t=0),void 0===r&&(r=[]);var i=function(e,t){void 0===t&&(t=0);var r=(0,n.useRef)(!1),i=(0,n.useRef)(),a=(0,n.useRef)(e),o=(0,n.useCallback)((function(){return r.current}),[]),s=(0,n.useCallback)((function(){r.current=!1,i.current&&clearTimeout(i.current),i.current=setTimeout((function(){r.current=!0,a.current()}),t)}),[t]),l=(0,n.useCallback)((function(){r.current=null,i.current&&clearTimeout(i.current)}),[]);return(0,n.useEffect)((function(){a.current=e}),[e]),(0,n.useEffect)((function(){return s(),l}),[t]),[o,l,s]}(e,t),a=i[0],o=i[1],s=i[2];return(0,n.useEffect)(s,r),[a,o]}},4720:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});var n=r(5959);function i(e){var t=(0,n.useRef)();return(0,n.useEffect)((function(){t.current=e})),t.current}},2192:(e,t,r)=>{"use strict";var n=r(5959),i=Symbol.for("react.element"),a=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,s=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function u(e,t,r){var n,a={},u=null,c=null;for(n in void 0!==r&&(u=""+r),void 0!==t.key&&(u=""+t.key),void 0!==t.ref&&(c=t.ref),t)o.call(t,n)&&!l.hasOwnProperty(n)&&(a[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===a[n]&&(a[n]=t[n]);return{$$typeof:i,type:e,key:u,ref:c,props:a,_owner:s.current}}t.Fragment=a,t.jsx=u,t.jsxs=u},2540:(e,t,r)=>{"use strict";e.exports=r(2192)},8353:(e,t,r)=>{"use strict";r.d(t,{Ms:()=>v,vU:()=>p});var n=r(4120),i=r(1693),a=r(3449),o=r(2236),s=r(6712);function l(){}var u=c("C",void 0,void 0);function c(e,t,r){return{kind:e,value:t,error:r}}var d=r(2332),h=r(3004),p=function(e){function t(t){var r=e.call(this)||this;return r.isStopped=!1,t?(r.destination=t,(0,a.Uv)(t)&&t.add(r)):r.destination=w,r}return(0,n.C6)(t,e),t.create=function(e,t,r){return new v(e,t,r)},t.prototype.next=function(e){this.isStopped?b(function(e){return c("N",e,void 0)}(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?b(function(e){return c("E",void 0,e)}(e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?b(u,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(a.yU),f=Function.prototype.bind;function m(e,t){return f.call(e,t)}var g=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){y(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){y(e)}else y(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){y(e)}},e}(),v=function(e){function t(t,r,n){var a,s,l=e.call(this)||this;(0,i.T)(t)||!t?a={next:null!=t?t:void 0,error:null!=r?r:void 0,complete:null!=n?n:void 0}:l&&o.$.useDeprecatedNextContext?((s=Object.create(t)).unsubscribe=function(){return l.unsubscribe()},a={next:t.next&&m(t.next,s),error:t.error&&m(t.error,s),complete:t.complete&&m(t.complete,s)}):a=t;return l.destination=new g(a),l}return(0,n.C6)(t,e),t}(p);function y(e){o.$.useDeprecatedSynchronousErrorHandling?(0,h.l)(e):(0,s.m)(e)}function b(e,t){var r=o.$.onStoppedNotification;r&&d.f.setTimeout((function(){return r(e,t)}))}var w={closed:!0,next:l,error:function(e){throw e},complete:l}},3449:(e,t,r)=>{"use strict";r.d(t,{yU:()=>l,Uv:()=>u});var n=r(4120),i=r(1693);var a,o=((a=function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}}((function(e){Error.call(e),e.stack=(new Error).stack}))).prototype=Object.create(Error.prototype),a.prototype.constructor=a,a);function s(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var l=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}var t;return e.prototype.unsubscribe=function(){var e,t,r,a,s;if(!this.closed){this.closed=!0;var l=this._parentage;if(l)if(this._parentage=null,Array.isArray(l))try{for(var u=(0,n.Ju)(l),d=u.next();!d.done;d=u.next()){d.value.remove(this)}}catch(t){e={error:t}}finally{try{d&&!d.done&&(t=u.return)&&t.call(u)}finally{if(e)throw e.error}}else l.remove(this);var h=this.initialTeardown;if((0,i.T)(h))try{h()}catch(e){s=e instanceof o?e.errors:[e]}var p=this._finalizers;if(p){this._finalizers=null;try{for(var f=(0,n.Ju)(p),m=f.next();!m.done;m=f.next()){var g=m.value;try{c(g)}catch(e){s=null!=s?s:[],e instanceof o?s=(0,n.fX)((0,n.fX)([],(0,n.zs)(s)),(0,n.zs)(e.errors)):s.push(e)}}}catch(e){r={error:e}}finally{try{m&&!m.done&&(a=f.return)&&a.call(f)}finally{if(r)throw r.error}}}if(s)throw new o(s)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)c(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(r=this._finalizers)&&void 0!==r?r:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&s(t,e)},e.prototype.remove=function(t){var r=this._finalizers;r&&s(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=((t=new e).closed=!0,t),e}();l.EMPTY;function u(e){return e instanceof l||e&&"closed"in e&&(0,i.T)(e.remove)&&(0,i.T)(e.add)&&(0,i.T)(e.unsubscribe)}function c(e){(0,i.T)(e)?e():e.unsubscribe()}},2236:(e,t,r)=>{"use strict";r.d(t,{$:()=>n});var n={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1}},4370:(e,t,r)=>{"use strict";r.d(t,{_:()=>i});var n=r(4120);function i(e,t,r,n,i){return new a(e,t,r,n,i)}var a=function(e){function t(t,r,n,i,a,o){var s=e.call(this,t)||this;return s.onFinalize=a,s.shouldUnsubscribe=o,s._next=r?function(e){try{r(e)}catch(e){t.error(e)}}:e.prototype._next,s._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,s._complete=n?function(){try{n()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,s}return(0,n.C6)(t,e),t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;e.prototype.unsubscribe.call(this),!r&&(null===(t=this.onFinalize)||void 0===t||t.call(this))}},t}(r(8353).vU)},7708:(e,t,r)=>{"use strict";r.d(t,{T:()=>a});var n=r(5096),i=r(4370);function a(e,t){return(0,n.N)((function(r,n){var a=0;r.subscribe((0,i._)(n,(function(r){n.next(e.call(t,r,a++))})))}))}},2332:(e,t,r)=>{"use strict";r.d(t,{f:()=>i});var n=r(4120),i={setTimeout:function(e,t){for(var r=[],a=2;a{"use strict";r.d(t,{Y:()=>a,l:()=>o});var n=r(2236),i=null;function a(e){if(n.$.useDeprecatedSynchronousErrorHandling){var t=!i;if(t&&(i={errorThrown:!1,error:null}),e(),t){var r=i,a=r.errorThrown,o=r.error;if(i=null,a)throw o}}else e()}function o(e){n.$.useDeprecatedSynchronousErrorHandling&&i&&(i.errorThrown=!0,i.error=e)}},3887:(e,t,r)=>{"use strict";function n(e){return e}r.d(t,{D:()=>n})},1693:(e,t,r)=>{"use strict";function n(e){return"function"==typeof e}r.d(t,{T:()=>n})},5096:(e,t,r)=>{"use strict";r.d(t,{N:()=>i});var n=r(1693);function i(e){return function(t){if(function(e){return(0,n.T)(null==e?void 0:e.lift)}(t))return t.lift((function(t){try{return e(t,this)}catch(e){this.error(e)}}));throw new TypeError("Unable to lift unknown Observable type")}}},6712:(e,t,r)=>{"use strict";r.d(t,{m:()=>a});var n=r(2236),i=r(2332);function a(e){i.f.setTimeout((function(){var t=n.$.onUnhandledError;if(!t)throw e;t(e)}))}},6852:(e,t,r)=>{"use strict";var n=r(8036),i=Array.prototype.concat,a=Array.prototype.slice,o=e.exports=function(e){for(var t=[],r=0,o=e.length;r{e.exports=function(e){return!(!e||"string"==typeof e)&&(e instanceof Array||Array.isArray(e)||e.length>=0&&(e.splice instanceof Function||Object.getOwnPropertyDescriptor(e,e.length-1)&&"String"!==e.constructor.name))}},6660:function(e,t,r){var n;!function(i,a){"use strict";var o="function",s="undefined",l="object",u="string",c="major",d="model",h="name",p="type",f="vendor",m="version",g="architecture",v="console",y="mobile",b="tablet",w="smarttv",S="wearable",x="embedded",O="Amazon",_="Apple",E="ASUS",k="BlackBerry",C="Browser",T="Chrome",A="Firefox",R="Google",D="Huawei",P="LG",j="Microsoft",I="Motorola",L="Opera",M="Samsung",N="Sharp",F="Sony",V="Xiaomi",z="Zebra",B="Facebook",$="Chromium OS",U="Mac OS",q=function(e){for(var t={},r=0;r0?2===s.length?typeof s[1]==o?this[s[0]]=s[1].call(this,c):this[s[0]]=s[1]:3===s.length?typeof s[1]!==o||s[1].exec&&s[1].test?this[s[0]]=c?c.replace(s[1],s[2]):a:this[s[0]]=c?s[1].call(this,c,s[2]):a:4===s.length&&(this[s[0]]=c?s[3].call(this,c.replace(s[1],s[2])):a):this[s]=c||a;d+=2}},K=function(e,t){for(var r in t)if(typeof t[r]===l&&t[r].length>0){for(var n=0;n2&&(e[d]="iPad",e[p]=b),e},this.getEngine=function(){var e={};return e[h]=a,e[m]=a,Q.call(e,n,w.engine),e},this.getOS=function(){var e={};return e[h]=a,e[m]=a,Q.call(e,n,w.os),S&&!e[h]&&v&&v.platform&&"Unknown"!=v.platform&&(e[h]=v.platform.replace(/chrome os/i,$).replace(/macos/i,U)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return n},this.setUA=function(e){return n=typeof e===u&&e.length>500?G(e,500):e,this},this.setUA(n),this};Y.VERSION="1.0.38",Y.BROWSER=q([h,m,c]),Y.CPU=q([g]),Y.DEVICE=q([d,f,p,v,y,w,b,S,x]),Y.ENGINE=Y.OS=q([h,m]),typeof t!==s?(e.exports&&(t=e.exports=Y),t.UAParser=Y):r.amdO?(n=function(){return Y}.call(t,r,t,e))===a||(e.exports=n):typeof i!==s&&(i.UAParser=Y);var Z=typeof i!==s&&(i.jQuery||i.Zepto);if(Z&&!Z.ua){var ee=new Y;Z.ua=ee.getResult(),Z.ua.get=function(){return ee.getUA()},Z.ua.set=function(e){ee.setUA(e);var t=ee.getResult();for(var r in t)Z.ua[r]=t[r]}}}("object"==typeof window?window:this)},5244:(e,t,r)=>{"use strict";r.d(t,{Py:()=>l,gY:()=>u,pz:()=>s,sk:()=>c});var n=r(2551),i=r(5968),a=r(4648);function o(e){var t;return(t={id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},getSnapshot:function(){},toJSON:function(){return{id:e}}})[i.s7]=function(){return this},t}function s(e,t,r,n){var a,s=(0,i.Xd)(e.src),u=null===(a=null==t?void 0:t.options.services)||void 0===a?void 0:a[s.type],c=e.data?(0,i.A9)(e.data,r,n):void 0,d=u?l(u,e.id,c):o(e.id);return d.meta=e,d}function l(e,t,r){var n=o(t);if(n.deferred=!0,(0,i.Ai)(e)){var s=n.state=(0,a.G)(void 0,(function(){return(r?e.withContext(r):e).initialState}));n.getSnapshot=function(){return s}}return n}function u(e){return function(e){try{return"function"==typeof e.send}catch(e){return!1}}(e)&&"id"in e}function c(e){var t;return(0,n.Cl)(((t={subscribe:function(){return{unsubscribe:function(){}}},id:"anonymous",getSnapshot:function(){}})[i.s7]=function(){return this},t),e)}},1015:(e,t,r)=>{"use strict";r.d(t,{O:()=>w});var n=r(2551),i=r(5968),a=r(7768),o=r(6590),s=r(5846),l=r(5184),u=r(8204),c=r(6099),d=r(5244);function h(e){if("string"==typeof e){var t={type:e,toString:function(){return e}};return t}return e}function p(e){return(0,n.Cl)((0,n.Cl)({type:o.lA},e),{toJSON:function(){e.onDone,e.onError;var t=(0,n.Tt)(e,["onDone","onError"]);return(0,n.Cl)((0,n.Cl)({},t),{type:o.lA,src:h(e.src)})}})}var f="",m="*",g={},v=function(e){return"#"===e[0]},y=function(){function e(t,r,a,o){void 0===a&&(a="context"in t?t.context:void 0);var d,h=this;this.config=t,this._context=a,this.order=-1,this.__xstatenode=!0,this.__cache={events:void 0,relativeValue:new Map,initialStateValue:void 0,initialState:void 0,on:void 0,transitions:void 0,candidates:{},delayedTransitions:void 0},this.idMap={},this.tags=[],this.options=Object.assign({actions:{},guards:{},services:{},activities:{},delays:{}},r),this.parent=null==o?void 0:o.parent,this.key=this.config.key||(null==o?void 0:o.key)||this.config.id||"(machine)",this.machine=this.parent?this.parent.machine:this,this.path=this.parent?this.parent.path.concat(this.key):[],this.delimiter=this.config.delimiter||(this.parent?this.parent.delimiter:u.AD),this.id=this.config.id||(0,n.fX)([this.machine.key],(0,n.zs)(this.path),!1).join(this.delimiter),this.version=this.parent?this.parent.version:this.config.version,this.type=this.config.type||(this.config.parallel?"parallel":this.config.states&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.schema=this.parent?this.machine.schema:null!==(d=this.config.schema)&&void 0!==d?d:{},this.description=this.config.description,l.p||(0,i.R8)(!("parallel"in this.config),'The "parallel" property is deprecated and will be removed in version 4.1. '.concat(this.config.parallel?"Replace with `type: 'parallel'`":"Use `type: '".concat(this.type,"'`")," in the config for state node '").concat(this.id,"' instead.")),this.initial=this.config.initial,this.states=this.config.states?(0,i.LG)(this.config.states,(function(t,r){var i,a=new e(t,{},void 0,{parent:h,key:r});return Object.assign(h.idMap,(0,n.Cl)(((i={})[a.id]=a,i),a.idMap)),a})):g;var m=0;!function e(t){var r,i;t.order=m++;try{for(var a=(0,n.Ju)((0,c.rz)(t)),o=a.next();!o.done;o=a.next()){e(o.value)}}catch(e){r={error:e}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}}(this),this.history=!0===this.config.history?"shallow":this.config.history||!1,this._transient=!!this.config.always||!!this.config.on&&(Array.isArray(this.config.on)?this.config.on.some((function(e){return e.event===f})):f in this.config.on),this.strict=!!this.config.strict,this.onEntry=(0,i.$r)(this.config.entry||this.config.onEntry).map((function(e){return(0,s.Hf)(e)})),this.onExit=(0,i.$r)(this.config.exit||this.config.onExit).map((function(e){return(0,s.Hf)(e)})),this.meta=this.config.meta,this.doneData="final"===this.type?this.config.data:void 0,this.invoke=(0,i.$r)(this.config.invoke).map((function(e,t){var r,a;if((0,i.Ai)(e)){var o=(0,i.cv)(h.id,t);return h.machine.options.services=(0,n.Cl)(((r={})[o]=e,r),h.machine.options.services),p({src:o,id:o})}if((0,i.Kg)(e.src)){o=e.id||(0,i.cv)(h.id,t);return p((0,n.Cl)((0,n.Cl)({},e),{id:o,src:e.src}))}if((0,i.Ai)(e.src)||(0,i.Tn)(e.src)){o=e.id||(0,i.cv)(h.id,t);return h.machine.options.services=(0,n.Cl)(((a={})[o]=e.src,a),h.machine.options.services),p((0,n.Cl)((0,n.Cl)({id:o},e),{src:o}))}var s=e.src;return p((0,n.Cl)((0,n.Cl)({id:(0,i.cv)(h.id,t)},e),{src:s}))})),this.activities=(0,i.$r)(this.config.activities).concat(this.invoke).map((function(e){return(0,s._4)(e)})),this.transition=this.transition.bind(this),this.tags=(0,i.$r)(this.config.tags)}return e.prototype._init=function(){this.__cache.transitions||(0,c.Ki)(this).forEach((function(e){return e.on}))},e.prototype.withConfig=function(t,r){var i=this.options,a=i.actions,o=i.activities,s=i.guards,l=i.services,u=i.delays;return new e(this.config,{actions:(0,n.Cl)((0,n.Cl)({},a),t.actions),activities:(0,n.Cl)((0,n.Cl)({},o),t.activities),guards:(0,n.Cl)((0,n.Cl)({},s),t.guards),services:(0,n.Cl)((0,n.Cl)({},l),t.services),delays:(0,n.Cl)((0,n.Cl)({},u),t.delays)},null!=r?r:this.context)},e.prototype.withContext=function(t){return new e(this.config,this.options,t)},Object.defineProperty(e.prototype,"context",{get:function(){return(0,i.Tn)(this._context)?this._context():this._context},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"definition",{get:function(){return{id:this.id,key:this.key,version:this.version,context:this.context,type:this.type,initial:this.initial,history:this.history,states:(0,i.LG)(this.states,(function(e){return e.definition})),on:this.on,transitions:this.transitions,entry:this.onEntry,exit:this.onExit,activities:this.activities||[],meta:this.meta,order:this.order||-1,data:this.doneData,invoke:this.invoke,description:this.description,tags:this.tags}},enumerable:!1,configurable:!0}),e.prototype.toJSON=function(){return this.definition},Object.defineProperty(e.prototype,"on",{get:function(){if(this.__cache.on)return this.__cache.on;var e=this.transitions;return this.__cache.on=e.reduce((function(e,t){return e[t.eventType]=e[t.eventType]||[],e[t.eventType].push(t),e}),{})},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"after",{get:function(){return this.__cache.delayedTransitions||(this.__cache.delayedTransitions=this.getDelayedTransitions(),this.__cache.delayedTransitions)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"transitions",{get:function(){return this.__cache.transitions||(this.__cache.transitions=this.formatTransitions(),this.__cache.transitions)},enumerable:!1,configurable:!0}),e.prototype.getCandidates=function(e){if(this.__cache.candidates[e])return this.__cache.candidates[e];var t=e===f,r=this.transitions.filter((function(r){var n=r.eventType===e;return t?n:n||r.eventType===m}));return this.__cache.candidates[e]=r,r},e.prototype.getDelayedTransitions=function(){var e=this,t=this.config.after;if(!t)return[];var r=function(t,r){var n=(0,i.Tn)(t)?"".concat(e.id,":delay[").concat(r,"]"):t,a=(0,s.Pl)(n,e.id);return e.onEntry.push((0,s.tN)(a,{delay:t})),e.onExit.push((0,s.ZT)(a)),a};return((0,i.cy)(t)?t.map((function(e,t){var i=r(e.delay,t);return(0,n.Cl)((0,n.Cl)({},e),{event:i})})):(0,i.Bq)(Object.keys(t).map((function(e,a){var o=t[e],s=(0,i.Kg)(o)?{target:o}:o,l=isNaN(+e)?e:+e,u=r(l,a);return(0,i.$r)(s).map((function(e){return(0,n.Cl)((0,n.Cl)({},e),{event:u,delay:l})}))})))).map((function(t){var r=t.delay;return(0,n.Cl)((0,n.Cl)({},e.formatTransition(t)),{delay:r})}))},e.prototype.getStateNodes=function(e){var t,r=this;if(!e)return[];var o=e instanceof a.Uw?e.value:(0,i.at)(e,this.delimiter);if((0,i.Kg)(o)){var s=this.getStateNode(o).initial;return void 0!==s?this.getStateNodes(((t={})[o]=s,t)):[this,this.states[o]]}var l=Object.keys(o),u=[this];return u.push.apply(u,(0,n.fX)([],(0,n.zs)((0,i.Bq)(l.map((function(e){return r.getStateNode(e).getStateNodes(o[e])})))),!1)),u},e.prototype.handles=function(e){var t=(0,i.vd)(e);return this.events.includes(t)},e.prototype.resolveState=function(e){var t=e instanceof a.Uw?e:a.Uw.create(e),r=Array.from((0,c.D0)([],this.getStateNodes(t.value)));return new a.Uw((0,n.Cl)((0,n.Cl)({},t),{value:this.resolve(t.value),configuration:r,done:(0,c.BJ)(r,this),tags:(0,c.iU)(r),machine:this.machine}))},e.prototype.transitionLeafNode=function(e,t,r){var n=this.getStateNode(e).next(t,r);return n&&n.transitions.length?n:this.next(t,r)},e.prototype.transitionCompoundNode=function(e,t,r){var n=Object.keys(e),i=this.getStateNode(n[0])._transition(e[n[0]],t,r);return i&&i.transitions.length?i:this.next(t,r)},e.prototype.transitionParallelNode=function(e,t,r){var a,o,s={};try{for(var l=(0,n.Ju)(Object.keys(e)),u=l.next();!u.done;u=l.next()){var c=u.value,d=e[c];if(d){var h=this.getStateNode(c)._transition(d,t,r);h&&(s[c]=h)}}}catch(e){a={error:e}}finally{try{u&&!u.done&&(o=l.return)&&o.call(l)}finally{if(a)throw a.error}}var p=Object.keys(s).map((function(e){return s[e]})),f=(0,i.Bq)(p.map((function(e){return e.transitions})));if(!p.some((function(e){return e.transitions.length>0})))return this.next(t,r);var m=(0,i.Bq)(Object.keys(s).map((function(e){return s[e].configuration})));return{transitions:f,exitSet:(0,i.Bq)(p.map((function(e){return e.exitSet}))),configuration:m,source:t,actions:(0,i.Bq)(Object.keys(s).map((function(e){return s[e].actions})))}},e.prototype._transition=function(e,t,r){return(0,i.Kg)(e)?this.transitionLeafNode(e,t,r):1===Object.keys(e).length?this.transitionCompoundNode(e,t,r):this.transitionParallelNode(e,t,r)},e.prototype.getTransitionData=function(e,t){return this._transition(e.value,e,(0,i.ft)(t))},e.prototype.next=function(e,t){var r,a,o,s=this,l=t.name,u=[],c=[];try{for(var d=(0,n.Ju)(this.getCandidates(l)),h=d.next();!h.done;h=d.next()){var p=h.value,f=p.cond,m=p.in,g=e.context,y=!m||((0,i.Kg)(m)&&v(m)?e.matches((0,i.at)(this.getStateNodeById(m).path,this.delimiter)):(0,i.HK)((0,i.at)(m,this.delimiter),(0,i.Ae)(this.path.slice(0,-2))(e.value))),b=!1;try{b=!f||(0,i.re)(this.machine,f,g,t,e)}catch(e){throw new Error("Unable to evaluate guard '".concat(f.name||f.type,"' in transition for event '").concat(l,"' in state node '").concat(this.id,"':\n").concat(e.message))}if(b&&y){void 0!==p.target&&(c=p.target),u.push.apply(u,(0,n.fX)([],(0,n.zs)(p.actions),!1)),o=p;break}}}catch(e){r={error:e}}finally{try{h&&!h.done&&(a=d.return)&&a.call(d)}finally{if(r)throw r.error}}if(o){if(!c.length)return{transitions:[o],exitSet:[],configuration:e.value?[this]:[],source:e,actions:u};var w=(0,i.Bq)(c.map((function(t){return s.getRelativeStateNodes(t,e.historyValue)})));return{transitions:[o],exitSet:!!o.internal?[]:(0,i.Bq)(c.map((function(e){return s.getPotentiallyReenteringNodes(e)}))),configuration:w,source:e,actions:u}}},e.prototype.getPotentiallyReenteringNodes=function(e){if(this.order0,w=b?e.configuration:t?t.configuration:[],S=(0,c.BJ)(w,this),x=b?(0,c._W)(this.machine,y):void 0,O=t?t.historyValue?t.historyValue:e.source?this.machine.historyValue(t.value):void 0:void 0,_=this.getActions(new Set(w),S,e,r,u,t,l),E=t?(0,n.Cl)({},t.activities):{};try{for(var k=(0,n.Ju)(_),C=k.next();!C.done;C=k.next()){var T=C.value;try{for(var A=(m=void 0,(0,n.Ju)(T.actions)),R=A.next();!R.done;R=A.next()){var D=R.value;D.type===o.ni?E[D.activity.id||D.activity.type]=D:D.type===o.ds&&(E[D.activity.id||D.activity.type]=!1)}}catch(e){m={error:e}}finally{try{R&&!R.done&&(g=A.return)&&g.call(A)}finally{if(m)throw m.error}}}}catch(e){h={error:e}}finally{try{C&&!C.done&&(p=k.return)&&p.call(k)}finally{if(h)throw h.error}}var P=(0,n.zs)((0,s.AS)(this,t,r,u,_,l,this.machine.config.predictableActionArguments||this.machine.config.preserveActionOrder),2),j=P[0],I=P[1],L=(0,n.zs)((0,i.jB)(j,i.Gx),2),M=L[0],N=L[1],F=j.filter((function(e){var t;return e.type===o.ni&&(null===(t=e.activity)||void 0===t?void 0:t.type)===o.lA})),V=F.reduce((function(e,t){return e[t.activity.id]=(0,d.pz)(t.activity,v.machine,I,u),e}),t?(0,n.Cl)({},t.children):{}),z=new a.Uw({value:x||t.value,context:I,_event:u,_sessionid:t?t._sessionid:null,historyValue:x?O?(0,i.BY)(O,x):void 0:t?t.historyValue:void 0,history:!x||e.source?t:void 0,actions:x?N:[],activities:x?E:t?t.activities:{},events:[],configuration:w,transitions:e.transitions,children:V,done:S,tags:(0,c.iU)(w),machine:this}),B=r!==I;z.changed=u.name===o.yo||B;var $=z.history;$&&delete $.history;var U=!S&&(this._transient||y.some((function(e){return e._transient})));if(!(b||U&&u.name!==f))return z;var q=z;if(!S)for(U&&(q=this.resolveRaisedTransition(q,{type:o.kx},u,l));M.length;){var H=M.shift();q=this.resolveRaisedTransition(q,H._event,u,l)}var W=q.changed||($?!!q.actions.length||B||typeof $.value!=typeof q.value||!(0,a.iE)(q.value,$.value):void 0);return q.changed=W,q.history=$,q},e.prototype.getStateNode=function(e){if(v(e))return this.machine.getStateNodeById(e);if(!this.states)throw new Error("Unable to retrieve child state '".concat(e,"' from '").concat(this.id,"'; no child states exist."));var t=this.states[e];if(!t)throw new Error("Child state '".concat(e,"' does not exist on '").concat(this.id,"'"));return t},e.prototype.getStateNodeById=function(e){var t=v(e)?e.slice(1):e;if(t===this.id)return this;var r=this.machine.idMap[t];if(!r)throw new Error("Child state node '#".concat(t,"' does not exist on machine '").concat(this.id,"'"));return r},e.prototype.getStateNodeByPath=function(e){if("string"==typeof e&&v(e))try{return this.getStateNodeById(e.slice(1))}catch(e){}for(var t=(0,i._J)(e,this.delimiter).slice(),r=this;t.length;){var n=t.shift();if(!n.length)break;r=r.getStateNode(n)}return r},e.prototype.resolve=function(e){var t,r=this;if(!e)return this.initialStateValue||g;switch(this.type){case"parallel":return(0,i.LG)(this.initialStateValue,(function(t,n){return t?r.getStateNode(n).resolve(e[n]||t):g}));case"compound":if((0,i.Kg)(e)){var n=this.getStateNode(e);return"parallel"===n.type||"compound"===n.type?((t={})[e]=n.initialStateValue,t):e}return Object.keys(e).length?(0,i.LG)(e,(function(e,t){return e?r.getStateNode(t).resolve(e):g})):this.initialStateValue||{};default:return e||g}},e.prototype.getResolvedPath=function(e){if(v(e)){var t=this.machine.idMap[e.slice(1)];if(!t)throw new Error("Unable to find state node '".concat(e,"'"));return t.path}return(0,i._J)(e,this.delimiter)},Object.defineProperty(e.prototype,"initialStateValue",{get:function(){var e,t;if(this.__cache.initialStateValue)return this.__cache.initialStateValue;if("parallel"===this.type)t=(0,i.rp)(this.states,(function(e){return e.initialStateValue||g}),(function(e){return!("history"===e.type)}));else if(void 0!==this.initial){if(!this.states[this.initial])throw new Error("Initial state '".concat(this.initial,"' not found on '").concat(this.key,"'"));t=(0,c.d2)(this.states[this.initial])?this.initial:((e={})[this.initial]=this.states[this.initial].initialStateValue,e)}else t={};return this.__cache.initialStateValue=t,this.__cache.initialStateValue},enumerable:!1,configurable:!0}),e.prototype.getInitialState=function(e,t){this._init();var r=this.getStateNodes(e);return this.resolveTransition({configuration:r,exitSet:[],transitions:[],source:void 0,actions:[]},void 0,null!=t?t:this.machine.context,void 0)},Object.defineProperty(e.prototype,"initialState",{get:function(){var e=this.initialStateValue;if(!e)throw new Error("Cannot retrieve initial state from simple state '".concat(this.id,"'."));return this.getInitialState(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"target",{get:function(){var e;if("history"===this.type){var t=this.config;e=(0,i.Kg)(t.target)&&v(t.target)?(0,i.zr)(this.machine.getStateNodeById(t.target).path.slice(this.path.length-1)):t.target}return e},enumerable:!1,configurable:!0}),e.prototype.getRelativeStateNodes=function(e,t,r){return void 0===r&&(r=!0),r?"history"===e.type?e.resolveHistory(t):e.initialStateNodes:[e]},Object.defineProperty(e.prototype,"initialStateNodes",{get:function(){var e=this;if((0,c.d2)(this))return[this];if("compound"===this.type&&!this.initial)return l.p||(0,i.R8)(!1,"Compound state node '".concat(this.id,"' has no initial state.")),[this];var t=(0,i.bm)(this.initialStateValue);return(0,i.Bq)(t.map((function(t){return e.getFromRelativePath(t)})))},enumerable:!1,configurable:!0}),e.prototype.getFromRelativePath=function(e){if(!e.length)return[this];var t=(0,n.zs)(e),r=t[0],i=t.slice(1);if(!this.states)throw new Error("Cannot retrieve subPath '".concat(r,"' from node with no states"));var a=this.getStateNode(r);if("history"===a.type)return a.resolveHistory();if(!this.states[r])throw new Error("Child state '".concat(r,"' does not exist on '").concat(this.id,"'"));return this.states[r].getFromRelativePath(i)},e.prototype.historyValue=function(e){if(Object.keys(this.states).length)return{current:e||this.initialStateValue,states:(0,i.rp)(this.states,(function(t,r){if(!e)return t.historyValue();var n=(0,i.Kg)(e)?void 0:e[r];return t.historyValue(n||t.initialStateValue)}),(function(e){return!e.history}))}},e.prototype.resolveHistory=function(e){var t=this;if("history"!==this.type)return[this];var r=this.parent;if(!e){var n=this.target;return n?(0,i.Bq)((0,i.bm)(n).map((function(e){return r.getFromRelativePath(e)}))):r.initialStateNodes}var a=(0,i.VQ)(r.path,"states")(e).current;return(0,i.Kg)(a)?[r.getStateNode(a)]:(0,i.Bq)((0,i.bm)(a).map((function(e){return"deep"===t.history?r.getFromRelativePath(e):[r.states[e[0]]]})))},Object.defineProperty(e.prototype,"stateIds",{get:function(){var e=this,t=(0,i.Bq)(Object.keys(this.states).map((function(t){return e.states[t].stateIds})));return[this.id].concat(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"events",{get:function(){var e,t,r,i;if(this.__cache.events)return this.__cache.events;var a=this.states,o=new Set(this.ownEvents);if(a)try{for(var s=(0,n.Ju)(Object.keys(a)),l=s.next();!l.done;l=s.next()){var u=a[l.value];if(u.states)try{for(var c=(r=void 0,(0,n.Ju)(u.events)),d=c.next();!d.done;d=c.next()){var h=d.value;o.add("".concat(h))}}catch(e){r={error:e}}finally{try{d&&!d.done&&(i=c.return)&&i.call(c)}finally{if(r)throw r.error}}}}catch(t){e={error:t}}finally{try{l&&!l.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}return this.__cache.events=Array.from(o)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ownEvents",{get:function(){var e=new Set(this.transitions.filter((function(e){return!(!e.target&&!e.actions.length&&e.internal)})).map((function(e){return e.eventType})));return Array.from(e)},enumerable:!1,configurable:!0}),e.prototype.resolveTarget=function(e){var t=this;if(void 0!==e)return e.map((function(e){if(!(0,i.Kg)(e))return e;var r=e[0]===t.delimiter;if(r&&!t.parent)return t.getStateNodeByPath(e.slice(1));var n=r?t.key+e:e;if(!t.parent)return t.getStateNodeByPath(n);try{return t.parent.getStateNodeByPath(n)}catch(e){throw new Error("Invalid transition definition for state node '".concat(t.id,"':\n").concat(e.message))}}))},e.prototype.formatTransition=function(e){var t=this,r=(0,i.R_)(e.target),a="internal"in e?e.internal:!r||r.some((function(e){return(0,i.Kg)(e)&&e[0]===t.delimiter})),o=this.machine.options.guards,l=this.resolveTarget(r),u=(0,n.Cl)((0,n.Cl)({},e),{actions:(0,s.Um)((0,i.$r)(e.actions)),cond:(0,i.Z8)(e.cond,o),target:l,source:this,internal:a,eventType:e.event,toJSON:function(){return(0,n.Cl)((0,n.Cl)({},u),{target:u.target?u.target.map((function(e){return"#".concat(e.id)})):void 0,source:"#".concat(t.id)})}});return u},e.prototype.formatTransitions=function(){var e,t,r,a=this;if(this.config.on)if(Array.isArray(this.config.on))r=this.config.on;else{var o=this.config.on,u=m,c=o[u],d=void 0===c?[]:c,h=(0,n.Tt)(o,["*"]);r=(0,i.Bq)(Object.keys(h).map((function(e){l.p||e!==f||(0,i.R8)(!1,"Empty string transition configs (e.g., `{ on: { '': ... }}`) for transient transitions are deprecated. Specify the transition in the `{ always: ... }` property instead. "+'Please check the `on` configuration for "#'.concat(a.id,'".'));var t=(0,i.oc)(e,h[e]);return l.p||function(e,t,r){var n=r.slice(0,-1).some((function(e){return!("cond"in e)&&!("in"in e)&&((0,i.Kg)(e.target)||(0,i.Ai)(e.target))})),a=t===f?"the transient event":"event '".concat(t,"'");(0,i.R8)(!n,"One or more transitions for ".concat(a," on state '").concat(e.id,"' are unreachable. ")+"Make sure that the default transition is the last one defined.")}(a,e,t),t})).concat((0,i.oc)(m,d)))}else r=[];var p=this.config.always?(0,i.oc)("",this.config.always):[],g=this.config.onDone?(0,i.oc)(String((0,s.Vw)(this.id)),this.config.onDone):[];l.p||(0,i.R8)(!(this.config.onDone&&!this.parent),'Root nodes cannot have an ".onDone" transition. Please check the config of "'.concat(this.id,'".'));var v=(0,i.Bq)(this.invoke.map((function(e){var t=[];return e.onDone&&t.push.apply(t,(0,n.fX)([],(0,n.zs)((0,i.oc)(String((0,s.tS)(e.id)),e.onDone)),!1)),e.onError&&t.push.apply(t,(0,n.fX)([],(0,n.zs)((0,i.oc)(String((0,s.z3)(e.id)),e.onError)),!1)),t}))),y=this.after,b=(0,i.Bq)((0,n.fX)((0,n.fX)((0,n.fX)((0,n.fX)([],(0,n.zs)(g),!1),(0,n.zs)(v),!1),(0,n.zs)(r),!1),(0,n.zs)(p),!1).map((function(e){return(0,i.$r)(e).map((function(e){return a.formatTransition(e)}))})));try{for(var w=(0,n.Ju)(y),S=w.next();!S.done;S=w.next()){var x=S.value;b.push(x)}}catch(t){e={error:t}}finally{try{S&&!S.done&&(t=w.return)&&t.call(w)}finally{if(e)throw e.error}}return b},e}(),b=!1;function w(e,t){return l.p||"predictableActionArguments"in e||b||(b=!0,console.warn("It is highly recommended to set `predictableActionArguments` to `true` when using `createMachine`. https://xstate.js.org/docs/guides/actions.html")),new y(e,t)}},7768:(e,t,r)=>{"use strict";r.d(t,{OS:()=>c,Sv:()=>d,Uw:()=>h,iE:()=>u});var n=r(2551),i=r(8204),a=r(5968),o=r(6099),s=r(5846),l=r(5184);function u(e,t){if(e===t)return!0;if(void 0===e||void 0===t)return!1;if((0,a.Kg)(e)||(0,a.Kg)(t))return e===t;var r=Object.keys(e),n=Object.keys(t);return r.length===n.length&&r.every((function(r){return u(e[r],t[r])}))}function c(e){return"object"==typeof e&&null!==e&&("value"in e&&"_event"in e)}function d(e,t){var r=e.exec;return(0,n.Cl)((0,n.Cl)({},e),{exec:void 0!==r?function(){return r(t.context,t.event,{action:e,state:t,_event:t._event})}:void 0})}var h=function(){function e(e){var t,r=this;this.actions=[],this.activities=i.xP,this.meta={},this.events=[],this.value=e.value,this.context=e.context,this._event=e._event,this._sessionid=e._sessionid,this.event=this._event.data,this.historyValue=e.historyValue,this.history=e.history,this.actions=e.actions||[],this.activities=e.activities||i.xP,this.meta=(0,o.IQ)(e.configuration),this.events=e.events||[],this.matches=this.matches.bind(this),this.toStrings=this.toStrings.bind(this),this.configuration=e.configuration,this.transitions=e.transitions,this.children=e.children,this.done=!!e.done,this.tags=null!==(t=Array.isArray(e.tags)?new Set(e.tags):e.tags)&&void 0!==t?t:new Set,this.machine=e.machine,Object.defineProperty(this,"nextEvents",{get:function(){return(0,o.Xh)(r.configuration)}})}return e.from=function(t,r){return t instanceof e?t.context!==r?new e({value:t.value,context:r,_event:t._event,_sessionid:null,historyValue:t.historyValue,history:t.history,actions:[],activities:t.activities,meta:{},events:[],configuration:[],transitions:[],children:{}}):t:new e({value:t,context:r,_event:s.zp,_sessionid:null,historyValue:void 0,history:void 0,actions:[],activities:void 0,meta:void 0,events:[],configuration:[],transitions:[],children:{}})},e.create=function(t){return new e(t)},e.inert=function(t,r){if(t instanceof e){if(!t.actions.length)return t;var n=s.zp;return new e({value:t.value,context:r,_event:n,_sessionid:null,historyValue:t.historyValue,history:t.history,activities:t.activities,configuration:t.configuration,transitions:[],children:{}})}return e.from(t,r)},e.prototype.toStrings=function(e,t){var r=this;if(void 0===e&&(e=this.value),void 0===t&&(t="."),(0,a.Kg)(e))return[e];var i=Object.keys(e);return i.concat.apply(i,(0,n.fX)([],(0,n.zs)(i.map((function(n){return r.toStrings(e[n],t).map((function(e){return n+t+e}))}))),!1))},e.prototype.toJSON=function(){var e=this;e.configuration,e.transitions;var t=e.tags;e.machine;var r=(0,n.Tt)(e,["configuration","transitions","tags","machine"]);return(0,n.Cl)((0,n.Cl)({},r),{tags:Array.from(t)})},e.prototype.matches=function(e){return(0,a.HK)(e,this.value)},e.prototype.hasTag=function(e){return this.tags.has(e)},e.prototype.can=function(e){var t;l.p&&(0,a.R8)(!!this.machine,"state.can(...) used outside of a machine-created State object; this will always return false.");var r=null===(t=this.machine)||void 0===t?void 0:t.getTransitionData(this,e);return!!(null==r?void 0:r.transitions.length)&&r.transitions.some((function(e){return void 0!==e.target||e.actions.length}))},e}()},2551:(e,t,r)=>{"use strict";r.d(t,{Cl:()=>n,Ju:()=>a,Tt:()=>i,fX:()=>s,zs:()=>o});var n=function(){return n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function o(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,a=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o}function s(e,t,r){if(r||2===arguments.length)for(var n,i=0,a=t.length;i{"use strict";r.d(t,{LM:()=>y,O$:()=>f,Rm:()=>d,Sw:()=>v,Ts:()=>h,ZT:()=>l,ds:()=>a,kp:()=>c,kx:()=>u,lA:()=>p,ni:()=>i,tN:()=>s,xl:()=>o,yo:()=>g,z3:()=>m});var n=r(5468),i=n.Q.Start,a=n.Q.Stop,o=n.Q.Raise,s=n.Q.Send,l=n.Q.Cancel,u=n.Q.NullEvent,c=n.Q.Assign,d=(n.Q.After,n.Q.DoneState,n.Q.Log),h=n.Q.Init,p=n.Q.Invoke,f=(n.Q.ErrorExecution,n.Q.ErrorPlatform),m=n.Q.ErrorCustom,g=n.Q.Update,v=n.Q.Choose,y=n.Q.Pure},5846:(e,t,r)=>{"use strict";r.d(t,{AS:()=>E,H7:()=>u,Hf:()=>c,Pl:()=>w,Um:()=>d,Vw:()=>S,ZT:()=>g,_4:()=>h,ds:()=>y,kp:()=>b,ni:()=>v,tN:()=>f,tS:()=>x,xl:()=>p,z3:()=>O,zp:()=>l});var n=r(2551),i=r(5468),a=r(6590),o=r(5968),s=r(5184),l=(0,o.ft)({type:a.Ts});function u(e,t){return t&&t[e]||void 0}function c(e,t){var r;if((0,o.Kg)(e)||"number"==typeof e){var i=u(e,t);r=(0,o.Tn)(i)?{type:e,exec:i}:i||{type:e,exec:void 0}}else if((0,o.Tn)(e))r={type:e.name||e.toString(),exec:e};else{i=u(e.type,t);if((0,o.Tn)(i))r=(0,n.Cl)((0,n.Cl)({},e),{exec:i});else if(i){var a=i.type||e.type;r=(0,n.Cl)((0,n.Cl)((0,n.Cl)({},i),e),{type:a})}else r=e}return r}var d=function(e,t){return e?((0,o.cy)(e)?e:[e]).map((function(e){return c(e,t)})):[]};function h(e){var t=c(e);return(0,n.Cl)((0,n.Cl)({id:(0,o.Kg)(e)?e:t.id},t),{type:t.type})}function p(e,t){return{type:a.xl,event:"function"==typeof e?e:(0,o.jK)(e),delay:t?t.delay:void 0,id:null==t?void 0:t.id}}function f(e,t){return{to:t?t.to:void 0,type:a.tN,event:(0,o.Tn)(e)?e:(0,o.jK)(e),delay:t?t.delay:void 0,id:t&&void 0!==t.id?t.id:(0,o.Tn)(e)?e.name:(0,o.vd)(e)}}var m=function(e,t,r){return(0,n.Cl)((0,n.Cl)({},e),{value:(0,o.Kg)(e.expr)?e.expr:e.expr(t,r.data,{_event:r})})},g=function(e){return{type:a.ZT,sendId:e}};function v(e){var t=h(e);return{type:i.Q.Start,activity:t,exec:void 0}}function y(e){var t=(0,o.Tn)(e)?e:h(e);return{type:i.Q.Stop,activity:t,exec:void 0}}var b=function(e){return{type:a.kp,assignment:e}};function w(e,t){var r=t?"#".concat(t):"";return"".concat(i.Q.After,"(").concat(e,")").concat(r)}function S(e,t){var r="".concat(i.Q.DoneState,".").concat(e),n={type:r,data:t,toString:function(){return r}};return n}function x(e,t){var r="".concat(i.Q.DoneInvoke,".").concat(e),n={type:r,data:t,toString:function(){return r}};return n}function O(e,t){var r="".concat(i.Q.ErrorPlatform,".").concat(e),n={type:r,data:t,toString:function(){return r}};return n}var _=function(e){var t,r,i=[];try{for(var o=(0,n.Ju)(e),s=o.next();!s.done;s=o.next())for(var l=s.value,u=0;u{"use strict";r.d(t,{$D:()=>o,AD:()=>n,hS:()=>a,xP:()=>i});var n=".",i={},a="xstate.guard",o=""},5184:(e,t,r)=>{"use strict";r.d(t,{p:()=>n});var n=!0},9221:(e,t,r)=>{"use strict";r.d(t,{kp:()=>n});var n=r(5846).kp},7268:(e,t,r)=>{"use strict";r.d(t,{U4:()=>k});var n=r(2551),i=r(5468),a=r(7768),o=r(6590),s=r(5846),l=r(5184),u=r(5968),c={deferEvents:!1},d=function(){function e(e){this.processingEvent=!1,this.queue=[],this.initialized=!1,this.options=(0,n.Cl)((0,n.Cl)({},c),e)}return e.prototype.initialize=function(e){if(this.initialized=!0,e){if(!this.options.deferEvents)return void this.schedule(e);this.process(e)}this.flushEvents()},e.prototype.schedule=function(e){if(this.initialized&&!this.processingEvent){if(0!==this.queue.length)throw new Error("Event queue should be empty when it is not processing events");this.process(e),this.flushEvents()}else this.queue.push(e)},e.prototype.clear=function(){this.queue=[]},e.prototype.flushEvents=function(){for(var e=this.queue.shift();e;)this.process(e),e=this.queue.shift()},e.prototype.process=function(e){this.processingEvent=!0;try{e()}catch(e){throw this.clear(),e}finally{this.processingEvent=!1}},e}(),h=r(5244),p=new Map,f=0,m=function(){return"x:".concat(f++)},g=function(e,t){return p.set(e,t),e},v=function(e){return p.get(e)},y=function(e){p.delete(e)};function b(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==r.g?r.g:void(l.p||console.warn("XState could not find a global object in this environment. Please let the maintainers know and raise an issue here: https://github.com/statelyai/xstate/issues"))}function w(e){if(b()){var t=function(){var e=b();if(e&&"__xstate__"in e)return e.__xstate__}();t&&t.register(e)}}var S=r(4648);function x(e,t){void 0===t&&(t={});var r=e.initialState,n=new Set,i=[],a=!1,o=(0,h.sk)({id:t.id,send:function(t){i.push(t),function(){if(!a){for(a=!0;i.length>0;){var t=i.shift();r=e.transition(r,t,s),n.forEach((function(e){return e.next(r)}))}a=!1}}()},getSnapshot:function(){return r},subscribe:function(e,t,i){var a=(0,u.WV)(e,t,i);return n.add(a),a.next(r),{unsubscribe:function(){n.delete(a)}}}}),s={parent:t.parent,self:o,id:t.id||"anonymous",observers:n};return r=e.start?e.start(s):r,o}var O,_={sync:!1,autoForward:!1};!function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(O||(O={}));var E=function(){function e(t,r){void 0===r&&(r=e.defaultOptions);var a=this;this.machine=t,this.delayedEventsMap={},this.listeners=new Set,this.contextListeners=new Set,this.stopListeners=new Set,this.doneListeners=new Set,this.eventListeners=new Set,this.sendListeners=new Set,this.initialized=!1,this.status=O.NotStarted,this.children=new Map,this.forwardTo=new Set,this._outgoingQueue=[],this.init=this.start,this.send=function(e,t){if((0,u.cy)(e))return a.batch(e),a.state;var r=(0,u.ft)((0,u.jK)(e,t));if(a.status===O.Stopped)return l.p||(0,u.R8)(!1,'Event "'.concat(r.name,'" was sent to stopped service "').concat(a.machine.id,'". This service has already reached its final state, and will not transition.\nEvent: ').concat(JSON.stringify(r.data))),a.state;if(a.status!==O.Running&&!a.options.deferEvents)throw new Error('Event "'.concat(r.name,'" was sent to uninitialized service "').concat(a.machine.id,'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.\nEvent: ').concat(JSON.stringify(r.data)));return a.scheduler.schedule((function(){a.forward(r);var e=a._nextState(r);a.update(e,r)})),a._state},this.sendTo=function(e,t,r){var c=a.parent&&(t===i.i.Parent||a.parent.id===t),d=c?a.parent:(0,u.Kg)(t)?t===i.i.Internal?a:a.children.get(t)||v(t):(0,u._3)(t)?t:void 0;if(d)if("machine"in d){if(a.status!==O.Stopped||a.parent!==d||a.state.done){var h=(0,n.Cl)((0,n.Cl)({},e),{name:e.name===o.z3?"".concat((0,s.z3)(a.id)):e.name,origin:a.sessionId});!r&&a.machine.config.predictableActionArguments?a._outgoingQueue.push([d,h]):d.send(h)}}else!r&&a.machine.config.predictableActionArguments?a._outgoingQueue.push([d,e.data]):d.send(e.data);else{if(!c)throw new Error("Unable to send event to child '".concat(t,"' from service '").concat(a.id,"'."));l.p||(0,u.R8)(!1,"Service '".concat(a.id,"' has no parent: unable to send event ").concat(e.type))}},this._exec=function(e,t,r,n){void 0===n&&(n=a.machine.options.actions);var c=e.exec||(0,s.H7)(e.type,n),d=(0,u.Tn)(c)?c:c?c.exec:e.exec;if(d)try{return d(t,r.data,a.machine.config.predictableActionArguments?{action:e,_event:r}:{action:e,state:a.state,_event:r})}catch(e){throw a.parent&&a.parent.send({type:"xstate.error",data:e}),e}switch(e.type){case o.xl:var h=e;a.defer(h);break;case o.tN:var p=e;if("number"==typeof p.delay)return void a.defer(p);p.to?a.sendTo(p._event,p.to,r===s.zp):a.send(p._event);break;case o.ZT:a.cancel(e.sendId);break;case o.ni:if(a.status!==O.Running)return;var f=e.activity;if(!a.machine.config.predictableActionArguments&&!a.state.activities[f.id||f.type])break;if(f.type===i.Q.Invoke){var m=(0,u.Xd)(f.src),g=a.machine.options.services?a.machine.options.services[m.type]:void 0,v=f.id,y=f.data;l.p||(0,u.R8)(!("forward"in f),"`forward` property is deprecated (found in invocation of '".concat(f.src,"' in in machine '").concat(a.machine.id,"'). ")+"Please use `autoForward` instead.");var b="autoForward"in f?f.autoForward:!!f.forward;if(!g)return void(l.p||(0,u.R8)(!1,"No service found for invocation '".concat(f.src,"' in machine '").concat(a.machine.id,"'.")));var w=y?(0,u.A9)(y,t,r):void 0;if("string"==typeof g)return;var S=(0,u.Tn)(g)?g(t,r.data,{data:w,src:m,meta:f.meta}):g;if(!S)return;var x=void 0;(0,u.Ai)(S)&&(S=w?S.withContext(w):S,x={autoForward:b}),a.spawn(S,v,x)}else a.spawnActivity(f);break;case o.ds:a.stopChild(e.activity.id);break;case o.Rm:var _=e,E=_.label,k=_.value;E?a.logger(E,k):a.logger(k);break;default:l.p||(0,u.R8)(!1,"No implementation found for action type '".concat(e.type,"'"))}};var c=(0,n.Cl)((0,n.Cl)({},e.defaultOptions),r),h=c.clock,p=c.logger,f=c.parent,g=c.id,y=void 0!==g?g:t.id;this.id=y,this.logger=p,this.clock=h,this.parent=f,this.options=c,this.scheduler=new d({deferEvents:this.options.deferEvents}),this.sessionId=m()}return Object.defineProperty(e.prototype,"initialState",{get:function(){var e=this;return this._initialState?this._initialState:(0,S.G)(this,(function(){return e._initialState=e.machine.initialState,e._initialState}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return l.p||(0,u.R8)(this.status!==O.NotStarted,"Attempted to read state from uninitialized service '".concat(this.id,"'. Make sure the service is started first.")),this._state},enumerable:!1,configurable:!0}),e.prototype.execute=function(e,t){var r,i;try{for(var a=(0,n.Ju)(e.actions),o=a.next();!o.done;o=a.next()){var s=o.value;this.exec(s,e,t)}}catch(e){r={error:e}}finally{try{o&&!o.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}},e.prototype.update=function(e,t){var r,i,a,o,l,c,d,h,p=this;if(e._sessionid=this.sessionId,this._state=e,this.machine.config.predictableActionArguments&&t!==s.zp||!this.options.execute)for(var f=void 0;f=this._outgoingQueue.shift();)f[0].send(f[1]);else this.execute(this.state);if(this.children.forEach((function(e){p.state.children[e.id]=e})),this.devTools&&this.devTools.send(t.data,e),e.event)try{for(var m=(0,n.Ju)(this.eventListeners),g=m.next();!g.done;g=m.next()){(0,g.value)(e.event)}}catch(e){r={error:e}}finally{try{g&&!g.done&&(i=m.return)&&i.call(m)}finally{if(r)throw r.error}}try{for(var v=(0,n.Ju)(this.listeners),b=v.next();!b.done;b=v.next()){(0,b.value)(e,e.event)}}catch(e){a={error:e}}finally{try{b&&!b.done&&(o=v.return)&&o.call(v)}finally{if(a)throw a.error}}try{for(var w=(0,n.Ju)(this.contextListeners),S=w.next();!S.done;S=w.next()){(0,S.value)(this.state.context,this.state.history?this.state.history.context:void 0)}}catch(e){l={error:e}}finally{try{S&&!S.done&&(c=w.return)&&c.call(w)}finally{if(l)throw l.error}}if(this.state.done){var x=e.configuration.find((function(e){return"final"===e.type&&e.parent===p.machine})),O=x&&x.doneData?(0,u.A9)(x.doneData,e.context,t):void 0;this._doneEvent=(0,s.tS)(this.id,O);try{for(var _=(0,n.Ju)(this.doneListeners),E=_.next();!E.done;E=_.next()){(0,E.value)(this._doneEvent)}}catch(e){d={error:e}}finally{try{E&&!E.done&&(h=_.return)&&h.call(_)}finally{if(d)throw d.error}}this._stop(),this._stopChildren(),y(this.sessionId)}},e.prototype.onTransition=function(e){return this.listeners.add(e),this.status===O.Running&&e(this.state,this.state.event),this},e.prototype.subscribe=function(e,t,r){var n=this,i=(0,u.WV)(e,t,r);this.listeners.add(i.next),this.status!==O.NotStarted&&i.next(this.state);var a=function(){n.doneListeners.delete(a),n.stopListeners.delete(a),i.complete()};return this.status===O.Stopped?i.complete():(this.onDone(a),this.onStop(a)),{unsubscribe:function(){n.listeners.delete(i.next),n.doneListeners.delete(a),n.stopListeners.delete(a)}}},e.prototype.onEvent=function(e){return this.eventListeners.add(e),this},e.prototype.onSend=function(e){return this.sendListeners.add(e),this},e.prototype.onChange=function(e){return this.contextListeners.add(e),this},e.prototype.onStop=function(e){return this.stopListeners.add(e),this},e.prototype.onDone=function(e){return this.status===O.Stopped&&this._doneEvent?e(this._doneEvent):this.doneListeners.add(e),this},e.prototype.off=function(e){return this.listeners.delete(e),this.eventListeners.delete(e),this.sendListeners.delete(e),this.stopListeners.delete(e),this.doneListeners.delete(e),this.contextListeners.delete(e),this},e.prototype.start=function(e){var t=this;if(this.status===O.Running)return this;this.machine._init(),g(this.sessionId,this),this.initialized=!0,this.status=O.Running;var r=void 0===e?this.initialState:(0,S.G)(this,(function(){return(0,a.OS)(e)?t.machine.resolveState(e):t.machine.resolveState(a.Uw.from(e,t.machine.context))}));return this.options.devTools&&this.attachDev(),this.scheduler.initialize((function(){t.update(r,s.zp)})),this},e.prototype._stopChildren=function(){this.children.forEach((function(e){(0,u.Tn)(e.stop)&&e.stop()})),this.children.clear()},e.prototype._stop=function(){var e,t,r,i,a,o,s,l,u,c;try{for(var h=(0,n.Ju)(this.listeners),p=h.next();!p.done;p=h.next()){var f=p.value;this.listeners.delete(f)}}catch(t){e={error:t}}finally{try{p&&!p.done&&(t=h.return)&&t.call(h)}finally{if(e)throw e.error}}try{for(var m=(0,n.Ju)(this.stopListeners),g=m.next();!g.done;g=m.next()){(f=g.value)(),this.stopListeners.delete(f)}}catch(e){r={error:e}}finally{try{g&&!g.done&&(i=m.return)&&i.call(m)}finally{if(r)throw r.error}}try{for(var v=(0,n.Ju)(this.contextListeners),y=v.next();!y.done;y=v.next()){f=y.value;this.contextListeners.delete(f)}}catch(e){a={error:e}}finally{try{y&&!y.done&&(o=v.return)&&o.call(v)}finally{if(a)throw a.error}}try{for(var b=(0,n.Ju)(this.doneListeners),w=b.next();!w.done;w=b.next()){f=w.value;this.doneListeners.delete(f)}}catch(e){s={error:e}}finally{try{w&&!w.done&&(l=b.return)&&l.call(b)}finally{if(s)throw s.error}}if(!this.initialized)return this;this.initialized=!1,this.status=O.Stopped,this._initialState=void 0;try{for(var S=(0,n.Ju)(Object.keys(this.delayedEventsMap)),x=S.next();!x.done;x=S.next()){var _=x.value;this.clock.clearTimeout(this.delayedEventsMap[_])}}catch(e){u={error:e}}finally{try{x&&!x.done&&(c=S.return)&&c.call(S)}finally{if(u)throw u.error}}this.scheduler.clear(),this.scheduler=new d({deferEvents:this.options.deferEvents})},e.prototype.stop=function(){var e=this,t=this.scheduler;return this._stop(),t.schedule((function(){var t;if(!(null===(t=e._state)||void 0===t?void 0:t.done)){var r=(0,u.ft)({type:"xstate.stop"}),i=(0,S.G)(e,(function(){var t=(0,u.Bq)((0,n.fX)([],(0,n.zs)(e.state.configuration),!1).sort((function(e,t){return t.order-e.order})).map((function(t){return(0,s.Um)(t.onExit,e.machine.options.actions)}))),i=(0,n.zs)((0,s.AS)(e.machine,e.state,e.state.context,r,[{type:"exit",actions:t}],e.machine.config.predictableActionArguments?e._exec:void 0,e.machine.config.predictableActionArguments||e.machine.config.preserveActionOrder),2),o=i[0],l=i[1],c=new a.Uw({value:e.state.value,context:l,_event:r,_sessionid:e.sessionId,historyValue:void 0,history:e.state,actions:o.filter((function(e){return!(0,u.Gx)(e)})),activities:{},events:[],configuration:[],transitions:[],children:{},done:e.state.done,tags:e.state.tags,machine:e.machine});return c.changed=!0,c}));e.update(i,r),e._stopChildren(),y(e.sessionId)}})),this},e.prototype.batch=function(e){var t=this;if(this.status===O.NotStarted&&this.options.deferEvents)l.p||(0,u.R8)(!1,"".concat(e.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,'" and are deferred. Make sure .start() is called for this service.\nEvent: ').concat(JSON.stringify(event)));else if(this.status!==O.Running)throw new Error("".concat(e.length,' event(s) were sent to uninitialized service "').concat(this.machine.id,'". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.'));if(e.length){var r=!!this.machine.config.predictableActionArguments&&this._exec;this.scheduler.schedule((function(){var i,o,s=t.state,l=!1,c=[],d=function(e){var i=(0,u.ft)(e);t.forward(i),s=(0,S.G)(t,(function(){return t.machine.transition(s,i,void 0,r||void 0)})),c.push.apply(c,(0,n.fX)([],(0,n.zs)(t.machine.config.predictableActionArguments?s.actions:s.actions.map((function(e){return(0,a.Sv)(e,s)}))),!1)),l=l||!!s.changed};try{for(var h=(0,n.Ju)(e),p=h.next();!p.done;p=h.next()){d(p.value)}}catch(e){i={error:e}}finally{try{p&&!p.done&&(o=h.return)&&o.call(h)}finally{if(i)throw i.error}}s.changed=l,s.actions=c,t.update(s,(0,u.ft)(e[e.length-1]))}))}},e.prototype.sender=function(e){return this.send.bind(this,e)},e.prototype._nextState=function(e,t){var r=this;void 0===t&&(t=!!this.machine.config.predictableActionArguments&&this._exec);var n=(0,u.ft)(e);if(0===n.name.indexOf(o.O$)&&!this.state.nextEvents.some((function(e){return 0===e.indexOf(o.O$)})))throw n.data.data;return(0,S.G)(this,(function(){return r.machine.transition(r.state,n,void 0,t||void 0)}))},e.prototype.nextState=function(e){return this._nextState(e,!1)},e.prototype.forward=function(e){var t,r;try{for(var i=(0,n.Ju)(this.forwardTo),a=i.next();!a.done;a=i.next()){var o=a.value,s=this.children.get(o);if(!s)throw new Error("Unable to forward event '".concat(e,"' from interpreter '").concat(this.id,"' to nonexistant child '").concat(o,"'."));s.send(e)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},e.prototype.defer=function(e){var t=this,r=this.clock.setTimeout((function(){"to"in e&&e.to?t.sendTo(e._event,e.to,!0):t.send(e._event)}),e.delay);e.id&&(this.delayedEventsMap[e.id]=r)},e.prototype.cancel=function(e){this.clock.clearTimeout(this.delayedEventsMap[e]),delete this.delayedEventsMap[e]},e.prototype.exec=function(e,t,r){void 0===r&&(r=this.machine.options.actions),this._exec(e,t.context,t._event,r)},e.prototype.removeChild=function(e){var t;this.children.delete(e),this.forwardTo.delete(e),null===(t=this.state)||void 0===t||delete t.children[e]},e.prototype.stopChild=function(e){var t=this.children.get(e);t&&(this.removeChild(e),(0,u.Tn)(t.stop)&&t.stop())},e.prototype.spawn=function(e,t,r){if(this.status!==O.Running)return(0,h.Py)(e,t);if((0,u.$X)(e))return this.spawnPromise(Promise.resolve(e),t);if((0,u.Tn)(e))return this.spawnCallback(e,t);if((0,h.gY)(e))return this.spawnActor(e,t);if((0,u.AT)(e))return this.spawnObservable(e,t);if((0,u.Ai)(e))return this.spawnMachine(e,(0,n.Cl)((0,n.Cl)({},r),{id:t}));if((0,u.lx)(e))return this.spawnBehavior(e,t);throw new Error('Unable to spawn entity "'.concat(t,'" of type "').concat(typeof e,'".'))},e.prototype.spawnMachine=function(t,r){var i=this;void 0===r&&(r={});var a=new e(t,(0,n.Cl)((0,n.Cl)({},this.options),{parent:this,id:r.id||t.id})),s=(0,n.Cl)((0,n.Cl)({},_),r);s.sync&&a.onTransition((function(e){i.send(o.yo,{state:e,id:a.id})}));var l=a;return this.children.set(a.id,l),s.autoForward&&this.forwardTo.add(a.id),a.onDone((function(e){i.removeChild(a.id),i.send((0,u.ft)(e,{origin:a.id}))})).start(),l},e.prototype.spawnBehavior=function(e,t){var r=x(e,{id:t,parent:this});return this.children.set(t,r),r},e.prototype.spawnPromise=function(e,t){var r,n,i=this,a=!1;e.then((function(e){a||(n=e,i.removeChild(t),i.send((0,u.ft)((0,s.tS)(t,e),{origin:t})))}),(function(e){if(!a){i.removeChild(t);var r=(0,s.z3)(t,e);try{i.send((0,u.ft)(r,{origin:t}))}catch(n){(0,u.En)(e,n,t),i.devTools&&i.devTools.send(r,i.state),i.machine.strict&&i.stop()}}}));var o=((r={id:t,send:function(){},subscribe:function(t,r,n){var i=(0,u.WV)(t,r,n),a=!1;return e.then((function(e){a||(i.next(e),a||i.complete())}),(function(e){a||i.error(e)})),{unsubscribe:function(){return a=!0}}},stop:function(){a=!0},toJSON:function(){return{id:t}},getSnapshot:function(){return n}})[u.s7]=function(){return this},r);return this.children.set(t,o),o},e.prototype.spawnCallback=function(e,t){var r,n,i,a=this,o=!1,l=new Set,c=new Set;try{i=e((function(e){n=e,c.forEach((function(t){return t(e)})),o||a.send((0,u.ft)(e,{origin:t}))}),(function(e){l.add(e)}))}catch(e){this.send((0,s.z3)(t,e))}if((0,u.$X)(i))return this.spawnPromise(i,t);var d=((r={id:t,send:function(e){return l.forEach((function(t){return t(e)}))},subscribe:function(e){var t=(0,u.WV)(e);return c.add(t.next),{unsubscribe:function(){c.delete(t.next)}}},stop:function(){o=!0,(0,u.Tn)(i)&&i()},toJSON:function(){return{id:t}},getSnapshot:function(){return n}})[u.s7]=function(){return this},r);return this.children.set(t,d),d},e.prototype.spawnObservable=function(e,t){var r,n,i=this,a=e.subscribe((function(e){n=e,i.send((0,u.ft)(e,{origin:t}))}),(function(e){i.removeChild(t),i.send((0,u.ft)((0,s.z3)(t,e),{origin:t}))}),(function(){i.removeChild(t),i.send((0,u.ft)((0,s.tS)(t),{origin:t}))})),o=((r={id:t,send:function(){},subscribe:function(t,r,n){return e.subscribe(t,r,n)},stop:function(){return a.unsubscribe()},getSnapshot:function(){return n},toJSON:function(){return{id:t}}})[u.s7]=function(){return this},r);return this.children.set(t,o),o},e.prototype.spawnActor=function(e,t){return this.children.set(t,e),e},e.prototype.spawnActivity=function(e){var t=this.machine.options&&this.machine.options.activities?this.machine.options.activities[e.type]:void 0;if(t){var r=t(this.state.context,e);this.spawnEffect(e.id,r)}else l.p||(0,u.R8)(!1,"No implementation found for activity '".concat(e.type,"'"))},e.prototype.spawnEffect=function(e,t){var r;this.children.set(e,((r={id:e,send:function(){},subscribe:function(){return{unsubscribe:function(){}}},stop:t||void 0,getSnapshot:function(){},toJSON:function(){return{id:e}}})[u.s7]=function(){return this},r))},e.prototype.attachDev=function(){var e=b();if(this.options.devTools&&e){if(e.__REDUX_DEVTOOLS_EXTENSION__){var t="object"==typeof this.options.devTools?this.options.devTools:void 0;this.devTools=e.__REDUX_DEVTOOLS_EXTENSION__.connect((0,n.Cl)((0,n.Cl)({name:this.id,autoPause:!0,stateSanitizer:function(e){return{value:e.value,context:e.context,actions:e.actions}}},t),{features:(0,n.Cl)({jump:!1,skip:!1},t?t.features:void 0)}),this.machine),this.devTools.init(this.state)}w(this)}},e.prototype.toJSON=function(){return{id:this.id}},e.prototype[u.s7]=function(){return this},e.prototype.getSnapshot=function(){return this.status===O.NotStarted?this.initialState:this._state},e.defaultOptions={execute:!0,deferEvents:!0,clock:{setTimeout:function(e,t){return setTimeout(e,t)},clearTimeout:function(e){return clearTimeout(e)}},logger:console.log.bind(console),devTools:!1},e.interpret=k,e}();function k(e,t){return new E(e,t)}},4648:(e,t,r)=>{"use strict";r.d(t,{G:()=>i});var n=[],i=function(e,t){n.push(e);var r=t(e);return n.pop(),r}},6099:(e,t,r)=>{"use strict";r.d(t,{BJ:()=>m,D0:()=>u,IQ:()=>g,Ki:()=>l,Xh:()=>f,_W:()=>h,d2:()=>a,i0:()=>s,iU:()=>v,rz:()=>o,zy:()=>p});var n=r(2551),i=r(5968),a=function(e){return"atomic"===e.type||"final"===e.type};function o(e){return Object.keys(e.states).map((function(t){return e.states[t]}))}function s(e){return o(e).filter((function(e){return"history"!==e.type}))}function l(e){var t=[e];return a(e)?t:t.concat((0,i.Bq)(s(e).map(l)))}function u(e,t){var r,i,a,o,l,u,c,h,p=d(new Set(e)),f=new Set(t);try{for(var m=(0,n.Ju)(f),g=m.next();!g.done;g=m.next())for(var v=(k=g.value).parent;v&&!f.has(v);)f.add(v),v=v.parent}catch(e){r={error:e}}finally{try{g&&!g.done&&(i=m.return)&&i.call(m)}finally{if(r)throw r.error}}var y=d(f);try{for(var b=(0,n.Ju)(f),w=b.next();!w.done;w=b.next()){if("compound"!==(k=w.value).type||y.get(k)&&y.get(k).length){if("parallel"===k.type)try{for(var S=(l=void 0,(0,n.Ju)(s(k))),x=S.next();!x.done;x=S.next()){var O=x.value;f.has(O)||(f.add(O),p.get(O)?p.get(O).forEach((function(e){return f.add(e)})):O.initialStateNodes.forEach((function(e){return f.add(e)})))}}catch(e){l={error:e}}finally{try{x&&!x.done&&(u=S.return)&&u.call(S)}finally{if(l)throw l.error}}}else p.get(k)?p.get(k).forEach((function(e){return f.add(e)})):k.initialStateNodes.forEach((function(e){return f.add(e)}))}}catch(e){a={error:e}}finally{try{w&&!w.done&&(o=b.return)&&o.call(b)}finally{if(a)throw a.error}}try{for(var _=(0,n.Ju)(f),E=_.next();!E.done;E=_.next()){var k;for(v=(k=E.value).parent;v&&!f.has(v);)f.add(v),v=v.parent}}catch(e){c={error:e}}finally{try{E&&!E.done&&(h=_.return)&&h.call(_)}finally{if(c)throw c.error}}return f}function c(e,t){var r=t.get(e);if(!r)return{};if("compound"===e.type){var n=r[0];if(!n)return{};if(a(n))return n.key}var i={};return r.forEach((function(e){i[e.key]=c(e,t)})),i}function d(e){var t,r,i=new Map;try{for(var a=(0,n.Ju)(e),o=a.next();!o.done;o=a.next()){var s=o.value;i.has(s)||i.set(s,[]),s.parent&&(i.has(s.parent)||i.set(s.parent,[]),i.get(s.parent).push(s))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}return i}function h(e,t){return c(e,d(u([e],t)))}function p(e,t){return Array.isArray(e)?e.some((function(e){return e===t})):e instanceof Set&&e.has(t)}function f(e){return(0,n.fX)([],(0,n.zs)(new Set((0,i.Bq)((0,n.fX)([],(0,n.zs)(e.map((function(e){return e.ownEvents}))),!1)))),!1)}function m(e,t){return"compound"===t.type?s(t).some((function(t){return"final"===t.type&&p(e,t)})):"parallel"===t.type&&s(t).every((function(t){return m(e,t)}))}function g(e){return void 0===e&&(e=[]),e.reduce((function(e,t){return void 0!==t.meta&&(e[t.id]=t.meta),e}),{})}function v(e){return new Set((0,i.Bq)(e.map((function(e){return e.tags}))))}},5468:(e,t,r)=>{"use strict";var n,i;r.d(t,{Q:()=>n,i:()=>i}),function(e){e.Start="xstate.start",e.Stop="xstate.stop",e.Raise="xstate.raise",e.Send="xstate.send",e.Cancel="xstate.cancel",e.NullEvent="",e.Assign="xstate.assign",e.After="xstate.after",e.DoneState="done.state",e.DoneInvoke="done.invoke",e.Log="xstate.log",e.Init="xstate.init",e.Invoke="xstate.invoke",e.ErrorExecution="error.execution",e.ErrorCommunication="error.communication",e.ErrorPlatform="error.platform",e.ErrorCustom="xstate.error",e.Update="xstate.update",e.Pure="xstate.pure",e.Choose="xstate.choose"}(n||(n={})),function(e){e.Parent="#_parent",e.Internal="#_internal"}(i||(i={}))},5968:(e,t,r)=>{"use strict";r.d(t,{$X:()=>_,$r:()=>S,A9:()=>x,AT:()=>L,Ae:()=>g,Ai:()=>N,BY:()=>T,Bq:()=>b,En:()=>U,Gx:()=>Q,HK:()=>u,Kg:()=>j,LG:()=>f,M7:()=>O,R8:()=>R,R_:()=>$,Tn:()=>P,VQ:()=>v,WV:()=>W,Xd:()=>H,Z8:()=>I,_3:()=>F,_J:()=>d,at:()=>h,bm:()=>y,cv:()=>G,cy:()=>D,ft:()=>z,jB:()=>k,jK:()=>V,lx:()=>E,oc:()=>B,r_:()=>A,re:()=>q,rp:()=>m,s7:()=>M,vd:()=>c,zr:()=>p});var n,i=r(2551),a=r(5468),o=r(6590),s=r(8204),l=r(5184);function u(e,t,r){void 0===r&&(r=s.AD);var n=h(e,r),i=h(t,r);return j(i)?!!j(n)&&i===n:j(n)?n in i:Object.keys(n).every((function(e){return e in i&&u(n[e],i[e])}))}function c(e){try{return j(e)||"number"==typeof e?"".concat(e):e.type}catch(e){throw new Error("Events must be strings or objects with a string event.type property.")}}function d(e,t){try{return D(e)?e:e.toString().split(t)}catch(t){throw new Error("'".concat(e,"' is not a valid state path."))}}function h(e,t){return"object"==typeof(r=e)&&"value"in r&&"context"in r&&"event"in r&&"_event"in r?e.value:D(e)?p(e):"string"!=typeof e?e:p(d(e,t));var r}function p(e){if(1===e.length)return e[0];for(var t={},r=t,n=0;n{"use strict";r.d(t,{A:()=>pt});var n=r(2540),i=r(6089),a=r(7993),o=r(5959),s=function(){};var l="undefined"!=typeof window;const u=l?o.useLayoutEffect:o.useEffect;var c={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};const d=l&&void 0!==window.ResizeObserver?function(){var e=(0,o.useState)(null),t=e[0],r=e[1],n=(0,o.useState)(c),i=n[0],a=n[1],s=(0,o.useMemo)((function(){return new window.ResizeObserver((function(e){if(e[0]){var t=e[0].contentRect,r=t.x,n=t.y,i=t.width,o=t.height,s=t.top,l=t.left,u=t.bottom,c=t.right;a({x:r,y:n,width:i,height:o,top:s,left:l,bottom:u,right:c})}}))}),[]);return u((function(){if(t)return s.observe(t),function(){s.disconnect()}}),[t]),[r,i]}:function(){return[s,c]};var h=r(2007);const p=22*window.devicePixelRatio,f=10*window.devicePixelRatio,m=.5*window.devicePixelRatio,g=20*window.devicePixelRatio,v=.5*window.devicePixelRatio,y=4*window.devicePixelRatio,b=3*window.devicePixelRatio,w=3*window.devicePixelRatio,S=4*window.devicePixelRatio,x=2*window.devicePixelRatio,O=120,_=({data:e,itemData:t,onMenuItemClick:r,onItemFocus:i,onSandwich:a,collapseConfig:o,onExpandGroup:s,onCollapseGroup:l,onExpandAllGroups:u,onCollapseAllGroups:c,getExtraContextMenuButtons:d,collapsing:p,allGroupsExpanded:f,allGroupsCollapsed:m,selectedView:g,search:v})=>(0,n.jsx)("div",{"data-testid":"contextMenu",children:(0,n.jsx)(h.ContextMenu,{renderMenuItems:function(){const y=(null==d?void 0:d(t,e.data,{selectedView:g,isDiff:e.isDiffFlamegraph(),search:v,collapseConfig:o}))||[];return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(h.MenuItem,{label:"Focus block",icon:"eye",onClick:()=>{i(),r()}}),(0,n.jsx)(h.MenuItem,{label:"Copy function name",icon:"copy",onClick:()=>{navigator.clipboard.writeText(t.label).then((()=>{r()}))}}),(0,n.jsx)(h.MenuItem,{label:"Sandwich view",icon:"gf-show-context",onClick:()=>{a(),r()}}),y.map((({label:e,icon:t,onClick:r})=>(0,n.jsx)(h.MenuItem,{label:e,icon:t,onClick:()=>r()},e))),p&&(0,n.jsxs)(h.MenuGroup,{label:"Grouping",children:[o?o.collapsed?(0,n.jsx)(h.MenuItem,{label:"Expand group",icon:"angle-double-down",onClick:()=>{s(),r()}}):(0,n.jsx)(h.MenuItem,{label:"Collapse group",icon:"angle-double-up",onClick:()=>{l(),r()}}):null,!f&&(0,n.jsx)(h.MenuItem,{label:"Expand all groups",icon:"angle-double-down",onClick:()=>{u(),r()}}),!m&&(0,n.jsx)(h.MenuItem,{label:"Collapse all groups",icon:"angle-double-up",onClick:()=>{c(),r()}})]})]})},x:t.posX+10,y:t.posY,focusOnOpen:!1})});var E=r(7781);const k=({data:e,item:t,totalTicks:r,position:i,collapseConfig:a})=>{const o=(0,h.useStyles2)(R);if(!t||!i)return null;let s;if(e.isDiffFlamegraph()){const i=T(e,t,r);s=(0,n.jsx)(h.InteractiveTable,{className:o.tooltipTable,columns:[{id:"label",header:""},{id:"baseline",header:"Baseline"},{id:"comparison",header:"Comparison"},{id:"diff",header:"Diff"}],data:i,getRowId:e=>e.rowId})}else{const i=C(e,t,r);s=(0,n.jsxs)("p",{className:o.lastParagraph,children:[i.unitTitle,(0,n.jsx)("br",{}),"Total: ",(0,n.jsx)("b",{children:i.unitValue})," (",i.percentValue,"%)",(0,n.jsx)("br",{}),"Self: ",(0,n.jsx)("b",{children:i.unitSelf})," (",i.percentSelf,"%)",(0,n.jsx)("br",{}),"Samples: ",(0,n.jsx)("b",{children:i.samples})]})}return(0,n.jsx)(h.Portal,{children:(0,n.jsx)(h.VizTooltipContainer,{className:o.tooltipContainer,position:i,offset:{x:15,y:0},children:(0,n.jsxs)("div",{className:o.tooltipContent,children:[(0,n.jsxs)("p",{className:o.tooltipName,children:[e.getLabel(t.itemIndexes[0]),a&&a.collapsed?(0,n.jsxs)("span",{children:[(0,n.jsx)("br",{}),"and ",a.items.length," similar items"]}):""]}),s]})})})},C=(e,t,r)=>{const n=e.valueDisplayProcessor(t.value),i=e.getSelfDisplay(t.itemIndexes),a=Math.round(n.numeric/r*1e4)/100,o=Math.round(i.numeric/r*1e4)/100;let s=n.text+n.suffix,l=i.text+i.suffix;const u=e.getUnitTitle();return"Count"===u&&(n.suffix||(s=n.text),i.suffix||(l=i.text)),{percentValue:a,percentSelf:o,unitTitle:u,unitValue:s,unitSelf:l,samples:n.numeric.toLocaleString()}},T=(e,t,r)=>{const n=e.getLevels()[0][0].valueRight,i=r-n,a=t.value-t.valueRight,o=Math.round(1e4*a/i)/100,s=Math.round(1e4*t.valueRight/n)/100,l=(s-o)/o*100,u=A(e,e.valueDisplayProcessor(a)),c=A(e,e.valueDisplayProcessor(t.valueRight)),d=(0,E.getValueFormat)("short");return[{rowId:"1",label:"% of total",baseline:o+"%",comparison:s+"%",diff:d(l).text+"%"},{rowId:"2",label:"Value",baseline:u,comparison:c,diff:A(e,e.valueDisplayProcessor(t.valueRight-a))},{rowId:"3",label:"Samples",baseline:d(a).text,comparison:d(t.valueRight).text,diff:d(t.valueRight-a).text}]};function A(e,t){let r=t.text+t.suffix;return"Count"===e.getUnitTitle()&&(t.suffix||(r=t.text)),r}const R=e=>({tooltipContainer:(0,i.css)({title:"tooltipContainer",overflow:"hidden"}),tooltipContent:(0,i.css)({title:"tooltipContent",fontSize:e.typography.bodySmall.fontSize,width:"100%"}),tooltipName:(0,i.css)({title:"tooltipName",marginTop:0,wordBreak:"break-all"}),lastParagraph:(0,i.css)({title:"lastParagraph",marginBottom:0}),name:(0,i.css)({title:"name",marginBottom:"10px"}),tooltipTable:(0,i.css)({title:"tooltipTable",maxWidth:"400px"})});function D(e){return D="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},D(e)}var P=/^\s+/,j=/\s+$/;function I(e,t){if(t=t||{},(e=e||"")instanceof I)return e;if(!(this instanceof I))return new I(e,t);var r=function(e){var t={r:0,g:0,b:0},r=1,n=null,i=null,a=null,o=!1,s=!1;"string"==typeof e&&(e=function(e){e=e.replace(P,"").replace(j,"").toLowerCase();var t,r=!1;if(J[e])e=J[e],r=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};if(t=ce.rgb.exec(e))return{r:t[1],g:t[2],b:t[3]};if(t=ce.rgba.exec(e))return{r:t[1],g:t[2],b:t[3],a:t[4]};if(t=ce.hsl.exec(e))return{h:t[1],s:t[2],l:t[3]};if(t=ce.hsla.exec(e))return{h:t[1],s:t[2],l:t[3],a:t[4]};if(t=ce.hsv.exec(e))return{h:t[1],s:t[2],v:t[3]};if(t=ce.hsva.exec(e))return{h:t[1],s:t[2],v:t[3],a:t[4]};if(t=ce.hex8.exec(e))return{r:re(t[1]),g:re(t[2]),b:re(t[3]),a:oe(t[4]),format:r?"name":"hex8"};if(t=ce.hex6.exec(e))return{r:re(t[1]),g:re(t[2]),b:re(t[3]),format:r?"name":"hex"};if(t=ce.hex4.exec(e))return{r:re(t[1]+""+t[1]),g:re(t[2]+""+t[2]),b:re(t[3]+""+t[3]),a:oe(t[4]+""+t[4]),format:r?"name":"hex8"};if(t=ce.hex3.exec(e))return{r:re(t[1]+""+t[1]),g:re(t[2]+""+t[2]),b:re(t[3]+""+t[3]),format:r?"name":"hex"};return!1}(e));"object"==D(e)&&(de(e.r)&&de(e.g)&&de(e.b)?(l=e.r,u=e.g,c=e.b,t={r:255*ee(l,255),g:255*ee(u,255),b:255*ee(c,255)},o=!0,s="%"===String(e.r).substr(-1)?"prgb":"rgb"):de(e.h)&&de(e.s)&&de(e.v)?(n=ie(e.s),i=ie(e.v),t=function(e,t,r){e=6*ee(e,360),t=ee(t,100),r=ee(r,100);var n=Math.floor(e),i=e-n,a=r*(1-t),o=r*(1-i*t),s=r*(1-(1-i)*t),l=n%6,u=[r,o,a,a,s,r][l],c=[s,r,r,o,a,a][l],d=[a,a,s,r,r,o][l];return{r:255*u,g:255*c,b:255*d}}(e.h,n,i),o=!0,s="hsv"):de(e.h)&&de(e.s)&&de(e.l)&&(n=ie(e.s),a=ie(e.l),t=function(e,t,r){var n,i,a;function o(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=ee(e,360),t=ee(t,100),r=ee(r,100),0===t)n=i=a=r;else{var s=r<.5?r*(1+t):r+t-r*t,l=2*r-s;n=o(l,s,e+1/3),i=o(l,s,e),a=o(l,s,e-1/3)}return{r:255*n,g:255*i,b:255*a}}(e.h,n,a),o=!0,s="hsl"),e.hasOwnProperty("a")&&(r=e.a));var l,u,c;return r=Z(r),{ok:o,format:e.format||s,r:Math.min(255,Math.max(t.r,0)),g:Math.min(255,Math.max(t.g,0)),b:Math.min(255,Math.max(t.b,0)),a:r}}(e);this._originalInput=e,this._r=r.r,this._g=r.g,this._b=r.b,this._a=r.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||r.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=r.ok}function L(e,t,r){e=ee(e,255),t=ee(t,255),r=ee(r,255);var n,i,a=Math.max(e,t,r),o=Math.min(e,t,r),s=(a+o)/2;if(a==o)n=i=0;else{var l=a-o;switch(i=s>.5?l/(2-a-o):l/(a+o),a){case e:n=(t-r)/l+(t>1)+720)%360;--t;)n.h=(n.h+i)%360,a.push(I(n));return a}function X(e,t){t=t||6;for(var r=I(e).toHsv(),n=r.h,i=r.s,a=r.v,o=[],s=1/t;t--;)o.push(I({h:n,s:i,v:a})),a=(a+s)%1;return o}I.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,r,n=this.toRgb();return e=n.r/255,t=n.g/255,r=n.b/255,.2126*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.0722*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))},setAlpha:function(e){return this._a=Z(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=M(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=M(this._r,this._g,this._b),t=Math.round(360*e.h),r=Math.round(100*e.s),n=Math.round(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=L(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=L(this._r,this._g,this._b),t=Math.round(360*e.h),r=Math.round(100*e.s),n=Math.round(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return N(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){return function(e,t,r,n,i){var a=[ne(Math.round(e).toString(16)),ne(Math.round(t).toString(16)),ne(Math.round(r).toString(16)),ne(ae(n))];if(i&&a[0].charAt(0)==a[0].charAt(1)&&a[1].charAt(0)==a[1].charAt(1)&&a[2].charAt(0)==a[2].charAt(1)&&a[3].charAt(0)==a[3].charAt(1))return a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0)+a[3].charAt(0);return a.join("")}(this._r,this._g,this._b,this._a,e)},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*ee(this._r,255))+"%",g:Math.round(100*ee(this._g,255))+"%",b:Math.round(100*ee(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*ee(this._r,255))+"%, "+Math.round(100*ee(this._g,255))+"%, "+Math.round(100*ee(this._b,255))+"%)":"rgba("+Math.round(100*ee(this._r,255))+"%, "+Math.round(100*ee(this._g,255))+"%, "+Math.round(100*ee(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&(Y[N(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+F(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var i=I(e);r="#"+F(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0;return t||!n||"hex"!==e&&"hex6"!==e&&"hex3"!==e&&"hex4"!==e&&"hex8"!==e&&"name"!==e?("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),"hex"!==e&&"hex6"!==e||(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString()):"name"===e&&0===this._a?this.toName():this.toRgbString()},clone:function(){return I(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification($,arguments)},brighten:function(){return this._applyModification(U,arguments)},darken:function(){return this._applyModification(q,arguments)},desaturate:function(){return this._applyModification(V,arguments)},saturate:function(){return this._applyModification(z,arguments)},greyscale:function(){return this._applyModification(B,arguments)},spin:function(){return this._applyModification(H,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(K,arguments)},complement:function(){return this._applyCombination(W,arguments)},monochromatic:function(){return this._applyCombination(X,arguments)},splitcomplement:function(){return this._applyCombination(Q,arguments)},triad:function(){return this._applyCombination(G,[3])},tetrad:function(){return this._applyCombination(G,[4])}},I.fromRatio=function(e,t){if("object"==D(e)){var r={};for(var n in e)e.hasOwnProperty(n)&&(r[n]="a"===n?e[n]:ie(e[n]));e=r}return I(e,t)},I.equals=function(e,t){return!(!e||!t)&&I(e).toRgbString()==I(t).toRgbString()},I.random=function(){return I.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},I.mix=function(e,t,r){r=0===r?0:r||50;var n=I(e).toRgb(),i=I(t).toRgb(),a=r/100;return I({r:(i.r-n.r)*a+n.r,g:(i.g-n.g)*a+n.g,b:(i.b-n.b)*a+n.b,a:(i.a-n.a)*a+n.a})},I.readability=function(e,t){var r=I(e),n=I(t);return(Math.max(r.getLuminance(),n.getLuminance())+.05)/(Math.min(r.getLuminance(),n.getLuminance())+.05)},I.isReadable=function(e,t,r){var n,i,a=I.readability(e,t);switch(i=!1,(n=function(e){var t,r;t=((e=e||{level:"AA",size:"small"}).level||"AA").toUpperCase(),r=(e.size||"small").toLowerCase(),"AA"!==t&&"AAA"!==t&&(t="AA");"small"!==r&&"large"!==r&&(r="small");return{level:t,size:r}}(r)).level+n.size){case"AAsmall":case"AAAlarge":i=a>=4.5;break;case"AAlarge":i=a>=3;break;case"AAAsmall":i=a>=7}return i},I.mostReadable=function(e,t,r){var n,i,a,o,s=null,l=0;i=(r=r||{}).includeFallbackColors,a=r.level,o=r.size;for(var u=0;ul&&(l=n,s=I(t[u]));return I.isReadable(e,s,{level:a,size:o})||!i?s:(r.includeFallbackColors=!1,I.mostReadable(e,["#fff","#000"],r))};var J=I.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},Y=I.hexNames=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(J);function Z(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function ee(e,t){(function(e){return"string"==typeof e&&-1!=e.indexOf(".")&&1===parseFloat(e)})(e)&&(e="100%");var r=function(e){return"string"==typeof e&&-1!=e.indexOf("%")}(e);return e=Math.min(t,Math.max(0,parseFloat(e))),r&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)}function te(e){return Math.min(1,Math.max(0,e))}function re(e){return parseInt(e,16)}function ne(e){return 1==e.length?"0"+e:""+e}function ie(e){return e<=1&&(e=100*e+"%"),e}function ae(e){return Math.round(255*parseFloat(e)).toString(16)}function oe(e){return re(e)/255}var se,le,ue,ce=(le="[\\s|\\(]+("+(se="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+se+")[,|\\s]+("+se+")\\s*\\)?",ue="[\\s|\\(]+("+se+")[,|\\s]+("+se+")[,|\\s]+("+se+")[,|\\s]+("+se+")\\s*\\)?",{CSS_UNIT:new RegExp(se),rgb:new RegExp("rgb"+le),rgba:new RegExp("rgba"+ue),hsl:new RegExp("hsl"+le),hsla:new RegExp("hsla"+ue),hsv:new RegExp("hsv"+le),hsva:new RegExp("hsva"+ue),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function de(e){return!!ce.CSS_UNIT.exec(e)}var he=(e=>(e.Bytes="bytes",e.Short="short",e.Nanoseconds="ns",e))(he||{}),pe=(e=>(e.TopTable="topTable",e.FlameGraph="flameGraph",e.Both="both",e))(pe||{}),fe=(e=>(e.ValueBased="valueBased",e.PackageBased="packageBased",e))(fe||{}),me=(e=>(e.Default="default",e.DiffColorBlind="diffColorBlind",e))(me||{}),ge=r(4201);const ve=[I({h:24,s:69,l:60}),I({h:34,s:65,l:65}),I({h:194,s:52,l:61}),I({h:163,s:45,l:55}),I({h:211,s:48,l:60}),I({h:246,s:40,l:65}),I({h:305,s:63,l:79}),I({h:47,s:100,l:73}),I({r:183,g:219,b:171}),I({r:244,g:213,b:152}),I({r:78,g:146,b:249}),I({r:249,g:186,b:143}),I({r:242,g:145,b:145}),I({r:130,g:181,b:216}),I({r:229,g:168,b:226}),I({r:174,g:162,b:224}),I({r:154,g:196,b:138}),I({r:242,g:201,b:109}),I({r:101,g:197,b:219}),I({r:249,g:147,b:78}),I({r:234,g:100,b:96}),I({r:81,g:149,b:206}),I({r:214,g:131,b:206}),I({r:128,g:110,b:183})],ye=`linear-gradient(90deg, ${we(1,100,0,1)} 0%, ${we(100,100,0,1)} 100%)`,be=`linear-gradient(90deg, ${ve[0]} 0%, ${ve[2]} 30%, ${ve[6]} 50%, ${ve[7]} 70%, ${ve[8]} 100%)`;function we(e,t,r,n){const i=Math.min(1,e/t/(n-r));return I({h:50-50*i,s:100,l:65+7*i})}function Se(e,t){const r=function(e,t=0){let r,n,i,a,o,s,l,u;for(r=3&e.length,n=e.length-r,i=t,o=3432918353,s=461845907,u=0;u>>16)*o&65535)<<16)&4294967295,l=l<<15|l>>>17,l=(65535&l)*s+(((l>>>16)*s&65535)<<16)&4294967295,i^=l,i=i<<13|i>>>19,a=5*(65535&i)+((5*(i>>>16)&65535)<<16)&4294967295,i=27492+(65535&a)+((58964+(a>>>16)&65535)<<16);switch(l=0,r){case 3:l^=(255&e.charCodeAt(u+2))<<16;case 2:l^=(255&e.charCodeAt(u+1))<<8;case 1:l^=255&e.charCodeAt(u);default:l=(65535&l)*o+(((l>>>16)*o&65535)<<16)&4294967295,l=l<<15|l>>>17,l=(65535&l)*s+(((l>>>16)*s&65535)<<16)&4294967295,i^=l}return i^=e.length,i^=i>>>16,i=2246822507*(65535&i)+((2246822507*(i>>>16)&65535)<<16)&4294967295,i^=i>>>13,i=3266489909*(65535&i)+((3266489909*(i>>>16)&65535)<<16)&4294967295,i^=i>>>16,i>>>0}(function(e){var t;for(const[r,n]of ke){const r=e.match(n);if(r)return(null==(t=r.groups)?void 0:t.packageName)||""}return}(e)||"",0)%ve.length;let n=ve[r].clone();return t.isLight&&(n=n.brighten(15)),n}const xe=["rgb(0, 170, 0)","rgb(148, 142, 142)","rgb(200, 0, 0)"],Oe=`linear-gradient(90deg, ${xe[0]} 0%, ${xe[1]} 50%, ${xe[2]} 100%)`,_e=["rgb(26, 133, 255)","rgb(148, 142, 142)","rgb(220, 50, 32)"],Ee=`linear-gradient(90deg, ${_e[0]} 0%, ${_e[1]} 50%, ${_e[2]} 100%)`;const ke=[["phpspy",/^(?([^\/]*\/)*)(?.*\.php+)(?.*)$/],["pyspy",/^(?([^\/]*\/)*)(?.*\.py+)(?.*)$/],["rbspy",/^(?([^\/]*\/)*)(?.*\.rb+)(?.*)$/],["nodespy",/^(\.\/node_modules\/)?(?[^/]*)(?.*\.?(jsx?|tsx?)?):(?.*):(?.*)$/],["gospy",/^(?.*?\/.*?\.|.*?\.|.+)(?.*)$/],["javaspy",/^(?.+\/)(?.+\.)(?.+)$/],["dotnetspy",/^(?.+)\.(.+)\.(.+)\(.*\)$/],["tracing",/^(?.+?):.*$/],["pyroscope-rs",/^(?[^::]+)/],["ebpfspy",/^(?.+)$/],["unknown",/^(?.+)$/]];function Ce(e){const{canvasRef:t,data:r,root:n,depth:i,direction:a,wrapperWidth:s,rangeMin:l,rangeMax:u,matchedLabels:c,textAlign:d,totalViewTicks:y,totalColorTicks:O,totalTicksRight:_,colorScheme:E,focusedItemData:k,collapsedMap:C}=e,T=function(e,t,r){const[n,i]=(0,o.useState)();return(0,o.useEffect)((()=>{if(!r||!e.current)return;const n=e.current.getContext("2d"),a=p*r;e.current.width=Math.round(t*window.devicePixelRatio),e.current.height=Math.round(a),e.current.style.width=`${t}px`,e.current.style.height=a/window.devicePixelRatio+"px",n.textBaseline="middle",n.font=12*window.devicePixelRatio+"px monospace",n.strokeStyle="white",i(n)}),[e,i,t,r]),n}(t,s,i),A=(0,h.useTheme2)(),R=(0,o.useMemo)((()=>{const e=I(A.colors.background.secondary);return A.isLight?e.darken(10).toHexString():e.lighten(10).toHexString()}),[A]),D=function(e,t,r,n,i,a,s,l,u){return(0,o.useCallback)((function(o,c,d){if(d&&!l)return i;const h=void 0===o.valueRight||r!==me.Default&&r!==me.DiffColorBlind?r===fe.ValueBased?we(o.value,e,a,s):Se(c,n):function(e,t,r,n,i){const a=i===me.Default?xe:_e,o=(0,ge.scaleLinear)().domain([-100,0,100]).range(a),s=e-t,l=r-n;if(0===n||0===l)return I(o(0));const u=Math.round(1e4*s/l)/100;return I(o((Math.round(1e4*t/n)/100-u)/u*100))}(o.value,o.valueRight,e,t,r);return l?l.has(c)?h.toHslString():i:o.level>u-1?h.toHslString():h.lighten(15).toHslString()}),[e,t,r,n,a,s,l,u,i])}(O,_,E,A,R,l,u,c,k?k.item.level:0),P=function(e,t,r,n,i){return(0,o.useMemo)((()=>{if(!e)return()=>{};return(a,o,s,l,u,c)=>{e.beginPath(),e.rect(o+v,s,l,u),e.fillStyle=r(a,c,!1),e.stroke(),e.fill();const d=i.get(a);let h=c;if(d&&d.collapsed){h=`(${d.items.length}) `+c}l>=g&&(d?(Te(e,t,h,a,l,"left"===n?o+S+x:o,s,n),function(e,t,r,n,i,a){const o=t+S;e.beginPath(),e.rect(t,r,o-t+b+w,n),e.fill(),e.beginPath(),a.collapsed?e.rect(o,r+n/4,b,n/2):a.items[0]===i?e.rect(o,r+n/2,b,n/2):a.items[a.items.length-1]===i?e.rect(o,r,b,n/2):e.rect(o,r,b,n);e.fillStyle="#666",e.fill()}(e,o,s,u,a,d)):Te(e,t,h,a,l,o,s,n))}}),[e,r,n,t,i])}(T,r,D,d,C);(0,o.useEffect)((()=>{if(!T)return;T.clearRect(0,0,T.canvas.width,T.canvas.height);const e=new Path2D;!function(e,t,r,n,i,a,o,s,l){const u=[];u.push({item:e,levelOffset:0});const c=o*window.devicePixelRatio/n/(a-i);let d;for(;u.length>0;){const{item:e,levelOffset:a}=u.shift();let o=e.value;const h=o*c<=f,g=o*c-(h?0:2*v),y=p;if(g({item:e,levelOffset:a+b}))))}}(n,a,r,y,l,u,s,C,((t,r,n,i,a,o,s)=>{s?e.rect(r,n,i,a):P(t,r,n,i,a,o)})),T.fillStyle=R,T.fill(e)}),[T,r,n,s,l,u,y,a,P,C,R])}function Te(e,t,r,n,i,a,o,s){e.save(),e.clip(),e.fillStyle="#222";const l=t.valueDisplayProcessor(n.value),u=l.suffix?l.text+l.suffix:l.text,c=e.measureText(r),d=i-y;let h=`${r} (${u})`,f=Math.max(a,0)+y;c.width>d&&(e.textAlign=s,"right"===s&&(h=r,f=a+i-y)),e.fillText(h,f,o+p/2+2),e.restore()}function Ae(e,t,r,n){return(e-t*r)*n}const Re=({data:e,rangeMin:t,rangeMax:r,matchedLabels:i,setRangeMin:a,setRangeMax:s,onItemFocused:l,focusedItemData:u,textAlign:c,onSandwich:h,colorScheme:p,totalProfileTicks:f,totalProfileTicksRight:m,totalViewTicks:g,root:v,direction:y,depth:b,showFlameGraphOnly:w,collapsedMap:S,setCollapsedMap:x,collapsing:O,getExtraContextMenuButtons:E,selectedView:C,search:T})=>{const A=De(),[R,{width:D}]=d(),P=(0,o.useRef)(null),[j,I]=(0,o.useState)(),[L,M]=(0,o.useState)();Ce({canvasRef:P,colorScheme:p,data:e,focusedItemData:u,root:v,direction:y,depth:b,rangeMax:r,rangeMin:t,matchedLabels:i,textAlign:c,totalViewTicks:g,totalColorTicks:e.isDiffFlamegraph()?f:g,totalTicksRight:m,wrapperWidth:D,collapsedMap:S});const N=(0,o.useCallback)((n=>{I(void 0);const i=P.current.clientWidth/g/(r-t),a=Pe({x:n.nativeEvent.offsetX,y:n.nativeEvent.offsetY},v,y,b,i,g,t,S);M(a?{posY:n.clientY,posX:n.clientX,item:a,label:e.getLabel(a.itemIndexes[0])}:void 0)}),[e,t,r,g,v,y,b,S]),[F,V]=(0,o.useState)(),z=(0,o.useCallback)((e=>{if(void 0===L){I(void 0),V(void 0);const n=P.current.clientWidth/g/(r-t),i=Pe({x:e.nativeEvent.offsetX,y:e.nativeEvent.offsetY},v,y,b,n,g,t,S);i&&(V({x:e.clientX,y:e.clientY}),I(i))}}),[t,r,g,L,V,v,y,b,S]),B=(0,o.useCallback)((()=>{I(void 0)}),[]);return(0,o.useEffect)((()=>{const e=e=>{var t;e.target instanceof HTMLElement&&"flameGraphCanvasContainer_clickOutsideCheck"!==(null==(t=e.target.parentElement)?void 0:t.id)&&M(void 0)};return window.addEventListener("click",e),()=>window.removeEventListener("click",e)}),[M]),(0,n.jsxs)("div",{className:A.graph,children:[(0,n.jsx)("div",{className:A.canvasWrapper,id:"flameGraphCanvasContainer_clickOutsideCheck",ref:R,children:(0,n.jsx)("canvas",{ref:P,"data-testid":"flameGraph",onClick:N,onMouseMove:z,onMouseLeave:B})}),(0,n.jsx)(k,{position:F,item:j,data:e,totalTicks:g,collapseConfig:j?S.get(j):void 0}),!w&&L&&(0,n.jsx)(_,{data:e,itemData:L,collapsing:O,collapseConfig:S.get(L.item),onMenuItemClick:()=>{M(void 0)},onItemFocus:()=>{a(L.item.start/g),s((L.item.start+L.item.value)/g),l(L)},onSandwich:()=>{h(e.getLabel(L.item.itemIndexes[0]))},onExpandGroup:()=>{x(S.setCollapsedStatus(L.item,!1))},onCollapseGroup:()=>{x(S.setCollapsedStatus(L.item,!0))},onExpandAllGroups:()=>{x(S.setAllCollapsedStatus(!1))},onCollapseAllGroups:()=>{x(S.setAllCollapsedStatus(!0))},allGroupsCollapsed:Array.from(S.values()).every((e=>e.collapsed)),allGroupsExpanded:Array.from(S.values()).every((e=>!e.collapsed)),getExtraContextMenuButtons:E,selectedView:C,search:T})]})},De=()=>({graph:(0,i.css)({label:"graph",overflow:"auto",flexGrow:1,flexBasis:"50%"}),canvasContainer:(0,i.css)({label:"canvasContainer",display:"flex"}),canvasWrapper:(0,i.css)({label:"canvasWrapper",cursor:"pointer",flex:1,overflow:"hidden"}),sandwichMarker:(0,i.css)({label:"sandwichMarker",writingMode:"vertical-lr",transform:"rotate(180deg)",overflow:"hidden",whiteSpace:"nowrap"}),sandwichMarkerIcon:(0,i.css)({label:"sandwichMarkerIcon",verticalAlign:"baseline"})}),Pe=(e,t,r,n,i,a,o,s)=>{let l=t,u="children"===r?0:n-1;const c=Math.floor(e.y/(p/window.devicePixelRatio));let d;for(;l;){const t=l;if(l=void 0,u===c){d=t;break}const n="children"===r?t.children:t.parents||[];for(const t of n){const n=Ae(t.start,a,o,i),c=Ae(t.start+t.value,a,o,i);if(n<=e.x&&e.x{const s=(0,h.useStyles2)(Ie),l=[],u=(0,E.getValueFormat)("short")(r),c=e.valueDisplayProcessor(r);let d=c.text+c.suffix;const p=e.getUnitTitle();if("Count"===p&&(c.suffix||(d=c.text)),l.push((0,n.jsxs)("div",{className:s.metadataPill,children:[d," | ",u.text,u.suffix," samples (",p,")"]},"default")),i&&l.push((0,n.jsx)(h.Tooltip,{content:i,placement:"top",children:(0,n.jsxs)("div",{children:[(0,n.jsx)(h.Icon,{size:"sm",name:"angle-right"}),(0,n.jsxs)("div",{className:s.metadataPill,children:[(0,n.jsx)(h.Icon,{size:"sm",name:"gf-show-context"})," ",(0,n.jsx)("span",{className:s.metadataPillName,children:i.substring(i.lastIndexOf("/")+1)}),(0,n.jsx)(h.IconButton,{className:s.pillCloseButton,name:"times",size:"sm",onClick:o,tooltip:"Remove sandwich view","aria-label":"Remove sandwich view"})]})]})},"sandwich")),t){const e=r>0?Math.round(t.item.value/r*1e4)/100:0,i=e>0?"eye":"exclamation-circle";l.push((0,n.jsx)(h.Tooltip,{content:t.label,placement:"top",children:(0,n.jsxs)("div",{children:[(0,n.jsx)(h.Icon,{size:"sm",name:"angle-right"}),(0,n.jsxs)("div",{className:s.metadataPill,children:[(0,n.jsx)(h.Icon,{size:"sm",name:i})," ",e,"% of total",(0,n.jsx)(h.IconButton,{className:s.pillCloseButton,name:"times",size:"sm",onClick:a,tooltip:"Remove focus","aria-label":"Remove focus"})]})]})},"focus"))}return(0,n.jsx)("div",{className:s.metadata,children:l})}));je.displayName="FlameGraphMetadata";const Ie=e=>({metadataPill:(0,i.css)({label:"metadataPill",display:"inline-flex",alignItems:"center",background:e.colors.background.secondary,borderRadius:e.shape.borderRadius(8),padding:e.spacing(.5,1),fontSize:e.typography.bodySmall.fontSize,fontWeight:e.typography.fontWeightMedium,lineHeight:e.typography.bodySmall.lineHeight,color:e.colors.text.secondary}),pillCloseButton:(0,i.css)({label:"pillCloseButton",verticalAlign:"text-bottom",margin:e.spacing(0,.5)}),metadata:(0,i.css)({display:"flex",alignItems:"center",justifyContent:"center",margin:"8px 0"}),metadataPillName:(0,i.css)({label:"metadataPillName",maxWidth:"200px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",marginLeft:e.spacing(.5)})}),Le=({data:e,rangeMin:t,rangeMax:r,matchedLabels:a,setRangeMin:s,setRangeMax:l,onItemFocused:u,focusedItemData:c,textAlign:d,onSandwich:p,sandwichItem:f,onFocusPillClick:m,onSandwichPillClick:g,colorScheme:v,showFlameGraphOnly:y,getExtraContextMenuButtons:b,collapsing:w,selectedView:S,search:x,collapsedMap:O,setCollapsedMap:_})=>{const E=Me(),[k,C]=(0,o.useState)(),[T,A]=(0,o.useState)(),[R,D]=(0,o.useState)(0),[P,j]=(0,o.useState)(),[I,L]=(0,o.useState)(0);if((0,o.useEffect)((()=>{var t,r,n;if(e){let i,a=e.getLevels(),o=a.length?a[0][0].value:0,s=a.length?a[0][0].valueRight:void 0,l=o;if(f){const[o,s]=e.getSandwichLevels(f);a=s,i=o,l=null!=(n=null==(r=null==(t=s[0])?void 0:t[0])?void 0:r.value)?n:0}C(a),A(i),D(o),j(s),L(l)}}),[e,f]),!k)return null;const M={data:e,rangeMin:t,rangeMax:r,matchedLabels:a,setRangeMin:s,setRangeMax:l,onItemFocused:u,focusedItemData:c,textAlign:d,onSandwich:p,colorScheme:v,totalProfileTicks:R,totalProfileTicksRight:P,totalViewTicks:I,showFlameGraphOnly:y,collapsedMap:O,setCollapsedMap:_,getExtraContextMenuButtons:b,collapsing:w,search:x,selectedView:S};let N=null;return(null==T?void 0:T.length)?N=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:E.sandwichCanvasWrapper,children:[(0,n.jsxs)("div",{className:E.sandwichMarker,children:["Callers",(0,n.jsx)(h.Icon,{className:E.sandwichMarkerIcon,name:"arrow-down"})]}),(0,n.jsx)(Re,{...M,root:T[T.length-1][0],depth:T.length,direction:"parents",collapsing:!1})]}),(0,n.jsxs)("div",{className:E.sandwichCanvasWrapper,children:[(0,n.jsxs)("div",{className:(0,i.cx)(E.sandwichMarker,E.sandwichMarkerCalees),children:[(0,n.jsx)(h.Icon,{className:E.sandwichMarkerIcon,name:"arrow-up"}),"Callees"]}),(0,n.jsx)(Re,{...M,root:k[0][0],depth:k.length,direction:"children",collapsing:!1})]})]}):(null==k?void 0:k.length)&&(N=(0,n.jsx)(Re,{...M,root:k[0][0],depth:k.length,direction:"children"})),(0,n.jsxs)("div",{className:E.graph,children:[(0,n.jsx)(je,{data:e,focusedItem:c,sandwichedLabel:f,totalTicks:I,onFocusPillClick:m,onSandwichPillClick:g}),N]})},Me=()=>({graph:(0,i.css)({label:"graph",overflow:"auto",flexGrow:1,flexBasis:"50%"}),sandwichCanvasWrapper:(0,i.css)({label:"sandwichCanvasWrapper",display:"flex",marginBottom:p/window.devicePixelRatio+"px"}),sandwichMarker:(0,i.css)({label:"sandwichMarker",writingMode:"vertical-lr",transform:"rotate(180deg)",overflow:"hidden",whiteSpace:"nowrap"}),sandwichMarkerCalees:(0,i.css)({label:"sandwichMarkerCalees",textAlign:"right"}),sandwichMarkerIcon:(0,i.css)({label:"sandwichMarkerIcon",verticalAlign:"baseline"})});var Ne=r(3241);function Fe(e,t){const r=function(e){return e.map((e=>{var t,r;if(!(null==(t=e.parents)?void 0:t.length))return e;const n={...e,children:[]},i=[{child:n,parent:e.parents[0]}];for(;i.length;){const e=i.shift(),t={...e.parent,children:e.child?[e.child]:[],parents:[]};e.child&&(t.value=e.child.value,e.child.parents=[t]),(null==(r=e.parent.parents)?void 0:r.length)&&i.push({child:t,parent:e.parent.parents[0]})}return n}))}(e);return Ve(r,t,"parents")}function Ve(e,t,r="children"){var n;const i="parents"===r?"children":"parents",a=[],o=[{previous:void 0,items:e,level:0}];for(;o.length;){const e=o.shift(),s=e.items.flatMap((e=>e.itemIndexes)),l={value:e.items.reduce(((e,t)=>e+t.value),0),itemIndexes:s,children:[],parents:[],start:0,level:e.level};if(a[e.level]=a[e.level]||[],a[e.level].push(l),e.previous){l[i]=[e.previous];const t=(null==(n=e.previous[r])?void 0:n.reduce(((e,t)=>e+t.value),0))||0;l.start=e.previous.start+t,e.previous[r].push(l)}const u=e.items.flatMap((e=>e[r]||[])),c=(0,Ne.groupBy)(u,(e=>t.getLabel(e.itemIndexes[0])));for(const t of Object.values(c))o.push({previous:l,items:t,level:e.level+1})}return"parents"===r&&(a.reverse(),a.forEach(((e,t)=>{e.forEach((e=>{e.level=t}))}))),a}class ze{constructor(e){this.map=new Map,this.map=e||new Map}get(e){return this.map.get(e)}keys(){return this.map.keys()}values(){return this.map.values()}size(){return this.map.size}setCollapsedStatus(e,t){const r=new Map(this.map),n=this.map.get(e),i={...n,collapsed:t};for(const e of n.items)r.set(e,i);return new ze(r)}setAllCollapsedStatus(e){const t=new Map(this.map);for(const r of this.map.keys()){const n={...this.map.get(r),collapsed:e};t.set(r,n)}return new ze(t)}}class Be{constructor(e){this.map=new Map,this.threshold=.99,void 0!==e&&(this.threshold=e)}addTree(e){var t;const r=[e];for(;r.length;){const e=r.shift();(null==(t=e.parents)?void 0:t.length)&&this.addItem(e,e.parents[0]),e.children.length&&r.unshift(...e.children)}}addItem(e,t){if(t&&e.value>t.value*this.threshold&&1===t.children.length)if(this.map.has(t)){const r=this.map.get(t);this.map.set(e,r),r.items.push(e)}else{const r={items:[t,e],collapsed:!0};this.map.set(t,r),this.map.set(e,r)}}getCollapsedMap(){return new ze(this.map)}}class $e{constructor(e,t,r=(0,E.createTheme)()){var n,i,a;this.data=e,this.options=t;const o=function(e){const t=[["label",[E.FieldType.string,E.FieldType.enum]],["level",[E.FieldType.number]],["value",[E.FieldType.number]],["self",[E.FieldType.number]]],r=[],n=[];for(const i of t){const[t,a]=i,o=null==e?void 0:e.fields.find((e=>e.name===t));o?a.includes(o.type)||n.push({name:t,expectedTypes:a,type:o.type}):r.push(t)}if(r.length>0||n.length>0)return{wrongTypeFields:n,missingFields:r}}(e);if(o)throw new Error(function(e){return e.missingFields.length?`Data is missing fields: ${e.missingFields.join(", ")}`:e.wrongTypeFields.length?`Data has fields of wrong type: ${e.wrongTypeFields.map((e=>`${e.name} has type ${e.type} but should be ${e.expectedTypes.join(" or ")}`)).join(", ")}`:""}(o));if(this.labelField=e.fields.find((e=>"label"===e.name)),this.levelField=e.fields.find((e=>"level"===e.name)),this.valueField=e.fields.find((e=>"value"===e.name)),this.selfField=e.fields.find((e=>"self"===e.name)),this.valueRightField=e.fields.find((e=>"valueRight"===e.name)),this.selfRightField=e.fields.find((e=>"selfRight"===e.name)),(this.valueField||this.selfField)&&(!this.valueField||!this.selfField))throw new Error("Malformed dataFrame: both valueRight and selfRight has to be present if one of them is present.");const s=null==(a=null==(i=null==(n=this.labelField)?void 0:n.config)?void 0:i.type)?void 0:a.enum;s?(this.labelDisplayProcessor=(0,E.getDisplayProcessor)({field:this.labelField,theme:r}),this.uniqueLabels=s.text||[]):(this.labelDisplayProcessor=e=>({text:e+"",numeric:0}),this.uniqueLabels=[...new Set(this.labelField.values)]),this.valueDisplayProcessor=(0,E.getDisplayProcessor)({field:this.valueField,theme:r})}isDiffFlamegraph(){return Boolean(this.valueRightField&&this.selfRightField)}getLabel(e){return this.labelDisplayProcessor(this.labelField.values[e]).text}getLevel(e){return this.levelField.values[e]}getValue(e){return Ue(this.valueField,e)}getValueRight(e){return Ue(this.valueRightField,e)}getSelf(e){return Ue(this.selfField,e)}getSelfRight(e){return Ue(this.selfRightField,e)}getSelfDisplay(e){return this.valueDisplayProcessor(this.getSelf(e))}getUniqueLabels(){return this.uniqueLabels}getUnitTitle(){switch(this.valueField.config.unit){case he.Bytes:return"RAM";case he.Nanoseconds:return"Time"}return"Count"}getLevels(){return this.initLevels(),this.levels}getSandwichLevels(e){const t=this.getNodesWithLabel(e);if(!(null==t?void 0:t.length))return[[],[]];return[Fe(t,this),Ve(t,this)]}getNodesWithLabel(e){return this.initLevels(),this.uniqueLabelsMap[e]}getCollapsedMap(){return this.initLevels(),this.collapsedMap}initLevels(){if(!this.levels){const[e,t,r]=function(e,t){const r=[];let n,i=0;const a={};for(let t=0;t0?e.getLevel(t-1):void 0;if(r[o]=r[o]||[],s&&s>=o){const t=r[o][r[o].length-1];i=t.start+e.getValue(t.itemIndexes[0])+e.getValueRight(t.itemIndexes[0]),n=t.parents[0]}const l={itemIndexes:[t],value:e.getValue(t)+e.getValueRight(t),valueRight:e.isDiffFlamegraph()?e.getValueRight(t):void 0,start:i,parents:n&&[n],children:[],level:o};a[e.getLabel(t)]?a[e.getLabel(t)].push(l):a[e.getLabel(t)]=[l],n&&n.children.push(l),n=l,r[o].push(l)}const o=new Be(null==t?void 0:t.collapsingThreshold);return(null==t?void 0:t.collapsing)&&o.addTree(r[0][0]),[r,a,o.getCollapsedMap()]}(this,this.options);this.levels=e,this.uniqueLabelsMap=t,this.collapsedMap=r}}}function Ue(e,t){if(!e)return 0;return("number"==typeof t?[t]:t).reduce(((t,r)=>t+e.values[r]),0)}var qe=r(5847),He=r(2293);const We=({search:e,setSearch:t,selectedView:r,setSelectedView:a,containerWidth:s,onReset:l,textAlign:u,onTextAlignChange:c,showResetButton:d,colorScheme:p,onColorSchemeChange:f,stickyHeader:m,extraHeaderElements:g,vertical:v,isDiffMode:y,setCollapsedMap:b,collapsedMap:w})=>{const S=(0,h.useStyles2)(Xe),[x,O]=function(e,t){const[r,n]=(0,o.useState)(e),i=(0,He.A)(e);return(0,qe.A)((()=>{t(r)}),250,[r]),(0,o.useEffect)((()=>{i!==e&&e!==r&&n(e)}),[e,i,r]),[r,n]}(e,t),_=""!==x?(0,n.jsx)(h.Button,{icon:"times",fill:"text",size:"sm",onClick:()=>{t(""),O("")},children:"Clear"}):null;return(0,n.jsxs)("div",{className:(0,i.cx)(S.header,{[S.stickyHeader]:m}),children:[(0,n.jsx)("div",{className:S.inputContainer,children:(0,n.jsx)(h.Input,{value:x||"",onChange:e=>{O(e.currentTarget.value)},placeholder:"Search...",suffix:_})}),(0,n.jsxs)("div",{className:S.rightContainer,children:[d&&(0,n.jsx)(h.Button,{variant:"secondary",fill:"outline",size:"sm",icon:"history-alt",tooltip:"Reset focus and sandwich state",onClick:()=>{l()},className:S.buttonSpacing,"aria-label":"Reset focus and sandwich state"}),(0,n.jsx)(Ge,{value:p,onChange:f,isDiffMode:y}),(0,n.jsxs)(h.ButtonGroup,{className:S.buttonSpacing,children:[(0,n.jsx)(h.Button,{variant:"secondary",fill:"outline",size:"sm",tooltip:"Expand all groups",onClick:()=>{b(w.setAllCollapsedStatus(!1))},"aria-label":"Expand all groups",icon:"angle-double-down",disabled:r===pe.TopTable}),(0,n.jsx)(h.Button,{variant:"secondary",fill:"outline",size:"sm",tooltip:"Collapse all groups",onClick:()=>{b(w.setAllCollapsedStatus(!0))},"aria-label":"Collapse all groups",icon:"angle-double-up",disabled:r===pe.TopTable})]}),(0,n.jsx)(h.RadioButtonGroup,{size:"sm",disabled:r===pe.TopTable,options:Qe,value:u,onChange:c,className:S.buttonSpacing}),(0,n.jsx)(h.RadioButtonGroup,{size:"sm",options:Ke(s,v),value:r,onChange:a}),g&&(0,n.jsx)("div",{className:S.extraElements,children:g})]})]})};function Ge(e){const t=(0,h.useStyles2)(Xe);let r=(0,n.jsxs)(h.Menu,{children:[(0,n.jsx)(h.Menu.Item,{label:"By package name",onClick:()=>e.onChange(fe.PackageBased)}),(0,n.jsx)(h.Menu.Item,{label:"By value",onClick:()=>e.onChange(fe.ValueBased)})]});const a={[fe.ValueBased]:t.colorDotByValue,[fe.PackageBased]:t.colorDotByPackage,[me.DiffColorBlind]:t.colorDotDiffColorBlind,[me.Default]:t.colorDotDiffDefault}[e.value]||t.colorDotByValue;let o=(0,n.jsx)("span",{className:(0,i.cx)(t.colorDot,a)});return e.isDiffMode&&(r=(0,n.jsxs)(h.Menu,{children:[(0,n.jsx)(h.Menu.Item,{label:"Default (green to red)",onClick:()=>e.onChange(me.Default)}),(0,n.jsx)(h.Menu.Item,{label:"Color blind (blue to red)",onClick:()=>e.onChange(me.DiffColorBlind)})]}),o=(0,n.jsxs)("div",{className:(0,i.cx)(t.colorDotDiff,a),children:[(0,n.jsx)("div",{children:"-100% (removed)"}),(0,n.jsx)("div",{children:"0%"}),(0,n.jsx)("div",{children:"+100% (added)"})]})),(0,n.jsx)(h.Dropdown,{overlay:r,children:(0,n.jsx)(h.Button,{variant:"secondary",fill:"outline",size:"sm",tooltip:"Change color scheme",onClick:()=>{},className:t.buttonSpacing,"aria-label":"Change color scheme",children:o})})}const Qe=[{value:"left",description:"Align text left",icon:"align-left"},{value:"right",description:"Align text right",icon:"align-right"}];function Ke(e,t){let r=[{value:pe.TopTable,label:"Top Table",description:"Only show top table"},{value:pe.FlameGraph,label:"Flame Graph",description:"Only show flame graph"}];return(e>=800||t)&&r.push({value:pe.Both,label:"Both",description:"Show both the top table and flame graph"}),r}const Xe=e=>({header:(0,i.css)({label:"header",display:"flex",flexWrap:"wrap",justifyContent:"space-between",width:"100%",top:0,gap:e.spacing(1),marginTop:e.spacing(1)}),stickyHeader:(0,i.css)({zIndex:e.zIndex.navbarFixed,position:"sticky",background:e.colors.background.primary}),inputContainer:(0,i.css)({label:"inputContainer",flexGrow:1,minWidth:"150px",maxWidth:"350px"}),rightContainer:(0,i.css)({label:"rightContainer",display:"flex",alignItems:"flex-start",flexWrap:"wrap"}),buttonSpacing:(0,i.css)({label:"buttonSpacing",marginRight:e.spacing(1)}),resetButton:(0,i.css)({label:"resetButton",display:"flex",marginRight:e.spacing(2)}),resetButtonIconWrapper:(0,i.css)({label:"resetButtonIcon",padding:"0 5px",color:e.colors.text.disabled}),colorDot:(0,i.css)({label:"colorDot",display:"inline-block",width:"10px",height:"10px",borderRadius:"50%"}),colorDotDiff:(0,i.css)({label:"colorDotDiff",display:"flex",width:"200px",height:"12px",color:"white",fontSize:9,lineHeight:1.3,fontWeight:300,justifyContent:"space-between",padding:"0 2px",borderRadius:"2px"}),colorDotByValue:(0,i.css)({label:"colorDotByValue",background:ye}),colorDotByPackage:(0,i.css)({label:"colorDotByPackage",background:be}),colorDotDiffDefault:(0,i.css)({label:"colorDotDiffDefault",background:Oe}),colorDotDiffColorBlind:(0,i.css)({label:"colorDotDiffColorBlind",background:Ee}),extraElements:(0,i.css)({label:"extraElements",marginLeft:e.spacing(1)})});let Je;Je="undefined"!=typeof window?window:"undefined"!=typeof self?self:r.g;let Ye=null,Ze=null;const et=Je.clearTimeout,tt=Je.setTimeout,rt=Je.cancelAnimationFrame||Je.mozCancelAnimationFrame||Je.webkitCancelAnimationFrame,nt=Je.requestAnimationFrame||Je.mozRequestAnimationFrame||Je.webkitRequestAnimationFrame;function it(e){let t,r,n,i,a,o,s;const l="undefined"!=typeof document&&document.attachEvent;if(!l){o=function(e){const t=e.__resizeTriggers__,r=t.firstElementChild,n=t.lastElementChild,i=r.firstElementChild;n.scrollLeft=n.scrollWidth,n.scrollTop=n.scrollHeight,i.style.width=r.offsetWidth+1+"px",i.style.height=r.offsetHeight+1+"px",r.scrollLeft=r.scrollWidth,r.scrollTop=r.scrollHeight},a=function(e){return e.offsetWidth!==e.__resizeLast__.width||e.offsetHeight!==e.__resizeLast__.height},s=function(e){if(e.target.className&&"function"==typeof e.target.className.indexOf&&e.target.className.indexOf("contract-trigger")<0&&e.target.className.indexOf("expand-trigger")<0)return;const t=this;o(this),this.__resizeRAF__&&Ye(this.__resizeRAF__),this.__resizeRAF__=Ze((function(){a(t)&&(t.__resizeLast__.width=t.offsetWidth,t.__resizeLast__.height=t.offsetHeight,t.__resizeListeners__.forEach((function(r){r.call(t,e)})))}))};let e=!1,l="";n="animationstart";const u="Webkit Moz O ms".split(" ");let c="webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "),d="";{const t=document.createElement("fakeelement");if(void 0!==t.style.animationName&&(e=!0),!1===e)for(let r=0;r div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',a=r.head||r.getElementsByTagName("head")[0],o=r.createElement("style");o.id="detectElementResize",o.type="text/css",null!=e&&o.setAttribute("nonce",e),o.styleSheet?o.styleSheet.cssText=n:o.appendChild(r.createTextNode(n)),a.appendChild(o)}}(l),a.__resizeLast__={},a.__resizeListeners__=[],(a.__resizeTriggers__=l.createElement("div")).className="resize-triggers";const c=l.createElement("div");c.className="expand-trigger",c.appendChild(l.createElement("div"));const d=l.createElement("div");d.className="contract-trigger",a.__resizeTriggers__.appendChild(c),a.__resizeTriggers__.appendChild(d),a.appendChild(a.__resizeTriggers__),o(a),a.addEventListener("scroll",s,!0),n&&(a.__resizeTriggers__.__animationListener__=function(e){e.animationName===r&&o(a)},a.__resizeTriggers__.addEventListener(n,a.__resizeTriggers__.__animationListener__))}a.__resizeListeners__.push(u)}},removeResizeListener:function(e,t){if(l)e.detachEvent("onresize",t);else if(e.__resizeListeners__.splice(e.__resizeListeners__.indexOf(t),1),!e.__resizeListeners__.length){e.removeEventListener("scroll",s,!0),e.__resizeTriggers__.__animationListener__&&(e.__resizeTriggers__.removeEventListener(n,e.__resizeTriggers__.__animationListener__),e.__resizeTriggers__.__animationListener__=null);try{e.__resizeTriggers__=!e.removeChild(e.__resizeTriggers__)}catch(e){}}}}}null==rt||null==nt?(Ye=et,Ze=function(e){return tt(e,20)}):(Ye=function([e,t]){rt(e),et(t)},Ze=function(e){const t=nt((function(){et(r),e()})),r=tt((function(){rt(t),e()}),20);return[t,r]});class at extends o.Component{constructor(...e){super(...e),this.state={height:this.props.defaultHeight||0,scaledHeight:this.props.defaultHeight||0,scaledWidth:this.props.defaultWidth||0,width:this.props.defaultWidth||0},this._autoSizer=null,this._detectElementResize=null,this._parentNode=null,this._resizeObserver=null,this._timeoutId=null,this._onResize=()=>{this._timeoutId=null;const{disableHeight:e,disableWidth:t,onResize:r}=this.props;if(this._parentNode){const n=window.getComputedStyle(this._parentNode)||{},i=parseFloat(n.paddingLeft||"0"),a=parseFloat(n.paddingRight||"0"),o=parseFloat(n.paddingTop||"0"),s=parseFloat(n.paddingBottom||"0"),l=this._parentNode.getBoundingClientRect(),u=l.height-o-s,c=l.width-i-a,d=this._parentNode.offsetHeight-o-s,h=this._parentNode.offsetWidth-i-a;(e||this.state.height===d&&this.state.scaledHeight===u)&&(t||this.state.width===h&&this.state.scaledWidth===c)||(this.setState({height:d,width:h,scaledHeight:u,scaledWidth:c}),"function"==typeof r&&r({height:d,scaledHeight:u,scaledWidth:c,width:h}))}},this._setRef=e=>{this._autoSizer=e}}componentDidMount(){const{nonce:e}=this.props,t=this._autoSizer?this._autoSizer.parentNode:null;if(null!=t&&t.ownerDocument&&t.ownerDocument.defaultView&&t instanceof t.ownerDocument.defaultView.HTMLElement){this._parentNode=t;const r=t.ownerDocument.defaultView.ResizeObserver;null!=r?(this._resizeObserver=new r((()=>{this._timeoutId=setTimeout(this._onResize,0)})),this._resizeObserver.observe(t)):(this._detectElementResize=it(e),this._detectElementResize.addResizeListener(t,this._onResize)),this._onResize()}}componentWillUnmount(){this._parentNode&&(this._detectElementResize&&this._detectElementResize.removeResizeListener(this._parentNode,this._onResize),null!==this._timeoutId&&clearTimeout(this._timeoutId),this._resizeObserver&&this._resizeObserver.disconnect())}render(){const{children:e,defaultHeight:t,defaultWidth:r,disableHeight:n=!1,disableWidth:i=!1,doNotBailOutOnEmptyChildren:a=!1,nonce:s,onResize:l,style:u={},tagName:c="div",...d}=this.props,{height:h,scaledHeight:p,scaledWidth:f,width:m}=this.state,g={overflow:"visible"},v={};let y=!1;return n||(0===h&&(y=!0),g.height=0,v.height=h,v.scaledHeight=p),i||(0===m&&(y=!0),g.width=0,v.width=m,v.scaledWidth=f),a&&(y=!1),(0,o.createElement)(c,{ref:this._setRef,style:{...g,...u},...d},!y&&e(v))}}const ot=(0,o.memo)((({data:e,onSymbolClick:t,search:r,matchedLabels:i,onSearch:a,sandwichItem:s,onSandwich:l,onTableSort:u,colorScheme:c})=>{const d=(0,o.useMemo)((()=>{let t={};for(let r=0;r{if(i<3||o<3)return null;const p=function(e,t,r,i,a,o,s,l,u,c){const d=function(e,t,r,i){const a={type:h.TableCellDisplayMode.Custom,cellComponent:a=>(0,n.jsx)(ut,{frame:a.frame,onSandwich:e,onSearch:t,search:r,sandwichItem:i,rowIndex:a.rowIndex})},o={filterable:!1,width:lt,hideHeader:!0,inspect:!1,align:"auto",cellOptions:a};return{type:E.FieldType.number,name:"actions",values:[],config:{custom:o}}}(o,a,u,c),p={type:E.FieldType.string,name:"Symbol",values:[],config:{custom:{width:r-lt-2*O},links:[{title:"Highlight symbol",url:"",onClick:e=>{const t=e.origin.field.values[e.origin.rowIndex];i(t)}}]}};let f;if(e.isDiffFlamegraph()){p.config.custom.width=r-lt-3*O;const n=st("Baseline","percent"),i=st("Comparison","percent"),a=st("Diff","percent");a.config.custom.cellOptions.type=h.TableCellDisplayMode.ColorText;const[o,s]=l===me.DiffColorBlind?[_e[0],_e[2]]:[xe[0],xe[2]];a.config.mappings=[{type:E.MappingType.ValueToText,options:{[1/0]:{text:"new",color:s}}},{type:E.MappingType.ValueToText,options:{[-100]:{text:"removed",color:o}}},{type:E.MappingType.RangeToText,options:{from:0,to:1/0,result:{color:s}}},{type:E.MappingType.RangeToText,options:{from:-1/0,to:0,result:{color:o}}}];const u=e.getLevels(),c=u.length?u[0][0].value:0,m=u.length?u[0][0].valueRight:void 0;for(let e in t){d.values.push(null),p.values.push(e);const r=t[e].total,o=t[e].totalRight,s=c-m,l=Math.round(1e4*r/s)/100,u=Math.round(1e4*o/m)/100,h=(u-l)/l*100;a.values.push(h),n.values.push(l),i.values.push(u)}f={fields:[d,p,n,i,a],length:p.values.length}}else{const r=st("Self",e.selfField.config.unit),n=st("Total",e.valueField.config.unit);for(let e in t)d.values.push(null),p.values.push(e),r.values.push(t[e].self),n.values.push(t[e].total);f={fields:[d,p,r,n],length:p.values.length}}const m=(0,E.applyFieldOverrides)({data:[f],fieldConfig:{defaults:{},overrides:[]},replaceVariables:e=>e,theme:s});return m[0]}(e,d,i,t,a,l,f,c,r,s);return(0,n.jsx)(h.Table,{initialSortBy:m,onSortByChange:e=>{e&&e.length&&(null==u||u(e[0].displayName+"_"+(e[0].desc?"desc":"asc"))),g(e)},data:p,width:i,height:o})}})})}));function st(e,t){const r={width:O,align:"auto",inspect:!1,cellOptions:{type:h.TableCellDisplayMode.Auto}};return{type:E.FieldType.number,name:e,values:[],config:{unit:t,custom:r}}}ot.displayName="FlameGraphTopTableContainer";const lt=61;function ut(e){var t;const r=dt(),i=null==(t=e.frame.fields.find((e=>"Symbol"===e.name)))?void 0:t.values[e.rowIndex],a=e.search===i,o=e.sandwichItem===i;return(0,n.jsxs)("div",{className:r.actionCellWrapper,children:[(0,n.jsx)(h.IconButton,{className:r.actionCellButton,name:"search",variant:a?"primary":"secondary",tooltip:a?"Clear from search":"Search for symbol","aria-label":a?"Clear from search":"Search for symbol",onClick:()=>{e.onSearch(a?"":i)}}),(0,n.jsx)(h.IconButton,{className:r.actionCellButton,name:"gf-show-context",tooltip:o?"Remove from sandwich view":"Show in sandwich view",variant:o?"primary":"secondary","aria-label":o?"Remove from sandwich view":"Show in sandwich view",onClick:()=>{e.onSandwich(o?void 0:i)}})]})}const ct=e=>({topTableContainer:(0,i.css)({label:"topTableContainer",padding:e.spacing(1),backgroundColor:e.colors.background.secondary,height:"100%"})}),dt=()=>({actionCellWrapper:(0,i.css)({label:"actionCellWrapper",display:"flex",height:"24px"}),actionCellButton:(0,i.css)({label:"actionCellButton",marginRight:0,width:"24px"})}),ht=new a.A,pt=({data:e,onTableSymbolClick:t,onViewSelected:r,onTextAlignSelected:a,onTableSort:s,getTheme:l,stickyHeader:u,extraHeaderElements:c,vertical:p,showFlameGraphOnly:f,disableCollapsing:m,keepFocusOnDataChange:g,getExtraContextMenuButtons:v})=>{const[y,b]=(0,o.useState)(),[w,S]=(0,o.useState)(0),[x,O]=(0,o.useState)(1),[_,E]=(0,o.useState)(""),[k,C]=(0,o.useState)(pe.Both),[T,{width:A}]=d(),[R,D]=(0,o.useState)("left"),[P,j]=(0,o.useState)(),[I,L]=(0,o.useState)(new ze),M=(0,o.useMemo)((()=>l()),[l]),N=(0,o.useMemo)((()=>{if(!e)return;const t=new $e(e,{collapsing:!m},M);return L(t.getCollapsedMap()),t}),[e,M,m]),[F,V]=function(e){const t=(null==e?void 0:e.isDiffFlamegraph())?me.Default:fe.PackageBased,[r,n]=(0,o.useState)(t);return(0,o.useEffect)((()=>{n(t)}),[t]),[r,n]}(N),z=function(e){return{container:(0,i.css)({label:"container",overflow:"auto",height:"100%",display:"flex",flex:"1 1 0",flexDirection:"column",minHeight:0,gap:e.spacing(1)}),body:(0,i.css)({label:"body",flexGrow:1}),tableContainer:(0,i.css)({height:800}),horizontalContainer:(0,i.css)({label:"horizontalContainer",display:"flex",minHeight:0,flexDirection:"row",columnGap:e.spacing(1),width:"100%"}),horizontalGraphContainer:(0,i.css)({flexBasis:"50%"}),horizontalTableContainer:(0,i.css)({flexBasis:"50%",maxHeight:800}),verticalGraphContainer:(0,i.css)({marginBottom:e.spacing(1)}),verticalTableContainer:(0,i.css)({height:800})}}(M),B=function(e,t){return(0,o.useMemo)((()=>{if(e&&t){const r=new Set;let n=ht.filter(t.getUniqueLabels(),e);if(n)for(let e of n)r.add(t.getUniqueLabels()[e]);return r}}),[e,t])}(_,N);(0,o.useEffect)((()=>{A>0&&A<800&&k===pe.Both&&!p&&C(pe.FlameGraph)}),[k,C,A,p]);const $=(0,o.useCallback)((()=>{b(void 0),S(0),O(1)}),[b,O,S]),U=(0,o.useCallback)((()=>{j(void 0)}),[j]);(0,o.useEffect)((()=>{var e;if(!g)return $(),void U();if(N&&y){const t=null==(e=N.getNodesWithLabel(y.label))?void 0:e[0];if(t){b({...y,item:t});const e=N.getLevels(),r=e.length?e[0][0].value:0;S(t.start/r),O((t.start+t.value)/r)}else b({...y,item:{start:0,value:0,itemIndexes:[],children:[],level:0}}),S(0),O(1)}}),[N,g]);const q=(0,o.useCallback)((e=>{_===e?E(""):(null==t||t(e),E(e),$())}),[E,$,t,_]);if(!N)return null;const H=(0,n.jsx)(Le,{data:N,rangeMin:w,rangeMax:x,matchedLabels:B,setRangeMin:S,setRangeMax:O,onItemFocused:e=>b(e),focusedItemData:y,textAlign:R,sandwichItem:P,onSandwich:e=>{$(),j(e)},onFocusPillClick:$,onSandwichPillClick:U,colorScheme:F,showFlameGraphOnly:f,collapsing:!m,getExtraContextMenuButtons:v,selectedView:k,search:_,collapsedMap:I,setCollapsedMap:L}),W=(0,n.jsx)(ot,{data:N,onSymbolClick:q,search:_,matchedLabels:B,sandwichItem:P,onSandwich:j,onSearch:E,onTableSort:s,colorScheme:F});let G;return f||k===pe.FlameGraph?G=H:k===pe.TopTable?G=(0,n.jsx)("div",{className:z.tableContainer,children:W}):k===pe.Both&&(G=p?(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:z.verticalGraphContainer,children:H}),(0,n.jsx)("div",{className:z.verticalTableContainer,children:W})]}):(0,n.jsxs)("div",{className:z.horizontalContainer,children:[(0,n.jsx)("div",{className:z.horizontalTableContainer,children:W}),(0,n.jsx)("div",{className:z.horizontalGraphContainer,children:H})]})),(0,n.jsx)(h.ThemeContext.Provider,{value:M,children:(0,n.jsxs)("div",{ref:T,className:z.container,children:[!f&&(0,n.jsx)(We,{search:_,setSearch:E,selectedView:k,setSelectedView:e=>{C(e),null==r||r(e)},containerWidth:A,onReset:()=>{$(),U()},textAlign:R,onTextAlignChange:e=>{D(e),null==a||a(e)},showResetButton:Boolean(y||P),colorScheme:F,onColorSchemeChange:V,stickyHeader:Boolean(u),extraHeaderElements:c,vertical:p,isDiffMode:N.isDiffFlamegraph(),setCollapsedMap:L,collapsedMap:I}),(0,n.jsx)("div",{className:z.body,children:G})]})})}},1625:(e,t,r)=>{"use strict";r.d(t,{$l:()=>s,$m:()=>d,L4:()=>n,T6:()=>u,TZ:()=>l,eX:()=>o,ob:()=>c,on:()=>i,xB:()=>a});var n=(e=>(e.Linear="linear",e.Log="log",e.Ordinal="ordinal",e.Symlog="symlog",e))(n||{}),i=(e=>(e.Hue="hue",e.None="none",e.Opacity="opacity",e.Scheme="scheme",e))(i||{});var a=(e=>(e.Ascending="asc",e.Descending="desc",e.None="none",e))(a||{});var o=(e=>(e.Basic="basic",e.Gradient="gradient",e.Lcd="lcd",e))(o||{}),s=(e=>(e.Color="color",e.Hidden="hidden",e.Text="text",e))(s||{}),l=(e=>(e.Auto="auto",e.Hidden="hidden",e.Left="left",e.Top="top",e))(l||{}),u=(e=>(e.Auto="auto",e.Manual="manual",e))(u||{}),c=(e=>(e.Actions="actions",e.Auto="auto",e.BasicGauge="basic",e.ColorBackground="color-background",e.ColorBackgroundSolid="color-background-solid",e.ColorText="color-text",e.Custom="custom",e.DataLinks="data-links",e.Gauge="gauge",e.GradientGauge="gradient-gauge",e.Image="image",e.JSONView="json-view",e.LcdGauge="lcd-gauge",e.Sparkline="sparkline",e))(c||{});var d=(e=>(e.CSV="csv",e.Date="date",e.Distributed="distributed",e.DoubleQuote="doublequote",e.Glob="glob",e.HTML="html",e.JSON="json",e.Lucene="lucene",e.PercentEncode="percentencode",e.Pipe="pipe",e.QueryParam="queryparam",e.Raw="raw",e.Regex="regex",e.SQLString="sqlstring",e.SingleQuote="singlequote",e.Text="text",e.UriEncode="uriencode",e))(d||{})},7993:(e,t,r)=>{"use strict";r.d(t,{A:()=>p});const n=(e,t)=>e>t?1:ee.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o="eexxaacctt",s=/\p{P}/gu,l=["en",{numeric:!0,sensitivity:"base"}],u=(e,t,r)=>e.replace("A-Z",t).replace("a-z",r),c={unicode:!1,alpha:null,interSplit:"[^A-Za-z\\d']+",intraSplit:"[a-z][A-Z]",interBound:"[^A-Za-z\\d]",intraBound:"[A-Za-z]\\d|\\d[A-Za-z]|[a-z][A-Z]",interLft:0,interRgt:0,interChars:".",interIns:i,intraChars:"[a-z\\d']",intraIns:null,intraContr:"'[a-z]{1,2}\\b",intraMode:0,intraSlice:[1,i],intraSub:null,intraTrn:null,intraDel:null,intraFilt:(e,t,r)=>!0,toUpper:e=>e.toLocaleUpperCase(),toLower:e=>e.toLocaleLowerCase(),compare:null,sort:(e,t,r,i=n)=>{let{idx:a,chars:o,terms:s,interLft2:l,interLft1:u,start:c,intraIns:d,interIns:h,cases:p}=e;return a.map(((e,t)=>t)).sort(((e,r)=>o[r]-o[e]||d[e]-d[r]||s[r]+l[r]+.5*u[r]-(s[e]+l[e]+.5*u[e])||h[e]-h[r]||c[e]-c[r]||p[r]-p[e]||i(t[a[e]],t[a[r]])))}},d=(e,t)=>0==t?"":1==t?e+"??":t==i?e+"*?":e+`{0,${t}}?`,h="(?:\\b|_)";function p(e){e=Object.assign({},c,e);let{unicode:t,interLft:r,interRgt:i,intraMode:p,intraSlice:f,intraIns:g,intraSub:v,intraTrn:y,intraDel:b,intraContr:w,intraSplit:S,interSplit:x,intraBound:O,interBound:_,intraChars:E,toUpper:k,toLower:C,compare:T}=e;g??=p,v??=p,y??=p,b??=p,T??="undefined"==typeof Intl?n:new Intl.Collator(...l).compare;let A=e.letters??e.alpha;if(null!=A){let e=k(A),t=C(A);x=u(x,e,t),S=u(S,e,t),_=u(_,e,t),O=u(O,e,t),E=u(E,e,t),w=u(w,e,t)}let R=t?"u":"";const D='".+?"',P=new RegExp(D,"gi"+R),j=new RegExp(`(?:\\s+|^)-(?:${E}+|${D})`,"gi"+R);let{intraRules:I}=e;null==I&&(I=e=>{let t=c.intraSlice,r=0,n=0,i=0,a=0;if(/[^\d]/.test(e)){let o=e.length;o<=4?o>=3&&(i=Math.min(y,1),4==o&&(r=Math.min(g,1))):(t=f,r=g,n=v,i=y,a=b)}return{intraSlice:t,intraIns:r,intraSub:n,intraTrn:i,intraDel:a}});let L=!!S,M=new RegExp(S,"g"+R),N=new RegExp(x,"g"+R),F=new RegExp("^"+x+"|"+x+"$","g"+R),V=new RegExp(w,"gi"+R);const z=(e,t=!1)=>{let r=[];e=(e=e.replace(P,(e=>(r.push(e),o)))).replace(F,""),t||(e=C(e)),L&&(e=e.replace(M,(e=>e[0]+" "+e[1])));let n=0;return e.split(N).filter((e=>""!=e)).map((e=>e===o?r[n++]:e))},B=/[^\d]+|\d+/g,$=(t,n=0,o=!1)=>{let s=z(t);if(0==s.length)return[];let l,u=Array(s.length).fill("");if(s=s.map(((e,t)=>e.replace(V,(e=>(u[t]=e,""))))),1==p)l=s.map(((e,t)=>{if('"'===e[0])return a(e.slice(1,-1));let r="";for(let n of e.matchAll(B)){let e=n[0],{intraSlice:i,intraIns:a,intraSub:o,intraTrn:s,intraDel:l}=I(e);if(a+o+s+l==0)r+=e+u[t];else{let[n,c]=i,h=e.slice(0,n),p=e.slice(c),f=e.slice(n,c);1==a&&1==h.length&&h!=f[0]&&(h+="(?!"+h+")");let m=f.length,g=[e];if(o)for(let e=0;e0&&(e=")("+e+")("),l=s.map(((t,r)=>'"'===t[0]?a(t.slice(1,-1)):t.split("").map(((e,t,r)=>(1==g&&0==t&&r.length>1&&e!=r[t+1]&&(e+="(?!"+e+")"),e))).join(e)+u[r]))}let c=2==r?h:"",f=2==i?h:"",m=f+d(e.interChars,e.interIns)+c;return n>0?o?l=c+"("+l.join(")"+f+"|"+c+"(")+")"+f:(l="("+l.join(")("+m+")(")+")",l="(.??"+c+")"+l+"("+f+".*)"):(l=l.join(m),l=c+l+f),[new RegExp(l,"i"+R),s,u]},U=(e,t,r)=>{let[n]=$(t);if(null==n)return null;let i=[];if(null!=r)for(let t=0;t{let[o,s,l]=$(a,1),u=z(a,!0),[c]=$(a,2),d=s.length,h=Array(d),p=Array(d);for(let e=0;e=g){let e=C(l[n+1]).indexOf(o);e>-1&&(A.push(f,y,e,g),f+=Q(l,n,e,g),a=o,y=g,D=!0,0==t&&(u=f))}if(v||D){let e=f-1,c=f+y,d=!1,h=!1;if(-1==e||H.test(s[e]))D&&b++,d=!0;else{if(2==r){m=!0;break}if(q&&W.test(s[e]+s[e+1]))D&&w++,d=!0;else if(1==r){let e=l[n+1],r=f+y;if(e.length>=g){let i,c=0,h=!1,p=new RegExp(o,"ig"+R);for(;i=p.exec(e);){c=i.index;let e=r+c,t=e-1;if(-1==t||H.test(s[t])){b++,h=!0;break}if(W.test(s[t]+s[e])){w++,h=!0;break}}h&&(d=!0,A.push(f,y,c,g),f+=Q(l,n,c,g),a=o,y=g,D=!0,0==t&&(u=f))}if(!d){m=!0;break}}}if(c==s.length||H.test(s[c]))D&&S++,h=!0;else{if(2==i){m=!0;break}if(q&&W.test(s[c-1]+s[c]))D&&x++,h=!0;else if(1==i){m=!0;break}}D&&(O+=g,d&&h&&_++)}if(y>g&&(T+=y-g),t>0&&(k+=l[n-1].length),!e.intraFilt(o,a,f)){m=!0;break}t0?0:1/0,o=n-4;for(let t=2;t0&&(l.push(d,h),d=h=r)}h>d&&l.push(d,h),y++}}if(y{let i=e[t]+e[t+1].slice(0,r);return e[t-1]+=i,e[t]=e[t+1].slice(r,r+n),e[t+1]=e[t+1].slice(r+n),i.length};return{search:(...t)=>((t,r,n,i=1e3,o)=>{n=n?!0===n?5:n:0;let l=null,u=null,c=[];r=r.replace(j,(e=>{let t=e.trim().slice(1);return t='"'===t[0]?a(t.slice(1,-1)):t.replace(s,""),""!=t&&c.push(t),""}));let d,h=z(r);if(c.length>0){if(d=new RegExp(c.join("|"),"i"+R),0==h.length){let e=[];for(let r=0;r0){let e=z(r);if(e.length>1){let r=e.slice().sort(((e,t)=>t.length-e.length));for(let e=0;en)return[o,null,null];l=m(e).map((e=>e.join(" "))),u=[];let i=new Set;for(let e=0;e!i.has(e))),n=U(t,l[e],r);for(let e=0;e0?o:U(t,r)]);let p=null,f=null;if(c.length>0&&(u=u.map((e=>e.filter((e=>!d.test(t[e])))))),u.reduce(((e,t)=>e+t.length),0)<=i){p={},f=[];for(let r=0;r0)for(let e=0;e{let e={A:"ÁÀÃÂÄĄ",a:"áàãâäą",E:"ÉÈÊËĖ",e:"éèêëę",I:"ÍÌÎÏĮ",i:"íìîïį",O:"ÓÒÔÕÖ",o:"óòôõö",U:"ÚÙÛÜŪŲ",u:"úùûüūų",C:"ÇČĆ",c:"çčć",L:"Ł",l:"ł",N:"ÑŃ",n:"ñń",S:"ŠŚ",s:"šś",Z:"ŻŹ",z:"żź"},t=new Map,r="";for(let n in e)e[n].split("").forEach((e=>{r+=e,t.set(e,n)}));let n=new RegExp(`[${r}]`,"g"),i=e=>t.get(e);return e=>{if("string"==typeof e)return e.replace(n,i);let t=Array(e.length);for(let r=0;rt?`${e}`:e,v=(e,t)=>e+t;p.latinize=f,p.permute=e=>m([...Array(e.length).keys()]).sort(((e,t)=>{for(let r=0;rt.map((t=>e[t])))),p.highlight=function(e,t,r=g,n="",i=v){n=i(n,r(e.substring(0,t[0]),!1))??n;for(let a=0;a{"use strict";r.d(t,{w:()=>i});var n=r(5959);function i(e){const{ref:t,box:r,onResize:i}=e;(0,n.useEffect)((()=>{let e=null==t?void 0:t.current;if(e){if(void 0===window.ResizeObserver)return window.addEventListener("resize",i,!1),()=>{window.removeEventListener("resize",i,!1)};{const t=new window.ResizeObserver((e=>{e.length&&i()}));return t.observe(e,{box:r}),()=>{e&&t.unobserve(e)}}}}),[i,t,r])}},7528:(e,t,r)=>{"use strict";r.d(t,{m:()=>a});var n=r(7794),i=r(9106),a=new class extends n.Q{#e;#t;#r;constructor(){super(),this.#r=e=>{if(!i.S$&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e((e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()}))}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach((t=>{t(e)}))}isFocused(){return"boolean"==typeof this.#e?this.#e:"hidden"!==globalThis.document?.visibilityState}}},9304:(e,t,r)=>{"use strict";r.d(t,{$:()=>s,s:()=>o});var n=r(3403),i=r(8546),a=r(5610),o=class extends i.k{#n;#i;#a;constructor(e){super(),this.mutationId=e.mutationId,this.#i=e.mutationCache,this.#n=[],this.state=e.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#n.includes(e)||(this.#n.push(e),this.clearGcTimeout(),this.#i.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#n=this.#n.filter((t=>t!==e)),this.scheduleGc(),this.#i.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#n.length||("pending"===this.state.status?this.scheduleGc():this.#i.remove(this))}continue(){return this.#a?.continue()??this.execute(this.state.variables)}async execute(e){this.#a=(0,a.II)({fn:()=>this.options.mutationFn?this.options.mutationFn(e):Promise.reject(new Error("No mutationFn found")),onFail:(e,t)=>{this.#o({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#o({type:"pause"})},onContinue:()=>{this.#o({type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#i.canRun(this)});const t="pending"===this.state.status,r=!this.#a.canStart();try{if(!t){this.#o({type:"pending",variables:e,isPaused:r}),await(this.#i.config.onMutate?.(e,this));const t=await(this.options.onMutate?.(e));t!==this.state.context&&this.#o({type:"pending",context:t,variables:e,isPaused:r})}const n=await this.#a.start();return await(this.#i.config.onSuccess?.(n,e,this.state.context,this)),await(this.options.onSuccess?.(n,e,this.state.context)),await(this.#i.config.onSettled?.(n,null,this.state.variables,this.state.context,this)),await(this.options.onSettled?.(n,null,e,this.state.context)),this.#o({type:"success",data:n}),n}catch(t){try{throw await(this.#i.config.onError?.(t,e,this.state.context,this)),await(this.options.onError?.(t,e,this.state.context)),await(this.#i.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this)),await(this.options.onSettled?.(void 0,t,e,this.state.context)),t}finally{this.#o({type:"error",error:t})}}finally{this.#i.runNext(this)}}#o(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),n.j.batch((()=>{this.#n.forEach((t=>{t.onMutationUpdate(e)})),this.#i.notify({mutation:this,type:"updated",action:e})}))}};function s(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}},3403:(e,t,r)=>{"use strict";r.d(t,{j:()=>n});var n=function(){let e=[],t=0,r=e=>{e()},n=e=>{e()},i=e=>setTimeout(e,0);const a=n=>{t?e.push(n):i((()=>{r(n)}))},o=()=>{const t=e;e=[],t.length&&i((()=>{n((()=>{t.forEach((e=>{r(e)}))}))}))};return{batch:e=>{let r;t++;try{r=e()}finally{t--,t||o()}return r},batchCalls:e=>(...t)=>{a((()=>{e(...t)}))},schedule:a,setNotifyFunction:e=>{r=e},setBatchNotifyFunction:e=>{n=e},setScheduler:e=>{i=e}}}()},4841:(e,t,r)=>{"use strict";r.d(t,{t:()=>a});var n=r(7794),i=r(9106),a=new class extends n.Q{#s=!0;#t;#r;constructor(){super(),this.#r=e=>{if(!i.S$&&window.addEventListener){const t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#t||this.setEventListener(this.#r)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#r=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#s!==e&&(this.#s=e,this.listeners.forEach((t=>{t(e)})))}isOnline(){return this.#s}}},2015:(e,t,r)=>{"use strict";r.d(t,{X:()=>s,k:()=>l});var n=r(9106),i=r(3403),a=r(5610),o=r(8546),s=class extends o.k{#l;#u;#c;#a;#d;#h;constructor(e){super(),this.#h=!1,this.#d=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#c=e.cache,this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#l=e.state||function(e){const t="function"==typeof e.initialData?e.initialData():e.initialData,r=void 0!==t,n=r?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}(this.options),this.state=this.#l,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#a?.promise}setOptions(e){this.options={...this.#d,...e},this.updateGcTime(this.options.gcTime)}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#c.remove(this)}setData(e,t){const r=(0,n.pl)(this.state.data,e,this.options);return this.#o({data:r,type:"success",dataUpdatedAt:t?.updatedAt,manual:t?.manual}),r}setState(e,t){this.#o({type:"setState",state:e,setStateOptions:t})}cancel(e){const t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(n.lQ).catch(n.lQ):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#l)}isActive(){return this.observers.some((e=>!1!==(0,n.Eh)(e.options.enabled,this)))}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return!!this.state.isInvalidated||(this.getObserversCount()>0?this.observers.some((e=>e.getCurrentResult().isStale)):void 0===this.state.data)}isStaleByTime(e=0){return this.state.isInvalidated||void 0===this.state.data||!(0,n.j3)(this.state.dataUpdatedAt,e)}onFocus(){const e=this.observers.find((e=>e.shouldFetchOnWindowFocus()));e?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){const e=this.observers.find((e=>e.shouldFetchOnReconnect()));e?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#c.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter((t=>t!==e)),this.observers.length||(this.#a&&(this.#h?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#c.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#o({type:"invalidate"})}fetch(e,t){if("idle"!==this.state.fetchStatus)if(void 0!==this.state.data&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise;if(e&&this.setOptions(e),!this.options.queryFn){const e=this.observers.find((e=>e.options.queryFn));e&&this.setOptions(e.options)}const r=new AbortController,i=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#h=!0,r.signal)})},o={fetchOptions:t,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:()=>{const e=(0,n.ZM)(this.options,t),r={queryKey:this.queryKey,meta:this.meta};return i(r),this.#h=!1,this.options.persister?this.options.persister(e,r,this):e(r)}};i(o),this.options.behavior?.onFetch(o,this),this.#u=this.state,"idle"!==this.state.fetchStatus&&this.state.fetchMeta===o.fetchOptions?.meta||this.#o({type:"fetch",meta:o.fetchOptions?.meta});const s=e=>{(0,a.wm)(e)&&e.silent||this.#o({type:"error",error:e}),(0,a.wm)(e)||(this.#c.config.onError?.(e,this),this.#c.config.onSettled?.(this.state.data,e,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.#a=(0,a.II)({initialPromise:t?.initialPromise,fn:o.fetchFn,abort:r.abort.bind(r),onSuccess:e=>{void 0!==e?(this.setData(e),this.#c.config.onSuccess?.(e,this),this.#c.config.onSettled?.(e,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1):s(new Error(`${this.queryHash} data is undefined`))},onError:s,onFail:(e,t)=>{this.#o({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#o({type:"pause"})},onContinue:()=>{this.#o({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0}),this.#a.start()}#o(e){this.state=(t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...l(t.data,this.options),fetchMeta:e.meta??null};case"success":return{...t,data:e.data,dataUpdateCount:t.dataUpdateCount+1,dataUpdatedAt:e.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const r=e.error;return(0,a.wm)(r)&&r.revert&&this.#u?{...this.#u,fetchStatus:"idle"}:{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:"idle",status:"error"};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}})(this.state),i.j.batch((()=>{this.observers.forEach((e=>{e.onQueryUpdate()})),this.#c.notify({query:this,type:"updated",action:e})}))}};function l(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:(0,a.v_)(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}},9398:(e,t,r)=>{"use strict";r.d(t,{E:()=>g});var n=r(9106),i=r(2015),a=r(3403),o=r(7794),s=class extends o.Q{constructor(e={}){super(),this.config=e,this.#p=new Map}#p;build(e,t,r){const a=t.queryKey,o=t.queryHash??(0,n.F$)(a,t);let s=this.get(o);return s||(s=new i.X({cache:this,queryKey:a,queryHash:o,options:e.defaultQueryOptions(t),state:r,defaultOptions:e.getQueryDefaults(a)}),this.add(s)),s}add(e){this.#p.has(e.queryHash)||(this.#p.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=this.#p.get(e.queryHash);t&&(e.destroy(),t===e&&this.#p.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){a.j.batch((()=>{this.getAll().forEach((e=>{this.remove(e)}))}))}get(e){return this.#p.get(e)}getAll(){return[...this.#p.values()]}find(e){const t={exact:!0,...e};return this.getAll().find((e=>(0,n.MK)(t,e)))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter((t=>(0,n.MK)(e,t))):t}notify(e){a.j.batch((()=>{this.listeners.forEach((t=>{t(e)}))}))}onFocus(){a.j.batch((()=>{this.getAll().forEach((e=>{e.onFocus()}))}))}onOnline(){a.j.batch((()=>{this.getAll().forEach((e=>{e.onOnline()}))}))}},l=r(9304),u=class extends o.Q{constructor(e={}){super(),this.config=e,this.#f=new Map,this.#m=Date.now()}#f;#m;build(e,t,r){const n=new l.s({mutationCache:this,mutationId:++this.#m,options:e.defaultMutationOptions(t),state:r});return this.add(n),n}add(e){const t=c(e),r=this.#f.get(t)??[];r.push(e),this.#f.set(t,r),this.notify({type:"added",mutation:e})}remove(e){const t=c(e);if(this.#f.has(t)){const r=this.#f.get(t)?.filter((t=>t!==e));r&&(0===r.length?this.#f.delete(t):this.#f.set(t,r))}this.notify({type:"removed",mutation:e})}canRun(e){const t=this.#f.get(c(e))?.find((e=>"pending"===e.state.status));return!t||t===e}runNext(e){const t=this.#f.get(c(e))?.find((t=>t!==e&&t.state.isPaused));return t?.continue()??Promise.resolve()}clear(){a.j.batch((()=>{this.getAll().forEach((e=>{this.remove(e)}))}))}getAll(){return[...this.#f.values()].flat()}find(e){const t={exact:!0,...e};return this.getAll().find((e=>(0,n.nJ)(t,e)))}findAll(e={}){return this.getAll().filter((t=>(0,n.nJ)(e,t)))}notify(e){a.j.batch((()=>{this.listeners.forEach((t=>{t(e)}))}))}resumePausedMutations(){const e=this.getAll().filter((e=>e.state.isPaused));return a.j.batch((()=>Promise.all(e.map((e=>e.continue().catch(n.lQ))))))}};function c(e){return e.options.scope?.id??String(e.mutationId)}var d=r(7528),h=r(4841);function p(e){return{onFetch:(t,r)=>{const i=async()=>{const r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]};let l=!1;const u=(0,n.ZM)(t.options,t.fetchOptions),c=async(e,r,i)=>{if(l)return Promise.reject();if(null==r&&e.pages.length)return Promise.resolve(e);const a={queryKey:t.queryKey,pageParam:r,direction:i?"backward":"forward",meta:t.options.meta};var o;o=a,Object.defineProperty(o,"signal",{enumerable:!0,get:()=>(t.signal.aborted?l=!0:t.signal.addEventListener("abort",(()=>{l=!0})),t.signal)});const s=await u(a),{maxPages:c}=t.options,d=i?n.ZZ:n.y9;return{pages:d(e.pages,s,c),pageParams:d(e.pageParams,r,c)}};let d;if(i&&a.length){const e="backward"===i,t={pages:a,pageParams:o},n=(e?m:f)(r,t);d=await c(t,n,e)}else{d=await c(s,o[0]??r.initialPageParam);const t=e??a.length;for(let e=1;et.options.persister?.(i,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r):t.fetchFn=i}}}function f(e,{pages:t,pageParams:r}){const n=t.length-1;return e.getNextPageParam(t[n],t,r[n],r)}function m(e,{pages:t,pageParams:r}){return e.getPreviousPageParam?.(t[0],t,r[0],r)}var g=class{#g;#i;#d;#v;#y;#b;#w;#S;constructor(e={}){this.#g=e.queryCache||new s,this.#i=e.mutationCache||new u,this.#d=e.defaultOptions||{},this.#v=new Map,this.#y=new Map,this.#b=0}mount(){this.#b++,1===this.#b&&(this.#w=d.m.subscribe((async e=>{e&&(await this.resumePausedMutations(),this.#g.onFocus())})),this.#S=h.t.subscribe((async e=>{e&&(await this.resumePausedMutations(),this.#g.onOnline())})))}unmount(){this.#b--,0===this.#b&&(this.#w?.(),this.#w=void 0,this.#S?.(),this.#S=void 0)}isFetching(e){return this.#g.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#i.findAll({...e,status:"pending"}).length}getQueryData(e){const t=this.defaultQueryOptions({queryKey:e});return this.#g.get(t.queryHash)?.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);if(void 0===t)return this.fetchQuery(e);{const r=this.defaultQueryOptions(e),i=this.#g.build(this,r);return e.revalidateIfStale&&i.isStaleByTime((0,n.d2)(r.staleTime,i))&&this.prefetchQuery(r),Promise.resolve(t)}}getQueriesData(e){return this.#g.findAll(e).map((({queryKey:e,state:t})=>[e,t.data]))}setQueryData(e,t,r){const i=this.defaultQueryOptions({queryKey:e}),a=this.#g.get(i.queryHash),o=a?.state.data,s=(0,n.Zw)(t,o);if(void 0!==s)return this.#g.build(this,i).setData(s,{...r,manual:!0})}setQueriesData(e,t,r){return a.j.batch((()=>this.#g.findAll(e).map((({queryKey:e})=>[e,this.setQueryData(e,t,r)]))))}getQueryState(e){const t=this.defaultQueryOptions({queryKey:e});return this.#g.get(t.queryHash)?.state}removeQueries(e){const t=this.#g;a.j.batch((()=>{t.findAll(e).forEach((e=>{t.remove(e)}))}))}resetQueries(e,t){const r=this.#g,n={type:"active",...e};return a.j.batch((()=>(r.findAll(e).forEach((e=>{e.reset()})),this.refetchQueries(n,t))))}cancelQueries(e={},t={}){const r={revert:!0,...t},i=a.j.batch((()=>this.#g.findAll(e).map((e=>e.cancel(r)))));return Promise.all(i).then(n.lQ).catch(n.lQ)}invalidateQueries(e={},t={}){return a.j.batch((()=>{if(this.#g.findAll(e).forEach((e=>{e.invalidate()})),"none"===e.refetchType)return Promise.resolve();const r={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(r,t)}))}refetchQueries(e={},t){const r={...t,cancelRefetch:t?.cancelRefetch??!0},i=a.j.batch((()=>this.#g.findAll(e).filter((e=>!e.isDisabled())).map((e=>{let t=e.fetch(void 0,r);return r.throwOnError||(t=t.catch(n.lQ)),"paused"===e.state.fetchStatus?Promise.resolve():t}))));return Promise.all(i).then(n.lQ)}fetchQuery(e){const t=this.defaultQueryOptions(e);void 0===t.retry&&(t.retry=!1);const r=this.#g.build(this,t);return r.isStaleByTime((0,n.d2)(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(n.lQ).catch(n.lQ)}fetchInfiniteQuery(e){return e.behavior=p(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(n.lQ).catch(n.lQ)}resumePausedMutations(){return h.t.isOnline()?this.#i.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#g}getMutationCache(){return this.#i}getDefaultOptions(){return this.#d}setDefaultOptions(e){this.#d=e}setQueryDefaults(e,t){this.#v.set((0,n.EN)(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...this.#v.values()];let r={};return t.forEach((t=>{(0,n.Cp)(e,t.queryKey)&&(r={...r,...t.defaultOptions})})),r}setMutationDefaults(e,t){this.#y.set((0,n.EN)(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...this.#y.values()];let r={};return t.forEach((t=>{(0,n.Cp)(e,t.mutationKey)&&(r={...r,...t.defaultOptions})})),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...this.#d.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=(0,n.F$)(t.queryKey,t)),void 0===t.refetchOnReconnect&&(t.refetchOnReconnect="always"!==t.networkMode),void 0===t.throwOnError&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),!0!==t.enabled&&t.queryFn===n.hT&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#d.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#g.clear(),this.#i.clear()}}},8546:(e,t,r)=>{"use strict";r.d(t,{k:()=>i});var n=r(9106),i=class{#x;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,n.gn)(this.gcTime)&&(this.#x=setTimeout((()=>{this.optionalRemove()}),this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(n.S$?1/0:3e5))}clearGcTimeout(){this.#x&&(clearTimeout(this.#x),this.#x=void 0)}}},5610:(e,t,r)=>{"use strict";r.d(t,{II:()=>c,v_:()=>s,wm:()=>u});var n=r(7528),i=r(4841),a=r(9106);function o(e){return Math.min(1e3*2**e,3e4)}function s(e){return"online"!==(e??"online")||i.t.isOnline()}var l=class{constructor(e){this.revert=e?.revert,this.silent=e?.silent}};function u(e){return e instanceof l}function c(e){let t,r,u,c=!1,d=0,h=!1;const p=new Promise(((e,t)=>{r=e,u=t})),f=()=>n.m.isFocused()&&("always"===e.networkMode||i.t.isOnline())&&e.canRun(),m=()=>s(e.networkMode)&&e.canRun(),g=n=>{h||(h=!0,e.onSuccess?.(n),t?.(),r(n))},v=r=>{h||(h=!0,e.onError?.(r),t?.(),u(r))},y=()=>new Promise((r=>{t=e=>{(h||f())&&r(e)},e.onPause?.()})).then((()=>{t=void 0,h||e.onContinue?.()})),b=()=>{if(h)return;let t;const r=0===d?e.initialPromise:void 0;try{t=r??e.fn()}catch(e){t=Promise.reject(e)}Promise.resolve(t).then(g).catch((t=>{if(h)return;const r=e.retry??(a.S$?0:3),n=e.retryDelay??o,i="function"==typeof n?n(d,t):n,s=!0===r||"number"==typeof r&&df()?void 0:y())).then((()=>{c?v(t):b()}))):v(t)}))};return{promise:p,cancel:t=>{h||(v(new l(t)),e.abort?.())},continue:()=>(t?.(),p),cancelRetry:()=>{c=!0},continueRetry:()=>{c=!1},canStart:m,start:()=>(m()?b():y().then(b),p)}}},7794:(e,t,r)=>{"use strict";r.d(t,{Q:()=>n});var n=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}},9106:(e,t,r)=>{"use strict";r.d(t,{Cp:()=>f,EN:()=>p,Eh:()=>u,F$:()=>h,MK:()=>c,S$:()=>n,ZM:()=>E,ZZ:()=>O,Zw:()=>a,d2:()=>l,f8:()=>g,gn:()=>o,hT:()=>_,j3:()=>s,lQ:()=>i,nJ:()=>d,pl:()=>S,y9:()=>x,yy:()=>w});var n="undefined"==typeof window||"Deno"in globalThis;function i(){}function a(e,t){return"function"==typeof e?e(t):e}function o(e){return"number"==typeof e&&e>=0&&e!==1/0}function s(e,t){return Math.max(e+(t||0)-Date.now(),0)}function l(e,t){return"function"==typeof e?e(t):e}function u(e,t){return"function"==typeof e?e(t):e}function c(e,t){const{type:r="all",exact:n,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o)if(n){if(t.queryHash!==h(o,t.options))return!1}else if(!f(t.queryKey,o))return!1;if("all"!==r){const e=t.isActive();if("active"===r&&!e)return!1;if("inactive"===r&&e)return!1}return("boolean"!=typeof s||t.isStale()===s)&&((!i||i===t.state.fetchStatus)&&!(a&&!a(t)))}function d(e,t){const{exact:r,status:n,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(r){if(p(t.options.mutationKey)!==p(a))return!1}else if(!f(t.options.mutationKey,a))return!1}return(!n||t.state.status===n)&&!(i&&!i(t))}function h(e,t){return(t?.queryKeyHashFn||p)(e)}function p(e){return JSON.stringify(e,((e,t)=>y(t)?Object.keys(t).sort().reduce(((e,r)=>(e[r]=t[r],e)),{}):t))}function f(e,t){return e===t||typeof e==typeof t&&(!(!e||!t||"object"!=typeof e||"object"!=typeof t)&&!Object.keys(t).some((r=>!f(e[r],t[r]))))}function m(e,t){if(e===t)return e;const r=v(e)&&v(t);if(r||y(e)&&y(t)){const n=r?e:Object.keys(e),i=n.length,a=r?t:Object.keys(t),o=a.length,s=r?[]:{};let l=0;for(let i=0;i{setTimeout(t,e)}))}function S(e,t,r){return"function"==typeof r.structuralSharing?r.structuralSharing(e,t):!1!==r.structuralSharing?m(e,t):t}function x(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function O(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var _=Symbol(),E=(e,t)=>!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==_?e.queryFn:()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`))},3715:(e,t,r)=>{"use strict";r.d(t,{Ht:()=>s,jE:()=>o});var n=r(5959),i=r(2540),a=n.createContext(void 0),o=e=>{const t=n.useContext(a);if(e)return e;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},s=({client:e,children:t})=>(n.useEffect((()=>(e.mount(),()=>{e.unmount()})),[e]),(0,i.jsx)(a.Provider,{value:e,children:t}))},6667:(e,t,r)=>{"use strict";r.d(t,{n:()=>d});var n=r(5959),i=r(9304),a=r(3403),o=r(7794),s=r(9106),l=class extends o.Q{#O;#_=void 0;#E;#k;constructor(e,t){super(),this.#O=e,this.setOptions(t),this.bindMethods(),this.#C()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){const t=this.options;this.options=this.#O.defaultMutationOptions(e),(0,s.f8)(this.options,t)||this.#O.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#E,observer:this}),t?.mutationKey&&this.options.mutationKey&&(0,s.EN)(t.mutationKey)!==(0,s.EN)(this.options.mutationKey)?this.reset():"pending"===this.#E?.state.status&&this.#E.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#E?.removeObserver(this)}onMutationUpdate(e){this.#C(),this.#T(e)}getCurrentResult(){return this.#_}reset(){this.#E?.removeObserver(this),this.#E=void 0,this.#C(),this.#T()}mutate(e,t){return this.#k=t,this.#E?.removeObserver(this),this.#E=this.#O.getMutationCache().build(this.#O,this.options),this.#E.addObserver(this),this.#E.execute(e)}#C(){const e=this.#E?.state??(0,i.$)();this.#_={...e,isPending:"pending"===e.status,isSuccess:"success"===e.status,isError:"error"===e.status,isIdle:"idle"===e.status,mutate:this.mutate,reset:this.reset}}#T(e){a.j.batch((()=>{if(this.#k&&this.hasListeners()){const t=this.#_.variables,r=this.#_.context;"success"===e?.type?(this.#k.onSuccess?.(e.data,t,r),this.#k.onSettled?.(e.data,null,t,r)):"error"===e?.type&&(this.#k.onError?.(e.error,t,r),this.#k.onSettled?.(void 0,e.error,t,r))}this.listeners.forEach((e=>{e(this.#_)}))}))}},u=r(3715),c=r(908);function d(e,t){const r=(0,u.jE)(t),[i]=n.useState((()=>new l(r,e)));n.useEffect((()=>{i.setOptions(e)}),[i,e]);const o=n.useSyncExternalStore(n.useCallback((e=>i.subscribe(a.j.batchCalls(e))),[i]),(()=>i.getCurrentResult()),(()=>i.getCurrentResult())),s=n.useCallback(((e,t)=>{i.mutate(e,t).catch(c.l)}),[i]);if(o.error&&(0,c.G)(i.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:s,mutateAsync:o.mutate}}},7616:(e,t,r)=>{"use strict";r.d(t,{I:()=>C});var n=r(9106),i=r(3403),a=r(7528),o=r(7794),s=r(2015),l=class extends o.Q{constructor(e,t){super(),this.options=t,this.#O=e,this.#A=null,this.bindMethods(),this.setOptions(t)}#O;#R=void 0;#D=void 0;#_=void 0;#P;#j;#A;#I;#L;#M;#N;#F;#V;#z=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#R.addObserver(this),u(this.#R,this.options)?this.#B():this.updateResult(),this.#$())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return c(this.#R,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return c(this.#R,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#U(),this.#q(),this.#R.removeObserver(this)}setOptions(e,t){const r=this.options,i=this.#R;if(this.options=this.#O.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof(0,n.Eh)(this.options.enabled,this.#R))throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#H(),this.#R.setOptions(this.options),r._defaulted&&!(0,n.f8)(this.options,r)&&this.#O.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#R,observer:this});const a=this.hasListeners();a&&d(this.#R,i,this.options,r)&&this.#B(),this.updateResult(t),!a||this.#R===i&&(0,n.Eh)(this.options.enabled,this.#R)===(0,n.Eh)(r.enabled,this.#R)&&(0,n.d2)(this.options.staleTime,this.#R)===(0,n.d2)(r.staleTime,this.#R)||this.#W();const o=this.#G();!a||this.#R===i&&(0,n.Eh)(this.options.enabled,this.#R)===(0,n.Eh)(r.enabled,this.#R)&&o===this.#V||this.#Q(o)}getOptimisticResult(e){const t=this.#O.getQueryCache().build(this.#O,e),r=this.createResult(t,e);return function(e,t){if(!(0,n.f8)(e.getCurrentResult(),t))return!0;return!1}(this,r)&&(this.#_=r,this.#j=this.options,this.#P=this.#R.state),r}getCurrentResult(){return this.#_}trackResult(e,t){const r={};return Object.keys(e).forEach((n=>{Object.defineProperty(r,n,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(n),t?.(n),e[n])})})),r}trackProp(e){this.#z.add(e)}getCurrentQuery(){return this.#R}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=this.#O.defaultQueryOptions(e),r=this.#O.getQueryCache().build(this.#O,t);return r.isFetchingOptimistic=!0,r.fetch().then((()=>this.createResult(r,t)))}fetch(e){return this.#B({...e,cancelRefetch:e.cancelRefetch??!0}).then((()=>(this.updateResult(),this.#_)))}#B(e){this.#H();let t=this.#R.fetch(this.options,e);return e?.throwOnError||(t=t.catch(n.lQ)),t}#W(){this.#U();const e=(0,n.d2)(this.options.staleTime,this.#R);if(n.S$||this.#_.isStale||!(0,n.gn)(e))return;const t=(0,n.j3)(this.#_.dataUpdatedAt,e)+1;this.#N=setTimeout((()=>{this.#_.isStale||this.updateResult()}),t)}#G(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#R):this.options.refetchInterval)??!1}#Q(e){this.#q(),this.#V=e,!n.S$&&!1!==(0,n.Eh)(this.options.enabled,this.#R)&&(0,n.gn)(this.#V)&&0!==this.#V&&(this.#F=setInterval((()=>{(this.options.refetchIntervalInBackground||a.m.isFocused())&&this.#B()}),this.#V))}#$(){this.#W(),this.#Q(this.#G())}#U(){this.#N&&(clearTimeout(this.#N),this.#N=void 0)}#q(){this.#F&&(clearInterval(this.#F),this.#F=void 0)}createResult(e,t){const r=this.#R,i=this.options,a=this.#_,o=this.#P,l=this.#j,c=e!==r?e.state:this.#D,{state:p}=e;let f,m={...p},g=!1;if(t._optimisticResults){const n=this.hasListeners(),a=!n&&u(e,t),o=n&&d(e,r,t,i);(a||o)&&(m={...m,...(0,s.k)(p.data,e.options)}),"isRestoring"===t._optimisticResults&&(m.fetchStatus="idle")}let{error:v,errorUpdatedAt:y,status:b}=m;if(t.select&&void 0!==m.data)if(a&&m.data===o?.data&&t.select===this.#I)f=this.#L;else try{this.#I=t.select,f=t.select(m.data),f=(0,n.pl)(a?.data,f,t),this.#L=f,this.#A=null}catch(e){this.#A=e}else f=m.data;if(void 0!==t.placeholderData&&void 0===f&&"pending"===b){let e;if(a?.isPlaceholderData&&t.placeholderData===l?.placeholderData)e=a.data;else if(e="function"==typeof t.placeholderData?t.placeholderData(this.#M?.state.data,this.#M):t.placeholderData,t.select&&void 0!==e)try{e=t.select(e),this.#A=null}catch(e){this.#A=e}void 0!==e&&(b="success",f=(0,n.pl)(a?.data,e,t),g=!0)}this.#A&&(v=this.#A,f=this.#L,y=Date.now(),b="error");const w="fetching"===m.fetchStatus,S="pending"===b,x="error"===b,O=S&&w,_=void 0!==f;return{status:b,fetchStatus:m.fetchStatus,isPending:S,isSuccess:"success"===b,isError:x,isInitialLoading:O,isLoading:O,data:f,dataUpdatedAt:m.dataUpdatedAt,error:v,errorUpdatedAt:y,failureCount:m.fetchFailureCount,failureReason:m.fetchFailureReason,errorUpdateCount:m.errorUpdateCount,isFetched:m.dataUpdateCount>0||m.errorUpdateCount>0,isFetchedAfterMount:m.dataUpdateCount>c.dataUpdateCount||m.errorUpdateCount>c.errorUpdateCount,isFetching:w,isRefetching:w&&!S,isLoadingError:x&&!_,isPaused:"paused"===m.fetchStatus,isPlaceholderData:g,isRefetchError:x&&_,isStale:h(e,t),refetch:this.refetch}}updateResult(e){const t=this.#_,r=this.createResult(this.#R,this.options);if(this.#P=this.#R.state,this.#j=this.options,void 0!==this.#P.data&&(this.#M=this.#R),(0,n.f8)(r,t))return;this.#_=r;const i={};!1!==e?.listeners&&(()=>{if(!t)return!0;const{notifyOnChangeProps:e}=this.options,r="function"==typeof e?e():e;if("all"===r||!r&&!this.#z.size)return!0;const n=new Set(r??this.#z);return this.options.throwOnError&&n.add("error"),Object.keys(this.#_).some((e=>{const r=e;return this.#_[r]!==t[r]&&n.has(r)}))})()&&(i.listeners=!0),this.#T({...i,...e})}#H(){const e=this.#O.getQueryCache().build(this.#O,this.options);if(e===this.#R)return;const t=this.#R;this.#R=e,this.#D=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#$()}#T(e){i.j.batch((()=>{e.listeners&&this.listeners.forEach((e=>{e(this.#_)})),this.#O.getQueryCache().notify({query:this.#R,type:"observerResultsUpdated"})}))}};function u(e,t){return function(e,t){return!1!==(0,n.Eh)(t.enabled,e)&&void 0===e.state.data&&!("error"===e.state.status&&!1===t.retryOnMount)}(e,t)||void 0!==e.state.data&&c(e,t,t.refetchOnMount)}function c(e,t,r){if(!1!==(0,n.Eh)(t.enabled,e)){const n="function"==typeof r?r(e):r;return"always"===n||!1!==n&&h(e,t)}return!1}function d(e,t,r,i){return(e!==t||!1===(0,n.Eh)(i.enabled,e))&&(!r.suspense||"error"!==e.state.status)&&h(e,r)}function h(e,t){return!1!==(0,n.Eh)(t.enabled,e)&&e.isStaleByTime((0,n.d2)(t.staleTime,e))}var p=r(5959);r(2540);function f(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var m=p.createContext(f()),g=()=>p.useContext(m),v=r(3715),y=p.createContext(!1),b=()=>p.useContext(y),w=(y.Provider,r(908)),S=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},x=e=>{p.useEffect((()=>{e.clearReset()}),[e])},O=({result:e,errorResetBoundary:t,throwOnError:r,query:n})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(0,w.G)(r,[e.error,n]),_=e=>{e.suspense&&"number"!=typeof e.staleTime&&(e.staleTime=1e3)},E=(e,t)=>e?.suspense&&t.isPending,k=(e,t,r)=>t.fetchOptimistic(e).catch((()=>{r.clearReset()}));function C(e,t){return function(e,t,r){const n=(0,v.jE)(r),a=b(),o=g(),s=n.defaultQueryOptions(e);n.getDefaultOptions().queries?._experimental_beforeQuery?.(s),s._optimisticResults=a?"isRestoring":"optimistic",_(s),S(s,o),x(o);const[l]=p.useState((()=>new t(n,s))),u=l.getOptimisticResult(s);if(p.useSyncExternalStore(p.useCallback((e=>{const t=a?()=>{}:l.subscribe(i.j.batchCalls(e));return l.updateResult(),t}),[l,a]),(()=>l.getCurrentResult()),(()=>l.getCurrentResult())),p.useEffect((()=>{l.setOptions(s,{listeners:!1})}),[s,l]),E(s,u))throw k(s,l,o);if(O({result:u,errorResetBoundary:o,throwOnError:s.throwOnError,query:n.getQueryCache().get(s.queryHash)}))throw u.error;return n.getDefaultOptions().queries?._experimental_afterQuery?.(s,u),s.notifyOnChangeProps?u:l.trackResult(u)}(e,l,t)}},908:(e,t,r)=>{"use strict";function n(e,t){return"function"==typeof e?e(...t):!!e}function i(){}r.d(t,{G:()=>n,l:()=>i})},8727:()=>{"use strict";var e={},t=Uint8Array,r=Uint16Array,n=Int32Array,i=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),a=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),o=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=function(e,t){for(var i=new r(31),a=0;a<31;++a)i[a]=t+=1<>1|(21845&m)<<1;g=(61680&(g=(52428&g)>>2|(13107&g)<<2))>>4|(3855&g)<<4,f[m]=((65280&g)>>8|(255&g)<<8)>>1}var v=function(e,t,n){for(var i=e.length,a=0,o=new r(t);a>u]=c}else for(s=new r(i),a=0;a>15-e[a]);return s},y=new t(288);for(m=0;m<144;++m)y[m]=8;for(m=144;m<256;++m)y[m]=9;for(m=256;m<280;++m)y[m]=7;for(m=280;m<288;++m)y[m]=8;var b=new t(32);for(m=0;m<32;++m)b[m]=5;var w=v(y,9,0),S=v(y,9,1),x=v(b,5,0),O=v(b,5,1),_=function(e){for(var t=e[0],r=1;rt&&(t=e[r]);return t},E=function(e,t,r){var n=t/8|0;return(e[n]|e[n+1]<<8)>>(7&t)&r},k=function(e,t){var r=t/8|0;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>(7&t)},C=function(e){return(e+7)/8|0},T=function(e,r,n){return(null==r||r<0)&&(r=0),(null==n||n>e.length)&&(n=e.length),new t(e.subarray(r,n))},A=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],R=function(e,t,r){var n=new Error(t||A[e]);if(n.code=e,Error.captureStackTrace&&Error.captureStackTrace(n,R),!r)throw n;return n},D=function(e,r,n,s){var l=e.length,c=s?s.length:0;if(!l||r.f&&!r.l)return n||new t(0);var d=!n,p=d||2!=r.i,f=r.i;d&&(n=new t(3*l));var m=function(e){var r=n.length;if(e>r){var i=new t(Math.max(2*r,e));i.set(n),n=i}},g=r.f||0,y=r.p||0,b=r.b||0,w=r.l,x=r.d,A=r.m,D=r.n,P=8*l;do{if(!w){g=E(e,y,1);var j=E(e,y+1,3);if(y+=3,!j){var I=e[(H=C(y)+4)-4]|e[H-3]<<8,L=H+I;if(L>l){f&&R(0);break}p&&m(b+I),n.set(e.subarray(H,L),b),r.b=b+=I,r.p=y=8*L,r.f=g;continue}if(1==j)w=S,x=O,A=9,D=5;else if(2==j){var M=E(e,y,31)+257,N=E(e,y+10,15)+4,F=M+E(e,y+5,31)+1;y+=14;for(var V=new t(F),z=new t(19),B=0;B>4)<16)V[B++]=H;else{var G=0,Q=0;for(16==H?(Q=3+E(e,y,3),y+=2,G=V[B-1]):17==H?(Q=3+E(e,y,7),y+=3):18==H&&(Q=11+E(e,y,127),y+=7);Q--;)V[B++]=G}}var K=V.subarray(0,M),X=V.subarray(M);A=_(K),D=_(X),w=v(K,A,1),x=v(X,D,1)}else R(1);if(y>P){f&&R(0);break}}p&&m(b+131072);for(var J=(1<>4;if((y+=15&G)>P){f&&R(0);break}if(G||R(2),ee<256)n[b++]=ee;else{if(256==ee){Z=y,w=null;break}var te=ee-254;if(ee>264){var re=i[B=ee-257];te=E(e,y,(1<>4;ne||R(3),y+=15≠X=h[ie];if(ie>3){re=a[ie];X+=k(e,y)&(1<P){f&&R(0);break}p&&m(b+131072);var ae=b+te;if(b>8},j=function(e,t,r){r<<=7&t;var n=t/8|0;e[n]|=r,e[n+1]|=r>>8,e[n+2]|=r>>16},I=function(e,n){for(var i=[],a=0;af&&(f=s[a].s);var m=new r(f+1),g=L(i[h-1],m,0);if(g>n){a=0;var v=0,y=g-n,b=1<n))break;v+=b-(1<>=y;v>0;){var S=s[a].s;m[S]=0&&v;--a){var x=s[a].s;m[x]==n&&(--m[x],++v)}g=n}return{t:new t(m),l:g}},L=function(e,t,r){return-1==e.s?Math.max(L(e.l,t,r+1),L(e.r,t,r+1)):t[e.s]=r},M=function(e){for(var t=e.length;t&&!e[--t];);for(var n=new r(++t),i=0,a=e[0],o=1,s=function(e){n[i++]=e},l=1;l<=t;++l)if(e[l]==a&&l!=t)++o;else{if(!a&&o>2){for(;o>138;o-=138)s(32754);o>2&&(s(o>10?o-11<<5|28690:o-3<<5|12305),o=0)}else if(o>3){for(s(a),--o;o>6;o-=6)s(8304);o>2&&(s(o-3<<5|8208),o=0)}for(;o--;)s(a);o=1,a=e[l]}return{c:n.subarray(0,i),n:t}},N=function(e,t){for(var r=0,n=0;n>8,e[i+2]=255^e[i],e[i+3]=255^e[i+1];for(var a=0;a4&&!B[o[U-1]];--U);var q,H,W,G,Q=p+5<<3,K=N(l,y)+N(u,b)+c,X=N(l,g)+N(u,_)+c+14+3*U+N(L,B)+2*L[16]+3*L[17]+7*L[18];if(h>=0&&Q<=K&&Q<=X)return F(t,f,e.subarray(h,h+p));if(P(t,f,1+(X15&&(P(t,f,ee[V]>>5&127),f+=ee[V]>>12)}}}else q=w,H=y,W=x,G=b;for(V=0;V255){j(t,f,q[(te=re>>18&31)+257]),f+=H[te+257],te>7&&(P(t,f,re>>23&31),f+=i[te]);var ne=31&re;j(t,f,W[ne]),f+=G[ne],ne>3&&(j(t,f,re>>5&8191),f+=a[ne])}else j(t,f,q[re]),f+=H[re]}return j(t,f,q[256]),f+H[256]},z=new n([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),B=new t(0),$=function(e,o,s,l,u,d){var h=d.z||e.length,f=new t(l+h+5*(1+Math.ceil(h/7e3))+u),m=f.subarray(l,f.length-u),g=d.l,v=7&(d.r||0);if(o){v&&(m[0]=d.r>>3);for(var y=z[o-1],b=y>>13,w=8191&y,S=(1<7e3||L>24576)&&(q>423||!g)){v=V(e,m,0,A,R,D,j,L,N,I-N,v),L=P=j=0,N=I;for(var H=0;H<286;++H)R[H]=0;for(H=0;H<30;++H)D[H]=0}var W=2,G=0,Q=w,K=$-U&32767;if(q>2&&B==k(I-K))for(var X=Math.min(b,q)-1,J=Math.min(32767,I),Y=Math.min(258,q);K<=J&&--Q&&$!=U;){if(e[I+W]==e[I+W-K]){for(var Z=0;ZW){if(W=Z,G=K,Z>X)break;var ee=Math.min(K,Z-2),te=0;for(H=0;Hte&&(te=ne,U=re)}}}K+=($=U)-(U=x[$])&32767}if(G){A[L++]=268435456|c[W]<<18|p[G];var ie=31&c[W],ae=31&p[G];j+=i[ie]+a[ae],++R[257+ie],++D[ae],M=I+W,++P}else A[L++]=e[I],++R[e[I]]}}for(I=Math.max(I,M);I=h&&(m[v/8|0]=g,oe=h),v=F(m,v+1,e.subarray(I,oe))}d.i=h}return T(f,0,l+C(v)+u)},U=function(){for(var e=new Int32Array(256),t=0;t<256;++t){for(var r=t,n=9;--n;)r=(1&r&&-306674912)^r>>>1;e[t]=r}return e}(),q=function(){var e=-1;return{p:function(t){for(var r=e,n=0;n>>8;e=r},d:function(){return~e}}},H=function(){var e=1,t=0;return{p:function(r){for(var n=e,i=t,a=0|r.length,o=0;o!=a;){for(var s=Math.min(o+2655,a);o>16),i=(65535&i)+15*(i>>16)}e=n,t=i},d:function(){return(255&(e%=65521))<<24|(65280&e)<<8|(255&(t%=65521))<<8|t>>8}}},W=function(e,r,n,i,a){if(!a&&(a={l:1},r.dictionary)){var o=r.dictionary.subarray(-32768),s=new t(o.length+e.length);s.set(o),s.set(e,o.length),e=s,a.w=o.length}return $(e,null==r.level?6:r.level,null==r.mem?a.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(e.length)))):20:12+r.mem,n,i,a)},G=function(e,t){var r={};for(var n in e)r[n]=e[n];for(var n in t)r[n]=t[n];return r},Q=function(e,t,r){for(var n=e(),i=e.toString(),a=i.slice(i.indexOf("[")+1,i.lastIndexOf("]")).replace(/\s+/g,"").split(","),o=0;o>>=8},le=function(e,t){var r=t.filename;if(e[0]=31,e[1]=139,e[2]=8,e[8]=t.level<2?4:9==t.level?2:0,e[9]=3,0!=t.mtime&&se(e,4,Math.floor(new Date(t.mtime||Date.now())/1e3)),r){e[3]=8;for(var n=0;n<=r.length;++n)e[n+10]=r.charCodeAt(n)}},ue=function(e){31==e[0]&&139==e[1]&&8==e[2]||R(6,"invalid gzip data");var t=e[3],r=10;4&t&&(r+=2+(e[10]|e[11]<<8));for(var n=(t>>3&1)+(t>>4&1);n>0;n-=!e[r++]);return r+(2&t)},ce=function(e){var t=e.length;return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0},de=function(e){return 10+(e.filename?e.filename.length+1:0)},he=function(e,t){var r=t.level,n=0==r?0:r<6?1:9==r?3:2;if(e[0]=120,e[1]=n<<6|(t.dictionary&&32),e[1]|=31-(e[0]<<8|e[1])%31,t.dictionary){var i=H();i.p(t.dictionary),se(e,2,i.d())}},pe=function(e,t){return(8!=(15&e[0])||e[0]>>4>7||(e[0]<<8|e[1])%31)&&R(6,"invalid zlib data"),(e[1]>>5&1)==+!t&&R(6,"invalid zlib data: "+(32&e[1]?"need":"unexpected")+" dictionary"),2+(e[1]>>3&4)};function fe(e,t){return"function"==typeof e&&(t=e,e={}),this.ondata=t,e}var me=function(){function e(e,r){if("function"==typeof e&&(r=e,e={}),this.ondata=r,this.o=e||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new t(98304),this.o.dictionary){var n=this.o.dictionary.subarray(-32768);this.b.set(n,32768-n.length),this.s.i=32768-n.length}}return e.prototype.p=function(e,t){this.ondata(W(e,this.o,0,0,this.s),t)},e.prototype.push=function(e,r){this.ondata||R(5),this.s.l&&R(4);var n=e.length+this.s.z;if(n>this.b.length){if(n>2*this.b.length-32768){var i=new t(-32768&n);i.set(this.b.subarray(0,this.s.z)),this.b=i}var a=this.b.length-this.s.z;this.b.set(e.subarray(0,a),this.s.z),this.s.z=this.b.length,this.p(this.b,!1),this.b.set(this.b.subarray(-32768)),this.b.set(e.subarray(a),32768),this.s.z=e.length-a+32768,this.s.i=32766,this.s.w=32768}else this.b.set(e,this.s.z),this.s.z+=e.length;this.s.l=1&r,(this.s.z>this.s.w+8191||r)&&(this.p(this.b,r||!1),this.s.w=this.s.i,this.s.i-=2)},e.prototype.flush=function(){this.ondata||R(5),this.s.l&&R(4),this.p(this.b,!1),this.s.w=this.s.i,this.s.i-=2},e}(),ge=function(){return function(e,t){oe([Y,function(){return[ae,me]}],this,fe.call(this,e,t),(function(e){var t=new me(e.data);onmessage=ae(t)}),6,1)}}();function ve(e,t){return W(e,t||{},0,0)}var ye=function(){function e(e,r){"function"==typeof e&&(r=e,e={}),this.ondata=r;var n=e&&e.dictionary&&e.dictionary.subarray(-32768);this.s={i:0,b:n?n.length:0},this.o=new t(32768),this.p=new t(0),n&&this.o.set(n)}return e.prototype.e=function(e){if(this.ondata||R(5),this.d&&R(4),this.p.length){if(e.length){var r=new t(this.p.length+e.length);r.set(this.p),r.set(e,this.p.length),this.p=r}}else this.p=e},e.prototype.c=function(e){this.s.i=+(this.d=e||!1);var t=this.s.b,r=D(this.p,this.s,this.o);this.ondata(T(r,t,this.s.b),this.d),this.o=T(r,this.s.b-32768),this.s.b=this.o.length,this.p=T(this.p,this.s.p/8|0),this.s.p&=7},e.prototype.push=function(e,t){this.e(e),this.c(t)},e}(),be=function(){return function(e,t){oe([J,function(){return[ae,ye]}],this,fe.call(this,e,t),(function(e){var t=new ye(e.data);onmessage=ae(t)}),7,0)}}();function we(e,t){return D(e,{i:2},t&&t.out,t&&t.dictionary)}var Se=function(){function e(e,t){this.c=q(),this.l=0,this.v=1,me.call(this,e,t)}return e.prototype.push=function(e,t){this.c.p(e),this.l+=e.length,me.prototype.push.call(this,e,t)},e.prototype.p=function(e,t){var r=W(e,this.o,this.v&&de(this.o),t&&8,this.s);this.v&&(le(r,this.o),this.v=0),t&&(se(r,r.length-8,this.c.d()),se(r,r.length-4,this.l)),this.ondata(r,t)},e.prototype.flush=function(){me.prototype.flush.call(this)},e}(),xe=function(){return function(e,t){oe([Y,Z,function(){return[ae,me,Se]}],this,fe.call(this,e,t),(function(e){var t=new Se(e.data);onmessage=ae(t)}),8,1)}}();var Oe=function(){function e(e,t){this.v=1,this.r=0,ye.call(this,e,t)}return e.prototype.push=function(e,r){if(ye.prototype.e.call(this,e),this.r+=e.length,this.v){var n=this.p.subarray(this.v-1),i=n.length>3?ue(n):4;if(i>n.length){if(!r)return}else this.v>1&&this.onmember&&this.onmember(this.r-n.length);this.p=n.subarray(i),this.v=0}ye.prototype.c.call(this,r),!this.s.f||this.s.l||r||(this.v=C(this.s.p)+9,this.s={i:0},this.o=new t(0),this.push(new t(0),r))},e}(),_e=function(){return function(e,t){var r=this;oe([J,ee,function(){return[ae,ye,Oe]}],this,fe.call(this,e,t),(function(e){var t=new Oe(e.data);t.onmember=function(e){return postMessage(e)},onmessage=ae(t)}),9,0,(function(e){return r.onmember&&r.onmember(e)}))}}();var Ee=function(){function e(e,t){this.c=H(),this.v=1,me.call(this,e,t)}return e.prototype.push=function(e,t){this.c.p(e),me.prototype.push.call(this,e,t)},e.prototype.p=function(e,t){var r=W(e,this.o,this.v&&(this.o.dictionary?6:2),t&&4,this.s);this.v&&(he(r,this.o),this.v=0),t&&se(r,r.length-4,this.c.d()),this.ondata(r,t)},e.prototype.flush=function(){me.prototype.flush.call(this)},e}(),ke=function(){return function(e,t){oe([Y,te,function(){return[ae,me,Ee]}],this,fe.call(this,e,t),(function(e){var t=new Ee(e.data);onmessage=ae(t)}),10,1)}}();var Ce=function(){function e(e,t){ye.call(this,e,t),this.v=e&&e.dictionary?2:1}return e.prototype.push=function(e,t){if(ye.prototype.e.call(this,e),this.v){if(this.p.length<6&&!t)return;this.p=this.p.subarray(pe(this.p,this.v-1)),this.v=0}t&&(this.p.length<4&&R(6,"invalid zlib data"),this.p=this.p.subarray(0,-4)),ye.prototype.c.call(this,t)},e}(),Te=function(){return function(e,t){oe([J,re,function(){return[ae,ye,Ce]}],this,fe.call(this,e,t),(function(e){var t=new Ce(e.data);onmessage=ae(t)}),11,0)}}();var Ae="undefined"!=typeof TextDecoder&&new TextDecoder;try{Ae.decode(B,{stream:!0}),1}catch(e){}"function"==typeof queueMicrotask?queueMicrotask:"function"==typeof setTimeout&&setTimeout;const Re=e=>class{constructor(){this.i=new e,this.i.ondata=(e,t)=>{this.ondata(null,e,t)}}push(e,t){try{this.queuedSize+=e.length,this.i.push(e,t),this.queuedSize-=e.length,this.ondrain&&this.ondrain(e.length)}catch(e){this.ondata(e,null,t||!1)}}};let De=1;try{(new ge).terminate()}catch(R){De=0}const Pe=De?{gzip:xe,deflate:ke,"deflate-raw":ge}:{gzip:Re(Se),deflate:Re(Ee),"deflate-raw":Re(me)},je=De?{gzip:_e,deflate:Te,"deflate-raw":be}:{gzip:Re(Oe),deflate:Re(Ce),"deflate-raw":Re(ye)},Ie=(e,t,r)=>class extends e{constructor(e){if(!arguments.length)throw new TypeError(`Failed to construct '${r}': 1 argument required, but only 0 present.`);const n=t[e];if(!n)throw new TypeError(`Failed to construct '${r}': Unsupported compression format: '${e}'`);let i,a=new n;super({start:e=>{a.ondata=(t,r,n)=>{t?e.error(t):r&&(e.enqueue(r),n&&(i?i():e.terminate()))}},transform:e=>{if(e instanceof ArrayBuffer)e=new Uint8Array(e);else{if(!ArrayBuffer.isView(e))throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'");e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}if(a.push(e),a.queuedSize>=32768)return new Promise((e=>{a.ondrain=()=>{a.queuedSize<32768&&e()}}))},flush:()=>new Promise((e=>{i=e,a.push(new Uint8Array(0),!0)}))},{size:e=>0|e.byteLength,highWaterMark:65536},{size:e=>0|e.byteLength,highWaterMark:65536})}};const Le="undefined"==typeof globalThis?"undefined"==typeof self?"undefined"==typeof global?{}:global:self:globalThis;var Me;void 0===Le.CompressionStream&&(Le.CompressionStream=(Me=TransformStream,Ie(Me,Pe,"CompressionStream"))),void 0===Le.DecompressionStream&&(Le.DecompressionStream=function(e){return Ie(e,je,"DecompressionStream")}(TransformStream))},7879:(e,t,r)=>{"use strict";r.d(t,{Ay:()=>Je});var n=r(5959);function i(){return i=Object.assign?Object.assign.bind():function(e){for(var t=1;t(e[t.toLowerCase()]=t,e)),{for:"htmlFor"}),c={amp:"&",apos:"'",gt:">",lt:"<",nbsp:" ",quot:"“"},d=["style","script"],h=/([-A-Z0-9_:]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|(?:\{((?:\\.|{[^}]*?}|[^}])*)\})))?/gi,p=/mailto:/i,f=/\n{2,}$/,m=/^(\s*>[\s\S]*?)(?=\n{2,})/,g=/^ *> ?/gm,v=/^ {2,}\n/,y=/^(?:( *[-*_])){3,} *(?:\n *)+\n/,b=/^\s*(`{3,}|~{3,}) *(\S+)?([^\n]*?)?\n([\s\S]+?)\s*\1 *(?:\n *)*\n?/,w=/^(?: {4}[^\n]+\n*)+(?:\n *)+\n?/,S=/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,x=/^(?:\n *)*\n/,O=/\r\n?/g,_=/^\[\^([^\]]+)](:(.*)((\n+ {4,}.*)|(\n(?!\[\^).+))*)/,E=/^\[\^([^\]]+)]/,k=/\f/g,C=/^---[ \t]*\n(.|\n)*\n---[ \t]*\n/,T=/^\s*?\[(x|\s)\]/,A=/^ *(#{1,6}) *([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,R=/^ *(#{1,6}) +([^\n]+?)(?: +#*)?(?:\n *)*(?:\n|$)/,D=/^([^\n]+)\n *(=|-){3,} *(?:\n *)+\n/,P=/^ *(?!<[a-z][^ >/]* ?\/>)<([a-z][^ >/]*) ?((?:[^>]*[^/])?)>\n?(\s*(?:<\1[^>]*?>[\s\S]*?<\/\1>|(?!<\1\b)[\s\S])*?)<\/\1>(?!<\/\1>)\n*/i,j=/&([a-z0-9]+|#[0-9]{1,6}|#x[0-9a-fA-F]{1,6});/gi,I=/^)/,L=/^(data|aria|x)-[a-z_][a-z\d_.-]*$/,M=/^ *<([a-z][a-z0-9:]*)(?:\s+((?:<.*?>|[^>])*))?\/?>(?!<\/\1>)(\s*\n)?/i,N=/^\{.*\}$/,F=/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,V=/^<([^ >]+@[^ >]+)>/,z=/^<([^ >]+:\/[^ >]+)>/,B=/-([a-z])?/gi,$=/^(.*\|.*)\n(?: *(\|? *[-:]+ *\|[-| :]*)\n((?:.*\|.*\n)*))?\n?/,U=/^\[([^\]]*)\]:\s+]+)>?\s*("([^"]*)")?/,q=/^!\[([^\]]*)\] ?\[([^\]]*)\]/,H=/^\[([^\]]*)\] ?\[([^\]]*)\]/,W=/(\[|\])/g,G=/(\n|^[-*]\s|^#|^ {2,}|^-{2,}|^>\s)/,Q=/\t/g,K=/(^ *\||\| *$)/g,X=/^ *:-+: *$/,J=/^ *:-+ *$/,Y=/^ *-+: *$/,Z="((?:\\[.*?\\][([].*?[)\\]]|<.*?>(?:.*?<.*?>)?|`.*?`|~~.*?~~|==.*?==|.|\\n)*?)",ee=new RegExp(`^([*_])\\1${Z}\\1\\1(?!\\1)`),te=new RegExp(`^([*_])${Z}\\1(?!\\1|\\w)`),re=new RegExp(`^==${Z}==`),ne=new RegExp(`^~~${Z}~~`),ie=/^\\([^0-9A-Za-z\s])/,ae=/^[\s\S]+?(?=[^0-9A-Z\s\u00c0-\uffff&#;.()'"]|\d+\.|\n\n| {2,}\n|\w+:\S|$)/i,oe=/^\n+/,se=/^([ \t]*)/,le=/\\([^\\])/g,ue=/ *\n+$/,ce=/(?:^|\n)( *)$/,de="(?:\\d+\\.)",he="(?:[*+-])";function pe(e){return"( *)("+(1===e?de:he)+") +"}const fe=pe(1),me=pe(2);function ge(e){return new RegExp("^"+(1===e?fe:me))}const ve=ge(1),ye=ge(2);function be(e){return new RegExp("^"+(1===e?fe:me)+"[^\\n]*(?:\\n(?!\\1"+(1===e?de:he)+" )[^\\n]*)*(\\n|$)","gm")}const we=be(1),Se=be(2);function xe(e){const t=1===e?de:he;return new RegExp("^( *)("+t+") [\\s\\S]+?(?:\\n{2,}(?! )(?!\\1"+t+" (?!"+t+" ))\\n*|\\s*\\n*$)")}const Oe=xe(1),_e=xe(2);function Ee(e,t){const r=1===t,n=r?Oe:_e,i=r?we:Se,a=r?ve:ye;return{match(e,t,r){const i=ce.exec(r);return i&&(t.list||!t.inline&&!t.simple)?n.exec(e=i[1]+e):null},order:1,parse(e,t,n){const o=r?+e[2]:void 0,s=e[0].replace(f,"\n").match(i);let l=!1;return{items:s.map((function(e,r){const i=a.exec(e)[0].length,o=new RegExp("^ {1,"+i+"}","gm"),u=e.replace(o,"").replace(a,""),c=r===s.length-1,d=-1!==u.indexOf("\n\n")||c&&l;l=d;const h=n.inline,p=n.list;let f;n.list=!0,d?(n.inline=!1,f=u.replace(ue,"\n\n")):(n.inline=!0,f=u.replace(ue,""));const m=t(f,n);return n.inline=h,n.list=p,m})),ordered:r,start:o}},render:(t,r,n)=>e(t.ordered?"ol":"ul",{key:n.key,start:"20"===t.type?t.start:void 0},t.items.map((function(t,i){return e("li",{key:i},r(t,n))})))}}const ke=new RegExp("^\\[((?:\\[[^\\]]*\\]|[^\\[\\]]|\\](?=[^\\[]*\\]))*)\\]\\(\\s*?(?:\\s+['\"]([\\s\\S]*?)['\"])?\\s*\\)"),Ce=/^!\[(.*?)\]\( *((?:\([^)]*\)|[^() ])*) *"?([^)"]*)?"?\)/,Te=[m,b,w,A,D,R,I,$,we,Oe,Se,_e],Ae=[...Te,/^[^\n]+(?: \n|\n{2,})/,P,M];function Re(e){return e.replace(/[ÀÁÂÃÄÅàáâãä忯]/g,"a").replace(/[çÇ]/g,"c").replace(/[ðÐ]/g,"d").replace(/[ÈÉÊËéèêë]/g,"e").replace(/[ÏïÎîÍíÌì]/g,"i").replace(/[Ññ]/g,"n").replace(/[øØœŒÕõÔôÓóÒò]/g,"o").replace(/[ÜüÛûÚúÙù]/g,"u").replace(/[ŸÿÝý]/g,"y").replace(/[^a-z0-9- ]/gi,"").replace(/ /gi,"-").toLowerCase()}function De(e){return Y.test(e)?"right":X.test(e)?"center":J.test(e)?"left":null}function Pe(e,t,r,n){const i=r.inTable;r.inTable=!0;let a=e.trim().split(/( *(?:`[^`]*`|<.*?>.*?<\/.*?>(?!<\/.*?>)|\\\||\|) *)/).reduce(((e,i)=>("|"===i.trim()?e.push(n?{type:"26"}:{type:"27",text:i}):""!==i&&e.push.apply(e,t(i,r)),e)),[]);r.inTable=i;let o=[[]];return a.forEach((function(e,t){"26"===e.type?0!==t&&t!==a.length-1&&o.push([]):("27"!==e.type||null!=a[t+1]&&"26"!==a[t+1].type||(e.text=e.text.trimEnd()),o[o.length-1].push(e))})),o}function je(e,t,r){r.inline=!0;const n=e[2]?e[2].replace(K,"").split("|").map(De):[],i=e[3]?function(e,t,r){return e.trim().split("\n").map((function(e){return Pe(e,t,r,!0)}))}(e[3],t,r):[],a=Pe(e[1],t,r,!!i.length);return r.inline=!1,i.length?{align:n,cells:i,header:a,type:"25"}:{children:a,type:"21"}}function Ie(e,t){return null==e.align[t]?{}:{textAlign:e.align[t]}}function Le(e){return function(t,r){return r.inline?e.exec(t):null}}function Me(e){return function(t,r){return r.inline||r.simple?e.exec(t):null}}function Ne(e){return function(t,r){return r.inline||r.simple?null:e.exec(t)}}function Fe(e){return function(t){return e.exec(t)}}function Ve(e,t,r){if(t.inline||t.simple)return null;if(r&&!r.endsWith("\n"))return null;let n="";e.split("\n").every((e=>!Te.some((t=>t.test(e)))&&(n+=e+"\n",e.trim())));const i=n.trimEnd();return""==i?null:[n,i]}function ze(e){try{if(decodeURIComponent(e).replace(/[^A-Za-z0-9/:]/g,"").match(/^\s*(javascript|vbscript|data(?!:image)):/i))return}catch(e){return null}return e}function Be(e){return e.replace(le,"$1")}function $e(e,t,r){const n=r.inline||!1,i=r.simple||!1;r.inline=!0,r.simple=!0;const a=e(t,r);return r.inline=n,r.simple=i,a}function Ue(e,t,r){const n=r.inline||!1,i=r.simple||!1;r.inline=!1,r.simple=!0;const a=e(t,r);return r.inline=n,r.simple=i,a}function qe(e,t,r){const n=r.inline||!1;r.inline=!1;const i=e(t,r);return r.inline=n,i}const He=(e,t,r)=>({children:$e(t,e[1],r)});function We(){return{}}function Ge(){return null}function Qe(...e){return e.filter(Boolean).join(" ")}function Ke(e,t,r){let n=e;const i=t.split(".");for(;i.length&&(n=n[i[0]],void 0!==n);)i.shift();return n||r}function Xe(e="",t={}){t.overrides=t.overrides||{},t.slugify=t.slugify||Re,t.namedCodesToUnicode=t.namedCodesToUnicode?i({},c,t.namedCodesToUnicode):c;const r=t.createElement||n.createElement;function a(e,n,...a){const o=Ke(t.overrides,`${e}.props`,{});return r(function(e,t){const r=Ke(t,e);return r?"function"==typeof r||"object"==typeof r&&"render"in r?r:Ke(t,`${e}.component`,e):e}(e,t.overrides),i({},n,o,{className:Qe(null==n?void 0:n.className,o.className)||void 0}),...a)}function o(e){e=e.replace(C,"");let r=!1;t.forceInline?r=!0:t.forceBlock||(r=!1===G.test(e));const i=J(X(r?e:`${e.trimEnd().replace(oe,"")}\n\n`,{inline:r}));for(;"string"==typeof i[i.length-1]&&!i[i.length-1].trim();)i.pop();if(null===t.wrapper)return i;const o=t.wrapper||(r?"span":"div");let s;if(i.length>1||t.forceWrapper)s=i;else{if(1===i.length)return s=i[0],"string"==typeof s?a("span",{key:"outer"},s):s;s=null}return n.createElement(o,{key:"outer"},s)}function s(e){const t=e.match(h);return t?t.reduce((function(e,t,r){const i=t.indexOf("=");if(-1!==i){const a=function(e){return-1!==e.indexOf("-")&&null===e.match(L)&&(e=e.replace(B,(function(e,t){return t.toUpperCase()}))),e}(t.slice(0,i)).trim(),s=function(e){const t=e[0];return('"'===t||"'"===t)&&e.length>=2&&e[e.length-1]===t?e.slice(1,-1):e}(t.slice(i+1).trim()),l=u[a]||a,c=e[l]=function(e,t){return"style"===e?t.split(/;\s?/).reduce((function(e,t){const r=t.slice(0,t.indexOf(":"));return e[r.trim().replace(/(-[a-z])/g,(e=>e[1].toUpperCase()))]=t.slice(r.length+1).trim(),e}),{}):"href"===e||"src"===e?ze(t):(t.match(N)&&(t=t.slice(1,t.length-1)),"true"===t||"false"!==t&&t)}(a,s);"string"==typeof c&&(P.test(c)||M.test(c))&&(e[l]=n.cloneElement(o(c.trim()),{key:r}))}else"style"!==t&&(e[u[t]||t]=!0);return e}),{}):null}const l=[],f={},K={0:{match:Ne(m),order:1,parse:(e,t,r)=>({children:t(e[0].replace(g,""),r)}),render:(e,t,r)=>a("blockquote",{key:r.key},t(e.children,r))},1:{match:Fe(v),order:1,parse:We,render:(e,t,r)=>a("br",{key:r.key})},2:{match:Ne(y),order:1,parse:We,render:(e,t,r)=>a("hr",{key:r.key})},3:{match:Ne(w),order:0,parse:e=>({lang:void 0,text:e[0].replace(/^ {4}/gm,"").replace(/\n+$/,"")}),render:(e,t,r)=>a("pre",{key:r.key},a("code",i({},e.attrs,{className:e.lang?`lang-${e.lang}`:""}),e.text))},4:{match:Ne(b),order:0,parse:e=>({attrs:s(e[3]||""),lang:e[2]||void 0,text:e[4],type:"3"})},5:{match:Me(S),order:3,parse:e=>({text:e[2]}),render:(e,t,r)=>a("code",{key:r.key},e.text)},6:{match:Ne(_),order:0,parse:e=>(l.push({footnote:e[2],identifier:e[1]}),{}),render:Ge},7:{match:Le(E),order:1,parse:e=>({target:`#${t.slugify(e[1])}`,text:e[1]}),render:(e,t,r)=>a("a",{key:r.key,href:ze(e.target)},a("sup",{key:r.key},e.text))},8:{match:Le(T),order:1,parse:e=>({completed:"x"===e[1].toLowerCase()}),render:(e,t,r)=>a("input",{checked:e.completed,key:r.key,readOnly:!0,type:"checkbox"})},9:{match:Ne(t.enforceAtxHeadings?R:A),order:1,parse:(e,r,n)=>({children:$e(r,e[2],n),id:t.slugify(e[2]),level:e[1].length}),render:(e,t,r)=>a(`h${e.level}`,{id:e.id,key:r.key},t(e.children,r))},10:{match:Ne(D),order:0,parse:(e,t,r)=>({children:$e(t,e[1],r),level:"="===e[2]?1:2,type:"9"})},11:{match:Fe(P),order:1,parse(e,t,r){const[,n]=e[3].match(se),i=new RegExp(`^${n}`,"gm"),a=e[3].replace(i,""),o=(l=a,Ae.some((e=>e.test(l)))?qe:$e);var l;const u=e[1].toLowerCase(),c=-1!==d.indexOf(u),h={attrs:s(e[2]),noInnerParse:c,tag:(c?u:e[1]).trim()};return r.inAnchor=r.inAnchor||"a"===u,c?h.text=e[3]:h.children=o(t,a,r),r.inAnchor=!1,h},render:(e,t,r)=>a(e.tag,i({key:r.key},e.attrs),e.text||t(e.children,r))},13:{match:Fe(M),order:1,parse:e=>({attrs:s(e[2]||""),tag:e[1].trim()}),render:(e,t,r)=>a(e.tag,i({},e.attrs,{key:r.key}))},12:{match:Fe(I),order:1,parse:()=>({}),render:Ge},14:{match:Me(Ce),order:1,parse:e=>({alt:e[1],target:Be(e[2]),title:e[3]}),render:(e,t,r)=>a("img",{key:r.key,alt:e.alt||void 0,title:e.title||void 0,src:ze(e.target)})},15:{match:Le(ke),order:3,parse:(e,t,r)=>({children:Ue(t,e[1],r),target:Be(e[2]),title:e[3]}),render:(e,t,r)=>a("a",{key:r.key,href:ze(e.target),title:e.title},t(e.children,r))},16:{match:Le(z),order:0,parse:e=>({children:[{text:e[1],type:"27"}],target:e[1],type:"15"})},17:{match:(e,t)=>t.inAnchor?null:Le(F)(e,t),order:0,parse:e=>({children:[{text:e[1],type:"27"}],target:e[1],title:void 0,type:"15"})},18:{match:Le(V),order:0,parse(e){let t=e[1],r=e[1];return p.test(r)||(r="mailto:"+r),{children:[{text:t.replace("mailto:",""),type:"27"}],target:r,type:"15"}}},20:Ee(a,1),33:Ee(a,2),19:{match:Ne(x),order:3,parse:We,render:()=>"\n"},21:{match:Ve,order:3,parse:He,render:(e,t,r)=>a("p",{key:r.key},t(e.children,r))},22:{match:Le(U),order:0,parse:e=>(f[e[1]]={target:e[2],title:e[4]},{}),render:Ge},23:{match:Me(q),order:0,parse:e=>({alt:e[1]||void 0,ref:e[2]}),render:(e,t,r)=>f[e.ref]?a("img",{key:r.key,alt:e.alt,src:ze(f[e.ref].target),title:f[e.ref].title}):null},24:{match:Le(H),order:0,parse:(e,t,r)=>({children:t(e[1],r),fallbackChildren:t(e[0].replace(W,"\\$1"),r),ref:e[2]}),render:(e,t,r)=>f[e.ref]?a("a",{key:r.key,href:ze(f[e.ref].target),title:f[e.ref].title},t(e.children,r)):a("span",{key:r.key},t(e.fallbackChildren,r))},25:{match:Ne($),order:1,parse:je,render(e,t,r){const n=e;return a("table",{key:r.key},a("thead",null,a("tr",null,n.header.map((function(e,i){return a("th",{key:i,style:Ie(n,i)},t(e,r))})))),a("tbody",null,n.cells.map((function(e,i){return a("tr",{key:i},e.map((function(e,i){return a("td",{key:i,style:Ie(n,i)},t(e,r))})))}))))}},27:{match:Fe(ae),order:4,parse:e=>({text:e[0].replace(j,((e,r)=>t.namedCodesToUnicode[r]?t.namedCodesToUnicode[r]:e))}),render:e=>e.text},28:{match:Me(ee),order:2,parse:(e,t,r)=>({children:t(e[2],r)}),render:(e,t,r)=>a("strong",{key:r.key},t(e.children,r))},29:{match:Me(te),order:3,parse:(e,t,r)=>({children:t(e[2],r)}),render:(e,t,r)=>a("em",{key:r.key},t(e.children,r))},30:{match:Me(ie),order:1,parse:e=>({text:e[1],type:"27"})},31:{match:Me(re),order:3,parse:He,render:(e,t,r)=>a("mark",{key:r.key},t(e.children,r))},32:{match:Me(ne),order:3,parse:He,render:(e,t,r)=>a("del",{key:r.key},t(e.children,r))}};!0===t.disableParsingRawHTML&&(delete K[11],delete K[13]);const X=function(e){let t=Object.keys(e);function r(n,i){let a=[],o="";for(;n;){let s=0;for(;sa(r,n,i)),r,n,i):a(r,n,i)}}(K,t.renderRule),function e(t,r={}){if(Array.isArray(t)){const n=r.key,i=[];let a=!1;for(let n=0;n{let{children:t="",options:r}=e,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n=0||(i[r]=e[r]);return i}(e,a);return n.cloneElement(Xe(t,r),i)}},8987:(e,t,r)=>{"use strict";r.d(t,{Ak:()=>n});let n=(e=21)=>{let t="",r=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&r[e]];return t}},8537:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});class n{value;next;constructor(e){this.value=e}}class i{#K;#X;#J;constructor(){this.clear()}enqueue(e){const t=new n(e);this.#K?(this.#X.next=t,this.#X=t):(this.#K=t,this.#X=t),this.#J++}dequeue(){const e=this.#K;if(e)return this.#K=this.#K.next,this.#J--,e.value}peek(){if(this.#K)return this.#K.value}clear(){this.#K=void 0,this.#X=void 0,this.#J=0}get size(){return this.#J}*[Symbol.iterator](){let e=this.#K;for(;e;)yield e.value,e=e.next}}function a(e){o(e);const t=new i;let r=0;const n=()=>{r0&&(t.dequeue()(),r++)},a=async(e,t,i)=>{const a=(async()=>e(...i))();t(a);try{await a}catch{}r--,n()},s=(i,...o)=>new Promise((s=>{((i,o,s)=>{new Promise((e=>{t.enqueue(e)})).then(a.bind(void 0,i,o,s)),(async()=>{await Promise.resolve(),rr},pendingCount:{get:()=>t.size},clearQueue:{value(){t.clear()}},concurrency:{get:()=>e,set(i){o(i),e=i,queueMicrotask((()=>{for(;r0;)n()}))}}}),s}function o(e){if(!Number.isInteger(e)&&e!==Number.POSITIVE_INFINITY||!(e>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up")}},9215:(e,t,r)=>{"use strict";r.d(t,{mN:()=>Re,xI:()=>B});var n=r(5959),i=e=>"checkbox"===e.type,a=e=>e instanceof Date,o=e=>null==e;const s=e=>"object"==typeof e;var l=e=>!o(e)&&!Array.isArray(e)&&s(e)&&!a(e),u=e=>l(e)&&e.target?i(e.target)?e.target.checked:e.target.value:e,c=(e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)),d=e=>{const t=e.constructor&&e.constructor.prototype;return l(t)&&t.hasOwnProperty("isPrototypeOf")},h="undefined"!=typeof window&&void 0!==window.HTMLElement&&"undefined"!=typeof document;function p(e){let t;const r=Array.isArray(e),n="undefined"!=typeof FileList&&e instanceof FileList;if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else{if(h&&(e instanceof Blob||n)||!r&&!l(e))return e;if(t=r?[]:{},r||d(e))for(const r in e)e.hasOwnProperty(r)&&(t[r]=p(e[r]));else t=e}return t}var f=e=>Array.isArray(e)?e.filter(Boolean):[],m=e=>void 0===e,g=(e,t,r)=>{if(!t||!l(e))return r;const n=f(t.split(/[,[\].]+?/)).reduce(((e,t)=>o(e)?e:e[t]),e);return m(n)||n===e?m(e[t])?r:e[t]:n},v=e=>"boolean"==typeof e,y=e=>/^\w*$/.test(e),b=e=>f(e.replace(/["|']|\]/g,"").split(/\.|\[/)),w=(e,t,r)=>{let n=-1;const i=y(t)?[t]:b(t),a=i.length,o=a-1;for(;++nn.useContext(R);var P=(e,t,r,n=!0)=>{const i={defaultValues:t._defaultValues};for(const a in e)Object.defineProperty(i,a,{get:()=>{const i=a;return t._proxyFormState[i]!==x.all&&(t._proxyFormState[i]=!n||x.all),r&&(r[i]=!0),e[i]}});return i},j=e=>l(e)&&!Object.keys(e).length,I=(e,t,r,n)=>{r(e);const{name:i,...a}=e;return j(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find((e=>t[e]===(!n||x.all)))},L=e=>Array.isArray(e)?e:[e],M=(e,t,r)=>!e||!t||e===t||L(e).some((e=>e&&(r?e===t:e.startsWith(t)||t.startsWith(e))));function N(e){const t=n.useRef(e);t.current=e,n.useEffect((()=>{const r=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{r&&r.unsubscribe()}}),[e.disabled])}var F=e=>"string"==typeof e,V=(e,t,r,n,i)=>F(e)?(n&&t.watch.add(e),g(r,e,i)):Array.isArray(e)?e.map((e=>(n&&t.watch.add(e),g(r,e)))):(n&&(t.watchAll=!0),r);function z(e){const t=D(),{name:r,disabled:i,control:a=t.control,shouldUnregister:o}=e,s=c(a._names.array,r),l=function(e){const t=D(),{control:r=t.control,name:i,defaultValue:a,disabled:o,exact:s}=e||{},l=n.useRef(i);l.current=i,N({disabled:o,subject:r._subjects.values,next:e=>{M(l.current,e.name,s)&&c(p(V(l.current,r._names,e.values||r._formValues,!1,a)))}});const[u,c]=n.useState(r._getWatch(i,a));return n.useEffect((()=>r._removeUnmounted())),u}({control:a,name:r,defaultValue:g(a._formValues,r,g(a._defaultValues,r,e.defaultValue)),exact:!0}),d=function(e){const t=D(),{control:r=t.control,disabled:i,name:a,exact:o}=e||{},[s,l]=n.useState(r._formState),u=n.useRef(!0),c=n.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),d=n.useRef(a);return d.current=a,N({disabled:i,next:e=>u.current&&M(d.current,e.name,o)&&I(e,c.current,r._updateFormState)&&l({...r._formState,...e}),subject:r._subjects.state}),n.useEffect((()=>(u.current=!0,c.current.isValid&&r._updateValid(!0),()=>{u.current=!1})),[r]),n.useMemo((()=>P(s,r,c.current,!1)),[s,r])}({control:a,name:r,exact:!0}),h=n.useRef(a.register(r,{...e.rules,value:l,...v(e.disabled)?{disabled:e.disabled}:{}})),f=n.useMemo((()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!g(d.errors,r)},isDirty:{enumerable:!0,get:()=>!!g(d.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!g(d.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!g(d.validatingFields,r)},error:{enumerable:!0,get:()=>g(d.errors,r)}})),[d,r]),y=n.useMemo((()=>({name:r,value:l,...v(i)||d.disabled?{disabled:d.disabled||i}:{},onChange:e=>h.current.onChange({target:{value:u(e),name:r},type:S.CHANGE}),onBlur:()=>h.current.onBlur({target:{value:g(a._formValues,r),name:r},type:S.BLUR}),ref:e=>{const t=g(a._fields,r);t&&e&&(t._f.ref={focus:()=>e.focus(),select:()=>e.select(),setCustomValidity:t=>e.setCustomValidity(t),reportValidity:()=>e.reportValidity()})}})),[r,a._formValues,i,d.disabled,l,a._fields]);return n.useEffect((()=>{const e=a._options.shouldUnregister||o,t=(e,t)=>{const r=g(a._fields,e);r&&r._f&&(r._f.mount=t)};if(t(r,!0),e){const e=p(g(a._options.defaultValues,r));w(a._defaultValues,r,e),m(g(a._formValues,r))&&w(a._formValues,r,e)}return!s&&a.register(r),()=>{(s?e&&!a._state.action:e)?a.unregister(r):t(r,!1)}}),[r,a,s,o]),n.useEffect((()=>{a._updateDisabledField({disabled:i,fields:a._fields,name:r})}),[i,r,a]),n.useMemo((()=>({field:y,formState:d,fieldState:f})),[y,d,f])}const B=e=>e.render(z(e));var $=(e,t,r,n,i)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:i||!0}}:{},U=e=>({isOnSubmit:!e||e===x.onSubmit,isOnBlur:e===x.onBlur,isOnChange:e===x.onChange,isOnAll:e===x.all,isOnTouch:e===x.onTouched}),q=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some((t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length)))));const H=(e,t,r,n)=>{for(const i of r||Object.keys(e)){const r=g(e,i);if(r){const{_f:e,...a}=r;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],i)&&!n)return!0;if(e.ref&&t(e.ref,e.name)&&!n)return!0;if(H(a,t))break}else if(l(a)&&H(a,t))break}}};var W=(e,t,r)=>{const n=L(g(e,r));return w(n,"root",t[r]),w(e,r,n),e},G=e=>"file"===e.type,Q=e=>"function"==typeof e,K=e=>{if(!h)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},X=e=>F(e),J=e=>"radio"===e.type,Y=e=>e instanceof RegExp;const Z={value:!1,isValid:!1},ee={value:!0,isValid:!0};var te=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter((e=>e&&e.checked&&!e.disabled)).map((e=>e.value));return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!m(e[0].attributes.value)?m(e[0].value)||""===e[0].value?ee:{value:e[0].value,isValid:!0}:ee:Z}return Z};const re={isValid:!1,value:null};var ne=e=>Array.isArray(e)?e.reduce(((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e),re):re;function ie(e,t,r="validate"){if(X(e)||Array.isArray(e)&&e.every(X)||v(e)&&!e)return{type:r,message:X(e)?e:"",ref:t}}var ae=e=>l(e)&&!Y(e)?e:{value:e,message:""},oe=async(e,t,r,n,a,s)=>{const{ref:u,refs:c,required:d,maxLength:h,minLength:p,min:f,max:y,pattern:b,validate:w,name:S,valueAsNumber:x,mount:R}=e._f,D=g(r,S);if(!R||t.has(S))return{};const P=c?c[0]:u,I=e=>{a&&P.reportValidity&&(P.setCustomValidity(v(e)?"":e||""),P.reportValidity())},L={},M=J(u),N=i(u),V=M||N,z=(x||G(u))&&m(u.value)&&m(D)||K(u)&&""===u.value||""===D||Array.isArray(D)&&!D.length,B=$.bind(null,S,n,L),U=(e,t,r,n=E,i=k)=>{const a=e?t:r;L[S]={type:e?n:i,message:a,ref:u,...B(e?n:i,a)}};if(s?!Array.isArray(D)||!D.length:d&&(!V&&(z||o(D))||v(D)&&!D||N&&!te(c).isValid||M&&!ne(c).isValid)){const{value:e,message:t}=X(d)?{value:!!d,message:d}:ae(d);if(e&&(L[S]={type:T,message:t,ref:P,...B(T,t)},!n))return I(t),L}if(!(z||o(f)&&o(y))){let e,t;const r=ae(y),i=ae(f);if(o(D)||isNaN(D)){const n=u.valueAsDate||new Date(D),a=e=>new Date((new Date).toDateString()+" "+e),o="time"==u.type,s="week"==u.type;F(r.value)&&D&&(e=o?a(D)>a(r.value):s?D>r.value:n>new Date(r.value)),F(i.value)&&D&&(t=o?a(D)r.value),o(i.value)||(t=n+e.value,i=!o(t.value)&&D.length<+t.value;if((r||i)&&(U(r,e.message,t.message),!n))return I(L[S].message),L}if(b&&!z&&F(D)){const{value:e,message:t}=ae(b);if(Y(e)&&!D.match(e)&&(L[S]={type:C,message:t,ref:u,...B(C,t)},!n))return I(t),L}if(w)if(Q(w)){const e=ie(await w(D,r),P);if(e&&(L[S]={...e,...B(A,e.message)},!n))return I(e.message),L}else if(l(w)){let e={};for(const t in w){if(!j(e)&&!n)break;const i=ie(await w[t](D,r),P,t);i&&(e={...i,...B(t,i.message)},I(i.message),n&&(L[S]=e))}if(!j(e)&&(L[S]={ref:P,...e},!n))return L}return I(!0),L};function se(e,t){const r=Array.isArray(t)?t:y(t)?[t]:b(t),n=1===r.length?e:function(e,t){const r=t.slice(0,-1).length;let n=0;for(;n{let e=[];return{get observers(){return e},next:t=>{for(const r of e)r.next&&r.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter((e=>e!==t))}}),unsubscribe:()=>{e=[]}}},ue=e=>o(e)||!s(e);function ce(e,t){if(ue(e)||ue(t))return e===t;if(a(e)&&a(t))return e.getTime()===t.getTime();const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(const i of r){const r=e[i];if(!n.includes(i))return!1;if("ref"!==i){const e=t[i];if(a(r)&&a(e)||l(r)&&l(e)||Array.isArray(r)&&Array.isArray(e)?!ce(r,e):r!==e)return!1}}return!0}var de=e=>"select-multiple"===e.type,he=e=>J(e)||i(e),pe=e=>K(e)&&e.isConnected,fe=e=>{for(const t in e)if(Q(e[t]))return!0;return!1};function me(e,t={}){const r=Array.isArray(e);if(l(e)||r)for(const r in e)Array.isArray(e[r])||l(e[r])&&!fe(e[r])?(t[r]=Array.isArray(e[r])?[]:{},me(e[r],t[r])):o(e[r])||(t[r]=!0);return t}function ge(e,t,r){const n=Array.isArray(e);if(l(e)||n)for(const n in e)Array.isArray(e[n])||l(e[n])&&!fe(e[n])?m(t)||ue(r[n])?r[n]=Array.isArray(e[n])?me(e[n],[]):{...me(e[n])}:ge(e[n],o(t)?{}:t[n],r[n]):r[n]=!ce(e[n],t[n]);return r}var ve=(e,t)=>ge(e,t,me(t)),ye=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>m(e)?e:t?""===e?NaN:e?+e:e:r&&F(e)?new Date(e):n?n(e):e;function be(e){const t=e.ref;return G(t)?t.files:J(t)?ne(e.refs).value:de(t)?[...t.selectedOptions].map((({value:e})=>e)):i(t)?te(e.refs).value:ye(m(t.value)?e.ref.value:t.value,e)}var we=(e,t,r,n)=>{const i={};for(const r of e){const e=g(t,r);e&&w(i,r,e._f)}return{criteriaMode:r,names:[...e],fields:i,shouldUseNativeValidation:n}},Se=e=>m(e)?e:Y(e)?e.source:l(e)?Y(e.value)?e.value.source:e.value:e;const xe="AsyncFunction";var Oe=e=>!!e&&!!e.validate&&!!(Q(e.validate)&&e.validate.constructor.name===xe||l(e.validate)&&Object.values(e.validate).find((e=>e.constructor.name===xe))),_e=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function Ee(e,t,r){const n=g(e,r);if(n||y(r))return{error:n,name:r};const i=r.split(".");for(;i.length;){const n=i.join("."),a=g(t,n),o=g(e,n);if(a&&!Array.isArray(a)&&r!==n)return{name:r};if(o&&o.type)return{name:n,error:o};i.pop()}return{name:r}}var ke=(e,t,r,n,i)=>!i.isOnAll&&(!r&&i.isOnTouch?!(t||e):(r?n.isOnBlur:i.isOnBlur)?!e:!(r?n.isOnChange:i.isOnChange)||e),Ce=(e,t)=>!f(g(e,t)).length&&se(e,t);const Te={mode:x.onSubmit,reValidateMode:x.onChange,shouldFocusError:!0};function Ae(e={}){let t,r={...Te,...e},n={submitCount:0,isDirty:!1,isLoading:Q(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1},s={},d=(l(r.defaultValues)||l(r.values))&&p(r.defaultValues||r.values)||{},y=r.shouldUnregister?{}:p(d),b={action:!1,mount:!1,watch:!1},O={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},_=0;const E={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},k={values:le(),array:le(),state:le()},C=U(r.mode),T=U(r.reValidateMode),A=r.criteriaMode===x.all,R=async e=>{if(!r.disabled&&(E.isValid||e)){const e=r.resolver?j((await N()).errors):await z(s,!0);e!==n.isValid&&k.state.next({isValid:e})}},D=(e,t)=>{r.disabled||!E.isValidating&&!E.validatingFields||((e||Array.from(O.mount)).forEach((e=>{e&&(t?w(n.validatingFields,e,t):se(n.validatingFields,e))})),k.state.next({validatingFields:n.validatingFields,isValidating:!j(n.validatingFields)}))},P=(e,t,r,n)=>{const i=g(s,e);if(i){const a=g(y,e,m(r)?g(d,e):r);m(a)||n&&n.defaultChecked||t?w(y,e,t?a:be(i._f)):X(e,a),b.mount&&R()}},I=(e,t,i,a,o)=>{let l=!1,u=!1;const c={name:e};if(!r.disabled){const r=!!(g(s,e)&&g(s,e)._f&&g(s,e)._f.disabled);if(!i||a){E.isDirty&&(u=n.isDirty,n.isDirty=c.isDirty=B(),l=u!==c.isDirty);const i=r||ce(g(d,e),t);u=!(r||!g(n.dirtyFields,e)),i||r?se(n.dirtyFields,e):w(n.dirtyFields,e,!0),c.dirtyFields=n.dirtyFields,l=l||E.dirtyFields&&u!==!i}if(i){const t=g(n.touchedFields,e);t||(w(n.touchedFields,e,i),c.touchedFields=n.touchedFields,l=l||E.touchedFields&&t!==i)}l&&o&&k.state.next(c)}return l?c:{}},M=(e,i,a,o)=>{const s=g(n.errors,e),l=E.isValid&&v(i)&&n.isValid!==i;var u;if(r.delayError&&a?(u=()=>((e,t)=>{w(n.errors,e,t),k.state.next({errors:n.errors})})(e,a),t=e=>{clearTimeout(_),_=setTimeout(u,e)},t(r.delayError)):(clearTimeout(_),t=null,a?w(n.errors,e,a):se(n.errors,e)),(a?!ce(s,a):s)||!j(o)||l){const t={...o,...l&&v(i)?{isValid:i}:{},errors:n.errors,name:e};n={...n,...t},k.state.next(t)}},N=async e=>{D(e,!0);const t=await r.resolver(y,r.context,we(e||O.mount,s,r.criteriaMode,r.shouldUseNativeValidation));return D(e),t},z=async(e,t,i={valid:!0})=>{for(const a in e){const o=e[a];if(o){const{_f:e,...s}=o;if(e){const s=O.array.has(e.name),l=o._f&&Oe(o._f);l&&E.validatingFields&&D([a],!0);const u=await oe(o,O.disabled,y,A,r.shouldUseNativeValidation&&!t,s);if(l&&E.validatingFields&&D([a]),u[e.name]&&(i.valid=!1,t))break;!t&&(g(u,e.name)?s?W(n.errors,u,e.name):w(n.errors,e.name,u[e.name]):se(n.errors,e.name))}!j(s)&&await z(s,t,i)}}return i.valid},B=(e,t)=>!r.disabled&&(e&&t&&w(y,e,t),!ce(re(),d)),$=(e,t,r)=>V(e,O,{...b.mount?y:m(t)?d:F(e)?{[e]:t}:t},r,t),X=(e,t,r={})=>{const n=g(s,e);let a=t;if(n){const r=n._f;r&&(!r.disabled&&w(y,e,ye(t,r)),a=K(r.ref)&&o(t)?"":t,de(r.ref)?[...r.ref.options].forEach((e=>e.selected=a.includes(e.value))):r.refs?i(r.ref)?r.refs.length>1?r.refs.forEach((e=>(!e.defaultChecked||!e.disabled)&&(e.checked=Array.isArray(a)?!!a.find((t=>t===e.value)):a===e.value))):r.refs[0]&&(r.refs[0].checked=!!a):r.refs.forEach((e=>e.checked=e.value===a)):G(r.ref)?r.ref.value="":(r.ref.value=a,r.ref.type||k.values.next({name:e,values:{...y}})))}(r.shouldDirty||r.shouldTouch)&&I(e,a,r.shouldTouch,r.shouldDirty,!0),r.shouldValidate&&te(e)},J=(e,t,r)=>{for(const n in t){const i=t[n],o=`${e}.${n}`,u=g(s,o);(O.array.has(e)||l(i)||u&&!u._f)&&!a(i)?J(o,i,r):X(o,i,r)}},Y=(e,t,r={})=>{const i=g(s,e),a=O.array.has(e),l=p(t);w(y,e,l),a?(k.array.next({name:e,values:{...y}}),(E.isDirty||E.dirtyFields)&&r.shouldDirty&&k.state.next({name:e,dirtyFields:ve(d,y),isDirty:B(e,l)})):!i||i._f||o(l)?X(e,l,r):J(e,l,r),q(e,O)&&k.state.next({...n}),k.values.next({name:b.mount?e:void 0,values:{...y}})},Z=async e=>{b.mount=!0;const i=e.target;let o=i.name,l=!0;const c=g(s,o),d=e=>{l=Number.isNaN(e)||a(e)&&isNaN(e.getTime())||ce(e,g(y,o,e))};if(c){let a,h;const p=i.type?be(c._f):u(e),f=e.type===S.BLUR||e.type===S.FOCUS_OUT,m=!_e(c._f)&&!r.resolver&&!g(n.errors,o)&&!c._f.deps||ke(f,g(n.touchedFields,o),n.isSubmitted,T,C),v=q(o,O,f);w(y,o,p),f?(c._f.onBlur&&c._f.onBlur(e),t&&t(0)):c._f.onChange&&c._f.onChange(e);const b=I(o,p,f,!1),x=!j(b)||v;if(!f&&k.values.next({name:o,type:e.type,values:{...y}}),m)return E.isValid&&("onBlur"===r.mode&&f?R():f||R()),x&&k.state.next({name:o,...v?{}:b});if(!f&&v&&k.state.next({...n}),r.resolver){const{errors:e}=await N([o]);if(d(p),l){const t=Ee(n.errors,s,o),r=Ee(e,s,t.name||o);a=r.error,o=r.name,h=j(e)}}else D([o],!0),a=(await oe(c,O.disabled,y,A,r.shouldUseNativeValidation))[o],D([o]),d(p),l&&(a?h=!1:E.isValid&&(h=await z(s,!0)));l&&(c._f.deps&&te(c._f.deps),M(o,h,a,b))}},ee=(e,t)=>{if(g(n.errors,t)&&e.focus)return e.focus(),1},te=async(e,t={})=>{let i,a;const o=L(e);if(r.resolver){const t=await(async e=>{const{errors:t}=await N(e);if(e)for(const r of e){const e=g(t,r);e?w(n.errors,r,e):se(n.errors,r)}else n.errors=t;return t})(m(e)?e:o);i=j(t),a=e?!o.some((e=>g(t,e))):i}else e?(a=(await Promise.all(o.map((async e=>{const t=g(s,e);return await z(t&&t._f?{[e]:t}:t)})))).every(Boolean),(a||n.isValid)&&R()):a=i=await z(s);return k.state.next({...!F(e)||E.isValid&&i!==n.isValid?{}:{name:e},...r.resolver||!e?{isValid:i}:{},errors:n.errors}),t.shouldFocus&&!a&&H(s,ee,e?o:O.mount),a},re=e=>{const t={...b.mount?y:d};return m(e)?t:F(e)?g(t,e):e.map((e=>g(t,e)))},ne=(e,t)=>({invalid:!!g((t||n).errors,e),isDirty:!!g((t||n).dirtyFields,e),error:g((t||n).errors,e),isValidating:!!g(n.validatingFields,e),isTouched:!!g((t||n).touchedFields,e)}),ie=(e,t,r)=>{const i=(g(s,e,{_f:{}})._f||{}).ref,a=g(n.errors,e)||{},{ref:o,message:l,type:u,...c}=a;w(n.errors,e,{...c,...t,ref:i}),k.state.next({name:e,errors:n.errors,isValid:!1}),r&&r.shouldFocus&&i&&i.focus&&i.focus()},ae=(e,t={})=>{for(const i of e?L(e):O.mount)O.mount.delete(i),O.array.delete(i),t.keepValue||(se(s,i),se(y,i)),!t.keepError&&se(n.errors,i),!t.keepDirty&&se(n.dirtyFields,i),!t.keepTouched&&se(n.touchedFields,i),!t.keepIsValidating&&se(n.validatingFields,i),!r.shouldUnregister&&!t.keepDefaultValue&&se(d,i);k.values.next({values:{...y}}),k.state.next({...n,...t.keepDirty?{isDirty:B()}:{}}),!t.keepIsValid&&R()},ue=({disabled:e,name:t,field:r,fields:n})=>{(v(e)&&b.mount||e||O.disabled.has(t))&&(e?O.disabled.add(t):O.disabled.delete(t),I(t,be(r?r._f:g(n,t)._f),!1,!1,!0))},fe=(e,t={})=>{let n=g(s,e);const i=v(t.disabled)||v(r.disabled);return w(s,e,{...n||{},_f:{...n&&n._f?n._f:{ref:{name:e}},name:e,mount:!0,...t}}),O.mount.add(e),n?ue({field:n,disabled:v(t.disabled)?t.disabled:r.disabled,name:e}):P(e,!0,t.value),{...i?{disabled:t.disabled||r.disabled}:{},...r.progressive?{required:!!t.required,min:Se(t.min),max:Se(t.max),minLength:Se(t.minLength),maxLength:Se(t.maxLength),pattern:Se(t.pattern)}:{},name:e,onChange:Z,onBlur:Z,ref:i=>{if(i){fe(e,t),n=g(s,e);const r=m(i.value)&&i.querySelectorAll&&i.querySelectorAll("input,select,textarea")[0]||i,a=he(r),o=n._f.refs||[];if(a?o.find((e=>e===r)):r===n._f.ref)return;w(s,e,{_f:{...n._f,...a?{refs:[...o.filter(pe),r,...Array.isArray(g(d,e))?[{}]:[]],ref:{type:r.type,name:e}}:{ref:r}}}),P(e,!1,void 0,r)}else n=g(s,e,{}),n._f&&(n._f.mount=!1),(r.shouldUnregister||t.shouldUnregister)&&(!c(O.array,e)||!b.action)&&O.unMount.add(e)}}},me=()=>r.shouldFocusError&&H(s,ee,O.mount),ge=(e,t)=>async i=>{let a;i&&(i.preventDefault&&i.preventDefault(),i.persist&&i.persist());let o=p(y);if(O.disabled.size)for(const e of O.disabled)w(o,e,void 0);if(k.state.next({isSubmitting:!0}),r.resolver){const{errors:e,values:t}=await N();n.errors=e,o=t}else await z(s);if(se(n.errors,"root"),j(n.errors)){k.state.next({errors:{}});try{await e(o,i)}catch(e){a=e}}else t&&await t({...n.errors},i),me(),setTimeout(me);if(k.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:j(n.errors)&&!a,submitCount:n.submitCount+1,errors:n.errors}),a)throw a},xe=(e,t={})=>{const i=e?p(e):d,a=p(i),o=j(e),l=o?d:a;if(t.keepDefaultValues||(d=i),!t.keepValues){if(t.keepDirtyValues){const e=new Set([...O.mount,...Object.keys(ve(d,y))]);for(const t of Array.from(e))g(n.dirtyFields,t)?w(l,t,g(y,t)):Y(t,g(l,t))}else{if(h&&m(e))for(const e of O.mount){const t=g(s,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(K(e)){const t=e.closest("form");if(t){t.reset();break}}}}s={}}y=r.shouldUnregister?t.keepDefaultValues?p(d):{}:p(l),k.array.next({values:{...l}}),k.values.next({values:{...l}})}O={mount:t.keepDirtyValues?O.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},b.mount=!E.isValid||!!t.keepIsValid||!!t.keepDirtyValues,b.watch=!!r.shouldUnregister,k.state.next({submitCount:t.keepSubmitCount?n.submitCount:0,isDirty:!o&&(t.keepDirty?n.isDirty:!(!t.keepDefaultValues||ce(e,d))),isSubmitted:!!t.keepIsSubmitted&&n.isSubmitted,dirtyFields:o?{}:t.keepDirtyValues?t.keepDefaultValues&&y?ve(d,y):n.dirtyFields:t.keepDefaultValues&&e?ve(d,e):t.keepDirty?n.dirtyFields:{},touchedFields:t.keepTouched?n.touchedFields:{},errors:t.keepErrors?n.errors:{},isSubmitSuccessful:!!t.keepIsSubmitSuccessful&&n.isSubmitSuccessful,isSubmitting:!1})},Ae=(e,t)=>xe(Q(e)?e(y):e,t);return{control:{register:fe,unregister:ae,getFieldState:ne,handleSubmit:ge,setError:ie,_executeSchema:N,_getWatch:$,_getDirty:B,_updateValid:R,_removeUnmounted:()=>{for(const e of O.unMount){const t=g(s,e);t&&(t._f.refs?t._f.refs.every((e=>!pe(e))):!pe(t._f.ref))&&ae(e)}O.unMount=new Set},_updateFieldArray:(e,t=[],i,a,o=!0,l=!0)=>{if(a&&i&&!r.disabled){if(b.action=!0,l&&Array.isArray(g(s,e))){const t=i(g(s,e),a.argA,a.argB);o&&w(s,e,t)}if(l&&Array.isArray(g(n.errors,e))){const t=i(g(n.errors,e),a.argA,a.argB);o&&w(n.errors,e,t),Ce(n.errors,e)}if(E.touchedFields&&l&&Array.isArray(g(n.touchedFields,e))){const t=i(g(n.touchedFields,e),a.argA,a.argB);o&&w(n.touchedFields,e,t)}E.dirtyFields&&(n.dirtyFields=ve(d,y)),k.state.next({name:e,isDirty:B(e,t),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else w(y,e,t)},_updateDisabledField:ue,_getFieldArray:e=>f(g(b.mount?y:d,e,r.shouldUnregister?g(d,e,[]):[])),_reset:xe,_resetDefaultValues:()=>Q(r.defaultValues)&&r.defaultValues().then((e=>{Ae(e,r.resetOptions),k.state.next({isLoading:!1})})),_updateFormState:e=>{n={...n,...e}},_disableForm:e=>{v(e)&&(k.state.next({disabled:e}),H(s,((t,r)=>{const n=g(s,r);n&&(t.disabled=n._f.disabled||e,Array.isArray(n._f.refs)&&n._f.refs.forEach((t=>{t.disabled=n._f.disabled||e})))}),0,!1))},_subjects:k,_proxyFormState:E,_setErrors:e=>{n.errors=e,k.state.next({errors:n.errors,isValid:!1})},get _fields(){return s},get _formValues(){return y},get _state(){return b},set _state(e){b=e},get _defaultValues(){return d},get _names(){return O},set _names(e){O=e},get _formState(){return n},set _formState(e){n=e},get _options(){return r},set _options(e){r={...r,...e}}},trigger:te,register:fe,handleSubmit:ge,watch:(e,t)=>Q(e)?k.values.subscribe({next:r=>e($(void 0,t),r)}):$(e,t,!0),setValue:Y,getValues:re,reset:Ae,resetField:(e,t={})=>{g(s,e)&&(m(t.defaultValue)?Y(e,p(g(d,e))):(Y(e,t.defaultValue),w(d,e,p(t.defaultValue))),t.keepTouched||se(n.touchedFields,e),t.keepDirty||(se(n.dirtyFields,e),n.isDirty=t.defaultValue?B(e,p(g(d,e))):B()),t.keepError||(se(n.errors,e),E.isValid&&R()),k.state.next({...n}))},clearErrors:e=>{e&&L(e).forEach((e=>se(n.errors,e))),k.state.next({errors:e?n.errors:{}})},unregister:ae,setError:ie,setFocus:(e,t={})=>{const r=g(s,e),n=r&&r._f;if(n){const e=n.refs?n.refs[0]:n.ref;e.focus&&(e.focus(),t.shouldSelect&&Q(e.select)&&e.select())}},getFieldState:ne}}function Re(e={}){const t=n.useRef(void 0),r=n.useRef(void 0),[i,a]=n.useState({isDirty:!1,isValidating:!1,isLoading:Q(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:Q(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...Ae(e),formState:i});const o=t.current.control;return o._options=e,N({subject:o._subjects.state,next:e=>{I(e,o._proxyFormState,o._updateFormState,!0)&&a({...o._formState})}}),n.useEffect((()=>o._disableForm(e.disabled)),[o,e.disabled]),n.useEffect((()=>{if(o._proxyFormState.isDirty){const e=o._getDirty();e!==i.isDirty&&o._subjects.state.next({isDirty:e})}}),[o,i.isDirty]),n.useEffect((()=>{e.values&&!ce(e.values,r.current)?(o._reset(e.values,o._options.resetOptions),r.current=e.values,a((e=>({...e})))):o._resetDefaultValues()}),[e.values,o]),n.useEffect((()=>{e.errors&&o._setErrors(e.errors)}),[e.errors,o]),n.useEffect((()=>{o._state.mount||(o._updateValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()})),n.useEffect((()=>{e.shouldUnregister&&o._subjects.values.next({values:o._getWatch()})}),[e.shouldUnregister,o]),t.current.formState=P(i,o),t.current}},9488:(e,t,r)=>{"use strict";r.d(t,{A:()=>k});var n=r(5959),i=e=>"string"!=typeof e?{}:e.split(/ ?; ?/).reduce(((e,t)=>{const[r,n]=t.split(/ ?: ?/).map(((e,t)=>0===t?e.replace(/\s+/g,""):e.trim()));if(r&&n){const t=r.replace(/(\w)-(\w)/g,((e,t,r)=>`${t}${r.toUpperCase()}`));let i=n.trim();Number.isNaN(Number(n))||(i=Number(n)),e[r.startsWith("-")?r:t]=i}return e}),{});var a=["br","col","colgroup","dl","hr","iframe","img","input","link","menuitem","meta","ol","param","select","table","tbody","tfoot","thead","tr","ul","wbr"],o={"accept-charset":"acceptCharset",acceptcharset:"acceptCharset",accesskey:"accessKey",allowfullscreen:"allowFullScreen",autocapitalize:"autoCapitalize",autocomplete:"autoComplete",autocorrect:"autoCorrect",autofocus:"autoFocus",autoplay:"autoPlay",autosave:"autoSave",cellpadding:"cellPadding",cellspacing:"cellSpacing",charset:"charSet",class:"className",classid:"classID",classname:"className",colspan:"colSpan",contenteditable:"contentEditable",contextmenu:"contextMenu",controlslist:"controlsList",crossorigin:"crossOrigin",dangerouslysetinnerhtml:"dangerouslySetInnerHTML",datetime:"dateTime",defaultchecked:"defaultChecked",defaultvalue:"defaultValue",enctype:"encType",for:"htmlFor",formmethod:"formMethod",formaction:"formAction",formenctype:"formEncType",formnovalidate:"formNoValidate",formtarget:"formTarget",frameborder:"frameBorder",hreflang:"hrefLang",htmlfor:"htmlFor",httpequiv:"httpEquiv","http-equiv":"httpEquiv",icon:"icon",innerhtml:"innerHTML",inputmode:"inputMode",itemid:"itemID",itemprop:"itemProp",itemref:"itemRef",itemscope:"itemScope",itemtype:"itemType",keyparams:"keyParams",keytype:"keyType",marginwidth:"marginWidth",marginheight:"marginHeight",maxlength:"maxLength",mediagroup:"mediaGroup",minlength:"minLength",nomodule:"noModule",novalidate:"noValidate",playsinline:"playsInline",radiogroup:"radioGroup",readonly:"readOnly",referrerpolicy:"referrerPolicy",rowspan:"rowSpan",spellcheck:"spellCheck",srcdoc:"srcDoc",srclang:"srcLang",srcset:"srcSet",tabindex:"tabIndex",typemustmatch:"typeMustMatch",usemap:"useMap",accentheight:"accentHeight","accent-height":"accentHeight",alignmentbaseline:"alignmentBaseline","alignment-baseline":"alignmentBaseline",allowreorder:"allowReorder",arabicform:"arabicForm","arabic-form":"arabicForm",attributename:"attributeName",attributetype:"attributeType",autoreverse:"autoReverse",basefrequency:"baseFrequency",baselineshift:"baselineShift","baseline-shift":"baselineShift",baseprofile:"baseProfile",calcmode:"calcMode",capheight:"capHeight","cap-height":"capHeight",clippath:"clipPath","clip-path":"clipPath",clippathunits:"clipPathUnits",cliprule:"clipRule","clip-rule":"clipRule",colorinterpolation:"colorInterpolation","color-interpolation":"colorInterpolation",colorinterpolationfilters:"colorInterpolationFilters","color-interpolation-filters":"colorInterpolationFilters",colorprofile:"colorProfile","color-profile":"colorProfile",colorrendering:"colorRendering","color-rendering":"colorRendering",contentscripttype:"contentScriptType",contentstyletype:"contentStyleType",diffuseconstant:"diffuseConstant",dominantbaseline:"dominantBaseline","dominant-baseline":"dominantBaseline",edgemode:"edgeMode",enablebackground:"enableBackground","enable-background":"enableBackground",externalresourcesrequired:"externalResourcesRequired",fillopacity:"fillOpacity","fill-opacity":"fillOpacity",fillrule:"fillRule","fill-rule":"fillRule",filterres:"filterRes",filterunits:"filterUnits",floodopacity:"floodOpacity","flood-opacity":"floodOpacity",floodcolor:"floodColor","flood-color":"floodColor",fontfamily:"fontFamily","font-family":"fontFamily",fontsize:"fontSize","font-size":"fontSize",fontsizeadjust:"fontSizeAdjust","font-size-adjust":"fontSizeAdjust",fontstretch:"fontStretch","font-stretch":"fontStretch",fontstyle:"fontStyle","font-style":"fontStyle",fontvariant:"fontVariant","font-variant":"fontVariant",fontweight:"fontWeight","font-weight":"fontWeight",glyphname:"glyphName","glyph-name":"glyphName",glyphorientationhorizontal:"glyphOrientationHorizontal","glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphorientationvertical:"glyphOrientationVertical","glyph-orientation-vertical":"glyphOrientationVertical",glyphref:"glyphRef",gradienttransform:"gradientTransform",gradientunits:"gradientUnits",horizadvx:"horizAdvX","horiz-adv-x":"horizAdvX",horizoriginx:"horizOriginX","horiz-origin-x":"horizOriginX",imagerendering:"imageRendering","image-rendering":"imageRendering",kernelmatrix:"kernelMatrix",kernelunitlength:"kernelUnitLength",keypoints:"keyPoints",keysplines:"keySplines",keytimes:"keyTimes",lengthadjust:"lengthAdjust",letterspacing:"letterSpacing","letter-spacing":"letterSpacing",lightingcolor:"lightingColor","lighting-color":"lightingColor",limitingconeangle:"limitingConeAngle",markerend:"markerEnd","marker-end":"markerEnd",markerheight:"markerHeight",markermid:"markerMid","marker-mid":"markerMid",markerstart:"markerStart","marker-start":"markerStart",markerunits:"markerUnits",markerwidth:"markerWidth",maskcontentunits:"maskContentUnits",maskunits:"maskUnits",numoctaves:"numOctaves",overlineposition:"overlinePosition","overline-position":"overlinePosition",overlinethickness:"overlineThickness","overline-thickness":"overlineThickness",paintorder:"paintOrder","paint-order":"paintOrder","panose-1":"panose1",pathlength:"pathLength",patterncontentunits:"patternContentUnits",patterntransform:"patternTransform",patternunits:"patternUnits",pointerevents:"pointerEvents","pointer-events":"pointerEvents",pointsatx:"pointsAtX",pointsaty:"pointsAtY",pointsatz:"pointsAtZ",preservealpha:"preserveAlpha",preserveaspectratio:"preserveAspectRatio",primitiveunits:"primitiveUnits",refx:"refX",refy:"refY",renderingintent:"renderingIntent","rendering-intent":"renderingIntent",repeatcount:"repeatCount",repeatdur:"repeatDur",requiredextensions:"requiredExtensions",requiredfeatures:"requiredFeatures",shaperendering:"shapeRendering","shape-rendering":"shapeRendering",specularconstant:"specularConstant",specularexponent:"specularExponent",spreadmethod:"spreadMethod",startoffset:"startOffset",stddeviation:"stdDeviation",stitchtiles:"stitchTiles",stopcolor:"stopColor","stop-color":"stopColor",stopopacity:"stopOpacity","stop-opacity":"stopOpacity",strikethroughposition:"strikethroughPosition","strikethrough-position":"strikethroughPosition",strikethroughthickness:"strikethroughThickness","strikethrough-thickness":"strikethroughThickness",strokedasharray:"strokeDasharray","stroke-dasharray":"strokeDasharray",strokedashoffset:"strokeDashoffset","stroke-dashoffset":"strokeDashoffset",strokelinecap:"strokeLinecap","stroke-linecap":"strokeLinecap",strokelinejoin:"strokeLinejoin","stroke-linejoin":"strokeLinejoin",strokemiterlimit:"strokeMiterlimit","stroke-miterlimit":"strokeMiterlimit",strokewidth:"strokeWidth","stroke-width":"strokeWidth",strokeopacity:"strokeOpacity","stroke-opacity":"strokeOpacity",suppresscontenteditablewarning:"suppressContentEditableWarning",suppresshydrationwarning:"suppressHydrationWarning",surfacescale:"surfaceScale",systemlanguage:"systemLanguage",tablevalues:"tableValues",targetx:"targetX",targety:"targetY",textanchor:"textAnchor","text-anchor":"textAnchor",textdecoration:"textDecoration","text-decoration":"textDecoration",textlength:"textLength",textrendering:"textRendering","text-rendering":"textRendering",underlineposition:"underlinePosition","underline-position":"underlinePosition",underlinethickness:"underlineThickness","underline-thickness":"underlineThickness",unicodebidi:"unicodeBidi","unicode-bidi":"unicodeBidi",unicoderange:"unicodeRange","unicode-range":"unicodeRange",unitsperem:"unitsPerEm","units-per-em":"unitsPerEm",unselectable:"unselectable",valphabetic:"vAlphabetic","v-alphabetic":"vAlphabetic",vectoreffect:"vectorEffect","vector-effect":"vectorEffect",vertadvy:"vertAdvY","vert-adv-y":"vertAdvY",vertoriginx:"vertOriginX","vert-origin-x":"vertOriginX",vertoriginy:"vertOriginY","vert-origin-y":"vertOriginY",vhanging:"vHanging","v-hanging":"vHanging",videographic:"vIdeographic","v-ideographic":"vIdeographic",viewbox:"viewBox",viewtarget:"viewTarget",vmathematical:"vMathematical","v-mathematical":"vMathematical",wordspacing:"wordSpacing","word-spacing":"wordSpacing",writingmode:"writingMode","writing-mode":"writingMode",xchannelselector:"xChannelSelector",xheight:"xHeight","x-height":"xHeight",xlinkactuate:"xlinkActuate","xlink:actuate":"xlinkActuate",xlinkarcrole:"xlinkArcrole","xlink:arcrole":"xlinkArcrole",xlinkhref:"xlinkHref","xlink:href":"xlinkHref",xlinkrole:"xlinkRole","xlink:role":"xlinkRole",xlinkshow:"xlinkShow","xlink:show":"xlinkShow",xlinktitle:"xlinkTitle","xlink:title":"xlinkTitle",xlinktype:"xlinkType","xlink:type":"xlinkType",xmlbase:"xmlBase","xml:base":"xmlBase",xmllang:"xmlLang","xml:lang":"xmlLang","xml:space":"xmlSpace",xmlnsxlink:"xmlnsXlink","xmlns:xlink":"xmlnsXlink",xmlspace:"xmlSpace",ychannelselector:"yChannelSelector",zoomandpan:"zoomAndPan",onblur:"onBlur",onchange:"onChange",onclick:"onClick",oncontextmenu:"onContextMenu",ondoubleclick:"onDoubleClick",ondrag:"onDrag",ondragend:"onDragEnd",ondragenter:"onDragEnter",ondragexit:"onDragExit",ondragleave:"onDragLeave",ondragover:"onDragOver",ondragstart:"onDragStart",ondrop:"onDrop",onerror:"onError",onfocus:"onFocus",oninput:"onInput",oninvalid:"onInvalid",onkeydown:"onKeyDown",onkeypress:"onKeyPress",onkeyup:"onKeyUp",onload:"onLoad",onmousedown:"onMouseDown",onmouseenter:"onMouseEnter",onmouseleave:"onMouseLeave",onmousemove:"onMouseMove",onmouseout:"onMouseOut",onmouseover:"onMouseOver",onmouseup:"onMouseUp",onscroll:"onScroll",onsubmit:"onSubmit",ontouchcancel:"onTouchCancel",ontouchend:"onTouchEnd",ontouchmove:"onTouchMove",ontouchstart:"onTouchStart",onwheel:"onWheel"};function s(e,t){const{key:r,level:s,...u}=t;switch(e.nodeType){case 1:return n.createElement(function(e){if(/[a-z]+[A-Z]+[a-z]+/.test(e))return e;return e.toLowerCase()}(e.nodeName),function(e,t){const r={key:t};if(e instanceof Element){const t=e.getAttribute("class");t&&(r.className=t),[...e.attributes].forEach((e=>{switch(e.name){case"class":break;case"style":r[e.name]=i(e.value);break;case"allowfullscreen":case"allowpaymentrequest":case"async":case"autofocus":case"autoplay":case"checked":case"controls":case"default":case"defer":case"disabled":case"formnovalidate":case"hidden":case"ismap":case"itemscope":case"loop":case"multiple":case"muted":case"nomodule":case"novalidate":case"open":case"readonly":case"required":case"reversed":case"selected":case"typemustmatch":r[o[e.name]||e.name]=!0;break;default:r[o[e.name]||e.name]=e.value}}))}return r}(e,r),l(e.childNodes,s,u));case 3:{const t=e.nodeValue?.toString()??"";if(!u.allowWhiteSpaces&&/^\s+$/.test(t)&&!/[\u00A0\u202F]/.test(t))return null;if(!e.parentNode)return t;const r=e.parentNode.nodeName.toLowerCase();return a.includes(r)?(/\S/.test(t)&&console.warn(`A textNode is not allowed inside '${r}'. Your text "${t}" will be ignored`),null):t}case 8:default:return null;case 11:return l(e.childNodes,s,t)}}function l(e,t,r){const n=[...e].map(((e,n)=>u(e,{...r,index:n,level:t+1}))).filter(Boolean);return n.length?n:null}function u(e,t={}){if(!(e&&e instanceof Node))return null;const{actions:r=[],index:n=0,level:i=0,randomKey:a}=t;let o=e,l=`${i}-${n}`;const u=[];return a&&0===i&&(l=`${function(e=6){const t="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";let r="";for(let n=e;n>0;--n)r+=t[Math.round(61*Math.random())];return r}()}-${l}`),Array.isArray(r)&&r.forEach((t=>{t.condition(o,l,i)&&("function"==typeof t.pre&&(o=t.pre(o,l,i),o instanceof Node||(o=e)),"function"==typeof t.post&&u.push(t.post(o,l,i)))})),u.length?u:s(o,{key:l,level:i,...t})}function c(e,t={}){return"string"==typeof e?function(e,t={}){if(!e||"string"!=typeof e)return null;const{includeAllNodes:r=!1,nodeOnly:n=!1,selector:i="body > *",type:a="text/html"}=t;try{const o=(new DOMParser).parseFromString(e,a);if(r){const{childNodes:e}=o.body;return n?e:[...e].map((e=>u(e,t)))}const s=o.querySelector(i)||o.body.childNodes[0];if(!(s instanceof Node))throw new TypeError("Error parsing input");return n?s:u(s,t)}catch(e){}return null}(e,t):e instanceof Node?u(e,t):null}var d=r(2540),h=Object.defineProperty,p=(e,t,r)=>(((e,t,r)=>{t in e?h(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r})(e,"symbol"!=typeof t?t+"":t,r),r),f="react-inlinesvg",m={IDLE:"idle",LOADING:"loading",LOADED:"loaded",FAILED:"failed",READY:"ready",UNSUPPORTED:"unsupported"};function g(){return!("undefined"==typeof window||!window.document||!window.document.createElement)}function v(){return function(){if(!document)return!1;const e=document.createElement("div");e.innerHTML="";const t=e.firstChild;return!!t&&"http://www.w3.org/2000/svg"===t.namespaceURI}()&&"undefined"!=typeof window&&null!==window}async function y(e,t){const r=await fetch(e,t),n=r.headers.get("content-type"),[i]=(n??"").split(/ ?; ?/);if(r.status>299)throw new Error("Not found");if(!["image/svg+xml","text/plain"].some((e=>i.includes(e))))throw new Error(`Content type isn't valid: ${i}`);return r.text()}function b(e=1){return new Promise((t=>{setTimeout(t,1e3*e)}))}var w,S=class{constructor(){p(this,"cacheApi"),p(this,"cacheStore"),p(this,"subscribers",[]),p(this,"isReady",!1),this.cacheStore=new Map;let e=f,t=!1;g()&&(e=window.REACT_INLINESVG_CACHE_NAME??f,t=!!window.REACT_INLINESVG_PERSISTENT_CACHE&&"caches"in window),t?caches.open(e).then((e=>{this.cacheApi=e,this.isReady=!0,this.subscribers.forEach((e=>e()))})).catch((e=>{this.isReady=!0,console.error(`Failed to open cache: ${e.message}`)})):this.isReady=!0}onReady(e){this.isReady?e():this.subscribers.push(e)}async get(e,t){return await(this.cacheApi?this.fetchAndAddToPersistentCache(e,t):this.fetchAndAddToInternalCache(e,t)),this.cacheStore.get(e)?.content??""}set(e,t){this.cacheStore.set(e,t)}isCached(e){return this.cacheStore.get(e)?.status===m.LOADED}async fetchAndAddToInternalCache(e,t){const r=this.cacheStore.get(e);if(r?.status!==m.LOADING){if(!r?.content){this.cacheStore.set(e,{content:"",status:m.LOADING});try{const r=await y(e,t);this.cacheStore.set(e,{content:r,status:m.LOADED})}catch(t){throw this.cacheStore.set(e,{content:"",status:m.FAILED}),t}}}else await this.handleLoading(e,(async()=>{this.cacheStore.set(e,{content:"",status:m.IDLE}),await this.fetchAndAddToInternalCache(e,t)}))}async fetchAndAddToPersistentCache(e,t){const r=this.cacheStore.get(e);if(r?.status===m.LOADED)return;if(r?.status===m.LOADING)return void await this.handleLoading(e,(async()=>{this.cacheStore.set(e,{content:"",status:m.IDLE}),await this.fetchAndAddToPersistentCache(e,t)}));this.cacheStore.set(e,{content:"",status:m.LOADING});const n=await(this.cacheApi?.match(e));if(n){const t=await n.text();this.cacheStore.set(e,{content:t,status:m.LOADED})}else try{await(this.cacheApi?.add(new Request(e,t)));const r=await(this.cacheApi?.match(e)),n=await(r?.text())??"";this.cacheStore.set(e,{content:n,status:m.LOADED})}catch(t){throw this.cacheStore.set(e,{content:"",status:m.FAILED}),t}}async handleLoading(e,t){let r=0;for(;this.cacheStore.get(e)?.status===m.LOADING&&r<10;)await b(.1),r+=1;r>=10&&await t()}keys(){return[...this.cacheStore.keys()]}data(){return[...this.cacheStore.entries()].map((([e,t])=>({[e]:t})))}async delete(e){this.cacheApi&&await this.cacheApi.delete(e),this.cacheStore.delete(e)}async clear(){if(this.cacheApi){const e=await this.cacheApi.keys();for(const t of e)await this.cacheApi.delete(t)}this.cacheStore.clear()}};function x(e){const t=(0,n.useRef)();return(0,n.useEffect)((()=>{t.current=e})),t.current}function O(e){const{baseURL:t,content:r,description:n,handleError:i,hash:a,preProcessor:o,title:s,uniquifyIDs:l=!1}=e;try{const e=function(e,t){if(t)return t(e);return e}(r,o),i=c(e,{nodeOnly:!0});if(!(i&&i instanceof SVGSVGElement))throw new Error("Could not convert the src to a DOM Node");const u=_(i,{baseURL:t,hash:a,uniquifyIDs:l});if(n){const e=u.querySelector("desc");e?.parentNode&&e.parentNode.removeChild(e);const t=document.createElementNS("http://www.w3.org/2000/svg","desc");t.innerHTML=n,u.prepend(t)}if(void 0!==s){const e=u.querySelector("title");if(e?.parentNode&&e.parentNode.removeChild(e),s){const e=document.createElementNS("http://www.w3.org/2000/svg","title");e.innerHTML=s,u.prepend(e)}}return u}catch(e){return i(e)}}function _(e,t){const{baseURL:r="",hash:n,uniquifyIDs:i}=t,a=["id","href","xlink:href","xlink:role","xlink:arcrole"],o=["href","xlink:href"];return i?([...e.children].forEach((e=>{if(e.attributes?.length){const t=Object.values(e.attributes).map((e=>{const t=e,i=/url\((.*?)\)/.exec(e.value);return i?.[1]&&(t.value=e.value.replace(i[0],`url(${r}${i[1]}__${n})`)),t}));a.forEach((e=>{const r=t.find((t=>t.name===e));var i,a;r&&(i=e,a=r.value,!o.includes(i)||!a||a.includes("#"))&&(r.value=`${r.value}__${n}`)}))}return e.children.length?_(e,t):e})),e):e}function E(e){const{cacheRequests:t=!0,children:r=null,description:i,fetchOptions:a,innerRef:o,loader:s=null,onError:l,onLoad:u,src:d,title:h,uniqueHash:p}=e,[f,b]=(0,n.useReducer)(((e,t)=>({...e,...t})),{content:"",element:null,isCached:t&&w.isCached(e.src),status:m.IDLE}),{content:S,element:_,isCached:E,status:k}=f,C=x(e),T=x(f),A=(0,n.useRef)(p??function(e){const t="abcdefghijklmnopqrstuvwxyz",r=`${t}${t.toUpperCase()}1234567890`;let n="";for(let t=0;t{R.current&&(b({status:"Browser does not support SVG"===e.message?m.UNSUPPORTED:m.FAILED}),l?.(e))}),[l]),j=(0,n.useCallback)(((e,t=!1)=>{R.current&&b({content:e,isCached:t,status:m.LOADED})}),[]),I=(0,n.useCallback)((async()=>{const e=await y(d,a);j(e)}),[a,j,d]),L=(0,n.useCallback)((()=>{try{const t=c(O({...e,handleError:P,hash:A.current,content:S}));if(!t||!(0,n.isValidElement)(t))throw new Error("Could not convert the src to a React element");b({element:t,status:m.READY})}catch(e){P(new Error(e.message))}}),[S,P,e]),M=(0,n.useCallback)((async()=>{const e=/^data:image\/svg[^,]*?(;base64)?,(.*)/u.exec(d);let r;if(e?r=e[1]?window.atob(e[2]):decodeURIComponent(e[2]):d.includes("{R.current&&b({content:"",element:null,isCached:!1,status:m.LOADING})}),[]);(0,n.useEffect)((()=>{if(R.current=!0,!g()||D.current)return()=>{};try{if(k===m.IDLE){if(!v())throw new Error("Browser does not support SVG");if(!d)throw new Error("Missing src");N()}}catch(e){P(e)}return D.current=!0,()=>{R.current=!1}}),[]),(0,n.useEffect)((()=>{if(g()&&C)if(C.src!==d){if(!d)return void P(new Error("Missing src"));N()}else C.title===h&&C.description===i||L()}),[i,L,P,N,C,d,h]),(0,n.useEffect)((()=>{T&&(T.status!==m.LOADING&&k===m.LOADING&&M(),T.status!==m.LOADED&&k===m.LOADED&&L(),T.status!==m.READY&&k===m.READY&&u?.(d,E))}),[M,L,E,u,T,d,k]);const F=function(e,...t){const r={};for(const n in e)({}).hasOwnProperty.call(e,n)&&(t.includes(n)||(r[n]=e[n]));return r}(e,"baseURL","cacheRequests","children","description","fetchOptions","innerRef","loader","onError","onLoad","preProcessor","src","title","uniqueHash","uniquifyIDs");return g()?_?(0,n.cloneElement)(_,{ref:o,...F}):[m.UNSUPPORTED,m.FAILED].includes(k)?r:s:s}function k(e){w||(w=new S);const{loader:t}=e,r=(0,n.useRef)(!1),[i,a]=(0,n.useState)(w.isReady);return(0,n.useEffect)((()=>{r.current||(w.onReady((()=>{a(!0)})),r.current=!0)}),[]),i?(0,d.jsx)(E,{...e}):t}},4120:(e,t,r)=>{"use strict";r.d(t,{AQ:()=>d,C6:()=>i,Ju:()=>s,N3:()=>c,YH:()=>o,fX:()=>u,sH:()=>a,xN:()=>h,zs:()=>l});var n=function(e,t){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},n(e,t)};function i(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function a(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{l(n.next(e))}catch(e){a(e)}}function s(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}l((n=n.apply(e,t||[])).next())}))}function o(e,t){var r,n,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(l){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,n=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function l(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,a=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o}function u(e,t,r){if(r||2===arguments.length)for(var n,i=0,a=t.length;i1||s(e,t)}))},t&&(n[e]=t(n[e])))}function s(e,t){try{(r=i[e](t)).value instanceof c?Promise.resolve(r.value.v).then(l,u):d(a[0][2],r)}catch(e){d(a[0][3],e)}var r}function l(e){s("next",e)}function u(e){s("throw",e)}function d(e,t){e(t),a.shift(),a.length&&s(a[0][0],a[0][1])}}function h(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=s(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,i){(function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)})(n,i,(t=e[r](t)).done,t.value)}))}}}Object.create;"function"==typeof SuppressedError&&SuppressedError}}]); //# sourceMappingURL=350.js.map