@reltio/segmentation 1.4.18 → 1.4.20

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/636.bundle.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_reltio_segmentation=self.webpackChunk_reltio_segmentation||[]).push([[636],{80636:(e,t,r)=>{r.r(t),r.d(t,{ConfigureColumnsButton:()=>jb,DEFAULT_SEARCH_SELECT:()=>ge,EntitiesTableWithConfigurableColumns:()=>ET,EntityAvatar:()=>A,ROWS_PER_PAGE_OPTIONS:()=>j,buildQueryForAdvancedSearchGroups:()=>it,buildSelectFromColumns:()=>cu,collectSpecialColumns:()=>eu,createRecentSearch:()=>If,default:()=>Y0,getActiveEntityTypeTab:()=>Cu,getAdditionalColumns:()=>Jc,getDataTenant:()=>cp,getEntityTypeLabel:()=>x.getEntityTypeLabel,getEntityTypeTab:()=>Ou,getModule:()=>vE,getPage:()=>ep,getRowsPerPage:()=>tp,getSearchResultsMode:()=>bu,getTotal:()=>Ju,needRequestAfterColumnsChanges:()=>uu,parseSearchState:()=>xm,queryBuilderHelpers:()=>n,queryBuilderSagas:()=>o,replaceSearchResultsColumns:()=>vm,showMoreResultsForEntityTypeAction:()=>Uc,showSavedSearchesDialogAction:()=>Ap});var n={};r.r(n),r.d(n,{PROP_NAME_FILTER:()=>ri,PROP_NAME_OPERATOR:()=>ei,PROP_NAME_VALUES:()=>ti,addAttributeAfter:()=>mi,changeAttributeData:()=>yi,createGetAttributeIndex:()=>ci,createGetAttributeLens:()=>ui,createGetAttributeProp:()=>di,createGetAttributesLens:()=>si,createGetGroupLens:()=>li,createSetAttributeProp:()=>pi,defaultFindGroupPath:()=>oi,deleteAttribute:()=>gi,duplicateAttribute:()=>hi,getAttributeData:()=>ii,getAttributeObject:()=>ai,getEmptyAttributeObject:()=>ni,setAttributeOperator:()=>fi,setFilter:()=>Ei,setValues:()=>bi});var a={};r.r(a),r.d(a,{ceil:()=>Ns,clamp:()=>ks,div:()=>xs,equals:()=>Ps,floor:()=>_s,greaterThan:()=>Cs,greaterThanOrEqualTo:()=>ws,lessThan:()=>As,lessThanOrEqualTo:()=>Rs,max:()=>Ds,min:()=>Is,minus:()=>Os,mul:()=>Ss,plus:()=>Ts,toFixed:()=>Ls});var i={};r.r(i),r.d(i,{ceil:()=>Ws,clamp:()=>$s,div:()=>Us,equals:()=>Zs,floor:()=>Ys,greaterThan:()=>Vs,greaterThanOrEqualTo:()=>Bs,lessThan:()=>zs,lessThanOrEqualTo:()=>Hs,max:()=>qs,min:()=>Gs,minus:()=>js,mul:()=>Ms,plus:()=>Fs,toFixed:()=>Ks});var o={};r.r(o),r.d(o,{toggleQueryBuilderAttributeSelect:()=>my});var l={};r.r(l),r.d(l,{addAttributes:()=>_w,addDefaultValuesAction:()=>Nw,addNextPageOfAttributeValues:()=>Pw,modifyAttribute:()=>Iw,processNextPageOfAttributeValues:()=>kw,profileSaved:()=>Uw,removeAttribute:()=>Dw,requestNextPageOfAttributeValues:()=>Lw,saveDraft:()=>jw,saveProfile:()=>Fw,validateProfile:()=>Mw});var s={};r.r(s),r.d(s,{dependentLookupsEditorTouched:()=>Yw,dependentLookupsEditorsBlocked:()=>Hw,dependentLookupsInitedTypeUrisAdded:()=>zw,dependentLookupsStructureSet:()=>Bw});var c={};r.r(c),r.d(c,{activityFilterUpdated:()=>cA,globalFilterUpdated:()=>uA,keywordUpdated:()=>oA,saveState:()=>sA,searchResultsSet:()=>iA,setSearchNavigationData:()=>yA,setSearchOptionsConfig:()=>dA,setSearchProviderData:()=>mA,updateSearchNavigationDataFields:()=>fA,updateSearchNavigationDataOnMerge:()=>gA,updateSearchOptions:()=>pA,updateState:()=>lA});var u={};r.r(u),r.d(u,{addDashboardExternalView:()=>nR,autocloseIntervalLoaded:()=>UA,clearNotifications:()=>DA,closeNotification:()=>IA,dateMaskUpdated:()=>WA,dateTimeMaskUpdated:()=>GA,documentationSet:()=>rR,entityDeletionFinished:()=>RA,errorSet:()=>tR,keysSet:()=>JA,localeAttributePresentationLoaded:()=>jA,localizationLoaded:()=>YA,navigateTo:()=>XA,newEntityShown:()=>AA,newUiConfigLoaded:()=>FA,numberFormatUpdated:()=>VA,openAppFromChocolateBar:()=>zA,openConsoleApp:()=>BA,openDashboard:()=>ZA,openEntity:()=>wA,openGraph:()=>HA,openHistoryEvent:()=>$A,openNewEntityWithAuthoring:()=>KA,openPerspective:()=>_A,openPivotingPerspective:()=>eR,openPreviousPage:()=>QA,openSearch:()=>qA,pathsSet:()=>PA,setPreferReact:()=>MA,setUseSharedPreferences:()=>aR,showNotification:()=>NA,uiConfigLoaded:()=>LA,uiPathSet:()=>kA});var p={};r.r(p),r.d(p,{getAbsoluteImagePath:()=>sI,getActiveErrorsForAttributesPager:()=>cN,getActivityFilter:()=>BN,getAdminToolsPath:()=>gN,getAiAssistantEnabled:()=>kN,getAiAssistantHistoryBufferSize:()=>jN,getAiAssistantLimitPerDay:()=>LN,getAiAssistantSkills:()=>FN,getAllRelationsToAddAndEdit:()=>nI,getAllRelationsToSave:()=>aI,getAllServicesPaths:()=>_I,getAllTreesEditingConnections:()=>hI,getApiPath:()=>pN,getAttributeTypeErrors:()=>lN,getAttributesErrors:()=>sN,getAttributesPresentation:()=>hN,getAttributesSortingStrategy:()=>VD,getAuthoringByEntityType:()=>zD,getAutoCloseInterval:()=>vN,getCanUserCreateWorkflowConfigJar:()=>jI,getCanUserCreateWorkflowEnvironmentConfigJar:()=>UI,getCanUserDeleteProfiles:()=>oD,getCanUserExecuteWorkflowJobs:()=>MI,getCanUserExecuteWorkflowJobsSyncBusinessProcessData:()=>VI,getCanUserExecuteWorkflowJobsTerminateProcessInstance:()=>BI,getCanUserExecuteWorkflowJobsUpdateTasks:()=>zI,getCanUserExecuteWorkflowJobsValidateTasks:()=>HI,getCanUserGetDQStatistic:()=>sD,getCanUserImportEntitiesFromDT:()=>rD,getCanUserMakeActivitiesExport:()=>tD,getCanUserMakeBulkUpdate:()=>iD,getCanUserMakeExport:()=>eD,getCanUserManageWorkflowDefinition:()=>YI,getCanUserManageWorkflowEnvironmentDefinition:()=>WI,getCanUserOpenDataLoader:()=>lD,getCanUserReadDVF:()=>cD,getCanUserReadEntitiesFromDT:()=>nD,getCanUserReadWorkflowDataTask:()=>GI,getCanUserRegisterConfigEnvironments:()=>FI,getCanUserStartProcessFromQuery:()=>aD,getCanUserUpdateProcessInstance:()=>qI,getCanUserUpdateWorkflowDataTask:()=>ZI,getCanUserViewProcessInstanceSearchQuery:()=>$I,getCanUserViewWorkflowConfigJar:()=>KI,getCanUserViewWorkflowDefinition:()=>QI,getCanUserViewWorkflowEnvironmentConfigJar:()=>XI,getCanUserViewWorkflowJobs:()=>JI,getCheckIfCanAddRelations:()=>wD,getCleanseByEntityType:()=>HD,getCollaborationPath:()=>DI,getConnectionsByViewId:()=>z_,getConnectionsTemporaryUrisForCreation:()=>q_,getConnectionsWithDraftsByViewId:()=>W_,getDBConnectorSideViews:()=>ED,getDVFPath:()=>PI,getDataTenants:()=>N_,getDateMask:()=>TN,getDateTimeMask:()=>ON,getDependentLookupEditorState:()=>SD,getDependentLookupEditorsState:()=>xD,getDependentLookups:()=>bD,getDependentLookupsInitedTypeUris:()=>OD,getDependentLookupsStructure:()=>vD,getDependentLookupsStructureNode:()=>TD,getDocReleaseNotes:()=>LD,getDraftsForSaveByViewId:()=>G_,getDtssPath:()=>wI,getEditingOrAddingConnectionByViewIdAndRelationUri:()=>H_,getEditingOrAddingConnectionRelationObjectByViewIdAndRelationUri:()=>Y_,getEntity:()=>M_,getEntityRelatedAttributesByAttributeTypeUri:()=>oN,getEntityUri:()=>V_,getEntityUriWithDataTenant:()=>B_,getEntityWithDiff:()=>AD,getEntityWithoutDiff:()=>RD,getEnvironment:()=>SI,getEnvironmentAlias:()=>CI,getEnvironmentObject:()=>k_,getExportDQPath:()=>AI,getExportPath:()=>dN,getGlobalFilter:()=>qN,getGlobalFilterQuery:()=>ZN,getGlobalFilterSavedSearchesUris:()=>$N,getGlobalSearchRequestOptions:()=>WN,getGoogleMapKey:()=>RN,getHeaderColor:()=>jD,getHistoryDiff:()=>X_,getHistoryEvent:()=>J_,getHistoryMode:()=>rN,getHistorySlice:()=>eN,getIcpLicenseKey:()=>_N,getImageAttributesFieldsOrder:()=>wN,getImagePath:()=>uN,getImageServicePath:()=>fN,getInitialConnection:()=>oI,getInitialConnectionTempEntity:()=>iI,getIsAuthoringMode:()=>YD,getIsEditableMode:()=>QN,getIsHistoryModeEnabled:()=>tN,getIsSuggestMode:()=>JN,getIsViewMode:()=>XN,getLogo:()=>FD,getLookupAutocomplete:()=>AN,getLookups:()=>$_,getMaxValuesInResponse:()=>bN,getMetadata:()=>D_,getMlDqPath:()=>LI,getMode:()=>KN,getModifiedEntities:()=>iN,getModifiedEntity:()=>nN,getModifiedEntityDefaultProfilePic:()=>aN,getNotifications:()=>SN,getPivotingAttributes:()=>CN,getProfile:()=>j_,getProfileCancelNeedConfirm:()=>TI,getProfileCheckUpdate:()=>BD,getProfileErrors:()=>K_,getProfileLastLoadedTime:()=>EI,getProfileOperation:()=>bI,getProfileViews:()=>vI,getQueryEstimatorEnabled:()=>WD,getRelationToAddByViewId:()=>tI,getRelations:()=>eI,getRelationsToEditByViewId:()=>rI,getRelationsViewIds:()=>Q_,getReleaseVersion:()=>kD,getReltioPath:()=>yN,getRequestProviderConfiguration:()=>xN,getSearch:()=>U_,getSearchKeyword:()=>VN,getSearchNavigationData:()=>YN,getSearchOptions:()=>zN,getSearchProviderData:()=>HN,getSearchResults:()=>MN,getServicesPath:()=>_D,getSharedPreferencesEnabled:()=>UN,getShowAttributeDescription:()=>MD,getShowEntityId:()=>PD,getShowSearchByOv:()=>UD,getStringifiedSearchOptions:()=>GN,getTenant:()=>OI,getTenantName:()=>xI,getTenantObject:()=>P_,getTenants:()=>I_,getTotalByViewId:()=>Z_,getTree:()=>dI,getTreeCommands:()=>fI,getTreeEditingConnection:()=>gI,getTreeRoot:()=>mI,getTreeTotal:()=>yI,getTrees:()=>pI,getUIConfig:()=>ND,getUIConfigLayout:()=>ID,getUIConfigProfile:()=>DD,getUIPath:()=>mN,getUi:()=>F_,getUiError:()=>CD,getUiNumberFormat:()=>EN,getUser:()=>L_,getUserName:()=>cI,getUserRoles:()=>uI,getValidateReadMode:()=>IN,getValidateReferenceEntityInReadMode:()=>PN,getValidateRelations:()=>DN,getValidationServicePath:()=>kI,getValidationServiceSeverityLevels:()=>NN,getViewIdsForOpenRelation:()=>lI,getWorkflowConfigurationEnabled:()=>II,getWorkflowEnvironmentUrl:()=>NI,getWorkflowPath:()=>RI,isCollaborationEnabled:()=>uD,isCollaborationSideViewEnabled:()=>fD,isDBConnectorSideViewEnabled:()=>hD,isHistorySideViewEnabled:()=>gD,isWorkflowEnabled:()=>pD,isWorkflowSideViewEnabled:()=>yD});var d={};r.r(d),r.d(d,{authoringDraftEntitiesLoaded:()=>TP,clearEntity:()=>SP,entityCloneRequested:()=>xP,entityCreationRequested:()=>bP,entityCreationWithAuthoringRequested:()=>vP,entityLoaded:()=>gP,entityRemoveRequested:()=>OP,loadEntity:()=>EP,setDefaultProfilePic:()=>hP});var m={};r.r(m),r.d(m,{errorDeactivated:()=>IP,errorsSet:()=>DP});var y={};r.r(y),r.d(y,{clearHistoryDiff:()=>UP,clearHistoryEvent:()=>VP,setHistoryDiff:()=>jP,setHistoryEvent:()=>MP,setHistoryMode:()=>zP,setHistorySlice:()=>BP});var f={};r.r(f),r.d(f,{lookupsForTypeResolved:()=>$P,lookupsListResolved:()=>KP,lookupsLoaded:()=>ZP});var g={};r.r(g),r.d(g,{modeCancelEditing:()=>tk,modeEditingCanceled:()=>rk,modeUpdated:()=>ek});var h={};r.r(h),r.d(h,{cleanseLoading:()=>pk,entityCreated:()=>lk,entityDeleted:()=>sk,modifiedEntitiesReset:()=>uk,setDefaultProfilePic:()=>ck});var E={};r.r(E),r.d(E,{addRelation:()=>wk,closeRelationEditor:()=>_k,editRelation:()=>Ak,ignoreRelation:()=>Ck,openRelationEditor:()=>Rk,relationsLoaded:()=>Ok,removeRelation:()=>Sk,secondLevelRelationsLoaded:()=>xk,setInitialInfo:()=>Dk,setRelationEntity:()=>Ik,setRelationType:()=>Nk}),r(69448);var b=r(8156),v=r.n(b),T=r(78310),O=r.n(T),x=r(2396),S=r(55743),C=r.n(S),w=r(79358);const A=e=>{let{entity:t,avatarClassName:r,imageClassName:n}=e;const a=(0,w.AH)(),i=(0,w.$H)()||"",o=(0,x.getEntityImage)(a,i,t),l=(0,x.getAbsoluteImageUrl)(i,(0,x.getEntityTypeImage)(a,t.type)),s=e=>{e.target.onError=null,e.target.src=(0,x.svg2Url)('\n<svg width="400px" height="400px" viewBox="0 0 400 400" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <title>Group</title>\n <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g id="Group" fill-rule="nonzero">\n <rect id="Rectangle" fill="#DFE5E9" x="0" y="0" width="400" height="400"></rect>\n <path d="M0,387.023257 L0,399.918908 L400,399.918908 L400,386.023594 C366.631,377.336524 321.866,364.269931 315.979,359.161654 C308.985,353.083704 270.481,310.508063 270.481,310.508063 L270.481,286.186267 C270.481,286.186267 284.478,266.204006 284.478,261.854473 C284.478,257.515936 285.353,246.219746 291.481,241.011503 C297.61,235.792263 311.607,211.471466 312.481,206.253226 C313.355,201.043983 319.484,188.009379 312.481,185.400259 C305.478,182.801135 307.236,173.244359 308.984,168.026119 C310.733,162.817875 319.484,139.355788 322.981,133.277838 C326.488,127.199888 312.481,108.956041 312.481,108.956041 C312.481,108.956041 294.978,80.2857109 245.975,53.3547939 C196.971,26.4138803 168.967,42.9283105 168.967,42.9283105 L161.964,60.3024507 C161.964,60.3024507 138.341,64.6409874 123.46,77.6765909 C108.589,90.7121943 99.837,106.346921 98.963,115.903698 C98.088,125.460475 103.334,159.339048 105.966,164.557289 C108.589,169.765532 112.96,185.400259 112.96,185.400259 C112.96,185.400259 108.589,183.670842 105.966,188.879085 C103.334,194.097325 112.085,218.419122 112.96,220.159535 C113.834,221.897949 114.718,238.403382 119.963,237.532676 C125.218,236.663969 130.463,251.42799 130.463,251.42799 C130.463,251.42799 143.596,271.41125 144.47,275.759783 C145.344,280.09832 147.967,307.039233 147.967,307.039233 L126.967,331.36103 L102.46,355.682827 C102.459,355.682827 34.042,375.886013 0,387.023257 Z" id="Path" fill="#B3BCC4"></path>\n <path d="M0,387.023257 L0,399.918908 L400,399.918908 L400,386.023594 C366.631,377.336524 321.866,364.269931 315.979,359.161654 C308.985,353.083704 270.481,310.508063 270.481,310.508063 L270.481,286.186267 C270.481,286.186267 284.478,266.204006 284.478,261.854473 C284.478,257.515936 285.353,246.219746 291.481,241.011503 C297.61,235.792263 311.607,211.471466 312.481,206.253226 C313.355,201.043983 319.484,188.009379 312.481,185.400259 C305.478,182.801135 307.236,173.244359 308.984,168.026119 C310.733,162.817875 319.484,139.355788 322.981,133.277838 C326.488,127.199888 312.481,108.956041 312.481,108.956041 C312.481,108.956041 294.978,80.2857109 245.975,53.3547939 C196.971,26.4138803 168.967,42.9283105 168.967,42.9283105 L161.964,60.3024507 C161.964,60.3024507 138.341,64.6409874 123.46,77.6765909 C108.589,90.7121943 99.837,106.346921 98.963,115.903698 C98.088,125.460475 103.334,159.339048 105.966,164.557289 C108.589,169.765532 112.96,185.400259 112.96,185.400259 C112.96,185.400259 108.589,183.670842 105.966,188.879085 C103.334,194.097325 112.085,218.419122 112.96,220.159535 C113.834,221.897949 114.718,238.403382 119.963,237.532676 C125.218,236.663969 130.463,251.42799 130.463,251.42799 C130.463,251.42799 143.596,271.41125 144.47,275.759783 C145.344,280.09832 147.967,307.039233 147.967,307.039233 L126.967,331.36103 L102.46,355.682827 C102.459,355.682827 34.042,375.886013 0,387.023257 Z" id="Path" fill="#B3BCC4"></path>\n <path d="M5.68434189e-14,387.023257 L5.68434189e-14,399.918908 L400,399.918908 L400,386.023594 C366.631,377.336524 321.866,364.269931 315.979,359.161654 C308.985,353.083704 270.481,310.508063 270.481,310.508063 L270.481,286.186267 C270.481,286.186267 284.478,266.204006 284.478,261.854473 C284.478,257.515936 285.353,246.219746 291.481,241.011503 C297.61,235.792263 311.607,211.471466 312.481,206.253226 C313.355,201.043983 319.484,188.009379 312.481,185.400259 C305.478,182.801135 307.236,173.244359 308.984,168.026119 C310.733,162.817875 319.484,139.355788 322.981,133.277838 C326.488,127.199888 312.481,108.956041 312.481,108.956041 C312.481,108.956041 294.978,80.2857109 245.975,53.3547939 C196.971,26.4138803 168.967,42.9283105 168.967,42.9283105 L161.964,60.3024507 C161.964,60.3024507 138.341,64.6409874 123.46,77.6765909 C108.589,90.7121943 99.837,106.346921 98.963,115.903698 C98.088,125.460475 103.334,159.339048 105.966,164.557289 C108.589,169.765532 112.96,185.400259 112.96,185.400259 C112.96,185.400259 108.589,183.670842 105.966,188.879085 C103.334,194.097325 112.085,218.419122 112.96,220.159535 C113.834,221.897949 114.718,238.403382 119.963,237.532676 C125.218,236.663969 130.463,251.42799 130.463,251.42799 C130.463,251.42799 143.596,271.41125 144.47,275.759783 C145.344,280.09832 147.967,307.039233 147.967,307.039233 L126.967,331.36103 L102.46,355.682827 C102.459,355.682827 34.042,375.886013 5.68434189e-14,387.023257 Z" id="Path" fill="#B3BCC4"></path>\n </g>\n </g>\n</svg>\n')};return v().createElement(C(),{className:O()(r,n),src:o,imgProps:{onError:s}},v().createElement("img",{className:n,src:l,alt:"fallback entity avatar",onError:s}))};var R=r(75580),_=r(73288);const N=(e,t)=>({get:e,set:t,compose:r=>N((t=>r.get(e(t))),((n,a)=>t(n,r.set(e(n),a))))}),I=e=>N((t=>t[e]),((t,r)=>Object.assign({},t,{[e]:r}))),D=e=>{return"string"==typeof e?I(e):(t=e,N((e=>e[t]),((e,r)=>((e=[...e])[t]=r,e))));var t},P=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return r.length?D(e).compose(P(...r)):D(e)};var k=r(65751),L=r.n(k);const F="explorer",j=[25,50,100],U=(()=>{const e=new Date;return e.setHours(0,0,0,0),e.setFullYear(e.getFullYear()-1)})(),M=(new Date).setHours(0,0,0,0),V="table",B="list",z=V,H={PROFILE:"profile",MAP:"map"},Y=20,W=[{label:"And",value:"and"},{label:"Or",value:"or"},{label:"And not",value:"and not"},{label:"Or not",value:"or not"}],G=W[0],q=W[1],Z={saved:"saved",recent:"recent"},$="public",K="private",Q="updateDate",X={name:"NAME",[Q]:"UPDATE_DATE"},J="desc",ee=[{label:L().text("Only me"),value:K},{label:L().text("All users"),value:$}],te="info",re="error",ne=300,ae="include",ie="exclude",oe="UpdateProfiles",le="DeleteProfiles",se={AddNew:"AddNew",Clear:"Clear",ReplaceAllWith:"ReplaceAllWith",FindAndReplace:"FindAndReplace",FindAndRemove:"FindAndRemove",RepointReference:"RepointReference"},ce={[se.AddNew]:L().text("Add new"),[se.Clear]:L().text("Clear attribute"),[se.ReplaceAllWith]:L().text("Replace all with"),[se.FindAndReplace]:L().text("Find and replace"),[se.FindAndRemove]:L().text("Find and remove"),[se.RepointReference]:L().text("Repoint reference")},ue={[se.AddNew]:["attributeValue"],[se.Clear]:[],[se.ReplaceAllWith]:["attributeValue"],[se.FindAndReplace]:["attributeValue","attributeValueToFind"],[se.FindAndRemove]:["attributeValueToFind"],[se.RepointReference]:["attributeValue"]},pe=(0,_.pipe)(_.values,(0,_.without)(se.RepointReference))(se),de=[se.AddNew,se.Clear,se.ReplaceAllWith],me=[se.AddNew,se.Clear,se.RepointReference],ye="AddAttribute",fe="referenced_entity_id",ge=["uri","label","type","secondaryLabel","defaultProfilePic","defaultProfilePicValue","ctSubscribedUris","attributes.Address","attributes.GeoLocation","attributes.ImageGallery"],he="/entities/_search",Ee="/entities/_total";var be=r(36631);function ve(){return ve=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ve.apply(this,arguments)}var Te=r(34126);const Oe=(0,_.pipe)((e=>Te.stringify(e,{strict:!1})),(e=>e?`?${e}`:""));function xe(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Se(e,t,r[t])}))}return e}function Se(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Ce(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}const we=e=>e.values&&e.values.length||e.rawFilter,Ae=e=>e.dataTenant?[{filter:"equals",fieldName:e.dataTenantFieldName,values:[e.dataTenant]}]:[],Re=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return[(0,_.prop)("fieldNameForRequest"),t=>{let{fieldNameForRequest:r}=t,n=Ce(t,["fieldNameForRequest"]);const a=(0,_.cond)([...e,...x.basicFilterBuildRules])(xe({},n,{fieldName:r}));return(0,_.pipe)((0,x.buildFilterQueryString)(),x.wrapQueryWithBrackets)([{rawFilter:a},...Ae(n)])}]},_e=(0,x.buildFilterQueryString)([Re()]),Ne=(0,_.pipe)((0,_.filter)(we),x.buildFilterHierarchyList),Ie=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{sortOrder:r,sortField:n,select:a,forceOvOnly:i,searchOptions:o,activityFilter:l,globalFilter:s}=t,c=(0,_.pipe)(_e,(0,x.addGlobalFilterToQuery)(s))(e),u=t.page||0,p=t.rowsPerPage||j[0];return{filter:c||void 0,select:Le(e,l,a),max:p,offset:u*p,sort:n||void 0,order:r||void 0,scoreEnabled:!1,options:(i?Pe(o,"ovOnly"):o)||void 0,activeness:l||void 0}},De=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{method:"POST",body:JSON.stringify(Ie(e,t))}},Pe=(e,t)=>{const r=(e=e||"").split(",").filter(_.identity);return r.includes(t)?e:r.concat(t).join(",")},ke=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{select:n,searchOptions:a,activityFilter:i}=r,o={select:Le(t,i,n),uris:e,options:Pe(a,"ovOnly")};return{url:"/entities/_byUris",options:{method:"POST",body:JSON.stringify(o),headers:{"Content-Type":"application/json"}}}},Le=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const n=ge.concat(r);return t&&t!==x.ActivityFilter.ACTIVE_ONLY&&n.push("startDate","endDate"),(0,_.uniq)(n).join(",")},Fe=(0,_.propOr)([],"businessCardAttributeURIs"),je=(0,_.compose)(_.flatten,(0,_.map)((e=>[e.latitude,e.longitude])),(0,_.propOr)([],"geoLocationAttributes")),Ue=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const n=x.Maybe.fromNull(t.find((e=>"type"===e.fieldName&&e.values.length))).map((0,_.prop)("values")).orSome((0,_.pluck)("uri",e.entityTypes)),a=n.map((t=>{const n=(0,x.getEntityType)(e,t);return r.reduce(((e,t)=>e.concat(t(n))),[]).map(Me)}));return(0,_.uniq)((0,_.flatten)(a).map(Ve))},Me=x.attributeUriToSearchUri,Ve=(0,_.pipe)((0,_.split)("."),(0,_.slice)(0,2),(0,_.join)(".")),Be=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{};const{searchOptions:i,activityFilter:o,globalFilter:l}=n,s=1===e.length?Ae(e[0]):[],c=(0,_.pipe)((0,_.filter)((e=>e.forceInclude||!r.includes(e.fieldName))),(0,_.concat)(_.__,s),_e,(0,x.addGlobalFilterToQuery)(l))(t),u=e.map((e=>{const t={fieldName:e.fieldNameForRequest||e.fieldName,pageSize:e.pageSize,pageNo:e.pageNumber||1,orderType:e.orderType};return e.disableIncludeFilter||(t.includeFilter=e.includeFilter||e.values),t})),p=xe({filter:c||void 0,options:i||void 0,activeness:o||void 0},a);return{url:`/entities/_facets${Oe(p)}`,options:{method:"POST",body:JSON.stringify(u),headers:{"Content-Type":"application/json"}}}},ze=function(e,t,r,n){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};const o=He(e,t,r,n,a,i);return`/entities/potentialMatches${Oe(o)}`},He=(e,t,r,n,a,i)=>{const{searchOptions:o,activityFilter:l,globalFilter:s,dataTenant:c}=i;return{filter:Ye(n,a,s)||void 0,options:o||void 0,from:e,to:t,bars:r,activeness:l||void 0,dataTenant:c}},Ye=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;return(0,_.pipe)((0,_.filter)((e=>e.forceInclude||!t.includes(e.fieldName))),_e,(0,x.addGlobalFilterToQuery)(r))(e)},We=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{searchOptions:n,activityFilter:a,globalFilter:i}=r,o=Ye(e,t,i);return(0,_.reject)(x.isEmptyValue,{filter:o||void 0,options:n||void 0,activeness:a||void 0})},Ge=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=We(e,t,r);return Oe(n).slice(1)};function qe(e){let{url:t,options:r,dataTenant:n,customerTenant:a,dtssPath:i}=e;return n?(0,x.requestForDataTenant)({url:t,options:r,dataTenant:n,customerTenant:a,dtssPath:i}):(0,x.rawRequest)(t,r)}const Ze=(0,_.path)(["data","attrType","type"]),$e=(e,t)=>{let{orGroupIndex:r=0}=e;const{filters:n}=e,{values:a,filter:i,operator:o}=t;(0,x.isOrOperator)(o)&&(r=(0,_.inc)(r));const l=(0,_.pathOr)({},["filters",r],e),s={filter:i,fieldName:(0,_.path)(["data","fieldName"],t),fieldNameForRequest:(0,_.path)(["data","fieldNameForRequest"],t),dataTenant:(0,_.path)(["data","dataTenant"],t),dataTenantFieldName:(0,_.path)(["data","dataTenantFieldName"],t),values:rt(a),type:Ze(t),operator:o},c=(0,x.getRootFieldName)(s);return l[c]=(0,_.concat)((0,_.propOr)([],c,l),[s]),{orGroupIndex:r,filters:(0,_.assoc)(r,l,n)}},Ke=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.reduce(((e,t)=>e||(0,x.canWrapInSameAttribute)(t.children)||Ke(t.children)),!1)},Qe=e=>(t,r)=>{const n=(0,_.values)(r).map((t=>{const r=(0,_.path)([0,"operator"],t),n=(0,_.pipe)(x.parseCompositeFilters,x.buildFilterHierarchyList)(t);return!e&&Ke(n)?{filter:t,operator:(0,_.cond)([[x.isAndOperator,(0,_.always)("and")],[x.isOrOperator,_.identity],[_.T,(0,_.always)(null)]])(r)}:{filter:t,operator:r}}));return(0,_.append)(n,t)},Xe=(e,t)=>({operand:e,operator:t}),Je=(0,_.both)((0,_.propSatisfies)((0,_.lt)(1),"length"),(0,_.propSatisfies)(Array.isArray,0)),et=[[(0,_.propEq)("fieldName","rdmLookups.resolved"),e=>{let{fieldName:t,values:r}=e;return(0,x.buildBasicFilterString)({filter:x.FilterOptions.EQUALS,fieldName:t,values:[!r[0]]})}],[(0,_.allPass)([(0,_.propEq)("filter",x.FilterOptions.EQUALS),(0,_.propSatisfies)(Je,"values"),(0,_.complement)((0,_.propEq)("fieldName","type")),(0,_.propSatisfies)((0,_.complement)(x.isDateType),"type")]),e=>{let{fieldName:t,values:r}=e;return(0,_.pipe)((0,_.map)((e=>e.length>1?(0,x.buildComplexFilterString)({fieldName:t,values:e,filter:"listEquals"}):(0,x.buildBasicFilterString)({fieldName:t,values:e,filter:"equals"}))),(0,x.joinFilterStrings)(" and "))(r)}]],tt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return r=>{const n=[...et,...e];return r.map((e=>Xe((0,x.buildFilterQueryString)([Re(n),...n],t)(e.filter),e.operator)))}},rt=(0,_.pipe)((0,_.defaultTo)([]),(0,_.map)((0,_.when)((0,_.has)("value"),(0,_.prop)("value")))),nt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const r=[{filter:"equals",fieldName:"type",values:t}],n=(0,x.buildFilterQueryString)()(r);return n+(n&&e?` and ${(0,x.wrapQueryWithBrackets)(e)}`:e)},at=e=>Array.isArray(e)?e:Object.keys(e).map((t=>e[t])),it=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const n=e.map((0,_.evolve)({attributes:x.shiftDownOperators})).filter(x.isValidSearchGroup).map((e=>{const n=(0,_.pipe)((0,_.prop)("attributes"),(0,_.filter)(x.isValidSearchGroupAttribute),(0,_.reduce)($e,{filters:[]}),(0,_.prop)("filters"),at,(0,_.reduce)(Qe(r),[]),(0,_.map)(tt(t,r)),_.flatten,(0,_.filter)((e=>e.operand)),(0,_.map)((0,_.evolve)({operand:e=>(0,x.wrapQueryWithBrackets)(e,!1)})),x.shiftUpOperators,x.buildOperationsToString)(e);return Xe(nt(n,e.entityTypes),e.operator)})).filter((e=>e.operand));return(0,_.pipe)((0,_.ifElse)((0,_.pipe)(_.length,(0,_.lt)(1)),(0,_.map)((e=>Xe((0,x.wrapQueryWithBrackets)(e.operand),e.operator))),_.identity),x.buildOperationsToString)(n)};function ot(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){lt(e,t,r[t])}))}return e}function lt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const st=(0,_.pipe)(_.values,(0,_.map)((e=>({title:e.label,fieldName:e.name,name:e.name,type:e.type,faceted:e.faceted,hideForDataTenant:e.hideForDataTenant})))),ct={id:"entity",title:L().text("Entity"),attributes:st(x.EntityAttrTypes)},ut={id:"workflow",title:L().text("Workflow"),attributes:st(x.WorkflowAttrTypes)},pt={id:"collaborationItems",title:L().text("Collaboration Items"),attributes:st(x.CollaborationAttrTypes)},dt={id:"RDMItems",title:L().text("Reference Data Management"),attributes:st(x.RdmAttrTypes)},mt={id:"auditItems",title:L().text("Audit Items"),attributes:st(x.AuditAttrTypes)},yt={id:"potentialMatches",title:L().text("Potential Matches"),attributes:st(x.PotentialMatchesAttrTypes)},ft={id:"crosswalksItems",title:L().text("Crosswalks Items"),attributes:st((0,_.omit)(["sourceTable"],x.CrosswalksAttrTypes))},gt=()=>ct,ht=()=>ut,Et=()=>pt,bt=()=>dt,vt=()=>mt,Tt=e=>e?(0,_.evolve)({attributes:(0,_.concat)(_.__,e.map((e=>ot({},yt.attributes.find((0,_.propEq)("fieldName",x.PotentialMatchesAttrTypes.matches.name)),{dataTenant:e,fieldNameForRequest:"dtPotentialMatches.matches",dataTenantFieldName:"dtPotentialMatches.dataTenant"}))))},yt):yt,Ot=()=>ft,xt=e=>{let{title:t,fieldName:r,dataTenant:n,fieldNameForRequest:a,dataTenantFieldName:i}=e,o=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["title","fieldName","dataTenant","fieldNameForRequest","dataTenantFieldName"]);return ot({title:t,fieldName:r,attrType:o},o.faceted?{pageSize:Pt(o),orderType:kt(o)}:{},n?Nt({dataTenant:n,fieldNameForRequest:a,dataTenantFieldName:i,originalTitle:t}):{})},St=(e,t,r)=>r&&r.length?{id:e,title:t,attributes:r}:null,Ct=function(){let{attributesFilter:e=_.T,dataTenants:t,canUserReadWorkflowDataTask:r=!0}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const n=t=>{let{id:r,title:n,attributes:a}=t;return St(r,n,a.map(xt).filter(e))},a=[gt(),...r?[ht()]:[],Et(),bt(),vt(),Tt(t),Ot()];return a.map(n).filter(_.identity)},wt=(e,t,r)=>{const n=Ct({dataTenants:t,canUserReadWorkflowDataTask:r}).find((t=>t.attributes.find((t=>t.fieldName===e))));return n&&n.attributes.find((t=>t.fieldName===e))};function At(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Rt(e,t,r[t])}))}return e}function Rt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const _t=(e,t)=>At({title:e.label,fieldName:e.name,type:(0,x.getFacetTypeForAttrType)(e),attrType:{type:e.type,name:e.name,singleValue:e.singleValue,hideForDataTenant:e.hideForDataTenant,faceted:!0}},t),Nt=e=>{let{dataTenant:t,fieldNameForRequest:r,dataTenantFieldName:n,originalTitle:a}=e;return{fieldName:(0,x.getDataTenantSpecialAttributeFieldName)(r,t.id),fieldNameForRequest:r,dataTenant:t.id,dataTenantFieldName:n,title:`${t.label} ${a}`}},It=[{attribute:_t(x.SpecialAttrTypes.matchRules,{pageSize:Y,orderType:"reversedCount"}),check:x.hasMatchRulesWithoutML},{attribute:_t(x.SpecialAttrTypes.MLRecommendedMatch,{fieldNameForRequest:"relevanceScores.matchRule",pageSize:Y,orderType:"reversedCount",LogoIcon: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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",ve({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),v().createElement("defs",null,v().createElement("linearGradient",{x1:"94.582%",y1:"6.451%",x2:"23.195%",y2:"83.323%",id:"svg1842926308b"},v().createElement("stop",{stopColor:"#CDE1FF",offset:"0%"}),v().createElement("stop",{stopColor:"#AFFBF4",offset:"100%"})),v().createElement("linearGradient",{x1:"94.582%",y1:"6.594%",x2:"23.195%",y2:"83.214%",id:"svg1842926308d"},v().createElement("stop",{stopColor:"#FFF",offset:"0%"}),v().createElement("stop",{stopColor:"#FDFFFF",offset:"100%"})),v().createElement("linearGradient",{x1:"93.837%",y1:"55.274%",x2:"29.292%",y2:"-20.431%",id:"svg1842926308g"},v().createElement("stop",{stopColor:"#FFFCC7",stopOpacity:"0",offset:"0%"}),v().createElement("stop",{stopColor:"#FFF470",offset:"100%"})),v().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"98.152%",id:"svg1842926308i"},v().createElement("stop",{stopColor:"#83D6FF",offset:"0%"}),v().createElement("stop",{stopColor:"#72B9EF",offset:"100%"})),v().createElement("path",{d:"M.228 8.25l4.055-7.007C4.579.727 5.709.074 6.425.009L14.48.001c.633-.03 1.853.635 2.236 1.3l3.934 6.812c.398.69.345 2.074-.017 2.765l-3.868 6.685c-.472.64-1.77 1.39-2.446 1.416l-7.767.008c-.689-.033-1.992-.72-2.345-1.332L.232 10.769c-.338-.585-.278-1.938-.004-2.519z",id:"svg1842926308a"}),v().createElement("path",{d:"M1.389 8.38l3.589-6.202c.262-.457 1.263-1.033 1.898-1.09h7.143c.56-.026 1.643.565 1.984 1.153l3.494 6.037c.353.611.308 1.837-.012 2.449l-3.424 5.916c-.418.567-1.569 1.23-2.168 1.252H7.006c-.61-.03-1.766-.64-2.08-1.182L1.395 10.61c-.3-.518-.249-1.717-.006-2.23z",id:"svg1842926308c"}),v().createElement("path",{d:"M.124 0l-.161-.002c3.374 0 6.11 2.727 6.11 6.092 0 3.279-2.974 4.316-2.974 7.123a.84.84 0 01-.84.838H.123V8.623a1.75 1.75 0 000-3.437V0z",id:"svg1842926308e"}),v().createElement("path",{d:"M5.92 0l-.012 5.154-.132.006A1.75 1.75 0 005.9 8.654l-.012 5.409H3.486c-.237-.07-.4-.155-.489-.254-.089-.098-.17-.284-.242-.557l-.291-1.341a2.084 2.084 0 00-.12-.344 1.507 1.507 0 00-.187-.267L.25 8.796a1.032 1.032 0 01-.201-.293 1.277 1.277 0 01-.048-.38V3.917a.522.522 0 01.027-.22.562.562 0 01.147-.172L3.546.111a.456.456 0 01.11-.088A.345.345 0 013.784 0h2.136z",id:"svg1842926308h"})),v().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},v().createElement("g",null,v().createElement("g",{transform:"translate(1.5 .75)"},v().createElement("use",{fill:"url(#svg1842926308b)",xlinkHref:"#svg1842926308a"}),v().createElement("use",{fill:"url(#svg1842926308d)",opacity:".5",xlinkHref:"#svg1842926308c"})),v().createElement("g",{transform:"translate(8.707 3.846)"},v().createElement("rect",{fill:"#363636",x:"1.932",y:"16.593",width:"2.644",height:"2.895",rx:"1.322"}),v().createElement("path",{d:"M6.018 14.845v2.367c0 .9-.743 1.629-1.66 1.629H2.27c-.917 0-1.66-.73-1.66-1.63v-2.366l.004-.095h5.401c.002.031.003.063.003.095z",fill:"#717171"}),v().createElement("path",{d:"M5.168 17.15c0 .9-.618 1.63-1.38 1.63H2.049c-.762 0-1.38-.73-1.38-1.63v-2.37h4.5v2.37z",fill:"#828282"}),v().createElement("path",{d:"M5.939 17.28a.5.5 0 010 1H.569a.5.5 0 110-1h5.37zm0-1.376a.5.5 0 010 1H.569a.5.5 0 110-1h5.37zm0-1.375a.5.5 0 010 1H.569a.5.5 0 110-1h5.37z",fill:"#B1B1B1"}),v().createElement("path",{d:"M3.125 17.28v1h-2v-1h2zm0-1.376v1h-2v-1h2zm0-1.375v1h-2v-1h2z",fill:"#C5C5C5"}),v().createElement("g",{transform:"translate(3.375)"},v().createElement("mask",{id:"svg1842926308f",fill:"#fff"},v().createElement("use",{xlinkHref:"#svg1842926308e"})),v().createElement("use",{fill:"#FFD44B",xlinkHref:"#svg1842926308e"}),v().createElement("path",{d:"M-6.125 6.091A6.076 6.076 0 01-.025 0c3.367 0 6.098 2.727 6.098 6.091 0 3.279-2.969 4.316-2.969 7.123a.838.838 0 01-.839.837H-2.51a.838.838 0 01-.839-.837c0-2.562-2.775-3.73-2.775-7.123z",fill:"#FFD347",mask:"url(#svg1842926308f)"}),v().createElement("path",{d:"M-6.125 6.091A6.076 6.076 0 01-.025 0c3.367 0 6.098 2.727 6.098 6.091 0 3.279-2.969 4.316-2.969 7.123a.838.838 0 01-.839.837H-2.51a.838.838 0 01-.839-.837c0-2.562-2.775-3.73-2.775-7.123z",fill:"#FFDE72",mask:"url(#svg1842926308f)"}),v().createElement("path",{d:"M1.496 6.08c.02-.896.936-1.336 1.732-.85.906.553.507 2.04-.592 2.069H2.199l-.576 7.012-.75-.032.552-6.406.023-.574H.124v-.75h1.354l.017-.448v-.02zm1.342-.21c-.318-.193-.58-.072-.592.221l-.001.036-.016.422h.373c.357 0 .5-.493.252-.668l-.016-.01z",fill:"#F3BE13",mask:"url(#svg1842926308f)"}),v().createElement("ellipse",{fill:"url(#svg1842926308g)",mask:"url(#svg1842926308f)",cx:"-.236",cy:"6.031",rx:"4.567",ry:"4.583"})))),v().createElement("g",null,v().createElement("g",{transform:"translate(5.706 3.846)"},v().createElement("mask",{id:"svg1842926308j",fill:"#fff"},v().createElement("use",{xlinkHref:"#svg1842926308h"})),v().createElement("use",{fill:"url(#svg1842926308i)",xlinkHref:"#svg1842926308h"}),v().createElement("path",{fill:"#D6FCFA",fillRule:"nonzero",opacity:".5",mask:"url(#svg1842926308j)",d:"M4.78 1.404v.75h-.444L1.56 4.93H-.706v-.75H1.25l2.775-2.776zM3.21 5.097l1.725 1.725H6.25v.75H4.625L2.68 5.628zM6.664 3.53v.75H4.958l-.492.53-.55-.51.714-.77zM1.781 6.53l2.565 2.564h.462v.75h-.773L1.47 7.28H-.08v-.75zM2.67 10.53h1.118L5.05 11.79h2.094v.75H4.74L3.477 11.28z"}))),v().createElement("circle",{fill:"#008FD8",cx:"11.75",cy:"10.75",r:"1.125"})))}}),check:x.hasMlMatchRule}],Dt=(0,_.curry)(((e,t)=>{const r=It.reduce(((e,r)=>{let{attribute:n,check:a}=r;return a(t)&&e.push(At({},n,{entityTypeUri:t.uri})),e}),[]),n=(e||[]).flatMap((e=>r.filter((0,_.propEq)("fieldName",x.SpecialAttrTypes.matchRules.name)).map((t=>At({},t,Nt({dataTenant:e,fieldNameForRequest:"dtPotentialMatches.matchRules",dataTenantFieldName:"dtPotentialMatches.dataTenant",originalTitle:t.title}))))));return r.concat(n)})),Pt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};switch(e.type){case"Int":case"Float":case"Double":case"Long":case"Number":case"Date":case"ActivenessDate":case"Timestamp":return 1;default:return Y}},kt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};switch(e.type){case"Int":case"Float":case"Double":case"Long":case"Number":case"Date":case"ActivenessDate":case"Timestamp":return"reversedTerm";default:return"reversedCount"}},Lt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};switch(e.type){case"Int":case"Float":case"Double":case"Long":case"Number":case"Date":case"ActivenessDate":case"Timestamp":return!0;default:return!1}},Ft=(0,_.curry)(((e,t)=>(0,x.isComplexAttribute)(t)?(0,x.getAttributeTypeSubAttributes)(e,t).some(Ft(e)):!!t.faceted)),jt=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return(e.children?e.children.concat(e.children.map(jt)).flat(1/0):[]).filter((0,_.complement)(_.isEmpty))},Ut=function(e,t,r,n,a){let i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[];const o=At({},a(e,t,r,n,i),{uri:t.uri}),l=t.children?t.children.map((n=>Ut(e,n,r,"",a,i.concat({name:t.name,label:t.label})))):[];return l.length&&(o.children=l),o},Mt=(e,t,r,n,a)=>{const i=(0,x.getEntityTypeLabel)(e,{type:r}),o=t.label||t.name;return{title:o,pathToTitle:Array.isArray(a)?[i,...(0,_.chain)((0,_.prop)("label"),a),o]:[i,o],fieldName:n||Me(t.uri,a),entityTypeUri:r,attrType:t,pageSize:Pt(t),orderType:kt(t),isComplex:(0,x.isComplexAttribute)(t),disableIncludeFilter:Lt(t)}},Vt=function(e,t){let r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return(0,x.getAllAttributeTypesTree)(e,t,(0,_.either)((0,_.always)(!r),Ft(e)))},Bt=(0,be.Z)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],i=!(arguments.length>5&&void 0!==arguments[5])||arguments[5],o=arguments.length>6?arguments[6]:void 0;const l=e=>t.includes(e),s=()=>i,c=()=>(0,_.propEq)("length",1,t),{entityTypes:u}=e;return u.filter(x.isAvailableEntityType).filter((0,_.anyPass)([(0,_.always)(!t.length),(0,_.allPass)([s,c,(0,_.propEq)("uri",t[0])]),(0,_.allPass)([(0,_.complement)(s),(0,_.pipe)((0,_.prop)("uri"),l)])])).map((t=>{const i=(0,x.getEntityTypeLabel)(e,{type:t.uri}),l=Dt(o,t).concat(Vt(e,t,a).map((r=>Ut(e,r,t.uri,"",n))));return l.length?r(t.uri,i,l):null})).filter(_.identity)})),zt=(0,be.Z)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:_.T,n=arguments.length>3?arguments[3]:void 0;if(0===t.length)return Bt(e,void 0,St,Mt,!1,!0,n);const a=[],i=t.length>1?(0,x.findClosestCommonAncestor)(e,t):t[0];if(i){const o=(0,x.getEntityType)(e,i),l=t.length>1?L().text("Attributes"):(0,x.getEntityTypeLabel)(e,{type:o.uri}),s=Dt(n,o).filter(r).concat(Vt(e,o,!1).map((t=>Ut(e,t,o.uri,"",Mt))));s.length&&a.push(St(o.uri,l,s))}return a}));function Ht(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Yt(e,t,r[t])}))}return e}function Yt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Wt=e=>_t(x.SpecialAttrTypes.type,{hiddenTitle:L().text("Entity types"),disableIncludeFilter:!0,pageSize:101,showIcon:!0,barColor:"#61D55D",transparentBackground:!0,showDeleteButton:!1}),Gt=_t(x.SpecialAttrTypes.matches,{pageSize:1,orderType:"reversedTerm",disableIncludeFilter:!0}),qt=[_t(x.SpecialAttrTypes.createdBy,{pageSize:Y}),_t(x.SpecialAttrTypes.updatedBy,{pageSize:Y}),_t(x.SpecialAttrTypes.createdTime,{disableIncludeFilter:!0,pageSize:1,orderType:"reversedTerm"}),_t(x.SpecialAttrTypes.updatedTime,{disableIncludeFilter:!0,pageSize:1,orderType:"reversedTerm"}),_t(x.SpecialAttrTypes.sourceSystems,{title:L().text("Sources"),pageSize:Y,orderType:"reversedCount"}),_t(x.SpecialAttrTypes.tags,{pageSize:Y,orderType:"reversedCount"}),_t(x.SpecialAttrTypes.roles,{pageSize:Y,orderType:"reversedCount"}),Gt,_t(x.SpecialAttrTypes.matchScore,{pageSize:1,orderType:"reversedTerm",disableIncludeFilter:!0}),_t(x.SpecialAttrTypes.relevanceScore,{pageSize:1,orderType:"reversedTerm",disableIncludeFilter:!0}),_t(x.SpecialAttrTypes.matchAction,{pageSize:Y,orderType:"reversedCount"}),_t(x.SpecialAttrTypes.startDate,{pageSize:1,orderType:"reversedTerm",disableIncludeFilter:!0}),_t(x.SpecialAttrTypes.endDate,{pageSize:1,orderType:"reversedTerm",disableIncludeFilter:!0})],Zt=e=>{const t=(e||[]).map((e=>Ht({},Gt,Nt({dataTenant:e,fieldNameForRequest:"dtPotentialMatches.matches",dataTenantFieldName:"dtPotentialMatches.dataTenant",originalTitle:Gt.title}))));return qt.concat(t)},$t=(e,t,r,n,a)=>Ht({},Mt(e,t,r,n,a),{uri:t.uri,type:(0,x.getFacetTypeForAttrType)(t)}),Kt=(0,x.memoizeWith)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;return t.toString()+(r||[]).map((0,_.prop)("id")).toString()}),(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;return Bt(e,t,Qt,$t,!0,!0,r)})),Qt=function(e,t,r){let n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];return r&&r.length?{id:e,title:t,needGroupIcon:n,facets:r}:null},Xt=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=arguments.length>3?arguments[3]:void 0;const a=1===t.length,i=Zt(n),o=Qt("special",L().text("Basic"),i,!1),l=Kt(e,t,n),s=(0,_.chain)((0,_.prop)("facets"),l),c=(0,_.pipe)((0,_.map)(Jt([...i,...s])),(0,_.reject)(_.isNil))(r);return[Qt("recommended",L().text("Recommended"),c,!1)].concat(a?l:o).concat(a?o:l).filter(_.identity)},Jt=(0,_.curry)(((e,t)=>{const r=e.find((0,_.propEq)("fieldName",t));if(r)return r;{const r=(0,_.chain)((0,_.propOr)([],"children"),e);return r.length?Jt(r,t):void 0}})),er=e=>Ht({},e,{facets:e.facets.reduce(((e,t)=>(e.push(t),t.children&&e.push(...jt(t)),e)),[])}),tr=(e,t,r)=>Xt(e,t,[],r).map(er),rr=e=>e.children?[e].concat(e.children.flatMap(rr)):[e],nr=(e,t,r,n)=>Xt(e,t,r,n).flatMap((e=>e.facets)).flatMap(rr),ar=function(e){let{values:t=[],showAllItems:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,_.reject)(_.isNil,{fieldName:e,data:[],values:t&&t.map((0,_.when)((0,_.is)(Boolean),_.toString)),showAllItems:r})},ir=e=>e.type===x.FACET_TYPES.COMPLEX_FACET,or=e=>e.attrType&&(0,x.isLookupAttrType)(e.attrType),lr=e=>"matches"===e.fieldName||"potentialMatches.matchScore"===e.fieldName||e.fieldName.startsWith((0,x.getDataTenantSpecialAttributeFieldName)("dtPotentialMatches.matches","")),sr=e=>(0,_.intersection)([x.MatchRulesAttrNames.matchRules,"dtPotentialMatches.matchRules",x.MatchRulesAttrNames.MLRecommendedMatch],[e.fieldNameForRequest,e.fieldName]).length>0,cr=e=>!!e.dataTenant,ur=[],pr="facetsData",dr=e=>[pr,e],mr=(0,_.curry)(((e,t,r)=>{const n=dr(t.fieldName);return(0,_.path)([F,"facets",...n,e],r)})),yr=mr("data"),fr=mr("values"),gr=mr("showAllItems"),hr=mr("filteredData"),Er=e=>e.explorer.facets.facetsData,br=e=>e.explorer.facets.facetsConfigs,vr=e=>e.explorer.facets.recommendedFacets,Tr=e=>(0,_.pathOr)(ur,[F,"facets",pr,"type","values"],e),Or=(e,t)=>vr(t).includes(e),xr=(e,t)=>{const{data:r,filteredData:n}=Er(e)[t];return n||r};var Sr=r(42308),Cr=r.n(Sr);let wr=function(e){return e.CREATE_FACETS="FACETS_CREATE_FACETS",e.DESTROY_FACETS="FACETS_DESTROY_FACETS",e.CHANGE_VALUES="FACETS_CHANGE_VALUES",e.CLEAR_ALL_VALUES="FACETS_CLEAR_ALL_VALUES",e.UPDATE_DATA="FACETS_UPDATE_DATA",e.UPDATE_FILTERED_DATA="FACETS_UPDATE_FILTERED_DATA",e.DESTROY_FILTERED_DATA="FACETS_DESTROY_FILTERED_DATA",e.FILTER_FACET_DATA="FACETS_FILTER_FACET_DATA",e.HANDLE_CONFIGS_CHANGES="FACETS_HANDLE_CONFIGS_CHANGES",e.REQUEST_GIVEN_FACETS_DATA="FACETS_REQUEST_GIVEN_FACETS_DATA",e.SET_RECOMMENDED_FACETS_LIST="FACETS_SET_RECOMMENDED_FACETS_LIST",e.CONVERT_FROM_ADVANCED_SEARCH="FACETS_CONVERT_FROM_ADVANCED_SEARCH",e.SHOW_MORE_ENTITY_TYPES="FACETS_SHOW_MORE_ENTITY_TYPES",e.HIGHLIGHT_ADDED_FACETS="FACETS_HIGHLIGHT_ADDED_FACETS",e.CLEAR_HIGHLIGHT_ADDED_FACETS="FACETS_CLEAR_HIGHLIGHT_ADDED_FACETS",e}({});const Ar="SEARCH_UPDATE_ENTITIES",Rr="SEARCH_CLEAR_RESULTS",_r="SEARCH_REFRESH_DISPLAYED_ENTITIES",Nr="SEARCH_REFRESH",Ir="SEARCH_CLEAR_ALL",Dr="SEARCH_SHOW_MORE_RESULTS_FOR_ENTITY_TYPE",Pr="SEARCH_UPDATE_TOTAL",kr="SEARCH_CHANGE_PAGE",Lr="SEARCH_RESET_PAGE",Fr="SEARCH_CHANGE_ROWS_PER_PAGE",jr="SEARCH_CHANGE_SORT",Ur="SEARCH_CHANGE_LOADING",Mr="SEARCH_MAP_CHANGE_VALUE",Vr="SEARCH_STATE_UPDATED",Br="SEARCH_EXPORT_RESULTS",zr="SEARCH_OPEN_DATA_LOADER",Hr="SEARCH_CHANGE_CURRENT_TENANT";function Yr(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Wr(e,t,r[t])}))}return e}function Wr(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Gr=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return e.split(".").slice(0,t+1).join()},qr=(e,t,r)=>{const n=t.map((e=>Gr(e,r)));return e.filter((e=>n.includes(Gr(e.fieldName,r)))).map((e=>{if(t.includes(e.fieldName))return e.isComplex?null:e;if(e.children){const n=qr(e.children,t,r+1);if(n.length>0)return Yr({},e,{children:n})}return null})).filter((e=>e))},Zr=e=>{let{attributeGroups:t,recommendedAttributes:r=[],attributesFilter:n,dataTenants:a,canUserReadWorkflowDataTask:i}=e;const o=Ct({attributesFilter:n,dataTenants:a,canUserReadWorkflowDataTask:i}),l=1===t.length?t.concat(o):o.concat(t),s=((e,t)=>{const r=e.reduce(((e,t)=>e.concat(t.attributes)),[]),n=qr(r,t);return n.length>0?[{id:"recommended",title:"Recommended",attributes:n}]:[]})(l,r);return s.concat(l)},$r=e=>Object.keys(e).map((t=>{switch(t){case"allowedEntityTypes":{const r=e[t];return r?e=>e.filter((e=>{let{id:t}=e;return r.includes(t)})).sort((0,x.orderByArrayComparator)(r,"id")):null}case"firstLevelAttributesFilter":{const r=e[t];return r?e=>e.map((e=>Yr({},e,{attributes:e.attributes.filter(r)}))).filter(Qr):_.identity}default:return null}})).filter(_.identity),Kr=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],a=arguments.length>4?arguments[4]:void 0,i=arguments.length>5?arguments[5]:void 0;const o=$r(e),l=zt(t,r,e.firstLevelAttributesFilter,a),s=o.reduce(((e,t)=>t(e)),l);return Zr({attributeGroups:s,recommendedAttributes:n,attributesFilter:e.firstLevelAttributesFilter,dataTenants:a,canUserReadWorkflowDataTask:i})},Qr=(0,_.path)(["attributes","length"]),Xr=e=>e.map((e=>Yr({},e,{attributes:e.attributes.map((e=>e.children&&e.attrType&&(0,x.isReference)(e.attrType)?Yr({},e,{children:e.children.filter(x.isRelationAttrType)}):e))}))).filter(Qr),Jr=(0,_.curry)(((e,t)=>(0,_.pathEq)(["attrType","uri"],e.uri)(t))),en=(0,_.pipe)((0,_.path)(["attrType","uri"]),_.not),tn=e=>(0,_.either)((0,_.path)(["attrType","hideForDataTenant"]),(0,_.pipe)((0,_.prop)("entityTypeUri"),(0,_.complement)((0,x.isAvailableEntityTypeForDataTenant)(e)))),rn=e=>(0,_.pipe)((0,_.prop)("id"),(0,_.either)((0,_.complement)(x.isEntityTypeUri),(0,x.isAvailableEntityTypeForDataTenant)(e))),nn=(0,_.path)(["facets","length"]),an=(0,_.curry)(((e,t)=>e?t.filter(rn(e)).map((0,_.evolve)({facets:(0,_.reject)(tn(e))})).filter(nn):t)),on=(0,_.curry)(((e,t)=>e?t.filter(rn(e)).map((0,_.evolve)({attributes:(0,_.reject)(tn(e))})).filter(Qr):t)),ln=(e,t)=>{const[r,n]=(0,_.partition)(tn(e),t);return r.length>0?n:t},sn=(0,_.curry)(((e,t)=>e?(0,_.map)((0,_.when)(x.isTypeFacet,(0,_.evolve)({values:(0,_.filter)((0,x.isAvailableEntityTypeForDataTenant)(e))})),t):t));function cn(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){un(e,t,r[t])}))}return e}function un(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const pn={facetsConfigs:[],facetsData:{},recommendedFacets:[],addedFacets:[]},dn=I("facetsConfigs"),mn=I("facetsData"),yn=I("recommendedFacets"),fn=I("addedFacets"),gn=(e,t,r)=>Object.keys(e).reduce(((t,n)=>(0,_.prop)(n,t)?P(n,r).set(t,e[n]):t),cn({},t)),hn=e=>{let{state:t,facetsConfigs:r,addToEnd:n=!1,facetsData:a={}}=e;const i=r.filter((e=>e.fieldName)),o=dn.get(t),l=dn.set(t,n?o.concat(i):i.concat(o)),s=mn.get(t),c=i.reduce(((e,t)=>cn({},e,{[t.fieldName]:ar(t.fieldName,a[t.fieldName])})),cn({},s));return mn.set(l,c)},En=(e,t)=>{const r=mn.get(e),n=dn.get(e),a=cn({},r);t.forEach((e=>{delete a[e]}));const i=mn.set(e,a);return dn.set(i,n.filter((e=>!t.includes(e.fieldName))))},bn=e=>{let{facetFieldName:t,values:r,state:n}=e;const a=[...dr(t),"values"];return P(...a).set(n,r)},vn=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:pn,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case wr.CREATE_FACETS:{const{facetsConfigs:r,addToEnd:n}=t.payload;return hn({state:e,facetsConfigs:r,addToEnd:n})}case Sr.search.constants.UPDATE_STATE:{const{facetsConfigs:e=[],facetsData:r={}}=t.payload.facets||{facetsConfigs:[]};return hn({state:pn,facetsConfigs:e,facetsData:r})}case wr.DESTROY_FACETS:{const r=t.payload||[];return En(e,r)}case wr.CHANGE_VALUES:{const{facetFieldName:r,values:n}=t.payload;return bn({facetFieldName:r,values:n,state:e})}case wr.SHOW_MORE_ENTITY_TYPES:{const{show:r}=t.payload,n=dr("type");if(r)return P(...n,"showAllItems").set(e,r);{const t=P(...n);return t.set(e,(0,_.omit)(["showAllItems"],t.get(e)))}}case wr.CLEAR_ALL_VALUES:case Ir:{const t=mn.get(e),r=Object.keys(t).reduce(((e,t)=>cn({},e,{[t]:[]})),{}),n=gn(r,t,"values");return mn.set(e,n)}case wr.UPDATE_DATA:{const r=t.payload||{},n=mn.get(e),a=gn(r,n,"data");return mn.set(e,a)}case wr.UPDATE_FILTERED_DATA:{const r=t.payload||{},n=mn.get(e),a=gn(r,n,"filteredData");return mn.set(e,a)}case wr.DESTROY_FILTERED_DATA:{const r=t.payload||{},n=dr(r);if((0,_.path)(n,e)){const t=P(...n),r=cn({},t.get(e));if(r.filteredData)return delete r.filteredData,t.set(e,r)}break}case wr.SET_RECOMMENDED_FACETS_LIST:return yn.set(e,t.payload||[]);case wr.HIGHLIGHT_ADDED_FACETS:return fn.set(e,t.payload);case wr.CLEAR_HIGHLIGHT_ADDED_FACETS:return fn.set(e,[]);case"UI_RESET":return cn({},pn);case Hr:{const{isDataTenant:r,tenantObject:n}=t.payload;if(r){const t=dn.get(e),r=mn.get(e),a=ln(n,t),i=(0,_.pluck)("fieldName",a),o=(0,_.pipe)((0,_.pick)(i),sn(n))(r);return mn.set(dn.set(e,a),o)}return e}}return e};function Tn(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){On(e,t,r[t])}))}return e}function On(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const xn={searchResults:null,searchResultsByEntityTypes:{},total:0,page:0,sortField:null,sortOrder:null,rowsPerPage:j[0],loading:!1,searchParams:{searchBoxInput:{fieldName:"attributes",filter:"containsWordStartingWith"},mapSearch:{fieldName:"geoLocation",type:"geoLocation",filter:"range",values:[]}},currentTenant:null},Sn=I("searchResults"),Cn=I("total"),wn=I("page"),An=I("rowsPerPage"),Rn=I("sortField"),_n=I("sortOrder"),Nn=I("loading"),In=P("searchParams","mapSearch","values"),Dn=P("searchParams","mapSearch","type"),Pn=P("searchParams","mapSearch","fieldName"),kn=I("searchResultsByEntityTypes"),Ln=e=>kn.compose(P(e,"page")),Fn=(e,t)=>{let{entityTypeUri:r,field:n,order:a}=e;if(r){const e=kn.compose(P(r,"sortField")),i=kn.compose(P(r,"sortOrder")),o=e.set(t,n);return i.set(o,a)}{const e=Rn.set(t,n);return _n.set(e,a)}},jn=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:xn,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Ar:{const{searchResults:r,entityTypeUri:n}=t.payload;return n?kn.compose(P(n,"searchResults")).set(e,r):Sn.set(e,r)}case Pr:return Cn.set(e,t.payload);case kr:{const{entityTypeUri:r,pageNumber:n}=t.payload;return r?Ln(r).set(e,n):wn.set(e,n)}case Lr:{const{entityTypeUri:r}=t.payload,n=wn.set(e,0);return r?Ln(r).set(n,0):n}case Fr:{const{entityTypeUri:r,number:n}=t.payload;if(r){const t=kn.compose(P(r,"rowsPerPage")),a=Ln(r).set(e,0);return t.set(a,n)}{const t=wn.set(e,0);return An.set(t,n)}}case jr:return Fn(t.payload,e);case Ur:return Nn.set(e,t.payload);case Sr.search.constants.UPDATE_STATE:{const{values:r=[],searchType:n=x.MAP_SEARCH_TYPES.geoPolygon}=t.payload.map||{};let a=In.set(xn,r);if(a=Dn.set(a,n),a=Pn.set(a,(0,x.mapSearchTypeToFieldName)(n)),t.payload.view){const{entityTypeTab:e,sortField:r,sortOrder:n}=t.payload.view;a=Fn({entityTypeUri:e,field:r,order:n},a)}return Tn({},a,{currentTenant:t.payload.currentTenant||e.currentTenant,searchOptions:t.payload.searchOptions||e.searchOptions})}case"UI_RESET":return Tn({},xn);case Mr:{const{value:r,searchType:n}=t.payload;let a=Dn.set(e,n);return a=Pn.set(a,(0,x.mapSearchTypeToFieldName)(n)),In.set(a,r?[r]:[])}case Rr:{const r=t.payload;if(r){let t=Sn.set(e,void 0);const n=kn.get(e);return kn.set(t,{[r]:n[r]})}return kn.set(e,{})}case Ir:return In.set(e,[]);case Hr:return Tn({},e,{currentTenant:t.payload.tenantObject.id})}return e},Un="UI_SHOW_MORE_FACETS_POPUP",Mn="UI_SHOW_SAVED_SEARCHES_DIALOG",Vn="UI_SHOW_SAVE_SEARCH_DIALOG",Bn="UI_SHOW_ADVANCED_SEARCH",zn="UI_SHOW_BULK_UPDATE",Hn="UI_SET_MARKER",Yn="UI_SET_HOVERED_ENTITY_URI",Wn="UI_SET_ACTIVE_ADDITIONAL_SEARCH",Gn="UI_SET_SEARCH_RESULTS_COLUMNS",qn="UI_CHANGE_SEARCH_RESULTS_COLUMNS",Zn="UI_SET_ENTITY_TYPE_TAB",$n="UI_UPDATE_TABLE_VIEW_TABS",Kn="UI_CHANGE_ORDER_SEARCH_RESULTS_COLUMNS",Qn="UI_CHANGE_SIZES_SEARCH_RESULTS_COLUMNS",Xn="UI_SET_LOADING",Jn="UI_CLEAR_NOTIFICATION",ea="UI_SET_NOTIFICATION",ta="UI_SET_SEARCH_RESULTS_MODE",ra="UI_SET_PREVIEW_PANEL_MODE",na={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},aa=I("showMoreFacetsPopup"),ia=I("showSavedSearchesDialog"),oa=I("showSaveSearchDialog"),la=I("showAdvancedSearch"),sa=I("showBulkUpdate"),ca=I("activeAdditionalSearch"),ua=I("activeMarker"),pa=I("hoveredEntityUri"),da=I("searchResultsMode"),ma=I("previewPanelMode"),ya=I("searchResultsColumns"),fa=I("entityTypeTab"),ga=I("tableViewTabs"),ha=I("loading"),Ea=I("notification"),ba=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:na,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Un:return aa.set(e,t.payload);case Mn:return ia.set(e,t.payload);case Vn:return oa.set(e,t.payload.show);case Bn:return la.set(e,t.payload);case zn:return sa.set(e,t.payload);case Wn:{const r=ca.get(e)===t.payload?null:t.payload;return ca.set(e,r)}case Hn:return ua.set(e,t.payload);case Yn:return pa.set(e,t.payload);case ta:return da.set(e,t.payload);case Gn:return ya.set(e,t.payload);case qn:{const{entityTypeUri:r,columns:n}=t.payload;return ya.compose(I(r)).set(e,n)}case Qn:{const{entityTypeUri:r,columns:n}=t.payload;return ya.compose(I(r)).set(e,n)}case Kn:{const{entityTypeUri:r,columns:n}=t.payload;return ya.compose(I(r)).set(e,n)}case ra:return ma.set(e,t.payload);case Zn:return fa.set(e,t.payload.entityTypeUri);case $n:return ga.set(e,t.payload);case wr.UPDATE_DATA:if((0,_.has)("type",t.payload))return ga.set(e,t.payload.type);break;case wr.CHANGE_VALUES:{const{facetFieldName:r,values:n}=t.payload;if("type"===r&&n.length){const t=fa.get(e);if(!n.includes(t))return fa.set(e,n[0])}break}case"UI_RESET":return na;case Xn:return ha.set(e,t.payload);case ea:return Ea.set(e,t.payload);case Jn:return Ea.set(e,null);case Sr.search.constants.UPDATE_STATE:{let r=la.set(e,(0,_.has)("advanced",t.payload));if(t.payload.view){const{searchResultsMode:e,entityTypeTab:n,searchResultsColumns:a,previewPanelMode:i}=t.payload.view;r=da.set(r,e),r=fa.set(r,n),(0,x.isEmptyValue)(a)||(r=ya.set(r,a)),r=ma.set(r,i)}return t.payload.showSavedSearchesDialog&&(r=ia.set(r,t.payload.showSavedSearchesDialog)),r}}return e};var va=r(37164);const Ta="ADVANCED_SEARCH_SET_GROUP_ENTITY_TYPES",Oa="ADVANCED_SEARCH_VERIFY_GROUP_ENTITY_TYPES",xa="ADVANCED_SEARCH_SET_GROUP_OPERATOR",Sa="ADVANCED_SEARCH_DELETE_GROUP",Ca="ADVANCED_SEARCH_ADD_GROUP",wa="ADVANCED_SEARCH_DUPLICATE_GROUP",Aa="ADVANCED_SEARCH_ADD_ATTRIBUTE_AFTER",Ra="ADVANCED_SEARCH_CHANGE_ATTRIBUTE_DATA",_a="ADVANCED_SEARCH_TOGGLE_ATTRIBUTE_SELECT",Na="ADVANCED_SEARCH_SET_ATTRIBUTE_OPERATOR",Ia="ADVANCED_SEARCH_DELETE_ATTRIBUTE",Da="ADVANCED_DELETE_ATTRIBUTE_AND_VERIFY_GROUP_ENTITY_TYPES",Pa="ADVANCED_SEARCH_DUPLICATE_ATTRIBUTE",ka="ADVANCED_SEARCH_SET_FILTER",La="ADVANCED_SEARCH_SET_VALUES",Fa="ADVANCED_SEARCH_ATTRIBUTE_SET_VALUES",ja="ADVANCED_SEARCH_ATTRIBUTE_FILTER_VALUES",Ua="ADVANCED_SEARCH_ATTRIBUTE_SET_FILTERED_VALUES",Ma="ADVANCED_SEARCH_ATTRIBUTE_UPDATE_VALUES",Va="ADVANCED_SEARCH_UPDATE",Ba="ADVANCED_SEARCH_CONVERT_FROM_FACETS";function za(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ha=(0,_.pipe)((0,_.propOr)([],"entityTypes"),(0,_.any)((0,_.complement)(x.isAvailableEntityType))),Ya=(0,_.pipe)((0,_.propOr)([],"entityTypes"),(0,_.filter)(x.isAvailableEntityType),(0,_.map)((0,_.prop)("uri"))),Wa=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return 0===t.length&&Ha(e)?Ya(e):t},Ga=(e,t)=>t&&Array.isArray(t.availableEntityTypes)?e.map((e=>t.availableEntityTypes.includes(e.value)?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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){za(e,t,r[t])}))}return e}({},e,{number:void 0}))):e;function qa(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Za=(0,_.curry)(((e,t)=>Ha(e)?t.length?t.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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){qa(e,t,r[t])}))}return e}({},t,{entityTypes:Wa(e,t.entityTypes||[])}))):[{entityTypes:Wa(e,[]),attributes:[],operator:q.value,id:"default"}]:t)),$a=(0,_.pipe)((0,_.map)((0,_.prop)("entityTypes")),_.flatten,(0,_.reject)(_.isNil),_.uniq),Ka=(0,_.pipe)((0,_.map)(x.getSearchGroupAttributeEntityTypeUri),(0,_.reject)(_.isNil),_.uniq),Qa=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if(!(0,_.isEmpty)(t)&&(0,_.isEmpty)(r))return{entityTypes:t,autoAddedEntityTypes:r};const n=r.filter((t=>e.includes(t))).concat((0,_.difference)(e,t));return(0,_.equals)(r,n)?{entityTypes:t,autoAddedEntityTypes:r}:{entityTypes:e,autoAddedEntityTypes:n}};function Xa(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ja(e,t,r[t])}))}return e}function Ja(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ei="operator",ti="values",ri="filter",ni=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:(0,va.x0)();return{[ei]:G.value,id:e}},ai=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,va.x0)();const r=ii(e);return{data:r,[ei]:G.value,[ri]:(0,_.pathOr)("",["filterOptions",0],r),id:t}},ii=e=>Xa({},e,{filterOptions:e.enforcedFilterOptions||(0,x.getFilterOptionsForQueryBuilder)(e.attrType,e.fieldName)}),oi=(0,_.curry)(((e,t)=>{const r=t.findIndex((t=>t.id===e));return r>-1?[r]:null})),li=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:oi;return(r,n)=>{const a=P(...e).get(r),i=t(n,a);return!!i&&P(...e,...i)}},si=(e,t)=>(r,n)=>{const a=e(r,n);return a&&a.compose(I(t))},ci=e=>(t,r,n)=>{const a=e(t,r);return a?a.get(t).findIndex((e=>e.id===n)):-1},ui=e=>(t,r,n)=>{const a=e(t,r),i=ci(e)(t,r,n);return-1!==i?a.compose(P(i)):null},pi=e=>(t,r,n,a,i)=>{const o=e(t,r,n);if(o){const e=Xa({},o.get(t));return e[a]=i,o.set(t,e)}return t},di=e=>(t,r,n,a)=>{const i=e(t,r,n);if(i)return i.get(t)[a]},mi=e=>{let{state:t,groupId:r,attributeId:n,attribute:a,getAttributesLens:i,getAttributeIndex:o}=e;const l=i(t,r);if(l){let e=[...l.get(t)];const i=o(t,r,n),s=!e[i+1];return-1!==i&&s?e.splice(i+1,0,a):-1!==i?(e.splice(i+1,0,Xa({},a,{operator:e[i].operator})),e[i]=Xa({},e[i],{operator:G.value})):e.push(a),l.set(t,e)}return t},yi=e=>{let{state:t,groupId:r,attributeId:n,attributeData:a,setAttributeProp:i,getAttributeLens:o}=e,l=t;if(a)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))})(t,r,n,a,o)&&(l=i(t,r,n,ri,a.filterOptions[0])),l=i(l,r,n,ti,[]),i(l,r,n,"data",a);{const e=o(t,r,n);return e&&(l=e.set(l,ni(n))),l}},fi=e=>{let{state:t,groupId:r,attributeId:n,operator:a,setAttributeProp:i}=e;return i(t,r,n,ei,a)},gi=e=>{let{state:t,groupId:r,attributeId:n,getAttributesLens:a}=e;const i=a(t,r);if(i){const e=[...i.get(t)],r=e.findIndex((e=>e.id===n));if(r>-1){const n=(0,_.remove)(r,1,e),a=n[r-1],o=e[r];return a&&(n[r-1]=Xa({},a,{operator:o.operator})),i.set(t,n)}}return t},hi=e=>{let{state:t,groupId:r,attributeId:n,id:a,getAttributesLens:i}=e;const o=i(t,r);if(o){const e=[...o.get(t)],r=e.findIndex((e=>e.id===n));if(r>-1)return e.push(Xa({},e[r],{id:a})),o.set(t,e)}return t},Ei=e=>{let{state:t,groupId:r,attributeId:n,filter:a,getAttributeProp:i,setAttributeProp:o}=e;const l=i(t,r,n,ri),s=(0,x.isCompatibleFilters)(l,a)?t:o(t,r,n,ti,[]);return o(s,r,n,ri,a)},bi=e=>{let{state:t,groupId:r,attributeId:n,values:a,setAttributeProp:i}=e;return i(t,r,n,ti,a)};function vi(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ti(e,t,r[t])}))}return e}function Ti(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Oi={searchParams:{groups:[]},attributesData:{}},xi="entityTypes",Si="attributes",Ci="autoAddedEntityTypes",wi=["groups"],Ai=P(...wi),Ri=li(wi),_i=si(Ri,Si),Ni=ci(_i),Ii=ui(_i),Di=pi(Ii),Pi=di(Ii),ki=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:(0,va.x0)();return{[Si]:e.map((e=>ai(e))),[ei]:q.value,[xi]:t,id:r}},Li=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Oi.attributesData,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Ua:{const{groupId:r,attributeId:n,values:a}=t.payload;return(0,_.assocPath)([r,n,"filtered"],a,e)}case Sa:{const{groupId:r}=t.payload;return(0,_.dissoc)(r,e)}case Ia:{const{groupId:r,attributeId:n}=t.payload;return(0,_.dissocPath)([r,n],e)}case wa:{const{groupId:r,id:n}=t.payload,a=e[r];return a?(0,_.assoc)(n,a,e):e}case Pa:{const{groupId:r,attributeId:n,id:a}=t.payload,i=(0,_.path)([r,n],e);return i?(0,_.assocPath)([r,a],i,e):e}case Ir:case Sr.search.constants.UPDATE_STATE:return Oi.attributesData;default:return e}},Fi=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Oi.searchParams,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Ca:{const{group:r}=t.payload,n=[...Ai.get(e)];return n.push(r),Ai.set(e,n)}case xa:{const{groupId:r,operator:n}=t.payload,a=Ri(e,r);if(a){const t=vi({},a.get(e));return t[ei]=n,a.set(e,t)}return e}case Ta:{const{groupId:r,entityTypes:n}=t.payload,a=Ri(e,r);if(a){const t=vi({},a.get(e));return t.entityTypes=n,t.autoAddedEntityTypes=[],t.attributes=[],a.set(e,t)}return e}case Oa:{const{groupId:r}=t.payload,n=Ri(e,r);if(n){const t=n.get(e),{entityTypes:r,autoAddedEntityTypes:a}=Qa(Ka(t.attributes||[]),t.entityTypes,t.autoAddedEntityTypes);return n.set(e,vi({},t,{[xi]:r,[Ci]:a}))}return e}case Sa:{const{groupId:r}=t.payload,n=[...Ai.get(e)],a=n.findIndex((e=>e.id===r));if(a>-1){const t=(0,_.remove)(a,1,n),r=t[a-1],i=n[a];return r&&(t[a-1]=vi({},r,{operator:i.operator})),Ai.set(e,t)}return e}case wa:{const{groupId:r,id:n}=t.payload,a=[...Ai.get(e)],i=a.findIndex((e=>e.id===r));return i>-1?(a.push(vi({},a[i],{id:n})),Ai.set(e,a)):e}case Aa:{const{groupId:r,attributeId:n,attribute:a}=t.payload;return mi({state:e,groupId:r,attributeId:n,attribute:a,getAttributesLens:_i,getAttributeIndex:Ni})}case Ra:{const{groupId:r,attributeId:n,attributeData:a}=t.payload;return yi({state:e,groupId:r,attributeId:n,attributeData:a,setAttributeProp:Di,getAttributeLens:Ii})}case Na:{const{groupId:r,attributeId:n,operator:a}=t.payload;return fi({state:e,groupId:r,attributeId:n,operator:a,setAttributeProp:Di})}case Ia:{const{groupId:r,attributeId:n}=t.payload;return gi({state:e,groupId:r,attributeId:n,getAttributesLens:_i})}case Pa:{const{groupId:r,attributeId:n,id:a}=t.payload;return hi({state:e,groupId:r,attributeId:n,id:a,getAttributesLens:_i})}case ka:{const{groupId:r,attributeId:n,filter:a}=t.payload;return Ei({state:e,groupId:r,attributeId:n,filter:a,getAttributeProp:Pi,setAttributeProp:Di})}case La:{const{groupId:r,attributeId:n,values:a}=t.payload;return bi({state:e,groupId:r,attributeId:n,values:a,setAttributeProp:Di})}case Ir:return Oi.searchParams;case Sr.search.constants.UPDATE_STATE:{const{advanced:e=[]}=t.payload;return Ai.set(Oi.searchParams,e)}default:return e}},ji=(e,t)=>{const r=((e,t)=>{if(t.type===Fa){var r;const{groupId:n,attributeId:a,values:i}=t.payload;return((null===(r=[...Ai.get(e.searchParams)].find((e=>e.id===n)))||void 0===r?void 0:r.attributes)||[]).some((e=>{let{id:t}=e;return t===a}))?(0,_.assocPath)(["attributesData",n,a,"default"],i,e):e}return e})((0,R.combineReducers)({searchParams:Fi,attributesData:Li})(e,t),t);return r},Ui="SAVED_SEARCHES_CREATE",Mi="SAVED_SEARCHES_SET_CURRENT",Vi="SAVED_SEARCHES_SET_CHANGE_INDICATOR",Bi="SAVED_SEARCHES_UPDATE",zi="SAVED_SEARCHES_LOAD",Hi="SAVED_SEARCHES_SET_TOTAL",Yi="SAVED_SEARCHES_SET_ITEMS",Wi="SAVED_SEARCHES_SET_ITEM_TOTAL",Gi="SAVED_SEARCHES_SET_PAGE",qi="SAVED_SEARCHES_SET_ROWS_PER_PAGE",Zi="SAVED_SEARCHES_SET_FILTERS",$i="SAVED_SEARCHES_SELECT_ITEM",Ki="SAVED_SEARCHES_SELECT_ALL_ITEMS",Qi="SAVED_SEARCHES_DESELECT_ALL_ITEMS",Xi="SAVED_SEARCHES_MARK_PUBLIC_REQUEST",Ji="SAVED_SEARCHES_MARK_PUBLIC",eo="SAVED_SEARCHES_MARK_FAVORITE_REQUEST",to="SAVED_SEARCHES_MARK_FAVORITE",ro="SAVED_SEARCHES_MARK_GLOBAL_FILTER_REQUEST",no="SAVED_SEARCHES_CHANGE_ITEM_NAME_REQUEST",ao="SAVED_SEARCHES_CHANGE_ITEM_NAME",io="SAVED_SEARCHES_SET_EDITING",oo="SAVED_SEARCHES_DELETE_SELECTED_ITEMS_REQUEST",lo="SAVED_SEARCHES_DELETE_ITEM_REQUEST",so="SAVED_SEARCHES_DELETE_ITEMS",co="SAVED_SEARCHES_SET_LOADING",uo="SAVED_SEARCHES_SET_SEARCH_VALUE",po="SAVED_SEARCHES_APPLY_ITEM",mo="SAVED_SEARCHES_SET_TOTAL_LOADING",yo="SAVED_SEARCHES_LOAD_TOTAL",fo="SAVED_SEARCHES_TOGGLE_SORT",go="RECENT_SEARCHES_CREATE",ho="RECENT_SEARCHES_LOAD",Eo="RECENT_SEARCHES_SET_ITEMS",bo="RECENT_SEARCHES_SET_ITEM_TOTAL",vo="RECENT_SEARCHES_SELECT_ITEM",To="RECENT_SEARCHES_SELECT_ALL_ITEMS",Oo="RECENT_SEARCHES_DESELECT_ALL_ITEMS",xo="RECENT_SEARCHES_DELETE_SELECTED_ITEMS_REQUEST",So="RECENT_SEARCHES_DELETE_ITEMS",Co="RECENT_SEARCHES_DELETE_ITEM_REQUEST",wo="RECENT_SEARCHES_SET_LOADING",Ao="RECENT_SEARCHES_SET_SEARCH_VALUE",Ro="RECENT_SEARCHES_SET_LAST_SAVED",_o="RECENT_SEARCHES_SET_TOTAL_LOADING",No="RECENT_SEARCHES_LOAD_TOTAL",Io="RECENT_SEARCHES_APPLY_ITEM";function Do(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Po(e,t,r[t])}))}return e}function Po(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ko={currentSearch:null,postSavingAction:null,changeIndicator:!1,items:[],loading:!1,total:0,page:0,rowsPerPage:j[0],searchValue:"",findPublic:!0,favoriteOnly:!1,sorting:{order:J,field:Q}},Lo=I("changeIndicator"),Fo=I("items"),jo=I("total"),Uo=I("page"),Mo=I("loading"),Vo=I("postSavingAction"),Bo=I("sorting"),zo=(e,t,r)=>{const n=Fo.get(r).findIndex((e=>e.uri===t)),a=Fo.compose(P([n])),i=a.get(r);return a.set(r,e(i))},Ho=e=>e===J?"asc":J,Yo=(e,t,r)=>(0,_.evolve)({page:(0,_.always)(0),[e]:(0,_.always)(t)},r),Wo=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ko,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Mi:return(0,_.evolve)({currentSearch:(0,_.always)(t.payload),changeIndicator:null===t.payload?(0,_.always)(!1):_.identity},e);case Ir:return(0,_.evolve)({currentSearch:(0,_.always)(null),changeIndicator:(0,_.always)(!1)},e);case Vi:return Lo.set(e,t.payload);case Hi:return jo.set(e,t.payload);case Gi:return Uo.set(e,t.payload);case qi:return Yo("rowsPerPage",t.payload,e);case Zi:{const{findPublic:r,favoriteOnly:n}=t.payload;return(0,_.evolve)({page:(0,_.always)(0),findPublic:(0,_.always)(r),favoriteOnly:(0,_.always)(n)},e)}case Yi:return Fo.set(e,t.payload);case $i:{const{uri:r,checked:n}=t.payload;return zo((e=>Do({},e,{checked:n})),r,e)}case Qi:{const t=Fo.get(e);return Fo.set(e,t.map((0,_.omit)(["checked"])))}case Ki:{const t=Fo.get(e);return Fo.set(e,t.map((0,_.ifElse)((0,_.prop)("isOwnSearch"),(0,_.assoc)("checked",!0),_.identity)))}case so:{const r=t.payload,n=Fo.get(e),a=jo.set(e,jo.get(e)-r.length);return Fo.set(a,n.filter((e=>!r.includes(e.uri))))}case Ji:{const{uri:r,isPublic:n}=t.payload;return zo((e=>Do({},e,{isPublic:n})),r,e)}case to:{const{uri:r,isFavorite:n}=t.payload;return zo((e=>Do({},e,{isFavorite:n})),r,e)}case Wi:{const{uri:r,total:n}=t.payload;return zo((e=>Do({},e,{total:n})),r,e)}case io:{const{uri:r,isEditing:n}=t.payload;return zo((e=>Do({},e,{isEditing:n})),r,e)}case no:{const{uri:r}=t.payload;return zo((0,_.omit)(["isEditing"]),r,e)}case ao:{const{uri:r,name:n}=t.payload;return zo((e=>Do({},e,{name:n})),r,e)}case co:return Mo.set(e,t.payload);case Ao:case uo:return Yo("searchValue",t.payload,e);case zi:return Do({},e,{page:0,findPublic:!0,favoriteOnly:!1});case fo:{const r=t.payload,n=(0,_.path)(["sorting","field"],e),a=(0,_.path)(["sorting","order"],e);return Bo.set(e,{field:r,order:Ho(r===n?a:null)})}case mo:{const{uri:r,isLoading:n}=t.payload;return zo((e=>Do({},e,{isTotalLoading:n})),r,e)}case Vn:return Vo.set(e,t.payload.postSavingAction);case Mn:return Yo("searchValue",ko.searchValue,e)}return e};function Go(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){qo(e,t,r[t])}))}return e}function qo(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Zo={items:[],filterWord:null,loading:!1,lastSavedRecentSearch:null},$o=I("items"),Ko=I("loading"),Qo=I("filterWord"),Xo=I("lastSavedRecentSearch"),Jo=(e,t,r)=>{const n=$o.get(r).findIndex((e=>e.createdDate===t)),a=$o.compose(P([n])),i=a.get(r);return a.set(r,e(i))},el=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Zo,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case uo:case Ao:return Qo.set(e,t.payload);case Eo:return $o.set(e,t.payload);case vo:{const{searchCreatedDate:r,checked:n}=t.payload;return Jo((e=>Go({},e,{checked:n})),r,e)}case Oo:{const t=$o.get(e);return $o.set(e,t.map((0,_.omit)(["checked"])))}case To:{const t=$o.get(e);return $o.set(e,t.map((0,_.assoc)("checked",!0)))}case So:{const r=(t.payload||[]).map((0,_.prop)("createdDate")),n=$o.get(e);return $o.set(e,n.filter((e=>!r.includes(e.createdDate))))}case bo:{const{searchCreatedDate:r,total:n}=t.payload;return Jo((e=>Go({},e,{total:n})),r,e)}case wo:return Ko.set(e,t.payload);case Ro:return Xo.set(e,t.payload);case _o:{const{searchCreatedDate:r,isLoading:n}=t.payload;return Jo((e=>Go({},e,{isTotalLoading:n})),r,e)}case Mn:return Qo.set(e,Zo.filterWord)}return e},tl="ENTITY_SET_LOADING",rl="ENTITY_LOAD_ENTITY_REQUEST",nl="ENTITY_SET_SELECTED_ENTITY_URI",al="ENTITY_SET_ENTITY",il={loading:!1,selectedEntityUri:null,entity:null},ol=I("loading"),ll=I("selectedEntityUri"),sl=I("entity"),cl=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:il,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case tl:return ol.set(e,t.payload);case nl:return ll.set(e,t.payload);case al:return sl.set(e,t.payload);case Sr.profile.constants.ProfileActions.ADD_NEXT_PAGE_ATTRIBUTE_VALUES:{const{parentUri:r,attributeTypeName:n,attributeTypeUri:a,values:i}=t.payload,o=(0,x.getAttributeSource)(a);if(e.entity&&r===e.entity.uri){const t=(0,_.lensPath)(["entity",o,n]);return(0,_.over)(t,(0,_.pipe)((0,_.defaultTo)([]),(0,_.concat)(_.__,i)),e)}return e}case Sr.search.constants.SEARCH_RESULTS_SET:if((0,x.isEmptyValue)(t.payload)){const t=sl.set(e,il.entity);return ll.set(t,il.selectedEntityUri)}return e}return e},ul="BULK_UPDATE_SET_ACTIVE_STEP",pl="BULK_UPDATE_INIT",dl="BULK_UPDATE_TOGGLE_SELECTION_MODE",ml="BULK_UPDATE_SELECT_ENTITY",yl="BULK_UPDATE_SELECT_ALL_ENTITIES_ON_PAGE",fl="BULK_UPDATE_SET_LOADING",gl="BULK_UPDATE_CHANGE_ROWS_PER_PAGE",hl="BULK_UPDATE_CHANGE_PAGE",El="BULK_UPDATE_CHANGE_SORT",bl="BULK_UPDATE_CHANGE_COLUMNS",vl="BULK_UPDATE_UPDATE_ENTITIES",Tl="BULK_UPDATE_SET_FILTER_TEXT",Ol="BULK_UPDATE_SET_TOTAL",xl="UPDATE_BULK_UPDATE_CURRENT_ENTITIES",Sl="BULK_UPDATE_SET_OPERATION",Cl="BULK_UPDATE_SET_ACTION_ATTRIBUTE",wl="BULK_UPDATE_SET_ACTION_OPERATION",Al="BULK_UPDATE_ADD_OPERATION_PARAMETERS",Rl="BULK_UPDATE_DELETE_ACTION",_l="BULK_UPDATE_TOGGLE_CONDITIONS",Nl="BULK_UPDATE_ADD_CONDITION_AFTER",Il="BULK_UPDATE_CHANGE_CONDITION_DATA",Dl="BULK_UPDATE_TOGGLE_CONDITION_SELECT",Pl="BULK_UPDATE_DELETE_CONDITION",kl="BULK_UPDATE_SET_CONDITION_FILTER",Ll="BULK_UPDATE_SET_CONDITION_VALUES",Fl="BULK_UPDATE_TOGGLE_ACTION_PIN",jl="BULK_UPDATE_TOGGLE_ACTION_ADD_NESTED",Ul="BULK_UPDATE_CONFIRM",Ml="BULK_UPDATE_SET_REQUEST_PENDING";function Vl(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Bl(e,t,r[t])}))}return e}function Bl(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const zl={objects:{selectionMode:ie,selectedEntities:[],entities:[],total:0,page:0,rowsPerPage:j[0],filterText:"",sortOrder:null,sortField:null,selectedColumns:[]},actions:[],operation:null,activeStep:0,loading:!1,requestPending:!1},Hl=I("activeStep"),Yl=I("operation"),Wl=I("loading"),Gl=I("requestPending"),ql=P("objects","total"),Zl=P("objects","page"),$l=P("objects","rowsPerPage"),Kl=P("objects","selectionMode"),Ql=P("objects","entities"),Xl=P("objects","selectedEntities"),Jl=P("objects","filterText"),es=e=>Kl.get(e)===ae,ts=P("objects","sortOrder"),rs=P("objects","sortField"),ns=P("objects","selectedColumns"),as=["actions"],is=P(...as),os=e=>{let{groupId:t,state:r}=e;if(t){const e=is.get(r).findIndex((e=>e.id===t));if(-1!==e)return[...as,e,"actions"]}return as},ls=(e,t)=>({id:(0,va.x0)(),operation:e,operationParameters:t}),ss=e=>((0,_.path)(["attributeTypeData","fieldName"],e)||[]).split(".").slice(0,2).join("."),cs=(e,t)=>({id:(0,va.x0)(),fieldName:ss(t),actions:[ls(e,t)]}),us=e=>{let{state:t,id:r,groupId:n,operation:a,operationParameters:i,togglePin:o,toggleAddNested:l}=e;const s=os({state:t,groupId:n}),c=P(...s).get(t),u=!n&&(0,_.prop)("attributeTypeData",i)&&(e=>{let{attributeType:t,fieldName:r=""}=e;return(0,x.isComplexAttribute)(t)||r.split(".").length>2})(i.attributeTypeData);if(r){const e=c.findIndex((e=>e.id===r)),n=P(...s,e),d=Vl({},n.get(t));if(a&&d.operation!==a){if(d.operationParameters){const e=[d.operation,a].includes(se.RepointReference)?[]:ue[a];d.operationParameters=(0,_.omit)((0,_.without)(e,["attributeValue","attributeValueToFind"]),d.operationParameters)}d.operation=a}return i&&(d.operationParameters=(0,_.reject)(_.isNil,Vl({},d.operationParameters,i))),o&&(d.operationParameters=Vl({},d.operationParameters,{pin:!(0,_.path)(["operationParameters","pin"],d)})),l&&(d.operationParameters=Vl({},d.operationParameters,{addNestedAttribute:!(0,_.path)(["operationParameters","addNestedAttribute"],d)})),n.set(t,u?cs((p=d).operation,p.operationParameters):d)}{const e=(0,_.reject)(_.isNil,i),r=u?cs(a,e):ls(a,e);return P(...s,c.length).set(t,r)}var p},ps=li(as),ds=si(ps,"conditions"),ms=ci(ds),ys=ui(ds),fs=pi(ys),gs=di(ys),hs=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:zl,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ul:return Hl.set(e,t.payload);case pl:return Vl({},zl,{objects:Vl({},zl.objects,t.payload)});case vl:return Ql.set(e,t.payload);case dl:{const t=Kl.set(e,es(e)?ie:ae);return Xl.set(t,[])}case ml:{const{uri:r,checked:n}=t.payload,a=Xl.get(e),i=es(e);return Xl.set(e,!!n==!!i?(0,_.uniq)(a.concat(r)):(0,_.without)(r,a))}case yl:{const r=t.payload,n=es(e),a=Xl.get(e),i=Ql.get(e).map((0,_.prop)("uri"));return Xl.set(e,!!r==!!n?(0,_.uniq)(a.concat(i)):(0,_.without)(i,a))}case fl:return Wl.set(e,t.payload);case hl:return Zl.set(e,t.payload);case gl:{const r=Zl.set(e,0);return $l.set(r,t.payload)}case El:{const{order:r,field:n}=t.payload,a=rs.set(e,n);return ts.set(a,r)}case bl:return ns.set(e,t.payload);case Ol:return ql.set(e,t.payload);case Tl:{const{filterText:r}=t.payload;return Jl.set(e,r)}case Sl:return Yl.set(e,t.payload);case Cl:{const{id:r,groupId:n,attribute:a}=t.payload;return us({state:e,id:r,groupId:n,operationParameters:{attributeTypeData:a,attributeValue:null,attributeValueToFind:null,pin:null,addNestedAttribute:null}})}case wl:{const{id:r,groupId:n,operation:a}=t.payload;return us({state:e,id:r,groupId:n,operation:a})}case Al:{const{id:r,groupId:n,operationParameters:a}=t.payload;return us({state:e,id:r,groupId:n,operationParameters:a})}case Fl:{const{id:r,groupId:n}=t.payload;return us({state:e,id:r,groupId:n,togglePin:!0})}case jl:{const{id:r,groupId:n}=t.payload;return us({state:e,id:r,groupId:n,toggleAddNested:!0})}case Rl:{const{id:r,groupId:n}=t.payload,a=os({state:e,groupId:n}),i=P(...a),o=i.get(e);return i.set(e,o.filter((e=>e.id!==r)))}case _l:{const r=t.payload,n=is.get(e).findIndex((e=>e.id===r)),a=P(...as,n),i=a.get(e);return a.set(e,i.conditions?(0,_.omit)(["conditions"],i):(0,_.assoc)("conditions",[],i))}case Nl:{const{groupId:r,attributeId:n,attribute:a}=t.payload;return mi({state:e,groupId:r,attributeId:n,attribute:a,getAttributesLens:ds,getAttributeIndex:ms})}case Il:{const{groupId:r,attributeId:n,attributeData:a}=t.payload;return yi({state:e,groupId:r,attributeId:n,attributeData:a,setAttributeProp:fs,getAttributeLens:ys})}case Pl:{const{groupId:r,attributeId:n}=t.payload;return gi({state:e,groupId:r,attributeId:n,getAttributesLens:ds})}case kl:{const{groupId:r,attributeId:n,filter:a}=t.payload;return Ei({state:e,groupId:r,attributeId:n,filter:a,getAttributeProp:gs,setAttributeProp:fs})}case Ll:{const{groupId:r,attributeId:n,values:a}=t.payload;return bi({state:e,groupId:r,attributeId:n,values:a,setAttributeProp:fs})}case Ml:return Gl.set(e,t.payload)}return e};var Es=r(85383),bs=r(52180);const vs=e=>"object"==typeof e&&null!==e,Ts=(e,t)=>new bs.Decimal(e).add(t),Os=(e,t)=>new bs.Decimal(e).sub(t),xs=(e,t)=>new bs.Decimal(e).div(t),Ss=(e,t)=>new bs.Decimal(e).mul(t),Cs=(e,t)=>(0,bs.Decimal)(e).greaterThan(t),ws=(e,t)=>new bs.Decimal(e).greaterThanOrEqualTo(t),As=(e,t)=>new bs.Decimal(e).lessThan(t),Rs=(e,t)=>new bs.Decimal(e).lessThanOrEqualTo(t),_s=e=>new bs.Decimal(e).floor(),Ns=e=>new bs.Decimal(e).ceil(),Is=(e,t)=>bs.Decimal.min(e,t),Ds=(e,t)=>bs.Decimal.max(e,t),Ps=(e,t)=>new bs.Decimal(e).equals(t),ks=(e,t,r)=>{if(new bs.Decimal(e).gt(t))throw new Error("min must not be greater than max in clamp(min, max, value)");const n=new bs.Decimal(r);return n.lt(e)?e:n.gt(t)?t:r},Ls=(e,t)=>new bs.Decimal(e).toFixed(t),Fs=(e,t)=>Number(e)+Number(t),js=(e,t)=>e-t,Us=(e,t)=>e/t,Ms=(e,t)=>e*t,Vs=(e,t)=>Number(e)>Number(t),Bs=(e,t)=>Number(e)>=Number(t),zs=(e,t)=>Number(e)<Number(t),Hs=(e,t)=>Number(e)<=Number(t),Ys=e=>Math.floor(e),Ws=e=>Math.ceil(e),Gs=(e,t)=>Math.min(e,t),qs=(e,t)=>Math.max(e,t),Zs=(e,t)=>e===t,$s=(e,t,r)=>(0,_.clamp)(Number(e),Number(t),Number(r)),Ks=(e,t)=>Number(e).toFixed(t);(0,_.compose)(JSON.parse,JSON.stringify);const Qs=(e,t)=>{if(!(e=>!isNaN(parseFloat(e))&&isFinite(e))(e))return"";const r=Xs(bs.Decimal.isDecimal(e)&&"Long");return r.lessThanOrEqualTo(e,Number.MAX_SAFE_INTEGER)&&r.greaterThanOrEqualTo(e,Number.MIN_SAFE_INTEGER)?r.greaterThan(e,t||1e3)?L().number(e,"0,0.0a").toUpperCase():L().number(e,"0,0[.]0"):r.greaterThan(e,t||1e3)?L().number(r.div(e,1e12),"0,0.0")+"T":e.toString()},Xs=e=>"Long"===e?a:i,Js=()=>{},ec=(0,_.memoizeWith)(_.identity,(e=>[e])),tc=e=>{const t=Xs(e),r=(e,r)=>t.toFixed(t.div(t.minus(e,r.offset),r.ratio),0);return{NumMath:t,getRange:(e,r)=>{const n=(0,_.pathOr)((0,_.pathOr)(null,["value",0],(0,_.head)(r)),[0,0],e),a=(0,_.pathOr)((0,_.pathOr)(null,["value",1],(0,_.last)(r)),[0,1],e);return null===n||null===a?[]:t.lessThanOrEqualTo(n,a)?[n,a]:[a,n]},formatNumberForRangeFacet:e=>t.greaterThan(e,1e4)?Qs(e,1e4):e.toString(),getBarDomain:e=>e.length>0?[(0,_.head)(e).value[0],(0,_.last)(e).value[1]]:[],calcScale:(t,r)=>{if("Long"===e){const e=r.minus(t),n=e.div(2).gt(Number.MAX_SAFE_INTEGER)?new bs.Decimal(Number.MAX_SAFE_INTEGER).mul(2).div(e):1,a=t.mul(n),i=r.mul(n);return{ratio:n,offset:a.lt(Number.MIN_SAFE_INTEGER)?new bs.Decimal(Number.MIN_SAFE_INTEGER).minus(a):i.gt(Number.MAX_SAFE_INTEGER)?new bs.Decimal(Number.MAX_SAFE_INTEGER).minus(i):0}}return{ratio:1,offset:0}},revertScale:r,applyScale:(e,r)=>Number(t.plus(t.mul(e,r.ratio),r.offset)),bigNumbersTickFormatterX:(e,t)=>n=>e(r(n,t)),adjustRange:(e,r,n)=>{const a=e[0],i=e[1];return[(0,_.isNil)(r)?a:t.max(a,r),(0,_.isNil)(n)?i:t.min(i,n)]},equals:function(){return t.equals(...arguments)},addRanges:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0;if(0===e.length)return[];const i=e[0].value,o=e[e.length-1].value,l=t.greaterThan(i,r)?(0,_.unfold)((e=>!!t.lessThan(e,i)&&[{value:e,number:0},t.plus(e,a)]),r):[],s=t.lessThan(o,t.minus(n,a))?(0,_.unfold)((e=>!!t.lessThanOrEqualTo(e,n)&&[{value:e,number:0},t.plus(e,a)]),t.plus(o,a)):[];return[...l,...e,...s]},getInterval:function(r,n){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:50;return r===n?1:(0,x.isFloatingType)(e)?(n-r)/a:t.ceil(t.div(t.minus(n,r),a))}}};function rc(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){nc(e,t,r[t])}))}return e}function nc(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ac=(e,t)=>t.find((t=>[t.fieldName,`${t.fieldName}.ov`].includes(e)))||(console.warn(`Can't find facet config for ${e} fieldName`),null),ic=(e,t,r,n,a)=>Object.keys(t).reduce(((i,o)=>{const l=ac(o,r);if(l){const r=l.fieldName;i[r]=bc(e,r,t[o],l,n,a)}return i}),{}),oc=(e,t)=>t.number-e.number,lc=e=>{let{number:t}=e;return t>0},sc=e=>(0,_.either)(lc,(e=>{let{values:t=[]}=e;return e=>{let{value:r}=e;return t.includes(r)}})(e)),cc=(0,_.anyPass)([sr,(0,_.propEq)("fieldName","sourceSystems"),(0,_.propEq)("fieldName","roles"),(0,_.pipe)((0,_.prop)("attrType"),x.isEnumAttrType)]),uc=e=>Object.keys(e).map((t=>({value:t,number:e[t],label:t}))).sort(oc),pc=(e,t)=>{const r=Xs(t);return Object.keys(e).map((r=>({value:"Long"===t?new bs.Decimal(r):+r,number:e[r],label:r}))).sort(((e,t)=>r.minus(e.value,t.value)))},dc=(e,t)=>uc(e).map((e=>rc({},e,{label:(0,x.getLookupLabel)(e.value,(0,_.path)([e.value,"displayName"],t))}))),mc=(e,t)=>t.map((t=>({value:t,label:t,number:e[t]||0}))).sort(oc),yc=(e,t)=>Object.keys(e).map((r=>({value:r,number:e[r],label:(0,x.formatDataTypeValue)({dataTypeDefinition:t},r)}))).sort(oc),fc=(e,t,r)=>{const{entityTypes:n}=e;return n.filter(r?e=>{let{uri:t}=e;return r.includes(t)}:_.identity).sort(r?(0,x.orderByArrayComparator)(r,"uri"):e=>0).map((r=>{const n=(0,x.getLastUriPart)(r.uri);return(0,x.isAvailableEntityType)(r)?{value:r.uri,number:t[n]||0,label:(0,x.getEntityTypeLabel)(e,{type:r.uri})||n}:null})).filter(_.identity)},gc=(e,t,r)=>{const{roles:n}=e;return n.map((e=>{const r=(0,x.getLastUriPart)(e.uri);return{value:e.uri,label:e.label,number:t[r]||0}})).filter(sc(r)).sort(oc)},hc=(e,t,r)=>{const{sources:n}=e;return n.map((e=>{const r=(0,x.getLastUriPart)(e.uri);return{value:r,number:t[r]||0,label:e.label||r}})).filter(sc(r)).sort(oc)},Ec=(e,t,r)=>{const n=(0,x.getEntityType)(e,r.entityTypeUri),a=n&&n.matchGroups||[];return(0,_.uniqBy)((0,_.prop)("value"),[...a.map((e=>{let{uri:r,label:n}=e;return{isRaw:!1,value:r,number:t[r]||0,label:n||r}})),...Object.entries(t).map((e=>{let[t,r]=e;const n=(0,_.find)((0,_.propEq)("uri",t))(a),i=!n;return{value:t,number:r,label:i?t:n.label,isRaw:i}}))]).filter(sc(r)).sort(oc)},bc=function(e,t,r,n){var a;let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},o=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};switch(t){case"type":{const{allowedEntityTypes:t}=o;return fc(e,r,t)}case"roles":return gc(e,r,n);case"sourceSystems":return hc(e,r,n)}if(sr(n))return Ec(e,r,n);if(or(n))return dc(r,i[(0,x.getAttrTypeLookupCode)(n.attrType)]);if((0,x.isEnumAttrType)(n.attrType))return mc(r,(0,_.path)(["attrType","values"],n));if((0,x.isBooleanType)(null===(a=n.attrType)||void 0===a?void 0:a.type))return yc(r,(0,x.getAttrDataTypeDefinition)(n.attrType));switch(n.type){case x.FACET_TYPES.NUMERIC_RANGE_FACET:case x.FACET_TYPES.DATE_RANGE_FACET:return pc(r,n.attrType&&n.attrType.type);default:return uc(r)}},vc=e=>{switch(e){case x.FACET_TYPES.DATE_RANGE_FACET:return[U,M];case x.FACET_TYPES.NUMERIC_RANGE_FACET:default:return[0,1e4]}},Tc=((0,_.curry)(((e,t)=>(Object.values(t).map((t=>t.filter((e=>isNaN(e.value))).forEach((t=>t.value=e)))),t))),(e,t)=>isNaN(t)?e:t),Oc=(e,t)=>t.find((t=>t.fieldName===e||t.fieldNameForRequest===e)),xc=(e,t)=>{const r=t.reduce(((e,t)=>(e[t.fieldName]=t,e)),{});return Object.keys(e).reduce(((t,n)=>{const a=r[n];return t[n]=rc({},e[n],a),t}),{})},Sc=e=>Object.keys(e).reduce(((t,r)=>(t[r]=rc({},e[r],{filter:wc(e[r].type)}),t)),{}),Cc=(0,_.path)(["facets","facetsData","type"]),wc=e=>({entityTypeFacet:"equals",facetWithDropdownCheckboxes:"equals",numericRangeFacet:"range",dateRangeFacet:"range"}[e]),Ac=(0,_.pipe)((0,_.propOr)([],"values"),_.length,(0,_.gt)(_.__,7)),Rc=(0,_.pipe)((0,_.pipe)((0,_.filter)(or),(0,_.map)((e=>({type:(0,x.getAttrTypeLookupCode)((0,_.path)(["attrType"],e)),codeValues:(0,_.flatten)((0,_.propOr)([],"values",e))}))),(0,_.filter)((e=>{let{codeValues:t}=e;return t.length>0}))),x.mergeLookupsLists);var _c=r(33192),Nc=r.n(_c);const Ic=(e,t,r)=>{const n=Dc(t);if(n.length){const i=kc(e,t,r),o=Pc(e,t,r),l=o.every((e=>(0,x.isTypeSearchGroupAttribute)({data:e})||i.some((0,_.eqProps)("fieldName",e)))),s=(0,x.areAllOperatorsAnd)(t),c=(0,x.areAllOperatorsAnd)(n),u=n.every((e=>{let{filter:t,data:{attrType:r={}}}=e;return[x.FilterOptions.EQUALS,x.FilterOptions.IN_RANGE,x.FilterOptions.FULL_TEXT,x.FilterOptions.ON,x.FilterOptions.WITHIN].includes(t)||x.FilterOptions.EXISTS===t&&(0,x.isBooleanType)(r.type)})),p=(a=n,!Object.values(a.reduce(((e,t)=>{let{data:{fieldName:r},filter:n,values:a}=t;return n===x.FilterOptions.EQUALS&&(0,_.path)([0,"length"],a)&&(e[r]=e[r]&&e[r]+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},Dc=e=>e.flatMap((e=>e.attributes)).filter((0,_.has)("data")),Pc=(e,t,r)=>{const n=Dc(t).map((e=>{let{data:{fieldName:t,entityTypeUri:r},filter:n,values:a}=e;return{entityTypeUri:r,fieldName:t,filter:n,values:a}})).reduce(((t,n)=>{let{entityTypeUri:a,fieldName:i,filter:o,values:l}=n;const{attrType:s}=a?nr(e,[a],[],r).find((e=>e.fieldName===i))||{}:wt(i,r)||{},c=!(0,_.isNil)(s)&&s.faceted?((e,t,r,n)=>{if(![x.FilterOptions.EQUALS,x.FilterOptions.IN_RANGE].includes(t)&&![x.FilterOptions.ON,x.FilterOptions.WITHIN].includes(t)||!Array.isArray(e)||(0,x.isEmptyValue)(e[0]))return(0,x.isBooleanType)(n)&&t===x.FilterOptions.EXISTS?[!0,!1]:e&&!(0,x.isEmptyValue)(e[0])?[e[0]]:[];switch(r){case x.FACET_TYPES.NUMERIC_RANGE_FACET:return((e,t)=>{switch(t){case x.FilterOptions.EQUALS:return e.map((e=>[e,e]));case x.FilterOptions.IN_RANGE:return e.some(x.isEmptyValue)?[]:[e]}})(e[0],t);case x.FACET_TYPES.DATE_RANGE_FACET:return((e,t)=>{switch(t){case x.FilterOptions.ON:{const t=Nc()(e),r=!(0,x.isTimestampBasedType)(n);return[[x.utils.dates.getStartOfDay(t,r),x.utils.dates.getEndOfDay(t,r)]]}case x.FilterOptions.WITHIN:return(0,x.isDateRangeValue)(e)?[(0,x.getDateRangeByValue)(e)]:e.some(x.isEmptyValue)?[]:[e]}})(e[0],t);default:return e[0]}})(l,o,(0,x.getFacetTypeForAttrType)(s),s.type):l;return(0,_.isNil)(c)||(t[i]=(0,_.uniq)((t[i]||[]).concat(c))),t}),{}),a=Object.keys(n).map((e=>({fieldName:e,values:n[e]})));return a.some((e=>{let{values:t}=e;return t&&Array.isArray(t[0])&&t.length>1}))?[]:a},kc=(e,t,r)=>{const n=$a(t);return nr(e,n,[],r)},Lc=(e,t)=>({type:Ar,payload:{searchResults:e,entityTypeUri:t}}),Fc=()=>({type:_r}),jc=e=>{let{silent:t}=e;return{type:Ir,payload:{silent:t}}},Uc=e=>{let{entityTypeUri:t,keywordValue:r}=e;return{type:Dr,payload:{entityTypeUri:t,keywordValue:r}}},Mc=e=>({type:Pr,payload:e}),Vc=e=>({type:Ur,payload:e}),Bc=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:Mr,payload:{value:e,searchType:t,silent:r}}},zc=(e,t)=>({type:wr.CREATE_FACETS,payload:{facetsConfigs:e,addToEnd:t}}),Hc=e=>({type:wr.DESTROY_FACETS,payload:e}),Yc=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:wr.CHANGE_VALUES,payload:{facetFieldName:e,values:t,silent:r}}},Wc=e=>({type:wr.UPDATE_DATA,payload:e}),Gc=e=>({type:wr.UPDATE_FILTERED_DATA,payload:e}),qc=e=>{let{facetsToAdd:t,fieldNamesToDelete:r,changedEntityTypes:n,addToEnd:a}=e;return{type:wr.HANDLE_CONFIGS_CHANGES,payload:{facetsToAdd:t,fieldNamesToDelete:r,changedEntityTypes:n,addToEnd:a}}};var Zc=r(97698);function $c(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Kc=e=>e===V,Qc=(0,_.curry)((function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const n=x.Maybe.fromNull((0,x.getEntityType)(e,t)).orSome({});return eu(r).concat(tu((n.attributes||[]).concat(n.analyticsAttributes||[])))})),Xc=(0,x.memoizeWith)(((e,t)=>t),Qc(_.__,_.__,["label"])),Jc=(e,t,r)=>r&&au(Xc(e,t),(e=>!r.some((t=>e.id===t.id)))),eu=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return[{id:"label",label:L().text("Profile")},{id:"entityId",label:L().text("Entity ID")}].filter((t=>!e.includes(t.id)))},tu=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.filter(x.isReadableAttribute).map((e=>{const t={id:Me(e.uri),label:e.label||(0,x.getLastUriPart)(e.uri),attrType:e},r=e.attributes||e.analyticsAttributes;return"Nested"===e.type&&r&&(t.children=tu(r)),t}))},ru=(e,t)=>{let r=null;const n=e=>{e.some((e=>e.id===t?(r=e,!0):e.children?n(e.children,t):void 0))};return n(e),r},nu=e=>(0,_.flatten)((e.children||[]).map((e=>e.children?nu(e):[e]))),au=(e,t)=>e.filter(t).map((e=>e.children?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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){$c(e,t,r[t])}))}return e}({},e,{children:au(e.children,t)}):e)),iu=(e,t,r)=>{const n=Qc(e,t);return(0,_.uniq)((0,_.pipe)((0,_.concat)(["label"]),(0,_.map)((e=>ru(n,e))),(0,_.reject)(_.isNil),(0,_.filter)((0,_.pipe)((0,_.prop)("attrType"),(0,_.complement)(x.isNested))))(r))},ou=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const n=fc(e,{},t),a=(0,_.prop)("*",r);return n.reduce(((t,n)=>{const i=r[n.value]||a;return t[n.value]=(0,_.isNil)(i)?eu():iu(e,n.value,i),t}),{})},lu=e=>(t,r)=>e.indexOf(t.value)-e.indexOf(r.value),su=function(e){let{entityTypes:t}=e,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];const a=(0,_.pluck)("uri",t),i=lu(a),o=lu(n),l=r.filter((e=>{let{value:t}=e;return 0===n.length||n.includes(t)}));return(0,_.sort)(0===n.length?i:o,l)},cu=e=>{const t=eu();return(0,_.uniq)(e.filter((e=>!t.find((t=>t.id===e.id)))).map((0,_.pipe)((0,_.prop)("id"),Ve)))},uu=(e,t)=>{const r=cu(e),n=cu(t);return!(0,_.equals)((0,_.intersection)(r,n),r)},pu=e=>e.explorer,du=e=>e.explorer.ui.loading,mu=e=>e.explorer.ui.showMoreFacetsPopup,yu=e=>(0,_.pathOr)(!1,[F,"ui","showSavedSearchesDialog"],e),fu=e=>(0,_.pathOr)(!1,[F,"ui","showAdvancedSearch"],e),gu=e=>(0,_.pathOr)(!1,[F,"ui","showBulkUpdate"],e),hu=e=>e.explorer.ui.activeMarker,Eu=e=>e.explorer.ui.hoveredEntityUri,bu=e=>e.explorer.ui.searchResultsMode||z,vu=(0,_.pathOr)({},[F,"ui","searchResultsColumns"]),Tu=(0,_.pipe)(vu,(0,_.map)((0,_.map)((0,_.ifElse)((0,_.prop)("autoResize"),(0,_.pick)(["id"]),(0,_.pick)(["id","size"]))))),Ou=e=>e.explorer.ui.entityTypeTab,xu=e=>e.explorer.ui.previewPanelMode,Su=e=>!!xu(e),Cu=e=>Kc(bu(e))&&Ou(e)||void 0,wu=(e,t)=>(0,_.path)([F,"ui","searchResultsColumns",t],e),Au=e=>e.explorer.ui.notification,Ru=(0,Zc.createSelector)(Cr().selectors.getUIConfig,(e=>(0,x.findPerspectiveConfig)(x.ScreenType.Search,e))),_u=(0,_.pipe)(Ru,(0,_.defaultTo)({}),(0,_.path)(["options","showSearchByOv"])),Nu=(0,_.pipe)(Ru,(0,_.defaultTo)({}),(0,_.prop)("potentialMatchesReview")),Iu=(0,_.pipe)(Ru,(0,_.propSatisfies)((e=>!1!==e),"mapSearchEnabled")),Du=(0,_.pipe)(Ru,(0,_.defaultTo)({}),(0,_.prop)("tabs")),Pu=e=>e.explorer.ui.tableViewTabs,ku=e=>(0,_.prop)("entityTypes",Ru(e)),Lu=e=>(0,_.path)([F,"advancedSearch","searchParams","groups"],e),Fu=e=>(0,_.pipe)(Lu,(0,_.map)((0,_.prop)("entityTypes")),_.flatten,_.uniq)(e),ju=(e,t,r)=>(0,_.path)([F,"advancedSearch","attributesData",t,r],e),Uu=(e,t,r)=>{const{default:n,filtered:a}=ju(e,t,r);return a||n},Mu=(e,t,r)=>{if(!fu(e))return[];const n=Cr().selectors.getMetadata(e),a=(0,_.pipe)(Lu,(0,_.unless)((0,_.always)((0,x.isEmptyValue)(r)),(0,_.map)((0,_.modify)("attributes",(0,_.reject)((0,_.pathEq)(["data","fieldName"],r))))),Za(n))(e),i=it(a,t);return i?[{rawFilter:`(${i})`}]:[]},Vu=(e,t)=>{const r=((e,t)=>(0,_.pipe)(Lu,(0,_.find)((0,_.propEq)("id",t)))(e))(e,t);return(0,_.path)(["entityTypes","length"],r)?[{type:x.FACET_TYPES.ENTITY_TYPE_FACET,fieldName:"type",values:r.entityTypes,filter:"equals"}]:[]},Bu=e=>{const t=Lu(e),r=(0,_.pipe)((0,_.chain)((0,_.prop)("attributes")),(0,_.pluck)("operator"))(t);return[...(0,_.pipe)(_.init,(0,_.pluck)("operator"))(t),...r].every(x.isAndOperator)},zu=(0,Zc.createSelector)(Lu,Cr().selectors.getLookups,(0,_.pipe)(x.getUnresolvedLookupsListFromSearchGroups,_.isEmpty,_.not)),Hu=(0,_.curry)((function(e,t){let{entityTypeUri:r}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return r?(0,_.path)([F,"search","searchResultsByEntityTypes",r,e],t):(0,_.path)([F,"search",e],t)})),Yu=I("searchBoxInput"),Wu=Yu.compose(I("values")),Gu=e=>(0,_.path)([F,"search","searchParams"],e),qu=(0,_.curry)(((e,t)=>{if(!e)return t;const{value:r,isRawFilter:n}=e;return n?Yu.set(t,{rawFilter:r}):Wu.set(t,r?[r]:[])})),Zu=(e,t)=>(0,_.pipe)(Gu,qu(t))(e),$u=e=>(0,_.path)([F,"search","searchParams","mapSearch","values"],e),Ku=e=>(0,_.path)([F,"search","searchParams","mapSearch","type"],e),Qu=e=>(0,_.length)($u(e))?{values:$u(e),searchType:Ku(e)}:null,Xu=e=>{const t=Qu(e);return t&&t.searchType===x.MAP_SEARCH_TYPES.onMapMove?null:t},Ju=(e,t)=>{let{entityTypeUri:r}=t;return r?((e,t)=>{const r=((e,t)=>(Pu(e)||[]).find((e=>e.value===t)))(e,t)||{};return r.number})(e,r):e.explorer.search.total},ep=Hu("page"),tp=Hu("rowsPerPage"),rp=Hu("sortField"),np=Hu("sortOrder"),ap=Hu("searchResults"),ip=e=>e.explorer.search.loading,op=e=>{const t=Er(e),r=Cr().selectors.getSearchKeyword(e),n=Zu(e,r),a=Lu(e);return(0,_.all)(_.isEmpty)([Object.values(n).filter(we),a.filter(x.isValidSearchGroup),Object.values(t).filter(we)])},lp=(0,_.path)([F,"search","currentTenant"]),sp=(0,Zc.createSelector)(lp,Cr().selectors.getDataTenants,((e,t)=>e&&t&&t.find((0,_.propEq)("id",e)))),cp=(0,_.pipe)(sp,(0,_.prop)("id")),up=(0,Zc.createSelector)(op,cp,((e,t)=>!e&&!t)),pp=(e,t)=>{const r=sp(e);return fp(e,t,r,{excludeAllowedEntityTypes:!0})},dp=(e,t)=>{const r=sp(e);return fp(e,t,r)},mp=(e,t)=>{const r=sp(e);return fp(e,[],r,{excludeFieldName:t})},yp=(e,t)=>{if(t)return[];const r=(0,_.pipe)(Cr().selectors.getMetadata,(0,_.propOr)([],"entityTypes"),(0,_.filter)(x.isAvailableEntityType),(0,_.pluck)("uri"))(e);return(ku(e)||[]).filter((e=>r.includes(e)))},fp=(0,Zc.createSelector)((e=>Cr().selectors.getMetadata(e)),Er,br,Cr().selectors.getSearchKeyword,Gu,(function(e,t,r){let{excludeFieldName:n}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return Mu(e,t,n)}),(function(e,t,r){let{excludeAllowedEntityTypes:n}=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return yp(e,n)}),(0,_.nthArg)(2),((e,t,r,n,a,i,o,l)=>{const s=qu(n,a),c=(0,_.pipe)(xc,Sc,(e=>(0,_.when)((0,_.always)(null==e?void 0:e.length),(t=>{const r=(e=>({rawFilter:(0,x.buildComplexFilterString)({fieldName:"type",values:e,filter:x.AdditionalFilterOptionsValues.LIST_EQUALS})}))(e);return(0,_.assoc)("allowedTypes",r,t)})))(o),(e=>(0,_.map)((0,_.ifElse)(x.isTypeFacet,(t=>rc({},t,{values:Wa(e,t.values)})),_.identity)))(e),sn(l),Object.values);return c(t,r).concat(Object.values(s)).concat(i).filter(we)})),gp=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2?arguments[2]:void 0;const n=Bu(e),a=mp(e,r);return n?[...a,...t]:t},hp=e=>{const t=Cu(e);return ap(e,{entityTypeUri:t})},Ep=e=>{const t=Cu(e);return Ju(e,{entityTypeUri:t})},bp=(0,Zc.createSelector)(Cr().selectors.getMetadata,Cr().selectors.getAttributesPresentation,Cr().selectors.getLookups,Lu,Cr().selectors.getSearchKeyword,Xu,x.buildReadableQueryToString);var vp=r(49656);const Tp=e=>{(0,vp.U)(e,{title:L().text("Server Error"),defaultMessage:L().text("Something went wrong...")})},Op=(e,t,r)=>`${e}/recommend/${r}/${t}`,xp=e=>e&&1===e.length?e[0]:null,Sp=e=>[e].filter((0,_.complement)(x.isComplexAttribute)).map((0,_.compose)(Me,(0,_.prop)("uri"))).concat((e.children||[]).map(Sp)).flat(1/0);function*Cp(){const e=yield(0,Es.RE)(nf),t=yield(0,Es.Ys)(Cr().selectors.getTenant),r=yield(0,Es.Ys)(Cr().selectors.getEnvironment),n=((e,t,r,n,a)=>{const i=e.map((e=>{let{fieldName:t,values:r}=e;return{fieldName:t,values:r.map((e=>Array.isArray(e)?JSON.stringify(e):e))}})),o={facets:Ne(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:5};return{url:Op(r,n,a),options:{method:"POST",body:JSON.stringify(o),headers:{"Content-Type":"application/json"}}}})(e,0,yield(0,Es.Ys)(Cr().selectors.getServicesPath),t,r);let a;try{a=yield(0,Es.RE)(x.rawRequest,n.url,n.options),a=a.filter((e=>"type"!==e)).slice(0,5)}catch(e){a=[]}const i=yield(0,Es.Ys)(Cr().selectors.getMetadata),o=yield(0,Es.Ys)(Tr);a=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const r=xp(arguments.length>2?arguments[2]:void 0),n=r&&(0,x.getEntityType)(e,r),a=Vt(e,n||{}).map(Sp).flat(1/0);return t.filter((e=>r||!e.startsWith("attributes."))).filter((e=>!e.startsWith("attributes.")||a.includes(e)))}(i,a,o);const l=((e,t,r,n)=>{const a=e=>!t.includes(e);let i=[];const o=Math.max(0,5-t.length);if(o){const t=xp(n);if(t){const r=((0,x.getEntityType)(e,t).defaultFacetedAttributes||[]).map((r=>(0,x.findAttributeTypeByUri)(e,r,t))).filter((e=>e&&(0,x.isReadableAttribute)(e)&&!(0,x.isComplexAttribute)(e))).map((0,_.prop)("uri")).map(Me).filter(a);i=i.concat(r)}if(i.length<o){const e=Zt().map((e=>e.fieldName)).filter(a);i=i.concat(e)}}return i.slice(0,o)})(i,a,0,o);var s;a=a.concat(l),yield(0,Es.gz)((s=a,{type:wr.SET_RECOMMENDED_FACETS_LIST,payload:s}))}const wp=e=>({type:Un,payload:e}),Ap=e=>({type:Mn,payload:e}),Rp=(e,t)=>({type:Vn,payload:{show:e,postSavingAction:t}}),_p=e=>({type:Bn,payload:e}),Np=(e,t,r)=>({type:qn,payload:{entityTypeUri:e,columns:t,prevColumns:r}}),Ip=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{type:Zn,payload:{entityTypeUri:e,silent:t}}},Dp=e=>({type:$n,payload:e}),Pp=()=>({type:Jn}),kp=e=>({type:ea,payload:e}),Lp=e=>kp({payload:{message:e,action:null},type:te}),Fp=e=>{let{message:t,actionLabel:r,actionToDispatch:n,autoHideDuration:a}=e;return kp({payload:{message:t,action:{actionLabel:r,actionToDispatch:n},autoHideDuration:a},type:te})},jp=e=>({type:ra,payload:e}),Up=e=>({type:zn,payload:e}),Mp=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return Object.keys(e).filter((r=>x.utils.strings.search(r,t)||x.utils.strings.search(e[r].displayName,t)))},Vp=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)}},Bp=(e,t)=>e===t,zp=new class{constructor(){this.isLookupValueResolveTaskRunning=(0,_.curry)(((e,t)=>(0,_.hasPath)([e,t],this._lookupValuesResolveTasks))),this._lookupValuesResolveTasks=Object.create(null)}addTask(e,t){e.forEach((e=>{let{type:r,codeValues:n}=e;!this._lookupValuesResolveTasks[r]&&(this._lookupValuesResolveTasks[r]={}),n.forEach((e=>{this._lookupValuesResolveTasks[r][e]=t}))}))}deleteTask(e){e.forEach((e=>{let{type:t,codeValues:r}=e;this._lookupValuesResolveTasks[t]&&r.forEach((e=>{delete this._lookupValuesResolveTasks[t][e]})),(0,_.isEmpty)(this._lookupValuesResolveTasks[t])&&delete this._lookupValuesResolveTasks[t]}))}getRunningTasks(e){const t=e.flatMap((e=>{let{type:t,codeValues:r}=e;return this._lookupValuesResolveTasks[t]?r.reduce(((e,r)=>{const n=this._lookupValuesResolveTasks[t][r];return n&&e.push(n),e}),[]):[]}));return(0,_.uniqWith)(Bp,t)}clearTasks(){this._lookupValuesResolveTasks=Object.create(null)}};function*Hp(e){const t=zp.getRunningTasks(e);t.length>0&&(yield(0,Es.v_)(t))}function*Yp(e){try{const t=e.flatMap((e=>{let{type:t,codeValues:r}=e;return r.map((e=>({type:t,codeValue:e})))})),r=yield(0,Es.rM)(x.resolveLookupsList,t);zp.addTask(e,r);const n=(yield(0,Es.v_)(r)).reduce(((e,t)=>{const[r]=Object.keys(t),[n]=Object.keys(t[r]),a=(0,_.lensPath)([r,n]),i=(0,_.path)([r,n],t);return(0,_.set)(a,i,e)}),{});for(const e in n)yield(0,Es.gz)(Sr.profile.lookups.actions.lookupsForTypeResolved({type:e,values:n[e]}))}catch(e){console.warn(e)}finally{zp.deleteTask(e)}}function*Wp(e){if((0,_.isEmpty)(e))return;const t=e.map((e=>{let{type:t,codeValues:r}=e;const n=zp.isLookupValueResolveTaskRunning(t);return{type:t,codeValues:r.filter((0,_.complement)(n))}})).filter((e=>{let{codeValues:t}=e;return t.length>0}));t.length>0&&(yield(0,Es.RE)(Yp,t)),yield(0,Es.RE)(Hp,e)}function*Gp(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Y,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;const a=!t&&1===n,i=`${e}${r}`,o=a&&Vp.getRunningTask(i);if(o)yield(0,Es.v_)(o);else try{const o=yield(0,Es.rM)(x.getDependentLookups,{type:e,displayNamePrefix:t,max:r,offset:r*(n-1)});a&&Vp.addTask(i,o);const l=yield(0,Es.v_)(o);yield(0,Es.gz)(Sr.profile.lookups.actions.lookupsForTypeResolved({type:e,values:l.codeValues[e]}))}catch(e){console.warn(e)}finally{a&&Vp.deleteTask(i)}}const qp=(e,t,r)=>e.slice((r-1)*t,t*r);function*Zp(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;const a=yield(0,Es.Ys)(Cr().selectors.getLookups),i=Mp(a[e],t);if(i.length>=r*n)return qp(i,r,n);yield(0,Es.RE)(Gp,e,t,r,n);const o=yield(0,Es.Ys)(Cr().selectors.getLookups);return qp(Mp(o[e],t),r,n)}const $p=(e,t)=>Object.keys(e).filter((e=>Oc(e,t))).reduce(((r,n)=>(r[Oc(n,t).fieldName]=e[n],r)),{});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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Qp(e,t,r[t])}))}return e}function Qp(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*Xp(e,t,r){if((0,_.isEmpty)(e))return;const n=yield(0,Es.Ys)(Cr().selectors.getLookups),a=yield(0,Es.Ys)(Cr().selectors.getMetadata),i=$p(r,e),o=yield(0,Es.Ys)(ku);yield(0,Es.gz)(t(ic(a,i,e,n,{allowedEntityTypes:o})))}function*Jp(e,t,r){try{const n=yield(0,Es.RE)(Yy,e.url,e.options),[a,i]=(0,_.partition)(or,t);yield(0,Es.rM)(Xp,i,r,n),yield(0,Es.RE)(id,a,n),yield(0,Es.RE)(Xp,a,r,n)}catch(e){console.warn(e)}}function*ed(e,t,r){e=Kp({},e,{includeFilter:[]});const n=yield(0,Es.Ys)(Cr().selectors.getGlobalSearchRequestOptions),a=Be([e],t,[e.fieldName],n);yield(0,Es.RE)(Jp,a,[e],r)}const td=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t.filter((t=>{let{label:r}=t;return x.utils.strings.search(r,e)}))},rd=(e,t)=>td(t,e).map((0,_.prop)("value"));function*nd(e,t,r,n){const a=Kp({},e),i=[...t];if(or(a)){const t=(0,x.getAttrTypeLookupCode)(e.attrType);a.includeFilter=yield(0,Es.RE)(Zp,t,r,(0,_.propOr)(Y,"pageSize",a),a.pageNumber)}else if("sourceSystems"===a.fieldName){const{sources:e}=yield(0,Es.Ys)(Cr().selectors.getMetadata);a.includeFilter=((e,t)=>td(t,e).map((e=>{let{uri:t}=e;return(0,x.getLastUriPart)(t)})))(e,r)}else if(sr(a)){const t=yield(0,Es.Ys)(Cr().selectors.getMetadata),n=(0,x.getEntityType)(t,a.entityTypeUri)||{},i=(0,_.pipe)((0,_.propOr)([],"displayedItems"),(0,_.filter)((0,_.propEq)("isRaw",!0)))(e);a.includeFilter=[...(o=n.matchGroups,l=r,td(l,o).map((0,_.prop)("uri"))),...rd(i,r)]}else a.disableIncludeFilter=!0,i.push({values:[r],fieldName:e.fieldName,filter:"containsWordStartingWith",forceInclude:!0});var o,l;const s=yield(0,Es.Ys)(Cr().selectors.getGlobalSearchRequestOptions),c=Be([a],i,[e.fieldName],s);yield(0,Es.RE)(ad,c,e,a.includeFilter,n)}function*ad(e,t,r,n){try{const a=yield(0,Es.RE)(Yy,e.url,e.options),i=yield(0,Es.Ys)(Cr().selectors.getLookups),o=$p(a,[t]);if(r){const e=t.fieldName;o[e]=((e,t)=>Object.keys(e).filter((e=>t.includes(e))).reduce(((t,r)=>(t[r]=e[r],t)),{}))(o[e],r)}const l=yield(0,Es.Ys)(Cr().selectors.getMetadata),s=yield(0,Es.Ys)(ku);yield(0,Es.gz)(n(ic(l,o,[t],i,{allowedEntityTypes:s})))}catch(e){console.warn(e)}}function*id(e,t){const r=yield(0,Es.Ys)(Cr().selectors.getLookups),n=((e,t)=>(0,_.pipe)(Rc,(0,x.getUnresolvedLookupsList)(t))(e))(e,r),a=((e,t,r)=>{const n=((e,t)=>(0,_.pipe)(Object.entries,(0,_.reduce)(((e,r)=>{let[n,a]=r;const i=t.find((0,_.propEq)("fieldName",n));if(!i)return e;const{attrType:o}=i,l=(0,x.getAttrTypeLookupCode)(o);return e[l]={type:l,codeValues:(0,_.uniq)([...(0,_.pathOr)([],[l,"codeValues"],e),...Object.keys(a)])},e}),{}),_.values)(e))(e,t);return(0,x.getUnresolvedLookupsList)(r,n)})(t,e,r),i=(0,x.mergeLookupsLists)(n,a);i.length&&(yield(0,Es.RE)(Wp,i))}function od(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){ld(e,t,r[t])}))}return e}function ld(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*sd(){const e=yield(0,Es.Ys)(Cr().selectors.getMetadata),t=yield(0,Es.Ys)(ku),r=yield(0,Es.Ys)(Du);return ou(e,t,r)}const cd=e=>t=>{let{value:r}=t;return!e.length||e.includes(r)};function*ud(e){e=e||(yield(0,Es.Ys)(dp));const t=yield(0,Es.Ys)(bu);if(Kc(t)){yield(0,Es.Ys)(Cr().selectors.getMetadata);const t=yield(0,Es.Ys)(Fu),r=Wt(),n=yield(0,Es.Ys)(Cr().selectors.getGlobalSearchRequestOptions),a=Be([r],e,[r.fieldName],n),i=e=>{let{type:r=[]}=e;const n=r.filter(cd(t));return Dp(n)};yield(0,Es.RE)(Jp,a,[r],i)}else yield(0,Es.gz)(Dp([]))}function*pd(){const e=yield(0,Es.Ys)(Cr().selectors.getMetadata),t=yield(0,Es.Ys)(ku),r=yield(0,Es.Ys)(Fu);return fc(e,{},t).filter(cd(r))}function*dd(){const e=yield(0,Es.Ys)(Cr().selectors.getMetadata),t=yield(0,Es.RE)(sd),r=yield(0,Es.Ys)(vu),n=eu().map((0,_.prop)("id")),a=(0,_.pipe)((0,_.map)((0,_.filter)((0,_.pipe)((0,_.prop)("id"),(0,_.cond)([[(0,_.includes)("."),_.T],[(0,_.includes)(_.__,n),_.T],[_.T,_.F]])))),_.toPairs,(0,_.map)((t=>{let[r,n]=t;return[r,iu(e,r,(0,_.map)((0,_.prop)("id"),n)).map(((e,t)=>{const r=n.find((0,_.propEq)("id",e.id)),{size:a,autoResize:i=0!==t&&!a}=r||{};return(0,_.reject)(_.isNil,od({},e,{size:a,autoResize:i}))}))]})),_.fromPairs)(r),i=!(0,_.equals)(r,a),o=Object.keys(t),l=Object.keys(a);var s;!i&&(0,_.equals)(new Set(o),new Set(l))||(yield(0,Es.gz)((s=od({},t,(0,_.pick)(o,a)),{type:Gn,payload:s})))}function*md(){const e=yield(0,Es.Ys)(Cr().selectors.getMetadata),t=yield(0,Es.Ys)(Tr),r=(yield(0,Es.Ys)(fu))?yield(0,Es.RE)(pd):yield(0,Es.RE)(ff),n=su(e,r,t).map((0,_.prop)("value")),a=yield(0,Es.Ys)(Ou);n.includes(a)||(yield(0,Es.gz)(Ip(n[0],!0)))}function*yd(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{silent:t}=e.payload||{};if(!t){const e=yield(0,Es.Ys)(Cu),t=yield(0,Es.Ys)(sp);if((0,x.isAvailableEntityTypeForDataTenant)(t,e)){const t=yield(0,Es.Ys)(ap,{entityTypeUri:e});(0,_.isNil)(t)&&(yield(0,Es.gz)(Fc()))}else yield(0,Es.gz)(Lc([],e))}}function*fd(e){const t=e.payload;yield(0,Es.RE)(yd,e);const r=yield(0,Es.Ys)(Pu);if(Kc(t)&&0===r.length){const e=yield(0,Es.RE)(pd);yield(0,Es.gz)(Dp(e)),yield(0,Es.RE)(ud)}}function*gd(){const e=yield(0,Es.Ys)(xu),t=yield(0,Es.Ys)($u);e!==H.MAP&&t.length&&(yield(0,Es.gz)(Bc(null)))}function*hd(e){const t=(0,x.removeDtssPrefixFromEntityUri)(e.payload.uri),r=yield(0,Es.Ys)(Cu),n=((yield(0,Es.Ys)(ap,{entityTypeUri:r}))||[]).map((0,_.prop)("uri")),a=(yield(0,Es.Ys)(ep,{entityTypeUri:r}))||0,i=(yield(0,Es.Ys)(tp,{entityTypeUri:r}))||j[0],o=n.indexOf(t)+a*i,l=yield(0,Es.Ys)(Ju,{entityTypeUri:r}),s=yield(0,Es.Ys)(Cr().selectors.getTenant),c=yield(0,Es.Ys)(cp);yield(0,Es.gz)(Sr.search.actions.setSearchNavigationData({uri:t,index:o,total:l,tenant:c||s,cache:n}))}const Ed=[function*(){yield(0,Es.Fm)(Zn,yd)},function*(){yield(0,Es.Fm)(ta,fd)},function*(){yield(0,Es.Fm)([Ta,Oa,Sa],md)},function*(){yield(0,Es.Fm)(ra,gd)},function*(){yield(0,Es.Fm)(Sr.ui.constants.UIActions.OPEN_ENTITY,hd)}],bd=e=>({type:Mi,payload:e}),vd=e=>({type:Vi,payload:e}),Td=()=>({type:Qi}),Od=e=>({type:so,payload:e}),xd=e=>({type:co,payload:e}),Sd=(e,t)=>({type:mo,payload:{uri:e,isLoading:t}}),Cd=(0,_.prop)("checked"),wd=e=>e.filter(Cd).length,Ad=e=>(0,Zc.createSelector)(e,wd),Rd=e=>(0,Zc.createSelector)(e,(e=>!!e.length&&e.length===wd(e))),_d=e=>(0,Zc.createSelector)(e,(e=>wd(e)>0)),Nd=(0,_.curry)(((e,t)=>e(t).filter(Cd))),Id=(0,_.path)([F,"savedSearches"]),Dd=e=>Id(e).items,Pd=(e,t)=>Dd(e).find((0,_.propEq)("uri",t)),kd=e=>Id(e).total,Ld=e=>Id(e).page,Fd=e=>Id(e).rowsPerPage,jd=e=>Id(e).favoriteOnly,Ud=e=>Id(e).searchValue,Md=e=>Id(e).findPublic,Vd=e=>Id(e).sorting,Bd=e=>Id(e).loading,zd=e=>Id(e).postSavingAction,Hd=Ad(Dd),Yd=Rd(Dd),Wd=_d(Dd),Gd=Nd(Dd),qd=e=>(0,_.path)([F,"savedSearches","currentSearch"],e),Zd=e=>(0,_.path)([F,"savedSearches","changeIndicator"],e),$d=e=>{const t=qd(e);return!(0,_.isNil)(t)&&((0,_.has)("isOwnSearch")(t)?t.isOwnSearch:t.owner===Cr().selectors.getUserName(e))},Kd=(0,_.prop)("uiState"),Qd=e=>t=>{const r=t.entityType||t.entityTypeUri||"special",n=e.find((0,_.propEq)("id",r));return(0,_.propOr)([],"facets",n).find((0,_.propEq)("fieldName",t.fieldName))},Xd=e=>t=>e.find((e=>e.fieldName===t.fieldName));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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){em(e,t,r[t])}))}return e}function em(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const tm=(0,_.pipe)((e=>e.reduce(((e,t)=>(e[t.fieldName]=Jd({},t,{values:[...(0,_.propOr)([],"values",t),...(0,_.pathOr)([],[t.fieldName,"values"],e)]}),e)),{})),_.values),rm=(e,t,r)=>(n,a)=>{const{entityType:i,fieldName:o,filter:l,values:s}=a,c={fieldName:o,filter:l||"equals",values:s||[]};if(i){const r=(0,x.searchUriToAttrUri)(o,i),a=(0,x.findAttributeTypeByUri)(e,r),l=(0,x.getEntityType)(e,i),s=Dt(t,l).find((e=>e.fieldName===o));0===n.entityTypes.length&&n.entityTypes.push(i),n.entityTypes.includes(i)&&(s?n.searchParams.push(c):a&&n.searchParams.push(Jd({},c,{uri:a.uri})))}else wt(o,t,r)&&n.searchParams.push(c);return n},nm=(e,t)=>(r,n)=>{const a=e.find((e=>e.fieldName===n.fieldName));if(a){const e=((e,t,r)=>(0,x.isTypeFacet)(e)?r:(0,x.isRangeFacet)(e)?(0,x.getOldRangeFacetValues)(t.values):t.values)(a,n,t),i=(0,x.isTypeFacet)(a)&&n.showAllEntityTypes?n.showAllEntityTypes:null;return Jd({},r,{[n.fieldName]:(0,_.reject)(_.isNil,{fieldName:n.fieldName,values:e,showAllItems:i})})}return r};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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){im(e,t,r[t])}))}return e}function im(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const om=(0,_.curry)(((e,t,r,n)=>{const{uri:a}=n;return a&&!a.startsWith("special/")?((e,t)=>{let{uri:r,entityTypeUri:n,fieldName:a}=t;const i=(0,x.findAttributeTypeByUri)(e,r);if(i){const t=((0,x.getAttributeTypesHierarchyByUri)(e,(0,x.searchUriToAttrUri)(a,n),n)||[]).map((0,_.pick)(["label","name"])).slice(0,-1);return am({uri:r,groupName:(0,x.getEntityTypeLabel)(e,{type:n}),filterOptions:(0,x.getFilterOptionsForQueryBuilder)(i,a)},Mt(e,i,n,a,t))}return null})(e,n):((e,t,r,n)=>{let{fieldName:a}=n;const i=Ct({dataTenants:t,canUserReadWorkflowDataTask:r}).find((e=>e.attributes.find((e=>e.fieldName===a)))),o=i&&i.attributes.find((e=>e.fieldName===a));return o?am({groupName:i.title,filterOptions:(0,x.getFilterOptionsForQueryBuilder)(o.attrType,a)},(0,_.pick)(["title","fieldName","attrType","pageSize","orderType","dataTenant","fieldNameForRequest","dataTenantFieldName"],o)):null})(0,t,r,n)||((e,t,r)=>{let{fieldName:n,entityTypeUri:a}=r;const i=(0,_.pipe)((0,x.getEntityType)(e),Dt(t),(0,_.find)((0,_.propEq)("fieldName",n)))(a);return i?am({groupName:(0,x.getEntityTypeLabel)(e,{type:a}),filterOptions:(0,x.getFilterOptionsForQueryBuilder)(i.attrType,n)},i):null})(e,t,n)})),lm=(0,_.curry)(((e,t,r,n,a)=>(0,_.pipe)((0,x.convertOldAdvancedAttribute)(e,n),(0,_.evolve)({data:om(e,t,r)}))(a))),sm="Preview",cm={NoPreview:B,[sm]:z,MapPreview:z,TableView:V},um={[sm]:H.PROFILE},pm=e=>e.find((e=>e.selected))||{},dm=(e,t,r)=>{const n=ou(e,t),a=r.reduce(((t,r)=>(t[r.entityTypeUri]=r.selectedAttributes.map((t=>{const r=(0,x.findAttributeTypeByUri)(e,t);return{id:(0,x.attributeUriToSearchUri)(r.uri),label:r.label,attrType:r}})).filter((e=>!(0,x.isComplexAttribute)(e.attrType))),t)),{});return(0,_.mergeDeepWith)(_.concat,n,a)};function mm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ym=(0,_.filter)((0,_.pipe)((0,_.prop)("values"),_.isEmpty,_.not)),fm=(0,be.Z)((e=>Ct({dataTenants:e}))),gm=(e,t,r)=>(0,x.getEntityTypeLabel)(e,{type:r.entityTypeUri})||(fm(t).find((e=>e.attributes.find((e=>e.fieldName===r.fieldName))))||{}).title,hm=(e,t,r)=>{const n=ym(r),[[a={}],i]=(0,_.partition)(x.isTypeFacet,n),o=i.reduce(((r,n)=>{const a=(0,x.getFilterOptionsForQueryBuilder)(n.attrType,n.fieldName),i=(0,x.getFilterOptionForFacet)(n),o=(0,_.pick)(["title","pathToTitle","fieldName","fieldNameForRequest","dataTenant","dataTenantFieldName","attrType","groupName","entityTypeUri","pageSize","orderType","isComplex","disableIncludeFilter","uri"])(n),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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){mm(e,t,r[t])}))}return e}({},o,{groupName:gm(e,t,o),filterOptions:a}),s=(0,x.getFilterValueForFacet)(n);return r[0].push({data:l,operator:"and",filter:i,id:(0,va.x0)(),values:s}),r}),[[]]);return o.filter((e=>e.length||(0,_.path)(["values","length"],a))).map((e=>({attributes:e,operator:q.value,id:(0,va.x0)(),entityTypes:a.values||[]})))},Em=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.options||[],r=t.find((0,_.propEq)("fieldName","searchByOv"));if(r){const e=(0,_.path)(["values",0],r);if("boolean"==typeof e)return{searchByOv:e,ovOnly:e}}return null};function bm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const vm=(0,_.curry)(((e,t)=>(0,_.assocPath)(["view","searchResultsColumns"],e,t))),Tm=(e,t,r,n)=>{let{keyword:a=null,facets:i={},advanced:o=[],map:l,view:s,searchOptions:c,currentSavedSearchUri:u,currentTenant:p,showSavedSearchesDialog:d}=t;const m={map:l,keyword:a,searchOptions:c,showSavedSearchesDialog:d};return o.some((e=>{let{attributes:t,entityTypes:r=[]}=e;return t.length||r.length}))?m.advanced=(0,x.parseAdvancedSearch)(om,e,o,r,n):m.facets=((e,t,r)=>{const n=Wt();if(!t||0===t.length)return{facetsData:{},facetsConfigs:[n]};const a=t.type?t.type.values.filter((0,x.isAvailableEntityTypeUri)(e)):[],i=tr(e,a,r),o=(0,_.pipe)((0,_.dissoc)("type"),_.values,(0,_.reduce)((e=>{const t=Qd(e);return(e,r)=>{const n=t(r);return n&&!e.find((0,_.propEq)("fieldName",r.fieldName))?[...e,n]:e}})(i),[n]))(t);return{facetsConfigs:o,facetsData:(0,_.pipe)((0,_.evolve)({type:(0,_.assoc)("values",a)}),(0,_.filter)(Xd(o)),(0,_.map)((0,_.omit)(["entityTypeUri"])))(t)}})(e,i,r),s&&(m.view={searchResultsMode:s.searchResultsMode||z,entityTypeTab:s.entityTypeTab,sortField:s.sortField,sortOrder:s.sortOrder,searchResultsColumns:s.tabs,previewPanelMode:s.previewPanelMode||null}),u&&(m.currentSavedSearchUri=u),p&&(m.currentTenant=p),m},Om=(e,t,r,n,a)=>{const{facets:i={},advanced:o,view:l,curSavedSearchUri:s,useSeparateGroups:c}=t,u={keyword:(0,x.getKeywordFromOldSearchState)(t),searchOptions:Em(o)},p=((e,t,r,n)=>{const a=Wt();if(!r||(0,_.isEmpty)(r))return{facetsData:{},facetsConfigs:[a]};const[i,o]=(0,_.partition)((e=>"tenants"===e.fieldName),r),l=(0,_.path)([0,"currentTenant"],i),[s,c]=(0,_.partition)((e=>"type"===e.fieldName),o),u=(0,_.pipe)((0,_.chain)((0,_.propOr)([],"values")),(0,_.filter)((0,x.isAvailableEntityTypeUri)(e)))(s),p=(0,_.compose)(Qd,tr)(e,u,t),d=(0,x.convertOldFacets)(c),m=(0,_.either)((0,_.pipe)((0,_.prop)("filter"),_.isNil),(0,_.propEq)("filter","equals"));if(d.some((e=>!p(e)||!m(e))))return{currentTenant:l,advanced:d.reduce(rm(e,t,n),{entityTypes:u,searchParams:[]}),facetsConfigs:[],facetsData:{}};{const e=tm(d),t=[a,...e.map(p)];return{currentTenant:l,facetsConfigs:t,facetsData:[...s,...e].reduce(nm(t,u),{})}}})(e,n,i,a),{currentTenant:d,advanced:m}=p,y=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(p,["currentTenant","advanced"]),f=function(e,t,r){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const{searchParams:i=[],fastSearchParams:o=[],entityTypes:l=[]}=n,s=[...i,...o].map(lm(e,t,r,(0,x.findClosestCommonAncestor)(e,l))).filter((e=>e&&e.data)),c=(0,_.curry)(((e,t)=>({id:(0,va.x0)(),operator:e,attributes:t,entityTypes:l}))),u=a?s.map((0,_.pipe)(x.wrapInArray,c(G.value))):(0,x.wrapInArray)(c(q.value,s));return(0,_.pipe)((0,x.sanitizeTypesInSearchGroups)(e),x.convertTransitionAttributes,(0,_.reject)(x.isEmptySearchGroup))(u)}(e,n,a,o||m,c);if(f.some((e=>{let{attributes:t}=e;return t.length}))){const{facetsData:t,facetsConfigs:r}=y,a=r.reduce(((e,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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){bm(e,t,r[t])}))}return e}({},e,{[r.fieldName]:ar(r.fieldName,t[r.fieldName])})),{}),i=hm(e,n,Object.values(xc(a,r)));u.advanced=i.length>0?(g=f,h=i,(0,_.prop)("attributes",h.find((e=>e.attributes))).map((e=>g[0].attributes.push(e))),g):f}else u.facets=y;var g,h;return l&&(u.view=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{mode:n,tabs:a=[]}=t,{allowedEntityTypes:i}=r;return{searchResultsMode:cm[n]||z,previewPanelMode:um[n]||null,entityTypeTab:(0,_.propOr)(null,"entityTypeUri",pm(a)),sortField:"label",sortOrder:"asc",searchResultsColumns:dm(e,i,a)}}(e,l,r)),s&&(u.currentSavedSearchUri=s),d&&(u.currentTenant=d),u},xm=(e,t,r,n,a)=>{try{const{version:i}=t;return"2.0"===i?Tm(e,t,n,a):Om(e,t,r,n,a)}catch(e){return console.warn("Can't parse search state",e),{errors:Array.isArray(e)?e:[e]}}};function Sm(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Cm(e,t,r[t])}))}return e}function Cm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const wm=(0,_.curry)(((e,t,r,n)=>{try{const a=(0,_.pipe)(xm,vm(null))(e,n.uiState.state||n.uiState,{},t,r);return Sm({},n,{originalUiState:n.uiState,uiState:a})}catch(e){const t=(n.errors||[]).push(e);return Sm({},n,{originalUiState:n.uiState,uiState:{},errors:t})}})),Am=e=>Sm({},e,{uiState:e.originalUiState}),Rm=(0,_.pipe)(Am,(0,_.pick)(["createdDate","description","isFavorite","isPublic","name","owner","query","uiState","updatedDate","uri"])),_m=(0,_.pipe)((0,_.map)((0,_.evolve)({attributes:(0,_.map)((0,_.evolve)({data:(0,_.pick)(["uri","entityTypeUri","fieldName","dataTenant"])}))})),(0,_.map)((0,_.omit)(["autoAddedEntityTypes"]))),Nm=(0,Zc.createSelector)(bu,Ou,(e=>rp(e,{entityTypeUri:Cu(e)})),(e=>np(e,{entityTypeUri:Cu(e)})),Tu,xu,((e,t)=>t),(function(e,t,r,n,a,i){let o=arguments.length>6&&void 0!==arguments[6]&&arguments[6];return{searchResultsMode:e,entityTypeTab:t,sortField:r,sortOrder:n,tabs:o?a:null,previewPanelMode:i}})),Im=(0,Zc.createSelector)(Er,br,((e,t)=>(e=>{let{facetsData:t,facetsConfig:r}=e;const n=r.reduce(((e,t)=>(e[t.fieldName]=t,e)),{});return Object.keys(n).reduce(((e,r)=>{const a=(0,_.pick)(["entityTypeUri","dataTenant"],n[r]),i=(0,_.pick)(["values","showAllItems"],t[r]);return e[r]=Sm({fieldName:r},i,a),e}),{})})({facetsData:e,facetsConfig:t}))),Dm=(0,_.pipe)(Lu,_m),Pm=(0,Zc.createSelector)(Nm,Im,Dm,lp,Cr().selectors.getSearchOptions,Cr().selectors.getSearchKeyword,Xu,(e=>bp(e)),((e,t,r,n,a,i,o,l)=>{const s={view:e,facets:t,advanced:r,currentTenant:n,searchOptions:a,keyword:i,map:o,version:"2.0"};return(0,_.isEmpty)(r)||(s.readableQuery=l),s}));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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Lm(e,t,r[t])}))}return e}function Lm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*Fm(){yield(0,Es.gz)(xd(!0));try{const t=yield(0,Es.Ys)(Cr().selectors.getUserName),r=e=>km({},e,{isOwnSearch:t===e.owner}),n=yield(0,Es.RE)(jm),{result:a=[],total:i}=yield(0,Es.RE)(x.getSavedSearches,n);yield(0,Es.gz)((e=>({type:Hi,payload:e}))(i));const o=yield(0,Es.Ys)(Cr().selectors.getMetadata),l=yield(0,Es.Ys)(Cr().selectors.getDataTenants),s=yield(0,Es.Ys)(Cr().selectors.getCanUserReadWorkflowDataTask);yield(0,Es.gz)((e=a.map(r).map(wm(o,l,s)),{type:Yi,payload:e})),yield(0,Es.gz)(xd(!1)),yield(0,Es.RE)(Vm,a)}catch(e){yield(0,Es.gz)(xd(!1))}var e}function*jm(){const e=yield(0,Es.Ys)(Fd),t=yield(0,Es.Ys)(Ld),r=yield(0,Es.Ys)(Ud),n=yield(0,Es.Ys)(jd),a=yield(0,Es.Ys)(Md),{field:i,order:o}=yield(0,Es.Ys)(Vd);return{offset:e*t,max:e,containsWordStartingWith:r,favoriteOnly:n,findPublic:a,countResults:!1,sortBy:X[i],sortOrder:o}}function*Um(e){const t=yield(0,Es.Ys)(Pd,e.payload);yield(0,Es.RE)(Mm,t)}function*Mm(e,t){yield(0,Es.gz)(Sd(e.uri,!0));try{const{total:r}=yield(0,Es.RE)(x.getTotalsForQuery,(0,x.replacePlaceholdersInQuery)(e.query),Boolean(t));yield(0,Es.gz)(((e,t)=>({type:Wi,payload:{uri:e,total:t}}))(e.uri,r))}catch(e){Tp(e)}yield(0,Es.gz)(Sd(e.uri,!1))}function*Vm(e){const t=yield(0,Es.Ys)(Cr().selectors.getQueryEstimatorEnabled);return yield(0,Es.$6)(e.map((e=>(0,Es.RE)(Mm,e,t))))}function*Bm(e){const{uri:t,isPublic:r}=e.payload,n=yield(0,Es.Ys)(Pd,t);if(n){yield(0,Es.gz)(xd(!0));try{yield(0,Es.RE)(x.markSavedSearchAsPublic,Am(n),r),yield(0,Es.gz)(((e,t)=>({type:Ji,payload:{uri:e,isPublic:t}}))(t,r))}catch(e){Tp(e)}yield(0,Es.gz)(xd(!1))}}function*zm(e){const{uri:t,isFavorite:r}=e.payload,n=yield(0,Es.Ys)(Pd,t);if(n){yield(0,Es.gz)(xd(!0));try{yield(0,Es.RE)(x.markSavedSearchAsFavorite,Am(n),r),yield(0,Es.gz)(((e,t)=>({type:to,payload:{uri:e,isFavorite:t}}))(t,r))}catch(e){Tp(e)}yield(0,Es.gz)(xd(!1))}}function*Hm(e){const{uri:t,isGlobalFilter:r}=e.payload,n=yield(0,Es.Ys)(Pd,t);if(n){const e=Rm(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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["uiState"]);(0,x.isObject)("2.0"===t.version?t:t.state)||!r?yield(0,Es.gz)(((e,t)=>({type:"SAVED_SEARCHES_MARK_GLOBAL_FILTER",payload:{savedSearch:e,isGlobalFilter:t}}))(km({},a,{uiState:t,query:(0,x.replacePlaceholdersInQuery)((0,_.propOr)("","query",a))}),r)):(0,vp.U)({errorMessage:"Saved Search is incorrect"},{title:L().text("Saved Search can't be mark as global")})}}function*Ym(e){const{uri:t,name:r}=e.payload,n=yield(0,Es.Ys)(Pd,t);if(n&&r!==n.name){yield(0,Es.gz)(xd(!0));try{yield(0,Es.RE)(x.updateSavedSearch,km({},Am(n),{name:r})),yield(0,Es.gz)(((e,t)=>({type:ao,payload:{uri:e,name:t}}))(t,r))}catch(e){Tp(e)}yield(0,Es.gz)(xd(!1))}}function*Wm(){const e=yield(0,Es.Ys)(Gd);yield(0,Es.gz)(xd(!0));try{yield(0,Es.$6)(e.map((e=>(0,Es.RE)(x.deleteSavedSearch,e)))),yield(0,Es.gz)(Od(e.map((0,_.prop)("uri"))))}catch(e){Tp(e)}yield(0,Es.gz)(xd(!1))}function*Gm(e){const t=e.payload;yield(0,Es.gz)(xd(!0));try{yield(0,Es.RE)(x.deleteSavedSearch,{uri:t}),yield(0,Es.gz)(Od([t]))}catch(e){Tp(e)}yield(0,Es.gz)(xd(!1))}function*qm(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const r=e?[[(0,_.allPass)([(0,_.propSatisfies)(x.isDateFilterOption,"filter"),(0,_.propEq)("filter",x.FilterOptions.WITHIN),(0,_.pathSatisfies)((0,_.is)(String),["values",0])]),e=>{let{fieldName:t,values:r}=e;return(0,x.buildBasicFilterString)({filter:x.FilterOptions.IN_RANGE,fieldName:t,values:[[`\${${r}}`,"${now}"]]})}]]:[],n=yield(0,Es.Ys)(pp,r),a=yield(0,Es.Ys)(Cr().selectors.getStringifiedSearchOptions),i=Ge(n,[],{searchOptions:a}),o=yield(0,Es.Ys)(Pm,t),l={query:i,uiState:o};return l}function*Zm(e){let{payload:{name:t,share:r}}=e;const{query:n,uiState:a}=yield(0,Es.RE)(qm,!0),i={isFavorite:!1,isPublic:r===$,name:t,query:n,uiState:a},o=yield(0,Es.Ys)(zd);yield(0,Es.gz)(Rp(!1));try{yield(0,Es.gz)(Lp(L().text("Saving search...")));const e=yield(0,Es.RE)(x.createSavedSearch,[i]);e[0].successful?(yield(0,Es.gz)(bd(e[0].object)),yield(0,Es.gz)(vd(!1)),yield(0,Es.gz)(Lp(L().text("Search saved successfully"))),o&&(yield(0,Es.gz)(o))):Tp(e)}catch(e){Tp(e)}}function*$m(e){const{uri:t,debounceTime:r}=e.payload;yield(0,Es.gz)(Ap(!1));const n=yield(0,Es.Ys)(Pd,t),a=Kd(n)||{},{errors:i}=a;i&&i.length?function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];(0,vp.U)(e,{message:L().text("Saved Search can't be applied")})}(i):(yield(0,Es.gz)(bd(n)),(yield(0,Es.Ys)(cp))&&(a.currentTenant=yield(0,Es.Ys)(Cr().selectors.getTenant)),yield(0,Es.gz)(Sr.search.actions.updateState(km({},a,{debounceTime:r}))),yield(0,Es.qn)(Vr))}const Km=[function*(){yield(0,Es.Fm)([zi,Gi,qi,uo,Zi,fo],Fm)},function*(){const e={[Xi]:Bm,[eo]:zm,[lo]:Gm,[oo]:Wm,[no]:Ym,[ro]:Hm},t=yield(0,Es.ZO)(Object.keys(e));for(;;){const r=yield(0,Es.qn)(t);yield(0,Es.RE)(e[r.type],r)}},function*(){yield(0,Es.Fm)([Ui],Zm)},function*(){yield(0,Es.Fm)([po],$m)},function*(){yield(0,Es.ib)([yo],Um)}];function*Qm(e){try{yield(0,Es.RE)(x.createActivity,{label:x.ACTIVITY_TYPES.userSearch,description:JSON.stringify({activity:e,version:"2.0"})})}catch(e){console.warn(e)}}const Xm=e=>({type:Oa,payload:{groupId:e}}),Jm=(e,t)=>({type:Aa,payload:{groupId:e,attributeId:t,attribute:ni()}}),ey=(e,t,r)=>({type:Aa,payload:{groupId:e,attributeId:t,attribute:ai(r)}}),ty=(e,t,r)=>({type:Ra,payload:{groupId:e,attributeId:t,attributeData:ii(r)}}),ry=(e,t)=>({type:Ra,payload:{groupId:e,attributeId:t,attributeData:null}}),ny=(e,t,r)=>({type:_a,payload:{groupId:e,attributeId:t,selectInfo:r}}),ay=(e,t,r)=>({type:Na,payload:{groupId:e,attributeId:t,operator:r}}),iy=(e,t)=>({type:Ia,payload:{groupId:e,attributeId:t}}),oy=(e,t)=>({type:Da,payload:{groupId:e,attributeId:t}}),ly=(e,t)=>({type:Pa,payload:{groupId:e,attributeId:t,id:(0,va.x0)()}}),sy=(e,t,r)=>({type:ka,payload:{groupId:e,attributeId:t,filter:r}}),cy=(e,t,r)=>({type:La,payload:{groupId:e,attributeId:t,values:r}}),uy=(e,t)=>{let{attribute:r,value:n,debounceTime:a=0,pageNumber:i=1,currentOptions:o}=t;return{type:ja,payload:{groupId:e,attribute:r,value:n,debounceTime:a,pageNumber:i,currentOptions:o}}},py=(e,t,r)=>({type:Ua,payload:{groupId:e,attributeId:t,values:r}}),dy=(e,t)=>({type:Ma,payload:{groupId:e,attribute:t}});function*my(e){let{groups:t,findGroupPath:r=oi,attributesPropName:n,groupId:a,attributeId:i,selectInfo:o,actions:l}=e;const{checked:s,attribute:c,index:u,selectedAttributes:p}=o,{addAttributeAfter:d,changeAttribute:m,clearAttribute:y,deleteAttribute:f}=l,g=(0,_.pipe)(r(a),(0,_.path)(_.__,t),(0,_.propOr)([],n))(t),h=e=>(0,_.path)([e,"id"],g),E=g.findIndex((0,_.propEq)("id",i));if(i&&0===u)if(s)yield(0,Es.gz)(m(a,i,c));else{let e=p[u+1];e?(yield(0,Es.gz)(m(a,i,e)),yield(0,Es.gz)(f(a,h(E+1)))):yield(0,Es.gz)(y(a,i))}else{const e=p.length-u,t=i?E+u:g.length-e;s?yield(0,Es.gz)(d(a,h(t-1),c)):yield(0,Es.gz)(f(a,h(t)))}}function yy(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){fy(e,t,r[t])}))}return e}function fy(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*gy(e){const{groupId:t,attributeId:r,selectInfo:n}=e.payload,a=yield(0,Es.Ys)(Lu),i={addAttributeAfter:ey,changeAttribute:ty,clearAttribute:ry,deleteAttribute:iy};yield(0,Es.RE)(my,{groups:a,attributesPropName:"attributes",groupId:t,attributeId:r,selectInfo:n,actions:i}),yield(0,Es.gz)(Xm(t))}function*hy(e){const{attribute:t,groupId:r}=e.payload,n=yield(0,Es.Ys)(Vu,r),a=yield(0,Es.Ys)(Cr().selectors.getGlobalSearchRequestOptions),{data:{fieldName:i},values:o}=t,l=yield(0,Es.Ys)(gp,n,i),s=yy({},t.data,{values:o?(0,_.flatten)(o):void 0,pageSize:t.data.pageSize+1}),c=Be([s],l,[],a);yield(0,Es.RE)(Jp,c,[s],(e=>((e,t,r)=>({type:Fa,payload:{groupId:e,attributeId:t,values:r}}))(r,t.id,e[i])))}function*Ey(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,Es.gz)(py(i,t.id,void 0));else{a&&(yield(0,Es.gw)(a));const e=yield(0,Es.Ys)(Uu,i,t.id),c=e=>py(i,t.id,o.concat(e[s]));if(r){const a=l?[{values:[l],fieldName:"type",filter:"equals"}]:[],i=yield(0,Es.Ys)(gp,a,s);yield(0,Es.rM)(nd,yy({},t.data,{displayedItems:e,pageNumber:n,pageSize:t.data.pageSize+1}),i,r,c)}else{const r=yield(0,Es.Ys)(Vu,i),a=yield(0,Es.Ys)(gp,r,s);yield(0,Es.rM)(ed,yy({},t.data,{displayedItems:e,pageNumber:n,pageSize:t.data.pageSize+1}),a,c)}}}function*by(){const e=yield(0,Es.Ys)(Cr().selectors.getSearchKeyword),t=yield(0,Es.Ys)(Qu),r=yield(0,Es.RE)(nf),n=yield(0,Es.Ys)(Cr().selectors.getMetadata),a=yield(0,Es.Ys)(Cr().selectors.getDataTenants),i=hm(n,a,r);yield(0,Es.gz)(Sr.search.actions.updateState({advanced:i,keyword:e,map:t}))}function*vy(e){const{groupId:t,attributeId:r}=e.payload;yield(0,Es.gz)(iy(t,r)),yield(0,Es.gz)(Xm(t))}function*Ty(){if(yield(0,Es.Ys)(fu)){const e=yield(0,Es.Ys)(Lu),t=yield(0,Es.Ys)(ku);for(const r of e){const e=r.entityTypes||[];if((t?e.filter((e=>t.includes(e))):e).length!==e.length){yield(0,Es.gz)(jc({silent:!0}));break}}}}const Oy=[function*(){yield(0,Es.ib)([_a],gy)},function*(){yield(0,Es.Fm)([ja],Ey)},function*(){yield(0,Es.ib)(Ba,by)},function*(){yield(0,Es.ib)(Ma,hy)},function*(){yield(0,Es.ib)([Da],vy)}];function xy(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Sy(e,t,r[t])}))}return e}function Sy(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*Cy(){const e=yield(0,Es.Ys)(dp);yield(0,Es.RE)(Ay);const t=yield(0,Es.Ys)(Cu);var r;yield(0,Es.gz)((r=t,{type:Lr,payload:{entityTypeUri:r}})),yield(0,Es.rM)(af,e),yield(0,Es.rM)(ky,e),(yield(0,Es.Ys)(fu))?yield(0,Es.rM)(ud,e):yield(0,Es.rM)(Cp)}function*wy(e){const{debounceTime:t}=e.payload||{};t&&(yield(0,Es.gw)(t));const r=yield(0,Es.Ys)(dp);yield(0,Es.rM)(Ry,r)}function*Ay(){const e=yield(0,Es.Ys)(Cu);var t;yield(0,Es.gz)((t=e,{type:Rr,payload:t}))}function*Ry(e){const t=yield(0,Es.Ys)(Cr().selectors.getMetadata),r=yield(0,Es.Ys)(Cu),n=yield(0,Es.Ys)(ep,{entityTypeUri:r}),a=yield(0,Es.Ys)(tp,{entityTypeUri:r}),i=yield(0,Es.Ys)(np,{entityTypeUri:r}),o=yield(0,Es.Ys)(rp,{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,Es.RE)(Py,r);c=(0,_.uniq)(c.concat(a).concat(Ue(t,s,[je]))),l=!0}else c=(0,_.uniq)(c.concat(Ue(t,s,[Fe,je]))),l=!1;const u=xy({page:n,rowsPerPage:a,sortOrder:i,sortField:o,forceOvOnly:l},yield(0,Es.Ys)(Cr().selectors.getGlobalSearchRequestOptions),{select:c}),p=_e(s,u),d=yield(0,Es.Ys)(cp);yield(0,Es.gz)(Vc(!0));try{let e;if(d){const t=function(e){return`/entities${Oe(Ie(e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}))}`}(s,u);e=yield(0,Es.RE)(Yy,t)}else{const t=De(s,u);e=yield(0,Es.RE)(Yy,he,t)}Array.isArray(e)||(e=[]),yield(0,Es.RE)(_y,(0,_.reject)(_.isNil,{query:p,sortField:o,sortOrder:i,dataTenant:d})),e=yield(0,Es.RE)(Hy,e),yield(0,Es.gz)(Lc(e,r))}catch(e){yield(0,Es.gz)(Lc([],r))}yield(0,Es.gz)(Vc(!1))}function*_y(e){var t;yield(0,Es.gz)((t=e.query,{type:"SEARCH_UPDATE_URL",payload:t}));const r=yield(0,Es.Ys)(Cr().selectors.getSearchProviderData);(0,_.equals)(null==r?void 0:r.data,e)||(yield(0,Es.gz)(Sr.search.actions.setSearchNavigationData(null))),yield(0,Es.gz)(Sr.search.actions.setSearchProviderData({type:"search",data:e}))}function*Ny(e){const{columns:t,prevColumns:r}=e.payload;if(uu(t,r)){const e=yield(0,Es.Ys)(Ou),t=(yield(0,Es.Ys)(ap,{entityTypeUri:e})).map((e=>e.uri)),r=yield(0,Es.RE)(Py,e),n=yield(0,Es.Ys)(dp),a=yield(0,Es.Ys)(Cr().selectors.getGlobalSearchRequestOptions),i=ke(t,n,xy({select:r},a));yield(0,Es.gz)(Vc(!0));try{let t=yield(0,Es.RE)(Yy,i.url,i.options);t=yield(0,Es.RE)(Hy,t),yield(0,Es.gz)(Lc(t,e))}catch(t){yield(0,Es.gz)(Lc([],e)),Tp(t)}yield(0,Es.gz)(Vc(!1))}}function*Iy(){const e=yield(0,Es.Ys)(Cu),t=yield(0,Es.Ys)(ap,{entityTypeUri:e});t&&(yield(0,Es.gz)(Sr.search.actions.searchResultsSet(t)))}function*Dy(e){const{entityTypeUri:t,keywordValue:r}=e.payload;yield(0,Es.gz)(function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return{type:wr.CLEAR_ALL_VALUES,payload:{silent:e}}}(!0)),yield(0,Es.gz)(Yc("type",[t],!0)),yield(0,Es.gz)(Sr.search.actions.keywordUpdated({value:r,isRawFilter:!1}))}function*Py(e){const t=yield(0,Es.Ys)(wu,e);return cu(t)}function*ky(e){const t=yield(0,Es.Ys)(Cr().selectors.getGlobalSearchRequestOptions),r=We(e,[],t);try{const e=yield(0,Es.RE)(Yy,Ee,{method:"POST",body:JSON.stringify(r)});yield(0,Es.gz)(Mc(e.total))}catch(e){yield(0,Es.gz)(Mc(0))}}function*Ly(){yield(0,Es.RE)(jy);const e=yield(0,Es.RE)(qm,!0);(0,_.isEmpty)(e.query)||(yield(0,Es.RE)(Qm,e))}const Fy=[Fa];function*jy(){for(;yield(0,Es.Ys)(zu);)yield(0,Es.qn)(Fy)}function*Uy(e){const{debounceTime:t}=e.payload||{};t&&(yield(0,Es.gw)(t)),function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t="type"===(0,_.path)(["payload","facetFieldName"],e);return e.type===wr.CHANGE_VALUES&&t||e.type===wr.CLEAR_ALL_VALUES||e.type===Ir}(e)&&(yield(0,Es.RE)(pf)),(0,_.pathOr)(!1,["payload","silent"],e)||(yield(0,Es.RE)(Cy),yield(0,Es.RE)(Ly))}function*My(e){var t;const r=(0,_.path)(["payload","searchOptions"],e),n=(0,_.path)(["payload","errors"],e),a=(0,_.pathOr)(0,["payload","debounceTime"],e);n&&n.length&&function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];(0,vp.U)(e,{message:L().text("Can't apply search state")})}(n),!(null!==(t=yield(0,Es.Ys)(Cr().selectors.getShowSearchByOv))&&void 0!==t?t:yield(0,Es.Ys)(_u))&&r&&r.searchByOv&&(yield(0,Es.gz)(Sr.search.actions.updateSearchOptions({searchByOv:!1,ovOnly:!1}))),yield(0,Es.RE)(yf),yield(0,Es.RE)(Ty),yield(0,Es.RE)(dd),yield(0,Es.RE)(md),yield(0,Es.RE)(Vy),yield(0,Es.gz)(function(){return{type:Vr,payload:{debounceTime:arguments.length>0&&void 0!==arguments[0]?arguments[0]:0}}}(a))}function*Vy(){const e=yield(0,Es.Ys)(Iu),t=yield(0,Es.Ys)($u);!e&&t.length&&(yield(0,Es.gz)(Bc(null,null,!0)))}function*By(){const e=yield(0,Es.Ys)(pp),{activityFilter:t,globalFilter:r}=yield(0,Es.Ys)(Cr().selectors.getGlobalSearchRequestOptions),n=yield(0,Es.Ys)(Cr().selectors.getSearchOptions),a=n&&n.searchByOv,i=[Ge(e,[],{globalFilter:r})];a&&i.push("options=searchByOv"),t&&i.push(`activeness=${t}`);const o=i.filter(_.identity).join("&"),l=new URLSearchParams(o);if(yield(0,Es.Ys)(Cr().selectors.getSharedPreferencesEnabled)){const e=yield(0,Es.Ys)(Cr().selectors.getServicesPath),t=yield(0,Es.Ys)(Cr().selectors.getTenant),r=yield(0,Es.Ys)(Cr().selectors.getEnvironment),n=yield(0,Es.Ys)(Cr().selectors.getUserName),a=yield(0,Es.Ys)(bu),i=yield(0,Es.Ys)(vu),o=(0,_.pipe)((0,_.map)((0,_.pipe)((0,_.map)((0,_.path)(["attrType","uri"])),(0,_.reject)(x.isEmptyValue))),(0,_.reject)(_.isEmpty)),s="searchExportData",c={name:s,tenant:t,environment:r,user:n,servicesPath:e,value:{searchResultsColumnsUris:Kc(a)?o(i):void 0}};try{yield(0,Es.RE)(x.setSharedPreferences,c),l.set("sharedPreferenceName",s)}catch(e){Tp(e)}}yield(0,Es.gz)(Sr.ui.actions.openConsoleApp("Export","entities",l.toString()))}function*zy(){yield(0,Es.gz)(Sr.ui.actions.openConsoleApp("Data Loader","projects"))}function*Hy(e){const t=yield(0,Es.Ys)(cp);return e&&t?e.map((0,x.enrichEntityWithDataTenant)(t)):e}function*Yy(e,t){const r=yield(0,Es.Ys)(Cr().selectors.getTenant),n=yield(0,Es.Ys)(cp),a=yield(0,Es.Ys)(Cr().selectors.getDtssPath);return yield(0,Es.RE)(qe,{url:e,options:t,customerTenant:r,dataTenant:n,dtssPath:a})}const Wy=[wr.CHANGE_VALUES,Sr.search.constants.KEYWORD_UPDATED,Nr,wr.CLEAR_ALL_VALUES,Mr,Ir,Vr,Va,Sr.search.constants.SEARCH_OPTIONS_UPDATED,Sr.search.constants.ACTIVITY_FILTER_UPDATED,Sr.search.constants.GLOBAL_FILTER_UPDATED,Hr],Gy=[function*(){yield(0,Es.Fm)(Wy,Uy)},function*(){yield(0,Es.Fm)([kr,Lr,Fr,_r,jr],wy)},function*(){yield(0,Es.Fm)(qn,Ny)},function*(){yield(0,Es.Fm)([Ar,Zn,ta],Iy)},function*(){yield(0,Es.Fm)(Dr,Dy)},function*(){yield(0,Es.Fm)(Sr.search.constants.UPDATE_STATE,My)},function*(){yield(0,Es.Fm)(Br,By)},function*(){yield(0,Es.Fm)(zr,zy)}];function qy(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*Zy(e,t){try{const[r,n]=yield(0,Es.RE)($y,e,[]);if((0,_.isNil)(r)||(0,_.isNil)(n))yield(0,Es.gz)(Wc({[e.fieldName]:[]}));else{const[a,i]=vc(e.type),o=Tc(a,r),l=Tc(i,n),s=Xs(e.attrType&&e.attrType.type),[c,u]=s.greaterThan(o,l)?[l,o]:[o,l],p=yield(0,Es.RE)(Ky,e,c,u,t),d={[e.fieldName]:p};yield(0,Es.gz)(Wc(d))}}catch(e){console.warn(e)}}function*$y(e,t){const r=yield(0,Es.Ys)(Cr().selectors.getGlobalSearchRequestOptions),n=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const{searchOptions:a,activityFilter:i,globalFilter:o}=n,l={filter:Ye(t.concat(Ae(e)),r,o)||void 0,options:a||void 0,activeness:i||void 0},s=[{fieldName:e.fieldNameForRequest||e.fieldName,facetType:"stats"}];return{url:`/entities/_facets${Oe(l)}`,options:{method:"POST",body:JSON.stringify(s),headers:{"Content-Type":"application/json"}}}}(e,t,[e.fieldName],r),a=yield(0,Es.RE)(Yy,n.url,n.options),i=$p(a,[e]),{min:o,max:l,count:s}=(c=i,u=[e],Object.keys(c).reduce(((e,t)=>{const r=ac(t,u);return r&&(e[r.fieldName]=((e,t)=>{const{min:r,max:n,count:a}=e;return{min:"Long"===t?new bs.Decimal(r):+r,max:"Long"===t?new bs.Decimal(n):+n,count:a}})(c[t],r.attrType&&r.attrType.type)),e}),{}))[e.fieldName];var c,u;return s?[lr(e)?0:o,l]:[]}function*Ky(e,t,r,n){const a=e.attrType&&e.attrType.type,i=tc(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){qy(e,t,r[t])}))}return e}({interval:o,offset:t},yield(0,Es.Ys)(Cr().selectors.getGlobalSearchRequestOptions)),s=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const{searchOptions:a,activityFilter:i,globalFilter:o}=n,l=Ce(n,["searchOptions","activityFilter","globalFilter"]),s={filter:Ye(t.concat(Ae(e)),r,o)||void 0,options:a||void 0,activeness:i||void 0},c=[xe({fieldName:e.fieldNameForRequest||e.fieldName,facetType:"histogram"},l)];return{url:`/entities/_facets${Oe(s)}`,options:{method:"POST",body:JSON.stringify(c),headers:{"Content-Type":"application/json"}}}}(e,n,[e.fieldName],l),c=yield(0,Es.RE)(Yy,s.url,s.options),u=yield(0,Es.Ys)(Cr().selectors.getMetadata),p=$p(c,[e]),d=ic(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 Qy(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Xy={matches:ze,"dtPotentialMatches.matches":ze,"potentialMatches.matchScore":function(e,t,r,n){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};const o=He(e,t,r,n,a,i);return`/entities/matchScores${Oe(o)}`}};function*Jy(e,t){try{const[r,n]=yield(0,Es.RE)($y,e,[]);if((0,_.isNil)(r)||(0,_.isNil)(n))yield(0,Es.gz)(Wc({[e.fieldName]:[]}));else{const[a,i]=vc(e.type),o=Tc(a,r),l=Tc(i,n),s=yield(0,Es.RE)(ef,e,o,l,t),c={[e.fieldName]:s};yield(0,Es.gz)(Wc(c))}}catch(e){console.warn(e)}}function*ef(e,t,r,n){const a=yield(0,Es.Ys)(Cr().selectors.getGlobalSearchRequestOptions),i=Math.min(5,r-t+1),o=yield(0,Es.RE)(x.rawRequest,Xy[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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Qy(e,t,r[t])}))}return e}({},a,{dataTenant:e.dataTenant})));return o.map((e=>({number:e.count,value:[e.from,e.to]})))}function tf(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){rf(e,t,r[t])}))}return e}function rf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*nf(){const e=yield(0,Es.Ys)(Er),t=yield(0,Es.Ys)(br);return Object.values(xc(e,t))}function*af(e){const t=yield(0,Es.RE)(nf),[r,n]=(0,_.partition)(lr,t);let[a,i]=(0,_.partition)(x.isRangeFacet,n);for(let t=0;t<r.length;t++)yield(0,Es.rM)(Jy,r[t],e);for(let t=0;t<a.length;t++)yield(0,Es.rM)(Zy,a[t],e);const[o,l]=(0,_.partition)((e=>e.values&&e.values.length),i);for(let t=0;t<o.length;t++)yield(0,Es.rM)(lf,o[t],e);const[s,c]=(0,_.partition)(cr,l);for(const t of s)yield(0,Es.rM)(sf,[t],e);c.length&&(yield(0,Es.rM)(sf,c,e))}function*of(e){const t=yield(0,Es.Ys)(dp),[r,n]=(0,_.partition)(lr,e.payload),[a,i]=(0,_.partition)(x.isRangeFacet,n),[o,l]=(0,_.partition)(cr,i);for(let e=0;e<r.length;e++)yield(0,Es.rM)(Jy,r[e],t);for(let e=0;e<a.length;e++)yield(0,Es.rM)(Zy,a[e],t);for(const e of o)yield(0,Es.rM)(sf,[e],t);l.length&&(yield(0,Es.rM)(sf,l,t))}function*lf(e,t,r){const n=yield(0,Es.Ys)(Cr().selectors.getGlobalSearchRequestOptions),a=Be([tf({},e,{pageSize:e.pageSize+1})],t,[e.fieldName],n,r);yield(0,Es.RE)(cf,a,[e])}function*sf(e,t,r){const n=yield(0,Es.Ys)(Cr().selectors.getGlobalSearchRequestOptions),a=Be(e.map((e=>tf({},e,{pageSize:e.pageSize+1}))),t,[],n,r);yield(0,Es.RE)(cf,a,e)}function*cf(e,t){yield(0,Es.RE)(Jp,e,t,Wc)}function*uf(e){const{facetFieldName:t,value:r,debounceTime:n,pageNumber:a=1,currentOptions:i=[]}=e.payload;if(""===r&&1===a)yield(0,Es.gz)((e=>({type:wr.DESTROY_FILTERED_DATA,payload:e}))(t));else{const e=yield(0,Es.Ys)(Er),o=yield(0,Es.Ys)(br),l=tf({},xc(e,o)[t]);if("type"===t){const e={[t]:[...l.data.filter((e=>e.label.toLowerCase().includes(r.toLowerCase())))]};yield(0,Es.gz)(Gc(e))}else{n&&(yield(0,Es.gw)(n));const e=yield(0,Es.Ys)(dp),o=yield(0,Es.Ys)(xr,t),s=e=>Gc({[t]:i.concat(e[t])});r?yield(0,Es.rM)(nd,tf({},l,{displayedItems:o,pageNumber:a,pageSize:l.pageSize+1}),e,r,s):yield(0,Es.rM)(ed,tf({},l,{pageNumber:a,pageSize:l.pageSize+1}),e,s)}}}function*pf(){const e=yield(0,Es.Ys)(Tr),t=t=>t.entityTypeUri&&t.entityTypeUri!==e[0],r=yield(0,Es.Ys)(br);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,Es.gz)(Hc(n)))}}function*df(e){const{facetsToAdd:t=[],fieldNamesToDelete:r=[],changedEntityTypes:n,addToEnd:a=!1}=e.payload;if(t.length||r.length){t.length&&(yield(0,Es.gz)(zc(t,a)));const e=yield(0,Es.RE)(nf);let o=!1;if(r.length){const t=e.filter((e=>e.values&&e.values.length));o=r.some((e=>t.some((t=>t.fieldName.startsWith(e))))),yield(0,Es.gz)(Hc(r))}if(null!=n)yield(0,Es.gz)(Yc("type",n));else if(o)yield(0,Es.gz)(function(){let{debounceTime:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{type:Nr,payload:{debounceTime:e}}}());else if(t.length){const r=e.filter((e=>t.some((t=>e.fieldName.startsWith(t.fieldName)))));yield(0,Es.gz)((i=r,{type:wr.REQUEST_GIVEN_FACETS_DATA,payload:i}))}}var i}function*mf(){const e=yield(0,Es.Ys)(Cr().selectors.getSearchKeyword),t=yield(0,Es.Ys)(Qu),r=yield(0,Es.Ys)(Lu),n=yield(0,Es.Ys)(Cr().selectors.getMetadata),a=yield(0,Es.Ys)(Cr().selectors.getDataTenants);if(Ic(n,r,a)){const i=((e,t,r)=>{const n=kc(e,t,r),a=Pc(e,t,r),i=(0,_.pipe)(_.flatten,_.uniq)($a(t)),o=Wt();return a.reduce(((e,t)=>{let{fieldName:r,values:a}=t;const i=n.find((e=>e.fieldName===r));return i&&(e.facetsConfigs.push(i),e.facetsData[r]={values:a}),e}),{facetsConfigs:[o],facetsData:{[o.fieldName]:(l=i,Ac({values:l})?{values:l,showAllItems:!0}:{values:l})}});var l})(n,r,a);yield(0,Es.gz)(Sr.search.actions.updateState({facets:i,keyword:e,map:t}))}}function*yf(){if(!(yield(0,Es.Ys)(fu)))if(yield(0,Es.Ys)(Cr().selectors.getMetadata),(yield(0,Es.Ys)(br)).some(x.isTypeFacet)){const e=yield(0,Es.Ys)(ku),t=yield(0,Es.Ys)(Tr);(e?t.filter((t=>e.includes(t))):t).length!==t.length&&(yield(0,Es.gz)(jc({silent:!0})))}else{const e=[Wt()];yield(0,Es.gz)(zc(e))}}function*ff(){const e=yield(0,Es.Ys)(Cr().selectors.getMetadata),t=yield(0,Es.Ys)(Er),r=xc({type:t.type},[Wt()]).type.data.reduce(((e,t)=>(e[(0,x.getLastUriPart)(t.value)]=t.number,e)),{}),n=yield(0,Es.Ys)(ku);return fc(e,r,n)}const gf=[function*(){yield(0,Es.Fm)([wr.FILTER_FACET_DATA],uf)},function*(){yield(0,Es.ib)(wr.REQUEST_GIVEN_FACETS_DATA,of)},function*(){yield(0,Es.ib)(wr.HANDLE_CONFIGS_CHANGES,df)},function*(){yield(0,Es.ib)(wr.CONVERT_FROM_ADVANCED_SEARCH,mf)}];function hf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ef=e=>{const t=["view","searchResultsColumns"],r=(0,_.pathOr)({},t,e),n=(0,_.map)((0,_.map)((0,_.pipe)((0,_.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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){hf(e,t,r[t])}))}return e}({},e,{attrType:{uri:(0,_.pathOr)("",["attrType","uri"],e)}}):e))),r),a=(0,_.lensPath)(t),i=(0,_.omit)(["sortField","sortOrder","entityTypeTab"],e.view),o=(0,_.lensPath)(["view"]),l=["keyword"],s=(0,_.pathOr)("",l,e),c=(0,_.lensPath)(l),u=["map"],p=(0,_.pathOr)("",u,e),d=(0,_.lensPath)(u);return(0,_.pipe)((0,_.omit)(["searchOptions"]),(0,_.set)(o,i),(0,_.set)(a,n),(0,_.set)(c,s),(0,_.set)(d,p))(e)};function bf(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){vf(e,t,r[t])}))}return e}function vf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*Tf(e){let{payload:{share:t}}=e;const{query:r,uiState:n}=yield(0,Es.RE)(qm,!0),a=bf({},yield(0,Es.Ys)(qd),{isPublic:t===$,query:r,uiState:n}),i=yield(0,Es.Ys)(zd);yield(0,Es.gz)(Rp(!1));try{yield(0,Es.gz)(Lp(L().text("Updating search..."))),yield(0,Es.RE)(x.updateSavedSearch,a),yield(0,Es.gz)(vd(!1)),yield(0,Es.gz)(Lp(L().text("Search updated successfully"))),i&&(yield(0,Es.gz)(i))}catch(e){Tp(e)}}function*Of(){const e=yield(0,Es.Ys)(qd);if(!e)return void(yield(0,Es.gz)(vd(!1)));const t=yield(0,Es.Ys)(Cr().selectors.getMetadata),r=yield(0,Es.Ys)(Cr().selectors.getDataTenants),n=yield(0,Es.Ys)(Cr().selectors.getCanUserReadWorkflowDataTask),{uiState:a}=wm(t,r,n,yield(0,Es.RE)(qm)),i=(e=>{let{savedUiState:t,actualUiState:r}=e;const n=Ef(t),a=Ef(r);if(!(0,_.equals)(n,a))return!1;if((0,_.path)(["view","searchResultsMode"],t)===V){const e=["view","sortField"],n=["view","sortOrder"],a=["view","entityTypeTab"],i=(0,_.path)(e,t),o=(0,_.path)(e,r),l=(0,_.path)(n,t),s=(0,_.path)(n,r),c=(0,_.path)(a,t),u=(0,_.path)(a,r);if(!(0,_.equals)(i,o)||!(0,_.equals)(l,s)||!(0,_.equals)(c,u))return!1}const i=["searchOptions"],o=(0,_.pathOr)(null,i,t),l=(0,_.pathOr)(null,i,r);return!!((0,_.isNil)(o)||(0,_.isNil)(l)||(0,_.equals)(o,l))})({savedUiState:e.uiState,actualUiState:a});yield(0,Es.gz)(vd(!i))}function*xf(e){const t=yield(0,Es.Ys)(qd);if(t)switch(e.type){case ao:case Ji:case to:t.uri===e.payload.uri&&(yield(0,Es.gz)(bd(bf({},t,e.payload))));break;case so:(0,_.includes)(t.uri,e.payload)&&(yield(0,Es.gz)(bd(null)));break;case Bi:yield(0,Es.gz)(bd(bf({},t,{isPublic:e.payload.share===$})));break;default:(yield(0,Es.Ys)(op))&&(yield(0,Es.gz)(bd(null)))}}function*Sf(e){const t=yield(0,Es.Ys)(Pd,e);if(t)return t;const r=yield(0,Es.Ys)(Cr().selectors.getMetadata),n=yield(0,Es.Ys)(Cr().selectors.getDataTenants),a=yield(0,Es.Ys)(Cr().selectors.getCanUserReadWorkflowDataTask);try{const t=yield(0,Es.RE)(x.getSavedSearch,(e=>e.split("savedSearches/")[1])(e));return wm(r,n,a,t)}catch(e){return Tp(e),null}}function*Cf(e){const t=(0,_.path)(["payload","currentSavedSearchUri"],e);if(!t)return;const r=yield(0,Es.Ys)(qd);if((0,_.prop)("uri",r)===t)return;const n=yield(0,Es.RE)(Sf,t);n&&(yield(0,Es.gz)(bd(n)),yield(0,Es.RE)(Of))}const wf=[...Wy,Zn,jr,ta,qn,Qn,Kn,ra,wr.CREATE_FACETS,wr.DESTROY_FACETS,wr.SHOW_MORE_ENTITY_TYPES],Af=[function*(){yield(0,Es.Fm)(wf,Of)},function*(){yield(0,Es.Fm)([Bi],Tf)},function*(){yield(0,Es.Fm)([ao,Ji,to,so,Bi,...Wy],xf)},function*(){yield(0,Es.Fm)(Sr.search.constants.UPDATE_STATE,Cf)}];function Rf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*_f(){yield(0,Es.gw)(500);const{uiState:e,query:t}=yield(0,Es.RE)(qm,!1,!0),r=yield(0,Es.Ys)(qd);yield(0,Es.gz)(Sr.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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Rf(e,t,r[t])}))}return e}({},e,{query:t,currentSavedSearchUri:(0,_.path)(["uri"],r)})))}function*Nf(){yield(0,Es.qn)(Sr.search.constants.UPDATE_STATE);const e=(0,_.reject)((0,_.includes)(_.__,[Nr]),wf);yield(0,Es.Fm)([Mi,...e],_f)}const If=e=>({type:go,payload:e}),Df=()=>({type:Oo}),Pf=e=>({type:So,payload:e}),kf=e=>({type:wo,payload:e}),Lf=(e,t)=>({type:_o,payload:{searchCreatedDate:e,isLoading:t}}),Ff=(0,_.path)([F,"recentSearches"]),jf=e=>Ff(e).items,Uf=e=>Ff(e).filterWord,Mf=(0,_.curry)(((e,t)=>!e||t&&t.name.toLocaleLowerCase().includes(e.toLocaleLowerCase()))),Vf=e=>(0,_.pipe)(jf,(0,_.filter)(Mf(Uf(e))))(e),Bf=e=>Ff(e).loading,zf=Ad(jf),Hf=Rd(jf),Yf=_d(jf),Wf=Nd(jf),Gf=e=>Ff(e).lastSavedRecentSearch,qf=(e,t)=>jf(e).find((0,_.propEq)("createdDate",t)),Zf=(0,_.path)(["advancedSearch","searchParams","groups"]),$f=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,_.chain)((0,_.prop)("attributes")),r=(0,_.filter)((0,_.has)("values")),n=(0,_.pipe)(Zf,t,r),a=(0,_.pipe)((0,_.prop)("values"),(0,_.map)((0,_.prop)("label")),(0,_.join)(", ")),i=(0,_.path)(["data","title"]),o=(0,_.pathEq)(["data","fieldName"],"type"),l=(0,_.find)(o),s=(0,_.pipe)(l,(0,_.when)(_.identity,a)),c=(0,_.pipe)((0,_.reject)(o),(0,_.map)(i),(0,_.reject)(_.isNil),(0,_.join)(", ")),u=e=>[s(e),c(e)].filter(_.identity).join(" - ");return u(n(e))},Kf=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,_.prop)("facets"),r=(0,_.prop)("facetsData"),n=(0,_.prop)("facetsConfigs"),a=(0,_.prop)("values"),i=(0,_.prop)("label"),o=(0,_.prop)("title"),l=(0,_.pipe)(a,(e=>e&&e.length>0)),s=e=>(0,_.pipe)((0,_.propOr)([],"data"),(0,_.find)((0,_.propEq)("value",e)),(0,_.defaultTo)({}),i),c=(0,_.curry)(((e,r)=>(0,_.pipe)(t,n,(0,_.find)((0,_.propEq)("fieldName",r)),(0,_.defaultTo)({}),o)(e))),u=Cc(e),p=[];u&&p.push(a(u).map(s).map((e=>e(u))).join(", "));const d=(0,_.pipe)(t,r,_.values,(0,_.reject)(x.isTypeFacet),(0,_.filter)(l),(0,_.map)((0,_.prop)("fieldName"))),m=(0,_.pipe)(d,(0,_.map)(c(e))),y=m(e);return y.length>0&&p.push(y.join(", ")),p.filter(_.identity).join(" - ")};function Qf(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Xf(e,t,r[t])}))}return e}function Xf(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*Jf(){yield(0,Es.gz)(kf(!0));try{const t=yield(0,Es.Ys)(Cr().selectors.getTenant),r=yield(0,Es.Ys)(Cr().selectors.getEnvironment),n=yield(0,Es.Ys)(Cr().selectors.getServicesPath),{result:a=[]}=yield(0,Es.RE)(x.getRecentSearches,{environment:r,tenant:t,servicesPath:n}),i=(0,_.sort)((0,_.descend)((0,_.prop)("createdDate")))(a);yield(0,Es.gz)((e=i,{type:Eo,payload:e})),yield(0,Es.gz)(kf(!1)),yield(0,Es.RE)(rg,i)}catch(e){Tp(e),yield(0,Es.gz)(kf(!1))}var e}function*eg(e){const t=yield(0,Es.Ys)(qf,e.payload);yield(0,Es.RE)(tg,t)}function*tg(e,t){yield(0,Es.gz)(Lf(e.createdDate,!0));try{const{total:r}=yield(0,Es.RE)(x.getTotalsForQuery,(0,x.replacePlaceholdersInQuery)(e.query),Boolean(t));yield(0,Es.gz)(((e,t)=>({type:bo,payload:{searchCreatedDate:e,total:t}}))(e.createdDate,r))}catch(e){Tp(e)}yield(0,Es.gz)(Lf(e.createdDate,!1))}function*rg(e){const t=yield(0,Es.Ys)(Cr().selectors.getQueryEstimatorEnabled);return yield(0,Es.$6)(e.map((e=>(0,Es.RE)(tg,e,t))))}function*ng(){const e=yield(0,Es.Ys)(Wf),t=yield(0,Es.Ys)(Cr().selectors.getServicesPath);yield(0,Es.gz)(kf(!0));try{yield(0,Es.$6)(e.map((e=>(0,Es.RE)(x.deleteRecentSearch,Qf({},e,{servicesPath:t}))))),yield(0,Es.gz)(Pf(e))}catch(e){Tp(e)}yield(0,Es.gz)(kf(!1))}function*ag(e){const t=e.payload,r=yield(0,Es.Ys)(Cr().selectors.getServicesPath);yield(0,Es.gz)(kf(!0));try{yield(0,Es.RE)(x.deleteRecentSearch,Qf({},t,{servicesPath:r})),yield(0,Es.gz)(Pf([t]))}catch(e){Tp(e)}yield(0,Es.gz)(kf(!1))}function*ig(){const{query:e,uiState:t}=yield(0,Es.RE)(qm,!0),r=yield(0,Es.Ys)(pu),n=yield(0,Es.Ys)(Gf),a=yield(0,Es.Ys)(op),i=yield(0,Es.Ys)(Cr().selectors.getTenant),o=yield(0,Es.Ys)(Cr().selectors.getEnvironment),l=yield(0,Es.Ys)(Cr().selectors.getServicesPath),s=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Zf(e);return t&&t.length>0?$f(e):Kf(e)}(r),c=(0,x.getHash)(e),u={query:e,state:t,name:s,environment:o,tenant:i};try{if(n!==c&&!a){const e=yield(0,Es.RE)(x.createRecentSearch,u,l);e.success?yield(0,Es.gz)((e=>({type:Ro,payload:e}))(c)):Tp(e)}}catch(e){Tp(e)}}function*og(e){const{search:t,debounceTime:r}=e.payload;yield(0,Es.gz)(Ap(!1));const n=yield(0,Es.Ys)(Cr().selectors.getMetadata),a=yield(0,Es.Ys)(Cr().selectors.getDataTenants),i=yield(0,Es.Ys)(Cr().selectors.getCanUserReadWorkflowDataTask);let o={};try{o=(0,_.pipe)(xm,vm(null))(n,JSON.parse(t.state),{},a,i)}catch(e){o={}}(yield(0,Es.Ys)(cp))&&(o.currentTenant=yield(0,Es.Ys)(Cr().selectors.getTenant)),yield(0,Es.gz)(Sr.search.actions.updateState(Qf({},o,{debounceTime:r})))}const lg=e=>{let{type:t,payload:r={}}=e;return t===Sr.search.constants.KEYWORD_UPDATED&&!(null==r||!r.saveToRecent)},sg=[function*(){yield(0,Es.Fm)([ho],Jf)},function*(){yield(0,Es.ib)(xo,ng)},function*(){yield(0,Es.Fm)([Sr.ui.constants.UIActions.OPEN_ENTITY,Ui,Bi,go,kr,Fr,Br,lg],ig)},function*(){yield(0,Es.Fm)([Io],og)},function*(){yield(0,Es.ib)([No],eg)},function*(){yield(0,Es.ib)(Co,ag)}],cg=e=>e.explorer.entity.loading,ug=e=>e.explorer.entity.selectedEntityUri,pg=e=>e.explorer.entity.entity,dg=e=>({type:tl,payload:e}),mg=e=>({type:rl,payload:e}),yg=e=>({type:nl,payload:e}),fg=e=>({type:al,payload:e});function*gg(e){if(yield(0,Es.Ys)(cp)){const t=yield(0,Es.RE)(Yy,(0,x.getDtssEntityUrl)(e));return(yield(0,Es.RE)(Hy,t))[0]}return yield(0,Es.RE)(x.getEntity,e)}function*hg(e){const t=e.payload;(yield(0,Es.Ys)(ug))!==t&&(yield(0,Es.gz)(yg(t)));const r=yield(0,Es.Ys)(pg);if(yield(0,Es.gz)(dg(!0)),(0,_.isNil)(t))yield(0,Es.gz)(fg(null));else if(!r||r.uri!==t)try{const e=yield(0,Es.RE)(gg,t);yield(0,Es.gz)(fg(e))}catch(e){n=e,(0,vp.U)(n,{defaultMessage:L().text("Can't load entity")}),yield(0,Es.gz)(fg(null))}var n;yield(0,Es.gz)(dg(!1))}const Eg=[function*(){yield(0,Es.Fm)(rl,hg)}];function*bg(e){const t="type"===(0,_.path)(["payload","facetFieldName"],e),r=(0,_.path)(["payload","values"],e);if(!t||1!==(0,_.length)(r))return;const n=yield(0,Es.Ys)(Cr().selectors.getMetadata),a=(0,x.getEntityType)(n,r[0]),i=a.defaultFacetedAttributes||[];if(i.length>0){const e=yield(0,Es.Ys)(br),t=t=>{let{fieldName:r}=t;return(0,_.none)((0,_.propEq)("fieldName",r),e)},r=Vt(n,a).map((e=>Ut(n,e,a.uri,"",$t))),o=i.reduce(((e,n)=>{const a=(0,x.attributeUriToSearchUri)(n),i=Jt(r,a);return i&&t(i)?e.concat(i.children?jt(i).filter(t):i):e}),[]);o.length>0&&(yield(0,Es.gz)(zc(o,!0)))}}const vg=[function*(){yield(0,Es.Fm)(wr.CHANGE_VALUES,bg)}],Tg=e=>({type:vl,payload:e}),Og=()=>({type:xl}),xg=()=>({type:dl}),Sg=e=>({type:fl,payload:e}),Cg=e=>({type:hl,payload:e}),wg=e=>({type:bl,payload:e}),Ag=e=>({type:Ol,payload:e}),Rg=e=>({type:Sl,payload:e}),_g=e=>{let{id:t,groupId:r}=e;return{type:Rl,payload:{id:t,groupId:r}}},Ng=e=>{let{id:t,groupId:r,operationParameters:n}=e;return{type:Al,payload:{id:t,groupId:r,operationParameters:n}}},Ig=(e,t,r)=>({type:Nl,payload:{groupId:e,attributeId:t,attribute:ai(r)}}),Dg=(e,t,r)=>({type:Il,payload:{groupId:e,attributeId:t,attributeData:ii(r)}}),Pg=(e,t)=>({type:Il,payload:{groupId:e,attributeId:t,attributeData:null}}),kg=(e,t,r)=>({type:Dl,payload:{groupId:e,attributeId:t,selectInfo:r}}),Lg=(e,t)=>({type:Pl,payload:{groupId:e,attributeId:t}}),Fg=(e,t,r)=>({type:kl,payload:{groupId:e,attributeId:t,filter:r}}),jg=(e,t,r)=>({type:Ll,payload:{groupId:e,attributeId:t,values:r}}),Ug=e=>({type:Ml,payload:e}),Mg=(0,_.has)("actions"),Vg=e=>e.actions.map((0,_.assocPath)(["operationParameters","conditions"],e.conditions)),Bg=(0,_.path)(["operationParameters","attributeTypeData","attributeType"]),zg=(0,_.path)(["operationParameters","attributeTypeData","fieldName"]),Hg=(0,_.path)(["operationParameters","pin"]),Yg=(0,_.path)(["operationParameters","addNestedAttribute"]),Wg=(0,_.path)(["operationParameters","attributeValue"]),Gg=(0,_.path)(["operationParameters","attributeValueToFind"]),qg=(0,_.anyPass)([(0,_.equals)(se.AddNew),(0,_.equals)(se.ReplaceAllWith)]),Zg=(0,_.anyPass)([(0,_.equals)(se.AddNew),(0,_.equals)(se.ReplaceAllWith),(0,_.equals)(se.FindAndReplace)]),$g=(0,_.equals)(se.AddNew),Kg=(0,_.both)((0,_.pipe)(Bg,x.isNested),(0,_.pipe)((0,_.prop)("operation"),qg)),Qg=(0,_.both)((0,_.pipe)(Bg,x.isReference),(0,_.pipe)((0,_.prop)("operation"),$g)),Xg=(0,_.both)((0,_.pipe)(Wg,x.isLookupAttrType),(0,_.pipe)((0,_.prop)("operation"),Zg));function Jg(e){switch(e){case se.AddNew:case se.RepointReference:case se.ReplaceAllWith:return["attributeValue"];case se.FindAndReplace:return["attributeValueToFind","attributeValue"];case se.FindAndRemove:return["attributeValueToFind"];default:return[]}}const eh=e=>{if(!e.operation||!e.operationParameters)return!1;const t=Kg(e),r=Qg(e),n=Jg(e.operation);for(let a of n){const n=e.operationParameters[a];if((0,x.isEmptyValue)(n)||r&&(0,x.isEmptyValue)((0,x.getReferencedEntityFromAttrValue)(n))||t&&(0,x.isEmptyValue)((0,x.cleanAttributesWith)({deleteEmptyComplex:!0})(n.value)))return!1}return!0},th=e=>{const t=Kg(e),r=Qg(e);return t||r?Jg(e.operation).reduce(((e,t)=>{const r=["operationParameters",t,"value"];if((0,_.path)(r,e)){const t=(0,_.lensPath)(r);return(0,_.over)(t,(0,x.cleanAttributesWith)({deleteEmptyComplex:!0}),e)}return e}),e):e},rh=e=>e.explorer.bulkUpdate.operation,nh=e=>e.explorer.bulkUpdate.activeStep,ah=e=>e.explorer.bulkUpdate.loading,ih=e=>{const t=fu(e)?Fu(e):Tr(e),r=Cu(e);return r||1===t.length?r||t[0]:null},oh=(0,_.path)([F,"bulkUpdate","objects"]),lh=e=>oh(e).total,sh=e=>oh(e).selectionMode,ch=e=>oh(e).entities,uh=e=>oh(e).selectedEntities,ph=e=>oh(e).page,dh=e=>oh(e).rowsPerPage,mh=e=>oh(e).sortField,yh=e=>oh(e).sortOrder,fh=e=>oh(e).selectedColumns,gh=e=>oh(e).filterText,hh=(0,_.pipe)(sh,(0,_.equals)(ae)),Eh=(0,_.ifElse)(hh,(0,_.pipe)(uh,_.length),(e=>{const t=uh(e).length;return Ep(e)-t})),bh=(0,_.pipe)(Eh,(0,_.gt)(_.__,0)),vh=e=>e.explorer.bulkUpdate.actions,Th=(0,Zc.createSelector)(vh,(0,_.pipe)((0,_.map)((0,_.ifElse)(Mg,(0,_.evolve)({actions:(0,_.pipe)((0,_.map)(th),(0,_.filter)(eh))}),th)),(0,_.filter)((0,_.ifElse)(Mg,(0,_.pipe)((0,_.path)(["actions","length"]),(0,_.gt)(_.__,0)),eh)))),Oh=(0,Zc.createSelector)(vh,(0,_.pipe)((0,_.map)((0,_.when)(Mg,(0,_.prop)("actions"))),_.flatten)),xh=e=>{const t=Oh(e);return 0!==t.length&&t.every(eh)},Sh=e=>e.explorer.bulkUpdate.requestPending,Ch=(0,x.getUrisForSaving)((e=>(0,_.equals)(e.slice(-3),["operationParameters","attributeValue","entityUri"]))),wh=(0,_.curry)(((e,t,r)=>{const n=(0,_.pipe)(Ch,(0,_.find)((t=>(0,_.pathSatisfies)((t=>t===e),t,r))))(r);return n?(0,_.set)((0,_.lensPath)(n),t,r):r})),Ah=(e,t,r)=>(0,_.pipe)(wh(e,t),(0,_.when)((e=>e===r),(0,x.replaceTemporaryRefEntityURI)(e,t)))(r),Rh=(0,_.pathEq)(["data","fieldName"],fe),_h=(0,_.pipe)((0,_.path)(["values",0,"entityUri"]),(0,_.objOf)("uri"),x.getEntityId,x.wrapInQuotes),Nh=e=>[{attributes:e,operator:"or"}],Ih=(0,_.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===ye&&l--,i.length||(i=a.slice(-1),l++);const s=`${(0,_.repeat)("parent.",Math.max(0,l)).join("")}attributes.${i.join(".")}`;return(0,_.assocPath)(["data","fieldName"],s,r)})))),Dh=(0,_.curry)(((e,t,r)=>{const n=((e,t,r)=>{const[n,a]=(0,_.partition)(Rh,e),i=(0,_.pipe)(Ih(t,r),Nh,it)(a),o=n.length?(e=>`in(referenced_entity_id, ${e.map(_h).join(",")})`)(n):"";return i&&o?`${i} and ${o}`:i||o})(e,t,r.operation);return(0,_.isEmpty)(n)?r:(0,_.ifElse)((0,_.pipe)((0,_.path)(["operationParameters","valueFilter"]),x.isEmptyValue),(0,_.assocPath)(["operationParameters","valueFilter"],n),(0,_.evolve)({operationParameters:{valueFilter:(0,_.concat)(_.__,` and (${n})`)}}))(r)}));function Ph(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){kh(e,t,r[t])}))}return e}function kh(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Lh=e=>{const t=(0,_.pipe)((0,_.pick)(["pin"]),(0,_.assoc)("value",Fh(e)))(e);return vs(t.value)?Object.keys(t.value).reduce(((e,r)=>(e.value=Ph({},e.value,{[r]:t.value[r].map(Lh)}),e)),t):t},Fh=(0,_.when)(vs,(0,_.ifElse)((0,_.has)("lookupCode"),(0,_.prop)("lookupCode"),(0,_.prop)("value"))),jh=(0,_.cond)([[Kg,(0,_.pipe)(Wg,Lh)],[Qg,(0,_.pipe)(Wg,(e=>{const{refEntity:t=[],refRelation:r=[]}=e;return Ph({refEntity:(0,_.pipe)(_.head,(0,_.pick)(["objectURI"]))(t),refRelation:(0,_.pipe)(_.head,(0,_.pick)(["type"]))(r)},Lh(e))}))],[Xg,(0,_.pipe)(Wg,Fh)],[_.T,Wg]]),Uh=(0,_.pipe)(jh,(0,_.assocPath)(["operationParameters","attributeValue"])),Mh=(0,_.ifElse)(Hg,(()=>(0,_.assocPath)(["operationParameters","pin"],!0)),(()=>_.identity)),Vh=(0,_.ifElse)(Yg,(()=>(0,_.assocPath)(["operationParameters","addNestedAttribute"],!0)),(()=>_.identity)),Bh=(0,_.pipe)(Gg,(0,_.ifElse)(_.isNil,(()=>_.identity),(0,_.pipe)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return`equals(value, '${Fh(e)}')`}),(0,_.assocPath)(["operationParameters","valueFilter"])))),zh=(0,_.pipe)(Wg,(0,_.prop)("entityUri"),(0,_.assocPath)(["operationParameters","referencedEntity","uri"])),Hh=(e,t)=>({operationParameters:{attributeURI:e},operation:t}),Yh=(e,t)=>(0,_.pipe)(Hh,Uh(e),Mh(e),Vh(e))(t,ye),Wh=(e,t)=>(0,_.pipe)(Hh,Bh(e))(t,"DeleteAttribute"),Gh=(e,t)=>(0,_.pipe)(Hh,Uh(e),Mh(e),Bh(e))(t,"UpdateAttribute"),qh=(e,t)=>(0,_.pipe)(Hh,zh(e))(t,"RepointReferencedEntity"),Zh=(e,t)=>(0,_.reject)(_.isNil,{operationParameters:e,operation:t}),$h=e=>Zh({tags:[Wg(e)]},"AddTags"),Kh=e=>Zh({newValue:Wg(e),oldValue:Gg(e)},"ReplaceTag"),Qh=e=>Zh({tags:[Gg(e)]},"DeleteTags"),Xh=()=>Zh(null,"ClearTags"),Jh=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{selectionMode:n,selectedEntities:a=[]}=e,{searchOptions:i,activityFilter:o,globalFilter:l}=r;return n===ae?{list:a,activeness:o}:{filter:(0,_.pipe)(_e,(0,x.addGlobalFilterToQuery)(l))(t),excludeList:a,options:i,activeness:o}},eE=(0,_.curry)(((e,t)=>(0,_.chain)((0,_.ifElse)(Mg,(0,_.pipe)(Vg,eE(e)),tE(e)))(t))),tE=(0,_.curry)(((e,t)=>{const r=(0,_.pathOr)([],["operationParameters","conditions"],t),n=zg(t);return(0,_.pipe)(nE(e),(0,_.map)(Dh(r,n)))(t)})),rE=(0,_.curry)((e=>(0,_.propEq)("operation",e))),nE=(0,_.curry)(((e,t)=>{const r=zg(t),n=r.includes(".")?(0,x.searchUriToAttrUri)(r,e):r,a=r===x.EntityAttrTypes.tags.uri;return(0,_.cond)([[(0,_.both)((0,_.always)(a),rE(se.AddNew)),()=>[$h(t)]],[(0,_.both)((0,_.always)(a),rE(se.Clear)),()=>[Xh()]],[(0,_.both)((0,_.always)(a),rE(se.ReplaceAllWith)),()=>[Xh(),$h(t)]],[(0,_.both)((0,_.always)(a),rE(se.FindAndReplace)),()=>[Kh(t)]],[(0,_.both)((0,_.always)(a),rE(se.FindAndRemove)),()=>[Qh(t)]],[rE(se.AddNew),()=>[Yh(t,n)]],[rE(se.Clear),()=>[Wh(t,n)]],[rE(se.ReplaceAllWith),()=>[Wh(t,n),Yh(t,n)]],[rE(se.FindAndReplace),()=>[Gh(t,n)]],[rE(se.FindAndRemove),()=>[Wh(t,n)]],[rE(se.RepointReference),()=>[qh(t,n)]]])(t)}));function aE(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){iE(e,t,r[t])}))}return e}function iE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*oE(e){if(e.payload){const e=yield(0,Es.Ys)(Cu);let r;do{if(r=yield(0,Es.Ys)(ap,{entityTypeUri:e}),r)break;yield(0,Es.qn)(Ar)}while(!r);const n=yield(0,Es.Ys)(ih),a=yield(0,Es.Ys)(ep,{entityTypeUri:e}),i=yield(0,Es.Ys)(tp,{entityTypeUri:e}),o=(yield(0,Es.Ys)(np,{entityTypeUri:e}))||void 0,l=yield(0,Es.Ys)(rp,{entityTypeUri:e}),s=(yield(0,Es.RE)(sd))[n].filter((0,_.pipe)((0,_.prop)("id"),x.isAttributeSearchUri,_.not)),c=e?yield(0,Es.Ys)(wu,e):s,u=yield(0,Es.Ys)(Ju,{entityTypeUri:e});yield(0,Es.gz)((t={page:a,rowsPerPage:i,sortOrder:o,sortField:l,selectedColumns:c,total:u,entities:r},{type:pl,payload:t}))}var t}function*lE(e){const t=yield(0,Es.Ys)(Cr().selectors.getMetadata),r=yield(0,Es.Ys)(ph),n=yield(0,Es.Ys)(dh),a=yield(0,Es.Ys)(yh),i=yield(0,Es.Ys)(mh),o=yield(0,Es.RE)(hE),l=(0,_.uniq)(o.concat(Ue(t,e))),s=aE({page:r,rowsPerPage:n,sortOrder:a,sortField:i,forceOvOnly:!0},yield(0,Es.Ys)(Cr().selectors.getGlobalSearchRequestOptions),{select:l}),c=De(e,s);yield(0,Es.gz)(Sg(!0));try{const e=yield(0,Es.RE)(x.rawRequest,he,c);yield(0,Es.gz)(Tg(e))}catch(e){console.warn(e),yield(0,Es.gz)(Tg([]))}yield(0,Es.gz)(Sg(!1))}function*sE(){const e=yield(0,Es.Ys)(gh),t=yield(0,Es.RE)(gE,e);yield(0,Es.rM)(lE,t)}function*cE(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{debounceTime:t}=e.payload||{};t&&(yield(0,Es.gw)(t));const r=yield(0,Es.Ys)(gh),n=yield(0,Es.RE)(gE,r);yield(0,Es.gz)(Cg(0)),yield(0,Es.rM)(uE,n)}function*uE(e){const t=yield(0,Es.Ys)(Cr().selectors.getGlobalSearchRequestOptions),r=We(e,[],t);try{const e=yield(0,Es.RE)(x.rawRequest,Ee,{method:"POST",body:JSON.stringify(r)});yield(0,Es.gz)(Ag(e.total))}catch(e){console.warn(e),yield(0,Es.gz)(Ag(0))}}function*pE(){const e=(yield(0,Es.Ys)(ch)).map((e=>e.uri)),t=yield(0,Es.RE)(hE),r=yield(0,Es.Ys)(gh),n=yield(0,Es.RE)(gE,r),a=yield(0,Es.Ys)(Cr().selectors.getGlobalSearchRequestOptions),i=ke(e,n,aE({select:t},a));yield(0,Es.gz)(Sg(!0));try{const e=yield(0,Es.RE)(x.rawRequest,i.url,i.options);yield(0,Es.gz)(Tg(e))}catch(e){console.warn(e),yield(0,Es.gz)(Tg([]))}yield(0,Es.gz)(Sg(!1))}function*dE(e){try{yield(0,Es.RE)(x.rawRequest,e.url,e.options),yield(0,Es.gz)(Up(!1)),yield(0,Es.gz)(Fp({message:L().text("Bulk update is currently in progress. You'll receive an email notification once completed.\nGo to Tenant Management to view the status."),actionLabel:L().text("Tenant Management"),actionToDispatch:Sr.ui.actions.openConsoleApp("Tenant Management","jobs/pending"),autoHideDuration:1e4}))}catch(e){let r=e;e&&"object"==typeof e&&(r="errorCode"in e&&441===e.errorCode?L().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||L().text("Something went wrong...")),yield(0,Es.gz)((t=r,kp({payload:{message:t,action:{actionToDispatch:Pp()}},type:re})))}var t}function*mE(){const e=yield(0,Es.Ys)(rh);e===oe?yield(0,Es.RE)(yE):e===le&&(yield(0,Es.RE)(fE))}function*yE(){yield(0,Es.gz)(Ug(!0));const e=yield(0,Es.Ys)(ih),t=yield(0,Es.Ys)(oh);let r=yield(0,Es.Ys)(Th);const n=yield(0,Es.RE)(gE),a=yield(0,Es.Ys)(Cr().selectors.getGlobalSearchRequestOptions),i=yield(0,Es.Ys)(Cr().selectors.getModifiedEntities),o=((e,t)=>{const r=(0,x.findAllTemporaryRefEntityURI)(t),n=(a=t,(0,_.pipe)(Ch,(0,x.getPathsWithTempUri)(a),(0,_.map)((e=>(0,_.path)(e,a))))(a));var a;return r.concat(n).filter((t=>e[t]))})(i,r);if(o.length>0){const e=yield(0,Es.RE)(x.saveTemporaryEntities,i,o);for(const[t,n]of Object.entries(e))r=Ah(t,n,r)}const l=function(e,t,r,n,a){const i=function(e){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];return{objects:Jh(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],arguments.length>4&&void 0!==arguments[4]?arguments[4]:{}),actions:eE(e,t)}}(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,Es.RE)(dE,l),yield(0,Es.gz)(Ug(!1))}function*fE(){yield(0,Es.gz)(Ug(!0));const e=function(e,t,r){const n={objects:Jh(e,t,r)};return{url:"/entities/_delete?sendMail=true",options:{method:"POST",body:JSON.stringify(n),headers:{"Content-Type":"application/json"}}}}(yield(0,Es.Ys)(oh),yield(0,Es.RE)(gE),yield(0,Es.Ys)(Cr().selectors.getGlobalSearchRequestOptions));yield(0,Es.RE)(dE,e),yield(0,Es.gz)(Ug(!1))}function*gE(e){const t=yield(0,Es.Ys)(dp),r={fieldName:"type",filter:"equals",values:[yield(0,Es.Ys)(ih)]};let n=t.filter((e=>"type"!==e.fieldName)).concat(r);return e&&(n=n.concat({fieldName:"attributes",filter:"containsWordStartingWith",values:[e]})),n}function*hE(){const e=yield(0,Es.Ys)(fh);return cu(e)}function*EE(e){const{groupId:t,attributeId:r,selectInfo:n}=e.payload,a=yield(0,Es.Ys)(vh),i={addAttributeAfter:Ig,changeAttribute:Dg,clearAttribute:Pg,deleteAttribute:Lg};yield(0,Es.RE)(my,{groups:a,attributesPropName:"conditions",groupId:t,attributeId:r,selectInfo:n,actions:i})}const bE=[function*(){yield(0,Es.Fm)(zn,oE)},function*(){yield(0,Es.Fm)([hl,gl,El],sE)},function*(){yield(0,Es.Fm)(Tl,cE)},function*(){yield(0,Es.Fm)(xl,pE)},function*(){yield(0,Es.ib)(Dl,EE)},function*(){yield(0,Es.ib)(Ul,mE)}],vE=()=>({id:F,reducerMap:{[F]:(0,R.combineReducers)({ui:ba,search:jn,facets:vn,advancedSearch:ji,savedSearches:Wo,recentSearches:el,entity:cl,bulkUpdate:hs})},sagas:[...Gy,...gf,...Ed,...Oy,...Km,...sg,...Af,Nf,...Eg,...vg,...bE]});var TE=r(95099),OE=r.n(TE),xE=r(34756),SE=r(79573),CE=r(23625),wE=r.n(CE),AE=r(42950);const RE=(0,AE.Z)((()=>({container:e=>{let{containerHeight:t=553,containerWidth:r}=e;return{display:"flex",flexDirection:"column",height:t,width:r,flexGrow:1}},header:{marginLeft:"16px",marginTop:"16px",marginBottom:"12px",fontSize:"16px",fontWeight:500,letterSpacing:"0.15px",lineHeight:"24px"},searchInputContainer:{margin:"0 16px 12px 16px",flexShrink:"0"},list:{flexGrow:1,height:0,overflow:"hidden",width:"100%",position:"relative","& ul":{paddingBottom:0,paddingTop:0}}})));var _E=r(53732),NE=r.n(_E),IE=r(88214),DE=r.n(IE),PE=r(14294),kE=r.n(PE),LE=r(4501),FE=r.n(LE),jE=r(18538);const UE=(0,AE.Z)((()=>({container:e=>{let{height:t=36}=e;return{height:t,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 ME(){return ME=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ME.apply(this,arguments)}function VE(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){BE(e,t,r[t])}))}return e}function BE(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const zE=(0,b.memo)((e=>{let{value:t,autofocus:r,onSearch:n=SE.ZT,rootRef:a,classes:i={},height:o,placeholder:l=L().text("Search")}=e,s=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["value","autofocus","onSearch","rootRef","classes","height","placeholder"]);const c=UE({height:o}),[u,p]=(0,b.useState)(""),d=(0,_.pipe)((0,_.tap)(n),p),m=(0,_.isNil)(t)?u:t;return v().createElement(NE(),ME({startAdornment:v().createElement(DE(),{position:"start"},v().createElement(FE(),{className:c.icon})),endAdornment:v().createElement(DE(),{position:"end"},m.length>0&&v().createElement(jE.T,{icon:kE(),className:c.clearButton,onClick:()=>d("")})),autoFocus:r,classes:VE({},i,{input:O()(c.input,i.input),root:O()(c.container,i.root)}),placeholder:l,value:m,onChange:(0,_.pipe)(SE.NA,d),disableUnderline:!0,ref:a},s))}));function HE(){return HE=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},HE.apply(this,arguments)}const YE=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,y=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.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 f=RE({containerWidth:l,containerHeight:s}),g=v().createElement(v().Fragment,null,!a&&v().createElement("div",{className:f.header},t),!i&&v().createElement(zE,{onSearch:n,autofocus:!0,onKeyDown:c,inputRef:p,classes:{root:f.searchInputContainer},placeholder:L().text("Search & add attributes"),height:40}));return v().createElement(wE(),HE({anchorOrigin:d,transformOrigin:m},y),v().createElement("div",{className:O()(f.container,r),style:{width:l}},"top"===o&&g,v().createElement("div",{className:f.list},u),"bottom"===o&&g))},WE=e=>{const t=e=>(0,_.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})))};var GE=r(50166),qE=r(88267);const ZE=(0,AE.Z)({stickyTitlesWrapper:{position:"absolute",top:0,"& > div":{zIndex:1,position:"absolute",top:0,width:"100%",visibility:"hidden"}}}),$E=e=>e.titleItemIndex===e.index,KE=e=>{let{items:t,getItemSize:r,renderItem:n,renderGroupTitle:a,width:i="100%",height:o,fixedTitle:l=!0,itemKey:s=(e=>e),disableHorizontalScrollbar:c,hideSubtitles:u,focusIndex:p=null,onInnerContainerResize:d}=e;const m=ZE(),y=(0,b.useRef)(null),f=(0,b.useRef)(null),g=(0,b.useRef)(null),h=(0,b.useRef)([0]),E={topMargin:0},T=(0,b.useMemo)((()=>!u||(t||[]).some((e=>null!==e.titleItemIndex))),[t,u]),O=(0,b.useCallback)((e=>{const n=h.current.length;let a=0;t.slice(n-1,e+1).forEach(((e,t)=>{const i=n+t-1;t>0&&(h.current[i]=h.current[i-1]+a),a=r(i,e.item)}))}),[r,t]),x=(0,b.useCallback)((e=>t[e].titleItemIndex),[t]),S=(0,b.useCallback)((e=>t[e]),[t]);(0,b.useEffect)((()=>{requestAnimationFrame((()=>{y.current&&y.current.scrollTo(0)}))}),[t.length]),(0,b.useEffect)((()=>{y.current&&y.current.resetAfterIndex(0),C();const e=(e=>{const t=e.findIndex((e=>e.item.moveTo));if(t>-1){O(t);const e=x(t);return{offset:h.current[t],titleHeight:r(e,S(e).item)}}})(t);if(e&&e.offset&&y.current){const{titleHeight:t}=e,r=e.offset-t;(r<y.current.state.scrollOffset||r>y.current.state.scrollOffset+o)&&requestAnimationFrame((()=>{y.current&&y.current.scrollTo(r-(o-t)/2)}))}}),[O,S,r,x,o,h,t,y]);const C=()=>{g.current&&f.current&&(g.current.style.width=f.current.offsetWidth+"px")},w=(0,b.useCallback)((e=>{let r=null,n=0;return t.some(((t,a)=>{O(a+10);const i=h.current[a+1];return e>=n&&e<i&&(r={index:a,offset:n,listItem:t}),n=i,r})),r}),[O,h,t]),A=(0,b.useCallback)((e=>r(e,S(e).item)),[S,r]),R=(0,b.useCallback)((e=>{let{index:t,style:r,data:i}=e;const o=S(t);return o.item&&($E(o)&&a(r,o.item)||n(r,o.item,t,i))}),[S,a,n]),{handleOnItemsRendered:_}=(e=>{let{focusIndex:t,listRef:r,items:n}=e;const a=(0,b.useRef)(null),i=(0,b.useRef)(null),o=(0,b.useCallback)((e=>{let{visibleStartIndex:t,visibleStopIndex:r}=e;a.current=t,i.current=r}),[]);return(0,b.useEffect)((()=>{r.current&&null!==t&&0!==n.length&&(t<Math.max(a.current+3,0)?r.current.scrollToItem(Math.max(t-3,0),"start"):t>Math.min(i.current-3,n.length-1)&&r.current.scrollToItem(Math.min(t+3,n.length-1),"end"))}),[t,n.length,r]),{handleOnItemsRendered:o}})({items:t,focusIndex:p,listRef:y}),N=(0,b.useCallback)((()=>t.filter((e=>$E(e))).map((e=>(e=>v().createElement("div",{className:"stickyTitleItem",style:{visibility:"hidden"},"data-index":e.index,key:e.index},a({height:r(e.index,e.item)},e.item)))(e)))),[r,t,a]);return v().createElement(v().Fragment,null,v().createElement("div",{ref:g,className:m.stickyTitlesWrapper},l&&N()),d&&f.current&&v().createElement(qE.Z,{handleHeight:!0,onResize:d,targetDomEl:f.current}),v().createElement(GE.VariableSizeList,{ref:y,itemCount:t.length,itemSize:A,width:i,height:o,itemKey:s,innerRef:f,onScroll:e=>{let{scrollOffset:n,scrollDirection:a}=e;if(!l||!T)return;const i=w(n),o=i&&x(i.index);var s;null!==o&&(s=o,g.current&&[...g.current.querySelectorAll(".stickyTitleItem")].forEach((e=>{e.dataset.index===s.toString()?(e.style.visibility="visible",E.index=s):e.style.visibility="hidden"}))),C();const c=null!==o&&r(o,S(o).item),u=w(n+c+E.topMargin);let p=0;if(u){switch(a){case"forward":u.offset-n>0&&$E(u.listItem)&&(p=c-(u.offset-n));break;case"backward":{const e=o>-1&&(d=o,t.findIndex(((e,t)=>$E(e)&&d<t))),r=(e=>(O(e),h.current[e]))(e);e>-1&&n<r&&c>=r-n&&(p=c-(r-n))}}(e=>{g.current&&(E.topMargin=-e,g.current.style.top=-e+"px")})(p)}var d},style:c?{overflowX:"hidden"}:void 0,overscanCount:5,onItemsRendered:_},R))};KE.propTypes={items:OE().arrayOf(OE().object).isRequired,getItemSize:OE().func.isRequired,renderItem:OE().func.isRequired,width:OE().oneOfType([OE().number,OE().string]),height:OE().number.isRequired,renderGroupTitle:OE().func,fixedTitle:OE().bool,hideSubtitles:OE().bool,itemKey:OE().func,disableHorizontalScrollbar:OE().bool,focusIndex:OE().number,onInnerContainerResize:OE().func};const QE=KE,XE=e=>{let{items:t,open:r,onSelectFocusedItem:n,selectedItems:a,onClose:i}=e;const[o,l]=(0,b.useState)(null),s=(0,b.useRef)(!1),c=(0,b.useCallback)((e=>{let r=null===e?c(-1):e;for(;null!==e&&r<t.length&&(r<=e||r>=0&&$E(t[r]));)r+=1;return r!==t.length?r:c(-1)}),[t]),u=(0,b.useCallback)((e=>{let r=null===e?t.length-1:e;for(;null!==e&&r>=0&&(r>=e||$E(t[r]));)r-=1;return r<0?t.length-1:r}),[t]),p=(0,b.useCallback)((()=>{if(!(0,_.isNil)(o)){const e=t[o].item;!e.item.notSelectable&&n({item:e.item,groupData:e})}}),[n,t,o]),d=(0,b.useCallback)((e=>{if(0!==t.length)switch(e.key){case"Down":case"ArrowDown":return l(c),e.preventDefault(),!1;case"Up":case"ArrowUp":return l(u),e.preventDefault(),!1;case"Enter":s.current=!0,p();break;case"Tab":i&&i(e);break;default:return}}),[t,c,u,p,i]);return(0,b.useEffect)((()=>{if(s.current){s.current=!1;const e=t.findIndex((e=>e.item.moveTo));e>-1&&l(e)}else l(null)}),[t,r,a]),{focusIndex:o,handleKeyDown:d}};var JE=r(85746),eb=r.n(JE),tb=r(22811),rb=r.n(tb),nb=r(93222),ab=r.n(nb);function ib(){return ib=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ib.apply(this,arguments)}function ob(){return ob=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ob.apply(this,arguments)}const lb=e=>v().createElement("svg",ob({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),v().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 sb(){return sb=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},sb.apply(this,arguments)}const cb=e=>v().createElement("svg",sb({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),v().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 ub(){return ub=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ub.apply(this,arguments)}const pb=e=>v().createElement("svg",ub({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),v().createElement("rect",{fill:"#000",x:9,y:9,width:6,height:6,rx:1,stroke:"none",strokeWidth:1,fillRule:"evenodd"})),db=(0,AE.Z)({icon:{opacity:.29,width:"16px",height:"16px",flexShrink:0,marginRight:"6px",marginLeft:"8px"}}),mb=e=>{let{attrType:t={}}=e;const r=db(),n=(e=>{switch(e.type){case x.DataTypes.TYPE_IMAGE:case x.DataTypes.TYPE_NESTED:return lb;case x.DataTypes.TYPE_REFERENCE:return cb;default:return pb}})(t);return v().createElement(n,{className:r.icon})},yb=(0,AE.Z)({mark:{color:"red"}}),fb=()=>{const e=yb();return v().createElement("span",{className:e.mark},"*")},gb=e=>{let{margin:t,level:r,className:n,children:a}=e;return null!=r?v().createElement("div",{style:{marginLeft:r*t},className:n},a):a};var hb=r(1063),Eb=r(85740);const bb=(0,AE.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"}}),vb=(0,Eb.T)((e=>v().createElement("svg",ib({width:13,height:18,viewBox:"0 0 13 18",xmlns:"http://www.w3.org/2000/svg"},e),v().createElement("g",{transform:"translate(-3 -1)",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},v().createElement("path",{fill:"#FF4081",d:"M5.833 10h3.75v6.667l-3.75 1.666z"}),v().createElement("path",{fill:"#CE0C4E",d:"M13.333 10v8.333l-3.75-1.666V10z"}),v().createElement("circle",{fill:"#FFC058",cx:9.583,cy:7.917,r:6.25}),v().createElement("circle",{fill:"#FFCD7B",cx:9.583,cy:7.917,r:5.417}),v().createElement("path",{fill:"#FFFBB5",d:"M8.333 11.667L5 8.462l.933-.898 2.4 2.308L13.4 5l.933.897z"}))))),Tb=e=>{let{groupId:t,data:r,checked:n=!1,isFocused:a=!1,isRequired:i=!1,label:o,labelInText:l,level:s,onClick:c=SE.ZT,hideCheckBox:u=!1,hideIcon:p=!1,notSelectable:d=!1,disableHorizontalScrollbar:m=!1,style:y={},subItemMargin:f=20,LogoIcon:g,className:h,disableNonSelectable:E,disableGutters:b}=e;const T=bb(),{attrType:S}=r||{},C=!(u&&(0,x.isNested)(S)||d),w=!!g;return v().createElement(hb.Y,{value:l||o,className:T.itemTooltip,placement:"bottom-end"},v().createElement(ab(),{className:O()(T.container,T.listItem,{[T.defaultCursor]:!C},h),onClick:C?()=>c(r,!n,t):void 0,style:y,dense:!0,disabled:E&&d,classes:{focusVisible:T.listItemFocus,selected:T.listItemFocus},selected:a,tabIndex:-1,disableGutters:b},!u&&v().createElement(rb(),{checked:n,disableRipple:!0,disabled:!C,className:O()(T.checkbox,{[T.checked]:n}),tabIndex:-1}),v().createElement(gb,{margin:f,level:s,className:T.marginWrapper},v().createElement(v().Fragment,null,!p&&(e=>"recommended"===t?v().createElement(vb,{className:T.recommendedIcon,tooltipTitle:L().text("Recommended"),showForDisabled:!0}):v().createElement(mb,{attrType:e}))(S),v().createElement("div",{className:O()(T.itemTextWrapper,{[T.marginText]:p})},w&&v().createElement(g,{className:T.logoIcon}),v().createElement(eb(),{primary:v().createElement(v().Fragment,null,o,i&&v().createElement(fb,null)),className:T.itemText})))),C&&m&&v().createElement("div",{className:T.itemAfter})))};Tb.defaultName="AttributeListItem";const Ob=(0,b.memo)(Tb);var xb=r(49940);const Sb=(0,AE.Z)({popupContainer:{},container:{"&$popupContainer":{height:"408px",minWidth:"200px"}}});function Cb(){return Cb=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Cb.apply(this,arguments)}function wb(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ab(e,t,r[t])}))}return e}function Ab(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Rb=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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.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,b.useCallback)((e=>e.label.toLowerCase().includes(l.toLowerCase())),[l]),y=(0,b.useCallback)((e=>m(e)||(e.children||[]).some(y)),[m]),f=(0,b.useMemo)((()=>{const e=(0,_.curry)(((e,r,n,a)=>[{item:wb({},r,{filterText:l}),level:e,groupId:n,groupName:a},...t(r.children||[],n,a,e+1)])),t=function(t,r,n){let a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;const i=t=>e(a,t,r,n),o=t.filter(y);return(p?_.map:_.chain)(i,o)};return t}),[l,p,y]),g=(0,b.useCallback)((e=>e.map((e=>({item:e,items:f(e.attributes,e.id,e.label)}))).filter((e=>e.items.length))),[f]),h=(0,b.useCallback)((e=>{let{item:t}=e;s(t,!c.find((e=>e.id===t.id||e.id.includes(`${t.id}.`))))}),[s,c]),E=(0,b.useMemo)((()=>(p?g:f)(n)),[n,p,g,f]),T=(0,b.useMemo)((()=>WE(E)),[E]),{focusIndex:S,handleKeyDown:C}=XE({items:T,open:t,onSelectFocusedItem:h,selectedItems:c}),w=(0,b.useRef)(null);w.current=S;const A=(0,b.useCallback)(((e,t,r)=>{let{item:n,level:a=0}=t;const i=!!c.find((e=>e.id===n.id||e.id.includes(`${n.id}.`))),o=w.current===r;return v().createElement(Ob,{key:n.id,onClick:s,checked:i,level:a,data:n,label:v().createElement(xb.o,{text:n.label,highlight:n.filterText}),labelInText:n.label,style:e,hideCheckBox:u,isFocused:o,notSelectable:n.notSelectable,LogoIcon:n.LogoIcon})}),[u,s,c]),R=(0,x.getMaxItemWidth)("label")(E)||308,N=Sb();return v().createElement(YE,Cb({open:t,className:O()(N.container,N.popupContainer),anchorEl:r,onClose:i,onSearch:a,title:o,containerWidth:R,searchInputOnKeyDown:C},d),v().createElement(QE,{height:300,renderItem:A,items:T,hideSubtitles:!0,getItemSize:()=>32,containerWidth:R,focusIndex:S,renderGroupTitle:p}))};Rb.propTypes={open:OE().bool,hideCheckBox:OE().bool,anchorEl:OE().any,selected:OE().array,data:OE().array,filterText:OE().string,titleText:OE().string,onClose:OE().func,onListItemClick:OE().func,onSearch:OE().func,renderGroupTitle:OE().func},Rb.defaultProps={data:[],selected:[],titleText:L().text("Show/hide columns"),filterText:""};var _b=r(97179);function Nb(){return Nb=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Nb.apply(this,arguments)}const Ib=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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",Nb({width:"24",height:"24",viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},r),v().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd",opacity:".54"},v().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"})))},Db="Headers-styles-container--Zbdka",Pb="Headers-styles-actionsBar--RXMy4",kb="Headers-styles-previewSwitcher--Ppqem";function Lb(){return Lb=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Lb.apply(this,arguments)}const Fb=e=>{let{entityTypeUri:t,headColumns:r=[],onSelectColumns:n=SE.ZT}=e,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["entityTypeUri","headColumns","onSelectColumns"]);const[i,o]=(0,b.useState)(null),[l,s]=(0,b.useState)(""),c=(0,xE.useSelector)(Cr().selectors.getMetadata),u=()=>{o(null),s("")},p=(0,b.useCallback)(((e,a)=>{const i=((e,t)=>{const r=ru(e,t);return nu(r)})(Xc(c,t),e.id);let o;o=i.length?a?r.concat(i):r.filter((e=>!i.find((t=>t.id===e.id)))):a?r.concat(e):r.filter((t=>t.id!==e.id)),n(o)}),[c,t,r,n]);return v().createElement(v().Fragment,null,v().createElement(_b.k,Lb({tooltipTitle:L().text("Show/hide columns"),size:"M",icon:Ib,onClick:e=>o(e.currentTarget),className:"Headers-styles-headerIcon--c2qe7"},a)),(()=>{const e=Xc(c,t);return v().createElement(Rb,{open:!!i,anchorEl:i,data:e,onListItemClick:p,selected:r,filterText:l,onClose:u,onSearch:s})})())};Fb.propTypes={entityTypeUri:OE().string,headColumns:OE().array,onSelectColumns:OE().func};const jb=Fb;var Ub=r(45053),Mb=r(29722),Vb=r(27618),Bb=r.n(Vb),zb=r(98515),Hb=r.n(zb),Yb=r(29289);const Wb=e=>{let{headCellData:t,headIndex:r,sortOrder:n,sortField:a,sortHandler:i,canCheck:o,onCheck:l,headerCheckboxState:s,openConfigColumnPopup:c}=e;return v().createElement("div",{className:O()("HeadCellRenderer-styles-headCellContentWrapper--L6RrQ",(0,_.path)(["wrapperClassName"],t))},t&&o&&v().createElement(rb(),{className:"HeadCellRenderer-styles-checkbox--qQEHg",checked:s||!1,indeterminate:null===s,onChange:()=>l()}),v().createElement("div",{className:"HeadCellRenderer-styles-labelWrapper--cmclk"},t&&(t.sortable?v().createElement(Bb(),{active:Boolean(n&&a===t.id),direction:n,onClick:i,classes:{root:"HeadCellRenderer-styles-sortLabel--NZx3o"},component:"div"},t.label):t.label)),c&&v().createElement("div",{className:"HeadCellRenderer-styles-menuButtonWrapper--aBNeR"},v().createElement(jE.T,{icon:Hb(),onClick:c,size:"S","data-column-index":r})))};Wb.propTypes={headCellData:OE().shape({id:OE().string,label:OE().oneOfType([OE().string,OE().node]),sortable:OE().bool}),headIndex:OE().number,sortOrder:OE().string,sortField:OE().string,sortHandler:OE().func,canCheck:OE().bool,onCheck:OE().func,headerCheckboxState:OE().oneOf([!0,!1,null]),openConfigColumnPopup:OE().func};const Gb=(0,Yb.q)((0,_.pick)(["openConfigColumnPopup"]))(Wb),qb=(0,Yb.q)((0,_.pick)(["openConfigColumnPopup","canCheck","onCheck","headerCheckboxState"]))(Wb),Zb=v().createContext({generateEntityUrl:x.generateEntityUrlForOldMode,generatePivotingUrl:x.generatePivotingUrlForOldMode,generateTagUrl:x.generateTagUrlForOldMode});function $b(){return $b=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$b.apply(this,arguments)}Zb.displayName="UrlGeneratorsContext";const Kb=(0,b.forwardRef)(((e,t)=>{let{value:r,children:n,screen:a,className:i,shouldOpenInNewTab:o=!1}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["value","children","screen","className","shouldOpenInNewTab"]);const{generateEntityUrl:s}=(0,b.useContext)(Zb),c=(0,w.ax)("openEntity"),u=(0,w.Qh)(),p=(0,b.useCallback)((e=>{(0,SE.rR)(e)||(c({uri:r,screen:a}),e.preventDefault()),e.stopPropagation()}),[c,a,r]);return v().createElement("a",$b({ref:t,href:(d=r,s({uiPath:u,uri:d,screen:a})),onClick:o?void 0:p,target:o?"_blank":"_self",rel:"noreferrer",className:i},l),n);var d}));Kb.displayName="EntityUriLink";const Qb={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"},Xb=e=>{let{value:t={}}=e;const r=(0,x.getLabel)(t.label);return v().createElement("div",{className:O()(Qb.defaultWrapper,Qb.profileWrapper)},v().createElement(A,{avatarClassName:Qb.entityAvatar,imageClassName:Qb.entityAvatarImage,entity:t}),v().createElement(Kb,{value:(0,x.getEntityUriForLink)(t),className:Qb.entityLabel},r))};Xb.propTypes={value:OE().object};const Jb=Xb;var ev=r(56755);const tv=e=>{let{value:t,columnData:{dataTypeDefinition:r}}=e;return v().createElement("div",{className:Qb.defaultWrapper},r?v().createElement(ev.x,{value:t,dataTypeDefinition:r}):t)};tv.propTypes={value:OE().any,columnData:OE().object};const rv=tv,nv=(e,t,r)=>{const n=(0,x.getEntityTypeGraphIcon)(e,{type:t});return(0,x.getAbsoluteImageUrl)(r,n)};let av=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 iv(){return iv=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},iv.apply(this,arguments)}const ov=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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","icon","avatarText","rootClasses"]);const[o,l]=(0,b.useState)(null);(0,b.useEffect)((()=>{l(r?av.ICON_MODE:av.TEXT_MODE)}),[r,n]);const s=()=>{l(av.ERROR_MODE)};switch(o){case av.ICON_MODE:return v().createElement(C(),iv({className:O()(t,null==a?void 0:a.iconRoot),src:r,onError:s},i));case av.TEXT_MODE:case av.ERROR_MODE:return v().createElement(C(),iv({className:O()(t,null==a?void 0:a.textRoot)},i),n);default:return null}},lv=e=>{let{value:t}=e;const r=(0,xE.useSelector)(Cr().selectors.getMetadata),n=(0,xE.useSelector)(Cr().selectors.getApiPath),a=(0,xE.useSelector)(Cr().selectors.getImagePath);return t&&v().createElement("div",{className:O()(Qb.defaultWrapper,Qb.referenceWrapper)},v().createElement(ov,{className:Qb.referenceIcon,icon:nv(r,t.refEntity.type,a||n)}),v().createElement(Kb,{value:t.refEntity.objectURI,className:Qb.referenceContent},(0,x.getLabel)(t.label)))};lv.propTypes={value:OE().object};const sv=lv,cv=e=>{e.stopPropagation()},uv=e=>{const{value:t}=e;return v().createElement("div",{className:Qb.blobWrapper,onScroll:cv},t)};uv.propTypes={value:OE().any};const pv=uv,dv=e=>{let{value:t}=e;const r=(0,x.getImageAttributeOvThumbnailUrl)({value:t});return r&&v().createElement("div",{className:Qb.imageWrapper},v().createElement("img",{src:r}))};dv.propTypes={value:OE().object};const mv=dv,yv=e=>{if("label"===e.id)return Jb;switch((0,_.path)(["attrType","type"],e)){case"Reference":return sv;case"Blob":return pv;case"Image":return mv}return rv};function fv(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){gv(e,t,r[t])}))}return e}function gv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function hv(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}const Ev=(0,_.split)("."),bv=["entityId"],vv=e=>!bv.includes(e.id),Tv=e=>{if((0,x.isAttributeSearchUri)(e)){const[,...t]=Ev(e);return t.length>1?t.slice(0,-1):null}return null};var Ov=r(57526),xv=r.n(Ov),Sv=r(18567),Cv=r.n(Sv),wv=r(99272),Av=r.n(wv);const Rv=(0,AE.Z)({root:{display:"flex",alignItems:"center",justifyContent:"center",width:"24px",height:"24px"},check:{color:"#8CC152"}});let _v=function(e){return e[e.INIT=1]="INIT",e[e.PROGRESS=2]="PROGRESS",e[e.SUCCESS=3]="SUCCESS",e[e.DONE=4]="DONE",e}({});const Nv=e=>{let{classes:t={},tooltip:r="",onClick:n=SE.ZT,mode:a=_v.INIT}=e;const i=Rv();return v().createElement("div",{className:O()(i.root,t.root)},(()=>{switch(a){case _v.INIT:return v().createElement(_b.k,{className:t.button,size:"M",tooltipTitle:r,icon:Cv(),onClick:n});case _v.PROGRESS:return v().createElement(xv(),{className:t.spinner,size:24});case _v.SUCCESS:return v().createElement(Av(),{className:O()(i.check,t.check)});default:return null}})())};function Iv(){return Iv=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Iv.apply(this,arguments)}const Dv=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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["entity","importStatus","onImportStatusChange","hideDelay"]);const o=(0,xE.useSelector)(Cr().selectors.getDtssPath),l=(0,xE.useSelector)(Cr().selectors.getTenant);return v().createElement(Nv,Iv({},i,{mode:r,tooltip:L().text("Import this record"),onClick:e=>{e.stopPropagation(),n(_v.PROGRESS),(0,x.importEntityFromDataTenant)({dtssPath:o,customerTenant:l,entity:t}).then((e=>{let{success:r,uris:i}=e;if(!r)throw new Error("Failed to import entity");t.ctSubscribedUris=i,n(_v.SUCCESS),setTimeout((()=>n(_v.DONE)),a)})).catch((()=>{n(_v.INIT),(0,vp.U)(undefined,{title:L().text("Import Error"),message:L().text("Record can't be imported")})}))}}))};Dv.propTypes={entity:x.EntityType,importStatus:OE().oneOf((0,_.values)(_v)),onImportStatusChange:OE().func,hideDelay:OE().number};const Pv=Dv,kv=(0,AE.Z)({importButtonPlaceholder:{display:"flex",alignItems:"center",padding:"0 10px",width:"24px",flexShrink:0,position:"relative"}}),Lv=e=>{let{entity:t,entityImportStatus:r,onEntityImportStatusChange:n}=e;const a=kv(),i=(0,xE.useSelector)(Cr().selectors.getMetadata),o=(0,xE.useSelector)(Cr().selectors.getCanUserImportEntitiesFromDT),l=(0,x.isDataTenantEntity)(t)&&o,s=(0,x.getEntityType)(i,t.type),c=(0,x.checkCanImportEntityOfType)(s)&&!(0,x.isEntityImportedToCT)(t),u=r&&r!==_v.DONE||c;return v().createElement(v().Fragment,null,l&&v().createElement("div",{className:a.importButtonPlaceholder},u&&v().createElement(Pv,{entity:t,importStatus:r,onImportStatusChange:e=>n(t.uri,e)})))},Fv=e=>{let{entity:t,isSelectedEntity:r,isHighlightedEntity:n,entityImportStatus:a,onEntityImportStatusChange:i}=e;return v().createElement("div",{className:O()(Qb.entityButtons,{[Qb.selectedEntityButtons]:r,[Qb.justImportedEntityButtons]:a===_v.SUCCESS,[Qb.highlightedEntityButtons]:n})},v().createElement(Lv,{entity:t,entityImportStatus:a,onEntityImportStatusChange:i}))};Fv.propTypes={entity:OE().object,isSelectedEntity:OE().bool,isHighlightedEntity:OE().bool,entityImportStatus:OE().oneOf(Object.values(_v)),onEntityImportStatusChange:OE().func};const jv=(0,Yb.q)(((e,t)=>{let{entitiesImportStatus:r,onEntityImportStatusChange:n,selectedEntityUri:a,highlightedEntityIndex:i}=e,{entity:o,rowIndex:l}=t;return{entityImportStatus:o&&r[o.uri],onEntityImportStatusChange:n,isSelectedEntity:a===o.uri,isHighlightedEntity:i===l}}))(Fv);var Uv=r(72326),Mv=r(67655);function Vv(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Bv(e,t,r[t])}))}return e}function Bv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const zv={height:"100%",display:"flex",flexDirection:"column"},Hv=(0,AE.Z)((e=>({inactiveCell:Vv({background:e.inactiveBackground},zv,{"&$selectedRowCell":{background:e.inactiveSelectedBackground}}),selectedRowCell:Vv({background:(0,Mv.lighten)(e.palette.primary.main,.88)},zv),clickable:Vv({cursor:"pointer"},zv),justImported:Vv({backgroundColor:"#FFFBEB !important"},zv)}))),Yv={entity:OE().object,isSelected:OE().bool,onEntityClick:OE().func,isJustImported:OE().bool},Wv=(0,AE.Z)({checkboxWrapper:{display:"flex",alignItems:"center"},checkbox:{marginRight:"-8px",marginLeft:"11px"}});const Gv={onCheck:OE().func,isChecked:OE().bool,hasCheckbox:OE().bool},qv=(0,AE.Z)({collapser:{marginLeft:"-2px"}});var Zv=r(18021),$v=r(8835),Kv=r.n($v);const Qv=(0,AE.Z)({collapseButton:{cursor:"pointer"},expandLess:{transform:"rotate( -180deg )"}});function Xv(){return Xv=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Xv.apply(this,arguments)}const Jv=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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["isOpen","tooltipTitle"]);const a=Qv(),i={icon:Kv(),className:a.collapseButton,iconClassName:O()({[a.expandLess]:t})},o={tooltipTitle:r};return v().createElement(_b.k,Xv({"data-reltio-id":"collapse-button"},i,o,n))},eT=(0,AE.Z)((()=>({hidden:{visibility:"hidden"}}))),tT=e=>{let{rowIndex:t,rowValue:r,className:n}=e;const a=eT(),{toggleRowCollapse:i,getIsRowCollapsible:o,getIsRowCollapsed:l}=(0,b.useContext)(Zv.x),s=o(r),c=l(t);return v().createElement(Jv,{className:O()(n,{[a.hidden]:!s}),isOpen:!c,onClick:e=>{i(t),e.stopPropagation()}})};const rT={hasCollapseButton:OE().bool},nT=(0,_.pipe)((e=>{const t=t=>{const r=qv(),{hasCollapseButton:n}=t,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(t,["hasCollapseButton"]),{rowValue:i,rowIndex:o}=a;return n?v().createElement("div",{className:"cellWithCollapser"},v().createElement(tT,{className:r.collapser,rowIndex:o,rowValue:i}),v().createElement(e,a)):v().createElement(e,a)};return t.propTypes=rT,t}),(e=>{const t=t=>{const r=Wv(),{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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(t,["onCheck","isChecked","hasCheckbox"]),{rowValue:{rawValue:l}}=o;return i?v().createElement("div",{className:O()(r.checkboxWrapper,"cellWithCheckbox")},v().createElement(rb(),{className:r.checkbox,checked:a,onClick:e=>e.stopPropagation(),onChange:e=>n(l.uri,e.target.checked)}),v().createElement(e,o)):v().createElement(e,o)};return t.propTypes=Gv,t}),(e=>{const t=t=>{const r=Hv(),{rowValue:{rawValue:n},isSelected:a,onEntityClick:i,isJustImported:o}=t,l=i?()=>i(n.uri):void 0,s=n&&!(0,x.isActiveObject)(n);return l||s||a||o?v().createElement("div",{className:O()({[r.inactiveCell]:s},{inactiveCell:s},{[r.selectedRowCell]:a},{selectedRowCell:a},{[r.clickable]:!!l},{[r.justImported]:o},{justImported:o}),onClick:l},v().createElement(e,t)):v().createElement(e,t)};return t.propTypes=Yv,t}),(0,Yb.q)(((e,t)=>{let{onEntityClick:r,selectedEntityUri:n,entitiesImportStatus:a,canCheck:i,onCheck:o,checkedEntitiesUris:l}=e,{rowValue:s,columnIndex:c}=t;const{rawValue:u}=s,p=0===c;return{onCheck:o,isChecked:l&&l.includes(u.uri),hasCheckbox:i&&p,hasCollapseButton:p,isSelected:n===u.uri,isJustImported:a[u.uri]===_v.SUCCESS,onEntityClick:r}})))(Uv.DN),aT=e=>{let{columnData:t,cell:r}=e;const n=r.values.length,a=28*Math.max(n,1)+20;if(!n)return a;switch((0,_.path)(["dataTypeDefinition","type"],t)){case"Reference":return 28*n+17;case"Blob":return 100*n;case"Image":return 76*n+17;default:return a}},iT=(0,b.forwardRef)(((e,t)=>{let{headColumns:r,entities:n,entityToHighlight:a,selectedEntityUri:i,onReorderingColumn:o,dndColumnReorderingEnabled:l,columnsSize:s,onChangeColumnsSize:c,onScroll:u,onSort:p,sortField:d,sortOrder:m,onEntityHover:y,onEntityClick:f,entitiesImportStatus:g,onEntityImportStatusChange:h,logger:E,canCheck:T,checkedEntitiesUris:O,headerCheckboxState:S,onCheck:C,openConfigColumnPopup:w,resizeDebounceDelay:A}=e;const R=(0,b.useMemo)((()=>({highlightRow:"highlightedSelector",dragColumnHead:Qb.dragColumnHead,dragColumnBody:Qb.dragColumnBody,draggableHeadCell:Qb.draggableHeadCell,cellWrapper:Qb.cellWrapper})),[]),N=(0,xE.useSelector)(Cr().selectors.getMetadata),[I,D]=(0,b.useState)(null),P=(0,b.useCallback)((e=>{D(e),y&&y((0,_.path)([e,"uri"],n))}),[y,n]),k=(0,b.useRef)();(0,b.useImperativeHandle)(t,(()=>({resetScrollbarPosition:()=>{k.current&&k.current.resetScrollbarPosition({resetLeft:!1})}})));const L=(0,b.useCallback)((e=>{m&&e===d?m===Ub.oy?p({field:e,order:Ub.U9}):p({field:e}):p({field:e,order:Ub.oy})}),[p,d,m]),F=(0,b.useCallback)((e=>{const t=(0,_.prop)(e,n);return t?v().createElement(jv,{entity:t,rowIndex:e}):null}),[n]),j=(0,b.useCallback)((e=>v().createElement(nT,e)),[]),U=!!y,M=!!p,V=(0,b.useMemo)((()=>function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e.map(((e,r)=>{var n;let{attrType:a}=e,i=hv(e,["attrType"]);const o=0===r;return fv({},i,{dataTypeDefinition:a&&(0,x.getAttrDataTypeDefinition)(a),resizable:!0,autoResize:null!==(n=i.autoResize)&&void 0!==n?n:!o,draggable:!o,sortable:t&&vv(i),nestedPath:Tv(i.id),headCellRenderer:o?qb:Gb,rowCellValueRenderer:yv(fv({},i,{attrType:a}))})}))}(r,M)),[r,M]),B=(0,b.useMemo)((()=>((e,t,r)=>(r||[]).map((e=>(0,_.pipe)((0,_.reduce)(((t,r)=>(0,_.assoc)(r.id,((e,t,r)=>{switch(t.id){case"label":return r;case"entityId":return(0,x.getEntityId)(r);default:{const[e,...n]=Ev(t.id);return(0,_.pipe)((0,_.prop)(e),(0,x.getOvAttributeValuesByPath)(n))(r)}}})(0,r,e),t)),{}),(0,_.assoc)("rawValue",e))(t))))(0,r,n)),[N,r,n]),z=a?n.findIndex((0,_.propEq)("uri",a)):-1,H=(0,b.useMemo)((()=>({onEntityClick:f,selectedEntityUri:i,highlightedEntityIndex:z,entitiesImportStatus:g,onEntityImportStatusChange:h,canCheck:T,checkedEntitiesUris:O,headerCheckboxState:S,onCheck:C,openConfigColumnPopup:w})),[O,g,S,z,T,C,f,h,i,w]);return v().createElement(Mb.M,{fixFirstColumn:!0,onScroll:u,rowsData:B,columnsData:V,onSort:L,highlightRow:-1!==z?z:null,ref:k,sortFieldClassName:Qb.sortableCell,containerClassName:Qb.table,classes:R,defaultColumnWidth:250,headRowHeight:50,defaultColumnMinWidth:100,defaultRowHeight:48,sorting:{field:d,order:m},dndColumnReorderingHandler:o,dndColumnReorderingEnabled:l,onChangeColumnsSize:c,columnsSize:s,resizeDebounceDelay:null!=A?A:150,onRowHover:U?P:void 0,hoverStateEnabled:U,hoverRowIndex:I,renderRowOverlay:F,logger:E,context:H,maxRowValuesCount:2,renderRowCell:j,getRowCellHeight:aT})}));iT.propTypes={entities:OE().array,entityToHighlight:OE().string,selectedEntityUri:OE().string,headColumns:OE().array,columnsSize:OE().array,onScroll:OE().func,onSort:OE().func,onReorderingColumn:OE().func,onChangeColumnsSize:OE().func,dndColumnReorderingEnabled:OE().bool,onEntityClick:OE().func,onEntityHover:OE().func,sortField:OE().string,sortOrder:OE().oneOf([Ub.oy,Ub.U9]),entitiesImportStatus:OE().object,onEntityImportStatusChange:OE().func,logger:OE().func,canCheck:OE().bool,checkedEntitiesUris:OE().arrayOf(OE().string),headerCheckboxState:OE().oneOf([!0,!1,null]),onCheck:OE().func,openConfigColumnPopup:OE().func,resizeDebounceDelay:OE().number},iT.defaultProps={entities:[],headColumns:[]},iT.displayName="EntitiesTable";const oT=(0,b.memo)(iT);var lT=r(4437),sT=r.n(lT),cT=r(5106),uT=r.n(cT);const pT="left",dT="right",mT="hide",yT={[pT]:L().text("Insert 1 left"),[dT]:L().text("Insert 1 right"),[mT]:L().text("Hide column")},fT=e=>{let{open:t,anchorEl:r,onClick:n,onClose:a,actions:i}=e;return v().createElement(wE(),{open:t,anchorEl:r,onClose:a},v().createElement(sT(),{component:"div"},i.map(((e,t)=>((e,t,r)=>v().createElement(uT(),{button:!0,component:"div",key:r,onClick:t},v().createElement(eb(),{primary:yT[e],primaryTypographyProps:{variant:"body2"}})))(e,(e=>()=>{n(e)})(e),t)))))};fT.propTypes={open:OE().bool,anchorEl:OE().any,onClick:OE().func,onClose:OE().func,actions:OE().array};const gT=fT;class hT extends v().PureComponent{constructor(){super(...arguments),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=e=>{let{newColumnPlaceIndex:t}=e;this.setState({newColumnPlaceIndex:t,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 pT:this.openAddColumnPopup({newColumnPlaceIndex:t});break;case dT:this.openAddColumnPopup({newColumnPlaceIndex:t+1});break;case mT: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,x.memoizeWith)(hT.getMemoIdForColumnSize,hT.getColumnSizeFromHeadColumns)}static getColumnSizeFromHeadColumns(e){return e.map((e=>({id:e.id,size:e.size})))}static getMemoIdForColumnSize(e,t){return`${t}${(0,_.toString)(e.map((e=>(0,_.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:y,onChangeColumnsSize:f,entityTypeUri:g,entitiesImportStatus:h={},onEntityImportStatusChange:E,logger:b,canCheck:T,checkedEntitiesUris:O,headerCheckboxState:x,onCheck:S,resizeDebounceDelay:C}=this.props,{addColumnPopupOpen:w,configColumnPopupOpen:A,popupAnchor:R,filterText:_,configurableColumnIndex:N}=this.state,I=this.memoizedGetColumnSize(a,g);return v().createElement(v().Fragment,null,v().createElement(oT,{entities:e,entityToHighlight:t,selectedEntityUri:r,onScroll:n,onSort:y,onEntityClick:s,onEntityHover:c,headColumns:a,sortField:i,sortOrder:o,onReorderingColumn:m,ref:u,onChangeColumnsList:d,dndColumnReorderingEnabled:l,onChangeColumnsSize:f,columnsSize:I,entitiesImportStatus:h,onEntityImportStatusChange:E,logger:b,canCheck:T,checkedEntitiesUris:O,headerCheckboxState:x,onCheck:S,openConfigColumnPopup:this.openConfigColumnPopup,resizeDebounceDelay:C}),v().createElement(Rb,{open:w,anchorEl:R,data:p,onListItemClick:this.addColumnHandler,filterText:_,onClose:this.closeAddColumnPopup,onSearch:this.setFilterText,hideCheckBox:!0,titleText:k.text("Add column")}),v().createElement(gT,{onClick:this.configColumnHandler,onClose:this.closeConfigColumnPopup,anchorEl:R,open:A,actions:N>0?[pT,dT,mT]:[dT]}))}}hT.propTypes={entities:OE().array,entityToHighlight:OE().string,selectedEntityUri:OE().string,entityTypeUri:OE().string,headColumns:OE().array,dndColumnReorderingEnabled:OE().bool,onScroll:OE().func,onSort:OE().func,onReorderingColumn:OE().func,onChangeColumnsSize:OE().func,onChangeColumnsList:OE().func,onEntityClick:OE().func,onEntityHover:OE().func,sortField:OE().string,sortOrder:OE().oneOf([Ub.oy,Ub.U9]),entitiesTableRef:OE().shape({current:OE().shape({resetScrollbarPosition:OE().func})}),additionalColumns:OE().arrayOf(OE().shape({id:OE().string,label:OE().string})),entitiesImportStatus:OE().object,onEntityImportStatusChange:OE().func,logger:OE().func,canCheck:OE().bool,checkedEntitiesUris:OE().arrayOf(OE().string),headerCheckboxState:OE().oneOf([!0,!1,null]),onCheck:OE().func};const ET=hT;var bT=r(66780),vT=r(9366),TT=r(41633),OT=r(79881),xT=r.n(OT),ST=r(93962),CT=r.n(ST),wT=r(45995),AT=r.n(wT);function RT(){return RT=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},RT.apply(this,arguments)}const _T=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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["open","children"]);const[a,i]=(0,b.useState)(t),o=(0,Mv.useTheme)().transitions.duration.leavingScreen;return(0,b.useEffect)((()=>{if(t!==a){if(!t){const e=setTimeout((()=>{i(!1)}),o);return()=>clearTimeout(e)}i(!0)}}),[t,o,a]),v().createElement(AT(),RT({open:t},n),a&&r)};_T.displayName="Drawer";var NT=r(418),IT=r(18759),DT=r.n(IT),PT=r(30122),kT=r.n(PT),LT=r(43410),FT=r.n(LT),jT=r(93416),UT=r.n(jT);function MT(){return MT=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},MT.apply(this,arguments)}const VT=(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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(r,["dispatch"]);return v().createElement(e,MT({config:t,onChange:(i=t.fieldName,e=>{n(Yc(i,e))}),onClose:t.showDeleteButton?(e=>()=>{n(qc({fieldNamesToDelete:[e]}))})(t.fieldName):()=>{},onSearch:(e=>t=>{let{value:r,pageNumber:a,currentOptions:i}=t;n((e=>{let{facetFieldName:t,value:r,debounceTime:n=0,pageNumber:a=1,currentOptions:i}=e;return{type:wr.FILTER_FACET_DATA,payload:{facetFieldName:t,value:r,debounceTime:n,pageNumber:a,currentOptions:i}}})({facetFieldName:e,value:r,debounceTime:250,pageNumber:a,currentOptions:i}))})(t.fieldName)},a));var i};return r.propTypes={dispatch:OE().func,isRecommended:OE().bool},r};var BT=r(52004),zT=r.n(BT),HT=r(58282),YT=r.n(HT);const WT=(0,AE.Z)((()=>({viewMoreLessLink:{display:"flex",alignItems:"center",cursor:"pointer"},arrow:{marginRight:"8px",marginLeft:"-2px",transform:"rotate(0deg)",transition:"transform 0.35s ease"},rotated:{transform:"rotate(-180deg)"}}))),GT=e=>{let{active:t,onClick:r,className:n}=e;const a=WT();return v().createElement(zT(),{className:O()(a.viewMoreLessLink,n),onClick:r,underline:"none"},v().createElement(YT(),{className:O()(a.arrow,{[a.rotated]:t})}),t?L().text("View less"):L().text("View more"))};GT.propTypes={active:OE().bool,onClick:OE().func,className:OE().string};const qT=GT;var ZT=r(50592),$T=r(23888),KT=r.n($T);const QT=(0,AE.Z)((e=>({bar:{backgroundColor:e.palette.secondary.main,opacity:.12,position:"absolute",minHeight:"20px",minWidth:"5px",borderRadius:"2px",top:0,left:0,height:"100%"}}))),XT=e=>(0,_.is)(Number,e),JT=e=>{let{className:t,width:r=0,maxWidth:n}=e;const a=QT(),i=(0,b.useCallback)((e=>(n?100*e/n:0)+"%"),[n]);return r?v().createElement("div",{className:O()(a.bar,t),style:{width:XT(r)?i(r):r}}):null},eO=(0,AE.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 tO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const rO={showColorBar:!0,hasOnlyButton:!1},nO=e=>{let{config:t,data:r=[],values:n=[],onChange:a=Js}=e;const i=eO();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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){tO(e,t,r[t])}))}return e}({},rO,t);const o=e=>()=>{const t=n.includes(e)?n.filter((t=>t!==e)):n.concat(e);a(t)},l=Math.max(...r.map((e=>e.number)));return v().createElement("div",{className:i.listContainer},r.map((e=>v().createElement("div",{key:e.value,className:O()(i.item,{[i.disabled]:!e.number&&!n.includes(e.value)}),"data-reltio-id":"search-facets-list-row"},(e=>v().createElement(rb(),{className:O()(i.checkbox,{[i.checked]:n.includes(e.value)}),checked:n.includes(e.value),onChange:o(e.value),value:e.value,color:"primary"}))(e),v().createElement("div",{className:i.info,onClick:o(e.value)},(e=>v().createElement(JT,{className:O()({[i.checkedBar]:n.includes(e.value)}),width:e.number,maxWidth:l}))(e),v().createElement("div",{className:O()(i.textInfo)},v().createElement("div",{className:i.text},e.label),v().createElement("div",{className:i.count},void 0===e.number?L().text("N/A"):Qs(e.number,5e3))),t.hasOnlyButton&&(e=>{return v().createElement(KT(),{className:i.buttonONLY,onClick:(t=e.value,e=>{e.stopPropagation(),a([t])})},L().text("ONLY"));var t})(e))))))},aO=(0,AE.Z)((()=>({container:{overflow:"hidden",display:"flex",flexGrow:1,flexDirection:"column",fontSize:"13px"},noData:{marginLeft:"16px"},viewMoreLess:{paddingLeft:"20px"}}))),iO=e=>{let{config:t,data:r=[],values:n=[],onChange:a}=e;const i=aO(),o=(0,xE.useDispatch)(),l=(0,b.useCallback)((e=>{let{show:t}=e;o((e=>{let{show:t,silent:r}=e;return{type:wr.SHOW_MORE_ENTITY_TYPES,payload:{show:t,silent:r}}})({show:t}))}),[o]),s=(0,xE.useSelector)((e=>gr(t,e))),c=(0,xE.useSelector)(sp),u=r.length>7,p=(0,b.useCallback)((()=>{l({show:!s})}),[l,s]),d=(0,b.useMemo)((()=>{const e=s?r:r.slice(0,7);return Ga(e,c)}),[r,s,c]);return v().createElement("div",{className:i.container},r.length>0?v().createElement(v().Fragment,null,v().createElement(nO,{data:d,values:n,onChange:a,config:t}),u&&v().createElement(qT,{active:s,onClick:p,className:i.viewMoreLess})):v().createElement(ZT.K,{variant:"noData",className:i.noData}))};var oO=r(70347),lO=r(52935);const sO=(0,lO.Z)(oO.ZP);var cO=r(81697),uO=r(27308);const pO=(0,lO.Z)(uO.ZP);function dO(){return dO=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dO.apply(this,arguments)}function mO(e){const{innerProps:t,innerRef:r,children:n,isFocused:a,isSelected:i,selectProps:{classes:o},label:l}=e;return v().createElement(ab(),dO({className:O()(o.option,{[o["option--selected"]]:i}),ref:r,selected:a,component:"div"},t),v().createElement(rb(),{color:"primary",checked:i}),v().createElement(hb.Y,{value:l},v().createElement("div",{className:o["option--item"]},n)))}mO.propTypes={children:OE().node,innerProps:OE().shape({id:OE().string.isRequired,key:OE().string,onClick:OE().func.isRequired,onMouseMove:OE().func.isRequired,onMouseOver:OE().func.isRequired,tabIndex:OE().number.isRequired}).isRequired,innerRef:OE().oneOfType([OE().oneOf([null]),OE().func,OE().shape({current:OE().any.isRequired})]),isFocused:OE().bool.isRequired,isSelected:OE().bool.isRequired,label:OE().string,selectProps:OE().shape({classes:OE().shape({option:OE().string})})};const yO={Option:mO};var fO=r(62127);const gO=e=>{let t=null==e?void 0:e.parentElement;for(;t;){if(t.scrollHeight>t.clientHeight)return t;t=t.parentElement}return null},hO=(e,t,r,n)=>e&&t<e&&n.getBoundingClientRect().bottom>r.getBoundingClientRect().bottom;function EO(){return EO=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},EO.apply(this,arguments)}function bO(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){vO(e,t,r[t])}))}return e}function vO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const TO=(0,AE.Z)((e=>({label:{top:6,left:16},placeholder:e=>({display:!e.placeholder||e.label?"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)}})));let OO=0;function xO(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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["label","creatable","getOptions","loadingIndicator","components","classes","styles","onChange","onInputChange","menuPlacement"]),d=r?sO:n?pO:cO.Z,[m,y]=(0,b.useState)(""),f=TO((0,_.omit)(["classes"],e)),g="custom-select-"+OO++,h=(0,b.useRef)();!function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;const r=(0,fO.D)(null==e?void 0:e.length);(0,b.useEffect)((()=>{const n=setTimeout((()=>{const n=gO(null==t?void 0:t.current);var a;n&&hO(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,_.either)((0,_.path)(["select","controlRef"]),(0,_.path)(["select","select","controlRef"]))(e.current)),t})(h));const E=bO({},yO,i),T=(0,SE.ze)(f,o),O=bO({indicatorSeparator:e=>bO({},e,{margin:"10px 0"}),loadingIndicator:e=>bO({},e,{display:a?e.display:"none"}),loadingMessage:e=>bO({},e,{fontFamily:'"Roboto", "Helvetica", "Arial", sans-serif'})},l),x=t?{inputId:g,TextFieldProps:bO({label:t,InputLabelProps:{htmlFor:g,shrink:!(!e.value||!e.value.length)||void 0,className:T.label}},e.TextFieldProps)}:{};return v().createElement(d,EO({isMulti:!0,inputId:g,inputValue:m,onChange:function(e,t){s(e,t),"create-option"===t.action&&(y(""),c("",{action:"input-change"}))},onInputChange:function(e,t){let{action:r}=t;c(e,{action:r}),"set-value"!==r&&y(e)},closeMenuOnSelect:!1,hideSelectedOptions:!1,classes:T,components:E,styles:O,menuPlacement:u,loadOptions:n,innerRef:h},x,p))}xO.defaultProps={creatable:!1,cacheOptions:!0,components:{},classes:{},placeholder:"",loadingIndicator:!1,onInputChange:()=>{},onChange:()=>{}},xO.propTypes={creatable:OE().bool,cacheOptions:OE().bool,defaultOptions:OE().bool,value:OE().arrayOf(OE().shape({label:OE().string.isRequired,value:OE().any})),options:OE().arrayOf(OE().shape({label:OE().string.isRequired,value:OE().any})),onChange:OE().func,onInputChange:OE().func,placeholder:OE().string,label:OE().string,loadingIndicator:OE().bool,components:OE().shape({ClearIndicator:OE().func,Control:OE().func,DropdownIndicator:OE().func,DownChevron:OE().func,CrossIcon:OE().func,Group:OE().func,GroupHeading:OE().func,IndicatorsContainer:OE().func,IndicatorSeparator:OE().func,Input:OE().func,LoadingIndicator:OE().func,Menu:OE().func,MenuList:OE().func,MenuPortal:OE().func,LoadingMessage:OE().func,NoOptionsMessage:OE().func,MultiValue:OE().func,MultiValueContainer:OE().func,MultiValueLabel:OE().func,MultiValueRemove:OE().func,Option:OE().func,Placeholder:OE().func,SelectContainer:OE().func,SingleValue:OE().func,ValueContainer:OE().func}),classes:OE().shape({control:OE().string,valueContainer:OE().string,multiValue:OE().string,noOptionsMessage:OE().string,singleValue:OE().string,placeholder:OE().string,menu:OE().string,clearIndicator:OE().string,dropdownIndicator:OE().string,option:OE().string,"option--selected":OE().string,label:OE().string}),styles:OE().shape({clearIndicator:OE().func,container:OE().func,control:OE().func,dropdownIndicator:OE().func,group:OE().func,groupHeading:OE().func,indicatorsContainer:OE().func,indicatorSeparator:OE().func,input:OE().func,loadingIndicator:OE().func,loadingMessage:OE().func,menu:OE().func,menuList:OE().func,menuPortal:OE().func,multiValue:OE().func,multiValueLabel:OE().func,multiValueRemove:OE().func,noOptionsMessage:OE().func,option:OE().func,placeholder:OE().func,singleValue:OE().func,valueContainer:OE().func}),TextFieldProps:OE().object,getOptions:OE().func,menuPlacement:OE().string,menuPortalTarget:OE().object,menuShouldBlockScroll:OE().bool,captureMenuScroll:OE().bool,getOptionValue:OE().func,isSearchable:OE().bool,inputRef:OE().shape({current:OE().object})};const SO=xO;var CO=r(80959),wO=r(88640),AO=r(25386),RO=r(59428),_O=r(47823);const NO=(0,AE.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 IO(){return IO=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},IO.apply(this,arguments)}const DO=e=>{const{innerProps:t,innerRef:r,data:n,isSelected:a,isFocused:i,selectProps:{classes:o}}=e,l=NO(),s=(0,_.has)("width",n),c=(0,_.has)("number",n);return v().createElement(ab(),IO({className:o.option,classes:{root:l.item,selected:l.itemSelected},ref:r,component:"div",selected:i,disableGutters:!0},t),v().createElement(rb(),{checked:a,color:"primary",disableRipple:!0,classes:{root:l.checkbox}}),v().createElement("div",{className:l.infobox},v().createElement("div",{className:l.textbox},v().createElement(hb.Y,{value:n.label},v().createElement("div",{className:l.text},n.label)),c&&v().createElement("div",{className:l.number},Qs(n.number,5e3))),s&&v().createElement(JT,{className:O()(l.colorBar,{[l.selectedColorBar]:a}),width:n.width})))};DO.propTypes={innerProps:OE().shape({id:OE().string.isRequired,key:OE().string,onClick:OE().func.isRequired,onMouseMove:OE().func.isRequired,onMouseOver:OE().func.isRequired,tabIndex:OE().number.isRequired}).isRequired,innerRef:OE().oneOfType([OE().oneOf([null]),OE().func,OE().shape({current:OE().any.isRequired})]),isSelected:OE().bool.isRequired,isFocused:OE().bool.isRequired,selectProps:OE().shape({classes:OE().shape({option:OE().string})}),data:OE().shape({value:OE().string,label:OE().string.isRequired,number:OE().number}).isRequired};const PO=DO,kO=e=>{const{selectProps:{classes:t}}=e;return v().createElement(ZT.K,{variant:"noData",className:t.noOptionsMessage})};kO.propTypes={selectProps:OE().object.isRequired};const LO=kO;function FO(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){jO(e,t,r[t])}))}return e}function jO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const UO={container:e=>FO({},e,{width:"100%"}),menuList:e=>FO({},e,{maxHeight:"240px",padding:"8px 0"}),menu:e=>FO({},e,{maxHeight:"240px"})},MO=(0,AE.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)"}})));var VO=r(53862);const BO=OE().shape({value:OE().string.isRequired,label:OE().string.isRequired,number:OE().number}),zO=(OE().shape({default:OE().array,filtered:OE().array}),OE().shape({values:OE().array,searchType:OE().oneOf(Object.values(x.MAP_SEARCH_TYPES))})),HO={id:OE().string,operation:OE().string,operationParameters:OE().shape({attributeTypeData:OE().shape({pathToTitle:OE().arrayOf(OE().string),title:OE().string,attributeType:x.AttributeTypeType}),attributeValue:OE().oneOfType([OE().string,x.LookupValueType,x.NestedAttributeValueType,x.ReferenceAttributeValueType]),attributeValueToFind:OE().oneOfType([OE().string,x.LookupValueType]),pin:OE().bool,addNestedAttribute:OE().bool})},YO={id:OE().string,fieldName:OE().string,conditions:OE().arrayOf(VO.Xw),actions:OE().arrayOf(OE().shape(HO))};function WO(){return WO=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},WO.apply(this,arguments)}function GO(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const qO=e=>{let{values:t=[],defaultOptions:r=[],filteredOptions:n,onChange:a=_.identity,getSuggestions:i,showBar:o=!0,showNumberInValue:l=!1,classes:s={},styles:c={},canLoadMore:u=!0,max:p=Y}=e,d=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["values","defaultOptions","filteredOptions","onChange","getSuggestions","showBar","showNumberInValue","classes","styles","canLoadMore","max"]);const m=MO(),[y,f]=(0,b.useState)(""),[g,h]=(0,b.useState)(1),[E,T]=(0,b.useState)(!1),O=(0,b.useRef)(null),S=(0,b.useRef)(!1),C=(0,b.useRef)(!1),w=(n||[]).concat(r),A=e=>w.find((t=>t.value===e))||{value:e,label:e},R=e=>l&&(0,_.has)("number",e)?(0,_.assoc)("formattedNumber",(0,x.formatNumberAsMetric)((0,_.prop)("number",e),5e3),e):e,N=(0,_.pipe)((e=>{if(o&&e.length&&(0,_.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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){GO(e,t,r[t])}))}return e}({},e,{width:I(e.number,t)})))}return e}),(0,_.uniqBy)((0,_.prop)("value"))),I=(e,t)=>(t?100*e/t:0)+"%",D=(0,x.debounce)(((e,t)=>{let{action:r}=t;e!==y&&"set-value"!==r&&(f(e),h(1),S.current=!1,T(!0),i({value:e,pageNumber:1}))}),250),P=n||r,k=(0,b.useCallback)((()=>{T(!0),i({value:y,pageNumber:g+1,currentOptions:P}),S.current=!0}),[y,g,i,P]);(0,b.useEffect)((()=>{T(!1),S.current&&(h((e=>e+1)),S.current=!1)}),[n]),(0,b.useEffect)((()=>{C.current||(T(!1),h(1),S.current=!1,i({value:"",pageNumber:1})),C.current=!1}),[r]);const L=(0,b.useMemo)((()=>P.slice(0,g*p)),[P,g,p]),F=u&&P.length>L.length;return v().createElement(SO,WO({filterOption:(e,t)=>{let{label:r,value:n}=e;return x.utils.strings.search(r,t)||x.utils.strings.search(n,t)},value:(e=>(0,x.wrapInArrayIfNeeded)(e).map(A).map(R))(t),onChange:(0,_.pipe)((0,_.tap)((()=>{C.current=!0})),(0,_.defaultTo)([]),(0,_.pluck)("value"),a),options:N(L),onInputChange:D,classes:(0,_.mergeRight)(m,s),styles:(0,_.mergeRight)(UO,c),TextFieldProps:{InputProps:{disableUnderline:!0},ref:O},inputRef:O,components:{Option:PO,NoOptionsMessage:LO,Menu:CO.h,DropdownIndicator:wO.K,MultiValue:AO._,MenuList:RO.d},menuPlacement:"bottom",menuListFooter:F&&v().createElement(_O.X,{loading:E,onClick:k})},d))};qO.propTypes={values:OE().array,defaultOptions:OE().arrayOf(BO),filteredOptions:OE().arrayOf(BO),onChange:OE().func.isRequired,getSuggestions:OE().func.isRequired,showBar:OE().bool,showNumberInValue:OE().bool,classes:OE().object,styles:OE().object,canLoadMore:OE().bool,max:OE().number};const ZO=(0,b.memo)(qO);var $O=r(43627),KO=r.n($O);function QO(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=n.concat(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 in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const JO=(0,_.range)(2,10).reduce(((e,t)=>QO({},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)"}}})),{}),ex=(0,AE.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":QO({fontSize:"10px",lineHeight:"11px",fontWeight:500,color:"rgba(255, 255, 255, 0.7)",marginTop:"4px"},JO,{"&:last-child":{color:"white"}}),"& li + li":{marginTop:"2px"}}}})));function tx(){return tx=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},tx.apply(this,arguments)}const rx=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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["pathToTitle","children"]);const a=ex(),i=null!=t&&t.length?v().createElement("div",{className:a.tooltipContent},v().createElement("p",null,(0,_.last)(t)),t.length>2&&v().createElement("ul",null,t.map((e=>v().createElement("li",{key:e},e))))):"";return v().createElement(KO(),tx({title:i,disableFocusListener:!0,classes:{tooltip:a.tooltip}},n),r)};var nx=r(96091),ax=r.n(nx),ix=r(35635),ox=r.n(ix);const lx=(0,AE.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 sx(){return sx=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},sx.apply(this,arguments)}const cx=(0,Eb.T)(ox()),ux=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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["label","onDelete"]);const a=lx();return v().createElement(ax(),sx({className:a.root,label:L().number(t),onDelete:r,variant:"outlined",classes:{root:a.root,outlined:a.outlined,deleteIcon:a.deleteIcon,label:a.label},deleteIcon:v().createElement(cx,{tooltipTitle:L().text("Clear")})},n))},px=(0,AE.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 dx(){return dx=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dx.apply(this,arguments)}const mx=e=>{let{title:t="",chipLabel:r=0,onDelete:n,pathToTitle:a,onClick:i}=e;const o=px(),l=Boolean(a&&a.length>2),s=l?rx:hb.Y,c=l?{pathToTitle:a}:{value:t};return v().createElement("div",{className:o.container,onClick:i},l&&v().createElement(rx,dx({placement:"bottom-start"},c),v().createElement("div",{className:o.parent},a[a.length-2])),v().createElement("div",{className:o.titleContainer},v().createElement(s,dx({placement:"bottom-start"},c),v().createElement("span",{className:o.title},t)),0!==r&&v().createElement("div",{className:o.chip},v().createElement(ux,{label:r,onDelete:n}))))};function yx(){return yx=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yx.apply(this,arguments)}const fx=(0,AE.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}}))),gx=(0,Eb.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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",yx({width:"13",height:"18",viewBox:"0 0 13 18",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},r),v().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},v().createElement("g",null,v().createElement("g",null,v().createElement("g",null,v().createElement("g",{transform:"translate(-3 -1)"},v().createElement("g",null,v().createElement("path",{fill:"#FF4081",d:"M5.833 10h3.75v6.667l-3.75 1.666z"}),v().createElement("path",{fill:"#CE0C4E",d:"M13.333 10v8.333l-3.75-1.666V10z"})),v().createElement("circle",{fill:"#FFC058",cx:"9.583",cy:"7.917",r:"6.25"}),v().createElement("circle",{fill:"#FFCD7B",cx:"9.583",cy:"7.917",r:"5.417"}),v().createElement("path",{fill:"#FFFBB5",d:"M8.333 11.667L5 8.462l.933-.898 2.4 2.308L13.4 5l.933.897z"})))))))})),hx=e=>{let{title:t,chipLabel:r,onDeleteChip:n,pathToTitle:a,onClose:i,children:o,isOpenByDefault:l=!0,isHighlighted:s=!1,isRecommended:c=!1}=e;const u=fx(),[p,d]=(0,b.useState)(l),m=()=>{d(!p)};return v().createElement("div",{className:O()(u.facetContainer,{[u.openedFacetContainer]:p,[u.closedFacetContainer]:!p,[u.highlighted]:s}),"data-reltio-id":`search-facet-container-${t}`},v().createElement("div",{className:u.titleContainer},v().createElement(_b.k,{tooltipTitle:L().text("Remove"),icon:kE(),onClick:i,className:u.iconButton,size:"XXS"}),c&&v().createElement(gx,{className:u.recommendedIcon,tooltipTitle:L().text("Recommended"),showForDisabled:!0}),v().createElement(mx,{title:t,pathToTitle:a,chipLabel:r,onDelete:n,onClick:m}),v().createElement(Jv,{onClick:m,isOpen:p,className:u.iconButton,size:"S",tooltipTitle:p?L().text("Collapse attribute"):L().text("Expand attribute"),tooltipPlacement:"bottom-end"})),p?o:null)},Ex=(0,AE.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"}}))),bx=e=>{let{config:t,data:r=[],filteredData:n,values:a=[],isHighlighted:i,isRecommended:o,onSearch:l=_.identity,onChange:s,onClose:c}=e;const u=Ex();return v().createElement(hx,{title:t.title,pathToTitle:t.pathToTitle,onClose:c,chipLabel:a.length,onDeleteChip:()=>s([]),isHighlighted:i,isRecommended:o},v().createElement(ZO,{values:a,defaultOptions:r,filteredOptions:n,onChange:s,getSuggestions:l,isClearable:!1,showBar:!1,showNumberInValue:!0,classes:u,placeholder:L().text("All values"),canLoadMore:!cc(t)}))};var vx=r(19014),Tx=r(15608),Ox=r.n(Tx);const xx=(0,AE.Z)((e=>({root:{borderRadius:4,padding:"15px 0"},rail:{backgroundColor:(0,Mv.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,Mv.alpha)(e.palette.primary.main,.12)}`,"@media (hover: none)":{boxShadow:"none"}},"&$active":{boxShadow:`0px 0px 0px 9px ${(0,Mv.alpha)(e.palette.primary.main,.12)}`},"&::after":{left:-10,top:-10,right:-10,bottom:-10}},focusVisible:{},active:{},track:{borderRadius:4}}))),Sx=(0,AE.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"}}))),Cx=e=>{let{children:t,open:r,value:n}=e;const a=Sx();return v().createElement(KO(),{open:r,enterTouchDelay:0,placement:"top",title:n,classes:{tooltipPlacementTop:a.tooltipPlacementTop,tooltip:a.tooltip}},t)};function wx(){return wx=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},wx.apply(this,arguments)}Cx.propTypes={children:OE().element.isRequired,open:OE().bool.isRequired,value:OE().string.isRequired};const Ax=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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["min","max","range","onChange","onAfterChange","className"]);const s=xx();return v().createElement("div",{className:o},v().createElement(Ox(),wx({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:Cx},size:"small",component:"div"},l)))};Ax.propTypes={min:OE().oneOfType([OE().number,OE().string]).isRequired,max:OE().oneOfType([OE().number,OE().string]).isRequired,range:OE().array.isRequired,onChange:OE().func,onAfterChange:OE().func,className:OE().string};const Rx=Ax;var _x=r(18205),Nx=r(19406),Ix=r(55484),Dx=r(25556),Px=r(3131),kx=r(27741),Lx=r(42400),Fx=r(11011);const jx=(0,AE.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"}}))),Ux=e=>{let{payload:t,formatter:r,active:n}=e;const a=jx();if(n){const{payload:{label:e},value:n}=t[0];return v().createElement("div",{className:a.tooltip},v().createElement("div",{className:a.number},r(n)),v().createElement("div",{className:a.value},e))}return null},Mx=(0,AE.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 Vx(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Bx=e=>{let{data:t=[],range:r=[],domain:n,color:a=x.theme.palette.primary.main,tickFormatterX:i,tickFormatterY:o}=e;const l=Mx(),[s,c]=(0,b.useState)(null),u=(e,t)=>(s===t?.2:0)+((e=>{let{value:t}=e;return t[0]>=r[0]&&t[1]<=r[1]})(e)?.6:.2),p=t.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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Vx(e,t,r[t])}))}return e}({},e,{value:t<r.length-1?e.value[0]:e.value[1]}))),d=e=>{e.isTooltipActive?c(e.activeTooltipIndex):c(null)};return v().createElement(_x.h,null,v().createElement(Nx.v,{data:p,margin:{top:12,right:0,left:0,bottom:0},onMouseEnter:d,onMouseLeave:d,onMouseMove:d,className:l.barChart},v().createElement(Ix.q,{vertical:!1,stroke:"#f2f2f2"}),v().createElement(Dx.K,{dataKey:"value",interval:0,padding:{left:4,right:4},height:15,tickLine:!1,ticks:n,tick:e=>{const{x:t,y:r,index:n,payload:{value:a,offset:o}}=e;return v().createElement("text",{x:0===n?t-o:t+o,y:r+4,textAnchor:0===n?"start":"end"},`${i(a)}`)}}),v().createElement(Px.B,{width:38,domain:[0,"auto"],axisLine:!1,tickLine:!1,tickSize:0,tickMargin:4,tickCount:6,tickFormatter:o}),v().createElement(kx.u,{cursor:{fill:"rgb(255,255,255)"},content:v().createElement(Ux,{formatter:o}),isAnimationActive:!1}),v().createElement(Lx.$,{dataKey:"number",isAnimationActive:!1},t.map(((e,t)=>v().createElement(Fx.b,{key:`cell-${t}`,fill:a,fillOpacity:u(e,t)}))))))},zx="NumericRangeFacet-styles-numberEditorInputRoot--djW3k",Hx="NumericRangeFacet-styles-numberEditorRoot--DVXqx",Yx="NumericRangeFacet-styles-input--Nl2tx";function Wx(){return Wx=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Wx.apply(this,arguments)}class Gx extends b.PureComponent{constructor(){super(...arguments),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,_.path)([0,0],r))&&n.equals(o[1],(0,_.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,_.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,_.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=tc(a),l=Xs(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,x.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,y=t.map((e=>({value:e.value.map(this.applyScale),label:e.value.map(p.formatNumberForRangeFacet).join(" - "),number:e.number}))),f=s.map((e=>+this.applyScale(e))),[g,h]=p.getBarDomain(t).map((e=>this.applyScale(e)));return v().createElement(hx,{title:e.title,pathToTitle:e.pathToTitle,onClose:a,isHighlighted:r,isRecommended:n},v().createElement("div",{className:"NumericRangeFacet-styles-data--kL9q5"},y.length>0?v().createElement(v().Fragment,null,v().createElement("div",{className:"NumericRangeFacet-styles-barChartContainer--t9NkG","data-reltio-id":"search-bar-chart-with-selection"},v().createElement(Bx,{data:y,range:f,tickFormatterX:m,tickFormatterY:p.formatNumberForRangeFacet,domain:[g,h]})),v().createElement(Rx,{min:g,max:h,range:f,onAfterChange:this.onRevertedChange,onChange:this.onChangeRange,className:"NumericRangeFacet-styles-slider--XbmKe",valueLabelFormat:m,step:d?(h-g)/200:1}),v().createElement("div",{className:"NumericRangeFacet-styles-inputsContainer--mU0_m"},v().createElement(vx.c,{value:c,onChange:this.onLowerBoundChanged,onFocus:this.onFocus,integer:!d,format:i,variant:"filled",classes:{root:Hx},InputProps:{classes:{root:zx,input:Yx}}}),v().createElement(vx.c,{value:u,onChange:this.onUpperBoundChanged,onFocus:this.onFocus,integer:!d,format:i,variant:"filled",classes:{root:Hx},InputProps:{classes:{root:zx,input:Yx}}}))):v().createElement(ZT.K,{variant:"noData"})))}}Gx.propTypes={data:OE().array,values:OE().array,config:OE().object,isHighlighted:OE().bool,isRecommended:OE().bool,onClose:OE().func,onChange:OE().func,numberFormat:OE().shape({decimalSeparator:OE().string,thousandSeparator:OE().string,prefix:OE().string,suffix:OE().string,decimalScale:OE().number})},Gx.defaultProps={config:{},data:[],values:[]};const qx=(0,xE.connect)((e=>({numberFormat:Cr().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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(t,["config","values","data","onChange","numberFormat"]);const s=(0,xE.useSelector)(Cr().selectors.getAttributesPresentation),{strategy:c}=(0,x.getNumberFormat)((0,x.getAttrDataTypeDefinition)(r.attrType),s,x.intl.getLocale()),u=(0,b.useMemo)((()=>null==a?void 0:a.map((0,_.evolve)({value:(0,_.map)((0,x.applyPresentationStrategyToValue)(c))}))),[a,c]),p=(0,b.useMemo)((()=>null==n?void 0:n.map((0,x.mapFilterValue)((0,x.applyPresentationStrategyToValue)(c)))),[n,c]),d=(0,b.useCallback)((e=>{const t=null==e?void 0:e.map((0,x.mapFilterValue)((0,x.revertPresentationStrategyForValue)(c)));i(t)}),[c,i]);return v().createElement(e,Wx({data:u,values:p,onChange:d,config:r,numberFormat:o&&(0,_.omit)(["strategy",o])},l))};return t.displayName="WithCustomizedData",t})(Gx));var Zx=r(21669);const $x=(0,AE.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 Kx(){return Kx=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Kx.apply(this,arguments)}const Qx=(e,t)=>(0,_.pathOr)(null,[t],e),Xx=e=>e&&new Date(e),Jx=e=>e&&e.getTime(),eS=e=>{let{values:t,minDate:r,maxDate:n,onChange:a}=e;const[i,o]=(0,b.useState)(null),[l,s]=(0,b.useState)(null),c=(0,b.useRef)((0,va.x0)()),u=(0,b.useRef)((0,va.x0)()),p=$x();v().useEffect((()=>{o(Qx(t,0)),s(Qx(t,1))}),[t]);const d=(e,t)=>{(0,_.isNil)(e)||(0,_.isNil)(t)||a(e>t?[[t,e]]:[[e,t]])},m={minDate:Xx(r),maxDate:Xx(n)};return v().createElement("div",{className:p.container},v().createElement(Zx.Q,Kx({label:L().text("Start Date"),value:Xx(i),onChange:e=>{const t=Jx(e);o(t),d(t,l)},slotProps:{textField:{id:c.current,className:p.dateEditor}}},m)),v().createElement(Zx.Q,Kx({label:L().text("End Date"),value:Xx(l),onChange:e=>{const t=Jx(e);s(t),d(i,t)},slotProps:{textField:{id:u.current,className:p.dateEditor},popper:{placement:"bottom-end"}}},m)))};function tS(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const rS=e=>t=>e===x.DataTypes.TYPE_DATE?x.utils.dates.toLocalDate(t).getTime():t,nS=(0,AE.Z)({barChartContainer:{position:"relative",height:"190px",paddingTop:"6px",width:"100%",overflow:"hidden"},dateRangeChooserWrapper:{display:"flex",flexDirection:"column",alignItems:"center",marginTop:"12px",width:"100%"}}),aS=tc(),iS=e=>{let{data:t=[],values:r=[],config:n,onChange:a,isHighlighted:i,isRecommended:o,onClose:l}=e;const s=nS(),c=(0,_.path)(["attrType","type"],n),u=(0,b.useCallback)((e=>{const n=e.map((0,x.mapFilterValue)((i=c,e=>i===x.DataTypes.TYPE_DATE?x.utils.dates.toUtcDate(e).getTime():e)));var i;if(!(0,_.equals)(r,n)){const[e,r]=aS.getBarDomain(t),i=c===x.DataTypes.TYPE_DATE,o=n.map((e=>[x.utils.dates.getStartOfDay(e[0],i),x.utils.dates.getEndOfDay(e[1],i)])),l=aS.getRange(o,t);a([l.length?l:[e,r]])}}),[t,a,c,r]),p=(0,b.useMemo)((()=>{return t.map((e=c,t=>{if(Array.isArray(t.value)){const r=t.value.map(rS(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){tS(e,t,r[t])}))}return e}({},t,{value:r,label:r.map(x.formatDate).join(" - ")})}}));var e}),[t,c]),[d,m]=(0,b.useMemo)((()=>[aS.getBarDomain(p),aS.getRange(r.map((0,x.mapFilterValue)(rS(c))),p)]),[p,c,r]);return v().createElement(hx,{title:n.title,pathToTitle:n.pathToTitle,onClose:l,isHighlighted:i,isRecommended:o},t.length>0?v().createElement(v().Fragment,null,v().createElement("div",{className:s.barChartContainer},v().createElement(Bx,{data:p,range:m,tickFormatterX:x.formatDate,tickFormatterY:aS.formatNumberForRangeFacet,domain:d})),v().createElement("div",{className:s.dateRangeChooserWrapper},v().createElement(eS,{values:m,onChange:u}))):v().createElement(ZT.K,{variant:"noData"}))};function oS(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class lS{static getWidget(e){switch(e.type){case x.FACET_TYPES.ENTITY_TYPE_FACET:return iO;case x.FACET_TYPES.WITH_DROPDOWN_CHECKBOXES_FACET:return bx;case x.FACET_TYPES.NUMERIC_RANGE_FACET:return qx;case x.FACET_TYPES.DATE_RANGE_FACET:return iS;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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){oS(e,t,r[t])}))}return e}({},lS.getDefaultConfig(),e),r=lS.getWidget(t);return r?(e=>{const r=VT(e,t);return lS.connectData(r,t)})(r):null}}lS.getDefaultConfig=()=>({autofocus:!1,showDeleteButton:!0}),lS.connectData=(e,t)=>(0,xE.connect)((e=>{return{data:yr(t,e),values:fr(t,e),filteredData:hr(t,e),isHighlighted:(r=t.fieldName,n=e,(e=>e.explorer.facets.addedFacets)(n).includes(r)),isRecommended:Or(t.fieldName,e)};var r,n}))(e);const sS=(0,_.allPass)([(0,_.propSatisfies)(_.isEmpty,"configs"),(0,_.pathEq)(["group","hasCollapseButton"],!0)]),cS=(0,_.reject)(sS);var uS=r(66825),pS=r.n(uS);const dS=(0,AE.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"}}),mS=e=>{let{title:t="",iconSrc:r="",isOpen:n=!0,hasCollapseButton:a=!0,leftIcon:i,onCollapse:o}=e;const l=dS();return v().createElement("div",{className:l.titleBox},v().createElement("div",{className:l.title},i&&v().createElement("div",{className:l.leftIcon},i),r&&v().createElement(C(),{src:r,className:l.avatar}),v().createElement(hb.Y,{value:t},v().createElement("span",{className:l.text},t))),a&&v().createElement(Jv,{isOpen:n,onClick:o,className:l.collapseIcon,size:"S"}))};var yS=r(1230),fS=r.n(yS);const gS=e=>{let{facet:t,selectedFacets:r}=e;return!!r.find((e=>e.fieldName===t.fieldName||e.fieldName.includes(`${t.fieldName}.`)))},hS=e=>{let{facet:t,selectedFacets:r}=e;return gS({facet:t,selectedFacets:r})||ir(t)&&t.children&&t.children.some((e=>gS({facet:e,selectedFacets:r})))},ES=(0,AE.Z)({icon:{maxHeight:"25px",maxWidth:"25px",marginRight:"16px"}}),bS=e=>{let{group:t,metadata:r}=e;const n=ES(),a=(0,w.$H)(),i=(0,x.getEntityTypeGraphIcon)(r,{type:t.id}),o=(0,x.getAbsoluteImageUrl)(a,i);return v().createElement(ov,{className:n.icon,icon:o,avatarText:t.title[0]})};function vS(){return vS=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vS.apply(this,arguments)}const TS=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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["onListItemClick","focusIndex","selectedFacets","metadata"]);const o=(0,b.useRef)(null);o.current=n;const l=(0,b.useRef)(null);l.current=r;const s=(0,b.useCallback)(((e,r,n)=>{let{item:a,level:i,groupId:s}=r;const c=hS({facet:a,selectedFacets:o.current}),u=l.current===n;return v().createElement(Ob,{key:`item-${s}-${a.fieldName}`,onClick:t,data:a,label:v().createElement(xb.o,{text:a.title,highlight:a.filterText}),labelInText:a.title,level:i,style:e,index:n,checked:c,isFocused:u,groupId:s,LogoIcon:a.LogoIcon})}),[t]),c=(0,b.useCallback)(((e,t)=>v().createElement(uT(),{component:"div",className:"MoreFacetsPopup-styles-subHeader--h1vGz",style:e,key:`group-${t.item.id}`},t.item.needGroupIcon&&v().createElement(bS,{metadata:a,group:t.item}),t.item.title)),[a]),u=(0,b.useCallback)(((e,t)=>t.items?40:28),[]);return v().createElement(QE,vS({getItemSize:u,renderGroupTitle:c,renderItem:s,focusIndex:r},i,{disableHorizontalScrollbar:!0}))};TS.propTypes={focusIndex:OE().number,selectedFacets:OE().array,onListItemClick:OE().func,metadata:x.MetadataType};const OS=TS;function xS(){return xS=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xS.apply(this,arguments)}const SS=574,CS=e=>{let{metadata:t,open:r,selectedFacets:n,data:a=[],onListItemClick:i,lastFacetClicked:o={},width:l,height:s=SS}=e,c=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["metadata","open","selectedFacets","data","onListItemClick","lastFacetClicked","width","height"]);const[u,p]=(0,b.useState)(464),d=s-110;(0,b.useEffect)((()=>{p(d)}),[d]);const m=(0,b.useCallback)(((e,t)=>p((0,_.clamp)(56,d,t))),[d]),y=(0,b.useRef)();(0,b.useEffect)((()=>{const e=(0,_.path)(["current","updatePosition"],y);e&&e()}),[u]);const f=(0,b.useCallback)((function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return[{type:"item",item:e,moveTo:(0,_.has)("facetConfig")(o)&&o.facetConfig.fieldName===e.fieldName&&t===o.groupId,level:r,groupId:t}].concat(e.children?e.children.flatMap((e=>f(e,t,r+1))):[]).flat().filter((e=>!e.item.hide))}),[o]),g=(0,b.useCallback)((e=>e.map((e=>({type:"group",item:e,items:e.facets.filter((e=>!e.hide)).map((t=>f(t,e.id)))}))).filter((e=>e.items.length))),[f]),h=(0,b.useMemo)((()=>g(a)),[a,g]),E=(0,b.useMemo)((()=>(e=>{const t=e=>(0,_.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})))})(h)),[h]),T=(0,b.useCallback)((e=>{let{item:t,groupData:r}=e;i(t,!hS({facet:t,selectedFacets:n}),r.groupId)}),[i,n]),{focusIndex:O,handleKeyDown:S}=XE({items:E,open:r,onSelectFocusedItem:T,selectedItems:n}),C=Math.max(l||(0,x.getMaxItemWidth)("title")(h),240);return v().createElement(YE,xS({open:r,action:y,title:L().text("Select attribute"),containerWidth:C,searchInputOnKeyDown:S,containerHeight:110+u},c),v().createElement(OS,{focusIndex:O,selectedFacets:n,onListItemClick:i,metadata:t,containerWidth:C,items:E,height:u,onInnerContainerResize:m}),0===E.length&&v().createElement("div",{className:"MoreFacetsPopup-styles-noResultsCaptionContainer--ChfND"},v().createElement(DT(),{variant:"caption",display:"block",gutterBottom:!0},L().text("No results found"))))};CS.propTypes={metadata:x.MetadataType,open:OE().bool,selectedFacets:OE().array,data:OE().array,onListItemClick:OE().func,lastFacetClicked:OE().shape({facetConfig:OE().object,groupId:OE().string}),width:OE().number,height:OE().number};const wS=CS;function AS(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=n.concat(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 in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class _S extends b.PureComponent{constructor(e){super(e),this.state={filterText:"",lastFacetClicked:{},addedFacets:[]},this.showSearchInput=()=>this.searchInputRootRef.current.scrollIntoView(!0),this.openPopup=()=>this.props.dispatch(wp(!0)),this.closePopup=()=>{this.props.dispatch(wp(!1)),this.props.dispatch(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:wr.HIGHLIGHT_ADDED_FACETS,payload:e}}(this.state.addedFacets)),this.setState({addedFacets:[]}),setTimeout((()=>{this.props.dispatch({type:wr.CLEAR_HIGHLIGHT_ADDED_FACETS})}),3e3)},this.setFilterText=e=>this.setState({filterText:e,lastFacetClicked:{}}),this.clearFilterText=()=>this.setFilterText(""),this.setLastFacetClicked=e=>this.setState({lastFacetClicked:e}),this.resetLastFacetClicked=()=>this.setLastFacetClicked({}),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=>AS({},e,{hide:!this.filterItemsTree(e),filterText:this.state.filterText}))).map((e=>{const t=this.getFilteredFacets(e.children);return(0,_.isEmpty)(t)?e:AS({},e,{children:t})})),this.filterItemsInGroups=e=>e.map((e=>AS({},e,{facets:this.getFilteredFacets(e.facets)}))),this.rejectNotAllowedEntityTypes=e=>t=>t.filter((t=>{let{id:r}=t;return!(0,x.isEntityTypeUri)(r)||e.includes(r)})),this.toggleSelectedFacet=(e,t)=>{const{facetsConfigs:r,selectedEntityTypes:n,dispatch:a}=this.props,i=jt(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,_.uniq)(o.filter((e=>e.entityTypeUri)).map((e=>e.entityTypeUri)).concat(n)),s=o.filter((0,_.complement)(ir)),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,_.prop)("fieldName")),u),a(qc({facetsToAdd:c,fieldNamesToDelete:u,changedEntityTypes:(0,_.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,be.Z)(Xt),this.handleInputFocus=()=>{this.showSearchInput(),this.openPopup()},this.searchInputRootRef=v().createRef()}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,_.pipe)((0,_.when)((0,_.always)(e),this.filterItemsInGroups),(0,_.when)((0,_.always)(c),this.rejectNotAllowedEntityTypes(c)),an(s))(d),{verticalOrigin:y,popupHeight:f}=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:16,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,SS),g={vertical:y,horizontal:"right"};return v().createElement(b.Fragment,null,v().createElement(zE,{classes:{root:a.inputContainer},onSearch:this.setFilterText,onFocus:this.handleInputFocus,rootRef:this.searchInputRootRef,value:e,placeholder:L().text("Search & add attributes"),height:40,"data-reltio-id":"reltio-search-more-facets-search-input"}),v().createElement(wS,{open:r,anchorEl:this.searchInputRootRef.current,metadata:i,selectedFacets:p,data:m,onClose:this.handlePopupClose,onListItemClick:this.handleItemClick,lastFacetClicked:t,width:this.inputWidth,height:f,onSearch:this.setFilterText,headerPlacement:"bottom"===y?"bottom":"top",anchorOrigin:g,transformOrigin:g,disableRestoreFocus:!0}))}}_S.propTypes={metadata:x.MetadataType,open:OE().bool,facetsConfigs:OE().array,recommendedFacets:OE().array,selectedEntityTypes:OE().array,dispatch:OE().func,classes:OE().object,dataTenantObject:x.DataTenantType,allowedEntityTypes:OE().array,dataTenants:OE().arrayOf(x.DataTenantType)},_S.defaultProps={selectedEntityTypes:[],facetsConfigs:[]};const NS=(0,xE.connect)((e=>({metadata:Cr().selectors.getMetadata(e),open:mu(e),facetsConfigs:br(e),recommendedFacets:vr(e),selectedEntityTypes:Tr(e),dataTenantObject:sp(e),allowedEntityTypes:ku(e),dataTenants:Cr().selectors.getDataTenants(e)})))(fS()((()=>({inputContainer:{margin:"4px 16px 16px",flexShrink:"0"}})))(_S)),IS=(0,AE.Z)({facetGroupContainer:{display:"flex",flexShrink:0,flexDirection:"column","& + hr":{marginTop:8},"& + &":{marginTop:"8px"}}});function DS(){return DS=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},DS.apply(this,arguments)}const PS=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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["hasSearchAttributesField","children"]);const a=IS(),[i,o]=(0,b.useState)(!0);return v().createElement("div",{className:a.facetGroupContainer},v().createElement(mS,DS({isOpen:i,onCollapse:e=>{o(!i)}},n)),t&&v().createElement(v().Fragment,null,v().createElement(NS,null),v().createElement(pS(),null)),i&&r)},kS=(0,AE.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}}),LS=e=>{let{variant:t="facetsPanel",searchOptions:r={},dispatch:n}=e;const{root:a,labelRoot:i,checkboxRoot:o,checkboxRootQueryGroups:l}=kS(),s=r.searchByOv,c=(0,b.useCallback)((()=>{n(Sr.search.actions.updateSearchOptions({searchByOv:!s,ovOnly:!s}))}),[s,n]),u=L().text("Search by OV only");return v().createElement("div",{className:a,onClick:c},v().createElement(rb(),{classes:{root:O()(o,{[l]:"queryGroups"===t})},checked:s,color:"primary"}),v().createElement(hb.Y,{value:u},v().createElement(DT(),{variant:"body2",classes:{root:i}},u)))};LS.propTypes={searchOptions:OE().shape({searchByOv:OE().bool,ovOnly:OE().bool}),variant:OE().oneOf(["facetsPanel","queryGroups"]),dispatch:OE().func};const FS=(0,xE.connect)((e=>({searchOptions:Cr().selectors.getSearchOptions(e)})))(LS);var jS=r(8007),US=r(64927),MS=r.n(US),VS=r(73707),BS=r.n(VS),zS=r(93463),HS=r.n(zS);const YS=(0,AE.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 WS=r(19701);const GS=e=>{let{tenantObject:t,isDataTenant:r,className:n}=e;const a=(e=>{let{tenantObject:t,isDataTenant:r}=e;const n=(0,WS._)(),[a,i]=(0,b.useState)(0),o=(0,xE.useSelector)(Cr().selectors.getGlobalSearchRequestOptions),l=r?t:null,s=(0,xE.useSelector)((e=>fp(e,[],l))),c=JSON.stringify(We(s,[],o)),u=(0,xE.useSelector)(Cr().selectors.getDtssPath),p=(0,xE.useSelector)(Cr().selectors.getTenant);return(0,b.useEffect)((()=>{n(qe({url:Ee,options:{method:"POST",body:c},customerTenant:p,dataTenant:(0,_.prop)("id",l),dtssPath:u})).then((e=>{let{total:t}=e;i(t)})).catch((e=>{console.warn(e)}))}),[l,p,u,c]),a})({tenantObject:t,isDataTenant:r});return v().createElement("div",{className:n},Qs(a))};GS.propTypes={className:OE().string,tenantObject:OE().object.isRequired,isDataTenant:OE().bool};const qS=GS;function ZS(){return ZS=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ZS.apply(this,arguments)}const $S=e=>{let{customerTenantObject:t,currentTenant:r,dataTenants:n,changeCurrentTenant:a,openAdvancedSearch:i}=e;const o=YS(),l=(0,_.pipe)((0,_.map)((e=>{let{id:t,label:r}=e;return{value:t,label:r}})),(0,_.prepend)({value:t.id,label:t.name}))(n),s=e=>{const r=e!==t.id;return{isDataTenant:r,tenantObject:r?n.find((0,_.propEq)("id",e)):t}},c=r||t.id;return v().createElement("div",{className:o.tenantFacet},v().createElement(mS,{title:L().text("Tenants"),hasCollapseButton:!1}),v().createElement(BS(),{className:o.radioGroup,value:c,onChange:(0,_.pipe)(SE.NA,s,a)},l.map((e=>{let{value:t,label:r}=e;return v().createElement("div",{className:o.tenantContainer,key:t},v().createElement(HS(),{classes:{root:o.radioLabelRoot,label:o.radioLabel},value:t,label:r||t,control:v().createElement(MS(),{className:o.radioButton,color:"primary"})}),!i&&v().createElement(qS,ZS({className:o.total},s(t))))}))))};$S.propTypes={customerTenantObject:OE().shape({id:OE().string,name:OE().string}),currentTenant:OE().string,dataTenants:OE().arrayOf(x.DataTenantType),changeCurrentTenant:OE().func,openAdvancedSearch:OE().bool};const KS={changeCurrentTenant:e=>{let{tenantObject:t,isDataTenant:r}=e;return{type:Hr,payload:{tenantObject:t,isDataTenant:r}}}},QS=(0,xE.connect)((e=>({dataTenants:Cr().selectors.getDataTenants(e),customerTenantObject:Cr().selectors.getTenantObject(e),currentTenant:lp(e),openAdvancedSearch:fu(e)})),KS)($S),XS=(0,AE.Z)({root:{display:"flex",flexDirection:"column",overflow:"auto",height:"100%"}});function JS(){return JS=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},JS.apply(this,arguments)}const eC=(0,x.memoizeWith)((e=>e.fieldName),lS.build),tC=e=>{let{group:t,configs:r}=e;return v().createElement(PS,JS({},t,{key:t.title}),(e=>e.map((e=>({Facet:eC(e),id:e.fieldName}))).filter((e=>{let{Facet:t}=e;return t})).map((e=>{let{Facet:t,id:r}=e;return v().createElement(t,{key:r})})))(r))};tC.propTypes={group:OE().object,configs:OE().array};const rC=e=>{let{facetsConfigs:t=[],metadata:r,onScroll:n,uiConfigShowSearchByOv:a,showTenantFacet:i}=e;const{root:o}=XS(),l=(0,b.useRef)(null),s=(0,b.useCallback)((e=>{n(l.current.scrollTop,e)}),[n]),c=((e,t)=>{const[r,n]=(0,_.partition)(x.isTypeFacet,t),a=[{group:{title:L().text("Entity types"),hasCollapseButton:!1},configs:r},{group:{title:L().text("Attributes"),hasCollapseButton:!1,hasSearchAttributesField:!0},configs:n}];return cS(a)})(0,t),u=(0,_.head)(c),p=(0,_.tail)(c),d=l.current,m=(0,b.useMemo)((()=>({element:d,priority:["top","bottom"]})),[d]);return v().createElement("div",{ref:l,className:o,onScroll:s},v().createElement(jS.p.Provider,{value:m},a&&v().createElement(FS,null),i&&v().createElement(v().Fragment,null,v().createElement(QS,null),v().createElement(pS(),null)),u&&tC(u),v().createElement(pS(),null),p.map(((e,t)=>v().createElement(tC,JS({},e,{key:t}))))))};rC.propTypes={metadata:x.MetadataType,facetsConfigs:OE().array,onScroll:OE().func,dispatch:OE().func,uiConfigShowSearchByOv:OE().bool,showTenantFacet:OE().bool};const nC=(0,xE.connect)((e=>{var t;const r=Cr().selectors.getDataTenants(e);return{metadata:Cr().selectors.getMetadata(e),facetsConfigs:br(e),uiConfigShowSearchByOv:null!==(t=Cr().selectors.getShowSearchByOv(e))&&void 0!==t?t:_u(e),showTenantFacet:r&&r.length>0,tenant:Cr().selectors.getTenant(e)}}))(rC),aC=e=>{let{children:t,className:r}=e;return v().createElement("div",{className:O()("MainContent-styles-mainContent--Ha5me",r)},t)};aC.propTypes={children:OE().node,className:OE().string};const iC=aC;var oC=r(33788);const lC=(0,AE.Z)({container:{backgroundColor:"#fff",opacity:.37,position:"fixed",width:"100%",height:"100%",top:0,left:0,display:"flex",justifyContent:"center",alignItems:"center"}}),sC=()=>{const e=(0,xE.useSelector)(du),{container:t}=lC();return e?v().createElement("div",{className:t},v().createElement(oC.Z,{size:160})):null};var cC=r(54596),uC=r.n(cC),pC=r(49233),dC=r.n(pC),mC=r(35206),yC=r.n(mC),fC=r(81733),gC=r.n(fC),hC=r(68290),EC=r.n(hC);const bC=(0,AE.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"},[re]:{backgroundColor:e.palette.error.dark}})));function vC(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const TC=()=>{const e=(0,xE.useDispatch)(),t=(0,xE.useSelector)(Au),r=(0,xE.useSelector)(Cr().selectors.getAutoCloseInterval),n=t&&t.payload.autoHideDuration||r&&1e3*r||5e3,a=bC(),i=(0,b.useRef)(null),o=(0,b.useCallback)((()=>{e(Pp())}),[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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){vC(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,b.useCallback)((()=>{p&&e(p)}),[p,e]),m=(0,b.useMemo)((()=>l===re?v().createElement(dC(),{key:"close","aria-label":"Close",color:"inherit",className:a.close,onClick:d,size:"large"},v().createElement(kE(),null)):u?v().createElement(yC(),{color:"primary",size:"small",onClick:d},u.actionLabel):null),[a,l,u,d]);return v().createElement(gC(),{container:document.body},v().createElement(uC(),{key:c+l,anchorOrigin:{vertical:"bottom",horizontal:"center"},autoHideDuration:n,open:Boolean(t),onClose:o,ContentProps:{classes:{root:O()(a.snackbar,a[l]),message:a.message}},message:v().createElement("div",{className:a.messageContent},l===re&&v().createElement(EC(),{className:a.icon}),c),classes:{anchorOriginBottomCenter:a.anchorSnackBar},action:m}))},OC=(0,AE.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 xC=r(31396);const SC=(0,AE.Z)((()=>({container:{position:"relative","& .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:"row-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","&:not(.disabled):hover":{cursor:"col-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%"}}}}}))),CC=250,wC=e=>"horizontal"===e,AC=e=>{let{className:t,children:r,orientation:n,primary:a,defaultSize:i,size:o,minSize:l,maxSize:s,allowResize:c,debounceInterval:u=CC,onChange:p}=e;const d=SC(),m=(0,Mv.useTheme)(),[y,f]=(0,b.useState)(null),[g,h]=(0,b.useState)(!0),E=(0,b.useCallback)((()=>h(!0)),[]),T=(0,b.useCallback)((()=>h(!1)),[]),S=()=>wC(n)?null==y?void 0:y.clientHeight:null==y?void 0:y.clientWidth,C=(0,b.useCallback)((0,x.debounce)((e=>{const t=S();p({percentageSize:e/t*100+"%",isMaxSize:+s>0?e===s:e===t+s,isMinSize:e===l,size:e})}),u),[p,n,s,y]),w=(0,b.useMemo)((()=>({transition:m.transitions.create(wC(n)?"height":"width",{easing:m.transitions.easing.sharp,duration:m.transitions.duration.leavingScreen})})),[n,m]);return"number"==typeof o&&o<0&&(o=(S()||0)+o),v().createElement("div",{ref:f,className:O()(d.container,t)},v().createElement(xC.Z,{split:n,size:o,primary:a,allowResize:c,onChange:C,defaultSize:i,minSize:l,maxSize:s,onDragStarted:T,onDragFinished:E,pane1Style:g?w:void 0},r))};AC.displayName="ResizablePanes";const RC=(0,AE.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 8px 3px",borderRadius:"2px",fontSize:"13px",fontWeight:500,lineHeight:"15px",marginRight:"16px",flexShrink:0}}),_C=e=>{let{entity:t,className:r,size:n="small"}=e;const a=RC(),i=(0,w.AH)(),o=(0,x.getEntityType)(i,t.type),l=(o?(0,x.getPropWithInheritance)(i,o,"typeColor"):null)||x.theme.palette.primary.main,s=(0,x.getEntityTypeLabel)(i,t);return v().createElement(hb.Y,{value:s,placement:"top"},v().createElement(DT(),{style:{backgroundColor:l,color:x.utils.Colors.getColor(l)?"#FFFFFF":"#212121"},className:O()(a[`entityType-${n}`],a["entityType-overflow"],r),component:"div"},s))},NC=e=>e&&e.scrollIntoView({block:"end",behavior:"smooth"}),IC=e=>{e&&clearTimeout(e)},DC=(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 PC=r(55962);const kC=(0,AE.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,Mv.alpha)(e.palette.primary.main,.12),"&:hover":{background:(0,Mv.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"}}))),LC=e=>{let{entities:t,entityToHighlight:r,selectedEntityUri:n,onEntityClick:a,onEntityHover:i,entitiesImportStatus:o,entityButtonsRenderer:l}=e;const s=kC(),c=(0,b.useRef)(null),u=(0,b.useRef)(null),p=(0,w.AH)();return(0,PC.D)((()=>{if(r){var e;const n=null===(e=c.current)||void 0===e?void 0:e.querySelectorAll(`[data-entity-uri='${r}']`);if(IC(u.current),(null==n?void 0:n.length)>0){var t;const e=null===(t=c.current)||void 0===t?void 0:t.parentElement;DC(n[0],e)||(NC(n[0]),u.current=setTimeout((()=>{DC(n[0],e)||NC(n[0])}),1e3))}}return()=>{IC(u.current)}}),[r]),v().createElement("div",{ref:c},(t||[]).map((e=>{const t=(0,x.getLabel)(e.label),c=e.secondaryLabel,u=(0,x.getBusinessCardAttributesText)(p,e),d=(0,x.isActiveObject)(e),m=e.uri,y=(0,x.getEntityUriForLink)(e),f=(0,_.prop)(m,o);return v().createElement("div",{key:m,className:O()(s.item,{[s.clickable]:!!a,[s.selected]:m===n,[s.highlighted]:m===r,[s.inactive]:!d,[s.justImported]:f===_v.SUCCESS}),onClick:a?()=>a(m):void 0,onMouseEnter:i?()=>i(m):void 0,onMouseLeave:i?()=>i(null):void 0,"data-entity-uri":m},v().createElement(A,{entity:e,avatarClassName:s.avatar,imageClassName:s.image}),v().createElement("div",{className:s.info},v().createElement("div",null,v().createElement(Kb,{value:y,className:s.label},t),c&&v().createElement("span",{className:s.secondaryLabel},c," "),u&&v().createElement("span",{className:s.businessCard},u)),v().createElement("div",{className:s.secondRow},v().createElement(_C,{entity:e}),v().createElement("div",null,(0,x.getEntityId)(e)))),l&&l(e))})))};var FC=r(92255);function jC(){return jC=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},jC.apply(this,arguments)}function UC(){return UC=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},UC.apply(this,arguments)}function MC(){return MC=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},MC.apply(this,arguments)}function VC(){return VC=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},VC.apply(this,arguments)}const BC=(0,AE.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:{},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 zC(){return zC=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},zC.apply(this,arguments)}let HC=function(e){return e.full="full",e.embedded="embedded",e.small="small",e}({});const YC={SEARCH_RESULTS:e=>v().createElement("svg",jC({width:256,height:256,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),v().createElement("defs",null,v().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"},v().createElement("stop",{stopColor:"#00BFFF",stopOpacity:.5,offset:"0%"}),v().createElement("stop",{stopColor:"#9EE8FF",stopOpacity:0,offset:"100%"})),v().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"},v().createElement("stop",{stopColor:"#91F8E5",stopOpacity:.6,offset:"0%"}),v().createElement("stop",{stopColor:"#14F7FF",stopOpacity:0,offset:"100%"})),v().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"},v().createElement("stop",{stopColor:"#FFF",offset:"0%"}),v().createElement("stop",{stopColor:"#73FAFF",stopOpacity:.21,offset:"59.38%"}),v().createElement("stop",{stopColor:"#14F7FF",stopOpacity:0,offset:"100%"})),v().createElement("linearGradient",{x1:"50%",y1:"170.771%",x2:"50%",y2:"10.303%",id:"EmptySearchResults_svg__e"},v().createElement("stop",{stopColor:"#91F8E5",offset:"0%"}),v().createElement("stop",{stopColor:"#99FCFF",stopOpacity:0,offset:"100%"})),v().createElement("filter",{x:"-25.9%",y:"-26.2%",width:"151.8%",height:"152.3%",filterUnits:"objectBoundingBox",id:"EmptySearchResults_svg__d"},v().createElement("feGaussianBlur",{stdDeviation:15,in:"SourceGraphic"})),v().createElement("circle",{id:"EmptySearchResults_svg__a",cx:128,cy:128,r:128})),v().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},v().createElement("mask",{id:"EmptySearchResults_svg__b",fill:"#fff"},v().createElement("use",{xlinkHref:"#EmptySearchResults_svg__a"})),v().createElement("use",{fillOpacity:.2,fill:"#A792CD",xlinkHref:"#EmptySearchResults_svg__a"}),v().createElement("g",{mask:"url(#EmptySearchResults_svg__b)"},v().createElement("g",{transform:"translate(56 34)"},v().createElement("g",{opacity:.9,strokeWidth:1,fill:"#FFF"},v().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"}),v().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})),v().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(21.756 45.833)"},v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:213.204,cy:5.456,rx:4.351,ry:4.365}),v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:197.976,cy:5.456,rx:4.351,ry:4.365}),v().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"}),v().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}),v().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}),v().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})),v().createElement("rect",{fill:"#645F6D",opacity:.5,x:21.756,y:17.46,width:87.022,height:12.004,rx:6.002}),v().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(21.756 87.302)"},v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:213.204,cy:5.456,rx:4.351,ry:4.365}),v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:197.976,cy:5.456,rx:4.351,ry:4.365}),v().createElement("rect",{fill:"#E3EBF4",x:0,y:1.091,width:20.668,height:20.734,rx:10.334}),v().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}),v().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}),v().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})),v().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(21.756 128.77)"},v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:213.204,cy:5.456,rx:4.351,ry:4.365}),v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:197.976,cy:5.456,rx:4.351,ry:4.365}),v().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"}),v().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}),v().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}),v().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})))),v().createElement("g",{mask:"url(#EmptySearchResults_svg__b)"},v().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"}),v().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"}),v().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"}),v().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}),v().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"}),v().createElement("g",null,v().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)"}),v().createElement("path",{fill:"url(#EmptySearchResults_svg__e)",opacity:.3,d:"M4 9h166.37L120.73 172.299H53.64z",transform:"rotate(120 90.404 138.861)"}),v().createElement("path",{fill:"url(#EmptySearchResults_svg__f)",opacity:.3,d:"M4 2h166.37L120.73 172.299H53.64z",transform:"rotate(120 90.404 138.861)"}),v().createElement("path",{fill:"url(#EmptySearchResults_svg__g)",d:"M4 9h166.37L120.73 172.299H53.64z",transform:"rotate(120 90.404 138.861)"}),v().createElement("path",{fill:"#FFF",opacity:.196,d:"M212.363 205.344l-1 1.732L60.418 124.52l4.977-8.62z"})),v().createElement("path",{fill:"#76A2B5",d:"M73.112 84.533l-35.5 61.488-.866-.5 35.5-61.488z"}),v().createElement("path",{fill:"#F3F3F3",d:"M80.906 89.033l-35.5 61.488-.866-.5 35.5-61.488z"}),v().createElement("path",{fill:"#538196",d:"M55.112 115.71l-17.5 30.311-.866-.5 17.5-30.31z"})))),SELECT_ATTRIBUTES:e=>v().createElement("svg",UC({width:256,height:256,viewBox:"0 0 256 256",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),v().createElement("circle",{cx:128,cy:128,r:128,fill:"#0072CE",fillOpacity:.1}),v().createElement("mask",{id:"SelectAttributes_svg__a",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:256,height:256},v().createElement("circle",{cx:128,cy:128,r:128,fill:"#fff"})),v().createElement("g",{mask:"url(#SelectAttributes_svg__a)"},v().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M-16 9h256v247H-16V9z",fill:"url(#SelectAttributes_svg__paint0_linear_0_19219)"}),v().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)"}),v().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"}),v().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"}),v().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"}),v().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"}),v().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"}),v().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"}),v().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"}),v().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"}),v().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"}),v().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"}),v().createElement("circle",{cx:67,cy:79,r:9,fill:"#B6C7DB"}),v().createElement("circle",{cx:67,cy:79,r:9,fill:"#B6C7DB"}),v().createElement("circle",{cx:120,cy:106,r:6,fill:"#B6C7DB"}),v().createElement("circle",{cx:120,cy:136,r:6,fill:"#B6C7DB"}),v().createElement("circle",{cx:67,cy:169,r:9,fill:"#B6C7DB"}),v().createElement("circle",{cx:67,cy:199,r:9,fill:"#B6C7DB"}),v().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"}),v().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"}),v().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"}),v().createElement("path",{opacity:.54,fillRule:"evenodd",clipRule:"evenodd",d:"M95.071 77l-3.535 3.535L88 77h7.071z",fill:"#000"}),v().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"}),v().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"})),v().createElement("defs",null,v().createElement("linearGradient",{id:"SelectAttributes_svg__paint0_linear_0_19219",x1:-16,y1:9,x2:-16,y2:256,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopColor:"#FAFAFA",stopOpacity:.01}),v().createElement("stop",{offset:1,stopColor:"#F4F4F4"})),v().createElement("linearGradient",{id:"SelectAttributes_svg__paint1_linear_0_19219",x1:266.117,y1:181.111,x2:154.882,y2:77.681,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopOpacity:.01}),v().createElement("stop",{offset:1})))),NO_DATA:e=>v().createElement("svg",MC({width:256,height:256,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),v().createElement("defs",null,v().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"NoData_svg__b"},v().createElement("stop",{stopColor:"#FAFAFA",stopOpacity:0,offset:"0%"}),v().createElement("stop",{stopColor:"#F4F4F4",offset:"100%"})),v().createElement("linearGradient",{x1:"69.573%",y1:"86.747%",x2:"38.144%",y2:"33.403%",id:"NoData_svg__d"},v().createElement("stop",{stopColor:"#000",stopOpacity:0,offset:"0%"}),v().createElement("stop",{stopColor:"#000",offset:"100%"})),v().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"NoData_svg__e"},v().createElement("stop",{stopColor:"#EEFBFF",offset:"0%"}),v().createElement("stop",{stopColor:"#0072CE",offset:"100%"})),v().createElement("filter",{x:"-7.7%",y:"-7.5%",width:"115.3%",height:"115%",filterUnits:"objectBoundingBox",id:"NoData_svg__f"},v().createElement("feOffset",{dx:0,dy:2,in:"SourceAlpha",result:"shadowOffsetOuter1"}),v().createElement("feGaussianBlur",{stdDeviation:2,in:"shadowOffsetOuter1",result:"shadowBlurOuter1"}),v().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"}),v().createElement("feMerge",null,v().createElement("feMergeNode",{in:"shadowMatrixOuter1"}),v().createElement("feMergeNode",{in:"SourceGraphic"}))),v().createElement("circle",{id:"NoData_svg__a",cx:128,cy:128,r:128})),v().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},v().createElement("mask",{id:"NoData_svg__c",fill:"#fff"},v().createElement("use",{xlinkHref:"#NoData_svg__a"})),v().createElement("use",{fillOpacity:.1,fill:"#0072CE",xlinkHref:"#NoData_svg__a"}),v().createElement("path",{fill:"url(#NoData_svg__b)",mask:"url(#NoData_svg__c)",d:"M0 9h256v247H0z"}),v().createElement("g",{mask:"url(#NoData_svg__c)"},v().createElement("g",{transform:"translate(29 37)"},v().createElement("g",{opacity:.9,strokeWidth:1,fill:"#FFF"},v().createElement("path",{fillOpacity:.8,opacity:.5,d:"M14.565 8h228.144v176.476H14.565z"}),v().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"})),v().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(19.986 42.105)"},v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:195.862,cy:5.013,rx:3.997,ry:4.01}),v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:181.872,cy:5.013,rx:3.997,ry:4.01}),v().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"}),v().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}),v().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}),v().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})),v().createElement("rect",{fill:"#645F6D",opacity:.5,x:19.986,y:16.04,width:79.944,height:11.028,rx:5.514}),v().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(19.986 80.2)"},v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:195.862,cy:5.013,rx:3.997,ry:4.01}),v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:181.872,cy:5.013,rx:3.997,ry:4.01}),v().createElement("rect",{fill:"#E3EBF4",x:0,y:1.003,width:18.987,height:19.048,rx:9.493}),v().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}),v().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}),v().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})),v().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(19.986 118.296)"},v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:195.862,cy:5.013,rx:3.997,ry:4.01}),v().createElement("ellipse",{fill:"#6DBCFF",opacity:.5,cx:181.872,cy:5.013,rx:3.997,ry:4.01}),v().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"}),v().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}),v().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}),v().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})))),v().createElement("g",{mask:"url(#NoData_svg__c)"},v().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)"}),v().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)"}),v().createElement("g",{filter:"url(#NoData_svg__f)",strokeWidth:1,fill:"none",transform:"translate(70 86)"},v().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"}),v().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"})),v().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"}}),v().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"}}),v().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=>v().createElement("svg",VC({width:88,height:88,viewBox:"0 0 88 88",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),v().createElement("mask",{id:"Error_svg__a",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:88,height:88},v().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"})),v().createElement("g",{mask:"url(#Error_svg__a)"},v().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}),v().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"}),v().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"}),v().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"}),v().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"}),v().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"}),v().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"}),v().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"}),v().createElement("path",{d:"M21.036 40.178h-5.09a.636.636 0 000 1.272h5.09a.636.636 0 100-1.272z",fill:"#ACACAC"}),v().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"}),v().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"}),v().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"}),v().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"}),v().createElement("path",{d:"M18.915 18.546a1.909 1.909 0 100-3.817 1.909 1.909 0 000 3.817z",fill:"#9C6CF0"}),v().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"}),v().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"}),v().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"}),v().createElement("path",{d:"M41.82 18.546a1.909 1.909 0 100-3.817 1.909 1.909 0 000 3.817z",fill:"#4DBEE9"}),v().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"}),v().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"}),v().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"}),v().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"}),v().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"}),v().createElement("path",{d:"M54.968 67.324h-5.09a.636.636 0 000 1.273h5.09a.636.636 0 000-1.273z",fill:"#E9E9E9"}),v().createElement("g",{filter:"url(#Error_svg__filter0_d)"},v().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"})),v().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"}),v().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"}),v().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"}),v().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"}),v().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"}),v().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)"}),v().createElement("g",{filter:"url(#Error_svg__filter1_d)"},v().createElement("path",{d:"M57.406 68.063a1.719 1.719 0 100-3.438 1.719 1.719 0 000 3.438z",fill:"#000"})),v().createElement("path",{d:"M57.406 68.063a1.719 1.719 0 100-3.438 1.719 1.719 0 000 3.438z",fill:"#fff"}),v().createElement("g",{filter:"url(#Error_svg__filter2_d)"},v().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"})),v().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"})),v().createElement("defs",null,v().createElement("filter",{id:"Error_svg__filter0_d",x:36.219,y:37.875,width:42.375,height:42.375,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},v().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),v().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"}),v().createElement("feOffset",{dy:2}),v().createElement("feGaussianBlur",{stdDeviation:2}),v().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"}),v().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),v().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),v().createElement("filter",{id:"Error_svg__filter1_d",x:51.688,y:62.625,width:11.438,height:11.438,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},v().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),v().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"}),v().createElement("feOffset",{dy:2}),v().createElement("feGaussianBlur",{stdDeviation:2}),v().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"}),v().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),v().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),v().createElement("filter",{id:"Error_svg__filter2_d",x:51.688,y:44.063,width:11.438,height:23.813,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},v().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),v().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"}),v().createElement("feOffset",{dy:2}),v().createElement("feGaussianBlur",{stdDeviation:2}),v().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"}),v().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),v().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),v().createElement("linearGradient",{id:"Error_svg__paint0_linear",x1:68.438,y1:71.571,x2:60.119,y2:58.801,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopOpacity:0}),v().createElement("stop",{offset:1})))),LOADING:e=>v().createElement("svg",zC({width:256,height:256,viewBox:"0 0 256 256",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),v().createElement("circle",{cx:128,cy:128,r:128,fill:"#0072CE",fillOpacity:.03}),v().createElement("mask",{id:"EmptyLoading_svg__a",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:0,y:0,width:256,height:256},v().createElement("circle",{cx:128,cy:128,r:128,fill:"#fff"})),v().createElement("g",{mask:"url(#EmptyLoading_svg__a)"},v().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M-16 9h256v247H-16V9z",fill:"url(#EmptyLoading_svg__paint0_linear_2978_41880)"}),v().createElement("g",{fillRule:"evenodd",clipRule:"evenodd"},v().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"}),v().createElement("path",{d:"M50.371 43.106h255.685V195.71H50.371V43.106z",fill:"url(#EmptyLoading_svg__paint1_linear_2978_41880)"}),v().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"}),v().createElement("path",{d:"M339.015 204.883v4.966H15v-4.966h324.015z",fill:"#D4DCDF"}),v().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)"})),v().createElement("g",{filter:"url(#EmptyLoading_svg__filter0_d_2978_41880)"},v().createElement("rect",{x:81.703,y:99,width:170,height:26,rx:8,fill:"#D1E6FF"}),v().createElement("rect",{x:84.703,y:102,width:164,height:20,rx:5,stroke:"#fff",strokeWidth:6})),v().createElement("g",{filter:"url(#EmptyLoading_svg__filter1_d_2978_41880)"},v().createElement("mask",{id:"EmptyLoading_svg__b",fill:"#fff"},v().createElement("rect",{x:81,y:105,width:108,height:14,rx:2})),v().createElement("rect",{x:81,y:105,width:108,height:14,rx:2,fill:"#61A3F1"}),v().createElement("rect",{x:81,y:105,width:108,height:14,rx:2,stroke:"#4A90E2",strokeWidth:8,mask:"url(#EmptyLoading_svg__b)"})),v().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"}),v().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"}),v().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"}),v().createElement("g",{filter:"url(#EmptyLoading_svg__filter2_ddd_2978_41880)"},v().createElement("path",{fill:"#A0C1D7",d:"M70.703 64h11v8h-11z"}),v().createElement("rect",{x:62,y:59,width:28,height:8,rx:1,fill:"#BDD4E3"}),v().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"}),v().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"}),v().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)"}),v().createElement("circle",{cx:75.94,cy:123.237,r:44.723,fill:"#91B0C2"}),v().createElement("g",{filter:"url(#EmptyLoading_svg__filter3_d_2978_41880)"},v().createElement("circle",{r:42.793,transform:"matrix(-1 0 0 1 75.94 123.237)",fill:"#F7F4FF"})),v().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)"}),v().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)"}),v().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"}),v().createElement("circle",{cx:75.94,cy:123.237,r:2.896,fill:"#EEEBF6"}),v().createElement("circle",{cx:96.211,cy:148.655,r:2.574,fill:"#A0C3D7"}),v().createElement("circle",{cx:107.15,cy:131.924,r:2.574,fill:"#A0C3D7"}),v().createElement("rect",{x:62.427,y:135.592,width:27.027,height:10.039,rx:3,fill:"#A0C3D7"}),v().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)"}),v().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)"}),v().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)"}),v().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)"}),v().createElement("circle",{cx:75.618,cy:155.734,r:2.574,fill:"#A0C3D7"}),v().createElement("circle",{cx:55.026,cy:148.655,r:2.574,fill:"#A0C3D7"}),v().createElement("circle",{cx:44.73,cy:131.924,r:2.574,fill:"#A0C3D7"}),v().createElement("g",{fill:"#A0C3D7"},v().createElement("circle",{r:2.574,transform:"matrix(1 0 0 -1 96.21 97.363)"}),v().createElement("circle",{r:2.574,transform:"matrix(1 0 0 -1 107.149 114.094)"}),v().createElement("circle",{r:2.574,transform:"matrix(1 0 0 -1 75.618 90.284)"}),v().createElement("circle",{r:2.574,transform:"matrix(1 0 0 -1 55.026 97.363)"}),v().createElement("circle",{r:2.574,transform:"matrix(1 0 0 -1 44.73 114.094)"})))),v().createElement("defs",null,v().createElement("linearGradient",{id:"EmptyLoading_svg__paint0_linear_2978_41880",x1:-16,y1:9,x2:-16,y2:256,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopColor:"#FAFAFA",stopOpacity:.01}),v().createElement("stop",{offset:1,stopColor:"#F4F4F4"})),v().createElement("linearGradient",{id:"EmptyLoading_svg__paint1_linear_2978_41880",x1:178.214,y1:43.106,x2:178.214,y2:195.709,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopColor:"#F2F9FB"}),v().createElement("stop",{offset:1,stopColor:"#fff"})),v().createElement("linearGradient",{id:"EmptyLoading_svg__paint2_linear_2978_41880",x1:178.497,y1:204.542,x2:178.497,y2:213.991,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopColor:"#90AABF"}),v().createElement("stop",{offset:1,stopColor:"#869DAE"})),v().createElement("linearGradient",{id:"EmptyLoading_svg__paint3_linear_2978_41880",x1:154.275,y1:146.574,x2:96.683,y2:91.352,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopOpacity:.01}),v().createElement("stop",{offset:1})),v().createElement("linearGradient",{id:"EmptyLoading_svg__paint4_linear_2978_41880",x1:60.762,y1:143.327,x2:114.747,y2:176.019,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopOpacity:.87}),v().createElement("stop",{offset:1,stopOpacity:.01})),v().createElement("linearGradient",{id:"EmptyLoading_svg__paint6_linear_2978_41880",x1:90.287,y1:154.267,x2:68.53,y2:131.301,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopOpacity:.01}),v().createElement("stop",{offset:1})),v().createElement("linearGradient",{id:"EmptyLoading_svg__paint7_linear_2978_41880",x1:100.735,y1:120.288,x2:78.978,y2:97.322,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopOpacity:.01}),v().createElement("stop",{offset:1})),v().createElement("linearGradient",{id:"EmptyLoading_svg__paint8_linear_2978_41880",x1:121.119,y1:112.739,x2:99.362,y2:89.773,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopOpacity:.01}),v().createElement("stop",{offset:1})),v().createElement("linearGradient",{id:"EmptyLoading_svg__paint9_linear_2978_41880",x1:90.166,y1:136.143,x2:68.409,y2:113.177,gradientUnits:"userSpaceOnUse"},v().createElement("stop",{stopOpacity:.01}),v().createElement("stop",{offset:1})),v().createElement("filter",{id:"EmptyLoading_svg__filter0_d_2978_41880",x:77.703,y:96,width:178,height:34,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},v().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),v().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"}),v().createElement("feOffset",{dy:1}),v().createElement("feGaussianBlur",{stdDeviation:2}),v().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"}),v().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_2978_41880"}),v().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_2978_41880",result:"shape"})),v().createElement("filter",{id:"EmptyLoading_svg__filter1_d_2978_41880",x:77,y:102,width:116,height:22,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},v().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),v().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"}),v().createElement("feOffset",{dy:1}),v().createElement("feGaussianBlur",{stdDeviation:2}),v().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"}),v().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_2978_41880"}),v().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_2978_41880",result:"shape"})),v().createElement("filter",{id:"EmptyLoading_svg__filter2_ddd_2978_41880",x:-13.297,y:28,width:181.534,height:189.17,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},v().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),v().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"}),v().createElement("feMorphology",{radius:4,operator:"erode",in:"SourceAlpha",result:"effect1_dropShadow_2978_41880"}),v().createElement("feOffset",{dy:7}),v().createElement("feGaussianBlur",{stdDeviation:4}),v().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"}),v().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_2978_41880"}),v().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"}),v().createElement("feMorphology",{radius:4,operator:"dilate",in:"SourceAlpha",result:"effect2_dropShadow_2978_41880"}),v().createElement("feOffset",{dy:5}),v().createElement("feGaussianBlur",{stdDeviation:16}),v().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"}),v().createElement("feBlend",{mode:"normal",in2:"effect1_dropShadow_2978_41880",result:"effect2_dropShadow_2978_41880"}),v().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"}),v().createElement("feMorphology",{radius:2,operator:"dilate",in:"SourceAlpha",result:"effect3_dropShadow_2978_41880"}),v().createElement("feOffset",{dy:12}),v().createElement("feGaussianBlur",{stdDeviation:8.5}),v().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"}),v().createElement("feBlend",{mode:"normal",in2:"effect2_dropShadow_2978_41880",result:"effect3_dropShadow_2978_41880"}),v().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect3_dropShadow_2978_41880",result:"shape"})),v().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"},v().createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),v().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"}),v().createElement("feOffset",{dy:2}),v().createElement("feGaussianBlur",{stdDeviation:2}),v().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"}),v().createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow_2978_41880"}),v().createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow_2978_41880",result:"shape"})),v().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)"},v().createElement("stop",{stopColor:"#CFE8FF"}),v().createElement("stop",{offset:.599,stopColor:"#D1F2F9",stopOpacity:0}))))},WC=e=>{let{variant:t=HC.full,LogoRenderer:r=YC.SEARCH_RESULTS,text:n,secondaryText:a,buttonTitle:i,onClick:o=_.identity,access:l}=e;const s=BC(),c=l&&i;return v().createElement("div",{className:O()(s.root,s[`root_${t}`])},v().createElement(r,{className:s[`${t}`]}),v().createElement("div",{className:s.textBox},v().createElement(DT(),{variant:"h5",classes:{h5:s.text}},n),a&&v().createElement(DT(),{variant:"subtitle1",classes:{subtitle1:s.secondaryText}},a)),c&&v().createElement(yC(),{className:s.button,variant:"contained",color:"primary",onClick:o},i))};var GC=r(87378);class qC extends v().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 ZC=(0,AE.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 $C=r(46089),KC=r.n($C);const QC=(0,AE.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,Mv.alpha)(e.palette.primary.main,.12),fill:e.palette.primary.main,color:e.palette.primary.main,"&:hover":{backgroundColor:(0,Mv.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:{}}))),XC=(0,Eb.T)(yC()),JC=e=>{let{className:t,classes:r={},modes:n=[],modeId:a,onChange:i}=e;const o=QC();return v().createElement(KC(),{className:t},n.map((e=>{let{id:t,title:n,tooltipTitle:l,Icon:s,disabled:c}=e;return v().createElement(XC,{disabled:c,showForDisabled:c&&!!l,key:String(t),className:O()(o.button,{[o.current]:a===t},r.button),tooltipTitle:l,onClick:(u=t,()=>i(u)),"data-reltio-id":`reltio-search-mode-${t}`},s&&v().createElement(s,{className:o.icon}),n&&v().createElement("div",{className:o.title},n));var u})))},ew=(0,AE.Z)((()=>({button:{"&.MuiButtonGroup-grouped":{minWidth:"90px",padding:"8px 12px"}}})));function tw(){return tw=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},tw.apply(this,arguments)}const rw=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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",tw({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),v().createElement("defs",null,v().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"})),v().createElement("g",{stroke:"none",strokeWidth:"1"},v().createElement("g",{transform:"translate(.2)"},v().createElement("mask",{id:"svg3365802068b",fill:"#fff"},v().createElement("use",{xlinkHref:"#svg3365802068a"})),v().createElement("g",{mask:"url(#svg3365802068b)"},v().createElement("g",null,v().createElement("g",null,v().createElement("path",{d:"M0 0h24v24H0z"})))))))};function nw(){return nw=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},nw.apply(this,arguments)}const aw=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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",nw({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),v().createElement("defs",null,v().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"})),v().createElement("g",{stroke:"none",strokeWidth:"1"},v().createElement("g",{transform:"translate(.2)"},v().createElement("mask",{id:"svg4195527304b",fill:"#fff"},v().createElement("use",{xlinkHref:"#svg4195527304a"})),v().createElement("g",{mask:"url(#svg4195527304b)"},v().createElement("path",{d:"M0 0h24v24H0z"})))))},iw=e=>{switch(e){case V:return rw;case B:return aw;default:return EC()}},ow=[{id:V,tooltipTitle:L().text("Table view"),title:L().text("Table"),Icon:iw(V)},{id:B,tooltipTitle:L().text("List view"),title:L().text("List"),Icon:iw(B)}],lw=e=>{let{className:t}=e;const r=ew(),n=(0,xE.useDispatch)(),a=(0,xE.useSelector)(bu);return v().createElement(JC,{className:t,classes:{button:r.button},modes:ow,modeId:a,onChange:e=>{a!==e&&n((e=>({type:ta,payload:e}))(e))}})};lw.propTypes={className:OE().string};const sw=lw;var cw=r(81085),uw=r.n(cw),pw=r(48139),dw=r.n(pw);const mw="DATA_TENANTS_UPDATED",yw=e=>t=>({type:e,payload:t}),fw=(yw(mw),null),gw=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:fw,t=arguments.length>1?arguments[1]:void 0;return t.type===mw?t.payload||fw:e},hw="TENANTS_UPDATED",Ew=(yw(hw),null),bw=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ew,t=arguments.length>1?arguments[1]:void 0;return t.type===hw?t.payload||Ew:e},vw="METADATA_LOADED";let Tw=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 Ow(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){xw(e,t,r[t])}))}return e}function xw(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Sw={},Cw=(0,_.pipe)(x.normalizeMetadata,x.parseMetadata,x.localizeMetadata),ww=(0,_.map)(x.localizeMetadata),Aw=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Sw,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case vw:{const{tenant:r,metadata:n}=t.payload;return Ow({},e,{[r]:Cw(n)})}case Tw.LOCALIZATION_LOADED:return ww(e);default:return e}};let Rw=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.PROFILE_SAVED="PROFILE_SAVED",e}({});const _w=yw(Rw.ADD_ATTRIBUTES),Nw=yw(Rw.ADD_DEFAULT_VALUES),Iw=yw(Rw.MODIFY_ATTRIBUTE),Dw=yw(Rw.REMOVE_ATTRIBUTE),Pw=yw(Rw.ADD_NEXT_PAGE_ATTRIBUTE_VALUES),kw=yw(Rw.PROCESS_NEXT_PAGE_ATTRIBUTE_VALUES),Lw=yw(Rw.REQUEST_NEXT_PAGE_ATTRIBUTE_VALUES),Fw=yw(Rw.SAVE_PROFILE),jw=yw(Rw.SAVE_DRAFT),Uw=yw(Rw.PROFILE_SAVED),Mw=yw(Rw.VALIDATE_PROFILE);let Vw=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 Bw=yw(Vw.DEPENDENT_LOOKUPS_STRUCTURE_SET),zw=yw(Vw.DEPENDENT_LOOKUPS_INITED_TYPE_URIS_ADDED),Hw=yw(Vw.DEPENDENT_LOOKUPS_EDITORS_BLOCKED),Yw=yw(Vw.DEPENDENT_LOOKUPS_EDITOR_TOUCHED);let Ww=function(e){return e.MODE_UPDATED="MODE_UPDATED",e.MODE_CANCEL_EDITING="MODE_CANCEL_EDITING",e.MODE_EDITING_CANCELED="MODE_EDITING_CANCELED",e}({});function Gw(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=n.concat(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 in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Zw={structure:{},editors:{},initedTypeUris:[]},$w="SEARCH_RESULTS_SET",Kw="KEYWORD_UPDATED",Qw="UPDATE_STATE",Xw="ACTIVITY_FILTER_UPDATED",Jw="GLOBAL_FILTER_UPDATED",eA="SEARCH_OPTIONS_UPDATED",tA="SET_SEARCH_OPTIONS_CONFIG",rA="SET_SEARCH_PROVIDER_DATA",nA="SET_SEARCH_NAVIGATION_DATA",aA="UPDATE_SEARCH_NAVIGATION_DATA_FIELDS",iA=yw($w),oA=yw(Kw),lA=yw(Qw),sA=yw("SAVE_STATE"),cA=yw(Xw),uA=yw(Jw),pA=yw(eA),dA=yw(tA),mA=yw(rA),yA=yw(nA),fA=yw(aA),gA=yw("UPDATE_SEARCH_NAVIGATION_DATA_ON_MERGE"),hA=(0,_.path)(["globalFilter","savedSearchesUris"]),EA="searchNavigation";function*bA(){const e=yield(0,Es.Ys)(Ej.selectors.getSearchNavigationData),t=yield(0,Es.Ys)(Ej.selectors.getSearchProviderData);sessionStorage.setItem(EA,JSON.stringify({searchNavigationData:e,searchProviderData:t}))}function*vA(){let e;try{e=JSON.parse(sessionStorage.getItem(EA))||{}}catch(t){e={}}const{searchNavigationData:t,searchProviderData:r}=e;t&&r&&(yield(0,Es.gz)(mA(r)),yield(0,Es.gz)(yA(t)))}const TA=[function*(){yield(0,Es.Fm)([nA,aA,Tw.OPEN_ENTITY],bA)},function*(){yield(0,Es.RE)(vA)}];function OA(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){xA(e,t,r[t])}))}return e}function xA(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const SA={searchResults:[],keyword:null,searchOptions:{searchByOv:!1,ovOnly:!1},activityFilter:"active",globalFilter:{query:null,savedSearchesUris:[],isMuted:!0},searchProviderData:null,searchNavigationData:null},CA=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:SA,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case $w:return OA({},e,{searchResults:t.payload});case Kw:{const r=(0,_.pick)(["value","isRawFilter"],t.payload||{});return OA({},e,{keyword:(0,_.isEmpty)(r)?null:r})}case Qw:return OA({},SA,{keyword:(0,_.isNil)(t.payload.keyword)||(0,_.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 Xw:return OA({},e,{activityFilter:t.payload});case Jw:return OA({},e,{globalFilter:(0,x.isEmptyValue)(t.payload)?SA.globalFilter:t.payload});case eA:return OA({},e,{searchOptions:OA({},e.searchOptions,t.payload)});case tA:{const r=!!t.payload.showSearchByOv;return OA({},e,{searchOptions:{searchByOv:r,ovOnly:r}})}case rA:return OA({},e,{searchProviderData:t.payload});case nA:return OA({},e,{searchNavigationData:t.payload});case aA:return OA({},e,{searchNavigationData:OA({},e.searchNavigationData,t.payload)});case Tw.OPEN_ENTITY:{var r;const n=(0,x.removeDtssPrefixFromEntityUri)(t.payload.uri);return"navigation"===t.payload.source||n===(null===(r=e.searchNavigationData)||void 0===r?void 0:r.uri)?e:OA({},e,{searchNavigationData:null})}default:return e}},wA=e=>{let{uri:t,source:r=null,screen:n="profile"}=e;return{type:Tw.OPEN_ENTITY,payload:{uri:t,source:r,screen:n}}},AA=e=>{let{entity:t}=e;return{type:Tw.NEW_ENTITY_SHOWN,payload:{entity:t}}},RA=yw(Tw.ENTITY_DELETION_FINISHED),_A=yw(Tw.OPEN_PERSPECTIVE),NA=e=>({type:Tw.SHOW_NOTIFICATION,payload:e}),IA=e=>({type:Tw.CLOSE_NOTIFICATION,payload:e}),DA=yw(Tw.CLEAR_NOTIFICATIONS),PA=yw(Tw.PATHS_SET),kA=yw(Tw.UI_PATH_SET),LA=yw(Tw.UI_CONFIG_LOADED),FA=yw(Tw.NEW_UI_CONFIG_LOADED),jA=yw(Tw.LOCALE_ATTRIBUTE_PRESENTATION_LOADED),UA=yw(Tw.AUTOCLOSE_INTERVAL_LOADED),MA=yw(Tw.SET_PREFER_REACT),VA=yw(Tw.NUMBER_FORMAT_UPDATED),BA=(e,t,r)=>({type:Tw.OPEN_CONSOLE_APP,payload:{name:e,path:t,query:r}}),zA=yw(Tw.OPEN_APP_FROM_CHOCOLATE_BAR),HA=yw(Tw.OPEN_GRAPH),YA=yw(Tw.LOCALIZATION_LOADED),WA=yw(Tw.DATE_MASK_UPDATED),GA=yw(Tw.DATE_TIME_MASK_UPDATED),qA=e=>({type:Tw.OPEN_SEARCH,payload:"searchState"in e?e:{searchState:e}}),ZA=e=>({type:Tw.OPEN_DASHBOARD,payload:e}),$A=yw(Tw.OPEN_HISTORY_EVENT),KA=yw(Tw.OPEN_NEW_ENTITY_WITH_AUTHORING),QA=yw(Tw.OPEN_PREVIOUS_PAGE),XA=yw(Tw.NAVIGATE),JA=yw(Tw.KEYS_SET),eR=yw(Tw.OPEN_PIVOTING_PERSPECTIVE),tR=yw(Tw.ERROR_SET),rR=yw(Tw.DOCUMENTATION_SET),nR=yw(Tw.ADD_DASHBOARD_EXTERNAL_VIEW),aR=yw(Tw.SET_USE_SHARED_PREFERENCES);function iR(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){oR(e,t,r[t])}))}return e}function oR(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const lR=(0,_.path)(["paths","imagePath"]),sR=(0,_.path)(["paths","exportPath"]),cR=(0,_.path)(["paths","apiPath"]),uR=(0,_.path)(["paths","uiPath"]),pR=(0,_.path)(["paths","reltioPath"]),dR=(0,_.path)(["paths","dtssPath"]),mR=(0,_.path)(["paths","exportDQPath"]),yR=(0,_.either)((0,_.path)(["newConfig","properties","workflow","path"]),(0,_.path)(["paths","workflowPath"])),fR=(0,_.prop)("paths"),gR=(0,_.path)(["paths","workflowEnvironmentURL"]),hR=(0,_.path)(["paths","collaborationPath"]),ER=(0,_.path)(["paths","imageServicePath"]),bR=(0,_.path)(["paths","dvfPath"]),vR=(0,_.path)(["paths","validationServicePath"]),TR=(0,_.path)(["paths","adminToolsPath"]),OR=(0,_.path)(["paths","mlDqPath"]),xR=(0,Zc.createSelector)((e=>(0,_.path)(["newConfig","properties","attributes","presentation"])(e)),(()=>x.intl.getLocale()),(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return iR({},e,(0,x.getSpecialAttributesPresentation)(e,t))})),SR=(0,_.either)((0,_.path)(["config","com.reltio.plugins.entity.EntityRequestSettings","defaultMaxValues"]),(0,_.path)(["newConfig","properties","entity","maxValuesInResponse"])),CR=(0,_.path)(["numberFormat"]),wR=(0,_.either)((0,_.path)(["newConfig","properties","masks","dateMask"]),(0,_.path)(["dateMask"])),AR=(0,_.path)(["notifications"]),RR=(0,_.either)((0,_.path)(["newConfig","properties","masks","dateTimeMask"]),(0,_.path)(["dateTimeMask"])),_R=(0,_.path)(["newConfig","properties","requestProvider"]),NR=["config","com.reltio.plugins.pivoting.PivotingSettings","pivotingAttributes"],IR=(0,_.chain)((0,_.prop)("attributeTypes")),DR=(0,_.ifElse)((0,_.hasPath)(NR),(0,_.path)(NR),(0,_.pipe)((0,_.pathOr)([],["newConfig","pivoting"]),IR)),PR=(0,_.either)((0,_.path)(["config","com.reltio.plugins.imageattribute.fieldsorder"]),(0,_.path)(["newConfig","properties","image","attributeFieldsOrder"])),kR=(0,_.either)((0,_.path)(["config","com.reltio.plugins.ui.LookupAutocomplete"]),(0,_.path)(["newConfig","properties","lookups","autocomplete"])),LR=(0,_.path)(["keys","googleMapKey"]),FR=(0,_.path)(["keys","icpLicenseKey"]),jR=(0,_.pathOr)("",["documentation","releaseNotes"]),UR=["config","com.reltio.plugins.entity.ValidationServiceLevels","levels"],MR=(0,_.ifElse)((0,_.hasPath)(UR),(0,_.path)(UR),(0,_.path)(["newConfig","properties","validation","levels"])),VR=(0,_.ifElse)((0,_.hasPath)(["config","com.reltio.plugins.entity.Validation","validateReadMode"]),(0,_.path)(["config","com.reltio.plugins.entity.Validation","validateReadMode"]),(0,_.pathOr)(!0,["newConfig","properties","validation","validateReadMode"])),BR=(0,_.pathOr)(!1,["newConfig","properties","validation","validateRelations"]),zR=(0,_.pathOr)(!1,["newConfig","properties","validation","validateReferenceEntityInReadMode"]),HR=(0,_.either)((0,_.path)(["config","com.reltio.plugins.workflow.configuration","enabled"]),(0,_.path)(["newConfig","properties","workflow","enabled"])),YR=(0,_.path)(["error"]),WR=(0,_.path)(["paths","servicesPath"]),GR=(0,_.path)(["newConfig"]),qR=(0,_.path)(["newConfig","layout"]),ZR=(0,_.path)(["newConfig","profile"]),$R=(0,_.pathOr)(!0,["newConfig","properties","showEntityId"]),KR=(0,_.path)(["newConfig","properties","release"]),QR=(0,_.path)(["newConfig","properties","logo"]),XR=(0,_.path)(["newConfig","properties","headerColor"]),JR=(0,_.path)(["newConfig","properties","showSearchByOv"]),e_=(0,_.path)(["newConfig","properties","showAttributeDescription"]),t_=(0,_.path)(["newConfig","properties","attributes","sorting"]),r_=(0,_.path)(["newConfig","properties","profileCheckUpdate"]),n_=(0,_.pathOr)(!1,["newConfig","properties","aiAssistant","enabled"]),a_=(0,_.pathOr)(500,["newConfig","properties","aiAssistant","messagesPerDay"]),i_=(0,_.path)(["newConfig","properties","aiAssistant","skills"]),o_=(0,_.path)(["newConfig","properties","aiAssistant","historyBufferSize"]),l_=(0,_.pathOr)(!1,["newConfig","properties","queryEstimator","enabled"]),s_=(0,_.pathOr)(!1,["newConfig","properties","sharedPreferences","enabled"]);function c_(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=n.concat(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 in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const p_={},d_=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:p_,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Tw.PATHS_SET:return c_({},e,{paths:t.payload});case Tw.UI_PATH_SET:return(0,_.evolve)({paths:(0,_.assoc)("uiPath",t.payload)},e);case Tw.UI_CONFIG_LOADED:return c_({},e,{config:t.payload});case Tw.NEW_UI_CONFIG_LOADED:return c_({},e,{newConfig:t.payload});case Tw.LOCALE_ATTRIBUTE_PRESENTATION_LOADED:return(0,_.evolve)({newConfig:{properties:{attributes:{presentation:(0,_.assoc)(x.LOCALE_ATTRIBUTE_PRESENTATION,t.payload)}}}},e);case Tw.AUTOCLOSE_INTERVAL_LOADED:return c_({},e,{autoCloseInterval:t.payload});case Tw.NUMBER_FORMAT_UPDATED:return c_({},e,{numberFormat:t.payload});case Tw.DATE_MASK_UPDATED:return c_({},e,{dateMask:t.payload});case Tw.DATE_TIME_MASK_UPDATED:return c_({},e,{dateTimeMask:t.payload});case Tw.KEYS_SET:return c_({},e,{keys:t.payload});case Tw.ERROR_SET:return c_({},e,{error:t.payload});case Tw.DOCUMENTATION_SET:return c_({},e,{documentation:t.payload});case Tw.SHOW_NOTIFICATION:return c_({},e,{notifications:[...e.notifications||[],t.payload]});case Tw.CLOSE_NOTIFICATION:return(0,_.evolve)({notifications:(0,_.reject)((0,_.propEq)("id",t.payload))},e);case Tw.CLEAR_NOTIFICATIONS:return c_({},e,{notifications:[]});case Tw.SET_USE_SHARED_PREFERENCES:return c_({},e,{useSharedPreferences:t.payload});default:return e}},m_="USER_UPDATED",y_=(yw(m_),null),f_=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:y_,t=arguments.length>1?arguments[1]:void 0;return t.type===m_?t.payload||y_:e},g_="TENANT_UPDATED",h_="TENANT_NAME_UPDATED",E_=(yw(g_),yw(h_),(0,_.prop)("id")),b_=(0,_.prop)("name");function v_(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){T_(e,t,r[t])}))}return e}function T_(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const O_=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case g_:return v_({},e,{id:t.payload});case h_:return v_({},e,{name:t.payload});default:return e}},x_="ENVIRONMENT_UPDATED",S_="ENVIRONMENT_ALIAS_UPDATED",C_=(yw(x_),yw(S_),(0,_.prop)("id")),w_=(0,_.prop)("alias");function A_(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){R_(e,t,r[t])}))}return e}function R_(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const __=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case x_:return A_({},e,{id:t.payload});case S_:return A_({},e,{alias:t.payload});default:return e}},N_=e=>e.dataTenants,I_=e=>e.tenants,D_=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:OI(e);return e.metadata&&e.metadata[t]},P_=e=>e.tenant,k_=e=>e.environment,L_=e=>e.user,F_=e=>e.ui,j_=e=>e.profile,U_=e=>e.search,M_=e=>bL(j_(e)),V_=e=>DL(j_(e)),B_=e=>PL(j_(e)),z_=(e,t)=>BL(j_(e),t),H_=(e,t,r)=>UL(j_(e),t,r),Y_=(e,t,r)=>ML(j_(e),t,r),W_=(e,t,r)=>jL(j_(e),t,r),G_=(e,t)=>zL(j_(e),t),q_=e=>HL(j_(e)),Z_=(e,t,r)=>VL(j_(e),t,r),$_=e=>SL(j_(e)),K_=e=>TL(j_(e)),Q_=e=>FL(j_(e)),X_=e=>yF(j_(e)),J_=e=>fF(j_(e)),eN=e=>gF(j_(e)),tN=e=>hF(j_(e)),rN=e=>EF(j_(e)),nN=(e,t)=>kL(j_(e),t),aN=(e,t)=>LL(j_(e),t),iN=e=>vL(j_(e)),oN=(e,t)=>bF(j_(e),t),lN=(e,t,r)=>{let{uri:n}=r;return eF(j_(e),t,n)},sN=(e,t,r)=>{let{uri:n}=r;return tF(j_(e),t,n)},cN=(e,t,r)=>rF(j_(e),t,r),uN=e=>lR(F_(e)),pN=e=>cR(F_(e)),dN=e=>sR(F_(e)),mN=e=>uR(F_(e)),yN=e=>pR(F_(e)),fN=e=>ER(F_(e)),gN=e=>TR(F_(e)),hN=e=>xR(F_(e)),EN=e=>CR(F_(e)),bN=e=>SR(F_(e)),vN=e=>(e=>e.autoCloseInterval)(F_(e)),TN=e=>wR(F_(e)),ON=e=>RR(F_(e)),xN=e=>_R(F_(e)),SN=e=>AR(F_(e)),CN=e=>DR(F_(e)),wN=e=>PR(F_(e)),AN=e=>kR(F_(e)),RN=e=>LR(F_(e)),_N=e=>FR(F_(e)),NN=e=>MR(F_(e)),IN=e=>VR(F_(e)),DN=e=>BR(F_(e)),PN=e=>zR(F_(e)),kN=e=>n_(F_(e)),LN=e=>a_(F_(e)),FN=e=>i_(F_(e)),jN=e=>o_(F_(e)),UN=e=>s_(F_(e)),MN=e=>(e=>e.searchResults)(U_(e)),VN=e=>(e=>e.keyword)(U_(e)),BN=e=>x.getActivityFilter(U_(e)),zN=e=>x.getSearchOptions(U_(e)),HN=e=>(e=>e.searchProviderData)(U_(e)),YN=e=>(e=>e.searchNavigationData)(U_(e)),WN=(e,t)=>x.getGlobalSearchRequestOptions(U_(e),t),GN=e=>x.getStringifiedSearchOptions(U_(e)),qN=e=>(e=>e.globalFilter)(U_(e)),ZN=e=>x.getGlobalFilterQuery(U_(e)),$N=e=>hA(U_(e)),KN=e=>wL(j_(e)),QN=e=>YL(j_(e)),XN=e=>WL(j_(e)),JN=e=>GL(j_(e)),eI=e=>OL(j_(e)),tI=(e,t)=>qL(j_(e),t),rI=(e,t)=>ZL(j_(e),t),nI=(e,t)=>$L(j_(e),t),aI=(e,t,r)=>KL(j_(e),t,r),iI=(e,t,r)=>QL(j_(e),t,r),oI=(e,t,r)=>XL(j_(e),t,r),lI=(e,t)=>JL(j_(e),t),sI=e=>lR(F_(e))||cR(F_(e)),cI=e=>(e=>null==e?void 0:e.username)(L_(e)),uI=e=>(e=>null==e?void 0:e.roles)(L_(e)),pI=e=>xL(j_(e)),dI=(e,t)=>nF(j_(e),t),mI=(e,t)=>aF(j_(e),t),yI=(e,t)=>iF(j_(e),t),fI=e=>oF(j_(e)),gI=(e,t,r)=>lF(j_(e),t,r),hI=(e,t)=>sF(j_(e),t),EI=e=>AL(j_(e)),bI=e=>_L(j_(e)),vI=e=>NL(j_(e)),TI=e=>SF(j_(e),YD(e)),OI=e=>E_(P_(e)),xI=e=>b_(P_(e)),SI=e=>C_(k_(e)),CI=e=>w_(k_(e)),wI=e=>dR(F_(e)),AI=e=>mR(F_(e)),RI=e=>yR(F_(e)),_I=e=>fR(F_(e)),NI=e=>gR(F_(e)),II=e=>HR(F_(e)),DI=e=>hR(F_(e)),PI=e=>bR(F_(e)),kI=e=>vR(F_(e)),LI=e=>OR(F_(e)),FI=(0,Zc.createSelector)(L_,OI,x.canUserRegisterConfigEnvironments),jI=(0,Zc.createSelector)(L_,OI,x.canUserCreateWorkflowConfigJar),UI=(0,Zc.createSelector)(L_,OI,x.canUserCreateWorkflowEnvironmentConfigJar),MI=(0,Zc.createSelector)(L_,OI,x.canUserExecuteWorkflowJobs),VI=(0,Zc.createSelector)(L_,OI,x.canUserExecuteWorkflowJobsSyncBusinessProcessData),BI=(0,Zc.createSelector)(L_,OI,x.canUserExecuteWorkflowJobsTerminateProcessInstance),zI=(0,Zc.createSelector)(L_,OI,x.canUserExecuteWorkflowJobsUpdateTasks),HI=(0,Zc.createSelector)(L_,OI,x.canUserExecuteWorkflowJobsValidateTasks),YI=(0,Zc.createSelector)(L_,OI,x.canUserManageWorkflowDefinition),WI=(0,Zc.createSelector)(L_,OI,x.canUserManageWorkflowEnvironmentDefinition),GI=(0,Zc.createSelector)(L_,OI,x.canUserReadWorkflowDataTask),qI=(0,Zc.createSelector)(L_,OI,x.canUserUpdateProcessInstance),ZI=(0,Zc.createSelector)(L_,OI,x.canUserUpdateWorkflowDataTask),$I=(0,Zc.createSelector)(L_,OI,x.canUserViewProcessInstanceSearchQuery),KI=(0,Zc.createSelector)(L_,OI,x.canUserViewWorkflowConfigJar),QI=(0,Zc.createSelector)(L_,OI,x.canUserViewWorkflowDefinition),XI=(0,Zc.createSelector)(L_,OI,x.canUserViewWorkflowEnvironmentConfigJar),JI=(0,Zc.createSelector)(L_,OI,x.canUserViewWorkflowJobs),eD=(0,Zc.createSelector)(L_,OI,x.canUserMakeExport),tD=(0,Zc.createSelector)(L_,OI,x.canUserMakeActivitiesExport),rD=(0,Zc.createSelector)(L_,OI,x.canUserImportEntitiesFromDT),nD=(0,Zc.createSelector)(L_,OI,x.canUserReadEntitiesFromDT),aD=(0,Zc.createSelector)(L_,OI,x.canUserStartProcessInstanceFromQuery),iD=(0,Zc.createSelector)(L_,OI,x.canUserMakeBulkUpdate),oD=(0,Zc.createSelector)(L_,OI,x.canUserDeleteProfiles),lD=(0,Zc.createSelector)(L_,OI,x.canUserOpenDataLoader),sD=(0,Zc.createSelector)(L_,OI,x.canUserGetDQStatistic),cD=(0,Zc.createSelector)(L_,OI,x.canUserReadDVF),uD=(0,Zc.createSelector)(DI,tN,((e,t)=>!!e&&!t)),pD=(0,Zc.createSelector)(RI,II,((e,t)=>!!e&&!!t)),dD=(e,t)=>{var r;return null===(r=IL(j_(e)))||void 0===r?void 0:r.find((0,_.propEq)("id",t))},mD=(e,t)=>Boolean(dD(e,t)),yD=e=>mD(e,x.SidePanelViewId.Workflow),fD=e=>mD(e,x.SidePanelViewId.Discussion),gD=e=>mD(e,x.SidePanelViewId.History),hD=e=>mD(e,x.SidePanelViewId.DB),ED=e=>{var t,r;return null!==(t=null===(r=dD(e,x.SidePanelViewId.DB))||void 0===r?void 0:r.views)&&void 0!==t?t:[]},bD=e=>CL(j_(e)),vD=e=>cF(j_(e)),TD=(e,t)=>uF(j_(e),t),OD=e=>pF(j_(e)),xD=e=>dF(j_(e)),SD=(e,t)=>mF(j_(e),t),CD=e=>YR(F_(e)),wD=(e,t)=>{const r=D_(e),n=KN(e),a=M_(e),{nextEntry:i,inRelations:o=[],outRelations:l=[]}=t,s=n===x.Mode.Editing||n===x.Mode.Suggesting,c=n===x.Mode.Suggesting&&(0,x.isTempUri)(null==a?void 0:a.uri),u=YD(e);if(!s||c&&!u||i||!a)return!1;{const e=(0,x.checkMetadataForUpdate)(n,(0,x.getEntityType)(r,a.type)),t=o.concat(l).map((e=>(0,x.getRelationType)(r,e.uri||e))).some((0,_.both)((0,x.checkMetadataForCreate)(n),(0,x.checkMetadataForUpdate)(n)));return e&&t}},AD=(0,Zc.createSelector)(M_,XN,eN,X_,x.getProfileEntityWithHistoryDiff),RD=(0,Zc.createSelector)(M_,XN,eN,x.getProfileEntityWithoutHistoryDiff),_D=e=>WR(F_(e)),ND=e=>GR(F_(e)),ID=e=>qR(F_(e)),DD=e=>ZR(F_(e)),PD=e=>$R(F_(e)),kD=e=>KR(F_(e)),LD=e=>jR(F_(e)),FD=e=>QR(F_(e)),jD=e=>XR(F_(e)),UD=e=>JR(F_(e)),MD=e=>e_(F_(e)),VD=e=>t_(F_(e)),BD=e=>r_(F_(e)),zD=(e,t)=>((e,t)=>(0,x.getAuthoringItemsFromLayoutByEntityType)(ZR(e),t))(F_(e),t),HD=(e,t)=>((e,t)=>(0,_.path)(["newConfig","properties","cleanse",t])(e))(F_(e),t),YD=e=>{const t=M_(e),r=zD(e,null==t?void 0:t.type);return!(0,x.isEmptyValue)(r)},WD=e=>l_(F_(e));let GD=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}({}),qD=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}({});var ZD=r(51095);const $D=(e,t)=>e.find((0,_.pipe)(x.getRelationUriFromConnection,(0,_.equals)(t))),KD=(e,t)=>(0,_.path)([t,"connections"],e),QD=r.n(ZD)()(KD,((e,t)=>(0,_.path)([t,"drafts"],e)),((e,t,r)=>r),(function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;const{addedConnections:a=[],editedConnections:i=[],removedUris:o=[],ignoredRelationData:l=[]}=r,s=(0,_.pipe)(x.getRelationUriFromConnection,_.equals,(0,_.find)(_.__,o)),c=l.map((e=>e.relationUri)),u=(0,_.pipe)(x.getRelationUriFromConnection,_.equals,(0,_.find)(_.__,c)),p=e=>(0,_.pipe)((0,_.eqBy)(x.getRelationUriFromConnection),(0,_.find)(_.__,i),(0,_.unless)(_.isNil,x.markEdited))(e),d=n?(null===(e=t.find((e=>e.entity.entityUri===n)))||void 0===e?void 0:e.connections)||[]:t,m=a.filter((0,_.propEq)("parentEntityUri",n));return m.map(x.markNew).concat(d.filter((e=>!m.some((0,_.pipe)(x.getRelationUriFromConnection,(0,_.equals)((0,x.getRelationUriFromConnection)(e)))))).map((0,_.pipe)((0,_.either)(p,_.identity),(0,_.when)(s,x.markRemoved),(0,_.when)(u,x.markIgnored))))}))(((e,t,r)=>t+r)),XD=(e,t,r)=>{const n=(0,x.getTempRelations)(e,t);return $D(n,r)};function*JD(e){yield(0,Es.gw)(0);const t=e.payload,r=yield(0,Es.Ys)(D_),n=yield(0,Es.Ys)(vD),a=[t.type],i=yield(0,Es.Ys)(OD),o=(0,x.initDependentLookups)({structure:n,metadata:r,typeUris:a,alreadyAddedTypeUris:i}),l=(0,x.populateDependentLookupsFromEntity)({structure:o,metadata:r,entityOrRelation:t});yield(0,Es.gz)(Bw(l)),yield(0,Es.gz)(zw(a))}function*eP(e,t){const r=(0,x.getBaseUri)(e);return(0,x.isRelationUri)(r)?yield(0,Es.Ys)(Y_,t,r):yield(0,Es.Ys)(nN,r)}function*tP(e){const{attributeType:t,metadata:r,parentUri:n,viewId:a}=e.payload,i=yield(0,Es.RE)(eP,n,a),o=yield(0,Es.Ys)(vD);if(i)if(t){const e=(0,x.findAttributeValuesByTypeUri)(r,i,t.uri).filter((e=>{let{uri:t}=e;return t.startsWith(n)}))[0],a=(0,x.addValueToDependentLookups)({structure:o,attributeValue:e});yield(0,Es.gz)(Bw(a))}else{const e=[i.type],t=yield(0,Es.Ys)(OD),n=(0,x.initDependentLookups)({structure:o,metadata:r,typeUris:e,alreadyAddedTypeUris:t}),a=(0,x.populateDependentLookupsFromEntity)({structure:n,metadata:r,entityOrRelation:i});yield(0,Es.gz)(Bw(a)),yield(0,Es.gz)(zw(e))}}function*rP(e){const t=e.payload,r=yield(0,Es.Ys)(D_),n=yield(0,Es.Ys)(vD);let a=n;for(const e of t){const{attributeType:t,parentUri:i,viewId:o}=e;if((0,x.isAttributeTypeInDependentLookups)(n,t.uri)){const e=yield(0,Es.RE)(eP,i,o);e&&(a=(0,x.syncAttributeTypeWithDependentLookups)({structure:a,entityOrRelation:e,attrTypeUri:t.uri,metadata:r}))}}a!==n&&(yield(0,Es.gz)(Bw(a)))}function*nP(e){let{structure:t,attributeType:r,value:n}=e;if((0,x.isReference)(r)&&n){const e=(0,x.getReferencedEntityUriFromAttrValue)(n);if((0,x.isTempUri)(e))return yield(0,Es.RE)(lP,t,e)}return t}function*aP(e){let{structure:t,uri:r,attributeType:n,value:a}=e,i=(0,x.removeValuesFromDependentLookups)({structure:t,uri:r});if(i=yield(0,Es.RE)(nP,{structure:i,attributeType:n,value:a}),i=(0,x.addValueToDependentLookups)({structure:i,attributeValue:a}),(0,x.isReference)(n)&&a){const e=(0,x.getReferencedEntityUriFromAttrValue)(a);(0,x.isTempUri)(e)&&(i=yield(0,Es.RE)(oP,i,e))}i!==t&&(yield(0,Es.gz)(Bw(i)))}function*iP(e){yield(0,Es.gw)(0);const{attributeType:t,uri:r,viewId:n,silent:a,value:i}=e.payload,o=yield(0,Es.Ys)(vD),l=yield(0,Es.RE)(eP,r,n);if(l&&(0,x.isAttributeTypeInDependentLookups)(o,t.uri)){const{value:n,lookupCode:i}=e.payload.value,l=i||n;a||(yield(0,Es.rM)(uP,o,{type:t.uri,uri:r,lookupValue:l}));const s=(0,x.addValueToDependentLookups)({structure:o,attributeValue:{type:t.uri,value:l,uri:r}});yield(0,Es.gz)(Bw(s))}l&&(0,x.isComplexAttribute)(t.type)&&(yield(0,Es.RE)(aP,{structure:o,uri:r,attributeType:t,value:i}))}function*oP(e,t){const r=yield(0,Es.Ys)(D_),n=yield(0,Es.Ys)(nN,t);if(!n)return e;const a=yield(0,Es.Ys)(iN),i=(0,x.findRelatedTemporaryEntities)(a,n);let o=e;for(const e of[n,...i])o=(0,x.populateDependentLookupsFromEntity)({structure:o,metadata:r,entityOrRelation:e});return o}function*lP(e,t){const r=yield(0,Es.Ys)(nN,t),n=yield(0,Es.Ys)(iN),a=(0,x.findRelatedTemporaryEntities)(n,r).map((0,_.prop)("uri"));let i=e;for(const e of[t,...a])i=(0,x.removeValuesFromDependentLookups)({structure:i,uri:e});return i}function*sP(e){const{attributeType:t,uri:r,attributeValue:n,viewId:a}=e.payload,i=yield(0,Es.Ys)(vD),o=(0,x.isAttributeTypeInDependentLookups)(i,t.uri);if(yield(0,Es.RE)(eP,r,a)){o&&(yield(0,Es.rM)(uP,i,{type:t.uri,uri:r,lookupValue:""}));let e=o||(0,x.isComplexAttribute)(t)?(0,x.removeValuesFromDependentLookups)({structure:i,uri:r}):i;e=yield(0,Es.RE)(nP,{structure:e,attributeType:t,value:n}),e!==i&&(yield(0,Es.gz)(Bw(e)))}}function*cP(e){yield(0,Es.gw)(0);const t=yield(0,Es.Ys)(vD),r=yield(0,Es.RE)(lP,t,e.payload);yield(0,Es.gz)(Bw(r))}function*uP(e,t){const r=yield(0,Es.Ys)(D_),n=yield(0,Es.Ys)(iN),a=yield(0,Es.Ys)(nI),i=yield(0,Es.Ys)(V_),o=yield(0,Es.Ys)(AN),l=yield(0,Es.Ys)(xD),s=(0,x.getDependentLookupStateForValueUri)({structure:e,typeUri:t.type,valueUri:t.uri,modifiedEntities:n,connections:a,entityUri:i,config:o,editorsState:l});if(s.length>0){const e=s.map((e=>e.uri));yield(0,Es.gz)(Hw({uris:e,isBlocked:!0}));try{const e=yield(0,Es.RE)(x.cascadeUpdate,s,t);for(const n of e){const{type:e,uri:a,lookupValue:i,displayName:o}=n,l=(yield(0,Es.Ys)(lI,(0,x.getBaseUri)(a)))[0],s=yield(0,Es.RE)(eP,a,l);s&&(0,x.findAttributeValueByUri)(s,a)&&a!==t.uri&&(yield(0,Es.gz)(Iw({attributeType:(0,x.findAttributeTypeByUri)(r,e),uri:a,value:{value:o||"",lookupCode:i||""},silent:!0,viewId:l})))}}catch(e){console.warn(e)}yield(0,Es.gz)(Hw({uris:e,isBlocked:!1}))}}function*pP(e){const t=e.payload.connection,r=(0,x.getEntityUriFromConnection)(t);if((0,x.isTempUri)(r)&&(yield(0,Es.Ys)(nN,r))){yield(0,Es.qn)(Vw.DEPENDENT_LOOKUPS_STRUCTURE_SET);const e=yield(0,Es.Ys)(vD),t=yield(0,Es.RE)(oP,e,r);yield(0,Es.gz)(Bw(t))}}function*dP(e){const t=e.payload.relationUri,r=yield(0,Es.Ys)(vD),n=(0,x.removeValuesFromDependentLookups)({structure:r,uri:t});yield(0,Es.gz)(Bw(n))}function*mP(e){const t=e.payload.id,r=e.payload.relationUri;if(0===(yield(0,Es.Ys)(lI,r)).length){const e=yield(0,Es.Ys)(vD);let n=(0,x.removeValuesFromDependentLookups)({structure:e,uri:r});const a=yield(0,Es.Ys)(W_,t),i=$D(a,r),o=(0,x.getEntityUriFromConnection)(i);(0,x.isTempUri)(o)&&(n=yield(0,Es.RE)(lP,n,o)),yield(0,Es.gz)(Bw(n))}}const yP=[function*(){yield(0,Es.ib)(GD.MODIFIED_ENTITY_CREATED,JD)},function*(){yield(0,Es.ib)(GD.MODIFIED_ENTITY_DELETED,cP)},function*(){yield(0,Es.ib)(Rw.ADD_DEFAULT_VALUES,tP)},function*(){yield(0,Es.ib)(Rw.ADD_ATTRIBUTES,rP)},function*(){yield(0,Es.ib)(Rw.MODIFY_ATTRIBUTE,iP)},function*(){yield(0,Es.ib)(Rw.REMOVE_ATTRIBUTE,sP)},function*(){yield(0,Es.ib)(qD.OPEN_RELATION_EDITOR,pP)},function*(){yield(0,Es.ib)(qD.SET_RELATION_TYPE,dP)},function*(){yield(0,Es.ib)(qD.CLOSE_RELATION_EDITOR,mP)}];let fP=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}({});const gP=(e,t)=>({type:fP.ENTITY_LOADED,payload:{entity:e,keepErrors:t}}),hP=yw(fP.DEFAULT_PROFILE_PIC_SET),EP=yw(fP.LOAD_ENTITY),bP=yw(fP.ENTITY_CREATION_REQUESTED),vP=yw(fP.ENTITY_CREATION_WITH_AUTHORING_REQUESTED),TP=yw(fP.ENTITY_AUTHORING_DRAFT_ENTITIES_LOADED),OP=yw(fP.ENTITY_REMOVE_REQUESTED),xP=yw(fP.CLONE_ENTITY),SP=yw(fP.CLEAR_ENTITY),CP=e=>null==e?void 0:e.uri,wP=(0,Zc.createSelector)((e=>null==e?void 0:e.dataTenant),CP,((e,t)=>(0,x.getEntityUriForLink)({dataTenant:e,uri:t})));function AP(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){RP(e,t,r[t])}))}return e}function RP(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const _P={};let NP=function(e){return e.ERRORS_SET="ERRORS_SET",e.REMOVE_ERROR="REMOVE_ERROR",e.ERROR_DEACTIVATED="ERROR_DEACTIVATED",e}({});const IP=yw(NP.ERROR_DEACTIVATED),DP=yw(NP.ERRORS_SET);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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){kP(e,t,r[t])}))}return e}function kP(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const LP=[];let FP=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 jP=yw(FP.HISTORY_DIFF_SET),UP=yw(FP.HISTORY_DIFF_CLEARED),MP=yw(FP.HISTORY_EVENT_SET),VP=yw(FP.HISTORY_EVENT_CLEARED),BP=yw(FP.HISTORY_SLICE_SET),zP=yw(FP.HISTORY_MODE_SET);function HP(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){YP(e,t,r[t])}))}return e}function YP(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const WP={mode:x.HistoryMode.Current};let GP=function(e){return e.PROFILE_LAST_LOADED_TIME_UPDATE="PROFILE_LAST_LOADED_TIME_UPDATE",e}({});yw(GP.PROFILE_LAST_LOADED_TIME_UPDATE);let qP=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 ZP=yw(qP.LOOKUPS_LOADED),$P=yw(qP.LOOKUPS_FOR_TYPE_RESOLVED),KP=yw(qP.LOOKUPS_LIST_RESOLVED);function QP(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=n.concat(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 in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const JP={},ek=(e,t)=>({type:Ww.MODE_UPDATED,payload:{mode:e,silent:t}}),tk=yw(Ww.MODE_CANCEL_EDITING),rk=yw(Ww.MODE_EDITING_CANCELED),nk=x.isSuggestMode,ak=(x.isEditMode,x.isViewMode),ik=x.isEditableMode,ok=x.Mode.Viewing,lk=yw(GD.MODIFIED_ENTITY_CREATED),sk=yw(GD.MODIFIED_ENTITY_DELETED),ck=yw(GD.MODIFIED_ENTITY_DEFAULT_PROFILE_PIC_SET),uk=yw(GD.MODIFIED_ENTITIES_RESET),pk=yw(GD.CLEANSE_LOADING);function dk(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){mk(e,t,r[t])}))}return e}function mk(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const yk={};function fk(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){gk(e,t,r[t])}))}return e}function gk(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*hk(e){const{values:t,parentUri:r,attributeTypeUri:n,attributeTypeName:a}=e.payload;let i=t;const o=yield(0,Es.Ys)(M_);if(r===o.uri){const e=(0,x.getAttributeSource)(n),r=(0,_.pipe)((0,_.pathOr)([],[e,a]),(0,_.map)((0,_.prop)("uri")))(o),l=(0,_.intersection)(r,t.map((0,_.prop)("uri")));i=t.filter((e=>!l.includes(e.uri)))}i.length&&(yield(0,Es.gz)(Pw(fk({},e.payload,{values:i}))))}function*Ek(){return{apiPath:yield(0,Es.Ys)(pN),tenant:yield(0,Es.Ys)(OI)}}function*bk(e){const{attributeTypeName:t,attributeTypeUri:r}=e.payload,n=yield(0,Es.RE)(Ek);try{const a=yield(0,Es.RE)(x.getPagedEntity,fk({},e.payload,n)),i=(0,x.getAttributeSource)(r),o=(0,_.pathOr)([],[i,t],a);yield(0,Es.gz)(kw(fk({},e.payload,{values:o})))}catch(e){console.warn(e),yield(0,Es.gz)(tR((0,x.getRequestErrorMessage)(e,L().text("Something went wrong"))))}}function*vk(e){var t;const{attributeType:r,value:n,uri:a}=e.payload,i=r.uri,o=(0,x.getBaseUri)(i),l=yield(0,Es.Ys)(HD,o);if(!l)return;const s=yield(0,Es.Ys)(D_),c=(0,x.getEntityType)(s,o),u=null==c||null===(t=c.cleanseConfig)||void 0===t?void 0:t.infos;if(!u)return;const p=(0,x.getCleanseType)(l,i);if(!(0,x.hasCleanseTypeInEntityType)(p,u))return;const d=(0,x.getCleanseAttributes)(l);if(null!=d&&d.includes(i)){yield(0,Es.gz)(pk({isLoading:!0}));try{const e=yield(0,Es.RE)(x.cleanseData,{cleanseType:p.split("/cleanse/infos/")[1],type:o,attributes:{[r.name]:[{type:i,value:n}]}}),t=(0,x.getBaseUri)(a),l=yield(0,Es.Ys)(nN,t);if((0,x.hasCleanseStatus)(e))if((0,x.isUnverifiedCleanse)(e))yield(0,Es.gz)(tR((0,_.path)(x.CLEANSE_STATUS_ERROR_PATH,e)));else if(l){const{attributes:r}=e,n=(0,x.prepareCleansedAttributes)(t,r);yield(0,Es.gz)(lk(fk({},l,{attributes:fk({},l.attributes,n)})))}}catch(e){console.warn(e),yield(0,Es.gz)(tR((0,x.getRequestErrorMessage)(e,L().text("Something went wrong"))))}yield(0,Es.gz)(pk({isLoading:!1}))}}const Tk=[function*(){yield(0,Es.ib)(Rw.REQUEST_NEXT_PAGE_ATTRIBUTE_VALUES,bk)},function*(){yield(0,Es.ib)(Rw.PROCESS_NEXT_PAGE_ATTRIBUTE_VALUES,hk)},function*(){yield(0,Es.ib)(Rw.MODIFY_ATTRIBUTE,vk)}],Ok=yw(qD.RELATIONS_LOADED),xk=yw(qD.SECOND_LEVEL_RELATIONS_LOADED),Sk=(0,_.curry)(((e,t)=>({type:qD.REMOVE_RELATION,payload:{id:e,relationUri:t}}))),Ck=(0,_.curry)(((e,t)=>({type:qD.IGNORE_RELATION,payload:{id:e,ignoredRelationData:t}}))),wk=(0,_.curry)(((e,t)=>({type:qD.ADD_RELATION,payload:{id:e,connection:t}}))),Ak=(0,_.curry)(((e,t)=>({type:qD.EDIT_RELATION,payload:{id:e,connection:t}}))),Rk=(0,_.curry)(((e,t)=>({type:qD.OPEN_RELATION_EDITOR,payload:{id:e,connection:t}}))),_k=(0,_.curry)(((e,t)=>({type:qD.CLOSE_RELATION_EDITOR,payload:{id:e,relationUri:t}}))),Nk=(0,_.curry)(((e,t,r)=>({type:qD.SET_RELATION_TYPE,payload:{id:e,relationUri:t,relationType:r}}))),Ik=(0,_.curry)(((e,t,r)=>({type:qD.SET_RELATION_ENTITY,payload:{id:e,relationUri:t,entityInfo:r}}))),Dk=(0,_.curry)(((e,t,r)=>({type:qD.SET_INITIAL_INFO,payload:{id:e,relationUri:t,tempEntity:r}})));function Pk(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){kk(e,t,r[t])}))}return e}function kk(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Lk={},Fk={removedUris:[],addedConnections:[],editedConnections:[],ignoredRelationData:[]},jk=(e,t,r)=>{if((0,_.pathEq)([...(0,x.getRelationToAddPath)(e),"relation","relationUri"],t,r))return(0,x.getRelationToAddPath)(e);{const n=((0,_.path)((0,x.getRelationsToEditPath)(e),r)||[]).findIndex((0,_.pathEq)(["relation","relationUri"],t));return n>=0?[...(0,x.getRelationsToEditPath)(e),n]:null}},Uk=(e,t,r)=>{const n=jk(e,t,r);return n?(0,_.lensPath)([...n,"relation"]):null},Mk=(0,_.pipe)(Uk,(e=>(0,_.compose)(e,(0,_.lensProp)("object"))));let Vk=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}({});yw(Vk.TREE_LOADED),yw(Vk.TREE_LOADED_WITH_ERROR),yw(Vk.TREE_LOADING),yw(Vk.TREE_SCROLL_TO_NODE_RESET);const Bk=yw(Vk.TREE_COMMANDS_CLEARED),zk=(yw(Vk.TREE_CHILDREN_LOADING),yw(Vk.TREE_CURRENT_ENTITY_SHOWN),yw(Vk.TREE_REFRESHED),yw(Vk.TREE_NODE_EXPANDED),yw(Vk.TREE_RELATION_REMOVED),yw(Vk.TREE_NODE_REMOVED),yw(Vk.TREE_SECONDARY_LABEL_SHOWN),yw(Vk.TREE_ENTITIES_MAPPING_LOADED),yw(Vk.TREE_CHANGED)),Hk=(yw(Vk.TREE_NODE_EDITED),yw(Vk.TREE_ACTIVENESS_DATE_CHANGED),yw(Vk.TREE_RELATION_REPOINTED),yw(Vk.TREE_RELATION_CREATED),yw(Vk.TREE_NODE_CREATED),yw(Vk.TREE_RELATION_EDITED),yw(Vk.TREE_NODE_EDITED),yw(Vk.TREE_NODE_EDITING_STARTED),yw(Vk.TREE_NODE_EDITING_APPLIED),yw(Vk.TREE_NODE_EDITING_CANCELED),yw(Vk.TREE_NODE_NEW_PARENT_EDITING_STARTED),yw(Vk.TREE_NODE_NEW_PARENT_EDITING_APPLIED),yw(Vk.TREE_NODE_NEW_PARENT_EDITING_CANCELED),yw(Vk.TREE_NODE_NEW_CHILD_EDITING_STARTED),yw(Vk.TREE_NODE_NEW_CHILD_EDITING_APPLIED),yw(Vk.TREE_NODE_NEW_CHILD_EDITING_CANCELED),yw(Vk.TREE_NODE_RELATION_TYPE_CHANGED),yw(Vk.TREE_NODE_ENTITY_CHANGED),yw(Vk.TREE_SORTED),yw(Vk.TREES_STATE_SAVED),yw(Vk.TREES_STATE_RESTORED),yw(Vk.TREE_CHILDREN_LOADED),yw(Vk.TREES_RESTORE_FROM_INITIAL_TREES)),Yk=yw(Vk.TREES_RESET_INITIAL_TREES),Wk=(yw(Vk.TREE_CANCEL_CHILDREN_LOADING),(0,_.path)(["common","commands"]));var Gk=r(76665);function qk(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Zk(e,t,r[t])}))}return e}function Zk(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const $k=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[];if((0,_.path)(["entity","uri"],e)===t)return r.forEach((e=>e.expanded=!0)),e;if(e.children)for(const n of e.children){const a=$k(n,t,r.concat(e));if(a)return a}},Kk=(e,t)=>{const r=Object.keys(e).reduce(((r,n)=>{const a=e[n];return t[n]&&(a.parent=(0,_.uniq)([].concat(a.parent).concat(t[n].parent).filter(_.identity))),r[n]=a,r}),{});return Object.keys(t).forEach((e=>{r[e]||(r[e]=t[e])})),r},Qk=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const r=(0,_.reject)((0,_.prop)("loading")),n=r(e);return t.forEach((t=>{e.find((e=>(0,_.path)(["entity","uri"],e)===t.entity.uri))||n.push(t)})),n},Xk=(e,t)=>{if(e&&e.children){const r=e.children.findIndex((e=>{let{nodeId:r}=e;return r===t}));r>-1&&e.children.splice(r,1)}},Jk=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;e&&e.children&&e.children.splice(r,0,t)},eL=e=>{let{path:t,value:r,object:n}=e,a=n;for(let e=0;e<t.length;e++){const n=t[e];e===t.length-1?a[n]="function"==typeof r?r(a[n]):r:(a[n]=a[n]||("number"==typeof n?[]:{}),a=a[n])}},tL=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;e[t]=r,e.children&&e.children.forEach((e=>tL(e,t,r)))},rL=e=>({entity:e.entity,relation:e.relation}),nL=e=>{let{id:t,draft:r,node:n}=e;eL({path:["editingConnections",n.relation.uri],object:r[t],value:rL(n)})},aL=e=>{let{id:t,draft:r,node:n,entity:a}=e;eL({path:["editingConnections",n.relation.uri,"entity"],object:r[t],value:a})},iL=e=>{let{id:t,draft:r,node:n,relationTypeUri:a}=e;eL({path:["editingConnections",n.relation.uri,"relation"],object:r[t],value:e=>qk({},e,{type:a,attributes:{}})})},oL=e=>{let{id:t,draft:r,relationUri:n}=e;delete r[t].editingConnections[n]},lL=e=>{let{id:t,draft:r,relationUri:n}=e;return r[t].editingConnections[n]},sL=e=>{delete e.editingMode,delete e.relatedEntity,delete e.initialConnection},cL=e=>{let{id:t,draft:r,currentNode:n}=e;const a=r[t].root;if(a===n)r[t].root=n.children[0],r[t].root.children=r[t].root.children||[],r[t].root.children.push(...n.children.slice(1));else{const e=(0,x.findParentNodeById)(a,n.nodeId);Xk(e,n.nodeId)}},uL=(e,t,r)=>{const n=[e,"editingConnections",t,"relation"];return(0,_.path)(n,r)?(0,_.lensPath)(n):null},pL=(0,_.pick)(["showSecondaryLabel","sortField","sortOrder"]),dL=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return Kk(e,t.reduce(((e,t)=>qk({},e,{[t.entity.uri]:(0,_.pick)(["entity","parent","relations"],t)})),{}))},mL=e=>({entity:(0,_.pick)(["uri","type","label","secondaryLabel"],e.entity),parent:[],relations:[(0,_.pick)(["uri","type"],e.relation)]});function yL(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=n.concat(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 in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const gL={common:{commands:[]},trees:{},initialTrees:{}};let hL=function(e){return e.ENTITY_RELATED_ATTRIBUTES_ADDED="ENTITY_RELATED_ATTRIBUTES_ADDED",e}({});yw(hL.ENTITY_RELATED_ATTRIBUTES_ADDED);const EL={},bL=e=>e.entity,vL=e=>e.modifiedEntities,TL=e=>e.errors,OL=e=>e.relations,xL=e=>e.trees,SL=e=>e.lookups,CL=e=>e.dependentLookups,wL=e=>e.mode,AL=e=>e.lastLoadedTime,RL=e=>e.history,_L=e=>e.operation,NL=e=>e.views,IL=e=>e.sidePanelViews,DL=e=>CP(bL(e)),PL=e=>wP(bL(e)),kL=(e,t)=>((e,t)=>t&&e[t])(vL(e),t),LL=(e,t)=>((e,t)=>t&&e[t]&&e[t].defaultProfilePic)(vL(e),t),FL=e=>(0,_.keys)(OL(e)),jL=(e,t,r)=>QD(OL(e),t,r),UL=(e,t,r)=>XD(OL(e),t,r),ML=(e,t,r)=>((e,t,r)=>{const n=XD(e,t,r);return(0,x.getRelationObjectFromConnection)(n)})(OL(e),t,r),VL=(e,t,r)=>((e,t,r)=>{const n=(0,_.pipe)((0,_.pathOr)([],[t,"drafts","addedConnections"]),(0,_.filter)((0,_.pipe)(x.getRelationUriFromConnection,x.isTempUri)),(0,_.when)((0,_.always)(r),(0,_.filter)((0,_.propEq)("parentEntityUri",r))),_.length)(e);return((e,t,r)=>r?(0,_.pipe)((0,_.path)([t,"connections"]),(0,_.find)((e=>{let{entity:t}=e;return t.entityUri===r})),(0,_.pathOr)(0,["total"]))(e):(0,_.pathOr)(0,[t,"total"],e))(e,t,r)+n})(OL(e),t,r),BL=(e,t)=>KD(OL(e),t),zL=(e,t)=>x.getDraftsForSaveByViewId(OL(e),t),HL=e=>(e=>(0,_.keys)(e).reduce(((t,r)=>{const{addedConnections:n,editedConnections:a}=(0,x.getDraftsForSaveByViewId)(e,r);return(0,_.pipe)(_.concat,(0,_.map)(x.getEntityUriFromConnection),(0,_.filter)(x.isTempUri),(0,_.concat)(t))(n,a)}),[]))(OL(e)),YL=e=>ik(wL(e)),WL=e=>ak(wL(e)),GL=e=>nk(wL(e)),qL=(e,t)=>x.getRelationToAddByViewId(OL(e),t),ZL=(e,t)=>x.getRelationsToEditByViewId(OL(e),t),$L=(e,t)=>x.getAllRelationsToAddAndEdit(OL(e),t),KL=(e,t,r)=>x.getAllRelationsToSave(OL(e),t,r),QL=(e,t,r)=>x.getInitialConnectionTempEntity(e.relations,t,r),XL=(e,t,r)=>x.getInitialConnection(e.relations,t,r),JL=(e,t)=>((e,t)=>Object.keys(e).filter((r=>{const n=(0,x.getTempRelations)(e,r);return!!$D(n,t)})))(OL(e),t),eF=(e,t,r)=>((e,t,r)=>(0,_.pipe)((0,_.filter)((0,_.allPass)([(0,_.propEq)("parentUri",t),(0,_.propEq)("attributeTypeUri",r),(0,_.pipe)((0,_.prop)("uri"),_.isEmpty)])),(0,_.map)((0,_.prop)("message")),(0,_.join)(". "))(e))(TL(e),t,r),tF=(e,t,r)=>((e,t,r)=>(0,_.filter)((0,_.allPass)([(0,_.propEq)("parentUri",t),(0,_.propEq)("attributeTypeUri",r),(0,_.pipe)((0,_.prop)("uri"),_.isEmpty,_.not)]))(e))(TL(e),t,r),rF=(e,t,r)=>x.getCachedActiveErrorsForAttributesPager(TL(e),t,r),nF=(e,t)=>((e,t)=>e.trees[t])(xL(e),t),aF=(e,t)=>((e,t)=>(0,_.path)(["trees",t,"root"],e))(xL(e),t),iF=(e,t)=>((e,t)=>(0,_.path)(["trees",t,"total"],e))(xL(e),t),oF=e=>Wk(xL(e)),lF=(e,t,r)=>((e,t,r)=>(0,_.path)(["trees",t,"editingConnections",r],e))(xL(e),t,r),sF=(e,t)=>((e,t)=>(0,_.pipe)((0,_.prop)("trees"),(0,_.when)((0,_.always)(t),(0,_.pick)(t)),_.values,(0,_.map)((0,_.pipe)((0,_.prop)("editingConnections"),_.values)),_.flatten,(0,_.reject)(_.isNil))(e))(xL(e),t),cF=e=>(e=>e.structure)(CL(e)),uF=(e,t)=>x.getDependentLookupsStructureNode(CL(e),t),pF=e=>(e=>e.initedTypeUris)(CL(e)),dF=e=>(e=>e.editors)(CL(e)),mF=(e,t)=>x.getDependentLookupEditorState(CL(e),t),yF=e=>(e=>e.diff)(RL(e)),fF=e=>(e=>e.event)(RL(e)),gF=e=>(e=>e.slice)(RL(e)),hF=e=>(e=>!(0,x.isEmptyValue)(e.slice))(RL(e)),EF=e=>(e=>e.mode)(RL(e)),bF=(e,t)=>((e,t)=>e[t])((e=>e.entityRelatedAttributes)(e),t),vF=(0,Zc.createSelector)(bL,(e=>kL(e,DL(e))),((e,t)=>!(!e||!t||(0,x.isEmptyValue)((0,x.collectAllDiffs)(e,t,!0))))),TF=(0,Zc.createSelector)(xL,(e=>{const t=Wk(e),r=(0,x.getNotAppliedTreeCommands)((0,_.reject)((0,_.propSatisfies)(x.isEmptyValue,"root"),e.trees));return!(0,x.isEmptyValue)(t)||!(0,x.isEmptyValue)(r)})),OF=(0,Zc.createSelector)(OL,(e=>(0,_.keys)(e).reduce(((t,r)=>t||!(0,_.all)(x.isEmptyValue)((0,_.values)(x.getDraftsForSaveByViewId(e,r)))),!1))),xF=(0,Zc.createSelector)(vF,OF,TF,((e,t,r)=>e||t||r)),SF=(0,Zc.createSelector)(wL,bL,xF,((e,t)=>t),((e,t,r,n)=>!(e===x.Mode.Viewing||!t)&&((0,x.isTempUri)(t.uri)&&!n||r)));let CF=function(e){return e.PROFILE_OPERATION_UPDATE="PROFILE_OPERATION_UPDATE",e}({});const wF=yw(CF.PROFILE_OPERATION_UPDATE),AF=e=>{let{metadata:t,modifiedEntities:r,connections:n=[],errors:a}=e;return a.filter((e=>{let{attributeType:t,type:r}=e;return t&&!(0,x.isRequired)(t)&&r===x.ErrorType.missed})).filter((e=>{let{attributeType:a,parentUri:i}=e;const o=(0,x.getBaseUri)(i),l=(0,x.isEntityUri)(i)?r[o]:(0,x.findConnectionRelationObjectByRelationUri)(n,o),s=l&&(0,x.findAttributeValuesByTypeUri)(t,l,a.uri,!0);return null==s?void 0:s.some((e=>{let{parent:t,attrValues:r}=e;return t.uri===i&&0===r.length}))})).map((e=>{let{attributeType:t,parentUri:r}=e;return{attributeType:t,parentUri:r}}))},RF=e=>(0,x.getProfileViewsIdsByTypes)(e,[x.ProfileViewType.Relations,x.ProfileViewType.RelationsTable]);function _F(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){NF(e,t,r[t])}))}return e}function NF(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*IF(){const e=yield(0,Es.Ys)(Ej.selectors.getEntity),t=yield(0,Es.Ys)(Ej.selectors.getMode),r=yield(0,Es.Ys)(Ej.selectors.getEntityUri),n=yield(0,Es.Ys)(Ej.selectors.getMetadata),a=yield(0,Es.Ys)(Ej.selectors.getModifiedEntity,r),i=yield(0,Es.Ys)(Ej.selectors.getModifiedEntities),o=yield(0,Es.Ys)(Ej.selectors.getProfileViews);return{entity:e,modifiedEntity:t===x.Mode.Viewing?e:a,entityUri:r,metadata:n,modifiedEntities:t===x.Mode.Viewing?{[r]:e}:i,profileViews:o,mode:t}}function*DF(){return _F({},yield(0,Es.RE)(IF),{validationServicePath:yield(0,Es.Ys)(Ej.selectors.getValidationServicePath),tenant:yield(0,Es.Ys)(Ej.selectors.getTenant),severity:yield(0,Es.Ys)(Ej.selectors.getValidationServiceSeverityLevels)})}function*PF(){const{entityUri:e,metadata:t,modifiedEntities:r,modifiedEntity:n,profileViews:a}=yield(0,Es.RE)(IF),i=RF(a),o=(0,x.getProfileViewsIdsByTypes)(a,[x.ProfileViewType.HierarchyTree]),l=yield(0,Es.Ys)(aI,i,!0),s=yield(0,Es.Ys)(Ej.selectors.getRelations),c=yield(0,Es.Ys)(Ej.selectors.getAllTreesEditingConnections,o);return[...(0,x.validateEntityLocally)(t,r,n,(0,x.isAvailableAttributeTypeForProfile)(a)),...l.flatMap((e=>(0,x.validateConnection)(t,r,e))),...c.flatMap((e=>(0,x.validateHierarchyConnection)(t,e)))].map((n=>_F({},n,{path:(0,x.evaluateErrorPath)({entityUri:e,metadata:t,connections:l,entitiesMap:r,relationsState:s,relationViewsIds:i},n.uri||n.parentUri)})))}function*kF(){const{entityUri:e,metadata:t,modifiedEntity:r,mode:n,validationServicePath:a}=yield(0,Es.RE)(DF);if(a&&(0,x.shouldUseValidationService)(t,r.type)){const r=yield(0,Es.RE)((0,x.isTempUri)(e)?FF:jF),{modifiedEntities:a}=yield(0,Es.RE)(IF),i=(0,_.pipe)(x.convertValidationServiceErrors,(0,_.uniqBy)(x.getErrorUniqKey))(r,{entityUri:e,metadata:t,entitiesMap:a});if(n!==x.Mode.Viewing){const e=AF({metadata:t,modifiedEntities:a,errors:i});e.length&&(yield(0,Es.gz)(_w(e)))}return i}return[]}function LF(e){return console.warn("Validation service error",e),[]}function*FF(){const{mode:e,modifiedEntity:t,modifiedEntities:r,validationServicePath:n,tenant:a,severity:i}=yield(0,Es.RE)(DF),o=(0,x.prepareEntityForValidation)(t,r);try{return yield(0,Es.RE)(x.validateEntity,{validationServicePath:n,entity:o,tenant:a,severity:i,options:(0,_.reject)(_.isNil,[x.ValidationServiceOption.preserveURIs,e===x.Mode.Editing?x.ValidationServiceOption.validateDataPermissions:null])})}catch(e){return LF(e)}}function*jF(){var e;const{entityUri:t,mode:r,entity:n,modifiedEntity:a,modifiedEntities:i,validationServicePath:o,metadata:l,tenant:s,severity:c}=yield(0,Es.RE)(DF),u=yield(0,Es.Ys)(Ej.selectors.getValidateReferenceEntityInReadMode),p=(0,x.getEntityType)(l,n.type),d=null===(e=null==p?void 0:p.forceOvForUiUpdates)||void 0===e||e,m=r===x.Mode.Viewing?[]:(0,x.collectDiffForValidation)(n,a,i,d);try{return yield(0,Es.RE)(x.validateEntityChanges,{validationServicePath:o,uri:t,diff:m,tenant:s,severity:c,options:(0,_.reject)(_.isNil,[x.ValidationServiceOption.preserveURIs,x.ValidationServiceOption.updateAttributeUpdateDates,r===x.Mode.Editing?x.ValidationServiceOption.validateDataPermissions:null,r===x.Mode.Viewing&&u?x.ValidationServiceOption.validateReferenceEntityAttribute:null])})}catch(e){return LF(e)}}function*UF(){const{entityUri:e,metadata:t,mode:r,modifiedEntity:n,modifiedEntities:a,validationServicePath:i,tenant:o,severity:l,profileViews:s}=yield(0,Es.RE)(DF),c=yield(0,Es.Ys)(Ej.selectors.getValidateRelations);if(i&&c){const c=RF(s),u=(yield(0,Es.Ys)(aI,c)).filter((e=>(0,x.shouldUseValidationService)(t,e.relation.relationType)));if(u.length>0){let s=[];const p=(0,x.prepareConnectionsForValidation)(u,n,a,t);try{const e=yield(0,Es.RE)(x.validateRelations,{validationServicePath:i,body:p,tenant:o,severity:l,options:(0,_.reject)(_.isNil,[x.ValidationServiceOption.preserveURIs,r===x.Mode.Editing?x.ValidationServiceOption.validateDataPermissions:null])});s=Object.values(e.validated).flat()}catch(e){return LF(e)}const d=yield(0,Es.Ys)(Ej.selectors.getModifiedEntities),m=yield(0,Es.Ys)(Ej.selectors.getRelations),y=(0,_.pipe)(x.convertValidationServiceErrors,(0,_.uniqBy)(x.getErrorUniqKey))(s,{entityUri:e,metadata:t,entitiesMap:d,connections:u,relationsState:m,relationViewsIds:c}),f=AF({metadata:t,modifiedEntities:d,connections:u,errors:y});return f.length&&(yield(0,Es.gz)(_w(f))),y}}return[]}function*MF(){const e=yield(0,Es.RE)(PF),[t,r]=yield(0,Es.$6)([(0,Es.RE)(kF),(0,Es.RE)(UF)]),n=(0,_.uniqBy)(x.getErrorUniqKey,[...e,...t,...r]);return yield(0,Es.gz)(DP(n)),0===n.filter(x.isCriticalError).length}let VF=function(e){return e.PROFILE_VIEWS_SET="PROFILE_VIEWS_SET",e}({});function BF(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){zF(e,t,r[t])}))}return e}function zF(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*HF(e){const t=yield(0,Es.Ys)(Ej.selectors.getMetadata),r=yield(0,Es.Ys)(Ej.selectors.getMode);switch(e.type){case qD.OPEN_RELATION_EDITOR:{const{id:n,connection:a}=e.payload;a.relation.relationType&&(yield(0,Es.gz)(Nw({viewId:n,metadata:t,mode:r,parentUri:a.relation.object.uri})));break}case Rw.ADD_ATTRIBUTES:{const n=e.payload;for(const e of n){const{attributeType:n,parentUri:a,viewId:i}=e;(0,x.isComplexAttribute)(n)&&(yield(0,Es.gz)(Nw({viewId:i,attributeType:n,parentUri:a,metadata:t,mode:r})))}break}case qD.SET_RELATION_TYPE:{const{id:n,relationUri:a}=e.payload;yield(0,Es.gz)(Nw({viewId:n,metadata:t,mode:r,parentUri:a}));break}case Vk.TREE_NODE_RELATION_TYPE_CHANGED:{var n;const{id:a,node:i}=e.payload;yield(0,Es.gz)(Nw({viewId:a,metadata:t,mode:r,parentUri:null==i||null===(n=i.relation)||void 0===n?void 0:n.uri}));break}}}function*YF(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const r=yield(0,Es.Ys)(pI),n=(0,x.getNotAppliedTreeCommands)(null==r?void 0:r.trees),a=yield(0,Es.Ys)(fI),i=(0,x.optimizeCommands)([...a,...n]);if(null!=i&&i.length){const r=(0,_.when)((0,_.always)(t),(0,x.replaceTempUriInCommands)(t))(i);yield(0,Es.RE)(e,r),yield(0,Es.gz)(Bk())}}function*WF(e){var t;const r=yield(0,Es.Ys)(M_),n=yield(0,Es.Ys)(V_),a=yield(0,Es.Ys)(nN,n),i=yield(0,Es.Ys)(D_),o=(0,x.getEntityType)(i,r.type),l=null===(t=null==o?void 0:o.forceOvForUiUpdates)||void 0===t||t,s=(0,x.collectAllDiffs)(r,a,l);return(0,x.prepareAttrDiff)(e,s)}function*GF(e){const t=yield(0,Es.Ys)(q_),r=yield(0,Es.Ys)(iN),n=yield(0,Es.Ys)(V_),a=yield(0,Es.Ys)(nN,n),i=(0,x.findAllTemporaryRefEntityURI)(a),o=(0,_.concat)(i,t);return yield(0,Es.RE)(x.saveTemporaryEntities,r,o,e)}function*qF(e,t){const r=e.getDCRObjectUris(),n=yield(0,Es.Ys)(RI),a=yield(0,Es.Ys)(NI),i=yield(0,Es.Ys)(OI);if(null!=r&&r.length){const o=yield(0,Es.RE)(x.startProcessInstance,{workflowPath:n,processType:"dataChangeRequestReview",objectURIs:(0,_.uniq)([t,...r,e.getDCRUri()]).filter((0,_.complement)(_.isNil)),tenant:i,environment:a});"OK"!==(null==o?void 0:o.status)&&console.warn(o)}}function*ZF(e,t,r,n){const a=yield(0,Es.Ys)(G_,r),i=(0,x.createRelationsCommandsFromConnections)(a,n,t);i.length&&(yield(0,Es.RE)(e,i))}function*$F(e,t,r){const n=yield(0,Es.Ys)(Q_),a=yield(0,Es.Ys)(V_);for(const i of n)yield(0,Es.rM)(ZF,e,r||a,i,t)}function*KF(e){if(!e.hasNewUri())return;const t=yield(0,Es.Ys)(pI);for(const[r,n]of Object.entries(t.trees))if(n.root){const t=t=>(0,_.when)((0,_.prop)("uri"),(0,_.assoc)("uri",e.getUri(null==t?void 0:t.uri)))(t),a=(0,x.mapTree)(n.root,{nodeProcessing:e=>(0,_.pipe)((e=>BF({},e)),(0,_.unless)((0,_.has)("editingMode"),(0,_.evolve)({relation:t,relations:(0,_.map)(t)})))(e)});(0,_.equals)(n.root,a)||(yield(0,Es.gz)(zk({id:r,tree:a})))}}function*QF(){try{var e;const t=yield(0,Es.Ys)(JN),{commandExecutor:r,dcrProcessor:n,relationUriProcessor:a}=(0,x.createCommandExecutor)({alwaysCreateDCR:t,dcrUri:null}),i=yield(0,Es.RE)(GF,n);yield(0,Es.$6)([(0,Es.RE)(YF,r),(0,Es.RE)($F,r,i)]),yield(0,Es.RE)(KF,a);const o=yield(0,Es.RE)(WF,i),l=yield(0,Es.Ys)(V_);let s;if(null!=o&&o.length&&(s=yield(0,Es.RE)(x.entityCumulativeUpdate,{uri:l,diff:o,uriPreprocessor:n.enhanceUriWithDCR})),t||(0,x.isChangeRequestUri)(null===(e=s)||void 0===e?void 0:e.uri))s&&n.updateDCRUriFromResponse(s),yield(0,Es.RE)(qF,n,l),yield(0,Es.gz)(Hk()),window.alert(L().text("Your changes are saved as pending and have been sent for review"));else if(s){yield(0,Es.gz)(gP(s));const{trees:e}=yield(0,Es.Ys)(Ej.selectors.getTrees),t=(0,x.updateTreesWithNewEntity)((0,_.pick)(["uri","label","secondaryLabel","type"],s),e);for(const e of t)yield(0,Es.gz)(zk({id:e.id,tree:e.root}))}yield(0,Es.gz)(ek(x.Mode.Viewing)),yield(0,Es.gz)(Uw())}catch(e){yield(0,Es.gz)(tR((0,x.getRequestErrorMessage)(e,L().text("Something went wrong"))))}}function*XF(){yield(0,Es.qn)(fP.ENTITY_LOADED),yield(0,Es.gz)(Uw())}function*JF(e,t){const r=yield(0,Es.Ys)(V_),n=yield(0,Es.Ys)(Ej.selectors.getModifiedEntity,r),{commandExecutor:a,dcrProcessor:i}=(0,x.createCommandExecutor)({alwaysCreateDCR:t,dcrUri:e}),o=yield(0,Es.RE)(GF,i),l=yield(0,Es.RE)(x.saveTemporaryEntity,n,o,i);return yield(0,Es.$6)([(0,Es.RE)(YF,a,{[r]:l}),(0,Es.RE)($F,a,o,l)]),{savedEntityUri:l,dcrProcessor:i}}function*ej(){const e=yield(0,Es.Ys)(V_),t=yield(0,Es.Ys)(Ej.selectors.getModifiedEntity,e);if((0,x.isEmptyEntity)(t)){const e=(0,va.x0)();return yield(0,Es.gz)(NA({id:e,text:L().text("Please fill out some fields."),actions:[]})),!1}return!0}function*tj(){try{const e=yield(0,Es.Ys)(JN);if(!(yield(0,Es.RE)(ej)))return;const{dcrProcessor:t,savedEntityUri:r}=yield(0,Es.RE)(JF,null,e);e&&(yield(0,Es.RE)(qF,t),window.alert(L().text("Your changes are saved as pending and have been sent for review"))),yield(0,Es.gz)(ek(x.Mode.Viewing)),e?(yield(0,Es.gz)(_A()),yield(0,Es.gz)(SP())):(yield(0,Es.gz)(wA({uri:r})),yield(0,Es.rM)(XF))}catch(e){yield(0,Es.gz)(tR((0,x.getRequestErrorMessage)(e,L().text("Something went wrong"))))}}function*rj(e){const t=yield(0,Es.RE)(x.getDataChangeRequest,e),r=(0,_.pipe)((0,_.prop)("changes"),_.values,_.flatten,(0,_.pluck)("id"))(t);try{yield(0,Es.$6)(r.map((t=>(0,Es.RE)(x.deleteChangeRequestItem,{dcrUri:e,changeItemId:t}))))}catch(e){yield(0,Es.gz)(tR((0,x.getRequestErrorMessage)(e,L().text("Something went wrong"))))}}function*nj(e,t){yield(0,Es.RE)(rj,e);const{savedEntityUri:r}=yield(0,Es.RE)(JF,e,!0),n=yield(0,Es.Ys)(RI),a=yield(0,Es.Ys)(NI),i=yield(0,Es.Ys)(OI);yield(0,Es.RE)(x.runTaskAction,{workflowPath:n,environment:a,tenant:i,taskId:t,action:"Approve"}),yield(0,Es.gz)(ek(x.Mode.Viewing)),yield(0,Es.gz)(wA({uri:r})),yield(0,Es.rM)(XF)}function*aj(e){const{dcrUri:t,userAction:r,taskId:n}=e.payload;try{if(!(yield(0,Es.RE)(ej)))return;yield(0,Es.gz)(ek("saveDraft"===r?x.Mode.Suggesting:x.Mode.Editing,!0)),yield(0,Es.gz)(wF(x.Operation.Saving));const e=yield(0,Es.RE)(MF);if("saveDraft"===r){if(t)yield(0,Es.RE)(rj,t),yield(0,Es.RE)(JF,t,!0);else{const{dcrProcessor:e}=yield(0,Es.RE)(JF,null,!0);yield(0,Es.RE)(qF,e);const t=e.getDCRUri();yield(0,Es.gz)(XA({url:"../authoring",searchParams:{entityUri:`${t}`},options:{replace:!0,state:{keepErrors:!0}}}))}window.alert(L().text("Your changes are saved as pending and have been sent for review"))}else if(e)if(t)yield(0,Es.RE)(nj,t,n);else{const{savedEntityUri:e}=yield(0,Es.RE)(JF,null,!1);yield(0,Es.gz)(ek(x.Mode.Viewing)),yield(0,Es.gz)(wA({uri:e})),yield(0,Es.rM)(XF)}else e||(yield(0,Es.gz)(ek(x.Mode.Suggesting,!0)))}catch(e){yield(0,Es.gz)(ek(x.Mode.Suggesting,!0)),yield(0,Es.gz)(tR((0,x.getRequestErrorMessage)(e,L().text("Something went wrong"))))}yield(0,Es.gz)(wF(null))}function*ij(){if(yield(0,Es.gz)(wF(x.Operation.Saving)),yield(0,Es.RE)(MF)){const e=yield(0,Es.Ys)(V_);(0,x.isTempUri)(e)?yield(0,Es.RE)(tj):yield(0,Es.RE)(QF)}yield(0,Es.gz)(wF(null))}function*oj(e){const{mode:t,silent:r}=e.payload;if(t!==x.Mode.Viewing&&!r){const e=yield(0,Es.Ys)(Ej.selectors.getEntity),r=yield(0,Es.Ys)(Ej.selectors.getModifiedEntity,null==e?void 0:e.uri),n=yield(0,Es.Ys)(Ej.selectors.getMetadata);if(e&&!r&&n){const r=yield(0,Es.Ys)(Ej.selectors.getProfileViews),a=yield(0,Es.Ys)(Ej.selectors.getUIConfig),i=yield(0,Es.Ys)(Ej.selectors.getUserRoles),o=(0,x.addToEntityRequiredAttributes)({entity:e,metadata:n,mode:t,attrTypeFilter:(0,_.both)((0,x.isAvailableAttributeTypeForProfile)(r||[]),(0,x.getProfileAttributeConfigPermissionsChecker)(a,e.type,i,[x.ConfigPermissions.READ,x.ConfigPermissions.CREATE]))});yield(0,Es.gz)(lk(o));const l=yield(0,Es.Ys)(Ej.selectors.getModifiedEntities),s=yield(0,Es.Ys)(Ej.selectors.getProfileErrors),c=AF({metadata:n,modifiedEntities:l,errors:s});c.length&&(yield(0,Es.gz)(_w(c)))}}}function*lj(e){const{entityTypeUri:t}=e.payload,r=yield(0,Es.Ys)(Ej.selectors.getMetadata),n=(0,x.getEntityType)(r,t),a=yield(0,Es.Ys)(Ej.selectors.getUIConfig),i=yield(0,Es.Ys)(Ej.selectors.getUserRoles),o=(0,x.getProfileAttributeConfigPermissionsChecker)(a,t,i,[x.ConfigPermissions.READ,x.ConfigPermissions.CREATE]),l=((null==n?void 0:n.attributes)||[]).filter((e=>o(e))),s=(0,x.checkMetadataForCreate)(x.Mode.Editing,n)?x.Mode.Editing:x.Mode.Suggesting,c=(0,x.createTemporaryEntity)({entityTypeUri:t,attributeTypes:l,metadata:r,mode:s});yield(0,Es.gz)(AA({entity:c})),yield(0,Es.gz)(gP(c)),yield(0,Es.gz)(ek(x.Mode.Viewing)),yield(0,Es.gw)(0),(yield(0,Es.Ys)(Ej.selectors.getProfileViews))||(yield(0,Es.qn)(VF.PROFILE_VIEWS_SET)),yield(0,Es.gz)(ek(s)),yield(0,Es.gz)(Yk())}function*sj(e){const{entityTypeUri:t}=e.payload,r=yield(0,Es.Ys)(Ej.selectors.getMetadata),n=(0,x.getEntityType)(r,t),a=(0,_.prop)("attributes",n),i=(0,x.checkMetadataForCreate)(x.Mode.Suggesting,n)?x.Mode.Suggesting:x.Mode.Editing,o=(0,x.createTemporaryEntity)({entityTypeUri:t,attributeTypes:a,metadata:r,mode:i});yield(0,Es.gz)(KA({entity:o})),yield(0,Es.gz)(gP(o)),yield(0,Es.gz)(ek(i))}function*cj(e){const{mainEntityUri:t,tempEntities:r,keepErrors:n}=e.payload,[[a],i]=(0,_.partition)((0,_.propEq)("uri",t),r);for(const e of i)yield(0,Es.gz)(lk(e));yield(0,Es.gz)(gP(a,n)),yield(0,Es.gz)(ek(x.Mode.Suggesting))}function*uj(e){const{payload:{entityUri:t,data:r}}=e;yield(0,Es.gz)(wF(x.Operation.Cloning));try{const e=yield(0,Es.RE)(x.cloneEntity,t,r);yield(0,Es.gz)(AA({entity:e})),yield(0,Es.gz)(gP(e)),yield(0,Es.gz)(ek(x.Mode.Editing)),yield(0,Es.gz)(Yk());const n=(0,va.x0)(),a=yield(0,Es.Ys)(Ej.selectors.getMetadata),i=(0,x.getEntityType)(a,e.type),o=(0,x.checkMetadataForDelete)(x.Mode.Editing,i);yield(0,Es.gz)(NA({id:n,type:"cloneAction",autoHideDuration:1e4,text:L().text("Profile is cloned successfully. You can modify the attributes if required."),actions:o?[{label:L().text("Undo"),needConfirmation:!0,confirmationText:L().text("Are you sure you want to undo the cloning process?"),confirmationDescription:L().text("Undoing the cloning process will delete the cloned profile. Are you sure you want to proceed?"),applyAction:OP({entityUri:e.uri}),cancelAction:IA(n)}]:[]}))}catch(e){yield(0,Es.gz)(tR((0,x.getRequestErrorMessage)(e,L().text("Something went wrong"))))}yield(0,Es.gz)(wF(null))}function*pj(e){const{entityUri:t}=e.payload;if(!(0,x.isTempUri)(t))try{yield(0,Es.RE)(x.removeEntity,t),yield(0,Es.gz)(RA())}catch(e){yield(0,Es.gz)(tR((0,x.getRequestErrorMessage)(e,L().text("Something went wrong"))))}}function*dj(){(yield(0,Es.Ys)(TI))&&!confirm(L().text("Are you sure you want to cancel changes for this Profile?"))||(yield(0,Es.gz)(rk()))}const mj=[function*(){yield(0,Es.A7)([Ww.MODE_CANCEL_EDITING],dj)},function*(){yield(0,Es.ib)([qD.OPEN_RELATION_EDITOR,Rw.ADD_ATTRIBUTES,qD.SET_RELATION_TYPE,Vk.TREE_NODE_RELATION_TYPE_CHANGED],HF)},function*(){yield(0,Es.A7)([Rw.SAVE_PROFILE],ij)},function*(){yield(0,Es.ib)([Ww.MODE_UPDATED],oj)},function*(){yield(0,Es.ib)([fP.ENTITY_CREATION_REQUESTED],lj)},function*(){yield(0,Es.Fm)([Rw.VALIDATE_PROFILE],MF)},function*(){yield(0,Es.ib)([fP.ENTITY_REMOVE_REQUESTED],pj)},function*(){yield(0,Es.ib)([fP.CLONE_ENTITY],uj)},function*(){yield(0,Es.ib)([fP.ENTITY_CREATION_WITH_AUTHORING_REQUESTED],sj)},function*(){yield(0,Es.ib)([fP.ENTITY_AUTHORING_DRAFT_ENTITIES_LOADED],cj)},function*(){yield(0,Es.A7)([Rw.SAVE_DRAFT],aj)}],yj=(yw(VF.PROFILE_VIEWS_SET),function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return t.type===VF.PROFILE_VIEWS_SET?t.payload:e});let fj=function(e){return e.SIDE_PANEL_VIEWS_LOADED="SIDE_PANEL_VIEWS_LOADED",e}({});yw(fj.SIDE_PANEL_VIEWS_LOADED);const gj=[],hj=(0,R.combineReducers)({dependentLookups:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Zw,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Ww.MODE_UPDATED:{const{mode:r,silent:n}=t.payload;return(0,x.isViewMode)(r)&&!n?Zw:e}case Vw.DEPENDENT_LOOKUPS_STRUCTURE_SET:return Gw({},e,{structure:t.payload});case Vw.DEPENDENT_LOOKUPS_INITED_TYPE_URIS_ADDED:{const r=t.payload;return Gw({},e,{initedTypeUris:(0,_.uniq)(e.initedTypeUris.concat(r))})}case Vw.DEPENDENT_LOOKUPS_EDITORS_BLOCKED:{const{uris:r,isBlocked:n}=t.payload,a=e.editors,i=r.reduce(((e,t)=>Gw({},e,{[t]:Gw({},e[t],{isBlocked:n})})),a);return Gw({},e,{editors:i})}case Vw.DEPENDENT_LOOKUPS_EDITOR_TOUCHED:{const{uri:r,isTouched:n}=t.payload;return(0,_.assocPath)(["editors",r,"isTouched"],n,e)}default:return e}},entity:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:_P,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case fP.ENTITY_LOADED:return t.payload.entity;case fP.DEFAULT_PROFILE_PIC_SET:return"object"==typeof t.payload&&null!==t.payload?AP({},e,{defaultProfilePic:t.payload.uri,defaultProfilePicValue:t.payload}):e;case Rw.ADD_NEXT_PAGE_ATTRIBUTE_VALUES:{const{parentUri:r,attributeTypeName:n,attributeTypeUri:a,values:i}=t.payload,o=(0,x.getAttributeSource)(a);if(r===e.uri){const t=(0,_.lensPath)([o,n]);return(0,_.over)(t,(0,_.pipe)((0,_.defaultTo)([]),(0,_.concat)(_.__,i)),e)}return e}case fP.CLEAR_ENTITY:return _P;default:return e}},errors:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:LP,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case NP.ERRORS_SET:return t.payload;case NP.ERROR_DEACTIVATED:{const r=t.payload,n=e.findIndex((e=>(0,x.getErrorId)(e)===r)),a=(0,_.lensPath)([n]);return(0,_.over)(a,(0,_.assoc)("deactivated",!0),e)}case Rw.REMOVE_ATTRIBUTE:{const{uri:r}=t.payload;return e.map((e=>e.uri===r||(0,x.areOneHierarchyUris)(e.parentUri,r)?PP({},e,{deactivated:!0}):e))}case Ww.MODE_UPDATED:{const{mode:r,silent:n}=t.payload;return(0,x.isViewMode)(r)&&!n?LP:e}case fP.ENTITY_LOADED:{const{keepErrors:r}=t.payload;return r?e:LP}default:return e}},history:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:WP,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case FP.HISTORY_DIFF_SET:return HP({},e,{diff:t.payload});case FP.HISTORY_DIFF_CLEARED:return HP({},e,{diff:WP.diff});case FP.HISTORY_EVENT_SET:return HP({},e,{event:t.payload});case Tw.NEW_ENTITY_SHOWN:case Tw.OPEN_ENTITY:case FP.HISTORY_EVENT_CLEARED:return HP({},WP,{mode:e.mode});case FP.HISTORY_SLICE_SET:return HP({},e,{slice:t.payload});case FP.HISTORY_MODE_SET:return HP({},e,{mode:t.payload});default:return e}},lastLoadedTime:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case GP.PROFILE_LAST_LOADED_TIME_UPDATE:case fP.ENTITY_LOADED:return Date.now();default:return e}},lookups:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:JP,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case qP.LOOKUPS_LOADED:return t.payload;case qP.LOOKUPS_FOR_TYPE_RESOLVED:{const{type:r,values:n}=t.payload;return QP({},e,{[r]:QP({},e[r],n)})}case qP.LOOKUPS_LIST_RESOLVED:return t.payload.reduce(((e,t)=>Object.keys(t).reduce(((e,r)=>QP({},e,{[r]:QP({},e[r],t[r])})),e)),e);case"UI_RESET":return QP({},JP);default:return e}},mode:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ok,t=arguments.length>1?arguments[1]:void 0;return t.type===Ww.MODE_UPDATED?t.payload.mode:e},modifiedEntities:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:yk,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case GD.MODIFIED_ENTITY_CREATED:{const r=t.payload;return dk({},e,{[r.uri]:r})}case GD.MODIFIED_ENTITY_DELETED:{const r=t.payload;return(0,_.omit)([r],e)}case GD.MODIFIED_ENTITIES_RESET:return yk;case Ww.MODE_UPDATED:{const{mode:r,silent:n}=t.payload;return(0,x.isViewMode)(r)&&!n?yk:e}case GD.MODIFIED_ENTITY_DEFAULT_PROFILE_PIC_SET:{const{entityUri:r,value:n}=t.payload;return r?dk({},e,{[r]:dk({},e[r],{defaultProfilePic:n.uri,defaultProfilePicValue:n})}):e}case Rw.ADD_ATTRIBUTES:return t.payload.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a}=t,i=(0,x.getBaseUri)(n);if((0,x.isEntityUri)(i)){const t=e[i];return e[i]||console.error(`ADD_ATTRIBUTES. parentUri - ${n}, state: ${JSON.stringify(e)}`),(0,x.isEntitySpecialAttrType)(r)?dk({},e,{[i]:(0,x.addEntitySpecialAttribute)({entity:t,attributeType:r})}):dk({},e,{[i]:(0,x.addAttribute)({entity:t,attributeType:r,parentUri:n,index:a})})}return e}),e);case Rw.ADD_NEXT_PAGE_ATTRIBUTE_VALUES:{const{parentUri:r,attributeTypeName:n,attributeTypeUri:a,values:i}=t.payload,o=(0,x.getAttributeSource)(a);if((0,x.isEntityUri)(r)&&r in e){const t=(0,_.lensPath)([r,o,n]);return(0,_.over)(t,(0,_.pipe)((0,_.defaultTo)([]),(0,_.concat)(_.__,i)),e)}return e}case Rw.MODIFY_ATTRIBUTE:{const{attributeType:r,uri:n,value:a}=t.payload,i=(0,x.getBaseUri)(n);if((0,x.isEntityUri)(i)){const t=e[i];return e[i]&&e[i].attributes||console.error(`MODIFY_ATTRIBUTE. uri - ${n}, state: ${JSON.stringify(e)}`),(0,x.isEntitySpecialAttrType)(r)?dk({},e,{[i]:(0,x.editEntitySpecialAttribute)({entity:t,attributeType:r,value:a})}):dk({},e,{[i]:(0,x.editAttribute)({entity:t,attributeType:r,uri:n,value:a})})}return e}case Rw.REMOVE_ATTRIBUTE:{const{attributeType:r,uri:n}=t.payload,a=(0,x.getBaseUri)(n);if((0,x.isEntityUri)(n)){const t=e[a];return e[a]||console.error(`REMOVE_ATTRIBUTE. uri - ${n}, state: ${JSON.stringify(e)}`),(0,x.isEntitySpecialAttrType)(r)?dk({},e,{[a]:(0,x.removeEntitySpecialAttribute)({entity:t,attributeType:r})}):dk({},e,{[a]:(0,x.removeAttribute)({entity:t,attributeType:r,uri:n})})}return e}case Rw.ADD_DEFAULT_VALUES:{const{attributeType:r,parentUri:n,metadata:a,mode:i}=t.payload,o=(0,x.getBaseUri)(n);if((0,x.isEntityUri)(o)){const t=(0,x.getEditableAttributeTypeSubAttributes)(a,r);return(0,_.over)((0,_.lensProp)(o),(0,x.addDefaultValuesToComplexAttribute)({attributeType:r,subAttributes:t,metadata:a,mode:i,parentUri:n}),e)}return e}default:return e}},relations:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Lk,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case fP.ENTITY_LOADED:return{};case qD.RELATIONS_LOADED:{const{id:r,connections:n=[],total:a,mode:i}=t.payload;return(0,_.pipe)((0,_.assocPath)([r,"connections"],n),(0,_.assocPath)([r,"total"],a),(0,_.when)((0,_.both)((0,_.complement)((0,_.hasPath)([r,"drafts"])),(0,_.always)((0,x.isEditableMode)(i))),(0,_.assocPath)([r,"drafts"],Fk)))(e)}case qD.SECOND_LEVEL_RELATIONS_LOADED:{const{id:r,connections:n,parentEntityUri:a,total:i}=t.payload,o=(0,_.path)([r,"connections"],e).map((e=>{const{entityUri:t}=e.entity;return t===a?Pk({},e,{total:i,connections:n.map((e=>Pk({},e,{parentEntityUri:a})))}):e}));return(0,_.assocPath)([r,"connections"],o,e)}case Ww.MODE_UPDATED:{const{mode:r,silent:n}=t.payload;return n?e:(0,_.map)(ak(r)?(0,_.omit)(["drafts","relationsToEdit","relationToAdd"]):(0,_.assoc)("drafts",Fk),e)}case qD.REMOVE_RELATION:{const{id:r,relationUri:n}=t.payload,a=(0,_.pipe)(x.getRelationUriFromConnection,(0,_.equals)(n)),i=(0,_.path)([r,"connections"],e),o=!((0,x.isTempUri)(n)||null!=i&&i.some((e=>e.suggested&&e.relation.relationUri===n)));return(0,_.evolve)({[r]:{drafts:(0,_.evolve)({removedUris:o?(0,_.append)(n):_.identity,addedConnections:(0,_.reject)(a),editedConnections:(0,_.reject)(a)})}},e)}case qD.IGNORE_RELATION:{const{id:r,ignoredRelationData:n}=t.payload;return(0,_.evolve)({[r]:{drafts:(0,_.evolve)({ignoredRelationData:(0,_.append)(n)})}},e)}case qD.ADD_RELATION:{const{id:r,connection:n}=t.payload,a=(0,_.omit)(["isNew"],n);return(0,_.evolve)({[r]:(0,_.pipe)((0,_.when)((0,_.propSatisfies)(_.isNil,"drafts"),(0,_.assocPath)(["drafts"],Fk)),(0,_.evolve)({drafts:{addedConnections:(0,_.prepend)(a)}}))},e)}case qD.EDIT_RELATION:{const{id:r,connection:n}=t.payload,a=(0,_.eqBy)(x.getRelationUriFromConnection,n);if((0,x.isTempUri)((0,x.getRelationUriFromConnection)(n))){const t=e=>{const t=e.findIndex(a);return t>=0?(0,_.update)(t,n,e):e};return(0,_.evolve)({[r]:{drafts:(0,_.evolve)({addedConnections:t})}},e)}{const t=e=>{const t=e.findIndex(a);return t>=0?(0,_.update)(t,n,e):[...e,n]};return(0,_.evolve)({[r]:{drafts:(0,_.evolve)({editedConnections:t})}},e)}}case qD.OPEN_RELATION_EDITOR:{const{id:r,connection:n}=t.payload,a=n.initial?n:Pk({},n,{initial:{connection:n}});if(a.isNew){const t=(0,x.getRelationToAddPath)(r);return(0,_.path)(t,e)?e:(0,_.assocPath)(t,a,e)}{const t=(0,_.lensPath)((0,x.getRelationsToEditPath)(r)),n=(0,_.eqBy)((0,_.path)(["relation","relationUri"]),a);return(0,_.over)(t,(0,_.pipe)((0,_.defaultTo)([]),(0,_.unless)((0,_.find)(n),(0,_.append)(a))),e)}}case qD.SET_INITIAL_INFO:{const{id:r,relationUri:n,tempEntity:a}=t.payload,i=jk(r,n,e);return(0,_.assocPath)([...i,"initial","modifiedEntity"],a,e)}case qD.CLOSE_RELATION_EDITOR:{const{id:r,relationUri:n}=t.payload,a=(0,_.pathEq)(["relation","relationUri"],n);return(0,_.evolve)({[r]:{relationToAdd:(0,_.when)(a,(0,_.always)(null)),relationsToEdit:(0,_.reject)(a)}},e)}case qD.SET_RELATION_TYPE:{const{id:r,relationUri:n,relationType:a}=t.payload,i=jk(r,n,e);if(i){const t=[...i,"relation"],r=(0,_.lensPath)(t);return(0,_.over)(r,(0,x.applyRelationTypeObject)(a),e)}return e}case Rw.ADD_ATTRIBUTES:return t.payload.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a,viewId:i}=t,o=(0,x.getBaseUri)(n),l=Uk(i,o,e);if(l&&(0,x.isRelationUri)(o)){if((0,x.isActivenessAttrType)(r)){const t=(0,_.view)(l,e),n=(0,x.addEntitySpecialAttribute)({entity:t,attributeType:r});return(0,_.set)(l,n,e)}{const t=Mk(i,o,e),l=(0,_.view)(t,e);l||console.error(`relations.ADD_ATTRIBUTES. viewId - ${i}, relationUri - ${o}, state: ${JSON.stringify(e)}`);const s=(0,x.addAttribute)({entity:l,attributeType:r,parentUri:n,index:a});return(0,_.set)(t,s,e)}}return e}),e);case Rw.ADD_NEXT_PAGE_ATTRIBUTE_VALUES:{const{parentUri:r,attributeTypeName:n,values:a,viewId:i}=t.payload;if(!(0,x.isRelationUri)(r))return e;const o=(0,x.getBaseUri)(r),l=jk(i,o,e),s=(0,_.lensPath)([...l,"relation","object","attributes",n]);return(0,_.over)(s,(0,_.pipe)((0,_.defaultTo)([]),(0,_.append)(a)),e)}case Rw.MODIFY_ATTRIBUTE:{const{attributeType:r,viewId:n,uri:a,value:i}=t.payload,o=(0,x.getBaseUri)(a),l=Uk(n,o,e);if(l&&(0,x.isRelationUri)(o)){if((0,x.isActivenessAttrType)(r)){const t=(0,_.view)(l,e),n=(0,x.editEntitySpecialAttribute)({entity:t,attributeType:r,value:i});return(0,_.set)(l,n,e)}{const t=Mk(n,o,e),l=(0,_.view)(t,e);l||console.error(`relations.MODIFY_ATTRIBUTE. viewId - ${n}, relationUri - ${o}, state: ${JSON.stringify(e)}`);const s=(0,x.editAttribute)({entity:l,attributeType:r,uri:a,value:i});return(0,_.set)(t,s,e)}}return e}case Rw.REMOVE_ATTRIBUTE:{const{attributeType:r,uri:n,viewId:a}=t.payload,i=(0,x.getBaseUri)(n),o=Uk(a,i,e);if(o&&(0,x.isRelationUri)(i)){if((0,x.isActivenessAttrType)(r)){const t=(0,_.view)(o,e),n=(0,x.removeEntitySpecialAttribute)({entity:t,attributeType:r});return(0,_.set)(o,n,e)}{const t=Mk(a,i,e),o=(0,_.view)(t,e);o||console.error(`relations.REMOVE_ATTRIBUTE. viewId - ${a}, relationUri - ${i}, state: ${JSON.stringify(e)}`);const l=(0,x.removeAttribute)({entity:o,attributeType:r,uri:n});return(0,_.set)(t,l,e)}}return e}case qD.SET_RELATION_ENTITY:{const{id:r,relationUri:n,entityInfo:a}=t.payload,i=jk(r,n,e);if(i){const t=[...i,"entity"],r=(0,_.lensPath)(t),{uri:n,label:o,type:l}=a,s=(0,_.isEmpty)(a)?{}:{entityUri:n,entityLabel:o,entityType:l,object:{uri:n,label:o,type:l}};return(0,_.set)(r,s,e)}return e}case Rw.ADD_DEFAULT_VALUES:{const{viewId:r,attributeType:n,parentUri:a,metadata:i,mode:o}=t.payload,l=(0,x.getBaseUri)(a);if((0,x.isRelationUri)(l)){const t=jk(r,l,e);if(t){if(n){const r=[...t,"relation","object"],l=(0,x.getAttributeTypeSubAttributes)(i,n);return(0,_.over)((0,_.lensPath)(r),(0,x.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,_.view)((0,_.lensPath)(n),e),{attributes:s=[]}=(0,x.getRelationType)(i,l);return(0,_.over)((0,_.lensPath)(r),(0,x.addDefaultValuesToAttributes)({metadata:i,mode:o,attributeTypes:s,parentUri:a}),e)}}return e}return e}default:return e}},trees:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:gL,t=arguments.length>1?arguments[1]:void 0;return(0,Gk.ZP)(e,(r=>{switch(t.type){case Ww.MODE_UPDATED:{const{mode:e,silent:n}=t.payload;if(n)break;Object.keys(null==r?void 0:r.trees).forEach((e=>{tL(r.trees[e].root,"showDetails",!1)})),(0,x.isViewMode)(e)&&(r.common.commands=[],r.initialTrees={}),(0,x.isEditableMode)(e)&&(r.initialTrees=yL({},r.trees));break}case Ww.MODE_EDITING_CANCELED:case Vk.TREES_RESTORE_FROM_INITIAL_TREES:r.trees=yL({},r.initialTrees);break;case Vk.TREES_RESET_INITIAL_TREES:r.initialTrees={};break;case fP.ENTITY_LOADED:return gL;case Vk.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 Vk.TREE_LOADING:{const e=t.payload;r.trees[e]=r.trees[e]||{},r.trees[e].loading=!0;break}case Vk.TREE_CHILDREN_LOADING:{const{id:e,parentId:n,nodeId:a}=t.payload,i=r.trees[e].root,o=(0,x.findNodeById)(i,n);o.pending=!1,o.children=(o.children||[]).concat({entity:{},loading:!0,nodeId:a});break}case Vk.TREE_CHILDREN_LOADED:{const{children:e,id:n,parentId:a}=t.payload,i=r.trees[n].root,o=(0,x.findNodeById)(i,a);o&&(o.children=Qk(o.children,e),delete o.pending);break}case Vk.TREE_NODE_REMOVED:{const{id:e,nodeId:n}=t.payload,a=r.trees[e].root,i=(0,x.findParentNodeById)(a,n);Xk(i||a,n);break}case Vk.TREE_NODE_CREATED:{const{id:e,parentId:n,node:a}=t.payload,i=r.trees[e].root,o=(0,x.findNodeById)(i,n)||i,l=o.children.length;Jk(o,a,l);break}case Vk.TREE_NODE_EDITED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,x.findNodeById)(a,n.nodeId),o=Object.keys(n);for(const e of o)i[e]=n[e];break}case Vk.TREE_NODE_EDITING_STARTED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,x.findNodeById)(a,n.nodeId),o=(0,x.findParentNodeById)(a,n.nodeId);i&&o&&(i.editingMode=x.NODE_EDITING_MODES.editing,i.relatedEntity=o.entity,delete i.loading,i.initialConnection=rL(i),nL({id:e,draft:r.trees,node:i}));break}case Vk.TREE_NODE_EDITING_APPLIED:{const{id:e,node:a}=t.payload,i=r.trees[e].root,o=(0,x.findNodeById)(i,a.nodeId),l=lL({id:e,draft:r.trees,relationUri:a.relation.uri});var n;o&&l&&(sL(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,oL({id:e,draft:r.trees,relationUri:a.relation.uri}));break}case Vk.TREE_NODE_EDITING_CANCELED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,x.findNodeById)(a,n.nodeId);i&&(sL(i),oL({id:e,draft:r.trees,relationUri:n.relation.uri}));break}case Vk.TREE_NODE_NEW_PARENT_EDITING_STARTED:{const{id:e,node:n,newNode:a}=t.payload,i=r.trees[e].root,o=(0,x.findNodeById)(i,n.nodeId);if(a.relatedEntity=o.entity,a.relatedNodeId=o.nodeId,a.editingMode=x.NODE_EDITING_MODES.addingParent,i===o)a.children=[i],r.trees[e].root=a;else{const e=(0,x.findParentNodeById)(i,n.nodeId),t=e.children.findIndex((e=>o===e));Jk(e,a,t)}a.initialConnection=rL(a),nL({id:e,draft:r.trees,node:a});break}case Vk.TREE_NODE_NEW_PARENT_EDITING_APPLIED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,x.findNodeById)(a,n.nodeId),o=(0,x.findNodeById)(a,n.relatedNodeId),l=lL({id:e,draft:r.trees,relationUri:n.relation.uri});i&&l&&(cL({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=dL(r.trees[e].entitiesMap,[o,mL(l)]),oL({id:e,draft:r.trees,relationUri:i.relation.uri}));break}case Vk.TREE_NODE_NEW_PARENT_EDITING_CANCELED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,x.findNodeById)(a,n.nodeId);i&&(cL({id:e,draft:r.trees,currentNode:i}),oL({id:e,draft:r.trees,relationUri:i.relation.uri}));break}case Vk.TREE_NODE_NEW_CHILD_EDITING_STARTED:{const{id:e,node:n,newNode:a}=t.payload,i=r.trees[e].root,o=(0,x.findNodeById)(i,n.nodeId);a.relatedEntity=o.entity,a.editingMode=x.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=rL(a),nL({id:e,draft:r.trees,node:a});break}case Vk.TREE_NODE_NEW_CHILD_EDITING_APPLIED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,x.findParentNodeById)(a,n.nodeId),o=(0,x.findNodeById)(i,n.nodeId),l=lL({id:e,draft:r.trees,relationUri:n.relation.uri});i&&o&&l&&(sL(o),o.entity=l.entity,o.relation=l.relation,o.relations=[l.relation],oL({id:e,draft:r.trees,relationUri:n.relation.uri}));break}case Vk.TREE_NODE_NEW_CHILD_EDITING_CANCELED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,x.findParentNodeById)(a,n.nodeId);i&&(Xk(i,n.nodeId),oL({id:e,draft:r.trees,relationUri:n.relation.uri}));break}case Vk.TREE_NODE_RELATION_TYPE_CHANGED:{const{id:e,node:n,relationTypeUri:a}=t.payload,i=lL({id:e,draft:r.trees,relationUri:n.relation.uri}).relation.type;i!==a&&(i&&aL({id:e,draft:r.trees,node:n,entity:null}),iL({id:e,draft:r.trees,node:n,relationTypeUri:a}));break}case Vk.TREE_NODE_ENTITY_CHANGED:{const{id:e,node:n,entity:a}=t.payload;aL({id:e,draft:r.trees,node:n,entity:a});break}case Rw.ADD_ATTRIBUTES:return t.payload.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a,viewId:i}=t,o=(0,x.getBaseUri)(n),l=uL(i,o,e.trees);if(l&&(0,x.isRelationUri)(o)){const t=(0,_.view)(l,e.trees);if((0,x.isActivenessAttrType)(r)){const n=(0,x.addEntitySpecialAttribute)({entity:t,attributeType:r});return yL({},e,{trees:(0,_.set)(l,n,e.trees)})}{const i=(0,x.addAttribute)({entity:t,attributeType:r,parentUri:n,index:a});return yL({},e,{trees:(0,_.set)(l,i,e.trees)})}}return e}),e);case Rw.MODIFY_ATTRIBUTE:{const{attributeType:r,viewId:n,uri:a,value:i}=t.payload,o=(0,x.getBaseUri)(a),l=uL(n,o,e.trees);if(l&&(0,x.isRelationUri)(o)){const t=(0,_.view)(l,e.trees);if((0,x.isActivenessAttrType)(r)){const n=(0,x.editEntitySpecialAttribute)({entity:t,attributeType:r,value:i});return yL({},e,{trees:(0,_.set)(l,n,e.trees)})}{const n=(0,x.editAttribute)({entity:t,attributeType:r,uri:a,value:i});return yL({},e,{trees:(0,_.set)(l,n,e.trees)})}}return e}case Rw.REMOVE_ATTRIBUTE:{const{attributeType:r,uri:n,viewId:a}=t.payload,i=(0,x.getBaseUri)(n),o=uL(a,i,e.trees);if(o&&(0,x.isRelationUri)(i)){const t=(0,_.view)(o,e.trees);if((0,x.isActivenessAttrType)(r)){const n=(0,x.removeEntitySpecialAttribute)({entity:t,attributeType:r});return yL({},e,{trees:(0,_.set)(o,n,e.trees)})}{const a=(0,x.removeAttribute)({entity:t,attributeType:r,uri:n});return yL({},e,{trees:(0,_.set)(o,a,e.trees)})}}return e}case Rw.ADD_DEFAULT_VALUES:{const{viewId:r,attributeType:n,parentUri:a,metadata:i,mode:o}=t.payload,l=(0,x.getBaseUri)(a),s=uL(r,l,e.trees);if((0,x.isRelationUri)(l)&&s){if(n){const t=(0,x.getAttributeTypeSubAttributes)(i,n);return yL({},e,{trees:(0,_.over)(s,(0,x.addDefaultValuesToComplexAttribute)({attributeType:n,subAttributes:t,metadata:i,mode:o,parentUri:a}),e.trees)})}{const t=(0,_.compose)(s,(0,_.lensPath)(["attributes"])),r=(0,_.compose)(s,(0,_.lensPath)(["type"])),n=(0,_.view)(r,e.trees),{attributes:l=[]}=(0,x.getRelationType)(i,n);return yL({},e,{trees:(0,_.over)(t,(0,x.addDefaultValuesToAttributes)({metadata:i,mode:o,attributeTypes:l,parentUri:a}),e.trees)})}}return e}case Vk.TREE_ENTITIES_MAPPING_LOADED:{const{id:e,entitiesSubMap:n}=t.payload,a=r.trees[e].entitiesMap;r.trees[e].entitiesMap=Kk(a,n);break}case Vk.TREE_LOADED:{const{tree:e,id:n,graphTypes:a,activenessDate:i,isReversed:o}=t.payload,l=pL(r.trees[n]||{});r.trees[n]=yL({},l,e,{graphTypes:a,activenessDate:i,isReversed:o}),delete r.trees[n].errorMessage,r.trees[n].loading=!1;break}case Vk.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,x.mapTree)(r.trees[e].root,{childrenProcessing:(0,x.sortTreeChildren)({sortField:a,sortOrder:i,typesLabelsMap:n})}));break}case Vk.TREE_SECONDARY_LABEL_SHOWN:{const{id:e,show:n}=t.payload;r.trees[e].showSecondaryLabel=n,r.trees[e].root=yL({},r.trees[e].root);break}case Vk.TREES_STATE_RESTORED:{const e=t.payload;Object.keys(e).forEach((t=>{r.trees[t]=r.trees[t]||{},r.trees[t]=yL({},r.trees[t],e[t]),r.trees[t].root&&(r.trees[t].root=yL({},r.trees[t].root))}));break}case Vk.TREE_CHANGED:{const{id:e,tree:n}=t.payload;r.trees[e].root=n;break}case Vk.TREE_REFRESHED:{const e=t.payload;r.trees[e].root=yL({},r.trees[e].root);break}case Vk.TREE_NODE_EXPANDED:{const{id:e,nodeId:n}=t.payload,a=r.trees[e].root;(0,x.findNodeById)(a,n).expanded=!0;break}case Vk.TREE_CURRENT_ENTITY_SHOWN:{const{id:n,uri:a=(0,_.path)(["entity","uri"],e)}=t.payload;if(r.trees[n]){const e=$k(r.trees[n].root,a);r.trees[n].scrollTo=e}break}case Vk.TREE_SCROLL_TO_NODE_RESET:{const e=t.payload;r.trees[e]&&(r.trees[e].scrollTo=null);break}case Vk.TREE_ACTIVENESS_DATE_CHANGED:{const{id:e,activenessDate:n}=t.payload;r.trees[e].activenessDate=n;break}case Vk.TREE_RELATION_REPOINTED:{const{entity:e,relation:n,newParent:a,isReversed:i}=t.payload,o=(0,_.prop)("uri"),l=o(e),s=o(a),c=(0,x.createRelationRepointCommand)({entityUri:l,relation:n,newEntityUri:s,isReversed:i});r.common.commands.push(c);break}case Vk.TREE_RELATION_REMOVED:{const{relationUri:e}=t.payload;if((0,x.isTempUri)(e))r.common.commands=(0,_.reject)((0,x.isRelationCommandForUri)(e),r.common.commands);else{const t=(0,x.createRelationDeleteCommand)({relationUri:e});r.common.commands.push(t)}break}case Vk.TREE_RELATION_CREATED:{const{entityUri:e,relation:n,parentEntityUri:a}=t.payload,i=(0,x.createRelationCreateCommand)({parentUri:a,relation:n,entityUri:e});r.common.commands.push(i);break}case Vk.TREE_RELATION_EDITED:{const{oldRelation:e,newRelation:n,entityUri:a,newEntityUri:i,isReversed:o}=t.payload,l=i?(0,x.createRelationRepointCommand)({entityUri:a,newEntityUri:i,relation:n,isReversed:o}):(0,x.createRelationUpdateCommand)({oldRelation:e,newRelation:n});r.common.commands.push(l);break}case Vk.TREE_COMMANDS_CLEARED:r.common.commands=[];break;case Vk.TREE_CANCEL_CHILDREN_LOADING:{const{id:e,parentId:n}=t.payload,a=r.trees[e].root,i=(0,x.findNodeById)(a,n);i&&(i.pending=!0,delete i.expanded,delete i.children);break}}}))},operation:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return t.type===CF.PROFILE_OPERATION_UPDATE?t.payload:e},views:yj,sidePanelViews:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:gj,t=arguments.length>1?arguments[1]:void 0;return t.type===fj.SIDE_PANEL_VIEWS_LOADED?t.payload:e},entityRelatedAttributes:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:EL,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case hL.ENTITY_RELATED_ATTRIBUTES_ADDED:{const{attributeTypeUri:r,entityUri:n,attributes:a}=t.payload;return(0,_.assocPath)([r,n],a,e)}case Ww.MODE_UPDATED:{const{mode:r,silent:n}=t.payload;return(0,x.isViewMode)(r)&&!n?EL:e}default:return e}}}),Ej={getModule:()=>({id:"mdm",reducerMap:{dataTenants:gw,tenants:bw,metadata:Aw,profile:hj,tenant:O_,environment:__,user:f_,ui:d_,search:CA},sagas:[...Tk,...yP,...mj,...TA]}),selectors:p},bj=Ej,vj=e=>{let{className:t}=e;const r=(0,xE.useDispatch)(),n=(0,xE.useSelector)(xu),a=(0,xE.useSelector)(bj.selectors.getGoogleMapKey),i=(0,b.useMemo)((()=>((e,t)=>(0,_.when)((0,_.always)(!t),(0,_.reject)((0,_.propEq)("id",H.MAP)))(e))([{id:H.MAP,tooltipTitle:L().text("View map"),Icon:dw()},{id:H.PROFILE,tooltipTitle:L().text("View entity details"),Icon:uw()}],a)),[a]);return v().createElement(JC,{className:t,modes:i,modeId:n,onChange:e=>{r(jp(n!==e?e:null))}})};vj.propTypes={className:OE().string};const Tj=vj,Oj=()=>v().createElement("div",{className:Db},v().createElement("div",{className:"Headers-styles-title--TvsMA"},L().text("Profiles")),v().createElement("div",{className:Pb},v().createElement(sw,null),v().createElement(Tj,{className:kb})));var xj=r(12932),Sj=r.n(xj),Cj=r(83754),wj=r.n(Cj);const Aj=(0,AE.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 Rj(){return Rj=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Rj.apply(this,arguments)}function _j(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}const Nj=e=>{let{value:t,tabs:r=[],onChange:n,tabClasses:a}=e,i=_j(e,["value","tabs","onChange","tabClasses"]);const o=Aj(),l=(e,t)=>v().createElement("span",{className:o.labelWrapper},v().createElement(hb.Y,{value:e},v().createElement("span",{className:o.label},e)),t);return v().createElement(Sj(),Rj({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=_j(e,["label","value","additionalLabel","dataReltioId"]);return v().createElement(wj(),Rj({classes:a||{root:o.tabRoot,disabled:o.disabled},key:r,value:r,label:l(t,n),"data-reltio-id":i},s))})))};function Ij(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class Dj extends b.PureComponent{constructor(){super(...arguments),this.getTabsData=()=>{const{tenantObject:e,tableViewTabs:t,selectedEntityTypes:r,metadata:n}=this.props,a=Ga(t,e);return su(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Ij(e,t,r[t])}))}return e}({},e,{additionalLabel:v().createElement("span",{className:"Headers-styles-number--trErH"},"(",void 0===e.number?L().text("N/A"):Qs(e.number),")")})))},this.onTabChange=e=>{this.props.dispatch(Ip(e))},this.onSelectColumns=e=>{const{dispatch:t,entityTypeTab:r,columnsForEntityType:n}=this.props;return t(Np(r,e,n))},this.renderTabs=()=>{const{entityTypeTab:e}=this.props;return v().createElement("div",{className:"Headers-styles-tabsContainer--lhDXc"},v().createElement(Nj,{value:e,tabs:this.getTabsData(),onChange:this.onTabChange}))}}render(){const{entityTypeTab:e,columnsForEntityType:t}=this.props;return v().createElement("div",{className:Db},this.renderTabs(),v().createElement("div",{className:Pb},v().createElement(jb,{entityTypeUri:e,headColumns:t,onSelectColumns:this.onSelectColumns,"data-reltio-id":"reltio-search-table-add-remove-column",disabled:!e,showForDisabled:!0}),v().createElement(pS(),{orientation:"vertical",className:"Headers-styles-splitter--sCvn6"}),v().createElement(sw,null),v().createElement(Tj,{className:kb})))}}Dj.propTypes={metadata:x.MetadataType,dispatch:OE().func,selectedEntityTypes:OE().array,tableViewTabs:OE().array,entityTypeTab:OE().string,columnsForEntityType:OE().array,tenantObject:OE().object};const Pj=(0,xE.connect)((e=>{const t=Ou(e);return{metadata:Cr().selectors.getMetadata(e),selectedEntityTypes:Tr(e),tableViewTabs:Pu(e),entityTypeTab:t,columnsForEntityType:wu(e,t),tenantObject:sp(e)}}))(Dj);function kj(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class Lj extends v().PureComponent{constructor(){super(...arguments),this.entitiesTableRef=this.props.basicTableRef||v().createRef(),this.state={resizeDebounceDelay:void 0},this.sortHandle=e=>{let{field:t,order:r}=e;this.props.dispatch((e=>{let{field:t,order:r,entityTypeUri:n}=e;return{type:jr,payload:{field:t,order:r,entityTypeUri:n}}})({field:r?t:null,order:r,entityTypeUri:this.props.entityTypeUri}))},this.reorderingHandle=e=>{let{what:t,where:r}=e;const{entityTypeUri:n,dispatch:a,headColumns:i}=this.props;a(((e,t)=>({type:Kn,payload:{entityTypeUri:e,columns:t}}))(n,(0,_.move)(t.columnIndex,r.columnIndex,i)))},this.changeColumnsListHandle=e=>{let{columns:t}=e;const{entityTypeUri:r,dispatch:n,headColumns:a}=this.props;n(Np(r,t,a))},this.changeColumnsSizeHandle=e=>{const{headColumns:t,entityTypeUri:r,dispatch:n}=this.props,a=t.map(((t,r)=>{var n;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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){kj(e,t,r[t])}))}return e}({},t,{size:e[r].size,autoResize:(null!==(n=t.autoResize)&&void 0!==n?n:0!==r)&&!e[r].manuallyChanged})}));n(((e,t)=>({type:Qn,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,_.path)(["headColumns","length"],e)||(0,_.difference)((0,_.omit)(["size"],t),(0,_.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 v().createElement(ET,{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})}}Lj.propTypes={entities:OE().array,entityToHighlight:OE().string,selectedEntityUri:OE().string,headColumns:OE().array,onScroll:OE().func,entityTypeUri:OE().string,sortField:OE().string,sortOrder:OE().oneOf([Ub.oy,Ub.U9]),dndColumnReorderingEnabled:OE().bool,dispatch:OE().func,additionalColumns:OE().arrayOf(OE().shape({id:OE().string,label:OE().string})),onEntityClick:OE().func,onEntityHover:OE().func,entitiesImportStatus:OE().object,onEntityImportStatusChange:OE().func,basicTableRef:OE().shape({current:OE().object})},Lj.defaultProps={entities:[],headColumns:[]};const Fj=(0,be.Z)(Jc),jj=(0,xE.connect)((e=>{const t=Cu(e),r=wu(e,t),n=Cr().selectors.getMetadata(e),a=Fj(n,t,r);return{sortField:rp(e,{entityTypeUri:Ou(e)}),sortOrder:np(e,{entityTypeUri:Ou(e)}),dndColumnReorderingEnabled:!gu(e),headColumns:r,entityTypeUri:t,additionalColumns:a}}))(Lj);var Uj=r(14058),Mj=r.n(Uj);const Vj=(0,AE.Z)((()=>({container:{position:"relative",height:"100%",width:"100%"},closeButton:{position:"absolute",top:"7px",left:"7px",zIndex:1}}))),Bj=(0,AE.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"}}}))),zj=e=>{let{className:t,entity:r,children:n,classes:a,renderLabel:i=_.identity}=e;const o=Bj({classes:a}),l=(0,w.AH)(),s=(0,w.QQ)(),c=(0,b.useCallback)((()=>{navigator.clipboard.writeText((0,x.getEntityId)(r))}),[r]);if((0,_.isNil)(r))return null;const u=(0,x.getLabel)(r.label),p=r.secondaryLabel,d=(0,x.getBusinessCardAttributesText)(l,r),m=(0,x.isActiveObject)(r),y=r.uri,f=(0,x.getEntityId)(r);return v().createElement("div",{className:O()(o.profileBandWrapper,t)},v().createElement("div",{className:O()(o.profileBand,{[o.inactive]:!m}),"data-entity-uri":y},v().createElement(A,{key:r.uri,entity:r,avatarClassName:o.profileIcon,imageClassName:o.imageProfileIcon}),v().createElement("div",{className:o.profileInfo},v().createElement("div",null,v().createElement(DT(),{variant:"h6",className:o.label},i(u)),p&&v().createElement(DT(),{variant:"subtitle2",className:o.secondaryLabel},p),d&&v().createElement(DT(),{variant:"subtitle1",className:o.businessCard},d)),v().createElement("div",{className:o.specialInfo},v().createElement("div",{className:o.entityType},v().createElement(_C,{entity:r,size:"medium",className:o.badge}),!(0,x.isTempUri)(y)&&s&&v().createElement(KO(),{title:L().text("Copy to clipboard")},v().createElement(DT(),{display:"inline",variant:"body2",className:o.entityId,onClick:c},L().text("Entity ID"),": ",f))))),n&&v().createElement("div",null,n)))},Hj=v().createContext(!1);Hj.displayName="BlockImageGalleryDialogContext";var Yj=r(31574),Wj=r.n(Yj);const Gj=v().createContext([]);var qj=r(24436),Zj=r.n(qj);function $j(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Kj(e,t,r[t])}))}return e}function Kj(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Qj=(0,AE.Z)((e=>({basicViewPaper:$j({display:"flex",flexDirection:"column"},e.basicView)})));function Xj(){return Xj=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Xj.apply(this,arguments)}const Jj=(0,b.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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["children","className"]);const i=Qj();return v().createElement(Zj(),Xj({ref:t,className:n,classes:{root:i.basicViewPaper}},a),r)}));Jj.displayName="BasicView";var eU=r(52574);const tU="1px solid #AFD4E9",rU=(0,AE.Z)({decorator:{marginLeft:8,borderLeft:tU,"&:last-child":{borderLeft:"none","&:before":{borderLeft:tU}},"&:before":{top:0,height:14,width:5,borderBottom:tU,content:'""',display:"block",left:"0"},"&$plain":{"&:before":{width:0}}},plain:{},wrapper:{marginLeft:16,marginTop:-8}}),nU=e=>{let{className:t,children:r,plain:n=!1,enabled:a=!1}=e;const i=rU();return a?v().createElement("div",{"data-reltio-id":"branch-decorator",className:O()(i.decorator,{[i.plain]:n},t)},v().createElement("div",{className:i.wrapper},r)):v().createElement(v().Fragment,null,r)},aU="commentsContainerVisibilityArea",iU=v().createContext([]);iU.displayName="RelatedObjectUrisContext";const oU=()=>{},lU=v().createContext({comments:[],commentsMap:null,currentComment:null,updateCommentState:oU,clearCommentState:oU,getCommentState:()=>({}),getComment:oU,getComments:()=>new Promise(oU),getCommentsCount:oU,createComment:()=>new Promise(oU),editComment:()=>new Promise(oU),createReply:()=>new Promise(oU),resolveThread:oU,reOpenThread:oU,clearCurrentComment:oU,deleteComment:oU,sending:!1,loading:!1,pageToken:null,deleteReply:oU,editReply:()=>new Promise(oU)});function sU(){return sU=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},sU.apply(this,arguments)}lU.displayName="CollaborationContext";const cU=e=>v().createElement("svg",sU({width:20,height:20,fillOpacity:.54,fill:"#000",fillRule:"nonzero",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},e),v().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"})),uU=(0,AE.Z)((()=>({root:{position:"relative",height:"18px",display:"flex",alignItems:"center",justifyContent:"center",marginLeft:"4px",cursor:"pointer"},icon:{"&:hover":{fillOpacity:.7}}})));function pU(){return pU=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},pU.apply(this,arguments)}const dU=v().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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["children","tooltipTitle","icon","onClick","className"]);const s=uU();return v().createElement(KO(),{title:n},v().createElement("div",pU({ref:t,className:O()(s.root,o),onClick:i},l),v().createElement(a,{className:s.icon}),r))}));dU.displayName="BasicCommentButton";const mU=(0,AE.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"}}),yU=v().forwardRef(((e,t)=>{let{children:r,onClick:n}=e;const a=mU();return v().createElement(dU,{ref:t,tooltipTitle:L().text("Show comment"),icon:cU,onClick:n,"data-reltio-id":"reltio-comment-button"},v().createElement("div",{className:a.childrenWrapper},r))}));function fU(){return fU=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},fU.apply(this,arguments)}yU.displayName="CommentButton";const gU=e=>v().createElement("svg",fU({width:20,height:20,fillOpacity:.54,fill:"#000",fillRule:"nonzero",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg"},e),v().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"})),hU=e=>{let{className:t,onClick:r}=e;return v().createElement(dU,{className:t,onClick:r,tooltipTitle:L().text("Add comment"),icon:gU})};var EU=r(94511),bU=r.n(EU),vU=r(7421);const TU=(0,AE.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 OU(){return OU=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},OU.apply(this,arguments)}const xU=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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["children","className","classes","transition"]);const o=TU(),l=a?bU():v().Fragment,[s,c]=(0,b.useState)(null);return v().createElement(vU.Z,OU({className:O()(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),(e=>{let{TransitionProps:r}=e;return v().createElement(l,r,v().createElement(Zj(),{className:O()(o.paper,null==n?void 0:n.root)},v().createElement("span",{className:O()(o.arrow,null==n?void 0:n.arrow),ref:c}),t))}))};var SU=r(93526),CU=r.n(SU);const wU=(0,AE.Z)((e=>({menuItem:{minHeight:"32px"},menuText:{color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px",letterSpacing:0}}))),AU=(0,Eb.T)(ab()),RU=(0,b.forwardRef)(((e,t)=>{let{item:r,onMenuClose:n=_.identity}=e;const a=wU(),{disabled:i,text:o,tooltip:l,onClick:s,id:c="",selectable:u,selected:p}=r;return v().createElement(AU,{tooltipTitle:l,showForDisabled:!0,classes:{root:a.menuItem},onClick:e=>{n(e),s(e)},disabled:i,ref:t,"data-modal":!0,"data-reltio-id":`reltio-search-menu-item${c}`},u&&v().createElement(rb(),{checked:p,color:"primary"}),v().createElement(DT(),{classes:{root:a.menuText}},o))}));RU.displayName="DefaultMenuItemRenderer";const _U=(0,AE.Z)((e=>({buttonRoot:{"&$selected":{color:e.palette.action.active,backgroundColor:(0,Mv.alpha)(e.palette.action.active,.12),"&:hover":{backgroundColor:(0,Mv.alpha)(e.palette.action.active,.15)}}},selected:{},paper:{minWidth:"112px"}})));function NU(){return NU=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},NU.apply(this,arguments)}function IU(e){let{className:t,menuId:r,buttonComponent:n=yC(),buttonContent:a,menuItems:i=[],buttonProps:o={},popoverProps:l={},onMenuOpen:s=_.identity,onMenuClose:c=_.identity,MenuItemRenderer:u=RU}=e;const p=n,d=_U(),m=(0,b.useRef)(),[y,f]=(0,b.useState)(!1);(0,PC.D)((()=>{y?s():c()}),[y]);const g=(0,b.useCallback)((e=>{null==e||e.stopPropagation(),f((e=>!e))}),[]);return v().createElement(v().Fragment,null,v().createElement(p,NU({"data-reltio-id":"drop-down-menu-button",ref:m,className:O()(d.buttonRoot,{[d.selected]:y},t),onClick:g,"aria-pressed":y,"aria-controls":y?r:void 0,"aria-haspopup":"true"},o),a),v().createElement(CU(),NU({id:r,variant:"menu",open:y,autoFocus:!1,classes:{paper:d.paper},anchorEl:m.current,onClose:g,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},elevation:2,MenuListProps:{autoFocusItem:y}},l),i.map(((e,t)=>v().createElement(u,{item:e,key:t,onMenuClose:g})))))}const DU=(e,t)=>{(0,b.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])},PU=(e,t)=>{const r=e.relatedObjectUris.indexOf(t);if(r>=0)return e.relatedObjectUris[1-r]},kU=e=>`${L().date(e,"LT")} ${L().date(e,"LL")}`,LU=e=>`comment/${e.commentId}`,FU=(e,t)=>`comment/${e.commentId}/reply/${t.replyId}`,jU=(e,t)=>{let r=e;for(const e of t)r=r.split(`+${e}`).join(`@[${e}](${e})`);return r},UU=v().createContext({});UU.displayName="EntitiesMapContext";const MU=(0,AE.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 VU(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const BU=e=>{let{comment:t,className:r}=e;const n=MU(),a=(0,b.useContext)(UU),i=(0,w.AH)(),o=(0,w.eh)();return v().createElement(Wj(),{className:r},(()=>{switch(t.objectType){case x.CollaborationObjectTypes.ENTITY_ATTRIBUTE:{const e=(0,x.getAttributeTypeUriByValueUri)(t.objectId,o.type),r=(0,x.findAttributeTypeByUri)(i,e);return v().createElement(v().Fragment,null,v().createElement(DT(),{className:n.title},L().text("Selected attribute:")),v().createElement(DT(),{className:n.label},null==r?void 0:r.label))}case x.CollaborationObjectTypes.RELATION_ATTRIBUTE:{const e=t.relatedObjectUris.find((0,_.startsWith)("configuration/relationTypes")),r=e&&(0,x.getAttributeTypeUriByValueUri)(t.objectId,e),a=r&&(0,x.findAttributeTypeByUri)(i,r);return v().createElement(v().Fragment,null,v().createElement(DT(),{className:n.title},L().text("Selected attribute:")),v().createElement(DT(),{className:n.label},null==a?void 0:a.label))}case x.CollaborationObjectTypes.ENTITY:return v().createElement(v().Fragment,null,v().createElement(DT(),{className:n.title},L().text("Selected profile:")),v().createElement(Kb,{className:O()(n.label,n.link),value:(0,x.getEntityUriForLink)(o)},(0,x.getLabel)(o.label)));case x.CollaborationObjectTypes.RELATION:{const e=PU(t,o.uri),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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){VU(e,t,r[t])}))}return e}({},a[e]||{},{uri:e});return v().createElement(v().Fragment,null,v().createElement(DT(),{className:n.title},L().text("Selected relation:")),v().createElement(DT(),{className:n.label},v().createElement(Kb,{className:n.link,value:(0,x.getEntityUriForLink)(o)},(0,x.getLabel)(o.label)),e&&v().createElement(v().Fragment,null,` ${L().text("to")} `,v().createElement(Kb,{className:n.link,value:(0,x.getEntityUriForLink)(r)},r.label?(0,x.getLabel)(r.label):(0,x.getEntityId)(r)))))}case x.CollaborationObjectTypes.POTENTIAL_MATCH:{var e;const r=PU(t,o.uri),i={uri:r,label:null===(e=a[r])||void 0===e?void 0:e.label};return v().createElement(v().Fragment,null,v().createElement(DT(),{className:n.title},L().text("Selected potential match:")),v().createElement(DT(),{className:n.label},v().createElement(Kb,{className:n.link,value:(0,x.getEntityUriForLink)(o)},(0,x.getLabel)(o.label)),r&&v().createElement(v().Fragment,null,` ${L().text("and")} `,v().createElement(Kb,{className:n.link,value:(0,x.getEntityUriForLink)(i)},i.label?(0,x.getLabel)(i.label):(0,x.getEntityId)(i)))))}default:return null}})())},zU=v().createContext([]);zU.displayName="UsersContext";const HU=(0,AE.Z)((e=>({root:{color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px",wordBreak:"break-word"}}))),YU=e=>{let{comment:t,className:r}=e;const n=HU(),a=(0,b.useContext)(zU);return v().createElement(DT(),{className:O()(n.root,r)},function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e=>e,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"+";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}(t.content,t.namedUsers,(e=>{const t=a.find((t=>t.username===e.slice(1)));return t?v().createElement(zT(),{href:`mailto:${t.email}`,underline:"hover"},e):e})).map(((e,t)=>v().createElement(b.Fragment,{key:t},e))))},WU=(0,AE.Z)((e=>({root:{width:"32px",height:"32px",fontSize:"12px",color:e.palette.text.secondary,backgroundColor:"rgba(144, 164, 174, 0.2)"}})));function GU(){return GU=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},GU.apply(this,arguments)}const qU=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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","children"]);const a=WU();return v().createElement(C(),GU({},n,{className:O()(a.root,t)}),r.split(".").map((e=>e[0].toUpperCase())).join(""))};var ZU=r(2271);const $U=r(47503).$+1,KU=(0,AE.Z)((e=>({root:{backgroundColor:"#fff",fontFamily:"Roboto"},mentionsControl:{fontSize:"13px"},mentionsHighlighter:{padding:"10px 22px",border:"1px solid transparent !important","&::before":{content:e=>{let{placeholder:t}=e;return t&&`"${t}"`}}},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:$U+"!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)",transform:"translateY(-100%)"},mentionsSuggestionsList:{maxHeight:"200px",overflowY:"scroll"},mentionsSuggestionsItem:{padding:"6px 12px",color:e.palette.text.primary,fontSize:"13px",transition:e.transitions.create(["background-color"]),"&:hover, &--focused":{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 QU(){return QU=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},QU.apply(this,arguments)}const XU=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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["onChange","className","value","placeholder"]);const o=KU({placeholder:n?"":a}),l=(0,b.useContext)(zU);return v().createElement("div",{className:O()(o.root,r)},v().createElement(ZU.r,QU({},i,{value:n,placeholder:a,onChange:(e,r,n,a)=>{t(r,n,(0,_.uniq)(a.map((e=>{let{display:t}=e;return t.slice(1)}))))},className:"mentionsTextArea",suggestionsPortalHost:document.body,classNames:{mentionsTextArea__input:o.mentionsInput,mentionsTextArea__highlighter:o.mentionsHighlighter,mentionsTextArea__control:o.mentionsControl,mentionsTextArea__suggestions:o.mentionsSuggestions,mentionsTextArea__suggestions__list:o.mentionsSuggestionsList,mentionsTextArea__suggestions__item:o.mentionsSuggestionsItem}}),v().createElement(ZU.p,{trigger:"+",data:l.map((e=>{let{username:t}=e;return{id:t,display:t}})),displayTransform:(e,t)=>`+${t}`,appendSpaceOnAdd:!0,className:o.mention})))},JU=(0,AE.Z)({root:e=>{let{isEditing:t}=e;return{padding:t?"6px 6px 6px 0":" 6px 6px 6px 8px",borderRadius:"4px",backgroundColor:t?"transparent":"rgba(0,114,206,0.06)"}},textField:e=>{let{isEditing:t}=e;return{width:t?"100%":"calc(100% - 40px)"}},form:{marginBottom:0},main:{display:"flex",alignItems:"center"},avatar:{marginRight:"8px"},buttons:e=>{let{isEditing:t}=e;return{marginLeft:t?"0":"40px",marginTop:"8px"}},button:{"& + $button":{marginLeft:"8px"}}}),eM=e=>{switch(e){case"open":return L().text("Reply...");case"resolved":return L().text("Adding a comment will re-open this");default:return""}},tM=e=>{let{inputRef:t,className:r,uri:n,relatedObjectUris:a,objectType:i,popperRef:o,comment:l,reply:s,isEditingComment:c,isEditingReply:u,onCancel:p}=e;const d=c||u,m=JU({isEditing:d}),[y,f]=(0,b.useState)(!1),{createReply:g,createComment:h,sending:E,editComment:T,editReply:x,getCommentState:S,updateCommentState:C,clearCommentState:A}=(0,b.useContext)(lU),R=(0,w.qg)(),N=(e=>{let{comment:t,reply:r,isEditingComment:n,isEditingReply:a}=e;return(0,_.isNil)(t)?"comment/new":n?LU(t):a?FU(t,r):(e=>`comment/${e.commentId}/reply/new`)(t)})({comment:l,reply:s,isEditingComment:c,isEditingReply:u}),I=(e=>{let{comment:t,reply:r,isEditingComment:n,isEditingReply:a}=e;const i=n?t:a?r:null,{content:o="",namedUsers:l=[]}=i||{};return{value:jU(o,l),plainTextValue:o,mentions:l}})({comment:l,reply:s,isEditingComment:c,isEditingReply:u}),{value:D=I.value,plainTextValue:P=I.plainTextValue,mentions:k=I.mentions}=S(n,N),F=""!==D.trim(),j=y||F,U=null==l?void 0:l.status,M=()=>{null==p||p(),A(n,N)};(0,b.useEffect)((()=>{o&&o.current.forceUpdate()}),[o,j]);const V=d?"small":"medium";return v().createElement(Wj(),{className:O()(m.root,r)},v().createElement("form",{onSubmit:e=>(e.preventDefault(),(0,_.cond)([[(0,_.always)(!l),()=>h({content:P,namedUsers:k,objectType:i,uri:n,relatedObjectUris:a})],[(0,_.always)(c),()=>T({content:P,namedUsers:k,commentId:l.commentId,objectType:i,replies:l.replies,relatedObjectUris:a,uri:n})],[(0,_.always)(u),()=>x({content:P,namedUsers:k,commentId:l.commentId,replyId:s.replyId})],[_.T,()=>g({content:P,namedUsers:k,commentId:l.commentId,action:"open"===l.status?"none":"reopen",uri:n})]])().then(M).catch(console.log)),className:m.form},v().createElement(Wj(),{className:m.main},!d&&v().createElement(qU,{classes:{root:m.avatar}},R),v().createElement(XU,{className:m.textField,disabled:E,onChange:(e,t,r)=>C(n,N,{value:e,plainTextValue:t,mentions:r}),inputRef:t,value:D,onFocus:()=>f(!0),onBlur:()=>f(!1),placeholder:eM(U)})),j&&v().createElement(Wj(),{className:m.buttons},v().createElement(yC(),{className:m.button,variant:"contained",color:"primary",disabled:!F||E,type:"submit",size:V},((e,t,r)=>t||r?L().text("Edit"):"open"===e||"resolved"===e?L().text("Reply"):L().text("Comment"))(U,c,u)),v().createElement(yC(),{disabled:E,onClick:()=>M(),className:m.button,variant:"outlined",color:"primary",size:V},L().text("Cancel")))))},rM=(0,AE.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"}}))),nM=e=>{let{onReply:t,className:r,uri:n,comment:a,relatedObjectUris:i,objectType:o}=e;const l=rM(),s=(0,b.useRef)(),c=(0,w.qg)(),{commentId:u,createdBy:p,createdTime:d,status:m}=a,y="resolved"===m,f=p===c,{resolveThread:g,reOpenThread:h,sending:E,deleteComment:T,updateCommentState:O,getCommentState:x}=(0,b.useContext)(lU),S=LU(a),{isEditing:C}=x(n,S),A=(0,b.useCallback)((e=>O(n,S,{isEditing:e})),[S,O,n]);DU(s,C);const R=(0,b.useMemo)((()=>y?[{text:L().text("Delete"),onClick:()=>T({uri:n,commentId:u})}]:[{text:L().text("Edit"),onClick:()=>A(!0)},{text:L().text("Delete"),onClick:()=>T({uri:n,commentId:u})}]),[u,T,y,A,n]),_=v().createElement(tM,{inputRef:s,uri:n,relatedObjectUris:i,objectType:o,onCancel:()=>A(!1),isEditingComment:C,comment:a});return v().createElement(Wj(),{className:r},v().createElement(Wj(),{className:l.header},v().createElement(qU,{classes:{root:l.avatar}},p),v().createElement(Wj(),{width:"100%"},v().createElement(DT(),{className:l.username},p)),v().createElement(DT(),{className:l.createdAt},kU(d)),f&&v().createElement(IU,{buttonComponent:_b.k,buttonProps:{icon:Hb(),tooltipTitle:L().text("Open menu")},popoverProps:{PopoverClasses:{root:l.dropdownMenu}},menuItems:R,menuId:"collaboration-comment-menu"})),v().createElement(Wj(),{className:l.body},v().createElement(BU,{comment:a,className:l.commentTarget}),C?_:v().createElement(YU,{comment:a,className:l.message}),v().createElement(Wj(),{className:l.buttons},v().createElement(zT(),{className:l.button,onClick:t,component:"button",underline:"hover"},L().text("Reply")),!y&&v().createElement(zT(),{disabled:E,className:l.button,onClick:()=>{g({commentId:u,uri:n})},component:"button",underline:"hover"},L().text("Resolve")),y&&v().createElement(zT(),{disabled:E,className:l.button,onClick:()=>{h({commentId:u,uri:n})},component:"button",underline:"hover"},L().text("Re-open")))))},aM=(0,AE.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"}}))),iM=e=>{let{className:t,reply:r,uri:n,comment:a,popperRef:i}=e;const o=(0,b.useRef)(),l=(0,w.qg)(),{createdBy:s,action:c,createdTime:u}=r,p=s===l&&"resolved"!==a.status,{deleteReply:d,updateCommentState:m,getCommentState:y}=(0,b.useContext)(lU),f=FU(a,r),{isEditing:g}=y(n,f),h=(0,b.useCallback)((e=>m(n,f,{isEditing:e})),[f,m,n]);DU(o,g);const E=aM(),T=(0,b.useMemo)((()=>[{text:L().text("Edit"),onClick:()=>h(!0)},{text:L().text("Delete"),onClick:()=>d({uri:n,commentId:a.commentId,reply:r})}]),[d,n,a.commentId,r,h]),x=v().createElement(tM,{inputRef:o,popperRef:i,uri:n,onCancel:()=>h(!1),isEditingReply:g,reply:r,comment:a});return v().createElement(Wj(),{className:O()(E.root,t)},v().createElement(qU,{classes:{root:E.avatar}},s),v().createElement(Wj(),{className:E.replyArea},v().createElement(Wj(),{className:E.header},v().createElement(DT(),{className:E.username},s),"resolve"===c&&v().createElement(DT(),{className:E.marked},L().text("Marked as resolved")),"reopen"===c&&v().createElement(DT(),{className:E.marked},L().text("Re-opened"))),"resolve"!==c&&(g?x:v().createElement(YU,{className:E.message,comment:r})),v().createElement(DT(),{className:E.createdAt},kU(u))),p&&v().createElement(IU,{buttonComponent:_b.k,buttonProps:{icon:Hb(),tooltipTitle:L().text("Open menu")},menuItems:T,menuId:"collaboration-comment-menu"}))},oM=(0,AE.Z)((()=>({root:{maxWidth:"100%",padding:"8px 4px 10px 16px"},messages:{},repliedComment:{marginBottom:"2px"},replies:{marginLeft:"40px"},sendMessageArea:{marginLeft:"40px"},comment:{}}))),lM=(0,b.memo)((e=>{let{uri:t,relatedObjectUris:r,objectType:n,classes:a,popperRef:i,messagesRef:o,comment:l}=e;const s=(0,b.useRef)(),c=oM({classes:a}),u=v().createElement(tM,{className:c.sendMessageArea,inputRef:s,popperRef:i,uri:t,relatedObjectUris:r,objectType:n,comment:l});return v().createElement(Wj(),{className:c.root},l&&v().createElement(v().Fragment,null,v().createElement("div",{className:c.messages,ref:o},v().createElement(nM,{comment:l,uri:t,onReply:()=>{s.current.focus()},className:c.comment,relatedObjectUris:r,objectType:n}),v().createElement(Wj(),{className:c.replies},l.replies.map((e=>v().createElement(iM,{key:e.replyId,className:c.repliedComment,reply:e,uri:t,comment:l}))))),u),!l&&u)})),sM=(0,AE.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:e=>{let{hasScroll:t}=e;return{marginLeft:"16px",marginRight:t?"2px":"8px"}},replies:e=>{let{hasScroll:t}=e;return{marginLeft:"8px",marginRight:t?"2px":"8px"}},sendMessageArea:e=>{let{hasScroll:t,scrollWidth:r}=e;return{marginLeft:"8px",marginRight:t?r+2:"8px"}},messages:{maxHeight:"400px",overflowY:"auto"}}))),cM=e=>{let{uri:t,relatedObjectUris:r,objectType:n,anchorEl:a,onClose:i,open:o,comment:l}=e;const[s,c]=(0,b.useState)(0),u=sM({scrollWidth:s,hasScroll:0!==s}),p=(0,b.useRef)(null),{resolveThread:d,loading:m,sending:y}=(0,b.useContext)(lU),f=1+(null==l?void 0:l.replies.length);return v().createElement(xU,{popperRef:p,anchorEl:a,open:o,placement:"right-start",onClose:i,className:u.popper},v().createElement(Wj(),{className:u.header},v().createElement(Wj(),{className:u.headerInfo},v().createElement(DT(),{className:u.title},L().text("Comments")),l&&!m&&v().createElement(DT(),{className:u.counter},L().number(f)," ",1===f?L().text("item"):L().text("items"))),l&&!m&&v().createElement(_b.k,{className:u.resolveButton,size:"S",onClick:()=>{d({commentId:l.commentId,uri:t})},disabled:y,showForDisabled:!0,tooltipTitle:L().text("Resolve"),icon:Av(),color:"primary"})),!m&&v().createElement(lM,{popperRef:p,messagesRef:e=>{e&&c(e.offsetWidth-e.clientWidth)},classes:{root:u.collaborationItem,replies:u.replies,sendMessageArea:u.sendMessageArea,messages:u.messages,comment:u.comment},uri:t,relatedObjectUris:r,objectType:n,comment:l}))},uM=(0,AE.Z)((()=>({root:{display:"flex",alignItems:"start"},addButton:{visibility:"hidden","&$showAlways":{visibility:"visible"},".commentsContainerVisibilityArea:hover &":{visibility:"visible"}},showAlways:{}}))),pM=e=>{let{className:t,uri:r,objectType:n,relatedObjectUris:a,onChangePopupVisibility:i,allowOnlyOneComment:o=!1,showAlways:l=!1}=e;const s=uM(),[c,u]=(0,b.useState)(null),[p,d]=(0,b.useState)(!1),m=p&&Boolean(c),{currentComment:y,commentsMap:f,getComment:g,clearCurrentComment:h,objectTypes:E}=(0,b.useContext)(lU),T=!!f&&(!E||E.includes(n)),x=((null==f?void 0:f[r])||[]).filter((e=>{let{status:t}=e;return"resolved"!==t})).reverse(),S=!o||o&&0===x.length,C=null===y&&m;(0,PC.D)((()=>{i&&i(m)}),[m]);const w=(0,b.useContext)(iU),A=(0,b.useMemo)((()=>w?[...a,...w]:a),[w,a]);return T&&v().createElement("div",{className:O()(s.root,t)},S&&v().createElement(hU,{className:O()(s.addButton,{[s.showAlways]:l||C}),onClick:e=>{u(e.currentTarget),d(!0)}}),x.map((e=>{let{replies:t,commentId:r}=e;return v().createElement(yU,{ref:r===(null==y?void 0:y.commentId)?u:null,key:r,onClick:()=>(e=>{g(e),d(!0)})(r)},1+t)})),v().createElement(cM,{anchorEl:c,open:m,onClose:()=>{u(null),h(),d(!1)},uri:r,relatedObjectUris:A,objectType:n,comment:y}))},dM=(0,AE.Z)({label:{color:"rgba(0,0,0,0.6)",fontSize:"13px",lineHeight:"16px"}});function mM(){return mM=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},mM.apply(this,arguments)}const yM=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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["label","isRequired","className"]);const i=dM();return v().createElement(DT(),mM({className:O()(i.label,n),component:"span"},a),t,r&&v().createElement(fb,null))},fM=v().createContext(null);fM.displayName="EntityContext";const gM=(0,AE.Z)((e=>({container:{height:"16px",borderColor:(0,Mv.alpha)(e.palette.primary.main,.54)},label:{paddingLeft:"4px",paddingRight:"4px",fontSize:"10px",lineHeight:"11px",color:e.palette.primary.main}}))),hM=(0,Eb.T)(ax()),EM=e=>{let{className:t,attributeType:r,nonOvValues:n=[],nonOvTotal:a}=e;const i=gM(),o=(0,w.ax)("openEntity"),l=((e,t,r)=>{var n;const a=null==t||null===(n=t[0])||void 0===n?void 0:n.uri,i=a?(0,x.getEntityUriFromAttributeUri)(a):null;if(i&&(0,x.isEntityUri)(i)){const t=(0,x.getEntityUriFromAttributeUri)(r.uri);if(!e||e.type===t)return{uri:i,type:t};const n=(0,x.getParentUri)(a),o=(0,x.findAttributeValueByUri)(e,n);return{uri:(0,x.getReferencedEntityUriFromAttrValue)(o),type:t}}return e?{uri:e.uri,type:e.type}:null})((0,b.useContext)(fM),n,r),s=(0,w.fC)(null==l?void 0:l.type),c=(0,b.useCallback)((()=>{o({uri:l.uri,screen:"sources"})}),[o,l]);if(!a)return null;const u=n.length?n.map(((e,t)=>v().createElement("div",{key:t},(0,x.isComplexAttribute)(r)?(0,x.getLabel)(e.label):v().createElement(ev.x,{value:(0,x.getAttributeValue)(e),dataTypeDefinition:(0,x.getAttrDataTypeDefinition)(r),rich:!1})))):null;return v().createElement(hM,{tooltipTitle:u,tooltipPlacement:"bottom",label:`+ ${a}`,variant:"outlined",onClick:null!=l&&l.uri&&s?c:void 0,classes:{root:O()(i.container,t),label:i.label}})};function bM(){return bM=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},bM.apply(this,arguments)}const vM=e=>v().createElement("svg",bM({width:12,height:12,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),v().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})),TM=v().createContext({showDescription:!1,showNavigateToGraph:!0});TM.displayName="FeaturesContext";const OM=(0,AE.Z)((()=>({icon:{display:"inline-flex",marginLeft:"8px",verticalAlign:"middle"}}))),xM=e=>{let{className:t,description:r}=e;const{showDescription:n}=(0,b.useContext)(TM),a=OM();return r&&n?v().createElement(KO(),{title:r,placement:"bottom"},v().createElement("span",{"data-reltio-id":"reltio-description-icon",className:O()(a.icon,t)},v().createElement(vM,null))):null},SM=v().createContext({appearance:void 0,attributes:void 0,roles:void 0,tags:void 0});SM.displayName="HistoryDiffContext";const CM=v().createContext({highlightedValuesUris:[],highlightedClassName:""});function wM(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}CM.displayName="HighlightedValuesContext";const AM=(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=RM(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}),[])},RM=(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,x.findAttributeTypeByUri)(t,n.type);a&&"object"!=typeof a&&(0,x.isOv)(n)?e.push(_M(a,i)):a&&"object"==typeof a&&!Array.isArray(a)&&e.push(AM(i,a,r,t))}return e}),[])},_M=(e,t)=>{switch(null==t?void 0:t.type){case x.DataTypes.TYPE_DATE:return new Date(e).getTime();case x.DataTypes.TYPE_TIMESTAMP:return isNaN(Number(e))?new Date(e).getTime():new Date(Number(e)).getTime();default:return e}};function NM(){return NM=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},NM.apply(this,arguments)}const IM=e=>v().createElement("svg",NM({width:11,height:11,viewBox:"0 0 11 11"},e),v().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"})),DM=(0,AE.Z)((e=>({link:{color:e.palette.primary.main,textDecoration:"none"}}))),PM=(0,b.forwardRef)(((e,t)=>{let{value:r,attributeType:n,children:a,className:i,onClick:o}=e;const l=DM(),{generatePivotingUrl:s}=(0,b.useContext)(Zb),c=s({uiPath:(0,w.Qh)(),uri:n.uri,value:JSON.stringify(r)}),u=(0,b.useCallback)((e=>{(0,SE.rR)(e)||(o(),e.preventDefault()),e.stopPropagation()}),[o]);return v().createElement("a",{ref:t,href:c,onClick:u,className:O()(l.link,i)},a)}));PM.displayName="PivotingUriLink";const kM=PM,LM=(0,AE.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"}}))),FM=e=>{let{attributeType:t,label:r,entities:n,generatedValue:a,onSeeAllClick:i,total:o}=e;const l=LM(),s=o>6,c=Boolean(r);return v().createElement("div",{className:l.container},v().createElement("div",{className:l.header},v().createElement("div",{className:l.title},L().text("Pivot profiles")),v().createElement("div",{className:l.divider}),v().createElement("div",{className:l.headerCount},L().number(o,"0,0")+" "+(1===o?L().text("item"):L().text("items")))),c&&v().createElement("div",{className:l.entityTypeLabel},r),v().createElement("div",{className:l.body},n.map((e=>v().createElement("div",{key:e.uri,className:l.entityContainer},v().createElement(A,{entity:e,avatarClassName:l.profileIcon}),v().createElement(Kb,{className:l.entityLabel,value:(0,x.getEntityUriForLink)(e)},(0,x.getLabel)(e.label)))))),s&&v().createElement("div",{className:l.footer},v().createElement(kM,{value:a,attributeType:t,className:l.seeAllButton,onClick:i},L().text("See all"))))},jM=(0,AE.Z)((e=>({icon:{marginRight:"8px",verticalAlign:"middle",width:"12px",height:"12px"},content:{color:e.palette.primary.main,cursor:"pointer",lineHeight:"16px"}}))),UM=(0,AE.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"}}}),MM=e=>{let{value:t,attributeType:r,children:n,className:a}=e;const i=UM(),o=jM(),l=(0,b.useContext)(Gj)||[],s=(0,w.ax)("openPivotingPerspective"),c=(0,w.AH)()||{},u=(0,x.isNested)(r)?AM(r,t.value,l,c):_M(t.lookupCode||t.value,r),p=l.some((e=>{let{uri:t}=e;return t===r.uri}))&&(Array.isArray(u)&&u.length||!Array.isArray(u)&&!(0,_.isNil)(u)),d=l.find((e=>{let{uri:t}=e;return t===r.uri})),m=null==d?void 0:d.popup,y=p?Array.isArray(u)?u.map((e=>Object.fromEntries(Object.entries(e).map((e=>{let[t,r]=e;return[(0,x.getLastUriPart)(t),r]}))))):((e,t)=>[{[e.name]:t}])(r,u):void 0,f=()=>{s({value:y,attributeType:r})},{entities:g,total:h,loadPivotingData:E}=(e=>{let{value:t,attributeType:r,entityType:n}=e;const[a,i]=(0,b.useState)([]),[o,l]=(0,b.useState)(0),s=(0,WS._)(),c=(0,w.eh)(),u=(0,w.mU)(),p=n||(null==c?void 0:c.type),d=(0,b.useMemo)((()=>(0,x.convertPivotingValueToSearchFilters)({value:t,attributeType:r,entityType:p})),[r,p,t]),m=(0,b.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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){wM(e,t,r[t])}))}return e}({max:6,sort:"label"},u||{})),[u]),y=(0,b.useCallback)((()=>{s(Promise.all([(0,x.getFilteredEntities)({filters:d,options:m}),(0,x.getTotals)({filters:d,options:m})])).then((e=>{const[t,{total:r}]=e;i(Array.isArray(t)?t:[]),l(r)})).catch((()=>{i([]),l(0)}))}),[d,m,s]);return{entities:a,total:o,loadPivotingData:y}})({attributeType:r,value:u,entityType:null==m?void 0:m.entityType});return p?v().createElement(KO(),{arrow:!0,placement:"right-start",classes:i,disableInteractive:!1,onOpen:E,title:v().createElement(FM,{generatedValue:y,attributeType:r,label:null==m?void 0:m.label,onSeeAllClick:f,entities:g,total:h})},v().createElement("span",{className:a},v().createElement(IM,{className:o.icon}),v().createElement(kM,{onClick:f,className:o.content,value:y,attributeType:r},n))):v().createElement(v().Fragment,null,n)};function VM(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){BM(e,t,r[t])}))}return e}function BM(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const zM=(0,AE.Z)((e=>({root:{display:"flex",alignItems:"start",justifyContent:"space-between"},commentsContainer:{height:"15px",marginRight:"-4px"},attributeValue:{verticalAlign:"middle",wordBreak:"break-all"},updateAttribute:VM({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},x.historyPalettes[x.HistoryOperations.updateAttribute],{"& > a":{color:x.historyPalettes[x.HistoryOperations.updateAttribute].color}}),insertAttribute:VM({width:"fit-content"},x.historyPalettes[x.HistoryOperations.insertAttribute],{"& > a":{color:x.historyPalettes[x.HistoryOperations.insertAttribute].color}}),deleteAttribute:VM({width:"fit-content",padding:"0 4px",marginLeft:"-4px",textDecoration:"line-through"},x.historyPalettes[x.HistoryOperations.deleteAttribute],{"& > a":{color:x.historyPalettes[x.HistoryOperations.deleteAttribute].color}}),multilineAttribute:{width:"fit-content"},ovFalse:e.inactive}))),HM=e=>{let{className:t,attributeType:r=null,attributeValue:n,inlined:a}=e;const i=zM(),{highlightedValuesUris:o=[],highlightedClassName:l}=(0,b.useContext)(CM),{appearance:s}=(0,b.useContext)(SM),c=(0,x.getHistoryAppearanceByUri)(n.uri,s),u=(0,x.getHistoryAttributeClassName)(c),p=v().createElement(ev.x,{value:(0,x.getAttributeValue)(n),dataTypeDefinition:(0,x.getAttrDataTypeDefinition)(r)}),d=(0,x.isRelationUri)(n.uri)?x.CollaborationObjectTypes.RELATION_ATTRIBUTE:x.CollaborationObjectTypes.ENTITY_ATTRIBUTE;return a||u?v().createElement("div",{className:O()(t,{[l]:o.includes(n.uri)})},v().createElement(MM,{value:n,attributeType:r,key:n.uri,className:O()({[i.multilineAttribute]:!a})},v().createElement("span",{className:O()(i.attributeValue,i[u],{[i.ovFalse]:!(0,x.isOv)(n)}),"data-reltio-id":"reltio-attribute-value"},p))):v().createElement("div",{className:O()(t,i.root,aU,{[l]:o.includes(n.uri)})},v().createElement(MM,{value:n,attributeType:r,key:n.uri},v().createElement("span",{className:O()(i.attributeValue,{[i.ovFalse]:!(0,x.isOv)(n)}),"data-reltio-id":"reltio-attribute-value"},p)),v().createElement(pM,{className:i.commentsContainer,uri:n.uri,relatedObjectUris:(0,x.createRelatedObjectUris)(d,{uri:n.uri}),objectType:d}))};var YM=r(84419),WM=r.n(YM);const GM=(0,AE.Z)({expandButton:{"&:hover":{backgroundColor:"transparent"}},expandIcon:{transition:"transform .15s ease"},expanded:{transform:"rotate(90deg)"}});function qM(){return qM=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},qM.apply(this,arguments)}const ZM=e=>{const t=GM(),{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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["expanded","className"]);return v().createElement(jE.T,qM({icon:WM(),size:"XXS",disableRipple:!0,iconClassName:O()(t.expandIcon,{[t.expanded]:r}),className:O()(n,t.expandButton),"data-reltio-id":"arrow-expand-button"},a))},$M=(0,AE.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 KM(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const QM=e=>{let{attributeTypesList:t,attributeValue:r,label:n,expanded:a=!1,children:i,showNonOv:o,attributeType:l,LabelRenderer:s,RightSlot:c}=e;const u=$M(),p=r.uri,[d,m]=(0,b.useState)(!1),{highlightedValuesUris:y=[],highlightedClassName:f}=(0,b.useContext)(CM);(0,b.useEffect)((()=>{m(a)}),[a]);const g=(t||[]).some((e=>(0,x.isAnalyticAttribute)(e))),h=(0,b.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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){KM(e,t,r[t])}))}return e}({attributes:g?null:r.value,analyticsAttributes:g?r.value:null},(0,x.isSpecialAttribute)(l)?r.value:{})),[r,g,l]),E=(0,x.isRelationUri)(r.uri)?x.CollaborationObjectTypes.RELATION_ATTRIBUTE:x.CollaborationObjectTypes.ENTITY_ATTRIBUTE;return v().createElement("div",{className:u.complexContainer},v().createElement("div",{className:O()(u.labelContainer,aU)},v().createElement(ZM,{onClick:()=>m((e=>!e)),expanded:d}),s?v().createElement(s,{attributeType:l,attributeValue:r}):v().createElement(v().Fragment,null,v().createElement(DT(),{component:"span",variant:"body2",classes:{body2:u.label},className:O()({[f]:y.includes(r.uri),[u.ovFalse]:!(0,x.isOv)(r)}),"data-reltio-id":"reltio-attribute-complex-label"},n),v().createElement("div",{className:u.spacer}),c&&v().createElement(c,{attributeType:l,attributeValue:r}),v().createElement(pM,{uri:r.uri,relatedObjectUris:(0,x.createRelatedObjectUris)(E,{uri:r.uri}),objectType:E}))),d&&v().createElement(jW,{attrTypes:t,entity:h,drawLines:!0,parentUri:p,showNonOv:o},i))};QM.propTypes={children:OE().node,label:OE().oneOfType([OE().string,OE().node]),attributeTypesList:OE().arrayOf(x.AttributeTypeType),attributeValue:OE().oneOfType([x.NestedAttributeValueType,x.ReferenceAttributeValueType]),expanded:OE().bool,showNonOv:OE().bool,attributeType:x.AttributeTypeType,LabelRenderer:OE().elementType,RightSlot:OE().elementType};var XM=r(71896);function JM(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){eV(e,t,r[t])}))}return e}function eV(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const tV=(0,AE.Z)({label:{textDecoration:"none",verticalAlign:"middle"},updateAttribute:JM({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},x.historyPalettes[x.HistoryOperations.updateAttribute]),insertAttribute:JM({width:"fit-content"},x.historyPalettes[x.HistoryOperations.insertAttribute]),deleteAttribute:JM({width:"fit-content",textDecoration:"line-through",padding:"0 4px",marginLeft:"-4px"},x.historyPalettes[x.HistoryOperations.deleteAttribute]),pivotingTooltip:{marginLeft:"4px"}});function rV(){return rV=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},rV.apply(this,arguments)}const nV=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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValue","attributeType"]);const a=tV(),{appearance:i}=(0,b.useContext)(SM),o=(0,b.useMemo)((()=>{const e=(0,x.getHistoryAppearanceByUri)(t.uri,i),n=(0,x.getHistoryAttributeClassName)(e),o=t.label?t.label:(0,x.evaluateDeepEntityLabel)(t,r.dataLabelPattern);return v().createElement(MM,{className:a.pivotingTooltip,value:t,attributeType:r},v().createElement(Wj(),{component:"span",className:O()(a[n],a.label)},v().createElement(XM.Z,{text:(0,x.getLabel)(o)})))}),[i,a,t,r]);return v().createElement(QM,rV({label:o,attributeValue:t,attributeTypesList:(0,x.getAttributeTypeSubAttributes)({},r),attributeType:r},n))};nV.propTypes=x.NestedAttributeType;const aV=(0,b.memo)(nV);var iV=r(24217),oV=r(16782);const lV=(0,AE.Z)((e=>({link:{color:e.palette.primary.main,textDecoration:"none"}})));function sV(){return sV=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},sV.apply(this,arguments)}const cV=e=>{const t=lV(),r=(0,oV.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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["href","className"]),o=O()(t.link,a);return r&&n?v().createElement(iV.rU,sV({to:n.replace(window.location.origin,""),className:o},i)):v().createElement("a",sV({href:n,className:o},i))};function uV(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){pV(e,t,r[t])}))}return e}function pV(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const dV=(0,AE.Z)((e=>({relationshipLabel:{marginLeft:"4px",color:e.palette.text.primary},updateAttribute:uV({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},x.historyPalettes[x.HistoryOperations.updateAttribute]),insertAttribute:uV({width:"fit-content"},x.historyPalettes[x.HistoryOperations.insertAttribute]),deleteAttribute:uV({width:"fit-content",textDecoration:"line-through",padding:"0 4px",marginLeft:"-4px"},x.historyPalettes[x.HistoryOperations.deleteAttribute]),ovFalse:e.inactive})));function mV(){return mV=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},mV.apply(this,arguments)}const yV=(0,b.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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValue","attributeType"]);const a=dV(),i=(0,w.AH)(),o=(0,w.Qh)(),l=(0,x.getReferencedEntityUriFromAttrValue)(t),s=(0,b.useMemo)((()=>(0,x.getAttributeTypeSubAttributes)(i,r)),[r,i]),{appearance:c}=(0,b.useContext)(SM),{generateEntityUrl:u}=(0,b.useContext)(Zb),p=(0,b.useMemo)((()=>{const e=(0,x.getHistoryAppearanceByUri)(t.uri,c),r=(0,x.getHistoryAttributeClassName)(e),n=null!=l&&l.startsWith("changeRequests")?"dcrReview":"profile";return v().createElement(cV,{href:(0,x.isEmptyValue)(c)?u({uiPath:o,uri:l,screen:n}):void 0,className:O()(a[r],{[a.ovFalse]:!(0,x.isOv)(t)})},v().createElement(XM.Z,{text:(0,x.getLabel)(t.label)}),t.relationshipLabel&&v().createElement("span",{className:a.relationshipLabel},v().createElement(XM.Z,{text:t.relationshipLabel})))}),[t,c,o,l,a,u]);return v().createElement(QM,mV({attributeTypesList:s,attributeValue:t,label:p,attributeType:r},n))}));yV.displayName="ReferenceAttribute";const fV=e=>{const{attributeType:t}=e;return class{static build(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(e.type){case x.DataTypes.TYPE_NESTED:return v().createElement(aV,t);case x.DataTypes.TYPE_REFERENCE:return v().createElement(yV,t);default:return v().createElement(HM,t)}}}.build(t,e)};function gV(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){hV(e,t,r[t])}))}return e}function hV(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const EV="13px",bV="16px",vV={titleRow:{display:"inline-block",minHeight:"16px"},title:{wordBreak:"break-all",verticalAlign:"middle"},ovIcon:{marginLeft:"8px",textIndent:0},descriptionIcon:{textIndent:0}},TV=(0,AE.Z)({paddingWrapper:{paddingTop:"3px",paddingBottom:"5px","&:last-child":{paddingBottom:"2px"}},paddingWrapperWithLines:{paddingBottom:"1px","&:last-child":{paddingBottom:"2px"}}}),OV=(0,AE.Z)(gV({wrapper:{fontSize:EV,lineHeight:bV},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"}},vV)),xV=(0,AE.Z)(gV({wrapper:{display:"flex",flexDirection:"column",alignItems:"flex-start",fontSize:EV,lineHeight:bV},attribute:{"&:last-child":{marginBottom:0},paddingLeft:"4px",paddingRight:"4px",marginLeft:"5px",marginBottom:"4px",whiteSpace:"pre-wrap",wordBreak:"break-word"},attributes:{alignSelf:"stretch"},titleRow:gV({},vV.titleRow,{marginBottom:"3px"})},vV)),SV=e=>{let{value:t,nonVisibleValues:r,attributeType:n,titleClassName:a,contentClassName:i,showNonOv:o,totalNonVisibleValues:l}=e;const s=OV(),{label:c,description:u}=n,p=(0,x.isRelationUri)(t.uri)?x.CollaborationObjectTypes.RELATION_ATTRIBUTE:x.CollaborationObjectTypes.ENTITY_ATTRIBUTE;return v().createElement("div",{"data-reltio-id":"one-line-renderer",className:O()(s.collaborationWrapper,aU)},v().createElement("div",{className:O()(s.titleRow,s.wrapper)},v().createElement(yM,{label:c,className:O()(s.title,a),"data-reltio-id":"reltio-attribute-label"}),v().createElement(xM,{description:u,className:s.descriptionIcon}),v().createElement(EM,{nonOvValues:r,attributeType:n,className:s.ovIcon,nonOvTotal:l}),v().createElement(fV,{className:O()(s.attribute,i),attributeValue:t,attributeType:n,showNonOv:o,inlined:!0})),v().createElement(pM,{uri:t.uri,relatedObjectUris:(0,x.createRelatedObjectUris)(p,{uri:t.uri}),objectType:p}))};var CV=r(33062),wV=r.n(CV);const AV=(0,AE.Z)({link:{display:"flex",marginTop:4},icon:{fontSize:"1rem"}}),RV=e=>{let{moreNumber:t,valueNumber:r,onClick:n}=e;const a=AV();return v().createElement(zT(),{"data-reltio-id":"show-more",component:"button",variant:"caption",className:a.link,onClick:n,underline:"none"},v().createElement(wV(),{className:a.icon}),t&&r?L().text("Show ${moreNumber} more of remaining ${valueNumber} value",{moreNumber:t,valueNumber:r}):L().text("Show more"))};var _V=r(86800),NV=r.n(_V);const IV=(0,AE.Z)({link:{display:"flex",marginTop:4},icon:{fontSize:"1rem"}}),DV=e=>{let{onClick:t}=e;const r=IV();return v().createElement(zT(),{component:"button",variant:"caption",className:r.link,onClick:t,underline:"none"},v().createElement(NV(),{className:r.icon}),L().text("Show less"))},PV=e=>{let{max:t,values:r,nonVisibleValues:n,totalVisibleValues:a,attributeType:i,parentUri:o,requestNextPageOfAttributeValues:l,titleClassName:s,contentClassName:c,showNonOv:u,totalNonVisibleValues:p}=e;const d=xV(),[m,y]=(0,b.useState)(t),f=t<a,g=f&&m<a,h=f&&m>=a,{label:E,description:T}=i,x=r.slice(0,m),S=a-m;return v().createElement("div",{"data-reltio-id":"multi-line-renderer",className:d.wrapper},v().createElement("div",{className:d.titleRow},v().createElement(yM,{label:E,className:O()(d.title,s),"data-reltio-id":"reltio-attribute-label"}),v().createElement(xM,{description:T}),v().createElement(EM,{nonOvValues:n,attributeType:i,className:d.ovIcon,nonOvTotal:p})),v().createElement("div",{className:d.attributes},x.map((e=>v().createElement(fV,{key:e.uri,className:O()(d.attribute,c),attributeValue:e,attributeType:i,showNonOv:u})))),g&&v().createElement(RV,{moreNumber:(0,_.min)(t,S),valueNumber:S,onClick:()=>{r.length<a&&l({parentUri:o,attributeTypeUri:i.uri,attributeTypeName:i.name,values:r,defaultMaxValues:t}),y(m+t)}}),h&&v().createElement(DV,{onClick:()=>{y(t)}}))};var kV=r(88941),LV=r.n(kV);function FV(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){jV(e,t,r[t])}))}return e}function jV(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const UV=(0,AE.Z)({attributeValue:{verticalAlign:"middle"},insertAttribute:FV({width:"fit-content"},x.historyPalettes[x.HistoryOperations.insertAttribute]),deleteAttribute:FV({width:"fit-content",textDecoration:"line-through",padding:"0 4px"},x.historyPalettes[x.HistoryOperations.deleteAttribute])}),MV=e=>{let{value:t}=e;const r=UV(),{appearance:n}=(0,b.useContext)(SM),a=(0,w.AH)(),i=(0,x.getHistoryAppearanceBySpecialAttributeValue)("roles",t,n),o=(0,x.getHistoryAttributeClassName)(i);return v().createElement("span",{className:O()(r.attributeValue,r[o])},(0,x.getRoleLabel)(a,t))},VV=e=>{let{className:t,values:r,Component:n,dataReltioId:a}=e;return v().createElement("div",{className:t,"data-reltio-id":a},r.map(((e,t)=>v().createElement(b.Fragment,{key:e},v().createElement(n,{value:e}),t<r.length-1&&", "))))},BV=e=>{let{className:t,values:r}=e;return v().createElement(VV,{values:r,className:t,dataReltioId:"reltio-attribute-value",Component:MV})};function zV(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){HV(e,t,r[t])}))}return e}function HV(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const YV=(0,AE.Z)({attributeValue:{verticalAlign:"middle"},insertAttribute:zV({width:"fit-content"},x.historyPalettes[x.HistoryOperations.insertAttribute]),deleteAttribute:zV({width:"fit-content",textDecoration:"line-through",padding:"0 4px"},x.historyPalettes[x.HistoryOperations.deleteAttribute])}),WV=e=>{let{value:t}=e;const r=YV(),n=(0,b.useContext)(fM),{appearance:a}=(0,b.useContext)(SM),{generateTagUrl:i}=(0,b.useContext)(Zb),o=(0,w.eh)(),l=(0,w.Qh)(),s=(0,x.getHistoryAppearanceBySpecialAttributeValue)("tags",t,a),c=(0,x.getHistoryAttributeClassName)(s),u=n||o;return v().createElement(cV,{className:O()(r.attributeValue,r[c]),href:i({uiPath:l,tag:t,entityUri:u.dataTenant?(0,x.getDataTenantEntityUri)(u):u.uri})},t)},GV=e=>{let{className:t,values:r}=e;return v().createElement(VV,{values:r,className:t,dataReltioId:"reltio-attribute-value",Component:WV})},qV=e=>{let{values:t,attributeType:r}=e;const n=OV(),{label:a}=r;return v().createElement("div",{"data-reltio-id":"special-renderer",className:O()(n.titleRow,n.wrapper)},(i=n.titleIcon,r.uri===x.EntityAttrTypes.tags.uri?v().createElement(LV(),{className:i}):null),v().createElement(yM,{label:a,className:n.title,"data-reltio-id":"reltio-attribute-label"}),(e=>{switch(r.uri){case x.EntityAttrTypes.tags.uri:return v().createElement(GV,{className:e,values:t});case x.EntityAttrTypes.roles.uri:return v().createElement(BV,{className:e,values:t});default:return v().createElement(fV,{className:e,attributeValue:{value:t[0],uri:""},attributeType:r,inlined:!0})}})(n.attribute));var i};var ZV=r(97986),$V=r.n(ZV);function KV(){return KV=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},KV.apply(this,arguments)}const QV=e=>v().createElement("svg",KV({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),v().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},v().createElement("path",{d:"M0 0h24v24H0z"}),v().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"}))),XV={SMALL:{imageWidth:114,imageHeight:114},MEDIUM:{imageWidth:162,imageHeight:162},LARGE:{imageWidth:192,imageHeight:192},OVERRIDE:{imageWidth:"unset",imageHeight:"unset"}};var JV=r(39034);const eB=(0,AE.Z)((e=>({root:{position:"relative"},image:e=>{let{imageWidth:t,imageHeight:r}=e;return{width:t,height:r,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 tB(){return tB=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},tB.apply(this,arguments)}const rB=(0,b.memo)((e=>{const{src:t,className:r,containerClassName:n,size:a=XV.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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["src","className","containerClassName","size","overlay"]),l=a||XV.SMALL,s=eB(l),[c,u]=(0,b.useState)(JV.o.LOADING);(0,b.useEffect)((()=>{u(JV.o.LOADING)}),[t]);const p=c===JV.o.LOADING,d=c===JV.o.LOADED;return c===JV.o.ERROR?v().createElement("div",tB({className:O()(s.defaultContainer,s.image,r)},o),v().createElement($V(),{className:s.defaultImage})):v().createElement("div",{className:O()(s.root,n)},!(0,x.isEmptyValue)(t)&&v().createElement("img",tB({src:t,className:O()(s.image,r,{[s.hideImage]:p}),onLoad:()=>{u(JV.o.LOADED)},onError:()=>{u(JV.o.ERROR)},alt:"image"},o)),p&&v().createElement("div",tB({className:O()(s.defaultContainer,s.image,r)},o),v().createElement(QV,{className:s.defaultImage})),d&&i)})),nB={imageMargin:4,imageWidth:XV.SMALL.imageWidth,imageHeight:XV.SMALL.imageHeight};var aB=r(59849),iB=r.n(aB),oB=r(47867),lB=r.n(oB),sB=r(93643),cB=r.n(sB);const uB=(0,AE.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)"}}))),pB=e=>{let{attributeValues:t,setAttributeValueIndex:r,attributeValueIndex:n}=e;const a=uB(),i=(0,b.useRef)(null);return(0,b.useEffect)((()=>{if(null!=i&&i.current){const e=i.current.scrollLeft,t=i.current.offsetWidth+e,r=96*n+16*n+12;t<r?i.current.scroll&&(r>t+96+16?i.current.scroll(r,0):i.current.scroll(112+e,0)):e+96>r&&i.current.scroll&&i.current.scroll(r-96,0)}}),[n,i]),v().createElement("div",{ref:i,className:a.thumbnails},v().createElement(cB(),{container:!0,wrap:"nowrap",direction:"row",spacing:1,className:a.gridContainer},t.map(((e,t)=>{let{uri:i,value:o}=e;return v().createElement(cB(),{item:!0,key:i},v().createElement(rB,{onClick:()=>r(t),className:O()(a.thumb,{[a.inactiveThumb]:n!==t}),src:(0,x.getImageAttributeOvThumbnailUrl)({value:o})}))}))))},dB=(0,AE.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%)"}}))),mB=e=>{let{className:t,attributeValues:r,attributeValueIndex:n,setAttributeValueIndex:a}=e;const i=dB(),o=r[n],l=(0,x.getImageAttributeOvPreviewUrl)(o);return v().createElement("div",{className:O()(i.root,t)},v().createElement("div",{className:i.main},n>0&&v().createElement(jE.T,{icon:iB(),className:O()(i.arrowButton,i.arrowButtonPrev),onClick:()=>{a(n-1)},size:"XL"}),v().createElement(rB,{containerClassName:i.mainImageContainer,className:i.mainImage,size:l&&XV.OVERRIDE,src:l}),n!==r.length-1&&v().createElement(jE.T,{icon:lB(),className:O()(i.arrowButton,i.arrowButtonNext),onClick:()=>{a(n+1)},size:"XL"})),v().createElement(pB,{attributeValues:r,attributeValueIndex:n,setAttributeValueIndex:a}))};var yB=r(71884),fB=r.n(yB);const gB=(0,_.curry)(((e,t)=>(0,_.filter)((t=>(t.label||t.name).toLowerCase().includes(e.toLowerCase())))(t))),hB=e=>{let{attrTypes:t,filter:r="",sortingFn:n}=e;return(0,_.pipe)(gB(r),(0,_.sort)(n),(0,_.map)((e=>({item:{id:e.uri,label:e.label||e.name,attrType:e}}))))(t)};var EB=function(e){return e.parent="parent",e.attributes="attributes",e}(EB||{});const bB=(0,AE.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"}}),vB=e=>{let{label:t,popupTitle:r=t,data:n,parent:a,dense:i,onApply:o}=e;const l=bB(),s=(0,b.useRef)(),[c,u]=(0,b.useState)(!1),[p,d]=(0,b.useState)(""),[m,y]=(0,b.useState)([]),{items:f,hasGroups:g,parentGroupLength:h,attributesGroupLength:E}=(e=>{let{data:t,parent:r,filter:n}=e;const a=(0,w.mT)(),i=Boolean(r),o=(0,b.useMemo)((()=>a===x.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),[a]),l=(0,b.useMemo)((()=>i?hB({attrTypes:[r],filter:n,sortingFn:o}):[]),[i,r,n,o]),s=(0,b.useMemo)((()=>i&&null!=l&&l.length?[{item:{id:EB.parent,label:L().text("Parent")},items:l}]:[]),[i,l]),c=(0,b.useMemo)((()=>hB({attrTypes:t,filter:n,sortingFn:o})),[t,n,o]),u=(0,b.useMemo)((()=>i&&null!=c&&c.length?[{item:{id:EB.attributes,label:L().text("Attributes")},items:c}]:c),[i,c]),p=(0,b.useMemo)((()=>WE((s||[]).concat(u))),[s,u]),d=s.length,m=u.length;return{items:p,hasGroups:i,parentGroupLength:d,attributesGroupLength:m}})({data:n,parent:a,filter:p}),T=(0,b.useCallback)(((e,t)=>{y((0,_.ifElse)((0,_.always)(t),(0,_.append)(e),(0,_.reject)((0,_.propEq)("id",e.id)))(m))}),[m]),S=(0,b.useCallback)(((e,t)=>t.items?40:28),[]),C=(0,b.useCallback)((e=>{let{item:t}=e;T(t,(0,_.not)((0,_.any)((0,_.propEq)("id",t.id))(m)))}),[T,m]),{focusIndex:A,handleKeyDown:R}=XE({items:f,open:c,onSelectFocusedItem:C,selectedItems:m}),N=(0,b.useRef)(null);N.current=A;const I=g?(h?1:0)+(E?1:0):0,D=f.length-I,P=Math.min(255,28*D+40*I),k=Math.max(140,P+112),F=(0,b.useCallback)(((e,t,r)=>{var n;let{item:a,level:i=0}=t;const o=(0,_.any)((0,_.propEq)("id",a.id))(m),l=N.current===r;return v().createElement(Ob,{key:a.uri,onClick:T,checked:o,level:i,data:a,label:v().createElement(xb.o,{text:a.label,highlight:p}),labelInText:a.label,style:e,isFocused:l,isRequired:!(null===(n=a.attrType)||void 0===n||!n.required),LogoIcon:a.LogoIcon})}),[p,T,m]),j=(0,b.useCallback)(((e,t)=>v().createElement(uT(),{component:"div",className:l.subHeader,style:e,key:`group-${t.item.id}`},t.item.label)),[]);return v().createElement("div",{className:O()(l.moreAttributes,{[l.dense]:i})},v().createElement(yC(),{color:"primary",onClick:()=>u(!c),ref:s,className:l.moreButton},v().createElement(fB(),{classes:{root:l.icon}}),v().createElement("div",{className:l.buttonLabel},t)),v().createElement(YE,{open:c,className:O()(l.moreAttributesPopup,l.popupContainer),anchorEl:s.current,onClose:(0,_.pipe)((()=>{m.length>0&&o((0,_.pluck)("attrType",m))}),(()=>u(!1)),(()=>d("")),(()=>y([]))),onSearch:d,containerHeight:k,title:r,containerWidth:320,searchInputOnKeyDown:R},v().createElement(QE,{getItemSize:S,renderItem:F,renderGroupTitle:j,disableHorizontalScrollbar:!0,items:f,height:P,focusIndex:A}),0===f.length&&v().createElement("div",{className:l.noResultsCaptionContainer},v().createElement(DT(),{variant:"caption",display:"block",gutterBottom:!0},L().text("No results found")))))},TB=v().createContext({canCreate:!0,canUpdate:!0,canDelete:!0});TB.displayName="ConfigPermissionsContext";const OB=e=>{const{canCreate:t,canUpdate:r,canDelete:n}=(0,b.useContext)(TB),a=(0,x.isTempUri)(e);return(0,b.useMemo)((()=>({canCreate:t,canUpdate:a||r,canDelete:a||n})),[a,t,r,n])},xB={get CreationTime(){return L().text("Creation Time")},get CreationDate(){return L().text("Creation Date")},get Dimensions(){return L().text("Dimensions")},get MimeType(){return L().text("Mime Type")},get Size(){return L().text("Size")},get Url(){return L().text("Full image URL (S3)")},get UrlPreview(){return L().text("Preview image URL (S3)")},get UrlThumbnail(){return L().text("Small image URL (S3)")},get CdnUrl(){return L().text("Full image URL (CDN)")},get CdnUrlPreview(){return L().text("Preview image URL (CDN)")},get CdnUrlThumbnail(){return L().text("Small image URL (CDN)")}},SB=function(){let{value:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return["Url","UrlPreview","UrlThumbnail","CdnUrl","CdnUrlPreview","CdnUrlThumbnail","MimeType"].includes(t)?(0,_.path)([t,0,"value"],e):"CreationDate"===t&&(0,_.path)(["CreationTimestamp",0,"value"],e)?Nc()(e.CreationTimestamp[0].value).format("MM-DD-YYYY"):"CreationTime"===t&&(0,_.path)(["CreationTimestamp",0,"value"],e)?Nc()(e.CreationTimestamp[0].value).format("HH:mm:ss"):"Dimensions"===t&&(0,_.path)(["Height",0,"value"],e)&&(0,_.path)(["Width",0,"value"],e)?`${e.Height[0].value} x ${e.Width[0].value} ${L().text("pixels")}`:"Size"===t&&(0,_.path)(["Size",0,"value"],e)?`${(Number(e.Size[0].value)/1e3).toFixed(2)} KB`:void 0},CB=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.filter((e=>{let{system:t}=e;return!t}))},wB=(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}))},AB=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0;const n=CB(t.attributes);return wB(Object.keys(e.value||{}),r).reduce(((t,r)=>{const a=n.find((e=>{let{name:t}=e;return t===r}));return a?[...t,{attrType:a,values:e.value[r]}]:t}),[])},RB=e=>["Url","UrlPreview","UrlThumbnail","CdnUrl","CdnUrlPreview","CdnUrlThumbnail"].includes(e),_B=(0,AE.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:{}}),NB=e=>{let{attributeType:t,onAddAttributes:r,uri:n}=e;const a=_B(),i=CB(t.attributes),{canCreate:o}=(0,b.useContext)(TB),l=o&&Boolean(r);return v().createElement(Wj(),null,v().createElement(DT(),{className:O()(a.title,{[a.canAdd]:l})},L().text("Meta info")),l&&v().createElement(b.Fragment,null,v().createElement(vB,{label:L().text("Attributes"),data:i,dense:!1,onApply:e=>{r&&r(e.map((e=>({attributeType:e,parentUri:n}))))}}),v().createElement(pS(),{className:a.divider})))},IB=(0,AE.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"}}))),DB=e=>{let{title:t,content:r,isLink:n,children:a}=e;const i=IB();return v().createElement("div",{className:i.root},v().createElement("span",{className:i.title},t),n?v().createElement("a",{className:i.link,href:r},L().text("link")):v().createElement("span",{className:i.content},r||a))},PB=(0,AE.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"}}),kB=e=>{let{attributeValue:t,attributeType:r,imageAttributeFieldsOrder:n}=e;const a=PB(),i=(0,w.xH)(),o=(l=t,s=n,wB(Object.keys(xB),s).map((e=>SB(l,e)?{title:xB[e],value:SB(l,e),isLink:RB(e)}:null)).filter(Boolean));var l,s;const c=AB(t,r,n);return v().createElement(Wj(),{className:a.root},o.map((e=>{let{title:t,value:r,isLink:n}=e;return v().createElement(DB,{key:t,isLink:n,title:t,content:r})})),i&&c.map((e=>{let{attrType:r,values:n}=e;return v().createElement(LW,{key:r.uri,attributeType:r,drawLines:!1,values:n,titleClassName:a.title,contentClassName:a.content,parentUri:t.uri})})))},LB=(0,AE.Z)((e=>({caption:{display:"flex",color:e.palette.error.main,fontSize:"12px",lineHeight:"16px"}}))),FB=e=>{let{className:t,message:r}=e;const n=LB();return r?v().createElement(DT(),{variant:"caption",className:O()(n.caption,t)},r):null};var jB=r(66826),UB=r.n(jB),MB=r(54508),VB=r(70485),BB=r.n(VB),zB=r(53167),HB=r.n(zB);const YB=(0,AE.Z)({wrapper:{width:"100%"},helperText:{margin:"3px 0 1px 12px"}});function WB(){return WB=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},WB.apply(this,arguments)}const GB=(0,b.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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["errorMessage","children","className","classes"]);const o=YB(),l=!!t;return v().createElement(BB(),WB({variant:"standard",className:O()(o.wrapper,n,null==a?void 0:a.root),error:!0},i),r,l&&v().createElement(HB(),{className:O()(o.helperText,null==a?void 0:a.helperText)},v().createElement(FB,{message:t})))}));GB.displayName="ErrorWrapper";const qB=(e,t,r,n)=>{const a=(0,_.pipe)(x.getEntityType,(0,_.defaultTo)({}),(0,_.props)(["attributes","analyticsAttributes"]),(0,_.reject)(_.isNil),_.flatten,(0,_.concat)(_.__,(0,_.pipe)(_.values,(0,_.reject)((0,_.propEq)("uri",x.EntityAttrTypes.id.uri)))(x.EntityAttrTypes)))(e,t);return r.length?a.filter((e=>{let{uri:t}=e;return r.includes(t)})):a.filter((e=>{let{uri:t}=e;return!n.includes(t)}))},ZB=(e,t)=>(0,_.partition)((0,_.pipe)((0,_.path)(["attrType","uri"]),(0,_.includes)(_.__,e)),t),$B=(0,_.eqBy)((0,_.pick)(["fieldName","uri","entityTypeUri"])),KB=(e,t)=>t&&!!t.find($B(e)),QB=(0,_.curry)(((e,t,r)=>{const n=((e,t)=>{const{type:r}=(0,x.getAttrDataTypeDefinition)(e);switch(r){case x.DataTypes.TYPE_BOOLEAN:case x.DataTypes.TYPE_BOOLEAN_RADIO:case x.DataTypes.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return t.toString();case x.DataTypes.TYPE_DATE:return t&&Nc()(t).format("YYYY-MM-DD")||"";case x.DataTypes.TYPE_TIMESTAMP:return t&&Nc()(t).utc().format()||"";case x.DataTypes.TYPE_ACTIVENESS_DATE:case x.DataTypes.TYPE_LOCAL_DATE:return t&&t.valueOf();default:return t||""}})(t,r);return{value:n,uri:e.uri,attributeType:t}})),XB=v().createContext({enabled:!1,queueSizeThreshold:0});XB.Provider.propTypes={value:OE().shape({enabled:OE().bool,queueSizeThreshold:OE().number})},XB.displayName="AsyncMountContext";let JB=0;const ez=()=>{const e=(0,b.useRef)(!0),{enabled:t,queueSizeThreshold:r=0}=(0,b.useContext)(XB),[n,a]=(0,b.useState)(!t||t&&JB<r);e.current&&JB++;const i=(0,b.useRef)();return(0,b.useEffect)((()=>{if(JB--,!n)return i.current=setTimeout((()=>{a(!0)}),0),()=>clearTimeout(i.current)}),[]),e.current=!1,n};function tz(){return tz=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},tz.apply(this,arguments)}var rz=r(50548);const nz=v().createContext(!1);nz.displayName="ProfilePerspectiveViewContext";let az=function(e){return e.Error="Error",e.NewAttribute="NewAttribute",e.NewView="NewView",e}({});const iz=e=>e===az.Error,oz=v().createContext({element:null,type:null,highlightView:SE.ZT,highlightError:SE.ZT,highlightAttribute:SE.ZT,scrollIntoRef:SE.ZT});function lz(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){sz(e,t,r[t])}))}return e}function sz(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const cz={content:'""',position:"absolute",left:"-1000px",top:"0px",width:"5000px",height:"calc(100% - 10px)",animationName:"$highlightAnimation",animationDuration:"2s",animationIterationCount:1,opacity:0},uz=(0,AE.Z)((()=>({"@keyframes highlightAnimation":{"0%":{opacity:0},"50%":{opacity:1},"100%":{opacity:0}},highlightError:{"&::before":lz({},cz,{background:"rgba(255, 0, 0, 0.06)"})},highlightWarning:{"&::before":lz({},cz,{background:"rgba(228, 151, 0, 0.08)"})},simpleAttribute:{position:"relative","&::before":{top:"-4px",height:"calc(100% + 8px)"}}}))),pz=e=>{let{highlightedError:t,isSimple:r=!1}=e;const n=uz(),a=(0,b.useRef)(null),i=(0,_.pathOr)(x.ErrorSeverity.ERROR,["element","severity"])(t),o=O()({[n.highlightError]:i===x.ErrorSeverity.ERROR,[n.highlightWarning]:i===x.ErrorSeverity.WARNING,[n.simpleAttribute]:r});return(0,b.useEffect)((()=>{t&&t.scrollIntoRef(a)}),[t]),t?{ref:a,errorClassName:o}:{ref:a}};var dz=r(51894);const mz=(0,AE.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 yz(){return yz=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yz.apply(this,arguments)}const fz=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:y=!1}=e,f=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.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=mz(),h="deleted"===d,E="edited"===d,T=(0,x.isEditableMode)(o),{canCreate:S,canEdit:C,canDelete:A}=(e=>{let{attributeType:t,attributeValue:r,isReltioCrosswalk:n,mode:a}=e;const{canCreate:i,canUpdate:o,canDelete:l}=OB(r.uri);return{canCreate:i&&(0,x.checkCanCreateAttribute)({attributeType:t,mode:a}),canEdit:o&&(0,x.checkCanEditAttribute)({attributeType:t,attributeValue:r,mode:a,isReltioCrosswalk:n}),canDelete:l&&(0,x.checkCanDeleteAttribute)({attributeType:t,attributeValue:r,mode:a,isReltioCrosswalk:n})}})({attributeValue:r,attributeType:n,mode:o,isReltioCrosswalk:a}),R=C&&T,N=(0,x.getErrorMessage)(i),I=(0,w.ZI)(r,n),{ref:D,errorClassName:P}=pz({highlightedError:m,isSimple:!0});(0,b.useEffect)((()=>{y&&(0,x.isDependentLookupAttrType)(n)&&!(0,_.has)("lookupCode",r)&&c({attributeType:n,uri:r.uri,value:r.value,silent:!0})}),[y]);const k=(0,b.useMemo)((()=>(0,x.getAttrDataTypeDefinition)(n)),[n]),F=(0,b.useMemo)((()=>((e,t)=>{let{type:r}=t;const{value:n,lookupCode:a}=e||{};switch(r){case x.DataTypes.TYPE_BOOLEAN:case x.DataTypes.TYPE_BOOLEAN_RADIO:case x.DataTypes.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return(0,x.parseBoolean)(n);case x.DataTypes.TYPE_DATE:return n&&x.utils.dates.toLocalDate(n)||null;case x.DataTypes.TYPE_LOCAL_DATE:case x.DataTypes.TYPE_TIMESTAMP:case x.DataTypes.TYPE_ACTIVENESS_DATE:return n&&new Date(n)||null;case x.DataTypes.TYPE_DEPENDENT_LOOKUP:case x.DataTypes.TYPE_LOOKUP:return{value:n,lookupCode:a};default:return n}})(r,k)),[r,k]),j=(0,b.useCallback)((()=>{i&&u((0,x.getErrorId)(i))}),[i,u]),U=(0,b.useCallback)((0,_.pipe)(QB(r,n),c,j),[r,n,c,j]),M=!!l&&S&&!n.singleValue,V=!h&&!!s&&A,B=!!N,z=h?{disabled:!0,isCrossedOut:!0}:{},H=(0,b.useContext)(nz),{autopopulationContextValue:Y}=(e=>{let{enabled:t,attributeTypeUri:r,valueUri:n}=e;const a=(0,w.ax)("dependentLookupsEditorTouched"),i=(0,w.Pl)(),o=(0,w.h0)(n),l=t&&(0,x.isAutopopulationEnabled)(i,r),s=l?n:null,{isTouched:c=!1}=l&&o||{},u=(0,b.useCallback)((e=>{a({uri:e,isTouched:!0})}),[a]);return{autopopulationContextValue:(0,b.useMemo)((()=>s?{id:s,isTouched:c,onTouch:u}:null),[s,c,u])}})({enabled:H&&(0,x.isDependentLookupAttrType)(n),attributeTypeUri:null==n?void 0:n.uri,valueUri:r.uri});return v().createElement("div",{ref:D,className:O()(g.editor,t,P)},v().createElement(GB,{errorMessage:N,className:g.errorWrapper},v().createElement("div",{className:O()(g["editor-value"],{[g.deleted]:h},{[g["editor-read-only-value"]]:!R}),"data-reltio-id":"reltio-attribute-value"},R?v().createElement(dz.m.Provider,{value:Y},v().createElement(MB.Z,yz({fieldName:(0,x.attributeUriToSearchUri)(n.uri),value:F,dataTypeDefinition:k,error:B,onChange:U,fullWidth:!0},I,f,z))):v().createElement(ev.x,{value:(0,x.getAttributeValue)(r),dataTypeDefinition:k}))),v().createElement("div",{className:g["editor-actions"]},E&&v().createElement(DT(),{variant:"caption",className:g.editedLabel},"(",L().text("edited"),")"),M&&v().createElement(jE.T,{icon:fB(),onClick:l,size:"L",className:O()(g.addButton,g.button),"data-reltio-id":"reltio-add-one-more-simple-attribute-button"}),p&&p({attributeType:n,attributeValue:r}),V&&v().createElement(jE.T,{className:g.button,icon:UB(),onClick:()=>{s({uri:r.uri,attributeType:n}),(0,x.getErrorType)(i)!==x.ErrorType.missed&&j()},size:"L","data-reltio-id":"reltio-delete-simple-attribute-button"})))};fz.propTypes={className:OE().string,attributeValue:x.SimpleAttributeValueType,attributeType:x.AttributeTypeType,ownError:x.AttributeErrorType,isReltioCrosswalk:OE().bool,state:OE().oneOf(["deleted","edited"]),mode:x.ModeType,onAddOneMore:OE().func,onDeleteAttribute:OE().func,onChangeAttribute:OE().func,onDeactivateError:OE().func,additionalControlsRenderer:OE().func,highlightedError:OE().object,isEmptyEditor:OE().bool};const gz=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const r=(0,b.forwardRef)(((r,n)=>ez()?v().createElement(e,tz({},r,{ref:n})):t&&v().createElement(t,tz({},r,{ref:n}))));return r.displayName="WithAsyncMount",r}((0,rz.l)(oz,((e,t)=>{let{attributeValue:r}=t;const{element:n,type:a}=e||{};return{highlightedError:iz(a)&&(null==n?void 0:n.uri)===r.uri?e:null}}),fz),(()=>{const e=mz();return v().createElement("div",{className:e.placeholder})})),hz=[x.EntityAttrTypes.roles.uri,x.EntityAttrTypes.tags.uri],Ez=v().createContext(null),bz=v().createContext(null);function vz(){return vz=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vz.apply(this,arguments)}function Tz(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Oz=e=>{let{parentAttributeType:t,attrTypes:r,entity:n,parentUri:a,showEmptyEditors:i,mode:o,crosswalks:l,drawLines:s,children:c,className:u,alwaysVisibleTypeUris:p=hz,onAddAttributes:d,onChangeAttribute:m,onDeleteAttribute:y,additionalControlsRenderer:f,showNonOv:g,highlightAttribute:h}=e;const{attributes:E={}}=n,[T,O]=(0,b.useState)({}),S=(0,b.useCallback)(((e,t)=>{O((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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Tz(e,t,r[t])}))}return e}({},r,{[e]:t})))}),[]);(0,b.useEffect)((()=>{O({})}),[a]);const{canCreate:C}=(0,b.useContext)(TB),w=(0,b.useMemo)((()=>C&&t&&(0,x.checkCanCreateAttribute)({attributeType:t,mode:o})),[t,o,C]),A=((e,t,r,n)=>e.filter((e=>{const a=((e,t)=>{const{attributes:r={},analyticsAttributes:n={}}=t;return(0,_.cond)([[x.isSpecialAttribute,(0,_.always)(t)],[(0,_.both)(x.isAnalyticAttribute,(0,_.always)(n)),(0,_.always)(n)],[_.T,(0,_.always)(r)]])(e)})(e,t),i=(e=>(0,x.isSpecialAttribute)(e)?"uri":"name")(e);return!((e.singleValue||(0,x.isRoleAttrType)(e)||(0,x.isTagAttrType)(e))&&((0,_.has)(e[i])(a)||r&&(null==n||!n[e.uri])))})))((0,b.useMemo)((()=>C?(0,x.getCreatableAttributeTypes)(o,r):[]),[r,o,C]),n,i,T),R=(0,b.useContext)(Ez),N=(0,b.useMemo)((()=>(0,x.getAttributesListForEditMode)(r,o,n,i,g,R,C)),[r,o,n,i,g,R,C]),[I,D]=(0,b.useMemo)((()=>ZB(p,N)),[N,p]),P=(0,b.useCallback)((e=>{d(e.map((e=>({attributeType:e,parentUri:e===t?(0,x.getParentUri)(a):a})))),h((0,_.last)(e),az.NewAttribute)}),[d,a,t]),k={enabled:s},F=(0,b.useMemo)((()=>({hasDeletionsMap:T,setHasDeletions:S})),[T,S]);return v().createElement("div",{className:u},c&&v().createElement(nU,k,c),v().createElement(nU,vz({},k,{plain:!0}),A.length>0&&v().createElement(vB,{label:L().text("More attributes"),onApply:P,dense:s,data:A,parent:w&&t})),v().createElement(bz.Provider,{value:F},D.concat(I).map((e=>{let{attrType:t,values:r}=e;return v().createElement(qY,{key:`${t.uri}_${a}`,attributeType:t,drawLines:s,values:r,paging:(0,_.path)(["paging",t.uri],E),parentUri:a,showEmptyEditors:i,mode:o,crosswalks:l,onAddAttributes:d,onChangeAttribute:m,onDeleteAttribute:y,additionalControlsRenderer:f,showNonOv:g})}))))};Oz.propTypes={parentAttributeType:OE().object,attrTypes:OE().array,entity:OE().object,parentUri:OE().string,children:OE().node,showEmptyEditors:OE().bool,mode:x.ModeType,crosswalks:OE().array,drawLines:OE().bool,showNonOv:OE().bool,className:OE().string,alwaysVisibleTypeUris:OE().array,onAddAttributes:OE().func,onChangeAttribute:OE().func,onDeleteAttribute:OE().func,additionalControlsRenderer:OE().func,highlightAttribute:OE().func};const xz=(0,rz.l)(oz,(e=>{const{highlightAttribute:t}=e||{};return{highlightAttribute:t}}),Oz),Sz=(0,AE.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}})));function Cz(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const wz=e=>{let{label:t,attributeTypesList:r,attributeType:n,attributeValue:a,children:i,errors:o,ownError:l,mode:s,metadata:c,crosswalks:u,lazy:p,showEmptyEditors:d,onAddOneMore:m,onAddAttributes:y,onDeleteAttribute:f,onChangeAttribute:g,additionalControlsRenderer:h,hideDeleteButton:E,state:T,showNonOv:S,isHighlightedPath:C,highlightedError:w,expanded:A=!1}=e;const R=Sz(),_="deleted"===T,N="edited"===T,I=a.uri,D=(0,x.isTempUri)(I),P=D||A,[k,F]=(0,b.useState)(P),{ref:j,errorClassName:U}=pz({highlightedError:w});(0,b.useEffect)((()=>{C&&F(!0)}),[C]),(0,b.useEffect)((()=>{F(P)}),[P]);const{canDelete:M}=OB(a.uri),V=(0,b.useMemo)((()=>M&&(0,x.checkCanDeleteAttribute)({attributeType:n,attributeValue:a,mode:s,metadata:c,isReltioCrosswalk:(0,x.isReltioCrosswalk)(u,a)})),[n,a,s,c,u,M]),B=!_&&!E&&!!f&&V,z=(0,b.useMemo)((()=>(0,x.hasAttributeDescendantsWithErrors)(a,o)),[o,a]);(0,b.useEffect)((()=>{z&&F(!0)}),[o,z]),(0,b.useEffect)((()=>{_&&F(!1)}),[_]);const H=(r||[]).some((e=>(0,x.isAnalyticAttribute)(e))),Y=(0,b.useMemo)((()=>({attributes:H?null:a.value,analyticsAttributes:H?a.value:null})),[a,H]),W=(0,x.getErrorMessage)(l)||z&&L().text("Has an incorrect value")||"";return p?v().createElement(yC(),{variant:"text",color:"primary",onClick:m},"Create attribute"):v().createElement("div",{ref:j,className:O()(R.complexWrapper,U)},v().createElement("div",{className:R.editor},v().createElement("div",{className:R.titleContainer},v().createElement(ZM,{onClick:()=>F((e=>!e)),expanded:k,className:R.expandButton,disabled:_}),v().createElement(GB,{errorMessage:W,classes:{helperText:R.errorWrapperHelperText}},v().createElement("div",{className:O()(R.label,{[R.deleted]:_}),"data-reltio-id":"reltio-attribute-complex-label"},t))),v().createElement("div",{className:R.actions},N&&v().createElement(DT(),{variant:"caption",className:R.editedLabel},"(",L().text("edited"),")"),h&&h({attributeType:n,attributeValue:a}),B&&v().createElement(jE.T,{icon:UB(),onClick:()=>f({uri:I,attributeType:n,attributeValue:a}),size:"L","data-reltio-id":"reltio-delete-complex-attribute-button"}))),k&&v().createElement(xz,{parentAttributeType:n,attrTypes:r,entity:Y,showEmptyEditors:d||D,drawLines:!0,parentUri:I,mode:s,crosswalks:u,onAddAttributes:y,onChangeAttribute:g,onDeleteAttribute:f,additionalControlsRenderer:h,showNonOv:S},i))};wz.propTypes=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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Cz(e,t,r[t])}))}return e}({label:OE().string,children:OE().node,attributeTypesList:OE().arrayOf(x.AttributeTypeType),attributeValue:OE().oneOfType([x.NestedAttributeValueType,x.ReferenceAttributeValueType]),highlightedError:OE().object,isHighlightedPath:OE().bool},x.ComplexAttributeType);const Az=(0,rz.l)(oz,((e,t)=>{let{attributeValue:r}=t;const{element:n,type:a}=e||{},i=iz(a);return{highlightedError:i&&(null==n?void 0:n.uri)===r.uri?e:null,isHighlightedPath:i&&(0,_.pipe)((0,_.propOr)([],"path"),(0,_.any)((0,_.pathEq)(["value","uri"],r.uri)))(n)}}),wz);function Rz(){return Rz=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Rz.apply(this,arguments)}const _z=(0,b.memo)((e=>{const{attributeValue:t,attributeType:r}=e,n=(0,x.evaluateDeepEntityLabel)(t,r.dataLabelPattern);return v().createElement(Az,Rz({label:(0,x.getLabel)(n),attributeTypesList:r.attributes||r.analyticsAttributes},e))}));_z.propTypes=x.NestedAttributeType,_z.displayName="NestedAttributeEditor";var Nz=r(62880);const Iz=(0,AE.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"}}))),Dz=e=>{const{selectProps:{onCreate:t,createLabel:r,inputValue:n,components:a},children:i}=e,o=Iz();return v().createElement(CO.h,e,i,r&&!(0,_.prop)("Group",a)&&v().createElement("span",{className:o.addLabel,onClick:()=>t(n)},v().createElement(fB(),{className:o.addIcon}),r))};Dz.propTypes={children:OE().element.isRequired,selectProps:OE().object.isRequired};const Pz=(0,AE.Z)({singleValue:{fontSize:"14px",lineHeight:"16px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",marginTop:"17px"}});function kz(){return kz=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},kz.apply(this,arguments)}const Lz=e=>{const{selectProps:{menuIsOpen:t},innerProps:r,children:n}=e,a=Pz();return!t&&v().createElement(DT(),kz({className:a.singleValue},r),n)};function Fz(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){jz(e,t,r[t])}))}return e}function jz(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}Lz.propTypes={children:OE().node,innerProps:OE().object};const Uz=(0,AE.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"}}}),Mz={menu:e=>Fz({},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=>Fz({},e,{maxHeight:"208px",padding:"8px 0"}),group:e=>Fz({},e,{padding:"0 0 8px 0"}),input:e=>Fz({},e,{height:"16px",color:"rgba(0, 0, 0, 0.87)",fontSize:"14px",lineHeight:"16px",margin:"16px 0 0",padding:0}),option:e=>Fz({},e,{fontSize:"13px",lineHeight:"15px",height:"32px"})},Vz={menuList:e=>Fz({},e,{padding:0})},Bz={input:e=>Fz({},e,{height:"16px",color:"rgba(0, 0, 0, 0.87)",fontSize:"14px",lineHeight:"16px",margin:0,padding:0})};function zz(){return zz=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},zz.apply(this,arguments)}function Hz(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Yz(e,t,r[t])}))}return e}function Yz(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Wz=e=>{let{value:t,label:r,createLabel:n,getOptions:a,options:i,height:o=46,onChange:l=_.identity,onCreate:s,onClear:c=_.identity,components:u,textFieldInputRef:p,TextFieldProps:d,classes:m}=e,y=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.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 f=Uz({height:o}),[g,h]=(0,b.useState)(!1),E=(0,b.useRef)(null),T=a?pO:cO.Z,S=(0,_.prop)("ClearIndicator",u)?{}:{IndicatorSeparator:SE.Vd,ClearIndicator:SE.Vd},C=s?(e,t)=>{s(e,t),h(!1)}:void 0,w=(0,_.prop)("Group",u)?Vz:{},A=(0,_.isEmpty)(r)?Bz:{},R=Hz({},Mz,w,A),N=Hz({},f,m);return v().createElement(T,zz({placeholder:"",defaultOptions:!0},y,{value:(0,_.defaultTo)(null,t),loadOptions:a,options:i,cacheOptions:!0,onChange:l,onCreate:C,onClear:c,createLabel:n,classes:N,styles:R,components:Hz({DropdownIndicator:Nz.G,LoadingIndicator:SE.Vd,SingleValue:Lz,Menu:Dz},S,u),menuPlacement:"auto",TextFieldProps:Hz({},d,{label:r,variant:"filled",size:"small",classes:Hz({},(0,_.prop)("classes",d),{root:O()(f.formControl,(0,_.path)(["classes","root"],d))}),inputProps:Hz({},(0,_.prop)("inputProps",d)),InputProps:Hz({},(0,_.prop)("InputProps",d),{classes:Hz({},(0,_.path)(["InputProps","classes"],d),{root:O()(f.filledInputRoot,(0,_.path)(["InputProps","classes","root"],d)),underline:O()({[f.filledInputUnderline]:(0,x.isEmptyValue)(t)},(0,_.path)(["InputProps","classes","underline"],d)),focused:O()("focused",(0,_.path)(["InputProps","classes","focused"],d))})}),InputLabelProps:Hz({},(0,_.prop)("InputLabelProps",d),{classes:Hz({},(0,_.path)(["InputLabelProps","classes"],d),{root:O()(f.inputLabel,(0,_.path)(["InputLabelProps","classes","root"],d)),shrink:O()("shrink",(0,_.path)(["InputLabelProps","classes","shrink"],d))}),shrink:!(0,x.isEmptyValue)(t)||void 0}),ref:p||E}),inputRef:p||E,menuIsOpen:g,onMenuOpen:()=>h(!0),onMenuClose:()=>h(!1)}))},Gz={value:OE().oneOfType([OE().object,OE().array]),label:OE().string.isRequired,getOptions:OE().func,options:OE().array,onChange:OE().func,onCreate:OE().func,onClear:OE().func,createLabel:OE().string,components:OE().object,textFieldInputRef:OE().object,TextFieldProps:OE().object,height:OE().number,classes:OE().object};Wz.propTypes=Gz;var qz=r(98018);function Zz(){return Zz=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Zz.apply(this,arguments)}const $z=e=>{const t=(0,w.$H)()||"";return v().createElement(qz.ZP,Zz({},e,{storagePath:(r=t,r.endsWith("/")?r:r+"/")}));var r},Kz=(0,AE.Z)({entityContainer:{display:"flex",alignItems:"center",height:"32px",minHeight:"32px",padding:0},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 Qz(){return Qz=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Qz.apply(this,arguments)}const Xz=e=>{let{innerRef:t,innerProps:r,selectOption:n,data:a}=e;const i=Kz(),{uri:o,entityType:l,label:s,secondaryLabel:c}=a;return""!==o?v().createElement(ab(),Qz({className:i.entityContainer,ref:t,key:o,onClick:()=>n({label:s,uri:o,entityType:l})},r),v().createElement($z,{className:i.entityAvatar,entityType:l}),v().createElement(hb.Y,{value:`${s}${c?", "+c:""}`},v().createElement("span",{className:i.entityLabel},s,c&&v().createElement("span",{className:i.entitySecondaryLabel},", ",c)))):v().createElement(ab(),Qz({className:i.entityContainer,ref:t,key:o},r,{disabled:!0}),v().createElement("span",{className:i.emptyEntityLabel},L().text("No results found")))};Xz.propTypes={innerRef:OE().oneOfType([OE().oneOf([null]),OE().func,OE().shape({current:OE().any.isRequired})]),innerProps:OE().object.isRequired,selectOption:OE().func.isRequired,data:OE().shape({uri:OE().string.isRequired,label:OE().string.isRequired,entityType:x.EntityType.isRequired})};const Jz=(0,AE.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"}}))),eH=e=>{let{selectProps:{currentEntityType:t,menuIsOpen:r,disableLinkClick:n},children:a,data:i}=e;const o=Jz(),l=(0,w.ax)("openEntity"),s=(0,w.Qh)(),{generateEntityUrl:c}=(0,b.useContext)(Zb),u=(0,x.isTempUri)(i.entityUri)?{className:o.singleValue,component:"span"}:{className:O()(o.singleValue,o.linkValue),onMouseDown:e=>{e.stopPropagation()},onClick:e=>{e.stopPropagation(),n?e.preventDefault():(0,SE.rR)(e)||(l({uri:i.entityUri}),e.preventDefault())},href:c({uiPath:s,uri:i.entityUri}),component:"a"};return r?null:v().createElement(DT(),u,(0,x.isTempUri)(i.entityUri)?L().text(`New ${t.label} will be created`):(0,x.getLabel)(a))},tH=(0,AE.Z)({clearIcon:{cursor:"pointer",height:"20px",width:"20px"}}),rH=e=>{const{selectProps:{onClear:t}}=e,r=tH();return v().createElement(dC(),{onClick:t,size:"large"},v().createElement(Mj(),{className:r.clearIcon}))};rH.propTypes={selectProps:OE().object.isRequired};var nH=r(81997);const aH=(0,AE.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:iH}=nH.F,oH=e=>{const{selectProps:{inputValue:t,onCreate:r},data:n,children:a}=e,i=aH();return v().createElement(iH,e,v().createElement("div",{className:i.groupHeading},v().createElement("span",null,n.label),r&&v().createElement("span",{onClick:()=>r(t,n.entityType),className:i.addLabel},v().createElement(fB(),{className:i.addIcon}),L().text(`Create ${t?`"${t}" as `:""}new ${n.label}`))),a)};oH.propTypes={selectProps:OE().object.isRequired,data:OE().object,children:OE().array};const lH=e=>e&&e.attributes,sH=e=>{let{entityUri:t,entityType:r,mode:n,attributeTypesSelectionStrategy:a=lH}=e;const i=(0,w.ax)("addAttributes"),o=(0,w.ax)("removeAttribute"),l=(0,w.ax)("modifyAttribute"),s=(0,w.vc)(t),c=(0,b.useMemo)((()=>a(r)),[a,r]);return s?v().createElement(xz,{key:s.uri,attrTypes:c,entity:s,showEmptyEditors:!0,drawLines:!0,parentUri:s.uri,mode:n,crosswalks:s.crosswalks,onAddAttributes:i,onChangeAttribute:l,onDeleteAttribute:o}):null};function cH(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const uH=(0,AE.Z)({creatorWrapper:{marginTop:"20px"}});function pH(){return pH=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},pH.apply(this,arguments)}function dH(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){mH(e,t,r[t])}))}return e}function mH(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yH(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}const fH=e=>{let{entity:t={},entityTypesUris:r=[],mode:n,max:a,onChange:i,onCreate:o,metadata:l,globalSearchRequestOptions:s,attributeTypesSelectionStrategy:c,disableLinkClick:u=!1}=e,p=yH(e,["entity","entityTypesUris","mode","max","onChange","onCreate","metadata","globalSearchRequestOptions","attributeTypesSelectionStrategy","disableLinkClick"]);const d=uH(),[m,y]=(0,b.useState)(""),f=(0,b.useMemo)((()=>r.map((e=>(0,x.getEntityType)(l,e))).filter(x.isAvailableEntityType)),[r,l]),g=dH({},s,{max:a}),h=o?(e,t)=>{o(t||r[0],e),y("")}:void 0,E=e=>{null!==e&&(y(""),i(e))},T=(0,b.useMemo)((()=>1!==f.length),[f]),O=((0,_.isEmpty)(t)?f[0]:(0,x.getEntityType)(l,t.entityType))||{},S=o&&L().text(`Create ${m?`"${m}" as `:""}new ${O.label}`),C=L().text(`Select ${1===f.length?`${f[0].label} `:""}profile`),w=!(0,_.isEmpty)(t)&&(0,x.isTempUri)(t.entityUri),A=T?{Group:oH,GroupHeading:SE.Vd}:{},R=w?{ClearIndicator:rH}:{},{TextFieldProps:N}=p,I=yH(p,["TextFieldProps"]),D=(0,b.useMemo)((()=>dH({},N||{},{"data-reltio-id":"reltio-entity-selector"})),[N]);return v().createElement(v().Fragment,null,v().createElement(Wz,pH({value:(0,_.isEmpty)(t)?void 0:t,inputValue:m,onInputChange:e=>{y(e)},getOptions:e=>(0,x.typeAheadSearch)(f,e,g).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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){cH(e,t,r[t])}))}return e}({},t,{label:(0,x.getLabel)(t.label),entityType:e.find((e=>{let{uri:r}=e;return r===t.type}))}))),a=e=>(0,_.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)})(f,o)),getOptionLabel:(0,_.prop)("entityLabel"),onChange:E,onCreate:h,onClear:()=>{E({})},label:C,createLabel:S,components:dH({Option:Xz,SingleValue:eH},A,R),currentEntityType:O,isClearable:!0,disableLinkClick:u,TextFieldProps:D},I)),w&&v().createElement("div",{className:d.creatorWrapper},v().createElement(sH,{mode:n,attributeTypesSelectionStrategy:c,entityType:O,entityUri:t.entityUri})))};fH.propTypes={entity:x.ConnectionEntityType,entityTypesUris:OE().arrayOf(OE().string),max:OE().number,mode:x.ModeType,dispatch:OE().func,metadata:x.MetadataType,onChange:OE().func.isRequired,onCreate:OE().func,attributeTypesSelectionStrategy:OE().func,globalSearchRequestOptions:OE().object,disableLinkClick:OE().bool};const gH=(0,AE.Z)({item:{marginBottom:"20px"},dense:{marginBottom:0}});function hH(){return hH=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hH.apply(this,arguments)}function EH(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){bH(e,t,r[t])}))}return e}function bH(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const vH=e=>{const t=gH(),{highlightedError:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.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,b.useRef)(a),{ref:p,errorClassName:d}=pz({highlightedError:r,isSimple:!0}),m=(0,x.getReferencedEntityUriFromAttrValue)(a),y=(0,w.ax)("entityDeleted"),f=(0,w.ax)("entityCreated"),g=(0,w.ax)("errorDeactivated"),h=(0,w.vc)(m),E=(0,x.isTempUri)(m)?h:null,T=(0,w.AH)(),S=(0,w.mU)(["ovOnly"]),C=(0,x.getReferencedEntityFromAttrValue)(a),A=(0,x.getReferencedRelationFromAttrValue)(a),R=(0,x.getReferencedEntityTypeUriFromAttrType)(i),N=(0,x.getEntityType)(T,R),I=E?(0,x.evaluateDeepEntityLabel)(E,N.dataLabelPattern):a.label,D=(0,b.useMemo)((()=>[R]),[R]),P=(0,b.useMemo)((()=>(0,x.addReferencedRelationCrosswalks)(l,A)),[l,A]),k=(0,b.useMemo)((()=>(0,x.getReferencedEntityActiveError)(a,s)),[a,s]),L=(0,b.useMemo)((()=>C&&{entityUri:(0,x.getReferencedEntityUri)(C),entityType:(0,x.getReferencedEntityTypeUri)(C),entityLabel:a.label}),[C,a.label]),F=(0,b.useMemo)((()=>(0,x.getReferencedRelationAttrTypesUris)(i).map((e=>(0,x.findAttributeTypeByUri)(T,e))).filter(_.identity)),[i,T]),j=(0,b.useCallback)((e=>(0,x.referencedEntityAttributeTypesSelectionStrategy)(i,e)),[i]),U=(0,b.useCallback)((e=>{E&&y(E.uri);const t=u.current,r=!(0,_.isEmpty)(e)&&e.uri===(0,x.getReferencedEntityUriFromAttrValue)(t),n=EH({},a,{label:e.label,refEntity:r?t.refEntity:(0,x.convertReferencedEntityForAttrValue)(e),refRelation:r?t.refRelation:(0,x.createReferencedRelationForAttrValue)(a)});c({value:n,attributeType:i,uri:a.uri}),k&&g((0,x.getErrorId)(k))}),[a,i,E,c,y,g,k]),M=(0,b.useCallback)(((e,t)=>{const r=(0,_.pipe)(j,(0,x.getCreatableAttributeTypes)(o))(N),n=(0,x.createTemporaryEntity)({entityTypeUri:e,initValue:t,attributeTypes:r,metadata:T,mode:o});U(n),f(n)}),[j,o,N,T,U,f]),{canCreate:V,canUpdate:B}=OB(a.uri),z=(0,b.useMemo)((()=>B&&(0,x.checkCanEditAttribute)({attributeType:i,attributeValue:a,mode:o,isReltioCrosswalk:(0,x.isReltioCrosswalk)(l,a)})),[i,a,o,l,B]),H=(0,b.useMemo)((()=>V&&(0,x.checkMetadataForCreate)(o,N)),[o,N,V]),Y=(0,x.getErrorMessage)(k);return v().createElement(Az,hH({},n,{label:(0,x.getLabel)(I),attributeTypesList:F,crosswalks:P,metadata:T}),v().createElement("div",{ref:p,className:d},v().createElement(GB,{errorMessage:Y},v().createElement(fH,{className:O()(t.item,{[t.dense]:Y||L&&(0,x.isTempUri)(L.entityUri)}),entity:L||{},entityTypesUris:D,max:20,globalSearchRequestOptions:S,mode:o,isDisabled:!z,onChange:U,onCreate:H?M:void 0,metadata:T,attributeTypesSelectionStrategy:j}))))};vH.propTypes=EH({},x.ReferenceAttributeType,{highlightedError:OE().object});const TH=(0,rz.l)(oz,((e,t)=>{let{attributeValue:r,attributeType:n}=t;const{element:a,type:i}=e||{};return{highlightedError:iz(i)&&(0,x.isAttributeTypeError)(a,r.uri,n.uri)?e:null}}),vH);function OH(){return OH=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},OH.apply(this,arguments)}const xH=(0,b.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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className"]);return v().createElement("div",{ref:t,"data-reltio-id":"reltio-edit-attribute",className:r},class{static build(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(e.type){case x.DataTypes.TYPE_NESTED:return v().createElement(_z,t);case x.DataTypes.TYPE_REFERENCE:return v().createElement(TH,t);default:{const e=(0,_.omit)(["showEmptyEditors","onAddAttributes","lazy","errors","crosswalks","showNonOv","expanded"],t);return v().createElement(gz,OH({isReltioCrosswalk:(0,x.isReltioCrosswalk)(t.crosswalks,t.attributeValue)},e))}}}}.build(e.attributeType,n))}));xH.displayName="EditModeAttribute";const SH=e=>L().text("${value}",{value:1===e?L().text("value"):L().text("values")}),CH=(0,_.has)("minValue"),wH=(0,_.has)("maxValue"),AH=(0,_.pipe)(wH,_.not),RH=(0,_.propSatisfies)((e=>1===e),"minValue"),_H=e=>{let{minValue:t}=e;return L().text("This attribute can have minimum ${minValue} ${minValueCaption}",{minValue:L().number(t,"0"),minValueCaption:SH(t)})},NH=e=>{let{maxValue:t}=e;return L().text("This attribute can have maximum ${maxValue} ${maxValueCaption}",{maxValue:L().number(t,"0"),maxValueCaption:SH(t)})},IH=(0,_.cond)([[_.isNil,(0,_.always)("")],[e=>{let{minValue:t,maxValue:r}=e;return t&&t===r},e=>{let{minValue:t}=e;return L().text("This attribute should have ${minValue} ${minValueCaption}",{minValue:L().number(t,"0"),minValueCaption:SH(t)})}],[(0,_.allPass)([RH,wH]),NH],[(0,_.allPass)([RH,AH]),(0,_.always)("")],[(0,_.allPass)([CH,wH]),e=>{let{minValue:t,maxValue:r}=e;return L().text("${minCardinality} and maximum ${maxValue} ${maxValueCaption}",{minCardinality:_H({minValue:t}),maxValue:L().number(r,"0"),maxValueCaption:SH(r)})}],[wH,NH],[CH,_H],[_.T,(0,_.always)("")]]),DH=(0,AE.Z)((()=>({caption:{fontSize:"0.7rem",opacity:.54}}))),PH=e=>{let{cardinality:t}=e;const r=DH(),n=IH(t);return n?v().createElement(DT(),{variant:"caption",className:r.caption},n):null};function kH(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){LH(e,t,r[t])}))}return e}function LH(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const FH={content:'""',position:"absolute",left:"-1000px",top:"-4px",width:"5000px",height:"calc(100% + 8px)",animationName:"$highlightAnimation",animationDuration:"2s",animationIterationCount:1,opacity:0},jH=(0,AE.Z)((()=>({"@keyframes highlightAnimation":{"0%":{opacity:0},"50%":{opacity:1},"100%":{opacity:0}},highlighted:{"&::before":kH({},FH,{background:"rgba(228, 151, 0, 0.08)"}),position:"relative"}}))),UH=e=>{const t=jH(),r=(0,b.useRef)(null);return(0,b.useEffect)((()=>{e&&e.scrollIntoRef(r)}),[e]),e?{ref:r,highlightedClassName:t.highlighted}:{ref:r}},MH=(0,_.filter)((0,_.propSatisfies)(x.isTempUri,"uri")),VH=(0,AE.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"}}))),BH=e=>{let{max:t,values:r,attributeType:n,parentUri:a,mode:i,drawLines:o,showEmptyEditors:l,errorMessage:s,errors:c,paging:u,crosswalks:p,showNonOv:d,nonVisibleValues:m,highlightedError:y,highlightedAttribute:f,onAddAttributes:g,onDeleteAttribute:h,onChangeAttribute:E,onDeactivateError:T,additionalControlsRenderer:S,requestNextPageOfAttributeValues:C}=e;const w=VH(),[A,R]=(0,b.useState)(t),[N,I]=(0,b.useState)(!1),{label:D,required:P,cardinality:k,name:L,uri:F,description:j}=n,U=(0,x.isEditableMode)(i),{ref:M,errorClassName:V}=pz({highlightedError:y}),{ref:B,highlightedClassName:z}=UH(f),H=(0,b.useContext)(Ez),Y=(0,b.useMemo)((()=>null==H?void 0:H.includes(F)),[F,H]),W=(0,x.isEmptyValue)(r),G=(!N&&l||P||Y)&&W,q=(0,b.useRef)((0,x.createNewAttribute)({parentUri:a,attributeType:(0,_.omit)(["defaultValue"],n)})),Z=(0,b.useCallback)((()=>{R(A+1);const e=e=>({parentUri:a,index:A,attributeType:e});if(G&&!(0,x.isComplexAttribute)(n.type)){const t=[e((0,_.omit)(["defaultValue"],n)),e(n)];return g(t)}return g([e(n)])}),[A,g,a,n,G]),$=(0,b.useCallback)((0,_.pipe)(h,_.T,I),[h,I]);if(W&&!G)return null;if(G&&W&&(r=[q.current]),(0,x.isEmptyValue)(r))return null;const K=(MH(r)||[]).length,Q=d?"totalValues":"totalOvValues",X=(0,_.ifElse)((0,_.has)(Q),(0,_.pipe)((0,_.prop)(Q),(0,_.add)(K)),(0,_.always)(r.length))(u),J=null!=u&&u.totalValues?u.totalValues-X:null==m?void 0:m.length,ee=t<X,te=ee&&A<X,re=ee&&A>=X,ne=r.slice(0,A),ae=ne?ne.length-1:0,ie=X-A;return v().createElement(nU,{enabled:o},v().createElement("div",{ref:M,className:O()(w.wrapper,V)},v().createElement("div",{className:w.titleWrapper},v().createElement(yM,{label:D,isRequired:P,className:w.title,"data-reltio-id":"reltio-attribute-label"}),v().createElement(xM,{description:j}),v().createElement(EM,{nonOvValues:m,attributeType:n,className:w.ovIcon,nonOvTotal:J})),U&&v().createElement(PH,{cardinality:k}),U&&v().createElement(FB,{message:s,className:w.typeError}),v().createElement("div",{className:w.attributesWrapper},ne.map(((e,t)=>v().createElement(xH,{key:e.uri,attributeValue:e,attributeType:n,lazy:G&&!P,showEmptyEditors:l,errors:c,ownError:(0,x.getAttributeOwnError)(e,t,n.uri,c),mode:i,crosswalks:p,onAddOneMore:ae===t?Z:null,onAddAttributes:g,onDeleteAttribute:$,onChangeAttribute:E,onDeactivateError:T,additionalControlsRenderer:S,className:0===t?z:null,ref:0===t?B:null,isEmptyEditor:G}))),te&&v().createElement(RV,{moreNumber:(0,_.min)(t,ie),valueNumber:ie,onClick:()=>{r.length<X&&C({parentUri:a,attributeTypeUri:F,attributeTypeName:L,values:r,defaultMaxValues:t}),R(A+t)}}),re&&v().createElement(DV,{onClick:()=>{R(t)}}))))};BH.displayName="AttributeRenderer";const zH=(0,b.memo)(BH),HH=(0,AE.Z)({value:{color:"rgba(0, 0, 0, 0.87)"},placeholder:{color:"rgba(0, 0, 0, 0.38)",fontSize:"14px !important"}}),YH=e=>{let{selectProps:{menuIsOpen:t},data:{label:r}}=e;const n=HH();return!t&&v().createElement(DT(),{variant:"body2",classes:{root:n.value}},r)};YH.propTypes={selectProps:OE().shape({menuIsOpen:OE().bool}),data:OE().shape({label:OE().string})};const WH=YH;function GH(){return GH=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},GH.apply(this,arguments)}const qH=e=>{const t=HH(),{innerProps:r={},children:n}=e;return v().createElement(DT(),GH({className:t.placeholder},r),n)};function ZH(){return ZH=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ZH.apply(this,arguments)}qH.propTypes={children:OE().node,innerProps:OE().object,selectProps:OE().object.isRequired};const $H={SingleValue:WH,Placeholder:qH},KH=(0,b.memo)((e=>{let t=ZH({},e);return v().createElement(Wz,ZH({components:$H},t))})),QH=(0,AE.Z)({container:{display:"flex",flex:1,alignItems:"flex-start",marginBottom:"10px"},roleContainer:{width:"100%"},valueContainer:{marginLeft:"8px",width:0},deleteButton:{marginLeft:"8px"}}),XH={MultiValue:AO._},JH=e=>{let{values:t,onChange:r,onDelete:n}=e;const a=QH(),i=(0,w.AH)(),o=(0,w.eh)(),l=o.uri,s=(0,x.getRolesForEntityType)(i,o.type).map((e=>({value:e.uri,label:e.label}))),c=(t||[]).map((e=>{var t;return{value:e,label:(null===(t=s.find((0,_.propEq)("value",e)))||void 0===t?void 0:t.label)||(0,x.getLastUriPart)(e)}})),u=(0,b.useCallback)((e=>{const t=(null==e?void 0:e.map((0,_.prop)("value")))||[];r({value:t,attributeType:x.EntityAttrTypes.roles,uri:l})}),[l,r]),p=(0,b.useCallback)((()=>{n({uri:l,attributeType:x.EntityAttrTypes.roles})}),[l,n]);return v().createElement("div",{className:a.container,"data-reltio-id":"reltio-attribute-value"},v().createElement(KH,{label:"",height:40,isMulti:!0,options:s,value:c,onChange:u,components:XH,classes:a,className:a.roleContainer}),!!n&&v().createElement(jE.T,{"data-reltio-id":"reltio-roles-delete-button",className:a.deleteButton,icon:UB(),onClick:p,size:"L"}))};var eY=r(56333);const tY=(0,AE.Z)({container:{display:"flex",flex:1,alignItems:"flex-start",marginBottom:"10px"},deleteButton:{marginLeft:"8px"}});function rY(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){nY(e,t,r[t])}))}return e}function nY(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const aY=e=>{let{className:t,values:r,onChange:n,onDelete:a}=e;const i=tY(),o=(0,w.lG)(),l=(0,w.mU)(),s=(0,b.useCallback)((async(e,t,r)=>{const n=await(0,x.getFacetedAttributeData)({fieldName:"tags",searchValue:e,options:rY({},l,{max:t,pageNo:r})});return Object.keys(n.tags)}),[l]),c=(0,b.useCallback)((e=>{n({value:e,attributeType:x.EntityAttrTypes.tags,uri:o})}),[n,o]),u=(0,b.useCallback)((()=>{a({uri:o,attributeType:x.EntityAttrTypes.tags})}),[o,a]);return v().createElement("div",{className:i.container,"data-reltio-id":"reltio-attribute-value"},v().createElement(eY.p,{fullWidth:!0,multiple:!0,variant:"filled",className:t,value:r||[],onChange:c,getSuggestions:s}),!!a&&v().createElement(jE.T,{"data-reltio-id":"reltio-tags-delete-button",className:i.deleteButton,icon:UB(),onClick:u,size:"L"}))};function iY(){return iY=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},iY.apply(this,arguments)}function oY(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const lY=(0,rz.l)(bz,((e,t)=>{let{attributeType:r}=t;const{hasDeletionsMap:n,setHasDeletions:a}=e||{};return{hasDeletions:n?Boolean(n[null==r?void 0:r.uri]):void 0,setHasDeletions:a}}),(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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["values","attributeType","parentUri","mode","errorMessage","onDeleteAttribute","onChangeAttribute","showEmptyEditors","hasDeletions","setHasDeletions","highlightedAttribute"]);const m=VH(),{label:y,required:f,cardinality:g}=r,h=(0,x.isEditableMode)(a),[E,T]=(0,b.useState)(!1),S=(0,b.useCallback)((e=>{T(e),null==u||u(r.uri,e)}),[r.uri,u]),C=void 0!==c?c:E,w=(0,b.useCallback)((0,_.pipe)(o,_.T,S),[o,S]),A=(0,x.isEmptyValue)(t),R=!C&&s&&A,N=(0,b.useRef)((0,x.createNewAttribute)({parentUri:n,attributeType:r})),{ref:I,highlightedClassName:D}=UH(p);return(0,x.isActivenessAttrType)(r)&&A&&!R?null:v().createElement("div",{ref:I,className:O()(D,m.wrapper)},v().createElement(yM,{label:y,isRequired:f,className:O()(m.title,m.titleWrapper),"data-reltio-id":"reltio-attribute-label"}),h&&v().createElement(PH,{cardinality:g}),h&&v().createElement(FB,{message:i}),v().createElement(Wj(),{className:m.attributesWrapper},(()=>{switch(r.uri){case x.EntityAttrTypes.tags.uri:return v().createElement(aY,{values:t,onDelete:w,onChange:l});case x.EntityAttrTypes.roles.uri:return v().createElement(JH,{values:t,onDelete:w,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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){oY(e,t,r[t])}))}return e}({},N.current,{value:t[0]||""});return v().createElement(xH,iY({attributeValue:e,attributeType:r,mode:a,onDeleteAttribute:w,onChangeAttribute:l},d))}}})()))}));var sY=r(57517),cY=r.n(sY);function uY(){return uY=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},uY.apply(this,arguments)}const pY=e=>v().createElement("svg",uY({width:18,height:18,viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),v().createElement("defs",null,v().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"})),v().createElement("g",{transform:"translate(-3 -3)",stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},v().createElement("mask",{id:"Download_svg__b",fill:"#fff"},v().createElement("use",{xlinkHref:"#Download_svg__a"})),v().createElement("path",{fillOpacity:.54,fill:"#fff",mask:"url(#Download_svg__b)",d:"M0 0h24v24H0z"})));var dY=r(76550),mY=r.n(dY),yY=r(29367),fY=r.n(yY);const gY=(0,AE.Z)((()=>({root:{fontSize:"24px",color:"#fff"}}))),hY=e=>{let{checked:t,className:r,onClick:n}=e;const a=gY(),i=t?fY():mY();return v().createElement(i,{className:O()(a.root,r),onClick:n})},EY=(0,AE.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"}}))),bY=(0,b.memo)((e=>{const{id:t,canBeSelected:r=!1,selected:n=!1,selectionMode:a=!1,onDeselect:i=SE.ZT,onSelect:o=SE.ZT,onShareLink:l,onSetAsDefault:s,onDelete:c,onDownload:u=SE.ZT,onClick:p}=e,d=EY(),[m,y]=(0,b.useState)(!1),{canDelete:f}=OB(t),g=(0,b.useMemo)((()=>[{text:L().text("Share link"),onClick:l},{text:L().text("Set as default"),onClick:s},{text:L().text("Delete"),onClick:f&&c}].filter((0,_.prop)("onClick"))),[l,s,c,f]),h=e=>()=>(0,_.ifElse)((0,_.equals)(!0),i,o)(e),E=r&&(n||m||a),T=!a&&!n&&m,x=r&&n;return v().createElement("div",{className:O()(d.overlay,{[d.selected]:n,[d.selectionMode]:a}),onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),onClick:a?h(n):e=>{e.currentTarget===e.target&&p()},"data-reltio-id":"image-actions-overlay"},E&&v().createElement(hY,{className:d.checkedIcon,checked:n,onClick:h(n)}),T&&v().createElement("div",{className:d.actions},v().createElement(jE.T,{onClick:u,className:d.actionButton,icon:pY}),v().createElement(IU,{menuId:`image-overlay-actions-${t}`,buttonComponent:jE.T,buttonProps:{icon:Hb(),className:O()(d.actionButton,d.dropDownMenuButton)},menuItems:g})),x&&v().createElement(yC(),{className:d.button,variant:"outlined",onClick:i},L().text("Deselect")))}));var vY=r(70251),TY=r.n(vY),OY=r(1937),xY=r.n(OY);const SY=(0,AE.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}}))),CY=e=>0===e.trim().length,wY=e=>{let{onSend:t}=e;const r=SY(),[n,a]=(0,b.useState)(""),[i,o]=(0,b.useState)(null);return v().createElement(Wj(),{className:r.root},v().createElement(Zj(),{className:r.paper},v().createElement(xY(),{value:n,onChange:e=>{const t=e.target.value,r=new RegExp(/^(ftp|http|https):\/\/[^ "]+$/).test(t);a(t),r||CY(t)?o(null):o(L().text("URL is not correct"))},classes:{root:r.inputRoot,input:r.input},placeholder:L().text("Paste an image URL here")}),v().createElement(yC(),{disabled:Boolean(i)||CY(n),variant:"outlined",color:"primary",onClick:()=>{t(n),a(""),o(null)}},L().text("Send"))),i&&v().createElement(DT(),{className:r.errorMessage},i))};var AY=r(65680),RY=r(83997);const _Y=["image/png","image/jpeg","image/tiff","image/gif","image/bmp"],NY=e=>{let{className:t,onAppendFile:r}=e;return v().createElement(v().Fragment,null,v().createElement("input",{onInput:e=>{r&&r(e.currentTarget.files[0])},style:{display:"none"},accept:_Y.join(","),id:"upload-image-button","data-reltio-id":"upload-image-button",type:"file"}),v().createElement("label",{htmlFor:"upload-image-button"},v().createElement(yC(),{className:t,variant:"contained",color:"primary",component:"span"},L().text("Select image"))))};function IY(){return IY=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},IY.apply(this,arguments)}const DY=e=>v().createElement("svg",IY({width:256,height:256,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),v().createElement("defs",null,v().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"UploadIcon_svg__c"},v().createElement("stop",{stopColor:"#FFF",offset:"0%"}),v().createElement("stop",{stopColor:"#FFF",stopOpacity:0,offset:"100%"})),v().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"UploadIcon_svg__d"},v().createElement("stop",{stopColor:"#FFF",offset:"0%"}),v().createElement("stop",{stopColor:"#FFF",stopOpacity:0,offset:"100%"})),v().createElement("linearGradient",{x1:"67.572%",y1:"54.952%",x2:"15.212%",y2:"13.907%",id:"UploadIcon_svg__e"},v().createElement("stop",{stopColor:"#000",stopOpacity:0,offset:"0%"}),v().createElement("stop",{stopColor:"#000",offset:"100%"})),v().createElement("linearGradient",{x1:"50%",y1:"0%",x2:"50%",y2:"100%",id:"UploadIcon_svg__f"},v().createElement("stop",{stopColor:"#B8EDFF",offset:"0%"}),v().createElement("stop",{stopColor:"#53ACDE",offset:"100%"})),v().createElement("circle",{id:"UploadIcon_svg__a",cx:128,cy:128,r:128})),v().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},v().createElement("mask",{id:"UploadIcon_svg__b",fill:"#fff"},v().createElement("use",{xlinkHref:"#UploadIcon_svg__a"})),v().createElement("use",{fillOpacity:.1,fill:"#0072CE",xlinkHref:"#UploadIcon_svg__a"}),v().createElement("g",{mask:"url(#UploadIcon_svg__b)"},v().createElement("g",{strokeWidth:1,fill:"none",transform:"translate(-1 9)"},v().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}),v().createElement("ellipse",{fill:"url(#UploadIcon_svg__c)",opacity:.4,cx:64.553,cy:107.664,rx:61.43,ry:62.336}),v().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})),v().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)"}),v().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)"})))),PY=(0,AE.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"}}))),kY=e=>{let{onAppendFile:t,className:r}=e;const n=PY(),[{canDrop:a,isOver:i},o]=(0,AY.useDrop)({accept:[RY.FILE],drop:e=>{e&&t(e.files[0])},collect:e=>({isOver:e.isOver(),canDrop:e.canDrop()})}),l=a&&i;return v().createElement("div",{ref:o,className:O()(n.root,{[n.isActive]:l},r)},v().createElement(DY,{className:n.icon}),v().createElement(DT(),{className:n.title},L().text("Drag an image here")),v().createElement(DT(),{className:n.description},L().text("Acceptable image types would include JPG, PNG, TIFF, GIF, BMP. Maximum image size: ${MAX_IMAGE_SIZE}Mb",{MAX_IMAGE_SIZE:20})),v().createElement(NY,{onAppendFile:t}))},LY=(0,AE.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"}}))),FY=e=>{let{children:t,className:r}=e;const n=LY();return v().createElement(Wj(),{className:O()(n.root,r)},v().createElement(Wj(),{className:n.border}),v().createElement(DT(),{className:n.text},t),v().createElement(Wj(),{className:n.border}))},jY=(0,AE.Z)({closeIcon:{color:"#fff"}}),UY=e=>{let{error:t,onClose:r}=e;const n=jY();return v().createElement(uC(),{open:Boolean(t),onClose:r,message:t,action:v().createElement(_b.k,{className:n.closeIcon,tooltipTitle:L().text("Close"),icon:kE(),onClick:r})})},MY=(0,AE.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"}}))),VY=e=>{let{open:t,onClose:r,onUpload:n}=e;const a=MY(),[i,o]=(0,b.useState)(!1),[l,s]=(0,b.useState)(null),c=(0,w.qD)(),u=(0,w.fN)(),p=(0,w.Uv)(),d=e=>{o(!0),(0,x.uploadImage)({image:e,imageServicePath:c,environment:u,tenant:p}).then((e=>{n(e),r()})).catch((e=>{s((0,x.getRequestErrorMessage)(e,L().text("Something went wrong")))})).finally((()=>o(!1)))};return v().createElement(TY(),{open:t,onClose:r,classes:{paper:a.dialogPaper}},v().createElement(DT(),{className:a.title},L().text("Add new image")),v().createElement(Wj(),{className:a.body},v().createElement(kY,{className:a.targetBox,onAppendFile:e=>{if(!e)return s(L().text("No image selected."));const t=Number((e.size/1024/1024).toFixed(2)),r=_Y.includes(e.type);t>20?s(L().text("File size exceeds configured max file size.")):r?d(e):s(L().text("File format is not supported."))}}),v().createElement(FY,{className:a.divider},L().text("or")),v().createElement(wY,{onSend:e=>{d(e)}})),i&&v().createElement(GC.Z,null),v().createElement(UY,{error:l,onClose:()=>s(null)}))},BY=(0,AE.Z)((()=>({root:{width:"100%"},image:e=>{let{imageMargin:t}=e;return{marginRight:t,cursor:"pointer","&:last-child":{marginRight:0}}},uploadContainer:e=>{let{imageMargin:t,imageWidth:r,imageHeight:n}=e;return{backgroundColor:"white",width:r,height:n,cursor:"pointer",border:"1px dashed #0072CE",boxSizing:"border-box",marginRight:t,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}},uploadButton:{width:"50px",height:"50px"},uploadIcon:{fontSize:"36px"}}))),zY={},HY=e=>{let{attributeType:t={},attributeValues:r=[],onDeleteAttribute:n,onChangeAttribute:a,requestNextPageOfAttributeValues:i,parentUri:o,paging:l,showNonOv:s,imageSize:c=nB}=e;const u=BY(c),[p,d]=(0,b.useState)(!1),m=(0,w.ax)("setDefaultProfilePicForModifiedEntity"),y=(0,w.eh)()||zY,f=(0,w.AU)(y.uri),{canCreate:g}=(0,b.useContext)(TB),h=(0,b.useCallback)((()=>{d((e=>!e))}),[]),E=(0,b.useCallback)((e=>{const r=(0,x.generateUri)(o,t.name),n={};for(const a in e){const i=(t.attributes||[]).find((e=>{let{name:t}=e;return t===a}));i&&(n[a]=[{uri:(0,x.generateUri)(r,i.name),ov:!0,value:e[a],type:i.uri}])}a({attributeType:t,uri:r,value:n})}),[a,o,t]),T=(0,b.useCallback)((e=>{if(n(e),f===e.uri){var t;const n=(null===(t=r[0])||void 0===t?void 0:t.uri)===e.uri?r[1]:r[0];m({entityUri:y.uri,value:n||{}})}}),[n,y,f,r,m]),O=(e,r)=>{const{onOpenImageGalleryDialog:n,onDownload:a,onShareLink:i,onSetAsDefault:o}=e,l=(0,x.getImageAttributeOvUrl)(r),{uri:s}=r;return v().createElement(bY,{id:s,onShareLink:()=>i(l),onSetAsDefault:()=>o(r),onDelete:()=>T({uri:s,attributeType:t}),onDownload:()=>a([l]),onClick:()=>n(s)})};return v().createElement("div",{className:u.root,"data-reltio-id":"image-line-edit-mode"},v().createElement(AW,{attributeValues:r,attributeType:t,renderImage:e=>function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const r=(0,x.getImageAttributeOvThumbnailUrl)(t),{uri:n}=t,{onOpenImageGalleryDialog:a}=e;return v().createElement("div",{className:u.image,key:n},v().createElement(rB,{src:r,overlay:O(e,t),onClick:()=>a(n),size:{imageWidth:c.imageWidth,imageHeight:c.imageHeight},"data-reltio-id":"reltio-attribute-value"}))},overlay:!0,countFixedItems:g?1:0,onUpload:h,onDeleteAttribute:T,imageSize:c,requestNextPageOfAttributeValues:i,paging:l,parentUri:o,showNonOv:s},g&&v().createElement("div",{className:u.uploadContainer,onClick:h},v().createElement(jE.T,{className:u.uploadButton,iconClassName:u.uploadIcon,icon:cY(),"data-reltio-id":"reltio-upload-image-button"}))),v().createElement(VY,{open:p,onUpload:E,onClose:h}))},YY=e=>{let{attributeType:t,attributeValues:r,paging:n,parentUri:a,showNonOv:i,onDeleteAttribute:o,onChangeAttribute:l,requestNextPageOfAttributeValues:s,highlightedAttribute:c,error:u,highlightedError:p,onDeactivateError:d}=e;const m=VH(),{label:y,description:f,required:g}=t,{ref:h,highlightedClassName:E}=UH(c),{ref:T,errorClassName:S}=pz({highlightedError:p}),C=(0,b.useCallback)((()=>{u&&d&&d((0,x.getErrorId)(u))}),[u,d]);return v().createElement("div",{ref:h,className:O()(m.wrapper,E)},v().createElement("div",{ref:T,className:O()(m.imagesWrapper,S)},v().createElement("div",{className:m.titleWrapper},v().createElement(yM,{className:m.title,label:y,"data-reltio-id":"reltio-attribute-label",isRequired:g}),v().createElement(xM,{description:f})),v().createElement(GB,{errorMessage:null==u?void 0:u.message,className:m.errorWrapper},v().createElement(HY,{attributeValues:r,attributeType:t,paging:n,onDeleteAttribute:o,parentUri:a,onChangeAttribute:(0,_.pipe)(l,C),requestNextPageOfAttributeValues:s,showNonOv:i}))))};let WY=function(e){return e.imageLine="imageLine",e.special="special",e.default="default",e}({});function GY(){return GY=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},GY.apply(this,arguments)}const qY=(0,rz.l)(oz,((e,t)=>{let{attributeType:r,parentUri:n}=t;const{element:a,type:i}=e||{},o=(e=>e===az.NewAttribute)(i)&&a.uri===r.uri;return{highlightedAttribute:o?e:null,highlightedError:iz(i)&&(0,x.isAttributeTypeError)(a,n,r.uri)?e:null}}),(e=>{var t;let{values:r,attributeType:n,mode:a=x.Mode.Viewing,crosswalks:i,drawLines:o,paging:l={},parentUri:s,max:c,showEmptyEditors:u,showNonOv:p,highlightedError:d,highlightedAttribute:m,onAddAttributes:y,onDeleteAttribute:f,onChangeAttribute:g,additionalControlsRenderer:h}=e;const E=(0,w.ax)("errorDeactivated"),b=(0,w.ax)("requestNextPageOfAttributeValues"),T=(0,w.Jz)(s,n),O=(0,w.Xj)(),S=(0,w.vd)(),C=(0,x.getAttributePagerActiveTypeErrorMessage)(s,n,O),A=null!==(t=null!=c?c:S)&&void 0!==t?t:1/0,R=(0,_.partition)(x.isOv),[N,I]=R(r),D=p?r:N,P=p?[]:I,k={errorMessage:C,errors:T,mode:a,parentUri:s,onAddAttributes:y,onDeleteAttribute:f,onChangeAttribute:g,onDeactivateError:E,additionalControlsRenderer:h,showEmptyEditors:u,highlightedError:d,highlightedAttribute:m};return(()=>{switch((0,_.cond)([[x.isSpecialAttribute,(0,_.always)(WY.special)],[x.isImage,(0,_.always)(WY.imageLine)],[_.T,(0,_.always)(WY.default)]])(n)){case WY.special:return v().createElement(nU,{enabled:o},v().createElement(lY,GY({values:D,attributeType:n},k)));case WY.imageLine:return v().createElement(nU,{enabled:o},v().createElement(YY,{attributeValues:D,attributeType:n,paging:l,onDeleteAttribute:f,parentUri:s,onChangeAttribute:g,requestNextPageOfAttributeValues:b,showNonOv:p,highlightedAttribute:m,error:(0,x.getAttributeErrorByTypeUri)(n.uri,T),highlightedError:d,onDeactivateError:E}));default:return v().createElement(zH,GY({values:D,attributeType:n,max:A,paging:l,crosswalks:i,drawLines:o,requestNextPageOfAttributeValues:b,showNonOv:p,nonVisibleValues:P},k))}})()})),ZY=(0,AE.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"}}),$Y=e=>{let{attributeType:t,imageAttributeFieldsOrder:r,attributeValue:n,hasChanges:a,onDeleteAttribute:i,onChangeAttribute:o,onAddAttributes:l,onCancel:s,onApply:c,mode:u}=e;const p=ZY(),d=AB(n,t,r),m=0!==d.length||0===d.length&&a;return v().createElement(Wj(),{className:p.root},v().createElement(Wj(),{className:p.form},d.map((e=>{let{attrType:t,values:r}=e;return v().createElement(qY,{key:t.uri,parentUri:n.uri,attributeType:t,values:r,showEmptyEditors:(0,x.isTempUri)(n.uri),mode:u,drawLines:!1,onDeleteAttribute:i,onChangeAttribute:o,onAddAttributes:l})}))),m&&v().createElement(v().Fragment,null,v().createElement(pS(),{className:p.divider}),v().createElement(Wj(),{className:p.actions},v().createElement(yC(),{disabled:!a,onClick:s,className:p.cancelButton},L().text("Cancel")),v().createElement(yC(),{disabled:!a,onClick:c,color:"primary"},L().text("Apply")))))},KY={palette:{mode:"dark",primary:x.theme.palette.primary,secondary:x.theme.palette.secondary}},QY=(0,Mv.createTheme)(KY),XY=e=>{let{imageAttributeFieldsOrder:t,attributeType:r,attributeValue:n}=e;const a=(0,w.YA)(),i=(0,w.o_)(),{addAttributes:o,changeAttribute:l,deleteAttribute:s,clearLocalChanges:c,applyLocalChanges:u,attributeValue:p,hasChanges:d}=(e=>{let{initialAttributeValue:t,attributeType:r}=e;const n=(0,w.ax)("modifyAttribute"),[a,i]=(0,b.useState)(t);(0,b.useEffect)((()=>{i(t)}),[t]);const o=!(0,_.equals)(a,t),l=(0,b.useCallback)((e=>{i((t=>e.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a}=t;return(0,x.addAttribute)({entity:e,attributeType:r,parentUri:n,index:a,nestingLevel:1})}),t)))}),[]),s=(0,b.useCallback)((e=>{let{value:t,attributeType:r,uri:n}=e;i((e=>(0,x.editAttribute)({entity:e,attributeType:r,uri:n,value:t,nestingLevel:1})))}),[]),c=(0,b.useCallback)((e=>{let{attributeType:t,uri:r}=e;i((e=>(0,x.removeAttribute)({entity:e,attributeType:t,uri:r,nestingLevel:1})))}),[]);return{addAttributes:l,changeAttribute:s,deleteAttribute:c,clearLocalChanges:(0,b.useCallback)((()=>{i(t)}),[t]),applyLocalChanges:(0,b.useCallback)((()=>{n({value:a,attributeType:r,uri:a.uri})}),[a,r,n]),attributeValue:a,hasChanges:o}})({attributeType:r,initialAttributeValue:n});return v().createElement(Mv.ThemeProvider,{theme:QY},v().createElement(Wj(),null,v().createElement(NB,{attributeType:r,uri:null==p?void 0:p.uri,onAddAttributes:i?o:void 0}),v().createElement(kB,{attributeType:r,attributeValue:p,imageAttributeFieldsOrder:t}),i&&v().createElement($Y,{mode:a,imageAttributeFieldsOrder:t,attributeType:r,attributeValue:p,hasChanges:d,onDeleteAttribute:s,onChangeAttribute:l,onAddAttributes:o,onCancel:c,onApply:u})))},JY=(0,AE.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}}))),eW=e=>{let{className:t,attributeValue:r,handleSetAsDefault:n,attributeType:a}=e;const i=JY(),[o,l]=(0,b.useState)(!1),s=(0,w.eh)()||{},c=(0,w.vc)(null==s?void 0:s.uri)||{},u=(0,w.xH)(),p=(0,w.uO)()||{},d=u?s:c,m=p[null==s?void 0:s.type]||(null==p?void 0:p.default)||{};(0,b.useEffect)((()=>{l((null==d?void 0:d.defaultProfilePic)===(null==r?void 0:r.uri))}),[null==r?void 0:r.uri,d]);const y=(0,b.useCallback)((()=>{n(r.uri)}),[null==r?void 0:r.uri]);return v().createElement(Wj(),{className:O()(i.root,t)},v().createElement(Wj(),{className:i.header},v().createElement(DT(),{className:i.headerTitle},L().text("Details"))),v().createElement(Wj(),{className:i.bodyWrapper},v().createElement(Wj(),{className:i.body},v().createElement(HS(),{classes:{root:i.formControlLabel,label:i.checkboxLabel},control:v().createElement(rb(),{className:i.checkbox,checked:o,onChange:y}),label:L().text("Set as default")}),v().createElement(XY,{attributeType:a,imageAttributeFieldsOrder:m,attributeValue:r}))))},tW=(0,AE.Z)((()=>({root:{display:"flex",width:"100%",overflowY:"auto",height:"calc(100vh - 64px)"},main:{flex:"1 0 auto"},details:{width:"340px"}}))),rW=e=>{let{attributeValues:t=[],currentAttributeValueUri:r,setCurrentAttributeValueUri:n,handleSetAsDefault:a,attributeType:i}=e;const[o,l]=(0,b.useState)(0);(0,b.useEffect)((()=>{s(r?t.findIndex((e=>e.uri===r)):0)}),[r,t]);const s=(0,b.useCallback)((e=>{var r;l(e),n(null===(r=t[e])||void 0===r?void 0:r.uri)}),[t]),c=tW();return v().createElement(Wj(),{className:c.root},v().createElement(mB,{attributeValueIndex:o,setAttributeValueIndex:s,attributeValues:t,className:c.main}),v().createElement(eW,{handleSetAsDefault:a,attributeValue:t[o],className:c.details,attributeType:i}))};var nW=r(60480),aW=r.n(nW),iW=r(54886),oW=r.n(iW),lW=r(86038),sW=r.n(lW),cW=r(39178),uW=r.n(cW);function pW(){return pW=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},pW.apply(this,arguments)}const dW=e=>v().createElement("svg",pW({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),v().createElement("defs",null,v().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"})),v().createElement("g",{stroke:"none",strokeWidth:1,fillRule:"evenodd"},v().createElement("mask",{id:"Details_svg__b",fill:"#fff"},v().createElement("use",{xlinkHref:"#Details_svg__a"})),v().createElement("path",{mask:"url(#Details_svg__b)",d:"M0 0h24v24H0z"}))),mW=(0,AE.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}})));let yW=function(e){return e.GALLERY_MODE="gallery",e.DETAILS_MODE="details",e}({});const fW=e=>{let{open:t,mode:r,children:n,header:a,onClose:i,onChangeMode:o}=e;const l=mW(),s=(0,b.useMemo)((()=>[{id:yW.GALLERY_MODE,title:L().text("Gallery"),Icon:uW()},{id:yW.DETAILS_MODE,title:L().text("Details"),Icon:dW}]),[]);return v().createElement(TY(),{classes:{paper:l.paper},open:t,BackdropProps:{className:l.backdrop},fullScreen:!0},v().createElement(oW(),{classes:{colorPrimary:l.appBar}},v().createElement(sW(),{className:l.toolbar},v().createElement(Wj(),{className:l.headerLeft},v().createElement(_b.k,{tooltipTitle:L().text("Close"),onClick:i,className:l.closeButton,iconClassName:l.closeIcon,icon:kE()}),null==a?void 0:a.left),v().createElement(Wj(),{className:l.headerCenter},v().createElement(JC,{modes:s,modeId:r,onChange:o,className:l.modeSwitcher})),v().createElement(Wj(),{className:l.headerRight},null==a?void 0:a.right))),v().createElement(aW(),{className:l.content},n))},gW=(0,AE.Z)((()=>({root:{padding:"0 24px",overflowY:"auto",height:"calc(100vh - 64px)"},item:{padding:"2px"}}))),hW=e=>{let{items:t,selectedItems:r,onSelectImage:n,onDeselectImage:a,onShareLink:i,onSetAsDefault:o,onDownload:l,onClickImage:s,onDelete:c}=e;const u=gW(),p=e=>v().createElement(bY,{id:e,selected:r.includes(e),selectionMode:0!==r.length,onSelect:()=>n(e),onDeselect:()=>a(e),onShareLink:()=>i(e),onSetAsDefault:()=>o(e),onDownload:()=>l(e),onClick:()=>s(e),onDelete:c?()=>c(e):void 0,canBeSelected:!0});return v().createElement(Wj(),{className:u.root},v().createElement(cB(),{container:!0},t.map((e=>{let{id:t,src:r}=e;return v().createElement(cB(),{key:t,classes:{item:u.item},item:!0},v().createElement(rB,{size:XV.LARGE,onClick:()=>s(t),src:r,overlay:p(t)}))}))))},EW=(0,AE.Z)((e=>({selectButton:{fontSize:"14px",fontWeight:500,color:e.palette.primary.main,textTransform:"uppercase"}}))),bW=e=>{let{selectedItems:t,items:r,onSelectAll:n,onClearAll:a}=e;const i=EW(),o=t.length===r.length;return v().createElement(zT(),{component:"button",underline:"none",classes:{button:i.selectButton},onClick:o?a:n},o?L().text("Clear selection"):L().text("Select all images"))};var vW=r(70997),TW=r.n(vW);const OW=(0,AE.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)"}}))),xW=e=>{let{onDownload:t,onShare:r,onUpload:n,onDelete:a}=e;const i=OW();return v().createElement(v().Fragment,null,n&&v().createElement(yC(),{variant:"contained",color:"primary",onClick:n,startIcon:v().createElement(cY(),null)},L().text("Upload")),t&&n&&v().createElement("div",{className:i.divider}),t&&v().createElement(_b.k,{className:i.downloadButton,tooltipTitle:L().text("Download selected items"),icon:pY,onClick:t}),r&&v().createElement(_b.k,{className:i.shareButton,tooltipTitle:L().text("Copy link"),icon:TW(),onClick:r}),a&&v().createElement(_b.k,{className:i.deleteButton,tooltipTitle:L().text("Delete selected items"),icon:UB(),onClick:a}))},SW=e=>{let{attributeValues:t,open:r,onClose:n,currentAttributeValueUri:a,setCurrentAttributeValueUri:i,attributeType:o,onDownload:l,onShareLink:s,onSetAsDefault:c,onUpload:u,onDeleteAttribute:p}=e;const[d,m]=(0,b.useState)([]),[y,f]=(0,b.useState)(yW.GALLERY_MODE),g=(0,w.xH)();(0,b.useEffect)((()=>{f(a?yW.DETAILS_MODE:yW.GALLERY_MODE)}),[a]);const h=t.map((e=>({src:(0,x.getImageAttributeOvThumbnailUrl)(e),downloadURL:(0,x.getImageAttributeOvUrl)(e),id:e.uri}))),E=e=>{s(h.find((0,_.propEq)("id",e)).downloadURL)},T=e=>{const r=t.find((t=>{let{uri:r}=t;return r===e}));c(r)},O=e=>{p({uri:e,attributeType:o})},{canCreate:S,canDelete:C}=(0,b.useContext)(TB),A=y===yW.GALLERY_MODE,R=y===yW.DETAILS_MODE,N=d.length>0,I=R||A&&N,D=()=>A?d:[a],P=D().every((e=>(0,x.isTempUri)(e)||C)),k=!g&&I&&P,L=!g&&S&&(R||A&&!N),F=A&&N&&v().createElement(bW,{items:h,selectedItems:d,onClearAll:()=>{m([])},onSelectAll:()=>{m((0,_.pluck)("id",h))}}),j=v().createElement(xW,{onDelete:k?()=>{D().forEach((e=>{O(e)})),d.length&&m([])}:void 0,onDownload:I?()=>{const e=A?(0,_.pipe)((0,_.filter)((e=>{let{id:t}=e;return d.includes(t)})),(0,_.pluck)("downloadURL"))(h):[h.find((0,_.propEq)("id",a)).downloadURL];l(e)}:void 0,onShare:R?()=>{E(a)}:void 0,onUpload:L?u:void 0});return v().createElement(fW,{mode:y,open:r,onChangeMode:f,header:{left:F,right:j},onClose:n},A&&v().createElement(hW,{items:h,selectedItems:d,onSelectImage:e=>{m((t=>[...t,e]))},onDeselectImage:e=>{m((t=>t.filter((t=>t!==e))))},onShareLink:E,onSetAsDefault:T,onDownload:e=>{l([h.find((0,_.propEq)("id",e)).downloadURL])},onClickImage:e=>{i(e),f(yW.DETAILS_MODE)},onDelete:g?void 0:O}),R&&v().createElement(rW,{handleSetAsDefault:T,setCurrentAttributeValueUri:i,currentAttributeValueUri:a,attributeValues:t,attributeType:o}))},CW=(0,AE.Z)((e=>({imageBox:{position:"relative",display:"flex",width:"100%",flexGrow:1,flexShrink:0,flexWrap:"nowrap",marginTop:"2px",overflow:"hidden"},moreButtonContainer:e=>{let{imageWidth:t,imageHeight:r}=e;return{backgroundColor:"white",width:t,height:r,position:"absolute",right:0,cursor:"pointer"}},moreButton:t=>{let{imageWidth:r,imageHeight:n}=t;return{display:"flex",justifyContent:"center",alignItems:"center",width:r,height:n,backgroundColor:(0,Mv.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 wW(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const AW=e=>{let{attributeType:t,attributeValues:r=[],renderImage:n,overlay:a=!1,countFixedItems:i=0,children:o,onUpload:l,onDeleteAttribute:s,imageSize:c=nB,paging:u,parentUri:p,showNonOv:d,requestNextPageOfAttributeValues:m}=e;const y=CW(c);(0,b.useEffect)((()=>{if(u&&m){const e=d?u.totalOvValues:u.totalValues;e>r.length&&m({parentUri:p,attributeTypeUri:t.uri,attributeTypeName:t.name,values:[],defaultMaxValues:e})}}),[u,m,t,p,r.length,d]);const f=(0,b.useRef)(),[g,h]=(0,b.useState)(0),[E,T]=(0,b.useState)(0),O=(0,b.useContext)(Hj),[S,C]=(0,b.useState)(!1),[A,R]=(0,b.useState)(),_=(0,w.ax)("setDefaultProfilePicForEntity"),N=(0,w.ax)("setDefaultProfilePicForModifiedEntity"),I=(0,w.eh)()||{},D=(0,w.xH)(),P=(0,b.useCallback)((e=>{const{imageMargin:t,imageWidth:n}=c,a=Math.floor((e+t)/(n+t))-i,o=e+t-(a+i)*(n+t)<8;h(a),r.length>a?T(r.length-a+(o?1:0)):T(0)}),[r.length,i,c]),k=(0,b.useCallback)((e=>{P(e),f.current=e}),[P]);(0,b.useEffect)((()=>{f.current&&P(f.current)}),[r.length,P]);const L=(0,b.useCallback)((e=>{O||(R(e),C(!0))}),[O]),F=(0,b.useCallback)((()=>{C(!1)}),[]),j=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),U=e=>navigator.clipboard.writeText(e),M=(0,b.useCallback)((e=>{D?(0,x.insertDefaultImageByAttrUri)(I.uri,e.uri).then((t=>{let{status:r}=t;"success"===r&&_(e)})):N({entityUri:I.uri,value:e})}),[D,I.uri,_,N]),V=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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){wW(e,t,r[t])}))}return e}({onOpenImageGalleryDialog:L},a&&{onDownload:j,onShareLink:U,onSetAsDefault:M});return v().createElement(v().Fragment,null,v().createElement(qE.Z,{handleWidth:!0,onResize:k}),v().createElement(SW,{attributeValues:r,open:S,onClose:F,setCurrentAttributeValueUri:R,currentAttributeValueUri:A,attributeType:t,onDownload:j,onShareLink:U,onSetAsDefault:M,onUpload:l,onDeleteAttribute:s}),v().createElement("div",{className:y.imageBox},o,r.slice(0,g).map(n(V)),E>0&&v().createElement("div",{className:y.moreButtonContainer},v().createElement("div",{className:y.moreButton,onClick:()=>L()},v().createElement(DT(),{className:y.number},`+${E}`)))))},RW=(0,AE.Z)((e=>({image:e=>{let{imageMargin:t,imageHeight:r,imageWidth:n}=e;return{marginRight:t,width:n,height:r,cursor:"pointer","&:last-child":{marginRight:0}}},deleteAttributeImage:{position:"relative","&:before":{content:"''",position:"absolute",left:0,top:0,right:0,bottom:0,background:`url('${(0,x.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:x.historyPalettes[x.HistoryOperations.deleteAttribute].backgroundColor,pointerEvents:"none"}},updateAttributeImage:{position:"relative","&:before":{content:"''",position:"absolute",left:0,top:0,right:0,bottom:0,backgroundColor:x.historyPalettes[x.HistoryOperations.updateAttribute].backgroundColor,pointerEvents:"none"}},deleteAttribute:e=>{let{imageWidth:t,imageHeight:r}=e;return{width:t,height:r,boxSizing:"border-box",outline:`3px solid ${x.historyPalettes[x.HistoryOperations.deleteAttribute].color}`,outlineOffset:"-3px"}},insertAttribute:e=>{let{imageWidth:t,imageHeight:r}=e;return{width:t,height:r,boxSizing:"border-box",outline:`3px solid ${x.historyPalettes[x.HistoryOperations.insertAttribute].color}`,outlineOffset:"-3px"}},updateAttribute:e=>{let{imageWidth:t,imageHeight:r}=e;return{width:t,height:r,boxSizing:"border-box",outline:`3px solid ${x.historyPalettes[x.HistoryOperations.updateAttribute].color}`,outlineOffset:"-3px"}},number:{color:e.palette.primary.main,fontSize:"24px",lineHeight:"42px",letterSpacing:0,padding:"36px 8px",textAlign:"center",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}}))),_W=e=>{let{attributeType:t,attributeValues:r=[],paging:n,parentUri:a,requestNextPageOfAttributeValues:i,showNonOv:o,imageSize:l=nB}=e;const s=RW(l),{appearance:c}=(0,b.useContext)(SM);return v().createElement(AW,{attributeValues:r,attributeType:t,renderImage:e=>{let{onOpenImageGalleryDialog:t}=e;return e=>{const r=(0,x.getImageAttributeOvThumbnailUrl)(e),{uri:n}=e,a=(0,x.getHistoryAppearanceByUri)(n,c),i=(0,x.getHistoryAttributeClassName)(a);return v().createElement("div",{className:O()(s.image,{[s[i+"Image"]]:i}),key:n,"data-reltio-id":"reltio-attribute-value"},v().createElement(rB,{onClick:()=>t(n),className:s[i],src:r,size:{imageWidth:l.imageWidth,imageHeight:l.imageHeight}}))}},imageSize:l,requestNextPageOfAttributeValues:i,paging:n,parentUri:a,showNonOv:o})},NW=e=>{let{attributeType:t,attributeValues:r,paging:n,parentUri:a,showNonOv:i,requestNextPageOfAttributeValues:o}=e;const l=xV(),{label:s,description:c}=t;return v().createElement(v().Fragment,null,v().createElement("div",{className:l.titleRow},v().createElement(yM,{className:l.title,label:s,"data-reltio-id":"reltio-attribute-label"}),v().createElement(xM,{className:l.descriptionIcon,description:c})),v().createElement(_W,{attributeValues:r,attributeType:t,paging:n,parentUri:a,requestNextPageOfAttributeValues:o,showNonOv:i}))},IW="oneLine",DW="multiLine",PW="imageLine",kW="special",LW=(0,b.memo)((e=>{var t;let{values:r,attributeType:n,drawLines:a,paging:i={},parentUri:o,max:l,titleClassName:s,contentClassName:c,showNonOv:u}=e;const p=TV(),d=(0,w.ax)("requestNextPageOfAttributeValues"),m=(0,w.vd)(),y=null!==(t=null!=l?l:m)&&void 0!==t?t:1/0,f=(0,_.partition)(x.isOv);if(!r||!r.length)return null;const[g,h]=f(r),E=u?r:g,b=u?[]:h,T=u?"totalValues":"totalOvValues",S=(0,_.ifElse)((0,_.has)(T),(0,_.prop)(T),(0,_.always)(E.length))(i),C=null!=i&&i.totalValues?i.totalValues-S:b.length,A=1===S&&!(0,x.isComplexAttribute)(n);return v().createElement(nU,{enabled:a,className:O()({[p.paddingWrapperWithLines]:a})},v().createElement("div",{className:O()({[p.paddingWrapper]:!a})},(()=>{switch((0,_.cond)([[x.isSpecialAttribute,(0,_.always)(kW)],[x.isImage,(0,_.always)(PW)],[(0,_.always)(A),(0,_.always)(IW)],[_.T,(0,_.always)(DW)]])(n)){case IW:return v().createElement(SV,{value:E[0],nonVisibleValues:b,totalNonVisibleValues:C,attributeType:n,titleClassName:s,contentClassName:c,showNonOv:u});case DW:return v().createElement(PV,{values:E,nonVisibleValues:b,totalVisibleValues:S,totalNonVisibleValues:C,attributeType:n,parentUri:o,max:y,requestNextPageOfAttributeValues:d,titleClassName:s,contentClassName:c,showNonOv:u});case PW:return v().createElement(NW,{attributeValues:E,attributeType:n,paging:i,parentUri:o,requestNextPageOfAttributeValues:d,showNonOv:u});case kW:return v().createElement(qV,{values:E,attributeType:n})}})()))})),FW=e=>{let{attrTypes:t,entity:r,parentUri:n,drawLines:a,children:i,className:o,max:l,alwaysVisibleTypeUris:s=hz,showNonOv:c}=e;const[u,p]=(0,b.useState)(l||1/0),d=(0,b.useMemo)((()=>(0,x.getAttributesListForReadMode)(t,r,c)),[t,r,c]),[m,y]=(0,b.useMemo)((()=>ZB(s,d)),[d,s]),f=y.slice(0,u),g=l&&f.length<y.length,h=l&&f.length>=y.length&&l<f.length,E={enabled:a};return v().createElement("div",{className:o},i&&v().createElement(nU,E,i),f.concat(m).map((e=>{let{attrType:t,values:i}=e;return v().createElement(LW,{key:t.uri,attributeType:t,drawLines:a,values:i,paging:(0,_.path)(["paging",t.uri],r.attributes),parentUri:n,showNonOv:c})})),g&&v().createElement(RV,{onClick:()=>{p(1/0)}}),h&&v().createElement(DV,{onClick:()=>{p(l)}}))};FW.displayName="ReadOnlyAttributesList";const jW=(0,b.memo)(FW),UW=(0,AE.Z)({attributesContainer:{padding:"8px 16px"},noCaption:{paddingTop:"16px"},noData:{fontSize:"13px",color:"rgba(0,0,0,0.54)"}}),MW=e=>{let{className:t,entity:r={},caption:n="",excludeUris:a=[],includeUris:i=[],attributesCount:o}=e;const l=UW(),s=(0,w.AH)(),c=(0,w.xK)(),u=(0,b.useMemo)((()=>{const e=(0,x.getRuleBasedAttributes)(s,r.type),t=(0,x.getHiddenDynamicAttributes)(e,r);return(0,_.pipe)(qB,(0,_.reject)((e=>{let{uri:r}=e;return t.includes(r)})))(s,r.type,i,a,t)}),[a,i,s,r]),p=o||16,d=(0,x.getAttributesListForReadMode)(u,r).filter((e=>{let{values:t}=e;return!(0,x.isEmptyValue)(t)})).length>0;return d||!(0,x.isEmptyValue)(n)?v().createElement(Gj.Provider,{value:c},v().createElement(Jj,{className:t},n&&v().createElement(eU.I,{title:n}),v().createElement(Wj(),{className:O()(l.attributesContainer,{[l.noCaption]:!n})},d?v().createElement(jW,{entity:r,attrTypes:u,parentUri:r.uri,drawLines:!1,max:p}):v().createElement(DT(),{className:l.noData},L().text("No data found"))))):null},VW=(0,AE.Z)({attributesContainer:{overflow:"hidden",padding:"8px 16px"},noCaption:{paddingTop:"16px"}}),BW=e=>{let{className:t,mode:r,entity:n,caption:a="",excludeUris:i=[],includeUris:o=[],pinnedAttributes:l}=e;const s=VW(),c=(0,w.ax)("addAttributes"),u=(0,w.ax)("modifyAttribute"),p=(0,w.ax)("removeAttribute"),d=(0,w.AH)(),m=(0,w.R2)(),y=(0,w.vc)(n.uri)||{},f=(0,b.useMemo)((()=>(0,x.getPinnedAttributesForUser)(l,m)),[l,m]),g=(0,b.useMemo)((()=>qB(d,y.type,o,i)),[i,o,d,y.type]);return v().createElement(Jj,{className:t},a&&v().createElement(eU.I,{title:a}),v().createElement(Wj(),{className:O()(s.attributesContainer,{[s.noCaption]:!a})},v().createElement(Ez.Provider,{value:f},v().createElement(xz,{entity:y,attrTypes:g,parentUri:y.uri,drawLines:!1,mode:r,showEmptyEditors:(0,x.isTempUri)(y.uri),crosswalks:y.crosswalks,onAddAttributes:c,onChangeAttribute:u,onDeleteAttribute:p}))))};function zW(){return zW=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},zW.apply(this,arguments)}const HW=e=>{let{attributesCount:t,pinnedAttributes:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributesCount","pinnedAttributes"]);const a=(0,w.Fr)(),i=(0,w.YA)(),o=n.entity||a,l=n.mode||i;return v().createElement(fM.Provider,{value:o},(0,x.isViewMode)(l)?v().createElement(MW,zW({},n,{attributesCount:t,entity:o})):v().createElement(BW,zW({},n,{mode:l,pinnedAttributes:r,entity:o})))},YW=(0,AE.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)"}}))),WW=()=>{const e=YW(),t=(0,xE.useSelector)(pg),r=(0,xE.useSelector)(cg);return v().createElement(v().Fragment,null,r&&v().createElement(GC.Z,null),t?v().createElement("div",{className:e.container},v().createElement(zj,{entity:t,classes:{profileBand:e.profileBand}}),v().createElement("div",{className:e.scrollWrapper},v().createElement(Hj.Provider,{value:!0},v().createElement(HW,{className:e.attributesView,entity:t,mode:x.Mode.Viewing})))):v().createElement("div",{className:e.emptyState},v().createElement(WC,{LogoRenderer:YC.NO_DATA,text:L().text("No data to display."),secondaryText:L().text("Select a profile and view preview details here."),variant:HC.embedded})))},GW="circle",qW="polygon",ZW={fillColor:"rgb(242,82,82)",fillOpacity:.1,strokeWeight:2,strokeColor:"#F25252",clickable:!1,editable:!0,zIndex:1},$W={mapTypeControl:!1,streetViewControl:!1,fullscreenControl:!1},KW=.001,QW=v().createContext({});QW.displayName="EntityMarkerContext";var XW=r(17871),JW=r(47111);const eG=e=>{let{children:t,className:r,position:n,map:a}=e;const[i,o]=(0,b.useState)(null);return(0,b.useEffect)((()=>{const e=document.createElement("div"),t=a.controls[n].length;return a.controls[n].push(e),o(e),()=>{a.controls[n].removeAt(t)}}),[a,n]),(0,b.useEffect)((()=>{i&&r&&i.classList.add(r)}),[r,i]),i?(0,JW.createPortal)(t,i):null};var tG=r(518),rG=r.n(tG);function nG(){return nG=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},nG.apply(this,arguments)}const aG=e=>v().createElement("svg",nG({width:18,height:18,viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg"},e),v().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 iG(){return iG=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},iG.apply(this,arguments)}const oG=e=>v().createElement("svg",iG({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink"},e),v().createElement("defs",null,v().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"})),v().createElement("g",{stroke:"none",strokeWidth:1,fill:"none",fillRule:"evenodd"},v().createElement("mask",{id:"Draw_svg__b",fill:"#fff"},v().createElement("use",{xlinkHref:"#Draw_svg__a"})),v().createElement("g",{mask:"url(#Draw_svg__b)",fill:"#000",fillOpacity:.54},v().createElement("path",{d:"M0 0h24v24H0z"})))),lG=(0,AE.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"}}),sG=(0,Eb.T)(yC()),cG=e=>{let{drawingMode:t,drawingModes:r=[],hasActiveOverlay:n,onDrawingModeChanged:a,onClearOverlay:i}=e;const o=lG(),l=e=>()=>{a(e)};return v().createElement("div",{className:o.container},t||n?v().createElement(sG,{tooltipTitle:L().text("Clear area"),className:o.button,onClick:n?i:l(null)},v().createElement(rG(),{className:o.icon})):r.map((e=>{const t=(e=>{switch(e){case GW:return aG;case qW:return oG;default:return null}})(e);return v().createElement(sG,{tooltipTitle:L().text("Draw area"),key:e,className:o.button,onClick:l(e)},v().createElement(t,{className:o.icon}))})))},uG=(0,AE.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"}}}),pG=e=>{let{isSearchOnMapMove:t,onChangeIsSearchOnMapMove:r}=e;const n=uG();return v().createElement(HS(),{classes:{root:n.container,label:n.label},control:v().createElement(rb(),{checked:t,onChange:e=>{r(e.target.checked)},className:n.checkbox}),label:L().text("Search as I move the map")})},dG=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]]},mG=e=>{switch(e){case GW:return window.google.maps.drawing.OverlayType.CIRCLE;case qW:return window.google.maps.drawing.OverlayType.POLYGON;default:return null}},yG=(e,t,r)=>{if(t.path){const n=r||new window.google.maps.LatLngBounds;t.path.forEach((e=>{let{lat:t,lng:r}=e;return n.extend(new window.google.maps.LatLng(t,r))})),e.fitBounds(n)}},fG=(0,AE.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"}}}}))),gG=e=>{let{entity:t,classes:r={}}=e;const n=fG(),{secondaryLabel:a,label:i}=r,o=(0,x.getLabel)(t.label),{secondaryLabel:l}=t,s=(0,b.useCallback)((()=>{navigator.clipboard.writeText((0,x.getEntityId)(t))}),[t]);return v().createElement(v().Fragment,null,v().createElement(A,{entity:t,imageClassName:n.image}),v().createElement("div",{className:n.info},v().createElement(Kb,{value:(0,x.getEntityUriForLink)(t),className:n.link},v().createElement(hb.Y,{value:o,placement:"top",showOnExceededHeight:!0},v().createElement("div",{className:O()(n.label,i)},o))),l&&v().createElement(hb.Y,{value:l,placement:"top",showOnExceededHeight:!0},v().createElement("div",{className:O()(n.secondaryLabel,a)},l)),v().createElement("div",{className:n.thirdRow},v().createElement(_C,{entity:t,size:"medium"}),v().createElement("div",{className:n.entityId,onClick:s},v().createElement("div",{className:n.entityIdLabel},L().text("ID:")),v().createElement(hb.Y,{value:`Copy to clipboard ${(0,x.getEntityId)(t)}`,placement:"top"},v().createElement("div",{className:n.entityIdValue},(0,x.getEntityId)(t)))))))},hG=(0,AE.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)"}}),EG=()=>{const e=hG();return v().createElement(v().Fragment,null,v().createElement("div",{className:O()(e.avatar,e.wave)}),v().createElement("div",{className:e.info},v().createElement("div",{className:O()(e.label,e.wave)}),v().createElement("div",{className:O()(e.secondaryLabel,e.wave)}),v().createElement("div",{className:O()(e.thirdRow,e.wave)})))},bG=(0,AE.Z)({container:{display:"flex",padding:"16px",overflow:"hidden"}});function vG(){return vG=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vG.apply(this,arguments)}const TG=(0,b.memo)((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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["entity","classes","variant"]);const i=bG(),{container:o}=r;return v().createElement("div",vG({className:O()(i.container,o)},a),"normal"===n?v().createElement(gG,{entity:t,classes:r}):v().createElement(EG,null))})),OG=(0,AE.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 xG(){return xG=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xG.apply(this,arguments)}const SG=(0,x.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>'),CG=(0,x.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>'),wG=(0,b.memo)((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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["marker","onClick"]);const a=OG(),i=(0,b.useRef)(),[o,l]=(0,b.useState)(!1),{activeEntityUri:s}=(0,b.useContext)(QW),c=(0,_.pathEq)(["entity","uri"],s,t),u={lat:t.point.lat,lng:t.point.lng},p=(0,b.useCallback)((0,x.debounce)(l,50),[]),d=(0,b.useCallback)((()=>p(!0)),[p]),m=(0,b.useCallback)((()=>p(!1)),[p]),y=(0,b.useCallback)((()=>r(t)),[r,t]);return v().createElement(v().Fragment,null,v().createElement(vU.Z,{anchorEl:i.current,open:o,className:a.popper,modal:!1,placement:"top"},v().createElement(TG,{entity:t.entity,onMouseOver:d,onMouseOut:m})),v().createElement(XW.Jx,xG({icon:{url:o||c?SG:CG,scaledSize:new google.maps.Size(22,32)},position:u,onClick:y,visible:!1!==t.visible,onMouseOver:d,onMouseOut:m},n)),v().createElement(XW.vD,{options:{alignBottom:!0,pane:"mapPane",pixelOffset:new google.maps.Size(0,-40),closeBoxURL:"",enableEventPropagation:!0,disableAutoPan:!0},position:u},v().createElement("span",{ref:i})))})),AG=(0,AE.Z)({mapControlContainer:{borderRadius:"2px",backgroundColor:"#FFFFFF",boxShadow:"0 1px 3px 0 rgba(0,0,0,0.15)",margin:"10px"}});function RG(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){_G(e,t,r[t])}))}return e}function _G(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const NG=["drawing"],IG=e=>{let{markers:t=[],mapKey:r,defaultZoom:n,defaultCenter:a,loadingElement:i,isSearchOnMapMove:o,isSearchEnabled:l,activeOverlay:s,overlayOptions:c={},drawingModes:u=[],markerClusterer:p,markerClustererOptions:d,mapOptions:m={},mapContainerClassName:y,onMapBoundsChanged:f=SE.ZT,onOverlayUpdated:g=SE.ZT,onMarkerClicked:h=SE.ZT}=e;const E=AG(),{isLoaded:T,loadError:O}=(0,XW.Ji)({googleMapsApiKey:r,libraries:NG}),x=(0,b.useRef)(null),[S,C]=(0,b.useState)(null),[w,A]=(0,b.useState)(null),[R,N]=(0,b.useState)(null);(e=>{let{markers:t,activeOverlay:r,isSearchOnMapMove:n,map:a}=e;const i=Boolean(a&&window.google),o=(0,fO.D)(t),l=(0,fO.D)(r),s=(0,fO.D)(i);(0,b.useEffect)((()=>{const e=o!==t,c=s!==i,u=i&&r&&(l!==r||c);i&&!n&&t.length&&(e||c)?((e,t,r)=>{const n=new window.google.maps.LatLngBounds;if(e.forEach((e=>n.extend(e.point))),1===e.length){const e=n.getCenter();n.extend(new window.google.maps.LatLng(e.lat()+KW,e.lng()+KW)),n.extend(new window.google.maps.LatLng(e.lat()-KW,e.lng()-KW))}t.fitBounds(n),r&&yG(t,r,n)})(t,a,r):u&&yG(a,r)}),[i,t,r])})({markers:t,activeOverlay:s,map:S,isSearchOnMapMove:o});const I=(0,b.useMemo)((()=>RG({},ZW,c)),[c]),D=(0,b.useMemo)((()=>RG({},$W,m)),[m]),P=(0,b.useCallback)((e=>{f(e?dG(S):null),N(null),clearTimeout(x.current)}),[S,f]),k=(0,b.useCallback)((()=>{clearTimeout(x.current)}),[]),L=(0,b.useCallback)((()=>{o&&f(dG(S))}),[o,S,f]),F=(0,b.useCallback)((()=>{o&&(clearTimeout(x.current),x.current=setTimeout(L,1e3))}),[L,o]),j=(0,b.useCallback)(((e,t)=>{var r;const n=t||w&&{type:qW,overlay:w};if((0,_.isEmpty)(n))return;const{overlay:a,type:i}=n,o={[qW]:()=>a.getPath().getArray().map((e=>[e.lat(),e.lng()])),[GW]:()=>({radius:a.getRadius()/1e3,center:a.getCenter()})},l=null===(r=o[i])||void 0===r?void 0:r.call(o);l&&g({data:l,type:i})}),[g,w]),U=(0,b.useCallback)((e=>t=>{j(null,{type:e,overlay:t}),t.setMap(null),N(null)}),[j]),M=(0,b.useCallback)((()=>{g(null)}),[g]),V=e=>t.filter((0,_.prop)("point")).map((t=>v().createElement(wG,{key:t.id,marker:t,clusterer:e,onClick:h})));if(O)return null;if(!T)return i;const B=l&&Boolean(u.length),z=S&&l&&Boolean(u.length),H=S&&l,Y=!mG(R)&&s&&(0,_.propEq)("type",qW,s);return v().createElement(XW.b6,{mapTypeId:window.google.maps.MapTypeId.ROADMAP,options:D,onLoad:C,zoom:n,center:a,onZoomChanged:k,onDragStart:k,onIdle:F,mapContainerClassName:y},z&&v().createElement(eG,{className:E.mapControlContainer,position:window.google.maps.ControlPosition.TOP_RIGHT,map:S},v().createElement(cG,{hasActiveOverlay:!!s,drawingModes:u,drawingMode:R,onDrawingModeChanged:N,onClearOverlay:M})),H&&v().createElement(eG,{className:E.mapControlContainer,position:window.google.maps.ControlPosition.TOP_CENTER,map:S},v().createElement(pG,{onChangeIsSearchOnMapMove:P,isSearchOnMapMove:o})),p?(W=d,v().createElement(XW.XL,{options:W},V)):V(),Y&&v().createElement(XW.mg,{onLoad:A,path:s.path,editable:!0,options:I,onMouseUp:j,onDragEnd:j}),B&&v().createElement(XW.j_,{onPolygonComplete:U(qW),onCircleComplete:U(GW),drawingMode:mG(R),options:{drawingControl:!1,circleOptions:I,polygonOptions:I}}));var W},DG=(e,t)=>Math.abs(e-t)<1,PG=(0,_.curry)(((e,t,r)=>{const n=t.map((t=>{let{position:r}=t;const n=e.find((e=>{let{point:t}=e;return DG(r.lat(),t.lat)&&DG(r.lng(),t.lng)}));return(0,_.propOr)("","label",n)})),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}})),kG=[],LG=(0,_.pipe)((0,_.path)(["point","lat"]),(0,_.both)((0,_.gt)(90),(0,_.lt)(-90))),FG={[x.MAP_SEARCH_TYPES.geoPolygon]:qW,[x.MAP_SEARCH_TYPES.geoLocation]:GW},jG=e=>e&&e.length?[...e,e[0]]:e,UG=e=>e[0].map((e=>{let[t,r]=e;return{lat:t,lng:r}})).slice(0,-1),MG=(0,AE.Z)((()=>({container:{height:"100%",width:"100%",position:"relative"},fullHeight:{height:"100%"}}))),VG=()=>{const e=MG(),t=(0,xE.useSelector)(Cr().selectors.getMetadata),r=(0,xE.useSelector)(hp),n=(0,xE.useSelector)(Eu),a=(0,xE.useSelector)(Cr().selectors.getGoogleMapKey),{markers:i,loading:o,onMarkerClicked:l}=(e=>{let{searchResults:t,metadata:r,mapKey:n}=e;t=t||kG;const a=(0,xE.useDispatch)(),[i,o]=(0,b.useState)([]),[l,s]=(0,b.useState)(!1),c=(0,b.useRef)(),u=(0,b.useRef)(),p=(0,b.useCallback)((e=>{a({type:Hn,payload:e||null})}),[a]),d=(0,b.useCallback)((()=>{clearTimeout(u.current),clearTimeout(c.current)}),[]);return(0,b.useEffect)((()=>{s(!0),(0,x.resolve)(r,t,n).then((e=>{s(!1),o(e.filter(LG))})).catch((()=>{s(!1),o([])}))}),[t,r,n]),{markers:i,loading:l,onMarkerClicked:(0,b.useCallback)((e=>{const t=(0,_.path)(["entity","uri"],e);d(),p(),c.current=setTimeout((()=>p(t)),0),u.current=setTimeout(p,3e3)}),[d,p])}})({searchResults:r,metadata:t,mapKey:a}),{isSearchEnabled:s,activeOverlay:c,onOverlayUpdated:u,isSearchOnMapMove:p,onMapBoundsChanged:d}=(()=>{const e=(0,xE.useDispatch)(),t=(0,xE.useSelector)($u),r=(0,xE.useSelector)(Ku),n=(0,xE.useSelector)(Iu),[a,i]=(0,b.useState)(!1),o=(0,b.useCallback)((t=>{let r=null,n=null;if(t){const{data:e,type:a}=t;switch(a){case GW:{const{center:t,radius:a}=e;r=[t.lng(),t.lat(),a],n=x.MAP_SEARCH_TYPES.geoLocation;break}case qW:r=jG(e),n=x.MAP_SEARCH_TYPES.geoPolygon}}i(!1),e(Bc(r,n))}),[e]),l=(0,b.useCallback)((t=>{i(!!t),e(Bc(jG(t),t&&x.MAP_SEARCH_TYPES.onMapMove))}),[e]),s=FG[r],c=(0,b.useMemo)((()=>n&&s&&t.length?{path:s===qW?UG(t):null,type:s}:null),[n,t,s]);return(0,b.useEffect)((()=>{(c||0===t.length)&&i(!1)}),[t,c]),{isSearchEnabled:n,onOverlayUpdated:o,activeOverlay:c,isSearchOnMapMove:a,onMapBoundsChanged:l}})(),m=(0,b.useMemo)((()=>v().createElement("div",{className:e.fullHeight},v().createElement(GC.Z,null))),[e]),y=(0,b.useMemo)((()=>({gridSize:60,maxZoom:9,calculator:PG(i)})),[i]),f=(0,b.useMemo)((()=>({activeEntityUri:n})),[n]),g=(0,b.useMemo)((()=>({lat:0,lng:0})),[]),h=(0,b.useMemo)((()=>[qW]),[]);return a?v().createElement("div",{className:e.container},o&&v().createElement(GC.Z,null),v().createElement(QW.Provider,{value:f},v().createElement(IG,{loadingElement:m,defaultZoom:1,defaultCenter:g,onOverlayUpdated:u,onMarkerClicked:l,activeOverlay:c,markers:i,fullscreenControl:!1,markerClusterer:!0,markerClustererOptions:y,drawingModes:h,isSearchOnMapMove:p,onMapBoundsChanged:d,isSearchEnabled:s,mapContainerClassName:e.fullHeight,mapKey:a}))):null},BG=(0,Eb.T)(jE.T),zG=e=>{switch(e){case H.PROFILE:return L().text("Hide entity details");case H.MAP:return L().text("Hide map")}},HG=()=>{const e=Vj(),t=(0,xE.useDispatch)(),r=(0,xE.useSelector)(xu),n=r===H.MAP,a=(0,xE.useSelector)(Cr().selectors.getGoogleMapKey),i=(0,b.useCallback)((()=>t(jp(null))),[t]);return(0,b.useEffect)((()=>{!a&&n&&i()}),[a,n,i]),v().createElement("div",{className:e.container},v().createElement(BG,{tooltipTitle:zG(r),tooltipPlacement:"bottom-start",size:"L",icon:Mj(),className:e.closeButton,onClick:i}),(e=>{switch(e){case H.PROFILE:return v().createElement(WW,null);case H.MAP:return v().createElement(VG,null)}})(r))},YG=e=>{let{className:t,loading:r,entities:n,entityTypeTab:a,quantity:i,rowsPerPage:o,page:l,entityToHighlight:s,selectedEntityUri:c,mode:u,previewPanelMode:p,isPreviewPanelOpen:d,dispatch:m}=e;const y=ZC(),f=(0,b.useRef)(),[g,h]=(0,b.useState)("50%"),E=Kc(u),T=p===H.PROFILE,S=p===H.MAP,[C,w]=(0,b.useState)({}),A=(0,b.useCallback)(((e,t)=>{w((0,_.assoc)(e,t))}),[]);(0,b.useEffect)((()=>{f.current&&(f.current.scrollTop=0)}),[n]),(0,b.useEffect)((()=>{T&&((0,x.isEmptyValue)(n)?m(mg(null)):!(0,_.prop)(0,n)||c&&n.map((0,_.prop)("uri")).includes(c)||m(mg(n[0].uri)))}),[m,T,c,n]),(0,b.useEffect)((()=>{!T&&c&&m(yg(null))}),[m,c,T]);const R=(0,b.useCallback)((e=>m(function(e){return{type:kr,payload:{pageNumber:e,debounceTime:arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,entityTypeUri:arguments.length>2?arguments[2]:void 0}}}(e,250,a))),[m,a]),N=(0,b.useCallback)((e=>m(((e,t)=>({type:Fr,payload:{number:e,entityTypeUri:t}}))(e,a))),[m,a]),I=(0,b.useCallback)((e=>m(mg(e))),[m]),D=(0,b.useCallback)((0,x.debounce)((e=>m({type:Yn,payload:e})),50),[m]),P=(0,b.useCallback)((e=>{let{percentageSize:t}=e;return h(t)}),[]),k=e=>{const t=(0,_.prop)(e.uri,C);return v().createElement(Lv,{entity:e,entityImportStatus:t,onEntityImportStatusChange:A})},F=(0,b.useRef)(null);return v().createElement("div",{className:O()(y.container,t)},r&&v().createElement(GC.Z,null),Kc(u)?v().createElement(Pj,{quantity:i}):v().createElement(Oj,null),v().createElement(AC,{className:y.resizablePanesWrapper,orientation:"vertical",size:d?g:"100%",minSize:480,maxSize:-480,allowResize:d,onChange:P},v().createElement("div",{className:y.pane},v().createElement(qC,{error:v().createElement(WC,{LogoRenderer:YC.ERROR,text:L().text("Something went wrong."),variant:HC.embedded})},(()=>{const e=s||null;return i?v().createElement("div",{className:E?y.tableContainer:y.listContainer,ref:f},E?v().createElement(jj,{entities:n,entityToHighlight:e,selectedEntityUri:c,entityTypeUri:a,onEntityClick:T?I:void 0,onEntityHover:S?D:void 0,entitiesImportStatus:C,onEntityImportStatusChange:A,basicTableRef:F}):v().createElement(LC,{entities:n,entityToHighlight:e,selectedEntityUri:c,onEntityClick:T?I:void 0,onEntityHover:S?D:void 0,entitiesImportStatus:C,entityButtonsRenderer:k}),i>j[0]&&v().createElement("div",{className:y.pagination},v().createElement(FC.Z,{count:i,rowsPerPageOptions:j,rowsPerPage:o||j[0],page:l||0,onChangePage:R,onChangeRowsPerPage:N,basicTableRef:F}))):v().createElement(WC,{LogoRenderer:YC.SEARCH_RESULTS,text:L().text("No results found."),secondaryText:L().text("Try adjusting your search or filter to find what you're looking for."),variant:HC.embedded})})())),v().createElement("div",{className:y.pane},v().createElement(HG,null))))};YG.propTypes={page:OE().number,quantity:OE().number,rowsPerPage:OE().number,entities:OE().array,loading:OE().bool,dispatch:OE().func,entityToHighlight:OE().string,mode:OE().string,entityTypeTab:OE().string,className:OE().string,isPreviewPanelOpen:OE().bool,previewPanelMode:OE().oneOf(Object.values(H)),selectedEntityUri:OE().string},YG.defaultProps={quantity:0,entities:[]};const WG=(0,xE.connect)((e=>{const t=Cu(e);return{quantity:Ju(e,{entityTypeUri:t}),page:ep(e,{entityTypeUri:t}),rowsPerPage:tp(e,{entityTypeUri:t}),entities:ap(e,{entityTypeUri:t}),loading:ip(e),entityToHighlight:hu(e),mode:bu(e),entityTypeTab:t,previewPanelMode:xu(e),isPreviewPanelOpen:Su(e),selectedEntityUri:ug(e)}}))(YG);var GG=r(4539),qG=r.n(GG),ZG=r(4494);const $G=(0,AE.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"}}),KG=e=>{const t=$G(),r=e.values&&e.values.join(", ");return v().createElement(ax(),{label:v().createElement("div",{className:t.labelContainer},e.title&&v().createElement("div",{className:t.title},e.title,": "),e.values&&v().createElement(hb.Y,{value:r},v().createElement("div",{className:t.values},r))),onDelete:e.onDelete,variant:"outlined",deleteIcon:v().createElement(ox(),{"data-reltio-id":"facet-bar-chip-delete"}),classes:{root:t.root,deleteIcon:t.deleteIcon,label:t.label}})};KG.propTypes={classes:OE().object,title:OE().string,values:OE().array,onDelete:OE().func};const QG=KG;class XG extends b.PureComponent{constructor(){super(...arguments),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 v().createElement(b.Fragment,null,v().createElement(yC(),{"aria-describedby":a,color:"primary",variant:"contained",classes:{root:e.root,label:e.label},onClick:this.handleClick},L().text(`+ ${t.length}`)),v().createElement(vU.Z,{id:a,open:n,onClose:this.handleClose,anchorEl:r,placement:"bottom-start"},v().createElement(Zj(),{elevation:2,classes:{root:e.popperContent}},this.props.items)))}}XG.propTypes={classes:OE().object,items:OE().array},XG.defaultProps={items:[]};const JG=fS()((()=>({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"}})))(XG);var eq=r(74635),tq=r.n(eq),rq=r(42670),nq=r(96177),aq=r.n(nq),iq=r(96858);const oq=(0,AE.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 lq(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){sq(e,t,r[t])}))}return e}function sq(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function cq(){return cq=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},cq.apply(this,arguments)}const uq=e=>{let{isOpen:t,isAvailableUpdate:r,isChangedSavedSearch:n,currentSavedSearch:a,onClose:i,onSave:o,onUpdate:l}=e;const s=oq(),[c,u]=(0,b.useState)(""),[p,d]=(0,b.useState)(K),m=r&&a&&c===a.name,y=m&&a.isPublic===(p===$)&&!n,f=(0,b.useCallback)((e=>{u(e.target.value)}),[]),g=(0,b.useCallback)((e=>{d(e)}),[]),h=(0,b.useCallback)((()=>m?l({share:p}):o({name:c,share:p})),[c,o,l,p,m]),E={InputProps:{classes:{input:O()(s.dialogInput,s.dialogFont)}},InputLabelProps:{classes:{root:s.dialogFont}}};return(0,b.useEffect)((()=>{if(t){const e=r?a.name:"",t=r&&a.isPublic?$:K;u(e),d(t)}}),[t,r,a]),v().createElement(TY(),{onClose:i,open:t,PaperProps:{classes:{root:s.dialogRoot}}},v().createElement(tq(),{classes:{root:s.dialogTitle}},L().text("Save search")),v().createElement(aW(),{classes:{root:s.dialogContentRoot}},v().createElement(rq.H,cq({classes:{root:s.dialogField},label:L().text("Name"),required:!0,variant:"filled",value:c,onInput:f,size:"small",autoFocus:!0},E)),v().createElement(iq.k,{entries:ee,TextFieldProps:lq({classes:{root:s.dialogField},required:!0,label:L().text("Share with"),variant:"filled",size:"small"},E),value:p,onChange:g})),v().createElement(aq(),{classes:{root:s.dialogActions},disableSpacing:!0},v().createElement(yC(),{onClick:i},L().text("Cancel")),v().createElement(yC(),{color:"primary",onClick:h,disabled:m?y:0===c.length},m?L().text("Save"):L().text("Save as"))))};uq.propTypes={isOpen:OE().bool,isAvailableUpdate:OE().bool,isChangedSavedSearch:OE().bool,currentSavedSearch:OE().object,onClose:OE().func.isRequired,onSave:OE().func.isRequired,onUpdate:OE().func.isRequired};const pq=(0,xE.connect)((e=>{const t=qd(e);return{isOpen:(r=e,r.explorer.ui.showSaveSearchDialog),isAvailableUpdate:!(0,_.isNil)(t)&&$d(e),isChangedSavedSearch:Zd(e),currentSavedSearch:t};var r}),{onClose:()=>Rp(!1),onSave:e=>({type:Ui,payload:e}),onUpdate:e=>({type:Bi,payload:e})})(uq);function dq(){return dq=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dq.apply(this,arguments)}const mq=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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",dq({xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},r),v().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"}))},yq=(0,AE.Z)({button:{marginRight:"-4px"},dialogRoot:{minWidth:"600px",minHeight:"280px"},dialogContentRoot:{display:"flex",flexDirection:"column",gap:"20px"}}),fq=()=>{const e=yq(),[t,r]=(0,b.useState)(!1),[n,a]=(0,b.useState)(""),[i,o]=(0,b.useState)(""),[l,s]=(0,b.useState)(K),c=(0,b.useCallback)((e=>{a(e.target.value)}),[]),u=(0,b.useCallback)((e=>{o(e.target.value)}),[]),p=(0,b.useCallback)((e=>{s(e)}),[]),d=()=>{r(!1),a(""),o(""),s(K)};return v().createElement(v().Fragment,null,v().createElement(_b.k,{icon:mq,size:"L",onClick:()=>r(!0),tooltipTitle:L().text("Save as segment"),className:e.button,"data-reltio-id":"reltio-search-actions-menu-segmentation"}),v().createElement(TY(),{onClose:d,open:t,PaperProps:{classes:{root:e.dialogRoot}}},v().createElement(tq(),null,L().text("Save segment")),v().createElement(aW(),{className:e.dialogContentRoot},v().createElement(rq.H,{label:L().text("Name"),required:!0,variant:"filled",onInput:c,value:n,size:"small",autoFocus:!0}),v().createElement(rq.H,{label:L().text("Description (optional)"),multiline:!0,variant:"filled",value:i,onInput:u,size:"small",rows:5}),v().createElement(iq.k,{entries:ee,TextFieldProps:{required:!0,label:L().text("Share with"),variant:"filled",size:"small"},value:l,onChange:p})),v().createElement(aq(),null,v().createElement(yC(),{onClick:d},L().text("Cancel")),v().createElement(yC(),{color:"primary",onClick:()=>{},disabled:!1},L().text("Save")))))};function gq(){return gq=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gq.apply(this,arguments)}const hq=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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",gq({xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},r),v().createElement("g",null,v().createElement("path",{fill:"none",d:"M0 0h24v24H0z"})),v().createElement("g",null,v().createElement("path",{fillOpacity:".54",d:"M5 20h14v-2H5v2zM19 9h-4V3H9v6H5l7 7 7-7z"})))};function Eq(){return Eq=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Eq.apply(this,arguments)}const bq=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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",Eq({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),v().createElement("defs",null,v().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"})),v().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},v().createElement("mask",{id:"svg1966704254b",fill:"#fff"},v().createElement("use",{xlinkHref:"#svg1966704254a"})),v().createElement("g",{mask:"url(#svg1966704254b)",fill:"#000",fillOpacity:".54"},v().createElement("path",{d:"M0 0h24v24H0z"}))))};function vq(){return vq=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vq.apply(this,arguments)}const Tq=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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",vq({xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},r),v().createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),v().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 Oq(){return Oq=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Oq.apply(this,arguments)}const xq=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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",Oq({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),v().createElement("defs",null,v().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"})),v().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},v().createElement("mask",{id:"svg2486556319b",fill:"#fff"},v().createElement("use",{xlinkHref:"#svg2486556319a"})),v().createElement("g",{mask:"url(#svg2486556319b)",fill:"#000",fillOpacity:".54"},v().createElement("path",{d:"M0 0h12v24H0z"}))))};var Sq=r(69199),Cq=r.n(Sq),wq=r(37290),Aq=r.n(wq);const Rq=e=>navigator.clipboard?navigator.clipboard.writeText(e):(e=>new Promise(((t,r)=>{const n=document.createElement("textarea");n.value=e,n.style.top="0",n.style.left="0",n.style.position="fixed",document.body.appendChild(n),n.focus(),n.select();try{document.execCommand("copy"),t()}catch(e){r(e)}document.body.removeChild(n)})))(e);function _q(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Nq(e,t,r[t])}))}return e}function Nq(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Iq=(0,AE.Z)({title:{marginBottom:"-10px"},linkField:{margin:"10px 0"},linkInput:{textOverflow:"ellipsis",fontSize:"14px"}}),Dq=e=>{let{open:t,onClose:r=SE.ZT}=e;const n=Iq(),a=(e=>{let{enabled:t}=e;const[r,n]=(0,b.useState)(""),a=(0,xE.useSelector)(Pm),i=(0,xE.useSelector)(lp),o=(0,xE.useSelector)(Cr().selectors.getServicesPath),l=(0,xE.useSelector)(Cr().selectors.getUIPath);return(0,b.useEffect)((()=>{t?(0,x.rawRequest)(`${o}/searchLink`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(_q({},a,{currentTenant:i}))}).then((0,_.pipe)((0,_.prop)("link"),(0,x.getSearchLink)(l),n)).catch(Tp):n("")}),[t]),r})({enabled:t});return v().createElement(TY(),{open:t,onClose:r},v().createElement(tq(),{className:n.title},L().text("Share link with search results")),v().createElement(aW(),null,v().createElement(Cq(),null,L().text("With the URL link, anyone can view these search results. Paste this link in email or IM for testing, analyze, sharing and more.")),v().createElement(Aq(),{className:n.linkField,InputProps:{classes:{input:n.linkInput}},label:a?"URL":"",placeholder:L().text("Loading URL..."),value:a,variant:"filled",fullWidth:!0,size:"small"})),v().createElement(aq(),null,v().createElement(yC(),{onClick:r},L().text("Cancel")),v().createElement(yC(),{disabled:!a,onClick:(0,_.pipe)((()=>Rq(a)),r),color:"primary",autoFocus:!0},L().text("Copy link"))))};Dq.propTypes={open:OE().bool,onClose:OE().func};const Pq=Dq,kq=(0,AE.Z)((()=>({button:{marginRight:"-4px"},exportButtonDisabled:{opacity:"0.54"}}))),Lq=e=>{let{customActions:t=[]}=e;const r=kq(),n=(0,xE.useDispatch)(),a=(0,xE.useSelector)(Cr().selectors.getUIConfig),i=(0,xE.useSelector)(Cr().selectors.getCanUserMakeExport),o=(0,xE.useSelector)(Cr().selectors.getCanUserOpenDataLoader),l=!!(0,x.findPerspectiveConfig)(x.ScreenType.Segmentation,a),s=!!(0,xE.useSelector)(cp),{canExport:c}=(0,xE.useSelector)(Ru),u=c&&i,p=(0,b.useCallback)((()=>{n({type:Br})}),[n]),d=(0,b.useCallback)((()=>{n({type:zr})}),[n]),m=(0,xE.useSelector)(up),y=(0,b.useCallback)((()=>{n(Rp(!0))}),[n]),f=[],[g]=(()=>{const e=(0,xE.useSelector)(Cr().selectors.getCanUserStartProcessFromQuery),t=(0,xE.useSelector)(Cr().selectors.getWorkflowPath),r=(0,xE.useSelector)(Cr().selectors.getWorkflowEnvironmentUrl),n=(0,xE.useSelector)(Nu),a=(0,xE.useSelector)(Cr().selectors.getTenant),i=(0,xE.useDispatch)(),o=(0,xE.useSelector)(dp),{globalFilter:l}=(0,xE.useSelector)(Cr().selectors.getGlobalSearchRequestOptions),s=Ye(o,[],l),c=(0,b.useCallback)((()=>{const{processType:e}=n;(0,x.startProcessFromQuery)({workflowPath:t,processType:e,searchString:s,tenant:a,environment:r}).then((()=>{i(Fp({message:L().text("Match reviews successfully submitted. Go to Inbox to view their status."),actionToDispatch:Sr.ui.actions.openAppFromChocolateBar("Inbox"),actionLabel:L().text("Go to inbox"),autoHideDuration:null}))})).catch((e=>{Tp(e)}))}),[n,t,s,a,r,i]),u=s.includes("matches")||s.includes("matchRules");return[e&&t&&n?{disabled:!u,text:L().text("Request Match Review"),tooltip:L().text("Filter on match rules or potential matches to enable Potential Match Review"),onClick:c,id:"-request-match-review"}:null]})();g&&f.push(g);const[h]=(()=>{const e={NO_ENTITY_TYPE:L().text("Please select exactly one entity type or switch to table mode")},t=(0,xE.useDispatch)(),r=(0,xE.useSelector)(Ru),n=(0,xE.useSelector)(Cr().selectors.getCanUserMakeBulkUpdate),a=!!(0,xE.useSelector)(cp),i=(0,xE.useSelector)(ih),o=!!i,l=Boolean(null==r?void 0:r.bulkUpdate),s=(0,xE.useSelector)(Cr().selectors.getMetadata),c=(0,xE.useSelector)(ku),u=l&&n&&!a?{disabled:!o||!(e=>fc(s,{},c).some((t=>t.value===e)))(i),text:L().text("Bulk update"),tooltip:o?null:e.NO_ENTITY_TYPE,onClick:()=>t(Up(!0)),id:"-bulk-update"}:null;return[u]})();h&&f.push(h);const[E,T]=(0,b.useState)(!1);return f.push({text:L().text("Share link"),onClick:()=>T(!0),id:"-share-link"}),f.push(...t),v().createElement(v().Fragment,null,o&&v().createElement(_b.k,{icon:Tq,size:"L",onClick:d,tooltipTitle:L().text("Load data"),className:r.button,"data-reltio-id":"reltio-search-actions-menu-load-data"}),u&&v().createElement(_b.k,{icon:hq,size:"L",onClick:p,tooltipTitle:L().text("Export"),showForDisabled:!0,classes:{disabled:r.exportButtonDisabled},className:r.button,disabled:s,"data-reltio-id":"reltio-search-actions-menu-export"}),v().createElement(_b.k,{tooltipTitle:L().text("Save"),showForDisabled:!0,className:O()({[r.button]:f.length>0}),disabled:!m,onClick:y,icon:bq,size:"L","data-reltio-id":"reltio-search-actions-menu-save"}),l&&v().createElement(fq,null),f.length>0&&v().createElement(IU,{buttonComponent:jE.T,buttonProps:{icon:xq,size:"L","data-reltio-id":"reltio-search-actions-menu"},menuId:"custom-actions",menuItems:f}),v().createElement(pq,null),v().createElement(Pq,{open:E,onClose:()=>T(!1)}))},Fq="#FF1744",jq=(0,AE.Z)({indicatorWrapper:{width:0,height:"20px",position:"relative"},indicatorTooltipArea:{width:"10px",height:"20px"},indicator:{width:"3px",height:"3px",backgroundColor:Fq,border:"1px solid",borderColor:Fq,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"}}),Uq=()=>{const e=(0,xE.useSelector)(qd),t=(0,xE.useSelector)(Zd),r=jq();if(!e)return null;const n=e.name;return v().createElement(v().Fragment,null,v().createElement("div",{className:r.wrapper},v().createElement(DT(),{variant:"body2",component:"span",classes:{root:r.for}},L().text("for")),v().createElement(hb.Y,{value:n},v().createElement(DT(),{variant:"body2",classes:{root:r.label}},n))),t&&v().createElement(KO(),{title:L().text("Saved search has changed"),placement:"bottom"},v().createElement("div",{className:r.indicatorWrapper},v().createElement("div",{className:r.indicator}),v().createElement("div",{className:r.indicatorTooltipArea}))))},Mq=(0,AE.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}}),Vq=()=>{const e=Mq(),t=(0,xE.useSelector)(Cr().selectors.getDataTenants),r=t&&t.length>0,n=(0,xE.useSelector)(sp),a=(0,xE.useSelector)(Cr().selectors.getTenantName),i=n?n.label:a;return r&&v().createElement("div",{className:e.wrapper},v().createElement(DT(),{variant:"body2",component:"span",classes:{root:e.in}},L().text("in")),v().createElement(hb.Y,{value:a},v().createElement(DT(),{variant:"body2",classes:{root:e.label}},i)))};var Bq=r(81877),zq=r.n(Bq);const Hq=(0,AE.Z)({dialogPaper:{height:"70vh"},contentRoot:{padding:0,display:"flex",flexDirection:"column",overflow:"hidden"},tabContent:{display:"flex",flex:"1 1 auto"},tabsWrapper:{padding:"0 24px"}}),Yq=(0,AE.Z)((e=>({container:{display:"flex",alignItems:"center",paddingTop:17,paddingBottom:11,paddingLeft:15,paddingRight:15},selected:{backgroundColor:(0,Mv.alpha)(e.palette.primary.main,.12)}}))),Wq=(0,AE.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}}),Gq=(0,AE.Z)({closeButton:{marginRight:"10px"}}),qq=e=>{let{onClose:t}=e;const r=Gq();return v().createElement(jE.T,{size:"L",icon:kE(),className:r.closeButton,onClick:t})};qq.propTypes={onClose:OE().func};const Zq=qq,$q=e=>{let{selectedNumber:t,onDelete:r,onClose:n}=e;const a=Wq();return v().createElement(v().Fragment,null,v().createElement("div",{className:O()(a.title,a.flex1)},v().createElement(Zq,{onClose:n}),v().createElement(DT(),{color:"primary"},L().text("Selected: ${count}",{count:t}))),v().createElement(_b.k,{tooltipTitle:L().text("Delete"),size:"L",icon:UB(),className:a.deleteButton,onClick:r}))};$q.propTypes={selectedNumber:OE().number,onClose:OE().func,onDelete:OE().func};const Kq=$q;function Qq(){return Qq=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Qq.apply(this,arguments)}function Xq(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){Jq(e,t,r[t])}))}return e}function Jq(e,t,r){return 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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["classes"]);const n=UE({});return v().createElement(zE,Qq({classes:Xq({},t,{focused:n.white})},r))};var tZ=r(34480),rZ=r.n(tZ);const nZ=(0,AE.Z)((e=>({changedFiltersIndicator:{backgroundColor:(0,Mv.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?$:K,iZ=e=>e===$,oZ=e=>{let{className:t,findPublic:r,favoriteOnly:n,onChangeFilters:a}=e;const i=nZ(),o=(0,b.useRef)(),[l,s]=(0,b.useState)(!1),[c,u]=(0,b.useState)(r),[p,d]=(0,b.useState)(n);(0,b.useEffect)((()=>{u(r),d(n)}),[r,n]);const m=(0,b.useCallback)((()=>s((e=>!e))),[]),y=(0,b.useCallback)((e=>d(e.target.checked)),[]),f=(0,b.useCallback)((()=>{a({findPublic:c,favoriteOnly:p}),m()}),[m,a,c,p]),g=(0,b.useCallback)((()=>{u(r),d(n),m()}),[m,r,n]),h=(0,b.useCallback)((()=>{u(!0),d(!1)}),[]),E=!0===c&&!1===p;return v().createElement(v().Fragment,null,v().createElement(yC(),{ref:o,color:E?"inherit":"primary",classes:{root:t,textPrimary:i.changedFiltersIndicator},onClick:m},v().createElement(rZ(),null)),v().createElement(wE(),{open:l,classes:{paper:i.popupContent},anchorEl:o.current,onClose:g,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},v().createElement(DT(),{className:i.title,variant:"h6"},L().text("Filter")),v().createElement(iq.k,{entries:ee,TextFieldProps:{InputLabelProps:{classes:{root:i.shareWithLabel}},label:L().text("Shared with"),variant:"filled"},classes:{root:i.shareWithRoot,menuItem:i.shareWithMenuItem},fullWidth:!0,value:aZ(c),onChange:(0,_.pipe)(iZ,u)}),v().createElement(HS(),{classes:{root:i.favoriteOnlyControlRoot,label:i.favoriteOnlyControlLabel},control:v().createElement(rb(),{className:i.favoriteOnlyCheckbox,checked:p,onChange:y}),label:L().text("Show favorites only")}),v().createElement("div",{className:i.buttonsGroup},v().createElement(yC(),{onClick:h,disabled:E},L().text("Clear all")),v().createElement("div",null,v().createElement(yC(),{onClick:g,className:i.cancelButton},L().text("Cancel")),v().createElement(yC(),{onClick:f,color:"primary"},L().text("Apply"))))))};oZ.propTypes={className:OE().string,findPublic:OE().bool,favoriteOnly:OE().bool,onChangeFilters:OE().func,onChangeFavoriteOnly:OE().func};const lZ=(0,xE.connect)((e=>({findPublic:Md(e),favoriteOnly:jd(e)})),{onChangeFilters:e=>{let{findPublic:t,favoriteOnly:r}=e;return{type:Zi,payload:{findPublic:t,favoriteOnly:r}}}})(oZ),sZ=e=>{let{type:t,onSearch:r,placeholder:n,onClose:a}=e;const i=Wq();return v().createElement(v().Fragment,null,v().createElement("div",{className:i.main},v().createElement("div",{className:i.title},v().createElement(Zq,{onClose:a}),v().createElement(DT(),{variant:"h6"},L().text("Saved & recent searches"))),v().createElement("div",{className:i.searchBox},v().createElement(eZ,{fullWidth:!0,onSearch:r,placeholder:n}))),t===Z.saved&&v().createElement(lZ,{className:i.filterButton}))};sZ.propTypes={type:OE().oneOf(Object.values(Z)),onClose:OE().func,onSearch:OE().func,placeholder:OE().string};const cZ=sZ,uZ=e=>{let{type:t,selectedNumber:r,onClose:n,dispatch:a}=e;const i=Yq(),o=(0,b.useCallback)((()=>{a(t===Z.saved?{type:oo}:{type:xo})}),[t,a]),l=(0,b.useCallback)((0,x.debounce)((e=>{const r=t===Z.saved?{type:uo,payload:e}:{type:Ao,payload:e};a(r)}),500),[t,a]),s=(0,_.cond)([[(0,_.equals)(Z.saved),(0,_.always)(L().text("Search name"))],[(0,_.equals)(Z.recent),(0,_.always)(L().text("Search for filtered entity types and attributes"))]])(t);return v().createElement(tq(),{className:O()(i.container,{[i.selected]:r})},r?v().createElement(Kq,{selectedNumber:r,onDelete:o,onClose:n}):v().createElement(cZ,{type:t,onSearch:l,onClose:n,placeholder:s}))};uZ.propTypes={type:OE().oneOf(Object.values(Z)).isRequired,selectedNumber:OE().number,onClose:OE().func,dispatch:OE().func};const pZ=(0,xE.connect)(((e,t)=>({selectedNumber:t.type===Z.saved?Hd(e):zf(e)})))(uZ),dZ="0.75rem",mZ=(0,AE.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:dZ},paginationCaption:{fontSize:dZ}}),yZ=(0,AE.Z)({paper:{minHeight:"180px"},title:{padding:"16px 16px 10px 16px",fontSize:"20px",fontWeight:500,letterSpacing:"0.25px",lineHeight:"24px"},content:{padding:"0 16px"},contentText:{marginBottom:0,fontSize:"16px",letterSpacing:"0.15px",lineHeight:"24px"},actionButtons:{display:"flex",paddingTop:"4px",fontSize:"14px",fontWeight:500,letterSpacing:0,lineHeight:"16px","& > div":{marginLeft:"auto"}},discardButton:{marginRight:"8px"}}),fZ=e=>{let{open:t,title:r,content:n,onCancel:a,cancelCaption:i=L().text("Cancel"),onDiscard:o,discardCaption:l="",onSave:s,saveCaption:c=L().text("Save"),disabledSave:u=!1}=e;const p=yZ();return v().createElement(TY(),{open:t,onClose:a,classes:{paperScrollPaper:p.paper}},v().createElement(tq(),{classes:{root:p.title}},r),v().createElement(aW(),{classes:{root:p.content}},v().createElement(Cq(),{classes:{root:p.contentText}},n)),v().createElement(aq(),{className:p.actionButtons,disableSpacing:!0},a&&v().createElement(yC(),{onClick:a},i),v().createElement("div",null,o&&v().createElement(yC(),{onClick:o,classes:{root:p.discardButton}},l),v().createElement(yC(),{onClick:s,color:"primary",disabled:u,autoFocus:!0},c))))},gZ="0.8rem",hZ=(0,AE.Z)((e=>{const t=(0,Mv.lighten)(e.palette.primary.main,.88),r=(0,Mv.alpha)(t,0),n=(0,Mv.lighten)(e.palette.primary.main,.82),a={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","div.hoveredRow &":{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%)`},"div.hoveredRow $checkedRowCell &":{background:`linear-gradient(to right, ${(0,Mv.alpha)(n,0)}, ${n} 100%)`}};return{defaultWrapper:{whiteSpace:"nowrap",overflow:"hidden",padding:"0 22px",fontSize:gZ,display:"flex",alignItems:"center",height:"100%","&:after":a},numberWrapper:{whiteSpace:"nowrap",overflow:"hidden",padding:"0 24px 0 22px",fontSize:gZ,justifyContent:"flex-end",display:"flex",alignItems:"center",height:"100%"},nameWithStar:{display:"flex",alignItems:"center",height:"100%",paddingLeft:"6px","& $editNameButton":{display:"none"},"div.hoveredRow & $editNameButton":{display:"flex"}},leftButtonWrapper:{},deleteButton:{visibility:"hidden",marginRight:"2px"},totalWithButtonsWrapper:{justifyContent:"flex-end",display:"flex",alignItems:"center",height:"100%","& $numberWrapper":{paddingRight:"8px"},"div.hoveredRow & $deleteButton":{visibility:"visible"}},nameTextEditorRoot:{margin:0},nameInput:{fontSize:gZ,"&::-ms-clear":{display:"none"}},nameContainer:{flex:1,overflow:"hidden"},editing:{},editNameButton:{},searchName:{cursor:"pointer",lineHeight:"29px",position:"relative",whiteSpace:"nowrap",overflow:"hidden",fontSize:gZ,"&:after":a},clickableArea:{cursor:"pointer"},starButton:{marginLeft:"-7px",marginRight:"3px",visibility:"hidden","div.hoveredRow &$enabledButton":{visibility:"visible"}},checkedStarButton:{visibility:"visible",color:"#F5A623 !important"},filterButton:{"$editing &":{marginRight:"2px"},marginLeft:"-7px",marginRight:"10px",visibility:"hidden","div.hoveredRow &$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:"22px",display:"flex",alignItems:"center",height:"100%"},sharingRoot:{flexShrink:1,maxWidth:"100%"},sharingInput:{fontSize:gZ},sharingMenuItem:{fontSize:gZ,minWidth:"100px"},sharingDisabled:{color:"rgba(0,0,0,0.89)",paddingRight:"0 !important"},sharingIconDisabled:{display:"none"},rowCell:{height:"100%"},checkedRowCell:{backgroundColor:t,"div.hoveredRow &":{backgroundColor:n}},invisibleOnHoverCommon:{height:"100%","&$invisibleOnHover":{pointerEvents:"none","div.hoveredRow &":{color:"transparent"}}},invisibleOnHover:{},tooltip:e.tooltip,tooltipSection:{marginBottom:"5px"},tooltipSectionHeader:{margin:"5px 0",fontSize:"11px",fontWeight:500},tooltipText:{opacity:.7,fontSize:"10px"}}})),EZ=e=>{let{mode:t}=e;const r=hZ(),n=(0,xE.useDispatch)(),a=t===Z.saved?Yd:Hf,i=(0,xE.useSelector)(a),o=t===Z.saved?Wd:Yf,l=(0,xE.useSelector)(o),s=(0,b.useCallback)((()=>{n(t===Z.saved?l?Td():{type:Ki}:l?Df():{type:To})}),[n,l,t]);return v().createElement("div",{className:O()(r.headCell,r.checkbox)},v().createElement(rb(),{indeterminate:!i&&l,checked:i,onChange:s}))};EZ.propTypes={mode:OE().string};const bZ=(0,Yb.q)((0,_.pick)(["mode"]))(EZ),vZ=e=>{const t=t=>{const r=hZ(),{rowValue:{checked:n}}=t;return v().createElement("div",{className:O()(r.rowCell,{[r.checkedRowCell]:n})},v().createElement(e,t))};return t.propTypes={rowValue:OE().shape({checked:OE().bool})},t},TZ=(0,Eb.T)(rb()),OZ=e=>{let{value:t=!1,rowValue:{uri:r,isOwnSearch:n},onClick:a}=e;const i=hZ(),o=!n;return v().createElement("div",{className:O()(i.headCell,i.checkbox)},v().createElement(TZ,{showForDisabled:!0,tooltipTitle:o&&L().text("Cannot edit because you're not the owner"),tooltipPlacement:"bottom-start",disabled:o,checked:t,onChange:e=>a(r,e.target.checked)}))};OZ.propTypes={value:OE().bool,rowValue:OE().shape({uri:OE().string,isOwnSearch:OE().bool}),onClick:OE().func};const xZ=(0,Yb.q)((e=>{let{onSelectItem:t}=e;return{onClick:t}}))(vZ(OZ));var SZ=r(92332);function CZ(){return CZ=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},CZ.apply(this,arguments)}function wZ(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){AZ(e,t,r[t])}))}return e}function AZ(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const RZ=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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className"]);const n=hZ(),{headCellData:a}=r;return v().createElement("div",{className:O()(n.headCell,t)},v().createElement(SZ.default,CZ({},r,{headCellData:wZ({},a,{label:v().createElement(hb.Y,{value:a.label},v().createElement("div",{className:n.headLabel},a.label))})})))};RZ.propTypes={className:OE().string,headCellData:OE().shape({id:OE().string,label:OE().oneOfType([OE().string,OE().node]),sortable:OE().bool,resizable:OE().bool,className:OE().string,initialWidth:OE().number,minWidth:OE().number,autoResize:OE().bool,renderer:OE().func})};const _Z=RZ;function NZ(){return NZ=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},NZ.apply(this,arguments)}const IZ=e=>{const t=hZ();return v().createElement(_Z,NZ({className:t.nameHeadCell},e))};IZ.propTypes={headCellData:OE().shape({id:OE().string,label:OE().oneOfType([OE().string,OE().node]),sortable:OE().bool,resizable:OE().bool,className:OE().string,initialWidth:OE().number,minWidth:OE().number,autoResize:OE().bool,renderer:OE().func})};const DZ=IZ;var PZ=r(18122),kZ=r.n(PZ),LZ=r(62839),FZ=r.n(LZ);function jZ(){return jZ=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},jZ.apply(this,arguments)}const UZ=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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",jZ({xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},r),v().createElement("g",null,v().createElement("path",{d:"M0 0h24m0 24H0",fill:"none"}),v().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"}),v().createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"})))};function MZ(){return MZ=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},MZ.apply(this,arguments)}const VZ=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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",MZ({xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},r),v().createElement("g",null,v().createElement("path",{d:"M0 0h24m0 24H0",fill:"none"}),v().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"}),v().createElement("path",{d:"M0 0h24v24H0V0z",fill:"none"})))};var BZ=r(74492),zZ=r.n(BZ),HZ=r(72246),YZ=r.n(HZ);const WZ=e=>{let{value:t,rowValue:{uri:r,isFavorite:n,isOwnSearch:a,isEditing:i,isGlobalFilter:o},onStarClick:l,onGlobalClick:s,onApply:c,onChangeName:u,onSetEditing:p}=e;const d=hZ(),m=a&&!i,[y,f]=(0,b.useState)(t);(0,b.useEffect)((()=>{f(t)}),[t]);const g=(0,b.useCallback)((()=>{u(r,y)}),[r,y,u]),h=(0,b.useCallback)((()=>l(r,!n)),[l,r,n]),E=(0,b.useCallback)((()=>s(r,!o)),[s,r,o]),T=(0,b.useCallback)((()=>p(r,!0)),[p,r]),x=(0,b.useCallback)((()=>c(r)),[c,r]),S=(0,_.cond)([[(0,_.always)(a),(0,_.always)(L().text("Mark as favorite"))],[(0,_.always)(n),(0,_.always)(L().text("Cannot ummark because you're not the owner"))],[_.T,(0,_.always)("")]])();return v().createElement("div",{className:O()(d.nameWithStar,{[d.editing]:i})},v().createElement(_b.k,{showForDisabled:!0,tooltipTitle:S,tooltipPlacement:a?"bottom":"bottom-start",disabled:!a,className:O()(d.starButton,{[d.checkedStarButton]:n},{[d.enabledButton]:a}),size:"M",icon:n?kZ():FZ(),onClick:h}),v().createElement(_b.k,{tooltipTitle:o?L().text("Remove Global filter"):L().text("Set as Global filter"),className:O()(d.filterButton,d.enabledButton,{[d.checkedFilterButton]:o}),size:"M",icon:o?UZ:VZ,onClick:E}),v().createElement("div",{className:d.nameContainer},i?v().createElement(YZ(),{onClickAway:g},v().createElement("div",null,v().createElement(rq.H,{variant:"filled",hiddenLabel:!0,size:"small",fullWidth:!0,autoFocus:!0,classes:{root:d.nameTextEditorRoot},InputProps:{classes:{input:d.nameInput}},value:y,onInput:e=>f(e.target.value),onKeyDown:(0,_.when)((0,_.propEq)("keyCode",13),g)}))):v().createElement(hb.Y,{value:t},v().createElement("div",{className:d.searchName,onClick:x},t))),m&&v().createElement(_b.k,{tooltipTitle:L().text("Edit"),className:d.editNameButton,size:"M",icon:zZ(),onClick:T}))};WZ.propTypes={value:OE().string,rowValue:OE().shape({uri:OE().string,isFavorite:OE().bool,isOwnSearch:OE().bool,isEditing:OE().bool,isGlobalFilter:OE().bool}),onStarClick:OE().func,onGlobalClick:OE().func,onApply:OE().func,onChangeName:OE().func,onSetEditing:OE().func};const GZ=(0,Yb.q)((e=>{let{onChangeIsFavorite:t,onChangeIsGlobal:r,onSearchApply:n,onSetItemEditing:a,onChangeItemName:i}=e;return{onStarClick:t,onGlobalClick:r,onApply:n,onSetEditing:a,onChangeName:i}}))(vZ(WZ)),qZ=e=>{let{value:t,rowValue:{uri:r,isOwnSearch:n},onChange:a}=e;const i=hZ(),o=(0,b.useCallback)((e=>{const n=iZ(e);n!==t&&a(r,n)}),[r,t,a]);return v().createElement("div",{className:i.sharingWrapper},v().createElement(iq.k,{entries:ee,value:aZ(t),onChange:o,disableUnderline:!0,disabled:!n,MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},elevation:3},TextFieldProps:{classes:{root:i.sharingRoot}},classes:{root:i.sharingInput,menuItem:i.sharingMenuItem,disabled:i.sharingDisabled,icon:O()({[i.sharingIconDisabled]:!n})}}))};qZ.propTypes={value:OE().bool,rowValue:OE().shape({uri:OE().string,isOwnSearch:OE().bool}),onChange:OE().func};const ZZ=(0,Yb.q)((e=>{let{onChangeIsPublic:t}=e;return{onChange:t}}))(vZ(qZ)),$Z=e=>{let{value:t,rowValue:r,onClick:n}=e;const a=hZ(),i=n?()=>n(r):()=>{};return v().createElement(hb.Y,{value:t},v().createElement("div",{className:O()(a.defaultWrapper,{[a.clickableArea]:n}),onClick:i},t))};$Z.propTypes={value:OE().any,rowValue:OE().object,onClick:OE().func};const KZ=vZ($Z);function QZ(){return QZ=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},QZ.apply(this,arguments)}const XZ=e=>{const{rowValue:{updateDate:t,createDate:r}}=e,n=t||r;return v().createElement(KZ,QZ({},e,{value:n&&L().date(n,"L")}))};XZ.propTypes={rowValue:OE().shape({updateDate:OE().number,createDate:OE().number})};const JZ=XZ,e$=e=>{let{values:t}=e;return(0,_.pipe)((0,_.cond)([[_.isNil,_.T],[Array.isArray,(0,_.pipe)(_.flatten,_.isEmpty)],[_.T,_.isEmpty]]),_.not)(t)},t$=(0,_.curry)(((e,t)=>(0,_.path)(["facetsData",t.fieldName,"values","length"],e)>0)),r$=e=>e&&e.slice(1).join(" / "),n$=(e,t,r)=>(e[t]||(e[t]={title:t,attributes:[]}),e[t].attributes=(0,_.uniq)(e[t].attributes.concat(r)),e),a$=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return e.flatMap((e=>e.attributes)).filter(e$).reduce(((e,t)=>{let{data:{title:r,groupName:n,pathToTitle:a}}=t;const i=r$(a)||r;return n$(e,n,i)}),{})},i$=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(e.facetsConfigs||[]).filter((0,_.pipe)(x.isTypeFacet,_.not)).filter(t$(e)).reduce(((e,t)=>{const r=(0,_.path)(["pathToTitle",0],t)||L().text("Special"),n=r$(t.pathToTitle)||t.title;return n$(e,r,n)}),{})},o$=e=>{let{rowValue:{uiState:t}}=e;const r=hZ(),n=(0,b.useMemo)((()=>function(){let{facets:e,advanced:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{const r=t?a$(t):i$(e);return Object.values(r)}catch(e){return[]}}(t)),[t]),a=(0,b.useMemo)((()=>(e=>e.flatMap((e=>e.attributes)).length)(n)),[n]),i=!!n.length&&v().createElement("div",null,n.map((e=>{let{title:t,attributes:n}=e;return v().createElement("div",{key:t,className:r.tooltipSection},v().createElement("h6",{className:r.tooltipSectionHeader},t),n.map((e=>v().createElement("div",{key:e,className:r.tooltipText},e))))})));return v().createElement("div",{className:r.numberWrapper},(o=a,i?v().createElement(KO(),{title:i,classes:{tooltip:r.tooltip},disableFocusListener:!0,disableTouchListener:!0},v().createElement("span",null,o)):o));var o};o$.propTypes={rowValue:OE().shape({uiState:OE().shape({facets:OE().object,advanced:OE().array})})};const l$=vZ(o$);function s$(){return s$=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},s$.apply(this,arguments)}const c$=e=>{const t=hZ();return v().createElement(_Z,s$({className:t.totalHeadCell},e))};c$.propTypes={headCellData:OE().shape({id:OE().string,label:OE().oneOfType([OE().string,OE().node]),sortable:OE().bool,resizable:OE().bool,className:OE().string,initialWidth:OE().number,minWidth:OE().number,autoResize:OE().bool,renderer:OE().func})};const u$=c$;var p$=r(67520),d$=r.n(p$);const m$=e=>{let{value:t}=e;const r=hZ();return v().createElement(hb.Y,{value:t},v().createElement("div",{className:r.numberWrapper},L().number(t)))};m$.propTypes={value:OE().number};const y$=vZ(m$),f$=e=>{const t=hZ(),{rowValue:{isTotalLoading:r,isOwnSearch:n,uri:a},onDeleteItem:i,onLoadTotalForItem:o,value:l}=e,s=(0,b.useCallback)((()=>{i(a)}),[i,a]),c=n?L().text("Delete"):L().text("Cannot delete because you're not the owner"),u=r?L().text("Loading data"):L().text("Load data"),p=(0,b.useCallback)((()=>{o(a)}),[o,a]),d=r||-1===l;return v().createElement("div",{className:t.totalWithButtonsWrapper},d?v().createElement(_b.k,{showForDisabled:!0,tooltipTitle:u,tooltipPlacement:"bottom-end",disabled:r,size:"L",icon:d$(),onClick:p}):v().createElement(y$,e),v().createElement(_b.k,{showForDisabled:!0,className:t.deleteButton,tooltipTitle:c,tooltipPlacement:"bottom-end",disabled:!n,size:"L",icon:UB(),onClick:s}))};f$.propTypes={value:OE().number,rowIndex:OE().number,rowValue:OE().shape({isOwnSearch:OE().bool,isTotalLoading:OE().bool,uri:OE().string}),onDeleteItem:OE().func,onLoadTotalForItem:OE().func};const g$=(0,Yb.q)((e=>{let{onDeleteItem:t,onLoadTotalForItem:r}=e;return{onDeleteItem:t,onLoadTotalForItem:r}}))(vZ(f$));function h$(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const E$={rowCellValueRenderer:KZ,headCellRenderer:_Z,autoResize:!1},b$=[{id:"checked",label:"",initialWidth:55,headCellRenderer:bZ,rowCellValueRenderer:xZ},{id:"name",get label(){return L().text("Name")},autoResize:!0,headCellRenderer:DZ,rowCellValueRenderer:GZ,sortable:!0},{id:"isPublic",get label(){return L().text("Shared with")},rowCellValueRenderer:ZZ},{id:"owner",get label(){return L().text("Created by")},initialWidth:260},{id:"updateDate",get label(){return L().text("Last modified")},rowCellValueRenderer:JZ,sortable:!0},{id:"attributes",get label(){return L().text("Filtered attributes")},rowCellValueRenderer:l$},{id:"total",get label(){return L().text("Number of profiles")},headCellRenderer:u$,rowCellValueRenderer:g$,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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){h$(e,t,r[t])}))}return e}({},E$,e)));function v$(){return v$=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},v$.apply(this,arguments)}function T$(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const O$=e=>{let{items:t,total:r,sorting:n,page:a,rowsPerPage:i,loading:o,searchValue:l,globalFilterSavedSearchesUris:s=[],onSearchApply:c,onChangeIsFavorite:u,onChangeIsPublic:p,onChangeIsGlobal:d,onChangeRowsPerPage:m,onChangePage:y,onSelectItem:f,onDeselectAllItems:g,onDeleteItem:h,onChangeItemName:E,onSetItemEditing:T,onLoadTotalForItem:O,onSort:S}=e;const C=mZ(),w=(0,b.useMemo)((()=>({cellBorder:C.cellBorder})),[C]),[A,R]=(0,b.useState)(null),[_,N]=(0,b.useState)(null),I=(0,b.useRef)(null);(0,b.useEffect)((()=>g),[g]);const D=(0,b.useCallback)((e=>{s.includes(e)?N(e):h(e)}),[s,h]),P=(0,b.useMemo)((()=>({mode:Z.saved,onSelectItem:f,onChangeIsFavorite:u,onChangeIsGlobal:d,onSearchApply:c,onSetItemEditing:T,onChangeItemName:E,onDeleteItem:D,onLoadTotalForItem:O,onChangeIsPublic:p})),[D,f,u,d,O,c,T,E,p]),k=(0,b.useMemo)((()=>(0,x.isEmptyValue)(l)?{LogoRenderer:YC.SELECT_ATTRIBUTES,text:L().text("No saved searches."),secondaryText:L().text("Save time by creating saved searches for queries you regularly search for.")}:{LogoRenderer:YC.SEARCH_RESULTS,text:L().text("No results found."),secondaryText:L().text("Try adjusting your search or filter to find what you're looking for.")}),[l]),F=(0,b.useMemo)((()=>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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){T$(e,t,r[t])}))}return e}({},e,{isGlobalFilter:s.includes(e.uri)})))),[t,s]);return v().createElement("div",{className:C.tableWrapper},r>0?v().createElement(v().Fragment,null,v().createElement(Mb.M,{columnsData:b$,rowsData:F,context:P,sorting:n,getRowCellHeight:null,defaultColumnWidth:140,defaultColumnMinWidth:140,defaultRowHeight:48,headRowHeight:47,hoverStateEnabled:!0,onSort:S,hoverRowIndex:A,onRowHover:R,classes:w,ref:I}),v().createElement(FC.Z,{classes:{root:C.paginationRoot,caption:C.paginationCaption},count:r,rowsPerPageOptions:j,rowsPerPage:i,onChangeRowsPerPage:m,page:a,onChangePage:y,basicTableRef:I}),v().createElement(fZ,{open:!!_,title:L().text("Keep the global filter?"),content:L().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:L().text("NO, remove it"),saveCaption:L().text("YES, KEEP GLOBAL FILTER"),onCancel:()=>N(null),onDiscard:()=>{d(_,!1),h(_),N(null)},onSave:()=>{h(_),N(null)}})):v().createElement(WC,v$({},k,{variant:HC.embedded})),o&&v().createElement(GC.Z,null))};O$.propTypes={items:OE().arrayOf(OE().shape({uri:OE().string,name:OE().string,isPublic:OE().bool,isFavorite:OE().bool,isOwnSearch:OE().bool,isEditing:OE().bool,checked:OE().bool,owner:OE().string,updateDate:OE().number,query:OE().string})),total:OE().number,sorting:VO.nI,page:OE().number,rowsPerPage:OE().number,loading:OE().bool,searchValue:OE().string,globalFilterSavedSearchesUris:OE().arrayOf(OE().string),onSearchApply:OE().func,onChangeIsFavorite:OE().func,onChangeIsPublic:OE().func,onChangeIsGlobal:OE().func,onChangeRowsPerPage:OE().func,onChangePage:OE().func,onSelectItem:OE().func,onDeselectAllItems:OE().func,onDeleteItem:OE().func,onChangeItemName:OE().func,onSetItemEditing:OE().func,onSort:OE().func};const x$=(0,xE.connect)((e=>({items:Dd(e),total:kd(e),sorting:Vd(e),page:Ld(e),rowsPerPage:Fd(e),loading:Bd(e),searchValue:Ud(e),globalFilterSavedSearchesUris:Cr().selectors.getGlobalFilterSavedSearchesUris(e)})),{onSearchApply:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ne;return{type:po,payload:{uri:e,debounceTime:t}}},onChangeIsFavorite:(e,t)=>({type:eo,payload:{uri:e,isFavorite:t}}),onChangeIsPublic:(e,t)=>({type:Xi,payload:{uri:e,isPublic:t}}),onChangeIsGlobal:(e,t)=>({type:ro,payload:{uri:e,isGlobalFilter:t}}),onChangeRowsPerPage:e=>({type:qi,payload:e}),onChangePage:e=>({type:Gi,payload:e}),onSelectItem:(e,t)=>({type:$i,payload:{uri:e,checked:t}}),onDeselectAllItems:Td,onDeleteItem:e=>({type:lo,payload:e}),onChangeItemName:(e,t)=>({type:no,payload:{uri:e,name:t}}),onSetItemEditing:(e,t)=>({type:io,payload:{uri:e,isEditing:t}}),onLoadTotalForItem:e=>({type:yo,payload:e}),onSort:e=>({type:fo,payload:e})})(O$),S$=e=>{let{value:t=!1,rowValue:{createdDate:r},onClick:n}=e;const a=hZ();return v().createElement("div",{className:O()(a.headCell,a.checkbox)},v().createElement(rb(),{checked:t,onChange:e=>n(r,e.target.checked)}))};S$.propTypes={value:OE().bool,rowValue:OE().shape({createdDate:OE().number}),onClick:OE().func};const C$=(0,Yb.q)((e=>{let{onSelectItem:t}=e;return{onClick:t}}))(vZ(S$));function w$(){return w$=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},w$.apply(this,arguments)}const A$=e=>{const{rowValue:{createdDate:t}}=e,r=t;return v().createElement(KZ,w$({},e,{value:r&&L().date(r,"L LT")}))};A$.propTypes={rowValue:OE().shape({createdDate:OE().number}),onClick:OE().func};const R$=(0,Yb.q)((e=>{let{onSearchApply:t}=e;return{onClick:t}}))(A$),_$=e=>{const t=hZ(),{rowValue:r,onDeleteItem:n,onLoadTotalForItem:a,value:i}=e,{isTotalLoading:o,createdDate:l}=r,s=(0,b.useCallback)((()=>{n(r)}),[n,r]),c=o?L().text("Loading data"):L().text("Load data"),u=(0,b.useCallback)((()=>{a(l)}),[a,l]),p=o||-1===i;return v().createElement("div",{className:t.totalWithButtonsWrapper},p?v().createElement(_b.k,{showForDisabled:!0,tooltipTitle:c,tooltipPlacement:"bottom-end",disabled:o,size:"L",icon:d$(),onClick:u}):v().createElement(y$,e),v().createElement(_b.k,{className:t.deleteButton,tooltipTitle:L().text("Delete"),tooltipPlacement:"bottom-end",size:"L",icon:UB(),onClick:s}))};_$.propTypes={value:OE().number,rowValue:OE().shape({isTotalLoading:OE().bool,createdDate:OE().number}),onDeleteItem:OE().func,onLoadTotalForItem:OE().func};const N$=(0,Yb.q)((e=>{let{onDeleteItem:t,onLoadTotalForItem:r}=e;return{onDeleteItem:t,onLoadTotalForItem:r}}))(vZ(_$)),I$=(0,Yb.q)((e=>{let{onSearchApply:t}=e;return{onClick:t}}))(KZ);function D$(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const P$={rowCellValueRenderer:KZ,headCellRenderer:_Z,autoResize:!1},k$=[{id:"checked",label:"",initialWidth:55,headCellRenderer:bZ,rowCellValueRenderer:C$},{id:"createdDate",get label(){return L().text("Created")},rowCellValueRenderer:R$,initialWidth:256},{id:"name",get label(){return L().text("Query")},autoResize:!0,rowCellValueRenderer:I$,minWidth:150},{id:"total",get label(){return L().text("Record count")},rowCellValueRenderer:N$,headCellRenderer:u$,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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){D$(e,t,r[t])}))}return e}({},P$,e)));function L$(){return L$=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},L$.apply(this,arguments)}const F$=e=>{let{items:t,loading:r,filterWord:n,onSelectItem:a,onDeselectAllItems:i,onSearchApply:o,onDeleteItem:l,onLoadTotalForItem:s}=e;const c=mZ(),u=(0,b.useMemo)((()=>({cellBorder:c.cellBorder})),[c]),[p,d]=(0,b.useState)(null);(0,b.useEffect)((()=>i),[i]);const m=(0,b.useMemo)((()=>({mode:Z.recent,onSelectItem:a,onSearchApply:o,onDeleteItem:l,onLoadTotalForItem:s})),[l,s,a,o]),y=(0,b.useMemo)((()=>(0,x.isEmptyValue)(n)?{LogoRenderer:YC.SELECT_ATTRIBUTES,text:L().text("No recent searches."),secondaryText:L().text("Your recent search history will appear here.")}:{LogoRenderer:YC.SEARCH_RESULTS,text:L().text("No results found."),secondaryText:L().text("Try adjusting your search or filter to find what you're looking for.")}),[n]);return v().createElement("div",{className:c.tableWrapper},t.length>0?v().createElement(Mb.M,{columnsData:k$,rowsData:t,context:m,getRowCellHeight:null,defaultColumnWidth:50,defaultColumnMinWidth:50,defaultRowHeight:48,headRowHeight:47,hoverStateEnabled:!0,hoverRowIndex:p,onRowHover:d,classes:u}):v().createElement(WC,L$({},y,{variant:HC.embedded})),r&&v().createElement(GC.Z,null))};F$.propTypes={items:OE().arrayOf(OE().shape({uri:OE().string,name:OE().string,isPublic:OE().bool,isFavorite:OE().bool,isOwnSearch:OE().bool,checked:OE().bool,owner:OE().string,createdDate:OE().number,query:OE().string})),loading:OE().bool,filterWord:OE().string,onSelectItem:OE().func,onSearchApply:OE().func,onDeselectAllItems:OE().func,onDeleteItem:OE().func};const j$=(0,xE.connect)((e=>({items:Vf(e),loading:Bf(e),filterWord:Uf(e)})),{onSearchApply:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ne;return{type:Io,payload:{search:e,debounceTime:t}}},onSelectItem:(e,t)=>({type:vo,payload:{searchCreatedDate:e,checked:t}}),onDeselectAllItems:Df,onDeleteItem:e=>({type:Co,payload:e}),onLoadTotalForItem:e=>({type:No,payload:e})})(F$),U$=e=>{let{open:t,onClose:r}=e;const n=Hq(),a=(0,xE.useDispatch)(),i=(0,b.useMemo)((()=>[{value:Z.saved,label:L().text("Saved searches"),content:v().createElement(x$,null),dataReltioId:"reltio-search-saved-searches"},{value:Z.recent,label:L().text("Recent searches"),content:v().createElement(j$,null),dataReltioId:"reltio-search-recent-searches"}]),[]),[o,l]=(0,b.useState)(i[0].value);return(0,b.useEffect)((()=>{t&&a(o===Z.saved?{type:zi}:{type:ho})}),[t,a,o]),v().createElement(TY(),{classes:{paper:n.dialogPaper},fullWidth:!0,maxWidth:"lg",open:t,onClose:r},v().createElement(pZ,{type:o,onClose:r}),v().createElement(aW(),{classes:{root:n.contentRoot}},v().createElement("div",{className:n.tabsWrapper},v().createElement(Nj,{value:o,tabs:i,onChange:l,scrollButtons:"auto"})),v().createElement("div",{className:n.tabContent},i.find((0,_.propEq)("value",o)).content)))};U$.propTypes={open:OE().bool,onClose:OE().func};const M$=U$,V$=(0,AE.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"}}))),B$=e=>{let{showTypography:t}=e;const r=V$(),n=(0,xE.useDispatch)(),a=(0,xE.useSelector)(yu),i=L().text("Saved & recent searches"),o=(0,b.useCallback)((()=>n(Ap(!0))),[n]),l=(0,b.useCallback)((()=>n(Ap(!1))),[n]);return v().createElement(v().Fragment,null,v().createElement(KO(),{title:t?"":i},v().createElement(yC(),{className:r.button,variant:"outlined",startIcon:v().createElement(zq(),{className:O()({[r.compact]:!t}),color:"action"}),onClick:o,"data-reltio-id":"reltio-search-saved-and-recent-search"},t&&v().createElement(DT(),{variant:"button",color:"textPrimary",className:r.buttonText},i))),v().createElement(M$,{open:a,onClose:l}))},z$=(0,AE.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"}}))),H$="search",Y$="geoLocation",W$={},G$=()=>{const e=z$(),t=(0,xE.useDispatch)(),r=(0,xE.useSelector)(br),n=(0,xE.useSelector)(Er),a=(0,xE.useSelector)(Zu)||W$,i=(0,xE.useSelector)(Cr().selectors.getSearchKeyword),o=(0,xE.useSelector)(Cr().selectors.getDateMask),l=(0,xE.useSelector)(Cr().selectors.getDateTimeMask),s=(0,xE.useSelector)(Cr().selectors.getAttributesPresentation)||W$,c=(0,xE.useSelector)(fu),u=(0,xE.useSelector)((e=>Ju(e,{entityTypeUri:void 0}))),p=(0,xE.useSelector)(Lu),d=(0,b.useContext)(ZG._),[m,y]=(0,b.useState)([]),[f,g]=(0,b.useState)(0),[h,E]=(0,b.useState)(!1),T=(0,b.useRef)(null),[O,S]=(0,b.useState)(!0);(0,b.useEffect)((()=>{y(C())}),[r,n,a,i]),(0,b.useEffect)((()=>{g(m.length),E(!0)}),[m]),(0,b.useEffect)((()=>{if(h){const e=R();g(e),E(!1)}}),[h,n]);const C=(0,b.useCallback)((()=>{const e=Object.values(xc(n,r)).filter((e=>e.values&&e.values.length)).map((e=>{const t=e.title||e.hiddenTitle,r=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const{dateTimeMask:a,dateMask:i}=n,o=(0,x.formatDataTypeValue)({dataTypeDefinition:{type:x.DataTypes.TYPE_LOCAL_DATE},dateMask:i,dateTimeMask:a});return t.map((n=>{let a;switch(r){case x.FACET_TYPES.NUMERIC_RANGE_FACET:return`${Qs(+n[0],1e4)} — ${Qs(+n[1],1e4)}`;case x.FACET_TYPES.DATE_RANGE_FACET:return a=tc().getRange(t,e),`${o(a[0])} — ${o(a[1])}`;case x.FACET_TYPES.ENTITY_TYPE_FACET:case x.FACET_TYPES.WITH_DROPDOWN_CHECKBOXES_FACET:default:return x.Maybe.fromNull(e.find((e=>e.value===n))).orSome({label:n||""}).label}}))}([...e.data||[],...e.filteredData||[]],(0,_.path)(["attrType","type"],e)===x.DataTypes.TYPE_DATE?e.values.map((e=>e.map((e=>x.utils.dates.toLocalDate(e).getTime())))):e.values.map((0,x.mapFilterValue)((0,x.applyPresentationStrategyToValue)((e=>(0,x.getNumberFormat)((0,x.getAttrDataTypeDefinition)(e.attrType),s,x.intl.getLocale()).strategy)(e)))),e.type,{dateMask:o,dateTimeMask:l});return{fieldName:e.fieldName,title:t,values:r}}));i&&e.push({fieldName:H$,title:L().text("Search"),values:[i.value]});const{values:[t]=[],type:c}=(0,_.pathOr)({},["mapSearch"],a);return t&&e.push({fieldName:Y$,values:(0,x.getMapSearchValues)(c,t),title:(0,x.getMapSearchLabel)(c)}),e}),[r,n,a,i,s,o,l]),w=(0,b.useCallback)((()=>{g(m.length),E(!0)}),[m]),A=(0,b.useCallback)((e=>{S(e>=410)}),[]),R=(0,b.useCallback)((()=>{if(!T.current)return 0;const{firstChild:e,offsetLeft:t,offsetWidth:r}=T.current,n=t+r;return([...e.childNodes]||[]).filter((a=n,e=>e.offsetLeft+e.offsetWidth<=a)).length;var a}),[T]),N=(0,b.useCallback)((e=>r=>{switch(r.stopPropagation(),e){case H$:t(Sr.search.actions.keywordUpdated(null));break;case Y$:t(Bc(null));break;default:t(Yc(e,[]))}}),[t]),I=(0,b.useCallback)((()=>{t(jc({silent:!0})),t(Sr.search.actions.keywordUpdated({debounceTime:ne}))}),[t]),D=(0,b.useMemo)((()=>m.map((e=>v().createElement(QG,{key:e.fieldName,title:e.title,values:e.values,onDelete:N(e.fieldName)})))),[m,N]),P=D.slice(0,f),k=D.slice(f),F=(0,_.when)((0,_.propEq)("length",1),(0,_.reject)(x.isEmptySearchGroup))(p),j=0===D.length&&0===F.length;return v().createElement("div",{className:e.container,"data-reltio-id":"search-bar"},v().createElement("div",{className:e.header},v().createElement("div",{className:e.captionWrapper,"data-reltio-id":"search-bar-total-profiles"},v().createElement(DT(),{component:"span",classes:{body1:e.profileNumber}},L().number(u,"0,0")),v().createElement(DT(),{variant:"body2",component:"span",classes:{root:e.profileText}},L().text("total profiles"))),v().createElement(Vq,null),v().createElement(Uq,null),v().createElement(yC(),{color:"primary",className:e.clearButton,onClick:I,disabled:j,"data-reltio-id":"reltio-search-clear"},L().text("clear")),!d&&v().createElement("div",{className:e.searchBarControls,"data-reltio-id":"search-bar-controls"},v().createElement(qE.Z,{handleWidth:!0,onResize:A}),v().createElement(Lq,null),v().createElement(pS(),{orientation:"vertical",className:e.splitter}),v().createElement(B$,{showTypography:O}))),v().createElement(qE.Z,{handleWidth:!0,onResize:w}),v().createElement(qG(),{in:!c&&f>0,timeout:500},v().createElement("div",{ref:T,className:e.facetsBar,"data-reltio-id":"search-facets-bar"},v().createElement("div",{className:e.showBar},P),k.length>0&&v().createElement(JG,{items:k}))))},q$=(0,AE.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"}}),Z$=e=>{let{onBackBtnClick:t}=e;const r=q$();return v().createElement(sW(),{disableGutters:!0,classes:{root:r.toolBar}},v().createElement(_b.k,{tooltipTitle:L().text("Switch to basic mode"),size:"L",icon:Mj(),className:r.backButtonContainer,onClick:t}),v().createElement(DT(),{variant:"subtitle1",className:r.title},L().text("Advanced search")))};Z$.propTypes={onBackBtnClick:OE().func};const $$=Z$,K$=(0,AE.Z)({resultQueryPanel:{background:"#E3E7E9",display:"flex",flex:"0 0 auto",alignItems:"center"},resultQuery:{flexGrow:1,padding:"10px 10px 10px 24px",fontSize:"12px",lineHeight:"16px",color:"rgba(0,0,0,0.38)"},queryContainer:{height:"auto",maxHeight:"48px",paddingRight:"24px",paddingTop:"4px",overflow:"auto"},queryContainerMinHeight:{maxHeight:"18px"},query:{cursor:"pointer"},noQuery:{color:"#000000"},actionsPanel:{display:"flex",paddingRight:"12px"},collapseButton:{marginRight:"-4px"}}),Q$=(0,AE.Z)((e=>({query:{color:e.palette.text.secondary,fontSize:"12px",letterSpacing:0,lineHeight:"16px"},[x.READABLE_QUERY_PRIMITIVE_TYPES.entityTypeLabel]:{color:"#03904A"},[x.READABLE_QUERY_PRIMITIVE_TYPES.attributeLabel]:{color:"#059BEA"},[x.READABLE_QUERY_PRIMITIVE_TYPES.specialAttributeLabel]:{color:"#EA05CF"},[x.READABLE_QUERY_PRIMITIVE_TYPES.attributeFilter]:{color:"#7F00FF"},[x.READABLE_QUERY_PRIMITIVE_TYPES.attributeValue]:{color:"#000000"}})));function X$(){return X$=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},X$.apply(this,arguments)}const J$=(0,b.forwardRef)(((e,t)=>{let{readableQuery: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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["readableQuery","className"]);const i=Q$();return v().createElement("span",X$({ref:t,className:O()(i.query,n),"data-reltio-id":"search-readable-query"},a),r.map(((e,t)=>{let{type:r,text:n}=e;return v().createElement("span",{key:t,className:i[r]},n)})))}));J$.displayName="ReadableSearchQuery";const eK=J$;var tK=r(82466),rK=r.n(tK);const nK=(0,AE.Z)({collapseIcon:{transform:"rotate(0deg)",transition:"transform 0.35s ease"},"collapseIcon--inverted":{transform:"rotate(-180deg)"}});function aK(){return aK=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},aK.apply(this,arguments)}const iK=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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["collapseBtnActive","onCollapseBtnClick"]);const a=nK();return v().createElement(_b.k,aK({size:"L",icon:rK(),tooltipTitle:t?L().text("Collapse panel"):L().text("Expand panel"),onClick:r,iconClassName:O()(a.collapseIcon,{[a["collapseIcon--inverted"]]:!t}),"data-reltio-id":"reltio-search-advanced-search-collapse-panel"},n))};iK.propTypes={backBtnDisabled:OE().bool,onBackBtnClick:OE().func,collapseBtnActive:OE().bool,onCollapseBtnClick:OE().func};const oK=iK;var lK=r(89808),sK=r.n(lK),cK=r(19820),uK=r.n(cK);function pK(){return pK=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},pK.apply(this,arguments)}const dK=e=>{let{isFullscreen:t=!1,onClick:r=_.identity}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["isFullscreen","onClick"]);return v().createElement(_b.k,pK({size:"L",icon:t?uK():sK(),tooltipTitle:t?L().text("Exit full screen"):L().text("Full screen"),onClick:r,"data-reltio-id":"reltio-search-advanced-search-full-screen"},n))};dK.propTypes={isFullscreen:OE().bool,onClick:OE().func};const mK=dK,yK=e=>{let{groups:t,hasMinSize:r,lookups:n,metadata:a,attributesPresentation:i,collapseBtnActive:o,isFullscreen:l,onCollapseBtnClick:s,onFullScreenBtnClick:c,keyword:u,map:p,dispatch:d}=e;const m=K$(),[y,f]=(0,b.useState)(0),[g,h]=(0,b.useState)(0),E=(0,b.useMemo)((()=>it(Za(a,t))),[a,t]),T=(0,x.buildReadableQuery)(a,i,n,t,u,p),S=L().text("Copy to clipboard"),[C,w]=(0,b.useState)(S),A=(0,b.useCallback)((0,x.debounce)((()=>{d({type:Va})}),500),[d]),R=(0,b.useCallback)((()=>{Rq((0,x.buildReadableQueryToString)(a,i,n,t,u,p)).then((()=>w(L().text("Query was copied")))).catch((()=>w(L().text("Error"))))}),[t,i,n,a,u,p]),_=(0,b.useCallback)((()=>{w(S)}),[S]),N=(0,b.useCallback)((e=>{f(e.clientX),h(e.clientY)}),[]);(0,PC.D)(A,[A,E]);const I=(0,b.useMemo)((()=>({anchorEl:{clientWidth:1,clientHeight:1,getBoundingClientRect:()=>({left:y,bottom:g,height:1,right:y,width:1,top:g})}})),[y,g]);return v().createElement("div",{className:m.resultQueryPanel},v().createElement("div",{className:m.resultQuery},L().text("Search query"),v().createElement("div",{className:O()(m.queryContainer,{[m.queryContainerMinHeight]:r})},T.length>0?v().createElement(KO(),{key:C,title:C,onClose:_,PopperProps:I},v().createElement(eK,{readableQuery:T,onMouseEnter:N,onClick:R,className:m.query})):v().createElement("span",{className:m.noQuery},L().text("Build your search and view your search query here")))),v().createElement("div",{className:m.actionsPanel},v().createElement(oK,{collapseBtnActive:o,onCollapseBtnClick:s,className:m.collapseButton}),v().createElement(mK,{isFullscreen:l,onClick:c})))};yK.propTypes={groups:OE().arrayOf(OE().shape({id:OE().string,attributes:OE().arrayOf(OE().shape({values:OE().array,data:OE().object,filter:OE().string,operator:OE().string})),operator:OE().string})),lookups:OE().object,hasMinSize:OE().bool,attributesPresentation:OE().object,collapseBtnActive:OE().bool,isFullscreen:OE().bool,onCollapseBtnClick:OE().func,onFullScreenBtnClick:OE().func,metadata:x.MetadataType,keyword:x.KeywordSearchType,map:zO,dispatch:OE().func};const fK=yK,gK={position:"absolute",width:1,background:"rgba(43, 152, 240, 0.3)",height:16,left:36};function hK(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=n.concat(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 in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const bK=(0,AE.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:hK({},gK),upperLine:{marginTop:-18},searchByOvContainer:{marginLeft:-6,marginBottom:-14}})));var vK=r(28345),TK=r.n(vK);const OK="46px",xK=(0,AE.Z)((e=>({readOnlyLogicOperatorContainer:{display:"flex",alignItems:"center",marginRight:"40px",width:"76px",fontSize:"14px",color:e.palette.text.secondary,maxHeight:OK},readOnlyFilter:{display:"flex",alignItems:"center",fontSize:"14px",color:e.palette.text.secondary,width:"50px",marginLeft:"12px",maxHeight:OK}})));var SK=r(68157);const CK=e=>{let{className:t,rowData:r}=e;const n=xK();return v().createElement("div",{className:O()(n.readOnlyLogicOperatorContainer,t)},r&&r.operator?(0,SK.capitalize)(r.operator):L().text("Where"))};CK.propTypes={className:OE().string,rowData:OE().object};const wK=CK,AK=e=>{let{className:t,rowData:r}=e;const n=xK();return v().createElement("div",{className:O()(n.readOnlyFilter,t)},r&&r.filter?(0,x.getFilterOptionLabel)(r.filter):L().text("equals"))},RK=(0,AE.Z)((()=>({row:{display:"flex",marginBottom:"12px"},rowItem:{paddingRight:"10px",display:"flex"},fullWidth:{flexGrow:"1",flexBasis:"0",overflow:"hidden"},hidden:{visibility:"hidden"}})));const _K=e=>{let{classes:t={},rowData:r,previousRowData:n,LogicOperatorComponent:a=wK,AttributeSelectorComponent:i,FilterSelectorComponent:o=AK,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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["classes","rowData","previousRowData","LogicOperatorComponent","AttributeSelectorComponent","FilterSelectorComponent","ValuesEditorComponent","ActionsComponent","filterSelectorRef","attributeSelectorProps"]);const d=RK();return v().createElement("div",{className:O()(d.row,t.root),"data-reltio-id":"query-builder-row"},v().createElement(a,{className:t.logicOperatorContainer,rowContext:p,rowData:n}),v().createElement("div",{className:O()(d.rowItem,t.attributeSelectorContainer)},v().createElement(i,{attributeSelectorProps:u,rowContext:p,rowData:r})),v().createElement("div",{className:O()(d.rowItem,t.filterSelectorContainer)},v().createElement(o,{textFieldInputRef:c,rowContext:p,rowData:r})),v().createElement("div",{className:O()(d.rowItem,d.fullWidth,t.valuesEditorContainer)},v().createElement(l,{rowContext:p,rowData:r})),v().createElement("div",{className:O()(d.rowItem,t.actionsContainer,{[d.hidden]:!r})},v().createElement(s,{rowContext:p,rowData:r})))};_K.propTypes={classes:OE().shape({root:OE().string,logicOperatorContainer:OE().string,attributeSelectorContainer:OE().string,filterSelectorContainer:OE().string,valuesEditorContainer:OE().string,actionsContainer:OE().string}),rowData:VO.Xw,previousRowData:VO.Xw,LogicOperatorComponent:OE().elementType,AttributeSelectorComponent:OE().elementType,FilterSelectorComponent:OE().elementType,ValuesEditorComponent:OE().elementType,ActionsComponent:OE().elementType,filterSelectorRef:OE().object,attributeSelectorProps:OE().shape({onRestoreFocus:OE().func,onOpen:OE().func,disablePopoverRestoreFocus:OE().bool})};const NK=(0,b.memo)(_K);function IK(){return IK=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},IK.apply(this,arguments)}const DK=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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.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,_.path)([t-1],n):null,c=t===n.length?{attributeSelectorProps:a}:{};return v().createElement(NK,IK({key:e&&e.id,rowData:e,previousRowData:s,classes:r,filterSelectorRef:t===o?i:void 0},l,c))};return v().createElement("div",{className:t},n.map(s),s(null,n.length,n))};DK.propTypes={className:OE().string,rowClasses:OE().shape({root:OE().string,logicOperatorContainer:OE().string,attributeSelectorContainer:OE().string,filterSelectorContainer:OE().string,valuesEditorContainer:OE().string,actionsContainer:OE().string}),rowsData:OE().arrayOf(VO.Xw),LogicOperatorComponent:OE().elementType,AttributeSelectorComponent:OE().elementType,FilterSelectorComponent:OE().elementType,ValuesEditorComponent:OE().elementType,ActionsComponent:OE().elementType,filterSelectorRef:OE().object,filterSelectorRefIndex:OE().number,lastRowAttributeSelectorProps:OE().shape({onRestoreFocus:OE().func,onOpen:OE().func,disablePopoverRestoreFocus:OE().bool})};const PK=(0,b.memo)(DK),kK=(0,AE.Z)((()=>({select:{padding:"6px 16px 7px"},dropDown:{width:"100px","&:before":{content:"none !important"}}})));function LK(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const FK=e=>{let{className:t,value:r,onChange:n}=e;const a=kK(),i=x.operatorOptions.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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){LK(e,t,r[t])}))}return e}({},e,{label:L().text(e.label)})));return v().createElement(iq.k,{className:O()(a.dropDown,t),classes:a,value:r,entries:i,onChange:n})};function jK(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){UK(e,t,r[t])}))}return e}function UK(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const MK=(0,AE.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:jK({},gK),upperLine:{marginTop:-18},lowerLine:{marginBottom:-16,bottom:0}}))),VK="46px",BK=(0,AE.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:VK},filterSelect:{width:"190px"},valuesWrapper:{width:"100%",display:"flex",minHeight:VK,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:{}}))),zK=(0,AE.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)"}}),HK=(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+", ".length)}}return-1},YK=e=>e.join(", "),WK=e=>`calc(${(0,_.isNil)(e)?"100%":`${e}px`} - 35px)`,GK=e=>{let{list:t,maxWidth:r}=e;const n=zK(),a=(0,b.useRef)(),[i,o]=(0,b.useState)(0);(0,b.useEffect)((()=>{o(((e,t)=>{const r=e.length,n=((e,t)=>{if(t){const r=HK(e,t);return-1===r?0:e.length-r}return 0})(e,t);return r-Math.max(1,r-n)})(t,a.current))}),[t]);const l=YK(t),s=i>0,c=s?YK(t.slice(0,-i)):l;return v().createElement(KO(),{title:s?l:""},v().createElement("div",{className:n.listLabelContainer},v().createElement("div",{style:{width:WK(r)},className:n.listLabel,ref:a},l),v().createElement("div",{className:n.visibleItemsLabel},c),s&&v().createElement("div",{className:n.hiddenCount},`+${i}`)))};function qK(){return qK=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},qK.apply(this,arguments)}const ZK=(0,_.always)(32),$K=(0,b.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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["selectedItems","onItemClick","focusIndex","width","height"]);return v().createElement(QE,qK({getItemSize:ZK,renderItem:(e,a,i)=>{let{item:o}=a;const l=!!t.find((e=>o.uri===e)),s=i===n;return v().createElement(Ob,{key:o.uri,onClick:r,checked:l,data:o,label:v().createElement(xb.o,{text:o.label,highlight:o.filterText}),labelInText:o.label,style:e,isFocused:s,hideIcon:!0,LogoIcon:o.LogoIcon})},focusIndex:n,fixedTitle:!1,disableHorizontalScrollbar:!0,width:a,height:i},o))}));$K.displayName="SelectMetadataTypesList";const KK=(0,AE.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 QK(){return QK=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},QK.apply(this,arguments)}function XK(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){JK(e,t,r[t])}))}return e}function JK(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const eQ=(0,b.memo)((e=>{let{placeholder:t,classes:r={},items:n,selectedItemsUris:a,onChange:i,ListLabelProps:o={},disabled:l,enableEmptyValueUnderline:s,single:c,label:u,dataReltioId:p,selectionPopupTitle:d}=e;const m=KK(),[y,f]=(0,b.useState)(!1),g=(0,b.useCallback)((()=>f(!0)),[]),h=(0,b.useCallback)((()=>f(!1)),[]),[E,T]=(0,b.useState)(""),S=(0,b.useCallback)((()=>T("")),[]),C=(0,b.useCallback)((0,_.pipe)(S,h),[h,S]),w=n.filter((e=>{let{label:t}=e;return x.utils.strings.search(t,E)})).map(((e,t)=>({item:{item:XK({},e,{filterText:E})},index:t}))),A=(0,b.useMemo)((()=>(0,_.pipe)((0,_.map)((e=>n.find((0,_.propEq)("uri",e)))),(0,_.reject)(_.isNil),(0,_.pluck)("label"))(a)),[a,n]),R=(0,b.useCallback)(((e,t)=>{c?(i(t?[e.uri]:[]),C()):i(t?a.concat(e.uri):a.filter((t=>t!==e.uri)))}),[a,i,c,C]),N=(0,b.useCallback)((e=>{let{item:t}=e;const r=!a.includes(t.uri);R(t,r)}),[a,R]),{focusIndex:I,handleKeyDown:D}=XE({items:w,open:y,onSelectFocusedItem:N,selectedItems:a,onClose:C}),P=(0,b.useRef)(),k=P.current?P.current.getBoundingClientRect().width:0,L=Math.max(k,255),F=0===a.length;return v().createElement(v().Fragment,null,v().createElement(Aq(),{label:u,ref:P,InputProps:{startAdornment:F&&!t?null:v().createElement("div",{className:O()(m.inputText,r.inputText)},F?v().createElement("div",null,t):v().createElement(GK,QK({},o,{list:A}))),classes:{root:m.inputRoot,input:O()(m.input,r.input,{[m.emptyInput]:F&&!t}),disabled:O()(m.disabledInput,{[m.disabledPointer]:l}),underline:m.disabledUnderline},endAdornment:v().createElement(jE.T,{size:"L",icon:YT(),iconClassName:O()(m.icon,{[m["popup-opened-icon"]]:y}),disabled:l}),readOnly:!0,disableUnderline:F&&!s},inputProps:{tabIndex:-1},InputLabelProps:{classes:{root:O()(m.inputLabel,r.label)}},value:"",onClick:l?void 0:g,classes:{root:O()(m.root,r.root)},size:"small",variant:"filled",disabled:l,"data-reltio-id":p}),v().createElement(YE,{open:y,anchorEl:P.current,onClose:C,onSearch:T,title:d,containerWidth:L,containerHeight:355,searchInputOnKeyDown:D,transformOrigin:{horizontal:"left",vertical:"top"},anchorOrigin:{horizontal:"left",vertical:"bottom"},PaperProps:{"data-reltio-id":`${p}-popup`}},v().createElement($K,{items:w,onItemClick:R,selectedItems:a,width:L,height:245,focusIndex:I})))}));eQ.displayName="MetadataTypesSelector";const tQ=(0,b.memo)((e=>{let{entityTypes:t,selectedEntityTypes:r,single:n,placeholder:a,enableEmptyValueUnderline:i,onChange:o,classes:l={},ListLabelProps:s={},disabled:c=!1}=e;const u=(0,b.useMemo)((()=>t.filter(x.isAvailableEntityType)),[t]);return v().createElement(eQ,{items:u,selectedItemsUris:r,single:n,placeholder:a,enableEmptyValueUnderline:i,onChange:o,classes:l,ListLabelProps:s,disabled:c,label:L().text("Entity type"),dataReltioId:"entity-type-selector",selectionPopupTitle:L().text("Select entity types")})}));tQ.displayName="EntityTypesSelector";const rQ=e=>{let{selectedEntityTypes:t,onChange:r,classes:n={},ListLabelProps:a={}}=e;const i=(0,xE.useSelector)(Cr().selectors.getMetadata),o=(0,xE.useSelector)(sp),l=(0,xE.useSelector)(ku),s=(0,b.useCallback)(l?e=>{let{uri:t}=e;return l.includes(t)}:_.identity,[l]),c=(0,b.useMemo)((()=>i.entityTypes.filter(s).sort(l?(0,x.orderByArrayComparator)(l,"uri"):e=>0).filter((e=>{let{uri:t}=e;return(0,x.isAvailableEntityTypeForDataTenant)(o,t)}))),[i,o,s,l]);return v().createElement(tQ,{classes:n,entityTypes:c,onChange:r,selectedEntityTypes:t,ListLabelProps:a,placeholder:L().text("All"),enableEmptyValueUnderline:!0})};rQ.propTypes={selectedEntityTypes:OE().arrayOf(OE().string).isRequired,onChange:OE().func.isRequired,classes:OE().shape({root:OE().string,label:OE().string}),ListLabelProps:OE().shape({maxWidth:OE().number})};const nQ=rQ,aQ=(0,AE.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)"}}}}),iQ=(0,_.either)((0,_.prop)("title"),(0,_.prop)("fieldName")),oQ=e=>{let{value:t,getLabel:r=iQ,onSelectAttributeClick:n,disabled:a=!1}=e;const i=aQ(),o=t&&r(t);return v().createElement("div",{onClick:a?void 0:n,className:O()(i.attribute,{[i.attributeWithValue]:!!o},{[i.disabled]:a})},v().createElement(hb.Y,{value:o},v().createElement("div",{className:O()(i.name,{[i.disabled]:a})},o||v().createElement("span",{className:i.noSelect},L().text("Select attribute")))),v().createElement(jE.T,{size:"M",icon:YT(),disabled:a}))},lQ=(0,AE.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 sQ(){return sQ=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},sQ.apply(this,arguments)}function cQ(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){uQ(e,t,r[t])}))}return e}function uQ(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const pQ=(0,b.memo)((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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["selectedAttributes","onItemClick","focusIndex","hideCheckBox"]);const o=lQ(),l=(0,w.AH)();return v().createElement(QE,sQ({getItemSize:(e,t)=>t.items?40:28,renderItem:(e,i,o)=>{let{item:l,level:s,groupId:c,groupName:u}=i;const p=KB(l,t),d=o===n;return v().createElement(Ob,{key:`item-${c}-${l.fieldName}`,onClick:r,checked:p,data:cQ({},l,{groupName:u}),notSelectable:l.notSelectable,hideCheckBox:a,label:v().createElement(xb.o,{text:l.title,highlight:l.filterText}),labelInText:l.title,level:s,style:e,isFocused:d,groupId:c,LogoIcon:l.LogoIcon})},renderGroupTitle:(e,t)=>v().createElement(uT(),{component:"div",className:o.subHeader,style:e,key:`group-${t.item.id}`},t.item.needGroupIcon&&v().createElement(bS,{group:t.item,metadata:l}),t.item.title),focusIndex:n},i))}));function dQ(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){mQ(e,t,r[t])}))}return e}function mQ(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const yQ=(e,t)=>e.title.toLowerCase().includes(t.toLowerCase()),fQ=(e,t)=>yQ(e,t)||(e.children||[]).some((e=>fQ(e,t))),gQ=(e,t)=>e.findIndex($B(t)),hQ=(0,x.getMaxItemWidth)("title"),EQ=function(e,t,r,n){let a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,i=arguments.length>5&&void 0!==arguments[5]&&arguments[5];const o=yQ(e,n);return[{item:n?dQ({},e,{filterText:n}):e,level:a,groupId:t,groupName:r}].concat(e.children?e.children.filter((e=>i||o||fQ(e,n))).flatMap((e=>EQ(e,t,r,n,a+1,i||o))):[]).flat()},bQ=(0,_.curry)(((e,t)=>t.map((t=>({item:t,items:t.attributes.filter((t=>fQ(t,e))).map((r=>EQ(r,t.id,t.title,e)))}))).filter((e=>e.items.length)))),vQ=(0,AE.Z)({selector:{minWidth:"200px",width:"100%",alignItems:"stretch",background:"rgba(0,0,0, 0.0267)",boxSizing:"border-box",borderRadius:"4px",display:"flex"}}),TQ=(0,b.memo)((e=>{let{className:t,itemsGroups:r,value:n,getLabel:a,onSelect:i,onRestoreFocus:o=_.identity,onOpenPopup:l=_.identity,disableRestoreFocus:s=!1,disableEnforceFocus:c=!1,single:u=!1,ungroup:p=!1,disabled:d=!1,hideCheckBox:m=!1}=e;const y=vQ(),[f,g]=(0,b.useState)(null),h=(0,b.useCallback)((()=>g(null)),[]),E=!!f,[T,x]=(0,b.useState)(""),S=(0,b.useCallback)((()=>x("")),[]),[C,w]=(0,b.useState)([]),A=(0,b.useCallback)((()=>w([])),[]),R=(0,b.useMemo)((()=>bQ(T,r)),[r,T]),N=(0,b.useMemo)((()=>(0,_.pipe)((0,_.when)((0,_.always)(p),(0,_.chain)((0,_.pipe)((0,_.prop)("items"),_.flatten,(0,_.map)((0,_.pick)(["item","level"]))))),WE)(R)),[p,R]),I=(0,b.useMemo)((()=>Math.max(hQ(R),308)),[R]),D=(0,_.pipe)((0,_.tap)((0,_.pipe)(A,S,h)),o),P=(0,b.useRef)(),k=(0,b.useCallback)(((e,t)=>{i({checked:t,attribute:e,index:t?C.length:gQ(C,e),selectedAttributes:C}),u?(w(t?[e]:[]),D({})):(w((e=>{let{attribute:t,selectedAttributes:r,checked:n}=e;return n?r.concat(t):r.filter((e=>!$B(t,e)))})({selectedAttributes:C,attribute:e,checked:t})),P.current&&P.current.focus())}),[C,i,u,D,P]),F=(0,b.useCallback)((e=>{let{onListItemClick:t,selectedAttributes:r}=e;return e=>{let{item:n,groupData:a}=e;const i=KB(n,r);t(dQ({},n,{groupName:a.groupName}),!i)}})({onListItemClick:k,selectedAttributes:C}),[k,C]),{focusIndex:j,handleKeyDown:U}=XE({items:N,open:E,onSelectFocusedItem:F,selectedItems:C,onClose:D});return v().createElement("div",{className:O()(y.selector,t),"data-reltio-id":"attribute-selector"},v().createElement(oQ,{value:n,getLabel:a,onSelectAttributeClick:e=>{l(),g(e.currentTarget)},disabled:d}),v().createElement(YE,{open:E,anchorEl:f,onClose:D,onSearch:x,title:L().text("Select attribute"),containerWidth:I,containerHeight:507,searchInputOnKeyDown:U,anchorOrigin:{horizontal:"right",vertical:"bottom"},searchInputRef:P,disableRestoreFocus:s,disableEnforceFocus:c},v().createElement(pQ,{items:N,onItemClick:k,selectedAttributes:C,width:I,height:400,focusIndex:j,hideCheckBox:m})))}));function OQ(){return OQ=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},OQ.apply(this,arguments)}const xQ=(0,b.memo)((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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["entityTypes","recommendedAttributes","showReferencedEntityAttributes","firstLevelAttributesFilter"]);const o=(0,xE.useSelector)(Cr().selectors.getMetadata),l=(0,xE.useSelector)(sp),s=(0,xE.useSelector)(Cr().selectors.getCanUserReadWorkflowDataTask),c=(0,xE.useSelector)(ku),u=(0,xE.useSelector)(Cr().selectors.getDataTenants),p=(0,b.useMemo)((()=>(0,_.pipe)(Kr,(0,_.when)((0,_.always)(!n),Xr),on(l))({allowedEntityTypes:c,firstLevelAttributesFilter:a},o,t,r,u,s)),[t,o,l,c,a,r,n,u,s]);return v().createElement(TQ,OQ({},i,{itemsGroups:p}))})),SQ=e=>{let{rowData:t,rowContext:{entityTypes:r,dispatchGroupAction:n},attributeSelectorProps:a={}}=e;const i=BK(),o=t&&t.id,l=(0,b.useCallback)((e=>{n(ny,o,e)}),[o,n]),s=(0,b.useCallback)((e=>(0,x.getSearchGroupAttributeLabel)({data:e})),[]);return v().createElement(xQ,{className:i.attributeSelect,value:t&&t.data,getLabel:s,entityTypes:r,onSelect:l,onRestoreFocus:a.onRestoreFocus,onOpenPopup:a.onOpen,disableRestoreFocus:a.disablePopoverRestoreFocus,disableEnforceFocus:a.disablePopoverRestoreFocus})};SQ.propTypes={rowData:VO.Xw,rowContext:OE().shape({entityTypes:OE().arrayOf(OE().string),dispatchGroupAction:OE().func}),attributeSelectorProps:OE().shape({onRestoreFocus:OE().func,onOpen:OE().func,disablePopoverRestoreFocus:OE().bool})};const CQ=(0,b.memo)(SQ);function wQ(){return wQ=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},wQ.apply(this,arguments)}const AQ=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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",wQ({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),v().createElement("defs",null,v().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"})),v().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},v().createElement("g",null,v().createElement("g",{transform:"translate(-2 -2)"},v().createElement("mask",{id:"svg397942461b",fill:"#fff"},v().createElement("use",{xlinkHref:"#svg397942461a"})),v().createElement("g",{mask:"url(#svg397942461b)",fill:"#000",fillOpacity:".54"},v().createElement("path",{d:"M0 0h24v24H0z"}))))))},RQ=e=>!(e&&e.data),_Q=e=>{let{rowData:t,rowContext:{dispatchGroupAction:r}}=e;const n=BK(),a=t&&t.id,i=(0,b.useCallback)((()=>r(oy,a)),[a,r]),o=(0,b.useCallback)((()=>r(ly,a)),[a,r]),l=(0,b.useCallback)((()=>r(Jm,a)),[a,r]);return t&&v().createElement("div",{className:O()(n.actions)},v().createElement(KO(),{title:L().text("Add"),placement:"bottom"},v().createElement(TK(),{className:n.actionIcon,onClick:l})),!RQ(t)&&v().createElement(KO(),{title:L().text("Duplicate"),placement:"bottom"},v().createElement("div",{className:n.actionIcon,tabIndex:-1},v().createElement(AQ,{onClick:o,tabIndex:-1}))),v().createElement(KO(),{title:L().text("Delete"),placement:"bottom"},v().createElement(kE(),{onClick:i,className:n.actionIcon})))};_Q.propTypes={rowData:VO.Xw,rowContext:OE().shape({dispatchGroupAction:OE().func})};const NQ=(0,b.memo)(_Q),IQ={BY_LABEL:(0,r(51774).c)({stringify:(0,_.prop)("label")})},DQ=e=>{let{className:t,attribute:r,textFieldInputRef:n,isDisabled:a,height:i,onChange:o}=e;const l=(0,_.pipe)(x.getFilterOptionLabel,SK.capitalize);return v().createElement(KH,{label:"",placeholder:L().text("Equals"),className:t,value:a?void 0:{value:r.filter,label:l(r.filter)},options:r&&r.data&&r.data.filterOptions.map((e=>({value:e,label:l(e)})))||[],height:i,onChange:o,isDisabled:a,filterOption:IQ.BY_LABEL,textFieldInputRef:n})};DQ.propTypes={className:OE().string,attribute:VO.Xw,textFieldInputRef:OE().object,isDisabled:OE().bool,onChange:OE().func,height:OE().number};const PQ=(0,b.memo)(DQ),kQ=e=>{let{rowData:t,rowContext:{dispatchGroupAction:r},textFieldInputRef:n}=e;const a=BK(),i=t&&t.id,o=(0,b.useCallback)((e=>r(sy,i,e.value)),[r,i]);return v().createElement(PQ,{className:a.filterSelect,attribute:t,textFieldInputRef:n,isDisabled:RQ(t),onChange:o})};kQ.propTypes={rowData:VO.Xw,rowContext:OE().shape({dispatchGroupAction:OE().func}),textFieldInputRef:OE().object};const LQ=(0,b.memo)(kQ);var FQ=r(24629);const jQ=(0,AE.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"}}),UQ=e=>{let{attribute:t,groupId:r,onChange:n,updateValues:a,filterValues:i}=e;const{values:o,data:{attrType:l,fieldName:s}={},id:c}=t,u=(0,xE.useSelector)((e=>ju(e,r,c)))||{},p=(0,xE.useSelector)((e=>Bu(e))),d=(0,xE.useSelector)((e=>((e,t)=>{const r=mp(e,t),n=Cr().selectors.getGlobalSearchRequestOptions(e);return Ge(r,[],n)})(e,s)));(0,b.useEffect)((()=>{p&&a()}),[o,p,d]),(0,b.useEffect)((()=>{p||a()}),[o,p]);const m=(0,b.useMemo)((()=>(0,_.propOr)([],0,o)),[o]),y=(0,b.useCallback)((0,_.pipe)(x.wrapInArray,n),[n]),{default:f,filtered:g}=u;return!f&&l?v().createElement("div",{className:"ValuesEditor-styles-loadingWrapper--_rOmn"},v().createElement(xv(),{size:20,className:"ValuesEditor-styles-loading--mLFVu"})):v().createElement(ZO,{values:m,defaultOptions:f,filteredOptions:g,onChange:y,getSuggestions:i,tabSelectsValue:!1,canLoadMore:!cc(t.data)})};UQ.propTypes={attribute:VO.Xw.isRequired,groupId:OE().string,onChange:OE().func,updateValues:OE().func,filterValues:OE().func};const MQ=UQ,VQ=e=>{let{attribute:t,dispatchGroupAction:r,groupId:n}=e;const{values:a,data:{attrType:i,fieldName:o}={},filter:l}=t,s=jQ(),c=(0,x.isTypeaheadAttrType)(i)||(0,_.allPass)([(0,_.propSatisfies)((0,_.either)(_.isNil,x.isEntityTypeUri),"uri"),(0,_.prop)("faceted"),(0,_.propEq)("type",x.DataTypes.TYPE_BLOB)])(i),u=(0,x.isEnumAttrType)(i)||(0,x.isLookupAttrType)(i),p=e=>r(cy,t.id,e);if((c||u)&&(0,x.isMultiValueOption)(l)){const e=()=>r(dy,t),a=e=>{let{value:n,pageNumber:a,currentOptions:i}=e;return r(uy,{attribute:t,value:n,debounceTime:500,pageNumber:a,currentOptions:i})};return v().createElement(MQ,{attribute:t,groupId:n,onChange:p,filterValues:a,updateValues:e})}{const e=u?{type:x.DataTypes.TYPE_STRING}:(0,x.getAttrDataTypeDefinition)(i),t=(0,x.getDataTypeDefinitionForFilterValue)(e,l),r=(0,x.isDateType)(t.type)&&!(0,x.isDateRangeFilterOption)(l)&&s.dateRoot||(0,x.isBooleanType)(t.type)&&s.boolRoot||s.root;return v().createElement(FQ.n,{filter:{filter:l,fieldName:o,values:a||[]},onChange:p,dataTypeDefinition:t,fullWidth:!0,TextFieldProps:{InputProps:{classes:{root:s.input},disableUnderline:(0,_.isNil)(a)||(0,_.isEmpty)((0,_.flatten)(a))}},color:"primary",booleanRadioEditorClassName:s.booleanRadioEditor,classes:{root:r},orientation:"horizontal"})}};VQ.propTypes={attribute:VO.Xw.isRequired,groupId:OE().string,dispatchGroupAction:OE().func};const BQ=(0,b.memo)(VQ),zQ=e=>{let{rowData:t,rowContext:{dispatchGroupAction:r,groupId:n}}=e;const a=BK(),i=t&&(0,x.checkIfOptionHasValues)(t.filter);return v().createElement("div",{className:a.valuesWrapper,"data-reltio-id":"advanced-search-values-editor-wrapper"},!RQ(t)&&i&&v().createElement(BQ,{attribute:t,dispatchGroupAction:r,groupId:n}))};zQ.propTypes={rowData:VO.Xw,rowContext:OE().shape({dispatchGroupAction:OE().func,groupId:OE().string})};const HQ=(0,b.memo)(zQ),YQ=e=>{let{rowData:t,rowContext:{dispatchGroupAction:r}}=e;const n=BK(),a=t&&t.id,i=t&&t.operator,o=(0,b.useCallback)((e=>r(ay,a,e)),[r,a]);return v().createElement("div",{className:n.logicOperatorContainer},i?v().createElement(FK,{className:n.logicOperator,value:i,onChange:o}):v().createElement("div",{className:O()(n.logicOperator,n.logicOperatorPlaceholder)},L().text("Where")))};YQ.propTypes={rowData:VO.Xw,rowContext:OE().shape({dispatchGroupAction:OE().func})};const WQ=(0,b.memo)(YQ);function GQ(){return GQ=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},GQ.apply(this,arguments)}const qQ=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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["showLogicOperator","group","dispatch","onAddEmptyGroup"]);const c=MK(),u=BK(),p=(0,b.useCallback)((()=>o({type:wa,payload:{groupId:r,id:(0,va.x0)()}})),[r,o]),d=(0,b.useCallback)((()=>o({type:Sa,payload:{groupId:r}})),[r,o]),m=(0,b.useCallback)((e=>o(((e,t)=>({type:xa,payload:{groupId:e,operator:t}}))(r,e))),[r,o]),y=(0,b.useCallback)((e=>o(((e,t)=>({type:Ta,payload:{groupId:e,entityTypes:t}}))(r,e))),[r,o]),f=(0,b.useCallback)((function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),a=1;a<t;a++)n[a-1]=arguments[a];return o(e(r,...n))}),[r,o]),g=(0,b.useRef)(null),h=(0,b.useRef)(null),E=(0,b.useRef)(null);E.current=n.length;const T=(0,b.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),g.current&&h.current!==E.current&&(g.current.querySelector("input").focus(),h.current=null)}),[]),x=(0,b.useCallback)((()=>{h.current=n.length}),[n.length]),S=(0,b.useMemo)((()=>[{text:L().text("Add set"),onClick:l,id:"-group-add-set"},{text:L().text("Duplicate set"),onClick:p,id:"-group-duplicate-set"},{text:L().text("Delete set"),onClick:d,id:"-group-delete-set"}]),[l,p,d]),C=(0,b.useMemo)((()=>({root:u.row})),[u]),w=(0,b.useMemo)((()=>({onRestoreFocus:T,onOpen:x,disablePopoverRestoreFocus:!!T})),[T,x]);return v().createElement(v().Fragment,null,v().createElement("div",GQ({className:c.container},s),v().createElement("div",{className:c.title},L().text("Set")),v().createElement("div",{className:c.entityTypeSelectorContainer},v().createElement(nQ,{classes:{root:c.entityTypeSelector},selectedEntityTypes:i,onChange:y})),v().createElement("div",{className:c.rows},v().createElement(PK,{rowClasses:C,rowsData:n,AttributeSelectorComponent:CQ,FilterSelectorComponent:LQ,ValuesEditorComponent:HQ,ActionsComponent:NQ,LogicOperatorComponent:WQ,filterSelectorRefIndex:h.current,filterSelectorRef:g,lastRowAttributeSelectorProps:w,entityTypes:i,groupId:r,dispatchGroupAction:f}),v().createElement("div",{className:c.actions},v().createElement(IU,{menuId:`query-builder-group-actions-${r}`,buttonComponent:jE.T,buttonProps:{icon:Hb(),size:"L","data-reltio-id":"reltio-search-query-builder-group-actions"},menuItems:S})))),t&&v().createElement("div",{className:c.logicOperator},v().createElement("div",{className:O()(c.verticalOperatorLine,c.upperLine)}),v().createElement("div",{className:O()(c.verticalOperatorLine,c.lowerLine)}),v().createElement(FK,{value:a,onChange:m})))};qQ.propTypes={showLogicOperator:OE().bool,group:OE().shape({id:OE().string,attributes:OE().arrayOf(VO.Xw),entityTypes:OE().arrayOf(OE().string),operator:OE().string}),onAddEmptyGroup:OE().func,dispatch:OE().func};const ZQ=(0,b.memo)(qQ),$Q=e=>{let{groups:t,uiConfigShowSearchByOv:r,dispatch:n}=e;const a=bK(),i=(0,b.useRef)(null),o=(0,b.useRef)(null),l=(0,b.useCallback)((()=>n({type:Ca,payload:{group:ki([])}})),[n]);return(0,b.useEffect)((()=>{if(0===t.length)l();else if(!(0,_.isNil)(o.current)&&o.current<t.length&&i.current){const e=i.current.childNodes;e[e.length-2].scrollIntoView({behavior:"smooth"})}o.current=t.length}),[t.length,l]),v().createElement("div",{className:a.scrollWrapper},v().createElement("div",{className:a.groupsContainer,ref:i},r&&v().createElement("div",{className:a.searchByOvContainer},v().createElement(FS,{variant:"queryGroups"})),t.map(((e,t,r)=>v().createElement(ZQ,{key:e.id,group:e,dispatch:n,showLogicOperator:t!==r.length-1,onAddEmptyGroup:l,"data-reltio-id":`reltio-search-advansed-search-group-builder-${t}`}))),v().createElement("div",{className:a.button},v().createElement("div",{className:O()(a.verticalOperatorLine,a.upperLine)}),v().createElement(yC(),{onClick:l,color:"primary",size:"small","data-reltio-id":"reltio-search-advanced-search-add-set-button"},v().createElement(TK(),{color:"primary",className:a.icon,fontSize:"small"}),L().text("ADD SET")))))};$Q.propTypes={groups:OE().array,dispatch:OE().func,uiConfigShowSearchByOv:OE().bool};const KQ=(0,xE.connect)((e=>{var t;return{groups:Lu(e),uiConfigShowSearchByOv:null!==(t=Cr().selectors.getShowSearchByOv(e))&&void 0!==t?t:_u(e)}}))($Q),QQ=Sr.search.actions.updateState({}),XQ=e=>{let{open:t,onClose:r}=e;const n=(0,xE.useDispatch)(),a=(0,b.useCallback)((()=>{r(),n(QQ)}),[n,r]),i=(0,b.useCallback)((()=>{r(),n(Rp(!0,QQ))}),[n,r]),o=(0,xE.useSelector)(qd),l=(0,xE.useSelector)(up),s=(0,xE.useSelector)(Zd),c=(0,xE.useSelector)($d),u=o?c&&!s:!l;return v().createElement(fZ,{open:t,title:L().text("Search filters cannot be displayed in Quick filters"),content:L().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:L().text("Clear search"),saveCaption:L().text("Save search"),disabledSave:u,onCancel:r,onDiscard:a,onSave:i})};XQ.propTypes={open:OE().bool,onClose:OE().func};const JQ=XQ,eX=e=>{let{metadata:t,attributesPresentation:r,lookups:n,groups:a,keyword:i,map:o,onClose:l,collapsed:s,isFullscreen:c,onCollapse:u,onExpand:p,onFullscreen:d,dataTenants:m,dispatch:y}=e;const f=bK(),[g,h]=(0,b.useState)(!1),E=(0,_.ifElse)((0,_.always)(Ic(t,a,m)),(0,_.pipe)(l,p),(()=>h(!0)));return v().createElement("div",{className:f.container},v().createElement($$,{onBackBtnClick:E}),v().createElement(KQ,null),v().createElement(fK,{groups:a,lookups:n,dispatch:y,metadata:t,attributesPresentation:r,hasMinSize:s,collapseBtnActive:!s,isFullscreen:c,onCollapseBtnClick:s?p:u,onFullScreenBtnClick:c?p:d,keyword:i,map:o}),v().createElement(JQ,{open:g,onClose:()=>h(!1)}))};eX.propTypes={metadata:x.MetadataType,lookups:OE().object,attributesData:OE().object,groups:OE().array,keyword:x.KeywordSearchType,map:zO,onClose:OE().func,collapsed:OE().bool,isFullscreen:OE().bool,onCollapse:OE().func,onExpand:OE().func,onFullscreen:OE().func,dispatch:OE().func,attributesPresentation:OE().object,dataTenants:OE().arrayOf(x.DataTenantType)};const tX=(0,xE.connect)((e=>({metadata:Cr().selectors.getMetadata(e),attributesPresentation:Cr().selectors.getAttributesPresentation(e),groups:Lu(e),lookups:Cr().selectors.getLookups(e),keyword:Cr().selectors.getSearchKeyword(e),map:Qu(e),dataTenants:Cr().selectors.getDataTenants(e)})))(eX),rX="calc(100% - 53px)",nX=e=>{let{isOpenAdvancedSearch:t,onCloseAdvancedSearch:r}=e;const n=OC(),[a,i]=(0,b.useState)(!1),[o,l]=(0,b.useState)("50%"),s=(0,b.useCallback)((()=>{i(!0),l("120px")}),[]),c=(0,b.useCallback)((()=>{i(!1),l("50%")}),[]),u=(0,b.useCallback)((e=>{let{percentageSize:t,isMaxSize:r,isMinSize:n}=e;i(n),l(r?rX:t)}),[]),p=(0,b.useCallback)((()=>{i(!1),l(rX)}),[]),d=v().createElement(v().Fragment,null,v().createElement(G$,null),v().createElement(pS(),{className:n.divider})),m=v().createElement(v().Fragment,null,d,v().createElement(tX,{collapsed:a,isFullscreen:o===rX,onClose:r,onCollapse:s,onExpand:c,onFullscreen:p}));return v().createElement(AC,{className:n.resizablePanesWrapper,orientation:"horizontal",size:t?o:0,minSize:120,maxSize:-53,allowResize:t,onChange:u},v().createElement("div",{className:n.pane},t&&m),v().createElement("div",{className:n.pane},!t&&d,v().createElement(WG,null)))};nX.propTypes={isOpenAdvancedSearch:OE().bool,onCloseAdvancedSearch:OE().func};const aX=nX;function iX(){return iX=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},iX.apply(this,arguments)}const oX=e=>v().createElement("svg",iX({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),v().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"})),lX=(0,AE.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)"}}))),sX=e=>{let{className:t}=e;const r=lX(),n=(0,w.xz)(),a=(0,w.fN)(),i=`${n}${a?" - "+a.toUpperCase():""}`;return v().createElement("div",{className:O()(r.labelWrapper,t)},v().createElement(oX,{className:r.tenantIcon,"data-reltio-id":"reltio-tenant-icon"}),v().createElement(DT(),{className:r.tenantLabel},i))},cX=(0,AE.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)"}}))),uX=()=>{const e=cX(),t=(0,xE.useSelector)(Cr().selectors.getMetadata),r=(0,xE.useSelector)(ih),n=(0,xE.useSelector)(nh),a=(0,xE.useSelector)(hh),i=(0,xE.useSelector)(Ep),o=(0,xE.useSelector)(Eh),l=(0,xE.useSelector)(fh),s=(0,x.getEntityTypeLabel)(t,{type:r}),c=(0,xE.useSelector)(gh),u=(0,xE.useDispatch)(),p=(()=>{const e=(0,xE.useSelector)(Cr().selectors.getMetadata),t=(0,xE.useSelector)(Cr().selectors.getLookups),r=(0,xE.useSelector)(Cr().selectors.getAttributesPresentation),n=(0,xE.useSelector)(Lu),a=(0,xE.useSelector)(Cr().selectors.getSearchKeyword),i=(0,xE.useSelector)(Qu),o=(0,xE.useSelector)(Cr().selectors.getDataTenants),l=(0,xE.useSelector)(Er),s=(0,xE.useSelector)(br),c=(0,b.useMemo)((()=>Object.values(xc(l,s))),[l,s]);return(0,b.useMemo)((()=>{const l=(0,_.isEmpty)(n)?hm(e,o,c):n;return(e=>!(1===e.length&&(0,_.isEmpty)(e[0].attributes)&&1===e[0].entityTypes.length))(l)||i||a?(0,x.buildReadableQuery)(e,r,t,l,a,i):[]}),[a,i,e,o,r,n,c,t])})();(0,b.useEffect)((()=>{0!==i&&(a&&o>=i||!a&&o<=0)&&u(xg())}),[a,i,o,u]);const d=(0,b.useCallback)((e=>u(((e,t)=>({type:Tl,payload:{filterText:e,debounceTime:300}}))(e))),[u]);return v().createElement(v().Fragment,null,v().createElement(sW(),{className:O()(e.container,{[e.borderBottom]:n>0})},v().createElement(DT(),{component:"span",className:e.entityTypeTitle},s),v().createElement(pS(),{orientation:"vertical",className:e.splitter}),v().createElement(DT(),{component:"span",className:e.profileNumber},L().number(o,"0,0")),v().createElement(DT(),{variant:"body2",component:"span",className:e.profileText},L().text(" profiles are selected for bulk edit.")),0===n&&v().createElement(v().Fragment,null,v().createElement(yC(),{color:"primary",className:e.clearButton,onClick:()=>{u(xg())},"data-reltio-id":"reltio-search-bulk-update-"+(a?"select-all-profiles":"clear-selection")},a?`${L().text("Select all")} ${L().number(i,"0,0")} ${L().text("profiles")}`:L().text("Clear selection")),v().createElement(zE,{classes:{root:e.searchBox},value:c,onSearch:d,"data-reltio-id":"reltio-search-bulk-update-search-input"}),v().createElement(pS(),{orientation:"vertical",className:e.splitter}),v().createElement(jb,{entityTypeUri:r,headColumns:l,onSelectColumns:e=>{const t=uu(e,l);u(wg(e)),t&&u(Og())},"data-reltio-id":"reltio-search-bulk-update-add-remove-columns"}))),0===n&&!(0,_.isEmpty)(p)&&v().createElement(sW(),{className:e.searchQueryContainer},L().text("Search query"),v().createElement(eK,{readableQuery:p,className:e.searchQuery})))},pX=(0,AE.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"}}),dX="1px solid #e4e4e4",mX=(0,AE.Z)((e=>({mainRowContent:{display:"flex",alignItems:"center","&>*":{marginRight:8}},row:{borderBottom:dX,padding:"17px 34px","&: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}}})));function yX(){return yX=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yX.apply(this,arguments)}const fX=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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",yX({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),v().createElement("defs",null,v().createElement("path",{id:"svg3533951039a",d:"M15 6v5l2 2v2h-4v4l-.992 1L11 19v-4H7v-2l2-2V6H8V4h8v2z"})),v().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},v().createElement("mask",{id:"svg3533951039b",fill:"#fff"},v().createElement("use",{xlinkHref:"#svg3533951039a"})),v().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg3533951039b)",d:"M0 0h24v24H0z"})))};function gX(){return gX=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gX.apply(this,arguments)}const hX=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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",gX({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),v().createElement("defs",null,v().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"})),v().createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},v().createElement("mask",{id:"svg1464898421b",fill:"#fff"},v().createElement("use",{xlinkHref:"#svg1464898421a"})),v().createElement("path",{fillOpacity:".54",fill:"#000",mask:"url(#svg1464898421b)",d:"M0 0h24v24H0z"})))},EX={flex:"0 0 auto"},bX=(0,AE.Z)({container:{flexGrow:1,display:"flex",alignItems:"center",margin:0},singleEditor:{marginRight:5,maxWidth:334},editor:{maxWidth:334,marginBottom:0},editorValue:{width:"100%",marginRight:"8px"},to:{color:"#696969",padding:"0 16px 0 7px"},type_Timestamp:EX,type_Boolean:EX,type_Date:EX}),vX=e=>{let{id:t,groupId:r,operation:n,operationParameters:a}=e;const i=bX(),o=(0,xE.useDispatch)(),l=a.attributeTypeData.attributeType,s=(0,b.useMemo)((()=>(0,x.createNewAttribute)({parentUri:"entities/fakeEntity",attributeType:l})),[l]),c=(0,b.useCallback)((e=>(0,_.mergeLeft)((0,_.ifElse)((0,_.hasPath)(["lookupCode"]),_.identity,(0,_.objOf)("value"))(e),s)),[s]),u=(0,b.useCallback)((e=>n=>o(Ng({id:t,groupId:r,operationParameters:{[e]:n.value}}))),[t,r,o]),p=Jg(n).map((e=>{const t=O()(i.editor,i[`type_${l.type}`]);return l.uri?v().createElement(gz,{key:e,className:t,mode:x.Mode.Editing,attributeType:l,attributeValue:c((0,_.path)([e],a)),onChangeAttribute:u(e)}):v().createElement("div",{key:e,className:O()(t,i.editorValue)},v().createElement(MB.Z,{fieldName:a.attributeTypeData.fieldName,value:a[e],dataTypeDefinition:(0,x.getAttrDataTypeDefinition)(l),onChange:(0,_.pipe)((0,_.objOf)("value"),u(e)),fullWidth:!0}))}));return 2===p.length&&p.splice(1,0,v().createElement("div",{key:"to",className:i.to},L().text("with"))),p.length?v().createElement("div",{className:O()(i.container,1===p.length&&i.singleEditor,i[`type_${l.type}`])},p):null};vX.propTypes={id:OE().string,groupId:OE().string,operation:OE().string,operationParameters:OE().object};const TX=(0,b.memo)(vX),OX=(0,_.curry)(((e,t,r)=>(0,_.assoc)(t,(0,_.prop)(e,r),(0,_.dissoc)(e,r)))),xX=(0,_.pipe)((0,_.pick)(["fieldName","title","pathToTitle","attrType"]),OX("attrType","attributeType")),SX=(0,_.unless)(_.isNil,OX("attributeType","attrType")),CX=e=>(0,_.last)(e.type.split("/")),wX=e=>({attributes:{[CX(e)]:[e]}}),AX=(e,t)=>{const r=CX(e);return t.attributes[r][0]},RX=e=>{let{attributeValue:t,onChange:r}=e;const n=(0,b.useRef)(t);n.current=t;const a=(0,b.useCallback)((e=>{let{value:t,attributeType:a,uri:i}=e;const o=wX(n.current),l=(0,x.editAttribute)({entity:o,attributeType:a,uri:i,value:t});r(AX(n.current,l))}),[r]),i=(0,b.useCallback)((e=>{let{attributeType:t,uri:a}=e;const i=wX(n.current),o=(0,x.removeAttribute)({entity:i,attributeType:t,uri:a});r(AX(n.current,o))}),[r]),o=(0,b.useCallback)((e=>{const t=wX(n.current),a=e.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a}=t;return(0,x.addAttribute)({entity:e,attributeType:r,parentUri:n,index:a})}),t);r(AX(n.current,a))}),[r]),l=(0,b.useCallback)((e=>{const t=(e=>{let{parentAttributeValue:t,uri:r}=e;const n=r.split(t.uri+"/")[1].split("/"),a=[];for(;n.length;){a.push("value");const e=n.shift(),r=n.shift();a.push(e);const i=(0,_.view)((0,_.lensPath)(a),t);if(!i)return null;const o=i.findIndex((e=>{let{uri:t}=e;return t.endsWith("/"+r)}));a.push(o)}return a.length?(a.push("pin"),(0,_.over)((0,_.lensPath)(a),_.not,t)):null})({parentAttributeValue:n.current,uri:e});t&&r(t)}),[r]);return{onChangeAttribute:a,onDeleteAttribute:i,onAddAttributes:o,onTogglePin:l}},_X=(0,AE.Z)((e=>({pinIcon:{marginRight:"-8px"},pinIconActive:{"& svg > g > path":{fill:e.palette.primary.main,fillOpacity:1}}}))),NX=e=>{let{onTogglePin:t,subAttributeValue:r}=e;const n=_X();return v().createElement(_b.k,{icon:fX,onClick:()=>t(r.uri),size:"L",className:O()(n.pinIcon,r.pin&&n.pinIconActive)})};NX.propTypes={onTogglePin:OE().func,subAttributeValue:OE().oneOfType([x.SimpleAttributeValueType,x.NestedAttributeValueType])};const IX=(0,_.curry)(((e,t,r)=>{let{attributeValue:n}=r;return n.uri!==e&&v().createElement(NX,{onTogglePin:t,subAttributeValue:n})}));function DX(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const PX=e=>{let{attributeType:t,attributeValue:r,onChange:n}=e;const a=(0,xE.useSelector)(Cr().selectors.getMetadata),i=(0,b.useMemo)((()=>{const e=(0,x.getAttributeTypeSubAttributes)(a,t),r=(0,x.createNewAttribute)({parentUri:"entities/fakeEntity",attributeType: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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){DX(e,t,r[t])}))}return e}({},r,{value:(0,x.createDefaultValues)({attributeTypes:e,parentUri:r.uri,mode:x.Mode.Editing})})}),[t,a]),o=r||i,{onChangeAttribute:l,onDeleteAttribute:s,onAddAttributes:c,onTogglePin:u}=RX({attributeValue:o,onChange:n}),p=(0,b.useCallback)(IX(o.uri,u),[o.uri,u]);return v().createElement(_z,{attributeType:t,attributeValue:o,showEmptyEditors:!0,mode:x.Mode.Editing,metadata:a,onAddAttributes:c,onDeleteAttribute:s,onChangeAttribute:l,hideDeleteButton:!0,additionalControlsRenderer:p})};PX.propTypes={attributeType:x.AttributeTypeType,attributeValue:x.NestedAttributeValueType,onChange:OE().func};const kX=PX,LX=(0,AE.Z)((()=>({entitySelector:{marginTop:"10px",width:"100%",maxWidth:"452px","& $entitySelectorInputLabel":{transform:"translate(12px, 13px)"}},entitySelectorInputLabel:{}}))),FX=e=>{let{attributeType:t,value:r,onChange:n}=e;const a=LX(),i=(0,xE.useDispatch)(),o=x.Mode.Editing,l=(0,x.getReferencedEntityTypeUriFromAttrType)(t),s=(0,xE.useSelector)(Cr().selectors.getMetadata),c=(0,xE.useSelector)((e=>Cr().selectors.getGlobalSearchRequestOptions(e,["ovOnly"]))),u=(0,b.useCallback)((e=>(0,x.referencedEntityAttributeTypesSelectionStrategy)(t,e)),[t]),p=(0,_.prop)("entityUri",r),d=(0,b.useCallback)((e=>{const{uri:t,type:r,label:a}=e;(0,x.isTempUri)(p)&&i(Sr.profile.modifiedEntities.actions.entityDeleted(p)),n((0,_.isEmpty)(e)?null:{entityUri:t,entityType:r,entityLabel:a})}),[i,n,p]),m=(0,b.useCallback)(((e,t)=>{const r=(0,x.getEntityType)(s,l),n=(0,_.pipe)(u,(0,x.getCreatableAttributeTypes)(o))(r),a=(0,x.createTemporaryEntity)({entityTypeUri:e,initValue:t,attributeTypes:n,metadata:s,mode:o});d(a),i(Sr.profile.modifiedEntities.actions.entityCreated(a))}),[i,d,u,s,o,l]);return v().createElement(fH,{className:a.entitySelector,entity:r,entityTypesUris:ec(l),metadata:s,max:20,globalSearchRequestOptions:c,onChange:d,onCreate:m,height:40,disableLinkClick:!0,attributeTypesSelectionStrategy:u,mode:o,TextFieldProps:{InputLabelProps:{classes:{marginDense:a.entitySelectorInputLabel}}}})};FX.propTypes={attributeType:x.AttributeTypeType,value:OE().shape({entityUri:OE().string,entityType:OE().string,entityLabel:OE().string}),onChange:OE().func};const jX=FX;function UX(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const MX=e=>{let{attributeType:t,attributeValue:r,onChange:n}=e;const a=(0,xE.useSelector)(Cr().selectors.getMetadata),i=(0,b.useMemo)((()=>{const e=(0,x.getEditableAttributeTypeSubAttributes)(a,t),r=(0,x.createNewAttribute)({parentUri:"entities/fakeEntity",attributeType: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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){UX(e,t,r[t])}))}return e}({},r,{value:(0,x.createDefaultValues)({attributeTypes:e,parentUri:r.uri,mode:x.Mode.Editing})})}),[t,a]),o=r||i,{onChangeAttribute:l,onDeleteAttribute:s,onAddAttributes:c,onTogglePin:u}=RX({attributeValue:o,onChange:n}),p=(0,b.useCallback)(IX(o.uri,u),[o.uri,u]);return v().createElement(TH,{attributeType:t,attributeValue:o,showEmptyEditors:!0,mode:x.Mode.Editing,metadata:a,onAddAttributes:c,onDeleteAttribute:s,onChangeAttribute:l,hideDeleteButton:!0,additionalControlsRenderer:p})};MX.propTypes={attributeType:x.AttributeTypeType,attributeValue:x.NestedAttributeValueType,onChange:OE().func};const VX=MX;function BX(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const zX={enabled:!0,queueSizeThreshold:5},HX=e=>{let{id:t,operation:r,operationParameters:n,groupId:a,groupAttributeType:i,hasConditions:o}=e;const l=mX(),s=(0,xE.useDispatch)(),c=(0,xE.useSelector)(ih),u=ec(c),p=(0,b.useCallback)((e=>{let{attribute:r,checked:n}=e;n&&s((e=>{let{id:t,groupId:r,attribute:n}=e;return{type:Cl,payload:{id:t,groupId:r,attribute:n}}})({id:t,groupId:a,attribute:xX(r)}))}),[t,a,s]),d=(0,b.useCallback)((e=>{s(Ng({id:t,groupId:a,operationParameters:{attributeValue:e}}))}),[s,t,a]),m=(0,b.useCallback)((()=>{s((e=>{let{id:t,groupId:r}=e;return{type:Fl,payload:{id:t,groupId:r}}})({id:t,groupId:a}))}),[t,a,s]),y=(0,b.useCallback)((()=>{s((e=>{let{id:t,groupId:r}=e;return{type:jl,payload:{id:t,groupId:r}}})({id:t,groupId:a}))}),[t,a,s]),f=(0,b.useCallback)((()=>{s(_g({id:t,groupId:a}))}),[t,a,s]),g=(0,b.useCallback)((e=>{s((e=>{let{id:t,groupId:r,operation:n}=e;return{type:wl,payload:{id:t,groupId:r,operation:n}}})({id:t,groupId:a,operation:e.value}))}),[t,a,s]),h=(0,_.prop)("pin",n),E=(0,_.prop)("addNestedAttribute",n),T=(0,_.prop)("attributeTypeData",n),S=(0,_.path)(["attributeTypeData","attributeType"],n),C=(0,x.isComplexAttribute)(S)&&[se.AddNew,se.ReplaceAllWith,se.RepointReference].includes(r),w=i&&S&&S.uri===i.uri,A=[se.AddNew,se.ReplaceAllWith,se.FindAndReplace].includes(r)&&!(null==S||!S.uri),R=a&&!w&&r===se.AddNew&&!(0,x.isReference)(i);(0,b.useEffect)((()=>{h&&!A&&m()}),[A,h,m]),(0,b.useEffect)((()=>{E&&!R&&y()}),[R,E,y]);const N=(0,b.useMemo)((()=>{return S?(e=S,t=o&&w,(0,_.cond)([[(0,_.both)(x.isNested,(0,_.always)(t)),(0,_.always)((0,_.without)([se.AddNew,se.ReplaceAllWith],de))],[x.isNested,(0,_.always)(de)],[(0,_.both)(x.isReference,(0,_.always)(t)),(0,_.always)((0,_.without)([se.AddNew],me))],[x.isReference,(0,_.always)(me)],[_.T,(0,_.always)(pe)]])(e)).map((e=>({value:se[e],label:ce[e]}))):[];var e,t}),[o,S,w]),I=N.find((e=>e.value===r));(0,b.useEffect)((()=>{!I&&N[0]&&T&&g(N[0])}),[N,I,T,g]);const D=r&&T,P=(0,b.useMemo)((()=>SX(T)),[T]),k=(0,b.useCallback)(i?Jr(i):(0,_.ifElse)(en,(0,_.pipe)((0,_.pathEq)(["fieldName"],"tags")),(0,_.pipe)((0,_.prop)("attrType"),(0,_.both)((0,_.complement)(x.isImage),(0,_.complement)(x.isAnalyticAttribute)))),[i]),F=(0,b.useCallback)((e=>(0,x.getSearchGroupAttributeLabel)({data:e})),[]);return v().createElement("div",{className:O()(l.row,{[l.withoutLine]:!!a})},v().createElement("div",{className:l.mainRowContent},v().createElement(xQ,{className:l.attrSelector,single:!0,showReferencedEntityAttributes:!1,entityTypes:u,value:P,onSelect:p,firstLevelAttributesFilter:k,ungroup:!!a,getLabel:F}),v().createElement(KH,{label:"",isDisabled:!P,placeholder:L().text("Select operation"),className:l.operationSelector,value:I,options:N,height:40,onChange:g}),D&&v().createElement(v().Fragment,null,!C&&v().createElement(TX,{id:t,groupId:a,operation:r,operationParameters:n}),v().createElement("div",{className:l.icons},A&&v().createElement(_b.k,{className:O()(l.actionIcon,h&&l.actionIconActive),size:"M",tooltipTitle:L().text("Make this Operational Value"),icon:fX,onClick:m}),R&&v().createElement(_b.k,{className:O()(l.actionIcon,E&&l.actionIconActive),size:"M",tooltipTitle:L().text("Create parent attribute if none exists"),icon:hX,onClick:y}),v().createElement(_b.k,{size:"M",tooltipTitle:L().text("Delete"),icon:kE(),onClick:f})))),D&&C&&v().createElement(XB.Provider,{value:zX},r===se.RepointReference?v().createElement(jX,{attributeType:S,value:n.attributeValue,onChange:d}):(0,x.isNested)(S)?v().createElement(kX,{attributeType:S,attributeValue:n.attributeValue,onChange:d}):(0,x.isReference)(S)?v().createElement(VX,{attributeType:S,attributeValue:n.attributeValue,onChange:d}):null))};HX.propTypes=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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){BX(e,t,r[t])}))}return e}({},HO,{groupId:OE().string,groupAttributeType:x.AttributeTypeType,hasConditions:OE().bool});const YX=(0,b.memo)(HX);var WX=r(80510),GX=r.n(WX);const qX=(0,AE.Z)((e=>({complexRow:{borderBottom:dX,padding:"10px 34px 17px","&:last-child":{borderBottom:"none"}},header:{display:"flex",alignItems:"center",marginBottom:"4px"},actionsBlock:{marginTop:"2px",marginLeft:"-34px",marginRight:"-34px"},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"}}))),ZX=(0,AE.Z)((e=>({caption:{color:e.palette.text.secondary},conditions:{backgroundColor:"rgba(0,0,0,0.032)",padding:"20px 15px",margin:"7px 0"}}))),$X="40px",KX=(0,AE.Z)((()=>({row:{"&:hover $actions":{opacity:1}},logicOperatorContainer:{maxHeight:"40px"},attributeSelect:{width:"254px",height:$X},filterSelect:{width:"190px"},valuesWrapper:{width:"100%",display:"flex",minHeight:$X,alignItems:"flex-start",boxSizing:"border-box"},actions:{opacity:"0",transition:"opacity 0.3s",paddingTop:"8px",height:"24px",display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:"0"}})));function QX(){return QX=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},QX.apply(this,arguments)}const XX=(0,b.memo)((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,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeType","showReferencedEntityAttributes","subattributesGroupTitle","additionalItemsGroups"]);const o=(0,xE.useSelector)(Cr().selectors.getMetadata),l=t.uri.split("/").slice(0,3).join("/"),s=ec(l),c=(0,b.useCallback)(Jr(t),[t]),u=(0,b.useMemo)((()=>(0,_.pipe)(Kr,(0,_.when)((0,_.always)(!r),Xr),(0,_.map)((0,_.evolve)({attributes:(0,_.pathOr)([],[0,"children"]),title:(0,_.when)((0,_.always)(n),(0,_.always)(n))})),(0,_.when)((0,_.always)(a),(0,_.concat)(a)))({firstLevelAttributesFilter:c},o,s)),[a,n,r,s,o,c]);return v().createElement(TQ,QX({},i,{ungroup:!a,itemsGroups:u}))}));function JX(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=n.concat(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 in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const tJ=(e,t)=>St("referenced_entity_id_group",L().text("Profile"),[JX({},xt(JX({title:(0,x.getEntityTypeLabel)(t,{type:(0,x.getReferencedEntityTypeUriFromAttrType)(e)}),fieldName:fe},e)),{enforcedFilterOptions:[x.FilterOptions.EQUALS]})]),rJ=e=>{let{rowData:t,rowContext:{attributeType:r,dispatchGroupAction:n},attributeSelectorProps:a={}}=e;const i=KX(),o=(0,xE.useSelector)(Cr().selectors.getMetadata),l=t&&t.id,s=(0,b.useMemo)((()=>(0,x.isReference)(r)?[tJ(r,o)]:null),[r,o]),c=(0,b.useCallback)((e=>{n(kg,l,e)}),[l,n]);return v().createElement(XX,{className:i.attributeSelect,value:t&&t.data,attributeType:r,additionalItemsGroups:s,subattributesGroupTitle:(0,x.isReference)(r)?L().text("Reference attributes"):"",onSelect:c,onRestoreFocus:a.onRestoreFocus,onOpenPopup:a.onOpen,disableRestoreFocus:a.disablePopoverRestoreFocus,disableEnforceFocus:a.disablePopoverRestoreFocus})};rJ.propTypes={rowData:VO.Xw,rowContext:OE().shape({attributeType:x.AttributeTypeType,dispatchGroupAction:OE().func}),attributeSelectorProps:OE().shape({onRestoreFocus:OE().func,onOpen:OE().func,disablePopoverRestoreFocus:OE().bool})};const nJ=(0,b.memo)(rJ),aJ=e=>!(e&&e.data),iJ=e=>{let{rowData:t,rowContext:{dispatchGroupAction:r},textFieldInputRef:n}=e;const a=KX(),i=t&&t.id,o=(0,b.useCallback)((e=>r(Fg,i,e.value)),[r,i]);return v().createElement(PQ,{height:40,className:a.filterSelect,attribute:t,textFieldInputRef:n,isDisabled:aJ(t),onChange:o})};iJ.propTypes={rowData:VO.Xw,rowContext:OE().shape({dispatchGroupAction:OE().func}),textFieldInputRef:OE().object};const oJ=(0,b.memo)(iJ),lJ=(0,AE.Z)({input:{margin:0,borderRadius:"4px"},root:{borderRadius:"4px 4px 0 0",padding:0,display:"flex",alignItems:"center",margin:0},entitySelector:{width:"100%","& $entitySelectorInputLabel":{transform:"translate(12px, 13px)"}},entitySelectorInputLabel:{}}),sJ=(0,_.pathEq)(["data","fieldName"],fe),cJ=e=>{let{condition:t,dispatchGroupAction:r}=e;const{values:n=[],data:{attrType:a,fieldName:i}={},filter:o}=t,l=lJ(),s=(0,b.useCallback)((e=>r(jg,t.id,e)),[r,t.id]),c=(0,x.getAttrDataTypeDefinition)(a),u=(0,x.getDataTypeDefinitionForFilterValue)(c,o),p=(0,xE.useSelector)(Cr().selectors.getMetadata),d=(0,xE.useSelector)((e=>Cr().selectors.getGlobalSearchRequestOptions(e,["ovOnly"]))),m=(0,b.useCallback)((e=>{let{uri:t,type:r,label:n}=e;return s([{entityUri:t,entityType:r,entityLabel:n}])}),[s]);return sJ(t)?v().createElement(fH,{className:l.entitySelector,entity:n[0],entityTypesUris:ec((0,x.getReferencedEntityTypeUriFromAttrType)(a)),metadata:p,max:20,globalSearchRequestOptions:d,onChange:m,height:40,disableLinkClick:!0,TextFieldProps:{InputLabelProps:{classes:{marginDense:l.entitySelectorInputLabel}}}}):v().createElement(FQ.n,{filter:{filter:o,fieldName:i,values:n||[]},onChange:s,dataTypeDefinition:u,fullWidth:!0,TextFieldProps:{InputProps:{classes:{root:l.input}}},color:"primary",classes:{root:l.root},orientation:"horizontal"})};cJ.propTypes={condition:VO.Xw.isRequired,dispatchGroupAction:OE().func};const uJ=(0,b.memo)(cJ),pJ=e=>{let{rowData:t,rowContext:{dispatchGroupAction:r}}=e;const n=KX(),a=aJ(t),i=t&&(0,x.checkIfOptionHasValues)(t.filter);return v().createElement("div",{className:n.valuesWrapper},!a&&i&&v().createElement(uJ,{condition:t,dispatchGroupAction:r}))};pJ.propTypes={rowData:VO.Xw,rowContext:OE().shape({dispatchGroupAction:OE().func})};const dJ=(0,b.memo)(pJ),mJ=e=>{let{rowData:t,rowContext:{dispatchGroupAction:r}}=e;const n=KX(),a=t&&t.id,i=(0,b.useCallback)((()=>r(Lg,a)),[a,r]);return t&&v().createElement("div",{className:n.actions},v().createElement(_b.k,{tooltipTitle:L().text("Delete"),tooltipPlacement:"bottom",icon:kE(),size:"M",onClick:i}))};mJ.propTypes={rowData:VO.Xw,rowContext:OE().shape({dispatchGroupAction:OE().func})};const yJ=(0,b.memo)(mJ),fJ=e=>{let{attributeType:t,conditions:r,groupId:n}=e;const a=ZX(),i=KX(),o=(0,xE.useDispatch)(),l=(0,b.useCallback)((function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),a=1;a<t;a++)r[a-1]=arguments[a];return o(e(n,...r))}),[n,o]),s=(0,b.useMemo)((()=>({root:i.row,logicOperatorContainer:i.logicOperatorContainer})),[i]);return v().createElement(v().Fragment,null,v().createElement(DT(),{variant:"caption",component:"div",className:a.caption},L().text("If the following conditions are met")),v().createElement(PK,{className:a.conditions,rowClasses:s,rowsData:r,AttributeSelectorComponent:nJ,FilterSelectorComponent:oJ,ValuesEditorComponent:dJ,ActionsComponent:yJ,attributeType:t,dispatchGroupAction:l}),v().createElement(DT(),{variant:"caption",component:"div",className:a.caption},L().text("Then perform the change")))};fJ.propTypes={attributeType:x.AttributeTypeType,conditions:OE().arrayOf(VO.Xw),groupId:OE().string};const gJ=fJ;function hJ(){return hJ=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hJ.apply(this,arguments)}const EJ=e=>{let{id:t,fieldName:r,actions:n,conditions:a}=e;const i=qX(),o=(0,xE.useDispatch)(),l=(0,xE.useSelector)(ih),s=(0,xE.useSelector)(Cr().selectors.getMetadata),c=(0,b.useMemo)((()=>{const e=(0,x.searchUriToAttrUri)(r,l);return(0,x.findAttributeTypeByUri)(s,e,l)}),[s,r,l]),u=(0,b.useCallback)((()=>o({type:_l,payload:t})),[t,o]),p=!!a,d=((e,t)=>(0,_.any)((0,_.both)((0,_.pipe)((0,_.prop)("operation"),(0,_.includes)(_.__,[se.AddNew,se.ReplaceAllWith])),(0,_.pathEq)(["operationParameters","attributeTypeData","attributeType","uri"],t.uri)))(e))(n,c);(0,b.useEffect)((()=>{p||0!==n.length||o(_g({id:t}))}),[t,p,n.length,o]);const m=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return v().createElement(YX,hJ({key:e.id},e,{groupId:t,groupAttributeType:c,hasConditions:p}))};return v().createElement("div",{className:i.complexRow},v().createElement("div",{className:i.header},v().createElement("div",{className:i.attributeLabel},c.label),v().createElement(yC(),{disabled:d,color:"primary",className:i.conditionsToggleButton,onClick:u},p?v().createElement(v().Fragment,null,v().createElement(GX(),{className:i.conditionsToggleIcon}),L().text("Remove")," "):v().createElement(v().Fragment,null,v().createElement(TK(),{className:i.conditionsToggleIcon}),L().text("Add")," "),L().text("conditions"))),a&&v().createElement(gJ,{attributeType:c,conditions:a,groupId:t}),v().createElement("div",{className:i.actionsBlock},n.map(m),m()))};EJ.propTypes=YO;const bJ=(0,b.memo)(EJ);function vJ(){return vJ=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vJ.apply(this,arguments)}const TJ=e=>{const t=(e=>e.actions?bJ:YX)(e);return v().createElement(t,vJ({key:e.id},e))},OJ=()=>{const e=pX(),t=(0,xE.useSelector)(vh);return v().createElement("div",{className:e.wrapper},v().createElement("div",{className:e.container},t.map(TJ),v().createElement(YX,null)))};var xJ=r(99261),SJ=r.n(xJ),CJ=r(26518),wJ=r.n(CJ),AJ=r(60158),RJ=r.n(AJ),_J=r(61887),NJ=r.n(_J);const IJ=(0,AE.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)"},progressButtonWrapper:{position:"relative"},progress:{position:"absolute",left:"calc(50% - 12px)",top:"calc(50% - 12px)"},errorLabel:{color:"#dd2c00 !important"},warningLabel:{color:"#f9a825 !important"}})));function DJ(){return DJ=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},DJ.apply(this,arguments)}const PJ=e=>{let{isInProgress:t,disabled:r,circularColor:n="primary",className:a,children:i,onClick:o}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["isInProgress","disabled","circularColor","className","children","onClick"]);const s=IJ();return v().createElement(yC(),DJ({},l,{className:O()(s.progressButtonWrapper,a),onClick:o,disabled:r||t}),i,t&&v().createElement("div",{className:s.progress,"data-reltio-id":"reltio-circular-load-indicator"},v().createElement(xv(),{size:24,color:n})))},kJ=e=>{let{activeStep:t,steps:r,isPending:n=!1,shouldCompleteSteps:a=!0,onConfirm:i,onChangeStep:o}=e;const l=IJ(),s=t===r.length-1,c=e=>{e!==t&&o(e)},u=(0,_.propOr)(!0,"enabled"),p=e=>{if(e>0){const t=e-1;u(r[t])?c(t):p(t)}},d=e=>{if(e<r.length-1){const t=e+1;u(r[t])?c(t):d(t)}},m=s&&!!i,y=m||(0,_.any)(u,(0,_.drop)(t+1,r));return v().createElement("div",{className:l.container},v().createElement("div",{className:l.placeholder}),v().createElement(SJ(),{nonLinear:!0,activeStep:t,className:l.stepper},r.map(((e,r)=>{let{label:i,enabled:o=!0,hasError:s,hasWarning:u}=e;const p=!o||n,d=a&&!p&&r<t;return v().createElement(wJ(),{key:i,completed:d,disabled:p},v().createElement(RJ(),{className:l.stepButton,onClick:()=>c(r),"data-reltio-id":`reltio-search-bulk-update-${r}`},v().createElement(NJ(),{error:s||u,classes:{error:s?l.errorLabel:l.warningLabel}},i)))}))),v().createElement("div",{className:l.buttons},t>0&&v().createElement(yC(),{variant:"outlined",className:l.backButton,onClick:()=>p(t),disabled:n,"data-reltio-id":"reltio-search-bulk-update-back"},L().text("Back")),v().createElement(PJ,{variant:"contained",color:"primary",disabled:!y,isInProgress:n,onClick:s?i:()=>d(t),"data-reltio-id":"reltio-search-bulk-update-"+(s?"confirm":"continue")},m?L().text("Confirm"):L().text("Continue"))))},LJ=()=>{const e=(0,xE.useDispatch)(),t=(0,xE.useSelector)(nh),r=(0,xE.useSelector)(bh),n=(0,xE.useSelector)(rh),a=!(0,_.isNil)(n),i=(0,xE.useSelector)(xh),o=(0,xE.useSelector)(Sh),l=[{label:L().text("Select profiles")},{label:L().text("Select operation"),enabled:r},{label:L().text("Define changes"),enabled:r&&a&&n===oe},{label:L().text("Review changes"),enabled:r&&a&&(i||n===le)}];return v().createElement(kJ,{activeStep:t,steps:l,isPending:o,onChangeStep:t=>e((e=>({type:ul,payload:e}))(t)),onConfirm:()=>e({type:Ul})})},FJ=(0,AE.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"}}))),jJ=e=>{let{children:t,onClose:r}=e;const n=FJ();return v().createElement(oW(),{position:"static",color:"default",className:n.appBar},v().createElement(sW(),{className:n.toolbar},v().createElement(_b.k,{edge:"start",tooltipTitle:L().text("Close"),"aria-label":L().text("Close"),icon:kE(),onClick:r,className:n.closeButton,size:"L","data-reltio-id":"reltio-search-bulk-update-close"}),v().createElement(DT(),{variant:"h6",className:n.title},t)),v().createElement(sW(),{className:n.toolbar},v().createElement(LJ,null)))};jJ.propTypes={children:OE().node,onClose:OE().func};const UJ=jJ,MJ=(0,AE.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"}}))),VJ=(0,_.equals)(ae);function BJ(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const zJ=()=>{const e=MJ(),t=(0,xE.useDispatch)(),r=(0,xE.useSelector)(Cr().selectors.getMetadata),n=(0,xE.useSelector)(ih),a=(0,xE.useSelector)(fh),i=(0,xE.useSelector)(ch),o=(0,xE.useSelector)(mh),l=(0,xE.useSelector)(yh),s=(0,xE.useSelector)(lh),c=(0,xE.useSelector)(ph),u=(0,xE.useSelector)(dh),p=(0,xE.useSelector)(ah),d=(0,xE.useSelector)(uh),m=(0,xE.useSelector)(sh),y=(0,b.useMemo)((()=>((e,t,r)=>(0,_.pipe)((0,_.map)((0,_.prop)("uri")),VJ(e)?(0,_.intersection)(t):(0,_.without)(t))(r))(m,d,i)),[m,d,i]),f=((e,t)=>0!==e.length&&(e.length===t.length||null))(y,i),g=(0,b.useMemo)((()=>Jc(r,n,a)),[r,n,a]),h=(0,b.useCallback)((e=>{let{field:r,order:n}=e;return t((e=>{let{field:t,order:r}=e;return{type:El,payload:{field:t,order:r}}})({field:n?r:null,order:n}))}),[t]),E=(0,b.useCallback)((e=>{let{what:r,where:n}=e;const i=(0,_.move)(r.columnIndex,n.columnIndex,a);t(wg(i))}),[t,a]),T=(0,b.useCallback)((e=>{let{columns:r}=e;const n=uu(r,a);t(wg(r)),n&&t(Og())}),[t,a]),O=(0,b.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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){BJ(e,t,r[t])}))}return e}({},t,{size:e[r].size})));t(wg(r))}),[t,a]),x=(0,b.useCallback)(((e,r)=>{t(e?((e,t)=>({type:ml,payload:{uri:e,checked:t}}))(e,r):{type:yl,payload:!f})}),[f,t]),S=(0,b.useRef)(null);return v().createElement("div",{className:e.tableContainer},p&&v().createElement(GC.Z,null),v().createElement(ET,{entities:i,entityTypeUri:n,headColumns:a,additionalColumns:g,canCheck:!0,onCheck:x,checkedEntitiesUris:y,headerCheckboxState:f,dndColumnReorderingEnabled:!0,sortField:o,sortOrder:l,onSort:h,onReorderingColumn:E,onChangeColumnsList:T,onChangeColumnsSize:O,entitiesTableRef:S}),s>j[0]&&v().createElement("div",{className:e.pagination},v().createElement(FC.Z,{count:s,rowsPerPageOptions:j,rowsPerPage:u||j[0],page:c||0,onChangePage:e=>t(Cg(e)),onChangeRowsPerPage:e=>t((e=>({type:gl,payload:e}))(e)),basicTableRef:S})))},HJ=(0,AE.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"}}))),YJ=()=>{const e=HJ(),t=(0,xE.useDispatch)(),r=(0,xE.useSelector)(rh),n=(0,xE.useSelector)(Cr().selectors.getCanUserDeleteProfiles);(0,b.useEffect)((()=>{(0,_.isNil)(r)&&t(Rg(oe))}),[r,t]);const a=(0,_.pipe)(SE.NA,Rg,t);return v().createElement("div",{className:e.tableContainer},v().createElement(DT(),{className:e.title},L().text("Choose Bulk Update Operation")),v().createElement(BS(),{value:r,onChange:a},v().createElement(HS(),{classes:{label:e.label},value:oe,control:v().createElement(MS(),{className:e.radioButton}),label:L().text("Update Profiles - Update attribute values of selected profiles")}),v().createElement(HS(),{disabled:!n,classes:{label:e.label},value:le,control:v().createElement(MS(),{className:e.radioButton}),label:L().text("Delete Profiles - Delete selected profiles")})))};var WJ=r(49850),GJ=r.n(WJ),qJ=r(28012),ZJ=r.n(qJ),$J=r(18878),KJ=r.n($J),QJ=r(70918),XJ=r.n(QJ),JJ=r(51159),e0=r.n(JJ),t0=r(35681),r0=r.n(t0);const n0=e=>{let{value:t,attributeType:r,lookups:n}=e;return(0,x.isLookupAttrType)(r)&&"string"==typeof t&&(t={lookupCode:t,value:(0,x.getResolvedLookupValue)(n,(0,x.getAttrTypeLookupCode)(r),t)}),v().createElement(ev.x,{dataTypeDefinition:(0,x.getAttrDataTypeDefinition)(r),value:t})};n0.propTypes={value:OE().any,attributeType:x.AttributeTypeType,lookups:OE().object};const a0=n0,i0=e=>{let{operation:t}=e;return v().createElement(v().Fragment,null,ce[t])},o0=e=>{let{conditions:t,attributesPresentation:r,metadata:n,lookups:a}=e;if((0,x.isEmptyValue)(t))return v().createElement(v().Fragment,null,"-");const i=(0,x.buildAttributesReadableQuery)(n,r,a,t,!1);return v().createElement(eK,{readableQuery:i})},l0="8px",s0="1px",c0="1px solid #AFD4E9",u0=(0,AE.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:s0,left:l0,top:0,borderLeft:c0}},scaffoldHalfVert:{"&:before":{content:'""',position:"absolute",display:"block",boxSizing:"border-box",height:"50%",width:s0,left:l0,top:0,borderLeft:c0}},scaffoldHor:{"&:after":{content:'""',position:"absolute",display:"block",boxSizing:"border-box",height:s0,width:"5px",left:l0,top:"50%",borderBottom:c0}},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%"}}))),p0=e=>{let{attributeTypeData:{pathToTitle:t,title:r}}=e;const n=u0();return Boolean(t&&t.length>2)?v().createElement(rx,{placement:"bottom-start",pathToTitle:t},v().createElement("span",{className:n.nestedLabel},r)):r};p0.propTypes={attributeTypeData:OE().shape({title:OE().string,attributeType:x.AttributeTypeType})};const d0=p0;function m0(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r,n,a={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(a[r]=e[r]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function y0(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=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){f0(e,t,r[t])}))}return e}function f0(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const g0={EMPTY:"empty",FULL_VERT:"full_vert",FULL_VERT_HOR:"full_vert_hor",HALF_VERT_HOR:"half_vert_hor"},h0=e=>e.map(((t,r)=>(e=>{let{hasLowerSubAttrs:t,isFirstValue:r,isLastScaffold:n}=e;const a=n&&r;return t?a?g0.FULL_VERT_HOR:g0.FULL_VERT:a?g0.HALF_VERT_HOR:g0.EMPTY})(y0({},t,{isLastScaffold:r===e.length-1})))),E0=e=>{let{operation:t,operationParameters:r}=e;return(0,x.wrapInArrayIfNeeded)(y0({},r,{operation:t}))},b0=function(e,t){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];const a=(0,x.findAttributeTypeByUri)(e,t.type),i=a.label||a.name,o={attributeTypeData:{attributeType:a,title:i,pathToTitle:[...r,i]},scaffolds:h0(n),pin:t.pin};if((0,x.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 b0(e,t,[...r,i],[...n,s])}))));return[o,...l]}return[y0({},o,{attributeValue:(0,x.getAttributeValue)(t)})]},v0=(0,_.curry)(((e,t)=>{let{operation:r,operationParameters:n}=t;const{attributeValue:a,attributeTypeData:i}=n,o=m0(n,["attributeValue","attributeTypeData"]),[l,...s]=b0(e,a,i.pathToTitle.slice(0,-1));return[y0({},l,{operation:r},o),...s]})),T0=(0,_.curry)(((e,t)=>{let{operation:r,operationParameters:n}=t;const{attributeValue:a,attributeTypeData:i}=n,o=m0(n,["attributeValue","attributeTypeData"]),[l,...s]=b0(e,a,i.pathToTitle.slice(0,-1)),{label:c,refEntity:u}=a,[{objectURI:p,type:d}]=u;return[y0({},l,{operation:r},o,{attributeValue:{entityUri:p,entityLabel:c,entityType:d}}),...s]})),O0=(0,_.curry)(((e,t)=>(0,_.cond)([[Kg,v0(e)],[Qg,T0(e)],[_.T,E0]])(t))),x0=(0,_.curry)(((e,t)=>(0,_.pipe)((0,_.defaultTo)([]),(0,_.chain)((0,_.ifElse)(Mg,(0,_.pipe)(Vg,x0(e)),O0(e))))(t))),S0=e=>{let{scaffold:t}=e;const r=u0();return v().createElement("div",{className:O()(r.scaffold,{[r.scaffoldFullVert]:t===g0.FULL_VERT||t===g0.FULL_VERT_HOR,[r.scaffoldHalfVert]:t===g0.HALF_VERT_HOR,[r.scaffoldHor]:t===g0.FULL_VERT_HOR||t===g0.HALF_VERT_HOR})})};S0.propTypes={scaffold:OE().oneOf((0,_.values)(g0))};const C0=e=>{let{scaffolds:t}=e;const r=u0();return v().createElement("div",{className:r.scaffoldsContainer},t.map(((e,t)=>v().createElement(S0,{key:t,scaffold:e}))))};C0.propTypes={scaffolds:OE().arrayOf(S0.propTypes.scaffold)};const w0=C0,A0=e=>{let{children:t}=e;const r=u0();return v().createElement("div",{className:r.noWrapContainer},t)};A0.propTypes={children:OE().node};const R0=A0,_0=e=>{let{pin:t,addParent:r}=e;const n=u0();return v().createElement(R0,null,v().createElement("div",{className:O()(n.optionContainer,{[n.opaque]:!t})},v().createElement(fX,null)),v().createElement("div",{className:O()(n.optionContainer,{[n.opaque]:!r})},v().createElement(hX,null)))};_0.propTypes={pin:OE().bool,addParent:OE().bool};const N0=_0,I0=e=>{let{entity:{entityLabel:t,entityUri:r},attributeType:n}=e;const a=u0(),i=(0,xE.useSelector)((e=>Cr().selectors.getModifiedEntity(e,r)))||null,o=(0,xE.useSelector)(Cr().selectors.getMetadata),l=(0,b.useCallback)((()=>{const e=(0,x.getReferencedEntityTypeUriFromAttrType)(n),t=(0,x.getEntityType)(o,e);return(0,x.evaluateDeepEntityLabel)(i,t.dataLabelPattern)}),[n,o,i]),s=i?l():t;return v().createElement(R0,null,(0,x.getLabel)(s),(0,x.isTempUri)(r)&&v().createElement("div",{className:a.newIcon},L().text("New")))};I0.propTypes={entity:x.ConnectionEntityType,attributeType:x.AttributeTypeType};const D0=I0,P0=(0,AE.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%"}}))),k0=()=>{const e=P0(),t=(0,xE.useSelector)(Th),r=(0,xE.useSelector)(Cr().selectors.getMetadata),n=(0,xE.useSelector)(Cr().selectors.getAttributesPresentation),a=(0,xE.useSelector)(Cr().selectors.getLookups),i=(0,b.useMemo)((()=>x0(r,t)),[t,r]);return v().createElement(XJ(),{className:e.tableContainer,component:Zj()},v().createElement(GJ(),{className:e.table},v().createElement(e0(),null,v().createElement(r0(),null,v().createElement(KJ(),{className:e.attributeColumn},L().text("Attribute")),v().createElement(KJ(),{className:e.conditionColumn},L().text("Condition")),v().createElement(KJ(),{className:e.operatorColumn},L().text("Operator")),v().createElement(KJ(),{className:e.valueColumn,colSpan:2}),v().createElement(KJ(),{className:e.valueColumn}),v().createElement(KJ(),{className:e.optionsColumn}))),v().createElement(ZJ(),null,i.map(((e,t)=>{let{scaffolds:i,attributeTypeData:o,conditions:l,operation:s,attributeValueToFind:c,attributeValue:u,pin:p,addNestedAttribute:d}=e;const m=!(0,_.isNil)(u),y=!(0,_.isNil)(c);return v().createElement(r0(),{key:t},v().createElement(KJ(),null,v().createElement(R0,null,i&&v().createElement(w0,{scaffolds:i}),v().createElement(d0,{attributeTypeData:o}))),v().createElement(KJ(),null,v().createElement(o0,{attributesPresentation:n,metadata:r,lookups:a,conditions:l})),v().createElement(KJ(),null,s&&v().createElement(i0,{operation:s})),v().createElement(KJ(),null,y&&v().createElement(a0,{lookups:a,attributeType:o.attributeType,value:c})),v().createElement(KJ(),{align:"right"},y&&m&&v().createElement(R0,null,v().createElement("span",null,L().text("with")))),v().createElement(KJ(),null,m&&((0,x.isReference)(o.attributeType)?v().createElement(D0,{entity:u,attributeType:o.attributeType}):v().createElement(a0,{lookups:a,attributeType:o.attributeType,value:u}))),v().createElement(KJ(),{align:"right"},v().createElement(N0,{pin:p,addParent:d})))})))))},L0=(0,AE.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}}}))),F0=()=>{const e=L0(),t=(0,xE.useSelector)(rh),r=(0,xE.useSelector)(Eh);return t===oe?v().createElement(k0,null):v().createElement("div",{className:e.tableContainer},v().createElement("div",{className:e.text},v().createElement("p",null,`${L().text("Please confirm that you wish to start deletion of the selected")}`,v().createElement("b",null,` ${L().number(r,"0,0")} `),L().text(" profiles.")),v().createElement("p",null,L().text("Click on Confirm to proceed."))))},j0=(0,AE.Z)((()=>({contentRoot:{padding:"0 0 5px",position:"relative",backgroundColor:"#FAFAFA"},tenantLabel:{marginLeft:"23px"}}))),U0=()=>{const e=j0(),t=(0,xE.useSelector)(gu),r=(0,xE.useSelector)(nh),n=(0,xE.useDispatch)(),a=()=>n(Up(!1));return v().createElement(TY(),{fullScreen:!0,open:t,onClose:a,disableEnforceFocus:!0},v().createElement(UJ,{onClose:a},L().text("Bulk update"),v().createElement(sX,{className:e.tenantLabel})),v().createElement(uX,null),v().createElement(aW(),{classes:{root:e.contentRoot}},(()=>{switch(r){case 0:return v().createElement(zJ,null);case 1:return v().createElement(YJ,null);case 2:return v().createElement(OJ,null);case 3:return v().createElement(F0,null)}})()))},M0="1px solid rgba(0, 0, 0, 0.33)",V0=(0,AE.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:M0},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:M0,boxShadow:"0 1px 3px 0 rgba(0,0,0,0.12)"}}))),B0=(0,Eb.T)(kT()),z0=(0,xE.connect)((e=>({isReadyAppData:!!pu(e),openAdvancedSearch:fu(e),tenant:Cr().selectors.getTenant(e)})))((e=>{let{openAdvancedSearch:t,isReadyAppData:r,tenant:n,dispatch:a}=e;const i=(0,b.useCallback)((()=>{a({type:wr.CONVERT_FROM_ADVANCED_SEARCH}),a(_p(!1))}),[a]),o=(0,b.useCallback)((()=>{a(_p(!0)),a({type:Ba})}),[a]),[l,s]=(0,b.useState)(!0),c=(0,b.useCallback)((e=>{s(e<=0)}),[]),u=V0(),p=!t;return(0,b.useEffect)((()=>()=>x.memoizeWith.clearCache()),[n]),r?v().createElement(v().Fragment,null,v().createElement("div",{className:u.root},v().createElement(_T,{variant:"persistent",anchor:"left",open:p,classes:{root:u.drawer,paper:u.drawerPaper,docked:u.docked},"data-reltio-id":"reltio-search-facet-search-panel"},v().createElement(B0,{tooltipTitle:L().text("Switch to Advanced search"),tooltipPlacement:"bottom-end",variant:"extended",classes:{root:u.buttonRoot,extended:u.buttonExtended},onClick:o,"data-reltio-id":"reltio-search-advanced-search-button"},v().createElement(FT(),{color:"primary",className:u.menuIcon}),v().createElement("span",{className:u.buttonLabel},L().text("Advanced search")),v().createElement(UT(),{color:"action",className:u.goToActionIcon})),v().createElement(DT(),{variant:"button",classes:{root:O()(u.quickFilterRoot,{[u.withBottomBorder]:!l})}},L().text("Quick filters")),v().createElement(nC,{onScroll:c})),v().createElement(iC,{className:O()(u.mainContent,{[u["mainContent--shifted"]]:p})},v().createElement(aX,{isOpenAdvancedSearch:t,onCloseAdvancedSearch:i}))),v().createElement(NT.O,null),v().createElement(sC,null),v().createElement(TC,null),v().createElement(U0,null)):null})),H0=xT()({productionPrefix:"searchTable",disableGlobal:!0,seed:"srch"});x.userPreferencesComparator.register("searchState",((e,t)=>(0,x.looseEquals)((0,_.omit)(["query"],e),(0,_.omit)(["query"],t))));const Y0=e=>{let{onResize:t=SE.ZT}=e;return v().createElement(bT.DynamicModuleLoader,{modules:[vE()]},v().createElement(CT(),{generateClassName:H0},v().createElement(qE.Z,{handleHeight:!0,onResize:t}),v().createElement(TT._,{dateAdapter:vT.Q},v().createElement(z0,null))))}}}]);