@reltio/segmentation 1.4.175 → 1.4.176
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/18.bundle.js +1 -0
- package/735.bundle.js +2 -0
- package/bundle.js +1 -1
- package/package.json +3 -3
- package/185.bundle.js +0 -1
- package/342.bundle.js +0 -2
- /package/{185.css → 18.css} +0 -0
- /package/{342.bundle.js.LICENSE.txt → 735.bundle.js.LICENSE.txt} +0 -0
package/185.bundle.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_reltio_segmentation=self.webpackChunk_reltio_segmentation||[]).push([[185],{73185:(e,t,r)=>{r.r(t),r.d(t,{ConfigureColumnsButton:()=>$d,DEFAULT_SEARCH_SELECT:()=>B.Tv,EntitiesTableWithConfigurableColumns:()=>_f,EntityAvatar:()=>b.A,ROWS_PER_PAGE_OPTIONS:()=>B.Tu,buildQueryForAdvancedSearchGroups:()=>Na.Jk,buildSelectFromColumns:()=>Di.vw,collectSpecialColumns:()=>Di.oX,createRecentSearch:()=>Ps,default:()=>zZ,getActiveEntityTypeTab:()=>ki.tB,getAdditionalColumns:()=>Di.oq,getDataTenant:()=>ai.lF,getEntityTypeLabel:()=>v.getEntityTypeLabel,getEntityTypeTab:()=>ki.o4,getModule:()=>Ap,getPage:()=>ai.fx,getRowsPerPage:()=>ai.Uz,getSearchResultsMode:()=>ki.XM,getSearchUrlQuery:()=>_o.Cc,getSerializedSearchState:()=>No.Z,getTotal:()=>ai.NU,needRequestAfterColumnsChanges:()=>Di.tU,parseSearchState:()=>Fs.Z,queryBuilderHelpers:()=>n,queryBuilderSagas:()=>a,replaceSearchResultsColumns:()=>Fs.f,showMoreResultsForEntityTypeAction:()=>Wa,showSavedSearchesDialogAction:()=>bi});var n={};r.r(n),r.d(n,{PROP_NAME_FILTER:()=>dt,PROP_NAME_OPERATOR:()=>ut,PROP_NAME_VALUES:()=>pt,addAttributeAfter:()=>St,changeAttributeData:()=>xt,createGetAttributeIndex:()=>bt,createGetAttributeLens:()=>vt,createGetAttributeProp:()=>Ot,createGetAttributesLens:()=>Et,createGetGroupLens:()=>ht,createSetAttributeProp:()=>Tt,defaultFindGroupPath:()=>gt,deleteAttribute:()=>wt,duplicateAttribute:()=>At,getAttributeData:()=>yt,getAttributeObject:()=>ft,getEmptyAttributeObject:()=>mt,setAttributeOperator:()=>Ct,setFilter:()=>Rt,setValues:()=>_t});var a={};r.r(a),r.d(a,{toggleQueryBuilderAttributeSelect:()=>dl});var i={};r.r(i),r.d(i,{addAttributes:()=>Ib,addDefaultValuesAction:()=>Nb,addNextPageOfAttributeValues:()=>kb,cancelProfileValidation:()=>zb,modifyAttribute:()=>Pb,processNextPageOfAttributeValues:()=>Lb,profileSaved:()=>Vb,removeAttribute:()=>Db,requestNextPageOfAttributeValues:()=>Ub,runAuthoringTaskAction:()=>Fb,saveDraft:()=>Mb,saveProfile:()=>jb,validateProfile:()=>Bb});var o={};r.r(o),r.d(o,{dependentLookupsEditorTouched:()=>qb,dependentLookupsEditorsBlocked:()=>Gb,dependentLookupsInitedTypeUrisAdded:()=>Wb,dependentLookupsStructureSet:()=>Yb});var l={};r.r(l),r.d(l,{activityFilterUpdated:()=>dv,globalFilterUpdated:()=>mv,keywordUpdated:()=>cv,saveState:()=>pv,searchResultsSet:()=>sv,setSearchNavigationData:()=>hv,setSearchOptionsConfig:()=>yv,setSearchProviderData:()=>gv,updateSearchNavigationDataFields:()=>Ev,updateSearchNavigationDataOnMerge:()=>bv,updateSearchOptions:()=>fv,updateState:()=>uv});var s={};r.r(s),r.d(s,{addDashboardExternalView:()=>oT,autocloseIntervalLoaded:()=>Bv,clearNotifications:()=>Lv,closeNotification:()=>kv,dateMaskUpdated:()=>Zv,dateTimeMaskUpdated:()=>$v,documentationSet:()=>iT,entityDeletionFinished:()=>Nv,errorSet:()=>aT,keysSet:()=>rT,localeAttributePresentationLoaded:()=>Vv,localizationLoaded:()=>qv,navigateTo:()=>tT,newEntityShown:()=>Iv,newUiConfigLoaded:()=>Mv,numberFormatUpdated:()=>Hv,openAppFromChocolateBar:()=>Wv,openConsoleApp:()=>Yv,openDashboard:()=>Xv,openEntity:()=>_v,openGraph:()=>Gv,openHistoryEvent:()=>Qv,openNewEntityWithAuthoring:()=>Jv,openPerspective:()=>Pv,openPivotingPerspective:()=>nT,openPreviousPage:()=>eT,openSearch:()=>Kv,pathsSet:()=>Uv,setPreferReact:()=>zv,setUseSharedPreferences:()=>lT,showNotification:()=>Dv,uiConfigLoaded:()=>Fv,uiPathSet:()=>jv});var c={};r.r(c),r.d(c,{getAbsoluteImagePath:()=>px,getActiveErrorsForAttributesPager:()=>dS,getActivityFilter:()=>YS,getAdminToolsPath:()=>bS,getAiAssistantEnabled:()=>jS,getAiAssistantHistoryBufferSize:()=>VS,getAiAssistantLimitPerDay:()=>FS,getAiAssistantSkills:()=>MS,getAllRelationsToAddAndEdit:()=>ox,getAllRelationsToSave:()=>lx,getAllServicesPaths:()=>Px,getAllTreesEditingConnections:()=>vx,getApiPath:()=>fS,getAttributeTypeErrors:()=>uS,getAttributesErrors:()=>pS,getAttributesPresentation:()=>vS,getAttributesSortingStrategy:()=>HC,getAuthoringByEntityType:()=>WC,getAutoCloseInterval:()=>SS,getCanSuggestAuthoring:()=>QC,getCanUserCreateWorkflowConfigJar:()=>Vx,getCanUserCreateWorkflowEnvironmentConfigJar:()=>Bx,getCanUserDeleteProfiles:()=>cC,getCanUserExecuteWorkflowJobs:()=>zx,getCanUserExecuteWorkflowJobsSyncBusinessProcessData:()=>Hx,getCanUserExecuteWorkflowJobsTerminateProcessInstance:()=>Yx,getCanUserExecuteWorkflowJobsUpdateTasks:()=>Wx,getCanUserExecuteWorkflowJobsValidateTasks:()=>Gx,getCanUserGetDQStatistic:()=>pC,getCanUserImportEntitiesFromDT:()=>iC,getCanUserMakeActivitiesExport:()=>aC,getCanUserMakeBulkUpdate:()=>sC,getCanUserMakeExport:()=>nC,getCanUserManageWorkflowDefinition:()=>qx,getCanUserManageWorkflowEnvironmentDefinition:()=>Zx,getCanUserOpenDataLoader:()=>uC,getCanUserReadDVF:()=>dC,getCanUserReadEntitiesFromDT:()=>oC,getCanUserReadWorkflowDataTask:()=>$x,getCanUserRegisterConfigEnvironments:()=>Mx,getCanUserStartProcessFromQuery:()=>lC,getCanUserUpdateProcessInstance:()=>Kx,getCanUserUpdateWorkflowDataTask:()=>Xx,getCanUserViewProcessInstanceSearchQuery:()=>Qx,getCanUserViewWorkflowConfigJar:()=>Jx,getCanUserViewWorkflowDefinition:()=>eC,getCanUserViewWorkflowEnvironmentConfigJar:()=>tC,getCanUserViewWorkflowJobs:()=>rC,getCheckIfCanAddRelations:()=>_C,getCleanseByEntityType:()=>GC,getCollaborationPath:()=>Lx,getConnectionsByViewId:()=>WO,getConnectionsTemporaryUrisForCreation:()=>KO,getConnectionsWithDraftsByViewId:()=>ZO,getControlAttributes:()=>XC,getDBConnectorSideViews:()=>TC,getDVFPath:()=>Ux,getDataTenants:()=>DO,getDateMask:()=>xS,getDateTimeMask:()=>CS,getDependentLookupEditorState:()=>AC,getDependentLookupEditorsState:()=>wC,getDependentLookups:()=>OC,getDependentLookupsInitedTypeUris:()=>CC,getDependentLookupsStructure:()=>SC,getDependentLookupsStructureNode:()=>xC,getDocReleaseNotes:()=>FC,getDraftsForSaveByViewId:()=>$O,getDtssPath:()=>_x,getEditingOrAddingConnectionByViewIdAndRelationUri:()=>GO,getEditingOrAddingConnectionRelationObjectByViewIdAndRelationUri:()=>qO,getEntity:()=>zO,getEntityRelatedAttributesByAttributeTypeUri:()=>cS,getEntityUri:()=>HO,getEntityUriWithDataTenant:()=>YO,getEntityWithDiff:()=>IC,getEntityWithoutDiff:()=>NC,getEnvironment:()=>Ax,getEnvironmentAlias:()=>Rx,getEnvironmentObject:()=>jO,getExportDQPath:()=>Ix,getExportPath:()=>yS,getGlobalFilter:()=>KS,getGlobalFilterQuery:()=>XS,getGlobalFilterSavedSearchesUris:()=>QS,getGlobalSearchRequestOptions:()=>ZS,getGoogleMapKey:()=>NS,getHeaderColor:()=>VC,getHiddenAttributes:()=>KC,getHistoryDiff:()=>tS,getHistoryEvent:()=>rS,getHistoryMode:()=>iS,getHistorySlice:()=>nS,getIcpLicenseKey:()=>PS,getImageAttributesFieldsOrder:()=>_S,getImagePath:()=>mS,getImageServicePath:()=>ES,getInitialConnection:()=>cx,getInitialConnectionTempEntity:()=>sx,getIsAuthoringMode:()=>ZC,getIsEditableMode:()=>ex,getIsHistoryModeEnabled:()=>aS,getIsSuggestMode:()=>rx,getIsViewMode:()=>tx,getLogo:()=>MC,getLookupAutocomplete:()=>IS,getLookups:()=>QO,getMaxValuesInResponse:()=>OS,getMetadata:()=>LO,getMlDqPath:()=>Fx,getMode:()=>JS,getModifiedEntities:()=>sS,getModifiedEntity:()=>oS,getModifiedEntityDefaultProfilePic:()=>lS,getNewTreeEnabled:()=>qC,getNotifications:()=>AS,getPivotingAttributes:()=>RS,getProfile:()=>VO,getProfileCancelNeedConfirm:()=>xx,getProfileCheckUpdate:()=>YC,getProfileErrors:()=>JO,getProfileLastLoadedTime:()=>Tx,getProfileOperation:()=>Ox,getProfileViews:()=>Sx,getQueryEstimatorEnabled:()=>$C,getRelationToAddByViewId:()=>ax,getRelations:()=>nx,getRelationsToEditByViewId:()=>ix,getRelationsViewIds:()=>eS,getReleaseVersion:()=>jC,getReltioPath:()=>hS,getRequestProviderConfiguration:()=>wS,getSearch:()=>BO,getSearchKeyword:()=>HS,getSearchNavigationData:()=>qS,getSearchOptions:()=>WS,getSearchProviderData:()=>GS,getSearchResults:()=>zS,getServicesPath:()=>PC,getSharedPreferencesEnabled:()=>BS,getShowAttributeDescription:()=>zC,getShowEntityId:()=>UC,getShowSearchByOv:()=>BC,getStringifiedSearchOptions:()=>$S,getTenant:()=>Cx,getTenantName:()=>wx,getTenantObject:()=>UO,getTenants:()=>kO,getTotalByViewId:()=>XO,getTree:()=>yx,getTreeCommands:()=>Ex,getTreeEditingConnection:()=>bx,getTreeRoot:()=>gx,getTreeTotal:()=>hx,getTrees:()=>fx,getUIConfig:()=>DC,getUIConfigLayout:()=>kC,getUIConfigProfile:()=>LC,getUIPath:()=>gS,getUi:()=>MO,getUiError:()=>RC,getUiNumberFormat:()=>TS,getUser:()=>FO,getUserName:()=>dx,getUserRoles:()=>mx,getValidateReadMode:()=>kS,getValidateReferenceEntityInReadMode:()=>US,getValidateRelations:()=>LS,getValidationServicePath:()=>jx,getValidationServiceSeverityLevels:()=>DS,getViewIdsForOpenRelation:()=>ux,getWorkflowConfigurationEnabled:()=>kx,getWorkflowEnvironmentUrl:()=>Dx,getWorkflowPath:()=>Nx,isCollaborationEnabled:()=>mC,isCollaborationSideViewEnabled:()=>EC,isDBConnectorSideViewEnabled:()=>vC,isHistorySideViewEnabled:()=>bC,isWorkflowEnabled:()=>fC,isWorkflowSideViewEnabled:()=>hC});var u={};r.r(u),r.d(u,{authoringDcrResolved:()=>_w,authoringDraftEntitiesLoaded:()=>Rw,clearEntity:()=>Pw,entityCloneRequested:()=>Nw,entityCreationRequested:()=>ww,entityCreationWithAuthoringRequested:()=>Aw,entityLoaded:()=>Sw,entityRemoveRequested:()=>Iw,loadEntity:()=>Cw,setDefaultProfilePic:()=>xw});var p={};r.r(p),r.d(p,{errorDeactivated:()=>Fw,errorsSet:()=>Mw});var d={};r.r(d),r.d(d,{clearHistoryDiff:()=>Yw,clearHistoryEvent:()=>Gw,setHistoryDiff:()=>Hw,setHistoryEvent:()=>Ww,setHistoryMode:()=>Zw,setHistorySlice:()=>qw});var m={};r.r(m),r.d(m,{lookupsForTypeResolved:()=>tA,lookupsListResolved:()=>rA,lookupsLoaded:()=>eA});var f={};r.r(f),r.d(f,{modeEditingCanceled:()=>sA,modeUpdateRequested:()=>lA,modeUpdated:()=>oA});var y={};r.r(y),r.d(y,{cleanseLoading:()=>hA,entityCreated:()=>mA,entityDeleted:()=>fA,modifiedEntitiesReset:()=>gA,setDefaultProfilePic:()=>yA});var g={};r.r(g),r.d(g,{addRelation:()=>PA,closeRelationEditor:()=>UA,editRelation:()=>DA,ignoreRelation:()=>NA,openRelationEditor:()=>LA,relationsLoaded:()=>RA,removeRelation:()=>IA,secondLevelRelationsLoaded:()=>_A,setInitialInfo:()=>MA,setRelationEntity:()=>FA,setRelationType:()=>jA,updateRelationRating:()=>kA});var h={};r.r(h),r.d(h,{hiddenAttributesReset:()=>_I,hiddenAttributesUpdated:()=>RI});var E={};r.r(E),r.d(E,{controlAttributesUpdated:()=>PI}),r(69448);var b=r(68269),v=r(2396),T=r(75580),O=r(73288),S=r(62391),x=r(9400),C=r(8523),w=r(42308),A=r.n(w),R=r(61882),_=r(26040),I=r(5950);function N(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){P(e,t,r[t])}))}return e}function P(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const D={facetsConfigs:[],facetsData:{},recommendedFacets:[],addedFacets:[]},k=(0,S.Ic)("facetsConfigs"),L=(0,S.Ic)("facetsData"),U=(0,S.Ic)("recommendedFacets"),j=(0,S.Ic)("addedFacets"),F=(e,t,r)=>Object.keys(e).reduce(((t,n)=>(0,O.prop)(n,t)?(0,S.ET)(n,r).set(t,e[n]):t),N({},t)),M=({state:e,facetsConfigs:t,addToEnd:r=!1,facetsData:n={}})=>{const a=t.filter((e=>e.fieldName)),i=k.get(e),o=k.set(e,r?i.concat(a):a.concat(i)),l=L.get(e),s=a.reduce(((e,t)=>N({},e,{[t.fieldName]:(0,x.DV)(t.fieldName,n[t.fieldName])})),N({},l));return L.set(o,s)},V=(e=D,t)=>{switch(t.type){case R.k.CREATE_FACETS:{const{facetsConfigs:r,addToEnd:n}=t.payload;return M({state:e,facetsConfigs:r,addToEnd:n})}case w.search.constants.UPDATE_STATE:{const{facetsConfigs:e=[],facetsData:r={}}=t.payload.facets||{facetsConfigs:[]};return M({state:D,facetsConfigs:e,facetsData:r})}case R.k.DESTROY_FACETS:return((e,t)=>{const r=L.get(e),n=k.get(e),a=N({},r);t.forEach((e=>{delete a[e]}));const i=L.set(e,a);return k.set(i,n.filter((e=>!t.includes(e.fieldName))))})(e,t.payload||[]);case R.k.CHANGE_VALUES:{const{facetFieldName:r,values:n}=t.payload;return(({facetFieldName:e,values:t,state:r})=>{const n=[...(0,C.jK)(e),"values"];return(0,S.ET)(...n).set(r,t)})({facetFieldName:r,values:n,state:e})}case R.k.SHOW_MORE_ENTITY_TYPES:{const{show:r}=t.payload,n="type",a=(0,C.jK)(n);if(r)return(0,S.ET)(...a,"showAllItems").set(e,r);{const t=(0,S.ET)(...a);return t.set(e,(0,O.omit)(["showAllItems"],t.get(e)))}}case R.k.CLEAR_ALL_VALUES:case _.Z.CLEAR_ALL:{const t=L.get(e),r=Object.keys(t).reduce(((e,t)=>N({},e,{[t]:[]})),{}),n=F(r,t,"values");return L.set(e,n)}case R.k.UPDATE_DATA:{const r=t.payload||{},n=L.get(e),a=F(r,n,"data");return L.set(e,a)}case R.k.UPDATE_FILTERED_DATA:{const r=t.payload||{},n=L.get(e),a=F(r,n,"filteredData");return L.set(e,a)}case R.k.DESTROY_FILTERED_DATA:{const r=t.payload||{},n=(0,C.jK)(r);if((0,O.path)(n,e)){const t=(0,S.ET)(...n),r=N({},t.get(e));if(r.filteredData)return delete r.filteredData,t.set(e,r)}break}case R.k.SET_RECOMMENDED_FACETS_LIST:return U.set(e,t.payload||[]);case R.k.HIGHLIGHT_ADDED_FACETS:return j.set(e,t.payload);case R.k.CLEAR_HIGHLIGHT_ADDED_FACETS:return j.set(e,[]);case"UI_RESET":return N({},D);case _.Z.CHANGE_CURRENT_TENANT:{const{isDataTenant:r,tenantObject:n}=t.payload;if(r){const t=k.get(e),r=L.get(e),a=(0,I.ci)(n,t),i=(0,O.pluck)("fieldName",a),o=(0,O.pipe)((0,O.pick)(i),(0,I.AZ)(n))(r);return L.set(k.set(e,a),o)}return e}}return e};var B=r(33950);function z(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){H(e,t,r[t])}))}return e}function H(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Y={searchResults:null,searchResultsByEntityTypes:{},total:0,page:0,sortField:null,sortOrder:null,rowsPerPage:B.Tu[0],loading:!1,searchParams:{searchBoxInput:{fieldName:"attributes",filter:"containsWordStartingWith"},mapSearch:{fieldName:"geoLocation",type:"geoLocation",filter:"range",values:[]}},currentTenant:null},W=(0,S.Ic)("searchResults"),G=(0,S.Ic)("total"),q=(0,S.Ic)("page"),Z=(0,S.Ic)("rowsPerPage"),$=(0,S.Ic)("sortField"),K=(0,S.Ic)("sortOrder"),X=(0,S.Ic)("loading"),Q=(0,S.ET)("searchParams","mapSearch","values"),J=(0,S.ET)("searchParams","mapSearch","type"),ee=(0,S.ET)("searchParams","mapSearch","fieldName"),te=(0,S.Ic)("searchResultsByEntityTypes"),re=e=>te.compose((0,S.ET)(e,"page")),ne=({entityTypeUri:e,field:t,order:r},n)=>{if(e){const a=te.compose((0,S.ET)(e,"sortField")),i=te.compose((0,S.ET)(e,"sortOrder")),o=a.set(n,t);return i.set(o,r)}{const e=$.set(n,t);return K.set(e,r)}},ae=(e=Y,t)=>{switch(t.type){case _.Z.UPDATE_ENTITIES:{const{searchResults:r,entityTypeUri:n}=t.payload;return n?te.compose((0,S.ET)(n,"searchResults")).set(e,r):W.set(e,r)}case _.Z.UPDATE_TOTAL:return G.set(e,t.payload);case _.Z.CHANGE_PAGE:{const{entityTypeUri:r,pageNumber:n}=t.payload;return r?re(r).set(e,n):q.set(e,n)}case _.Z.RESET_PAGE:{const{entityTypeUri:r}=t.payload,n=q.set(e,0);return r?re(r).set(n,0):n}case _.Z.CHANGE_ROWS_PER_PAGE:{const{entityTypeUri:r,number:n}=t.payload;if(r){const t=te.compose((0,S.ET)(r,"rowsPerPage")),a=re(r).set(e,0);return t.set(a,n)}{const t=q.set(e,0);return Z.set(t,n)}}case _.Z.CHANGE_SORT:return ne(t.payload,e);case _.Z.CHANGE_LOADING:return X.set(e,t.payload);case w.search.constants.UPDATE_STATE:{const{values:r=[],searchType:n=v.MapSearch.geoPolygon}=t.payload.map||{};let a=Q.set(Y,r);if(a=J.set(a,n),a=ee.set(a,(0,v.mapSearchTypeToFieldName)(n)),t.payload.view){const{entityTypeTab:e,sortField:r,sortOrder:n}=t.payload.view;a=ne({entityTypeUri:e,field:r,order:n},a)}return z({},a,{currentTenant:t.payload.currentTenant||e.currentTenant,searchOptions:t.payload.searchOptions||e.searchOptions})}case"UI_RESET":return z({},Y);case _.Z.MAP_CHANGE_VALUE:{const{value:r,searchType:n}=t.payload;let a=J.set(e,n);return a=ee.set(a,(0,v.mapSearchTypeToFieldName)(n)),Q.set(a,r?[r]:[])}case _.Z.CLEAR_RESULTS:{const r=t.payload;if(r){let t=W.set(e,void 0);const n=te.get(e);return te.set(t,{[r]:n[r]})}return te.set(e,{})}case _.Z.CLEAR_ALL:return Q.set(e,[]);case _.Z.CHANGE_CURRENT_TENANT:return z({},e,{currentTenant:t.payload.tenantObject.id})}return e},ie="UI_SHOW_MORE_FACETS_POPUP",oe="UI_SHOW_SAVED_SEARCHES_DIALOG",le="UI_SHOW_SAVE_SEARCH_DIALOG",se="UI_SHOW_ADVANCED_SEARCH",ce="UI_SHOW_BULK_UPDATE",ue="UI_SET_MARKER",pe="UI_SET_HOVERED_ENTITY_URI",de="UI_SET_SEARCH_RESULTS_COLUMNS",me="UI_CHANGE_SEARCH_RESULTS_COLUMNS",fe="UI_SET_ENTITY_TYPE_TAB",ye="UI_UPDATE_TABLE_VIEW_TABS",ge="UI_CHANGE_ORDER_SEARCH_RESULTS_COLUMNS",he="UI_CHANGE_SIZES_SEARCH_RESULTS_COLUMNS",Ee="UI_CLEAR_NOTIFICATION",be="UI_SET_NOTIFICATION",ve="UI_SET_SEARCH_RESULTS_MODE",Te="UI_SET_PREVIEW_PANEL_MODE",Oe={showMoreFacetsPopup:!1,showSavedSearchesDialog:!1,showAdvancedSearch:!1,showSaveSearchDialog:!1,showBulkUpdate:!1,activeAdditionalSearch:null,activeMarker:null,hoveredEntityUri:null,searchResultsMode:null,previewPanelMode:null,searchResultsColumns:{},entityTypeTab:null,tableViewTabs:[],notification:null},Se=(0,S.Ic)("showMoreFacetsPopup"),xe=(0,S.Ic)("showSavedSearchesDialog"),Ce=(0,S.Ic)("showSaveSearchDialog"),we=(0,S.Ic)("showAdvancedSearch"),Ae=(0,S.Ic)("showBulkUpdate"),Re=(0,S.Ic)("activeAdditionalSearch"),_e=(0,S.Ic)("activeMarker"),Ie=(0,S.Ic)("hoveredEntityUri"),Ne=(0,S.Ic)("searchResultsMode"),Pe=(0,S.Ic)("previewPanelMode"),De=(0,S.Ic)("searchResultsColumns"),ke=(0,S.Ic)("entityTypeTab"),Le=(0,S.Ic)("tableViewTabs"),Ue=(0,S.Ic)("loading"),je=(0,S.Ic)("notification"),Fe=(e=Oe,t)=>{switch(t.type){case ie:return Se.set(e,t.payload);case oe:return xe.set(e,t.payload);case le:return Ce.set(e,t.payload.show);case se:return we.set(e,t.payload);case ce:return Ae.set(e,t.payload);case"UI_SET_ACTIVE_ADDITIONAL_SEARCH":{const r=Re.get(e)===t.payload?null:t.payload;return Re.set(e,r)}case ue:return _e.set(e,t.payload);case pe:return Ie.set(e,t.payload);case ve:return Ne.set(e,t.payload);case de:return De.set(e,t.payload);case me:{const{entityTypeUri:r,columns:n}=t.payload;return De.compose((0,S.Ic)(r)).set(e,n)}case he:{const{entityTypeUri:r,columns:n}=t.payload;return De.compose((0,S.Ic)(r)).set(e,n)}case ge:{const{entityTypeUri:r,columns:n}=t.payload;return De.compose((0,S.Ic)(r)).set(e,n)}case Te:return Pe.set(e,t.payload);case fe:return ke.set(e,t.payload.entityTypeUri);case ye:return Le.set(e,t.payload);case R.k.UPDATE_DATA:if((0,O.has)("type",t.payload))return Le.set(e,t.payload.type);break;case R.k.CHANGE_VALUES:{const{facetFieldName:r,values:n}=t.payload;if("type"===r&&n.length){const t=ke.get(e);if(!n.includes(t))return ke.set(e,n[0])}break}case"UI_RESET":return Oe;case"UI_SET_LOADING":return Ue.set(e,t.payload);case be:return je.set(e,t.payload);case Ee:return je.set(e,null);case w.search.constants.UPDATE_STATE:{let r=we.set(e,(0,O.has)("advanced",t.payload));if(t.payload.view){const{searchResultsMode:e,entityTypeTab:n,searchResultsColumns:a,previewPanelMode:i}=t.payload.view;r=Ne.set(r,e),r=ke.set(r,n),(0,v.isEmptyValue)(a)||(r=De.set(r,a)),r=Pe.set(r,i)}return t.payload.showSavedSearchesDialog&&(r=xe.set(r,t.payload.showSavedSearchesDialog)),r}}return e};var Me=r(37164);const Ve="ADVANCED_SEARCH_SET_GROUP_ENTITY_TYPES",Be="ADVANCED_SEARCH_VERIFY_GROUP_ENTITY_TYPES",ze="ADVANCED_SEARCH_SET_GROUP_OPERATOR",He="ADVANCED_SEARCH_DELETE_GROUP",Ye="ADVANCED_SEARCH_ADD_GROUP",We="ADVANCED_SEARCH_DUPLICATE_GROUP",Ge="ADVANCED_SEARCH_ADD_ATTRIBUTE_AFTER",qe="ADVANCED_SEARCH_CHANGE_ATTRIBUTE_DATA",Ze="ADVANCED_SEARCH_TOGGLE_ATTRIBUTE_SELECT",$e="ADVANCED_SEARCH_SET_ATTRIBUTE_OPERATOR",Ke="ADVANCED_SEARCH_DELETE_ATTRIBUTE",Xe="ADVANCED_DELETE_ATTRIBUTE_AND_VERIFY_GROUP_ENTITY_TYPES",Qe="ADVANCED_SEARCH_DUPLICATE_ATTRIBUTE",Je="ADVANCED_SEARCH_SET_FILTER",et="ADVANCED_SEARCH_SET_VALUES",tt="ADVANCED_SEARCH_ATTRIBUTE_SET_VALUES",rt="ADVANCED_SEARCH_ATTRIBUTE_FILTER_VALUES",nt="ADVANCED_SEARCH_ATTRIBUTE_SET_FILTERED_VALUES",at="ADVANCED_SEARCH_ATTRIBUTE_UPDATE_VALUES",it="ADVANCED_SEARCH_UPDATE",ot="ADVANCED_SEARCH_CONVERT_FROM_FACETS";var lt=r(81253);function st(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){ct(e,t,r[t])}))}return e}function ct(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ut="operator",pt="values",dt="filter",mt=(e=(0,Me.x0)())=>({[ut]:B.YL.value,id:e}),ft=(e,t=(0,Me.x0)())=>{const r=yt(e);return{data:r,[ut]:B.YL.value,[dt]:(0,O.pathOr)("",["filterOptions",0],r),id:t}},yt=e=>st({},e,{filterOptions:e.enforcedFilterOptions||(0,v.getFilterOptionsForQueryBuilder)(e.attrType,e.fieldName,!0)}),gt=(0,O.curry)(((e,t)=>{const r=t.findIndex((t=>t.id===e));return r>-1?[r]:null})),ht=(e,t=gt)=>(r,n)=>{const a=(0,S.ET)(...e).get(r),i=t(n,a);return!!i&&(0,S.ET)(...e,...i)},Et=(e,t)=>(r,n)=>{const a=e(r,n);return a&&a.compose((0,S.Ic)(t))},bt=e=>(t,r,n)=>{const a=e(t,r);return a?a.get(t).findIndex((e=>e.id===n)):-1},vt=e=>(t,r,n)=>{const a=e(t,r),i=bt(e)(t,r,n);return-1!==i?a.compose((0,S.ET)(i)):null},Tt=e=>(t,r,n,a,i)=>{const o=e(t,r,n);if(o){const e=st({},o.get(t));return e[a]=i,o.set(t,e)}return t},Ot=e=>(t,r,n,a)=>{const i=e(t,r,n);if(i)return i.get(t)[a]},St=({state:e,groupId:t,attributeId:r,attribute:n,getAttributesLens:a,getAttributeIndex:i})=>{const o=a(e,t);if(o){let a=[...o.get(e)];const l=i(e,t,r),s=!a[l+1];return-1!==l&&s?a.splice(l+1,0,n):-1!==l?(a.splice(l+1,0,st({},n,{operator:a[l].operator})),a[l]=st({},a[l],{operator:B.YL.value})):a.push(n),o.set(e,a)}return e},xt=({state:e,groupId:t,attributeId:r,attributeData:n,setAttributeProp:a,getAttributeLens:i})=>{let o=e;if(n)return((e,t,r,n,a)=>{const i=a(e,t,r);let o;return i&&(o=i.get(e).filter),n.filterOptions.length&&(!o||!n.filterOptions.includes(o))})(e,t,r,n,i)&&(o=a(e,t,r,dt,n.filterOptions[0])),o=a(o,t,r,pt,[]),a(o,t,r,"data",n);{const n=i(e,t,r);return n&&(o=n.set(o,mt(r))),o}},Ct=({state:e,groupId:t,attributeId:r,operator:n,setAttributeProp:a})=>a(e,t,r,ut,n),wt=({state:e,groupId:t,attributeId:r,getAttributesLens:n})=>{const a=n(e,t);if(a){const t=[...a.get(e)],n=t.findIndex((e=>e.id===r));if(n>-1){const r=(0,O.remove)(n,1,t),i=r[n-1],o=t[n];return i&&(r[n-1]=st({},i,{operator:o.operator})),a.set(e,r)}}return e},At=({state:e,groupId:t,attributeId:r,id:n,getAttributesLens:a})=>{const i=a(e,t);if(i){const t=[...i.get(e)],a=t.findIndex((e=>e.id===r));if(a>-1)return t.push(st({},t[a],{id:n})),i.set(e,t)}return e},Rt=({state:e,groupId:t,attributeId:r,filter:n,getAttributeProp:a,setAttributeProp:i})=>{const o=a(e,t,r,dt),l=(0,v.isCompatibleFilters)(o,n)?e:i(e,t,r,pt,[]);return i(l,t,r,dt,n)},_t=({state:e,groupId:t,attributeId:r,values:n,setAttributeProp:a})=>a(e,t,r,pt,n);function It(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Nt(e,t,r[t])}))}return e}function Nt(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Pt={groups:[]},Dt={},kt="entityTypes",Lt="attributes",Ut="autoAddedEntityTypes",jt=["groups"],Ft=(0,S.ET)(...jt),Mt=ht(jt),Vt=Et(Mt,Lt),Bt=bt(Vt),zt=vt(Vt),Ht=Tt(zt),Yt=Ot(zt),Wt=(e,t=[],r=(0,Me.x0)())=>({[Lt]:e.map((e=>ft(e))),[ut]:B.qx.value,[kt]:t,id:r}),Gt=(e=Dt,t)=>{switch(t.type){case nt:{const{groupId:r,attributeId:n,values:a}=t.payload;return(0,O.assocPath)([r,n,"filtered"],a,e)}case He:{const{groupId:r}=t.payload;return(0,O.dissoc)(r,e)}case Ke:{const{groupId:r,attributeId:n}=t.payload;return(0,O.dissocPath)([r,n],e)}case We:{const{groupId:r,id:n}=t.payload,a=e[r];return a?(0,O.assoc)(n,a,e):e}case Qe:{const{groupId:r,attributeId:n,id:a}=t.payload,i=(0,O.path)([r,n],e);return i?(0,O.assocPath)([r,a],i,e):e}case _.Z.CLEAR_ALL:case w.search.constants.UPDATE_STATE:return Dt;default:return e}},qt=(e=Pt,t)=>{switch(t.type){case Ye:{const{group:r}=t.payload,n=[...Ft.get(e)];return n.push(r),Ft.set(e,n)}case ze:{const{groupId:r,operator:n}=t.payload,a=Mt(e,r);if(a){const t=It({},a.get(e));return t[ut]=n,a.set(e,t)}return e}case Ve:{const{groupId:r,entityTypes:n}=t.payload,a=Mt(e,r);if(a){const t=It({},a.get(e));return t[kt]=n,t[Ut]=[],t[Lt]=[],a.set(e,t)}return e}case Be:{const{groupId:r}=t.payload,n=Mt(e,r);if(n){const t=n.get(e),{entityTypes:r,autoAddedEntityTypes:a}=(0,lt.tg)((0,lt.r8)(t[Lt]||[]),t[kt],t[Ut]);return n.set(e,It({},t,{[kt]:r,[Ut]:a}))}return e}case He:{const{groupId:r}=t.payload,n=[...Ft.get(e)],a=n.findIndex((e=>e.id===r));if(a>-1){const t=(0,O.remove)(a,1,n),r=t[a-1],i=n[a];return r&&(t[a-1]=It({},r,{operator:i.operator})),Ft.set(e,t)}return e}case We:{const{groupId:r,id:n}=t.payload,a=[...Ft.get(e)],i=a.findIndex((e=>e.id===r));return i>-1?(a.push(It({},a[i],{id:n})),Ft.set(e,a)):e}case Ge:{const{groupId:r,attributeId:n,attribute:a}=t.payload;return St({state:e,groupId:r,attributeId:n,attribute:a,getAttributesLens:Vt,getAttributeIndex:Bt})}case qe:{const{groupId:r,attributeId:n,attributeData:a}=t.payload;return xt({state:e,groupId:r,attributeId:n,attributeData:a,setAttributeProp:Ht,getAttributeLens:zt})}case $e:{const{groupId:r,attributeId:n,operator:a}=t.payload;return Ct({state:e,groupId:r,attributeId:n,operator:a,setAttributeProp:Ht})}case Ke:{const{groupId:r,attributeId:n}=t.payload;return wt({state:e,groupId:r,attributeId:n,getAttributesLens:Vt})}case Qe:{const{groupId:r,attributeId:n,id:a}=t.payload;return At({state:e,groupId:r,attributeId:n,id:a,getAttributesLens:Vt})}case Je:{const{groupId:r,attributeId:n,filter:a}=t.payload;return Rt({state:e,groupId:r,attributeId:n,filter:a,getAttributeProp:Yt,setAttributeProp:Ht})}case et:{const{groupId:r,attributeId:n,values:a}=t.payload;return _t({state:e,groupId:r,attributeId:n,values:a,setAttributeProp:Ht})}case _.Z.CLEAR_ALL:return Pt;case w.search.constants.UPDATE_STATE:{const{advanced:e=[]}=t.payload;return Ft.set(Pt,e)}default:return e}},Zt=(e,t)=>{const r=((e,t)=>{if(t.type===tt){var r;const{groupId:n,attributeId:a,values:i}=t.payload;return((null===(r=[...Ft.get(e.searchParams)].find((e=>e.id===n)))||void 0===r?void 0:r.attributes)||[]).some((({id:e})=>e===a))?(0,O.assocPath)(["attributesData",n,a,"default"],i,e):e}return e})((0,T.combineReducers)({searchParams:qt,attributesData:Gt})(e,t),t);return r},$t="SAVED_SEARCHES_CREATE",Kt="SAVED_SEARCHES_SET_CURRENT",Xt="SAVED_SEARCHES_SET_CHANGE_INDICATOR",Qt="SAVED_SEARCHES_UPDATE",Jt="SAVED_SEARCHES_LOAD",er="SAVED_SEARCHES_SET_TOTAL",tr="SAVED_SEARCHES_SET_ITEMS",rr="SAVED_SEARCHES_SET_ITEM_TOTAL",nr="SAVED_SEARCHES_SET_PAGE",ar="SAVED_SEARCHES_SET_ROWS_PER_PAGE",ir="SAVED_SEARCHES_SET_FILTERS",or="SAVED_SEARCHES_SELECT_ITEM",lr="SAVED_SEARCHES_SELECT_ALL_ITEMS",sr="SAVED_SEARCHES_DESELECT_ALL_ITEMS",cr="SAVED_SEARCHES_MARK_PUBLIC_REQUEST",ur="SAVED_SEARCHES_MARK_PUBLIC",pr="SAVED_SEARCHES_MARK_FAVORITE_REQUEST",dr="SAVED_SEARCHES_MARK_FAVORITE",mr="SAVED_SEARCHES_MARK_GLOBAL_FILTER_REQUEST",fr="SAVED_SEARCHES_MARK_GLOBAL_FILTER",yr="SAVED_SEARCHES_CHANGE_ITEM_NAME_REQUEST",gr="SAVED_SEARCHES_CHANGE_ITEM_NAME",hr="SAVED_SEARCHES_SET_EDITING",Er="SAVED_SEARCHES_DELETE_SELECTED_ITEMS_REQUEST",br="SAVED_SEARCHES_DELETE_ITEM_REQUEST",vr="SAVED_SEARCHES_DELETE_ITEMS",Tr="SAVED_SEARCHES_SET_LOADING",Or="SAVED_SEARCHES_SET_SEARCH_VALUE",Sr="SAVED_SEARCHES_APPLY_ITEM",xr="SAVED_SEARCHES_SET_TOTAL_LOADING",Cr="SAVED_SEARCHES_LOAD_TOTAL",wr="SAVED_SEARCHES_TOGGLE_SORT",Ar="RECENT_SEARCHES_CREATE",Rr="RECENT_SEARCHES_LOAD",_r="RECENT_SEARCHES_SET_ITEMS",Ir="RECENT_SEARCHES_SET_ITEM_TOTAL",Nr="RECENT_SEARCHES_SELECT_ITEM",Pr="RECENT_SEARCHES_SELECT_ALL_ITEMS",Dr="RECENT_SEARCHES_DESELECT_ALL_ITEMS",kr="RECENT_SEARCHES_DELETE_SELECTED_ITEMS_REQUEST",Lr="RECENT_SEARCHES_DELETE_ITEMS",Ur="RECENT_SEARCHES_DELETE_ITEM_REQUEST",jr="RECENT_SEARCHES_SET_LOADING",Fr="RECENT_SEARCHES_SET_SEARCH_VALUE",Mr="RECENT_SEARCHES_SET_LAST_SAVED",Vr="RECENT_SEARCHES_SET_TOTAL_LOADING",Br="RECENT_SEARCHES_LOAD_TOTAL",zr="RECENT_SEARCHES_APPLY_ITEM";function Hr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Yr(e,t,r[t])}))}return e}function Yr(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Wr={currentSearch:null,postSavingAction:null,changeIndicator:!1,items:[],loading:!1,total:0,page:0,rowsPerPage:B.Tu[0],searchValue:"",findPublic:!0,favoriteOnly:!1,sorting:{order:B.rX.DESC,field:B.KY.updateDate}},Gr=(0,S.Ic)("changeIndicator"),qr=(0,S.Ic)("items"),Zr=(0,S.Ic)("total"),$r=(0,S.Ic)("page"),Kr=(0,S.Ic)("loading"),Xr=(0,S.Ic)("postSavingAction"),Qr=(0,S.Ic)("sorting"),Jr=(e,t,r)=>{const n=qr.get(r).findIndex((e=>e.uri===t)),a=qr.compose((0,S.ET)([n])),i=a.get(r);return a.set(r,e(i))},en=(e,t,r)=>(0,O.evolve)({page:(0,O.always)(0),[e]:(0,O.always)(t)},r),tn=(e=Wr,t)=>{switch(t.type){case Kt:return(0,O.evolve)({currentSearch:(0,O.always)(t.payload),changeIndicator:null===t.payload?(0,O.always)(!1):O.identity},e);case _.Z.CLEAR_ALL:return(0,O.evolve)({currentSearch:(0,O.always)(null),changeIndicator:(0,O.always)(!1)},e);case Xt:return Gr.set(e,t.payload);case er:return Zr.set(e,t.payload);case nr:return $r.set(e,t.payload);case ar:return en("rowsPerPage",t.payload,e);case ir:{const{findPublic:r,favoriteOnly:n}=t.payload;return(0,O.evolve)({page:(0,O.always)(0),findPublic:(0,O.always)(r),favoriteOnly:(0,O.always)(n)},e)}case tr:return qr.set(e,t.payload);case or:{const{uri:r,checked:n}=t.payload;return Jr((e=>Hr({},e,{checked:n})),r,e)}case sr:{const t=qr.get(e);return qr.set(e,t.map((0,O.omit)(["checked"])))}case lr:{const t=qr.get(e);return qr.set(e,t.map((0,O.ifElse)((0,O.prop)("isOwnSearch"),(0,O.assoc)("checked",!0),O.identity)))}case vr:{const r=t.payload,n=qr.get(e),a=Zr.set(e,Zr.get(e)-r.length);return qr.set(a,n.filter((e=>!r.includes(e.uri))))}case ur:{const{uri:r,isPublic:n}=t.payload;return Jr((e=>Hr({},e,{isPublic:n})),r,e)}case dr:{const{uri:r,isFavorite:n}=t.payload;return Jr((e=>Hr({},e,{isFavorite:n})),r,e)}case rr:{const{uri:r,total:n}=t.payload;return Jr((e=>Hr({},e,{total:n})),r,e)}case hr:{const{uri:r,isEditing:n}=t.payload;return Jr((e=>Hr({},e,{isEditing:n})),r,e)}case yr:{const{uri:r}=t.payload;return Jr((0,O.omit)(["isEditing"]),r,e)}case gr:{const{uri:r,name:n}=t.payload;return Jr((e=>Hr({},e,{name:n})),r,e)}case Tr:return Kr.set(e,t.payload);case Fr:case Or:return en("searchValue",t.payload,e);case Jt:return Hr({},e,{page:0,findPublic:!0,favoriteOnly:!1});case wr:{const n=t.payload,a=(0,O.path)(["sorting","field"],e),i=(0,O.path)(["sorting","order"],e);return Qr.set(e,{field:n,order:(r=n===a?i:null,r===B.rX.DESC?B.rX.ASC:B.rX.DESC)})}case xr:{const{uri:r,isLoading:n}=t.payload;return Jr((e=>Hr({},e,{isTotalLoading:n})),r,e)}case le:return Xr.set(e,t.payload.postSavingAction);case oe:return en("searchValue",Wr.searchValue,e)}var r;return e};function rn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){nn(e,t,r[t])}))}return e}function nn(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const an={items:[],filterWord:null,loading:!1,lastSavedRecentSearch:null},on=(0,S.Ic)("items"),ln=(0,S.Ic)("loading"),sn=(0,S.Ic)("filterWord"),cn=(0,S.Ic)("lastSavedRecentSearch"),un=(e,t,r)=>{const n=on.get(r).findIndex((e=>e.createdDate===t)),a=on.compose((0,S.ET)([n])),i=a.get(r);return a.set(r,e(i))},pn=(e=an,t)=>{switch(t.type){case Or:case Fr:return sn.set(e,t.payload);case _r:return on.set(e,t.payload);case Nr:{const{searchCreatedDate:r,checked:n}=t.payload;return un((e=>rn({},e,{checked:n})),r,e)}case Dr:{const t=on.get(e);return on.set(e,t.map((0,O.omit)(["checked"])))}case Pr:{const t=on.get(e);return on.set(e,t.map((0,O.assoc)("checked",!0)))}case Lr:{const r=(t.payload||[]).map((0,O.prop)("createdDate")),n=on.get(e);return on.set(e,n.filter((e=>!r.includes(e.createdDate))))}case Ir:{const{searchCreatedDate:r,total:n}=t.payload;return un((e=>rn({},e,{total:n})),r,e)}case jr:return ln.set(e,t.payload);case Mr:return cn.set(e,t.payload);case Vr:{const{searchCreatedDate:r,isLoading:n}=t.payload;return un((e=>rn({},e,{isTotalLoading:n})),r,e)}case oe:return sn.set(e,an.filterWord)}return e},dn="ENTITY_SET_LOADING",mn="ENTITY_LOAD_ENTITY_REQUEST",fn="ENTITY_SET_SELECTED_ENTITY_URI",yn="ENTITY_SET_ENTITY",gn={loading:!1,selectedEntityUri:null,entity:null},hn=(0,S.Ic)("loading"),En=(0,S.Ic)("selectedEntityUri"),bn=(0,S.Ic)("entity"),vn=(e=gn,t)=>{switch(t.type){case dn:return hn.set(e,t.payload);case fn:return En.set(e,t.payload);case yn:return bn.set(e,t.payload);case w.profile.constants.ProfileActions.ADD_NEXT_PAGE_ATTRIBUTE_VALUES:{const{parentUri:r,attributeTypeName:n,attributeTypeUri:a,values:i}=t.payload,o=(0,v.getAttributeSource)(a);if(e.entity&&r===e.entity.uri){const t=(0,O.lensPath)(["entity",o,n]);return(0,O.over)(t,(0,O.pipe)((0,O.defaultTo)([]),(0,O.concat)(O.__,i)),e)}return e}case w.search.constants.SEARCH_RESULTS_SET:if((0,v.isEmptyValue)(t.payload)){const t=bn.set(e,gn.entity);return En.set(t,gn.selectedEntityUri)}return e}return e},Tn="BULK_UPDATE_SET_ACTIVE_STEP",On="BULK_UPDATE_INIT",Sn="BULK_UPDATE_TOGGLE_SELECTION_MODE",xn="BULK_UPDATE_SELECT_ENTITY",Cn="BULK_UPDATE_SELECT_ALL_ENTITIES_ON_PAGE",wn="BULK_UPDATE_SET_LOADING",An="BULK_UPDATE_CHANGE_ROWS_PER_PAGE",Rn="BULK_UPDATE_CHANGE_PAGE",_n="BULK_UPDATE_CHANGE_SORT",In="BULK_UPDATE_CHANGE_COLUMNS",Nn="BULK_UPDATE_UPDATE_ENTITIES",Pn="BULK_UPDATE_SET_FILTER_TEXT",Dn="BULK_UPDATE_SET_TOTAL",kn="UPDATE_BULK_UPDATE_CURRENT_ENTITIES",Ln="BULK_UPDATE_SET_OPERATION",Un="BULK_UPDATE_SET_ACTION_ATTRIBUTE",jn="BULK_UPDATE_SET_ACTION_OPERATION",Fn="BULK_UPDATE_ADD_OPERATION_PARAMETERS",Mn="BULK_UPDATE_DELETE_ACTION",Vn="BULK_UPDATE_TOGGLE_CONDITIONS",Bn="BULK_UPDATE_ADD_CONDITION_AFTER",zn="BULK_UPDATE_CHANGE_CONDITION_DATA",Hn="BULK_UPDATE_TOGGLE_CONDITION_SELECT",Yn="BULK_UPDATE_DELETE_CONDITION",Wn="BULK_UPDATE_SET_CONDITION_FILTER",Gn="BULK_UPDATE_SET_CONDITION_VALUES",qn="BULK_UPDATE_TOGGLE_ACTION_PIN",Zn="BULK_UPDATE_TOGGLE_ACTION_ADD_NESTED",$n="BULK_UPDATE_CONFIRM",Kn="BULK_UPDATE_SET_REQUEST_PENDING";var Xn=r(39705);function Qn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Jn(e,t,r[t])}))}return e}function Jn(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ea={objects:{selectionMode:B.v6.exclude,selectedEntities:[],entities:[],total:0,page:0,rowsPerPage:B.Tu[0],filterText:"",sortOrder:null,sortField:null,selectedColumns:[]},actions:[],operation:null,activeStep:0,loading:!1,requestPending:!1},ta=(0,S.Ic)("activeStep"),ra=(0,S.Ic)("operation"),na=(0,S.Ic)("loading"),aa=(0,S.Ic)("requestPending"),ia=(0,S.ET)("objects","total"),oa=(0,S.ET)("objects","page"),la=(0,S.ET)("objects","rowsPerPage"),sa=(0,S.ET)("objects","selectionMode"),ca=(0,S.ET)("objects","entities"),ua=(0,S.ET)("objects","selectedEntities"),pa=(0,S.ET)("objects","filterText"),da=e=>sa.get(e)===B.v6.include,ma=(0,S.ET)("objects","sortOrder"),fa=(0,S.ET)("objects","sortField"),ya=(0,S.ET)("objects","selectedColumns"),ga=["actions"],ha=(0,S.ET)(...ga),Ea=({groupId:e,state:t})=>{if(e){const r=ha.get(t).findIndex((t=>t.id===e));if(-1!==r)return[...ga,r,"actions"]}return ga},ba=(e,t)=>({id:(0,Me.x0)(),operation:e,operationParameters:t}),va=e=>((0,O.path)(["attributeTypeData","fieldName"],e)||"").split(".").slice(0,2).join("."),Ta=(e,t)=>({id:(0,Me.x0)(),fieldName:va(t),actions:[ba(e,t)]}),Oa=({state:e,id:t,groupId:r,operation:n,operationParameters:a,togglePin:i,toggleAddNested:o})=>{const l=Ea({state:e,groupId:r}),s=(0,S.ET)(...l).get(e),c=!r&&(0,O.prop)("attributeTypeData",a)&&(({attributeType:e,fieldName:t=""})=>(0,v.isComplexAttribute)(e)||t.split(".").length>2)(a.attributeTypeData);if(t){const r=s.findIndex((e=>e.id===t)),p=(0,S.ET)(...l,r),d=Qn({},p.get(e));if(n&&d.operation!==n){if(d.operationParameters){const e=[d.operation,n].includes(Xn.d.RepointReference)?[]:B.KJ[n];d.operationParameters=(0,O.omit)((0,O.without)(e,["attributeValue","attributeValueToFind"]),d.operationParameters)}d.operation=n}return a&&(d.operationParameters=(0,O.reject)(O.isNil,Qn({},d.operationParameters,a))),i&&(d.operationParameters=Qn({},d.operationParameters,{pin:!(0,O.path)(["operationParameters","pin"],d)})),o&&(d.operationParameters=Qn({},d.operationParameters,{addNestedAttribute:!(0,O.path)(["operationParameters","addNestedAttribute"],d)})),p.set(e,c?Ta((u=d).operation,u.operationParameters):d)}{const t=(0,O.reject)(O.isNil,a),r=c?Ta(n,t):ba(n,t);return(0,S.ET)(...l,s.length).set(e,r)}var u},Sa=ht(ga),xa=Et(Sa,"conditions"),Ca=bt(xa),wa=vt(xa),Aa=Tt(wa),Ra=Ot(wa),_a=(e=ea,t)=>{switch(t.type){case Tn:return ta.set(e,t.payload);case On:return Qn({},ea,{objects:Qn({},ea.objects,t.payload)});case Nn:return ca.set(e,t.payload);case Sn:{const t=sa.set(e,da(e)?B.v6.exclude:B.v6.include);return ua.set(t,[])}case xn:{const{uri:r,checked:n}=t.payload,a=ua.get(e),i=da(e);return ua.set(e,!!n==!!i?(0,O.uniq)(a.concat(r)):(0,O.without)(r,a))}case Cn:{const r=t.payload,n=da(e),a=ua.get(e),i=ca.get(e).map((0,O.prop)("uri"));return ua.set(e,!!r==!!n?(0,O.uniq)(a.concat(i)):(0,O.without)(i,a))}case wn:return na.set(e,t.payload);case Rn:return oa.set(e,t.payload);case An:{const r=oa.set(e,0);return la.set(r,t.payload)}case _n:{const{order:r,field:n}=t.payload,a=fa.set(e,n);return ma.set(a,r)}case In:return ya.set(e,t.payload);case Dn:return ia.set(e,t.payload);case Pn:{const{filterText:r}=t.payload;return pa.set(e,r)}case Ln:return ra.set(e,t.payload);case Un:{const{id:r,groupId:n,attribute:a}=t.payload;return Oa({state:e,id:r,groupId:n,operationParameters:{attributeTypeData:a,attributeValue:null,attributeValueToFind:null,pin:null,addNestedAttribute:null}})}case jn:{const{id:r,groupId:n,operation:a}=t.payload;return Oa({state:e,id:r,groupId:n,operation:a})}case Fn:{const{id:r,groupId:n,operationParameters:a}=t.payload;return Oa({state:e,id:r,groupId:n,operationParameters:a})}case qn:{const{id:r,groupId:n}=t.payload;return Oa({state:e,id:r,groupId:n,togglePin:!0})}case Zn:{const{id:r,groupId:n}=t.payload;return Oa({state:e,id:r,groupId:n,toggleAddNested:!0})}case Mn:{const{id:r,groupId:n}=t.payload,a=Ea({state:e,groupId:n}),i=(0,S.ET)(...a),o=i.get(e);return i.set(e,o.filter((e=>e.id!==r)))}case Vn:{const r=t.payload,n=ha.get(e).findIndex((e=>e.id===r)),a=(0,S.ET)(...ga,n),i=a.get(e);return a.set(e,i.conditions?(0,O.omit)(["conditions"],i):(0,O.assoc)("conditions",[],i))}case Bn:{const{groupId:r,attributeId:n,attribute:a}=t.payload;return St({state:e,groupId:r,attributeId:n,attribute:a,getAttributesLens:xa,getAttributeIndex:Ca})}case zn:{const{groupId:r,attributeId:n,attributeData:a}=t.payload;return xt({state:e,groupId:r,attributeId:n,attributeData:a,setAttributeProp:Aa,getAttributeLens:wa})}case Yn:{const{groupId:r,attributeId:n}=t.payload;return wt({state:e,groupId:r,attributeId:n,getAttributesLens:xa})}case Wn:{const{groupId:r,attributeId:n,filter:a}=t.payload;return Rt({state:e,groupId:r,attributeId:n,filter:a,getAttributeProp:Ra,setAttributeProp:Aa})}case Gn:{const{groupId:r,attributeId:n,values:a}=t.payload;return _t({state:e,groupId:r,attributeId:n,values:a,setAttributeProp:Aa})}case Kn:return aa.set(e,t.payload)}return e};var Ia=r(27422),Na=r(82349),Pa=r(12848),Da=r(33192),ka=r.n(Da),La=r(43717);const Ua=(e,t,r)=>{const n=ja(t);if(n.length){const i=Ma(e,t,r),o=Fa(e,t,r),l=o.every((e=>(0,v.isTypeSearchGroupAttribute)({data:e})||i.some((0,O.eqProps)("fieldName",e)))),s=(0,v.areAllOperatorsAnd)(t),c=(0,v.areAllOperatorsAnd)(n),u=n.every((({filter:e,data:{attrType:t={}}})=>[v.FilterOptions.EQUALS,v.FilterOptions.IN_RANGE,v.FilterOptions.FULL_TEXT,v.FilterOptions.ON,v.FilterOptions.WITHIN].includes(e)||v.FilterOptions.EXISTS===e&&(0,v.isBooleanType)(t.type))),p=(a=n,!Object.values(a.reduce(((e,{data:{fieldName:t},filter:r,values:n})=>(r===v.FilterOptions.EQUALS&&(0,O.path)([0,"length"],n)&&(e[t]=e[t]&&e[t]+1||1),e)),{})).some((e=>e>1)));return o.length&&s&&c&&u&&n.every((e=>e.data.attrType.faceted))&&l&&p}var a;return!0},ja=e=>e.flatMap((e=>e.attributes)).filter((0,O.has)("data")),Fa=(e,t,r)=>{const n=ja(t).map((({data:{fieldName:e,entityTypeUri:t},filter:r,values:n})=>({entityTypeUri:t,fieldName:e,filter:r,values:n}))).reduce(((t,{entityTypeUri:n,fieldName:a,filter:i,values:o})=>{const{attrType:l}=n?(0,x.eC)(e,[n],[],r).find((e=>e.fieldName===a))||{}:(0,La.zH)(a,r)||{},s=!(0,O.isNil)(l)&&l.faceted?((e,t,r,n)=>{if(![v.FilterOptions.EQUALS,v.FilterOptions.IN_RANGE].includes(t)&&![v.FilterOptions.ON,v.FilterOptions.WITHIN].includes(t)||!Array.isArray(e)||(0,v.isEmptyValue)(e[0]))return(0,v.isBooleanType)(n)&&t===v.FilterOptions.EXISTS?[!0,!1]:e&&!(0,v.isEmptyValue)(e[0])?[e[0]]:[];switch(r){case v.FACET_TYPES.NUMERIC_RANGE_FACET:return((e,t)=>{switch(t){case v.FilterOptions.EQUALS:return e.map((e=>[e,e]));case v.FilterOptions.IN_RANGE:return e.some(v.isEmptyValue)?[]:[e]}})(e[0],t);case v.FACET_TYPES.DATE_RANGE_FACET:return((e,t)=>{switch(t){case v.FilterOptions.ON:{const t=ka()(e),r=!(0,v.isTimestampBasedType)(n);return[[v.utils.dates.getStartOfDay(t,r),v.utils.dates.getEndOfDay(t,r)]]}case v.FilterOptions.WITHIN:return(0,v.isDateRangeValue)(e)?[(0,v.getDateRangeByValue)(e)]:e.some(v.isEmptyValue)?[]:[e]}})(e[0],t);default:return e[0]}})(o,i,(0,v.getFacetTypeForAttrType)(l),l.type):o;return(0,O.isNil)(s)||(t[a]=(0,O.uniq)((t[a]||[]).concat(s))),t}),{}),a=Object.keys(n).map((e=>({fieldName:e,values:n[e]})));return a.some((({values:e})=>e&&Array.isArray(e[0])&&e.length>1))?[]:a},Ma=(e,t,r)=>{const n=(0,lt.VO)(t);return(0,x.eC)(e,n,[],r)},Va=(e,t)=>({type:_.Z.UPDATE_ENTITIES,payload:{searchResults:e,entityTypeUri:t}}),Ba=e=>({type:_.Z.UPDATE_URL,payload:e}),za=e=>({type:_.Z.CLEAR_RESULTS,payload:e}),Ha=()=>({type:_.Z.REFRESH_DISPLAYED_ENTITIES}),Ya=({silent:e})=>({type:_.Z.CLEAR_ALL,payload:{silent:e}}),Wa=({entityTypeUri:e,keywordValue:t})=>({type:_.Z.SHOW_MORE_RESULTS_FOR_ENTITY_TYPE,payload:{entityTypeUri:e,keywordValue:t}}),Ga=e=>({type:_.Z.UPDATE_TOTAL,payload:e}),qa=e=>({type:_.Z.RESET_PAGE,payload:{entityTypeUri:e}}),Za=e=>({type:_.Z.CHANGE_LOADING,payload:e}),$a=(e,t=null,r=!1)=>({type:_.Z.MAP_CHANGE_VALUE,payload:{value:e,searchType:t,silent:r}}),Ka=(e,t)=>({type:R.k.CREATE_FACETS,payload:{facetsConfigs:e,addToEnd:t}}),Xa=e=>({type:R.k.DESTROY_FACETS,payload:e}),Qa=(e,t,r=!1)=>({type:R.k.CHANGE_VALUES,payload:{facetFieldName:e,values:t,silent:r}}),Ja=e=>({type:R.k.UPDATE_DATA,payload:e}),ei=e=>({type:R.k.UPDATE_FILTERED_DATA,payload:e}),ti=({facetsToAdd:e,fieldNamesToDelete:t,changedEntityTypes:r,addToEnd:n})=>({type:R.k.HANDLE_CONFIGS_CHANGES,payload:{facetsToAdd:e,fieldNamesToDelete:t,changedEntityTypes:r,addToEnd:n}}),ri=e=>({type:R.k.SET_RECOMMENDED_FACETS_LIST,payload:e});var ni=r(5236),ai=r(54145),ii=r(55443),oi=r(65751),li=r.n(oi);const si=e=>{(0,ii.U)(e,{title:li().text("Server Error"),defaultMessage:li().text("Something went wrong...")})};var ci=r(21430);const ui=(e,t,r)=>`${e}/recommend/${r}/${t}`,pi=(e,t,r,n,a)=>{const i=e.map((({fieldName:e,values:t})=>({fieldName:e,values:t.map((e=>Array.isArray(e)?JSON.stringify(e):e))}))),o={facets:(0,Na._e)(i).reduce(((e,t)=>{const r=(t.children||[]).map((e=>JSON.stringify(e)));return e[t.fieldName]=r.length>0?r:t.values.slice().sort(),e}),{}),max:t};return{url:ui(r,n,a),options:{method:"POST",body:JSON.stringify(o),headers:{"Content-Type":"application/json"}}}},di=e=>e&&1===e.length?e[0]:null,mi=e=>[e].filter((0,O.complement)(v.isComplexAttribute)).map((0,O.compose)(Na.$9,(0,O.prop)("uri"))).concat((e.children||[]).map(mi)).flat(1/0),fi=(e,t=[],r)=>{const n=di(r),a=n&&(0,v.getEntityType)(e,n),i=(0,ci.vf)(e,a||{}).map(mi).flat(1/0);return t.filter((e=>n||!e.startsWith("attributes."))).filter((e=>!e.startsWith("attributes.")||i.includes(e)))},yi=(e,t,r,n)=>{const a=e=>!t.includes(e);let i=[];const o=Math.max(0,r-t.length);if(o){const t=di(n);if(t){const r=((0,v.getEntityType)(e,t).defaultFacetedAttributes||[]).map((r=>(0,v.findAttributeTypeByUri)(e,r,t))).filter((e=>e&&(0,v.isReadableAttribute)(e)&&!(0,v.isComplexAttribute)(e))).map((0,O.prop)("uri")).map(Na.$9).filter(a);i=i.concat(r)}if(i.length<o){const e=(0,x.Xk)().map((e=>e.fieldName)).filter(a);i=i.concat(e)}}return i.slice(0,o)},gi=5;function*hi(){const e=yield(0,Ia.RE)(ns),t=yield(0,Ia.Ys)(A().selectors.getTenant),r=yield(0,Ia.Ys)(A().selectors.getEnvironment),n=yield(0,Ia.Ys)(A().selectors.getServicesPath),a=pi(e,gi,n,t,r);let i;try{i=yield(0,Ia.RE)(v.rawRequest,a.url,a.options),i=i.filter((e=>"type"!==e)).slice(0,gi)}catch(e){i=[]}const o=yield(0,Ia.Ys)(A().selectors.getMetadata),l=yield(0,Ia.Ys)(C.DX);i=fi(o,i,l);const s=yi(o,i,gi,l);i=i.concat(s),yield(0,Ia.gz)(ri(i))}const Ei=e=>({type:ie,payload:e}),bi=e=>({type:oe,payload:e}),vi=(e,t)=>({type:le,payload:{show:e,postSavingAction:t}}),Ti=e=>({type:se,payload:e}),Oi=e=>({type:de,payload:e}),Si=(e,t,r)=>({type:me,payload:{entityTypeUri:e,columns:t,prevColumns:r}}),xi=(e,t=!1)=>({type:fe,payload:{entityTypeUri:e,silent:t}}),Ci=e=>({type:ye,payload:e}),wi=()=>({type:Ee}),Ai=e=>({type:be,payload:e}),Ri=e=>Ai({payload:{message:e,action:{actionToDispatch:wi()}},type:B.GT.error}),_i=e=>Ai({payload:{message:e,action:null},type:B.GT.info}),Ii=({message:e,actionLabel:t,actionToDispatch:r,autoHideDuration:n})=>Ai({payload:{message:e,action:{actionLabel:t,actionToDispatch:r},autoHideDuration:n},type:B.GT.info}),Ni=e=>({type:Te,payload:e}),Pi=e=>({type:ce,payload:e});var Di=r(90503),ki=r(82877);const Li=(e={},t="")=>Object.keys(e).filter((r=>v.utils.strings.search(r,t)||v.utils.strings.search(e[r].displayName,t))),Ui=new class{constructor(){this._lookupsCodesResolveTasks=Object.create(null)}addTask(e,t){this._lookupsCodesResolveTasks[e]=t}deleteTask(e){delete this._lookupsCodesResolveTasks[e]}getRunningTask(e){return this._lookupsCodesResolveTasks[e]}clearTasks(){this._lookupsCodesResolveTasks=Object.create(null)}},ji=(e,t)=>e===t,Fi=new class{constructor(){this.isLookupValueResolveTaskRunning=(0,O.curry)(((e,t)=>(0,O.hasPath)([e,t],this._lookupValuesResolveTasks))),this._lookupValuesResolveTasks=Object.create(null)}addTask(e,t){e.forEach((({type:e,codeValues:r})=>{!this._lookupValuesResolveTasks[e]&&(this._lookupValuesResolveTasks[e]={}),r.forEach((r=>{this._lookupValuesResolveTasks[e][r]=t}))}))}deleteTask(e){e.forEach((({type:e,codeValues:t})=>{this._lookupValuesResolveTasks[e]&&t.forEach((t=>{delete this._lookupValuesResolveTasks[e][t]})),(0,O.isEmpty)(this._lookupValuesResolveTasks[e])&&delete this._lookupValuesResolveTasks[e]}))}getRunningTasks(e){const t=e.flatMap((({type:e,codeValues:t})=>this._lookupValuesResolveTasks[e]?t.reduce(((t,r)=>{const n=this._lookupValuesResolveTasks[e][r];return n&&t.push(n),t}),[]):[]));return(0,O.uniqWith)(ji,t)}clearTasks(){this._lookupValuesResolveTasks=Object.create(null)}};function*Mi(e){const t=Fi.getRunningTasks(e);t.length>0&&(yield(0,Ia.v_)(t))}function*Vi(e){try{const t=e.flatMap((({type:e,codeValues:t})=>t.map((t=>({type:e,codeValue:t}))))),r=yield(0,Ia.rM)(v.resolveLookupsList,t);Fi.addTask(e,r);const n=(yield(0,Ia.v_)(r)).reduce(((e,t)=>{const[r]=Object.keys(t),[n]=Object.keys(t[r]),a=(0,O.lensPath)([r,n]),i=(0,O.path)([r,n],t);return(0,O.set)(a,i,e)}),{});for(const e in n)yield(0,Ia.gz)(w.profile.lookups.actions.lookupsForTypeResolved({type:e,values:n[e]}))}catch(e){console.warn(e)}finally{Fi.deleteTask(e)}}function*Bi(e){if((0,O.isEmpty)(e))return;const t=e.map((({type:e,codeValues:t})=>{const r=Fi.isLookupValueResolveTaskRunning(e);return{type:e,codeValues:t.filter((0,O.complement)(r))}})).filter((({codeValues:e})=>e.length>0));t.length>0&&(yield(0,Ia.RE)(Vi,t)),yield(0,Ia.RE)(Mi,e)}function*zi(e,t,r=B.cu,n=1){const a=!t&&1===n,i=`${e}${r}`,o=a&&Ui.getRunningTask(i);if(o)yield(0,Ia.v_)(o);else try{const o=yield(0,Ia.rM)(v.getDependentLookups,{type:e,displayNamePrefix:t,max:r,offset:r*(n-1)});a&&Ui.addTask(i,o);const l=yield(0,Ia.v_)(o);yield(0,Ia.gz)(w.profile.lookups.actions.lookupsForTypeResolved({type:e,values:l.codeValues[e]}))}catch(e){console.warn(e)}finally{a&&Ui.deleteTask(i)}}const Hi=(e,t,r)=>e.slice((r-1)*t,t*r);function*Yi(e,t,r,n=1){const a=yield(0,Ia.Ys)(A().selectors.getLookups),i=Li(a[e],t);if(i.length>=r*n)return Hi(i,r,n);yield(0,Ia.RE)(zi,e,t,r,n);const o=yield(0,Ia.Ys)(A().selectors.getLookups);return Hi(Li(o[e],t),r,n)}const Wi=(e,t,r)=>{const n=((e,t)=>(0,O.pipe)(Object.entries,(0,O.reduce)(((e,[r,n])=>{const a=t.find((0,O.propEq)("fieldName",r));if(!a)return e;const{attrType:i}=a,o=(0,v.getAttrTypeLookupCode)(i);return e[o]={type:o,codeValues:(0,O.uniq)([...(0,O.pathOr)([],[o,"codeValues"],e),...Object.keys(n)])},e}),{}),O.values)(e))(e,t);return(0,v.getUnresolvedLookupsList)(r,n)},Gi=(e,t)=>Object.keys(e).filter((e=>(0,Pa.iL)(e,t))).reduce(((r,n)=>(r[(0,Pa.iL)(n,t).fieldName]=e[n],r)),{});function qi(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Zi(e,t,r[t])}))}return e}function Zi(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*$i(e,t,r){if((0,O.isEmpty)(e))return;const n=yield(0,Ia.Ys)(A().selectors.getLookups),a=yield(0,Ia.Ys)(A().selectors.getMetadata),i=Gi(r,e),o=yield(0,Ia.Ys)(ki.Xf);yield(0,Ia.gz)(t((0,Pa.HC)(a,i,e,n,{allowedEntityTypes:o})))}function*Ki(e,t,r){try{const n=yield(0,Ia.RE)(Hl,e.url,e.options),[a,i]=(0,O.partition)(x._H,t);yield(0,Ia.rM)($i,i,r,n),yield(0,Ia.RE)(ao,a,n),yield(0,Ia.RE)($i,a,r,n)}catch(e){console.warn(e)}}function*Xi(e,t,r){e=qi({},e,{includeFilter:[]});const n=yield(0,Ia.Ys)(A().selectors.getGlobalSearchRequestOptions),a=(0,Na.aw)([e],t,[e.fieldName],n);yield(0,Ia.RE)(Ki,a,[e],r)}const Qi=(e,t=[])=>t.filter((({label:t})=>v.utils.strings.search(t,e))),Ji=(e,t)=>Qi(t,e).map((({uri:e})=>(0,v.getLastUriPart)(e))),eo=(e,t)=>Qi(t,e).map((0,O.prop)("uri")),to=(e,t)=>Qi(t,e).map((0,O.prop)("value"));function*ro(e,t,r,n){const a=qi({},e),i=[...t];if((0,x._H)(a)){const t=(0,v.getAttrTypeLookupCode)(e.attrType);a.includeFilter=yield(0,Ia.RE)(Yi,t,r,(0,O.propOr)(B.cu,"pageSize",a),a.pageNumber)}else if("sourceSystems"===a.fieldName){const{sources:e}=yield(0,Ia.Ys)(A().selectors.getMetadata);a.includeFilter=Ji(e,r)}else if((0,x.S9)(a)){const t=yield(0,Ia.Ys)(A().selectors.getMetadata),n=(0,v.getEntityType)(t,a.entityTypeUri)||{},i=(0,O.pipe)((0,O.propOr)([],"displayedItems"),(0,O.filter)((0,O.propEq)("isRaw",!0)))(e);a.includeFilter=[...eo(n.matchGroups,r),...to(i,r)]}else a.disableIncludeFilter=!0,i.push({values:[r],fieldName:e.fieldName,filter:"containsWordStartingWith",forceInclude:!0});const o=yield(0,Ia.Ys)(A().selectors.getGlobalSearchRequestOptions),l=(0,Na.aw)([a],i,[e.fieldName],o);yield(0,Ia.RE)(no,l,e,a.includeFilter,n)}function*no(e,t,r,n){try{const a=yield(0,Ia.RE)(Hl,e.url,e.options),i=yield(0,Ia.Ys)(A().selectors.getLookups),o=Gi(a,[t]);if(r){const e=t.fieldName;o[e]=(0,Pa.AX)(o[e],r)}const l=yield(0,Ia.Ys)(A().selectors.getMetadata),s=yield(0,Ia.Ys)(ki.Xf);yield(0,Ia.gz)(n((0,Pa.HC)(l,o,[t],i,{allowedEntityTypes:s})))}catch(e){console.warn(e)}}function*ao(e,t){const r=yield(0,Ia.Ys)(A().selectors.getLookups),n=(0,Pa.U4)(e,r),a=Wi(t,e,r),i=(0,v.mergeLookupsLists)(n,a);i.length&&(yield(0,Ia.RE)(Bi,i))}var io=r(59295);function oo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){lo(e,t,r[t])}))}return e}function lo(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*so(){const e=yield(0,Ia.Ys)(A().selectors.getMetadata),t=yield(0,Ia.Ys)(ki.Xf),r=yield(0,Ia.Ys)(ki.sl);return(0,Di.wM)(e,t,r)}const co=e=>({value:t})=>!e.length||e.includes(t);function*uo(e){e=e||(yield(0,Ia.Ys)(ai.FR));const t=yield(0,Ia.Ys)(ki.XM);if((0,Di.gj)(t)){const t=yield(0,Ia.Ys)(A().selectors.getMetadata),r=yield(0,Ia.Ys)(io.V6),n=(0,x.$t)(t),a=yield(0,Ia.Ys)(A().selectors.getGlobalSearchRequestOptions),i=(0,Na.aw)([n],e,[n.fieldName],a),o=({type:e=[]})=>{const t=e.filter(co(r));return Ci(t)};yield(0,Ia.RE)(Ki,i,[n],o)}else yield(0,Ia.gz)(Ci([]))}function*po(){const e=yield(0,Ia.Ys)(A().selectors.getMetadata),t=yield(0,Ia.Ys)(ki.Xf),r=yield(0,Ia.Ys)(io.V6);return(0,Pa.wW)(e,{},t).filter(co(r))}function*mo(){const e=yield(0,Ia.Ys)(A().selectors.getMetadata),t=yield(0,Ia.RE)(so),r=yield(0,Ia.Ys)(ki.uJ),n=(0,Di.oX)().map((0,O.prop)("id")),a=(0,O.pipe)((0,O.map)((0,O.filter)((0,O.pipe)((0,O.prop)("id"),(0,O.cond)([[(0,O.includes)("."),O.T],[(0,O.includes)(O.__,n),O.T],[O.T,O.F]])))),O.toPairs,(0,O.map)((([t,r])=>[t,(0,Di.Wh)(e,t,(0,O.map)((0,O.prop)("id"),r)).map(((e,t)=>{const n=r.find((0,O.propEq)("id",e.id)),{size:a,autoResize:i=0!==t&&!a}=n||{};return(0,O.reject)(O.isNil,oo({},e,{size:a,autoResize:i}))}))])),O.fromPairs)(r),i=!(0,O.equals)(r,a),o=Object.keys(t),l=Object.keys(a);!i&&(0,O.equals)(new Set(o),new Set(l))||(yield(0,Ia.gz)(Oi(oo({},t,(0,O.pick)(o,a)))))}function*fo(){const e=yield(0,Ia.Ys)(A().selectors.getMetadata),t=yield(0,Ia.Ys)(C.DX),r=(yield(0,Ia.Ys)(ki.IJ))?yield(0,Ia.RE)(po):yield(0,Ia.RE)(fs),n=(0,Di.nx)(e,r,t).map((0,O.prop)("value")),a=yield(0,Ia.Ys)(ki.o4);n.includes(a)||(yield(0,Ia.gz)(xi(n[0],!0)))}function*yo(e={}){const{silent:t}=e.payload||{};if(!t){const e=yield(0,Ia.Ys)(ki.tB),t=yield(0,Ia.Ys)(ai.t9);if((0,v.isAvailableEntityTypeForDataTenant)(t,e)){const t=yield(0,Ia.Ys)(ai.BP,{entityTypeUri:e});(0,O.isNil)(t)&&(yield(0,Ia.gz)(Ha()))}else yield(0,Ia.gz)(Va([],e))}}function*go(e){const t=e.payload;yield(0,Ia.RE)(yo,e);const r=yield(0,Ia.Ys)(ki.gu);if((0,Di.gj)(t)&&0===r.length){const e=yield(0,Ia.RE)(po);yield(0,Ia.gz)(Ci(e)),yield(0,Ia.RE)(uo)}}function*ho(){const e=yield(0,Ia.Ys)(ki.qx),t=yield(0,Ia.Ys)(ai.Qy);e!==B.om.MAP&&t.length&&(yield(0,Ia.gz)($a(null)))}function*Eo(e){const t=(0,v.removeDtssPrefixFromEntityUri)(e.payload.uri),r=yield(0,Ia.Ys)(ki.tB),n=((yield(0,Ia.Ys)(ai.BP,{entityTypeUri:r}))||[]).map((0,O.prop)("uri")),a=(yield(0,Ia.Ys)(ai.fx,{entityTypeUri:r}))||0,i=(yield(0,Ia.Ys)(ai.Uz,{entityTypeUri:r}))||B.Tu[0],o=n.indexOf(t)+a*i,l=yield(0,Ia.Ys)(ai.NU,{entityTypeUri:r}),s=yield(0,Ia.Ys)(A().selectors.getTenant),c=yield(0,Ia.Ys)(ai.lF);yield(0,Ia.gz)(w.search.actions.setSearchNavigationData({uri:t,index:o,total:l,tenant:c||s,cache:n}))}const bo=[function*(){yield(0,Ia.Fm)(fe,yo)},function*(){yield(0,Ia.Fm)(ve,go)},function*(){yield(0,Ia.Fm)([Ve,Be,He],fo)},function*(){yield(0,Ia.Fm)(Te,ho)},function*(){yield(0,Ia.Fm)(w.ui.constants.UIActions.OPEN_ENTITY,Eo)}],vo=e=>({type:Kt,payload:e}),To=e=>({type:Xt,payload:e}),Oo=e=>({type:er,payload:e}),So=e=>({type:tr,payload:e}),xo=(e,t)=>({type:rr,payload:{uri:e,total:t}}),Co=()=>({type:sr}),wo=e=>({type:vr,payload:e}),Ao=e=>({type:Tr,payload:e}),Ro=(e,t)=>({type:xr,payload:{uri:e,isLoading:t}});var _o=r(90533),Io=r(86374),No=r(4898);function Po(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Do(e,t,r[t])}))}return e}function Do(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*ko(){yield(0,Ia.gz)(Ao(!0));try{const e=yield(0,Ia.Ys)(A().selectors.getUserName),t=t=>Po({},t,{isOwnSearch:e===t.owner}),r=yield(0,Ia.RE)(Lo),{result:n=[],total:a}=yield(0,Ia.RE)(v.getSavedSearches,r);yield(0,Ia.gz)(Oo(a));const i=yield(0,Ia.Ys)(A().selectors.getMetadata),o=yield(0,Ia.Ys)(A().selectors.getDataTenants),l=yield(0,Ia.Ys)(A().selectors.getCanUserReadWorkflowDataTask);yield(0,Ia.gz)(So(n.map(t).map((0,Io.z7)(i,o,l)))),yield(0,Ia.gz)(Ao(!1)),yield(0,Ia.RE)(Fo,n)}catch(e){yield(0,Ia.gz)(Ao(!1))}}function*Lo(){const e=yield(0,Ia.Ys)(_o.s6),t=yield(0,Ia.Ys)(_o.wH),r=yield(0,Ia.Ys)(_o.U3),n=yield(0,Ia.Ys)(_o.VS),a=yield(0,Ia.Ys)(_o.kU),{field:i,order:o}=yield(0,Ia.Ys)(_o.rT);return{offset:e*t,max:e,containsWordStartingWith:r,favoriteOnly:n,findPublic:a,countResults:!1,sortBy:B.PW[i],sortOrder:o}}function*Uo(e){const t=yield(0,Ia.Ys)(_o.EH,e.payload);yield(0,Ia.RE)(jo,t)}function*jo(e,t){yield(0,Ia.gz)(Ro(e.uri,!0));try{const{total:r}=yield(0,Ia.RE)(v.getTotalsForQuery,(0,v.replacePlaceholdersInQuery)(e.query),Boolean(t));yield(0,Ia.gz)(xo(e.uri,r))}catch(e){si(e)}yield(0,Ia.gz)(Ro(e.uri,!1))}function*Fo(e){const t=yield(0,Ia.Ys)(A().selectors.getQueryEstimatorEnabled);return yield(0,Ia.$6)(e.map((e=>(0,Ia.RE)(jo,e,t))))}function*Mo(e){const{uri:t,isPublic:r}=e.payload,n=yield(0,Ia.Ys)(_o.EH,t);if(n){yield(0,Ia.gz)(Ao(!0));try{yield(0,Ia.RE)(v.markSavedSearchAsPublic,(0,Io.Tp)(n),r),yield(0,Ia.gz)(((e,t)=>({type:ur,payload:{uri:e,isPublic:t}}))(t,r))}catch(e){si(e)}yield(0,Ia.gz)(Ao(!1))}}function*Vo(e){const{uri:t,isFavorite:r}=e.payload,n=yield(0,Ia.Ys)(_o.EH,t);if(n){yield(0,Ia.gz)(Ao(!0));try{yield(0,Ia.RE)(v.markSavedSearchAsFavorite,(0,Io.Tp)(n),r),yield(0,Ia.gz)(((e,t)=>({type:dr,payload:{uri:e,isFavorite:t}}))(t,r))}catch(e){si(e)}yield(0,Ia.gz)(Ao(!1))}}function*Bo(e){const{uri:t,isGlobalFilter:r}=e.payload,n=yield(0,Ia.Ys)(_o.EH,t);if(n){const e=(0,Io.V2)(n),{uiState:t}=e,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["uiState"]);(0,v.isObject)("2.0"===t.version?t:t.state)||!r?yield(0,Ia.gz)(((e,t)=>({type:fr,payload:{savedSearch:e,isGlobalFilter:t}}))(Po({},a,{uiState:t,query:(0,v.replacePlaceholdersInQuery)((0,O.propOr)("","query",a))}),r)):(0,ii.U)({errorMessage:"Saved Search is incorrect"},{title:li().text("Saved Search can't be mark as global")})}}function*zo(e){const{uri:t,name:r}=e.payload,n=yield(0,Ia.Ys)(_o.EH,t);if(n&&r!==n.name){yield(0,Ia.gz)(Ao(!0));try{yield(0,Ia.RE)(v.updateSavedSearch,Po({},(0,Io.Tp)(n),{name:r})),yield(0,Ia.gz)(((e,t)=>({type:gr,payload:{uri:e,name:t}}))(t,r))}catch(e){si(e)}yield(0,Ia.gz)(Ao(!1))}}function*Ho(){const e=yield(0,Ia.Ys)(_o.Kh);yield(0,Ia.gz)(Ao(!0));try{yield(0,Ia.$6)(e.map((e=>(0,Ia.RE)(v.deleteSavedSearch,e)))),yield(0,Ia.gz)(wo(e.map((0,O.prop)("uri"))))}catch(e){si(e)}yield(0,Ia.gz)(Ao(!1))}function*Yo(e){const t=e.payload;yield(0,Ia.gz)(Ao(!0));try{yield(0,Ia.RE)(v.deleteSavedSearch,{uri:t}),yield(0,Ia.gz)(wo([t]))}catch(e){si(e)}yield(0,Ia.gz)(Ao(!1))}function*Wo(e=!1,t=!1){return{query:yield(0,Ia.Ys)(_o.Cc,e),uiState:yield(0,Ia.Ys)(No.Z,t)}}function*Go({payload:{name:e,share:t}}){const{query:r,uiState:n}=yield(0,Ia.RE)(Wo,!0),a={isFavorite:!1,isPublic:t===B.ib.public,name:e,query:r,uiState:n},i=yield(0,Ia.Ys)(_o.tp);yield(0,Ia.gz)(vi(!1));try{yield(0,Ia.gz)(_i(li().text("Saving search...")));const e=yield(0,Ia.RE)(v.createSavedSearch,[a]);e[0].successful?(yield(0,Ia.gz)(vo(e[0].object)),yield(0,Ia.gz)(To(!1)),yield(0,Ia.gz)(_i(li().text("Search saved successfully"))),i&&(yield(0,Ia.gz)(i))):si(e)}catch(e){si(e)}}function*qo(e){const{uri:t,debounceTime:r}=e.payload;yield(0,Ia.gz)(bi(!1));const n=yield(0,Ia.Ys)(_o.EH,t),a=(0,_o.In)(n)||{},{errors:i}=a;i&&i.length?((e=[])=>{(0,ii.U)(e,{message:li().text("Saved Search can't be applied")})})(i):(yield(0,Ia.gz)(vo(n)),(yield(0,Ia.Ys)(ai.lF))&&(a.currentTenant=yield(0,Ia.Ys)(A().selectors.getTenant)),yield(0,Ia.gz)(w.search.actions.updateState(Po({},a,{debounceTime:r}))),yield(0,Ia.qn)(_.Z.STATE_UPDATED))}const Zo=[function*(){yield(0,Ia.Fm)([Jt,nr,ar,Or,ir,wr],ko)},function*(){const e={[cr]:Mo,[pr]:Vo,[br]:Yo,[Er]:Ho,[yr]:zo,[mr]:Bo},t=yield(0,Ia.ZO)(Object.keys(e));for(;;){const r=yield(0,Ia.qn)(t);yield(0,Ia.RE)(e[r.type],r)}},function*(){yield(0,Ia.Fm)([$t],Go)},function*(){yield(0,Ia.Fm)([Sr],qo)},function*(){yield(0,Ia.ib)([Cr],Uo)}];function*$o(e){try{yield(0,Ia.RE)(v.createActivity,{label:v.ACTIVITY_TYPES.userSearch,description:JSON.stringify({activity:e,version:"2.0"})})}catch(e){console.warn(e)}}const Ko=e=>({type:Be,payload:{groupId:e}}),Xo=(e,t)=>({type:Ge,payload:{groupId:e,attributeId:t,attribute:mt()}}),Qo=(e,t,r)=>({type:Ge,payload:{groupId:e,attributeId:t,attribute:ft(r)}}),Jo=(e,t,r)=>({type:qe,payload:{groupId:e,attributeId:t,attributeData:yt(r)}}),el=(e,t)=>({type:qe,payload:{groupId:e,attributeId:t,attributeData:null}}),tl=(e,t,r)=>({type:Ze,payload:{groupId:e,attributeId:t,selectInfo:r}}),rl=(e,t,r)=>({type:$e,payload:{groupId:e,attributeId:t,operator:r}}),nl=(e,t)=>({type:Ke,payload:{groupId:e,attributeId:t}}),al=(e,t)=>({type:Xe,payload:{groupId:e,attributeId:t}}),il=(e,t)=>({type:Qe,payload:{groupId:e,attributeId:t,id:(0,Me.x0)()}}),ol=(e,t,r)=>({type:Je,payload:{groupId:e,attributeId:t,filter:r}}),ll=(e,t,r)=>({type:et,payload:{groupId:e,attributeId:t,values:r}}),sl=(e,{attribute:t,value:r,debounceTime:n=0,pageNumber:a=1,currentOptions:i})=>({type:rt,payload:{groupId:e,attribute:t,value:r,debounceTime:n,pageNumber:a,currentOptions:i}}),cl=(e,t,r)=>({type:nt,payload:{groupId:e,attributeId:t,values:r}}),ul=(e,t)=>({type:at,payload:{groupId:e,attribute:t}});var pl=r(44006);function*dl({groups:e,findGroupPath:t=gt,attributesPropName:r,groupId:n,attributeId:a,selectInfo:i,actions:o}){const{checked:l,attribute:s,index:c,selectedAttributes:u}=i,{addAttributeAfter:p,changeAttribute:d,clearAttribute:m,deleteAttribute:f}=o,y=(0,O.pipe)(t(n),(0,O.path)(O.__,e),(0,O.propOr)([],r))(e),g=e=>(0,O.path)([e,"id"],y),h=y.findIndex((0,O.propEq)("id",a));if(a&&0===c)if(l)yield(0,Ia.gz)(d(n,a,s));else{let e=u[c+1];e?(yield(0,Ia.gz)(d(n,a,e)),yield(0,Ia.gz)(f(n,g(h+1)))):yield(0,Ia.gz)(m(n,a))}else{const e=u.length-c,t=a?h+c:y.length-e;l?yield(0,Ia.gz)(p(n,g(t-1),s)):yield(0,Ia.gz)(f(n,g(t)))}}function ml(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){fl(e,t,r[t])}))}return e}function fl(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*yl(e){const{groupId:t,attributeId:r,selectInfo:n}=e.payload,a=yield(0,Ia.Ys)(io.go),i={addAttributeAfter:Qo,changeAttribute:Jo,clearAttribute:el,deleteAttribute:nl};yield(0,Ia.RE)(dl,{groups:a,attributesPropName:"attributes",groupId:t,attributeId:r,selectInfo:n,actions:i}),yield(0,Ia.gz)(Ko(t))}function*gl(e){const{attribute:t,groupId:r}=e.payload,n=yield(0,Ia.Ys)(io._7,r),a=yield(0,Ia.Ys)(A().selectors.getGlobalSearchRequestOptions),{data:{fieldName:i},values:o}=t,l=yield(0,Ia.Ys)(ai.L7,n,i),s=ml({},t.data,{values:o?(0,O.flatten)(o):void 0,pageSize:t.data.pageSize+1}),c=(0,Na.aw)([s],l,[],a);yield(0,Ia.RE)(Ki,c,[s],(e=>((e,t,r)=>({type:tt,payload:{groupId:e,attributeId:t,values:r}}))(r,t.id,e[i])))}function*hl(e){const{attribute:t,value:r,pageNumber:n=1,debounceTime:a,groupId:i,currentOptions:o=[]}=e.payload,{entityTypeUri:l,fieldName:s}=t.data;if(""===r&&1===n)yield(0,Ia.gz)(cl(i,t.id,void 0));else{a&&(yield(0,Ia.gw)(a));const e=yield(0,Ia.Ys)(io.ad,i,t.id),c=e=>cl(i,t.id,o.concat(e[s]));if(r){const a=l?[{values:[l],fieldName:"type",filter:"equals"}]:[],i=yield(0,Ia.Ys)(ai.L7,a,s);yield(0,Ia.rM)(ro,ml({},t.data,{displayedItems:e,pageNumber:n,pageSize:t.data.pageSize+1}),i,r,c)}else{const r=yield(0,Ia.Ys)(io._7,i),a=yield(0,Ia.Ys)(ai.L7,r,s);yield(0,Ia.rM)(Xi,ml({},t.data,{displayedItems:e,pageNumber:n,pageSize:t.data.pageSize+1}),a,c)}}}function*El(){const e=yield(0,Ia.Ys)(A().selectors.getSearchKeyword),t=yield(0,Ia.Ys)(ai.vH),r=yield(0,Ia.RE)(ns),n=yield(0,Ia.Ys)(A().selectors.getMetadata),a=yield(0,Ia.Ys)(A().selectors.getDataTenants),i=(0,pl.h)(n,a,r);yield(0,Ia.gz)(w.search.actions.updateState({advanced:i,keyword:e,map:t}))}function*bl(e){const{groupId:t,attributeId:r}=e.payload;yield(0,Ia.gz)(nl(t,r)),yield(0,Ia.gz)(Ko(t))}function*vl(){if(yield(0,Ia.Ys)(ki.IJ)){const e=yield(0,Ia.Ys)(io.go),t=yield(0,Ia.Ys)(ki.Xf);for(const r of e){const e=r.entityTypes||[];if((t?e.filter((e=>t.includes(e))):e).length!==e.length){yield(0,Ia.gz)(Ya({silent:!0}));break}}}}const Tl=[function*(){yield(0,Ia.ib)([Ze],yl)},function*(){yield(0,Ia.Fm)([rt],hl)},function*(){yield(0,Ia.ib)(ot,El)},function*(){yield(0,Ia.ib)(at,gl)},function*(){yield(0,Ia.ib)([Xe],bl)}];function Ol(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Sl(e,t,r[t])}))}return e}function Sl(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*xl(){const e=yield(0,Ia.Ys)(ai.FR);yield(0,Ia.RE)(wl);const t=yield(0,Ia.Ys)(ki.tB);yield(0,Ia.gz)(qa(t)),yield(0,Ia.rM)(as,e),yield(0,Ia.rM)(Dl,e),(yield(0,Ia.Ys)(ki.IJ))?yield(0,Ia.rM)(uo,e):yield(0,Ia.rM)(hi)}function*Cl(e){const{debounceTime:t}=e.payload||{};t&&(yield(0,Ia.gw)(t));const r=yield(0,Ia.Ys)(ai.FR);yield(0,Ia.rM)(Al,r)}function*wl(){const e=yield(0,Ia.Ys)(ki.tB);yield(0,Ia.gz)(za(e))}function*Al(e){const t=yield(0,Ia.Ys)(A().selectors.getMetadata),r=yield(0,Ia.Ys)(ki.tB),n=yield(0,Ia.Ys)(ai.fx,{entityTypeUri:r}),a=yield(0,Ia.Ys)(ai.Uz,{entityTypeUri:r}),i=yield(0,Ia.Ys)(ai.L9,{entityTypeUri:r}),o=yield(0,Ia.Ys)(ai.NW,{entityTypeUri:r});let l,s=e,c=[];if(r){const n={fieldName:"type",filter:"equals",values:[r]};s=e.filter((e=>"type"!==e.fieldName)).concat(n);const a=yield(0,Ia.RE)(Pl,r);c=(0,O.uniq)(c.concat(a).concat((0,Na.kx)(t,s,[Na.cI]))),l=!0}else c=(0,O.uniq)(c.concat((0,Na.kx)(t,s,[Na.Bo,Na.cI]))),l=!1;const u=Ol({page:n,rowsPerPage:a,sortOrder:i,sortField:o,forceOvOnly:l},yield(0,Ia.Ys)(A().selectors.getGlobalSearchRequestOptions),{select:c}),p=(0,Na.XP)(s,u),d=yield(0,Ia.Ys)(ai.lF);yield(0,Ia.gz)(Za(!0));try{let e;if(d){const t=(0,Na.kH)(s,u);e=yield(0,Ia.RE)(Hl,t)}else{const t=(0,Na.Lv)(s,u);e=yield(0,Ia.RE)(Hl,B.NV,t)}Array.isArray(e)||(e=[]),yield(0,Ia.RE)(Rl,(0,O.reject)(O.isNil,{query:p,sortField:o,sortOrder:i,dataTenant:d})),e=yield(0,Ia.RE)(zl,e),yield(0,Ia.gz)(Va(e,r))}catch(e){yield(0,Ia.gz)(Va([],r))}yield(0,Ia.gz)(Za(!1))}function*Rl(e){yield(0,Ia.gz)(Ba(e.query));const t=yield(0,Ia.Ys)(A().selectors.getSearchProviderData);(0,O.equals)(null==t?void 0:t.data,e)||(yield(0,Ia.gz)(w.search.actions.setSearchNavigationData(null))),yield(0,Ia.gz)(w.search.actions.setSearchProviderData({type:"search",data:e}))}function*_l(e){const{columns:t,prevColumns:r}=e.payload;if((0,Di.tU)(t,r)){const e=yield(0,Ia.Ys)(ki.o4),t=(yield(0,Ia.Ys)(ai.BP,{entityTypeUri:e})).map((e=>e.uri)),r=yield(0,Ia.RE)(Pl,e),n=yield(0,Ia.Ys)(ai.FR),a=yield(0,Ia.Ys)(A().selectors.getGlobalSearchRequestOptions),i=(0,Na.aG)(t,n,Ol({select:r},a));yield(0,Ia.gz)(Za(!0));try{let t=yield(0,Ia.RE)(Hl,i.url,i.options);t=yield(0,Ia.RE)(zl,t),yield(0,Ia.gz)(Va(t,e))}catch(t){yield(0,Ia.gz)(Va([],e)),si(t)}yield(0,Ia.gz)(Za(!1))}}function*Il(){const e=yield(0,Ia.Ys)(ki.tB),t=yield(0,Ia.Ys)(ai.BP,{entityTypeUri:e});t&&(yield(0,Ia.gz)(w.search.actions.searchResultsSet(t)))}function*Nl(e){const{entityTypeUri:t,keywordValue:r}=e.payload;yield(0,Ia.gz)(((e=!1)=>({type:R.k.CLEAR_ALL_VALUES,payload:{silent:e}}))(!0)),yield(0,Ia.gz)(Qa("type",[t],!0)),yield(0,Ia.gz)(w.search.actions.keywordUpdated({value:r,isRawFilter:!1}))}function*Pl(e){const t=yield(0,Ia.Ys)(ki.Gv,e);return(0,Di.vw)(t)}function*Dl(e){const t=yield(0,Ia.Ys)(A().selectors.getGlobalSearchRequestOptions),r=(0,Na.Vg)(e,[],t);try{const e=yield(0,Ia.RE)(Hl,B.jS,{method:"POST",body:JSON.stringify(r)});yield(0,Ia.gz)(Ga(e.total))}catch(e){yield(0,Ia.gz)(Ga(0))}}function*kl(){yield(0,Ia.RE)(Ul);const e=yield(0,Ia.RE)(Wo,!0);(0,O.isEmpty)(e.query)||(yield(0,Ia.RE)($o,e))}const Ll=[tt];function*Ul(){for(;yield(0,Ia.Ys)(io.UM);)yield(0,Ia.qn)(Ll)}function*jl(e){const{debounceTime:t}=e.payload||{};t&&(yield(0,Ia.gw)(t)),(0,Pa.$L)(e)&&(yield(0,Ia.RE)(us)),(0,O.pathOr)(!1,["payload","silent"],e)||(yield(0,Ia.RE)(xl),yield(0,Ia.RE)(kl))}function*Fl(e){const t=(0,O.path)(["payload","searchOptions"],e),r=(0,O.path)(["payload","errors"],e),n=(0,O.pathOr)(0,["payload","debounceTime"],e);r&&r.length&&((e=[])=>{(0,ii.U)(e,{message:li().text("Can't apply search state")})})(r),!((yield(0,Ia.Ys)(A().selectors.getShowSearchByOv))??(yield(0,Ia.Ys)(ki.cC)))&&t&&t.searchByOv&&(yield(0,Ia.gz)(w.search.actions.updateSearchOptions({searchByOv:!1,ovOnly:!1}))),yield(0,Ia.RE)(ms),yield(0,Ia.RE)(vl),yield(0,Ia.RE)(mo),yield(0,Ia.RE)(fo),yield(0,Ia.RE)(Ml),yield(0,Ia.gz)(((e=0)=>({type:_.Z.STATE_UPDATED,payload:{debounceTime:e}}))(n))}function*Ml(){const e=yield(0,Ia.Ys)(ki.d7),t=yield(0,Ia.Ys)(ai.Qy);!e&&t.length&&(yield(0,Ia.gz)($a(null,null,!0)))}function*Vl(){const e=yield(0,Ia.Ys)(ai.A7),{activityFilter:t,globalFilter:r}=yield(0,Ia.Ys)(A().selectors.getGlobalSearchRequestOptions),n=yield(0,Ia.Ys)(A().selectors.getSearchOptions),a=n&&n.searchByOv,i=[(0,Na.s4)(e,[],{globalFilter:r})];a&&i.push("options=searchByOv"),t&&i.push(`activeness=${t}`);const o=i.filter(O.identity).join("&"),l=new URLSearchParams(o);if(yield(0,Ia.Ys)(A().selectors.getSharedPreferencesEnabled)){const e=yield(0,Ia.Ys)(A().selectors.getServicesPath),t=yield(0,Ia.Ys)(A().selectors.getTenant),r=yield(0,Ia.Ys)(A().selectors.getEnvironment),n=yield(0,Ia.Ys)(A().selectors.getUserName),a=yield(0,Ia.Ys)(ki.XM),i=yield(0,Ia.Ys)(ki.uJ),o=(0,O.pipe)((0,O.map)((0,O.pipe)((0,O.map)((0,O.path)(["attrType","uri"])),(0,O.reject)(v.isEmptyValue))),(0,O.reject)(O.isEmpty)),s="searchExportData",c={name:s,tenant:t,environment:r,user:n,servicesPath:e,value:{searchResultsColumnsUris:(0,Di.gj)(a)?o(i):void 0}};try{yield(0,Ia.RE)(v.setSharedPreferences,c),l.set("sharedPreferenceName",s)}catch(e){si(e)}}yield(0,Ia.gz)(w.ui.actions.openConsoleApp("Export","entities",l.toString()))}function*Bl(){yield(0,Ia.gz)(w.ui.actions.openConsoleApp("Data Loader","projects"))}function*zl(e){const t=yield(0,Ia.Ys)(ai.lF);return e&&t?e.map((0,v.enrichEntityWithDataTenant)(t)):e}function*Hl(e,t){const r=yield(0,Ia.Ys)(A().selectors.getTenant),n=yield(0,Ia.Ys)(ai.lF),a=yield(0,Ia.Ys)(A().selectors.getDtssPath);return yield(0,Ia.RE)(Na.Es,{url:e,options:t,customerTenant:r,dataTenant:n,dtssPath:a})}const Yl=[R.k.CHANGE_VALUES,w.search.constants.KEYWORD_UPDATED,_.Z.REFRESH,R.k.CLEAR_ALL_VALUES,_.Z.MAP_CHANGE_VALUE,_.Z.CLEAR_ALL,_.Z.STATE_UPDATED,it,w.search.constants.SEARCH_OPTIONS_UPDATED,w.search.constants.ACTIVITY_FILTER_UPDATED,w.search.constants.GLOBAL_FILTER_UPDATED,_.Z.CHANGE_CURRENT_TENANT],Wl=[function*(){yield(0,Ia.Fm)(Yl,jl)},function*(){yield(0,Ia.Fm)([_.Z.CHANGE_PAGE,_.Z.RESET_PAGE,_.Z.CHANGE_ROWS_PER_PAGE,_.Z.REFRESH_DISPLAYED_ENTITIES,_.Z.CHANGE_SORT],Cl)},function*(){yield(0,Ia.Fm)(me,_l)},function*(){yield(0,Ia.Fm)([_.Z.UPDATE_ENTITIES,fe,ve],Il)},function*(){yield(0,Ia.Fm)(_.Z.SHOW_MORE_RESULTS_FOR_ENTITY_TYPE,Nl)},function*(){yield(0,Ia.Fm)(w.search.constants.UPDATE_STATE,Fl)},function*(){yield(0,Ia.Fm)(_.Z.EXPORT_RESULTS,Vl)},function*(){yield(0,Ia.Fm)(_.Z.OPEN_DATA_LOADER,Bl)}];var Gl=r(56906);function ql(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*Zl(e,t){try{const[r,n]=yield(0,Ia.RE)($l,e,[]);if((0,O.isNil)(r)||(0,O.isNil)(n))yield(0,Ia.gz)(Ja({[e.fieldName]:[]}));else{const[a,i]=(0,Pa.dG)(e.type),o=(0,Pa.q7)(a,r),l=(0,Pa.q7)(i,n),s=(0,ni.Oz)(e.attrType&&e.attrType.type),[c,u]=s.greaterThan(o,l)?[l,o]:[o,l],p=yield(0,Ia.RE)(Kl,e,c,u,t),d={[e.fieldName]:p};yield(0,Ia.gz)(Ja(d))}}catch(e){console.warn(e)}}function*$l(e,t){const r=yield(0,Ia.Ys)(A().selectors.getGlobalSearchRequestOptions),n=(0,Na.rN)(e,t,[e.fieldName],r),a=yield(0,Ia.RE)(Hl,n.url,n.options),i=Gi(a,[e]),{min:o,max:l,count:s}=(0,Pa.Kn)(i,[e])[e.fieldName];return s?[(0,x.bB)(e)?0:o,l]:[]}function*Kl(e,t,r,n){const a=e.attrType&&e.attrType.type,i=(0,Gl.C)(a),o=i.getInterval(t,r,50),l=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){ql(e,t,r[t])}))}return e}({interval:o,offset:t},yield(0,Ia.Ys)(A().selectors.getGlobalSearchRequestOptions)),s=(0,Na.ti)(e,n,[e.fieldName],l),c=yield(0,Ia.RE)(Hl,s.url,s.options),u=yield(0,Ia.Ys)(A().selectors.getMetadata),p=Gi(c,[e]),d=(0,Pa.HC)(u,p,[e]);return i.addRanges(d[e.fieldName],t,r,o).map(((e,t,n)=>({value:[e.value,t<n.length-1?n[t+1].value:r],number:e.number})))}function Xl(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ql={matches:Na.dW,"dtPotentialMatches.matches":Na.dW,"potentialMatches.matchScore":Na._9};function*Jl(e,t){try{const[r,n]=yield(0,Ia.RE)($l,e,[]);if((0,O.isNil)(r)||(0,O.isNil)(n))yield(0,Ia.gz)(Ja({[e.fieldName]:[]}));else{const[a,i]=(0,Pa.dG)(e.type),o=(0,Pa.q7)(a,r),l=(0,Pa.q7)(i,n),s=yield(0,Ia.RE)(es,e,o,l,t),c={[e.fieldName]:s};yield(0,Ia.gz)(Ja(c))}}catch(e){console.warn(e)}}function*es(e,t,r,n){const a=yield(0,Ia.Ys)(A().selectors.getGlobalSearchRequestOptions),i=Math.min(5,r-t+1),o=yield(0,Ia.RE)(v.rawRequest,Ql[e.fieldNameForRequest||e.fieldName](t,r,i,n,[e.fieldName],function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Xl(e,t,r[t])}))}return e}({},a,{dataTenant:e.dataTenant})));return o.map((e=>({number:e.count,value:[e.from,e.to]})))}function ts(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){rs(e,t,r[t])}))}return e}function rs(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*ns(){const e=yield(0,Ia.Ys)(C.X0),t=yield(0,Ia.Ys)(C.Mp);return Object.values((0,Pa.t8)(e,t))}function*as(e){const t=yield(0,Ia.RE)(ns),[r,n]=(0,O.partition)(x.bB,t);let[a,i]=(0,O.partition)(v.isRangeFacet,n);for(let t=0;t<r.length;t++)yield(0,Ia.rM)(Jl,r[t],e);for(let t=0;t<a.length;t++)yield(0,Ia.rM)(Zl,a[t],e);const[o,l]=(0,O.partition)((e=>e.values&&e.values.length),i);for(let t=0;t<o.length;t++)yield(0,Ia.rM)(os,o[t],e);const[s,c]=(0,O.partition)(x.DT,l);for(const t of s)yield(0,Ia.rM)(ls,[t],e);c.length&&(yield(0,Ia.rM)(ls,c,e))}function*is(e){const t=yield(0,Ia.Ys)(ai.FR),[r,n]=(0,O.partition)(x.bB,e.payload),[a,i]=(0,O.partition)(v.isRangeFacet,n),[o,l]=(0,O.partition)(x.DT,i);for(let e=0;e<r.length;e++)yield(0,Ia.rM)(Jl,r[e],t);for(let e=0;e<a.length;e++)yield(0,Ia.rM)(Zl,a[e],t);for(const e of o)yield(0,Ia.rM)(ls,[e],t);l.length&&(yield(0,Ia.rM)(ls,l,t))}function*os(e,t,r){const n=yield(0,Ia.Ys)(A().selectors.getGlobalSearchRequestOptions),a=(0,Na.aw)([ts({},e,{pageSize:e.pageSize+1})],t,[e.fieldName],n,r);yield(0,Ia.RE)(ss,a,[e])}function*ls(e,t,r){const n=yield(0,Ia.Ys)(A().selectors.getGlobalSearchRequestOptions),a=(0,Na.aw)(e.map((e=>ts({},e,{pageSize:e.pageSize+1}))),t,[],n,r);yield(0,Ia.RE)(ss,a,e)}function*ss(e,t){yield(0,Ia.RE)(Ki,e,t,Ja)}function*cs(e){const{facetFieldName:t,value:r,debounceTime:n,pageNumber:a=1,currentOptions:i=[]}=e.payload;if(""===r&&1===a)yield(0,Ia.gz)((e=>({type:R.k.DESTROY_FILTERED_DATA,payload:e}))(t));else{const e=yield(0,Ia.Ys)(C.X0),o=yield(0,Ia.Ys)(C.Mp),l=ts({},(0,Pa.t8)(e,o)[t]);if("type"===t){const e={[t]:[...l.data.filter((e=>e.label.toLowerCase().includes(r.toLowerCase())))]};yield(0,Ia.gz)(ei(e))}else{n&&(yield(0,Ia.gw)(n));const e=yield(0,Ia.Ys)(ai.FR),o=yield(0,Ia.Ys)(C.rM,t),s=e=>ei({[t]:i.concat(e[t])});r?yield(0,Ia.rM)(ro,ts({},l,{displayedItems:o,pageNumber:a,pageSize:l.pageSize+1}),e,r,s):yield(0,Ia.rM)(Xi,ts({},l,{pageNumber:a,pageSize:l.pageSize+1}),e,s)}}}function*us(){const e=yield(0,Ia.Ys)(C.DX),t=t=>t.entityTypeUri&&t.entityTypeUri!==e[0],r=yield(0,Ia.Ys)(C.Mp);if(1!==e.length||r.some(t)){const n=r.filter((r=>1!==e.length&&!!r.entityTypeUri||1===e.length&&t(r))).map((e=>e.fieldName));n.length&&(yield(0,Ia.gz)(Xa(n)))}}function*ps(e){const{facetsToAdd:t=[],fieldNamesToDelete:r=[],changedEntityTypes:n,addToEnd:a=!1}=e.payload;if(t.length||r.length){t.length&&(yield(0,Ia.gz)(Ka(t,a)));const e=yield(0,Ia.RE)(ns);let o=!1;if(r.length){const t=e.filter((e=>e.values&&e.values.length));o=r.some((e=>t.some((t=>{var r;return null===(r=t.fieldName)||void 0===r?void 0:r.startsWith(e)})))),yield(0,Ia.gz)(Xa(r))}if(null!=n)yield(0,Ia.gz)(Qa("type",n));else if(o)yield(0,Ia.gz)((({debounceTime:e}={})=>({type:_.Z.REFRESH,payload:{debounceTime:e}}))());else if(t.length){const r=e.filter((e=>t.some((t=>e.fieldName.startsWith(t.fieldName)))));yield(0,Ia.gz)((i=r,{type:R.k.REQUEST_GIVEN_FACETS_DATA,payload:i}))}}var i}function*ds(){const e=yield(0,Ia.Ys)(A().selectors.getSearchKeyword),t=yield(0,Ia.Ys)(ai.vH),r=yield(0,Ia.Ys)(io.go),n=yield(0,Ia.Ys)(A().selectors.getMetadata),a=yield(0,Ia.Ys)(A().selectors.getDataTenants);if(Ua(n,r,a)){const i=((e,t,r)=>{const n=Ma(e,t,r),a=Fa(e,t,r),i=(0,O.pipe)(O.flatten,O.uniq)((0,lt.VO)(t)),o=(0,x.$t)(e);return a.reduce(((e,{fieldName:t,values:r})=>{const a=n.find((e=>e.fieldName===t));return a&&(e.facetsConfigs.push(a),e.facetsData[t]={values:r}),e}),{facetsConfigs:[o],facetsData:{[o.fieldName]:(l=i,(0,Pa.Kk)({values:l})?{values:l,showAllItems:!0}:{values:l})}});var l})(n,r,a);yield(0,Ia.gz)(w.search.actions.updateState({facets:i,keyword:e,map:t}))}}function*ms(){if(!(yield(0,Ia.Ys)(ki.IJ))){const e=yield(0,Ia.Ys)(A().selectors.getMetadata);if((yield(0,Ia.Ys)(C.Mp)).some(v.isTypeFacet)){const e=yield(0,Ia.Ys)(ki.Xf),t=yield(0,Ia.Ys)(C.DX);(e?t.filter((t=>e.includes(t))):t).length!==t.length&&(yield(0,Ia.gz)(Ya({silent:!0})))}else{const t=[(0,x.$t)(e)];yield(0,Ia.gz)(Ka(t))}}}function*fs(){const e=yield(0,Ia.Ys)(A().selectors.getMetadata),t=yield(0,Ia.Ys)(C.X0),r=(0,Pa.t8)({type:t.type},[(0,x.$t)(e)]).type.data.reduce(((e,t)=>(e[(0,v.getLastUriPart)(t.value)]=t.number,e)),{}),n=yield(0,Ia.Ys)(ki.Xf);return(0,Pa.wW)(e,r,n)}const ys=[function*(){yield(0,Ia.Fm)([R.k.FILTER_FACET_DATA],cs)},function*(){yield(0,Ia.ib)(R.k.REQUEST_GIVEN_FACETS_DATA,is)},function*(){yield(0,Ia.ib)(R.k.HANDLE_CONFIGS_CHANGES,ps)},function*(){yield(0,Ia.ib)(R.k.CONVERT_FROM_ADVANCED_SEARCH,ds)}];function gs(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const hs=e=>{const t=["view","searchResultsColumns"],r=(0,O.pathOr)({},t,e),n=(0,O.map)((0,O.map)((0,O.pipe)((0,O.omit)(["size"]),(e=>e.attrType?function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){gs(e,t,r[t])}))}return e}({},e,{attrType:{uri:(0,O.pathOr)("",["attrType","uri"],e)}}):e))),r),a=(0,O.lensPath)(t),i=(0,O.omit)(["sortField","sortOrder","entityTypeTab"],e.view),o=(0,O.lensPath)(["view"]),l=["keyword"],s=(0,O.pathOr)("",l,e),c=(0,O.lensPath)(l),u=["map"],p=(0,O.pathOr)("",u,e),d=(0,O.lensPath)(u);return(0,O.pipe)((0,O.omit)(["searchOptions"]),(0,O.set)(o,i),(0,O.set)(a,n),(0,O.set)(c,s),(0,O.set)(d,p))(e)},Es=({savedUiState:e,actualUiState:t})=>{const r=hs(e),n=hs(t);if(!(0,O.equals)(r,n))return!1;if((0,O.path)(["view","searchResultsMode"],e)===B.ll.TABLE){const r=["view","sortField"],n=["view","sortOrder"],a=["view","entityTypeTab"],i=(0,O.path)(r,e),o=(0,O.path)(r,t),l=(0,O.path)(n,e),s=(0,O.path)(n,t),c=(0,O.path)(a,e),u=(0,O.path)(a,t);if(!(0,O.equals)(i,o)||!(0,O.equals)(l,s)||!(0,O.equals)(c,u))return!1}const a=["searchOptions"],i=(0,O.pathOr)(null,a,e),o=(0,O.pathOr)(null,a,t);return!!((0,O.isNil)(i)||(0,O.isNil)(o)||(0,O.equals)(i,o))};function bs(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){vs(e,t,r[t])}))}return e}function vs(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*Ts({payload:{share:e}}){const{query:t,uiState:r}=yield(0,Ia.RE)(Wo,!0),n=bs({},yield(0,Ia.Ys)(_o.LA),{isPublic:e===B.ib.public,query:t,uiState:r}),a=yield(0,Ia.Ys)(_o.tp);yield(0,Ia.gz)(vi(!1));try{yield(0,Ia.gz)(_i(li().text("Updating search..."))),yield(0,Ia.RE)(v.updateSavedSearch,n),yield(0,Ia.gz)(To(!1)),yield(0,Ia.gz)(_i(li().text("Search updated successfully"))),a&&(yield(0,Ia.gz)(a))}catch(e){si(e)}}function*Os(){const e=yield(0,Ia.Ys)(_o.LA);if(!e)return void(yield(0,Ia.gz)(To(!1)));const t=yield(0,Ia.Ys)(A().selectors.getMetadata),r=yield(0,Ia.Ys)(A().selectors.getDataTenants),n=yield(0,Ia.Ys)(A().selectors.getCanUserReadWorkflowDataTask),{uiState:a}=(0,Io.z7)(t,r,n,yield(0,Ia.RE)(Wo)),i=Es({savedUiState:e.uiState,actualUiState:a});yield(0,Ia.gz)(To(!i))}function*Ss(e){const t=yield(0,Ia.Ys)(_o.LA);if(t)switch(e.type){case gr:case ur:case dr:t.uri===e.payload.uri&&(yield(0,Ia.gz)(vo(bs({},t,e.payload))));break;case vr:(0,O.includes)(t.uri,e.payload)&&(yield(0,Ia.gz)(vo(null)));break;case Qt:yield(0,Ia.gz)(vo(bs({},t,{isPublic:e.payload.share===B.ib.public})));break;default:(yield(0,Ia.Ys)(ai.kw))&&(yield(0,Ia.gz)(vo(null)))}}function*xs(e){const t=yield(0,Ia.Ys)(_o.EH,e);if(t)return t;const r=yield(0,Ia.Ys)(A().selectors.getMetadata),n=yield(0,Ia.Ys)(A().selectors.getDataTenants),a=yield(0,Ia.Ys)(A().selectors.getCanUserReadWorkflowDataTask);try{const t=yield(0,Ia.RE)(v.getSavedSearch,(0,Io.tk)(e));return(0,Io.z7)(r,n,a,t)}catch(e){return si(e),null}}function*Cs(e){const t=(0,O.path)(["payload","currentSavedSearchUri"],e);if(!t)return;const r=yield(0,Ia.Ys)(_o.LA);if((0,O.prop)("uri",r)===t)return;const n=yield(0,Ia.RE)(xs,t);n&&(yield(0,Ia.gz)(vo(n)),yield(0,Ia.RE)(Os))}const ws=[...Yl,fe,_.Z.CHANGE_SORT,ve,me,he,ge,Te,R.k.CREATE_FACETS,R.k.DESTROY_FACETS,R.k.SHOW_MORE_ENTITY_TYPES],As=[function*(){yield(0,Ia.Fm)(ws,Os)},function*(){yield(0,Ia.Fm)([Qt],Ts)},function*(){yield(0,Ia.Fm)([gr,ur,dr,vr,Qt,...Yl],Ss)},function*(){yield(0,Ia.Fm)(w.search.constants.UPDATE_STATE,Cs)}];function Rs(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const _s=500;function*Is(){yield(0,Ia.gw)(_s);const{uiState:e,query:t}=yield(0,Ia.RE)(Wo,!1,!0),r=yield(0,Ia.Ys)(_o.LA);yield(0,Ia.gz)(w.search.actions.saveState(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Rs(e,t,r[t])}))}return e}({},e,{query:t,currentSavedSearchUri:(0,O.path)(["uri"],r)})))}function*Ns(){yield(0,Ia.qn)(w.search.constants.UPDATE_STATE);const e=(0,O.reject)((0,O.includes)(O.__,[_.Z.REFRESH]),ws);yield(0,Ia.Fm)([Kt,...e],Is)}const Ps=e=>({type:Ar,payload:e}),Ds=(e,t)=>({type:Ir,payload:{searchCreatedDate:e,total:t}}),ks=()=>({type:Dr}),Ls=e=>({type:Lr,payload:e}),Us=e=>({type:jr,payload:e}),js=(e,t)=>({type:Vr,payload:{searchCreatedDate:e,isLoading:t}});var Fs=r(97010),Ms=r(73667);const Vs=(0,O.path)([B.Jf,"recentSearches"]),Bs=e=>Vs(e).items,zs=e=>Vs(e).filterWord,Hs=(0,O.curry)(((e,t)=>!e||t&&t.name.toLocaleLowerCase().includes(e.toLocaleLowerCase()))),Ys=e=>(0,O.pipe)(Bs,(0,O.filter)(Hs(zs(e))))(e),Ws=e=>Vs(e).loading,Gs=(0,Ms.Rm)(Bs),qs=(0,Ms.d1)(Bs),Zs=(0,Ms.Ky)(Bs),$s=(0,Ms.$y)(Bs),Ks=e=>Vs(e).lastSavedRecentSearch,Xs=(e,t)=>Bs(e).find((0,O.propEq)("createdDate",t)),Qs=(0,O.path)(["advancedSearch","searchParams","groups"]);function Js(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){ec(e,t,r[t])}))}return e}function ec(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*tc(){yield(0,Ia.gz)(Us(!0));try{const t=yield(0,Ia.Ys)(A().selectors.getTenant),r=yield(0,Ia.Ys)(A().selectors.getEnvironment),n=yield(0,Ia.Ys)(A().selectors.getServicesPath),{result:a=[]}=yield(0,Ia.RE)(v.getRecentSearches,{environment:r,tenant:t,servicesPath:n}),i=(0,O.sort)((0,O.descend)((0,O.prop)("createdDate")))(a);yield(0,Ia.gz)((e=i,{type:_r,payload:e})),yield(0,Ia.gz)(Us(!1)),yield(0,Ia.RE)(ac,i)}catch(e){si(e),yield(0,Ia.gz)(Us(!1))}var e}function*rc(e){const t=yield(0,Ia.Ys)(Xs,e.payload);yield(0,Ia.RE)(nc,t)}function*nc(e,t){yield(0,Ia.gz)(js(e.createdDate,!0));try{const{total:r}=yield(0,Ia.RE)(v.getTotalsForQuery,(0,v.replacePlaceholdersInQuery)(e.query),Boolean(t));yield(0,Ia.gz)(Ds(e.createdDate,r))}catch(e){si(e)}yield(0,Ia.gz)(js(e.createdDate,!1))}function*ac(e){const t=yield(0,Ia.Ys)(A().selectors.getQueryEstimatorEnabled);return yield(0,Ia.$6)(e.map((e=>(0,Ia.RE)(nc,e,t))))}function*ic(){const e=yield(0,Ia.Ys)($s),t=yield(0,Ia.Ys)(A().selectors.getServicesPath);yield(0,Ia.gz)(Us(!0));try{yield(0,Ia.$6)(e.map((e=>(0,Ia.RE)(v.deleteRecentSearch,Js({},e,{servicesPath:t}))))),yield(0,Ia.gz)(Ls(e))}catch(e){si(e)}yield(0,Ia.gz)(Us(!1))}function*oc(e){const t=e.payload,r=yield(0,Ia.Ys)(A().selectors.getServicesPath);yield(0,Ia.gz)(Us(!0));try{yield(0,Ia.RE)(v.deleteRecentSearch,Js({},t,{servicesPath:r})),yield(0,Ia.gz)(Ls([t]))}catch(e){si(e)}yield(0,Ia.gz)(Us(!1))}function*lc(e){const{debounceTime:t}=e.payload??{};t&&(yield(0,Ia.gw)(t));const{query:r,uiState:n}=yield(0,Ia.RE)(Wo,!0),a=yield(0,Ia.Ys)(ki.$s),i=yield(0,Ia.Ys)(Ks),o=yield(0,Ia.Ys)(ai.kw),l=yield(0,Ia.Ys)(A().selectors.getTenant),s=yield(0,Ia.Ys)(A().selectors.getEnvironment),c=yield(0,Ia.Ys)(A().selectors.getServicesPath),u=((e={})=>{const t=Qs(e);return t&&t.length>0?((e={})=>{const t=(0,O.chain)((0,O.prop)("attributes")),r=(0,O.filter)((0,O.has)("values")),n=(0,O.pipe)(Qs,t,r),a=(0,O.pipe)((0,O.prop)("values"),(0,O.map)((0,O.prop)("label")),(0,O.join)(", ")),i=(0,O.path)(["data","title"]),o=(0,O.pathEq)(["data","fieldName"],"type"),l=(0,O.find)(o),s=(0,O.pipe)(l,(0,O.when)(O.identity,a)),c=(0,O.pipe)((0,O.reject)(o),(0,O.map)(i),(0,O.reject)(O.isNil),(0,O.join)(", "));return[s(u=n(e)),c(u)].filter(O.identity).join(" - ");var u})(e):((e={})=>{const t=(0,O.prop)("facets"),r=(0,O.prop)("facetsData"),n=(0,O.prop)("facetsConfigs"),a=(0,O.prop)("values"),i=(0,O.prop)("label"),o=(0,O.prop)("title"),l=(0,O.pipe)(a,(e=>e&&e.length>0)),s=(0,O.curry)(((e,r)=>(0,O.pipe)(t,n,(0,O.find)((0,O.propEq)("fieldName",r)),(0,O.defaultTo)({}),o)(e))),c=(0,Pa.XK)(e),u=[];c&&u.push(a(c).map((e=>(0,O.pipe)((0,O.propOr)([],"data"),(0,O.find)((0,O.propEq)("value",e)),(0,O.defaultTo)({}),i))).map((e=>e(c))).join(", "));const p=(0,O.pipe)(t,r,O.values,(0,O.reject)(v.isTypeFacet),(0,O.filter)(l),(0,O.map)((0,O.prop)("fieldName"))),d=(0,O.pipe)(p,(0,O.map)(s(e)))(e);return d.length>0&&u.push(d.join(", ")),u.filter(O.identity).join(" - ")})(e)})(a),p=(0,v.getHash)(r),d={query:r,state:n,name:u,environment:s,tenant:l};try{if(i!==p&&!o){const e=yield(0,Ia.RE)(v.createRecentSearch,d,c);e.success?yield(0,Ia.gz)((e=>({type:Mr,payload:e}))(p)):si(e)}}catch(e){si(e)}}function*sc(e){const{search:t,debounceTime:r}=e.payload;yield(0,Ia.gz)(bi(!1));const n=yield(0,Ia.Ys)(A().selectors.getMetadata),a=yield(0,Ia.Ys)(A().selectors.getDataTenants),i=yield(0,Ia.Ys)(A().selectors.getCanUserReadWorkflowDataTask);let o={};try{o=(0,O.pipe)(Fs.Z,(0,Fs.f)(null))(n,JSON.parse(t.state),{},a,i)}catch(e){o={}}(yield(0,Ia.Ys)(ai.lF))&&(o.currentTenant=yield(0,Ia.Ys)(A().selectors.getTenant)),yield(0,Ia.gz)(w.search.actions.updateState(Js({},o,{debounceTime:r})))}const cc=({type:e,payload:t={}})=>e===w.search.constants.KEYWORD_UPDATED&&!(null==t||!t.saveToRecent),uc=[function*(){yield(0,Ia.Fm)([Rr],tc)},function*(){yield(0,Ia.ib)(kr,ic)},function*(){yield(0,Ia.Fm)([w.ui.constants.UIActions.OPEN_ENTITY,$t,Qt,Ar,_.Z.CHANGE_PAGE,_.Z.CHANGE_ROWS_PER_PAGE,_.Z.EXPORT_RESULTS,cc],lc)},function*(){yield(0,Ia.Fm)([zr],sc)},function*(){yield(0,Ia.ib)([Br],rc)},function*(){yield(0,Ia.ib)(Ur,oc)}],pc=e=>e[B.Jf].entity.loading,dc=e=>e[B.Jf].entity.selectedEntityUri,mc=e=>e[B.Jf].entity.entity,fc=e=>({type:dn,payload:e}),yc=e=>({type:mn,payload:e}),gc=e=>({type:fn,payload:e}),hc=e=>({type:yn,payload:e});function*Ec(e){if(yield(0,Ia.Ys)(ai.lF)){const t=yield(0,Ia.RE)(Hl,(0,v.getDtssEntityUrl)(e));return(yield(0,Ia.RE)(zl,t))[0]}{const t=yield(0,Ia.Ys)(A().selectors.getMetadata),r=(0,v.addMetadataSpecificGetEntityOptions)(t);return yield(0,Ia.RE)(v.getEntity,e,r)}}function*bc(e){const t=e.payload;(yield(0,Ia.Ys)(dc))!==t&&(yield(0,Ia.gz)(gc(t)));const r=yield(0,Ia.Ys)(mc);if(yield(0,Ia.gz)(fc(!0)),(0,O.isNil)(t))yield(0,Ia.gz)(hc(null));else if(!r||r.uri!==t)try{const e=yield(0,Ia.RE)(Ec,t);yield(0,Ia.gz)(hc(e))}catch(e){n=e,(0,ii.U)(n,{defaultMessage:li().text("Can't load entity")}),yield(0,Ia.gz)(hc(null))}var n;yield(0,Ia.gz)(fc(!1))}const vc=[function*(){yield(0,Ia.Fm)(mn,bc)}];function*Tc(e){const t="type"===(0,O.path)(["payload","facetFieldName"],e),r=(0,O.path)(["payload","values"],e);if(!t||1!==(0,O.length)(r))return;const n=yield(0,Ia.Ys)(A().selectors.getMetadata),a=(0,v.getEntityType)(n,r[0]),i=a.defaultFacetedAttributes||[];if(i.length>0){const e=yield(0,Ia.Ys)(C.Mp),t=({fieldName:t})=>(0,O.none)((0,O.propEq)("fieldName",t),e),r=(0,ci.vf)(n,a).map((e=>(0,ci.NG)(n,e,a.uri,"",x.u7))),o=i.reduce(((e,n)=>{const a=(0,v.attributeUriToSearchUri)(n),i=(0,x.zy)(r,a);return i&&t(i)?e.concat(i.children?(0,ci.jj)(i).filter(t):i):e}),[]);o.length>0&&(yield(0,Ia.gz)(Ka(o,!0)))}}const Oc=[function*(){yield(0,Ia.Fm)(R.k.CHANGE_VALUES,Tc)}],Sc=e=>({type:Nn,payload:e}),xc=()=>({type:kn}),Cc=()=>({type:Sn}),wc=e=>({type:wn,payload:e}),Ac=e=>({type:Rn,payload:e}),Rc=e=>({type:In,payload:e}),_c=e=>({type:Dn,payload:e}),Ic=e=>({type:Ln,payload:e}),Nc=({id:e,groupId:t})=>({type:Mn,payload:{id:e,groupId:t}}),Pc=({id:e,groupId:t,operationParameters:r})=>({type:Fn,payload:{id:e,groupId:t,operationParameters:r}}),Dc=(e,t,r)=>({type:Bn,payload:{groupId:e,attributeId:t,attribute:ft(r)}}),kc=(e,t,r)=>({type:zn,payload:{groupId:e,attributeId:t,attributeData:yt(r)}}),Lc=(e,t)=>({type:zn,payload:{groupId:e,attributeId:t,attributeData:null}}),Uc=(e,t,r)=>({type:Hn,payload:{groupId:e,attributeId:t,selectInfo:r}}),jc=(e,t)=>({type:Yn,payload:{groupId:e,attributeId:t}}),Fc=(e,t,r)=>({type:Wn,payload:{groupId:e,attributeId:t,filter:r}}),Mc=(e,t,r)=>({type:Gn,payload:{groupId:e,attributeId:t,values:r}}),Vc=e=>({type:Kn,payload:e});var Bc=r(27901);const zc=(0,O.has)("actions"),Hc=e=>e.actions.map((0,O.assocPath)(["operationParameters","conditions"],e.conditions)),Yc=(0,O.path)(["operationParameters","attributeTypeData","attributeType"]),Wc=(0,O.path)(["operationParameters","attributeTypeData","fieldName"]),Gc=(0,O.path)(["operationParameters","pin"]),qc=(0,O.path)(["operationParameters","addNestedAttribute"]),Zc=(0,O.path)(["operationParameters","attributeValue"]),$c=(0,O.path)(["operationParameters","attributeValueToFind"]),Kc=(0,O.anyPass)([(0,O.equals)(Xn.d.AddNew),(0,O.equals)(Xn.d.ReplaceAllWith)]),Xc=(0,O.anyPass)([(0,O.equals)(Xn.d.AddNew),(0,O.equals)(Xn.d.ReplaceAllWith),(0,O.equals)(Xn.d.FindAndReplace)]),Qc=(0,O.equals)(Xn.d.AddNew),Jc=(0,O.both)((0,O.pipe)(Yc,v.isNested),(0,O.pipe)((0,O.prop)("operation"),Kc)),eu=(0,O.both)((0,O.pipe)(Yc,v.isReference),(0,O.pipe)((0,O.prop)("operation"),Qc)),tu=(0,O.both)((0,O.pipe)(Zc,v.isLookupAttrType),(0,O.pipe)((0,O.prop)("operation"),Xc)),ru=(0,O.pipe)(Yc,v.isLookupAttrType),nu=e=>{switch(e){case Xn.d.AddNew:case Xn.d.RepointReference:case Xn.d.ReplaceAllWith:return["attributeValue"];case Xn.d.FindAndReplace:return["attributeValueToFind","attributeValue"];case Xn.d.FindAndRemove:return["attributeValueToFind"];default:return[]}},au=e=>{if(!e.operation||!e.operationParameters)return!1;const t=Jc(e),r=eu(e),n=ru(e),a=nu(e.operation);for(let i of a){const a=e.operationParameters[i];if((0,v.isEmptyValue)(a)||n&&(0,v.isEmptyValue)((0,v.getAttrTypeLookupCode)(a))||r&&(0,v.isEmptyValue)((0,v.getReferencedEntityFromAttrValue)(a))||t&&(0,v.isEmptyValue)((0,v.cleanAttributesWith)({deleteEmptyComplex:!0})(a.value)))return!1}return!0},iu=e=>{const t=Jc(e),r=eu(e);return t||r?nu(e.operation).reduce(((e,t)=>{const r=["operationParameters",t,"value"];if((0,O.path)(r,e)){const t=(0,O.lensPath)(r);return(0,O.over)(t,(0,v.cleanAttributesWith)({deleteEmptyComplex:!0}),e)}return e}),e):e},ou=e=>e[B.Jf].bulkUpdate.operation,lu=e=>e[B.Jf].bulkUpdate.activeStep,su=e=>e[B.Jf].bulkUpdate.loading,cu=e=>{const t=(0,ki.IJ)(e)?(0,io.V6)(e):(0,C.DX)(e),r=(0,ki.tB)(e);return r||1===t.length?r||t[0]:null},uu=(0,O.path)([B.Jf,"bulkUpdate","objects"]),pu=e=>uu(e).total,du=e=>uu(e).selectionMode,mu=e=>uu(e).entities,fu=e=>uu(e).selectedEntities,yu=e=>uu(e).page,gu=e=>uu(e).rowsPerPage,hu=e=>uu(e).sortField,Eu=e=>uu(e).sortOrder,bu=e=>uu(e).selectedColumns,vu=e=>uu(e).filterText,Tu=(0,O.pipe)(du,(0,O.equals)(B.v6.include)),Ou=(0,O.ifElse)(Tu,(0,O.pipe)(fu,O.length),(e=>{const t=fu(e).length;return(0,ai.hX)(e)-t})),Su=(0,O.pipe)(Ou,(0,O.gt)(O.__,0)),xu=e=>e[B.Jf].bulkUpdate.actions,Cu=(0,Bc.P1)(xu,(0,O.pipe)((0,O.map)((0,O.ifElse)(zc,(0,O.evolve)({actions:(0,O.pipe)((0,O.map)(iu),(0,O.filter)(au))}),iu)),(0,O.filter)((0,O.ifElse)(zc,(0,O.pipe)((0,O.path)(["actions","length"]),(0,O.gt)(O.__,0)),au)))),wu=(0,Bc.P1)(xu,(0,O.pipe)((0,O.map)((0,O.when)(zc,(0,O.prop)("actions"))),O.flatten)),Au=e=>{const t=wu(e);return 0!==t.length&&t.every(au)},Ru=e=>e[B.Jf].bulkUpdate.requestPending,_u=(0,v.getUrisForSaving)((e=>(0,O.equals)(e.slice(-3),["operationParameters","attributeValue","entityUri"]))),Iu=(e,t)=>{const r=(0,v.findAllTemporaryRefEntityURI)(t),n=(a=t,(0,O.pipe)(_u,(0,v.getPathsWithTempUri)(a),(0,O.map)((e=>(0,O.path)(e,a))))(a));var a;return r.concat(n).filter((t=>e[t]))},Nu=(0,O.curry)(((e,t,r)=>{const n=(0,O.pipe)(_u,(0,O.find)((t=>(0,O.pathSatisfies)((t=>t===e),t,r))))(r);return n?(0,O.set)((0,O.lensPath)(n),t,r):r})),Pu=(e,t,r)=>(0,O.pipe)(Nu(e,t),(0,O.when)((e=>e===r),(0,v.replaceTemporaryRefEntityURI)(e,t)))(r),Du=(0,O.pathEq)(["data","fieldName"],B.E_),ku=(0,O.pipe)((0,O.path)(["values",0,"entityUri"]),(0,O.objOf)("uri"),v.getEntityId,v.wrapInQuotes),Lu=e=>[{attributes:e,operator:"or"}],Uu=(0,O.curry)(((e,t,r)=>r.map((r=>{const{data:{fieldName:n}}=r,a=n.split(".");let[i,o]=((e,t)=>{let r=0;for(;r<Math.min(e.length,t.length)&&e[r]===t[r];r++);return[e.slice(r),t.slice(r)]})(a,e.split(".")),l=o.length;t===B.Vp.AddAttribute&&l--,i.length||(i=a.slice(-1),l++);const s=`${(0,O.repeat)("parent.",Math.max(0,l)).join("")}attributes.${i.join(".")}`;return(0,O.assocPath)(["data","fieldName"],s,r)})))),ju=(0,O.curry)(((e,t,r)=>{const n=((e,t,r)=>{const[n,a]=(0,O.partition)(Du,e),i=(0,O.pipe)(Uu(t,r),Lu,Na.Jk)(a),o=n.length?(e=>`in(${B.E_}, ${e.map(ku).join(",")})`)(n):"";return i&&o?`${i} and ${o}`:i||o})(e,t,r.operation);return(0,O.isEmpty)(n)?r:(0,O.ifElse)((0,O.pipe)((0,O.path)(["operationParameters","valueFilter"]),v.isEmptyValue),(0,O.assocPath)(["operationParameters","valueFilter"],n),(0,O.evolve)({operationParameters:{valueFilter:(0,O.concat)(O.__,` and (${n})`)}}))(r)}));var Fu=r(9828);function Mu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Vu(e,t,r[t])}))}return e}function Vu(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Bu=e=>{const t=(0,O.pipe)((0,O.pick)(["pin"]),(0,O.assoc)("value",zu(e)))(e);return(0,Fu.Kn)(t.value)?Object.keys(t.value).reduce(((e,r)=>(e.value=Mu({},e.value,{[r]:t.value[r].map(Bu)}),e)),t):t},zu=(0,O.when)(Fu.Kn,(0,O.ifElse)((0,O.has)("lookupCode"),(0,O.prop)("lookupCode"),(0,O.prop)("value"))),Hu=(0,O.cond)([[Jc,(0,O.pipe)(Zc,Bu)],[eu,(0,O.pipe)(Zc,(e=>{const{refEntity:t=[],refRelation:r=[]}=e;return Mu({refEntity:(0,O.pipe)(O.head,(0,O.pick)(["objectURI"]))(t),refRelation:(0,O.pipe)(O.head,(0,O.pick)(["type"]))(r)},Bu(e))}))],[tu,(0,O.pipe)(Zc,zu)],[O.T,Zc]]),Yu=(0,O.pipe)(Hu,(0,O.assocPath)(["operationParameters","attributeValue"])),Wu=(0,O.ifElse)(Gc,(()=>(0,O.assocPath)(["operationParameters","pin"],!0)),(()=>O.identity)),Gu=(0,O.ifElse)(qc,(()=>(0,O.assocPath)(["operationParameters","addNestedAttribute"],!0)),(()=>O.identity)),qu=(0,O.pipe)($c,(0,O.ifElse)(O.isNil,(()=>O.identity),(0,O.pipe)(((e="")=>`equals(value, '${zu(e)}')`),(0,O.assocPath)(["operationParameters","valueFilter"])))),Zu=(0,O.pipe)(Zc,(0,O.prop)("entityUri"),(0,O.assocPath)(["operationParameters","referencedEntity","uri"])),$u=(e,t)=>({operationParameters:{attributeURI:e},operation:t}),Ku=(e,t)=>(0,O.pipe)($u,Yu(e),Wu(e),Gu(e))(t,B.Vp.AddAttribute),Xu=(e,t)=>(0,O.pipe)($u,qu(e))(t,B.Vp.DeleteAttribute),Qu=(e,t)=>(0,O.pipe)($u,Yu(e),Wu(e),qu(e))(t,B.Vp.UpdateAttribute),Ju=(e,t)=>(0,O.pipe)($u,Zu(e))(t,B.Vp.RepointReferencedEntity),ep=(e,t)=>(0,O.reject)(O.isNil,{operationParameters:e,operation:t}),tp=e=>ep({tags:[Zc(e)]},B.Vp.AddTags),rp=e=>ep({newValue:Zc(e),oldValue:$c(e)},B.Vp.ReplaceTag),np=e=>ep({tags:[$c(e)]},B.Vp.DeleteTags),ap=()=>ep(null,B.Vp.ClearTags),ip=(e,t={},r=[],n=[],a={})=>({objects:op(t,n,a),actions:lp(e,r)}),op=(e,t=[],r={})=>{const{selectionMode:n,selectedEntities:a=[]}=e,{searchOptions:i,activityFilter:o,globalFilter:l}=r;return n===B.v6.include?{list:a,activeness:o}:{filter:(0,O.pipe)(Na.XP,(0,v.addGlobalFilterToQuery)(l))(t),excludeList:a,options:i,activeness:o}},lp=(0,O.curry)(((e,t)=>(0,O.chain)((0,O.ifElse)(zc,(0,O.pipe)(Hc,lp(e)),sp(e)))(t))),sp=(0,O.curry)(((e,t)=>{const r=(0,O.pathOr)([],["operationParameters","conditions"],t),n=Wc(t);return(0,O.pipe)(up(e),(0,O.map)(ju(r,n)))(t)})),cp=(0,O.curry)((e=>(0,O.propEq)("operation",e))),up=(0,O.curry)(((e,t)=>{const r=Wc(t),n=r.includes(".")?(0,v.searchUriToAttrUri)(r,e):r,a=r===v.EntityAttrTypes.tags.uri;return(0,O.cond)([[(0,O.both)((0,O.always)(a),cp(Xn.d.AddNew)),()=>[tp(t)]],[(0,O.both)((0,O.always)(a),cp(Xn.d.Clear)),()=>[ap()]],[(0,O.both)((0,O.always)(a),cp(Xn.d.ReplaceAllWith)),()=>[ap(),tp(t)]],[(0,O.both)((0,O.always)(a),cp(Xn.d.FindAndReplace)),()=>[rp(t)]],[(0,O.both)((0,O.always)(a),cp(Xn.d.FindAndRemove)),()=>[np(t)]],[cp(Xn.d.AddNew),()=>[Ku(t,n)]],[cp(Xn.d.Clear),()=>[Xu(t,n)]],[cp(Xn.d.ReplaceAllWith),()=>[Xu(t,n),Ku(t,n)]],[cp(Xn.d.FindAndReplace),()=>[Qu(t,n)]],[cp(Xn.d.FindAndRemove),()=>[Xu(t,n)]],[cp(Xn.d.RepointReference),()=>[Ju(t,n)]]])(t)}));function pp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){dp(e,t,r[t])}))}return e}function dp(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*mp(e){if(e.payload){const e=yield(0,Ia.Ys)(ki.tB);let r;do{if(r=yield(0,Ia.Ys)(ai.BP,{entityTypeUri:e}),r)break;yield(0,Ia.qn)(_.Z.UPDATE_ENTITIES)}while(!r);const n=yield(0,Ia.Ys)(cu),a=yield(0,Ia.Ys)(ai.fx,{entityTypeUri:e}),i=yield(0,Ia.Ys)(ai.Uz,{entityTypeUri:e}),o=(yield(0,Ia.Ys)(ai.L9,{entityTypeUri:e}))||void 0,l=yield(0,Ia.Ys)(ai.NW,{entityTypeUri:e}),s=(yield(0,Ia.RE)(so))[n].filter((0,O.pipe)((0,O.prop)("id"),v.isAttributeSearchUri,O.not)),c=e?yield(0,Ia.Ys)(ki.Gv,e):s,u=yield(0,Ia.Ys)(ai.NU,{entityTypeUri:e});yield(0,Ia.gz)((t={page:a,rowsPerPage:i,sortOrder:o,sortField:l,selectedColumns:c,total:u,entities:r},{type:On,payload:t}))}var t}function*fp(e){const t=yield(0,Ia.Ys)(A().selectors.getMetadata),r=yield(0,Ia.Ys)(yu),n=yield(0,Ia.Ys)(gu),a=yield(0,Ia.Ys)(Eu),i=yield(0,Ia.Ys)(hu),o=yield(0,Ia.RE)(xp),l=(0,O.uniq)(o.concat((0,Na.kx)(t,e))),s=pp({page:r,rowsPerPage:n,sortOrder:a,sortField:i,forceOvOnly:!0},yield(0,Ia.Ys)(A().selectors.getGlobalSearchRequestOptions),{select:l}),c=(0,Na.Lv)(e,s);yield(0,Ia.gz)(wc(!0));try{const e=yield(0,Ia.RE)(v.rawRequest,B.NV,c);yield(0,Ia.gz)(Sc(e))}catch(e){console.warn(e),yield(0,Ia.gz)(Sc([]))}yield(0,Ia.gz)(wc(!1))}function*yp(){const e=yield(0,Ia.Ys)(vu),t=yield(0,Ia.RE)(Sp,e);yield(0,Ia.rM)(fp,t)}function*gp(e={}){const{debounceTime:t}=e.payload||{};t&&(yield(0,Ia.gw)(t));const r=yield(0,Ia.Ys)(vu),n=yield(0,Ia.RE)(Sp,r);yield(0,Ia.gz)(Ac(0)),yield(0,Ia.rM)(hp,n)}function*hp(e){const t=yield(0,Ia.Ys)(A().selectors.getGlobalSearchRequestOptions),r=(0,Na.Vg)(e,[],t);try{const e=yield(0,Ia.RE)(v.rawRequest,B.jS,{method:"POST",body:JSON.stringify(r)});yield(0,Ia.gz)(_c(e.total))}catch(e){console.warn(e),yield(0,Ia.gz)(_c(0))}}function*Ep(){const e=(yield(0,Ia.Ys)(mu)).map((e=>e.uri)),t=yield(0,Ia.RE)(xp),r=yield(0,Ia.Ys)(vu),n=yield(0,Ia.RE)(Sp,r),a=yield(0,Ia.Ys)(A().selectors.getGlobalSearchRequestOptions),i=(0,Na.aG)(e,n,pp({select:t},a));yield(0,Ia.gz)(wc(!0));try{const e=yield(0,Ia.RE)(v.rawRequest,i.url,i.options);yield(0,Ia.gz)(Sc(e))}catch(e){console.warn(e),yield(0,Ia.gz)(Sc([]))}yield(0,Ia.gz)(wc(!1))}function*bp(e){try{yield(0,Ia.RE)(v.rawRequest,e.url,e.options),yield(0,Ia.gz)(Pi(!1)),yield(0,Ia.gz)(Ii({message:li().text("Bulk update is currently in progress. You'll receive an email notification once completed.\nGo to Tenant Management to view the status."),actionLabel:li().text("Tenant Management"),actionToDispatch:w.ui.actions.openConsoleApp("Tenant Management","jobs/pending"),autoHideDuration:1e4}))}catch(e){let t=e;e&&"object"==typeof e&&(t="errorCode"in e&&441===e.errorCode?li().text("You already have a bulk update job in progress. You can start a new job when the current job is finished.\nWe will send you an update via email once the current job is finished."):e.errorMessage||e.error_description||li().text("Something went wrong...")),yield(0,Ia.gz)(Ri(t))}}function*vp(){const e=yield(0,Ia.Ys)(ou);e===B.dV.UpdateProfiles?yield(0,Ia.RE)(Tp):e===B.dV.DeleteProfiles&&(yield(0,Ia.RE)(Op))}function*Tp(){yield(0,Ia.gz)(Vc(!0));const e=yield(0,Ia.Ys)(cu),t=yield(0,Ia.Ys)(uu);let r=yield(0,Ia.Ys)(Cu);const n=yield(0,Ia.RE)(Sp),a=yield(0,Ia.Ys)(A().selectors.getGlobalSearchRequestOptions),i=yield(0,Ia.Ys)(A().selectors.getModifiedEntities),o=Iu(i,r);if(o.length>0){const e=yield(0,Ia.RE)(v.saveTemporaryEntities,i,o);for(const[t,n]of Object.entries(e))r=Pu(t,n,r)}const l=function(e,t,r,n,a){const i=ip(e,t,r,n,a);return{url:"/entities/_update?sendMail=true",options:{method:"POST",body:JSON.stringify(i),headers:{"Content-Type":"application/json"}}}}(e,t,r,n,a);yield(0,Ia.RE)(bp,l),yield(0,Ia.gz)(Vc(!1))}function*Op(){yield(0,Ia.gz)(Vc(!0));const e=function(e,t,r){const n={objects:op(e,t,r)};return{url:"/entities/_delete?sendMail=true",options:{method:"POST",body:JSON.stringify(n),headers:{"Content-Type":"application/json"}}}}(yield(0,Ia.Ys)(uu),yield(0,Ia.RE)(Sp),yield(0,Ia.Ys)(A().selectors.getGlobalSearchRequestOptions));yield(0,Ia.RE)(bp,e),yield(0,Ia.gz)(Vc(!1))}function*Sp(e){const t=yield(0,Ia.Ys)(ai.FR),r={fieldName:"type",filter:"equals",values:[yield(0,Ia.Ys)(cu)]};let n=t.filter((e=>"type"!==e.fieldName)).concat(r);return e&&(n=n.concat({fieldName:"attributes",filter:"containsWordStartingWith",values:[e]})),n}function*xp(){const e=yield(0,Ia.Ys)(bu);return(0,Di.vw)(e)}function*Cp(e){const{groupId:t,attributeId:r,selectInfo:n}=e.payload,a=yield(0,Ia.Ys)(xu),i={addAttributeAfter:Dc,changeAttribute:kc,clearAttribute:Lc,deleteAttribute:jc};yield(0,Ia.RE)(dl,{groups:a,attributesPropName:"conditions",groupId:t,attributeId:r,selectInfo:n,actions:i})}const wp=[function*(){yield(0,Ia.Fm)(ce,mp)},function*(){yield(0,Ia.Fm)([Rn,An,_n],yp)},function*(){yield(0,Ia.Fm)(Pn,gp)},function*(){yield(0,Ia.Fm)(kn,Ep)},function*(){yield(0,Ia.ib)(Hn,Cp)},function*(){yield(0,Ia.ib)($n,vp)}],Ap=()=>({id:B.Jf,reducerMap:{[B.Jf]:(0,T.combineReducers)({ui:Fe,search:ae,facets:V,advancedSearch:Zt,savedSearches:tn,recentSearches:pn,entity:vn,bulkUpdate:_a})},sagas:[...Wl,...ys,...bo,...Tl,...Zo,...uc,...As,Ns,...vc,...Oc,...wp]});var Rp=r(8156),_p=r.n(Rp),Ip=r(95099),Np=r.n(Ip),Pp=r(34756),Dp=r(78310),kp=r.n(Dp),Lp=r(23625),Up=r.n(Lp),jp=r(53732),Fp=r.n(jp),Mp=r(88214),Vp=r.n(Mp),Bp=r(14294),zp=r.n(Bp),Hp=r(4501),Yp=r.n(Hp),Wp=r(87925),Gp=r(18538),qp=r(42950);const Zp=(0,qp.Z)((()=>({container:({height:e=36})=>({height:e,borderRadius:"2px",alignItems:"center",backgroundColor:"rgba(0,0,0,0.03)",minWidth:"100px"}),icon:{opacity:.67,marginLeft:"10px",marginRight:"6px"},input:{fontSize:"13px",width:"100%"},clearButton:{marginRight:"10px"},white:{backgroundColor:"rgb(255, 255, 255)",boxShadow:"0 1px 3px 0 rgba(0,0,0,0.24)"}})));function $p(){return $p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$p.apply(null,arguments)}function Kp(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Xp(e,t,r[t])}))}return e}function Xp(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Qp=e=>{let{value:t,autofocus:r,onSearch:n=O.identity,rootRef:a,classes:i={},height:o,placeholder:l=li().text("Search"),endAdornmentContent:s}=e,c=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["value","autofocus","onSearch","rootRef","classes","height","placeholder","endAdornmentContent"]);const u=Zp({height:o}),[p,d]=(0,Rp.useState)(""),m=(0,O.pipe)((0,O.tap)(n),d),f=(0,O.isNil)(t)?p:t;return _p().createElement(Fp(),$p({startAdornment:_p().createElement(Vp(),{position:"start"},_p().createElement(Yp(),{className:u.icon})),endAdornment:_p().createElement(Vp(),{position:"end"},f.length>0&&_p().createElement(Gp.T,{icon:zp(),className:u.clearButton,onClick:()=>m("")}),s),autoFocus:r,classes:Kp({},i,{input:kp()(u.input,i.input),root:kp()(u.container,i.root)}),placeholder:l,value:f,onChange:(0,O.pipe)(Wp.NA,m),disableUnderline:!0,ref:a},c))},Jp=(0,Rp.memo)(Qp),ed="16px",td=(0,qp.Z)((()=>({container:({containerHeight:e=553,containerWidth:t})=>({display:"flex",flexDirection:"column",height:e,width:t,flexGrow:1}),header:{marginLeft:ed,marginTop:"16px",marginBottom:"12px",fontSize:"16px",fontWeight:500,letterSpacing:"0.15px",lineHeight:"24px"},searchInputContainer:{margin:`0 ${ed} 12px ${ed}`,flexShrink:"0"},list:{flexGrow:1,height:0,overflow:"hidden",width:"100%",position:"relative","& ul":{paddingBottom:0,paddingTop:0}}})));function rd(){return rd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},rd.apply(null,arguments)}const nd=e=>{let{title:t,className:r,onSearch:n,hideTitle:a,hideSearchInput:i,headerPlacement:o="top",containerWidth:l,containerHeight:s,searchInputOnKeyDown:c,children:u,searchInputRef:p,anchorOrigin:d={vertical:"top",horizontal:"right"},transformOrigin:m={vertical:"top",horizontal:"right"}}=e,f=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["title","className","onSearch","hideTitle","hideSearchInput","headerPlacement","containerWidth","containerHeight","searchInputOnKeyDown","children","searchInputRef","anchorOrigin","transformOrigin"]);const y=td({containerWidth:l,containerHeight:s}),g=_p().createElement(_p().Fragment,null,!a&&_p().createElement("div",{className:y.header},t),!i&&_p().createElement(Jp,{onSearch:n,autofocus:!0,onKeyDown:c,inputRef:p,classes:{root:y.searchInputContainer},placeholder:li().text("Search & add attributes"),height:40}));return _p().createElement(Up(),rd({anchorOrigin:d,transformOrigin:m},f),_p().createElement("div",{className:kp()(y.container,r),style:{width:l}},"top"===o&&g,_p().createElement("div",{className:y.list},u),"bottom"===o&&g))},ad=e=>{const t=e=>(0,O.flatten)(e.map((e=>[e].concat(e.items?t(e.items):[]))));let r=null;return t(e).map(((e,t)=>(e&&e.items&&(r=t),{item:e,index:t,titleItemIndex:r})))},id=e=>e.titleItemIndex===e.index;var od=r(50166),ld=r(62515);const sd=(0,qp.Z)({stickyTitlesWrapper:{position:"absolute",top:0,"& > div":{zIndex:1,position:"absolute",top:0,width:"100%",visibility:"hidden"}}}),cd=({items:e,getItemSize:t,renderItem:r,renderGroupTitle:n,width:a="100%",height:i,fixedTitle:o=!0,itemKey:l=e=>e,disableHorizontalScrollbar:s,hideSubtitles:c,focusIndex:u=null,onInnerContainerResize:p})=>{const d=sd(),m=(0,Rp.useRef)(null),f=(0,Rp.useRef)(null),y=(0,Rp.useRef)(null),g=(0,Rp.useRef)([0]),h="stickyTitleItem",E={topMargin:0},b=(0,Rp.useMemo)((()=>!c||(e||[]).some((e=>null!==e.titleItemIndex))),[e,c]),v=(0,Rp.useCallback)((r=>{const n=g.current.length;let a=0;e.slice(n-1,r+1).forEach(((e,r)=>{const i=n+r-1;r>0&&(g.current[i]=g.current[i-1]+a),a=t(i,e.item)}))}),[t,e]),T=(0,Rp.useCallback)((t=>e[t].titleItemIndex),[e]),O=(0,Rp.useCallback)((t=>e[t]),[e]);(0,Rp.useEffect)((()=>{requestAnimationFrame((()=>{m.current&&m.current.scrollTo(0)}))}),[e.length]),(0,Rp.useEffect)((()=>{m.current&&m.current.resetAfterIndex(0),S();const r=(e=>{const r=e.findIndex((e=>e.item.moveTo));if(r>-1){v(r);const e=T(r);return{offset:g.current[r],titleHeight:t(e,O(e).item)}}})(e);if(r&&r.offset&&m.current){const{titleHeight:e}=r,t=r.offset-e;(t<m.current.state.scrollOffset||t>m.current.state.scrollOffset+i)&&requestAnimationFrame((()=>{m.current&&m.current.scrollTo(t-(i-e)/2)}))}}),[v,O,t,T,i,g,e,m]);const S=()=>{y.current&&f.current&&(y.current.style.width=f.current.offsetWidth+"px")},x=(0,Rp.useCallback)((t=>{let r=null,n=0;return e.some(((e,a)=>{v(a+10);const i=g.current[a+1];return t>=n&&t<i&&(r={index:a,offset:n,listItem:e}),n=i,r})),r}),[v,g,e]),C=(0,Rp.useCallback)((e=>t(e,O(e).item)),[O,t]),w=(0,Rp.useCallback)((({index:e,style:t,data:a})=>{const i=O(e);return i.item&&(id(i)&&n(t,i.item)||r(t,i.item,e,a))}),[O,n,r]),{handleOnItemsRendered:A}=(({focusIndex:e,listRef:t,items:r})=>{const n=(0,Rp.useRef)(null),a=(0,Rp.useRef)(null),i=(0,Rp.useCallback)((({visibleStartIndex:e,visibleStopIndex:t})=>{n.current=e,a.current=t}),[]);return(0,Rp.useEffect)((()=>{t.current&&null!==e&&0!==r.length&&(e<Math.max(n.current+3,0)?t.current.scrollToItem(Math.max(e-3,0),"start"):e>Math.min(a.current-3,r.length-1)&&t.current.scrollToItem(Math.min(e+3,r.length-1),"end"))}),[e,r.length,t]),{handleOnItemsRendered:i}})({items:e,focusIndex:u,listRef:m}),R=(0,Rp.useCallback)((()=>e.filter((e=>id(e))).map((e=>(e=>_p().createElement("div",{className:h,style:{visibility:"hidden"},"data-index":e.index,key:e.index},n({height:t(e.index,e.item)},e.item)))(e)))),[t,e,n]);return _p().createElement(_p().Fragment,null,_p().createElement("div",{ref:y,className:d.stickyTitlesWrapper},o&&R()),p&&f.current&&_p().createElement(ld.ZP,{handleHeight:!0,onResize:p,targetRef:f}),_p().createElement(od.VariableSizeList,{ref:m,itemCount:e.length,itemSize:C,width:a,height:i,itemKey:l,innerRef:f,onScroll:({scrollOffset:r,scrollDirection:n})=>{if(!o||!b)return;const a=x(r),i=a&&T(a.index);var l;null!==i&&(l=i,y.current&&[...y.current.querySelectorAll("."+h)].forEach((e=>{e.dataset.index===l.toString()?(e.style.visibility="visible",E.index=l):e.style.visibility="hidden"}))),S();const s=null!==i&&t(i,O(i).item),c=x(r+s+E.topMargin);let u=0;if(c){switch(n){case"forward":c.offset-r>0&&id(c.listItem)&&(u=s-(c.offset-r));break;case"backward":{const t=i>-1&&(p=i,e.findIndex(((e,t)=>id(e)&&p<t))),n=(e=>(v(e),g.current[e]))(t);t>-1&&r<n&&s>=n-r&&(u=s-(n-r))}}(e=>{y.current&&(E.topMargin=-e,y.current.style.top=-e+"px")})(u)}var p},style:s?{overflowX:"hidden"}:void 0,overscanCount:5,onItemsRendered:A},w))};cd.propTypes={items:Np().arrayOf(Np().object).isRequired,getItemSize:Np().func.isRequired,renderItem:Np().func.isRequired,width:Np().oneOfType([Np().number,Np().string]),height:Np().number.isRequired,renderGroupTitle:Np().func,fixedTitle:Np().bool,hideSubtitles:Np().bool,itemKey:Np().func,disableHorizontalScrollbar:Np().bool,focusIndex:Np().number,onInnerContainerResize:Np().func};const ud=({items:e,open:t,onSelectFocusedItem:r,selectedItems:n,onClose:a})=>{const[i,o]=(0,Rp.useState)(null),l=(0,Rp.useRef)(!1),s=(0,Rp.useCallback)((t=>{let r=null===t?s(-1):t;for(;null!==t&&r<e.length&&(r<=t||r>=0&&id(e[r]));)r+=1;return r!==e.length?r:s(-1)}),[e]),c=(0,Rp.useCallback)((t=>{let r=null===t?e.length-1:t;for(;null!==t&&r>=0&&(r>=t||id(e[r]));)r-=1;return r<0?e.length-1:r}),[e]),u=(0,Rp.useCallback)((()=>{if(!(0,O.isNil)(i)){const t=e[i].item;!t.item.notSelectable&&r({item:t.item,groupData:t})}}),[r,e,i]),p=(0,Rp.useCallback)((t=>{if(0!==e.length)switch(t.key){case"Down":case"ArrowDown":return o(s),t.preventDefault(),!1;case"Up":case"ArrowUp":return o(c),t.preventDefault(),!1;case"Enter":l.current=!0,u();break;case"Tab":a&&a(t);break;default:return}}),[e,s,c,u,a]);return(0,Rp.useEffect)((()=>{if(l.current){l.current=!1;const t=e.findIndex((e=>e.item.moveTo));t>-1&&o(t)}else o(null)}),[e,t,n]),{focusIndex:i,handleKeyDown:p}};var pd=r(85746),dd=r.n(pd),md=r(22811),fd=r.n(md),yd=r(93222),gd=r.n(yd);function hd(){return hd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hd.apply(null,arguments)}function Ed(){return Ed=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ed.apply(null,arguments)}const bd=e=>_p().createElement("svg",Ed({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgNestedAttribute"},e),_p().createElement("path",{d:"M14 11v-1a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1v-1h-3v1a1 1 0 01-1 1H6a1 1 0 01-1-1v-4a1 1 0 011-1h4a1 1 0 011 1v1h3z",fill:"#000",stroke:"none",strokeWidth:1,fillRule:"evenodd"}));function vd(){return vd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vd.apply(null,arguments)}const Td=e=>_p().createElement("svg",vd({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgReferenceAttribute"},e),_p().createElement("path",{d:"M10 18h3v-1a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1v-1H8V8H6a1 1 0 01-1-1V3a1 1 0 011-1h6a1 1 0 011 1v4a1 1 0 01-1 1h-2v3h3v-1a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1v-1h-3v5z",fill:"#000",stroke:"none",strokeWidth:1,fillRule:"evenodd"}));function Od(){return Od=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Od.apply(null,arguments)}const Sd=e=>_p().createElement("svg",Od({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgSimpleAttribute"},e),_p().createElement("rect",{fill:"#000",x:9,y:9,width:6,height:6,rx:1,stroke:"none",strokeWidth:1,fillRule:"evenodd"})),xd=(0,qp.Z)({icon:{opacity:.29,width:"16px",height:"16px",flexShrink:0,marginRight:"6px",marginLeft:"8px"}}),Cd=({attrType:e={}})=>{const t=xd(),r=(e=>{switch(e.type){case v.DataTypes.TYPE_IMAGE:case v.DataTypes.TYPE_NESTED:return bd;case v.DataTypes.TYPE_REFERENCE:return Td;default:return Sd}})(e);return _p().createElement(r,{className:t.icon})},wd=(0,qp.Z)({mark:{color:"red"}}),Ad=()=>{const e=wd();return _p().createElement("span",{className:e.mark},"*")},Rd=({margin:e,level:t,className:r,children:n})=>null!=t?_p().createElement("div",{style:{marginLeft:t*e},className:r},n):n;var _d=r(1063),Id=r(85740);const Nd=(0,qp.Z)({container:{"& > $marginWrapper:first-child":{paddingLeft:"4px"}},listItem:{paddingLeft:"1px",paddingTop:"2px",paddingBottom:"2px",transition:"none","&:hover":{"& $itemAfter":{background:"linear-gradient(to right, rgba(235, 235, 235, 0.2), rgba(235, 235, 235, 1) 100%)"}},"&$listItemFocus":{"& $itemAfter":{background:"linear-gradient(to right, rgba(219, 219, 219, 0.2), rgba(219, 219, 219, 1) 100%)"}},"&:focus":{outline:"none"}},listItemFocus:{},recommendedIcon:{width:"18px",height:"18px",marginRight:"5px",marginLeft:"7px",flexShrink:0},logoIcon:{width:"18px",height:"18px",flexShrink:0,marginRight:"4px"},itemAfter:{position:"absolute",right:0,top:0,width:"40px",height:"100%",pointerEvents:"none",background:"linear-gradient(to right, rgba(255, 255, 255, 0.2), #fff 100%)"},itemText:{padding:"0",margin:0,"& span":{fontSize:"0.8125rem",letterSpacing:"normal",whiteSpace:"nowrap"}},checkbox:{opacity:.34,padding:0,marginLeft:"14px","&$checked":{opacity:1,background:"none"}},checked:{},marginWrapper:{display:"flex",alignItems:"center"},defaultCursor:{cursor:"default"},itemTooltip:{margin:"4px 0"},marginText:{marginLeft:"21px"},itemTextWrapper:{display:"flex",alignItems:"center"}}),Pd=(0,Id.T)((e=>_p().createElement("svg",hd({width:13,height:18,viewBox:"0 0 13 18",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgRecommended"},e),_p().createElement("g",{transform:"translate(-3 -1)",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},_p().createElement("path",{fill:"#FF4081",d:"M5.833 10h3.75v6.667l-3.75 1.666z"}),_p().createElement("path",{fill:"#CE0C4E",d:"M13.333 10v8.333l-3.75-1.666V10z"}),_p().createElement("circle",{fill:"#FFC058",cx:9.583,cy:7.917,r:6.25}),_p().createElement("circle",{fill:"#FFCD7B",cx:9.583,cy:7.917,r:5.417}),_p().createElement("path",{fill:"#FFFBB5",d:"M8.333 11.667L5 8.462l.933-.898 2.4 2.308L13.4 5l.933.897z"}))))),Dd=({groupId:e,data:t,checked:r=!1,isFocused:n=!1,isRequired:a=!1,label:i,labelInText:o,level:l,onClick:s=O.identity,hideCheckBox:c=!1,hideIcon:u=!1,notSelectable:p=!1,disableHorizontalScrollbar:d=!1,style:m={},subItemMargin:f=20,LogoIcon:y,className:g,disableNonSelectable:h,disableGutters:E})=>{const b=Nd(),{attrType:T}=t||{},S=!(c&&(0,v.isNested)(T)||p),x=!!y;return _p().createElement(_d.Y,{value:o||i,className:b.itemTooltip,placement:"bottom-end"},_p().createElement(gd(),{className:kp()(b.container,b.listItem,{[b.defaultCursor]:!S},g),onClick:S?()=>s(t,!r,e):void 0,style:m,dense:!0,disabled:h&&p,classes:{focusVisible:b.listItemFocus,selected:b.listItemFocus},selected:n,tabIndex:-1,disableGutters:E},!c&&_p().createElement(fd(),{checked:r,disableRipple:!0,disabled:!S,className:kp()(b.checkbox,{[b.checked]:r}),tabIndex:-1}),_p().createElement(Rd,{margin:f,level:l,className:b.marginWrapper},_p().createElement(_p().Fragment,null,!u&&(t=>"recommended"===e?_p().createElement(Pd,{className:b.recommendedIcon,tooltipTitle:li().text("Recommended"),showForDisabled:!0}):_p().createElement(Cd,{attrType:t}))(T),_p().createElement("div",{className:kp()(b.itemTextWrapper,{[b.marginText]:u})},x&&_p().createElement(y,{className:b.logoIcon}),_p().createElement(dd(),{primary:_p().createElement(_p().Fragment,null,i,a&&_p().createElement(Ad,null)),className:b.itemText})))),S&&d&&_p().createElement("div",{className:b.itemAfter})))};Dd.defaultName="AttributeListItem";const kd=(0,Rp.memo)(Dd);var Ld=r(49940);const Ud=(0,qp.Z)({popupContainer:{},container:{"&$popupContainer":{height:"408px",minWidth:"200px"}}});function jd(){return jd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},jd.apply(null,arguments)}function Fd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Md(e,t,r[t])}))}return e}function Md(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Vd=e=>{let{open:t,anchorEl:r,data:n,onSearch:a,onClose:i,titleText:o,filterText:l,onListItemClick:s,selected:c,hideCheckBox:u,renderGroupTitle:p}=e,d=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["open","anchorEl","data","onSearch","onClose","titleText","filterText","onListItemClick","selected","hideCheckBox","renderGroupTitle"]);const m=(0,Rp.useCallback)((e=>e.label.toLowerCase().includes(l.toLowerCase())),[l]),f=(0,Rp.useCallback)((e=>m(e)||(e.children||[]).some(f)),[m]),y=(0,Rp.useMemo)((()=>{const e=(0,O.curry)(((e,r,n,a)=>[{item:Fd({},r,{filterText:l}),level:e,groupId:n,groupName:a},...t(r.children||[],n,a,e+1)])),t=(t,r,n,a=0)=>{const i=t.filter(f);return(p?O.map:O.chain)((t=>e(a,t,r,n)),i)};return t}),[l,p,f]),g=(0,Rp.useCallback)((e=>e.map((e=>({item:e,items:y(e.attributes,e.id,e.label)}))).filter((e=>e.items.length))),[y]),h=(0,Rp.useCallback)((({item:e})=>{s(e,!c.find((t=>t.id===e.id||t.id.includes(`${e.id}.`))))}),[s,c]),E=(0,Rp.useMemo)((()=>(p?g:y)(n)),[n,p,g,y]),b=(0,Rp.useMemo)((()=>ad(E)),[E]),{focusIndex:T,handleKeyDown:S}=ud({items:b,open:t,onSelectFocusedItem:h,selectedItems:c}),x=(0,Rp.useRef)(null);x.current=T;const C=(0,Rp.useCallback)(((e,{item:t,level:r=0},n)=>{const a=!!c.find((e=>e.id===t.id||e.id.includes(`${t.id}.`))),i=x.current===n;return _p().createElement(kd,{key:t.id,onClick:s,checked:a,level:r,data:t,label:_p().createElement(Ld.o,{text:t.label,highlight:t.filterText}),labelInText:t.label,style:e,hideCheckBox:u,isFocused:i,notSelectable:t.notSelectable,LogoIcon:t.LogoIcon})}),[u,s,c]),w=(0,v.getMaxItemWidth)("label")(E)||308,A=Ud();return _p().createElement(nd,jd({open:t,className:kp()(A.container,A.popupContainer),anchorEl:r,onClose:i,onSearch:a,title:o,containerWidth:w,searchInputOnKeyDown:S},d),_p().createElement(cd,{height:300,renderItem:C,items:b,hideSubtitles:!0,getItemSize:()=>32,containerWidth:w,focusIndex:T,renderGroupTitle:p}))};Vd.propTypes={open:Np().bool,hideCheckBox:Np().bool,anchorEl:Np().any,selected:Np().array,data:Np().array,filterText:Np().string,titleText:Np().string,onClose:Np().func,onListItemClick:Np().func,onSearch:Np().func,renderGroupTitle:Np().func},Vd.defaultProps={data:[],selected:[],titleText:li().text("Show/hide columns"),filterText:""};var Bd=r(97179);function zd(){return zd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},zd.apply(null,arguments)}const Hd=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return _p().createElement("svg",zd({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},r),_p().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",opacity:".54"},_p().createElement("path",{d:"M19 11.24V10h-4v1.24a8.417 8.417 0 00-2 .768V10H9v6h.29a8.497 8.497 0 00-.15.358l-.29.733.29.733.07.176H5c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2h14c1.1 0 2 .9 2 2v6.008a8.417 8.417 0 00-2-.768zM7 16v-6H5v6h2zm0-8V6H5v2h2zm6 0V6H9v2h4zm6 0V6h-4v2h4zm-2 5a6.451 6.451 0 00-6 4.09 6.451 6.451 0 006 4.092 6.451 6.451 0 006-4.091A6.451 6.451 0 0017 13zm0 6.818a2.728 2.728 0 010-5.454 2.728 2.728 0 010 5.454zm0-4.363c-.905 0-1.636.73-1.636 1.636 0 .905.73 1.636 1.636 1.636.905 0 1.636-.73 1.636-1.636 0-.906-.73-1.636-1.636-1.636z",fill:"#000",fillRule:"nonzero"})))},Yd="Headers-styles-container--Zbdka",Wd="Headers-styles-actionsBar--RXMy4",Gd="Headers-styles-previewSwitcher--Ppqem";function qd(){return qd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},qd.apply(null,arguments)}const Zd=e=>{let{entityTypeUri:t,headColumns:r=[],onSelectColumns:n=O.identity}=e,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["entityTypeUri","headColumns","onSelectColumns"]);const[i,o]=(0,Rp.useState)(null),[l,s]=(0,Rp.useState)(""),c=(0,Pp.useSelector)(A().selectors.getMetadata),u=()=>{o(null),s("")},p=(0,Rp.useCallback)(((e,a)=>{const i=(0,Di.kF)(c,t),o=(0,Di.m5)(i,e.id);let l;l=o.length?a?r.concat(o):r.filter((e=>!o.find((t=>t.id===e.id)))):a?r.concat(e):r.filter((t=>t.id!==e.id)),n(l)}),[c,t,r,n]);return _p().createElement(_p().Fragment,null,_p().createElement(Bd.k,qd({tooltipTitle:li().text("Show/hide columns"),size:"M",icon:Hd,onClick:e=>o(e.currentTarget),className:"Headers-styles-headerIcon--c2qe7"},a)),(()=>{const e=(0,Di.kF)(c,t);return _p().createElement(Vd,{open:!!i,anchorEl:i,data:e,onListItemClick:p,selected:r,filterText:l,onClose:u,onSearch:s})})())};Zd.propTypes={entityTypeUri:Np().string,headColumns:Np().array,onSelectColumns:Np().func};const $d=Zd;var Kd=r(45053),Xd=r(72897),Qd=r(27618),Jd=r.n(Qd),em=r(98515),tm=r.n(em),rm=r(29289);const nm=({headCellData:e,headIndex:t,sortOrder:r,sortField:n,sortHandler:a,canCheck:i,onCheck:o,headerCheckboxState:l,openConfigColumnPopup:s})=>_p().createElement("div",{className:kp()("HeadCellRenderer-styles-headCellContentWrapper--L6RrQ",(0,O.path)(["wrapperClassName"],e))},e&&i&&_p().createElement(fd(),{className:"HeadCellRenderer-styles-checkbox--qQEHg",checked:l||!1,indeterminate:null===l,onChange:()=>o()}),_p().createElement("div",{className:"HeadCellRenderer-styles-labelWrapper--cmclk"},e&&(e.sortable?_p().createElement(Jd(),{active:Boolean(r&&n===e.id),direction:r,onClick:a,classes:{root:"HeadCellRenderer-styles-sortLabel--NZx3o"},component:"div"},e.label):e.label)),s&&_p().createElement("div",{className:"HeadCellRenderer-styles-menuButtonWrapper--aBNeR"},_p().createElement(Gp.T,{icon:tm(),onClick:s,size:"S","data-column-index":t})));nm.propTypes={headCellData:Np().shape({id:Np().string,label:Np().oneOfType([Np().string,Np().node]),sortable:Np().bool}),headIndex:Np().number,sortOrder:Np().string,sortField:Np().string,sortHandler:Np().func,canCheck:Np().bool,onCheck:Np().func,headerCheckboxState:Np().oneOf([!0,!1,null]),openConfigColumnPopup:Np().func};const am=(0,rm.q)((0,O.pick)(["openConfigColumnPopup"]))(nm),im=(0,rm.q)((0,O.pick)(["openConfigColumnPopup","canCheck","onCheck","headerCheckboxState"]))(nm);var om=r(16778);const lm={popupBackdrop:"EntitiesTable-styles-popupBackdrop--nEX1F",popupContent:"EntitiesTable-styles-popupContent--PLSPL",complexPopupContent:"EntitiesTable-styles-complexPopupContent--wqOGI",highlighted:"EntitiesTable-styles-highlighted--GHk6T",highlightAnimate:"EntitiesTable-styles-highlightAnimate--oR7ki",inactiveBackground:"EntitiesTable-styles-inactiveBackground--nAfS3",inactiveHoverBackground:"EntitiesTable-styles-inactiveHoverBackground--qe__Y",inactiveSelectedBackground:"EntitiesTable-styles-inactiveSelectedBackground--WkWtD",inactiveSelectedHoverBackground:"EntitiesTable-styles-inactiveSelectedHoverBackground--oFAbX",textOverflow:"EntitiesTable-styles-textOverflow--AAABW",textOverflowInactive:"EntitiesTable-styles-textOverflowInactive--eU4xE",link:"EntitiesTable-styles-link--JNCz5",defaultWrapper:"EntitiesTable-styles-defaultWrapper--EP4tA",table:"EntitiesTable-styles-table--jmlbo",imageWrapper:"EntitiesTable-styles-imageWrapper--xmq8R",blobWrapper:"EntitiesTable-styles-blobWrapper--ruHVs",highlightAnimateForEllipsis:"EntitiesTable-styles-highlightAnimateForEllipsis--r1Fmq",referenceWrapper:"EntitiesTable-styles-referenceWrapper--Q5RqZ",referenceContent:"EntitiesTable-styles-referenceContent--wkahK",referenceIcon:"EntitiesTable-styles-referenceIcon--b8M3n",nestedCellWrapper:"EntitiesTable-styles-nestedCellWrapper--I4J6A",nestedAttributeWrapper:"EntitiesTable-styles-nestedAttributeWrapper--dvfn3",profileWrapper:"EntitiesTable-styles-profileWrapper--lGPma",entityAvatar:"EntitiesTable-styles-entityAvatar--GiuUS",entityAvatarImage:"EntitiesTable-styles-entityAvatarImage--UHIRm",entityLabel:"EntitiesTable-styles-entityLabel--OyjLV",scores:"EntitiesTable-styles-scores--RqsDU",dragColumnHead:"EntitiesTable-styles-dragColumnHead--oDlFz",dragColumnBody:"EntitiesTable-styles-dragColumnBody--_HZDV",draggableHeadCell:"EntitiesTable-styles-draggableHeadCell--DbfHi",cellWrapper:"EntitiesTable-styles-cellWrapper--dUWGQ",entityButtons:"EntitiesTable-styles-entityButtons--tYSvC",selectedEntityButtons:"EntitiesTable-styles-selectedEntityButtons--mZJfv",justImportedEntityButtons:"EntitiesTable-styles-justImportedEntityButtons--q5bPw",highlightedEntityButtons:"EntitiesTable-styles-highlightedEntityButtons--PvzNM"},sm=({value:e={}})=>{const t=(0,v.getLabel)(e.label);return _p().createElement("div",{className:kp()(lm.defaultWrapper,lm.profileWrapper)},_p().createElement(b.A,{avatarClassName:lm.entityAvatar,imageClassName:lm.entityAvatarImage,entity:e}),_p().createElement(om.x,{value:(0,v.getEntityUriForLink)(e),className:lm.entityLabel},t))};sm.propTypes={value:Np().object};const cm=sm;var um=r(56755);const pm=({value:e,columnData:{dataTypeDefinition:t}})=>_p().createElement("div",{className:lm.defaultWrapper},t?_p().createElement(um.x,{value:e,dataTypeDefinition:t}):e);pm.propTypes={value:Np().any,columnData:Np().object};const dm=pm,mm=(e,t,r)=>{const n=(0,v.getEntityTypeGraphIcon)(e,{type:t});return(0,v.getAbsoluteImageUrl)(r,n)};var fm=r(55743),ym=r.n(fm);let gm=function(e){return e[e.ICON_MODE=0]="ICON_MODE",e[e.TEXT_MODE=1]="TEXT_MODE",e[e.ERROR_MODE=2]="ERROR_MODE",e}({});function hm(){return hm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hm.apply(null,arguments)}const Em=e=>{let{className:t,icon:r,avatarText:n,rootClasses:a}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","icon","avatarText","rootClasses"]);const[o,l]=(0,Rp.useState)(null);(0,Rp.useEffect)((()=>{l(r?gm.ICON_MODE:gm.TEXT_MODE)}),[r,n]);const s=()=>{l(gm.ERROR_MODE)};switch(o){case gm.ICON_MODE:return _p().createElement(ym(),hm({className:kp()(t,null==a?void 0:a.iconRoot),src:r,onError:s},i));case gm.TEXT_MODE:case gm.ERROR_MODE:return _p().createElement(ym(),hm({className:kp()(t,null==a?void 0:a.textRoot)},i),n);default:return null}},bm=({value:e})=>{const t=(0,Pp.useSelector)(A().selectors.getMetadata),r=(0,Pp.useSelector)(A().selectors.getApiPath),n=(0,Pp.useSelector)(A().selectors.getImagePath);return e&&_p().createElement("div",{className:kp()(lm.defaultWrapper,lm.referenceWrapper)},_p().createElement(Em,{className:lm.referenceIcon,icon:mm(t,e.refEntity.type,n||r)}),_p().createElement(om.x,{value:e.refEntity.objectURI,className:lm.referenceContent},(0,v.getLabel)(e.label)))};bm.propTypes={value:Np().object};const vm=bm,Tm=e=>{e.stopPropagation()},Om=e=>{const{value:t}=e;return _p().createElement("div",{className:lm.blobWrapper,onScroll:Tm},t)};Om.propTypes={value:Np().any};const Sm=Om,xm=({value:e})=>{const t=(0,v.getImageAttributeOvThumbnailUrl)({value:e});return t&&_p().createElement("div",{className:lm.imageWrapper},_p().createElement("img",{src:t}))};xm.propTypes={value:Np().object};const Cm=xm,wm=e=>{if("label"===e.id)return cm;switch((0,O.path)(["attrType","type"],e)){case"Reference":return vm;case"Blob":return Sm;case"Image":return Cm}return dm};function Am(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Rm(e,t,r[t])}))}return e}function Rm(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const _m=(0,O.split)("."),Im=["entityId"],Nm=e=>!Im.includes(e.id),Pm=e=>{if((0,v.isAttributeSearchUri)(e)){const[,...t]=_m(e);return t.length>1?t.slice(0,-1):null}return null};var Dm=r(39034),km=r(57526),Lm=r.n(km),Um=r(18567),jm=r.n(Um),Fm=r(99272),Mm=r.n(Fm);const Vm=(0,qp.Z)({root:{display:"flex",alignItems:"center",justifyContent:"center",width:"24px",height:"24px"},check:{color:"#8CC152"}}),Bm=({classes:e={},tooltip:t="",onClick:r=O.identity,mode:n=Dm.Eh.Init})=>{const a=Vm();return _p().createElement("div",{className:kp()(a.root,e.root)},(()=>{switch(n){case Dm.Eh.Init:return _p().createElement(Bd.k,{className:e.button,size:"M",tooltipTitle:t,icon:jm(),onClick:r});case Dm.Eh.Progress:return _p().createElement(Lm(),{className:e.spinner,size:24});case Dm.Eh.Success:return _p().createElement(Mm(),{className:kp()(a.check,e.check)});default:return null}})())};function zm(){return zm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},zm.apply(null,arguments)}const Hm=e=>{let{entity:t,importStatus:r,onImportStatusChange:n,hideDelay:a=3e3}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["entity","importStatus","onImportStatusChange","hideDelay"]);const o=(0,Pp.useSelector)(A().selectors.getDtssPath),l=(0,Pp.useSelector)(A().selectors.getTenant);return _p().createElement(Bm,zm({},i,{mode:r,tooltip:li().text("Import this record"),onClick:e=>{e.stopPropagation(),n(Dm.Eh.Progress),(0,v.importEntityFromDataTenant)({dtssPath:o,customerTenant:l,entity:t}).then((({success:e,uris:r})=>{if(!e)throw new Error("Failed to import entity");t.ctSubscribedUris=r,n(Dm.Eh.Success),setTimeout((()=>n(Dm.Eh.Done)),a)})).catch((()=>{n(Dm.Eh.Init),(0,ii.U)(undefined,{title:li().text("Import Error"),message:li().text("Record can't be imported")})}))}}))},Ym=(0,qp.Z)({importButtonPlaceholder:{display:"flex",alignItems:"center",padding:"0 10px",width:"24px",flexShrink:0,position:"relative"}}),Wm=({entity:e,entityImportStatus:t,onEntityImportStatusChange:r})=>{const n=Ym(),a=(0,Pp.useSelector)(A().selectors.getMetadata),i=(0,Pp.useSelector)(A().selectors.getCanUserImportEntitiesFromDT),o=(0,v.isDataTenantEntity)(e)&&i,l=(0,v.getEntityType)(a,e.type),s=(0,v.checkCanImportEntityOfType)(l)&&!(0,v.isEntityImportedToCT)(e),c=t&&t!==Dm.Eh.Done||s;return _p().createElement(_p().Fragment,null,o&&_p().createElement("div",{className:n.importButtonPlaceholder},c&&_p().createElement(Hm,{entity:e,importStatus:t,onImportStatusChange:t=>r(e.uri,t)})))},Gm=({entity:e,isSelectedEntity:t,isHighlightedEntity:r,entityImportStatus:n,onEntityImportStatusChange:a})=>_p().createElement("div",{className:kp()(lm.entityButtons,{[lm.selectedEntityButtons]:t,[lm.justImportedEntityButtons]:n===Dm.Eh.Success,[lm.highlightedEntityButtons]:r})},_p().createElement(Wm,{entity:e,entityImportStatus:n,onEntityImportStatusChange:a}));Gm.propTypes={entity:Np().object,isSelectedEntity:Np().bool,isHighlightedEntity:Np().bool,entityImportStatus:Np().oneOf(Object.values(Dm.Eh)),onEntityImportStatusChange:Np().func};const qm=(0,rm.q)((({entitiesImportStatus:e,onEntityImportStatusChange:t,selectedEntityUri:r,highlightedEntityIndex:n},{entity:a,rowIndex:i})=>({entityImportStatus:a&&e[a.uri],onEntityImportStatusChange:t,isSelectedEntity:r===a.uri,isHighlightedEntity:n===i})))(Gm);var Zm=r(72326),$m=r(67655);function Km(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Xm(e,t,r[t])}))}return e}function Xm(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Qm={height:"100%",display:"flex",flexDirection:"column"},Jm=(0,qp.Z)((e=>({inactiveCell:Km({background:e.inactiveBackground},Qm,{"&$selectedRowCell":{background:e.inactiveSelectedBackground}}),selectedRowCell:Km({background:(0,$m.lighten)(e.palette.primary.main,.88)},Qm),clickable:Km({cursor:"pointer"},Qm),justImported:Km({backgroundColor:"#FFFBEB !important"},Qm)}))),ef={entity:Np().object,isSelected:Np().bool,onEntityClick:Np().func,isJustImported:Np().bool},tf=(0,qp.Z)({checkboxWrapper:{display:"flex",alignItems:"center"},checkbox:{marginRight:"-8px",marginLeft:"11px"}}),rf={onCheck:Np().func,isChecked:Np().bool,hasCheckbox:Np().bool},nf=(0,qp.Z)({collapser:{marginLeft:"-2px"}});var af=r(18021),of=r(8835),lf=r.n(of);const sf=(0,qp.Z)({collapseButton:{cursor:"pointer"},expandLess:{transform:"rotate( -180deg )"}});function cf(){return cf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},cf.apply(null,arguments)}const uf=e=>{let{isOpen:t=!1,tooltipTitle:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["isOpen","tooltipTitle"]);const a=sf(),i={icon:lf(),className:a.collapseButton,iconClassName:kp()({[a.expandLess]:t})},o={tooltipTitle:r};return _p().createElement(Bd.k,cf({"data-reltio-id":"collapse-button"},i,o,n))},pf=(0,qp.Z)((()=>({hidden:{visibility:"hidden"}}))),df=({rowIndex:e,rowValue:t,className:r})=>{const n=pf(),{toggleRowCollapse:a,getIsRowCollapsible:i,getIsRowCollapsed:o}=(0,Rp.useContext)(af.x),l=i(t),s=o(e);return _p().createElement(uf,{className:kp()(r,{[n.hidden]:!l}),isOpen:!s,onClick:t=>{a(e),t.stopPropagation()}})},mf={hasCollapseButton:Np().bool},ff=(0,O.pipe)((e=>{const t=t=>{const r=nf(),{hasCollapseButton:n}=t,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(t,["hasCollapseButton"]),{rowValue:i,rowIndex:o}=a;return n?_p().createElement("div",{className:"cellWithCollapser"},_p().createElement(df,{className:r.collapser,rowIndex:o,rowValue:i}),_p().createElement(e,a)):_p().createElement(e,a)};return t.propTypes=mf,t}),(e=>{const t=t=>{const r=tf(),{onCheck:n,isChecked:a,hasCheckbox:i}=t,o=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(t,["onCheck","isChecked","hasCheckbox"]),{rowValue:{rawValue:l}}=o;return i?_p().createElement("div",{className:kp()(r.checkboxWrapper,"cellWithCheckbox")},_p().createElement(fd(),{className:r.checkbox,checked:a,onClick:e=>e.stopPropagation(),onChange:e=>n(l.uri,e.target.checked)}),_p().createElement(e,o)):_p().createElement(e,o)};return t.propTypes=rf,t}),(e=>{const t=t=>{const r=Jm(),{rowValue:{rawValue:n},isSelected:a,onEntityClick:i,isJustImported:o}=t,l=i?()=>i(n.uri):void 0,s=n&&!(0,v.isActiveObject)(n);return l||s||a||o?_p().createElement("div",{className:kp()({[r.inactiveCell]:s},{inactiveCell:s},{[r.selectedRowCell]:a},{selectedRowCell:a},{[r.clickable]:!!l},{[r.justImported]:o},{justImported:o}),onClick:l},_p().createElement(e,t)):_p().createElement(e,t)};return t.propTypes=ef,t}),(0,rm.q)((({onEntityClick:e,selectedEntityUri:t,entitiesImportStatus:r,canCheck:n,onCheck:a,checkedEntitiesUris:i},{rowValue:o,columnIndex:l})=>{const{rawValue:s}=o,c=0===l;return{onCheck:a,isChecked:i&&i.includes(s.uri),hasCheckbox:n&&c,hasCollapseButton:c,isSelected:t===s.uri,isJustImported:r[s.uri]===Dm.Eh.Success,onEntityClick:e}})))(Zm.DN),yf=({columnData:e,cell:t})=>{const r=t.values.length,n=28*Math.max(r,1)+20;if(!r)return n;switch((0,O.path)(["dataTypeDefinition","type"],e)){case"Reference":return 28*r+17;case"Blob":return 100*r;case"Image":return 76*r+17;default:return n}},gf=(0,Rp.forwardRef)((({headColumns:e,entities:t,entityToHighlight:r,selectedEntityUri:n,onReorderingColumn:a,dndColumnReorderingEnabled:i,columnsSize:o,onChangeColumnsSize:l,onScroll:s,onSort:c,sortField:u,sortOrder:p,onEntityHover:d,onEntityClick:m,entitiesImportStatus:f,onEntityImportStatusChange:y,logger:g,canCheck:h,checkedEntitiesUris:E,headerCheckboxState:b,onCheck:T,openConfigColumnPopup:S,resizeDebounceDelay:x},C)=>{const w=(0,Rp.useMemo)((()=>({highlightRow:"highlightedSelector",dragColumnHead:lm.dragColumnHead,dragColumnBody:lm.dragColumnBody,draggableHeadCell:lm.draggableHeadCell,cellWrapper:lm.cellWrapper})),[]),R=(0,Pp.useSelector)(A().selectors.getMetadata),[_,I]=(0,Rp.useState)(null),N=(0,Rp.useCallback)((e=>{I(e),d&&d((0,O.path)([e,"uri"],t))}),[d,t]),P=(0,Rp.useRef)();(0,Rp.useImperativeHandle)(C,(()=>({resetScrollbarPosition:()=>{P.current&&P.current.resetScrollbarPosition({resetLeft:!1})}})));const D=(0,Rp.useCallback)((e=>{p&&e===u?p===Kd.oy?c({field:e,order:Kd.U9}):c({field:e}):c({field:e,order:Kd.oy})}),[c,u,p]),k=(0,Rp.useCallback)((e=>{const r=(0,O.prop)(e,t);return r?_p().createElement(qm,{entity:r,rowIndex:e}):null}),[t]),L=(0,Rp.useCallback)((e=>_p().createElement(ff,e)),[]),U=!!d,j=!!c,F=(0,Rp.useMemo)((()=>((e,t=!0)=>e.map(((e,r)=>{let{attrType:n}=e,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attrType"]);const i=0===r;return Am({},a,{dataTypeDefinition:n&&(0,v.getAttrDataTypeDefinition)(n),resizable:!0,autoResize:a.autoResize??!i,draggable:!i,sortable:t&&Nm(a),nestedPath:Pm(a.id),headCellRenderer:i?im:am,rowCellValueRenderer:wm(Am({},a,{attrType:n}))})})))(e,j)),[e,j]),M=(0,Rp.useMemo)((()=>((e,t,r)=>(r||[]).map((e=>(0,O.pipe)((0,O.reduce)(((t,r)=>(0,O.assoc)(r.id,((e,t,r)=>{switch(t.id){case"label":return r;case"entityId":return(0,v.getEntityId)(r);default:{const[e,...n]=_m(t.id);return(0,O.pipe)((0,O.prop)(e),(0,v.getOvAttributeValuesByPath)(n))(r)}}})(0,r,e),t)),{}),(0,O.assoc)("rawValue",e))(t))))(0,e,t)),[R,e,t]),V=r?t.findIndex((0,O.propEq)("uri",r)):-1,B=(0,Rp.useMemo)((()=>({onEntityClick:m,selectedEntityUri:n,highlightedEntityIndex:V,entitiesImportStatus:f,onEntityImportStatusChange:y,canCheck:h,checkedEntitiesUris:E,headerCheckboxState:b,onCheck:T,openConfigColumnPopup:S})),[E,f,b,V,h,T,m,y,n,S]);return _p().createElement(Xd.M,{fixFirstColumn:!0,onScroll:s,rowsData:M,columnsData:F,onSort:D,highlightRow:-1!==V?V:null,ref:P,sortFieldClassName:lm.sortableCell,containerClassName:lm.table,classes:w,defaultColumnWidth:250,headRowHeight:50,defaultColumnMinWidth:100,defaultRowHeight:48,sorting:{field:u,order:p},dndColumnReorderingHandler:a,dndColumnReorderingEnabled:i,onChangeColumnsSize:l,columnsSize:o,resizeDebounceDelay:x??150,onRowHover:U?N:void 0,hoverStateEnabled:U,hoverRowIndex:_,renderRowOverlay:k,logger:g,context:B,maxRowValuesCount:2,renderRowCell:L,getRowCellHeight:yf})}));gf.propTypes={entities:Np().array,entityToHighlight:Np().string,selectedEntityUri:Np().string,headColumns:Np().array,columnsSize:Np().array,onScroll:Np().func,onSort:Np().func,onReorderingColumn:Np().func,onChangeColumnsSize:Np().func,dndColumnReorderingEnabled:Np().bool,onEntityClick:Np().func,onEntityHover:Np().func,sortField:Np().string,sortOrder:Np().oneOf([Kd.oy,Kd.U9]),entitiesImportStatus:Np().object,onEntityImportStatusChange:Np().func,logger:Np().func,canCheck:Np().bool,checkedEntitiesUris:Np().arrayOf(Np().string),headerCheckboxState:Np().oneOf([!0,!1,null]),onCheck:Np().func,openConfigColumnPopup:Np().func,resizeDebounceDelay:Np().number},gf.defaultProps={entities:[],headColumns:[]},gf.displayName="EntitiesTable";const hf=(0,Rp.memo)(gf);var Ef=r(4437),bf=r.n(Ef),vf=r(5106),Tf=r.n(vf);const Of="left",Sf="right",xf="hide",Cf={[Of]:li().text("Insert 1 left"),[Sf]:li().text("Insert 1 right"),[xf]:li().text("Hide column")},wf=({open:e,anchorEl:t,onClick:r,onClose:n,actions:a})=>_p().createElement(Up(),{open:e,anchorEl:t,onClose:n},_p().createElement(bf(),{component:"div"},a.map(((e,t)=>((e,t,r)=>_p().createElement(Tf(),{button:!0,component:"div",key:r,onClick:t},_p().createElement(dd(),{primary:Cf[e],primaryTypographyProps:{variant:"body2"}})))(e,(e=>()=>{r(e)})(e),t)))));wf.propTypes={open:Np().bool,anchorEl:Np().any,onClick:Np().func,onClose:Np().func,actions:Np().array};const Af=wf;class Rf extends _p().PureComponent{constructor(...e){super(...e),this.state={addColumnPopupOpen:!1,configColumnPopupOpen:!1,configurableColumnIndex:!1,popupAnchor:null,filterText:""},this.addColumnHandler=e=>{const{newColumnPlaceIndex:t}=this.state,{onChangeColumnsList:r,headColumns:n}=this.props,a=n.slice();a.splice(t,0,e),r({columns:a}),this.closeAddColumnPopup()},this.openAddColumnPopup=({newColumnPlaceIndex:e})=>{this.setState({newColumnPlaceIndex:e,configColumnPopupOpen:!1,addColumnPopupOpen:!0})},this.closeAddColumnPopup=()=>{this.setState({popupAnchor:null,addColumnPopupOpen:!1,filterText:""})},this.setFilterText=e=>{this.setState({filterText:e})},this.openConfigColumnPopup=e=>{this.setState({popupAnchor:e.currentTarget,configColumnPopupOpen:!0,configurableColumnIndex:parseInt(e.currentTarget.getAttribute("data-column-index"))})},this.closeConfigColumnPopup=()=>{this.setState({configColumnPopupOpen:!1})},this.configColumnHandler=e=>{const{configurableColumnIndex:t}=this.state;switch(e){case Of:this.openAddColumnPopup({newColumnPlaceIndex:t});break;case Sf:this.openAddColumnPopup({newColumnPlaceIndex:t+1});break;case xf:this.hideCurrentConfigColumn()}},this.hideCurrentConfigColumn=()=>{const{configurableColumnIndex:e}=this.state,{onChangeColumnsList:t,headColumns:r}=this.props,n=r.slice();n.splice(e,1),t({columns:n}),this.closeConfigColumnPopup()},this.memoizedGetColumnSize=(0,v.memoizeWith)(Rf.getMemoIdForColumnSize,Rf.getColumnSizeFromHeadColumns)}static getColumnSizeFromHeadColumns(e){return e.map((e=>({id:e.id,size:e.size})))}static getMemoIdForColumnSize(e,t){return`${t}${(0,O.toString)(e.map((e=>(0,O.pick)(["id","size"],e))))}`}render(){const{entities:e,entityToHighlight:t,selectedEntityUri:r,onScroll:n,headColumns:a,sortField:i,sortOrder:o,dndColumnReorderingEnabled:l,onEntityClick:s,onEntityHover:c,entitiesTableRef:u,additionalColumns:p,onChangeColumnsList:d,onReorderingColumn:m,onSort:f,onChangeColumnsSize:y,entityTypeUri:g,entitiesImportStatus:h={},onEntityImportStatusChange:E,logger:b,canCheck:v,checkedEntitiesUris:T,headerCheckboxState:O,onCheck:S,resizeDebounceDelay:x}=this.props,{addColumnPopupOpen:C,configColumnPopupOpen:w,popupAnchor:A,filterText:R,configurableColumnIndex:_}=this.state,I=this.memoizedGetColumnSize(a,g);return _p().createElement(_p().Fragment,null,_p().createElement(hf,{entities:e,entityToHighlight:t,selectedEntityUri:r,onScroll:n,onSort:f,onEntityClick:s,onEntityHover:c,headColumns:a,sortField:i,sortOrder:o,onReorderingColumn:m,ref:u,onChangeColumnsList:d,dndColumnReorderingEnabled:l,onChangeColumnsSize:y,columnsSize:I,entitiesImportStatus:h,onEntityImportStatusChange:E,logger:b,canCheck:v,checkedEntitiesUris:T,headerCheckboxState:O,onCheck:S,openConfigColumnPopup:this.openConfigColumnPopup,resizeDebounceDelay:x}),_p().createElement(Vd,{open:C,anchorEl:A,data:p,onListItemClick:this.addColumnHandler,filterText:R,onClose:this.closeAddColumnPopup,onSearch:this.setFilterText,hideCheckBox:!0,titleText:oi.text("Add column")}),_p().createElement(Af,{onClick:this.configColumnHandler,onClose:this.closeConfigColumnPopup,anchorEl:A,open:w,actions:_>0?[Of,Sf,xf]:[Sf]}))}}Rf.propTypes={entities:Np().array,entityToHighlight:Np().string,selectedEntityUri:Np().string,entityTypeUri:Np().string,headColumns:Np().array,dndColumnReorderingEnabled:Np().bool,onScroll:Np().func,onSort:Np().func,onReorderingColumn:Np().func,onChangeColumnsSize:Np().func,onChangeColumnsList:Np().func,onEntityClick:Np().func,onEntityHover:Np().func,sortField:Np().string,sortOrder:Np().oneOf([Kd.oy,Kd.U9]),entitiesTableRef:Np().shape({current:Np().shape({resetScrollbarPosition:Np().func})}),additionalColumns:Np().arrayOf(Np().shape({id:Np().string,label:Np().string})),entitiesImportStatus:Np().object,onEntityImportStatusChange:Np().func,logger:Np().func,canCheck:Np().bool,checkedEntitiesUris:Np().arrayOf(Np().string),headerCheckboxState:Np().oneOf([!0,!1,null]),onCheck:Np().func};const _f=Rf;var If=r(66780),Nf=r(9366),Pf=r(41633),Df=r(79881),kf=r.n(Df),Lf=r(93962),Uf=r.n(Lf),jf=r(45995),Ff=r.n(jf);function Mf(){return Mf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Mf.apply(null,arguments)}const Vf=e=>{let{open:t=!0,children:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["open","children"]);const[a,i]=(0,Rp.useState)(t),o=(0,$m.useTheme)().transitions.duration.leavingScreen;return(0,Rp.useEffect)((()=>{if(t!==a){if(!t){const e=setTimeout((()=>{i(!1)}),o);return()=>clearTimeout(e)}i(!0)}}),[t,o,a]),_p().createElement(Ff(),Mf({open:t},n),a&&r)};Vf.displayName="Drawer";var Bf=r(18759),zf=r.n(Bf),Hf=r(30122),Yf=r.n(Hf),Wf=r(43410),Gf=r.n(Wf),qf=r(93416),Zf=r.n(qf),$f=r(66825),Kf=r.n($f),Xf=r(17698);const Qf=(0,O.allPass)([(0,O.propSatisfies)(O.isEmpty,"configs"),(0,O.pathEq)(["group","hasCollapseButton"],!0)]),Jf=(0,O.reject)(Qf),ey=(0,qp.Z)({titleBox:{display:"flex",flexDirection:"row",flexShrink:0,lineHeight:"24px",paddingTop:"12px",paddingBottom:"8px",alignItems:"center",justifyContent:"space-between"},title:{color:"rgba(0,0,0,0.87)",display:"flex",flexGrow:1,alignItems:"center",fontSize:16,fontWeight:500,paddingLeft:16,letterSpacing:"0.15px",overflow:"hidden"},text:{},avatar:{marginRight:12,width:"32px",height:"32px"},collapseIcon:{marginRight:8},leftIcon:{flexShrink:0,marginRight:"20px"}}),ty=({title:e="",iconSrc:t="",isOpen:r=!0,hasCollapseButton:n=!0,leftIcon:a,onCollapse:i})=>{const o=ey();return _p().createElement("div",{className:o.titleBox},_p().createElement("div",{className:o.title},a&&_p().createElement("div",{className:o.leftIcon},a),t&&_p().createElement(ym(),{src:t,className:o.avatar}),_p().createElement(_d.Y,{value:e},_p().createElement("span",{className:o.text},e))),n&&_p().createElement(uf,{isOpen:r,onClick:i,className:o.collapseIcon,size:"S"}))};var ry=r(1230),ny=r.n(ry),ay=r(36631);const iy=({facet:e,selectedFacets:t})=>!!t.find((t=>t.fieldName===e.fieldName||t.fieldName.includes(`${e.fieldName}.`))),oy=({facet:e,selectedFacets:t})=>iy({facet:e,selectedFacets:t})||(0,x.OP)(e)&&e.children&&e.children.some((e=>iy({facet:e,selectedFacets:t})));var ly=r(13639);const sy=(0,qp.Z)({icon:{maxHeight:"25px",maxWidth:"25px",marginRight:"16px"}}),cy=({group:e,metadata:t})=>{const r=sy(),n=(0,ly.$H)(),a=(0,v.getEntityTypeGraphIcon)(t,{type:e.id}),i=(0,v.getAbsoluteImageUrl)(n,a);return _p().createElement(Em,{className:r.icon,icon:i,avatarText:e.title[0]})};function uy(){return uy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},uy.apply(null,arguments)}const py=e=>{let{onListItemClick:t,focusIndex:r,selectedFacets:n,metadata:a}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["onListItemClick","focusIndex","selectedFacets","metadata"]);const o=(0,Rp.useRef)(null);o.current=n;const l=(0,Rp.useRef)(null);l.current=r;const s=(0,Rp.useCallback)(((e,{item:r,level:n,groupId:a},i)=>{const s=oy({facet:r,selectedFacets:o.current}),c=l.current===i;return _p().createElement(kd,{key:`item-${a}-${r.fieldName}`,onClick:t,data:r,label:_p().createElement(Ld.o,{text:r.title,highlight:r.filterText}),labelInText:r.title,level:n,style:e,checked:s,isFocused:c,groupId:a,LogoIcon:r.LogoIcon})}),[t]),c=(0,Rp.useCallback)(((e,t)=>_p().createElement(Tf(),{component:"div",className:"MoreFacetsPopup-styles-subHeader--h1vGz",style:e,key:`group-${t.item.id}`},t.item.needGroupIcon&&_p().createElement(cy,{metadata:a,group:t.item}),t.item.title)),[a]),u=(0,Rp.useCallback)(((e,t)=>t.items?40:28),[]);return _p().createElement(cd,uy({getItemSize:u,renderGroupTitle:c,renderItem:s,focusIndex:r},i,{disableHorizontalScrollbar:!0}))};function dy(){return dy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dy.apply(null,arguments)}const my=574,fy={},yy=e=>{let{metadata:t,open:r,selectedFacets:n,data:a=[],onListItemClick:i,lastFacetClicked:o=fy,width:l,height:s=my}=e,c=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["metadata","open","selectedFacets","data","onListItemClick","lastFacetClicked","width","height"]);const[u,p]=(0,Rp.useState)(464),d=s-110;(0,Rp.useEffect)((()=>{p(d)}),[d]);const m=(0,Rp.useCallback)(((e,t)=>p((0,O.clamp)(56,d,t))),[d]),f=(0,Rp.useRef)();(0,Rp.useEffect)((()=>{const e=(0,O.path)(["current","updatePosition"],f);e&&e()}),[u]);const y=(0,Rp.useCallback)(((e,t,r=0)=>[{type:"item",item:e,moveTo:(0,O.has)("facetConfig")(o)&&o.facetConfig.fieldName===e.fieldName&&t===o.groupId,level:r,groupId:t}].concat(e.children?e.children.flatMap((e=>y(e,t,r+1))):[]).flat().filter((e=>!e.item.hide))),[o]),g=(0,Rp.useCallback)((e=>e.map((e=>({type:"group",item:e,items:e.facets.filter((e=>!e.hide)).map((t=>y(t,e.id)))}))).filter((e=>e.items.length))),[y]),h=(0,Rp.useMemo)((()=>g(a)),[a,g]),E=(0,Rp.useMemo)((()=>(0,ci.LG)(h)),[h]),b=(0,Rp.useCallback)((({item:e,groupData:t})=>{i(e,!oy({facet:e,selectedFacets:n}),t.groupId)}),[i,n]),{focusIndex:T,handleKeyDown:S}=ud({items:E,open:r,onSelectFocusedItem:b,selectedItems:n}),x=Math.max(l||(0,v.getMaxItemWidth)("title")(h),240);return _p().createElement(nd,dy({open:r,action:f,title:li().text("Select attribute"),containerWidth:x,searchInputOnKeyDown:S,containerHeight:110+u},c),_p().createElement(py,{focusIndex:T,selectedFacets:n,onListItemClick:i,metadata:t,items:E,height:u,onInnerContainerResize:m}),0===E.length&&_p().createElement("div",{className:"MoreFacetsPopup-styles-noResultsCaptionContainer--ChfND"},_p().createElement(zf(),{variant:"caption",display:"block",gutterBottom:!0},li().text("No results found"))))};function gy(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const hy=(0,O.curry)(((e,t)=>{const r=(0,v.getAttrTypeUrisHavingMasking)(e);return t.map((e=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){gy(e,t,r[t])}))}return e}({},e,{facets:e.facets.map((e=>(0,v.filterMaskedFromGroup)(r,e))).filter(O.identity)})))}));function Ey(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){by(e,t,r[t])}))}return e}function by(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class vy extends Rp.PureComponent{constructor(e){super(e),this.state={filterText:"",lastFacetClicked:null,addedFacets:[]},this.searchInputRootRef=_p().createRef(),this.showSearchInput=()=>this.searchInputRootRef.current.scrollIntoView(!0),this.openPopup=()=>this.props.dispatch(Ei(!0)),this.closePopup=()=>{this.props.dispatch(Ei(!1)),this.props.dispatch(((e=[])=>({type:R.k.HIGHLIGHT_ADDED_FACETS,payload:e}))(this.state.addedFacets)),this.setState({addedFacets:[]}),setTimeout((()=>{this.props.dispatch({type:R.k.CLEAR_HIGHLIGHT_ADDED_FACETS})}),3e3)},this.setFilterText=e=>this.setState({filterText:e,lastFacetClicked:null}),this.clearFilterText=()=>this.setFilterText(""),this.setLastFacetClicked=e=>this.setState({lastFacetClicked:e}),this.resetLastFacetClicked=()=>this.setLastFacetClicked(null),this.filterItem=e=>{const{filterText:t=""}=this.state;return e.title.toLowerCase().includes(t.toLowerCase())},this.filterItemsTree=e=>this.filterItem(e)||(e.children||[]).some(this.filterItemsTree),this.getFilteredFacets=e=>(e||[]).map((e=>Ey({},e,{hide:!this.filterItemsTree(e),filterText:this.state.filterText}))).map((e=>{const t=this.getFilteredFacets(e.children);return(0,O.isEmpty)(t)?e:Ey({},e,{children:t})})),this.filterItemsInGroups=e=>e.map((e=>Ey({},e,{facets:this.getFilteredFacets(e.facets)}))),this.rejectNotAllowedEntityTypes=e=>t=>t.filter((({id:t})=>!(0,v.isEntityTypeUri)(t)||e.includes(t))),this.toggleSelectedFacet=(e,t)=>{const{facetsConfigs:r,selectedEntityTypes:n,dispatch:a}=this.props,i=(0,ci.jj)(e),o=t?r.concat(e).concat(i):r.filter((t=>t.fieldName!==e.fieldName)).filter((e=>!i.find((t=>t.fieldName===e.fieldName)))),l=(0,O.uniq)(o.filter((e=>e.entityTypeUri)).map((e=>e.entityTypeUri)).concat(n)),s=o.filter((0,O.complement)(x.OP)),c=s.filter((e=>!r.find((t=>t.fieldName===e.fieldName)))),u=r.filter((e=>!s.find((t=>e.fieldName===t.fieldName)))).map((e=>e.fieldName));(c.length||u.length)&&(this.setAddedFacets(c.map((0,O.prop)("fieldName")),u),a(ti({facetsToAdd:c,fieldNamesToDelete:u,changedEntityTypes:(0,O.equals)(l,n)?null:l})))},this.setAddedFacets=(e,t)=>{const r=this.state.addedFacets.concat(e).filter((e=>!t.includes(e)));this.setState({addedFacets:r})},this.handleItemClick=(e,t,r)=>{this.setLastFacetClicked({facetConfig:e,groupId:r}),this.toggleSelectedFacet(e,t)},this.handlePopupClose=()=>{this.closePopup(),this.clearFilterText(),this.resetLastFacetClicked()},this.memoizedCollectFacetsList=(0,ay.Z)(x.tI),this.handleInputFocus=()=>{this.showSearchInput(),this.openPopup()}}get inputWidth(){return this.searchInputRootRef.current?this.searchInputRootRef.current.getBoundingClientRect().width:0}render(){const{filterText:e,lastFacetClicked:t}=this.state,{open:r,recommendedFacets:n,classes:a,metadata:i,selectedEntityTypes:o,facetsConfigs:l,dataTenantObject:s,allowedEntityTypes:c,dataTenants:u}=this.props,p=l.map((e=>({fieldName:e.fieldName,uri:e.uri}))),d=this.memoizedCollectFacetsList(i,o,n,u),m=(0,O.pipe)((0,O.when)((0,O.always)(e),this.filterItemsInGroups),(0,O.when)((0,O.always)(c),this.rejectNotAllowedEntityTypes(c)),(0,I.Eb)(s),hy(i))(d),{verticalOrigin:f,popupHeight:y}=((e,t,r=16)=>{let n="top";if(e){const a=e.getBoundingClientRect(),i=r,o=window.innerHeight-r;if(a.top+t>o)if(a.bottom-t<i){const e=a.bottom-i,r=o-a.top;t=Math.max(e,r),n=e>r?"bottom":"top"}else n="bottom"}return{verticalOrigin:n,popupHeight:t}})(this.searchInputRootRef.current,my),g={vertical:f,horizontal:"right"};return _p().createElement(Rp.Fragment,null,_p().createElement(Jp,{classes:{root:a.inputContainer},onSearch:this.setFilterText,onFocus:this.handleInputFocus,rootRef:this.searchInputRootRef,value:e,placeholder:li().text("Search & add attributes"),height:40,"data-reltio-id":"reltio-search-more-facets-search-input"}),_p().createElement(yy,{open:r,anchorEl:this.searchInputRootRef.current,metadata:i,selectedFacets:p,data:m,onClose:this.handlePopupClose,onListItemClick:this.handleItemClick,lastFacetClicked:t,width:this.inputWidth,height:y,onSearch:this.setFilterText,headerPlacement:"bottom"===f?"bottom":"top",anchorOrigin:g,transformOrigin:g,disableRestoreFocus:!0}))}}vy.defaultProps={selectedEntityTypes:[],facetsConfigs:[]};const Ty=(0,Pp.connect)((e=>({metadata:A().selectors.getMetadata(e),open:(0,ki.ds)(e),facetsConfigs:(0,C.Mp)(e),recommendedFacets:(0,C.ER)(e),selectedEntityTypes:(0,C.DX)(e),dataTenantObject:(0,ai.t9)(e),allowedEntityTypes:(0,ki.Xf)(e),dataTenants:A().selectors.getDataTenants(e)})))(ny()((()=>({inputContainer:{margin:"4px 16px 16px",flexShrink:"0"}})))(vy)),Oy=(0,qp.Z)({facetGroupContainer:{display:"flex",flexShrink:0,flexDirection:"column","& + hr":{marginTop:8},"& + &":{marginTop:"8px"}}});function Sy(){return Sy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Sy.apply(null,arguments)}const xy=e=>{let{hasSearchAttributesField:t,children:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["hasSearchAttributesField","children"]);const a=Oy(),[i,o]=(0,Rp.useState)(!0);return _p().createElement("div",{className:a.facetGroupContainer},_p().createElement(ty,Sy({isOpen:i,onCollapse:e=>{o(!i)}},n)),t&&_p().createElement(_p().Fragment,null,_p().createElement(Ty,null),_p().createElement(Kf(),null)),i&&r)};function Cy(){return Cy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Cy.apply(null,arguments)}var wy=r(52004),Ay=r.n(wy),Ry=r(40927),_y=r.n(Ry);const Iy=(0,qp.Z)({link:{display:"flex",alignItems:"center",cursor:"pointer"},icon:{fontSize:"20px",marginRight:"4px",marginLeft:"-2px"}}),Ny=({active:e,onClick:t,className:r})=>{const n=Iy(),a=e?_y():lf();return _p().createElement(Ay(),{className:kp()(n.link,r),onClick:t,underline:"none"},_p().createElement(a,{className:n.icon}),e?li().text("View less"):li().text("View more"))};var Py=r(50592),Dy=r(23888),ky=r.n(Dy);const Ly=(0,qp.Z)((e=>({bar:{backgroundColor:e.palette.secondary.main,opacity:.12,position:"absolute",minHeight:"20px",minWidth:"5px",borderRadius:"2px",top:0,left:0,height:"100%"}}))),Uy=e=>(0,O.is)(Number,e),jy=({className:e,width:t=0,maxWidth:r})=>{const n=Ly(),a=(0,Rp.useCallback)((e=>(r?100*e/r:0)+"%"),[r]);return t?_p().createElement("div",{className:kp()(n.bar,e),style:{width:Uy(t)?a(t):t}}):null},Fy=(0,qp.Z)((e=>({listContainer:{display:"flex",flexDirection:"column",paddingLeft:18,"& $disabled":{pointerEvents:"none",opacity:.4}},disabled:{},item:{display:"flex",flexGrow:1,flexShrink:0,flexDirection:"row",marginRight:10,marginTop:2,marginBottom:2},info:{display:"flex",flexGrow:1,position:"relative",minWidth:0,marginTop:2,marginBottom:2,"&:hover":{cursor:"pointer","& $buttonONLY":{display:"block"}}},buttonONLY:{display:"none",position:"absolute",height:24,width:59,borderRadius:3,backgroundColor:"#DFDFDF",fontSize:14,fontWeight:600,lineHeight:"16px",color:"rgba(0,0,0,0.54)",boxShadow:"none",top:0,right:0,zIndex:3},avatar:{marginRight:8,height:24,width:24},checkbox:{marginRight:14,padding:0,"& $checked":{opacity:1}},checked:{},textInfo:{display:"flex",flexGrow:1,lineHeight:"16px",backgroundColor:"transparent",minWidth:0,alignItems:"center",zIndex:2},text:{flexGrow:1,marginLeft:7,marginRight:4,color:e.palette.text.primary,width:"100%",maxHeight:"32px",wordBreak:"break-word",wordWrap:"break-word",overflow:"hidden"},count:{flexShrink:0,fontSize:12,color:e.palette.text.secondary,textAlign:"right",marginRight:4},toggleContainer:{height:28,padding:"2px 2px",display:"flex",alignItems:"center",justifyContent:"flex-start",margin:"0",background:e.palette.background.default},toggleButton:{padding:"0",minWidth:"28",height:"28",border:"0","&:last-child":{paddingLeft:"0"}},checkedBar:{opacity:.4}})));function My(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Vy={showColorBar:!0,hasOnlyButton:!1},By=({config:e,data:t=[],values:r=[],onChange:n=O.identity})=>{const a=Fy();e=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){My(e,t,r[t])}))}return e}({},Vy,e);const i=e=>()=>{const t=r.includes(e)?r.filter((t=>t!==e)):r.concat(e);n(t)},o=Math.max(...t.map((e=>e.number)));return _p().createElement("div",{className:a.listContainer},t.map((t=>_p().createElement("div",{key:t.value,className:kp()(a.item,{[a.disabled]:!t.number&&!r.includes(t.value)}),"data-reltio-id":"search-facets-list-row"},(e=>_p().createElement(fd(),{className:kp()(a.checkbox,{[a.checked]:r.includes(e.value)}),checked:r.includes(e.value),onChange:i(e.value),value:e.value,color:"primary"}))(t),_p().createElement("div",{className:a.info,onClick:i(t.value)},(e=>_p().createElement(jy,{className:kp()({[a.checkedBar]:r.includes(e.value)}),width:e.number,maxWidth:o}))(t),_p().createElement("div",{className:kp()(a.textInfo)},_p().createElement("div",{className:a.text},t.label),_p().createElement("div",{className:a.count},void 0===t.number?li().text("N/A"):(0,ni.k7)(t.number,5e3))),e.hasOnlyButton&&(e=>{return _p().createElement(ky(),{className:a.buttonONLY,onClick:(t=e.value,e=>{e.stopPropagation(),n([t])})},li().text("ONLY"));var t})(t))))))};var zy=r(1441);const Hy=(0,qp.Z)((()=>({container:{overflow:"hidden",display:"flex",flexGrow:1,flexDirection:"column",fontSize:"13px"},noData:{marginLeft:"16px"},viewMoreLess:{paddingLeft:"20px"}}))),Yy=({config:e,data:t=[],values:r=[],onChange:n})=>{const a=Hy(),i=(0,Pp.useDispatch)(),o=(0,Rp.useCallback)((({show:e})=>{i((({show:e,silent:t})=>({type:R.k.SHOW_MORE_ENTITY_TYPES,payload:{show:e,silent:t}}))({show:e}))}),[i]),l=(0,Pp.useSelector)((t=>(0,C.jC)(e,t))),s=(0,Pp.useSelector)(ai.t9),c=t.length>B.wP,u=(0,Rp.useCallback)((()=>{o({show:!l})}),[o,l]),p=(0,Rp.useMemo)((()=>{const e=l?t:t.slice(0,B.wP);return(0,zy.ZK)(e,s)}),[t,l,s]);return _p().createElement("div",{className:a.container},t.length>0?_p().createElement(_p().Fragment,null,_p().createElement(By,{data:p,values:r,onChange:n,config:e}),c&&_p().createElement(Ny,{active:l,onClick:u,className:a.viewMoreLess})):_p().createElement(Py.K,{variant:"noData",className:a.noData}))};var Wy=r(97317),Gy=r(90320);const qy=(0,Gy.M)(Wy.Z);var Zy=r(14489),$y=r(79283);const Ky=(0,Gy.M)($y.Z);var Xy=r(22507),Qy=r(14658);function Jy(){return Jy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Jy.apply(null,arguments)}const eg={Option:({innerProps:e,innerRef:t,children:r,isFocused:n,isSelected:a,selectProps:{classes:i},label:o})=>_p().createElement(gd(),Jy({className:kp()(i.option,{[i["option--selected"]]:a}),ref:t,selected:n,component:"div"},e),_p().createElement(fd(),{color:"primary",checked:a}),_p().createElement(_d.Y,{value:o},_p().createElement("div",{className:i["option--item"]},r)))},tg=(0,qp.Z)((e=>({label:{top:6,left:16},placeholder:({placeholder:e,label:t})=>({display:!e||t?"none":void 0}),"option--selected":{fontWeight:400},clearIndicator:{padding:e.spacing(1),margin:e.spacing(.25,.5)},dropdownIndicator:{padding:e.spacing(1),margin:e.spacing(.25,.5)}})));function rg(){return rg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},rg.apply(null,arguments)}function ng(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){ag(e,t,r[t])}))}return e}function ag(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let ig=0;const og=e=>{const{label:t,creatable:r,getOptions:n,loadingIndicator:a,components:i,classes:o,styles:l,onChange:s,onInputChange:c,menuPlacement:u="auto"}=e,p=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["label","creatable","getOptions","loadingIndicator","components","classes","styles","onChange","onInputChange","menuPlacement"]),d=r?qy:n?Ky:Zy.J,[m,f]=(0,Rp.useState)(""),y=tg((0,O.omit)(["classes"],e)),g="custom-select-"+ig++,h=(0,Rp.useRef)();((e=[],t)=>{const r=(0,Qy.D)(null==e?void 0:e.length);(0,Rp.useEffect)((()=>{const n=setTimeout((()=>{const n=(e=>{let t=null==e?void 0:e.parentElement;for(;t;){if(t.scrollHeight>t.clientHeight)return t;t=t.parentElement}return null})(null==t?void 0:t.current);var a;n&&((e,t,r,n)=>e&&t<e&&n.getBoundingClientRect().bottom>r.getBoundingClientRect().bottom)(null==e?void 0:e.length,r,n,t.current)&&(null===(a=t.current)||void 0===a||a.scrollIntoView(!1))}),0);return()=>{clearTimeout(n)}}),[null==e?void 0:e.length])})(e.value,(e=>{const t={};return e.current&&(t.current=(0,O.prop)("controlRef",e.current)),t})(h));const E=ng({},eg,i),b=(0,Xy.z)(y,o),v=ng({indicatorSeparator:e=>ng({},e,{margin:"10px 0"}),loadingIndicator:e=>ng({},e,{display:a?e.display:"none"}),loadingMessage:e=>ng({},e,{fontFamily:'"Roboto", "Helvetica", "Arial", sans-serif'})},l),T=t?{inputId:g,TextFieldProps:ng({label:t,InputLabelProps:{htmlFor:g,shrink:!(!e.value||!e.value.length)||void 0,className:b.label}},e.TextFieldProps)}:{};return _p().createElement(d,rg({isMulti:!0,inputId:g,inputValue:m,onChange:function(e,t){s(e,t),"create-option"===t.action&&(f(""),c("",{action:"input-change"}))},onInputChange:function(e,{action:t}){c(e,{action:t}),"set-value"!==t&&f(e)},closeMenuOnSelect:!1,hideSelectedOptions:!1,classes:b,components:E,styles:v,menuPlacement:u,loadOptions:n,innerRef:h},T,p))};og.defaultProps={creatable:!1,cacheOptions:!0,components:{},classes:{},placeholder:"",loadingIndicator:!1,onInputChange:()=>{},onChange:()=>{}},og.propTypes={creatable:Np().bool,cacheOptions:Np().bool,defaultOptions:Np().bool,value:Np().arrayOf(Np().shape({label:Np().string.isRequired,value:Np().any})),options:Np().arrayOf(Np().shape({label:Np().string.isRequired,value:Np().any})),onChange:Np().func,onInputChange:Np().func,placeholder:Np().string,label:Np().string,loadingIndicator:Np().bool,components:Np().shape({ClearIndicator:Np().func,Control:Np().func,DropdownIndicator:Np().func,DownChevron:Np().func,CrossIcon:Np().func,Group:Np().func,GroupHeading:Np().func,IndicatorsContainer:Np().func,IndicatorSeparator:Np().func,Input:Np().func,LoadingIndicator:Np().func,Menu:Np().func,MenuList:Np().func,MenuPortal:Np().func,LoadingMessage:Np().func,NoOptionsMessage:Np().func,MultiValue:Np().func,MultiValueContainer:Np().func,MultiValueLabel:Np().func,MultiValueRemove:Np().func,Option:Np().func,Placeholder:Np().func,SelectContainer:Np().func,SingleValue:Np().func,ValueContainer:Np().func}),classes:Np().shape({control:Np().string,valueContainer:Np().string,multiValue:Np().string,noOptionsMessage:Np().string,singleValue:Np().string,placeholder:Np().string,menu:Np().string,clearIndicator:Np().string,dropdownIndicator:Np().string,option:Np().string,"option--selected":Np().string,label:Np().string}),styles:Np().shape({clearIndicator:Np().func,container:Np().func,control:Np().func,dropdownIndicator:Np().func,group:Np().func,groupHeading:Np().func,indicatorsContainer:Np().func,indicatorSeparator:Np().func,input:Np().func,loadingIndicator:Np().func,loadingMessage:Np().func,menu:Np().func,menuList:Np().func,menuPortal:Np().func,multiValue:Np().func,multiValueLabel:Np().func,multiValueRemove:Np().func,noOptionsMessage:Np().func,option:Np().func,placeholder:Np().func,singleValue:Np().func,valueContainer:Np().func}),TextFieldProps:Np().object,getOptions:Np().func,menuPlacement:Np().string,menuPortalTarget:Np().object,menuShouldBlockScroll:Np().bool,captureMenuScroll:Np().bool,getOptionValue:Np().func,isSearchable:Np().bool,inputRef:Np().shape({current:Np().object})};var lg=r(80959),sg=r(88640),cg=r(25386),ug=r(59428),pg=r(47823);const dg=(0,qp.Z)({item:{display:"flex",minHeight:"28px",flexGrow:1,flexDirection:"row",alignItems:"center",borderRadius:"1px",padding:0,opacity:1},checkbox:{marginRight:"14px",marginLeft:"18px",padding:0},infobox:{display:"flex",flexGrow:1,alignItems:"center",position:"relative",height:"20px",margin:"2px 10px 2px 0",minWidth:0},textbox:{display:"flex",flexDirection:"row",alignItems:"center",flexGrow:1,minWidth:0,zIndex:2},text:{flexGrow:1,width:0,height:"15px",color:"rgba(0,0,0,0.87)",fontSize:"13px",lineHeight:"16px",letterSpacing:0,fontWeight:"normal",paddingLeft:"7px",paddingRight:"8px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",minWidth:0},number:{flexGrow:0,flexShrink:0,height:"16px",color:"rgba(0,0,0,0.6)",fontSize:"12px",lineHeight:"16px",textAlign:"right",paddingRight:"4px"},colorBar:{height:"20px"},selectedColorBar:{opacity:.4},itemSelected:{backgroundColor:"rgba(0, 0, 0, 0.04) !important"}});function mg(){return mg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},mg.apply(null,arguments)}const fg=e=>{const{innerProps:t,innerRef:r,data:n,isSelected:a,isFocused:i,selectProps:{classes:o}}=e,l=dg(),s=(0,O.has)("width",n),c=(0,O.has)("number",n);return _p().createElement(gd(),mg({className:o.option,classes:{root:l.item,selected:l.itemSelected},ref:r,component:"div",selected:i,disableGutters:!0},t),_p().createElement(fd(),{checked:a,color:"primary",disableRipple:!0,classes:{root:l.checkbox}}),_p().createElement("div",{className:l.infobox},_p().createElement("div",{className:l.textbox},_p().createElement(_d.Y,{value:n.label},_p().createElement("div",{className:l.text},n.label)),c&&_p().createElement("div",{className:l.number},(0,ni.k7)(n.number,5e3))),s&&_p().createElement(jy,{className:kp()(l.colorBar,{[l.selectedColorBar]:a}),width:n.width})))};fg.propTypes={innerProps:Np().shape({id:Np().string.isRequired,key:Np().string,onClick:Np().func.isRequired,onMouseMove:Np().func.isRequired,onMouseOver:Np().func.isRequired,tabIndex:Np().number.isRequired}).isRequired,innerRef:Np().oneOfType([Np().oneOf([null]),Np().func,Np().shape({current:Np().any.isRequired})]),isSelected:Np().bool.isRequired,isFocused:Np().bool.isRequired,selectProps:Np().shape({classes:Np().shape({option:Np().string})}),data:Np().shape({value:Np().string,label:Np().string.isRequired,number:Np().number}).isRequired};const yg=fg,gg=e=>{const{selectProps:{classes:t}}=e;return _p().createElement(Py.K,{variant:"noData",className:t.noOptionsMessage})};gg.propTypes={selectProps:Np().object.isRequired};const hg=gg;function Eg(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){bg(e,t,r[t])}))}return e}function bg(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const vg={container:e=>Eg({},e,{width:"100%"}),menuList:e=>Eg({},e,{maxHeight:"240px",padding:"8px 0"}),menu:e=>Eg({},e,{maxHeight:"240px"})},Tg=(0,qp.Z)((()=>({control:{minHeight:"46px",backgroundColor:"rgba(0,0,0, 0.0267)",height:"auto",padding:0},option:{minHeight:"28px",display:"flex",flexGrow:1,flexShrink:0,flexDirection:"row",padding:0},noOptionsMessage:{padding:"0 16px 0 18px"},multiValue:{backgroundColor:"rgba(43, 152, 240, 0.12)"}}))),Og=Np().shape({value:Np().string.isRequired,label:Np().string.isRequired,number:Np().number});function Sg(){return Sg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Sg.apply(null,arguments)}function xg(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Cg=e=>{let{values:t=[],defaultOptions:r=[],filteredOptions:n,onChange:a=O.identity,getSuggestions:i,showBar:o=!0,showNumberInValue:l=!1,classes:s={},styles:c={},canLoadMore:u=!0,max:p=B.cu}=e,d=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["values","defaultOptions","filteredOptions","onChange","getSuggestions","showBar","showNumberInValue","classes","styles","canLoadMore","max"]);const m=Tg(),[f,y]=(0,Rp.useState)(""),[g,h]=(0,Rp.useState)(1),[E,b]=(0,Rp.useState)(!1),T=(0,Rp.useRef)(null),S=(0,Rp.useRef)(!1),x=(0,Rp.useRef)(!1),C=(n||[]).concat(r),w=e=>C.find((t=>t.value===e))||{value:e,label:e},A=e=>l&&(0,O.has)("number",e)?(0,O.assoc)("formattedNumber",(0,v.formatNumberAsMetric)((0,O.prop)("number",e),5e3),e):e,R=(0,O.pipe)((e=>{if(o&&e.length&&(0,O.has)("number",e[0])){const t=Math.max(...e.map((e=>e.number)));return e.map((e=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){xg(e,t,r[t])}))}return e}({},e,{width:_(e.number,t)})))}return e}),(0,O.uniqBy)((0,O.prop)("value"))),_=(e,t)=>(t?100*e/t:0)+"%",I=(0,v.debounce)(((e,{action:t})=>{e!==f&&"set-value"!==t&&(y(e),h(1),S.current=!1,b(!0),i({value:e,pageNumber:1}))}),250),N=n||r,P=(0,Rp.useCallback)((()=>{b(!0),i({value:f,pageNumber:g+1,currentOptions:N}),S.current=!0}),[f,g,i,N]);(0,Rp.useEffect)((()=>{b(!1),S.current&&(h((e=>e+1)),S.current=!1)}),[n]),(0,Rp.useEffect)((()=>{x.current||(b(!1),h(1),S.current=!1,i({value:"",pageNumber:1})),x.current=!1}),[r]);const D=(0,Rp.useMemo)((()=>N.slice(0,g*p)),[N,g,p]),k=u&&N.length>D.length;return _p().createElement(og,Sg({filterOption:({label:e,value:t},r)=>v.utils.strings.search(e,r)||v.utils.strings.search(t,r),value:(e=>(0,v.wrapInArrayIfNeeded)(e).map(w).map(A))(t),onChange:(0,O.pipe)((0,O.tap)((()=>{x.current=!0})),(0,O.pluck)("value"),a),options:R(D),onInputChange:I,classes:(0,O.mergeRight)(m,s),styles:(0,O.mergeRight)(vg,c),TextFieldProps:{InputProps:{disableUnderline:!0},ref:T},inputRef:T,components:{Option:yg,NoOptionsMessage:hg,Menu:lg.h,DropdownIndicator:sg.K,MultiValue:cg._,MenuList:ug.d},menuPlacement:"bottom",menuListFooter:k&&_p().createElement(pg.X,{loading:E,onClick:P})},d))};Cg.propTypes={values:Np().array,defaultOptions:Np().arrayOf(Og),filteredOptions:Np().arrayOf(Og),onChange:Np().func.isRequired,getSuggestions:Np().func.isRequired,showBar:Np().bool,showNumberInValue:Np().bool,classes:Np().object,styles:Np().object,canLoadMore:Np().bool,max:Np().number};const wg=(0,Rp.memo)(Cg);var Ag=r(43627),Rg=r.n(Ag);function _g(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Ig(e,t,r[t])}))}return e}function Ig(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ng=(0,O.range)(2,10).reduce(((e,t)=>_g({},e,{[`&:nth-child(${t})`]:{paddingLeft:`calc(1em * (${t} - 2))`,"&::before":{content:'"└"',display:"inline-block",fontSize:"1em",marginRight:"5px",color:"rgba(255, 255, 255, 0.28)"}}})),{}),Pg=(0,qp.Z)((e=>({tooltip:e.tooltip,tooltipContent:{minWidth:"165px",padding:"4px 2px 2px","& p":{fontSize:"11px",lineHeight:"13px",fontWeight:500,margin:0,color:"white"},"& ul":{listStyleType:"none",padding:0,margin:0,"& li":_g({fontSize:"10px",lineHeight:"11px",fontWeight:500,color:"rgba(255, 255, 255, 0.7)",marginTop:"4px"},Ng,{"&:last-child":{color:"white"}}),"& li + li":{marginTop:"2px"}}}})));function Dg(){return Dg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Dg.apply(null,arguments)}const kg=e=>{let{pathToTitle:t,children:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["pathToTitle","children"]);const a=Pg(),i=null!=t&&t.length?_p().createElement("div",{className:a.tooltipContent},_p().createElement("p",null,(0,O.last)(t)),t.length>2&&_p().createElement("ul",null,t.map((e=>_p().createElement("li",{key:e},e))))):"";return _p().createElement(Rg(),Dg({title:i,disableFocusListener:!0,classes:{tooltip:a.tooltip}},n),r)};var Lg=r(96091),Ug=r.n(Lg),jg=r(35635),Fg=r.n(jg);const Mg=(0,qp.Z)({root:{boxSizing:"border-box",height:"18px",border:"1px solid rgba(0,0,0,0.12)",borderRadius:"16px",backgroundColor:"transparent","& $deleteIcon":{margin:"0",height:"12px",width:"12px",color:"rgba(0,0,0,0.38)"}},outlined:{"& $deleteIcon":{marginRight:2}},deleteIcon:{},label:{color:"rgba(0,0,0,0.38)",fontSize:"12px",fontWeight:500,lineHeight:"16px",paddingLeft:"4px",paddingRight:"4px"}});function Vg(){return Vg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Vg.apply(null,arguments)}const Bg=(0,Id.T)(Fg()),zg=e=>{let{label:t,onDelete:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["label","onDelete"]);const a=Mg();return _p().createElement(Ug(),Vg({className:a.root,label:li().number(t),onDelete:r,variant:"outlined",classes:{root:a.root,outlined:a.outlined,deleteIcon:a.deleteIcon,label:a.label},deleteIcon:_p().createElement(Bg,{tooltipTitle:li().text("Clear")})},n))},Hg=(0,qp.Z)((e=>({container:{display:"flex",flexDirection:"column",flexGrow:1,justifyContent:"center",height:"100%",minWidth:0,cursor:"pointer"},parent:{color:e.palette.text.secondary,fontSize:"13px",lineHeight:"15px",letterSpacing:0,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},titleContainer:{display:"flex",flexDirection:"row",overflow:"hidden",alignItems:"flex-end",height:"18px",width:"100%"},title:{color:e.palette.text.primary,fontSize:"14px",lineHeight:"16px",fontWeight:500,letterSpacing:"0.24px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},chip:{display:"inline",marginLeft:"6px"}})));function Yg(){return Yg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Yg.apply(null,arguments)}const Wg=({title:e="",chipLabel:t=0,onDelete:r,pathToTitle:n,onClick:a})=>{const i=Hg(),o=Boolean(n&&n.length>2),l=o?kg:_d.Y,s=o?{pathToTitle:n}:{value:e};return _p().createElement("div",{className:i.container,onClick:a},o&&_p().createElement(kg,Yg({placement:"bottom-start"},s),_p().createElement("div",{className:i.parent},n[n.length-2])),_p().createElement("div",{className:i.titleContainer},_p().createElement(l,Yg({placement:"bottom-start"},s),_p().createElement("span",{className:i.title},e)),0!==t&&_p().createElement("div",{className:i.chip},_p().createElement(zg,{label:t,onDelete:r}))))};function Gg(){return Gg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Gg.apply(null,arguments)}const qg=(0,qp.Z)((()=>({facetContainer:{display:"flex",flexGrow:1,flexShrink:0,flexDirection:"column",padding:"0 16px",borderRadius:"1px",position:"relative",borderBottom:"solid 1px rgba(0,0,0, 0.33)","&:last-child":{borderBottom:"solid 1px rgb(255,255,255)"}},openedFacetContainer:{paddingBottom:"15px"},closedFacetContainer:{paddingBottom:"5px"},iconButton:{"&:first-child":{marginLeft:"-16px",height:24,width:24},visibility:"hidden"},recommendedIcon:{width:"18px",height:"18px",marginRight:"6px",flexShrink:0},titleContainer:{display:"flex",flexDirection:"row",flexShrink:0,alignItems:"center",height:"42px",borderRadius:"1px","&:hover $iconButton":{visibility:"visible"},marginLeft:"-16px",paddingLeft:"16px"},expandIcon:{transition:"transform .15s ease",margin:"0 2px",color:"rgba(0, 0, 0, 0.54)"},expanded:{transform:"rotate(180deg)"},"@keyframes animate":{from:{background:"#FFFBEB"},"66%":{background:"#FFFBEB"},"100%":{background:"transparent"}},highlighted:{animationName:"$animate",animationDuration:"3s",animationIterationCount:1}}))),Zg=(0,Id.T)((e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return _p().createElement("svg",Gg({width:"13",height:"18",viewBox:"0 0 13 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},r),_p().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},_p().createElement("g",null,_p().createElement("g",null,_p().createElement("g",null,_p().createElement("g",{transform:"translate(-3 -1)"},_p().createElement("g",null,_p().createElement("path",{fill:"#FF4081",d:"M5.833 10h3.75v6.667l-3.75 1.666z"}),_p().createElement("path",{fill:"#CE0C4E",d:"M13.333 10v8.333l-3.75-1.666V10z"})),_p().createElement("circle",{fill:"#FFC058",cx:"9.583",cy:"7.917",r:"6.25"}),_p().createElement("circle",{fill:"#FFCD7B",cx:"9.583",cy:"7.917",r:"5.417"}),_p().createElement("path",{fill:"#FFFBB5",d:"M8.333 11.667L5 8.462l.933-.898 2.4 2.308L13.4 5l.933.897z"})))))))})),$g=({title:e,chipLabel:t,onDeleteChip:r,pathToTitle:n,onClose:a,children:i,isOpenByDefault:o=!0,isHighlighted:l=!1,isRecommended:s=!1})=>{const c=qg(),[u,p]=(0,Rp.useState)(o),d=()=>{p(!u)};return _p().createElement("div",{className:kp()(c.facetContainer,{[c.openedFacetContainer]:u,[c.closedFacetContainer]:!u,[c.highlighted]:l}),"data-reltio-id":`search-facet-container-${e}`},_p().createElement("div",{className:c.titleContainer},_p().createElement(Bd.k,{tooltipTitle:li().text("Remove"),icon:zp(),onClick:a,className:c.iconButton,size:"XXS"}),s&&_p().createElement(Zg,{className:c.recommendedIcon,tooltipTitle:li().text("Recommended"),showForDisabled:!0}),_p().createElement(Wg,{title:e,pathToTitle:n,chipLabel:t,onDelete:r,onClick:d}),_p().createElement(uf,{onClick:d,isOpen:u,className:c.iconButton,size:"S",tooltipTitle:u?li().text("Collapse attribute"):li().text("Expand attribute"),tooltipPlacement:"bottom-end"})),u?i:null)},Kg=(0,qp.Z)((()=>({control:{minHeight:"40px",backgroundColor:"rgba(0, 0, 0, 0.03)",height:"auto",padding:0},valueContainer:{margin:"4px 6px"},placeholder:{color:"rgba(0,0,0,0.6)",fontSize:"13px",letterSpacing:0,lineHeight:"15px",left:"16px",bottom:"14px"},dropdownIndicator:{margin:"0px 2px 0px 0px"}}))),Xg=({config:e,data:t=[],filteredData:r,values:n=[],isHighlighted:a,isRecommended:i,onSearch:o=O.identity,onChange:l,onClose:s})=>{const c=Kg();return _p().createElement($g,{title:e.title,pathToTitle:e.pathToTitle,onClose:s,chipLabel:n.length,onDeleteChip:()=>l([]),isHighlighted:a,isRecommended:i},_p().createElement(wg,{values:n,defaultOptions:t,filteredOptions:r,onChange:l,getSuggestions:o,isClearable:!1,showBar:!1,showNumberInValue:!0,classes:c,placeholder:li().text("All values"),canLoadMore:!(0,Pa.tW)(e)}))};var Qg=r(32015),Jg=r(15608),eh=r.n(Jg);const th=(0,qp.Z)((e=>({root:{borderRadius:4,padding:"15px 0"},rail:{backgroundColor:(0,$m.alpha)(e.palette.primary.main,.12),borderRadius:4},thumb:{width:"14px",height:"14px",border:"1px solid #FFFFFF","&$focusVisible,&:hover":{boxShadow:`0px 0px 0px 9px ${(0,$m.alpha)(e.palette.primary.main,.12)}`,"@media (hover: none)":{boxShadow:"none"}},"&$active":{boxShadow:`0px 0px 0px 9px ${(0,$m.alpha)(e.palette.primary.main,.12)}`},"&::after":{left:-10,top:-10,right:-10,bottom:-10}},focusVisible:{},active:{},track:{borderRadius:4}}))),rh=(0,qp.Z)((e=>({tooltipPlacementTop:{margin:"3px 0"},tooltip:{color:"#FFFFFF",fontSize:"9px",letterSpacing:0,lineHeight:"10px",textAlign:"right",padding:"3px 4px",backgroundColor:e.palette.primary.main,borderRadius:"4px"}}))),nh=({children:e,open:t,value:r})=>{const n=rh();return _p().createElement(Rg(),{open:t,enterTouchDelay:0,placement:"top",title:r,classes:{tooltipPlacementTop:n.tooltipPlacementTop,tooltip:n.tooltip}},e)};function ah(){return ah=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ah.apply(null,arguments)}nh.propTypes={children:Np().element.isRequired,open:Np().bool.isRequired,value:Np().string.isRequired};const ih=e=>{let{min:t,max:r,range:n,onChange:a,onAfterChange:i,className:o}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["min","max","range","onChange","onAfterChange","className"]);const s=th();return _p().createElement("div",{className:o},_p().createElement(eh(),ah({min:t,max:r,value:n,classes:{root:s.root,rail:s.rail,track:s.track,thumb:s.thumb},onChange:(e,t)=>{a&&a(t)},onChangeCommitted:(e,t)=>{i&&i(t)},valueLabelDisplay:"auto","aria-labelledby":"range-slider",components:{ValueLabel:nh},size:"small",component:"div"},l)))};ih.propTypes={min:Np().oneOfType([Np().number,Np().string]).isRequired,max:Np().oneOfType([Np().number,Np().string]).isRequired,range:Np().array.isRequired,onChange:Np().func,onAfterChange:Np().func,className:Np().string};const oh=ih;var lh=r(18205),sh=r(19406),ch=r(55484),uh=r(25556),ph=r(3131),dh=r(27741),mh=r(42400),fh=r(11011);const yh=(0,qp.Z)((()=>({tooltip:{borderRadius:"1px",backgroundColor:"rgba(97,97,97,0.9)",padding:"8px"},number:{color:"#FFFFFF",fontSize:"11px",fontWeight:500,letterSpacing:0,lineHeight:"13px"},value:{opacity:.7,color:"#FFFFFF",fontSize:"10px",letterSpacing:0,lineHeight:"11px",marginTop:"4px"}}))),gh=({payload:e,formatter:t,active:r})=>{const n=yh();if(r){const{payload:{label:r},value:a}=e[0];return _p().createElement("div",{className:n.tooltip},_p().createElement("div",{className:n.number},t(a)),_p().createElement("div",{className:n.value},r))}return null},hh=(0,qp.Z)((()=>({barChart:{"& text":{stroke:"none",fill:"rgba(0, 0, 0, 0.54)",textAnchor:"end"},"& .recharts-yAxis":{fontSize:"10px",fill:"rgba(0, 0, 0, 0.54)",textAnchor:"end"},"& .recharts-xAxis .recharts-cartesian-axis-tick:first-child text":{fontSize:"10px",fill:"rgba(0, 0, 0, 0.54)",textAnchor:"start"},"& .recharts-xAxis .recharts-cartesian-axis-tick:last-child text":{fontSize:"10px",fill:"rgba(0, 0, 0, 0.54)",textAnchor:"end"},"& .recharts-cartesian-axis-line":{stroke:"rgba(0, 0, 0, 0.54)"}}})));function Eh(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const bh=({data:e=[],range:t=[],domain:r,color:n=v.theme.palette.primary.main,tickFormatterX:a,tickFormatterY:i})=>{const o=hh(),[l,s]=(0,Rp.useState)(null),c=(e,r)=>(l===r?.2:0)+((({value:e})=>e[0]>=t[0]&&e[1]<=t[1])(e)?.6:.2),u=e.map(((e,t,r)=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Eh(e,t,r[t])}))}return e}({},e,{value:t<r.length-1?e.value[0]:e.value[1]}))),p=e=>{e.isTooltipActive?s(e.activeTooltipIndex):s(null)};return _p().createElement(lh.h,null,_p().createElement(sh.v,{data:u,margin:{top:12,right:0,left:0,bottom:0},onMouseEnter:p,onMouseLeave:p,onMouseMove:p,className:o.barChart},_p().createElement(ch.q,{vertical:!1,stroke:"#f2f2f2"}),_p().createElement(uh.K,{dataKey:"value",interval:0,padding:{left:4,right:4},height:15,tickLine:!1,ticks:r,tick:e=>{const{x:t,y:r,index:n,payload:{value:i,offset:o}}=e;return _p().createElement("text",{x:0===n?t-o:t+o,y:r+4,textAnchor:0===n?"start":"end"},`${a(i)}`)}}),_p().createElement(ph.B,{width:38,domain:[0,"auto"],axisLine:!1,tickLine:!1,tickSize:0,tickMargin:4,tickCount:6,tickFormatter:i}),_p().createElement(dh.u,{cursor:{fill:"rgb(255,255,255)"},content:_p().createElement(gh,{formatter:i}),isAnimationActive:!1}),_p().createElement(mh.$,{dataKey:"number",isAnimationActive:!1},e.map(((e,t)=>_p().createElement(fh.b,{key:`cell-${t}`,fill:n,fillOpacity:c(e,t)}))))))},vh="NumericRangeFacet-styles-numberEditorInputRoot--djW3k",Th="NumericRangeFacet-styles-numberEditorRoot--DVXqx",Oh="NumericRangeFacet-styles-input--Nl2tx";function Sh(){return Sh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Sh.apply(null,arguments)}class xh extends Rp.PureComponent{constructor(...e){super(...e),this.state={range:[],data:[],values:[],lowerBound:0,upperBound:0},this.handleOnChangeValue=e=>{if(!this.props.onChange)return;const{data:t,values:r}=this.props,{rangeService:n}=this.state,[a,i]=n.getBarDomain(t),o=n.adjustRange(e,a,i);0!==r.length&&n.equals(o[0],(0,O.path)([0,0],r))&&n.equals(o[1],(0,O.path)([0,1],r))||this.props.onChange([o])},this.onLowerBoundChanged=e=>{const{range:t,NumMath:r,isFloating:n}=this.state;this.setState({lowerBound:n?e:r.toFixed(e,0)},(()=>{const a=(0,O.head)(this.props.data).value[0],i=""===e||isNaN(e)?a:e,o=r.clamp(a,t[1],n?i:r.floor(i));this.setState((e=>({lowerBound:o.toString(),range:[o,e.range[1]]}))),this.handleOnChangeValue([o,t[1]])}))},this.onUpperBoundChanged=e=>{const{range:t,NumMath:r,isFloating:n}=this.state;this.setState({upperBound:n?e:r.toFixed(e,0)},(()=>{const a=(0,O.last)(this.props.data).value[1],i=""===e||isNaN(e)?a:e,o=r.clamp(t[0],a,n?i:r.ceil(i));this.setState((e=>({upperBound:o.toString(),range:[e.range[0],o]}))),this.handleOnChangeValue([t[0],o])}))},this.onChangeRange=e=>{const{isFloating:t,NumMath:r}=this.state,n=e.map((e=>t?e:r.toFixed(this.revertScale(e),0)));this.setState({range:n,lowerBound:n[0],upperBound:n[1]})},this.onRevertedChange=e=>{const{isFloating:t,NumMath:r}=this.state,n=e.map((e=>t?e:r.toFixed(this.revertScale(e),0)));this.handleOnChangeValue(n)},this.applyScale=e=>{const{isScaled:t,scale:r,rangeService:n}=this.state;return t?n.applyScale(e,r):e},this.revertScale=e=>{const{isScaled:t,scale:r,rangeService:n}=this.state;return t?n.revertScale(e,r):e},this.onFocus=e=>e.target.select()}static getDerivedStateFromProps(e,t){if(e.data!==t.data||e.values!==t.values){const{config:t,values:r,data:n}=e,a=t.attrType&&t.attrType.type,i="Long"===a,o=(0,Gl.C)(a),l=(0,ni.Oz)(a),s=o.getRange(r,n);return{range:s,data:n,values:r,lowerBound:s.length>0?s[0].toString():0,upperBound:s.length>0?s[1].toString():0,NumMath:l,rangeService:o,isScaled:i,isFloating:(0,v.isFloatingType)(a),scale:n.length>0?o.calcScale(...o.getBarDomain(n)):{ratio:1,offset:0}}}return null}render(){const{config:e,data:t,isHighlighted:r,isRecommended:n,onClose:a,numberFormat:i}=this.props,{isScaled:o,scale:l,range:s,lowerBound:c,upperBound:u,rangeService:p,isFloating:d}=this.state,m=o?p.bigNumbersTickFormatterX(p.formatNumberForRangeFacet,l):p.formatNumberForRangeFacet,f=t.map((e=>({value:e.value.map(this.applyScale),label:e.value.map(p.formatNumberForRangeFacet).join(" - "),number:e.number}))),y=s.map((e=>+this.applyScale(e))),[g,h]=p.getBarDomain(t).map((e=>this.applyScale(e)));return _p().createElement($g,{title:e.title,pathToTitle:e.pathToTitle,onClose:a,isHighlighted:r,isRecommended:n},_p().createElement("div",{className:"NumericRangeFacet-styles-data--kL9q5"},f.length>0?_p().createElement(_p().Fragment,null,_p().createElement("div",{className:"NumericRangeFacet-styles-barChartContainer--t9NkG","data-reltio-id":"search-bar-chart-with-selection"},_p().createElement(bh,{data:f,range:y,tickFormatterX:m,tickFormatterY:p.formatNumberForRangeFacet,domain:[g,h]})),_p().createElement(oh,{min:g,max:h,range:y,onAfterChange:this.onRevertedChange,onChange:this.onChangeRange,className:"NumericRangeFacet-styles-slider--XbmKe",valueLabelFormat:m,step:d?(h-g)/200:1}),_p().createElement("div",{className:"NumericRangeFacet-styles-inputsContainer--mU0_m"},_p().createElement(Qg.c,{value:c,onChange:this.onLowerBoundChanged,onFocus:this.onFocus,integer:!d,format:i,variant:"filled",classes:{root:Th},InputProps:{classes:{root:vh,input:Oh}}}),_p().createElement(Qg.c,{value:u,onChange:this.onUpperBoundChanged,onFocus:this.onFocus,integer:!d,format:i,variant:"filled",classes:{root:Th},InputProps:{classes:{root:vh,input:Oh}}}))):_p().createElement(Py.K,{variant:"noData"})))}}xh.propTypes={data:Np().array,values:Np().array,config:Np().object,isHighlighted:Np().bool,isRecommended:Np().bool,onClose:Np().func,onChange:Np().func,numberFormat:Np().shape({decimalSeparator:Np().string,thousandSeparator:Np().string,prefix:Np().string,suffix:Np().string,decimalScale:Np().number})},xh.defaultProps={config:{},data:[],values:[]};const Ch=(0,Pp.connect)((e=>({numberFormat:A().selectors.getUiNumberFormat(e)})))((e=>{const t=t=>{let{config:r,values:n,data:a,onChange:i,numberFormat:o}=t,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(t,["config","values","data","onChange","numberFormat"]);const s=(0,Pp.useSelector)(A().selectors.getAttributesPresentation),{strategy:c}=(0,v.getNumberFormat)((0,v.getAttrDataTypeDefinition)(r.attrType),s,v.intl.getLocale()),u=(0,Rp.useMemo)((()=>null==a?void 0:a.map((0,O.evolve)({value:(0,O.map)((0,v.applyPresentationStrategyToValue)(c))}))),[a,c]),p=(0,Rp.useMemo)((()=>null==n?void 0:n.map((0,v.mapFilterValue)((0,v.applyPresentationStrategyToValue)(c)))),[n,c]),d=(0,Rp.useCallback)((e=>{const t=null==e?void 0:e.map((0,v.mapFilterValue)((0,v.revertPresentationStrategyForValue)(c)));i(t)}),[c,i]);return _p().createElement(e,Sh({data:u,values:p,onChange:d,config:r,numberFormat:o&&(0,O.omit)(["strategy",o])},l))};return t.displayName="WithCustomizedData",t})(xh));var wh=r(21669);const Ah=(0,qp.Z)((()=>({container:{display:"flex",flexGrow:1,whiteSpace:"nowrap",cursor:"default",width:"100%"},dateEditor:{margin:0,width:"50%",whiteSpace:"normal","&:first-child":{marginRight:"4px"},"& .MuiInputAdornment-root":{paddingRight:0}}})));function Rh(){return Rh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Rh.apply(null,arguments)}const _h=(e,t)=>(0,O.pathOr)(null,[t],e),Ih=e=>e&&new Date(e),Nh=e=>e&&e.getTime(),Ph=({values:e,minDate:t,maxDate:r,onChange:n})=>{const[a,i]=(0,Rp.useState)(null),[o,l]=(0,Rp.useState)(null),s=(0,Rp.useRef)((0,Me.x0)()),c=(0,Rp.useRef)((0,Me.x0)()),u=Ah();_p().useEffect((()=>{i(_h(e,0)),l(_h(e,1))}),[e]);const p=(e,t)=>{(0,O.isNil)(e)||(0,O.isNil)(t)||n(e>t?[[t,e]]:[[e,t]])},d={minDate:Ih(t),maxDate:Ih(r)};return _p().createElement("div",{className:u.container},_p().createElement(wh.Q,Rh({label:li().text("Start Date"),value:Ih(a),onChange:e=>{const t=Nh(e);i(t),p(t,o)},slotProps:{textField:{id:s.current,className:u.dateEditor}}},d)),_p().createElement(wh.Q,Rh({label:li().text("End Date"),value:Ih(o),onChange:e=>{const t=Nh(e);l(t),p(a,t)},slotProps:{textField:{id:c.current,className:u.dateEditor},popper:{placement:"bottom-end"}}},d)))};function Dh(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const kh=e=>t=>e===v.DataTypes.TYPE_DATE?v.utils.dates.toLocalDate(t).getTime():t,Lh=(0,qp.Z)({barChartContainer:{position:"relative",height:"190px",paddingTop:"6px",width:"100%",overflow:"hidden"},dateRangeChooserWrapper:{display:"flex",flexDirection:"column",alignItems:"center",marginTop:"12px",width:"100%"}}),Uh=(0,Gl.C)(),jh=({data:e=[],values:t=[],config:r,onChange:n,isHighlighted:a,isRecommended:i,onClose:o})=>{const l=Lh(),s=(0,O.path)(["attrType","type"],r),c=(0,Rp.useCallback)((r=>{const a=r.map((0,v.mapFilterValue)((i=s,e=>i===v.DataTypes.TYPE_DATE?v.utils.dates.toUtcDate(e).getTime():e)));var i;if(!(0,O.equals)(t,a)){const[t,r]=Uh.getBarDomain(e),i=s===v.DataTypes.TYPE_DATE,o=a.map((e=>[v.utils.dates.getStartOfDay(e[0],i),v.utils.dates.getEndOfDay(e[1],i)])),l=Uh.getRange(o,e);n([l.length?l:[t,r]])}}),[e,n,s,t]),u=(0,Rp.useMemo)((()=>{return e.map((t=s,e=>{if(Array.isArray(e.value)){const r=e.value.map(kh(t));return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Dh(e,t,r[t])}))}return e}({},e,{value:r,label:r.map(v.formatDate).join(" - ")})}}));var t}),[e,s]),[p,d]=(0,Rp.useMemo)((()=>[Uh.getBarDomain(u),Uh.getRange(t.map((0,v.mapFilterValue)(kh(s))),u)]),[u,s,t]);return _p().createElement($g,{title:r.title,pathToTitle:r.pathToTitle,onClose:o,isHighlighted:a,isRecommended:i},e.length>0?_p().createElement(_p().Fragment,null,_p().createElement("div",{className:l.barChartContainer},_p().createElement(bh,{data:u,range:d,tickFormatterX:v.formatDate,tickFormatterY:Uh.formatNumberForRangeFacet,domain:p})),_p().createElement("div",{className:l.dateRangeChooserWrapper},_p().createElement(Ph,{values:d,onChange:c}))):_p().createElement(Py.K,{variant:"noData"}))};function Fh(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class Mh{static getWidget(e){switch(e.type){case v.FACET_TYPES.ENTITY_TYPE_FACET:return Yy;case v.FACET_TYPES.WITH_DROPDOWN_CHECKBOXES_FACET:return Xg;case v.FACET_TYPES.NUMERIC_RANGE_FACET:return Ch;case v.FACET_TYPES.DATE_RANGE_FACET:return jh;default:return null}}static build(e){const t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Fh(e,t,r[t])}))}return e}({},Mh.getDefaultConfig(),e),r=Mh.getWidget(t);return r?(e=>{const r=((e,t)=>{const r=r=>{let{dispatch:n}=r,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(r,["dispatch"]);return _p().createElement(e,Cy({config:t,onChange:(i=t.fieldName,e=>{n(Qa(i,e))}),onClose:t.showDeleteButton?(e=>()=>{n(ti({fieldNamesToDelete:[e]}))})(t.fieldName):()=>{},onSearch:(e=>({value:t,pageNumber:r,currentOptions:a})=>{n((({facetFieldName:e,value:t,debounceTime:r=0,pageNumber:n=1,currentOptions:a})=>({type:R.k.FILTER_FACET_DATA,payload:{facetFieldName:e,value:t,debounceTime:r,pageNumber:n,currentOptions:a}}))({facetFieldName:e,value:t,debounceTime:250,pageNumber:r,currentOptions:a}))})(t.fieldName)},a));var i};return r.propTypes={dispatch:Np().func,isRecommended:Np().bool},r})(e,t);return Mh.connectData(r,t)})(r):null}}Mh.getDefaultConfig=()=>({autofocus:!1,showDeleteButton:!0}),Mh.connectData=(e,t)=>(0,Pp.connect)((e=>({data:(0,C.X7)(t,e),values:(0,C.N1)(t,e),filteredData:(0,C.VP)(t,e),isHighlighted:(0,C.$t)(t.fieldName,e),isRecommended:(0,C.TH)(t.fieldName,e)})))(e);var Vh=r(64927),Bh=r.n(Vh),zh=r(73707),Hh=r.n(zh),Yh=r(93463),Wh=r.n(Yh);const Gh=(0,qp.Z)((()=>({tenantFacet:{flexShrink:0},radioGroup:{padding:"0 15px 10px 20px",overflow:"hidden"},radioLabelRoot:{overflow:"hidden"},radioLabel:{paddingLeft:"12px",fontSize:"13px",lineHeight:"16px",overflowWrap:"break-word",wordWrap:"break-word",overflow:"hidden"},radioButton:{padding:"0 9px"},tenantContainer:{display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%",marginBottom:"5px"},total:{color:"rgba(0,0,0,0.6)",fontSize:"13px",lineHeight:"16px"}})));var qh=r(44244);const Zh=({tenantObject:e,isDataTenant:t,className:r})=>{const n=(({tenantObject:e,isDataTenant:t})=>{const r=(0,qh._)(),[n,a]=(0,Rp.useState)(0),i=(0,Pp.useSelector)(A().selectors.getGlobalSearchRequestOptions),o=t?e:null,l=(0,Pp.useSelector)((e=>(0,ai.E2)(e,[],o))),s=JSON.stringify((0,Na.Vg)(l,[],i)),c=(0,Pp.useSelector)(A().selectors.getDtssPath),u=(0,Pp.useSelector)(A().selectors.getTenant);return(0,Rp.useEffect)((()=>{r((0,Na.Es)({url:B.jS,options:{method:"POST",body:s},customerTenant:u,dataTenant:(0,O.prop)("id",o),dtssPath:c})).then((({total:e})=>{a(e)})).catch((e=>{console.warn(e)}))}),[o,u,c,s]),n})({tenantObject:e,isDataTenant:t});return _p().createElement("div",{className:r},(0,ni.k7)(n))};Zh.propTypes={className:Np().string,tenantObject:Np().object.isRequired,isDataTenant:Np().bool};const $h=Zh;function Kh(){return Kh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Kh.apply(null,arguments)}const Xh={changeCurrentTenant:({tenantObject:e,isDataTenant:t})=>({type:_.Z.CHANGE_CURRENT_TENANT,payload:{tenantObject:e,isDataTenant:t}})},Qh=(0,Pp.connect)((e=>({dataTenants:A().selectors.getDataTenants(e),customerTenantObject:A().selectors.getTenantObject(e),currentTenant:(0,ai.RO)(e),openAdvancedSearch:(0,ki.IJ)(e)})),Xh)((({customerTenantObject:e,currentTenant:t,dataTenants:r,changeCurrentTenant:n,openAdvancedSearch:a})=>{const i=Gh(),o=(0,O.pipe)((0,O.map)((({id:e,label:t})=>({value:e,label:t}))),(0,O.prepend)({value:e.id,label:e.name}))(r),l=t=>{const n=t!==e.id;return{isDataTenant:n,tenantObject:n?r.find((0,O.propEq)("id",t)):e}},s=t||e.id;return _p().createElement("div",{className:i.tenantFacet},_p().createElement(ty,{title:li().text("Tenants"),hasCollapseButton:!1}),_p().createElement(Hh(),{className:i.radioGroup,value:s,onChange:(0,O.pipe)(Wp.NA,l,n)},o.map((({value:e,label:t})=>_p().createElement("div",{className:i.tenantContainer,key:e},_p().createElement(Wh(),{classes:{root:i.radioLabelRoot,label:i.radioLabel},value:e,label:t||e,control:_p().createElement(Bh(),{className:i.radioButton,color:"primary"})}),!a&&_p().createElement($h,Kh({className:i.total},l(e))))))))})),Jh=(0,qp.Z)({root:{display:"flex",flexShrink:0,flexDirection:"row",overflow:"hidden",alignItems:"center",marginBottom:"4px"},labelRoot:{fontSize:"13px",paddingLeft:"3px",cursor:"pointer",letterSpacing:"normal",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",marginRight:"16px"},checkboxRoot:{padding:"0",margin:"0 18px"},checkboxRootQueryGroups:{marginRight:9}}),eE=({variant:e="facetsPanel",searchOptions:t={},dispatch:r})=>{const{root:n,labelRoot:a,checkboxRoot:i,checkboxRootQueryGroups:o}=Jh(),l=t.searchByOv,s=(0,Rp.useCallback)((()=>{r(w.search.actions.updateSearchOptions({searchByOv:!l,ovOnly:!l}))}),[l,r]),c=li().text("Search by OV only");return _p().createElement("div",{className:n,onClick:s},_p().createElement(fd(),{classes:{root:kp()(i,{[o]:"queryGroups"===e})},checked:l,color:"primary"}),_p().createElement(_d.Y,{value:c},_p().createElement(zf(),{variant:"body2",classes:{root:a}},c)))};eE.propTypes={searchOptions:Np().shape({searchByOv:Np().bool,ovOnly:Np().bool}),variant:Np().oneOf(["facetsPanel","queryGroups"]),dispatch:Np().func};const tE=(0,Pp.connect)((e=>({searchOptions:A().selectors.getSearchOptions(e)})))(eE),rE=(0,qp.Z)({root:{display:"flex",flexDirection:"column",overflow:"auto",height:"100%"}});function nE(){return nE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},nE.apply(null,arguments)}const aE=(0,v.memoizeWith)((e=>e.fieldName),Mh.build),iE=({group:e,configs:t})=>_p().createElement(xy,nE({},e,{key:e.title}),(e=>e.map((e=>({Facet:aE(e),id:e.fieldName}))).filter((({Facet:e})=>e)).map((({Facet:e,id:t})=>_p().createElement(e,{key:t}))))(t)),oE=(0,Pp.connect)((e=>{const t=A().selectors.getDataTenants(e);return{metadata:A().selectors.getMetadata(e),facetsConfigs:(0,C.Mp)(e),uiConfigShowSearchByOv:A().selectors.getShowSearchByOv(e)??(0,ki.cC)(e),showTenantFacet:t&&t.length>0,tenant:A().selectors.getTenant(e)}}))((({facetsConfigs:e=[],metadata:t,onScroll:r,uiConfigShowSearchByOv:n,showTenantFacet:a})=>{const{root:i}=rE(),o=(0,Rp.useRef)(null),l=(0,Rp.useCallback)((e=>{r(o.current.scrollTop,e)}),[r]),s=((e,t)=>{const[r,n]=(0,O.partition)(v.isTypeFacet,t),a=[{group:{title:li().text("Entity types"),hasCollapseButton:!1},configs:r},{group:{title:li().text("Attributes"),hasCollapseButton:!1,hasSearchAttributesField:!0},configs:n}];return Jf(a)})(0,e),c=(0,O.head)(s),u=(0,O.tail)(s),p=o.current,d=(0,Rp.useMemo)((()=>({element:p,priority:["top","bottom"]})),[p]);return _p().createElement("div",{ref:o,className:i,onScroll:l},_p().createElement(Xf.p.Provider,{value:d},n&&_p().createElement(tE,null),a&&_p().createElement(_p().Fragment,null,_p().createElement(Qh,null),_p().createElement(Kf(),null)),c&&iE(c),_p().createElement(Kf(),null),u.map(((e,t)=>_p().createElement(iE,nE({},e,{key:t}))))))})),lE=({children:e,className:t})=>_p().createElement("div",{className:kp()("MainContent-styles-mainContent--Ha5me",t)},e);lE.propTypes={children:Np().node,className:Np().string};const sE=lE;var cE=r(33788);const uE=(0,qp.Z)({container:{backgroundColor:"#fff",opacity:.37,position:"fixed",width:"100%",height:"100%",top:0,left:0,display:"flex",justifyContent:"center",alignItems:"center"}}),pE=()=>{const e=(0,Pp.useSelector)(ki.Kv),{container:t}=uE();return e?_p().createElement("div",{className:t},_p().createElement(cE.Z,{size:160})):null};var dE=r(54596),mE=r.n(dE),fE=r(49233),yE=r.n(fE),gE=r(35206),hE=r.n(gE),EE=r(81733),bE=r.n(EE),vE=r(68290),TE=r.n(vE);const OE=(0,qp.Z)((e=>({snackbar:{display:"flex",flexWrap:"nowrap",backgroundColor:"rgba(0,0,0,0.87)",boxShadow:"0 2px 4px 0 rgba(0,0,0,0.25)",padding:"8px 16px",minHeight:"48px","&:after":{content:'""',minHeight:"inherit",fontSize:0}},anchorSnackBar:{zIndex:11e3,"@media (min-width: 960px)":{bottom:8}},message:{color:"#FFFFFF",fontSize:14,fontWeight:500,lineHeight:"16px",display:"flex",alignItems:"center",flex:1},messageContent:{display:"flex",alignItems:"center",whiteSpace:"pre"},icon:{opacity:.9,marginRight:"12px"},[B.GT.error]:{backgroundColor:e.palette.error.dark}})));function SE(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const xE=()=>{const e=(0,Pp.useDispatch)(),t=(0,Pp.useSelector)(ki.v6),r=(0,Pp.useSelector)(A().selectors.getAutoCloseInterval),n=t&&t.payload.autoHideDuration||r&&1e3*r||5e3,a=OE(),i=(0,Rp.useRef)(null),o=(0,Rp.useCallback)((()=>{e(wi())}),[e]);t&&(i.current=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){SE(e,t,r[t])}))}return e}({},t));const{type:l,payload:s}=i.current||{},{message:c,action:u}=s||{},p=u&&u.actionToDispatch,d=(0,Rp.useCallback)((()=>{p&&e(p)}),[p,e]),m=(0,Rp.useMemo)((()=>l===B.GT.error?_p().createElement(yE(),{key:"close","aria-label":"Close",color:"inherit",className:a.close,onClick:d,size:"large"},_p().createElement(zp(),null)):u?_p().createElement(hE(),{color:"primary",size:"small",onClick:d},u.actionLabel):null),[a,l,u,d]);return _p().createElement(bE(),{container:document.body},_p().createElement(mE(),{key:c+l,anchorOrigin:{vertical:"bottom",horizontal:"center"},autoHideDuration:n,open:Boolean(t),onClose:o,ContentProps:{classes:{root:kp()(a.snackbar,a[l]),message:a.message}},message:_p().createElement("div",{className:a.messageContent},l===B.GT.error&&_p().createElement(TE(),{className:a.icon}),c),classes:{anchorOriginBottomCenter:a.anchorSnackBar},action:m}))},CE=(0,qp.Z)((()=>({resizablePanesWrapper:{flex:"1 0 0px"},pane:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",flexDirection:"column",overflow:"hidden"},divider:{height:"1px"}})));var wE=r(95641);const AE=(0,qp.Z)((()=>({container:{position:"relative"},panel:{position:"relative"},horizontal:{},vertical:{},disabled:{},resizer:{zIndex:1,boxSizing:"border-box",backgroundClip:"padding-box","&$disabled":{cursor:"initial",height:0,margin:0},"&$horizontal":{height:"11px",backgroundImage:"linear-gradient(rgba(0,0,0,0.33), rgba(0,0,0,0.33))",backgroundRepeat:"no-repeat",backgroundSize:"100% 1px",backgroundPosition:"top",width:"100%",marginBottom:"-10px","&$disabled":{background:"transparent"},"&:not($disabled):hover":{cursor:"ns-resize",backgroundImage:"linear-gradient(rgba(0, 114, 206, 0), rgba(0, 114, 206, 0.35), rgba(0, 114, 206, 1))",backgroundSize:"100% 3px"}},"&$vertical":{width:"11px",backgroundImage:"linear-gradient(rgba(0,0,0,0.33), rgba(0,0,0,0.33))",backgroundRepeat:"no-repeat",backgroundSize:"1px 100%",backgroundPosition:"left",height:"100%",marginRight:"-10px","&$disabled":{background:"transparent"},"&:not($disabled):hover":{cursor:"ew-resize",backgroundImage:"linear-gradient(to left, rgba(0, 114, 206, 0.35), rgba(0, 114, 206, 1), rgba(0, 114, 206, 0.35))",backgroundSize:"3px 100%"}}}})));function RE(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){_E(e,t,r[t])}))}return e}function _E(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const IE=e=>"horizontal"===e,NE=(e,t)=>e.toFixed(2)===t.toFixed(2),PE=({className:e,children:t,orientation:r="vertical",primary:n="first",size:a,minSize:i,maxSize:o,allowResize:l,debounceInterval:s=250,onChange:c})=>{const u=AE(),p=(0,$m.useTheme)(),d=(0,Rp.useRef)(),[m,f]=(0,Rp.useState)(null),[y,g]=(0,Rp.useState)(0),[h,E]=(0,Rp.useState)(0),[b,T]=(0,Rp.useState)(!0),O=(0,Rp.useCallback)((()=>T(!0)),[]),S=(0,Rp.useCallback)((()=>T(!1)),[]),x=(0,Rp.useCallback)((()=>IE(r)?null==m?void 0:m.clientHeight:null==m?void 0:m.clientWidth),[m,r]);"number"==typeof a&&a<0&&(a=(x()||0)+a);const C=(0,Rp.useCallback)((e=>"string"==typeof e&&e.endsWith("%")?+e.replace("%",""):("string"==typeof e&&e.endsWith("px")&&(e=e.replace("px","")),isNaN(+e)?null:+e/x()*100)),[x]),w=(0,Rp.useCallback)(((e,t)=>0===e||100===e?0:C(t)||0),[C]),A=(0,Rp.useCallback)((()=>{if(m&&d.current){const e=C(a);null==e||isNaN(e)||(E(w(e,o)),g(w(e,i)),d.current.resize(e))}}),[C,w,i,o,a,m]);(0,Rp.useEffect)((()=>{A()}),[A,h,y]);const R=(0,Rp.useCallback)((0,v.debounce)((e=>{if(void 0===e)return;const t=x();c({percentageSize:e+"%",isMaxSize:NE(e,+h>0?h:100+h),isMinSize:NE(e,y),size:Math.round(e*t/100)})}),s),[c,h,y,x]),_=(0,Rp.useCallback)((e=>{e?(R(),S()):(R(d.current.getSize()),O())}),[S,O,R]),I=(0,Rp.useMemo)((()=>({transition:p.transitions.create("flex",{easing:p.transitions.easing.sharp,duration:p.transitions.duration.leavingScreen})})),[p]),N=RE({className:u.panel,minSize:y},h>0?{maxSize:h}:{},{ref:d,style:b?I:void 0}),P=RE({className:u.panel,style:b?I:void 0},h<0?{minSize:-h}:{});return _p().createElement("div",{ref:f,className:kp()(u.container,e)},_p().createElement(ld.ZP,{handleHeight:IE(r),handleWidth:!IE(r),onResize:A,refreshMode:"debounce",refreshRate:50}),_p().createElement(wE.eh,{direction:IE(r)?"vertical":"horizontal"},_p().createElement(wE.s_,"first"===n?N:P,t[0]),_p().createElement(wE.OT,{className:kp()(u.resizer,u[r],{[u.disabled]:!l}),disabled:!l,hitAreaMargins:{coarse:0,fine:0},onDragging:_}),_p().createElement(wE.s_,"second"===n?N:P,t[1])))};PE.displayName="ResizablePanes";const DE=(0,qp.Z)({"entityType-overflow":{textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},"entityType-small":{padding:"1px 4px",fontSize:"10px",lineHeight:"normal",marginRight:"12px",borderRadius:"2px",flexShrink:0},"entityType-medium":{padding:"2px 7px",borderRadius:"2px",fontSize:"13px",fontWeight:500,lineHeight:"16px",marginRight:"16px",flexShrink:0}}),kE=({entity:e,className:t,size:r="small"})=>{const n=DE(),a=(0,ly.AH)(),i=(0,v.getEntityType)(a,e.type),o=(i?(0,v.getPropWithInheritance)(a,i,"typeColor"):null)||v.theme.palette.primary.main,l=(0,v.getEntityTypeLabel)(a,e);return _p().createElement(_d.Y,{value:l,placement:"top"},_p().createElement(zf(),{style:{backgroundColor:o,color:v.utils.Colors.getColor(o)?"#FFFFFF":"#212121"},className:kp()(n[`entityType-${r}`],n["entityType-overflow"],t),component:"div"},l))},LE=e=>e&&e.scrollIntoView({block:"end",behavior:"smooth"}),UE=e=>{e&&clearTimeout(e)},jE=(e,t)=>{if(e&&t){const r=e.offsetTop,n=e.offsetTop+e.clientHeight,{clientHeight:a,scrollTop:i}=t;return r>=0&&n>i&&n<i+a}};var FE=r(600);const ME=(0,qp.Z)((e=>({"@keyframes animate":{from:{background:"transparent"},"66%":{background:"#f2e68e"},"100%":{background:"transparent"}},highlighted:{animationName:"$animate",animationDuration:"3s",animationIterationCount:1},item:{display:"flex",minHeight:"40px",borderBottom:"1px solid rgba(0, 0, 0, 0.1)",flexDirection:"row","&:after":{content:"",minHeight:"inherit",fontSize:0},"&:hover":{backgroundColor:"rgba(0, 0, 0, 0.03)"}},clickable:{cursor:"pointer"},selected:{background:(0,$m.alpha)(e.palette.primary.main,.12),"&:hover":{background:(0,$m.alpha)(e.palette.primary.main,.24)}},inactive:{background:e.inactiveBackground,"&:hover":{background:e.inactiveHoverBackground},"&$selected":{background:e.inactiveSelectedBackground,"&:hover":{background:e.inactiveSelectedHoverBackground}}},justImported:{backgroundColor:"#FFFBEB !important"},avatar:{marginLeft:"20px"},image:{height:"32px",width:"32px",marginTop:"8px",marginBottom:"7px"},info:{marginLeft:"20px",flexGrow:1,display:"flex",flexDirection:"column",justifyContent:"center",fontSize:"13px",width:"100%",overflow:"hidden",overflowWrap:"break-word",wordWrap:"break-word"},label:{fontSize:"13px",lineHeight:"15px",fontWeight:500,color:e.palette.primary.main,marginRight:"17px",textDecoration:"none"},secondaryLabel:{marginRight:"12px"},businessCard:{color:"rgba(0, 0, 0, 0.54)"},secondRow:{display:"flex",marginTop:"2px",alignItems:"center",color:"rgba(0, 0, 0, 0.54)",fontSize:"12px"}}))),VE=({entities:e,entityToHighlight:t,selectedEntityUri:r,onEntityClick:n,onEntityHover:a,entitiesImportStatus:i,entityButtonsRenderer:o})=>{const l=ME(),s=(0,Rp.useRef)(null),c=(0,Rp.useRef)(null),u=(0,ly.AH)();return(0,FE.D)((()=>{if(t){var e;const n=null===(e=s.current)||void 0===e?void 0:e.querySelectorAll(`[data-entity-uri='${t}']`);if(UE(c.current),(null==n?void 0:n.length)>0){var r;const e=null===(r=s.current)||void 0===r?void 0:r.parentElement;jE(n[0],e)||(LE(n[0]),c.current=setTimeout((()=>{jE(n[0],e)||LE(n[0])}),1e3))}}return()=>{UE(c.current)}}),[t]),_p().createElement("div",{ref:s},(e||[]).map((e=>{const s=(0,v.getLabel)(e.label),c=e.secondaryLabel,p=(0,v.getBusinessCardAttributesText)(u,e),d=(0,v.isActiveObject)(e),m=e.uri,f=(0,v.getEntityUriForLink)(e),y=(0,O.prop)(m,i);return _p().createElement("div",{key:m,className:kp()(l.item,{[l.clickable]:!!n,[l.selected]:m===r,[l.highlighted]:m===t,[l.inactive]:!d,[l.justImported]:y===Dm.Eh.Success}),onClick:n?()=>n(m):void 0,onMouseEnter:a?()=>a(m):void 0,onMouseLeave:a?()=>a(null):void 0,"data-entity-uri":m},_p().createElement(b.A,{entity:e,avatarClassName:l.avatar,imageClassName:l.image}),_p().createElement("div",{className:l.info},_p().createElement("div",null,_p().createElement(om.x,{value:f,className:l.label},s),c&&_p().createElement("span",{className:l.secondaryLabel},c," "),p&&_p().createElement("span",{className:l.businessCard},p)),_p().createElement("div",{className:l.secondRow},_p().createElement(kE,{entity:e}),_p().createElement("div",null,(0,v.getEntityId)(e)))),o&&o(e))})))};var BE=r(92255);function zE(){return zE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},zE.apply(null,arguments)}function HE(){return HE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},HE.apply(null,arguments)}function YE(){return YE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},YE.apply(null,arguments)}function WE(){return WE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},WE.apply(null,arguments)}const GE=(0,qp.Z)((e=>({root:{display:"flex",flex:"1 1 auto",flexWrap:"nowrap",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"10px",overflow:"auto",height:"100%",minHeight:"350px",boxSizing:"border-box","&$root_small":{minHeight:"160px"},"& $text":{color:e.palette.text.primary,fontSize:"20px",fontWeight:500,lineHeight:"24px",letterSpacing:"0.25px",textAlign:"center"},"& $secondaryText":{color:e.palette.text.secondary,fontSize:"15px",fontWeight:300,lineHeight:"18px",letterSpacing:"0.11px",textAlign:"center",paddingTop:"3px"}},root_small:{},small:{width:"88px",height:"88px"},embedded:{flexShrink:0,width:"190px",height:"190px",padding:"8px"},full:{width:"256px",height:"256px"},textBox:{display:"flex",flexDirection:"column",alignItems:"center",maxWidth:500,marginTop:"16px"},text:{},secondaryText:{},button:{minHeight:36,minWidth:64,maxWidth:500,padding:"10px 16px",borderRadius:"2px",boxShadow:"0 0 2px 0 rgba(0,0,0,0.12), 0 2px 2px 0 rgba(0,0,0,0.24), 0 0 8px 0 rgba(0,0,0,0.12), 0 8px 8px 0 rgba(0,0,0,0.24)",fontSize:"14px",fontWeight:500,lineHeight:"16px",marginTop:"24px"}})));function qE(){return qE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},qE.apply(null,arguments)}let ZE=function(e){return e.full="full",e.embedded="embedded",e.small="small",e}({});const $E={SEARCH_RESULTS:e=>_p().createElement("svg",zE({width:256,height:256,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","data-reltio-id":"SvgEmptySearchResults"},e),_p().createElement("defs",null,_p().createElement("radialGradient",{cx:"50%",cy:"100%",fx:"50%",fy:"100%",r:"81.681%",gradientTransform:"matrix(.98998 0 0 .612 .005 .388)",id:"EmptySearchResults_svg__c"},_p().createElement("stop",{stopColor:"#00BFFF",stopOpacity:.5,offset:"0%"}),_p().createElement("stop",{stopColor:"#9EE8FF",stopOpacity:0,offset:"100%"})),_p().createElement("radialGradient",{cx:"50%",cy:"111.651%",fx:"50%",fy:"111.651%",r:"87.693%",gradientTransform:"matrix(0 -.97693 .7263 0 -.31 1.605)",id:"EmptySearchResults_svg__f"},_p().createElement("stop",{stopColor:"#91F8E5",stopOpacity:.6,offset:"0%"}),_p().createElement("stop",{stopColor:"#14F7FF",stopOpacity:0,offset:"100%"})),_p().createElement("radialGradient",{cx:"50%",cy:"103.659%",fx:"50%",fy:"103.659%",r:"90.207%",gradientTransform:"matrix(0 -1 2.23905 0 -1.821 1.537)",id:"EmptySearchResults_svg__g"},_p().createElement("stop",{stopColor:"#FFF",offset:"0%"}),_p().createElement("stop",{stopColor:"#73FAFF",stopOpacity:.21,offset:"59.38%"}),_p().createElement("stop",{stopColor:"#14F7FF",stopOpacity:0,offset:"100%"})),_p().createElement("linearGradient",{x1:"50%",y1:"170.771%",x2:"50%",y2:"10.303%",id:"EmptySearchResults_svg__e"},_p().createElement("stop",{stopColor:"#91F8E5",offset:"0%"}),_p().createElement("stop",{stopColor:"#99FCFF",stopOpacity:0,offset:"100%"})),_p().createElement("filter",{x:"-25.9%",y:"-26.2%",width:"151.8%",height:"152.3%",filterUnits:"objectBoundingBox",id:"EmptySearchResults_svg__d"},_p().createElement("feGaussianBlur",{stdDeviation:15,in:"SourceGraphic"})),_p().createElement("circle",{id:"EmptySearchResults_svg__a",cx:128,cy:128,r:128})),_p().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},_p().createElement("mask",{id:"EmptySearchResults_svg__b",fill:"#fff"},_p().createElement("use",{xlinkHref:"#EmptySearchResults_svg__a"})),_p().createElement("use",{fillOpacity:.2,fill:"#A792CD",xlinkHref:"#EmptySearchResults_svg__a"}),_p().createElement("g",{mask:"url(#EmptySearchResults_svg__b)"},_p().createElement("g",{transform:"translate(56 34)"},_p().createElement("g",{opacity:.9,strokeWidth:1,fill:"#FFF"},_p().createElement("path",{d:"M0 6.99C0 3.13 3.137 0 7 0h247.067c3.866 0 7 3.144 7 6.99v169.353c0 3.86-3.137 6.99-7 6.99H7c-3.866 0-7-3.143-7-6.99V6.99z"}),_p().createElement("path",{d:"M13 25.99c0-3.86 3.137-6.99 7-6.99h247.067c3.866 0 7 3.144 7 6.99v169.353c0 3.86-3.137 6.99-7 6.99H20c-3.866 0-7-3.143-7-6.99V25.99z",opacity:.4})),_p().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(21.756 45.833)"},_p().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:213.204,cy:5.456,rx:4.351,ry:4.365}),_p().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:197.976,cy:5.456,rx:4.351,ry:4.365}),_p().createElement("path",{d:"M10.334 1.091c5.707 0 10.334 4.627 10.334 10.334v.067c0 5.707-4.627 10.333-10.334 10.333S0 17.2 0 11.492v-.067C0 5.718 4.627 1.091 10.334 1.091z",fill:"#E3EBF4"}),_p().createElement("path",{d:"M35.365.861h69.768a3.82 3.82 0 010 7.639H35.365a3.82 3.82 0 010-7.639z",fill:"#B1AABD",opacity:.5}),_p().createElement("path",{d:"M34.274 15.048h126.164a2.728 2.728 0 010 5.456H34.274a2.728 2.728 0 110-5.456z",fill:"#B1AABD",opacity:.43}),_p().createElement("path",{d:"M33.182 24.869H73.89a1.637 1.637 0 110 3.274H33.182a1.637 1.637 0 010-3.274z",fill:"#B1AABD",opacity:.2})),_p().createElement("rect",{fill:"#645F6D",opacity:.5,x:21.756,y:17.46,width:87.022,height:12.004,rx:6.002}),_p().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(21.756 87.302)"},_p().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:213.204,cy:5.456,rx:4.351,ry:4.365}),_p().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:197.976,cy:5.456,rx:4.351,ry:4.365}),_p().createElement("rect",{fill:"#E3EBF4",x:0,y:1.091,width:20.668,height:20.734,rx:10.334}),_p().createElement("path",{d:"M35.365.861h82.647a3.82 3.82 0 010 7.639H35.365a3.82 3.82 0 010-7.639z",fill:"#B1AABD",opacity:.5}),_p().createElement("path",{d:"M34.274 15.048H174.58a2.728 2.728 0 010 5.456H34.274a2.728 2.728 0 110-5.456z",fill:"#B1AABD",opacity:.43}),_p().createElement("path",{d:"M33.182 24.869h113.119a1.637 1.637 0 110 3.274H33.182a1.637 1.637 0 010-3.274z",fill:"#B1AABD",opacity:.2})),_p().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(21.756 128.77)"},_p().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:213.204,cy:5.456,rx:4.351,ry:4.365}),_p().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:197.976,cy:5.456,rx:4.351,ry:4.365}),_p().createElement("path",{d:"M10.334 1.091c5.707 0 10.334 4.627 10.334 10.334v.067c0 5.707-4.627 10.333-10.334 10.333S0 17.2 0 11.492v-.067C0 5.718 4.627 1.091 10.334 1.091z",fill:"#E3EBF4"}),_p().createElement("path",{d:"M35.365.861h110.929a3.82 3.82 0 010 7.639H35.365a3.82 3.82 0 010-7.639z",fill:"#B1AABD",opacity:.5}),_p().createElement("path",{d:"M34.274 15.048h92.443a2.728 2.728 0 010 5.456H34.274a2.728 2.728 0 110-5.456z",fill:"#B1AABD",opacity:.43}),_p().createElement("path",{d:"M33.182 24.869H73.89a1.637 1.637 0 110 3.274H33.182a1.637 1.637 0 010-3.274z",fill:"#B1AABD",opacity:.2})))),_p().createElement("g",{mask:"url(#EmptySearchResults_svg__b)"},_p().createElement("path",{fill:"#446275",d:"M72.246 84.033l8.66 5-35.5 61.488-8.66-5-12.556-24.729-51.307-29.622 20.431-35.388 50.648 29.242z"}),_p().createElement("path",{d:"M62.906 120.21l-80.091-46.24 10.5-18.188 50.647 29.242 28.284-.99 8.66 5-18 31.176z",fillOpacity:.2,fill:"#FFF"}),_p().createElement("path",{d:"M27.566 75.558L3.877 109.065l-5.013-2.895 26.045-32.146 2.657 1.534zm9.467 5.466L13.345 114.53l-5.014-2.895L34.377 79.49l2.656 1.534zm8.158 4.71l-22.32 34.297-5.013-2.895L43.903 84.99l1.288.744z",fill:"#527585"}),_p().createElement("path",{d:"M11.524 90.544l13.385-16.52 2.657 1.534-12.174 17.22-3.868-2.234zm9.467 5.467L34.377 79.49l2.656 1.534-12.174 17.22-3.868-2.233zm9.527 5.5L43.903 84.99l1.288.744-11.47 17.626-3.203-1.85z",fill:"#76A2B5",opacity:.6}),_p().createElement("path",{d:"M.355 59.848l-23.689 33.507-5.013-2.895 26.045-32.146 2.657 1.534zm9.468 5.466L-13.866 98.82l-5.013-2.895L7.166 63.78l2.657 1.534zm8.158 4.71L-4.34 104.32l-5.014-2.895L16.692 69.28l1.289.744z",fillOpacity:.1,fill:"#000"}),_p().createElement("g",null,_p().createElement("path",{fill:"url(#EmptySearchResults_svg__c)",opacity:.993,filter:"url(#EmptySearchResults_svg__d)",d:"M.63 0h173.74L123 172H52z",transform:"rotate(120 90.404 138.861)"}),_p().createElement("path",{fill:"url(#EmptySearchResults_svg__e)",opacity:.3,d:"M4 9h166.37L120.73 172.299H53.64z",transform:"rotate(120 90.404 138.861)"}),_p().createElement("path",{fill:"url(#EmptySearchResults_svg__f)",opacity:.3,d:"M4 2h166.37L120.73 172.299H53.64z",transform:"rotate(120 90.404 138.861)"}),_p().createElement("path",{fill:"url(#EmptySearchResults_svg__g)",d:"M4 9h166.37L120.73 172.299H53.64z",transform:"rotate(120 90.404 138.861)"}),_p().createElement("path",{fill:"#FFF",opacity:.196,d:"M212.363 205.344l-1 1.732L60.418 124.52l4.977-8.62z"})),_p().createElement("path",{fill:"#76A2B5",d:"M73.112 84.533l-35.5 61.488-.866-.5 35.5-61.488z"}),_p().createElement("path",{fill:"#F3F3F3",d:"M80.906 89.033l-35.5 61.488-.866-.5 35.5-61.488z"}),_p().createElement("path",{fill:"#538196",d:"M55.112 115.71l-17.5 30.311-.866-.5 17.5-30.31z"})))),SELECT_ATTRIBUTES:e=>_p().createElement("svg",HE({width:256,height:256,viewBox:"0 0 256 256",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgSelectAttributes"},e),_p().createElement("circle",{cx:128,cy:128,r:128,fill:"#0072CE",fillOpacity:.1}),_p().createElement("mask",{id:"SelectAttributes_svg__a",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:256,height:256},_p().createElement("circle",{cx:128,cy:128,r:128,fill:"#fff"})),_p().createElement("g",{mask:"url(#SelectAttributes_svg__a)"},_p().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M-16 9h256v247H-16V9z",fill:"url(#SelectAttributes_svg__paint0_linear_0_19219)"}),_p().createElement("path",{opacity:.05,fillRule:"evenodd",clipRule:"evenodd",d:"M187.761 56.865l58.639 58.639v148.871H93.383L52 225.083V56.865h135.761z",fill:"url(#SelectAttributes_svg__paint1_linear_0_19219)"}),_p().createElement("path",{opacity:.06,fillRule:"evenodd",clipRule:"evenodd",d:"M47 58h202a7 7 0 017 7v157a7 7 0 01-7 7H47a7 7 0 01-7-7V65a7 7 0 017-7z",fill:"#000"}),_p().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M50 56h201a5 5 0 015 5v157a5 5 0 01-5 5H50a5 5 0 01-5-5V61a5 5 0 015-5z",fill:"#fff"}),_p().createElement("path",{opacity:.8,fillRule:"evenodd",clipRule:"evenodd",d:"M105.376 72.635a3 3 0 013-3H150a3 3 0 110 6h-41.624a3 3 0 01-3-3z",fill:"#B6C7DB"}),_p().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M105 84.635a3 3 0 013-3h64.205a3 3 0 110 6H108a3 3 0 01-3-3z",fill:"#979797"}),_p().createElement("path",{opacity:.8,fillRule:"evenodd",clipRule:"evenodd",d:"M105.376 163a3 3 0 013-3H150a3 3 0 110 6h-41.624a3 3 0 01-3-3z",fill:"#B6C7DB"}),_p().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M105 175a3 3 0 013-3h64.205a3 3 0 110 6H108a3 3 0 01-3-3z",fill:"#979797"}),_p().createElement("path",{opacity:.8,fillRule:"evenodd",clipRule:"evenodd",d:"M105.376 193a3 3 0 013-3H190a3 3 0 110 6h-81.624a3 3 0 01-3-3z",fill:"#B6C7DB"}),_p().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M105 205a3 3 0 013-3h74.205a3 3 0 110 6H108a3 3 0 01-3-3z",fill:"#979797"}),_p().createElement("path",{opacity:.8,fillRule:"evenodd",clipRule:"evenodd",d:"M138.376 103a3 3 0 013-3H223a3 3 0 110 6h-81.624a3 3 0 01-3-3z",fill:"#B6C7DB"}),_p().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M138 115a3 3 0 013-3h64.205a3 3 0 110 6H141a3 3 0 01-3-3z",fill:"#979797"}),_p().createElement("circle",{cx:67,cy:79,r:9,fill:"#B6C7DB"}),_p().createElement("circle",{cx:67,cy:79,r:9,fill:"#B6C7DB"}),_p().createElement("circle",{cx:120,cy:106,r:6,fill:"#B6C7DB"}),_p().createElement("circle",{cx:120,cy:136,r:6,fill:"#B6C7DB"}),_p().createElement("circle",{cx:67,cy:169,r:9,fill:"#B6C7DB"}),_p().createElement("circle",{cx:67,cy:199,r:9,fill:"#B6C7DB"}),_p().createElement("path",{opacity:.8,fillRule:"evenodd",clipRule:"evenodd",d:"M138.376 133a3 3 0 013-3H223a3 3 0 110 6h-81.624a3 3 0 01-3-3z",fill:"#B6C7DB"}),_p().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M138 145a3 3 0 013-3h74.205a3 3 0 110 6H141a3 3 0 01-3-3z",fill:"#979797"}),_p().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M92.514 108v-8h-2V140.365h11.178v-2h-9.178V110h9.178v-2h-9.178z",fill:"#2B98F0"}),_p().createElement("path",{opacity:.54,fillRule:"evenodd",clipRule:"evenodd",d:"M95.071 77l-3.535 3.535L88 77h7.071z",fill:"#000"}),_p().createElement("path",{opacity:.6,fillRule:"evenodd",clipRule:"evenodd",d:"M50 22h186a6 6 0 016 6v18a6 6 0 01-6 6H50a6 6 0 01-6-6V28a6 6 0 016-6z",fill:"#fff"}),_p().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M58 37a6 6 0 016-6h70a6 6 0 110 12H64a6 6 0 01-6-6zM148 37a6 6 0 016-6h10a6 6 0 110 12h-10a6 6 0 01-6-6z",fill:"#979797"})),_p().createElement("defs",null,_p().createElement("linearGradient",{id:"SelectAttributes_svg__paint0_linear_0_19219",x1:-16,y1:9,x2:-16,y2:256,gradientUnits:"userSpaceOnUse"},_p().createElement("stop",{stopColor:"#FAFAFA",stopOpacity:.01}),_p().createElement("stop",{offset:1,stopColor:"#F4F4F4"})),_p().createElement("linearGradient",{id:"SelectAttributes_svg__paint1_linear_0_19219",x1:266.117,y1:181.111,x2:154.882,y2:77.681,gradientUnits:"userSpaceOnUse"},_p().createElement("stop",{stopOpacity:.01}),_p().createElement("stop",{offset:1})))),NO_DATA:e=>_p().createElement("svg",YE({width:256,height:256,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","data-reltio-id":"SvgNoData"},e),_p().createElement("defs",null,_p().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"NoData_svg__b"},_p().createElement("stop",{stopColor:"#FAFAFA",stopOpacity:0,offset:"0%"}),_p().createElement("stop",{stopColor:"#F4F4F4",offset:"100%"})),_p().createElement("linearGradient",{x1:"69.573%",y1:"86.747%",x2:"38.144%",y2:"33.403%",id:"NoData_svg__d"},_p().createElement("stop",{stopColor:"#000",stopOpacity:0,offset:"0%"}),_p().createElement("stop",{stopColor:"#000",offset:"100%"})),_p().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"NoData_svg__e"},_p().createElement("stop",{stopColor:"#EEFBFF",offset:"0%"}),_p().createElement("stop",{stopColor:"#0072CE",offset:"100%"})),_p().createElement("filter",{x:"-7.7%",y:"-7.5%",width:"115.3%",height:"115%",filterUnits:"objectBoundingBox",id:"NoData_svg__f"},_p().createElement("feOffset",{dx:0,dy:2,in:"SourceAlpha",result:"shadowOffsetOuter1"}),_p().createElement("feGaussianBlur",{stdDeviation:2,in:"shadowOffsetOuter1",result:"shadowBlurOuter1"}),_p().createElement("feColorMatrix",{values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0",type:"matrix",in:"shadowBlurOuter1",result:"shadowMatrixOuter1"}),_p().createElement("feMerge",null,_p().createElement("feMergeNode",{in:"shadowMatrixOuter1"}),_p().createElement("feMergeNode",{in:"SourceGraphic"}))),_p().createElement("circle",{id:"NoData_svg__a",cx:128,cy:128,r:128})),_p().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},_p().createElement("mask",{id:"NoData_svg__c",fill:"#fff"},_p().createElement("use",{xlinkHref:"#NoData_svg__a"})),_p().createElement("use",{fillOpacity:.1,fill:"#0072CE",xlinkHref:"#NoData_svg__a"}),_p().createElement("path",{fill:"url(#NoData_svg__b)",mask:"url(#NoData_svg__c)",d:"M0 9h256v247H0z"}),_p().createElement("g",{mask:"url(#NoData_svg__c)"},_p().createElement("g",{transform:"translate(29 37)"},_p().createElement("g",{opacity:.9,strokeWidth:1,fill:"#FFF"},_p().createElement("path",{fillOpacity:.8,opacity:.5,d:"M14.565 8h228.144v176.476H14.565z"}),_p().createElement("path",{d:"M0 8.01C0 3.586 3.576 0 7.997 0h223.838a7.997 7.997 0 017.997 8.01v152.401c0 4.424-3.577 8.01-7.997 8.01H7.997A7.997 7.997 0 010 160.411V8.01z"})),_p().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(19.986 42.105)"},_p().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:195.862,cy:5.013,rx:3.997,ry:4.01}),_p().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:181.872,cy:5.013,rx:3.997,ry:4.01}),_p().createElement("path",{d:"M9.493 1.003a9.493 9.493 0 019.494 9.493v.06a9.493 9.493 0 01-18.987 0v-.06a9.493 9.493 0 019.493-9.493z",fill:"#E3EBF4"}),_p().createElement("path",{d:"M32.488.791h64.093a3.509 3.509 0 110 7.018H32.488a3.509 3.509 0 110-7.018z",fill:"#B1AABD",opacity:.5}),_p().createElement("path",{d:"M31.486 13.824h115.902a2.506 2.506 0 010 5.012H31.486a2.506 2.506 0 010-5.012z",fill:"#B1AABD",opacity:.43}),_p().createElement("path",{d:"M30.483 22.846H67.88a1.504 1.504 0 110 3.008H30.483a1.504 1.504 0 110-3.008z",fill:"#B1AABD",opacity:.2})),_p().createElement("rect",{fill:"#645F6D",opacity:.5,x:19.986,y:16.04,width:79.944,height:11.028,rx:5.514}),_p().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(19.986 80.2)"},_p().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:195.862,cy:5.013,rx:3.997,ry:4.01}),_p().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:181.872,cy:5.013,rx:3.997,ry:4.01}),_p().createElement("rect",{fill:"#E3EBF4",x:0,y:1.003,width:18.987,height:19.048,rx:9.493}),_p().createElement("path",{d:"M32.488.791h75.925a3.509 3.509 0 010 7.018H32.488a3.509 3.509 0 110-7.018z",fill:"#B1AABD",opacity:.5}),_p().createElement("path",{d:"M31.486 13.824h128.893a2.506 2.506 0 110 5.012H31.486a2.506 2.506 0 010-5.012z",fill:"#B1AABD",opacity:.43}),_p().createElement("path",{d:"M30.483 22.846h103.918a1.504 1.504 0 010 3.008H30.483a1.504 1.504 0 110-3.008z",fill:"#B1AABD",opacity:.2})),_p().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(19.986 118.296)"},_p().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:195.862,cy:5.013,rx:3.997,ry:4.01}),_p().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:181.872,cy:5.013,rx:3.997,ry:4.01}),_p().createElement("path",{d:"M9.493 1.003a9.493 9.493 0 019.494 9.493v.06a9.493 9.493 0 01-18.987 0v-.06a9.493 9.493 0 019.493-9.493z",fill:"#E3EBF4"}),_p().createElement("path",{d:"M32.488.791h101.906a3.509 3.509 0 010 7.018H32.488a3.509 3.509 0 110-7.018z",fill:"#B1AABD",opacity:.5}),_p().createElement("path",{d:"M31.486 13.824h84.924a2.506 2.506 0 010 5.012H31.486a2.506 2.506 0 010-5.012z",fill:"#B1AABD",opacity:.43}),_p().createElement("path",{d:"M30.483 22.846H67.88a1.504 1.504 0 110 3.008H30.483a1.504 1.504 0 110-3.008z",fill:"#B1AABD",opacity:.2})))),_p().createElement("g",{mask:"url(#NoData_svg__c)"},_p().createElement("path",{d:"M154.445 45.134v154.072H36.625V45.134h.811C35.508 62.52 41.07 80.609 54.12 93.944c22.74 23.235 59.61 23.235 82.352 0 13.05-13.335 18.612-31.424 16.683-48.81h1.29z",fill:"url(#NoData_svg__d)",opacity:.1,transform:"rotate(-30 291.014 34.548)"}),_p().createElement("path",{d:"M27.473 93.234c17.964 18.355 47.09 18.355 65.054 0s17.964-48.113 0-66.468c-17.964-18.355-47.09-18.355-65.054 0s-17.964 48.113 0 66.468z",fill:"url(#NoData_svg__e)",opacity:.2,transform:"translate(70 86)"}),_p().createElement("g",{filter:"url(#NoData_svg__f)",strokeWidth:1,fill:"none",transform:"translate(70 86)"},_p().createElement("path",{d:"M59.697 0c32.97 0 59.697 26.746 59.697 59.738 0 15.185-5.662 29.047-14.988 39.587l51.204 51.24a89.336 89.336 0 01-10.097 9.392l-51.38-51.416c-9.73 6.888-21.61 10.936-34.436 10.936C26.727 119.477 0 92.73 0 59.738 0 26.746 26.727 0 59.697 0zm0 17.756c-23.17 0-41.953 18.796-41.953 41.982s18.783 41.982 41.953 41.982 41.953-18.796 41.953-41.982-18.783-41.982-41.953-41.982z",fill:"#B5C8C9"}),_p().createElement("path",{d:"M21.508 105.656C8.365 94.698 0 78.196 0 59.738 0 26.746 26.727 0 59.697 0c18.444 0 34.935 8.37 45.885 21.523l-9.794 9.8c-8.408-10.68-21.45-17.537-36.091-17.537-25.361 0-45.92 20.573-45.92 45.952 0 14.652 6.852 27.702 17.525 36.117l-9.794 9.8z",fillOpacity:.4,fill:"#FFF"})),_p().createElement("path",{d:"M97.473 179.234c17.964 18.355 47.09 18.355 65.054 0s17.964-48.113 0-66.468c-17.964-18.355-47.09-18.355-65.054 0s-17.964 48.113 0 66.468z",fill:"#D9F5FF",opacity:.4,style:{mixBlendMode:"soft-light"}}),_p().createElement("path",{d:"M123.885 158.736c0-3.929.444-7.03 1.332-9.304.888-2.274 2.328-4.245 4.32-5.914 1.99-1.668 3.504-3.195 4.54-4.581 1.037-1.386 1.555-2.913 1.555-4.581 0-4.064-1.75-6.095-5.248-6.095-1.614 0-2.92.592-3.915 1.776-.996 1.184-1.52 2.785-1.574 4.803H111.25c.054-5.382 1.75-9.573 5.086-12.574 3.337-3 8.02-4.5 14.047-4.5 6.001 0 10.65 1.386 13.946 4.157 3.297 2.772 4.945 6.714 4.945 11.827 0 2.234-.444 4.265-1.332 6.095-.888 1.83-2.315 3.7-4.279 5.61l-4.642 4.32c-1.318 1.265-2.233 2.563-2.745 3.895-.51 1.332-.793 3.02-.847 5.066h-11.545zm-1.655 12.27c0-1.99.72-3.625 2.16-4.904 1.44-1.278 3.236-1.917 5.389-1.917 2.152 0 3.949.64 5.388 1.917 1.44 1.279 2.16 2.913 2.16 4.905 0 1.991-.72 3.626-2.16 4.904-1.44 1.278-3.236 1.917-5.388 1.917-2.153 0-3.95-.639-5.389-1.917-1.44-1.278-2.16-2.913-2.16-4.904z",fillOpacity:.87,fill:"#000",style:{mixBlendMode:"overlay"}}),_p().createElement("path",{d:"M123.885 158.736c0-3.929.444-7.03 1.332-9.304.888-2.274 2.328-4.245 4.32-5.914 1.99-1.668 3.504-3.195 4.54-4.581 1.037-1.386 1.555-2.913 1.555-4.581 0-4.064-1.75-6.095-5.248-6.095-1.614 0-2.92.592-3.915 1.776-.996 1.184-1.52 2.785-1.574 4.803H111.25c.054-5.382 1.75-9.573 5.086-12.574 3.337-3 8.02-4.5 14.047-4.5 6.001 0 10.65 1.386 13.946 4.157 3.297 2.772 4.945 6.714 4.945 11.827 0 2.234-.444 4.265-1.332 6.095-.888 1.83-2.315 3.7-4.279 5.61l-4.642 4.32c-1.318 1.265-2.233 2.563-2.745 3.895-.51 1.332-.793 3.02-.847 5.066h-11.545zm-1.655 12.27c0-1.99.72-3.625 2.16-4.904 1.44-1.278 3.236-1.917 5.389-1.917 2.152 0 3.949.64 5.388 1.917 1.44 1.279 2.16 2.913 2.16 4.905 0 1.991-.72 3.626-2.16 4.904-1.44 1.278-3.236 1.917-5.388 1.917-2.153 0-3.95-.639-5.389-1.917-1.44-1.278-2.16-2.913-2.16-4.904z",fillOpacity:.38,fill:"#3C74B4"})))),ERROR:e=>_p().createElement("svg",WE({width:88,height:88,viewBox:"0 0 88 88",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgError"},e),_p().createElement("mask",{id:"Error_svg__a",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:88,height:88},_p().createElement("path",{d:"M44 88c24.3 0 44-19.7 44-44S68.3 0 44 0 0 19.7 0 44s19.7 44 44 44z",fill:"#fff"})),_p().createElement("g",{mask:"url(#Error_svg__a)"},_p().createElement("path",{d:"M44 88c24.3 0 44-19.7 44-44S68.3 0 44 0 0 19.7 0 44s19.7 44 44 44z",fill:"#CAC4D5",fillOpacity:.3}),_p().createElement("path",{opacity:.3,fillRule:"evenodd",clipRule:"evenodd",d:"M19.987 6.73l49.449 6.072a.687.687 0 01.596.767l-7.845 63.888a.688.688 0 01-.766.6L7.214 71.4a.688.688 0 01-.599-.763l.408-3.326L19.987 6.73z",fill:"#fff"}),_p().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M1.267 25.921l45.86-19.466a.687.687 0 01.9.366l25.15 59.251a.61.61 0 01-.386.84L22.34 82.765a.719.719 0 01-.887-.445l-20.185-56.4z",fill:"#fff"}),_p().createElement("path",{d:"M65.631 9.23H11.017a.688.688 0 00-.687.687v64.37c0 .38.307.687.687.687h54.614c.38 0 .688-.308.688-.687V9.917a.688.688 0 00-.688-.688z",fill:"#F9F9F9"}),_p().createElement("path",{opacity:.1,fillRule:"evenodd",clipRule:"evenodd",d:"M14.885 34.95l3.105-1.666 7.31-4.025 8.852 3.472 7.89-5.223 8.036-2.628 8.113 5.193 3.352-10.255v16.967H14.935l-.05-1.835z",fill:"#9C6CF0"}),_p().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M14.885 32.331l3.105-3.761 7.31 4.31 8.852 1.656 7.89-2.205 8.036 1.827 8.113-12.643 3.352.742V36.36H14.935l-.05-4.029z",fill:"#FA82AA"}),_p().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M14.885 34.946l3.105.432 7.31 1.01 8.852-5.117 7.89 3.675 8.036 1.839 8.113-1.839 3.352.811v1.028H14.935l-.05-1.839z",fill:"#4DBEE9"}),_p().createElement("path",{opacity:.1,fillRule:"evenodd",clipRule:"evenodd",d:"M61.543 35.288l-.05 1.497H14.885v-5.239l3.352-.276 8.114 4.697 8.036-.679 7.889.82 8.852-.616 7.31-1.601 3.105 1.397z",fill:"#4DBEE9"}),_p().createElement("path",{d:"M21.036 40.178h-5.09a.636.636 0 000 1.272h5.09a.636.636 0 100-1.272z",fill:"#ACACAC"}),_p().createElement("path",{opacity:.3,fillRule:"evenodd",clipRule:"evenodd",d:"M16.582 55.872c.703 0 1.273.57 1.273 1.273V69.02a1.272 1.272 0 11-2.545 0V57.144c0-.702.57-1.272 1.272-1.272zM25.914 55.872c.702 0 1.272.57 1.272 1.273V69.02a1.272 1.272 0 11-2.545 0V57.144c0-.702.57-1.272 1.273-1.272zM39.91 55.872c.703 0 1.273.57 1.273 1.273V69.02a1.272 1.272 0 11-2.545 0V57.144c0-.702.57-1.272 1.273-1.272zM21.248 55.872c.702 0 1.272.57 1.272 1.273V69.02a1.273 1.273 0 01-2.545 0V57.144c0-.702.57-1.272 1.273-1.272zM35.245 55.872c.703 0 1.273.57 1.273 1.273V69.02a1.272 1.272 0 11-2.545 0V57.144c0-.702.57-1.272 1.272-1.272zM30.58 55.872c.702 0 1.272.57 1.272 1.273V69.02a1.272 1.272 0 11-2.545 0V57.144c0-.702.57-1.272 1.272-1.272zM44.577 55.872c.702 0 1.272.57 1.272 1.273V69.02a1.273 1.273 0 01-2.545 0V57.144c0-.702.57-1.272 1.273-1.272z",fill:"#BDBDBD"}),_p().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M16.582 65.628c.703 0 1.273.57 1.273 1.272v2.121a1.272 1.272 0 11-2.545 0v-2.12c0-.703.57-1.273 1.272-1.273zM25.914 62.658c.702 0 1.272.57 1.272 1.273v5.09a1.272 1.272 0 11-2.545 0v-5.09c0-.703.57-1.273 1.273-1.273zM39.91 65.628c.703 0 1.273.57 1.273 1.272v2.121a1.272 1.272 0 11-2.545 0v-2.12c0-.703.57-1.273 1.273-1.273zM21.248 66.477c.702 0 1.272.57 1.272 1.272v1.273a1.273 1.273 0 01-2.545 0v-1.273c0-.703.57-1.272 1.273-1.272z",fill:"#4DBEE9"}),_p().createElement("path",{d:"M36.518 65.628a1.272 1.272 0 00-2.545 0v3.393a1.272 1.272 0 102.545 0v-3.393zM31.852 62.234a1.272 1.272 0 10-2.545 0v6.787a1.272 1.272 0 102.545 0v-6.787z",fill:"#4DBEE9"}),_p().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M44.577 60.962c.702 0 1.272.57 1.272 1.272v6.787a1.273 1.273 0 01-2.545 0v-6.787c0-.702.57-1.272 1.273-1.272z",fill:"#4DBEE9"}),_p().createElement("path",{d:"M18.915 18.546a1.909 1.909 0 100-3.817 1.909 1.909 0 000 3.817z",fill:"#9C6CF0"}),_p().createElement("path",{opacity:.5,d:"M34.185 18.546a1.909 1.909 0 100-3.817 1.909 1.909 0 000 3.817z",fill:"#4DBEE9"}),_p().createElement("path",{opacity:.3,d:"M49.454 18.546a1.909 1.909 0 100-3.817 1.909 1.909 0 000 3.817z",fill:"#4DBEE9"}),_p().createElement("path",{opacity:.8,d:"M26.55 18.546a1.909 1.909 0 100-3.817 1.909 1.909 0 000 3.817z",fill:"#FB6597"}),_p().createElement("path",{d:"M41.82 18.546a1.909 1.909 0 100-3.817 1.909 1.909 0 000 3.817z",fill:"#4DBEE9"}),_p().createElement("path",{opacity:.2,d:"M57.09 18.546a1.909 1.909 0 100-3.817 1.909 1.909 0 000 3.817z",fill:"#4DBEE9"}),_p().createElement("path",{opacity:.5,fillRule:"evenodd",clipRule:"evenodd",d:"M16.582 19.818h4.666a.424.424 0 110 .849h-4.666a.424.424 0 110-.849zM31.851 19.818h4.666a.424.424 0 010 .849h-4.666a.424.424 0 110-.849zM47.121 19.818h4.666a.424.424 0 010 .849h-4.666a.424.424 0 010-.849zM24.217 19.818h4.665a.424.424 0 010 .849h-4.665a.424.424 0 010-.849zM39.486 19.818h4.666a.424.424 0 110 .849h-4.666a.424.424 0 110-.849zM54.756 19.818h4.666a.424.424 0 110 .849h-4.666a.424.424 0 110-.849z",fill:"#ACACAC"}),_p().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.946 43.571h5.09a.636.636 0 110 1.273h-5.09a.636.636 0 010-1.273zM15.946 46.116h5.09a.636.636 0 010 1.273h-5.09a.636.636 0 010-1.273zM15.946 48.661h5.09a.636.636 0 010 1.273h-5.09a.636.636 0 110-1.273zM23.58 43.571h5.09a.636.636 0 110 1.273h-5.09a.636.636 0 010-1.273zM23.58 46.116h5.09a.636.636 0 010 1.273h-5.09a.636.636 0 010-1.273zM23.58 48.661h5.09a.636.636 0 010 1.273h-5.09a.636.636 0 110-1.273zM49.454 43.571h11.028a.636.636 0 010 1.273H49.454a.636.636 0 010-1.273zM49.454 46.116h11.028a.636.636 0 010 1.273H49.454a.636.636 0 010-1.273zM49.454 48.661h11.028a.636.636 0 010 1.273H49.454a.636.636 0 110-1.273zM31.215 43.571h15.27a.636.636 0 110 1.273h-15.27a.636.636 0 010-1.273zM31.215 46.116h15.27a.636.636 0 010 1.273h-15.27a.636.636 0 010-1.273zM31.215 48.661h15.27a.636.636 0 010 1.273h-15.27a.636.636 0 010-1.273zM15.946 51.206h5.09a.636.636 0 110 1.272h-5.09a.636.636 0 110-1.272zM23.58 51.206h5.09a.636.636 0 110 1.272h-5.09a.636.636 0 110-1.272zM49.454 51.206h11.028a.636.636 0 010 1.272H49.454a.636.636 0 110-1.272zM31.215 51.206h15.27a.636.636 0 110 1.272h-15.27a.636.636 0 010-1.272z",fill:"#E9E9E9"}),_p().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M49.878 55.872h5.09a.636.636 0 110 1.273h-5.09a.636.636 0 110-1.273z",fill:"#ACACAC"}),_p().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M49.878 59.69h11.029a.636.636 0 010 1.272H49.878a.636.636 0 110-1.273zM49.878 62.234h11.029a.636.636 0 010 1.273H49.878a.636.636 0 010-1.273zM49.878 64.78h11.029a.636.636 0 010 1.272H49.878a.636.636 0 010-1.273z",fill:"#E9E9E9"}),_p().createElement("path",{d:"M54.968 67.324h-5.09a.636.636 0 000 1.273h5.09a.636.636 0 000-1.273z",fill:"#E9E9E9"}),_p().createElement("g",{filter:"url(#Error_svg__filter0_d)"},_p().createElement("path",{d:"M57.406 74.25c9.493 0 17.188-7.695 17.188-17.188 0-9.492-7.695-17.187-17.188-17.187-9.492 0-17.187 7.695-17.187 17.188 0 9.492 7.695 17.187 17.187 17.187z",fill:"#000"})),_p().createElement("path",{d:"M57.406 74.25c9.493 0 17.188-7.695 17.188-17.188 0-9.492-7.695-17.187-17.188-17.187-9.492 0-17.187 7.695-17.187 17.188 0 9.492 7.695 17.187 17.187 17.187z",fill:"#F25252"}),_p().createElement("path",{opacity:.15,fillRule:"evenodd",clipRule:"evenodd",d:"M57.406 34.719c12.34 0 22.344 10.003 22.344 22.343S69.746 79.406 57.406 79.406c-12.34 0-22.343-10.003-22.343-22.344 0-12.34 10.003-22.343 22.343-22.343zm-.172 2.406c-10.916 0-19.765 8.85-19.765 19.766 0 10.916 8.85 19.765 19.765 19.765C68.151 76.656 77 67.806 77 56.891c0-10.917-8.85-19.766-19.766-19.766z",fill:"#F25252"}),_p().createElement("path",{opacity:.3,fillRule:"evenodd",clipRule:"evenodd",d:"M57.406 38.844c10.062 0 18.219 8.157 18.219 18.218 0 10.062-8.157 18.22-18.219 18.22-10.062 0-18.218-8.158-18.218-18.22 0-10.061 8.156-18.218 18.218-18.218zm0 2.043c-8.933 0-16.175 7.242-16.175 16.175 0 8.934 7.242 16.176 16.175 16.176 8.934 0 16.176-7.242 16.176-16.175 0-8.934-7.242-16.176-16.176-16.176z",fill:"#F25252"}),_p().createElement("path",{opacity:.05,fillRule:"evenodd",clipRule:"evenodd",d:"M57.406 26.469C74.303 26.469 88 40.166 88 57.062c0 16.897-13.697 30.594-30.594 30.594-16.896 0-30.593-13.697-30.593-30.594 0-16.896 13.697-30.593 30.593-30.593zm-.172 3.437c-14.903 0-26.984 12.082-26.984 26.985 0 14.903 12.081 26.984 26.984 26.984 14.903 0 26.985-12.081 26.985-26.984 0-14.903-12.082-26.985-26.985-26.985z",fill:"#F25252"}),_p().createElement("path",{d:"M57.406 71.844c8.164 0 14.782-6.618 14.782-14.781 0-8.164-6.618-14.782-14.782-14.782-8.163 0-14.781 6.618-14.781 14.782 0 8.163 6.618 14.78 14.781 14.78z",fill:"#FF6A6A"}),_p().createElement("path",{opacity:.05,fillRule:"evenodd",clipRule:"evenodd",d:"M58.298 46.448L75.18 63.331l-9.114 12.078h-2.029l-7.582-7.582 1.006-3.178.837-18.2z",fill:"url(#Error_svg__paint0_linear)"}),_p().createElement("g",{filter:"url(#Error_svg__filter1_d)"},_p().createElement("path",{d:"M57.406 68.063a1.719 1.719 0 100-3.438 1.719 1.719 0 000 3.438z",fill:"#000"})),_p().createElement("path",{d:"M57.406 68.063a1.719 1.719 0 100-3.438 1.719 1.719 0 000 3.438z",fill:"#fff"}),_p().createElement("g",{filter:"url(#Error_svg__filter2_d)"},_p().createElement("path",{d:"M57.406 46.063c.95 0 1.719.769 1.719 1.718v12.375a1.719 1.719 0 11-3.438 0V47.781c0-.949.77-1.718 1.72-1.718z",fill:"#000"})),_p().createElement("path",{d:"M57.406 46.063c.95 0 1.719.769 1.719 1.718v12.375a1.719 1.719 0 11-3.438 0V47.781c0-.949.77-1.718 1.72-1.718z",fill:"#fff"})),_p().createElement("defs",null,_p().createElement("filter",{id:"Error_svg__filter0_d",x:36.219,y:37.875,width:42.375,height:42.375,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},_p().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),_p().createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),_p().createElement("feOffset",{dy:2}),_p().createElement("feGaussianBlur",{stdDeviation:2}),_p().createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0"}),_p().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),_p().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),_p().createElement("filter",{id:"Error_svg__filter1_d",x:51.688,y:62.625,width:11.438,height:11.438,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},_p().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),_p().createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),_p().createElement("feOffset",{dy:2}),_p().createElement("feGaussianBlur",{stdDeviation:2}),_p().createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0"}),_p().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),_p().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),_p().createElement("filter",{id:"Error_svg__filter2_d",x:51.688,y:44.063,width:11.438,height:23.813,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},_p().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),_p().createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),_p().createElement("feOffset",{dy:2}),_p().createElement("feGaussianBlur",{stdDeviation:2}),_p().createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0"}),_p().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),_p().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),_p().createElement("linearGradient",{id:"Error_svg__paint0_linear",x1:68.438,y1:71.571,x2:60.119,y2:58.801,gradientUnits:"userSpaceOnUse"},_p().createElement("stop",{stopOpacity:0}),_p().createElement("stop",{offset:1})))),LOADING:e=>_p().createElement("svg",qE({width:256,height:256,viewBox:"0 0 256 256",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgEmptyLoading"},e),_p().createElement("circle",{cx:128,cy:128,r:128,fill:"#0072CE",fillOpacity:.03}),_p().createElement("mask",{id:"EmptyLoading_svg__a",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:256,height:256},_p().createElement("circle",{cx:128,cy:128,r:128,fill:"#fff"})),_p().createElement("g",{mask:"url(#EmptyLoading_svg__a)"},_p().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M-16 9h256v247H-16V9z",fill:"url(#EmptyLoading_svg__paint0_linear_2978_41880)"}),_p().createElement("g",{fillRule:"evenodd",clipRule:"evenodd"},_p().createElement("path",{d:"M40.755 44.17C40.755 38.002 45.76 33 51.92 33h251.675c6.167 0 11.166 5.001 11.166 11.17v160.596H40.755V44.171z",fill:"#5E7282"}),_p().createElement("path",{d:"M50.371 43.106h255.685V195.71H50.371V43.106z",fill:"url(#EmptyLoading_svg__paint1_linear_2978_41880)"}),_p().createElement("path",{d:"M15.545 208.914c2.321.469 4.723.716 7.183.716H338.75c.22 0 .439-.002.658-.006-7.061 8.445-17.67 13.816-29.524 13.816H45.655c-12.111 0-22.916-5.597-29.968-14.349l-.142-.177z",fill:"#BDCBD8"}),_p().createElement("path",{d:"M339.015 204.883v4.966H15v-4.966h324.015z",fill:"#D4DCDF"}),_p().createElement("path",{d:"M201.107 213.991h-45.221a11.176 11.176 0 01-11.046-9.449h67.314a11.172 11.172 0 01-11.047 9.449z",fill:"url(#EmptyLoading_svg__paint2_linear_2978_41880)"})),_p().createElement("g",{filter:"url(#EmptyLoading_svg__filter0_d_2978_41880)"},_p().createElement("rect",{x:81.703,y:99,width:170,height:26,rx:8,fill:"#D1E6FF"}),_p().createElement("rect",{x:84.703,y:102,width:164,height:20,rx:5,stroke:"#fff",strokeWidth:6})),_p().createElement("g",{filter:"url(#EmptyLoading_svg__filter1_d_2978_41880)"},_p().createElement("mask",{id:"EmptyLoading_svg__b",fill:"#fff"},_p().createElement("rect",{x:81,y:105,width:108,height:14,rx:2})),_p().createElement("rect",{x:81,y:105,width:108,height:14,rx:2,fill:"#61A3F1"}),_p().createElement("rect",{x:81,y:105,width:108,height:14,rx:2,stroke:"#4A90E2",strokeWidth:8,mask:"url(#EmptyLoading_svg__b)"})),_p().createElement("path",{opacity:.8,fillRule:"evenodd",clipRule:"evenodd",d:"M122.703 74a3 3 0 013-3h81.625a3 3 0 010 6h-81.625a3 3 0 01-3-3z",fill:"#B6C7DB"}),_p().createElement("path",{opacity:.2,fillRule:"evenodd",clipRule:"evenodd",d:"M146.703 86a3 3 0 013-3h34a3 3 0 110 6h-34a3 3 0 01-3-3zM136.703 139a3 3 0 013-3h54a3 3 0 110 6h-54a3 3 0 01-3-3z",fill:"#979797"}),_p().createElement("path",{opacity:.1,fillRule:"evenodd",clipRule:"evenodd",d:"M112.703 151a3 3 0 013-3h103a3 3 0 110 6h-103a3 3 0 01-3-3zM124.703 163a3 3 0 013-3h79a3 3 0 110 6h-79a3 3 0 01-3-3z",fill:"#979797"}),_p().createElement("g",{filter:"url(#EmptyLoading_svg__filter2_ddd_2978_41880)"},_p().createElement("path",{fill:"#A0C1D7",d:"M70.703 64h11v8h-11z"}),_p().createElement("rect",{x:62,y:59,width:28,height:8,rx:1,fill:"#BDD4E3"}),_p().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M38.23 160.5c20.704 20.703 54.27 20.703 74.973 0 20.703-20.703 20.703-54.27 0-74.973-20.703-20.703-54.27-20.703-74.973 0-20.703 20.703-20.703 54.27 0 74.973z",fill:"#BDD4E3"}),_p().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M113.427 85.988c20.463 20.652 20.404 53.981-.175 74.561-20.432 20.431-53.432 20.635-74.115.613l-.446-.439 74.736-74.735z",fill:"#A0C1D7"}),_p().createElement("path",{opacity:.144,fillRule:"evenodd",clipRule:"evenodd",d:"M75.037 175.385c29.402 0 53.236-23.834 53.236-53.236a54.67 54.67 0 00-.106-3.399L100.45 91.037l-55.142 58.396 25.814 25.811c1.293.094 2.598.141 3.915.141z",fill:"url(#EmptyLoading_svg__paint3_linear_2978_41880)"}),_p().createElement("circle",{cx:75.94,cy:123.237,r:44.723,fill:"#91B0C2"}),_p().createElement("g",{filter:"url(#EmptyLoading_svg__filter3_d_2978_41880)"},_p().createElement("circle",{r:42.793,transform:"matrix(-1 0 0 1 75.94 123.237)",fill:"#F7F4FF"})),_p().createElement("path",{opacity:.05,fillRule:"evenodd",clipRule:"evenodd",d:"M105.043 175.309l-10.298.861-20.313-20.152.863-2.292-9.973-9.982 18.679-6.882h-4.308l-8.943-8.951 4.545-10.532L94.35 90.74l37.888 37.162c-.343 20.088-11.146 37.627-27.195 47.407z",fill:"url(#EmptyLoading_svg__paint4_linear_2978_41880)"}),_p().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M67.703 123a8 8 0 0112.362-6.707l14.477-25.145A36.828 36.828 0 0075.703 86c-20.434 0-37 16.565-37 37h29z",fill:"url(#EmptyLoading_svg__paint5_angular_2978_41880)"}),_p().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M94.297 90.6l.24.138s-12.45 35.125-12.811 35.752a6.92 6.92 0 01-11.985-6.92c.361-.626 24.556-28.97 24.556-28.97z",fill:"#323232"}),_p().createElement("circle",{cx:75.94,cy:123.237,r:2.896,fill:"#EEEBF6"}),_p().createElement("circle",{cx:96.211,cy:148.655,r:2.574,fill:"#A0C3D7"}),_p().createElement("circle",{cx:107.15,cy:131.924,r:2.574,fill:"#A0C3D7"}),_p().createElement("rect",{x:62.427,y:135.592,width:27.027,height:10.039,rx:3,fill:"#A0C3D7"}),_p().createElement("path",{opacity:.05,fillRule:"evenodd",clipRule:"evenodd",d:"M85.914 170.534H75.112l-21.605-21.472 2.126-2.775v-1.01L42.8 132.523l2.853-2.529 40.261 40.54z",fill:"url(#EmptyLoading_svg__paint6_linear_2978_41880)"}),_p().createElement("path",{opacity:.02,fillRule:"evenodd",clipRule:"evenodd",d:"M96.362 136.555h-4.988l-38.126-38.01 2.853-2.53 40.261 40.54z",fill:"url(#EmptyLoading_svg__paint7_linear_2978_41880)"}),_p().createElement("path",{opacity:.02,fillRule:"evenodd",clipRule:"evenodd",d:"M116.746 129.006h-4.988L73.632 90.995l2.853-2.53 40.261 40.541z",fill:"url(#EmptyLoading_svg__paint8_linear_2978_41880)"}),_p().createElement("path",{opacity:.02,fillRule:"evenodd",clipRule:"evenodd",d:"M85.793 152.41h-4.988l-38.126-38.011 2.852-2.53 40.262 40.541z",fill:"url(#EmptyLoading_svg__paint9_linear_2978_41880)"}),_p().createElement("circle",{cx:75.618,cy:155.734,r:2.574,fill:"#A0C3D7"}),_p().createElement("circle",{cx:55.026,cy:148.655,r:2.574,fill:"#A0C3D7"}),_p().createElement("circle",{cx:44.73,cy:131.924,r:2.574,fill:"#A0C3D7"}),_p().createElement("g",{fill:"#A0C3D7"},_p().createElement("circle",{r:2.574,transform:"matrix(1 0 0 -1 96.21 97.363)"}),_p().createElement("circle",{r:2.574,transform:"matrix(1 0 0 -1 107.149 114.094)"}),_p().createElement("circle",{r:2.574,transform:"matrix(1 0 0 -1 75.618 90.284)"}),_p().createElement("circle",{r:2.574,transform:"matrix(1 0 0 -1 55.026 97.363)"}),_p().createElement("circle",{r:2.574,transform:"matrix(1 0 0 -1 44.73 114.094)"})))),_p().createElement("defs",null,_p().createElement("linearGradient",{id:"EmptyLoading_svg__paint0_linear_2978_41880",x1:-16,y1:9,x2:-16,y2:256,gradientUnits:"userSpaceOnUse"},_p().createElement("stop",{stopColor:"#FAFAFA",stopOpacity:.01}),_p().createElement("stop",{offset:1,stopColor:"#F4F4F4"})),_p().createElement("linearGradient",{id:"EmptyLoading_svg__paint1_linear_2978_41880",x1:178.214,y1:43.106,x2:178.214,y2:195.709,gradientUnits:"userSpaceOnUse"},_p().createElement("stop",{stopColor:"#F2F9FB"}),_p().createElement("stop",{offset:1,stopColor:"#fff"})),_p().createElement("linearGradient",{id:"EmptyLoading_svg__paint2_linear_2978_41880",x1:178.497,y1:204.542,x2:178.497,y2:213.991,gradientUnits:"userSpaceOnUse"},_p().createElement("stop",{stopColor:"#90AABF"}),_p().createElement("stop",{offset:1,stopColor:"#869DAE"})),_p().createElement("linearGradient",{id:"EmptyLoading_svg__paint3_linear_2978_41880",x1:154.275,y1:146.574,x2:96.683,y2:91.352,gradientUnits:"userSpaceOnUse"},_p().createElement("stop",{stopOpacity:.01}),_p().createElement("stop",{offset:1})),_p().createElement("linearGradient",{id:"EmptyLoading_svg__paint4_linear_2978_41880",x1:60.762,y1:143.327,x2:114.747,y2:176.019,gradientUnits:"userSpaceOnUse"},_p().createElement("stop",{stopOpacity:.87}),_p().createElement("stop",{offset:1,stopOpacity:.01})),_p().createElement("linearGradient",{id:"EmptyLoading_svg__paint6_linear_2978_41880",x1:90.287,y1:154.267,x2:68.53,y2:131.301,gradientUnits:"userSpaceOnUse"},_p().createElement("stop",{stopOpacity:.01}),_p().createElement("stop",{offset:1})),_p().createElement("linearGradient",{id:"EmptyLoading_svg__paint7_linear_2978_41880",x1:100.735,y1:120.288,x2:78.978,y2:97.322,gradientUnits:"userSpaceOnUse"},_p().createElement("stop",{stopOpacity:.01}),_p().createElement("stop",{offset:1})),_p().createElement("linearGradient",{id:"EmptyLoading_svg__paint8_linear_2978_41880",x1:121.119,y1:112.739,x2:99.362,y2:89.773,gradientUnits:"userSpaceOnUse"},_p().createElement("stop",{stopOpacity:.01}),_p().createElement("stop",{offset:1})),_p().createElement("linearGradient",{id:"EmptyLoading_svg__paint9_linear_2978_41880",x1:90.166,y1:136.143,x2:68.409,y2:113.177,gradientUnits:"userSpaceOnUse"},_p().createElement("stop",{stopOpacity:.01}),_p().createElement("stop",{offset:1})),_p().createElement("filter",{id:"EmptyLoading_svg__filter0_d_2978_41880",x:77.703,y:96,width:178,height:34,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},_p().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),_p().createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),_p().createElement("feOffset",{dy:1}),_p().createElement("feGaussianBlur",{stdDeviation:2}),_p().createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.06 0"}),_p().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_2978_41880"}),_p().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_2978_41880",result:"shape"})),_p().createElement("filter",{id:"EmptyLoading_svg__filter1_d_2978_41880",x:77,y:102,width:116,height:22,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},_p().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),_p().createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),_p().createElement("feOffset",{dy:1}),_p().createElement("feGaussianBlur",{stdDeviation:2}),_p().createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.06 0"}),_p().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_2978_41880"}),_p().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_2978_41880",result:"shape"})),_p().createElement("filter",{id:"EmptyLoading_svg__filter2_ddd_2978_41880",x:-13.297,y:28,width:181.534,height:189.17,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},_p().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),_p().createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),_p().createElement("feMorphology",{radius:4,operator:"erode",in:"SourceAlpha",result:"effect1_dropShadow_2978_41880"}),_p().createElement("feOffset",{dy:7}),_p().createElement("feGaussianBlur",{stdDeviation:4}),_p().createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0.600156 0 0 0 0 0.745337 0 0 0 0 0.8625 0 0 0 0.1 0"}),_p().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_2978_41880"}),_p().createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),_p().createElement("feMorphology",{radius:4,operator:"dilate",in:"SourceAlpha",result:"effect2_dropShadow_2978_41880"}),_p().createElement("feOffset",{dy:5}),_p().createElement("feGaussianBlur",{stdDeviation:16}),_p().createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0.447059 0 0 0 0 0.807843 0 0 0 0.06 0"}),_p().createElement("feBlend",{mode:"normal",in2:"effect1_dropShadow_2978_41880",result:"effect2_dropShadow_2978_41880"}),_p().createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),_p().createElement("feMorphology",{radius:2,operator:"dilate",in:"SourceAlpha",result:"effect3_dropShadow_2978_41880"}),_p().createElement("feOffset",{dy:12}),_p().createElement("feGaussianBlur",{stdDeviation:8.5}),_p().createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0.447059 0 0 0 0 0.807843 0 0 0 0.06 0"}),_p().createElement("feBlend",{mode:"normal",in2:"effect2_dropShadow_2978_41880",result:"effect3_dropShadow_2978_41880"}),_p().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect3_dropShadow_2978_41880",result:"shape"})),_p().createElement("filter",{id:"EmptyLoading_svg__filter3_d_2978_41880",x:29.148,y:78.444,width:93.585,height:93.585,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},_p().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),_p().createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),_p().createElement("feOffset",{dy:2}),_p().createElement("feGaussianBlur",{stdDeviation:2}),_p().createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0"}),_p().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_2978_41880"}),_p().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_2978_41880",result:"shape"})),_p().createElement("radialGradient",{id:"EmptyLoading_svg__paint5_angular_2978_41880",cx:0,cy:0,r:1,gradientUnits:"userSpaceOnUse",gradientTransform:"rotate(-56.035 152.55 -12.515) scale(43.4058 65.5062)"},_p().createElement("stop",{stopColor:"#CFE8FF"}),_p().createElement("stop",{offset:.599,stopColor:"#D1F2F9",stopOpacity:0}))))},KE=({variant:e=ZE.full,LogoRenderer:t=$E.SEARCH_RESULTS,text:r,secondaryText:n,buttonTitle:a,onClick:i=O.identity,access:o})=>{const l=GE(),s=o&&a;return _p().createElement("div",{className:kp()(l.root,l[`root_${e}`])},_p().createElement(t,{className:l[`${e}`]}),_p().createElement("div",{className:l.textBox},_p().createElement(zf(),{variant:"h5",classes:{h5:l.text}},r),n&&_p().createElement(zf(),{variant:"subtitle1",classes:{subtitle1:l.secondaryText}},n)),s&&_p().createElement(hE(),{className:l.button,variant:"contained",color:"primary",onClick:i},a))};var XE=r(15503);class QE extends _p().Component{constructor(e){super(e),this.state={error:null}}componentDidCatch(e){this.setState({error:e}),console.error(e)}render(){const{children:e,error:t}=this.props;return this.state.error?t:e}}const JE=(0,qp.Z)({container:{flexGrow:1,display:"flex",flexDirection:"column",position:"relative",overflow:"hidden","& .Resizer.disabled":{display:"none"}},pagination:{flexGrow:0,height:"52px"},listContainer:{overflowY:"auto"},tableContainer:{display:"flex",flexDirection:"column",height:"100%"},resizablePanesWrapper:{flexGrow:1,height:0},pane:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",flexDirection:"column",overflow:"hidden"}});var eb=r(46089),tb=r.n(eb);const rb=(0,qp.Z)((e=>({button:{"&.MuiButtonGroup-grouped":{minWidth:"30px",padding:"8px 8px",justifyContent:"start",fill:"rgba(0,0,0,0.54)",textTransform:"none",color:"rgba(0,0,0,0.87)",borderColor:"rgba(0,0,0,0.12)","&:hover":{backgroundColor:"rgba(0, 0, 0, 0.04)"},"&:not(:last-of-type):hover":{borderRightColor:"transparent"},"&$current":{"& $icon":{color:e.palette.primary.main},backgroundColor:(0,$m.alpha)(e.palette.primary.main,.12),fill:e.palette.primary.main,color:e.palette.primary.main,"&:hover":{backgroundColor:(0,$m.alpha)(e.palette.primary.main,.24),borderRightColor:"transparent"}}}},icon:{color:"rgba(0,0,0,0.54)",width:"20px",height:"20px","& + $title":{marginLeft:"8px"}},title:{fontSize:"13px",lineHeight:"15px",letterSpacing:0},current:{}}))),nb=(0,Id.T)(hE()),ab=({className:e,classes:t={},modes:r=[],modeId:n,onChange:a})=>{const i=rb();return _p().createElement(tb(),{className:e},r.map((({id:e,title:r,tooltipTitle:o,Icon:l,disabled:s})=>{return _p().createElement(nb,{disabled:s,showForDisabled:s&&!!o,key:String(e),className:kp()(i.button,{[i.current]:n===e},t.button),tooltipTitle:o,onClick:(c=e,()=>a(c)),"data-reltio-id":`reltio-search-mode-${e}`},l&&_p().createElement(l,{className:i.icon}),r&&_p().createElement("div",{className:i.title},r));var c})))},ib=(0,qp.Z)((()=>({button:{"&.MuiButtonGroup-grouped":{minWidth:"90px",padding:"8px 12px"}}})));function ob(){return ob=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ob.apply(null,arguments)}const lb=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return _p().createElement("svg",ob({width:"25",height:"24",viewBox:"0 0 25 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},r),_p().createElement("defs",null,_p().createElement("path",{d:"M19 4H5c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zM7 18H5v-8h2v8zM7 8H5V6h2v2zm6 10H9v-8h4v8zm0-10H9V6h4v2zm6 10h-4v-8h4v8zm0-10h-4V6h4v2z",id:"svg3365802068a"})),_p().createElement("g",{stroke:"none",strokeWidth:"1"},_p().createElement("g",{transform:"translate(.2)"},_p().createElement("mask",{id:"svg3365802068b",fill:"#fff"},_p().createElement("use",{xlinkHref:"#svg3365802068a"})),_p().createElement("g",{mask:"url(#svg3365802068b)"},_p().createElement("g",null,_p().createElement("g",null,_p().createElement("path",{d:"M0 0h24v24H0z"})))))))};function sb(){return sb=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},sb.apply(null,arguments)}const cb=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return _p().createElement("svg",sb({width:"25",height:"24",viewBox:"0 0 25 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},r),_p().createElement("defs",null,_p().createElement("path",{d:"M20 15.5v3H9v-3h11zm-14 0a1 1 0 011 1v1a1 1 0 01-1 1H5a1 1 0 01-1-1v-1a1 1 0 011-1h1zm14-5v3H9v-3h11zm-14 0a1 1 0 011 1v1a1 1 0 01-1 1H5a1 1 0 01-1-1v-1a1 1 0 011-1h1zm14-5v3H9v-3h11zm-14 0a1 1 0 011 1v1a1 1 0 01-1 1H5a1 1 0 01-1-1v-1a1 1 0 011-1h1z",id:"svg4195527304a"})),_p().createElement("g",{stroke:"none",strokeWidth:"1"},_p().createElement("g",{transform:"translate(.2)"},_p().createElement("mask",{id:"svg4195527304b",fill:"#fff"},_p().createElement("use",{xlinkHref:"#svg4195527304a"})),_p().createElement("g",{mask:"url(#svg4195527304b)"},_p().createElement("path",{d:"M0 0h24v24H0z"})))))},ub=e=>{switch(e){case B.ll.TABLE:return lb;case B.ll.LIST:return cb;default:return TE()}},pb=[{id:B.ll.TABLE,tooltipTitle:li().text("Table view"),title:li().text("Table"),Icon:ub(B.ll.TABLE)},{id:B.ll.LIST,tooltipTitle:li().text("List view"),title:li().text("List"),Icon:ub(B.ll.LIST)}],db=({className:e})=>{const t=ib(),r=(0,Pp.useDispatch)(),n=(0,Pp.useSelector)(ki.XM);return _p().createElement(ab,{className:e,classes:{button:t.button},modes:pb,modeId:n,onChange:e=>{n!==e&&r((e=>({type:ve,payload:e}))(e))}})};db.propTypes={className:Np().string};const mb=db;var fb=r(81085),yb=r.n(fb),gb=r(48139),hb=r.n(gb);const Eb="DATA_TENANTS_UPDATED",bb=e=>t=>({type:e,payload:t}),vb=(bb(Eb),(e=null,t)=>t.type===Eb?t.payload||null:e),Tb="TENANTS_UPDATED",Ob=(bb(Tb),(e=null,t)=>t.type===Tb?t.payload||null:e);let Sb=function(e){return e.OPEN_ENTITY="OPEN_ENTITY",e.NEW_ENTITY_SHOWN="NEW_ENTITY_SHOWN",e.ENTITY_DELETION_FINISHED="ENTITY_DELETION_FINISHED",e.OPEN_PERSPECTIVE="OPEN_PERSPECTIVE",e.UI_CONFIG_LOADED="UI_CONFIG_LOADED",e.NEW_UI_CONFIG_LOADED="NEW_UI_CONFIG_LOADED",e.PATHS_SET="PATHS_SET",e.UI_PATH_SET="UI_PATH_SET",e.LOCALIZATION_LOADED="LOCALIZATION_LOADED",e.LOCALE_ATTRIBUTE_PRESENTATION_LOADED="LOCALE_ATTRIBUTE_PRESENTATION_LOADED",e.AUTOCLOSE_INTERVAL_LOADED="AUTOCLOSE_INTERVAL_LOADED",e.SET_PREFER_REACT="SET_PREFER_REACT",e.OPEN_CONSOLE_APP="OPEN_CONSOLE_APP",e.OPEN_APP_FROM_CHOCOLATE_BAR="OPEN_APP_FROM_CHOCOLATE_BAR",e.NUMBER_FORMAT_UPDATED="NUMBER_FORMAT_UPDATED",e.OPEN_GRAPH="OPEN_GRAPH",e.DATE_MASK_UPDATED="DATE_MASK_UPDATED",e.DATE_TIME_MASK_UPDATED="DATE_TIME_MASK_UPDATED",e.OPEN_SEARCH="OPEN_SEARCH",e.OPEN_DASHBOARD="OPEN_DASHBOARD",e.OPEN_HISTORY_EVENT="OPEN_HISTORY_EVENT",e.KEYS_SET="KEYS_SET",e.OPEN_PIVOTING_PERSPECTIVE="OPEN_PIVOTING_PERSPECTIVE",e.ERROR_SET="ERROR_SET",e.SHOW_NOTIFICATION="SHOW_NOTIFICATION",e.CLOSE_NOTIFICATION="CLOSE_NOTIFICATION",e.CLEAR_NOTIFICATIONS="CLEAR_NOTIFICATIONS",e.DOCUMENTATION_SET="DOCUMENTATION_SET",e.OPEN_NEW_ENTITY_WITH_AUTHORING="OPEN_NEW_ENTITY_WITH_AUTHORING",e.OPEN_PREVIOUS_PAGE="OPEN_PREVIOUS_PAGE",e.NAVIGATE="NAVIGATE",e.ADD_DASHBOARD_EXTERNAL_VIEW="ADD_DASHBOARD_EXTERNAL_VIEW",e.SET_USE_SHARED_PREFERENCES="SET_USE_SHARED_PREFERENCES",e}({});function xb(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Cb={},wb=(0,O.pipe)(v.normalizeMetadata,v.parseMetadata,v.localizeMetadata),Ab=(0,O.map)(v.localizeMetadata),Rb=(e=Cb,t)=>{switch(t.type){case"METADATA_LOADED":{const{tenant:r,metadata:n}=t.payload;return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){xb(e,t,r[t])}))}return e}({},e,{[r]:wb(n)})}case Sb.LOCALIZATION_LOADED:return Ab(e);default:return e}};let _b=function(e){return e.ADD_ATTRIBUTES="ADD_ATTRIBUTES",e.MODIFY_ATTRIBUTE="MODIFY_ATTRIBUTE",e.REMOVE_ATTRIBUTE="REMOVE_ATTRIBUTE",e.REQUEST_NEXT_PAGE_ATTRIBUTE_VALUES="REQUEST_NEXT_PAGE_ATTRIBUTE_VALUES",e.ADD_NEXT_PAGE_ATTRIBUTE_VALUES="ADD_NEXT_PAGE_ATTRIBUTE_VALUES",e.PROCESS_NEXT_PAGE_ATTRIBUTE_VALUES="PROCESS_NEXT_PAGE_ATTRIBUTE_VALUES",e.ADD_DEFAULT_VALUES="ADD_DEFAULT_VALUES",e.SAVE_PROFILE="SAVE_PROFILE",e.SAVE_DRAFT="SAVE_DRAFT",e.VALIDATE_PROFILE="VALIDATE_PROFILE",e.CANCEL_PROFILE_VALIDATION="CANCEL_PROFILE_VALIDATION",e.PROFILE_SAVED="PROFILE_SAVED",e.RUN_AUTHORING_TASK_ACTION="RUN_AUTHORING_TASK_ACTION",e}({});const Ib=bb(_b.ADD_ATTRIBUTES),Nb=bb(_b.ADD_DEFAULT_VALUES),Pb=bb(_b.MODIFY_ATTRIBUTE),Db=bb(_b.REMOVE_ATTRIBUTE),kb=bb(_b.ADD_NEXT_PAGE_ATTRIBUTE_VALUES),Lb=bb(_b.PROCESS_NEXT_PAGE_ATTRIBUTE_VALUES),Ub=bb(_b.REQUEST_NEXT_PAGE_ATTRIBUTE_VALUES),jb=bb(_b.SAVE_PROFILE),Fb=bb(_b.RUN_AUTHORING_TASK_ACTION),Mb=bb(_b.SAVE_DRAFT),Vb=bb(_b.PROFILE_SAVED),Bb=bb(_b.VALIDATE_PROFILE),zb=bb(_b.CANCEL_PROFILE_VALIDATION);let Hb=function(e){return e.DEPENDENT_LOOKUPS_STRUCTURE_SET="DEPENDENT_LOOKUPS_STRUCTURE_SET",e.DEPENDENT_LOOKUPS_INITED_TYPE_URIS_ADDED="DEPENDENT_LOOKUPS_INITED_TYPE_URIS_ADDED",e.DEPENDENT_LOOKUPS_EDITORS_BLOCKED="DEPENDENT_LOOKUPS_EDITORS_BLOCKED",e.DEPENDENT_LOOKUPS_EDITOR_TOUCHED="DEPENDENT_LOOKUPS_EDITOR_TOUCHED",e}({});const Yb=bb(Hb.DEPENDENT_LOOKUPS_STRUCTURE_SET),Wb=bb(Hb.DEPENDENT_LOOKUPS_INITED_TYPE_URIS_ADDED),Gb=bb(Hb.DEPENDENT_LOOKUPS_EDITORS_BLOCKED),qb=bb(Hb.DEPENDENT_LOOKUPS_EDITOR_TOUCHED);let Zb=function(e){return e.MODE_UPDATED="MODE_UPDATED",e.MODE_EDITING_CANCELED="MODE_EDITING_CANCELED",e.MODE_UPDATE_REQUESTED="MODE_UPDATE_REQUESTED",e}({});function $b(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Kb(e,t,r[t])}))}return e}function Kb(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Xb={structure:{},editors:{},initedTypeUris:[]},Qb="SEARCH_RESULTS_SET",Jb="KEYWORD_UPDATED",ev="UPDATE_STATE",tv="ACTIVITY_FILTER_UPDATED",rv="GLOBAL_FILTER_UPDATED",nv="SEARCH_OPTIONS_UPDATED",av="SET_SEARCH_OPTIONS_CONFIG",iv="SET_SEARCH_PROVIDER_DATA",ov="SET_SEARCH_NAVIGATION_DATA",lv="UPDATE_SEARCH_NAVIGATION_DATA_FIELDS",sv=bb(Qb),cv=bb(Jb),uv=bb(ev),pv=bb("SAVE_STATE"),dv=bb(tv),mv=bb(rv),fv=bb(nv),yv=bb(av),gv=bb(iv),hv=bb(ov),Ev=bb(lv),bv=bb("UPDATE_SEARCH_NAVIGATION_DATA_ON_MERGE"),vv=(0,O.path)(["globalFilter","savedSearchesUris"]),Tv="searchNavigation";function*Ov(){const e=yield(0,Ia.Ys)(LI.selectors.getSearchNavigationData),t=yield(0,Ia.Ys)(LI.selectors.getSearchProviderData);sessionStorage.setItem(Tv,JSON.stringify({searchNavigationData:e,searchProviderData:t}))}function*Sv(){let e;try{e=JSON.parse(sessionStorage.getItem(Tv))||{}}catch(t){e={}}const{searchNavigationData:t,searchProviderData:r}=e;t&&r&&(yield(0,Ia.gz)(gv(r)),yield(0,Ia.gz)(hv(t)))}const xv=[function*(){yield(0,Ia.Fm)([ov,lv,Sb.OPEN_ENTITY],Ov)},function*(){yield(0,Ia.RE)(Sv)}];function Cv(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){wv(e,t,r[t])}))}return e}function wv(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Av={searchResults:[],keyword:null,searchOptions:{searchByOv:!1,ovOnly:!1},activityFilter:"active",globalFilter:{query:null,savedSearchesUris:[],isMuted:!0},searchProviderData:null,searchNavigationData:null},Rv=(e=Av,t)=>{switch(t.type){case Qb:return Cv({},e,{searchResults:t.payload});case Jb:{const r=(0,O.pick)(["value","isRawFilter"],t.payload||{});return Cv({},e,{keyword:(0,O.isEmpty)(r)?null:r})}case ev:return Cv({},Av,{keyword:(0,O.isNil)(t.payload.keyword)||(0,O.isEmpty)(t.payload.keyword)?null:t.payload.keyword,searchOptions:t.payload.searchOptions||e.searchOptions,activityFilter:e.activityFilter,globalFilter:e.globalFilter,searchNavigationData:e.searchNavigationData,searchProviderData:e.searchProviderData});case tv:return Cv({},e,{activityFilter:t.payload});case rv:return Cv({},e,{globalFilter:(0,v.isEmptyValue)(t.payload)?Av.globalFilter:t.payload});case nv:return Cv({},e,{searchOptions:Cv({},e.searchOptions,t.payload)});case av:{const r=!!t.payload.showSearchByOv;return Cv({},e,{searchOptions:{searchByOv:r,ovOnly:r}})}case iv:return Cv({},e,{searchProviderData:t.payload});case ov:return Cv({},e,{searchNavigationData:t.payload});case lv:return Cv({},e,{searchNavigationData:Cv({},e.searchNavigationData,t.payload)});case Sb.OPEN_ENTITY:{var r;const n=(0,v.removeDtssPrefixFromEntityUri)(t.payload.uri);return"navigation"===t.payload.source||n===(null===(r=e.searchNavigationData)||void 0===r?void 0:r.uri)?e:Cv({},e,{searchNavigationData:null})}default:return e}},_v=({uri:e,source:t=null,screen:r="profile"})=>({type:Sb.OPEN_ENTITY,payload:{uri:e,source:t,screen:r}}),Iv=({entity:e})=>({type:Sb.NEW_ENTITY_SHOWN,payload:{entity:e}}),Nv=bb(Sb.ENTITY_DELETION_FINISHED),Pv=bb(Sb.OPEN_PERSPECTIVE),Dv=e=>({type:Sb.SHOW_NOTIFICATION,payload:e}),kv=e=>({type:Sb.CLOSE_NOTIFICATION,payload:e}),Lv=bb(Sb.CLEAR_NOTIFICATIONS),Uv=bb(Sb.PATHS_SET),jv=bb(Sb.UI_PATH_SET),Fv=bb(Sb.UI_CONFIG_LOADED),Mv=bb(Sb.NEW_UI_CONFIG_LOADED),Vv=bb(Sb.LOCALE_ATTRIBUTE_PRESENTATION_LOADED),Bv=bb(Sb.AUTOCLOSE_INTERVAL_LOADED),zv=bb(Sb.SET_PREFER_REACT),Hv=bb(Sb.NUMBER_FORMAT_UPDATED),Yv=(e,t,r)=>({type:Sb.OPEN_CONSOLE_APP,payload:{name:e,path:t,query:r}}),Wv=bb(Sb.OPEN_APP_FROM_CHOCOLATE_BAR),Gv=bb(Sb.OPEN_GRAPH),qv=bb(Sb.LOCALIZATION_LOADED),Zv=bb(Sb.DATE_MASK_UPDATED),$v=bb(Sb.DATE_TIME_MASK_UPDATED),Kv=e=>({type:Sb.OPEN_SEARCH,payload:"searchState"in e?e:{searchState:e}}),Xv=e=>({type:Sb.OPEN_DASHBOARD,payload:e}),Qv=bb(Sb.OPEN_HISTORY_EVENT),Jv=bb(Sb.OPEN_NEW_ENTITY_WITH_AUTHORING),eT=bb(Sb.OPEN_PREVIOUS_PAGE),tT=bb(Sb.NAVIGATE),rT=bb(Sb.KEYS_SET),nT=bb(Sb.OPEN_PIVOTING_PERSPECTIVE),aT=bb(Sb.ERROR_SET),iT=bb(Sb.DOCUMENTATION_SET),oT=bb(Sb.ADD_DASHBOARD_EXTERNAL_VIEW),lT=bb(Sb.SET_USE_SHARED_PREFERENCES);var sT=r(97698);function cT(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const uT=(0,O.path)(["paths","imagePath"]),pT=(0,O.path)(["paths","exportPath"]),dT=(0,O.path)(["paths","apiPath"]),mT=(0,O.path)(["paths","uiPath"]),fT=(0,O.path)(["paths","reltioPath"]),yT=(0,O.path)(["paths","dtssPath"]),gT=(0,O.path)(["paths","exportDQPath"]),hT=(0,O.either)((0,O.path)(["newConfig","properties","workflow","path"]),(0,O.path)(["paths","workflowPath"])),ET=(0,O.prop)("paths"),bT=(0,O.path)(["paths","workflowEnvironmentURL"]),vT=(0,O.path)(["paths","collaborationPath"]),TT=(0,O.path)(["paths","imageServicePath"]),OT=(0,O.path)(["paths","dvfPath"]),ST=(0,O.path)(["paths","validationServicePath"]),xT=(0,O.path)(["paths","adminToolsPath"]),CT=(0,O.path)(["paths","mlDqPath"]),wT=(0,sT.createSelector)((e=>(0,O.path)(["newConfig","properties","attributes","presentation"])(e)),(()=>v.intl.getLocale()),((e={},t)=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){cT(e,t,r[t])}))}return e}({},e,(0,v.getSpecialAttributesPresentation)(e,t)))),AT=(0,O.either)((0,O.path)(["config","com.reltio.plugins.entity.EntityRequestSettings","defaultMaxValues"]),(0,O.path)(["newConfig","properties","entity","maxValuesInResponse"])),RT=(0,O.path)(["numberFormat"]),_T=(0,O.either)((0,O.path)(["newConfig","properties","masks","dateMask"]),(0,O.path)(["dateMask"])),IT=(0,O.path)(["notifications"]),NT=(0,O.either)((0,O.path)(["newConfig","properties","masks","dateTimeMask"]),(0,O.path)(["dateTimeMask"])),PT=(0,O.path)(["newConfig","properties","requestProvider"]),DT=["config","com.reltio.plugins.pivoting.PivotingSettings","pivotingAttributes"],kT=(0,O.chain)((0,O.prop)("attributeTypes")),LT=(0,O.ifElse)((0,O.hasPath)(DT),(0,O.path)(DT),(0,O.pipe)((0,O.pathOr)([],["newConfig","pivoting"]),kT)),UT=(0,O.either)((0,O.path)(["config","com.reltio.plugins.imageattribute.fieldsorder"]),(0,O.path)(["newConfig","properties","image","attributeFieldsOrder"])),jT=(0,O.either)((0,O.path)(["config","com.reltio.plugins.ui.LookupAutocomplete"]),(0,O.path)(["newConfig","properties","lookups","autocomplete"])),FT=(0,O.path)(["keys","googleMapKey"]),MT=(0,O.path)(["keys","icpLicenseKey"]),VT=(0,O.pathOr)("",["documentation","releaseNotes"]),BT=["config","com.reltio.plugins.entity.ValidationServiceLevels","levels"],zT=(0,O.ifElse)((0,O.hasPath)(BT),(0,O.path)(BT),(0,O.path)(["newConfig","properties","validation","levels"])),HT=(0,O.ifElse)((0,O.hasPath)(["config","com.reltio.plugins.entity.Validation","validateReadMode"]),(0,O.path)(["config","com.reltio.plugins.entity.Validation","validateReadMode"]),(0,O.pathOr)(!0,["newConfig","properties","validation","validateReadMode"])),YT=(0,O.pathOr)(!1,["newConfig","properties","validation","validateRelations"]),WT=(0,O.pathOr)(!1,["newConfig","properties","validation","validateReferenceEntityInReadMode"]),GT=(0,O.either)((0,O.path)(["config","com.reltio.plugins.workflow.configuration","enabled"]),(0,O.path)(["newConfig","properties","workflow","enabled"])),qT=(0,O.path)(["error"]),ZT=(0,O.path)(["paths","servicesPath"]),$T=(0,O.path)(["newConfig"]),KT=(0,O.path)(["newConfig","layout"]),XT=(0,O.path)(["newConfig","profile"]),QT=(0,O.pathOr)(!0,["newConfig","properties","showEntityId"]),JT=(0,O.path)(["newConfig","properties","release"]),eO=(0,O.path)(["newConfig","properties","logo"]),tO=(0,O.path)(["newConfig","properties","headerColor"]),rO=(0,O.path)(["newConfig","properties","showSearchByOv"]),nO=(0,O.path)(["newConfig","properties","showAttributeDescription"]),aO=(0,O.path)(["newConfig","properties","attributes","sorting"]),iO=(0,O.path)(["newConfig","properties","profileCheckUpdate"]),oO=(0,O.pathOr)(!1,["newConfig","properties","newTreeEnabled"]),lO=(0,O.pathOr)(!1,["newConfig","properties","aiAssistant","enabled"]),sO=(0,O.pathOr)(500,["newConfig","properties","aiAssistant","messagesPerDay"]),cO=(0,O.path)(["newConfig","properties","aiAssistant","skills"]),uO=(0,O.path)(["newConfig","properties","aiAssistant","historyBufferSize"]),pO=(0,O.pathOr)(!1,["newConfig","properties","queryEstimator","enabled"]),dO=(0,O.pathOr)(!1,["newConfig","properties","sharedPreferences","enabled"]);function mO(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){fO(e,t,r[t])}))}return e}function fO(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const yO={},gO=(e=yO,t)=>{switch(t.type){case Sb.PATHS_SET:return mO({},e,{paths:t.payload});case Sb.UI_PATH_SET:return(0,O.evolve)({paths:(0,O.assoc)("uiPath",t.payload)},e);case Sb.UI_CONFIG_LOADED:return mO({},e,{config:t.payload});case Sb.NEW_UI_CONFIG_LOADED:return mO({},e,{newConfig:t.payload});case Sb.LOCALE_ATTRIBUTE_PRESENTATION_LOADED:return(0,O.evolve)({newConfig:{properties:{attributes:{presentation:(0,O.assoc)(v.LOCALE_ATTRIBUTE_PRESENTATION,t.payload)}}}},e);case Sb.AUTOCLOSE_INTERVAL_LOADED:return mO({},e,{autoCloseInterval:t.payload});case Sb.NUMBER_FORMAT_UPDATED:return mO({},e,{numberFormat:t.payload});case Sb.DATE_MASK_UPDATED:return mO({},e,{dateMask:t.payload});case Sb.DATE_TIME_MASK_UPDATED:return mO({},e,{dateTimeMask:t.payload});case Sb.KEYS_SET:return mO({},e,{keys:t.payload});case Sb.ERROR_SET:return mO({},e,{error:t.payload});case Sb.DOCUMENTATION_SET:return mO({},e,{documentation:t.payload});case Sb.SHOW_NOTIFICATION:return mO({},e,{notifications:[...e.notifications||[],t.payload]});case Sb.CLOSE_NOTIFICATION:return(0,O.evolve)({notifications:(0,O.reject)((0,O.propEq)("id",t.payload))},e);case Sb.CLEAR_NOTIFICATIONS:return mO({},e,{notifications:[]});case Sb.SET_USE_SHARED_PREFERENCES:return mO({},e,{useSharedPreferences:t.payload});default:return e}},hO="USER_UPDATED",EO=(bb(hO),(e=null,t)=>t.type===hO?t.payload||null:e),bO="TENANT_UPDATED",vO="TENANT_NAME_UPDATED",TO=(bb(bO),bb(vO),(0,O.prop)("id")),OO=(0,O.prop)("name");function SO(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){xO(e,t,r[t])}))}return e}function xO(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const CO=(e=null,t)=>{switch(t.type){case bO:return SO({},e,{id:t.payload});case vO:return SO({},e,{name:t.payload});default:return e}},wO="ENVIRONMENT_UPDATED",AO="ENVIRONMENT_ALIAS_UPDATED",RO=(bb(wO),bb(AO),(0,O.prop)("id")),_O=(0,O.prop)("alias");function IO(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){NO(e,t,r[t])}))}return e}function NO(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const PO=(e=null,t)=>{switch(t.type){case wO:return IO({},e,{id:t.payload});case AO:return IO({},e,{alias:t.payload});default:return e}},DO=e=>e.dataTenants,kO=e=>e.tenants,LO=(e,t=Cx(e))=>e.metadata&&e.metadata[t],UO=e=>e.tenant,jO=e=>e.environment,FO=e=>e.user,MO=e=>e.ui,VO=e=>e.profile,BO=e=>e.search,zO=e=>SR(VO(e)),HO=e=>FR(VO(e)),YO=e=>MR(VO(e)),WO=(e,t)=>qR(VO(e),t),GO=(e,t,r)=>YR(VO(e),t,r),qO=(e,t,r)=>WR(VO(e),t,r),ZO=(e,t,r)=>HR(VO(e),t,r),$O=(e,t)=>ZR(VO(e),t),KO=e=>$R(VO(e)),XO=(e,t,r)=>GR(VO(e),t,r),QO=e=>RR(VO(e)),JO=e=>CR(VO(e)),eS=e=>zR(VO(e)),tS=e=>v_(VO(e)),rS=e=>T_(VO(e)),nS=e=>O_(VO(e)),aS=e=>S_(VO(e)),iS=e=>x_(VO(e)),oS=(e,t)=>VR(VO(e),t),lS=(e,t)=>BR(VO(e),t),sS=e=>xR(VO(e)),cS=(e,t)=>C_(VO(e),t),uS=(e,t,{uri:r})=>o_(VO(e),t,r),pS=(e,t,{uri:r})=>l_(VO(e),t,r),dS=(e,t,r)=>s_(VO(e),t,r),mS=e=>uT(MO(e)),fS=e=>dT(MO(e)),yS=e=>pT(MO(e)),gS=e=>mT(MO(e)),hS=e=>fT(MO(e)),ES=e=>TT(MO(e)),bS=e=>xT(MO(e)),vS=e=>wT(MO(e)),TS=e=>RT(MO(e)),OS=e=>AT(MO(e)),SS=e=>(e=>e.autoCloseInterval)(MO(e)),xS=e=>_T(MO(e)),CS=e=>NT(MO(e)),wS=e=>PT(MO(e)),AS=e=>IT(MO(e)),RS=e=>LT(MO(e)),_S=e=>UT(MO(e)),IS=e=>jT(MO(e)),NS=e=>FT(MO(e)),PS=e=>MT(MO(e)),DS=e=>zT(MO(e)),kS=e=>HT(MO(e)),LS=e=>YT(MO(e)),US=e=>WT(MO(e)),jS=e=>lO(MO(e)),FS=e=>sO(MO(e)),MS=e=>cO(MO(e)),VS=e=>uO(MO(e)),BS=e=>dO(MO(e)),zS=e=>(e=>e.searchResults)(BO(e)),HS=e=>(e=>e.keyword)(BO(e)),YS=e=>v.getActivityFilter(BO(e)),WS=e=>v.getSearchOptions(BO(e)),GS=e=>(e=>e.searchProviderData)(BO(e)),qS=e=>(e=>e.searchNavigationData)(BO(e)),ZS=(e,t)=>v.getGlobalSearchRequestOptions(BO(e),t),$S=e=>v.getStringifiedSearchOptions(BO(e)),KS=e=>(e=>e.globalFilter)(BO(e)),XS=e=>v.getGlobalFilterQuery(BO(e)),QS=e=>vv(BO(e)),JS=e=>IR(VO(e)),ex=e=>KR(VO(e)),tx=e=>XR(VO(e)),rx=e=>QR(VO(e)),nx=e=>wR(VO(e)),ax=(e,t)=>JR(VO(e),t),ix=(e,t)=>e_(VO(e),t),ox=(e,t)=>t_(VO(e),t),lx=(e,t,r)=>r_(VO(e),t,r),sx=(e,t,r)=>n_(VO(e),t,r),cx=(e,t,r)=>a_(VO(e),t,r),ux=(e,t)=>i_(VO(e),t),px=e=>uT(MO(e))||dT(MO(e)),dx=e=>(e=>null==e?void 0:e.username)(FO(e)),mx=e=>(e=>null==e?void 0:e.roles)(FO(e)),fx=e=>AR(VO(e)),yx=(e,t)=>c_(VO(e),t),gx=(e,t)=>u_(VO(e),t),hx=(e,t)=>p_(VO(e),t),Ex=e=>d_(VO(e)),bx=(e,t,r)=>m_(VO(e),t,r),vx=(e,t)=>f_(VO(e),t),Tx=e=>NR(VO(e)),Ox=e=>DR(VO(e)),Sx=e=>kR(VO(e)),xx=e=>I_(VO(e),ZC(e)),Cx=e=>TO(UO(e)),wx=e=>OO(UO(e)),Ax=e=>RO(jO(e)),Rx=e=>_O(jO(e)),_x=e=>yT(MO(e)),Ix=e=>gT(MO(e)),Nx=e=>hT(MO(e)),Px=e=>ET(MO(e)),Dx=e=>bT(MO(e)),kx=e=>GT(MO(e)),Lx=e=>vT(MO(e)),Ux=e=>OT(MO(e)),jx=e=>ST(MO(e)),Fx=e=>CT(MO(e)),Mx=(0,sT.createSelector)(FO,Cx,v.canUserRegisterConfigEnvironments),Vx=(0,sT.createSelector)(FO,Cx,v.canUserCreateWorkflowConfigJar),Bx=(0,sT.createSelector)(FO,Cx,v.canUserCreateWorkflowEnvironmentConfigJar),zx=(0,sT.createSelector)(FO,Cx,v.canUserExecuteWorkflowJobs),Hx=(0,sT.createSelector)(FO,Cx,v.canUserExecuteWorkflowJobsSyncBusinessProcessData),Yx=(0,sT.createSelector)(FO,Cx,v.canUserExecuteWorkflowJobsTerminateProcessInstance),Wx=(0,sT.createSelector)(FO,Cx,v.canUserExecuteWorkflowJobsUpdateTasks),Gx=(0,sT.createSelector)(FO,Cx,v.canUserExecuteWorkflowJobsValidateTasks),qx=(0,sT.createSelector)(FO,Cx,v.canUserManageWorkflowDefinition),Zx=(0,sT.createSelector)(FO,Cx,v.canUserManageWorkflowEnvironmentDefinition),$x=(0,sT.createSelector)(FO,Cx,v.canUserReadWorkflowDataTask),Kx=(0,sT.createSelector)(FO,Cx,v.canUserUpdateProcessInstance),Xx=(0,sT.createSelector)(FO,Cx,v.canUserUpdateWorkflowDataTask),Qx=(0,sT.createSelector)(FO,Cx,v.canUserViewProcessInstanceSearchQuery),Jx=(0,sT.createSelector)(FO,Cx,v.canUserViewWorkflowConfigJar),eC=(0,sT.createSelector)(FO,Cx,v.canUserViewWorkflowDefinition),tC=(0,sT.createSelector)(FO,Cx,v.canUserViewWorkflowEnvironmentConfigJar),rC=(0,sT.createSelector)(FO,Cx,v.canUserViewWorkflowJobs),nC=(0,sT.createSelector)(FO,Cx,v.canUserMakeExport),aC=(0,sT.createSelector)(FO,Cx,v.canUserMakeActivitiesExport),iC=(0,sT.createSelector)(FO,Cx,v.canUserImportEntitiesFromDT),oC=(0,sT.createSelector)(FO,Cx,v.canUserReadEntitiesFromDT),lC=(0,sT.createSelector)(FO,Cx,v.canUserStartProcessInstanceFromQuery),sC=(0,sT.createSelector)(FO,Cx,v.canUserMakeBulkUpdate),cC=(0,sT.createSelector)(FO,Cx,v.canUserDeleteProfiles),uC=(0,sT.createSelector)(FO,Cx,v.canUserOpenDataLoader),pC=(0,sT.createSelector)(FO,Cx,v.canUserGetDQStatistic),dC=(0,sT.createSelector)(FO,Cx,v.canUserReadDVF),mC=(0,sT.createSelector)(Lx,aS,((e,t)=>!!e&&!t)),fC=(0,sT.createSelector)(Nx,kx,((e,t)=>!!e&&!!t)),yC=(e,t)=>{var r;return null===(r=LR(VO(e)))||void 0===r?void 0:r.find((0,O.propEq)("id",t))},gC=(e,t)=>Boolean(yC(e,t)),hC=e=>gC(e,v.SidePanelViewId.Workflow),EC=e=>gC(e,v.SidePanelViewId.Discussion),bC=e=>gC(e,v.SidePanelViewId.History),vC=e=>gC(e,v.SidePanelViewId.DB),TC=e=>{var t;return(null===(t=yC(e,v.SidePanelViewId.DB))||void 0===t?void 0:t.views)??[]},OC=e=>_R(VO(e)),SC=e=>y_(VO(e)),xC=(e,t)=>g_(VO(e),t),CC=e=>h_(VO(e)),wC=e=>E_(VO(e)),AC=(e,t)=>b_(VO(e),t),RC=e=>qT(MO(e)),_C=(e,t)=>{const r=LO(e),n=JS(e),a=zO(e),{nextEntry:i,inRelations:o=[],outRelations:l=[]}=t,s=n===v.Mode.Editing||n===v.Mode.Suggesting,c=n===v.Mode.Suggesting&&(0,v.isTempUri)(null==a?void 0:a.uri),u=ZC(e);if(!s||c&&!u||i||!a)return!1;{const e=(0,v.checkMetadataForUpdate)(n,(0,v.getEntityType)(r,a.type)),t=o.concat(l).map((e=>(0,v.getRelationType)(r,e.uri||e))).some((0,O.both)((0,v.checkMetadataForCreate)(n),(0,v.checkMetadataForUpdate)(n)));return e&&t}},IC=(0,sT.createSelector)(zO,tx,nS,tS,v.getProfileEntityWithHistoryDiff),NC=(0,sT.createSelector)(zO,tx,nS,v.getProfileEntityWithoutHistoryDiff),PC=e=>ZT(MO(e)),DC=e=>$T(MO(e)),kC=e=>KT(MO(e)),LC=e=>XT(MO(e)),UC=e=>QT(MO(e)),jC=e=>JT(MO(e)),FC=e=>VT(MO(e)),MC=e=>eO(MO(e)),VC=e=>tO(MO(e)),BC=e=>rO(MO(e)),zC=e=>nO(MO(e)),HC=e=>aO(MO(e)),YC=e=>iO(MO(e)),WC=(e,t)=>((e,t)=>(0,v.getAuthoringItemsFromLayoutByEntityType)(XT(e),t))(MO(e),t),GC=(e,t)=>((e,t)=>(0,O.path)(["newConfig","properties","cleanse",t])(e))(MO(e),t),qC=e=>oO(MO(e)),ZC=e=>{const t=zO(e),r=WC(e,null==t?void 0:t.type);return!(0,v.isEmptyValue)(r)},$C=e=>pO(MO(e)),KC=e=>UR(VO(e)),XC=e=>jR(VO(e)),QC=(e,t)=>fC(e)&&lC(e)&&(0,v.checkMetadataPermission)(v.MetadataPermissions.INITIATE_CHANGE_REQUEST,t);let JC=function(e){return e.MODIFIED_ENTITY_CREATED="MODIFIED_ENTITY_CREATED",e.MODIFIED_ENTITY_DELETED="MODIFIED_ENTITY_DELETED",e.MODIFIED_ENTITY_DEFAULT_PROFILE_PIC_SET="MODIFIED_ENTITY_DEFAULT_PROFILE_PIC_SET",e.MODIFIED_ENTITIES_RESET="MODIFIED_ENTITIES_RESET",e.CLEANSE_LOADING="CLEANSE_LOADING",e}({}),ew=function(e){return e.RELATIONS_LOADED="RELATIONS_LOADED",e.REMOVE_RELATION="REMOVE_RELATION",e.EDIT_RELATION="EDIT_RELATION",e.ADD_RELATION="ADD_RELATION",e.OPEN_RELATION_EDITOR="OPEN_RELATION_EDITOR",e.CLOSE_RELATION_EDITOR="CLOSE_RELATION_EDITOR",e.SET_RELATION_TYPE="SET_RELATION_TYPE",e.SET_RELATION_ENTITY="SET_RELATION_ENTITY",e.SET_INITIAL_INFO="SET_INITIAL_INFO",e.IGNORE_RELATION="IGNORE_RELATION",e.SECOND_LEVEL_RELATIONS_LOADED="SECOND_LEVEL_RELATIONS_LOADED",e.UPDATE_RELATION_RATING="UPDATE_RELATION_RATING",e}({});var tw=r(51095);const rw=(e,t)=>e.find((0,O.pipe)(v.getRelationUriFromConnection,(0,O.equals)(t))),nw=(e,t)=>(0,O.path)([t,"connections"],e),aw=r.n(tw)()(nw,((e,t)=>(0,O.path)([t,"drafts"],e)),((e,t,r)=>r),((e=[],t={},r)=>{var n;const{addedConnections:a=[],editedConnections:i=[],removedUris:o=[],ignoredRelationData:l=[]}=t,s=(0,O.pipe)(v.getRelationUriFromConnection,O.equals,(0,O.find)(O.__,o)),c=l.map((e=>e.relationUri)),u=(0,O.pipe)(v.getRelationUriFromConnection,O.equals,(0,O.find)(O.__,c)),p=r?(null===(n=e.find((e=>e.entity.entityUri===r)))||void 0===n?void 0:n.connections)||[]:e,d=a.filter((0,O.propEq)("parentEntityUri",r));return d.map(v.markNew).concat(p.filter((e=>!d.some((0,O.pipe)(v.getRelationUriFromConnection,(0,O.equals)((0,v.getRelationUriFromConnection)(e)))))).map((0,O.pipe)((0,O.either)((e=>(0,O.pipe)((0,O.eqBy)(v.getRelationUriFromConnection),(0,O.find)(O.__,i),(0,O.unless)(O.isNil,v.markEdited))(e)),O.identity),(0,O.when)(s,v.markRemoved),(0,O.when)(u,v.markIgnored))))}))(((e,t,r)=>t+r)),iw=(e,t,r)=>{const n=(0,v.getTempRelations)(e,t);return rw(n,r)};function*ow(e){yield(0,Ia.gw)(0);const t=e.payload,r=yield(0,Ia.Ys)(LO),n=yield(0,Ia.Ys)(SC),a=[t.type],i=yield(0,Ia.Ys)(CC),o=(0,v.initDependentLookups)({structure:n,metadata:r,typeUris:a,alreadyAddedTypeUris:i}),l=(0,v.populateDependentLookupsFromEntity)({structure:o,metadata:r,entityOrRelation:t});yield(0,Ia.gz)(Yb(l)),yield(0,Ia.gz)(Wb(a))}function*lw(e,t){const r=(0,v.getBaseUri)(e);return(0,v.isRelationUri)(r)?yield(0,Ia.Ys)(qO,t,r):yield(0,Ia.Ys)(oS,r)}function*sw(e){const{attributeType:t,metadata:r,parentUri:n,viewId:a}=e.payload,i=yield(0,Ia.RE)(lw,n,a),o=yield(0,Ia.Ys)(SC);if(i)if(t){const e=(0,v.findAttributeValuesByTypeUri)(r,i,t.uri).filter((({uri:e})=>e.startsWith(n)))[0],a=(0,v.addValueToDependentLookups)({structure:o,attributeValue:e});yield(0,Ia.gz)(Yb(a))}else{const e=[i.type],t=yield(0,Ia.Ys)(CC),n=(0,v.initDependentLookups)({structure:o,metadata:r,typeUris:e,alreadyAddedTypeUris:t}),a=(0,v.populateDependentLookupsFromEntity)({structure:n,metadata:r,entityOrRelation:i});yield(0,Ia.gz)(Yb(a)),yield(0,Ia.gz)(Wb(e))}}function*cw(e){const t=e.payload,r=yield(0,Ia.Ys)(LO),n=yield(0,Ia.Ys)(SC);let a=n;for(const e of t){const{attributeType:t,parentUri:i,viewId:o}=e;if((0,v.isAttributeTypeInDependentLookups)(n,t.uri)){const e=yield(0,Ia.RE)(lw,i,o);e&&(a=(0,v.syncAttributeTypeWithDependentLookups)({structure:a,entityOrRelation:e,attrTypeUri:t.uri,metadata:r}))}}a!==n&&(yield(0,Ia.gz)(Yb(a)))}function*uw({structure:e,attributeType:t,value:r}){if((0,v.isReference)(t)&&r){const t=(0,v.getReferencedEntityUriFromAttrValue)(r);if((0,v.isTempUri)(t))return yield(0,Ia.RE)(fw,e,t)}return e}function*pw({structure:e,uri:t,attributeType:r,value:n}){let a=(0,v.removeValuesFromDependentLookups)({structure:e,uri:t});if(a=yield(0,Ia.RE)(uw,{structure:a,attributeType:r,value:n}),a=(0,v.addValueToDependentLookups)({structure:a,attributeValue:n}),(0,v.isReference)(r)&&n){const e=(0,v.getReferencedEntityUriFromAttrValue)(n);(0,v.isTempUri)(e)&&(a=yield(0,Ia.RE)(mw,a,e))}a!==e&&(yield(0,Ia.gz)(Yb(a)))}function*dw(e){yield(0,Ia.gw)(0);const{attributeType:t,uri:r,viewId:n,silent:a,value:i}=e.payload,o=yield(0,Ia.Ys)(SC),l=yield(0,Ia.RE)(lw,r,n);if(l&&(0,v.isAttributeTypeInDependentLookups)(o,t.uri)){const{value:n,lookupCode:i}=e.payload.value,l=i||n;a||(yield(0,Ia.rM)(hw,o,{type:t.uri,uri:r,lookupValue:l}));const s=(0,v.addValueToDependentLookups)({structure:o,attributeValue:{type:t.uri,value:l,uri:r}});yield(0,Ia.gz)(Yb(s))}l&&(0,v.isComplexAttribute)(t.type)&&(yield(0,Ia.RE)(pw,{structure:o,uri:r,attributeType:t,value:i}))}function*mw(e,t){const r=yield(0,Ia.Ys)(LO),n=yield(0,Ia.Ys)(oS,t);if(!n)return e;const a=yield(0,Ia.Ys)(sS),i=(0,v.findRelatedTemporaryEntities)(a,n);let o=e;for(const e of[n,...i])o=(0,v.populateDependentLookupsFromEntity)({structure:o,metadata:r,entityOrRelation:e});return o}function*fw(e,t){const r=yield(0,Ia.Ys)(oS,t),n=yield(0,Ia.Ys)(sS),a=(0,v.findRelatedTemporaryEntities)(n,r).map((0,O.prop)("uri"));let i=e;for(const e of[t,...a])i=(0,v.removeValuesFromDependentLookups)({structure:i,uri:e});return i}function*yw(e){const{attributeType:t,uri:r,attributeValue:n,viewId:a}=e.payload,i=yield(0,Ia.Ys)(SC),o=(0,v.isAttributeTypeInDependentLookups)(i,t.uri);if(yield(0,Ia.RE)(lw,r,a)){o&&(yield(0,Ia.rM)(hw,i,{type:t.uri,uri:r,lookupValue:""}));let e=o||(0,v.isComplexAttribute)(t)?(0,v.removeValuesFromDependentLookups)({structure:i,uri:r}):i;e=yield(0,Ia.RE)(uw,{structure:e,attributeType:t,value:n}),e!==i&&(yield(0,Ia.gz)(Yb(e)))}}function*gw(e){yield(0,Ia.gw)(0);const t=yield(0,Ia.Ys)(SC),r=yield(0,Ia.RE)(fw,t,e.payload);yield(0,Ia.gz)(Yb(r))}function*hw(e,t){const r=yield(0,Ia.Ys)(LO),n=yield(0,Ia.Ys)(sS),a=yield(0,Ia.Ys)(ox),i=yield(0,Ia.Ys)(HO),o=yield(0,Ia.Ys)(IS),l=yield(0,Ia.Ys)(wC),s=yield(0,Ia.Ys)(KC),c=(0,v.getDependentLookupStateForValueUri)({structure:e,typeUri:t.type,valueUri:t.uri,modifiedEntities:n,connections:a,entityUri:i,config:o,editorsState:l,hiddenAttributes:s[i]??[]});if(c.length>0){const e=c.map((e=>e.uri));yield(0,Ia.gz)(Gb({uris:e,isBlocked:!0}));try{const e=yield(0,Ia.RE)(v.cascadeUpdate,c,t);for(const n of e){const{type:e,uri:a,lookupValue:i,displayName:o}=n,l=(yield(0,Ia.Ys)(ux,(0,v.getBaseUri)(a)))[0],s=yield(0,Ia.RE)(lw,a,l);s&&(0,v.findAttributeValueByUri)(s,a)&&a!==t.uri&&(yield(0,Ia.gz)(Pb({attributeType:(0,v.findAttributeTypeByUri)(r,e),uri:a,value:{value:o||"",lookupCode:i||""},silent:!0,viewId:l})))}}catch(e){console.warn(e)}yield(0,Ia.gz)(Gb({uris:e,isBlocked:!1}))}}function*Ew(e){const t=e.payload.connection,r=(0,v.getEntityUriFromConnection)(t);if((0,v.isTempUri)(r)&&(yield(0,Ia.Ys)(oS,r))){yield(0,Ia.qn)(Hb.DEPENDENT_LOOKUPS_STRUCTURE_SET);const e=yield(0,Ia.Ys)(SC),t=yield(0,Ia.RE)(mw,e,r);yield(0,Ia.gz)(Yb(t))}}function*bw(e){const t=e.payload.relationUri,r=yield(0,Ia.Ys)(SC),n=(0,v.removeValuesFromDependentLookups)({structure:r,uri:t});yield(0,Ia.gz)(Yb(n))}function*vw(e){const t=e.payload.id,r=e.payload.relationUri;if(0===(yield(0,Ia.Ys)(ux,r)).length){const e=yield(0,Ia.Ys)(SC);let n=(0,v.removeValuesFromDependentLookups)({structure:e,uri:r});const a=yield(0,Ia.Ys)(ZO,t),i=rw(a,r),o=(0,v.getEntityUriFromConnection)(i);(0,v.isTempUri)(o)&&(n=yield(0,Ia.RE)(fw,n,o)),yield(0,Ia.gz)(Yb(n))}}const Tw=[function*(){yield(0,Ia.ib)(JC.MODIFIED_ENTITY_CREATED,ow)},function*(){yield(0,Ia.ib)(JC.MODIFIED_ENTITY_DELETED,gw)},function*(){yield(0,Ia.ib)(_b.ADD_DEFAULT_VALUES,sw)},function*(){yield(0,Ia.ib)(_b.ADD_ATTRIBUTES,cw)},function*(){yield(0,Ia.ib)(_b.MODIFY_ATTRIBUTE,dw)},function*(){yield(0,Ia.ib)(_b.REMOVE_ATTRIBUTE,yw)},function*(){yield(0,Ia.ib)(ew.OPEN_RELATION_EDITOR,Ew)},function*(){yield(0,Ia.ib)(ew.SET_RELATION_TYPE,bw)},function*(){yield(0,Ia.ib)(ew.CLOSE_RELATION_EDITOR,vw)}];let Ow=function(e){return e.ENTITY_LOADED="ENTITY_LOADED",e.DEFAULT_PROFILE_PIC_SET="DEFAULT_PROFILE_PIC_SET",e.LOAD_ENTITY="LOAD_ENTITY",e.ENTITY_CREATION_REQUESTED="ENTITY_CREATION_REQUESTED",e.ENTITY_CREATION_WITH_AUTHORING_REQUESTED="ENTITY_CREATION_WITH_AUTHORING_REQUESTED",e.ENTITY_REMOVE_REQUESTED="ENTITY_REMOVE_REQUESTED",e.CLEAR_ENTITY="CLEAR_ENTITY",e.CLONE_ENTITY="CLONE_ENTITY",e.ENTITY_AUTHORING_DRAFT_ENTITIES_LOADED="ENTITY_AUTHORING_DRAFT_ENTITIES_LOADED",e.AUTHORING_DCR_RESOLVED="AUTHORING_DCR_RESOLVED",e}({});const Sw=(e,t)=>({type:Ow.ENTITY_LOADED,payload:{entity:e,silent:t}}),xw=bb(Ow.DEFAULT_PROFILE_PIC_SET),Cw=bb(Ow.LOAD_ENTITY),ww=bb(Ow.ENTITY_CREATION_REQUESTED),Aw=bb(Ow.ENTITY_CREATION_WITH_AUTHORING_REQUESTED),Rw=bb(Ow.ENTITY_AUTHORING_DRAFT_ENTITIES_LOADED),_w=bb(Ow.AUTHORING_DCR_RESOLVED),Iw=bb(Ow.ENTITY_REMOVE_REQUESTED),Nw=bb(Ow.CLONE_ENTITY),Pw=bb(Ow.CLEAR_ENTITY),Dw=e=>null==e?void 0:e.uri,kw=(0,sT.createSelector)((e=>null==e?void 0:e.dataTenant),Dw,((e,t)=>(0,v.getEntityUriForLink)({dataTenant:e,uri:t})));function Lw(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Uw={};let jw=function(e){return e.ERRORS_SET="ERRORS_SET",e.REMOVE_ERROR="REMOVE_ERROR",e.ERROR_DEACTIVATED="ERROR_DEACTIVATED",e}({});const Fw=bb(jw.ERROR_DEACTIVATED),Mw=bb(jw.ERRORS_SET);function Vw(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Bw=[];let zw=function(e){return e.HISTORY_DIFF_SET="HISTORY_DIFF_SET",e.HISTORY_DIFF_CLEARED="HISTORY_DIFF_CLEARED",e.HISTORY_EVENT_SET="HISTORY_EVENT_SET",e.HISTORY_EVENT_CLEARED="HISTORY_EVENT_CLEARED",e.HISTORY_SLICE_SET="HISTORY_SLICE_SET",e.HISTORY_MODE_SET="HISTORY_MODE_SET",e}({});const Hw=bb(zw.HISTORY_DIFF_SET),Yw=bb(zw.HISTORY_DIFF_CLEARED),Ww=bb(zw.HISTORY_EVENT_SET),Gw=bb(zw.HISTORY_EVENT_CLEARED),qw=bb(zw.HISTORY_SLICE_SET),Zw=bb(zw.HISTORY_MODE_SET);function $w(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Kw(e,t,r[t])}))}return e}function Kw(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Xw={mode:v.HistoryMode.Current};let Qw=function(e){return e.PROFILE_LAST_LOADED_TIME_UPDATE="PROFILE_LAST_LOADED_TIME_UPDATE",e}({});bb(Qw.PROFILE_LAST_LOADED_TIME_UPDATE);let Jw=function(e){return e.LOOKUPS_LOADED="LOOKUPS_LOADED",e.LOOKUPS_FOR_TYPE_RESOLVED="LOOKUPS_FOR_TYPE_RESOLVED",e.LOOKUPS_LIST_RESOLVED="LOOKUPS_LIST_RESOLVED",e}({});const eA=bb(Jw.LOOKUPS_LOADED),tA=bb(Jw.LOOKUPS_FOR_TYPE_RESOLVED),rA=bb(Jw.LOOKUPS_LIST_RESOLVED);function nA(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){aA(e,t,r[t])}))}return e}function aA(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const iA={},oA=(e,t)=>({type:Zb.MODE_UPDATED,payload:{mode:e,silent:t}}),lA=bb(Zb.MODE_UPDATE_REQUESTED),sA=bb(Zb.MODE_EDITING_CANCELED),cA=v.isSuggestMode,uA=(v.isEditMode,v.isViewMode),pA=v.isEditableMode,dA=v.Mode.Viewing,mA=bb(JC.MODIFIED_ENTITY_CREATED),fA=bb(JC.MODIFIED_ENTITY_DELETED),yA=bb(JC.MODIFIED_ENTITY_DEFAULT_PROFILE_PIC_SET),gA=bb(JC.MODIFIED_ENTITIES_RESET),hA=bb(JC.CLEANSE_LOADING);function EA(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){bA(e,t,r[t])}))}return e}function bA(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const vA={};function TA(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){OA(e,t,r[t])}))}return e}function OA(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*SA(e){const{values:t,parentUri:r,attributeTypeUri:n,attributeTypeName:a}=e.payload;let i=t;const o=yield(0,Ia.Ys)(zO);if(r===o.uri){const e=(0,v.getAttributeSource)(n),r=(0,O.pipe)((0,O.pathOr)([],[e,a]),(0,O.map)((0,O.prop)("uri")))(o),l=(0,O.intersection)(r,t.map((0,O.prop)("uri")));i=t.filter((e=>!l.includes(e.uri)))}i.length&&(yield(0,Ia.gz)(kb(TA({},e.payload,{values:i}))))}function*xA(){return{apiPath:yield(0,Ia.Ys)(fS),tenant:yield(0,Ia.Ys)(Cx)}}function*CA(e){const{attributeTypeName:t,attributeTypeUri:r}=e.payload,n=yield(0,Ia.RE)(xA);try{const a=yield(0,Ia.RE)(v.getPagedEntity,TA({},e.payload,n)),i=(0,v.getAttributeSource)(r),o=(0,O.pathOr)([],[i,t],a);yield(0,Ia.gz)(Lb(TA({},e.payload,{values:o})))}catch(e){console.warn(e),yield(0,Ia.gz)(aT((0,v.getRequestErrorMessage)(e,li().text("Something went wrong"))))}}function*wA(e){var t;const{attributeType:r,value:n,uri:a}=e.payload,i=r.uri,o=(0,v.getBaseUri)(i),l=yield(0,Ia.Ys)(GC,o);if(!l)return;const s=yield(0,Ia.Ys)(LO),c=(0,v.getEntityType)(s,o),u=null==c||null===(t=c.cleanseConfig)||void 0===t?void 0:t.infos;if(!u)return;const p=(0,v.getCleanseType)(l,i);if(!(0,v.hasCleanseTypeInEntityType)(p,u))return;const d=(0,v.getCleanseAttributes)(l);if(null!=d&&d.includes(i)){yield(0,Ia.gz)(hA({isLoading:!0}));try{const e=yield(0,Ia.RE)(v.cleanseData,{cleanseType:p.split("/cleanse/infos/")[1],type:o,attributes:{[r.name]:[{type:i,value:n}]}}),t=(0,v.getBaseUri)(a),l=yield(0,Ia.Ys)(oS,t);if((0,v.hasCleanseStatus)(e))if((0,v.isUnverifiedCleanse)(e))yield(0,Ia.gz)(aT((0,O.path)(v.CLEANSE_STATUS_ERROR_PATH,e)));else if(l){const{attributes:r}=e,n=(0,v.prepareCleansedAttributes)(t,r);yield(0,Ia.gz)(mA(TA({},l,{attributes:TA({},l.attributes,n)})))}}catch(e){console.warn(e),yield(0,Ia.gz)(aT((0,v.getRequestErrorMessage)(e,li().text("Something went wrong"))))}yield(0,Ia.gz)(hA({isLoading:!1}))}}const AA=[function*(){yield(0,Ia.ib)(_b.REQUEST_NEXT_PAGE_ATTRIBUTE_VALUES,CA)},function*(){yield(0,Ia.ib)(_b.PROCESS_NEXT_PAGE_ATTRIBUTE_VALUES,SA)},function*(){yield(0,Ia.ib)(_b.MODIFY_ATTRIBUTE,wA)}],RA=bb(ew.RELATIONS_LOADED),_A=bb(ew.SECOND_LEVEL_RELATIONS_LOADED),IA=(0,O.curry)(((e,t)=>({type:ew.REMOVE_RELATION,payload:{id:e,relationUri:t}}))),NA=(0,O.curry)(((e,t)=>({type:ew.IGNORE_RELATION,payload:{id:e,ignoredRelationData:t}}))),PA=(0,O.curry)(((e,t)=>({type:ew.ADD_RELATION,payload:{id:e,connection:t}}))),DA=(0,O.curry)(((e,t)=>({type:ew.EDIT_RELATION,payload:{id:e,connection:t}}))),kA=(0,O.curry)(((e,t,r,n)=>({type:ew.UPDATE_RELATION_RATING,payload:{id:e,connection:t,rating:r,user:n}}))),LA=(0,O.curry)(((e,t)=>({type:ew.OPEN_RELATION_EDITOR,payload:{id:e,connection:t}}))),UA=(0,O.curry)(((e,t)=>({type:ew.CLOSE_RELATION_EDITOR,payload:{id:e,relationUri:t}}))),jA=(0,O.curry)(((e,t,r)=>({type:ew.SET_RELATION_TYPE,payload:{id:e,relationUri:t,relationType:r}}))),FA=(0,O.curry)(((e,t,r)=>({type:ew.SET_RELATION_ENTITY,payload:{id:e,relationUri:t,entityInfo:r}}))),MA=(0,O.curry)(((e,t,r)=>({type:ew.SET_INITIAL_INFO,payload:{id:e,relationUri:t,tempEntity:r}})));function VA(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){BA(e,t,r[t])}))}return e}function BA(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const zA={},HA={removedUris:[],addedConnections:[],editedConnections:[],ignoredRelationData:[]},YA=(e,t,r)=>{if((0,O.pathEq)([...(0,v.getRelationToAddPath)(e),"relation","relationUri"],t,r))return(0,v.getRelationToAddPath)(e);{const n=((0,O.path)((0,v.getRelationsToEditPath)(e),r)||[]).findIndex((0,O.pathEq)(["relation","relationUri"],t));return n>=0?[...(0,v.getRelationsToEditPath)(e),n]:null}},WA=(e,t,r)=>{const n=YA(e,t,r);return n?(0,O.lensPath)([...n,"relation"]):null},GA=(0,O.pipe)(WA,(e=>(0,O.compose)(e,(0,O.lensProp)("object"))));let qA=function(e){return e.TREES_RESET_INITIAL_TREES="TREES_RESET_INITIAL_TREES",e.TREES_RESTORE_FROM_INITIAL_TREES="TREES_RESTORE_FROM_INITIAL_TREES",e.TREES_STATE_RESTORED="TREES_STATE_RESTORED",e.TREES_STATE_SAVED="TREES_STATE_SAVED",e.TREE_ACTIVENESS_DATE_CHANGED="TREE_ACTIVENESS_DATE_CHANGED",e.TREE_CHANGED="TREE_CHANGED",e.TREE_CHILDREN_LOADED="TREE_CHILDREN_LOADED",e.TREE_CHILDREN_LOADING="TREE_CHILDREN_LOADING",e.TREE_COMMANDS_CLEARED="TREE_COMMANDS_CLEARED",e.TREE_CURRENT_ENTITY_SHOWN="TREE_CURRENT_ENTITY_SHOWN",e.TREE_ENTITIES_MAPPING_LOADED="TREE_ENTITIES_MAPPING_LOADED",e.TREE_LOADED="TREE_LOADED",e.TREE_LOADED_WITH_ERROR="TREE_LOADED_WITH_ERROR",e.TREE_LOADING="TREE_LOADING",e.TREE_NODE_CREATED="TREE_NODE_CREATED",e.TREE_NODE_EDITED="TREE_NODE_EDITED",e.TREE_NODE_EDITING_APPLIED="TREE_NODE_EDITING_APPLIED",e.TREE_NODE_EDITING_CANCELED="TREE_NODE_EDITING_CANCELED",e.TREE_NODE_EDITING_STARTED="TREE_NODE_EDITING_STARTED",e.TREE_NODE_ENTITY_CHANGED="TREE_NODE_ENTITY_CHANGED",e.TREE_NODE_EXPANDED="TREE_NODE_EXPANDED",e.TREE_NODE_NEW_CHILD_EDITING_APPLIED="TREE_NODE_NEW_CHILD_EDITING_APPLIED",e.TREE_NODE_NEW_CHILD_EDITING_CANCELED="TREE_NODE_NEW_CHILD_EDITING_CANCELED",e.TREE_NODE_NEW_CHILD_EDITING_STARTED="TREE_NODE_NEW_CHILD_EDITING_STARTED",e.TREE_NODE_NEW_PARENT_EDITING_APPLIED="TREE_NODE_NEW_PARENT_EDITING_APPLIED",e.TREE_NODE_NEW_PARENT_EDITING_CANCELED="TREE_NODE_NEW_PARENT_EDITING_CANCELED",e.TREE_NODE_NEW_PARENT_EDITING_STARTED="TREE_NODE_NEW_PARENT_EDITING_STARTED",e.TREE_NODE_RELATION_TYPE_CHANGED="TREE_NODE_RELATION_TYPE_CHANGED",e.TREE_NODE_REMOVED="TREE_NODE_REMOVED",e.TREE_SECONDARY_LABEL_SHOWN="TREE_SECONDARY_LABEL_SHOWN",e.TREE_SCROLL_TO_NODE_RESET="TREE_SCROLL_TO_NODE_RESET",e.TREE_SORTED="TREE_SORTED",e.TREE_REFRESHED="TREE_REFRESHED",e.TREE_RELATION_CREATED="TREE_RELATION_CREATED",e.TREE_RELATION_EDITED="TREE_RELATION_EDITED",e.TREE_RELATION_REMOVED="TREE_RELATION_REMOVED",e.TREE_RELATION_REPOINTED="TREE_RELATION_REPOINTED",e.TREE_CANCEL_CHILDREN_LOADING="TREE_CANCEL_CHILDREN_LOADING",e}({});bb(qA.TREE_LOADED),bb(qA.TREE_LOADED_WITH_ERROR),bb(qA.TREE_LOADING),bb(qA.TREE_SCROLL_TO_NODE_RESET);const ZA=bb(qA.TREE_COMMANDS_CLEARED),$A=(bb(qA.TREE_CHILDREN_LOADING),bb(qA.TREE_CURRENT_ENTITY_SHOWN),bb(qA.TREE_REFRESHED),bb(qA.TREE_NODE_EXPANDED),bb(qA.TREE_RELATION_REMOVED),bb(qA.TREE_NODE_REMOVED),bb(qA.TREE_SECONDARY_LABEL_SHOWN),bb(qA.TREE_ENTITIES_MAPPING_LOADED),bb(qA.TREE_CHANGED)),KA=(bb(qA.TREE_NODE_EDITED),bb(qA.TREE_ACTIVENESS_DATE_CHANGED),bb(qA.TREE_RELATION_REPOINTED),bb(qA.TREE_RELATION_CREATED),bb(qA.TREE_NODE_CREATED),bb(qA.TREE_RELATION_EDITED),bb(qA.TREE_NODE_EDITED),bb(qA.TREE_NODE_EDITING_STARTED),bb(qA.TREE_NODE_EDITING_APPLIED),bb(qA.TREE_NODE_EDITING_CANCELED),bb(qA.TREE_NODE_NEW_PARENT_EDITING_STARTED),bb(qA.TREE_NODE_NEW_PARENT_EDITING_APPLIED),bb(qA.TREE_NODE_NEW_PARENT_EDITING_CANCELED),bb(qA.TREE_NODE_NEW_CHILD_EDITING_STARTED),bb(qA.TREE_NODE_NEW_CHILD_EDITING_APPLIED),bb(qA.TREE_NODE_NEW_CHILD_EDITING_CANCELED),bb(qA.TREE_NODE_RELATION_TYPE_CHANGED),bb(qA.TREE_NODE_ENTITY_CHANGED),bb(qA.TREE_SORTED),bb(qA.TREES_STATE_SAVED),bb(qA.TREES_STATE_RESTORED),bb(qA.TREE_CHILDREN_LOADED),bb(qA.TREES_RESTORE_FROM_INITIAL_TREES)),XA=bb(qA.TREES_RESET_INITIAL_TREES),QA=(bb(qA.TREE_CANCEL_CHILDREN_LOADING),(0,O.path)(["common","commands"]));var JA=r(76665);function eR(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){tR(e,t,r[t])}))}return e}function tR(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const rR=(e,t,r=[])=>{if((0,O.path)(["entity","uri"],e)===t)return r.forEach((e=>e.expanded=!0)),e;if(e.children)for(const n of e.children){const a=rR(n,t,r.concat(e));if(a)return a}},nR=(e,t)=>{const r=Object.keys(e).reduce(((r,n)=>{const a=e[n];return t[n]&&(a.parent=(0,O.uniq)([].concat(a.parent).concat(t[n].parent).filter(O.identity))),r[n]=a,r}),{});return Object.keys(t).forEach((e=>{r[e]||(r[e]=t[e])})),r},aR=(e,t)=>{if(e&&e.children){const r=e.children.findIndex((({nodeId:e})=>e===t));r>-1&&e.children.splice(r,1)}},iR=(e,t,r=0)=>{e&&e.children&&e.children.splice(r,0,t)},oR=({path:e,value:t,object:r})=>{let n=r;for(let r=0;r<e.length;r++){const a=e[r];r===e.length-1?n[a]="function"==typeof t?t(n[a]):t:(n[a]=n[a]||("number"==typeof a?[]:{}),n=n[a])}},lR=(e={},t,r)=>{e[t]=r,e.children&&e.children.forEach((e=>lR(e,t,r)))},sR=e=>({entity:e.entity,relation:e.relation}),cR=({id:e,draft:t,node:r})=>{oR({path:["editingConnections",r.relation.uri],object:t[e],value:sR(r)})},uR=({id:e,draft:t,node:r,entity:n})=>{oR({path:["editingConnections",r.relation.uri,"entity"],object:t[e],value:n})},pR=({id:e,draft:t,relationUri:r})=>{delete t[e].editingConnections[r]},dR=({id:e,draft:t,relationUri:r})=>t[e].editingConnections[r],mR=e=>{delete e.editingMode,delete e.relatedEntity,delete e.initialConnection},fR=({id:e,draft:t,currentNode:r})=>{const n=t[e].root;if(n===r)t[e].root=r.children[0],t[e].root.children=t[e].root.children||[],t[e].root.children.push(...r.children.slice(1));else{const e=(0,v.findParentNodeById)(n,r.nodeId);aR(e,r.nodeId)}},yR=(e,t,r)=>{const n=[e,"editingConnections",t,"relation"];return(0,O.path)(n,r)?(0,O.lensPath)(n):null},gR=(0,O.pick)(["showSecondaryLabel","sortField","sortOrder"]),hR=e=>({entity:(0,O.pick)(["uri","type","label","secondaryLabel"],e.entity),parent:[],relations:[(0,O.pick)(["uri","type"],e.relation)]});function ER(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){bR(e,t,r[t])}))}return e}function bR(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const vR={common:{commands:[]},trees:{},initialTrees:{}};let TR=function(e){return e.ENTITY_RELATED_ATTRIBUTES_ADDED="ENTITY_RELATED_ATTRIBUTES_ADDED",e}({});bb(TR.ENTITY_RELATED_ATTRIBUTES_ADDED);const OR={},SR=e=>e.entity,xR=e=>e.modifiedEntities,CR=e=>e.errors,wR=e=>e.relations,AR=e=>e.trees,RR=e=>e.lookups,_R=e=>e.dependentLookups,IR=e=>e.mode,NR=e=>e.lastLoadedTime,PR=e=>e.history,DR=e=>e.operation,kR=e=>e.views,LR=e=>e.sidePanelViews,UR=e=>e.hiddenAttributes,jR=e=>e.controlAttributes,FR=e=>Dw(SR(e)),MR=e=>kw(SR(e)),VR=(e,t)=>((e,t)=>t&&e[t])(xR(e),t),BR=(e,t)=>((e,t)=>t&&e[t]&&e[t].defaultProfilePic)(xR(e),t),zR=e=>(0,O.keys)(wR(e)),HR=(e,t,r)=>aw(wR(e),t,r),YR=(e,t,r)=>iw(wR(e),t,r),WR=(e,t,r)=>((e,t,r)=>{const n=iw(e,t,r);return(0,v.getRelationObjectFromConnection)(n)})(wR(e),t,r),GR=(e,t,r)=>((e,t,r)=>{const n=(0,O.pipe)((0,O.pathOr)([],[t,"drafts","addedConnections"]),(0,O.filter)((0,O.pipe)(v.getRelationUriFromConnection,v.isTempUri)),(0,O.when)((0,O.always)(r),(0,O.filter)((0,O.propEq)("parentEntityUri",r))),O.length)(e);return((e,t,r)=>r?(0,O.pipe)((0,O.path)([t,"connections"]),(0,O.find)((({entity:e})=>e.entityUri===r)),(0,O.pathOr)(0,["total"]))(e):(0,O.pathOr)(0,[t,"total"],e))(e,t,r)+n})(wR(e),t,r),qR=(e,t)=>nw(wR(e),t),ZR=(e,t)=>v.getDraftsForSaveByViewId(wR(e),t),$R=e=>(e=>(0,O.keys)(e).reduce(((t,r)=>{const{addedConnections:n,editedConnections:a}=(0,v.getDraftsForSaveByViewId)(e,r);return(0,O.pipe)(O.concat,(0,O.map)(v.getEntityUriFromConnection),(0,O.filter)(v.isTempUri),(0,O.concat)(t))(n,a)}),[]))(wR(e)),KR=e=>pA(IR(e)),XR=e=>uA(IR(e)),QR=e=>cA(IR(e)),JR=(e,t)=>v.getRelationToAddByViewId(wR(e),t),e_=(e,t)=>v.getRelationsToEditByViewId(wR(e),t),t_=(e,t)=>v.getAllRelationsToAddAndEdit(wR(e),t),r_=(e,t,r)=>v.getAllRelationsToSave(wR(e),t,r),n_=(e,t,r)=>v.getInitialConnectionTempEntity(e.relations,t,r),a_=(e,t,r)=>v.getInitialConnection(e.relations,t,r),i_=(e,t)=>((e,t)=>Object.keys(e).filter((r=>{const n=(0,v.getTempRelations)(e,r);return!!rw(n,t)})))(wR(e),t),o_=(e,t,r)=>((e,t,r)=>(0,O.pipe)((0,O.filter)((0,O.allPass)([(0,O.propEq)("parentUri",t),(0,O.propEq)("attributeTypeUri",r),(0,O.pipe)((0,O.prop)("uri"),O.isEmpty)])),(0,O.map)((0,O.prop)("message")),(0,O.join)(". "))(e))(CR(e),t,r),l_=(e,t,r)=>((e,t,r)=>(0,O.filter)((0,O.allPass)([(0,O.propEq)("parentUri",t),(0,O.propEq)("attributeTypeUri",r),(0,O.pipe)((0,O.prop)("uri"),O.isEmpty,O.not)]))(e))(CR(e),t,r),s_=(e,t,r)=>v.getCachedActiveErrorsForAttributesPager(CR(e),t,r),c_=(e,t)=>((e,t)=>e.trees[t])(AR(e),t),u_=(e,t)=>((e,t)=>(0,O.path)(["trees",t,"root"],e))(AR(e),t),p_=(e,t)=>((e,t)=>(0,O.path)(["trees",t,"total"],e))(AR(e),t),d_=e=>QA(AR(e)),m_=(e,t,r)=>((e,t,r)=>(0,O.path)(["trees",t,"editingConnections",r],e))(AR(e),t,r),f_=(e,t)=>((e,t)=>(0,O.pipe)((0,O.prop)("trees"),(0,O.when)((0,O.always)(t),(0,O.pick)(t)),O.values,(0,O.map)((0,O.pipe)((0,O.prop)("editingConnections"),O.values)),O.flatten,(0,O.reject)(O.isNil))(e))(AR(e),t),y_=e=>(e=>e.structure)(_R(e)),g_=(e,t)=>v.getDependentLookupsStructureNode(_R(e),t),h_=e=>(e=>e.initedTypeUris)(_R(e)),E_=e=>(e=>e.editors)(_R(e)),b_=(e,t)=>v.getDependentLookupEditorState(_R(e),t),v_=e=>(e=>e.diff)(PR(e)),T_=e=>(e=>e.event)(PR(e)),O_=e=>(e=>e.slice)(PR(e)),S_=e=>(e=>!(0,v.isEmptyValue)(e.slice))(PR(e)),x_=e=>(e=>e.mode)(PR(e)),C_=(e,t)=>((e,t)=>e[t])((e=>e.entityRelatedAttributes)(e),t),w_=(0,sT.createSelector)(SR,(e=>VR(e,FR(e))),((e,t)=>!(!e||!t||(0,v.isEmptyValue)((0,v.collectAllDiffs)(e,t,!0))))),A_=(0,sT.createSelector)(AR,(e=>{const t=QA(e),r=(0,v.getNotAppliedTreeCommands)((0,O.reject)((0,O.propSatisfies)(v.isEmptyValue,"root"),e.trees));return!(0,v.isEmptyValue)(t)||!(0,v.isEmptyValue)(r)})),R_=(0,sT.createSelector)(wR,(e=>(0,O.keys)(e).reduce(((t,r)=>t||!(0,O.all)(v.isEmptyValue)((0,O.values)(v.getDraftsForSaveByViewId(e,r)))),!1))),__=(0,sT.createSelector)(w_,R_,A_,((e,t,r)=>e||t||r)),I_=(0,sT.createSelector)(IR,SR,__,((e,t)=>t),((e,t,r,n)=>!(e===v.Mode.Viewing||!t)&&((0,v.isTempUri)(t.uri)&&!n||r)));let N_=function(e){return e.PROFILE_OPERATION_UPDATE="PROFILE_OPERATION_UPDATE",e}({});const P_=bb(N_.PROFILE_OPERATION_UPDATE),D_=({metadata:e,modifiedEntities:t,connections:r=[],errors:n})=>n.filter((({attributeType:e,type:t})=>e&&!(0,v.isRequired)(e)&&t===v.ErrorType.missed)).filter((({attributeType:n,parentUri:a})=>{const i=(0,v.getBaseUri)(a),o=(0,v.isEntityUri)(a)?t[i]:(0,v.findConnectionRelationObjectByRelationUri)(r,i),l=o&&(0,v.findAttributeValuesByTypeUri)(e,o,n.uri,!0);return null==l?void 0:l.some((({parent:e,attrValues:t})=>e.uri===a&&0===t.length))})).map((({attributeType:e,parentUri:t})=>({attributeType:e,parentUri:t}))),k_=e=>(0,v.getProfileViewsIdsByTypes)(e,[v.ProfileViewType.Relations,v.ProfileViewType.RelationsTable]);function L_(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){U_(e,t,r[t])}))}return e}function U_(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*j_(){const e=yield(0,Ia.Ys)(LI.selectors.getEntity),t=yield(0,Ia.Ys)(LI.selectors.getMode),r=yield(0,Ia.Ys)(LI.selectors.getEntityUri),n=yield(0,Ia.Ys)(LI.selectors.getMetadata),a=yield(0,Ia.Ys)(LI.selectors.getModifiedEntity,r),i=yield(0,Ia.Ys)(LI.selectors.getModifiedEntities),o=yield(0,Ia.Ys)(LI.selectors.getProfileViews);return{entity:e,modifiedEntity:t===v.Mode.Viewing?e:a,entityUri:r,metadata:n,modifiedEntities:t===v.Mode.Viewing?{[r]:e}:i,profileViews:o,mode:t}}function*F_(){return L_({},yield(0,Ia.RE)(j_),{validationServicePath:yield(0,Ia.Ys)(LI.selectors.getValidationServicePath),tenant:yield(0,Ia.Ys)(LI.selectors.getTenant),severity:yield(0,Ia.Ys)(LI.selectors.getValidationServiceSeverityLevels)})}function*M_(){const{entityUri:e,metadata:t,modifiedEntities:r,modifiedEntity:n,profileViews:a}=yield(0,Ia.RE)(j_);if(!e)return[];const i=k_(a),o=(0,v.getProfileViewsIdsByTypes)(a,[v.ProfileViewType.HierarchyTree]),l=yield(0,Ia.Ys)(lx,i,!0),s=yield(0,Ia.Ys)(LI.selectors.getRelations),c=yield(0,Ia.Ys)(LI.selectors.getAllTreesEditingConnections,o);return[...(0,v.validateEntityLocally)(t,r,n,(0,v.isAvailableAttributeTypeForProfile)(a)),...l.flatMap((e=>(0,v.validateConnection)(t,r,e))),...c.flatMap((e=>(0,v.validateHierarchyConnection)(t,e)))].map((n=>L_({},n,{path:(0,v.evaluateErrorPath)({entityUri:e,metadata:t,connections:l,entitiesMap:r,relationsState:s,relationViewsIds:i},n.uri||n.parentUri)})))}function*V_(){const{entityUri:e,metadata:t,modifiedEntity:r,mode:n,validationServicePath:a}=yield(0,Ia.RE)(F_);if(a&&e&&(0,v.shouldUseValidationService)(t,null==r?void 0:r.type)){const r=yield(0,Ia.RE)((0,v.isTempUri)(e)?z_:H_),{modifiedEntities:a}=yield(0,Ia.RE)(j_),i=(0,O.pipe)(v.convertValidationServiceErrors,(0,O.uniqBy)(v.getErrorUniqKey))(r,{entityUri:e,metadata:t,entitiesMap:a});if(n!==v.Mode.Viewing){const e=D_({metadata:t,modifiedEntities:a,errors:i});e.length&&(yield(0,Ia.gz)(Ib(e)))}return i}return[]}function B_(e){return console.warn("Validation service error",e),[]}function*z_(){const{mode:e,modifiedEntity:t,modifiedEntities:r,validationServicePath:n,tenant:a,severity:i}=yield(0,Ia.RE)(F_),o=(0,v.prepareEntityForValidation)(t,r);try{return yield(0,Ia.RE)(v.validateEntity,{validationServicePath:n,entity:o,tenant:a,severity:i,options:(0,O.reject)(O.isNil,[v.ValidationServiceOption.preserveURIs,e===v.Mode.Editing?v.ValidationServiceOption.validateDataPermissions:null])})}catch(e){return B_(e)}}function*H_(){const{entityUri:e,mode:t,entity:r,modifiedEntity:n,modifiedEntities:a,validationServicePath:i,metadata:o,tenant:l,severity:s}=yield(0,Ia.RE)(F_),c=yield(0,Ia.Ys)(LI.selectors.getValidateReferenceEntityInReadMode),u=(0,v.getEntityType)(o,r.type),p=(null==u?void 0:u.forceOvForUiUpdates)??!0,d=t===v.Mode.Viewing?[]:(0,v.collectDiffForValidation)(r,n,a,p);try{return yield(0,Ia.RE)(v.validateEntityChanges,{validationServicePath:i,uri:e,diff:d,tenant:l,severity:s,options:(0,O.reject)(O.isNil,[v.ValidationServiceOption.preserveURIs,v.ValidationServiceOption.updateAttributeUpdateDates,t===v.Mode.Editing?v.ValidationServiceOption.validateDataPermissions:null,t===v.Mode.Viewing&&c?v.ValidationServiceOption.validateReferenceEntityAttribute:null])})}catch(e){return B_(e)}}function*Y_(){const{entityUri:e,metadata:t,mode:r,modifiedEntity:n,modifiedEntities:a,validationServicePath:i,tenant:o,severity:l,profileViews:s}=yield(0,Ia.RE)(F_),c=yield(0,Ia.Ys)(LI.selectors.getValidateRelations);if(i&&c){const c=k_(s),u=(yield(0,Ia.Ys)(lx,c)).filter((e=>(0,v.shouldUseValidationService)(t,e.relation.relationType)));if(u.length>0){let s=[];const p=(0,v.prepareConnectionsForValidation)(u,n,a,t);try{const e=yield(0,Ia.RE)(v.validateRelations,{validationServicePath:i,body:p,tenant:o,severity:l,options:(0,O.reject)(O.isNil,[v.ValidationServiceOption.preserveURIs,r===v.Mode.Editing?v.ValidationServiceOption.validateDataPermissions:null])});s=Object.values(e.validated).flat()}catch(e){return B_(e)}const d=yield(0,Ia.Ys)(LI.selectors.getModifiedEntities),m=yield(0,Ia.Ys)(LI.selectors.getRelations),f=(0,O.pipe)(v.convertValidationServiceErrors,(0,O.uniqBy)(v.getErrorUniqKey))(s,{entityUri:e,metadata:t,entitiesMap:d,connections:u,relationsState:m,relationViewsIds:c}),y=D_({metadata:t,modifiedEntities:d,connections:u,errors:f});return y.length&&(yield(0,Ia.gz)(Ib(y))),f}}return[]}function*W_(e){if((null==e?void 0:e.type)===_b.CANCEL_PROFILE_VALIDATION)return!0;const t=yield(0,Ia.RE)(M_),[r,n]=yield(0,Ia.$6)([(0,Ia.RE)(V_),(0,Ia.RE)(Y_)]),a=(0,O.uniqBy)(v.getErrorUniqKey,[...t,...r,...n]),i=yield(0,Ia.Ys)(LI.selectors.getEntityUri),o=yield(0,Ia.Ys)(LI.selectors.getHiddenAttributes),l=(null==o?void 0:o[i])||[],s=(0,v.filterErrorsForHiddenAttributes)(a,l);return yield(0,Ia.gz)(Mw(a)),0===s.filter(v.isCriticalError).length}let G_=function(e){return e.PROFILE_VIEWS_SET="PROFILE_VIEWS_SET",e}({});const q_=bb(G_.PROFILE_VIEWS_SET);function Z_(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){$_(e,t,r[t])}))}return e}function $_(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*K_(e){const t=yield(0,Ia.Ys)(LI.selectors.getMetadata),r=yield(0,Ia.Ys)(LI.selectors.getMode);switch(e.type){case ew.OPEN_RELATION_EDITOR:{const{id:n,connection:a}=e.payload;a.relation.relationType&&(yield(0,Ia.gz)(Nb({viewId:n,metadata:t,mode:r,parentUri:a.relation.object.uri})));break}case _b.ADD_ATTRIBUTES:{const n=e.payload;for(const e of n){const{attributeType:n,parentUri:a,viewId:i}=e;(0,v.isComplexAttribute)(n)&&(yield(0,Ia.gz)(Nb({viewId:i,attributeType:n,parentUri:a,metadata:t,mode:r})))}break}case ew.SET_RELATION_TYPE:{const{id:n,relationUri:a}=e.payload;yield(0,Ia.gz)(Nb({viewId:n,metadata:t,mode:r,parentUri:a}));break}case qA.TREE_NODE_RELATION_TYPE_CHANGED:{var n;const{id:a,node:i}=e.payload;yield(0,Ia.gz)(Nb({viewId:a,metadata:t,mode:r,parentUri:null==i||null===(n=i.relation)||void 0===n?void 0:n.uri}));break}}}function*X_(e,t=null){const r=yield(0,Ia.Ys)(fx),n=(0,v.getNotAppliedTreeCommands)(null==r?void 0:r.trees),a=yield(0,Ia.Ys)(Ex),i=(0,v.optimizeCommands)([...a,...n]);if(null!=i&&i.length){const r=(0,O.when)((0,O.always)(t),(0,v.replaceTempUriInCommands)(t))(i);yield(0,Ia.RE)(e,r),yield(0,Ia.gz)(ZA())}}function*Q_(e){const t=yield(0,Ia.Ys)(zO),r=yield(0,Ia.Ys)(HO),n=yield(0,Ia.Ys)(oS,r),a=yield(0,Ia.Ys)(LO),i=(0,v.getEntityType)(a,t.type),o=(null==i?void 0:i.forceOvForUiUpdates)??!0,l=(0,v.collectAllDiffs)(t,n,o);return(0,v.prepareAttrDiff)(e,l)}function*J_(e){const t=yield(0,Ia.Ys)(KO),r=yield(0,Ia.Ys)(sS),n=yield(0,Ia.Ys)(HO),a=yield(0,Ia.Ys)(oS,n),i=(0,v.findAllTemporaryRefEntityURI)(a),o=(0,O.concat)(i,t);return yield(0,Ia.RE)(v.saveTemporaryEntities,r,o,e)}function*eI(e,t,r){const n=e.getDCRObjectUris(),a=yield(0,Ia.Ys)(Nx),i=yield(0,Ia.Ys)(Dx),o=yield(0,Ia.Ys)(Cx);if(null!=n&&n.length){const l=yield(0,Ia.RE)(v.startProcessInstance,{workflowPath:a,processType:t?"authoring":"dataChangeRequestReview",objectURIs:(0,O.uniq)([r,...n,e.getDCRUri()]).filter((0,O.complement)(O.isNil)),tenant:o,environment:i});"OK"!==(null==l?void 0:l.status)&&console.warn(l)}}function*tI(e,t,r,n){const a=yield(0,Ia.Ys)($O,r),i=yield(0,Ia.Ys)(LI.selectors.getUserName),o=(0,v.createRelationsCommandsFromConnections)(a,n,t,i);o.length&&(yield(0,Ia.RE)(e,o))}function*rI(e,t,r){const n=yield(0,Ia.Ys)(eS),a=yield(0,Ia.Ys)(HO);for(const i of n)yield(0,Ia.rM)(tI,e,r||a,i,t)}function*nI(e){if(!e.hasNewUri())return;const t=yield(0,Ia.Ys)(fx);for(const[r,n]of Object.entries(t.trees))if(n.root){const t=t=>(0,O.when)((0,O.prop)("uri"),(0,O.assoc)("uri",e.getUri(null==t?void 0:t.uri)))(t),a=(0,v.mapTree)(n.root,{nodeProcessing:e=>(0,O.pipe)((e=>Z_({},e)),(0,O.unless)((0,O.has)("editingMode"),(0,O.evolve)({relation:t,relations:(0,O.map)(t)})))(e)});(0,O.equals)(n.root,a)||(yield(0,Ia.gz)($A({id:r,tree:a})))}}function*aI(){try{var e;const t=yield(0,Ia.Ys)(rx),{commandExecutor:r,dcrProcessor:n,relationUriProcessor:a}=(0,v.createCommandExecutor)({alwaysCreateDCR:t,dcrUri:null}),i=yield(0,Ia.RE)(J_,n);yield(0,Ia.$6)([(0,Ia.RE)(X_,r),(0,Ia.RE)(rI,r,i)]),yield(0,Ia.RE)(nI,a);const o=yield(0,Ia.RE)(Q_,i),l=yield(0,Ia.Ys)(HO),s=yield(0,Ia.Ys)(LI.selectors.getMetadata),c=(0,v.hasAttributeMasking)(s);let u;if(null!=o&&o.length&&(u=yield(0,Ia.RE)(v.entityCumulativeUpdate,{uri:l,diff:o,uriPreprocessor:n.enhanceUriWithDCR,sendMasked:c})),t||(0,v.isChangeRequestUri)(null===(e=u)||void 0===e?void 0:e.uri))u&&n.updateDCRUriFromResponse(u),yield(0,Ia.RE)(eI,n,!1,l),yield(0,Ia.gz)(KA()),c&&(yield(0,Ia.RE)(mI,!0)),window.alert(li().text("Your changes are saved as pending and have been sent for review"));else if(u){yield(0,Ia.gz)(Sw(u));const{trees:e}=yield(0,Ia.Ys)(LI.selectors.getTrees),t=(0,v.updateTreesWithNewEntity)((0,O.pick)(["uri","label","secondaryLabel","type"],u),e);for(const e of t)yield(0,Ia.gz)($A({id:e.id,tree:e.root}))}else!u&&c&&(yield(0,Ia.RE)(mI,!0));yield(0,Ia.gz)(oA(v.Mode.Viewing)),yield(0,Ia.gz)(Vb())}catch(e){yield(0,Ia.gz)(aT((0,v.getRequestErrorMessage)(e,li().text("Something went wrong"))))}}function*iI(){yield(0,Ia.qn)(Ow.ENTITY_LOADED),yield(0,Ia.gz)(Vb())}function*oI(e,t){const r=yield(0,Ia.Ys)(HO),n=yield(0,Ia.Ys)(LI.selectors.getModifiedEntity,r),{commandExecutor:a,dcrProcessor:i}=(0,v.createCommandExecutor)({alwaysCreateDCR:t,dcrUri:e}),o=yield(0,Ia.RE)(J_,i),l=yield(0,Ia.RE)(v.saveTemporaryEntity,n,o,i);return yield(0,Ia.$6)([(0,Ia.RE)(X_,a,{[r]:l}),(0,Ia.RE)(rI,a,o,l)]),{savedEntityUri:l,dcrProcessor:i}}function*lI(){const e=yield(0,Ia.Ys)(HO),t=yield(0,Ia.Ys)(LI.selectors.getModifiedEntity,e);if((0,v.isEmptyEntity)(t)){const e=(0,Me.x0)();return yield(0,Ia.gz)(Dv({id:e,text:li().text("Please fill out some fields."),actions:[]})),!1}return!0}function*sI(){try{const e=yield(0,Ia.Ys)(rx);if(!(yield(0,Ia.RE)(lI)))return;const{dcrProcessor:t,savedEntityUri:r}=yield(0,Ia.RE)(oI,null,e);e&&(yield(0,Ia.RE)(eI,t),window.alert(li().text("Your changes are saved as pending and have been sent for review"))),yield(0,Ia.gz)(oA(v.Mode.Viewing)),e?(yield(0,Ia.gz)(Pv()),yield(0,Ia.gz)(Pw())):(yield(0,Ia.gz)(_v({uri:r})),yield(0,Ia.rM)(iI))}catch(e){yield(0,Ia.gz)(aT((0,v.getRequestErrorMessage)(e,li().text("Something went wrong"))))}}function*cI(e){const t=yield(0,Ia.RE)(v.getDataChangeRequest,e),r=(0,O.pipe)((0,O.prop)("changes"),O.values,O.flatten,(0,O.pluck)("id"))(t);try{yield(0,Ia.$6)(r.map((t=>(0,Ia.RE)(v.deleteChangeRequestItem,{dcrUri:e,changeItemId:t}))))}catch(e){yield(0,Ia.gz)(aT((0,v.getRequestErrorMessage)(e,li().text("Something went wrong"))))}}function*uI(e){const{dcrUri:t,action:r,taskId:n}=e.payload;try{if(!(yield(0,Ia.RE)(lI)))return;if(yield(0,Ia.gz)(P_(v.Operation.Saving)),yield(0,Ia.RE)(cI,t),yield(0,Ia.RE)(oI,t,!0),"Approve"!==r||(yield(0,Ia.RE)(W_))){const e=yield(0,Ia.Ys)(Nx),t=yield(0,Ia.Ys)(Dx),a=yield(0,Ia.Ys)(Cx);yield(0,Ia.RE)(v.runTaskAction,{workflowPath:e,environment:t,tenant:a,taskId:n,action:r}),yield(0,Ia.gz)(_w())}}catch(e){const t=null==e?void 0:e.error;if((null==t?void 0:t.errorCode)===v.ApiErrorCode.WORKFLOW_IS_NOT_REGISTERED_ERROR)return;yield(0,Ia.gz)(aT((0,v.getRequestErrorMessage)(t||e,li().text("Something went wrong"))))}yield(0,Ia.gz)(P_(null))}function*pI(e){const{dcrUri:t,userAction:r}=e.payload,n=yield(0,Ia.Ys)(JS);try{if(!(yield(0,Ia.RE)(lI)))return;yield(0,Ia.gz)(oA("saveDraft"===r?v.Mode.Suggesting:v.Mode.Editing,!0)),yield(0,Ia.gz)(P_(v.Operation.Saving));const e=yield(0,Ia.RE)(W_);if("saveDraft"===r){if(t)yield(0,Ia.RE)(cI,t),yield(0,Ia.RE)(oI,t,!0);else{const{dcrProcessor:e}=yield(0,Ia.RE)(oI,null,!0);yield(0,Ia.RE)(eI,e,!0);const t=e.getDCRUri();yield(0,Ia.gz)(tT({url:"../authoring",searchParams:{entityUri:`${t}`},options:{replace:!0,state:{keepErrors:!0}}}))}window.alert(li().text("Your changes are saved as pending and have been sent for review"))}else if(e){const{savedEntityUri:e}=yield(0,Ia.RE)(oI,null,!1);yield(0,Ia.gz)(oA(v.Mode.Viewing)),yield(0,Ia.gz)(_v({uri:e})),yield(0,Ia.rM)(iI)}else e||(yield(0,Ia.gz)(oA(n,!0)))}catch(e){yield(0,Ia.gz)(oA(n,!0)),yield(0,Ia.gz)(aT((0,v.getRequestErrorMessage)(e,li().text("Something went wrong"))))}yield(0,Ia.gz)(P_(null))}function*dI(){if(yield(0,Ia.gz)(P_(v.Operation.Saving)),yield(0,Ia.RE)(W_)){const e=yield(0,Ia.Ys)(HO);(0,v.isTempUri)(e)?yield(0,Ia.RE)(sI):yield(0,Ia.RE)(aI)}yield(0,Ia.gz)(P_(null))}function*mI(e){try{let t;if(e){const e=yield(0,Ia.Ys)(LI.selectors.getMetadata);t=(0,v.addMetadataSpecificGetEntityOptions)(e)}yield(0,Ia.gz)(P_(v.Operation.Fetching));const r=yield(0,Ia.Ys)(HO),n=yield(0,Ia.RE)(v.getEntity,r,t);if(!n)throw new Error("Failed to request entity");return yield(0,Ia.gz)(Sw(n,!0)),n}catch(e){throw yield(0,Ia.gz)(aT((0,v.getRequestErrorMessage)(e,li().text("Something went wrong")))),e}finally{yield(0,Ia.gz)(P_(null))}}function*fI(e){const{mode:t,silent:r}=e.payload;r||(yield yI({mode:t}))}function*yI({mode:e,overwrite:t=!1}){const r=yield(0,Ia.Ys)(LI.selectors.getEntity),n=yield(0,Ia.Ys)(LI.selectors.getMetadata),a=yield(0,Ia.Ys)(LI.selectors.getModifiedEntity,null==r?void 0:r.uri);if((t||!a)&&e!==v.Mode.Viewing&&r&&n){const t=yield(0,Ia.Ys)(LI.selectors.getProfileViews),a=yield(0,Ia.Ys)(LI.selectors.getUIConfig),i=yield(0,Ia.Ys)(LI.selectors.getUserRoles),o=(0,v.getAlwaysVisibleProfileAttributes)(a,null==r?void 0:r.type),l=(0,v.addToEntityRequiredAttributes)({entity:r,metadata:n,mode:e,attrTypeFilter:(0,O.both)((0,v.isAvailableAttributeTypeForProfile)(t||[]),(0,v.getProfileAttributeConfigPermissionsChecker)(a,r.type,i,[v.ConfigPermissions.READ,v.ConfigPermissions.CREATE])),alwaysVisibleAttributes:o});yield(0,Ia.gz)(mA(l));const s=yield(0,Ia.Ys)(LI.selectors.getModifiedEntities),c=yield(0,Ia.Ys)(LI.selectors.getProfileErrors),u=D_({metadata:n,modifiedEntities:s,errors:c});u.length&&(yield(0,Ia.gz)(Ib(u)))}}function*gI(e){const{entity:t,silent:r}=e.payload,n=yield(0,Ia.Ys)(LI.selectors.getMode),a=yield(0,Ia.Ys)(LI.selectors.getProfileOperation);r||(0,v.isTempUri)(t.uri)||a||(yield yI({mode:n,overwrite:!0}))}function*hI(e){const{entityTypeUri:t}=e.payload,r=yield(0,Ia.Ys)(LI.selectors.getMetadata),n=(0,v.getEntityType)(r,t),a=yield(0,Ia.Ys)(LI.selectors.getUIConfig),i=yield(0,Ia.Ys)(LI.selectors.getUserRoles),o=(0,v.getProfileAttributeConfigPermissionsChecker)(a,t,i,[v.ConfigPermissions.READ,v.ConfigPermissions.CREATE]),l=((null==n?void 0:n.attributes)||[]).filter((e=>o(e))),s=(0,v.checkMetadataForCreate)(v.Mode.Editing,n)?v.Mode.Editing:v.Mode.Suggesting,c=(0,v.createTemporaryEntity)({entityTypeUri:t,attributeTypes:l,metadata:r,mode:s});yield(0,Ia.gz)(Iv({entity:c})),yield(0,Ia.gz)(Sw(c)),yield(0,Ia.gz)(oA(v.Mode.Viewing)),yield(0,Ia.gw)(0),(yield(0,Ia.Ys)(LI.selectors.getProfileViews))||(yield(0,Ia.qn)(G_.PROFILE_VIEWS_SET)),yield(0,Ia.gz)(oA(s)),yield(0,Ia.gz)(XA())}function*EI(e){const t=yield(0,Ia.Ys)(LI.selectors.getMetadata),r=yield(0,Ia.Ys)(LI.selectors.getAuthoringByEntityType,e),n=yield(0,Ia.Ys)(LI.selectors.getUIConfig),a=(0,v.getPreparedAuthoringItems)(t,r,e,n).map((({views:e})=>e)).flat();yield(0,Ia.gz)(q_(a))}function*bI(e){const{entityTypeUri:t}=e.payload,r=yield(0,Ia.Ys)(LI.selectors.getMetadata),n=(0,v.getEntityType)(r,t),a=(0,O.prop)("attributes",n),i=(yield(0,Ia.Ys)(LI.selectors.getCanSuggestAuthoring,n))?v.Mode.Suggesting:v.Mode.Editing,o=(0,v.createTemporaryEntity)({entityTypeUri:t,attributeTypes:a,metadata:r,mode:i});yield(0,Ia.gz)(Jv({entity:o})),yield(0,Ia.gz)(Sw(o)),yield(0,Ia.RE)(EI,o.type),yield(0,Ia.gz)(oA(i))}function*vI(e){const{mainEntityUri:t,tempEntities:r,keepErrors:n}=e.payload,[[a],i]=(0,O.partition)((0,O.propEq)("uri",t),r);yield(0,Ia.gz)(Sw(a,n)),yield(0,Ia.RE)(EI,a.type),yield(0,Ia.gz)(oA(v.Mode.Suggesting));for(const e of i)yield(0,Ia.gz)(mA(e))}function*TI(e){const{payload:{entityUri:t,data:r}}=e;yield(0,Ia.gz)(P_(v.Operation.Cloning));try{const e=yield(0,Ia.RE)(v.cloneEntity,t,r);yield(0,Ia.gz)(Iv({entity:e})),yield(0,Ia.gz)(Sw(e)),yield(0,Ia.gz)(oA(v.Mode.Editing)),yield(0,Ia.gz)(XA());const n=(0,Me.x0)(),a=yield(0,Ia.Ys)(LI.selectors.getMetadata),i=(0,v.getEntityType)(a,e.type),o=(0,v.checkMetadataForDelete)(v.Mode.Editing,i);yield(0,Ia.gz)(Dv({id:n,type:"cloneAction",autoHideDuration:1e4,text:li().text("Profile is cloned successfully. You can modify the attributes if required."),actions:o?[{label:li().text("Undo"),needConfirmation:!0,confirmationText:li().text("Are you sure you want to undo the cloning process?"),confirmationDescription:li().text("Undoing the cloning process will delete the cloned profile. Are you sure you want to proceed?"),applyAction:Iw({entityUri:e.uri}),cancelAction:kv(n)}]:[]}))}catch(e){yield(0,Ia.gz)(aT((0,v.getRequestErrorMessage)(e,li().text("Something went wrong"))))}yield(0,Ia.gz)(P_(null))}function*OI(e){const{entityUri:t}=e.payload;if(!(0,v.isTempUri)(t))try{yield(0,Ia.RE)(v.removeEntity,t),yield(0,Ia.gz)(Nv())}catch(e){yield(0,Ia.gz)(aT((0,v.getRequestErrorMessage)(e,li().text("Something went wrong"))))}}function*SI(e){const t=e.payload;try{if((yield(0,Ia.Ys)(xx))&&!confirm(li().text("Are you sure you want to cancel changes for this Profile?")))return;const e=yield(0,Ia.Ys)(JS),r=yield(0,Ia.Ys)(LI.selectors.getMetadata),n=yield(0,Ia.Ys)(HO),a=(0,v.hasAttributeMasking)(r),i=(0,v.isTempUri)(n),o=(0,v.isViewMode)(t),l=(0,v.isEditableMode)(e)&&(0,v.isViewMode)(t),s=(0,v.isViewMode)(e)&&(0,v.isEditableMode)(t);n&&(l||s)&&a&&!i&&(yield(0,Ia.RE)(mI,o)),yield(0,Ia.gz)(oA(t)),l&&(yield(0,Ia.gz)(sA()))}catch{}}const xI=[function*(){yield(0,Ia.A7)([Zb.MODE_UPDATE_REQUESTED],SI)},function*(){yield(0,Ia.A7)([_b.RUN_AUTHORING_TASK_ACTION],uI)},function*(){yield(0,Ia.ib)([ew.OPEN_RELATION_EDITOR,_b.ADD_ATTRIBUTES,ew.SET_RELATION_TYPE,qA.TREE_NODE_RELATION_TYPE_CHANGED],K_)},function*(){yield(0,Ia.A7)([_b.SAVE_PROFILE],dI)},function*(){yield(0,Ia.ib)([Zb.MODE_UPDATED],fI)},function*(){yield(0,Ia.ib)([Ow.ENTITY_CREATION_REQUESTED],hI)},function*(){yield(0,Ia.Fm)([_b.VALIDATE_PROFILE,_b.CANCEL_PROFILE_VALIDATION],W_)},function*(){yield(0,Ia.ib)([Ow.ENTITY_REMOVE_REQUESTED],OI)},function*(){yield(0,Ia.ib)([Ow.CLONE_ENTITY],TI)},function*(){yield(0,Ia.ib)([Ow.ENTITY_CREATION_WITH_AUTHORING_REQUESTED],bI)},function*(){yield(0,Ia.ib)([Ow.ENTITY_AUTHORING_DRAFT_ENTITIES_LOADED],vI)},function*(){yield(0,Ia.A7)([_b.SAVE_DRAFT],pI)},function*(){yield(0,Ia.ib)([Ow.ENTITY_LOADED],gI)}];let CI=function(e){return e.SIDE_PANEL_VIEWS_LOADED="SIDE_PANEL_VIEWS_LOADED",e}({});bb(CI.SIDE_PANEL_VIEWS_LOADED);const wI=[];let AI=function(e){return e.HIDDEN_ATTRIBUTES_UPDATED="HIDDEN_ATTRIBUTES_UPDATED",e.HIDDEN_ATTRIBUTES_RESET="HIDDEN_ATTRIBUTES_RESET",e}({});const RI=bb(AI.HIDDEN_ATTRIBUTES_UPDATED),_I=bb(AI.HIDDEN_ATTRIBUTES_RESET),II={};let NI=function(e){return e.CONTROL_ATTRIBUTES_UPDATED="CONTROL_ATTRIBUTES_UPDATED",e}({});const PI=bb(NI.CONTROL_ATTRIBUTES_UPDATED),DI=[],kI=(0,T.combineReducers)({dependentLookups:(e=Xb,t)=>{switch(t.type){case Zb.MODE_UPDATED:{const{mode:r,silent:n}=t.payload;return(0,v.isViewMode)(r)&&!n?Xb:e}case Hb.DEPENDENT_LOOKUPS_STRUCTURE_SET:return $b({},e,{structure:t.payload});case Hb.DEPENDENT_LOOKUPS_INITED_TYPE_URIS_ADDED:{const r=t.payload;return $b({},e,{initedTypeUris:(0,O.uniq)(e.initedTypeUris.concat(r))})}case Hb.DEPENDENT_LOOKUPS_EDITORS_BLOCKED:{const{uris:r,isBlocked:n}=t.payload,a=e.editors,i=r.reduce(((e,t)=>$b({},e,{[t]:$b({},e[t],{isBlocked:n})})),a);return $b({},e,{editors:i})}case Hb.DEPENDENT_LOOKUPS_EDITOR_TOUCHED:{const{uri:r,isTouched:n}=t.payload;return(0,O.assocPath)(["editors",r,"isTouched"],n,e)}default:return e}},entity:(e=Uw,t)=>{switch(t.type){case Ow.ENTITY_LOADED:return t.payload.entity;case Ow.DEFAULT_PROFILE_PIC_SET:return"object"==typeof t.payload&&null!==t.payload?function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Lw(e,t,r[t])}))}return e}({},e,{defaultProfilePic:t.payload.uri,defaultProfilePicValue:t.payload}):e;case _b.ADD_NEXT_PAGE_ATTRIBUTE_VALUES:{const{parentUri:r,attributeTypeName:n,attributeTypeUri:a,values:i}=t.payload,o=(0,v.getAttributeSource)(a);if(r===e.uri){const t=(0,O.lensPath)([o,n]);return(0,O.over)(t,(0,O.pipe)((0,O.defaultTo)([]),(0,O.concat)(O.__,i)),e)}return e}case Ow.CLEAR_ENTITY:return Uw;default:return e}},errors:(e=Bw,t)=>{switch(t.type){case jw.ERRORS_SET:return t.payload;case jw.ERROR_DEACTIVATED:{const r=t.payload,n=e.findIndex((e=>(0,v.getErrorId)(e)===r)),a=(0,O.lensPath)([n]);return(0,O.over)(a,(0,O.assoc)("deactivated",!0),e)}case _b.REMOVE_ATTRIBUTE:{const{uri:r}=t.payload,n=e.map((e=>e.uri===r||(0,v.areOneHierarchyUris)(e.parentUri,r)?function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Vw(e,t,r[t])}))}return e}({},e,{deactivated:!0}):e));return((e,t)=>(0,O.equals)(e,t)?e:t)(e,n)}case Zb.MODE_UPDATED:{const{mode:r,silent:n}=t.payload;return(0,v.isViewMode)(r)&&!n?Bw:e}case Ow.ENTITY_LOADED:{const{silent:r}=t.payload;return r?e:Bw}default:return e}},history:(e=Xw,t)=>{switch(t.type){case zw.HISTORY_DIFF_SET:return $w({},e,{diff:t.payload});case zw.HISTORY_DIFF_CLEARED:return $w({},e,{diff:Xw.diff});case zw.HISTORY_EVENT_SET:return $w({},e,{event:t.payload});case Sb.NEW_ENTITY_SHOWN:case Sb.OPEN_ENTITY:case zw.HISTORY_EVENT_CLEARED:return $w({},Xw,{mode:e.mode});case zw.HISTORY_SLICE_SET:return $w({},e,{slice:t.payload});case zw.HISTORY_MODE_SET:return $w({},e,{mode:t.payload});default:return e}},lastLoadedTime:(e=null,t)=>{switch(t.type){case Qw.PROFILE_LAST_LOADED_TIME_UPDATE:case Ow.ENTITY_LOADED:return Date.now();default:return e}},lookups:(e=iA,t)=>{switch(t.type){case Jw.LOOKUPS_LOADED:return t.payload;case Jw.LOOKUPS_FOR_TYPE_RESOLVED:{const{type:r,values:n}=t.payload;return nA({},e,{[r]:nA({},e[r],n)})}case Jw.LOOKUPS_LIST_RESOLVED:return t.payload.reduce(((e,t)=>Object.keys(t).reduce(((e,r)=>nA({},e,{[r]:nA({},e[r],t[r])})),e)),e);case"UI_RESET":return nA({},iA);default:return e}},mode:(e=dA,t)=>t.type===Zb.MODE_UPDATED?t.payload.mode:e,modifiedEntities:(e=vA,t)=>{switch(t.type){case JC.MODIFIED_ENTITY_CREATED:{const r=t.payload;return EA({},e,{[r.uri]:r})}case JC.MODIFIED_ENTITY_DELETED:{const r=t.payload;return(0,O.omit)([r],e)}case JC.MODIFIED_ENTITIES_RESET:return vA;case Zb.MODE_UPDATED:{const{silent:r}=t.payload;return r?e:vA}case JC.MODIFIED_ENTITY_DEFAULT_PROFILE_PIC_SET:{const{entityUri:r,value:n}=t.payload;return r?EA({},e,{[r]:EA({},e[r],{defaultProfilePic:n.uri,defaultProfilePicValue:n})}):e}case _b.ADD_ATTRIBUTES:return t.payload.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a}=t,i=(0,v.getBaseUri)(n);if((0,v.isEntityUri)(i)){const t=e[i];return e[i]||console.error(`ADD_ATTRIBUTES. parentUri - ${n}, state: ${JSON.stringify(e)}`),(0,v.isEntitySpecialAttrType)(r)?EA({},e,{[i]:(0,v.addEntitySpecialAttribute)({entity:t,attributeType:r})}):EA({},e,{[i]:(0,v.addAttribute)({entity:t,attributeType:r,parentUri:n,index:a})})}return e}),e);case _b.ADD_NEXT_PAGE_ATTRIBUTE_VALUES:{const{parentUri:r,attributeTypeName:n,attributeTypeUri:a,values:i}=t.payload,o=(0,v.getAttributeSource)(a);if((0,v.isEntityUri)(r)&&r in e){const t=(0,O.lensPath)([r,o,n]);return(0,O.over)(t,(0,O.pipe)((0,O.defaultTo)([]),(0,O.concat)(O.__,i)),e)}return e}case _b.MODIFY_ATTRIBUTE:{const{attributeType:r,uri:n,value:a}=t.payload,i=(0,v.getBaseUri)(n);if((0,v.isEntityUri)(i)){const t=e[i];return e[i]&&e[i].attributes||console.error(`MODIFY_ATTRIBUTE. uri - ${n}, state: ${JSON.stringify(e)}`),(0,v.isEntitySpecialAttrType)(r)?EA({},e,{[i]:(0,v.editEntitySpecialAttribute)({entity:t,attributeType:r,value:a})}):EA({},e,{[i]:(0,v.editAttribute)({entity:t,attributeType:r,uri:n,value:a})})}return e}case _b.REMOVE_ATTRIBUTE:{const{attributeType:r,uri:n}=t.payload,a=(0,v.getBaseUri)(n);if((0,v.isEntityUri)(n)){const t=e[a];return e[a]||console.error(`REMOVE_ATTRIBUTE. uri - ${n}, state: ${JSON.stringify(e)}`),(0,v.isEntitySpecialAttrType)(r)?EA({},e,{[a]:(0,v.removeEntitySpecialAttribute)({entity:t,attributeType:r})}):EA({},e,{[a]:(0,v.removeAttribute)({entity:t,attributeType:r,uri:n})})}return e}case _b.ADD_DEFAULT_VALUES:{const{attributeType:r,parentUri:n,metadata:a,mode:i}=t.payload,o=(0,v.getBaseUri)(n);if((0,v.isEntityUri)(o)){const t=(0,v.getEditableAttributeTypeSubAttributes)(a,r);return(0,O.over)((0,O.lensProp)(o),(0,v.addDefaultValuesToComplexAttribute)({attributeType:r,subAttributes:t,metadata:a,mode:i,parentUri:n}),e)}return e}default:return e}},relations:(e=zA,t)=>{switch(t.type){case Ow.ENTITY_LOADED:{const{silent:r}=t.payload;return r?e:zA}case ew.RELATIONS_LOADED:{const{id:r,connections:n=[],total:a,mode:i}=t.payload;return(0,O.pipe)((0,O.assocPath)([r,"connections"],n),(0,O.assocPath)([r,"total"],a),(0,O.when)((0,O.both)((0,O.complement)((0,O.hasPath)([r,"drafts"])),(0,O.always)((0,v.isEditableMode)(i))),(0,O.assocPath)([r,"drafts"],HA)))(e)}case ew.SECOND_LEVEL_RELATIONS_LOADED:{const{id:r,connections:n,parentEntityUri:a,total:i}=t.payload,o=(0,O.path)([r,"connections"],e).map((e=>{const{entityUri:t}=e.entity;return t===a?VA({},e,{total:i,connections:n.map((e=>VA({},e,{parentEntityUri:a})))}):e}));return(0,O.assocPath)([r,"connections"],o,e)}case Zb.MODE_UPDATED:{const{mode:r,silent:n}=t.payload;return n?e:(0,O.map)(uA(r)?(0,O.omit)(["drafts","relationsToEdit","relationToAdd"]):(0,O.assoc)("drafts",HA),e)}case ew.REMOVE_RELATION:{const{id:r,relationUri:n}=t.payload,a=(0,O.pipe)(v.getRelationUriFromConnection,(0,O.equals)(n)),i=(0,O.path)([r,"connections"],e),o=!((0,v.isTempUri)(n)||null!=i&&i.some((e=>e.suggested&&e.relation.relationUri===n)));return(0,O.evolve)({[r]:{drafts:(0,O.evolve)({removedUris:o?(0,O.append)(n):O.identity,addedConnections:(0,O.reject)(a),editedConnections:(0,O.reject)(a)})}},e)}case ew.IGNORE_RELATION:{const{id:r,ignoredRelationData:n}=t.payload;return(0,O.evolve)({[r]:{drafts:(0,O.evolve)({ignoredRelationData:(0,O.append)(n)})}},e)}case ew.ADD_RELATION:{const{id:r,connection:n}=t.payload,a=(0,O.omit)(["isNew"],n);return(0,O.evolve)({[r]:(0,O.pipe)((0,O.when)((0,O.propSatisfies)(O.isNil,"drafts"),(0,O.assocPath)(["drafts"],HA)),(0,O.evolve)({drafts:{addedConnections:(0,O.prepend)(a)}}))},e)}case ew.EDIT_RELATION:{const{id:r,connection:n}=t.payload,a=(0,O.eqBy)(v.getRelationUriFromConnection,n);if((0,v.isTempUri)((0,v.getRelationUriFromConnection)(n))){const t=e=>{const t=e.findIndex(a);return t>=0?(0,O.update)(t,n,e):e};return(0,O.evolve)({[r]:{drafts:(0,O.evolve)({addedConnections:t})}},e)}{const t=e=>{const t=e.findIndex(a);return t>=0?(0,O.update)(t,n,e):[...e,n]};return(0,O.evolve)({[r]:{drafts:(0,O.evolve)({editedConnections:t})}},e)}}case ew.UPDATE_RELATION_RATING:{const{id:r,connection:n,rating:a,user:i}=t.payload,o=n.initial?n:VA({},n,{initial:{connection:n}}),l=(0,v.isTempUri)((0,v.getRelationUriFromConnection)(o)),s=(0,O.eqBy)(v.getRelationUriFromConnection,o),c=e=>{const t=null==e?void 0:e.findIndex((e=>e.user===i));return!a&&t>=0?e.filter((e=>e.user!==i)):t>=0?(0,O.update)(t,a,e):[...e,a]},u=e=>{const t=e.findIndex(s);return t>=0?(0,O.update)(t,p,e):[...e,p]},p=(0,O.evolve)({relation:e=>VA({},e,{ratings:c((0,O.defaultTo)([],e.ratings))})},o);return(0,O.evolve)({[r]:{drafts:(0,O.evolve)({[l?"addedConnections":"editedConnections"]:u})}},e)}case ew.OPEN_RELATION_EDITOR:{const{id:r,connection:n}=t.payload,a=n.initial?n:VA({},n,{initial:{connection:n}});if(a.isNew){const t=(0,v.getRelationToAddPath)(r);return(0,O.path)(t,e)?e:(0,O.assocPath)(t,a,e)}{const t=(0,O.lensPath)((0,v.getRelationsToEditPath)(r)),n=(0,O.eqBy)((0,O.path)(["relation","relationUri"]),a);return(0,O.over)(t,(0,O.pipe)((0,O.defaultTo)([]),(0,O.unless)((0,O.find)(n),(0,O.append)(a))),e)}}case ew.SET_INITIAL_INFO:{const{id:r,relationUri:n,tempEntity:a}=t.payload,i=YA(r,n,e);return(0,O.assocPath)([...i,"initial","modifiedEntity"],a,e)}case ew.CLOSE_RELATION_EDITOR:{const{id:r,relationUri:n}=t.payload,a=(0,O.pathEq)(["relation","relationUri"],n);return(0,O.evolve)({[r]:{relationToAdd:(0,O.when)(a,(0,O.always)(null)),relationsToEdit:(0,O.reject)(a)}},e)}case ew.SET_RELATION_TYPE:{const{id:r,relationUri:n,relationType:a}=t.payload,i=YA(r,n,e);if(i){const t=[...i,"relation"],r=(0,O.lensPath)(t);return(0,O.over)(r,(0,v.applyRelationTypeObject)(a),e)}return e}case _b.ADD_ATTRIBUTES:return t.payload.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a,viewId:i}=t,o=(0,v.getBaseUri)(n),l=WA(i,o,e);if(l&&(0,v.isRelationUri)(o)){if((0,v.isActivenessAttrType)(r)){const t=(0,O.view)(l,e),n=(0,v.addEntitySpecialAttribute)({entity:t,attributeType:r});return(0,O.set)(l,n,e)}{const t=GA(i,o,e),l=(0,O.view)(t,e);l||console.error(`relations.ADD_ATTRIBUTES. viewId - ${i}, relationUri - ${o}, state: ${JSON.stringify(e)}`);const s=(0,v.addAttribute)({entity:l,attributeType:r,parentUri:n,index:a});return(0,O.set)(t,s,e)}}return e}),e);case _b.ADD_NEXT_PAGE_ATTRIBUTE_VALUES:{const{parentUri:r,attributeTypeName:n,values:a,viewId:i}=t.payload;if(!(0,v.isRelationUri)(r))return e;const o=(0,v.getBaseUri)(r),l=YA(i,o,e),s=(0,O.lensPath)([...l,"relation","object","attributes",n]);return(0,O.over)(s,(0,O.pipe)((0,O.defaultTo)([]),(0,O.append)(a)),e)}case _b.MODIFY_ATTRIBUTE:{const{attributeType:r,viewId:n,uri:a,value:i}=t.payload,o=(0,v.getBaseUri)(a),l=WA(n,o,e);if(l&&(0,v.isRelationUri)(o)){if((0,v.isActivenessAttrType)(r)){const t=(0,O.view)(l,e),n=(0,v.editEntitySpecialAttribute)({entity:t,attributeType:r,value:i});return(0,O.set)(l,n,e)}{const t=GA(n,o,e),l=(0,O.view)(t,e);l||console.error(`relations.MODIFY_ATTRIBUTE. viewId - ${n}, relationUri - ${o}, state: ${JSON.stringify(e)}`);const s=(0,v.editAttribute)({entity:l,attributeType:r,uri:a,value:i});return(0,O.set)(t,s,e)}}return e}case _b.REMOVE_ATTRIBUTE:{const{attributeType:r,uri:n,viewId:a}=t.payload,i=(0,v.getBaseUri)(n),o=WA(a,i,e);if(o&&(0,v.isRelationUri)(i)){if((0,v.isActivenessAttrType)(r)){const t=(0,O.view)(o,e),n=(0,v.removeEntitySpecialAttribute)({entity:t,attributeType:r});return(0,O.set)(o,n,e)}{const t=GA(a,i,e),o=(0,O.view)(t,e);o||console.error(`relations.REMOVE_ATTRIBUTE. viewId - ${a}, relationUri - ${i}, state: ${JSON.stringify(e)}`);const l=(0,v.removeAttribute)({entity:o,attributeType:r,uri:n});return(0,O.set)(t,l,e)}}return e}case ew.SET_RELATION_ENTITY:{const{id:r,relationUri:n,entityInfo:a}=t.payload,i=YA(r,n,e);if(i){const t=[...i,"entity"],r=(0,O.lensPath)(t),{uri:n,label:o,type:l}=a,s=(0,O.isEmpty)(a)?{}:{entityUri:n,entityLabel:o,entityType:l,object:{uri:n,label:o,type:l}};return(0,O.set)(r,s,e)}return e}case _b.ADD_DEFAULT_VALUES:{const{viewId:r,attributeType:n,parentUri:a,metadata:i,mode:o}=t.payload,l=(0,v.getBaseUri)(a);if((0,v.isRelationUri)(l)){const t=YA(r,l,e);if(t){if(n){const r=[...t,"relation","object"],l=(0,v.getAttributeTypeSubAttributes)(i,n);return(0,O.over)((0,O.lensPath)(r),(0,v.addDefaultValuesToComplexAttribute)({attributeType:n,subAttributes:l,metadata:i,mode:o,parentUri:a}),e)}{const r=[...t,"relation","object","attributes"],n=[...t,"relation","object","type"],l=(0,O.view)((0,O.lensPath)(n),e),{attributes:s=[]}=(0,v.getRelationType)(i,l);return(0,O.over)((0,O.lensPath)(r),(0,v.addDefaultValuesToAttributes)({metadata:i,mode:o,attributeTypes:s,parentUri:a}),e)}}return e}return e}default:return e}},trees:(e=vR,t)=>(0,JA.ZP)(e,(r=>{switch(t.type){case Zb.MODE_UPDATED:{const{mode:e,silent:n}=t.payload;if(n)break;Object.keys(null==r?void 0:r.trees).forEach((e=>{lR(r.trees[e].root,"showDetails",!1)})),(0,v.isViewMode)(e)?(r.common.commands=[],r.initialTrees={}):(0,v.isEditableMode)(e)&&((0,v.isEmptyValue)(r.initialTrees)?r.initialTrees=ER({},r.trees):(r.common.commands=[],r.trees=ER({},r.initialTrees)));break}case Zb.MODE_EDITING_CANCELED:case qA.TREES_RESTORE_FROM_INITIAL_TREES:r.trees=ER({},r.initialTrees);break;case qA.TREES_RESET_INITIAL_TREES:r.initialTrees={};break;case Ow.ENTITY_LOADED:{const{silent:r}=t.payload;return r?e:vR}case qA.TREE_LOADED_WITH_ERROR:{const{id:e,errorMessage:n}=t.payload;r.trees[e]=r.trees[e]||{},r.trees[e].errorMessage=n,r.trees[e].loading=!1,delete r.trees[e].root,delete r.trees[e].entitiesMap;break}case qA.TREE_LOADING:{const e=t.payload;r.trees[e]=r.trees[e]||{},r.trees[e].loading=!0;break}case qA.TREE_CHILDREN_LOADING:{const{id:e,parentId:n,nodeId:a}=t.payload,i=r.trees[e].root,o=(0,v.findNodeById)(i,n);o.pending=!1,o.children=(o.children||[]).concat({entity:{},loading:!0,nodeId:a});break}case qA.TREE_CHILDREN_LOADED:{const{children:e,id:n,parentId:a}=t.payload,i=r.trees[n].root,o=(0,v.findNodeById)(i,a);o&&(o.children=((e=[],t=[])=>{const r=(0,O.reject)((0,O.prop)("loading"))(e);return t.forEach((t=>{e.find((e=>(0,O.path)(["entity","uri"],e)===t.entity.uri))||r.push(t)})),r})(o.children,e),delete o.pending);break}case qA.TREE_NODE_REMOVED:{const{id:e,nodeId:n}=t.payload,a=r.trees[e].root,i=(0,v.findParentNodeById)(a,n);aR(i||a,n);break}case qA.TREE_NODE_CREATED:{const{id:e,parentId:n,node:a}=t.payload,i=r.trees[e].root,o=(0,v.findNodeById)(i,n)||i,l=o.children.length;iR(o,a,l);break}case qA.TREE_NODE_EDITED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,v.findNodeById)(a,n.nodeId),o=Object.keys(n);for(const e of o)i[e]=n[e];break}case qA.TREE_NODE_EDITING_STARTED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,v.findNodeById)(a,n.nodeId),o=(0,v.findParentNodeById)(a,n.nodeId);i&&o&&(i.editingMode=v.NODE_EDITING_MODES.editing,i.relatedEntity=o.entity,delete i.loading,i.initialConnection=sR(i),cR({id:e,draft:r.trees,node:i}));break}case qA.TREE_NODE_EDITING_APPLIED:{const{id:e,node:a}=t.payload,i=r.trees[e].root,o=(0,v.findNodeById)(i,a.nodeId),l=dR({id:e,draft:r.trees,relationUri:a.relation.uri});var n;o&&l&&(mR(o),o.entity.uri!==l.entity.uri&&null!==(n=o.children)&&void 0!==n&&n.length&&(delete o.children,o.pending=!0),o.entity=l.entity,o.relation=l.relation,pR({id:e,draft:r.trees,relationUri:a.relation.uri}));break}case qA.TREE_NODE_EDITING_CANCELED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,v.findNodeById)(a,n.nodeId);i&&(mR(i),pR({id:e,draft:r.trees,relationUri:n.relation.uri}));break}case qA.TREE_NODE_NEW_PARENT_EDITING_STARTED:{const{id:e,node:n,newNode:a}=t.payload,i=r.trees[e].root,o=(0,v.findNodeById)(i,n.nodeId);if(a.relatedEntity=o.entity,a.relatedNodeId=o.nodeId,a.editingMode=v.NODE_EDITING_MODES.addingParent,i===o)a.children=[i],r.trees[e].root=a;else{const e=(0,v.findParentNodeById)(i,n.nodeId),t=e.children.findIndex((e=>o===e));iR(e,a,t)}a.initialConnection=sR(a),cR({id:e,draft:r.trees,node:a});break}case qA.TREE_NODE_NEW_PARENT_EDITING_APPLIED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,v.findNodeById)(a,n.nodeId),o=(0,v.findNodeById)(a,n.relatedNodeId),l=dR({id:e,draft:r.trees,relationUri:n.relation.uri});i&&l&&(fR({id:e,draft:r.trees,currentNode:i}),o.parent=o.parent||[],o.parent.push(l.entity.uri),o.relations=o.relations||[],o.relations.push(l.relation),r.trees[e].entitiesMap=((e,t=[])=>nR(e,t.reduce(((e,t)=>eR({},e,{[t.entity.uri]:(0,O.pick)(["entity","parent","relations"],t)})),{})))(r.trees[e].entitiesMap,[o,hR(l)]),pR({id:e,draft:r.trees,relationUri:i.relation.uri}));break}case qA.TREE_NODE_NEW_PARENT_EDITING_CANCELED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,v.findNodeById)(a,n.nodeId);i&&(fR({id:e,draft:r.trees,currentNode:i}),pR({id:e,draft:r.trees,relationUri:i.relation.uri}));break}case qA.TREE_NODE_NEW_CHILD_EDITING_STARTED:{const{id:e,node:n,newNode:a}=t.payload,i=r.trees[e].root,o=(0,v.findNodeById)(i,n.nodeId);a.relatedEntity=o.entity,a.editingMode=v.NODE_EDITING_MODES.addingChild,a.parent=[o.entity.uri],a.directParentUri=o.entity.uri,o.children=o.children||[],o.children.unshift(a),o.expanded=!0,a.initialConnection=sR(a),cR({id:e,draft:r.trees,node:a});break}case qA.TREE_NODE_NEW_CHILD_EDITING_APPLIED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,v.findParentNodeById)(a,n.nodeId),o=(0,v.findNodeById)(i,n.nodeId),l=dR({id:e,draft:r.trees,relationUri:n.relation.uri});i&&o&&l&&(mR(o),o.entity=l.entity,o.relation=l.relation,o.relations=[l.relation],pR({id:e,draft:r.trees,relationUri:n.relation.uri}));break}case qA.TREE_NODE_NEW_CHILD_EDITING_CANCELED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,v.findParentNodeById)(a,n.nodeId);i&&(aR(i,n.nodeId),pR({id:e,draft:r.trees,relationUri:n.relation.uri}));break}case qA.TREE_NODE_RELATION_TYPE_CHANGED:{const{id:e,node:n,relationTypeUri:a}=t.payload,i=dR({id:e,draft:r.trees,relationUri:n.relation.uri}).relation.type;i!==a&&(i&&uR({id:e,draft:r.trees,node:n,entity:null}),(({id:e,draft:t,node:r,relationTypeUri:n})=>{oR({path:["editingConnections",r.relation.uri,"relation"],object:t[e],value:e=>eR({},e,{type:n,attributes:{}})})})({id:e,draft:r.trees,node:n,relationTypeUri:a}));break}case qA.TREE_NODE_ENTITY_CHANGED:{const{id:e,node:n,entity:a}=t.payload;uR({id:e,draft:r.trees,node:n,entity:a});break}case _b.ADD_ATTRIBUTES:return t.payload.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a,viewId:i}=t,o=(0,v.getBaseUri)(n),l=yR(i,o,e.trees);if(l&&(0,v.isRelationUri)(o)){const t=(0,O.view)(l,e.trees);if((0,v.isActivenessAttrType)(r)){const n=(0,v.addEntitySpecialAttribute)({entity:t,attributeType:r});return ER({},e,{trees:(0,O.set)(l,n,e.trees)})}{const i=(0,v.addAttribute)({entity:t,attributeType:r,parentUri:n,index:a});return ER({},e,{trees:(0,O.set)(l,i,e.trees)})}}return e}),e);case _b.MODIFY_ATTRIBUTE:{const{attributeType:r,viewId:n,uri:a,value:i}=t.payload,o=(0,v.getBaseUri)(a),l=yR(n,o,e.trees);if(l&&(0,v.isRelationUri)(o)){const t=(0,O.view)(l,e.trees);if((0,v.isActivenessAttrType)(r)){const n=(0,v.editEntitySpecialAttribute)({entity:t,attributeType:r,value:i});return ER({},e,{trees:(0,O.set)(l,n,e.trees)})}{const n=(0,v.editAttribute)({entity:t,attributeType:r,uri:a,value:i});return ER({},e,{trees:(0,O.set)(l,n,e.trees)})}}return e}case _b.REMOVE_ATTRIBUTE:{const{attributeType:r,uri:n,viewId:a}=t.payload,i=(0,v.getBaseUri)(n),o=yR(a,i,e.trees);if(o&&(0,v.isRelationUri)(i)){const t=(0,O.view)(o,e.trees);if((0,v.isActivenessAttrType)(r)){const n=(0,v.removeEntitySpecialAttribute)({entity:t,attributeType:r});return ER({},e,{trees:(0,O.set)(o,n,e.trees)})}{const a=(0,v.removeAttribute)({entity:t,attributeType:r,uri:n});return ER({},e,{trees:(0,O.set)(o,a,e.trees)})}}return e}case _b.ADD_DEFAULT_VALUES:{const{viewId:r,attributeType:n,parentUri:a,metadata:i,mode:o}=t.payload,l=(0,v.getBaseUri)(a),s=yR(r,l,e.trees);if((0,v.isRelationUri)(l)&&s){if(n){const t=(0,v.getAttributeTypeSubAttributes)(i,n);return ER({},e,{trees:(0,O.over)(s,(0,v.addDefaultValuesToComplexAttribute)({attributeType:n,subAttributes:t,metadata:i,mode:o,parentUri:a}),e.trees)})}{const t=(0,O.compose)(s,(0,O.lensPath)(["attributes"])),r=(0,O.compose)(s,(0,O.lensPath)(["type"])),n=(0,O.view)(r,e.trees),{attributes:l=[]}=(0,v.getRelationType)(i,n);return ER({},e,{trees:(0,O.over)(t,(0,v.addDefaultValuesToAttributes)({metadata:i,mode:o,attributeTypes:l,parentUri:a}),e.trees)})}}return e}case qA.TREE_ENTITIES_MAPPING_LOADED:{const{id:e,entitiesSubMap:n}=t.payload,a=r.trees[e].entitiesMap;r.trees[e].entitiesMap=nR(a,n);break}case qA.TREE_LOADED:{const{tree:e,id:n,graphTypes:a,activenessDate:i,isReversed:o}=t.payload,l=gR(r.trees[n]||{});r.trees[n]=ER({},l,e,{graphTypes:a,activenessDate:i,isReversed:o}),delete r.trees[n].errorMessage,r.trees[n].loading=!1;break}case qA.TREE_SORTED:{const{id:e,typesLabelsMap:n={},sortField:a,sortOrder:i}=t.payload;r.trees[e]=r.trees[e]||{},r.trees[e].sortField=a,r.trees[e].sortOrder=i,r.trees[e].root&&(r.trees[e].root=(0,v.mapTree)(r.trees[e].root,{childrenProcessing:(0,v.sortTreeChildren)({sortField:a,sortOrder:i,typesLabelsMap:n})}));break}case qA.TREE_SECONDARY_LABEL_SHOWN:{const{id:e,show:n}=t.payload;r.trees[e].showSecondaryLabel=n,r.trees[e].root=ER({},r.trees[e].root);break}case qA.TREES_STATE_RESTORED:{const e=t.payload;Object.keys(e).forEach((t=>{r.trees[t]=r.trees[t]||{},r.trees[t]=ER({},r.trees[t],e[t]),r.trees[t].root&&(r.trees[t].root=ER({},r.trees[t].root))}));break}case qA.TREE_CHANGED:{const{id:e,tree:n}=t.payload;r.trees[e].root=n;break}case qA.TREE_REFRESHED:{const e=t.payload;r.trees[e].root=ER({},r.trees[e].root);break}case qA.TREE_NODE_EXPANDED:{const{id:e,nodeId:n}=t.payload,a=r.trees[e].root;(0,v.findNodeById)(a,n).expanded=!0;break}case qA.TREE_CURRENT_ENTITY_SHOWN:{const{id:n,uri:a=(0,O.path)(["entity","uri"],e)}=t.payload;if(r.trees[n]){const e=rR(r.trees[n].root,a);r.trees[n].scrollTo=e}break}case qA.TREE_SCROLL_TO_NODE_RESET:{const e=t.payload;r.trees[e]&&(r.trees[e].scrollTo=null);break}case qA.TREE_ACTIVENESS_DATE_CHANGED:{const{id:e,activenessDate:n}=t.payload;r.trees[e].activenessDate=n;break}case qA.TREE_RELATION_REPOINTED:{const{entity:e,relation:n,newParent:a,isReversed:i}=t.payload,o=(0,O.prop)("uri"),l=o(e),s=o(a),c=(0,v.createRelationRepointCommand)({entityUri:l,relation:n,newEntityUri:s,isReversed:i});r.common.commands.push(c);break}case qA.TREE_RELATION_REMOVED:{const{relationUri:e}=t.payload;if((0,v.isTempUri)(e))r.common.commands=(0,O.reject)((0,v.isRelationCommandForUri)(e),r.common.commands);else{const t=(0,v.createRelationDeleteCommand)({relationUri:e});r.common.commands.push(t)}break}case qA.TREE_RELATION_CREATED:{const{entityUri:e,relation:n,parentEntityUri:a}=t.payload,i=(0,v.createRelationCreateCommand)({parentUri:a,relation:n,entityUri:e});r.common.commands.push(i);break}case qA.TREE_RELATION_EDITED:{const{oldRelation:e,newRelation:n,entityUri:a,newEntityUri:i,isReversed:o}=t.payload,l=i?(0,v.createRelationRepointCommand)({entityUri:a,newEntityUri:i,relation:n,isReversed:o}):(0,v.createRelationUpdateCommand)({oldRelation:e,newRelation:n});r.common.commands.push(l);break}case qA.TREE_COMMANDS_CLEARED:r.common.commands=[];break;case qA.TREE_CANCEL_CHILDREN_LOADING:{const{id:e,parentId:n}=t.payload,a=r.trees[e].root,i=(0,v.findNodeById)(a,n);i&&(i.pending=!0,delete i.expanded,delete i.children);break}}})),operation:(e=null,t)=>t.type===N_.PROFILE_OPERATION_UPDATE?t.payload:e,views:(e=null,t)=>t.type===G_.PROFILE_VIEWS_SET?t.payload:e,sidePanelViews:(e=wI,t)=>t.type===CI.SIDE_PANEL_VIEWS_LOADED?t.payload:e,entityRelatedAttributes:(e=OR,t)=>{switch(t.type){case TR.ENTITY_RELATED_ATTRIBUTES_ADDED:{const{attributeTypeUri:r,entityUri:n,attributes:a}=t.payload;return(0,O.assocPath)([r,n],a,e)}case Zb.MODE_UPDATED:{const{mode:r,silent:n}=t.payload;return(0,v.isViewMode)(r)&&!n?OR:e}default:return e}},hiddenAttributes:(e=II,t)=>{switch(t.type){case AI.HIDDEN_ATTRIBUTES_UPDATED:{const{uri:r,hiddenAttributes:n}=t.payload;return(0,O.assoc)(r,n,e)}case AI.HIDDEN_ATTRIBUTES_RESET:return(0,O.dissoc)(t.payload,e);default:return e}},controlAttributes:(e=DI,t)=>t.type===NI.CONTROL_ATTRIBUTES_UPDATED?t.payload:e});r(39235),r(58512),r(36801);const LI={getModule:()=>({id:"mdm",reducerMap:{dataTenants:vb,tenants:Ob,metadata:Rb,profile:kI,tenant:CO,environment:PO,user:EO,ui:gO,search:Rv},sagas:[...AA,...Tw,...xI,...xv]}),selectors:c},UI=LI,jI=({className:e})=>{const t=(0,Pp.useDispatch)(),r=(0,Pp.useSelector)(ki.qx),n=(0,Pp.useSelector)(UI.selectors.getGoogleMapKey),a=(0,Rp.useMemo)((()=>((e,t)=>(0,O.when)((0,O.always)(!t),(0,O.reject)((0,O.propEq)("id",B.om.MAP)))(e))([{id:B.om.MAP,tooltipTitle:li().text("View map"),Icon:hb()},{id:B.om.PROFILE,tooltipTitle:li().text("View entity details"),Icon:yb()}],n)),[n]);return _p().createElement(ab,{className:e,modes:a,modeId:r,onChange:e=>{t(Ni(r!==e?e:null))}})};jI.propTypes={className:Np().string};const FI=jI,MI=()=>_p().createElement("div",{className:Yd},_p().createElement("div",{className:"Headers-styles-title--TvsMA"},li().text("Profiles")),_p().createElement("div",{className:Wd},_p().createElement(mb,null),_p().createElement(FI,{className:Gd})));var VI=r(12932),BI=r.n(VI),zI=r(83754),HI=r.n(zI);const YI=(0,qp.Z)({tabsRoot:{width:"100%"},tabsScrollButton:{flex:"0 0 24px"},tabRoot:{fontSize:"0.875rem",padding:"7px 18px 5px","@media (min-width: 960px)":{minWidth:"inherit"},"&$disabled":{pointerEvents:"auto"}},labelWrapper:{whiteSpace:"nowrap",letterSpacing:"normal",display:"flex",flexDirection:"row",width:"100%"},label:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",fontWeight:500},disabled:{}});function WI(){return WI=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},WI.apply(null,arguments)}function GI(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}const qI=e=>{let{value:t,tabs:r=[],onChange:n,tabClasses:a}=e,i=GI(e,["value","tabs","onChange","tabClasses"]);const o=YI(),l=(e,t)=>_p().createElement("span",{className:o.labelWrapper},_p().createElement(_d.Y,{value:e},_p().createElement("span",{className:o.label},e)),t);return _p().createElement(BI(),WI({value:t,onChange:(e,t)=>n(t),classes:{root:o.tabsRoot,scrollButtons:o.tabsScrollButton},indicatorColor:"primary",textColor:"primary",variant:"scrollable",scrollButtons:!0},i,{allowScrollButtonsMobile:!0}),r.map((e=>{let{label:t,value:r,additionalLabel:n,dataReltioId:i}=e,s=GI(e,["label","value","additionalLabel","dataReltioId"]);return _p().createElement(HI(),WI({classes:a||{root:o.tabRoot,disabled:o.disabled},key:r,value:r,label:l(t,n),"data-reltio-id":i},s))})))};function ZI(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class $I extends Rp.PureComponent{constructor(...e){super(...e),this.getTabsData=()=>{const{tenantObject:e,tableViewTabs:t,selectedEntityTypes:r,metadata:n}=this.props,a=(0,zy.ZK)(t,e);return(0,Di.nx)(n,a,r).map((e=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){ZI(e,t,r[t])}))}return e}({},e,{additionalLabel:_p().createElement("span",{className:"Headers-styles-number--trErH"},"(",void 0===e.number?li().text("N/A"):(0,ni.k7)(e.number),")")})))},this.onTabChange=e=>{this.props.dispatch(xi(e))},this.onSelectColumns=e=>{const{dispatch:t,entityTypeTab:r,columnsForEntityType:n}=this.props;return t(Si(r,e,n))},this.renderTabs=()=>{const{entityTypeTab:e}=this.props;return _p().createElement("div",{className:"Headers-styles-tabsContainer--lhDXc"},_p().createElement(qI,{value:e,tabs:this.getTabsData(),onChange:this.onTabChange}))}}render(){const{entityTypeTab:e,columnsForEntityType:t}=this.props;return _p().createElement("div",{className:Yd},this.renderTabs(),_p().createElement("div",{className:Wd},_p().createElement($d,{entityTypeUri:e,headColumns:t,onSelectColumns:this.onSelectColumns,"data-reltio-id":"reltio-search-table-add-remove-column",disabled:!e,showForDisabled:!0}),_p().createElement(Kf(),{orientation:"vertical",className:"Headers-styles-splitter--sCvn6"}),_p().createElement(mb,null),_p().createElement(FI,{className:Gd})))}}const KI=(0,Pp.connect)((e=>{const t=(0,ki.o4)(e);return{metadata:A().selectors.getMetadata(e),selectedEntityTypes:(0,C.DX)(e),tableViewTabs:(0,ki.gu)(e),entityTypeTab:t,columnsForEntityType:(0,ki.Gv)(e,t),tenantObject:(0,ai.t9)(e)}}))($I);function XI(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class QI extends _p().PureComponent{constructor(...e){super(...e),this.entitiesTableRef=this.props.basicTableRef||_p().createRef(),this.state={resizeDebounceDelay:void 0},this.sortHandle=({field:e,order:t})=>{this.props.dispatch((({field:e,order:t,entityTypeUri:r})=>({type:_.Z.CHANGE_SORT,payload:{field:e,order:t,entityTypeUri:r}}))({field:t?e:null,order:t,entityTypeUri:this.props.entityTypeUri}))},this.reorderingHandle=({what:e,where:t})=>{const{entityTypeUri:r,dispatch:n,headColumns:a}=this.props;n(((e,t)=>({type:ge,payload:{entityTypeUri:e,columns:t}}))(r,(0,O.move)(e.columnIndex,t.columnIndex,a)))},this.changeColumnsListHandle=({columns:e})=>{const{entityTypeUri:t,dispatch:r,headColumns:n}=this.props;r(Si(t,e,n))},this.changeColumnsSizeHandle=e=>{const{headColumns:t,entityTypeUri:r,dispatch:n}=this.props,a=t.map(((t,r)=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){XI(e,t,r[t])}))}return e}({},t,{size:e[r].size,autoResize:(t.autoResize??0!==r)&&!e[r].manuallyChanged})));n(((e,t)=>({type:he,payload:{entityTypeUri:e,columns:t}}))(r,a)),this.setState({resizeDebounceDelay:void 0})},this.logger=e=>{this.props.dispatch({type:"TABLE_LOG",payload:e})}}componentDidUpdate(e){const{headColumns:t,sortField:r,sortOrder:n,entities:a,entityTypeUri:i}=this.props;this.entitiesTableRef.current&&(t.length!==(0,O.path)(["headColumns","length"],e)||(0,O.difference)((0,O.omit)(["size"],t),(0,O.omit)(["size"],e.headColumns)).length>0||r!==e.sortField||n!==e.sortOrder||a!==e.entities)&&this.entitiesTableRef.current.resetScrollbarPosition(),e.entityTypeUri!==i&&this.setState({resizeDebounceDelay:0})}render(){const{entities:e,entityToHighlight:t,onScroll:r,entityTypeUri:n,headColumns:a,sortField:i,sortOrder:o,additionalColumns:l,selectedEntityUri:s,dndColumnReorderingEnabled:c,onEntityClick:u,onEntityHover:p,entitiesImportStatus:d,onEntityImportStatusChange:m}=this.props;return _p().createElement(_f,{entities:e,entityToHighlight:t,selectedEntityUri:s,onScroll:r,onSort:this.sortHandle,onEntityClick:u,onEntityHover:p,entityTypeUri:n,headColumns:a,sortField:i,sortOrder:o,dndColumnReorderingEnabled:c,onReorderingColumn:this.reorderingHandle,entitiesTableRef:this.entitiesTableRef,onChangeColumnsList:this.changeColumnsListHandle,onChangeColumnsSize:this.changeColumnsSizeHandle,additionalColumns:l,entitiesImportStatus:d,onEntityImportStatusChange:m,logger:this.logger,resizeDebounceDelay:this.state.resizeDebounceDelay})}}QI.propTypes={entities:Np().array,entityToHighlight:Np().string,selectedEntityUri:Np().string,headColumns:Np().array,onScroll:Np().func,entityTypeUri:Np().string,sortField:Np().string,sortOrder:Np().oneOf([Kd.oy,Kd.U9]),dndColumnReorderingEnabled:Np().bool,dispatch:Np().func,additionalColumns:Np().arrayOf(Np().shape({id:Np().string,label:Np().string})),onEntityClick:Np().func,onEntityHover:Np().func,entitiesImportStatus:Np().object,onEntityImportStatusChange:Np().func,basicTableRef:Np().shape({current:Np().object})},QI.defaultProps={entities:[],headColumns:[]};const JI=(0,ay.Z)(Di.oq),eN=(0,Pp.connect)((e=>{const t=(0,ki.tB)(e),r=(0,ki.Gv)(e,t),n=A().selectors.getMetadata(e),a=JI(n,t,r);return{sortField:(0,ai.NW)(e,{entityTypeUri:(0,ki.o4)(e)}),sortOrder:(0,ai.L9)(e,{entityTypeUri:(0,ki.o4)(e)}),dndColumnReorderingEnabled:!(0,ki.Ue)(e),headColumns:r,entityTypeUri:t,additionalColumns:a}}))(QI);var tN=r(14058),rN=r.n(tN);const nN=(0,qp.Z)((()=>({container:{position:"relative",height:"100%",width:"100%"},closeButton:{position:"absolute",top:"7px",left:"7px",zIndex:1}}))),aN=(0,qp.Z)((e=>({profileBandWrapper:{flexShrink:0},profileBand:{display:"flex",padding:"16px 12px 16px 16px",alignItems:"flex-start",backgroundColor:"#fff",boxShadow:"0px 1px 0px rgba(0, 0, 0, 0.12)",marginBottom:"1px","&:after":{content:'""',minHeight:"inherit",fontSize:0}},inactive:{background:e.inactiveBackground},profileIcon:{marginRight:"12px"},imageProfileIcon:{width:"48px",height:"48px"},profileInfo:{display:"flex",flexDirection:"column",flex:"1 1 50%"},badge:{},label:{lineHeight:"1.2",letterSpacing:"0.25px",color:e.palette.text.primary,wordBreak:"break-word","&+ $specialInfo":{marginTop:"4px"}},secondaryLabel:{display:"inline-flex",color:e.palette.text.primary,marginTop:"2px",lineHeight:"16px",fontSize:"14px",fontWeight:400,"&+ $businessCard":{marginLeft:"12px"}},businessCard:{color:e.palette.text.secondary,display:"inline-flex",fontSize:"14px",marginTop:"4px",lineHeight:"1.2"},specialInfo:{display:"flex",justifyContent:"space-between",flexWrap:"wrap",width:"100%",marginTop:"8px"},entityType:{display:"flex",flexWrap:"wrap"},entityId:{fontSize:"13px",color:e.palette.text.secondary,whiteSpace:"nowrap",cursor:"pointer","&:hover":{textDecoration:"underline"}}}))),iN=({className:e,entity:t,children:r,classes:n,renderLabel:a=O.identity})=>{const i=aN({classes:n}),o=(0,ly.AH)(),l=(0,ly.QQ)(),s=(0,Rp.useCallback)((()=>{navigator.clipboard.writeText((0,v.getEntityId)(t))}),[t]);if((0,O.isNil)(t))return null;const c=(0,v.getLabel)(t.label),u=t.secondaryLabel,p=(0,v.getBusinessCardAttributesText)(o,t),d=(0,v.isActiveObject)(t),m=t.uri,f=(0,v.getEntityId)(t);return _p().createElement("div",{className:kp()(i.profileBandWrapper,e),"data-reltio-id":"reltio-profile-band"},_p().createElement("div",{className:kp()(i.profileBand,{[i.inactive]:!d}),"data-entity-uri":m},_p().createElement(b.A,{key:t.uri,entity:t,avatarClassName:i.profileIcon,imageClassName:i.imageProfileIcon}),_p().createElement("div",{className:i.profileInfo},_p().createElement("div",null,_p().createElement(zf(),{variant:"h6",className:i.label},a(c)),u&&_p().createElement(zf(),{variant:"subtitle2",className:i.secondaryLabel},u),p&&_p().createElement(zf(),{variant:"subtitle1",className:i.businessCard},p)),_p().createElement("div",{className:i.specialInfo},_p().createElement("div",{className:i.entityType},_p().createElement(kE,{entity:t,size:"medium",className:i.badge}),!(0,v.isTempUri)(m)&&l&&_p().createElement(Rg(),{title:li().text("Copy to clipboard")},_p().createElement(zf(),{display:"inline",variant:"body2",className:i.entityId,onClick:s},li().text("Entity ID"),": ",f))))),r&&_p().createElement("div",null,r)))},oN=_p().createContext(!1);oN.displayName="BlockImageGalleryDialogContext";var lN=r(31574),sN=r.n(lN);const cN=_p().createContext([]),uN=(0,Rp.createContext)([]);uN.displayName="AlwaysVisibleAttributesContext";var pN=r(24436),dN=r.n(pN);function mN(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){fN(e,t,r[t])}))}return e}function fN(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const yN=(0,qp.Z)((e=>({basicViewPaper:mN({display:"flex",flexDirection:"column"},e.basicView)})));function gN(){return gN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gN.apply(null,arguments)}const hN=(0,Rp.forwardRef)(((e,t)=>{let{children:r,className:n}=e,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["children","className"]);const i=yN();return _p().createElement(dN(),gN({ref:t,className:n,classes:{root:i.basicViewPaper}},a),r)}));hN.displayName="BasicView";var EN=r(52574);const bN="1px solid #AFD4E9",vN=(0,qp.Z)({decorator:{marginLeft:8,borderLeft:bN,"&:last-child":{borderLeft:"none","&:before":{borderLeft:bN}},"&:before":{top:0,height:14,width:5,borderBottom:bN,content:'""',display:"block",left:"0"},"&$plain":{"&:before":{width:0}}},plain:{},wrapper:{marginLeft:16,marginTop:-8}}),TN=({className:e,children:t,plain:r=!1,enabled:n=!1})=>{const a=vN();return n?_p().createElement("div",{"data-reltio-id":"branch-decorator",className:kp()(a.decorator,{[a.plain]:r},e)},_p().createElement("div",{className:a.wrapper},t)):_p().createElement(_p().Fragment,null,t)},ON="commentsContainerVisibilityArea",SN=_p().createContext([]);SN.displayName="RelatedObjectUrisContext";const xN={comments:[],commentsMap:null,currentComment:null,updateCommentState:O.identity,clearCommentState:O.identity,getCommentState:()=>({}),getComment:O.identity,getComments:()=>new Promise(O.identity),getCommentsCount:O.identity,createComment:()=>new Promise(O.identity),editComment:()=>new Promise(O.identity),createReply:()=>new Promise(O.identity),resolveThread:O.identity,reOpenThread:O.identity,clearCurrentComment:O.identity,deleteComment:O.identity,sending:!1,loading:!1,pageToken:null,deleteReply:O.identity,editReply:()=>new Promise(O.identity)},CN=_p().createContext(xN);function wN(){return wN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},wN.apply(null,arguments)}CN.displayName="CollaborationContext";const AN=e=>_p().createElement("svg",wN({width:20,height:20,fillOpacity:.54,fill:"#000",fillRule:"nonzero",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgCommentBubble"},e),_p().createElement("path",{d:"M2.8 1h14.4c.99 0 1.8.81 1.8 1.8v10.8c0 .99-.81 1.8-1.8 1.8H4.6L1 19V2.8C1 1.81 1.81 1 2.8 1z"})),RN=(0,qp.Z)((()=>({root:{position:"relative",height:"18px",display:"flex",alignItems:"center",justifyContent:"center",marginLeft:"4px",cursor:"pointer"},icon:{"&:hover":{fillOpacity:.7}}})));function _N(){return _N=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_N.apply(null,arguments)}const IN=_p().forwardRef(((e,t)=>{let{children:r,tooltipTitle:n,icon:a,onClick:i,className:o}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["children","tooltipTitle","icon","onClick","className"]);const s=RN();return _p().createElement(Rg(),{title:n},_p().createElement("div",_N({ref:t,className:kp()(s.root,o),onClick:i},l),_p().createElement(a,{className:s.icon}),r))}));IN.displayName="BasicCommentButton";const NN=(0,qp.Z)({childrenWrapper:{position:"absolute",width:"100%",height:"100%",lineHeight:"15px",display:"flex",alignItems:"center",justifyContent:"center",top:"-2px",left:0,right:0,bottom:0,color:"white",fontSize:"10px",pointerEvents:"none"}}),PN=_p().forwardRef((({children:e,onClick:t},r)=>{const n=NN();return _p().createElement(IN,{ref:r,tooltipTitle:li().text("Show comment"),icon:AN,onClick:t,"data-reltio-id":"reltio-comment-button"},_p().createElement("div",{className:n.childrenWrapper},e))}));function DN(){return DN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},DN.apply(null,arguments)}PN.displayName="CommentButton";const kN=e=>_p().createElement("svg",DN({width:20,height:20,fillOpacity:.54,fill:"#000",fillRule:"nonzero",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgAddComment"},e),_p().createElement("path",{d:"M2.8 14.653L3.853 13.6H17.2V2.8H2.8v11.853zM17.2 1c.99 0 1.8.81 1.8 1.8v10.8c0 .99-.81 1.8-1.8 1.8H4.6L1 19V2.8C1 1.81 1.81 1 2.8 1h14.4zm-6.3 3.6H9.1v2.699L6.4 7.3v1.8l2.7-.001V11.8h1.8V9.099l2.7.001V7.3l-2.7-.001V4.6z"})),LN=({className:e,onClick:t})=>_p().createElement(IN,{className:e,onClick:t,tooltipTitle:li().text("Add comment"),icon:kN});var UN=r(94511),jN=r.n(UN),FN=r(59674);const MN=(0,qp.Z)((e=>{const t=e.palette.background.paper;return{paper:{backgroundColor:t,maxWidth:1e3},popper:{'&[data-popper-placement*="bottom"] $arrow':{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},'&[data-popper-placement*="top"] $arrow':{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},'&[data-popper-placement*="right"] $arrow':{left:0,marginLeft:"-0.71em",height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}},'&[data-popper-placement*="left"] $arrow':{right:0,marginRight:"-0.71em",height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}}},arrow:{overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:t,"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",boxShadow:e.shadows[1],backgroundColor:"currentColor",transform:"rotate(45deg)"}}}}));function VN(){return VN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},VN.apply(null,arguments)}const BN=e=>{let{children:t,className:r,classes:n,transition:a}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["children","className","classes","transition"]);const o=MN(),l=a?jN():_p().Fragment,[s,c]=(0,Rp.useState)(null);return _p().createElement(FN.r,VN({className:kp()(o.popper,r),modifiers:[{name:"preventOverflow",enabled:!0,options:{rootBoundary:"viewport",padding:14,altAxis:!0}},{name:"arrow",enabled:!0,options:{element:s,padding:4}}],transition:a,excludeAnchorFromBackdrop:!1},i),(({TransitionProps:e})=>_p().createElement(l,e,_p().createElement(dN(),{className:kp()(o.paper,null==n?void 0:n.root)},_p().createElement("span",{className:kp()(o.arrow,null==n?void 0:n.arrow),ref:c}),t))))};var zN=r(93526),HN=r.n(zN);const YN=(0,qp.Z)((e=>({menuItem:{minHeight:"32px"},menuText:{color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px",letterSpacing:0}}))),WN=(0,Id.T)(gd()),GN=(0,Rp.forwardRef)((({item:e,onMenuClose:t=O.identity},r)=>{const n=YN(),{disabled:a,text:i,tooltip:o,onClick:l,id:s="",selectable:c,selected:u}=e;return _p().createElement(WN,{tooltipTitle:o,showForDisabled:!0,classes:{root:n.menuItem},onClick:e=>{t(e),l(e)},disabled:a,ref:r,"data-modal":!0,"data-reltio-id":`reltio-search-menu-item${s}`},c&&_p().createElement(fd(),{checked:u,color:"primary"}),_p().createElement(zf(),{classes:{root:n.menuText}},i))}));GN.displayName="DefaultMenuItemRenderer";const qN=(0,qp.Z)((e=>({buttonRoot:{"&$selected":{color:e.palette.action.active,backgroundColor:(0,$m.alpha)(e.palette.action.active,.12),"&:hover":{backgroundColor:(0,$m.alpha)(e.palette.action.active,.15)}}},selected:{},paper:{minWidth:"112px"}})));function ZN(){return ZN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ZN.apply(null,arguments)}function $N({className:e,menuId:t,buttonComponent:r=hE(),buttonContent:n,menuItems:a=[],buttonProps:i={},popoverProps:o={},onMenuOpen:l=O.identity,onMenuClose:s=O.identity,MenuItemRenderer:c=GN}){const u=r,p=qN(),d=(0,Rp.useRef)(),[m,f]=(0,Rp.useState)(!1);(0,FE.D)((()=>{m?l():s()}),[m]);const y=(0,Rp.useCallback)((e=>{null==e||e.stopPropagation(),f((e=>!e))}),[]);return _p().createElement(_p().Fragment,null,_p().createElement(u,ZN({"data-reltio-id":"drop-down-menu-button",ref:d,className:kp()(p.buttonRoot,{[p.selected]:m},e),onClick:y,"aria-pressed":m,"aria-controls":m?t:void 0,"aria-haspopup":"true"},i),n),_p().createElement(HN(),ZN({id:t,variant:"menu",open:m,autoFocus:!1,classes:{paper:p.paper},anchorEl:d.current,onClose:y,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},elevation:2,MenuListProps:{autoFocusItem:m}},o),a.map(((e,t)=>_p().createElement(c,{item:e,key:t,onMenuClose:y})))))}const KN=(e,t)=>{(0,Rp.useEffect)((()=>{if(t){var r,n,a,i;const t=null===(r=e.current)||void 0===r||null===(n=r.value)||void 0===n?void 0:n.length;null===(a=e.current)||void 0===a||a.focus(),null===(i=e.current)||void 0===i||i.setSelectionRange(t,t)}}),[e,t])},XN=(e,t)=>{const r=e.relatedObjectUris.indexOf(t);if(r>=0)return e.relatedObjectUris[1-r]},QN=e=>`${li().date(e,"LT")} ${li().date(e,"LL")}`,JN=e=>`comment/${e.commentId}`,eP=(e,t)=>`comment/${e.commentId}/reply/${t.replyId}`,tP=(e,t)=>{let r=e;for(const e of t)r=r.split(`+${e}`).join(`@[${e}](${e})`);return r},rP=_p().createContext({});rP.displayName="EntitiesMapContext";const nP=(0,qp.Z)((e=>({title:{marginBottom:"10px",color:e.palette.divider,fontSize:"12px",lineHeight:"14px"},label:{paddingLeft:"9px",borderLeft:"1px solid #D8D8D8",fontSize:"13px",color:e.palette.text.primary,lineHeight:"15px"},link:{color:e.palette.primary.main,textDecoration:"none"}})));function aP(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const iP=({comment:e,className:t})=>{const r=nP(),n=(0,Rp.useContext)(rP),a=(0,ly.AH)(),i=(0,ly.eh)();return _p().createElement(sN(),{className:t},(()=>{switch(e.objectType){case v.CollaborationObjectTypes.ENTITY_ATTRIBUTE:{const t=(0,v.getAttributeTypeUriByValueUri)(e.objectId,i.type),n=(0,v.findAttributeTypeByUri)(a,t);return _p().createElement(_p().Fragment,null,_p().createElement(zf(),{className:r.title},li().text("Selected attribute:")),_p().createElement(zf(),{className:r.label},null==n?void 0:n.label))}case v.CollaborationObjectTypes.RELATION_ATTRIBUTE:{const t=e.relatedObjectUris.find((0,O.startsWith)("configuration/relationTypes")),n=t&&(0,v.getAttributeTypeUriByValueUri)(e.objectId,t),i=n&&(0,v.findAttributeTypeByUri)(a,n);return _p().createElement(_p().Fragment,null,_p().createElement(zf(),{className:r.title},li().text("Selected attribute:")),_p().createElement(zf(),{className:r.label},null==i?void 0:i.label))}case v.CollaborationObjectTypes.ENTITY:return _p().createElement(_p().Fragment,null,_p().createElement(zf(),{className:r.title},li().text("Selected profile:")),_p().createElement(om.x,{className:kp()(r.label,r.link),value:(0,v.getEntityUriForLink)(i)},(0,v.getLabel)(i.label)));case v.CollaborationObjectTypes.RELATION:{const t=XN(e,i.uri),a=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){aP(e,t,r[t])}))}return e}({},n[t]||{},{uri:t});return _p().createElement(_p().Fragment,null,_p().createElement(zf(),{className:r.title},li().text("Selected relation:")),_p().createElement(zf(),{className:r.label},_p().createElement(om.x,{className:r.link,value:(0,v.getEntityUriForLink)(i)},(0,v.getLabel)(i.label)),t&&_p().createElement(_p().Fragment,null,` ${li().text("to")} `,_p().createElement(om.x,{className:r.link,value:(0,v.getEntityUriForLink)(a)},a.label?(0,v.getLabel)(a.label):(0,v.getEntityId)(a)))))}case v.CollaborationObjectTypes.POTENTIAL_MATCH:{var t;const a=XN(e,i.uri),o={uri:a,label:null===(t=n[a])||void 0===t?void 0:t.label};return _p().createElement(_p().Fragment,null,_p().createElement(zf(),{className:r.title},li().text("Selected potential match:")),_p().createElement(zf(),{className:r.label},_p().createElement(om.x,{className:r.link,value:(0,v.getEntityUriForLink)(i)},(0,v.getLabel)(i.label)),a&&_p().createElement(_p().Fragment,null,` ${li().text("and")} `,_p().createElement(om.x,{className:r.link,value:(0,v.getEntityUriForLink)(o)},o.label?(0,v.getLabel)(o.label):(0,v.getEntityId)(o)))))}default:return null}})())},oP=_p().createContext([]);oP.displayName="UsersContext";const lP=(0,qp.Z)((e=>({root:{color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px",wordBreak:"break-word"}}))),sP=({comment:e,className:t})=>{const r=lP(),n=(0,Rp.useContext)(oP);return _p().createElement(zf(),{className:kp()(r.root,t)},((e,t,r=e=>e,n="+")=>{const a=[];let i="",o=!1;for(let l=0;l<=e.length;l++){const s=e[l],c=e[l+1],u=l===e.length-1;i+=s,s===n&&0===l&&(o=!0),o&&t.includes(i.slice(n.length))&&(o=!1,a.push(r(i)),i=""),c===n&&(o=!0,a.push(i),i=""),u&&a.push(i)}return a})(e.content,e.namedUsers,(e=>{const t=n.find((t=>t.username===e.slice(1)));return t?_p().createElement(Ay(),{href:`mailto:${t.email}`,underline:"hover"},e):e})).map(((e,t)=>_p().createElement(Rp.Fragment,{key:t},e))))},cP=(0,qp.Z)((e=>({root:{width:"32px",height:"32px",fontSize:"12px",color:e.palette.text.secondary,backgroundColor:"rgba(144, 164, 174, 0.2)"}})));function uP(){return uP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},uP.apply(null,arguments)}const pP=e=>{let{className:t,children:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","children"]);const a=cP();return _p().createElement(ym(),uP({},n,{className:kp()(a.root,t)}),r.split(".").map((e=>e[0].toUpperCase())).join(""))};var dP=r(2271);const mP=r(47503).$+1,fP=(0,qp.Z)((e=>({root:{backgroundColor:"#fff",fontFamily:"Roboto"},mentionsControl:{fontSize:"13px"},mentionsHighlighter:{padding:"10px 22px",border:"1px solid transparent !important","&::before":{content:({placeholder:e})=>e&&`"${e}"`}},mentionsInput:{borderRadius:"2px",border:"1px solid rgba(0,0,0,0.12)",padding:"10px 22px",outline:0,overflow:"auto !important"},mentionsSuggestions:{padding:"8px 0",zIndex:mP+"!important",borderRadius:"4px",backgroundColor:"#fafafa !important",boxShadow:"0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.2)"},mentionsSuggestionsList:{maxHeight:"200px",overflowY:"scroll"},mentionsSuggestionsItem:{padding:"6px 12px",color:e.palette.text.primary,fontSize:"13px",transition:e.transitions.create(["background-color"]),"&:hover":{backgroundColor:"rgba(0,0,0,0.04)"}},mentionsSuggestionsItemFocused:{backgroundColor:"rgba(0,0,0,0.04)"},mention:{position:"relative",zIndex:1,color:e.palette.primary.main,textShadow:"1px 1px 1px white, 1px -1px 1px white, -1px 1px 1px white, -1px -1px 1px white",pointerEvents:"none"}})));function yP(){return yP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yP.apply(null,arguments)}const gP="mentionsTextArea",hP=e=>{let{onChange:t,className:r,value:n,placeholder:a}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["onChange","className","value","placeholder"]);const o=fP({placeholder:n?"":a}),l=(0,Rp.useContext)(oP);return _p().createElement("div",{className:kp()(o.root,r)},_p().createElement(dP.r,yP({},i,{value:n,placeholder:a,onChange:(e,r,n,a)=>{t(r,n,(0,O.uniq)(a.map((({display:e})=>e.slice(1)))))},className:gP,suggestionsPortalHost:document.body,allowSuggestionsAboveCursor:!0,classNames:{[`${gP}__input`]:o.mentionsInput,[`${gP}__highlighter`]:o.mentionsHighlighter,[`${gP}__control`]:o.mentionsControl,[`${gP}__suggestions`]:o.mentionsSuggestions,[`${gP}__suggestions__list`]:o.mentionsSuggestionsList,[`${gP}__suggestions__item`]:o.mentionsSuggestionsItem,[`${gP}__suggestions__item--focused`]:o.mentionsSuggestionsItemFocused}}),_p().createElement(dP.p,{trigger:"+",data:l.map((({username:e})=>({id:e,display:e}))),displayTransform:(e,t)=>`+${t}`,appendSpaceOnAdd:!0,className:o.mention})))},EP=(0,qp.Z)({root:({isEditing:e})=>({padding:e?"6px 6px 6px 0":" 6px 6px 6px 8px",borderRadius:"4px",backgroundColor:e?"transparent":"rgba(0,114,206,0.06)"}),textField:({isEditing:e})=>({width:e?"100%":"calc(100% - 40px)"}),form:{marginBottom:0},main:{display:"flex",alignItems:"center"},avatar:{marginRight:"8px"},buttons:({isEditing:e})=>({marginLeft:e?"0":"40px",marginTop:"8px"}),button:{"& + $button":{marginLeft:"8px"}}}),bP=e=>{switch(e){case"open":return li().text("Reply...");case"resolved":return li().text("Adding a comment will re-open this");default:return""}},vP=({inputRef:e,className:t,uri:r,relatedObjectUris:n,objectType:a,popperRef:i,comment:o,reply:l,isEditingComment:s,isEditingReply:c,onCancel:u})=>{const p=s||c,d=EP({isEditing:p}),[m,f]=(0,Rp.useState)(!1),{createReply:y,createComment:g,sending:h,editComment:E,editReply:b,getCommentState:v,updateCommentState:T,clearCommentState:S}=(0,Rp.useContext)(CN),x=(0,ly.qg)(),C=(({comment:e,reply:t,isEditingComment:r,isEditingReply:n})=>(0,O.isNil)(e)?"comment/new":r?JN(e):n?eP(e,t):(e=>`comment/${e.commentId}/reply/new`)(e))({comment:o,reply:l,isEditingComment:s,isEditingReply:c}),w=(({comment:e,reply:t,isEditingComment:r,isEditingReply:n})=>{const a=r?e:n?t:null,{content:i="",namedUsers:o=[]}=a||{};return{value:tP(i,o),plainTextValue:i,mentions:o}})({comment:o,reply:l,isEditingComment:s,isEditingReply:c}),{value:A=w.value,plainTextValue:R=w.plainTextValue,mentions:_=w.mentions}=v(r,C),I=""!==w.value.trim(),N=""!==A.trim(),P=m||N||I,D=null==o?void 0:o.status,k=()=>{null==u||u(),S(r,C)};(0,Rp.useEffect)((()=>{i&&i.current.forceUpdate()}),[i,P]);const L=p?"small":"medium";return _p().createElement(sN(),{className:kp()(d.root,t)},_p().createElement("form",{onSubmit:e=>(e.preventDefault(),(0,O.cond)([[(0,O.always)(!o),()=>g({content:R,namedUsers:_,objectType:a,uri:r,relatedObjectUris:n})],[(0,O.always)(s),()=>E({content:R,namedUsers:_,commentId:o.commentId,objectType:a,replies:o.replies,relatedObjectUris:n,uri:r})],[(0,O.always)(c),()=>b({content:R,namedUsers:_,commentId:o.commentId,replyId:l.replyId})],[O.T,()=>y({content:R,namedUsers:_,commentId:o.commentId,action:"open"===o.status?"none":"reopen",uri:r})]])().then(k).catch(console.log)),className:d.form},_p().createElement(sN(),{className:d.main},!p&&_p().createElement(pP,{classes:{root:d.avatar}},x),_p().createElement(hP,{className:d.textField,disabled:h,onChange:(e,t,n)=>T(r,C,{value:e,plainTextValue:t,mentions:n}),inputRef:e,value:A,onFocus:()=>f(!0),onBlur:()=>f(!1),placeholder:bP(D)})),P&&_p().createElement(sN(),{className:d.buttons},_p().createElement(hE(),{className:d.button,variant:"contained",color:"primary",disabled:!N||h,type:"submit",size:L},((e,t,r)=>t||r?li().text("Edit"):"open"===e||"resolved"===e?li().text("Reply"):li().text("Comment"))(D,s,c)),_p().createElement(hE(),{disabled:h,onClick:()=>k(),className:d.button,variant:"outlined",color:"primary",size:L},li().text("Cancel")))))},TP=(0,qp.Z)((e=>({header:{display:"flex"},avatar:{marginRight:"8px"},username:{marginBottom:"1px",color:e.palette.text.primary,fontSize:"13px",fontWeight:500,lineHeight:"15px"},createdAt:{marginTop:"3px",marginRight:"4px",color:e.palette.text.secondary,fontSize:"11px",lineHeight:"13px",whiteSpace:"nowrap"},body:{marginLeft:"40px"},commentTarget:{marginTop:"-15px",overflowWrap:"break-word"},message:{marginTop:"12px"},dropdownMenu:{zIndex:"3000 !important"},buttons:{marginTop:"15px",marginBottom:"12px",display:"flex","& $button + $button":{marginLeft:"10px"}},button:{fontSize:"13px",lineHeight:"15px"}}))),OP=({onReply:e,className:t,uri:r,comment:n,relatedObjectUris:a,objectType:i})=>{const o=TP(),l=(0,Rp.useRef)(),s=(0,ly.qg)(),{commentId:c,createdBy:u,createdTime:p,status:d}=n,m="resolved"===d,f=u===s,{resolveThread:y,reOpenThread:g,sending:h,deleteComment:E,updateCommentState:b,getCommentState:v}=(0,Rp.useContext)(CN),T=JN(n),{isEditing:O}=v(r,T),S=(0,Rp.useCallback)((e=>b(r,T,{isEditing:e})),[T,b,r]);KN(l,O);const x=(0,Rp.useMemo)((()=>m?[{text:li().text("Delete"),onClick:()=>E({uri:r,commentId:c})}]:[{text:li().text("Edit"),onClick:()=>S(!0)},{text:li().text("Delete"),onClick:()=>E({uri:r,commentId:c})}]),[c,E,m,S,r]),C=_p().createElement(vP,{inputRef:l,uri:r,relatedObjectUris:a,objectType:i,onCancel:()=>S(!1),isEditingComment:O,comment:n});return _p().createElement(sN(),{className:t},_p().createElement(sN(),{className:o.header},_p().createElement(pP,{classes:{root:o.avatar}},u),_p().createElement(sN(),{width:"100%"},_p().createElement(zf(),{className:o.username},u)),_p().createElement(zf(),{className:o.createdAt},QN(p)),f&&_p().createElement($N,{buttonComponent:Bd.k,buttonProps:{icon:tm(),tooltipTitle:li().text("Open menu")},popoverProps:{PopoverClasses:{root:o.dropdownMenu}},menuItems:x,menuId:"collaboration-comment-menu"})),_p().createElement(sN(),{className:o.body},_p().createElement(iP,{comment:n,className:o.commentTarget}),O?C:_p().createElement(sP,{comment:n,className:o.message}),_p().createElement(sN(),{className:o.buttons},_p().createElement(Ay(),{className:o.button,onClick:e,component:"button",underline:"hover"},li().text("Reply")),!m&&_p().createElement(Ay(),{disabled:h,className:o.button,onClick:()=>{y({commentId:c,uri:r})},component:"button",underline:"hover"},li().text("Resolve")),m&&_p().createElement(Ay(),{disabled:h,className:o.button,onClick:()=>{g({commentId:c,uri:r})},component:"button",underline:"hover"},li().text("Re-open")))))},SP=(0,qp.Z)((e=>({root:{display:"flex",padding:"8px",borderRadius:"4px",backgroundColor:"rgba(0,114,206,0.06)"},avatar:{marginRight:"8px"},replyArea:{width:"calc(100% - 60px)"},header:{display:"flex",marginBottom:"8px"},username:{color:e.palette.text.primary,fontSize:"13px",fontWeight:500,lineHeight:"15px"},message:{marginBottom:"8px",color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px"},createdAt:{color:e.palette.text.secondary,fontSize:"11px",lineHeight:"13px",whiteSpace:"nowrap"},marked:{marginLeft:"8px",color:e.palette.text.secondary,fontSize:"13px",fontStyle:"italic",lineHeight:"15px"}}))),xP=({className:e,reply:t,uri:r,comment:n,popperRef:a})=>{const i=(0,Rp.useRef)(),o=(0,ly.qg)(),{createdBy:l,action:s,createdTime:c}=t,u=l===o&&"resolved"!==n.status,{deleteReply:p,updateCommentState:d,getCommentState:m}=(0,Rp.useContext)(CN),f=eP(n,t),{isEditing:y}=m(r,f),g=(0,Rp.useCallback)((e=>d(r,f,{isEditing:e})),[f,d,r]);KN(i,y);const h=SP(),E=(0,Rp.useMemo)((()=>[{text:li().text("Edit"),onClick:()=>g(!0)},{text:li().text("Delete"),onClick:()=>p({uri:r,commentId:n.commentId,reply:t})}]),[p,r,n.commentId,t,g]),b=_p().createElement(vP,{inputRef:i,popperRef:a,uri:r,onCancel:()=>g(!1),isEditingReply:y,reply:t,comment:n});return _p().createElement(sN(),{className:kp()(h.root,e)},_p().createElement(pP,{classes:{root:h.avatar}},l),_p().createElement(sN(),{className:h.replyArea},_p().createElement(sN(),{className:h.header},_p().createElement(zf(),{className:h.username},l),"resolve"===s&&_p().createElement(zf(),{className:h.marked},li().text("Marked as resolved")),"reopen"===s&&_p().createElement(zf(),{className:h.marked},li().text("Re-opened"))),"resolve"!==s&&(y?b:_p().createElement(sP,{className:h.message,comment:t})),_p().createElement(zf(),{className:h.createdAt},QN(c))),u&&_p().createElement($N,{buttonComponent:Bd.k,buttonProps:{icon:tm(),tooltipTitle:li().text("Open menu")},menuItems:E,menuId:"collaboration-comment-menu"}))},CP=(0,qp.Z)((()=>({root:{maxWidth:"100%",padding:"8px 4px 10px 16px"},messages:{},repliedComment:{marginBottom:"2px"},replies:{marginLeft:"40px"},sendMessageArea:{marginLeft:"40px"},comment:{}}))),wP=({uri:e,relatedObjectUris:t,objectType:r,classes:n,popperRef:a,messagesRef:i,comment:o})=>{const l=(0,Rp.useRef)(),s=CP({classes:n}),c=_p().createElement(vP,{className:s.sendMessageArea,inputRef:l,popperRef:a,uri:e,relatedObjectUris:t,objectType:r,comment:o});return _p().createElement(sN(),{className:s.root},o&&_p().createElement(_p().Fragment,null,_p().createElement("div",{className:s.messages,ref:i},_p().createElement(OP,{comment:o,uri:e,onReply:()=>{l.current.focus()},className:s.comment,relatedObjectUris:t,objectType:r}),_p().createElement(sN(),{className:s.replies},o.replies.map((t=>_p().createElement(xP,{key:t.replyId,className:s.repliedComment,reply:t,uri:e,comment:o}))))),c),!o&&c)},AP=(0,Rp.memo)(wP),RP=(0,qp.Z)((e=>({root:{},header:{display:"flex",alignItems:"center",height:"48px",paddingLeft:"16px",paddingRight:"8px"},headerInfo:{marginRight:"auto",display:"flex",alignItems:"center"},title:{marginRight:"15px",color:e.palette.text.primary,fontSize:"16px"},counter:{paddingLeft:"15px",borderLeft:"1px solid rgba(0,0,0,0.12)",color:e.palette.text.secondary,fontSize:"14px",lineHeight:"24px"},resolveButton:{zIndex:3e3,"&:hover":{backgroundColor:"transparent"}},popper:{width:"424px",borderRadius:"0 0 4px 4px"},collaborationItem:{padding:"0 0 10px 0"},comment:({hasScroll:e})=>({marginLeft:"16px",marginRight:e?"2px":"8px"}),replies:({hasScroll:e})=>({marginLeft:"8px",marginRight:e?"2px":"8px"}),sendMessageArea:({hasScroll:e,scrollWidth:t})=>({marginLeft:"8px",marginRight:e?t+2:"8px"}),messages:{maxHeight:"400px",overflowY:"auto"}}))),_P=({uri:e,relatedObjectUris:t,objectType:r,anchorEl:n,onClose:a,open:i,comment:o})=>{const[l,s]=(0,Rp.useState)(0),c=RP({scrollWidth:l,hasScroll:0!==l}),u=(0,Rp.useRef)(null),{resolveThread:p,loading:d,sending:m}=(0,Rp.useContext)(CN),f=1+(null==o?void 0:o.replies.length);return _p().createElement(BN,{popperRef:u,anchorEl:n,open:i,placement:"right-start",onClose:a,className:c.popper},_p().createElement(sN(),{className:c.header},_p().createElement(sN(),{className:c.headerInfo},_p().createElement(zf(),{className:c.title},li().text("Comments")),o&&!d&&_p().createElement(zf(),{className:c.counter},li().number(f)," ",1===f?li().text("item"):li().text("items"))),o&&!d&&_p().createElement(Bd.k,{className:c.resolveButton,size:"S",onClick:()=>{p({commentId:o.commentId,uri:e})},disabled:m,showForDisabled:!0,tooltipTitle:li().text("Resolve"),icon:Mm(),color:"primary"})),!d&&_p().createElement(AP,{popperRef:u,messagesRef:e=>{e&&s(e.offsetWidth-e.clientWidth)},classes:{root:c.collaborationItem,replies:c.replies,sendMessageArea:c.sendMessageArea,messages:c.messages,comment:c.comment},uri:e,relatedObjectUris:t,objectType:r,comment:o}))},IP=(0,qp.Z)((()=>({root:{display:"flex",alignItems:"start"},addButton:{visibility:"hidden","&$showAlways":{visibility:"visible"},[`.${ON}:hover &`]:{visibility:"visible"}},showAlways:{}}))),NP=({className:e,uri:t,objectType:r,relatedObjectUris:n,onChangePopupVisibility:a,allowOnlyOneComment:i=!1,showAlways:o=!1})=>{const l=IP(),[s,c]=(0,Rp.useState)(null),[u,p]=(0,Rp.useState)(!1),d=u&&Boolean(s),{currentComment:m,commentsMap:f,getComment:y,clearCurrentComment:g,objectTypes:h}=(0,Rp.useContext)(CN),E=!!f&&(!h||h.includes(r)),b=((null==f?void 0:f[t])||[]).filter((({status:e})=>"resolved"!==e)).reverse(),v=!i||i&&0===b.length,T=null===m&&d;(0,FE.D)((()=>{a&&a(d)}),[d]);const O=(0,Rp.useContext)(SN),S=(0,Rp.useMemo)((()=>O?[...n,...O]:n),[O,n]);return E&&_p().createElement("div",{className:kp()(l.root,e)},v&&_p().createElement(LN,{className:kp()(l.addButton,{[l.showAlways]:o||T}),onClick:e=>{c(e.currentTarget),p(!0)}}),b.map((({replies:e,commentId:t})=>_p().createElement(PN,{ref:t===(null==m?void 0:m.commentId)?c:null,key:t,onClick:()=>(e=>{y(e),p(!0)})(t)},1+e))),_p().createElement(_P,{anchorEl:s,open:d,onClose:()=>{c(null),g(),p(!1)},uri:t,relatedObjectUris:S,objectType:r,comment:m}))},PP=(0,qp.Z)({label:{color:"rgba(0,0,0,0.6)",fontSize:"13px",lineHeight:"16px"}});function DP(){return DP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},DP.apply(null,arguments)}const kP=e=>{let{label:t,isRequired:r,className:n}=e,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["label","isRequired","className"]);const i=PP();return _p().createElement(zf(),DP({className:kp()(i.label,n),component:"span"},a),t,r&&_p().createElement(Ad,null))},LP=_p().createContext(null);LP.displayName="EntityContext";const UP=(0,qp.Z)((e=>({container:{height:"16px",borderColor:(0,$m.alpha)(e.palette.primary.main,.54)},label:{paddingLeft:"4px",paddingRight:"4px",fontSize:"10px",lineHeight:"11px",color:e.palette.primary.main}}))),jP=(0,Id.T)(Ug()),FP=({className:e,attributeType:t,nonOvValues:r=[],nonOvTotal:n})=>{const a=UP(),i=(0,ly.ax)("openEntity"),o=((e,t,r)=>{var n;const a=null==t||null===(n=t[0])||void 0===n?void 0:n.uri,i=a?(0,v.getEntityUriFromAttributeUri)(a):null;if(i&&(0,v.isEntityUri)(i)){const t=(0,v.getEntityUriFromAttributeUri)(r.uri);if(!e||e.type===t)return{uri:i,type:t};const n=(0,v.getParentUri)(a),o=(0,v.findAttributeValueByUri)(e,n);return{uri:(0,v.getReferencedEntityUriFromAttrValue)(o),type:t}}return e?{uri:e.uri,type:e.type}:null})((0,Rp.useContext)(LP),r,t),l=(0,ly.fC)(null==o?void 0:o.type),s=(0,Rp.useCallback)((()=>{i({uri:o.uri,screen:"sources"})}),[i,o]);if(!n)return null;const c=r.length?r.map(((e,r)=>_p().createElement("div",{key:r},(0,v.isComplexAttribute)(t)?(0,v.getLabel)(e.label):_p().createElement(um.x,{value:(0,v.getAttributeValue)(e),dataTypeDefinition:(0,v.getAttrDataTypeDefinition)(t),rich:!1})))):null;return _p().createElement(jP,{tooltipTitle:c,tooltipPlacement:"bottom",label:`+ ${n}`,variant:"outlined",onClick:null!=o&&o.uri&&l?s:void 0,classes:{root:kp()(a.container,e),label:a.label}})};function MP(){return MP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},MP.apply(null,arguments)}const VP=e=>_p().createElement("svg",MP({width:12,height:12,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgDescription"},e),_p().createElement("path",{d:"M5.417 9.5h1.166V8.333H5.417V9.5zM6 .167A5.835 5.835 0 00.167 6 5.835 5.835 0 006 11.833 5.835 5.835 0 0011.833 6 5.835 5.835 0 006 .167zm0 10.5A4.673 4.673 0 011.333 6 4.673 4.673 0 016 1.333 4.673 4.673 0 0110.667 6 4.673 4.673 0 016 10.667zM6 2.5a2.333 2.333 0 00-2.333 2.333h1.166A1.17 1.17 0 016 3.667a1.17 1.17 0 011.167 1.166c0 1.167-1.75 1.021-1.75 2.917h1.166c0-1.313 1.75-1.458 1.75-2.917A2.333 2.333 0 006 2.5z",fill:"#000",fillOpacity:.54})),BP=_p().createContext({showDescription:!1,showNavigateToGraph:!0});BP.displayName="FeaturesContext";const zP=(0,qp.Z)((()=>({icon:{display:"inline-flex",marginLeft:"8px",verticalAlign:"middle"}}))),HP=({className:e,description:t})=>{const{showDescription:r}=(0,Rp.useContext)(BP),n=zP();return t&&r?_p().createElement(Rg(),{title:t,placement:"bottom"},_p().createElement("span",{"data-reltio-id":"reltio-description-icon",className:kp()(n.icon,e)},_p().createElement(VP,null))):null};var YP=r(87558);const WP=(0,r(87171).k)({unmaskedAttributes:{},unmaskAttributeValue:void 0,maskAttributeValue:void 0,deleteUnmaskedAttributeForRelation:void 0}),GP=e=>(0,YP.S)(WP,e),qP=_p().createContext({appearance:void 0,attributes:void 0,roles:void 0,tags:void 0});qP.displayName="HistoryDiffContext";const ZP=_p().createContext({highlightedValuesUris:[],highlightedClassName:""});function $P(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}ZP.displayName="HighlightedValuesContext";const KP=(e,t,r,n)=>{const a=((e,t)=>{const r=t.find((t=>t.uri===e.uri));return r&&Array.isArray(r.children)?r.children:[]})(e,r);let i=(null==e?void 0:e.attributes)||(null==e?void 0:e.analyticsAttributes)||[];return a.length&&(i=i.filter((e=>a.includes(e.uri)))),i.reduce(((e,a)=>{const i=XP(t[a.name],n,r);return i&&i.length&&(Array.isArray(i[0])?e.push({[a.uri]:i[0]}):e.push({[a.uri]:i})),e}),[])},XP=(e,t,r)=>{if(e&&0!==e.length)return e.reduce(((e,n)=>{if("type"in n&&n.type){const a="lookupCode"in n?n.lookupCode:n.value,i=(0,v.findAttributeTypeByUri)(t,n.type);a&&"object"!=typeof a&&(0,v.isOv)(n)?e.push(QP(a,i)):a&&"object"==typeof a&&!Array.isArray(a)&&e.push(KP(i,a,r,t))}return e}),[])},QP=(e,t)=>{switch(null==t?void 0:t.type){case v.DataTypes.TYPE_DATE:return new Date(e).getTime();case v.DataTypes.TYPE_TIMESTAMP:return isNaN(Number(e))?new Date(e).getTime():new Date(Number(e)).getTime();default:return e}};function JP(){return JP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},JP.apply(null,arguments)}const eD=e=>_p().createElement("svg",JP({width:11,height:11,viewBox:"0 0 11 11","data-reltio-id":"SvgPivotingIcon"},e),_p().createElement("path",{d:"M2.514 5h2.314V3l2.5 2.5-2.5 2.5V6h-3.8a4.5 4.5 0 10.73-3H.6a5.5 5.5 0 11-.577 3H0V5H2.514z",fill:"#6CACE4",stroke:"none",strokeWidth:1,fillRule:"evenodd"}));var tD=r(98074);const rD=(0,qp.Z)((e=>({link:{color:e.palette.primary.main,textDecoration:"none"}}))),nD=(0,Rp.forwardRef)((({value:e,attributeType:t,children:r,className:n,onClick:a},i)=>{const o=rD(),{generatePivotingUrl:l}=(0,Rp.useContext)(tD.v),s=l({uiPath:(0,ly.Qh)(),uri:t.uri,value:JSON.stringify(e)}),c=(0,Rp.useCallback)((e=>{(0,Wp.rR)(e)||(a(),e.preventDefault()),e.stopPropagation()}),[a]);return _p().createElement("a",{ref:i,href:s,onClick:c,className:kp()(o.link,n)},r)}));nD.displayName="PivotingUriLink";const aD=(0,qp.Z)((e=>({container:{backgroundColor:"white",width:"360px",minWidth:"360px",maxWidth:"720px"},header:{display:"flex",height:"48px",alignItems:"center",justifyContent:"space-between",paddingLeft:"16px"},title:{color:e.palette.text.primary,fontSize:"16px",letterSpacing:"0.15px",lineHeight:"19px"},entityTypeLabel:{color:"rgba(0,0,0,0.67)",fontSize:"14px",paddingLeft:"16px",paddingBottom:"12px",lineHeight:"16px"},divider:{height:"24px",width:"1px",backgroundColor:"rgba(0,0,0,0.12)"},headerCount:{color:e.palette.text.secondary,fontSize:"14px",letterSpacing:"0.24px",lineHeight:"28px",width:"210px"},body:{borderBottom:"1px solid rgba(0,0,0,0.12)",padding:"0 16px 8px"},footer:{display:"flex",alignItems:"center",height:"32px",paddingLeft:"16px",color:e.palette.primary.main,fontSize:"13px",letterSpacing:"0",lineHeight:"16px"},profileIcon:{height:"16px",width:"16px"},entityContainer:{display:"flex",flexDirection:"row",alignItems:"center"},entityLabel:{color:e.palette.primary.main,fontSize:"13px",letterSpacing:"0",lineHeight:"15px",textDecoration:"none",paddingLeft:"8px",wordBreak:"break-word"},seeAllButton:{cursor:"pointer"}}))),iD=({attributeType:e,label:t,entities:r,generatedValue:n,onSeeAllClick:a,total:i})=>{const o=aD(),l=i>6,s=Boolean(t);return _p().createElement("div",{className:o.container},_p().createElement("div",{className:o.header},_p().createElement("div",{className:o.title},li().text("Pivot profiles")),_p().createElement("div",{className:o.divider}),_p().createElement("div",{className:o.headerCount},li().number(i,"0,0")+" "+(1===i?li().text("item"):li().text("items")))),s&&_p().createElement("div",{className:o.entityTypeLabel},t),_p().createElement("div",{className:o.body},r.map((e=>_p().createElement("div",{key:e.uri,className:o.entityContainer},_p().createElement(b.A,{entity:e,avatarClassName:o.profileIcon}),_p().createElement(om.x,{className:o.entityLabel,value:(0,v.getEntityUriForLink)(e)},(0,v.getLabel)(e.label)))))),l&&_p().createElement("div",{className:o.footer},_p().createElement(nD,{value:n,attributeType:e,className:o.seeAllButton,onClick:a},li().text("See all"))))},oD=(0,qp.Z)((e=>({icon:{marginRight:"8px",verticalAlign:"middle",width:"12px",height:"12px"},content:{color:e.palette.primary.main,cursor:"pointer",lineHeight:"16px"}}))),lD=(0,qp.Z)({tooltip:{backgroundColor:"white",boxShadow:"0 4px 5px 0 rgba(0,0,0,0.14), 0 1px 10px 0 rgba(0,0,0,0.12), 0 2px 4px -1px rgba(0,0,0,0.2)",padding:0,borderRadius:"4px",maxWidth:"none"},arrow:{"&::before":{backgroundColor:"white"}}}),sD=({value:e,attributeType:t,children:r,className:n})=>{const a=lD(),i=oD(),o=(0,Rp.useContext)(cN)||[],l=(0,ly.ax)("openPivotingPerspective"),s=(0,ly.AH)()||{},c=(0,v.isNested)(t)?KP(t,e.value,o,s):QP(e.lookupCode||e.value,t),u=o.some((({uri:e})=>e===t.uri))&&(Array.isArray(c)&&c.length||!Array.isArray(c)&&!(0,O.isNil)(c)),p=o.find((({uri:e})=>e===t.uri)),d=null==p?void 0:p.popup,m=u?Array.isArray(c)?c.map((e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[(0,v.getLastUriPart)(e),t]))))):((e,t)=>[{[e.name]:t}])(t,c):void 0,f=()=>{l({value:m,attributeType:t})},{entities:y,total:g,loadPivotingData:h}=(({value:e,attributeType:t,entityType:r})=>{const[n,a]=(0,Rp.useState)([]),[i,o]=(0,Rp.useState)(0),l=(0,qh._)(),s=(0,ly.eh)(),c=(0,ly.mU)(),u=r||(null==s?void 0:s.type),p=(0,Rp.useMemo)((()=>(0,v.convertPivotingValueToSearchFilters)({value:e,attributeType:t,entityType:u})),[t,u,e]),d=(0,Rp.useMemo)((()=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){$P(e,t,r[t])}))}return e}({max:6,sort:"label"},c||{})),[c]),m=(0,Rp.useCallback)((()=>{l(Promise.all([(0,v.getFilteredEntities)({filters:p,options:d}),(0,v.getTotals)({filters:p,options:d})])).then((e=>{const[t,{total:r}]=e;a(Array.isArray(t)?t:[]),o(r)})).catch((()=>{a([]),o(0)}))}),[p,d,l]);return{entities:n,total:i,loadPivotingData:m}})({attributeType:t,value:c,entityType:null==d?void 0:d.entityType});return u?_p().createElement(Rg(),{arrow:!0,placement:"right-start",classes:a,disableInteractive:!1,onOpen:h,title:_p().createElement(iD,{generatedValue:m,attributeType:t,label:null==d?void 0:d.label,onSeeAllClick:f,entities:y,total:g})},_p().createElement("span",{className:n},_p().createElement(eD,{className:i.icon}),_p().createElement(nD,{onClick:f,className:i.content,value:m,attributeType:t},r))):_p().createElement(_p().Fragment,null,r)};var cD=r(78577),uD=r.n(cD),pD=r(46157),dD=r.n(pD);const mD=(0,qp.Z)((e=>({icon:{color:e.palette.text.secondary,fontSize:18},switcherWrapper:{verticalAlign:"middle",marginLeft:8,width:"16px",height:"16px"}}))),fD=({className:e,isMasked:t,isUnmasking:r,onToggleMasking:n})=>{const a=mD(),i=t?li().text("Show"):li().text("Hide");return r?_p().createElement(Lm(),{size:16,className:kp()(e,a.switcherWrapper)}):_p().createElement(Rg(),{key:String(t),title:i},_p().createElement(yE(),{"aria-label":i,onClick:n,className:kp()(e,a.switcherWrapper)},t?_p().createElement(dD(),{className:a.icon}):_p().createElement(uD(),{className:a.icon})))};function yD(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){gD(e,t,r[t])}))}return e}function gD(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const hD=(0,qp.Z)((e=>({root:{display:"flex",alignItems:"start",justifyContent:"space-between"},commentsContainer:{height:"15px",marginRight:"-4px"},attributeValue:{verticalAlign:"middle",wordBreak:"break-all"},updateAttribute:yD({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},v.historyPalettes[v.HistoryOperations.updateAttribute],{"& > a":{color:v.historyPalettes[v.HistoryOperations.updateAttribute].color}}),insertAttribute:yD({width:"fit-content"},v.historyPalettes[v.HistoryOperations.insertAttribute],{"& > a":{color:v.historyPalettes[v.HistoryOperations.insertAttribute].color}}),deleteAttribute:yD({width:"fit-content",padding:"0 4px",marginLeft:"-4px",textDecoration:"line-through"},v.historyPalettes[v.HistoryOperations.deleteAttribute],{"& > a":{color:v.historyPalettes[v.HistoryOperations.deleteAttribute].color}}),multilineAttribute:{width:"fit-content"},ovFalse:e.inactive}))),ED=({className:e,attributeType:t=null,attributeValue:r,inlined:n})=>{const{isUnmaskingNeeded:a,isMasked:i,toggleMasking:o,attributeValue:l,isUnmasking:s}=(({attributeType:e,attributeValue:t})=>{const r=(0,ly.xH)(),n=GP((({unmaskAttributeValue:e})=>e)),a=GP((({maskAttributeValue:e})=>e)),{attributeValue:i,isUnmasked:o=!1,loading:l=!1}=(s=t.uri,GP((({unmaskedAttributes:e})=>e[s]))||{});var s;const c=n&&a&&!!e.masking&&r,u=(0,Rp.useCallback)((()=>c?n(t.uri):Promise.resolve()),[n,t.uri,c]),p=(0,Rp.useCallback)((()=>{o?a(t.uri):u()}),[t.uri,o,a,u]);return{isUnmaskingNeeded:c,isMasked:!o,toggleMasking:p,isUnmasking:l,unmask:u,attributeValue:c&&o&&i||t}})({attributeType:t,attributeValue:r}),c=hD(),{highlightedValuesUris:u=[],highlightedClassName:p}=(0,Rp.useContext)(ZP),{appearance:d}=(0,Rp.useContext)(qP),m=(0,v.getHistoryAppearanceByUri)(l.uri,d),f=(0,v.getHistoryAttributeClassName)(m),y=(0,Rp.useMemo)((()=>_p().createElement(um.x,{value:(0,v.getAttributeValue)(l),dataTypeDefinition:(0,v.getAttrDataTypeDefinition)(t)})),[l,t]),g=(0,v.getObjectTypeByAttributeUri)(l.uri),h=a&&_p().createElement(fD,{isMasked:i,onToggleMasking:o,isUnmasking:s});return n||f?_p().createElement("div",{className:kp()(e,{[p]:u.includes(l.uri)})},_p().createElement(sD,{value:l,attributeType:t,key:l.uri,className:kp()({[c.multilineAttribute]:!n})},_p().createElement("span",{className:kp()(c.attributeValue,c[f],{[c.ovFalse]:!(0,v.isOv)(l)}),"data-reltio-id":"reltio-attribute-value"},y,h))):_p().createElement("div",{className:kp()(e,c.root,ON,{[p]:u.includes(l.uri)})},_p().createElement(sD,{value:l,attributeType:t,key:l.uri},_p().createElement("span",{className:kp()(c.attributeValue,{[c.ovFalse]:!(0,v.isOv)(l)}),"data-reltio-id":"reltio-attribute-value"},y,h)),_p().createElement(NP,{className:c.commentsContainer,uri:l.uri,relatedObjectUris:(0,v.createRelatedObjectUris)(g,{uri:l.uri}),objectType:g}))};var bD=r(84419),vD=r.n(bD);const TD=(0,qp.Z)({expandButton:{"&:hover":{backgroundColor:"transparent"}},expandIcon:{transition:"transform .15s ease"},expanded:{transform:"rotate(90deg)"}});function OD(){return OD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},OD.apply(null,arguments)}const SD=e=>{const t=TD(),{expanded:r,className:n}=e,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["expanded","className"]);return _p().createElement(Gp.T,OD({icon:vD(),size:"XXS",disableRipple:!0,iconClassName:kp()(t.expandIcon,{[t.expanded]:r}),className:kp()(n,t.expandButton),"data-reltio-id":"arrow-expand-button"},a))},xD=(0,qp.Z)((e=>({complexContainer:{marginTop:"1px"},labelContainer:{display:"flex",minHeight:"18px"},label:{display:"inline-flex",fontSize:"13px",lineHeight:"16px",letterSpacing:"normal",marginLeft:"2px"},spacer:{flex:1},ovFalse:e.inactive})));function CD(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const wD=({attributeTypesList:e,attributeValue:t,label:r,expanded:n=!1,children:a,showNonOv:i,attributeType:o,classes:l,LabelRenderer:s,RightSlot:c})=>{const u=xD(),p=t.uri,[d,m]=(0,Rp.useState)(!1),{highlightedValuesUris:f=[],highlightedClassName:y}=(0,Rp.useContext)(ZP);(0,Rp.useEffect)((()=>{m(n)}),[n]);const g=(e||[]).some((e=>(0,v.isAnalyticAttribute)(e))),h=(0,Rp.useMemo)((()=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){CD(e,t,r[t])}))}return e}({attributes:g?null:t.value,analyticsAttributes:g?t.value:null},(0,v.isSpecialAttribute)(o)?t.value:{})),[t,g,o]),E=(0,v.getObjectTypeByAttributeUri)(t.uri);return _p().createElement("div",{className:u.complexContainer},_p().createElement("div",{className:kp()(u.labelContainer,ON)},_p().createElement(SD,{onClick:()=>m((e=>!e)),expanded:d}),s?_p().createElement(s,{attributeType:o,attributeValue:t}):_p().createElement(_p().Fragment,null,_p().createElement(zf(),{component:"span",variant:"body2",classes:{body2:u.label},className:kp()({[y]:f.includes(t.uri),[u.ovFalse]:!(0,v.isOv)(t)}),"data-reltio-id":"reltio-attribute-complex-label"},r),_p().createElement("div",{className:u.spacer}),c&&_p().createElement(c,{attributeType:o,attributeValue:t}),_p().createElement(NP,{uri:t.uri,relatedObjectUris:(0,v.createRelatedObjectUris)(E,{uri:t.uri}),objectType:E}))),d&&_p().createElement(wM,{attrTypes:e,entity:h,drawLines:!0,parentUri:p,showNonOv:i,classes:l},a))};var AD=r(29195);function RD(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){_D(e,t,r[t])}))}return e}function _D(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ID=(0,qp.Z)({label:{textDecoration:"none",verticalAlign:"middle"},updateAttribute:RD({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},v.historyPalettes[v.HistoryOperations.updateAttribute]),insertAttribute:RD({width:"fit-content"},v.historyPalettes[v.HistoryOperations.insertAttribute]),deleteAttribute:RD({width:"fit-content",textDecoration:"line-through",padding:"0 4px",marginLeft:"-4px"},v.historyPalettes[v.HistoryOperations.deleteAttribute]),pivotingTooltip:{marginLeft:"4px"}});function ND(){return ND=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ND.apply(null,arguments)}const PD=e=>{let{attributeValue:t,attributeType:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValue","attributeType"]);const a=ID(),{appearance:i}=(0,Rp.useContext)(qP),o=(0,Rp.useMemo)((()=>{const e=(0,v.getHistoryAppearanceByUri)(t.uri,i),n=(0,v.getHistoryAttributeClassName)(e),o=t.label?t.label:(0,v.evaluateDeepEntityLabel)(t,r.dataLabelPattern);return _p().createElement(sD,{className:a.pivotingTooltip,value:t,attributeType:r},_p().createElement(sN(),{component:"span",className:kp()(a[n],a.label)},_p().createElement(AD.b,{text:(0,v.getLabel)(o)})))}),[i,a,t,r]);return _p().createElement(wD,ND({label:o,attributeValue:t,attributeTypesList:(0,v.getAttributeTypeSubAttributes)({},r),attributeType:r},n))},DD=(0,Rp.memo)(PD);var kD=r(24217),LD=r(16782);const UD=(0,qp.Z)((e=>({link:{color:e.palette.primary.main,textDecoration:"none"}})));function jD(){return jD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},jD.apply(null,arguments)}const FD=e=>{const t=UD(),r=(0,LD.GV)(),{href:n,className:a}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["href","className"]),o=kp()(t.link,a);return r&&n?_p().createElement(kD.rU,jD({to:n.replace(window.location.origin,""),className:o},i)):_p().createElement("a",jD({href:n,className:o},i))};function MD(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){VD(e,t,r[t])}))}return e}function VD(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const BD=(0,qp.Z)((e=>({relationshipLabel:{marginLeft:"4px",color:e.palette.text.primary},updateAttribute:MD({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},v.historyPalettes[v.HistoryOperations.updateAttribute]),insertAttribute:MD({width:"fit-content"},v.historyPalettes[v.HistoryOperations.insertAttribute]),deleteAttribute:MD({width:"fit-content",textDecoration:"line-through",padding:"0 4px",marginLeft:"-4px"},v.historyPalettes[v.HistoryOperations.deleteAttribute]),ovFalse:e.inactive})));function zD(){return zD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},zD.apply(null,arguments)}const HD=(0,Rp.memo)((e=>{let{attributeValue:t,attributeType:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValue","attributeType"]);const a=BD(),i=(0,ly.AH)(),o=(0,ly.Qh)(),l=(0,v.getReferencedEntityUriFromAttrValue)(t),s=(0,Rp.useMemo)((()=>(0,v.getAttributeTypeSubAttributes)(i,r)),[r,i]),{appearance:c}=(0,Rp.useContext)(qP),{generateEntityUrl:u}=(0,Rp.useContext)(tD.v),p=(0,Rp.useMemo)((()=>{const e=(0,v.getHistoryAppearanceByUri)(t.uri,c),r=(0,v.getHistoryAttributeClassName)(e),n=null!=l&&l.startsWith("changeRequests")?"dcrReview":"profile";return _p().createElement(FD,{href:(0,v.isEmptyValue)(c)?u({uiPath:o,uri:l,screen:n}):void 0,className:kp()(a[r],{[a.ovFalse]:!(0,v.isOv)(t)})},_p().createElement(AD.b,{text:(0,v.getLabel)(t.label)}),t.relationshipLabel&&_p().createElement("span",{className:a.relationshipLabel},_p().createElement(AD.b,{text:t.relationshipLabel})))}),[t,c,o,l,a,u]);return _p().createElement(wD,zD({attributeTypesList:s,attributeValue:t,label:p,attributeType:r},n))}));HD.displayName="ReferenceAttribute";class YD{static build(e,t={}){switch(e.type){case v.DataTypes.TYPE_NESTED:return _p().createElement(DD,t);case v.DataTypes.TYPE_REFERENCE:return _p().createElement(HD,t);default:return _p().createElement(ED,t)}}}const WD=e=>{const{attributeType:t}=e;return YD.build(t,e)};function GD(){return GD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},GD.apply(null,arguments)}const qD=e=>_p().createElement("svg",GD({width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgControlAttribute"},e),_p().createElement("mask",{id:"ControlAttribute_svg__a",fill:"#fff"},_p().createElement("path",{d:"M10.966 9.203a3.2 3.2 0 11-.018-2.449l-1.375.581a1.707 1.707 0 10.01 1.307l1.383.561z"})),_p().createElement("path",{d:"M10.966 9.203a3.2 3.2 0 11-.018-2.449l-1.375.581a1.707 1.707 0 10.01 1.307l1.383.561z",stroke:"#72828B",strokeWidth:4,mask:"url(#ControlAttribute_svg__a)"}),_p().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.297 8.965a4.804 4.804 0 004.068 3.793v1.61a6.403 6.403 0 01-5.693-5.403h1.625zm4.068-5.724a4.803 4.803 0 00-4.124 4.124h-1.61a6.402 6.402 0 015.734-5.734v1.61zm5.393 4.124a4.804 4.804 0 00-3.793-4.068V1.672a6.403 6.403 0 015.404 5.693h-1.61zm-.055 1.6a4.806 4.806 0 01-3.738 3.738v1.625a6.405 6.405 0 005.363-5.363h-1.625z",fill:"#72828B"})),ZD=(0,qp.Z)({icon:{display:"inline-flex",marginLeft:"8px",verticalAlign:"middle"}});function $D(){return $D=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$D.apply(null,arguments)}const KD=(0,Rp.forwardRef)(((e,t)=>_p().createElement("span",$D({},e,{ref:t}),_p().createElement(qD,null))));KD.displayName="ControlAttributeForwarded";const XD=(0,Id.T)(KD),QD=()=>{const e=ZD();return _p().createElement(XD,{"data-reltio-id":"reltio-control-attribute-icon",tooltipTitle:li().text("This is a control attribute. Changing this value will affect availability of other conditional attributes."),className:e.icon})};function JD(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){ek(e,t,r[t])}))}return e}function ek(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const tk="13px",rk="16px",nk={titleRow:{display:"inline-block",minHeight:"16px"},title:{wordBreak:"break-all",verticalAlign:"middle"},ovIcon:{marginLeft:"8px",textIndent:0},descriptionIcon:{textIndent:0}},ak=(0,qp.Z)({paddingWrapper:{paddingTop:"3px",paddingBottom:"5px","&:last-child":{paddingBottom:"2px"}},paddingWrapperWithLines:{paddingBottom:"1px","&:last-child":{paddingBottom:"2px"}}}),ik=(0,qp.Z)(JD({wrapper:{fontSize:tk,lineHeight:rk},collaborationWrapper:{display:"flex",alignItems:"start",minHeight:"18px",justifyContent:"space-between"},attribute:{marginLeft:"8px",paddingLeft:"4px",paddingRight:"4px",display:"inline",overflow:"hidden",whiteSpace:"pre-wrap",wordBreak:"break-word"},titleIcon:{width:"16px",height:"16px",marginRight:"8px",marginLeft:"1px",color:"rgba(0, 0, 0, 0.38)",verticalAlign:"middle"}},nk)),ok=(0,qp.Z)(JD({wrapper:{display:"flex",flexDirection:"column",alignItems:"flex-start",fontSize:tk,lineHeight:rk},attribute:{"&:last-child":{marginBottom:0},paddingLeft:"4px",paddingRight:"4px",marginLeft:"5px",marginBottom:"4px",whiteSpace:"pre-wrap",wordBreak:"break-word"},attributes:{alignSelf:"stretch"},titleRow:JD({},nk.titleRow,{marginBottom:"3px"})},nk)),lk=(0,qp.Z)(JD({wrapper:{fontSize:tk,lineHeight:rk}},nk)),sk=({value:e,nonVisibleValues:t,attributeType:r,showNonOv:n,totalNonVisibleValues:a,classes:i})=>{const o=ik(),{label:l,description:s}=r,c=(0,ly.Ws)(),u=(0,Rp.useMemo)((()=>c.includes(r.uri)),[c,r.uri]),p=(0,v.getObjectTypeByAttributeUri)(e.uri);return _p().createElement("div",{"data-reltio-id":"one-line-renderer",className:kp()(o.collaborationWrapper,ON)},_p().createElement("div",{className:kp()(o.titleRow,o.wrapper)},_p().createElement(kP,{label:l,className:kp()(o.title,null==i?void 0:i.title),"data-reltio-id":"reltio-attribute-label"}),_p().createElement(HP,{description:s,className:o.descriptionIcon}),u&&_p().createElement(QD,null),_p().createElement(FP,{nonOvValues:t,attributeType:r,className:o.ovIcon,nonOvTotal:a}),_p().createElement(WD,{className:kp()(o.attribute,null==i?void 0:i.content),attributeValue:e,attributeType:r,showNonOv:n,inlined:!0,classes:i})),_p().createElement(NP,{uri:e.uri,relatedObjectUris:(0,v.createRelatedObjectUris)(p,{uri:e.uri}),objectType:p}))};var ck=r(33062),uk=r.n(ck);const pk=(0,qp.Z)({link:{display:"flex",marginTop:4},icon:{fontSize:"1rem"}}),dk=({moreNumber:e,valueNumber:t,onClick:r})=>{const n=pk();return _p().createElement(Ay(),{"data-reltio-id":"show-more",component:"button",variant:"caption",className:n.link,onClick:r,underline:"none"},_p().createElement(uk(),{className:n.icon}),e&&t?li().text("Show ${moreNumber} more of remaining ${valueNumber} value",{moreNumber:e,valueNumber:t}):li().text("Show more"))};var mk=r(86800),fk=r.n(mk);const yk=(0,qp.Z)({link:{display:"flex",marginTop:4},icon:{fontSize:"1rem"}}),gk=({onClick:e})=>{const t=yk();return _p().createElement(Ay(),{component:"button",variant:"caption",className:t.link,onClick:e,underline:"none"},_p().createElement(fk(),{className:t.icon}),li().text("Show less"))},hk=({max:e,values:t,nonVisibleValues:r,totalVisibleValues:n,attributeType:a,parentUri:i,requestNextPageOfAttributeValues:o,showNonOv:l,totalNonVisibleValues:s,classes:c})=>{const u=ok(),[p,d]=(0,Rp.useState)(e),m=(0,ly.Ws)(),f=(0,Rp.useMemo)((()=>m.includes(a.uri)),[m,a.uri]),y=e<n,g=y&&p<n,h=y&&p>=n,{label:E,description:b}=a,v=t.slice(0,p),T=n-p;return _p().createElement("div",{"data-reltio-id":"multi-line-renderer",className:u.wrapper},_p().createElement("div",{className:u.titleRow},_p().createElement(kP,{label:E,className:kp()(u.title,null==c?void 0:c.title),"data-reltio-id":"reltio-attribute-label"}),_p().createElement(HP,{description:b}),f&&_p().createElement(QD,null),_p().createElement(FP,{nonOvValues:r,attributeType:a,className:u.ovIcon,nonOvTotal:s})),_p().createElement("div",{className:u.attributes},v.map((e=>_p().createElement(WD,{key:e.uri,className:kp()(u.attribute,null==c?void 0:c.content),attributeValue:e,attributeType:a,showNonOv:l,classes:c})))),g&&_p().createElement(dk,{moreNumber:(0,O.min)(e,T),valueNumber:T,onClick:()=>{t.length<n&&o({parentUri:i,attributeTypeUri:a.uri,attributeTypeName:a.name,values:t,defaultMaxValues:e}),d(p+e)}}),h&&_p().createElement(gk,{onClick:()=>{d(e)}}))};var Ek=r(88941),bk=r.n(Ek);function vk(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Tk(e,t,r[t])}))}return e}function Tk(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ok=(0,qp.Z)({attributeValue:{verticalAlign:"middle"},insertAttribute:vk({width:"fit-content"},v.historyPalettes[v.HistoryOperations.insertAttribute]),deleteAttribute:vk({width:"fit-content",textDecoration:"line-through",padding:"0 4px"},v.historyPalettes[v.HistoryOperations.deleteAttribute])}),Sk=({value:e})=>{const t=Ok(),{appearance:r}=(0,Rp.useContext)(qP),n=(0,ly.AH)(),a=(0,v.getHistoryAppearanceBySpecialAttributeValue)("roles",e,r),i=(0,v.getHistoryAttributeClassName)(a);return _p().createElement("span",{className:kp()(t.attributeValue,t[i])},(0,v.getRoleLabel)(n,e))},xk=({className:e,values:t,Component:r,dataReltioId:n})=>_p().createElement("div",{className:e,"data-reltio-id":n},t.map(((e,n)=>_p().createElement(Rp.Fragment,{key:e},_p().createElement(r,{value:e}),n<t.length-1&&", ")))),Ck=({className:e,values:t})=>_p().createElement(xk,{values:t,className:e,dataReltioId:"reltio-attribute-value",Component:Sk});function wk(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Ak(e,t,r[t])}))}return e}function Ak(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Rk=(0,qp.Z)({attributeValue:{verticalAlign:"middle"},insertAttribute:wk({width:"fit-content"},v.historyPalettes[v.HistoryOperations.insertAttribute]),deleteAttribute:wk({width:"fit-content",textDecoration:"line-through",padding:"0 4px"},v.historyPalettes[v.HistoryOperations.deleteAttribute])}),_k=({value:e})=>{const t=Rk(),r=(0,Rp.useContext)(LP),{appearance:n}=(0,Rp.useContext)(qP),{generateTagUrl:a}=(0,Rp.useContext)(tD.v),i=(0,ly.eh)(),o=(0,ly.Qh)(),l=(0,v.getHistoryAppearanceBySpecialAttributeValue)("tags",e,n),s=(0,v.getHistoryAttributeClassName)(l),c=r||i;return _p().createElement(FD,{className:kp()(t.attributeValue,t[s]),href:a({uiPath:o,tag:e,entityUri:c.dataTenant?(0,v.getDataTenantEntityUri)(c):c.uri})},e)},Ik=({className:e,values:t})=>_p().createElement(xk,{values:t,className:e,dataReltioId:"reltio-attribute-value",Component:_k}),Nk=({values:e,attributeType:t,classes:r})=>{const n=ik(),{label:a}=t;return _p().createElement("div",{"data-reltio-id":"special-renderer",className:kp()(n.titleRow,n.wrapper)},(i=n.titleIcon,t.uri===v.EntityAttrTypes.tags.uri?_p().createElement(bk(),{className:i}):null),_p().createElement(kP,{label:a,className:kp()(n.title,null==r?void 0:r.title),"data-reltio-id":"reltio-attribute-label"}),(n=>{switch(t.uri){case v.EntityAttrTypes.tags.uri:return _p().createElement(Ik,{className:n,values:e});case v.EntityAttrTypes.roles.uri:return _p().createElement(Ck,{className:n,values:e});default:return _p().createElement(WD,{className:n,attributeValue:{value:e[0],uri:""},attributeType:t,inlined:!0,classes:r})}})(kp()(n.attribute,null==r?void 0:r.content)));var i};var Pk=r(97986),Dk=r.n(Pk);function kk(){return kk=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},kk.apply(null,arguments)}const Lk=e=>_p().createElement("svg",kk({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgDefaultImage"},e),_p().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},_p().createElement("path",{d:"M0 0h24v24H0z"}),_p().createElement("path",{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zm-4.5-9l2.5 3.096V18H5l4.5-5.5 2.5 3.01L16.5 10zm-8-4a1.5 1.5 0 110 3 1.5 1.5 0 010-3z",fillOpacity:.12,fill:"#000",fillRule:"nonzero"}))),Uk={SMALL:{imageWidth:114,imageHeight:114},MEDIUM:{imageWidth:162,imageHeight:162},LARGE:{imageWidth:192,imageHeight:192},OVERRIDE:{imageWidth:"unset",imageHeight:"unset"}},jk=(0,qp.Z)((e=>({root:{position:"relative"},image:({imageWidth:e,imageHeight:t})=>({width:e,height:t,objectFit:"cover",verticalAlign:"bottom"}),defaultContainer:{display:"flex",alignItems:"center",backgroundColor:"rgb(247, 247, 247)"},defaultImage:{width:"40px",height:"40px",marginLeft:"auto",marginRight:"auto",color:e.palette.text.secondary},hideImage:{display:"none"}})));function Fk(){return Fk=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Fk.apply(null,arguments)}const Mk=e=>{const{src:t,className:r,containerClassName:n,size:a=Uk.SMALL,overlay:i=null}=e,o=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["src","className","containerClassName","size","overlay"]),l=a||Uk.SMALL,s=jk(l),[c,u]=(0,Rp.useState)(Dm.oA.LOADING);(0,Rp.useEffect)((()=>{u(Dm.oA.LOADING)}),[t]);const p=c===Dm.oA.LOADING,d=c===Dm.oA.LOADED;return c===Dm.oA.ERROR?_p().createElement("div",Fk({className:kp()(s.defaultContainer,s.image,r)},o),_p().createElement(Dk(),{className:s.defaultImage})):_p().createElement("div",{className:kp()(s.root,n)},!(0,v.isEmptyValue)(t)&&_p().createElement("img",Fk({src:t,className:kp()(s.image,r,{[s.hideImage]:p}),onLoad:()=>{u(Dm.oA.LOADED)},onError:()=>{u(Dm.oA.ERROR)},alt:"image"},o)),p&&_p().createElement("div",Fk({className:kp()(s.defaultContainer,s.image,r)},o),_p().createElement(Lk,{className:s.defaultImage})),d&&i)},Vk=(0,Rp.memo)(Mk),Bk={imageMargin:4,imageWidth:Uk.SMALL.imageWidth,imageHeight:Uk.SMALL.imageHeight};var zk=r(59849),Hk=r.n(zk),Yk=r(47867),Wk=r.n(Yk),Gk=r(93643),qk=r.n(Gk);const Zk=(0,qp.Z)((()=>({thumbnails:{marginLeft:"12px",marginBottom:"12px",marginTop:"auto",width:"calc(100vw - 364px)",overflowX:"auto",overflowY:"hidden"},gridContainer:{width:"100%"},thumb:{width:"96px",height:"96px",cursor:"pointer",userSelect:"none"},inactiveThumb:{filter:"brightness(0.5)"}}))),$k=({attributeValues:e,setAttributeValueIndex:t,attributeValueIndex:r})=>{const n=Zk(),a=(0,Rp.useRef)(null);return(0,Rp.useEffect)((()=>{if(null!=a&&a.current){const e=a.current.scrollLeft,t=a.current.offsetWidth+e,n=96*r+16*r+12;t<n?a.current.scroll&&(n>t+96+16?a.current.scroll(n,0):a.current.scroll(112+e,0)):e+96>n&&a.current.scroll&&a.current.scroll(n-96,0)}}),[r,a]),_p().createElement("div",{ref:a,className:n.thumbnails},_p().createElement(qk(),{container:!0,wrap:"nowrap",direction:"row",spacing:1,className:n.gridContainer},e.map((({uri:e,value:a},i)=>_p().createElement(qk(),{item:!0,key:e},_p().createElement(Vk,{onClick:()=>t(i),className:kp()(n.thumb,{[n.inactiveThumb]:r!==i}),src:(0,v.getImageAttributeOvThumbnailUrl)({value:a})}))))))},Kk=(0,qp.Z)((e=>({root:{display:"flex",alignContent:"center",flexDirection:"column"},main:{position:"relative",padding:"0 86px",marginTop:"auto"},mainImageContainer:{display:"flex",alignContent:"center",height:"100%",width:"100%"},mainImage:{maxWidth:"calc(100vw - 512px)",maxHeight:"calc(100vh - 192px)",margin:"0 auto",userSelect:"none"},arrowButton:{backgroundColor:e.palette.divider,color:"white","&:hover":{backgroundColor:e.palette.divider}},arrowButtonPrev:{position:"absolute",top:"50%",left:"16px",transform:"translateY(-50%)"},arrowButtonNext:{position:"absolute",top:"50%",right:"16px",transform:"translateY(-50%)"}}))),Xk=({className:e,attributeValues:t,attributeValueIndex:r,setAttributeValueIndex:n})=>{const a=Kk(),i=t[r],o=(0,v.getImageAttributeOvPreviewUrl)(i);return _p().createElement("div",{className:kp()(a.root,e)},_p().createElement("div",{className:a.main},r>0&&_p().createElement(Gp.T,{icon:Hk(),className:kp()(a.arrowButton,a.arrowButtonPrev),onClick:()=>{n(r-1)},size:"XL"}),_p().createElement(Vk,{containerClassName:a.mainImageContainer,className:a.mainImage,size:o&&Uk.OVERRIDE,src:o}),r!==t.length-1&&_p().createElement(Gp.T,{icon:Wk(),className:kp()(a.arrowButton,a.arrowButtonNext),onClick:()=>{n(r+1)},size:"XL"})),_p().createElement($k,{attributeValues:t,attributeValueIndex:r,setAttributeValueIndex:n}))};var Qk=r(71884),Jk=r.n(Qk);const eL=(0,O.curry)(((e,t)=>(0,O.filter)((t=>(t.label||t.name).toLowerCase().includes(e.toLowerCase())))(t))),tL=({attrTypes:e,filter:t="",sortingFn:r})=>(0,O.pipe)(eL(t),(0,O.sort)(r),(0,O.map)((e=>({item:{id:e.uri,label:e.label||e.name,attrType:e}}))))(e);var rL=function(e){return e.parent="parent",e.attributes="attributes",e}(rL||{});const nL=(0,qp.Z)({moreAttributes:{display:"flex",paddingBottom:"6px","&$dense":{padding:0}},dense:{},popupContainer:{},moreAttributesPopup:{"&$popupContainer":{}},moreButton:{padding:"9px 16px 9px 12px",backgroundColor:"rgba(98, 2, 238, 0)",marginTop:"8px",marginLeft:"-4px",marginBottom:"4px"},buttonLabel:{fontSize:"14px",fontWeight:500,lineHeight:"16px"},icon:{fontSize:"18px",marginRight:"8px"},subHeader:{backgroundColor:"rgb(245, 245, 245)",padding:"0 16px",margin:0,display:"flex",alignItems:"center",color:"rgba(0,0,0,0.84)",fontSize:"14px",fontWeight:500},noResultsCaptionContainer:{position:"absolute",top:0,bottom:0,left:0,right:0,display:"flex",justifyContent:"center",alignItems:"center"}}),aL=({label:e,popupTitle:t=e,data:r,parent:n,dense:a,onApply:i})=>{const o=nL(),l=(0,Rp.useRef)(),[s,c]=(0,Rp.useState)(!1),[u,p]=(0,Rp.useState)(""),[d,m]=(0,Rp.useState)([]),{items:f,hasGroups:y,parentGroupLength:g,attributesGroupLength:h}=(({data:e,parent:t,filter:r})=>{const n=(0,ly.mT)(),a=Boolean(t),i=(0,Rp.useMemo)((()=>n===v.SortingStrategy.ASC_BY_NAME?(e,t)=>{var r;return null==e||null===(r=e.label)||void 0===r?void 0:r.localeCompare(null==t?void 0:t.label)}:(e,t)=>0),[n]),o=(0,Rp.useMemo)((()=>a?tL({attrTypes:[t],filter:r,sortingFn:i}):[]),[a,t,r,i]),l=(0,Rp.useMemo)((()=>a&&null!=o&&o.length?[{item:{id:rL.parent,label:li().text("Parent")},items:o}]:[]),[a,o]),s=(0,Rp.useMemo)((()=>tL({attrTypes:e,filter:r,sortingFn:i})),[e,r,i]),c=(0,Rp.useMemo)((()=>a&&null!=s&&s.length?[{item:{id:rL.attributes,label:li().text("Attributes")},items:s}]:s),[a,s]),u=(0,Rp.useMemo)((()=>ad((l||[]).concat(c))),[l,c]),p=l.length,d=c.length;return{items:u,hasGroups:a,parentGroupLength:p,attributesGroupLength:d}})({data:r,parent:n,filter:u}),E=(0,Rp.useCallback)(((e,t)=>{m((0,O.ifElse)((0,O.always)(t),(0,O.append)(e),(0,O.reject)((0,O.propEq)("id",e.id)))(d))}),[d]),b=(0,Rp.useCallback)(((e,t)=>t.items?40:28),[]),T=(0,Rp.useCallback)((({item:e})=>{E(e,(0,O.not)((0,O.any)((0,O.propEq)("id",e.id))(d)))}),[E,d]),{focusIndex:S,handleKeyDown:x}=ud({items:f,open:s,onSelectFocusedItem:T,selectedItems:d}),C=(0,Rp.useRef)(null);C.current=S;const w=y?(g?1:0)+(h?1:0):0,A=f.length-w,R=Math.min(255,28*A+40*w),_=Math.max(140,R+112),I=(0,Rp.useCallback)(((e,{item:t,level:r=0},n)=>{var a;const i=(0,O.any)((0,O.propEq)("id",t.id))(d),o=C.current===n;return _p().createElement(kd,{key:t.uri,onClick:E,checked:i,level:r,data:t,label:_p().createElement(Ld.o,{text:t.label,highlight:u}),labelInText:t.label,style:e,isFocused:o,isRequired:!(null===(a=t.attrType)||void 0===a||!a.required),LogoIcon:t.LogoIcon})}),[u,E,d]),N=(0,Rp.useCallback)(((e,t)=>_p().createElement(Tf(),{component:"div",className:o.subHeader,style:e,key:`group-${t.item.id}`},t.item.label)),[]);return _p().createElement("div",{className:kp()(o.moreAttributes,{[o.dense]:a})},_p().createElement(hE(),{color:"primary",onClick:()=>c(!s),ref:l,className:o.moreButton},_p().createElement(Jk(),{classes:{root:o.icon}}),_p().createElement("div",{className:o.buttonLabel},e)),_p().createElement(nd,{open:s,className:kp()(o.moreAttributesPopup,o.popupContainer),anchorEl:l.current,onClose:(0,O.pipe)((()=>{d.length>0&&i((0,O.pluck)("attrType",d))}),(()=>c(!1)),(()=>p("")),(()=>m([]))),onSearch:p,containerHeight:_,title:t,containerWidth:320,searchInputOnKeyDown:x},_p().createElement(cd,{getItemSize:b,renderItem:I,renderGroupTitle:N,disableHorizontalScrollbar:!0,items:f,height:R,focusIndex:S}),0===f.length&&_p().createElement("div",{className:o.noResultsCaptionContainer},_p().createElement(zf(),{variant:"caption",display:"block",gutterBottom:!0},li().text("No results found")))))},iL={canCreate:!0,canUpdate:!0,canDelete:!0},oL=_p().createContext(iL);oL.displayName="ConfigPermissionsContext";const lL=e=>{const{canCreate:t,canUpdate:r,canDelete:n}=(0,Rp.useContext)(oL),a=(0,v.isTempUri)(e);return(0,Rp.useMemo)((()=>({canCreate:t,canUpdate:a||r,canDelete:a||n})),[a,t,r,n])},sL={get CreationTime(){return li().text("Creation Time")},get CreationDate(){return li().text("Creation Date")},get Dimensions(){return li().text("Dimensions")},get MimeType(){return li().text("Mime Type")},get Size(){return li().text("Size")},get Url(){return li().text("Full image URL (S3)")},get UrlPreview(){return li().text("Preview image URL (S3)")},get UrlThumbnail(){return li().text("Small image URL (S3)")},get CdnUrl(){return li().text("Full image URL (CDN)")},get CdnUrlPreview(){return li().text("Preview image URL (CDN)")},get CdnUrlThumbnail(){return li().text("Small image URL (CDN)")}},cL=({value:e}={},t)=>["Url","UrlPreview","UrlThumbnail","CdnUrl","CdnUrlPreview","CdnUrlThumbnail","MimeType"].includes(t)?(0,O.path)([t,0,"value"],e):"CreationDate"===t&&(0,O.path)(["CreationTimestamp",0,"value"],e)?ka()(e.CreationTimestamp[0].value).format("MM-DD-YYYY"):"CreationTime"===t&&(0,O.path)(["CreationTimestamp",0,"value"],e)?ka()(e.CreationTimestamp[0].value).format("HH:mm:ss"):"Dimensions"===t&&(0,O.path)(["Height",0,"value"],e)&&(0,O.path)(["Width",0,"value"],e)?`${e.Height[0].value} x ${e.Width[0].value} ${li().text("pixels")}`:"Size"===t&&(0,O.path)(["Size",0,"value"],e)?`${(Number(e.Size[0].value)/1e3).toFixed(2)} KB`:void 0,uL=(e=[])=>e.filter((({system:e})=>!e)),pL=(e,t)=>{const{includeNames:r=[],excludeNames:n=[],order:a=[]}=t,i=r.length?e.filter((e=>r.includes(e))):e.filter((e=>!n.includes(e)));return 0===a.length?i:i.sort(((e,t)=>{const r=a.indexOf(e),n=a.indexOf(t);return-1===r&&-1!==n?1:-1===n&&-1!==r?-1:r-n}))},dL=(e={},t,r)=>{const n=uL(t.attributes);return pL(Object.keys(e.value||{}),r).reduce(((t,r)=>{const a=n.find((({name:e})=>e===r));return a?[...t,{attrType:a,values:e.value[r]}]:t}),[])},mL=e=>["Url","UrlPreview","UrlThumbnail","CdnUrl","CdnUrlPreview","CdnUrlThumbnail"].includes(e),fL=(0,qp.Z)({title:{marginBottom:"10px",color:"white",fontSize:"18px",lineHeight:"21px","&$canAdd":{marginBottom:"3px"}},divider:{width:"100%",height:"1px",borderColor:"rgba(255,255,255,0.12)"},canAdd:{}}),yL=({attributeType:e,onAddAttributes:t,uri:r})=>{const n=fL(),a=uL(e.attributes),{canCreate:i}=(0,Rp.useContext)(oL),o=i&&Boolean(t);return _p().createElement(sN(),null,_p().createElement(zf(),{className:kp()(n.title,{[n.canAdd]:o})},li().text("Meta info")),o&&_p().createElement(Rp.Fragment,null,_p().createElement(aL,{label:li().text("Attributes"),data:a,dense:!1,onApply:e=>{t&&t(e.map((e=>({attributeType:e,parentUri:r}))))}}),_p().createElement(Kf(),{className:n.divider})))},gL=(0,qp.Z)((e=>({root:{fontSize:"13px",letterSpacing:0,lineHeight:"15px",marginBottom:"11px"},title:{color:"rgba(255,255,255,0.54)",marginRight:"12px",float:"left"},content:{color:"rgba(255,255,255,0.87)",wordWrap:"break-word"},link:{color:e.palette.primary.main,textDecoration:"none"}}))),hL=({title:e,content:t,isLink:r,children:n})=>{const a=gL();return _p().createElement("div",{className:a.root},_p().createElement("span",{className:a.title},e),r?_p().createElement("a",{className:a.link,href:t},li().text("link")):_p().createElement("span",{className:a.content},t||n))},EL=(0,qp.Z)({root:{padding:"10px 0"},title:{color:"rgba(255,255,255,0.54)",fontSize:"13px"},content:{color:"rgba(255,255,255,0.87)",wordWrap:"break-word"}}),bL=({attributeValue:e,attributeType:t,imageAttributeFieldsOrder:r})=>{const n=EL(),a=(0,ly.xH)(),i=(o=e,l=r,pL(Object.keys(sL),l).map((e=>cL(o,e)?{title:sL[e],value:cL(o,e),isLink:mL(e)}:null)).filter(Boolean));var o,l;const s=dL(e,t,r),c=(0,Rp.useMemo)((()=>({title:n.title,content:n.content})),[n]);return _p().createElement(sN(),{className:n.root},i.map((({title:e,value:t,isLink:r})=>_p().createElement(hL,{key:e,isLink:r,title:e,content:t}))),a&&s.map((({attrType:t,values:r})=>_p().createElement(xM,{key:t.uri,attributeType:t,drawLines:!1,values:r,classes:c,parentUri:e.uri}))))},vL=(0,qp.Z)((e=>({caption:{display:"flex",color:e.palette.error.main,fontSize:"12px",lineHeight:"16px"}}))),TL=({className:e,message:t})=>{const r=vL();return t?_p().createElement(zf(),{variant:"caption",className:kp()(r.caption,e)},t):null};var OL=r(66826),SL=r.n(OL),xL=r(95210),CL=r(70485),wL=r.n(CL),AL=r(53167),RL=r.n(AL);const _L=(0,qp.Z)({wrapper:{width:"100%"},helperText:{margin:"3px 0 1px 12px"}});function IL(){return IL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},IL.apply(null,arguments)}const NL=(0,Rp.memo)((e=>{let{errorMessage:t,children:r,className:n,classes:a}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["errorMessage","children","className","classes"]);const o=_L(),l=!!t;return _p().createElement(wL(),IL({variant:"standard",className:kp()(o.wrapper,n,null==a?void 0:a.root),error:!0},i),r,l&&_p().createElement(RL(),{className:kp()(o.helperText,null==a?void 0:a.helperText)},_p().createElement(TL,{message:t})))}));NL.displayName="ErrorWrapper";const PL=(e,t,r,n)=>{const a=(0,O.pipe)(v.getEntityType,(0,O.defaultTo)({}),(0,O.props)(["attributes","analyticsAttributes"]),(0,O.reject)(O.isNil),O.flatten,(0,O.concat)(O.__,(0,O.pipe)(O.values,(0,O.reject)((0,O.propEq)("uri",v.EntityAttrTypes.id.uri)))(v.EntityAttrTypes)))(e,t);return r.length?a.filter((({uri:e})=>r.includes(e))):a.filter((({uri:e})=>!n.includes(e)))},DL=(e,t)=>(0,O.partition)((0,O.pipe)((0,O.path)(["attrType","uri"]),(0,O.includes)(O.__,e)),t),kL=(0,O.eqBy)((0,O.pick)(["fieldName","uri","entityTypeUri"])),LL=(e,t)=>t&&!!t.find(kL(e)),UL=(0,O.curry)(((e,t,r)=>{const n=((e,t)=>{const{type:r}=(0,v.getAttrDataTypeDefinition)(e);switch(r){case v.DataTypes.TYPE_BOOLEAN:case v.DataTypes.TYPE_BOOLEAN_RADIO:case v.DataTypes.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return t.toString();case v.DataTypes.TYPE_DATE:return t&&ka()(t).format("YYYY-MM-DD")||"";case v.DataTypes.TYPE_TIMESTAMP:return t&&ka()(t).utc().format()||"";case v.DataTypes.TYPE_ACTIVENESS_DATE:case v.DataTypes.TYPE_LOCAL_DATE:return t&&t.valueOf();default:return t||""}})(t,r);return{value:n,uri:e.uri,attributeType:t}})),jL=_p().createContext({enabled:!1,queueSizeThreshold:0});jL.displayName="AsyncMountContext";let FL=0;function ML(){return ML=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ML.apply(null,arguments)}var VL=r(50548);const BL=_p().createContext(!1);BL.displayName="ProfilePerspectiveViewContext";let zL=function(e){return e.Error="Error",e.NewAttribute="NewAttribute",e.NewView="NewView",e}({});const HL=e=>e===zL.Error,YL=_p().createContext({element:null,type:null,highlightView:O.identity,highlightError:O.identity,highlightAttribute:O.identity,scrollIntoRef:O.identity});function WL(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){GL(e,t,r[t])}))}return e}function GL(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const qL={content:'""',position:"absolute",left:"-1000px",top:"0px",width:"5000px",height:"calc(100% - 10px)",animationName:"$highlightAnimation",animationDuration:"2s",animationIterationCount:1,opacity:0},ZL=(0,qp.Z)((()=>({"@keyframes highlightAnimation":{"0%":{opacity:0},"50%":{opacity:1},"100%":{opacity:0}},highlightError:{"&::before":WL({},qL,{background:"rgba(255, 0, 0, 0.06)"})},highlightWarning:{"&::before":WL({},qL,{background:"rgba(228, 151, 0, 0.08)"})},simpleAttribute:{position:"relative","&::before":{top:"-4px",height:"calc(100% + 8px)"}}}))),$L=({highlightedError:e,isSimple:t=!1})=>{const r=ZL(),n=(0,Rp.useRef)(null),a=(0,O.pathOr)(v.ErrorSeverity.ERROR,["element","severity"])(e),i=kp()({[r.highlightError]:a===v.ErrorSeverity.ERROR,[r.highlightWarning]:a===v.ErrorSeverity.WARNING,[r.simpleAttribute]:t});return(0,Rp.useEffect)((()=>{e&&e.scrollIntoRef(n)}),[e]),e?{ref:n,errorClassName:i}:{ref:n}};var KL=r(51894);const XL=(0,qp.Z)((e=>({wrapper:{width:"100%"},errorWrapper:{alignSelf:"stretch"},editor:{display:"flex",flex:1,alignItems:"flex-start",marginBottom:"10px",position:"relative"},"editor-value":{flex:"1 1 auto"},"editor-read-only-value":{marginLeft:"12px",display:"flex",alignItems:"center",color:e.palette.text.primary},"editor-actions":{display:"flex",alignItems:"center",paddingLeft:"8px"},addButton:{marginRight:"-8px"},button:{color:e.palette.text.secondary},placeholder:{height:"50px"},deleted:{color:e.palette.text.secondary,textDecoration:"line-through"},editedLabel:{fontStyle:"italic",color:e.palette.text.secondary}})));function QL(){return QL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},QL.apply(null,arguments)}const JL=(0,VL.l)(YL,((e,{attributeValue:t})=>{const{element:r,type:n}=e||{};return{highlightedError:HL(n)&&(null==r?void 0:r.uri)===t.uri?e:null}}),(e=>{let{className:t,attributeValue:r,attributeType:n,isReltioCrosswalk:a,ownError:i,mode:o,onAddOneMore:l,onDeleteAttribute:s,onChangeAttribute:c,onDeactivateError:u,additionalControlsRenderer:p,state:d,highlightedError:m,isEmptyEditor:f=!1}=e,y=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","attributeValue","attributeType","isReltioCrosswalk","ownError","mode","onAddOneMore","onDeleteAttribute","onChangeAttribute","onDeactivateError","additionalControlsRenderer","state","highlightedError","isEmptyEditor"]);const g=XL(),h="deleted"===d,E="edited"===d,b=(0,v.isEditableMode)(o),{canCreate:T,canEdit:S,canDelete:x}=(({attributeType:e,attributeValue:t,isReltioCrosswalk:r,mode:n})=>{const{canCreate:a,canUpdate:i,canDelete:o}=lL(t.uri),l=(0,Rp.useContext)(uN),s=(0,Rp.useMemo)((()=>null==l?void 0:l.includes(e.uri)),[e.uri,l]);return{canCreate:a&&(0,v.checkCanCreateAttribute)({attributeType:e,mode:n}),canEdit:i&&(0,v.checkCanEditAttribute)({attributeType:e,attributeValue:t,mode:n,isReltioCrosswalk:r,isAlwaysVisible:s}),canDelete:o&&(0,v.checkCanDeleteAttribute)({attributeType:e,attributeValue:t,mode:n,isReltioCrosswalk:r,isAlwaysVisible:s})}})({attributeValue:r,attributeType:n,mode:o,isReltioCrosswalk:a}),C=S&&b&&!r.masked,w=(0,v.getErrorMessage)(i),A=(0,ly.ZI)(r,n),{ref:R,errorClassName:_}=$L({highlightedError:m,isSimple:!0});(0,Rp.useEffect)((()=>{f&&(0,v.isDependentLookupAttrType)(n)&&!(0,O.has)("lookupCode",r)&&c({attributeType:n,uri:r.uri,value:r.value,silent:!0})}),[f]);const I=(0,Rp.useMemo)((()=>(0,v.getAttrDataTypeDefinition)(n)),[n]),N=(0,Rp.useMemo)((()=>((e,{type:t})=>{const{value:r,lookupCode:n}=e||{};switch(t){case v.DataTypes.TYPE_BOOLEAN:case v.DataTypes.TYPE_BOOLEAN_RADIO:case v.DataTypes.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return(0,v.parseBoolean)(r);case v.DataTypes.TYPE_DATE:return r&&v.utils.dates.toLocalDate(r)||null;case v.DataTypes.TYPE_LOCAL_DATE:case v.DataTypes.TYPE_TIMESTAMP:case v.DataTypes.TYPE_ACTIVENESS_DATE:return r&&new Date(r)||null;case v.DataTypes.TYPE_DEPENDENT_LOOKUP:case v.DataTypes.TYPE_LOOKUP:return{value:r,lookupCode:n};default:return r}})(r,I)),[r,I]),P=(0,Rp.useCallback)((()=>{i&&u((0,v.getErrorId)(i))}),[i,u]),D=(0,Rp.useCallback)((0,O.pipe)(UL(r,n),c,P),[r,n,c,P]),k=!!l&&T&&!n.singleValue&&!r.masked&&o!==v.Mode.Viewing,L=!h&&!!s&&x&&!r.masked&&o!==v.Mode.Viewing,U=!!w,j=h?{disabled:!0,isCrossedOut:!0}:{},F=(0,Rp.useContext)(BL),{autopopulationContextValue:M}=(({enabled:e,attributeTypeUri:t,valueUri:r})=>{const n=(0,ly.ax)("dependentLookupsEditorTouched"),a=(0,ly.Pl)(),i=(0,ly.h0)(r),o=e&&(0,v.isAutopopulationEnabled)(a,t),l=o?r:null,{isTouched:s=!1}=o&&i||{},c=(0,Rp.useCallback)((e=>{n({uri:e,isTouched:!0})}),[n]);return{autopopulationContextValue:(0,Rp.useMemo)((()=>l?{id:l,isTouched:s,onTouch:c}:null),[l,s,c])}})({enabled:F&&(0,v.isDependentLookupAttrType)(n),attributeTypeUri:null==n?void 0:n.uri,valueUri:r.uri});return _p().createElement("div",{ref:R,className:kp()(g.editor,t,_)},_p().createElement(NL,{errorMessage:w,className:g.errorWrapper},_p().createElement("div",{className:kp()(g["editor-value"],{[g.deleted]:h},{[g["editor-read-only-value"]]:!C}),"data-reltio-id":"reltio-attribute-value"},C?_p().createElement(KL.m.Provider,{value:M},_p().createElement(xL.Z,QL({fieldName:(0,v.attributeUriToSearchUri)(n.uri),value:N,dataTypeDefinition:I,error:U,onChange:D,fullWidth:!0},A,y,j))):_p().createElement(um.x,{value:(0,v.getAttributeValue)(r),dataTypeDefinition:I}))),_p().createElement("div",{className:g["editor-actions"]},E&&_p().createElement(zf(),{variant:"caption",className:g.editedLabel},"(",li().text("edited"),")"),k&&_p().createElement(Gp.T,{icon:Jk(),onClick:l,size:"L",className:kp()(g.addButton,g.button),"data-reltio-id":"reltio-add-one-more-simple-attribute-button"}),p&&p({attributeType:n,attributeValue:r}),L&&_p().createElement(Gp.T,{className:g.button,icon:SL(),onClick:()=>{s({uri:r.uri,attributeType:n}),(0,v.getErrorType)(i)!==v.ErrorType.missed&&P()},size:"L","data-reltio-id":"reltio-delete-simple-attribute-button"})))})),eU=((e,t=null)=>{const r=(0,Rp.forwardRef)(((r,n)=>(()=>{const e=(0,Rp.useRef)(!0),{enabled:t,queueSizeThreshold:r=0}=(0,Rp.useContext)(jL),[n,a]=(0,Rp.useState)(!t||t&&FL<r);e.current&&FL++;const i=(0,Rp.useRef)();return(0,Rp.useEffect)((()=>{if(FL--,!n)return i.current=setTimeout((()=>{a(!0)}),0),()=>clearTimeout(i.current)}),[]),e.current=!1,n})()?_p().createElement(e,ML({},r,{ref:n})):t&&_p().createElement(t,ML({},r,{ref:n}))));return r.displayName="WithAsyncMount",r})(JL,(()=>{const e=XL();return _p().createElement("div",{className:e.placeholder})})),tU=[v.EntityAttrTypes.roles.uri,v.EntityAttrTypes.tags.uri],rU=_p().createContext(null),nU=_p().createContext(null),aU=(0,Rp.createContext)({});function iU(){return iU=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},iU.apply(null,arguments)}function oU(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const lU=(0,VL.l)(YL,(e=>{const{highlightAttribute:t}=e||{};return{highlightAttribute:t}}),(({parentAttributeType:e,attrTypes:t,entity:r,parentUri:n,showEmptyEditors:a,mode:i,crosswalks:o,drawLines:l,children:s,className:c,fixedTypeUris:u=tU,onAddAttributes:p,onChangeAttribute:d,onDeleteAttribute:m,additionalControlsRenderer:f,showNonOv:y,highlightAttribute:g})=>{const h=(0,Rp.useContext)(aU),E=n&&(0,v.getBaseUri)(n),b=(0,Rp.useMemo)((()=>h[E]||[]),[h,E]),T=(0,Rp.useContext)(uN),S=(0,Rp.useMemo)((()=>t.filter((e=>!b.includes(e.uri)))),[t,b]),{attributes:x={}}=r,[C,w]=(0,Rp.useState)({}),A=(0,Rp.useCallback)(((e,t)=>{w((r=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){oU(e,t,r[t])}))}return e}({},r,{[e]:t})))}),[]);(0,Rp.useEffect)((()=>{w({})}),[n]);const{canCreate:R}=(0,Rp.useContext)(oL),_=(0,Rp.useMemo)((()=>R&&e&&(0,v.checkCanCreateAttribute)({attributeType:e,mode:i})),[e,i,R]),I=((e,t,r,n)=>e.filter((e=>{const a=((e,t)=>{const{attributes:r={},analyticsAttributes:n={}}=t;return(0,O.cond)([[v.isSpecialAttribute,(0,O.always)(t)],[(0,O.both)(v.isAnalyticAttribute,(0,O.always)(n)),(0,O.always)(n)],[O.T,(0,O.always)(r)]])(e)})(e,t),i=(e=>(0,v.isSpecialAttribute)(e)?"uri":"name")(e);return!((e.singleValue||(0,v.isRoleAttrType)(e)||(0,v.isTagAttrType)(e))&&((0,O.has)(e[i])(a)||r&&(null==n||!n[e.uri])))})))((0,Rp.useMemo)((()=>R?(0,v.getCreatableAttributeTypes)(i,S):[]),[S,i,R]),r,a,C),N=(0,Rp.useContext)(rU),P=(0,Rp.useMemo)((()=>(0,v.getAttributesListForEditMode)(S,i,r,a,y,N,R,T)),[S,i,r,a,y,N,R,T]),[D,k]=(0,Rp.useMemo)((()=>DL(u,P)),[P,u]),L=(0,Rp.useCallback)((t=>{p(t.map((t=>({attributeType:t,parentUri:t===e?(0,v.getParentUri)(n):n})))),g((0,O.last)(t),zL.NewAttribute)}),[p,n,e]),U={enabled:l},j=(0,Rp.useMemo)((()=>({hasDeletionsMap:C,setHasDeletions:A})),[C,A]);return _p().createElement("div",{className:c},s&&_p().createElement(TN,U,s),_p().createElement(TN,iU({},U,{plain:!0}),I.length>0&&i!==v.Mode.Viewing&&_p().createElement(aL,{label:li().text("More attributes"),onApply:L,dense:l,data:I,parent:_&&e})),_p().createElement(nU.Provider,{value:j},k.concat(D).map((({attrType:e,values:t})=>_p().createElement(IF,{key:`${e.uri}_${n}`,attributeType:e,drawLines:l,values:t,paging:(0,O.path)(["paging",e.uri],x),parentUri:n,showEmptyEditors:a,mode:i,crosswalks:o,onAddAttributes:p,onChangeAttribute:d,onDeleteAttribute:m,additionalControlsRenderer:f,showNonOv:y})))))})),sU=(0,qp.Z)((e=>({complexWrapper:{position:"relative"},editor:{display:"flex",flex:1,height:"36px",alignItems:"center"},label:{flex:1,marginLeft:"2px",marginTop:"2px",fontSize:"13px",lineHeight:"15px"},actions:{display:"flex",alignItems:"center"},titleContainer:{display:"flex",flex:1,minHeight:"20px"},expandButton:{marginTop:"2px"},deleted:{color:e.palette.text.secondary,textDecoration:"line-through"},editedLabel:{fontStyle:"italic",color:e.palette.text.secondary},errorWrapperHelperText:{marginLeft:0}}))),cU=(0,VL.l)(YL,((e,{attributeValue:t})=>{const{element:r,type:n}=e||{},a=HL(n);return{highlightedError:a&&(null==r?void 0:r.uri)===t.uri?e:null,isHighlightedPath:a&&(0,O.pipe)((0,O.propOr)([],"path"),(0,O.any)((0,O.pathEq)(["value","uri"],t.uri)))(r)}}),(({label:e,attributeTypesList:t,attributeType:r,attributeValue:n,children:a,errors:i,ownError:o,mode:l,metadata:s,crosswalks:c,lazy:u,showEmptyEditors:p,onAddOneMore:d,onAddAttributes:m,onDeleteAttribute:f,onChangeAttribute:y,additionalControlsRenderer:g,hideDeleteButton:h,state:E,showNonOv:b,isHighlightedPath:T,highlightedError:O,expanded:S=!1})=>{const x=sU(),C="deleted"===E,w="edited"===E,A=n.uri,R=(0,v.isTempUri)(A),_=R||S,[I,N]=(0,Rp.useState)(_),{ref:P,errorClassName:D}=$L({highlightedError:O}),k=n.masked?v.Mode.Viewing:l;(0,Rp.useEffect)((()=>{T&&N(!0)}),[T]),(0,Rp.useEffect)((()=>{N(_)}),[_]);const{canDelete:L}=lL(n.uri),U=(0,Rp.useMemo)((()=>L&&(0,v.checkCanDeleteAttribute)({attributeType:r,attributeValue:n,mode:k,metadata:s,isReltioCrosswalk:(0,v.isReltioCrosswalk)(c,n)})),[r,n,k,s,c,L]),j=!C&&!h&&!!f&&U&&!n.masked&&k!==v.Mode.Viewing,F=(0,Rp.useMemo)((()=>(0,v.hasAttributeDescendantsWithErrors)(n,i)),[i,n]);(0,Rp.useEffect)((()=>{F&&N(!0)}),[i,F]),(0,Rp.useEffect)((()=>{C&&N(!1)}),[C]);const M=(t||[]).some((e=>(0,v.isAnalyticAttribute)(e))),V=(0,Rp.useMemo)((()=>({attributes:M?null:n.value,analyticsAttributes:M?n.value:null})),[n,M]),B=(0,v.getErrorMessage)(o)||F&&li().text("Has an incorrect value")||"";return u?_p().createElement(hE(),{variant:"text",color:"primary",onClick:d},"Create attribute"):_p().createElement("div",{ref:P,"data-reltio-id":"reltio-edit-mode-complex-attribute",className:kp()(x.complexWrapper,D)},_p().createElement("div",{className:x.editor},_p().createElement("div",{className:x.titleContainer},_p().createElement(SD,{onClick:()=>N((e=>!e)),expanded:I,className:x.expandButton,disabled:C}),_p().createElement(NL,{errorMessage:B,classes:{helperText:x.errorWrapperHelperText}},_p().createElement("div",{className:kp()(x.label,{[x.deleted]:C}),"data-reltio-id":"reltio-attribute-complex-label"},e))),_p().createElement("div",{className:x.actions},w&&_p().createElement(zf(),{variant:"caption",className:x.editedLabel},"(",li().text("edited"),")"),g&&g({attributeType:r,attributeValue:n}),j&&_p().createElement(Gp.T,{icon:SL(),onClick:()=>f({uri:A,attributeType:r,attributeValue:n}),size:"L","data-reltio-id":"reltio-delete-complex-attribute-button"}))),I&&_p().createElement(lU,{parentAttributeType:r,attrTypes:t,entity:V,showEmptyEditors:p||R,drawLines:!0,parentUri:A,mode:k,crosswalks:c,onAddAttributes:m,onChangeAttribute:y,onDeleteAttribute:f,additionalControlsRenderer:g,showNonOv:b},a))}));function uU(){return uU=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},uU.apply(null,arguments)}const pU=(0,Rp.memo)((e=>{const{attributeValue:t,attributeType:r}=e,n=(0,v.evaluateDeepEntityLabel)(t,r.dataLabelPattern);return _p().createElement(cU,uU({label:(0,v.getLabel)(n),attributeTypesList:r.attributes||r.analyticsAttributes},e))}));pU.displayName="NestedAttributeEditor";var dU=r(84199),mU=r(62880);const fU=(0,qp.Z)((e=>({addLabel:{display:"flex",padding:"0 7px",height:"35px",alignItems:"center",fontSize:"13px",fontWeight:"500",color:e.palette.primary.main,cursor:"pointer",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",borderTop:"solid 1px rgba(0, 0, 0, 0.14)",backgroundColor:"rgba(0, 0, 0, 0.03)"},addIcon:{height:"18px",width:"18px",padding:"0 9px"}}))),yU=e=>{const{selectProps:{onCreate:t,createLabel:r,inputValue:n,components:a},children:i}=e,o=fU();return _p().createElement(lg.h,e,i,r&&!(0,O.prop)("Group",a)&&_p().createElement("span",{className:o.addLabel,onClick:()=>t(n)},_p().createElement(Jk(),{className:o.addIcon}),r))};yU.propTypes={children:Np().element.isRequired,selectProps:Np().object.isRequired};const gU=(0,qp.Z)({singleValue:{fontSize:"14px",lineHeight:"16px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",marginTop:"17px"}});function hU(){return hU=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hU.apply(null,arguments)}const EU=e=>{const{selectProps:{menuIsOpen:t},innerProps:r,children:n}=e,a=gU();return!t&&_p().createElement(zf(),hU({className:a.singleValue},r),n)};function bU(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){vU(e,t,r[t])}))}return e}function vU(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}EU.propTypes={children:Np().node,innerProps:Np().object};const TU=(0,qp.Z)({control:{height:"auto"},dropdownIndicator:{boxSizing:"content-box",transition:"transform .15s ease",padding:e=>(e.height-24)/2+"px 12px",cursor:"pointer",color:"rgba(0, 0, 0, 0.54)"},valueContainer:{marginLeft:"16px",width:0},formControl:{margin:0},filledInputRoot:{backgroundColor:"rgba(0, 0, 0, 0.03)","&:hover":{backgroundColor:"rgba(0, 0, 0, 0.03)"},"&.focused":{backgroundColor:"rgba(0, 0, 0, 0.03)"}},filledInputUnderline:{"&:before":{display:"none"}},inputLabel:{color:"rgba(0,0,0,0.6)",fontSize:"14px",paddingLeft:"4px","&.shrink":{paddingLeft:"4px"}}}),OU={menu:e=>bU({},e,{borderRadius:"0 0 4px 4px",backgroundColor:"#FFFFFFFF",boxShadow:"0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.2)",margin:0}),menuList:e=>bU({},e,{maxHeight:"208px",padding:"8px 0"}),group:e=>bU({},e,{padding:"0 0 8px 0"}),input:e=>bU({},e,{height:"16px",color:"rgba(0, 0, 0, 0.87)",fontSize:"14px",lineHeight:"16px",margin:"16px 0 0",padding:0}),option:e=>bU({},e,{fontSize:"13px",lineHeight:"15px",height:"32px"})},SU={menuList:e=>bU({},e,{padding:0})},xU={input:e=>bU({},e,{height:"16px",color:"rgba(0, 0, 0, 0.87)",fontSize:"14px",lineHeight:"16px",margin:0,padding:0})};function CU(){return CU=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},CU.apply(null,arguments)}function wU(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){AU(e,t,r[t])}))}return e}function AU(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const RU=e=>{let{value:t,label:r,createLabel:n,getOptions:a,options:i,height:o=46,onChange:l=O.identity,onCreate:s,onClear:c=O.identity,components:u,textFieldInputRef:p,TextFieldProps:d,classes:m}=e,f=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["value","label","createLabel","getOptions","options","height","onChange","onCreate","onClear","components","textFieldInputRef","TextFieldProps","classes"]);const y=TU({height:o}),[g,h]=(0,Rp.useState)(!1),E=(0,Rp.useRef)(null),b=a?Ky:Zy.J,T=(0,O.prop)("ClearIndicator",u)?{}:{IndicatorSeparator:dU.V,ClearIndicator:dU.V},S=s?(e,t)=>{s(e,t),h(!1)}:void 0,x=(0,O.prop)("Group",u)?SU:{},C=(0,O.isEmpty)(r)?xU:{},w=wU({},OU,x,C),A=wU({},y,m);return _p().createElement(b,CU({placeholder:"",defaultOptions:!0},f,{value:(0,O.defaultTo)(null,t),loadOptions:a,options:i,cacheOptions:!0,onChange:l,onCreate:S,onClear:c,createLabel:n,classes:A,styles:w,components:wU({DropdownIndicator:mU.G,LoadingIndicator:dU.V,SingleValue:EU,Menu:yU},T,u),menuPlacement:"auto",TextFieldProps:wU({},d,{label:r,variant:"filled",size:"small",classes:wU({},(0,O.prop)("classes",d),{root:kp()(y.formControl,(0,O.path)(["classes","root"],d))}),inputProps:wU({},(0,O.prop)("inputProps",d)),InputProps:wU({},(0,O.prop)("InputProps",d),{classes:wU({},(0,O.path)(["InputProps","classes"],d),{root:kp()(y.filledInputRoot,(0,O.path)(["InputProps","classes","root"],d)),underline:kp()({[y.filledInputUnderline]:(0,v.isEmptyValue)(t)},(0,O.path)(["InputProps","classes","underline"],d)),focused:kp()("focused",(0,O.path)(["InputProps","classes","focused"],d))})}),InputLabelProps:wU({},(0,O.prop)("InputLabelProps",d),{classes:wU({},(0,O.path)(["InputLabelProps","classes"],d),{root:kp()(y.inputLabel,(0,O.path)(["InputLabelProps","classes","root"],d)),shrink:kp()("shrink",(0,O.path)(["InputLabelProps","classes","shrink"],d))}),shrink:!(0,v.isEmptyValue)(t)||void 0}),ref:p||E}),inputRef:p||E,menuIsOpen:g,onMenuOpen:()=>h(!0),onMenuClose:()=>h(!1)}))},_U={value:Np().oneOfType([Np().object,Np().array]),label:Np().string.isRequired,getOptions:Np().func,options:Np().array,onChange:Np().func,onCreate:Np().func,onClear:Np().func,createLabel:Np().string,components:Np().object,textFieldInputRef:Np().object,TextFieldProps:Np().object,height:Np().number,classes:Np().object};RU.propTypes=_U;var IU=r(98018);function NU(){return NU=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},NU.apply(null,arguments)}const PU=e=>{const t=(0,ly.$H)()||"";return _p().createElement(IU.ZP,NU({},e,{storagePath:(r=t,r.endsWith("/")?r:r+"/")}));var r},DU=(0,qp.Z)({entityContainer:{display:"flex",alignItems:"center",height:"32px",minHeight:"32px",padding:0,"&.focused":{backgroundColor:"rgba(0,0,0,0.04)"}},entityLabel:{height:"15px",fontSize:"13px",color:"rgba(0,0,0,0.87)",cursor:"pointer",lineHeight:"15px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},emptyEntityLabel:{height:"15px",fontSize:"13px",color:"rgba(0,0,0,0.6)",lineHeight:"15px",marginLeft:"16px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",cursor:"default"},entityAvatar:{transform:"scale(0.5)",marginLeft:"8px",marginRight:"11px"},entitySecondaryLabel:{color:"rgba(0,0,0,0.6)"}});function kU(){return kU=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},kU.apply(null,arguments)}const LU=({innerRef:e,innerProps:t,selectOption:r,data:n,isFocused:a})=>{const i=DU(),{uri:o,entityType:l,label:s,secondaryLabel:c}=n;return""!==o?_p().createElement(gd(),kU({className:kp()(i.entityContainer,{focused:a}),ref:e,key:o,onClick:()=>r({label:s,uri:o,entityType:l})},t),_p().createElement(PU,{className:i.entityAvatar,entityType:l}),_p().createElement(_d.Y,{value:`${s}${c?", "+c:""}`},_p().createElement("span",{className:i.entityLabel},s,c&&_p().createElement("span",{className:i.entitySecondaryLabel},", ",c)))):_p().createElement(gd(),kU({className:i.entityContainer,ref:e,key:o},t,{disabled:!0}),_p().createElement("span",{className:i.emptyEntityLabel},li().text("No results found")))},UU=(0,qp.Z)((e=>({singleValue:{color:"rgba(0, 0, 0, 0.87)",fontSize:"14px",paddingTop:"18px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},linkValue:{cursor:"pointer",color:e.palette.primary.main,textDecoration:"none",pointerEvents:"all"}}))),jU=({selectProps:{currentEntityType:e,menuIsOpen:t,disableLinkClick:r},children:n,data:a})=>{const i=UU(),o=(0,ly.ax)("openEntity"),l=(0,ly.Qh)(),{generateEntityUrl:s}=(0,Rp.useContext)(tD.v),c=(0,v.isTempUri)(a.entityUri)?{className:i.singleValue,component:"span"}:{className:kp()(i.singleValue,i.linkValue),onMouseDown:e=>{e.stopPropagation()},onClick:e=>{e.stopPropagation(),r?e.preventDefault():(0,Wp.rR)(e)||(o({uri:a.entityUri}),e.preventDefault())},href:s({uiPath:l,uri:a.entityUri}),component:"a"};return t?null:_p().createElement(zf(),c,(0,v.isTempUri)(a.entityUri)?li().text(`New ${e.label} will be created`):(0,v.getLabel)(n))},FU=(0,qp.Z)({clearIcon:{cursor:"pointer",height:"20px",width:"20px"}}),MU=e=>{const{selectProps:{onClear:t}}=e,r=FU();return _p().createElement(yE(),{onClick:t,size:"large"},_p().createElement(rN(),{className:r.clearIcon}))};MU.propTypes={selectProps:Np().object.isRequired};var VU=r(55454);const BU=(0,qp.Z)((e=>({addLabel:{color:e.palette.primary.main,display:"flex",fontWeight:"500",cursor:"pointer",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},groupHeading:{fontSize:"13px",height:"36px",padding:"0 16px",display:"flex",justifyContent:"space-between",alignItems:"center",backgroundColor:"rgba(0, 0, 0, 0.03)"},addIcon:{height:"18px",width:"18px",padding:"0 9px"}}))),{Group:zU}=VU.c,HU=e=>{const{selectProps:{inputValue:t,onCreate:r},data:n,children:a}=e,i=BU();return _p().createElement(zU,e,_p().createElement("div",{className:i.groupHeading},_p().createElement("span",null,n.label),r&&_p().createElement("span",{onClick:()=>r(t,n.entityType),className:i.addLabel},_p().createElement(Jk(),{className:i.addIcon}),li().text(`Create ${t?`"${t}" as `:""}new ${n.label}`))),a)};HU.propTypes={selectProps:Np().object.isRequired,data:Np().object,children:Np().array};const YU=e=>e&&e.attributes,WU=({entityUri:e,entityType:t,mode:r,attributeTypesSelectionStrategy:n=YU})=>{const a=(0,ly.ax)("addAttributes"),i=(0,ly.ax)("removeAttribute"),o=(0,ly.ax)("modifyAttribute"),l=(0,ly.vc)(e),s=(0,Rp.useMemo)((()=>n(t)),[n,t]);return l?_p().createElement(lU,{key:l.uri,attrTypes:s,entity:l,showEmptyEditors:!0,drawLines:!0,parentUri:l.uri,mode:r,crosswalks:l.crosswalks,onAddAttributes:a,onChangeAttribute:o,onDeleteAttribute:i}):null};function GU(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const qU=(0,qp.Z)({creatorWrapper:{marginTop:"20px"}});function ZU(){return ZU=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ZU.apply(null,arguments)}function $U(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){KU(e,t,r[t])}))}return e}function KU(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function XU(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}const QU=20,JU=e=>{let{entity:t={},entityTypesUris:r=[],mode:n,max:a=QU,onChange:i,onCreate:o,metadata:l,globalSearchRequestOptions:s,attributeTypesSelectionStrategy:c,disableLinkClick:u=!1,isMasked:p=!1}=e,d=XU(e,["entity","entityTypesUris","mode","max","onChange","onCreate","metadata","globalSearchRequestOptions","attributeTypesSelectionStrategy","disableLinkClick","isMasked"]);const m=qU(),[f,y]=(0,Rp.useState)(""),g=(0,Rp.useMemo)((()=>r.map((e=>(0,v.getEntityType)(l,e))).filter(v.isAvailableEntityType)),[r,l]),h=$U({},s,{max:a,sendMasked:p}),E=o?(e,t)=>{o(t||r[0],e),y("")}:void 0,b=e=>{null!==e&&(y(""),i(e))},T=(0,Rp.useMemo)((()=>1!==g.length),[g]),S=((0,O.isEmpty)(t)?g[0]:(0,v.getEntityType)(l,t.entityType))||{},x=o&&li().text(`Create ${f?`"${f}" as `:""}new ${S.label}`),C=li().text(`Select ${1===g.length?`${g[0].label} `:""}profile`),w=!(0,O.isEmpty)(t)&&(0,v.isTempUri)(t.entityUri),A=T?{Group:HU,GroupHeading:dU.V}:{},R=w?{ClearIndicator:MU}:{},{TextFieldProps:_}=d,I=XU(d,["TextFieldProps"]),N=(0,Rp.useMemo)((()=>$U({},_||{},{"data-reltio-id":"reltio-entity-selector"})),[_]);return _p().createElement(_p().Fragment,null,_p().createElement(RU,ZU({value:(0,O.isEmpty)(t)?void 0:t,inputValue:f,onInputChange:e=>{y(e)},getOptions:e=>(0,v.typeAheadSearch)(g,e,h).then(((e,t)=>r=>{const n=r.map((t=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){GU(e,t,r[t])}))}return e}({},t,{label:(0,v.getLabel)(t.label),entityType:e.find((({uri:e})=>e===t.type))}))),a=e=>(0,O.isEmpty)(e)?[{label:"",uri:"",entityType:{}}]:e,i=t?e:e.filter((e=>n.some((t=>t.type===e.uri))));return i.length>1?i.map((e=>({label:e.label,entityType:e.uri,options:a(n.filter((t=>t.type===e.uri)))}))):a(n)})(g,o)),getOptionLabel:(0,O.prop)("entityLabel"),onChange:b,onCreate:E,onClear:()=>{b({})},label:C,createLabel:x,components:$U({Option:LU,SingleValue:jU},A,R),currentEntityType:S,isClearable:!0,disableLinkClick:u,TextFieldProps:N},I)),w&&_p().createElement("div",{className:m.creatorWrapper},_p().createElement(WU,{mode:n,attributeTypesSelectionStrategy:c,entityType:S,entityUri:t.entityUri})))},ej=(0,qp.Z)({item:{marginBottom:"20px"},dense:{marginBottom:0}});function tj(){return tj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},tj.apply(null,arguments)}function rj(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const nj=(0,VL.l)(YL,((e,{attributeValue:t,attributeType:r})=>{const{element:n,type:a}=e||{};return{highlightedError:HL(a)&&(0,v.isAttributeTypeError)(n,t.uri,r.uri)?e:null}}),(e=>{const t=ej(),{highlightedError:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["highlightedError"]),{attributeValue:a,attributeType:i,mode:o,crosswalks:l,errors:s,onChangeAttribute:c}=n,u=(0,Rp.useRef)(a),{ref:p,errorClassName:d}=$L({highlightedError:r,isSimple:!0}),m=(0,v.getReferencedEntityUriFromAttrValue)(a),f=(0,ly.ax)("entityDeleted"),y=(0,ly.ax)("entityCreated"),g=(0,ly.ax)("errorDeactivated"),h=(0,ly.vc)(m),E=(0,v.isTempUri)(m)?h:null,b=(0,ly.AH)(),T=(0,ly.mU)(["ovOnly"]),S=(0,v.getReferencedEntityFromAttrValue)(a),x=(0,v.getReferencedRelationFromAttrValue)(a),C=(0,v.getReferencedEntityTypeUriFromAttrType)(i),w=(0,v.getEntityType)(b,C),A=E?(0,v.evaluateDeepEntityLabel)(E,w.dataLabelPattern):a.label,R=(0,Rp.useMemo)((()=>[C]),[C]),_=(0,Rp.useMemo)((()=>(0,v.addReferencedRelationCrosswalks)(l,x)),[l,x]),I=(0,Rp.useMemo)((()=>(0,v.getReferencedEntityActiveError)(a,s)),[a,s]),N=(0,Rp.useMemo)((()=>S&&{entityUri:(0,v.getReferencedEntityUri)(S),entityType:(0,v.getReferencedEntityTypeUri)(S),entityLabel:a.label}),[S,a.label]),P=(0,Rp.useMemo)((()=>(0,v.getReferencedRelationAttrTypesUris)(i).map((e=>(0,v.findAttributeTypeByUri)(b,e))).filter(O.identity)),[i,b]),D=(0,Rp.useCallback)((e=>(0,v.referencedEntityAttributeTypesSelectionStrategy)(i,e)),[i]),k=(0,Rp.useCallback)((e=>{E&&f(E.uri);const t=u.current,r=!(0,O.isEmpty)(e)&&e.uri===(0,v.getReferencedEntityUriFromAttrValue)(t),n=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){rj(e,t,r[t])}))}return e}({},a,{label:e.label,refEntity:r?t.refEntity:(0,v.convertReferencedEntityForAttrValue)(e),refRelation:r?t.refRelation:(0,v.createReferencedRelationForAttrValue)(a)});c({value:n,attributeType:i,uri:a.uri}),I&&g((0,v.getErrorId)(I))}),[a,i,E,c,f,g,I]),L=(0,Rp.useCallback)(((e,t)=>{const r=(0,O.pipe)(D,(0,v.getCreatableAttributeTypes)(o))(w),n=(0,v.createTemporaryEntity)({entityTypeUri:e,initValue:t,attributeTypes:r,metadata:b,mode:o});k(n),y(n)}),[D,o,w,b,k,y]),{canCreate:U,canUpdate:j}=lL(a.uri),F=(0,Rp.useMemo)((()=>j&&(0,v.checkCanEditAttribute)({attributeType:i,attributeValue:a,mode:o,isReltioCrosswalk:(0,v.isReltioCrosswalk)(l,a)})),[i,a,o,l,j]),M=(0,Rp.useMemo)((()=>U&&(0,v.checkMetadataForCreate)(o,w)),[o,w,U]),V=(0,v.getErrorMessage)(I);return _p().createElement(cU,tj({},n,{label:(0,v.getLabel)(A),attributeTypesList:P,crosswalks:_,metadata:b}),_p().createElement("div",{ref:p,className:d},_p().createElement(NL,{errorMessage:V},_p().createElement(JU,{className:kp()(t.item,{[t.dense]:V||N&&(0,v.isTempUri)(N.entityUri)}),entity:N||{},entityTypesUris:R,globalSearchRequestOptions:T,mode:o,isDisabled:!F||!!a.masked,onChange:k,onCreate:M?L:void 0,metadata:b,attributeTypesSelectionStrategy:D,isMasked:(0,v.isAttributeHasMaskedValue)(a)}))))}));function aj(){return aj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},aj.apply(null,arguments)}class ij{static build(e,t={}){switch(e.type){case v.DataTypes.TYPE_NESTED:return _p().createElement(pU,t);case v.DataTypes.TYPE_REFERENCE:return _p().createElement(nj,t);default:{const e=(0,O.omit)(["showEmptyEditors","onAddAttributes","lazy","errors","crosswalks","showNonOv","expanded"],t);return _p().createElement(eU,aj({isReltioCrosswalk:(0,v.isReltioCrosswalk)(t.crosswalks,t.attributeValue)},e))}}}}const oj=(0,Rp.forwardRef)(((e,t)=>{const{className:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className"]);return _p().createElement("div",{ref:t,"data-reltio-id":"reltio-edit-attribute",className:r},ij.build(e.attributeType,n))}));oj.displayName="EditModeAttribute";const lj=e=>li().text("${value}",{value:1===e?li().text("value"):li().text("values")}),sj=(0,O.has)("minValue"),cj=(0,O.has)("maxValue"),uj=(0,O.pipe)(cj,O.not),pj=(0,O.propSatisfies)((e=>1===e),"minValue"),dj=({minValue:e})=>li().text("This attribute can have minimum ${minValue} ${minValueCaption}",{minValue:li().number(e,"0"),minValueCaption:lj(e)}),mj=({maxValue:e})=>li().text("This attribute can have maximum ${maxValue} ${maxValueCaption}",{maxValue:li().number(e,"0"),maxValueCaption:lj(e)}),fj=(0,O.cond)([[O.isNil,(0,O.always)("")],[({minValue:e,maxValue:t})=>e&&e===t,({minValue:e})=>li().text("This attribute should have ${minValue} ${minValueCaption}",{minValue:li().number(e,"0"),minValueCaption:lj(e)})],[(0,O.allPass)([pj,cj]),mj],[(0,O.allPass)([pj,uj]),(0,O.always)("")],[(0,O.allPass)([sj,cj]),({minValue:e,maxValue:t})=>li().text("${minCardinality} and maximum ${maxValue} ${maxValueCaption}",{minCardinality:dj({minValue:e}),maxValue:li().number(t,"0"),maxValueCaption:lj(t)})],[cj,mj],[sj,dj],[O.T,(0,O.always)("")]]),yj=(0,qp.Z)((()=>({caption:{fontSize:"0.7rem",opacity:.54}}))),gj=({cardinality:e})=>{const t=yj(),r=fj(e);return r?_p().createElement(zf(),{variant:"caption",className:t.caption},r):null};function hj(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Ej(e,t,r[t])}))}return e}function Ej(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const bj={content:'""',position:"absolute",left:"-1000px",top:"-4px",width:"5000px",height:"calc(100% + 8px)",animationName:"$highlightAnimation",animationDuration:"2s",animationIterationCount:1,opacity:0},vj=(0,qp.Z)((()=>({"@keyframes highlightAnimation":{"0%":{opacity:0},"50%":{opacity:1},"100%":{opacity:0}},highlighted:{"&::before":hj({},bj,{background:"rgba(228, 151, 0, 0.08)"}),position:"relative"}}))),Tj=e=>{const t=vj(),r=(0,Rp.useRef)(null);return(0,Rp.useEffect)((()=>{e&&e.scrollIntoRef(r)}),[e]),e?{ref:r,highlightedClassName:t.highlighted}:{ref:r}},Oj=(0,O.filter)((0,O.propSatisfies)(v.isTempUri,"uri")),Sj=(0,qp.Z)((e=>({caption:{fontSize:"0.7rem",opacity:.54},wrapper:{display:"flex",flexDirection:"column",alignItems:"flex-start",position:"relative"},attributesWrapper:{width:"100%",marginBottom:"10px"},imagesWrapper:{paddingBottom:"10px",width:"100%"},link:{display:"flex",marginTop:4},"svg-icon__root":{fontSize:"1rem"},title:{fontSize:"12px",lineHeight:"14px",paddingLeft:"12px",verticalAlign:"middle",wordBreak:"break-all",color:e.palette.text.secondary},typeError:{marginLeft:"12px"},ovIcon:{marginLeft:"8px",textIndent:0},titleWrapper:{display:"inline-block",paddingBottom:"3px"},errorWrapper:{paddingBottom:"10px"}}))),xj=({max:e,values:t,attributeType:r,parentUri:n,mode:a,drawLines:i,showEmptyEditors:o,errorMessage:l,errors:s,paging:c,crosswalks:u,showNonOv:p,nonVisibleValues:d,highlightedError:m,highlightedAttribute:f,onAddAttributes:y,onDeleteAttribute:g,onChangeAttribute:h,onDeactivateError:E,additionalControlsRenderer:b,requestNextPageOfAttributeValues:T})=>{const S=Sj(),[x,C]=(0,Rp.useState)(e),[w,A]=(0,Rp.useState)(!1),{label:R,required:_,cardinality:I,name:N,uri:P,description:D}=r,k=(0,v.isEditableMode)(a),{ref:L,errorClassName:U}=$L({highlightedError:m}),{ref:j,highlightedClassName:F}=Tj(f),M=(0,Rp.useContext)(rU),V=(0,Rp.useContext)(uN),B=(0,Rp.useMemo)((()=>null==M?void 0:M.includes(P)),[P,M]),z=(0,Rp.useMemo)((()=>null==V?void 0:V.includes(P)),[P,V]),H=(0,v.isEmptyValue)(t),Y=(!w&&o||_||B||z)&&H,W=(0,ly.Ws)(),G=(0,Rp.useMemo)((()=>W.includes(r.uri)),[W,r.uri]),q=(0,Rp.useRef)((0,v.createNewAttribute)({parentUri:n,attributeType:(0,O.omit)(["defaultValue"],r)})),Z=(0,Rp.useCallback)((()=>{C(x+1);const e=e=>({parentUri:n,index:x,attributeType:e});if(Y&&!(0,v.isComplexAttribute)(r.type)){const t=[e((0,O.omit)(["defaultValue"],r)),e(r)];return y(t)}return y([e(r)])}),[x,y,n,r,Y]),$=(0,Rp.useCallback)((0,O.pipe)(g,O.T,A),[g,A]);if(H&&!Y)return null;if(Y&&H&&(t=[q.current]),(0,v.isEmptyValue)(t))return null;const K=(Oj(t)||[]).length,X=p?"totalValues":"totalOvValues",Q=(0,O.ifElse)((0,O.has)(X),(0,O.pipe)((0,O.prop)(X),(0,O.add)(K)),(0,O.always)(t.length))(c),J=null!=c&&c.totalValues?c.totalValues-Q:null==d?void 0:d.length,ee=e<Q,te=ee&&x<Q,re=ee&&x>=Q,ne=t.slice(0,x),ae=ne?ne.length-1:0,ie=Q-x;return _p().createElement(TN,{enabled:i},_p().createElement("div",{ref:L,className:kp()(S.wrapper,U)},_p().createElement("div",{className:S.titleWrapper},_p().createElement(kP,{label:R,isRequired:_,className:S.title,"data-reltio-id":"reltio-attribute-label"}),_p().createElement(HP,{description:D}),G&&_p().createElement(QD,null),_p().createElement(FP,{nonOvValues:d,attributeType:r,className:S.ovIcon,nonOvTotal:J})),k&&_p().createElement(gj,{cardinality:I}),k&&_p().createElement(TL,{message:l,className:S.typeError}),_p().createElement("div",{className:S.attributesWrapper},ne.map(((e,t)=>_p().createElement(oj,{key:e.uri,attributeValue:e,attributeType:r,lazy:Y&&!_,showEmptyEditors:o,errors:s,ownError:(0,v.getAttributeOwnError)(e,t,r.uri,s),mode:a,crosswalks:u,onAddOneMore:ae===t?Z:null,onAddAttributes:y,onDeleteAttribute:$,onChangeAttribute:h,onDeactivateError:E,additionalControlsRenderer:b,className:0===t?F:null,ref:0===t?j:null,isEmptyEditor:Y}))),te&&_p().createElement(dk,{moreNumber:(0,O.min)(e,ie),valueNumber:ie,onClick:()=>{t.length<Q&&T({parentUri:n,attributeTypeUri:P,attributeTypeName:N,values:t,defaultMaxValues:e}),C(x+e)}}),re&&_p().createElement(gk,{onClick:()=>{C(e)}}))))};xj.displayName="AttributeRenderer";const Cj=(0,Rp.memo)(xj),wj=(0,qp.Z)({value:{color:"rgba(0, 0, 0, 0.87)"}}),Aj=(0,qp.Z)({placeholder:{color:"rgba(0, 0, 0, 0.38)",fontSize:"14px !important"}});function Rj(){return Rj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Rj.apply(null,arguments)}function _j(){return _j=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_j.apply(null,arguments)}const Ij={SingleValue:({selectProps:{menuIsOpen:e},data:{label:t}})=>{const r=wj();return!e&&_p().createElement(zf(),{variant:"body2",classes:{root:r.value}},t)},Placeholder:({innerProps:e,children:t})=>{const r=Aj();return _p().createElement(zf(),Rj({className:r.placeholder},e),t)}},Nj=e=>_p().createElement(RU,_j({components:Ij},e)),Pj=(0,Rp.memo)(Nj),Dj=(0,qp.Z)({container:{display:"flex",flex:1,alignItems:"flex-start",marginBottom:"10px"},roleContainer:{width:"100%"},valueContainer:{marginLeft:"8px",width:0},deleteButton:{marginLeft:"8px"}}),kj={MultiValue:cg._},Lj=({values:e,onChange:t,onDelete:r})=>{const n=Dj(),a=(0,ly.AH)(),i=(0,ly.eh)(),o=i.uri,l=(0,v.getRolesForEntityType)(a,i.type).map((e=>({value:e.uri,label:e.label}))),s=(e||[]).map((e=>{var t;return{value:e,label:(null===(t=l.find((0,O.propEq)("value",e)))||void 0===t?void 0:t.label)||(0,v.getLastUriPart)(e)}})),c=(0,Rp.useCallback)((e=>{const r=(null==e?void 0:e.map((0,O.prop)("value")))||[];t({value:r,attributeType:v.EntityAttrTypes.roles,uri:o})}),[o,t]),u=(0,Rp.useCallback)((()=>{r({uri:o,attributeType:v.EntityAttrTypes.roles})}),[o,r]);return _p().createElement("div",{className:n.container,"data-reltio-id":"reltio-attribute-value"},_p().createElement(Pj,{label:"",height:40,isMulti:!0,options:l,value:s,onChange:c,components:kj,classes:n,className:n.roleContainer}),!!r&&_p().createElement(Gp.T,{"data-reltio-id":"reltio-roles-delete-button",className:n.deleteButton,icon:SL(),onClick:u,size:"L"}))};var Uj=r(56333);const jj=(0,qp.Z)({container:{display:"flex",flex:1,alignItems:"flex-start",marginBottom:"10px"},deleteButton:{marginLeft:"8px"}});function Fj(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Mj(e,t,r[t])}))}return e}function Mj(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Vj=({className:e,values:t,onChange:r,onDelete:n})=>{const a=jj(),i=(0,ly.lG)(),o=(0,ly.mU)(),l=(0,Rp.useCallback)((async(e,t,r)=>{const n=await(0,v.getFacetedAttributeData)({fieldName:"tags",searchValue:e,options:Fj({},o,{max:t,pageNo:r})});return Object.keys(n.tags)}),[o]),s=(0,Rp.useCallback)((e=>{r({value:e,attributeType:v.EntityAttrTypes.tags,uri:i})}),[r,i]),c=(0,Rp.useCallback)((()=>{n({uri:i,attributeType:v.EntityAttrTypes.tags})}),[i,n]);return _p().createElement("div",{className:a.container,"data-reltio-id":"reltio-attribute-value"},_p().createElement(Uj.p,{fullWidth:!0,multiple:!0,variant:"filled",className:e,value:t||[],onChange:s,getSuggestions:l}),!!n&&_p().createElement(Gp.T,{"data-reltio-id":"reltio-tags-delete-button",className:a.deleteButton,icon:SL(),onClick:c,size:"L"}))};function Bj(){return Bj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Bj.apply(null,arguments)}function zj(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Hj=(0,VL.l)(nU,((e,{attributeType:t})=>{const{hasDeletionsMap:r,setHasDeletions:n}=e||{};return{hasDeletions:r?Boolean(r[null==t?void 0:t.uri]):void 0,setHasDeletions:n}}),(e=>{let{values:t,attributeType:r,parentUri:n,mode:a,errorMessage:i,onDeleteAttribute:o,onChangeAttribute:l,showEmptyEditors:s,hasDeletions:c,setHasDeletions:u,highlightedAttribute:p}=e,d=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["values","attributeType","parentUri","mode","errorMessage","onDeleteAttribute","onChangeAttribute","showEmptyEditors","hasDeletions","setHasDeletions","highlightedAttribute"]);const m=Sj(),{label:f,required:y,cardinality:g}=r,h=(0,v.isEditableMode)(a),[E,b]=(0,Rp.useState)(!1),T=(0,Rp.useCallback)((e=>{b(e),null==u||u(r.uri,e)}),[r.uri,u]),S=void 0!==c?c:E,x=(0,Rp.useCallback)((0,O.pipe)(o,O.T,T),[o,T]),C=(0,v.isEmptyValue)(t),w=!S&&s&&C,A=(0,Rp.useRef)((0,v.createNewAttribute)({parentUri:n,attributeType:r})),{ref:R,highlightedClassName:_}=Tj(p);return(0,v.isActivenessAttrType)(r)&&C&&!w?null:_p().createElement("div",{ref:R,className:kp()(_,m.wrapper)},_p().createElement(kP,{label:f,isRequired:y,className:kp()(m.title,m.titleWrapper),"data-reltio-id":"reltio-attribute-label"}),h&&_p().createElement(gj,{cardinality:g}),h&&_p().createElement(TL,{message:i}),_p().createElement(sN(),{className:m.attributesWrapper},(()=>{switch(r.uri){case v.EntityAttrTypes.tags.uri:return _p().createElement(Vj,{values:t,onDelete:x,onChange:l});case v.EntityAttrTypes.roles.uri:return _p().createElement(Lj,{values:t,onDelete:x,onChange:l});default:{const e=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){zj(e,t,r[t])}))}return e}({},A.current,{value:t[0]||""});return _p().createElement(oj,Bj({attributeValue:e,attributeType:r,mode:a,onDeleteAttribute:x,onChangeAttribute:l},d))}}})()))}));var Yj=r(57517),Wj=r.n(Yj);function Gj(){return Gj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Gj.apply(null,arguments)}const qj=e=>_p().createElement("svg",Gj({width:18,height:18,viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","data-reltio-id":"SvgDownload"},e),_p().createElement("defs",null,_p().createElement("path",{d:"M19 16v3H5v-3H3v3c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-3h-2zm-6-3.33l2.59-2.58L17 11.5l-5 5-5-5 1.41-1.41L11 12.67V3h2v9.67z",id:"Download_svg__a"})),_p().createElement("g",{transform:"translate(-3 -3)",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},_p().createElement("mask",{id:"Download_svg__b",fill:"#fff"},_p().createElement("use",{xlinkHref:"#Download_svg__a"})),_p().createElement("path",{fillOpacity:.54,fill:"#fff",mask:"url(#Download_svg__b)",d:"M0 0h24v24H0z"})));var Zj=r(76550),$j=r.n(Zj),Kj=r(29367),Xj=r.n(Kj);const Qj=(0,qp.Z)((()=>({root:{fontSize:"24px",color:"#fff"}}))),Jj=({checked:e,className:t,onClick:r})=>{const n=Qj(),a=e?Xj():$j();return _p().createElement(a,{className:kp()(n.root,t),onClick:r})},eF=(0,qp.Z)((()=>({overlay:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",transition:"0.2s linear all","&:not($selected):not($selectionMode):hover":{backgroundColor:"rgba(0,0,0,0.6)"},userSelect:"none"},selected:{backgroundColor:"rgba(0,114,206,0.6)"},selectionMode:{cursor:"pointer","&:not($selected)":{backgroundColor:"rgba(0,0,0,0.6)"}},button:{padding:0,width:"100px",height:"36px",color:"#fff",fontSize:"14px",fontWeight:500,lineHeight:"16px",border:"1px solid rgba(255,255,255,0.25)",backgroundColor:"rgba(98,2,238,0)"},checkedIcon:{position:"absolute",left:"4px",top:"4px",cursor:"pointer"},actions:{display:"flex",alignItems:"center",position:"absolute",top:"4px",right:"4px"},actionButton:{color:"#fff",fontSize:"24px"},dropDownMenuButton:{margin:"0 2px 0 8px"}}))),tF=e=>{const{id:t,canBeSelected:r=!1,selected:n=!1,selectionMode:a=!1,onDeselect:i=O.identity,onSelect:o=O.identity,onShareLink:l,onSetAsDefault:s,onDelete:c,onDownload:u=O.identity,onClick:p}=e,d=eF(),[m,f]=(0,Rp.useState)(!1),{canDelete:y}=lL(t),g=(0,Rp.useMemo)((()=>[{text:li().text("Share link"),onClick:l},{text:li().text("Set as default"),onClick:s},{text:li().text("Delete"),onClick:y&&c}].filter((0,O.prop)("onClick"))),[l,s,c,y]),h=e=>()=>(0,O.ifElse)((0,O.equals)(!0),i,o)(e),E=r&&(n||m||a),b=!a&&!n&&m,v=r&&n;return _p().createElement("div",{className:kp()(d.overlay,{[d.selected]:n,[d.selectionMode]:a}),onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),onClick:a?h(n):e=>{e.currentTarget===e.target&&p()},"data-reltio-id":"image-actions-overlay"},E&&_p().createElement(Jj,{className:d.checkedIcon,checked:n,onClick:h(n)}),b&&_p().createElement("div",{className:d.actions},_p().createElement(Gp.T,{onClick:u,className:d.actionButton,icon:qj}),_p().createElement($N,{menuId:`image-overlay-actions-${t}`,buttonComponent:Gp.T,buttonProps:{icon:tm(),className:kp()(d.actionButton,d.dropDownMenuButton)},menuItems:g})),v&&_p().createElement(hE(),{className:d.button,variant:"outlined",onClick:i},li().text("Deselect")))},rF=(0,Rp.memo)(tF);var nF=r(70251),aF=r.n(nF),iF=r(1937),oF=r.n(iF);const lF=(0,qp.Z)((e=>({root:{width:"328px"},paper:{width:"100%",height:"40px",display:"flex",alignItems:"center",boxShadow:"none",backgroundColor:"rgba(0,0,0,0.03)"},inputRoot:{flex:1},input:{padding:"0 12px",fontSize:"14px","&:placeholder":{color:e.palette.text.secondary}},errorMessage:{marginTop:"8px",fontSize:"12px",color:e.palette.error.main}}))),sF=e=>0===e.trim().length,cF=({onSend:e})=>{const t=lF(),[r,n]=(0,Rp.useState)(""),[a,i]=(0,Rp.useState)(null);return _p().createElement(sN(),{className:t.root},_p().createElement(dN(),{className:t.paper},_p().createElement(oF(),{value:r,onChange:e=>{const t=e.target.value,r=new RegExp(/^(ftp|http|https):\/\/[^ "]+$/).test(t);n(t),r||sF(t)?i(null):i(li().text("URL is not correct"))},classes:{root:t.inputRoot,input:t.input},placeholder:li().text("Paste an image URL here")}),_p().createElement(hE(),{disabled:Boolean(a)||sF(r),variant:"outlined",color:"primary",onClick:()=>{e(r),n(""),i(null)}},li().text("Send"))),a&&_p().createElement(zf(),{className:t.errorMessage},a))};var uF=r(65680),pF=r(83997);const dF=["image/png","image/jpeg","image/tiff","image/gif","image/bmp"],mF=({className:e,onAppendFile:t})=>_p().createElement(_p().Fragment,null,_p().createElement("input",{onInput:e=>{t&&t(e.currentTarget.files[0])},style:{display:"none"},accept:dF.join(","),id:"upload-image-button","data-reltio-id":"upload-image-button",type:"file"}),_p().createElement("label",{htmlFor:"upload-image-button"},_p().createElement(hE(),{className:e,variant:"contained",color:"primary",component:"span"},li().text("Select image"))));function fF(){return fF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},fF.apply(null,arguments)}const yF=e=>_p().createElement("svg",fF({width:256,height:256,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","data-reltio-id":"SvgUploadIcon"},e),_p().createElement("defs",null,_p().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"UploadIcon_svg__c"},_p().createElement("stop",{stopColor:"#FFF",offset:"0%"}),_p().createElement("stop",{stopColor:"#FFF",stopOpacity:0,offset:"100%"})),_p().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"UploadIcon_svg__d"},_p().createElement("stop",{stopColor:"#FFF",offset:"0%"}),_p().createElement("stop",{stopColor:"#FFF",stopOpacity:0,offset:"100%"})),_p().createElement("linearGradient",{x1:"67.572%",y1:"54.952%",x2:"15.212%",y2:"13.907%",id:"UploadIcon_svg__e"},_p().createElement("stop",{stopColor:"#000",stopOpacity:0,offset:"0%"}),_p().createElement("stop",{stopColor:"#000",offset:"100%"})),_p().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"UploadIcon_svg__f"},_p().createElement("stop",{stopColor:"#B8EDFF",offset:"0%"}),_p().createElement("stop",{stopColor:"#53ACDE",offset:"100%"})),_p().createElement("circle",{id:"UploadIcon_svg__a",cx:128,cy:128,r:128})),_p().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},_p().createElement("mask",{id:"UploadIcon_svg__b",fill:"#fff"},_p().createElement("use",{xlinkHref:"#UploadIcon_svg__a"})),_p().createElement("use",{fillOpacity:.1,fill:"#0072CE",xlinkHref:"#UploadIcon_svg__a"}),_p().createElement("g",{mask:"url(#UploadIcon_svg__b)"},_p().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(-1 9)"},_p().createElement("path",{d:"M0 107.268c0 35.579 28.703 64.409 64.173 64.409h139.021c29.578 0 53.497-24.035 53.497-53.635 0-28.356-21.935-51.562-49.705-53.515C199.577 27.705 167.2 0 128.346 0 97.425 0 70.59 17.582 57.171 43.274 25.027 46.767 0 74.117 0 107.268z",fill:"#FFF",opacity:.3}),_p().createElement("ellipse",{fill:"url(#UploadIcon_svg__c)",opacity:.4,cx:64.553,cy:107.664,rx:61.43,ry:62.336}),_p().createElement("path",{d:"M127.979 8.91c38.773 0 70.206 31.895 70.206 71.24 0 39.346-31.433 71.241-70.206 71.241-6.067 0-11.954-.78-17.57-2.249 9.688-11.019 15.574-25.551 15.574-41.478 0-33.7-26.352-61.153-59.286-62.299C78.714 23.611 101.654 8.91 127.98 8.91z",fill:"url(#UploadIcon_svg__d)",opacity:.4})),_p().createElement("path",{fill:"url(#UploadIcon_svg__e)",opacity:.12,d:"M82.093 128.474l38.374 37.966-10.666 18.958 72.714 71.94 63.578-57.537v-6.11l-71.107-70.352H97.22z",transform:"translate(-1 9)"}),_p().createElement("path",{fill:"url(#UploadIcon_svg__f)",d:"M151.004 128.29v57.591h-40.836V128.29H81l49.5-49.409L180 128.29z",transform:"translate(-1 9)"})))),gF=(0,qp.Z)((e=>({root:{padding:"36px 0 29px"},isActive:{backgroundColor:"rgba(0,114,206,0.12)"},icon:{width:"190px",height:"190px",marginBottom:"24px"},title:{marginBottom:"8px",color:e.palette.text.primary,fontSize:"20px",fontWeight:500,lineHeight:"24px"},description:{marginBottom:"24px",color:e.palette.text.secondary,fontSize:"14px",lineHeight:"16px"}}))),hF=({onAppendFile:e,className:t})=>{const r=gF(),[{canDrop:n,isOver:a},i]=(0,uF.useDrop)({accept:[pF.FILE],drop:t=>{t&&e(t.files[0])},collect:e=>({isOver:e.isOver(),canDrop:e.canDrop()})}),o=n&&a;return _p().createElement("div",{ref:i,className:kp()(r.root,{[r.isActive]:o},t)},_p().createElement(yF,{className:r.icon}),_p().createElement(zf(),{className:r.title},li().text("Drag an image here")),_p().createElement(zf(),{className:r.description},li().text("Acceptable image types would include JPG, PNG, TIFF, GIF, BMP. Maximum image size: ${MAX_IMAGE_SIZE}Mb",{MAX_IMAGE_SIZE:20})),_p().createElement(mF,{onAppendFile:e}))},EF=(0,qp.Z)((e=>({root:{width:"100%",display:"flex",alignItems:"center",padding:"0 30px",boxSizing:"border-box"},border:{borderBottom:`1px solid ${e.palette.text.primary}`,flex:1,opacity:.12},text:{padding:"0 10px",color:e.palette.text.secondary,fontSize:"14px",lineHeight:"16px"}}))),bF=({children:e,className:t})=>{const r=EF();return _p().createElement(sN(),{className:kp()(r.root,t)},_p().createElement(sN(),{className:r.border}),_p().createElement(zf(),{className:r.text},e),_p().createElement(sN(),{className:r.border}))},vF=(0,qp.Z)({closeIcon:{color:"#fff"}}),TF=({error:e,onClose:t})=>{const r=vF();return _p().createElement(mE(),{open:Boolean(e),onClose:t,message:e,action:_p().createElement(Bd.k,{className:r.closeIcon,tooltipTitle:li().text("Close"),icon:zp(),onClick:t})})},OF=(0,qp.Z)((e=>({root:{},dialogPaper:{position:"relative",maxWidth:"480px"},title:{color:e.palette.text.primary,fontSize:"20px",fontWeight:500,letterSpacing:"0.25px",lineHeight:"24px",padding:"16px"},body:{display:"flex",flexDirection:"column",alignItems:"center",padding:"0 8px 49px",textAlign:"center"},targetBox:{marginBottom:"8px"},divider:{marginBottom:"28px"}}))),SF=({open:e,onClose:t,onUpload:r})=>{const n=OF(),[a,i]=(0,Rp.useState)(!1),[o,l]=(0,Rp.useState)(null),s=(0,ly.qD)(),c=(0,ly.fN)(),u=(0,ly.Uv)(),p=e=>{i(!0),(0,v.uploadImage)({image:e,imageServicePath:s,environment:c,tenant:u}).then((e=>{r(e),t()})).catch((e=>{l((0,v.getRequestErrorMessage)(e,li().text("Something went wrong")))})).finally((()=>i(!1)))};return _p().createElement(aF(),{open:e,onClose:t,classes:{paper:n.dialogPaper}},_p().createElement(zf(),{className:n.title},li().text("Add new image")),_p().createElement(sN(),{className:n.body},_p().createElement(hF,{className:n.targetBox,onAppendFile:e=>{if(!e)return l(li().text("No image selected."));const t=Number((e.size/1024/1024).toFixed(2)),r=dF.includes(e.type);t>20?l(li().text("File size exceeds configured max file size.")):r?p(e):l(li().text("File format is not supported."))}}),_p().createElement(bF,{className:n.divider},li().text("or")),_p().createElement(cF,{onSend:e=>{p(e)}})),a&&_p().createElement(XE.z,null),_p().createElement(TF,{error:o,onClose:()=>l(null)}))},xF=(0,qp.Z)((()=>({root:{width:"100%"},image:({imageMargin:e})=>({marginRight:e,cursor:"pointer","&:last-child":{marginRight:0}}),uploadContainer:({imageMargin:e,imageWidth:t,imageHeight:r})=>({backgroundColor:"white",width:t,height:r,cursor:"pointer",border:"1px dashed #0072CE",boxSizing:"border-box",marginRight:e,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}),uploadButton:{width:"50px",height:"50px"},uploadIcon:{fontSize:"36px"}}))),CF={},wF=({attributeType:e={},attributeValues:t=[],onDeleteAttribute:r,onChangeAttribute:n,requestNextPageOfAttributeValues:a,parentUri:i,paging:o,showNonOv:l,imageSize:s=Bk})=>{const c=xF(s),[u,p]=(0,Rp.useState)(!1),d=(0,ly.ax)("setDefaultProfilePicForModifiedEntity"),m=(0,ly.eh)()||CF,f=(0,ly.AU)(m.uri),{canCreate:y}=(0,Rp.useContext)(oL),g=(0,Rp.useCallback)((()=>{p((e=>!e))}),[]),h=(0,Rp.useCallback)((t=>{const r=(0,v.generateUri)(i,e.name),a={};for(const n in t){const i=(e.attributes||[]).find((({name:e})=>e===n));i&&(a[n]=[{uri:(0,v.generateUri)(r,i.name),ov:!0,value:t[n],type:i.uri}])}n({attributeType:e,uri:r,value:a})}),[n,i,e]),E=(0,Rp.useCallback)((e=>{if(r(e),f===e.uri){var n;const r=(null===(n=t[0])||void 0===n?void 0:n.uri)===e.uri?t[1]:t[0];d({entityUri:m.uri,value:r||{}})}}),[r,m,f,t,d]),b=(t,r)=>{const{onOpenImageGalleryDialog:n,onDownload:a,onShareLink:i,onSetAsDefault:o}=t,l=(0,v.getImageAttributeOvUrl)(r),{uri:s}=r;return _p().createElement(rF,{id:s,onShareLink:()=>i(l),onSetAsDefault:()=>o(r),onDelete:()=>E({uri:s,attributeType:e}),onDownload:()=>a([l]),onClick:()=>n(s)})};return _p().createElement("div",{className:c.root,"data-reltio-id":"image-line-edit-mode"},_p().createElement(uM,{attributeValues:t,attributeType:e,renderImage:e=>(t={})=>{const r=(0,v.getImageAttributeOvThumbnailUrl)(t),{uri:n}=t,{onOpenImageGalleryDialog:a}=e;return _p().createElement("div",{className:c.image,key:n},_p().createElement(Vk,{src:r,overlay:b(e,t),onClick:()=>a(n),size:{imageWidth:s.imageWidth,imageHeight:s.imageHeight},"data-reltio-id":"reltio-attribute-value"}))},overlay:!0,countFixedItems:y?1:0,onUpload:g,onDeleteAttribute:E,imageSize:s,requestNextPageOfAttributeValues:a,paging:o,parentUri:i,showNonOv:l},y&&_p().createElement("div",{className:c.uploadContainer,onClick:g},_p().createElement(Gp.T,{className:c.uploadButton,iconClassName:c.uploadIcon,icon:Wj(),"data-reltio-id":"reltio-upload-image-button"}))),_p().createElement(SF,{open:u,onUpload:h,onClose:g}))},AF=({attributeType:e,attributeValues:t,paging:r,parentUri:n,showNonOv:a,onDeleteAttribute:i,onChangeAttribute:o,requestNextPageOfAttributeValues:l,highlightedAttribute:s,error:c,highlightedError:u,onDeactivateError:p})=>{const d=Sj(),{label:m,description:f,required:y}=e,{ref:g,highlightedClassName:h}=Tj(s),{ref:E,errorClassName:b}=$L({highlightedError:u}),T=(0,Rp.useCallback)((()=>{c&&p&&p((0,v.getErrorId)(c))}),[c,p]);return _p().createElement("div",{ref:g,className:kp()(d.wrapper,h)},_p().createElement("div",{ref:E,className:kp()(d.imagesWrapper,b)},_p().createElement("div",{className:d.titleWrapper},_p().createElement(kP,{className:d.title,label:m,"data-reltio-id":"reltio-attribute-label",isRequired:y}),_p().createElement(HP,{description:f})),_p().createElement(NL,{errorMessage:null==c?void 0:c.message,className:d.errorWrapper},_p().createElement(wF,{attributeValues:t,attributeType:e,paging:r,onDeleteAttribute:i,parentUri:n,onChangeAttribute:(0,O.pipe)(o,T),requestNextPageOfAttributeValues:l,showNonOv:a}))))};let RF=function(e){return e.imageLine="imageLine",e.special="special",e.default="default",e}({});function _F(){return _F=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_F.apply(null,arguments)}const IF=(0,VL.l)(YL,((e,{attributeType:t,parentUri:r})=>{const{element:n,type:a}=e||{},i=(e=>e===zL.NewAttribute)(a)&&n.uri===t.uri;return{highlightedAttribute:i?e:null,highlightedError:HL(a)&&(0,v.isAttributeTypeError)(n,r,t.uri)?e:null}}),(({values:e,attributeType:t,mode:r=v.Mode.Viewing,crosswalks:n,drawLines:a,paging:i={},parentUri:o,max:l,showEmptyEditors:s,showNonOv:c,highlightedError:u,highlightedAttribute:p,onAddAttributes:d,onDeleteAttribute:m,onChangeAttribute:f,additionalControlsRenderer:y})=>{const g=(0,ly.ax)("errorDeactivated"),h=(0,ly.ax)("requestNextPageOfAttributeValues"),E=(0,Rp.useContext)(aU),b=o&&(0,v.getBaseUri)(o),T=(0,Rp.useMemo)((()=>E[b]||[]),[E,b]),S=(0,ly.Jz)(o,t),x=(0,Rp.useMemo)((()=>(0,v.filterErrorsForHiddenAttributes)(S,T)),[S,T]),C=(0,ly.Xj)(),w=(0,ly.vd)(),A=(0,v.getAttributePagerActiveTypeErrorMessage)(o,t,C),R=l??w??1/0,_=(0,O.partition)(v.isOv),[I,N]=_(e),P=c?e:I,D=c?[]:N,k={errorMessage:A,errors:x,mode:r,parentUri:o,onAddAttributes:d,onDeleteAttribute:m,onChangeAttribute:f,onDeactivateError:g,additionalControlsRenderer:y,showEmptyEditors:s,highlightedError:u,highlightedAttribute:p};return(()=>{switch((0,O.cond)([[v.isSpecialAttribute,(0,O.always)(RF.special)],[v.isImage,(0,O.always)(RF.imageLine)],[O.T,(0,O.always)(RF.default)]])(t)){case RF.special:return _p().createElement(TN,{enabled:a},_p().createElement(Hj,_F({values:P,attributeType:t},k)));case RF.imageLine:return _p().createElement(TN,{enabled:a},_p().createElement(AF,{attributeValues:P,attributeType:t,paging:i,onDeleteAttribute:m,parentUri:o,onChangeAttribute:f,requestNextPageOfAttributeValues:h,showNonOv:c,highlightedAttribute:p,error:(0,v.getAttributeErrorByTypeUri)(t.uri,x),highlightedError:u,onDeactivateError:g}));default:return _p().createElement(Cj,_F({values:P,attributeType:t,max:R,paging:i,crosswalks:n,drawLines:a,requestNextPageOfAttributeValues:h,showNonOv:c,nonVisibleValues:D},k))}})()})),NF=(0,qp.Z)({root:{},form:{padding:"10px 0"},divider:{width:"100%",height:"1px",borderColor:"rgba(255,255,255,0.12)"},actions:{display:"flex",justifyContent:"flex-end",marginTop:"4px"},cancelButton:{color:"white",marginRight:"8px"}}),PF=({attributeType:e,imageAttributeFieldsOrder:t,attributeValue:r,hasChanges:n,onDeleteAttribute:a,onChangeAttribute:i,onAddAttributes:o,onCancel:l,onApply:s,mode:c})=>{const u=NF(),p=dL(r,e,t),d=0!==p.length||0===p.length&&n;return _p().createElement(sN(),{className:u.root},_p().createElement(sN(),{className:u.form},p.map((({attrType:e,values:t})=>_p().createElement(IF,{key:e.uri,parentUri:r.uri,attributeType:e,values:t,showEmptyEditors:(0,v.isTempUri)(r.uri),mode:c,drawLines:!1,onDeleteAttribute:a,onChangeAttribute:i,onAddAttributes:o})))),d&&_p().createElement(_p().Fragment,null,_p().createElement(Kf(),{className:u.divider}),_p().createElement(sN(),{className:u.actions},_p().createElement(hE(),{disabled:!n,onClick:l,className:u.cancelButton},li().text("Cancel")),_p().createElement(hE(),{disabled:!n,onClick:s,color:"primary"},li().text("Apply")))))},DF={palette:{mode:"dark",primary:v.theme.palette.primary,secondary:v.theme.palette.secondary}},kF=(0,$m.createTheme)(DF),LF=({imageAttributeFieldsOrder:e,attributeType:t,attributeValue:r})=>{const n=(0,ly.YA)(),a=(0,ly.o_)(),{addAttributes:i,changeAttribute:o,deleteAttribute:l,clearLocalChanges:s,applyLocalChanges:c,attributeValue:u,hasChanges:p}=(({initialAttributeValue:e,attributeType:t})=>{const r=(0,ly.ax)("modifyAttribute"),[n,a]=(0,Rp.useState)(e);(0,Rp.useEffect)((()=>{a(e)}),[e]);const i=!(0,O.equals)(n,e),o=(0,Rp.useCallback)((e=>{a((t=>e.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a}=t;return(0,v.addAttribute)({entity:e,attributeType:r,parentUri:n,index:a,nestingLevel:1})}),t)))}),[]),l=(0,Rp.useCallback)((({value:e,attributeType:t,uri:r})=>{a((n=>(0,v.editAttribute)({entity:n,attributeType:t,uri:r,value:e,nestingLevel:1})))}),[]),s=(0,Rp.useCallback)((({attributeType:e,uri:t})=>{a((r=>(0,v.removeAttribute)({entity:r,attributeType:e,uri:t,nestingLevel:1})))}),[]);return{addAttributes:o,changeAttribute:l,deleteAttribute:s,clearLocalChanges:(0,Rp.useCallback)((()=>{a(e)}),[e]),applyLocalChanges:(0,Rp.useCallback)((()=>{r({value:n,attributeType:t,uri:n.uri})}),[n,t,r]),attributeValue:n,hasChanges:i}})({attributeType:t,initialAttributeValue:r});return _p().createElement($m.ThemeProvider,{theme:kF},_p().createElement(sN(),null,_p().createElement(yL,{attributeType:t,uri:null==u?void 0:u.uri,onAddAttributes:a?i:void 0}),_p().createElement(bL,{attributeType:t,attributeValue:u,imageAttributeFieldsOrder:e}),a&&_p().createElement(PF,{mode:n,imageAttributeFieldsOrder:e,attributeType:t,attributeValue:u,hasChanges:p,onDeleteAttribute:l,onChangeAttribute:o,onAddAttributes:i,onCancel:s,onApply:c})))},UF=(0,qp.Z)((e=>({root:{position:"relative",backgroundColor:"#333",maxHeight:"calc(100vh - 64px)",overflow:"hidden"},header:{display:"flex",alignItems:"center",height:"56px",paddingLeft:"16px",boxShadow:`0 1px 0 0 ${e.palette.divider}`},headerTitle:{color:"rgba(255, 255, 255, 0.87)",fontSize:"16px",lineHeight:"19px"},bodyWrapper:{maxHeight:"calc(100% - 56px)",overflow:"auto"},body:{padding:"16px"},formControlLabel:{marginLeft:0,marginBottom:"27px"},checkboxLabel:{marginLeft:"8px",color:"rgba(255,255,255,0.87)",fontSize:"13px",lineHeight:"15px"},checkbox:{color:"white",padding:0}}))),jF=({className:e,attributeValue:t,handleSetAsDefault:r,attributeType:n})=>{const a=UF(),[i,o]=(0,Rp.useState)(!1),l=(0,ly.eh)()||{},s=(0,ly.vc)(null==l?void 0:l.uri)||{},c=(0,ly.xH)(),u=(0,ly.uO)()||{},p=c?l:s,d=u[null==l?void 0:l.type]||(null==u?void 0:u.default)||{};(0,Rp.useEffect)((()=>{o((null==p?void 0:p.defaultProfilePic)===(null==t?void 0:t.uri))}),[null==t?void 0:t.uri,p]);const m=(0,Rp.useCallback)((()=>{r(t.uri)}),[null==t?void 0:t.uri]);return _p().createElement(sN(),{className:kp()(a.root,e)},_p().createElement(sN(),{className:a.header},_p().createElement(zf(),{className:a.headerTitle},li().text("Details"))),_p().createElement(sN(),{className:a.bodyWrapper},_p().createElement(sN(),{className:a.body},_p().createElement(Wh(),{classes:{root:a.formControlLabel,label:a.checkboxLabel},control:_p().createElement(fd(),{className:a.checkbox,checked:i,onChange:m}),label:li().text("Set as default")}),_p().createElement(LF,{attributeType:n,imageAttributeFieldsOrder:d,attributeValue:t}))))},FF=(0,qp.Z)((()=>({root:{display:"flex",width:"100%",overflowY:"auto",height:"calc(100vh - 64px)"},main:{flex:"1 0 auto"},details:{width:"340px"}}))),MF=({attributeValues:e=[],currentAttributeValueUri:t,setCurrentAttributeValueUri:r,handleSetAsDefault:n,attributeType:a})=>{const[i,o]=(0,Rp.useState)(0);(0,Rp.useEffect)((()=>{l(t?e.findIndex((e=>e.uri===t)):0)}),[t,e]);const l=(0,Rp.useCallback)((t=>{var n;o(t),r(null===(n=e[t])||void 0===n?void 0:n.uri)}),[e]),s=FF();return _p().createElement(sN(),{className:s.root},_p().createElement(Xk,{attributeValueIndex:i,setAttributeValueIndex:l,attributeValues:e,className:s.main}),_p().createElement(jF,{handleSetAsDefault:n,attributeValue:e[i],className:s.details,attributeType:a}))};let VF=function(e){return e.Gallery="gallery",e.Details="details",e}({});var BF=r(60480),zF=r.n(BF),HF=r(54886),YF=r.n(HF),WF=r(86038),GF=r.n(WF),qF=r(39178),ZF=r.n(qF);function $F(){return $F=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$F.apply(null,arguments)}const KF=e=>_p().createElement("svg",$F({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","data-reltio-id":"SvgDetails"},e),_p().createElement("defs",null,_p().createElement("path",{d:"M14 5a1 1 0 011 1v12a1 1 0 01-1 1H4a1 1 0 01-1-1V6a1 1 0 011-1h10zm6 12v2h-3v-2h3zm2-4v2h-5v-2h5zm0-4v2h-5V9h5zm0-4v2h-5V5h5z",id:"Details_svg__a"})),_p().createElement("g",{stroke:"none",strokeWidth:1,fillRule:"evenodd"},_p().createElement("mask",{id:"Details_svg__b",fill:"#fff"},_p().createElement("use",{xlinkHref:"#Details_svg__a"})),_p().createElement("path",{mask:"url(#Details_svg__b)",d:"M0 0h24v24H0z"}))),XF=(0,qp.Z)((()=>({paper:{backgroundColor:"rgba(0, 0, 0, .85)"},backdrop:{backgroundColor:"transparent"},toolbar:{paddingLeft:"20px",paddingRight:"20px"},appBar:{position:"relative",background:"linear-gradient(180deg, rgba(0,0,0,0.65) 0%, rgba(0,0,0,0) 100%)"},closeButton:{marginRight:"28px"},closeIcon:{fontSize:"24px",color:"#fff"},headerLeft:{display:"flex",alignItems:"center",flex:2},headerCenter:{display:"flex",justifyContent:"center",flex:1},headerRight:{flex:2,display:"flex",justifyContent:"flex-end",alignItems:"center"},modeSwitcher:{backgroundColor:"#fff"},content:{padding:0}}))),QF=({open:e,mode:t,children:r,header:n,onClose:a,onChangeMode:i})=>{const o=XF(),l=(0,Rp.useMemo)((()=>[{id:VF.Gallery,title:li().text("Gallery"),Icon:ZF()},{id:VF.Details,title:li().text("Details"),Icon:KF}]),[]);return _p().createElement(aF(),{classes:{paper:o.paper},open:e,BackdropProps:{className:o.backdrop},fullScreen:!0},_p().createElement(YF(),{classes:{colorPrimary:o.appBar}},_p().createElement(GF(),{className:o.toolbar},_p().createElement(sN(),{className:o.headerLeft},_p().createElement(Bd.k,{tooltipTitle:li().text("Close"),onClick:a,className:o.closeButton,iconClassName:o.closeIcon,icon:zp()}),null==n?void 0:n.left),_p().createElement(sN(),{className:o.headerCenter},_p().createElement(ab,{modes:l,modeId:t,onChange:i,className:o.modeSwitcher})),_p().createElement(sN(),{className:o.headerRight},null==n?void 0:n.right))),_p().createElement(zF(),{className:o.content},r))},JF=(0,qp.Z)((()=>({root:{padding:"0 24px",overflowY:"auto",height:"calc(100vh - 64px)"},item:{padding:"2px"}}))),eM=({items:e,selectedItems:t,onSelectImage:r,onDeselectImage:n,onShareLink:a,onSetAsDefault:i,onDownload:o,onClickImage:l,onDelete:s})=>{const c=JF(),u=e=>_p().createElement(rF,{id:e,selected:t.includes(e),selectionMode:0!==t.length,onSelect:()=>r(e),onDeselect:()=>n(e),onShareLink:()=>a(e),onSetAsDefault:()=>i(e),onDownload:()=>o(e),onClick:()=>l(e),onDelete:s?()=>s(e):void 0,canBeSelected:!0});return _p().createElement(sN(),{className:c.root},_p().createElement(qk(),{container:!0},e.map((({id:e,src:t})=>_p().createElement(qk(),{key:e,classes:{item:c.item},item:!0},_p().createElement(Vk,{size:Uk.LARGE,onClick:()=>l(e),src:t,overlay:u(e)}))))))},tM=(0,qp.Z)((e=>({selectButton:{fontSize:"14px",fontWeight:500,color:e.palette.primary.main,textTransform:"uppercase"}}))),rM=({selectedItems:e,items:t,onSelectAll:r,onClearAll:n})=>{const a=tM(),i=e.length===t.length;return _p().createElement(Ay(),{component:"button",underline:"none",classes:{button:a.selectButton},onClick:i?n:r},i?li().text("Clear selection"):li().text("Select all images"))};var nM=r(70997),aM=r.n(nM);const iM=(0,qp.Z)((()=>({downloadButton:{color:"#fff",fontSize:"24px",marginLeft:"30px"},shareButton:{color:"#fff",fontSize:"24px",marginLeft:"21px"},deleteButton:{color:"#fff",fontSize:"24px",marginLeft:"24px"},divider:{height:"31px",width:"1px",marginLeft:"10px",backgroundColor:"rgba(255,255,255,0.38)"}}))),oM=({onDownload:e,onShare:t,onUpload:r,onDelete:n})=>{const a=iM();return _p().createElement(_p().Fragment,null,r&&_p().createElement(hE(),{variant:"contained",color:"primary",onClick:r,startIcon:_p().createElement(Wj(),null)},li().text("Upload")),e&&r&&_p().createElement("div",{className:a.divider}),e&&_p().createElement(Bd.k,{className:a.downloadButton,tooltipTitle:li().text("Download selected items"),icon:qj,onClick:e}),t&&_p().createElement(Bd.k,{className:a.shareButton,tooltipTitle:li().text("Copy link"),icon:aM(),onClick:t}),n&&_p().createElement(Bd.k,{className:a.deleteButton,tooltipTitle:li().text("Delete selected items"),icon:SL(),onClick:n}))},lM=({attributeValues:e,open:t,onClose:r,currentAttributeValueUri:n,setCurrentAttributeValueUri:a,attributeType:i,onDownload:o,onShareLink:l,onSetAsDefault:s,onUpload:c,onDeleteAttribute:u})=>{const[p,d]=(0,Rp.useState)([]),[m,f]=(0,Rp.useState)(VF.Gallery),y=(0,ly.xH)();(0,Rp.useEffect)((()=>{f(n?VF.Details:VF.Gallery)}),[n]);const g=e.map((e=>({src:(0,v.getImageAttributeOvThumbnailUrl)(e),downloadURL:(0,v.getImageAttributeOvUrl)(e),id:e.uri}))),h=e=>{l(g.find((0,O.propEq)("id",e)).downloadURL)},E=t=>{const r=e.find((({uri:e})=>e===t));s(r)},b=e=>{u({uri:e,attributeType:i})},{canCreate:T,canDelete:S}=(0,Rp.useContext)(oL),x=m===VF.Gallery,C=m===VF.Details,w=p.length>0,A=C||x&&w,R=()=>x?p:[n],_=R().every((e=>(0,v.isTempUri)(e)||S)),I=!y&&A&&_,N=!y&&T&&(C||x&&!w),P=x&&w&&_p().createElement(rM,{items:g,selectedItems:p,onClearAll:()=>{d([])},onSelectAll:()=>{d((0,O.pluck)("id",g))}}),D=_p().createElement(oM,{onDelete:I?()=>{R().forEach((e=>{b(e)})),p.length&&d([])}:void 0,onDownload:A?()=>{const e=x?(0,O.pipe)((0,O.filter)((({id:e})=>p.includes(e))),(0,O.pluck)("downloadURL"))(g):[g.find((0,O.propEq)("id",n)).downloadURL];o(e)}:void 0,onShare:C?()=>{h(n)}:void 0,onUpload:N?c:void 0});return _p().createElement(QF,{mode:m,open:t,onChangeMode:f,header:{left:P,right:D},onClose:r},x&&_p().createElement(eM,{items:g,selectedItems:p,onSelectImage:e=>{d((t=>[...t,e]))},onDeselectImage:e=>{d((t=>t.filter((t=>t!==e))))},onShareLink:h,onSetAsDefault:E,onDownload:e=>{o([g.find((0,O.propEq)("id",e)).downloadURL])},onClickImage:e=>{a(e),f(VF.Details)},onDelete:y?void 0:b}),C&&_p().createElement(MF,{handleSetAsDefault:E,setCurrentAttributeValueUri:a,currentAttributeValueUri:n,attributeValues:e,attributeType:i}))},sM=(0,qp.Z)((e=>({imageBox:{position:"relative",display:"flex",width:"100%",flexGrow:1,flexShrink:0,flexWrap:"nowrap",marginTop:"2px",overflow:"hidden"},moreButtonContainer:({imageWidth:e,imageHeight:t})=>({backgroundColor:"white",width:e,height:t,position:"absolute",right:0,cursor:"pointer"}),moreButton:({imageWidth:t,imageHeight:r})=>({display:"flex",justifyContent:"center",alignItems:"center",width:t,height:r,backgroundColor:(0,$m.alpha)(e.palette.primary.main,.06)}),number:{color:e.palette.primary.main,fontSize:"24px",lineHeight:"42px",letterSpacing:0,textAlign:"center",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}})));function cM(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const uM=({attributeType:e,attributeValues:t=[],renderImage:r,overlay:n=!1,countFixedItems:a=0,children:i,onUpload:o,onDeleteAttribute:l,imageSize:s=Bk,paging:c,parentUri:u,showNonOv:p,requestNextPageOfAttributeValues:d})=>{const m=sM(s);(0,Rp.useEffect)((()=>{if(c&&d){const r=p?c.totalOvValues:c.totalValues;r>t.length&&d({parentUri:u,attributeTypeUri:e.uri,attributeTypeName:e.name,values:[],defaultMaxValues:r})}}),[c,d,e,u,t.length,p]);const f=(0,Rp.useRef)(),[y,g]=(0,Rp.useState)(0),[h,E]=(0,Rp.useState)(0),b=(0,Rp.useContext)(oN),[T,O]=(0,Rp.useState)(!1),[S,x]=(0,Rp.useState)(),C=(0,ly.ax)("setDefaultProfilePicForEntity"),w=(0,ly.ax)("setDefaultProfilePicForModifiedEntity"),A=(0,ly.eh)()||{},R=(0,ly.xH)(),_=(0,Rp.useCallback)((e=>{const{imageMargin:r,imageWidth:n}=s,i=Math.floor((e+r)/(n+r))-a,o=e+r-(i+a)*(n+r)<8;g(i),t.length>i?E(t.length-i+(o?1:0)):E(0)}),[t.length,a,s]),I=(0,Rp.useCallback)((e=>{_(e),f.current=e}),[_]);(0,Rp.useEffect)((()=>{f.current&&_(f.current)}),[t.length,_]);const N=(0,Rp.useCallback)((e=>{b||(x(e),O(!0))}),[b]),P=(0,Rp.useCallback)((()=>{O(!1)}),[]),D=e=>(e=>{e.forEach(((e,t)=>{try{if((e=>!!(e=>e.indexOf("://")>0||0===e.indexOf("//"))(e)&&new URL(e).host!==location.host)(e)){const r=document.createElement("iframe");r.setAttribute("style","display: none;"),r.setAttribute("src",e),document.body.appendChild(r),setTimeout((()=>document.body.removeChild(r)),3e4*(t+1))}else{const t=document.createElement("a");t.href=e,t.download=(e=>e.split("/").pop())(e),document.body.appendChild(t),t.click(),document.body.removeChild(t)}}catch(e){console.error(e)}}))})(e),k=e=>navigator.clipboard.writeText(e),L=(0,Rp.useCallback)((e=>{R?(0,v.insertDefaultImageByAttrUri)(A.uri,e.uri).then((({status:t})=>{"success"===t&&C(e)})):w({entityUri:A.uri,value:e})}),[R,A.uri,C,w]),U=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){cM(e,t,r[t])}))}return e}({onOpenImageGalleryDialog:N},n&&{onDownload:D,onShareLink:k,onSetAsDefault:L});return _p().createElement(_p().Fragment,null,_p().createElement(ld.ZP,{handleWidth:!0,onResize:I}),_p().createElement(lM,{attributeValues:t,open:T,onClose:P,setCurrentAttributeValueUri:x,currentAttributeValueUri:S,attributeType:e,onDownload:D,onShareLink:k,onSetAsDefault:L,onUpload:o,onDeleteAttribute:l}),_p().createElement("div",{className:m.imageBox},i,t.slice(0,y).map(r(U)),h>0&&_p().createElement("div",{className:m.moreButtonContainer},_p().createElement("div",{className:m.moreButton,onClick:()=>N()},_p().createElement(zf(),{className:m.number},`+${h}`)))))},pM="3px",dM=(0,qp.Z)((e=>({image:({imageMargin:e,imageHeight:t,imageWidth:r})=>({marginRight:e,width:r,height:t,cursor:"pointer","&:last-child":{marginRight:0}}),deleteAttributeImage:{position:"relative","&:before":{content:"''",position:"absolute",left:0,top:0,right:0,bottom:0,background:`url('${(0,v.svg2Url)('<svg xmlns="http://www.w3.org/2000/svg" style="stroke: #D1051E; stroke-width: 1" viewBox="0 0 114 114">\n\t<line x1="5" y1="109" x2="109" y2="5" />\n</svg>')}') no-repeat`,backgroundColor:v.historyPalettes[v.HistoryOperations.deleteAttribute].backgroundColor,pointerEvents:"none"}},updateAttributeImage:{position:"relative","&:before":{content:"''",position:"absolute",left:0,top:0,right:0,bottom:0,backgroundColor:v.historyPalettes[v.HistoryOperations.updateAttribute].backgroundColor,pointerEvents:"none"}},deleteAttribute:({imageWidth:e,imageHeight:t})=>({width:e,height:t,boxSizing:"border-box",outline:`${pM} solid ${v.historyPalettes[v.HistoryOperations.deleteAttribute].color}`,outlineOffset:`-${pM}`}),insertAttribute:({imageWidth:e,imageHeight:t})=>({width:e,height:t,boxSizing:"border-box",outline:`${pM} solid ${v.historyPalettes[v.HistoryOperations.insertAttribute].color}`,outlineOffset:`-${pM}`}),updateAttribute:({imageWidth:e,imageHeight:t})=>({width:e,height:t,boxSizing:"border-box",outline:`${pM} solid ${v.historyPalettes[v.HistoryOperations.updateAttribute].color}`,outlineOffset:`-${pM}`}),number:{color:e.palette.primary.main,fontSize:"24px",lineHeight:"42px",letterSpacing:0,padding:"36px 8px",textAlign:"center",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}}))),mM=({attributeType:e,attributeValues:t=[],paging:r,parentUri:n,requestNextPageOfAttributeValues:a,showNonOv:i,imageSize:o=Bk})=>{const l=dM(o),{appearance:s}=(0,Rp.useContext)(qP);return _p().createElement(uM,{attributeValues:t,attributeType:e,renderImage:({onOpenImageGalleryDialog:e})=>t=>{const r=(0,v.getImageAttributeOvThumbnailUrl)(t),{uri:n}=t,a=(0,v.getHistoryAppearanceByUri)(n,s),i=(0,v.getHistoryAttributeClassName)(a);return _p().createElement("div",{className:kp()(l.image,{[l[i+"Image"]]:i}),key:n,"data-reltio-id":"reltio-attribute-value"},_p().createElement(Vk,{onClick:()=>e(n),className:l[i],src:r,size:{imageWidth:o.imageWidth,imageHeight:o.imageHeight}}))},imageSize:o,requestNextPageOfAttributeValues:a,paging:r,parentUri:n,showNonOv:i})},fM=({attributeType:e,attributeValues:t,paging:r,parentUri:n,showNonOv:a,requestNextPageOfAttributeValues:i})=>{const o=ok(),{label:l,description:s}=e;return _p().createElement(_p().Fragment,null,_p().createElement("div",{className:o.titleRow},_p().createElement(kP,{className:o.title,label:l,"data-reltio-id":"reltio-attribute-label"}),_p().createElement(HP,{className:o.descriptionIcon,description:s})),_p().createElement(mM,{attributeValues:t,attributeType:e,paging:r,parentUri:n,requestNextPageOfAttributeValues:i,showNonOv:a}))},yM=({attributeType:e,classes:t})=>{const r=lk(),{label:n,description:a}=e,i=(0,ly.Ws)(),o=(0,Rp.useMemo)((()=>i.includes(e.uri)),[i,e.uri]);return _p().createElement("div",{"data-reltio-id":"reltio-empty-renderer",className:kp()(r.titleRow,r.wrapper)},_p().createElement(kP,{label:n,className:kp()(r.title,null==t?void 0:t.title),"data-reltio-id":"reltio-attribute-label"}),o&&_p().createElement(QD,null),_p().createElement(HP,{description:a,className:r.descriptionIcon}))};function gM(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){hM(e,t,r[t])}))}return e}function hM(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const EM="oneLine",bM="multiLine",vM="imageLine",TM="special",OM="empty",SM=({values:e,attributeType:t,drawLines:r,paging:n={},parentUri:a,max:i,showNonOv:o,classes:l})=>{const s=ak(),c=(0,ly.ax)("requestNextPageOfAttributeValues"),u=(0,ly.vd)(),p=i??u??1/0,d=(0,O.partition)(v.isOv),m=(0,Rp.useContext)(uN),f=(0,Rp.useMemo)((()=>null==m?void 0:m.includes(t.uri)),[t.uri,m]);if(!e||!e.length&&!f)return null;const[y,g]=d(e),h=o?e:y,E=o?[]:g,b=o?"totalValues":"totalOvValues",T=(0,O.ifElse)((0,O.has)(b),(0,O.prop)(b),(0,O.always)(h.length))(n),S=null!=n&&n.totalValues?n.totalValues-T:E.length,x=1===T&&!(0,v.isComplexAttribute)(t),C=0===e.length&&f;return _p().createElement(TN,{enabled:r,className:kp()(gM({[s.paddingWrapperWithLines]:r},null!=l&&l.wrapperWithLines?{[null==l?void 0:l.wrapperWithLines]:r}:{}))},_p().createElement("div",{className:kp()(gM({[s.paddingWrapper]:!r},null!=l&&l.wrapper?{[null==l?void 0:l.wrapper]:!r}:{}))},(()=>{switch((0,O.cond)([[v.isSpecialAttribute,(0,O.always)(TM)],[v.isImage,(0,O.always)(vM)],[(0,O.always)(x),(0,O.always)(EM)],[(0,O.always)(C),(0,O.always)(OM)],[O.T,(0,O.always)(bM)]])(t)){case EM:return _p().createElement(sk,{value:h[0],nonVisibleValues:E,totalNonVisibleValues:S,attributeType:t,showNonOv:o,classes:l});case bM:return _p().createElement(hk,{values:h,nonVisibleValues:E,totalVisibleValues:T,totalNonVisibleValues:S,attributeType:t,parentUri:a,max:p,requestNextPageOfAttributeValues:c,showNonOv:o,classes:l});case vM:return _p().createElement(fM,{attributeValues:h,attributeType:t,paging:n,parentUri:a,requestNextPageOfAttributeValues:c,showNonOv:o});case TM:return _p().createElement(Nk,{values:h,attributeType:t,classes:l});case OM:return _p().createElement(yM,{attributeType:t,classes:l})}})()))},xM=(0,Rp.memo)(SM),CM=({attrTypes:e=[],entity:t,parentUri:r,drawLines:n,children:a,className:i,max:o,fixedTypeUris:l=tU,showNonOv:s,classes:c})=>{const u=(0,Rp.useContext)(aU),p=(0,Rp.useContext)(uN),d=r&&(0,v.getBaseUri)(r),m=(0,Rp.useMemo)((()=>u[d]||[]),[u,d]),f=(0,Rp.useMemo)((()=>(e||[]).filter((e=>!m.includes(e.uri)))),[e,m]),[y,g]=(0,Rp.useState)(o||1/0),h=(0,Rp.useMemo)((()=>(0,v.getAttributesListForReadMode)(f,t,s,p)),[f,t,s,p]),[E,b]=(0,Rp.useMemo)((()=>DL(l,h)),[h,l]),T=b.slice(0,y),S=o&&T.length<b.length,x=o&&T.length>=b.length&&o<T.length,C={enabled:n};return _p().createElement("div",{className:i},a&&_p().createElement(TN,C,a),T.concat(E).map((({attrType:e,values:a})=>_p().createElement(xM,{key:e.uri,attributeType:e,drawLines:n,values:a,paging:(0,O.path)(["paging",e.uri],t.attributes),parentUri:r,showNonOv:s,classes:c}))),S&&_p().createElement(dk,{onClick:()=>{g(1/0)}}),x&&_p().createElement(gk,{onClick:()=>{g(o)}}))};CM.displayName="ReadOnlyAttributesList";const wM=(0,Rp.memo)(CM),AM=(0,qp.Z)({attributesContainer:{padding:"8px 16px"},noCaption:{paddingTop:"16px"},noData:{fontSize:"13px",color:"rgba(0,0,0,0.54)"}}),RM=({className:e,entity:t={},caption:r="",excludeUris:n=[],includeUris:a=[],attributesCount:i})=>{const o=AM(),l=(0,ly.AH)(),s=(0,ly.xK)(),c=(0,Rp.useMemo)((()=>PL(l,t.type,a,n)),[n,a,l,t]),u=i||16,p=(0,v.getAttributesListForReadMode)(c,t),d=(0,Rp.useContext)(uN),m=p.filter((({values:e})=>!(0,v.isEmptyValue)(e))).length>0||d.length>0;return m||!(0,v.isEmptyValue)(r)?_p().createElement(cN.Provider,{value:s},_p().createElement(hN,{className:e},r&&_p().createElement(EN.I,{title:r}),_p().createElement(sN(),{className:kp()(o.attributesContainer,{[o.noCaption]:!r})},m?_p().createElement(wM,{entity:t,attrTypes:c,parentUri:t.uri,drawLines:!1,max:u}):_p().createElement(zf(),{className:o.noData},li().text("No data found"))))):null},_M=(0,qp.Z)({attributesContainer:{overflow:"hidden",padding:"8px 16px"},noCaption:{paddingTop:"16px"}}),IM=({className:e,mode:t,entity:r,caption:n="",excludeUris:a=[],includeUris:i=[],pinnedAttributes:o})=>{const l=_M(),s=(0,ly.ax)("addAttributes"),c=(0,ly.ax)("modifyAttribute"),u=(0,ly.ax)("removeAttribute"),p=(0,ly.AH)(),d=(0,ly.R2)(),m=(0,ly.vc)(r.uri)||{},f=(0,Rp.useMemo)((()=>(0,v.getPinnedAttributesForUser)(o,d)),[o,d]),y=(0,Rp.useMemo)((()=>PL(p,m.type,i,a)),[a,i,p,m.type]);return _p().createElement(hN,{className:e},n&&_p().createElement(EN.I,{title:n}),_p().createElement(sN(),{className:kp()(l.attributesContainer,{[l.noCaption]:!n})},_p().createElement(rU.Provider,{value:f},_p().createElement(lU,{entity:m,attrTypes:y,parentUri:m.uri,drawLines:!1,mode:t,showEmptyEditors:(0,v.isTempUri)(m.uri),crosswalks:m.crosswalks,onAddAttributes:s,onChangeAttribute:c,onDeleteAttribute:u}))))};function NM(){return NM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},NM.apply(null,arguments)}const PM=e=>{let{attributesCount:t,pinnedAttributes:r,alwaysVisible:n=[]}=e,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributesCount","pinnedAttributes","alwaysVisible"]);const i=(0,ly.Fr)(),o=(0,ly.YA)(),l=a.entity||i,s=a.mode||o;return _p().createElement(LP.Provider,{value:l},_p().createElement(uN.Provider,{value:n},(0,v.isViewMode)(s)?_p().createElement(RM,NM({},a,{attributesCount:t,entity:l})):_p().createElement(IM,NM({},a,{mode:s,pinnedAttributes:r,entity:l}))))},DM=(0,qp.Z)((()=>({container:{display:"flex",flexDirection:"column",height:"100%"},scrollWrapper:{flexGrow:1,overflowY:"auto",backgroundColor:"#FAFAFA"},attributesView:{margin:"16px"},emptyState:{height:"100%",backgroundColor:"#FAFAFA"},profileBand:{paddingLeft:48,backgroundColor:"rgba(0,114,206,0.06)"}}))),kM=()=>{const e=DM(),t=(0,Pp.useSelector)(mc),r=(0,Pp.useSelector)(pc);return _p().createElement(_p().Fragment,null,r&&_p().createElement(XE.z,null),t?_p().createElement("div",{className:e.container},_p().createElement(iN,{entity:t,classes:{profileBand:e.profileBand}}),_p().createElement("div",{className:e.scrollWrapper},_p().createElement(oN.Provider,{value:!0},_p().createElement(PM,{className:e.attributesView,entity:t,mode:v.Mode.Viewing})))):_p().createElement("div",{className:e.emptyState},_p().createElement(KE,{LogoRenderer:$E.NO_DATA,text:li().text("No data to display."),secondaryText:li().text("Select a profile and view preview details here."),variant:ZE.embedded})))},LM="circle",UM="polygon",jM={fillColor:"rgb(242,82,82)",fillOpacity:.1,strokeWeight:2,strokeColor:"#F25252",clickable:!1,editable:!0,zIndex:1},FM={mapTypeControl:!1,streetViewControl:!1,fullscreenControl:!1},MM=.001,VM=_p().createContext({});VM.displayName="EntityMarkerContext";var BM=r(17871);const zM=(0,qp.Z)((e=>({image:{width:"40px",height:"40px"},info:{marginLeft:"12px",overflow:"hidden",display:"flex",flexDirection:"column"},label:{textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",fontWeight:400,fontSize:"13px",lineHeight:"15px",color:e.palette.primary.main},secondaryLabel:{marginTop:"4px",fontWeight:400,fontSize:"10px",lineHeight:"12px",color:e.palette.text.secondary,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},link:{textDecoration:"none"},thirdRow:{display:"flex",overflow:"hidden",alignItems:"center",marginTop:"auto",paddingTop:"4px"},entityId:{display:"flex",overflow:"hidden",alignItems:"baseline",whiteSpace:"nowrap",fontWeight:400,fontSize:"12px",lineHeight:"16px"},entityIdLabel:{color:e.palette.text.secondary},entityIdValue:{marginLeft:"8px",color:e.palette.text.primary,overflow:"hidden",textOverflow:"ellipsis","&[aria-describedby]":{cursor:"pointer","&:hover":{textDecoration:"underline"}}}}))),HM=({entity:e,classes:t={}})=>{const r=zM(),{secondaryLabel:n,label:a}=t,i=(0,v.getLabel)(e.label),{secondaryLabel:o}=e,l=(0,Rp.useCallback)((()=>{navigator.clipboard.writeText((0,v.getEntityId)(e))}),[e]);return _p().createElement(_p().Fragment,null,_p().createElement(b.A,{entity:e,imageClassName:r.image}),_p().createElement("div",{className:r.info},_p().createElement(om.x,{value:(0,v.getEntityUriForLink)(e),className:r.link},_p().createElement(_d.Y,{value:i,placement:"top",showOnExceededHeight:!0},_p().createElement("div",{className:kp()(r.label,a)},i))),o&&_p().createElement(_d.Y,{value:o,placement:"top",showOnExceededHeight:!0},_p().createElement("div",{className:kp()(r.secondaryLabel,n)},o)),_p().createElement("div",{className:r.thirdRow},_p().createElement(kE,{entity:e,size:"medium"}),_p().createElement("div",{className:r.entityId,onClick:l},_p().createElement("div",{className:r.entityIdLabel},li().text("ID:")),_p().createElement(_d.Y,{value:`Copy to clipboard ${(0,v.getEntityId)(e)}`,placement:"top"},_p().createElement("div",{className:r.entityIdValue},(0,v.getEntityId)(e)))))))},YM=(0,qp.Z)({"@keyframes keyframes-wave":{"0%":{transform:"translateX(-100%)"},"60%":{transform:"translateX(100%)"},"100%":{transform:"translateX(100%)"}},wave:{overflow:"hidden",position:"relative","&:after":{top:"0",left:"0",right:"0",bottom:"0",content:'""',position:"absolute",animation:"$keyframes-wave 1.6s linear 0.5s infinite",transform:"translateX(-100%)",background:"linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.04), transparent);"}},avatar:{flex:"none",width:"40px",height:"40px",borderRadius:"50%",backgroundColor:"rgba(0, 0, 0, 0.11)"},info:{marginLeft:"12px",flex:"auto"},label:{width:"40%",height:"15px",borderRadius:"2px",backgroundColor:"rgba(0, 0, 0, 0.11)"},secondaryLabel:{marginTop:"4px",width:"100%",height:"12px",borderRadius:"2px",backgroundColor:"rgba(0, 0, 0, 0.11)"},thirdRow:{marginTop:"4px",width:"60%",height:"24px",borderRadius:"2px",backgroundColor:"rgba(0, 0, 0, 0.11)"}}),WM=()=>{const e=YM();return _p().createElement(_p().Fragment,null,_p().createElement("div",{className:kp()(e.avatar,e.wave)}),_p().createElement("div",{className:e.info},_p().createElement("div",{className:kp()(e.label,e.wave)}),_p().createElement("div",{className:kp()(e.secondaryLabel,e.wave)}),_p().createElement("div",{className:kp()(e.thirdRow,e.wave)})))},GM=(0,qp.Z)({container:{display:"flex",padding:"16px",overflow:"hidden"}});function qM(){return qM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},qM.apply(null,arguments)}const ZM=e=>{let{entity:t,classes:r={},variant:n="normal"}=e,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["entity","classes","variant"]);const i=GM(),{container:o}=r;return _p().createElement("div",qM({className:kp()(i.container,o)},a),"normal"===n?_p().createElement(HM,{entity:t,classes:r}):_p().createElement(WM,null))},$M=(0,Rp.memo)(ZM),KM=(0,qp.Z)({popper:{maxWidth:"263px",minWidth:"150px",boxShadow:"0 1px 1px 0 rgba(0,0,0,0.14), 0 2px 1px -1px rgba(0,0,0,0.12), 0 1px 3px 0 rgba(0,0,0,0.2)",backgroundColor:"white",borderRadius:"2px"}});function XM(){return XM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},XM.apply(null,arguments)}const QM=(0,v.svg2Url)('<?xml version="1.0" encoding="UTF-8"?>\n<svg width="22px" height="32px" viewBox="0 0 22 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>View / Map / Marker / Large (hover)</title>\n <defs>\n <radialGradient cx="50%" cy="50.2950175%" fx="50%" fy="50.2950175%" r="49.7049825%" gradientTransform="translate(0.500000,0.502950),scale(0.777778,1.000000),rotate(90.000000),scale(1.000000,1.293560),translate(-0.500000,-0.502950)" id="radialGradient-1">\n <stop stop-color="#000000" offset="0%"></stop>\n <stop stop-color="#000000" stop-opacity="0" offset="100%"></stop>\n </radialGradient>\n <path d="M21,0 C21.5522847,-1.01453063e-16 22,0.44771525 22,1 L22,21 C22,21.5522847 21.5522847,22 21,22 L15.7283832,22.0012846 C15.5422129,22.2445529 15.3664776,22.4802332 15.1984183,22.7122576 C13.7560833,24.7035592 13,26.2846074 13,27.5 L13,27.5 L12.9945143,27.6492623 C12.9181651,28.6841222 12.0543618,29.5 11,29.5 C9.8954305,29.5 9,28.6045695 9,27.5 L9,27.5 L8.99485006,27.3298651 C8.91582184,26.0024976 7.93016704,24.2171459 6.23940611,22.000704 L1,22 C0.44771525,22 6.76353751e-17,21.5522847 0,21 L0,1 C-6.76353751e-17,0.44771525 0.44771525,1.01453063e-16 1,0 L21,0 Z" id="path-2"></path>\n </defs>\n <g id="View-/-Map-/-Marker-/-Large-(hover)" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <ellipse id="Oval" fill="url(#radialGradient-1)" opacity="0.32" cx="11" cy="28.5" rx="6" ry="4.66666667"></ellipse>\n <mask id="mask-3" fill="white">\n <use xlink:href="#path-2"></use>\n </mask>\n <use id="Path-2" fill="#FFFFFF" xlink:href="#path-2"></use>\n <rect id="Entity-type" fill="#24A8E8" mask="url(#mask-3)" x="0" y="0" width="22" height="32"></rect>\n <path d="M20,2 L20,20 L14.755,20 L14.6905172,20.0815309 C14.3562717,20.5012516 14.0578656,20.8886742 13.7817711,21.2616986 L13.5786724,21.5390469 C11.92787,23.8181606 11.079024,25.6311217 11.0052669,27.2674145 L11.0052669,27.2674145 L11,27.5 L10.9968324,27.3203844 C10.9285422,25.3781621 9.75347502,23.1598866 7.22124201,20.0010865 L2,20 L2,2 L20,2 Z" id="Path" fill="#FFFFFF" fill-rule="nonzero" mask="url(#mask-3)"></path>\n </g>\n</svg>'),JM=(0,v.svg2Url)('<?xml version="1.0" encoding="UTF-8"?>\n<svg width="22px" height="32px" viewBox="0 0 22 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>View / Map / Marker / Large</title>\n <defs>\n <radialGradient cx="50%" cy="50.2950175%" fx="50%" fy="50.2950175%" r="49.7049825%" gradientTransform="translate(0.500000,0.502950),scale(0.777778,1.000000),rotate(90.000000),scale(1.000000,1.293560),translate(-0.500000,-0.502950)" id="radialGradient-1">\n <stop stop-color="#000000" offset="0%"></stop>\n <stop stop-color="#000000" stop-opacity="0" offset="100%"></stop>\n </radialGradient>\n <path d="M20,1 C20.5522847,1 21,1.44771525 21,2 L21,20 C21,20.5522847 20.5522847,21 20,21 L15.2374606,21.0021908 C14.9306693,21.3935449 14.6510143,21.7632851 14.3885453,22.1256523 C12.8309725,24.2760522 12,26.0137017 12,27.5 C12,28.0522847 11.5522847,28.5 11,28.5 C10.4477153,28.5 10,28.0522847 10,27.5 C10,25.7886708 8.84033182,23.6810997 6.73798027,21.0014567 L2,21 C1.44771525,21 1,20.5522847 1,20 L1,2 C1,1.44771525 1.44771525,1 2,1 L20,1 Z" id="path-2"></path>\n </defs>\n <g id="View-/-Map-/-Marker-/-Large" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <ellipse id="Oval" fill="url(#radialGradient-1)" opacity="0.12" cx="11" cy="28.5" rx="4.5" ry="3.5"></ellipse>\n <path d="M21,0 C21.5522847,-1.01453063e-16 22,0.44771525 22,1 L22,21 C22,21.5522847 21.5522847,22 21,22 L15.7283832,22.0012846 C15.5422129,22.2445529 15.3664776,22.4802332 15.1984183,22.7122576 C13.7560833,24.7035592 13,26.2846074 13,27.5 L13,27.5 L12.9945143,27.6492623 C12.9181651,28.6841222 12.0543618,29.5 11,29.5 C9.8954305,29.5 9,28.6045695 9,27.5 L9,27.5 L8.99485006,27.3298651 C8.91582184,26.0024976 7.93016704,24.2171459 6.23940611,22.000704 L1,22 C0.44771525,22 6.76353751e-17,21.5522847 0,21 L0,1 C-6.76353751e-17,0.44771525 0.44771525,1.01453063e-16 1,0 L21,0 Z" id="Path-3" fill="#FFFFFF"></path>\n <mask id="mask-3" fill="white">\n <use xlink:href="#path-2"></use>\n </mask>\n <use id="Path-2" fill="#FFFFFF" fill-rule="nonzero" xlink:href="#path-2"></use>\n <rect id="Entity-type" fill="#24A8E8" mask="url(#mask-3)" x="0" y="0" width="22" height="32"></rect>\n </g>\n</svg>'),eV=e=>{let{marker:t,onClick:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["marker","onClick"]);const a=KM(),i=(0,Rp.useRef)(),[o,l]=(0,Rp.useState)(!1),{activeEntityUri:s}=(0,Rp.useContext)(VM),c=(0,O.pathEq)(["entity","uri"],s,t),u={lat:t.point.lat,lng:t.point.lng},p=(0,Rp.useCallback)((0,v.debounce)(l,50),[]),d=(0,Rp.useCallback)((()=>p(!0)),[p]),m=(0,Rp.useCallback)((()=>p(!1)),[p]),f=(0,Rp.useCallback)((()=>r(t)),[r,t]);return _p().createElement(_p().Fragment,null,_p().createElement(FN.r,{anchorEl:i.current,open:o,className:a.popper,modal:!1,placement:"top"},_p().createElement($M,{entity:t.entity,onMouseOver:d,onMouseOut:m})),_p().createElement(BM.Jx,XM({icon:{url:o||c?QM:JM,scaledSize:new google.maps.Size(22,32)},position:u,onClick:f,visible:!1!==t.visible,onMouseOver:d,onMouseOut:m},n)),_p().createElement(BM.vD,{options:{alignBottom:!0,pane:"mapPane",pixelOffset:new google.maps.Size(0,-40),closeBoxURL:"",enableEventPropagation:!0,disableAutoPan:!0},position:u},_p().createElement("span",{ref:i})))},tV=(0,Rp.memo)(eV);var rV=r(47111);const nV=({children:e,className:t,position:r,map:n})=>{const[a,i]=(0,Rp.useState)(null);return(0,Rp.useEffect)((()=>{const e=document.createElement("div"),t=n.controls[r].length;return n.controls[r].push(e),i(e),()=>{n.controls[r].removeAt(t)}}),[n,r]),(0,Rp.useEffect)((()=>{a&&t&&a.classList.add(t)}),[t,a]),a?(0,rV.createPortal)(e,a):null};var aV=r(518),iV=r.n(aV);function oV(){return oV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},oV.apply(null,arguments)}const lV=e=>_p().createElement("svg",oV({width:18,height:18,viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgRadius"},e),_p().createElement("path",{d:"M10.61 8.568A1.666 1.666 0 119.432 7.39l3.656-3.657a6.668 6.668 0 101.179 1.179L10.61 8.568zm-7.503 6.325A8.333 8.333 0 1114.893 3.107 8.333 8.333 0 013.107 14.893z",fill:"#000",stroke:"none",strokeWidth:1,fillRule:"evenodd",opacity:.54}));function sV(){return sV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},sV.apply(null,arguments)}const cV=e=>_p().createElement("svg",sV({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","data-reltio-id":"SvgDraw"},e),_p().createElement("defs",null,_p().createElement("path",{d:"M18.29 11.44a1.49 1.49 0 012.12 0l1.15 1.15c.59.58.59 1.53 0 2.12L16.27 20H13v-3.27zM18.174 4c0 1.71-.26 3.285-.932 4.563-.946 1.798-2.609 2.724-4.906 2.46l-.855-.116c-4.382-.544-6.626.53-6.626 3.609 0 1.968 1.105 2.924 3.267 3.304.692.121 1.306.165 2.234.176L11 18v2l-.698-.003c-1.016-.013-1.71-.063-2.526-.206-3.018-.53-4.921-2.176-4.921-5.274 0-4.819 3.71-6.378 9.52-5.505 1.575.237 2.506-.255 3.098-1.38.451-.858.666-2.02.697-3.307L16.174 4h2zM18 13.97l-3.45 3.45v1.03h1.03L19.03 15 18 13.97z",id:"Draw_svg__a"})),_p().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},_p().createElement("mask",{id:"Draw_svg__b",fill:"#fff"},_p().createElement("use",{xlinkHref:"#Draw_svg__a"})),_p().createElement("g",{mask:"url(#Draw_svg__b)",fill:"#000",fillOpacity:.54},_p().createElement("path",{d:"M0 0h24v24H0z"})))),uV=(0,qp.Z)({container:{margin:"2px",display:"flex",alignItems:"center"},button:{color:"rgba(0,0,0,0.54)",padding:0,height:"24px",width:"24px",minWidth:0},icon:{width:"20px",height:"20px"}}),pV=(0,Id.T)(hE()),dV=({drawingMode:e,drawingModes:t=[],hasActiveOverlay:r,onDrawingModeChanged:n,onClearOverlay:a})=>{const i=uV(),o=e=>()=>{n(e)};return _p().createElement("div",{className:i.container},e||r?_p().createElement(pV,{tooltipTitle:li().text("Clear area"),className:i.button,onClick:r?a:o(null)},_p().createElement(iV(),{className:i.icon})):t.map((e=>{const t=(e=>{switch(e){case LM:return lV;case UM:return cV;default:return null}})(e);return _p().createElement(pV,{tooltipTitle:li().text("Draw area"),key:e,className:i.button,onClick:o(e)},_p().createElement(t,{className:i.icon}))})))},mV=(0,qp.Z)({container:{height:"28px",marginRight:"7px",marginLeft:0},label:{fontSize:"11px",alignSelf:"center",lineHeight:"13px",marginLeft:"2px",letterSpacing:0},checkbox:{width:"20px",height:"20px",boxSizing:"content-box",padding:"5px","& svg":{width:"16px",height:"16px"}}}),fV=({isSearchOnMapMove:e,onChangeIsSearchOnMapMove:t})=>{const r=mV();return _p().createElement(Wh(),{classes:{root:r.container,label:r.label},control:_p().createElement(fd(),{checked:e,onChange:e=>{t(e.target.checked)},className:r.checkbox}),label:li().text("Search as I move the map")})},yV=e=>{const t=e.getBounds(),r=t.getNorthEast(),n=t.getSouthWest(),a=r.lat(),i=r.lng(),o=n.lat(),l=n.lng(),s=[],c=[];if(!(180===i&&-180===l||-180===i&&180===l)){const e=t.getCenter();s.push([a,e.lng()]),c.push([o,e.lng()])}return[[a,i],...s,[a,l],[o,l],...c,[o,i]]},gV=e=>{switch(e){case LM:return window.google.maps.drawing.OverlayType.CIRCLE;case UM:return window.google.maps.drawing.OverlayType.POLYGON;default:return null}},hV=(e,t,r)=>{if(t.path){const n=r||new window.google.maps.LatLngBounds;t.path.forEach((({lat:e,lng:t})=>n.extend(new window.google.maps.LatLng(e,t)))),e.fitBounds(n)}},EV=(0,qp.Z)({mapControlContainer:{borderRadius:"2px",backgroundColor:"#FFFFFF",boxShadow:"0 1px 3px 0 rgba(0,0,0,0.15)",margin:"10px"}});function bV(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){vV(e,t,r[t])}))}return e}function vV(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const TV=["drawing"],OV=({markers:e=[],mapKey:t,defaultZoom:r,defaultCenter:n,loadingElement:a,isSearchOnMapMove:i,isSearchEnabled:o,activeOverlay:l,overlayOptions:s={},drawingModes:c=[],markerClusterer:u,markerClustererOptions:p,mapOptions:d={},mapContainerClassName:m,onMapBoundsChanged:f=O.identity,onOverlayUpdated:y=O.identity,onMarkerClicked:g=O.identity})=>{const h=EV(),{isLoaded:E,loadError:b}=(0,BM.Ji)({googleMapsApiKey:t,libraries:TV}),v=(0,Rp.useRef)(null),[T,S]=(0,Rp.useState)(null),[x,C]=(0,Rp.useState)(null),[w,A]=(0,Rp.useState)(null);(({markers:e,activeOverlay:t,isSearchOnMapMove:r,map:n})=>{const a=Boolean(n&&window.google),i=(0,Qy.D)(e),o=(0,Qy.D)(t),l=(0,Qy.D)(a);(0,Rp.useEffect)((()=>{const s=i!==e,c=l!==a,u=a&&t&&(o!==t||c);a&&!r&&e.length&&(s||c)?((e,t,r)=>{const n=new window.google.maps.LatLngBounds;if(e.forEach((e=>n.extend(e.point))),1===e.length){const t=e[0].point;n.extend(new window.google.maps.LatLng(t.lat+MM,t.lng+MM)),n.extend(new window.google.maps.LatLng(t.lat-MM,t.lng-MM))}t.fitBounds(n),r&&hV(t,r,n)})(e,n,t):u&&hV(n,t)}),[a,e,t])})({markers:e,activeOverlay:l,map:T,isSearchOnMapMove:i});const R=(0,Rp.useMemo)((()=>bV({},jM,s)),[s]),_=(0,Rp.useMemo)((()=>bV({},FM,d)),[d]),I=(0,Rp.useCallback)((e=>{f(e?yV(T):null),A(null),clearTimeout(v.current)}),[T,f]),N=(0,Rp.useCallback)((()=>{clearTimeout(v.current)}),[]),P=(0,Rp.useCallback)((()=>{i&&f(yV(T))}),[i,T,f]),D=(0,Rp.useCallback)((()=>{i&&(clearTimeout(v.current),v.current=setTimeout(P,1e3))}),[P,i]),k=(0,Rp.useCallback)(((e,t)=>{var r;const n=t||x&&{type:UM,overlay:x};if((0,O.isEmpty)(n))return;const{overlay:a,type:i}=n,o={[UM]:()=>a.getPath().getArray().map((e=>[e.lat(),e.lng()])),[LM]:()=>({radius:a.getRadius()/1e3,center:a.getCenter()})},l=null===(r=o[i])||void 0===r?void 0:r.call(o);l&&y({data:l,type:i})}),[y,x]),L=(0,Rp.useCallback)((e=>t=>{k(null,{type:e,overlay:t}),t.setMap(null),A(null)}),[k]),U=(0,Rp.useCallback)((()=>{y(null)}),[y]),j=t=>e.filter((0,O.prop)("point")).map((e=>_p().createElement(tV,{key:e.id,marker:e,clusterer:t,onClick:g})));if(b)return null;if(!E)return a;const F=o&&Boolean(c.length),M=T&&o&&Boolean(c.length),V=T&&o,B=!gV(w)&&l&&(0,O.propEq)("type",UM,l);return _p().createElement(BM.b6,{mapTypeId:window.google.maps.MapTypeId.ROADMAP,options:_,onLoad:S,zoom:r,center:n,onZoomChanged:N,onDragStart:N,onIdle:D,mapContainerClassName:m},M&&_p().createElement(nV,{className:h.mapControlContainer,position:window.google.maps.ControlPosition.TOP_RIGHT,map:T},_p().createElement(dV,{hasActiveOverlay:!!l,drawingModes:c,drawingMode:w,onDrawingModeChanged:A,onClearOverlay:U})),V&&_p().createElement(nV,{className:h.mapControlContainer,position:window.google.maps.ControlPosition.TOP_CENTER,map:T},_p().createElement(fV,{onChangeIsSearchOnMapMove:I,isSearchOnMapMove:i})),u?(z=p,_p().createElement(BM.XL,{options:z},j)):j(),B&&_p().createElement(BM.mg,{onLoad:C,path:l.path,editable:!0,options:R,onMouseUp:k,onDragEnd:k}),F&&_p().createElement(BM.j_,{onPolygonComplete:L(UM),onCircleComplete:L(LM),drawingMode:gV(w),options:{drawingControl:!1,circleOptions:R,polygonOptions:R}}));var z},SV=(e,t)=>Math.abs(e-t)<1,xV=(0,O.curry)(((e,t,r)=>{const n=t.map((({position:t})=>{const r=e.find((({point:e})=>SV(t.lat(),e.lat)&&SV(t.lng(),e.lng)));return(0,O.propOr)("","label",r)})),a=(n.length>2?n.slice(0,2).concat("..."):n).join("\n");let i=0;const o=t.length.toString();let l=o;for(;0!==l;)l=parseInt(l/10,10),i++;return i=Math.min(i,r),{text:o,index:i,title:a}})),CV=e=>{let t=e.label||e.value||"";return Array.isArray(t)?t=t.join(", "):(0,O.is)(Object,t)&&(t=""),t},wV=(e,t)=>Object.values(e).filter(Array.isArray).flat(1/0).filter(v.isOv).flatMap((e=>{let r;return e.type==t&&(r=[CV(e)]),(0,O.is)(Object,e.value)&&(r=(r||[]).concat(wV(e.value,t))),r})),AV=(0,O.pipe)((0,O.path)(["point","lat"]),(0,O.both)((0,O.gt)(90),(0,O.lt)(-90))),RV=e=>e&&e.length>0,_V=(e,t)=>[].concat(null!=e&&e.attributes?wV(e.attributes,t):[]).filter(O.identity),IV=(e,t,r)=>{if((0,v.hasMaskingByUris)(e,[r.latitude,r.longitude]))return null;const n=_V(t,r.latitude),a=_V(t,r.longitude);return RV(n)&&RV(a)?(0,O.zipWith)(((e,t)=>({lat:Number(e),lng:Number(t)})),n,a):null};function NV(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const PV=async(e,t,r=[])=>{const n=((e,t)=>{const r={};return(0,O.flatten)(t.map((t=>{return"configuration/entityTypes/Location"===t.type?{id:t.uri,label:t.label,entity:t,pointSource:t.attributes}:(r[t.type]=r[t.type]||((null===(n=(0,v.getEntityType)(e,t.type))||void 0===n?void 0:n.attributes)||[]).filter((e=>"configuration/entityTypes/Location"===e.referencedEntityTypeURI)).map((({name:e})=>e)),r[t.type].map((e=>[e,t.attributes[e]])).filter((([,e])=>e)).flatMap((([e,r])=>r.map((r=>({id:r.uri,label:r.label,entity:t,pointSource:r.value,refAttribute:r,name:e}))))));var n})))})(t,r),a=await Promise.all(n.map((({id:r,label:n,entity:a,pointSource:i,refAttribute:o,name:l})=>(async(e,t,r,n,a,i)=>{if(t&&t.type){const e=(0,v.getEntityType)(n,t.type);a&&(t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){NV(e,t,r[t])}))}return e}({},t,{attributes:{[i]:[a]}}));const r=(e.geoLocationAttributes||[]).map((e=>IV(n,t,e))).filter(O.identity);if(r.length>0)return Promise.resolve(r[0])}const o=r.GeoLocation;if(o){const e=o.map((e=>{const t=e.value.Latitude,r=e.value.Longitude;if(RV(t)&&t[0].value&&RV(r)&&r[0].value)return(0,v.hasMaskingByUris)(n,[t[0].type,r[0].type])?null:{id:e.uri,lat:Number(t[0].value),lng:Number(r[0].value)}})).filter(O.identity);if(e.length>0)return Promise.resolve(e)}if(a&&a.label)try{return(await(0,v.decodeAddress)({servicesPath:e,address:a.label})).location}catch{return null}return Promise.resolve(null)})(e,a,i,t,o,l).then((t=>!t&&a.label?(0,v.decodeAddress)({servicesPath:e,address:a.label}).then((e=>e.location)).catch((()=>null)):t)).then((e=>(0,v.wrapInArrayIfNeeded)(e).filter(O.identity).map((e=>({id:e.id||r,label:n,entity:a,point:e}))))).catch((()=>null)))));return a.flat(1/0).filter(O.identity)},DV=async({servicesPath:e,metadata:t,entities:r})=>{const n=((e,t=[])=>(0,O.pipe)((0,O.chain)((t=>{const r=(0,v.getEntityType)(e,t.type);return((null==r?void 0:r.geoLocationAttributes)||[]).flatMap((r=>{if((0,v.findAttributeTypeByUri)(e,r.latitude,t.type)&&(0,v.findAttributeTypeByUri)(e,r.longitude,t.type)){const n=IV(e,t,r);return null==n?void 0:n.map((({lat:e,lng:r})=>({id:`${t.uri}_nested_${e}_${r}`,entity:t,label:t.label,point:{lat:Number(e),lng:Number(r)}})))}}))})),(0,O.filter)(O.identity),(0,O.uniqBy)((0,O.prop)("id")))(t))(t,r),a=await PV(e,t,r);return[...n,...a.filter((e=>!n.some((t=>{return n=t,(r=e).entity===n.entity&&r.point.lat===n.point.lat&&r.point.lng===n.point.lng;var r,n}))))]},kV=[],LV={[v.MapSearch.geoPolygon]:UM,[v.MapSearch.geoLocation]:LM},UV=e=>e&&e.length?[...e,e[0]]:e,jV=e=>e[0].map((([e,t])=>({lat:e,lng:t}))).slice(0,-1),FV=(0,qp.Z)((()=>({container:{height:"100%",width:"100%",position:"relative"},fullHeight:{height:"100%"}}))),MV=()=>{const e=FV(),t=(0,Pp.useSelector)(ai.Qr),r=(0,Pp.useSelector)(ki.AO),n=(0,Pp.useSelector)(A().selectors.getGoogleMapKey),{markers:a,loading:i,onMarkerClicked:o}=(e=>{const t=(0,Pp.useDispatch)(),{markers:r,loading:n}=(e=>{const[t,r]=(0,Rp.useState)([]),[n,a]=(0,Rp.useState)(!1),i=(0,qh._)(),o=(0,ly.AH)(),l=(0,ly.au)();return(0,Rp.useEffect)((()=>{a(!0),i(DV({metadata:o,servicesPath:l,entities:e})).then((e=>{r(e.filter(AV))})).catch((()=>{r([])})).finally((()=>{a(!1)}))}),[o,l,e,DV,i]),{markers:t,loading:n}})(e||kV),a=(0,Rp.useRef)(null),i=(0,Rp.useRef)(null),o=(0,Rp.useCallback)((e=>{t({type:ue,payload:e||null})}),[t]),l=(0,Rp.useCallback)((()=>{clearTimeout(i.current),clearTimeout(a.current)}),[]);return{markers:r,loading:n,onMarkerClicked:(0,Rp.useCallback)((e=>{const t=(0,O.path)(["entity","uri"],e);l(),o(),a.current=setTimeout((()=>o(t)),0),i.current=setTimeout(o,3e3)}),[l,o])}})(t),{isSearchEnabled:l,activeOverlay:s,onOverlayUpdated:c,isSearchOnMapMove:u,onMapBoundsChanged:p}=(()=>{const e=(0,Pp.useDispatch)(),t=(0,Pp.useSelector)(ai.Qy),r=(0,Pp.useSelector)(ai.bt),n=(0,Pp.useSelector)(ki.d7),[a,i]=(0,Rp.useState)(!1),o=(0,Rp.useCallback)((t=>{let r=null,n=null;if(t){const{data:e,type:a}=t;switch(a){case LM:{const{center:t,radius:a}=e;r=[t.lng(),t.lat(),a],n=v.MapSearch.geoLocation;break}case UM:r=UV(e),n=v.MapSearch.geoPolygon}}i(!1),e($a(r,n))}),[e]),l=(0,Rp.useCallback)((t=>{i(!!t),e($a(UV(t),t&&v.MapSearch.onMapMove))}),[e]),s=LV[r],c=(0,Rp.useMemo)((()=>n&&s&&t.length?{path:s===UM?jV(t):null,type:s}:null),[n,t,s]);return(0,Rp.useEffect)((()=>{(c||0===t.length)&&i(!1)}),[t,c]),{isSearchEnabled:n,onOverlayUpdated:o,activeOverlay:c,isSearchOnMapMove:a,onMapBoundsChanged:l}})(),d=(0,Rp.useMemo)((()=>_p().createElement("div",{className:e.fullHeight},_p().createElement(XE.z,null))),[e]),m=(0,Rp.useMemo)((()=>({gridSize:60,maxZoom:9,calculator:xV(a)})),[a]),f=(0,Rp.useMemo)((()=>({activeEntityUri:r})),[r]),y=(0,Rp.useMemo)((()=>({lat:0,lng:0})),[]),g=(0,Rp.useMemo)((()=>[UM]),[]);return n?_p().createElement("div",{className:e.container},i&&_p().createElement(XE.z,null),_p().createElement(VM.Provider,{value:f},_p().createElement(OV,{loadingElement:d,defaultZoom:1,defaultCenter:y,onOverlayUpdated:c,onMarkerClicked:o,activeOverlay:s,markers:a,fullscreenControl:!1,markerClusterer:!0,markerClustererOptions:m,drawingModes:g,isSearchOnMapMove:u,onMapBoundsChanged:p,isSearchEnabled:l,mapContainerClassName:e.fullHeight,mapKey:n}))):null},VV=(0,Id.T)(Gp.T),BV=e=>{switch(e){case B.om.PROFILE:return li().text("Hide entity details");case B.om.MAP:return li().text("Hide map")}},zV=()=>{const e=nN(),t=(0,Pp.useDispatch)(),r=(0,Pp.useSelector)(ki.qx),n=r===B.om.MAP,a=(0,Pp.useSelector)(A().selectors.getGoogleMapKey),i=(0,Rp.useCallback)((()=>t(Ni(null))),[t]);return(0,Rp.useEffect)((()=>{!a&&n&&i()}),[a,n,i]),_p().createElement("div",{className:e.container},_p().createElement(VV,{tooltipTitle:BV(r),tooltipPlacement:"bottom-start",size:"L",icon:rN(),className:e.closeButton,onClick:i}),(e=>{switch(e){case B.om.PROFILE:return _p().createElement(kM,null);case B.om.MAP:return _p().createElement(MV,null)}})(r))},HV=({className:e,loading:t,entities:r,entityTypeTab:n,quantity:a,rowsPerPage:i,page:o,entityToHighlight:l,selectedEntityUri:s,mode:c,previewPanelMode:u,isPreviewPanelOpen:p,dispatch:d})=>{const m=JE(),f=(0,Rp.useRef)(),[y,g]=(0,Rp.useState)("50%"),h=(0,Di.gj)(c),E=u===B.om.PROFILE,b=u===B.om.MAP,[T,S]=(0,Rp.useState)({}),x=(0,Rp.useCallback)(((e,t)=>{S((0,O.assoc)(e,t))}),[]);(0,Rp.useEffect)((()=>{f.current&&(f.current.scrollTop=0)}),[r]),(0,Rp.useEffect)((()=>{E&&((0,v.isEmptyValue)(r)?d(yc(null)):!(0,O.prop)(0,r)||s&&r.map((0,O.prop)("uri")).includes(s)||d(yc(r[0].uri)))}),[d,E,s,r]),(0,Rp.useEffect)((()=>{!E&&s&&d(gc(null))}),[d,s,E]);const C=(0,Rp.useCallback)((e=>d(((e,t=0,r)=>({type:_.Z.CHANGE_PAGE,payload:{pageNumber:e,debounceTime:t,entityTypeUri:r}}))(e,250,n))),[d,n]),w=(0,Rp.useCallback)((e=>d(((e,t)=>({type:_.Z.CHANGE_ROWS_PER_PAGE,payload:{number:e,entityTypeUri:t}}))(e,n))),[d,n]),A=(0,Rp.useCallback)((e=>d(yc(e))),[d]),R=(0,Rp.useCallback)((0,v.debounce)((e=>d({type:pe,payload:e})),50),[d]),I=(0,Rp.useCallback)((({percentageSize:e})=>g(e)),[]),N=e=>{const t=(0,O.prop)(e.uri,T);return _p().createElement(Wm,{entity:e,entityImportStatus:t,onEntityImportStatusChange:x})},P=(0,Rp.useRef)(null);return _p().createElement("div",{className:kp()(m.container,e)},t&&_p().createElement(XE.z,null),(0,Di.gj)(c)?_p().createElement(KI,{quantity:a}):_p().createElement(MI,null),_p().createElement(PE,{className:m.resizablePanesWrapper,orientation:"vertical",size:p?y:"100%",minSize:480,maxSize:-480,allowResize:p,onChange:I},_p().createElement("div",{className:m.pane},_p().createElement(QE,{error:_p().createElement(KE,{LogoRenderer:$E.ERROR,text:li().text("Something went wrong."),variant:ZE.embedded})},(()=>{const e=l||null;return a?_p().createElement("div",{className:h?m.tableContainer:m.listContainer,ref:f},h?_p().createElement(eN,{entities:r,entityToHighlight:e,selectedEntityUri:s,entityTypeUri:n,onEntityClick:E?A:void 0,onEntityHover:b?R:void 0,entitiesImportStatus:T,onEntityImportStatusChange:x,basicTableRef:P}):_p().createElement(VE,{entities:r,entityToHighlight:e,selectedEntityUri:s,onEntityClick:E?A:void 0,onEntityHover:b?R:void 0,entitiesImportStatus:T,entityButtonsRenderer:N}),a>B.Tu[0]&&_p().createElement("div",{className:m.pagination},_p().createElement(BE.Z,{count:a,rowsPerPageOptions:B.Tu,rowsPerPage:i||B.Tu[0],page:o||0,onChangePage:C,onChangeRowsPerPage:w,basicTableRef:P}))):_p().createElement(KE,{LogoRenderer:$E.SEARCH_RESULTS,text:li().text("No results found."),secondaryText:li().text("Try adjusting your search or filter to find what you're looking for."),variant:ZE.embedded})})())),_p().createElement("div",{className:m.pane},_p().createElement(zV,null))))};HV.propTypes={page:Np().number,quantity:Np().number,rowsPerPage:Np().number,entities:Np().array,loading:Np().bool,dispatch:Np().func,entityToHighlight:Np().string,mode:Np().string,entityTypeTab:Np().string,className:Np().string,isPreviewPanelOpen:Np().bool,previewPanelMode:Np().oneOf(Object.values(B.om)),selectedEntityUri:Np().string},HV.defaultProps={quantity:0,entities:[]};const YV=(0,Pp.connect)((e=>{const t=(0,ki.tB)(e);return{quantity:(0,ai.NU)(e,{entityTypeUri:t}),page:(0,ai.fx)(e,{entityTypeUri:t}),rowsPerPage:(0,ai.Uz)(e,{entityTypeUri:t}),entities:(0,ai.BP)(e,{entityTypeUri:t}),loading:(0,ai.gP)(e),entityToHighlight:(0,ki.Dn)(e),mode:(0,ki.XM)(e),entityTypeTab:t,previewPanelMode:(0,ki.qx)(e),isPreviewPanelOpen:(0,ki.jr)(e),selectedEntityUri:dc(e)}}))(HV);var WV=r(4539),GV=r.n(WV),qV=r(4494);const ZV=(0,qp.Z)({root:{height:"32px",borderRadius:"18px",backgroundColor:"rgba(0,0,0,0.10)",margin:"4px",maxWidth:"380px",flexShrink:"0",border:"none","&:focus":{"background-color":"rgb(206, 206, 206)"},"&:first-child":{marginLeft:0},"& $deleteIcon":{color:"rgba(0,0,0,0.38)",margin:"0 5px 0 0px",height:"18px",width:"18px"}},deleteIcon:{},label:{paddingLeft:"8px",paddingRight:"8px",overflow:"hidden"},labelContainer:{display:"flex",overflow:"hidden"},title:{color:"rgba(0,0,0,0.67)",marginRight:"6px"},values:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}}),$V=e=>{const t=ZV(),r=e.values&&e.values.join(", ");return _p().createElement(Ug(),{label:_p().createElement("div",{className:t.labelContainer},e.title&&_p().createElement("div",{className:t.title},e.title,": "),e.values&&_p().createElement(_d.Y,{value:r},_p().createElement("div",{className:t.values},r))),onDelete:e.onDelete,variant:"outlined",deleteIcon:_p().createElement(Fg(),{"data-reltio-id":"facet-bar-chip-delete"}),classes:{root:t.root,deleteIcon:t.deleteIcon,label:t.label}})};$V.propTypes={classes:Np().object,title:Np().string,values:Np().array,onDelete:Np().func};const KV=$V;class XV extends Rp.PureComponent{constructor(...e){super(...e),this.state={anchorEl:null},this.handleClick=e=>{const{currentTarget:t}=e;this.setState((e=>({anchorEl:e.anchorEl?null:t})))},this.handleClose=e=>{e.stopPropagation(),this.setState({anchorEl:null})}}render(){const{classes:e,items:t}=this.props,{anchorEl:r}=this.state,n=Boolean(r),a=n?"moreButtonPopper":null;return _p().createElement(Rp.Fragment,null,_p().createElement(hE(),{"aria-describedby":a,color:"primary",variant:"contained",classes:{root:e.root,label:e.label},onClick:this.handleClick},li().text(`+ ${t.length}`)),_p().createElement(FN.r,{id:a,open:n,onClose:this.handleClose,anchorEl:r,placement:"bottom-start"},_p().createElement(dN(),{elevation:2,classes:{root:e.popperContent}},this.props.items)))}}XV.propTypes={classes:Np().object,items:Np().array},XV.defaultProps={items:[]};const QV=ny()((()=>({root:{flexShrink:0,minHeight:"32px",opacity:"0.54",padding:"8px",minWidth:"35px",borderRadius:"8px"},label:{fontSize:"13px",lineHeight:"15px"},popperContent:{display:"flex",flexDirection:"column",alignItems:"flex-start",padding:"8px"}})))(XV);var JV=r(74635),eB=r.n(JV),tB=r(60904),rB=r(34319),nB=r(96177),aB=r.n(nB);const iB=(0,qp.Z)({dialogRoot:{minWidth:"600px",minHeight:"280px"},dialogTitle:{paddingTop:"19px"},dialogContentRoot:{paddingTop:"14px",display:"flex",flexDirection:"column"},dialogField:{marginTop:"0px",marginBottom:"24px"},dialogInput:{paddingTop:"21px",paddingBottom:"7px"},dialogFont:{fontSize:"14px"},dialogActions:{padding:"0 8px 8px 0"}});function oB(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){lB(e,t,r[t])}))}return e}function lB(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function sB(){return sB=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},sB.apply(null,arguments)}const cB=({isOpen:e,isAvailableUpdate:t,isChangedSavedSearch:r,currentSavedSearch:n,onClose:a,onSave:i,onUpdate:o})=>{const l=iB(),[s,c]=(0,Rp.useState)(""),[u,p]=(0,Rp.useState)(B.ib.private),d=t&&n&&s===n.name,m=d&&n.isPublic===(u===B.ib.public)&&!r,f=(0,Rp.useCallback)((e=>{c(e.target.value)}),[]),y=(0,Rp.useCallback)((e=>{p(e)}),[]),g=(0,Rp.useCallback)((()=>d?o({share:u}):i({name:s,share:u})),[s,i,o,u,d]),h={InputProps:{classes:{input:kp()(l.dialogInput,l.dialogFont)}},InputLabelProps:{classes:{root:l.dialogFont}}};return(0,Rp.useEffect)((()=>{if(e){const e=t?n.name:"",r=t&&n.isPublic?B.ib.public:B.ib.private;c(e),p(r)}}),[e,t,n]),_p().createElement(aF(),{onClose:a,open:e,PaperProps:{classes:{root:l.dialogRoot}}},_p().createElement(eB(),{classes:{root:l.dialogTitle}},li().text("Save search")),_p().createElement(zF(),{classes:{root:l.dialogContentRoot}},_p().createElement(tB.H,sB({classes:{root:l.dialogField},label:li().text("Name"),required:!0,variant:"filled",value:s,onInput:f,size:"small",autoFocus:!0},h)),_p().createElement(rB.k,{entries:B.m2,TextFieldProps:oB({classes:{root:l.dialogField},required:!0,label:li().text("Share with"),variant:"filled",size:"small"},h),value:u,onChange:y})),_p().createElement(aB(),{classes:{root:l.dialogActions},disableSpacing:!0},_p().createElement(hE(),{onClick:a},li().text("Cancel")),_p().createElement(hE(),{color:"primary",onClick:g,disabled:d?m:0===s.length},d?li().text("Save"):li().text("Save as"))))};cB.propTypes={isOpen:Np().bool,isAvailableUpdate:Np().bool,isChangedSavedSearch:Np().bool,currentSavedSearch:Np().object,onClose:Np().func.isRequired,onSave:Np().func.isRequired,onUpdate:Np().func.isRequired};const uB=(0,Pp.connect)((e=>{const t=(0,_o.LA)(e);return{isOpen:(0,ki.jd)(e),isAvailableUpdate:!(0,O.isNil)(t)&&(0,_o.Jv)(e),isChangedSavedSearch:(0,_o.WH)(e),currentSavedSearch:t}}),{onClose:()=>vi(!1),onSave:e=>({type:$t,payload:e}),onUpdate:e=>({type:Qt,payload:e})})(cB);var pB=r(11400);function dB(){return dB=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dB.apply(null,arguments)}const mB=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return _p().createElement("svg",dB({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},r),_p().createElement("path",{fill:"#000",fillOpacity:".54",fillRule:"evenodd",d:"M7.596 3.561A5.963 5.963 0 019 3.4c1.164 0 2.195.3 3.093.902l.99-.99a7.287 7.287 0 00-1.353-.76A6.816 6.816 0 009 2c-.74 0-1.447.107-2.12.322l.716 1.239zm-2.007-.675A6.948 6.948 0 002.551 6.27 6.816 6.816 0 002 9c0 .968.184 1.878.551 2.73a7.069 7.069 0 001.497 2.223 7.07 7.07 0 002.222 1.496 6.689 6.689 0 001.73.483v-1.828a6.272 6.272 0 00-.19.356 5.213 5.213 0 01-1.479-.534 5.44 5.44 0 01-1.251-.936 4.848 4.848 0 011.059-.367A5.106 5.106 0 017.25 12.5h.306c.1 0 .219.012.359.035L8 12.451v-1.305a6.4 6.4 0 00-2.308.147 7.568 7.568 0 00-1.487.542 4.735 4.735 0 01-.604-1.33A5.547 5.547 0 013.4 9c0-1.563.542-2.888 1.627-3.973a5.66 5.66 0 011.25-.951l-.688-1.19zm9.86 3.384c.238.552.399 1.129.483 1.73H14.52a5.305 5.305 0 00-1.365-2.781l.98-.98A7.1 7.1 0 0115.45 6.27zm-2.056 1.488c.076.076.145.157.204.242h-2.894c.06-.085.128-.166.205-.242a1.69 1.69 0 011.242-.508c.49 0 .904.17 1.242.508zM9.7 7.6c0 .137-.01.27-.03.4H9a1 1 0 00-1 1v.94c-.235.073-.485.11-.75.11a2.36 2.36 0 01-1.732-.718A2.36 2.36 0 014.8 7.6c0-.677.24-1.254.718-1.732A2.36 2.36 0 017.25 5.15c.677 0 1.254.24 1.732.717A2.36 2.36 0 019.7 7.6zm-1.706.744a1.013 1.013 0 01-.744.306c-.292 0-.54-.102-.744-.306A1.013 1.013 0 016.2 7.6c0-.292.102-.54.306-.744.204-.204.452-.306.744-.306s.54.102.744.306c.204.204.306.452.306.744s-.102.54-.306.744zM22 20.667v-8L19.333 10h-8c-.366 0-.68.13-.941.392a1.284 1.284 0 00-.392.941v9.334c0 .366.13.68.392.941.26.261.575.392.941.392h9.334c.366 0 .68-.13.941-.392.261-.26.392-.575.392-.941zm-4.583-1.25A1.929 1.929 0 0116 20a1.929 1.929 0 01-1.417-.583A1.929 1.929 0 0114 18c0-.556.194-1.028.583-1.417A1.929 1.929 0 0116 16c.556 0 1.028.194 1.417.583.389.39.583.861.583 1.417s-.194 1.028-.583 1.417zm.583-4.75h-6V12h6v2.667z",clipRule:"evenodd"}))},fB=(0,qp.Z)({button:{marginRight:"-4px"},dialogRoot:{minWidth:"600px",minHeight:"280px"},dialogContentRoot:{display:"flex",flexDirection:"column",gap:"20px"}}),yB=()=>{const e=fB(),t=(0,Pp.useStore)(),[r,n]=(0,Rp.useState)(!1),[a,i]=(0,Rp.useState)(!1),o=(0,Rp.useCallback)((()=>n(!1)),[]),l=(0,Rp.useCallback)((()=>n(!0)),[]),s=(0,Rp.useCallback)((async(e,r,n)=>{const a=t.getState(),l=(0,No.Z)(a),s=(0,_o.Cc)(a,!0);i(!0);try{await(0,v.createSavedSearch)([{name:e,description:r,isPublic:n,query:s,uiState:l,type:v.SavedSearchType.SEGMENTATION}]),i(!1),o()}catch(e){(0,ii.U)(e,{defaultMessage:li().text("Something went wrong while saving of the segment")}),i(!1)}}),[t,o]);return _p().createElement(_p().Fragment,null,_p().createElement(Bd.k,{icon:mB,size:"L",onClick:l,tooltipTitle:li().text("Save as segment"),className:e.button}),_p().createElement(pB.L,{isOpen:r,isSaving:a,onClose:o,onSave:s}))};function gB(){return gB=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gB.apply(null,arguments)}const hB=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return _p().createElement("svg",gB({xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},r),_p().createElement("g",null,_p().createElement("path",{fill:"none",d:"M0 0h24v24H0z"})),_p().createElement("g",null,_p().createElement("path",{fillOpacity:".54",d:"M5 20h14v-2H5v2zM19 9h-4V3H9v6H5l7 7 7-7z"})))};function EB(){return EB=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},EB.apply(null,arguments)}const bB=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return _p().createElement("svg",EB({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},r),_p().createElement("defs",null,_p().createElement("path",{d:"M17 3H5a2 2 0 00-2 2v14a2 2 0 002 2h14c1.1 0 2-.9 2-2V7l-4-4zm-5 16c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3zm3-10H5V5h10v4z",id:"svg1966704254a"})),_p().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},_p().createElement("mask",{id:"svg1966704254b",fill:"#fff"},_p().createElement("use",{xlinkHref:"#svg1966704254a"})),_p().createElement("g",{mask:"url(#svg1966704254b)",fill:"#000",fillOpacity:".54"},_p().createElement("path",{d:"M0 0h24v24H0z"}))))};function vB(){return vB=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vB.apply(null,arguments)}const TB=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return _p().createElement("svg",vB({xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},r),_p().createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),_p().createElement("path",{fillOpacity:".54",d:"M19.35 10.04A7.49 7.49 0 0012 4C9.11 4 6.6 5.64 5.35 8.04A5.994 5.994 0 000 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5 0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5 5 5h-3z"}))};function OB(){return OB=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},OB.apply(null,arguments)}const SB=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return _p().createElement("svg",OB({width:"12",height:"24",viewBox:"0 0 12 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},r),_p().createElement("defs",null,_p().createElement("path",{d:"M6 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z",id:"svg2486556319a"})),_p().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},_p().createElement("mask",{id:"svg2486556319b",fill:"#fff"},_p().createElement("use",{xlinkHref:"#svg2486556319a"})),_p().createElement("g",{mask:"url(#svg2486556319b)",fill:"#000",fillOpacity:".54"},_p().createElement("path",{d:"M0 0h12v24H0z"}))))};var xB=r(69199),CB=r.n(xB),wB=r(37290),AB=r.n(wB);function RB(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){_B(e,t,r[t])}))}return e}function _B(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const IB=(0,qp.Z)({title:{marginBottom:"-10px"},linkField:{margin:"10px 0"},linkInput:{textOverflow:"ellipsis",fontSize:"14px"}}),NB=({open:e,onClose:t=O.identity})=>{const r=IB(),n=(({enabled:e})=>{const[t,r]=(0,Rp.useState)(""),n=(0,Pp.useSelector)(No.Z),a=(0,Pp.useSelector)(ai.RO),i=(0,Pp.useSelector)(A().selectors.getServicesPath),o=(0,Pp.useSelector)(A().selectors.getUIPath);return(0,Rp.useEffect)((()=>{e?(0,v.rawRequest)(`${i}/searchLink`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(RB({},n,{currentTenant:a}))}).then((0,O.pipe)((0,O.prop)("link"),(0,v.getSearchLink)(o),r)).catch(si):r("")}),[e]),t})({enabled:e});return _p().createElement(aF(),{open:e,onClose:t},_p().createElement(eB(),{className:r.title},li().text("Share link with search results")),_p().createElement(zF(),null,_p().createElement(CB(),null,li().text("With the URL link, anyone can view these search results. Paste this link in email or IM for testing, analyze, sharing and more.")),_p().createElement(AB(),{className:r.linkField,InputProps:{classes:{input:r.linkInput}},label:n?"URL":"",placeholder:li().text("Loading URL..."),value:n,variant:"filled",fullWidth:!0,size:"small"})),_p().createElement(aB(),null,_p().createElement(hE(),{onClick:t},li().text("Cancel")),_p().createElement(hE(),{disabled:!n,onClick:(0,O.pipe)((()=>navigator.clipboard.writeText(n)),t),color:"primary",autoFocus:!0},li().text("Copy link"))))};NB.propTypes={open:Np().bool,onClose:Np().func};const PB=NB,DB=(0,qp.Z)((()=>({button:{marginRight:"-4px"},exportButtonDisabled:{opacity:"0.54"}}))),kB=({customActions:e=[]})=>{const t=DB(),r=(0,Pp.useDispatch)(),n=(0,Pp.useSelector)(A().selectors.getUIConfig),a=(0,Pp.useSelector)(A().selectors.getCanUserMakeExport),i=(0,Pp.useSelector)(A().selectors.getCanUserOpenDataLoader),o=!!(0,v.findPerspectiveConfig)(v.ScreenType.Segmentation,n),l=!!(0,Pp.useSelector)(ai.lF),{canExport:s}=(0,Pp.useSelector)(ki.MO),c=s&&a,u=(0,Rp.useCallback)((()=>{r({type:_.Z.EXPORT_RESULTS})}),[r]),p=(0,Rp.useCallback)((()=>{r({type:_.Z.OPEN_DATA_LOADER})}),[r]),d=(0,Pp.useSelector)(ai.ai),m=(0,Rp.useCallback)((()=>{r(vi(!0))}),[r]),f=[],[y]=(()=>{const e=(0,Pp.useSelector)(A().selectors.getCanUserStartProcessFromQuery),t=(0,Pp.useSelector)(A().selectors.getWorkflowPath),r=(0,Pp.useSelector)(A().selectors.getWorkflowEnvironmentUrl),n=(0,Pp.useSelector)(ki.FH),a=(0,Pp.useSelector)(A().selectors.getTenant),i=(0,Pp.useDispatch)(),o=(0,Pp.useSelector)(ai.FR),{globalFilter:l}=(0,Pp.useSelector)(A().selectors.getGlobalSearchRequestOptions),s=(0,Na._k)(o,[],l),c=(0,Rp.useCallback)((()=>{const{processType:e}=n;(0,v.startProcessFromQuery)({workflowPath:t,processType:e,searchString:s,tenant:a,environment:r}).then((()=>{i(Ii({message:li().text("Match reviews successfully submitted. Go to Inbox to view their status."),actionToDispatch:w.ui.actions.openAppFromChocolateBar("Inbox"),actionLabel:li().text("Go to inbox"),autoHideDuration:null}))})).catch((e=>{si(e)}))}),[n,t,s,a,r,i]),u=s.includes("matches")||s.includes("matchRules");return[e&&t&&n?{disabled:!u,text:li().text("Request Match Review"),tooltip:li().text("Filter on match rules or potential matches to enable Potential Match Review"),onClick:c,id:"-request-match-review"}:null]})();y&&f.push(y);const[g]=(()=>{const e={NO_ENTITY_TYPE:li().text("Please select exactly one entity type or switch to table mode")},t=(0,Pp.useDispatch)(),r=(0,Pp.useSelector)(ki.MO),n=(0,Pp.useSelector)(A().selectors.getCanUserMakeBulkUpdate),a=!!(0,Pp.useSelector)(ai.lF),i=(0,Pp.useSelector)(cu),o=!!i,l=Boolean(null==r?void 0:r.bulkUpdate),s=(0,Pp.useSelector)(A().selectors.getMetadata),c=(0,Pp.useSelector)(ki.Xf),u=l&&n&&!a?{disabled:!o||!(e=>(0,Pa.wW)(s,{},c).some((t=>t.value===e)))(i),text:li().text("Bulk update"),tooltip:o?null:e.NO_ENTITY_TYPE,onClick:()=>t(Pi(!0)),id:"-bulk-update"}:null;return[u]})();g&&f.push(g);const[h,E]=(0,Rp.useState)(!1);return f.push({text:li().text("Share link"),onClick:()=>E(!0),id:"-share-link"}),f.push(...e),_p().createElement(_p().Fragment,null,i&&_p().createElement(Bd.k,{icon:TB,size:"L",onClick:p,tooltipTitle:li().text("Load data"),className:t.button,"data-reltio-id":"reltio-search-actions-menu-load-data"}),c&&_p().createElement(Bd.k,{icon:hB,size:"L",onClick:u,tooltipTitle:li().text("Export"),showForDisabled:!0,classes:{disabled:t.exportButtonDisabled},className:t.button,disabled:l,"data-reltio-id":"reltio-search-actions-menu-export"}),_p().createElement(Bd.k,{tooltipTitle:li().text("Save"),showForDisabled:!0,className:kp()({[t.button]:f.length>0}),disabled:!d,onClick:m,icon:bB,size:"L","data-reltio-id":"reltio-search-actions-menu-save"}),o&&_p().createElement(yB,null),f.length>0&&_p().createElement($N,{buttonComponent:Gp.T,buttonProps:{icon:SB,size:"L","data-reltio-id":"reltio-search-actions-menu"},menuId:"custom-actions",menuItems:f}),_p().createElement(uB,null),_p().createElement(PB,{open:h,onClose:()=>E(!1)}))},LB="#FF1744",UB=(0,qp.Z)({indicatorWrapper:{width:0,height:"20px",position:"relative"},indicatorTooltipArea:{width:"10px",height:"20px"},indicator:{width:"3px",height:"3px",backgroundColor:LB,border:"1px solid",borderColor:LB,borderRadius:"3px",position:"absolute",right:"-7px"},wrapper:{display:"inline-flex",position:"relative",overflow:"hidden"},for:{color:"rgba(0,0,0,0.6)",marginLeft:"8px",marginRight:"8px"},label:{color:"rgba(0,0,0,0.87)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}}),jB=()=>{const e=(0,Pp.useSelector)(_o.LA),t=(0,Pp.useSelector)(_o.WH),r=(0,Rp.useContext)(qV._),n=UB();if(!e)return null;const a=e.name,i=r?li().text("Segment has changed"):li().text("Saved search has changed");return _p().createElement(_p().Fragment,null,_p().createElement("div",{className:n.wrapper},_p().createElement(zf(),{variant:"body2",component:"span",classes:{root:n.for}},li().text("for")),_p().createElement(_d.Y,{value:a},_p().createElement(zf(),{variant:"body2",classes:{root:n.label}},a))),t&&_p().createElement(Rg(),{title:i,placement:"bottom"},_p().createElement("div",{className:n.indicatorWrapper,"data-reltio-id":"changed-indicator"},_p().createElement("div",{className:n.indicator}),_p().createElement("div",{className:n.indicatorTooltipArea}))))},FB=(0,qp.Z)({wrapper:{display:"inline-flex",position:"relative",overflow:"hidden",color:"rgba(0,0,0,0.6)"},in:{marginLeft:"8px",marginRight:"8px"},label:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",fontWeight:500}}),MB=()=>{const e=FB(),t=(0,Pp.useSelector)(A().selectors.getDataTenants),r=t&&t.length>0,n=(0,Pp.useSelector)(ai.t9),a=(0,Pp.useSelector)(A().selectors.getTenantName),i=n?n.label:a;return r&&_p().createElement("div",{className:e.wrapper},_p().createElement(zf(),{variant:"body2",component:"span",classes:{root:e.in}},li().text("in")),_p().createElement(_d.Y,{value:a},_p().createElement(zf(),{variant:"body2",classes:{root:e.label}},i)))};var VB=r(81877),BB=r.n(VB);const zB=(0,qp.Z)({dialogPaper:{height:"70vh"},contentRoot:{padding:0,display:"flex",flexDirection:"column",overflow:"hidden"},tabContent:{display:"flex",flex:"1 1 auto"},tabsWrapper:{padding:"0 24px"}}),HB=(0,qp.Z)((e=>({container:{display:"flex",alignItems:"center",paddingTop:17,paddingBottom:11,paddingLeft:15,paddingRight:15},selected:{backgroundColor:(0,$m.alpha)(e.palette.primary.main,.12)}}))),YB=(0,qp.Z)({main:{display:"flex",alignItems:"center",justifyContent:"space-between",flex:1},title:{display:"flex",alignItems:"center"},filterButton:{marginLeft:"10px",minWidth:0},deleteButton:{marginTop:"-5px"},searchBox:{flex:"1 1 auto",width:"100%",maxWidth:"323px"},flex1:{flex:1}}),WB=(0,qp.Z)({closeButton:{marginRight:"10px"}}),GB=({onClose:e})=>{const t=WB();return _p().createElement(Gp.T,{size:"L",icon:zp(),className:t.closeButton,onClick:e})};GB.propTypes={onClose:Np().func};const qB=GB,ZB=({selectedNumber:e,onDelete:t,onClose:r})=>{const n=YB();return _p().createElement(_p().Fragment,null,_p().createElement("div",{className:kp()(n.title,n.flex1)},_p().createElement(qB,{onClose:r}),_p().createElement(zf(),{color:"primary"},li().text("Selected: ${count}",{count:e}))),_p().createElement(Bd.k,{tooltipTitle:li().text("Delete"),size:"L",icon:SL(),className:n.deleteButton,onClick:t}))};ZB.propTypes={selectedNumber:Np().number,onClose:Np().func,onDelete:Np().func};const $B=ZB,KB=(0,qp.Z)((()=>({white:{backgroundColor:"rgb(255, 255, 255)",boxShadow:"0 1px 3px 0 rgba(0,0,0,0.24)"}})));function XB(){return XB=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},XB.apply(null,arguments)}function QB(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){JB(e,t,r[t])}))}return e}function JB(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ez=e=>{let{classes:t}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["classes"]);const n=KB({});return _p().createElement(Jp,XB({classes:QB({},t,{focused:n.white})},r))};var tz=r(34480),rz=r.n(tz);const nz=(0,qp.Z)((e=>({changedFiltersIndicator:{backgroundColor:(0,$m.alpha)(e.palette.primary.main,.12)},popupContent:{paddingTop:"19px",paddingBottom:"10px",paddingLeft:"23px",paddingRight:"23px",width:"48%",maxWidth:"480px"},title:{marginBottom:"30px"},favoriteOnlyControlRoot:{marginTop:"27px"},favoriteOnlyControlLabel:{fontSize:"0.8rem"},favoriteOnlyCheckbox:{marginRight:"20px"},buttonsGroup:{display:"flex",justifyContent:"space-between",marginTop:"35px",marginLeft:"-11px",marginRight:"-11px"},cancelButton:{marginRight:"10px"},shareWithRoot:{padding:"20px 16px 7px",fontSize:"0.85rem"},shareWithLabel:{top:"-3px",left:"4px"},shareWithMenuItem:{fontSize:"0.85rem"}}))),az=e=>e?B.ib.public:B.ib.private,iz=e=>e===B.ib.public,oz=!0,lz=!1,sz=({className:e,findPublic:t,favoriteOnly:r,onChangeFilters:n})=>{const a=nz(),i=(0,Rp.useRef)(),[o,l]=(0,Rp.useState)(!1),[s,c]=(0,Rp.useState)(t),[u,p]=(0,Rp.useState)(r);(0,Rp.useEffect)((()=>{c(t),p(r)}),[t,r]);const d=(0,Rp.useCallback)((()=>l((e=>!e))),[]),m=(0,Rp.useCallback)((e=>p(e.target.checked)),[]),f=(0,Rp.useCallback)((()=>{n({findPublic:s,favoriteOnly:u}),d()}),[d,n,s,u]),y=(0,Rp.useCallback)((()=>{c(t),p(r),d()}),[d,t,r]),g=(0,Rp.useCallback)((()=>{c(oz),p(lz)}),[]),h=s===oz&&u===lz;return _p().createElement(_p().Fragment,null,_p().createElement(hE(),{ref:i,color:h?"inherit":"primary",classes:{root:e,textPrimary:a.changedFiltersIndicator},onClick:d},_p().createElement(rz(),null)),_p().createElement(Up(),{open:o,classes:{paper:a.popupContent},anchorEl:i.current,onClose:y,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},_p().createElement(zf(),{className:a.title,variant:"h6"},li().text("Filter")),_p().createElement(rB.k,{entries:B.m2,TextFieldProps:{InputLabelProps:{classes:{root:a.shareWithLabel}},label:li().text("Shared with"),variant:"filled"},classes:{root:a.shareWithRoot,menuItem:a.shareWithMenuItem},fullWidth:!0,value:az(s),onChange:(0,O.pipe)(iz,c)}),_p().createElement(Wh(),{classes:{root:a.favoriteOnlyControlRoot,label:a.favoriteOnlyControlLabel},control:_p().createElement(fd(),{className:a.favoriteOnlyCheckbox,checked:u,onChange:m}),label:li().text("Show favorites only")}),_p().createElement("div",{className:a.buttonsGroup},_p().createElement(hE(),{onClick:g,disabled:h},li().text("Clear all")),_p().createElement("div",null,_p().createElement(hE(),{onClick:y,className:a.cancelButton},li().text("Cancel")),_p().createElement(hE(),{onClick:f,color:"primary"},li().text("Apply"))))))};sz.propTypes={className:Np().string,findPublic:Np().bool,favoriteOnly:Np().bool,onChangeFilters:Np().func,onChangeFavoriteOnly:Np().func};const cz=(0,Pp.connect)((e=>({findPublic:(0,_o.kU)(e),favoriteOnly:(0,_o.VS)(e)})),{onChangeFilters:({findPublic:e,favoriteOnly:t})=>({type:ir,payload:{findPublic:e,favoriteOnly:t}})})(sz),uz=({type:e,onSearch:t,placeholder:r,onClose:n})=>{const a=YB();return _p().createElement(_p().Fragment,null,_p().createElement("div",{className:a.main},_p().createElement("div",{className:a.title},_p().createElement(qB,{onClose:n}),_p().createElement(zf(),{variant:"h6"},li().text("Saved & recent searches"))),_p().createElement("div",{className:a.searchBox},_p().createElement(ez,{fullWidth:!0,onSearch:t,placeholder:r}))),e===B.uJ.saved&&_p().createElement(cz,{className:a.filterButton}))};uz.propTypes={type:Np().oneOf(Object.values(B.uJ)),onClose:Np().func,onSearch:Np().func,placeholder:Np().string};const pz=uz,dz=({type:e,selectedNumber:t,onClose:r,dispatch:n})=>{const a=HB(),i=(0,Rp.useCallback)((()=>{const t=e===B.uJ.saved?{type:Er}:{type:kr};n(t)}),[e,n]),o=(0,Rp.useCallback)((0,v.debounce)((t=>{const r=e===B.uJ.saved?{type:Or,payload:t}:(e=>({type:Fr,payload:e}))(t);n(r)}),500),[e,n]),l=(0,O.cond)([[(0,O.equals)(B.uJ.saved),(0,O.always)(li().text("Search name"))],[(0,O.equals)(B.uJ.recent),(0,O.always)(li().text("Search for filtered entity types and attributes"))]])(e);return _p().createElement(eB(),{className:kp()(a.container,{[a.selected]:t})},t?_p().createElement($B,{selectedNumber:t,onDelete:i,onClose:r}):_p().createElement(pz,{type:e,onSearch:o,onClose:r,placeholder:l}))};dz.propTypes={type:Np().oneOf(Object.values(B.uJ)).isRequired,selectedNumber:Np().number,onClose:Np().func,dispatch:Np().func};const mz=(0,Pp.connect)(((e,t)=>({selectedNumber:t.type===B.uJ.saved?(0,_o.g2)(e):Gs(e)})))(dz),fz="0.75rem",yz=(0,qp.Z)({tableWrapper:{display:"flex",flexDirection:"column",width:"100%",position:"relative","& $cellBorder":{borderLeft:"none",borderRight:"none"}},cellBorder:{},paginationRoot:{flexShrink:0,boxShadow:"none",borderTop:"1px solid rgba(0, 0, 0, 0.1)",fontSize:fz},paginationCaption:{fontSize:fz}});var gz=r(54622);const hz=Np().shape({field:Np().string,order:Np().oneOf(["asc","desc"])}),Ez=Np().shape({label:Np().string,name:Np().string,description:Np().string,type:Np().string,hidden:Np().bool,faceted:Np().bool,searchable:Np().bool,uri:Np().string,access:Np().arrayOf(Np().string),cardinality:Np().shape({minValue:Np().number,maxValue:Np().number})}),bz=Np().shape({title:Np().string,pathToTitle:Np().arrayOf(Np().string),fieldName:Np().string,entityTypeUri:Np().string,attrType:Ez,uri:Np().string,groupName:Np().string}),vz=Np().shape({id:Np().oneOfType([Np().number,Np().string]),values:Np().array,data:bz,filter:Np().string,operator:Np().string}),Tz="0.8rem",Oz="22px",Sz=(0,qp.Z)((e=>{const t=(0,$m.lighten)(e.palette.primary.main,.88),r=(0,$m.alpha)(t,0),n=(0,$m.lighten)(e.palette.primary.main,.82),a=(0,$m.alpha)(n,0),i="div.hoveredRow",o={content:'""',position:"absolute",top:0,right:0,width:"40px",height:"100%",background:"linear-gradient(to right, rgba(255, 255, 255, 0.2), #fff 100%)",pointerEvents:"none",[`${i} &`]:{background:"linear-gradient(to right, rgba(238, 238, 238, 0), rgba(238, 238, 238, 1) 100%)"},"$checkedRowCell &":{background:`linear-gradient(to right, ${r}, ${t} 100%)`},[`${i} $checkedRowCell &`]:{background:`linear-gradient(to right, ${a}, ${n} 100%)`}};return{defaultWrapper:{whiteSpace:"nowrap",overflow:"hidden",padding:`0 ${Oz}`,fontSize:Tz,display:"flex",alignItems:"center",height:"100%","&:after":o},numberWrapper:{whiteSpace:"nowrap",overflow:"hidden",padding:`0 24px 0 ${Oz}`,fontSize:Tz,justifyContent:"flex-end",display:"flex",alignItems:"center",height:"100%"},nameWithStar:{display:"flex",alignItems:"center",height:"100%",paddingLeft:"6px","& $editNameButton":{display:"none"},[`${i} & $editNameButton`]:{display:"flex"}},leftButtonWrapper:{},deleteButton:{visibility:"hidden",marginRight:"2px"},totalWithButtonsWrapper:{justifyContent:"flex-end",display:"flex",alignItems:"center",height:"100%","& $numberWrapper":{paddingRight:"8px"},[`${i} & $deleteButton`]:{visibility:"visible"}},nameTextEditorRoot:{margin:0},nameInput:{fontSize:Tz,"&::-ms-clear":{display:"none"}},nameContainer:{flex:1,overflow:"hidden"},editing:{},editNameButton:{},searchName:{cursor:"pointer",lineHeight:"29px",position:"relative",whiteSpace:"nowrap",overflow:"hidden",fontSize:Tz,"&:after":o},clickableArea:{cursor:"pointer"},starButton:{marginLeft:"-7px",marginRight:"3px",visibility:"hidden",[`${i} &$enabledButton`]:{visibility:"visible"}},checkedStarButton:{visibility:"visible",color:"#F5A623 !important"},filterButton:{"$editing &":{marginRight:"2px"},marginLeft:"-7px",marginRight:"10px",visibility:"hidden",[`${i} &$enabledButton`]:{visibility:"visible"},"& svg":{fill:"rgba(0,0,0,0.56)"}},checkedFilterButton:{visibility:"visible","& svg":{fill:e.palette.primary.main}},enabledButton:{},headCell:{display:"flex",alignItems:"center",height:"100%",fontSize:"0.75rem",borderBottom:"1px solid rgba(0,0,0,.1)",color:"rgba(0,0,0,0.6)",fontWeight:500,"&>div":{padding:"0 4px 0 22px"},"& $headLabel":{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}},totalHeadCell:{justifyContent:"flex-end",marginRight:"45px"},nameHeadCell:{paddingLeft:"39px"},headLabel:{},checkbox:{paddingLeft:"11px"},sharingWrapper:{paddingLeft:Oz,display:"flex",alignItems:"center",height:"100%"},sharingRoot:{flexShrink:1,maxWidth:"100%"},sharingInput:{fontSize:Tz},sharingMenuItem:{fontSize:Tz,minWidth:"100px"},sharingDisabled:{color:"rgba(0,0,0,0.89)",paddingRight:"0 !important"},sharingIconDisabled:{display:"none"},rowCell:{height:"100%"},checkedRowCell:{backgroundColor:t,[`${i} &`]:{backgroundColor:n}},invisibleOnHoverCommon:{height:"100%","&$invisibleOnHover":{pointerEvents:"none",[`${i} &`]:{color:"transparent"}}},invisibleOnHover:{},tooltip:e.tooltip,tooltipSection:{marginBottom:"5px"},tooltipSectionHeader:{margin:"5px 0",fontSize:"11px",fontWeight:500},tooltipText:{opacity:.7,fontSize:"10px"}}})),xz=({mode:e})=>{const t=Sz(),r=(0,Pp.useDispatch)(),n=e===B.uJ.saved?_o.tc:qs,a=(0,Pp.useSelector)(n),i=e===B.uJ.saved?_o.hY:Zs,o=(0,Pp.useSelector)(i),l=(0,Rp.useCallback)((()=>{e===B.uJ.saved?r(o?Co():{type:lr}):r(o?ks():{type:Pr})}),[r,o,e]);return _p().createElement("div",{className:kp()(t.headCell,t.checkbox)},_p().createElement(fd(),{indeterminate:!a&&o,checked:a,onChange:l}))};xz.propTypes={mode:Np().string};const Cz=(0,rm.q)((0,O.pick)(["mode"]))(xz),wz=e=>{const t=t=>{const r=Sz(),{rowValue:{checked:n}}=t;return _p().createElement("div",{className:kp()(r.rowCell,{[r.checkedRowCell]:n})},_p().createElement(e,t))};return t.propTypes={rowValue:Np().shape({checked:Np().bool})},t},Az=(0,Id.T)(fd()),Rz=({value:e=!1,rowValue:{uri:t,isOwnSearch:r},onClick:n})=>{const a=Sz(),i=!r;return _p().createElement("div",{className:kp()(a.headCell,a.checkbox)},_p().createElement(Az,{showForDisabled:!0,tooltipTitle:i&&li().text("Cannot edit because you're not the owner"),tooltipPlacement:"bottom-start",disabled:i,checked:e,onChange:e=>n(t,e.target.checked)}))};Rz.propTypes={value:Np().bool,rowValue:Np().shape({uri:Np().string,isOwnSearch:Np().bool}),onClick:Np().func};const _z=(0,rm.q)((({onSelectItem:e})=>({onClick:e})))(wz(Rz));var Iz=r(92332);function Nz(){return Nz=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Nz.apply(null,arguments)}function Pz(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Dz(e,t,r[t])}))}return e}function Dz(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const kz=e=>{let{className:t}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className"]);const n=Sz(),{headCellData:a}=r;return _p().createElement("div",{className:kp()(n.headCell,t)},_p().createElement(Iz.default,Nz({},r,{headCellData:Pz({},a,{label:_p().createElement(_d.Y,{value:a.label},_p().createElement("div",{className:n.headLabel},a.label))})})))};kz.propTypes={className:Np().string,headCellData:Np().shape({id:Np().string,label:Np().oneOfType([Np().string,Np().node]),sortable:Np().bool,resizable:Np().bool,className:Np().string,initialWidth:Np().number,minWidth:Np().number,autoResize:Np().bool,renderer:Np().func})};const Lz=kz;function Uz(){return Uz=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Uz.apply(null,arguments)}const jz=e=>{const t=Sz();return _p().createElement(Lz,Uz({className:t.nameHeadCell},e))};jz.propTypes={headCellData:Np().shape({id:Np().string,label:Np().oneOfType([Np().string,Np().node]),sortable:Np().bool,resizable:Np().bool,className:Np().string,initialWidth:Np().number,minWidth:Np().number,autoResize:Np().bool,renderer:Np().func})};const Fz=jz;var Mz=r(18122),Vz=r.n(Mz),Bz=r(62839),zz=r.n(Bz);function Hz(){return Hz=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Hz.apply(null,arguments)}const Yz=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return _p().createElement("svg",Hz({xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},r),_p().createElement("g",null,_p().createElement("path",{d:"M0 0h24m0 24H0",fill:"none"}),_p().createElement("path",{d:"M4.25 5.61C6.27 8.2 10 13 10 13v6c0 .55.45 1 1 1h2c.55 0 1-.45 1-1v-6s3.72-4.8 5.74-7.39A.998.998 0 0018.95 4H5.04c-.83 0-1.3.95-.79 1.61z"}),_p().createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"})))};function Wz(){return Wz=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Wz.apply(null,arguments)}const Gz=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return _p().createElement("svg",Wz({xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},r),_p().createElement("g",null,_p().createElement("path",{d:"M0 0h24m0 24H0",fill:"none"}),_p().createElement("path",{d:"M7 6h10l-5.01 6.3L7 6zm-2.75-.39C6.27 8.2 10 13 10 13v6c0 .55.45 1 1 1h2c.55 0 1-.45 1-1v-6s3.72-4.8 5.74-7.39A.998.998 0 0018.95 4H5.04c-.83 0-1.3.95-.79 1.61z"}),_p().createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"})))};var qz=r(74492),Zz=r.n(qz),$z=r(72246),Kz=r.n($z);const Xz=({value:e,rowValue:{uri:t,isFavorite:r,isOwnSearch:n,isEditing:a,isGlobalFilter:i},onStarClick:o,onGlobalClick:l,onApply:s,onChangeName:c,onSetEditing:u})=>{const p=Sz(),d=n&&!a,[m,f]=(0,Rp.useState)(e);(0,Rp.useEffect)((()=>{f(e)}),[e]);const y=(0,Rp.useCallback)((()=>{c(t,m)}),[t,m,c]),g=(0,Rp.useCallback)((()=>o(t,!r)),[o,t,r]),h=(0,Rp.useCallback)((()=>l(t,!i)),[l,t,i]),E=(0,Rp.useCallback)((()=>u(t,!0)),[u,t]),b=(0,Rp.useCallback)((()=>s(t)),[s,t]),v=(0,O.cond)([[(0,O.always)(n),(0,O.always)(li().text("Mark as favorite"))],[(0,O.always)(r),(0,O.always)(li().text("Cannot ummark because you're not the owner"))],[O.T,(0,O.always)("")]])();return _p().createElement("div",{className:kp()(p.nameWithStar,{[p.editing]:a})},_p().createElement(Bd.k,{showForDisabled:!0,tooltipTitle:v,tooltipPlacement:n?"bottom":"bottom-start",disabled:!n,className:kp()(p.starButton,{[p.checkedStarButton]:r},{[p.enabledButton]:n}),size:"M",icon:r?Vz():zz(),onClick:g}),_p().createElement(Bd.k,{tooltipTitle:i?li().text("Remove Global filter"):li().text("Set as Global filter"),className:kp()(p.filterButton,p.enabledButton,{[p.checkedFilterButton]:i}),size:"M",icon:i?Yz:Gz,onClick:h}),_p().createElement("div",{className:p.nameContainer},a?_p().createElement(Kz(),{onClickAway:y},_p().createElement("div",null,_p().createElement(tB.H,{variant:"filled",hiddenLabel:!0,size:"small",fullWidth:!0,autoFocus:!0,classes:{root:p.nameTextEditorRoot},InputProps:{classes:{input:p.nameInput}},value:m,onInput:e=>f(e.target.value),onKeyDown:(0,O.when)((0,O.propEq)("keyCode",13),y)}))):_p().createElement(_d.Y,{value:e},_p().createElement("div",{className:p.searchName,onClick:b},e))),d&&_p().createElement(Bd.k,{tooltipTitle:li().text("Edit"),className:p.editNameButton,size:"M",icon:Zz(),onClick:E}))};Xz.propTypes={value:Np().string,rowValue:Np().shape({uri:Np().string,isFavorite:Np().bool,isOwnSearch:Np().bool,isEditing:Np().bool,isGlobalFilter:Np().bool}),onStarClick:Np().func,onGlobalClick:Np().func,onApply:Np().func,onChangeName:Np().func,onSetEditing:Np().func};const Qz=(0,rm.q)((({onChangeIsFavorite:e,onChangeIsGlobal:t,onSearchApply:r,onSetItemEditing:n,onChangeItemName:a})=>({onStarClick:e,onGlobalClick:t,onApply:r,onSetEditing:n,onChangeName:a})))(wz(Xz)),Jz=({value:e,rowValue:{uri:t,isOwnSearch:r},onChange:n})=>{const a=Sz(),i=(0,Rp.useCallback)((r=>{const a=iz(r);a!==e&&n(t,a)}),[t,e,n]);return _p().createElement("div",{className:a.sharingWrapper},_p().createElement(rB.k,{entries:B.m2,value:az(e),onChange:i,disableUnderline:!0,disabled:!r,MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},elevation:3},TextFieldProps:{classes:{root:a.sharingRoot}},classes:{root:a.sharingInput,menuItem:a.sharingMenuItem,disabled:a.sharingDisabled,icon:kp()({[a.sharingIconDisabled]:!r})}}))};Jz.propTypes={value:Np().bool,rowValue:Np().shape({uri:Np().string,isOwnSearch:Np().bool}),onChange:Np().func};const eH=(0,rm.q)((({onChangeIsPublic:e})=>({onChange:e})))(wz(Jz)),tH=({value:e,rowValue:t,onClick:r})=>{const n=Sz(),a=r?()=>r(t):()=>{};return _p().createElement(_d.Y,{value:e},_p().createElement("div",{className:kp()(n.defaultWrapper,{[n.clickableArea]:r}),onClick:a},e))};tH.propTypes={value:Np().any,rowValue:Np().object,onClick:Np().func};const rH=wz(tH);function nH(){return nH=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},nH.apply(null,arguments)}const aH=e=>{const{rowValue:{updateDate:t,createDate:r}}=e,n=t||r;return _p().createElement(rH,nH({},e,{value:n&&li().date(n,"L")}))};aH.propTypes={rowValue:Np().shape({updateDate:Np().number,createDate:Np().number})};const iH=aH,oH=({values:e})=>(0,O.pipe)((0,O.cond)([[O.isNil,O.T],[Array.isArray,(0,O.pipe)(O.flatten,O.isEmpty)],[O.T,O.isEmpty]]),O.not)(e),lH=(0,O.curry)(((e,t)=>(0,O.path)(["facetsData",t.fieldName,"values","length"],e)>0)),sH=e=>e&&e.slice(1).join(" / "),cH=(e,t,r)=>(e[t]||(e[t]={title:t,attributes:[]}),e[t].attributes=(0,O.uniq)(e[t].attributes.concat(r)),e),uH=({rowValue:{uiState:e}})=>{const t=Sz(),r=(0,Rp.useMemo)((()=>(({facets:e,advanced:t}={})=>{try{const r=t?((e=[])=>e.flatMap((e=>e.attributes)).filter(oH).reduce(((e,{data:{title:t,groupName:r,pathToTitle:n}})=>{const a=sH(n)||t;return cH(e,r,a)}),{}))(t):((e={})=>(e.facetsConfigs||[]).filter((0,O.pipe)(v.isTypeFacet,O.not)).filter(lH(e)).reduce(((e,t)=>{const r=(0,O.path)(["pathToTitle",0],t)||li().text("Special"),n=sH(t.pathToTitle)||t.title;return cH(e,r,n)}),{}))(e);return Object.values(r)}catch(e){return[]}})(e)),[e]),n=(0,Rp.useMemo)((()=>(e=>e.flatMap((e=>e.attributes)).length)(r)),[r]),a=!!r.length&&_p().createElement("div",null,r.map((({title:e,attributes:r})=>_p().createElement("div",{key:e,className:t.tooltipSection},_p().createElement("h6",{className:t.tooltipSectionHeader},e),r.map((e=>_p().createElement("div",{key:e,className:t.tooltipText},e)))))));return _p().createElement("div",{className:t.numberWrapper},(i=n,a?_p().createElement(Rg(),{title:a,classes:{tooltip:t.tooltip},disableFocusListener:!0,disableTouchListener:!0},_p().createElement("span",null,i)):i));var i};uH.propTypes={rowValue:Np().shape({uiState:Np().shape({facets:Np().object,advanced:Np().array})})};const pH=wz(uH);function dH(){return dH=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dH.apply(null,arguments)}const mH=e=>{const t=Sz();return _p().createElement(Lz,dH({className:t.totalHeadCell},e))};mH.propTypes={headCellData:Np().shape({id:Np().string,label:Np().oneOfType([Np().string,Np().node]),sortable:Np().bool,resizable:Np().bool,className:Np().string,initialWidth:Np().number,minWidth:Np().number,autoResize:Np().bool,renderer:Np().func})};const fH=mH;var yH=r(67520),gH=r.n(yH);const hH=({value:e})=>{const t=Sz();return _p().createElement(_d.Y,{value:e},_p().createElement("div",{className:t.numberWrapper},li().number(e)))};hH.propTypes={value:Np().number};const EH=wz(hH),bH=e=>{const t=Sz(),{rowValue:{isTotalLoading:r,isOwnSearch:n,uri:a},onDeleteItem:i,onLoadTotalForItem:o,value:l}=e,s=(0,Rp.useCallback)((()=>{i(a)}),[i,a]),c=n?li().text("Delete"):li().text("Cannot delete because you're not the owner"),u=r?li().text("Loading data"):li().text("Load data"),p=(0,Rp.useCallback)((()=>{o(a)}),[o,a]),d=r||-1===l;return _p().createElement("div",{className:t.totalWithButtonsWrapper},d?_p().createElement(Bd.k,{showForDisabled:!0,tooltipTitle:u,tooltipPlacement:"bottom-end",disabled:r,size:"L",icon:gH(),onClick:p}):_p().createElement(EH,e),_p().createElement(Bd.k,{showForDisabled:!0,className:t.deleteButton,tooltipTitle:c,tooltipPlacement:"bottom-end",disabled:!n,size:"L",icon:SL(),onClick:s}))};bH.propTypes={value:Np().number,rowIndex:Np().number,rowValue:Np().shape({isOwnSearch:Np().bool,isTotalLoading:Np().bool,uri:Np().string}),onDeleteItem:Np().func,onLoadTotalForItem:Np().func};const vH=(0,rm.q)((({onDeleteItem:e,onLoadTotalForItem:t})=>({onDeleteItem:e,onLoadTotalForItem:t})))(wz(bH));function TH(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const OH={rowCellValueRenderer:rH,headCellRenderer:Lz,autoResize:!1},SH=[{id:"checked",label:"",initialWidth:55,headCellRenderer:Cz,rowCellValueRenderer:_z},{id:"name",get label(){return li().text("Name")},autoResize:!0,headCellRenderer:Fz,rowCellValueRenderer:Qz,sortable:!0},{id:"isPublic",get label(){return li().text("Shared with")},rowCellValueRenderer:eH},{id:"owner",get label(){return li().text("Created by")},initialWidth:260},{id:"updateDate",get label(){return li().text("Last modified")},rowCellValueRenderer:iH,sortable:!0},{id:"attributes",get label(){return li().text("Filtered attributes")},rowCellValueRenderer:pH},{id:"total",get label(){return li().text("Number of profiles")},headCellRenderer:fH,rowCellValueRenderer:vH,initialWidth:194}].map((e=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){TH(e,t,r[t])}))}return e}({},OH,e)));function xH(){return xH=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xH.apply(null,arguments)}function CH(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const wH=({items:e,total:t,sorting:r,page:n,rowsPerPage:a,loading:i,searchValue:o,globalFilterSavedSearchesUris:l=[],onSearchApply:s,onChangeIsFavorite:c,onChangeIsPublic:u,onChangeIsGlobal:p,onChangeRowsPerPage:d,onChangePage:m,onSelectItem:f,onDeselectAllItems:y,onDeleteItem:g,onChangeItemName:h,onSetItemEditing:E,onLoadTotalForItem:b,onSort:T})=>{const O=yz(),S=(0,Rp.useMemo)((()=>({cellBorder:O.cellBorder})),[O]),[x,C]=(0,Rp.useState)(null),[w,A]=(0,Rp.useState)(null),R=(0,Rp.useRef)(null);(0,Rp.useEffect)((()=>y),[y]);const _=(0,Rp.useCallback)((e=>{l.includes(e)?A(e):g(e)}),[l,g]),I=(0,Rp.useMemo)((()=>({mode:B.uJ.saved,onSelectItem:f,onChangeIsFavorite:c,onChangeIsGlobal:p,onSearchApply:s,onSetItemEditing:E,onChangeItemName:h,onDeleteItem:_,onLoadTotalForItem:b,onChangeIsPublic:u})),[_,f,c,p,b,s,E,h,u]),N=(0,Rp.useMemo)((()=>(0,v.isEmptyValue)(o)?{LogoRenderer:$E.SELECT_ATTRIBUTES,text:li().text("No saved searches."),secondaryText:li().text("Save time by creating saved searches for queries you regularly search for.")}:{LogoRenderer:$E.SEARCH_RESULTS,text:li().text("No results found."),secondaryText:li().text("Try adjusting your search or filter to find what you're looking for.")}),[o]),P=(0,Rp.useMemo)((()=>e.map((e=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){CH(e,t,r[t])}))}return e}({},e,{isGlobalFilter:l.includes(e.uri)})))),[e,l]);return _p().createElement("div",{className:O.tableWrapper},t>0?_p().createElement(_p().Fragment,null,_p().createElement(Xd.M,{columnsData:SH,rowsData:P,context:I,sorting:r,getRowCellHeight:null,defaultColumnWidth:140,defaultColumnMinWidth:140,defaultRowHeight:48,headRowHeight:47,hoverStateEnabled:!0,onSort:T,hoverRowIndex:x,onRowHover:C,classes:S,ref:R}),_p().createElement(BE.Z,{classes:{root:O.paginationRoot,caption:O.paginationCaption},count:t,rowsPerPageOptions:B.Tu,rowsPerPage:a,onChangeRowsPerPage:d,page:n,onChangePage:m,basicTableRef:R}),_p().createElement(gz.U,{open:!!w,title:li().text("Keep the global filter?"),content:li().text("The saved search you are deleting is being used as a global filter in your tenant. Do you want to keep the global filter?"),discardCaption:li().text("NO, remove it"),saveCaption:li().text("YES, KEEP GLOBAL FILTER"),onCancel:()=>A(null),onDiscard:()=>{p(w,!1),g(w),A(null)},onSave:()=>{g(w),A(null)}})):_p().createElement(KE,xH({},N,{variant:ZE.embedded})),i&&_p().createElement(XE.z,null))};wH.propTypes={items:Np().arrayOf(Np().shape({uri:Np().string,name:Np().string,isPublic:Np().bool,isFavorite:Np().bool,isOwnSearch:Np().bool,isEditing:Np().bool,checked:Np().bool,owner:Np().string,updateDate:Np().number,query:Np().string})),total:Np().number,sorting:hz,page:Np().number,rowsPerPage:Np().number,loading:Np().bool,searchValue:Np().string,globalFilterSavedSearchesUris:Np().arrayOf(Np().string),onSearchApply:Np().func,onChangeIsFavorite:Np().func,onChangeIsPublic:Np().func,onChangeIsGlobal:Np().func,onChangeRowsPerPage:Np().func,onChangePage:Np().func,onSelectItem:Np().func,onDeselectAllItems:Np().func,onDeleteItem:Np().func,onChangeItemName:Np().func,onSetItemEditing:Np().func,onSort:Np().func};const AH=(0,Pp.connect)((e=>({items:(0,_o.gg)(e),total:(0,_o.Yi)(e),sorting:(0,_o.rT)(e),page:(0,_o.wH)(e),rowsPerPage:(0,_o.s6)(e),loading:(0,_o.w7)(e),searchValue:(0,_o.U3)(e),globalFilterSavedSearchesUris:A().selectors.getGlobalFilterSavedSearchesUris(e)})),{onSearchApply:(e,t=B.XU)=>({type:Sr,payload:{uri:e,debounceTime:t}}),onChangeIsFavorite:(e,t)=>({type:pr,payload:{uri:e,isFavorite:t}}),onChangeIsPublic:(e,t)=>({type:cr,payload:{uri:e,isPublic:t}}),onChangeIsGlobal:(e,t)=>({type:mr,payload:{uri:e,isGlobalFilter:t}}),onChangeRowsPerPage:e=>({type:ar,payload:e}),onChangePage:e=>({type:nr,payload:e}),onSelectItem:(e,t)=>({type:or,payload:{uri:e,checked:t}}),onDeselectAllItems:Co,onDeleteItem:e=>({type:br,payload:e}),onChangeItemName:(e,t)=>({type:yr,payload:{uri:e,name:t}}),onSetItemEditing:(e,t)=>({type:hr,payload:{uri:e,isEditing:t}}),onLoadTotalForItem:e=>({type:Cr,payload:e}),onSort:e=>({type:wr,payload:e})})(wH),RH=({value:e=!1,rowValue:{createdDate:t},onClick:r})=>{const n=Sz();return _p().createElement("div",{className:kp()(n.headCell,n.checkbox)},_p().createElement(fd(),{checked:e,onChange:e=>r(t,e.target.checked)}))};RH.propTypes={value:Np().bool,rowValue:Np().shape({createdDate:Np().number}),onClick:Np().func};const _H=(0,rm.q)((({onSelectItem:e})=>({onClick:e})))(wz(RH));function IH(){return IH=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},IH.apply(null,arguments)}const NH=e=>{const{rowValue:{createdDate:t}}=e,r=t;return _p().createElement(rH,IH({},e,{value:r&&li().date(r,"L LT")}))};NH.propTypes={rowValue:Np().shape({createdDate:Np().number}),onClick:Np().func};const PH=(0,rm.q)((({onSearchApply:e})=>({onClick:e})))(NH),DH=e=>{const t=Sz(),{rowValue:r,onDeleteItem:n,onLoadTotalForItem:a,value:i}=e,{isTotalLoading:o,createdDate:l}=r,s=(0,Rp.useCallback)((()=>{n(r)}),[n,r]),c=o?li().text("Loading data"):li().text("Load data"),u=(0,Rp.useCallback)((()=>{a(l)}),[a,l]),p=o||-1===i;return _p().createElement("div",{className:t.totalWithButtonsWrapper},p?_p().createElement(Bd.k,{showForDisabled:!0,tooltipTitle:c,tooltipPlacement:"bottom-end",disabled:o,size:"L",icon:gH(),onClick:u}):_p().createElement(EH,e),_p().createElement(Bd.k,{className:t.deleteButton,tooltipTitle:li().text("Delete"),tooltipPlacement:"bottom-end",size:"L",icon:SL(),onClick:s}))};DH.propTypes={value:Np().number,rowValue:Np().shape({isTotalLoading:Np().bool,createdDate:Np().number}),onDeleteItem:Np().func,onLoadTotalForItem:Np().func};const kH=(0,rm.q)((({onDeleteItem:e,onLoadTotalForItem:t})=>({onDeleteItem:e,onLoadTotalForItem:t})))(wz(DH)),LH=(0,rm.q)((({onSearchApply:e})=>({onClick:e})))(rH);function UH(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const jH={rowCellValueRenderer:rH,headCellRenderer:Lz,autoResize:!1},FH=[{id:"checked",label:"",initialWidth:55,headCellRenderer:Cz,rowCellValueRenderer:_H},{id:"createdDate",get label(){return li().text("Created")},rowCellValueRenderer:PH,initialWidth:256},{id:"name",get label(){return li().text("Query")},autoResize:!0,rowCellValueRenderer:LH,minWidth:150},{id:"total",get label(){return li().text("Record count")},rowCellValueRenderer:kH,headCellRenderer:fH,initialWidth:150}].map((e=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){UH(e,t,r[t])}))}return e}({},jH,e)));function MH(){return MH=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},MH.apply(null,arguments)}const VH=({items:e,loading:t,filterWord:r,onSelectItem:n,onDeselectAllItems:a,onSearchApply:i,onDeleteItem:o,onLoadTotalForItem:l})=>{const s=yz(),c=(0,Rp.useMemo)((()=>({cellBorder:s.cellBorder})),[s]),[u,p]=(0,Rp.useState)(null);(0,Rp.useEffect)((()=>a),[a]);const d=(0,Rp.useMemo)((()=>({mode:B.uJ.recent,onSelectItem:n,onSearchApply:i,onDeleteItem:o,onLoadTotalForItem:l})),[o,l,n,i]),m=(0,Rp.useMemo)((()=>(0,v.isEmptyValue)(r)?{LogoRenderer:$E.SELECT_ATTRIBUTES,text:li().text("No recent searches."),secondaryText:li().text("Your recent search history will appear here.")}:{LogoRenderer:$E.SEARCH_RESULTS,text:li().text("No results found."),secondaryText:li().text("Try adjusting your search or filter to find what you're looking for.")}),[r]);return _p().createElement("div",{className:s.tableWrapper},e.length>0?_p().createElement(Xd.M,{columnsData:FH,rowsData:e,context:d,getRowCellHeight:null,defaultColumnWidth:50,defaultColumnMinWidth:50,defaultRowHeight:48,headRowHeight:47,hoverStateEnabled:!0,hoverRowIndex:u,onRowHover:p,classes:c}):_p().createElement(KE,MH({},m,{variant:ZE.embedded})),t&&_p().createElement(XE.z,null))};VH.propTypes={items:Np().arrayOf(Np().shape({uri:Np().string,name:Np().string,isPublic:Np().bool,isFavorite:Np().bool,isOwnSearch:Np().bool,checked:Np().bool,owner:Np().string,createdDate:Np().number,query:Np().string})),loading:Np().bool,filterWord:Np().string,onSelectItem:Np().func,onSearchApply:Np().func,onDeselectAllItems:Np().func,onDeleteItem:Np().func};const BH=(0,Pp.connect)((e=>({items:Ys(e),loading:Ws(e),filterWord:zs(e)})),{onSearchApply:(e,t=B.XU)=>({type:zr,payload:{search:e,debounceTime:t}}),onSelectItem:(e,t)=>({type:Nr,payload:{searchCreatedDate:e,checked:t}}),onDeselectAllItems:ks,onDeleteItem:e=>({type:Ur,payload:e}),onLoadTotalForItem:e=>({type:Br,payload:e})})(VH),zH=({open:e,onClose:t})=>{const r=zB(),n=(0,Pp.useDispatch)(),a=(0,Rp.useMemo)((()=>[{value:B.uJ.saved,label:li().text("Saved searches"),content:_p().createElement(AH,null),dataReltioId:"reltio-search-saved-searches"},{value:B.uJ.recent,label:li().text("Recent searches"),content:_p().createElement(BH,null),dataReltioId:"reltio-search-recent-searches"}]),[]),[i,o]=(0,Rp.useState)(a[0].value);return(0,Rp.useEffect)((()=>{e&&(i===B.uJ.saved?n({type:Jt}):n({type:Rr}))}),[e,n,i]),_p().createElement(aF(),{classes:{paper:r.dialogPaper},fullWidth:!0,maxWidth:"lg",open:e,onClose:t},_p().createElement(mz,{type:i,onClose:t}),_p().createElement(zF(),{classes:{root:r.contentRoot}},_p().createElement("div",{className:r.tabsWrapper},_p().createElement(qI,{value:i,tabs:a,onChange:o,scrollButtons:"auto"})),_p().createElement("div",{className:r.tabContent},a.find((0,O.propEq)("value",i)).content)))};zH.propTypes={open:Np().bool,onClose:Np().func};const HH=zH,YH=(0,qp.Z)((()=>({button:{display:"flex",alignItems:"center",whiteSpace:"nowrap",borderColor:"rgba(0, 0, 0, 0.12)"},buttonText:{letterSpacing:0},compact:{paddingTop:"2px",paddingBottom:"2px",marginRight:"-8px",marginLeft:"4px"}}))),WH=({showTypography:e})=>{const t=YH(),r=(0,Pp.useDispatch)(),n=(0,Pp.useSelector)(ki.tm),a=li().text("Saved & recent searches"),i=(0,Rp.useCallback)((()=>r(bi(!0))),[r]),o=(0,Rp.useCallback)((()=>r(bi(!1))),[r]);return _p().createElement(_p().Fragment,null,_p().createElement(Rg(),{title:e?"":a},_p().createElement(hE(),{className:t.button,variant:"outlined",startIcon:_p().createElement(BB(),{className:kp()({[t.compact]:!e}),color:"action"}),onClick:i,"data-reltio-id":"reltio-search-saved-and-recent-search"},e&&_p().createElement(zf(),{variant:"button",color:"textPrimary",className:t.buttonText},a))),_p().createElement(HH,{open:n,onClose:o}))},GH=(0,qp.Z)((()=>({container:{display:"flex",flexDirection:"column",position:"relative",paddingLeft:"16px",paddingRight:"20px"},header:{height:"63px",display:"flex",alignItems:"center"},captionWrapper:{marginTop:"-2px",paddingLeft:"8px",flexShrink:0},profileText:{paddingLeft:"8px",color:"rgba(0,0,0,0.6)"},profileNumber:{fontWeight:600},facetsBar:{display:"flex",alignItems:"center",flexGrow:1,marginBottom:"12px",marginTop:"-8px"},showBar:{display:"flex",overflow:"hidden"},clearButton:{marginRight:"auto",marginLeft:"14px"},splitter:{marginRight:"15px",marginLeft:"1px",height:"32px"},searchBarControls:{display:"flex",alignItems:"center",width:"100%",justifyContent:"flex-end"}}))),qH="search",ZH="geoLocation",$H={},KH=()=>{const e=GH(),t=(0,Pp.useDispatch)(),r=(0,Pp.useSelector)(C.Mp),n=(0,Pp.useSelector)(C.X0),a=(0,Pp.useSelector)(ai.Qw)||$H,i=(0,Pp.useSelector)(A().selectors.getSearchKeyword),o=(0,Pp.useSelector)(A().selectors.getDateMask),l=(0,Pp.useSelector)(A().selectors.getDateTimeMask),s=(0,Pp.useSelector)(A().selectors.getAttributesPresentation)||$H,c=(0,Pp.useSelector)(ki.IJ),u=(0,Pp.useSelector)((e=>(0,ai.NU)(e,{entityTypeUri:void 0}))),p=(0,Pp.useSelector)(io.go),d=(0,Rp.useContext)(qV._),[m,f]=(0,Rp.useState)([]),[y,g]=(0,Rp.useState)(0),[h,E]=(0,Rp.useState)(!1),b=(0,Rp.useRef)(null),[T,S]=(0,Rp.useState)(!0);(0,Rp.useEffect)((()=>{f(x())}),[r,n,a,i]),(0,Rp.useEffect)((()=>{g(m.length),E(!0)}),[m]),(0,Rp.useEffect)((()=>{if(h){const e=I();g(e),E(!1)}}),[h,n]);const x=(0,Rp.useCallback)((()=>{const e=Object.values((0,Pa.t8)(n,r)).filter((e=>e.values&&e.values.length)).map((e=>{const t=e.title||e.hiddenTitle,r=(0,Pa.MI)([...e.data||[],...e.filteredData||[]],(0,O.path)(["attrType","type"],e)===v.DataTypes.TYPE_DATE?e.values.map((e=>e.map((e=>v.utils.dates.toLocalDate(e).getTime())))):e.values.map((0,v.mapFilterValue)((0,v.applyPresentationStrategyToValue)((e=>(0,v.getNumberFormat)((0,v.getAttrDataTypeDefinition)(e.attrType),s,v.intl.getLocale()).strategy)(e)))),e.type,{dateMask:o,dateTimeMask:l});return{fieldName:e.fieldName,title:t,values:r}}));i&&e.push({fieldName:qH,title:li().text("Search"),values:[i.value]});const{values:[t]=[],type:c}=(0,O.pathOr)({},["mapSearch"],a);return t&&e.push({fieldName:ZH,values:(0,v.getMapSearchValues)(c,t),title:(0,v.getMapSearchLabel)(c)}),e}),[r,n,a,i,s,o,l]),R=(0,Rp.useCallback)((()=>{g(m.length),E(!0)}),[m]),_=(0,Rp.useCallback)((e=>{S(e>=450)}),[]),I=(0,Rp.useCallback)((()=>{if(!b.current)return 0;const{firstChild:e,offsetLeft:t,offsetWidth:r}=b.current,n=t+r;return([...e.childNodes]||[]).filter((a=n,e=>e.offsetLeft+e.offsetWidth<=a)).length;var a}),[b]),N=(0,Rp.useCallback)((e=>r=>{switch(r.stopPropagation(),e){case qH:t(w.search.actions.keywordUpdated(null));break;case ZH:t($a(null));break;default:t(Qa(e,[]))}}),[t]),P=(0,Rp.useCallback)((()=>{t(Ya({silent:!0})),t(w.search.actions.keywordUpdated({debounceTime:B.XU}))}),[t]),D=(0,Rp.useMemo)((()=>m.map((e=>_p().createElement(KV,{key:e.fieldName,title:e.title,values:e.values,onDelete:N(e.fieldName)})))),[m,N]),k=D.slice(0,y),L=D.slice(y),U=(0,O.when)((0,O.propEq)("length",1),(0,O.reject)(v.isEmptySearchGroup))(p),j=0===D.length&&0===U.length,F=!c&&D.length>0;return _p().createElement("div",{className:e.container,"data-reltio-id":"search-bar"},_p().createElement("div",{className:e.header},_p().createElement("div",{className:e.captionWrapper,"data-reltio-id":"search-bar-total-profiles"},_p().createElement(zf(),{component:"span",classes:{body1:e.profileNumber}},li().number(u,"0,0")),_p().createElement(zf(),{variant:"body2",component:"span",classes:{root:e.profileText}},li().text("total profiles"))),_p().createElement(MB,null),_p().createElement(jB,null),_p().createElement(hE(),{color:"primary",className:e.clearButton,onClick:P,disabled:j,"data-reltio-id":"reltio-search-clear"},li().text("clear")),!d&&_p().createElement("div",{className:e.searchBarControls,"data-reltio-id":"search-bar-controls"},_p().createElement(ld.ZP,{handleWidth:!0,handleHeight:!1,onResize:_}),_p().createElement(kB,null),_p().createElement(Kf(),{orientation:"vertical",className:e.splitter}),_p().createElement(WH,{showTypography:T}))),_p().createElement(ld.ZP,{handleWidth:!0,handleHeight:!1,onResize:R}),_p().createElement(GV(),{in:F,timeout:500},_p().createElement("div",{ref:b,className:e.facetsBar,"data-reltio-id":"search-facets-bar"},_p().createElement("div",{className:e.showBar},k),L.length>0&&_p().createElement(QV,{items:L}))))},XH=(0,qp.Z)({title:{flexGrow:1},collapseIcon:{transform:"rotate(0deg)",transition:"transform 0.35s ease"},"collapseIcon--inverted":{transform:"rotate(-180deg)"},backButtonContainer:{margin:"12px"},collapseButton:{padding:"8px",marginRight:"12px"},toolBar:{minHeight:0,flexShrink:1,overflow:"hidden"}}),QH=({onBackBtnClick:e})=>{const t=XH();return _p().createElement(GF(),{disableGutters:!0,classes:{root:t.toolBar}},_p().createElement(Bd.k,{tooltipTitle:li().text("Switch to basic mode"),size:"L",icon:rN(),className:t.backButtonContainer,onClick:e}),_p().createElement(zf(),{variant:"subtitle1",className:t.title},li().text("Advanced search")))};QH.propTypes={onBackBtnClick:Np().func};const JH=QH;var eY=r(28552),tY=r(82466),rY=r.n(tY);const nY=(0,qp.Z)({collapseIcon:{transform:"rotate(0deg)",transition:"transform 0.35s ease"},"collapseIcon--inverted":{transform:"rotate(-180deg)"}});function aY(){return aY=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},aY.apply(null,arguments)}const iY=e=>{let{collapseBtnActive:t,onCollapseBtnClick:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["collapseBtnActive","onCollapseBtnClick"]);const a=nY();return _p().createElement(Bd.k,aY({size:"L",icon:rY(),tooltipTitle:t?li().text("Collapse panel"):li().text("Expand panel"),onClick:r,iconClassName:kp()(a.collapseIcon,{[a["collapseIcon--inverted"]]:!t}),"data-reltio-id":"reltio-search-advanced-search-collapse-panel"},n))};iY.propTypes={backBtnDisabled:Np().bool,onBackBtnClick:Np().func,collapseBtnActive:Np().bool,onCollapseBtnClick:Np().func};const oY=iY;var lY=r(89808),sY=r.n(lY),cY=r(19820),uY=r.n(cY);function pY(){return pY=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},pY.apply(null,arguments)}const dY=e=>{let{isFullscreen:t=!1,onClick:r=O.identity}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["isFullscreen","onClick"]);return _p().createElement(Bd.k,pY({size:"L",icon:t?uY():sY(),tooltipTitle:t?li().text("Exit full screen"):li().text("Full screen"),onClick:r,"data-reltio-id":"reltio-search-advanced-search-full-screen"},n))};dY.propTypes={isFullscreen:Np().bool,onClick:Np().func};const mY=dY,fY="24px",yY=(0,qp.Z)({resultQueryPanel:{background:"#E3E7E9",display:"flex",flex:"0 0 auto",alignItems:"center"},queryBuilder:{flexGrow:1,padding:`10px 10px 10px ${fY}`},queryWrapper:{paddingRight:fY},queryWrapperMinHeight:{maxHeight:"18px"},actionsPanel:{display:"flex",paddingRight:"12px"},collapseButton:{marginRight:"-4px"}}),gY=({groups:e,hasMinSize:t,lookups:r,metadata:n,attributesPresentation:a,collapseBtnActive:i,isFullscreen:o,onCollapseBtnClick:l,onFullScreenBtnClick:s,keyword:c,map:u,dispatch:p})=>{const d=yY(),m=(0,Rp.useMemo)((()=>(0,Na.Jk)((0,lt.P0)(n,e))),[n,e]),f=(0,Rp.useMemo)((()=>(0,v.buildReadableQuery)(n,a,r,e,c,u)),[n,a,r,e,c,u]),y=(0,Rp.useCallback)((0,v.debounce)((()=>{p({type:it})}),500),[p]);return(0,FE.D)(y,[y,m]),_p().createElement("div",{className:d.resultQueryPanel},_p().createElement(eY.B,{classes:{root:d.queryBuilder,queryWrapper:kp()(d.queryWrapper,{[d.queryWrapperMinHeight]:t})},readableQuery:f}),_p().createElement("div",{className:d.actionsPanel},_p().createElement(oY,{collapseBtnActive:i,onCollapseBtnClick:l,className:d.collapseButton}),_p().createElement(mY,{isFullscreen:o,onClick:s})))};var hY=r(28345),EY=r.n(hY),bY=r(68157);const vY=(0,qp.Z)((e=>({readOnlyLogicOperatorContainer:{display:"flex",alignItems:"center",marginRight:"40px",width:"76px",fontSize:"14px",color:e.palette.text.secondary,maxHeight:"46px"}}))),TY=({className:e,rowData:t})=>{const r=vY();return _p().createElement("div",{className:kp()(r.readOnlyLogicOperatorContainer,e)},t&&t.operator?(0,bY.capitalize)(t.operator):li().text("Where"))},OY=(0,qp.Z)((e=>({readOnlyFilter:{display:"flex",alignItems:"center",fontSize:"14px",color:e.palette.text.secondary,width:"50px",marginLeft:"12px",maxHeight:"46px"}}))),SY=({className:e,rowData:t})=>{const r=OY();return _p().createElement("div",{className:kp()(r.readOnlyFilter,e)},t&&t.filter?(0,v.getFilterOptionLabel)(t.filter):li().text("equals"))},xY=(0,qp.Z)((()=>({row:{display:"flex",marginBottom:"12px"},rowItem:{paddingRight:"10px",display:"flex"},fullWidth:{flexGrow:"1",flexBasis:"0",overflow:"hidden"},hidden:{visibility:"hidden"}}))),CY=e=>{let{classes:t={},rowData:r,previousRowData:n,LogicOperatorComponent:a=TY,AttributeSelectorComponent:i,FilterSelectorComponent:o=SY,ValuesEditorComponent:l,ActionsComponent:s,filterSelectorRef:c,attributeSelectorProps:u={}}=e,p=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["classes","rowData","previousRowData","LogicOperatorComponent","AttributeSelectorComponent","FilterSelectorComponent","ValuesEditorComponent","ActionsComponent","filterSelectorRef","attributeSelectorProps"]);const d=xY();return _p().createElement("div",{className:kp()(d.row,t.root),"data-reltio-id":"query-builder-row"},_p().createElement(a,{className:t.logicOperatorContainer,rowContext:p,rowData:n}),_p().createElement("div",{className:kp()(d.rowItem,t.attributeSelectorContainer),"data-reltio-id":"query-builder-row-attribute-selector"},_p().createElement(i,{attributeSelectorProps:u,rowContext:p,rowData:r})),_p().createElement("div",{className:kp()(d.rowItem,t.filterSelectorContainer),"data-reltio-id":"query-builder-row-filter-selector"},_p().createElement(o,{textFieldInputRef:c,rowContext:p,rowData:r})),_p().createElement("div",{className:kp()(d.rowItem,d.fullWidth,t.valuesEditorContainer),"data-reltio-id":"query-builder-row-values-editor"},_p().createElement(l,{rowContext:p,rowData:r})),_p().createElement("div",{className:kp()(d.rowItem,t.actionsContainer,{[d.hidden]:!r}),"data-reltio-id":"query-builder-row-actions"},_p().createElement(s,{rowContext:p,rowData:r})))},wY=(0,Rp.memo)(CY);function AY(){return AY=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},AY.apply(null,arguments)}const RY=(0,_p().memo)((e=>{let{className:t,rowClasses:r,rowsData:n,lastRowAttributeSelectorProps:a,filterSelectorRef:i,filterSelectorRefIndex:o}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","rowClasses","rowsData","lastRowAttributeSelectorProps","filterSelectorRef","filterSelectorRefIndex"]);const s=(e,t,n)=>{const s=t>0?(0,O.path)([t-1],n):null,c=t===n.length?{attributeSelectorProps:a}:{};return _p().createElement(wY,AY({key:e&&e.id,rowData:e,previousRowData:s,classes:r,filterSelectorRef:t===o?i:void 0},l,c))};return _p().createElement("div",{"data-reltio-id":"reltio-query-builder-rows-group",className:t},n.map(s),s(null,n.length,n))})),_Y=(0,qp.Z)((()=>({select:{padding:"6px 16px 7px"},dropDown:{width:"100px","&:before":{content:"none !important"}}}))),IY=({className:e,value:t,onChange:r})=>{const n=_Y();return _p().createElement(rB.k,{className:kp()(n.dropDown,e),classes:n,value:t,entries:v.operatorOptions,onChange:r})},NY={position:"absolute",width:1,background:"rgba(43, 152, 240, 0.3)",height:16,left:36};function PY(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){DY(e,t,r[t])}))}return e}function DY(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const kY=(0,qp.Z)((e=>({title:{},rows:{},actions:{},container:{backgroundColor:e.palette.background.paper,padding:"18px 16px 0",position:"relative",margin:"16px 0 19px","& $title":{color:e.palette.text.hint,fontSize:12,marginBottom:20},"& $rows":{display:"flex",flexDirection:"column"},"& $actions":{position:"absolute",top:16,right:16,paddingTop:0},"&:after, &:before":{content:"",width:1,height:16,position:"absolute",top:"100%",left:35,background:"rgba(43, 152, 240, .3)"},"&:before":{top:"initial",bottom:"100%"},"&:first-child":{marginTop:0,"&:before":{content:"none"}}},entityTypeSelector:{width:"394px",height:"46px"},entityTypeSelectorContainer:{marginBottom:"20px"},logicOperator:{position:"relative",paddingLeft:16,"&:before":{}},verticalOperatorLine:PY({},NY),upperLine:{marginTop:-18},lowerLine:{marginBottom:-16,bottom:0}}))),LY="46px",UY=(0,qp.Z)((e=>({row:{marginBottom:"20px","&:hover $actions":{opacity:1}},logicOperatorContainer:{marginTop:"7px",marginRight:"40px",width:"100px"},logicOperator:{fontSize:"14px",color:e.palette.text.secondary},logicOperatorPlaceholder:{paddingLeft:"16px",paddingTop:"10px"},attributeSelect:{width:"254px",height:LY},filterSelect:{width:"190px"},valuesWrapper:{width:"100%",display:"flex",minHeight:LY,alignItems:"flex-start",boxSizing:"border-box"},actions:{opacity:"0",transition:"opacity 0.3s",paddingTop:"13px",width:"88px",height:"24px",display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:"0",marginLeft:"8px","& >span":{cursor:"pointer",display:"flex"},"& $actionIcon":{cursor:"pointer",color:"rgba(0, 0, 0, .54)"}},actionIcon:{}})));var jY=r(58282),FY=r.n(jY);const MY=e=>e.join(", "),VY=e=>`calc(${(0,O.isNil)(e)?"100%":`${e}px`} - 35px)`,BY=(0,qp.Z)({listLabelContainer:{display:"flex",alignItems:"center",position:"relative",overflow:"hidden",whiteSpace:"nowrap",justifyContent:"space-between",height:"100%",width:"100%"},listLabel:{visibility:"hidden",position:"absolute",overflow:"hidden"},visibleItemsLabel:{textOverflow:"ellipsis",marginRight:"5px",overflow:"hidden",flex:1,flexBasis:"auto"},hiddenCount:{color:"rgba(0,0,0,0.87)",fontSize:"13px",lineHeight:"15px",padding:"5px 8px",borderRadius:"16px",backgroundColor:"rgba(0,0,0,.12)"}}),zY=({list:e,maxWidth:t})=>{const r=BY(),n=(0,Rp.useRef)(),[a,i]=(0,Rp.useState)(0);(0,Rp.useEffect)((()=>{i(((e,t)=>{const r=e.length,n=((e,t)=>{if(t){const r=((e,t)=>{const{childNodes:r,clientLeft:n,clientWidth:a}=t;if(r.length>0){const[t]=Array.from(r),i=document.createRange();i.setStart(t,0);for(let r=0;r<e.length;r++){i.setEnd(t,i.endOffset+e[r].length);const{width:o}=i.getBoundingClientRect();if(n+o>a)return r;r!==e.length-1&&i.setEnd(t,i.endOffset+2)}}return-1})(e,t);return-1===r?0:e.length-r}return 0})(e,t);return r-Math.max(1,r-n)})(e,n.current))}),[e]);const o=MY(e),l=a>0,s=l?MY(e.slice(0,-a)):o;return _p().createElement(Rg(),{title:l?o:""},_p().createElement("div",{className:r.listLabelContainer},_p().createElement("div",{style:{width:VY(t)},className:r.listLabel,ref:n},o),_p().createElement("div",{className:r.visibleItemsLabel},s),l&&_p().createElement("div",{className:r.hiddenCount},`+${a}`)))},HY=e=>e.map(YY),YY=e=>e.label||(0,v.getLastUriPart)(e.uri);function WY(){return WY=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},WY.apply(null,arguments)}const GY=(0,O.always)(32),qY=(0,Rp.memo)((e=>{let{selectedItems:t,onItemClick:r,focusIndex:n,width:a,height:i}=e,o=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["selectedItems","onItemClick","focusIndex","width","height"]);return _p().createElement(cd,WY({getItemSize:GY,renderItem:(e,{item:a},i)=>{const o=!!t.find((e=>a.uri===e)),l=i===n;return _p().createElement(kd,{key:a.uri,onClick:r,checked:o,data:a,label:_p().createElement(Ld.o,{text:YY(a),highlight:a.filterText}),labelInText:a.label,style:e,isFocused:l,hideIcon:!0,LogoIcon:a.LogoIcon})},focusIndex:n,fixedTitle:!1,disableHorizontalScrollbar:!0,width:a,height:i},o))}));qY.displayName="SelectMetadataTypesList";const ZY=(0,qp.Z)({root:{borderRadius:"4px 4px 0 0",margin:0,fontSize:"14px",letterSpacing:0,lineHeight:"16px"},inputLabel:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",width:"100%",cursor:"pointer",top:"calc(50% - 23px)"},inputText:{display:"flex",flexGrow:1,alignItems:"center",height:"25px",width:"calc(100% - 53px)",paddingTop:"18px",paddingBottom:"4px",color:"rgba(0,0,0,0.87)",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},input:{width:0,cursor:"pointer","&.Mui-disabled":{backgroundColor:"transparent",cursor:"default"},"&$emptyInput":{width:"100%"}},emptyInput:{},disabledInput:{},disabledPointer:{},disabledUnderline:{},inputRoot:{flex:1,paddingRight:"4px",fontSize:"14px",letterSpacing:0,lineHeight:"16px",cursor:"pointer","&$disabledInput":{backgroundColor:"rgba(0, 0, 0, 0.03)",cursor:"pointer","&$disabledPointer":{cursor:"default"},"&$disabledUnderline::before":{borderBottomStyle:"solid"}}},icon:{transform:"rotate(0deg)",transition:"transform 0.35s ease"},"popup-opened-icon":{transform:"rotate(-180deg)"}});function $Y(){return $Y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$Y.apply(null,arguments)}function KY(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){XY(e,t,r[t])}))}return e}function XY(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const QY=(0,Rp.memo)((({placeholder:e,classes:t={},items:r,selectedItemsUris:n,onChange:a,ListLabelProps:i={},disabled:o,enableEmptyValueUnderline:l,single:s,label:c,dataReltioId:u,selectionPopupTitle:p})=>{const d=ZY(),[m,f]=(0,Rp.useState)(!1),y=(0,Rp.useCallback)((()=>f(!0)),[]),g=(0,Rp.useCallback)((()=>f(!1)),[]),[h,E]=(0,Rp.useState)(""),b=(0,Rp.useCallback)((()=>E("")),[]),T=(0,Rp.useCallback)((0,O.pipe)(b,g),[g,b]),S=r.filter((({label:e})=>v.utils.strings.search(e,h))).map(((e,t)=>({item:{item:KY({},e,{filterText:h})},index:t}))),x=(0,Rp.useMemo)((()=>(0,O.pipe)((0,O.map)((e=>r.find((0,O.propEq)("uri",e)))),(0,O.reject)(O.isNil),HY)(n)),[n,r]),C=(0,Rp.useCallback)(((e,t)=>{s?(a(t?[e.uri]:[]),T()):a(t?n.concat(e.uri):n.filter((t=>t!==e.uri)))}),[n,a,s,T]),w=(0,Rp.useCallback)((({item:e})=>{const t=!n.includes(e.uri);C(e,t)}),[n,C]),{focusIndex:A,handleKeyDown:R}=ud({items:S,open:m,onSelectFocusedItem:w,selectedItems:n,onClose:T}),_=(0,Rp.useRef)(),I=_.current?_.current.getBoundingClientRect().width:0,N=Math.max(I,255),P=0===n.length;return _p().createElement(_p().Fragment,null,_p().createElement(AB(),{label:c,ref:_,InputProps:{startAdornment:P&&!e?null:_p().createElement("div",{className:kp()(d.inputText,t.inputText)},P?_p().createElement("div",null,e):_p().createElement(zY,$Y({},i,{list:x}))),classes:{root:d.inputRoot,input:kp()(d.input,t.input,{[d.emptyInput]:P&&!e}),disabled:kp()(d.disabledInput,{[d.disabledPointer]:o}),underline:d.disabledUnderline},endAdornment:_p().createElement(Gp.T,{size:"L",icon:FY(),iconClassName:kp()(d.icon,{[d["popup-opened-icon"]]:m}),disabled:o}),readOnly:!0,disableUnderline:P&&!l},inputProps:{tabIndex:-1},InputLabelProps:{classes:{root:kp()(d.inputLabel,t.label)}},value:"",onClick:o?void 0:y,classes:{root:kp()(d.root,t.root)},size:"small",variant:"filled",disabled:o,"data-reltio-id":u}),_p().createElement(nd,{open:m,anchorEl:_.current,onClose:T,onSearch:E,title:p,containerWidth:N,containerHeight:355,searchInputOnKeyDown:R,transformOrigin:{horizontal:"left",vertical:"top"},anchorOrigin:{horizontal:"left",vertical:"bottom"},PaperProps:{"data-reltio-id":`${u}-popup`}},_p().createElement(qY,{items:S,onItemClick:C,selectedItems:n,width:N,height:245,focusIndex:A})))}));QY.displayName="MetadataTypesSelector";const JY=(0,Rp.memo)((({entityTypes:e,selectedEntityTypes:t,single:r,placeholder:n,enableEmptyValueUnderline:a,onChange:i,classes:o={},ListLabelProps:l={},disabled:s=!1})=>{const c=(0,Rp.useMemo)((()=>e.filter(v.isAvailableEntityType)),[e]);return _p().createElement(QY,{items:c,selectedItemsUris:t,single:r,placeholder:n,enableEmptyValueUnderline:a,onChange:i,classes:o,ListLabelProps:l,disabled:s,label:li().text("Entity type"),dataReltioId:"entity-type-selector",selectionPopupTitle:li().text("Select entity types")})}));JY.displayName="EntityTypesSelector";const eW=({selectedEntityTypes:e,onChange:t,classes:r={},ListLabelProps:n={}})=>{const a=(0,Pp.useSelector)(A().selectors.getMetadata),i=(0,Pp.useSelector)(ai.t9),o=(0,Pp.useSelector)(ki.Xf),l=(0,Rp.useCallback)(o?({uri:e})=>o.includes(e):O.identity,[o]),s=(0,Rp.useMemo)((()=>a.entityTypes.filter(l).sort(o?(0,v.orderByArrayComparator)(o,"uri"):e=>0).filter((({uri:e})=>(0,v.isAvailableEntityTypeForDataTenant)(i,e)))),[a,i,l,o]);return _p().createElement(JY,{classes:r,entityTypes:s,onChange:t,selectedEntityTypes:e,ListLabelProps:n,placeholder:li().text("All"),enableEmptyValueUnderline:!0})};eW.propTypes={selectedEntityTypes:Np().arrayOf(Np().string).isRequired,onChange:Np().func.isRequired,classes:Np().shape({root:Np().string,label:Np().string}),ListLabelProps:Np().shape({maxWidth:Np().number})};const tW=eW,rW=(0,qp.Z)({attribute:{cursor:"pointer",lineHeight:"16px",flexBasis:"100%",display:"flex",alignItems:"center",padding:"0 10px 0 16px",width:"calc(100% - 32px)","&$attributeWithValue":{borderBottom:"1px solid rgba(0,0,0,0.38)"},"&$disabled":{cursor:"default"}},disabled:{},attributeWithValue:{},noSelect:{},name:{fontSize:"14px",color:"rgba(0,0,0,0.87)",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",direction:"rtl",textAlign:"left",flex:"1 0",width:"0","& $noSelect":{color:"rgba(0,0,0,0.38)"},"&$disabled":{color:"rgba(0,0,0,0.26)","& $noSelect":{color:"rgba(0,0,0,0.26)"}}}}),nW=(0,O.either)((0,O.prop)("title"),(0,O.prop)("fieldName")),aW=({value:e,getLabel:t=nW,onSelectAttributeClick:r,disabled:n=!1})=>{const a=rW(),i=e&&t(e);return _p().createElement("div",{onClick:n?void 0:r,className:kp()(a.attribute,{[a.attributeWithValue]:!!i},{[a.disabled]:n})},_p().createElement(_d.Y,{value:i},_p().createElement("div",{className:kp()(a.name,{[a.disabled]:n})},i||_p().createElement("span",{className:a.noSelect},li().text("Select attribute")))),_p().createElement(Gp.T,{size:"M",icon:FY(),disabled:n}))},iW=(0,qp.Z)({subHeader:{backgroundColor:"#f5f5f5",padding:"0 16px",margin:0,display:"flex",alignItems:"center",color:"rgba(0,0,0,0.84)",fontSize:"14px",fontWeight:500}});function oW(){return oW=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},oW.apply(null,arguments)}function lW(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){sW(e,t,r[t])}))}return e}function sW(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const cW=e=>{let{selectedAttributes:t,onItemClick:r,focusIndex:n,hideCheckBox:a}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["selectedAttributes","onItemClick","focusIndex","hideCheckBox"]);const o=iW(),l=(0,ly.AH)();return _p().createElement(cd,oW({getItemSize:(e,t)=>t.items?40:28,renderItem:(e,{item:i,level:o,groupId:l,groupName:s},c)=>{const u=LL(i,t),p=c===n;return _p().createElement(kd,{key:`item-${l}-${i.fieldName}`,onClick:r,checked:u,data:lW({},i,{groupName:s}),notSelectable:i.notSelectable,hideCheckBox:a,label:_p().createElement(Ld.o,{text:i.title,highlight:i.filterText}),labelInText:i.title,level:o,style:e,isFocused:p,groupId:l,LogoIcon:i.LogoIcon})},renderGroupTitle:(e,t)=>_p().createElement(Tf(),{component:"div",className:o.subHeader,style:e,key:`group-${t.item.id}`},t.item.needGroupIcon&&_p().createElement(cy,{group:t.item,metadata:l}),t.item.title),focusIndex:n},i))},uW=(0,Rp.memo)(cW);function pW(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){dW(e,t,r[t])}))}return e}function dW(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const mW=(e,t)=>e.title.toLowerCase().includes(t.toLowerCase()),fW=(e,t)=>mW(e,t)||(e.children||[]).some((e=>fW(e,t))),yW=(e,t)=>e.findIndex(kL(t)),gW=(0,v.getMaxItemWidth)("title"),hW=(e,t,r,n,a=0,i=!1)=>{const o=mW(e,n);return[{item:n?pW({},e,{filterText:n}):e,level:a,groupId:t,groupName:r}].concat(e.children?e.children.filter((e=>i||o||fW(e,n))).flatMap((e=>hW(e,t,r,n,a+1,i||o))):[]).flat()},EW=(0,O.curry)(((e,t)=>t.map((t=>({item:t,items:t.attributes.filter((t=>fW(t,e))).map((r=>hW(r,t.id,t.title,e)))}))).filter((e=>e.items.length)))),bW=(0,qp.Z)({selector:{minWidth:"200px",width:"100%",alignItems:"stretch",background:"rgba(0,0,0, 0.0267)",boxSizing:"border-box",borderRadius:"4px",display:"flex"}}),vW=({className:e,itemsGroups:t,value:r,getLabel:n,onSelect:a,onRestoreFocus:i=O.identity,onOpenPopup:o=O.identity,disableRestoreFocus:l=!1,disableEnforceFocus:s=!1,single:c=!1,ungroup:u=!1,disabled:p=!1,hideCheckBox:d=!1})=>{const m=bW(),[f,y]=(0,Rp.useState)(null),g=(0,Rp.useCallback)((()=>y(null)),[]),h=!!f,[E,b]=(0,Rp.useState)(""),v=(0,Rp.useCallback)((()=>b("")),[]),[T,S]=(0,Rp.useState)([]),x=(0,Rp.useCallback)((()=>S([])),[]),C=(0,Rp.useMemo)((()=>EW(E,t)),[t,E]),w=(0,Rp.useMemo)((()=>(0,O.pipe)((0,O.when)((0,O.always)(u),(0,O.chain)((0,O.pipe)((0,O.prop)("items"),O.flatten,(0,O.map)((0,O.pick)(["item","level"]))))),ad)(C)),[u,C]),A=(0,Rp.useMemo)((()=>Math.max(gW(C),308)),[C]),R=(0,O.pipe)((0,O.tap)((0,O.pipe)(x,v,g)),i),_=(0,Rp.useRef)(),I=(0,Rp.useCallback)(((e,t)=>{a({checked:t,attribute:e,index:t?T.length:yW(T,e),selectedAttributes:T}),c?(S(t?[e]:[]),R({})):(S((({attribute:e,selectedAttributes:t,checked:r})=>r?t.concat(e):t.filter((t=>!kL(e,t))))({selectedAttributes:T,attribute:e,checked:t})),_.current&&_.current.focus())}),[T,a,c,R,_]),N=(0,Rp.useCallback)((({onListItemClick:e,selectedAttributes:t})=>({item:r,groupData:n})=>{const a=LL(r,t);e(pW({},r,{groupName:n.groupName}),!a)})({onListItemClick:I,selectedAttributes:T}),[I,T]),{focusIndex:P,handleKeyDown:D}=ud({items:w,open:h,onSelectFocusedItem:N,selectedItems:T,onClose:R});return _p().createElement("div",{className:kp()(m.selector,e),"data-reltio-id":"attribute-selector"},_p().createElement(aW,{value:r,getLabel:n,onSelectAttributeClick:e=>{o(),y(e.currentTarget)},disabled:p}),_p().createElement(nd,{open:h,anchorEl:f,onClose:R,onSearch:b,title:li().text("Select attribute"),containerWidth:A,containerHeight:507,searchInputOnKeyDown:D,anchorOrigin:{horizontal:"right",vertical:"bottom"},searchInputRef:_,disableRestoreFocus:l,disableEnforceFocus:s},_p().createElement(uW,{items:w,onItemClick:I,selectedAttributes:T,width:A,height:400,focusIndex:P,hideCheckBox:d})))},TW=(0,Rp.memo)(vW);var OW=r(80349);function SW(){return SW=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},SW.apply(null,arguments)}const xW=e=>{let{entityTypes:t,recommendedAttributes:r,showReferencedEntityAttributes:n=!0,firstLevelAttributesFilter:a}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["entityTypes","recommendedAttributes","showReferencedEntityAttributes","firstLevelAttributesFilter"]);const o=(0,Pp.useSelector)(A().selectors.getMetadata),l=(0,Pp.useSelector)(ai.t9),s=(0,Pp.useSelector)(A().selectors.getCanUserReadWorkflowDataTask),c=(0,Pp.useSelector)(ki.Xf),u=(0,Pp.useSelector)(A().selectors.getDataTenants),p=(0,Rp.useMemo)((()=>(0,O.pipe)(OW.s1,(0,O.when)((0,O.always)(!n),OW.a),(0,I.ED)(l),(e=>(0,v.filterMaskedAttributes)(o,e)))({allowedEntityTypes:c,firstLevelAttributesFilter:a},o,t,r,u,s)),[t,o,l,c,a,r,n,u,s]);return _p().createElement(TW,SW({},i,{itemsGroups:p}))},CW=(0,Rp.memo)(xW),wW=({rowData:e,rowContext:{entityTypes:t,dispatchGroupAction:r},attributeSelectorProps:n={}})=>{const a=UY(),i=e&&e.id,o=(0,Rp.useCallback)((e=>{r(tl,i,e)}),[i,r]),l=(0,Rp.useCallback)((e=>(0,v.getSearchGroupAttributeLabel)({data:e})),[]);return _p().createElement(CW,{className:a.attributeSelect,value:e&&e.data,getLabel:l,entityTypes:t,onSelect:o,onRestoreFocus:n.onRestoreFocus,onOpenPopup:n.onOpen,disableRestoreFocus:n.disablePopoverRestoreFocus,disableEnforceFocus:n.disablePopoverRestoreFocus})};wW.propTypes={rowData:vz,rowContext:Np().shape({entityTypes:Np().arrayOf(Np().string),dispatchGroupAction:Np().func}),attributeSelectorProps:Np().shape({onRestoreFocus:Np().func,onOpen:Np().func,disablePopoverRestoreFocus:Np().bool})};const AW=(0,Rp.memo)(wW);function RW(){return RW=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},RW.apply(null,arguments)}const _W=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return _p().createElement("svg",RW({width:"20",height:"20",viewBox:"0 0 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",focusable:"false"},r),_p().createElement("defs",null,_p().createElement("path",{d:"M20.222 6C21.21 6 22 6.8 22 7.778v12.444C22 21.2 21.209 22 20.222 22H7.778C6.79 22 6 21.2 6 20.222V7.778C6 6.8 6.791 6 7.778 6h12.444zM8 8v12h12V8H8zM4 18H2V4c0-1.1.9-2 2-2h14v2H4v14z",id:"svg397942461a"})),_p().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},_p().createElement("g",null,_p().createElement("g",{transform:"translate(-2 -2)"},_p().createElement("mask",{id:"svg397942461b",fill:"#fff"},_p().createElement("use",{xlinkHref:"#svg397942461a"})),_p().createElement("g",{mask:"url(#svg397942461b)",fill:"#000",fillOpacity:".54"},_p().createElement("path",{d:"M0 0h24v24H0z"}))))))},IW=e=>!(e&&e.data),NW=({rowData:e,rowContext:{dispatchGroupAction:t}})=>{const r=UY(),n=e&&e.id,a=(0,Rp.useCallback)((()=>t(al,n)),[n,t]),i=(0,Rp.useCallback)((()=>t(il,n)),[n,t]),o=(0,Rp.useCallback)((()=>t(Xo,n)),[n,t]);return e&&_p().createElement("div",{className:kp()(r.actions)},_p().createElement(Rg(),{title:li().text("Add"),placement:"bottom"},_p().createElement(EY(),{className:r.actionIcon,onClick:o})),!IW(e)&&_p().createElement(Rg(),{title:li().text("Duplicate"),placement:"bottom"},_p().createElement("div",{className:r.actionIcon,tabIndex:-1},_p().createElement(_W,{onClick:i,tabIndex:-1}))),_p().createElement(Rg(),{title:li().text("Delete"),placement:"bottom"},_p().createElement(zp(),{onClick:a,className:r.actionIcon})))};NW.propTypes={rowData:vz,rowContext:Np().shape({dispatchGroupAction:Np().func})};const PW=(0,Rp.memo)(NW),DW={BY_LABEL:(0,r(39588).c)({stringify:(0,O.prop)("label")})},kW=({className:e,attribute:t,textFieldInputRef:r,isDisabled:n,height:a,onChange:i})=>{const o=(0,O.pipe)(v.getFilterOptionLabel,bY.capitalize);return _p().createElement(Pj,{label:"",placeholder:li().text("Equals"),className:e,value:n?void 0:{value:t.filter,label:o(t.filter)},options:t&&t.data&&t.data.filterOptions.map((e=>({value:e,label:o(e)})))||[],height:a,onChange:i,isDisabled:n,filterOption:DW.BY_LABEL,textFieldInputRef:r})};kW.propTypes={className:Np().string,attribute:vz,textFieldInputRef:Np().object,isDisabled:Np().bool,onChange:Np().func,height:Np().number};const LW=(0,Rp.memo)(kW),UW=({rowData:e,rowContext:{dispatchGroupAction:t},textFieldInputRef:r})=>{const n=UY(),a=e&&e.id,i=(0,Rp.useCallback)((e=>t(ol,a,e.value)),[t,a]);return _p().createElement(LW,{className:n.filterSelect,attribute:e,textFieldInputRef:r,isDisabled:IW(e),onChange:i})};UW.propTypes={rowData:vz,rowContext:Np().shape({dispatchGroupAction:Np().func}),textFieldInputRef:Np().object};const jW=(0,Rp.memo)(UW);var FW=r(23821);const MW=(0,qp.Z)({input:{margin:0,paddingBottom:"4px !important",paddingTop:"2px !important",borderRadius:"4px"},multipleInput:{minHeight:"46px",margin:0,padding:100},root:{borderRadius:"4px 4px 0 0",padding:0,display:"flex",alignItems:"center",margin:0},boolRoot:{borderRadius:"4px 4px",padding:11,display:"flex",alignItems:"center"},dateRoot:{borderRadius:"4px 4px 0 0",margin:0},booleanRadioEditor:{paddingLeft:"11px"}}),VW=({attribute:e,groupId:t,onChange:r,updateValues:n,filterValues:a})=>{const{values:i,data:{attrType:o,fieldName:l}={},id:s}=e,c=(0,Pp.useSelector)((e=>(0,io.Sw)(e,t,s)))||{},u=(0,Pp.useSelector)((e=>(0,io.Ly)(e))),p=(0,Pp.useSelector)((e=>(0,ai.Sg)(e,l)));(0,Rp.useEffect)((()=>{u&&n()}),[i,u,p]),(0,Rp.useEffect)((()=>{u||n()}),[i,u]);const d=(0,Rp.useMemo)((()=>(0,O.propOr)([],0,i)),[i]),m=(0,Rp.useCallback)((0,O.pipe)(v.wrapInArray,r),[r]),{default:f,filtered:y}=c;return!f&&o?_p().createElement("div",{className:"ValuesEditor-styles-loadingWrapper--_rOmn"},_p().createElement(Lm(),{size:20,className:"ValuesEditor-styles-loading--mLFVu"})):_p().createElement(wg,{values:d,defaultOptions:f,filteredOptions:y,onChange:m,getSuggestions:a,tabSelectsValue:!1,canLoadMore:!(0,Pa.tW)(e.data)})};VW.propTypes={attribute:vz.isRequired,groupId:Np().string,onChange:Np().func,updateValues:Np().func,filterValues:Np().func};const BW=VW,zW=({attribute:e,dispatchGroupAction:t,groupId:r})=>{const{values:n,data:{attrType:a,fieldName:i}={},filter:o}=e,l=MW(),s=(0,v.isTypeaheadAttrType)(a)||(0,O.allPass)([(0,O.propSatisfies)((0,O.either)(O.isNil,v.isEntityTypeUri),"uri"),(0,O.prop)("faceted"),(0,O.propEq)("type",v.DataTypes.TYPE_BLOB)])(a),c=(0,v.isEnumAttrType)(a)||(0,v.isLookupAttrType)(a),u=r=>t(ll,e.id,r);if((s||c)&&(0,v.isMultiValueOption)(o)){const n=()=>t(ul,e),a=({value:r,pageNumber:n,currentOptions:a})=>t(sl,{attribute:e,value:r,debounceTime:500,pageNumber:n,currentOptions:a});return _p().createElement(BW,{attribute:e,groupId:r,onChange:u,filterValues:a,updateValues:n})}{const e=c?{type:v.DataTypes.TYPE_STRING}:(0,v.getAttrDataTypeDefinition)(a),t=(0,v.getDataTypeDefinitionForFilterValue)(e,o),r=(0,v.isDateType)(t.type)&&!(0,v.isDateRangeFilterOption)(o)&&l.dateRoot||(0,v.isBooleanType)(t.type)&&l.boolRoot||l.root;return _p().createElement(FW.n,{filter:{filter:o,fieldName:i,values:n||[]},onChange:u,dataTypeDefinition:t,fullWidth:!0,TextFieldProps:{InputProps:{classes:{root:l.input},disableUnderline:(0,O.isNil)(n)||(0,O.isEmpty)((0,O.flatten)(n))}},color:"primary",booleanRadioEditorClassName:l.booleanRadioEditor,classes:{root:r},orientation:"horizontal"})}};zW.propTypes={attribute:vz.isRequired,groupId:Np().string,dispatchGroupAction:Np().func};const HW=(0,Rp.memo)(zW),YW=({rowData:e,rowContext:{dispatchGroupAction:t,groupId:r}})=>{const n=UY(),a=e&&(0,v.checkIfOptionHasValues)(e.filter);return _p().createElement("div",{className:n.valuesWrapper,"data-reltio-id":"advanced-search-values-editor-wrapper"},!IW(e)&&a&&_p().createElement(HW,{attribute:e,dispatchGroupAction:t,groupId:r}))};YW.propTypes={rowData:vz,rowContext:Np().shape({dispatchGroupAction:Np().func,groupId:Np().string})};const WW=(0,Rp.memo)(YW),GW=({rowData:e,rowContext:{dispatchGroupAction:t}})=>{const r=UY(),n=e&&e.id,a=e&&e.operator,i=(0,Rp.useCallback)((e=>t(rl,n,e)),[t,n]);return _p().createElement("div",{className:r.logicOperatorContainer},a?_p().createElement(IY,{className:r.logicOperator,value:a,onChange:i}):_p().createElement("div",{className:kp()(r.logicOperator,r.logicOperatorPlaceholder)},li().text("Where")))};GW.propTypes={rowData:vz,rowContext:Np().shape({dispatchGroupAction:Np().func})};const qW=(0,Rp.memo)(GW);function ZW(){return ZW=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ZW.apply(null,arguments)}const $W=e=>{let{showLogicOperator:t,group:{id:r,attributes:n,operator:a,entityTypes:i=[]},dispatch:o,onAddEmptyGroup:l}=e,s=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["showLogicOperator","group","dispatch","onAddEmptyGroup"]);const c=kY(),u=UY(),p=(0,Rp.useCallback)((()=>o({type:We,payload:{groupId:r,id:(0,Me.x0)()}})),[r,o]),d=(0,Rp.useCallback)((()=>o({type:He,payload:{groupId:r}})),[r,o]),m=(0,Rp.useCallback)((e=>o(((e,t)=>({type:ze,payload:{groupId:e,operator:t}}))(r,e))),[r,o]),f=(0,Rp.useCallback)((e=>o(((e,t)=>({type:Ve,payload:{groupId:e,entityTypes:t}}))(r,e))),[r,o]),y=(0,Rp.useCallback)(((e,...t)=>o(e(r,...t))),[r,o]),g=(0,Rp.useRef)(null),h=(0,Rp.useRef)(null),E=(0,Rp.useRef)(null);E.current=n.length;const b=(0,Rp.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),g.current&&h.current!==E.current&&(g.current.querySelector("input").focus(),h.current=null)}),[]),v=(0,Rp.useCallback)((()=>{h.current=n.length}),[n.length]),T=(0,Rp.useMemo)((()=>[{text:li().text("Add set"),onClick:l,id:"-group-add-set"},{text:li().text("Duplicate set"),onClick:p,id:"-group-duplicate-set"},{text:li().text("Delete set"),onClick:d,id:"-group-delete-set"}]),[l,p,d]),O=(0,Rp.useMemo)((()=>({root:u.row})),[u]),S=(0,Rp.useMemo)((()=>({onRestoreFocus:b,onOpen:v,disablePopoverRestoreFocus:!!b})),[b,v]);return _p().createElement(_p().Fragment,null,_p().createElement("div",ZW({className:c.container},s),_p().createElement("div",{className:c.title},li().text("Set")),_p().createElement("div",{className:c.entityTypeSelectorContainer},_p().createElement(tW,{classes:{root:c.entityTypeSelector},selectedEntityTypes:i,onChange:f})),_p().createElement("div",{className:c.rows},_p().createElement(RY,{rowClasses:O,rowsData:n,AttributeSelectorComponent:AW,FilterSelectorComponent:jW,ValuesEditorComponent:WW,ActionsComponent:PW,LogicOperatorComponent:qW,filterSelectorRefIndex:h.current,filterSelectorRef:g,lastRowAttributeSelectorProps:S,entityTypes:i,groupId:r,dispatchGroupAction:y}),_p().createElement("div",{className:c.actions},_p().createElement($N,{menuId:`query-builder-group-actions-${r}`,buttonComponent:Gp.T,buttonProps:{icon:tm(),size:"L","data-reltio-id":"reltio-search-query-builder-group-actions"},menuItems:T})))),t&&_p().createElement("div",{className:c.logicOperator},_p().createElement("div",{className:kp()(c.verticalOperatorLine,c.upperLine)}),_p().createElement("div",{className:kp()(c.verticalOperatorLine,c.lowerLine)}),_p().createElement(IY,{value:a,onChange:m})))};$W.propTypes={showLogicOperator:Np().bool,group:Np().shape({id:Np().string,attributes:Np().arrayOf(vz),entityTypes:Np().arrayOf(Np().string),operator:Np().string}),onAddEmptyGroup:Np().func,dispatch:Np().func};const KW=(0,Rp.memo)($W);function XW(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){QW(e,t,r[t])}))}return e}function QW(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const JW=(0,qp.Z)((e=>({container:{backgroundColor:e.palette.background.default,transition:"flex-grow 0.35s ease",flexGrow:1,flexBasis:0,overflow:"hidden",display:"flex",flexDirection:"column"},button:{paddingLeft:23,fontSize:"14px",position:"relative"},scrollWrapper:{overflow:"auto",flex:"1 0 0px",padding:"0 60px"},groupsContainer:{margin:"0 auto",width:"100%",maxWidth:"1280px"},apply:{background:e.palette.background.default,textAlign:"right",padding:"15px 45px"},icon:{height:18,width:18,marginRight:"9px"},verticalOperatorLine:XW({},NY),upperLine:{marginTop:-18},searchByOvContainer:{marginLeft:-6,marginBottom:-14}}))),eG=({groups:e,uiConfigShowSearchByOv:t,dispatch:r})=>{const n=JW(),a=(0,Rp.useRef)(null),i=(0,Rp.useRef)(null),o=(0,Rp.useCallback)((()=>r({type:Ye,payload:{group:Wt([])}})),[r]);return(0,Rp.useEffect)((()=>{if(0===e.length)o();else if(!(0,O.isNil)(i.current)&&i.current<e.length&&a.current){const e=a.current.childNodes;e[e.length-2].scrollIntoView({behavior:"smooth"})}i.current=e.length}),[e.length,o]),_p().createElement("div",{className:n.scrollWrapper},_p().createElement("div",{className:n.groupsContainer,ref:a},t&&_p().createElement("div",{className:n.searchByOvContainer},_p().createElement(tE,{variant:"queryGroups"})),e.map(((e,t,n)=>_p().createElement(KW,{key:e.id,group:e,dispatch:r,showLogicOperator:t!==n.length-1,onAddEmptyGroup:o,"data-reltio-id":`reltio-search-advansed-search-group-builder-${t}`}))),_p().createElement("div",{className:n.button},_p().createElement("div",{className:kp()(n.verticalOperatorLine,n.upperLine)}),_p().createElement(hE(),{onClick:o,color:"primary",size:"small","data-reltio-id":"reltio-search-advanced-search-add-set-button"},_p().createElement(EY(),{color:"primary",className:n.icon,fontSize:"small"}),li().text("ADD SET")))))};eG.propTypes={groups:Np().array,dispatch:Np().func,uiConfigShowSearchByOv:Np().bool};const tG=(0,Pp.connect)((e=>({groups:(0,io.go)(e),uiConfigShowSearchByOv:A().selectors.getShowSearchByOv(e)??(0,ki.cC)(e)})))(eG),rG=w.search.actions.updateState({}),nG=({open:e,onClose:t})=>{const r=(0,Pp.useDispatch)(),n=(0,Rp.useCallback)((()=>{t(),r(rG)}),[r,t]),a=(0,Rp.useCallback)((()=>{t(),r(vi(!0,rG))}),[r,t]),i=(0,Pp.useSelector)(_o.LA),o=(0,Pp.useSelector)(ai.ai),l=(0,Pp.useSelector)(_o.WH),s=(0,Pp.useSelector)(_o.Jv),c=i?s&&!l:!o;return _p().createElement(gz.U,{open:e,title:li().text("Search filters cannot be displayed in Quick filters"),content:li().text("You have advanced filters that cannot be displayed in Quick filters. Save your search or clear your filters to go to Quick filters."),discardCaption:li().text("Clear search"),saveCaption:li().text("Save search"),disabledSave:c,onCancel:t,onDiscard:n,onSave:a})};nG.propTypes={open:Np().bool,onClose:Np().func};const aG=nG,iG=(0,Pp.connect)((e=>({metadata:A().selectors.getMetadata(e),attributesPresentation:A().selectors.getAttributesPresentation(e),groups:(0,io.go)(e),lookups:A().selectors.getLookups(e),keyword:A().selectors.getSearchKeyword(e),map:(0,ai.vH)(e),dataTenants:A().selectors.getDataTenants(e)})))((({metadata:e,attributesPresentation:t,lookups:r,groups:n,keyword:a,map:i,onClose:o,collapsed:l,isFullscreen:s,onCollapse:c,onExpand:u,onFullscreen:p,dataTenants:d,dispatch:m})=>{const f=JW(),[y,g]=(0,Rp.useState)(!1),h=(0,O.ifElse)((0,O.always)(Ua(e,n,d)),(0,O.pipe)(o,u),(()=>g(!0)));return _p().createElement("div",{className:f.container},_p().createElement(JH,{onBackBtnClick:h}),_p().createElement(tG,null),_p().createElement(gY,{groups:n,lookups:r,dispatch:m,metadata:e,attributesPresentation:t,hasMinSize:l,collapseBtnActive:!l,isFullscreen:s,onCollapseBtnClick:l?u:c,onFullScreenBtnClick:s?u:p,keyword:a,map:i}),_p().createElement(aG,{open:y,onClose:()=>g(!1)}))})),oG=({isOpenAdvancedSearch:e,onCloseAdvancedSearch:t})=>{const r=CE(),[n,a]=(0,Rp.useState)(!1),[i,o]=(0,Rp.useState)("50%"),l=(0,Rp.useCallback)((()=>{a(!0),o("120px")}),[]),s=(0,Rp.useCallback)((()=>{a(!1),o("50%")}),[]),c=(0,Rp.useCallback)((({percentageSize:e,isMaxSize:t,isMinSize:r})=>{a(r),o(t?-53:e)}),[]),u=(0,Rp.useCallback)((()=>{a(!1),o(-53)}),[]),p=_p().createElement(_p().Fragment,null,_p().createElement(KH,null),_p().createElement(Kf(),{className:r.divider})),d=_p().createElement(_p().Fragment,null,p,_p().createElement(iG,{collapsed:n,isFullscreen:-53===i,onClose:t,onCollapse:l,onExpand:s,onFullscreen:u}));return _p().createElement(PE,{className:r.resizablePanesWrapper,orientation:"horizontal",size:e?i:0,minSize:120,maxSize:-53,allowResize:e,onChange:c},_p().createElement("div",{className:r.pane},e&&d),_p().createElement("div",{className:r.pane},!e&&p,_p().createElement(YV,null)))};oG.propTypes={isOpenAdvancedSearch:Np().bool,onCloseAdvancedSearch:Np().func};const lG=oG;function sG(){return sG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},sG.apply(null,arguments)}const cG=e=>_p().createElement("svg",sG({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgTenant"},e),_p().createElement("path",{d:"M2 0h13v2H8v19h12V6h-9V4h11v19H2V0zm9 8h7v2h-7V8zm0 4h7v2h-7v-2zm0 4h7v2h-7v-2zM4 4v2h2V4H4zm0 8v2h2v-2H4zm0-4v2h2V8H4zm0 8v2h2v-2H4z",fill:"#000",stroke:"none",strokeWidth:1,fillRule:"evenodd"})),uG=(0,qp.Z)((()=>({labelWrapper:{height:"24px",display:"inline-flex",alignItems:"center"},tenantIcon:{height:"24px",width:"24px",marginRight:"4px",opacity:.38},tenantLabel:{lineHeight:"15px",fontSize:"13px",color:"rgba(0,0,0,0.38)"}}))),pG=({className:e})=>{const t=uG(),r=(0,ly.xz)(),n=(0,ly.fN)(),a=`${r}${n?" - "+n.toUpperCase():""}`;return _p().createElement("div",{className:kp()(t.labelWrapper,e)},_p().createElement(cG,{className:t.tenantIcon,"data-reltio-id":"reltio-tenant-icon"}),_p().createElement(zf(),{className:t.tenantLabel},a))};var dG=r(80671);const mG=(0,qp.Z)((e=>({container:{display:"flex",flexDirection:"row",minHeight:"64px",flexShrink:0,alignItems:"center",paddingRight:"14px"},entityTypeTitle:{fontSize:"18px",letterSpacing:0,lineHeight:"21px",marginRight:"16px",flexShrink:0},profileText:{color:e.palette.text.secondary,fontSize:"14px",lineHeight:"28px",flexShrink:0},profileNumber:{color:e.palette.text.secondary,fontWeight:600,paddingLeft:"3px",paddingRight:"8px",flexShrink:0},splitter:{marginRight:"15px",marginLeft:"18px",height:"32px"},clearButton:{marginRight:"auto",marginLeft:"14px",flexShrink:0},searchBox:{flex:"1 1 auto",width:"100%",maxWidth:"538px"},searchQueryContainer:{display:"flex",flexDirection:"column",minHeight:"50px",flexShrink:0,paddingLeft:"24px",paddingRight:"14px",alignItems:"flex-start",color:e.palette.text.secondary,fontSize:"12px",letterSpacing:0,lineHeight:"14px"},searchQuery:{paddingTop:"6px"},borderBottom:{borderBottom:"1px solid rgba(0,0,0,0.1)"}}))),fG=()=>{const e=mG(),t=(0,Pp.useSelector)(A().selectors.getMetadata),r=(0,Pp.useSelector)(cu),n=(0,Pp.useSelector)(lu),a=(0,Pp.useSelector)(Tu),i=(0,Pp.useSelector)(ai.hX),o=(0,Pp.useSelector)(Ou),l=(0,Pp.useSelector)(bu),s=(0,v.getEntityTypeLabel)(t,{type:r}),c=(0,Pp.useSelector)(vu),u=(0,Pp.useDispatch)(),p=(()=>{const e=(0,Pp.useSelector)(A().selectors.getMetadata),t=(0,Pp.useSelector)(A().selectors.getLookups),r=(0,Pp.useSelector)(A().selectors.getAttributesPresentation),n=(0,Pp.useSelector)(io.go),a=(0,Pp.useSelector)(A().selectors.getSearchKeyword),i=(0,Pp.useSelector)(ai.vH),o=(0,Pp.useSelector)(A().selectors.getDataTenants),l=(0,Pp.useSelector)(C.X0),s=(0,Pp.useSelector)(C.Mp),c=(0,Rp.useMemo)((()=>Object.values((0,Pa.t8)(l,s))),[l,s]);return(0,Rp.useMemo)((()=>{const l=(0,O.isEmpty)(n)?(0,pl.h)(e,o,c):n;return(e=>!(1===e.length&&(0,O.isEmpty)(e[0].attributes)&&1===e[0].entityTypes.length))(l)||i||a?(0,v.buildReadableQuery)(e,r,t,l,a,i):[]}),[a,i,e,o,r,n,c,t])})();(0,Rp.useEffect)((()=>{0!==i&&(a&&o>=i||!a&&o<=0)&&u(Cc())}),[a,i,o,u]);const d=(0,Rp.useCallback)((e=>u(((e,t)=>({type:Pn,payload:{filterText:e,debounceTime:t}}))(e,B.XU))),[u]);return _p().createElement(_p().Fragment,null,_p().createElement(GF(),{className:kp()(e.container,{[e.borderBottom]:n>0})},_p().createElement(zf(),{component:"span",className:e.entityTypeTitle},s),_p().createElement(Kf(),{orientation:"vertical",className:e.splitter}),_p().createElement(zf(),{component:"span",className:e.profileNumber},li().number(o,"0,0")),_p().createElement(zf(),{variant:"body2",component:"span",className:e.profileText},li().text(" profiles are selected for bulk edit.")),0===n&&_p().createElement(_p().Fragment,null,_p().createElement(hE(),{color:"primary",className:e.clearButton,onClick:()=>{u(Cc())},"data-reltio-id":"reltio-search-bulk-update-"+(a?"select-all-profiles":"clear-selection")},a?`${li().text("Select all")} ${li().number(i,"0,0")} ${li().text("profiles")}`:li().text("Clear selection")),_p().createElement(Jp,{classes:{root:e.searchBox},value:c,onSearch:d,"data-reltio-id":"reltio-search-bulk-update-search-input"}),_p().createElement(Kf(),{orientation:"vertical",className:e.splitter}),_p().createElement($d,{entityTypeUri:r,headColumns:l,onSelectColumns:e=>{const t=(0,Di.tU)(e,l);u(Rc(e)),t&&u(xc())},"data-reltio-id":"reltio-search-bulk-update-add-remove-columns"}))),0===n&&!(0,O.isEmpty)(p)&&_p().createElement(GF(),{className:e.searchQueryContainer},li().text("Search query"),_p().createElement(dG.B,{readableQuery:p,className:e.searchQuery})))};function yG(){return yG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yG.apply(null,arguments)}const gG=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return _p().createElement("svg",yG({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},r),_p().createElement("defs",null,_p().createElement("path",{id:"svg3533951039a",d:"M15 6v5l2 2v2h-4v4l-.992 1L11 19v-4H7v-2l2-2V6H8V4h8v2z"})),_p().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},_p().createElement("mask",{id:"svg3533951039b",fill:"#fff"},_p().createElement("use",{xlinkHref:"#svg3533951039a"})),_p().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg3533951039b)",d:"M0 0h24v24H0z"})))};function hG(){return hG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hG.apply(null,arguments)}const EG=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return _p().createElement("svg",hG({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},r),_p().createElement("defs",null,_p().createElement("path",{d:"M9 4a5.002 5.002 0 011 9.9V18h5.24a2.2 2.2 0 110 2H10c-1.11 0-2-.89-2-2v-4.1A5.002 5.002 0 019 4zm.5 2.5h-1v2h-2v1h2v2h1v-2h2v-1h-2v-2z",id:"svg1464898421a"})),_p().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},_p().createElement("mask",{id:"svg1464898421b",fill:"#fff"},_p().createElement("use",{xlinkHref:"#svg1464898421a"})),_p().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg1464898421b)",d:"M0 0h24v24H0z"})))},bG=(0,qp.Z)({editor:{marginBottom:0},editorValue:{width:"100%",marginRight:"8px"}}),vG=({valueProperty:e,emptyEditorValue:t,attributeType:r,value:n,fieldName:a,onChangeValue:i})=>{const o=bG(),l=!r.uri,s=(0,O.pipe)((0,O.ifElse)((0,O.has)("lookupCode"),O.identity,(0,O.objOf)("value")),(0,O.filter)((e=>void 0!==e)),(0,O.mergeRight)(t))(n);return(0,Rp.useEffect)((()=>{(0,v.isLookupAttrType)(r)||""===t.value||i(e)(t)}),[]),l?_p().createElement("div",{key:e,className:kp()(o.editor,o.editorValue),"data-reltio-id":"bulk-update-special-attribute-change-editor"},_p().createElement(xL.Z,{fieldName:a,value:n,dataTypeDefinition:(0,v.getAttrDataTypeDefinition)(r),onChange:(0,O.pipe)((0,O.objOf)("value"),i(e)),fullWidth:!0})):_p().createElement(eU,{key:e,className:o.editor,mode:v.Mode.Editing,attributeType:r,attributeValue:s,onChangeAttribute:i(e)})},TG={flex:"0 0 auto"},OG=(0,qp.Z)({container:{flexGrow:1,display:"flex",alignItems:"center",margin:0},singleEditor:{marginRight:5,maxWidth:334},to:{color:"#696969",padding:"0 16px 0 7px"},type_Timestamp:TG,type_Boolean:TG,type_Date:TG}),SG=(0,Rp.memo)((({id:e,groupId:t,operation:r,operationParameters:n})=>{const a=OG(),i=(0,Pp.useDispatch)(),{attributeType:o,fieldName:l}=n.attributeTypeData,s=(0,Rp.useMemo)((()=>(0,v.createNewAttribute)({parentUri:"entities/fakeEntity",attributeType:o})),[o]),c=(0,Rp.useCallback)((r=>n=>{const{value:a}=n,l=""===a&&(0,v.isLookupAttrType)(o)?{lookupCode:"",value:""}:a;i(Pc({id:e,groupId:t,operationParameters:{[r]:l}}))}),[e,t,o,i]),u=nu(r).map((e=>_p().createElement(vG,{key:e,valueProperty:e,value:n[e],emptyEditorValue:s,fieldName:l,attributeType:o,onChangeValue:c})));if(!u.length)return null;const p=_p().createElement("div",{key:"to",className:a.to},li().text("with"));return _p().createElement("div",{className:kp()(a.container,a[`type_${o.type}`],{[a.singleEditor]:1===u.length})},2===u.length?(0,O.insert)(1,p,u):u)}));SG.displayName="ChangeEditor";const xG=(0,qp.Z)((()=>({entitySelector:{marginTop:"10px",width:"100%",maxWidth:"452px"},label:{"&:not($labelShrink)":{transform:"translate(12px, 10px)"}},labelShrink:{}}))),CG=({attributeType:e,value:t,onChange:r})=>{const n=xG(),a=(0,Pp.useDispatch)(),i=(0,Pp.useSelector)(A().selectors.getMetadata),o=(0,Pp.useSelector)((e=>A().selectors.getGlobalSearchRequestOptions(e,["ovOnly"]))),l=v.Mode.Editing,s=null==t?void 0:t.entityUri,c=(0,v.getReferencedEntityTypeUriFromAttrType)(e),u=(0,Rp.useCallback)((t=>(0,v.referencedEntityAttributeTypesSelectionStrategy)(e,t)),[e]),p=(0,Rp.useCallback)((e=>{const{uri:t,type:n,label:i}=e;(0,v.isTempUri)(s)&&a(w.profile.modifiedEntities.actions.entityDeleted(s)),r((0,O.isEmpty)(e)?null:{entityUri:t,entityType:n,entityLabel:i})}),[a,r,s]),d=(0,Rp.useCallback)(((e,t)=>{const r=(0,v.getEntityType)(i,c),n=(0,O.pipe)(u,(0,v.getCreatableAttributeTypes)(l))(r),o=(0,v.createTemporaryEntity)({entityTypeUri:e,initValue:t,attributeTypes:n,metadata:i,mode:l});p(o),a(w.profile.modifiedEntities.actions.entityCreated(o))}),[a,p,u,i,l,c]);return _p().createElement(JU,{className:n.entitySelector,entity:t,entityTypesUris:(0,ni.l0)(c),metadata:i,globalSearchRequestOptions:o,onChange:p,onCreate:d,height:40,disableLinkClick:!0,attributeTypesSelectionStrategy:u,mode:l,TextFieldProps:{InputLabelProps:{classes:{root:n.label,shrink:n.labelShrink}}}})},wG=e=>(0,O.last)(e.type.split("/")),AG=e=>{const t=wG(e);return{attributes:{[t]:[e]}}},RG=(e,t)=>{const r=wG(e);return t.attributes[r][0]},_G=({attributeValue:e,onChange:t})=>{const r=(0,Rp.useRef)(e);r.current=e;return{onChangeAttribute:(0,Rp.useCallback)((({value:e,attributeType:n,uri:a})=>{const i=AG(r.current),o=(0,v.editAttribute)({entity:i,attributeType:n,uri:a,value:e});t(RG(r.current,o))}),[t]),onDeleteAttribute:(0,Rp.useCallback)((({attributeType:e,uri:n})=>{const a=AG(r.current),i=(0,v.removeAttribute)({entity:a,attributeType:e,uri:n});t(RG(r.current,i))}),[t]),onAddAttributes:(0,Rp.useCallback)((e=>{const n=AG(r.current),a=e.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a}=t;return(0,v.addAttribute)({entity:e,attributeType:r,parentUri:n,index:a})}),n);t(RG(r.current,a))}),[t]),onTogglePin:(0,Rp.useCallback)((e=>{const n=(({parentAttributeValue:e,uri:t})=>{const r=t.split(e.uri+"/")[1].split("/"),n=[];for(;r.length;){n.push("value");const t=r.shift(),a=r.shift();n.push(t);const i=(0,O.view)((0,O.lensPath)(n),e);if(!i)return null;const o=i.findIndex((({uri:e})=>e.endsWith("/"+a)));n.push(o)}return n.length?(n.push("pin"),(0,O.over)((0,O.lensPath)(n),O.not,e)):null})({parentAttributeValue:r.current,uri:e});n&&t(n)}),[t])}},IG=(0,qp.Z)((e=>({pinIcon:{marginRight:"-8px"},pinIconActive:{"& svg > g > path":{fill:e.palette.primary.main,fillOpacity:1}}}))),NG=({onTogglePin:e,subAttributeValue:t})=>{const r=IG();return _p().createElement(Bd.k,{icon:gG,onClick:()=>e(t.uri),size:"L",className:kp()(r.pinIcon,t.pin&&r.pinIconActive)})},PG=(0,O.curry)(((e,t,{attributeValue:r})=>r.uri===e?null:_p().createElement(NG,{onTogglePin:t,subAttributeValue:r})));function DG(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const kG=({attributeType:e,attributeValue:t,onChange:r})=>{const n=(0,Pp.useSelector)(A().selectors.getMetadata),a=(0,Rp.useMemo)((()=>{const t=(0,v.getAttributeTypeSubAttributes)(n,e),r=(0,v.createNewAttribute)({parentUri:"entities/fakeEntity",attributeType:e});return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){DG(e,t,r[t])}))}return e}({},r,{value:(0,v.createDefaultValues)({attributeTypes:t,parentUri:r.uri,metadata:n,mode:v.Mode.Editing})})}),[e,n]),i=t||a,{onChangeAttribute:o,onDeleteAttribute:l,onAddAttributes:s,onTogglePin:c}=_G({attributeValue:i,onChange:r}),u=(0,Rp.useCallback)(PG(i.uri,c),[i.uri,c]);return _p().createElement(pU,{attributeType:e,attributeValue:i,showEmptyEditors:!0,mode:v.Mode.Editing,metadata:n,onAddAttributes:s,onDeleteAttribute:l,onChangeAttribute:o,hideDeleteButton:!0,additionalControlsRenderer:u})};function LG(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const UG=({attributeType:e,attributeValue:t,onChange:r})=>{const n=(0,Pp.useSelector)(A().selectors.getMetadata),a=(0,Rp.useMemo)((()=>{const t=(0,v.getEditableAttributeTypeSubAttributes)(n,e),r=(0,v.createNewAttribute)({parentUri:"entities/fakeEntity",attributeType:e});return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){LG(e,t,r[t])}))}return e}({},r,{value:(0,v.createDefaultValues)({attributeTypes:t,parentUri:r.uri,metadata:n,mode:v.Mode.Editing})})}),[e,n]),i=t||a,{onChangeAttribute:o,onDeleteAttribute:l,onAddAttributes:s,onTogglePin:c}=_G({attributeValue:i,onChange:r}),u=(0,Rp.useCallback)(PG(i.uri,c),[i.uri,c]);return _p().createElement(nj,{attributeType:e,attributeValue:i,showEmptyEditors:!0,mode:v.Mode.Editing,metadata:n,onAddAttributes:s,onDeleteAttribute:l,onChangeAttribute:o,hideDeleteButton:!0,additionalControlsRenderer:u})},jG=({operation:e,attributeType:t,attributeValue:r,onChange:n})=>e===Xn.d.RepointReference?_p().createElement(CG,{attributeType:t,value:r,onChange:n}):(0,v.isNested)(t)?_p().createElement(kG,{attributeType:t,attributeValue:r,onChange:n}):(0,v.isReference)(t)?_p().createElement(UG,{attributeType:t,attributeValue:r,onChange:n}):null,FG=(0,O.curry)(((e,t,r)=>(0,O.assoc)(t,(0,O.prop)(e,r),(0,O.dissoc)(e,r)))),MG=(0,O.pipe)((0,O.pick)(["fieldName","title","pathToTitle","attrType"]),FG("attrType","attributeType")),VG=(0,O.unless)(O.isNil,FG("attributeType","attrType")),BG="17px",zG="34px",HG="1px solid #e4e4e4",YG=(0,qp.Z)((e=>({mainRowContent:{display:"flex",alignItems:"center","&>*":{marginRight:8}},row:{borderBottom:HG,padding:`${BG} ${zG}`,"&:last-child":{borderBottom:"none"},"&$withoutLine":{borderBottom:"none",paddingTop:"9px",paddingBottom:"9px"}},withoutLine:{},attrSelector:{width:254,height:40,flexShrink:0},operationSelector:{width:190,marginRight:26,flexShrink:0},icons:{flexGrow:0,marginLeft:-5,display:"flex"},actionIcon:{marginRight:2},actionIconActive:{"& svg > g > path":{fill:e.palette.primary.main,fillOpacity:1}}}))),WG={enabled:!0,queueSizeThreshold:5},GG=({id:e,operation:t,operationParameters:r,groupId:n,groupAttributeType:a,hasConditions:i})=>{const o=YG(),l=(0,Pp.useDispatch)(),s=(0,Pp.useSelector)(cu),c=(0,ni.l0)(s),{pin:u,addNestedAttribute:p,attributeTypeData:d}=r||{},{attributeType:m}=d||{},f=t&&d,y=(0,Rp.useCallback)((({attribute:t,checked:r})=>{r&&l((({id:e,groupId:t,attribute:r})=>({type:Un,payload:{id:e,groupId:t,attribute:r}}))({id:e,groupId:n,attribute:MG(t)}))}),[e,n,l]),g=(0,Rp.useCallback)((t=>{l(Pc({id:e,groupId:n,operationParameters:{attributeValue:t}}))}),[l,e,n]),h=(0,Rp.useCallback)((()=>{l((({id:e,groupId:t})=>({type:qn,payload:{id:e,groupId:t}}))({id:e,groupId:n}))}),[e,n,l]),E=(0,Rp.useCallback)((()=>{l((({id:e,groupId:t})=>({type:Zn,payload:{id:e,groupId:t}}))({id:e,groupId:n}))}),[e,n,l]),b=(0,Rp.useCallback)((()=>{l(Nc({id:e,groupId:n}))}),[e,n,l]),T=(0,Rp.useCallback)((t=>{l((({id:e,groupId:t,operation:r})=>({type:jn,payload:{id:e,groupId:t,operation:r}}))({id:e,groupId:n,operation:t.value}))}),[e,n,l]),S=(0,v.isComplexAttribute)(m)&&[Xn.d.AddNew,Xn.d.ReplaceAllWith,Xn.d.RepointReference].includes(t),x=[Xn.d.AddNew,Xn.d.ReplaceAllWith,Xn.d.FindAndReplace].includes(t)&&!(null==m||!m.uri),C=a&&m&&m.uri===a.uri,w=n&&!C&&t===Xn.d.AddNew&&!(0,v.isReference)(a),A=(0,Rp.useMemo)((()=>{return m?(e=m,t=i&&C,(0,O.cond)([[(0,O.both)(v.isNested,(0,O.always)(t)),(0,O.always)((0,O.without)([Xn.d.AddNew,Xn.d.ReplaceAllWith],B.DY))],[v.isNested,(0,O.always)(B.DY)],[(0,O.both)(v.isReference,(0,O.always)(t)),(0,O.always)((0,O.without)([Xn.d.AddNew],B.hS))],[v.isReference,(0,O.always)(B.hS)],[O.T,(0,O.always)(B.pG)]])(e)).map((e=>({value:Xn.d[e],label:B.WN[e]}))):[];var e,t}),[i,m,C]),R=(0,Rp.useMemo)((()=>A.find((e=>e.value===t))),[t,A]),_=(0,Rp.useMemo)((()=>VG(d)),[d]),I=(0,Rp.useCallback)(a?(0,OW.xM)(a):(0,O.ifElse)(OW.XF,(0,O.pipe)((0,O.pathEq)(["fieldName"],"tags")),(0,O.pipe)((0,O.prop)("attrType"),(0,O.both)((0,O.complement)(v.isImage),(0,O.complement)(v.isAnalyticAttribute)))),[a]),N=(0,Rp.useCallback)((e=>(0,v.getSearchGroupAttributeLabel)({data:e})),[]);return(0,Rp.useEffect)((()=>{!R&&A[0]&&d&&T(A[0])}),[A,R,d,T]),(0,Rp.useEffect)((()=>{u&&!x&&h()}),[x,u,h]),(0,Rp.useEffect)((()=>{p&&!w&&E()}),[w,p,E]),_p().createElement("div",{"data-reltio-id":"bulk-update-dialog-action-row",className:kp()(o.row,{[o.withoutLine]:!!n})},_p().createElement("div",{className:o.mainRowContent},_p().createElement(CW,{className:o.attrSelector,single:!0,showReferencedEntityAttributes:!1,entityTypes:c,value:_,onSelect:y,firstLevelAttributesFilter:I,ungroup:!!n,getLabel:N}),_p().createElement(Pj,{label:"",isDisabled:!_,placeholder:li().text("Select operation"),className:o.operationSelector,value:R,options:A,height:40,onChange:T}),f&&_p().createElement(_p().Fragment,null,!S&&_p().createElement(SG,{id:e,groupId:n,operation:t,operationParameters:r}),_p().createElement("div",{className:o.icons},x&&_p().createElement(Bd.k,{className:kp()(o.actionIcon,{[o.actionIconActive]:u}),size:"M",tooltipTitle:li().text("Make this Operational Value"),icon:gG,onClick:h}),w&&_p().createElement(Bd.k,{className:kp()(o.actionIcon,{[o.actionIconActive]:p}),size:"M",tooltipTitle:li().text("Create parent attribute if none exists"),icon:EG,onClick:E}),_p().createElement(Bd.k,{size:"M",tooltipTitle:li().text("Delete"),icon:zp(),onClick:b})))),f&&S&&_p().createElement(jL.Provider,{value:WG},_p().createElement(jG,{operation:t,attributeType:m,attributeValue:r.attributeValue,onChange:g})))},qG=(0,Rp.memo)(GG);var ZG=r(80510),$G=r.n(ZG);function KG(){return KG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},KG.apply(null,arguments)}const XG=e=>{let{attributeType:t,showReferencedEntityAttributes:r,subattributesGroupTitle:n,additionalItemsGroups:a}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeType","showReferencedEntityAttributes","subattributesGroupTitle","additionalItemsGroups"]);const o=(0,Pp.useSelector)(A().selectors.getMetadata),l=t.uri.split("/").slice(0,3).join("/"),s=(0,ni.l0)(l),c=(0,Rp.useCallback)((0,OW.xM)(t),[t]),u=(0,Rp.useMemo)((()=>(0,O.pipe)(OW.s1,(0,O.when)((0,O.always)(!r),OW.a),(0,O.map)((0,O.evolve)({attributes:(0,O.pathOr)([],[0,"children"]),title:(0,O.when)((0,O.always)(n),(0,O.always)(n))})),(0,O.when)((0,O.always)(a),(0,O.concat)(a)))({firstLevelAttributesFilter:c},o,s)),[a,n,r,s,o,c]);return _p().createElement(TW,KG({},i,{ungroup:!a,itemsGroups:u}))},QG=(0,Rp.memo)(XG);function JG(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){eq(e,t,r[t])}))}return e}function eq(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const tq=(e,t)=>(0,La.nT)(`${B.E_}_group`,li().text("Profile"),[JG({},(0,La.o)(JG({title:(0,v.getEntityTypeLabel)(t,{type:(0,v.getReferencedEntityTypeUriFromAttrType)(e)}),fieldName:B.E_},e)),{enforcedFilterOptions:[v.FilterOptions.EQUALS]})]),rq=(0,qp.Z)({selector:{width:"254px",height:"40px"}}),nq=(0,Rp.memo)((({rowData:e,rowContext:{attributeType:t,dispatchGroupAction:r},attributeSelectorProps:n={}})=>{const a=rq(),i=(0,Pp.useSelector)(A().selectors.getMetadata),o=e&&e.id,l=(0,Rp.useMemo)((()=>(0,v.isReference)(t)?[tq(t,i)]:null),[t,i]),s=(0,Rp.useCallback)((e=>{r(Uc,o,e)}),[o,r]);return _p().createElement(QG,{className:a.selector,value:e&&e.data,attributeType:t,additionalItemsGroups:l,subattributesGroupTitle:(0,v.isReference)(t)?li().text("Reference attributes"):"",onSelect:s,onRestoreFocus:n.onRestoreFocus,onOpenPopup:n.onOpen,disableRestoreFocus:n.disablePopoverRestoreFocus,disableEnforceFocus:n.disablePopoverRestoreFocus})}));nq.displayName="ConditionAttributeSelector";const aq=e=>!(e&&e.data),iq=(0,O.pathEq)(["data","fieldName"],B.E_),oq=(0,qp.Z)({selector:{width:"190px"}}),lq=(0,Rp.memo)((({rowData:e,rowContext:{dispatchGroupAction:t},textFieldInputRef:r})=>{const n=oq(),a=e&&e.id,i=(0,Rp.useCallback)((e=>t(Fc,a,e.value)),[t,a]);return _p().createElement(LW,{height:40,className:n.selector,attribute:e,textFieldInputRef:r,isDisabled:aq(e),onChange:i})}));lq.displayName="ConditionFilterSelector";const sq=(0,qp.Z)({input:{margin:0,borderRadius:"4px"},root:{borderRadius:"4px 4px 0 0",padding:0,display:"flex",alignItems:"center",margin:0},entitySelector:{width:"100%"},entitySelectorLabel:{"&:not($entitySelectorLabelShrink)":{transform:"translate(12px, 10px)"}},entitySelectorLabelShrink:{}}),cq=(0,Rp.memo)((({condition:e,dispatchGroupAction:t})=>{const{values:r=[],data:{attrType:n,fieldName:a}={},filter:i}=e,o=sq(),l=(0,Pp.useSelector)(A().selectors.getMetadata),s=(0,Pp.useSelector)((e=>A().selectors.getGlobalSearchRequestOptions(e,["ovOnly"]))),c=(0,Rp.useCallback)((r=>t(Mc,e.id,r)),[t,e.id]),u=(0,Rp.useCallback)((({uri:e,type:t,label:r})=>{c([{entityUri:e,entityType:t,entityLabel:r}])}),[c]),p=(0,v.getAttrDataTypeDefinition)(n),d=(0,v.getDataTypeDefinitionForFilterValue)(p,i);return iq(e)?_p().createElement(JU,{className:o.entitySelector,entity:r[0],entityTypesUris:(0,ni.l0)((0,v.getReferencedEntityTypeUriFromAttrType)(n)),metadata:l,mode:v.Mode.Editing,globalSearchRequestOptions:s,onChange:u,height:40,disableLinkClick:!0,TextFieldProps:{InputLabelProps:{classes:{root:o.entitySelectorLabel,shrink:o.entitySelectorLabelShrink}}}}):_p().createElement(FW.n,{filter:{filter:i,fieldName:a,values:r||[]},onChange:c,dataTypeDefinition:d,fullWidth:!0,TextFieldProps:{InputProps:{classes:{root:o.input}}},color:"primary",classes:{root:o.root},orientation:"horizontal"})}));cq.displayName="ConditionValuesEditor";const uq=(0,qp.Z)({root:{width:"100%",display:"flex",minHeight:"40px",alignItems:"flex-start",boxSizing:"border-box"}}),pq=(0,Rp.memo)((({rowData:e,rowContext:{dispatchGroupAction:t}})=>{const r=uq(),n=aq(e),a=e&&(0,v.checkIfOptionHasValues)(e.filter);return _p().createElement("div",{className:r.root},!n&&a&&_p().createElement(cq,{condition:e,dispatchGroupAction:t}))}));pq.displayName="ConditionValuesEditorWrapper";const dq=(0,qp.Z)({root:{paddingTop:"8px",height:"24px",display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:"0"}}),mq=(0,Rp.memo)((({rowData:e,rowContext:{dispatchGroupAction:t}})=>{const r=dq(),n=e&&e.id,a=(0,Rp.useCallback)((()=>t(jc,n)),[n,t]);return e?_p().createElement("div",{className:r.root},_p().createElement(Bd.k,{tooltipTitle:li().text("Delete"),tooltipPlacement:"bottom",icon:zp(),size:"M",onClick:a})):null}));mq.displayName="ConditionActions";const fq=(0,qp.Z)((e=>({row:{"&:hover $actions":{opacity:1}},logicOperatorContainer:{maxHeight:"40px"},caption:{color:e.palette.text.secondary},conditions:{backgroundColor:"rgba(0,0,0,0.032)",padding:"20px 15px",margin:"7px 0"},actions:{opacity:"0",transition:"opacity 0.3s"}}))),yq=({attributeType:e,conditions:t,groupId:r})=>{const n=fq(),a=(0,Pp.useDispatch)(),i=(0,Rp.useCallback)(((e,...t)=>a(e(r,...t))),[r,a]),o=(0,Rp.useMemo)((()=>({root:n.row,logicOperatorContainer:n.logicOperatorContainer,actionsContainer:n.actions})),[n]);return _p().createElement(_p().Fragment,null,_p().createElement(zf(),{variant:"caption",component:"div",className:n.caption},li().text("If the following conditions are met")),_p().createElement(RY,{className:n.conditions,rowClasses:o,rowsData:t,AttributeSelectorComponent:nq,FilterSelectorComponent:lq,ValuesEditorComponent:pq,ActionsComponent:mq,attributeType:e,dispatchGroupAction:i}),_p().createElement(zf(),{variant:"caption",component:"div",className:n.caption},li().text("Then perform the change")))},gq=(0,qp.Z)((e=>({complexRow:{borderBottom:HG,padding:`10px ${zG} ${BG}`,"&:last-child":{borderBottom:"none"}},header:{display:"flex",alignItems:"center",marginBottom:"4px"},actionsBlock:{marginTop:"2px",marginLeft:`-${zG}`,marginRight:`-${zG}`},attributeLabel:{fontSize:"14px",fontWeight:500,color:e.palette.text.secondary},conditionsToggleButton:{marginTop:"1px",marginLeft:"6px",display:"flex",alignItems:"center"},conditionsToggleIcon:{marginRight:"8px",width:"18px",height:"18px",marginTop:"-1px"}})));function hq(){return hq=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hq.apply(null,arguments)}const Eq=(0,Rp.memo)((({id:e,fieldName:t,actions:r,conditions:n})=>{const a=gq(),i=(0,Pp.useDispatch)(),o=(0,Pp.useSelector)(cu),l=(0,Pp.useSelector)(A().selectors.getMetadata),s=(0,Rp.useMemo)((()=>{const e=(0,v.searchUriToAttrUri)(t,o);return(0,v.findAttributeTypeByUri)(l,e,o)}),[l,t,o]),c=!!n,u=((e,t)=>(0,O.any)((0,O.both)((0,O.pipe)((0,O.prop)("operation"),(0,O.includes)(O.__,[Xn.d.AddNew,Xn.d.ReplaceAllWith])),(0,O.pathEq)(["operationParameters","attributeTypeData","attributeType","uri"],t.uri)))(e))(r,s),p=(0,Rp.useCallback)((()=>i({type:Vn,payload:e})),[e,i]),d=(t={})=>_p().createElement(qG,hq({key:t.id},t,{groupId:e,groupAttributeType:s,hasConditions:c}));return(0,Rp.useEffect)((()=>{c||0!==r.length||i(Nc({id:e,groupId:void 0}))}),[e,c,r.length,i]),_p().createElement("div",{className:a.complexRow},_p().createElement("div",{className:a.header},_p().createElement("div",{className:a.attributeLabel},s.label),_p().createElement(hE(),{disabled:u,color:"primary",className:a.conditionsToggleButton,onClick:p},c?_p().createElement(_p().Fragment,null,_p().createElement($G(),{className:a.conditionsToggleIcon}),li().text("Remove")," "):_p().createElement(_p().Fragment,null,_p().createElement(EY(),{className:a.conditionsToggleIcon}),li().text("Add")," "),li().text("conditions"))),n&&_p().createElement(yq,{attributeType:s,conditions:n,groupId:e}),_p().createElement("div",{className:a.actionsBlock},r.map(d),d()))}));Eq.displayName="ComplexActionRow";const bq=(0,qp.Z)({wrapper:{flexGrow:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"flex-start",backgroundColor:"#fafafa",boxSizing:"border-box",padding:30},container:{width:"100%",flex:"1 1 auto",maxWidth:1320,backgroundColor:"white",borderRadius:2,padding:"16px 0 50px",display:"flex",flexDirection:"column"}});function vq(){return vq=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vq.apply(null,arguments)}const Tq=e=>"actions"in e?_p().createElement(Eq,vq({key:e.id},e)):_p().createElement(qG,vq({key:e.id},e)),Oq=()=>{const e=bq(),t=(0,Pp.useSelector)(xu);return _p().createElement("div",{className:e.wrapper},_p().createElement("div",{className:e.container},t.map(Tq),_p().createElement(qG,null)))};var Sq=r(99261),xq=r.n(Sq),Cq=r(26518),wq=r.n(Cq),Aq=r(60158),Rq=r.n(Aq),_q=r(61887),Iq=r.n(_q);const Nq=(0,qp.Z)((()=>({buttonWrapper:{position:"relative"},progress:{position:"absolute",left:"calc(50% - 12px)",top:"calc(50% - 12px)"}})));function Pq(){return Pq=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Pq.apply(null,arguments)}const Dq=e=>{let{isInProgress:t,disabled:r,circularColor:n="primary",className:a,children:i}=e,o=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["isInProgress","disabled","circularColor","className","children"]);const l=Nq();return _p().createElement(hE(),Pq({},o,{className:kp()(l.buttonWrapper,a),disabled:r||t}),i,t&&_p().createElement("div",{className:l.progress,"data-reltio-id":"reltio-circular-load-indicator"},_p().createElement(Lm(),{size:24,color:n})))},kq=(0,qp.Z)((()=>({container:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"},placeholder:{flex:1},stepper:{padding:"0 24px",flex:2},stepButton:{margin:"-20px -16px",padding:"20px 16px","& svg text":{textAnchor:"middle"}},buttons:{flex:1,display:"flex",justifyContent:"flex-end"},backButton:{marginRight:"8px",border:"1px solid rgba(0, 0, 0, 0.23)"},errorLabel:{color:"#dd2c00 !important"},warningLabel:{color:"#f9a825 !important"}}))),Lq=({activeStep:e,steps:t,isPending:r=!1,shouldCompleteSteps:n=!0,onConfirm:a,onChangeStep:i})=>{const o=kq(),l=e===t.length-1,s=t=>{t!==e&&i(t)},c=(0,O.propOr)(!0,"enabled"),u=e=>{if(e>0){const r=e-1;c(t[r])?s(r):u(r)}},p=e=>{if(e<t.length-1){const r=e+1;c(t[r])?s(r):p(r)}},d=l&&!!a,m=d||(0,O.any)(c,(0,O.drop)(e+1,t));return _p().createElement("div",{className:o.container},_p().createElement("div",{className:o.placeholder}),_p().createElement(xq(),{nonLinear:!0,activeStep:e,className:o.stepper},t.map((({label:t,enabled:a=!0,hasError:i,hasWarning:l},c)=>{const u=!a||r,p=n&&!u&&c<e;return _p().createElement(wq(),{key:t,completed:p,disabled:u},_p().createElement(Rq(),{className:o.stepButton,onClick:()=>s(c),"data-reltio-id":`reltio-search-bulk-update-${c}`},_p().createElement(Iq(),{error:i||l,classes:{error:i?o.errorLabel:o.warningLabel}},t)))}))),_p().createElement("div",{className:o.buttons},e>0&&_p().createElement(hE(),{variant:"outlined",className:o.backButton,onClick:()=>u(e),disabled:r,"data-reltio-id":"reltio-search-bulk-update-back"},li().text("Back")),_p().createElement(Dq,{variant:"contained",color:"primary",disabled:!m,isInProgress:r,onClick:l?a:()=>p(e),"data-reltio-id":"reltio-search-bulk-update-"+(l?"confirm":"continue")},d?li().text("Confirm"):li().text("Continue"))))},Uq=()=>{const e=(0,Pp.useDispatch)(),t=(0,Pp.useSelector)(lu),r=(0,Pp.useSelector)(Su),n=(0,Pp.useSelector)(ou),a=!(0,O.isNil)(n),i=(0,Pp.useSelector)(Au),o=(0,Pp.useSelector)(Ru),l=[{label:li().text("Select profiles")},{label:li().text("Select operation"),enabled:r},{label:li().text("Define changes"),enabled:r&&a&&n===B.dV.UpdateProfiles},{label:li().text("Review changes"),enabled:r&&a&&(i||n===B.dV.DeleteProfiles)}];return _p().createElement(Lq,{activeStep:t,steps:l,isPending:o,onChangeStep:t=>e((e=>({type:Tn,payload:e}))(t)),onConfirm:()=>e({type:$n})})},jq=(0,qp.Z)((()=>({appBar:{boxShadow:"none"},toolbar:{background:"white",borderBottom:"1px solid rgba(0,0,0,0.1)",boxSizing:"border-box",paddingLeft:"21px"},title:{fontSize:"1.1rem",display:"inline-flex",alignItems:"center"},closeButton:{marginRight:"10px"}}))),Fq=({children:e,onClose:t})=>{const r=jq();return _p().createElement(YF(),{position:"static",color:"default",className:r.appBar},_p().createElement(GF(),{className:r.toolbar},_p().createElement(Bd.k,{edge:"start",tooltipTitle:li().text("Close"),"aria-label":li().text("Close"),icon:zp(),onClick:t,className:r.closeButton,size:"L","data-reltio-id":"reltio-search-bulk-update-close"}),_p().createElement(zf(),{variant:"h6",className:r.title},e)),_p().createElement(GF(),{className:r.toolbar},_p().createElement(Uq,null)))};Fq.propTypes={children:Np().node,onClose:Np().func};const Mq=Fq,Vq=(0,qp.Z)((()=>({tableContainer:{position:"relative",height:"100%",display:"flex",flexDirection:"column",backgroundColor:"#fff"},pagination:{flexGrow:0,borderTop:"1px solid rgba(0, 0, 0, 0.1)",height:"52px",boxShadow:"none"}}))),Bq=(0,O.equals)(B.v6.include);function zq(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Hq=()=>{const e=Vq(),t=(0,Pp.useDispatch)(),r=(0,Pp.useSelector)(A().selectors.getMetadata),n=(0,Pp.useSelector)(cu),a=(0,Pp.useSelector)(bu),i=(0,Pp.useSelector)(mu),o=(0,Pp.useSelector)(hu),l=(0,Pp.useSelector)(Eu),s=(0,Pp.useSelector)(pu),c=(0,Pp.useSelector)(yu),u=(0,Pp.useSelector)(gu),p=(0,Pp.useSelector)(su),d=(0,Pp.useSelector)(fu),m=(0,Pp.useSelector)(du),f=(0,Rp.useMemo)((()=>((e,t,r)=>(0,O.pipe)((0,O.map)((0,O.prop)("uri")),Bq(e)?(0,O.intersection)(t):(0,O.without)(t))(r))(m,d,i)),[m,d,i]),y=((e,t)=>0!==e.length&&(e.length===t.length||null))(f,i),g=(0,Rp.useMemo)((()=>(0,Di.oq)(r,n,a)),[r,n,a]),h=(0,Rp.useCallback)((({field:e,order:r})=>t((({field:e,order:t})=>({type:_n,payload:{field:e,order:t}}))({field:r?e:null,order:r}))),[t]),E=(0,Rp.useCallback)((({what:e,where:r})=>{const n=(0,O.move)(e.columnIndex,r.columnIndex,a);t(Rc(n))}),[t,a]),b=(0,Rp.useCallback)((({columns:e})=>{const r=(0,Di.tU)(e,a);t(Rc(e)),r&&t(xc())}),[t,a]),v=(0,Rp.useCallback)((e=>{const r=a.map(((t,r)=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){zq(e,t,r[t])}))}return e}({},t,{size:e[r].size})));t(Rc(r))}),[t,a]),T=(0,Rp.useCallback)(((e,r)=>{t(e?((e,t)=>({type:xn,payload:{uri:e,checked:t}}))(e,r):{type:Cn,payload:!y})}),[y,t]),S=(0,Rp.useRef)(null);return _p().createElement("div",{className:e.tableContainer},p&&_p().createElement(XE.z,null),_p().createElement(_f,{entities:i,entityTypeUri:n,headColumns:a,additionalColumns:g,canCheck:!0,onCheck:T,checkedEntitiesUris:f,headerCheckboxState:y,dndColumnReorderingEnabled:!0,sortField:o,sortOrder:l,onSort:h,onReorderingColumn:E,onChangeColumnsList:b,onChangeColumnsSize:v,entitiesTableRef:S}),s>B.Tu[0]&&_p().createElement("div",{className:e.pagination},_p().createElement(BE.Z,{count:s,rowsPerPageOptions:B.Tu,rowsPerPage:u||B.Tu[0],page:c||0,onChangePage:e=>t(Ac(e)),onChangeRowsPerPage:e=>t((e=>({type:An,payload:e}))(e)),basicTableRef:S})))},Yq=(0,qp.Z)((e=>({tableContainer:{display:"flex",flexDirection:"column",backgroundColor:"#fff",width:"100%",margin:"30px 60px",padding:"24px"},title:{fontSize:"14px",fontWeight:500,letterSpacing:"0.1px",lineHeight:"24px",color:e.palette.text.secondary,marginBottom:"6px"},label:{color:e.palette.text.secondary,fontSize:"14px",letterSpacing:0,lineHeight:"32px",paddingLeft:"7px"},radioButton:{padding:"0 9px"}}))),Wq=()=>{const e=Yq(),t=(0,Pp.useDispatch)(),r=(0,Pp.useSelector)(ou),n=(0,Pp.useSelector)(A().selectors.getCanUserDeleteProfiles);(0,Rp.useEffect)((()=>{(0,O.isNil)(r)&&t(Ic(B.dV.UpdateProfiles))}),[r,t]);const a=(0,O.pipe)(Wp.NA,Ic,t);return _p().createElement("div",{className:e.tableContainer},_p().createElement(zf(),{className:e.title},li().text("Choose Bulk Update Operation")),_p().createElement(Hh(),{value:r,onChange:a},_p().createElement(Wh(),{classes:{label:e.label},value:B.dV.UpdateProfiles,control:_p().createElement(Bh(),{className:e.radioButton}),label:li().text("Update Profiles - Update attribute values of selected profiles")}),_p().createElement(Wh(),{disabled:!n,classes:{label:e.label},value:B.dV.DeleteProfiles,control:_p().createElement(Bh(),{className:e.radioButton}),label:li().text("Delete Profiles - Delete selected profiles")})))};var Gq=r(49850),qq=r.n(Gq),Zq=r(28012),$q=r.n(Zq),Kq=r(18878),Xq=r.n(Kq),Qq=r(70918),Jq=r.n(Qq),eZ=r(51159),tZ=r.n(eZ),rZ=r(35681),nZ=r.n(rZ);const aZ=({value:e,attributeType:t,lookups:r})=>((0,v.isLookupAttrType)(t)&&"string"==typeof e&&(e={lookupCode:e,value:(0,v.getResolvedLookupValue)(r,(0,v.getAttrTypeLookupCode)(t),e)}),_p().createElement(um.x,{dataTypeDefinition:(0,v.getAttrDataTypeDefinition)(t),value:e})),iZ=({operation:e})=>_p().createElement(_p().Fragment,null,B.WN[e]),oZ=({conditions:e,attributesPresentation:t,metadata:r,lookups:n})=>{if((0,v.isEmptyValue)(e))return _p().createElement(_p().Fragment,null,"-");const a=(0,v.buildAttributesReadableQuery)(r,t,n,e,!1);return _p().createElement(dG.B,{readableQuery:a})},lZ="8px",sZ="1px",cZ=`${sZ} solid #AFD4E9`,uZ=(0,qp.Z)((e=>({scaffoldsContainer:{height:"calc(100% + 24px)",margin:"-12px 0"},scaffold:{width:"32px",height:"100%",position:"relative",display:"inline-block",verticalAlign:"middle"},scaffoldFullVert:{"&:before":{content:'""',position:"absolute",display:"block",boxSizing:"border-box",height:"100%",width:sZ,left:lZ,top:0,borderLeft:cZ}},scaffoldHalfVert:{"&:before":{content:'""',position:"absolute",display:"block",boxSizing:"border-box",height:"50%",width:sZ,left:lZ,top:0,borderLeft:cZ}},scaffoldHor:{"&:after":{content:'""',position:"absolute",display:"block",boxSizing:"border-box",height:sZ,width:"5px",left:lZ,top:"50%",borderBottom:cZ}},noWrapContainer:{display:"inline-flex",verticalAlign:"middle",height:"100%",alignItems:"center","& > *":{flexShrink:0}},optionContainer:{width:"20px","& svg g path":{fill:e.palette.primary.main,fillOpacity:1},"& + &":{paddingLeft:"4px"}},opaque:{opacity:0},newIcon:{color:"#599E0E",marginLeft:"10px",borderRadius:"16px",padding:"2px 12px",border:"2px solid rgba(89,158,14,0.3)",fontSize:"10px",lineHeight:"16px"},nestedLabel:{width:"100%"}}))),pZ=({attributeTypeData:{pathToTitle:e,title:t}})=>{const r=uZ();return Boolean(e&&e.length>2)?_p().createElement(kg,{placement:"bottom-start",pathToTitle:e},_p().createElement("span",{className:r.nestedLabel},t)):_p().createElement(_p().Fragment,null,t)};function dZ(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function mZ(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){fZ(e,t,r[t])}))}return e}function fZ(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const yZ={EMPTY:"empty",FULL_VERT:"full_vert",FULL_VERT_HOR:"full_vert_hor",HALF_VERT_HOR:"half_vert_hor"},gZ=e=>e.map(((t,r)=>(({hasLowerSubAttrs:e,isFirstValue:t,isLastScaffold:r})=>{const n=r&&t;return e?n?yZ.FULL_VERT_HOR:yZ.FULL_VERT:n?yZ.HALF_VERT_HOR:yZ.EMPTY})(mZ({},t,{isLastScaffold:r===e.length-1})))),hZ=({operation:e,operationParameters:t})=>(0,v.wrapInArrayIfNeeded)(mZ({},t,{operation:e})),EZ=(e,t,r=[],n=[])=>{const a=(0,v.findAttributeTypeByUri)(e,t.type),i=a.label||a.name,o={attributeTypeData:{attributeType:a,title:i,pathToTitle:[...r,i]},scaffolds:gZ(n),pin:t.pin};if((0,v.isComplexAttribute)(a)){const a=Object.values(t.value),l=a.flatMap(((t,o)=>t.flatMap(((t,l)=>{const s={hasLowerSubAttrs:a.length-o-1>0,isFirstValue:0===l};return EZ(e,t,[...r,i],[...n,s])}))));return[o,...l]}return[mZ({},o,{attributeValue:(0,v.getAttributeValue)(t)})]},bZ=(0,O.curry)(((e,{operation:t,operationParameters:r})=>{const{attributeValue:n,attributeTypeData:a}=r,i=dZ(r,["attributeValue","attributeTypeData"]),[o,...l]=EZ(e,n,a.pathToTitle.slice(0,-1));return[mZ({},o,{operation:t},i),...l]})),vZ=(0,O.curry)(((e,{operation:t,operationParameters:r})=>{const{attributeValue:n,attributeTypeData:a}=r,i=dZ(r,["attributeValue","attributeTypeData"]),[o,...l]=EZ(e,n,a.pathToTitle.slice(0,-1)),{label:s,refEntity:c}=n,[{objectURI:u,type:p}]=c;return[mZ({},o,{operation:t},i,{attributeValue:{entityUri:u,entityLabel:s,entityType:p}}),...l]})),TZ=(0,O.curry)(((e,t)=>(0,O.cond)([[Jc,bZ(e)],[eu,vZ(e)],[O.T,hZ]])(t))),OZ=(0,O.curry)(((e,t)=>(0,O.pipe)((0,O.defaultTo)([]),(0,O.chain)((0,O.ifElse)(zc,(0,O.pipe)(Hc,OZ(e)),TZ(e))))(t))),SZ=({scaffold:e})=>{const t=uZ();return _p().createElement("div",{className:kp()(t.scaffold,{[t.scaffoldFullVert]:e===yZ.FULL_VERT||e===yZ.FULL_VERT_HOR,[t.scaffoldHalfVert]:e===yZ.HALF_VERT_HOR,[t.scaffoldHor]:e===yZ.FULL_VERT_HOR||e===yZ.HALF_VERT_HOR})})};SZ.propTypes={scaffold:Np().oneOf((0,O.values)(yZ))};const xZ=({scaffolds:e})=>{const t=uZ();return _p().createElement("div",{className:t.scaffoldsContainer},e.map(((e,t)=>_p().createElement(SZ,{key:t,scaffold:e}))))};xZ.propTypes={scaffolds:Np().arrayOf(SZ.propTypes.scaffold)};const CZ=xZ,wZ=({children:e})=>{const t=uZ();return _p().createElement("div",{className:t.noWrapContainer},e)};wZ.propTypes={children:Np().node};const AZ=wZ,RZ=({pin:e,addParent:t})=>{const r=uZ();return _p().createElement(AZ,null,_p().createElement("div",{className:kp()(r.optionContainer,{[r.opaque]:!e})},_p().createElement(gG,null)),_p().createElement("div",{className:kp()(r.optionContainer,{[r.opaque]:!t})},_p().createElement(EG,null)))};RZ.propTypes={pin:Np().bool,addParent:Np().bool};const _Z=RZ,IZ=({entity:{entityLabel:e,entityUri:t},attributeType:r})=>{const n=uZ(),a=(0,Pp.useSelector)((e=>A().selectors.getModifiedEntity(e,t)))||null,i=(0,Pp.useSelector)(A().selectors.getMetadata),o=(0,Rp.useCallback)((()=>{const e=(0,v.getReferencedEntityTypeUriFromAttrType)(r),t=(0,v.getEntityType)(i,e);return(0,v.evaluateDeepEntityLabel)(a,t.dataLabelPattern)}),[r,i,a]),l=a?o():e;return _p().createElement(AZ,null,(0,v.getLabel)(l),(0,v.isTempUri)(t)&&_p().createElement("div",{className:n.newIcon},li().text("New")))},NZ=(0,qp.Z)((()=>({tableContainer:{width:"90%",maxWidth:"1320px",margin:"30px auto",boxShadow:"0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.2)"},table:{height:0,"& td, & th":{padding:"12px",overflowWrap:"anywhere"},"& th":{fontSize:"12px"},"& td":{fontSize:"13px"},"& tr":{"& > *:first-child":{paddingLeft:"24px"},"& > *:last-child":{paddingRight:"24px"}}},attributeColumn:{width:"35%"},conditionColumn:{width:"20%"},operatorColumn:{width:"10%"},valueColumn:{width:"15%"},optionsColumn:{width:"5%"}}))),PZ=()=>{const e=NZ(),t=(0,Pp.useSelector)(Cu),r=(0,Pp.useSelector)(A().selectors.getMetadata),n=(0,Pp.useSelector)(A().selectors.getAttributesPresentation),a=(0,Pp.useSelector)(A().selectors.getLookups),i=(0,Rp.useMemo)((()=>OZ(r,t)),[t,r]);return _p().createElement(Jq(),{className:e.tableContainer,component:dN()},_p().createElement(qq(),{className:e.table},_p().createElement(tZ(),null,_p().createElement(nZ(),null,_p().createElement(Xq(),{className:e.attributeColumn},li().text("Attribute")),_p().createElement(Xq(),{className:e.conditionColumn},li().text("Condition")),_p().createElement(Xq(),{className:e.operatorColumn},li().text("Operator")),_p().createElement(Xq(),{className:e.valueColumn,colSpan:2}),_p().createElement(Xq(),{className:e.valueColumn}),_p().createElement(Xq(),{className:e.optionsColumn}))),_p().createElement($q(),null,i.map((({scaffolds:e,attributeTypeData:t,conditions:i,operation:o,attributeValueToFind:l,attributeValue:s,pin:c,addNestedAttribute:u},p)=>{const d=!(0,O.isNil)(s),m=!(0,O.isNil)(l);return _p().createElement(nZ(),{key:p},_p().createElement(Xq(),null,_p().createElement(AZ,null,e&&_p().createElement(CZ,{scaffolds:e}),_p().createElement(pZ,{attributeTypeData:t}))),_p().createElement(Xq(),null,_p().createElement(oZ,{attributesPresentation:n,metadata:r,lookups:a,conditions:i})),_p().createElement(Xq(),null,o&&_p().createElement(iZ,{operation:o})),_p().createElement(Xq(),null,m&&_p().createElement(aZ,{lookups:a,attributeType:t.attributeType,value:l})),_p().createElement(Xq(),{align:"right"},m&&d&&_p().createElement(AZ,null,_p().createElement("span",null,li().text("with")))),_p().createElement(Xq(),null,d&&((0,v.isReference)(t.attributeType)?_p().createElement(IZ,{entity:s,attributeType:t.attributeType}):_p().createElement(aZ,{lookups:a,attributeType:t.attributeType,value:s}))),_p().createElement(Xq(),{align:"right"},_p().createElement(_Z,{pin:c,addParent:u})))})))))},DZ=(0,qp.Z)((e=>({tableContainer:{display:"flex",flexDirection:"column",backgroundColor:"#fff",width:"100%",margin:"30px 60px",padding:"24px"},text:{paddingTop:"2px",paddingBottom:"1px","& p":{fontSize:"14px",lineHeight:"16px",margin:0,letterSpacing:0,color:e.palette.text.primary}}}))),kZ=()=>{const e=DZ(),t=(0,Pp.useSelector)(ou),r=(0,Pp.useSelector)(Ou);return t===B.dV.UpdateProfiles?_p().createElement(PZ,null):_p().createElement("div",{className:e.tableContainer},_p().createElement("div",{className:e.text},_p().createElement("p",null,`${li().text("Please confirm that you wish to start deletion of the selected")}`,_p().createElement("b",null,` ${li().number(r,"0,0")} `),li().text(" profiles.")),_p().createElement("p",null,li().text("Click on Confirm to proceed."))))},LZ=(0,qp.Z)((()=>({contentRoot:{padding:"0 0 5px",position:"relative",backgroundColor:"#FAFAFA"},tenantLabel:{marginLeft:"23px"}}))),UZ=()=>{const e=LZ(),t=(0,Pp.useSelector)(ki.Ue),r=(0,Pp.useSelector)(lu),n=(0,Pp.useDispatch)(),a=()=>n(Pi(!1));return _p().createElement(aF(),{fullScreen:!0,open:t,onClose:a,disableEnforceFocus:!0},_p().createElement(Mq,{onClose:a},li().text("Bulk update"),_p().createElement(pG,{className:e.tenantLabel})),_p().createElement(fG,null),_p().createElement(zF(),{classes:{root:e.contentRoot}},(()=>{switch(r){case 0:return _p().createElement(Hq,null);case 1:return _p().createElement(Wq,null);case 2:return _p().createElement(Oq,null);case 3:return _p().createElement(kZ,null)}})()))},jZ="1px solid rgba(0, 0, 0, 0.33)",FZ=(0,qp.Z)((e=>({root:{fontFamily:"Roboto, Helvetica, Arial, sans-serif",display:"flex",overflow:"hidden",position:"absolute",top:0,left:0,bottom:0,right:0},drawer:{flex:"0 0 288px!important"},docked:{flex:"0 0 288px"},drawerPaper:{width:288,display:"flex",flexDirection:"column",position:"relative",borderRight:jZ},mainContent:{transition:e.transitions.create("margin",{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen}),backgroundColor:"white",marginLeft:-288},"mainContent--shifted":{transition:e.transitions.create("margin",{easing:e.transitions.easing.easeOut,duration:e.transitions.duration.enteringScreen}),marginLeft:0},menuIcon:{width:"24px",height:"24px",flexShrink:0,marginRight:"12px"},goToActionIcon:{marginLeft:"12px"},buttonRoot:{flexShrink:0},buttonExtended:{width:"256px",margin:"8px 16px",padding:"12px",backgroundColor:"rgba(0,0,0,0)",boxShadow:"0 1px 1px 0 rgba(0,0,0,0.14), 0 2px 1px -1px rgba(0,0,0,0.12), 0 1px 3px 0 rgba(0,0,0,0.2)","&:hover":{backgroundColor:"rgba(0,0,0,0.1)"}},buttonLabel:{flexGrow:1,textAlign:"left",color:e.palette.text.secondary,fontSize:"14px",fontWeight:500,letterSpacing:0,lineHeight:"16px"},quickFilterRoot:{lineHeight:"16px",fontWeight:100,color:"rgba(0,0,0, 0.54)",letterSpacing:"normal",display:"flex",padding:"8px 0 16px 16px",flexShrink:0},withBottomBorder:{borderBottom:jZ,boxShadow:"0 1px 3px 0 rgba(0,0,0,0.12)"}}))),MZ=(0,Id.T)(Yf()),VZ=(0,Pp.connect)((e=>({isReadyAppData:!!(0,ki.$s)(e),openAdvancedSearch:(0,ki.IJ)(e),tenant:A().selectors.getTenant(e)})))((({openAdvancedSearch:e,isReadyAppData:t,tenant:r,dispatch:n})=>{const a=(0,Rp.useCallback)((()=>{n({type:R.k.CONVERT_FROM_ADVANCED_SEARCH}),n(Ti(!1))}),[n]),i=(0,Rp.useCallback)((()=>{n(Ti(!0)),n({type:ot})}),[n]),[o,l]=(0,Rp.useState)(!0),s=(0,Rp.useCallback)((e=>{l(e<=0)}),[]),c=FZ(),u=!e;return(0,Rp.useEffect)((()=>()=>v.memoizeWith.clearCache()),[r]),t?_p().createElement(_p().Fragment,null,_p().createElement("div",{className:c.root},_p().createElement(Vf,{variant:"persistent",anchor:"left",open:u,classes:{root:c.drawer,paper:c.drawerPaper,docked:c.docked},"data-reltio-id":"reltio-search-facet-search-panel"},_p().createElement(MZ,{tooltipTitle:li().text("Switch to Advanced search"),tooltipPlacement:"bottom-end",variant:"extended",classes:{root:c.buttonRoot,extended:c.buttonExtended},onClick:i,"data-reltio-id":"reltio-search-advanced-search-button"},_p().createElement(Gf(),{color:"primary",className:c.menuIcon}),_p().createElement("span",{className:c.buttonLabel},li().text("Advanced search")),_p().createElement(Zf(),{color:"action",className:c.goToActionIcon})),_p().createElement(zf(),{variant:"button",classes:{root:kp()(c.quickFilterRoot,{[c.withBottomBorder]:!o})}},li().text("Quick filters")),_p().createElement(oE,{onScroll:s})),_p().createElement(sE,{className:kp()(c.mainContent,{[c["mainContent--shifted"]]:u})},_p().createElement(lG,{isOpenAdvancedSearch:e,onCloseAdvancedSearch:a}))),_p().createElement(pE,null),_p().createElement(xE,null),_p().createElement(UZ,null)):null})),BZ=kf()({productionPrefix:"searchTable",disableGlobal:!0,seed:"srch"});v.userPreferencesComparator.register("searchState",((e,t)=>(0,v.looseEquals)((0,O.omit)(["query"],e),(0,O.omit)(["query"],t))));const zZ=()=>_p().createElement(If.DynamicModuleLoader,{modules:[Ap()]},_p().createElement(Uf(),{generateClassName:BZ},_p().createElement(Pf._,{dateAdapter:Nf.Q},_p().createElement(VZ,null))))}}]);
|