@reltio/segmentation 1.4.116 → 1.4.2042-hf

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/171.bundle.js DELETED
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_reltio_segmentation=self.webpackChunk_reltio_segmentation||[]).push([[171],{71171:(e,t,r)=>{r.r(t),r.d(t,{ConfigureColumnsButton:()=>Rd,DEFAULT_SEARCH_SELECT:()=>Z.Tv,EntitiesTableWithConfigurableColumns:()=>sf,EntityAvatar:()=>A,ROWS_PER_PAGE_OPTIONS:()=>Z.Tu,buildQueryForAdvancedSearchGroups:()=>Ua.Jk,buildSelectFromColumns:()=>Ai.vw,collectSpecialColumns:()=>Ai.oX,createRecentSearch:()=>vs,default:()=>Rq,getActiveEntityTypeTab:()=>Ri.tB,getAdditionalColumns:()=>Ai.oq,getDataTenant:()=>ai.lF,getEntityTypeLabel:()=>S.getEntityTypeLabel,getEntityTypeTab:()=>Ri.o4,getModule:()=>dp,getPage:()=>ai.fx,getRowsPerPage:()=>ai.Uz,getSearchResultsMode:()=>Ri.XM,getSearchUrlQuery:()=>bo.Cc,getSerializedSearchState:()=>To.Z,getTotal:()=>ai.NU,needRequestAfterColumnsChanges:()=>Ai.tU,parseSearchState:()=>Cs.Z,queryBuilderHelpers:()=>n,queryBuilderSagas:()=>a,replaceSearchResultsColumns:()=>Cs.f,showMoreResultsForEntityTypeAction:()=>qa,showSavedSearchesDialogAction:()=>yi});var n={};r.r(n),r.d(n,{PROP_NAME_FILTER:()=>bt,PROP_NAME_OPERATOR:()=>ht,PROP_NAME_VALUES:()=>Et,addAttributeAfter:()=>It,changeAttributeData:()=>Nt,createGetAttributeIndex:()=>wt,createGetAttributeLens:()=>At,createGetAttributeProp:()=>_t,createGetAttributesLens:()=>Ct,createGetGroupLens:()=>xt,createSetAttributeProp:()=>Rt,defaultFindGroupPath:()=>St,deleteAttribute:()=>Dt,duplicateAttribute:()=>kt,getAttributeData:()=>Ot,getAttributeObject:()=>Tt,getEmptyAttributeObject:()=>vt,setAttributeOperator:()=>Pt,setFilter:()=>Lt,setValues:()=>Ut});var a={};r.r(a),r.d(a,{toggleQueryBuilderAttributeSelect:()=>rl});var i={};r.r(i),r.d(i,{addAttributes:()=>ob,addDefaultValuesAction:()=>lb,addNextPageOfAttributeValues:()=>ub,modifyAttribute:()=>sb,processNextPageOfAttributeValues:()=>pb,profileSaved:()=>gb,removeAttribute:()=>cb,requestNextPageOfAttributeValues:()=>db,runAuthoringTaskAction:()=>fb,saveDraft:()=>yb,saveProfile:()=>mb,validateProfile:()=>hb});var o={};r.r(o),r.d(o,{dependentLookupsEditorTouched:()=>Ob,dependentLookupsEditorsBlocked:()=>Tb,dependentLookupsInitedTypeUrisAdded:()=>vb,dependentLookupsStructureSet:()=>bb});var l={};r.r(l),r.d(l,{activityFilterUpdated:()=>Bb,globalFilterUpdated:()=>zb,keywordUpdated:()=>Fb,saveState:()=>Vb,searchResultsSet:()=>jb,setSearchNavigationData:()=>Gb,setSearchOptionsConfig:()=>Yb,setSearchProviderData:()=>Wb,updateSearchNavigationDataFields:()=>qb,updateSearchNavigationDataOnMerge:()=>Zb,updateSearchOptions:()=>Hb,updateState:()=>Mb});var s={};r.r(s),r.d(s,{addDashboardExternalView:()=>Lv,autocloseIntervalLoaded:()=>gv,clearNotifications:()=>uv,closeNotification:()=>cv,dateMaskUpdated:()=>Sv,dateTimeMaskUpdated:()=>xv,documentationSet:()=>kv,entityDeletionFinished:()=>ov,errorSet:()=>Dv,keysSet:()=>Nv,localeAttributePresentationLoaded:()=>yv,localizationLoaded:()=>Ov,navigateTo:()=>Iv,newEntityShown:()=>iv,newUiConfigLoaded:()=>fv,numberFormatUpdated:()=>Ev,openAppFromChocolateBar:()=>vv,openConsoleApp:()=>bv,openDashboard:()=>wv,openEntity:()=>av,openGraph:()=>Tv,openHistoryEvent:()=>Av,openNewEntityWithAuthoring:()=>Rv,openPerspective:()=>lv,openPivotingPerspective:()=>Pv,openPreviousPage:()=>_v,openSearch:()=>Cv,pathsSet:()=>pv,setPreferReact:()=>hv,setUseSharedPreferences:()=>Uv,showNotification:()=>sv,uiConfigLoaded:()=>mv,uiPathSet:()=>dv});var c={};r.r(c),r.d(c,{getAbsoluteImagePath:()=>FS,getActiveErrorsForAttributesPager:()=>MO,getActivityFilter:()=>hS,getAdminToolsPath:()=>GO,getAiAssistantEnabled:()=>uS,getAiAssistantHistoryBufferSize:()=>mS,getAiAssistantLimitPerDay:()=>pS,getAiAssistantSkills:()=>dS,getAllRelationsToAddAndEdit:()=>DS,getAllRelationsToSave:()=>kS,getAllServicesPaths:()=>ix,getAllTreesEditingConnections:()=>qS,getApiPath:()=>BO,getAttributeTypeErrors:()=>jO,getAttributesErrors:()=>FO,getAttributesPresentation:()=>qO,getAttributesSortingStrategy:()=>gC,getAuthoringByEntityType:()=>EC,getAutoCloseInterval:()=>KO,getCanSuggestAuthoring:()=>xC,getCanUserCreateWorkflowConfigJar:()=>mx,getCanUserCreateWorkflowEnvironmentConfigJar:()=>fx,getCanUserDeleteProfiles:()=>Ux,getCanUserExecuteWorkflowJobs:()=>yx,getCanUserExecuteWorkflowJobsSyncBusinessProcessData:()=>gx,getCanUserExecuteWorkflowJobsTerminateProcessInstance:()=>hx,getCanUserExecuteWorkflowJobsUpdateTasks:()=>Ex,getCanUserExecuteWorkflowJobsValidateTasks:()=>bx,getCanUserGetDQStatistic:()=>Fx,getCanUserImportEntitiesFromDT:()=>Px,getCanUserMakeActivitiesExport:()=>Nx,getCanUserMakeBulkUpdate:()=>Lx,getCanUserMakeExport:()=>Ix,getCanUserManageWorkflowDefinition:()=>vx,getCanUserManageWorkflowEnvironmentDefinition:()=>Tx,getCanUserOpenDataLoader:()=>jx,getCanUserReadDVF:()=>Mx,getCanUserReadEntitiesFromDT:()=>Dx,getCanUserReadWorkflowDataTask:()=>Ox,getCanUserRegisterConfigEnvironments:()=>dx,getCanUserStartProcessFromQuery:()=>kx,getCanUserUpdateProcessInstance:()=>Sx,getCanUserUpdateWorkflowDataTask:()=>xx,getCanUserViewProcessInstanceSearchQuery:()=>Cx,getCanUserViewWorkflowConfigJar:()=>wx,getCanUserViewWorkflowDefinition:()=>Ax,getCanUserViewWorkflowEnvironmentConfigJar:()=>Rx,getCanUserViewWorkflowJobs:()=>_x,getCheckIfCanAddRelations:()=>rC,getCleanseByEntityType:()=>bC,getCollaborationPath:()=>sx,getConnectionsByViewId:()=>EO,getConnectionsTemporaryUrisForCreation:()=>SO,getConnectionsWithDraftsByViewId:()=>TO,getControlAttributes:()=>SC,getDBConnectorSideViews:()=>Zx,getDVFPath:()=>cx,getDataTenants:()=>oO,getDateMask:()=>XO,getDateTimeMask:()=>QO,getDependentLookupEditorState:()=>eC,getDependentLookupEditorsState:()=>Jx,getDependentLookups:()=>$x,getDependentLookupsInitedTypeUris:()=>Qx,getDependentLookupsStructure:()=>Kx,getDependentLookupsStructureNode:()=>Xx,getDocReleaseNotes:()=>pC,getDraftsForSaveByViewId:()=>OO,getDtssPath:()=>rx,getEditingOrAddingConnectionByViewIdAndRelationUri:()=>bO,getEditingOrAddingConnectionRelationObjectByViewIdAndRelationUri:()=>vO,getEntity:()=>yO,getEntityRelatedAttributesByAttributeTypeUri:()=>UO,getEntityUri:()=>gO,getEntityUriWithDataTenant:()=>hO,getEntityWithDiff:()=>nC,getEntityWithoutDiff:()=>aC,getEnvironment:()=>ex,getEnvironmentAlias:()=>tx,getEnvironmentObject:()=>uO,getExportDQPath:()=>nx,getExportPath:()=>zO,getGlobalFilter:()=>SS,getGlobalFilterQuery:()=>xS,getGlobalFilterSavedSearchesUris:()=>CS,getGlobalSearchRequestOptions:()=>TS,getGoogleMapKey:()=>aS,getHeaderColor:()=>mC,getHiddenAttributes:()=>OC,getHistoryDiff:()=>RO,getHistoryEvent:()=>_O,getHistoryMode:()=>PO,getHistorySlice:()=>IO,getIcpLicenseKey:()=>iS,getImageAttributesFieldsOrder:()=>rS,getImagePath:()=>VO,getImageServicePath:()=>WO,getInitialConnection:()=>US,getInitialConnectionTempEntity:()=>LS,getIsAuthoringMode:()=>vC,getIsEditableMode:()=>AS,getIsHistoryModeEnabled:()=>NO,getIsSuggestMode:()=>_S,getIsViewMode:()=>RS,getLogo:()=>dC,getLookupAutocomplete:()=>nS,getLookups:()=>CO,getMaxValuesInResponse:()=>$O,getMetadata:()=>sO,getMlDqPath:()=>px,getMode:()=>wS,getModifiedEntities:()=>LO,getModifiedEntity:()=>DO,getModifiedEntityDefaultProfilePic:()=>kO,getNotifications:()=>eS,getPivotingAttributes:()=>tS,getProfile:()=>mO,getProfileCancelNeedConfirm:()=>XS,getProfileCheckUpdate:()=>hC,getProfileErrors:()=>wO,getProfileLastLoadedTime:()=>ZS,getProfileOperation:()=>$S,getProfileViews:()=>KS,getQueryEstimatorEnabled:()=>TC,getRelationToAddByViewId:()=>NS,getRelations:()=>IS,getRelationsToEditByViewId:()=>PS,getRelationsViewIds:()=>AO,getReleaseVersion:()=>uC,getReltioPath:()=>YO,getRequestProviderConfiguration:()=>JO,getSearch:()=>fO,getSearchKeyword:()=>gS,getSearchNavigationData:()=>vS,getSearchOptions:()=>ES,getSearchProviderData:()=>bS,getSearchResults:()=>yS,getServicesPath:()=>iC,getSharedPreferencesEnabled:()=>fS,getShowAttributeDescription:()=>yC,getShowEntityId:()=>cC,getShowSearchByOv:()=>fC,getStringifiedSearchOptions:()=>OS,getTenant:()=>QS,getTenantName:()=>JS,getTenantObject:()=>cO,getTenants:()=>lO,getTotalByViewId:()=>xO,getTree:()=>zS,getTreeCommands:()=>WS,getTreeEditingConnection:()=>GS,getTreeRoot:()=>HS,getTreeTotal:()=>YS,getTrees:()=>BS,getUIConfig:()=>oC,getUIConfigLayout:()=>lC,getUIConfigProfile:()=>sC,getUIPath:()=>HO,getUi:()=>dO,getUiError:()=>tC,getUiNumberFormat:()=>ZO,getUser:()=>pO,getUserName:()=>MS,getUserRoles:()=>VS,getValidateReadMode:()=>lS,getValidateReferenceEntityInReadMode:()=>cS,getValidateRelations:()=>sS,getValidationServicePath:()=>ux,getValidationServiceSeverityLevels:()=>oS,getViewIdsForOpenRelation:()=>jS,getWorkflowConfigurationEnabled:()=>lx,getWorkflowEnvironmentUrl:()=>ox,getWorkflowPath:()=>ax,isCollaborationEnabled:()=>Vx,isCollaborationSideViewEnabled:()=>Wx,isDBConnectorSideViewEnabled:()=>qx,isHistorySideViewEnabled:()=>Gx,isWorkflowEnabled:()=>Bx,isWorkflowSideViewEnabled:()=>Yx});var u={};r.r(u),r.d(u,{authoringDcrResolved:()=>tw,authoringDraftEntitiesLoaded:()=>ew,clearEntity:()=>aw,entityCloneRequested:()=>nw,entityCreationRequested:()=>QC,entityCreationWithAuthoringRequested:()=>JC,entityLoaded:()=>$C,entityRemoveRequested:()=>rw,loadEntity:()=>XC,setDefaultProfilePic:()=>KC});var p={};r.r(p),r.d(p,{errorDeactivated:()=>uw,errorsSet:()=>pw});var d={};r.r(d),r.d(d,{clearHistoryDiff:()=>gw,clearHistoryEvent:()=>Ew,setHistoryDiff:()=>yw,setHistoryEvent:()=>hw,setHistoryMode:()=>vw,setHistorySlice:()=>bw});var m={};r.r(m),r.d(m,{lookupsForTypeResolved:()=>Aw,lookupsListResolved:()=>Rw,lookupsLoaded:()=>ww});var f={};r.r(f),r.d(f,{modeEditingCanceled:()=>kw,modeUpdateRequested:()=>Dw,modeUpdated:()=>Pw});var y={};r.r(y),r.d(y,{cleanseLoading:()=>Hw,entityCreated:()=>Mw,entityDeleted:()=>Vw,modifiedEntitiesReset:()=>zw,setDefaultProfilePic:()=>Bw});var g={};r.r(g),r.d(g,{addRelation:()=>aA,closeRelationEditor:()=>sA,editRelation:()=>iA,ignoreRelation:()=>nA,openRelationEditor:()=>lA,relationsLoaded:()=>eA,removeRelation:()=>rA,secondLevelRelationsLoaded:()=>tA,setInitialInfo:()=>pA,setRelationEntity:()=>uA,setRelationType:()=>cA,updateRelationRating:()=>oA});var h={};r.r(h),r.d(h,{hiddenAttributesReset:()=>tI,hiddenAttributesUpdated:()=>eI});var E={};r.r(E),r.d(E,{controlAttributesUpdated:()=>aI}),r(69448);var b=r(8156),v=r.n(b),T=r(78310),O=r.n(T),S=r(2396),x=r(55743),C=r.n(x),w=r(13639);const A=({entity:e,avatarClassName:t,imageClassName:r})=>{const n=(0,w.AH)(),a=(0,w.$H)()||"",i=(0,S.getEntityImage)(n,a,e),o=(0,S.getAbsoluteImageUrl)(a,(0,S.getEntityTypeImage)(n,e.type)),l=e=>{e.target.onError=null,e.target.src=(0,S.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()(t,r),src:i,imgProps:{onError:l}},v().createElement("img",{className:r,src:o,alt:"fallback entity avatar",onError:l}))};var R=r(75580),_=r(73288),I=r(62391),N=r(9400),P=r(8523),D=r(42308),k=r.n(D),L=r(61882),U=r(26040),j=r(5950);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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){M(e,t,r[t])}))}return e}function M(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const V={facetsConfigs:[],facetsData:{},recommendedFacets:[],addedFacets:[]},B=(0,I.Ic)("facetsConfigs"),z=(0,I.Ic)("facetsData"),H=(0,I.Ic)("recommendedFacets"),Y=(0,I.Ic)("addedFacets"),W=(e,t,r)=>Object.keys(e).reduce(((t,n)=>(0,_.prop)(n,t)?(0,I.ET)(n,r).set(t,e[n]):t),F({},t)),G=({state:e,facetsConfigs:t,addToEnd:r=!1,facetsData:n={}})=>{const a=t.filter((e=>e.fieldName)),i=B.get(e),o=B.set(e,r?i.concat(a):a.concat(i)),l=z.get(e),s=a.reduce(((e,t)=>F({},e,{[t.fieldName]:(0,N.DV)(t.fieldName,n[t.fieldName])})),F({},l));return z.set(o,s)},q=(e=V,t)=>{switch(t.type){case L.k.CREATE_FACETS:{const{facetsConfigs:r,addToEnd:n}=t.payload;return G({state:e,facetsConfigs:r,addToEnd:n})}case D.search.constants.UPDATE_STATE:{const{facetsConfigs:e=[],facetsData:r={}}=t.payload.facets||{facetsConfigs:[]};return G({state:V,facetsConfigs:e,facetsData:r})}case L.k.DESTROY_FACETS:return((e,t)=>{const r=z.get(e),n=B.get(e),a=F({},r);t.forEach((e=>{delete a[e]}));const i=z.set(e,a);return B.set(i,n.filter((e=>!t.includes(e.fieldName))))})(e,t.payload||[]);case L.k.CHANGE_VALUES:{const{facetFieldName:r,values:n}=t.payload;return(({facetFieldName:e,values:t,state:r})=>{const n=[...(0,P.jK)(e),"values"];return(0,I.ET)(...n).set(r,t)})({facetFieldName:r,values:n,state:e})}case L.k.SHOW_MORE_ENTITY_TYPES:{const{show:r}=t.payload,n="type",a=(0,P.jK)(n);if(r)return(0,I.ET)(...a,"showAllItems").set(e,r);{const t=(0,I.ET)(...a);return t.set(e,(0,_.omit)(["showAllItems"],t.get(e)))}}case L.k.CLEAR_ALL_VALUES:case U.Z.CLEAR_ALL:{const t=z.get(e),r=Object.keys(t).reduce(((e,t)=>F({},e,{[t]:[]})),{}),n=W(r,t,"values");return z.set(e,n)}case L.k.UPDATE_DATA:{const r=t.payload||{},n=z.get(e),a=W(r,n,"data");return z.set(e,a)}case L.k.UPDATE_FILTERED_DATA:{const r=t.payload||{},n=z.get(e),a=W(r,n,"filteredData");return z.set(e,a)}case L.k.DESTROY_FILTERED_DATA:{const r=t.payload||{},n=(0,P.jK)(r);if((0,_.path)(n,e)){const t=(0,I.ET)(...n),r=F({},t.get(e));if(r.filteredData)return delete r.filteredData,t.set(e,r)}break}case L.k.SET_RECOMMENDED_FACETS_LIST:return H.set(e,t.payload||[]);case L.k.HIGHLIGHT_ADDED_FACETS:return Y.set(e,t.payload);case L.k.CLEAR_HIGHLIGHT_ADDED_FACETS:return Y.set(e,[]);case"UI_RESET":return F({},V);case U.Z.CHANGE_CURRENT_TENANT:{const{isDataTenant:r,tenantObject:n}=t.payload;if(r){const t=B.get(e),r=z.get(e),a=(0,j.ci)(n,t),i=(0,_.pluck)("fieldName",a),o=(0,_.pipe)((0,_.pick)(i),(0,j.AZ)(n))(r);return z.set(B.set(e,a),o)}return e}}return e};var Z=r(33950);function $(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){K(e,t,r[t])}))}return e}function K(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const X={searchResults:null,searchResultsByEntityTypes:{},total:0,page:0,sortField:null,sortOrder:null,rowsPerPage:Z.Tu[0],loading:!1,searchParams:{searchBoxInput:{fieldName:"attributes",filter:"containsWordStartingWith"},mapSearch:{fieldName:"geoLocation",type:"geoLocation",filter:"range",values:[]}},currentTenant:null},Q=(0,I.Ic)("searchResults"),J=(0,I.Ic)("total"),ee=(0,I.Ic)("page"),te=(0,I.Ic)("rowsPerPage"),re=(0,I.Ic)("sortField"),ne=(0,I.Ic)("sortOrder"),ae=(0,I.Ic)("loading"),ie=(0,I.ET)("searchParams","mapSearch","values"),oe=(0,I.ET)("searchParams","mapSearch","type"),le=(0,I.ET)("searchParams","mapSearch","fieldName"),se=(0,I.Ic)("searchResultsByEntityTypes"),ce=e=>se.compose((0,I.ET)(e,"page")),ue=({entityTypeUri:e,field:t,order:r},n)=>{if(e){const a=se.compose((0,I.ET)(e,"sortField")),i=se.compose((0,I.ET)(e,"sortOrder")),o=a.set(n,t);return i.set(o,r)}{const e=re.set(n,t);return ne.set(e,r)}},pe=(e=X,t)=>{switch(t.type){case U.Z.UPDATE_ENTITIES:{const{searchResults:r,entityTypeUri:n}=t.payload;return n?se.compose((0,I.ET)(n,"searchResults")).set(e,r):Q.set(e,r)}case U.Z.UPDATE_TOTAL:return J.set(e,t.payload);case U.Z.CHANGE_PAGE:{const{entityTypeUri:r,pageNumber:n}=t.payload;return r?ce(r).set(e,n):ee.set(e,n)}case U.Z.RESET_PAGE:{const{entityTypeUri:r}=t.payload,n=ee.set(e,0);return r?ce(r).set(n,0):n}case U.Z.CHANGE_ROWS_PER_PAGE:{const{entityTypeUri:r,number:n}=t.payload;if(r){const t=se.compose((0,I.ET)(r,"rowsPerPage")),a=ce(r).set(e,0);return t.set(a,n)}{const t=ee.set(e,0);return te.set(t,n)}}case U.Z.CHANGE_SORT:return ue(t.payload,e);case U.Z.CHANGE_LOADING:return ae.set(e,t.payload);case D.search.constants.UPDATE_STATE:{const{values:r=[],searchType:n=S.MapSearch.geoPolygon}=t.payload.map||{};let a=ie.set(X,r);if(a=oe.set(a,n),a=le.set(a,(0,S.mapSearchTypeToFieldName)(n)),t.payload.view){const{entityTypeTab:e,sortField:r,sortOrder:n}=t.payload.view;a=ue({entityTypeUri:e,field:r,order:n},a)}return $({},a,{currentTenant:t.payload.currentTenant||e.currentTenant,searchOptions:t.payload.searchOptions||e.searchOptions})}case"UI_RESET":return $({},X);case U.Z.MAP_CHANGE_VALUE:{const{value:r,searchType:n}=t.payload;let a=oe.set(e,n);return a=le.set(a,(0,S.mapSearchTypeToFieldName)(n)),ie.set(a,r?[r]:[])}case U.Z.CLEAR_RESULTS:{const r=t.payload;if(r){let t=Q.set(e,void 0);const n=se.get(e);return se.set(t,{[r]:n[r]})}return se.set(e,{})}case U.Z.CLEAR_ALL:return ie.set(e,[]);case U.Z.CHANGE_CURRENT_TENANT:return $({},e,{currentTenant:t.payload.tenantObject.id})}return e},de="UI_SHOW_MORE_FACETS_POPUP",me="UI_SHOW_SAVED_SEARCHES_DIALOG",fe="UI_SHOW_SAVE_SEARCH_DIALOG",ye="UI_SHOW_ADVANCED_SEARCH",ge="UI_SHOW_BULK_UPDATE",he="UI_SET_MARKER",Ee="UI_SET_HOVERED_ENTITY_URI",be="UI_SET_SEARCH_RESULTS_COLUMNS",ve="UI_CHANGE_SEARCH_RESULTS_COLUMNS",Te="UI_SET_ENTITY_TYPE_TAB",Oe="UI_UPDATE_TABLE_VIEW_TABS",Se="UI_CHANGE_ORDER_SEARCH_RESULTS_COLUMNS",xe="UI_CHANGE_SIZES_SEARCH_RESULTS_COLUMNS",Ce="UI_CLEAR_NOTIFICATION",we="UI_SET_NOTIFICATION",Ae="UI_SET_SEARCH_RESULTS_MODE",Re="UI_SET_PREVIEW_PANEL_MODE",_e={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},Ie=(0,I.Ic)("showMoreFacetsPopup"),Ne=(0,I.Ic)("showSavedSearchesDialog"),Pe=(0,I.Ic)("showSaveSearchDialog"),De=(0,I.Ic)("showAdvancedSearch"),ke=(0,I.Ic)("showBulkUpdate"),Le=(0,I.Ic)("activeAdditionalSearch"),Ue=(0,I.Ic)("activeMarker"),je=(0,I.Ic)("hoveredEntityUri"),Fe=(0,I.Ic)("searchResultsMode"),Me=(0,I.Ic)("previewPanelMode"),Ve=(0,I.Ic)("searchResultsColumns"),Be=(0,I.Ic)("entityTypeTab"),ze=(0,I.Ic)("tableViewTabs"),He=(0,I.Ic)("loading"),Ye=(0,I.Ic)("notification"),We=(e=_e,t)=>{switch(t.type){case de:return Ie.set(e,t.payload);case me:return Ne.set(e,t.payload);case fe:return Pe.set(e,t.payload.show);case ye:return De.set(e,t.payload);case ge:return ke.set(e,t.payload);case"UI_SET_ACTIVE_ADDITIONAL_SEARCH":{const r=Le.get(e)===t.payload?null:t.payload;return Le.set(e,r)}case he:return Ue.set(e,t.payload);case Ee:return je.set(e,t.payload);case Ae:return Fe.set(e,t.payload);case be:return Ve.set(e,t.payload);case ve:{const{entityTypeUri:r,columns:n}=t.payload;return Ve.compose((0,I.Ic)(r)).set(e,n)}case xe:{const{entityTypeUri:r,columns:n}=t.payload;return Ve.compose((0,I.Ic)(r)).set(e,n)}case Se:{const{entityTypeUri:r,columns:n}=t.payload;return Ve.compose((0,I.Ic)(r)).set(e,n)}case Re:return Me.set(e,t.payload);case Te:return Be.set(e,t.payload.entityTypeUri);case Oe:return ze.set(e,t.payload);case L.k.UPDATE_DATA:if((0,_.has)("type",t.payload))return ze.set(e,t.payload.type);break;case L.k.CHANGE_VALUES:{const{facetFieldName:r,values:n}=t.payload;if("type"===r&&n.length){const t=Be.get(e);if(!n.includes(t))return Be.set(e,n[0])}break}case"UI_RESET":return _e;case"UI_SET_LOADING":return He.set(e,t.payload);case we:return Ye.set(e,t.payload);case Ce:return Ye.set(e,null);case D.search.constants.UPDATE_STATE:{let r=De.set(e,(0,_.has)("advanced",t.payload));if(t.payload.view){const{searchResultsMode:e,entityTypeTab:n,searchResultsColumns:a,previewPanelMode:i}=t.payload.view;r=Fe.set(r,e),r=Be.set(r,n),(0,S.isEmptyValue)(a)||(r=Ve.set(r,a)),r=Me.set(r,i)}return t.payload.showSavedSearchesDialog&&(r=Ne.set(r,t.payload.showSavedSearchesDialog)),r}}return e};var Ge=r(37164);const qe="ADVANCED_SEARCH_SET_GROUP_ENTITY_TYPES",Ze="ADVANCED_SEARCH_VERIFY_GROUP_ENTITY_TYPES",$e="ADVANCED_SEARCH_SET_GROUP_OPERATOR",Ke="ADVANCED_SEARCH_DELETE_GROUP",Xe="ADVANCED_SEARCH_ADD_GROUP",Qe="ADVANCED_SEARCH_DUPLICATE_GROUP",Je="ADVANCED_SEARCH_ADD_ATTRIBUTE_AFTER",et="ADVANCED_SEARCH_CHANGE_ATTRIBUTE_DATA",tt="ADVANCED_SEARCH_TOGGLE_ATTRIBUTE_SELECT",rt="ADVANCED_SEARCH_SET_ATTRIBUTE_OPERATOR",nt="ADVANCED_SEARCH_DELETE_ATTRIBUTE",at="ADVANCED_DELETE_ATTRIBUTE_AND_VERIFY_GROUP_ENTITY_TYPES",it="ADVANCED_SEARCH_DUPLICATE_ATTRIBUTE",ot="ADVANCED_SEARCH_SET_FILTER",lt="ADVANCED_SEARCH_SET_VALUES",st="ADVANCED_SEARCH_ATTRIBUTE_SET_VALUES",ct="ADVANCED_SEARCH_ATTRIBUTE_FILTER_VALUES",ut="ADVANCED_SEARCH_ATTRIBUTE_SET_FILTERED_VALUES",pt="ADVANCED_SEARCH_ATTRIBUTE_UPDATE_VALUES",dt="ADVANCED_SEARCH_UPDATE",mt="ADVANCED_SEARCH_CONVERT_FROM_FACETS";var ft=r(81253);function yt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){gt(e,t,r[t])}))}return e}function gt(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ht="operator",Et="values",bt="filter",vt=(e=(0,Ge.x0)())=>({[ht]:Z.YL.value,id:e}),Tt=(e,t=(0,Ge.x0)())=>{const r=Ot(e);return{data:r,[ht]:Z.YL.value,[bt]:(0,_.pathOr)("",["filterOptions",0],r),id:t}},Ot=e=>yt({},e,{filterOptions:e.enforcedFilterOptions||(0,S.getFilterOptionsForQueryBuilder)(e.attrType,e.fieldName,!0)}),St=(0,_.curry)(((e,t)=>{const r=t.findIndex((t=>t.id===e));return r>-1?[r]:null})),xt=(e,t=St)=>(r,n)=>{const a=(0,I.ET)(...e).get(r),i=t(n,a);return!!i&&(0,I.ET)(...e,...i)},Ct=(e,t)=>(r,n)=>{const a=e(r,n);return a&&a.compose((0,I.Ic)(t))},wt=e=>(t,r,n)=>{const a=e(t,r);return a?a.get(t).findIndex((e=>e.id===n)):-1},At=e=>(t,r,n)=>{const a=e(t,r),i=wt(e)(t,r,n);return-1!==i?a.compose((0,I.ET)(i)):null},Rt=e=>(t,r,n,a,i)=>{const o=e(t,r,n);if(o){const e=yt({},o.get(t));return e[a]=i,o.set(t,e)}return t},_t=e=>(t,r,n,a)=>{const i=e(t,r,n);if(i)return i.get(t)[a]},It=({state:e,groupId:t,attributeId:r,attribute:n,getAttributesLens:a,getAttributeIndex:i})=>{const o=a(e,t);if(o){let a=[...o.get(e)];const l=i(e,t,r),s=!a[l+1];return-1!==l&&s?a.splice(l+1,0,n):-1!==l?(a.splice(l+1,0,yt({},n,{operator:a[l].operator})),a[l]=yt({},a[l],{operator:Z.YL.value})):a.push(n),o.set(e,a)}return e},Nt=({state:e,groupId:t,attributeId:r,attributeData:n,setAttributeProp:a,getAttributeLens:i})=>{let o=e;if(n)return((e,t,r,n,a)=>{const i=a(e,t,r);let o;return i&&(o=i.get(e).filter),n.filterOptions.length&&(!o||!n.filterOptions.includes(o))})(e,t,r,n,i)&&(o=a(e,t,r,bt,n.filterOptions[0])),o=a(o,t,r,Et,[]),a(o,t,r,"data",n);{const n=i(e,t,r);return n&&(o=n.set(o,vt(r))),o}},Pt=({state:e,groupId:t,attributeId:r,operator:n,setAttributeProp:a})=>a(e,t,r,ht,n),Dt=({state:e,groupId:t,attributeId:r,getAttributesLens:n})=>{const a=n(e,t);if(a){const t=[...a.get(e)],n=t.findIndex((e=>e.id===r));if(n>-1){const r=(0,_.remove)(n,1,t),i=r[n-1],o=t[n];return i&&(r[n-1]=yt({},i,{operator:o.operator})),a.set(e,r)}}return e},kt=({state:e,groupId:t,attributeId:r,id:n,getAttributesLens:a})=>{const i=a(e,t);if(i){const t=[...i.get(e)],a=t.findIndex((e=>e.id===r));if(a>-1)return t.push(yt({},t[a],{id:n})),i.set(e,t)}return e},Lt=({state:e,groupId:t,attributeId:r,filter:n,getAttributeProp:a,setAttributeProp:i})=>{const o=a(e,t,r,bt),l=(0,S.isCompatibleFilters)(o,n)?e:i(e,t,r,Et,[]);return i(l,t,r,bt,n)},Ut=({state:e,groupId:t,attributeId:r,values:n,setAttributeProp:a})=>a(e,t,r,Et,n);function jt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Ft(e,t,r[t])}))}return e}function Ft(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Mt={groups:[]},Vt={},Bt="entityTypes",zt="attributes",Ht=["groups"],Yt=(0,I.ET)(...Ht),Wt=xt(Ht),Gt=Ct(Wt,zt),qt=wt(Gt),Zt=At(Gt),$t=Rt(Zt),Kt=_t(Zt),Xt=(e,t=[],r=(0,Ge.x0)())=>({[zt]:e.map((e=>Tt(e))),[ht]:Z.qx.value,[Bt]:t,id:r}),Qt=(e=Vt,t)=>{switch(t.type){case ut:{const{groupId:r,attributeId:n,values:a}=t.payload;return(0,_.assocPath)([r,n,"filtered"],a,e)}case Ke:{const{groupId:r}=t.payload;return(0,_.dissoc)(r,e)}case nt:{const{groupId:r,attributeId:n}=t.payload;return(0,_.dissocPath)([r,n],e)}case Qe:{const{groupId:r,id:n}=t.payload,a=e[r];return a?(0,_.assoc)(n,a,e):e}case it:{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 U.Z.CLEAR_ALL:case D.search.constants.UPDATE_STATE:return Vt;default:return e}},Jt=(e=Mt,t)=>{switch(t.type){case Xe:{const{group:r}=t.payload,n=[...Yt.get(e)];return n.push(r),Yt.set(e,n)}case $e:{const{groupId:r,operator:n}=t.payload,a=Wt(e,r);if(a){const t=jt({},a.get(e));return t[ht]=n,a.set(e,t)}return e}case qe:{const{groupId:r,entityTypes:n}=t.payload,a=Wt(e,r);if(a){const t=jt({},a.get(e));return t.entityTypes=n,t.autoAddedEntityTypes=[],t.attributes=[],a.set(e,t)}return e}case Ze:{const{groupId:r}=t.payload,n=Wt(e,r);if(n){const t=n.get(e),{entityTypes:r,autoAddedEntityTypes:a}=(0,ft.tg)((0,ft.r8)(t.attributes||[]),t.entityTypes,t.autoAddedEntityTypes);return n.set(e,jt({},t,{[Bt]:r,autoAddedEntityTypes:a}))}return e}case Ke:{const{groupId:r}=t.payload,n=[...Yt.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]=jt({},r,{operator:i.operator})),Yt.set(e,t)}return e}case Qe:{const{groupId:r,id:n}=t.payload,a=[...Yt.get(e)],i=a.findIndex((e=>e.id===r));return i>-1?(a.push(jt({},a[i],{id:n})),Yt.set(e,a)):e}case Je:{const{groupId:r,attributeId:n,attribute:a}=t.payload;return It({state:e,groupId:r,attributeId:n,attribute:a,getAttributesLens:Gt,getAttributeIndex:qt})}case et:{const{groupId:r,attributeId:n,attributeData:a}=t.payload;return Nt({state:e,groupId:r,attributeId:n,attributeData:a,setAttributeProp:$t,getAttributeLens:Zt})}case rt:{const{groupId:r,attributeId:n,operator:a}=t.payload;return Pt({state:e,groupId:r,attributeId:n,operator:a,setAttributeProp:$t})}case nt:{const{groupId:r,attributeId:n}=t.payload;return Dt({state:e,groupId:r,attributeId:n,getAttributesLens:Gt})}case it:{const{groupId:r,attributeId:n,id:a}=t.payload;return kt({state:e,groupId:r,attributeId:n,id:a,getAttributesLens:Gt})}case ot:{const{groupId:r,attributeId:n,filter:a}=t.payload;return Lt({state:e,groupId:r,attributeId:n,filter:a,getAttributeProp:Kt,setAttributeProp:$t})}case lt:{const{groupId:r,attributeId:n,values:a}=t.payload;return Ut({state:e,groupId:r,attributeId:n,values:a,setAttributeProp:$t})}case U.Z.CLEAR_ALL:return Mt;case D.search.constants.UPDATE_STATE:{const{advanced:e=[]}=t.payload;return Yt.set(Mt,e)}default:return e}},er=(e,t)=>{const r=((e,t)=>{if(t.type===st){var r;const{groupId:n,attributeId:a,values:i}=t.payload;return((null===(r=[...Yt.get(e.searchParams)].find((e=>e.id===n)))||void 0===r?void 0:r.attributes)||[]).some((({id:e})=>e===a))?(0,_.assocPath)(["attributesData",n,a,"default"],i,e):e}return e})((0,R.combineReducers)({searchParams:Jt,attributesData:Qt})(e,t),t);return r},tr="SAVED_SEARCHES_CREATE",rr="SAVED_SEARCHES_SET_CURRENT",nr="SAVED_SEARCHES_SET_CHANGE_INDICATOR",ar="SAVED_SEARCHES_UPDATE",ir="SAVED_SEARCHES_LOAD",or="SAVED_SEARCHES_SET_TOTAL",lr="SAVED_SEARCHES_SET_ITEMS",sr="SAVED_SEARCHES_SET_ITEM_TOTAL",cr="SAVED_SEARCHES_SET_PAGE",ur="SAVED_SEARCHES_SET_ROWS_PER_PAGE",pr="SAVED_SEARCHES_SET_FILTERS",dr="SAVED_SEARCHES_SELECT_ITEM",mr="SAVED_SEARCHES_SELECT_ALL_ITEMS",fr="SAVED_SEARCHES_DESELECT_ALL_ITEMS",yr="SAVED_SEARCHES_MARK_PUBLIC_REQUEST",gr="SAVED_SEARCHES_MARK_PUBLIC",hr="SAVED_SEARCHES_MARK_FAVORITE_REQUEST",Er="SAVED_SEARCHES_MARK_FAVORITE",br="SAVED_SEARCHES_MARK_GLOBAL_FILTER_REQUEST",vr="SAVED_SEARCHES_CHANGE_ITEM_NAME_REQUEST",Tr="SAVED_SEARCHES_CHANGE_ITEM_NAME",Or="SAVED_SEARCHES_SET_EDITING",Sr="SAVED_SEARCHES_DELETE_SELECTED_ITEMS_REQUEST",xr="SAVED_SEARCHES_DELETE_ITEM_REQUEST",Cr="SAVED_SEARCHES_DELETE_ITEMS",wr="SAVED_SEARCHES_SET_LOADING",Ar="SAVED_SEARCHES_SET_SEARCH_VALUE",Rr="SAVED_SEARCHES_APPLY_ITEM",_r="SAVED_SEARCHES_SET_TOTAL_LOADING",Ir="SAVED_SEARCHES_LOAD_TOTAL",Nr="SAVED_SEARCHES_TOGGLE_SORT",Pr="RECENT_SEARCHES_CREATE",Dr="RECENT_SEARCHES_LOAD",kr="RECENT_SEARCHES_SET_ITEMS",Lr="RECENT_SEARCHES_SET_ITEM_TOTAL",Ur="RECENT_SEARCHES_SELECT_ITEM",jr="RECENT_SEARCHES_SELECT_ALL_ITEMS",Fr="RECENT_SEARCHES_DESELECT_ALL_ITEMS",Mr="RECENT_SEARCHES_DELETE_SELECTED_ITEMS_REQUEST",Vr="RECENT_SEARCHES_DELETE_ITEMS",Br="RECENT_SEARCHES_DELETE_ITEM_REQUEST",zr="RECENT_SEARCHES_SET_LOADING",Hr="RECENT_SEARCHES_SET_SEARCH_VALUE",Yr="RECENT_SEARCHES_SET_LAST_SAVED",Wr="RECENT_SEARCHES_SET_TOTAL_LOADING",Gr="RECENT_SEARCHES_LOAD_TOTAL",qr="RECENT_SEARCHES_APPLY_ITEM";function Zr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){$r(e,t,r[t])}))}return e}function $r(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Kr={currentSearch:null,postSavingAction:null,changeIndicator:!1,items:[],loading:!1,total:0,page:0,rowsPerPage:Z.Tu[0],searchValue:"",findPublic:!0,favoriteOnly:!1,sorting:{order:Z.rX.DESC,field:Z.KY.updateDate}},Xr=(0,I.Ic)("changeIndicator"),Qr=(0,I.Ic)("items"),Jr=(0,I.Ic)("total"),en=(0,I.Ic)("page"),tn=(0,I.Ic)("loading"),rn=(0,I.Ic)("postSavingAction"),nn=(0,I.Ic)("sorting"),an=(e,t,r)=>{const n=Qr.get(r).findIndex((e=>e.uri===t)),a=Qr.compose((0,I.ET)([n])),i=a.get(r);return a.set(r,e(i))},on=(e,t,r)=>(0,_.evolve)({page:(0,_.always)(0),[e]:(0,_.always)(t)},r),ln=(e=Kr,t)=>{switch(t.type){case rr:return(0,_.evolve)({currentSearch:(0,_.always)(t.payload),changeIndicator:null===t.payload?(0,_.always)(!1):_.identity},e);case U.Z.CLEAR_ALL:return(0,_.evolve)({currentSearch:(0,_.always)(null),changeIndicator:(0,_.always)(!1)},e);case nr:return Xr.set(e,t.payload);case or:return Jr.set(e,t.payload);case cr:return en.set(e,t.payload);case ur:return on("rowsPerPage",t.payload,e);case pr:{const{findPublic:r,favoriteOnly:n}=t.payload;return(0,_.evolve)({page:(0,_.always)(0),findPublic:(0,_.always)(r),favoriteOnly:(0,_.always)(n)},e)}case lr:return Qr.set(e,t.payload);case dr:{const{uri:r,checked:n}=t.payload;return an((e=>Zr({},e,{checked:n})),r,e)}case fr:{const t=Qr.get(e);return Qr.set(e,t.map((0,_.omit)(["checked"])))}case mr:{const t=Qr.get(e);return Qr.set(e,t.map((0,_.ifElse)((0,_.prop)("isOwnSearch"),(0,_.assoc)("checked",!0),_.identity)))}case Cr:{const r=t.payload,n=Qr.get(e),a=Jr.set(e,Jr.get(e)-r.length);return Qr.set(a,n.filter((e=>!r.includes(e.uri))))}case gr:{const{uri:r,isPublic:n}=t.payload;return an((e=>Zr({},e,{isPublic:n})),r,e)}case Er:{const{uri:r,isFavorite:n}=t.payload;return an((e=>Zr({},e,{isFavorite:n})),r,e)}case sr:{const{uri:r,total:n}=t.payload;return an((e=>Zr({},e,{total:n})),r,e)}case Or:{const{uri:r,isEditing:n}=t.payload;return an((e=>Zr({},e,{isEditing:n})),r,e)}case vr:{const{uri:r}=t.payload;return an((0,_.omit)(["isEditing"]),r,e)}case Tr:{const{uri:r,name:n}=t.payload;return an((e=>Zr({},e,{name:n})),r,e)}case wr:return tn.set(e,t.payload);case Hr:case Ar:return on("searchValue",t.payload,e);case ir:return Zr({},e,{page:0,findPublic:!0,favoriteOnly:!1});case Nr:{const n=t.payload,a=(0,_.path)(["sorting","field"],e),i=(0,_.path)(["sorting","order"],e);return nn.set(e,{field:n,order:(r=n===a?i:null,r===Z.rX.DESC?Z.rX.ASC:Z.rX.DESC)})}case _r:{const{uri:r,isLoading:n}=t.payload;return an((e=>Zr({},e,{isTotalLoading:n})),r,e)}case fe:return rn.set(e,t.payload.postSavingAction);case me:return on("searchValue",Kr.searchValue,e)}var r;return e};function sn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){cn(e,t,r[t])}))}return e}function cn(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const un={items:[],filterWord:null,loading:!1,lastSavedRecentSearch:null},pn=(0,I.Ic)("items"),dn=(0,I.Ic)("loading"),mn=(0,I.Ic)("filterWord"),fn=(0,I.Ic)("lastSavedRecentSearch"),yn=(e,t,r)=>{const n=pn.get(r).findIndex((e=>e.createdDate===t)),a=pn.compose((0,I.ET)([n])),i=a.get(r);return a.set(r,e(i))},gn=(e=un,t)=>{switch(t.type){case Ar:case Hr:return mn.set(e,t.payload);case kr:return pn.set(e,t.payload);case Ur:{const{searchCreatedDate:r,checked:n}=t.payload;return yn((e=>sn({},e,{checked:n})),r,e)}case Fr:{const t=pn.get(e);return pn.set(e,t.map((0,_.omit)(["checked"])))}case jr:{const t=pn.get(e);return pn.set(e,t.map((0,_.assoc)("checked",!0)))}case Vr:{const r=(t.payload||[]).map((0,_.prop)("createdDate")),n=pn.get(e);return pn.set(e,n.filter((e=>!r.includes(e.createdDate))))}case Lr:{const{searchCreatedDate:r,total:n}=t.payload;return yn((e=>sn({},e,{total:n})),r,e)}case zr:return dn.set(e,t.payload);case Yr:return fn.set(e,t.payload);case Wr:{const{searchCreatedDate:r,isLoading:n}=t.payload;return yn((e=>sn({},e,{isTotalLoading:n})),r,e)}case me:return mn.set(e,un.filterWord)}return e},hn="ENTITY_SET_LOADING",En="ENTITY_LOAD_ENTITY_REQUEST",bn="ENTITY_SET_SELECTED_ENTITY_URI",vn="ENTITY_SET_ENTITY",Tn={loading:!1,selectedEntityUri:null,entity:null},On=(0,I.Ic)("loading"),Sn=(0,I.Ic)("selectedEntityUri"),xn=(0,I.Ic)("entity"),Cn=(e=Tn,t)=>{switch(t.type){case hn:return On.set(e,t.payload);case bn:return Sn.set(e,t.payload);case vn:return xn.set(e,t.payload);case D.profile.constants.ProfileActions.ADD_NEXT_PAGE_ATTRIBUTE_VALUES:{const{parentUri:r,attributeTypeName:n,attributeTypeUri:a,values:i}=t.payload,o=(0,S.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 D.search.constants.SEARCH_RESULTS_SET:if((0,S.isEmptyValue)(t.payload)){const t=xn.set(e,Tn.entity);return Sn.set(t,Tn.selectedEntityUri)}return e}return e},wn="BULK_UPDATE_SET_ACTIVE_STEP",An="BULK_UPDATE_INIT",Rn="BULK_UPDATE_TOGGLE_SELECTION_MODE",_n="BULK_UPDATE_SELECT_ENTITY",In="BULK_UPDATE_SELECT_ALL_ENTITIES_ON_PAGE",Nn="BULK_UPDATE_SET_LOADING",Pn="BULK_UPDATE_CHANGE_ROWS_PER_PAGE",Dn="BULK_UPDATE_CHANGE_PAGE",kn="BULK_UPDATE_CHANGE_SORT",Ln="BULK_UPDATE_CHANGE_COLUMNS",Un="BULK_UPDATE_UPDATE_ENTITIES",jn="BULK_UPDATE_SET_FILTER_TEXT",Fn="BULK_UPDATE_SET_TOTAL",Mn="UPDATE_BULK_UPDATE_CURRENT_ENTITIES",Vn="BULK_UPDATE_SET_OPERATION",Bn="BULK_UPDATE_SET_ACTION_ATTRIBUTE",zn="BULK_UPDATE_SET_ACTION_OPERATION",Hn="BULK_UPDATE_ADD_OPERATION_PARAMETERS",Yn="BULK_UPDATE_DELETE_ACTION",Wn="BULK_UPDATE_TOGGLE_CONDITIONS",Gn="BULK_UPDATE_ADD_CONDITION_AFTER",qn="BULK_UPDATE_CHANGE_CONDITION_DATA",Zn="BULK_UPDATE_TOGGLE_CONDITION_SELECT",$n="BULK_UPDATE_DELETE_CONDITION",Kn="BULK_UPDATE_SET_CONDITION_FILTER",Xn="BULK_UPDATE_SET_CONDITION_VALUES",Qn="BULK_UPDATE_TOGGLE_ACTION_PIN",Jn="BULK_UPDATE_TOGGLE_ACTION_ADD_NESTED",ea="BULK_UPDATE_CONFIRM",ta="BULK_UPDATE_SET_REQUEST_PENDING";var ra=r(39705);function na(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){aa(e,t,r[t])}))}return e}function aa(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ia={objects:{selectionMode:Z.v6.exclude,selectedEntities:[],entities:[],total:0,page:0,rowsPerPage:Z.Tu[0],filterText:"",sortOrder:null,sortField:null,selectedColumns:[]},actions:[],operation:null,activeStep:0,loading:!1,requestPending:!1},oa=(0,I.Ic)("activeStep"),la=(0,I.Ic)("operation"),sa=(0,I.Ic)("loading"),ca=(0,I.Ic)("requestPending"),ua=(0,I.ET)("objects","total"),pa=(0,I.ET)("objects","page"),da=(0,I.ET)("objects","rowsPerPage"),ma=(0,I.ET)("objects","selectionMode"),fa=(0,I.ET)("objects","entities"),ya=(0,I.ET)("objects","selectedEntities"),ga=(0,I.ET)("objects","filterText"),ha=e=>ma.get(e)===Z.v6.include,Ea=(0,I.ET)("objects","sortOrder"),ba=(0,I.ET)("objects","sortField"),va=(0,I.ET)("objects","selectedColumns"),Ta=["actions"],Oa=(0,I.ET)(...Ta),Sa=({groupId:e,state:t})=>{if(e){const r=Oa.get(t).findIndex((t=>t.id===e));if(-1!==r)return[...Ta,r,"actions"]}return Ta},xa=(e,t)=>({id:(0,Ge.x0)(),operation:e,operationParameters:t}),Ca=e=>((0,_.path)(["attributeTypeData","fieldName"],e)||"").split(".").slice(0,2).join("."),wa=(e,t)=>({id:(0,Ge.x0)(),fieldName:Ca(t),actions:[xa(e,t)]}),Aa=({state:e,id:t,groupId:r,operation:n,operationParameters:a,togglePin:i,toggleAddNested:o})=>{const l=Sa({state:e,groupId:r}),s=(0,I.ET)(...l).get(e),c=!r&&(0,_.prop)("attributeTypeData",a)&&(({attributeType:e,fieldName:t=""})=>(0,S.isComplexAttribute)(e)||t.split(".").length>2)(a.attributeTypeData);if(t){const r=s.findIndex((e=>e.id===t)),p=(0,I.ET)(...l,r),d=na({},p.get(e));if(n&&d.operation!==n){if(d.operationParameters){const e=[d.operation,n].includes(ra.d.RepointReference)?[]:Z.KJ[n];d.operationParameters=(0,_.omit)((0,_.without)(e,["attributeValue","attributeValueToFind"]),d.operationParameters)}d.operation=n}return a&&(d.operationParameters=(0,_.reject)(_.isNil,na({},d.operationParameters,a))),i&&(d.operationParameters=na({},d.operationParameters,{pin:!(0,_.path)(["operationParameters","pin"],d)})),o&&(d.operationParameters=na({},d.operationParameters,{addNestedAttribute:!(0,_.path)(["operationParameters","addNestedAttribute"],d)})),p.set(e,c?wa((u=d).operation,u.operationParameters):d)}{const t=(0,_.reject)(_.isNil,a),r=c?wa(n,t):xa(n,t);return(0,I.ET)(...l,s.length).set(e,r)}var u},Ra=xt(Ta),_a=Ct(Ra,"conditions"),Ia=wt(_a),Na=At(_a),Pa=Rt(Na),Da=_t(Na),ka=(e=ia,t)=>{switch(t.type){case wn:return oa.set(e,t.payload);case An:return na({},ia,{objects:na({},ia.objects,t.payload)});case Un:return fa.set(e,t.payload);case Rn:{const t=ma.set(e,ha(e)?Z.v6.exclude:Z.v6.include);return ya.set(t,[])}case _n:{const{uri:r,checked:n}=t.payload,a=ya.get(e),i=ha(e);return ya.set(e,!!n==!!i?(0,_.uniq)(a.concat(r)):(0,_.without)(r,a))}case In:{const r=t.payload,n=ha(e),a=ya.get(e),i=fa.get(e).map((0,_.prop)("uri"));return ya.set(e,!!r==!!n?(0,_.uniq)(a.concat(i)):(0,_.without)(i,a))}case Nn:return sa.set(e,t.payload);case Dn:return pa.set(e,t.payload);case Pn:{const r=pa.set(e,0);return da.set(r,t.payload)}case kn:{const{order:r,field:n}=t.payload,a=ba.set(e,n);return Ea.set(a,r)}case Ln:return va.set(e,t.payload);case Fn:return ua.set(e,t.payload);case jn:{const{filterText:r}=t.payload;return ga.set(e,r)}case Vn:return la.set(e,t.payload);case Bn:{const{id:r,groupId:n,attribute:a}=t.payload;return Aa({state:e,id:r,groupId:n,operationParameters:{attributeTypeData:a,attributeValue:null,attributeValueToFind:null,pin:null,addNestedAttribute:null}})}case zn:{const{id:r,groupId:n,operation:a}=t.payload;return Aa({state:e,id:r,groupId:n,operation:a})}case Hn:{const{id:r,groupId:n,operationParameters:a}=t.payload;return Aa({state:e,id:r,groupId:n,operationParameters:a})}case Qn:{const{id:r,groupId:n}=t.payload;return Aa({state:e,id:r,groupId:n,togglePin:!0})}case Jn:{const{id:r,groupId:n}=t.payload;return Aa({state:e,id:r,groupId:n,toggleAddNested:!0})}case Yn:{const{id:r,groupId:n}=t.payload,a=Sa({state:e,groupId:n}),i=(0,I.ET)(...a),o=i.get(e);return i.set(e,o.filter((e=>e.id!==r)))}case Wn:{const r=t.payload,n=Oa.get(e).findIndex((e=>e.id===r)),a=(0,I.ET)(...Ta,n),i=a.get(e);return a.set(e,i.conditions?(0,_.omit)(["conditions"],i):(0,_.assoc)("conditions",[],i))}case Gn:{const{groupId:r,attributeId:n,attribute:a}=t.payload;return It({state:e,groupId:r,attributeId:n,attribute:a,getAttributesLens:_a,getAttributeIndex:Ia})}case qn:{const{groupId:r,attributeId:n,attributeData:a}=t.payload;return Nt({state:e,groupId:r,attributeId:n,attributeData:a,setAttributeProp:Pa,getAttributeLens:Na})}case $n:{const{groupId:r,attributeId:n}=t.payload;return Dt({state:e,groupId:r,attributeId:n,getAttributesLens:_a})}case Kn:{const{groupId:r,attributeId:n,filter:a}=t.payload;return Lt({state:e,groupId:r,attributeId:n,filter:a,getAttributeProp:Da,setAttributeProp:Pa})}case Xn:{const{groupId:r,attributeId:n,values:a}=t.payload;return Ut({state:e,groupId:r,attributeId:n,values:a,setAttributeProp:Pa})}case ta:return ca.set(e,t.payload)}return e};var La=r(85383),Ua=r(82349),ja=r(12848),Fa=r(33192),Ma=r.n(Fa),Va=r(43717);const Ba=(e,t,r)=>{const n=za(t);if(n.length){const i=Ya(e,t,r),o=Ha(e,t,r),l=o.every((e=>(0,S.isTypeSearchGroupAttribute)({data:e})||i.some((0,_.eqProps)("fieldName",e)))),s=(0,S.areAllOperatorsAnd)(t),c=(0,S.areAllOperatorsAnd)(n),u=n.every((({filter:e,data:{attrType:t={}}})=>[S.FilterOptions.EQUALS,S.FilterOptions.IN_RANGE,S.FilterOptions.FULL_TEXT,S.FilterOptions.ON,S.FilterOptions.WITHIN].includes(e)||S.FilterOptions.EXISTS===e&&(0,S.isBooleanType)(t.type))),p=(a=n,!Object.values(a.reduce(((e,{data:{fieldName:t},filter:r,values:n})=>(r===S.FilterOptions.EQUALS&&(0,_.path)([0,"length"],n)&&(e[t]=e[t]&&e[t]+1||1),e)),{})).some((e=>e>1)));return o.length&&s&&c&&u&&n.every((e=>e.data.attrType.faceted))&&l&&p}var a;return!0},za=e=>e.flatMap((e=>e.attributes)).filter((0,_.has)("data")),Ha=(e,t,r)=>{const n=za(t).map((({data:{fieldName:e,entityTypeUri:t},filter:r,values:n})=>({entityTypeUri:t,fieldName:e,filter:r,values:n}))).reduce(((t,{entityTypeUri:n,fieldName:a,filter:i,values:o})=>{const{attrType:l}=n?(0,N.eC)(e,[n],[],r).find((e=>e.fieldName===a))||{}:(0,Va.zH)(a,r)||{},s=!(0,_.isNil)(l)&&l.faceted?((e,t,r,n)=>{if(![S.FilterOptions.EQUALS,S.FilterOptions.IN_RANGE].includes(t)&&![S.FilterOptions.ON,S.FilterOptions.WITHIN].includes(t)||!Array.isArray(e)||(0,S.isEmptyValue)(e[0]))return(0,S.isBooleanType)(n)&&t===S.FilterOptions.EXISTS?[!0,!1]:e&&!(0,S.isEmptyValue)(e[0])?[e[0]]:[];switch(r){case S.FACET_TYPES.NUMERIC_RANGE_FACET:return((e,t)=>{switch(t){case S.FilterOptions.EQUALS:return e.map((e=>[e,e]));case S.FilterOptions.IN_RANGE:return e.some(S.isEmptyValue)?[]:[e]}})(e[0],t);case S.FACET_TYPES.DATE_RANGE_FACET:return((e,t)=>{switch(t){case S.FilterOptions.ON:{const t=Ma()(e),r=!(0,S.isTimestampBasedType)(n);return[[S.utils.dates.getStartOfDay(t,r),S.utils.dates.getEndOfDay(t,r)]]}case S.FilterOptions.WITHIN:return(0,S.isDateRangeValue)(e)?[(0,S.getDateRangeByValue)(e)]:e.some(S.isEmptyValue)?[]:[e]}})(e[0],t);default:return e[0]}})(o,i,(0,S.getFacetTypeForAttrType)(l),l.type):o;return(0,_.isNil)(s)||(t[a]=(0,_.uniq)((t[a]||[]).concat(s))),t}),{}),a=Object.keys(n).map((e=>({fieldName:e,values:n[e]})));return a.some((({values:e})=>e&&Array.isArray(e[0])&&e.length>1))?[]:a},Ya=(e,t,r)=>{const n=(0,ft.VO)(t);return(0,N.eC)(e,n,[],r)},Wa=(e,t)=>({type:U.Z.UPDATE_ENTITIES,payload:{searchResults:e,entityTypeUri:t}}),Ga=({silent:e})=>({type:U.Z.CLEAR_ALL,payload:{silent:e}}),qa=({entityTypeUri:e,keywordValue:t})=>({type:U.Z.SHOW_MORE_RESULTS_FOR_ENTITY_TYPE,payload:{entityTypeUri:e,keywordValue:t}}),Za=e=>({type:U.Z.UPDATE_TOTAL,payload:e}),$a=e=>({type:U.Z.CHANGE_LOADING,payload:e}),Ka=(e,t=null,r=!1)=>({type:U.Z.MAP_CHANGE_VALUE,payload:{value:e,searchType:t,silent:r}}),Xa=(e,t)=>({type:L.k.CREATE_FACETS,payload:{facetsConfigs:e,addToEnd:t}}),Qa=e=>({type:L.k.DESTROY_FACETS,payload:e}),Ja=(e,t,r=!1)=>({type:L.k.CHANGE_VALUES,payload:{facetFieldName:e,values:t,silent:r}}),ei=e=>({type:L.k.UPDATE_DATA,payload:e}),ti=e=>({type:L.k.UPDATE_FILTERED_DATA,payload:e}),ri=({facetsToAdd:e,fieldNamesToDelete:t,changedEntityTypes:r,addToEnd:n})=>({type:L.k.HANDLE_CONFIGS_CHANGES,payload:{facetsToAdd:e,fieldNamesToDelete:t,changedEntityTypes:r,addToEnd:n}});var ni=r(5236),ai=r(54145),ii=r(55443),oi=r(65751),li=r.n(oi);const si=e=>{(0,ii.U)(e,{title:li().text("Server Error"),defaultMessage:li().text("Something went wrong...")})};var ci=r(21430);const ui=(e,t,r)=>`${e}/recommend/${r}/${t}`,pi=e=>e&&1===e.length?e[0]:null,di=e=>[e].filter((0,_.complement)(S.isComplexAttribute)).map((0,_.compose)(Ua.$9,(0,_.prop)("uri"))).concat((e.children||[]).map(di)).flat(1/0);function*mi(){const e=yield(0,La.RE)(ql),t=yield(0,La.Ys)(k().selectors.getTenant),r=yield(0,La.Ys)(k().selectors.getEnvironment),n=((e,t,r,n,a)=>{const i=e.map((({fieldName:e,values:t})=>({fieldName:e,values:t.map((e=>Array.isArray(e)?JSON.stringify(e):e))}))),o={facets:(0,Ua._e)(i).reduce(((e,t)=>{const r=(t.children||[]).map((e=>JSON.stringify(e)));return e[t.fieldName]=r.length>0?r:t.values.slice().sort(),e}),{}),max:5};return{url:ui(r,n,a),options:{method:"POST",body:JSON.stringify(o),headers:{"Content-Type":"application/json"}}}})(e,0,yield(0,La.Ys)(k().selectors.getServicesPath),t,r);let a;try{a=yield(0,La.RE)(S.rawRequest,n.url,n.options),a=a.filter((e=>"type"!==e)).slice(0,5)}catch(e){a=[]}const i=yield(0,La.Ys)(k().selectors.getMetadata),o=yield(0,La.Ys)(P.DX);a=((e,t=[],r)=>{const n=pi(r),a=n&&(0,S.getEntityType)(e,n),i=(0,ci.vf)(e,a||{}).map(di).flat(1/0);return t.filter((e=>n||!e.startsWith("attributes."))).filter((e=>!e.startsWith("attributes.")||i.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=pi(n);if(t){const r=((0,S.getEntityType)(e,t).defaultFacetedAttributes||[]).map((r=>(0,S.findAttributeTypeByUri)(e,r,t))).filter((e=>e&&(0,S.isReadableAttribute)(e)&&!(0,S.isComplexAttribute)(e))).map((0,_.prop)("uri")).map(Ua.$9).filter(a);i=i.concat(r)}if(i.length<o){const e=(0,N.Xk)().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,La.gz)((s=a,{type:L.k.SET_RECOMMENDED_FACETS_LIST,payload:s}))}const fi=e=>({type:de,payload:e}),yi=e=>({type:me,payload:e}),gi=(e,t)=>({type:fe,payload:{show:e,postSavingAction:t}}),hi=e=>({type:ye,payload:e}),Ei=(e,t,r)=>({type:ve,payload:{entityTypeUri:e,columns:t,prevColumns:r}}),bi=(e,t=!1)=>({type:Te,payload:{entityTypeUri:e,silent:t}}),vi=e=>({type:Oe,payload:e}),Ti=()=>({type:Ce}),Oi=e=>({type:we,payload:e}),Si=e=>Oi({payload:{message:e,action:null},type:Z.GT.info}),xi=({message:e,actionLabel:t,actionToDispatch:r,autoHideDuration:n})=>Oi({payload:{message:e,action:{actionLabel:t,actionToDispatch:r},autoHideDuration:n},type:Z.GT.info}),Ci=e=>({type:Re,payload:e}),wi=e=>({type:ge,payload:e});var Ai=r(90503),Ri=r(82877);const _i=(e={},t="")=>Object.keys(e).filter((r=>S.utils.strings.search(r,t)||S.utils.strings.search(e[r].displayName,t))),Ii=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)}},Ni=(e,t)=>e===t,Pi=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((({type:e,codeValues:r})=>{!this._lookupValuesResolveTasks[e]&&(this._lookupValuesResolveTasks[e]={}),r.forEach((r=>{this._lookupValuesResolveTasks[e][r]=t}))}))}deleteTask(e){e.forEach((({type:e,codeValues:t})=>{this._lookupValuesResolveTasks[e]&&t.forEach((t=>{delete this._lookupValuesResolveTasks[e][t]})),(0,_.isEmpty)(this._lookupValuesResolveTasks[e])&&delete this._lookupValuesResolveTasks[e]}))}getRunningTasks(e){const t=e.flatMap((({type:e,codeValues:t})=>this._lookupValuesResolveTasks[e]?t.reduce(((t,r)=>{const n=this._lookupValuesResolveTasks[e][r];return n&&t.push(n),t}),[]):[]));return(0,_.uniqWith)(Ni,t)}clearTasks(){this._lookupValuesResolveTasks=Object.create(null)}};function*Di(e,t){try{yield(0,La.RE)(e,...t)}catch(e){console.warn(e)}}const ki=(e,...t)=>(0,La.rM)(Di,e,t);function*Li(e){const t=Pi.getRunningTasks(e);t.length>0&&(yield(0,La.v_)(t))}function*Ui(e){try{const t=e.flatMap((({type:e,codeValues:t})=>t.map((t=>({type:e,codeValue:t}))))),r=yield ki(S.resolveLookupsList,t);Pi.addTask(e,r);const n=(yield(0,La.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,La.gz)(D.profile.lookups.actions.lookupsForTypeResolved({type:e,values:n[e]}))}catch(e){console.warn(e)}finally{Pi.deleteTask(e)}}function*ji(e){if((0,_.isEmpty)(e))return;const t=e.map((({type:e,codeValues:t})=>{const r=Pi.isLookupValueResolveTaskRunning(e);return{type:e,codeValues:t.filter((0,_.complement)(r))}})).filter((({codeValues:e})=>e.length>0));t.length>0&&(yield(0,La.RE)(Ui,t)),yield(0,La.RE)(Li,e)}function*Fi(e,t,r=Z.cu,n=1){const a=!t&&1===n,i=`${e}${r}`,o=a&&Ii.getRunningTask(i);if(o)yield(0,La.v_)(o);else try{const o=yield ki(S.getDependentLookups,{type:e,displayNamePrefix:t,max:r,offset:r*(n-1)});a&&Ii.addTask(i,o);const l=yield(0,La.v_)(o);yield(0,La.gz)(D.profile.lookups.actions.lookupsForTypeResolved({type:e,values:l.codeValues[e]}))}catch(e){console.warn(e)}finally{a&&Ii.deleteTask(i)}}const Mi=(e,t,r)=>e.slice((r-1)*t,t*r);function*Vi(e,t,r,n=1){const a=yield(0,La.Ys)(k().selectors.getLookups),i=_i(a[e],t);if(i.length>=r*n)return Mi(i,r,n);yield(0,La.RE)(Fi,e,t,r,n);const o=yield(0,La.Ys)(k().selectors.getLookups);return Mi(_i(o[e],t),r,n)}const Bi=(e,t)=>Object.keys(e).filter((e=>(0,ja.iL)(e,t))).reduce(((r,n)=>(r[(0,ja.iL)(n,t).fieldName]=e[n],r)),{});function zi(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Hi(e,t,r[t])}))}return e}function Hi(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*Yi(e,t,r){if((0,_.isEmpty)(e))return;const n=yield(0,La.Ys)(k().selectors.getLookups),a=yield(0,La.Ys)(k().selectors.getMetadata),i=Bi(r,e),o=yield(0,La.Ys)(Ri.Xf);yield(0,La.gz)(t((0,ja.HC)(a,i,e,n,{allowedEntityTypes:o})))}function*Wi(e,t,r){try{const n=yield(0,La.RE)(Dl,e.url,e.options),[a,i]=(0,_.partition)(N._H,t);yield(0,La.rM)(Yi,i,r,n),yield(0,La.RE)(Xi,a,n),yield(0,La.RE)(Yi,a,r,n)}catch(e){console.warn(e)}}function*Gi(e,t,r){e=zi({},e,{includeFilter:[]});const n=yield(0,La.Ys)(k().selectors.getGlobalSearchRequestOptions),a=(0,Ua.aw)([e],t,[e.fieldName],n);yield(0,La.RE)(Wi,a,[e],r)}const qi=(e,t=[])=>t.filter((({label:t})=>S.utils.strings.search(t,e))),Zi=(e,t)=>qi(t,e).map((0,_.prop)("value"));function*$i(e,t,r,n){const a=zi({},e),i=[...t];if((0,N._H)(a)){const t=(0,S.getAttrTypeLookupCode)(e.attrType);a.includeFilter=yield(0,La.RE)(Vi,t,r,(0,_.propOr)(Z.cu,"pageSize",a),a.pageNumber)}else if("sourceSystems"===a.fieldName){const{sources:e}=yield(0,La.Ys)(k().selectors.getMetadata);a.includeFilter=((e,t)=>qi(t,e).map((({uri:e})=>(0,S.getLastUriPart)(e))))(e,r)}else if((0,N.S9)(a)){const t=yield(0,La.Ys)(k().selectors.getMetadata),n=(0,S.getEntityType)(t,a.entityTypeUri)||{},i=(0,_.pipe)((0,_.propOr)([],"displayedItems"),(0,_.filter)((0,_.propEq)("isRaw",!0)))(e);a.includeFilter=[...(o=n.matchGroups,l=r,qi(l,o).map((0,_.prop)("uri"))),...Zi(i,r)]}else a.disableIncludeFilter=!0,i.push({values:[r],fieldName:e.fieldName,filter:"containsWordStartingWith",forceInclude:!0});var o,l;const s=yield(0,La.Ys)(k().selectors.getGlobalSearchRequestOptions),c=(0,Ua.aw)([a],i,[e.fieldName],s);yield(0,La.RE)(Ki,c,e,a.includeFilter,n)}function*Ki(e,t,r,n){try{const a=yield(0,La.RE)(Dl,e.url,e.options),i=yield(0,La.Ys)(k().selectors.getLookups),o=Bi(a,[t]);if(r){const e=t.fieldName;o[e]=(0,ja.AX)(o[e],r)}const l=yield(0,La.Ys)(k().selectors.getMetadata),s=yield(0,La.Ys)(Ri.Xf);yield(0,La.gz)(n((0,ja.HC)(l,o,[t],i,{allowedEntityTypes:s})))}catch(e){console.warn(e)}}function*Xi(e,t){const r=yield(0,La.Ys)(k().selectors.getLookups),n=(0,ja.U4)(e,r),a=((e,t,r)=>{const n=((e,t)=>(0,_.pipe)(Object.entries,(0,_.reduce)(((e,[r,n])=>{const a=t.find((0,_.propEq)("fieldName",r));if(!a)return e;const{attrType:i}=a,o=(0,S.getAttrTypeLookupCode)(i);return e[o]={type:o,codeValues:(0,_.uniq)([...(0,_.pathOr)([],[o,"codeValues"],e),...Object.keys(n)])},e}),{}),_.values)(e))(e,t);return(0,S.getUnresolvedLookupsList)(r,n)})(t,e,r),i=(0,S.mergeLookupsLists)(n,a);i.length&&(yield(0,La.RE)(ji,i))}var Qi=r(59295);function Ji(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){eo(e,t,r[t])}))}return e}function eo(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*to(){const e=yield(0,La.Ys)(k().selectors.getMetadata),t=yield(0,La.Ys)(Ri.Xf),r=yield(0,La.Ys)(Ri.sl);return(0,Ai.wM)(e,t,r)}const ro=e=>({value:t})=>!e.length||e.includes(t);function*no(e){e=e||(yield(0,La.Ys)(ai.FR));const t=yield(0,La.Ys)(Ri.XM);if((0,Ai.gj)(t)){const t=yield(0,La.Ys)(k().selectors.getMetadata),r=yield(0,La.Ys)(Qi.V6),n=(0,N.$t)(t),a=yield(0,La.Ys)(k().selectors.getGlobalSearchRequestOptions),i=(0,Ua.aw)([n],e,[n.fieldName],a),o=({type:e=[]})=>{const t=e.filter(ro(r));return vi(t)};yield(0,La.RE)(Wi,i,[n],o)}else yield(0,La.gz)(vi([]))}function*ao(){const e=yield(0,La.Ys)(k().selectors.getMetadata),t=yield(0,La.Ys)(Ri.Xf),r=yield(0,La.Ys)(Qi.V6);return(0,ja.wW)(e,{},t).filter(ro(r))}function*io(){const e=yield(0,La.Ys)(k().selectors.getMetadata),t=yield(0,La.RE)(to),r=yield(0,La.Ys)(Ri.uJ),n=(0,Ai.oX)().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,r])=>[t,(0,Ai.Wh)(e,t,(0,_.map)((0,_.prop)("id"),r)).map(((e,t)=>{const n=r.find((0,_.propEq)("id",e.id)),{size:a,autoResize:i=0!==t&&!a}=n||{};return(0,_.reject)(_.isNil,Ji({},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,La.gz)((s=Ji({},t,(0,_.pick)(o,a)),{type:be,payload:s})))}function*oo(){const e=yield(0,La.Ys)(k().selectors.getMetadata),t=yield(0,La.Ys)(P.DX),r=(yield(0,La.Ys)(Ri.IJ))?yield(0,La.RE)(ao):yield(0,La.RE)(as),n=(0,Ai.nx)(e,r,t).map((0,_.prop)("value")),a=yield(0,La.Ys)(Ri.o4);n.includes(a)||(yield(0,La.gz)(bi(n[0],!0)))}function*lo(e={}){const{silent:t}=e.payload||{};if(!t){const e=yield(0,La.Ys)(Ri.tB),t=yield(0,La.Ys)(ai.t9);if((0,S.isAvailableEntityTypeForDataTenant)(t,e)){const t=yield(0,La.Ys)(ai.BP,{entityTypeUri:e});(0,_.isNil)(t)&&(yield(0,La.gz)({type:U.Z.REFRESH_DISPLAYED_ENTITIES}))}else yield(0,La.gz)(Wa([],e))}}function*so(e){const t=e.payload;yield(0,La.RE)(lo,e);const r=yield(0,La.Ys)(Ri.gu);if((0,Ai.gj)(t)&&0===r.length){const e=yield(0,La.RE)(ao);yield(0,La.gz)(vi(e)),yield(0,La.RE)(no)}}function*co(){const e=yield(0,La.Ys)(Ri.qx),t=yield(0,La.Ys)(ai.Qy);e!==Z.om.MAP&&t.length&&(yield(0,La.gz)(Ka(null)))}function*uo(e){const t=(0,S.removeDtssPrefixFromEntityUri)(e.payload.uri),r=yield(0,La.Ys)(Ri.tB),n=((yield(0,La.Ys)(ai.BP,{entityTypeUri:r}))||[]).map((0,_.prop)("uri")),a=(yield(0,La.Ys)(ai.fx,{entityTypeUri:r}))||0,i=(yield(0,La.Ys)(ai.Uz,{entityTypeUri:r}))||Z.Tu[0],o=n.indexOf(t)+a*i,l=yield(0,La.Ys)(ai.NU,{entityTypeUri:r}),s=yield(0,La.Ys)(k().selectors.getTenant),c=yield(0,La.Ys)(ai.lF);yield(0,La.gz)(D.search.actions.setSearchNavigationData({uri:t,index:o,total:l,tenant:c||s,cache:n}))}const po=[function*(){yield(0,La.Fm)(Te,lo)},function*(){yield(0,La.Fm)(Ae,so)},function*(){yield(0,La.Fm)([qe,Ze,Ke],oo)},function*(){yield(0,La.Fm)(Re,co)},function*(){yield(0,La.Fm)(D.ui.constants.UIActions.OPEN_ENTITY,uo)}],mo=e=>({type:rr,payload:e}),fo=e=>({type:nr,payload:e}),yo=()=>({type:fr}),go=e=>({type:Cr,payload:e}),ho=e=>({type:wr,payload:e}),Eo=(e,t)=>({type:_r,payload:{uri:e,isLoading:t}});var bo=r(90533),vo=r(86374),To=r(4898);function Oo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){So(e,t,r[t])}))}return e}function So(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*xo(){yield(0,La.gz)(ho(!0));try{const t=yield(0,La.Ys)(k().selectors.getUserName),r=e=>Oo({},e,{isOwnSearch:t===e.owner}),n=yield(0,La.RE)(Co),{result:a=[],total:i}=yield(0,La.RE)(S.getSavedSearches,n);yield(0,La.gz)((e=>({type:or,payload:e}))(i));const o=yield(0,La.Ys)(k().selectors.getMetadata),l=yield(0,La.Ys)(k().selectors.getDataTenants),s=yield(0,La.Ys)(k().selectors.getCanUserReadWorkflowDataTask);yield(0,La.gz)((e=a.map(r).map((0,vo.z7)(o,l,s)),{type:lr,payload:e})),yield(0,La.gz)(ho(!1)),yield(0,La.RE)(Ro,a)}catch(e){yield(0,La.gz)(ho(!1))}var e}function*Co(){const e=yield(0,La.Ys)(bo.s6),t=yield(0,La.Ys)(bo.wH),r=yield(0,La.Ys)(bo.U3),n=yield(0,La.Ys)(bo.VS),a=yield(0,La.Ys)(bo.kU),{field:i,order:o}=yield(0,La.Ys)(bo.rT);return{offset:e*t,max:e,containsWordStartingWith:r,favoriteOnly:n,findPublic:a,countResults:!1,sortBy:Z.PW[i],sortOrder:o}}function*wo(e){const t=yield(0,La.Ys)(bo.EH,e.payload);yield(0,La.RE)(Ao,t)}function*Ao(e,t){yield(0,La.gz)(Eo(e.uri,!0));try{const{total:r}=yield(0,La.RE)(S.getTotalsForQuery,(0,S.replacePlaceholdersInQuery)(e.query),Boolean(t));yield(0,La.gz)(((e,t)=>({type:sr,payload:{uri:e,total:t}}))(e.uri,r))}catch(e){si(e)}yield(0,La.gz)(Eo(e.uri,!1))}function*Ro(e){const t=yield(0,La.Ys)(k().selectors.getQueryEstimatorEnabled);return yield(0,La.$6)(e.map((e=>(0,La.RE)(Ao,e,t))))}function*_o(e){const{uri:t,isPublic:r}=e.payload,n=yield(0,La.Ys)(bo.EH,t);if(n){yield(0,La.gz)(ho(!0));try{yield(0,La.RE)(S.markSavedSearchAsPublic,(0,vo.Tp)(n),r),yield(0,La.gz)(((e,t)=>({type:gr,payload:{uri:e,isPublic:t}}))(t,r))}catch(e){si(e)}yield(0,La.gz)(ho(!1))}}function*Io(e){const{uri:t,isFavorite:r}=e.payload,n=yield(0,La.Ys)(bo.EH,t);if(n){yield(0,La.gz)(ho(!0));try{yield(0,La.RE)(S.markSavedSearchAsFavorite,(0,vo.Tp)(n),r),yield(0,La.gz)(((e,t)=>({type:Er,payload:{uri:e,isFavorite:t}}))(t,r))}catch(e){si(e)}yield(0,La.gz)(ho(!1))}}function*No(e){const{uri:t,isGlobalFilter:r}=e.payload,n=yield(0,La.Ys)(bo.EH,t);if(n){const e=(0,vo.V2)(n),{uiState:t}=e,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["uiState"]);(0,S.isObject)("2.0"===t.version?t:t.state)||!r?yield(0,La.gz)(((e,t)=>({type:"SAVED_SEARCHES_MARK_GLOBAL_FILTER",payload:{savedSearch:e,isGlobalFilter:t}}))(Oo({},a,{uiState:t,query:(0,S.replacePlaceholdersInQuery)((0,_.propOr)("","query",a))}),r)):(0,ii.U)({errorMessage:"Saved Search is incorrect"},{title:li().text("Saved Search can't be mark as global")})}}function*Po(e){const{uri:t,name:r}=e.payload,n=yield(0,La.Ys)(bo.EH,t);if(n&&r!==n.name){yield(0,La.gz)(ho(!0));try{yield(0,La.RE)(S.updateSavedSearch,Oo({},(0,vo.Tp)(n),{name:r})),yield(0,La.gz)(((e,t)=>({type:Tr,payload:{uri:e,name:t}}))(t,r))}catch(e){si(e)}yield(0,La.gz)(ho(!1))}}function*Do(){const e=yield(0,La.Ys)(bo.Kh);yield(0,La.gz)(ho(!0));try{yield(0,La.$6)(e.map((e=>(0,La.RE)(S.deleteSavedSearch,e)))),yield(0,La.gz)(go(e.map((0,_.prop)("uri"))))}catch(e){si(e)}yield(0,La.gz)(ho(!1))}function*ko(e){const t=e.payload;yield(0,La.gz)(ho(!0));try{yield(0,La.RE)(S.deleteSavedSearch,{uri:t}),yield(0,La.gz)(go([t]))}catch(e){si(e)}yield(0,La.gz)(ho(!1))}function*Lo(e=!1,t=!1){return{query:yield(0,La.Ys)(bo.Cc,e),uiState:yield(0,La.Ys)(To.Z,t)}}function*Uo({payload:{name:e,share:t}}){const{query:r,uiState:n}=yield(0,La.RE)(Lo,!0),a={isFavorite:!1,isPublic:t===Z.ib.public,name:e,query:r,uiState:n},i=yield(0,La.Ys)(bo.tp);yield(0,La.gz)(gi(!1));try{yield(0,La.gz)(Si(li().text("Saving search...")));const e=yield(0,La.RE)(S.createSavedSearch,[a]);e[0].successful?(yield(0,La.gz)(mo(e[0].object)),yield(0,La.gz)(fo(!1)),yield(0,La.gz)(Si(li().text("Search saved successfully"))),i&&(yield(0,La.gz)(i))):si(e)}catch(e){si(e)}}function*jo(e){const{uri:t,debounceTime:r}=e.payload;yield(0,La.gz)(yi(!1));const n=yield(0,La.Ys)(bo.EH,t),a=(0,bo.In)(n)||{},{errors:i}=a;i&&i.length?((e=[])=>{(0,ii.U)(e,{message:li().text("Saved Search can't be applied")})})(i):(yield(0,La.gz)(mo(n)),(yield(0,La.Ys)(ai.lF))&&(a.currentTenant=yield(0,La.Ys)(k().selectors.getTenant)),yield(0,La.gz)(D.search.actions.updateState(Oo({},a,{debounceTime:r}))),yield(0,La.qn)(U.Z.STATE_UPDATED))}const Fo=[function*(){yield(0,La.Fm)([ir,cr,ur,Ar,pr,Nr],xo)},function*(){const e={[yr]:_o,[hr]:Io,[xr]:ko,[Sr]:Do,[vr]:Po,[br]:No},t=yield(0,La.ZO)(Object.keys(e));for(;;){const r=yield(0,La.qn)(t);yield(0,La.RE)(e[r.type],r)}},function*(){yield(0,La.Fm)([tr],Uo)},function*(){yield(0,La.Fm)([Rr],jo)},function*(){yield(0,La.ib)([Ir],wo)}];function*Mo(e){try{yield(0,La.RE)(S.createActivity,{label:S.ACTIVITY_TYPES.userSearch,description:JSON.stringify({activity:e,version:"2.0"})})}catch(e){console.warn(e)}}const Vo=e=>({type:Ze,payload:{groupId:e}}),Bo=(e,t)=>({type:Je,payload:{groupId:e,attributeId:t,attribute:vt()}}),zo=(e,t,r)=>({type:Je,payload:{groupId:e,attributeId:t,attribute:Tt(r)}}),Ho=(e,t,r)=>({type:et,payload:{groupId:e,attributeId:t,attributeData:Ot(r)}}),Yo=(e,t)=>({type:et,payload:{groupId:e,attributeId:t,attributeData:null}}),Wo=(e,t,r)=>({type:tt,payload:{groupId:e,attributeId:t,selectInfo:r}}),Go=(e,t,r)=>({type:rt,payload:{groupId:e,attributeId:t,operator:r}}),qo=(e,t)=>({type:nt,payload:{groupId:e,attributeId:t}}),Zo=(e,t)=>({type:at,payload:{groupId:e,attributeId:t}}),$o=(e,t)=>({type:it,payload:{groupId:e,attributeId:t,id:(0,Ge.x0)()}}),Ko=(e,t,r)=>({type:ot,payload:{groupId:e,attributeId:t,filter:r}}),Xo=(e,t,r)=>({type:lt,payload:{groupId:e,attributeId:t,values:r}}),Qo=(e,{attribute:t,value:r,debounceTime:n=0,pageNumber:a=1,currentOptions:i})=>({type:ct,payload:{groupId:e,attribute:t,value:r,debounceTime:n,pageNumber:a,currentOptions:i}}),Jo=(e,t,r)=>({type:ut,payload:{groupId:e,attributeId:t,values:r}}),el=(e,t)=>({type:pt,payload:{groupId:e,attribute:t}});var tl=r(44006);function*rl({groups:e,findGroupPath:t=St,attributesPropName:r,groupId:n,attributeId:a,selectInfo:i,actions:o}){const{checked:l,attribute:s,index:c,selectedAttributes:u}=i,{addAttributeAfter:p,changeAttribute:d,clearAttribute:m,deleteAttribute:f}=o,y=(0,_.pipe)(t(n),(0,_.path)(_.__,e),(0,_.propOr)([],r))(e),g=e=>(0,_.path)([e,"id"],y),h=y.findIndex((0,_.propEq)("id",a));if(a&&0===c)if(l)yield(0,La.gz)(d(n,a,s));else{let e=u[c+1];e?(yield(0,La.gz)(d(n,a,e)),yield(0,La.gz)(f(n,g(h+1)))):yield(0,La.gz)(m(n,a))}else{const e=u.length-c,t=a?h+c:y.length-e;l?yield(0,La.gz)(p(n,g(t-1),s)):yield(0,La.gz)(f(n,g(t)))}}function nl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){al(e,t,r[t])}))}return e}function al(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*il(e){const{groupId:t,attributeId:r,selectInfo:n}=e.payload,a=yield(0,La.Ys)(Qi.go),i={addAttributeAfter:zo,changeAttribute:Ho,clearAttribute:Yo,deleteAttribute:qo};yield(0,La.RE)(rl,{groups:a,attributesPropName:"attributes",groupId:t,attributeId:r,selectInfo:n,actions:i}),yield(0,La.gz)(Vo(t))}function*ol(e){const{attribute:t,groupId:r}=e.payload,n=yield(0,La.Ys)(Qi._7,r),a=yield(0,La.Ys)(k().selectors.getGlobalSearchRequestOptions),{data:{fieldName:i},values:o}=t,l=yield(0,La.Ys)(ai.L7,n,i),s=nl({},t.data,{values:o?(0,_.flatten)(o):void 0,pageSize:t.data.pageSize+1}),c=(0,Ua.aw)([s],l,[],a);yield(0,La.RE)(Wi,c,[s],(e=>((e,t,r)=>({type:st,payload:{groupId:e,attributeId:t,values:r}}))(r,t.id,e[i])))}function*ll(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,La.gz)(Jo(i,t.id,void 0));else{a&&(yield(0,La.gw)(a));const e=yield(0,La.Ys)(Qi.ad,i,t.id),c=e=>Jo(i,t.id,o.concat(e[s]));if(r){const a=l?[{values:[l],fieldName:"type",filter:"equals"}]:[],i=yield(0,La.Ys)(ai.L7,a,s);yield(0,La.rM)($i,nl({},t.data,{displayedItems:e,pageNumber:n,pageSize:t.data.pageSize+1}),i,r,c)}else{const r=yield(0,La.Ys)(Qi._7,i),a=yield(0,La.Ys)(ai.L7,r,s);yield(0,La.rM)(Gi,nl({},t.data,{displayedItems:e,pageNumber:n,pageSize:t.data.pageSize+1}),a,c)}}}function*sl(){const e=yield(0,La.Ys)(k().selectors.getSearchKeyword),t=yield(0,La.Ys)(ai.vH),r=yield(0,La.RE)(ql),n=yield(0,La.Ys)(k().selectors.getMetadata),a=yield(0,La.Ys)(k().selectors.getDataTenants),i=(0,tl.h)(n,a,r);yield(0,La.gz)(D.search.actions.updateState({advanced:i,keyword:e,map:t}))}function*cl(e){const{groupId:t,attributeId:r}=e.payload;yield(0,La.gz)(qo(t,r)),yield(0,La.gz)(Vo(t))}function*ul(){if(yield(0,La.Ys)(Ri.IJ)){const e=yield(0,La.Ys)(Qi.go),t=yield(0,La.Ys)(Ri.Xf);for(const r of e){const e=r.entityTypes||[];if((t?e.filter((e=>t.includes(e))):e).length!==e.length){yield(0,La.gz)(Ga({silent:!0}));break}}}}const pl=[function*(){yield(0,La.ib)([tt],il)},function*(){yield(0,La.Fm)([ct],ll)},function*(){yield(0,La.ib)(mt,sl)},function*(){yield(0,La.ib)(pt,ol)},function*(){yield(0,La.ib)([at],cl)}];function dl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){ml(e,t,r[t])}))}return e}function ml(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*fl(){const e=yield(0,La.Ys)(ai.FR);yield(0,La.RE)(gl);const t=yield(0,La.Ys)(Ri.tB);var r;yield(0,La.gz)((r=t,{type:U.Z.RESET_PAGE,payload:{entityTypeUri:r}})),yield(0,La.rM)(Zl,e),yield(0,La.rM)(Sl,e),(yield(0,La.Ys)(Ri.IJ))?yield(0,La.rM)(no,e):yield(0,La.rM)(mi)}function*yl(e){const{debounceTime:t}=e.payload||{};t&&(yield(0,La.gw)(t));const r=yield(0,La.Ys)(ai.FR);yield(0,La.rM)(hl,r)}function*gl(){const e=yield(0,La.Ys)(Ri.tB);var t;yield(0,La.gz)((t=e,{type:U.Z.CLEAR_RESULTS,payload:t}))}function*hl(e){const t=yield(0,La.Ys)(k().selectors.getMetadata),r=yield(0,La.Ys)(Ri.tB),n=yield(0,La.Ys)(ai.fx,{entityTypeUri:r}),a=yield(0,La.Ys)(ai.Uz,{entityTypeUri:r}),i=yield(0,La.Ys)(ai.L9,{entityTypeUri:r}),o=yield(0,La.Ys)(ai.NW,{entityTypeUri:r});let l,s=e,c=[];if(r){const n={fieldName:"type",filter:"equals",values:[r]};s=e.filter((e=>"type"!==e.fieldName)).concat(n);const a=yield(0,La.RE)(Ol,r);c=(0,_.uniq)(c.concat(a).concat((0,Ua.kx)(t,s,[Ua.cI]))),l=!0}else c=(0,_.uniq)(c.concat((0,Ua.kx)(t,s,[Ua.Bo,Ua.cI]))),l=!1;const u=dl({page:n,rowsPerPage:a,sortOrder:i,sortField:o,forceOvOnly:l},yield(0,La.Ys)(k().selectors.getGlobalSearchRequestOptions),{select:c}),p=(0,Ua.XP)(s,u),d=yield(0,La.Ys)(ai.lF);yield(0,La.gz)($a(!0));try{let e;if(d){const t=(0,Ua.kH)(s,u);e=yield(0,La.RE)(Dl,t)}else{const t=(0,Ua.Lv)(s,u);e=yield(0,La.RE)(Dl,Z.NV,t)}Array.isArray(e)||(e=[]),yield(0,La.RE)(El,(0,_.reject)(_.isNil,{query:p,sortField:o,sortOrder:i,dataTenant:d})),e=yield(0,La.RE)(Pl,e),yield(0,La.gz)(Wa(e,r))}catch(e){yield(0,La.gz)(Wa([],r))}yield(0,La.gz)($a(!1))}function*El(e){var t;yield(0,La.gz)((t=e.query,{type:U.Z.UPDATE_URL,payload:t}));const r=yield(0,La.Ys)(k().selectors.getSearchProviderData);(0,_.equals)(null==r?void 0:r.data,e)||(yield(0,La.gz)(D.search.actions.setSearchNavigationData(null))),yield(0,La.gz)(D.search.actions.setSearchProviderData({type:"search",data:e}))}function*bl(e){const{columns:t,prevColumns:r}=e.payload;if((0,Ai.tU)(t,r)){const e=yield(0,La.Ys)(Ri.o4),t=(yield(0,La.Ys)(ai.BP,{entityTypeUri:e})).map((e=>e.uri)),r=yield(0,La.RE)(Ol,e),n=yield(0,La.Ys)(ai.FR),a=yield(0,La.Ys)(k().selectors.getGlobalSearchRequestOptions),i=(0,Ua.aG)(t,n,dl({select:r},a));yield(0,La.gz)($a(!0));try{let t=yield(0,La.RE)(Dl,i.url,i.options);t=yield(0,La.RE)(Pl,t),yield(0,La.gz)(Wa(t,e))}catch(t){yield(0,La.gz)(Wa([],e)),si(t)}yield(0,La.gz)($a(!1))}}function*vl(){const e=yield(0,La.Ys)(Ri.tB),t=yield(0,La.Ys)(ai.BP,{entityTypeUri:e});t&&(yield(0,La.gz)(D.search.actions.searchResultsSet(t)))}function*Tl(e){const{entityTypeUri:t,keywordValue:r}=e.payload;yield(0,La.gz)(((e=!1)=>({type:L.k.CLEAR_ALL_VALUES,payload:{silent:e}}))(!0)),yield(0,La.gz)(Ja("type",[t],!0)),yield(0,La.gz)(D.search.actions.keywordUpdated({value:r,isRawFilter:!1}))}function*Ol(e){const t=yield(0,La.Ys)(Ri.Gv,e);return(0,Ai.vw)(t)}function*Sl(e){const t=yield(0,La.Ys)(k().selectors.getGlobalSearchRequestOptions),r=(0,Ua.Vg)(e,[],t);try{const e=yield(0,La.RE)(Dl,Z.jS,{method:"POST",body:JSON.stringify(r)});yield(0,La.gz)(Za(e.total))}catch(e){yield(0,La.gz)(Za(0))}}function*xl(){yield(0,La.RE)(wl);const e=yield(0,La.RE)(Lo,!0);(0,_.isEmpty)(e.query)||(yield(0,La.RE)(Mo,e))}const Cl=[st];function*wl(){for(;yield(0,La.Ys)(Qi.UM);)yield(0,La.qn)(Cl)}function*Al(e){const{debounceTime:t}=e.payload||{};t&&(yield(0,La.gw)(t)),(0,ja.$L)(e)&&(yield(0,La.RE)(es)),(0,_.pathOr)(!1,["payload","silent"],e)||(yield(0,La.RE)(fl),yield(0,La.RE)(xl))}function*Rl(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&&((e=[])=>{(0,ii.U)(e,{message:li().text("Can't apply search state")})})(n),!(null!==(t=yield(0,La.Ys)(k().selectors.getShowSearchByOv))&&void 0!==t?t:yield(0,La.Ys)(Ri.cC))&&r&&r.searchByOv&&(yield(0,La.gz)(D.search.actions.updateSearchOptions({searchByOv:!1,ovOnly:!1}))),yield(0,La.RE)(ns),yield(0,La.RE)(ul),yield(0,La.RE)(io),yield(0,La.RE)(oo),yield(0,La.RE)(_l),yield(0,La.gz)(((e=0)=>({type:U.Z.STATE_UPDATED,payload:{debounceTime:e}}))(a))}function*_l(){const e=yield(0,La.Ys)(Ri.d7),t=yield(0,La.Ys)(ai.Qy);!e&&t.length&&(yield(0,La.gz)(Ka(null,null,!0)))}function*Il(){const e=yield(0,La.Ys)(ai.A7),{activityFilter:t,globalFilter:r}=yield(0,La.Ys)(k().selectors.getGlobalSearchRequestOptions),n=yield(0,La.Ys)(k().selectors.getSearchOptions),a=n&&n.searchByOv,i=[(0,Ua.s4)(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,La.Ys)(k().selectors.getSharedPreferencesEnabled)){const e=yield(0,La.Ys)(k().selectors.getServicesPath),t=yield(0,La.Ys)(k().selectors.getTenant),r=yield(0,La.Ys)(k().selectors.getEnvironment),n=yield(0,La.Ys)(k().selectors.getUserName),a=yield(0,La.Ys)(Ri.XM),i=yield(0,La.Ys)(Ri.uJ),o=(0,_.pipe)((0,_.map)((0,_.pipe)((0,_.map)((0,_.path)(["attrType","uri"])),(0,_.reject)(S.isEmptyValue))),(0,_.reject)(_.isEmpty)),s="searchExportData",c={name:s,tenant:t,environment:r,user:n,servicesPath:e,value:{searchResultsColumnsUris:(0,Ai.gj)(a)?o(i):void 0}};try{yield(0,La.RE)(S.setSharedPreferences,c),l.set("sharedPreferenceName",s)}catch(e){si(e)}}yield(0,La.gz)(D.ui.actions.openConsoleApp("Export","entities",l.toString()))}function*Nl(){yield(0,La.gz)(D.ui.actions.openConsoleApp("Data Loader","projects"))}function*Pl(e){const t=yield(0,La.Ys)(ai.lF);return e&&t?e.map((0,S.enrichEntityWithDataTenant)(t)):e}function*Dl(e,t){const r=yield(0,La.Ys)(k().selectors.getTenant),n=yield(0,La.Ys)(ai.lF),a=yield(0,La.Ys)(k().selectors.getDtssPath);return yield(0,La.RE)(Ua.Es,{url:e,options:t,customerTenant:r,dataTenant:n,dtssPath:a})}const kl=[L.k.CHANGE_VALUES,D.search.constants.KEYWORD_UPDATED,U.Z.REFRESH,L.k.CLEAR_ALL_VALUES,U.Z.MAP_CHANGE_VALUE,U.Z.CLEAR_ALL,U.Z.STATE_UPDATED,dt,D.search.constants.SEARCH_OPTIONS_UPDATED,D.search.constants.ACTIVITY_FILTER_UPDATED,D.search.constants.GLOBAL_FILTER_UPDATED,U.Z.CHANGE_CURRENT_TENANT],Ll=[function*(){yield(0,La.Fm)(kl,Al)},function*(){yield(0,La.Fm)([U.Z.CHANGE_PAGE,U.Z.RESET_PAGE,U.Z.CHANGE_ROWS_PER_PAGE,U.Z.REFRESH_DISPLAYED_ENTITIES,U.Z.CHANGE_SORT],yl)},function*(){yield(0,La.Fm)(ve,bl)},function*(){yield(0,La.Fm)([U.Z.UPDATE_ENTITIES,Te,Ae],vl)},function*(){yield(0,La.Fm)(U.Z.SHOW_MORE_RESULTS_FOR_ENTITY_TYPE,Tl)},function*(){yield(0,La.Fm)(D.search.constants.UPDATE_STATE,Rl)},function*(){yield(0,La.Fm)(U.Z.EXPORT_RESULTS,Il)},function*(){yield(0,La.Fm)(U.Z.OPEN_DATA_LOADER,Nl)}];var Ul=r(56906);function jl(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*Fl(e,t){try{const[r,n]=yield(0,La.RE)(Ml,e,[]);if((0,_.isNil)(r)||(0,_.isNil)(n))yield(0,La.gz)(ei({[e.fieldName]:[]}));else{const[a,i]=(0,ja.dG)(e.type),o=(0,ja.q7)(a,r),l=(0,ja.q7)(i,n),s=(0,ni.Oz)(e.attrType&&e.attrType.type),[c,u]=s.greaterThan(o,l)?[l,o]:[o,l],p=yield(0,La.RE)(Vl,e,c,u,t),d={[e.fieldName]:p};yield(0,La.gz)(ei(d))}}catch(e){console.warn(e)}}function*Ml(e,t){const r=yield(0,La.Ys)(k().selectors.getGlobalSearchRequestOptions),n=(0,Ua.rN)(e,t,[e.fieldName],r),a=yield(0,La.RE)(Dl,n.url,n.options),i=Bi(a,[e]),{min:o,max:l,count:s}=(0,ja.Kn)(i,[e])[e.fieldName];return s?[(0,N.bB)(e)?0:o,l]:[]}function*Vl(e,t,r,n){const a=e.attrType&&e.attrType.type,i=(0,Ul.C)(a),o=i.getInterval(t,r,50),l=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){jl(e,t,r[t])}))}return e}({interval:o,offset:t},yield(0,La.Ys)(k().selectors.getGlobalSearchRequestOptions)),s=(0,Ua.ti)(e,n,[e.fieldName],l),c=yield(0,La.RE)(Dl,s.url,s.options),u=yield(0,La.Ys)(k().selectors.getMetadata),p=Bi(c,[e]),d=(0,ja.HC)(u,p,[e]);return i.addRanges(d[e.fieldName],t,r,o).map(((e,t,n)=>({value:[e.value,t<n.length-1?n[t+1].value:r],number:e.number})))}function Bl(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const zl={matches:Ua.dW,"dtPotentialMatches.matches":Ua.dW,"potentialMatches.matchScore":Ua._9};function*Hl(e,t){try{const[r,n]=yield(0,La.RE)(Ml,e,[]);if((0,_.isNil)(r)||(0,_.isNil)(n))yield(0,La.gz)(ei({[e.fieldName]:[]}));else{const[a,i]=(0,ja.dG)(e.type),o=(0,ja.q7)(a,r),l=(0,ja.q7)(i,n),s=yield(0,La.RE)(Yl,e,o,l,t),c={[e.fieldName]:s};yield(0,La.gz)(ei(c))}}catch(e){console.warn(e)}}function*Yl(e,t,r,n){const a=yield(0,La.Ys)(k().selectors.getGlobalSearchRequestOptions),i=Math.min(5,r-t+1),o=yield(0,La.RE)(S.rawRequest,zl[e.fieldNameForRequest||e.fieldName](t,r,i,n,[e.fieldName],function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Bl(e,t,r[t])}))}return e}({},a,{dataTenant:e.dataTenant})));return o.map((e=>({number:e.count,value:[e.from,e.to]})))}function Wl(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Gl(e,t,r[t])}))}return e}function Gl(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*ql(){const e=yield(0,La.Ys)(P.X0),t=yield(0,La.Ys)(P.Mp);return Object.values((0,ja.t8)(e,t))}function*Zl(e){const t=yield(0,La.RE)(ql),[r,n]=(0,_.partition)(N.bB,t);let[a,i]=(0,_.partition)(S.isRangeFacet,n);for(let t=0;t<r.length;t++)yield(0,La.rM)(Hl,r[t],e);for(let t=0;t<a.length;t++)yield(0,La.rM)(Fl,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,La.rM)(Kl,o[t],e);const[s,c]=(0,_.partition)(N.DT,l);for(const t of s)yield(0,La.rM)(Xl,[t],e);c.length&&(yield(0,La.rM)(Xl,c,e))}function*$l(e){const t=yield(0,La.Ys)(ai.FR),[r,n]=(0,_.partition)(N.bB,e.payload),[a,i]=(0,_.partition)(S.isRangeFacet,n),[o,l]=(0,_.partition)(N.DT,i);for(let e=0;e<r.length;e++)yield(0,La.rM)(Hl,r[e],t);for(let e=0;e<a.length;e++)yield(0,La.rM)(Fl,a[e],t);for(const e of o)yield(0,La.rM)(Xl,[e],t);l.length&&(yield(0,La.rM)(Xl,l,t))}function*Kl(e,t,r){const n=yield(0,La.Ys)(k().selectors.getGlobalSearchRequestOptions),a=(0,Ua.aw)([Wl({},e,{pageSize:e.pageSize+1})],t,[e.fieldName],n,r);yield(0,La.RE)(Ql,a,[e])}function*Xl(e,t,r){const n=yield(0,La.Ys)(k().selectors.getGlobalSearchRequestOptions),a=(0,Ua.aw)(e.map((e=>Wl({},e,{pageSize:e.pageSize+1}))),t,[],n,r);yield(0,La.RE)(Ql,a,e)}function*Ql(e,t){yield(0,La.RE)(Wi,e,t,ei)}function*Jl(e){const{facetFieldName:t,value:r,debounceTime:n,pageNumber:a=1,currentOptions:i=[]}=e.payload;if(""===r&&1===a)yield(0,La.gz)((e=>({type:L.k.DESTROY_FILTERED_DATA,payload:e}))(t));else{const e=yield(0,La.Ys)(P.X0),o=yield(0,La.Ys)(P.Mp),l=Wl({},(0,ja.t8)(e,o)[t]);if("type"===t){const e={[t]:[...l.data.filter((e=>e.label.toLowerCase().includes(r.toLowerCase())))]};yield(0,La.gz)(ti(e))}else{n&&(yield(0,La.gw)(n));const e=yield(0,La.Ys)(ai.FR),o=yield(0,La.Ys)(P.rM,t),s=e=>ti({[t]:i.concat(e[t])});r?yield(0,La.rM)($i,Wl({},l,{displayedItems:o,pageNumber:a,pageSize:l.pageSize+1}),e,r,s):yield(0,La.rM)(Gi,Wl({},l,{pageNumber:a,pageSize:l.pageSize+1}),e,s)}}}function*es(){const e=yield(0,La.Ys)(P.DX),t=t=>t.entityTypeUri&&t.entityTypeUri!==e[0],r=yield(0,La.Ys)(P.Mp);if(1!==e.length||r.some(t)){const n=r.filter((r=>1!==e.length&&!!r.entityTypeUri||1===e.length&&t(r))).map((e=>e.fieldName));n.length&&(yield(0,La.gz)(Qa(n)))}}function*ts(e){const{facetsToAdd:t=[],fieldNamesToDelete:r=[],changedEntityTypes:n,addToEnd:a=!1}=e.payload;if(t.length||r.length){t.length&&(yield(0,La.gz)(Xa(t,a)));const e=yield(0,La.RE)(ql);let o=!1;if(r.length){const t=e.filter((e=>e.values&&e.values.length));o=r.some((e=>t.some((t=>{var r;return null===(r=t.fieldName)||void 0===r?void 0:r.startsWith(e)})))),yield(0,La.gz)(Qa(r))}if(null!=n)yield(0,La.gz)(Ja("type",n));else if(o)yield(0,La.gz)((({debounceTime:e}={})=>({type:U.Z.REFRESH,payload:{debounceTime:e}}))());else if(t.length){const r=e.filter((e=>t.some((t=>e.fieldName.startsWith(t.fieldName)))));yield(0,La.gz)((i=r,{type:L.k.REQUEST_GIVEN_FACETS_DATA,payload:i}))}}var i}function*rs(){const e=yield(0,La.Ys)(k().selectors.getSearchKeyword),t=yield(0,La.Ys)(ai.vH),r=yield(0,La.Ys)(Qi.go),n=yield(0,La.Ys)(k().selectors.getMetadata),a=yield(0,La.Ys)(k().selectors.getDataTenants);if(Ba(n,r,a)){const i=((e,t,r)=>{const n=Ya(e,t,r),a=Ha(e,t,r),i=(0,_.pipe)(_.flatten,_.uniq)((0,ft.VO)(t)),o=(0,N.$t)(e);return a.reduce(((e,{fieldName:t,values:r})=>{const a=n.find((e=>e.fieldName===t));return a&&(e.facetsConfigs.push(a),e.facetsData[t]={values:r}),e}),{facetsConfigs:[o],facetsData:{[o.fieldName]:(l=i,(0,ja.Kk)({values:l})?{values:l,showAllItems:!0}:{values:l})}});var l})(n,r,a);yield(0,La.gz)(D.search.actions.updateState({facets:i,keyword:e,map:t}))}}function*ns(){if(!(yield(0,La.Ys)(Ri.IJ))){const e=yield(0,La.Ys)(k().selectors.getMetadata);if((yield(0,La.Ys)(P.Mp)).some(S.isTypeFacet)){const e=yield(0,La.Ys)(Ri.Xf),t=yield(0,La.Ys)(P.DX);(e?t.filter((t=>e.includes(t))):t).length!==t.length&&(yield(0,La.gz)(Ga({silent:!0})))}else{const t=[(0,N.$t)(e)];yield(0,La.gz)(Xa(t))}}}function*as(){const e=yield(0,La.Ys)(k().selectors.getMetadata),t=yield(0,La.Ys)(P.X0),r=(0,ja.t8)({type:t.type},[(0,N.$t)(e)]).type.data.reduce(((e,t)=>(e[(0,S.getLastUriPart)(t.value)]=t.number,e)),{}),n=yield(0,La.Ys)(Ri.Xf);return(0,ja.wW)(e,r,n)}const is=[function*(){yield(0,La.Fm)([L.k.FILTER_FACET_DATA],Jl)},function*(){yield(0,La.ib)(L.k.REQUEST_GIVEN_FACETS_DATA,$l)},function*(){yield(0,La.ib)(L.k.HANDLE_CONFIGS_CHANGES,ts)},function*(){yield(0,La.ib)(L.k.CONVERT_FROM_ADVANCED_SEARCH,rs)}];function os(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ls=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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){os(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 ss(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){cs(e,t,r[t])}))}return e}function cs(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*us({payload:{share:e}}){const{query:t,uiState:r}=yield(0,La.RE)(Lo,!0),n=ss({},yield(0,La.Ys)(bo.LA),{isPublic:e===Z.ib.public,query:t,uiState:r}),a=yield(0,La.Ys)(bo.tp);yield(0,La.gz)(gi(!1));try{yield(0,La.gz)(Si(li().text("Updating search..."))),yield(0,La.RE)(S.updateSavedSearch,n),yield(0,La.gz)(fo(!1)),yield(0,La.gz)(Si(li().text("Search updated successfully"))),a&&(yield(0,La.gz)(a))}catch(e){si(e)}}function*ps(){const e=yield(0,La.Ys)(bo.LA);if(!e)return void(yield(0,La.gz)(fo(!1)));const t=yield(0,La.Ys)(k().selectors.getMetadata),r=yield(0,La.Ys)(k().selectors.getDataTenants),n=yield(0,La.Ys)(k().selectors.getCanUserReadWorkflowDataTask),{uiState:a}=(0,vo.z7)(t,r,n,yield(0,La.RE)(Lo)),i=(({savedUiState:e,actualUiState:t})=>{const r=ls(e),n=ls(t);if(!(0,_.equals)(r,n))return!1;if((0,_.path)(["view","searchResultsMode"],e)===Z.ll.TABLE){const r=["view","sortField"],n=["view","sortOrder"],a=["view","entityTypeTab"],i=(0,_.path)(r,e),o=(0,_.path)(r,t),l=(0,_.path)(n,e),s=(0,_.path)(n,t),c=(0,_.path)(a,e),u=(0,_.path)(a,t);if(!(0,_.equals)(i,o)||!(0,_.equals)(l,s)||!(0,_.equals)(c,u))return!1}const a=["searchOptions"],i=(0,_.pathOr)(null,a,e),o=(0,_.pathOr)(null,a,t);return!!((0,_.isNil)(i)||(0,_.isNil)(o)||(0,_.equals)(i,o))})({savedUiState:e.uiState,actualUiState:a});yield(0,La.gz)(fo(!i))}function*ds(e){const t=yield(0,La.Ys)(bo.LA);if(t)switch(e.type){case Tr:case gr:case Er:t.uri===e.payload.uri&&(yield(0,La.gz)(mo(ss({},t,e.payload))));break;case Cr:(0,_.includes)(t.uri,e.payload)&&(yield(0,La.gz)(mo(null)));break;case ar:yield(0,La.gz)(mo(ss({},t,{isPublic:e.payload.share===Z.ib.public})));break;default:(yield(0,La.Ys)(ai.kw))&&(yield(0,La.gz)(mo(null)))}}function*ms(e){const t=yield(0,La.Ys)(bo.EH,e);if(t)return t;const r=yield(0,La.Ys)(k().selectors.getMetadata),n=yield(0,La.Ys)(k().selectors.getDataTenants),a=yield(0,La.Ys)(k().selectors.getCanUserReadWorkflowDataTask);try{const t=yield(0,La.RE)(S.getSavedSearch,(0,vo.tk)(e));return(0,vo.z7)(r,n,a,t)}catch(e){return si(e),null}}function*fs(e){const t=(0,_.path)(["payload","currentSavedSearchUri"],e);if(!t)return;const r=yield(0,La.Ys)(bo.LA);if((0,_.prop)("uri",r)===t)return;const n=yield(0,La.RE)(ms,t);n&&(yield(0,La.gz)(mo(n)),yield(0,La.RE)(ps))}const ys=[...kl,Te,U.Z.CHANGE_SORT,Ae,ve,xe,Se,Re,L.k.CREATE_FACETS,L.k.DESTROY_FACETS,L.k.SHOW_MORE_ENTITY_TYPES],gs=[function*(){yield(0,La.Fm)(ys,ps)},function*(){yield(0,La.Fm)([ar],us)},function*(){yield(0,La.Fm)([Tr,gr,Er,Cr,ar,...kl],ds)},function*(){yield(0,La.Fm)(D.search.constants.UPDATE_STATE,fs)}];function hs(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*Es(){yield(0,La.gw)(500);const{uiState:e,query:t}=yield(0,La.RE)(Lo,!1,!0),r=yield(0,La.Ys)(bo.LA);yield(0,La.gz)(D.search.actions.saveState(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){hs(e,t,r[t])}))}return e}({},e,{query:t,currentSavedSearchUri:(0,_.path)(["uri"],r)})))}function*bs(){yield(0,La.qn)(D.search.constants.UPDATE_STATE);const e=(0,_.reject)((0,_.includes)(_.__,[U.Z.REFRESH]),ys);yield(0,La.Fm)([rr,...e],Es)}const vs=e=>({type:Pr,payload:e}),Ts=()=>({type:Fr}),Os=e=>({type:Vr,payload:e}),Ss=e=>({type:zr,payload:e}),xs=(e,t)=>({type:Wr,payload:{searchCreatedDate:e,isLoading:t}});var Cs=r(97010),ws=r(73667);const As=(0,_.path)([Z.Jf,"recentSearches"]),Rs=e=>As(e).items,_s=e=>As(e).filterWord,Is=(0,_.curry)(((e,t)=>!e||t&&t.name.toLocaleLowerCase().includes(e.toLocaleLowerCase()))),Ns=e=>(0,_.pipe)(Rs,(0,_.filter)(Is(_s(e))))(e),Ps=e=>As(e).loading,Ds=(0,ws.Rm)(Rs),ks=(0,ws.d1)(Rs),Ls=(0,ws.Ky)(Rs),Us=(0,ws.$y)(Rs),js=e=>As(e).lastSavedRecentSearch,Fs=(e,t)=>Rs(e).find((0,_.propEq)("createdDate",t)),Ms=(0,_.path)(["advancedSearch","searchParams","groups"]);function Vs(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Bs(e,t,r[t])}))}return e}function Bs(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*zs(){yield(0,La.gz)(Ss(!0));try{const t=yield(0,La.Ys)(k().selectors.getTenant),r=yield(0,La.Ys)(k().selectors.getEnvironment),n=yield(0,La.Ys)(k().selectors.getServicesPath),{result:a=[]}=yield(0,La.RE)(S.getRecentSearches,{environment:r,tenant:t,servicesPath:n}),i=(0,_.sort)((0,_.descend)((0,_.prop)("createdDate")))(a);yield(0,La.gz)((e=i,{type:kr,payload:e})),yield(0,La.gz)(Ss(!1)),yield(0,La.RE)(Ws,i)}catch(e){si(e),yield(0,La.gz)(Ss(!1))}var e}function*Hs(e){const t=yield(0,La.Ys)(Fs,e.payload);yield(0,La.RE)(Ys,t)}function*Ys(e,t){yield(0,La.gz)(xs(e.createdDate,!0));try{const{total:r}=yield(0,La.RE)(S.getTotalsForQuery,(0,S.replacePlaceholdersInQuery)(e.query),Boolean(t));yield(0,La.gz)(((e,t)=>({type:Lr,payload:{searchCreatedDate:e,total:t}}))(e.createdDate,r))}catch(e){si(e)}yield(0,La.gz)(xs(e.createdDate,!1))}function*Ws(e){const t=yield(0,La.Ys)(k().selectors.getQueryEstimatorEnabled);return yield(0,La.$6)(e.map((e=>(0,La.RE)(Ys,e,t))))}function*Gs(){const e=yield(0,La.Ys)(Us),t=yield(0,La.Ys)(k().selectors.getServicesPath);yield(0,La.gz)(Ss(!0));try{yield(0,La.$6)(e.map((e=>(0,La.RE)(S.deleteRecentSearch,Vs({},e,{servicesPath:t}))))),yield(0,La.gz)(Os(e))}catch(e){si(e)}yield(0,La.gz)(Ss(!1))}function*qs(e){const t=e.payload,r=yield(0,La.Ys)(k().selectors.getServicesPath);yield(0,La.gz)(Ss(!0));try{yield(0,La.RE)(S.deleteRecentSearch,Vs({},t,{servicesPath:r})),yield(0,La.gz)(Os([t]))}catch(e){si(e)}yield(0,La.gz)(Ss(!1))}function*Zs(e){const{debounceTime:t}=e.payload;t&&(yield(0,La.gw)(t));const{query:r,uiState:n}=yield(0,La.RE)(Lo,!0),a=yield(0,La.Ys)(Ri.$s),i=yield(0,La.Ys)(js),o=yield(0,La.Ys)(ai.kw),l=yield(0,La.Ys)(k().selectors.getTenant),s=yield(0,La.Ys)(k().selectors.getEnvironment),c=yield(0,La.Ys)(k().selectors.getServicesPath),u=((e={})=>{const t=Ms(e);return t&&t.length>0?((e={})=>{const t=(0,_.chain)((0,_.prop)("attributes")),r=(0,_.filter)((0,_.has)("values")),n=(0,_.pipe)(Ms,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)(", "));return[s(u=n(e)),c(u)].filter(_.identity).join(" - ");var u})(e):((e={})=>{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=(0,_.curry)(((e,r)=>(0,_.pipe)(t,n,(0,_.find)((0,_.propEq)("fieldName",r)),(0,_.defaultTo)({}),o)(e))),c=(0,ja.XK)(e),u=[];c&&u.push(a(c).map((e=>(0,_.pipe)((0,_.propOr)([],"data"),(0,_.find)((0,_.propEq)("value",e)),(0,_.defaultTo)({}),i))).map((e=>e(c))).join(", "));const p=(0,_.pipe)(t,r,_.values,(0,_.reject)(S.isTypeFacet),(0,_.filter)(l),(0,_.map)((0,_.prop)("fieldName"))),d=(0,_.pipe)(p,(0,_.map)(s(e)))(e);return d.length>0&&u.push(d.join(", ")),u.filter(_.identity).join(" - ")})(e)})(a),p=(0,S.getHash)(r),d={query:r,state:n,name:u,environment:s,tenant:l};try{if(i!==p&&!o){const e=yield(0,La.RE)(S.createRecentSearch,d,c);e.success?yield(0,La.gz)((e=>({type:Yr,payload:e}))(p)):si(e)}}catch(e){si(e)}}function*$s(e){const{search:t,debounceTime:r}=e.payload;yield(0,La.gz)(yi(!1));const n=yield(0,La.Ys)(k().selectors.getMetadata),a=yield(0,La.Ys)(k().selectors.getDataTenants),i=yield(0,La.Ys)(k().selectors.getCanUserReadWorkflowDataTask);let o={};try{o=(0,_.pipe)(Cs.Z,(0,Cs.f)(null))(n,JSON.parse(t.state),{},a,i)}catch(e){o={}}(yield(0,La.Ys)(ai.lF))&&(o.currentTenant=yield(0,La.Ys)(k().selectors.getTenant)),yield(0,La.gz)(D.search.actions.updateState(Vs({},o,{debounceTime:r})))}const Ks=({type:e,payload:t={}})=>e===D.search.constants.KEYWORD_UPDATED&&!(null==t||!t.saveToRecent),Xs=[function*(){yield(0,La.Fm)([Dr],zs)},function*(){yield(0,La.ib)(Mr,Gs)},function*(){yield(0,La.Fm)([D.ui.constants.UIActions.OPEN_ENTITY,tr,ar,Pr,U.Z.CHANGE_PAGE,U.Z.CHANGE_ROWS_PER_PAGE,U.Z.EXPORT_RESULTS,Ks],Zs)},function*(){yield(0,La.Fm)([qr],$s)},function*(){yield(0,La.ib)([Gr],Hs)},function*(){yield(0,La.ib)(Br,qs)}],Qs=e=>e[Z.Jf].entity.loading,Js=e=>e[Z.Jf].entity.selectedEntityUri,ec=e=>e[Z.Jf].entity.entity,tc=e=>({type:hn,payload:e}),rc=e=>({type:En,payload:e}),nc=e=>({type:bn,payload:e}),ac=e=>({type:vn,payload:e});function*ic(e){if(yield(0,La.Ys)(ai.lF)){const t=yield(0,La.RE)(Dl,(0,S.getDtssEntityUrl)(e));return(yield(0,La.RE)(Pl,t))[0]}{const t=yield(0,La.Ys)(k().selectors.getMetadata),r=(0,S.addMetadataSpecificGetEntityOptions)(t);return yield(0,La.RE)(S.getEntity,e,r)}}function*oc(e){const t=e.payload;(yield(0,La.Ys)(Js))!==t&&(yield(0,La.gz)(nc(t)));const r=yield(0,La.Ys)(ec);if(yield(0,La.gz)(tc(!0)),(0,_.isNil)(t))yield(0,La.gz)(ac(null));else if(!r||r.uri!==t)try{const e=yield(0,La.RE)(ic,t);yield(0,La.gz)(ac(e))}catch(e){n=e,(0,ii.U)(n,{defaultMessage:li().text("Can't load entity")}),yield(0,La.gz)(ac(null))}var n;yield(0,La.gz)(tc(!1))}const lc=[function*(){yield(0,La.Fm)(En,oc)}];function*sc(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,La.Ys)(k().selectors.getMetadata),a=(0,S.getEntityType)(n,r[0]),i=a.defaultFacetedAttributes||[];if(i.length>0){const e=yield(0,La.Ys)(P.Mp),t=({fieldName:t})=>(0,_.none)((0,_.propEq)("fieldName",t),e),r=(0,ci.vf)(n,a).map((e=>(0,ci.NG)(n,e,a.uri,"",N.u7))),o=i.reduce(((e,n)=>{const a=(0,S.attributeUriToSearchUri)(n),i=(0,N.zy)(r,a);return i&&t(i)?e.concat(i.children?(0,ci.jj)(i).filter(t):i):e}),[]);o.length>0&&(yield(0,La.gz)(Xa(o,!0)))}}const cc=[function*(){yield(0,La.Fm)(L.k.CHANGE_VALUES,sc)}],uc=e=>({type:Un,payload:e}),pc=()=>({type:Mn}),dc=()=>({type:Rn}),mc=e=>({type:Nn,payload:e}),fc=e=>({type:Dn,payload:e}),yc=e=>({type:Ln,payload:e}),gc=e=>({type:Fn,payload:e}),hc=e=>({type:Vn,payload:e}),Ec=({id:e,groupId:t})=>({type:Yn,payload:{id:e,groupId:t}}),bc=({id:e,groupId:t,operationParameters:r})=>({type:Hn,payload:{id:e,groupId:t,operationParameters:r}}),vc=(e,t,r)=>({type:Gn,payload:{groupId:e,attributeId:t,attribute:Tt(r)}}),Tc=(e,t,r)=>({type:qn,payload:{groupId:e,attributeId:t,attributeData:Ot(r)}}),Oc=(e,t)=>({type:qn,payload:{groupId:e,attributeId:t,attributeData:null}}),Sc=(e,t,r)=>({type:Zn,payload:{groupId:e,attributeId:t,selectInfo:r}}),xc=(e,t)=>({type:$n,payload:{groupId:e,attributeId:t}}),Cc=(e,t,r)=>({type:Kn,payload:{groupId:e,attributeId:t,filter:r}}),wc=(e,t,r)=>({type:Xn,payload:{groupId:e,attributeId:t,values:r}}),Ac=e=>({type:ta,payload:e});var Rc=r(97698);const _c=(0,_.has)("actions"),Ic=e=>e.actions.map((0,_.assocPath)(["operationParameters","conditions"],e.conditions)),Nc=(0,_.path)(["operationParameters","attributeTypeData","attributeType"]),Pc=(0,_.path)(["operationParameters","attributeTypeData","fieldName"]),Dc=(0,_.path)(["operationParameters","pin"]),kc=(0,_.path)(["operationParameters","addNestedAttribute"]),Lc=(0,_.path)(["operationParameters","attributeValue"]),Uc=(0,_.path)(["operationParameters","attributeValueToFind"]),jc=(0,_.anyPass)([(0,_.equals)(ra.d.AddNew),(0,_.equals)(ra.d.ReplaceAllWith)]),Fc=(0,_.anyPass)([(0,_.equals)(ra.d.AddNew),(0,_.equals)(ra.d.ReplaceAllWith),(0,_.equals)(ra.d.FindAndReplace)]),Mc=(0,_.equals)(ra.d.AddNew),Vc=(0,_.both)((0,_.pipe)(Nc,S.isNested),(0,_.pipe)((0,_.prop)("operation"),jc)),Bc=(0,_.both)((0,_.pipe)(Nc,S.isReference),(0,_.pipe)((0,_.prop)("operation"),Mc)),zc=(0,_.both)((0,_.pipe)(Lc,S.isLookupAttrType),(0,_.pipe)((0,_.prop)("operation"),Fc)),Hc=(0,_.pipe)(Nc,S.isLookupAttrType),Yc=e=>{switch(e){case ra.d.AddNew:case ra.d.RepointReference:case ra.d.ReplaceAllWith:return["attributeValue"];case ra.d.FindAndReplace:return["attributeValueToFind","attributeValue"];case ra.d.FindAndRemove:return["attributeValueToFind"];default:return[]}},Wc=e=>{if(!e.operation||!e.operationParameters)return!1;const t=Vc(e),r=Bc(e),n=Hc(e),a=Yc(e.operation);for(let i of a){const a=e.operationParameters[i];if((0,S.isEmptyValue)(a)||n&&(0,S.isEmptyValue)((0,S.getAttrTypeLookupCode)(a))||r&&(0,S.isEmptyValue)((0,S.getReferencedEntityFromAttrValue)(a))||t&&(0,S.isEmptyValue)((0,S.cleanAttributesWith)({deleteEmptyComplex:!0})(a.value)))return!1}return!0},Gc=e=>{const t=Vc(e),r=Bc(e);return t||r?Yc(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,S.cleanAttributesWith)({deleteEmptyComplex:!0}),e)}return e}),e):e},qc=e=>e[Z.Jf].bulkUpdate.operation,Zc=e=>e[Z.Jf].bulkUpdate.activeStep,$c=e=>e[Z.Jf].bulkUpdate.loading,Kc=e=>{const t=(0,Ri.IJ)(e)?(0,Qi.V6)(e):(0,P.DX)(e),r=(0,Ri.tB)(e);return r||1===t.length?r||t[0]:null},Xc=(0,_.path)([Z.Jf,"bulkUpdate","objects"]),Qc=e=>Xc(e).total,Jc=e=>Xc(e).selectionMode,eu=e=>Xc(e).entities,tu=e=>Xc(e).selectedEntities,ru=e=>Xc(e).page,nu=e=>Xc(e).rowsPerPage,au=e=>Xc(e).sortField,iu=e=>Xc(e).sortOrder,ou=e=>Xc(e).selectedColumns,lu=e=>Xc(e).filterText,su=(0,_.pipe)(Jc,(0,_.equals)(Z.v6.include)),cu=(0,_.ifElse)(su,(0,_.pipe)(tu,_.length),(e=>{const t=tu(e).length;return(0,ai.hX)(e)-t})),uu=(0,_.pipe)(cu,(0,_.gt)(_.__,0)),pu=e=>e[Z.Jf].bulkUpdate.actions,du=(0,Rc.createSelector)(pu,(0,_.pipe)((0,_.map)((0,_.ifElse)(_c,(0,_.evolve)({actions:(0,_.pipe)((0,_.map)(Gc),(0,_.filter)(Wc))}),Gc)),(0,_.filter)((0,_.ifElse)(_c,(0,_.pipe)((0,_.path)(["actions","length"]),(0,_.gt)(_.__,0)),Wc)))),mu=(0,Rc.createSelector)(pu,(0,_.pipe)((0,_.map)((0,_.when)(_c,(0,_.prop)("actions"))),_.flatten)),fu=e=>{const t=mu(e);return 0!==t.length&&t.every(Wc)},yu=e=>e[Z.Jf].bulkUpdate.requestPending,gu=(0,S.getUrisForSaving)((e=>(0,_.equals)(e.slice(-3),["operationParameters","attributeValue","entityUri"]))),hu=(0,_.curry)(((e,t,r)=>{const n=(0,_.pipe)(gu,(0,_.find)((t=>(0,_.pathSatisfies)((t=>t===e),t,r))))(r);return n?(0,_.set)((0,_.lensPath)(n),t,r):r})),Eu=(e,t,r)=>(0,_.pipe)(hu(e,t),(0,_.when)((e=>e===r),(0,S.replaceTemporaryRefEntityURI)(e,t)))(r),bu=(0,_.pathEq)(["data","fieldName"],Z.E_),vu=(0,_.pipe)((0,_.path)(["values",0,"entityUri"]),(0,_.objOf)("uri"),S.getEntityId,S.wrapInQuotes),Tu=e=>[{attributes:e,operator:"or"}],Ou=(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===Z.Vp.AddAttribute&&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)})))),Su=(0,_.curry)(((e,t,r)=>{const n=((e,t,r)=>{const[n,a]=(0,_.partition)(bu,e),i=(0,_.pipe)(Ou(t,r),Tu,Ua.Jk)(a),o=n.length?(e=>`in(${Z.E_}, ${e.map(vu).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"]),S.isEmptyValue),(0,_.assocPath)(["operationParameters","valueFilter"],n),(0,_.evolve)({operationParameters:{valueFilter:(0,_.concat)(_.__,` and (${n})`)}}))(r)}));var xu=r(9828);function Cu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){wu(e,t,r[t])}))}return e}function wu(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Au=e=>{const t=(0,_.pipe)((0,_.pick)(["pin"]),(0,_.assoc)("value",Ru(e)))(e);return(0,xu.Kn)(t.value)?Object.keys(t.value).reduce(((e,r)=>(e.value=Cu({},e.value,{[r]:t.value[r].map(Au)}),e)),t):t},Ru=(0,_.when)(xu.Kn,(0,_.ifElse)((0,_.has)("lookupCode"),(0,_.prop)("lookupCode"),(0,_.prop)("value"))),_u=(0,_.cond)([[Vc,(0,_.pipe)(Lc,Au)],[Bc,(0,_.pipe)(Lc,(e=>{const{refEntity:t=[],refRelation:r=[]}=e;return Cu({refEntity:(0,_.pipe)(_.head,(0,_.pick)(["objectURI"]))(t),refRelation:(0,_.pipe)(_.head,(0,_.pick)(["type"]))(r)},Au(e))}))],[zc,(0,_.pipe)(Lc,Ru)],[_.T,Lc]]),Iu=(0,_.pipe)(_u,(0,_.assocPath)(["operationParameters","attributeValue"])),Nu=(0,_.ifElse)(Dc,(()=>(0,_.assocPath)(["operationParameters","pin"],!0)),(()=>_.identity)),Pu=(0,_.ifElse)(kc,(()=>(0,_.assocPath)(["operationParameters","addNestedAttribute"],!0)),(()=>_.identity)),Du=(0,_.pipe)(Uc,(0,_.ifElse)(_.isNil,(()=>_.identity),(0,_.pipe)(((e="")=>`equals(value, '${Ru(e)}')`),(0,_.assocPath)(["operationParameters","valueFilter"])))),ku=(0,_.pipe)(Lc,(0,_.prop)("entityUri"),(0,_.assocPath)(["operationParameters","referencedEntity","uri"])),Lu=(e,t)=>({operationParameters:{attributeURI:e},operation:t}),Uu=(e,t)=>(0,_.pipe)(Lu,Iu(e),Nu(e),Pu(e))(t,Z.Vp.AddAttribute),ju=(e,t)=>(0,_.pipe)(Lu,Du(e))(t,Z.Vp.DeleteAttribute),Fu=(e,t)=>(0,_.pipe)(Lu,Iu(e),Nu(e),Du(e))(t,Z.Vp.UpdateAttribute),Mu=(e,t)=>(0,_.pipe)(Lu,ku(e))(t,Z.Vp.RepointReferencedEntity),Vu=(e,t)=>(0,_.reject)(_.isNil,{operationParameters:e,operation:t}),Bu=e=>Vu({tags:[Lc(e)]},Z.Vp.AddTags),zu=e=>Vu({newValue:Lc(e),oldValue:Uc(e)},Z.Vp.ReplaceTag),Hu=e=>Vu({tags:[Uc(e)]},Z.Vp.DeleteTags),Yu=()=>Vu(null,Z.Vp.ClearTags),Wu=(e,t=[],r={})=>{const{selectionMode:n,selectedEntities:a=[]}=e,{searchOptions:i,activityFilter:o,globalFilter:l}=r;return n===Z.v6.include?{list:a,activeness:o}:{filter:(0,_.pipe)(Ua.XP,(0,S.addGlobalFilterToQuery)(l))(t),excludeList:a,options:i,activeness:o}},Gu=(0,_.curry)(((e,t)=>(0,_.chain)((0,_.ifElse)(_c,(0,_.pipe)(Ic,Gu(e)),qu(e)))(t))),qu=(0,_.curry)(((e,t)=>{const r=(0,_.pathOr)([],["operationParameters","conditions"],t),n=Pc(t);return(0,_.pipe)($u(e),(0,_.map)(Su(r,n)))(t)})),Zu=(0,_.curry)((e=>(0,_.propEq)("operation",e))),$u=(0,_.curry)(((e,t)=>{const r=Pc(t),n=r.includes(".")?(0,S.searchUriToAttrUri)(r,e):r,a=r===S.EntityAttrTypes.tags.uri;return(0,_.cond)([[(0,_.both)((0,_.always)(a),Zu(ra.d.AddNew)),()=>[Bu(t)]],[(0,_.both)((0,_.always)(a),Zu(ra.d.Clear)),()=>[Yu()]],[(0,_.both)((0,_.always)(a),Zu(ra.d.ReplaceAllWith)),()=>[Yu(),Bu(t)]],[(0,_.both)((0,_.always)(a),Zu(ra.d.FindAndReplace)),()=>[zu(t)]],[(0,_.both)((0,_.always)(a),Zu(ra.d.FindAndRemove)),()=>[Hu(t)]],[Zu(ra.d.AddNew),()=>[Uu(t,n)]],[Zu(ra.d.Clear),()=>[ju(t,n)]],[Zu(ra.d.ReplaceAllWith),()=>[ju(t,n),Uu(t,n)]],[Zu(ra.d.FindAndReplace),()=>[Fu(t,n)]],[Zu(ra.d.FindAndRemove),()=>[ju(t,n)]],[Zu(ra.d.RepointReference),()=>[Mu(t,n)]]])(t)}));function Ku(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Xu(e,t,r[t])}))}return e}function Xu(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*Qu(e){if(e.payload){const e=yield(0,La.Ys)(Ri.tB);let r;do{if(r=yield(0,La.Ys)(ai.BP,{entityTypeUri:e}),r)break;yield(0,La.qn)(U.Z.UPDATE_ENTITIES)}while(!r);const n=yield(0,La.Ys)(Kc),a=yield(0,La.Ys)(ai.fx,{entityTypeUri:e}),i=yield(0,La.Ys)(ai.Uz,{entityTypeUri:e}),o=(yield(0,La.Ys)(ai.L9,{entityTypeUri:e}))||void 0,l=yield(0,La.Ys)(ai.NW,{entityTypeUri:e}),s=(yield(0,La.RE)(to))[n].filter((0,_.pipe)((0,_.prop)("id"),S.isAttributeSearchUri,_.not)),c=e?yield(0,La.Ys)(Ri.Gv,e):s,u=yield(0,La.Ys)(ai.NU,{entityTypeUri:e});yield(0,La.gz)((t={page:a,rowsPerPage:i,sortOrder:o,sortField:l,selectedColumns:c,total:u,entities:r},{type:An,payload:t}))}var t}function*Ju(e){const t=yield(0,La.Ys)(k().selectors.getMetadata),r=yield(0,La.Ys)(ru),n=yield(0,La.Ys)(nu),a=yield(0,La.Ys)(iu),i=yield(0,La.Ys)(au),o=yield(0,La.RE)(cp),l=(0,_.uniq)(o.concat((0,Ua.kx)(t,e))),s=Ku({page:r,rowsPerPage:n,sortOrder:a,sortField:i,forceOvOnly:!0},yield(0,La.Ys)(k().selectors.getGlobalSearchRequestOptions),{select:l}),c=(0,Ua.Lv)(e,s);yield(0,La.gz)(mc(!0));try{const e=yield(0,La.RE)(S.rawRequest,Z.NV,c);yield(0,La.gz)(uc(e))}catch(e){console.warn(e),yield(0,La.gz)(uc([]))}yield(0,La.gz)(mc(!1))}function*ep(){const e=yield(0,La.Ys)(lu),t=yield(0,La.RE)(sp,e);yield(0,La.rM)(Ju,t)}function*tp(e={}){const{debounceTime:t}=e.payload||{};t&&(yield(0,La.gw)(t));const r=yield(0,La.Ys)(lu),n=yield(0,La.RE)(sp,r);yield(0,La.gz)(fc(0)),yield(0,La.rM)(rp,n)}function*rp(e){const t=yield(0,La.Ys)(k().selectors.getGlobalSearchRequestOptions),r=(0,Ua.Vg)(e,[],t);try{const e=yield(0,La.RE)(S.rawRequest,Z.jS,{method:"POST",body:JSON.stringify(r)});yield(0,La.gz)(gc(e.total))}catch(e){console.warn(e),yield(0,La.gz)(gc(0))}}function*np(){const e=(yield(0,La.Ys)(eu)).map((e=>e.uri)),t=yield(0,La.RE)(cp),r=yield(0,La.Ys)(lu),n=yield(0,La.RE)(sp,r),a=yield(0,La.Ys)(k().selectors.getGlobalSearchRequestOptions),i=(0,Ua.aG)(e,n,Ku({select:t},a));yield(0,La.gz)(mc(!0));try{const e=yield(0,La.RE)(S.rawRequest,i.url,i.options);yield(0,La.gz)(uc(e))}catch(e){console.warn(e),yield(0,La.gz)(uc([]))}yield(0,La.gz)(mc(!1))}function*ap(e){try{yield(0,La.RE)(S.rawRequest,e.url,e.options),yield(0,La.gz)(wi(!1)),yield(0,La.gz)(xi({message:li().text("Bulk update is currently in progress. You'll receive an email notification once completed.\nGo to Tenant Management to view the status."),actionLabel:li().text("Tenant Management"),actionToDispatch:D.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?li().text("You already have a bulk update job in progress. You can start a new job when the current job is finished.\nWe will send you an update via email once the current job is finished."):e.errorMessage||e.error_description||li().text("Something went wrong...")),yield(0,La.gz)((t=r,Oi({payload:{message:t,action:{actionToDispatch:Ti()}},type:Z.GT.error})))}var t}function*ip(){const e=yield(0,La.Ys)(qc);e===Z.dV.UpdateProfiles?yield(0,La.RE)(op):e===Z.dV.DeleteProfiles&&(yield(0,La.RE)(lp))}function*op(){yield(0,La.gz)(Ac(!0));const e=yield(0,La.Ys)(Kc),t=yield(0,La.Ys)(Xc);let r=yield(0,La.Ys)(du);const n=yield(0,La.RE)(sp),a=yield(0,La.Ys)(k().selectors.getGlobalSearchRequestOptions),i=yield(0,La.Ys)(k().selectors.getModifiedEntities),o=((e,t)=>{const r=(0,S.findAllTemporaryRefEntityURI)(t),n=(a=t,(0,_.pipe)(gu,(0,S.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,La.RE)(S.saveTemporaryEntities,i,o);for(const[t,n]of Object.entries(e))r=Eu(t,n,r)}const l=function(e,t,r,n,a){const i=((e,t={},r=[],n=[],a={})=>({objects:Wu(t,n,a),actions:Gu(e,r)}))(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,La.RE)(ap,l),yield(0,La.gz)(Ac(!1))}function*lp(){yield(0,La.gz)(Ac(!0));const e=function(e,t,r){const n={objects:Wu(e,t,r)};return{url:"/entities/_delete?sendMail=true",options:{method:"POST",body:JSON.stringify(n),headers:{"Content-Type":"application/json"}}}}(yield(0,La.Ys)(Xc),yield(0,La.RE)(sp),yield(0,La.Ys)(k().selectors.getGlobalSearchRequestOptions));yield(0,La.RE)(ap,e),yield(0,La.gz)(Ac(!1))}function*sp(e){const t=yield(0,La.Ys)(ai.FR),r={fieldName:"type",filter:"equals",values:[yield(0,La.Ys)(Kc)]};let n=t.filter((e=>"type"!==e.fieldName)).concat(r);return e&&(n=n.concat({fieldName:"attributes",filter:"containsWordStartingWith",values:[e]})),n}function*cp(){const e=yield(0,La.Ys)(ou);return(0,Ai.vw)(e)}function*up(e){const{groupId:t,attributeId:r,selectInfo:n}=e.payload,a=yield(0,La.Ys)(pu),i={addAttributeAfter:vc,changeAttribute:Tc,clearAttribute:Oc,deleteAttribute:xc};yield(0,La.RE)(rl,{groups:a,attributesPropName:"conditions",groupId:t,attributeId:r,selectInfo:n,actions:i})}const pp=[function*(){yield(0,La.Fm)(ge,Qu)},function*(){yield(0,La.Fm)([Dn,Pn,kn],ep)},function*(){yield(0,La.Fm)(jn,tp)},function*(){yield(0,La.Fm)(Mn,np)},function*(){yield(0,La.ib)(Zn,up)},function*(){yield(0,La.ib)(ea,ip)}],dp=()=>({id:Z.Jf,reducerMap:{[Z.Jf]:(0,R.combineReducers)({ui:We,search:pe,facets:q,advancedSearch:er,savedSearches:ln,recentSearches:gn,entity:Cn,bulkUpdate:ka})},sagas:[...Ll,...is,...po,...pl,...Fo,...Xs,...gs,bs,...lc,...cc,...pp]});var mp=r(95099),fp=r.n(mp),yp=r(34756),gp=r(23625),hp=r.n(gp),Ep=r(53732),bp=r.n(Ep),vp=r(88214),Tp=r.n(vp),Op=r(14294),Sp=r.n(Op),xp=r(4501),Cp=r.n(xp),wp=r(87925),Ap=r(18538),Rp=r(42950);const _p=(0,Rp.Z)((()=>({container:({height:e=36})=>({height:e,borderRadius:"2px",alignItems:"center",backgroundColor:"rgba(0,0,0,0.03)",minWidth:"100px"}),icon:{opacity:.67,marginLeft:"10px",marginRight:"6px"},input:{fontSize:"13px",width:"100%"},clearButton:{marginRight:"10px"},white:{backgroundColor:"rgb(255, 255, 255)",boxShadow:"0 1px 3px 0 rgba(0,0,0,0.24)"}})));function Ip(){return Ip=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ip.apply(null,arguments)}function Np(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Pp(e,t,r[t])}))}return e}function Pp(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Dp=(0,b.memo)((e=>{let{value:t,autofocus:r,onSearch:n=_.identity,rootRef:a,classes:i={},height:o,placeholder:l=li().text("Search")}=e,s=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["value","autofocus","onSearch","rootRef","classes","height","placeholder"]);const c=_p({height:o}),[u,p]=(0,b.useState)(""),d=(0,_.pipe)((0,_.tap)(n),p),m=(0,_.isNil)(t)?u:t;return v().createElement(bp(),Ip({startAdornment:v().createElement(Tp(),{position:"start"},v().createElement(Cp(),{className:c.icon})),endAdornment:v().createElement(Tp(),{position:"end"},m.length>0&&v().createElement(Ap.T,{icon:Sp(),className:c.clearButton,onClick:()=>d("")})),autoFocus:r,classes:Np({},i,{input:O()(c.input,i.input),root:O()(c.container,i.root)}),placeholder:l,value:m,onChange:(0,_.pipe)(wp.NA,d),disableUnderline:!0,ref:a},s))})),kp=(0,Rp.Z)((()=>({container:({containerHeight:e=553,containerWidth:t})=>({display:"flex",flexDirection:"column",height:e,width:t,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}}})));function Lp(){return Lp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Lp.apply(null,arguments)}const Up=e=>{let{title:t,className:r,onSearch:n,hideTitle:a,hideSearchInput:i,headerPlacement:o="top",containerWidth:l,containerHeight:s,searchInputOnKeyDown:c,children:u,searchInputRef:p,anchorOrigin:d={vertical:"top",horizontal:"right"},transformOrigin:m={vertical:"top",horizontal:"right"}}=e,f=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["title","className","onSearch","hideTitle","hideSearchInput","headerPlacement","containerWidth","containerHeight","searchInputOnKeyDown","children","searchInputRef","anchorOrigin","transformOrigin"]);const y=kp({containerWidth:l,containerHeight:s}),g=v().createElement(v().Fragment,null,!a&&v().createElement("div",{className:y.header},t),!i&&v().createElement(Dp,{onSearch:n,autofocus:!0,onKeyDown:c,inputRef:p,classes:{root:y.searchInputContainer},placeholder:li().text("Search & add attributes"),height:40}));return v().createElement(hp(),Lp({anchorOrigin:d,transformOrigin:m},f),v().createElement("div",{className:O()(y.container,r),style:{width:l}},"top"===o&&g,v().createElement("div",{className:y.list},u),"bottom"===o&&g))},jp=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})))},Fp=e=>e.titleItemIndex===e.index;var Mp=r(50166),Vp=r(88267);const Bp=(0,Rp.Z)({stickyTitlesWrapper:{position:"absolute",top:0,"& > div":{zIndex:1,position:"absolute",top:0,width:"100%",visibility:"hidden"}}}),zp=({items:e,getItemSize:t,renderItem:r,renderGroupTitle:n,width:a="100%",height:i,fixedTitle:o=!0,itemKey:l=(e=>e),disableHorizontalScrollbar:s,hideSubtitles:c,focusIndex:u=null,onInnerContainerResize:p})=>{const d=Bp(),m=(0,b.useRef)(null),f=(0,b.useRef)(null),y=(0,b.useRef)(null),g=(0,b.useRef)([0]),h={topMargin:0},E=(0,b.useMemo)((()=>!c||(e||[]).some((e=>null!==e.titleItemIndex))),[e,c]),T=(0,b.useCallback)((r=>{const n=g.current.length;let a=0;e.slice(n-1,r+1).forEach(((e,r)=>{const i=n+r-1;r>0&&(g.current[i]=g.current[i-1]+a),a=t(i,e.item)}))}),[t,e]),O=(0,b.useCallback)((t=>e[t].titleItemIndex),[e]),S=(0,b.useCallback)((t=>e[t]),[e]);(0,b.useEffect)((()=>{requestAnimationFrame((()=>{m.current&&m.current.scrollTo(0)}))}),[e.length]),(0,b.useEffect)((()=>{m.current&&m.current.resetAfterIndex(0),x();const r=(e=>{const r=e.findIndex((e=>e.item.moveTo));if(r>-1){T(r);const e=O(r);return{offset:g.current[r],titleHeight:t(e,S(e).item)}}})(e);if(r&&r.offset&&m.current){const{titleHeight:e}=r,t=r.offset-e;(t<m.current.state.scrollOffset||t>m.current.state.scrollOffset+i)&&requestAnimationFrame((()=>{m.current&&m.current.scrollTo(t-(i-e)/2)}))}}),[T,S,t,O,i,g,e,m]);const x=()=>{y.current&&f.current&&(y.current.style.width=f.current.offsetWidth+"px")},C=(0,b.useCallback)((t=>{let r=null,n=0;return e.some(((e,a)=>{T(a+10);const i=g.current[a+1];return t>=n&&t<i&&(r={index:a,offset:n,listItem:e}),n=i,r})),r}),[T,g,e]),w=(0,b.useCallback)((e=>t(e,S(e).item)),[S,t]),A=(0,b.useCallback)((({index:e,style:t,data:a})=>{const i=S(e);return i.item&&(Fp(i)&&n(t,i.item)||r(t,i.item,e,a))}),[S,n,r]),{handleOnItemsRendered:R}=(({focusIndex:e,listRef:t,items:r})=>{const n=(0,b.useRef)(null),a=(0,b.useRef)(null),i=(0,b.useCallback)((({visibleStartIndex:e,visibleStopIndex:t})=>{n.current=e,a.current=t}),[]);return(0,b.useEffect)((()=>{t.current&&null!==e&&0!==r.length&&(e<Math.max(n.current+3,0)?t.current.scrollToItem(Math.max(e-3,0),"start"):e>Math.min(a.current-3,r.length-1)&&t.current.scrollToItem(Math.min(e+3,r.length-1),"end"))}),[e,r.length,t]),{handleOnItemsRendered:i}})({items:e,focusIndex:u,listRef:m}),_=(0,b.useCallback)((()=>e.filter((e=>Fp(e))).map((e=>(e=>v().createElement("div",{className:"stickyTitleItem",style:{visibility:"hidden"},"data-index":e.index,key:e.index},n({height:t(e.index,e.item)},e.item)))(e)))),[t,e,n]);return v().createElement(v().Fragment,null,v().createElement("div",{ref:y,className:d.stickyTitlesWrapper},o&&_()),p&&f.current&&v().createElement(Vp.Z,{handleHeight:!0,onResize:p,targetDomEl:f.current}),v().createElement(Mp.VariableSizeList,{ref:m,itemCount:e.length,itemSize:w,width:a,height:i,itemKey:l,innerRef:f,onScroll:({scrollOffset:r,scrollDirection:n})=>{if(!o||!E)return;const a=C(r),i=a&&O(a.index);var l;null!==i&&(l=i,y.current&&[...y.current.querySelectorAll(".stickyTitleItem")].forEach((e=>{e.dataset.index===l.toString()?(e.style.visibility="visible",h.index=l):e.style.visibility="hidden"}))),x();const s=null!==i&&t(i,S(i).item),c=C(r+s+h.topMargin);let u=0;if(c){switch(n){case"forward":c.offset-r>0&&Fp(c.listItem)&&(u=s-(c.offset-r));break;case"backward":{const t=i>-1&&(p=i,e.findIndex(((e,t)=>Fp(e)&&p<t))),n=(e=>(T(e),g.current[e]))(t);t>-1&&r<n&&s>=n-r&&(u=s-(n-r))}}(e=>{y.current&&(h.topMargin=-e,y.current.style.top=-e+"px")})(u)}var p},style:s?{overflowX:"hidden"}:void 0,overscanCount:5,onItemsRendered:R},A))};zp.propTypes={items:fp().arrayOf(fp().object).isRequired,getItemSize:fp().func.isRequired,renderItem:fp().func.isRequired,width:fp().oneOfType([fp().number,fp().string]),height:fp().number.isRequired,renderGroupTitle:fp().func,fixedTitle:fp().bool,hideSubtitles:fp().bool,itemKey:fp().func,disableHorizontalScrollbar:fp().bool,focusIndex:fp().number,onInnerContainerResize:fp().func};const Hp=({items:e,open:t,onSelectFocusedItem:r,selectedItems:n,onClose:a})=>{const[i,o]=(0,b.useState)(null),l=(0,b.useRef)(!1),s=(0,b.useCallback)((t=>{let r=null===t?s(-1):t;for(;null!==t&&r<e.length&&(r<=t||r>=0&&Fp(e[r]));)r+=1;return r!==e.length?r:s(-1)}),[e]),c=(0,b.useCallback)((t=>{let r=null===t?e.length-1:t;for(;null!==t&&r>=0&&(r>=t||Fp(e[r]));)r-=1;return r<0?e.length-1:r}),[e]),u=(0,b.useCallback)((()=>{if(!(0,_.isNil)(i)){const t=e[i].item;!t.item.notSelectable&&r({item:t.item,groupData:t})}}),[r,e,i]),p=(0,b.useCallback)((t=>{if(0!==e.length)switch(t.key){case"Down":case"ArrowDown":return o(s),t.preventDefault(),!1;case"Up":case"ArrowUp":return o(c),t.preventDefault(),!1;case"Enter":l.current=!0,u();break;case"Tab":a&&a(t);break;default:return}}),[e,s,c,u,a]);return(0,b.useEffect)((()=>{if(l.current){l.current=!1;const t=e.findIndex((e=>e.item.moveTo));t>-1&&o(t)}else o(null)}),[e,t,n]),{focusIndex:i,handleKeyDown:p}};var Yp=r(85746),Wp=r.n(Yp),Gp=r(22811),qp=r.n(Gp),Zp=r(93222),$p=r.n(Zp);function Kp(){return Kp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Kp.apply(null,arguments)}function Xp(){return Xp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Xp.apply(null,arguments)}const Qp=e=>v().createElement("svg",Xp({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgNestedAttribute"},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 Jp(){return Jp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Jp.apply(null,arguments)}const ed=e=>v().createElement("svg",Jp({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgReferenceAttribute"},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 td(){return td=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},td.apply(null,arguments)}const rd=e=>v().createElement("svg",td({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgSimpleAttribute"},e),v().createElement("rect",{fill:"#000",x:9,y:9,width:6,height:6,rx:1,stroke:"none",strokeWidth:1,fillRule:"evenodd"})),nd=(0,Rp.Z)({icon:{opacity:.29,width:"16px",height:"16px",flexShrink:0,marginRight:"6px",marginLeft:"8px"}}),ad=({attrType:e={}})=>{const t=nd(),r=(e=>{switch(e.type){case S.DataTypes.TYPE_IMAGE:case S.DataTypes.TYPE_NESTED:return Qp;case S.DataTypes.TYPE_REFERENCE:return ed;default:return rd}})(e);return v().createElement(r,{className:t.icon})},id=(0,Rp.Z)({mark:{color:"red"}}),od=()=>{const e=id();return v().createElement("span",{className:e.mark},"*")},ld=({margin:e,level:t,className:r,children:n})=>null!=t?v().createElement("div",{style:{marginLeft:t*e},className:r},n):n;var sd=r(1063),cd=r(85740);const ud=(0,Rp.Z)({container:{"& > $marginWrapper:first-child":{paddingLeft:"4px"}},listItem:{paddingLeft:"1px",paddingTop:"2px",paddingBottom:"2px",transition:"none","&:hover":{"& $itemAfter":{background:"linear-gradient(to right, rgba(235, 235, 235, 0.2), rgba(235, 235, 235, 1) 100%)"}},"&$listItemFocus":{"& $itemAfter":{background:"linear-gradient(to right, rgba(219, 219, 219, 0.2), rgba(219, 219, 219, 1) 100%)"}},"&:focus":{outline:"none"}},listItemFocus:{},recommendedIcon:{width:"18px",height:"18px",marginRight:"5px",marginLeft:"7px",flexShrink:0},logoIcon:{width:"18px",height:"18px",flexShrink:0,marginRight:"4px"},itemAfter:{position:"absolute",right:0,top:0,width:"40px",height:"100%",pointerEvents:"none",background:"linear-gradient(to right, rgba(255, 255, 255, 0.2), #fff 100%)"},itemText:{padding:"0",margin:0,"& span":{fontSize:"0.8125rem",letterSpacing:"normal",whiteSpace:"nowrap"}},checkbox:{opacity:.34,padding:0,marginLeft:"14px","&$checked":{opacity:1,background:"none"}},checked:{},marginWrapper:{display:"flex",alignItems:"center"},defaultCursor:{cursor:"default"},itemTooltip:{margin:"4px 0"},marginText:{marginLeft:"21px"},itemTextWrapper:{display:"flex",alignItems:"center"}}),pd=(0,cd.T)((e=>v().createElement("svg",Kp({width:13,height:18,viewBox:"0 0 13 18",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgRecommended"},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"}))))),dd=({groupId:e,data:t,checked:r=!1,isFocused:n=!1,isRequired:a=!1,label:i,labelInText:o,level:l,onClick:s=_.identity,hideCheckBox:c=!1,hideIcon:u=!1,notSelectable:p=!1,disableHorizontalScrollbar:d=!1,style:m={},subItemMargin:f=20,LogoIcon:y,className:g,disableNonSelectable:h,disableGutters:E})=>{const b=ud(),{attrType:T}=t||{},x=!(c&&(0,S.isNested)(T)||p),C=!!y;return v().createElement(sd.Y,{value:o||i,className:b.itemTooltip,placement:"bottom-end"},v().createElement($p(),{className:O()(b.container,b.listItem,{[b.defaultCursor]:!x},g),onClick:x?()=>s(t,!r,e):void 0,style:m,dense:!0,disabled:h&&p,classes:{focusVisible:b.listItemFocus,selected:b.listItemFocus},selected:n,tabIndex:-1,disableGutters:E},!c&&v().createElement(qp(),{checked:r,disableRipple:!0,disabled:!x,className:O()(b.checkbox,{[b.checked]:r}),tabIndex:-1}),v().createElement(ld,{margin:f,level:l,className:b.marginWrapper},v().createElement(v().Fragment,null,!u&&(t=>"recommended"===e?v().createElement(pd,{className:b.recommendedIcon,tooltipTitle:li().text("Recommended"),showForDisabled:!0}):v().createElement(ad,{attrType:t}))(T),v().createElement("div",{className:O()(b.itemTextWrapper,{[b.marginText]:u})},C&&v().createElement(y,{className:b.logoIcon}),v().createElement(Wp(),{primary:v().createElement(v().Fragment,null,i,a&&v().createElement(od,null)),className:b.itemText})))),x&&d&&v().createElement("div",{className:b.itemAfter})))};dd.defaultName="AttributeListItem";const md=(0,b.memo)(dd);var fd=r(49940);const yd=(0,Rp.Z)({popupContainer:{},container:{"&$popupContainer":{height:"408px",minWidth:"200px"}}});function gd(){return gd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gd.apply(null,arguments)}function hd(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Ed(e,t,r[t])}))}return e}function Ed(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const bd=e=>{let{open:t,anchorEl:r,data:n,onSearch:a,onClose:i,titleText:o,filterText:l,onListItemClick:s,selected:c,hideCheckBox:u,renderGroupTitle:p}=e,d=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["open","anchorEl","data","onSearch","onClose","titleText","filterText","onListItemClick","selected","hideCheckBox","renderGroupTitle"]);const m=(0,b.useCallback)((e=>e.label.toLowerCase().includes(l.toLowerCase())),[l]),f=(0,b.useCallback)((e=>m(e)||(e.children||[]).some(f)),[m]),y=(0,b.useMemo)((()=>{const e=(0,_.curry)(((e,r,n,a)=>[{item:hd({},r,{filterText:l}),level:e,groupId:n,groupName:a},...t(r.children||[],n,a,e+1)])),t=(t,r,n,a=0)=>{const i=t.filter(f);return(p?_.map:_.chain)((t=>e(a,t,r,n)),i)};return t}),[l,p,f]),g=(0,b.useCallback)((e=>e.map((e=>({item:e,items:y(e.attributes,e.id,e.label)}))).filter((e=>e.items.length))),[y]),h=(0,b.useCallback)((({item:e})=>{s(e,!c.find((t=>t.id===e.id||t.id.includes(`${e.id}.`))))}),[s,c]),E=(0,b.useMemo)((()=>(p?g:y)(n)),[n,p,g,y]),T=(0,b.useMemo)((()=>jp(E)),[E]),{focusIndex:x,handleKeyDown:C}=Hp({items:T,open:t,onSelectFocusedItem:h,selectedItems:c}),w=(0,b.useRef)(null);w.current=x;const A=(0,b.useCallback)(((e,{item:t,level:r=0},n)=>{const a=!!c.find((e=>e.id===t.id||e.id.includes(`${t.id}.`))),i=w.current===n;return v().createElement(md,{key:t.id,onClick:s,checked:a,level:r,data:t,label:v().createElement(fd.o,{text:t.label,highlight:t.filterText}),labelInText:t.label,style:e,hideCheckBox:u,isFocused:i,notSelectable:t.notSelectable,LogoIcon:t.LogoIcon})}),[u,s,c]),R=(0,S.getMaxItemWidth)("label")(E)||308,I=yd();return v().createElement(Up,gd({open:t,className:O()(I.container,I.popupContainer),anchorEl:r,onClose:i,onSearch:a,title:o,containerWidth:R,searchInputOnKeyDown:C},d),v().createElement(zp,{height:300,renderItem:A,items:T,hideSubtitles:!0,getItemSize:()=>32,containerWidth:R,focusIndex:x,renderGroupTitle:p}))};bd.propTypes={open:fp().bool,hideCheckBox:fp().bool,anchorEl:fp().any,selected:fp().array,data:fp().array,filterText:fp().string,titleText:fp().string,onClose:fp().func,onListItemClick:fp().func,onSearch:fp().func,renderGroupTitle:fp().func},bd.defaultProps={data:[],selected:[],titleText:li().text("Show/hide columns"),filterText:""};var vd=r(97179);function Td(){return Td=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Td.apply(null,arguments)}const Od=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",Td({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"})))},Sd="Headers-styles-container--Zbdka",xd="Headers-styles-actionsBar--RXMy4",Cd="Headers-styles-previewSwitcher--Ppqem";function wd(){return wd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},wd.apply(null,arguments)}const Ad=e=>{let{entityTypeUri:t,headColumns:r=[],onSelectColumns:n=_.identity}=e,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["entityTypeUri","headColumns","onSelectColumns"]);const[i,o]=(0,b.useState)(null),[l,s]=(0,b.useState)(""),c=(0,yp.useSelector)(k().selectors.getMetadata),u=()=>{o(null),s("")},p=(0,b.useCallback)(((e,a)=>{const i=(0,Ai.kF)(c,t),o=(0,Ai.m5)(i,e.id);let l;l=o.length?a?r.concat(o):r.filter((e=>!o.find((t=>t.id===e.id)))):a?r.concat(e):r.filter((t=>t.id!==e.id)),n(l)}),[c,t,r,n]);return v().createElement(v().Fragment,null,v().createElement(vd.k,wd({tooltipTitle:li().text("Show/hide columns"),size:"M",icon:Od,onClick:e=>o(e.currentTarget),className:"Headers-styles-headerIcon--c2qe7"},a)),(()=>{const e=(0,Ai.kF)(c,t);return v().createElement(bd,{open:!!i,anchorEl:i,data:e,onListItemClick:p,selected:r,filterText:l,onClose:u,onSearch:s})})())};Ad.propTypes={entityTypeUri:fp().string,headColumns:fp().array,onSelectColumns:fp().func};const Rd=Ad;var _d=r(45053),Id=r(72897),Nd=r(27618),Pd=r.n(Nd),Dd=r(98515),kd=r.n(Dd),Ld=r(29289);const Ud=({headCellData:e,headIndex:t,sortOrder:r,sortField:n,sortHandler:a,canCheck:i,onCheck:o,headerCheckboxState:l,openConfigColumnPopup:s})=>v().createElement("div",{className:O()("HeadCellRenderer-styles-headCellContentWrapper--L6RrQ",(0,_.path)(["wrapperClassName"],e))},e&&i&&v().createElement(qp(),{className:"HeadCellRenderer-styles-checkbox--qQEHg",checked:l||!1,indeterminate:null===l,onChange:()=>o()}),v().createElement("div",{className:"HeadCellRenderer-styles-labelWrapper--cmclk"},e&&(e.sortable?v().createElement(Pd(),{active:Boolean(r&&n===e.id),direction:r,onClick:a,classes:{root:"HeadCellRenderer-styles-sortLabel--NZx3o"},component:"div"},e.label):e.label)),s&&v().createElement("div",{className:"HeadCellRenderer-styles-menuButtonWrapper--aBNeR"},v().createElement(Ap.T,{icon:kd(),onClick:s,size:"S","data-column-index":t})));Ud.propTypes={headCellData:fp().shape({id:fp().string,label:fp().oneOfType([fp().string,fp().node]),sortable:fp().bool}),headIndex:fp().number,sortOrder:fp().string,sortField:fp().string,sortHandler:fp().func,canCheck:fp().bool,onCheck:fp().func,headerCheckboxState:fp().oneOf([!0,!1,null]),openConfigColumnPopup:fp().func};const jd=(0,Ld.q)((0,_.pick)(["openConfigColumnPopup"]))(Ud),Fd=(0,Ld.q)((0,_.pick)(["openConfigColumnPopup","canCheck","onCheck","headerCheckboxState"]))(Ud),Md=v().createContext({generateEntityUrl:S.generateEntityUrlForOldMode,generatePivotingUrl:S.generatePivotingUrlForOldMode,generateTagUrl:S.generateTagUrlForOldMode});function Vd(){return Vd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Vd.apply(null,arguments)}Md.displayName="UrlGeneratorsContext";const Bd=(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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["value","children","screen","className","shouldOpenInNewTab"]);const{generateEntityUrl:s}=(0,b.useContext)(Md),c=(0,w.ax)("openEntity"),u=(0,w.Qh)(),p=(0,b.useCallback)((e=>{(0,wp.rR)(e)||(c({uri:r,screen:a}),e.preventDefault()),e.stopPropagation()}),[c,a,r]);return v().createElement("a",Vd({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}));Bd.displayName="EntityUriLink";const zd={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"},Hd=({value:e={}})=>{const t=(0,S.getLabel)(e.label);return v().createElement("div",{className:O()(zd.defaultWrapper,zd.profileWrapper)},v().createElement(A,{avatarClassName:zd.entityAvatar,imageClassName:zd.entityAvatarImage,entity:e}),v().createElement(Bd,{value:(0,S.getEntityUriForLink)(e),className:zd.entityLabel},t))};Hd.propTypes={value:fp().object};const Yd=Hd;var Wd=r(56755);const Gd=({value:e,columnData:{dataTypeDefinition:t}})=>v().createElement("div",{className:zd.defaultWrapper},t?v().createElement(Wd.x,{value:e,dataTypeDefinition:t}):e);Gd.propTypes={value:fp().any,columnData:fp().object};const qd=Gd,Zd=(e,t,r)=>{const n=(0,S.getEntityTypeGraphIcon)(e,{type:t});return(0,S.getAbsoluteImageUrl)(r,n)};let $d=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 Kd(){return Kd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Kd.apply(null,arguments)}const Xd=e=>{let{className:t,icon:r,avatarText:n,rootClasses:a}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","icon","avatarText","rootClasses"]);const[o,l]=(0,b.useState)(null);(0,b.useEffect)((()=>{l(r?$d.ICON_MODE:$d.TEXT_MODE)}),[r,n]);const s=()=>{l($d.ERROR_MODE)};switch(o){case $d.ICON_MODE:return v().createElement(C(),Kd({className:O()(t,null==a?void 0:a.iconRoot),src:r,onError:s},i));case $d.TEXT_MODE:case $d.ERROR_MODE:return v().createElement(C(),Kd({className:O()(t,null==a?void 0:a.textRoot)},i),n);default:return null}},Qd=({value:e})=>{const t=(0,yp.useSelector)(k().selectors.getMetadata),r=(0,yp.useSelector)(k().selectors.getApiPath),n=(0,yp.useSelector)(k().selectors.getImagePath);return e&&v().createElement("div",{className:O()(zd.defaultWrapper,zd.referenceWrapper)},v().createElement(Xd,{className:zd.referenceIcon,icon:Zd(t,e.refEntity.type,n||r)}),v().createElement(Bd,{value:e.refEntity.objectURI,className:zd.referenceContent},(0,S.getLabel)(e.label)))};Qd.propTypes={value:fp().object};const Jd=Qd,em=e=>{e.stopPropagation()},tm=e=>{const{value:t}=e;return v().createElement("div",{className:zd.blobWrapper,onScroll:em},t)};tm.propTypes={value:fp().any};const rm=tm,nm=({value:e})=>{const t=(0,S.getImageAttributeOvThumbnailUrl)({value:e});return t&&v().createElement("div",{className:zd.imageWrapper},v().createElement("img",{src:t}))};nm.propTypes={value:fp().object};const am=nm,im=e=>{if("label"===e.id)return Yd;switch((0,_.path)(["attrType","type"],e)){case"Reference":return Jd;case"Blob":return rm;case"Image":return am}return qd};function om(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){lm(e,t,r[t])}))}return e}function lm(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const sm=(0,_.split)("."),cm=["entityId"],um=e=>!cm.includes(e.id),pm=e=>{if((0,S.isAttributeSearchUri)(e)){const[,...t]=sm(e);return t.length>1?t.slice(0,-1):null}return null};var dm=r(39034),mm=r(57526),fm=r.n(mm),ym=r(18567),gm=r.n(ym),hm=r(99272),Em=r.n(hm);const bm=(0,Rp.Z)({root:{display:"flex",alignItems:"center",justifyContent:"center",width:"24px",height:"24px"},check:{color:"#8CC152"}}),vm=({classes:e={},tooltip:t="",onClick:r=_.identity,mode:n=dm.Eh.Init})=>{const a=bm();return v().createElement("div",{className:O()(a.root,e.root)},(()=>{switch(n){case dm.Eh.Init:return v().createElement(vd.k,{className:e.button,size:"M",tooltipTitle:t,icon:gm(),onClick:r});case dm.Eh.Progress:return v().createElement(fm(),{className:e.spinner,size:24});case dm.Eh.Success:return v().createElement(Em(),{className:O()(a.check,e.check)});default:return null}})())};function Tm(){return Tm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Tm.apply(null,arguments)}const Om=e=>{let{entity:t,importStatus:r,onImportStatusChange:n,hideDelay:a=3e3}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["entity","importStatus","onImportStatusChange","hideDelay"]);const o=(0,yp.useSelector)(k().selectors.getDtssPath),l=(0,yp.useSelector)(k().selectors.getTenant);return v().createElement(vm,Tm({},i,{mode:r,tooltip:li().text("Import this record"),onClick:e=>{e.stopPropagation(),n(dm.Eh.Progress),(0,S.importEntityFromDataTenant)({dtssPath:o,customerTenant:l,entity:t}).then((({success:e,uris:r})=>{if(!e)throw new Error("Failed to import entity");t.ctSubscribedUris=r,n(dm.Eh.Success),setTimeout((()=>n(dm.Eh.Done)),a)})).catch((()=>{n(dm.Eh.Init),(0,ii.U)(undefined,{title:li().text("Import Error"),message:li().text("Record can't be imported")})}))}}))},Sm=(0,Rp.Z)({importButtonPlaceholder:{display:"flex",alignItems:"center",padding:"0 10px",width:"24px",flexShrink:0,position:"relative"}}),xm=({entity:e,entityImportStatus:t,onEntityImportStatusChange:r})=>{const n=Sm(),a=(0,yp.useSelector)(k().selectors.getMetadata),i=(0,yp.useSelector)(k().selectors.getCanUserImportEntitiesFromDT),o=(0,S.isDataTenantEntity)(e)&&i,l=(0,S.getEntityType)(a,e.type),s=(0,S.checkCanImportEntityOfType)(l)&&!(0,S.isEntityImportedToCT)(e),c=t&&t!==dm.Eh.Done||s;return v().createElement(v().Fragment,null,o&&v().createElement("div",{className:n.importButtonPlaceholder},c&&v().createElement(Om,{entity:e,importStatus:t,onImportStatusChange:t=>r(e.uri,t)})))},Cm=({entity:e,isSelectedEntity:t,isHighlightedEntity:r,entityImportStatus:n,onEntityImportStatusChange:a})=>v().createElement("div",{className:O()(zd.entityButtons,{[zd.selectedEntityButtons]:t,[zd.justImportedEntityButtons]:n===dm.Eh.Success,[zd.highlightedEntityButtons]:r})},v().createElement(xm,{entity:e,entityImportStatus:n,onEntityImportStatusChange:a}));Cm.propTypes={entity:fp().object,isSelectedEntity:fp().bool,isHighlightedEntity:fp().bool,entityImportStatus:fp().oneOf(Object.values(dm.Eh)),onEntityImportStatusChange:fp().func};const wm=(0,Ld.q)((({entitiesImportStatus:e,onEntityImportStatusChange:t,selectedEntityUri:r,highlightedEntityIndex:n},{entity:a,rowIndex:i})=>({entityImportStatus:a&&e[a.uri],onEntityImportStatusChange:t,isSelectedEntity:r===a.uri,isHighlightedEntity:n===i})))(Cm);var Am=r(72326),Rm=r(67655);function _m(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Im(e,t,r[t])}))}return e}function Im(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Nm={height:"100%",display:"flex",flexDirection:"column"},Pm=(0,Rp.Z)((e=>({inactiveCell:_m({background:e.inactiveBackground},Nm,{"&$selectedRowCell":{background:e.inactiveSelectedBackground}}),selectedRowCell:_m({background:(0,Rm.lighten)(e.palette.primary.main,.88)},Nm),clickable:_m({cursor:"pointer"},Nm),justImported:_m({backgroundColor:"#FFFBEB !important"},Nm)}))),Dm={entity:fp().object,isSelected:fp().bool,onEntityClick:fp().func,isJustImported:fp().bool},km=(0,Rp.Z)({checkboxWrapper:{display:"flex",alignItems:"center"},checkbox:{marginRight:"-8px",marginLeft:"11px"}}),Lm={onCheck:fp().func,isChecked:fp().bool,hasCheckbox:fp().bool},Um=(0,Rp.Z)({collapser:{marginLeft:"-2px"}});var jm=r(18021),Fm=r(8835),Mm=r.n(Fm);const Vm=(0,Rp.Z)({collapseButton:{cursor:"pointer"},expandLess:{transform:"rotate( -180deg )"}});function Bm(){return Bm=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Bm.apply(null,arguments)}const zm=e=>{let{isOpen:t=!1,tooltipTitle:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["isOpen","tooltipTitle"]);const a=Vm(),i={icon:Mm(),className:a.collapseButton,iconClassName:O()({[a.expandLess]:t})},o={tooltipTitle:r};return v().createElement(vd.k,Bm({"data-reltio-id":"collapse-button"},i,o,n))},Hm=(0,Rp.Z)((()=>({hidden:{visibility:"hidden"}}))),Ym=({rowIndex:e,rowValue:t,className:r})=>{const n=Hm(),{toggleRowCollapse:a,getIsRowCollapsible:i,getIsRowCollapsed:o}=(0,b.useContext)(jm.x),l=i(t),s=o(e);return v().createElement(zm,{className:O()(r,{[n.hidden]:!l}),isOpen:!s,onClick:t=>{a(e),t.stopPropagation()}})},Wm={hasCollapseButton:fp().bool},Gm=(0,_.pipe)((e=>{const t=t=>{const r=Um(),{hasCollapseButton:n}=t,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(t,["hasCollapseButton"]),{rowValue:i,rowIndex:o}=a;return n?v().createElement("div",{className:"cellWithCollapser"},v().createElement(Ym,{className:r.collapser,rowIndex:o,rowValue:i}),v().createElement(e,a)):v().createElement(e,a)};return t.propTypes=Wm,t}),(e=>{const t=t=>{const r=km(),{onCheck:n,isChecked:a,hasCheckbox:i}=t,o=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(t,["onCheck","isChecked","hasCheckbox"]),{rowValue:{rawValue:l}}=o;return i?v().createElement("div",{className:O()(r.checkboxWrapper,"cellWithCheckbox")},v().createElement(qp(),{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=Lm,t}),(e=>{const t=t=>{const r=Pm(),{rowValue:{rawValue:n},isSelected:a,onEntityClick:i,isJustImported:o}=t,l=i?()=>i(n.uri):void 0,s=n&&!(0,S.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=Dm,t}),(0,Ld.q)((({onEntityClick:e,selectedEntityUri:t,entitiesImportStatus:r,canCheck:n,onCheck:a,checkedEntitiesUris:i},{rowValue:o,columnIndex:l})=>{const{rawValue:s}=o,c=0===l;return{onCheck:a,isChecked:i&&i.includes(s.uri),hasCheckbox:n&&c,hasCollapseButton:c,isSelected:t===s.uri,isJustImported:r[s.uri]===dm.Eh.Success,onEntityClick:e}})))(Am.DN),qm=({columnData:e,cell:t})=>{const r=t.values.length,n=28*Math.max(r,1)+20;if(!r)return n;switch((0,_.path)(["dataTypeDefinition","type"],e)){case"Reference":return 28*r+17;case"Blob":return 100*r;case"Image":return 76*r+17;default:return n}},Zm=(0,b.forwardRef)((({headColumns:e,entities:t,entityToHighlight:r,selectedEntityUri:n,onReorderingColumn:a,dndColumnReorderingEnabled:i,columnsSize:o,onChangeColumnsSize:l,onScroll:s,onSort:c,sortField:u,sortOrder:p,onEntityHover:d,onEntityClick:m,entitiesImportStatus:f,onEntityImportStatusChange:y,logger:g,canCheck:h,checkedEntitiesUris:E,headerCheckboxState:T,onCheck:O,openConfigColumnPopup:x,resizeDebounceDelay:C},w)=>{const A=(0,b.useMemo)((()=>({highlightRow:"highlightedSelector",dragColumnHead:zd.dragColumnHead,dragColumnBody:zd.dragColumnBody,draggableHeadCell:zd.draggableHeadCell,cellWrapper:zd.cellWrapper})),[]),R=(0,yp.useSelector)(k().selectors.getMetadata),[I,N]=(0,b.useState)(null),P=(0,b.useCallback)((e=>{N(e),d&&d((0,_.path)([e,"uri"],t))}),[d,t]),D=(0,b.useRef)();(0,b.useImperativeHandle)(w,(()=>({resetScrollbarPosition:()=>{D.current&&D.current.resetScrollbarPosition({resetLeft:!1})}})));const L=(0,b.useCallback)((e=>{p&&e===u?p===_d.oy?c({field:e,order:_d.U9}):c({field:e}):c({field:e,order:_d.oy})}),[c,u,p]),U=(0,b.useCallback)((e=>{const r=(0,_.prop)(e,t);return r?v().createElement(wm,{entity:r,rowIndex:e}):null}),[t]),j=(0,b.useCallback)((e=>v().createElement(Gm,e)),[]),F=!!d,M=!!c,V=(0,b.useMemo)((()=>((e,t=!0)=>e.map(((e,r)=>{var n;let{attrType:a}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attrType"]);const o=0===r;return om({},i,{dataTypeDefinition:a&&(0,S.getAttrDataTypeDefinition)(a),resizable:!0,autoResize:null!==(n=i.autoResize)&&void 0!==n?n:!o,draggable:!o,sortable:t&&um(i),nestedPath:pm(i.id),headCellRenderer:o?Fd:jd,rowCellValueRenderer:im(om({},i,{attrType:a}))})})))(e,M)),[e,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,S.getEntityId)(r);default:{const[e,...n]=sm(t.id);return(0,_.pipe)((0,_.prop)(e),(0,S.getOvAttributeValuesByPath)(n))(r)}}})(0,r,e),t)),{}),(0,_.assoc)("rawValue",e))(t))))(0,e,t)),[R,e,t]),z=r?t.findIndex((0,_.propEq)("uri",r)):-1,H=(0,b.useMemo)((()=>({onEntityClick:m,selectedEntityUri:n,highlightedEntityIndex:z,entitiesImportStatus:f,onEntityImportStatusChange:y,canCheck:h,checkedEntitiesUris:E,headerCheckboxState:T,onCheck:O,openConfigColumnPopup:x})),[E,f,T,z,h,O,m,y,n,x]);return v().createElement(Id.M,{fixFirstColumn:!0,onScroll:s,rowsData:B,columnsData:V,onSort:L,highlightRow:-1!==z?z:null,ref:D,sortFieldClassName:zd.sortableCell,containerClassName:zd.table,classes:A,defaultColumnWidth:250,headRowHeight:50,defaultColumnMinWidth:100,defaultRowHeight:48,sorting:{field:u,order:p},dndColumnReorderingHandler:a,dndColumnReorderingEnabled:i,onChangeColumnsSize:l,columnsSize:o,resizeDebounceDelay:null!=C?C:150,onRowHover:F?P:void 0,hoverStateEnabled:F,hoverRowIndex:I,renderRowOverlay:U,logger:g,context:H,maxRowValuesCount:2,renderRowCell:j,getRowCellHeight:qm})}));Zm.propTypes={entities:fp().array,entityToHighlight:fp().string,selectedEntityUri:fp().string,headColumns:fp().array,columnsSize:fp().array,onScroll:fp().func,onSort:fp().func,onReorderingColumn:fp().func,onChangeColumnsSize:fp().func,dndColumnReorderingEnabled:fp().bool,onEntityClick:fp().func,onEntityHover:fp().func,sortField:fp().string,sortOrder:fp().oneOf([_d.oy,_d.U9]),entitiesImportStatus:fp().object,onEntityImportStatusChange:fp().func,logger:fp().func,canCheck:fp().bool,checkedEntitiesUris:fp().arrayOf(fp().string),headerCheckboxState:fp().oneOf([!0,!1,null]),onCheck:fp().func,openConfigColumnPopup:fp().func,resizeDebounceDelay:fp().number},Zm.defaultProps={entities:[],headColumns:[]},Zm.displayName="EntitiesTable";const $m=(0,b.memo)(Zm);var Km=r(4437),Xm=r.n(Km),Qm=r(5106),Jm=r.n(Qm);const ef="left",tf="right",rf="hide",nf={[ef]:li().text("Insert 1 left"),[tf]:li().text("Insert 1 right"),[rf]:li().text("Hide column")},af=({open:e,anchorEl:t,onClick:r,onClose:n,actions:a})=>v().createElement(hp(),{open:e,anchorEl:t,onClose:n},v().createElement(Xm(),{component:"div"},a.map(((e,t)=>((e,t,r)=>v().createElement(Jm(),{button:!0,component:"div",key:r,onClick:t},v().createElement(Wp(),{primary:nf[e],primaryTypographyProps:{variant:"body2"}})))(e,(e=>()=>{r(e)})(e),t)))));af.propTypes={open:fp().bool,anchorEl:fp().any,onClick:fp().func,onClose:fp().func,actions:fp().array};const of=af;class lf extends v().PureComponent{constructor(...e){super(...e),this.state={addColumnPopupOpen:!1,configColumnPopupOpen:!1,configurableColumnIndex:!1,popupAnchor:null,filterText:""},this.addColumnHandler=e=>{const{newColumnPlaceIndex:t}=this.state,{onChangeColumnsList:r,headColumns:n}=this.props,a=n.slice();a.splice(t,0,e),r({columns:a}),this.closeAddColumnPopup()},this.openAddColumnPopup=({newColumnPlaceIndex:e})=>{this.setState({newColumnPlaceIndex:e,configColumnPopupOpen:!1,addColumnPopupOpen:!0})},this.closeAddColumnPopup=()=>{this.setState({popupAnchor:null,addColumnPopupOpen:!1,filterText:""})},this.setFilterText=e=>{this.setState({filterText:e})},this.openConfigColumnPopup=e=>{this.setState({popupAnchor:e.currentTarget,configColumnPopupOpen:!0,configurableColumnIndex:parseInt(e.currentTarget.getAttribute("data-column-index"))})},this.closeConfigColumnPopup=()=>{this.setState({configColumnPopupOpen:!1})},this.configColumnHandler=e=>{const{configurableColumnIndex:t}=this.state;switch(e){case ef:this.openAddColumnPopup({newColumnPlaceIndex:t});break;case tf:this.openAddColumnPopup({newColumnPlaceIndex:t+1});break;case rf: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,S.memoizeWith)(lf.getMemoIdForColumnSize,lf.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:f,onChangeColumnsSize:y,entityTypeUri:g,entitiesImportStatus:h={},onEntityImportStatusChange:E,logger:b,canCheck:T,checkedEntitiesUris:O,headerCheckboxState:S,onCheck:x,resizeDebounceDelay:C}=this.props,{addColumnPopupOpen:w,configColumnPopupOpen:A,popupAnchor:R,filterText:_,configurableColumnIndex:I}=this.state,N=this.memoizedGetColumnSize(a,g);return v().createElement(v().Fragment,null,v().createElement($m,{entities:e,entityToHighlight:t,selectedEntityUri:r,onScroll:n,onSort:f,onEntityClick:s,onEntityHover:c,headColumns:a,sortField:i,sortOrder:o,onReorderingColumn:m,ref:u,onChangeColumnsList:d,dndColumnReorderingEnabled:l,onChangeColumnsSize:y,columnsSize:N,entitiesImportStatus:h,onEntityImportStatusChange:E,logger:b,canCheck:T,checkedEntitiesUris:O,headerCheckboxState:S,onCheck:x,openConfigColumnPopup:this.openConfigColumnPopup,resizeDebounceDelay:C}),v().createElement(bd,{open:w,anchorEl:R,data:p,onListItemClick:this.addColumnHandler,filterText:_,onClose:this.closeAddColumnPopup,onSearch:this.setFilterText,hideCheckBox:!0,titleText:oi.text("Add column")}),v().createElement(of,{onClick:this.configColumnHandler,onClose:this.closeConfigColumnPopup,anchorEl:R,open:A,actions:I>0?[ef,tf,rf]:[tf]}))}}lf.propTypes={entities:fp().array,entityToHighlight:fp().string,selectedEntityUri:fp().string,entityTypeUri:fp().string,headColumns:fp().array,dndColumnReorderingEnabled:fp().bool,onScroll:fp().func,onSort:fp().func,onReorderingColumn:fp().func,onChangeColumnsSize:fp().func,onChangeColumnsList:fp().func,onEntityClick:fp().func,onEntityHover:fp().func,sortField:fp().string,sortOrder:fp().oneOf([_d.oy,_d.U9]),entitiesTableRef:fp().shape({current:fp().shape({resetScrollbarPosition:fp().func})}),additionalColumns:fp().arrayOf(fp().shape({id:fp().string,label:fp().string})),entitiesImportStatus:fp().object,onEntityImportStatusChange:fp().func,logger:fp().func,canCheck:fp().bool,checkedEntitiesUris:fp().arrayOf(fp().string),headerCheckboxState:fp().oneOf([!0,!1,null]),onCheck:fp().func};const sf=lf;var cf=r(66780),uf=r(9366),pf=r(41633),df=r(79881),mf=r.n(df),ff=r(93962),yf=r.n(ff),gf=r(45995),hf=r.n(gf);function Ef(){return Ef=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ef.apply(null,arguments)}const bf=e=>{let{open:t=!0,children:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["open","children"]);const[a,i]=(0,b.useState)(t),o=(0,Rm.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(hf(),Ef({open:t},n),a&&r)};bf.displayName="Drawer";var vf=r(18759),Tf=r.n(vf),Of=r(30122),Sf=r.n(Of),xf=r(43410),Cf=r.n(xf),wf=r(93416),Af=r.n(wf),Rf=r(66825),_f=r.n(Rf),If=r(17698);const Nf=(0,_.allPass)([(0,_.propSatisfies)(_.isEmpty,"configs"),(0,_.pathEq)(["group","hasCollapseButton"],!0)]),Pf=(0,_.reject)(Nf),Df=(0,Rp.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"}}),kf=({title:e="",iconSrc:t="",isOpen:r=!0,hasCollapseButton:n=!0,leftIcon:a,onCollapse:i})=>{const o=Df();return v().createElement("div",{className:o.titleBox},v().createElement("div",{className:o.title},a&&v().createElement("div",{className:o.leftIcon},a),t&&v().createElement(C(),{src:t,className:o.avatar}),v().createElement(sd.Y,{value:e},v().createElement("span",{className:o.text},e))),n&&v().createElement(zm,{isOpen:r,onClick:i,className:o.collapseIcon,size:"S"}))};var Lf=r(1230),Uf=r.n(Lf),jf=r(36631);const Ff=({facet:e,selectedFacets:t})=>!!t.find((t=>t.fieldName===e.fieldName||t.fieldName.includes(`${e.fieldName}.`))),Mf=({facet:e,selectedFacets:t})=>Ff({facet:e,selectedFacets:t})||(0,N.OP)(e)&&e.children&&e.children.some((e=>Ff({facet:e,selectedFacets:t}))),Vf=(0,Rp.Z)({icon:{maxHeight:"25px",maxWidth:"25px",marginRight:"16px"}}),Bf=({group:e,metadata:t})=>{const r=Vf(),n=(0,w.$H)(),a=(0,S.getEntityTypeGraphIcon)(t,{type:e.id}),i=(0,S.getAbsoluteImageUrl)(n,a);return v().createElement(Xd,{className:r.icon,icon:i,avatarText:e.title[0]})};function zf(){return zf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},zf.apply(null,arguments)}const Hf=e=>{let{onListItemClick:t,focusIndex:r,selectedFacets:n,metadata:a}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["onListItemClick","focusIndex","selectedFacets","metadata"]);const o=(0,b.useRef)(null);o.current=n;const l=(0,b.useRef)(null);l.current=r;const s=(0,b.useCallback)(((e,{item:r,level:n,groupId:a},i)=>{const s=Mf({facet:r,selectedFacets:o.current}),c=l.current===i;return v().createElement(md,{key:`item-${a}-${r.fieldName}`,onClick:t,data:r,label:v().createElement(fd.o,{text:r.title,highlight:r.filterText}),labelInText:r.title,level:n,style:e,checked:s,isFocused:c,groupId:a,LogoIcon:r.LogoIcon})}),[t]),c=(0,b.useCallback)(((e,t)=>v().createElement(Jm(),{component:"div",className:"MoreFacetsPopup-styles-subHeader--h1vGz",style:e,key:`group-${t.item.id}`},t.item.needGroupIcon&&v().createElement(Bf,{metadata:a,group:t.item}),t.item.title)),[a]),u=(0,b.useCallback)(((e,t)=>t.items?40:28),[]);return v().createElement(zp,zf({getItemSize:u,renderGroupTitle:c,renderItem:s,focusIndex:r},i,{disableHorizontalScrollbar:!0}))};function Yf(){return Yf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Yf.apply(null,arguments)}const Wf=574,Gf={},qf=e=>{let{metadata:t,open:r,selectedFacets:n,data:a=[],onListItemClick:i,lastFacetClicked:o=Gf,width:l,height:s=Wf}=e,c=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["metadata","open","selectedFacets","data","onListItemClick","lastFacetClicked","width","height"]);const[u,p]=(0,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]),f=(0,b.useRef)();(0,b.useEffect)((()=>{const e=(0,_.path)(["current","updatePosition"],f);e&&e()}),[u]);const y=(0,b.useCallback)(((e,t,r=0)=>[{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=>y(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=>y(t,e.id)))}))).filter((e=>e.items.length))),[y]),h=(0,b.useMemo)((()=>g(a)),[a,g]),E=(0,b.useMemo)((()=>(0,ci.LG)(h)),[h]),T=(0,b.useCallback)((({item:e,groupData:t})=>{i(e,!Mf({facet:e,selectedFacets:n}),t.groupId)}),[i,n]),{focusIndex:O,handleKeyDown:x}=Hp({items:E,open:r,onSelectFocusedItem:T,selectedItems:n}),C=Math.max(l||(0,S.getMaxItemWidth)("title")(h),240);return v().createElement(Up,Yf({open:r,action:f,title:li().text("Select attribute"),containerWidth:C,searchInputOnKeyDown:x,containerHeight:110+u},c),v().createElement(Hf,{focusIndex:O,selectedFacets:n,onListItemClick:i,metadata:t,items:E,height:u,onInnerContainerResize:m}),0===E.length&&v().createElement("div",{className:"MoreFacetsPopup-styles-noResultsCaptionContainer--ChfND"},v().createElement(Tf(),{variant:"caption",display:"block",gutterBottom:!0},li().text("No results found"))))};function Zf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){$f(e,t,r[t])}))}return e}function $f(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class Kf extends b.PureComponent{constructor(e){super(e),this.state={filterText:"",lastFacetClicked:null,addedFacets:[]},this.searchInputRootRef=v().createRef(),this.showSearchInput=()=>this.searchInputRootRef.current.scrollIntoView(!0),this.openPopup=()=>this.props.dispatch(fi(!0)),this.closePopup=()=>{this.props.dispatch(fi(!1)),this.props.dispatch(((e=[])=>({type:L.k.HIGHLIGHT_ADDED_FACETS,payload:e}))(this.state.addedFacets)),this.setState({addedFacets:[]}),setTimeout((()=>{this.props.dispatch({type:L.k.CLEAR_HIGHLIGHT_ADDED_FACETS})}),3e3)},this.setFilterText=e=>this.setState({filterText:e,lastFacetClicked:null}),this.clearFilterText=()=>this.setFilterText(""),this.setLastFacetClicked=e=>this.setState({lastFacetClicked:e}),this.resetLastFacetClicked=()=>this.setLastFacetClicked(null),this.filterItem=e=>{const{filterText:t=""}=this.state;return e.title.toLowerCase().includes(t.toLowerCase())},this.filterItemsTree=e=>this.filterItem(e)||(e.children||[]).some(this.filterItemsTree),this.getFilteredFacets=e=>(e||[]).map((e=>Zf({},e,{hide:!this.filterItemsTree(e),filterText:this.state.filterText}))).map((e=>{const t=this.getFilteredFacets(e.children);return(0,_.isEmpty)(t)?e:Zf({},e,{children:t})})),this.filterItemsInGroups=e=>e.map((e=>Zf({},e,{facets:this.getFilteredFacets(e.facets)}))),this.rejectNotAllowedEntityTypes=e=>t=>t.filter((({id:t})=>!(0,S.isEntityTypeUri)(t)||e.includes(t))),this.toggleSelectedFacet=(e,t)=>{const{facetsConfigs:r,selectedEntityTypes:n,dispatch:a}=this.props,i=(0,ci.jj)(e),o=t?r.concat(e).concat(i):r.filter((t=>t.fieldName!==e.fieldName)).filter((e=>!i.find((t=>t.fieldName===e.fieldName)))),l=(0,_.uniq)(o.filter((e=>e.entityTypeUri)).map((e=>e.entityTypeUri)).concat(n)),s=o.filter((0,_.complement)(N.OP)),c=s.filter((e=>!r.find((t=>t.fieldName===e.fieldName)))),u=r.filter((e=>!s.find((t=>e.fieldName===t.fieldName)))).map((e=>e.fieldName));(c.length||u.length)&&(this.setAddedFacets(c.map((0,_.prop)("fieldName")),u),a(ri({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,jf.Z)(N.tI),this.handleInputFocus=()=>{this.showSearchInput(),this.openPopup()}}get inputWidth(){return this.searchInputRootRef.current?this.searchInputRootRef.current.getBoundingClientRect().width:0}render(){const{filterText:e,lastFacetClicked:t}=this.state,{open:r,recommendedFacets:n,classes:a,metadata:i,selectedEntityTypes:o,facetsConfigs:l,dataTenantObject:s,allowedEntityTypes:c,dataTenants:u}=this.props,p=l.map((e=>({fieldName:e.fieldName,uri:e.uri}))),d=this.memoizedCollectFacetsList(i,o,n,u),m=(0,_.pipe)((0,_.when)((0,_.always)(e),this.filterItemsInGroups),(0,_.when)((0,_.always)(c),this.rejectNotAllowedEntityTypes(c)),(0,j.Eb)(s))(d),{verticalOrigin:f,popupHeight:y}=((e,t,r=16)=>{let n="top";if(e){const a=e.getBoundingClientRect(),i=r,o=window.innerHeight-r;if(a.top+t>o)if(a.bottom-t<i){const e=a.bottom-i,r=o-a.top;t=Math.max(e,r),n=e>r?"bottom":"top"}else n="bottom"}return{verticalOrigin:n,popupHeight:t}})(this.searchInputRootRef.current,Wf),g={vertical:f,horizontal:"right"};return v().createElement(b.Fragment,null,v().createElement(Dp,{classes:{root:a.inputContainer},onSearch:this.setFilterText,onFocus:this.handleInputFocus,rootRef:this.searchInputRootRef,value:e,placeholder:li().text("Search & add attributes"),height:40,"data-reltio-id":"reltio-search-more-facets-search-input"}),v().createElement(qf,{open:r,anchorEl:this.searchInputRootRef.current,metadata:i,selectedFacets:p,data:m,onClose:this.handlePopupClose,onListItemClick:this.handleItemClick,lastFacetClicked:t,width:this.inputWidth,height:y,onSearch:this.setFilterText,headerPlacement:"bottom"===f?"bottom":"top",anchorOrigin:g,transformOrigin:g,disableRestoreFocus:!0}))}}Kf.defaultProps={selectedEntityTypes:[],facetsConfigs:[]};const Xf=(0,yp.connect)((e=>({metadata:k().selectors.getMetadata(e),open:(0,Ri.ds)(e),facetsConfigs:(0,P.Mp)(e),recommendedFacets:(0,P.ER)(e),selectedEntityTypes:(0,P.DX)(e),dataTenantObject:(0,ai.t9)(e),allowedEntityTypes:(0,Ri.Xf)(e),dataTenants:k().selectors.getDataTenants(e)})))(Uf()((()=>({inputContainer:{margin:"4px 16px 16px",flexShrink:"0"}})))(Kf)),Qf=(0,Rp.Z)({facetGroupContainer:{display:"flex",flexShrink:0,flexDirection:"column","& + hr":{marginTop:8},"& + &":{marginTop:"8px"}}});function Jf(){return Jf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Jf.apply(null,arguments)}const ey=e=>{let{hasSearchAttributesField:t,children:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["hasSearchAttributesField","children"]);const a=Qf(),[i,o]=(0,b.useState)(!0);return v().createElement("div",{className:a.facetGroupContainer},v().createElement(kf,Jf({isOpen:i,onCollapse:e=>{o(!i)}},n)),t&&v().createElement(v().Fragment,null,v().createElement(Xf,null),v().createElement(_f(),null)),i&&r)};function ty(){return ty=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ty.apply(null,arguments)}var ry=r(52004),ny=r.n(ry),ay=r(58282),iy=r.n(ay);const oy=(0,Rp.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)"}}))),ly=({active:e,onClick:t,className:r})=>{const n=oy();return v().createElement(ny(),{className:O()(n.viewMoreLessLink,r),onClick:t,underline:"none"},v().createElement(iy(),{"data-reltio-id":"more-arrow-icon",className:O()(n.arrow,{[n.rotated]:e})}),e?li().text("View less"):li().text("View more"))};var sy=r(50592),cy=r(23888),uy=r.n(cy);const py=(0,Rp.Z)((e=>({bar:{backgroundColor:e.palette.secondary.main,opacity:.12,position:"absolute",minHeight:"20px",minWidth:"5px",borderRadius:"2px",top:0,left:0,height:"100%"}}))),dy=e=>(0,_.is)(Number,e),my=({className:e,width:t=0,maxWidth:r})=>{const n=py(),a=(0,b.useCallback)((e=>(r?100*e/r:0)+"%"),[r]);return t?v().createElement("div",{className:O()(n.bar,e),style:{width:dy(t)?a(t):t}}):null},fy=(0,Rp.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 yy(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const gy={showColorBar:!0,hasOnlyButton:!1},hy=({config:e,data:t=[],values:r=[],onChange:n=_.identity})=>{const a=fy();e=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){yy(e,t,r[t])}))}return e}({},gy,e);const i=e=>()=>{const t=r.includes(e)?r.filter((t=>t!==e)):r.concat(e);n(t)},o=Math.max(...t.map((e=>e.number)));return v().createElement("div",{className:a.listContainer},t.map((t=>v().createElement("div",{key:t.value,className:O()(a.item,{[a.disabled]:!t.number&&!r.includes(t.value)}),"data-reltio-id":"search-facets-list-row"},(e=>v().createElement(qp(),{className:O()(a.checkbox,{[a.checked]:r.includes(e.value)}),checked:r.includes(e.value),onChange:i(e.value),value:e.value,color:"primary"}))(t),v().createElement("div",{className:a.info,onClick:i(t.value)},(e=>v().createElement(my,{className:O()({[a.checkedBar]:r.includes(e.value)}),width:e.number,maxWidth:o}))(t),v().createElement("div",{className:O()(a.textInfo)},v().createElement("div",{className:a.text},t.label),v().createElement("div",{className:a.count},void 0===t.number?li().text("N/A"):(0,ni.k7)(t.number,5e3))),e.hasOnlyButton&&(e=>{return v().createElement(uy(),{className:a.buttonONLY,onClick:(t=e.value,e=>{e.stopPropagation(),n([t])})},li().text("ONLY"));var t})(t))))))};var Ey=r(1441);const by=(0,Rp.Z)((()=>({container:{overflow:"hidden",display:"flex",flexGrow:1,flexDirection:"column",fontSize:"13px"},noData:{marginLeft:"16px"},viewMoreLess:{paddingLeft:"20px"}}))),vy=({config:e,data:t=[],values:r=[],onChange:n})=>{const a=by(),i=(0,yp.useDispatch)(),o=(0,b.useCallback)((({show:e})=>{i((({show:e,silent:t})=>({type:L.k.SHOW_MORE_ENTITY_TYPES,payload:{show:e,silent:t}}))({show:e}))}),[i]),l=(0,yp.useSelector)((t=>(0,P.jC)(e,t))),s=(0,yp.useSelector)(ai.t9),c=t.length>Z.wP,u=(0,b.useCallback)((()=>{o({show:!l})}),[o,l]),p=(0,b.useMemo)((()=>{const e=l?t:t.slice(0,Z.wP);return(0,Ey.ZK)(e,s)}),[t,l,s]);return v().createElement("div",{className:a.container},t.length>0?v().createElement(v().Fragment,null,v().createElement(hy,{data:p,values:r,onChange:n,config:e}),c&&v().createElement(ly,{active:l,onClick:u,className:a.viewMoreLess})):v().createElement(sy.K,{variant:"noData",className:a.noData}))};var Ty=r(70347),Oy=r(94852);const Sy=(0,Oy.M)(Ty.ZP);var xy=r(75237),Cy=r(27308);const wy=(0,Oy.M)(Cy.ZP);var Ay=r(22507),Ry=r(14658);function _y(){return _y=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_y.apply(null,arguments)}const Iy={Option:({innerProps:e,innerRef:t,children:r,isFocused:n,isSelected:a,selectProps:{classes:i},label:o})=>v().createElement($p(),_y({className:O()(i.option,{[i["option--selected"]]:a}),ref:t,selected:n,component:"div"},e),v().createElement(qp(),{color:"primary",checked:a}),v().createElement(sd.Y,{value:o},v().createElement("div",{className:i["option--item"]},r)))},Ny=(0,Rp.Z)((e=>({label:{top:6,left:16},placeholder:({placeholder:e,label:t})=>({display:!e||t?"none":void 0}),"option--selected":{fontWeight:400},clearIndicator:{padding:e.spacing(1),margin:e.spacing(.25,.5)},dropdownIndicator:{padding:e.spacing(1),margin:e.spacing(.25,.5)}})));function Py(){return Py=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Py.apply(null,arguments)}function Dy(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){ky(e,t,r[t])}))}return e}function ky(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}let Ly=0;const Uy=e=>{const{label:t,creatable:r,getOptions:n,loadingIndicator:a,components:i,classes:o,styles:l,onChange:s,onInputChange:c,menuPlacement:u="auto"}=e,p=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["label","creatable","getOptions","loadingIndicator","components","classes","styles","onChange","onInputChange","menuPlacement"]),d=r?Sy:n?wy:xy.J,[m,f]=(0,b.useState)(""),y=Ny((0,_.omit)(["classes"],e)),g="custom-select-"+Ly++,h=(0,b.useRef)();((e=[],t)=>{const r=(0,Ry.D)(null==e?void 0:e.length);(0,b.useEffect)((()=>{const n=setTimeout((()=>{const n=(e=>{let t=null==e?void 0:e.parentElement;for(;t;){if(t.scrollHeight>t.clientHeight)return t;t=t.parentElement}return null})(null==t?void 0:t.current);var a;n&&((e,t,r,n)=>e&&t<e&&n.getBoundingClientRect().bottom>r.getBoundingClientRect().bottom)(null==e?void 0:e.length,r,n,t.current)&&(null===(a=t.current)||void 0===a||a.scrollIntoView(!1))}),0);return()=>{clearTimeout(n)}}),[null==e?void 0:e.length])})(e.value,(e=>{const t={};return e.current&&(t.current=(0,_.either)((0,_.path)(["select","controlRef"]),(0,_.path)(["select","select","controlRef"]))(e.current)),t})(h));const E=Dy({},Iy,i),T=(0,Ay.z)(y,o),O=Dy({indicatorSeparator:e=>Dy({},e,{margin:"10px 0"}),loadingIndicator:e=>Dy({},e,{display:a?e.display:"none"}),loadingMessage:e=>Dy({},e,{fontFamily:'"Roboto", "Helvetica", "Arial", sans-serif'})},l),S=t?{inputId:g,TextFieldProps:Dy({label:t,InputLabelProps:{htmlFor:g,shrink:!(!e.value||!e.value.length)||void 0,className:T.label}},e.TextFieldProps)}:{};return v().createElement(d,Py({isMulti:!0,inputId:g,inputValue:m,onChange:function(e,t){s(e,t),"create-option"===t.action&&(f(""),c("",{action:"input-change"}))},onInputChange:function(e,{action:t}){c(e,{action:t}),"set-value"!==t&&f(e)},closeMenuOnSelect:!1,hideSelectedOptions:!1,classes:T,components:E,styles:O,menuPlacement:u,loadOptions:n,innerRef:h},S,p))};Uy.defaultProps={creatable:!1,cacheOptions:!0,components:{},classes:{},placeholder:"",loadingIndicator:!1,onInputChange:()=>{},onChange:()=>{}},Uy.propTypes={creatable:fp().bool,cacheOptions:fp().bool,defaultOptions:fp().bool,value:fp().arrayOf(fp().shape({label:fp().string.isRequired,value:fp().any})),options:fp().arrayOf(fp().shape({label:fp().string.isRequired,value:fp().any})),onChange:fp().func,onInputChange:fp().func,placeholder:fp().string,label:fp().string,loadingIndicator:fp().bool,components:fp().shape({ClearIndicator:fp().func,Control:fp().func,DropdownIndicator:fp().func,DownChevron:fp().func,CrossIcon:fp().func,Group:fp().func,GroupHeading:fp().func,IndicatorsContainer:fp().func,IndicatorSeparator:fp().func,Input:fp().func,LoadingIndicator:fp().func,Menu:fp().func,MenuList:fp().func,MenuPortal:fp().func,LoadingMessage:fp().func,NoOptionsMessage:fp().func,MultiValue:fp().func,MultiValueContainer:fp().func,MultiValueLabel:fp().func,MultiValueRemove:fp().func,Option:fp().func,Placeholder:fp().func,SelectContainer:fp().func,SingleValue:fp().func,ValueContainer:fp().func}),classes:fp().shape({control:fp().string,valueContainer:fp().string,multiValue:fp().string,noOptionsMessage:fp().string,singleValue:fp().string,placeholder:fp().string,menu:fp().string,clearIndicator:fp().string,dropdownIndicator:fp().string,option:fp().string,"option--selected":fp().string,label:fp().string}),styles:fp().shape({clearIndicator:fp().func,container:fp().func,control:fp().func,dropdownIndicator:fp().func,group:fp().func,groupHeading:fp().func,indicatorsContainer:fp().func,indicatorSeparator:fp().func,input:fp().func,loadingIndicator:fp().func,loadingMessage:fp().func,menu:fp().func,menuList:fp().func,menuPortal:fp().func,multiValue:fp().func,multiValueLabel:fp().func,multiValueRemove:fp().func,noOptionsMessage:fp().func,option:fp().func,placeholder:fp().func,singleValue:fp().func,valueContainer:fp().func}),TextFieldProps:fp().object,getOptions:fp().func,menuPlacement:fp().string,menuPortalTarget:fp().object,menuShouldBlockScroll:fp().bool,captureMenuScroll:fp().bool,getOptionValue:fp().func,isSearchable:fp().bool,inputRef:fp().shape({current:fp().object})};var jy=r(80959),Fy=r(88640),My=r(25386),Vy=r(59428),By=r(47823);const zy=(0,Rp.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 Hy(){return Hy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Hy.apply(null,arguments)}const Yy=e=>{const{innerProps:t,innerRef:r,data:n,isSelected:a,isFocused:i,selectProps:{classes:o}}=e,l=zy(),s=(0,_.has)("width",n),c=(0,_.has)("number",n);return v().createElement($p(),Hy({className:o.option,classes:{root:l.item,selected:l.itemSelected},ref:r,component:"div",selected:i,disableGutters:!0},t),v().createElement(qp(),{checked:a,color:"primary",disableRipple:!0,classes:{root:l.checkbox}}),v().createElement("div",{className:l.infobox},v().createElement("div",{className:l.textbox},v().createElement(sd.Y,{value:n.label},v().createElement("div",{className:l.text},n.label)),c&&v().createElement("div",{className:l.number},(0,ni.k7)(n.number,5e3))),s&&v().createElement(my,{className:O()(l.colorBar,{[l.selectedColorBar]:a}),width:n.width})))};Yy.propTypes={innerProps:fp().shape({id:fp().string.isRequired,key:fp().string,onClick:fp().func.isRequired,onMouseMove:fp().func.isRequired,onMouseOver:fp().func.isRequired,tabIndex:fp().number.isRequired}).isRequired,innerRef:fp().oneOfType([fp().oneOf([null]),fp().func,fp().shape({current:fp().any.isRequired})]),isSelected:fp().bool.isRequired,isFocused:fp().bool.isRequired,selectProps:fp().shape({classes:fp().shape({option:fp().string})}),data:fp().shape({value:fp().string,label:fp().string.isRequired,number:fp().number}).isRequired};const Wy=Yy,Gy=e=>{const{selectProps:{classes:t}}=e;return v().createElement(sy.K,{variant:"noData",className:t.noOptionsMessage})};Gy.propTypes={selectProps:fp().object.isRequired};const qy=Gy;function Zy(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){$y(e,t,r[t])}))}return e}function $y(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ky={container:e=>Zy({},e,{width:"100%"}),menuList:e=>Zy({},e,{maxHeight:"240px",padding:"8px 0"}),menu:e=>Zy({},e,{maxHeight:"240px"})},Xy=(0,Rp.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)"}}))),Qy=fp().shape({value:fp().string.isRequired,label:fp().string.isRequired,number:fp().number});function Jy(){return Jy=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Jy.apply(null,arguments)}function eg(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const tg=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=Z.cu}=e,d=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["values","defaultOptions","filteredOptions","onChange","getSuggestions","showBar","showNumberInValue","classes","styles","canLoadMore","max"]);const m=Xy(),[f,y]=(0,b.useState)(""),[g,h]=(0,b.useState)(1),[E,T]=(0,b.useState)(!1),O=(0,b.useRef)(null),x=(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,S.formatNumberAsMetric)((0,_.prop)("number",e),5e3),e):e,I=(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){eg(e,t,r[t])}))}return e}({},e,{width:N(e.number,t)})))}return e}),(0,_.uniqBy)((0,_.prop)("value"))),N=(e,t)=>(t?100*e/t:0)+"%",P=(0,S.debounce)(((e,{action:t})=>{e!==f&&"set-value"!==t&&(y(e),h(1),x.current=!1,T(!0),i({value:e,pageNumber:1}))}),250),D=n||r,k=(0,b.useCallback)((()=>{T(!0),i({value:f,pageNumber:g+1,currentOptions:D}),x.current=!0}),[f,g,i,D]);(0,b.useEffect)((()=>{T(!1),x.current&&(h((e=>e+1)),x.current=!1)}),[n]),(0,b.useEffect)((()=>{C.current||(T(!1),h(1),x.current=!1,i({value:"",pageNumber:1})),C.current=!1}),[r]);const L=(0,b.useMemo)((()=>D.slice(0,g*p)),[D,g,p]),U=u&&D.length>L.length;return v().createElement(Uy,Jy({filterOption:({label:e,value:t},r)=>S.utils.strings.search(e,r)||S.utils.strings.search(t,r),value:(e=>(0,S.wrapInArrayIfNeeded)(e).map(A).map(R))(t),onChange:(0,_.pipe)((0,_.tap)((()=>{C.current=!0})),(0,_.defaultTo)([]),(0,_.pluck)("value"),a),options:I(L),onInputChange:P,classes:(0,_.mergeRight)(m,s),styles:(0,_.mergeRight)(Ky,c),TextFieldProps:{InputProps:{disableUnderline:!0},ref:O},inputRef:O,components:{Option:Wy,NoOptionsMessage:qy,Menu:jy.h,DropdownIndicator:Fy.K,MultiValue:My._,MenuList:Vy.d},menuPlacement:"bottom",menuListFooter:U&&v().createElement(By.X,{loading:E,onClick:k})},d))};tg.propTypes={values:fp().array,defaultOptions:fp().arrayOf(Qy),filteredOptions:fp().arrayOf(Qy),onChange:fp().func.isRequired,getSuggestions:fp().func.isRequired,showBar:fp().bool,showNumberInValue:fp().bool,classes:fp().object,styles:fp().object,canLoadMore:fp().bool,max:fp().number};const rg=(0,b.memo)(tg);var ng=r(43627),ag=r.n(ng);function ig(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){og(e,t,r[t])}))}return e}function og(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const lg=(0,_.range)(2,10).reduce(((e,t)=>ig({},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)"}}})),{}),sg=(0,Rp.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":ig({fontSize:"10px",lineHeight:"11px",fontWeight:500,color:"rgba(255, 255, 255, 0.7)",marginTop:"4px"},lg,{"&:last-child":{color:"white"}}),"& li + li":{marginTop:"2px"}}}})));function cg(){return cg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},cg.apply(null,arguments)}const ug=e=>{let{pathToTitle:t,children:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["pathToTitle","children"]);const a=sg(),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(ag(),cg({title:i,disableFocusListener:!0,classes:{tooltip:a.tooltip}},n),r)};var pg=r(96091),dg=r.n(pg),mg=r(35635),fg=r.n(mg);const yg=(0,Rp.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 gg(){return gg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gg.apply(null,arguments)}const hg=(0,cd.T)(fg()),Eg=e=>{let{label:t,onDelete:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["label","onDelete"]);const a=yg();return v().createElement(dg(),gg({className:a.root,label:li().number(t),onDelete:r,variant:"outlined",classes:{root:a.root,outlined:a.outlined,deleteIcon:a.deleteIcon,label:a.label},deleteIcon:v().createElement(hg,{tooltipTitle:li().text("Clear")})},n))},bg=(0,Rp.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 vg(){return vg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vg.apply(null,arguments)}const Tg=({title:e="",chipLabel:t=0,onDelete:r,pathToTitle:n,onClick:a})=>{const i=bg(),o=Boolean(n&&n.length>2),l=o?ug:sd.Y,s=o?{pathToTitle:n}:{value:e};return v().createElement("div",{className:i.container,onClick:a},o&&v().createElement(ug,vg({placement:"bottom-start"},s),v().createElement("div",{className:i.parent},n[n.length-2])),v().createElement("div",{className:i.titleContainer},v().createElement(l,vg({placement:"bottom-start"},s),v().createElement("span",{className:i.title},e)),0!==t&&v().createElement("div",{className:i.chip},v().createElement(Eg,{label:t,onDelete:r}))))};function Og(){return Og=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Og.apply(null,arguments)}const Sg=(0,Rp.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}}))),xg=(0,cd.T)((e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",Og({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"})))))))})),Cg=({title:e,chipLabel:t,onDeleteChip:r,pathToTitle:n,onClose:a,children:i,isOpenByDefault:o=!0,isHighlighted:l=!1,isRecommended:s=!1})=>{const c=Sg(),[u,p]=(0,b.useState)(o),d=()=>{p(!u)};return v().createElement("div",{className:O()(c.facetContainer,{[c.openedFacetContainer]:u,[c.closedFacetContainer]:!u,[c.highlighted]:l}),"data-reltio-id":`search-facet-container-${e}`},v().createElement("div",{className:c.titleContainer},v().createElement(vd.k,{tooltipTitle:li().text("Remove"),icon:Sp(),onClick:a,className:c.iconButton,size:"XXS"}),s&&v().createElement(xg,{className:c.recommendedIcon,tooltipTitle:li().text("Recommended"),showForDisabled:!0}),v().createElement(Tg,{title:e,pathToTitle:n,chipLabel:t,onDelete:r,onClick:d}),v().createElement(zm,{onClick:d,isOpen:u,className:c.iconButton,size:"S",tooltipTitle:u?li().text("Collapse attribute"):li().text("Expand attribute"),tooltipPlacement:"bottom-end"})),u?i:null)},wg=(0,Rp.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"}}))),Ag=({config:e,data:t=[],filteredData:r,values:n=[],isHighlighted:a,isRecommended:i,onSearch:o=_.identity,onChange:l,onClose:s})=>{const c=wg();return v().createElement(Cg,{title:e.title,pathToTitle:e.pathToTitle,onClose:s,chipLabel:n.length,onDeleteChip:()=>l([]),isHighlighted:a,isRecommended:i},v().createElement(rg,{values:n,defaultOptions:t,filteredOptions:r,onChange:l,getSuggestions:o,isClearable:!1,showBar:!1,showNumberInValue:!0,classes:c,placeholder:li().text("All values"),canLoadMore:!(0,ja.tW)(e)}))};var Rg=r(32015),_g=r(15608),Ig=r.n(_g);const Ng=(0,Rp.Z)((e=>({root:{borderRadius:4,padding:"15px 0"},rail:{backgroundColor:(0,Rm.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,Rm.alpha)(e.palette.primary.main,.12)}`,"@media (hover: none)":{boxShadow:"none"}},"&$active":{boxShadow:`0px 0px 0px 9px ${(0,Rm.alpha)(e.palette.primary.main,.12)}`},"&::after":{left:-10,top:-10,right:-10,bottom:-10}},focusVisible:{},active:{},track:{borderRadius:4}}))),Pg=(0,Rp.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"}}))),Dg=({children:e,open:t,value:r})=>{const n=Pg();return v().createElement(ag(),{open:t,enterTouchDelay:0,placement:"top",title:r,classes:{tooltipPlacementTop:n.tooltipPlacementTop,tooltip:n.tooltip}},e)};function kg(){return kg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},kg.apply(null,arguments)}Dg.propTypes={children:fp().element.isRequired,open:fp().bool.isRequired,value:fp().string.isRequired};const Lg=e=>{let{min:t,max:r,range:n,onChange:a,onAfterChange:i,className:o}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["min","max","range","onChange","onAfterChange","className"]);const s=Ng();return v().createElement("div",{className:o},v().createElement(Ig(),kg({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:Dg},size:"small",component:"div"},l)))};Lg.propTypes={min:fp().oneOfType([fp().number,fp().string]).isRequired,max:fp().oneOfType([fp().number,fp().string]).isRequired,range:fp().array.isRequired,onChange:fp().func,onAfterChange:fp().func,className:fp().string};const Ug=Lg;var jg=r(18205),Fg=r(19406),Mg=r(55484),Vg=r(25556),Bg=r(3131),zg=r(27741),Hg=r(42400),Yg=r(11011);const Wg=(0,Rp.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"}}))),Gg=({payload:e,formatter:t,active:r})=>{const n=Wg();if(r){const{payload:{label:r},value:a}=e[0];return v().createElement("div",{className:n.tooltip},v().createElement("div",{className:n.number},t(a)),v().createElement("div",{className:n.value},r))}return null},qg=(0,Rp.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 Zg(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const $g=({data:e=[],range:t=[],domain:r,color:n=S.theme.palette.primary.main,tickFormatterX:a,tickFormatterY:i})=>{const o=qg(),[l,s]=(0,b.useState)(null),c=(e,r)=>(l===r?.2:0)+((({value:e})=>e[0]>=t[0]&&e[1]<=t[1])(e)?.6:.2),u=e.map(((e,t,r)=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Zg(e,t,r[t])}))}return e}({},e,{value:t<r.length-1?e.value[0]:e.value[1]}))),p=e=>{e.isTooltipActive?s(e.activeTooltipIndex):s(null)};return v().createElement(jg.h,null,v().createElement(Fg.v,{data:u,margin:{top:12,right:0,left:0,bottom:0},onMouseEnter:p,onMouseLeave:p,onMouseMove:p,className:o.barChart},v().createElement(Mg.q,{vertical:!1,stroke:"#f2f2f2"}),v().createElement(Vg.K,{dataKey:"value",interval:0,padding:{left:4,right:4},height:15,tickLine:!1,ticks:r,tick:e=>{const{x:t,y:r,index:n,payload:{value:i,offset:o}}=e;return v().createElement("text",{x:0===n?t-o:t+o,y:r+4,textAnchor:0===n?"start":"end"},`${a(i)}`)}}),v().createElement(Bg.B,{width:38,domain:[0,"auto"],axisLine:!1,tickLine:!1,tickSize:0,tickMargin:4,tickCount:6,tickFormatter:i}),v().createElement(zg.u,{cursor:{fill:"rgb(255,255,255)"},content:v().createElement(Gg,{formatter:i}),isAnimationActive:!1}),v().createElement(Hg.$,{dataKey:"number",isAnimationActive:!1},e.map(((e,t)=>v().createElement(Yg.b,{key:`cell-${t}`,fill:n,fillOpacity:c(e,t)}))))))},Kg="NumericRangeFacet-styles-numberEditorInputRoot--djW3k",Xg="NumericRangeFacet-styles-numberEditorRoot--DVXqx",Qg="NumericRangeFacet-styles-input--Nl2tx";function Jg(){return Jg=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Jg.apply(null,arguments)}class eh extends b.PureComponent{constructor(...e){super(...e),this.state={range:[],data:[],values:[],lowerBound:0,upperBound:0},this.handleOnChangeValue=e=>{if(!this.props.onChange)return;const{data:t,values:r}=this.props,{rangeService:n}=this.state,[a,i]=n.getBarDomain(t),o=n.adjustRange(e,a,i);0!==r.length&&n.equals(o[0],(0,_.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=(0,Ul.C)(a),l=(0,ni.Oz)(a),s=o.getRange(r,n);return{range:s,data:n,values:r,lowerBound:s.length>0?s[0].toString():0,upperBound:s.length>0?s[1].toString():0,NumMath:l,rangeService:o,isScaled:i,isFloating:(0,S.isFloatingType)(a),scale:n.length>0?o.calcScale(...o.getBarDomain(n)):{ratio:1,offset:0}}}return null}render(){const{config:e,data:t,isHighlighted:r,isRecommended:n,onClose:a,numberFormat:i}=this.props,{isScaled:o,scale:l,range:s,lowerBound:c,upperBound:u,rangeService:p,isFloating:d}=this.state,m=o?p.bigNumbersTickFormatterX(p.formatNumberForRangeFacet,l):p.formatNumberForRangeFacet,f=t.map((e=>({value:e.value.map(this.applyScale),label:e.value.map(p.formatNumberForRangeFacet).join(" - "),number:e.number}))),y=s.map((e=>+this.applyScale(e))),[g,h]=p.getBarDomain(t).map((e=>this.applyScale(e)));return v().createElement(Cg,{title:e.title,pathToTitle:e.pathToTitle,onClose:a,isHighlighted:r,isRecommended:n},v().createElement("div",{className:"NumericRangeFacet-styles-data--kL9q5"},f.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($g,{data:f,range:y,tickFormatterX:m,tickFormatterY:p.formatNumberForRangeFacet,domain:[g,h]})),v().createElement(Ug,{min:g,max:h,range:y,onAfterChange:this.onRevertedChange,onChange:this.onChangeRange,className:"NumericRangeFacet-styles-slider--XbmKe",valueLabelFormat:m,step:d?(h-g)/200:1}),v().createElement("div",{className:"NumericRangeFacet-styles-inputsContainer--mU0_m"},v().createElement(Rg.c,{value:c,onChange:this.onLowerBoundChanged,onFocus:this.onFocus,integer:!d,format:i,variant:"filled",classes:{root:Xg},InputProps:{classes:{root:Kg,input:Qg}}}),v().createElement(Rg.c,{value:u,onChange:this.onUpperBoundChanged,onFocus:this.onFocus,integer:!d,format:i,variant:"filled",classes:{root:Xg},InputProps:{classes:{root:Kg,input:Qg}}}))):v().createElement(sy.K,{variant:"noData"})))}}eh.propTypes={data:fp().array,values:fp().array,config:fp().object,isHighlighted:fp().bool,isRecommended:fp().bool,onClose:fp().func,onChange:fp().func,numberFormat:fp().shape({decimalSeparator:fp().string,thousandSeparator:fp().string,prefix:fp().string,suffix:fp().string,decimalScale:fp().number})},eh.defaultProps={config:{},data:[],values:[]};const th=(0,yp.connect)((e=>({numberFormat:k().selectors.getUiNumberFormat(e)})))((e=>{const t=t=>{let{config:r,values:n,data:a,onChange:i,numberFormat:o}=t,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(t,["config","values","data","onChange","numberFormat"]);const s=(0,yp.useSelector)(k().selectors.getAttributesPresentation),{strategy:c}=(0,S.getNumberFormat)((0,S.getAttrDataTypeDefinition)(r.attrType),s,S.intl.getLocale()),u=(0,b.useMemo)((()=>null==a?void 0:a.map((0,_.evolve)({value:(0,_.map)((0,S.applyPresentationStrategyToValue)(c))}))),[a,c]),p=(0,b.useMemo)((()=>null==n?void 0:n.map((0,S.mapFilterValue)((0,S.applyPresentationStrategyToValue)(c)))),[n,c]),d=(0,b.useCallback)((e=>{const t=null==e?void 0:e.map((0,S.mapFilterValue)((0,S.revertPresentationStrategyForValue)(c)));i(t)}),[c,i]);return v().createElement(e,Jg({data:u,values:p,onChange:d,config:r,numberFormat:o&&(0,_.omit)(["strategy",o])},l))};return t.displayName="WithCustomizedData",t})(eh));var rh=r(21669);const nh=(0,Rp.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 ah(){return ah=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ah.apply(null,arguments)}const ih=(e,t)=>(0,_.pathOr)(null,[t],e),oh=e=>e&&new Date(e),lh=e=>e&&e.getTime(),sh=({values:e,minDate:t,maxDate:r,onChange:n})=>{const[a,i]=(0,b.useState)(null),[o,l]=(0,b.useState)(null),s=(0,b.useRef)((0,Ge.x0)()),c=(0,b.useRef)((0,Ge.x0)()),u=nh();v().useEffect((()=>{i(ih(e,0)),l(ih(e,1))}),[e]);const p=(e,t)=>{(0,_.isNil)(e)||(0,_.isNil)(t)||n(e>t?[[t,e]]:[[e,t]])},d={minDate:oh(t),maxDate:oh(r)};return v().createElement("div",{className:u.container},v().createElement(rh.Q,ah({label:li().text("Start Date"),value:oh(a),onChange:e=>{const t=lh(e);i(t),p(t,o)},slotProps:{textField:{id:s.current,className:u.dateEditor}}},d)),v().createElement(rh.Q,ah({label:li().text("End Date"),value:oh(o),onChange:e=>{const t=lh(e);l(t),p(a,t)},slotProps:{textField:{id:c.current,className:u.dateEditor},popper:{placement:"bottom-end"}}},d)))};function ch(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const uh=e=>t=>e===S.DataTypes.TYPE_DATE?S.utils.dates.toLocalDate(t).getTime():t,ph=(0,Rp.Z)({barChartContainer:{position:"relative",height:"190px",paddingTop:"6px",width:"100%",overflow:"hidden"},dateRangeChooserWrapper:{display:"flex",flexDirection:"column",alignItems:"center",marginTop:"12px",width:"100%"}}),dh=(0,Ul.C)(),mh=({data:e=[],values:t=[],config:r,onChange:n,isHighlighted:a,isRecommended:i,onClose:o})=>{const l=ph(),s=(0,_.path)(["attrType","type"],r),c=(0,b.useCallback)((r=>{const a=r.map((0,S.mapFilterValue)((i=s,e=>i===S.DataTypes.TYPE_DATE?S.utils.dates.toUtcDate(e).getTime():e)));var i;if(!(0,_.equals)(t,a)){const[t,r]=dh.getBarDomain(e),i=s===S.DataTypes.TYPE_DATE,o=a.map((e=>[S.utils.dates.getStartOfDay(e[0],i),S.utils.dates.getEndOfDay(e[1],i)])),l=dh.getRange(o,e);n([l.length?l:[t,r]])}}),[e,n,s,t]),u=(0,b.useMemo)((()=>{return e.map((t=s,e=>{if(Array.isArray(e.value)){const r=e.value.map(uh(t));return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){ch(e,t,r[t])}))}return e}({},e,{value:r,label:r.map(S.formatDate).join(" - ")})}}));var t}),[e,s]),[p,d]=(0,b.useMemo)((()=>[dh.getBarDomain(u),dh.getRange(t.map((0,S.mapFilterValue)(uh(s))),u)]),[u,s,t]);return v().createElement(Cg,{title:r.title,pathToTitle:r.pathToTitle,onClose:o,isHighlighted:a,isRecommended:i},e.length>0?v().createElement(v().Fragment,null,v().createElement("div",{className:l.barChartContainer},v().createElement($g,{data:u,range:d,tickFormatterX:S.formatDate,tickFormatterY:dh.formatNumberForRangeFacet,domain:p})),v().createElement("div",{className:l.dateRangeChooserWrapper},v().createElement(sh,{values:d,onChange:c}))):v().createElement(sy.K,{variant:"noData"}))};function fh(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class yh{static getWidget(e){switch(e.type){case S.FACET_TYPES.ENTITY_TYPE_FACET:return vy;case S.FACET_TYPES.WITH_DROPDOWN_CHECKBOXES_FACET:return Ag;case S.FACET_TYPES.NUMERIC_RANGE_FACET:return th;case S.FACET_TYPES.DATE_RANGE_FACET:return mh;default:return null}}static build(e){const t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){fh(e,t,r[t])}))}return e}({},yh.getDefaultConfig(),e),r=yh.getWidget(t);return r?(e=>{const r=((e,t)=>{const r=r=>{let{dispatch:n}=r,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(r,["dispatch"]);return v().createElement(e,ty({config:t,onChange:(i=t.fieldName,e=>{n(Ja(i,e))}),onClose:t.showDeleteButton?(e=>()=>{n(ri({fieldNamesToDelete:[e]}))})(t.fieldName):()=>{},onSearch:(e=>({value:t,pageNumber:r,currentOptions:a})=>{n((({facetFieldName:e,value:t,debounceTime:r=0,pageNumber:n=1,currentOptions:a})=>({type:L.k.FILTER_FACET_DATA,payload:{facetFieldName:e,value:t,debounceTime:r,pageNumber:n,currentOptions:a}}))({facetFieldName:e,value:t,debounceTime:250,pageNumber:r,currentOptions:a}))})(t.fieldName)},a));var i};return r.propTypes={dispatch:fp().func,isRecommended:fp().bool},r})(e,t);return yh.connectData(r,t)})(r):null}}yh.getDefaultConfig=()=>({autofocus:!1,showDeleteButton:!0}),yh.connectData=(e,t)=>(0,yp.connect)((e=>({data:(0,P.X7)(t,e),values:(0,P.N1)(t,e),filteredData:(0,P.VP)(t,e),isHighlighted:(0,P.$t)(t.fieldName,e),isRecommended:(0,P.TH)(t.fieldName,e)})))(e);var gh=r(64927),hh=r.n(gh),Eh=r(73707),bh=r.n(Eh),vh=r(93463),Th=r.n(vh);const Oh=(0,Rp.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 Sh=r(44244);const xh=({tenantObject:e,isDataTenant:t,className:r})=>{const n=(({tenantObject:e,isDataTenant:t})=>{const r=(0,Sh._)(),[n,a]=(0,b.useState)(0),i=(0,yp.useSelector)(k().selectors.getGlobalSearchRequestOptions),o=t?e:null,l=(0,yp.useSelector)((e=>(0,ai.E2)(e,[],o))),s=JSON.stringify((0,Ua.Vg)(l,[],i)),c=(0,yp.useSelector)(k().selectors.getDtssPath),u=(0,yp.useSelector)(k().selectors.getTenant);return(0,b.useEffect)((()=>{r((0,Ua.Es)({url:Z.jS,options:{method:"POST",body:s},customerTenant:u,dataTenant:(0,_.prop)("id",o),dtssPath:c})).then((({total:e})=>{a(e)})).catch((e=>{console.warn(e)}))}),[o,u,c,s]),n})({tenantObject:e,isDataTenant:t});return v().createElement("div",{className:r},(0,ni.k7)(n))};xh.propTypes={className:fp().string,tenantObject:fp().object.isRequired,isDataTenant:fp().bool};const Ch=xh;function wh(){return wh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},wh.apply(null,arguments)}const Ah={changeCurrentTenant:({tenantObject:e,isDataTenant:t})=>({type:U.Z.CHANGE_CURRENT_TENANT,payload:{tenantObject:e,isDataTenant:t}})},Rh=(0,yp.connect)((e=>({dataTenants:k().selectors.getDataTenants(e),customerTenantObject:k().selectors.getTenantObject(e),currentTenant:(0,ai.RO)(e),openAdvancedSearch:(0,Ri.IJ)(e)})),Ah)((({customerTenantObject:e,currentTenant:t,dataTenants:r,changeCurrentTenant:n,openAdvancedSearch:a})=>{const i=Oh(),o=(0,_.pipe)((0,_.map)((({id:e,label:t})=>({value:e,label:t}))),(0,_.prepend)({value:e.id,label:e.name}))(r),l=t=>{const n=t!==e.id;return{isDataTenant:n,tenantObject:n?r.find((0,_.propEq)("id",t)):e}},s=t||e.id;return v().createElement("div",{className:i.tenantFacet},v().createElement(kf,{title:li().text("Tenants"),hasCollapseButton:!1}),v().createElement(bh(),{className:i.radioGroup,value:s,onChange:(0,_.pipe)(wp.NA,l,n)},o.map((({value:e,label:t})=>v().createElement("div",{className:i.tenantContainer,key:e},v().createElement(Th(),{classes:{root:i.radioLabelRoot,label:i.radioLabel},value:e,label:t||e,control:v().createElement(hh(),{className:i.radioButton,color:"primary"})}),!a&&v().createElement(Ch,wh({className:i.total},l(e))))))))})),_h=(0,Rp.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}}),Ih=({variant:e="facetsPanel",searchOptions:t={},dispatch:r})=>{const{root:n,labelRoot:a,checkboxRoot:i,checkboxRootQueryGroups:o}=_h(),l=t.searchByOv,s=(0,b.useCallback)((()=>{r(D.search.actions.updateSearchOptions({searchByOv:!l,ovOnly:!l}))}),[l,r]),c=li().text("Search by OV only");return v().createElement("div",{className:n,onClick:s},v().createElement(qp(),{classes:{root:O()(i,{[o]:"queryGroups"===e})},checked:l,color:"primary"}),v().createElement(sd.Y,{value:c},v().createElement(Tf(),{variant:"body2",classes:{root:a}},c)))};Ih.propTypes={searchOptions:fp().shape({searchByOv:fp().bool,ovOnly:fp().bool}),variant:fp().oneOf(["facetsPanel","queryGroups"]),dispatch:fp().func};const Nh=(0,yp.connect)((e=>({searchOptions:k().selectors.getSearchOptions(e)})))(Ih),Ph=(0,Rp.Z)({root:{display:"flex",flexDirection:"column",overflow:"auto",height:"100%"}});function Dh(){return Dh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Dh.apply(null,arguments)}const kh=(0,S.memoizeWith)((e=>e.fieldName),yh.build),Lh=({group:e,configs:t})=>v().createElement(ey,Dh({},e,{key:e.title}),(e=>e.map((e=>({Facet:kh(e),id:e.fieldName}))).filter((({Facet:e})=>e)).map((({Facet:e,id:t})=>v().createElement(e,{key:t}))))(t)),Uh=(0,yp.connect)((e=>{var t;const r=k().selectors.getDataTenants(e);return{metadata:k().selectors.getMetadata(e),facetsConfigs:(0,P.Mp)(e),uiConfigShowSearchByOv:null!==(t=k().selectors.getShowSearchByOv(e))&&void 0!==t?t:(0,Ri.cC)(e),showTenantFacet:r&&r.length>0,tenant:k().selectors.getTenant(e)}}))((({facetsConfigs:e=[],metadata:t,onScroll:r,uiConfigShowSearchByOv:n,showTenantFacet:a})=>{const{root:i}=Ph(),o=(0,b.useRef)(null),l=(0,b.useCallback)((e=>{r(o.current.scrollTop,e)}),[r]),s=((e,t)=>{const[r,n]=(0,_.partition)(S.isTypeFacet,t),a=[{group:{title:li().text("Entity types"),hasCollapseButton:!1},configs:r},{group:{title:li().text("Attributes"),hasCollapseButton:!1,hasSearchAttributesField:!0},configs:n}];return Pf(a)})(0,e),c=(0,_.head)(s),u=(0,_.tail)(s),p=o.current,d=(0,b.useMemo)((()=>({element:p,priority:["top","bottom"]})),[p]);return v().createElement("div",{ref:o,className:i,onScroll:l},v().createElement(If.p.Provider,{value:d},n&&v().createElement(Nh,null),a&&v().createElement(v().Fragment,null,v().createElement(Rh,null),v().createElement(_f(),null)),c&&Lh(c),v().createElement(_f(),null),u.map(((e,t)=>v().createElement(Lh,Dh({},e,{key:t}))))))})),jh=({children:e,className:t})=>v().createElement("div",{className:O()("MainContent-styles-mainContent--Ha5me",t)},e);jh.propTypes={children:fp().node,className:fp().string};const Fh=jh;var Mh=r(33788);const Vh=(0,Rp.Z)({container:{backgroundColor:"#fff",opacity:.37,position:"fixed",width:"100%",height:"100%",top:0,left:0,display:"flex",justifyContent:"center",alignItems:"center"}}),Bh=()=>{const e=(0,yp.useSelector)(Ri.Kv),{container:t}=Vh();return e?v().createElement("div",{className:t},v().createElement(Mh.Z,{size:160})):null};var zh=r(54596),Hh=r.n(zh),Yh=r(49233),Wh=r.n(Yh),Gh=r(35206),qh=r.n(Gh),Zh=r(81733),$h=r.n(Zh),Kh=r(68290),Xh=r.n(Kh);const Qh=(0,Rp.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"},[Z.GT.error]:{backgroundColor:e.palette.error.dark}})));function Jh(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const eE=()=>{const e=(0,yp.useDispatch)(),t=(0,yp.useSelector)(Ri.v6),r=(0,yp.useSelector)(k().selectors.getAutoCloseInterval),n=t&&t.payload.autoHideDuration||r&&1e3*r||5e3,a=Qh(),i=(0,b.useRef)(null),o=(0,b.useCallback)((()=>{e(Ti())}),[e]);t&&(i.current=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Jh(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===Z.GT.error?v().createElement(Wh(),{key:"close","aria-label":"Close",color:"inherit",className:a.close,onClick:d,size:"large"},v().createElement(Sp(),null)):u?v().createElement(qh(),{color:"primary",size:"small",onClick:d},u.actionLabel):null),[a,l,u,d]);return v().createElement($h(),{container:document.body},v().createElement(Hh(),{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===Z.GT.error&&v().createElement(Xh(),{className:a.icon}),c),classes:{anchorOriginBottomCenter:a.anchorSnackBar},action:m}))},tE=(0,Rp.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 rE=r(95641);const nE=(0,Rp.Z)((()=>({container:{position:"relative"},panel:{position:"relative"},horizontal:{},vertical:{},disabled:{},resizer:{zIndex:1,boxSizing:"border-box",backgroundClip:"padding-box","&$disabled":{cursor:"initial",height:0,margin:0},"&$horizontal":{height:"11px",backgroundImage:"linear-gradient(rgba(0,0,0,0.33), rgba(0,0,0,0.33))",backgroundRepeat:"no-repeat",backgroundSize:"100% 1px",backgroundPosition:"top",width:"100%",marginBottom:"-10px","&$disabled":{background:"transparent"},"&:not($disabled):hover":{cursor:"ns-resize",backgroundImage:"linear-gradient(rgba(0, 114, 206, 0), rgba(0, 114, 206, 0.35), rgba(0, 114, 206, 1))",backgroundSize:"100% 3px"}},"&$vertical":{width:"11px",backgroundImage:"linear-gradient(rgba(0,0,0,0.33), rgba(0,0,0,0.33))",backgroundRepeat:"no-repeat",backgroundSize:"1px 100%",backgroundPosition:"left",height:"100%",marginRight:"-10px","&$disabled":{background:"transparent"},"&:not($disabled):hover":{cursor:"ew-resize",backgroundImage:"linear-gradient(to left, rgba(0, 114, 206, 0.35), rgba(0, 114, 206, 1), rgba(0, 114, 206, 0.35))",backgroundSize:"3px 100%"}}}})));function 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.push.apply(n,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=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const oE=e=>"horizontal"===e,lE=(e,t)=>e.toFixed(2)===t.toFixed(2),sE=({className:e,children:t,orientation:r="vertical",primary:n="first",size:a,minSize:i,maxSize:o,allowResize:l,debounceInterval:s=250,onChange:c})=>{const u=nE(),p=(0,Rm.useTheme)(),d=(0,b.useRef)(),[m,f]=(0,b.useState)(null),[y,g]=(0,b.useState)(0),[h,E]=(0,b.useState)(0),[T,x]=(0,b.useState)(!0),C=(0,b.useCallback)((()=>x(!0)),[]),w=(0,b.useCallback)((()=>x(!1)),[]),A=(0,b.useCallback)((()=>oE(r)?null==m?void 0:m.clientHeight:null==m?void 0:m.clientWidth),[m,r]);"number"==typeof a&&a<0&&(a=(A()||0)+a);const R=(0,b.useCallback)((e=>"string"==typeof e&&e.endsWith("%")?+e.replace("%",""):("string"==typeof e&&e.endsWith("px")&&(e=e.replace("px","")),isNaN(+e)?null:+e/A()*100)),[A]),_=(0,b.useCallback)(((e,t)=>0===e||100===e?0:R(t)||0),[R]),I=(0,b.useCallback)((()=>{if(m&&d.current){const e=R(a);null==e||isNaN(e)||(E(_(e,o)),g(_(e,i)),d.current.resize(e))}}),[R,_,i,o,a,m]);(0,b.useEffect)((()=>{I()}),[I,h,y]);const N=(0,b.useCallback)((0,S.debounce)((e=>{if(void 0===e)return;const t=A();c({percentageSize:e+"%",isMaxSize:lE(e,+h>0?h:100+h),isMinSize:lE(e,y),size:Math.round(e*t/100)})}),s),[c,h,y,A]),P=(0,b.useCallback)((e=>{e?(N(),w()):(N(d.current.getSize()),C())}),[w,C,N]),D=(0,b.useMemo)((()=>({transition:p.transitions.create("flex",{easing:p.transitions.easing.sharp,duration:p.transitions.duration.leavingScreen})})),[p]),k=aE({className:u.panel,minSize:y},h>0?{maxSize:h}:{},{ref:d,style:T?D:void 0}),L=aE({className:u.panel,style:T?D:void 0},h<0?{minSize:-h}:{});return v().createElement("div",{ref:f,className:O()(u.container,e)},v().createElement(Vp.Z,{handleHeight:oE(r),handleWidth:!oE(r),onResize:I,refreshMode:"debounce",refreshRate:50}),v().createElement(rE.eh,{direction:oE(r)?"vertical":"horizontal"},v().createElement(rE.s_,"first"===n?k:L,t[0]),v().createElement(rE.OT,{className:O()(u.resizer,u[r],{[u.disabled]:!l}),disabled:!l,hitAreaMargins:{coarse:0,fine:0},onDragging:P}),v().createElement(rE.s_,"second"===n?k:L,t[1])))};sE.displayName="ResizablePanes";const cE=(0,Rp.Z)({"entityType-overflow":{textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},"entityType-small":{padding:"1px 4px",fontSize:"10px",lineHeight:"normal",marginRight:"12px",borderRadius:"2px",flexShrink:0},"entityType-medium":{padding:"2px 7px",borderRadius:"2px",fontSize:"13px",fontWeight:500,lineHeight:"16px",marginRight:"16px",flexShrink:0}}),uE=({entity:e,className:t,size:r="small"})=>{const n=cE(),a=(0,w.AH)(),i=(0,S.getEntityType)(a,e.type),o=(i?(0,S.getPropWithInheritance)(a,i,"typeColor"):null)||S.theme.palette.primary.main,l=(0,S.getEntityTypeLabel)(a,e);return v().createElement(sd.Y,{value:l,placement:"top"},v().createElement(Tf(),{style:{backgroundColor:o,color:S.utils.Colors.getColor(o)?"#FFFFFF":"#212121"},className:O()(n[`entityType-${r}`],n["entityType-overflow"],t),component:"div"},l))},pE=e=>e&&e.scrollIntoView({block:"end",behavior:"smooth"}),dE=e=>{e&&clearTimeout(e)},mE=(e,t)=>{if(e&&t){const r=e.offsetTop,n=e.offsetTop+e.clientHeight,{clientHeight:a,scrollTop:i}=t;return r>=0&&n>i&&n<i+a}};var fE=r(600);const yE=(0,Rp.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,Rm.alpha)(e.palette.primary.main,.12),"&:hover":{background:(0,Rm.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"}}))),gE=({entities:e,entityToHighlight:t,selectedEntityUri:r,onEntityClick:n,onEntityHover:a,entitiesImportStatus:i,entityButtonsRenderer:o})=>{const l=yE(),s=(0,b.useRef)(null),c=(0,b.useRef)(null),u=(0,w.AH)();return(0,fE.D)((()=>{if(t){var e;const n=null===(e=s.current)||void 0===e?void 0:e.querySelectorAll(`[data-entity-uri='${t}']`);if(dE(c.current),(null==n?void 0:n.length)>0){var r;const e=null===(r=s.current)||void 0===r?void 0:r.parentElement;mE(n[0],e)||(pE(n[0]),c.current=setTimeout((()=>{mE(n[0],e)||pE(n[0])}),1e3))}}return()=>{dE(c.current)}}),[t]),v().createElement("div",{ref:s},(e||[]).map((e=>{const s=(0,S.getLabel)(e.label),c=e.secondaryLabel,p=(0,S.getBusinessCardAttributesText)(u,e),d=(0,S.isActiveObject)(e),m=e.uri,f=(0,S.getEntityUriForLink)(e),y=(0,_.prop)(m,i);return v().createElement("div",{key:m,className:O()(l.item,{[l.clickable]:!!n,[l.selected]:m===r,[l.highlighted]:m===t,[l.inactive]:!d,[l.justImported]:y===dm.Eh.Success}),onClick:n?()=>n(m):void 0,onMouseEnter:a?()=>a(m):void 0,onMouseLeave:a?()=>a(null):void 0,"data-entity-uri":m},v().createElement(A,{entity:e,avatarClassName:l.avatar,imageClassName:l.image}),v().createElement("div",{className:l.info},v().createElement("div",null,v().createElement(Bd,{value:f,className:l.label},s),c&&v().createElement("span",{className:l.secondaryLabel},c," "),p&&v().createElement("span",{className:l.businessCard},p)),v().createElement("div",{className:l.secondRow},v().createElement(uE,{entity:e}),v().createElement("div",null,(0,S.getEntityId)(e)))),o&&o(e))})))};var hE=r(92255);function EE(){return EE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},EE.apply(null,arguments)}function bE(){return bE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},bE.apply(null,arguments)}function vE(){return vE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vE.apply(null,arguments)}function TE(){return TE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},TE.apply(null,arguments)}const OE=(0,Rp.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 SE(){return SE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},SE.apply(null,arguments)}let xE=function(e){return e.full="full",e.embedded="embedded",e.small="small",e}({});const CE={SEARCH_RESULTS:e=>v().createElement("svg",EE({width:256,height:256,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","data-reltio-id":"SvgEmptySearchResults"},e),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",bE({width:256,height:256,viewBox:"0 0 256 256",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgSelectAttributes"},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",vE({width:256,height:256,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","data-reltio-id":"SvgNoData"},e),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",TE({width:88,height:88,viewBox:"0 0 88 88",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgError"},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",SE({width:256,height:256,viewBox:"0 0 256 256",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgEmptyLoading"},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}))))},wE=({variant:e=xE.full,LogoRenderer:t=CE.SEARCH_RESULTS,text:r,secondaryText:n,buttonTitle:a,onClick:i=_.identity,access:o})=>{const l=OE(),s=o&&a;return v().createElement("div",{className:O()(l.root,l[`root_${e}`])},v().createElement(t,{className:l[`${e}`]}),v().createElement("div",{className:l.textBox},v().createElement(Tf(),{variant:"h5",classes:{h5:l.text}},r),n&&v().createElement(Tf(),{variant:"subtitle1",classes:{subtitle1:l.secondaryText}},n)),s&&v().createElement(qh(),{className:l.button,variant:"contained",color:"primary",onClick:i},a))};var AE=r(15503);class RE 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 _E=(0,Rp.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 IE=r(46089),NE=r.n(IE);const PE=(0,Rp.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,Rm.alpha)(e.palette.primary.main,.12),fill:e.palette.primary.main,color:e.palette.primary.main,"&:hover":{backgroundColor:(0,Rm.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:{}}))),DE=(0,cd.T)(qh()),kE=({className:e,classes:t={},modes:r=[],modeId:n,onChange:a})=>{const i=PE();return v().createElement(NE(),{className:e},r.map((({id:e,title:r,tooltipTitle:o,Icon:l,disabled:s})=>{return v().createElement(DE,{disabled:s,showForDisabled:s&&!!o,key:String(e),className:O()(i.button,{[i.current]:n===e},t.button),tooltipTitle:o,onClick:(c=e,()=>a(c)),"data-reltio-id":`reltio-search-mode-${e}`},l&&v().createElement(l,{className:i.icon}),r&&v().createElement("div",{className:i.title},r));var c})))},LE=(0,Rp.Z)((()=>({button:{"&.MuiButtonGroup-grouped":{minWidth:"90px",padding:"8px 12px"}}})));function UE(){return UE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},UE.apply(null,arguments)}const jE=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",UE({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 FE(){return FE=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},FE.apply(null,arguments)}const ME=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",FE({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"})))))},VE=e=>{switch(e){case Z.ll.TABLE:return jE;case Z.ll.LIST:return ME;default:return Xh()}},BE=[{id:Z.ll.TABLE,tooltipTitle:li().text("Table view"),title:li().text("Table"),Icon:VE(Z.ll.TABLE)},{id:Z.ll.LIST,tooltipTitle:li().text("List view"),title:li().text("List"),Icon:VE(Z.ll.LIST)}],zE=({className:e})=>{const t=LE(),r=(0,yp.useDispatch)(),n=(0,yp.useSelector)(Ri.XM);return v().createElement(kE,{className:e,classes:{button:t.button},modes:BE,modeId:n,onChange:e=>{n!==e&&r((e=>({type:Ae,payload:e}))(e))}})};zE.propTypes={className:fp().string};const HE=zE;var YE=r(81085),WE=r.n(YE),GE=r(48139),qE=r.n(GE);const ZE="DATA_TENANTS_UPDATED",$E=e=>t=>({type:e,payload:t}),KE=($E(ZE),(e=null,t)=>t.type===ZE?t.payload||null:e),XE="TENANTS_UPDATED",QE=($E(XE),(e=null,t)=>t.type===XE?t.payload||null:e);let JE=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 eb(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const tb={},rb=(0,_.pipe)(S.normalizeMetadata,S.parseMetadata,S.localizeMetadata),nb=(0,_.map)(S.localizeMetadata),ab=(e=tb,t)=>{switch(t.type){case"METADATA_LOADED":{const{tenant:r,metadata:n}=t.payload;return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){eb(e,t,r[t])}))}return e}({},e,{[r]:rb(n)})}case JE.LOCALIZATION_LOADED:return nb(e);default:return e}};let ib=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.RUN_AUTHORING_TASK_ACTION="RUN_AUTHORING_TASK_ACTION",e}({});const ob=$E(ib.ADD_ATTRIBUTES),lb=$E(ib.ADD_DEFAULT_VALUES),sb=$E(ib.MODIFY_ATTRIBUTE),cb=$E(ib.REMOVE_ATTRIBUTE),ub=$E(ib.ADD_NEXT_PAGE_ATTRIBUTE_VALUES),pb=$E(ib.PROCESS_NEXT_PAGE_ATTRIBUTE_VALUES),db=$E(ib.REQUEST_NEXT_PAGE_ATTRIBUTE_VALUES),mb=$E(ib.SAVE_PROFILE),fb=$E(ib.RUN_AUTHORING_TASK_ACTION),yb=$E(ib.SAVE_DRAFT),gb=$E(ib.PROFILE_SAVED),hb=$E(ib.VALIDATE_PROFILE);let Eb=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 bb=$E(Eb.DEPENDENT_LOOKUPS_STRUCTURE_SET),vb=$E(Eb.DEPENDENT_LOOKUPS_INITED_TYPE_URIS_ADDED),Tb=$E(Eb.DEPENDENT_LOOKUPS_EDITORS_BLOCKED),Ob=$E(Eb.DEPENDENT_LOOKUPS_EDITOR_TOUCHED);let Sb=function(e){return e.MODE_UPDATED="MODE_UPDATED",e.MODE_EDITING_CANCELED="MODE_EDITING_CANCELED",e.MODE_UPDATE_REQUESTED="MODE_UPDATE_REQUESTED",e}({});function xb(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Cb(e,t,r[t])}))}return e}function Cb(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const wb={structure:{},editors:{},initedTypeUris:[]},Ab="SEARCH_RESULTS_SET",Rb="KEYWORD_UPDATED",_b="UPDATE_STATE",Ib="ACTIVITY_FILTER_UPDATED",Nb="GLOBAL_FILTER_UPDATED",Pb="SEARCH_OPTIONS_UPDATED",Db="SET_SEARCH_OPTIONS_CONFIG",kb="SET_SEARCH_PROVIDER_DATA",Lb="SET_SEARCH_NAVIGATION_DATA",Ub="UPDATE_SEARCH_NAVIGATION_DATA_FIELDS",jb=$E(Ab),Fb=$E(Rb),Mb=$E(_b),Vb=$E("SAVE_STATE"),Bb=$E(Ib),zb=$E(Nb),Hb=$E(Pb),Yb=$E(Db),Wb=$E(kb),Gb=$E(Lb),qb=$E(Ub),Zb=$E("UPDATE_SEARCH_NAVIGATION_DATA_ON_MERGE"),$b=(0,_.path)(["globalFilter","savedSearchesUris"]),Kb="searchNavigation";function*Xb(){const e=yield(0,La.Ys)(lI.selectors.getSearchNavigationData),t=yield(0,La.Ys)(lI.selectors.getSearchProviderData);sessionStorage.setItem(Kb,JSON.stringify({searchNavigationData:e,searchProviderData:t}))}function*Qb(){let e;try{e=JSON.parse(sessionStorage.getItem(Kb))||{}}catch(t){e={}}const{searchNavigationData:t,searchProviderData:r}=e;t&&r&&(yield(0,La.gz)(Wb(r)),yield(0,La.gz)(Gb(t)))}const Jb=[function*(){yield(0,La.Fm)([Lb,Ub,JE.OPEN_ENTITY],Xb)},function*(){yield(0,La.RE)(Qb)}];function ev(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){tv(e,t,r[t])}))}return e}function tv(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const rv={searchResults:[],keyword:null,searchOptions:{searchByOv:!1,ovOnly:!1},activityFilter:"active",globalFilter:{query:null,savedSearchesUris:[],isMuted:!0},searchProviderData:null,searchNavigationData:null},nv=(e=rv,t)=>{switch(t.type){case Ab:return ev({},e,{searchResults:t.payload});case Rb:{const r=(0,_.pick)(["value","isRawFilter"],t.payload||{});return ev({},e,{keyword:(0,_.isEmpty)(r)?null:r})}case _b:return ev({},rv,{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 Ib:return ev({},e,{activityFilter:t.payload});case Nb:return ev({},e,{globalFilter:(0,S.isEmptyValue)(t.payload)?rv.globalFilter:t.payload});case Pb:return ev({},e,{searchOptions:ev({},e.searchOptions,t.payload)});case Db:{const r=!!t.payload.showSearchByOv;return ev({},e,{searchOptions:{searchByOv:r,ovOnly:r}})}case kb:return ev({},e,{searchProviderData:t.payload});case Lb:return ev({},e,{searchNavigationData:t.payload});case Ub:return ev({},e,{searchNavigationData:ev({},e.searchNavigationData,t.payload)});case JE.OPEN_ENTITY:{var r;const n=(0,S.removeDtssPrefixFromEntityUri)(t.payload.uri);return"navigation"===t.payload.source||n===(null===(r=e.searchNavigationData)||void 0===r?void 0:r.uri)?e:ev({},e,{searchNavigationData:null})}default:return e}},av=({uri:e,source:t=null,screen:r="profile"})=>({type:JE.OPEN_ENTITY,payload:{uri:e,source:t,screen:r}}),iv=({entity:e})=>({type:JE.NEW_ENTITY_SHOWN,payload:{entity:e}}),ov=$E(JE.ENTITY_DELETION_FINISHED),lv=$E(JE.OPEN_PERSPECTIVE),sv=e=>({type:JE.SHOW_NOTIFICATION,payload:e}),cv=e=>({type:JE.CLOSE_NOTIFICATION,payload:e}),uv=$E(JE.CLEAR_NOTIFICATIONS),pv=$E(JE.PATHS_SET),dv=$E(JE.UI_PATH_SET),mv=$E(JE.UI_CONFIG_LOADED),fv=$E(JE.NEW_UI_CONFIG_LOADED),yv=$E(JE.LOCALE_ATTRIBUTE_PRESENTATION_LOADED),gv=$E(JE.AUTOCLOSE_INTERVAL_LOADED),hv=$E(JE.SET_PREFER_REACT),Ev=$E(JE.NUMBER_FORMAT_UPDATED),bv=(e,t,r)=>({type:JE.OPEN_CONSOLE_APP,payload:{name:e,path:t,query:r}}),vv=$E(JE.OPEN_APP_FROM_CHOCOLATE_BAR),Tv=$E(JE.OPEN_GRAPH),Ov=$E(JE.LOCALIZATION_LOADED),Sv=$E(JE.DATE_MASK_UPDATED),xv=$E(JE.DATE_TIME_MASK_UPDATED),Cv=e=>({type:JE.OPEN_SEARCH,payload:"searchState"in e?e:{searchState:e}}),wv=e=>({type:JE.OPEN_DASHBOARD,payload:e}),Av=$E(JE.OPEN_HISTORY_EVENT),Rv=$E(JE.OPEN_NEW_ENTITY_WITH_AUTHORING),_v=$E(JE.OPEN_PREVIOUS_PAGE),Iv=$E(JE.NAVIGATE),Nv=$E(JE.KEYS_SET),Pv=$E(JE.OPEN_PIVOTING_PERSPECTIVE),Dv=$E(JE.ERROR_SET),kv=$E(JE.DOCUMENTATION_SET),Lv=$E(JE.ADD_DASHBOARD_EXTERNAL_VIEW),Uv=$E(JE.SET_USE_SHARED_PREFERENCES);function jv(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Fv=(0,_.path)(["paths","imagePath"]),Mv=(0,_.path)(["paths","exportPath"]),Vv=(0,_.path)(["paths","apiPath"]),Bv=(0,_.path)(["paths","uiPath"]),zv=(0,_.path)(["paths","reltioPath"]),Hv=(0,_.path)(["paths","dtssPath"]),Yv=(0,_.path)(["paths","exportDQPath"]),Wv=(0,_.either)((0,_.path)(["newConfig","properties","workflow","path"]),(0,_.path)(["paths","workflowPath"])),Gv=(0,_.prop)("paths"),qv=(0,_.path)(["paths","workflowEnvironmentURL"]),Zv=(0,_.path)(["paths","collaborationPath"]),$v=(0,_.path)(["paths","imageServicePath"]),Kv=(0,_.path)(["paths","dvfPath"]),Xv=(0,_.path)(["paths","validationServicePath"]),Qv=(0,_.path)(["paths","adminToolsPath"]),Jv=(0,_.path)(["paths","mlDqPath"]),eT=(0,Rc.createSelector)((e=>(0,_.path)(["newConfig","properties","attributes","presentation"])(e)),(()=>S.intl.getLocale()),((e={},t)=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){jv(e,t,r[t])}))}return e}({},e,(0,S.getSpecialAttributesPresentation)(e,t)))),tT=(0,_.either)((0,_.path)(["config","com.reltio.plugins.entity.EntityRequestSettings","defaultMaxValues"]),(0,_.path)(["newConfig","properties","entity","maxValuesInResponse"])),rT=(0,_.path)(["numberFormat"]),nT=(0,_.either)((0,_.path)(["newConfig","properties","masks","dateMask"]),(0,_.path)(["dateMask"])),aT=(0,_.path)(["notifications"]),iT=(0,_.either)((0,_.path)(["newConfig","properties","masks","dateTimeMask"]),(0,_.path)(["dateTimeMask"])),oT=(0,_.path)(["newConfig","properties","requestProvider"]),lT=["config","com.reltio.plugins.pivoting.PivotingSettings","pivotingAttributes"],sT=(0,_.chain)((0,_.prop)("attributeTypes")),cT=(0,_.ifElse)((0,_.hasPath)(lT),(0,_.path)(lT),(0,_.pipe)((0,_.pathOr)([],["newConfig","pivoting"]),sT)),uT=(0,_.either)((0,_.path)(["config","com.reltio.plugins.imageattribute.fieldsorder"]),(0,_.path)(["newConfig","properties","image","attributeFieldsOrder"])),pT=(0,_.either)((0,_.path)(["config","com.reltio.plugins.ui.LookupAutocomplete"]),(0,_.path)(["newConfig","properties","lookups","autocomplete"])),dT=(0,_.path)(["keys","googleMapKey"]),mT=(0,_.path)(["keys","icpLicenseKey"]),fT=(0,_.pathOr)("",["documentation","releaseNotes"]),yT=["config","com.reltio.plugins.entity.ValidationServiceLevels","levels"],gT=(0,_.ifElse)((0,_.hasPath)(yT),(0,_.path)(yT),(0,_.path)(["newConfig","properties","validation","levels"])),hT=(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"])),ET=(0,_.pathOr)(!1,["newConfig","properties","validation","validateRelations"]),bT=(0,_.pathOr)(!1,["newConfig","properties","validation","validateReferenceEntityInReadMode"]),vT=(0,_.either)((0,_.path)(["config","com.reltio.plugins.workflow.configuration","enabled"]),(0,_.path)(["newConfig","properties","workflow","enabled"])),TT=(0,_.path)(["error"]),OT=(0,_.path)(["paths","servicesPath"]),ST=(0,_.path)(["newConfig"]),xT=(0,_.path)(["newConfig","layout"]),CT=(0,_.path)(["newConfig","profile"]),wT=(0,_.pathOr)(!0,["newConfig","properties","showEntityId"]),AT=(0,_.path)(["newConfig","properties","release"]),RT=(0,_.path)(["newConfig","properties","logo"]),_T=(0,_.path)(["newConfig","properties","headerColor"]),IT=(0,_.path)(["newConfig","properties","showSearchByOv"]),NT=(0,_.path)(["newConfig","properties","showAttributeDescription"]),PT=(0,_.path)(["newConfig","properties","attributes","sorting"]),DT=(0,_.path)(["newConfig","properties","profileCheckUpdate"]),kT=(0,_.pathOr)(!1,["newConfig","properties","aiAssistant","enabled"]),LT=(0,_.pathOr)(500,["newConfig","properties","aiAssistant","messagesPerDay"]),UT=(0,_.path)(["newConfig","properties","aiAssistant","skills"]),jT=(0,_.path)(["newConfig","properties","aiAssistant","historyBufferSize"]),FT=(0,_.pathOr)(!1,["newConfig","properties","queryEstimator","enabled"]),MT=(0,_.pathOr)(!1,["newConfig","properties","sharedPreferences","enabled"]);function VT(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){BT(e,t,r[t])}))}return e}function BT(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const zT={},HT=(e=zT,t)=>{switch(t.type){case JE.PATHS_SET:return VT({},e,{paths:t.payload});case JE.UI_PATH_SET:return(0,_.evolve)({paths:(0,_.assoc)("uiPath",t.payload)},e);case JE.UI_CONFIG_LOADED:return VT({},e,{config:t.payload});case JE.NEW_UI_CONFIG_LOADED:return VT({},e,{newConfig:t.payload});case JE.LOCALE_ATTRIBUTE_PRESENTATION_LOADED:return(0,_.evolve)({newConfig:{properties:{attributes:{presentation:(0,_.assoc)(S.LOCALE_ATTRIBUTE_PRESENTATION,t.payload)}}}},e);case JE.AUTOCLOSE_INTERVAL_LOADED:return VT({},e,{autoCloseInterval:t.payload});case JE.NUMBER_FORMAT_UPDATED:return VT({},e,{numberFormat:t.payload});case JE.DATE_MASK_UPDATED:return VT({},e,{dateMask:t.payload});case JE.DATE_TIME_MASK_UPDATED:return VT({},e,{dateTimeMask:t.payload});case JE.KEYS_SET:return VT({},e,{keys:t.payload});case JE.ERROR_SET:return VT({},e,{error:t.payload});case JE.DOCUMENTATION_SET:return VT({},e,{documentation:t.payload});case JE.SHOW_NOTIFICATION:return VT({},e,{notifications:[...e.notifications||[],t.payload]});case JE.CLOSE_NOTIFICATION:return(0,_.evolve)({notifications:(0,_.reject)((0,_.propEq)("id",t.payload))},e);case JE.CLEAR_NOTIFICATIONS:return VT({},e,{notifications:[]});case JE.SET_USE_SHARED_PREFERENCES:return VT({},e,{useSharedPreferences:t.payload});default:return e}},YT="USER_UPDATED",WT=($E(YT),(e=null,t)=>t.type===YT?t.payload||null:e),GT="TENANT_UPDATED",qT="TENANT_NAME_UPDATED",ZT=($E(GT),$E(qT),(0,_.prop)("id")),$T=(0,_.prop)("name");function KT(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){XT(e,t,r[t])}))}return e}function XT(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const QT=(e=null,t)=>{switch(t.type){case GT:return KT({},e,{id:t.payload});case qT:return KT({},e,{name:t.payload});default:return e}},JT="ENVIRONMENT_UPDATED",eO="ENVIRONMENT_ALIAS_UPDATED",tO=($E(JT),$E(eO),(0,_.prop)("id")),rO=(0,_.prop)("alias");function nO(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){aO(e,t,r[t])}))}return e}function aO(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const iO=(e=null,t)=>{switch(t.type){case JT:return nO({},e,{id:t.payload});case eO:return nO({},e,{alias:t.payload});default:return e}},oO=e=>e.dataTenants,lO=e=>e.tenants,sO=(e,t=QS(e))=>e.metadata&&e.metadata[t],cO=e=>e.tenant,uO=e=>e.environment,pO=e=>e.user,dO=e=>e.ui,mO=e=>e.profile,fO=e=>e.search,yO=e=>$A(mO(e)),gO=e=>uR(mO(e)),hO=e=>pR(mO(e)),EO=(e,t)=>bR(mO(e),t),bO=(e,t,r)=>gR(mO(e),t,r),vO=(e,t,r)=>hR(mO(e),t,r),TO=(e,t,r)=>yR(mO(e),t,r),OO=(e,t)=>vR(mO(e),t),SO=e=>TR(mO(e)),xO=(e,t,r)=>ER(mO(e),t,r),CO=e=>eR(mO(e)),wO=e=>XA(mO(e)),AO=e=>fR(mO(e)),RO=e=>GR(mO(e)),_O=e=>qR(mO(e)),IO=e=>ZR(mO(e)),NO=e=>$R(mO(e)),PO=e=>KR(mO(e)),DO=(e,t)=>dR(mO(e),t),kO=(e,t)=>mR(mO(e),t),LO=e=>KA(mO(e)),UO=(e,t)=>XR(mO(e),t),jO=(e,t,{uri:r})=>PR(mO(e),t,r),FO=(e,t,{uri:r})=>DR(mO(e),t,r),MO=(e,t,r)=>kR(mO(e),t,r),VO=e=>Fv(dO(e)),BO=e=>Vv(dO(e)),zO=e=>Mv(dO(e)),HO=e=>Bv(dO(e)),YO=e=>zv(dO(e)),WO=e=>$v(dO(e)),GO=e=>Qv(dO(e)),qO=e=>eT(dO(e)),ZO=e=>rT(dO(e)),$O=e=>tT(dO(e)),KO=e=>(e=>e.autoCloseInterval)(dO(e)),XO=e=>nT(dO(e)),QO=e=>iT(dO(e)),JO=e=>oT(dO(e)),eS=e=>aT(dO(e)),tS=e=>cT(dO(e)),rS=e=>uT(dO(e)),nS=e=>pT(dO(e)),aS=e=>dT(dO(e)),iS=e=>mT(dO(e)),oS=e=>gT(dO(e)),lS=e=>hT(dO(e)),sS=e=>ET(dO(e)),cS=e=>bT(dO(e)),uS=e=>kT(dO(e)),pS=e=>LT(dO(e)),dS=e=>UT(dO(e)),mS=e=>jT(dO(e)),fS=e=>MT(dO(e)),yS=e=>(e=>e.searchResults)(fO(e)),gS=e=>(e=>e.keyword)(fO(e)),hS=e=>S.getActivityFilter(fO(e)),ES=e=>S.getSearchOptions(fO(e)),bS=e=>(e=>e.searchProviderData)(fO(e)),vS=e=>(e=>e.searchNavigationData)(fO(e)),TS=(e,t)=>S.getGlobalSearchRequestOptions(fO(e),t),OS=e=>S.getStringifiedSearchOptions(fO(e)),SS=e=>(e=>e.globalFilter)(fO(e)),xS=e=>S.getGlobalFilterQuery(fO(e)),CS=e=>$b(fO(e)),wS=e=>rR(mO(e)),AS=e=>OR(mO(e)),RS=e=>SR(mO(e)),_S=e=>xR(mO(e)),IS=e=>QA(mO(e)),NS=(e,t)=>CR(mO(e),t),PS=(e,t)=>wR(mO(e),t),DS=(e,t)=>AR(mO(e),t),kS=(e,t,r)=>RR(mO(e),t,r),LS=(e,t,r)=>_R(mO(e),t,r),US=(e,t,r)=>IR(mO(e),t,r),jS=(e,t)=>NR(mO(e),t),FS=e=>Fv(dO(e))||Vv(dO(e)),MS=e=>(e=>null==e?void 0:e.username)(pO(e)),VS=e=>(e=>null==e?void 0:e.roles)(pO(e)),BS=e=>JA(mO(e)),zS=(e,t)=>LR(mO(e),t),HS=(e,t)=>UR(mO(e),t),YS=(e,t)=>jR(mO(e),t),WS=e=>FR(mO(e)),GS=(e,t,r)=>MR(mO(e),t,r),qS=(e,t)=>VR(mO(e),t),ZS=e=>nR(mO(e)),$S=e=>iR(mO(e)),KS=e=>oR(mO(e)),XS=e=>r_(mO(e),vC(e)),QS=e=>ZT(cO(e)),JS=e=>$T(cO(e)),ex=e=>tO(uO(e)),tx=e=>rO(uO(e)),rx=e=>Hv(dO(e)),nx=e=>Yv(dO(e)),ax=e=>Wv(dO(e)),ix=e=>Gv(dO(e)),ox=e=>qv(dO(e)),lx=e=>vT(dO(e)),sx=e=>Zv(dO(e)),cx=e=>Kv(dO(e)),ux=e=>Xv(dO(e)),px=e=>Jv(dO(e)),dx=(0,Rc.createSelector)(pO,QS,S.canUserRegisterConfigEnvironments),mx=(0,Rc.createSelector)(pO,QS,S.canUserCreateWorkflowConfigJar),fx=(0,Rc.createSelector)(pO,QS,S.canUserCreateWorkflowEnvironmentConfigJar),yx=(0,Rc.createSelector)(pO,QS,S.canUserExecuteWorkflowJobs),gx=(0,Rc.createSelector)(pO,QS,S.canUserExecuteWorkflowJobsSyncBusinessProcessData),hx=(0,Rc.createSelector)(pO,QS,S.canUserExecuteWorkflowJobsTerminateProcessInstance),Ex=(0,Rc.createSelector)(pO,QS,S.canUserExecuteWorkflowJobsUpdateTasks),bx=(0,Rc.createSelector)(pO,QS,S.canUserExecuteWorkflowJobsValidateTasks),vx=(0,Rc.createSelector)(pO,QS,S.canUserManageWorkflowDefinition),Tx=(0,Rc.createSelector)(pO,QS,S.canUserManageWorkflowEnvironmentDefinition),Ox=(0,Rc.createSelector)(pO,QS,S.canUserReadWorkflowDataTask),Sx=(0,Rc.createSelector)(pO,QS,S.canUserUpdateProcessInstance),xx=(0,Rc.createSelector)(pO,QS,S.canUserUpdateWorkflowDataTask),Cx=(0,Rc.createSelector)(pO,QS,S.canUserViewProcessInstanceSearchQuery),wx=(0,Rc.createSelector)(pO,QS,S.canUserViewWorkflowConfigJar),Ax=(0,Rc.createSelector)(pO,QS,S.canUserViewWorkflowDefinition),Rx=(0,Rc.createSelector)(pO,QS,S.canUserViewWorkflowEnvironmentConfigJar),_x=(0,Rc.createSelector)(pO,QS,S.canUserViewWorkflowJobs),Ix=(0,Rc.createSelector)(pO,QS,S.canUserMakeExport),Nx=(0,Rc.createSelector)(pO,QS,S.canUserMakeActivitiesExport),Px=(0,Rc.createSelector)(pO,QS,S.canUserImportEntitiesFromDT),Dx=(0,Rc.createSelector)(pO,QS,S.canUserReadEntitiesFromDT),kx=(0,Rc.createSelector)(pO,QS,S.canUserStartProcessInstanceFromQuery),Lx=(0,Rc.createSelector)(pO,QS,S.canUserMakeBulkUpdate),Ux=(0,Rc.createSelector)(pO,QS,S.canUserDeleteProfiles),jx=(0,Rc.createSelector)(pO,QS,S.canUserOpenDataLoader),Fx=(0,Rc.createSelector)(pO,QS,S.canUserGetDQStatistic),Mx=(0,Rc.createSelector)(pO,QS,S.canUserReadDVF),Vx=(0,Rc.createSelector)(sx,NO,((e,t)=>!!e&&!t)),Bx=(0,Rc.createSelector)(ax,lx,((e,t)=>!!e&&!!t)),zx=(e,t)=>{var r;return null===(r=lR(mO(e)))||void 0===r?void 0:r.find((0,_.propEq)("id",t))},Hx=(e,t)=>Boolean(zx(e,t)),Yx=e=>Hx(e,S.SidePanelViewId.Workflow),Wx=e=>Hx(e,S.SidePanelViewId.Discussion),Gx=e=>Hx(e,S.SidePanelViewId.History),qx=e=>Hx(e,S.SidePanelViewId.DB),Zx=e=>{var t,r;return null!==(t=null===(r=zx(e,S.SidePanelViewId.DB))||void 0===r?void 0:r.views)&&void 0!==t?t:[]},$x=e=>tR(mO(e)),Kx=e=>BR(mO(e)),Xx=(e,t)=>zR(mO(e),t),Qx=e=>HR(mO(e)),Jx=e=>YR(mO(e)),eC=(e,t)=>WR(mO(e),t),tC=e=>TT(dO(e)),rC=(e,t)=>{const r=sO(e),n=wS(e),a=yO(e),{nextEntry:i,inRelations:o=[],outRelations:l=[]}=t,s=n===S.Mode.Editing||n===S.Mode.Suggesting,c=n===S.Mode.Suggesting&&(0,S.isTempUri)(null==a?void 0:a.uri),u=vC(e);if(!s||c&&!u||i||!a)return!1;{const e=(0,S.checkMetadataForUpdate)(n,(0,S.getEntityType)(r,a.type)),t=o.concat(l).map((e=>(0,S.getRelationType)(r,e.uri||e))).some((0,_.both)((0,S.checkMetadataForCreate)(n),(0,S.checkMetadataForUpdate)(n)));return e&&t}},nC=(0,Rc.createSelector)(yO,RS,IO,RO,S.getProfileEntityWithHistoryDiff),aC=(0,Rc.createSelector)(yO,RS,IO,S.getProfileEntityWithoutHistoryDiff),iC=e=>OT(dO(e)),oC=e=>ST(dO(e)),lC=e=>xT(dO(e)),sC=e=>CT(dO(e)),cC=e=>wT(dO(e)),uC=e=>AT(dO(e)),pC=e=>fT(dO(e)),dC=e=>RT(dO(e)),mC=e=>_T(dO(e)),fC=e=>IT(dO(e)),yC=e=>NT(dO(e)),gC=e=>PT(dO(e)),hC=e=>DT(dO(e)),EC=(e,t)=>((e,t)=>(0,S.getAuthoringItemsFromLayoutByEntityType)(CT(e),t))(dO(e),t),bC=(e,t)=>((e,t)=>(0,_.path)(["newConfig","properties","cleanse",t])(e))(dO(e),t),vC=e=>{const t=yO(e),r=EC(e,null==t?void 0:t.type);return!(0,S.isEmptyValue)(r)},TC=e=>FT(dO(e)),OC=e=>sR(mO(e)),SC=e=>cR(mO(e)),xC=(e,t)=>Bx(e)&&kx(e)&&(0,S.checkMetadataPermission)(S.MetadataPermissions.INITIATE_CHANGE_REQUEST,t);let CC=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}({}),wC=function(e){return e.RELATIONS_LOADED="RELATIONS_LOADED",e.REMOVE_RELATION="REMOVE_RELATION",e.EDIT_RELATION="EDIT_RELATION",e.ADD_RELATION="ADD_RELATION",e.OPEN_RELATION_EDITOR="OPEN_RELATION_EDITOR",e.CLOSE_RELATION_EDITOR="CLOSE_RELATION_EDITOR",e.SET_RELATION_TYPE="SET_RELATION_TYPE",e.SET_RELATION_ENTITY="SET_RELATION_ENTITY",e.SET_INITIAL_INFO="SET_INITIAL_INFO",e.IGNORE_RELATION="IGNORE_RELATION",e.SECOND_LEVEL_RELATIONS_LOADED="SECOND_LEVEL_RELATIONS_LOADED",e.UPDATE_RELATION_RATING="UPDATE_RELATION_RATING",e}({});var AC=r(51095);const RC=(e,t)=>e.find((0,_.pipe)(S.getRelationUriFromConnection,(0,_.equals)(t))),_C=(e,t)=>(0,_.path)([t,"connections"],e),IC=r.n(AC)()(_C,((e,t)=>(0,_.path)([t,"drafts"],e)),((e,t,r)=>r),((e=[],t={},r)=>{var n;const{addedConnections:a=[],editedConnections:i=[],removedUris:o=[],ignoredRelationData:l=[]}=t,s=(0,_.pipe)(S.getRelationUriFromConnection,_.equals,(0,_.find)(_.__,o)),c=l.map((e=>e.relationUri)),u=(0,_.pipe)(S.getRelationUriFromConnection,_.equals,(0,_.find)(_.__,c)),p=r?(null===(n=e.find((e=>e.entity.entityUri===r)))||void 0===n?void 0:n.connections)||[]:e,d=a.filter((0,_.propEq)("parentEntityUri",r));return d.map(S.markNew).concat(p.filter((e=>!d.some((0,_.pipe)(S.getRelationUriFromConnection,(0,_.equals)((0,S.getRelationUriFromConnection)(e)))))).map((0,_.pipe)((0,_.either)((e=>(0,_.pipe)((0,_.eqBy)(S.getRelationUriFromConnection),(0,_.find)(_.__,i),(0,_.unless)(_.isNil,S.markEdited))(e)),_.identity),(0,_.when)(s,S.markRemoved),(0,_.when)(u,S.markIgnored))))}))(((e,t,r)=>t+r)),NC=(e,t,r)=>{const n=(0,S.getTempRelations)(e,t);return RC(n,r)};function*PC(e){yield(0,La.gw)(0);const t=e.payload,r=yield(0,La.Ys)(sO),n=yield(0,La.Ys)(Kx),a=[t.type],i=yield(0,La.Ys)(Qx),o=(0,S.initDependentLookups)({structure:n,metadata:r,typeUris:a,alreadyAddedTypeUris:i}),l=(0,S.populateDependentLookupsFromEntity)({structure:o,metadata:r,entityOrRelation:t});yield(0,La.gz)(bb(l)),yield(0,La.gz)(vb(a))}function*DC(e,t){const r=(0,S.getBaseUri)(e);return(0,S.isRelationUri)(r)?yield(0,La.Ys)(vO,t,r):yield(0,La.Ys)(DO,r)}function*kC(e){const{attributeType:t,metadata:r,parentUri:n,viewId:a}=e.payload,i=yield(0,La.RE)(DC,n,a),o=yield(0,La.Ys)(Kx);if(i)if(t){const e=(0,S.findAttributeValuesByTypeUri)(r,i,t.uri).filter((({uri:e})=>e.startsWith(n)))[0],a=(0,S.addValueToDependentLookups)({structure:o,attributeValue:e});yield(0,La.gz)(bb(a))}else{const e=[i.type],t=yield(0,La.Ys)(Qx),n=(0,S.initDependentLookups)({structure:o,metadata:r,typeUris:e,alreadyAddedTypeUris:t}),a=(0,S.populateDependentLookupsFromEntity)({structure:n,metadata:r,entityOrRelation:i});yield(0,La.gz)(bb(a)),yield(0,La.gz)(vb(e))}}function*LC(e){const t=e.payload,r=yield(0,La.Ys)(sO),n=yield(0,La.Ys)(Kx);let a=n;for(const e of t){const{attributeType:t,parentUri:i,viewId:o}=e;if((0,S.isAttributeTypeInDependentLookups)(n,t.uri)){const e=yield(0,La.RE)(DC,i,o);e&&(a=(0,S.syncAttributeTypeWithDependentLookups)({structure:a,entityOrRelation:e,attrTypeUri:t.uri,metadata:r}))}}a!==n&&(yield(0,La.gz)(bb(a)))}function*UC({structure:e,attributeType:t,value:r}){if((0,S.isReference)(t)&&r){const t=(0,S.getReferencedEntityUriFromAttrValue)(r);if((0,S.isTempUri)(t))return yield(0,La.RE)(VC,e,t)}return e}function*jC({structure:e,uri:t,attributeType:r,value:n}){let a=(0,S.removeValuesFromDependentLookups)({structure:e,uri:t});if(a=yield(0,La.RE)(UC,{structure:a,attributeType:r,value:n}),a=(0,S.addValueToDependentLookups)({structure:a,attributeValue:n}),(0,S.isReference)(r)&&n){const e=(0,S.getReferencedEntityUriFromAttrValue)(n);(0,S.isTempUri)(e)&&(a=yield(0,La.RE)(MC,a,e))}a!==e&&(yield(0,La.gz)(bb(a)))}function*FC(e){yield(0,La.gw)(0);const{attributeType:t,uri:r,viewId:n,silent:a,value:i}=e.payload,o=yield(0,La.Ys)(Kx),l=yield(0,La.RE)(DC,r,n);if(l&&(0,S.isAttributeTypeInDependentLookups)(o,t.uri)){const{value:n,lookupCode:i}=e.payload.value,l=i||n;a||(yield(0,La.rM)(HC,o,{type:t.uri,uri:r,lookupValue:l}));const s=(0,S.addValueToDependentLookups)({structure:o,attributeValue:{type:t.uri,value:l,uri:r}});yield(0,La.gz)(bb(s))}l&&(0,S.isComplexAttribute)(t.type)&&(yield(0,La.RE)(jC,{structure:o,uri:r,attributeType:t,value:i}))}function*MC(e,t){const r=yield(0,La.Ys)(sO),n=yield(0,La.Ys)(DO,t);if(!n)return e;const a=yield(0,La.Ys)(LO),i=(0,S.findRelatedTemporaryEntities)(a,n);let o=e;for(const e of[n,...i])o=(0,S.populateDependentLookupsFromEntity)({structure:o,metadata:r,entityOrRelation:e});return o}function*VC(e,t){const r=yield(0,La.Ys)(DO,t),n=yield(0,La.Ys)(LO),a=(0,S.findRelatedTemporaryEntities)(n,r).map((0,_.prop)("uri"));let i=e;for(const e of[t,...a])i=(0,S.removeValuesFromDependentLookups)({structure:i,uri:e});return i}function*BC(e){const{attributeType:t,uri:r,attributeValue:n,viewId:a}=e.payload,i=yield(0,La.Ys)(Kx),o=(0,S.isAttributeTypeInDependentLookups)(i,t.uri);if(yield(0,La.RE)(DC,r,a)){o&&(yield(0,La.rM)(HC,i,{type:t.uri,uri:r,lookupValue:""}));let e=o||(0,S.isComplexAttribute)(t)?(0,S.removeValuesFromDependentLookups)({structure:i,uri:r}):i;e=yield(0,La.RE)(UC,{structure:e,attributeType:t,value:n}),e!==i&&(yield(0,La.gz)(bb(e)))}}function*zC(e){yield(0,La.gw)(0);const t=yield(0,La.Ys)(Kx),r=yield(0,La.RE)(VC,t,e.payload);yield(0,La.gz)(bb(r))}function*HC(e,t){var r;const n=yield(0,La.Ys)(sO),a=yield(0,La.Ys)(LO),i=yield(0,La.Ys)(DS),o=yield(0,La.Ys)(gO),l=yield(0,La.Ys)(nS),s=yield(0,La.Ys)(Jx),c=yield(0,La.Ys)(OC),u=(0,S.getDependentLookupStateForValueUri)({structure:e,typeUri:t.type,valueUri:t.uri,modifiedEntities:a,connections:i,entityUri:o,config:l,editorsState:s,hiddenAttributes:null!==(r=c[o])&&void 0!==r?r:[]});if(u.length>0){const e=u.map((e=>e.uri));yield(0,La.gz)(Tb({uris:e,isBlocked:!0}));try{const e=yield(0,La.RE)(S.cascadeUpdate,u,t);for(const r of e){const{type:e,uri:a,lookupValue:i,displayName:o}=r,l=(yield(0,La.Ys)(jS,(0,S.getBaseUri)(a)))[0],s=yield(0,La.RE)(DC,a,l);s&&(0,S.findAttributeValueByUri)(s,a)&&a!==t.uri&&(yield(0,La.gz)(sb({attributeType:(0,S.findAttributeTypeByUri)(n,e),uri:a,value:{value:o||"",lookupCode:i||""},silent:!0,viewId:l})))}}catch(e){console.warn(e)}yield(0,La.gz)(Tb({uris:e,isBlocked:!1}))}}function*YC(e){const t=e.payload.connection,r=(0,S.getEntityUriFromConnection)(t);if((0,S.isTempUri)(r)&&(yield(0,La.Ys)(DO,r))){yield(0,La.qn)(Eb.DEPENDENT_LOOKUPS_STRUCTURE_SET);const e=yield(0,La.Ys)(Kx),t=yield(0,La.RE)(MC,e,r);yield(0,La.gz)(bb(t))}}function*WC(e){const t=e.payload.relationUri,r=yield(0,La.Ys)(Kx),n=(0,S.removeValuesFromDependentLookups)({structure:r,uri:t});yield(0,La.gz)(bb(n))}function*GC(e){const t=e.payload.id,r=e.payload.relationUri;if(0===(yield(0,La.Ys)(jS,r)).length){const e=yield(0,La.Ys)(Kx);let n=(0,S.removeValuesFromDependentLookups)({structure:e,uri:r});const a=yield(0,La.Ys)(TO,t),i=RC(a,r),o=(0,S.getEntityUriFromConnection)(i);(0,S.isTempUri)(o)&&(n=yield(0,La.RE)(VC,n,o)),yield(0,La.gz)(bb(n))}}const qC=[function*(){yield(0,La.ib)(CC.MODIFIED_ENTITY_CREATED,PC)},function*(){yield(0,La.ib)(CC.MODIFIED_ENTITY_DELETED,zC)},function*(){yield(0,La.ib)(ib.ADD_DEFAULT_VALUES,kC)},function*(){yield(0,La.ib)(ib.ADD_ATTRIBUTES,LC)},function*(){yield(0,La.ib)(ib.MODIFY_ATTRIBUTE,FC)},function*(){yield(0,La.ib)(ib.REMOVE_ATTRIBUTE,BC)},function*(){yield(0,La.ib)(wC.OPEN_RELATION_EDITOR,YC)},function*(){yield(0,La.ib)(wC.SET_RELATION_TYPE,WC)},function*(){yield(0,La.ib)(wC.CLOSE_RELATION_EDITOR,GC)}];let ZC=function(e){return e.ENTITY_LOADED="ENTITY_LOADED",e.DEFAULT_PROFILE_PIC_SET="DEFAULT_PROFILE_PIC_SET",e.LOAD_ENTITY="LOAD_ENTITY",e.ENTITY_CREATION_REQUESTED="ENTITY_CREATION_REQUESTED",e.ENTITY_CREATION_WITH_AUTHORING_REQUESTED="ENTITY_CREATION_WITH_AUTHORING_REQUESTED",e.ENTITY_REMOVE_REQUESTED="ENTITY_REMOVE_REQUESTED",e.CLEAR_ENTITY="CLEAR_ENTITY",e.CLONE_ENTITY="CLONE_ENTITY",e.ENTITY_AUTHORING_DRAFT_ENTITIES_LOADED="ENTITY_AUTHORING_DRAFT_ENTITIES_LOADED",e.AUTHORING_DCR_RESOLVED="AUTHORING_DCR_RESOLVED",e}({});const $C=(e,t)=>({type:ZC.ENTITY_LOADED,payload:{entity:e,silent:t}}),KC=$E(ZC.DEFAULT_PROFILE_PIC_SET),XC=$E(ZC.LOAD_ENTITY),QC=$E(ZC.ENTITY_CREATION_REQUESTED),JC=$E(ZC.ENTITY_CREATION_WITH_AUTHORING_REQUESTED),ew=$E(ZC.ENTITY_AUTHORING_DRAFT_ENTITIES_LOADED),tw=$E(ZC.AUTHORING_DCR_RESOLVED),rw=$E(ZC.ENTITY_REMOVE_REQUESTED),nw=$E(ZC.CLONE_ENTITY),aw=$E(ZC.CLEAR_ENTITY),iw=e=>null==e?void 0:e.uri,ow=(0,Rc.createSelector)((e=>null==e?void 0:e.dataTenant),iw,((e,t)=>(0,S.getEntityUriForLink)({dataTenant:e,uri:t})));function lw(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const sw={};let cw=function(e){return e.ERRORS_SET="ERRORS_SET",e.REMOVE_ERROR="REMOVE_ERROR",e.ERROR_DEACTIVATED="ERROR_DEACTIVATED",e}({});const uw=$E(cw.ERROR_DEACTIVATED),pw=$E(cw.ERRORS_SET);function dw(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const mw=[];let fw=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 yw=$E(fw.HISTORY_DIFF_SET),gw=$E(fw.HISTORY_DIFF_CLEARED),hw=$E(fw.HISTORY_EVENT_SET),Ew=$E(fw.HISTORY_EVENT_CLEARED),bw=$E(fw.HISTORY_SLICE_SET),vw=$E(fw.HISTORY_MODE_SET);function Tw(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Ow(e,t,r[t])}))}return e}function Ow(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Sw={mode:S.HistoryMode.Current};let xw=function(e){return e.PROFILE_LAST_LOADED_TIME_UPDATE="PROFILE_LAST_LOADED_TIME_UPDATE",e}({});$E(xw.PROFILE_LAST_LOADED_TIME_UPDATE);let Cw=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 ww=$E(Cw.LOOKUPS_LOADED),Aw=$E(Cw.LOOKUPS_FOR_TYPE_RESOLVED),Rw=$E(Cw.LOOKUPS_LIST_RESOLVED);function _w(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Iw(e,t,r[t])}))}return e}function Iw(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Nw={},Pw=(e,t)=>({type:Sb.MODE_UPDATED,payload:{mode:e,silent:t}}),Dw=$E(Sb.MODE_UPDATE_REQUESTED),kw=$E(Sb.MODE_EDITING_CANCELED),Lw=S.isSuggestMode,Uw=(S.isEditMode,S.isViewMode),jw=S.isEditableMode,Fw=S.Mode.Viewing,Mw=$E(CC.MODIFIED_ENTITY_CREATED),Vw=$E(CC.MODIFIED_ENTITY_DELETED),Bw=$E(CC.MODIFIED_ENTITY_DEFAULT_PROFILE_PIC_SET),zw=$E(CC.MODIFIED_ENTITIES_RESET),Hw=$E(CC.CLEANSE_LOADING);function Yw(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Ww(e,t,r[t])}))}return e}function Ww(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Gw={};function qw(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Zw(e,t,r[t])}))}return e}function Zw(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*$w(e){const{values:t,parentUri:r,attributeTypeUri:n,attributeTypeName:a}=e.payload;let i=t;const o=yield(0,La.Ys)(yO);if(r===o.uri){const e=(0,S.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,La.gz)(ub(qw({},e.payload,{values:i}))))}function*Kw(){return{apiPath:yield(0,La.Ys)(BO),tenant:yield(0,La.Ys)(QS)}}function*Xw(e){const{attributeTypeName:t,attributeTypeUri:r}=e.payload,n=yield(0,La.RE)(Kw);try{const a=yield(0,La.RE)(S.getPagedEntity,qw({},e.payload,n)),i=(0,S.getAttributeSource)(r),o=(0,_.pathOr)([],[i,t],a);yield(0,La.gz)(pb(qw({},e.payload,{values:o})))}catch(e){console.warn(e),yield(0,La.gz)(Dv((0,S.getRequestErrorMessage)(e,li().text("Something went wrong"))))}}function*Qw(e){var t;const{attributeType:r,value:n,uri:a}=e.payload,i=r.uri,o=(0,S.getBaseUri)(i),l=yield(0,La.Ys)(bC,o);if(!l)return;const s=yield(0,La.Ys)(sO),c=(0,S.getEntityType)(s,o),u=null==c||null===(t=c.cleanseConfig)||void 0===t?void 0:t.infos;if(!u)return;const p=(0,S.getCleanseType)(l,i);if(!(0,S.hasCleanseTypeInEntityType)(p,u))return;const d=(0,S.getCleanseAttributes)(l);if(null!=d&&d.includes(i)){yield(0,La.gz)(Hw({isLoading:!0}));try{const e=yield(0,La.RE)(S.cleanseData,{cleanseType:p.split("/cleanse/infos/")[1],type:o,attributes:{[r.name]:[{type:i,value:n}]}}),t=(0,S.getBaseUri)(a),l=yield(0,La.Ys)(DO,t);if((0,S.hasCleanseStatus)(e))if((0,S.isUnverifiedCleanse)(e))yield(0,La.gz)(Dv((0,_.path)(S.CLEANSE_STATUS_ERROR_PATH,e)));else if(l){const{attributes:r}=e,n=(0,S.prepareCleansedAttributes)(t,r);yield(0,La.gz)(Mw(qw({},l,{attributes:qw({},l.attributes,n)})))}}catch(e){console.warn(e),yield(0,La.gz)(Dv((0,S.getRequestErrorMessage)(e,li().text("Something went wrong"))))}yield(0,La.gz)(Hw({isLoading:!1}))}}const Jw=[function*(){yield(0,La.ib)(ib.REQUEST_NEXT_PAGE_ATTRIBUTE_VALUES,Xw)},function*(){yield(0,La.ib)(ib.PROCESS_NEXT_PAGE_ATTRIBUTE_VALUES,$w)},function*(){yield(0,La.ib)(ib.MODIFY_ATTRIBUTE,Qw)}],eA=$E(wC.RELATIONS_LOADED),tA=$E(wC.SECOND_LEVEL_RELATIONS_LOADED),rA=(0,_.curry)(((e,t)=>({type:wC.REMOVE_RELATION,payload:{id:e,relationUri:t}}))),nA=(0,_.curry)(((e,t)=>({type:wC.IGNORE_RELATION,payload:{id:e,ignoredRelationData:t}}))),aA=(0,_.curry)(((e,t)=>({type:wC.ADD_RELATION,payload:{id:e,connection:t}}))),iA=(0,_.curry)(((e,t)=>({type:wC.EDIT_RELATION,payload:{id:e,connection:t}}))),oA=(0,_.curry)(((e,t,r,n)=>({type:wC.UPDATE_RELATION_RATING,payload:{id:e,connection:t,rating:r,user:n}}))),lA=(0,_.curry)(((e,t)=>({type:wC.OPEN_RELATION_EDITOR,payload:{id:e,connection:t}}))),sA=(0,_.curry)(((e,t)=>({type:wC.CLOSE_RELATION_EDITOR,payload:{id:e,relationUri:t}}))),cA=(0,_.curry)(((e,t,r)=>({type:wC.SET_RELATION_TYPE,payload:{id:e,relationUri:t,relationType:r}}))),uA=(0,_.curry)(((e,t,r)=>({type:wC.SET_RELATION_ENTITY,payload:{id:e,relationUri:t,entityInfo:r}}))),pA=(0,_.curry)(((e,t,r)=>({type:wC.SET_INITIAL_INFO,payload:{id:e,relationUri:t,tempEntity:r}})));function dA(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){mA(e,t,r[t])}))}return e}function mA(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const fA={},yA={removedUris:[],addedConnections:[],editedConnections:[],ignoredRelationData:[]},gA=(e,t,r)=>{if((0,_.pathEq)([...(0,S.getRelationToAddPath)(e),"relation","relationUri"],t,r))return(0,S.getRelationToAddPath)(e);{const n=((0,_.path)((0,S.getRelationsToEditPath)(e),r)||[]).findIndex((0,_.pathEq)(["relation","relationUri"],t));return n>=0?[...(0,S.getRelationsToEditPath)(e),n]:null}},hA=(e,t,r)=>{const n=gA(e,t,r);return n?(0,_.lensPath)([...n,"relation"]):null},EA=(0,_.pipe)(hA,(e=>(0,_.compose)(e,(0,_.lensProp)("object"))));let bA=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}({});$E(bA.TREE_LOADED),$E(bA.TREE_LOADED_WITH_ERROR),$E(bA.TREE_LOADING),$E(bA.TREE_SCROLL_TO_NODE_RESET);const vA=$E(bA.TREE_COMMANDS_CLEARED),TA=($E(bA.TREE_CHILDREN_LOADING),$E(bA.TREE_CURRENT_ENTITY_SHOWN),$E(bA.TREE_REFRESHED),$E(bA.TREE_NODE_EXPANDED),$E(bA.TREE_RELATION_REMOVED),$E(bA.TREE_NODE_REMOVED),$E(bA.TREE_SECONDARY_LABEL_SHOWN),$E(bA.TREE_ENTITIES_MAPPING_LOADED),$E(bA.TREE_CHANGED)),OA=($E(bA.TREE_NODE_EDITED),$E(bA.TREE_ACTIVENESS_DATE_CHANGED),$E(bA.TREE_RELATION_REPOINTED),$E(bA.TREE_RELATION_CREATED),$E(bA.TREE_NODE_CREATED),$E(bA.TREE_RELATION_EDITED),$E(bA.TREE_NODE_EDITED),$E(bA.TREE_NODE_EDITING_STARTED),$E(bA.TREE_NODE_EDITING_APPLIED),$E(bA.TREE_NODE_EDITING_CANCELED),$E(bA.TREE_NODE_NEW_PARENT_EDITING_STARTED),$E(bA.TREE_NODE_NEW_PARENT_EDITING_APPLIED),$E(bA.TREE_NODE_NEW_PARENT_EDITING_CANCELED),$E(bA.TREE_NODE_NEW_CHILD_EDITING_STARTED),$E(bA.TREE_NODE_NEW_CHILD_EDITING_APPLIED),$E(bA.TREE_NODE_NEW_CHILD_EDITING_CANCELED),$E(bA.TREE_NODE_RELATION_TYPE_CHANGED),$E(bA.TREE_NODE_ENTITY_CHANGED),$E(bA.TREE_SORTED),$E(bA.TREES_STATE_SAVED),$E(bA.TREES_STATE_RESTORED),$E(bA.TREE_CHILDREN_LOADED),$E(bA.TREES_RESTORE_FROM_INITIAL_TREES)),SA=$E(bA.TREES_RESET_INITIAL_TREES),xA=($E(bA.TREE_CANCEL_CHILDREN_LOADING),(0,_.path)(["common","commands"]));var CA=r(76665);function wA(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){AA(e,t,r[t])}))}return e}function AA(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const RA=(e,t,r=[])=>{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=RA(n,t,r.concat(e));if(a)return a}},_A=(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},IA=(e,t)=>{if(e&&e.children){const r=e.children.findIndex((({nodeId:e})=>e===t));r>-1&&e.children.splice(r,1)}},NA=(e,t,r=0)=>{e&&e.children&&e.children.splice(r,0,t)},PA=({path:e,value:t,object:r})=>{let n=r;for(let r=0;r<e.length;r++){const a=e[r];r===e.length-1?n[a]="function"==typeof t?t(n[a]):t:(n[a]=n[a]||("number"==typeof a?[]:{}),n=n[a])}},DA=(e={},t,r)=>{e[t]=r,e.children&&e.children.forEach((e=>DA(e,t,r)))},kA=e=>({entity:e.entity,relation:e.relation}),LA=({id:e,draft:t,node:r})=>{PA({path:["editingConnections",r.relation.uri],object:t[e],value:kA(r)})},UA=({id:e,draft:t,node:r,entity:n})=>{PA({path:["editingConnections",r.relation.uri,"entity"],object:t[e],value:n})},jA=({id:e,draft:t,relationUri:r})=>{delete t[e].editingConnections[r]},FA=({id:e,draft:t,relationUri:r})=>t[e].editingConnections[r],MA=e=>{delete e.editingMode,delete e.relatedEntity,delete e.initialConnection},VA=({id:e,draft:t,currentNode:r})=>{const n=t[e].root;if(n===r)t[e].root=r.children[0],t[e].root.children=t[e].root.children||[],t[e].root.children.push(...r.children.slice(1));else{const e=(0,S.findParentNodeById)(n,r.nodeId);IA(e,r.nodeId)}},BA=(e,t,r)=>{const n=[e,"editingConnections",t,"relation"];return(0,_.path)(n,r)?(0,_.lensPath)(n):null},zA=(0,_.pick)(["showSecondaryLabel","sortField","sortOrder"]),HA=e=>({entity:(0,_.pick)(["uri","type","label","secondaryLabel"],e.entity),parent:[],relations:[(0,_.pick)(["uri","type"],e.relation)]});function YA(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){WA(e,t,r[t])}))}return e}function WA(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const GA={common:{commands:[]},trees:{},initialTrees:{}};let qA=function(e){return e.ENTITY_RELATED_ATTRIBUTES_ADDED="ENTITY_RELATED_ATTRIBUTES_ADDED",e}({});$E(qA.ENTITY_RELATED_ATTRIBUTES_ADDED);const ZA={},$A=e=>e.entity,KA=e=>e.modifiedEntities,XA=e=>e.errors,QA=e=>e.relations,JA=e=>e.trees,eR=e=>e.lookups,tR=e=>e.dependentLookups,rR=e=>e.mode,nR=e=>e.lastLoadedTime,aR=e=>e.history,iR=e=>e.operation,oR=e=>e.views,lR=e=>e.sidePanelViews,sR=e=>e.hiddenAttributes,cR=e=>e.controlAttributes,uR=e=>iw($A(e)),pR=e=>ow($A(e)),dR=(e,t)=>((e,t)=>t&&e[t])(KA(e),t),mR=(e,t)=>((e,t)=>t&&e[t]&&e[t].defaultProfilePic)(KA(e),t),fR=e=>(0,_.keys)(QA(e)),yR=(e,t,r)=>IC(QA(e),t,r),gR=(e,t,r)=>NC(QA(e),t,r),hR=(e,t,r)=>((e,t,r)=>{const n=NC(e,t,r);return(0,S.getRelationObjectFromConnection)(n)})(QA(e),t,r),ER=(e,t,r)=>((e,t,r)=>{const n=(0,_.pipe)((0,_.pathOr)([],[t,"drafts","addedConnections"]),(0,_.filter)((0,_.pipe)(S.getRelationUriFromConnection,S.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)((({entity:e})=>e.entityUri===r)),(0,_.pathOr)(0,["total"]))(e):(0,_.pathOr)(0,[t,"total"],e))(e,t,r)+n})(QA(e),t,r),bR=(e,t)=>_C(QA(e),t),vR=(e,t)=>S.getDraftsForSaveByViewId(QA(e),t),TR=e=>(e=>(0,_.keys)(e).reduce(((t,r)=>{const{addedConnections:n,editedConnections:a}=(0,S.getDraftsForSaveByViewId)(e,r);return(0,_.pipe)(_.concat,(0,_.map)(S.getEntityUriFromConnection),(0,_.filter)(S.isTempUri),(0,_.concat)(t))(n,a)}),[]))(QA(e)),OR=e=>jw(rR(e)),SR=e=>Uw(rR(e)),xR=e=>Lw(rR(e)),CR=(e,t)=>S.getRelationToAddByViewId(QA(e),t),wR=(e,t)=>S.getRelationsToEditByViewId(QA(e),t),AR=(e,t)=>S.getAllRelationsToAddAndEdit(QA(e),t),RR=(e,t,r)=>S.getAllRelationsToSave(QA(e),t,r),_R=(e,t,r)=>S.getInitialConnectionTempEntity(e.relations,t,r),IR=(e,t,r)=>S.getInitialConnection(e.relations,t,r),NR=(e,t)=>((e,t)=>Object.keys(e).filter((r=>{const n=(0,S.getTempRelations)(e,r);return!!RC(n,t)})))(QA(e),t),PR=(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))(XA(e),t,r),DR=(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))(XA(e),t,r),kR=(e,t,r)=>S.getCachedActiveErrorsForAttributesPager(XA(e),t,r),LR=(e,t)=>((e,t)=>e.trees[t])(JA(e),t),UR=(e,t)=>((e,t)=>(0,_.path)(["trees",t,"root"],e))(JA(e),t),jR=(e,t)=>((e,t)=>(0,_.path)(["trees",t,"total"],e))(JA(e),t),FR=e=>xA(JA(e)),MR=(e,t,r)=>((e,t,r)=>(0,_.path)(["trees",t,"editingConnections",r],e))(JA(e),t,r),VR=(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))(JA(e),t),BR=e=>(e=>e.structure)(tR(e)),zR=(e,t)=>S.getDependentLookupsStructureNode(tR(e),t),HR=e=>(e=>e.initedTypeUris)(tR(e)),YR=e=>(e=>e.editors)(tR(e)),WR=(e,t)=>S.getDependentLookupEditorState(tR(e),t),GR=e=>(e=>e.diff)(aR(e)),qR=e=>(e=>e.event)(aR(e)),ZR=e=>(e=>e.slice)(aR(e)),$R=e=>(e=>!(0,S.isEmptyValue)(e.slice))(aR(e)),KR=e=>(e=>e.mode)(aR(e)),XR=(e,t)=>((e,t)=>e[t])((e=>e.entityRelatedAttributes)(e),t),QR=(0,Rc.createSelector)($A,(e=>dR(e,uR(e))),((e,t)=>!(!e||!t||(0,S.isEmptyValue)((0,S.collectAllDiffs)(e,t,!0))))),JR=(0,Rc.createSelector)(JA,(e=>{const t=xA(e),r=(0,S.getNotAppliedTreeCommands)((0,_.reject)((0,_.propSatisfies)(S.isEmptyValue,"root"),e.trees));return!(0,S.isEmptyValue)(t)||!(0,S.isEmptyValue)(r)})),e_=(0,Rc.createSelector)(QA,(e=>(0,_.keys)(e).reduce(((t,r)=>t||!(0,_.all)(S.isEmptyValue)((0,_.values)(S.getDraftsForSaveByViewId(e,r)))),!1))),t_=(0,Rc.createSelector)(QR,e_,JR,((e,t,r)=>e||t||r)),r_=(0,Rc.createSelector)(rR,$A,t_,((e,t)=>t),((e,t,r,n)=>!(e===S.Mode.Viewing||!t)&&((0,S.isTempUri)(t.uri)&&!n||r)));let n_=function(e){return e.PROFILE_OPERATION_UPDATE="PROFILE_OPERATION_UPDATE",e}({});const a_=$E(n_.PROFILE_OPERATION_UPDATE),i_=({metadata:e,modifiedEntities:t,connections:r=[],errors:n})=>n.filter((({attributeType:e,type:t})=>e&&!(0,S.isRequired)(e)&&t===S.ErrorType.missed)).filter((({attributeType:n,parentUri:a})=>{const i=(0,S.getBaseUri)(a),o=(0,S.isEntityUri)(a)?t[i]:(0,S.findConnectionRelationObjectByRelationUri)(r,i),l=o&&(0,S.findAttributeValuesByTypeUri)(e,o,n.uri,!0);return null==l?void 0:l.some((({parent:e,attrValues:t})=>e.uri===a&&0===t.length))})).map((({attributeType:e,parentUri:t})=>({attributeType:e,parentUri:t}))),o_=e=>(0,S.getProfileViewsIdsByTypes)(e,[S.ProfileViewType.Relations,S.ProfileViewType.RelationsTable]);function l_(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){s_(e,t,r[t])}))}return e}function s_(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*c_(){const e=yield(0,La.Ys)(lI.selectors.getEntity),t=yield(0,La.Ys)(lI.selectors.getMode),r=yield(0,La.Ys)(lI.selectors.getEntityUri),n=yield(0,La.Ys)(lI.selectors.getMetadata),a=yield(0,La.Ys)(lI.selectors.getModifiedEntity,r),i=yield(0,La.Ys)(lI.selectors.getModifiedEntities),o=yield(0,La.Ys)(lI.selectors.getProfileViews);return{entity:e,modifiedEntity:t===S.Mode.Viewing?e:a,entityUri:r,metadata:n,modifiedEntities:t===S.Mode.Viewing?{[r]:e}:i,profileViews:o,mode:t}}function*u_(){return l_({},yield(0,La.RE)(c_),{validationServicePath:yield(0,La.Ys)(lI.selectors.getValidationServicePath),tenant:yield(0,La.Ys)(lI.selectors.getTenant),severity:yield(0,La.Ys)(lI.selectors.getValidationServiceSeverityLevels)})}function*p_(){const{entityUri:e,metadata:t,modifiedEntities:r,modifiedEntity:n,profileViews:a}=yield(0,La.RE)(c_);if(!e)return[];const i=o_(a),o=(0,S.getProfileViewsIdsByTypes)(a,[S.ProfileViewType.HierarchyTree]),l=yield(0,La.Ys)(kS,i,!0),s=yield(0,La.Ys)(lI.selectors.getRelations),c=yield(0,La.Ys)(lI.selectors.getAllTreesEditingConnections,o);return[...(0,S.validateEntityLocally)(t,r,n,(0,S.isAvailableAttributeTypeForProfile)(a)),...l.flatMap((e=>(0,S.validateConnection)(t,r,e))),...c.flatMap((e=>(0,S.validateHierarchyConnection)(t,e)))].map((n=>l_({},n,{path:(0,S.evaluateErrorPath)({entityUri:e,metadata:t,connections:l,entitiesMap:r,relationsState:s,relationViewsIds:i},n.uri||n.parentUri)})))}function*d_(){const{entityUri:e,metadata:t,modifiedEntity:r,mode:n,validationServicePath:a}=yield(0,La.RE)(u_);if(a&&e&&(0,S.shouldUseValidationService)(t,null==r?void 0:r.type)){const r=yield(0,La.RE)((0,S.isTempUri)(e)?f_:y_),{modifiedEntities:a}=yield(0,La.RE)(c_),i=(0,_.pipe)(S.convertValidationServiceErrors,(0,_.uniqBy)(S.getErrorUniqKey))(r,{entityUri:e,metadata:t,entitiesMap:a});if(n!==S.Mode.Viewing){const e=i_({metadata:t,modifiedEntities:a,errors:i});e.length&&(yield(0,La.gz)(ob(e)))}return i}return[]}function m_(e){return console.warn("Validation service error",e),[]}function*f_(){const{mode:e,modifiedEntity:t,modifiedEntities:r,validationServicePath:n,tenant:a,severity:i}=yield(0,La.RE)(u_),o=(0,S.prepareEntityForValidation)(t,r);try{return yield(0,La.RE)(S.validateEntity,{validationServicePath:n,entity:o,tenant:a,severity:i,options:(0,_.reject)(_.isNil,[S.ValidationServiceOption.preserveURIs,e===S.Mode.Editing?S.ValidationServiceOption.validateDataPermissions:null])})}catch(e){return m_(e)}}function*y_(){var e;const{entityUri:t,mode:r,entity:n,modifiedEntity:a,modifiedEntities:i,validationServicePath:o,metadata:l,tenant:s,severity:c}=yield(0,La.RE)(u_),u=yield(0,La.Ys)(lI.selectors.getValidateReferenceEntityInReadMode),p=(0,S.getEntityType)(l,n.type),d=null===(e=null==p?void 0:p.forceOvForUiUpdates)||void 0===e||e,m=r===S.Mode.Viewing?[]:(0,S.collectDiffForValidation)(n,a,i,d);try{return yield(0,La.RE)(S.validateEntityChanges,{validationServicePath:o,uri:t,diff:m,tenant:s,severity:c,options:(0,_.reject)(_.isNil,[S.ValidationServiceOption.preserveURIs,S.ValidationServiceOption.updateAttributeUpdateDates,r===S.Mode.Editing?S.ValidationServiceOption.validateDataPermissions:null,r===S.Mode.Viewing&&u?S.ValidationServiceOption.validateReferenceEntityAttribute:null])})}catch(e){return m_(e)}}function*g_(){const{entityUri:e,metadata:t,mode:r,modifiedEntity:n,modifiedEntities:a,validationServicePath:i,tenant:o,severity:l,profileViews:s}=yield(0,La.RE)(u_),c=yield(0,La.Ys)(lI.selectors.getValidateRelations);if(i&&c){const c=o_(s),u=(yield(0,La.Ys)(kS,c)).filter((e=>(0,S.shouldUseValidationService)(t,e.relation.relationType)));if(u.length>0){let s=[];const p=(0,S.prepareConnectionsForValidation)(u,n,a,t);try{const e=yield(0,La.RE)(S.validateRelations,{validationServicePath:i,body:p,tenant:o,severity:l,options:(0,_.reject)(_.isNil,[S.ValidationServiceOption.preserveURIs,r===S.Mode.Editing?S.ValidationServiceOption.validateDataPermissions:null])});s=Object.values(e.validated).flat()}catch(e){return m_(e)}const d=yield(0,La.Ys)(lI.selectors.getModifiedEntities),m=yield(0,La.Ys)(lI.selectors.getRelations),f=(0,_.pipe)(S.convertValidationServiceErrors,(0,_.uniqBy)(S.getErrorUniqKey))(s,{entityUri:e,metadata:t,entitiesMap:d,connections:u,relationsState:m,relationViewsIds:c}),y=i_({metadata:t,modifiedEntities:d,connections:u,errors:f});return y.length&&(yield(0,La.gz)(ob(y))),f}}return[]}function*h_(){const e=yield(0,La.RE)(p_),[t,r]=yield(0,La.$6)([(0,La.RE)(d_),(0,La.RE)(g_)]),n=(0,_.uniqBy)(S.getErrorUniqKey,[...e,...t,...r]),a=yield(0,La.Ys)(lI.selectors.getEntityUri),i=yield(0,La.Ys)(lI.selectors.getHiddenAttributes),o=(null==i?void 0:i[a])||[],l=(0,S.filterErrorsForHiddenAttributes)(n,o);return yield(0,La.gz)(pw(n)),0===l.filter(S.isCriticalError).length}let E_=function(e){return e.PROFILE_VIEWS_SET="PROFILE_VIEWS_SET",e}({});const b_=$E(E_.PROFILE_VIEWS_SET);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.push.apply(n,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=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function*O_(e){const t=yield(0,La.Ys)(lI.selectors.getMetadata),r=yield(0,La.Ys)(lI.selectors.getMode);switch(e.type){case wC.OPEN_RELATION_EDITOR:{const{id:n,connection:a}=e.payload;a.relation.relationType&&(yield(0,La.gz)(lb({viewId:n,metadata:t,mode:r,parentUri:a.relation.object.uri})));break}case ib.ADD_ATTRIBUTES:{const n=e.payload;for(const e of n){const{attributeType:n,parentUri:a,viewId:i}=e;(0,S.isComplexAttribute)(n)&&(yield(0,La.gz)(lb({viewId:i,attributeType:n,parentUri:a,metadata:t,mode:r})))}break}case wC.SET_RELATION_TYPE:{const{id:n,relationUri:a}=e.payload;yield(0,La.gz)(lb({viewId:n,metadata:t,mode:r,parentUri:a}));break}case bA.TREE_NODE_RELATION_TYPE_CHANGED:{var n;const{id:a,node:i}=e.payload;yield(0,La.gz)(lb({viewId:a,metadata:t,mode:r,parentUri:null==i||null===(n=i.relation)||void 0===n?void 0:n.uri}));break}}}function*S_(e,t=null){const r=yield(0,La.Ys)(BS),n=(0,S.getNotAppliedTreeCommands)(null==r?void 0:r.trees),a=yield(0,La.Ys)(WS),i=(0,S.optimizeCommands)([...a,...n]);if(null!=i&&i.length){const r=(0,_.when)((0,_.always)(t),(0,S.replaceTempUriInCommands)(t))(i);yield(0,La.RE)(e,r),yield(0,La.gz)(vA())}}function*x_(e){var t;const r=yield(0,La.Ys)(yO),n=yield(0,La.Ys)(gO),a=yield(0,La.Ys)(DO,n),i=yield(0,La.Ys)(sO),o=(0,S.getEntityType)(i,r.type),l=null===(t=null==o?void 0:o.forceOvForUiUpdates)||void 0===t||t,s=(0,S.collectAllDiffs)(r,a,l);return(0,S.prepareAttrDiff)(e,s)}function*C_(e){const t=yield(0,La.Ys)(SO),r=yield(0,La.Ys)(LO),n=yield(0,La.Ys)(gO),a=yield(0,La.Ys)(DO,n),i=(0,S.findAllTemporaryRefEntityURI)(a),o=(0,_.concat)(i,t);return yield(0,La.RE)(S.saveTemporaryEntities,r,o,e)}function*w_(e,t,r){const n=e.getDCRObjectUris(),a=yield(0,La.Ys)(ax),i=yield(0,La.Ys)(ox),o=yield(0,La.Ys)(QS);if(null!=n&&n.length){const l=yield(0,La.RE)(S.startProcessInstance,{workflowPath:a,processType:t?"authoring":"dataChangeRequestReview",objectURIs:(0,_.uniq)([r,...n,e.getDCRUri()]).filter((0,_.complement)(_.isNil)),tenant:o,environment:i});"OK"!==(null==l?void 0:l.status)&&console.warn(l)}}function*A_(e,t,r,n){const a=yield(0,La.Ys)(OO,r),i=yield(0,La.Ys)(lI.selectors.getUserName),o=(0,S.createRelationsCommandsFromConnections)(a,n,t,i);o.length&&(yield(0,La.RE)(e,o))}function*R_(e,t,r){const n=yield(0,La.Ys)(AO),a=yield(0,La.Ys)(gO);for(const i of n)yield(0,La.rM)(A_,e,r||a,i,t)}function*__(e){if(!e.hasNewUri())return;const t=yield(0,La.Ys)(BS);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,S.mapTree)(n.root,{nodeProcessing:e=>(0,_.pipe)((e=>v_({},e)),(0,_.unless)((0,_.has)("editingMode"),(0,_.evolve)({relation:t,relations:(0,_.map)(t)})))(e)});(0,_.equals)(n.root,a)||(yield(0,La.gz)(TA({id:r,tree:a})))}}function*I_(){try{var e;const t=yield(0,La.Ys)(_S),{commandExecutor:r,dcrProcessor:n,relationUriProcessor:a}=(0,S.createCommandExecutor)({alwaysCreateDCR:t,dcrUri:null}),i=yield(0,La.RE)(C_,n);yield(0,La.$6)([(0,La.RE)(S_,r),(0,La.RE)(R_,r,i)]),yield(0,La.RE)(__,a);const o=yield(0,La.RE)(x_,i),l=yield(0,La.Ys)(gO),s=yield(0,La.Ys)(lI.selectors.getMetadata),c=(0,S.hasAttributeMasking)(s);let u;if(null!=o&&o.length&&(u=yield(0,La.RE)(S.entityCumulativeUpdate,{uri:l,diff:o,uriPreprocessor:n.enhanceUriWithDCR,sendMasked:c})),t||(0,S.isChangeRequestUri)(null===(e=u)||void 0===e?void 0:e.uri))u&&n.updateDCRUriFromResponse(u),yield(0,La.RE)(w_,n,!1,l),yield(0,La.gz)(OA()),c&&(yield(0,La.RE)(M_,!0)),window.alert(li().text("Your changes are saved as pending and have been sent for review"));else if(u){yield(0,La.gz)($C(u));const{trees:e}=yield(0,La.Ys)(lI.selectors.getTrees),t=(0,S.updateTreesWithNewEntity)((0,_.pick)(["uri","label","secondaryLabel","type"],u),e);for(const e of t)yield(0,La.gz)(TA({id:e.id,tree:e.root}))}else!u&&c&&(yield(0,La.RE)(M_,!0));yield(0,La.gz)(Pw(S.Mode.Viewing)),yield(0,La.gz)(gb())}catch(e){yield(0,La.gz)(Dv((0,S.getRequestErrorMessage)(e,li().text("Something went wrong"))))}}function*N_(){yield(0,La.qn)(ZC.ENTITY_LOADED),yield(0,La.gz)(gb())}function*P_(e,t){const r=yield(0,La.Ys)(gO),n=yield(0,La.Ys)(lI.selectors.getModifiedEntity,r),{commandExecutor:a,dcrProcessor:i}=(0,S.createCommandExecutor)({alwaysCreateDCR:t,dcrUri:e}),o=yield(0,La.RE)(C_,i),l=yield(0,La.RE)(S.saveTemporaryEntity,n,o,i);return yield(0,La.$6)([(0,La.RE)(S_,a,{[r]:l}),(0,La.RE)(R_,a,o,l)]),{savedEntityUri:l,dcrProcessor:i}}function*D_(){const e=yield(0,La.Ys)(gO),t=yield(0,La.Ys)(lI.selectors.getModifiedEntity,e);if((0,S.isEmptyEntity)(t)){const e=(0,Ge.x0)();return yield(0,La.gz)(sv({id:e,text:li().text("Please fill out some fields."),actions:[]})),!1}return!0}function*k_(){try{const e=yield(0,La.Ys)(_S);if(!(yield(0,La.RE)(D_)))return;const{dcrProcessor:t,savedEntityUri:r}=yield(0,La.RE)(P_,null,e);e&&(yield(0,La.RE)(w_,t),window.alert(li().text("Your changes are saved as pending and have been sent for review"))),yield(0,La.gz)(Pw(S.Mode.Viewing)),e?(yield(0,La.gz)(lv()),yield(0,La.gz)(aw())):(yield(0,La.gz)(av({uri:r})),yield(0,La.rM)(N_))}catch(e){yield(0,La.gz)(Dv((0,S.getRequestErrorMessage)(e,li().text("Something went wrong"))))}}function*L_(e){const t=yield(0,La.RE)(S.getDataChangeRequest,e),r=(0,_.pipe)((0,_.prop)("changes"),_.values,_.flatten,(0,_.pluck)("id"))(t);try{yield(0,La.$6)(r.map((t=>(0,La.RE)(S.deleteChangeRequestItem,{dcrUri:e,changeItemId:t}))))}catch(e){yield(0,La.gz)(Dv((0,S.getRequestErrorMessage)(e,li().text("Something went wrong"))))}}function*U_(e){const{dcrUri:t,action:r,taskId:n}=e.payload;try{if(!(yield(0,La.RE)(D_)))return;if(yield(0,La.gz)(a_(S.Operation.Saving)),yield(0,La.RE)(L_,t),yield(0,La.RE)(P_,t,!0),"Approve"!==r||(yield(0,La.RE)(h_))){const e=yield(0,La.Ys)(ax),t=yield(0,La.Ys)(ox),a=yield(0,La.Ys)(QS);yield(0,La.RE)(S.runTaskAction,{workflowPath:e,environment:t,tenant:a,taskId:n,action:r}),yield(0,La.gz)(tw())}}catch(e){const t=null==e?void 0:e.error;if((null==t?void 0:t.errorCode)===S.ApiErrorCode.WORKFLOW_IS_NOT_REGISTERED_ERROR)return;yield(0,La.gz)(Dv((0,S.getRequestErrorMessage)(t||e,li().text("Something went wrong"))))}yield(0,La.gz)(a_(null))}function*j_(e){const{dcrUri:t,userAction:r}=e.payload,n=yield(0,La.Ys)(wS);try{if(!(yield(0,La.RE)(D_)))return;yield(0,La.gz)(Pw("saveDraft"===r?S.Mode.Suggesting:S.Mode.Editing,!0)),yield(0,La.gz)(a_(S.Operation.Saving));const e=yield(0,La.RE)(h_);if("saveDraft"===r){if(t)yield(0,La.RE)(L_,t),yield(0,La.RE)(P_,t,!0);else{const{dcrProcessor:e}=yield(0,La.RE)(P_,null,!0);yield(0,La.RE)(w_,e,!0);const t=e.getDCRUri();yield(0,La.gz)(Iv({url:"../authoring",searchParams:{entityUri:`${t}`},options:{replace:!0,state:{keepErrors:!0}}}))}window.alert(li().text("Your changes are saved as pending and have been sent for review"))}else if(e){const{savedEntityUri:e}=yield(0,La.RE)(P_,null,!1);yield(0,La.gz)(Pw(S.Mode.Viewing)),yield(0,La.gz)(av({uri:e})),yield(0,La.rM)(N_)}else e||(yield(0,La.gz)(Pw(n,!0)))}catch(e){yield(0,La.gz)(Pw(n,!0)),yield(0,La.gz)(Dv((0,S.getRequestErrorMessage)(e,li().text("Something went wrong"))))}yield(0,La.gz)(a_(null))}function*F_(){if(yield(0,La.gz)(a_(S.Operation.Saving)),yield(0,La.RE)(h_)){const e=yield(0,La.Ys)(gO);(0,S.isTempUri)(e)?yield(0,La.RE)(k_):yield(0,La.RE)(I_)}yield(0,La.gz)(a_(null))}function*M_(e){try{let t;if(e){const e=yield(0,La.Ys)(lI.selectors.getMetadata);t=(0,S.addMetadataSpecificGetEntityOptions)(e)}yield(0,La.gz)(a_(S.Operation.Fetching));const r=yield(0,La.Ys)(gO),n=yield(0,La.RE)(S.getEntity,r,t);if(!n)throw new Error("Failed to request entity");return yield(0,La.gz)($C(n,!0)),n}catch(e){throw yield(0,La.gz)(Dv((0,S.getRequestErrorMessage)(e,li().text("Something went wrong")))),e}finally{yield(0,La.gz)(a_(null))}}function*V_(e){const{mode:t,silent:r}=e.payload;r||(yield B_({mode:t}))}function*B_({mode:e,overwrite:t=!1}){const r=yield(0,La.Ys)(lI.selectors.getEntity),n=yield(0,La.Ys)(lI.selectors.getMetadata),a=yield(0,La.Ys)(lI.selectors.getModifiedEntity,null==r?void 0:r.uri);if((t||!a)&&e!==S.Mode.Viewing&&r&&n){const t=yield(0,La.Ys)(lI.selectors.getProfileViews),a=yield(0,La.Ys)(lI.selectors.getUIConfig),i=yield(0,La.Ys)(lI.selectors.getUserRoles),o=(0,S.addToEntityRequiredAttributes)({entity:r,metadata:n,mode:e,attrTypeFilter:(0,_.both)((0,S.isAvailableAttributeTypeForProfile)(t||[]),(0,S.getProfileAttributeConfigPermissionsChecker)(a,r.type,i,[S.ConfigPermissions.READ,S.ConfigPermissions.CREATE]))});yield(0,La.gz)(Mw(o));const l=yield(0,La.Ys)(lI.selectors.getModifiedEntities),s=yield(0,La.Ys)(lI.selectors.getProfileErrors),c=i_({metadata:n,modifiedEntities:l,errors:s});c.length&&(yield(0,La.gz)(ob(c)))}}function*z_(e){const{entity:t,silent:r}=e.payload,n=yield(0,La.Ys)(lI.selectors.getMode);r||(0,S.isTempUri)(t.uri)||(yield B_({mode:n,overwrite:!0}))}function*H_(e){const{entityTypeUri:t}=e.payload,r=yield(0,La.Ys)(lI.selectors.getMetadata),n=(0,S.getEntityType)(r,t),a=yield(0,La.Ys)(lI.selectors.getUIConfig),i=yield(0,La.Ys)(lI.selectors.getUserRoles),o=(0,S.getProfileAttributeConfigPermissionsChecker)(a,t,i,[S.ConfigPermissions.READ,S.ConfigPermissions.CREATE]),l=((null==n?void 0:n.attributes)||[]).filter((e=>o(e))),s=(0,S.checkMetadataForCreate)(S.Mode.Editing,n)?S.Mode.Editing:S.Mode.Suggesting,c=(0,S.createTemporaryEntity)({entityTypeUri:t,attributeTypes:l,metadata:r,mode:s});yield(0,La.gz)(iv({entity:c})),yield(0,La.gz)($C(c)),yield(0,La.gz)(Pw(S.Mode.Viewing)),yield(0,La.gw)(0),(yield(0,La.Ys)(lI.selectors.getProfileViews))||(yield(0,La.qn)(E_.PROFILE_VIEWS_SET)),yield(0,La.gz)(Pw(s)),yield(0,La.gz)(SA())}function*Y_(e){const t=yield(0,La.Ys)(lI.selectors.getMetadata),r=yield(0,La.Ys)(lI.selectors.getAuthoringByEntityType,e),n=(0,S.getPreparedAuthoringItems)(t,r,e).map((({views:e})=>e)).flat();yield(0,La.gz)(b_(n))}function*W_(e){const{entityTypeUri:t}=e.payload,r=yield(0,La.Ys)(lI.selectors.getMetadata),n=(0,S.getEntityType)(r,t),a=(0,_.prop)("attributes",n),i=(yield(0,La.Ys)(lI.selectors.getCanSuggestAuthoring,n))?S.Mode.Suggesting:S.Mode.Editing,o=(0,S.createTemporaryEntity)({entityTypeUri:t,attributeTypes:a,metadata:r,mode:i});yield(0,La.gz)(Rv({entity:o})),yield(0,La.gz)($C(o)),yield(0,La.RE)(Y_,o.type),yield(0,La.gz)(Pw(i))}function*G_(e){const{mainEntityUri:t,tempEntities:r,keepErrors:n}=e.payload,[[a],i]=(0,_.partition)((0,_.propEq)("uri",t),r);yield(0,La.gz)($C(a,n)),yield(0,La.RE)(Y_,a.type),yield(0,La.gz)(Pw(S.Mode.Suggesting));for(const e of i)yield(0,La.gz)(Mw(e))}function*q_(e){const{payload:{entityUri:t,data:r}}=e;yield(0,La.gz)(a_(S.Operation.Cloning));try{const e=yield(0,La.RE)(S.cloneEntity,t,r);yield(0,La.gz)(iv({entity:e})),yield(0,La.gz)($C(e)),yield(0,La.gz)(Pw(S.Mode.Editing)),yield(0,La.gz)(SA());const n=(0,Ge.x0)(),a=yield(0,La.Ys)(lI.selectors.getMetadata),i=(0,S.getEntityType)(a,e.type),o=(0,S.checkMetadataForDelete)(S.Mode.Editing,i);yield(0,La.gz)(sv({id:n,type:"cloneAction",autoHideDuration:1e4,text:li().text("Profile is cloned successfully. You can modify the attributes if required."),actions:o?[{label:li().text("Undo"),needConfirmation:!0,confirmationText:li().text("Are you sure you want to undo the cloning process?"),confirmationDescription:li().text("Undoing the cloning process will delete the cloned profile. Are you sure you want to proceed?"),applyAction:rw({entityUri:e.uri}),cancelAction:cv(n)}]:[]}))}catch(e){yield(0,La.gz)(Dv((0,S.getRequestErrorMessage)(e,li().text("Something went wrong"))))}yield(0,La.gz)(a_(null))}function*Z_(e){const{entityUri:t}=e.payload;if(!(0,S.isTempUri)(t))try{yield(0,La.RE)(S.removeEntity,t),yield(0,La.gz)(ov())}catch(e){yield(0,La.gz)(Dv((0,S.getRequestErrorMessage)(e,li().text("Something went wrong"))))}}function*$_(e){const t=e.payload;try{if((yield(0,La.Ys)(XS))&&!confirm(li().text("Are you sure you want to cancel changes for this Profile?")))return;const e=yield(0,La.Ys)(wS),r=yield(0,La.Ys)(lI.selectors.getMetadata),n=yield(0,La.Ys)(gO),a=(0,S.hasAttributeMasking)(r),i=(0,S.isTempUri)(n),o=(0,S.isViewMode)(t),l=(0,S.isEditableMode)(e)&&(0,S.isViewMode)(t),s=(0,S.isViewMode)(e)&&(0,S.isEditableMode)(t);n&&(l||s)&&a&&!i&&(yield(0,La.RE)(M_,o)),yield(0,La.gz)(Pw(t)),l&&(yield(0,La.gz)(kw()))}catch{}}const K_=[function*(){yield(0,La.A7)([Sb.MODE_UPDATE_REQUESTED],$_)},function*(){yield(0,La.A7)([ib.RUN_AUTHORING_TASK_ACTION],U_)},function*(){yield(0,La.ib)([wC.OPEN_RELATION_EDITOR,ib.ADD_ATTRIBUTES,wC.SET_RELATION_TYPE,bA.TREE_NODE_RELATION_TYPE_CHANGED],O_)},function*(){yield(0,La.A7)([ib.SAVE_PROFILE],F_)},function*(){yield(0,La.ib)([Sb.MODE_UPDATED],V_)},function*(){yield(0,La.ib)([ZC.ENTITY_CREATION_REQUESTED],H_)},function*(){yield(0,La.Fm)([ib.VALIDATE_PROFILE],h_)},function*(){yield(0,La.ib)([ZC.ENTITY_REMOVE_REQUESTED],Z_)},function*(){yield(0,La.ib)([ZC.CLONE_ENTITY],q_)},function*(){yield(0,La.ib)([ZC.ENTITY_CREATION_WITH_AUTHORING_REQUESTED],W_)},function*(){yield(0,La.ib)([ZC.ENTITY_AUTHORING_DRAFT_ENTITIES_LOADED],G_)},function*(){yield(0,La.A7)([ib.SAVE_DRAFT],j_)},function*(){yield(0,La.ib)([ZC.ENTITY_LOADED],z_)}];let X_=function(e){return e.SIDE_PANEL_VIEWS_LOADED="SIDE_PANEL_VIEWS_LOADED",e}({});$E(X_.SIDE_PANEL_VIEWS_LOADED);const Q_=[];let J_=function(e){return e.HIDDEN_ATTRIBUTES_UPDATED="HIDDEN_ATTRIBUTES_UPDATED",e.HIDDEN_ATTRIBUTES_RESET="HIDDEN_ATTRIBUTES_RESET",e}({});const eI=$E(J_.HIDDEN_ATTRIBUTES_UPDATED),tI=$E(J_.HIDDEN_ATTRIBUTES_RESET),rI={};let nI=function(e){return e.CONTROL_ATTRIBUTES_UPDATED="CONTROL_ATTRIBUTES_UPDATED",e}({});const aI=$E(nI.CONTROL_ATTRIBUTES_UPDATED),iI=[],oI=(0,R.combineReducers)({dependentLookups:(e=wb,t)=>{switch(t.type){case Sb.MODE_UPDATED:{const{mode:r,silent:n}=t.payload;return(0,S.isViewMode)(r)&&!n?wb:e}case Eb.DEPENDENT_LOOKUPS_STRUCTURE_SET:return xb({},e,{structure:t.payload});case Eb.DEPENDENT_LOOKUPS_INITED_TYPE_URIS_ADDED:{const r=t.payload;return xb({},e,{initedTypeUris:(0,_.uniq)(e.initedTypeUris.concat(r))})}case Eb.DEPENDENT_LOOKUPS_EDITORS_BLOCKED:{const{uris:r,isBlocked:n}=t.payload,a=e.editors,i=r.reduce(((e,t)=>xb({},e,{[t]:xb({},e[t],{isBlocked:n})})),a);return xb({},e,{editors:i})}case Eb.DEPENDENT_LOOKUPS_EDITOR_TOUCHED:{const{uri:r,isTouched:n}=t.payload;return(0,_.assocPath)(["editors",r,"isTouched"],n,e)}default:return e}},entity:(e=sw,t)=>{switch(t.type){case ZC.ENTITY_LOADED:return t.payload.entity;case ZC.DEFAULT_PROFILE_PIC_SET:return"object"==typeof t.payload&&null!==t.payload?function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){lw(e,t,r[t])}))}return e}({},e,{defaultProfilePic:t.payload.uri,defaultProfilePicValue:t.payload}):e;case ib.ADD_NEXT_PAGE_ATTRIBUTE_VALUES:{const{parentUri:r,attributeTypeName:n,attributeTypeUri:a,values:i}=t.payload,o=(0,S.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 ZC.CLEAR_ENTITY:return sw;default:return e}},errors:(e=mw,t)=>{switch(t.type){case cw.ERRORS_SET:return t.payload;case cw.ERROR_DEACTIVATED:{const r=t.payload,n=e.findIndex((e=>(0,S.getErrorId)(e)===r)),a=(0,_.lensPath)([n]);return(0,_.over)(a,(0,_.assoc)("deactivated",!0),e)}case ib.REMOVE_ATTRIBUTE:{const{uri:r}=t.payload;return e.map((e=>e.uri===r||(0,S.areOneHierarchyUris)(e.parentUri,r)?function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){dw(e,t,r[t])}))}return e}({},e,{deactivated:!0}):e))}case Sb.MODE_UPDATED:{const{mode:r,silent:n}=t.payload;return(0,S.isViewMode)(r)&&!n?mw:e}case ZC.ENTITY_LOADED:{const{silent:r}=t.payload;return r?e:mw}default:return e}},history:(e=Sw,t)=>{switch(t.type){case fw.HISTORY_DIFF_SET:return Tw({},e,{diff:t.payload});case fw.HISTORY_DIFF_CLEARED:return Tw({},e,{diff:Sw.diff});case fw.HISTORY_EVENT_SET:return Tw({},e,{event:t.payload});case JE.NEW_ENTITY_SHOWN:case JE.OPEN_ENTITY:case fw.HISTORY_EVENT_CLEARED:return Tw({},Sw,{mode:e.mode});case fw.HISTORY_SLICE_SET:return Tw({},e,{slice:t.payload});case fw.HISTORY_MODE_SET:return Tw({},e,{mode:t.payload});default:return e}},lastLoadedTime:(e=null,t)=>{switch(t.type){case xw.PROFILE_LAST_LOADED_TIME_UPDATE:case ZC.ENTITY_LOADED:return Date.now();default:return e}},lookups:(e=Nw,t)=>{switch(t.type){case Cw.LOOKUPS_LOADED:return t.payload;case Cw.LOOKUPS_FOR_TYPE_RESOLVED:{const{type:r,values:n}=t.payload;return _w({},e,{[r]:_w({},e[r],n)})}case Cw.LOOKUPS_LIST_RESOLVED:return t.payload.reduce(((e,t)=>Object.keys(t).reduce(((e,r)=>_w({},e,{[r]:_w({},e[r],t[r])})),e)),e);case"UI_RESET":return _w({},Nw);default:return e}},mode:(e=Fw,t)=>t.type===Sb.MODE_UPDATED?t.payload.mode:e,modifiedEntities:(e=Gw,t)=>{switch(t.type){case CC.MODIFIED_ENTITY_CREATED:{const r=t.payload;return Yw({},e,{[r.uri]:r})}case CC.MODIFIED_ENTITY_DELETED:{const r=t.payload;return(0,_.omit)([r],e)}case CC.MODIFIED_ENTITIES_RESET:return Gw;case Sb.MODE_UPDATED:{const{silent:r}=t.payload;return r?e:Gw}case CC.MODIFIED_ENTITY_DEFAULT_PROFILE_PIC_SET:{const{entityUri:r,value:n}=t.payload;return r?Yw({},e,{[r]:Yw({},e[r],{defaultProfilePic:n.uri,defaultProfilePicValue:n})}):e}case ib.ADD_ATTRIBUTES:return t.payload.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a}=t,i=(0,S.getBaseUri)(n);if((0,S.isEntityUri)(i)){const t=e[i];return e[i]||console.error(`ADD_ATTRIBUTES. parentUri - ${n}, state: ${JSON.stringify(e)}`),(0,S.isEntitySpecialAttrType)(r)?Yw({},e,{[i]:(0,S.addEntitySpecialAttribute)({entity:t,attributeType:r})}):Yw({},e,{[i]:(0,S.addAttribute)({entity:t,attributeType:r,parentUri:n,index:a})})}return e}),e);case ib.ADD_NEXT_PAGE_ATTRIBUTE_VALUES:{const{parentUri:r,attributeTypeName:n,attributeTypeUri:a,values:i}=t.payload,o=(0,S.getAttributeSource)(a);if((0,S.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 ib.MODIFY_ATTRIBUTE:{const{attributeType:r,uri:n,value:a}=t.payload,i=(0,S.getBaseUri)(n);if((0,S.isEntityUri)(i)){const t=e[i];return e[i]&&e[i].attributes||console.error(`MODIFY_ATTRIBUTE. uri - ${n}, state: ${JSON.stringify(e)}`),(0,S.isEntitySpecialAttrType)(r)?Yw({},e,{[i]:(0,S.editEntitySpecialAttribute)({entity:t,attributeType:r,value:a})}):Yw({},e,{[i]:(0,S.editAttribute)({entity:t,attributeType:r,uri:n,value:a})})}return e}case ib.REMOVE_ATTRIBUTE:{const{attributeType:r,uri:n}=t.payload,a=(0,S.getBaseUri)(n);if((0,S.isEntityUri)(n)){const t=e[a];return e[a]||console.error(`REMOVE_ATTRIBUTE. uri - ${n}, state: ${JSON.stringify(e)}`),(0,S.isEntitySpecialAttrType)(r)?Yw({},e,{[a]:(0,S.removeEntitySpecialAttribute)({entity:t,attributeType:r})}):Yw({},e,{[a]:(0,S.removeAttribute)({entity:t,attributeType:r,uri:n})})}return e}case ib.ADD_DEFAULT_VALUES:{const{attributeType:r,parentUri:n,metadata:a,mode:i}=t.payload,o=(0,S.getBaseUri)(n);if((0,S.isEntityUri)(o)){const t=(0,S.getEditableAttributeTypeSubAttributes)(a,r);return(0,_.over)((0,_.lensProp)(o),(0,S.addDefaultValuesToComplexAttribute)({attributeType:r,subAttributes:t,metadata:a,mode:i,parentUri:n}),e)}return e}default:return e}},relations:(e=fA,t)=>{switch(t.type){case ZC.ENTITY_LOADED:{const{silent:r}=t.payload;return r?e:fA}case wC.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,S.isEditableMode)(i))),(0,_.assocPath)([r,"drafts"],yA)))(e)}case wC.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?dA({},e,{total:i,connections:n.map((e=>dA({},e,{parentEntityUri:a})))}):e}));return(0,_.assocPath)([r,"connections"],o,e)}case Sb.MODE_UPDATED:{const{mode:r,silent:n}=t.payload;return n?e:(0,_.map)(Uw(r)?(0,_.omit)(["drafts","relationsToEdit","relationToAdd"]):(0,_.assoc)("drafts",yA),e)}case wC.REMOVE_RELATION:{const{id:r,relationUri:n}=t.payload,a=(0,_.pipe)(S.getRelationUriFromConnection,(0,_.equals)(n)),i=(0,_.path)([r,"connections"],e),o=!((0,S.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 wC.IGNORE_RELATION:{const{id:r,ignoredRelationData:n}=t.payload;return(0,_.evolve)({[r]:{drafts:(0,_.evolve)({ignoredRelationData:(0,_.append)(n)})}},e)}case wC.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"],yA)),(0,_.evolve)({drafts:{addedConnections:(0,_.prepend)(a)}}))},e)}case wC.EDIT_RELATION:{const{id:r,connection:n}=t.payload,a=(0,_.eqBy)(S.getRelationUriFromConnection,n);if((0,S.isTempUri)((0,S.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 wC.UPDATE_RELATION_RATING:{const{id:r,connection:n,rating:a,user:i}=t.payload,o=n.initial?n:dA({},n,{initial:{connection:n}}),l=(0,S.isTempUri)((0,S.getRelationUriFromConnection)(o)),s=(0,_.eqBy)(S.getRelationUriFromConnection,o),c=e=>{const t=null==e?void 0:e.findIndex((e=>e.user===i));return!a&&t>=0?e.filter((e=>e.user!==i)):t>=0?(0,_.update)(t,a,e):[...e,a]},u=e=>{const t=e.findIndex(s);return t>=0?(0,_.update)(t,p,e):[...e,p]},p=(0,_.evolve)({relation:e=>dA({},e,{ratings:c((0,_.defaultTo)([],e.ratings))})},o);return(0,_.evolve)({[r]:{drafts:(0,_.evolve)({[l?"addedConnections":"editedConnections"]:u})}},e)}case wC.OPEN_RELATION_EDITOR:{const{id:r,connection:n}=t.payload,a=n.initial?n:dA({},n,{initial:{connection:n}});if(a.isNew){const t=(0,S.getRelationToAddPath)(r);return(0,_.path)(t,e)?e:(0,_.assocPath)(t,a,e)}{const t=(0,_.lensPath)((0,S.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 wC.SET_INITIAL_INFO:{const{id:r,relationUri:n,tempEntity:a}=t.payload,i=gA(r,n,e);return(0,_.assocPath)([...i,"initial","modifiedEntity"],a,e)}case wC.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 wC.SET_RELATION_TYPE:{const{id:r,relationUri:n,relationType:a}=t.payload,i=gA(r,n,e);if(i){const t=[...i,"relation"],r=(0,_.lensPath)(t);return(0,_.over)(r,(0,S.applyRelationTypeObject)(a),e)}return e}case ib.ADD_ATTRIBUTES:return t.payload.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a,viewId:i}=t,o=(0,S.getBaseUri)(n),l=hA(i,o,e);if(l&&(0,S.isRelationUri)(o)){if((0,S.isActivenessAttrType)(r)){const t=(0,_.view)(l,e),n=(0,S.addEntitySpecialAttribute)({entity:t,attributeType:r});return(0,_.set)(l,n,e)}{const t=EA(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,S.addAttribute)({entity:l,attributeType:r,parentUri:n,index:a});return(0,_.set)(t,s,e)}}return e}),e);case ib.ADD_NEXT_PAGE_ATTRIBUTE_VALUES:{const{parentUri:r,attributeTypeName:n,values:a,viewId:i}=t.payload;if(!(0,S.isRelationUri)(r))return e;const o=(0,S.getBaseUri)(r),l=gA(i,o,e),s=(0,_.lensPath)([...l,"relation","object","attributes",n]);return(0,_.over)(s,(0,_.pipe)((0,_.defaultTo)([]),(0,_.append)(a)),e)}case ib.MODIFY_ATTRIBUTE:{const{attributeType:r,viewId:n,uri:a,value:i}=t.payload,o=(0,S.getBaseUri)(a),l=hA(n,o,e);if(l&&(0,S.isRelationUri)(o)){if((0,S.isActivenessAttrType)(r)){const t=(0,_.view)(l,e),n=(0,S.editEntitySpecialAttribute)({entity:t,attributeType:r,value:i});return(0,_.set)(l,n,e)}{const t=EA(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,S.editAttribute)({entity:l,attributeType:r,uri:a,value:i});return(0,_.set)(t,s,e)}}return e}case ib.REMOVE_ATTRIBUTE:{const{attributeType:r,uri:n,viewId:a}=t.payload,i=(0,S.getBaseUri)(n),o=hA(a,i,e);if(o&&(0,S.isRelationUri)(i)){if((0,S.isActivenessAttrType)(r)){const t=(0,_.view)(o,e),n=(0,S.removeEntitySpecialAttribute)({entity:t,attributeType:r});return(0,_.set)(o,n,e)}{const t=EA(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,S.removeAttribute)({entity:o,attributeType:r,uri:n});return(0,_.set)(t,l,e)}}return e}case wC.SET_RELATION_ENTITY:{const{id:r,relationUri:n,entityInfo:a}=t.payload,i=gA(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 ib.ADD_DEFAULT_VALUES:{const{viewId:r,attributeType:n,parentUri:a,metadata:i,mode:o}=t.payload,l=(0,S.getBaseUri)(a);if((0,S.isRelationUri)(l)){const t=gA(r,l,e);if(t){if(n){const r=[...t,"relation","object"],l=(0,S.getAttributeTypeSubAttributes)(i,n);return(0,_.over)((0,_.lensPath)(r),(0,S.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,S.getRelationType)(i,l);return(0,_.over)((0,_.lensPath)(r),(0,S.addDefaultValuesToAttributes)({metadata:i,mode:o,attributeTypes:s,parentUri:a}),e)}}return e}return e}default:return e}},trees:(e=GA,t)=>(0,CA.ZP)(e,(r=>{switch(t.type){case Sb.MODE_UPDATED:{const{mode:e,silent:n}=t.payload;if(n)break;Object.keys(null==r?void 0:r.trees).forEach((e=>{DA(r.trees[e].root,"showDetails",!1)})),(0,S.isViewMode)(e)?(r.common.commands=[],r.initialTrees={}):(0,S.isEditableMode)(e)&&((0,S.isEmptyValue)(r.initialTrees)?r.initialTrees=YA({},r.trees):(r.common.commands=[],r.trees=YA({},r.initialTrees)));break}case Sb.MODE_EDITING_CANCELED:case bA.TREES_RESTORE_FROM_INITIAL_TREES:r.trees=YA({},r.initialTrees);break;case bA.TREES_RESET_INITIAL_TREES:r.initialTrees={};break;case ZC.ENTITY_LOADED:{const{silent:r}=t.payload;return r?e:GA}case bA.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 bA.TREE_LOADING:{const e=t.payload;r.trees[e]=r.trees[e]||{},r.trees[e].loading=!0;break}case bA.TREE_CHILDREN_LOADING:{const{id:e,parentId:n,nodeId:a}=t.payload,i=r.trees[e].root,o=(0,S.findNodeById)(i,n);o.pending=!1,o.children=(o.children||[]).concat({entity:{},loading:!0,nodeId:a});break}case bA.TREE_CHILDREN_LOADED:{const{children:e,id:n,parentId:a}=t.payload,i=r.trees[n].root,o=(0,S.findNodeById)(i,a);o&&(o.children=((e=[],t=[])=>{const r=(0,_.reject)((0,_.prop)("loading"))(e);return t.forEach((t=>{e.find((e=>(0,_.path)(["entity","uri"],e)===t.entity.uri))||r.push(t)})),r})(o.children,e),delete o.pending);break}case bA.TREE_NODE_REMOVED:{const{id:e,nodeId:n}=t.payload,a=r.trees[e].root,i=(0,S.findParentNodeById)(a,n);IA(i||a,n);break}case bA.TREE_NODE_CREATED:{const{id:e,parentId:n,node:a}=t.payload,i=r.trees[e].root,o=(0,S.findNodeById)(i,n)||i,l=o.children.length;NA(o,a,l);break}case bA.TREE_NODE_EDITED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,S.findNodeById)(a,n.nodeId),o=Object.keys(n);for(const e of o)i[e]=n[e];break}case bA.TREE_NODE_EDITING_STARTED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,S.findNodeById)(a,n.nodeId),o=(0,S.findParentNodeById)(a,n.nodeId);i&&o&&(i.editingMode=S.NODE_EDITING_MODES.editing,i.relatedEntity=o.entity,delete i.loading,i.initialConnection=kA(i),LA({id:e,draft:r.trees,node:i}));break}case bA.TREE_NODE_EDITING_APPLIED:{const{id:e,node:a}=t.payload,i=r.trees[e].root,o=(0,S.findNodeById)(i,a.nodeId),l=FA({id:e,draft:r.trees,relationUri:a.relation.uri});var n;o&&l&&(MA(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,jA({id:e,draft:r.trees,relationUri:a.relation.uri}));break}case bA.TREE_NODE_EDITING_CANCELED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,S.findNodeById)(a,n.nodeId);i&&(MA(i),jA({id:e,draft:r.trees,relationUri:n.relation.uri}));break}case bA.TREE_NODE_NEW_PARENT_EDITING_STARTED:{const{id:e,node:n,newNode:a}=t.payload,i=r.trees[e].root,o=(0,S.findNodeById)(i,n.nodeId);if(a.relatedEntity=o.entity,a.relatedNodeId=o.nodeId,a.editingMode=S.NODE_EDITING_MODES.addingParent,i===o)a.children=[i],r.trees[e].root=a;else{const e=(0,S.findParentNodeById)(i,n.nodeId),t=e.children.findIndex((e=>o===e));NA(e,a,t)}a.initialConnection=kA(a),LA({id:e,draft:r.trees,node:a});break}case bA.TREE_NODE_NEW_PARENT_EDITING_APPLIED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,S.findNodeById)(a,n.nodeId),o=(0,S.findNodeById)(a,n.relatedNodeId),l=FA({id:e,draft:r.trees,relationUri:n.relation.uri});i&&l&&(VA({id:e,draft:r.trees,currentNode:i}),o.parent=o.parent||[],o.parent.push(l.entity.uri),o.relations=o.relations||[],o.relations.push(l.relation),r.trees[e].entitiesMap=((e,t=[])=>_A(e,t.reduce(((e,t)=>wA({},e,{[t.entity.uri]:(0,_.pick)(["entity","parent","relations"],t)})),{})))(r.trees[e].entitiesMap,[o,HA(l)]),jA({id:e,draft:r.trees,relationUri:i.relation.uri}));break}case bA.TREE_NODE_NEW_PARENT_EDITING_CANCELED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,S.findNodeById)(a,n.nodeId);i&&(VA({id:e,draft:r.trees,currentNode:i}),jA({id:e,draft:r.trees,relationUri:i.relation.uri}));break}case bA.TREE_NODE_NEW_CHILD_EDITING_STARTED:{const{id:e,node:n,newNode:a}=t.payload,i=r.trees[e].root,o=(0,S.findNodeById)(i,n.nodeId);a.relatedEntity=o.entity,a.editingMode=S.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=kA(a),LA({id:e,draft:r.trees,node:a});break}case bA.TREE_NODE_NEW_CHILD_EDITING_APPLIED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,S.findParentNodeById)(a,n.nodeId),o=(0,S.findNodeById)(i,n.nodeId),l=FA({id:e,draft:r.trees,relationUri:n.relation.uri});i&&o&&l&&(MA(o),o.entity=l.entity,o.relation=l.relation,o.relations=[l.relation],jA({id:e,draft:r.trees,relationUri:n.relation.uri}));break}case bA.TREE_NODE_NEW_CHILD_EDITING_CANCELED:{const{id:e,node:n}=t.payload,a=r.trees[e].root,i=(0,S.findParentNodeById)(a,n.nodeId);i&&(IA(i,n.nodeId),jA({id:e,draft:r.trees,relationUri:n.relation.uri}));break}case bA.TREE_NODE_RELATION_TYPE_CHANGED:{const{id:e,node:n,relationTypeUri:a}=t.payload,i=FA({id:e,draft:r.trees,relationUri:n.relation.uri}).relation.type;i!==a&&(i&&UA({id:e,draft:r.trees,node:n,entity:null}),(({id:e,draft:t,node:r,relationTypeUri:n})=>{PA({path:["editingConnections",r.relation.uri,"relation"],object:t[e],value:e=>wA({},e,{type:n,attributes:{}})})})({id:e,draft:r.trees,node:n,relationTypeUri:a}));break}case bA.TREE_NODE_ENTITY_CHANGED:{const{id:e,node:n,entity:a}=t.payload;UA({id:e,draft:r.trees,node:n,entity:a});break}case ib.ADD_ATTRIBUTES:return t.payload.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a,viewId:i}=t,o=(0,S.getBaseUri)(n),l=BA(i,o,e.trees);if(l&&(0,S.isRelationUri)(o)){const t=(0,_.view)(l,e.trees);if((0,S.isActivenessAttrType)(r)){const n=(0,S.addEntitySpecialAttribute)({entity:t,attributeType:r});return YA({},e,{trees:(0,_.set)(l,n,e.trees)})}{const i=(0,S.addAttribute)({entity:t,attributeType:r,parentUri:n,index:a});return YA({},e,{trees:(0,_.set)(l,i,e.trees)})}}return e}),e);case ib.MODIFY_ATTRIBUTE:{const{attributeType:r,viewId:n,uri:a,value:i}=t.payload,o=(0,S.getBaseUri)(a),l=BA(n,o,e.trees);if(l&&(0,S.isRelationUri)(o)){const t=(0,_.view)(l,e.trees);if((0,S.isActivenessAttrType)(r)){const n=(0,S.editEntitySpecialAttribute)({entity:t,attributeType:r,value:i});return YA({},e,{trees:(0,_.set)(l,n,e.trees)})}{const n=(0,S.editAttribute)({entity:t,attributeType:r,uri:a,value:i});return YA({},e,{trees:(0,_.set)(l,n,e.trees)})}}return e}case ib.REMOVE_ATTRIBUTE:{const{attributeType:r,uri:n,viewId:a}=t.payload,i=(0,S.getBaseUri)(n),o=BA(a,i,e.trees);if(o&&(0,S.isRelationUri)(i)){const t=(0,_.view)(o,e.trees);if((0,S.isActivenessAttrType)(r)){const n=(0,S.removeEntitySpecialAttribute)({entity:t,attributeType:r});return YA({},e,{trees:(0,_.set)(o,n,e.trees)})}{const a=(0,S.removeAttribute)({entity:t,attributeType:r,uri:n});return YA({},e,{trees:(0,_.set)(o,a,e.trees)})}}return e}case ib.ADD_DEFAULT_VALUES:{const{viewId:r,attributeType:n,parentUri:a,metadata:i,mode:o}=t.payload,l=(0,S.getBaseUri)(a),s=BA(r,l,e.trees);if((0,S.isRelationUri)(l)&&s){if(n){const t=(0,S.getAttributeTypeSubAttributes)(i,n);return YA({},e,{trees:(0,_.over)(s,(0,S.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,S.getRelationType)(i,n);return YA({},e,{trees:(0,_.over)(t,(0,S.addDefaultValuesToAttributes)({metadata:i,mode:o,attributeTypes:l,parentUri:a}),e.trees)})}}return e}case bA.TREE_ENTITIES_MAPPING_LOADED:{const{id:e,entitiesSubMap:n}=t.payload,a=r.trees[e].entitiesMap;r.trees[e].entitiesMap=_A(a,n);break}case bA.TREE_LOADED:{const{tree:e,id:n,graphTypes:a,activenessDate:i,isReversed:o}=t.payload,l=zA(r.trees[n]||{});r.trees[n]=YA({},l,e,{graphTypes:a,activenessDate:i,isReversed:o}),delete r.trees[n].errorMessage,r.trees[n].loading=!1;break}case bA.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,S.mapTree)(r.trees[e].root,{childrenProcessing:(0,S.sortTreeChildren)({sortField:a,sortOrder:i,typesLabelsMap:n})}));break}case bA.TREE_SECONDARY_LABEL_SHOWN:{const{id:e,show:n}=t.payload;r.trees[e].showSecondaryLabel=n,r.trees[e].root=YA({},r.trees[e].root);break}case bA.TREES_STATE_RESTORED:{const e=t.payload;Object.keys(e).forEach((t=>{r.trees[t]=r.trees[t]||{},r.trees[t]=YA({},r.trees[t],e[t]),r.trees[t].root&&(r.trees[t].root=YA({},r.trees[t].root))}));break}case bA.TREE_CHANGED:{const{id:e,tree:n}=t.payload;r.trees[e].root=n;break}case bA.TREE_REFRESHED:{const e=t.payload;r.trees[e].root=YA({},r.trees[e].root);break}case bA.TREE_NODE_EXPANDED:{const{id:e,nodeId:n}=t.payload,a=r.trees[e].root;(0,S.findNodeById)(a,n).expanded=!0;break}case bA.TREE_CURRENT_ENTITY_SHOWN:{const{id:n,uri:a=(0,_.path)(["entity","uri"],e)}=t.payload;if(r.trees[n]){const e=RA(r.trees[n].root,a);r.trees[n].scrollTo=e}break}case bA.TREE_SCROLL_TO_NODE_RESET:{const e=t.payload;r.trees[e]&&(r.trees[e].scrollTo=null);break}case bA.TREE_ACTIVENESS_DATE_CHANGED:{const{id:e,activenessDate:n}=t.payload;r.trees[e].activenessDate=n;break}case bA.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,S.createRelationRepointCommand)({entityUri:l,relation:n,newEntityUri:s,isReversed:i});r.common.commands.push(c);break}case bA.TREE_RELATION_REMOVED:{const{relationUri:e}=t.payload;if((0,S.isTempUri)(e))r.common.commands=(0,_.reject)((0,S.isRelationCommandForUri)(e),r.common.commands);else{const t=(0,S.createRelationDeleteCommand)({relationUri:e});r.common.commands.push(t)}break}case bA.TREE_RELATION_CREATED:{const{entityUri:e,relation:n,parentEntityUri:a}=t.payload,i=(0,S.createRelationCreateCommand)({parentUri:a,relation:n,entityUri:e});r.common.commands.push(i);break}case bA.TREE_RELATION_EDITED:{const{oldRelation:e,newRelation:n,entityUri:a,newEntityUri:i,isReversed:o}=t.payload,l=i?(0,S.createRelationRepointCommand)({entityUri:a,newEntityUri:i,relation:n,isReversed:o}):(0,S.createRelationUpdateCommand)({oldRelation:e,newRelation:n});r.common.commands.push(l);break}case bA.TREE_COMMANDS_CLEARED:r.common.commands=[];break;case bA.TREE_CANCEL_CHILDREN_LOADING:{const{id:e,parentId:n}=t.payload,a=r.trees[e].root,i=(0,S.findNodeById)(a,n);i&&(i.pending=!0,delete i.expanded,delete i.children);break}}})),operation:(e=null,t)=>t.type===n_.PROFILE_OPERATION_UPDATE?t.payload:e,views:(e=null,t)=>t.type===E_.PROFILE_VIEWS_SET?t.payload:e,sidePanelViews:(e=Q_,t)=>t.type===X_.SIDE_PANEL_VIEWS_LOADED?t.payload:e,entityRelatedAttributes:(e=ZA,t)=>{switch(t.type){case qA.ENTITY_RELATED_ATTRIBUTES_ADDED:{const{attributeTypeUri:r,entityUri:n,attributes:a}=t.payload;return(0,_.assocPath)([r,n],a,e)}case Sb.MODE_UPDATED:{const{mode:r,silent:n}=t.payload;return(0,S.isViewMode)(r)&&!n?ZA:e}default:return e}},hiddenAttributes:(e=rI,t)=>{switch(t.type){case J_.HIDDEN_ATTRIBUTES_UPDATED:{const{uri:r,hiddenAttributes:n}=t.payload;return(0,_.assoc)(r,n,e)}case J_.HIDDEN_ATTRIBUTES_RESET:return(0,_.dissoc)(t.payload,e);default:return e}},controlAttributes:(e=iI,t)=>t.type===nI.CONTROL_ATTRIBUTES_UPDATED?t.payload:e}),lI={getModule:()=>({id:"mdm",reducerMap:{dataTenants:KE,tenants:QE,metadata:ab,profile:oI,tenant:QT,environment:iO,user:WT,ui:HT,search:nv},sagas:[...Jw,...qC,...K_,...Jb]}),selectors:c},sI=lI,cI=({className:e})=>{const t=(0,yp.useDispatch)(),r=(0,yp.useSelector)(Ri.qx),n=(0,yp.useSelector)(sI.selectors.getGoogleMapKey),a=(0,b.useMemo)((()=>((e,t)=>(0,_.when)((0,_.always)(!t),(0,_.reject)((0,_.propEq)("id",Z.om.MAP)))(e))([{id:Z.om.MAP,tooltipTitle:li().text("View map"),Icon:qE()},{id:Z.om.PROFILE,tooltipTitle:li().text("View entity details"),Icon:WE()}],n)),[n]);return v().createElement(kE,{className:e,modes:a,modeId:r,onChange:e=>{t(Ci(r!==e?e:null))}})};cI.propTypes={className:fp().string};const uI=cI,pI=()=>v().createElement("div",{className:Sd},v().createElement("div",{className:"Headers-styles-title--TvsMA"},li().text("Profiles")),v().createElement("div",{className:xd},v().createElement(HE,null),v().createElement(uI,{className:Cd})));var dI=r(12932),mI=r.n(dI),fI=r(83754),yI=r.n(fI);const gI=(0,Rp.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 hI(){return hI=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},hI.apply(null,arguments)}function EI(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}const bI=e=>{let{value:t,tabs:r=[],onChange:n,tabClasses:a}=e,i=EI(e,["value","tabs","onChange","tabClasses"]);const o=gI(),l=(e,t)=>v().createElement("span",{className:o.labelWrapper},v().createElement(sd.Y,{value:e},v().createElement("span",{className:o.label},e)),t);return v().createElement(mI(),hI({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=EI(e,["label","value","additionalLabel","dataReltioId"]);return v().createElement(yI(),hI({classes:a||{root:o.tabRoot,disabled:o.disabled},key:r,value:r,label:l(t,n),"data-reltio-id":i},s))})))};function vI(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class TI extends b.PureComponent{constructor(...e){super(...e),this.getTabsData=()=>{const{tenantObject:e,tableViewTabs:t,selectedEntityTypes:r,metadata:n}=this.props,a=(0,Ey.ZK)(t,e);return(0,Ai.nx)(n,a,r).map((e=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){vI(e,t,r[t])}))}return e}({},e,{additionalLabel:v().createElement("span",{className:"Headers-styles-number--trErH"},"(",void 0===e.number?li().text("N/A"):(0,ni.k7)(e.number),")")})))},this.onTabChange=e=>{this.props.dispatch(bi(e))},this.onSelectColumns=e=>{const{dispatch:t,entityTypeTab:r,columnsForEntityType:n}=this.props;return t(Ei(r,e,n))},this.renderTabs=()=>{const{entityTypeTab:e}=this.props;return v().createElement("div",{className:"Headers-styles-tabsContainer--lhDXc"},v().createElement(bI,{value:e,tabs:this.getTabsData(),onChange:this.onTabChange}))}}render(){const{entityTypeTab:e,columnsForEntityType:t}=this.props;return v().createElement("div",{className:Sd},this.renderTabs(),v().createElement("div",{className:xd},v().createElement(Rd,{entityTypeUri:e,headColumns:t,onSelectColumns:this.onSelectColumns,"data-reltio-id":"reltio-search-table-add-remove-column",disabled:!e,showForDisabled:!0}),v().createElement(_f(),{orientation:"vertical",className:"Headers-styles-splitter--sCvn6"}),v().createElement(HE,null),v().createElement(uI,{className:Cd})))}}const OI=(0,yp.connect)((e=>{const t=(0,Ri.o4)(e);return{metadata:k().selectors.getMetadata(e),selectedEntityTypes:(0,P.DX)(e),tableViewTabs:(0,Ri.gu)(e),entityTypeTab:t,columnsForEntityType:(0,Ri.Gv)(e,t),tenantObject:(0,ai.t9)(e)}}))(TI);function SI(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class xI extends v().PureComponent{constructor(...e){super(...e),this.entitiesTableRef=this.props.basicTableRef||v().createRef(),this.state={resizeDebounceDelay:void 0},this.sortHandle=({field:e,order:t})=>{this.props.dispatch((({field:e,order:t,entityTypeUri:r})=>({type:U.Z.CHANGE_SORT,payload:{field:e,order:t,entityTypeUri:r}}))({field:t?e:null,order:t,entityTypeUri:this.props.entityTypeUri}))},this.reorderingHandle=({what:e,where:t})=>{const{entityTypeUri:r,dispatch:n,headColumns:a}=this.props;n(((e,t)=>({type:Se,payload:{entityTypeUri:e,columns:t}}))(r,(0,_.move)(e.columnIndex,t.columnIndex,a)))},this.changeColumnsListHandle=({columns:e})=>{const{entityTypeUri:t,dispatch:r,headColumns:n}=this.props;r(Ei(t,e,n))},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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){SI(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:xe,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(sf,{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})}}xI.propTypes={entities:fp().array,entityToHighlight:fp().string,selectedEntityUri:fp().string,headColumns:fp().array,onScroll:fp().func,entityTypeUri:fp().string,sortField:fp().string,sortOrder:fp().oneOf([_d.oy,_d.U9]),dndColumnReorderingEnabled:fp().bool,dispatch:fp().func,additionalColumns:fp().arrayOf(fp().shape({id:fp().string,label:fp().string})),onEntityClick:fp().func,onEntityHover:fp().func,entitiesImportStatus:fp().object,onEntityImportStatusChange:fp().func,basicTableRef:fp().shape({current:fp().object})},xI.defaultProps={entities:[],headColumns:[]};const CI=(0,jf.Z)(Ai.oq),wI=(0,yp.connect)((e=>{const t=(0,Ri.tB)(e),r=(0,Ri.Gv)(e,t),n=k().selectors.getMetadata(e),a=CI(n,t,r);return{sortField:(0,ai.NW)(e,{entityTypeUri:(0,Ri.o4)(e)}),sortOrder:(0,ai.L9)(e,{entityTypeUri:(0,Ri.o4)(e)}),dndColumnReorderingEnabled:!(0,Ri.Ue)(e),headColumns:r,entityTypeUri:t,additionalColumns:a}}))(xI);var AI=r(14058),RI=r.n(AI);const _I=(0,Rp.Z)((()=>({container:{position:"relative",height:"100%",width:"100%"},closeButton:{position:"absolute",top:"7px",left:"7px",zIndex:1}}))),II=(0,Rp.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"}}}))),NI=({className:e,entity:t,children:r,classes:n,renderLabel:a=_.identity})=>{const i=II({classes:n}),o=(0,w.AH)(),l=(0,w.QQ)(),s=(0,b.useCallback)((()=>{navigator.clipboard.writeText((0,S.getEntityId)(t))}),[t]);if((0,_.isNil)(t))return null;const c=(0,S.getLabel)(t.label),u=t.secondaryLabel,p=(0,S.getBusinessCardAttributesText)(o,t),d=(0,S.isActiveObject)(t),m=t.uri,f=(0,S.getEntityId)(t);return v().createElement("div",{className:O()(i.profileBandWrapper,e),"data-reltio-id":"reltio-profile-band"},v().createElement("div",{className:O()(i.profileBand,{[i.inactive]:!d}),"data-entity-uri":m},v().createElement(A,{key:t.uri,entity:t,avatarClassName:i.profileIcon,imageClassName:i.imageProfileIcon}),v().createElement("div",{className:i.profileInfo},v().createElement("div",null,v().createElement(Tf(),{variant:"h6",className:i.label},a(c)),u&&v().createElement(Tf(),{variant:"subtitle2",className:i.secondaryLabel},u),p&&v().createElement(Tf(),{variant:"subtitle1",className:i.businessCard},p)),v().createElement("div",{className:i.specialInfo},v().createElement("div",{className:i.entityType},v().createElement(uE,{entity:t,size:"medium",className:i.badge}),!(0,S.isTempUri)(m)&&l&&v().createElement(ag(),{title:li().text("Copy to clipboard")},v().createElement(Tf(),{display:"inline",variant:"body2",className:i.entityId,onClick:s},li().text("Entity ID"),": ",f))))),r&&v().createElement("div",null,r)))},PI=v().createContext(!1);PI.displayName="BlockImageGalleryDialogContext";var DI=r(31574),kI=r.n(DI);const LI=v().createContext([]);var UI=r(24436),jI=r.n(UI);function FI(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){MI(e,t,r[t])}))}return e}function MI(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const VI=(0,Rp.Z)((e=>({basicViewPaper:FI({display:"flex",flexDirection:"column"},e.basicView)})));function BI(){return BI=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},BI.apply(null,arguments)}const zI=(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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["children","className"]);const i=VI();return v().createElement(jI(),BI({ref:t,className:n,classes:{root:i.basicViewPaper}},a),r)}));zI.displayName="BasicView";var HI=r(52574);const YI="1px solid #AFD4E9",WI=(0,Rp.Z)({decorator:{marginLeft:8,borderLeft:YI,"&:last-child":{borderLeft:"none","&:before":{borderLeft:YI}},"&:before":{top:0,height:14,width:5,borderBottom:YI,content:'""',display:"block",left:"0"},"&$plain":{"&:before":{width:0}}},plain:{},wrapper:{marginLeft:16,marginTop:-8}}),GI=({className:e,children:t,plain:r=!1,enabled:n=!1})=>{const a=WI();return n?v().createElement("div",{"data-reltio-id":"branch-decorator",className:O()(a.decorator,{[a.plain]:r},e)},v().createElement("div",{className:a.wrapper},t)):v().createElement(v().Fragment,null,t)},qI="commentsContainerVisibilityArea",ZI=v().createContext([]);ZI.displayName="RelatedObjectUrisContext";const $I={comments:[],commentsMap:null,currentComment:null,updateCommentState:_.identity,clearCommentState:_.identity,getCommentState:()=>({}),getComment:_.identity,getComments:()=>new Promise(_.identity),getCommentsCount:_.identity,createComment:()=>new Promise(_.identity),editComment:()=>new Promise(_.identity),createReply:()=>new Promise(_.identity),resolveThread:_.identity,reOpenThread:_.identity,clearCurrentComment:_.identity,deleteComment:_.identity,sending:!1,loading:!1,pageToken:null,deleteReply:_.identity,editReply:()=>new Promise(_.identity)},KI=v().createContext($I);function XI(){return XI=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},XI.apply(null,arguments)}KI.displayName="CollaborationContext";const QI=e=>v().createElement("svg",XI({width:20,height:20,fillOpacity:.54,fill:"#000",fillRule:"nonzero",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgCommentBubble"},e),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"})),JI=(0,Rp.Z)((()=>({root:{position:"relative",height:"18px",display:"flex",alignItems:"center",justifyContent:"center",marginLeft:"4px",cursor:"pointer"},icon:{"&:hover":{fillOpacity:.7}}})));function eN(){return eN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},eN.apply(null,arguments)}const tN=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["children","tooltipTitle","icon","onClick","className"]);const s=JI();return v().createElement(ag(),{title:n},v().createElement("div",eN({ref:t,className:O()(s.root,o),onClick:i},l),v().createElement(a,{className:s.icon}),r))}));tN.displayName="BasicCommentButton";const rN=(0,Rp.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"}}),nN=v().forwardRef((({children:e,onClick:t},r)=>{const n=rN();return v().createElement(tN,{ref:r,tooltipTitle:li().text("Show comment"),icon:QI,onClick:t,"data-reltio-id":"reltio-comment-button"},v().createElement("div",{className:n.childrenWrapper},e))}));function aN(){return aN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},aN.apply(null,arguments)}nN.displayName="CommentButton";const iN=e=>v().createElement("svg",aN({width:20,height:20,fillOpacity:.54,fill:"#000",fillRule:"nonzero",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgAddComment"},e),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"})),oN=({className:e,onClick:t})=>v().createElement(tN,{className:e,onClick:t,tooltipTitle:li().text("Add comment"),icon:iN});var lN=r(94511),sN=r.n(lN),cN=r(59674);const uN=(0,Rp.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 pN(){return pN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},pN.apply(null,arguments)}const dN=e=>{let{children:t,className:r,classes:n,transition:a}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["children","className","classes","transition"]);const o=uN(),l=a?sN():v().Fragment,[s,c]=(0,b.useState)(null);return v().createElement(cN.r,pN({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),(({TransitionProps:e})=>v().createElement(l,e,v().createElement(jI(),{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 mN=r(93526),fN=r.n(mN);const yN=(0,Rp.Z)((e=>({menuItem:{minHeight:"32px"},menuText:{color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px",letterSpacing:0}}))),gN=(0,cd.T)($p()),hN=(0,b.forwardRef)((({item:e,onMenuClose:t=_.identity},r)=>{const n=yN(),{disabled:a,text:i,tooltip:o,onClick:l,id:s="",selectable:c,selected:u}=e;return v().createElement(gN,{tooltipTitle:o,showForDisabled:!0,classes:{root:n.menuItem},onClick:e=>{t(e),l(e)},disabled:a,ref:r,"data-modal":!0,"data-reltio-id":`reltio-search-menu-item${s}`},c&&v().createElement(qp(),{checked:u,color:"primary"}),v().createElement(Tf(),{classes:{root:n.menuText}},i))}));hN.displayName="DefaultMenuItemRenderer";const EN=(0,Rp.Z)((e=>({buttonRoot:{"&$selected":{color:e.palette.action.active,backgroundColor:(0,Rm.alpha)(e.palette.action.active,.12),"&:hover":{backgroundColor:(0,Rm.alpha)(e.palette.action.active,.15)}}},selected:{},paper:{minWidth:"112px"}})));function bN(){return bN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},bN.apply(null,arguments)}function vN({className:e,menuId:t,buttonComponent:r=qh(),buttonContent:n,menuItems:a=[],buttonProps:i={},popoverProps:o={},onMenuOpen:l=_.identity,onMenuClose:s=_.identity,MenuItemRenderer:c=hN}){const u=r,p=EN(),d=(0,b.useRef)(),[m,f]=(0,b.useState)(!1);(0,fE.D)((()=>{m?l():s()}),[m]);const y=(0,b.useCallback)((e=>{null==e||e.stopPropagation(),f((e=>!e))}),[]);return v().createElement(v().Fragment,null,v().createElement(u,bN({"data-reltio-id":"drop-down-menu-button",ref:d,className:O()(p.buttonRoot,{[p.selected]:m},e),onClick:y,"aria-pressed":m,"aria-controls":m?t:void 0,"aria-haspopup":"true"},i),n),v().createElement(fN(),bN({id:t,variant:"menu",open:m,autoFocus:!1,classes:{paper:p.paper},anchorEl:d.current,onClose:y,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},elevation:2,MenuListProps:{autoFocusItem:m}},o),a.map(((e,t)=>v().createElement(c,{item:e,key:t,onMenuClose:y})))))}const TN=(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])},ON=(e,t)=>{const r=e.relatedObjectUris.indexOf(t);if(r>=0)return e.relatedObjectUris[1-r]},SN=e=>`${li().date(e,"LT")} ${li().date(e,"LL")}`,xN=e=>`comment/${e.commentId}`,CN=(e,t)=>`comment/${e.commentId}/reply/${t.replyId}`,wN=(e,t)=>{let r=e;for(const e of t)r=r.split(`+${e}`).join(`@[${e}](${e})`);return r},AN=v().createContext({});AN.displayName="EntitiesMapContext";const RN=(0,Rp.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 _N(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const IN=({comment:e,className:t})=>{const r=RN(),n=(0,b.useContext)(AN),a=(0,w.AH)(),i=(0,w.eh)();return v().createElement(kI(),{className:t},(()=>{switch(e.objectType){case S.CollaborationObjectTypes.ENTITY_ATTRIBUTE:{const t=(0,S.getAttributeTypeUriByValueUri)(e.objectId,i.type),n=(0,S.findAttributeTypeByUri)(a,t);return v().createElement(v().Fragment,null,v().createElement(Tf(),{className:r.title},li().text("Selected attribute:")),v().createElement(Tf(),{className:r.label},null==n?void 0:n.label))}case S.CollaborationObjectTypes.RELATION_ATTRIBUTE:{const t=e.relatedObjectUris.find((0,_.startsWith)("configuration/relationTypes")),n=t&&(0,S.getAttributeTypeUriByValueUri)(e.objectId,t),i=n&&(0,S.findAttributeTypeByUri)(a,n);return v().createElement(v().Fragment,null,v().createElement(Tf(),{className:r.title},li().text("Selected attribute:")),v().createElement(Tf(),{className:r.label},null==i?void 0:i.label))}case S.CollaborationObjectTypes.ENTITY:return v().createElement(v().Fragment,null,v().createElement(Tf(),{className:r.title},li().text("Selected profile:")),v().createElement(Bd,{className:O()(r.label,r.link),value:(0,S.getEntityUriForLink)(i)},(0,S.getLabel)(i.label)));case S.CollaborationObjectTypes.RELATION:{const t=ON(e,i.uri),a=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){_N(e,t,r[t])}))}return e}({},n[t]||{},{uri:t});return v().createElement(v().Fragment,null,v().createElement(Tf(),{className:r.title},li().text("Selected relation:")),v().createElement(Tf(),{className:r.label},v().createElement(Bd,{className:r.link,value:(0,S.getEntityUriForLink)(i)},(0,S.getLabel)(i.label)),t&&v().createElement(v().Fragment,null,` ${li().text("to")} `,v().createElement(Bd,{className:r.link,value:(0,S.getEntityUriForLink)(a)},a.label?(0,S.getLabel)(a.label):(0,S.getEntityId)(a)))))}case S.CollaborationObjectTypes.POTENTIAL_MATCH:{var t;const a=ON(e,i.uri),o={uri:a,label:null===(t=n[a])||void 0===t?void 0:t.label};return v().createElement(v().Fragment,null,v().createElement(Tf(),{className:r.title},li().text("Selected potential match:")),v().createElement(Tf(),{className:r.label},v().createElement(Bd,{className:r.link,value:(0,S.getEntityUriForLink)(i)},(0,S.getLabel)(i.label)),a&&v().createElement(v().Fragment,null,` ${li().text("and")} `,v().createElement(Bd,{className:r.link,value:(0,S.getEntityUriForLink)(o)},o.label?(0,S.getLabel)(o.label):(0,S.getEntityId)(o)))))}default:return null}})())},NN=v().createContext([]);NN.displayName="UsersContext";const PN=(0,Rp.Z)((e=>({root:{color:e.palette.text.primary,fontSize:"13px",lineHeight:"15px",wordBreak:"break-word"}}))),DN=({comment:e,className:t})=>{const r=PN(),n=(0,b.useContext)(NN);return v().createElement(Tf(),{className:O()(r.root,t)},((e,t,r=(e=>e),n="+")=>{const a=[];let i="",o=!1;for(let l=0;l<=e.length;l++){const s=e[l],c=e[l+1],u=l===e.length-1;i+=s,s===n&&0===l&&(o=!0),o&&t.includes(i.slice(n.length))&&(o=!1,a.push(r(i)),i=""),c===n&&(o=!0,a.push(i),i=""),u&&a.push(i)}return a})(e.content,e.namedUsers,(e=>{const t=n.find((t=>t.username===e.slice(1)));return t?v().createElement(ny(),{href:`mailto:${t.email}`,underline:"hover"},e):e})).map(((e,t)=>v().createElement(b.Fragment,{key:t},e))))},kN=(0,Rp.Z)((e=>({root:{width:"32px",height:"32px",fontSize:"12px",color:e.palette.text.secondary,backgroundColor:"rgba(144, 164, 174, 0.2)"}})));function LN(){return LN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},LN.apply(null,arguments)}const UN=e=>{let{className:t,children:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","children"]);const a=kN();return v().createElement(C(),LN({},n,{className:O()(a.root,t)}),r.split(".").map((e=>e[0].toUpperCase())).join(""))};var jN=r(2271);const FN=r(47503).$+1,MN=(0,Rp.Z)((e=>({root:{backgroundColor:"#fff",fontFamily:"Roboto"},mentionsControl:{fontSize:"13px"},mentionsHighlighter:{padding:"10px 22px",border:"1px solid transparent !important","&::before":{content:({placeholder:e})=>e&&`"${e}"`}},mentionsInput:{borderRadius:"2px",border:"1px solid rgba(0,0,0,0.12)",padding:"10px 22px",outline:0,overflow:"auto !important"},mentionsSuggestions:{padding:"8px 0",zIndex:FN+"!important",borderRadius:"4px",backgroundColor:"#fafafa !important",boxShadow:"0 2px 2px 0 rgba(0,0,0,0.14), 0 3px 1px -2px rgba(0,0,0,0.12), 0 1px 5px 0 rgba(0,0,0,0.2)"},mentionsSuggestionsList:{maxHeight:"200px",overflowY:"scroll"},mentionsSuggestionsItem:{padding:"6px 12px",color:e.palette.text.primary,fontSize:"13px",transition:e.transitions.create(["background-color"]),"&:hover":{backgroundColor:"rgba(0,0,0,0.04)"}},mentionsSuggestionsItemFocused:{backgroundColor:"rgba(0,0,0,0.04)"},mention:{position:"relative",zIndex:1,color:e.palette.primary.main,textShadow:"1px 1px 1px white, 1px -1px 1px white, -1px 1px 1px white, -1px -1px 1px white",pointerEvents:"none"}})));function VN(){return VN=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},VN.apply(null,arguments)}const BN=e=>{let{onChange:t,className:r,value:n,placeholder:a}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["onChange","className","value","placeholder"]);const o=MN({placeholder:n?"":a}),l=(0,b.useContext)(NN);return v().createElement("div",{className:O()(o.root,r)},v().createElement(jN.r,VN({},i,{value:n,placeholder:a,onChange:(e,r,n,a)=>{t(r,n,(0,_.uniq)(a.map((({display:e})=>e.slice(1)))))},className:"mentionsTextArea",suggestionsPortalHost:document.body,allowSuggestionsAboveCursor:!0,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,"mentionsTextArea__suggestions__item--focused":o.mentionsSuggestionsItemFocused}}),v().createElement(jN.p,{trigger:"+",data:l.map((({username:e})=>({id:e,display:e}))),displayTransform:(e,t)=>`+${t}`,appendSpaceOnAdd:!0,className:o.mention})))},zN=(0,Rp.Z)({root:({isEditing:e})=>({padding:e?"6px 6px 6px 0":" 6px 6px 6px 8px",borderRadius:"4px",backgroundColor:e?"transparent":"rgba(0,114,206,0.06)"}),textField:({isEditing:e})=>({width:e?"100%":"calc(100% - 40px)"}),form:{marginBottom:0},main:{display:"flex",alignItems:"center"},avatar:{marginRight:"8px"},buttons:({isEditing:e})=>({marginLeft:e?"0":"40px",marginTop:"8px"}),button:{"& + $button":{marginLeft:"8px"}}}),HN=e=>{switch(e){case"open":return li().text("Reply...");case"resolved":return li().text("Adding a comment will re-open this");default:return""}},YN=({inputRef:e,className:t,uri:r,relatedObjectUris:n,objectType:a,popperRef:i,comment:o,reply:l,isEditingComment:s,isEditingReply:c,onCancel:u})=>{const p=s||c,d=zN({isEditing:p}),[m,f]=(0,b.useState)(!1),{createReply:y,createComment:g,sending:h,editComment:E,editReply:T,getCommentState:S,updateCommentState:x,clearCommentState:C}=(0,b.useContext)(KI),A=(0,w.qg)(),R=(({comment:e,reply:t,isEditingComment:r,isEditingReply:n})=>(0,_.isNil)(e)?"comment/new":r?xN(e):n?CN(e,t):(e=>`comment/${e.commentId}/reply/new`)(e))({comment:o,reply:l,isEditingComment:s,isEditingReply:c}),I=(({comment:e,reply:t,isEditingComment:r,isEditingReply:n})=>{const a=r?e:n?t:null,{content:i="",namedUsers:o=[]}=a||{};return{value:wN(i,o),plainTextValue:i,mentions:o}})({comment:o,reply:l,isEditingComment:s,isEditingReply:c}),{value:N=I.value,plainTextValue:P=I.plainTextValue,mentions:D=I.mentions}=S(r,R),k=""!==I.value.trim(),L=""!==N.trim(),U=m||L||k,j=null==o?void 0:o.status,F=()=>{null==u||u(),C(r,R)};(0,b.useEffect)((()=>{i&&i.current.forceUpdate()}),[i,U]);const M=p?"small":"medium";return v().createElement(kI(),{className:O()(d.root,t)},v().createElement("form",{onSubmit:e=>(e.preventDefault(),(0,_.cond)([[(0,_.always)(!o),()=>g({content:P,namedUsers:D,objectType:a,uri:r,relatedObjectUris:n})],[(0,_.always)(s),()=>E({content:P,namedUsers:D,commentId:o.commentId,objectType:a,replies:o.replies,relatedObjectUris:n,uri:r})],[(0,_.always)(c),()=>T({content:P,namedUsers:D,commentId:o.commentId,replyId:l.replyId})],[_.T,()=>y({content:P,namedUsers:D,commentId:o.commentId,action:"open"===o.status?"none":"reopen",uri:r})]])().then(F).catch(console.log)),className:d.form},v().createElement(kI(),{className:d.main},!p&&v().createElement(UN,{classes:{root:d.avatar}},A),v().createElement(BN,{className:d.textField,disabled:h,onChange:(e,t,n)=>x(r,R,{value:e,plainTextValue:t,mentions:n}),inputRef:e,value:N,onFocus:()=>f(!0),onBlur:()=>f(!1),placeholder:HN(j)})),U&&v().createElement(kI(),{className:d.buttons},v().createElement(qh(),{className:d.button,variant:"contained",color:"primary",disabled:!L||h,type:"submit",size:M},((e,t,r)=>t||r?li().text("Edit"):"open"===e||"resolved"===e?li().text("Reply"):li().text("Comment"))(j,s,c)),v().createElement(qh(),{disabled:h,onClick:()=>F(),className:d.button,variant:"outlined",color:"primary",size:M},li().text("Cancel")))))},WN=(0,Rp.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"}}))),GN=({onReply:e,className:t,uri:r,comment:n,relatedObjectUris:a,objectType:i})=>{const o=WN(),l=(0,b.useRef)(),s=(0,w.qg)(),{commentId:c,createdBy:u,createdTime:p,status:d}=n,m="resolved"===d,f=u===s,{resolveThread:y,reOpenThread:g,sending:h,deleteComment:E,updateCommentState:T,getCommentState:O}=(0,b.useContext)(KI),S=xN(n),{isEditing:x}=O(r,S),C=(0,b.useCallback)((e=>T(r,S,{isEditing:e})),[S,T,r]);TN(l,x);const A=(0,b.useMemo)((()=>m?[{text:li().text("Delete"),onClick:()=>E({uri:r,commentId:c})}]:[{text:li().text("Edit"),onClick:()=>C(!0)},{text:li().text("Delete"),onClick:()=>E({uri:r,commentId:c})}]),[c,E,m,C,r]),R=v().createElement(YN,{inputRef:l,uri:r,relatedObjectUris:a,objectType:i,onCancel:()=>C(!1),isEditingComment:x,comment:n});return v().createElement(kI(),{className:t},v().createElement(kI(),{className:o.header},v().createElement(UN,{classes:{root:o.avatar}},u),v().createElement(kI(),{width:"100%"},v().createElement(Tf(),{className:o.username},u)),v().createElement(Tf(),{className:o.createdAt},SN(p)),f&&v().createElement(vN,{buttonComponent:vd.k,buttonProps:{icon:kd(),tooltipTitle:li().text("Open menu")},popoverProps:{PopoverClasses:{root:o.dropdownMenu}},menuItems:A,menuId:"collaboration-comment-menu"})),v().createElement(kI(),{className:o.body},v().createElement(IN,{comment:n,className:o.commentTarget}),x?R:v().createElement(DN,{comment:n,className:o.message}),v().createElement(kI(),{className:o.buttons},v().createElement(ny(),{className:o.button,onClick:e,component:"button",underline:"hover"},li().text("Reply")),!m&&v().createElement(ny(),{disabled:h,className:o.button,onClick:()=>{y({commentId:c,uri:r})},component:"button",underline:"hover"},li().text("Resolve")),m&&v().createElement(ny(),{disabled:h,className:o.button,onClick:()=>{g({commentId:c,uri:r})},component:"button",underline:"hover"},li().text("Re-open")))))},qN=(0,Rp.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"}}))),ZN=({className:e,reply:t,uri:r,comment:n,popperRef:a})=>{const i=(0,b.useRef)(),o=(0,w.qg)(),{createdBy:l,action:s,createdTime:c}=t,u=l===o&&"resolved"!==n.status,{deleteReply:p,updateCommentState:d,getCommentState:m}=(0,b.useContext)(KI),f=CN(n,t),{isEditing:y}=m(r,f),g=(0,b.useCallback)((e=>d(r,f,{isEditing:e})),[f,d,r]);TN(i,y);const h=qN(),E=(0,b.useMemo)((()=>[{text:li().text("Edit"),onClick:()=>g(!0)},{text:li().text("Delete"),onClick:()=>p({uri:r,commentId:n.commentId,reply:t})}]),[p,r,n.commentId,t,g]),T=v().createElement(YN,{inputRef:i,popperRef:a,uri:r,onCancel:()=>g(!1),isEditingReply:y,reply:t,comment:n});return v().createElement(kI(),{className:O()(h.root,e)},v().createElement(UN,{classes:{root:h.avatar}},l),v().createElement(kI(),{className:h.replyArea},v().createElement(kI(),{className:h.header},v().createElement(Tf(),{className:h.username},l),"resolve"===s&&v().createElement(Tf(),{className:h.marked},li().text("Marked as resolved")),"reopen"===s&&v().createElement(Tf(),{className:h.marked},li().text("Re-opened"))),"resolve"!==s&&(y?T:v().createElement(DN,{className:h.message,comment:t})),v().createElement(Tf(),{className:h.createdAt},SN(c))),u&&v().createElement(vN,{buttonComponent:vd.k,buttonProps:{icon:kd(),tooltipTitle:li().text("Open menu")},menuItems:E,menuId:"collaboration-comment-menu"}))},$N=(0,Rp.Z)((()=>({root:{maxWidth:"100%",padding:"8px 4px 10px 16px"},messages:{},repliedComment:{marginBottom:"2px"},replies:{marginLeft:"40px"},sendMessageArea:{marginLeft:"40px"},comment:{}}))),KN=(0,b.memo)((({uri:e,relatedObjectUris:t,objectType:r,classes:n,popperRef:a,messagesRef:i,comment:o})=>{const l=(0,b.useRef)(),s=$N({classes:n}),c=v().createElement(YN,{className:s.sendMessageArea,inputRef:l,popperRef:a,uri:e,relatedObjectUris:t,objectType:r,comment:o});return v().createElement(kI(),{className:s.root},o&&v().createElement(v().Fragment,null,v().createElement("div",{className:s.messages,ref:i},v().createElement(GN,{comment:o,uri:e,onReply:()=>{l.current.focus()},className:s.comment,relatedObjectUris:t,objectType:r}),v().createElement(kI(),{className:s.replies},o.replies.map((t=>v().createElement(ZN,{key:t.replyId,className:s.repliedComment,reply:t,uri:e,comment:o}))))),c),!o&&c)})),XN=(0,Rp.Z)((e=>({root:{},header:{display:"flex",alignItems:"center",height:"48px",paddingLeft:"16px",paddingRight:"8px"},headerInfo:{marginRight:"auto",display:"flex",alignItems:"center"},title:{marginRight:"15px",color:e.palette.text.primary,fontSize:"16px"},counter:{paddingLeft:"15px",borderLeft:"1px solid rgba(0,0,0,0.12)",color:e.palette.text.secondary,fontSize:"14px",lineHeight:"24px"},resolveButton:{zIndex:3e3,"&:hover":{backgroundColor:"transparent"}},popper:{width:"424px",borderRadius:"0 0 4px 4px"},collaborationItem:{padding:"0 0 10px 0"},comment:({hasScroll:e})=>({marginLeft:"16px",marginRight:e?"2px":"8px"}),replies:({hasScroll:e})=>({marginLeft:"8px",marginRight:e?"2px":"8px"}),sendMessageArea:({hasScroll:e,scrollWidth:t})=>({marginLeft:"8px",marginRight:e?t+2:"8px"}),messages:{maxHeight:"400px",overflowY:"auto"}}))),QN=({uri:e,relatedObjectUris:t,objectType:r,anchorEl:n,onClose:a,open:i,comment:o})=>{const[l,s]=(0,b.useState)(0),c=XN({scrollWidth:l,hasScroll:0!==l}),u=(0,b.useRef)(null),{resolveThread:p,loading:d,sending:m}=(0,b.useContext)(KI),f=1+(null==o?void 0:o.replies.length);return v().createElement(dN,{popperRef:u,anchorEl:n,open:i,placement:"right-start",onClose:a,className:c.popper},v().createElement(kI(),{className:c.header},v().createElement(kI(),{className:c.headerInfo},v().createElement(Tf(),{className:c.title},li().text("Comments")),o&&!d&&v().createElement(Tf(),{className:c.counter},li().number(f)," ",1===f?li().text("item"):li().text("items"))),o&&!d&&v().createElement(vd.k,{className:c.resolveButton,size:"S",onClick:()=>{p({commentId:o.commentId,uri:e})},disabled:m,showForDisabled:!0,tooltipTitle:li().text("Resolve"),icon:Em(),color:"primary"})),!d&&v().createElement(KN,{popperRef:u,messagesRef:e=>{e&&s(e.offsetWidth-e.clientWidth)},classes:{root:c.collaborationItem,replies:c.replies,sendMessageArea:c.sendMessageArea,messages:c.messages,comment:c.comment},uri:e,relatedObjectUris:t,objectType:r,comment:o}))},JN=(0,Rp.Z)((()=>({root:{display:"flex",alignItems:"start"},addButton:{visibility:"hidden","&$showAlways":{visibility:"visible"},".commentsContainerVisibilityArea:hover &":{visibility:"visible"}},showAlways:{}}))),eP=({className:e,uri:t,objectType:r,relatedObjectUris:n,onChangePopupVisibility:a,allowOnlyOneComment:i=!1,showAlways:o=!1})=>{const l=JN(),[s,c]=(0,b.useState)(null),[u,p]=(0,b.useState)(!1),d=u&&Boolean(s),{currentComment:m,commentsMap:f,getComment:y,clearCurrentComment:g,objectTypes:h}=(0,b.useContext)(KI),E=!!f&&(!h||h.includes(r)),T=((null==f?void 0:f[t])||[]).filter((({status:e})=>"resolved"!==e)).reverse(),S=!i||i&&0===T.length,x=null===m&&d;(0,fE.D)((()=>{a&&a(d)}),[d]);const C=(0,b.useContext)(ZI),w=(0,b.useMemo)((()=>C?[...n,...C]:n),[C,n]);return E&&v().createElement("div",{className:O()(l.root,e)},S&&v().createElement(oN,{className:O()(l.addButton,{[l.showAlways]:o||x}),onClick:e=>{c(e.currentTarget),p(!0)}}),T.map((({replies:e,commentId:t})=>v().createElement(nN,{ref:t===(null==m?void 0:m.commentId)?c:null,key:t,onClick:()=>(e=>{y(e),p(!0)})(t)},1+e))),v().createElement(QN,{anchorEl:s,open:d,onClose:()=>{c(null),g(),p(!1)},uri:t,relatedObjectUris:w,objectType:r,comment:m}))},tP=(0,Rp.Z)({label:{color:"rgba(0,0,0,0.6)",fontSize:"13px",lineHeight:"16px"}});function rP(){return rP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},rP.apply(null,arguments)}const nP=e=>{let{label:t,isRequired:r,className:n}=e,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["label","isRequired","className"]);const i=tP();return v().createElement(Tf(),rP({className:O()(i.label,n),component:"span"},a),t,r&&v().createElement(od,null))},aP=v().createContext(null);aP.displayName="EntityContext";const iP=(0,Rp.Z)((e=>({container:{height:"16px",borderColor:(0,Rm.alpha)(e.palette.primary.main,.54)},label:{paddingLeft:"4px",paddingRight:"4px",fontSize:"10px",lineHeight:"11px",color:e.palette.primary.main}}))),oP=(0,cd.T)(dg()),lP=({className:e,attributeType:t,nonOvValues:r=[],nonOvTotal:n})=>{const a=iP(),i=(0,w.ax)("openEntity"),o=((e,t,r)=>{var n;const a=null==t||null===(n=t[0])||void 0===n?void 0:n.uri,i=a?(0,S.getEntityUriFromAttributeUri)(a):null;if(i&&(0,S.isEntityUri)(i)){const t=(0,S.getEntityUriFromAttributeUri)(r.uri);if(!e||e.type===t)return{uri:i,type:t};const n=(0,S.getParentUri)(a),o=(0,S.findAttributeValueByUri)(e,n);return{uri:(0,S.getReferencedEntityUriFromAttrValue)(o),type:t}}return e?{uri:e.uri,type:e.type}:null})((0,b.useContext)(aP),r,t),l=(0,w.fC)(null==o?void 0:o.type),s=(0,b.useCallback)((()=>{i({uri:o.uri,screen:"sources"})}),[i,o]);if(!n)return null;const c=r.length?r.map(((e,r)=>v().createElement("div",{key:r},(0,S.isComplexAttribute)(t)?(0,S.getLabel)(e.label):v().createElement(Wd.x,{value:(0,S.getAttributeValue)(e),dataTypeDefinition:(0,S.getAttrDataTypeDefinition)(t),rich:!1})))):null;return v().createElement(oP,{tooltipTitle:c,tooltipPlacement:"bottom",label:`+ ${n}`,variant:"outlined",onClick:null!=o&&o.uri&&l?s:void 0,classes:{root:O()(a.container,e),label:a.label}})};function sP(){return sP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},sP.apply(null,arguments)}const cP=e=>v().createElement("svg",sP({width:12,height:12,viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgDescription"},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})),uP=v().createContext({showDescription:!1,showNavigateToGraph:!0});uP.displayName="FeaturesContext";const pP=(0,Rp.Z)((()=>({icon:{display:"inline-flex",marginLeft:"8px",verticalAlign:"middle"}}))),dP=({className:e,description:t})=>{const{showDescription:r}=(0,b.useContext)(uP),n=pP();return t&&r?v().createElement(ag(),{title:t,placement:"bottom"},v().createElement("span",{"data-reltio-id":"reltio-description-icon",className:O()(n.icon,e)},v().createElement(cP,null))):null};var mP=r(87558);const fP=(0,r(87171).k)({unmaskedAttributes:{},unmaskAttributeValue:void 0,maskAttributeValue:void 0}),yP=e=>(0,mP.S)(fP,e),gP=v().createContext({appearance:void 0,attributes:void 0,roles:void 0,tags:void 0});gP.displayName="HistoryDiffContext";const hP=v().createContext({highlightedValuesUris:[],highlightedClassName:""});function EP(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}hP.displayName="HighlightedValuesContext";const bP=(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=vP(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}),[])},vP=(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,S.findAttributeTypeByUri)(t,n.type);a&&"object"!=typeof a&&(0,S.isOv)(n)?e.push(TP(a,i)):a&&"object"==typeof a&&!Array.isArray(a)&&e.push(bP(i,a,r,t))}return e}),[])},TP=(e,t)=>{switch(null==t?void 0:t.type){case S.DataTypes.TYPE_DATE:return new Date(e).getTime();case S.DataTypes.TYPE_TIMESTAMP:return isNaN(Number(e))?new Date(e).getTime():new Date(Number(e)).getTime();default:return e}};function OP(){return OP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},OP.apply(null,arguments)}const SP=e=>v().createElement("svg",OP({width:11,height:11,viewBox:"0 0 11 11","data-reltio-id":"SvgPivotingIcon"},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"})),xP=(0,Rp.Z)((e=>({link:{color:e.palette.primary.main,textDecoration:"none"}}))),CP=(0,b.forwardRef)((({value:e,attributeType:t,children:r,className:n,onClick:a},i)=>{const o=xP(),{generatePivotingUrl:l}=(0,b.useContext)(Md),s=l({uiPath:(0,w.Qh)(),uri:t.uri,value:JSON.stringify(e)}),c=(0,b.useCallback)((e=>{(0,wp.rR)(e)||(a(),e.preventDefault()),e.stopPropagation()}),[a]);return v().createElement("a",{ref:i,href:s,onClick:c,className:O()(o.link,n)},r)}));CP.displayName="PivotingUriLink";const wP=(0,Rp.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"}}))),AP=({attributeType:e,label:t,entities:r,generatedValue:n,onSeeAllClick:a,total:i})=>{const o=wP(),l=i>6,s=Boolean(t);return v().createElement("div",{className:o.container},v().createElement("div",{className:o.header},v().createElement("div",{className:o.title},li().text("Pivot profiles")),v().createElement("div",{className:o.divider}),v().createElement("div",{className:o.headerCount},li().number(i,"0,0")+" "+(1===i?li().text("item"):li().text("items")))),s&&v().createElement("div",{className:o.entityTypeLabel},t),v().createElement("div",{className:o.body},r.map((e=>v().createElement("div",{key:e.uri,className:o.entityContainer},v().createElement(A,{entity:e,avatarClassName:o.profileIcon}),v().createElement(Bd,{className:o.entityLabel,value:(0,S.getEntityUriForLink)(e)},(0,S.getLabel)(e.label)))))),l&&v().createElement("div",{className:o.footer},v().createElement(CP,{value:n,attributeType:e,className:o.seeAllButton,onClick:a},li().text("See all"))))},RP=(0,Rp.Z)((e=>({icon:{marginRight:"8px",verticalAlign:"middle",width:"12px",height:"12px"},content:{color:e.palette.primary.main,cursor:"pointer",lineHeight:"16px"}}))),_P=(0,Rp.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"}}}),IP=({value:e,attributeType:t,children:r,className:n})=>{const a=_P(),i=RP(),o=(0,b.useContext)(LI)||[],l=(0,w.ax)("openPivotingPerspective"),s=(0,w.AH)()||{},c=(0,S.isNested)(t)?bP(t,e.value,o,s):TP(e.lookupCode||e.value,t),u=o.some((({uri:e})=>e===t.uri))&&(Array.isArray(c)&&c.length||!Array.isArray(c)&&!(0,_.isNil)(c)),p=o.find((({uri:e})=>e===t.uri)),d=null==p?void 0:p.popup,m=u?Array.isArray(c)?c.map((e=>Object.fromEntries(Object.entries(e).map((([e,t])=>[(0,S.getLastUriPart)(e),t]))))):((e,t)=>[{[e.name]:t}])(t,c):void 0,f=()=>{l({value:m,attributeType:t})},{entities:y,total:g,loadPivotingData:h}=(({value:e,attributeType:t,entityType:r})=>{const[n,a]=(0,b.useState)([]),[i,o]=(0,b.useState)(0),l=(0,Sh._)(),s=(0,w.eh)(),c=(0,w.mU)(),u=r||(null==s?void 0:s.type),p=(0,b.useMemo)((()=>(0,S.convertPivotingValueToSearchFilters)({value:e,attributeType:t,entityType:u})),[t,u,e]),d=(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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){EP(e,t,r[t])}))}return e}({max:6,sort:"label"},c||{})),[c]),m=(0,b.useCallback)((()=>{l(Promise.all([(0,S.getFilteredEntities)({filters:p,options:d}),(0,S.getTotals)({filters:p,options:d})])).then((e=>{const[t,{total:r}]=e;a(Array.isArray(t)?t:[]),o(r)})).catch((()=>{a([]),o(0)}))}),[p,d,l]);return{entities:n,total:i,loadPivotingData:m}})({attributeType:t,value:c,entityType:null==d?void 0:d.entityType});return u?v().createElement(ag(),{arrow:!0,placement:"right-start",classes:a,disableInteractive:!1,onOpen:h,title:v().createElement(AP,{generatedValue:m,attributeType:t,label:null==d?void 0:d.label,onSeeAllClick:f,entities:y,total:g})},v().createElement("span",{className:n},v().createElement(SP,{className:i.icon}),v().createElement(CP,{onClick:f,className:i.content,value:m,attributeType:t},r))):v().createElement(v().Fragment,null,r)};var NP=r(78577),PP=r.n(NP),DP=r(46157),kP=r.n(DP);const LP=(0,Rp.Z)((e=>({icon:{color:e.palette.text.secondary,fontSize:18},switcherWrapper:{verticalAlign:"middle",marginLeft:8,width:"16px",height:"16px"}}))),UP=({className:e,isMasked:t,isUnmasking:r,onToggleMasking:n})=>{const a=LP(),i=t?li().text("Show"):li().text("Hide");return r?v().createElement(fm(),{size:16,className:O()(e,a.switcherWrapper)}):v().createElement(ag(),{key:String(t),title:i},v().createElement(Wh(),{"aria-label":i,onClick:n,className:O()(e,a.switcherWrapper)},t?v().createElement(kP(),{className:a.icon}):v().createElement(PP(),{className:a.icon})))};function jP(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){FP(e,t,r[t])}))}return e}function FP(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const MP=(0,Rp.Z)((e=>({root:{display:"flex",alignItems:"start",justifyContent:"space-between"},commentsContainer:{height:"15px",marginRight:"-4px"},attributeValue:{verticalAlign:"middle",wordBreak:"break-all"},updateAttribute:jP({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},S.historyPalettes[S.HistoryOperations.updateAttribute],{"& > a":{color:S.historyPalettes[S.HistoryOperations.updateAttribute].color}}),insertAttribute:jP({width:"fit-content"},S.historyPalettes[S.HistoryOperations.insertAttribute],{"& > a":{color:S.historyPalettes[S.HistoryOperations.insertAttribute].color}}),deleteAttribute:jP({width:"fit-content",padding:"0 4px",marginLeft:"-4px",textDecoration:"line-through"},S.historyPalettes[S.HistoryOperations.deleteAttribute],{"& > a":{color:S.historyPalettes[S.HistoryOperations.deleteAttribute].color}}),multilineAttribute:{width:"fit-content"},ovFalse:e.inactive}))),VP=({className:e,attributeType:t=null,attributeValue:r,inlined:n})=>{const{isUnmaskingNeeded:a,isMasked:i,toggleMasking:o,attributeValue:l,isUnmasking:s}=(({attributeType:e,attributeValue:t})=>{const r=yP((({unmaskAttributeValue:e})=>e)),n=yP((({maskAttributeValue:e})=>e)),{attributeValue:a,isUnmasked:i=!1,loading:o=!1}=(l=t.uri,yP((({unmaskedAttributes:e})=>e[l]))||{});var l;const s=r&&n&&!!e.masking,c=(0,b.useCallback)((()=>s?r(t.uri):Promise.resolve()),[r,t.uri,s]),u=(0,b.useCallback)((()=>{i?n(t.uri):c()}),[t.uri,i,n,c]);return{isUnmaskingNeeded:s,isMasked:!i,toggleMasking:u,isUnmasking:o,unmask:c,attributeValue:s&&i&&a||t}})({attributeType:t,attributeValue:r}),c=MP(),{highlightedValuesUris:u=[],highlightedClassName:p}=(0,b.useContext)(hP),{appearance:d}=(0,b.useContext)(gP),m=(0,S.getHistoryAppearanceByUri)(l.uri,d),f=(0,S.getHistoryAttributeClassName)(m),y=(0,b.useMemo)((()=>v().createElement(Wd.x,{value:(0,S.getAttributeValue)(l),dataTypeDefinition:(0,S.getAttrDataTypeDefinition)(t)})),[l,t]),g=(0,S.getObjectTypeByAttributeUri)(l.uri),h=a&&v().createElement(UP,{isMasked:i,onToggleMasking:o,isUnmasking:s});return n||f?v().createElement("div",{className:O()(e,{[p]:u.includes(l.uri)})},v().createElement(IP,{value:l,attributeType:t,key:l.uri,className:O()({[c.multilineAttribute]:!n})},v().createElement("span",{className:O()(c.attributeValue,c[f],{[c.ovFalse]:!(0,S.isOv)(l)}),"data-reltio-id":"reltio-attribute-value"},y,h))):v().createElement("div",{className:O()(e,c.root,qI,{[p]:u.includes(l.uri)})},v().createElement(IP,{value:l,attributeType:t,key:l.uri},v().createElement("span",{className:O()(c.attributeValue,{[c.ovFalse]:!(0,S.isOv)(l)}),"data-reltio-id":"reltio-attribute-value"},y,h)),v().createElement(eP,{className:c.commentsContainer,uri:l.uri,relatedObjectUris:(0,S.createRelatedObjectUris)(g,{uri:l.uri}),objectType:g}))};var BP=r(84419),zP=r.n(BP);const HP=(0,Rp.Z)({expandButton:{"&:hover":{backgroundColor:"transparent"}},expandIcon:{transition:"transform .15s ease"},expanded:{transform:"rotate(90deg)"}});function YP(){return YP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},YP.apply(null,arguments)}const WP=e=>{const t=HP(),{expanded:r,className:n}=e,a=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["expanded","className"]);return v().createElement(Ap.T,YP({icon:zP(),size:"XXS",disableRipple:!0,iconClassName:O()(t.expandIcon,{[t.expanded]:r}),className:O()(n,t.expandButton),"data-reltio-id":"arrow-expand-button"},a))},GP=(0,Rp.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 qP(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const ZP=({attributeTypesList:e,attributeValue:t,label:r,expanded:n=!1,children:a,showNonOv:i,attributeType:o,classes:l,LabelRenderer:s,RightSlot:c})=>{const u=GP(),p=t.uri,[d,m]=(0,b.useState)(!1),{highlightedValuesUris:f=[],highlightedClassName:y}=(0,b.useContext)(hP);(0,b.useEffect)((()=>{m(n)}),[n]);const g=(e||[]).some((e=>(0,S.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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){qP(e,t,r[t])}))}return e}({attributes:g?null:t.value,analyticsAttributes:g?t.value:null},(0,S.isSpecialAttribute)(o)?t.value:{})),[t,g,o]),E=(0,S.getObjectTypeByAttributeUri)(t.uri);return v().createElement("div",{className:u.complexContainer},v().createElement("div",{className:O()(u.labelContainer,qI)},v().createElement(WP,{onClick:()=>m((e=>!e)),expanded:d}),s?v().createElement(s,{attributeType:o,attributeValue:t}):v().createElement(v().Fragment,null,v().createElement(Tf(),{component:"span",variant:"body2",classes:{body2:u.label},className:O()({[y]:f.includes(t.uri),[u.ovFalse]:!(0,S.isOv)(t)}),"data-reltio-id":"reltio-attribute-complex-label"},r),v().createElement("div",{className:u.spacer}),c&&v().createElement(c,{attributeType:o,attributeValue:t}),v().createElement(eP,{uri:t.uri,relatedObjectUris:(0,S.createRelatedObjectUris)(E,{uri:t.uri}),objectType:E}))),d&&v().createElement(UF,{attrTypes:e,entity:h,drawLines:!0,parentUri:p,showNonOv:i,classes:l},a))};var $P=r(29195);function KP(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){XP(e,t,r[t])}))}return e}function XP(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const QP=(0,Rp.Z)({label:{textDecoration:"none",verticalAlign:"middle"},updateAttribute:KP({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},S.historyPalettes[S.HistoryOperations.updateAttribute]),insertAttribute:KP({width:"fit-content"},S.historyPalettes[S.HistoryOperations.insertAttribute]),deleteAttribute:KP({width:"fit-content",textDecoration:"line-through",padding:"0 4px",marginLeft:"-4px"},S.historyPalettes[S.HistoryOperations.deleteAttribute]),pivotingTooltip:{marginLeft:"4px"}});function JP(){return JP=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},JP.apply(null,arguments)}const eD=(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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValue","attributeType"]);const a=QP(),{appearance:i}=(0,b.useContext)(gP),o=(0,b.useMemo)((()=>{const e=(0,S.getHistoryAppearanceByUri)(t.uri,i),n=(0,S.getHistoryAttributeClassName)(e),o=t.label?t.label:(0,S.evaluateDeepEntityLabel)(t,r.dataLabelPattern);return v().createElement(IP,{className:a.pivotingTooltip,value:t,attributeType:r},v().createElement(kI(),{component:"span",className:O()(a[n],a.label)},v().createElement($P.b,{text:(0,S.getLabel)(o)})))}),[i,a,t,r]);return v().createElement(ZP,JP({label:o,attributeValue:t,attributeTypesList:(0,S.getAttributeTypeSubAttributes)({},r),attributeType:r},n))}));var tD=r(24217),rD=r(16782);const nD=(0,Rp.Z)((e=>({link:{color:e.palette.primary.main,textDecoration:"none"}})));function aD(){return aD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},aD.apply(null,arguments)}const iD=e=>{const t=nD(),r=(0,rD.GV)(),{href:n,className:a}=e,i=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["href","className"]),o=O()(t.link,a);return r&&n?v().createElement(tD.rU,aD({to:n.replace(window.location.origin,""),className:o},i)):v().createElement("a",aD({href:n,className:o},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.push.apply(n,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=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const sD=(0,Rp.Z)((e=>({relationshipLabel:{marginLeft:"4px",color:e.palette.text.primary},updateAttribute:oD({width:"fit-content",padding:"0 4px",marginLeft:"-4px"},S.historyPalettes[S.HistoryOperations.updateAttribute]),insertAttribute:oD({width:"fit-content"},S.historyPalettes[S.HistoryOperations.insertAttribute]),deleteAttribute:oD({width:"fit-content",textDecoration:"line-through",padding:"0 4px",marginLeft:"-4px"},S.historyPalettes[S.HistoryOperations.deleteAttribute]),ovFalse:e.inactive})));function cD(){return cD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},cD.apply(null,arguments)}const uD=(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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeValue","attributeType"]);const a=sD(),i=(0,w.AH)(),o=(0,w.Qh)(),l=(0,S.getReferencedEntityUriFromAttrValue)(t),s=(0,b.useMemo)((()=>(0,S.getAttributeTypeSubAttributes)(i,r)),[r,i]),{appearance:c}=(0,b.useContext)(gP),{generateEntityUrl:u}=(0,b.useContext)(Md),p=(0,b.useMemo)((()=>{const e=(0,S.getHistoryAppearanceByUri)(t.uri,c),r=(0,S.getHistoryAttributeClassName)(e),n=null!=l&&l.startsWith("changeRequests")?"dcrReview":"profile";return v().createElement(iD,{href:(0,S.isEmptyValue)(c)?u({uiPath:o,uri:l,screen:n}):void 0,className:O()(a[r],{[a.ovFalse]:!(0,S.isOv)(t)})},v().createElement($P.b,{text:(0,S.getLabel)(t.label)}),t.relationshipLabel&&v().createElement("span",{className:a.relationshipLabel},v().createElement($P.b,{text:t.relationshipLabel})))}),[t,c,o,l,a,u]);return v().createElement(ZP,cD({attributeTypesList:s,attributeValue:t,label:p,attributeType:r},n))}));uD.displayName="ReferenceAttribute";const pD=e=>{const{attributeType:t}=e;return class{static build(e,t={}){switch(e.type){case S.DataTypes.TYPE_NESTED:return v().createElement(eD,t);case S.DataTypes.TYPE_REFERENCE:return v().createElement(uD,t);default:return v().createElement(VP,t)}}}.build(t,e)};function dD(){return dD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dD.apply(null,arguments)}const mD=e=>v().createElement("svg",dD({width:16,height:16,viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgControlAttribute"},e),v().createElement("mask",{id:"ControlAttribute_svg__a",fill:"#fff"},v().createElement("path",{d:"M10.966 9.203a3.2 3.2 0 11-.018-2.449l-1.375.581a1.707 1.707 0 10.01 1.307l1.383.561z"})),v().createElement("path",{d:"M10.966 9.203a3.2 3.2 0 11-.018-2.449l-1.375.581a1.707 1.707 0 10.01 1.307l1.383.561z",stroke:"#72828B",strokeWidth:4,mask:"url(#ControlAttribute_svg__a)"}),v().createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.297 8.965a4.804 4.804 0 004.068 3.793v1.61a6.403 6.403 0 01-5.693-5.403h1.625zm4.068-5.724a4.803 4.803 0 00-4.124 4.124h-1.61a6.402 6.402 0 015.734-5.734v1.61zm5.393 4.124a4.804 4.804 0 00-3.793-4.068V1.672a6.403 6.403 0 015.404 5.693h-1.61zm-.055 1.6a4.806 4.806 0 01-3.738 3.738v1.625a6.405 6.405 0 005.363-5.363h-1.625z",fill:"#72828B"})),fD=(0,Rp.Z)({icon:{display:"inline-flex",marginLeft:"8px",verticalAlign:"middle"}});function yD(){return yD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yD.apply(null,arguments)}const gD=(0,b.forwardRef)(((e,t)=>v().createElement("span",yD({},e,{ref:t}),v().createElement(mD,null))));gD.displayName="ControlAttributeForwarded";const hD=(0,cd.T)(gD),ED=()=>{const e=fD();return v().createElement(hD,{"data-reltio-id":"reltio-control-attribute-icon",tooltipTitle:li().text("This is a control attribute. Changing this value will affect availability of other conditional attributes."),className:e.icon})};function bD(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){vD(e,t,r[t])}))}return e}function vD(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const TD="13px",OD="16px",SD={titleRow:{display:"inline-block",minHeight:"16px"},title:{wordBreak:"break-all",verticalAlign:"middle"},ovIcon:{marginLeft:"8px",textIndent:0},descriptionIcon:{textIndent:0}},xD=(0,Rp.Z)({paddingWrapper:{paddingTop:"3px",paddingBottom:"5px","&:last-child":{paddingBottom:"2px"}},paddingWrapperWithLines:{paddingBottom:"1px","&:last-child":{paddingBottom:"2px"}}}),CD=(0,Rp.Z)(bD({wrapper:{fontSize:TD,lineHeight:OD},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"}},SD)),wD=(0,Rp.Z)(bD({wrapper:{display:"flex",flexDirection:"column",alignItems:"flex-start",fontSize:TD,lineHeight:OD},attribute:{"&:last-child":{marginBottom:0},paddingLeft:"4px",paddingRight:"4px",marginLeft:"5px",marginBottom:"4px",whiteSpace:"pre-wrap",wordBreak:"break-word"},attributes:{alignSelf:"stretch"},titleRow:bD({},SD.titleRow,{marginBottom:"3px"})},SD)),AD=({value:e,nonVisibleValues:t,attributeType:r,showNonOv:n,totalNonVisibleValues:a,classes:i})=>{const o=CD(),{label:l,description:s}=r,c=(0,w.Ws)(),u=(0,b.useMemo)((()=>c.includes(r.uri)),[c,r.uri]),p=(0,S.getObjectTypeByAttributeUri)(e.uri);return v().createElement("div",{"data-reltio-id":"one-line-renderer",className:O()(o.collaborationWrapper,qI)},v().createElement("div",{className:O()(o.titleRow,o.wrapper)},v().createElement(nP,{label:l,className:O()(o.title,null==i?void 0:i.title),"data-reltio-id":"reltio-attribute-label"}),v().createElement(dP,{description:s,className:o.descriptionIcon}),u&&v().createElement(ED,null),v().createElement(lP,{nonOvValues:t,attributeType:r,className:o.ovIcon,nonOvTotal:a}),v().createElement(pD,{className:O()(o.attribute,null==i?void 0:i.content),attributeValue:e,attributeType:r,showNonOv:n,inlined:!0,classes:i})),v().createElement(eP,{uri:e.uri,relatedObjectUris:(0,S.createRelatedObjectUris)(p,{uri:e.uri}),objectType:p}))};var RD=r(33062),_D=r.n(RD);const ID=(0,Rp.Z)({link:{display:"flex",marginTop:4},icon:{fontSize:"1rem"}}),ND=({moreNumber:e,valueNumber:t,onClick:r})=>{const n=ID();return v().createElement(ny(),{"data-reltio-id":"show-more",component:"button",variant:"caption",className:n.link,onClick:r,underline:"none"},v().createElement(_D(),{className:n.icon}),e&&t?li().text("Show ${moreNumber} more of remaining ${valueNumber} value",{moreNumber:e,valueNumber:t}):li().text("Show more"))};var PD=r(86800),DD=r.n(PD);const kD=(0,Rp.Z)({link:{display:"flex",marginTop:4},icon:{fontSize:"1rem"}}),LD=({onClick:e})=>{const t=kD();return v().createElement(ny(),{component:"button",variant:"caption",className:t.link,onClick:e,underline:"none"},v().createElement(DD(),{className:t.icon}),li().text("Show less"))},UD=({max:e,values:t,nonVisibleValues:r,totalVisibleValues:n,attributeType:a,parentUri:i,requestNextPageOfAttributeValues:o,showNonOv:l,totalNonVisibleValues:s,classes:c})=>{const u=wD(),[p,d]=(0,b.useState)(e),m=(0,w.Ws)(),f=(0,b.useMemo)((()=>m.includes(a.uri)),[m,a.uri]),y=e<n,g=y&&p<n,h=y&&p>=n,{label:E,description:T}=a,S=t.slice(0,p),x=n-p;return v().createElement("div",{"data-reltio-id":"multi-line-renderer",className:u.wrapper},v().createElement("div",{className:u.titleRow},v().createElement(nP,{label:E,className:O()(u.title,null==c?void 0:c.title),"data-reltio-id":"reltio-attribute-label"}),v().createElement(dP,{description:T}),f&&v().createElement(ED,null),v().createElement(lP,{nonOvValues:r,attributeType:a,className:u.ovIcon,nonOvTotal:s})),v().createElement("div",{className:u.attributes},S.map((e=>v().createElement(pD,{key:e.uri,className:O()(u.attribute,null==c?void 0:c.content),attributeValue:e,attributeType:a,showNonOv:l,classes:c})))),g&&v().createElement(ND,{moreNumber:(0,_.min)(e,x),valueNumber:x,onClick:()=>{t.length<n&&o({parentUri:i,attributeTypeUri:a.uri,attributeTypeName:a.name,values:t,defaultMaxValues:e}),d(p+e)}}),h&&v().createElement(LD,{onClick:()=>{d(e)}}))};var jD=r(88941),FD=r.n(jD);function MD(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){VD(e,t,r[t])}))}return e}function VD(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const BD=(0,Rp.Z)({attributeValue:{verticalAlign:"middle"},insertAttribute:MD({width:"fit-content"},S.historyPalettes[S.HistoryOperations.insertAttribute]),deleteAttribute:MD({width:"fit-content",textDecoration:"line-through",padding:"0 4px"},S.historyPalettes[S.HistoryOperations.deleteAttribute])}),zD=({value:e})=>{const t=BD(),{appearance:r}=(0,b.useContext)(gP),n=(0,w.AH)(),a=(0,S.getHistoryAppearanceBySpecialAttributeValue)("roles",e,r),i=(0,S.getHistoryAttributeClassName)(a);return v().createElement("span",{className:O()(t.attributeValue,t[i])},(0,S.getRoleLabel)(n,e))},HD=({className:e,values:t,Component:r,dataReltioId:n})=>v().createElement("div",{className:e,"data-reltio-id":n},t.map(((e,n)=>v().createElement(b.Fragment,{key:e},v().createElement(r,{value:e}),n<t.length-1&&", ")))),YD=({className:e,values:t})=>v().createElement(HD,{values:t,className:e,dataReltioId:"reltio-attribute-value",Component:zD});function WD(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){GD(e,t,r[t])}))}return e}function GD(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const qD=(0,Rp.Z)({attributeValue:{verticalAlign:"middle"},insertAttribute:WD({width:"fit-content"},S.historyPalettes[S.HistoryOperations.insertAttribute]),deleteAttribute:WD({width:"fit-content",textDecoration:"line-through",padding:"0 4px"},S.historyPalettes[S.HistoryOperations.deleteAttribute])}),ZD=({value:e})=>{const t=qD(),r=(0,b.useContext)(aP),{appearance:n}=(0,b.useContext)(gP),{generateTagUrl:a}=(0,b.useContext)(Md),i=(0,w.eh)(),o=(0,w.Qh)(),l=(0,S.getHistoryAppearanceBySpecialAttributeValue)("tags",e,n),s=(0,S.getHistoryAttributeClassName)(l),c=r||i;return v().createElement(iD,{className:O()(t.attributeValue,t[s]),href:a({uiPath:o,tag:e,entityUri:c.dataTenant?(0,S.getDataTenantEntityUri)(c):c.uri})},e)},$D=({className:e,values:t})=>v().createElement(HD,{values:t,className:e,dataReltioId:"reltio-attribute-value",Component:ZD}),KD=({values:e,attributeType:t,classes:r})=>{const n=CD(),{label:a}=t;return v().createElement("div",{"data-reltio-id":"special-renderer",className:O()(n.titleRow,n.wrapper)},(i=n.titleIcon,t.uri===S.EntityAttrTypes.tags.uri?v().createElement(FD(),{className:i}):null),v().createElement(nP,{label:a,className:O()(n.title,null==r?void 0:r.title),"data-reltio-id":"reltio-attribute-label"}),(n=>{switch(t.uri){case S.EntityAttrTypes.tags.uri:return v().createElement($D,{className:n,values:e});case S.EntityAttrTypes.roles.uri:return v().createElement(YD,{className:n,values:e});default:return v().createElement(pD,{className:n,attributeValue:{value:e[0],uri:""},attributeType:t,inlined:!0,classes:r})}})(O()(n.attribute,null==r?void 0:r.content)));var i};var XD=r(97986),QD=r.n(XD);function JD(){return JD=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},JD.apply(null,arguments)}const ek=e=>v().createElement("svg",JD({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgDefaultImage"},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"}))),tk={SMALL:{imageWidth:114,imageHeight:114},MEDIUM:{imageWidth:162,imageHeight:162},LARGE:{imageWidth:192,imageHeight:192},OVERRIDE:{imageWidth:"unset",imageHeight:"unset"}},rk=(0,Rp.Z)((e=>({root:{position:"relative"},image:({imageWidth:e,imageHeight:t})=>({width:e,height:t,objectFit:"cover",verticalAlign:"bottom"}),defaultContainer:{display:"flex",alignItems:"center",backgroundColor:"rgb(247, 247, 247)"},defaultImage:{width:"40px",height:"40px",marginLeft:"auto",marginRight:"auto",color:e.palette.text.secondary},hideImage:{display:"none"}})));function nk(){return nk=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},nk.apply(null,arguments)}const ak=(0,b.memo)((e=>{const{src:t,className:r,containerClassName:n,size:a=tk.SMALL,overlay:i=null}=e,o=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["src","className","containerClassName","size","overlay"]),l=a||tk.SMALL,s=rk(l),[c,u]=(0,b.useState)(dm.oA.LOADING);(0,b.useEffect)((()=>{u(dm.oA.LOADING)}),[t]);const p=c===dm.oA.LOADING,d=c===dm.oA.LOADED;return c===dm.oA.ERROR?v().createElement("div",nk({className:O()(s.defaultContainer,s.image,r)},o),v().createElement(QD(),{className:s.defaultImage})):v().createElement("div",{className:O()(s.root,n)},!(0,S.isEmptyValue)(t)&&v().createElement("img",nk({src:t,className:O()(s.image,r,{[s.hideImage]:p}),onLoad:()=>{u(dm.oA.LOADED)},onError:()=>{u(dm.oA.ERROR)},alt:"image"},o)),p&&v().createElement("div",nk({className:O()(s.defaultContainer,s.image,r)},o),v().createElement(ek,{className:s.defaultImage})),d&&i)})),ik={imageMargin:4,imageWidth:tk.SMALL.imageWidth,imageHeight:tk.SMALL.imageHeight};var ok=r(59849),lk=r.n(ok),sk=r(47867),ck=r.n(sk),uk=r(93643),pk=r.n(uk);const dk=(0,Rp.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)"}}))),mk=({attributeValues:e,setAttributeValueIndex:t,attributeValueIndex:r})=>{const n=dk(),a=(0,b.useRef)(null);return(0,b.useEffect)((()=>{if(null!=a&&a.current){const e=a.current.scrollLeft,t=a.current.offsetWidth+e,n=96*r+16*r+12;t<n?a.current.scroll&&(n>t+96+16?a.current.scroll(n,0):a.current.scroll(112+e,0)):e+96>n&&a.current.scroll&&a.current.scroll(n-96,0)}}),[r,a]),v().createElement("div",{ref:a,className:n.thumbnails},v().createElement(pk(),{container:!0,wrap:"nowrap",direction:"row",spacing:1,className:n.gridContainer},e.map((({uri:e,value:a},i)=>v().createElement(pk(),{item:!0,key:e},v().createElement(ak,{onClick:()=>t(i),className:O()(n.thumb,{[n.inactiveThumb]:r!==i}),src:(0,S.getImageAttributeOvThumbnailUrl)({value:a})}))))))},fk=(0,Rp.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%)"}}))),yk=({className:e,attributeValues:t,attributeValueIndex:r,setAttributeValueIndex:n})=>{const a=fk(),i=t[r],o=(0,S.getImageAttributeOvPreviewUrl)(i);return v().createElement("div",{className:O()(a.root,e)},v().createElement("div",{className:a.main},r>0&&v().createElement(Ap.T,{icon:lk(),className:O()(a.arrowButton,a.arrowButtonPrev),onClick:()=>{n(r-1)},size:"XL"}),v().createElement(ak,{containerClassName:a.mainImageContainer,className:a.mainImage,size:o&&tk.OVERRIDE,src:o}),r!==t.length-1&&v().createElement(Ap.T,{icon:ck(),className:O()(a.arrowButton,a.arrowButtonNext),onClick:()=>{n(r+1)},size:"XL"})),v().createElement(mk,{attributeValues:t,attributeValueIndex:r,setAttributeValueIndex:n}))};var gk=r(71884),hk=r.n(gk);const Ek=(0,_.curry)(((e,t)=>(0,_.filter)((t=>(t.label||t.name).toLowerCase().includes(e.toLowerCase())))(t))),bk=({attrTypes:e,filter:t="",sortingFn:r})=>(0,_.pipe)(Ek(t),(0,_.sort)(r),(0,_.map)((e=>({item:{id:e.uri,label:e.label||e.name,attrType:e}}))))(e);var vk=function(e){return e.parent="parent",e.attributes="attributes",e}(vk||{});const Tk=(0,Rp.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"}}),Ok=({label:e,popupTitle:t=e,data:r,parent:n,dense:a,onApply:i})=>{const o=Tk(),l=(0,b.useRef)(),[s,c]=(0,b.useState)(!1),[u,p]=(0,b.useState)(""),[d,m]=(0,b.useState)([]),{items:f,hasGroups:y,parentGroupLength:g,attributesGroupLength:h}=(({data:e,parent:t,filter:r})=>{const n=(0,w.mT)(),a=Boolean(t),i=(0,b.useMemo)((()=>n===S.SortingStrategy.ASC_BY_NAME?(e,t)=>{var r;return null==e||null===(r=e.label)||void 0===r?void 0:r.localeCompare(null==t?void 0:t.label)}:(e,t)=>0),[n]),o=(0,b.useMemo)((()=>a?bk({attrTypes:[t],filter:r,sortingFn:i}):[]),[a,t,r,i]),l=(0,b.useMemo)((()=>a&&null!=o&&o.length?[{item:{id:vk.parent,label:li().text("Parent")},items:o}]:[]),[a,o]),s=(0,b.useMemo)((()=>bk({attrTypes:e,filter:r,sortingFn:i})),[e,r,i]),c=(0,b.useMemo)((()=>a&&null!=s&&s.length?[{item:{id:vk.attributes,label:li().text("Attributes")},items:s}]:s),[a,s]),u=(0,b.useMemo)((()=>jp((l||[]).concat(c))),[l,c]),p=l.length,d=c.length;return{items:u,hasGroups:a,parentGroupLength:p,attributesGroupLength:d}})({data:r,parent:n,filter:u}),E=(0,b.useCallback)(((e,t)=>{m((0,_.ifElse)((0,_.always)(t),(0,_.append)(e),(0,_.reject)((0,_.propEq)("id",e.id)))(d))}),[d]),T=(0,b.useCallback)(((e,t)=>t.items?40:28),[]),x=(0,b.useCallback)((({item:e})=>{E(e,(0,_.not)((0,_.any)((0,_.propEq)("id",e.id))(d)))}),[E,d]),{focusIndex:C,handleKeyDown:A}=Hp({items:f,open:s,onSelectFocusedItem:x,selectedItems:d}),R=(0,b.useRef)(null);R.current=C;const I=y?(g?1:0)+(h?1:0):0,N=f.length-I,P=Math.min(255,28*N+40*I),D=Math.max(140,P+112),k=(0,b.useCallback)(((e,{item:t,level:r=0},n)=>{var a;const i=(0,_.any)((0,_.propEq)("id",t.id))(d),o=R.current===n;return v().createElement(md,{key:t.uri,onClick:E,checked:i,level:r,data:t,label:v().createElement(fd.o,{text:t.label,highlight:u}),labelInText:t.label,style:e,isFocused:o,isRequired:!(null===(a=t.attrType)||void 0===a||!a.required),LogoIcon:t.LogoIcon})}),[u,E,d]),L=(0,b.useCallback)(((e,t)=>v().createElement(Jm(),{component:"div",className:o.subHeader,style:e,key:`group-${t.item.id}`},t.item.label)),[]);return v().createElement("div",{className:O()(o.moreAttributes,{[o.dense]:a})},v().createElement(qh(),{color:"primary",onClick:()=>c(!s),ref:l,className:o.moreButton},v().createElement(hk(),{classes:{root:o.icon}}),v().createElement("div",{className:o.buttonLabel},e)),v().createElement(Up,{open:s,className:O()(o.moreAttributesPopup,o.popupContainer),anchorEl:l.current,onClose:(0,_.pipe)((()=>{d.length>0&&i((0,_.pluck)("attrType",d))}),(()=>c(!1)),(()=>p("")),(()=>m([]))),onSearch:p,containerHeight:D,title:t,containerWidth:320,searchInputOnKeyDown:A},v().createElement(zp,{getItemSize:T,renderItem:k,renderGroupTitle:L,disableHorizontalScrollbar:!0,items:f,height:P,focusIndex:C}),0===f.length&&v().createElement("div",{className:o.noResultsCaptionContainer},v().createElement(Tf(),{variant:"caption",display:"block",gutterBottom:!0},li().text("No results found")))))},Sk=v().createContext({canCreate:!0,canUpdate:!0,canDelete:!0});Sk.displayName="ConfigPermissionsContext";const xk=e=>{const{canCreate:t,canUpdate:r,canDelete:n}=(0,b.useContext)(Sk),a=(0,S.isTempUri)(e);return(0,b.useMemo)((()=>({canCreate:t,canUpdate:a||r,canDelete:a||n})),[a,t,r,n])},Ck={get CreationTime(){return li().text("Creation Time")},get CreationDate(){return li().text("Creation Date")},get Dimensions(){return li().text("Dimensions")},get MimeType(){return li().text("Mime Type")},get Size(){return li().text("Size")},get Url(){return li().text("Full image URL (S3)")},get UrlPreview(){return li().text("Preview image URL (S3)")},get UrlThumbnail(){return li().text("Small image URL (S3)")},get CdnUrl(){return li().text("Full image URL (CDN)")},get CdnUrlPreview(){return li().text("Preview image URL (CDN)")},get CdnUrlThumbnail(){return li().text("Small image URL (CDN)")}},wk=({value:e}={},t)=>["Url","UrlPreview","UrlThumbnail","CdnUrl","CdnUrlPreview","CdnUrlThumbnail","MimeType"].includes(t)?(0,_.path)([t,0,"value"],e):"CreationDate"===t&&(0,_.path)(["CreationTimestamp",0,"value"],e)?Ma()(e.CreationTimestamp[0].value).format("MM-DD-YYYY"):"CreationTime"===t&&(0,_.path)(["CreationTimestamp",0,"value"],e)?Ma()(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} ${li().text("pixels")}`:"Size"===t&&(0,_.path)(["Size",0,"value"],e)?`${(Number(e.Size[0].value)/1e3).toFixed(2)} KB`:void 0,Ak=(e=[])=>e.filter((({system:e})=>!e)),Rk=(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}))},_k=(e={},t,r)=>{const n=Ak(t.attributes);return Rk(Object.keys(e.value||{}),r).reduce(((t,r)=>{const a=n.find((({name:e})=>e===r));return a?[...t,{attrType:a,values:e.value[r]}]:t}),[])},Ik=e=>["Url","UrlPreview","UrlThumbnail","CdnUrl","CdnUrlPreview","CdnUrlThumbnail"].includes(e),Nk=(0,Rp.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:{}}),Pk=({attributeType:e,onAddAttributes:t,uri:r})=>{const n=Nk(),a=Ak(e.attributes),{canCreate:i}=(0,b.useContext)(Sk),o=i&&Boolean(t);return v().createElement(kI(),null,v().createElement(Tf(),{className:O()(n.title,{[n.canAdd]:o})},li().text("Meta info")),o&&v().createElement(b.Fragment,null,v().createElement(Ok,{label:li().text("Attributes"),data:a,dense:!1,onApply:e=>{t&&t(e.map((e=>({attributeType:e,parentUri:r}))))}}),v().createElement(_f(),{className:n.divider})))},Dk=(0,Rp.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"}}))),kk=({title:e,content:t,isLink:r,children:n})=>{const a=Dk();return v().createElement("div",{className:a.root},v().createElement("span",{className:a.title},e),r?v().createElement("a",{className:a.link,href:t},li().text("link")):v().createElement("span",{className:a.content},t||n))},Lk=(0,Rp.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"}}),Uk=({attributeValue:e,attributeType:t,imageAttributeFieldsOrder:r})=>{const n=Lk(),a=(0,w.xH)(),i=(o=e,l=r,Rk(Object.keys(Ck),l).map((e=>wk(o,e)?{title:Ck[e],value:wk(o,e),isLink:Ik(e)}:null)).filter(Boolean));var o,l;const s=_k(e,t,r),c=(0,b.useMemo)((()=>({title:n.title,content:n.content})),[n]);return v().createElement(kI(),{className:n.root},i.map((({title:e,value:t,isLink:r})=>v().createElement(kk,{key:e,isLink:r,title:e,content:t}))),a&&s.map((({attrType:t,values:r})=>v().createElement(kF,{key:t.uri,attributeType:t,drawLines:!1,values:r,classes:c,parentUri:e.uri}))))},jk=(0,Rp.Z)((e=>({caption:{display:"flex",color:e.palette.error.main,fontSize:"12px",lineHeight:"16px"}}))),Fk=({className:e,message:t})=>{const r=jk();return t?v().createElement(Tf(),{variant:"caption",className:O()(r.caption,e)},t):null};var Mk=r(66826),Vk=r.n(Mk),Bk=r(95210),zk=r(70485),Hk=r.n(zk),Yk=r(53167),Wk=r.n(Yk);const Gk=(0,Rp.Z)({wrapper:{width:"100%"},helperText:{margin:"3px 0 1px 12px"}});function qk(){return qk=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},qk.apply(null,arguments)}const Zk=(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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["errorMessage","children","className","classes"]);const o=Gk(),l=!!t;return v().createElement(Hk(),qk({variant:"standard",className:O()(o.wrapper,n,null==a?void 0:a.root),error:!0},i),r,l&&v().createElement(Wk(),{className:O()(o.helperText,null==a?void 0:a.helperText)},v().createElement(Fk,{message:t})))}));Zk.displayName="ErrorWrapper";const $k=(e,t,r,n)=>{const a=(0,_.pipe)(S.getEntityType,(0,_.defaultTo)({}),(0,_.props)(["attributes","analyticsAttributes"]),(0,_.reject)(_.isNil),_.flatten,(0,_.concat)(_.__,(0,_.pipe)(_.values,(0,_.reject)((0,_.propEq)("uri",S.EntityAttrTypes.id.uri)))(S.EntityAttrTypes)))(e,t);return r.length?a.filter((({uri:e})=>r.includes(e))):a.filter((({uri:e})=>!n.includes(e)))},Kk=(e,t)=>(0,_.partition)((0,_.pipe)((0,_.path)(["attrType","uri"]),(0,_.includes)(_.__,e)),t),Xk=(0,_.eqBy)((0,_.pick)(["fieldName","uri","entityTypeUri"])),Qk=(e,t)=>t&&!!t.find(Xk(e)),Jk=(0,_.curry)(((e,t,r)=>{const n=((e,t)=>{const{type:r}=(0,S.getAttrDataTypeDefinition)(e);switch(r){case S.DataTypes.TYPE_BOOLEAN:case S.DataTypes.TYPE_BOOLEAN_RADIO:case S.DataTypes.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return t.toString();case S.DataTypes.TYPE_DATE:return t&&Ma()(t).format("YYYY-MM-DD")||"";case S.DataTypes.TYPE_TIMESTAMP:return t&&Ma()(t).utc().format()||"";case S.DataTypes.TYPE_ACTIVENESS_DATE:case S.DataTypes.TYPE_LOCAL_DATE:return t&&t.valueOf();default:return t||""}})(t,r);return{value:n,uri:e.uri,attributeType:t}})),eL=v().createContext({enabled:!1,queueSizeThreshold:0});eL.displayName="AsyncMountContext";let tL=0;function rL(){return rL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},rL.apply(null,arguments)}var nL=r(50548);const aL=v().createContext(!1);aL.displayName="ProfilePerspectiveViewContext";let iL=function(e){return e.Error="Error",e.NewAttribute="NewAttribute",e.NewView="NewView",e}({});const oL=e=>e===iL.Error,lL=v().createContext({element:null,type:null,highlightView:_.identity,highlightError:_.identity,highlightAttribute:_.identity,scrollIntoRef:_.identity});function sL(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){cL(e,t,r[t])}))}return e}function cL(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const uL={content:'""',position:"absolute",left:"-1000px",top:"0px",width:"5000px",height:"calc(100% - 10px)",animationName:"$highlightAnimation",animationDuration:"2s",animationIterationCount:1,opacity:0},pL=(0,Rp.Z)((()=>({"@keyframes highlightAnimation":{"0%":{opacity:0},"50%":{opacity:1},"100%":{opacity:0}},highlightError:{"&::before":sL({},uL,{background:"rgba(255, 0, 0, 0.06)"})},highlightWarning:{"&::before":sL({},uL,{background:"rgba(228, 151, 0, 0.08)"})},simpleAttribute:{position:"relative","&::before":{top:"-4px",height:"calc(100% + 8px)"}}}))),dL=({highlightedError:e,isSimple:t=!1})=>{const r=pL(),n=(0,b.useRef)(null),a=(0,_.pathOr)(S.ErrorSeverity.ERROR,["element","severity"])(e),i=O()({[r.highlightError]:a===S.ErrorSeverity.ERROR,[r.highlightWarning]:a===S.ErrorSeverity.WARNING,[r.simpleAttribute]:t});return(0,b.useEffect)((()=>{e&&e.scrollIntoRef(n)}),[e]),e?{ref:n,errorClassName:i}:{ref:n}};var mL=r(51894);const fL=(0,Rp.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 yL(){return yL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yL.apply(null,arguments)}const gL=(0,nL.l)(lL,((e,{attributeValue:t})=>{const{element:r,type:n}=e||{};return{highlightedError:oL(n)&&(null==r?void 0:r.uri)===t.uri?e:null}}),(e=>{let{className:t,attributeValue:r,attributeType:n,isReltioCrosswalk:a,ownError:i,mode:o,onAddOneMore:l,onDeleteAttribute:s,onChangeAttribute:c,onDeactivateError:u,additionalControlsRenderer:p,state:d,highlightedError:m,isEmptyEditor:f=!1}=e,y=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","attributeValue","attributeType","isReltioCrosswalk","ownError","mode","onAddOneMore","onDeleteAttribute","onChangeAttribute","onDeactivateError","additionalControlsRenderer","state","highlightedError","isEmptyEditor"]);const g=fL(),h="deleted"===d,E="edited"===d,T=(0,S.isEditableMode)(o),{canCreate:x,canEdit:C,canDelete:A}=(({attributeType:e,attributeValue:t,isReltioCrosswalk:r,mode:n})=>{const{canCreate:a,canUpdate:i,canDelete:o}=xk(t.uri);return{canCreate:a&&(0,S.checkCanCreateAttribute)({attributeType:e,mode:n}),canEdit:i&&(0,S.checkCanEditAttribute)({attributeType:e,attributeValue:t,mode:n,isReltioCrosswalk:r}),canDelete:o&&(0,S.checkCanDeleteAttribute)({attributeType:e,attributeValue:t,mode:n,isReltioCrosswalk:r})}})({attributeValue:r,attributeType:n,mode:o,isReltioCrosswalk:a}),R=C&&T,I=(0,S.getErrorMessage)(i),N=(0,w.ZI)(r,n),{ref:P,errorClassName:D}=dL({highlightedError:m,isSimple:!0});(0,b.useEffect)((()=>{f&&(0,S.isDependentLookupAttrType)(n)&&!(0,_.has)("lookupCode",r)&&c({attributeType:n,uri:r.uri,value:r.value,silent:!0})}),[f]);const k=(0,b.useMemo)((()=>(0,S.getAttrDataTypeDefinition)(n)),[n]),L=(0,b.useMemo)((()=>((e,{type:t})=>{const{value:r,lookupCode:n}=e||{};switch(t){case S.DataTypes.TYPE_BOOLEAN:case S.DataTypes.TYPE_BOOLEAN_RADIO:case S.DataTypes.TYPE_RDM_LOOKUPS_NOT_RESOLVED:return(0,S.parseBoolean)(r);case S.DataTypes.TYPE_DATE:return r&&S.utils.dates.toLocalDate(r)||null;case S.DataTypes.TYPE_LOCAL_DATE:case S.DataTypes.TYPE_TIMESTAMP:case S.DataTypes.TYPE_ACTIVENESS_DATE:return r&&new Date(r)||null;case S.DataTypes.TYPE_DEPENDENT_LOOKUP:case S.DataTypes.TYPE_LOOKUP:return{value:r,lookupCode:n};default:return r}})(r,k)),[r,k]),U=(0,b.useCallback)((()=>{i&&u((0,S.getErrorId)(i))}),[i,u]),j=(0,b.useCallback)((0,_.pipe)(Jk(r,n),c,U),[r,n,c,U]),F=!!l&&x&&!n.singleValue,M=!h&&!!s&&A,V=!!I,B=h?{disabled:!0,isCrossedOut:!0}:{},z=(0,b.useContext)(aL),{autopopulationContextValue:H}=(({enabled:e,attributeTypeUri:t,valueUri:r})=>{const n=(0,w.ax)("dependentLookupsEditorTouched"),a=(0,w.Pl)(),i=(0,w.h0)(r),o=e&&(0,S.isAutopopulationEnabled)(a,t),l=o?r:null,{isTouched:s=!1}=o&&i||{},c=(0,b.useCallback)((e=>{n({uri:e,isTouched:!0})}),[n]);return{autopopulationContextValue:(0,b.useMemo)((()=>l?{id:l,isTouched:s,onTouch:c}:null),[l,s,c])}})({enabled:z&&(0,S.isDependentLookupAttrType)(n),attributeTypeUri:null==n?void 0:n.uri,valueUri:r.uri});return v().createElement("div",{ref:P,className:O()(g.editor,t,D)},v().createElement(Zk,{errorMessage:I,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(mL.m.Provider,{value:H},v().createElement(Bk.Z,yL({fieldName:(0,S.attributeUriToSearchUri)(n.uri),value:L,dataTypeDefinition:k,error:V,onChange:j,fullWidth:!0},N,y,B))):v().createElement(Wd.x,{value:(0,S.getAttributeValue)(r),dataTypeDefinition:k}))),v().createElement("div",{className:g["editor-actions"]},E&&v().createElement(Tf(),{variant:"caption",className:g.editedLabel},"(",li().text("edited"),")"),F&&v().createElement(Ap.T,{icon:hk(),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}),M&&v().createElement(Ap.T,{className:g.button,icon:Vk(),onClick:()=>{s({uri:r.uri,attributeType:n}),(0,S.getErrorType)(i)!==S.ErrorType.missed&&U()},size:"L","data-reltio-id":"reltio-delete-simple-attribute-button"})))})),hL=((e,t=null)=>{const r=(0,b.forwardRef)(((r,n)=>(()=>{const e=(0,b.useRef)(!0),{enabled:t,queueSizeThreshold:r=0}=(0,b.useContext)(eL),[n,a]=(0,b.useState)(!t||t&&tL<r);e.current&&tL++;const i=(0,b.useRef)();return(0,b.useEffect)((()=>{if(tL--,!n)return i.current=setTimeout((()=>{a(!0)}),0),()=>clearTimeout(i.current)}),[]),e.current=!1,n})()?v().createElement(e,rL({},r,{ref:n})):t&&v().createElement(t,rL({},r,{ref:n}))));return r.displayName="WithAsyncMount",r})(gL,(()=>{const e=fL();return v().createElement("div",{className:e.placeholder})})),EL=[S.EntityAttrTypes.roles.uri,S.EntityAttrTypes.tags.uri],bL=v().createContext(null),vL=v().createContext(null),TL=(0,b.createContext)({});function OL(){return OL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},OL.apply(null,arguments)}function SL(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const xL=(0,nL.l)(lL,(e=>{const{highlightAttribute:t}=e||{};return{highlightAttribute:t}}),(({parentAttributeType:e,attrTypes:t,entity:r,parentUri:n,showEmptyEditors:a,mode:i,crosswalks:o,drawLines:l,children:s,className:c,alwaysVisibleTypeUris:u=EL,onAddAttributes:p,onChangeAttribute:d,onDeleteAttribute:m,additionalControlsRenderer:f,showNonOv:y,highlightAttribute:g})=>{const h=(0,b.useContext)(TL),E=n&&(0,S.getBaseUri)(n),T=(0,b.useMemo)((()=>h[E]||[]),[h,E]),O=(0,b.useMemo)((()=>t.filter((e=>!T.includes(e.uri)))),[t,T]),{attributes:x={}}=r,[C,w]=(0,b.useState)({}),A=(0,b.useCallback)(((e,t)=>{w((r=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){SL(e,t,r[t])}))}return e}({},r,{[e]:t})))}),[]);(0,b.useEffect)((()=>{w({})}),[n]);const{canCreate:R}=(0,b.useContext)(Sk),I=(0,b.useMemo)((()=>R&&e&&(0,S.checkCanCreateAttribute)({attributeType:e,mode:i})),[e,i,R]),N=((e,t,r,n)=>e.filter((e=>{const a=((e,t)=>{const{attributes:r={},analyticsAttributes:n={}}=t;return(0,_.cond)([[S.isSpecialAttribute,(0,_.always)(t)],[(0,_.both)(S.isAnalyticAttribute,(0,_.always)(n)),(0,_.always)(n)],[_.T,(0,_.always)(r)]])(e)})(e,t),i=(e=>(0,S.isSpecialAttribute)(e)?"uri":"name")(e);return!((e.singleValue||(0,S.isRoleAttrType)(e)||(0,S.isTagAttrType)(e))&&((0,_.has)(e[i])(a)||r&&(null==n||!n[e.uri])))})))((0,b.useMemo)((()=>R?(0,S.getCreatableAttributeTypes)(i,O):[]),[O,i,R]),r,a,C),P=(0,b.useContext)(bL),D=(0,b.useMemo)((()=>(0,S.getAttributesListForEditMode)(O,i,r,a,y,P,R)),[O,i,r,a,y,P,R]),[k,L]=(0,b.useMemo)((()=>Kk(u,D)),[D,u]),U=(0,b.useCallback)((t=>{p(t.map((t=>({attributeType:t,parentUri:t===e?(0,S.getParentUri)(n):n})))),g((0,_.last)(t),iL.NewAttribute)}),[p,n,e]),j={enabled:l},F=(0,b.useMemo)((()=>({hasDeletionsMap:C,setHasDeletions:A})),[C,A]);return v().createElement("div",{className:c},s&&v().createElement(GI,j,s),v().createElement(GI,OL({},j,{plain:!0}),N.length>0&&v().createElement(Ok,{label:li().text("More attributes"),onApply:U,dense:l,data:N,parent:I&&e})),v().createElement(vL.Provider,{value:F},L.concat(k).map((({attrType:e,values:t})=>v().createElement(Yj,{key:`${e.uri}_${n}`,attributeType:e,drawLines:l,values:t,paging:(0,_.path)(["paging",e.uri],x),parentUri:n,showEmptyEditors:a,mode:i,crosswalks:o,onAddAttributes:p,onChangeAttribute:d,onDeleteAttribute:m,additionalControlsRenderer:f,showNonOv:y})))))})),CL=(0,Rp.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}}))),wL=(0,nL.l)(lL,((e,{attributeValue:t})=>{const{element:r,type:n}=e||{},a=oL(n);return{highlightedError:a&&(null==r?void 0:r.uri)===t.uri?e:null,isHighlightedPath:a&&(0,_.pipe)((0,_.propOr)([],"path"),(0,_.any)((0,_.pathEq)(["value","uri"],t.uri)))(r)}}),(({label:e,attributeTypesList:t,attributeType:r,attributeValue:n,children:a,errors:i,ownError:o,mode:l,metadata:s,crosswalks:c,lazy:u,showEmptyEditors:p,onAddOneMore:d,onAddAttributes:m,onDeleteAttribute:f,onChangeAttribute:y,additionalControlsRenderer:g,hideDeleteButton:h,state:E,showNonOv:T,isHighlightedPath:x,highlightedError:C,expanded:w=!1})=>{const A=CL(),R="deleted"===E,_="edited"===E,I=n.uri,N=(0,S.isTempUri)(I),P=N||w,[D,k]=(0,b.useState)(P),{ref:L,errorClassName:U}=dL({highlightedError:C});(0,b.useEffect)((()=>{x&&k(!0)}),[x]),(0,b.useEffect)((()=>{k(P)}),[P]);const{canDelete:j}=xk(n.uri),F=(0,b.useMemo)((()=>j&&(0,S.checkCanDeleteAttribute)({attributeType:r,attributeValue:n,mode:l,metadata:s,isReltioCrosswalk:(0,S.isReltioCrosswalk)(c,n)})),[r,n,l,s,c,j]),M=!R&&!h&&!!f&&F,V=(0,b.useMemo)((()=>(0,S.hasAttributeDescendantsWithErrors)(n,i)),[i,n]);(0,b.useEffect)((()=>{V&&k(!0)}),[i,V]),(0,b.useEffect)((()=>{R&&k(!1)}),[R]);const B=(t||[]).some((e=>(0,S.isAnalyticAttribute)(e))),z=(0,b.useMemo)((()=>({attributes:B?null:n.value,analyticsAttributes:B?n.value:null})),[n,B]),H=(0,S.getErrorMessage)(o)||V&&li().text("Has an incorrect value")||"";return u?v().createElement(qh(),{variant:"text",color:"primary",onClick:d},"Create attribute"):v().createElement("div",{ref:L,"data-reltio-id":"reltio-edit-mode-complex-attribute",className:O()(A.complexWrapper,U)},v().createElement("div",{className:A.editor},v().createElement("div",{className:A.titleContainer},v().createElement(WP,{onClick:()=>k((e=>!e)),expanded:D,className:A.expandButton,disabled:R}),v().createElement(Zk,{errorMessage:H,classes:{helperText:A.errorWrapperHelperText}},v().createElement("div",{className:O()(A.label,{[A.deleted]:R}),"data-reltio-id":"reltio-attribute-complex-label"},e))),v().createElement("div",{className:A.actions},_&&v().createElement(Tf(),{variant:"caption",className:A.editedLabel},"(",li().text("edited"),")"),g&&g({attributeType:r,attributeValue:n}),M&&v().createElement(Ap.T,{icon:Vk(),onClick:()=>f({uri:I,attributeType:r,attributeValue:n}),size:"L","data-reltio-id":"reltio-delete-complex-attribute-button"}))),D&&v().createElement(xL,{parentAttributeType:r,attrTypes:t,entity:z,showEmptyEditors:p||N,drawLines:!0,parentUri:I,mode:l,crosswalks:c,onAddAttributes:m,onChangeAttribute:y,onDeleteAttribute:f,additionalControlsRenderer:g,showNonOv:T},a))}));function AL(){return AL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},AL.apply(null,arguments)}const RL=(0,b.memo)((e=>{const{attributeValue:t,attributeType:r}=e,n=(0,S.evaluateDeepEntityLabel)(t,r.dataLabelPattern);return v().createElement(wL,AL({label:(0,S.getLabel)(n),attributeTypesList:r.attributes||r.analyticsAttributes},e))}));RL.displayName="NestedAttributeEditor";var _L=r(84199),IL=r(62880);const NL=(0,Rp.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"}}))),PL=e=>{const{selectProps:{onCreate:t,createLabel:r,inputValue:n,components:a},children:i}=e,o=NL();return v().createElement(jy.h,e,i,r&&!(0,_.prop)("Group",a)&&v().createElement("span",{className:o.addLabel,onClick:()=>t(n)},v().createElement(hk(),{className:o.addIcon}),r))};PL.propTypes={children:fp().element.isRequired,selectProps:fp().object.isRequired};const DL=(0,Rp.Z)({singleValue:{fontSize:"14px",lineHeight:"16px",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",marginTop:"17px"}});function kL(){return kL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},kL.apply(null,arguments)}const LL=e=>{const{selectProps:{menuIsOpen:t},innerProps:r,children:n}=e,a=DL();return!t&&v().createElement(Tf(),kL({className:a.singleValue},r),n)};function UL(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){jL(e,t,r[t])}))}return e}function jL(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}LL.propTypes={children:fp().node,innerProps:fp().object};const FL=(0,Rp.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"}}}),ML={menu:e=>UL({},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=>UL({},e,{maxHeight:"208px",padding:"8px 0"}),group:e=>UL({},e,{padding:"0 0 8px 0"}),input:e=>UL({},e,{height:"16px",color:"rgba(0, 0, 0, 0.87)",fontSize:"14px",lineHeight:"16px",margin:"16px 0 0",padding:0}),option:e=>UL({},e,{fontSize:"13px",lineHeight:"15px",height:"32px"})},VL={menuList:e=>UL({},e,{padding:0})},BL={input:e=>UL({},e,{height:"16px",color:"rgba(0, 0, 0, 0.87)",fontSize:"14px",lineHeight:"16px",margin:0,padding:0})};function zL(){return zL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},zL.apply(null,arguments)}function HL(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){YL(e,t,r[t])}))}return e}function YL(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const WL=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,f=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["value","label","createLabel","getOptions","options","height","onChange","onCreate","onClear","components","textFieldInputRef","TextFieldProps","classes"]);const y=FL({height:o}),[g,h]=(0,b.useState)(!1),E=(0,b.useRef)(null),T=a?wy:xy.J,x=(0,_.prop)("ClearIndicator",u)?{}:{IndicatorSeparator:_L.V,ClearIndicator:_L.V},C=s?(e,t)=>{s(e,t),h(!1)}:void 0,w=(0,_.prop)("Group",u)?VL:{},A=(0,_.isEmpty)(r)?BL:{},R=HL({},ML,w,A),I=HL({},y,m);return v().createElement(T,zL({placeholder:"",defaultOptions:!0},f,{value:(0,_.defaultTo)(null,t),loadOptions:a,options:i,cacheOptions:!0,onChange:l,onCreate:C,onClear:c,createLabel:n,classes:I,styles:R,components:HL({DropdownIndicator:IL.G,LoadingIndicator:_L.V,SingleValue:LL,Menu:PL},x,u),menuPlacement:"auto",TextFieldProps:HL({},d,{label:r,variant:"filled",size:"small",classes:HL({},(0,_.prop)("classes",d),{root:O()(y.formControl,(0,_.path)(["classes","root"],d))}),inputProps:HL({},(0,_.prop)("inputProps",d)),InputProps:HL({},(0,_.prop)("InputProps",d),{classes:HL({},(0,_.path)(["InputProps","classes"],d),{root:O()(y.filledInputRoot,(0,_.path)(["InputProps","classes","root"],d)),underline:O()({[y.filledInputUnderline]:(0,S.isEmptyValue)(t)},(0,_.path)(["InputProps","classes","underline"],d)),focused:O()("focused",(0,_.path)(["InputProps","classes","focused"],d))})}),InputLabelProps:HL({},(0,_.prop)("InputLabelProps",d),{classes:HL({},(0,_.path)(["InputLabelProps","classes"],d),{root:O()(y.inputLabel,(0,_.path)(["InputLabelProps","classes","root"],d)),shrink:O()("shrink",(0,_.path)(["InputLabelProps","classes","shrink"],d))}),shrink:!(0,S.isEmptyValue)(t)||void 0}),ref:p||E}),inputRef:p||E,menuIsOpen:g,onMenuOpen:()=>h(!0),onMenuClose:()=>h(!1)}))},GL={value:fp().oneOfType([fp().object,fp().array]),label:fp().string.isRequired,getOptions:fp().func,options:fp().array,onChange:fp().func,onCreate:fp().func,onClear:fp().func,createLabel:fp().string,components:fp().object,textFieldInputRef:fp().object,TextFieldProps:fp().object,height:fp().number,classes:fp().object};WL.propTypes=GL;var qL=r(98018);function ZL(){return ZL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ZL.apply(null,arguments)}const $L=e=>{const t=(0,w.$H)()||"";return v().createElement(qL.ZP,ZL({},e,{storagePath:(r=t,r.endsWith("/")?r:r+"/")}));var r},KL=(0,Rp.Z)({entityContainer:{display:"flex",alignItems:"center",height:"32px",minHeight:"32px",padding:0,"&.focused":{backgroundColor:"rgba(0,0,0,0.04)"}},entityLabel:{height:"15px",fontSize:"13px",color:"rgba(0,0,0,0.87)",cursor:"pointer",lineHeight:"15px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap"},emptyEntityLabel:{height:"15px",fontSize:"13px",color:"rgba(0,0,0,0.6)",lineHeight:"15px",marginLeft:"16px",textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",cursor:"default"},entityAvatar:{transform:"scale(0.5)",marginLeft:"8px",marginRight:"11px"},entitySecondaryLabel:{color:"rgba(0,0,0,0.6)"}});function XL(){return XL=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},XL.apply(null,arguments)}const QL=({innerRef:e,innerProps:t,selectOption:r,data:n,isFocused:a})=>{const i=KL(),{uri:o,entityType:l,label:s,secondaryLabel:c}=n;return""!==o?v().createElement($p(),XL({className:O()(i.entityContainer,{focused:a}),ref:e,key:o,onClick:()=>r({label:s,uri:o,entityType:l})},t),v().createElement($L,{className:i.entityAvatar,entityType:l}),v().createElement(sd.Y,{value:`${s}${c?", "+c:""}`},v().createElement("span",{className:i.entityLabel},s,c&&v().createElement("span",{className:i.entitySecondaryLabel},", ",c)))):v().createElement($p(),XL({className:i.entityContainer,ref:e,key:o},t,{disabled:!0}),v().createElement("span",{className:i.emptyEntityLabel},li().text("No results found")))},JL=(0,Rp.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"}}))),eU=({selectProps:{currentEntityType:e,menuIsOpen:t,disableLinkClick:r},children:n,data:a})=>{const i=JL(),o=(0,w.ax)("openEntity"),l=(0,w.Qh)(),{generateEntityUrl:s}=(0,b.useContext)(Md),c=(0,S.isTempUri)(a.entityUri)?{className:i.singleValue,component:"span"}:{className:O()(i.singleValue,i.linkValue),onMouseDown:e=>{e.stopPropagation()},onClick:e=>{e.stopPropagation(),r?e.preventDefault():(0,wp.rR)(e)||(o({uri:a.entityUri}),e.preventDefault())},href:s({uiPath:l,uri:a.entityUri}),component:"a"};return t?null:v().createElement(Tf(),c,(0,S.isTempUri)(a.entityUri)?li().text(`New ${e.label} will be created`):(0,S.getLabel)(n))},tU=(0,Rp.Z)({clearIcon:{cursor:"pointer",height:"20px",width:"20px"}}),rU=e=>{const{selectProps:{onClear:t}}=e,r=tU();return v().createElement(Wh(),{onClick:t,size:"large"},v().createElement(RI(),{className:r.clearIcon}))};rU.propTypes={selectProps:fp().object.isRequired};var nU=r(81997);const aU=(0,Rp.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:iU}=nU.F,oU=e=>{const{selectProps:{inputValue:t,onCreate:r},data:n,children:a}=e,i=aU();return v().createElement(iU,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(hk(),{className:i.addIcon}),li().text(`Create ${t?`"${t}" as `:""}new ${n.label}`))),a)};oU.propTypes={selectProps:fp().object.isRequired,data:fp().object,children:fp().array};const lU=e=>e&&e.attributes,sU=({entityUri:e,entityType:t,mode:r,attributeTypesSelectionStrategy:n=lU})=>{const a=(0,w.ax)("addAttributes"),i=(0,w.ax)("removeAttribute"),o=(0,w.ax)("modifyAttribute"),l=(0,w.vc)(e),s=(0,b.useMemo)((()=>n(t)),[n,t]);return l?v().createElement(xL,{key:l.uri,attrTypes:s,entity:l,showEmptyEditors:!0,drawLines:!0,parentUri:l.uri,mode:r,crosswalks:l.crosswalks,onAddAttributes:a,onChangeAttribute:o,onDeleteAttribute:i}):null};function cU(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const uU=(0,Rp.Z)({creatorWrapper:{marginTop:"20px"}});function pU(){return pU=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},pU.apply(null,arguments)}function dU(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){mU(e,t,r[t])}))}return e}function mU(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fU(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}const yU=20,gU=e=>{let{entity:t={},entityTypesUris:r=[],mode:n,max:a=yU,onChange:i,onCreate:o,metadata:l,globalSearchRequestOptions:s,attributeTypesSelectionStrategy:c,disableLinkClick:u=!1}=e,p=fU(e,["entity","entityTypesUris","mode","max","onChange","onCreate","metadata","globalSearchRequestOptions","attributeTypesSelectionStrategy","disableLinkClick"]);const d=uU(),[m,f]=(0,b.useState)(""),y=(0,b.useMemo)((()=>r.map((e=>(0,S.getEntityType)(l,e))).filter(S.isAvailableEntityType)),[r,l]),g=dU({},s,{max:a}),h=o?(e,t)=>{o(t||r[0],e),f("")}:void 0,E=e=>{null!==e&&(f(""),i(e))},T=(0,b.useMemo)((()=>1!==y.length),[y]),O=((0,_.isEmpty)(t)?y[0]:(0,S.getEntityType)(l,t.entityType))||{},x=o&&li().text(`Create ${m?`"${m}" as `:""}new ${O.label}`),C=li().text(`Select ${1===y.length?`${y[0].label} `:""}profile`),w=!(0,_.isEmpty)(t)&&(0,S.isTempUri)(t.entityUri),A=T?{Group:oU,GroupHeading:_L.V}:{},R=w?{ClearIndicator:rU}:{},{TextFieldProps:I}=p,N=fU(p,["TextFieldProps"]),P=(0,b.useMemo)((()=>dU({},I||{},{"data-reltio-id":"reltio-entity-selector"})),[I]);return v().createElement(v().Fragment,null,v().createElement(WL,pU({value:(0,_.isEmpty)(t)?void 0:t,inputValue:m,onInputChange:e=>{f(e)},getOptions:e=>(0,S.typeAheadSearch)(y,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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){cU(e,t,r[t])}))}return e}({},t,{label:(0,S.getLabel)(t.label),entityType:e.find((({uri:e})=>e===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)})(y,o)),getOptionLabel:(0,_.prop)("entityLabel"),onChange:E,onCreate:h,onClear:()=>{E({})},label:C,createLabel:x,components:dU({Option:QL,SingleValue:eU},A,R),currentEntityType:O,isClearable:!0,disableLinkClick:u,TextFieldProps:P},N)),w&&v().createElement("div",{className:d.creatorWrapper},v().createElement(sU,{mode:n,attributeTypesSelectionStrategy:c,entityType:O,entityUri:t.entityUri})))},hU=(0,Rp.Z)({item:{marginBottom:"20px"},dense:{marginBottom:0}});function EU(){return EU=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},EU.apply(null,arguments)}function bU(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const vU=(0,nL.l)(lL,((e,{attributeValue:t,attributeType:r})=>{const{element:n,type:a}=e||{};return{highlightedError:oL(a)&&(0,S.isAttributeTypeError)(n,t.uri,r.uri)?e:null}}),(e=>{const t=hU(),{highlightedError:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["highlightedError"]),{attributeValue:a,attributeType:i,mode:o,crosswalks:l,errors:s,onChangeAttribute:c}=n,u=(0,b.useRef)(a),{ref:p,errorClassName:d}=dL({highlightedError:r,isSimple:!0}),m=(0,S.getReferencedEntityUriFromAttrValue)(a),f=(0,w.ax)("entityDeleted"),y=(0,w.ax)("entityCreated"),g=(0,w.ax)("errorDeactivated"),h=(0,w.vc)(m),E=(0,S.isTempUri)(m)?h:null,T=(0,w.AH)(),x=(0,w.mU)(["ovOnly"]),C=(0,S.getReferencedEntityFromAttrValue)(a),A=(0,S.getReferencedRelationFromAttrValue)(a),R=(0,S.getReferencedEntityTypeUriFromAttrType)(i),I=(0,S.getEntityType)(T,R),N=E?(0,S.evaluateDeepEntityLabel)(E,I.dataLabelPattern):a.label,P=(0,b.useMemo)((()=>[R]),[R]),D=(0,b.useMemo)((()=>(0,S.addReferencedRelationCrosswalks)(l,A)),[l,A]),k=(0,b.useMemo)((()=>(0,S.getReferencedEntityActiveError)(a,s)),[a,s]),L=(0,b.useMemo)((()=>C&&{entityUri:(0,S.getReferencedEntityUri)(C),entityType:(0,S.getReferencedEntityTypeUri)(C),entityLabel:a.label}),[C,a.label]),U=(0,b.useMemo)((()=>(0,S.getReferencedRelationAttrTypesUris)(i).map((e=>(0,S.findAttributeTypeByUri)(T,e))).filter(_.identity)),[i,T]),j=(0,b.useCallback)((e=>(0,S.referencedEntityAttributeTypesSelectionStrategy)(i,e)),[i]),F=(0,b.useCallback)((e=>{E&&f(E.uri);const t=u.current,r=!(0,_.isEmpty)(e)&&e.uri===(0,S.getReferencedEntityUriFromAttrValue)(t),n=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){bU(e,t,r[t])}))}return e}({},a,{label:e.label,refEntity:r?t.refEntity:(0,S.convertReferencedEntityForAttrValue)(e),refRelation:r?t.refRelation:(0,S.createReferencedRelationForAttrValue)(a)});c({value:n,attributeType:i,uri:a.uri}),k&&g((0,S.getErrorId)(k))}),[a,i,E,c,f,g,k]),M=(0,b.useCallback)(((e,t)=>{const r=(0,_.pipe)(j,(0,S.getCreatableAttributeTypes)(o))(I),n=(0,S.createTemporaryEntity)({entityTypeUri:e,initValue:t,attributeTypes:r,metadata:T,mode:o});F(n),y(n)}),[j,o,I,T,F,y]),{canCreate:V,canUpdate:B}=xk(a.uri),z=(0,b.useMemo)((()=>B&&(0,S.checkCanEditAttribute)({attributeType:i,attributeValue:a,mode:o,isReltioCrosswalk:(0,S.isReltioCrosswalk)(l,a)})),[i,a,o,l,B]),H=(0,b.useMemo)((()=>V&&(0,S.checkMetadataForCreate)(o,I)),[o,I,V]),Y=(0,S.getErrorMessage)(k);return v().createElement(wL,EU({},n,{label:(0,S.getLabel)(N),attributeTypesList:U,crosswalks:D,metadata:T}),v().createElement("div",{ref:p,className:d},v().createElement(Zk,{errorMessage:Y},v().createElement(gU,{className:O()(t.item,{[t.dense]:Y||L&&(0,S.isTempUri)(L.entityUri)}),entity:L||{},entityTypesUris:P,globalSearchRequestOptions:x,mode:o,isDisabled:!z,onChange:F,onCreate:H?M:void 0,metadata:T,attributeTypesSelectionStrategy:j}))))}));function TU(){return TU=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},TU.apply(null,arguments)}const OU=(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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className"]);return v().createElement("div",{ref:t,"data-reltio-id":"reltio-edit-attribute",className:r},class{static build(e,t={}){switch(e.type){case S.DataTypes.TYPE_NESTED:return v().createElement(RL,t);case S.DataTypes.TYPE_REFERENCE:return v().createElement(vU,t);default:{const e=(0,_.omit)(["showEmptyEditors","onAddAttributes","lazy","errors","crosswalks","showNonOv","expanded"],t);return v().createElement(hL,TU({isReltioCrosswalk:(0,S.isReltioCrosswalk)(t.crosswalks,t.attributeValue)},e))}}}}.build(e.attributeType,n))}));OU.displayName="EditModeAttribute";const SU=e=>li().text("${value}",{value:1===e?li().text("value"):li().text("values")}),xU=(0,_.has)("minValue"),CU=(0,_.has)("maxValue"),wU=(0,_.pipe)(CU,_.not),AU=(0,_.propSatisfies)((e=>1===e),"minValue"),RU=({minValue:e})=>li().text("This attribute can have minimum ${minValue} ${minValueCaption}",{minValue:li().number(e,"0"),minValueCaption:SU(e)}),_U=({maxValue:e})=>li().text("This attribute can have maximum ${maxValue} ${maxValueCaption}",{maxValue:li().number(e,"0"),maxValueCaption:SU(e)}),IU=(0,_.cond)([[_.isNil,(0,_.always)("")],[({minValue:e,maxValue:t})=>e&&e===t,({minValue:e})=>li().text("This attribute should have ${minValue} ${minValueCaption}",{minValue:li().number(e,"0"),minValueCaption:SU(e)})],[(0,_.allPass)([AU,CU]),_U],[(0,_.allPass)([AU,wU]),(0,_.always)("")],[(0,_.allPass)([xU,CU]),({minValue:e,maxValue:t})=>li().text("${minCardinality} and maximum ${maxValue} ${maxValueCaption}",{minCardinality:RU({minValue:e}),maxValue:li().number(t,"0"),maxValueCaption:SU(t)})],[CU,_U],[xU,RU],[_.T,(0,_.always)("")]]),NU=(0,Rp.Z)((()=>({caption:{fontSize:"0.7rem",opacity:.54}}))),PU=({cardinality:e})=>{const t=NU(),r=IU(e);return r?v().createElement(Tf(),{variant:"caption",className:t.caption},r):null};function DU(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){kU(e,t,r[t])}))}return e}function kU(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const LU={content:'""',position:"absolute",left:"-1000px",top:"-4px",width:"5000px",height:"calc(100% + 8px)",animationName:"$highlightAnimation",animationDuration:"2s",animationIterationCount:1,opacity:0},UU=(0,Rp.Z)((()=>({"@keyframes highlightAnimation":{"0%":{opacity:0},"50%":{opacity:1},"100%":{opacity:0}},highlighted:{"&::before":DU({},LU,{background:"rgba(228, 151, 0, 0.08)"}),position:"relative"}}))),jU=e=>{const t=UU(),r=(0,b.useRef)(null);return(0,b.useEffect)((()=>{e&&e.scrollIntoRef(r)}),[e]),e?{ref:r,highlightedClassName:t.highlighted}:{ref:r}},FU=(0,_.filter)((0,_.propSatisfies)(S.isTempUri,"uri")),MU=(0,Rp.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"}}))),VU=({max:e,values:t,attributeType:r,parentUri:n,mode:a,drawLines:i,showEmptyEditors:o,errorMessage:l,errors:s,paging:c,crosswalks:u,showNonOv:p,nonVisibleValues:d,highlightedError:m,highlightedAttribute:f,onAddAttributes:y,onDeleteAttribute:g,onChangeAttribute:h,onDeactivateError:E,additionalControlsRenderer:T,requestNextPageOfAttributeValues:x})=>{const C=MU(),[A,R]=(0,b.useState)(e),[I,N]=(0,b.useState)(!1),{label:P,required:D,cardinality:k,name:L,uri:U,description:j}=r,F=(0,S.isEditableMode)(a),{ref:M,errorClassName:V}=dL({highlightedError:m}),{ref:B,highlightedClassName:z}=jU(f),H=(0,b.useContext)(bL),Y=(0,b.useMemo)((()=>null==H?void 0:H.includes(U)),[U,H]),W=(0,S.isEmptyValue)(t),G=(!I&&o||D||Y)&&W,q=(0,w.Ws)(),Z=(0,b.useMemo)((()=>q.includes(r.uri)),[q,r.uri]),$=(0,b.useRef)((0,S.createNewAttribute)({parentUri:n,attributeType:(0,_.omit)(["defaultValue"],r)})),K=(0,b.useCallback)((()=>{R(A+1);const e=e=>({parentUri:n,index:A,attributeType:e});if(G&&!(0,S.isComplexAttribute)(r.type)){const t=[e((0,_.omit)(["defaultValue"],r)),e(r)];return y(t)}return y([e(r)])}),[A,y,n,r,G]),X=(0,b.useCallback)((0,_.pipe)(g,_.T,N),[g,N]);if(W&&!G)return null;if(G&&W&&(t=[$.current]),(0,S.isEmptyValue)(t))return null;const Q=(FU(t)||[]).length,J=p?"totalValues":"totalOvValues",ee=(0,_.ifElse)((0,_.has)(J),(0,_.pipe)((0,_.prop)(J),(0,_.add)(Q)),(0,_.always)(t.length))(c),te=null!=c&&c.totalValues?c.totalValues-ee:null==d?void 0:d.length,re=e<ee,ne=re&&A<ee,ae=re&&A>=ee,ie=t.slice(0,A),oe=ie?ie.length-1:0,le=ee-A;return v().createElement(GI,{enabled:i},v().createElement("div",{ref:M,className:O()(C.wrapper,V)},v().createElement("div",{className:C.titleWrapper},v().createElement(nP,{label:P,isRequired:D,className:C.title,"data-reltio-id":"reltio-attribute-label"}),v().createElement(dP,{description:j}),Z&&v().createElement(ED,null),v().createElement(lP,{nonOvValues:d,attributeType:r,className:C.ovIcon,nonOvTotal:te})),F&&v().createElement(PU,{cardinality:k}),F&&v().createElement(Fk,{message:l,className:C.typeError}),v().createElement("div",{className:C.attributesWrapper},ie.map(((e,t)=>v().createElement(OU,{key:e.uri,attributeValue:e,attributeType:r,lazy:G&&!D,showEmptyEditors:o,errors:s,ownError:(0,S.getAttributeOwnError)(e,t,r.uri,s),mode:a,crosswalks:u,onAddOneMore:oe===t?K:null,onAddAttributes:y,onDeleteAttribute:X,onChangeAttribute:h,onDeactivateError:E,additionalControlsRenderer:T,className:0===t?z:null,ref:0===t?B:null,isEmptyEditor:G}))),ne&&v().createElement(ND,{moreNumber:(0,_.min)(e,le),valueNumber:le,onClick:()=>{t.length<ee&&x({parentUri:n,attributeTypeUri:U,attributeTypeName:L,values:t,defaultMaxValues:e}),R(A+e)}}),ae&&v().createElement(LD,{onClick:()=>{R(e)}}))))};VU.displayName="AttributeRenderer";const BU=(0,b.memo)(VU),zU=(0,Rp.Z)({value:{color:"rgba(0, 0, 0, 0.87)"}}),HU=(0,Rp.Z)({placeholder:{color:"rgba(0, 0, 0, 0.38)",fontSize:"14px !important"}});function YU(){return YU=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},YU.apply(null,arguments)}function WU(){return WU=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},WU.apply(null,arguments)}const GU={SingleValue:({selectProps:{menuIsOpen:e},data:{label:t}})=>{const r=zU();return!e&&v().createElement(Tf(),{variant:"body2",classes:{root:r.value}},t)},Placeholder:({innerProps:e,children:t})=>{const r=HU();return v().createElement(Tf(),YU({className:r.placeholder},e),t)}},qU=(0,b.memo)((e=>v().createElement(WL,WU({components:GU},e)))),ZU=(0,Rp.Z)({container:{display:"flex",flex:1,alignItems:"flex-start",marginBottom:"10px"},roleContainer:{width:"100%"},valueContainer:{marginLeft:"8px",width:0},deleteButton:{marginLeft:"8px"}}),$U={MultiValue:My._},KU=({values:e,onChange:t,onDelete:r})=>{const n=ZU(),a=(0,w.AH)(),i=(0,w.eh)(),o=i.uri,l=(0,S.getRolesForEntityType)(a,i.type).map((e=>({value:e.uri,label:e.label}))),s=(e||[]).map((e=>{var t;return{value:e,label:(null===(t=l.find((0,_.propEq)("value",e)))||void 0===t?void 0:t.label)||(0,S.getLastUriPart)(e)}})),c=(0,b.useCallback)((e=>{const r=(null==e?void 0:e.map((0,_.prop)("value")))||[];t({value:r,attributeType:S.EntityAttrTypes.roles,uri:o})}),[o,t]),u=(0,b.useCallback)((()=>{r({uri:o,attributeType:S.EntityAttrTypes.roles})}),[o,r]);return v().createElement("div",{className:n.container,"data-reltio-id":"reltio-attribute-value"},v().createElement(qU,{label:"",height:40,isMulti:!0,options:l,value:s,onChange:c,components:$U,classes:n,className:n.roleContainer}),!!r&&v().createElement(Ap.T,{"data-reltio-id":"reltio-roles-delete-button",className:n.deleteButton,icon:Vk(),onClick:u,size:"L"}))};var XU=r(56333);const QU=(0,Rp.Z)({container:{display:"flex",flex:1,alignItems:"flex-start",marginBottom:"10px"},deleteButton:{marginLeft:"8px"}});function JU(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){ej(e,t,r[t])}))}return e}function ej(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const tj=({className:e,values:t,onChange:r,onDelete:n})=>{const a=QU(),i=(0,w.lG)(),o=(0,w.mU)(),l=(0,b.useCallback)((async(e,t,r)=>{const n=await(0,S.getFacetedAttributeData)({fieldName:"tags",searchValue:e,options:JU({},o,{max:t,pageNo:r})});return Object.keys(n.tags)}),[o]),s=(0,b.useCallback)((e=>{r({value:e,attributeType:S.EntityAttrTypes.tags,uri:i})}),[r,i]),c=(0,b.useCallback)((()=>{n({uri:i,attributeType:S.EntityAttrTypes.tags})}),[i,n]);return v().createElement("div",{className:a.container,"data-reltio-id":"reltio-attribute-value"},v().createElement(XU.p,{fullWidth:!0,multiple:!0,variant:"filled",className:e,value:t||[],onChange:s,getSuggestions:l}),!!n&&v().createElement(Ap.T,{"data-reltio-id":"reltio-tags-delete-button",className:a.deleteButton,icon:Vk(),onClick:c,size:"L"}))};function rj(){return rj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},rj.apply(null,arguments)}function nj(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const aj=(0,nL.l)(vL,((e,{attributeType:t})=>{const{hasDeletionsMap:r,setHasDeletions:n}=e||{};return{hasDeletions:r?Boolean(r[null==t?void 0:t.uri]):void 0,setHasDeletions:n}}),(e=>{let{values:t,attributeType:r,parentUri:n,mode:a,errorMessage:i,onDeleteAttribute:o,onChangeAttribute:l,showEmptyEditors:s,hasDeletions:c,setHasDeletions:u,highlightedAttribute:p}=e,d=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["values","attributeType","parentUri","mode","errorMessage","onDeleteAttribute","onChangeAttribute","showEmptyEditors","hasDeletions","setHasDeletions","highlightedAttribute"]);const m=MU(),{label:f,required:y,cardinality:g}=r,h=(0,S.isEditableMode)(a),[E,T]=(0,b.useState)(!1),x=(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,x),[o,x]),A=(0,S.isEmptyValue)(t),R=!C&&s&&A,I=(0,b.useRef)((0,S.createNewAttribute)({parentUri:n,attributeType:r})),{ref:N,highlightedClassName:P}=jU(p);return(0,S.isActivenessAttrType)(r)&&A&&!R?null:v().createElement("div",{ref:N,className:O()(P,m.wrapper)},v().createElement(nP,{label:f,isRequired:y,className:O()(m.title,m.titleWrapper),"data-reltio-id":"reltio-attribute-label"}),h&&v().createElement(PU,{cardinality:g}),h&&v().createElement(Fk,{message:i}),v().createElement(kI(),{className:m.attributesWrapper},(()=>{switch(r.uri){case S.EntityAttrTypes.tags.uri:return v().createElement(tj,{values:t,onDelete:w,onChange:l});case S.EntityAttrTypes.roles.uri:return v().createElement(KU,{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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){nj(e,t,r[t])}))}return e}({},I.current,{value:t[0]||""});return v().createElement(OU,rj({attributeValue:e,attributeType:r,mode:a,onDeleteAttribute:w,onChangeAttribute:l},d))}}})()))}));var ij=r(57517),oj=r.n(ij);function lj(){return lj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},lj.apply(null,arguments)}const sj=e=>v().createElement("svg",lj({width:18,height:18,viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","data-reltio-id":"SvgDownload"},e),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 cj=r(76550),uj=r.n(cj),pj=r(29367),dj=r.n(pj);const mj=(0,Rp.Z)((()=>({root:{fontSize:"24px",color:"#fff"}}))),fj=({checked:e,className:t,onClick:r})=>{const n=mj(),a=e?dj():uj();return v().createElement(a,{className:O()(n.root,t),onClick:r})},yj=(0,Rp.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"}}))),gj=(0,b.memo)((e=>{const{id:t,canBeSelected:r=!1,selected:n=!1,selectionMode:a=!1,onDeselect:i=_.identity,onSelect:o=_.identity,onShareLink:l,onSetAsDefault:s,onDelete:c,onDownload:u=_.identity,onClick:p}=e,d=yj(),[m,f]=(0,b.useState)(!1),{canDelete:y}=xk(t),g=(0,b.useMemo)((()=>[{text:li().text("Share link"),onClick:l},{text:li().text("Set as default"),onClick:s},{text:li().text("Delete"),onClick:y&&c}].filter((0,_.prop)("onClick"))),[l,s,c,y]),h=e=>()=>(0,_.ifElse)((0,_.equals)(!0),i,o)(e),E=r&&(n||m||a),T=!a&&!n&&m,S=r&&n;return v().createElement("div",{className:O()(d.overlay,{[d.selected]:n,[d.selectionMode]:a}),onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),onClick:a?h(n):e=>{e.currentTarget===e.target&&p()},"data-reltio-id":"image-actions-overlay"},E&&v().createElement(fj,{className:d.checkedIcon,checked:n,onClick:h(n)}),T&&v().createElement("div",{className:d.actions},v().createElement(Ap.T,{onClick:u,className:d.actionButton,icon:sj}),v().createElement(vN,{menuId:`image-overlay-actions-${t}`,buttonComponent:Ap.T,buttonProps:{icon:kd(),className:O()(d.actionButton,d.dropDownMenuButton)},menuItems:g})),S&&v().createElement(qh(),{className:d.button,variant:"outlined",onClick:i},li().text("Deselect")))}));var hj=r(70251),Ej=r.n(hj),bj=r(1937),vj=r.n(bj);const Tj=(0,Rp.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}}))),Oj=e=>0===e.trim().length,Sj=({onSend:e})=>{const t=Tj(),[r,n]=(0,b.useState)(""),[a,i]=(0,b.useState)(null);return v().createElement(kI(),{className:t.root},v().createElement(jI(),{className:t.paper},v().createElement(vj(),{value:r,onChange:e=>{const t=e.target.value,r=new RegExp(/^(ftp|http|https):\/\/[^ "]+$/).test(t);n(t),r||Oj(t)?i(null):i(li().text("URL is not correct"))},classes:{root:t.inputRoot,input:t.input},placeholder:li().text("Paste an image URL here")}),v().createElement(qh(),{disabled:Boolean(a)||Oj(r),variant:"outlined",color:"primary",onClick:()=>{e(r),n(""),i(null)}},li().text("Send"))),a&&v().createElement(Tf(),{className:t.errorMessage},a))};var xj=r(65680),Cj=r(83997);const wj=["image/png","image/jpeg","image/tiff","image/gif","image/bmp"],Aj=({className:e,onAppendFile:t})=>v().createElement(v().Fragment,null,v().createElement("input",{onInput:e=>{t&&t(e.currentTarget.files[0])},style:{display:"none"},accept:wj.join(","),id:"upload-image-button","data-reltio-id":"upload-image-button",type:"file"}),v().createElement("label",{htmlFor:"upload-image-button"},v().createElement(qh(),{className:e,variant:"contained",color:"primary",component:"span"},li().text("Select image"))));function Rj(){return Rj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Rj.apply(null,arguments)}const _j=e=>v().createElement("svg",Rj({width:256,height:256,viewBox:"0 0 256 256",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","data-reltio-id":"SvgUploadIcon"},e),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)"})))),Ij=(0,Rp.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"}}))),Nj=({onAppendFile:e,className:t})=>{const r=Ij(),[{canDrop:n,isOver:a},i]=(0,xj.useDrop)({accept:[Cj.FILE],drop:t=>{t&&e(t.files[0])},collect:e=>({isOver:e.isOver(),canDrop:e.canDrop()})}),o=n&&a;return v().createElement("div",{ref:i,className:O()(r.root,{[r.isActive]:o},t)},v().createElement(_j,{className:r.icon}),v().createElement(Tf(),{className:r.title},li().text("Drag an image here")),v().createElement(Tf(),{className:r.description},li().text("Acceptable image types would include JPG, PNG, TIFF, GIF, BMP. Maximum image size: ${MAX_IMAGE_SIZE}Mb",{MAX_IMAGE_SIZE:20})),v().createElement(Aj,{onAppendFile:e}))},Pj=(0,Rp.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"}}))),Dj=({children:e,className:t})=>{const r=Pj();return v().createElement(kI(),{className:O()(r.root,t)},v().createElement(kI(),{className:r.border}),v().createElement(Tf(),{className:r.text},e),v().createElement(kI(),{className:r.border}))},kj=(0,Rp.Z)({closeIcon:{color:"#fff"}}),Lj=({error:e,onClose:t})=>{const r=kj();return v().createElement(Hh(),{open:Boolean(e),onClose:t,message:e,action:v().createElement(vd.k,{className:r.closeIcon,tooltipTitle:li().text("Close"),icon:Sp(),onClick:t})})},Uj=(0,Rp.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"}}))),jj=({open:e,onClose:t,onUpload:r})=>{const n=Uj(),[a,i]=(0,b.useState)(!1),[o,l]=(0,b.useState)(null),s=(0,w.qD)(),c=(0,w.fN)(),u=(0,w.Uv)(),p=e=>{i(!0),(0,S.uploadImage)({image:e,imageServicePath:s,environment:c,tenant:u}).then((e=>{r(e),t()})).catch((e=>{l((0,S.getRequestErrorMessage)(e,li().text("Something went wrong")))})).finally((()=>i(!1)))};return v().createElement(Ej(),{open:e,onClose:t,classes:{paper:n.dialogPaper}},v().createElement(Tf(),{className:n.title},li().text("Add new image")),v().createElement(kI(),{className:n.body},v().createElement(Nj,{className:n.targetBox,onAppendFile:e=>{if(!e)return l(li().text("No image selected."));const t=Number((e.size/1024/1024).toFixed(2)),r=wj.includes(e.type);t>20?l(li().text("File size exceeds configured max file size.")):r?p(e):l(li().text("File format is not supported."))}}),v().createElement(Dj,{className:n.divider},li().text("or")),v().createElement(Sj,{onSend:e=>{p(e)}})),a&&v().createElement(AE.z,null),v().createElement(Lj,{error:o,onClose:()=>l(null)}))},Fj=(0,Rp.Z)((()=>({root:{width:"100%"},image:({imageMargin:e})=>({marginRight:e,cursor:"pointer","&:last-child":{marginRight:0}}),uploadContainer:({imageMargin:e,imageWidth:t,imageHeight:r})=>({backgroundColor:"white",width:t,height:r,cursor:"pointer",border:"1px dashed #0072CE",boxSizing:"border-box",marginRight:e,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0}),uploadButton:{width:"50px",height:"50px"},uploadIcon:{fontSize:"36px"}}))),Mj={},Vj=({attributeType:e={},attributeValues:t=[],onDeleteAttribute:r,onChangeAttribute:n,requestNextPageOfAttributeValues:a,parentUri:i,paging:o,showNonOv:l,imageSize:s=ik})=>{const c=Fj(s),[u,p]=(0,b.useState)(!1),d=(0,w.ax)("setDefaultProfilePicForModifiedEntity"),m=(0,w.eh)()||Mj,f=(0,w.AU)(m.uri),{canCreate:y}=(0,b.useContext)(Sk),g=(0,b.useCallback)((()=>{p((e=>!e))}),[]),h=(0,b.useCallback)((t=>{const r=(0,S.generateUri)(i,e.name),a={};for(const n in t){const i=(e.attributes||[]).find((({name:e})=>e===n));i&&(a[n]=[{uri:(0,S.generateUri)(r,i.name),ov:!0,value:t[n],type:i.uri}])}n({attributeType:e,uri:r,value:a})}),[n,i,e]),E=(0,b.useCallback)((e=>{if(r(e),f===e.uri){var n;const r=(null===(n=t[0])||void 0===n?void 0:n.uri)===e.uri?t[1]:t[0];d({entityUri:m.uri,value:r||{}})}}),[r,m,f,t,d]),T=(t,r)=>{const{onOpenImageGalleryDialog:n,onDownload:a,onShareLink:i,onSetAsDefault:o}=t,l=(0,S.getImageAttributeOvUrl)(r),{uri:s}=r;return v().createElement(gj,{id:s,onShareLink:()=>i(l),onSetAsDefault:()=>o(r),onDelete:()=>E({uri:s,attributeType:e}),onDownload:()=>a([l]),onClick:()=>n(s)})};return v().createElement("div",{className:c.root,"data-reltio-id":"image-line-edit-mode"},v().createElement(xF,{attributeValues:t,attributeType:e,renderImage:e=>(t={})=>{const r=(0,S.getImageAttributeOvThumbnailUrl)(t),{uri:n}=t,{onOpenImageGalleryDialog:a}=e;return v().createElement("div",{className:c.image,key:n},v().createElement(ak,{src:r,overlay:T(e,t),onClick:()=>a(n),size:{imageWidth:s.imageWidth,imageHeight:s.imageHeight},"data-reltio-id":"reltio-attribute-value"}))},overlay:!0,countFixedItems:y?1:0,onUpload:g,onDeleteAttribute:E,imageSize:s,requestNextPageOfAttributeValues:a,paging:o,parentUri:i,showNonOv:l},y&&v().createElement("div",{className:c.uploadContainer,onClick:g},v().createElement(Ap.T,{className:c.uploadButton,iconClassName:c.uploadIcon,icon:oj(),"data-reltio-id":"reltio-upload-image-button"}))),v().createElement(jj,{open:u,onUpload:h,onClose:g}))},Bj=({attributeType:e,attributeValues:t,paging:r,parentUri:n,showNonOv:a,onDeleteAttribute:i,onChangeAttribute:o,requestNextPageOfAttributeValues:l,highlightedAttribute:s,error:c,highlightedError:u,onDeactivateError:p})=>{const d=MU(),{label:m,description:f,required:y}=e,{ref:g,highlightedClassName:h}=jU(s),{ref:E,errorClassName:T}=dL({highlightedError:u}),x=(0,b.useCallback)((()=>{c&&p&&p((0,S.getErrorId)(c))}),[c,p]);return v().createElement("div",{ref:g,className:O()(d.wrapper,h)},v().createElement("div",{ref:E,className:O()(d.imagesWrapper,T)},v().createElement("div",{className:d.titleWrapper},v().createElement(nP,{className:d.title,label:m,"data-reltio-id":"reltio-attribute-label",isRequired:y}),v().createElement(dP,{description:f})),v().createElement(Zk,{errorMessage:null==c?void 0:c.message,className:d.errorWrapper},v().createElement(Vj,{attributeValues:t,attributeType:e,paging:r,onDeleteAttribute:i,parentUri:n,onChangeAttribute:(0,_.pipe)(o,x),requestNextPageOfAttributeValues:l,showNonOv:a}))))};let zj=function(e){return e.imageLine="imageLine",e.special="special",e.default="default",e}({});function Hj(){return Hj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Hj.apply(null,arguments)}const Yj=(0,nL.l)(lL,((e,{attributeType:t,parentUri:r})=>{const{element:n,type:a}=e||{},i=(e=>e===iL.NewAttribute)(a)&&n.uri===t.uri;return{highlightedAttribute:i?e:null,highlightedError:oL(a)&&(0,S.isAttributeTypeError)(n,r,t.uri)?e:null}}),(({values:e,attributeType:t,mode:r=S.Mode.Viewing,crosswalks:n,drawLines:a,paging:i={},parentUri:o,max:l,showEmptyEditors:s,showNonOv:c,highlightedError:u,highlightedAttribute:p,onAddAttributes:d,onDeleteAttribute:m,onChangeAttribute:f,additionalControlsRenderer:y})=>{var g;const h=(0,w.ax)("errorDeactivated"),E=(0,w.ax)("requestNextPageOfAttributeValues"),T=(0,b.useContext)(TL),O=o&&(0,S.getBaseUri)(o),x=(0,b.useMemo)((()=>T[O]||[]),[T,O]),C=(0,w.Jz)(o,t),A=(0,b.useMemo)((()=>(0,S.filterErrorsForHiddenAttributes)(C,x)),[C,x]),R=(0,w.Xj)(),I=(0,w.vd)(),N=(0,S.getAttributePagerActiveTypeErrorMessage)(o,t,R),P=null!==(g=null!=l?l:I)&&void 0!==g?g:1/0,D=(0,_.partition)(S.isOv),[k,L]=D(e),U=c?e:k,j=c?[]:L,F={errorMessage:N,errors:A,mode:r,parentUri:o,onAddAttributes:d,onDeleteAttribute:m,onChangeAttribute:f,onDeactivateError:h,additionalControlsRenderer:y,showEmptyEditors:s,highlightedError:u,highlightedAttribute:p};return(()=>{switch((0,_.cond)([[S.isSpecialAttribute,(0,_.always)(zj.special)],[S.isImage,(0,_.always)(zj.imageLine)],[_.T,(0,_.always)(zj.default)]])(t)){case zj.special:return v().createElement(GI,{enabled:a},v().createElement(aj,Hj({values:U,attributeType:t},F)));case zj.imageLine:return v().createElement(GI,{enabled:a},v().createElement(Bj,{attributeValues:U,attributeType:t,paging:i,onDeleteAttribute:m,parentUri:o,onChangeAttribute:f,requestNextPageOfAttributeValues:E,showNonOv:c,highlightedAttribute:p,error:(0,S.getAttributeErrorByTypeUri)(t.uri,A),highlightedError:u,onDeactivateError:h}));default:return v().createElement(BU,Hj({values:U,attributeType:t,max:P,paging:i,crosswalks:n,drawLines:a,requestNextPageOfAttributeValues:E,showNonOv:c,nonVisibleValues:j},F))}})()})),Wj=(0,Rp.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"}}),Gj=({attributeType:e,imageAttributeFieldsOrder:t,attributeValue:r,hasChanges:n,onDeleteAttribute:a,onChangeAttribute:i,onAddAttributes:o,onCancel:l,onApply:s,mode:c})=>{const u=Wj(),p=_k(r,e,t),d=0!==p.length||0===p.length&&n;return v().createElement(kI(),{className:u.root},v().createElement(kI(),{className:u.form},p.map((({attrType:e,values:t})=>v().createElement(Yj,{key:e.uri,parentUri:r.uri,attributeType:e,values:t,showEmptyEditors:(0,S.isTempUri)(r.uri),mode:c,drawLines:!1,onDeleteAttribute:a,onChangeAttribute:i,onAddAttributes:o})))),d&&v().createElement(v().Fragment,null,v().createElement(_f(),{className:u.divider}),v().createElement(kI(),{className:u.actions},v().createElement(qh(),{disabled:!n,onClick:l,className:u.cancelButton},li().text("Cancel")),v().createElement(qh(),{disabled:!n,onClick:s,color:"primary"},li().text("Apply")))))},qj={palette:{mode:"dark",primary:S.theme.palette.primary,secondary:S.theme.palette.secondary}},Zj=(0,Rm.createTheme)(qj),$j=({imageAttributeFieldsOrder:e,attributeType:t,attributeValue:r})=>{const n=(0,w.YA)(),a=(0,w.o_)(),{addAttributes:i,changeAttribute:o,deleteAttribute:l,clearLocalChanges:s,applyLocalChanges:c,attributeValue:u,hasChanges:p}=(({initialAttributeValue:e,attributeType:t})=>{const r=(0,w.ax)("modifyAttribute"),[n,a]=(0,b.useState)(e);(0,b.useEffect)((()=>{a(e)}),[e]);const i=!(0,_.equals)(n,e),o=(0,b.useCallback)((e=>{a((t=>e.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a}=t;return(0,S.addAttribute)({entity:e,attributeType:r,parentUri:n,index:a,nestingLevel:1})}),t)))}),[]),l=(0,b.useCallback)((({value:e,attributeType:t,uri:r})=>{a((n=>(0,S.editAttribute)({entity:n,attributeType:t,uri:r,value:e,nestingLevel:1})))}),[]),s=(0,b.useCallback)((({attributeType:e,uri:t})=>{a((r=>(0,S.removeAttribute)({entity:r,attributeType:e,uri:t,nestingLevel:1})))}),[]);return{addAttributes:o,changeAttribute:l,deleteAttribute:s,clearLocalChanges:(0,b.useCallback)((()=>{a(e)}),[e]),applyLocalChanges:(0,b.useCallback)((()=>{r({value:n,attributeType:t,uri:n.uri})}),[n,t,r]),attributeValue:n,hasChanges:i}})({attributeType:t,initialAttributeValue:r});return v().createElement(Rm.ThemeProvider,{theme:Zj},v().createElement(kI(),null,v().createElement(Pk,{attributeType:t,uri:null==u?void 0:u.uri,onAddAttributes:a?i:void 0}),v().createElement(Uk,{attributeType:t,attributeValue:u,imageAttributeFieldsOrder:e}),a&&v().createElement(Gj,{mode:n,imageAttributeFieldsOrder:e,attributeType:t,attributeValue:u,hasChanges:p,onDeleteAttribute:l,onChangeAttribute:o,onAddAttributes:i,onCancel:s,onApply:c})))},Kj=(0,Rp.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}}))),Xj=({className:e,attributeValue:t,handleSetAsDefault:r,attributeType:n})=>{const a=Kj(),[i,o]=(0,b.useState)(!1),l=(0,w.eh)()||{},s=(0,w.vc)(null==l?void 0:l.uri)||{},c=(0,w.xH)(),u=(0,w.uO)()||{},p=c?l:s,d=u[null==l?void 0:l.type]||(null==u?void 0:u.default)||{};(0,b.useEffect)((()=>{o((null==p?void 0:p.defaultProfilePic)===(null==t?void 0:t.uri))}),[null==t?void 0:t.uri,p]);const m=(0,b.useCallback)((()=>{r(t.uri)}),[null==t?void 0:t.uri]);return v().createElement(kI(),{className:O()(a.root,e)},v().createElement(kI(),{className:a.header},v().createElement(Tf(),{className:a.headerTitle},li().text("Details"))),v().createElement(kI(),{className:a.bodyWrapper},v().createElement(kI(),{className:a.body},v().createElement(Th(),{classes:{root:a.formControlLabel,label:a.checkboxLabel},control:v().createElement(qp(),{className:a.checkbox,checked:i,onChange:m}),label:li().text("Set as default")}),v().createElement($j,{attributeType:n,imageAttributeFieldsOrder:d,attributeValue:t}))))},Qj=(0,Rp.Z)((()=>({root:{display:"flex",width:"100%",overflowY:"auto",height:"calc(100vh - 64px)"},main:{flex:"1 0 auto"},details:{width:"340px"}}))),Jj=({attributeValues:e=[],currentAttributeValueUri:t,setCurrentAttributeValueUri:r,handleSetAsDefault:n,attributeType:a})=>{const[i,o]=(0,b.useState)(0);(0,b.useEffect)((()=>{l(t?e.findIndex((e=>e.uri===t)):0)}),[t,e]);const l=(0,b.useCallback)((t=>{var n;o(t),r(null===(n=e[t])||void 0===n?void 0:n.uri)}),[e]),s=Qj();return v().createElement(kI(),{className:s.root},v().createElement(yk,{attributeValueIndex:i,setAttributeValueIndex:l,attributeValues:e,className:s.main}),v().createElement(Xj,{handleSetAsDefault:n,attributeValue:e[i],className:s.details,attributeType:a}))};let eF=function(e){return e.Gallery="gallery",e.Details="details",e}({});var tF=r(60480),rF=r.n(tF),nF=r(54886),aF=r.n(nF),iF=r(86038),oF=r.n(iF),lF=r(39178),sF=r.n(lF);function cF(){return cF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},cF.apply(null,arguments)}const uF=e=>v().createElement("svg",cF({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","data-reltio-id":"SvgDetails"},e),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"}))),pF=(0,Rp.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}}))),dF=({open:e,mode:t,children:r,header:n,onClose:a,onChangeMode:i})=>{const o=pF(),l=(0,b.useMemo)((()=>[{id:eF.Gallery,title:li().text("Gallery"),Icon:sF()},{id:eF.Details,title:li().text("Details"),Icon:uF}]),[]);return v().createElement(Ej(),{classes:{paper:o.paper},open:e,BackdropProps:{className:o.backdrop},fullScreen:!0},v().createElement(aF(),{classes:{colorPrimary:o.appBar}},v().createElement(oF(),{className:o.toolbar},v().createElement(kI(),{className:o.headerLeft},v().createElement(vd.k,{tooltipTitle:li().text("Close"),onClick:a,className:o.closeButton,iconClassName:o.closeIcon,icon:Sp()}),null==n?void 0:n.left),v().createElement(kI(),{className:o.headerCenter},v().createElement(kE,{modes:l,modeId:t,onChange:i,className:o.modeSwitcher})),v().createElement(kI(),{className:o.headerRight},null==n?void 0:n.right))),v().createElement(rF(),{className:o.content},r))},mF=(0,Rp.Z)((()=>({root:{padding:"0 24px",overflowY:"auto",height:"calc(100vh - 64px)"},item:{padding:"2px"}}))),fF=({items:e,selectedItems:t,onSelectImage:r,onDeselectImage:n,onShareLink:a,onSetAsDefault:i,onDownload:o,onClickImage:l,onDelete:s})=>{const c=mF(),u=e=>v().createElement(gj,{id:e,selected:t.includes(e),selectionMode:0!==t.length,onSelect:()=>r(e),onDeselect:()=>n(e),onShareLink:()=>a(e),onSetAsDefault:()=>i(e),onDownload:()=>o(e),onClick:()=>l(e),onDelete:s?()=>s(e):void 0,canBeSelected:!0});return v().createElement(kI(),{className:c.root},v().createElement(pk(),{container:!0},e.map((({id:e,src:t})=>v().createElement(pk(),{key:e,classes:{item:c.item},item:!0},v().createElement(ak,{size:tk.LARGE,onClick:()=>l(e),src:t,overlay:u(e)}))))))},yF=(0,Rp.Z)((e=>({selectButton:{fontSize:"14px",fontWeight:500,color:e.palette.primary.main,textTransform:"uppercase"}}))),gF=({selectedItems:e,items:t,onSelectAll:r,onClearAll:n})=>{const a=yF(),i=e.length===t.length;return v().createElement(ny(),{component:"button",underline:"none",classes:{button:a.selectButton},onClick:i?n:r},i?li().text("Clear selection"):li().text("Select all images"))};var hF=r(70997),EF=r.n(hF);const bF=(0,Rp.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)"}}))),vF=({onDownload:e,onShare:t,onUpload:r,onDelete:n})=>{const a=bF();return v().createElement(v().Fragment,null,r&&v().createElement(qh(),{variant:"contained",color:"primary",onClick:r,startIcon:v().createElement(oj(),null)},li().text("Upload")),e&&r&&v().createElement("div",{className:a.divider}),e&&v().createElement(vd.k,{className:a.downloadButton,tooltipTitle:li().text("Download selected items"),icon:sj,onClick:e}),t&&v().createElement(vd.k,{className:a.shareButton,tooltipTitle:li().text("Copy link"),icon:EF(),onClick:t}),n&&v().createElement(vd.k,{className:a.deleteButton,tooltipTitle:li().text("Delete selected items"),icon:Vk(),onClick:n}))},TF=({attributeValues:e,open:t,onClose:r,currentAttributeValueUri:n,setCurrentAttributeValueUri:a,attributeType:i,onDownload:o,onShareLink:l,onSetAsDefault:s,onUpload:c,onDeleteAttribute:u})=>{const[p,d]=(0,b.useState)([]),[m,f]=(0,b.useState)(eF.Gallery),y=(0,w.xH)();(0,b.useEffect)((()=>{f(n?eF.Details:eF.Gallery)}),[n]);const g=e.map((e=>({src:(0,S.getImageAttributeOvThumbnailUrl)(e),downloadURL:(0,S.getImageAttributeOvUrl)(e),id:e.uri}))),h=e=>{l(g.find((0,_.propEq)("id",e)).downloadURL)},E=t=>{const r=e.find((({uri:e})=>e===t));s(r)},T=e=>{u({uri:e,attributeType:i})},{canCreate:O,canDelete:x}=(0,b.useContext)(Sk),C=m===eF.Gallery,A=m===eF.Details,R=p.length>0,I=A||C&&R,N=()=>C?p:[n],P=N().every((e=>(0,S.isTempUri)(e)||x)),D=!y&&I&&P,k=!y&&O&&(A||C&&!R),L=C&&R&&v().createElement(gF,{items:g,selectedItems:p,onClearAll:()=>{d([])},onSelectAll:()=>{d((0,_.pluck)("id",g))}}),U=v().createElement(vF,{onDelete:D?()=>{N().forEach((e=>{T(e)})),p.length&&d([])}:void 0,onDownload:I?()=>{const e=C?(0,_.pipe)((0,_.filter)((({id:e})=>p.includes(e))),(0,_.pluck)("downloadURL"))(g):[g.find((0,_.propEq)("id",n)).downloadURL];o(e)}:void 0,onShare:A?()=>{h(n)}:void 0,onUpload:k?c:void 0});return v().createElement(dF,{mode:m,open:t,onChangeMode:f,header:{left:L,right:U},onClose:r},C&&v().createElement(fF,{items:g,selectedItems:p,onSelectImage:e=>{d((t=>[...t,e]))},onDeselectImage:e=>{d((t=>t.filter((t=>t!==e))))},onShareLink:h,onSetAsDefault:E,onDownload:e=>{o([g.find((0,_.propEq)("id",e)).downloadURL])},onClickImage:e=>{a(e),f(eF.Details)},onDelete:y?void 0:T}),A&&v().createElement(Jj,{handleSetAsDefault:E,setCurrentAttributeValueUri:a,currentAttributeValueUri:n,attributeValues:e,attributeType:i}))},OF=(0,Rp.Z)((e=>({imageBox:{position:"relative",display:"flex",width:"100%",flexGrow:1,flexShrink:0,flexWrap:"nowrap",marginTop:"2px",overflow:"hidden"},moreButtonContainer:({imageWidth:e,imageHeight:t})=>({backgroundColor:"white",width:e,height:t,position:"absolute",right:0,cursor:"pointer"}),moreButton:({imageWidth:t,imageHeight:r})=>({display:"flex",justifyContent:"center",alignItems:"center",width:t,height:r,backgroundColor:(0,Rm.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 SF(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const xF=({attributeType:e,attributeValues:t=[],renderImage:r,overlay:n=!1,countFixedItems:a=0,children:i,onUpload:o,onDeleteAttribute:l,imageSize:s=ik,paging:c,parentUri:u,showNonOv:p,requestNextPageOfAttributeValues:d})=>{const m=OF(s);(0,b.useEffect)((()=>{if(c&&d){const r=p?c.totalOvValues:c.totalValues;r>t.length&&d({parentUri:u,attributeTypeUri:e.uri,attributeTypeName:e.name,values:[],defaultMaxValues:r})}}),[c,d,e,u,t.length,p]);const f=(0,b.useRef)(),[y,g]=(0,b.useState)(0),[h,E]=(0,b.useState)(0),T=(0,b.useContext)(PI),[O,x]=(0,b.useState)(!1),[C,A]=(0,b.useState)(),R=(0,w.ax)("setDefaultProfilePicForEntity"),_=(0,w.ax)("setDefaultProfilePicForModifiedEntity"),I=(0,w.eh)()||{},N=(0,w.xH)(),P=(0,b.useCallback)((e=>{const{imageMargin:r,imageWidth:n}=s,i=Math.floor((e+r)/(n+r))-a,o=e+r-(i+a)*(n+r)<8;g(i),t.length>i?E(t.length-i+(o?1:0)):E(0)}),[t.length,a,s]),D=(0,b.useCallback)((e=>{P(e),f.current=e}),[P]);(0,b.useEffect)((()=>{f.current&&P(f.current)}),[t.length,P]);const k=(0,b.useCallback)((e=>{T||(A(e),x(!0))}),[T]),L=(0,b.useCallback)((()=>{x(!1)}),[]),U=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),j=e=>navigator.clipboard.writeText(e),F=(0,b.useCallback)((e=>{N?(0,S.insertDefaultImageByAttrUri)(I.uri,e.uri).then((({status:t})=>{"success"===t&&R(e)})):_({entityUri:I.uri,value:e})}),[N,I.uri,R,_]),M=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){SF(e,t,r[t])}))}return e}({onOpenImageGalleryDialog:k},n&&{onDownload:U,onShareLink:j,onSetAsDefault:F});return v().createElement(v().Fragment,null,v().createElement(Vp.Z,{handleWidth:!0,onResize:D}),v().createElement(TF,{attributeValues:t,open:O,onClose:L,setCurrentAttributeValueUri:A,currentAttributeValueUri:C,attributeType:e,onDownload:U,onShareLink:j,onSetAsDefault:F,onUpload:o,onDeleteAttribute:l}),v().createElement("div",{className:m.imageBox},i,t.slice(0,y).map(r(M)),h>0&&v().createElement("div",{className:m.moreButtonContainer},v().createElement("div",{className:m.moreButton,onClick:()=>k()},v().createElement(Tf(),{className:m.number},`+${h}`)))))},CF=(0,Rp.Z)((e=>({image:({imageMargin:e,imageHeight:t,imageWidth:r})=>({marginRight:e,width:r,height:t,cursor:"pointer","&:last-child":{marginRight:0}}),deleteAttributeImage:{position:"relative","&:before":{content:"''",position:"absolute",left:0,top:0,right:0,bottom:0,background:`url('${(0,S.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:S.historyPalettes[S.HistoryOperations.deleteAttribute].backgroundColor,pointerEvents:"none"}},updateAttributeImage:{position:"relative","&:before":{content:"''",position:"absolute",left:0,top:0,right:0,bottom:0,backgroundColor:S.historyPalettes[S.HistoryOperations.updateAttribute].backgroundColor,pointerEvents:"none"}},deleteAttribute:({imageWidth:e,imageHeight:t})=>({width:e,height:t,boxSizing:"border-box",outline:`3px solid ${S.historyPalettes[S.HistoryOperations.deleteAttribute].color}`,outlineOffset:"-3px"}),insertAttribute:({imageWidth:e,imageHeight:t})=>({width:e,height:t,boxSizing:"border-box",outline:`3px solid ${S.historyPalettes[S.HistoryOperations.insertAttribute].color}`,outlineOffset:"-3px"}),updateAttribute:({imageWidth:e,imageHeight:t})=>({width:e,height:t,boxSizing:"border-box",outline:`3px solid ${S.historyPalettes[S.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"}}))),wF=({attributeType:e,attributeValues:t=[],paging:r,parentUri:n,requestNextPageOfAttributeValues:a,showNonOv:i,imageSize:o=ik})=>{const l=CF(o),{appearance:s}=(0,b.useContext)(gP);return v().createElement(xF,{attributeValues:t,attributeType:e,renderImage:({onOpenImageGalleryDialog:e})=>t=>{const r=(0,S.getImageAttributeOvThumbnailUrl)(t),{uri:n}=t,a=(0,S.getHistoryAppearanceByUri)(n,s),i=(0,S.getHistoryAttributeClassName)(a);return v().createElement("div",{className:O()(l.image,{[l[i+"Image"]]:i}),key:n,"data-reltio-id":"reltio-attribute-value"},v().createElement(ak,{onClick:()=>e(n),className:l[i],src:r,size:{imageWidth:o.imageWidth,imageHeight:o.imageHeight}}))},imageSize:o,requestNextPageOfAttributeValues:a,paging:r,parentUri:n,showNonOv:i})},AF=({attributeType:e,attributeValues:t,paging:r,parentUri:n,showNonOv:a,requestNextPageOfAttributeValues:i})=>{const o=wD(),{label:l,description:s}=e;return v().createElement(v().Fragment,null,v().createElement("div",{className:o.titleRow},v().createElement(nP,{className:o.title,label:l,"data-reltio-id":"reltio-attribute-label"}),v().createElement(dP,{className:o.descriptionIcon,description:s})),v().createElement(wF,{attributeValues:t,attributeType:e,paging:r,parentUri:n,requestNextPageOfAttributeValues:i,showNonOv:a}))};function RF(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){_F(e,t,r[t])}))}return e}function _F(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const IF="oneLine",NF="multiLine",PF="imageLine",DF="special",kF=(0,b.memo)((({values:e,attributeType:t,drawLines:r,paging:n={},parentUri:a,max:i,showNonOv:o,classes:l})=>{var s;const c=xD(),u=(0,w.ax)("requestNextPageOfAttributeValues"),p=(0,w.vd)(),d=null!==(s=null!=i?i:p)&&void 0!==s?s:1/0,m=(0,_.partition)(S.isOv);if(!e||!e.length)return null;const[f,y]=m(e),g=o?e:f,h=o?[]:y,E=o?"totalValues":"totalOvValues",b=(0,_.ifElse)((0,_.has)(E),(0,_.prop)(E),(0,_.always)(g.length))(n),T=null!=n&&n.totalValues?n.totalValues-b:h.length,x=1===b&&!(0,S.isComplexAttribute)(t);return v().createElement(GI,{enabled:r,className:O()(RF({[c.paddingWrapperWithLines]:r},null!=l&&l.wrapperWithLines?{[null==l?void 0:l.wrapperWithLines]:r}:{}))},v().createElement("div",{className:O()(RF({[c.paddingWrapper]:!r},null!=l&&l.wrapper?{[null==l?void 0:l.wrapper]:!r}:{}))},(()=>{switch((0,_.cond)([[S.isSpecialAttribute,(0,_.always)(DF)],[S.isImage,(0,_.always)(PF)],[(0,_.always)(x),(0,_.always)(IF)],[_.T,(0,_.always)(NF)]])(t)){case IF:return v().createElement(AD,{value:g[0],nonVisibleValues:h,totalNonVisibleValues:T,attributeType:t,showNonOv:o,classes:l});case NF:return v().createElement(UD,{values:g,nonVisibleValues:h,totalVisibleValues:b,totalNonVisibleValues:T,attributeType:t,parentUri:a,max:d,requestNextPageOfAttributeValues:u,showNonOv:o,classes:l});case PF:return v().createElement(AF,{attributeValues:g,attributeType:t,paging:n,parentUri:a,requestNextPageOfAttributeValues:u,showNonOv:o});case DF:return v().createElement(KD,{values:g,attributeType:t,classes:l})}})()))})),LF=({attrTypes:e=[],entity:t,parentUri:r,drawLines:n,children:a,className:i,max:o,alwaysVisibleTypeUris:l=EL,showNonOv:s,classes:c})=>{const u=(0,b.useContext)(TL),p=r&&(0,S.getBaseUri)(r),d=(0,b.useMemo)((()=>u[p]||[]),[u,p]),m=(0,b.useMemo)((()=>(e||[]).filter((e=>!d.includes(e.uri)))),[e,d]),[f,y]=(0,b.useState)(o||1/0),g=(0,b.useMemo)((()=>(0,S.getAttributesListForReadMode)(m,t,s)),[m,t,s]),[h,E]=(0,b.useMemo)((()=>Kk(l,g)),[g,l]),T=E.slice(0,f),O=o&&T.length<E.length,x=o&&T.length>=E.length&&o<T.length,C={enabled:n};return v().createElement("div",{className:i},a&&v().createElement(GI,C,a),T.concat(h).map((({attrType:e,values:a})=>v().createElement(kF,{key:e.uri,attributeType:e,drawLines:n,values:a,paging:(0,_.path)(["paging",e.uri],t.attributes),parentUri:r,showNonOv:s,classes:c}))),O&&v().createElement(ND,{onClick:()=>{y(1/0)}}),x&&v().createElement(LD,{onClick:()=>{y(o)}}))};LF.displayName="ReadOnlyAttributesList";const UF=(0,b.memo)(LF),jF=(0,Rp.Z)({attributesContainer:{padding:"8px 16px"},noCaption:{paddingTop:"16px"},noData:{fontSize:"13px",color:"rgba(0,0,0,0.54)"}}),FF=({className:e,entity:t={},caption:r="",excludeUris:n=[],includeUris:a=[],attributesCount:i})=>{const o=jF(),l=(0,w.AH)(),s=(0,w.xK)(),c=(0,b.useMemo)((()=>$k(l,t.type,a,n)),[n,a,l,t]),u=i||16,p=(0,S.getAttributesListForReadMode)(c,t).filter((({values:e})=>!(0,S.isEmptyValue)(e))).length>0;return p||!(0,S.isEmptyValue)(r)?v().createElement(LI.Provider,{value:s},v().createElement(zI,{className:e},r&&v().createElement(HI.I,{title:r}),v().createElement(kI(),{className:O()(o.attributesContainer,{[o.noCaption]:!r})},p?v().createElement(UF,{entity:t,attrTypes:c,parentUri:t.uri,drawLines:!1,max:u}):v().createElement(Tf(),{className:o.noData},li().text("No data found"))))):null},MF=(0,Rp.Z)({attributesContainer:{overflow:"hidden",padding:"8px 16px"},noCaption:{paddingTop:"16px"}}),VF=({className:e,mode:t,entity:r,caption:n="",excludeUris:a=[],includeUris:i=[],pinnedAttributes:o})=>{const l=MF(),s=(0,w.ax)("addAttributes"),c=(0,w.ax)("modifyAttribute"),u=(0,w.ax)("removeAttribute"),p=(0,w.AH)(),d=(0,w.R2)(),m=(0,w.vc)(r.uri)||{},f=(0,b.useMemo)((()=>(0,S.getPinnedAttributesForUser)(o,d)),[o,d]),y=(0,b.useMemo)((()=>$k(p,m.type,i,a)),[a,i,p,m.type]);return v().createElement(zI,{className:e},n&&v().createElement(HI.I,{title:n}),v().createElement(kI(),{className:O()(l.attributesContainer,{[l.noCaption]:!n})},v().createElement(bL.Provider,{value:f},v().createElement(xL,{entity:m,attrTypes:y,parentUri:m.uri,drawLines:!1,mode:t,showEmptyEditors:(0,S.isTempUri)(m.uri),crosswalks:m.crosswalks,onAddAttributes:s,onChangeAttribute:c,onDeleteAttribute:u}))))};function BF(){return BF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},BF.apply(null,arguments)}const zF=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributesCount","pinnedAttributes"]);const a=(0,w.Fr)(),i=(0,w.YA)(),o=n.entity||a,l=n.mode||i;return v().createElement(aP.Provider,{value:o},(0,S.isViewMode)(l)?v().createElement(FF,BF({},n,{attributesCount:t,entity:o})):v().createElement(VF,BF({},n,{mode:l,pinnedAttributes:r,entity:o})))},HF=(0,Rp.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)"}}))),YF=()=>{const e=HF(),t=(0,yp.useSelector)(ec),r=(0,yp.useSelector)(Qs);return v().createElement(v().Fragment,null,r&&v().createElement(AE.z,null),t?v().createElement("div",{className:e.container},v().createElement(NI,{entity:t,classes:{profileBand:e.profileBand}}),v().createElement("div",{className:e.scrollWrapper},v().createElement(PI.Provider,{value:!0},v().createElement(zF,{className:e.attributesView,entity:t,mode:S.Mode.Viewing})))):v().createElement("div",{className:e.emptyState},v().createElement(wE,{LogoRenderer:CE.NO_DATA,text:li().text("No data to display."),secondaryText:li().text("Select a profile and view preview details here."),variant:xE.embedded})))},WF="circle",GF="polygon",qF={fillColor:"rgb(242,82,82)",fillOpacity:.1,strokeWeight:2,strokeColor:"#F25252",clickable:!1,editable:!0,zIndex:1},ZF={mapTypeControl:!1,streetViewControl:!1,fullscreenControl:!1},$F=.001,KF=v().createContext({});KF.displayName="EntityMarkerContext";var XF=r(17871);const QF=(0,Rp.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"}}}}))),JF=({entity:e,classes:t={}})=>{const r=QF(),{secondaryLabel:n,label:a}=t,i=(0,S.getLabel)(e.label),{secondaryLabel:o}=e,l=(0,b.useCallback)((()=>{navigator.clipboard.writeText((0,S.getEntityId)(e))}),[e]);return v().createElement(v().Fragment,null,v().createElement(A,{entity:e,imageClassName:r.image}),v().createElement("div",{className:r.info},v().createElement(Bd,{value:(0,S.getEntityUriForLink)(e),className:r.link},v().createElement(sd.Y,{value:i,placement:"top",showOnExceededHeight:!0},v().createElement("div",{className:O()(r.label,a)},i))),o&&v().createElement(sd.Y,{value:o,placement:"top",showOnExceededHeight:!0},v().createElement("div",{className:O()(r.secondaryLabel,n)},o)),v().createElement("div",{className:r.thirdRow},v().createElement(uE,{entity:e,size:"medium"}),v().createElement("div",{className:r.entityId,onClick:l},v().createElement("div",{className:r.entityIdLabel},li().text("ID:")),v().createElement(sd.Y,{value:`Copy to clipboard ${(0,S.getEntityId)(e)}`,placement:"top"},v().createElement("div",{className:r.entityIdValue},(0,S.getEntityId)(e)))))))},eM=(0,Rp.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)"}}),tM=()=>{const e=eM();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)})))},rM=(0,Rp.Z)({container:{display:"flex",padding:"16px",overflow:"hidden"}});function nM(){return nM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},nM.apply(null,arguments)}const aM=(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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["entity","classes","variant"]);const i=rM(),{container:o}=r;return v().createElement("div",nM({className:O()(i.container,o)},a),"normal"===n?v().createElement(JF,{entity:t,classes:r}):v().createElement(tM,null))})),iM=(0,Rp.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 oM(){return oM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},oM.apply(null,arguments)}const lM=(0,S.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>'),sM=(0,S.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>'),cM=(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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["marker","onClick"]);const a=iM(),i=(0,b.useRef)(),[o,l]=(0,b.useState)(!1),{activeEntityUri:s}=(0,b.useContext)(KF),c=(0,_.pathEq)(["entity","uri"],s,t),u={lat:t.point.lat,lng:t.point.lng},p=(0,b.useCallback)((0,S.debounce)(l,50),[]),d=(0,b.useCallback)((()=>p(!0)),[p]),m=(0,b.useCallback)((()=>p(!1)),[p]),f=(0,b.useCallback)((()=>r(t)),[r,t]);return v().createElement(v().Fragment,null,v().createElement(cN.r,{anchorEl:i.current,open:o,className:a.popper,modal:!1,placement:"top"},v().createElement(aM,{entity:t.entity,onMouseOver:d,onMouseOut:m})),v().createElement(XF.Jx,oM({icon:{url:o||c?lM:sM,scaledSize:new google.maps.Size(22,32)},position:u,onClick:f,visible:!1!==t.visible,onMouseOver:d,onMouseOut:m},n)),v().createElement(XF.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})))}));var uM=r(47111);const pM=({children:e,className:t,position:r,map:n})=>{const[a,i]=(0,b.useState)(null);return(0,b.useEffect)((()=>{const e=document.createElement("div"),t=n.controls[r].length;return n.controls[r].push(e),i(e),()=>{n.controls[r].removeAt(t)}}),[n,r]),(0,b.useEffect)((()=>{a&&t&&a.classList.add(t)}),[t,a]),a?(0,uM.createPortal)(e,a):null};var dM=r(518),mM=r.n(dM);function fM(){return fM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},fM.apply(null,arguments)}const yM=e=>v().createElement("svg",fM({width:18,height:18,viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgRadius"},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 gM(){return gM=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gM.apply(null,arguments)}const hM=e=>v().createElement("svg",gM({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","data-reltio-id":"SvgDraw"},e),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"})))),EM=(0,Rp.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"}}),bM=(0,cd.T)(qh()),vM=({drawingMode:e,drawingModes:t=[],hasActiveOverlay:r,onDrawingModeChanged:n,onClearOverlay:a})=>{const i=EM(),o=e=>()=>{n(e)};return v().createElement("div",{className:i.container},e||r?v().createElement(bM,{tooltipTitle:li().text("Clear area"),className:i.button,onClick:r?a:o(null)},v().createElement(mM(),{className:i.icon})):t.map((e=>{const t=(e=>{switch(e){case WF:return yM;case GF:return hM;default:return null}})(e);return v().createElement(bM,{tooltipTitle:li().text("Draw area"),key:e,className:i.button,onClick:o(e)},v().createElement(t,{className:i.icon}))})))},TM=(0,Rp.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"}}}),OM=({isSearchOnMapMove:e,onChangeIsSearchOnMapMove:t})=>{const r=TM();return v().createElement(Th(),{classes:{root:r.container,label:r.label},control:v().createElement(qp(),{checked:e,onChange:e=>{t(e.target.checked)},className:r.checkbox}),label:li().text("Search as I move the map")})},SM=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]]},xM=e=>{switch(e){case WF:return window.google.maps.drawing.OverlayType.CIRCLE;case GF:return window.google.maps.drawing.OverlayType.POLYGON;default:return null}},CM=(e,t,r)=>{if(t.path){const n=r||new window.google.maps.LatLngBounds;t.path.forEach((({lat:e,lng:t})=>n.extend(new window.google.maps.LatLng(e,t)))),e.fitBounds(n)}},wM=(0,Rp.Z)({mapControlContainer:{borderRadius:"2px",backgroundColor:"#FFFFFF",boxShadow:"0 1px 3px 0 rgba(0,0,0,0.15)",margin:"10px"}});function AM(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){RM(e,t,r[t])}))}return e}function RM(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const _M=["drawing"],IM=({markers:e=[],mapKey:t,defaultZoom:r,defaultCenter:n,loadingElement:a,isSearchOnMapMove:i,isSearchEnabled:o,activeOverlay:l,overlayOptions:s={},drawingModes:c=[],markerClusterer:u,markerClustererOptions:p,mapOptions:d={},mapContainerClassName:m,onMapBoundsChanged:f=_.identity,onOverlayUpdated:y=_.identity,onMarkerClicked:g=_.identity})=>{const h=wM(),{isLoaded:E,loadError:T}=(0,XF.Ji)({googleMapsApiKey:t,libraries:_M}),O=(0,b.useRef)(null),[S,x]=(0,b.useState)(null),[C,w]=(0,b.useState)(null),[A,R]=(0,b.useState)(null);(({markers:e,activeOverlay:t,isSearchOnMapMove:r,map:n})=>{const a=Boolean(n&&window.google),i=(0,Ry.D)(e),o=(0,Ry.D)(t),l=(0,Ry.D)(a);(0,b.useEffect)((()=>{const s=i!==e,c=l!==a,u=a&&t&&(o!==t||c);a&&!r&&e.length&&(s||c)?((e,t,r)=>{const n=new window.google.maps.LatLngBounds;if(e.forEach((e=>n.extend(e.point))),1===e.length){const t=e[0].point;n.extend(new window.google.maps.LatLng(t.lat+$F,t.lng+$F)),n.extend(new window.google.maps.LatLng(t.lat-$F,t.lng-$F))}t.fitBounds(n),r&&CM(t,r,n)})(e,n,t):u&&CM(n,t)}),[a,e,t])})({markers:e,activeOverlay:l,map:S,isSearchOnMapMove:i});const I=(0,b.useMemo)((()=>AM({},qF,s)),[s]),N=(0,b.useMemo)((()=>AM({},ZF,d)),[d]),P=(0,b.useCallback)((e=>{f(e?SM(S):null),R(null),clearTimeout(O.current)}),[S,f]),D=(0,b.useCallback)((()=>{clearTimeout(O.current)}),[]),k=(0,b.useCallback)((()=>{i&&f(SM(S))}),[i,S,f]),L=(0,b.useCallback)((()=>{i&&(clearTimeout(O.current),O.current=setTimeout(k,1e3))}),[k,i]),U=(0,b.useCallback)(((e,t)=>{var r;const n=t||C&&{type:GF,overlay:C};if((0,_.isEmpty)(n))return;const{overlay:a,type:i}=n,o={[GF]:()=>a.getPath().getArray().map((e=>[e.lat(),e.lng()])),[WF]:()=>({radius:a.getRadius()/1e3,center:a.getCenter()})},l=null===(r=o[i])||void 0===r?void 0:r.call(o);l&&y({data:l,type:i})}),[y,C]),j=(0,b.useCallback)((e=>t=>{U(null,{type:e,overlay:t}),t.setMap(null),R(null)}),[U]),F=(0,b.useCallback)((()=>{y(null)}),[y]),M=t=>e.filter((0,_.prop)("point")).map((e=>v().createElement(cM,{key:e.id,marker:e,clusterer:t,onClick:g})));if(T)return null;if(!E)return a;const V=o&&Boolean(c.length),B=S&&o&&Boolean(c.length),z=S&&o,H=!xM(A)&&l&&(0,_.propEq)("type",GF,l);return v().createElement(XF.b6,{mapTypeId:window.google.maps.MapTypeId.ROADMAP,options:N,onLoad:x,zoom:r,center:n,onZoomChanged:D,onDragStart:D,onIdle:L,mapContainerClassName:m},B&&v().createElement(pM,{className:h.mapControlContainer,position:window.google.maps.ControlPosition.TOP_RIGHT,map:S},v().createElement(vM,{hasActiveOverlay:!!l,drawingModes:c,drawingMode:A,onDrawingModeChanged:R,onClearOverlay:F})),z&&v().createElement(pM,{className:h.mapControlContainer,position:window.google.maps.ControlPosition.TOP_CENTER,map:S},v().createElement(OM,{onChangeIsSearchOnMapMove:P,isSearchOnMapMove:i})),u?(Y=p,v().createElement(XF.XL,{options:Y},M)):M(),H&&v().createElement(XF.mg,{onLoad:w,path:l.path,editable:!0,options:I,onMouseUp:U,onDragEnd:U}),V&&v().createElement(XF.j_,{onPolygonComplete:j(GF),onCircleComplete:j(WF),drawingMode:xM(A),options:{drawingControl:!1,circleOptions:I,polygonOptions:I}}));var Y},NM=(e,t)=>Math.abs(e-t)<1,PM=(0,_.curry)(((e,t,r)=>{const n=t.map((({position:t})=>{const r=e.find((({point:e})=>NM(t.lat(),e.lat)&&NM(t.lng(),e.lng)));return(0,_.propOr)("","label",r)})),a=(n.length>2?n.slice(0,2).concat("..."):n).join("\n");let i=0;const o=t.length.toString();let l=o;for(;0!==l;)l=parseInt(l/10,10),i++;return i=Math.min(i,r),{text:o,index:i,title:a}})),DM=[],kM=(0,_.pipe)((0,_.path)(["point","lat"]),(0,_.both)((0,_.gt)(90),(0,_.lt)(-90))),LM={[S.MapSearch.geoPolygon]:GF,[S.MapSearch.geoLocation]:WF},UM=e=>e&&e.length?[...e,e[0]]:e,jM=e=>e[0].map((([e,t])=>({lat:e,lng:t}))).slice(0,-1),FM=(0,Rp.Z)((()=>({container:{height:"100%",width:"100%",position:"relative"},fullHeight:{height:"100%"}}))),MM=()=>{const e=FM(),t=(0,yp.useSelector)(k().selectors.getMetadata),r=(0,yp.useSelector)(ai.Qr),n=(0,yp.useSelector)(Ri.AO),a=(0,yp.useSelector)(k().selectors.getGoogleMapKey),{markers:i,loading:o,onMarkerClicked:l}=(({searchResults:e,metadata:t,mapKey:r})=>{e=e||DM;const n=(0,yp.useDispatch)(),[a,i]=(0,b.useState)([]),[o,l]=(0,b.useState)(!1),s=(0,b.useRef)(),c=(0,b.useRef)(),u=(0,b.useCallback)((e=>{n({type:he,payload:e||null})}),[n]),p=(0,b.useCallback)((()=>{clearTimeout(c.current),clearTimeout(s.current)}),[]);return(0,b.useEffect)((()=>{l(!0),(0,S.resolve)(t,e,r).then((e=>{l(!1),i(e.filter(kM))})).catch((()=>{l(!1),i([])}))}),[e,t,r]),{markers:a,loading:o,onMarkerClicked:(0,b.useCallback)((e=>{const t=(0,_.path)(["entity","uri"],e);p(),u(),s.current=setTimeout((()=>u(t)),0),c.current=setTimeout(u,3e3)}),[p,u])}})({searchResults:r,metadata:t,mapKey:a}),{isSearchEnabled:s,activeOverlay:c,onOverlayUpdated:u,isSearchOnMapMove:p,onMapBoundsChanged:d}=(()=>{const e=(0,yp.useDispatch)(),t=(0,yp.useSelector)(ai.Qy),r=(0,yp.useSelector)(ai.bt),n=(0,yp.useSelector)(Ri.d7),[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 WF:{const{center:t,radius:a}=e;r=[t.lng(),t.lat(),a],n=S.MapSearch.geoLocation;break}case GF:r=UM(e),n=S.MapSearch.geoPolygon}}i(!1),e(Ka(r,n))}),[e]),l=(0,b.useCallback)((t=>{i(!!t),e(Ka(UM(t),t&&S.MapSearch.onMapMove))}),[e]),s=LM[r],c=(0,b.useMemo)((()=>n&&s&&t.length?{path:s===GF?jM(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(AE.z,null))),[e]),f=(0,b.useMemo)((()=>({gridSize:60,maxZoom:9,calculator:PM(i)})),[i]),y=(0,b.useMemo)((()=>({activeEntityUri:n})),[n]),g=(0,b.useMemo)((()=>({lat:0,lng:0})),[]),h=(0,b.useMemo)((()=>[GF]),[]);return a?v().createElement("div",{className:e.container},o&&v().createElement(AE.z,null),v().createElement(KF.Provider,{value:y},v().createElement(IM,{loadingElement:m,defaultZoom:1,defaultCenter:g,onOverlayUpdated:u,onMarkerClicked:l,activeOverlay:c,markers:i,fullscreenControl:!1,markerClusterer:!0,markerClustererOptions:f,drawingModes:h,isSearchOnMapMove:p,onMapBoundsChanged:d,isSearchEnabled:s,mapContainerClassName:e.fullHeight,mapKey:a}))):null},VM=(0,cd.T)(Ap.T),BM=e=>{switch(e){case Z.om.PROFILE:return li().text("Hide entity details");case Z.om.MAP:return li().text("Hide map")}},zM=()=>{const e=_I(),t=(0,yp.useDispatch)(),r=(0,yp.useSelector)(Ri.qx),n=r===Z.om.MAP,a=(0,yp.useSelector)(k().selectors.getGoogleMapKey),i=(0,b.useCallback)((()=>t(Ci(null))),[t]);return(0,b.useEffect)((()=>{!a&&n&&i()}),[a,n,i]),v().createElement("div",{className:e.container},v().createElement(VM,{tooltipTitle:BM(r),tooltipPlacement:"bottom-start",size:"L",icon:RI(),className:e.closeButton,onClick:i}),(e=>{switch(e){case Z.om.PROFILE:return v().createElement(YF,null);case Z.om.MAP:return v().createElement(MM,null)}})(r))},HM=({className:e,loading:t,entities:r,entityTypeTab:n,quantity:a,rowsPerPage:i,page:o,entityToHighlight:l,selectedEntityUri:s,mode:c,previewPanelMode:u,isPreviewPanelOpen:p,dispatch:d})=>{const m=_E(),f=(0,b.useRef)(),[y,g]=(0,b.useState)("50%"),h=(0,Ai.gj)(c),E=u===Z.om.PROFILE,T=u===Z.om.MAP,[x,C]=(0,b.useState)({}),w=(0,b.useCallback)(((e,t)=>{C((0,_.assoc)(e,t))}),[]);(0,b.useEffect)((()=>{f.current&&(f.current.scrollTop=0)}),[r]),(0,b.useEffect)((()=>{E&&((0,S.isEmptyValue)(r)?d(rc(null)):!(0,_.prop)(0,r)||s&&r.map((0,_.prop)("uri")).includes(s)||d(rc(r[0].uri)))}),[d,E,s,r]),(0,b.useEffect)((()=>{!E&&s&&d(nc(null))}),[d,s,E]);const A=(0,b.useCallback)((e=>d(((e,t=0,r)=>({type:U.Z.CHANGE_PAGE,payload:{pageNumber:e,debounceTime:t,entityTypeUri:r}}))(e,250,n))),[d,n]),R=(0,b.useCallback)((e=>d(((e,t)=>({type:U.Z.CHANGE_ROWS_PER_PAGE,payload:{number:e,entityTypeUri:t}}))(e,n))),[d,n]),I=(0,b.useCallback)((e=>d(rc(e))),[d]),N=(0,b.useCallback)((0,S.debounce)((e=>d({type:Ee,payload:e})),50),[d]),P=(0,b.useCallback)((({percentageSize:e})=>g(e)),[]),D=e=>{const t=(0,_.prop)(e.uri,x);return v().createElement(xm,{entity:e,entityImportStatus:t,onEntityImportStatusChange:w})},k=(0,b.useRef)(null);return v().createElement("div",{className:O()(m.container,e)},t&&v().createElement(AE.z,null),(0,Ai.gj)(c)?v().createElement(OI,{quantity:a}):v().createElement(pI,null),v().createElement(sE,{className:m.resizablePanesWrapper,orientation:"vertical",size:p?y:"100%",minSize:480,maxSize:-480,allowResize:p,onChange:P},v().createElement("div",{className:m.pane},v().createElement(RE,{error:v().createElement(wE,{LogoRenderer:CE.ERROR,text:li().text("Something went wrong."),variant:xE.embedded})},(()=>{const e=l||null;return a?v().createElement("div",{className:h?m.tableContainer:m.listContainer,ref:f},h?v().createElement(wI,{entities:r,entityToHighlight:e,selectedEntityUri:s,entityTypeUri:n,onEntityClick:E?I:void 0,onEntityHover:T?N:void 0,entitiesImportStatus:x,onEntityImportStatusChange:w,basicTableRef:k}):v().createElement(gE,{entities:r,entityToHighlight:e,selectedEntityUri:s,onEntityClick:E?I:void 0,onEntityHover:T?N:void 0,entitiesImportStatus:x,entityButtonsRenderer:D}),a>Z.Tu[0]&&v().createElement("div",{className:m.pagination},v().createElement(hE.Z,{count:a,rowsPerPageOptions:Z.Tu,rowsPerPage:i||Z.Tu[0],page:o||0,onChangePage:A,onChangeRowsPerPage:R,basicTableRef:k}))):v().createElement(wE,{LogoRenderer:CE.SEARCH_RESULTS,text:li().text("No results found."),secondaryText:li().text("Try adjusting your search or filter to find what you're looking for."),variant:xE.embedded})})())),v().createElement("div",{className:m.pane},v().createElement(zM,null))))};HM.propTypes={page:fp().number,quantity:fp().number,rowsPerPage:fp().number,entities:fp().array,loading:fp().bool,dispatch:fp().func,entityToHighlight:fp().string,mode:fp().string,entityTypeTab:fp().string,className:fp().string,isPreviewPanelOpen:fp().bool,previewPanelMode:fp().oneOf(Object.values(Z.om)),selectedEntityUri:fp().string},HM.defaultProps={quantity:0,entities:[]};const YM=(0,yp.connect)((e=>{const t=(0,Ri.tB)(e);return{quantity:(0,ai.NU)(e,{entityTypeUri:t}),page:(0,ai.fx)(e,{entityTypeUri:t}),rowsPerPage:(0,ai.Uz)(e,{entityTypeUri:t}),entities:(0,ai.BP)(e,{entityTypeUri:t}),loading:(0,ai.gP)(e),entityToHighlight:(0,Ri.Dn)(e),mode:(0,Ri.XM)(e),entityTypeTab:t,previewPanelMode:(0,Ri.qx)(e),isPreviewPanelOpen:(0,Ri.jr)(e),selectedEntityUri:Js(e)}}))(HM);var WM=r(4539),GM=r.n(WM),qM=r(4494);const ZM=(0,Rp.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"}}),$M=e=>{const t=ZM(),r=e.values&&e.values.join(", ");return v().createElement(dg(),{label:v().createElement("div",{className:t.labelContainer},e.title&&v().createElement("div",{className:t.title},e.title,": "),e.values&&v().createElement(sd.Y,{value:r},v().createElement("div",{className:t.values},r))),onDelete:e.onDelete,variant:"outlined",deleteIcon:v().createElement(fg(),{"data-reltio-id":"facet-bar-chip-delete"}),classes:{root:t.root,deleteIcon:t.deleteIcon,label:t.label}})};$M.propTypes={classes:fp().object,title:fp().string,values:fp().array,onDelete:fp().func};const KM=$M;class XM extends b.PureComponent{constructor(...e){super(...e),this.state={anchorEl:null},this.handleClick=e=>{const{currentTarget:t}=e;this.setState((e=>({anchorEl:e.anchorEl?null:t})))},this.handleClose=e=>{e.stopPropagation(),this.setState({anchorEl:null})}}render(){const{classes:e,items:t}=this.props,{anchorEl:r}=this.state,n=Boolean(r),a=n?"moreButtonPopper":null;return v().createElement(b.Fragment,null,v().createElement(qh(),{"aria-describedby":a,color:"primary",variant:"contained",classes:{root:e.root,label:e.label},onClick:this.handleClick},li().text(`+ ${t.length}`)),v().createElement(cN.r,{id:a,open:n,onClose:this.handleClose,anchorEl:r,placement:"bottom-start"},v().createElement(jI(),{elevation:2,classes:{root:e.popperContent}},this.props.items)))}}XM.propTypes={classes:fp().object,items:fp().array},XM.defaultProps={items:[]};const QM=Uf()((()=>({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"}})))(XM);var JM=r(74635),eV=r.n(JM),tV=r(60904),rV=r(96177),nV=r.n(rV),aV=r(34319);const iV=(0,Rp.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 oV(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){lV(e,t,r[t])}))}return e}function lV(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function sV(){return sV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},sV.apply(null,arguments)}const cV=({isOpen:e,isAvailableUpdate:t,isChangedSavedSearch:r,currentSavedSearch:n,onClose:a,onSave:i,onUpdate:o})=>{const l=iV(),[s,c]=(0,b.useState)(""),[u,p]=(0,b.useState)(Z.ib.private),d=t&&n&&s===n.name,m=d&&n.isPublic===(u===Z.ib.public)&&!r,f=(0,b.useCallback)((e=>{c(e.target.value)}),[]),y=(0,b.useCallback)((e=>{p(e)}),[]),g=(0,b.useCallback)((()=>d?o({share:u}):i({name:s,share:u})),[s,i,o,u,d]),h={InputProps:{classes:{input:O()(l.dialogInput,l.dialogFont)}},InputLabelProps:{classes:{root:l.dialogFont}}};return(0,b.useEffect)((()=>{if(e){const e=t?n.name:"",r=t&&n.isPublic?Z.ib.public:Z.ib.private;c(e),p(r)}}),[e,t,n]),v().createElement(Ej(),{onClose:a,open:e,PaperProps:{classes:{root:l.dialogRoot}}},v().createElement(eV(),{classes:{root:l.dialogTitle}},li().text("Save search")),v().createElement(rF(),{classes:{root:l.dialogContentRoot}},v().createElement(tV.H,sV({classes:{root:l.dialogField},label:li().text("Name"),required:!0,variant:"filled",value:s,onInput:f,size:"small",autoFocus:!0},h)),v().createElement(aV.k,{entries:Z.m2,TextFieldProps:oV({classes:{root:l.dialogField},required:!0,label:li().text("Share with"),variant:"filled",size:"small"},h),value:u,onChange:y})),v().createElement(nV(),{classes:{root:l.dialogActions},disableSpacing:!0},v().createElement(qh(),{onClick:a},li().text("Cancel")),v().createElement(qh(),{color:"primary",onClick:g,disabled:d?m:0===s.length},d?li().text("Save"):li().text("Save as"))))};cV.propTypes={isOpen:fp().bool,isAvailableUpdate:fp().bool,isChangedSavedSearch:fp().bool,currentSavedSearch:fp().object,onClose:fp().func.isRequired,onSave:fp().func.isRequired,onUpdate:fp().func.isRequired};const uV=(0,yp.connect)((e=>{const t=(0,bo.LA)(e);return{isOpen:(0,Ri.jd)(e),isAvailableUpdate:!(0,_.isNil)(t)&&(0,bo.Jv)(e),isChangedSavedSearch:(0,bo.WH)(e),currentSavedSearch:t}}),{onClose:()=>gi(!1),onSave:e=>({type:tr,payload:e}),onUpdate:e=>({type:ar,payload:e})})(cV);var pV=r(11400);function dV(){return dV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dV.apply(null,arguments)}const mV=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",dV({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"}))},fV=(0,Rp.Z)({button:{marginRight:"-4px"},dialogRoot:{minWidth:"600px",minHeight:"280px"},dialogContentRoot:{display:"flex",flexDirection:"column",gap:"20px"}}),yV=()=>{const e=fV(),t=(0,yp.useStore)(),[r,n]=(0,b.useState)(!1),[a,i]=(0,b.useState)(!1),o=(0,b.useCallback)((()=>n(!1)),[]),l=(0,b.useCallback)((()=>n(!0)),[]),s=(0,b.useCallback)((async(e,r,n)=>{const a=t.getState(),l=(0,To.Z)(a),s=(0,bo.Cc)(a,!0);i(!0);try{await(0,S.createSavedSearch)([{name:e,description:r,isPublic:n,query:s,uiState:l,type:S.SavedSearchType.SEGMENTATION}]),i(!1),o()}catch(e){(0,ii.U)(e,{defaultMessage:li().text("Something went wrong while saving of the segment")}),i(!1)}}),[t,o]);return v().createElement(v().Fragment,null,v().createElement(vd.k,{icon:mV,size:"L",onClick:l,tooltipTitle:li().text("Save as segment"),className:e.button}),v().createElement(pV.L,{isOpen:r,isSaving:a,onClose:o,onSave:s}))};function gV(){return gV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},gV.apply(null,arguments)}const hV=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",gV({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 EV(){return EV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},EV.apply(null,arguments)}const bV=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",EV({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 vV(){return vV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},vV.apply(null,arguments)}const TV=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",vV({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 OV(){return OV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},OV.apply(null,arguments)}const SV=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",OV({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 xV=r(69199),CV=r.n(xV),wV=r(37290),AV=r.n(wV);const RV=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 _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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){IV(e,t,r[t])}))}return e}function IV(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const NV=(0,Rp.Z)({title:{marginBottom:"-10px"},linkField:{margin:"10px 0"},linkInput:{textOverflow:"ellipsis",fontSize:"14px"}}),PV=({open:e,onClose:t=_.identity})=>{const r=NV(),n=(({enabled:e})=>{const[t,r]=(0,b.useState)(""),n=(0,yp.useSelector)(To.Z),a=(0,yp.useSelector)(ai.RO),i=(0,yp.useSelector)(k().selectors.getServicesPath),o=(0,yp.useSelector)(k().selectors.getUIPath);return(0,b.useEffect)((()=>{e?(0,S.rawRequest)(`${i}/searchLink`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(_V({},n,{currentTenant:a}))}).then((0,_.pipe)((0,_.prop)("link"),(0,S.getSearchLink)(o),r)).catch(si):r("")}),[e]),t})({enabled:e});return v().createElement(Ej(),{open:e,onClose:t},v().createElement(eV(),{className:r.title},li().text("Share link with search results")),v().createElement(rF(),null,v().createElement(CV(),null,li().text("With the URL link, anyone can view these search results. Paste this link in email or IM for testing, analyze, sharing and more.")),v().createElement(AV(),{className:r.linkField,InputProps:{classes:{input:r.linkInput}},label:n?"URL":"",placeholder:li().text("Loading URL..."),value:n,variant:"filled",fullWidth:!0,size:"small"})),v().createElement(nV(),null,v().createElement(qh(),{onClick:t},li().text("Cancel")),v().createElement(qh(),{disabled:!n,onClick:(0,_.pipe)((()=>RV(n)),t),color:"primary",autoFocus:!0},li().text("Copy link"))))};PV.propTypes={open:fp().bool,onClose:fp().func};const DV=PV,kV=(0,Rp.Z)((()=>({button:{marginRight:"-4px"},exportButtonDisabled:{opacity:"0.54"}}))),LV=({customActions:e=[]})=>{const t=kV(),r=(0,yp.useDispatch)(),n=(0,yp.useSelector)(k().selectors.getUIConfig),a=(0,yp.useSelector)(k().selectors.getCanUserMakeExport),i=(0,yp.useSelector)(k().selectors.getCanUserOpenDataLoader),o=!!(0,S.findPerspectiveConfig)(S.ScreenType.Segmentation,n),l=!!(0,yp.useSelector)(ai.lF),{canExport:s}=(0,yp.useSelector)(Ri.MO),c=s&&a,u=(0,b.useCallback)((()=>{r({type:U.Z.EXPORT_RESULTS})}),[r]),p=(0,b.useCallback)((()=>{r({type:U.Z.OPEN_DATA_LOADER})}),[r]),d=(0,yp.useSelector)(ai.ai),m=(0,b.useCallback)((()=>{r(gi(!0))}),[r]),f=[],[y]=(()=>{const e=(0,yp.useSelector)(k().selectors.getCanUserStartProcessFromQuery),t=(0,yp.useSelector)(k().selectors.getWorkflowPath),r=(0,yp.useSelector)(k().selectors.getWorkflowEnvironmentUrl),n=(0,yp.useSelector)(Ri.FH),a=(0,yp.useSelector)(k().selectors.getTenant),i=(0,yp.useDispatch)(),o=(0,yp.useSelector)(ai.FR),{globalFilter:l}=(0,yp.useSelector)(k().selectors.getGlobalSearchRequestOptions),s=(0,Ua._k)(o,[],l),c=(0,b.useCallback)((()=>{const{processType:e}=n;(0,S.startProcessFromQuery)({workflowPath:t,processType:e,searchString:s,tenant:a,environment:r}).then((()=>{i(xi({message:li().text("Match reviews successfully submitted. Go to Inbox to view their status."),actionToDispatch:D.ui.actions.openAppFromChocolateBar("Inbox"),actionLabel:li().text("Go to inbox"),autoHideDuration:null}))})).catch((e=>{si(e)}))}),[n,t,s,a,r,i]),u=s.includes("matches")||s.includes("matchRules");return[e&&t&&n?{disabled:!u,text:li().text("Request Match Review"),tooltip:li().text("Filter on match rules or potential matches to enable Potential Match Review"),onClick:c,id:"-request-match-review"}:null]})();y&&f.push(y);const[g]=(()=>{const e={NO_ENTITY_TYPE:li().text("Please select exactly one entity type or switch to table mode")},t=(0,yp.useDispatch)(),r=(0,yp.useSelector)(Ri.MO),n=(0,yp.useSelector)(k().selectors.getCanUserMakeBulkUpdate),a=!!(0,yp.useSelector)(ai.lF),i=(0,yp.useSelector)(Kc),o=!!i,l=Boolean(null==r?void 0:r.bulkUpdate),s=(0,yp.useSelector)(k().selectors.getMetadata),c=(0,yp.useSelector)(Ri.Xf),u=l&&n&&!a?{disabled:!o||!(e=>(0,ja.wW)(s,{},c).some((t=>t.value===e)))(i),text:li().text("Bulk update"),tooltip:o?null:e.NO_ENTITY_TYPE,onClick:()=>t(wi(!0)),id:"-bulk-update"}:null;return[u]})();g&&f.push(g);const[h,E]=(0,b.useState)(!1);return f.push({text:li().text("Share link"),onClick:()=>E(!0),id:"-share-link"}),f.push(...e),v().createElement(v().Fragment,null,i&&v().createElement(vd.k,{icon:TV,size:"L",onClick:p,tooltipTitle:li().text("Load data"),className:t.button,"data-reltio-id":"reltio-search-actions-menu-load-data"}),c&&v().createElement(vd.k,{icon:hV,size:"L",onClick:u,tooltipTitle:li().text("Export"),showForDisabled:!0,classes:{disabled:t.exportButtonDisabled},className:t.button,disabled:l,"data-reltio-id":"reltio-search-actions-menu-export"}),v().createElement(vd.k,{tooltipTitle:li().text("Save"),showForDisabled:!0,className:O()({[t.button]:f.length>0}),disabled:!d,onClick:m,icon:bV,size:"L","data-reltio-id":"reltio-search-actions-menu-save"}),o&&v().createElement(yV,null),f.length>0&&v().createElement(vN,{buttonComponent:Ap.T,buttonProps:{icon:SV,size:"L","data-reltio-id":"reltio-search-actions-menu"},menuId:"custom-actions",menuItems:f}),v().createElement(uV,null),v().createElement(DV,{open:h,onClose:()=>E(!1)}))},UV="#FF1744",jV=(0,Rp.Z)({indicatorWrapper:{width:0,height:"20px",position:"relative"},indicatorTooltipArea:{width:"10px",height:"20px"},indicator:{width:"3px",height:"3px",backgroundColor:UV,border:"1px solid",borderColor:UV,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"}}),FV=()=>{const e=(0,yp.useSelector)(bo.LA),t=(0,yp.useSelector)(bo.WH),r=(0,b.useContext)(qM._),n=jV();if(!e)return null;const a=e.name,i=r?li().text("Segment has changed"):li().text("Saved search has changed");return v().createElement(v().Fragment,null,v().createElement("div",{className:n.wrapper},v().createElement(Tf(),{variant:"body2",component:"span",classes:{root:n.for}},li().text("for")),v().createElement(sd.Y,{value:a},v().createElement(Tf(),{variant:"body2",classes:{root:n.label}},a))),t&&v().createElement(ag(),{title:i,placement:"bottom"},v().createElement("div",{className:n.indicatorWrapper,"data-reltio-id":"changed-indicator"},v().createElement("div",{className:n.indicator}),v().createElement("div",{className:n.indicatorTooltipArea}))))},MV=(0,Rp.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}}),VV=()=>{const e=MV(),t=(0,yp.useSelector)(k().selectors.getDataTenants),r=t&&t.length>0,n=(0,yp.useSelector)(ai.t9),a=(0,yp.useSelector)(k().selectors.getTenantName),i=n?n.label:a;return r&&v().createElement("div",{className:e.wrapper},v().createElement(Tf(),{variant:"body2",component:"span",classes:{root:e.in}},li().text("in")),v().createElement(sd.Y,{value:a},v().createElement(Tf(),{variant:"body2",classes:{root:e.label}},i)))};var BV=r(81877),zV=r.n(BV);const HV=(0,Rp.Z)({dialogPaper:{height:"70vh"},contentRoot:{padding:0,display:"flex",flexDirection:"column",overflow:"hidden"},tabContent:{display:"flex",flex:"1 1 auto"},tabsWrapper:{padding:"0 24px"}}),YV=(0,Rp.Z)((e=>({container:{display:"flex",alignItems:"center",paddingTop:17,paddingBottom:11,paddingLeft:15,paddingRight:15},selected:{backgroundColor:(0,Rm.alpha)(e.palette.primary.main,.12)}}))),WV=(0,Rp.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}}),GV=(0,Rp.Z)({closeButton:{marginRight:"10px"}}),qV=({onClose:e})=>{const t=GV();return v().createElement(Ap.T,{size:"L",icon:Sp(),className:t.closeButton,onClick:e})};qV.propTypes={onClose:fp().func};const ZV=qV,$V=({selectedNumber:e,onDelete:t,onClose:r})=>{const n=WV();return v().createElement(v().Fragment,null,v().createElement("div",{className:O()(n.title,n.flex1)},v().createElement(ZV,{onClose:r}),v().createElement(Tf(),{color:"primary"},li().text("Selected: ${count}",{count:e}))),v().createElement(vd.k,{tooltipTitle:li().text("Delete"),size:"L",icon:Vk(),className:n.deleteButton,onClick:t}))};$V.propTypes={selectedNumber:fp().number,onClose:fp().func,onDelete:fp().func};const KV=$V,XV=(0,Rp.Z)((()=>({white:{backgroundColor:"rgb(255, 255, 255)",boxShadow:"0 1px 3px 0 rgba(0,0,0,0.24)"}})));function QV(){return QV=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},QV.apply(null,arguments)}function JV(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){eB(e,t,r[t])}))}return e}function eB(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const tB=e=>{let{classes:t}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["classes"]);const n=XV({});return v().createElement(Dp,QV({classes:JV({},t,{focused:n.white})},r))};var rB=r(34480),nB=r.n(rB);const aB=(0,Rp.Z)((e=>({changedFiltersIndicator:{backgroundColor:(0,Rm.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"}}))),iB=e=>e?Z.ib.public:Z.ib.private,oB=e=>e===Z.ib.public,lB=({className:e,findPublic:t,favoriteOnly:r,onChangeFilters:n})=>{const a=aB(),i=(0,b.useRef)(),[o,l]=(0,b.useState)(!1),[s,c]=(0,b.useState)(t),[u,p]=(0,b.useState)(r);(0,b.useEffect)((()=>{c(t),p(r)}),[t,r]);const d=(0,b.useCallback)((()=>l((e=>!e))),[]),m=(0,b.useCallback)((e=>p(e.target.checked)),[]),f=(0,b.useCallback)((()=>{n({findPublic:s,favoriteOnly:u}),d()}),[d,n,s,u]),y=(0,b.useCallback)((()=>{c(t),p(r),d()}),[d,t,r]),g=(0,b.useCallback)((()=>{c(!0),p(!1)}),[]),h=!0===s&&!1===u;return v().createElement(v().Fragment,null,v().createElement(qh(),{ref:i,color:h?"inherit":"primary",classes:{root:e,textPrimary:a.changedFiltersIndicator},onClick:d},v().createElement(nB(),null)),v().createElement(hp(),{open:o,classes:{paper:a.popupContent},anchorEl:i.current,onClose:y,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"}},v().createElement(Tf(),{className:a.title,variant:"h6"},li().text("Filter")),v().createElement(aV.k,{entries:Z.m2,TextFieldProps:{InputLabelProps:{classes:{root:a.shareWithLabel}},label:li().text("Shared with"),variant:"filled"},classes:{root:a.shareWithRoot,menuItem:a.shareWithMenuItem},fullWidth:!0,value:iB(s),onChange:(0,_.pipe)(oB,c)}),v().createElement(Th(),{classes:{root:a.favoriteOnlyControlRoot,label:a.favoriteOnlyControlLabel},control:v().createElement(qp(),{className:a.favoriteOnlyCheckbox,checked:u,onChange:m}),label:li().text("Show favorites only")}),v().createElement("div",{className:a.buttonsGroup},v().createElement(qh(),{onClick:g,disabled:h},li().text("Clear all")),v().createElement("div",null,v().createElement(qh(),{onClick:y,className:a.cancelButton},li().text("Cancel")),v().createElement(qh(),{onClick:f,color:"primary"},li().text("Apply"))))))};lB.propTypes={className:fp().string,findPublic:fp().bool,favoriteOnly:fp().bool,onChangeFilters:fp().func,onChangeFavoriteOnly:fp().func};const sB=(0,yp.connect)((e=>({findPublic:(0,bo.kU)(e),favoriteOnly:(0,bo.VS)(e)})),{onChangeFilters:({findPublic:e,favoriteOnly:t})=>({type:pr,payload:{findPublic:e,favoriteOnly:t}})})(lB),cB=({type:e,onSearch:t,placeholder:r,onClose:n})=>{const a=WV();return v().createElement(v().Fragment,null,v().createElement("div",{className:a.main},v().createElement("div",{className:a.title},v().createElement(ZV,{onClose:n}),v().createElement(Tf(),{variant:"h6"},li().text("Saved & recent searches"))),v().createElement("div",{className:a.searchBox},v().createElement(tB,{fullWidth:!0,onSearch:t,placeholder:r}))),e===Z.uJ.saved&&v().createElement(sB,{className:a.filterButton}))};cB.propTypes={type:fp().oneOf(Object.values(Z.uJ)),onClose:fp().func,onSearch:fp().func,placeholder:fp().string};const uB=cB,pB=({type:e,selectedNumber:t,onClose:r,dispatch:n})=>{const a=YV(),i=(0,b.useCallback)((()=>{const t=e===Z.uJ.saved?{type:Sr}:{type:Mr};n(t)}),[e,n]),o=(0,b.useCallback)((0,S.debounce)((t=>{const r=e===Z.uJ.saved?{type:Ar,payload:t}:{type:Hr,payload:t};n(r)}),500),[e,n]),l=(0,_.cond)([[(0,_.equals)(Z.uJ.saved),(0,_.always)(li().text("Search name"))],[(0,_.equals)(Z.uJ.recent),(0,_.always)(li().text("Search for filtered entity types and attributes"))]])(e);return v().createElement(eV(),{className:O()(a.container,{[a.selected]:t})},t?v().createElement(KV,{selectedNumber:t,onDelete:i,onClose:r}):v().createElement(uB,{type:e,onSearch:o,onClose:r,placeholder:l}))};pB.propTypes={type:fp().oneOf(Object.values(Z.uJ)).isRequired,selectedNumber:fp().number,onClose:fp().func,dispatch:fp().func};const dB=(0,yp.connect)(((e,t)=>({selectedNumber:t.type===Z.uJ.saved?(0,bo.g2)(e):Ds(e)})))(pB),mB="0.75rem",fB=(0,Rp.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:mB},paginationCaption:{fontSize:mB}});var yB=r(54622);const gB=fp().shape({field:fp().string,order:fp().oneOf(["asc","desc"])}),hB=fp().shape({label:fp().string,name:fp().string,description:fp().string,type:fp().string,hidden:fp().bool,faceted:fp().bool,searchable:fp().bool,uri:fp().string,access:fp().arrayOf(fp().string),cardinality:fp().shape({minValue:fp().number,maxValue:fp().number})}),EB=fp().shape({title:fp().string,pathToTitle:fp().arrayOf(fp().string),fieldName:fp().string,entityTypeUri:fp().string,attrType:hB,uri:fp().string,groupName:fp().string}),bB=fp().shape({id:fp().oneOfType([fp().number,fp().string]),values:fp().array,data:EB,filter:fp().string,operator:fp().string}),vB="0.8rem",TB=(0,Rp.Z)((e=>{const t=(0,Rm.lighten)(e.palette.primary.main,.88),r=(0,Rm.alpha)(t,0),n=(0,Rm.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,Rm.alpha)(n,0)}, ${n} 100%)`}};return{defaultWrapper:{whiteSpace:"nowrap",overflow:"hidden",padding:"0 22px",fontSize:vB,display:"flex",alignItems:"center",height:"100%","&:after":a},numberWrapper:{whiteSpace:"nowrap",overflow:"hidden",padding:"0 24px 0 22px",fontSize:vB,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:vB,"&::-ms-clear":{display:"none"}},nameContainer:{flex:1,overflow:"hidden"},editing:{},editNameButton:{},searchName:{cursor:"pointer",lineHeight:"29px",position:"relative",whiteSpace:"nowrap",overflow:"hidden",fontSize:vB,"&: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:vB},sharingMenuItem:{fontSize:vB,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"}}})),OB=({mode:e})=>{const t=TB(),r=(0,yp.useDispatch)(),n=e===Z.uJ.saved?bo.tc:ks,a=(0,yp.useSelector)(n),i=e===Z.uJ.saved?bo.hY:Ls,o=(0,yp.useSelector)(i),l=(0,b.useCallback)((()=>{e===Z.uJ.saved?r(o?yo():{type:mr}):r(o?Ts():{type:jr})}),[r,o,e]);return v().createElement("div",{className:O()(t.headCell,t.checkbox)},v().createElement(qp(),{indeterminate:!a&&o,checked:a,onChange:l}))};OB.propTypes={mode:fp().string};const SB=(0,Ld.q)((0,_.pick)(["mode"]))(OB),xB=e=>{const t=t=>{const r=TB(),{rowValue:{checked:n}}=t;return v().createElement("div",{className:O()(r.rowCell,{[r.checkedRowCell]:n})},v().createElement(e,t))};return t.propTypes={rowValue:fp().shape({checked:fp().bool})},t},CB=(0,cd.T)(qp()),wB=({value:e=!1,rowValue:{uri:t,isOwnSearch:r},onClick:n})=>{const a=TB(),i=!r;return v().createElement("div",{className:O()(a.headCell,a.checkbox)},v().createElement(CB,{showForDisabled:!0,tooltipTitle:i&&li().text("Cannot edit because you're not the owner"),tooltipPlacement:"bottom-start",disabled:i,checked:e,onChange:e=>n(t,e.target.checked)}))};wB.propTypes={value:fp().bool,rowValue:fp().shape({uri:fp().string,isOwnSearch:fp().bool}),onClick:fp().func};const AB=(0,Ld.q)((({onSelectItem:e})=>({onClick:e})))(xB(wB));var RB=r(92332);function _B(){return _B=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},_B.apply(null,arguments)}function IB(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){NB(e,t,r[t])}))}return e}function NB(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const PB=e=>{let{className:t}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className"]);const n=TB(),{headCellData:a}=r;return v().createElement("div",{className:O()(n.headCell,t)},v().createElement(RB.default,_B({},r,{headCellData:IB({},a,{label:v().createElement(sd.Y,{value:a.label},v().createElement("div",{className:n.headLabel},a.label))})})))};PB.propTypes={className:fp().string,headCellData:fp().shape({id:fp().string,label:fp().oneOfType([fp().string,fp().node]),sortable:fp().bool,resizable:fp().bool,className:fp().string,initialWidth:fp().number,minWidth:fp().number,autoResize:fp().bool,renderer:fp().func})};const DB=PB;function kB(){return kB=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},kB.apply(null,arguments)}const LB=e=>{const t=TB();return v().createElement(DB,kB({className:t.nameHeadCell},e))};LB.propTypes={headCellData:fp().shape({id:fp().string,label:fp().oneOfType([fp().string,fp().node]),sortable:fp().bool,resizable:fp().bool,className:fp().string,initialWidth:fp().number,minWidth:fp().number,autoResize:fp().bool,renderer:fp().func})};const UB=LB;var jB=r(18122),FB=r.n(jB),MB=r(62839),VB=r.n(MB);function BB(){return BB=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},BB.apply(null,arguments)}const zB=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",BB({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 HB(){return HB=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},HB.apply(null,arguments)}const YB=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",HB({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 WB=r(74492),GB=r.n(WB),qB=r(72246),ZB=r.n(qB);const $B=({value:e,rowValue:{uri:t,isFavorite:r,isOwnSearch:n,isEditing:a,isGlobalFilter:i},onStarClick:o,onGlobalClick:l,onApply:s,onChangeName:c,onSetEditing:u})=>{const p=TB(),d=n&&!a,[m,f]=(0,b.useState)(e);(0,b.useEffect)((()=>{f(e)}),[e]);const y=(0,b.useCallback)((()=>{c(t,m)}),[t,m,c]),g=(0,b.useCallback)((()=>o(t,!r)),[o,t,r]),h=(0,b.useCallback)((()=>l(t,!i)),[l,t,i]),E=(0,b.useCallback)((()=>u(t,!0)),[u,t]),T=(0,b.useCallback)((()=>s(t)),[s,t]),S=(0,_.cond)([[(0,_.always)(n),(0,_.always)(li().text("Mark as favorite"))],[(0,_.always)(r),(0,_.always)(li().text("Cannot ummark because you're not the owner"))],[_.T,(0,_.always)("")]])();return v().createElement("div",{className:O()(p.nameWithStar,{[p.editing]:a})},v().createElement(vd.k,{showForDisabled:!0,tooltipTitle:S,tooltipPlacement:n?"bottom":"bottom-start",disabled:!n,className:O()(p.starButton,{[p.checkedStarButton]:r},{[p.enabledButton]:n}),size:"M",icon:r?FB():VB(),onClick:g}),v().createElement(vd.k,{tooltipTitle:i?li().text("Remove Global filter"):li().text("Set as Global filter"),className:O()(p.filterButton,p.enabledButton,{[p.checkedFilterButton]:i}),size:"M",icon:i?zB:YB,onClick:h}),v().createElement("div",{className:p.nameContainer},a?v().createElement(ZB(),{onClickAway:y},v().createElement("div",null,v().createElement(tV.H,{variant:"filled",hiddenLabel:!0,size:"small",fullWidth:!0,autoFocus:!0,classes:{root:p.nameTextEditorRoot},InputProps:{classes:{input:p.nameInput}},value:m,onInput:e=>f(e.target.value),onKeyDown:(0,_.when)((0,_.propEq)("keyCode",13),y)}))):v().createElement(sd.Y,{value:e},v().createElement("div",{className:p.searchName,onClick:T},e))),d&&v().createElement(vd.k,{tooltipTitle:li().text("Edit"),className:p.editNameButton,size:"M",icon:GB(),onClick:E}))};$B.propTypes={value:fp().string,rowValue:fp().shape({uri:fp().string,isFavorite:fp().bool,isOwnSearch:fp().bool,isEditing:fp().bool,isGlobalFilter:fp().bool}),onStarClick:fp().func,onGlobalClick:fp().func,onApply:fp().func,onChangeName:fp().func,onSetEditing:fp().func};const KB=(0,Ld.q)((({onChangeIsFavorite:e,onChangeIsGlobal:t,onSearchApply:r,onSetItemEditing:n,onChangeItemName:a})=>({onStarClick:e,onGlobalClick:t,onApply:r,onSetEditing:n,onChangeName:a})))(xB($B)),XB=({value:e,rowValue:{uri:t,isOwnSearch:r},onChange:n})=>{const a=TB(),i=(0,b.useCallback)((r=>{const a=oB(r);a!==e&&n(t,a)}),[t,e,n]);return v().createElement("div",{className:a.sharingWrapper},v().createElement(aV.k,{entries:Z.m2,value:iB(e),onChange:i,disableUnderline:!0,disabled:!r,MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"center"},transformOrigin:{vertical:"top",horizontal:"center"},elevation:3},TextFieldProps:{classes:{root:a.sharingRoot}},classes:{root:a.sharingInput,menuItem:a.sharingMenuItem,disabled:a.sharingDisabled,icon:O()({[a.sharingIconDisabled]:!r})}}))};XB.propTypes={value:fp().bool,rowValue:fp().shape({uri:fp().string,isOwnSearch:fp().bool}),onChange:fp().func};const QB=(0,Ld.q)((({onChangeIsPublic:e})=>({onChange:e})))(xB(XB)),JB=({value:e,rowValue:t,onClick:r})=>{const n=TB(),a=r?()=>r(t):()=>{};return v().createElement(sd.Y,{value:e},v().createElement("div",{className:O()(n.defaultWrapper,{[n.clickableArea]:r}),onClick:a},e))};JB.propTypes={value:fp().any,rowValue:fp().object,onClick:fp().func};const ez=xB(JB);function tz(){return tz=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},tz.apply(null,arguments)}const rz=e=>{const{rowValue:{updateDate:t,createDate:r}}=e,n=t||r;return v().createElement(ez,tz({},e,{value:n&&li().date(n,"L")}))};rz.propTypes={rowValue:fp().shape({updateDate:fp().number,createDate:fp().number})};const nz=rz,az=({values:e})=>(0,_.pipe)((0,_.cond)([[_.isNil,_.T],[Array.isArray,(0,_.pipe)(_.flatten,_.isEmpty)],[_.T,_.isEmpty]]),_.not)(e),iz=(0,_.curry)(((e,t)=>(0,_.path)(["facetsData",t.fieldName,"values","length"],e)>0)),oz=e=>e&&e.slice(1).join(" / "),lz=(e,t,r)=>(e[t]||(e[t]={title:t,attributes:[]}),e[t].attributes=(0,_.uniq)(e[t].attributes.concat(r)),e),sz=({rowValue:{uiState:e}})=>{const t=TB(),r=(0,b.useMemo)((()=>(({facets:e,advanced:t}={})=>{try{const r=t?((e=[])=>e.flatMap((e=>e.attributes)).filter(az).reduce(((e,{data:{title:t,groupName:r,pathToTitle:n}})=>{const a=oz(n)||t;return lz(e,r,a)}),{}))(t):((e={})=>(e.facetsConfigs||[]).filter((0,_.pipe)(S.isTypeFacet,_.not)).filter(iz(e)).reduce(((e,t)=>{const r=(0,_.path)(["pathToTitle",0],t)||li().text("Special"),n=oz(t.pathToTitle)||t.title;return lz(e,r,n)}),{}))(e);return Object.values(r)}catch(e){return[]}})(e)),[e]),n=(0,b.useMemo)((()=>(e=>e.flatMap((e=>e.attributes)).length)(r)),[r]),a=!!r.length&&v().createElement("div",null,r.map((({title:e,attributes:r})=>v().createElement("div",{key:e,className:t.tooltipSection},v().createElement("h6",{className:t.tooltipSectionHeader},e),r.map((e=>v().createElement("div",{key:e,className:t.tooltipText},e)))))));return v().createElement("div",{className:t.numberWrapper},(i=n,a?v().createElement(ag(),{title:a,classes:{tooltip:t.tooltip},disableFocusListener:!0,disableTouchListener:!0},v().createElement("span",null,i)):i));var i};sz.propTypes={rowValue:fp().shape({uiState:fp().shape({facets:fp().object,advanced:fp().array})})};const cz=xB(sz);function uz(){return uz=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},uz.apply(null,arguments)}const pz=e=>{const t=TB();return v().createElement(DB,uz({className:t.totalHeadCell},e))};pz.propTypes={headCellData:fp().shape({id:fp().string,label:fp().oneOfType([fp().string,fp().node]),sortable:fp().bool,resizable:fp().bool,className:fp().string,initialWidth:fp().number,minWidth:fp().number,autoResize:fp().bool,renderer:fp().func})};const dz=pz;var mz=r(67520),fz=r.n(mz);const yz=({value:e})=>{const t=TB();return v().createElement(sd.Y,{value:e},v().createElement("div",{className:t.numberWrapper},li().number(e)))};yz.propTypes={value:fp().number};const gz=xB(yz),hz=e=>{const t=TB(),{rowValue:{isTotalLoading:r,isOwnSearch:n,uri:a},onDeleteItem:i,onLoadTotalForItem:o,value:l}=e,s=(0,b.useCallback)((()=>{i(a)}),[i,a]),c=n?li().text("Delete"):li().text("Cannot delete because you're not the owner"),u=r?li().text("Loading data"):li().text("Load data"),p=(0,b.useCallback)((()=>{o(a)}),[o,a]),d=r||-1===l;return v().createElement("div",{className:t.totalWithButtonsWrapper},d?v().createElement(vd.k,{showForDisabled:!0,tooltipTitle:u,tooltipPlacement:"bottom-end",disabled:r,size:"L",icon:fz(),onClick:p}):v().createElement(gz,e),v().createElement(vd.k,{showForDisabled:!0,className:t.deleteButton,tooltipTitle:c,tooltipPlacement:"bottom-end",disabled:!n,size:"L",icon:Vk(),onClick:s}))};hz.propTypes={value:fp().number,rowIndex:fp().number,rowValue:fp().shape({isOwnSearch:fp().bool,isTotalLoading:fp().bool,uri:fp().string}),onDeleteItem:fp().func,onLoadTotalForItem:fp().func};const Ez=(0,Ld.q)((({onDeleteItem:e,onLoadTotalForItem:t})=>({onDeleteItem:e,onLoadTotalForItem:t})))(xB(hz));function bz(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const vz={rowCellValueRenderer:ez,headCellRenderer:DB,autoResize:!1},Tz=[{id:"checked",label:"",initialWidth:55,headCellRenderer:SB,rowCellValueRenderer:AB},{id:"name",get label(){return li().text("Name")},autoResize:!0,headCellRenderer:UB,rowCellValueRenderer:KB,sortable:!0},{id:"isPublic",get label(){return li().text("Shared with")},rowCellValueRenderer:QB},{id:"owner",get label(){return li().text("Created by")},initialWidth:260},{id:"updateDate",get label(){return li().text("Last modified")},rowCellValueRenderer:nz,sortable:!0},{id:"attributes",get label(){return li().text("Filtered attributes")},rowCellValueRenderer:cz},{id:"total",get label(){return li().text("Number of profiles")},headCellRenderer:dz,rowCellValueRenderer:Ez,initialWidth:194}].map((e=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){bz(e,t,r[t])}))}return e}({},vz,e)));function Oz(){return Oz=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Oz.apply(null,arguments)}function Sz(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const xz=({items:e,total:t,sorting:r,page:n,rowsPerPage:a,loading:i,searchValue:o,globalFilterSavedSearchesUris:l=[],onSearchApply:s,onChangeIsFavorite:c,onChangeIsPublic:u,onChangeIsGlobal:p,onChangeRowsPerPage:d,onChangePage:m,onSelectItem:f,onDeselectAllItems:y,onDeleteItem:g,onChangeItemName:h,onSetItemEditing:E,onLoadTotalForItem:T,onSort:O})=>{const x=fB(),C=(0,b.useMemo)((()=>({cellBorder:x.cellBorder})),[x]),[w,A]=(0,b.useState)(null),[R,_]=(0,b.useState)(null),I=(0,b.useRef)(null);(0,b.useEffect)((()=>y),[y]);const N=(0,b.useCallback)((e=>{l.includes(e)?_(e):g(e)}),[l,g]),P=(0,b.useMemo)((()=>({mode:Z.uJ.saved,onSelectItem:f,onChangeIsFavorite:c,onChangeIsGlobal:p,onSearchApply:s,onSetItemEditing:E,onChangeItemName:h,onDeleteItem:N,onLoadTotalForItem:T,onChangeIsPublic:u})),[N,f,c,p,T,s,E,h,u]),D=(0,b.useMemo)((()=>(0,S.isEmptyValue)(o)?{LogoRenderer:CE.SELECT_ATTRIBUTES,text:li().text("No saved searches."),secondaryText:li().text("Save time by creating saved searches for queries you regularly search for.")}:{LogoRenderer:CE.SEARCH_RESULTS,text:li().text("No results found."),secondaryText:li().text("Try adjusting your search or filter to find what you're looking for.")}),[o]),k=(0,b.useMemo)((()=>e.map((e=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){Sz(e,t,r[t])}))}return e}({},e,{isGlobalFilter:l.includes(e.uri)})))),[e,l]);return v().createElement("div",{className:x.tableWrapper},t>0?v().createElement(v().Fragment,null,v().createElement(Id.M,{columnsData:Tz,rowsData:k,context:P,sorting:r,getRowCellHeight:null,defaultColumnWidth:140,defaultColumnMinWidth:140,defaultRowHeight:48,headRowHeight:47,hoverStateEnabled:!0,onSort:O,hoverRowIndex:w,onRowHover:A,classes:C,ref:I}),v().createElement(hE.Z,{classes:{root:x.paginationRoot,caption:x.paginationCaption},count:t,rowsPerPageOptions:Z.Tu,rowsPerPage:a,onChangeRowsPerPage:d,page:n,onChangePage:m,basicTableRef:I}),v().createElement(yB.U,{open:!!R,title:li().text("Keep the global filter?"),content:li().text("The saved search you are deleting is being used as a global filter in your tenant. Do you want to keep the global filter?"),discardCaption:li().text("NO, remove it"),saveCaption:li().text("YES, KEEP GLOBAL FILTER"),onCancel:()=>_(null),onDiscard:()=>{p(R,!1),g(R),_(null)},onSave:()=>{g(R),_(null)}})):v().createElement(wE,Oz({},D,{variant:xE.embedded})),i&&v().createElement(AE.z,null))};xz.propTypes={items:fp().arrayOf(fp().shape({uri:fp().string,name:fp().string,isPublic:fp().bool,isFavorite:fp().bool,isOwnSearch:fp().bool,isEditing:fp().bool,checked:fp().bool,owner:fp().string,updateDate:fp().number,query:fp().string})),total:fp().number,sorting:gB,page:fp().number,rowsPerPage:fp().number,loading:fp().bool,searchValue:fp().string,globalFilterSavedSearchesUris:fp().arrayOf(fp().string),onSearchApply:fp().func,onChangeIsFavorite:fp().func,onChangeIsPublic:fp().func,onChangeIsGlobal:fp().func,onChangeRowsPerPage:fp().func,onChangePage:fp().func,onSelectItem:fp().func,onDeselectAllItems:fp().func,onDeleteItem:fp().func,onChangeItemName:fp().func,onSetItemEditing:fp().func,onSort:fp().func};const Cz=(0,yp.connect)((e=>({items:(0,bo.gg)(e),total:(0,bo.Yi)(e),sorting:(0,bo.rT)(e),page:(0,bo.wH)(e),rowsPerPage:(0,bo.s6)(e),loading:(0,bo.w7)(e),searchValue:(0,bo.U3)(e),globalFilterSavedSearchesUris:k().selectors.getGlobalFilterSavedSearchesUris(e)})),{onSearchApply:(e,t=Z.XU)=>({type:Rr,payload:{uri:e,debounceTime:t}}),onChangeIsFavorite:(e,t)=>({type:hr,payload:{uri:e,isFavorite:t}}),onChangeIsPublic:(e,t)=>({type:yr,payload:{uri:e,isPublic:t}}),onChangeIsGlobal:(e,t)=>({type:br,payload:{uri:e,isGlobalFilter:t}}),onChangeRowsPerPage:e=>({type:ur,payload:e}),onChangePage:e=>({type:cr,payload:e}),onSelectItem:(e,t)=>({type:dr,payload:{uri:e,checked:t}}),onDeselectAllItems:yo,onDeleteItem:e=>({type:xr,payload:e}),onChangeItemName:(e,t)=>({type:vr,payload:{uri:e,name:t}}),onSetItemEditing:(e,t)=>({type:Or,payload:{uri:e,isEditing:t}}),onLoadTotalForItem:e=>({type:Ir,payload:e}),onSort:e=>({type:Nr,payload:e})})(xz),wz=({value:e=!1,rowValue:{createdDate:t},onClick:r})=>{const n=TB();return v().createElement("div",{className:O()(n.headCell,n.checkbox)},v().createElement(qp(),{checked:e,onChange:e=>r(t,e.target.checked)}))};wz.propTypes={value:fp().bool,rowValue:fp().shape({createdDate:fp().number}),onClick:fp().func};const Az=(0,Ld.q)((({onSelectItem:e})=>({onClick:e})))(xB(wz));function Rz(){return Rz=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Rz.apply(null,arguments)}const _z=e=>{const{rowValue:{createdDate:t}}=e,r=t;return v().createElement(ez,Rz({},e,{value:r&&li().date(r,"L LT")}))};_z.propTypes={rowValue:fp().shape({createdDate:fp().number}),onClick:fp().func};const Iz=(0,Ld.q)((({onSearchApply:e})=>({onClick:e})))(_z),Nz=e=>{const t=TB(),{rowValue:r,onDeleteItem:n,onLoadTotalForItem:a,value:i}=e,{isTotalLoading:o,createdDate:l}=r,s=(0,b.useCallback)((()=>{n(r)}),[n,r]),c=o?li().text("Loading data"):li().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(vd.k,{showForDisabled:!0,tooltipTitle:c,tooltipPlacement:"bottom-end",disabled:o,size:"L",icon:fz(),onClick:u}):v().createElement(gz,e),v().createElement(vd.k,{className:t.deleteButton,tooltipTitle:li().text("Delete"),tooltipPlacement:"bottom-end",size:"L",icon:Vk(),onClick:s}))};Nz.propTypes={value:fp().number,rowValue:fp().shape({isTotalLoading:fp().bool,createdDate:fp().number}),onDeleteItem:fp().func,onLoadTotalForItem:fp().func};const Pz=(0,Ld.q)((({onDeleteItem:e,onLoadTotalForItem:t})=>({onDeleteItem:e,onLoadTotalForItem:t})))(xB(Nz)),Dz=(0,Ld.q)((({onSearchApply:e})=>({onClick:e})))(ez);function kz(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Lz={rowCellValueRenderer:ez,headCellRenderer:DB,autoResize:!1},Uz=[{id:"checked",label:"",initialWidth:55,headCellRenderer:SB,rowCellValueRenderer:Az},{id:"createdDate",get label(){return li().text("Created")},rowCellValueRenderer:Iz,initialWidth:256},{id:"name",get label(){return li().text("Query")},autoResize:!0,rowCellValueRenderer:Dz,minWidth:150},{id:"total",get label(){return li().text("Record count")},rowCellValueRenderer:Pz,headCellRenderer:dz,initialWidth:150}].map((e=>function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){kz(e,t,r[t])}))}return e}({},Lz,e)));function jz(){return jz=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},jz.apply(null,arguments)}const Fz=({items:e,loading:t,filterWord:r,onSelectItem:n,onDeselectAllItems:a,onSearchApply:i,onDeleteItem:o,onLoadTotalForItem:l})=>{const s=fB(),c=(0,b.useMemo)((()=>({cellBorder:s.cellBorder})),[s]),[u,p]=(0,b.useState)(null);(0,b.useEffect)((()=>a),[a]);const d=(0,b.useMemo)((()=>({mode:Z.uJ.recent,onSelectItem:n,onSearchApply:i,onDeleteItem:o,onLoadTotalForItem:l})),[o,l,n,i]),m=(0,b.useMemo)((()=>(0,S.isEmptyValue)(r)?{LogoRenderer:CE.SELECT_ATTRIBUTES,text:li().text("No recent searches."),secondaryText:li().text("Your recent search history will appear here.")}:{LogoRenderer:CE.SEARCH_RESULTS,text:li().text("No results found."),secondaryText:li().text("Try adjusting your search or filter to find what you're looking for.")}),[r]);return v().createElement("div",{className:s.tableWrapper},e.length>0?v().createElement(Id.M,{columnsData:Uz,rowsData:e,context:d,getRowCellHeight:null,defaultColumnWidth:50,defaultColumnMinWidth:50,defaultRowHeight:48,headRowHeight:47,hoverStateEnabled:!0,hoverRowIndex:u,onRowHover:p,classes:c}):v().createElement(wE,jz({},m,{variant:xE.embedded})),t&&v().createElement(AE.z,null))};Fz.propTypes={items:fp().arrayOf(fp().shape({uri:fp().string,name:fp().string,isPublic:fp().bool,isFavorite:fp().bool,isOwnSearch:fp().bool,checked:fp().bool,owner:fp().string,createdDate:fp().number,query:fp().string})),loading:fp().bool,filterWord:fp().string,onSelectItem:fp().func,onSearchApply:fp().func,onDeselectAllItems:fp().func,onDeleteItem:fp().func};const Mz=(0,yp.connect)((e=>({items:Ns(e),loading:Ps(e),filterWord:_s(e)})),{onSearchApply:(e,t=Z.XU)=>({type:qr,payload:{search:e,debounceTime:t}}),onSelectItem:(e,t)=>({type:Ur,payload:{searchCreatedDate:e,checked:t}}),onDeselectAllItems:Ts,onDeleteItem:e=>({type:Br,payload:e}),onLoadTotalForItem:e=>({type:Gr,payload:e})})(Fz),Vz=({open:e,onClose:t})=>{const r=HV(),n=(0,yp.useDispatch)(),a=(0,b.useMemo)((()=>[{value:Z.uJ.saved,label:li().text("Saved searches"),content:v().createElement(Cz,null),dataReltioId:"reltio-search-saved-searches"},{value:Z.uJ.recent,label:li().text("Recent searches"),content:v().createElement(Mz,null),dataReltioId:"reltio-search-recent-searches"}]),[]),[i,o]=(0,b.useState)(a[0].value);return(0,b.useEffect)((()=>{e&&(i===Z.uJ.saved?n({type:ir}):n({type:Dr}))}),[e,n,i]),v().createElement(Ej(),{classes:{paper:r.dialogPaper},fullWidth:!0,maxWidth:"lg",open:e,onClose:t},v().createElement(dB,{type:i,onClose:t}),v().createElement(rF(),{classes:{root:r.contentRoot}},v().createElement("div",{className:r.tabsWrapper},v().createElement(bI,{value:i,tabs:a,onChange:o,scrollButtons:"auto"})),v().createElement("div",{className:r.tabContent},a.find((0,_.propEq)("value",i)).content)))};Vz.propTypes={open:fp().bool,onClose:fp().func};const Bz=Vz,zz=(0,Rp.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"}}))),Hz=({showTypography:e})=>{const t=zz(),r=(0,yp.useDispatch)(),n=(0,yp.useSelector)(Ri.tm),a=li().text("Saved & recent searches"),i=(0,b.useCallback)((()=>r(yi(!0))),[r]),o=(0,b.useCallback)((()=>r(yi(!1))),[r]);return v().createElement(v().Fragment,null,v().createElement(ag(),{title:e?"":a},v().createElement(qh(),{className:t.button,variant:"outlined",startIcon:v().createElement(zV(),{className:O()({[t.compact]:!e}),color:"action"}),onClick:i,"data-reltio-id":"reltio-search-saved-and-recent-search"},e&&v().createElement(Tf(),{variant:"button",color:"textPrimary",className:t.buttonText},a))),v().createElement(Bz,{open:n,onClose:o}))},Yz=(0,Rp.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"}}))),Wz="search",Gz="geoLocation",qz={},Zz=()=>{const e=Yz(),t=(0,yp.useDispatch)(),r=(0,yp.useSelector)(P.Mp),n=(0,yp.useSelector)(P.X0),a=(0,yp.useSelector)(ai.Qw)||qz,i=(0,yp.useSelector)(k().selectors.getSearchKeyword),o=(0,yp.useSelector)(k().selectors.getDateMask),l=(0,yp.useSelector)(k().selectors.getDateTimeMask),s=(0,yp.useSelector)(k().selectors.getAttributesPresentation)||qz,c=(0,yp.useSelector)(Ri.IJ),u=(0,yp.useSelector)((e=>(0,ai.NU)(e,{entityTypeUri:void 0}))),p=(0,yp.useSelector)(Qi.go),d=(0,b.useContext)(qM._),[m,f]=(0,b.useState)([]),[y,g]=(0,b.useState)(0),[h,E]=(0,b.useState)(!1),T=(0,b.useRef)(null),[O,x]=(0,b.useState)(!0);(0,b.useEffect)((()=>{f(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((0,ja.t8)(n,r)).filter((e=>e.values&&e.values.length)).map((e=>{const t=e.title||e.hiddenTitle,r=(0,ja.MI)([...e.data||[],...e.filteredData||[]],(0,_.path)(["attrType","type"],e)===S.DataTypes.TYPE_DATE?e.values.map((e=>e.map((e=>S.utils.dates.toLocalDate(e).getTime())))):e.values.map((0,S.mapFilterValue)((0,S.applyPresentationStrategyToValue)((e=>(0,S.getNumberFormat)((0,S.getAttrDataTypeDefinition)(e.attrType),s,S.intl.getLocale()).strategy)(e)))),e.type,{dateMask:o,dateTimeMask:l});return{fieldName:e.fieldName,title:t,values:r}}));i&&e.push({fieldName:Wz,title:li().text("Search"),values:[i.value]});const{values:[t]=[],type:c}=(0,_.pathOr)({},["mapSearch"],a);return t&&e.push({fieldName:Gz,values:(0,S.getMapSearchValues)(c,t),title:(0,S.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=>{x(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]),I=(0,b.useCallback)((e=>r=>{switch(r.stopPropagation(),e){case Wz:t(D.search.actions.keywordUpdated(null));break;case Gz:t(Ka(null));break;default:t(Ja(e,[]))}}),[t]),N=(0,b.useCallback)((()=>{t(Ga({silent:!0})),t(D.search.actions.keywordUpdated({debounceTime:Z.XU}))}),[t]),L=(0,b.useMemo)((()=>m.map((e=>v().createElement(KM,{key:e.fieldName,title:e.title,values:e.values,onDelete:I(e.fieldName)})))),[m,I]),U=L.slice(0,y),j=L.slice(y),F=(0,_.when)((0,_.propEq)("length",1),(0,_.reject)(S.isEmptySearchGroup))(p),M=0===L.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(Tf(),{component:"span",classes:{body1:e.profileNumber}},li().number(u,"0,0")),v().createElement(Tf(),{variant:"body2",component:"span",classes:{root:e.profileText}},li().text("total profiles"))),v().createElement(VV,null),v().createElement(FV,null),v().createElement(qh(),{color:"primary",className:e.clearButton,onClick:N,disabled:M,"data-reltio-id":"reltio-search-clear"},li().text("clear")),!d&&v().createElement("div",{className:e.searchBarControls,"data-reltio-id":"search-bar-controls"},v().createElement(Vp.Z,{handleWidth:!0,onResize:A}),v().createElement(LV,null),v().createElement(_f(),{orientation:"vertical",className:e.splitter}),v().createElement(Hz,{showTypography:O}))),v().createElement(Vp.Z,{handleWidth:!0,onResize:w}),v().createElement(GM(),{in:!c&&y>0,timeout:500},v().createElement("div",{ref:T,className:e.facetsBar,"data-reltio-id":"search-facets-bar"},v().createElement("div",{className:e.showBar},U),j.length>0&&v().createElement(QM,{items:j}))))},$z=(0,Rp.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"}}),Kz=({onBackBtnClick:e})=>{const t=$z();return v().createElement(oF(),{disableGutters:!0,classes:{root:t.toolBar}},v().createElement(vd.k,{tooltipTitle:li().text("Switch to basic mode"),size:"L",icon:RI(),className:t.backButtonContainer,onClick:e}),v().createElement(Tf(),{variant:"subtitle1",className:t.title},li().text("Advanced search")))};Kz.propTypes={onBackBtnClick:fp().func};const Xz=Kz,Qz=(0,Rp.Z)((e=>({query:{color:e.palette.text.secondary,fontSize:"12px",letterSpacing:0,lineHeight:"16px"},[S.READABLE_QUERY_PRIMITIVE_TYPES.entityTypeLabel]:{color:"#03904A"},[S.READABLE_QUERY_PRIMITIVE_TYPES.attributeLabel]:{color:"#059BEA"},[S.READABLE_QUERY_PRIMITIVE_TYPES.specialAttributeLabel]:{color:"#EA05CF"},[S.READABLE_QUERY_PRIMITIVE_TYPES.attributeFilter]:{color:"#7F00FF"},[S.READABLE_QUERY_PRIMITIVE_TYPES.attributeValue]:{color:"#000000"}})));function Jz(){return Jz=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Jz.apply(null,arguments)}const eH=(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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["readableQuery","className"]);const i=Qz();return v().createElement("span",Jz({ref:t,className:O()(i.query,n),"data-reltio-id":"search-readable-query"},a),r.map((({type:e,text:t},r)=>v().createElement("span",{key:r,className:i[e]},t))))}));eH.displayName="ReadableSearchQuery";var tH=r(82466),rH=r.n(tH);const nH=(0,Rp.Z)({collapseIcon:{transform:"rotate(0deg)",transition:"transform 0.35s ease"},"collapseIcon--inverted":{transform:"rotate(-180deg)"}});function aH(){return aH=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},aH.apply(null,arguments)}const iH=e=>{let{collapseBtnActive:t,onCollapseBtnClick:r}=e,n=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["collapseBtnActive","onCollapseBtnClick"]);const a=nH();return v().createElement(vd.k,aH({size:"L",icon:rH(),tooltipTitle:t?li().text("Collapse panel"):li().text("Expand panel"),onClick:r,iconClassName:O()(a.collapseIcon,{[a["collapseIcon--inverted"]]:!t}),"data-reltio-id":"reltio-search-advanced-search-collapse-panel"},n))};iH.propTypes={backBtnDisabled:fp().bool,onBackBtnClick:fp().func,collapseBtnActive:fp().bool,onCollapseBtnClick:fp().func};const oH=iH;var lH=r(89808),sH=r.n(lH),cH=r(19820),uH=r.n(cH);function pH(){return pH=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},pH.apply(null,arguments)}const dH=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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["isFullscreen","onClick"]);return v().createElement(vd.k,pH({size:"L",icon:t?uH():sH(),tooltipTitle:t?li().text("Exit full screen"):li().text("Full screen"),onClick:r,"data-reltio-id":"reltio-search-advanced-search-full-screen"},n))};dH.propTypes={isFullscreen:fp().bool,onClick:fp().func};const mH=dH,fH=(0,Rp.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"}}),yH=({groups:e,hasMinSize:t,lookups:r,metadata:n,attributesPresentation:a,collapseBtnActive:i,isFullscreen:o,onCollapseBtnClick:l,onFullScreenBtnClick:s,keyword:c,map:u,dispatch:p})=>{const d=fH(),[m,f]=(0,b.useState)(0),[y,g]=(0,b.useState)(0),h=(0,b.useMemo)((()=>(0,Ua.Jk)((0,ft.P0)(n,e))),[n,e]),E=(0,S.buildReadableQuery)(n,a,r,e,c,u),T=li().text("Copy to clipboard"),[x,C]=(0,b.useState)(T),w=(0,b.useCallback)((0,S.debounce)((()=>{p({type:dt})}),500),[p]),A=(0,b.useCallback)((()=>{RV((0,S.buildReadableQueryToString)(n,a,r,e,c,u)).then((()=>C(li().text("Query was copied")))).catch((()=>C(li().text("Error"))))}),[e,a,r,n,c,u]),R=(0,b.useCallback)((()=>{C(T)}),[T]),_=(0,b.useCallback)((e=>{f(e.clientX),g(e.clientY)}),[]);(0,fE.D)(w,[w,h]);const I=(0,b.useMemo)((()=>({anchorEl:{clientWidth:1,clientHeight:1,getBoundingClientRect:()=>({left:m,bottom:y,height:1,right:m,width:1,top:y})}})),[m,y]);return v().createElement("div",{className:d.resultQueryPanel},v().createElement("div",{className:d.resultQuery},li().text("Search query"),v().createElement("div",{className:O()(d.queryContainer,{[d.queryContainerMinHeight]:t})},E.length>0?v().createElement(ag(),{key:x,title:x,onClose:R,PopperProps:I},v().createElement(eH,{readableQuery:E,onMouseEnter:_,onClick:A,className:d.query})):v().createElement("span",{className:d.noQuery},li().text("Build your search and view your search query here")))),v().createElement("div",{className:d.actionsPanel},v().createElement(oH,{collapseBtnActive:i,onCollapseBtnClick:l,className:d.collapseButton}),v().createElement(mH,{isFullscreen:o,onClick:s})))};var gH=r(28345),hH=r.n(gH),EH=r(68157);const bH=(0,Rp.Z)((e=>({readOnlyLogicOperatorContainer:{display:"flex",alignItems:"center",marginRight:"40px",width:"76px",fontSize:"14px",color:e.palette.text.secondary,maxHeight:"46px"}}))),vH=({className:e,rowData:t})=>{const r=bH();return v().createElement("div",{className:O()(r.readOnlyLogicOperatorContainer,e)},t&&t.operator?(0,EH.capitalize)(t.operator):li().text("Where"))},TH=(0,Rp.Z)((e=>({readOnlyFilter:{display:"flex",alignItems:"center",fontSize:"14px",color:e.palette.text.secondary,width:"50px",marginLeft:"12px",maxHeight:"46px"}}))),OH=({className:e,rowData:t})=>{const r=TH();return v().createElement("div",{className:O()(r.readOnlyFilter,e)},t&&t.filter?(0,S.getFilterOptionLabel)(t.filter):li().text("equals"))},SH=(0,Rp.Z)((()=>({row:{display:"flex",marginBottom:"12px"},rowItem:{paddingRight:"10px",display:"flex"},fullWidth:{flexGrow:"1",flexBasis:"0",overflow:"hidden"},hidden:{visibility:"hidden"}}))),xH=(0,b.memo)((e=>{let{classes:t={},rowData:r,previousRowData:n,LogicOperatorComponent:a=vH,AttributeSelectorComponent:i,FilterSelectorComponent:o=OH,ValuesEditorComponent:l,ActionsComponent:s,filterSelectorRef:c,attributeSelectorProps:u={}}=e,p=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["classes","rowData","previousRowData","LogicOperatorComponent","AttributeSelectorComponent","FilterSelectorComponent","ValuesEditorComponent","ActionsComponent","filterSelectorRef","attributeSelectorProps"]);const d=SH();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),"data-reltio-id":"query-builder-row-attribute-selector"},v().createElement(i,{attributeSelectorProps:u,rowContext:p,rowData:r})),v().createElement("div",{className:O()(d.rowItem,t.filterSelectorContainer),"data-reltio-id":"query-builder-row-filter-selector"},v().createElement(o,{textFieldInputRef:c,rowContext:p,rowData:r})),v().createElement("div",{className:O()(d.rowItem,d.fullWidth,t.valuesEditorContainer),"data-reltio-id":"query-builder-row-values-editor"},v().createElement(l,{rowContext:p,rowData:r})),v().createElement("div",{className:O()(d.rowItem,t.actionsContainer,{[d.hidden]:!r}),"data-reltio-id":"query-builder-row-actions"},v().createElement(s,{rowContext:p,rowData:r})))}));function CH(){return CH=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},CH.apply(null,arguments)}const wH=(0,v().memo)((e=>{let{className:t,rowClasses:r,rowsData:n,lastRowAttributeSelectorProps:a,filterSelectorRef:i,filterSelectorRefIndex:o}=e,l=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["className","rowClasses","rowsData","lastRowAttributeSelectorProps","filterSelectorRef","filterSelectorRefIndex"]);const s=(e,t,n)=>{const s=t>0?(0,_.path)([t-1],n):null,c=t===n.length?{attributeSelectorProps:a}:{};return v().createElement(xH,CH({key:e&&e.id,rowData:e,previousRowData:s,classes:r,filterSelectorRef:t===o?i:void 0},l,c))};return v().createElement("div",{"data-reltio-id":"reltio-query-builder-rows-group",className:t},n.map(s),s(null,n.length,n))})),AH=(0,Rp.Z)((()=>({select:{padding:"6px 16px 7px"},dropDown:{width:"100px","&:before":{content:"none !important"}}}))),RH=({className:e,value:t,onChange:r})=>{const n=AH();return v().createElement(aV.k,{className:O()(n.dropDown,e),classes:n,value:t,entries:S.operatorOptions,onChange:r})},_H={position:"absolute",width:1,background:"rgba(43, 152, 240, 0.3)",height:16,left:36};function IH(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){NH(e,t,r[t])}))}return e}function NH(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const PH=(0,Rp.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:IH({},_H),upperLine:{marginTop:-18},lowerLine:{marginBottom:-16,bottom:0}}))),DH="46px",kH=(0,Rp.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:DH},filterSelect:{width:"190px"},valuesWrapper:{width:"100%",display:"flex",minHeight:DH,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:{}}))),LH=e=>e.join(", "),UH=e=>`calc(${(0,_.isNil)(e)?"100%":`${e}px`} - 35px)`,jH=(0,Rp.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)"}}),FH=({list:e,maxWidth:t})=>{const r=jH(),n=(0,b.useRef)(),[a,i]=(0,b.useState)(0);(0,b.useEffect)((()=>{i(((e,t)=>{const r=e.length,n=((e,t)=>{if(t){const r=((e,t)=>{const{childNodes:r,clientLeft:n,clientWidth:a}=t;if(r.length>0){const[t]=Array.from(r),i=document.createRange();i.setStart(t,0);for(let r=0;r<e.length;r++){i.setEnd(t,i.endOffset+e[r].length);const{width:o}=i.getBoundingClientRect();if(n+o>a)return r;r!==e.length-1&&i.setEnd(t,i.endOffset+", ".length)}}return-1})(e,t);return-1===r?0:e.length-r}return 0})(e,t);return r-Math.max(1,r-n)})(e,n.current))}),[e]);const o=LH(e),l=a>0,s=l?LH(e.slice(0,-a)):o;return v().createElement(ag(),{title:l?o:""},v().createElement("div",{className:r.listLabelContainer},v().createElement("div",{style:{width:UH(t)},className:r.listLabel,ref:n},o),v().createElement("div",{className:r.visibleItemsLabel},s),l&&v().createElement("div",{className:r.hiddenCount},`+${a}`)))};function MH(){return MH=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},MH.apply(null,arguments)}const VH=(0,_.always)(32),BH=(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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["selectedItems","onItemClick","focusIndex","width","height"]);return v().createElement(zp,MH({getItemSize:VH,renderItem:(e,{item:a},i)=>{const o=!!t.find((e=>a.uri===e)),l=i===n;return v().createElement(md,{key:a.uri,onClick:r,checked:o,data:a,label:v().createElement(fd.o,{text:a.label,highlight:a.filterText}),labelInText:a.label,style:e,isFocused:l,hideIcon:!0,LogoIcon:a.LogoIcon})},focusIndex:n,fixedTitle:!1,disableHorizontalScrollbar:!0,width:a,height:i},o))}));BH.displayName="SelectMetadataTypesList";const zH=(0,Rp.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 HH(){return HH=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},HH.apply(null,arguments)}function YH(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){WH(e,t,r[t])}))}return e}function WH(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const GH=(0,b.memo)((({placeholder:e,classes:t={},items:r,selectedItemsUris:n,onChange:a,ListLabelProps:i={},disabled:o,enableEmptyValueUnderline:l,single:s,label:c,dataReltioId:u,selectionPopupTitle:p})=>{const d=zH(),[m,f]=(0,b.useState)(!1),y=(0,b.useCallback)((()=>f(!0)),[]),g=(0,b.useCallback)((()=>f(!1)),[]),[h,E]=(0,b.useState)(""),T=(0,b.useCallback)((()=>E("")),[]),x=(0,b.useCallback)((0,_.pipe)(T,g),[g,T]),C=r.filter((({label:e})=>S.utils.strings.search(e,h))).map(((e,t)=>({item:{item:YH({},e,{filterText:h})},index:t}))),w=(0,b.useMemo)((()=>(0,_.pipe)((0,_.map)((e=>r.find((0,_.propEq)("uri",e)))),(0,_.reject)(_.isNil),(0,_.pluck)("label"))(n)),[n,r]),A=(0,b.useCallback)(((e,t)=>{s?(a(t?[e.uri]:[]),x()):a(t?n.concat(e.uri):n.filter((t=>t!==e.uri)))}),[n,a,s,x]),R=(0,b.useCallback)((({item:e})=>{const t=!n.includes(e.uri);A(e,t)}),[n,A]),{focusIndex:I,handleKeyDown:N}=Hp({items:C,open:m,onSelectFocusedItem:R,selectedItems:n,onClose:x}),P=(0,b.useRef)(),D=P.current?P.current.getBoundingClientRect().width:0,k=Math.max(D,255),L=0===n.length;return v().createElement(v().Fragment,null,v().createElement(AV(),{label:c,ref:P,InputProps:{startAdornment:L&&!e?null:v().createElement("div",{className:O()(d.inputText,t.inputText)},L?v().createElement("div",null,e):v().createElement(FH,HH({},i,{list:w}))),classes:{root:d.inputRoot,input:O()(d.input,t.input,{[d.emptyInput]:L&&!e}),disabled:O()(d.disabledInput,{[d.disabledPointer]:o}),underline:d.disabledUnderline},endAdornment:v().createElement(Ap.T,{size:"L",icon:iy(),iconClassName:O()(d.icon,{[d["popup-opened-icon"]]:m}),disabled:o}),readOnly:!0,disableUnderline:L&&!l},inputProps:{tabIndex:-1},InputLabelProps:{classes:{root:O()(d.inputLabel,t.label)}},value:"",onClick:o?void 0:y,classes:{root:O()(d.root,t.root)},size:"small",variant:"filled",disabled:o,"data-reltio-id":u}),v().createElement(Up,{open:m,anchorEl:P.current,onClose:x,onSearch:E,title:p,containerWidth:k,containerHeight:355,searchInputOnKeyDown:N,transformOrigin:{horizontal:"left",vertical:"top"},anchorOrigin:{horizontal:"left",vertical:"bottom"},PaperProps:{"data-reltio-id":`${u}-popup`}},v().createElement(BH,{items:C,onItemClick:A,selectedItems:n,width:k,height:245,focusIndex:I})))}));GH.displayName="MetadataTypesSelector";const qH=(0,b.memo)((({entityTypes:e,selectedEntityTypes:t,single:r,placeholder:n,enableEmptyValueUnderline:a,onChange:i,classes:o={},ListLabelProps:l={},disabled:s=!1})=>{const c=(0,b.useMemo)((()=>e.filter(S.isAvailableEntityType)),[e]);return v().createElement(GH,{items:c,selectedItemsUris:t,single:r,placeholder:n,enableEmptyValueUnderline:a,onChange:i,classes:o,ListLabelProps:l,disabled:s,label:li().text("Entity type"),dataReltioId:"entity-type-selector",selectionPopupTitle:li().text("Select entity types")})}));qH.displayName="EntityTypesSelector";const ZH=({selectedEntityTypes:e,onChange:t,classes:r={},ListLabelProps:n={}})=>{const a=(0,yp.useSelector)(k().selectors.getMetadata),i=(0,yp.useSelector)(ai.t9),o=(0,yp.useSelector)(Ri.Xf),l=(0,b.useCallback)(o?({uri:e})=>o.includes(e):_.identity,[o]),s=(0,b.useMemo)((()=>a.entityTypes.filter(l).sort(o?(0,S.orderByArrayComparator)(o,"uri"):e=>0).filter((({uri:e})=>(0,S.isAvailableEntityTypeForDataTenant)(i,e)))),[a,i,l,o]);return v().createElement(qH,{classes:r,entityTypes:s,onChange:t,selectedEntityTypes:e,ListLabelProps:n,placeholder:li().text("All"),enableEmptyValueUnderline:!0})};ZH.propTypes={selectedEntityTypes:fp().arrayOf(fp().string).isRequired,onChange:fp().func.isRequired,classes:fp().shape({root:fp().string,label:fp().string}),ListLabelProps:fp().shape({maxWidth:fp().number})};const $H=ZH,KH=(0,Rp.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)"}}}}),XH=(0,_.either)((0,_.prop)("title"),(0,_.prop)("fieldName")),QH=({value:e,getLabel:t=XH,onSelectAttributeClick:r,disabled:n=!1})=>{const a=KH(),i=e&&t(e);return v().createElement("div",{onClick:n?void 0:r,className:O()(a.attribute,{[a.attributeWithValue]:!!i},{[a.disabled]:n})},v().createElement(sd.Y,{value:i},v().createElement("div",{className:O()(a.name,{[a.disabled]:n})},i||v().createElement("span",{className:a.noSelect},li().text("Select attribute")))),v().createElement(Ap.T,{size:"M",icon:iy(),disabled:n}))},JH=(0,Rp.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 eY(){return eY=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},eY.apply(null,arguments)}function tY(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){rY(e,t,r[t])}))}return e}function rY(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const nY=(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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["selectedAttributes","onItemClick","focusIndex","hideCheckBox"]);const o=JH(),l=(0,w.AH)();return v().createElement(zp,eY({getItemSize:(e,t)=>t.items?40:28,renderItem:(e,{item:i,level:o,groupId:l,groupName:s},c)=>{const u=Qk(i,t),p=c===n;return v().createElement(md,{key:`item-${l}-${i.fieldName}`,onClick:r,checked:u,data:tY({},i,{groupName:s}),notSelectable:i.notSelectable,hideCheckBox:a,label:v().createElement(fd.o,{text:i.title,highlight:i.filterText}),labelInText:i.title,level:o,style:e,isFocused:p,groupId:l,LogoIcon:i.LogoIcon})},renderGroupTitle:(e,t)=>v().createElement(Jm(),{component:"div",className:o.subHeader,style:e,key:`group-${t.item.id}`},t.item.needGroupIcon&&v().createElement(Bf,{group:t.item,metadata:l}),t.item.title),focusIndex:n},i))}));function aY(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){iY(e,t,r[t])}))}return e}function iY(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const oY=(e,t)=>e.title.toLowerCase().includes(t.toLowerCase()),lY=(e,t)=>oY(e,t)||(e.children||[]).some((e=>lY(e,t))),sY=(e,t)=>e.findIndex(Xk(t)),cY=(0,S.getMaxItemWidth)("title"),uY=(e,t,r,n,a=0,i=!1)=>{const o=oY(e,n);return[{item:n?aY({},e,{filterText:n}):e,level:a,groupId:t,groupName:r}].concat(e.children?e.children.filter((e=>i||o||lY(e,n))).flatMap((e=>uY(e,t,r,n,a+1,i||o))):[]).flat()},pY=(0,_.curry)(((e,t)=>t.map((t=>({item:t,items:t.attributes.filter((t=>lY(t,e))).map((r=>uY(r,t.id,t.title,e)))}))).filter((e=>e.items.length)))),dY=(0,Rp.Z)({selector:{minWidth:"200px",width:"100%",alignItems:"stretch",background:"rgba(0,0,0, 0.0267)",boxSizing:"border-box",borderRadius:"4px",display:"flex"}}),mY=(0,b.memo)((({className:e,itemsGroups:t,value:r,getLabel:n,onSelect:a,onRestoreFocus:i=_.identity,onOpenPopup:o=_.identity,disableRestoreFocus:l=!1,disableEnforceFocus:s=!1,single:c=!1,ungroup:u=!1,disabled:p=!1,hideCheckBox:d=!1})=>{const m=dY(),[f,y]=(0,b.useState)(null),g=(0,b.useCallback)((()=>y(null)),[]),h=!!f,[E,T]=(0,b.useState)(""),S=(0,b.useCallback)((()=>T("")),[]),[x,C]=(0,b.useState)([]),w=(0,b.useCallback)((()=>C([])),[]),A=(0,b.useMemo)((()=>pY(E,t)),[t,E]),R=(0,b.useMemo)((()=>(0,_.pipe)((0,_.when)((0,_.always)(u),(0,_.chain)((0,_.pipe)((0,_.prop)("items"),_.flatten,(0,_.map)((0,_.pick)(["item","level"]))))),jp)(A)),[u,A]),I=(0,b.useMemo)((()=>Math.max(cY(A),308)),[A]),N=(0,_.pipe)((0,_.tap)((0,_.pipe)(w,S,g)),i),P=(0,b.useRef)(),D=(0,b.useCallback)(((e,t)=>{a({checked:t,attribute:e,index:t?x.length:sY(x,e),selectedAttributes:x}),c?(C(t?[e]:[]),N({})):(C((({attribute:e,selectedAttributes:t,checked:r})=>r?t.concat(e):t.filter((t=>!Xk(e,t))))({selectedAttributes:x,attribute:e,checked:t})),P.current&&P.current.focus())}),[x,a,c,N,P]),k=(0,b.useCallback)((({onListItemClick:e,selectedAttributes:t})=>({item:r,groupData:n})=>{const a=Qk(r,t);e(aY({},r,{groupName:n.groupName}),!a)})({onListItemClick:D,selectedAttributes:x}),[D,x]),{focusIndex:L,handleKeyDown:U}=Hp({items:R,open:h,onSelectFocusedItem:k,selectedItems:x,onClose:N});return v().createElement("div",{className:O()(m.selector,e),"data-reltio-id":"attribute-selector"},v().createElement(QH,{value:r,getLabel:n,onSelectAttributeClick:e=>{o(),y(e.currentTarget)},disabled:p}),v().createElement(Up,{open:h,anchorEl:f,onClose:N,onSearch:T,title:li().text("Select attribute"),containerWidth:I,containerHeight:507,searchInputOnKeyDown:U,anchorOrigin:{horizontal:"right",vertical:"bottom"},searchInputRef:P,disableRestoreFocus:l,disableEnforceFocus:s},v().createElement(nY,{items:R,onItemClick:D,selectedAttributes:x,width:I,height:400,focusIndex:L,hideCheckBox:d})))}));var fY=r(80349);function yY(){return yY=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},yY.apply(null,arguments)}const gY=(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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["entityTypes","recommendedAttributes","showReferencedEntityAttributes","firstLevelAttributesFilter"]);const o=(0,yp.useSelector)(k().selectors.getMetadata),l=(0,yp.useSelector)(ai.t9),s=(0,yp.useSelector)(k().selectors.getCanUserReadWorkflowDataTask),c=(0,yp.useSelector)(Ri.Xf),u=(0,yp.useSelector)(k().selectors.getDataTenants),p=(0,b.useMemo)((()=>(0,_.pipe)(fY.s1,(0,_.when)((0,_.always)(!n),fY.a),(0,j.ED)(l))({allowedEntityTypes:c,firstLevelAttributesFilter:a},o,t,r,u,s)),[t,o,l,c,a,r,n,u,s]);return v().createElement(mY,yY({},i,{itemsGroups:p}))})),hY=({rowData:e,rowContext:{entityTypes:t,dispatchGroupAction:r},attributeSelectorProps:n={}})=>{const a=kH(),i=e&&e.id,o=(0,b.useCallback)((e=>{r(Wo,i,e)}),[i,r]),l=(0,b.useCallback)((e=>(0,S.getSearchGroupAttributeLabel)({data:e})),[]);return v().createElement(gY,{className:a.attributeSelect,value:e&&e.data,getLabel:l,entityTypes:t,onSelect:o,onRestoreFocus:n.onRestoreFocus,onOpenPopup:n.onOpen,disableRestoreFocus:n.disablePopoverRestoreFocus,disableEnforceFocus:n.disablePopoverRestoreFocus})};hY.propTypes={rowData:bB,rowContext:fp().shape({entityTypes:fp().arrayOf(fp().string),dispatchGroupAction:fp().func}),attributeSelectorProps:fp().shape({onRestoreFocus:fp().func,onOpen:fp().func,disablePopoverRestoreFocus:fp().bool})};const EY=(0,b.memo)(hY);function bY(){return bY=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},bY.apply(null,arguments)}const vY=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",bY({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"}))))))},TY=e=>!(e&&e.data),OY=({rowData:e,rowContext:{dispatchGroupAction:t}})=>{const r=kH(),n=e&&e.id,a=(0,b.useCallback)((()=>t(Zo,n)),[n,t]),i=(0,b.useCallback)((()=>t($o,n)),[n,t]),o=(0,b.useCallback)((()=>t(Bo,n)),[n,t]);return e&&v().createElement("div",{className:O()(r.actions)},v().createElement(ag(),{title:li().text("Add"),placement:"bottom"},v().createElement(hH(),{className:r.actionIcon,onClick:o})),!TY(e)&&v().createElement(ag(),{title:li().text("Duplicate"),placement:"bottom"},v().createElement("div",{className:r.actionIcon,tabIndex:-1},v().createElement(vY,{onClick:i,tabIndex:-1}))),v().createElement(ag(),{title:li().text("Delete"),placement:"bottom"},v().createElement(Sp(),{onClick:a,className:r.actionIcon})))};OY.propTypes={rowData:bB,rowContext:fp().shape({dispatchGroupAction:fp().func})};const SY=(0,b.memo)(OY),xY={BY_LABEL:(0,r(51774).c)({stringify:(0,_.prop)("label")})},CY=({className:e,attribute:t,textFieldInputRef:r,isDisabled:n,height:a,onChange:i})=>{const o=(0,_.pipe)(S.getFilterOptionLabel,EH.capitalize);return v().createElement(qU,{label:"",placeholder:li().text("Equals"),className:e,value:n?void 0:{value:t.filter,label:o(t.filter)},options:t&&t.data&&t.data.filterOptions.map((e=>({value:e,label:o(e)})))||[],height:a,onChange:i,isDisabled:n,filterOption:xY.BY_LABEL,textFieldInputRef:r})};CY.propTypes={className:fp().string,attribute:bB,textFieldInputRef:fp().object,isDisabled:fp().bool,onChange:fp().func,height:fp().number};const wY=(0,b.memo)(CY),AY=({rowData:e,rowContext:{dispatchGroupAction:t},textFieldInputRef:r})=>{const n=kH(),a=e&&e.id,i=(0,b.useCallback)((e=>t(Ko,a,e.value)),[t,a]);return v().createElement(wY,{className:n.filterSelect,attribute:e,textFieldInputRef:r,isDisabled:TY(e),onChange:i})};AY.propTypes={rowData:bB,rowContext:fp().shape({dispatchGroupAction:fp().func}),textFieldInputRef:fp().object};const RY=(0,b.memo)(AY);var _Y=r(23821);const IY=(0,Rp.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"}}),NY=({attribute:e,groupId:t,onChange:r,updateValues:n,filterValues:a})=>{const{values:i,data:{attrType:o,fieldName:l}={},id:s}=e,c=(0,yp.useSelector)((e=>(0,Qi.Sw)(e,t,s)))||{},u=(0,yp.useSelector)((e=>(0,Qi.Ly)(e))),p=(0,yp.useSelector)((e=>(0,ai.Sg)(e,l)));(0,b.useEffect)((()=>{u&&n()}),[i,u,p]),(0,b.useEffect)((()=>{u||n()}),[i,u]);const d=(0,b.useMemo)((()=>(0,_.propOr)([],0,i)),[i]),m=(0,b.useCallback)((0,_.pipe)(S.wrapInArray,r),[r]),{default:f,filtered:y}=c;return!f&&o?v().createElement("div",{className:"ValuesEditor-styles-loadingWrapper--_rOmn"},v().createElement(fm(),{size:20,className:"ValuesEditor-styles-loading--mLFVu"})):v().createElement(rg,{values:d,defaultOptions:f,filteredOptions:y,onChange:m,getSuggestions:a,tabSelectsValue:!1,canLoadMore:!(0,ja.tW)(e.data)})};NY.propTypes={attribute:bB.isRequired,groupId:fp().string,onChange:fp().func,updateValues:fp().func,filterValues:fp().func};const PY=NY,DY=({attribute:e,dispatchGroupAction:t,groupId:r})=>{const{values:n,data:{attrType:a,fieldName:i}={},filter:o}=e,l=IY(),s=(0,S.isTypeaheadAttrType)(a)||(0,_.allPass)([(0,_.propSatisfies)((0,_.either)(_.isNil,S.isEntityTypeUri),"uri"),(0,_.prop)("faceted"),(0,_.propEq)("type",S.DataTypes.TYPE_BLOB)])(a),c=(0,S.isEnumAttrType)(a)||(0,S.isLookupAttrType)(a),u=r=>t(Xo,e.id,r);if((s||c)&&(0,S.isMultiValueOption)(o)){const n=()=>t(el,e),a=({value:r,pageNumber:n,currentOptions:a})=>t(Qo,{attribute:e,value:r,debounceTime:500,pageNumber:n,currentOptions:a});return v().createElement(PY,{attribute:e,groupId:r,onChange:u,filterValues:a,updateValues:n})}{const e=c?{type:S.DataTypes.TYPE_STRING}:(0,S.getAttrDataTypeDefinition)(a),t=(0,S.getDataTypeDefinitionForFilterValue)(e,o),r=(0,S.isDateType)(t.type)&&!(0,S.isDateRangeFilterOption)(o)&&l.dateRoot||(0,S.isBooleanType)(t.type)&&l.boolRoot||l.root;return v().createElement(_Y.n,{filter:{filter:o,fieldName:i,values:n||[]},onChange:u,dataTypeDefinition:t,fullWidth:!0,TextFieldProps:{InputProps:{classes:{root:l.input},disableUnderline:(0,_.isNil)(n)||(0,_.isEmpty)((0,_.flatten)(n))}},color:"primary",booleanRadioEditorClassName:l.booleanRadioEditor,classes:{root:r},orientation:"horizontal"})}};DY.propTypes={attribute:bB.isRequired,groupId:fp().string,dispatchGroupAction:fp().func};const kY=(0,b.memo)(DY),LY=({rowData:e,rowContext:{dispatchGroupAction:t,groupId:r}})=>{const n=kH(),a=e&&(0,S.checkIfOptionHasValues)(e.filter);return v().createElement("div",{className:n.valuesWrapper,"data-reltio-id":"advanced-search-values-editor-wrapper"},!TY(e)&&a&&v().createElement(kY,{attribute:e,dispatchGroupAction:t,groupId:r}))};LY.propTypes={rowData:bB,rowContext:fp().shape({dispatchGroupAction:fp().func,groupId:fp().string})};const UY=(0,b.memo)(LY),jY=({rowData:e,rowContext:{dispatchGroupAction:t}})=>{const r=kH(),n=e&&e.id,a=e&&e.operator,i=(0,b.useCallback)((e=>t(Go,n,e)),[t,n]);return v().createElement("div",{className:r.logicOperatorContainer},a?v().createElement(RH,{className:r.logicOperator,value:a,onChange:i}):v().createElement("div",{className:O()(r.logicOperator,r.logicOperatorPlaceholder)},li().text("Where")))};jY.propTypes={rowData:bB,rowContext:fp().shape({dispatchGroupAction:fp().func})};const FY=(0,b.memo)(jY);function MY(){return MY=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},MY.apply(null,arguments)}const VY=e=>{let{showLogicOperator:t,group:{id:r,attributes:n,operator:a,entityTypes:i=[]},dispatch:o,onAddEmptyGroup:l}=e,s=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["showLogicOperator","group","dispatch","onAddEmptyGroup"]);const c=PH(),u=kH(),p=(0,b.useCallback)((()=>o({type:Qe,payload:{groupId:r,id:(0,Ge.x0)()}})),[r,o]),d=(0,b.useCallback)((()=>o({type:Ke,payload:{groupId:r}})),[r,o]),m=(0,b.useCallback)((e=>o(((e,t)=>({type:$e,payload:{groupId:e,operator:t}}))(r,e))),[r,o]),f=(0,b.useCallback)((e=>o(((e,t)=>({type:qe,payload:{groupId:e,entityTypes:t}}))(r,e))),[r,o]),y=(0,b.useCallback)(((e,...t)=>o(e(r,...t))),[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)}),[]),S=(0,b.useCallback)((()=>{h.current=n.length}),[n.length]),x=(0,b.useMemo)((()=>[{text:li().text("Add set"),onClick:l,id:"-group-add-set"},{text:li().text("Duplicate set"),onClick:p,id:"-group-duplicate-set"},{text:li().text("Delete set"),onClick:d,id:"-group-delete-set"}]),[l,p,d]),C=(0,b.useMemo)((()=>({root:u.row})),[u]),w=(0,b.useMemo)((()=>({onRestoreFocus:T,onOpen:S,disablePopoverRestoreFocus:!!T})),[T,S]);return v().createElement(v().Fragment,null,v().createElement("div",MY({className:c.container},s),v().createElement("div",{className:c.title},li().text("Set")),v().createElement("div",{className:c.entityTypeSelectorContainer},v().createElement($H,{classes:{root:c.entityTypeSelector},selectedEntityTypes:i,onChange:f})),v().createElement("div",{className:c.rows},v().createElement(wH,{rowClasses:C,rowsData:n,AttributeSelectorComponent:EY,FilterSelectorComponent:RY,ValuesEditorComponent:UY,ActionsComponent:SY,LogicOperatorComponent:FY,filterSelectorRefIndex:h.current,filterSelectorRef:g,lastRowAttributeSelectorProps:w,entityTypes:i,groupId:r,dispatchGroupAction:y}),v().createElement("div",{className:c.actions},v().createElement(vN,{menuId:`query-builder-group-actions-${r}`,buttonComponent:Ap.T,buttonProps:{icon:kd(),size:"L","data-reltio-id":"reltio-search-query-builder-group-actions"},menuItems:x})))),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(RH,{value:a,onChange:m})))};VY.propTypes={showLogicOperator:fp().bool,group:fp().shape({id:fp().string,attributes:fp().arrayOf(bB),entityTypes:fp().arrayOf(fp().string),operator:fp().string}),onAddEmptyGroup:fp().func,dispatch:fp().func};const BY=(0,b.memo)(VY);function zY(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){HY(e,t,r[t])}))}return e}function HY(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const YY=(0,Rp.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:zY({},_H),upperLine:{marginTop:-18},searchByOvContainer:{marginLeft:-6,marginBottom:-14}}))),WY=({groups:e,uiConfigShowSearchByOv:t,dispatch:r})=>{const n=YY(),a=(0,b.useRef)(null),i=(0,b.useRef)(null),o=(0,b.useCallback)((()=>r({type:Xe,payload:{group:Xt([])}})),[r]);return(0,b.useEffect)((()=>{if(0===e.length)o();else if(!(0,_.isNil)(i.current)&&i.current<e.length&&a.current){const e=a.current.childNodes;e[e.length-2].scrollIntoView({behavior:"smooth"})}i.current=e.length}),[e.length,o]),v().createElement("div",{className:n.scrollWrapper},v().createElement("div",{className:n.groupsContainer,ref:a},t&&v().createElement("div",{className:n.searchByOvContainer},v().createElement(Nh,{variant:"queryGroups"})),e.map(((e,t,n)=>v().createElement(BY,{key:e.id,group:e,dispatch:r,showLogicOperator:t!==n.length-1,onAddEmptyGroup:o,"data-reltio-id":`reltio-search-advansed-search-group-builder-${t}`}))),v().createElement("div",{className:n.button},v().createElement("div",{className:O()(n.verticalOperatorLine,n.upperLine)}),v().createElement(qh(),{onClick:o,color:"primary",size:"small","data-reltio-id":"reltio-search-advanced-search-add-set-button"},v().createElement(hH(),{color:"primary",className:n.icon,fontSize:"small"}),li().text("ADD SET")))))};WY.propTypes={groups:fp().array,dispatch:fp().func,uiConfigShowSearchByOv:fp().bool};const GY=(0,yp.connect)((e=>{var t;return{groups:(0,Qi.go)(e),uiConfigShowSearchByOv:null!==(t=k().selectors.getShowSearchByOv(e))&&void 0!==t?t:(0,Ri.cC)(e)}}))(WY),qY=D.search.actions.updateState({}),ZY=({open:e,onClose:t})=>{const r=(0,yp.useDispatch)(),n=(0,b.useCallback)((()=>{t(),r(qY)}),[r,t]),a=(0,b.useCallback)((()=>{t(),r(gi(!0,qY))}),[r,t]),i=(0,yp.useSelector)(bo.LA),o=(0,yp.useSelector)(ai.ai),l=(0,yp.useSelector)(bo.WH),s=(0,yp.useSelector)(bo.Jv),c=i?s&&!l:!o;return v().createElement(yB.U,{open:e,title:li().text("Search filters cannot be displayed in Quick filters"),content:li().text("You have advanced filters that cannot be displayed in Quick filters. Save your search or clear your filters to go to Quick filters."),discardCaption:li().text("Clear search"),saveCaption:li().text("Save search"),disabledSave:c,onCancel:t,onDiscard:n,onSave:a})};ZY.propTypes={open:fp().bool,onClose:fp().func};const $Y=ZY,KY=(0,yp.connect)((e=>({metadata:k().selectors.getMetadata(e),attributesPresentation:k().selectors.getAttributesPresentation(e),groups:(0,Qi.go)(e),lookups:k().selectors.getLookups(e),keyword:k().selectors.getSearchKeyword(e),map:(0,ai.vH)(e),dataTenants:k().selectors.getDataTenants(e)})))((({metadata:e,attributesPresentation:t,lookups:r,groups:n,keyword:a,map:i,onClose:o,collapsed:l,isFullscreen:s,onCollapse:c,onExpand:u,onFullscreen:p,dataTenants:d,dispatch:m})=>{const f=YY(),[y,g]=(0,b.useState)(!1),h=(0,_.ifElse)((0,_.always)(Ba(e,n,d)),(0,_.pipe)(o,u),(()=>g(!0)));return v().createElement("div",{className:f.container},v().createElement(Xz,{onBackBtnClick:h}),v().createElement(GY,null),v().createElement(yH,{groups:n,lookups:r,dispatch:m,metadata:e,attributesPresentation:t,hasMinSize:l,collapseBtnActive:!l,isFullscreen:s,onCollapseBtnClick:l?u:c,onFullScreenBtnClick:s?u:p,keyword:a,map:i}),v().createElement($Y,{open:y,onClose:()=>g(!1)}))})),XY=({isOpenAdvancedSearch:e,onCloseAdvancedSearch:t})=>{const r=tE(),[n,a]=(0,b.useState)(!1),[i,o]=(0,b.useState)("50%"),l=(0,b.useCallback)((()=>{a(!0),o("120px")}),[]),s=(0,b.useCallback)((()=>{a(!1),o("50%")}),[]),c=(0,b.useCallback)((({percentageSize:e,isMaxSize:t,isMinSize:r})=>{a(r),o(t?-53:e)}),[]),u=(0,b.useCallback)((()=>{a(!1),o(-53)}),[]),p=v().createElement(v().Fragment,null,v().createElement(Zz,null),v().createElement(_f(),{className:r.divider})),d=v().createElement(v().Fragment,null,p,v().createElement(KY,{collapsed:n,isFullscreen:-53===i,onClose:t,onCollapse:l,onExpand:s,onFullscreen:u}));return v().createElement(sE,{className:r.resizablePanesWrapper,orientation:"horizontal",size:e?i:0,minSize:120,maxSize:-53,allowResize:e,onChange:c},v().createElement("div",{className:r.pane},e&&d),v().createElement("div",{className:r.pane},!e&&p,v().createElement(YM,null)))};XY.propTypes={isOpenAdvancedSearch:fp().bool,onCloseAdvancedSearch:fp().func};const QY=XY;function JY(){return JY=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},JY.apply(null,arguments)}const eW=e=>v().createElement("svg",JY({width:24,height:24,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg","data-reltio-id":"SvgTenant"},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"})),tW=(0,Rp.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)"}}))),rW=({className:e})=>{const t=tW(),r=(0,w.xz)(),n=(0,w.fN)(),a=`${r}${n?" - "+n.toUpperCase():""}`;return v().createElement("div",{className:O()(t.labelWrapper,e)},v().createElement(eW,{className:t.tenantIcon,"data-reltio-id":"reltio-tenant-icon"}),v().createElement(Tf(),{className:t.tenantLabel},a))},nW=(0,Rp.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)"}}))),aW=()=>{const e=nW(),t=(0,yp.useSelector)(k().selectors.getMetadata),r=(0,yp.useSelector)(Kc),n=(0,yp.useSelector)(Zc),a=(0,yp.useSelector)(su),i=(0,yp.useSelector)(ai.hX),o=(0,yp.useSelector)(cu),l=(0,yp.useSelector)(ou),s=(0,S.getEntityTypeLabel)(t,{type:r}),c=(0,yp.useSelector)(lu),u=(0,yp.useDispatch)(),p=(()=>{const e=(0,yp.useSelector)(k().selectors.getMetadata),t=(0,yp.useSelector)(k().selectors.getLookups),r=(0,yp.useSelector)(k().selectors.getAttributesPresentation),n=(0,yp.useSelector)(Qi.go),a=(0,yp.useSelector)(k().selectors.getSearchKeyword),i=(0,yp.useSelector)(ai.vH),o=(0,yp.useSelector)(k().selectors.getDataTenants),l=(0,yp.useSelector)(P.X0),s=(0,yp.useSelector)(P.Mp),c=(0,b.useMemo)((()=>Object.values((0,ja.t8)(l,s))),[l,s]);return(0,b.useMemo)((()=>{const l=(0,_.isEmpty)(n)?(0,tl.h)(e,o,c):n;return(e=>!(1===e.length&&(0,_.isEmpty)(e[0].attributes)&&1===e[0].entityTypes.length))(l)||i||a?(0,S.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(dc())}),[a,i,o,u]);const d=(0,b.useCallback)((e=>u(((e,t)=>({type:jn,payload:{filterText:e,debounceTime:t}}))(e,Z.XU))),[u]);return v().createElement(v().Fragment,null,v().createElement(oF(),{className:O()(e.container,{[e.borderBottom]:n>0})},v().createElement(Tf(),{component:"span",className:e.entityTypeTitle},s),v().createElement(_f(),{orientation:"vertical",className:e.splitter}),v().createElement(Tf(),{component:"span",className:e.profileNumber},li().number(o,"0,0")),v().createElement(Tf(),{variant:"body2",component:"span",className:e.profileText},li().text(" profiles are selected for bulk edit.")),0===n&&v().createElement(v().Fragment,null,v().createElement(qh(),{color:"primary",className:e.clearButton,onClick:()=>{u(dc())},"data-reltio-id":"reltio-search-bulk-update-"+(a?"select-all-profiles":"clear-selection")},a?`${li().text("Select all")} ${li().number(i,"0,0")} ${li().text("profiles")}`:li().text("Clear selection")),v().createElement(Dp,{classes:{root:e.searchBox},value:c,onSearch:d,"data-reltio-id":"reltio-search-bulk-update-search-input"}),v().createElement(_f(),{orientation:"vertical",className:e.splitter}),v().createElement(Rd,{entityTypeUri:r,headColumns:l,onSelectColumns:e=>{const t=(0,Ai.tU)(e,l);u(yc(e)),t&&u(pc())},"data-reltio-id":"reltio-search-bulk-update-add-remove-columns"}))),0===n&&!(0,_.isEmpty)(p)&&v().createElement(oF(),{className:e.searchQueryContainer},li().text("Search query"),v().createElement(eH,{readableQuery:p,className:e.searchQuery})))};function iW(){return iW=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},iW.apply(null,arguments)}const oW=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",iW({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 lW(){return lW=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},lW.apply(null,arguments)}const sW=e=>{let{styles:t={}}=e,r=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["styles"]);return v().createElement("svg",lW({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"})))},cW=(0,Rp.Z)({editor:{marginBottom:0},editorValue:{width:"100%",marginRight:"8px"}}),uW=({valueProperty:e,emptyEditorValue:t,attributeType:r,value:n,fieldName:a,onChangeValue:i})=>{const o=cW(),l=!r.uri,s=(0,_.pipe)((0,_.ifElse)((0,_.has)("lookupCode"),_.identity,(0,_.objOf)("value")),(0,_.filter)((e=>void 0!==e)),(0,_.mergeRight)(t))(n);return(0,b.useEffect)((()=>{(0,S.isLookupAttrType)(r)||""===t.value||i(e)(t)}),[]),l?v().createElement("div",{key:e,className:O()(o.editor,o.editorValue),"data-reltio-id":"bulk-update-special-attribute-change-editor"},v().createElement(Bk.Z,{fieldName:a,value:n,dataTypeDefinition:(0,S.getAttrDataTypeDefinition)(r),onChange:(0,_.pipe)((0,_.objOf)("value"),i(e)),fullWidth:!0})):v().createElement(hL,{key:e,className:o.editor,mode:S.Mode.Editing,attributeType:r,attributeValue:s,onChangeAttribute:i(e)})},pW={flex:"0 0 auto"},dW=(0,Rp.Z)({container:{flexGrow:1,display:"flex",alignItems:"center",margin:0},singleEditor:{marginRight:5,maxWidth:334},to:{color:"#696969",padding:"0 16px 0 7px"},type_Timestamp:pW,type_Boolean:pW,type_Date:pW}),mW=(0,b.memo)((({id:e,groupId:t,operation:r,operationParameters:n})=>{const a=dW(),i=(0,yp.useDispatch)(),{attributeType:o,fieldName:l}=n.attributeTypeData,s=(0,b.useMemo)((()=>(0,S.createNewAttribute)({parentUri:"entities/fakeEntity",attributeType:o})),[o]),c=(0,b.useCallback)((r=>n=>{const{value:a}=n,l=""===a&&(0,S.isLookupAttrType)(o)?{lookupCode:"",value:""}:a;i(bc({id:e,groupId:t,operationParameters:{[r]:l}}))}),[e,t,o,i]),u=Yc(r).map((e=>v().createElement(uW,{key:e,valueProperty:e,value:n[e],emptyEditorValue:s,fieldName:l,attributeType:o,onChangeValue:c})));if(!u.length)return null;const p=v().createElement("div",{key:"to",className:a.to},li().text("with"));return v().createElement("div",{className:O()(a.container,a[`type_${o.type}`],{[a.singleEditor]:1===u.length})},2===u.length?(0,_.insert)(1,p,u):u)}));mW.displayName="ChangeEditor";const fW=(0,Rp.Z)((()=>({entitySelector:{marginTop:"10px",width:"100%",maxWidth:"452px"},label:{"&:not($labelShrink)":{transform:"translate(12px, 10px)"}},labelShrink:{}}))),yW=({attributeType:e,value:t,onChange:r})=>{const n=fW(),a=(0,yp.useDispatch)(),i=(0,yp.useSelector)(k().selectors.getMetadata),o=(0,yp.useSelector)((e=>k().selectors.getGlobalSearchRequestOptions(e,["ovOnly"]))),l=S.Mode.Editing,s=null==t?void 0:t.entityUri,c=(0,S.getReferencedEntityTypeUriFromAttrType)(e),u=(0,b.useCallback)((t=>(0,S.referencedEntityAttributeTypesSelectionStrategy)(e,t)),[e]),p=(0,b.useCallback)((e=>{const{uri:t,type:n,label:i}=e;(0,S.isTempUri)(s)&&a(D.profile.modifiedEntities.actions.entityDeleted(s)),r((0,_.isEmpty)(e)?null:{entityUri:t,entityType:n,entityLabel:i})}),[a,r,s]),d=(0,b.useCallback)(((e,t)=>{const r=(0,S.getEntityType)(i,c),n=(0,_.pipe)(u,(0,S.getCreatableAttributeTypes)(l))(r),o=(0,S.createTemporaryEntity)({entityTypeUri:e,initValue:t,attributeTypes:n,metadata:i,mode:l});p(o),a(D.profile.modifiedEntities.actions.entityCreated(o))}),[a,p,u,i,l,c]);return v().createElement(gU,{className:n.entitySelector,entity:t,entityTypesUris:(0,ni.l0)(c),metadata:i,globalSearchRequestOptions:o,onChange:p,onCreate:d,height:40,disableLinkClick:!0,attributeTypesSelectionStrategy:u,mode:l,TextFieldProps:{InputLabelProps:{classes:{root:n.label,shrink:n.labelShrink}}}})},gW=e=>(0,_.last)(e.type.split("/")),hW=e=>({attributes:{[gW(e)]:[e]}}),EW=(e,t)=>{const r=gW(e);return t.attributes[r][0]},bW=({attributeValue:e,onChange:t})=>{const r=(0,b.useRef)(e);r.current=e;return{onChangeAttribute:(0,b.useCallback)((({value:e,attributeType:n,uri:a})=>{const i=hW(r.current),o=(0,S.editAttribute)({entity:i,attributeType:n,uri:a,value:e});t(EW(r.current,o))}),[t]),onDeleteAttribute:(0,b.useCallback)((({attributeType:e,uri:n})=>{const a=hW(r.current),i=(0,S.removeAttribute)({entity:a,attributeType:e,uri:n});t(EW(r.current,i))}),[t]),onAddAttributes:(0,b.useCallback)((e=>{const n=hW(r.current),a=e.reduce(((e,t)=>{const{attributeType:r,parentUri:n,index:a}=t;return(0,S.addAttribute)({entity:e,attributeType:r,parentUri:n,index:a})}),n);t(EW(r.current,a))}),[t]),onTogglePin:(0,b.useCallback)((e=>{const n=(({parentAttributeValue:e,uri:t})=>{const r=t.split(e.uri+"/")[1].split("/"),n=[];for(;r.length;){n.push("value");const t=r.shift(),a=r.shift();n.push(t);const i=(0,_.view)((0,_.lensPath)(n),e);if(!i)return null;const o=i.findIndex((({uri:e})=>e.endsWith("/"+a)));n.push(o)}return n.length?(n.push("pin"),(0,_.over)((0,_.lensPath)(n),_.not,e)):null})({parentAttributeValue:r.current,uri:e});n&&t(n)}),[t])}},vW=(0,Rp.Z)((e=>({pinIcon:{marginRight:"-8px"},pinIconActive:{"& svg > g > path":{fill:e.palette.primary.main,fillOpacity:1}}}))),TW=({onTogglePin:e,subAttributeValue:t})=>{const r=vW();return v().createElement(vd.k,{icon:oW,onClick:()=>e(t.uri),size:"L",className:O()(r.pinIcon,t.pin&&r.pinIconActive)})},OW=(0,_.curry)(((e,t,{attributeValue:r})=>r.uri===e?null:v().createElement(TW,{onTogglePin:t,subAttributeValue:r})));function SW(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const xW=({attributeType:e,attributeValue:t,onChange:r})=>{const n=(0,yp.useSelector)(k().selectors.getMetadata),a=(0,b.useMemo)((()=>{const t=(0,S.getAttributeTypeSubAttributes)(n,e),r=(0,S.createNewAttribute)({parentUri:"entities/fakeEntity",attributeType:e});return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){SW(e,t,r[t])}))}return e}({},r,{value:(0,S.createDefaultValues)({attributeTypes:t,parentUri:r.uri,metadata:n,mode:S.Mode.Editing})})}),[e,n]),i=t||a,{onChangeAttribute:o,onDeleteAttribute:l,onAddAttributes:s,onTogglePin:c}=bW({attributeValue:i,onChange:r}),u=(0,b.useCallback)(OW(i.uri,c),[i.uri,c]);return v().createElement(RL,{attributeType:e,attributeValue:i,showEmptyEditors:!0,mode:S.Mode.Editing,metadata:n,onAddAttributes:s,onDeleteAttribute:l,onChangeAttribute:o,hideDeleteButton:!0,additionalControlsRenderer:u})};function CW(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const wW=({attributeType:e,attributeValue:t,onChange:r})=>{const n=(0,yp.useSelector)(k().selectors.getMetadata),a=(0,b.useMemo)((()=>{const t=(0,S.getEditableAttributeTypeSubAttributes)(n,e),r=(0,S.createNewAttribute)({parentUri:"entities/fakeEntity",attributeType:e});return function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){CW(e,t,r[t])}))}return e}({},r,{value:(0,S.createDefaultValues)({attributeTypes:t,parentUri:r.uri,metadata:n,mode:S.Mode.Editing})})}),[e,n]),i=t||a,{onChangeAttribute:o,onDeleteAttribute:l,onAddAttributes:s,onTogglePin:c}=bW({attributeValue:i,onChange:r}),u=(0,b.useCallback)(OW(i.uri,c),[i.uri,c]);return v().createElement(vU,{attributeType:e,attributeValue:i,showEmptyEditors:!0,mode:S.Mode.Editing,metadata:n,onAddAttributes:s,onDeleteAttribute:l,onChangeAttribute:o,hideDeleteButton:!0,additionalControlsRenderer:u})},AW=({operation:e,attributeType:t,attributeValue:r,onChange:n})=>e===ra.d.RepointReference?v().createElement(yW,{attributeType:t,value:r,onChange:n}):(0,S.isNested)(t)?v().createElement(xW,{attributeType:t,attributeValue:r,onChange:n}):(0,S.isReference)(t)?v().createElement(wW,{attributeType:t,attributeValue:r,onChange:n}):null,RW=(0,_.curry)(((e,t,r)=>(0,_.assoc)(t,(0,_.prop)(e,r),(0,_.dissoc)(e,r)))),_W=(0,_.pipe)((0,_.pick)(["fieldName","title","pathToTitle","attrType"]),RW("attrType","attributeType")),IW=(0,_.unless)(_.isNil,RW("attributeType","attrType")),NW="1px solid #e4e4e4",PW=(0,Rp.Z)((e=>({mainRowContent:{display:"flex",alignItems:"center","&>*":{marginRight:8}},row:{borderBottom:NW,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}}}))),DW={enabled:!0,queueSizeThreshold:5},kW=(0,b.memo)((({id:e,operation:t,operationParameters:r,groupId:n,groupAttributeType:a,hasConditions:i})=>{const o=PW(),l=(0,yp.useDispatch)(),s=(0,yp.useSelector)(Kc),c=(0,ni.l0)(s),{pin:u,addNestedAttribute:p,attributeTypeData:d}=r||{},{attributeType:m}=d||{},f=t&&d,y=(0,b.useCallback)((({attribute:t,checked:r})=>{r&&l((({id:e,groupId:t,attribute:r})=>({type:Bn,payload:{id:e,groupId:t,attribute:r}}))({id:e,groupId:n,attribute:_W(t)}))}),[e,n,l]),g=(0,b.useCallback)((t=>{l(bc({id:e,groupId:n,operationParameters:{attributeValue:t}}))}),[l,e,n]),h=(0,b.useCallback)((()=>{l((({id:e,groupId:t})=>({type:Qn,payload:{id:e,groupId:t}}))({id:e,groupId:n}))}),[e,n,l]),E=(0,b.useCallback)((()=>{l((({id:e,groupId:t})=>({type:Jn,payload:{id:e,groupId:t}}))({id:e,groupId:n}))}),[e,n,l]),T=(0,b.useCallback)((()=>{l(Ec({id:e,groupId:n}))}),[e,n,l]),x=(0,b.useCallback)((t=>{l((({id:e,groupId:t,operation:r})=>({type:zn,payload:{id:e,groupId:t,operation:r}}))({id:e,groupId:n,operation:t.value}))}),[e,n,l]),C=(0,S.isComplexAttribute)(m)&&[ra.d.AddNew,ra.d.ReplaceAllWith,ra.d.RepointReference].includes(t),w=[ra.d.AddNew,ra.d.ReplaceAllWith,ra.d.FindAndReplace].includes(t)&&!(null==m||!m.uri),A=a&&m&&m.uri===a.uri,R=n&&!A&&t===ra.d.AddNew&&!(0,S.isReference)(a),I=(0,b.useMemo)((()=>{return m?(e=m,t=i&&A,(0,_.cond)([[(0,_.both)(S.isNested,(0,_.always)(t)),(0,_.always)((0,_.without)([ra.d.AddNew,ra.d.ReplaceAllWith],Z.DY))],[S.isNested,(0,_.always)(Z.DY)],[(0,_.both)(S.isReference,(0,_.always)(t)),(0,_.always)((0,_.without)([ra.d.AddNew],Z.hS))],[S.isReference,(0,_.always)(Z.hS)],[_.T,(0,_.always)(Z.pG)]])(e)).map((e=>({value:ra.d[e],label:Z.WN[e]}))):[];var e,t}),[i,m,A]),N=(0,b.useMemo)((()=>I.find((e=>e.value===t))),[t,I]),P=(0,b.useMemo)((()=>IW(d)),[d]),D=(0,b.useCallback)(a?(0,fY.xM)(a):(0,_.ifElse)(fY.XF,(0,_.pipe)((0,_.pathEq)(["fieldName"],"tags")),(0,_.pipe)((0,_.prop)("attrType"),(0,_.both)((0,_.complement)(S.isImage),(0,_.complement)(S.isAnalyticAttribute)))),[a]),k=(0,b.useCallback)((e=>(0,S.getSearchGroupAttributeLabel)({data:e})),[]);return(0,b.useEffect)((()=>{!N&&I[0]&&d&&x(I[0])}),[I,N,d,x]),(0,b.useEffect)((()=>{u&&!w&&h()}),[w,u,h]),(0,b.useEffect)((()=>{p&&!R&&E()}),[R,p,E]),v().createElement("div",{"data-reltio-id":"bulk-update-dialog-action-row",className:O()(o.row,{[o.withoutLine]:!!n})},v().createElement("div",{className:o.mainRowContent},v().createElement(gY,{className:o.attrSelector,single:!0,showReferencedEntityAttributes:!1,entityTypes:c,value:P,onSelect:y,firstLevelAttributesFilter:D,ungroup:!!n,getLabel:k}),v().createElement(qU,{label:"",isDisabled:!P,placeholder:li().text("Select operation"),className:o.operationSelector,value:N,options:I,height:40,onChange:x}),f&&v().createElement(v().Fragment,null,!C&&v().createElement(mW,{id:e,groupId:n,operation:t,operationParameters:r}),v().createElement("div",{className:o.icons},w&&v().createElement(vd.k,{className:O()(o.actionIcon,{[o.actionIconActive]:u}),size:"M",tooltipTitle:li().text("Make this Operational Value"),icon:oW,onClick:h}),R&&v().createElement(vd.k,{className:O()(o.actionIcon,{[o.actionIconActive]:p}),size:"M",tooltipTitle:li().text("Create parent attribute if none exists"),icon:sW,onClick:E}),v().createElement(vd.k,{size:"M",tooltipTitle:li().text("Delete"),icon:Sp(),onClick:T})))),f&&C&&v().createElement(eL.Provider,{value:DW},v().createElement(AW,{operation:t,attributeType:m,attributeValue:r.attributeValue,onChange:g})))}));var LW=r(80510),UW=r.n(LW);function jW(){return jW=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},jW.apply(null,arguments)}const FW=(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={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["attributeType","showReferencedEntityAttributes","subattributesGroupTitle","additionalItemsGroups"]);const o=(0,yp.useSelector)(k().selectors.getMetadata),l=t.uri.split("/").slice(0,3).join("/"),s=(0,ni.l0)(l),c=(0,b.useCallback)((0,fY.xM)(t),[t]),u=(0,b.useMemo)((()=>(0,_.pipe)(fY.s1,(0,_.when)((0,_.always)(!r),fY.a),(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(mY,jW({},i,{ungroup:!a,itemsGroups:u}))}));function MW(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){VW(e,t,r[t])}))}return e}function VW(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const BW=(e,t)=>(0,Va.nT)(`${Z.E_}_group`,li().text("Profile"),[MW({},(0,Va.o)(MW({title:(0,S.getEntityTypeLabel)(t,{type:(0,S.getReferencedEntityTypeUriFromAttrType)(e)}),fieldName:Z.E_},e)),{enforcedFilterOptions:[S.FilterOptions.EQUALS]})]),zW=(0,Rp.Z)({selector:{width:"254px",height:"40px"}}),HW=(0,b.memo)((({rowData:e,rowContext:{attributeType:t,dispatchGroupAction:r},attributeSelectorProps:n={}})=>{const a=zW(),i=(0,yp.useSelector)(k().selectors.getMetadata),o=e&&e.id,l=(0,b.useMemo)((()=>(0,S.isReference)(t)?[BW(t,i)]:null),[t,i]),s=(0,b.useCallback)((e=>{r(Sc,o,e)}),[o,r]);return v().createElement(FW,{className:a.selector,value:e&&e.data,attributeType:t,additionalItemsGroups:l,subattributesGroupTitle:(0,S.isReference)(t)?li().text("Reference attributes"):"",onSelect:s,onRestoreFocus:n.onRestoreFocus,onOpenPopup:n.onOpen,disableRestoreFocus:n.disablePopoverRestoreFocus,disableEnforceFocus:n.disablePopoverRestoreFocus})}));HW.displayName="ConditionAttributeSelector";const YW=e=>!(e&&e.data),WW=(0,_.pathEq)(["data","fieldName"],Z.E_),GW=(0,Rp.Z)({selector:{width:"190px"}}),qW=(0,b.memo)((({rowData:e,rowContext:{dispatchGroupAction:t},textFieldInputRef:r})=>{const n=GW(),a=e&&e.id,i=(0,b.useCallback)((e=>t(Cc,a,e.value)),[t,a]);return v().createElement(wY,{height:40,className:n.selector,attribute:e,textFieldInputRef:r,isDisabled:YW(e),onChange:i})}));qW.displayName="ConditionFilterSelector";const ZW=(0,Rp.Z)({input:{margin:0,borderRadius:"4px"},root:{borderRadius:"4px 4px 0 0",padding:0,display:"flex",alignItems:"center",margin:0},entitySelector:{width:"100%"},entitySelectorLabel:{"&:not($entitySelectorLabelShrink)":{transform:"translate(12px, 10px)"}},entitySelectorLabelShrink:{}}),$W=(0,b.memo)((({condition:e,dispatchGroupAction:t})=>{const{values:r=[],data:{attrType:n,fieldName:a}={},filter:i}=e,o=ZW(),l=(0,yp.useSelector)(k().selectors.getMetadata),s=(0,yp.useSelector)((e=>k().selectors.getGlobalSearchRequestOptions(e,["ovOnly"]))),c=(0,b.useCallback)((r=>t(wc,e.id,r)),[t,e.id]),u=(0,b.useCallback)((({uri:e,type:t,label:r})=>{c([{entityUri:e,entityType:t,entityLabel:r}])}),[c]),p=(0,S.getAttrDataTypeDefinition)(n),d=(0,S.getDataTypeDefinitionForFilterValue)(p,i);return WW(e)?v().createElement(gU,{className:o.entitySelector,entity:r[0],entityTypesUris:(0,ni.l0)((0,S.getReferencedEntityTypeUriFromAttrType)(n)),metadata:l,mode:S.Mode.Editing,globalSearchRequestOptions:s,onChange:u,height:40,disableLinkClick:!0,TextFieldProps:{InputLabelProps:{classes:{root:o.entitySelectorLabel,shrink:o.entitySelectorLabelShrink}}}}):v().createElement(_Y.n,{filter:{filter:i,fieldName:a,values:r||[]},onChange:c,dataTypeDefinition:d,fullWidth:!0,TextFieldProps:{InputProps:{classes:{root:o.input}}},color:"primary",classes:{root:o.root},orientation:"horizontal"})}));$W.displayName="ConditionValuesEditor";const KW=(0,Rp.Z)({root:{width:"100%",display:"flex",minHeight:"40px",alignItems:"flex-start",boxSizing:"border-box"}}),XW=(0,b.memo)((({rowData:e,rowContext:{dispatchGroupAction:t}})=>{const r=KW(),n=YW(e),a=e&&(0,S.checkIfOptionHasValues)(e.filter);return v().createElement("div",{className:r.root},!n&&a&&v().createElement($W,{condition:e,dispatchGroupAction:t}))}));XW.displayName="ConditionValuesEditorWrapper";const QW=(0,Rp.Z)({root:{paddingTop:"8px",height:"24px",display:"flex",alignItems:"center",justifyContent:"space-between",flexShrink:"0"}}),JW=(0,b.memo)((({rowData:e,rowContext:{dispatchGroupAction:t}})=>{const r=QW(),n=e&&e.id,a=(0,b.useCallback)((()=>t(xc,n)),[n,t]);return e?v().createElement("div",{className:r.root},v().createElement(vd.k,{tooltipTitle:li().text("Delete"),tooltipPlacement:"bottom",icon:Sp(),size:"M",onClick:a})):null}));JW.displayName="ConditionActions";const eG=(0,Rp.Z)((e=>({row:{"&:hover $actions":{opacity:1}},logicOperatorContainer:{maxHeight:"40px"},caption:{color:e.palette.text.secondary},conditions:{backgroundColor:"rgba(0,0,0,0.032)",padding:"20px 15px",margin:"7px 0"},actions:{opacity:"0",transition:"opacity 0.3s"}}))),tG=({attributeType:e,conditions:t,groupId:r})=>{const n=eG(),a=(0,yp.useDispatch)(),i=(0,b.useCallback)(((e,...t)=>a(e(r,...t))),[r,a]),o=(0,b.useMemo)((()=>({root:n.row,logicOperatorContainer:n.logicOperatorContainer,actionsContainer:n.actions})),[n]);return v().createElement(v().Fragment,null,v().createElement(Tf(),{variant:"caption",component:"div",className:n.caption},li().text("If the following conditions are met")),v().createElement(wH,{className:n.conditions,rowClasses:o,rowsData:t,AttributeSelectorComponent:HW,FilterSelectorComponent:qW,ValuesEditorComponent:XW,ActionsComponent:JW,attributeType:e,dispatchGroupAction:i}),v().createElement(Tf(),{variant:"caption",component:"div",className:n.caption},li().text("Then perform the change")))},rG=(0,Rp.Z)((e=>({complexRow:{borderBottom:NW,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"}})));function nG(){return nG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},nG.apply(null,arguments)}const aG=(0,b.memo)((({id:e,fieldName:t,actions:r,conditions:n})=>{const a=rG(),i=(0,yp.useDispatch)(),o=(0,yp.useSelector)(Kc),l=(0,yp.useSelector)(k().selectors.getMetadata),s=(0,b.useMemo)((()=>{const e=(0,S.searchUriToAttrUri)(t,o);return(0,S.findAttributeTypeByUri)(l,e,o)}),[l,t,o]),c=!!n,u=((e,t)=>(0,_.any)((0,_.both)((0,_.pipe)((0,_.prop)("operation"),(0,_.includes)(_.__,[ra.d.AddNew,ra.d.ReplaceAllWith])),(0,_.pathEq)(["operationParameters","attributeTypeData","attributeType","uri"],t.uri)))(e))(r,s),p=(0,b.useCallback)((()=>i({type:Wn,payload:e})),[e,i]),d=(t={})=>v().createElement(kW,nG({key:t.id},t,{groupId:e,groupAttributeType:s,hasConditions:c}));return(0,b.useEffect)((()=>{c||0!==r.length||i(Ec({id:e,groupId:void 0}))}),[e,c,r.length,i]),v().createElement("div",{className:a.complexRow},v().createElement("div",{className:a.header},v().createElement("div",{className:a.attributeLabel},s.label),v().createElement(qh(),{disabled:u,color:"primary",className:a.conditionsToggleButton,onClick:p},c?v().createElement(v().Fragment,null,v().createElement(UW(),{className:a.conditionsToggleIcon}),li().text("Remove")," "):v().createElement(v().Fragment,null,v().createElement(hH(),{className:a.conditionsToggleIcon}),li().text("Add")," "),li().text("conditions"))),n&&v().createElement(tG,{attributeType:s,conditions:n,groupId:e}),v().createElement("div",{className:a.actionsBlock},r.map(d),d()))}));aG.displayName="ComplexActionRow";const iG=(0,Rp.Z)({wrapper:{flexGrow:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"flex-start",backgroundColor:"#fafafa",boxSizing:"border-box",padding:30},container:{width:"100%",flex:"1 1 auto",maxWidth:1320,backgroundColor:"white",borderRadius:2,padding:"16px 0 50px",display:"flex",flexDirection:"column"}});function oG(){return oG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},oG.apply(null,arguments)}const lG=e=>"actions"in e?v().createElement(aG,oG({key:e.id},e)):v().createElement(kW,oG({key:e.id},e)),sG=()=>{const e=iG(),t=(0,yp.useSelector)(pu);return v().createElement("div",{className:e.wrapper},v().createElement("div",{className:e.container},t.map(lG),v().createElement(kW,null)))};var cG=r(99261),uG=r.n(cG),pG=r(26518),dG=r.n(pG),mG=r(60158),fG=r.n(mG),yG=r(61887),gG=r.n(yG);const hG=(0,Rp.Z)((()=>({buttonWrapper:{position:"relative"},progress:{position:"absolute",left:"calc(50% - 12px)",top:"calc(50% - 12px)"}})));function EG(){return EG=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},EG.apply(null,arguments)}const bG=e=>{let{isInProgress:t,disabled:r,circularColor:n="primary",className:a,children:i}=e,o=function(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}(e,["isInProgress","disabled","circularColor","className","children"]);const l=hG();return v().createElement(qh(),EG({},o,{className:O()(l.buttonWrapper,a),disabled:r||t}),i,t&&v().createElement("div",{className:l.progress,"data-reltio-id":"reltio-circular-load-indicator"},v().createElement(fm(),{size:24,color:n})))},vG=(0,Rp.Z)((()=>({container:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%"},placeholder:{flex:1},stepper:{padding:"0 24px",flex:2},stepButton:{margin:"-20px -16px",padding:"20px 16px","& svg text":{textAnchor:"middle"}},buttons:{flex:1,display:"flex",justifyContent:"flex-end"},backButton:{marginRight:"8px",border:"1px solid rgba(0, 0, 0, 0.23)"},errorLabel:{color:"#dd2c00 !important"},warningLabel:{color:"#f9a825 !important"}}))),TG=({activeStep:e,steps:t,isPending:r=!1,shouldCompleteSteps:n=!0,onConfirm:a,onChangeStep:i})=>{const o=vG(),l=e===t.length-1,s=t=>{t!==e&&i(t)},c=(0,_.propOr)(!0,"enabled"),u=e=>{if(e>0){const r=e-1;c(t[r])?s(r):u(r)}},p=e=>{if(e<t.length-1){const r=e+1;c(t[r])?s(r):p(r)}},d=l&&!!a,m=d||(0,_.any)(c,(0,_.drop)(e+1,t));return v().createElement("div",{className:o.container},v().createElement("div",{className:o.placeholder}),v().createElement(uG(),{nonLinear:!0,activeStep:e,className:o.stepper},t.map((({label:t,enabled:a=!0,hasError:i,hasWarning:l},c)=>{const u=!a||r,p=n&&!u&&c<e;return v().createElement(dG(),{key:t,completed:p,disabled:u},v().createElement(fG(),{className:o.stepButton,onClick:()=>s(c),"data-reltio-id":`reltio-search-bulk-update-${c}`},v().createElement(gG(),{error:i||l,classes:{error:i?o.errorLabel:o.warningLabel}},t)))}))),v().createElement("div",{className:o.buttons},e>0&&v().createElement(qh(),{variant:"outlined",className:o.backButton,onClick:()=>u(e),disabled:r,"data-reltio-id":"reltio-search-bulk-update-back"},li().text("Back")),v().createElement(bG,{variant:"contained",color:"primary",disabled:!m,isInProgress:r,onClick:l?a:()=>p(e),"data-reltio-id":"reltio-search-bulk-update-"+(l?"confirm":"continue")},d?li().text("Confirm"):li().text("Continue"))))},OG=()=>{const e=(0,yp.useDispatch)(),t=(0,yp.useSelector)(Zc),r=(0,yp.useSelector)(uu),n=(0,yp.useSelector)(qc),a=!(0,_.isNil)(n),i=(0,yp.useSelector)(fu),o=(0,yp.useSelector)(yu),l=[{label:li().text("Select profiles")},{label:li().text("Select operation"),enabled:r},{label:li().text("Define changes"),enabled:r&&a&&n===Z.dV.UpdateProfiles},{label:li().text("Review changes"),enabled:r&&a&&(i||n===Z.dV.DeleteProfiles)}];return v().createElement(TG,{activeStep:t,steps:l,isPending:o,onChangeStep:t=>e((e=>({type:wn,payload:e}))(t)),onConfirm:()=>e({type:ea})})},SG=(0,Rp.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"}}))),xG=({children:e,onClose:t})=>{const r=SG();return v().createElement(aF(),{position:"static",color:"default",className:r.appBar},v().createElement(oF(),{className:r.toolbar},v().createElement(vd.k,{edge:"start",tooltipTitle:li().text("Close"),"aria-label":li().text("Close"),icon:Sp(),onClick:t,className:r.closeButton,size:"L","data-reltio-id":"reltio-search-bulk-update-close"}),v().createElement(Tf(),{variant:"h6",className:r.title},e)),v().createElement(oF(),{className:r.toolbar},v().createElement(OG,null)))};xG.propTypes={children:fp().node,onClose:fp().func};const CG=xG,wG=(0,Rp.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"}}))),AG=(0,_.equals)(Z.v6.include);function RG(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const _G=()=>{const e=wG(),t=(0,yp.useDispatch)(),r=(0,yp.useSelector)(k().selectors.getMetadata),n=(0,yp.useSelector)(Kc),a=(0,yp.useSelector)(ou),i=(0,yp.useSelector)(eu),o=(0,yp.useSelector)(au),l=(0,yp.useSelector)(iu),s=(0,yp.useSelector)(Qc),c=(0,yp.useSelector)(ru),u=(0,yp.useSelector)(nu),p=(0,yp.useSelector)($c),d=(0,yp.useSelector)(tu),m=(0,yp.useSelector)(Jc),f=(0,b.useMemo)((()=>((e,t,r)=>(0,_.pipe)((0,_.map)((0,_.prop)("uri")),AG(e)?(0,_.intersection)(t):(0,_.without)(t))(r))(m,d,i)),[m,d,i]),y=((e,t)=>0!==e.length&&(e.length===t.length||null))(f,i),g=(0,b.useMemo)((()=>(0,Ai.oq)(r,n,a)),[r,n,a]),h=(0,b.useCallback)((({field:e,order:r})=>t((({field:e,order:t})=>({type:kn,payload:{field:e,order:t}}))({field:r?e:null,order:r}))),[t]),E=(0,b.useCallback)((({what:e,where:r})=>{const n=(0,_.move)(e.columnIndex,r.columnIndex,a);t(yc(n))}),[t,a]),T=(0,b.useCallback)((({columns:e})=>{const r=(0,Ai.tU)(e,a);t(yc(e)),r&&t(pc())}),[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.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){RG(e,t,r[t])}))}return e}({},t,{size:e[r].size})));t(yc(r))}),[t,a]),S=(0,b.useCallback)(((e,r)=>{t(e?((e,t)=>({type:_n,payload:{uri:e,checked:t}}))(e,r):{type:In,payload:!y})}),[y,t]),x=(0,b.useRef)(null);return v().createElement("div",{className:e.tableContainer},p&&v().createElement(AE.z,null),v().createElement(sf,{entities:i,entityTypeUri:n,headColumns:a,additionalColumns:g,canCheck:!0,onCheck:S,checkedEntitiesUris:f,headerCheckboxState:y,dndColumnReorderingEnabled:!0,sortField:o,sortOrder:l,onSort:h,onReorderingColumn:E,onChangeColumnsList:T,onChangeColumnsSize:O,entitiesTableRef:x}),s>Z.Tu[0]&&v().createElement("div",{className:e.pagination},v().createElement(hE.Z,{count:s,rowsPerPageOptions:Z.Tu,rowsPerPage:u||Z.Tu[0],page:c||0,onChangePage:e=>t(fc(e)),onChangeRowsPerPage:e=>t((e=>({type:Pn,payload:e}))(e)),basicTableRef:x})))},IG=(0,Rp.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"}}))),NG=()=>{const e=IG(),t=(0,yp.useDispatch)(),r=(0,yp.useSelector)(qc),n=(0,yp.useSelector)(k().selectors.getCanUserDeleteProfiles);(0,b.useEffect)((()=>{(0,_.isNil)(r)&&t(hc(Z.dV.UpdateProfiles))}),[r,t]);const a=(0,_.pipe)(wp.NA,hc,t);return v().createElement("div",{className:e.tableContainer},v().createElement(Tf(),{className:e.title},li().text("Choose Bulk Update Operation")),v().createElement(bh(),{value:r,onChange:a},v().createElement(Th(),{classes:{label:e.label},value:Z.dV.UpdateProfiles,control:v().createElement(hh(),{className:e.radioButton}),label:li().text("Update Profiles - Update attribute values of selected profiles")}),v().createElement(Th(),{disabled:!n,classes:{label:e.label},value:Z.dV.DeleteProfiles,control:v().createElement(hh(),{className:e.radioButton}),label:li().text("Delete Profiles - Delete selected profiles")})))};var PG=r(49850),DG=r.n(PG),kG=r(28012),LG=r.n(kG),UG=r(18878),jG=r.n(UG),FG=r(70918),MG=r.n(FG),VG=r(51159),BG=r.n(VG),zG=r(35681),HG=r.n(zG);const YG=({value:e,attributeType:t,lookups:r})=>((0,S.isLookupAttrType)(t)&&"string"==typeof e&&(e={lookupCode:e,value:(0,S.getResolvedLookupValue)(r,(0,S.getAttrTypeLookupCode)(t),e)}),v().createElement(Wd.x,{dataTypeDefinition:(0,S.getAttrDataTypeDefinition)(t),value:e})),WG=({operation:e})=>v().createElement(v().Fragment,null,Z.WN[e]),GG=({conditions:e,attributesPresentation:t,metadata:r,lookups:n})=>{if((0,S.isEmptyValue)(e))return v().createElement(v().Fragment,null,"-");const a=(0,S.buildAttributesReadableQuery)(r,t,n,e,!1);return v().createElement(eH,{readableQuery:a})},qG="8px",ZG="1px",$G="1px solid #AFD4E9",KG=(0,Rp.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:ZG,left:qG,top:0,borderLeft:$G}},scaffoldHalfVert:{"&:before":{content:'""',position:"absolute",display:"block",boxSizing:"border-box",height:"50%",width:ZG,left:qG,top:0,borderLeft:$G}},scaffoldHor:{"&:after":{content:'""',position:"absolute",display:"block",boxSizing:"border-box",height:ZG,width:"5px",left:qG,top:"50%",borderBottom:$G}},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%"}}))),XG=({attributeTypeData:{pathToTitle:e,title:t}})=>{const r=KG();return Boolean(e&&e.length>2)?v().createElement(ug,{placement:"bottom-start",pathToTitle:e},v().createElement("span",{className:r.nestedLabel},t)):v().createElement(v().Fragment,null,t)};function QG(e,t){if(null==e)return{};var r,n,a=function(e,t){if(null==e)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.includes(n))continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.includes(r)||{}.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function JG(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?Object(arguments[t]):{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach((function(t){eq(e,t,r[t])}))}return e}function eq(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const tq={EMPTY:"empty",FULL_VERT:"full_vert",FULL_VERT_HOR:"full_vert_hor",HALF_VERT_HOR:"half_vert_hor"},rq=e=>e.map(((t,r)=>(({hasLowerSubAttrs:e,isFirstValue:t,isLastScaffold:r})=>{const n=r&&t;return e?n?tq.FULL_VERT_HOR:tq.FULL_VERT:n?tq.HALF_VERT_HOR:tq.EMPTY})(JG({},t,{isLastScaffold:r===e.length-1})))),nq=({operation:e,operationParameters:t})=>(0,S.wrapInArrayIfNeeded)(JG({},t,{operation:e})),aq=(e,t,r=[],n=[])=>{const a=(0,S.findAttributeTypeByUri)(e,t.type),i=a.label||a.name,o={attributeTypeData:{attributeType:a,title:i,pathToTitle:[...r,i]},scaffolds:rq(n),pin:t.pin};if((0,S.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 aq(e,t,[...r,i],[...n,s])}))));return[o,...l]}return[JG({},o,{attributeValue:(0,S.getAttributeValue)(t)})]},iq=(0,_.curry)(((e,{operation:t,operationParameters:r})=>{const{attributeValue:n,attributeTypeData:a}=r,i=QG(r,["attributeValue","attributeTypeData"]),[o,...l]=aq(e,n,a.pathToTitle.slice(0,-1));return[JG({},o,{operation:t},i),...l]})),oq=(0,_.curry)(((e,{operation:t,operationParameters:r})=>{const{attributeValue:n,attributeTypeData:a}=r,i=QG(r,["attributeValue","attributeTypeData"]),[o,...l]=aq(e,n,a.pathToTitle.slice(0,-1)),{label:s,refEntity:c}=n,[{objectURI:u,type:p}]=c;return[JG({},o,{operation:t},i,{attributeValue:{entityUri:u,entityLabel:s,entityType:p}}),...l]})),lq=(0,_.curry)(((e,t)=>(0,_.cond)([[Vc,iq(e)],[Bc,oq(e)],[_.T,nq]])(t))),sq=(0,_.curry)(((e,t)=>(0,_.pipe)((0,_.defaultTo)([]),(0,_.chain)((0,_.ifElse)(_c,(0,_.pipe)(Ic,sq(e)),lq(e))))(t))),cq=({scaffold:e})=>{const t=KG();return v().createElement("div",{className:O()(t.scaffold,{[t.scaffoldFullVert]:e===tq.FULL_VERT||e===tq.FULL_VERT_HOR,[t.scaffoldHalfVert]:e===tq.HALF_VERT_HOR,[t.scaffoldHor]:e===tq.FULL_VERT_HOR||e===tq.HALF_VERT_HOR})})};cq.propTypes={scaffold:fp().oneOf((0,_.values)(tq))};const uq=({scaffolds:e})=>{const t=KG();return v().createElement("div",{className:t.scaffoldsContainer},e.map(((e,t)=>v().createElement(cq,{key:t,scaffold:e}))))};uq.propTypes={scaffolds:fp().arrayOf(cq.propTypes.scaffold)};const pq=uq,dq=({children:e})=>{const t=KG();return v().createElement("div",{className:t.noWrapContainer},e)};dq.propTypes={children:fp().node};const mq=dq,fq=({pin:e,addParent:t})=>{const r=KG();return v().createElement(mq,null,v().createElement("div",{className:O()(r.optionContainer,{[r.opaque]:!e})},v().createElement(oW,null)),v().createElement("div",{className:O()(r.optionContainer,{[r.opaque]:!t})},v().createElement(sW,null)))};fq.propTypes={pin:fp().bool,addParent:fp().bool};const yq=fq,gq=({entity:{entityLabel:e,entityUri:t},attributeType:r})=>{const n=KG(),a=(0,yp.useSelector)((e=>k().selectors.getModifiedEntity(e,t)))||null,i=(0,yp.useSelector)(k().selectors.getMetadata),o=(0,b.useCallback)((()=>{const e=(0,S.getReferencedEntityTypeUriFromAttrType)(r),t=(0,S.getEntityType)(i,e);return(0,S.evaluateDeepEntityLabel)(a,t.dataLabelPattern)}),[r,i,a]),l=a?o():e;return v().createElement(mq,null,(0,S.getLabel)(l),(0,S.isTempUri)(t)&&v().createElement("div",{className:n.newIcon},li().text("New")))},hq=(0,Rp.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%"}}))),Eq=()=>{const e=hq(),t=(0,yp.useSelector)(du),r=(0,yp.useSelector)(k().selectors.getMetadata),n=(0,yp.useSelector)(k().selectors.getAttributesPresentation),a=(0,yp.useSelector)(k().selectors.getLookups),i=(0,b.useMemo)((()=>sq(r,t)),[t,r]);return v().createElement(MG(),{className:e.tableContainer,component:jI()},v().createElement(DG(),{className:e.table},v().createElement(BG(),null,v().createElement(HG(),null,v().createElement(jG(),{className:e.attributeColumn},li().text("Attribute")),v().createElement(jG(),{className:e.conditionColumn},li().text("Condition")),v().createElement(jG(),{className:e.operatorColumn},li().text("Operator")),v().createElement(jG(),{className:e.valueColumn,colSpan:2}),v().createElement(jG(),{className:e.valueColumn}),v().createElement(jG(),{className:e.optionsColumn}))),v().createElement(LG(),null,i.map((({scaffolds:e,attributeTypeData:t,conditions:i,operation:o,attributeValueToFind:l,attributeValue:s,pin:c,addNestedAttribute:u},p)=>{const d=!(0,_.isNil)(s),m=!(0,_.isNil)(l);return v().createElement(HG(),{key:p},v().createElement(jG(),null,v().createElement(mq,null,e&&v().createElement(pq,{scaffolds:e}),v().createElement(XG,{attributeTypeData:t}))),v().createElement(jG(),null,v().createElement(GG,{attributesPresentation:n,metadata:r,lookups:a,conditions:i})),v().createElement(jG(),null,o&&v().createElement(WG,{operation:o})),v().createElement(jG(),null,m&&v().createElement(YG,{lookups:a,attributeType:t.attributeType,value:l})),v().createElement(jG(),{align:"right"},m&&d&&v().createElement(mq,null,v().createElement("span",null,li().text("with")))),v().createElement(jG(),null,d&&((0,S.isReference)(t.attributeType)?v().createElement(gq,{entity:s,attributeType:t.attributeType}):v().createElement(YG,{lookups:a,attributeType:t.attributeType,value:s}))),v().createElement(jG(),{align:"right"},v().createElement(yq,{pin:c,addParent:u})))})))))},bq=(0,Rp.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}}}))),vq=()=>{const e=bq(),t=(0,yp.useSelector)(qc),r=(0,yp.useSelector)(cu);return t===Z.dV.UpdateProfiles?v().createElement(Eq,null):v().createElement("div",{className:e.tableContainer},v().createElement("div",{className:e.text},v().createElement("p",null,`${li().text("Please confirm that you wish to start deletion of the selected")}`,v().createElement("b",null,` ${li().number(r,"0,0")} `),li().text(" profiles.")),v().createElement("p",null,li().text("Click on Confirm to proceed."))))},Tq=(0,Rp.Z)((()=>({contentRoot:{padding:"0 0 5px",position:"relative",backgroundColor:"#FAFAFA"},tenantLabel:{marginLeft:"23px"}}))),Oq=()=>{const e=Tq(),t=(0,yp.useSelector)(Ri.Ue),r=(0,yp.useSelector)(Zc),n=(0,yp.useDispatch)(),a=()=>n(wi(!1));return v().createElement(Ej(),{fullScreen:!0,open:t,onClose:a,disableEnforceFocus:!0},v().createElement(CG,{onClose:a},li().text("Bulk update"),v().createElement(rW,{className:e.tenantLabel})),v().createElement(aW,null),v().createElement(rF(),{classes:{root:e.contentRoot}},(()=>{switch(r){case 0:return v().createElement(_G,null);case 1:return v().createElement(NG,null);case 2:return v().createElement(sG,null);case 3:return v().createElement(vq,null)}})()))},Sq="1px solid rgba(0, 0, 0, 0.33)",xq=(0,Rp.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:Sq},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:Sq,boxShadow:"0 1px 3px 0 rgba(0,0,0,0.12)"}}))),Cq=(0,cd.T)(Sf()),wq=(0,yp.connect)((e=>({isReadyAppData:!!(0,Ri.$s)(e),openAdvancedSearch:(0,Ri.IJ)(e),tenant:k().selectors.getTenant(e)})))((({openAdvancedSearch:e,isReadyAppData:t,tenant:r,dispatch:n})=>{const a=(0,b.useCallback)((()=>{n({type:L.k.CONVERT_FROM_ADVANCED_SEARCH}),n(hi(!1))}),[n]),i=(0,b.useCallback)((()=>{n(hi(!0)),n({type:mt})}),[n]),[o,l]=(0,b.useState)(!0),s=(0,b.useCallback)((e=>{l(e<=0)}),[]),c=xq(),u=!e;return(0,b.useEffect)((()=>()=>S.memoizeWith.clearCache()),[r]),t?v().createElement(v().Fragment,null,v().createElement("div",{className:c.root},v().createElement(bf,{variant:"persistent",anchor:"left",open:u,classes:{root:c.drawer,paper:c.drawerPaper,docked:c.docked},"data-reltio-id":"reltio-search-facet-search-panel"},v().createElement(Cq,{tooltipTitle:li().text("Switch to Advanced search"),tooltipPlacement:"bottom-end",variant:"extended",classes:{root:c.buttonRoot,extended:c.buttonExtended},onClick:i,"data-reltio-id":"reltio-search-advanced-search-button"},v().createElement(Cf(),{color:"primary",className:c.menuIcon}),v().createElement("span",{className:c.buttonLabel},li().text("Advanced search")),v().createElement(Af(),{color:"action",className:c.goToActionIcon})),v().createElement(Tf(),{variant:"button",classes:{root:O()(c.quickFilterRoot,{[c.withBottomBorder]:!o})}},li().text("Quick filters")),v().createElement(Uh,{onScroll:s})),v().createElement(Fh,{className:O()(c.mainContent,{[c["mainContent--shifted"]]:u})},v().createElement(QY,{isOpenAdvancedSearch:e,onCloseAdvancedSearch:a}))),v().createElement(Bh,null),v().createElement(eE,null),v().createElement(Oq,null)):null})),Aq=mf()({productionPrefix:"searchTable",disableGlobal:!0,seed:"srch"});S.userPreferencesComparator.register("searchState",((e,t)=>(0,S.looseEquals)((0,_.omit)(["query"],e),(0,_.omit)(["query"],t))));const Rq=()=>v().createElement(cf.DynamicModuleLoader,{modules:[dp()]},v().createElement(yf(),{generateClassName:Aq},v().createElement(pf._,{dateAdapter:uf.Q},v().createElement(wq,null))))}}]);