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2B,KACAd,KACAZ,KACAI,KACAC,KAEA,SAASwB,GAAmBjvH,EAAU,CAC7B,4BAAwB5F,GAAU,CACvCA,EAAM,eAAe,EACrBgkB,GAAYhkB,EAAM,MAAM,GAE1B,OAAO,QAAU,CAAC+5F,EAAK95D,EAAKliC,EAAMoyF,EAAKltE,KAChC5uB,GAAiB4uB,CAAK,EACpB,IAEF,wBAAiB,oBAAsBjjB,GAAU,CACtDA,EAAM,eAAe,EACrBgkB,GAAYhkB,EAAM,OAAO,EAC1B,EACD4F,EAAI,OAAO,aAAgBsM,GAAQ,CACjC8R,GAAY9R,CAAG,GAEjBtM,EAAI,OAAO,YAAesM,GAAQ,CAChC8R,GAAY9R,CAAG,EAEnB","names":["appId","apiBase","w","ic","d","i","args","l","s","x","EventBus","TinyEmitter","sendSetting","name","value","sendKeyEvent","sendBoardSwitch","sendEvent","sendServerTick","serverTime","sendBoardLoaded","boardId","sendOpenNavigation","item","sendStickyNoteAction","id","action","data","key","useEventBus","callbacks","onUnmounted","callback","onBoardSwitch","onEvent","onServerTick","onOpenNavigation","onStickyNoteAction","e","LocalStore","options","_a","_b","raw","captureException","versioned","version","isArray","convertCharToHtmlEntity","c","unique","exists","suffix","toKebabCase","str","toSnakeCase","actionEvent","eventName","source","params","modalOpened","trigger","modalName","modalClosed","appClosed","boardActivated","type","teamId","artId","boardDeactivated","planReadoutTabClicked","fromTab","toTab","planReadoutTeamChanged","planReadoutSelectObjective","objectiveId","isStretch","planReadoutSelectRisk","planReadoutObjectiveLinksToggled","open","objectiveMarkedAs","tabVisibilityStateChanged","visibility","userSettingChanged","fromValue","toValue","stickyNoteCreated","functionality","fromBoard","fromDefault","stickyNotePinned","stickyNoteUnpinned","stickyNoteAttributeChipClicked","chipName","isStickyActive","stickyNoteActionMenuItemClicked","itemName","shapeActionMenuItemClicked","statusDistributionShown","statusDistributionType","statusDistributionHidden","timerAdded","timerScope","timerStarted","searchOpened","searchClosed","keepFilters","boardHistoryOpened","boardHistoryClosed","boardHistoryItemOpened","tab","boardHistoryItemClosed","boardHistoryTimespanChanged","timespan","boardHistoryFilterChanged","filterName","selectedValues","boardHistoryTabChanged","modalTabChanged","searchFilterOpened","appZoomOpened","appZoomZoomChanged","stickyNoteDeactivated","stickyNoteActivated","stickyNoteTextChanged","textLengthBeforeEdit","stickyNoteEnlarged","stickyNoteShrunk","searchTextChanged","searchItemSelected","toBoard","stickyNoteLinkDragStarted","userActionsMenuOpened","bottomMenuToggled","stickyNoteDragStarted","stickyNoteDragMoved","stickyNoteDragEnded","errorDialogSeen","errorDialogReloadClicked","errorDialogStatusLinkClicked","userMenuStatusLinkClicked","linkModalSearchUsed","linkModalOrgTreeToggled","linkModalOrgTreeLevelSelected","level","linkModalFilterOpened","linkModalFilterTypeSelected","linkModalFilterTypeDeselected","drawShapeSelected","drawTextEdited","drawAlignEdited","switchSessionOrgTreeLevelSelected","kanbanBoardFilterUsed","filter","kanbanBoardFiltersCleared","kanbanBoardStickyChipClicked","kanbanBoardStickyDragStarted","kanbanBoardHorizontalScrollUsed","intercomMessengerShown","intercomMessengerHidden","intercomTriggerClicked","oppositeLineComponent","isCoordinate","relativeCoord","y","windowCoord","boardCoord","offScreen","isOffScreen","rectangle","halfSize","divided","minus","plus","add","a","b","times","factor1","factor2","max","as","res","min","toSize","ETA","isEqual","isNear","distance2","interpolate","v","insideRectangle","r","rectangleSize","clampRelativeCoord","clamp","nearestLinePoint","point","line","len","t","isHorizontal","scrollCoord","centerCoord","windowSize","contentSize","clientSize","clientCoord","elem","offsetCoord","scrollSize","el","offsetSize","boundsCoord","left","top","hideElements","elements","state","element","showElements","stickyNoteEl","isElementInViewport","_c","isBrowserTabActive","createTspan","text","tspan","fontsLoaded","fonts","terminateEvent","event","addFontFamily","fontFamily","isScrollbarVisible","documentElement","hasVerticalScrollbar","getScrollbarSize","outer","inner","size","rect","content","isMac","isFirefox","lineSeparator","whenChildElementWithClass","className","child","observer","mutationList","mutation","node","eventTarget","isInput","stopScrollPropagation","currentTarget","releaseCapture","_d","isLeftClick","logPerformance","toBoolean","natsUrl","authAPIUrl","piserverAPIUrl","adminUrl","isCloud","sentryDsn","gaKey","featureProxyUrl","featureProxySecret","environment","intercomId","intercomApi","loginTimeout","build","amplitudeApiKey","amplitudeDebug","faroUrl","getConfig","val","featureToggles","dummyToggles","initFeatureToggles","userId","unleash","unleashToggles","setGitlabToggles","UnleashClient","_toggleName","features","isFeatureEnabled","route","featureId","found","f","isFeatureEnabledInQuery","parseUrlWithoutRouter","hash","queryStart","extractedParams","feature","broadcastAvailableFeatures","broadcastFeatures","triggerSoftRefresh","toggles","router","__vitePreload","router$1","currentRoute","consoleLogger","consoleLogException","exception","hint","contexts","consoleLogMessage","message","mockSentry","noop","loadSentry","Sentry","n","initSentry","app","config","breadcrumb","Replay","setUser","company","authid","scope","ClientJS","resetUser","eventHint","captureMessage","addBreadcrumb","category","additionalProperties","DEFAULT_LOCALE","FALLBACK_LOCALE","none","en","i18n","createI18n","translate","k","modifiers","names","keyName","accept","hasModifiers","keys","ks","noAccept","noKey","dummyKey","isString","shiftOk","altCtrlOk","m","modKey","keyNames","stickySize","cssValue","fakeZoom","MILLI_SECONDS","SECONDS","MINUTES","boardAspect","zoomFactor","arrowBoxFactor","arrowLen","arrowAngle","longClick","longClickDist","dragStartDist","minZoom","maxZoom","cardZoomHeight","moveSendPeriod","moveSendPerPeriod","maxMoveSendPerPeriod","moveAnimationDelay","moveAnimationStep","statHistory","pointerPosInterval","pointerPosHide","pointerTrailMaxLen","pointerTrailDotDist","keepEndedTimer","timerEnding","userHeartbeatInterval","maxVisibleUsersOnBoard","natsRequestTimeout","natsTabInactiveRequestTimeout","iterationSyncTimeout","backlogSyncTimeout","updateTimeout","screenShotWidth","snapDistance","previewDelay","useActionStore","defineStore","execute","delay","ensureResolve","fun","resolve","used","doAfter","first","after","impl","ctx","actionContext","_","makeActionData","makeAction","ctxAction","previewAction","actionFun","assignShortcut","applyActionParams","defineActions","actions","context","arg","trackAction","ignoreActions","lastActionId","track","trackEvent","isBacklogBoard","isPlanningBoard","isSolutionBoard","isArtBoard","isTeamBoard","isRiskBoard","isObjectivesBoard","isFlexBoard","hasBoardObjectives","board","isFrontendBoard","boardTypeOrder","useStickyTypeStore","zombieStickyType","originTypes","mirrorTypes","boardStickyTypes","flexType","stickyType","origin","mirror","isZombieType","isStickyTypeAlmSynced","Throttle","period","executionsPerPeriod","maxSumPerPeriod","rate","firstProperty","obj","prop","mapObjectValues","mapper","firstValue","toHex","pad","generateId","end","h","removeNonPrintable","neverResolve","asyncNoop","performanceLog","start","truncateString","maxLength","countMax","rndMax","count","rndInt","objectId","rnd","asyncAny","asyncArray","dummyBackendSession","Sender","moved","move","props","priorities","convertToServerSticky","coord","iteration","velocity","objective","convertToServerObjective","stretch","rank","cardId","toBoardId","typeId","toId","linkId","iterationId","update","categoryId","pos","reaction","shape","shapeId","sender","_imports_0$2","__props","style","computed","modules","getIconComponent","defineAsyncComponent","path","err","PlaceHolderIcon","SvgLoadingPlaceholder","IconComponent","useAsyncHandler","eventNames","$attrs","useAttrs","attrs","handleClick","processing","ref","handler","handle","doHandleClick","result","timeout","buttonRef","focus","blur","getBoundingClientRect","aria","__expose","tooltipDelayToAppear","tooltipRef","slots","useSlots","onMounted","shouldShow","instance","useNativeEvents","listeners","onBeforeUnmount","removeEventListeners","addEventListener","listener","useSimpleDraggable","endDrag","moveDrag","drag","startDrag","setDragPos","handleBackdropClick","hide","useI18n","actionSource","navigationActions","modal","handleKey","useBoardSizeStore","margin","useSidePanelStore","side","width","close","target","useZoomStore","factor","center","windowToRelative","relativeToWindow","scroll","windowToBoard","limitCoords","additionalOffsets","boardSize","zoom","xHalf","useBoardStore","yHalf","limited","limit","additional","combineDeltas","inp","insideBoard","combine","xBase","yBase","p0","boardToWindow","p1","boardToWindowSimple","windowToBoardSimple","boardToRelative","coordinates","boardToRelativeSimple","relativeToBoard","cardSize","cardInsideBoardRelative","height","newX","newY","delta","scrollbarSize","validateCardPositionInBoard","checkViewport","originalX","originalY","scrollbarsVisible","scrollbarX","scrollbarY","outline","gap","leftPanelSize","rightPanelSize","viewportLeft","viewportRight","viewportTop","viewportBottom","calcBoardSize","visibleWindowSize","boardSpace","adjustBoardLeftSize","neededLeftSize","assureBoardLeftSize","removeBoardScrollMargin","docElem","maxScroll","possibleLeftTop","possibleRightBottom","initial","current","iter","addLeft","maxScrollX","needScroll","addRight","contentWidth","relativeClientCoord","infoLevelInfo","color","boardTypes","boardI18nKeys","boardTypeName","boardNavName","boardIcon","boardTitle","art","hasArt","isBoardType","riskTypes","riskI18nKeys","riskTypeName","risk","riskTitle","riskIcon","statusClasses","statusClassNames","almTypeInfo","NO_ART","useArtStore","arts","useBoardsStore","animateCardMove","card","moveFn","endFn","animations","animateLinkMove","animate","useLicenseStore","expire","useUserStore","identifyUser","authUser","user","amplitude.setUserId","plan","role","teams","teamIds","team","identifyEvent","amplitude.Identify","amplitude.identify","identifyUserSettings","settings","useClientSettingsStore","isTrackedSettingsKey","setUserProperty","property","trackedSettings","trackUserSettingsChanged","newSettings","oldSettings","setLanguage","lang","setI18nLanguage","loadedLanguages","messages","__variableDynamicImportRuntimeHelper","axios","roles","technicalUser","asRole","emptyUserOrgEntities","baseUser","backendUser","isBackendUserId","almUser","almInfo","isAlmUser","almOnlyUser","isUnknownUser","internalActions","switched","oldBoard","cards","cleanupBoard","clearStickySelection","newBoard","removeBoardSubscriptions","stickyId","maxTimeDiffBetweenTicks","maxDelayForSyncRequest","maxSyncRetries","timeDiff","lastTime","shouldSync","startServerTicks","syncServerTime","updateTime","nextTick","loggedIn","retry","before","info","getServerInfo","estimatedArrivalAtServer","dynamicStatus","status","statusClass","createAlmItemStatus","namedStatus","fallbackStatus","almItemType","toDo","createStatus","inProgress","done","initialDefaultStatus","defaultStatuses","order","baseStatus","next","emptyAlmItemType","useAlmItemTypeStore","almSourceId","boardKey","almItemTypes","mappingAlmItemType","boardType","defaultStatus","almItemStatus","existing","useCompanySettingsStore","RingBuffer","useConnectionStore","total","useLoadingStore","setSessionCount","useServerSettingsStore","Counter","counter","detail","useStatisticsStore","newEntry","subscriptions","oldEntry","useGlobalErrorStore","error","shortMessage","correlationId","_e","_j","_i","_h","_g","_f","_k","ApplicationError","CancelError","cause","UnauthenticatedError","UNAUTHENTICATED_MARKER","handleError","handleAxiosError","isAxiosError","request","joinUrl","response","base","AxiosError","Scheduler","task","DataError","mapAlmItemTypes","teamType","mapAlmItemType","transitions","transitionFilter","mapStatus","mapTargetStatus","statuses","transition","mapFields","fields","field","fromStatus","CardFlag","icon","colorIndex","flag","cardFlag","reactions","reactionLabels","getReactionLabel","colorPalette","black","white","toCssColor","hex","fromCssColor","normalizedHex","g","colorFromNumber","hue","shade","isDarkColor","brightness","isWhiteColor","contrastCssColor","shadeColor","amount","utcDateToLocalMidnight","timestamp","date","isBefore","d1","d2","isAfter","plusDays","days","lastWeekDay","startOfWeek","startOfDay","endOfDay","weekDaysBetween","weekdays","atDayStart","isWeekday","dayFraction","minuteDiff","dayDiff","isNow","tolerance","mapSessions","sessions","iterations","session","index","mapIterations","mapLinkTypes","types","mapLinks","links","link","mapScale","scale","mapBoardIterations","bis","bi","old","mapStickyType","prioritiesByValue","checkColor","stepEstimates","stepEstimate","mapAlmStickyTypes","almStickyTypes","almType","iters","mapObjective","mappedObjective","mapPartialObjective","mapFlexTypes","mapSearchResults","results","mapEvents","events","mapReactions","reactionUsers","loadReactiveUser","mapCategories","categories","cat","mapArts","mapTeams","mapUserTeams","mapUser","mapUserName","mapSettings","mapCompanySettings","mapFlexBackgrounds","backgrounds","info_link","mapUserId","almId","mapIdsToStringsInArray","items","mapOrgEntities","entities","mapValues","mapBoard","flexTypes","almSourceProvider","mapFlexBoard","mapNonFlexBoard","baseBoardData","alm","useTeamStore","stickyProperties","otherStickyChanges","stickyActivityKeys","serverStickyActivityKeys","mapStickyChanges","changes","change","mapChangeFields","mapBaseChange","mapUpdateFields","mapMirrorFields","mapUnmirrorFields","mapLinkFields","mapUnlinkFields","fieldChange","mapReactionsChange","mapTeamChange","mapUserChange","isDependency","isWorkitem","isNote","isRisk","calcLinkState","from","to","backlogToTeamLinkStates","dependencyLinkStates","backlog","workitemFrom","iterationOrder","solutionBacklog","dependency","nonDependency","isArtLevel","dependencyGroup","groupOf","nonDependencyGroup","situation","artLevel","iterDiff","fadeOutCard","fadeOut","linkFadeOutCard","linkHighlightCard","near","highlightCard","hideCard","setSearchCardMark","match","dependencyTeamFilter","resetCardMark","meta","fadeOutAllCardMarks","resetAllCardMarks","useObjectiveStore","indirectIds","sorted","useCardStore","childIds","linkedToCard","useLinkStore","getLinkTargetId","linkedCard","shouldShowSecondaryLink","secondaryCard","isCardFromTeam","sortBy","isCommitted","description","objectiveIndex","o","stretchObjectiveIndex","objectives","objectiveById","lnkId","linkTargetId","groups","cardLinks","getCardByLinkId","useSessionStore","objectiveLinks","boardObjective","counts","linked","map","groupId","boardCard","remove","linkIndex","linkInfo","cardObjective","fromCards","toCards","boardCardByLink","queue","addToQueue","distance","isLinkedCard","linkBetween","other","cardProperties","cardMeta","prios","use","priority","round","diff","backlogAlmSources","emptyReactions","statusName","hasSameStatus","existsOnTheBoard","iterId","newType","oldType","hasLoad","mirrorOriginId","cardColor","usePointerStore","pointerEvent","currentBoardId","pointer","boolean","now","p","relativePos","windowPos","lastPos","dist","steps","stepLen","useTimerStore","timer","useUsersOnBoardStore","observers","wrapMutationObserver","WrappedMutationObserver","disconnectObservers","wrapped","reconnectObservers","param","force","obs","nextTicks","ticks","injectStrict","fallback","resolved","inject","serverStickyPos","changeSticky","cardStore","exist","isTeamIdDifferent","validateObjectives","addSticky","numericTeamId","stringTeamId","sessionSubscriptions","backendSess","sendAddLink","iterState","setIterationStatus","setTimers","handleUpdate","getBoardFromEvent","kwargs","createBoardSubscriptions","boardSubscriptions","teamBoardSubscriptions","objectivesBoardSubscriptions","handleUserJoined","handleUserLeft","loadUser","boardVisitTimestamp","objectivesSubscriptions","loadStickies","loadStart","time","since","stickiesOrUpdates","stickies","parseStickies","updated","updateStickies","deleteStickies","isCacheHitServerStickiesUpdate","serverStickies","isCacheMissServerStickiesUpdate","stickyIds","sticky","removes","updates","ids","operations","serverSticky","processOperations","batchSize","operation","updateIds","deleteIds","updateLinks","loadStickiesForHalfCompleteLinks","linkIds","deleteLinks","createLinks","ls","notLoadedStickies","hasFrom","hasTo","timers","loadTimerUsers","getExistingSession","boardLoadScheduler","reload","setSessionId","subscribeSession","loadBoard","loadOtherBoards","useHttp","getStatusWithData","sizeMB","setAndStoreSession","initSession","loadCompanySettings","useFlexStore","loadSessions","license","valid","closeSession","connectionOpen","useNavigationStore","doSetSessionId","isAlm","getAlmInfo","mapped","loadSession","loadSessionAlmStatus","isSessionAlmSynced","recursive","doLoadBoard","subscribeBoard","loadBoardObjectives","loadBoardIterations","useForce","boards","load","random","getAlmConnectionId","loadSessionData","stickyTypes","linkTypes","allBoards","func","teamBoards","loadLinkTypes","loadLinks","serverLinks","loadAlmStickyTypes","loadCategories","cats","loadStickyTypes","getFlexTypes","loadBoards","serverBoards","serverBoard","loadAllBoardIterations","loadAllBoardObjectives","boardIterations","rankedObjectives","getStickyTypes","serverStickyTypes","mappedServerStickyTypes","almItemTypesCache","mappedStickyTypesChunk","serverStickyType","loaded","getAlmItemTypes","sessionId","cache","boardKeys","getBoardKeys","safeAlmType","cacheKey","loadAlmItemTypeOfCard","loadFlexBoards","searchStickies","query","createTimer","updateTimer","deleteEvent","getBoardIdsOfGroupedStickies","getStickyChanges","duplicateFlex","getBoardDiff","filters","changeTypes","getBoardEventLog","ret","hasMappedAlmUser","getArts","getTeams","SimpleCache","fetch","cached","BackendError","NoSuccessError","endpoint","useClientStore","uuid","defaultRetries","refreshing","createApiClient","url","client","transformRequest","enhanceRequestInterceptor","networkErrorInterceptor","authenticationInterceptor","modernInterceptor","requestData","responseData","fail","isNetworkError","ok","canLoadImage","rawClient","isPlainObject","redirectToLogin","refreshToken","loadImage","reject","img","Environment.authAPIUrl","headers","transform","defaultTransformers","transformers","login","loginPage","logout","reason","isAuthenticated","baseURL","api","users","reactive","uninitedUser","getUser","clearUserCache","handleUserError","getOrgEntities","noUser","permission","permissions","NO_TEAM","userTeamsFirst","userTeams","t1","t2","t1InUserTeams","t2InUserTeams","setRouter","routerImpl","getRouter","PARAM","ANY_TEAM","queryProps","toQueryImpl","goToLogin","goTo","goToLogout","goToBoard","mergeParams","boardParams","spec","handleRouterFail","replaceQuery","newQuery","throttledReplaceQuery","throttle","pushZoomState","boardUrl","queryImpl","fullUrl","search","isNavigationFailure","teamInArt","EMPTY_ITERATION","EMPTY_SESSION","EMPTY_BOARD_ITERATION","EMPTY_BOARD","ss","sessionName","indexed","archived","daysInIteration","daysPassedInIteration","DAY_IN_MS","currentSession","sessionIds","store","watch","lastSelectedSessionId","lastSelectedBoard","sessionState","lastSelectedArtId","lastSelectedTeamInArtId","lastSelectedTeamId","lastSelectedFlexId","flexTypeId","sessionSelected","boardSelected","artSelected","teamSelected","flexSelected","flex","background","flexBoards","objectivesBoard","frontendBoard","objectivesBoardId","flexBoard","emptyFlexBoard","boardByType","boardByTypeOptional","isTypeMatch","isTeamMatch","boardBelongsToTeam","isArtMatch","boardBelongsToArt","isFlexMatch","boardIsCurrentFlex","cardsMirrorableToNonFlexBoard","cardTypesMirrorableToBoard","anyNonOriginCard","cardsMatchingTeam","cardMirrorableToSolutionBoard","artLevelOnly","wasLoaded","boardA","boardB","isCurrentBoard","bs","shapes","_hoisted_1","_hoisted_2","_sfc_render","_ctx","_cache","_openBlock","_createElementBlock","_hoisted_3","loadState","capacity","ratio","warn","loadColor","ChartJS","BarElement","CategoryScale","LinearScale","Tooltip","Title","chartData","maxY","maxValue","chartOptions","chartLabel","loadPercentage","calcCapacityAllocation","loads","toLoadCapacityItem","teamIterations","teamIteration","sum","fixLine","borderLines","fullBoardLocation","cardsInLocation","loc","boardMetaKey","cardKey","cardMetaKey","cardMethodsKey","useSelectionStore","historyEntry","mode","usePanModeStore","removeNodesWithAttribute","attributeName","applyTransitionStyles","styles","duration","animateElement","elCopy","dateFilterValues","defaultDate","isLogEnabled","useActivityStore","MenuListConfigKey","provide","autofocusStatus","autofocus","initAutofocus","oldValue","keyboardNavigation","navId","listenerController","currentIndex","activeElement","listItems","autoSelect","wrapDisabled","ignoreTrigger","pullFocus","pullFocusInitial","horizontal","itemSelector","binding","initListItems","initCurrent","initActiveElement","keyHandler","setCurrent","initClickListeners","initPointerListeners","setCurrentIfDifferent","active","retries","currentItem","simulatePointerEvent","shouldPullFocus","hasListFocus","newItem","adjustIndex","noWrap","wrap","vKeyboardNavLocal","MenuListItemsContainer","focusin","firstMenuListItem","focusout","elRef","useTemplateRef","listConfig","emit","__emit","isMulti","isClearable","titleId","select","newValue","modelValues","clear","isActive","isSelected","cssColor","border","cardType","multiCreate","emitSent","cardTypes","almSources","multiLineOptions","almSourceNeeded","multiLine","finishAfterType","finishAfterAlmSource","setType","emitSelect","typeSelected","setAlmSource","almSourceSelected","setMultiCreate","option","applyZoom","scrollTo","applyFluidBoardSize","rightBottom","applyBoardSize","applyFullBoardSize","boardElem","borderElem","boardStyle","borderStyle","keepBoardScrollPos","scrollPos","resetBoardScrollMargin","arrangeCards","bounds","offset","xc","yc","boardActions","minDist","minC","alignCards","direction","distributeCards","comp","lineupCards","cardDistance","regionOf","boundsOf","columns","similarColumnCount","region","moveCards","assureInsideRegion","aspectOfBounds","minBy","range","cols","aspect","calcNewPos","movedCards","newPos","nearestCard","nearest","zoomToRegion","adjustZoom","targetSize","zooms","zoomedSize","zoomedTopLeft","zoomedTargetSize","overhang","centered","findFreePosition","step","notFree","useContextMenuStore","component","eventHandlers","newMenu","markRaw","useDraggingStore","dragId","linkDragEl","link_id","useToastStore","messageKey","hideKey","noShowAgain","linkActions","cardLink","addObjective","removeObjective","recreateStickyLink","recreateObjectiveLink","stickyLink","dragInfo","currentBoard","linkFrom","linkTo","markCardLinkedCards","getLinkObjectiveData","fromCard","distances","markLinkedCard","startAddCard","assurePos","getDefaultStickyNoteType","isAlmSourceOk","addAndTrack","CardCreationMenu","addPromises","cardPosStep","trackCreateStickyNoteEvent","addCard","defaultStickyType","originBoard","toggleActions","sanitize","ev","pinned","cardCreateProps","selectItem","selectionActions","modelValue","_useModel","inputElem","textInputElem","searchRef","keydown","searchInput","actionSourceKey","INDENTATION_STEP","isExpanded","hasChildren","isDisabled","isFirstNode","treeNodeRef","toggleExpand","arrow","selectNode","handleKeydown","currentNode","focusableNodes","tabindex","treeRef","nodeRefs","setNodeRef","cmp","selectedNodeId","handleSelectNode","findSelectedNode","nodes","foundChild","expandParentNodes","nodeId","parents","parent","parentRef","initialSelectedNode","handleFocusOut","treeId","onBeforeMount","getTeamsInArt","handleSelect","createTeamNodes","createArtNode","createSolutionTrainNode","selected","isSolutionTrainSession","selectedArt","iconMap","colorMap","flagName","linkColors","flagColors","normalLinkColors","statusClassColors","collapsed","showCollapsable","toggleCollapsed","renderAs","sortLinkableItems","artWorkItems","dependencies","teamWorkItems","objectivesCommitted","objectivesUncommitted","others","isARTWorkItem","isTeamWorkItem","isOtherItem","sortAlphabetically","isUserTeam","userTeam","userTeamArtWorkItems","restArtWorkItems","userDependTeamDependencies","userPrecondTeamDependencies","restDependencies","isSticky","isObjective","useWorkModeStore","isExecutionMode","toggleLink","objectiveArtOrTeam","tooltip","linkAnnouncement","canEdit","getLinkId","fromId","_renderSlot","handleHeaderClick","showContent","EMPTY_GROUPED_LINKABLE_ITEMS","dropdownKey","isOpenInternal","triggerRef","contentRef","popper","contentId","isStateManagedExternally","computedOpenState","closed","overflow","detectOverflow","handleKeyEvent","focusOnTrigger","handleOutsideClick","handleTriggerClick","handleContentClick","createPopper","disabled","allLinkableItems","group","allLinkableCards","isObjectiveTypePresent","uniqueTypes","stickyTypeToFilterItem","model","selection","values","triggerHeader","length","newModel","oldModel","addedItems","oldItem","removedItems","getFunctionality","groupedLinkableObjectives","targetCards","searchContext","getGroupedObjectives","groupedObjectives","getGroupObjectivesByBoardGroups","extractCurrentLevel","currentLevelItems","objectiveGroups","makeObjectiveLink","isTeam","groupedLinkableStickies","linkableStickies","getStickies","isNotTargetGroup","makeLinkableCard","groupStickies","getCurrentLevelBoards","groupedStickiesByBoardGroups","groupStickiesByBoardGroups","boardGroups","teamStickies","artStickies","solutionStickies","sortStickies","groupedByTeam","groupBy","groupedByART","removeDuplicatedStickies","sameTeam","sameArt","teamName","artName","solutionLevelBoards","artLevelBoards","teamLevelBoards","groupTracker","existingSticky","getTeam","linkableItems","filteredLinkableItems","filterByType","noCurrentLevelItems","noOtherLevelsItems","resultsCount","acc","noItems","noSearchResults","watchEffect","groupedStickies","mergeGroupedLinkableItems","groupedItems","filterInObjectives","isSelectedType","filteredOtherLevels","resetSearchAndFilters","group1","group2","otherLevels","headerByLevel","subHeaderByLevel","isOrganisationTreeCollapsed","organisationNodeIcon","searchLabel","levelIconMap","handleOrganisationNodeSelect","toggleOrgTree","debounce","resetSearch","alignHorizontal","alignVertical","distributeHorizontal","distributeVertical","lineup","openLinkModal","MirrorModal","TeamModal","setTeam","paste","duplicate","saveCardPositions","resetCardPositions","cardIds","StickyLinkModal","stateToBeSaved","cardStates","cardState","newLink","oldLink","newObj","oldObj","cardActions","mirroredId","setCardPositions","toFront","resolver","addMultipleCards","prio","alterCard","points","flagType","assignee","chipEl","assigneeChipId","useKeyboardDrag","deactivate","moveMode","screenReaderMessage","boardStore","startMove","getCurrentPos","dragCoords","handleMoveKey","stopMove","moveSticky","currentPos","movedPos","originalSection","newSection","reachedEdge","msgPosition","moveButtonRef","showControls","toggleMoveMode","shapeKey","dropdownId","isDropdownOpen","triggerButton","newVal","flexBoardActions","artRiskBoardActions","artBacklogBoardActions","artPlanningBoardActions","solutionPlanningBoardActions","solutionBacklogBoardActions","teamBaseActions","teamBoardDefaultActions","teamRiskActions","teamDependActions","teamProgramActions","cardWasCreatedOnDifferentTeamBoard","cardWasCreatedOnDifferentBoard","getActionsByBoardType","teamBoardActions","isStickyMovable","isOnOriginBoard","moveBetweenTeams","isStickyMirrorable","isActionVisible","dropdown","cardMethods","canDelete","isRemove","disabledMessage","confirm","confirmed","isVisible","icons","IconJira","IconAdo","IconAc","searchValue","Fuse","handleArtChange","root","long","sources","handleProjectChange","showingArts","searchVal","artListItemRefs","otherArtsButton","teamsInCurrentArt","currentTeam","teamsList","filterBySearch","artsList","showArtNav","searchPlaceholder","selectTeam","selectArt","showArts","list","input","handleChangeDependentOn","handleDuplicate","visible","handleLinkModalOpen","boardsStickyMirroredTo","boardName","mirrorToBoard","targetBoard","isAlreadyMirrored","isMirrorable","isRiskCard","handleCardMove","handleRiskCardMove","cardTeamId","boardTeamId","isMovable","toggle","stickyLinkToClipboard","almLinkToClipboard","almIdToClipboard","handleStatusChange","statusId","isStickyStatusVisible","onChange","targetType","rootRef","inputValue","focused","emitValOnBlur","allowedChars","numbers","keyPressed","unfocus","pointValues","selectPoints","setInput","toElipsis","serverSettingsStore","selectedTeam","handleTeamSelect","selectPriority","wsjf","trapOptions","isFullyFaded","isFaded","minFaded","isFiteredOut","classes","isProgressBarVisible","useTooltip","tippyRef","newTooltip","newEl","opts","getTippyOpts","useTippy","useModalStore","isTooltipWithinModal","baseModalElement","dropdownRef","triggerAriaLabel","isCardActive","theme","closeDropdown","zoomingWatcher","boardChangeWatcher","handleOpen","handleClose","dragWatcher","stickyWasDragged","handleDropdownPointerDown","handleDropdownClick","refetchMirroredBoards","boardIds","newKeys","oldKeys","symmetricDifference","keysA","keysB","mirrorCount","titleRef","sortedLinks","handleAdd","focusTitle","handleAddLinks","precondTeamRef","dependTeamRef","dependContent","dependTeam","useUser","userName","isImageUrlValid","imageUrl","letter","backgroundColor","colors","svgIconName","reactionsContainer","handleFocusin","siblings","sibling","handleFocusout","handleToggleReaction","IconHot","IconIncrement","IconLove","focusoutReactions","hotReaction","animateCopy","animationClass","started","copy","stickyHasAllReactions","arr","UsersListTooltip","setRef","newReactions","oldReactions","oldUsers","iconRef","onStarted","usersNumberForReaction","almMappingCache","almMapping","addAlmMapping","addReactiveAlmMapping","mapping","emptyListApi","searchUsers","teamUsers","usersInTeam","getUsersInTeam","getUserTeams","unmappedMessage","makeUser","rawUsers","currentAndTeamUsers","filteredTeamUsers","searchNonTeamUsers","currentUserFirst","notSelected","u","tu","isForeign","foreign","canAssign","setAssignee","setRisk","cardRisk","isRiskBoardType","tooltipKey","isAssigneeVisible","isTeamNameVisible","isTeamSelectChipVisible","isArtSelectChipVisible","isLinksChipVisible","isMirrorChipVisible","isWSJFChipVisible","isStatusChipVisible","isStoryPointsChipVisible","coloredCardFlags","iconIndex","visibleCardFlags","row","noneCardFlag","selectedFlags","noneFlagIsCurrent","handleKeyDown","selectCurrentByKey","iconDiff","colorDiff","doDiff","deselect","iconName","colorName","cardIsActive","iconAlt","handleFlagChange","dependencyLinks","dependencyLinkItems","statusClassItems","useSearchMenuStore","_state","currentUser","emptyMatch","states","matchesLinkState","linkState","showForSelectedCard","flagString","QuadraticSpline","via","tAtVal","aspectRatio","tMiddleX","tMiddleY","slope","x0","x1","y0","y1","dx","dy","middle","findDeleteIconPos","fromScale","unscaledSize","scaledSize","adjustment","adjustedFrom","fromRect","toRect","adjustedPos","isDragging","deleteIconPos","removeLink","userColor","cardStatusDistribution","criteria","initData","addValue","removeEmptyStatusClasses","dependencyCardStatusDistribution","shouldAffectStatusDistribution","iterationStatusDistribution","teamStatusDistribution","objectiveStatusDistribution","tree","curr","newData","excludedBoards","timeFormatters","getTimeFormatterForZone","zone","z","isValidTimeZone","formatLongDate","formatShortDate","formatTimestamp","formatTimestampFriendly","formatTime","timeZone","relativeDateName","relativeDate","relativeTime","totalWidth","createBarChartData","enrichFn","isEmpty","sourceKeys","emptyMessage","today","iterationNow","iterationState","passed","onShow","onHide","currentStatusDistribution","textDivRef","emojis","replaceEmoji","emoji","em","textareaRef","initialTextLength","maxTextLength","isAlmSynced","handleTextInput","replaceEmojis","replaced","cursor","thePaintLayer","registerPaintLayer","paintLayer","breakLines","measure","chars","lines","lineStart","setLine","asStringPositions","stringLines","j","shortText","TextMeasurer","paintFunctions","debug","wordDownsize","fontSize","minWordFontSize","minFontSize","wordFontSize","word","loadCache","calcPromise","calc","fontSizeCache","edit","font","calcFontData","getInfo","sub","fontData","saveCache","entries","it","LRUMap","clearCache","resolveAppUrl","rawBoard","rawName","splitQuery","replaceLinks","all","protocol","urlParts","parseUrl","urlPartsToLink","addLink","hashParts","parseHash","toHtmlWithLinks","linkStart","lineEnd","startPos","endPos","skipped","linkEnd","linkText","append","consume","normalizeUrlParam","parts","second","secondOnly","maxSteps","optimalFontSize","inputText","measurer","maxFontSize","maxFontSizeForText","wordSize","minMeasure","textareaButNotEdit","DEFAULT_FONT_SIZE","calculateOptimalFontSize","TEXT_INPUT_WRAPPER_CLASS","focusAndStartEditing","isReadonly","isEditing","toRefs","textDisplayRef","containerRef","textAsButton","renderedEl","handleBlur","scrollNearBoarder","scrollX","check","scrollY","dragScrolling","onDragScrollEnd","executeAfterDragScroll","dragScroll","enable","immediate","onPointerDown","onPointerEnter","onPointerMove","disable","setPos","onPointerUp","endDragScroll","isPinching","zoomEnd","processZoom","newFactor","emitZoom","pinchZoom","handlePinchPointerDown","otherPointer","getPointer","handlePinchPointerMove","pa","pb","handlePinchPointerUp","mouse","mouseState","downs","pointerDown","draggable","initPointerHandler","down","up","handleDragPointerMove","handleDragPointerUp","drags","registerDrag","imageStyle","scrollable","findScrollable","scrollInScrollable","setPosition","imageDist","release","stopPos","recur","scrollBy","registerCardDrag","onEnd","fromPalette","availableSelectedCards","selectedCardInfo","cardOnBoard","wc","doWithSelected","dragCard","endDragCard","cardOffset","cardCoordinate","coordinate","useDrag","handlePointerDown","isLinkDrag","onDragEnd","registerGlobalShortcut","isFunction","doRegisterShortcut","exec","shortcuts","doUnregisterShortcuts","shortcut","keyDown","keyUp","allKeysUp","isKeyDown","codeOrKey","isAllowedInput","wasDown","cut","code","useTransition","cssClass","hooks","handleTransitionEnd","handleTransitionStart","transitionOn","useDelayedAction","timeoutId","useEnlarge","dragStore","isDragged","isEnlarging","isEnlarged","zoomWatcher","enlargedWatcher","handleStickyNotePointerEnter","handleEnlargeAction","handleShrinkAction","registerDblClickEventListener","handleStickyNoteDblClick","removeDblClickEventListeners","cancel","enlarge","shrink","shrinkOnBoardClick","unregisterKeyUpAndPointerLeaveEvents","handleStickyNotePointerLeave","_event","useLinkDrag","handlePointerEnter","linkStore","isLinkingTarget","isLinkingSource","enlargeAfterLinking","handlePointerLeave","handleDocumentPointerUp","onLinkDragEnd","usePin","isPinned","handlePointerUp","cancelPin","cancelUnpin","delayedUnpin","delayedPin","trackStateChange","linkClickPrevent","pin","unpin","byPosition","yDiff","xDiff","skipButtonId","location","setAriaOwns","focusFirstCard","firstCardId","addSkipToCardsButton","existingButton","div","buttonProps","createApp","CardsSkipButton","ownedCards","focusedLocation","useSelect","textInput","wasDragged","wasDraggedFromPalette","panModeClickCount","wasActivatedByKeyboard","managedTabOrder","nextTabTarget","previousTabTarget","wasLongPressed","setWasLongPressed","cancelSetWasLongPressed","handleStickyNoteClick","handleFocusIn","fromKeyboard","isSingleClickSelect","clickedInput","isMultiSelect","isOneOfSelected","deactivateSticky","lastCard","isMultiSelecting","updateTabNavTargets","sortedCards","currentCardIndex","nextTargetId","prevTargetId","useActionMenu","referenceEl","isOpen","popperEl","newPopper","destroyPopper","popperOptions","updateRef","updateMenu","isInMenu","useStickyActionMenu","variables","calculateOffset","multiplier","useStyles","boardMeta","sizes","normalSize","enlargedSize","zIndex","position","contrastingTextColor","levelOfDetails","noDrag","stickyNoteRef","textInputRef","accessibilityControlsRef","isPanModeActive","isLocked","prevVal","enlargeTransitionClasses","isPinningDisabled","isDraggingDisabled","isActionMenuDisabled","actionMenu","animation","animations.mirror","animations.remove","animations.move","handleMoveHotkey","handleAccessibleDeactivate","stickyNoteGap","loadCapacityState","boardCardSize","boardData","canScaleUp","canScaleDown","tabStateKey","tabState","tabs","selectTab","showTabs","isAction","isName","label","characters","valueString","composedAriaLabel","objectiveActions","title","av","bv","ShortcutUser","Vue","BaseTextarea","computedStyle","borderTopWidth","borderBottomWidth","__decorateClass","Prop","Ref","Watch","Component","$props","$setup","$data","$options","_withDirectives","textValue","$event","_withModifiers","MaxLengthTextarea","_resolveComponent","_createVNode","_component_BaseTextarea","_mergeProps","handleFocus","isFocused","isLengthExceeded","$t","_normalizeClass","_toDisplayString","_createCommentVNode","isAddButtonEnabled","saveObjective","getIteration","linkedCards","rowLabel","ExpandableTextarea","targetEl","totalLength","hasNewLines","_Transition","_withCtx","componentId","showButtons","_hoisted_4","onFocus","_createElementVNode","onEnter","fullHeight","onLeave","linkedStickiesToggleRef","objectiveCardRef","highlightedStickyId","isLinkedStickiesExpanded","showActualValueSelector","showBusinessValueSelector","setIsFocused","linkedCardTree","readonly","actualValue","checkIfShouldBeExpanded","toggleExpandLinkedStickies","isStickyHighlighted","setHighlightedSticky","setTitle","setDescription","setActualValue","setBusinessValue","getStatusDistribution","markAsUncommitted","markAsCommitted","moveUp","moveDown","ObjectivesList","mixins","hasDraggedBetweenUncommittedObjectives","wasStretch","hasDraggedToHeader","_originalEvent","objectiveCard","SvgIcon","ObjectiveCard","AddObjectiveButton","AddObjectiveCard","MenuItemDelimiter","BaseButton","_hoisted_5","_hoisted_6","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_hoisted_12","_hoisted_13","_hoisted_14","_hoisted_16","_hoisted_17","committedIsExpanded","_hoisted_7","_component_BaseButton","_createTextVNode","_Fragment","_component_MenuItemDelimiter","_component_AddObjectiveButton","addCommittedObjectiveIsActive","_createBlock","_component_AddObjectiveCard","focusOnObjective","_component_draggable","onMove","onEndDragging","_component_ObjectiveCard","showNoObjectives","uncommittedIsExpanded","_hoisted_15","addUncommittedObjectiveIsActive","stretchObjectives","showNoStretchObjectives","ArcElement","Legend","ChartDataLabels","chartRef","tooltipItem","iterSize","teamSize","hoverSelected","pieWidth","pieHeight","itemIndex","iterData","iterationIndex","isLoading","shownStickyTypes","hover","selectName","iterationWidth","parseLoad","MetricsModalCapacityAllocationBody","MetricsModalLoadCapacityBody","tabContentRefs","setTabRef","syncTabHeights","maxHeight","loading","boardIndex","teamWidth","OverallMetricsModalCapacityAllocationBody","OverallMetricsModalLoadCapacityBody","repeatTimeout","startChange","endChange","handleEnterKey","handleInputChange","validateInput","stop","alignment","selectedOption","textAlignmentOptions","opt","isBoard","togglePosition","useBoardMenuStore","drawLines","useDrawStore","useSwitchSessionStore","toggleTimer","toggleBoardDiff","toggleSearch","showTeamObjectives","OverviewModal","OverallMetricsModal","MetricsModal","SettingsModal","ShortcutsModal","TeamObjectivesModal","formatDate","sessionExecution","sessionStartDate","sessionEndDate","sessionPlanning","planningEndDate","rangeText","isRangeActive","currentSessionId","staticModals","SessionSelectionModal","firstQueryParam","firstQueryValue","serializeObject","prefix","serialize","deserializeObject","deserialize","removePropsWithPrefix","QUERY_PREFIX","isModalOpen","wasModalJustOpened","useRoute","updateQuery","changeAttrs","componentName","queryModal","findModal","doFindModal","findDynamicModal","dynamicModals","modals","collapsedLists","resetListView","scrollContainerEl","objectiveLists","lists","sortedObjectives","checkSelectedObjective","selectFirstObjective","firstObjective","selectObjective","toggleList","isListDisabled","selectedObjective","objectiveType","selectedRiskTypeLabel","hasFlag","riskLists","filterRisks","riskType","sortedRisks","checkSelectedRisk","selectFirstRisk","firstRisk","selectRisk","selectedRisk","risks","teamBoard","currentTeamIndex","previousTeam","nextTeam","selectPreviousTeam","selectNextTeam","setActiveTab","tabId","useCategoryStore","payload","categoryActions","flexActions","components","comps","SearchInputLegacy","BaseInput","_component_BaseInput","_withKeys","$emit","cockpitSessionUrl","boardTypeSetupPath","cockpitProfileUrl","cockpitConnectionUrl","almConnectionId","almPath","cockpitBillingUrl","get","contains","normalize","matches","join","fromString","ns","equals","nextIndex","startIndex","SearchBase","mapResult","foundItemId","newFound","searchItemsContainer","baseSearchItems","foundDict","itemId","matchingElement","mark","_item","_mark","_focus","SelectList","_value","LabeledInput","InputField","allowed","hasSelection","noMoreInput","hasDot","readOnly","deleting","duplicating","canDuplicate","deleteCanvas","duplicateCanvas","main","del","editing","focusableElements","focusedElement","optionId","showMoveUp","showMoveDown","editMode","setName","keyDownListener","moveInternalFocus","initDrag","handlers","Draggable","dragHandler","createDragHandler","allCategory","FlexModal","urlCat","addBoard","q","catElem","shownBoards","focusBoard","focusTargetId","loadIfNeeded","fromCat","toCat","DeleteCategory","DuplicateFlexBoard","AddFlexBoard","FlexBoardElem","FlexCategoryElem","FlexBackground","ScreenReaderMessage","BaseModal","_hoisted_18","_hoisted_19","_hoisted_21","_hoisted_22","_resolveDirective","_component_BaseModal","selectNext","canGoToCockpit","addDuplicate","categoryDrag","_renderList","_component_FlexCategoryElem","currentCategory","delCategory","moveCategory","dragOverCategory","handleCategoryFocusout","_directive_draggable","addCat","_component_I18nT","setupUrl","_component_ScreenReaderMessage","editBoardId","boardDrag","_component_FlexBoardElem","_hoisted_20","_component_FlexBackground","categoryToDelete","_component_DeleteCategory","_component_AddFlexBoard","showDuplicates","_component_DuplicateFlexBoard","checkPut","_sortable","_activeSortable","dragEl","targetStatusId","isEmphasized","ts","handleStartDragging","column","useDragScrolling","container","scrollInterval","currentIntervalTime","currentScrollDirection","horizontalScrollUsed","threshold","scrollStep","minIntervalTime","maxIntervalTime","handleDragOver","containerElement","scrollDirection","newIntervalTime","throttledHandleDragOver","cancelScrolling","useStickyDrag","targetStatuses","dragOverColumnId","oldIndex","fromStatusId","toStatusId","targetStatus","columnsContainer","onStartDragging","handleEndDragging","internalItems","handleFilterChange","withUnassigned","unassigned","searchQuery","newSearchQuery","hasActiveFilters","handleClearFilters","$slots","useFilterTracking","filterTypes","trackedFilters","_oldFilters","filterKey","filterType","useKanbanColumns","allStickies","filteredStickies","selectedTypeIds","statusMap","almItemTypeStore","sortedEntries","columnData","useKanbanFilters","emptyFilters","filterFuncs","filtersRef","filterKeysCount","filterFn","resetFilters","updateFilters","newFilters","oldFilters","typeIds","filterByText","lowerCaseText","hasText","filterByUserId","userIds","assigneeId","filterByTeamId","isUnassigned","filterByArtId","artIds","textColor","useStickies","useTeams","currentArtId","onFilterChange","onFilterClear","render","UnknownAvatar","handleAssigneeChanged","maxUsers","handleChange","checkIsSelected","firstUsers","restUsers","isAnyRestUserSelected","currentTeamId","cardData","useStickyAssignees","foundIndex","dropdownArts","trackedGoToBoard","openModal","ArtKanbanModal","SolutionKanbanModal","IterationKanbanModal","PlanReadoutModal","doCancel","arrange","TimeoutError","sync","setState","stickyNotes","svgElementsOnBoard","removeBoxShadows","resetBoxShadows","setExplicitCurrentColor","svg","setAll","attribute","set","resetExplicitCurrentColor","resetAll","reset","setExplicitSize","setAllAttributes","resetExplicitSize","oldValues","setAttribute","screenShot","screenShotWithAdjustedDom","doScreenShot","html2canvas","screenShotScale","canvas","cutOutBoard","blob","saveAs","screenShotName","effectiveBoardWidth","safeFilename","ConfirmArrangeModal","ConfirmSyncBacklogModal","ConfirmSyncIterationModal","unselectSticky","selectSticky","setCardSize","BaseBoard","_pos","_top","BaseBacklogBoard","setReturnFocus","backlogColumn","groupColumn","iterationRow","i18nMap","PlanningBoardLocation","coordOrLeft","rawLeft","rows","col","BasePlanningBoard","teamGroup","roam","RiskBoardLocation","regionIndex","artIterations","artGroup","OBJECTIVES_INDEX","RISKS_INDEX","EMPTY_INDEX","TeamBoardLocation","boardOf","BacklogBoard","ProgramBoard","SolutionBacklogBoard","SolutionBoard","RiskBoard","TeamBoard","FlexBoard","ProgramObjectivesBoard","heartbeatWorker","_onHeartbeatTick","startUserHeartbeat","stopUserHeartbeat","BoardNotFoundError","activeCardId","initTracking","apiKey","amplitude.init","dataWithDefaults","addDefaultProperties","formattedData","formatEventData","isValidEventData","shouldTrack","amplitude.track","kebabCaseRegex","testValue","isNumber","isBoolean","isFont","isAlignment","loadSettings","saveSettings","kanbanFilters","isObject","isInteger","defaultVal","canvasRef","draw","properties","eff","last","lastN","lastC","xf","show","statistics","EVENT_TIMEOUT","WIN_MOUSE_DELTA","BIG_WHEEL_DELTA","WIN_MOUSE_DIVISOR","lastFactor","normalizeWheelEvent","calcFactor","wheelDelta","integerDelta","maxDelta","scrollSensibility","zoomSensibility","debounceDelay","moveTimeout","initWheelHandler","handleWheelEvent","isNoWheel","showDetails","trackStatusLinkClicked","errorDetails","errorDetailsURI","followupActions","progress","showProgress","stickyFontCss","trackClose","replace","css","regions","makeBoardRegionsUnfocusable","makeBoardRegionsFocusable","boardRegion","focusTrap","trapStack","trapMap","trapElements","disableOnOutsideClick","createFocusTrap","evaluateFallbackFocus","extraIds","fallbackFocus","scrollableOnBoard","handleScroll","isScrollable","handleArrowKeys","isArrowKey","isOnInput","maxParentElement","isScrollingDown","isAtBottom","isAtTop","apiClient","AuthService","reverseRpcTopicMapping","translateRPCPath","descriptor","originalMethod","restArgs","newPath","createCallContext","createCallHeaders","hasResponseFormat","isSuccessResponse","isErrorResponse","handleResponse","methodName","HttpRpcBackend","fullPath","_path","_args","_timeout","createDummySubscription","denormalizedServerAlmItemTypeMap","normalizedServerAlmItemTypeMap","alm_item_types_by_board_key","denormalizeNormalizedServerAlmItemTypeEntry","source_id","alm_item_type_response","transition_hash","board_key","alm_item_types_by_source","isNormalizedServerAlmItemTypeMap","BaseBackendSession","rpcBackend","promises","subscription","NatsError","ErrorCode","stickyAlmId","EventInfo","topic","_app","_module","_version","NatsBackendSession","connection","JSONCodec","msg","body","details","callHeaders","module","subscribe","NatsRPCPayload","RPCData","NatsRpcBackend","reconnects","startTime","rawResponse","nuid","elapsedTime","faro","formatState","entry","SwitchingRpcBackend","backends","choose","backend","useBackend","connectRetries","httpCallPaths","initNatsSession","openConnection","currentPath","onClose","connectionName","doConnect","Environment.natsUrl","addConnectionStateHandlers","addCloseConnectionHandlers","connect","shouldRefreshToken","shouldReload","shouldLogout","closeConnection","DebugEvents","Events","isReload","navigation","clientId","refreshServerErrors","reloadServerErrors","unexpectedServerMessage","useMessengerStore","anyMessages","anyNotifications","LAST_ACTIVITY_KEY","LOGOUT_CHANNEL_NAME","USER_EVENTS","setupInactivityLogout","timeoutMinutes","onTimeout","channel","throttledEventHandler","resetTimer","cleanup","handleStorageChange","handleTimeout","checkIfTimedOut","lastActivity","timeSinceLastActivity","timeoutDuration","handleBroadcastMessage","setLastLoginAt","initUserTracking","initIntercom","initFaro","initInactivityTimeout","sampleRate","initializeFaro","getWebInstrumentations","ifDefaultLauncherShown","intercomRoles","isSmallScreen","companyParam","isBoardChange","replaceParams","replaceRoute","pq","assertLoggedIn","loginAndRedirect","loginWithUser","setDocTitle","place","routeName","selectedSession","uniqueActiveSession","userOrgEntities","uniqueAssignedSession","sessionsArtsTeams","artAssigned","teamAssigned","initialTeamAndBoard","appParams","handleUser","handleAdmin","firstArtId","firstArt","entity","scrollTimeout","handleNonSessionParams","handleNameParam","handleTeamAndBoardParams","handleQuery","routeChange","toName","currentFlexBoardName","toTeam","toQuery","findTeam","findBoard","newSession","boardReload","applyZoomIfNeeded","scrollWindowIfNeeded","newZoom","paramChanged","queryChanged","setSessionData","clearSessionData","handleSessionParam","toSession","lastUsedSession","sessionByNameOrId","lastSessionId","lastSession","logError","drawActions","useDragScroll","dragScroller","setAlign","align","setText","MARGIN","PADDING","useTextElement","textElem","refs","cutText","textLen","allSpaces","maxLen","calcFirstEnd","firstEnd","secondStart","textAttrs","toRef","useDrawActionMenu","selectedEl","pointerPos","usePointerPosition","useSvgShapes","rectAround","rectAlong","rectAroundPoint","rectAlongLine","anchor","editableLine","selectedShape","pointerEvents","shapeDown","isDragOverMenu","moveShape","canStartShape","startShape","fixPoint","snap","snapPoint","contextMenu","DrawContextMenu","useShortcuts","registerShortcut","undoText","lastEntry","canMirror","useMultiSelectRect","quadTree","isSelecting","zooming","addPadding","padding","startDrawingRectangle","quadtree","updateRectangle","throttledSelectStickiesInRectWithQuadTree","finishDrawingRectangle","selectStickiesInRectWithLoop","addEventListeners","selectStickiesInRectWithQuadTree","selectedCardIds","coverRect","getSelectionBounds","isCardSelectable","halfCardSize","useSelectionActionMenu","menu","useStickyBoundingRect","selectionAndDrag","dragPos","selectionPos","scaledStart","baseRect","extraMargin","boundingRectElem","boundingRect","multiSelectRect","isNotSelecting","selectionMenu","rectStrokeWidth","zIndexRectangleSelection","parentFocus","closeSelf","closeParent","triggerLeft","vKeyboardNavSub","selectedCount","editable","positional","general","anyGeneral","storeToRefs","buttonEl","showMenu","BoardContextMenu","onKebabClose","openedByKeyboard","longClickTimeout","onLongClick","scrollBefore","noMove","noScroll","noClick","cancelLongClick","EventBusUser","BoardBase","boardEvent","Options","FluidBoard","iterStart","lastLoginAt","workingMode","spaceActivatedPanMode","startX","startY","dragged","currentSize","newBoardSize","Provide","fluidBoard","gapMultiplier","cardProps","cardMiddle","previousCardRowsHeight","numberOfCards","ac","bc","bw","bw2","a1","a2","b1","BaseTooltip","LoadingIndicator","KebabMenu","StickyNote","BacklogAddNewButton","_component_LoadingIndicator","_component_BaseTooltip","openKanbanBoard","_component_KebabMenu","_component_StickyNote","_component_BacklogAddNewButton","visibleCards","_component_BaseBacklogBoard","showLink","markMode","showIcon","isHidden","isStateShown","LinkLayer","spline","transparency","tMax","angle","cmd","_normalizeStyle","mask","clip","clipIndex","LinkLayers","linkColor","thisElement","focusableElementSelector","focusFirstElement","handleContentFocusin","teamColor","selector","minSize","maxSize","idealWidth","els","minQ","PlanningBoardKanbanModal","StatusDistribution","BasePlanningBoardSection","fieldHeight","overview","fieldWidth","iterIndex","showStatusDistribution","_component_StatusDistribution","getIterationStatusDistribution","groupKey","groupIndex","fieldClass","getGroupStatusDistribution","_component_BasePlanningBoard","committedCount","uncommittedCount","newIndex","IconButton","DropdownMenu","ListItem","programBoard","_component_DropdownMenu","_component_ListItem","_component_IconButton","isPrevDisabled","isNextDisabled","selectedTeamBoard","_component_ObjectivesList","RiskBoardLogic","scaleAttr","scrollbarAdjusted","adjustScrollbarWidth","isInBoard","fontSizeBasedZoom","setElementScale","percent","linkedStickies","linkCount","showLinkModal","ObjectiveLinkModal","setLinkingTarget","isAlreadyLinked","resetLinkingTarget","selectedObjectiveId","masterCards","highlightedObjectives","onScroll","editObjectives","toggleObjective","blurObjective","distribution","isCurrentIteration","isKanbanButtonVisible","changeVelocity","dates","processNextBatch","TeamBoardLogic","TeamObjectives","TeamIteration","_component_TeamIteration","_directive_board_region","_directive_owned_cards","sidePanelKey","MIN_WIDTH","DEFAULT_WIDTH","MAX_WIDTH","setWidth","initialWidth","resizing","startResize","resize","endResize","linkedSticky","almIcon","hot","increment","love","image","countDiff","stickyChanges","TextChange","TypeChange","PointsChange","PriorityChange","RiskChange","IterationChange","TeamChange","ReactionsChange","FlagChange","UserChange","StatusChange","BoardChange","LinkChange","linkChanges","mirrorChanges","groupByDay","toByDayList","groupByDayStart","groupBySticky","toByStickyList","groupByStickyId","sortFields","groupByKind","makeDisplayable","sortFieldChanges","isExpandable","deletedCardField","cardFromStickyChange","deletedCardCache","cardFromLogChange","cardName","typeName","handleExpanded","opened","expandedItemId","enlargedStickyId","useStickyChangeEnlarge","newState","prevState","somethingChanged","isDifferentItem","isDifferentSticky","changesBySticky","loadEvents","updateHighlightedCards","changeTitle","changesByDay","moreResults","enlargedSticky","incomplete","activeId","ch","contextMenuStore","zoomStore","dropdownMenuRef","menuProps","handleHideContextMenu","goToTeam","goToArt","goToSolutionTrain","currentSessionDateRange","goToSwitchSession","Duration","lessThan","LabelInput","forId","SuffixInput","$refs","InputTime","_component_SuffixInput","validating","nameError","durationError","timerFinished","stateInfo","isState","boardTimers","artTimers","addBoardTimer","addTimer","addArtTimer","timersEditing","startCardDrag","clientX","clientY","currentType","ZOOM_TIMEOUT","inputEl","zoomTimeout","zoomIn","toggleAppZoom","roundZoom","onInputBlur","inputFactor","oldFactor","plusKey","minusKey","zoomStep","appZoom","updateLiveRegion","liveRegion","startZoom","stopZoom","cardZooming","scaleUp","toggleZoom","cardZoomTimeout","lastCardZoom","canNonTeamZoom","cardZoomable","cardZoom","rep","toggleCardZooming","expandButton","collapseButton","drawMode","setCollapsed","collapse","showTrigger","checkForPassiveNotifications","passiveNotifications","showStickyActions","showMessenger","panelRightWidth","isZoomEnabled","configureBoardAction","isAnyActive","hasSolutionBacklogBoard","hasSolutionBoard","menuPosition","isButtonDisabled","TOP_MENU_OFFSET","trackFilterOpen","toggleLeft","toggleRight","toggleLeftWidth","toggleRightWidth","isMeasured","updateWidths","widthLeft","widthRight","datePickerRef","showTimePickers","toggleTimePickers","customDate","customDateItem","triggerLabel","fromDate","toDate","onDatesSelected","useUrlStore","stickyIdsToEnlarge","fromQuery","toSearchQuery","inputRef","onInput","handleInputFocus","CardMatcher","searchMenuStore","searchText","searchWords","dependTeamMatch","precondTeamMatch","typeMatch","selectedDependencyLink","anyLinks","SearchItemBase","flags","assignees","depLinks","allStatusClasses","cardMatcher","teamMatch","explicitLinkMatch","linkMatch","propMatch","matchesCard","toSearchResult","kindNames","sortSearchResults","groupSearchResultsByArt","groupSearchResults","mapSearchResult","findTeamById","countSearchResults","groupSearchResultsByType","groupByTeamName","searchResultsGroupedByTeam","kind","SinglePendingPromise","thenAction","startSeq","isHighlighted","otherBoardId","trackItemSelected","currentBoardType","targetBoardType","onKeydown","groupResults","typeGroupItems","resultsByType","dependencyStickyTypes","groupResultEntities","typeResultGroupEntity","typeResultGroupItems","groupDependencyResults","resultGroupItems","findTeamIndex","redundantTypeResultGroupItems","duppedItems","groupSearchResultsByDependencyTeamFilter","showDependencyGroupingHeader","resetCurrent","resultsByArt","SearchResults","currentBoardItems","backendResults","Emit","CurrentBoardSearchResults","OtherBoardsSearchResults","ComplexList","ListEmpty","_component_ComplexList","_component_ListEmpty","_createSlots","hasFilters","_component_CurrentBoardSearchResults","getCurrentBoardSearchResults","searchingOtherBoards","_component_OtherBoardsSearchResults","otherBoardsResults","currentBoardAssignees","riskyLinks","critical","risky","anySelected","SearchItem","isFocusInsideSearchResults","searchResults","marking","filterCriteria","SidePanel","AssigneeItem","DependencyTeamItem","DependencyLinkItem","SearchBar","StickyTypeItem","TeamItem","ArtItem","StatusClassItem","RiskyLinksItem","StickersItem","IterationItem","SkipButton","isSearchSidebarOpen","_component_SearchBar","_component_SkipButton","_component_StickyTypeItem","_component_DependencyLinkItem","_component_StickersItem","_component_AssigneeItem","showDependencyTeamFilter","_component_ArtItem","_component_TeamItem","_component_DependencyTeamItem","_component_StatusClassItem","anyFilterCriteria","_component_RiskyLinksItem","_component_SearchResults","editingCardId","isProgramBoard","isSwitchSessionOpen","showMetrics","showBoardDiff","isBoardActivityOpen","sound","strokeDasharray","audio","setDuration","showDuration","finished","endSoon","lastSoundStore","st","lastSound","filterActiveTimers","deleteTimer","cockpitUrl","cockpitAllowed","infoLink","showUserSync","expirationMessage","expiresIn","showExpirationMessage","openSettings","openShortcuts","handleDropdownOpen","almStatusMapping","showTooltip","allUsers","userNames","more","isPlanningMode","linkTypeCount","riskyLinkTooltipText","showRiskyLinks","criticalLink","warnLink","activeTimers","hoverActive","openActive","hoverInactive","closeInactive","useHoverable","hovered","keep","unhover","teamSelector","currentFlex","uniqBy","flexes","selectFlexType","flexId","selectFlex","artHovered","showArt","keepArt","hideArt","artWidth","isUserArt","currentArt","hasArtSelector","makeBoardItem","makeCurrentBoardItem","selectBoard","darkMode","boardActivityPanelOpen","hasWebsocketConnection","reloadPage","getStyleInfo","clearStyles","DefaultPaintLayer","elemFontSize","elemFontUnit","parseFont","unscaledCanvasUnitsPerPixel","calcElementSize","elementScale","boxWidth","boxHeight","canvasUnitsPerPixel","pixelPerFontUnit","measurePixelPerFontUnit","makeVisible","elStyle","unit","attr","findSvgRoot","svgUnitsPerPixel","box","setElementFontSize","pixel","fontSizeFactor","charWidthCache","exactHeightInCanvas","pixelSize","char1","char2","shadowColor","borderColor","alignmentFactor","DefaultZoomLayer","relativeSize","cardElem","currentColor","relativeCanvasSize","relativeFontSize","lineHeight","trailTimeout","trail","sendPos","doSendPos","pointerTrail","registerPointerEvents","registerShortcuts","pointerPosDelay","showMarker","useZoomLayerStickyNumber","zoomHandler","zoomLayer","cardNodes","checkZoomTimeout","endZoom","useLayer","initZoomLayer","checkZoom","hideZoomLayer","AppPage","useMode","MenuContainer","ToastMessage","DrawLayer","SelectionLayer","ConnectionStatus","ZoomLayer","PaintLayer","MousePointers","boardComponent","_component_ToastMessage","_component_MenuContainer","_component_MousePointers","showSelectionLayer","showDrawLayer","_component_DrawLayer","hasPaintLayer","_component_PaintLayer","_KeepAlive","_resolveDynamicComponent","_imports_0$1","_imports_1","email","tenantId","errorMessage","isWrongEmail","loginData","loginWithTenant","switchPageToEmail","LoginPageEmail","registerUrl","loginWithEmail","tenants","LoginPageTenants","useServicePopups","openServices","showServices","host","popups","closeAll","popup","currentLoginPage","pageSwitch","page","clearUserData","logoutReason","_imports_0","isMobile","onDesktop","useTimeout","repeated","interval","strictTiming","isPromise","schedule","updateInterval","newInterval","PointElement","LineElement","Filler","nowMinutes","fetchGoogleIcon","useOnlineStatus","online","PING_INTERVAL_SHORT","PING_INTERVAL_LONG","PAYLOAD_INTERVAL","useRouter","tabHasBeenInactive","updateLastVisibility","tableData","makePingRequests","addLabel","pingLabels","pingServer","pingGoogle","addVisibilityDataPoint","makePayloadRequests","payloadLabels","requestWithData","pingRepetition","userStore","payloadDatasets","pingDatasets","VISIBILITY_INDEX","arrayRef","addTableRow","addDataPoint","tableIndex","dataset","hidden","extractErrorMessage","http","tableHeaders","header","back","encoded","decoded","deprecated","assertSmallScreen","beforeLogin","companyId","followRedirect","routes","BasePage","StatusPage","MobileInfoPage","LoginPage","LogoutPage","WheelTestPage","Resolvable","createSyncQueue","running","doJobs","job","resolvable","desc","addSyncNav","navigatingTo","navigating","startNavigating","endNavigating","syncRouter","syncPush","syncReplace","routeFunc","createRouter","createWebHashHistory","assignShortcuts","preventSpacebarClickInterference","isMousePressed","activeEl","resetMousePress","disableDefaultContextMenu","disableImageDragging","targetNode","showLogo","blue","red","dw","dh","registerCopyPaste","cardPasteTarget","parseJson","isSerializedCard","initialPosition","freePos","deserializeCard","selectedText","setClipboard","cardWithText","clipboard","serializeCard","newBase","relativeToBase","registerGlobalActions","AppBase","createPinia","initErrorListeners"],"ignoreList":[],"sources":["../../src/assets/intercom.js","../../src/composables/EventBus.ts","../../src/composables/useEventBus.ts","../../src/utils/LocalStore.ts","../../src/utils/text/text.ts","../../src/utils/analytics/events.ts","../../src/model/coordinates.ts","../../src/math/coordinates.ts","../../src/utils/dom/coordinates.ts","../../src/utils/dom/dom.ts","../../src/utils/env/Environment.ts","../../src/utils/env/featureToggles.ts","../../src/utils/env/feature.ts","../../src/error/sentry.ts","../../src/translations/i18n.ts","../../src/components/shortcut/key.ts","../../src/model/Settings.ts","../../src/store/action.ts","../../src/utils/async/utils.ts","../../src/action/actions.ts","../../src/model/board.ts","../../src/store/stickyType.ts","../../src/utils/Throttle.ts","../../src/utils/general.ts","../../src/utils/objectId.ts","../../src/backend/DummyBackendSession.ts","../../src/backend/Sender.ts","../../src/assets/arrange.gif","../../src/components/ui/SvgIcon/SvgLoadingPlaceholder.vue","../../src/components/ui/SvgIcon/loader.ts","../../src/components/ui/SvgIcon/SvgIcon.vue","../../src/components/ui/BaseButton/asyncHandler.ts","../../src/components/ui/BaseButton/BaseButton.vue","../../src/components/ui/BaseTooltip/baseTooltip.ts","../../src/components/ui/BaseTooltip/BaseTooltip.vue","../../src/components/ui/IconButton/IconButton.vue","../../src/composables/useNativeEvents.ts","../../src/components/modal/useSimpleDraggable.ts","../../src/components/modal/BaseModal.vue","../../src/store/boardSize.ts","../../src/store/sidePanel.ts","../../src/store/zoom.ts","../../src/math/coordinate-systems.ts","../../src/model/baseTypes.ts","../../src/store/art.ts","../../src/store/helpers/animator.ts","../../src/store/license.ts","../../src/utils/analytics/trackUser.ts","../../src/language.ts","../../src/model/user.ts","../../src/action/internalActions.ts","../../src/components/utils/serverTime.ts","../../src/store/helpers/almItemStatus.ts","../../src/store/almItemType.ts","../../src/store/companySettings.ts","../../src/utils/RingBuffer.ts","../../src/store/connection.ts","../../src/store/loading.ts","../../src/store/serverSettings.ts","../../src/model/Counter.ts","../../src/store/statistics.ts","../../src/store/globalError.ts","../../src/error/ApplicationError.ts","../../src/error/CancelError.ts","../../src/error/UnauthenticatedError.ts","../../src/error/errorHandler.ts","../../src/utils/async/Scheduler.ts","../../src/backend/DataError.ts","../../src/backend/mapper/mapAlmItemType.ts","../../src/model/CardFlag.ts","../../src/model/card.ts","../../src/utils/colorPalette.ts","../../src/utils/color.ts","../../src/utils/date.ts","../../src/backend/mapper/mapBackendData.ts","../../src/backend/mapper/mapBoard.ts","../../src/model/change.ts","../../src/backend/mapper/mapStickyChange.ts","../../src/model/stickyType.ts","../../src/store/helpers/linkState.ts","../../src/store/helpers/mark.ts","../../src/store/objective.ts","../../src/store/link.ts","../../src/store/card.ts","../../src/store/pointer.ts","../../src/store/timer.ts","../../src/store/usersOnBoard.ts","../../src/utils/dom/mutationObserver.ts","../../src/utils/vue/index.ts","../../src/backend/changeSticky.ts","../../src/backend/subscriptionHandlers.ts","../../src/backend/Backend.ts","../../src/utils/SimpleCache.ts","../../src/backend/BackendError.ts","../../src/backend/NoSuccessError.ts","../../src/store/client.ts","../../src/services/api.config.ts","../../src/services/user.service.ts","../../src/store/user.ts","../../src/store/team.ts","../../src/router/index.ts","../../src/router/types.ts","../../src/router/navigation.ts","../../src/store/session.ts","../../src/store/navigation.ts","../../src/store/flex.ts","../../src/store/helpers/frontendBoard.ts","../../src/store/helpers/boardByType.ts","../../src/store/helpers/mirror.ts","../../src/store/boards.ts","../../src/components/modal/metrics/MetricsModalBodyLayout.vue","../../src/components/utils/capacity.ts","../../src/components/modal/metrics/components/CombinedLoadCapacityChart.vue","../../src/components/modal/metrics/components/LoadCapacityChart.vue","../../src/components/modal/metrics/metrics.ts","../../src/components/modal/metrics/MetricsModalLoadCapacityBody.vue","../../src/model/shape.ts","../../src/board/location/BoardLocation.ts","../../src/components/board/injectKeys.ts","../../src/components/card/injectKeys.ts","../../src/store/selection.ts","../../src/store/panMode.ts","../../src/components/StickyNote/animations.ts","../../src/store/activity.ts","../../src/components/ui/MenuList/types.ts","../../src/components/ui/MenuList/MenuList.vue","../../src/components/ui/MenuList/components/MenuListHeader.vue","../../src/directives/autofocus.ts","../../src/directives/keyboardNavigation.ts","../../src/components/ui/MenuList/components/MenuListItems.vue","../../src/components/ui/MenuList/components/MenuListItem.vue","../../src/components/ui/MenuList/components/MenuListTitle.vue","../../src/components/ui/SelectableList/SelectableList.vue","../../src/components/ui/TypeDot/TypeDot.vue","../../src/components/SelectStickyType/SelectStickyType.vue","../../src/components/ui/SelectNamedValue/SelectNamedValue.vue","../../src/components/card/CardCreationMenu.vue","../../src/components/utils/boardSize.ts","../../src/components/utils/layout.ts","../../src/store/contextMenu.ts","../../src/store/dragging.ts","../../src/store/toast.ts","../../src/action/linkActions.ts","../../src/action/addCard.ts","../../src/components/ui/NavigableList/NavigableList.vue","../../src/components/modal/MirrorModal.vue","../../src/components/modal/TeamModal.vue","../../src/components/a11y/ScreenReaderMessage.vue","../../src/components/ui/BaseInput/components/BaseInputText.vue","../../src/components/ui/BaseInput/BaseInput.vue","../../src/components/SearchInput/SearchInput.vue","../../src/components/action/injectKeys.ts","../../src/components/action/ActionSource.vue","../../src/components/TreeView/components/TreeNode.vue","../../src/components/TreeView/TreeView.vue","../../src/components/OrganizationBaseTree/OrganizationBaseTree.vue","../../src/components/modal/stickyLink/components/OrganizationTree.vue","../../src/components/StickyNote/components/StickyNoteHeader/components/FlagChip/flagMap.ts","../../src/model/colors.ts","../../src/components/card/BaseFlag.vue","../../src/components/ui/ComplexList/components/ListItem.vue","../../src/components/ui/ComplexList/components/ListItem/components/ListItemSubtitleSticky.vue","../../src/components/utils/linkableItems.ts","../../src/store/workMode.ts","../../src/components/ui/ComplexList/components/ListItem/variants/ListItemStickyLink.vue","../../src/components/StickyNote/components/StickyListItem/StickyLinkRow.vue","../../src/components/ui/ComplexList/ComplexList.vue","../../src/components/ui/ComplexList/components/ListGroup.vue","../../src/components/ui/ComplexList/components/ListHeader/ListHeader.vue","../../src/components/modal/stickyLink/types.ts","../../src/components/ui/BasePopup/BasePopup.vue","../../src/components/ui/DropdownMenu/injectKeys.ts","../../src/components/ui/DropdownMenu/DropdownMenu.vue","../../src/components/ui/DropdownMenu/DropdownTrigger.vue","../../src/components/modal/stickyLink/components/TypeFilter.vue","../../src/components/modal/stickyLink/components/groupedLinkableObjectives.ts","../../src/components/modal/stickyLink/components/groupedLinkableStickies.ts","../../src/components/modal/stickyLink/components/SearchResults.vue","../../src/components/modal/stickyLink/StickyLinkModal.vue","../../src/action/selectionActions.ts","../../src/action/cardActions.ts","../../src/components/StickyNote/composables/useKeyboardDrag.ts","../../src/components/StickyNote/components/Accessibility/StickyNoteAccessibilityControls.vue","../../src/components/Draw/injectKeys.ts","../../src/components/ActionMenu/ActionMenuItem.vue","../../src/components/StickyNote/components/ActionMenu/actions.ts","../../src/components/DeleteMenuItem/DeleteStickies.vue","../../src/components/DeleteMenuItem/DeleteMenuItem.vue","../../src/components/StickyNote/components/ActionMenu/components/ActivityMenuItem/ActivityMenuItem.vue","../../src/components/StickyNote/components/CurrentAlmIcon/CurrentAlmIcon.vue","../../src/components/StickyNote/components/ActionMenu/components/AlmMenuItem/AlmMenuItem.vue","../../src/components/ui/MenuList/components/MenuListSearch.vue","../../src/components/card/components/ArtSelector/ArtSelector.vue","../../src/components/StickyNote/components/ActionMenu/components/ChangeArtMenuItem/ChangeArt.vue","../../src/components/StickyNote/components/ActionMenu/components/ChangeArtMenuItem/ChangeArtMenuItem.vue","../../src/components/ui/MiddleEllipsis/MiddleEllipsis.vue","../../src/components/StickyNote/components/ActionMenu/components/ChangeProjectMenuItem/ChangeProject.vue","../../src/components/StickyNote/components/ActionMenu/components/ChangeProjectMenuItem/ChangeProjectMenuItem.vue","../../src/components/ComboBox/ComboBox.vue","../../src/components/card/components/TeamSelector/TeamSelector.vue","../../src/components/StickyNote/components/ActionMenu/components/DependOnTeamMenuItem/DependOnTeam.vue","../../src/components/StickyNote/components/ActionMenu/components/DependOnTeamMenuItem/DependOnTeamMenuItem.vue","../../src/components/StickyNote/components/ActionMenu/components/DuplicateMenuItem/DuplicateMenuItem.vue","../../src/components/StickyNote/components/ActionMenu/components/LinkMenuItem/LinkMenuItem.vue","../../src/components/StickyNote/components/MirrorSticky/MirrorSticky.vue","../../src/components/StickyNote/components/ActionMenu/components/MirrorMenuItem/MirrorMenuItem.vue","../../src/components/StickyNote/components/ActionMenu/components/MirrorToArtBoardMenuItem/MirrorToArtBoardMenuItem.vue","../../src/components/StickyNote/components/ActionMenu/components/MoveMenuItem/BoardSelector.vue","../../src/components/StickyNote/components/ActionMenu/components/MoveMenuItem/MoveSticky.vue","../../src/components/StickyNote/components/ActionMenu/components/MoveMenuItem/MoveMenuItem.vue","../../src/components/StickyNote/components/ActionMenu/components/PinMenuItem/PinMenuItem.vue","../../src/components/card/components/ShareMenu/ShareMenu.vue","../../src/components/StickyNote/components/StickyNoteFooter/components/StickyStatus/StickyStatus.vue","../../src/components/StickyNote/components/ActionMenu/components/StickyStatusMenuItem/StickyStatusMenuItem.vue","../../src/components/StickyNote/components/ActionMenu/components/StickyTypeMenuItem/StickyTypeChange.vue","../../src/components/StickyNote/components/ActionMenu/components/StickyTypeMenuItem/StickyTypeMenuItem.vue","../../src/components/input/BaseBoardInput.vue","../../src/components/input/BoardNumberInput.vue","../../src/components/ui/BasePopup/components/BasePopupTitle/BasePopupTitle.vue","../../src/components/card/components/SetStoryPoints/SetStoryPoints.vue","../../src/components/StickyNote/components/ActionMenu/utils.ts","../../src/components/StickyNote/components/ActionMenu/components/StoryPointsMenuItem/StoryPointsMenuItem.vue","../../src/components/StickyNote/components/TeamDropdown/TeamDropdown.vue","../../src/components/StickyNote/components/ActionMenu/components/TeamMenuItem/TeamMenuItem.vue","../../src/components/card/components/SetWsjf/SetWsjf.vue","../../src/components/StickyNote/components/ActionMenu/components/WsjfMenuItem/WsjfMenuItem.vue","../../src/components/StickyNote/components/ActionMenu/StickyActionMenu.vue","../../src/model/markMode.ts","../../src/components/StickyNote/components/StickyNoteFilter/StickyNoteFilter.vue","../../src/composables/useTooltip.ts","../../src/components/StickyNote/components/AttributeChip/AttributeChip.vue","../../src/components/StickyNote/components/StickyNoteFooter/components/MirrorStickyChip/MirrorStickyChip.vue","../../src/components/StickyNote/components/StickyNoteFooter/components/StickyLinks/StickyLinks.vue","../../src/components/StickyNote/components/StickyNoteFooter/components/StickyLinksChip/StickyLinksChip.vue","../../src/components/StickyNote/components/StickyNoteFooter/components/DependencyFooter/DependencyFooter.vue","../../src/composables/useUser.ts","../../src/components/UserAvatar/UserAvatar.vue","../../src/components/StickyNote/components/StickyNoteFooter/components/NoteFooter/components/UsersListTooltip/UsersListTooltip.vue","../../src/components/StickyNote/components/StickyNoteFooter/components/StickyReactions/StickyReactions.vue","../../src/utils/dom/animation.ts","../../src/components/StickyNote/components/StickyNoteFooter/components/NoteFooter/components/UserReactions/UserReactions.vue","../../src/components/StickyNote/components/StickyNoteFooter/components/NoteFooter/NoteFooter.vue","../../src/services/userAlmMapping.service.ts","../../src/services/userAdmin.service.ts","../../src/components/card/components/UserSelector/components/NoUserEntry.vue","../../src/components/card/components/UserSelector/components/UserEntry.vue","../../src/components/card/components/UserSelector/UserSelector.vue","../../src/components/ui/InfoMessage/InfoMessage.vue","../../src/components/card/components/SetAssignee/SetAssignee.vue","../../src/components/StickyNote/components/StickyNoteFooter/components/UserChip/UserChip.vue","../../src/components/card/components/ROAMSticky/ROAMSticky.vue","../../src/components/StickyNote/components/StickyNoteFooter/components/ROAMChip/ROAMChip.vue","../../src/components/StickyNote/components/StickyNoteFooter/components/RiskFooter/RiskFooter.vue","../../src/components/StickyNote/components/StickyNoteFooter/components/ArtSelectChip/ArtSelectDropdown.vue","../../src/components/StickyNote/components/StickyNoteFooter/components/ArtSelectChip/ArtSelectChip.vue","../../src/components/StickyNote/components/StickyNoteFooter/components/StickyStatusChip/StickyStatusChip.vue","../../src/components/StickyNote/components/StickyNoteFooter/components/StoryPointsChip/StoryPointsChip.vue","../../src/components/StickyNote/components/StickyNoteFooter/components/TeamSelectChip/TeamSelectChip.vue","../../src/components/StickyNote/components/StickyNoteFooter/components/WSJFChip/WSJFChip.vue","../../src/components/StickyNote/components/StickyNoteFooter/components/WorkItemFooter/WorkItemFooter.vue","../../src/components/StickyNote/components/StickyNoteFooter/StickyNoteFooter.vue","../../src/components/StickyNote/components/StickyNoteType/StickyNoteTypeText.vue","../../src/components/flags/FlagPicker.vue","../../src/components/StickyNote/components/StickyNoteHeader/components/FlagChip/FlagChip.vue","../../src/components/StickyNote/components/StickyNoteHeader/StickyNoteHeader.vue","../../src/store/searchMenu.ts","../../src/math/QuadraticSpline.ts","../../src/components/StickyNote/components/StickyNoteLinks/utils.ts","../../src/components/StickyNote/components/StickyNoteLinks/StickyNoteLinks.vue","../../src/components/UserAvatar/UserAvatarNamed.vue","../../src/components/StickyNote/components/StickyNotePin/StickyNotePin.vue","../../src/components/StatusDistribution/StatusDistribution.ts","../../src/utils/dateFormat.ts","../../src/components/StatusDistribution/components/StackedBarChart.ts","../../src/components/StatusDistribution/components/StackedBarChart.vue","../../src/components/StatusDistribution/StatusDistribution.vue","../../src/components/StickyNote/components/StickyNoteProgress/StickyNoteProgress.vue","../../src/components/StickyNote/components/StickyNoteText/components/StickyNoteTextDisplay.vue","../../src/utils/text/emojiReplacer.ts","../../src/components/StickyNote/components/StickyNoteText/components/StickyNoteTextInput.vue","../../src/utils/text/PaintLayer.ts","../../src/utils/text/lineBreaker.ts","../../src/utils/text/TextMeasurer.ts","../../src/utils/text/fontSizeCache.ts","../../src/utils/text/linkParser.ts","../../src/utils/text/fontSizeOptimizer.ts","../../src/components/StickyNote/components/StickyNoteText/components/StickyNoteTextWrapper.vue","../../src/components/StickyNote/components/StickyNoteText/StickyNoteTextEditable.vue","../../src/components/utils/scroll.ts","../../src/components/gestures/dragScroll.ts","../../src/components/gestures/zoom.ts","../../src/components/gestures/pinch.ts","../../src/components/gestures/pointer.ts","../../src/components/gestures/drag.ts","../../src/components/card/cardDragHandler.ts","../../src/components/StickyNote/composables/useDrag.ts","../../src/components/shortcut/shortcuts.ts","../../src/composables/useTransition.ts","../../src/composables/utils/useDelayedAction.ts","../../src/components/StickyNote/composables/useEnlarge.ts","../../src/components/StickyNote/composables/useLinkDrag.ts","../../src/components/StickyNote/composables/usePin.ts","../../src/directives/ownedCards.ts","../../src/components/StickyNote/composables/useSelect.ts","../../src/components/ActionMenu/useActionMenu.ts","../../src/components/StickyNote/composables/useStickyActionMenu.ts","../../src/components/StickyNote/composables/useStyles.ts","../../src/components/StickyNote/StickyNote.vue","../../src/components/modal/OverviewModal.vue","../../src/components/modal/injectKeys.ts","../../src/components/modal/ModalTab.vue","../../src/components/modal/TabbedModal.vue","../../src/components/modal/shortcuts/ShortcutEntry.vue","../../src/action/objectiveActions.ts","../../src/mixins/ShortcutUser.ts","../../src/components/objectives/AddObjectiveButton.vue","../../src/components/input/BaseTextarea.vue","../../src/components/input/MaxLengthTextarea.vue","../../src/components/objectives/AddObjectiveCard.vue","../../src/components/Search/SearchResultsItem.vue","../../src/components/CardRow/CardTree.vue","../../src/components/CardRow/LinkableCardRow.vue","../../src/components/input/ExpandableTextarea.vue","../../src/components/input/PointsSelect.vue","../../src/components/transitions/RevealHeightTransition.vue","../../src/components/objectives/ObjectiveCard.vue","../../src/components/objectives/ObjectivesList.vue","../../src/components/modal/TeamObjectivesModal.vue","../../src/components/PieChart/PieChart.vue","../../src/components/modal/metrics/MetricsModalCapacityAllocationBody.vue","../../src/components/modal/metrics/MetricsModal.vue","../../src/components/modal/metrics/OverallMetricsModalCapacityAllocationBody.vue","../../src/components/modal/metrics/OverallMetricsModalLoadCapacityBody.vue","../../src/components/modal/metrics/OverallMetricsModal.vue","../../src/components/input/BaseSwitch.vue","../../src/components/input/PercentageInput.vue","../../src/components/ui/ListItem/ListItem.vue","../../src/components/modal/settings/SettingsFontDropdown.vue","../../src/components/modal/settings/SettingsTextAlignmentDropdown.vue","../../src/components/modal/settings/SettingsContent.vue","../../src/components/modal/settings/SettingsModal.vue","../../src/store/boardMenu.ts","../../src/assets/draw-lines.gif","../../src/store/draw.ts","../../src/store/switchSession.ts","../../src/action/toggleActions.ts","../../src/utils/session.ts","../../src/components/modal/SessionSelectionModal.vue","../../src/utils/staticModals.ts","../../src/utils/vue/queryParam.ts","../../src/store/modal.ts","../../src/components/PlanReadout/components/ObjectiveCard.vue","../../src/components/PlanReadout/components/ObjectivesList.vue","../../src/components/PlanReadout/components/ObjectivesTab.vue","../../src/components/StickyNote/components/StickyNoteText/StickyNoteTextStatic.vue","../../src/components/PlanReadout/components/RiskDetail.vue","../../src/components/PlanReadout/components/PresentationRiskListItem.vue","../../src/components/PlanReadout/components/RisksList.vue","../../src/components/PlanReadout/components/RisksTab.vue","../../src/components/PlanReadout/components/TeamSelector.vue","../../src/components/PlanReadout/PlanReadoutModal.vue","../../src/store/category.ts","../../src/action/categoryActions.ts","../../src/action/flexActions.ts","../../src/components/background/FlexBackground.vue","../../src/components/input/SearchInputLegacy.vue","../../src/components/utils/cockpitUrls.ts","../../src/utils/list.ts","../../src/mixins/SearchBase.ts","../../src/mixins/SelectList.ts","../../src/components/modal/flex/AddFlexBoard.vue","../../src/components/modal/flex/DeleteCategory.vue","../../src/components/modal/flex/DuplicateFlexBoard.vue","../../src/mixins/LabeledInput.ts","../../src/components/input/InputField.vue","../../src/components/modal/flex/DeleteFlexBoardElem.vue","../../src/components/modal/flex/DuplicateFlexBoardElem.vue","../../src/components/modal/flex/FlexBoardElem.vue","../../src/components/modal/flex/FlexCategoryElem.vue","../../src/components/modal/flex/draggable.ts","../../src/components/modal/flex/FlexModal.vue","../../src/components/board/KanbanBoard/components/KanbanSticky/BaseKanbanSticky.vue","../../src/components/board/KanbanBoard/components/KanbanColumn.vue","../../src/components/board/KanbanBoard/composables/useDragScrolling.ts","../../src/components/board/KanbanBoard/composables/useStickyDrag.ts","../../src/components/board/KanbanBoard/KanbanBoard.vue","../../src/components/board/KanbanBoard/components/FilterDropdown.vue","../../src/components/board/KanbanBoard/utils.ts","../../src/components/board/KanbanBoard/TeamKanbanBoard/components/TeamFilter.vue","../../src/components/board/KanbanBoard/components/TextFilter.vue","../../src/components/board/KanbanBoard/components/BaseKanbanFilters.vue","../../src/components/board/KanbanBoard/components/KanbanSticky/BaseKanbanStickyContent.vue","../../src/components/board/KanbanBoard/components/KanbanSticky/BaseKanbanStickyHeader.vue","../../src/components/board/KanbanBoard/components/TypeFilter.vue","../../src/components/board/KanbanBoard/composables/useFilterTracking.ts","../../src/components/board/KanbanBoard/composables/useKanbanColumns.ts","../../src/components/board/KanbanBoard/composables/useKanbanFilters.ts","../../src/components/board/KanbanBoard/components/KanbanSticky/KanbanStickyChip.vue","../../src/components/board/KanbanBoard/components/KanbanSticky/AlmLinkChip.vue","../../src/components/board/KanbanBoard/components/KanbanSticky/BaseKanbanStickyFooter.vue","../../src/components/board/KanbanBoard/ArtKanbanBoard/components/ArtKanbanStickyFooter.vue","../../src/components/board/KanbanBoard/ArtKanbanBoard/composables/useStickies.ts","../../src/components/board/KanbanBoard/ArtKanbanBoard/composables/useTeams.ts","../../src/components/board/KanbanBoard/ArtKanbanBoard/ArtKanbanBoard.vue","../../src/components/modal/kanban/ArtKanbanModal.vue","../../src/assets/avatars/unknown.svg?component","../../src/components/board/KanbanBoard/TeamKanbanBoard/components/AssigneeDropdown.vue","../../src/components/board/KanbanBoard/TeamKanbanBoard/components/KanbanStickyFooter.vue","../../src/components/board/KanbanBoard/TeamKanbanBoard/components/UserFilter.vue","../../src/components/board/KanbanBoard/TeamKanbanBoard/composables/useStickies.ts","../../src/components/board/KanbanBoard/TeamKanbanBoard/composables/useStickyAssignees.ts","../../src/components/board/KanbanBoard/TeamKanbanBoard/IterationKanbanBoard.vue","../../src/components/modal/kanban/IterationKanbanModal.vue","../../src/components/board/KanbanBoard/SolutionKanbanBoard/components/ArtFilter.vue","../../src/components/board/KanbanBoard/SolutionKanbanBoard/components/SolutionKanbanStickyFooter.vue","../../src/components/board/KanbanBoard/SolutionKanbanBoard/composables/useStickies.ts","../../src/components/board/KanbanBoard/SolutionKanbanBoard/SolutionKanbanBoard.vue","../../src/components/modal/kanban/SolutionKanbanModal.vue","../../src/action/navigationActions.ts","../../src/components/modal/ConfirmModal.vue","../../src/components/modal/ConfirmArrangeModal.vue","../../src/backend/TimeoutError.ts","../../src/components/modal/ConfirmSyncBacklogModal.vue","../../src/components/modal/ConfirmSyncIterationModal.vue","../../src/action/utils/screenshotDom.ts","../../src/action/utils/screenshot.ts","../../src/action/boardActions.ts","../../src/board/BaseBoard.ts","../../src/board/BaseBacklogBoard.ts","../../src/board/BacklogBoard.ts","../../src/board/FlexBoard.ts","../../src/board/BasePlanningBoard.ts","../../src/board/location/PlanningBoardLocation.ts","../../src/board/ProgramBoard.ts","../../src/board/ProgramObjectivesBoard.ts","../../src/board/location/RiskBoardLocation.ts","../../src/board/RiskBoard.ts","../../src/board/SolutionBacklogBoard.ts","../../src/board/SolutionBoard.ts","../../src/board/location/TeamBoardLocation.ts","../../src/board/TeamBoard.ts","../../src/board/boardFactory.ts","../../src/services/heartbeat.service.ts","../../src/store/board.ts","../../src/utils/analytics/track.ts","../../src/store/clientSettings.ts","../../src/components/NetStatistics/AreaGraph.vue","../../src/components/NetStatistics/NetStatistics.vue","../../src/utils/dom/wheelEvent.ts","../../src/components/gestures/wheel.ts","../../src/components/modal/GlobalError.vue","../../src/components/AppBase/AppLoadingIndicator.vue","../../src/components/AppBase/AppBase.vue","../../src/directives/boardRegion.ts","../../src/directives/focusTrap.ts","../../src/directives/scrollableOnBoard.ts","../../src/services/auth.service.ts","../../src/backend/natsTopicMapper.ts","../../src/backend/requestHelper.ts","../../src/backend/responseHelper.ts","../../src/backend/HttpRpcBackend.ts","../../src/backend/BackendSession.ts","../../src/backend/BaseBackendSession.utils.ts","../../src/backend/serverModel.ts","../../src/backend/BaseBackendSession.ts","../../src/backend/EventInfo.ts","../../src/backend/NatsBackendSession.ts","../../src/backend/NatsRPCPayload.ts","../../src/backend/NatsRpcBackend.ts","../../src/backend/SwitchingRpcBackend.ts","../../src/backend/Connection.ts","../../src/store/messenger.ts","../../src/utils/inactivityLogout.ts","../../src/router/login.ts","../../src/router/guards/utils.ts","../../src/router/guards/assertLoggedIn.ts","../../src/router/guards/docTitle.ts","../../src/router/guards/appNavigation.ts","../../src/router/guards/handleNonSessionParams.ts","../../src/router/sessionData.ts","../../src/router/guards/handleSessionParam.ts","../../src/router/guards/logError.ts","../../src/action/drawActions.ts","../../src/composables/useDragScroll.ts","../../src/components/action/ActionListItem.vue","../../src/components/Draw/components/DrawContextMenu.vue","../../src/components/Draw/components/DeleteMenuItem.vue","../../src/components/Draw/components/TextDropdown.vue","../../src/components/Draw/components/TextMenuItem.vue","../../src/components/Draw/components/useTextElement.ts","../../src/components/Draw/components/TextLine.vue","../../src/components/Draw/components/TextRect.vue","../../src/components/Draw/composables/useDrawActionMenu.ts","../../src/components/Draw/composables/usePointerPosition.ts","../../src/components/Draw/composables/useSvgShapes.ts","../../src/components/Draw/DrawLayer.vue","../../src/components/action/ActionButton.vue","../../src/composables/useShortcuts.ts","../../src/components/Selection/components/ShareMenu.vue","../../src/components/Selection/components/SelectionActionMenu.vue","../../src/components/Selection/composables/useMultiSelectRect.ts","../../src/components/Selection/composables/useSelectionActionMenu.ts","../../src/components/Selection/composables/useStickyBoundingRect.ts","../../src/components/Selection/SelectionLayer.vue","../../src/components/ui/DropdownMenu/SubMenu.vue","../../src/components/menu/BoardContextMenu/BoardContextMenu.vue","../../src/components/menu/BoardContextMenu/KebabMenu.vue","../../src/components/gestures/longClick.ts","../../src/mixins/EventBusUser.ts","../../src/components/board/BoardBase.ts","../../src/components/board/FluidBoard.ts","../../src/components/board/components/BacklogAddNewButton.vue","../../src/components/board/BaseBacklogBoard.vue","../../src/components/board/BacklogBoard.vue","../../src/components/LinkLayer/linkLayer.ts","../../src/components/LinkLayer/LinkLayer.vue","../../src/components/board/FlexBoard.vue","../../src/components/a11y/SingleAriaElement.vue","../../src/components/board/BasePlanningBoardSection.vue","../../src/components/board/BasePlanningBoard.vue","../../src/components/board/ProgramBoard.vue","../../src/components/board/ProgramObjectivesBoard.vue","../../src/components/board/RiskBoard.vue","../../src/components/board/SolutionBacklogBoard.vue","../../src/components/board/SolutionBoard.vue","../../src/utils/dom/scrollbarWidth.ts","../../src/components/modal/ObjectiveLinkModal.vue","../../src/components/objectives/ObjectiveLinkButton.vue","../../src/components/objectives/TeamObjectiveRow.vue","../../src/components/objectives/TeamObjectives.vue","../../src/components/board/components/IterationFlag.vue","../../src/components/board/components/TeamIteration.vue","../../src/components/board/TeamBoard.vue","../../src/components/SidePanel/injectKeys.ts","../../src/components/SidePanel/SidePanel.vue","../../src/components/SidePanel/SidePanelContent.vue","../../src/components/ActivityPanel/components/change/BoardChange.vue","../../src/components/ActivityPanel/components/change/LinkedCard.vue","../../src/assets/reactions/reaction-hot.svg","../../src/assets/reactions/reaction-increment.svg","../../src/assets/reactions/reaction-love.svg","../../src/components/card/ReactionIcon.vue","../../src/components/ActivityPanel/components/change/ReactionsChange.vue","../../src/components/ActivityPanel/components/change/StatusChange.vue","../../src/components/ActivityPanel/components/change/TeamChange.vue","../../src/components/ActivityPanel/components/change/TypeChange.vue","../../src/components/ActivityPanel/stickyChanges.ts","../../src/components/ActivityPanel/components/ChangeTypesFilter.vue","../../src/components/ActivityPanel/components/DiffList.vue","../../src/components/ActivityPanel/components/groupChanges.ts","../../src/components/ui/ComplexList/components/ListItem/variants/ListItemStickyDiffs.vue","../../src/components/ActivityPanel/composables/useStickyChangeEnlarge.ts","../../src/components/ActivityPanel/components/DiffsBySticky.vue","../../src/components/ActivityPanel/BoardDiffPanel.vue","../../src/components/ui/ComplexList/components/ListItem/variants/ListItemStickyActivity.vue","../../src/components/ActivityPanel/components/ChangesByDay.vue","../../src/components/ActivityPanel/BoardLogPanel.vue","../../src/components/ActivityPanel/BoardHistoryPanel.vue","../../src/components/ActivityPanel/StickyActivityPanel.vue","../../src/components/ContextMenu/ContextMenu.vue","../../src/components/SwitchSessionPanel/components/OrganizationTree.vue","../../src/components/SwitchSessionPanel/SwitchSessionPanel.vue","../../src/components/Timer/Duration.ts","../../src/components/Timer/components/ActiveTimer.vue","../../src/components/input/LabelInput.vue","../../src/components/input/SuffixInput.vue","../../src/components/Timer/components/InputTime.vue","../../src/components/Timer/components/InactiveTimer.vue","../../src/components/Timer/components/EditTimer.vue","../../src/components/Timer/components/EditTimers.vue","../../src/components/Timer/TimerPanel.vue","../../src/components/menu/BottomMenu/components/AddItemCard.vue","../../src/components/menu/BottomMenu/components/AddItem.vue","../../src/components/menu/BottomMenu/components/AppZoom.vue","../../src/components/menu/BottomMenu/components/CardZoom.vue","../../src/components/menu/BottomMenu/components/CollapsableMenuGroup.vue","../../src/components/menu/BottomMenu/components/MessengerItem.vue","../../src/components/menu/BottomMenu/BottomMenu.vue","../../src/components/menu/SideMenu/components/BoardsItem.vue","../../src/components/menu/SideMenu/SideMenu.vue","../../src/components/menu/TopMenu/constants.ts","../../src/components/Search/utils.ts","../../src/components/Search/dropdown/IterationItem.vue","../../src/components/Search/dropdown/StickyTypeItem.vue","../../src/components/ui/ToggleButton/ToggleButton.vue","../../src/components/ActivityPanel/components/DatePicker.vue","../../src/components/ActivityPanel/components/DateFilter.vue","../../src/components/ActivityPanel/TopMenuBoardDiff.vue","../../src/store/url.ts","../../src/components/Search/SearchBar.vue","../../src/components/Search/CardMatcher.ts","../../src/components/Search/SearchItemBase.ts","../../src/components/Search/SearchResult.ts","../../src/utils/async/SinglePendingPromise.ts","../../src/components/Search/SearchResultList.vue","../../src/components/Search/groupSearchResults.ts","../../src/components/Search/GroupedByTypeSearchResults.vue","../../src/components/Search/CurrentBoardSearchResults.vue","../../src/components/Search/OtherBoardsSearchResults.vue","../../src/components/Search/SearchResults.vue","../../src/components/Search/dropdown/ArtItem.vue","../../src/components/SelectUser/SelectUser.vue","../../src/components/Search/dropdown/AssigneeItem.vue","../../src/components/Search/dropdown/DependencyLinkItem.vue","../../src/components/Search/dropdown/DependencyTeamItem.vue","../../src/components/Search/dropdown/RiskyLinksItem.vue","../../src/components/ui/SelectStatusClass/SelectStatusClass.vue","../../src/components/Search/dropdown/StatusClassItem.vue","../../src/components/ui/ListItem/ListItemSeparator.vue","../../src/components/Search/dropdown/StickersItem.vue","../../src/components/Search/dropdown/TeamItem.vue","../../src/components/Search/SearchItem.vue","../../src/components/menu/TopMenu/components/MetricsItem.vue","../../src/components/menu/TopMenu/components/SwitchSessionItem.vue","../../src/components/menu/TopMenu/TopLeftMenu.vue","../../src/assets/timer.mp3","../../src/components/Timer/components/ProgressTimerIcon.vue","../../src/components/Timer/components/RunningTimer.vue","../../src/components/Timer/RunningTimers.vue","../../src/components/UserActions/UserActions.vue","../../src/components/menu/TopMenu/components/AlmStatus.vue","../../src/components/menu/TopMenu/components/BoardUsers.vue","../../src/components/menu/TopMenu/components/ModeToggleButton/ModeToggleButton.vue","../../src/components/menu/TopMenu/components/RiskyLinks.vue","../../src/components/menu/TopMenu/TopRightMenu.vue","../../src/components/menu/TopMenu/components/BreadCrumb/BreadCrumbSelector.vue","../../src/components/menu/TopMenu/components/BreadCrumb/useHoverable.ts","../../src/components/menu/TopMenu/components/BreadCrumb/BreadCrumb.vue","../../src/components/menu/TopMenu/TopMenu.vue","../../src/components/menu/MenuContainer.vue","../../src/components/ui/ToastMessage/ToastMessage.vue","../../src/pages/AppPage/components/ConnectionStatus.vue","../../src/utils/dom/styleCache.ts","../../src/pages/AppPage/components/DefaultPaintLayer.vue","../../src/pages/AppPage/components/DefaultZoomLayer.vue","../../src/pages/AppPage/pointerTrail.ts","../../src/pages/AppPage/components/MousePointers.vue","../../src/pages/AppPage/components/ZoomHandler.ts","../../src/pages/AppPage/AppPage.vue","../../src/assets/logo-named.svg","../../src/pages/BasePage.vue","../../src/assets/login-background.svg","../../src/pages/LoginPage/components/LoginPage.utils.ts","../../src/pages/LoginPage/components/LoginPageTenants.vue","../../src/pages/LoginPage/components/LoginPageEmail.vue","../../src/pages/LoginPage/useServicePopups.ts","../../src/pages/LoginPage/LoginPage.vue","../../src/pages/LogoutPage/LogoutPage.vue","../../src/assets/logo.svg","../../src/pages/MobileInfoPage/MobileInfoPage.vue","../../src/composables/useTimeout.ts","../../src/pages/components/HomeHeader.vue","../../src/pages/StatusPage/StatusChart.vue","../../src/pages/StatusPage/StatusStackedBarChart.vue","../../src/pages/StatusPage/statusHelpers.ts","../../src/pages/StatusPage/useOnlineStatus.ts","../../src/pages/StatusPage/StatusPage.vue","../../src/pages/WheelTestPage.vue","../../src/router/guards/assertSmallScreen.ts","../../src/router/guards/beforeLogin.ts","../../src/router/routes.ts","../../src/utils/async/Resolvable.ts","../../src/utils/async/syncQueue.ts","../../src/router/syncNav.ts","../../src/router/router.ts","../../src/shortcuts.ts","../../src/utils/dom/globalEvents.ts","../../src/console.ts","../../src/copyPaste.ts","../../src/globalActions.ts","../../src/main.ts"],"sourcesContent":["window.loadIntercom = (appId, apiBase) => {\n window.intercomSettings = {\n app_id: appId,\n api_base: apiBase,\n };\n (function () {\n var w = window;\n var ic = w.Intercom;\n if (typeof ic === \"function\") {\n ic(\"reattach_activator\");\n ic(\"update\", w.intercomSettings);\n } else {\n var d = document;\n var i = function () {\n i.c(arguments);\n };\n i.q = [];\n i.c = function (args) {\n i.q.push(args);\n };\n w.Intercom = i;\n var l = function () {\n var s = d.createElement(\"script\");\n s.type = \"text/javascript\";\n s.async = true;\n s.src = \"https://widget.intercom.io/widget/\" + w.intercomSettings.app_id;\n var x = d.getElementsByTagName(\"script\")[0];\n x.parentNode.insertBefore(s, x);\n };\n if (document.readyState === \"complete\") {\n l();\n } else if (w.attachEvent) {\n w.attachEvent(\"onload\", l);\n } else {\n w.addEventListener(\"load\", l, false);\n }\n }\n })();\n};\n","import { TinyEmitter } from \"tiny-emitter\";\n\nconst EventBus = new TinyEmitter();\n\nexport default EventBus;\n","import { onUnmounted } from \"vue\";\n\nimport type { StickyEnlargeTrigger } from \"@/model/action\";\nimport type { Board } from \"@/model/board\";\nimport type { Card } from \"@/model/card\";\nimport type { ServerTime } from \"@/model/timer\";\n\nimport EventBus from \"./EventBus\";\n\nexport const sendSetting = (name: string, value: unknown) => sendKeyEvent(\"setting\", name, value);\nexport const sendBoardSwitch = () => sendEvent(\"boardSwitch\");\nexport const sendServerTick = (serverTime: ServerTime) => sendEvent(\"serverTick\", serverTime);\nexport const sendBoardLoaded = (boardId?: Board[\"id\"]) => sendEvent(\"boardLoaded\", boardId);\nexport const sendOpenNavigation = (item: \"team\") => sendEvent(\"openNavigation\", item);\n\n// ------------------------------ New sticky note actions ------------------------------\n\ninterface StickyNoteActionBase {\n action: T;\n id: Card[\"id\"];\n}\n\nexport type StickyNoteEnlarge = StickyNoteActionBase<\"enlarge\"> & {\n focus?: boolean;\n trigger: StickyEnlargeTrigger;\n};\nexport type StickyNoteShrink = StickyNoteActionBase<\"shrink\">;\ntype StickyNoteChanged = StickyNoteActionBase<\"changed\">;\n\nexport type StickyNoteAction = StickyNoteEnlarge | StickyNoteShrink | StickyNoteChanged;\n\ntype StickyNoteActionPayloads = {\n [K in StickyNoteAction[\"action\"]]: Omit, \"id\">;\n};\n\nexport const sendStickyNoteAction = (\n id: string,\n action: StickyNoteActionPayloads[T],\n) => {\n sendEvent(\"stickyNoteAction\", { id, ...action });\n};\n\nexport type EventType =\n | \"boardSwitch\"\n | \"setting\"\n | \"message\"\n | \"serverTick\"\n | \"stickyNoteAction\"\n | \"boardLoaded\"\n | \"openNavigation\";\n\nfunction sendEvent(name: EventType, data?: unknown): void {\n EventBus.emit(name, data);\n}\n\nfunction sendKeyEvent(name: EventType, key: string, data?: unknown) {\n EventBus.emit(name, { key, value: data });\n}\n\nexport function useEventBus() {\n const callbacks = new Array<{\n name: EventType;\n action: (e: unknown) => void;\n }>();\n\n onUnmounted(() => {\n for (const callback of callbacks) {\n EventBus.off(callback.name, callback.action);\n }\n });\n\n function onBoardSwitch(callback: () => void) {\n onEvent(\"boardSwitch\", callback);\n }\n\n function onServerTick(callback: (serverTime: ServerTime) => void) {\n onEvent(\"serverTick\", callback);\n }\n\n function onOpenNavigation(callback: (item: \"team\") => void) {\n onEvent(\"openNavigation\", callback);\n }\n\n function onStickyNoteAction(\n id: Card[\"id\"] | null,\n action: T,\n callback: (action: Extract) => void,\n ) {\n onEvent(\"stickyNoteAction\", (e: StickyNoteAction) => {\n if (id === null && e.action === action) {\n callback(e as Extract);\n return;\n }\n\n if (e.id === id && e.action === action) {\n callback(e as Extract);\n }\n });\n }\n\n function onEvent(name: EventType, action: (e?: any) => void) {\n callbacks.push({ name, action });\n EventBus.on(name, action);\n }\n\n return { onBoardSwitch, onServerTick, onOpenNavigation, onStickyNoteAction };\n}\n","import { captureException } from \"@sentry/vue\";\nimport { isArray } from \"lodash-es\";\n\ninterface SerDes {\n serialize?: (value: T) => unknown;\n deserialize?: (data: unknown) => T | undefined;\n}\n\nexport class LocalStore {\n saveTimeout = -1;\n saveDelay: number;\n serialize: (value: T) => unknown;\n deserialize: (data: unknown) => T | undefined;\n\n constructor(\n private name: string,\n options: { sedes?: SerDes; saveDelay?: number } = {},\n ) {\n this.saveDelay = options.saveDelay ?? 0;\n this.serialize = options.sedes?.serialize ?? ((value: T) => value);\n this.deserialize = options.sedes?.deserialize ?? ((data: unknown) => data as T); // unsafe cast\n }\n\n load(): T | undefined {\n const raw = localStorage.getItem(this.name);\n if (raw === null) {\n return this.deserialize(undefined);\n }\n try {\n return this.deserialize(JSON.parse(raw));\n } catch (e) {\n captureException(e);\n return this.deserialize(undefined);\n }\n }\n\n save(value: T) {\n if (!this.saveDelay) {\n this.doSave(value);\n } else {\n window.clearTimeout(this.saveTimeout);\n this.saveTimeout = window.setTimeout(() => this.doSave(value), this.saveDelay);\n }\n }\n\n doSave(value: T) {\n localStorage.setItem(this.name, JSON.stringify(this.serialize(value)));\n }\n}\n\nexport function versioned(version: number): SerDes {\n return {\n serialize: (value: T) => [version, value],\n deserialize: (data: unknown) =>\n isArray(data) && data.length === 2 && data[0] === version ? data[1] : undefined,\n };\n}\n","/**\n * Converts specific characters from a string into their corresponding HTML entities.\n */\nexport function convertCharToHtmlEntity(s: string, i: number) {\n const c = s.charAt(i);\n if (c === \"\\n\") {\n return \"
\";\n }\n if (c === \" \" && s.charAt(i - 1) === \" \") {\n return \" \";\n }\n if (c === \"<\") {\n return \"<\";\n }\n if (c === \"&\") {\n return \"&\";\n }\n return c;\n}\n\nexport function unique(name: string, exists: (name: string) => boolean) {\n let suffix = \"\";\n while (exists(name + suffix)) {\n suffix = suffix ? \"\" + (+suffix + 1) : \"2\";\n }\n return name + suffix;\n}\n\nexport function toKebabCase(str = \"\"): string {\n return str\n .replace(/([a-z])([A-Z])/g, \"$1-$2\")\n .replace(/[\\s_]+/g, \"-\")\n .toLowerCase();\n}\n\nexport function toSnakeCase(str = \"\"): string {\n return toKebabCase(str).replace(/-/g, \"_\");\n}\n","import type { StatusDistributionSource } from \"@/components/StatusDistribution/StatusDistribution\";\nimport type { Level } from \"@/components/modal/stickyLink/types\";\nimport type {\n ActionSource,\n BaseTrigger,\n StickyDragTrigger,\n StickyEnlargeTrigger,\n Trigger,\n} from \"@/model/action\";\nimport type { BoardType } from \"@/model/baseTypes\";\nimport type { Board } from \"@/model/board\";\nimport type { Functionality } from \"@/model/stickyType\";\nimport type { BoardHistoryTab, DateFilter } from \"@/store/activity\";\n\nimport { toSnakeCase } from \"../text/text\";\nimport type { AnalyticsEvent, TrackingParams } from \"./types\";\n\n/**\n * Handler to transform 'action' events into amplitude format\n *\n * NOTE: these events are more generic, so may be duplicated by other, more specific events\n */\nexport const actionEvent = ({\n eventName,\n source,\n params,\n}: {\n eventName: string;\n source: ActionSource;\n params?: TrackingParams;\n}): AnalyticsEvent => {\n // Transform event name to snake case (action events are in dot.separated.camelCase)\n // eg. \"board.workModeChanged\" -> \"board.work_mode_changed\"\n const event = `web.action.${toSnakeCase(eventName)}`;\n return {\n event,\n trigger: source,\n ...params,\n };\n};\n\n/**\n * Generic event fired anytime the modal is opened\n */\nexport const modalOpened = (\n trigger: Trigger,\n modalName?: string,\n params?: TrackingParams,\n): AnalyticsEvent => ({\n event: \"web.modal.opened\",\n trigger,\n modalName,\n ...params,\n});\n\n/**\n * Generic event fired anytime the modal is closed\n */\nexport const modalClosed = (trigger: Trigger, modalName?: string): AnalyticsEvent => ({\n event: \"web.modal.closed\",\n trigger,\n modalName,\n});\n\n/**\n * Called when the user leaves the app (eg. closes the tab)\n */\nexport const appClosed = (): AnalyticsEvent => ({\n event: \"web.app.closed\",\n});\n\n/**\n * Fired when a board is activated (equivalent to a pageview)\n * NOTE: This generally won't fire when switching between two boards\n * of the same type, eg. from one team board to another\n */\nexport const boardActivated = ({\n type,\n id,\n teamId,\n artId,\n}: {\n type: BoardType;\n id: Board[\"id\"];\n artId: Board[\"artId\"];\n teamId?: string;\n}): AnalyticsEvent => ({\n event: \"web.board.activated\",\n toBoard: type,\n boardId: id,\n artId,\n teamId,\n});\n\n/**\n * Fired when a board is deactivated (ie. user is leaving the board)\n * NOTE: This generally won't fire when switching between two boards\n * of the same type, eg. from one team board to another\n */\nexport const boardDeactivated = ({\n type,\n id,\n teamId,\n artId,\n}: {\n type: BoardType;\n id: Board[\"id\"];\n artId: Board[\"artId\"];\n teamId?: string;\n}): AnalyticsEvent => ({\n event: \"web.board.deactivated\",\n toBoard: type,\n boardId: id,\n artId,\n teamId,\n});\n\n/**\n * Triggered when the user switches tabs in the plan readout modal\n */\nexport const planReadoutTabClicked = (fromTab: string, toTab: string): AnalyticsEvent => {\n return {\n event: \"web.plan_readout_modal.tab_clicked\",\n fromTab,\n toTab,\n };\n};\n\n/**\n * Triggered when the user switches teams in the plan readout modal\n *\n * @param teamId ID of the team the user switched to\n * @param source Whether the user used the dropdown or the arrows to switch teams\n */\nexport const planReadoutTeamChanged = (\n teamId: string,\n source: \"dropdown\" | \"arrows\",\n): AnalyticsEvent => {\n return {\n event: \"web.plan_readout_modal.team_changed\",\n teamId,\n source,\n };\n};\n\n/**\n * Triggered when the user clicks on an objective in the plan readout modal\n */\nexport const planReadoutSelectObjective = (\n objectiveId: string,\n isStretch: boolean,\n): AnalyticsEvent => {\n return {\n event: \"web.app.plan_readout_modal.objective_selected\",\n objectiveId,\n isStretch,\n };\n};\n\n/**\n * Triggered when the user clicks on a risk in the plan readout modal\n */\nexport const planReadoutSelectRisk = (): AnalyticsEvent => {\n return {\n event: \"web.plan_readout_modal.risk_selected\",\n };\n};\n\n/**\n * Triggered when the expands/shrinks the 'linked stickies' section\n *\n * @param open True when the section is opened\n */\nexport const planReadoutObjectiveLinksToggled = (open: boolean): AnalyticsEvent => {\n return {\n event: \"web.plan_readout_modal.objective_links_toggled\",\n open,\n };\n};\n\n/***\n * OBJECTIVES\n ***/\n\n// Triggered when the user marks an objective as committed / uncommmitted\nexport const objectiveMarkedAs = (id: string, isStretch: boolean): AnalyticsEvent => {\n return {\n event: \"web.team_objectives_modal.objective_marked_as\",\n objectiveId: id,\n isStretch,\n };\n};\n\n/***\n * GENERAL SETTINGS\n ***/\n\n/**\n * Triggered when the tab's visibility state changes\n * https://developer.mozilla.org/en-US/docs/Web/API/Document/visibilitychange_event\n */\nexport const tabVisibilityStateChanged = (visibility: \"hidden\" | \"visible\"): AnalyticsEvent => ({\n event: \"web.tab_visibility_state_changed\",\n visibility,\n});\n\n/**\n * Triggered when the user changes a setting in the Settings Modal\n */\nexport function userSettingChanged({\n key,\n fromValue,\n toValue,\n}: {\n key: string;\n fromValue?: string;\n toValue?: string;\n}): AnalyticsEvent {\n return {\n event: \"web.user_setting.changed\",\n key,\n fromValue,\n toValue,\n };\n}\n\n/***\n * STICKY NOTE\n ***/\n\n/**\n * Triggered after user create a sticky note\n */\nexport const stickyNoteCreated = (\n functionality: Functionality,\n fromBoard: BoardType,\n trigger: Trigger,\n fromDefault?: boolean,\n): AnalyticsEvent => ({\n event: \"web.sticky_note.created\",\n functionality,\n fromBoard,\n trigger,\n fromDefault,\n});\n\n// Triggered when the user pins the sticky note\nexport const stickyNotePinned = (\n functionality: Functionality,\n trigger: Extract,\n): AnalyticsEvent => ({\n event: \"web.sticky_note.pinned\",\n functionality,\n trigger,\n});\n\n// Triggered when the user unpins the sticky note\nexport const stickyNoteUnpinned = (\n functionality: Functionality,\n trigger: Extract,\n): AnalyticsEvent => ({\n event: \"web.sticky_note.unpined\",\n functionality,\n trigger,\n});\n\n/**\n * Triggered when the user opens a chip in the StickyNote\n */\nexport const stickyNoteAttributeChipClicked = (\n chipName: string,\n functionality: Functionality,\n isStickyActive: boolean,\n): AnalyticsEvent => ({\n event: \"web.sticky_note.attribute_chip_clicked\",\n functionality,\n chipName,\n isStickyActive,\n});\n\n// Triggered when the user opens an item in the action menu of the StickyNote\nexport const stickyNoteActionMenuItemClicked = (\n itemName: string,\n functionality: Functionality,\n): AnalyticsEvent => ({\n event: \"web.sticky_note.action_menu_item_clicked\",\n functionality,\n chipName: itemName,\n});\n\nexport const shapeActionMenuItemClicked = (itemName: string): AnalyticsEvent => ({\n event: \"web.shape.action_menu_item_clicked\",\n chipName: itemName,\n});\n\n// Triggered when the status distribution popup is shown\nexport const statusDistributionShown = (\n statusDistributionType: StatusDistributionSource,\n): AnalyticsEvent => ({\n event: \"web.status_distribution.shown\",\n statusDistributionType,\n});\n\n// Triggered when the status distribution popup is hidden\nexport const statusDistributionHidden = (\n statusDistributionType: StatusDistributionSource,\n): AnalyticsEvent => ({\n event: \"web.status_distribution.hidden\",\n statusDistributionType,\n});\n\n// Triggered when the user adds a timer\nexport const timerAdded = (timerScope: \"board\" | \"art\"): AnalyticsEvent => ({\n event: \"web.timer.added\",\n timerScope,\n});\n\n// Triggered when the user starts a timer\nexport const timerStarted = (timerScope: \"board\" | \"art\"): AnalyticsEvent => ({\n event: \"web.timer.started\",\n timerScope,\n});\n\n// Triggered when the user opens the search sidebar\nexport const searchOpened = (trigger: Trigger): AnalyticsEvent => ({\n event: \"web.search.opened\",\n trigger,\n});\n\n// Triggered when the user closes the search sidebar\nexport const searchClosed = (trigger: Trigger, keepFilters?: boolean): AnalyticsEvent => ({\n event: \"web.search.closed\",\n keepFilters,\n trigger,\n});\n\n// Triggered when the user opens the board history panel\nexport const boardHistoryOpened = (trigger: Trigger): AnalyticsEvent => ({\n event: \"web.board_history.opened\",\n trigger,\n});\n\n// Triggered when the user closes the board history panel\nexport const boardHistoryClosed = (trigger: Trigger): AnalyticsEvent => ({\n event: \"web.board_history.closed\",\n trigger,\n});\n\n// Triggered when the user opens a sticky note diff\nexport const boardHistoryItemOpened = (tab: BoardHistoryTab): AnalyticsEvent => ({\n event: \"web.board_history.item_opened\",\n tab,\n});\n\n// Triggered when the user closes a sticky note diff\nexport const boardHistoryItemClosed = (tab: BoardHistoryTab): AnalyticsEvent => ({\n event: \"web.board_history.item_closed\",\n tab,\n});\n\n// Triggered when the user changes the timespan in the board diff dropdown\nexport const boardHistoryTimespanChanged = (\n timespan: DateFilter[\"id\"],\n tab: string,\n): AnalyticsEvent => ({\n event: \"web.board_history.timespan_changed\",\n timespan,\n tab,\n});\n\n// Triggered when the user changes the iteration/type/change-type filter\nexport const boardHistoryFilterChanged = ({\n filterName,\n selectedValues,\n tab,\n}: {\n filterName: \"iteration\" | \"sticky-type\" | \"change-type\";\n selectedValues: string[];\n tab: BoardHistoryTab;\n}): AnalyticsEvent => ({\n event: \"web.board_history.filter_changed\",\n filterName,\n selectedValues,\n tab,\n});\n\n// Triggered when the user changes between log & compare tabs\nexport const boardHistoryTabChanged = (tab: BoardHistoryTab): AnalyticsEvent => ({\n event: \"web.board_history.tab_changed\",\n tab,\n});\n\n// Triggered when the user changes the tab in any tabbed modal\nexport const modalTabChanged = (tab: string): AnalyticsEvent => ({\n event: \"web.modal.tab_changed\",\n tab,\n});\n\n// Triggered when the user opens a search filter\nexport const searchFilterOpened = (filterName: string): AnalyticsEvent => ({\n event: \"web.search.filter_opened\",\n filterName,\n});\n\n// when the user opens the app zoom menu in the top right corner of the app\nexport const appZoomOpened = (): AnalyticsEvent => ({\n event: \"web.topbar-menu.app_zoom_opened\",\n});\n\n// Triggered when the user changes the zoom level using the app zoom slider\n// or the +/- buttons at the top right corner of the app\nexport const appZoomZoomChanged = (): AnalyticsEvent => ({\n event: \"web.topbar-menu.app_zoom_changed\",\n});\n\n// triggered when the user deactivates a StickyNote.\nexport const stickyNoteDeactivated = (functionality: Functionality): AnalyticsEvent => ({\n event: \"web.sticky_note.deactivated\",\n functionality,\n});\n\n// triggered when the user activates a StickyNote.\nexport const stickyNoteActivated = (functionality: Functionality): AnalyticsEvent => ({\n event: \"web.sticky_note.activated\",\n functionality,\n});\n\n// triggered when the user changes the text of a StickyNote. Triggered only once per focus\nexport const stickyNoteTextChanged = (\n functionality: Functionality,\n textLengthBeforeEdit: number,\n): AnalyticsEvent => ({\n event: \"web.sticky_note.text_changed\",\n functionality,\n textLengthBeforeEdit,\n});\n\n// triggered when the user enlarges the StickyNote.\nexport const stickyNoteEnlarged = (\n functionality: Functionality,\n trigger: StickyEnlargeTrigger,\n): AnalyticsEvent => ({\n event: \"web.sticky_note.enlarged\",\n functionality,\n trigger,\n});\n\n// triggered when the user shrinks the StickyNote.\nexport const stickyNoteShrunk = (functionality: Functionality): AnalyticsEvent => ({\n event: \"web.sticky_note.shrunk\",\n functionality,\n});\n\n// triggered when the user changes the search text. Triggered once per focus\nexport const searchTextChanged = (): AnalyticsEvent => ({\n event: \"web.search.text_changed\",\n});\n\n// triggered when the user select an item in the search sidebar\nexport const searchItemSelected = (fromBoard: BoardType, toBoard?: BoardType): AnalyticsEvent => ({\n event: \"web.search.item_selected\",\n fromBoard,\n toBoard,\n});\n\n// triggers when the user clicks the link drag on the sticky nore\nexport const stickyNoteLinkDragStarted = (\n functionality: Functionality,\n trigger: Trigger,\n): AnalyticsEvent => ({\n event: \"web.sticky_note.link_drag_started\",\n functionality,\n trigger,\n});\n\n// when the user opens the user actions menu at the top right corner of the app\nexport const userActionsMenuOpened = (): AnalyticsEvent => ({\n event: \"web.app.user_actions_menu_opened\",\n});\n\nexport const bottomMenuToggled = (open: boolean): AnalyticsEvent => ({\n event: \"web.app.bottom_menu_toggled\",\n open,\n});\n\n/**\n * Drag Events\n */\nexport const stickyNoteDragStarted = (trigger: StickyDragTrigger): AnalyticsEvent => ({\n event: \"web.sticky_note.drag_started\",\n trigger,\n});\nexport const stickyNoteDragMoved = (trigger: StickyDragTrigger): AnalyticsEvent => ({\n event: \"web.sticky_note.drag_moved\",\n trigger,\n});\nexport const stickyNoteDragEnded = (trigger: StickyDragTrigger): AnalyticsEvent => ({\n event: \"web.sticky_note.drag_ended\",\n trigger,\n});\n\n/**\n * STATUS PAGE & ERROR MODAL\n */\n// When a globalError is set (opening the error dialog)\nexport const errorDialogSeen = (): AnalyticsEvent => ({\n event: \"web.error_dialog.seen\",\n});\n\n// When the user clicks the reload button in the error dialog\nexport const errorDialogReloadClicked = (): AnalyticsEvent => ({\n event: \"web.error_dialog.reload_clicked\",\n});\n\n// When the user clicks the status link in the error dialog\nexport const errorDialogStatusLinkClicked = (): AnalyticsEvent => ({\n event: \"web.error_dialog.status_link_clicked\",\n});\n\n// When the user clicks the connection status link in the user menu\nexport const userMenuStatusLinkClicked = (): AnalyticsEvent => ({\n event: \"web.user_menu.status_link_clicked\",\n});\n\n/**\n * LINK MODAL\n */\n\n// Triggered when search is used\nexport const linkModalSearchUsed = (): AnalyticsEvent => ({\n event: \"web.link_modal.search_used\",\n});\n\n// Triggered when expand/collapse Org Tree button is used\nexport const linkModalOrgTreeToggled = (): AnalyticsEvent => ({\n event: \"web.link_modal.org_tree_toggled\",\n});\n\n// Triggered when Org Tree level is selected\nexport const linkModalOrgTreeLevelSelected = (level: Level): AnalyticsEvent => ({\n event: \"web.link_modal.org_tree_level_selected\",\n level,\n});\n\n// Triggered when filter is opened\nexport const linkModalFilterOpened = (): AnalyticsEvent => ({\n event: \"web.link_modal.filter_opened\",\n});\n\n// Triggered when filter type is selected\nexport const linkModalFilterTypeSelected = (\n functionality: Functionality | \"objective\",\n): AnalyticsEvent => ({\n event: \"web.link_modal.filter_type_selected\",\n functionality,\n});\n\n// Triggered when filter type is deselected\nexport const linkModalFilterTypeDeselected = (\n functionality: Functionality | \"objective\",\n): AnalyticsEvent => ({\n event: \"web.link_modal.filter_type_deselected\",\n functionality,\n});\n\n/**\n * DRAW MODE\n */\nexport const drawShapeSelected = (): AnalyticsEvent => ({\n event: \"web.draw_mode.shape_selected\",\n});\n\nexport const drawTextEdited = (): AnalyticsEvent => ({\n event: \"web.draw_mode.text_edited\",\n});\nexport const drawAlignEdited = (): AnalyticsEvent => ({\n event: \"web.draw_mode.align_edited\",\n});\n\n/**\n * SWITCH SESSION\n */\n\nexport const switchSessionOrgTreeLevelSelected = (level: Level): AnalyticsEvent => ({\n event: \"web.switch_session.org_tree_level_selected\",\n level,\n});\n\nexport const kanbanBoardFilterUsed = (\n filter: \"user\" | \"type\" | \"text\" | \"art\" | \"team\",\n): AnalyticsEvent => ({\n event: \"web.kanban_board.filter_used\",\n kanbanBoardFilter: filter,\n});\n\nexport const kanbanBoardFiltersCleared = (): AnalyticsEvent => ({\n event: \"web.kanban_board.filters_cleared\",\n});\n\nexport const kanbanBoardStickyChipClicked = (chipName: string): AnalyticsEvent => ({\n event: \"web.kanban_board.sticky_chip_clicked\",\n chipName,\n});\n\nexport const kanbanBoardStickyDragStarted = (): AnalyticsEvent => ({\n event: \"web.kanban_board.sticky_drag_started\",\n});\n\nexport const kanbanBoardHorizontalScrollUsed = (): AnalyticsEvent => ({\n event: \"web.kanban_board.horizontal_scroll_used\",\n});\n\n/**\n * INTERCOM\n */\n// This is a passive event, called by Intercom when the messenger is shown\n// (whether it was opened by the user or by Intercom)\nexport const intercomMessengerShown = (): AnalyticsEvent => ({\n event: \"web.intercom.messenger_shown\",\n});\n\n// Passive event, called by Intercom when the messenger is hidden\nexport const intercomMessengerHidden = (): AnalyticsEvent => ({\n event: \"web.intercom.messenger_hidden\",\n});\n\n// When the user clicks the 'MessengerItem' button\nexport const intercomTriggerClicked = (): AnalyticsEvent => ({\n event: \"web.intercom.trigger_clicked\",\n});\n","/** coordinate systems:\n - window (center of a card), delivered by mouse input\n - card (scaled by zoom, relative to a certain card)\n - board (scaled by zoom, limited by border for the top left corner of a card, used to draw card)\n - relative (0..1 for the center of a card, used for backend)\n */\nexport type WindowCoordinate = Coordinate & { _type: \"window\" };\nexport type BoardCoordinate = Coordinate & { _type: \"board\" };\nexport type RelativeCoordinate = Coordinate & { _type: \"relative\" };\nexport type AnyCoordinate = WindowCoordinate | BoardCoordinate | RelativeCoordinate;\n\ninterface Coordinate {\n x: number;\n y: number;\n}\n\nexport type CoordinateComponent = \"x\" | \"y\";\n\nexport interface Rectangle {\n p0: T;\n p1: T;\n}\n\nexport type Line = Rectangle;\n\nexport type LineComponent = \"p0\" | \"p1\";\n\nexport function oppositeLineComponent(c: LineComponent) {\n return c === \"p0\" ? \"p1\" : \"p0\";\n}\n\nexport function isCoordinate(c?: unknown): c is Coordinate {\n return !!c && (c as Coordinate).x !== undefined;\n}\n\nexport function relativeCoord(x: number, y: number): RelativeCoordinate {\n return { x, y } as RelativeCoordinate;\n}\n\nexport function windowCoord(x: number, y: number): WindowCoordinate {\n return { x, y } as WindowCoordinate;\n}\n\nexport function boardCoord(x: number, y: number): BoardCoordinate {\n return { x, y } as BoardCoordinate;\n}\n\nexport const offScreen = relativeCoord(-10, -10);\n\nexport function isOffScreen(c: RelativeCoordinate) {\n return c.x === offScreen.x && c.y === offScreen.y;\n}\n","import { clamp } from \"lodash-es\";\n\nimport type { AnyCoordinate, Line, Rectangle, RelativeCoordinate } from \"@/model/coordinates\";\nimport { relativeCoord } from \"@/model/coordinates\";\n\nexport function rectangle(\n value: { from: T; to: T } | { center: T; size: T } | { from: T; size: T },\n): Rectangle {\n if (\"from\" in value && \"to\" in value) {\n return {\n p0: value.from,\n p1: value.to,\n };\n }\n\n if (\"center\" in value && \"size\" in value) {\n const halfSize = divided(value.size, 2);\n return {\n p0: minus(value.center, halfSize),\n p1: plus(value.center, halfSize),\n };\n }\n\n return { p0: value.from, p1: plus(value.from, value.size) };\n}\n\nexport function add(a: T, b: T) {\n a.x += b.x;\n a.y += b.y;\n}\n\nexport function plus(a: T, b: T): T {\n return { x: a.x + b.x, y: a.y + b.y } as T;\n}\n\nexport function minus(a: T, b?: T): T {\n return (b ? { x: a.x - b.x, y: a.y - b.y } : { x: -a.x, y: -a.y }) as T;\n}\n\nexport function times(a: T, factor1: number, factor2?: number): T {\n return { x: a.x * factor1, y: a.y * (factor2 ?? factor1) } as T;\n}\n\nexport function divided(a: T, factor1: number, factor2?: number): T {\n return { x: a.x / factor1, y: a.y / (factor2 ?? factor1) } as T;\n}\n\nexport function max(...as: T[]) {\n return as.reduce((res, a) => ({ x: Math.max(res.x, a.x), y: Math.max(res.y, a.y) }) as T, {\n x: -Infinity,\n y: -Infinity,\n } as T);\n}\n\nexport function min(...as: T[]) {\n return as.reduce((res, a) => ({ x: Math.min(res.x, a.x), y: Math.min(res.y, a.y) }) as T, {\n x: Infinity,\n y: Infinity,\n } as T);\n}\n\nexport function toSize(a: T) {\n return { width: a.x, height: a.y };\n}\n\nconst ETA = 0.000001;\n\nexport function isEqual(a: RelativeCoordinate, b: RelativeCoordinate) {\n return isNear(a.x, b.x) && isNear(a.y, b.y);\n}\n\nfunction isNear(a: number, b: number) {\n return Math.abs(a - b) < ETA;\n}\n\nexport function distance2(a: T, b: T): number {\n return (a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y);\n}\n\nexport function interpolate(v: number, a: T, b: T): T {\n return { x: a.x - v * (a.x - b.x), y: a.y - v * (a.y - b.y) } as T;\n}\n\nexport function insideRectangle(c: T, r: Rectangle) {\n return c.x >= r.p0.x && c.x <= r.p1.x && c.y >= r.p0.y && c.y <= r.p1.y;\n}\n\nexport function rectangleSize(r: Rectangle) {\n return minus(r.p1, r.p0);\n}\n\nexport function clampRelativeCoord(c: RelativeCoordinate): RelativeCoordinate {\n return relativeCoord(clamp(c.x, 0, 1), clamp(c.y, 0, 1));\n}\n\n/**\n * Return the point on the line that is nearest the given point.\n * @return {\n * t: the fractional position along the line 0..1 (0: p0, 1: p1, 0.5: middle of the line),\n * point: the point itself\n * }\n */\nexport function nearestLinePoint(point: T, line: Line) {\n const len = distance2(line.p0, line.p1);\n const t =\n ((point.x - line.p0.x) * (line.p1.x - line.p0.x) +\n (point.y - line.p0.y) * (line.p1.y - line.p0.y)) /\n len;\n return { t, point: interpolate(clamp(t, 0, 1), line.p0, line.p1) };\n}\n\nexport function isHorizontal(line: Line) {\n return Math.abs(line.p0.y - line.p1.y) < ETA;\n}\n","import { divided } from \"@/math/coordinates\";\nimport type { WindowCoordinate } from \"@/model/coordinates\";\nimport { windowCoord } from \"@/model/coordinates\";\n\nexport function scrollCoord(): WindowCoordinate {\n return windowCoord(window.scrollX, window.scrollY);\n}\n\nexport function centerCoord() {\n return divided(windowSize(), 2);\n}\n\n// complete window size\nexport function windowSize() {\n return windowCoord(window.innerWidth, window.innerHeight);\n}\n\n// window size without scroll bars\nexport function contentSize() {\n return clientSize(document.documentElement);\n}\n\nexport function clientCoord(elem: MouseEvent): WindowCoordinate {\n return windowCoord(elem.clientX, elem.clientY);\n}\n\nexport function offsetCoord(e: MouseEvent): WindowCoordinate {\n return windowCoord(e.offsetX, e.offsetY);\n}\n\nexport function scrollSize(el: Element): WindowCoordinate {\n return windowCoord(el.scrollWidth, el.scrollHeight);\n}\n\nexport function clientSize(el: Element): WindowCoordinate {\n return windowCoord(el.clientWidth, el.clientHeight);\n}\n\nexport function offsetSize(el: HTMLElement): WindowCoordinate {\n return windowCoord(el.offsetWidth, el.offsetHeight);\n}\n\nexport function boundsCoord(elem: HTMLElement): WindowCoordinate {\n const { left, top } = elem.getBoundingClientRect();\n return windowCoord(left, top);\n}\n","import { contentSize } from \"./coordinates\";\n\nexport interface ElementState {\n elements: Array<{\n element: HTMLElement;\n }>;\n activeElement: HTMLElement | null;\n}\n\n/**\n * Hides the specified elements by setting their display property to \"none\".\n * Returns the state of the elements before hiding.\n *\n * @param elements - The list of elements to hide.\n * @returns The state of the elements before hiding.\n */\nexport function hideElements(elements: NodeListOf): ElementState {\n const state: ElementState = {\n elements: [],\n activeElement: document.activeElement as HTMLElement | null,\n };\n\n elements.forEach((element) => {\n element.style.display = \"none\";\n\n if (!element.classList.contains(\"moving\") && !element.classList.contains(\"deleting\")) {\n state.elements.push({ element });\n }\n });\n\n return state;\n}\n\n/**\n * Shows the elements in the given state by setting their display style to an empty string.\n * If there is an active element in the state, it will be focused.\n *\n * @param state - The element state containing the elements to be shown.\n */\nexport function showElements(state: ElementState) {\n state.elements.forEach((item) => {\n item.element.style.display = \"\";\n });\n\n // only focus when the sticky note is inside the viewport\n const stickyNoteEl = state.activeElement?.closest(\".sticky-note\");\n\n if (!stickyNoteEl) return;\n if (!isElementInViewport(stickyNoteEl)) return;\n\n state.activeElement?.focus?.();\n}\n\nexport function isBrowserTabActive() {\n return document.visibilityState !== \"hidden\";\n}\n\nexport function createTspan(text: string, x: number, y: number) {\n const tspan = document.createElementNS(\"http://www.w3.org/2000/svg\", \"tspan\");\n tspan.appendChild(document.createTextNode(text));\n tspan.setAttribute(\"x\", \"\" + x);\n tspan.setAttribute(\"y\", \"\" + y);\n return tspan;\n}\n\nexport async function fontsLoaded() {\n const fonts = document.fonts;\n return fonts ? fonts.ready : Promise.resolve();\n}\n\nexport function terminateEvent(event: Event) {\n event.stopPropagation();\n event.preventDefault();\n}\n\nexport function addFontFamily(el: HTMLElement, fontFamily: string) {\n fontFamily = `\"${fontFamily}\"`;\n const fonts = getComputedStyle(el).fontFamily.split(/,\\s*/);\n if (!fonts.includes(fontFamily)) {\n // add it at second position: behind default font, but before all fallbacks\n fonts.splice(1, 0, fontFamily);\n el.style.fontFamily = fonts.join(\",\");\n }\n}\n\n/**\n * Checks if the scrollbars are visible in the current document.\n *\n * @returns An object with properties `x` and `y` indicating if\n * the horizontal and vertical scrollbars are visible, respectively.\n */\nexport function isScrollbarVisible(): { x: boolean; y: boolean } {\n const documentElement = document.documentElement;\n const hasVerticalScrollbar = documentElement.scrollHeight > documentElement.clientHeight;\n const hasHorizontalScrollbar = documentElement.scrollWidth > documentElement.clientWidth;\n\n return { x: hasHorizontalScrollbar, y: hasVerticalScrollbar };\n}\n\n/**\n * This function creates a temporary block element and calculates the size\n * of the scrollbar by comparing the width of the block element with and\n * without the scrollbar.\n *\n * @returns The size of the scrollbar in pixels.\n */\nexport function getScrollbarSize() {\n // Create a temporary block element\n const outer = document.createElement(\"div\");\n outer.style.visibility = \"hidden\";\n outer.style.overflow = \"scroll\"; // Force scrollbar to appear\n document.body.appendChild(outer);\n\n // Create an inner div and append it to the outer div\n const inner = document.createElement(\"div\");\n outer.appendChild(inner);\n\n // Calculate the scrollbar sizes\n const size = outer.offsetWidth - inner.offsetWidth;\n\n // Remove the temporary elements from the body\n outer.parentNode!.removeChild(outer);\n\n return size;\n}\n\nexport function isElementInViewport(el?: HTMLElement): boolean {\n if (!el) return false;\n const rect = el.getBoundingClientRect();\n const content = contentSize();\n return rect.top >= 0 && rect.left >= 0 && rect.bottom <= content.y && rect.right <= content.x;\n}\n\nexport const isMac = navigator.platform.includes(\"Mac\");\n\nexport const isFirefox = navigator.userAgent.toLowerCase().includes(\"firefox\");\n\nexport const lineSeparator = navigator.userAgent.indexOf(\"Windows\") < 0 ? \"\\n\" : \"\\r\\n\";\n\nexport function whenChildElementWithClass(\n element: Element,\n className: string,\n action: (child: Element) => void,\n) {\n const child = element.querySelector(`.${className}`);\n if (child) {\n action(child);\n } else {\n const observer = new window.MutationObserver((mutationList) => {\n for (const mutation of mutationList) {\n mutation.addedNodes.forEach((node) => {\n if (node instanceof Element && node.classList.contains(className)) {\n observer.disconnect();\n action(node);\n }\n });\n }\n }, true);\n observer.observe(element, { childList: true });\n setTimeout(() => observer.disconnect(), 10000);\n }\n}\n\nexport function eventTarget(e: Event): T | null {\n return e.target as T;\n}\n\nexport function isInput(el: HTMLElement) {\n return [\"INPUT\", \"TEXTAREA\", \"SELECT\"].includes(el.nodeName);\n}\n\nexport function stopScrollPropagation(e: WheelEvent) {\n const currentTarget = e.currentTarget as HTMLElement;\n if (\n (e.deltaY < 0 && currentTarget.scrollTop === 0) ||\n (e.deltaY > 0 &&\n currentTarget.scrollTop === currentTarget.scrollHeight - currentTarget.offsetHeight)\n ) {\n e.preventDefault();\n }\n}\n\nexport function releaseCapture(e: PointerEvent) {\n document.documentElement.setPointerCapture?.(e.pointerId);\n document.documentElement.releasePointerCapture?.(e.pointerId);\n}\n\nexport function isLeftClick(e: PointerEvent) {\n // eslint-disable-next-line no-bitwise\n return (e.buttons & 1) === 1;\n}\n","export const logPerformance = toBoolean(\n window.LOG_PERFORMANCE || import.meta.env.VITE_LOG_PERFORMANCE,\n);\nexport const natsUrl = window.NATS_URL || import.meta.env.VITE_NATS_URL;\nexport const authAPIUrl = window.AUTH_API_URL || import.meta.env.VITE_AUTH_API_URL;\nexport const piserverAPIUrl = window.PISERVER_API_URL || import.meta.env.VITE_PISERVER_API_URL;\nexport const adminUrl = window.ADMIN_URL || import.meta.env.VITE_ADMIN_URL;\nexport const isCloud = toBoolean(window.IS_CLOUD || import.meta.env.VITE_IS_CLOUD);\n\nexport const sentryDsn = window.SENTRY_DSN || import.meta.env.VITE_SENTRY_DSN;\nexport const gaKey = window.GA_KEY || import.meta.env.VITE_GA_KEY;\nexport const featureProxyUrl = window.FEATURE_PROXY_URL || import.meta.env.VITE_FEATURE_PROXY_URL;\nexport const featureProxySecret =\n window.FEATURE_PROXY_SECRET || import.meta.env.VITE_FEATURE_PROXY_SECRET;\nexport const environment = window.ENVIRONMENT || import.meta.env.VITE_ENVIRONMENT;\nexport const intercomId = window.INTERCOM_ID || import.meta.env.VITE_INTERCOM_ID;\nexport const intercomApi = window.INTERCOM_API || import.meta.env.VITE_INTERCOM_API;\nexport const loginTimeout =\n Number(window.LOGIN_TIMEOUT || import.meta.env.VITE_LOGIN_TIMEOUT) || 5000;\nexport const build = {\n id: window.BUILD_ID || import.meta.env.VITE_BUILD_ID,\n hash: window.BUILD_HASH || import.meta.env.VITE_BUILD_HASH,\n time: new Date(window.BUILD_TIME || import.meta.env.VITE_BUILD_TIME),\n};\nexport const amplitudeApiKey = window.AMPLITUDE_API_KEY || import.meta.env.VITE_AMPLITUDE_API_KEY;\nexport const amplitudeDebug = toBoolean(\n window.AMPLITUDE_DEBUG || import.meta.env.VITE_AMPLITUDE_DEBUG,\n);\nexport const faroUrl = window.FARO_URL || import.meta.env.VITE_FARO_URL || undefined;\n\nexport function getConfig() {\n return {\n natsUrl,\n authAPIUrl,\n piserverAPIUrl,\n adminUrl,\n isCloud,\n sentryDsn,\n gaKey,\n environment,\n intercomId,\n intercomApi,\n build,\n amplitudeApiKey,\n amplitudeDebug,\n };\n}\n\nfunction toBoolean(value: string | undefined) {\n const val = value?.toLowerCase();\n return val === \"true\" || val === \"1\";\n}\n","import { UnleashClient } from \"unleash-proxy-client\";\n\nimport { environment, featureProxySecret, featureProxyUrl } from \"./Environment\";\nimport { setGitlabToggles } from \"./feature\";\n\ninterface FeatureToggles {\n isEnabled(toggleName: string): boolean;\n}\n\nexport let featureToggles: FeatureToggles = dummyToggles();\n\nexport async function initFeatureToggles(userId: string) {\n if (featureProxyUrl && featureProxySecret) {\n const unleash = unleashToggles();\n await unleash.updateContext({ userId });\n await unleash.start();\n featureToggles = unleash;\n\n setGitlabToggles(unleash.getAllToggles());\n }\n}\n\nfunction unleashToggles() {\n return new UnleashClient({\n url: featureProxyUrl,\n clientKey: featureProxySecret,\n appName: environment,\n refreshInterval: 60 * 60 * 12, // update toggles after 12h\n disableMetrics: true,\n });\n}\n\nfunction dummyToggles() {\n return {\n isEnabled(_toggleName: string) {\n return false;\n },\n };\n}\n","import { isArray } from \"lodash-es\";\nimport type { IToggle } from \"unleash-proxy-client\";\n\nimport { featureToggles } from \"./featureToggles\";\n\ninterface Feature {\n id: string;\n description: string;\n active?: boolean;\n fromGitlab?: boolean;\n}\n\nlet features: Feature[] = [\n {\n id: \"log-less\",\n description: \"Log less description\",\n },\n {\n id: \"faro\",\n description: \"Send events to faro\",\n },\n {\n id: \"faro-sample-all\",\n description: \"Faro sample all description\",\n },\n {\n id: \"board-log\",\n description: \"Activity log in board history panel\",\n },\n] as const;\n\nexport type FeatureId = (typeof features)[number][\"id\"];\n\nexport function isFeatureEnabled(\n route: { query: Record },\n featureId: FeatureId,\n): boolean {\n const found = features.find((f) => f.id === featureId);\n if (found?.active !== undefined) return found.active;\n\n return (\n !isFeatureEnabledInQuery(route, \"!\" + featureId) &&\n (isFeatureEnabledInQuery(route, featureId) || featureToggles.isEnabled(featureId))\n );\n}\n\nexport function parseUrlWithoutRouter() {\n const hash = document.location.hash;\n const queryStart = hash.indexOf(\"?\");\n if (queryStart < 0) {\n return {};\n }\n const params = new URLSearchParams(hash.substring(queryStart));\n const extractedParams: Record = {};\n for (const [key, value] of params) {\n if (extractedParams[key]) {\n extractedParams[key].push(value);\n } else {\n extractedParams[key] = [value];\n }\n }\n return extractedParams;\n}\n\nfunction isFeatureEnabledInQuery(\n route: { query: Record },\n feature: string,\n): boolean {\n if (!route?.query?.feature) {\n return false;\n }\n if (isArray(route.query.feature)) {\n return route.query.feature.includes(feature);\n }\n return route.query.feature === feature;\n}\n\nfunction broadcastAvailableFeatures(features: Feature[]) {\n window.postMessage({ type: \"SET_AVAILABLE_FEATURES\", features }, \"*\");\n}\n\nexport function broadcastFeatures() {\n window.addEventListener(\n \"extensionAvailable\",\n () => {\n broadcastAvailableFeatures(features);\n\n window.addEventListener(\"message\", (event) => {\n if (event.source !== window) return;\n\n if (event.data.type === \"FEATURES_UPDATED\") {\n features = event.data.features;\n\n void triggerSoftRefresh();\n }\n });\n },\n { once: true },\n );\n}\n\nexport function setGitlabToggles(toggles: IToggle[]) {\n window.postMessage({ type: \"SET_GITLAB_TOGGLED_FEATURES\", toggles }, \"*\");\n}\n\nasync function triggerSoftRefresh() {\n const { router } = await import(\"@/router/router\");\n const currentRoute = router?.currentRoute?.value;\n if (currentRoute && currentRoute.fullPath !== \"/\") {\n void router.replace({\n ...currentRoute,\n query: { ...currentRoute.query, _t: Date.now() },\n });\n }\n}\n","import type { SeverityLevel } from \"@sentry/types\";\nimport type { Contexts } from \"@sentry/types/types/context\";\nimport type {\n Breadcrumb,\n EventHint,\n Hub,\n configureScope,\n init,\n addBreadcrumb as sentryAddBreadcrumb,\n getCurrentHub as sentryGetCurrentHub,\n setUser as sentrySetUser,\n} from \"@sentry/vue\";\nimport { Replay } from \"@sentry/vue\";\nimport { ClientJS } from \"clientjs\";\nimport { noop } from \"lodash-es\";\nimport type { App } from \"vue\";\n\nimport { isBrowserTabActive } from \"@/utils/dom/dom\";\nimport { environment, isCloud, sentryDsn } from \"@/utils/env/Environment\";\nimport { isFeatureEnabled, parseUrlWithoutRouter } from \"@/utils/env/feature\";\n\ninterface SentryFns {\n init: typeof init;\n setUser: typeof sentrySetUser;\n configureScope: typeof configureScope;\n getCurrentHub: typeof sentryGetCurrentHub;\n addBreadcrumb: typeof sentryAddBreadcrumb;\n}\n\n/* eslint-disable no-console */\nconst consoleLogger: Record void> = {\n error: console.error,\n warning: console.warn,\n};\n\nfunction consoleLogException(exception: unknown, hint?: EventHint) {\n console.error(exception, contexts(hint));\n return \"\";\n}\n\nfunction consoleLogMessage(message: string, level?: SeverityLevel, hint?: EventHint) {\n const logFunc = consoleLogger[level || \"error\"] || console.log;\n logFunc(message, contexts(hint));\n return \"\";\n}\n\nfunction contexts(hint?: EventHint) {\n return (hint?.captureContext as any)?.contexts || \"\";\n}\n\n/* eslint-enable */\n\nconst mockSentry: SentryFns = {\n init: noop,\n setUser: noop,\n getCurrentHub: () =>\n ({\n captureException: consoleLogException,\n captureMessage: consoleLogMessage,\n }) as Hub,\n configureScope: noop,\n addBreadcrumb: noop,\n};\n\nconst loadSentry = (() => {\n let Sentry: SentryFns;\n return async (): Promise => {\n if (!Sentry) {\n if (isCloud && sentryDsn) {\n Sentry = await import(\"@sentry/vue\");\n } else {\n Sentry = mockSentry;\n }\n }\n return Sentry;\n };\n})();\n\nexport async function initSentry(app: App) {\n const Sentry = await loadSentry();\n const config: Parameters[0] = {\n app,\n dsn: sentryDsn,\n environment,\n normalizeDepth: 6,\n beforeBreadcrumb(breadcrumb) {\n if (breadcrumb.category === \"fetch\" && breadcrumb.data?.url?.includes(\"amplitude.com\")) {\n return null;\n }\n return breadcrumb;\n },\n };\n if (!isFeatureEnabled({ query: parseUrlWithoutRouter() }, \"log-less\")) {\n Object.assign(config, {\n replaysSessionSampleRate: 0.0,\n replaysOnErrorSampleRate: 1.0,\n // useCompression: false to avoid CSP problems: https://github.com/getsentry/sentry-javascript/issues/6739\n integrations: [new Replay({ useCompression: false })],\n });\n }\n Sentry.init(config);\n}\n\nexport async function setUser(company: string, authid: string) {\n const Sentry = await loadSentry();\n Sentry.configureScope((scope) => {\n scope.setUser({\n id: new ClientJS().getFingerprint().toString(16),\n company,\n username: authid,\n });\n scope.setTag(\"company\", company);\n });\n}\n\nexport async function resetUser() {\n const Sentry = await loadSentry();\n Sentry.configureScope((scope) => {\n scope.setUser({ id: scope.getUser()?.id });\n scope.setTag(\"company\", undefined);\n });\n}\n\nexport async function captureException(exception: any, contexts: Contexts = {}) {\n const Sentry = await loadSentry();\n return Sentry.getCurrentHub().captureException(\n exception,\n eventHint({ ...contexts, ...exception.contexts }),\n );\n}\n\nexport async function captureMessage(message: string, contexts: Contexts = {}) {\n const Sentry = await loadSentry();\n return Sentry.getCurrentHub().captureMessage(message, \"error\", eventHint(contexts));\n}\n\nfunction eventHint(contexts: Contexts): EventHint {\n contexts.browser = {\n tabActive: isBrowserTabActive(),\n online: navigator.onLine,\n };\n const eventId =\n contexts.request?.correlationId || (contexts.request?.headers as any)?.[\"correlation-id\"];\n return {\n event_id: eventId,\n captureContext: { contexts },\n };\n}\n\nexport async function addBreadcrumb(\n category: Breadcrumb[\"category\"],\n additionalProperties: Breadcrumb = {},\n) {\n const Sentry = await loadSentry();\n Sentry.addBreadcrumb({ ...additionalProperties, category });\n}\n","import type { I18nOptions } from \"vue-i18n\";\nimport { createI18n } from \"vue-i18n\";\n\nimport en from \"./en.json\";\n\n// There are 2 default languages:\n// English and \"none\" which means it shows the i18n keys instead of the translations.\n// This can be helpful to quickly correct a translation error.\n// To quickly switch language, one can use the `lang` URL query parameter.\n\nconst DEFAULT_LOCALE = \"en\";\nconst FALLBACK_LOCALE = \"en\";\n\nconst none = Object.fromEntries(Object.entries(en).map(([key]) => [key, key]));\n\nexport const i18n = createI18n({\n legacy: false,\n allowComposition: true,\n locale: DEFAULT_LOCALE,\n fallbackLocale: FALLBACK_LOCALE,\n messages: { en, none } as I18nOptions[\"messages\"],\n silentFallbackWarn: true,\n silentTranslationWarn: true,\n});\n\nexport function translate(params: [key: string, params?: Record]) {\n return i18n.global.t.apply(null, params as any);\n}\n","import { isString } from \"lodash-es\";\n\nimport { i18n } from \"@/translations/i18n\";\nimport { isFirefox, isMac } from \"@/utils/dom/dom\";\n\nexport function key(k: string, ...modifiers: Modifier[]): Key {\n const names = keyName(k, modifiers);\n return {\n name: () => names().join(\"\"),\n names,\n accept: (e) => accept(k)(e) && hasModifiers(k, e, modifiers),\n modifiers,\n };\n}\n\nexport function keys(...ks: string[]): Key {\n const keys = ks.map((k) => key(k));\n return {\n name: () => keys.map((k) => k.name()).join(\", \"),\n names: () => keys.flatMap((k) => k.name()),\n accept: (e) => keys.some((k) => accept(k.accept)(e)),\n modifiers: [],\n };\n}\n\nexport const noAccept = () => false;\n\nexport const noKey: Key = {\n name: () => \"\",\n names: () => [],\n accept: noAccept,\n modifiers: [],\n};\n\nexport function dummyKey(name: string | (() => string), ...modifiers: Modifier[]): Key {\n const names = isString(name) ? keyName(name, modifiers) : keyName(name(), modifiers);\n return {\n name: () => names().join(\"\"),\n names,\n accept: noAccept,\n modifiers,\n };\n}\n\nexport interface Key {\n name: () => string;\n names: () => string[];\n accept: KeyAccept;\n modifiers: Modifier[];\n}\n\nexport type KeyAccept = (e: SimpleKeyEvent) => boolean;\n\nexport interface SimpleKeyEvent {\n code: string;\n key: string;\n keyCode: number;\n shiftKey: boolean;\n altKey: boolean;\n ctrlKey: boolean;\n metaKey: boolean;\n}\n\ntype Modifier = \"shift\" | \"altCtrl\";\n\nfunction hasModifiers(k: string, event: SimpleKeyEvent, modifiers: Modifier[]) {\n // shift is ok when it's not a letter as some chars are entered with shift, e.g. / on DE keyboard\n let shiftOk = !event.code.startsWith(\"Key\") || !event.shiftKey;\n let altCtrlOk =\n (!event.altKey && !event.ctrlKey && !event.metaKey) || [\"Alt\", \"Control\", \"Meta\"].includes(k);\n for (const m of modifiers) {\n switch (m) {\n case \"shift\":\n shiftOk = event.shiftKey;\n break;\n case \"altCtrl\":\n altCtrlOk = event.altKey || event.ctrlKey || event.metaKey;\n break;\n }\n }\n return shiftOk && altCtrlOk;\n}\n\nfunction modKey() {\n return isMac ? \"⌘\" : i18n.global.t(\"key.ctrl\") + \" \";\n}\n\nconst keyNames: Record string> = {\n Escape: () => (isMac ? i18n.global.t(\"key.escapeMac\") : i18n.global.t(\"key.escape\")),\n Backspace: () => \"⌫\",\n Enter: () => (isMac ? \"↵\" : i18n.global.t(\"key.enter\")),\n Shift: () => (isMac ? \"⇧\" : i18n.global.t(\"key.shift\") + \" \"),\n ArrowUp: () => (isMac ? \"⏶\" : \"↑\"),\n ArrowDown: () => (isMac ? \"⏷\" : \"↓\"),\n ArrowLeft: () => (isMac ? \"⏴\" : \"←\"),\n ArrowRight: () => (isMac ? \"⏵\" : \"→\"),\n Space: () => i18n.global.t(\"key.space\"),\n};\n\nfunction keyName(k: string, modifiers: Modifier[]) {\n return () => {\n const key =\n keyNames[k]?.() ||\n (k.startsWith(\"Key\") ? k.substring(3) : k.startsWith(\"Digit\") ? k.substring(5) : k);\n return [\n ...(modifiers.includes(\"altCtrl\") ? [modKey()] : []),\n ...(modifiers.includes(\"shift\") ? [keyNames[\"Shift\"]()] : []),\n key,\n ];\n };\n}\n\nexport function accept(k: string | KeyAccept): KeyAccept {\n if (!isString(k)) {\n return k;\n }\n\n // There is no perfect cross-keyboard way to detect '+' key, so we have to test all 3 possibilities (for our supported languages)\n // We'll have to do this manually, until https://developer.mozilla.org/en-US/docs/Web/API/Keyboard/getLayoutMap is widely used\n // (there doesn't seem to be any API to identify the keyboard layout either)\n if (k === \"+\") {\n return (e) =>\n e.key === \"+\" || // '+' on DE/ES/PT keyboard\n (e.shiftKey && e.key === \"=\") || // '+' on EN/JP/CH/FR keyboard\n (e.shiftKey && e.key === \"1\"); // '+'' on CH keyboard\n }\n\n // Similarly, for '-' key we should test the keyCode to avoid inconsistencies in the key property\n if (k === \"-\") {\n return isFirefox ? (e) => e.keyCode === 173 : (e) => e.keyCode === 189;\n }\n\n return k.startsWith(\"Key\") || k.startsWith(\"Digit\") ? (e) => e.code === k : (e) => e.key === k;\n}\n","import { relativeCoord } from \"./coordinates\";\nimport cssValue from \"./variable.module.scss\";\n\nexport const stickySize = parseInt(cssValue.stickySize);\nexport const fakeZoom = parseInt(cssValue.fakeZoom);\n\nconst MILLI_SECONDS = 1;\nexport const SECONDS = 1000;\nexport const MINUTES = 60 * SECONDS;\n\nexport const boardAspect = 16 / 9;\nexport const zoomFactor = relativeCoord(0.018, 0.018 * boardAspect);\nexport const arrowBoxFactor = 0.982;\nexport const arrowLen = 0.008;\nexport const arrowAngle = 2.8;\nexport const longClick = 0.5 * SECONDS;\nexport const longClickDist = 50;\nexport const dragStartDist = 16;\nexport const minZoom = 1;\nexport const maxZoom = 10;\nexport const cardZoomHeight = 0.3333;\nexport const moveSendPeriod = 5 * SECONDS;\nexport const moveSendPerPeriod = 50;\nexport const maxMoveSendPerPeriod = 100;\nexport const moveAnimationDelay = 45 * MILLI_SECONDS;\nexport const moveAnimationStep = 0.20001;\nexport const statHistory = 1000;\nexport const pointerPosInterval = 60 * MILLI_SECONDS;\nexport const pointerPosHide = 30 * SECONDS;\nexport const pointerTrailMaxLen = 50;\nexport const pointerTrailDotDist = 8;\nexport const keepEndedTimer = 10 * SECONDS;\nexport const timerEnding = 2 * MINUTES;\nexport const userHeartbeatInterval = 3 * SECONDS;\nexport const maxVisibleUsersOnBoard = 4;\nexport const natsRequestTimeout = 15 * SECONDS;\nexport const natsTabInactiveRequestTimeout = 60 * SECONDS;\nexport const iterationSyncTimeout = 2 * MINUTES;\nexport const backlogSyncTimeout = 5 * MINUTES;\nexport const updateTimeout = 500 * MILLI_SECONDS;\nexport const screenShotWidth = 10000;\nexport const snapDistance = 0.0002;\nexport const previewDelay = 1 * SECONDS;\n","import { defineStore } from \"pinia\";\n\nexport const useActionStore = defineStore(\"action\", {\n state: () => ({\n previewTimeout: 0,\n previewing: null as unknown,\n }),\n getters: {\n wasPreviewing(state) {\n window.clearTimeout(state.previewTimeout);\n return state.previewing;\n },\n },\n actions: {\n preview(action: unknown, execute: () => void, delay: number) {\n this.previewTimeout = window.setTimeout(() => {\n execute();\n this.previewing = action;\n }, delay);\n },\n endPreview() {\n this.previewing = null;\n },\n },\n});\n","/**\n * usage: ensureResolve(resolver=>{... call resolver() or not ...}) returns a Promise that is guaranteed to resolve\n */\nexport function ensureResolve(fun: (resolver: () => () => void) => void) {\n return new Promise((resolve) => {\n let used = false;\n fun(() => {\n used = true;\n return resolve;\n });\n if (!used) {\n resolve();\n }\n });\n}\n\n/**\n * Execute a function after the first has ended.\n */\nexport function doAfter(first: any, after: () => void) {\n if (first?.then) {\n first.then(after);\n } else {\n after();\n }\n}\n","import { isString } from \"lodash-es\";\n\nimport type { Key } from \"@/components/shortcut/key\";\nimport { noKey } from \"@/components/shortcut/key\";\nimport { previewDelay } from \"@/model/Settings\";\nimport type { ActionSource, ExecutionMode } from \"@/model/action\";\nimport { useActionStore } from \"@/store/action\";\nimport { actionEvent } from \"@/utils/analytics/events\";\nimport { trackEvent } from \"@/utils/analytics/track\";\nimport type { AnalyticsEvent, TrackingParams } from \"@/utils/analytics/types\";\nimport { doAfter } from \"@/utils/async/utils\";\n\nimport type {\n Action,\n ActionContext,\n ActionData,\n ActionDefinitionData,\n ActionSourceFun,\n ContextFun,\n Fun,\n} from \"./types\";\n\n/**\n * Create an action from its implementation and metadata.\n */\nexport function action(\n impl: Fun,\n data: ActionDefinitionData = {},\n): Action {\n const ctx = actionContext((_, ...params) => impl(...params), makeActionData(data));\n return makeAction(ctx.execute, ctx.data);\n}\n\n/**\n * Create an action that has ActionContext as first parameter.\n */\nexport function ctxAction(\n impl: ContextFun,\n data: ActionDefinitionData = {},\n): Action {\n const ctx = actionContext(impl, makeActionData(data));\n return makeAction(ctx.execute, ctx.data);\n}\n\n/**\n * Create an action that can be previewed (using `ActionContext.mode`).\n */\nexport function previewAction(\n impl: ContextFun,\n data: ActionDefinitionData = {},\n): Action {\n const ctx = actionContext(impl, makeActionData(data));\n const actionFun = (source: ActionSource | ActionContext, ...params: TParams) => {\n if (useActionStore().wasPreviewing === actionFun) {\n useActionStore().endPreview();\n ctx.mode = \"confirm\";\n } else {\n ctx.mode = \"normal\";\n }\n return ctx.execute(source, ...params);\n };\n ctx.data.startPreview = (...params: TParams) => {\n useActionStore().preview(\n actionFun,\n () => {\n ctx.mode = \"preview\";\n ctx.execute(\"internal\", ...params);\n },\n previewDelay,\n );\n };\n ctx.data.stopPreview = (...params: TParams) => {\n if (useActionStore().wasPreviewing === actionFun) {\n ctx.mode = \"undo\";\n doAfter(ctx.execute(\"internal\", ...params), () => useActionStore().endPreview());\n }\n };\n return makeAction(actionFun, ctx.data);\n}\n\nexport function assignShortcut(action: Action, key: Key) {\n action.data.shortcut = key;\n}\n\n/**\n * Create an action without parameters from another action and parameters.\n */\nexport function applyActionParams(\n action: Action,\n ...params: TParams\n): Action {\n return makeAction(\n (source: ActionSource | ActionContext) => action(source, ...params),\n action.data,\n );\n}\n\n/**\n * Define a group of actions.\n */\nexport function defineActions }>(\n name: string,\n actions: T,\n): { [id in keyof T]: T[id] } {\n Object.entries(actions).forEach(([id, action]) => {\n action.data.id = name + \".\" + id;\n });\n return actions as unknown as { [id in keyof T]: T[id] };\n}\n\ntype InternalActionContext = ActionContext & {\n params?: TParams;\n data: ActionData;\n execute: ActionSourceFun;\n};\n\nfunction actionContext(\n impl: ContextFun,\n data: ActionData,\n): InternalActionContext {\n const context: InternalActionContext = {\n tracked: false,\n data,\n source: \"internal\" as ActionSource,\n mode: \"normal\" as ExecutionMode,\n track(arg: AnalyticsEvent | TrackingParams | null) {\n if (arg) {\n trackAction(data, this.source, this.params!, arg);\n }\n this.tracked = true;\n },\n execute(source: ActionSource | ActionContext, ...params: TParams) {\n context.source = isString(source) ? source : source.source;\n context.params = params;\n context.tracked = false;\n const res = impl(context, ...params);\n if (!context.tracked) {\n context.track({});\n }\n // an action calls another action with its context -> don't track the first action\n if (!isString(source)) {\n source.tracked = true;\n }\n return res;\n },\n };\n return context;\n}\n\nfunction makeAction(\n fun: ActionSourceFun,\n data: ActionData,\n): Action {\n const res = fun as Action;\n res.data = data;\n return res;\n}\n\nfunction makeActionData(\n data: ActionDefinitionData,\n): ActionData {\n return {\n id: \"\",\n name: data.name || \"\",\n history: data.history,\n shortcut: noKey,\n icon: data.icon,\n };\n}\n\nconst ignoreActions = [\"board.clearCardSelection\"];\n\nconst lastActionId: Record = {};\n\nfunction trackAction(\n data: ActionData,\n source: ActionSource,\n params: TParams,\n track: AnalyticsEvent | TrackingParams,\n) {\n if (source !== \"internal\" && !ignoreActions.includes(data.id)) {\n if (data.history?.merge) {\n const id = data.history.saveState(...params).id;\n if (id !== lastActionId[data.id]) {\n lastActionId[data.id] = id;\n sendEvent();\n }\n } else {\n sendEvent();\n }\n }\n\n function sendEvent() {\n trackEvent(\n \"event\" in track\n ? (track as AnalyticsEvent)\n : actionEvent({ eventName: data.id, source, params: track }),\n );\n }\n}\n","import type { AlmSourceId, BoardType, IdMap } from \"./baseTypes\";\nimport type { BoardCard } from \"./card\";\nimport type { RelativeCoordinate } from \"./coordinates\";\nimport type { FlexType } from \"./flexboard\";\nimport type { Objective } from \"./objective\";\nimport type { Iteration, Team } from \"./session\";\nimport type { Shape } from \"./shape\";\n\nexport interface BoardId {\n boardId: string;\n}\n\ninterface BaseBoardData {\n id: string;\n type: BoardType;\n almSources: AlmSource[];\n cardSize: RelativeCoordinate & { factor: number };\n cards: IdMap;\n maxZ: number;\n loaded: number;\n artId?: string;\n userHeartbeatId?: number;\n selected: IdMap;\n shapes: Shape[];\n}\n\nexport type BoardData = BaseBoardData &\n {\n backlog: { type: \"backlog\" };\n program: {\n type: \"program\";\n objectives: Objective[];\n stretchObjectives: Objective[];\n };\n solution_backlog: { type: \"solution_backlog\" };\n solution: { type: \"solution\" };\n risk: { type: \"risk\" };\n team: {\n type: \"team\";\n iterations: BoardIteration[];\n team: Team;\n objectives: Objective[];\n stretchObjectives: Objective[];\n };\n flex: {\n type: \"flex\";\n flexType: FlexType;\n name: string;\n };\n objectives: { type: \"objectives\" };\n }[T];\n\nexport type Board =\n | BoardData<\"backlog\">\n | BoardData<\"program\">\n | BoardData<\"solution_backlog\">\n | BoardData<\"solution\">\n | BoardData<\"risk\">\n | BoardData<\"team\">\n | BoardData<\"flex\">\n | BoardData<\"objectives\">;\n\nexport type BoardWithObjectives = BoardData<\"program\"> | BoardData<\"team\">;\n\nexport function isBacklogBoard(type?: BoardType) {\n return type === \"backlog\" || type === \"solution_backlog\";\n}\n\nexport function isPlanningBoard(type?: BoardType) {\n return type === \"program\" || type === \"solution\";\n}\n\nexport function isSolutionBoard(type?: BoardType) {\n return type === \"solution\" || type === \"solution_backlog\";\n}\n\nexport function isArtBoard(type?: BoardType) {\n return type === \"backlog\" || type === \"program\" || type === \"risk\" || type === \"objectives\";\n}\n\nexport function isTeamBoard(type?: BoardType) {\n return type === \"team\";\n}\n\nexport function isRiskBoard(type?: BoardType) {\n return type === \"risk\";\n}\n\nexport function isObjectivesBoard(type?: BoardType) {\n return type === \"objectives\";\n}\n\nexport function isFlexBoard(type?: BoardType) {\n return type === \"flex\";\n}\n\nexport function hasBoardObjectives(board: Board): board is BoardWithObjectives {\n return board.type === \"program\" || board.type === \"team\";\n}\n\n/**\n * A frontend board is a board that exists only in the frontend,\n * i.e. no database representation exists for it.\n */\nexport function isFrontendBoard(type?: BoardType) {\n return type === \"objectives\";\n}\n\nexport function boardTypeOrder(type: BoardType) {\n return {\n solution_backlog: 0,\n solution: 1,\n backlog: 2,\n program: 3,\n objectives: 4,\n risk: 5,\n team: 6,\n flex: 7,\n }[type];\n}\n\nexport interface AlmSource {\n id: AlmSourceId;\n name: string;\n}\n\nexport interface GroupIteration extends Iteration {\n load?: number;\n velocity?: number;\n}\n\nexport interface BoardIteration {\n load: number;\n velocity: number;\n state: IterationState;\n}\n\ninterface IterationState {\n status: IterationStatus | null;\n detail: string | null;\n}\n\nexport type IterationStatus = \"syncing\" | \"synced\" | \"success\" | \"fail\";\n\nexport interface KanbanFilters {\n text: string;\n typeIds: string[];\n}\n","import { defineStore } from \"pinia\";\n\nimport type { BoardType, IdMap } from \"@/model/baseTypes\";\nimport { isFlexBoard } from \"@/model/board\";\nimport type { AlmStickyType, StickyType } from \"@/model/stickyType\";\nimport { i18n } from \"@/translations/i18n\";\n\nexport const useStickyTypeStore = defineStore(\"stickyType\", {\n state: () => ({\n stickyTypes: [] as StickyType[],\n almStickyTypes: {} as IdMap,\n }),\n getters: {\n findStickyType:\n (state) =>\n (id: string): StickyType => {\n const type = state.stickyTypes.find((t) => t.id === id);\n return type || zombieStickyType();\n },\n nonFlexBoardStickyTypes: (state) => (type: BoardType) => {\n const originTypes = state.stickyTypes.filter((s) => s.origin === type);\n const mirrorTypes = state.stickyTypes.filter(\n (s) => s.origin !== type && s.usable.find((a) => a === type),\n );\n return boardStickyTypes(originTypes, mirrorTypes);\n },\n flexBoardStickyTypes: (state) => (flexType: string) => {\n const originTypes = state.stickyTypes.filter(\n (s) => isFlexBoard(s.origin) && s.flexOrigin === flexType,\n );\n const mirrorTypes = state.stickyTypes.filter(\n (s) =>\n !isFlexBoard(s.origin) &&\n s.usable.find(isFlexBoard) &&\n (s.flexUsable || []).find((a) => a === flexType),\n );\n return boardStickyTypes(originTypes, mirrorTypes);\n },\n almStickyTypeOf: (state) => (stickyType: Pick) => {\n return state.almStickyTypes[stickyType.almType || \"\"];\n },\n },\n});\n\nfunction boardStickyTypes(origin: StickyType[], mirror: StickyType[]) {\n mirror.sort((a, b) => a.name.localeCompare(b.name));\n return [...origin, ...mirror];\n}\n\nfunction zombieStickyType(): StickyType {\n return {\n id: \"0\",\n name: i18n.global.t(\"stickyType.unknown\"),\n almType: null,\n color: [0.5, 0.5, 0.5, 0.8],\n altColor: [0.5, 0.5, 0.5, 0.8],\n origin: \"risk\",\n flexOrigin: null,\n usable: [],\n flexUsable: [],\n functionality: \"note\",\n };\n}\n\nexport function isZombieType(type: StickyType) {\n return type.id === \"0\";\n}\n\nexport function isStickyTypeAlmSynced(type: StickyType) {\n return useStickyTypeStore().almStickyTypeOf(type)?.isMapped;\n}\n","// Execute `action` `executionsPerPeriod` times during `period` milliseconds.\n// If the sum of the returned values is bigger than `maxSumPerPeriod` the execution frequency is reduced.\nexport class Throttle {\n private readonly values: number[];\n private index = 0;\n private total = 0;\n private wait = 0;\n\n constructor(\n private period: number,\n private executionsPerPeriod: number,\n private maxSumPerPeriod: number,\n private action: () => number,\n ) {\n this.values = new Array(executionsPerPeriod);\n this.run();\n }\n\n run() {\n this.total -= this.values[this.index] || 0;\n const rate = this.total / this.maxSumPerPeriod;\n let value = 0;\n // hard throttling when we're over maxSumPerPeriod\n if (rate > 1 || this.wait > 0) {\n this.wait--;\n } else {\n value = this.action();\n // start throttling when half of maxSumPerPeriod is reached\n this.wait = Math.floor(8 * rate * rate * rate);\n }\n this.total += this.values[this.index] = value;\n this.index = (this.index + 1) % this.executionsPerPeriod;\n setTimeout(() => this.run(), this.period / this.executionsPerPeriod);\n }\n}\n","import { noop } from \"lodash-es\";\n\nimport { logPerformance } from \"./env/Environment\";\n\nexport function firstProperty(obj: Record): string | undefined {\n for (const prop in obj) {\n return prop;\n }\n}\n\nexport function mapObjectValues(\n obj: Record,\n mapper: (value: S) => T,\n): Record {\n return Object.fromEntries(Object.entries(obj).map(([key, value]) => [key, mapper(value)]));\n}\n\nexport function firstValue(obj: Record): V {\n return obj[firstProperty(obj)!];\n}\n\nexport function isEmpty(obj: Record): boolean {\n return !firstProperty(obj);\n}\n\nexport function toHex(value: number, len: number): string {\n return pad(value.toString(16), len);\n}\n\nexport function pad(s: string | number, len: number): string {\n let r = s.toString();\n while (r.length < len) {\n r = \"0\" + r;\n }\n return r;\n}\n\nexport function generateId(type: string, data?: string) {\n let res = type;\n const end = data || \"\";\n while (res.length + end.length < 24) {\n res += \"0\";\n }\n return res + end;\n}\n\nexport function hash(s: string) {\n let h = 3496329;\n for (let i = 0; i < s.length; i++) {\n // eslint-disable-next-line no-bitwise\n h = ((h << 5) - h + s.charCodeAt(i)) | 0;\n }\n return h;\n}\n\nexport function flattenObject(obj: any, level = 2, path = \"\"): any {\n const flattenable = [\"[object Object]\", \"[object Array]\"].includes(\n Object.prototype.toString.call(obj),\n );\n const keys = Object.keys(obj || \"\");\n if (level === 0 || !flattenable || !keys.length) {\n return path.length ? { [path.substring(1)]: obj } : obj;\n }\n return keys.reduce(\n (accu, prop) => ({\n ...accu,\n ...flattenObject(obj[prop], level - 1, path + \".\" + prop),\n }),\n {},\n );\n}\n\n/**\n * Removes the non-printing character from a string\n * https://en.wikipedia.org/wiki/Control_character#In_Unicode\n */\nexport function removeNonPrintable(value: string) {\n // eslint-disable-next-line no-control-regex\n return value.replace(/[\\u0000-\\u001F\\u007F-\\u009F]/g, \" \");\n}\n\nexport function neverResolve(): Promise {\n return new Promise(noop);\n}\n\n// eslint-disable-next-line @typescript-eslint/no-empty-function\nexport async function asyncNoop() {}\n\nexport const performanceLog = logPerformance\n ? (message: string, start: number) => {\n // eslint-disable-next-line no-console\n console.log(message, performance.now() - start + \" ms\");\n }\n : noop;\n\nexport function truncateString(str: string, maxLength: number) {\n if (str.length <= maxLength) {\n return str;\n }\n return str.substring(0, maxLength - 3) + \"...\";\n}\n","import { toHex } from \"./general\";\n\n/* eslint-disable no-bitwise */\nconst countMax = (1 << 24) - 1;\nconst rndMax = 1 << 20;\nlet count = rndInt(countMax);\n\nexport function objectId(): string {\n count = (count + 1) & countMax;\n const rnd = toHex(rndInt(rndMax), 5) + toHex(rndInt(rndMax), 5);\n return toHex(Math.floor(Date.now() / 1000), 8) + rnd + toHex(count, 6);\n}\n\nfunction rndInt(max: number) {\n return Math.floor(Math.random() * max);\n}\n","import { noop } from \"lodash-es\";\n\nimport { asyncNoop } from \"@/utils/general\";\nimport { objectId } from \"@/utils/objectId\";\n\nimport type { BackendSession } from \"./BackendSession\";\n\nconst asyncAny = () => Promise.resolve({} as T);\nconst asyncArray = () => Promise.resolve([]);\n\nexport function dummyBackendSession(): BackendSession {\n return {\n addBoard: () => Promise.resolve(\"\"),\n addBoardToCategory: asyncNoop,\n addCategory: () => Promise.resolve(\"\"),\n addLink: asyncAny,\n addObjectiveLink: asyncNoop,\n addReaction: asyncNoop,\n almSource: () => undefined,\n almSubscribe: asyncAny,\n boardPublish: noop,\n boardSubscribe: asyncAny,\n createTimerEvent: () => Promise.resolve(\"\"),\n deleteBoard: asyncNoop,\n deleteCategory: asyncNoop,\n deleteEvent: asyncNoop,\n deleteLink: asyncNoop,\n deleteObjectiveLink: asyncNoop,\n getAlmConnectionId: () => undefined,\n getAlmItemType: asyncAny,\n getAlmItemTypeForSticky: asyncAny,\n getAlmStatus: asyncAny,\n hasMappedAlmUser: asyncAny,\n getAlmType: () => undefined,\n getArts: asyncArray,\n getBoardIterations: asyncArray,\n getBoardStickies: asyncAny,\n getBoards: asyncArray,\n getCategories: asyncArray,\n getEvents: asyncArray,\n getFlexBackgrounds: asyncArray,\n getFlexTypes: asyncArray,\n getIterations: asyncArray,\n getLicense: asyncAny,\n getLinkTypes: asyncArray,\n getLinks: asyncArray,\n getObjectives: asyncAny,\n getScale: () => Promise.resolve(0),\n getServerInfo: asyncAny,\n getSessions: asyncArray,\n getSettings: asyncAny,\n getCompanySettings: asyncAny,\n getStatusWithData: () => Promise.resolve({ data: \"\", timestamp_in: 0, timestamp_out: 0 }),\n subscriptionCount: () => 0,\n getStickies: asyncArray,\n getStickyTypes: asyncArray,\n getTeams: asyncArray,\n mirror: asyncAny,\n move: noop,\n newSticky: () => Promise.resolve(\"\"),\n removeBoardFromCategory: asyncNoop,\n removeReaction: asyncNoop,\n addShape: () => Promise.resolve(objectId()),\n editShape: asyncNoop,\n removeShape: asyncNoop,\n roomSubscribe: asyncAny,\n searchStickies: asyncArray,\n sessionSubscribe: asyncAny,\n setSessionId: () => Promise.resolve(false),\n syncBacklog: asyncAny,\n syncIteration: asyncAny,\n toRisk: noop,\n unsubscribe: asyncNoop,\n updateBoard: asyncNoop,\n updateCategory: asyncNoop,\n updateTimerEvent: asyncNoop,\n getAlmStickyTypes: asyncArray,\n getBoardIdsOfGroupedStickies: () => Promise.resolve({ board_ids: [] }),\n getStickyChanges: asyncArray,\n duplicateFlex: asyncNoop,\n getBoardDiff: asyncAny,\n getBoardEventLog: asyncAny,\n };\n}\n","import { maxMoveSendPerPeriod, moveSendPerPeriod, moveSendPeriod } from \"@/model/Settings\";\nimport type { ArtId } from \"@/model/baseTypes\";\nimport type { Card, Reaction } from \"@/model/card\";\nimport type { RelativeCoordinate } from \"@/model/coordinates\";\nimport type { Objective } from \"@/model/objective\";\nimport type { Shape } from \"@/model/shape\";\nimport { isZombieType } from \"@/store/stickyType\";\nimport { Throttle } from \"@/utils/Throttle\";\n\nimport type { BackendSession } from \"./BackendSession\";\nimport { dummyBackendSession } from \"./DummyBackendSession\";\nimport type {\n ServerIterationSyncState,\n ServerLink,\n ServerObjective,\n ServerSticky,\n} from \"./serverModel\";\n\ninterface CardMove {\n boardId: string;\n coord: RelativeCoordinate;\n}\n\nexport class Sender {\n backendSess: BackendSession = dummyBackendSession();\n cardMoves = new Map();\n\n constructor() {\n new Throttle(moveSendPeriod, moveSendPerPeriod, maxMoveSendPerPeriod, () => {\n const moved = this.cardMoves.size;\n for (const [id, move] of this.cardMoves) {\n this.alterCard(move.boardId, id, move.coord);\n }\n this.cardMoves.clear();\n return moved;\n });\n }\n\n startAlterCard(boardId: string, id: string) {\n this.backendSess.boardPublish(boardId, \"sticky.start_update\", [id, {}]);\n }\n\n alterCard(\n boardId: string,\n id: string,\n props: Partial,\n priorities?: boolean,\n ) {\n this.backendSess.boardPublish(boardId, \"sticky.update\", [\n id,\n convertToServerSticky(props, priorities),\n ]);\n }\n\n stopAlterCard(boardId: string, id: string, props?: Partial | RelativeCoordinate) {\n this.backendSess.boardPublish(boardId, \"sticky.stop_update\", [\n id,\n convertToServerSticky(props),\n ]);\n }\n\n moveCard(boardId: string, id: string, coord: RelativeCoordinate) {\n this.cardMoves.set(id, { boardId, coord });\n }\n\n addCard(boardId: string, props: Partial): Promise {\n return this.backendSess.newSticky(boardId, convertToServerSticky(props));\n }\n\n deleteCard(boardId: string, id: string) {\n this.stopAlterCard(boardId, id, {});\n this.backendSess.boardPublish(boardId, \"sticky.remove\", [id]);\n }\n\n scaleBoard(boardId: string, value: number) {\n this.backendSess.boardPublish(boardId, \"sticky.scale\", [value]);\n }\n\n frontCard(boardId: string, id: string) {\n this.backendSess.boardPublish(boardId, \"sticky.bring_to_front\", [id]);\n }\n\n setVelocity(boardId: string, iteration: number, velocity: number) {\n this.backendSess.boardPublish(boardId, \"capacity.update\", [iteration, \"\" + velocity]);\n }\n\n addObjective(boardId: string, objective: Objective) {\n this.backendSess.boardPublish(boardId, \"objective.add\", [\n {\n objective_id: objective.id,\n ...convertToServerObjective(objective),\n },\n ]);\n }\n\n deleteObjective(boardId: string, id: string) {\n this.backendSess.boardPublish(boardId, \"objective.remove\", [id]);\n }\n\n updateObjective(boardId: string, objective: Objective) {\n this.backendSess.boardPublish(boardId, \"objective.update\", [\n objective.id,\n convertToServerObjective(objective),\n ]);\n }\n\n moveObjective(boardId: string, objectiveId: string, stretch: boolean, rank: number) {\n this.backendSess.boardPublish(boardId, \"objective.move\", [objectiveId, stretch, rank]);\n }\n\n async mirror(cardId: string, toBoardId: string, props?: Partial) {\n const res = await this.backendSess.mirror(cardId, toBoardId, convertToServerSticky(props));\n return res.created ? res.mirrored_id : undefined;\n }\n\n move(cardId: string, teamId: string) {\n this.backendSess.move(cardId, teamId);\n }\n\n toRisk(cardId: string, boardId: string, text: string, typeId: string, teamId: string) {\n this.backendSess.toRisk(cardId, boardId, text, typeId, teamId);\n }\n\n addLink(cardId: string, toId: string): Promise {\n return this.backendSess.addLink(cardId, toId);\n }\n\n async addObjectiveLink(cardId: string, boardId: string, objectiveId: string): Promise {\n await this.backendSess.addObjectiveLink(cardId, boardId, objectiveId);\n }\n\n deleteLink(linkId: string): Promise {\n return this.backendSess.deleteLink(linkId);\n }\n\n async deleteObjectiveLink(cardId: string, boardId: string, objectiveId: string): Promise {\n await this.backendSess.deleteObjectiveLink(cardId, boardId, objectiveId);\n }\n\n syncIteration(teamId: string, iterationId: number): Promise {\n return this.backendSess.syncIteration(teamId, iterationId);\n }\n\n syncBacklog(artId?: ArtId) {\n return this.backendSess.syncBacklog(artId);\n }\n\n addBoard(type: string, name: string): Promise {\n return this.backendSess.addBoard(type, name);\n }\n\n updateBoard(id: string, name: string) {\n return this.backendSess.updateBoard(id, name);\n }\n\n deleteBoard(id: string) {\n return this.backendSess.deleteBoard(id);\n }\n\n addCategory(name: string): Promise {\n return this.backendSess.addCategory(name);\n }\n\n updateCategory(id: string, update: { name?: string; position?: number }) {\n return this.backendSess.updateCategory(id, update);\n }\n\n deleteCategory(id: string) {\n return this.backendSess.deleteCategory(id);\n }\n\n addBoardToCategory(boardId: string, categoryId: string) {\n return this.backendSess.addBoardToCategory(boardId, categoryId);\n }\n\n removeBoardFromCategory(boardId: string, categoryId: string) {\n return this.backendSess.removeBoardFromCategory(boardId, categoryId);\n }\n\n pointerPos(boardId: string, pos: RelativeCoordinate) {\n this.backendSess.boardPublish(boardId, \"pointer.position\", [pos]);\n }\n\n addUserOnBoard(boardId: string, userId: string) {\n this.backendSess.boardPublish(boardId, \"subscribers.join\", [userId]);\n }\n\n removeUserFromBoard(boardId: string, userId: string) {\n this.backendSess.boardPublish(boardId, \"subscribers.leave\", [userId]);\n }\n\n async addReaction(cardId: string, reaction: Reaction) {\n await this.backendSess.addReaction(cardId, reaction);\n }\n\n async removeReaction(cardId: string, reaction: Reaction) {\n await this.backendSess.removeReaction(cardId, reaction);\n }\n\n addShape(boardId: string, shape: Shape) {\n return this.backendSess.addShape(boardId, shape);\n }\n\n editShape(boardId: string, shape: Shape) {\n return this.backendSess.editShape(boardId, shape);\n }\n\n removeShape(boardId: string, shapeId: string) {\n return this.backendSess.removeShape(boardId, shapeId);\n }\n}\n\n/**\n * Converts a card to a ServerSticky\n */\nfunction convertToServerSticky(\n data?: Partial,\n priorities?: boolean,\n): Partial {\n const value: Partial = {};\n if (data) {\n if (data.x !== undefined && data.y !== undefined) {\n value.a_center = [data.x, 1 - data.y];\n }\n if (data.text !== undefined) {\n value.text = data.text;\n }\n if (data.status !== undefined) {\n value.status = data.status.name;\n if (data.status.dynamic) {\n value.status_class = data.status.statusClass;\n }\n }\n if (data.transition !== undefined) {\n value.transition = data.transition;\n }\n if (data.type !== undefined && !isZombieType(data.type)) {\n value.type_id = data.type.id;\n }\n if (data.priority !== undefined) {\n if (priorities) {\n value.step_value = data.priority;\n } else {\n value.WSJF_value = data.priority;\n }\n }\n if (data.points !== undefined) {\n value.story_points = data.points;\n }\n if (data.teamId !== undefined) {\n value.team_id = data.teamId === null ? null : +data.teamId;\n }\n if (data.precondTeam !== undefined) {\n value.precond_team = data.precondTeam.name;\n value.precond_team_id = +data.precondTeam.id;\n }\n if (data.dependTeam !== undefined) {\n value.depend_team = data.dependTeam.name;\n value.depend_team_id = +data.dependTeam.id;\n }\n if (data.iterationId !== undefined) {\n value.iteration_number = data.iterationId;\n }\n if (data.flagType !== undefined) {\n value.flag_type = data.flagType.isEmpty() ? null : data.flagType.toString();\n }\n if (data.risk !== undefined) {\n value.risk = data.risk;\n }\n if (data.almSourceId !== undefined) {\n value.alm_source = data.almSourceId;\n }\n if (data.artId !== undefined) {\n value.art_id = data.artId;\n }\n if (data.assignee !== undefined) {\n value.assignee = { pip_id: data.assignee?.id || null, alm_id: null };\n }\n }\n return value;\n}\n\nfunction convertToServerObjective(data: Partial): Partial {\n const value: Partial = {};\n if (data.id !== undefined) {\n value.objective_id = data.id;\n }\n if (data.text !== undefined) {\n value.text = data.text;\n }\n if (data.bv !== undefined) {\n value.bv = data.bv;\n }\n if (data.av !== undefined) {\n value.av = data.av;\n }\n if (data.description !== undefined) {\n value.description = data.description;\n }\n return value;\n}\n\nexport const sender = new Sender();\n","export default \"__VITE_ASSET__D8a9sRJD__\"","\n\n\n\n\n","// iconLoader.ts\n/// \nimport type { ComponentPublicInstance } from \"vue\";\nimport { defineAsyncComponent } from \"vue\";\n\nimport { captureException } from \"@/error/sentry\";\nimport PlaceHolderIcon from \"@/icons/base/placeholder.svg?component\";\nimport type { Icon } from \"@/model/icon\";\n\nimport SvgLoadingPlaceholder from \"./SvgLoadingPlaceholder.vue\";\n\nconst modules = import.meta.glob(\"/src/icons/**/*.svg\", {\n query: \"?component\",\n});\n\nexport const getIconComponent = (name: Icon) => {\n return defineAsyncComponent({\n loader: async () => {\n const path = `/src/icons/${name}.svg`;\n try {\n return (await modules[path]()) as ComponentPublicInstance;\n } catch (err) {\n void captureException(err);\n return PlaceHolderIcon;\n }\n },\n // Render an empty div while the icon is loading so there's\n // no layout shift when the icon is finally loaded\n loadingComponent: SvgLoadingPlaceholder,\n delay: 0,\n });\n};\n","\n\n\n","import { isArray } from \"lodash-es\";\nimport type { Events, Ref } from \"vue\";\nimport { computed, ref, useAttrs } from \"vue\";\n\n/**\n * Provides information about currently processing async event handlers.\n *\n * const { attrs, processing } = useAsyncHandler(\"onClick\")\n * async function onClick() {...}\n *\n * \n * Click handler is running: {{ processing['onClick'] }}\n */\nexport function useAsyncHandler>(delay: number, ...eventNames: T) {\n type EventName = (typeof eventNames)[number];\n\n const $attrs = useAttrs();\n const attrs = computed(() => {\n return {\n ...$attrs,\n ...Object.fromEntries(\n eventNames.map((name) => [name, (event: Event) => handleClick(name, event)]),\n ),\n };\n });\n\n const processing = ref(Object.fromEntries(eventNames.map((name) => [name, false]))) as Ref<{\n [event in EventName]: boolean;\n }>;\n\n function handleClick(name: EventName, event: Event) {\n const handler = $attrs[name];\n if (isArray(handler)) {\n handler.forEach((handle) => void doHandleClick(name, handle(event)));\n } else {\n void doHandleClick(name, (handler as any)?.(event));\n }\n }\n\n async function doHandleClick(name: EventName, result?: any) {\n if (result?.then) {\n const timeout = window.setTimeout(() => (processing.value[name] = true), delay);\n try {\n return await result;\n } finally {\n clearTimeout(timeout);\n processing.value[name] = false;\n }\n }\n }\n\n return { attrs, processing };\n}\n","\n\n\n\n\n","export const tooltipDelayToAppear = 350;\n","\n\n\n\n\n","\n\n\n\n\n","import { onBeforeUnmount } from \"vue\";\n\ninterface Listener {\n elem: Document | HTMLElement;\n type: string;\n listener: (this: any, ev: any) => unknown;\n options?: boolean | AddEventListenerOptions;\n}\n\nexport function useNativeEvents() {\n const listeners = new Array();\n\n onBeforeUnmount(() => {\n removeEventListeners();\n });\n\n function addEventListener(\n elem: Document,\n type: K,\n listener: (this: HTMLElement, ev: DocumentEventMap[K]) => unknown,\n options?: boolean | AddEventListenerOptions,\n ): void;\n function addEventListener(\n elem: HTMLElement | undefined,\n type: K,\n listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => unknown,\n options?: boolean | AddEventListenerOptions,\n ): void;\n function addEventListener(\n elem: Document | HTMLElement | undefined,\n type: string,\n listener: (this: Document | HTMLElement, ev: any) => unknown,\n options?: boolean | AddEventListenerOptions,\n ) {\n if (elem) {\n listeners.push({ elem, type, listener, options });\n elem.addEventListener(type, listener, options);\n }\n }\n\n function removeEventListeners() {\n for (const listener of listeners) {\n listener.elem.removeEventListener(listener.type, listener.listener, listener.options);\n }\n listeners.length = 0;\n }\n\n return { addEventListener, removeEventListeners };\n}\n","import { clamp } from \"lodash-es\";\nimport type { Ref } from \"vue\";\nimport { onMounted, ref } from \"vue\";\n\nimport { useNativeEvents } from \"@/composables/useNativeEvents\";\nimport { minus } from \"@/math/coordinates\";\nimport type { WindowCoordinate } from \"@/model/coordinates\";\nimport { boundsCoord, clientCoord, offsetSize, windowSize } from \"@/utils/dom/coordinates\";\n\nexport function useSimpleDraggable(el: Ref) {\n const { addEventListener } = useNativeEvents();\n onMounted(() => {\n addEventListener(document, \"pointerleave\", endDrag);\n addEventListener(document, \"pointerup\", endDrag);\n addEventListener(document, \"pointermove\", moveDrag);\n });\n\n const drag = ref(null);\n\n function startDrag(e: PointerEvent) {\n if (el.value) {\n drag.value = minus(clientCoord(e), boundsCoord(el.value));\n setDragPos(boundsCoord(el.value));\n el.value.style.transform = \"none\";\n el.value.style.margin = \"0\";\n }\n }\n\n function endDrag() {\n drag.value = null;\n }\n\n function moveDrag(e: PointerEvent) {\n if (drag.value) {\n setDragPos(minus(clientCoord(e), drag.value));\n }\n }\n\n function setDragPos(pos: WindowCoordinate) {\n if (el.value) {\n const max = minus(windowSize(), offsetSize(el.value));\n el.value.style.top = clamp(pos.y, 0, max.y) + \"px\";\n el.value.style.left = clamp(pos.x, 0, max.x) + \"px\";\n }\n }\n\n return { startDrag, endDrag };\n}\n","\n\n\n\n\n\n","import { defineStore } from \"pinia\";\n\nimport { plus } from \"@/math/coordinates\";\nimport { type WindowCoordinate, windowCoord } from \"@/model/coordinates\";\nimport type { Border, Size } from \"@/model/size\";\n\ninterface State {\n size: Size;\n scrollableMargin: Border;\n visibleMargin: Border;\n windowMargin: Border;\n scrollableMarginLocked: boolean;\n}\n\nexport const useBoardSizeStore = defineStore(\"boardSize\", {\n state: (): State => ({\n // effective, calculated board pos/size\n size: {\n top: 0,\n left: 0,\n height: 0,\n width: 0,\n },\n // scrollable margins around the board\n scrollableMargin: {\n leftTop: windowCoord(0, 0),\n rightBottom: windowCoord(0, 0),\n },\n // visible margins around the board when zoomed to 100%\n visibleMargin: {\n leftTop: windowCoord(64, 16),\n rightBottom: windowCoord(64, 64),\n },\n // margins of the window, unavailable for the board\n windowMargin: {\n leftTop: windowCoord(0, 48),\n rightBottom: windowCoord(0, 0),\n },\n // when a side panel is open, scrollableMargins must stay\n // otherwise, we are allowed to make it smaller if possible\n scrollableMarginLocked: false,\n }),\n getters: {\n leftTopMargin: (state) =>\n plus(\n plus(state.scrollableMargin.leftTop, state.visibleMargin.leftTop),\n state.windowMargin.leftTop,\n ),\n rightBottomMargin: (state) =>\n plus(\n plus(state.scrollableMargin.rightBottom, state.visibleMargin.rightBottom),\n state.windowMargin.rightBottom,\n ),\n totalScrollableMargin: (state) =>\n plus(state.scrollableMargin.leftTop, state.scrollableMargin.rightBottom),\n totalVisibleMargin: (state) =>\n plus(state.visibleMargin.leftTop, state.visibleMargin.rightBottom),\n totalWindowMargin: (state) => plus(state.windowMargin.leftTop, state.windowMargin.rightBottom),\n },\n actions: {\n addScrollableLeftTop(margin: WindowCoordinate) {\n this.scrollableMargin.leftTop = plus(this.scrollableMargin.leftTop, margin);\n },\n addScrollableRightBottom(margin: WindowCoordinate) {\n this.scrollableMargin.rightBottom = plus(this.scrollableMargin.rightBottom, margin);\n },\n resetScrollableMargin() {\n this.scrollableMargin.leftTop = windowCoord(0, 0);\n this.scrollableMargin.rightBottom = windowCoord(0, 0);\n },\n },\n});\n","import { noop } from \"lodash-es\";\nimport { defineStore } from \"pinia\";\n\nexport const useSidePanelStore = defineStore(\"sidePanel\", {\n state: () => {\n return {\n left: { width: 0, close: noop },\n right: { width: 0, close: noop },\n };\n },\n getters: {\n panelLeftOpen: (state) => state.left.width > 0,\n panelRightOpen: (state) => state.right.width > 0,\n },\n actions: {\n /**\n * @param close function to be called before another panels opens\n * @returns if the panel width could be set\n */\n setWidth(side: \"left\" | \"right\", width: number, close: () => void) {\n const target = this[side];\n // different close function = a different panel is opened -> call close() on the old panel\n if (target.close !== close) {\n if (width === 0) {\n return false;\n }\n target.close();\n }\n target.close = width === 0 ? noop : close;\n target.width = width;\n return true;\n },\n },\n});\n","import { defineStore } from \"pinia\";\n\nimport { relativeToWindow, windowToRelative } from \"@/math/coordinate-systems\";\nimport { minus } from \"@/math/coordinates\";\nimport type { WindowCoordinate } from \"@/model/coordinates\";\nimport { relativeCoord, windowCoord } from \"@/model/coordinates\";\nimport type { ZoomedSize } from \"@/model/size\";\n\nexport const useZoomStore = defineStore(\"zoom\", {\n state: () => ({\n zooming: false,\n dropdownOpen: false,\n useZoomLayer: true,\n factor: 1, // only updated at the end of zooming\n dynamicFactor: 1, // also updated during zooming\n // the point we are zooming to/from\n center: {\n absolute: windowCoord(0, 0),\n relative: relativeCoord(0, 0),\n },\n }),\n getters: {\n zoomingWithLayer: (state) => state.zooming && state.useZoomLayer,\n },\n actions: {\n setDynamicZoomFactor(factor: number) {\n this.dynamicFactor = Math.round(100 * factor) / 100;\n },\n setZoomFactor(factor: number) {\n this.setDynamicZoomFactor(factor);\n this.updateZoomFactor();\n },\n updateZoomFactor() {\n this.factor = this.dynamicFactor;\n },\n startZoom(center: WindowCoordinate) {\n this.zooming = true;\n this.center = { absolute: center, relative: windowToRelative(center) };\n },\n endZoom() {\n this.zooming = false;\n },\n scrollToCenter(size: ZoomedSize) {\n const windowCoord = relativeToWindow(this.center.relative, size);\n const scroll = minus(windowCoord, this.center.absolute);\n window.scrollTo(Math.round(scroll.x), Math.round(scroll.y));\n },\n setDropdownOpen(open: boolean) {\n this.dropdownOpen = open;\n },\n },\n});\n","import { clamp } from \"lodash-es\";\n\nimport { boardAspect, fakeZoom, stickySize } from \"@/model/Settings\";\nimport type {\n BoardCoordinate,\n Rectangle,\n RelativeCoordinate,\n WindowCoordinate,\n} from \"@/model/coordinates\";\nimport { boardCoord, relativeCoord, windowCoord } from \"@/model/coordinates\";\nimport type { Size, ZoomedSize } from \"@/model/size\";\nimport { useBoardStore } from \"@/store/board\";\nimport { useBoardSizeStore } from \"@/store/boardSize\";\nimport { useSidePanelStore } from \"@/store/sidePanel\";\nimport { useZoomStore } from \"@/store/zoom\";\nimport { clientCoord, clientSize, scrollCoord, scrollSize } from \"@/utils/dom/coordinates\";\nimport { getScrollbarSize, isScrollbarVisible } from \"@/utils/dom/dom\";\n\nimport { divided, min, minus, plus, times } from \"./coordinates\";\n\n/**\n * Convert a window coordinate into a board coordinate.\n * @param e The window coordinate to be converted.\n * @param limitCoords If the coordinate should be checked and adjusted if needed\n * - \"input\": Check the window coordinate parameter to be inside the window\n * - \"output\": Check the resulting board coordinate to be inside the board\n * @param additionalOffsets A list of additional offsets to the given coordinate that should also be checked.\n */\nexport function windowToBoard(\n e: WindowCoordinate,\n limitCoords: \"output\" | \"none\" = \"output\",\n additionalOffsets: Array<{ offset: WindowCoordinate }> = [],\n): BoardCoordinate {\n const boardSize = useBoardSizeStore().size;\n const zoom = useZoomStore().factor;\n const xHalf = useBoardStore().currentBoard().cardSize.x / 2;\n const yHalf = useBoardStore().currentBoard().cardSize.y / 2;\n const limited = limit(e);\n for (const additional of additionalOffsets) {\n combineDeltas(limited, limit(plus(e, times(additional.offset, zoom))));\n }\n return times(plus(limited, limited.delta), fakeZoom);\n\n function limit(inp: WindowCoordinate) {\n const c = boardCoord(\n (inp.x - boardSize.left) / zoom - xHalf * boardSize.width,\n (inp.y - boardSize.top) / zoom - yHalf * boardSize.height,\n );\n return {\n ...c,\n delta: limitCoords === \"output\" ? minus(insideBoard(c), c) : boardCoord(0, 0),\n };\n }\n\n function combineDeltas(target: { delta: BoardCoordinate }, combine: { delta: BoardCoordinate }) {\n if (Math.abs(combine.delta.x) > Math.abs(target.delta.x)) {\n target.delta.x = combine.delta.x;\n }\n if (Math.abs(combine.delta.y) > Math.abs(target.delta.y)) {\n target.delta.y = combine.delta.y;\n }\n }\n}\n\nfunction insideBoard(e: BoardCoordinate): BoardCoordinate {\n const xHalf = useBoardStore().currentBoard().cardSize.x / 2;\n const yHalf = useBoardStore().currentBoard().cardSize.y / 2;\n const h = useBoardSizeStore().size.height;\n return boardCoord(\n clamp(e.x, 0, (1 - 2 * xHalf) * useBoardSizeStore().size.width),\n clamp(e.y, 0, (1 - yHalf * 2) * h),\n );\n}\n\nexport function windowToRelative(e: WindowCoordinate): RelativeCoordinate {\n const boardSize = useBoardSizeStore().size;\n const zoom = useZoomStore().factor;\n const xBase = (e.x - boardSize.left + window.scrollX) / zoom;\n const yBase = (e.y - boardSize.top + window.scrollY) / zoom;\n return relativeCoord(xBase / boardSize.width, yBase / boardSize.height);\n}\n\nexport function relativeToWindow(\n e: RelativeCoordinate,\n boardSize: ZoomedSize = {\n ...useBoardSizeStore().size,\n zoom: useZoomStore().factor,\n },\n): WindowCoordinate {\n return windowCoord(\n boardSize.zoom * (e.x * boardSize.width) + boardSize.left,\n boardSize.zoom * (e.y * boardSize.height) + boardSize.top,\n );\n}\n\nexport function boardSize(): Rectangle {\n const xHalf = useBoardStore().currentBoard().cardSize.x / 2;\n const yHalf = useBoardStore().currentBoard().cardSize.y / 2;\n const h = useBoardSizeStore().size.height;\n const p0 = boardToWindow(boardCoord(0, 0));\n const p1 = boardToWindow(\n boardCoord(\n fakeZoom * (1 - 2 * xHalf) * useBoardSizeStore().size.width,\n fakeZoom * (1 - yHalf * 2) * h,\n ),\n );\n return {\n p0: windowCoord(Math.floor(p0.x), Math.floor(p0.y)),\n p1: windowCoord(Math.ceil(p1.x), Math.ceil(p1.y)),\n };\n}\n\nexport function boardToWindow(e: BoardCoordinate): WindowCoordinate {\n const boardSize = useBoardSizeStore().size;\n const zoom = useZoomStore().factor;\n const xHalf = useBoardStore().currentBoard().cardSize.x / 2;\n const yHalf = useBoardStore().currentBoard().cardSize.y / 2;\n return windowCoord(\n (e.x / fakeZoom + xHalf * boardSize.width) * zoom + boardSize.left,\n (e.y / fakeZoom + yHalf * boardSize.height) * zoom + boardSize.top,\n );\n}\n\nexport function boardToWindowSimple(c: BoardCoordinate): WindowCoordinate {\n return divided(c, fakeZoom) as unknown as WindowCoordinate;\n}\n\nexport function windowToBoardSimple(c: WindowCoordinate): BoardCoordinate {\n return times(c, fakeZoom) as unknown as BoardCoordinate;\n}\n\n/**\n * Converts a board coordinate for the top-left corner of the card to\n * a relative coordinate for the center of the card\n *\n * @param coordinates The board coordinate for the top-left corner of the card\n * @returns The relative coordinate for the center of the card\n */\nexport function boardToRelative(coordinates: Partial): RelativeCoordinate {\n if (coordinates.x === undefined || coordinates.y === undefined) {\n return relativeCoord(0.5, 0.5);\n }\n const xHalf = useBoardStore().currentBoard().cardSize.x / 2;\n const yHalf = useBoardStore().currentBoard().cardSize.y / 2;\n return relativeCoord(\n coordinates.x / (useBoardSizeStore().size.width * fakeZoom) + xHalf,\n coordinates.y / (useBoardSizeStore().size.height * fakeZoom) + yHalf,\n );\n}\n\n/**\n * Direct conversion from board to relative coordinate\n */\nexport function boardToRelativeSimple(e: BoardCoordinate): RelativeCoordinate {\n return relativeCoord(\n e.x / (useBoardSizeStore().size.width * fakeZoom),\n e.y / (useBoardSizeStore().size.height * fakeZoom),\n );\n}\n\n/**\n * Converts a relative coordinate for the top-left corner of a card to a board coordinate\n * for the center of the card\n *\n * @param e The relative coordinate for the top-left corner of the card\n * @returns The board coordinate for the center of the card\n */\nexport function relativeToBoard(e: RelativeCoordinate): BoardCoordinate {\n const cardSize = useBoardStore().currentBoard().cardSize;\n return boardCoord((e.x / cardSize.x + 0.5) * stickySize, (e.y / cardSize.y + 0.5) * stickySize);\n}\n\n/**\n * Returns the given position of the center of the sticky, corrected to bring\n * it inside the board at the nearest edge if needed\n *\n * @param pos Position of the center of the card\n * @returns [corrected_position, delta_(offset_from_pos)]\n */\nexport function cardInsideBoardRelative(\n pos: RelativeCoordinate,\n): [RelativeCoordinate, RelativeCoordinate] {\n const { x: width, y: height } = useBoardStore().currentBoard().cardSize;\n\n const newX = clamp(pos.x, width / 2, 1 - width / 2);\n const newY = clamp(pos.y, height / 2, 1 - height / 2);\n const delta = relativeCoord(newX - pos.x, newY - pos.y);\n\n return [relativeCoord(newX, newY), delta];\n}\n\nconst scrollbarSize = getScrollbarSize();\n\n/**\n * If the card is outside the board/viewport, moves it back inside the board.\n * This modifies the first input parameter (pos) in place.\n * If 3rd arg (checkViewport) is true, the card is also moved back inside the viewport\n *\n * @returns The offset by which the card was moved\n * (explicitly as {offsetX: number, offsetY: number} to avoid confusion)\n */\nexport function validateCardPositionInBoard(\n pos: BoardCoordinate,\n size: { width: number; height: number },\n checkViewport: boolean,\n): { offsetX: number; offsetY: number } {\n const { x: originalX, y: originalY } = pos;\n const boardSize = useBoardSizeStore().size;\n const zoom = useZoomStore().factor;\n\n // card inside board\n if (pos.x < 0) {\n pos.x = 0;\n }\n let x = pos.x + size.width - boardSize.width * fakeZoom;\n if (x > 0) {\n pos.x -= x;\n }\n if (pos.y < 0) {\n pos.y = 0;\n }\n let y = pos.y + size.height - boardSize.height * fakeZoom;\n if (y > 0) {\n pos.y -= y;\n }\n\n if (!checkViewport) {\n return { offsetX: pos.x - originalX, offsetY: pos.y - originalY };\n }\n\n const scrollbarsVisible = isScrollbarVisible();\n const scrollbarX = scrollbarsVisible.x ? scrollbarSize : 0;\n const scrollbarY = scrollbarsVisible.y ? scrollbarSize : 0;\n\n const outline = 2; // the outline of the sticky note\n const gap = 2; // desired gap between sticky note and viewport\n\n // Adjust viewport size for any open side panels\n const leftPanelSize = useSidePanelStore().left.width;\n const rightPanelSize = useSidePanelStore().right.width;\n\n // card inside view port (and not hidden by side panels)\n const viewportLeft = window.scrollX - boardSize.left + leftPanelSize + outline + gap;\n const viewportRight =\n viewportLeft +\n window.innerWidth -\n leftPanelSize -\n rightPanelSize -\n scrollbarY -\n outline * 3 -\n gap;\n const viewportTop = window.scrollY + outline + gap;\n const viewportBottom =\n window.scrollY - boardSize.top - outline - scrollbarX - gap + window.innerHeight;\n\n x = pos.x * zoom - viewportLeft * fakeZoom;\n if (x < 0) {\n pos.x -= x / zoom;\n }\n x = (pos.x + size.width) * zoom - viewportRight * fakeZoom;\n if (x > 0) {\n pos.x -= x / zoom;\n }\n\n y = pos.y * zoom - viewportTop * fakeZoom;\n if (y < 0) {\n pos.y -= y / zoom;\n }\n y = (pos.y + size.height) * zoom - viewportBottom * fakeZoom;\n if (y > 0) {\n pos.y -= y / zoom;\n }\n\n return { offsetX: pos.x - originalX, offsetY: pos.y - originalY };\n}\n\nexport function calcBoardSize(zoom = useZoomStore().factor): ZoomedSize {\n const margin = useBoardSizeStore().leftTopMargin;\n const windowSize = minus(visibleWindowSize(), useBoardSizeStore().totalVisibleMargin);\n const boardSpace = minus(windowSize, useBoardSizeStore().totalScrollableMargin);\n if (windowSize.x / windowSize.y < boardAspect) {\n // window is higher than boardAspect -> make board less high, add margin at top\n const height = windowSize.x / boardAspect;\n const width = windowSize.x;\n return {\n zoom,\n top: margin.y + Math.max(0, (boardSpace.y - height * zoom) / 2),\n left: margin.x,\n height,\n width,\n };\n }\n // window is broader than boardAspect -> make board less broad, add margin at left\n const width = windowSize.y * boardAspect;\n const height = windowSize.y;\n return {\n zoom,\n top: margin.y,\n left: margin.x + Math.max(0, (boardSpace.x - width * zoom) / 2),\n height,\n width,\n };\n}\n\n/**\n * Adjust useBoardSizeStore().scrollableMargin so that\n * there is enough space for a side panel of given size without the board scrolling\n */\nexport function adjustBoardLeftSize(left: number) {\n const neededLeftSize = left - useBoardSizeStore().size.left;\n if (neededLeftSize > 0) {\n const size = useBoardSizeStore().size;\n assureBoardLeftSize(left, size, size, 1);\n } else {\n removeBoardScrollMargin(windowCoord(-neededLeftSize, 0));\n }\n}\n\nexport function removeBoardScrollMargin(size?: WindowCoordinate) {\n const docElem = document.documentElement;\n const maxScroll = minus(scrollSize(docElem), clientSize(docElem));\n const possibleLeftTop = min(\n useBoardSizeStore().scrollableMargin.leftTop,\n scrollCoord(),\n size || windowCoord(Infinity, Infinity),\n );\n const possibleRightBottom = min(\n useBoardSizeStore().scrollableMargin.rightBottom,\n minus(maxScroll, scrollCoord()),\n );\n if (\n possibleLeftTop.x !== 0 ||\n possibleLeftTop.y !== 0 ||\n possibleRightBottom.x !== 0 ||\n possibleRightBottom.y !== 0\n ) {\n useBoardSizeStore().addScrollableLeftTop(minus(possibleLeftTop));\n useBoardSizeStore().addScrollableRightBottom(minus(possibleRightBottom));\n }\n}\n\nfunction assureBoardLeftSize(size: number, initial: Size, current: Size, iter: number) {\n // endless loops should not happen, but better make sure\n if (iter > 3) {\n return;\n }\n const addLeft = Math.ceil(size - current.left);\n if (addLeft >= 1) {\n useBoardSizeStore().addScrollableLeftTop(windowCoord(addLeft, 0));\n if (maxScrollX(current) === 0) {\n // no scroll bars -> window wider than content -> board is centered -> add same space also to the right\n useBoardSizeStore().addScrollableRightBottom(windowCoord(addLeft, 0));\n }\n return assureBoardLeftSize(size, initial, calcBoardSize(), iter + 1);\n }\n // assure there's enough space to the right so that we can scroll the board\n // the amount we added to the left (so it does not move visibly)\n const needScroll = window.scrollX + (current.left - initial.left);\n const addRight = Math.floor(needScroll) - Math.ceil(maxScrollX(current));\n if (addRight > 0) {\n useBoardSizeStore().addScrollableRightBottom(windowCoord(addRight, 0));\n }\n}\n\nfunction maxScrollX(size: Size) {\n const contentWidth =\n size.left + size.width * useZoomStore().factor + useBoardSizeStore().rightBottomMargin.x;\n return Math.max(0, contentWidth - document.documentElement.clientWidth);\n}\n\nexport function relativeClientCoord(elem: MouseEvent): RelativeCoordinate {\n return windowToRelative(clientCoord(elem));\n}\n\nexport function visibleWindowSize() {\n // Using window.innerWidth and window.innerHeight instead of document.documentElement.clientWidth/clientHeight\n // because clientWidth/clientHeight excludes scrollbars. When zooming in, the browser may briefly adjust\n // the layout, causing a scrollbar to appear or disappear momentarily. This can result in a flickering\n // size calculation during that brief period. window.innerWidth/innerHeight includes the scrollbar width,\n // making the size calculations more stable during zooming.\n return minus(\n windowCoord(window.innerWidth, window.innerHeight),\n useBoardSizeStore().totalWindowMargin,\n );\n}\n","import type { Counter } from \"./Counter\";\nimport type { Board } from \"./board\";\nimport color from \"./color.module.scss\";\nimport type { RelativeCoordinate, WindowCoordinate } from \"./coordinates\";\nimport type { Icon } from \"./icon\";\nimport type { Art } from \"./session\";\nimport type { AuthUser } from \"./user\";\n\nexport interface Id {\n id: string;\n}\n\nexport type IdMap = Record;\n\nexport type WorkingMode = \"planning\" | \"execution\";\n\nexport type InfoLevel = \"default\" | \"ok\" | \"warn\" | \"error\";\n\nexport const infoLevelInfo: {\n [level in InfoLevel]: { color: string; backColor: string; icon: Icon };\n} = {\n default: {\n color: color.back,\n backColor: \"transparent\",\n icon: \"message/info\",\n },\n ok: { color: color.ok, backColor: color.okBack, icon: \"message/info\" },\n warn: { color: color.warn, backColor: color.warnBack, icon: \"message/warn\" },\n error: {\n color: color.error,\n backColor: color.errorBack,\n icon: \"message/error\",\n },\n};\n\n// Our internal color type, representing [r, g, b, a], each on the range 0-1\nexport type Color = [number, number, number, number];\n\nexport type ArtId = number;\n\nexport const boardTypes = [\n \"backlog\",\n \"program\",\n \"solution_backlog\",\n \"solution\",\n \"risk\",\n \"team\",\n \"flex\",\n \"objectives\",\n] as const;\nexport type BoardType = (typeof boardTypes)[number];\n\nconst boardI18nKeys: {\n [boardType in BoardType]: { nav: string; short: string; long: string; icon: Icon };\n} = {\n backlog: {\n nav: /*$t*/ \"board.backlog.nav\",\n short: /*$t*/ \"board.backlog\",\n long: /*$t*/ \"board.backlog.long\",\n icon: \"board/backlog\",\n },\n program: {\n nav: /*$t*/ \"board.program.nav\",\n short: /*$t*/ \"board.program\",\n long: /*$t*/ \"board.program.long\",\n icon: \"board/planning\",\n },\n solution_backlog: {\n nav: /*$t*/ \"board.backlog.nav\",\n short: /*$t*/ \"board.solutionBacklog\",\n long: /*$t*/ \"board.solutionBacklog.long\",\n icon: \"board/solution-backlog\",\n },\n solution: {\n nav: /*$t*/ \"board.solution.nav\",\n short: /*$t*/ \"board.solution\",\n long: /*$t*/ \"board.solution.long\",\n icon: \"board/solution\",\n },\n risk: {\n nav: /*$t*/ \"board.risk.nav\",\n short: /*$t*/ \"board.risk\",\n long: /*$t*/ \"board.risk.long\",\n icon: \"board/risk\",\n },\n team: {\n nav: /*$t*/ \"board.team.nav\",\n short: /*$t*/ \"board.team\",\n long: /*$t*/ \"board.team.long\",\n icon: \"board/team\",\n },\n flex: {\n nav: /*$t*/ \"board.flex\",\n short: /*$t*/ \"board.flex\",\n long: /*$t*/ \"board.flex.long\",\n icon: \"board/canvas\",\n },\n objectives: {\n nav: /*$t*/ \"board.objectives.nav\",\n short: /*$t*/ \"board.objectives\",\n long: /*$t*/ \"board.objectives.long\",\n icon: \"board/objectives\",\n },\n};\n\nexport function boardTypeName(type: BoardType) {\n return boardI18nKeys[type].short;\n}\nexport function boardNavName(type: BoardType) {\n return boardI18nKeys[type].nav;\n}\n\nexport function boardIcon(type: BoardType) {\n return boardI18nKeys[type].icon;\n}\n\nexport function boardTitle(board: Board, art?: Art | null): [string, Record] {\n const key = boardI18nKeys[board.type];\n switch (board.type) {\n case \"team\":\n return [key.long, { team: board.team.name }];\n case \"flex\":\n return [key.long, { name: board.name }];\n default: {\n if (art === undefined) {\n return [key.short, {}];\n }\n const hasArt = board.artId && art?.name;\n return [key.long, { art: hasArt ? `(${art.name})` : \"\" }];\n }\n }\n}\n\nexport function isBoardType(s: string): s is BoardType {\n return boardTypes.includes(s as BoardType);\n}\n\nexport const riskTypes = [\"R\", \"O\", \"A\", \"M\", \"\"] as const;\nexport type RiskType = (typeof riskTypes)[number];\n\nconst riskI18nKeys: {\n [id in RiskType]: { short: string; long: string; icon: Icon };\n} = {\n R: {\n short: /*$t*/ \"risk.resolved.short\",\n long: /*$t*/ \"risk.resolved\",\n icon: \"risk/resolved\",\n },\n O: {\n short: /*$t*/ \"risk.owned.short\",\n long: /*$t*/ \"risk.owned\",\n icon: \"risk/owned\",\n },\n A: {\n short: /*$t*/ \"risk.accepted.short\",\n long: /*$t*/ \"risk.accepted\",\n icon: \"risk/accepted\",\n },\n M: {\n short: /*$t*/ \"risk.mitigated.short\",\n long: /*$t*/ \"risk.mitigated\",\n icon: \"risk/mitigated\",\n },\n \"\": {\n short: /*$t*/ \"risk.unRoam.short\",\n long: /*$t*/ \"risk.unRoam\",\n icon: \"risk/roam\",\n },\n};\n\nexport function riskTypeName(risk: RiskType) {\n return riskI18nKeys[risk].short;\n}\n\nexport function riskTitle(risk: RiskType) {\n return riskI18nKeys[risk].long;\n}\n\nexport function riskIcon(risk: RiskType) {\n return riskI18nKeys[risk].icon;\n}\n\nexport const statusClasses = [\"undefined\", \"todo\", \"in-progress\", \"done\"] as const;\nexport type StatusClass = (typeof statusClasses)[number];\n\nexport const statusClassNames: { [key in StatusClass]: string } = {\n undefined: /*$t*/ \"statusClass.unknown\",\n todo: /*$t*/ \"statusClass.toDo\",\n \"in-progress\": /*$t*/ \"statusClass.inProgress\",\n done: /*$t*/ \"statusClass.done\",\n};\n\nexport type AlmSourceId = number | string;\n\ntype AlmType = \"jira\" | \"ac\" | \"ado\" | \"\";\n\nexport interface AlmTypeInfo {\n name: string;\n cockpitPath: string;\n icon: `alm/${Exclude}` | \"base/minus\";\n colorIcon: `alm/${Exclude}-color` | \"base/minus\";\n isUserMapped: boolean;\n hasAssignee: boolean;\n}\n\nexport const almTypeInfo: { [type in AlmType]: AlmTypeInfo } = {\n jira: {\n name: \"Jira\",\n cockpitPath: \"jira\",\n icon: \"alm/jira\",\n colorIcon: \"alm/jira-color\",\n isUserMapped: true,\n hasAssignee: true,\n },\n ado: {\n name: \"Azure DevOps\",\n cockpitPath: \"ado\",\n icon: \"alm/ado\",\n colorIcon: \"alm/ado-color\",\n isUserMapped: false,\n hasAssignee: false,\n },\n ac: {\n name: \"Rally\",\n cockpitPath: \"ac\",\n icon: \"alm/ac\",\n colorIcon: \"alm/ac-color\",\n isUserMapped: true,\n hasAssignee: true,\n },\n \"\": {\n name: \"\",\n cockpitPath: \"\",\n icon: \"base/minus\",\n colorIcon: \"base/minus\",\n isUserMapped: false,\n hasAssignee: true,\n },\n};\n\nexport interface Pointer {\n user: AuthUser;\n relativePos: RelativeCoordinate;\n windowPos: Array<{ pos: WindowCoordinate; index: number }>;\n timestamp: number;\n}\n\nexport interface Statistics {\n calls: Counter;\n publishes: Counter;\n sends: Counter;\n receives: Counter;\n subscriptions: number;\n reconnects: number;\n}\n","import { defineStore } from \"pinia\";\n\nimport type { Art } from \"@/model/session\";\nimport { i18n } from \"@/translations/i18n\";\n\nimport { useBoardsStore } from \"./boards\";\n\nexport const NO_ART = { id: \"\", name: \"\" };\n\ninterface State {\n arts: Art[];\n current: Art;\n}\n\nexport const useArtStore = defineStore(\"art\", {\n state: (): State => ({ arts: [], current: NO_ART }),\n getters: {\n isMultiArt: (state) => {\n return state.arts.length > 1;\n },\n artById: (state) => (artId?: Art[\"id\"] | null) => {\n return state.arts.find((a) => a.id === artId);\n },\n noArt: () => {\n return { id: NO_ART.id, name: i18n.global.t(\"general.noArt\") };\n },\n },\n actions: {\n setArts(arts: Art[]) {\n this.arts = arts;\n this.setCurrent(NO_ART);\n },\n // this should only be called from team store\n setCurrent(art: Art) {\n this.current = art;\n useBoardsStore().updateObjectiveBoardId();\n },\n isCurrentArt(artId?: string) {\n return !this.isMultiArt || artId === this.current.id;\n },\n },\n});\n","import { noop } from \"lodash-es\";\n\nimport { interpolate } from \"@/math/coordinates\";\nimport { moveAnimationDelay, moveAnimationStep } from \"@/model/Settings\";\nimport type { IdMap } from \"@/model/baseTypes\";\nimport type { BoardCard } from \"@/model/card\";\nimport type { RelativeCoordinate } from \"@/model/coordinates\";\n\nexport function animateCardMove(\n card: BoardCard | undefined,\n coord: RelativeCoordinate,\n moveFn: (c: RelativeCoordinate) => void,\n endFn?: () => void,\n) {\n if (card) {\n animations[card.data.id] = {\n from: card.meta.pos,\n to: coord,\n moveFn,\n endFn: endFn || noop,\n t: 0,\n };\n }\n}\n\nexport function animateLinkMove(\n card: BoardCard,\n coord: RelativeCoordinate,\n moveFn: (c: RelativeCoordinate) => void,\n endFn: () => void,\n) {\n animations[card.data.id] = {\n from: coord,\n to: { ...card.meta.pos },\n moveFn,\n endFn,\n t: 0,\n };\n}\n\nexport function clear() {\n for (const id in animations) {\n delete animations[id];\n }\n}\n\ninterface Animation {\n from: RelativeCoordinate;\n to: RelativeCoordinate;\n moveFn: (c: RelativeCoordinate) => void;\n endFn: () => void;\n t: number;\n}\n\nconst animations: IdMap = {};\n\nanimate();\n\nfunction animate() {\n for (const id in animations) {\n const d = animations[id];\n d.t += moveAnimationStep;\n d.moveFn(interpolate(d.t, d.from, d.to));\n if (d.t >= 1) {\n d.endFn();\n delete animations[id];\n }\n }\n setTimeout(animate, moveAnimationDelay);\n}\n","import { defineStore } from \"pinia\";\n\nimport type { License, LicenseType } from \"@/model/session\";\n\nimport { useUserStore } from \"./user\";\n\nexport const useLicenseStore = defineStore(\"license\", {\n state: (): { license: License } => ({\n license: {\n daysTillExpiration: null,\n usable: true,\n plan: \"standard\",\n tracking: false,\n type: \"trial\",\n onPrem: false,\n },\n }),\n getters: {\n isExpired: (state) => {\n const expire = state.license.daysTillExpiration;\n return expire !== null && expire <= 0;\n },\n willExpireIn: (state) => {\n const expire = state.license.daysTillExpiration;\n if (expire !== null && expire < 30 && expire > 0) {\n return expire;\n }\n },\n },\n actions: {\n setLicense(e: {\n validDays: number;\n plan: License[\"plan\"];\n tracking: boolean;\n type: LicenseType;\n onPrem: boolean;\n }) {\n this.license.daysTillExpiration = e.validDays;\n this.license.usable = e.validDays >= 0 || useUserStore().isAllowed(\"useWithoutLicense\");\n this.license.plan = e.plan;\n this.license.tracking = e.tracking;\n this.license.type = e.type;\n this.license.onPrem = e.onPrem;\n },\n },\n});\n","import * as amplitude from \"@amplitude/analytics-browser\";\n\nimport type { AuthUser, TechnicalUser } from \"@/model/user\";\nimport { type ClientSettings, useClientSettingsStore } from \"@/store/clientSettings\";\nimport { useLicenseStore } from \"@/store/license\";\nimport { getConfig } from \"@/utils/env/Environment\";\n\nimport { userSettingChanged } from \"./events\";\nimport { trackEvent } from \"./track\";\n\nexport function identifyUser(authUser: AuthUser, user: TechnicalUser) {\n amplitude.setUserId(user.id);\n\n const { type, plan } = useLicenseStore().license;\n const { company, role, teams } = user;\n const teamIds = teams?.map((team) => team.id) || [];\n\n const identifyEvent = new amplitude.Identify();\n identifyEvent.set(\"company\", company);\n identifyEvent.set(\"role\", role);\n identifyEvent.set(\"type\", type);\n identifyEvent.set(\"isLicenseExpired\", useLicenseStore().isExpired);\n identifyEvent.set(\"plan\", plan);\n identifyEvent.set(\"build_hash\", getConfig().build.hash);\n identifyEvent.set(\"teams\", teamIds);\n identifyEvent.set(\"language\", authUser.preferredLanguage);\n identifyEvent.set(\"screenSize\", `${screen.width}x${screen.height}`);\n\n amplitude.identify(identifyEvent);\n}\n\n/**\n * Track most settings from ClientSettingsStore as amplitude user properties.\n */\nexport function identifyUserSettings() {\n const settings = useClientSettingsStore();\n\n const identifyEvent = new amplitude.Identify();\n\n for (const k in settings) {\n const key = k as keyof ClientSettings;\n\n if (isTrackedSettingsKey(key)) {\n const value = settings[key].toString();\n identifyEvent.set(key, value);\n }\n }\n\n amplitude.identify(identifyEvent);\n}\n\ntype CustomAmplitudeUserProperty =\n | \"company\"\n | \"role\"\n | \"plan\"\n | \"language\"\n | keyof ClientSettings\n | \"workingMode\";\n\n/**\n * Set any custom amplitude user property\n * (the new value will be added to all future events)\n *\n * @param property Property name\n * @param value Property value\n */\nexport function setUserProperty(\n property: CustomAmplitudeUserProperty,\n value: amplitude.Types.ValidPropertyType,\n) {\n const identifyEvent = new amplitude.Identify();\n identifyEvent.set(property, value);\n amplitude.identify(identifyEvent);\n}\n\n/**\n * ClientSettings we want to track.\n * Excluding\n * - workingMode (already tracked separately)\n * - defaultStickyType (difficult to track as it's per-board)\n */\nconst trackedSettings = [\n \"stickyFont\",\n \"wheelZoom\",\n \"overload\",\n \"permanentTeamLinks\",\n \"permanentProgramLinks\",\n \"initialLineupDistance\",\n \"showStats\",\n \"overviewScale\",\n \"highContrastMode\",\n \"textAlignment\",\n \"archivedSessions\",\n] as const;\ntype TrackedSettingsKey = (typeof trackedSettings)[number];\n\nfunction isTrackedSettingsKey(key: string): key is TrackedSettingsKey {\n return trackedSettings.includes(key as any);\n}\n\nexport function trackUserSettingsChanged(newSettings: ClientSettings, oldSettings: ClientSettings) {\n // Send events to amplitude when any _tracked_ user setting is changed\n for (const k in newSettings) {\n const key = k as keyof ClientSettings;\n\n // Only track the updated setting, and only if it's in trackedSettings\n if (isTrackedSettingsKey(key) && newSettings[key] !== oldSettings[key]) {\n trackEvent(\n userSettingChanged({\n key,\n fromValue: oldSettings[key].toString(),\n toValue: newSettings[key].toString(),\n }),\n );\n setUserProperty(key, newSettings[key]);\n }\n }\n}\n","import axios from \"axios\";\n\nimport { i18n } from \"@/translations/i18n\";\nimport { setUserProperty } from \"@/utils/analytics/trackUser\";\nimport { addFontFamily } from \"@/utils/dom/dom\";\n\nexport async function setLanguage(lang: string) {\n setUserProperty(\"language\", lang);\n if (lang === \"ja\") {\n addFontFamily(document.documentElement, \"Noto Sans JP\");\n }\n await setI18nLanguage(lang);\n}\n\nconst loadedLanguages = [\"en\", \"none\"];\n\nasync function setI18nLanguage(lang: string) {\n try {\n if (i18n.global.locale.value !== lang && !loadedLanguages.includes(lang)) {\n const messages = await import(`./translations/${lang}.json`);\n i18n.global.setLocaleMessage(lang, messages.default);\n loadedLanguages.push(lang);\n }\n i18n.global.locale.value = lang;\n axios.defaults.headers.common[\"Accept-Language\"] = lang;\n document.querySelector(\"html\")?.setAttribute(\"lang\", lang);\n } catch (e) {\n // ignore when loading messages goes wrong\n }\n}\n","import type { AlmTypeInfo } from \"./baseTypes\";\nimport color from \"./color.module.scss\";\nimport type { Icon } from \"./icon\";\nimport type { Team } from \"./session\";\n\n// basic user information about the current user returned from the isAuthenticated endpoint\nexport interface TechnicalUser {\n id: string;\n company: string;\n role: Role;\n teams: Team[];\n}\n\nconst roles = [\"observer\", \"user\", \"admin\", \"planning_interval_admin\"] as const;\n\nexport type Role = (typeof roles)[number];\n\nexport function technicalUser(id: string, company: string, role: string): TechnicalUser {\n return { id, company, role: asRole(role), teams: [] };\n}\n\nfunction asRole(s: string): Role {\n const r = s as Role;\n return roles.includes(r) ? r : \"observer\";\n}\n\n// extended user information about any user returned from the getUser endpoint\nexport type AuthUser = PersonalUser | AlmUser;\n\ntype UserType =\n | \"regular\" // regular user\n | \"backend\" // user running tasks in the backend\n | \"alm\" // alm tool user e.g. jira\n | \"unknown\" // could not load the user from backend\n | \"loading\" // user in loading state\n | \"no\"; // no user (for search by assignee)\n\nexport interface PersonalUser {\n type: UserType;\n id: string;\n name: string;\n email: string;\n imageUrl?: string;\n color: string;\n preferredLanguage: string;\n hash?: string;\n almMapping?: AlmMapping;\n}\n\nexport type AlmMapping = \"complete\" | \"pip-only\" | \"alm-only\";\n\nexport interface AlmUser extends PersonalUser {\n type: \"alm\";\n iconName: Icon; // (e.g. the 'jira' icon)\n}\n\ninterface OrgEntity {\n id: string;\n name: string;\n}\n\nexport interface UserOrgEntities {\n team: OrgEntity[];\n art: OrgEntity[];\n train: OrgEntity[];\n}\n\nexport const emptyUserOrgEntities: UserOrgEntities = {\n team: [],\n art: [],\n train: [],\n};\n\nexport const baseUser = {\n email: \"\",\n color: color.menu, // Must be a valid hex color\n preferredLanguage: \"en\",\n};\n\nexport function backendUser(): AuthUser {\n return {\n ...baseUser,\n type: \"backend\",\n id: \"backend\",\n name: \"System\",\n };\n}\n\nexport function isBackendUserId(userId: string) {\n return userId === \"backend\";\n}\n\n/**\n * Generates a user representing the session's ALM tool\n * (since a session can only have one ALM, we know any\n * 'backend' events are coming from that ALM)\n */\nexport function almUser(almInfo: AlmTypeInfo): AlmUser {\n return {\n ...baseUser,\n type: \"alm\",\n id: \"alm\",\n name: almInfo.name,\n iconName: almInfo.colorIcon,\n };\n}\n\nexport function isAlmUser(user: AuthUser): user is AlmUser {\n return user.type === \"alm\";\n}\n\nexport function almOnlyUser(id: string, color: string): PersonalUser {\n const name = id.substring(0, 6) + \" \" + id.substring(id.length - 6);\n return {\n ...baseUser,\n type: \"regular\",\n almMapping: \"alm-only\",\n id,\n name,\n color,\n };\n}\n\nexport function isUnknownUser(user: AuthUser | null) {\n return !user || user?.type === \"unknown\";\n}\n","import { removeBoardSubscriptions } from \"@/backend/Backend\";\nimport { sender } from \"@/backend/Sender\";\nimport type { Board } from \"@/model/board\";\nimport type { BoardCard } from \"@/model/card\";\nimport { offScreen } from \"@/model/coordinates\";\nimport { useBoardStore } from \"@/store/board\";\n\nexport const internalActions = {\n switchBoard(board?: Board) {\n const { switched, board: oldBoard, cards } = useBoardStore().switchBoard(board);\n cleanupBoard(oldBoard, cards, switched);\n },\n\n leaveBoard() {\n const { board, cards } = useBoardStore().leaveBoard();\n cleanupBoard(board, cards, true);\n },\n\n /**\n * Deselect all selected cards from the given board and\n * send a stopAlter for each card that was deselected\n */\n clearCardSelection(board: Board) {\n clearStickySelection(board);\n },\n};\n\nfunction cleanupBoard(board: Board | undefined, cards: BoardCard[], newBoard: boolean) {\n if (board) {\n for (const card of cards) {\n sender.stopAlterCard(board.id, card.data.id, { type: card.data.type });\n }\n sender.pointerPos(board.id, offScreen);\n clearStickySelection(board);\n }\n if (newBoard) {\n void removeBoardSubscriptions();\n }\n}\n\nfunction clearStickySelection(board: Board) {\n for (const stickyId in board.selected) {\n useBoardStore().unselectSticky(stickyId, board);\n sender.stopAlterCard(board.id, stickyId);\n }\n}\n","/**\n * Keeps track of the server time and its difference to the local user's time.\n * Publishes every second a \"serverTick\" event with the current server time.\n */\nimport { getServerInfo, loggedIn } from \"@/backend/Backend\";\nimport { sendServerTick } from \"@/composables/useEventBus\";\nimport type { ServerTime } from \"@/model/timer\";\nimport { isBrowserTabActive } from \"@/utils/dom/dom\";\n\nconst maxTimeDiffBetweenTicks = 3000;\nconst maxDelayForSyncRequest = 2000;\nconst maxSyncRetries = 5;\n\n// difference between server time and local time\nlet timeDiff = 0;\nlet lastTime = 0;\nlet shouldSync = false;\nlet timeout = 0;\n\nexport let serverTime: ServerTime = Date.now() as ServerTime;\n\nexport async function startServerTicks() {\n await syncServerTime();\n updateTime();\n void nextTick();\n}\n\nexport function stopServerTicks() {\n clearTimeout(timeout);\n}\n\nasync function nextTick() {\n if (shouldSync || Math.abs(Date.now() - lastTime) > maxTimeDiffBetweenTicks) {\n if (loggedIn() && isBrowserTabActive()) {\n await syncServerTime();\n shouldSync = false;\n } else {\n shouldSync = true;\n }\n }\n updateTime();\n sendServerTick(serverTime);\n timeout = window.setTimeout(nextTick, 1000);\n}\n\nfunction updateTime() {\n lastTime = Date.now();\n serverTime = (lastTime + timeDiff) as ServerTime;\n}\n\nasync function syncServerTime(retry = 0) {\n const before = Date.now();\n const info = await getServerInfo();\n const after = Date.now();\n if (after - before > maxDelayForSyncRequest && retry < maxSyncRetries) {\n await syncServerTime(retry + 1);\n } else {\n const estimatedArrivalAtServer = (after + before) / 2;\n timeDiff = info.time * 1000 - estimatedArrivalAtServer;\n }\n}\n","import type { StatusClass } from \"@/model/baseTypes\";\nimport type { AlmItemStatus, AlmItemType, Status } from \"@/model/status\";\n\nexport function dynamicStatus(status: string, statusClass?: StatusClass) {\n return createAlmItemStatus(namedStatus(status, statusClass), [], {\n dynamic: true,\n });\n}\n\nexport function fallbackStatus(almItemType: AlmItemType, status: string) {\n return createAlmItemStatus(\n namedStatus(status),\n almItemType.dynamic ? [] : almItemType.globalTargetStatuses,\n { dynamic: almItemType.dynamic },\n );\n}\n\nconst toDo = createStatus(\"toDo\", \"To Do\", \"todo\", 0);\nconst inProgress = createStatus(\"inProgress\", \"In Progress\", \"in-progress\", 1);\nconst done = createStatus(\"done\", \"Done\", \"done\", 2);\n\nexport const initialDefaultStatus = createAlmItemStatus(\n toDo,\n [\n { transition: { id: \"t1\", name: \"T1\" }, status: inProgress, fields: [] },\n { transition: { id: \"t2\", name: \"T2\" }, status: done, fields: [] },\n ],\n { initial: true },\n);\n\nexport const defaultStatuses = [\n initialDefaultStatus,\n createAlmItemStatus(inProgress, [\n { transition: { id: \"t3\", name: \"T3\" }, status: toDo, fields: [] },\n { transition: { id: \"t4\", name: \"T4\" }, status: done, fields: [] },\n ]),\n createAlmItemStatus(done, [\n { transition: { id: \"t5\", name: \"T5\" }, status: toDo, fields: [] },\n { transition: { id: \"t6\", name: \"T6\" }, status: inProgress, fields: [] },\n ]),\n];\n\nfunction namedStatus(status: string, statusClass?: StatusClass) {\n return createStatus(status, status, statusClass || \"undefined\", 0);\n}\n\nfunction createStatus(id: string, name: string, statusClass: StatusClass, order: number): Status {\n return { id, name, statusClass, order };\n}\n\nfunction createAlmItemStatus(\n baseStatus: Status,\n next: AlmItemStatus[\"next\"],\n options: { dynamic?: boolean; initial?: boolean } = {},\n): AlmItemStatus {\n return {\n ...baseStatus,\n dynamic: !!options.dynamic,\n initial: !!options.initial,\n next,\n };\n}\n","import { defineStore } from \"pinia\";\n\nimport type { AlmSourceId, BoardType, IdMap, StatusClass } from \"@/model/baseTypes\";\nimport type { Board } from \"@/model/board\";\nimport type { Card } from \"@/model/card\";\nimport type { AlmItemStatus, AlmItemType, AlmItemTypeMap } from \"@/model/status\";\nimport type { StickyType } from \"@/model/stickyType\";\n\nimport {\n defaultStatuses,\n dynamicStatus,\n fallbackStatus,\n initialDefaultStatus,\n} from \"./helpers/almItemStatus\";\n\nconst emptyAlmItemType = {\n statuses: [],\n globalTargetStatuses: [],\n dynamic: false,\n};\n\nexport const useAlmItemTypeStore = defineStore(\"almItemTypes\", {\n state: () => ({\n almItemTypes: {} as IdMap,\n }),\n getters: {},\n actions: {\n findAlmItemType(\n type: StickyType,\n teamId: string | null | undefined,\n artId: string | null | undefined,\n almSourceId: AlmSourceId | null,\n ): AlmItemType {\n const boardKey = this.getBoardKey(type.origin, artId ?? undefined, teamId ?? undefined);\n const almItemTypes = this.almItemTypes[type.id] || {};\n const mappingAlmItemType = almItemTypes[boardKey ?? \"\"] || almItemTypes[\"\"];\n return (\n mappingAlmItemType?.[almSourceId ?? \"\"] || mappingAlmItemType?.[\"\"] || emptyAlmItemType\n );\n },\n getBoardKey(\n boardType: BoardType,\n artId: string | undefined,\n teamId: string | undefined,\n ): string | undefined {\n switch (boardType) {\n case \"backlog\":\n return artId;\n case \"team\":\n return teamId;\n }\n },\n calcStatus(\n status: string | undefined,\n type: StickyType,\n teamId: string | null | undefined,\n artId: string | null | undefined,\n almSourceId: AlmSourceId | null,\n statusClass?: StatusClass,\n ): AlmItemStatus | undefined {\n if (type.functionality !== \"workitem\") {\n return;\n }\n const almItemType = this.findAlmItemType(type, teamId, artId, almSourceId);\n return status\n ? this.findStatus(almItemType, status, statusClass)\n : this.findInitialStatus(almItemType);\n },\n findStatusForCard(\n status: string,\n card: Card,\n board: Board,\n statusClass?: StatusClass,\n ): AlmItemStatus {\n const almItemType = this.findAlmItemType(\n card.type,\n card.teamId,\n board.artId ?? card.artId,\n card.almSourceId,\n );\n return this.findStatus(almItemType, status, statusClass);\n },\n findStatus(almItemType: AlmItemType, status: string, statusClass?: StatusClass): AlmItemStatus {\n // if no ALM tool -> default statuses\n if (almItemType.statuses.length === 0) {\n if (almItemType.dynamic) {\n return dynamicStatus(status, statusClass);\n }\n const defaultStatus = defaultStatuses.find((s) => s.name === status);\n if (!defaultStatus) {\n return initialDefaultStatus;\n }\n return defaultStatus;\n }\n const almItemStatus = almItemType.statuses.find((s) => s.name === status);\n if (almItemStatus) {\n return almItemStatus;\n }\n // if alm tool & no status found -> undefined\n return fallbackStatus(almItemType, status);\n },\n findInitialStatus(almItemType: AlmItemType): AlmItemStatus {\n const initial = almItemType.statuses.find((s) => s.initial);\n if (initial) {\n return initial;\n }\n return initialDefaultStatus;\n },\n async updateAlmItemType(card: Card, board: Board, almItemType: AlmItemType) {\n const existing = this.findAlmItemType(card.type, card.teamId, board.artId, card.almSourceId);\n existing.globalTargetStatuses = almItemType.globalTargetStatuses;\n existing.statuses = almItemType.statuses;\n },\n },\n});\n","import { defineStore } from \"pinia\";\n\ninterface CompanySettings {\n autoLogoutAfter?: number;\n}\n\nexport const useCompanySettingsStore = defineStore(\"companySettings\", {\n state: () => ({\n autoLogoutAfter: 0,\n }),\n\n actions: {\n setCompanySettings(settings: CompanySettings) {\n this.$patch(settings);\n },\n },\n});\n","export class RingBuffer {\n private data = new Array();\n private start = 0;\n private len = 0;\n\n constructor(private size: number) {}\n\n add(value: T) {\n if (this.len < this.size) {\n this.len++;\n }\n this.data[this.start] = value;\n this.start = (this.start + 1) % this.size;\n }\n\n get() {\n const res = [...this.data.slice(this.start), ...this.data.slice(0, this.start)];\n res.splice(this.len);\n return res;\n }\n}\n","import { defineStore } from \"pinia\";\n\nimport { RingBuffer } from \"@/utils/RingBuffer\";\n\nexport const useConnectionStore = defineStore(\"connection\", {\n state: () => {\n return {\n netWs: true,\n netOnline: true,\n alm: true,\n lastConnect: 0,\n lastDisconnect: 0,\n reconnects: 0,\n wsStates: new RingBuffer<{ timestamp: number; state: string }>(20),\n };\n },\n getters: {\n isConnected(state) {\n return state.netWs && state.netOnline;\n },\n },\n actions: {\n addWebsocketState(state: string) {\n this.wsStates.add({ timestamp: Date.now(), state });\n },\n setOffline() {\n this.lastDisconnect = Date.now();\n this.netOnline = false;\n },\n setOnline() {\n this.lastConnect = Date.now();\n this.netOnline = true;\n },\n disconnectWebsocket() {\n this.netWs = false;\n },\n reconnectWebsocket() {\n this.reconnects++;\n this.netWs = true;\n },\n },\n});\n","import { defineStore } from \"pinia\";\n\nimport { captureMessage } from \"@/error/sentry\";\n\nimport { useBoardStore } from \"./board\";\n\nconst total = 16;\n\nexport const useLoadingStore = defineStore(\"loading\", {\n state: () => ({\n items: { started: new Array(), loading: new Array() },\n started: 0,\n finished: 0,\n ended: false,\n }),\n getters: {\n progress: (state) => ({\n started: state.started / total,\n finished: state.finished / total,\n }),\n count: (state) => (type: string) => state.items.started.filter((item) => item === type).length,\n },\n actions: {\n start() {\n this.items.started = [];\n this.items.loading = [];\n this.started = 0;\n this.finished = 0;\n },\n end() {\n this.ended = true;\n if (this.started !== total || this.finished !== total) {\n // TODO avoid sentry spam, remove when REN-13052 is fixed\n if (this.multipleSetSession()) {\n return;\n }\n // TODO going to a flex board directly via URL loads the board twice\n // this could be fixed, but until then, don't log it to sentry.\n if (this.doubleLoadBoardOnFlex()) {\n return;\n }\n void captureMessage(\"loading items count not reached\", {\n counts: {\n total,\n items: this.items,\n started: this.started,\n finished: this.finished,\n },\n });\n }\n },\n doubleLoadBoardOnFlex() {\n return (\n useBoardStore().board?.type === \"flex\" &&\n this.started === this.finished &&\n this.count(\"loading.board\") === 2 &&\n this.started - total === 1\n );\n },\n multipleSetSession() {\n const setSessionCount = this.count(\"loading.setSession\");\n return (\n this.started === this.finished &&\n setSessionCount <= 3 &&\n setSessionCount - 1 === this.started - total\n );\n },\n load(item: string, action: Promise): Promise {\n if (this.ended) {\n return action;\n }\n this.started++;\n this.items.started.push(item);\n this.items.loading.push(item);\n return action.finally(() => {\n this.finished++;\n this.items.loading.splice(\n this.items.loading.findIndex((i) => i === item),\n 1,\n );\n });\n },\n },\n});\n","import { defineStore } from \"pinia\";\n\nimport type { BoardType } from \"@/model/baseTypes\";\n\nexport const useServerSettingsStore = defineStore(\"serverSettings\", {\n state: () => {\n return {\n isBacklogAlmStickyDeletable: true,\n isTeamAlmStickyDeletable: true,\n isPriorityEditable: true,\n confirmDelete: true,\n moveBetweenTeams: true,\n mirrorAssignedBacklogStickiesToTeamBoard: true,\n iterationLoadWarn: null as number | null,\n iterationLoadCritical: null as number | null,\n };\n },\n getters: {\n isStickyDeletable: (state) => (boardType: BoardType) => {\n switch (boardType) {\n case \"backlog\":\n return state.isBacklogAlmStickyDeletable;\n case \"team\":\n return state.isTeamAlmStickyDeletable;\n default:\n return true;\n }\n },\n },\n actions: {},\n});\n","import type { IdMap } from \"./baseTypes\";\n\nexport class Counter {\n ok = 0;\n fail = 0;\n okDetail: IdMap = {};\n failDetail: IdMap = {};\n\n constructor(counter?: Counter) {\n if (counter) {\n this.ok = counter.ok;\n this.fail = counter.fail;\n this.okDetail = { ...counter.okDetail };\n this.failDetail = { ...counter.failDetail };\n }\n }\n\n addOk(detail?: string) {\n this.ok++;\n if (detail) {\n if (!(detail in this.okDetail)) {\n this.okDetail[detail] = 0;\n }\n this.okDetail[detail]++;\n }\n }\n\n addFail(detail?: any) {\n this.fail++;\n if (detail) {\n const key = detail.code || detail.message || detail.toString();\n if (!(key in this.failDetail)) {\n this.failDetail[key] = 0;\n }\n this.failDetail[key]++;\n }\n }\n}\n","import { defineStore } from \"pinia\";\n\nimport { Counter } from \"@/model/Counter\";\nimport { statHistory } from \"@/model/Settings\";\nimport type { Statistics } from \"@/model/baseTypes\";\n\nexport const useStatisticsStore = defineStore(\"statistics\", {\n state: () => ({ statistics: [newEntry(0)] }),\n getters: {\n current: (state) => state.statistics[state.statistics.length - 1],\n },\n actions: {\n addNewEntry(subscriptions: number) {\n this.statistics.push(newEntry(subscriptions, this.current));\n if (this.statistics.length > statHistory) {\n this.statistics.splice(0, 1);\n }\n },\n },\n});\n\nfunction newEntry(subscriptions: number, oldEntry?: Statistics) {\n return {\n receives: new Counter(oldEntry?.receives),\n calls: new Counter(oldEntry?.calls),\n publishes: new Counter(oldEntry?.publishes),\n sends: new Counter(oldEntry?.sends),\n subscriptions,\n reconnects: oldEntry?.reconnects || 0,\n };\n}\n","import { defineStore } from \"pinia\";\n\nimport { errorDialogSeen } from \"@/utils/analytics/events\";\nimport { trackEvent } from \"@/utils/analytics/track\";\n\nexport const useGlobalErrorStore = defineStore(\"globalError\", {\n state: () => ({\n globalError: null as {\n error: any;\n timestamp: number;\n message?: string;\n } | null,\n }),\n actions: {\n setGlobalError(error: unknown, message?: string) {\n this.globalError = { error, timestamp: Date.now(), message };\n trackEvent(errorDialogSeen());\n },\n },\n getters: {\n errorDetails: (state) => {\n if (!state.globalError) return null;\n\n const e = state.globalError;\n // Extract the error message (can be nested in different places, depending on the shape of error)\n const errorMessage = e.error instanceof Error && e.error.toString();\n const shortMessage = errorMessage || e.error?.message || e.error?.name || e.message || \"\";\n\n // Extract the correlation ID (it can also be in different places)\n const correlationId =\n e.error?.contexts?.request?.correlationId ||\n e.error?.contexts?.cause?.config?.headers?.[\"correlation-id\"] ||\n \"\";\n\n return {\n time: new Date(e.timestamp).toISOString(),\n shortMessage,\n correlationId: correlationId?.toString?.(),\n };\n },\n },\n});\n","export class ApplicationError extends Error {\n constructor(\n public name: string,\n message: string,\n public contexts: Contexts,\n ) {\n super(message);\n }\n}\n\ntype Contexts = Record>;\n","import { ApplicationError } from \"./ApplicationError\";\n\n// Throw this when an action should be cancelled (e.g. due to no network, page reloading)\n// and no useful data can be returned to the caller, but the error should NOT be logged.\nexport class CancelError extends ApplicationError {\n constructor(message: string, cause: Record = {}) {\n super(\"CancelError\", message, { cause });\n }\n}\n","import { ApplicationError } from \"./ApplicationError\";\n\nexport class UnauthenticatedError extends ApplicationError {\n constructor(cause: Record = {}) {\n super(\"UnauthenticatedError\", \"\", { cause });\n }\n}\n","import { AxiosError } from \"axios\";\n\nimport { currentRoute } from \"@/router/navigation\";\nimport type { ExtendedRequestConfig } from \"@/services/api.config\";\nimport { useGlobalErrorStore } from \"@/store/globalError\";\n\nimport { CancelError } from \"./CancelError\";\nimport { UnauthenticatedError } from \"./UnauthenticatedError\";\nimport { captureException, captureMessage } from \"./sentry\";\n\nconst UNAUTHENTICATED_MARKER = \"reason=unauthenticated\";\n\nexport function handleError(error: unknown, message?: string): false | undefined {\n if (error instanceof TypeError) {\n // browser specific error messages, one for chrome, one for firefox\n if (\n error.message.startsWith(\"Failed to fetch dynamically imported module\") ||\n error.message.startsWith(\"error loading dynamically imported module\")\n ) {\n window.location.reload();\n return;\n }\n }\n if (error instanceof UnauthenticatedError) {\n if (window.location.search.includes(UNAUTHENTICATED_MARKER)) {\n void captureMessage(\"Stopped unauthenticated reload cycle.\");\n } else {\n window.location.search += \"&\" + UNAUTHENTICATED_MARKER;\n }\n return;\n }\n if (error instanceof CancelError) {\n return;\n }\n if (currentRoute().name !== \"app\" && currentRoute().name !== \"login\") {\n void captureException(error, { info: { message } });\n useGlobalErrorStore().setGlobalError(error, message);\n return false;\n }\n if (handleAxiosError(error, message)) {\n return;\n }\n void captureException(error);\n}\n\nfunction handleAxiosError(error?: unknown, message?: string) {\n if (!isAxiosError(error)) {\n return false;\n }\n const config = error.config as ExtendedRequestConfig;\n const request = {\n url: joinUrl(config.baseURL, config.url),\n timeout: config.timeout,\n headers: config.headers,\n params: config.params,\n sentAt: config.sentAt,\n retry: config.retry,\n isGoogleReachable: config.isGoogleReachable,\n correlationId: config.headers?.[\"correlation-id\"],\n };\n const response = {\n data: error.response?.data,\n status: error.response?.status,\n statusText: error.response?.statusText,\n headers: (error.response?.headers || {}) as Record,\n receivedAt: new Date().toISOString(),\n error: error.toJSON(),\n };\n void captureMessage((message ? `${message}: ` : \"\") + error.message, {\n request,\n response,\n });\n return true;\n}\n\nfunction joinUrl(base: string | undefined, path: string | undefined) {\n return (base || \"\").replace(/\\/$/, \"\") + \"/\" + (path || \"\").replace(/^\\//, \"\");\n}\n\nexport function isAxiosError(error?: unknown): error is AxiosError {\n return error instanceof AxiosError || (error instanceof Object && \"isAxiosError\" in error);\n}\n","import { handleError } from \"@/error/errorHandler\";\n\nexport default class Scheduler {\n tasks = new Set();\n\n schedule(action: () => void, timeout: number) {\n const task = window.setTimeout(() => {\n this.tasks.delete(task);\n try {\n action();\n } catch (e) {\n handleError(e);\n }\n }, timeout);\n this.tasks.add(task);\n }\n\n cancelAll() {\n this.tasks.forEach((task) => window.clearTimeout(task));\n this.tasks.clear();\n }\n}\n","import { ApplicationError } from \"@/error/ApplicationError\";\n\nexport class DataError extends ApplicationError {\n constructor(message: string, data: Record) {\n super(\"DataError\", message, { data });\n }\n}\n","import type {\n AlmItemStatus,\n AlmItemType,\n AlmItemTypeMap,\n TargetStatus,\n TransitionField,\n} from \"@/model/status\";\nimport { mapObjectValues } from \"@/utils/general\";\n\nimport type {\n ServerAlmItemStatus,\n ServerAlmItemTransition,\n ServerAlmItemTransitionField,\n ServerAlmItemType,\n ServerAlmItemTypeMap,\n} from \"../serverModel\";\n\nexport function mapAlmItemTypes(almItemTypes: ServerAlmItemTypeMap): AlmItemTypeMap {\n return mapObjectValues(almItemTypes, (teamType) => mapObjectValues(teamType, mapAlmItemType));\n}\n\nexport function mapAlmItemType(almItemType: ServerAlmItemType): AlmItemType {\n const transitions = transitionFilter(almItemType);\n return {\n statuses: almItemType.statuses.map((status) => mapStatus(almItemType, status)),\n globalTargetStatuses: mapTargetStatus(almItemType.statuses, transitions.globalFromStatus()),\n dynamic: almItemType.dynamic,\n };\n}\n\nfunction mapStatus(almItemType: ServerAlmItemType, status: ServerAlmItemStatus): AlmItemStatus {\n const transitions = transitionFilter(almItemType);\n return {\n id: status.id,\n name: status.name,\n initial: transitions.isStatusInitial(status),\n statusClass: status.category,\n order: status.order,\n next: mapTargetStatus(almItemType.statuses, [\n ...transitions.fromStatus(status),\n ...transitions.globalFromStatus(status),\n ]).sort((a, b) => {\n return a.status.order - b.status.order;\n }),\n dynamic: almItemType.dynamic,\n };\n}\n\nfunction mapTargetStatus(\n statuses: ServerAlmItemStatus[],\n transitions: ServerAlmItemTransition[],\n): TargetStatus[] {\n return transitions.map((transition) => {\n const target = statuses.find((status) => status.id === transition.to_status)!;\n return {\n transition: { id: transition.id, name: transition.name },\n status: {\n id: target.id,\n name: target.name,\n statusClass: target.category,\n order: target.order,\n },\n fields: mapFields(transition.fields),\n };\n });\n\n function mapFields(fields: ServerAlmItemTransitionField[]): TransitionField[] {\n return fields.map((field) => ({\n id: field.id,\n name: field.name,\n required: field.required,\n type: field.type,\n itemType: field.item_type,\n values: field.values,\n }));\n }\n}\n\nfunction transitionFilter(almItemType: ServerAlmItemType) {\n return {\n // status is initial when there's an initial transition to it\n isStatusInitial(status: ServerAlmItemStatus) {\n return almItemType.transitions.some(\n (transition) => transition.type === \"initial\" && transition.to_status === status.id,\n );\n },\n // statuses that can be reached from a given status by normal transitions\n fromStatus(status: ServerAlmItemStatus) {\n return almItemType.transitions.filter(\n (transition) =>\n transition.type === \"normal\" && transition.from_statuses.includes(status.id),\n );\n },\n // statuses that can be reached by global transitions (excluding the given one)\n globalFromStatus(fromStatus?: ServerAlmItemStatus) {\n return almItemType.transitions.filter(\n (transition) =>\n transition.type === \"global\" && (!fromStatus || transition.to_status !== fromStatus.id),\n );\n },\n };\n}\n","export type FlagIcon = \"none\" | \"flag\" | \"check\" | \"round\" | \"star\" | \"question\" | \"exclam\";\n\nexport type FlagColor = \"red\" | \"orange\" | \"yellow\" | \"blue\" | \"purple\" | \"green\";\n\nexport default class CardFlag {\n icon: FlagIcon;\n colorIndex: number;\n\n constructor(icon: FlagIcon, colorIndex: number) {\n this.icon = icon;\n this.colorIndex = colorIndex;\n }\n\n public toString(): string {\n return `${this.icon}-${this.colorIndex}`;\n }\n\n static fromFlagString(flag?: string | null): CardFlag {\n if (!flag) {\n return CardFlag.emptyFlag();\n }\n const [icon, colorIndex] = flag.split(\"-\");\n return new CardFlag(icon as FlagIcon, parseInt(colorIndex));\n }\n\n static emptyFlag(): CardFlag {\n return new CardFlag(\"none\", 0);\n }\n\n equals(cardFlag: CardFlag) {\n return this.icon === cardFlag.icon && this.colorIndex === cardFlag.colorIndex;\n }\n\n isEmpty(): boolean {\n return this.icon === \"none\" && this.colorIndex === 0;\n }\n}\n","import type CardFlag from \"./CardFlag\";\nimport type { AlmSourceId, RiskType } from \"./baseTypes\";\nimport type { RelativeCoordinate } from \"./coordinates\";\nimport type { Link } from \"./link\";\nimport type { MarkMode } from \"./markMode\";\nimport type { LinkedObjective } from \"./objective\";\nimport type { DependencyTeamFilter } from \"./search\";\nimport type { Iteration, Team } from \"./session\";\nimport type { AlmItemStatus, Status } from \"./status\";\nimport type { StickyType } from \"./stickyType\";\nimport type { AuthUser } from \"./user\";\n\nexport interface BoardCard {\n data: Card;\n meta: CardMeta;\n}\n\nexport interface PositionedCard {\n data: { id: string };\n meta: { pos: RelativeCoordinate };\n}\n\nexport interface CardMeta {\n pos: RelativeCoordinate;\n zIndex: number;\n mark: MarkMode;\n isHighlighted: boolean;\n isRelatedToHighlighted: boolean;\n dependencyTeamFilter: DependencyTeamFilter | null;\n editing: boolean;\n dragging: boolean;\n shouldAnimate?: boolean;\n}\n\n/**\n * Model that represents a card component on the UI.\n */\nexport interface Card {\n id: string;\n groupId?: string | null;\n almId?: string; // the ID of the external ALM item\n almIssueUrl?: string;\n almSourceId: AlmSourceId | null;\n text: string;\n points: number;\n priority: number;\n teamId: string | null;\n precondTeam?: Team; // team that created the sticky\n dependTeam?: Team; // team that the sticky depends on\n iterationId: number | null;\n editor: AuthUser | null;\n links: Link[];\n type: StickyType;\n flagType: CardFlag;\n risk?: RiskType;\n status?: AlmItemStatus;\n transition?: string;\n objectives: LinkedObjective[];\n reactions?: Reactions;\n artId: string | null;\n assignee: AuthUser | null;\n reporter: AuthUser | null;\n} //TODO subtypes depending on type.functionality\n\nexport interface BaseStickyInfo {\n id: string;\n groupId?: string;\n text: string;\n type: StickyType;\n flag: CardFlag;\n iteration?: Iteration;\n team?: Team;\n artId?: string;\n almId?: string;\n status?: Status;\n points: number;\n precondTeam?: Team;\n dependTeam?: Team;\n}\n\nexport type Reactions = { [reaction in Reaction]: AuthUser[] };\n\nexport const reactions = [\"hot\", \"love\", \"increment\"] as const;\n\nexport type Reaction = (typeof reactions)[number];\n\nconst reactionLabels: { [key in Reaction]: string } = {\n hot: /*$t*/ \"label.reaction.hot\",\n increment: /*$t*/ \"label.reaction.increment\",\n love: /*$t*/ \"label.reaction.love\",\n};\n\nexport function getReactionLabel(reaction: Reaction) {\n return reactionLabels[reaction];\n}\n","// from pi-admin's color picker\nexport const colorPalette = [\n // Greens\n { color: \"#4dff6a\" },\n { color: \"#2d8644\" },\n { color: \"#90bb9b\" },\n { color: \"#cce0d1\" },\n // Blues\n { color: \"#4ce6ff\" },\n { color: \"#2265c3\" },\n { color: \"#93b8ec\" },\n { color: \"#bad1f3\" },\n // Oranges\n { color: \"#ff914c\" },\n { color: \"#f98006\" },\n { color: \"#fba651\" },\n { color: \"#fdd9b4\" },\n // Yellows\n { color: \"#ffff54\" },\n { color: \"#ddb929\" },\n { color: \"#f3d459\" },\n { color: \"#fff5ae\" },\n // Reds\n { color: \"#ff0000\" },\n { color: \"#d22d2d\" },\n { color: \"#e06c6c\" },\n { color: \"#ecac9e\" },\n // Purples\n { color: \"#684cff\" },\n { color: \"#915cd6\" },\n { color: \"#b6acea\" },\n { color: \"#d0cae3\" },\n // Grayscale\n { color: \"#1c1e21\" },\n { color: \"#afb2ba\" },\n { color: \"#dee0e3\" },\n { color: \"#ffffff\" },\n];\n","import type { Color } from \"@/model/baseTypes\";\nimport color from \"@/model/color.module.scss\";\n\nimport { colorPalette } from \"./colorPalette\";\nimport { toHex } from \"./general\";\n\nconst black: Color = [0, 0, 0, 1];\nexport const white: Color = [1, 1, 1, 1];\n\nexport function toCssColor(c: Color): string {\n const hex = (v: number) => toHex(Math.round(v), 2);\n return \"#\" + hex(c[0] * 255) + hex(c[1] * 255) + hex(c[2] * 255) + hex(c[3] * 255);\n}\n\n/**\n * Converts a hexadecimal color code to an RGB color representation.\n *\n * @param hex - The hexadecimal color code to convert.\n * @returns The RGB color representation as an array of numbers.\n */\nexport function fromCssColor(hex: string): Color {\n const normalizedHex = hex.replace(/^#/, \"\");\n const r = parseInt(normalizedHex.substring(0, 2), 16) / 255;\n const g = parseInt(normalizedHex.substring(2, 4), 16) / 255;\n const b = parseInt(normalizedHex.substring(4, 6), 16) / 255;\n return [r, g, b, 1];\n}\n\nexport function colorFromNumber(h: number): string {\n // omit grays and the first shade of every color\n const a = Math.abs(h);\n const hue = a % 6;\n const shade = (Math.floor(a / 6) % 3) + 1;\n return colorPalette[hue * 4 + shade].color;\n}\n\nexport function isDarkColor(c: Color): boolean {\n return brightness(c) < 0.55;\n}\n\nexport function isWhiteColor(c: Color): boolean {\n return brightness(c) > 0.9;\n}\n\nexport function contrastCssColor(c: Color): string {\n return isDarkColor(c) ? color.back : color.textPrimary;\n}\n\nexport function shadeColor(c: Color, amount = 0.25): Color {\n return isDarkColor(c) === amount > 0\n ? interpolate(c, white, Math.abs(amount))\n : interpolate(c, black, Math.abs(amount));\n}\n\nfunction brightness(c: Color): number {\n return c[0] * 0.299 + c[1] * 0.587 + c[2] * 0.114;\n}\n\nfunction interpolate(c: Color, d: Color, f: number): Color {\n return [c[0] + (d[0] - c[0]) * f, c[1] + (d[1] - c[1]) * f, c[2] + (d[2] - c[2]) * f, c[3]];\n}\n","export function utcDateToLocalMidnight(timestamp: number): Date {\n const date = new Date(timestamp * 1000);\n return new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate());\n}\n\nexport function isBefore(d1: Date, d2: Date) {\n return d1.getTime() < d2.getTime();\n}\n\nexport function isAfter(d1: Date, d2: Date) {\n return d1.getTime() > d2.getTime();\n}\n\nexport function plusDays(date: Date, days: number) {\n const d = new Date(date);\n d.setDate(d.getDate() + days);\n return d;\n}\n\nexport function plusHours(date: Date, hours: number) {\n const d = new Date(date);\n d.setHours(d.getHours() + hours);\n return d;\n}\n\nexport function lastWeekDay(d: Date) {\n switch (d.getDay()) {\n case 0: //sunday\n return plusDays(d, -2);\n case 1: //monday\n return plusDays(d, -3);\n default:\n return plusDays(d, -1);\n }\n}\n\nexport function startOfWeek(d: Date) {\n if (d.getDay() === 0) {\n // sunday\n return plusDays(d, -6);\n } else {\n return plusDays(d, -(d.getDay() - 1));\n }\n}\n\nexport function startOfDay(d: Date) {\n return new Date(d.getFullYear(), d.getMonth(), d.getDate());\n}\n\nexport function endOfDay(d: Date) {\n return new Date(d.getFullYear(), d.getMonth(), d.getDate(), 23, 59, 59);\n}\n\nexport function weekDaysBetween(d1: Date, d2: Date) {\n let weekdays = 0;\n const d = new Date(d1);\n while (isBefore(d, atDayStart(d2))) {\n if (isWeekday(d)) {\n weekdays++;\n }\n d.setDate(d.getDate() + 1);\n }\n if (isWeekday(d2)) {\n weekdays += dayFraction(d2);\n }\n return weekdays;\n}\n\nfunction dayFraction(date: Date) {\n return (date.getHours() + date.getMinutes() / 60 + date.getSeconds() / 3600) / 24;\n}\n\nfunction isWeekday(date: Date) {\n return date.getDay() !== 0 && date.getDay() !== 6;\n}\n\nexport function atDayStart(d: Date) {\n return new Date(d.getFullYear(), d.getMonth(), d.getDate());\n}\n\nexport function minuteDiff(d1: Date, d2: Date) {\n return (d2.getTime() - d1.getTime()) / (1000 * 60);\n}\n\nexport function dayDiff(d1: Date, d2: Date) {\n return minuteDiff(d1, d2) / (60 * 24);\n}\n\nexport function isNow(d: Date, tolerance: number = 1000 * 60 * 5) {\n return Math.abs(d.getTime() - new Date().getTime()) < tolerance;\n}\n","import { mapValues } from \"lodash-es\";\n\nimport { captureMessage } from \"@/error/sentry\";\nimport { times } from \"@/math/coordinates\";\nimport CardFlag from \"@/model/CardFlag\";\nimport { zoomFactor } from \"@/model/Settings\";\nimport type { Color, IdMap } from \"@/model/baseTypes\";\nimport type { BoardIteration } from \"@/model/board\";\nimport type { Reaction, Reactions } from \"@/model/card\";\nimport { reactions } from \"@/model/card\";\nimport type { RelativeCoordinate } from \"@/model/coordinates\";\nimport type { Category, FlexBackground, FlexType } from \"@/model/flexboard\";\nimport type { Link, LinkType } from \"@/model/link\";\nimport type { Objective, ObjectiveUpdate } from \"@/model/objective\";\nimport type { SearchResult } from \"@/model/search\";\nimport type { Art, Iteration, Session, Team } from \"@/model/session\";\nimport type { AlmStickyType, Priority, StickyType } from \"@/model/stickyType\";\nimport type { TimerEvent } from \"@/model/timer\";\nimport type { AuthUser, PersonalUser, UserOrgEntities } from \"@/model/user\";\nimport { almOnlyUser } from \"@/model/user\";\nimport { loadReactiveUser } from \"@/services/user.service\";\nimport { useAlmItemTypeStore } from \"@/store/almItemType\";\nimport { useStickyTypeStore } from \"@/store/stickyType\";\nimport { colorFromNumber } from \"@/utils/color\";\nimport { plusDays, utcDateToLocalMidnight } from \"@/utils/date\";\nimport { hash } from \"@/utils/general\";\n\nimport type {\n ServerAlmStickyTypeData,\n ServerArt,\n ServerAuthUser,\n ServerBoardIteration,\n ServerCategory,\n ServerCompanySettings,\n ServerEvent,\n ServerFlexBackground,\n ServerFlexType,\n ServerIteration,\n ServerLink,\n ServerLinkType,\n ServerObjective,\n ServerSearchResult,\n ServerSession,\n ServerSettings,\n ServerStickyType,\n ServerTeam,\n ServerUserTeam,\n} from \"../serverModel\";\n\nexport function mapSessions(sessions: ServerSession[], iterations: ServerIteration[][]): Session[] {\n return sessions\n .map((session, index) => ({\n id: session.session_id,\n name: session.name,\n creationDate: session.creation_date,\n planningStart: session.planning_dates?.start\n ? utcDateToLocalMidnight(session.planning_dates.start)\n : null,\n planningEnd: session.planning_dates?.end\n ? utcDateToLocalMidnight(session.planning_dates.end)\n : null,\n archived: session.archived,\n almStatus: null,\n iterations: mapIterations(iterations[index]),\n }))\n .sort((a, b) => {\n const d = b.creationDate - a.creationDate;\n return d > 0 ? 1 : d < 0 ? -1 : 0;\n });\n}\n\nexport function mapLinkTypes(types: ServerLinkType[]): LinkType[] {\n return types.map((type) => ({\n id: type._id,\n from: type.from_sticky_type,\n to: type.to_sticky_type,\n }));\n}\n\nexport function mapLinks(links: ServerLink[]): Link[] {\n return links.map((link) => ({\n id: link.id,\n from: link.from_sticky_id,\n to: link.to_sticky_id,\n type: link.link_type_id,\n state: \"default\",\n }));\n}\n\nexport function mapScale(scale: number): {\n factor: number;\n} & RelativeCoordinate {\n return { factor: scale, ...times(zoomFactor, scale) };\n}\n\nexport function mapBoardIterations(\n bis: ServerBoardIteration[],\n existing?: BoardIteration[],\n): BoardIteration[] {\n const iter = new Array();\n bis.forEach((bi) => {\n const old = existing?.[bi.board_iteration_id];\n iter[bi.board_iteration_id] = {\n velocity: +bi.velocity,\n load: old?.load || 0,\n state: old?.state || { status: null, detail: null },\n };\n });\n return iter;\n}\n\nexport function mapStickyType(stickyType: ServerStickyType): StickyType {\n const priorities = stickyType.step_estimate\n ? prioritiesByValue(stickyType.step_estimate_values)\n : undefined;\n const color = checkColor(stickyType.id, stickyType.color);\n return {\n id: stickyType.id,\n name: stickyType.name,\n almType: stickyType.alm_type,\n color,\n altColor: stickyType.alt_color || color,\n priorities,\n functionality: stickyType.functionality,\n origin: stickyType.origin_board_type,\n flexOrigin: stickyType.origin_flexboard_type || null,\n usable: stickyType.available_board_types,\n flexUsable: stickyType.available_flexboard_types || [],\n };\n\n function prioritiesByValue(stepEstimates?: Priority[]) {\n if (stepEstimates) {\n return Object.fromEntries(\n stepEstimates.map((stepEstimate) => [stepEstimate.value, stepEstimate]),\n );\n }\n }\n\n function checkColor(id: string, c: Color | undefined | null): Color {\n if (c) {\n return c;\n }\n void captureMessage(\"Sticky type has no color\", { stickyType: { id } });\n return [0.5, 0.5, 0.5, 1];\n }\n}\n\nexport function mapAlmStickyTypes(almStickyTypes: ServerAlmStickyTypeData[]): IdMap {\n return Object.fromEntries(\n almStickyTypes.map((almType) => [almType.id, { id: almType.id, isMapped: almType.is_mapped }]),\n );\n}\n\nexport function mapIterations(iters: ServerIteration[]): Iteration[] {\n return iters\n .sort((a, b) => (a.order > b.order ? 1 : a.order < b.order ? -1 : 0))\n .map((iter) => ({\n id: iter.id,\n name: iter.name,\n start: utcDateToLocalMidnight(iter.start),\n end: plusDays(utcDateToLocalMidnight(iter.end), 1),\n }));\n}\n\nexport function mapObjective(objective: ServerObjective): Objective {\n const mappedObjective = mapPartialObjective(objective);\n\n return { ...mappedObjective, cards: mappedObjective.cards || [] };\n}\n\n/**\n * Similar to mapObjective, but the return value may not have a cards property\n * (used to communicate that the cards property hasn't been updated)\n */\nexport function mapPartialObjective(objective: ServerObjective): ObjectiveUpdate {\n return {\n id: objective.objective_id,\n text: objective.text,\n description: objective.description,\n bv: objective.bv,\n av: objective.av,\n cards: objective.stickies?.map((obj) => {\n return { id: obj.id, isOrigin: obj.is_origin };\n }),\n };\n}\n\nexport function mapFlexTypes(types: ServerFlexType[]): FlexType[] {\n return types.map((type) => ({\n id: type.id,\n name: type.name,\n background: type.background,\n }));\n}\n\nexport function mapSearchResults(results: ServerSearchResult[]): SearchResult[] {\n return results.map((result) => ({\n kind: \"sticky\",\n boardId: result.board_id,\n id: result.id,\n text: result.text ?? \"\",\n typeId: result.type_id,\n teamId: result.team_id?.toString(),\n artId: result.art_id,\n flag: CardFlag.fromFlagString(result.flag_type),\n almId: result.alm_issue_id,\n iterationId: result.iteration_number,\n groupId: result.sticky_group,\n status: useAlmItemTypeStore().calcStatus(\n result.status,\n useStickyTypeStore().findStickyType(result.type_id),\n result.team_id?.toString(),\n result.art_id,\n result.alm_source_id ?? null,\n result.status_class,\n ),\n dependTeamId: result.depend_team_id?.toString(),\n precondTeamId: result.precond_team_id?.toString(),\n points: result.story_points,\n }));\n}\n\nexport function mapEvents(events: ServerEvent[]): TimerEvent[] {\n return events.flatMap((event) =>\n event.type === \"timer\"\n ? [\n {\n id: event.id,\n boardId: event.board_id,\n artId: event.art_id,\n type: \"timer\",\n createdById: event.created_by,\n createdAt: event.created_at,\n updatedById: event.updated_by,\n updatedAt: event.updated_at,\n data: {\n name: event.data.name,\n state: event.data.state,\n duration: event.data.duration,\n end: event.data.end,\n },\n },\n ]\n : [],\n );\n}\n\nexport function mapReactions(reactionUsers: {\n [reaction in Reaction]?: string[];\n}): Reactions {\n const res = {} as Reactions;\n for (const reaction of reactions) {\n res[reaction] = (reactionUsers[reaction] || []).map((id) => loadReactiveUser({ id }));\n }\n return res;\n}\n\nexport function mapCategories(categories: ServerCategory[]): Category[] {\n return categories.map((cat) => ({\n id: cat._id,\n name: cat.name,\n boardIds: cat.board_ids,\n }));\n}\n\nexport function mapArts(arts: ServerArt[]): Art[] {\n return arts.map((art) => ({\n id: art.id ? \"\" + art.id : \"\",\n name: art.name,\n }));\n}\n\nexport function mapTeams(teams: ServerTeam[]): Team[] {\n return teams.map((team) => ({\n id: \"\" + team.user_id,\n name: team.name,\n artId: team.art_id ? \"\" + team.art_id : undefined,\n }));\n}\n\nexport function mapUserTeams(teams: ServerUserTeam[]): Team[] {\n return teams.map((team) => ({\n id: \"\" + team.id,\n name: team.name,\n artId: team.art_id ? \"\" + team.art_id : undefined,\n }));\n}\n\nexport function mapUser(user: ServerAuthUser): AuthUser {\n const name = mapUserName(user);\n return {\n type: \"regular\",\n id: user.id,\n name,\n email: user.email,\n imageUrl: user.image_url,\n color: user.color || colorFromNumber(hash(name)),\n preferredLanguage: user.preferred_language,\n hash: user.hash,\n };\n}\n\nexport function mapUserName(user: { name?: string; email?: string }) {\n return user.name || user.email?.substring(0, user.email.indexOf(\"@\")) || \"\";\n}\n\nexport function mapSettings(settings: ServerSettings) {\n return {\n isBacklogAlmStickyDeletable: !settings.backlog_forbid_JIRA_sticky_delete,\n isTeamAlmStickyDeletable: !settings.team_forbid_sticky_delete,\n isPriorityEditable: !settings.backlog_forbid_WSJF_edit,\n confirmDelete: settings.confirm_sticky_delete || false,\n moveBetweenTeams: settings.move_activated || false,\n mirrorAssignedBacklogStickiesToTeamBoard:\n settings.backlog_mirror_assigned_stickies_to_team_board || false,\n iterationLoadWarn: settings.iteration_load_warn || null,\n iterationLoadCritical: settings.iteration_load_critical || null,\n };\n}\n\nexport function mapCompanySettings(data: ServerCompanySettings = {}) {\n return {\n autoLogoutAfter: data.auto_logout_after || 0,\n };\n}\n\nexport function mapFlexBackgrounds(backgrounds: ServerFlexBackground[]): FlexBackground[] {\n return backgrounds.map(({ id, name, info_link }) => ({\n id,\n name,\n infoLink: info_link,\n }));\n}\n\nexport function mapUserId(userId?: string | null, almId?: string | null): PersonalUser | null {\n return userId\n ? loadReactiveUser({ id: userId }, { almMapping: almId ? \"complete\" : \"pip-only\" })\n : almId\n ? almOnlyUser(almId, colorFromNumber(hash(almId)))\n : null;\n}\n\ntype UserOrgEntitiesInput = {\n [K in keyof UserOrgEntities]: Array<{ id: number; name: string }>;\n};\n\nfunction mapIdsToStringsInArray(\n items: Array<{ id: number; name: string }>,\n): Array<{ id: string; name: string }> {\n return items.map((item) => ({\n ...item,\n id: item.id.toString(),\n }));\n}\n\nexport function mapOrgEntities(entities: UserOrgEntitiesInput): UserOrgEntities {\n return mapValues(entities, mapIdsToStringsInArray);\n}\n","import { zoomFactor } from \"@/model/Settings\";\nimport type { Board, BoardData } from \"@/model/board\";\nimport type { FlexType } from \"@/model/flexboard\";\nimport { useTeamStore } from \"@/store/team\";\n\nimport type { BackendSession } from \"../BackendSession\";\nimport type { ServerBoard, ServerFlexBoard } from \"../serverModel\";\n\nexport function mapBoard(\n board: ServerBoard | ServerFlexBoard,\n flexTypes: FlexType[],\n almSourceProvider: BackendSession[\"almSource\"],\n): Board {\n return board.board_type === \"flex\"\n ? mapFlexBoard(board, flexTypes)\n : mapNonFlexBoard(board, almSourceProvider);\n}\n\nexport function mapFlexBoard(board: ServerFlexBoard, flexTypes: FlexType[]): BoardData<\"flex\"> {\n return {\n ...baseBoardData(board),\n flexType: flexTypes.find((type) => type.id === board.flexboard_type)!,\n name: board.name,\n almSources: [],\n } as BoardData<\"flex\">;\n}\n\nfunction mapNonFlexBoard(\n board: ServerBoard,\n almSourceProvider: BackendSession[\"almSource\"],\n): Board {\n const alm = almSourceProvider(board.board_type, {\n teamId: board.user_id,\n artId: board.art_id,\n });\n return {\n ...baseBoardData(board),\n team:\n board.user_id === null\n ? undefined\n : useTeamStore().teams.find((t) => t.id === \"\" + board.user_id),\n almSources: alm ? alm.sources.map(({ id, name }) => ({ id, name })) : [],\n artId: board.art_id ? \"\" + board.art_id : undefined,\n } as Board;\n}\n\nfunction baseBoardData(board: ServerBoard | ServerFlexBoard): Partial {\n return {\n id: board.board_id,\n type: board.board_type,\n cardSize: { factor: 1, ...zoomFactor },\n cards: {},\n maxZ: 0,\n loaded: 0,\n selected: {},\n shapes: board.shapes || [],\n };\n}\n","import type { Reaction } from \"./card\";\nimport type { Icon } from \"./icon\";\nimport type { AuthUser } from \"./user\";\n\nexport type StickyChangeKind =\n | \"create\"\n | \"update\"\n | \"delete\"\n | \"mirror\"\n | \"unmirror\"\n | \"link\"\n | \"unlink\";\n\nexport interface StickyChange {\n stickyId: string;\n timestamp: Date;\n user: AuthUser;\n kind: StickyChangeKind;\n fields: FieldChange[];\n}\n\n// Sticky properties that we can render in the Activity Panel,\n// with mappings from their server-key to local-key\nconst stickyProperties = {\n text: \"text\",\n status: \"status\",\n type_id: \"type\",\n story_points: \"points\",\n WSJF_value: \"priority\",\n risk: \"risk\",\n iteration_number: \"iterationId\",\n team_id: \"teamId\",\n reactions: \"reactions\",\n flag_type: \"flagType\",\n depend_team_id: \"dependTeamId\",\n assignee: \"assignee\",\n reporter: \"reporter\",\n} as const;\n\n// Other changes that we can render in the Activity Panel\nconst otherStickyChanges = {\n mirror: \"mirrorBoard\",\n link: \"link\",\n create: \"create\",\n delete: \"delete\",\n} as const;\n\nexport const stickyActivityKeys = {\n ...stickyProperties,\n ...otherStickyChanges,\n} as const;\n\nexport type FieldChangeName = (typeof stickyActivityKeys)[keyof typeof stickyActivityKeys];\n\n// Reverse mapping (local-key to server-key)\nexport const serverStickyActivityKeys: Record = Object.fromEntries(\n Object.entries(stickyActivityKeys).map(([key, value]) => [value, key]),\n) as Record;\n\nexport interface FieldChange {\n name: FieldChangeName;\n old?: T;\n new?: T;\n}\n\nexport type ReactionField = Record;\n\nexport interface ChangeTypeItem {\n id: FieldChangeName;\n name: string;\n icon: Icon;\n}\n","import { reactions } from \"@/model/card\";\nimport type {\n FieldChange,\n FieldChangeName,\n ReactionField,\n StickyChange,\n StickyChangeKind,\n} from \"@/model/change\";\nimport { stickyActivityKeys } from \"@/model/change\";\nimport { loadReactiveUser } from \"@/services/user.service\";\nimport { i18n } from \"@/translations/i18n\";\n\nimport type {\n ServerFieldChange,\n ServerReactionField,\n ServerStickyChange,\n ServerStickyChangeDelete,\n ServerStickyChangeLink,\n ServerStickyChangeMirror,\n ServerStickyChangeUpdate,\n ServerUser,\n} from \"../serverModel\";\nimport { mapUserId } from \"./mapBackendData\";\n\nexport function mapStickyChanges(changes: ServerStickyChange[]): StickyChange[] {\n changes.reverse();\n return changes.flatMap((change) => {\n // Guard to ensure the FE only shows changes it knows how to handle\n const allowedKinds: StickyChangeKind[] = [\n \"create\",\n \"update\",\n \"delete\",\n \"mirror\",\n \"unmirror\",\n \"link\",\n \"unlink\",\n ];\n if (!allowedKinds.includes(change.kind)) {\n return [];\n }\n const fields = mapChangeFields(change);\n return change.kind === \"update\" && fields.length === 0\n ? []\n : { ...mapBaseChange(change), fields };\n });\n}\n\nfunction mapBaseChange(change: ServerStickyChange): Omit {\n return {\n stickyId: change.sticky_id,\n timestamp: new Date(change.timestamp),\n user: loadReactiveUser(\n {\n id: change.user_id,\n name: i18n.global.t(\"stickyChange.unknownUser\"), // Fallback name if user was deleted\n },\n { mapBackendToAlm: true },\n ),\n kind: change.kind,\n };\n}\n\nfunction mapChangeFields(change: ServerStickyChange): FieldChange[] {\n switch (change.kind) {\n case \"create\":\n return [];\n case \"delete\":\n return mapUpdateFields(change);\n case \"update\":\n return mapUpdateFields(change);\n case \"mirror\":\n return mapMirrorFields(change);\n case \"unmirror\":\n return mapUnmirrorFields(change);\n case \"link\":\n return mapLinkFields(change);\n case \"unlink\":\n return mapUnlinkFields(change);\n }\n}\n\nfunction mapLinkFields(change: ServerStickyChangeLink): FieldChange[] {\n return [{ name: \"link\", new: change.linked_to }];\n}\n\nfunction mapUnlinkFields(change: ServerStickyChangeLink): FieldChange[] {\n return [{ name: \"link\", old: change.linked_to }];\n}\n\nfunction mapMirrorFields(change: ServerStickyChangeMirror): FieldChange[] {\n return [{ name: \"mirrorBoard\", new: change.to_board }];\n}\n\nfunction mapUnmirrorFields(change: ServerStickyChangeMirror): FieldChange[] {\n return [{ name: \"mirrorBoard\", old: change.to_board }];\n}\n\nfunction mapUpdateFields(\n change: ServerStickyChangeUpdate | ServerStickyChangeDelete,\n): FieldChange[] {\n return (change.changes || []).flatMap((fieldChange) => {\n const key = stickyActivityKeys[fieldChange.key as keyof typeof stickyActivityKeys];\n switch (key) {\n case undefined:\n return [];\n case \"reactions\":\n return mapReactionsChange(fieldChange as ServerFieldChange);\n case \"teamId\":\n case \"dependTeamId\":\n return mapTeamChange(key, fieldChange as ServerFieldChange);\n case \"assignee\":\n case \"reporter\":\n return mapUserChange(key, fieldChange as ServerFieldChange);\n default:\n return {\n name: key,\n old: fieldChange.old,\n new: fieldChange.new,\n };\n }\n });\n}\n\nfunction mapReactionsChange(\n fieldChange: ServerFieldChange,\n): FieldChange {\n return {\n name: \"reactions\",\n old: mapReactions(fieldChange.old),\n new: mapReactions(fieldChange.new),\n };\n}\n\nfunction mapReactions(field: ServerReactionField) {\n return Object.fromEntries(\n reactions.map((reaction) => [reaction, field?.[reaction]?.length || 0]),\n ) as ReactionField;\n}\n\nfunction mapTeamChange(key: FieldChangeName, fieldChange: ServerFieldChange): FieldChange {\n return {\n name: key,\n old: fieldChange.old ? \"\" + fieldChange.old : undefined,\n new: fieldChange.new ? \"\" + fieldChange.new : undefined,\n };\n}\n\nfunction mapUserChange(\n key: FieldChangeName,\n fieldChange: ServerFieldChange,\n): FieldChange {\n return {\n name: key,\n old: fieldChange.old ? mapUserId(fieldChange.old.pip_id, fieldChange.old.alm_id) : undefined,\n new: fieldChange.new ? mapUserId(fieldChange.new.pip_id, fieldChange.new.alm_id) : undefined,\n };\n}\n","import type { BoardType, Color } from \"./baseTypes\";\n\nexport type Functionality = \"workitem\" | \"note\" | \"risk\" | \"dependency\";\n\nexport interface Priority {\n value: number;\n text: string;\n}\n\nexport interface StickyType {\n id: string;\n name: string;\n almType: string | null;\n color: Color;\n altColor: Color; // 'Taken' color (for backlog items assigned to a team, or solution backlog items assigned to an art)\n priorities?: Record;\n functionality: Functionality;\n origin: BoardType; // the board type where the card was initially created\n flexOrigin: string | null; // the flex-board/colaboration-canvas where the card was initially created\n usable: BoardType[]; // where the sticky note can be mirrored too\n flexUsable: string[];\n}\n\nexport function isDependency(card: { type: StickyType }) {\n return card.type.functionality === \"dependency\";\n}\n\nexport function isWorkitem(card: { type: StickyType }) {\n return card.type.functionality === \"workitem\";\n}\n\nexport function isNote(card: { type: StickyType }) {\n return card.type.functionality === \"note\";\n}\n\nexport function isRisk(card: { type: StickyType }) {\n return card.type.functionality === \"risk\";\n}\n\nexport interface AlmStickyType {\n id: string;\n isMapped: boolean;\n}\n","// NB: in order to be consistent, only card properties should be used\n// that are the same across all mirrored instances of a card\n// e.g. using teamId on a dependency card is not ok because it can be mirrored to multiple team boards\nimport type { BoardType, InfoLevel } from \"@/model/baseTypes\";\nimport type { Card } from \"@/model/card\";\nimport { isDependency, isWorkitem } from \"@/model/stickyType\";\n\nexport function calcLinkState(from: Card, to: Card): InfoLevel {\n // states for backlog sticky linked to\n // a team sticky in earlier/same/later iteration\n const backlogToTeamLinkStates: InfoLevel[] = [\"ok\", \"ok\", \"error\"];\n\n // states for a dependency sticky linked to\n // a team/backlog sticky of same/different team in earlier/same/later iteration\n const dependencyLinkStates: Record = {\n teamStickyOfSameGroup: [\"ok\", \"ok\", \"error\"],\n teamStickyOfDifferentGroup: [\"ok\", \"ok\", \"ok\"],\n backlogStickyOfSameGroup: [\"ok\", \"ok\", \"error\"],\n backlogStickyOfDifferentGroup: [\"error\", \"warn\", \"ok\"],\n solution_backlogStickyOfSameGroup: [\"ok\", \"ok\", \"error\"],\n solution_backlogStickyOfDifferentGroup: [\"error\", \"warn\", \"ok\"],\n };\n\n const cards = [from, to];\n if (cards.some((card) => card.iterationId === null)) {\n return \"default\";\n }\n\n const backlog = workitemFrom(cards, \"backlog\");\n const team = workitemFrom(cards, \"team\");\n if (backlog?.teamId && team?.teamId) {\n const order = iterationOrder(backlog, team);\n return backlogToTeamLinkStates[order];\n }\n\n const solutionBacklog = workitemFrom(cards, \"solution_backlog\");\n const dependency = cards.find(isDependency);\n const nonDependency = solutionBacklog || backlog || team;\n if (dependency && nonDependency) {\n const isArtLevel = !solutionBacklog;\n const dependencyGroup = groupOf(dependency, isArtLevel);\n const nonDependencyGroup = groupOf(nonDependency, isArtLevel);\n if (dependencyGroup && nonDependencyGroup) {\n const situation =\n nonDependency.type.origin +\n \"StickyOf\" +\n (dependencyGroup === nonDependencyGroup ? \"Same\" : \"Different\") +\n \"Group\";\n const order = iterationOrder(dependency, nonDependency);\n return dependencyLinkStates[situation][order];\n }\n }\n\n return \"default\";\n\n function groupOf(card: Card, artLevel: boolean) {\n if (isDependency(card)) {\n return artLevel ? card?.dependTeam?.id : card?.dependTeam?.artId;\n }\n return artLevel ? card?.teamId : card?.artId;\n }\n\n function workitemFrom(cards: Card[], origin: BoardType) {\n return cards.find((card) => isWorkitem(card) && card.type.origin === origin);\n }\n\n function iterationOrder(a: Card, b: Card) {\n const iterDiff = b.iterationId! - a.iterationId!;\n return iterDiff < 0 ? 0 : iterDiff > 0 ? 2 : 1;\n }\n}\n","import type { Board } from \"@/model/board\";\nimport type { BoardCard } from \"@/model/card\";\nimport type { DependencyTeamFilter } from \"@/model/search\";\n\nexport function fadeOutCard(card: BoardCard, fadeOut: boolean) {\n card.meta.mark = fadeOut ? \"fade-out\" : \"normal\";\n}\n\nexport function linkFadeOutCard(card: BoardCard) {\n card.meta.mark = \"fade-out\";\n card.meta.isHighlighted = false;\n card.meta.isRelatedToHighlighted = false;\n}\n\nexport function linkHighlightCard(card: BoardCard, near: boolean) {\n card.meta.mark = near ? \"normal\" : \"semi-fade-out\";\n card.meta.isRelatedToHighlighted = true;\n}\n\nexport function highlightCard(card: BoardCard) {\n card.meta.mark = \"normal\";\n card.meta.isHighlighted = true;\n}\n\nexport function hideCard(card: BoardCard) {\n card.meta.mark = \"hidden\";\n}\n\nexport function setSearchCardMark(\n card: BoardCard,\n match: boolean,\n hide: boolean,\n dependencyTeamFilter: DependencyTeamFilter | null,\n) {\n card.meta.mark = match ? \"normal\" : hide ? \"filter-out\" : \"fade-out\";\n card.meta.dependencyTeamFilter = dependencyTeamFilter;\n}\n\nexport function resetCardMark(card?: BoardCard) {\n const meta = card?.meta;\n if (meta) {\n meta.mark = \"normal\";\n meta.isHighlighted = false;\n meta.isRelatedToHighlighted = false;\n meta.dependencyTeamFilter = null;\n }\n}\n\nexport function fadeOutAllCardMarks(board: Board) {\n Object.values(board.cards).forEach((card) => fadeOutCard(card, true));\n}\n\nexport function resetAllCardMarks(board: Board) {\n Object.values(board.cards).forEach(resetCardMark);\n}\n","import { sortBy } from \"lodash-es\";\nimport { defineStore } from \"pinia\";\n\nimport { captureMessage } from \"@/error/sentry\";\nimport type { Id } from \"@/model/baseTypes\";\nimport type { Board, BoardId, BoardWithObjectives } from \"@/model/board\";\nimport { isArtBoard, isBacklogBoard, isSolutionBoard, isTeamBoard } from \"@/model/board\";\nimport type { Card } from \"@/model/card\";\nimport type { LinkableCardTree } from \"@/model/link\";\nimport type { Objective, ObjectiveType, ObjectiveUpdate } from \"@/model/objective\";\nimport type { Team } from \"@/model/session\";\nimport { isDependency, isNote } from \"@/model/stickyType\";\nimport { objectId } from \"@/utils/objectId\";\n\nimport { useBoardStore } from \"./board\";\nimport { useBoardsStore } from \"./boards\";\nimport { isCardFromTeam, useCardStore } from \"./card\";\nimport { getLinkTargetId, useLinkStore } from \"./link\";\n\nexport const useObjectiveStore = defineStore(\"objective\", {\n getters: {\n objectiveById() {\n return (\n objectiveId: Objective[\"id\"],\n { teamId, boardId }: { teamId?: Team[\"id\"]; boardId?: Board[\"id\"] } = {},\n ): Objective | undefined => {\n const board = boardId\n ? useBoardsStore().boardById(boardId)\n : useBoardsStore().boardByType(\"team\", { teamId });\n\n const objectives = [\n ...((\"objectives\" in board && board.objectives) || []),\n ...((\"stretchObjectives\" in board && board.stretchObjectives) || []),\n ];\n\n return objectives.find((objective) => objective.id === objectiveId);\n };\n },\n objectiveTypeById() {\n return (\n objectiveId: Objective[\"id\"],\n { teamId, boardId }: { teamId?: Team[\"id\"]; boardId?: Board[\"id\"] } = {},\n ): ObjectiveType | undefined => {\n const objective = this.objectiveById(objectiveId, { teamId, boardId });\n if (!objective) return;\n const board = useBoardsStore().boardByType(\"team\", { teamId });\n const isInObjectives = board.objectives.some((objective) => objective.id === objectiveId);\n return isInObjectives ? \"committed\" : \"uncommitted\";\n };\n },\n linkedCardTree() {\n return (objective: Objective): LinkableCardTree => {\n const indirectIds = new Set();\n const cards = sorted(\n objective.cards.flatMap((ref) => {\n const card = useCardStore().cards[ref.id];\n if (!card || !ref.isOrigin) {\n return [];\n }\n const childIds = linkedToCard(card).map((card) => card.id);\n childIds.forEach((id) => indirectIds.add(id));\n return { ...card, linked: true, childIds };\n }),\n );\n cards.forEach((card) => indirectIds.delete(card.id));\n\n const count = cards.length + indirectIds.size;\n return { cards, indirectLinkedIds: [...indirectIds], count };\n\n function linkedToCard(card: Card) {\n // Only show linked items that are 1 'level' below in the hierarchy,\n if (\n isNote(card) || // notes are never above items in hierarchy\n (isTeamBoard(card.type.origin) && !isDependency(card)) // team board workitems/risks are at the bottom of the hierarchy\n ) {\n return [];\n }\n\n return sorted(\n useLinkStore()\n .linksByCard(card.id)\n .map((link) => useCardStore().cards[getLinkTargetId(card, link)])\n .filter((linkedCard) => shouldShowSecondaryLink(card, linkedCard)),\n );\n }\n\n function shouldShowSecondaryLink(card: Card, secondaryCard?: Card) {\n if (!secondaryCard) return false;\n\n if (isDependency(card)) {\n return isCardFromTeam(secondaryCard, card.dependTeam?.id);\n }\n\n const board = card.type.origin;\n\n if (isSolutionBoard(board)) {\n // For solution-level items, show art/team level linked-items\n return !isSolutionBoard(secondaryCard.type.origin);\n }\n\n if (isArtBoard(board)) {\n // For art-level items, show team level linked-items\n return isTeamBoard(secondaryCard.type.origin);\n }\n\n return false;\n }\n\n function sorted(cards: T[]) {\n return sortBy(cards, (card) =>\n isBacklogBoard(card.type.origin) ? 1 : isDependency(card) ? 2 : 3,\n );\n }\n };\n },\n },\n actions: {\n add(e: Partial & BoardId, isCommitted = true) {\n const board = useBoardsStore().boards[e.boardId] as BoardWithObjectives;\n const id = e.id || objectId();\n const text = e.text ? e.text : \"\";\n const description = e.description ? e.description : \"\";\n const obj = { id, text, bv: 0, av: null, description, cards: [] };\n (isCommitted ? board.objectives : board.stretchObjectives).unshift(obj);\n return obj;\n },\n remove(item: Id & BoardId) {\n const boardId = item.boardId || useBoardStore().boardId();\n const board = useBoardsStore().boards[boardId] as BoardWithObjectives;\n const objectiveIndex = board.objectives.findIndex((o) => o.id === item.id);\n\n if (objectiveIndex > -1) {\n board.objectives.splice(objectiveIndex, 1);\n }\n\n const stretchObjectiveIndex = board.stretchObjectives.findIndex((o) => o.id === item.id);\n if (stretchObjectiveIndex > -1) {\n board.stretchObjectives.splice(stretchObjectiveIndex, 1);\n }\n },\n move(e: Id & BoardId & { stretch: boolean; rank: number }) {\n const boardId = e.boardId || useBoardStore().boardId();\n const board = useBoardsStore().boards[boardId] as BoardWithObjectives;\n const { objective, objectives, pos } = objectiveById(board, e.id);\n if (!objective) {\n void captureMessage(\"Move of unknown objective\", {\n info: {\n data: e,\n boardType: board.type,\n objectives: board.objectives.length,\n stretch: board.stretchObjectives.length,\n },\n });\n return;\n }\n objectives.splice(pos, 1);\n const target = e.stretch ? board.stretchObjectives : board.objectives;\n target.splice(e.rank, 0, objective);\n },\n update(e: Id & BoardId & ObjectiveUpdate) {\n const board = useBoardsStore().boards[e.boardId] as BoardWithObjectives;\n const { objective } = objectiveById(board, e.id);\n if (!objective) {\n if (e.text === \"\") {\n this.add(e);\n } else {\n void captureMessage(\"Update of unknown objective\", {\n info: {\n data: e,\n boardType: board.type,\n objectives: board.objectives.length,\n stretch: board.stretchObjectives.length,\n },\n });\n }\n return;\n }\n\n objective.text = e.text ?? objective.text;\n objective.description = e.description ?? objective.description;\n objective.bv = e.bv ?? objective.bv;\n objective.av = e.av ?? objective.av;\n objective.cards = e.cards || objective.cards;\n },\n },\n});\n\nfunction objectiveById(\n board: BoardWithObjectives,\n id: string,\n): {\n objective: Objective;\n objectives: Objective[];\n pos: number;\n} {\n let objectives = board.objectives;\n let pos = objectives.findIndex((o) => o.id === id);\n if (pos < 0) {\n objectives = board.stretchObjectives;\n pos = objectives.findIndex((o) => o.id === id);\n }\n return { objective: objectives[pos], objectives, pos };\n}\n","import { defineStore } from \"pinia\";\n\nimport type { IdMap } from \"@/model/baseTypes\";\nimport type { Board, BoardWithObjectives } from \"@/model/board\";\nimport type { BoardCard, Card } from \"@/model/card\";\nimport type {\n Link,\n LinkType,\n LinkableItem,\n Linking,\n LinkingTarget,\n ObjectiveLink,\n} from \"@/model/link\";\nimport type { Objective } from \"@/model/objective\";\n\nimport { useBoardStore } from \"./board\";\nimport { useBoardsStore } from \"./boards\";\nimport { useCardStore } from \"./card\";\nimport { calcLinkState } from \"./helpers/linkState\";\nimport { fadeOutCard, resetAllCardMarks } from \"./helpers/mark\";\nimport { useObjectiveStore } from \"./objective\";\nimport { useSessionStore } from \"./session\";\nimport { useTeamStore } from \"./team\";\n\nexport interface LinkedCards {\n link: Link;\n from: BoardCard;\n to: BoardCard;\n}\n\nexport const useLinkStore = defineStore(\"link\", {\n state: () => {\n return {\n links: [] as Link[],\n linksById: {} as Record,\n linksByFrom: {} as Record,\n linksByTo: {} as Record,\n markingObjectiveLinkedCards: null as Objective[\"id\"] | null,\n markingCardLinkedCards: null as BoardCard | null,\n linking: { from: null, to: null } as Linking,\n linkTypes: [] as LinkType[],\n linkGroups: {} as Record>,\n };\n },\n getters: {\n linksByCard:\n (state) =>\n (lnkId: string): Link[] => {\n return [...(state.linksByFrom[lnkId] || []), ...(state.linksByTo[lnkId] || [])];\n },\n isLinkedFrom: (state) => (id: LinkingTarget[\"id\"]) => {\n return state.linking.from?.id === id;\n },\n isPinned: (state) => (cardId: string) => {\n return state.markingCardLinkedCards?.data.id === cardId;\n },\n isMarkingLinks: (state) => {\n return !!state.markingObjectiveLinkedCards || !!state.markingCardLinkedCards;\n },\n cardsByLink:\n (state) =>\n (linkTargetId: string): Card[] => {\n const groups = state.linkGroups[linkTargetId];\n if (groups) {\n const res = [];\n for (const id in groups) {\n res.push(groups[id].data);\n }\n return res;\n }\n const card = useCardStore().cards[linkTargetId];\n if (!card) {\n // can happen because of REN-8846\n return [];\n }\n return [card];\n },\n boardCardByLink:\n (state) =>\n (linkTargetId: string, board: Board): BoardCard | undefined => {\n const groups = state.linkGroups[linkTargetId];\n return groups ? groups[board.id] : board.cards[linkTargetId];\n },\n getLinkableItems:\n (state) =>\n (card: Card): LinkableItem[] => {\n const cardLinks = card.links\n .flatMap((link) => {\n if (!link.to) {\n return [];\n }\n const linkedCard = getCardByLinkId(getLinkTargetId(card, link));\n if (!linkedCard) {\n return [];\n }\n return {\n kind: \"sticky\" as const,\n linked: true,\n id: linkedCard.id,\n groupId: linkedCard.groupId ?? undefined,\n text: linkedCard.text,\n type: linkedCard.type,\n flag: linkedCard.flagType,\n iteration: useSessionStore().getIterationById(linkedCard.iterationId),\n team: linkedCard.teamId\n ? useTeamStore().findTeam({ id: linkedCard.teamId })\n : undefined,\n artId: linkedCard.artId ?? undefined,\n almId: linkedCard.almId,\n status: linkedCard.status,\n points: linkedCard.points,\n precondTeam: linkedCard.precondTeam ?? undefined,\n dependTeam: linkedCard.dependTeam ?? undefined,\n };\n })\n .reverse();\n const objectiveLinks = card.objectives\n .flatMap((objective) => {\n const board = useBoardsStore().boards[objective.boardId] as BoardWithObjectives;\n const boardObjective = [\n ...(board?.objectives ?? []),\n ...(board?.stretchObjectives ?? []),\n ].find(({ id }) => objective.id === id);\n if (!boardObjective) {\n return [];\n }\n\n return {\n kind: \"objective\" as const,\n linked: true,\n id: objective.id,\n text: boardObjective.text,\n description: boardObjective.description,\n boardId: objective.boardId,\n type: useObjectiveStore().objectiveTypeById(objective.id, {\n boardId: objective.boardId,\n }),\n };\n })\n .reverse();\n return [...cardLinks, ...objectiveLinks];\n\n function getCardByLinkId(linkId: string) {\n const groups = state.linkGroups[linkId];\n if (groups && Object.keys(groups).length > 0) {\n return Object.entries(groups)[0][1].data;\n }\n const card = useCardStore().cards[linkId];\n if (!card) {\n // can happen because of REN-8846\n return;\n }\n return card;\n }\n },\n linksOnBoard() {\n const links = new Array();\n const board = useBoardStore().board;\n if (!board) {\n return [];\n }\n Object.values(board.cards).flatMap((from) => {\n for (const link of from.data.links) {\n if (link.to && linkId(from.data) === link.from) {\n const to = this.boardCardByLink(link.to, board);\n if (to) {\n links.push({ link, from, to });\n }\n }\n }\n });\n return links;\n },\n riskyLinkCount() {\n const counts = { risky: 0, critical: 0 };\n this.linksOnBoard.forEach((linked) => {\n if (linked.link.state === \"warn\") {\n counts.risky++;\n }\n if (linked.link.state === \"error\") {\n counts.critical++;\n }\n });\n return counts;\n },\n hasRiskyLinks() {\n const counts: { risky: number; critical: number } = this.riskyLinkCount;\n return counts.risky > 0 || counts.critical > 0;\n },\n },\n actions: {\n setLinks(links: Link[]) {\n this.links = [];\n for (const link of links) {\n this.addLink(link);\n }\n },\n addLink(link: Link) {\n this.links.push(link);\n this.linksById[link.id] = link;\n add(this.linksByFrom, link.from, link);\n add(this.linksByTo, link.to, link);\n\n function add(map: Record, id: string, link: Link) {\n if (!(id in map)) {\n map[id] = [];\n }\n map[id].push(link);\n }\n },\n addToLinkGroup(groupId: string, boardId: string, boardCard: BoardCard) {\n if (!this.linkGroups[groupId]) this.linkGroups[groupId] = {};\n this.linkGroups[groupId][boardId] = boardCard;\n },\n removeFromLinkGroup(card: Card, boardId: string) {\n if (card.groupId && this.linkGroups[card.groupId]) {\n delete this.linkGroups[card.groupId][boardId];\n }\n },\n removeLink(index: number) {\n const link = this.links[index];\n this.links.splice(index, 1);\n delete this.linksById[link.id];\n remove(this.linksByFrom, link.from, link);\n remove(this.linksByTo, link.to, link);\n return link;\n\n function remove(map: Record, id: string, link: Link) {\n const i = map[id].findIndex((l) => l.id === link.id);\n if (i >= 0) {\n map[id].splice(i, 1);\n }\n }\n },\n\n add(link: Link) {\n if (this.linksById[link.id]) {\n return;\n }\n this.setLinkState(link);\n this.addLink(link);\n this.updateLinks(link);\n },\n\n remove(linkId: string) {\n const linkIndex = this.links.findIndex((link) => link.id === linkId);\n if (linkIndex < 0) {\n return;\n }\n const link = this.removeLink(linkIndex);\n this.updateLinks(link);\n },\n addObjectiveLink(cardId: Card[\"id\"], linkInfo: { boardId: string; objectiveId: string }) {\n const card = useCardStore().cards[cardId];\n if (!card) {\n return;\n }\n if (\n card.objectives.every(\n (cardObjective) =>\n cardObjective.boardId !== linkInfo.boardId || cardObjective.id !== linkInfo.objectiveId,\n )\n ) {\n card.objectives.push({\n id: linkInfo.objectiveId,\n boardId: linkInfo.boardId,\n });\n }\n },\n removeObjectiveLink(\n cardId: Card[\"id\"],\n linkInfo: Pick,\n ) {\n const card = useCardStore().cards[cardId];\n if (!card) {\n return;\n }\n card.objectives = card.objectives.filter(\n (cardObjective) =>\n cardObjective.boardId !== linkInfo.boardId || cardObjective.id !== linkInfo.objectiveId,\n );\n },\n setLinkState(link: Link) {\n const fromCards = this.cardsByLink(link.from);\n const toCards = this.cardsByLink(link.to);\n if (fromCards.length && toCards.length) {\n link.state = calcLinkState(fromCards[0], toCards[0]);\n }\n },\n updateLinks(link: Link) {\n this.cardsByLink(link.from).forEach((c) => {\n c.links = this.linksByCard(link.from);\n });\n this.cardsByLink(link.to).forEach((c) => {\n c.links = this.linksByCard(link.to);\n });\n },\n setCardLinkStates(card: Card) {\n card.links.forEach((link) => this.setLinkState(link));\n },\n markCardLinkedCard(card: BoardCard) {\n this.markingObjectiveLinkedCards = null;\n this.markingCardLinkedCards = card;\n },\n\n // breadth first search from to given cards following all links\n linkedCardDistances(card: BoardCard): IdMap {\n const boardCardByLink = this.boardCardByLink;\n\n const queue = [{ card, distance: 0 }];\n const linked: IdMap = {};\n while (queue.length > 0) {\n const [item] = queue.splice(0, 1);\n if (!(item.card.data.id in linked)) {\n linked[item.card.data.id] = item.distance;\n item.card.data.links.forEach((link) => {\n addToQueue(link.from, item.distance + 1);\n addToQueue(link.to, item.distance + 1);\n });\n }\n }\n return linked;\n\n function addToQueue(linkTargetId: string, distance: number) {\n const card = boardCardByLink(linkTargetId, useBoardStore().currentBoard());\n if (card && !(card.data.id in linked)) {\n queue.push({ card, distance });\n }\n }\n },\n\n markObjectiveLinkedCards(objectiveId: string) {\n this.markingCardLinkedCards = null;\n this.markingObjectiveLinkedCards = objectiveId;\n Object.values(useBoardStore().currentBoard().cards).forEach((boardCard) => {\n const isLinkedCard = boardCard.data.objectives.some(\n (objective) => objective.id === objectiveId,\n );\n fadeOutCard(boardCard, !isLinkedCard);\n });\n },\n removeAllMarks() {\n this.markingObjectiveLinkedCards = null;\n this.markingCardLinkedCards = null;\n resetAllCardMarks(useBoardStore().currentBoard());\n },\n removeCardLinkedMarks(cardId: string) {\n if (this.markingCardLinkedCards?.data.id === cardId) {\n this.markingCardLinkedCards = null;\n resetAllCardMarks(useBoardStore().currentBoard());\n }\n },\n removeObjectiveLinkedMarks(objectiveId: string) {\n if (this.markingObjectiveLinkedCards === objectiveId) {\n this.markingObjectiveLinkedCards = null;\n resetAllCardMarks(useBoardStore().currentBoard());\n }\n },\n\n setLinkingTarget(target: LinkingTarget) {\n this.linking.to = target;\n },\n resetLinkingTarget() {\n this.linking.to = null;\n },\n },\n});\n\nexport function linkId(\n card: Pick,\n): NonNullable {\n return card.groupId || card.id;\n}\n\nexport function linkBetween(card: Card, other?: Pick | null) {\n return (\n other &&\n card.id !== other.id &&\n card.links.find((l) => l.from === linkId(other) || l.to === linkId(other))\n );\n}\n\nexport function getLinkTargetId(card: Card, link: Link): string {\n return linkId(card) === link.from ? link.to : link.from;\n}\n","import { round } from \"lodash-es\";\nimport { defineStore } from \"pinia\";\n\nimport { captureMessage } from \"@/error/sentry\";\nimport CardFlag from \"@/model/CardFlag\";\nimport type { AlmSourceId, Color, Id, IdMap, StatusClass } from \"@/model/baseTypes\";\nimport type { Board, BoardId } from \"@/model/board\";\nimport type { Card, CardMeta, Reaction, Reactions } from \"@/model/card\";\nimport { reactions } from \"@/model/card\";\nimport type { RelativeCoordinate } from \"@/model/coordinates\";\nimport type { StickyType } from \"@/model/stickyType\";\nimport type { PersonalUser } from \"@/model/user\";\nimport { loadReactiveUser } from \"@/services/user.service\";\nimport { firstValue, removeNonPrintable } from \"@/utils/general\";\n\nimport { useAlmItemTypeStore } from \"./almItemType\";\nimport { useBoardStore } from \"./board\";\nimport { useBoardsStore } from \"./boards\";\nimport { useLinkStore } from \"./link\";\nimport { isStickyTypeAlmSynced, useStickyTypeStore } from \"./stickyType\";\nimport { useTeamStore } from \"./team\";\nimport { useUserStore } from \"./user\";\n\nexport type CardEvent = Id & { pos: RelativeCoordinate } & BoardId &\n Partial &\n Pick<\n Card,\n \"type\" | \"priority\" | \"teamId\" | \"iterationId\" | \"flagType\" | \"objectives\" | \"reactions\"\n > &\n Pick;\n\nexport const useCardStore = defineStore(\"card\", {\n state: () => ({ cards: {} as IdMap }),\n getters: {},\n actions: {\n add(cardProperties: CardEvent) {\n const board = useBoardsStore().boards[cardProperties.boardId];\n const id = cardProperties.id;\n const card: Card = {\n id,\n groupId: cardProperties.groupId,\n status: cardProperties.status,\n text: cardProperties.text || \"\",\n points: cardProperties.points || 0,\n priority: cardProperties.priority,\n iterationId: cardProperties.iterationId === undefined ? null : cardProperties.iterationId,\n editor: null,\n links: useLinkStore().linksByCard(cardProperties.groupId || id),\n type: cardProperties.type,\n flagType: cardProperties.flagType,\n almId: cardProperties.almId || \"\",\n almSourceId: cardProperties.almSourceId ?? null,\n almIssueUrl: cardProperties.almIssueUrl,\n teamId: cardProperties.teamId || null,\n precondTeam: cardProperties.precondTeam,\n dependTeam: cardProperties.dependTeam,\n risk: cardProperties.risk,\n objectives: cardProperties.objectives || [],\n reactions: cardProperties.reactions,\n artId: cardProperties.artId || null,\n assignee: cardProperties.assignee || null,\n reporter: cardProperties.reporter || null,\n };\n const cardMeta: CardMeta = {\n pos: cardProperties.pos,\n zIndex: cardProperties.zIndex || board.maxZ,\n mark: \"normal\",\n editing: false,\n dragging: false,\n isHighlighted: false,\n isRelatedToHighlighted: false,\n dependencyTeamFilter: null,\n shouldAnimate: cardProperties.shouldAnimate,\n };\n this.cards[id] = card;\n board.cards[id] = { data: card, meta: cardMeta };\n if (cardProperties.zIndex > board.maxZ) {\n board.maxZ = cardProperties.zIndex;\n }\n if (cardProperties.groupId) {\n useLinkStore().addToLinkGroup(\n cardProperties.groupId,\n cardProperties.boardId,\n board.cards[id],\n );\n }\n useLinkStore().setCardLinkStates(card);\n this.updateLoad(card.id, card.iterationId, card.points);\n this.setType({\n id,\n type: cardProperties.type.id,\n boardId: cardProperties.boardId,\n });\n if (cardProperties.almSourceId !== undefined) {\n this.setAlmSource({ id, almSourceId: cardProperties.almSourceId });\n }\n return id;\n },\n\n setAlmSource(e: Id & { almSourceId: AlmSourceId | null }) {\n const card = this.cards[e.id];\n card.almSourceId = e.almSourceId ?? null;\n },\n\n setPriority(\n e: Id & {\n priority: number;\n priorities?: boolean;\n },\n ) {\n const prios = this.cards[e.id].type.priorities;\n const use = e.priorities === undefined ? !!prios : e.priorities;\n const priority = use ? e.priority || firstValue(prios!).value : round(e.priority || 0, 2);\n this.cards[e.id].priority = priority;\n return { use, priority };\n },\n\n setPoints(e: Id & { points: number }) {\n const card = this.cards[e.id];\n card.points = card.points || 0;\n const diff = e.points - card.points;\n card.points += diff;\n this.updateLoad(e.id, card.iterationId, diff);\n },\n\n setFlag(e: Id & { flagType: CardFlag }) {\n this.cards[e.id].flagType = e.flagType;\n },\n\n setRisk(e: Id & Pick) {\n this.cards[e.id].risk = e.risk;\n },\n\n setText(e: Id & { text: string }) {\n this.cards[e.id].text = e.text;\n },\n\n setIteration(e: Id & { iterationId: number | null }) {\n const card = this.cards[e.id];\n if (card.iterationId !== e.iterationId) {\n this.updateLoad(e.id, card.iterationId, -card.points);\n this.updateLoad(e.id, e.iterationId, card.points);\n card.iterationId = e.iterationId;\n useLinkStore().setCardLinkStates(card);\n return true;\n }\n },\n\n setTeam(e: Id & { teamId: string | null }) {\n const card = this.cards[e.id];\n card.teamId = e.teamId;\n useLinkStore().setCardLinkStates(card);\n },\n\n setArt(e: Id & { artId: string | null }) {\n const card = this.cards[e.id];\n card.artId = e.artId;\n useLinkStore().setCardLinkStates(card);\n },\n\n setPrecondTeam(e: Id & { teamId?: string; teamName?: string }) {\n this.cards[e.id].precondTeam = useTeamStore().findTeam({\n id: e.teamId,\n name: e.teamName,\n });\n },\n\n setDependTeam(e: Id & { teamId?: string; teamName?: string }) {\n this.cards[e.id].dependTeam = useTeamStore().findTeam({\n id: e.teamId,\n name: e.teamName,\n });\n },\n\n setDependAction(e: Id & { teamId: string }) {\n const board = useBoardsStore().boardByType(\"team\", { teamId: e.teamId });\n const card = this.cards[e.id];\n card.flagType = new CardFlag(\"flag\", 0);\n card.precondTeam = useTeamStore().current;\n card.dependTeam = board.team;\n return { board, card };\n },\n\n setType(e: Id & { boardId?: string; type: string }) {\n const card = this.cards[e.id];\n const board = e.boardId ? useBoardsStore().boards[e.boardId] : useBoardStore().currentBoard();\n const type = useStickyTypeStore().findStickyType(e.type);\n const changes: {\n board: Board;\n props: Partial;\n priorities: boolean;\n } = {\n board,\n props: {\n type,\n teamId: card.teamId,\n iterationId: card.iterationId,\n },\n priorities: false,\n };\n if (card.type && card.type.priorities !== type.priorities) {\n const { priority, use } = this.setPriority({\n id: e.id,\n priority: type.priorities ? firstValue(type.priorities).value : 0,\n priorities: !!type.priorities,\n });\n changes.props.priority = priority;\n changes.priorities = use;\n }\n this.updateLoad(e.id, card.iterationId, card.points, type);\n card.type = type;\n if (board.type === \"team\" && card.type.origin === \"backlog\") {\n const backlogAlmSources = useBoardsStore().boardByType(\"backlog\").almSources;\n if (backlogAlmSources.length === 1) {\n changes.props.almSourceId = backlogAlmSources[0].id;\n } else if (backlogAlmSources.length === 0) {\n changes.props.almSourceId = null;\n }\n }\n if (type.functionality === \"dependency\" && card.teamId && !card.precondTeam) {\n card.precondTeam = useTeamStore().findTeam({ id: card.teamId });\n changes.props.precondTeam = card.precondTeam;\n }\n if (type.functionality === \"workitem\" && !card.status) {\n card.status = useAlmItemTypeStore().calcStatus(\n undefined,\n type,\n card.teamId,\n board.artId,\n card.almSourceId,\n );\n changes.props.status = card.status;\n }\n if (type.functionality === \"note\" && card.reactions === undefined) {\n const emptyReactions = reactions.map((reaction) => [reaction, []]);\n useCardStore().setReactions(e.id, Object.fromEntries(emptyReactions));\n }\n if (isStickyTypeAlmSynced(type)) {\n card.text = removeNonPrintable(card.text);\n changes.props.text = card.text;\n }\n return changes;\n },\n\n setObjectives(cardId: Card[\"id\"], objectives: Card[\"objectives\"] | undefined) {\n if (!objectives) {\n return;\n }\n const card = this.cards[cardId];\n if (!card) {\n void captureMessage(\"Tried to set objectives but it is not in the state\", {\n info: { cardId },\n });\n return;\n }\n card.objectives = [...objectives];\n },\n\n setGroup(e: Id & { groupId: string }) {\n const card = this.cards[e.id];\n if (card) {\n // TODO a bug in the backend\n card.groupId = e.groupId;\n for (const boardId in useBoardsStore().boards) {\n const board = useBoardsStore().boards[boardId];\n const boardCard = board.cards[e.id];\n if (boardCard) {\n useLinkStore().addToLinkGroup(e.groupId, boardId, boardCard);\n }\n }\n }\n },\n\n setAlmId(e: Id & { almId: string; almIssueUrl?: string }) {\n const card = this.cards[e.id];\n card.almId = e.almId;\n card.almIssueUrl = e.almIssueUrl;\n },\n\n readOnly(e: Id & ({ readOnly: true; userId: string } | { readOnly: false })) {\n const card = this.cards[e.id];\n if (card) {\n // card might just have been deleted\n if (e.readOnly) {\n card.editor = loadReactiveUser({ id: e.userId });\n } else {\n card.editor = null;\n }\n }\n },\n\n setStatus(\n board: Board,\n cardId: string,\n statusName: string,\n options: { transition?: string; statusClass?: StatusClass } = {},\n ) {\n const card = this.cards[cardId];\n const status = useAlmItemTypeStore().findStatusForCard(\n statusName,\n card,\n board,\n options.statusClass,\n );\n card.status = status;\n card.transition = options.transition;\n return status;\n },\n\n updateCardsStatus(card: Card, board: Board) {\n if (!card.status) {\n return;\n }\n const status = useAlmItemTypeStore().findStatusForCard(card.status.name, card, board);\n for (const id in this.cards) {\n const c = this.cards[id];\n if (hasSameStatus(c, card)) {\n c.status = status;\n }\n }\n\n function hasSameStatus(a: Card, b: Card) {\n return (\n a.status?.id === b.status?.id &&\n a.type.id === b.type.id &&\n a.teamId === b.teamId &&\n a.almSourceId === b.almSourceId\n );\n }\n },\n\n hasCurrentUserReaction(cardId: string, reaction: Reaction): boolean {\n return (\n this.cards[cardId].reactions?.[reaction]?.some(\n (user) => user.id === useUserStore().technicalUser.id,\n ) ?? false\n );\n },\n\n setReactions(cardId: string, reactions: Reactions) {\n this.cards[cardId].reactions = reactions;\n },\n\n setAssignee(cardId: string, user: PersonalUser | null) {\n this.cards[cardId].assignee = user;\n },\n\n setReporter(cardId: string, user: PersonalUser | null) {\n this.cards[cardId].reporter = user;\n },\n\n delete({ id: cardId, boardId }: Id & BoardId) {\n const card = this.cards[cardId];\n const board = useBoardsStore().boards[boardId];\n const existsOnTheBoard = board && board.cards[cardId];\n\n if (existsOnTheBoard && useBoardStore().activeCardId === cardId) {\n useBoardStore().setActiveCardId(null);\n }\n if (board) {\n useBoardStore().unselectSticky(cardId, board);\n }\n if (!card || !existsOnTheBoard) {\n // might already be deleted\n return false;\n }\n useLinkStore().removeFromLinkGroup(card, boardId);\n this.updateLoad(cardId, card.iterationId, -card.points);\n delete this.cards[cardId];\n for (const b in useBoardsStore().boards) {\n delete useBoardsStore().boards[b].cards[cardId];\n }\n return true;\n },\n\n updateLoad(\n cardId: string,\n iterId: number | null | undefined,\n diff: number,\n newType?: StickyType,\n ) {\n const oldType = this.cards[cardId].type;\n if (newType) {\n if (hasLoad(oldType) && !hasLoad(newType)) {\n diff = -diff;\n }\n if (hasLoad(oldType) === hasLoad(newType)) {\n return;\n }\n } else {\n if (!hasLoad(oldType)) {\n return;\n }\n }\n // eslint-disable-next-line eqeqeq\n if (iterId != null) {\n const iters = useBoardsStore().findIterations(cardId);\n if (iters) {\n const iter = iters[iterId];\n if (iter) {\n iters[iterId] = {\n velocity: iter.velocity,\n load: iter.load + diff,\n state: iter.state,\n };\n }\n }\n }\n\n function hasLoad(type: StickyType) {\n return type.functionality !== \"risk\" && type.functionality !== \"dependency\";\n }\n },\n },\n});\n\nexport function mirrorOriginId(card: Card) {\n if (card.groupId && card.groupId !== card.id) {\n return card.groupId;\n }\n}\n\nexport function isCardFromTeam(card: Card, teamId?: string) {\n return card.type.origin === \"team\" && !!teamId && teamId === card.teamId;\n}\n\n/**\n * Get the color of a card based on the board type and the card's teamId.\n * On the backlog board, show the 'taken' color (altColor) if the card is assigned to a team.\n * On the solution backlog board, show the 'taken' color (altColor) if the card is assigned to an art.\n * Otherwise, show the default color (color).\n *\n * @returns The color of the card.\n */\nexport function cardColor(card: Card, board: Board): Color {\n if (board.type === \"backlog\" && card.type.origin === \"backlog\") {\n return card.teamId ? card.type.altColor : card.type.color;\n }\n\n if (board.type === \"solution_backlog\" && card.type.origin === \"solution_backlog\") {\n return card.artId ? card.type.altColor : card.type.color;\n }\n\n return card.type.color;\n}\n","import { clamp } from \"lodash-es\";\nimport { defineStore } from \"pinia\";\n\nimport { relativeToWindow } from \"@/math/coordinate-systems\";\nimport { distance2, interpolate } from \"@/math/coordinates\";\nimport { pointerPosHide, pointerTrailDotDist, pointerTrailMaxLen } from \"@/model/Settings\";\nimport type { Pointer } from \"@/model/baseTypes\";\nimport type { Board } from \"@/model/board\";\nimport type { RelativeCoordinate, WindowCoordinate } from \"@/model/coordinates\";\nimport { isOffScreen, relativeCoord } from \"@/model/coordinates\";\nimport type { TechnicalUser } from \"@/model/user\";\nimport { loadReactiveUser } from \"@/services/user.service\";\n\nimport { useBoardStore } from \"./board\";\nimport { useUserStore } from \"./user\";\n\ninterface PointerEvent {\n id?: TechnicalUser[\"id\"];\n boardId?: Board[\"id\"];\n pos: RelativeCoordinate;\n}\n\nexport const usePointerStore = defineStore(\"pointer\", {\n state: () => {\n return {\n pointers: {} as Record,\n isPointerActive: false,\n cleanupInterval: undefined as ReturnType | undefined,\n };\n },\n\n actions: {\n set(pointerEvent: PointerEvent) {\n this.ensureCleanupIsRunning();\n const currentBoardId = useBoardStore().currentBoard().id;\n const boardId = pointerEvent.boardId || currentBoardId;\n const id = pointerEvent.id || useUserStore().technicalUser.id;\n if (boardId !== currentBoardId) {\n return;\n }\n if (isOffScreen(pointerEvent.pos)) {\n delete this.pointers[id];\n return;\n }\n\n const pointer = this.getPointer(id);\n pointer.timestamp = Date.now();\n this.addPointerPos(pointer, pointerEvent.pos);\n },\n activatePointer(boolean: boolean) {\n this.isPointerActive = boolean;\n },\n togglePointerActivation() {\n this.isPointerActive = !this.isPointerActive;\n },\n ensureCleanupIsRunning() {\n if (!this.cleanupInterval) {\n this.cleanupInterval = setInterval(this.cleanupPointers.bind(this), pointerPosHide);\n }\n },\n\n cleanupPointers() {\n const now = Date.now();\n for (const id in this.pointers) {\n if (now - this.pointers[id].timestamp > pointerPosHide) {\n delete this.pointers[id];\n }\n }\n if (Object.keys(this.pointers).length === 0) {\n clearInterval(this.cleanupInterval);\n }\n },\n\n getPointer(id: TechnicalUser[\"id\"]) {\n let pointer = this.pointers[id];\n if (!pointer) {\n pointer = {\n user: loadReactiveUser({ id }),\n relativePos: relativeCoord(0, 0),\n windowPos: [],\n timestamp: 0,\n };\n this.pointers = { ...this.pointers, [id]: pointer };\n }\n return pointer;\n },\n\n addPointerPos(p: Pointer, relativePos: RelativeCoordinate) {\n p.relativePos = { ...relativePos };\n const windowPos = relativeToWindow(relativePos);\n if (p.windowPos.length === 0) {\n p.windowPos.unshift({ index: 0, pos: windowPos });\n } else {\n this.interpolatePointerPos(p, windowPos);\n if (p.windowPos.length > pointerTrailMaxLen) {\n p.windowPos.splice(pointerTrailMaxLen);\n }\n }\n },\n\n interpolatePointerPos(p: Pointer, windowPos: WindowCoordinate) {\n const lastPos = p.windowPos[0];\n const dist = Math.sqrt(distance2(windowPos, lastPos.pos));\n const steps = clamp(Math.round(dist / pointerTrailDotDist), 1, pointerTrailMaxLen);\n const stepLen = 1 / steps;\n for (let i = 1; i <= steps; i++) {\n const pos = interpolate(i * stepLen, lastPos.pos, windowPos);\n p.windowPos.unshift({\n index: lastPos.index + Math.round(100 * i * stepLen),\n pos,\n });\n }\n },\n\n reset() {\n clearInterval(this.cleanupInterval);\n this.$reset();\n },\n },\n});\n","import { defineStore } from \"pinia\";\n\nimport type { TimerEvent } from \"@/model/timer\";\n\nimport { useArtStore } from \"./art\";\nimport { useBoardStore } from \"./board\";\n\nexport const useTimerStore = defineStore(\"timer\", {\n state: () => ({\n timers: [] as TimerEvent[],\n active: false,\n }),\n getters: {\n boardTimers(): TimerEvent[] {\n return this.timers.filter((timer) => timer.boardId === useBoardStore().currentBoard().id);\n },\n artTimers(): TimerEvent[] {\n return this.timers.filter(\n (timer) => !timer.boardId && useArtStore().isCurrentArt(timer.artId),\n );\n },\n },\n actions: {\n toggleTimer() {\n this.active = !this.active;\n },\n },\n});\n","import { defineStore } from \"pinia\";\n\nimport { userHeartbeatInterval } from \"@/model/Settings\";\nimport type { AuthUser } from \"@/model/user\";\n\nexport type BoardUser = AuthUser & {\n boardVisitTimestamp: number;\n};\n\nexport const useUsersOnBoardStore = defineStore(\"usersOnBoard\", {\n state: () => ({\n usersOnBoard: [] as BoardUser[],\n }),\n getters: {},\n actions: {\n addUserOnBoard(user: BoardUser) {\n this.usersOnBoard = [user, ...this.usersOnBoard.filter(({ id }) => id !== user.id)];\n },\n removeUserFromBoard(userId: string) {\n this.usersOnBoard = this.usersOnBoard.filter((user) => user.id !== userId);\n },\n findUserOnBoard(userId: string): BoardUser | undefined {\n return this.usersOnBoard.find((user) => user.id === userId);\n },\n expireUsersOnBoard() {\n this.usersOnBoard = this.usersOnBoard.filter((user) => {\n if (user.boardVisitTimestamp) {\n const now = Date.now();\n const diff = now - user.boardVisitTimestamp;\n return diff <= userHeartbeatInterval * 2;\n } else {\n return false;\n }\n });\n },\n },\n});\n","// Wrap window.MutationObserver so that they can be disconnected/reconnected to improve performance.\n\nconst observers = new Array();\n\nexport function wrapMutationObserver() {\n window.MutationObserver = WrappedMutationObserver;\n}\n\nexport function disconnectObservers() {\n for (const wrapped of observers) {\n wrapped.observer.disconnect();\n }\n}\n\nexport function reconnectObservers() {\n for (const wrapped of observers) {\n for (const param of wrapped.observeParams) {\n wrapped.observer.observe(param.target, param.options);\n }\n }\n}\n\ninterface ObserveParams {\n target: Node;\n options?: MutationObserverInit;\n}\n\ninterface Wrapped extends MutationObserver {\n observeParams: ObserveParams[];\n observer: MutationObserver;\n}\n\nclass WrappedMutationObserver extends MutationObserver {\n constructor(callback: MutationCallback, force?: boolean) {\n super(callback);\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const observer = this;\n if (force) {\n return observer;\n }\n const obs = {\n observer,\n observeParams: new Array(),\n observe(target: Node, options?: MutationObserverInit) {\n this.observeParams.push({ target, options });\n observer.observe(target, options);\n },\n takeRecords(): MutationRecord[] {\n return observer.takeRecords();\n },\n disconnect() {\n this.observeParams = [];\n observer.disconnect();\n },\n };\n observers.push(obs);\n return obs;\n }\n}\n","import type { InjectionKey } from \"vue\";\nimport { inject, nextTick } from \"vue\";\n\nimport { performanceLog } from \"../general\";\n\nexport function nextTicks(ticks: number, callback: () => void) {\n const start = performance.now();\n if (ticks === 0) {\n callback();\n } else {\n void nextTick(() => {\n performanceLog(`tick ${ticks}`, start);\n nextTicks(ticks - 1, callback);\n });\n }\n}\n\n/**\n * Injects a value from the Vue composition API's injection system.\n * If the value is not found, an error is thrown.\n */\nexport function injectStrict(key: InjectionKey, fallback?: T) {\n const resolved = inject(key, fallback);\n if (!resolved) {\n throw new Error(`Could not find \"${key.description}\" in the context.`);\n }\n return resolved;\n}\n","import { clamp, round } from \"lodash-es\";\n\nimport { captureMessage } from \"@/error/sentry\";\nimport { isEqual } from \"@/math/coordinates\";\nimport CardFlag from \"@/model/CardFlag\";\nimport { type Board, isBacklogBoard } from \"@/model/board\";\nimport type { CardMeta } from \"@/model/card\";\nimport { relativeCoord } from \"@/model/coordinates\";\nimport type { LinkedObjective } from \"@/model/objective\";\nimport { useAlmItemTypeStore } from \"@/store/almItemType\";\nimport { useBoardsStore } from \"@/store/boards\";\nimport type { CardEvent } from \"@/store/card\";\nimport { useCardStore } from \"@/store/card\";\nimport { useStickyTypeStore } from \"@/store/stickyType\";\nimport { useTeamStore } from \"@/store/team\";\nimport { firstValue } from \"@/utils/general\";\n\nimport { mapReactions, mapUserId } from \"./mapper/mapBackendData\";\nimport type { ServerSticky } from \"./serverModel\";\n\nexport function serverStickyPos(data: Partial) {\n if (data.a_center) {\n return relativeCoord(data.a_center[0], 1 - data.a_center[1]);\n }\n}\n\nexport function changeSticky(board: Board, id?: string, data?: Partial) {\n if (id && data) {\n const card = board.cards[id];\n if (!card) {\n return;\n }\n const pos = serverStickyPos(data);\n if (!isBacklogBoard(board.type) && pos && !isEqual(card.meta.pos, pos)) {\n useBoardsStore().setCardPos({ id, boardId: board.id, ...pos });\n }\n\n const cardStore = useCardStore();\n const exist = card.data;\n if (data.text !== undefined && data.text !== exist.text) {\n cardStore.setText({ id, text: data.text });\n }\n if (data.type_id !== undefined && data.type_id !== exist.type.id) {\n cardStore.setType({ id, type: data.type_id });\n }\n if (\n !card.data.type.priorities &&\n data.WSJF_value !== undefined &&\n data.WSJF_value !== exist.priority\n ) {\n cardStore.setPriority({ id, priority: data.WSJF_value });\n }\n if (\n card.data.type.priorities &&\n data.step_value !== undefined &&\n data.step_value !== exist.priority\n ) {\n cardStore.setPriority({ id, priority: data.step_value });\n }\n if (data.story_points !== undefined && data.story_points !== exist.points) {\n cardStore.setPoints({ id, points: data.story_points });\n }\n if (data.status !== undefined && data.status !== exist.status?.name) {\n cardStore.setStatus(board, id, data.status, {\n statusClass: data.status_class,\n });\n }\n if (data.team_id !== undefined) {\n const teamId = data.team_id ? \"\" + data.team_id : null;\n if (teamId !== exist.teamId) {\n cardStore.setTeam({ id, teamId });\n }\n }\n if (data.art_id !== undefined) {\n const artId = data.art_id?.toString() ?? null;\n if (artId !== exist.artId) {\n cardStore.setArt({ id, artId });\n }\n }\n if (\n data.iteration_number !== undefined &&\n // yes null or undefined\n // eslint-disable-next-line eqeqeq\n data.iteration_number != exist.iterationId\n ) {\n cardStore.setIteration({\n id,\n iterationId: data.iteration_number,\n });\n }\n if (data.alm_issue_id !== undefined && \"\" + data.alm_issue_id !== exist.almId) {\n cardStore.setAlmId({\n id,\n almId: \"\" + data.alm_issue_id,\n almIssueUrl: data.alm_issue_url,\n });\n }\n if (data.alm_source !== undefined && data.alm_source !== exist.almSourceId) {\n cardStore.setAlmSource({ id, almSourceId: data.alm_source });\n }\n if (data.sticky_group !== undefined && data.sticky_group !== exist.groupId) {\n cardStore.setGroup({ id, groupId: data.sticky_group });\n }\n if (data.flag_type !== undefined && data.flag_type !== exist.flagType.toString()) {\n cardStore.setFlag({\n id,\n flagType: CardFlag.fromFlagString(data.flag_type),\n });\n }\n if (data.risk !== undefined && data.risk !== exist.risk) {\n cardStore.setRisk({ id, risk: data.risk });\n }\n //TODO can data.precond_team_id really be null? Verify and remove the null logic if possible\n if (\n data.precond_team_id !== undefined &&\n isTeamIdDifferent(data.precond_team_id, exist.precondTeam?.id)\n ) {\n cardStore.setPrecondTeam({\n id,\n teamId: data.precond_team_id !== null ? \"\" + data.precond_team_id : undefined,\n });\n }\n if (data.precond_team !== undefined && !exist.precondTeam) {\n cardStore.setPrecondTeam({ id, teamName: data.precond_team });\n }\n //TODO can data.depend_team_id really be null? Verify and remove the null logic if possible\n if (\n data.depend_team_id !== undefined &&\n isTeamIdDifferent(data.depend_team_id, exist.dependTeam?.id)\n ) {\n cardStore.setDependTeam({\n id,\n teamId: data.depend_team_id !== null ? \"\" + data.depend_team_id : undefined,\n });\n }\n if (data.depend_team !== undefined && !exist.dependTeam) {\n cardStore.setDependTeam({ id, teamName: data.depend_team });\n }\n if (data.objectives !== undefined) {\n cardStore.setObjectives(id, validateObjectives(data.objectives));\n }\n if (data.reactions !== undefined) {\n cardStore.setReactions(id, mapReactions(data.reactions));\n }\n if (data.assignee !== undefined) {\n cardStore.setAssignee(id, mapUserId(data.assignee?.pip_id, data.assignee?.alm_id));\n }\n if (data.reporter !== undefined) {\n cardStore.setReporter(id, mapUserId(data.reporter?.pip_id, data.reporter?.alm_id));\n }\n }\n}\n\nexport function addSticky(board: Board, data: ServerSticky & Pick) {\n const pos = data.a_center || [0.5, 0.5];\n const type = useStickyTypeStore().findStickyType(data.type_id);\n const almSourceId = data.alm_source ?? board.almSources?.[0]?.id;\n const teamId = data.team_id ? data.team_id.toString() : null;\n const artId = data.art_id ? data.art_id.toString() : null;\n\n const event: CardEvent = {\n id: data._id,\n groupId: data.sticky_group,\n text: data.text || \"\",\n status: useAlmItemTypeStore().calcStatus(\n data.status,\n type,\n teamId,\n artId,\n almSourceId,\n data.status_class,\n ),\n points: data.story_points || 0,\n boardId: board.id,\n type,\n teamId,\n iterationId: data.iteration_number,\n pos: relativeCoord(clamp(pos[0], 0, 1), 1 - clamp(pos[1], 0, 1)),\n zIndex: data.stack_pos,\n priority: type.priorities\n ? type.priorities[data.step_value!]?.value || firstValue(type.priorities).value\n : round(data.WSJF_value || 0, 2),\n precondTeam: useTeamStore().findTeam({\n id: \"\" + data.precond_team_id,\n name: data.precond_team,\n }),\n dependTeam: useTeamStore().findTeam({\n id: \"\" + data.depend_team_id,\n name: data.depend_team,\n }),\n flagType: CardFlag.fromFlagString(data.flag_type),\n almId: data.alm_issue_id === undefined ? undefined : \"\" + data.alm_issue_id,\n almSourceId,\n almIssueUrl: data.alm_issue_url,\n risk: data.risk,\n shouldAnimate: data.shouldAnimate,\n objectives: validateObjectives(data.objectives),\n reactions: data.reactions ? mapReactions(data.reactions) : undefined,\n artId,\n assignee: mapUserId(data.assignee?.pip_id, data.assignee?.alm_id),\n reporter: mapUserId(data.reporter?.pip_id, data.reporter?.alm_id),\n };\n useCardStore().add(event);\n}\n\nfunction validateObjectives(objectives: ServerSticky[\"objectives\"]): LinkedObjective[] {\n if (!objectives) {\n return [];\n }\n return objectives.flatMap((objective) => {\n if (objective.id && objective.board_id) {\n return { id: objective.id, boardId: objective.board_id };\n }\n void captureMessage(\"Received invalid objective\", { info: { objective } });\n return [];\n });\n}\n\nfunction isTeamIdDifferent(numericTeamId: number | null, stringTeamId: string | undefined) {\n return numericTeamId === null ? stringTeamId !== undefined : \"\" + numericTeamId !== stringTeamId;\n}\n","import { isArray, sortBy } from \"lodash-es\";\nimport { nextTick } from \"vue\";\n\nimport { sendBoardLoaded, sendStickyNoteAction } from \"@/composables/useEventBus\";\nimport { CancelError } from \"@/error/CancelError\";\nimport { addBreadcrumb } from \"@/error/sentry\";\nimport { windowToRelative } from \"@/math/coordinate-systems\";\nimport { distance2 } from \"@/math/coordinates\";\nimport { updateTimeout } from \"@/model/Settings\";\nimport type { IdMap } from \"@/model/baseTypes\";\nimport type { Board } from \"@/model/board\";\nimport { hasBoardObjectives } from \"@/model/board\";\nimport { relativeCoord } from \"@/model/coordinates\";\nimport type { SessionAlmStatus } from \"@/model/session\";\nimport type { Shape } from \"@/model/shape\";\nimport type { TimerEvent } from \"@/model/timer\";\nimport { isBackendUserId } from \"@/model/user\";\nimport { loadUser } from \"@/services/user.service\";\nimport { useArtStore } from \"@/store/art\";\nimport { useBoardStore } from \"@/store/board\";\nimport { useBoardsStore } from \"@/store/boards\";\nimport { useCardStore } from \"@/store/card\";\nimport { useConnectionStore } from \"@/store/connection\";\nimport { useLinkStore } from \"@/store/link\";\nimport { useObjectiveStore } from \"@/store/objective\";\nimport { usePointerStore } from \"@/store/pointer\";\nimport { useSessionStore } from \"@/store/session\";\nimport { useTimerStore } from \"@/store/timer\";\nimport { useUsersOnBoardStore } from \"@/store/usersOnBoard\";\nimport { i18n } from \"@/translations/i18n\";\nimport { centerCoord } from \"@/utils/dom/coordinates\";\nimport { disconnectObservers, reconnectObservers } from \"@/utils/dom/mutationObserver\";\nimport { performanceLog } from \"@/utils/general\";\nimport { nextTicks } from \"@/utils/vue\";\n\nimport type { BackendSession, Subscription } from \"./BackendSession\";\nimport type { EventInfo } from \"./EventInfo\";\nimport { addSticky, changeSticky, serverStickyPos } from \"./changeSticky\";\nimport { mapEvents, mapObjective, mapPartialObjective } from \"./mapper/mapBackendData\";\nimport type {\n ServerEvent,\n ServerIterationSubsState,\n ServerLink,\n ServerObjective,\n ServerStickiesUpdate,\n ServerStickiesUpdateCacheHit,\n ServerStickiesUpdateCacheMiss,\n ServerSticky,\n} from \"./serverModel\";\n\nexport function sessionSubscriptions(backendSess: BackendSession) {\n return [\n backendSess.sessionSubscribe<[ServerLink]>(\"link.add\", (args) => {\n const [link] = args ?? [];\n sendAddLink(link);\n }),\n backendSess.sessionSubscribe<[string]>(\"link.remove\", (args) => {\n const [id] = args ?? [];\n useLinkStore().remove(id);\n }),\n backendSess.almSubscribe<[SessionAlmStatus]>(\"running_state.update\", (args) => {\n const [status] = args ?? [];\n useConnectionStore().alm = status === \"running\";\n useSessionStore().setSessionAlmStatus(status);\n }),\n !backendSess.getAlmType()\n ? null\n : backendSess.almSubscribe<[ServerIterationSubsState]>(\"iteration_sync.update\", (args) => {\n const [iterState] = args ?? [];\n setIterationStatus(iterState);\n }),\n backendSess.sessionSubscribe<[ServerEvent[]]>(\"timer.handle_event\", (args) => {\n const [events] = args ?? [];\n void setTimers(events);\n }),\n backendSess.boardSubscribe(\n \"\",\n \"sticky.start_update\",\n \"session\",\n handleUpdate((id, userId) => useCardStore().readOnly({ readOnly: true, id, userId })),\n ),\n backendSess.boardSubscribe(\"\", \"sticky.update\", \"session\", handleUpdate()),\n backendSess.boardSubscribe(\n \"\",\n \"sticky.stop_update\",\n \"session\",\n handleUpdate((id) => {\n useCardStore().readOnly({ readOnly: false, id });\n sendStickyNoteAction(id, { action: \"changed\" });\n }),\n ),\n backendSess.boardSubscribe<[ServerSticky]>(\"\", \"sticky.add\", \"session\", (args, _, event) => {\n const [data] = args ?? [];\n const board = getBoardFromEvent(event);\n if (!board) {\n return;\n }\n addSticky(board, { ...data, shouldAnimate: true });\n sendStickyNoteAction(data._id, { action: \"changed\" });\n }),\n backendSess.boardSubscribe<[string]>(\"\", \"sticky.remove\", \"session\", (args, _, event) => {\n const [id] = args ?? [];\n useCardStore().delete({ id, boardId: event.boardId });\n }),\n backendSess.boardSubscribe<[number]>(\"\", \"sticky.scale\", \"session\", (args, _, event) => {\n const [factor] = args ?? [];\n useBoardsStore().setCardSize({ boardId: event.boardId, factor });\n }),\n backendSess.boardSubscribe<[string]>(\n \"\",\n \"sticky.bring_to_front\",\n \"session\",\n (args, _, event) => {\n const [id] = args ?? [];\n useBoardsStore().cardToFront({ id, boardId: event.boardId });\n },\n ),\n backendSess.boardSubscribe<[Shape]>(\"\", \"shape.add\", \"session\", ([shape], _, event) =>\n useBoardsStore().addShape(event.boardId, shape),\n ),\n backendSess.boardSubscribe<[Shape]>(\"\", \"shape.edit\", \"session\", ([shape], _, event) =>\n useBoardsStore().editShape(event.boardId, shape),\n ),\n backendSess.boardSubscribe<[string]>(\"\", \"shape.remove\", \"session\", ([id], _, event) =>\n useBoardsStore().removeShape(event.boardId, id),\n ),\n ];\n}\n\nfunction handleUpdate(action?: (id: string, userId: string) => void) {\n return (args: [string, ServerSticky], kwargs: unknown, event: EventInfo) => {\n const [id, data] = args ?? [];\n const board = getBoardFromEvent(event);\n if (!board) {\n return;\n }\n action?.(id, event.userId);\n changeSticky(board, id, data);\n };\n}\n\nexport function createBoardSubscriptions(backendSess: BackendSession, board: Board) {\n type Subscriptions = Array>;\n\n return Promise.all([\n ...boardSubscriptions(),\n ...teamBoardSubscriptions(),\n ...objectivesBoardSubscriptions(),\n ]);\n\n function boardSubscriptions(): Subscriptions {\n return [\n backendSess.boardSubscribe<[{ x: number; y: number }]>(\n board.id,\n \"pointer.position\",\n \"board\",\n (args, _, event) => {\n const [coord] = args ?? [];\n usePointerStore().set({\n boardId: board.id,\n id: event.userId,\n pos: relativeCoord(coord.x, coord.y),\n });\n },\n ),\n backendSess.boardSubscribe<[string]>(board.id, \"subscribers.join\", \"board\", (args) => {\n const [userId] = args ?? [];\n // don't await!\n void handleUserJoined(userId);\n }),\n backendSess.boardSubscribe<[string]>(board.id, \"subscribers.leave\", \"board\", (args) => {\n const [userId] = args ?? [];\n handleUserLeft(userId);\n }),\n ];\n\n async function handleUserJoined(userId: string) {\n if (!isBackendUserId(userId)) {\n const user = useUsersOnBoardStore().findUserOnBoard(userId);\n if (user) {\n user.boardVisitTimestamp = Date.now();\n } else {\n const user = await loadUser({ id: userId });\n const boardVisitTimestamp = Date.now();\n useUsersOnBoardStore().addUserOnBoard({\n ...user,\n boardVisitTimestamp,\n });\n }\n }\n }\n\n function handleUserLeft(userId: string) {\n if (!isBackendUserId(userId)) {\n useUsersOnBoardStore().removeUserFromBoard(userId);\n }\n }\n }\n\n function objectivesBoardSubscriptions(): Subscriptions {\n if (board.type !== \"objectives\") {\n return [];\n }\n return Object.values(useBoardsStore().boards)\n .filter((board) => useArtStore().isCurrentArt(board.artId) && hasBoardObjectives(board))\n .flatMap((board) => objectivesSubscriptions(board));\n }\n\n function teamBoardSubscriptions(): Subscriptions {\n if (board.type !== \"team\") {\n return [];\n }\n return [\n ...objectivesSubscriptions(board),\n backendSess.boardSubscribe<[number, number]>(board.id, \"capacity.update\", \"board\", (args) => {\n const [iteration, velocity] = args ?? [];\n useBoardsStore().setVelocity({\n id: board.id,\n iteration,\n velocity: +velocity,\n });\n }),\n ];\n }\n\n function objectivesSubscriptions(board: Board): Subscriptions {\n const objectives = useObjectiveStore();\n\n return [\n backendSess.boardSubscribe<[ServerObjective]>(board.id, \"objective.add\", \"board\", (args) => {\n const [objective] = args ?? [];\n objectives.add({ boardId: board.id, ...mapObjective(objective) });\n }),\n backendSess.boardSubscribe<[string]>(board.id, \"objective.remove\", \"board\", (args) => {\n const [id] = args ?? [];\n objectives.remove({ boardId: board.id, id });\n }),\n backendSess.boardSubscribe<[string, ServerObjective]>(\n board.id,\n \"objective.update\",\n \"board\",\n (args) => {\n const [id, objective] = args ?? [];\n objectives.update({\n boardId: board.id,\n ...mapPartialObjective(objective),\n id,\n });\n },\n ),\n backendSess.boardSubscribe<[string, boolean, number]>(\n board.id,\n \"objective.move\",\n \"board\",\n (args) => {\n const [id, stretch, rank] = args ?? [];\n objectives.move({ boardId: board.id, id, stretch, rank });\n },\n ),\n ];\n }\n}\n\nexport function loadStickies(backendSess: BackendSession, board: Board): Promise {\n let loadStart: number;\n type ServerStickyId = string;\n\n interface ParsedServerStickyUpdates {\n time: number;\n changes: ServerSticky[];\n removes?: ServerStickyId[];\n }\n\n const time = Date.now();\n const since = board.loaded;\n return backendSess.getBoardStickies(board.id, since).then((stickiesOrUpdates) => {\n // user logged out / switched session while the stickies where loaded\n if (!useBoardsStore().boards[board.id]) {\n return Promise.reject(new CancelError(\"Sticky loading cancelled\"));\n }\n const stickies = parseStickies(stickiesOrUpdates);\n const updated = updateStickies(stickies.changes);\n deleteStickies(updated, stickies.removes);\n return stickies.time;\n });\n\n function isCacheHitServerStickiesUpdate(\n serverStickies: ServerSticky[] | ServerStickiesUpdate,\n ): serverStickies is ServerStickiesUpdateCacheHit {\n return !isArray(serverStickies) && \"updates\" in serverStickies;\n }\n\n function isCacheMissServerStickiesUpdate(\n serverStickies: ServerSticky[] | ServerStickiesUpdate,\n ): serverStickies is ServerStickiesUpdateCacheMiss {\n return !isArray(serverStickies) && \"stickies\" in serverStickies;\n }\n\n function parseStickies(\n serverStickies: ServerSticky[] | ServerStickiesUpdate,\n ): ParsedServerStickyUpdates {\n if (isCacheMissServerStickiesUpdate(serverStickies)) {\n const { stickies } = serverStickies;\n const stickyIds = new Set(stickies.map((sticky: ServerSticky) => sticky._id));\n const removes: ServerStickyId[] = Object.keys(board.cards).filter(\n (cardId) => !stickyIds.has(cardId),\n );\n\n return {\n time: serverStickies.timestamp,\n changes: stickies,\n removes,\n };\n }\n\n if (isCacheHitServerStickiesUpdate(serverStickies)) {\n const { updates } = serverStickies;\n const changes: ServerSticky[] = updates\n .filter((update) => update.event === \"alter_sticky\")\n .map((update) => update.obj);\n const removes: ServerStickyId[] = updates\n .filter((update) => update.event === \"delete_sticky\")\n .map((update) => update.obj._id);\n\n return {\n time: serverStickies.timestamp,\n changes,\n removes,\n };\n }\n\n return { time, changes: serverStickies };\n }\n\n function updateStickies(changes: ServerSticky[]): IdMap {\n const ids: IdMap = {};\n\n const center = windowToRelative(centerCoord());\n const sorted = sortBy(changes, (serverSticky) => {\n const pos = serverStickyPos(serverSticky);\n return pos ? distance2(pos, center) : 2;\n });\n const operations = sorted.map((serverSticky: ServerSticky) => {\n ids[serverSticky._id] = true;\n return useCardStore().cards[serverSticky._id]\n ? () => {\n useCardStore().readOnly({ id: serverSticky._id, readOnly: false });\n changeSticky(board, serverSticky._id, serverSticky);\n }\n : () => addSticky(board, serverSticky);\n });\n\n void addBreadcrumb(\"render\", {\n message: \"Updating stickies on the board\",\n data: { count: operations.length, type: board.type, boardId: board.id },\n });\n disconnectObservers();\n loadStart = performance.now();\n setTimeout(() => processOperations(operations, 25, board.id), 0);\n return ids;\n }\n\n function processOperations(\n operations: Array<() => void>,\n batchSize: number,\n boardId?: Board[\"id\"],\n ) {\n const start = performance.now();\n operations.slice(0, batchSize).forEach((operation) => operation());\n if (operations.length > batchSize) {\n setTimeout(\n () =>\n nextTick(() => {\n const end = performance.now();\n processOperations(\n operations.slice(batchSize),\n (batchSize * updateTimeout) / (end - start),\n board.id,\n );\n }),\n 1,\n );\n } else {\n // 2 is found by trial: check that the last tick takes (nearly) no time\n nextTicks(2, () => {\n performanceLog(\"Load stickies\", loadStart);\n sendBoardLoaded(boardId);\n reconnectObservers();\n });\n }\n }\n\n function deleteStickies(updateIds: IdMap, deleteIds?: string[]) {\n if (deleteIds) {\n deleteIds.forEach((id) => {\n useCardStore().delete({ id, boardId: board.id });\n });\n } else {\n for (const c in board.cards) {\n if (!updateIds[c]) {\n useCardStore().delete({ id: c, boardId: board.id });\n }\n }\n }\n }\n}\n\n// links are updated by subscription of link.add / link.remove\n// this is not always working (why?), so we explicitly update the links with this function\nexport async function updateLinks(backendSess: BackendSession) {\n type LinkStates = Record;\n\n const links = await backendSess.getLinks();\n await loadStickiesForHalfCompleteLinks({ links, backendSess });\n const ids = linkIds(links);\n deleteLinks(ids);\n createLinks(links, ids);\n\n function linkIds(ls: ServerLink[]) {\n const ids: LinkStates = {};\n ls.forEach((l) => {\n ids[l.id] =\n useLinkStore().cardsByLink(l.from_sticky_id).length > 0 &&\n useLinkStore().cardsByLink(l.to_sticky_id).length > 0\n ? \"valid\"\n : \"orphan\";\n });\n return ids;\n }\n\n function deleteLinks(ids: LinkStates) {\n for (const link of useLinkStore().links) {\n if (!ids[link.id]) {\n // useLinkStore().remove(link.id);\n } else if (ids[link.id] === \"valid\") {\n ids[link.id] = \"existing\";\n }\n }\n }\n\n function createLinks(ls: ServerLink[], ids: LinkStates) {\n ls.forEach((l) => {\n if (ids[l.id] === \"valid\") {\n sendAddLink(l);\n }\n });\n }\n}\n\n// stickies from other ARTs might not be loaded\n// if we have links to them, load them now\nasync function loadStickiesForHalfCompleteLinks({\n links,\n backendSess,\n}: {\n links: ServerLink[];\n backendSess: BackendSession;\n}) {\n const notLoadedStickies = new Array();\n links.forEach((link) => {\n const fromCards = useLinkStore().cardsByLink(link.from_sticky_id);\n const toCards = useLinkStore().cardsByLink(link.to_sticky_id);\n\n const hasFrom = fromCards.length > 0;\n const hasTo = toCards.length > 0;\n\n // If one of the stickies is not loaded, load it\n if (hasFrom !== hasTo) {\n // Only fetch stickies that are linked to a card on the current board\n const loadedCards = hasFrom ? fromCards : toCards;\n const onCurrentBoard = loadedCards.some((card) => useBoardStore().board?.cards[card.id]);\n\n if (onCurrentBoard) {\n notLoadedStickies.push(hasFrom ? link.to_sticky_id : link.from_sticky_id);\n }\n }\n });\n if (notLoadedStickies.length === 0) {\n return;\n }\n\n const stickies = await backendSess.getStickies(notLoadedStickies);\n stickies.forEach((sticky) => {\n const board = useBoardsStore().boards[sticky.board_id];\n addSticky(board, sticky);\n });\n}\n\nfunction setIterationStatus(iterState: ServerIterationSubsState) {\n for (const id in useBoardsStore().boards) {\n const board = useBoardsStore().boards[id];\n if (board.type === \"team\" && board.team.id === \"\" + iterState.team_id) {\n const status =\n iterState.status === \"syncing\" ? \"syncing\" : iterState.error ? \"fail\" : \"success\";\n useBoardsStore().setIterationStatus({\n boardId: id,\n id: iterState.pi_iteration_id,\n status,\n detail: iterState.error\n ? i18n.global.t(\"iterationSync.failedSync\", {\n errorMessage: iterState.error,\n })\n : \"\",\n });\n break;\n }\n }\n}\n\nexport async function setTimers(events: ServerEvent[]) {\n const timers = mapEvents(events);\n await loadTimerUsers(timers);\n useTimerStore().timers = timers;\n}\n\nfunction loadTimerUsers(timers: TimerEvent[]) {\n return Promise.all(\n timers.map(async (timer) => {\n timer.updatedByUser = await loadUser({ id: timer.updatedById });\n }),\n );\n}\n\nfunction sendAddLink(link: ServerLink) {\n useLinkStore().add({\n id: link.id,\n from: link.from_sticky_id,\n to: link.to_sticky_id,\n type: link.link_type_id,\n state: \"default\",\n });\n}\n\nfunction getBoardFromEvent(event: EventInfo) {\n return useBoardsStore().boards[event.boardId];\n}\n","import { random } from \"lodash-es\";\n\nimport { internalActions } from \"@/action/internalActions\";\nimport { startServerTicks } from \"@/components/utils/serverTime\";\nimport { addBreadcrumb, captureException } from \"@/error/sentry\";\nimport type { BoardType, IdMap } from \"@/model/baseTypes\";\nimport { almTypeInfo } from \"@/model/baseTypes\";\nimport type { Board, BoardData } from \"@/model/board\";\nimport { hasBoardObjectives, isBacklogBoard, isFrontendBoard } from \"@/model/board\";\nimport type { Category, FlexType } from \"@/model/flexboard\";\nimport type { Link, LinkType } from \"@/model/link\";\nimport type { SearchResult } from \"@/model/search\";\nimport type { AlmStickyType, StickyType } from \"@/model/stickyType\";\nimport type { TimerData } from \"@/model/timer\";\nimport type { EventFilter } from \"@/store/activity\";\nimport { useAlmItemTypeStore } from \"@/store/almItemType\";\nimport { useArtStore } from \"@/store/art\";\nimport { useBoardStore } from \"@/store/board\";\nimport { useBoardsStore } from \"@/store/boards\";\nimport { useCompanySettingsStore } from \"@/store/companySettings\";\nimport { useConnectionStore } from \"@/store/connection\";\nimport { useFlexStore } from \"@/store/flex\";\nimport { useLicenseStore } from \"@/store/license\";\nimport { useLoadingStore } from \"@/store/loading\";\nimport { useNavigationStore } from \"@/store/navigation\";\nimport { useServerSettingsStore } from \"@/store/serverSettings\";\nimport { useSessionStore } from \"@/store/session\";\nimport { useStatisticsStore } from \"@/store/statistics\";\nimport { isZombieType, useStickyTypeStore } from \"@/store/stickyType\";\nimport { useTeamStore } from \"@/store/team\";\nimport Scheduler from \"@/utils/async/Scheduler\";\n\nimport type { BackendSession, SearchStickiesQuery, Subscription } from \"./BackendSession\";\nimport { DataError } from \"./DataError\";\nimport { sender } from \"./Sender\";\nimport { mapAlmItemType, mapAlmItemTypes } from \"./mapper/mapAlmItemType\";\nimport {\n mapAlmStickyTypes,\n mapArts,\n mapBoardIterations,\n mapCategories,\n mapCompanySettings,\n mapFlexBackgrounds,\n mapFlexTypes,\n mapLinkTypes,\n mapLinks,\n mapObjective,\n mapScale,\n mapSearchResults,\n mapSessions,\n mapSettings,\n mapStickyType,\n mapTeams,\n} from \"./mapper/mapBackendData\";\nimport { mapBoard, mapFlexBoard } from \"./mapper/mapBoard\";\nimport { mapStickyChanges } from \"./mapper/mapStickyChange\";\nimport type { ServerAlmItemTypeMap, ServerInfo, ServerStatusWithData } from \"./serverModel\";\nimport {\n createBoardSubscriptions,\n loadStickies,\n sessionSubscriptions,\n setTimers,\n updateLinks,\n} from \"./subscriptionHandlers\";\n\ndeclare global {\n /**\n * This is a bit hacky, but it's the cleanest way to fix a bug that\n * seems to be triggered by a new version of Backend.ts being imported\n * while the user is still in the middle of a session. See REN-13773.\n * Note: This property should not be accesed anywhere else, only in this module!!\n */\n interface Window {\n piplanning_backendSess?: BackendSession;\n }\n}\n\nlet backendSess: BackendSession;\ngetExistingSession();\n\nlet boardLoadScheduler: Scheduler | undefined;\n\nexport function reload() {\n useStatisticsStore().current.reconnects++;\n setSessionId(useSessionStore().current.id)\n .then(() => {\n internalActions.switchBoard();\n void Promise.all([\n subscribeSession(),\n loadBoard(useBoardStore().currentBoard()).then(() => loadOtherBoards({ useForce: true })),\n ]);\n })\n .catch(() => document.location.reload());\n}\n\nexport function getServerInfo(useHttp?: boolean): Promise {\n return backendSess.getServerInfo(useHttp);\n}\n\nexport function getStatusWithData(\n sizeMB: number,\n useHttp?: boolean,\n): Promise {\n return backendSess.getStatusWithData(sizeMB, useHttp);\n}\n\n/**\n * Keep a reference to the session locally and in the window object\n * (so it can be accessed by this module if it's ever re-loaded in\n * the middle of a user's session -- see REN-13773)\n */\nexport function setAndStoreSession(session: BackendSession) {\n backendSess = session;\n window.piplanning_backendSess = session;\n}\n\n/**\n * If there's an existing backendSess in the window object, use it\n * (this should only be the case when a new version of Backend.ts is\n * loaded while the user is still in the middle of a session -- see\n * REN-13773)\n */\nexport function getExistingSession() {\n if (window.piplanning_backendSess) {\n backendSess = window.piplanning_backendSess;\n }\n}\n\nexport function initSession(session: BackendSession): Promise {\n setAndStoreSession(session);\n\n void loadCompanySettings();\n\n boardLoadScheduler = new Scheduler();\n void startServerTicks();\n setInterval(() => {\n if (backendSess) {\n useStatisticsStore().addNewEntry(backendSess.subscriptionCount());\n }\n }, 5000);\n void backendSess\n .getFlexBackgrounds()\n .then((backgrounds) => useFlexStore().setFlexBackgrounds(mapFlexBackgrounds(backgrounds)));\n // session_list.update returns also sessions we should not see -> use getSessions\n void backendSess.roomSubscribe(\"session_list.update\", loadSessions);\n return backendSess.getLicense().then((license) => {\n const valid = license.expiryDate - Date.now() / 1000;\n useLicenseStore().setLicense({\n validDays: Math.round(valid / (60 * 60 * 24)),\n plan: license.plan,\n tracking: license.tracking,\n type: license.type,\n onPrem: license.onprem,\n });\n if (!useLicenseStore().license.usable) {\n return Promise.resolve();\n }\n\n sender.backendSess = backendSess;\n return useSessionStore().sessions.length > 0 ? Promise.resolve() : loadSessions();\n });\n}\n\nasync function loadSessions() {\n const sessions = await backendSess.getSessions();\n const iterations = await Promise.all(\n sessions.map((session) => backendSess.getIterations(session.session_id)),\n );\n useSessionStore().setSessions(mapSessions(sessions, iterations));\n}\n\nexport function loggedIn(): boolean {\n return !!backendSess;\n}\n\nexport function closeSession(connectionOpen?: boolean) {\n boardLoadScheduler?.cancelAll();\n if (backendSess && connectionOpen) {\n backendSess.unsubscribe(\"room\", connectionOpen).catch((err) => void captureException(err));\n }\n (backendSess as unknown) = null;\n}\n\nexport function setSessionId(id: string): Promise {\n useNavigationStore().sessionSelected(id);\n return useLoadingStore().load(\"loading.setSession\", doSetSessionId(id));\n}\n\nfunction doSetSessionId(id: string): Promise {\n if (id.length !== 24) {\n void captureException(new Error(`Invalid session id ${id}`));\n }\n if (!boardLoadScheduler) {\n throw new Error(\"Session is not correctly initialized: Board Load Scheduler is undefined\");\n }\n boardLoadScheduler.cancelAll();\n backendSess.unsubscribe(\"session\");\n return backendSess\n .setSessionId(id)\n .then((isAlm) => {\n useSessionStore().userSync = \"unsyncedSession\";\n if (!isAlm) {\n useConnectionStore().alm = true;\n return Promise.resolve();\n }\n if (getAlmInfo().isUserMapped) {\n void backendSess.hasMappedAlmUser().then((mapped) => {\n useSessionStore().userSync = mapped ? \"synced\" : \"unsynced\";\n });\n }\n return backendSess.getAlmStatus().then((status) => {\n useConnectionStore().alm = status === \"running\";\n });\n })\n .then(() => Promise.all(loadSession()));\n}\n\nexport async function loadSessionAlmStatus() {\n if (isSessionAlmSynced()) {\n const status = await backendSess.getAlmStatus();\n useSessionStore().setSessionAlmStatus(status);\n }\n}\n\nexport async function loadCompanySettings() {\n try {\n const settings = await backendSess.getCompanySettings();\n const mapped = mapCompanySettings(settings);\n useCompanySettingsStore().setCompanySettings(mapped);\n } catch (err) {\n void captureException(err);\n }\n}\n\nfunction loadSession(): Array> {\n return [\n backendSess\n .getSettings()\n .then((settings) => useServerSettingsStore().$patch(mapSettings(settings))),\n Promise.all([backendSess.getArts(), backendSess.getTeams()]).then(([arts, teams]) => {\n useArtStore().setArts(mapArts(arts));\n useTeamStore().setTeams(mapTeams(teams));\n }),\n backendSess.getEvents().then((events) => setTimers(events)),\n ];\n}\n\nexport async function loadBoard(board: Board, recursive = false) {\n return useLoadingStore().load(\"loading.board\", doLoadBoard(board, recursive));\n}\n\nasync function doLoadBoard(board: Board, recursive = false): Promise {\n void addBreadcrumb(\"load\", {\n message: \"Loading board\",\n data: {\n id: board?.id,\n type: board?.type,\n team: board.type === \"team\" ? board.team.name : undefined,\n },\n });\n\n if (!board.id) {\n return Promise.reject(\n new DataError(\"Board with empty id\", {\n ...board,\n stickyTypes: [],\n cards: [],\n }),\n );\n }\n\n if (isFrontendBoard(board.type)) {\n return subscribeBoard(board);\n }\n\n const scale = await backendSess.getScale(board.id);\n if (!isBacklogBoard(board.type)) {\n board.cardSize = mapScale(scale);\n }\n\n await Promise.all([loadBoardObjectives(board), loadBoardIterations(board)]);\n\n board.loaded = await loadStickies(backendSess, board);\n\n if (!recursive) {\n await subscribeBoard(board);\n }\n}\n\nexport function loadOtherBoards({ useForce = false } = {}) {\n const boards = useBoardsStore().artBoardsToLoad(useForce);\n load(0);\n\n function load(index: number) {\n if (!boardLoadScheduler) {\n throw new Error(\"Session is not correctly initialized: Board Load Scheduler is undefined\");\n }\n if (index < boards.length) {\n boardLoadScheduler.schedule(\n () => loadBoard(boards[index], true).then(() => load(index + 1)),\n random(500, 1500),\n );\n } else {\n updateLinks(backendSess);\n }\n }\n}\n\nexport function getAlmInfo() {\n return almTypeInfo[backendSess.getAlmType() || \"\"];\n}\n\nexport function isSessionAlmSynced(): boolean {\n return !!backendSess?.getAlmType();\n}\n\nexport function getAlmConnectionId() {\n return backendSess.getAlmConnectionId();\n}\n\nexport interface SessionData {\n boards: IdMap;\n stickyTypes: StickyType[];\n linkTypes: LinkType[];\n links: Link[];\n almStickyTypes: IdMap;\n categories: Category[];\n flexTypes: FlexType[];\n}\n\nexport function loadSessionData(): Promise {\n const boards: IdMap = {};\n let stickyTypes: StickyType[];\n let linkTypes: LinkType[];\n let links: Link[];\n let almStickyTypes: IdMap;\n let categories: Category[];\n let flexTypes: FlexType[];\n\n function allBoards(func: (b: Board) => Promise): Promise {\n return Promise.all(Object.values(boards).map((board) => func(board)));\n }\n\n function teamBoards(func: (b: Board) => Promise): Promise {\n return Promise.all(\n Object.values(boards).map((board) => {\n if (board.type === \"team\") {\n return func(board);\n }\n }),\n );\n }\n\n return Promise.all([\n loadLinkTypes().then((types) => (linkTypes = mapLinkTypes(types))),\n loadLinks().then((serverLinks) => (links = mapLinks(serverLinks))),\n loadAlmStickyTypes().then((types) => (almStickyTypes = mapAlmStickyTypes(types))),\n loadCategories().then((cats) => (categories = cats)),\n loadStickyTypes().then((types) => {\n stickyTypes = types;\n return getFlexTypes().then((types) => {\n flexTypes = types;\n return loadBoards().then((serverBoards) => {\n serverBoards.forEach((serverBoard) => {\n boards[serverBoard.board_id] = mapBoard(\n serverBoard,\n flexTypes,\n backendSess.almSource.bind(backendSess),\n );\n });\n return Promise.all([loadAllBoardIterations(), loadAllBoardObjectives()]);\n });\n });\n }),\n ])\n .then(() => subscribeSession())\n .then(() => ({\n boards,\n stickyTypes,\n linkTypes,\n links,\n almStickyTypes,\n categories,\n flexTypes,\n }));\n\n function loadAllBoardIterations() {\n return useLoadingStore().load(\n \"loading.iterations\",\n teamBoards((board) => loadBoardIterations(board)),\n );\n }\n\n function loadAllBoardObjectives() {\n return useLoadingStore().load(\n \"loading.objectives\",\n allBoards((board) => loadBoardObjectives(board)),\n );\n }\n}\n\nfunction loadBoardIterations(board: Board): Promise {\n if (board.type !== \"team\") {\n return Promise.resolve();\n }\n return backendSess.getBoardIterations(board.id).then((boardIterations) => {\n board.iterations = mapBoardIterations(boardIterations, board.iterations);\n });\n}\n\nfunction loadBoardObjectives(board: Board): Promise {\n if (!hasBoardObjectives(board)) {\n return Promise.resolve();\n }\n return backendSess.getObjectives(board.id).then((rankedObjectives) => {\n board.objectives = rankedObjectives.objectives.map(mapObjective);\n board.stretchObjectives = rankedObjectives.stretches.map(mapObjective);\n });\n}\n\nfunction loadLinkTypes() {\n return useLoadingStore().load(\"loading.linkTypes\", backendSess.getLinkTypes());\n}\n\nfunction loadLinks() {\n return useLoadingStore().load(\"loading.links\", backendSess.getLinks());\n}\n\nfunction loadAlmStickyTypes() {\n return useLoadingStore().load(\"loading.almTypes\", backendSess.getAlmStickyTypes());\n}\n\nfunction loadStickyTypes() {\n return useLoadingStore().load(\"loading.stickyTypes\", getStickyTypes());\n}\n\nfunction loadBoards() {\n return useLoadingStore().load(\"loading.boards\", backendSess.getBoards());\n}\n\nfunction subscribeSession() {\n return Promise.all(sessionSubscriptions(backendSess));\n}\n\nexport function subscribeBoard(board: Board): Promise {\n return createBoardSubscriptions(backendSess, board);\n}\n\nexport function removeBoardSubscriptions() {\n return backendSess?.unsubscribe?.(\"board\");\n}\n\ntype AlmItemTypesCache = Map>;\n\nexport async function getStickyTypes(): Promise {\n const serverStickyTypes = await backendSess.getStickyTypes();\n const mappedServerStickyTypes = new Array();\n const almItemTypesCache: AlmItemTypesCache = new Map();\n while (serverStickyTypes.length) {\n const mappedStickyTypesChunk = await Promise.all(\n serverStickyTypes.splice(0, 10).map(async (serverStickyType) => {\n const loaded = useStickyTypeStore().findStickyType(serverStickyType.id);\n if (!isZombieType(loaded)) {\n return loaded;\n }\n if (serverStickyType.functionality === \"workitem\") {\n const almItemTypes = await getAlmItemTypes(\n serverStickyType.alm_type,\n serverStickyType.origin_board_type,\n almItemTypesCache,\n );\n useAlmItemTypeStore().almItemTypes[serverStickyType.id] = mapAlmItemTypes(almItemTypes);\n }\n return mapStickyType(serverStickyType);\n }),\n );\n mappedServerStickyTypes.push(...mappedStickyTypesChunk);\n }\n return mappedServerStickyTypes;\n}\n\nasync function getFlexTypes(sessionId?: string) {\n const types = await backendSess.getFlexTypes(sessionId);\n return mapFlexTypes(types);\n}\n\nasync function getAlmItemTypes(\n almType: string | null,\n boardType: BoardType,\n cache: AlmItemTypesCache,\n): Promise {\n const boardKeys = getBoardKeys(boardType);\n const safeAlmType = almType || \"\";\n\n const cacheKey = `${safeAlmType};${boardType};${boardKeys?.join(\"+\")}`;\n let almItemType = cache.get(cacheKey);\n if (!almItemType) {\n almItemType = backendSess.getAlmItemType(safeAlmType, boardType, boardKeys);\n cache.set(cacheKey, almItemType);\n }\n return await almItemType;\n}\n\nfunction getBoardKeys(boardType: BoardType): string[] {\n switch (boardType) {\n case \"backlog\":\n return useArtStore().arts.map((art) => art.id);\n case \"team\":\n return useTeamStore().teams.map((team) => team.id);\n }\n return [];\n}\n\nexport async function loadAlmItemTypeOfCard(almId: string) {\n const almItemType = await backendSess.getAlmItemTypeForSticky(almId);\n return mapAlmItemType(almItemType);\n}\n\nexport async function loadFlexBoards(sessionId?: string): Promise<{\n flexTypes: FlexType[];\n flexBoards: Array>;\n}> {\n const flexTypes = await getFlexTypes(sessionId);\n const boards = await backendSess.getBoards(sessionId);\n return {\n flexTypes,\n flexBoards: boards\n .filter((board) => board.board_type === \"flex\")\n .map((board) => mapFlexBoard(board, flexTypes)),\n };\n}\n\nexport function loadCategories(): Promise {\n return backendSess.getCategories().then(mapCategories);\n}\n\nexport function searchStickies(query: SearchStickiesQuery): Promise {\n return backendSess.searchStickies(query).then(mapSearchResults);\n}\n\nexport async function createTimer(data: TimerData, target: { boardId?: string; artId?: string }) {\n return await backendSess.createTimerEvent(data, target);\n}\n\nexport async function updateTimer(id: string, data: Partial) {\n await backendSess.updateTimerEvent(id, data);\n}\n\nexport function deleteEvent(id: string) {\n return backendSess.deleteEvent(id);\n}\n\nexport async function getBoardIdsOfGroupedStickies(stickyId: string) {\n return backendSess.getBoardIdsOfGroupedStickies(stickyId).then((ids) => ids.board_ids);\n}\n\nexport function getStickyChanges(id: string) {\n return backendSess.getStickyChanges(id).then(mapStickyChanges);\n}\n\nexport function duplicateFlex(boardId: string, sessionId: string) {\n return backendSess.duplicateFlex(boardId, sessionId);\n}\n\n/**\n * Returns the sum of changes made to the board's cards between the two dates.\n */\nexport function getBoardDiff(\n id: string,\n from: Date,\n to: Date,\n filters?: EventFilter[],\n changeTypes?: string[],\n) {\n return backendSess.getBoardDiff(id, from, to, filters, changeTypes).then(mapStickyChanges);\n}\n\n/**\n * Returns\n * changes: list of all changes made to the board's cards between the two dates\n * moreChanges: boolean indicating if there are more than 1 'page' of changes\n *\n * Currently, the backend only returns the latest 100 changes. To get other results, the\n * frontend must change the to/from dates, filters, or changeTypes.\n */\nexport function getBoardEventLog(\n id: string,\n from: Date,\n to: Date,\n filters?: EventFilter[],\n changeTypes?: string[],\n) {\n return backendSess.getBoardEventLog(id, from, to, filters, changeTypes).then((ret) => ({\n changes: mapStickyChanges(ret.results),\n moreChanges: ret.total > ret.limit,\n }));\n}\n\nexport async function hasMappedAlmUser(id: string) {\n return await backendSess.hasMappedAlmUser(id);\n}\n\nexport async function getArts(sessionId: string) {\n return backendSess.getArts(sessionId).then(mapArts);\n}\n\nexport async function getTeams(sessionId: string) {\n return backendSess.getTeams(sessionId).then(mapTeams);\n}\n\nwindow.addEventListener(\"offline\", () => {\n useConnectionStore().setOffline();\n});\n\nwindow.addEventListener(\"online\", () => {\n useConnectionStore().setOnline();\n});\n","import type { IdMap } from \"@/model/baseTypes\";\n\nimport type { Store } from \"./Store\";\n\nexport class SimpleCache {\n store?: Store>;\n timeout: number;\n data: IdMap<[number, T]> = {};\n loading: IdMap> = {};\n\n constructor(options: { store?: Store; timeout: number }) {\n this.store = options.store; //TODO check data on load\n this.timeout = options.timeout;\n this.data = this.load();\n }\n\n async loadItem(id: string, fetch: () => Promise, options: { lookup?: boolean } = {}) {\n if (options.lookup !== false) {\n const cached = this.data[id];\n if (cached && Date.now() - cached[0] < this.timeout) {\n return cached[1];\n }\n }\n if (id in this.loading) {\n return this.loading[id];\n }\n try {\n return await (this.loading[id] = fetch()).then((item) => this.add(id, item));\n } finally {\n delete this.loading[id];\n }\n }\n\n clear() {\n this.data = {};\n this.save();\n }\n\n add(id: string, item: T) {\n this.data[id] = [Date.now(), item];\n this.save();\n return item;\n }\n\n load() {\n return this.store?.load() ?? {};\n }\n\n save() {\n this.store?.save(this.data);\n }\n}\n","import { ApplicationError } from \"@/error/ApplicationError\";\n\nexport class BackendError extends ApplicationError {\n constructor(\n name: string,\n message: string,\n contexts: {\n request: Record;\n response: Record;\n },\n ) {\n super(name, message, contexts);\n }\n}\n","import { ApplicationError } from \"@/error/ApplicationError\";\n\nexport class NoSuccessError extends ApplicationError {\n constructor(\n message: string,\n endpoint: string,\n contexts: { request: Record; response: NoSuccessResponse },\n ) {\n super(`NoSuccessError: ${message}`, `Server call unsuccessful to ${endpoint}`, contexts);\n }\n\n get response(): NoSuccessResponse {\n return this.contexts.response as NoSuccessResponse;\n }\n}\n\ninterface NoSuccessResponse extends Record {\n message: string;\n code?: string;\n details?: unknown;\n}\n","import { defineStore } from \"pinia\";\nimport { v4 as uuid } from \"uuid\";\n\nexport const useClientStore = defineStore(\"client\", {\n state: () => {\n return {\n // eslint-disable-next-line no-bitwise\n clientId: Math.floor(Math.random() * (1 << 16) * (1 << 16)).toString(16),\n };\n },\n actions: {\n newCorrelationId() {\n return this.clientId + uuid().substring(this.clientId.length);\n },\n },\n});\n","import type {\n AxiosInstance,\n AxiosPromise,\n AxiosRequestConfig,\n AxiosRequestHeaders,\n AxiosRequestTransformer,\n AxiosResponse,\n} from \"axios\";\nimport axios, { AxiosError } from \"axios\";\nimport { isArray, isPlainObject } from \"lodash-es\";\n\nimport { BackendError } from \"@/backend/BackendError\";\nimport { NoSuccessError } from \"@/backend/NoSuccessError\";\nimport type { UserResponse } from \"@/backend/serverModel\";\nimport { CancelError } from \"@/error/CancelError\";\nimport { captureMessage } from \"@/error/sentry\";\nimport type { LogoutReason } from \"@/router/types\";\nimport { useClientStore } from \"@/store/client\";\nimport { useConnectionStore } from \"@/store/connection\";\nimport * as Environment from \"@/utils/env/Environment\";\nimport { isCloud, loginTimeout } from \"@/utils/env/Environment\";\n\nimport type { LoginRequest, LoginResponse } from \"./auth.service\";\n\nconst defaultRetries = 1;\n\nexport type ExtendedRequestConfig = AxiosRequestConfig & {\n sentAt: string;\n retry: number;\n maxRetries: number;\n isGoogleReachable?: boolean;\n};\nlet refreshing: Promise | null = null;\n\nexport function createApiClient(url: string, options?: Partial) {\n const client = axios.create({\n baseURL: url,\n withCredentials: true,\n timeout: 10000,\n transformRequest,\n ...options,\n });\n return enhanceRequestInterceptor(networkErrorInterceptor(authenticationInterceptor(client)));\n}\n\nexport function modernInterceptor(client: AxiosInstance, options: { defaultValue?: unknown } = {}) {\n client.interceptors.response.use((res) => {\n if (res.data.status !== \"success\") {\n const contexts = {\n request: requestData(res.config as ExtendedRequestConfig),\n response: responseData(res),\n };\n\n if (\"defaultValue\" in options) {\n void captureMessage(\"Unsuccessful request\", contexts);\n res.data = options.defaultValue;\n return res;\n }\n\n throw new NoSuccessError(\n res.data.error?.message || res.data.error?.code || \"unknown\",\n res.config.url || \"unknown\",\n contexts,\n );\n }\n res.data = res.data.data;\n return res;\n });\n return client;\n}\n\nfunction enhanceRequestInterceptor(client: AxiosInstance) {\n client.interceptors.request.use((request) => {\n return {\n ...request,\n sentAt: new Date().toISOString(),\n retry: (request as any).retry || 0,\n maxRetries: (request as any).maxRetries || defaultRetries,\n };\n });\n return client;\n}\n\nfunction networkErrorInterceptor(client: AxiosInstance) {\n client.interceptors.response.use(\n (response) => response,\n async (fail) => {\n if (isNetworkError(fail)) {\n if (!useConnectionStore().netOnline) {\n throw new CancelError(\"Network problem: Browser is offline\", fail);\n }\n let ok = true;\n if (fail.config.retry === 0 && isCloud) {\n // the browser thinks it's online, but we could not reach our server -> try to reach google.\n // if it works, the problem is on our server\n // if it does not work, the problem is on the client's network connection\n ok = fail.config.isGoogleReachable = await canLoadImage(\n \"https://www.google.com/favicon.ico\",\n 2000,\n );\n }\n if (ok && fail.config.retry < fail.config.maxRetries) {\n fail.config.retry++;\n // using client here would execute any response interceptors twice\n return rawClient.request(fail.config);\n }\n const contexts = {\n request: isPlainObject(fail.config) ? requestData(fail.config) : {},\n response: isPlainObject(fail.response) ? responseData(fail.response) : {},\n };\n throw new BackendError(\"Network problem\", fail.message, contexts);\n }\n throw fail;\n },\n );\n return client;\n}\n\nfunction authenticationInterceptor(client: AxiosInstance) {\n client.interceptors.response.use(\n (response) => response,\n async (fail) => {\n if (fail.response?.status === 401) {\n const data = fail.response.data;\n switch (data?.error?.code) {\n case \"UNAUTHENTICATED\":\n // This happens primarily when the user is yet logged in at all (e.g. initial of the app)\n return redirectToLogin();\n case \"TOKEN_EXPIRED\":\n // if we already are refreshing the token, don't refresh again,\n // but wait for the refresh to end before repeating the request\n if (!refreshing) {\n refreshing = refreshToken({\n correlationId: fail.config.headers[\"correlation-id\"],\n });\n }\n try {\n await refreshing;\n } catch (err) {\n // Token refresh failed; redirect user to login page\n redirectToLogin();\n } finally {\n refreshing = null;\n }\n return await rawClient.request(fail.config);\n }\n // If for some reason a 401 does not contain an error-code\n return redirectToLogin();\n }\n throw fail;\n },\n );\n return client;\n}\n\nfunction requestData(config: ExtendedRequestConfig) {\n return {\n baseUrl: config.baseURL,\n url: config.url,\n headers: config.headers,\n sentAt: config.sentAt,\n retry: config.retry,\n maxRetries: config.maxRetries,\n };\n}\n\nfunction responseData(res: AxiosResponse) {\n return {\n status: res.status,\n statusText: res.statusText,\n code: res.data.status,\n message: res.data.error?.code || \"unknown\",\n details: res.data.data,\n data: res.data,\n };\n}\n\n/**\n * Use a non axios way to check if the network connection works.\n * @param url\n * @param timeout\n */\nasync function canLoadImage(url: string, timeout: number) {\n try {\n return !!(await loadImage(url, timeout));\n } catch (e) {\n return false;\n }\n}\n\nfunction loadImage(url: string, timeout: number) {\n return new Promise((resolve, reject) => {\n window.setTimeout(reject, timeout);\n const img = new Image();\n img.onload = () => resolve(img);\n img.onerror = (e) => reject(e);\n const random = Math.floor((1 + Math.random()) * 0x10000).toString(16);\n // add a random query parameter to avoid caching\n img.src = `${url}?no-cache=${random}`;\n });\n}\n\nfunction redirectToLogin(): never {\n window.location.assign(\n `${Environment.authAPIUrl}/auth/login?type=app&path=${encodeURIComponent(location.hash || \"\")}`,\n );\n throw new CancelError(\"Unauthorized\");\n}\n\nfunction transformRequest(data: unknown, headers: AxiosRequestHeaders) {\n if (headers && !headers[\"correlation-id\"]) {\n headers[\"correlation-id\"] = useClientStore().newCorrelationId();\n }\n for (const transform of defaultTransformers()) {\n data = transform(data, headers);\n }\n return data;\n}\n\nfunction defaultTransformers(): AxiosRequestTransformer[] {\n const transformers = axios.defaults.transformRequest;\n if (isArray(transformers)) {\n return transformers;\n }\n if (transformers) {\n return [transformers];\n }\n return [];\n}\n\nconst rawClient = enhanceRequestInterceptor(\n networkErrorInterceptor(\n axios.create({\n baseURL: Environment.authAPIUrl,\n withCredentials: true,\n timeout: 10000,\n transformRequest,\n }),\n ),\n);\n\n// login and loginPage can never return TOKEN_EXPIRED\nexport async function login(params: LoginRequest): Promise> {\n return await rawClient.get(\"/auth/login\", { params, timeout: loginTimeout });\n}\n\nexport function loginPage(params: LoginRequest): AxiosPromise {\n return rawClient.get(\"/auth/loginPage\", { params });\n}\n\n// using createApiClient for refreshToken or logout could lead to endless loop\nexport async function refreshToken(config: {\n path?: string;\n correlationId?: string;\n}): Promise {\n const res = await rawClient.get(\n `auth/token/refresh?path=${encodeURIComponent(config.path || \"\")}`,\n { headers: { \"correlation-id\": config.correlationId || \"\" } },\n );\n return res.data;\n}\n\nexport function logout(reason: LogoutReason) {\n return rawClient.get(\"/auth/logout\", { params: { reason } });\n}\n\nexport async function isAuthenticated(): Promise {\n const res = await createApiClient(Environment.authAPIUrl).get(`auth/user`);\n return res.data;\n}\n\nfunction isNetworkError(err: AxiosError) {\n return err?.code === AxiosError.ECONNABORTED || err?.code === AxiosError.ERR_NETWORK;\n}\n","import { reactive } from \"vue\";\n\nimport { getAlmInfo } from \"@/backend/Backend\";\nimport { mapOrgEntities, mapUser, mapUserName } from \"@/backend/mapper/mapBackendData\";\nimport { CancelError } from \"@/error/CancelError\";\nimport { UnauthenticatedError } from \"@/error/UnauthenticatedError\";\nimport { handleError, isAxiosError } from \"@/error/errorHandler\";\nimport { captureException } from \"@/error/sentry\";\nimport { MINUTES } from \"@/model/Settings\";\nimport type { AlmMapping, AlmUser, AuthUser, TechnicalUser, UserOrgEntities } from \"@/model/user\";\nimport {\n almUser,\n backendUser,\n baseUser,\n emptyUserOrgEntities,\n isBackendUserId,\n} from \"@/model/user\";\nimport { LocalStore, versioned } from \"@/utils/LocalStore\";\nimport { SimpleCache } from \"@/utils/SimpleCache\";\nimport * as Environment from \"@/utils/env/Environment\";\n\nimport { createApiClient, modernInterceptor } from \"./api.config\";\n\nconst baseURL = \"/v1/users\";\n\nconst api = modernInterceptor(createApiClient(Environment.authAPIUrl));\n\nconst users = new SimpleCache({\n store: new LocalStore(\"users\", { sedes: versioned(1) }),\n timeout: 24 * 60 * MINUTES,\n});\n\ntype UserIdentifier = { id: string } | TechnicalUser;\n\nexport function loadReactiveUser(\n user: UserIdentifier & { name?: string },\n options: { almMapping?: AlmMapping; mapBackendToAlm?: boolean } = {},\n): AuthUser {\n const res = reactive(uninitedUser(user, \"loading\"));\n loadUser(user, options)\n .then((loaded) => {\n res.type = loaded.type || \"regular\";\n res.id = loaded.id;\n res.name = loaded.name;\n res.email = loaded.email;\n res.imageUrl = loaded.imageUrl;\n res.color = loaded.color;\n res.preferredLanguage = loaded.preferredLanguage;\n res.hash = loaded.hash;\n res.almMapping = options.almMapping;\n if (\"iconName\" in loaded) {\n (res as AlmUser).iconName = loaded.iconName;\n }\n })\n .catch(() => {\n res.type = \"unknown\";\n });\n return res;\n}\n\nexport async function loadUser(\n user: UserIdentifier,\n options?: { useCache?: boolean; mapBackendToAlm?: boolean },\n): Promise {\n if (isBackendUserId(user.id)) {\n return options?.mapBackendToAlm ? almUser(getAlmInfo()) : backendUser();\n }\n return await users.loadItem(user.id, () => getUser(user), {\n lookup: options?.useCache ?? true,\n });\n}\n\nexport function clearUserCache() {\n users.clear();\n}\n\nasync function getUser(user: UserIdentifier): Promise {\n try {\n const res = await api.get(`${baseURL}/${user.id}`);\n return mapUser(res.data);\n } catch (e) {\n handleUserError(e);\n }\n return uninitedUser(user, \"unknown\");\n}\n\nfunction handleUserError(e: unknown) {\n if (e instanceof CancelError || e instanceof UnauthenticatedError) {\n // CancelError: most likely refreshing the token failed\n // don't log as we are already redirected to log out\n // UnauthenticatedError: let the errorHandler do the correct thing\n throw e;\n }\n // 404 response is legitimate (user can be deleted), don't log\n if (isAxiosError(e) && e.response?.status === 404) {\n return;\n }\n handleError(e, \"Could not get user\");\n}\n\nfunction uninitedUser(\n user: { id: string } & Partial,\n type: \"unknown\" | \"loading\",\n): AuthUser {\n return {\n ...baseUser,\n ...user,\n type,\n name: mapUserName(user),\n };\n}\n\nexport async function getOrgEntities(userId: string): Promise {\n const endpoint = `${baseURL}/${userId}/org_entities`;\n try {\n const res = await api.get(endpoint);\n return mapOrgEntities(res.data);\n } catch (e) {\n void captureException(e, {\n info: {\n message: \"Could not fetch org entities of a user with id: \" + userId,\n },\n });\n return emptyUserOrgEntities;\n }\n}\n","import { defineStore } from \"pinia\";\n\nimport { setLanguage } from \"@/language\";\nimport type { Board } from \"@/model/board\";\nimport { isPlanningBoard } from \"@/model/board\";\nimport type { Tenant } from \"@/model/session\";\nimport type { AuthUser, Role } from \"@/model/user\";\nimport { baseUser, technicalUser } from \"@/model/user\";\nimport { loadUser } from \"@/services/user.service\";\nimport { i18n } from \"@/translations/i18n\";\n\nexport function noUser(color: string): AuthUser {\n return {\n ...baseUser,\n type: \"no\",\n id: \"no\",\n name: i18n.global.t(\"general.noAssignee\"),\n color,\n };\n}\n\nexport const useUserStore = defineStore(\"user\", {\n state: () => {\n return {\n loginData: { email: \"\", tenants: [] as Tenant[] },\n technicalUser: technicalUser(\"\", \"\", \"\"),\n currentUser: null as AuthUser | null,\n };\n },\n getters: {\n preferredLanguage(): string | undefined {\n return this.currentUser?.preferredLanguage;\n },\n isAllowed: (state) => (permission: Permission) =>\n permissions[state.technicalUser.role].includes(permission),\n isNonTeamZoomAllowed() {\n return (board: Board): boolean =>\n (!isPlanningBoard(board.type) && board.type !== \"risk\") || this.isAllowed(\"nonTeamZoom\");\n },\n isTraining: (state) => state.technicalUser.company.startsWith(\"pips-\"),\n },\n actions: {\n async loadCurrentUser() {\n this.currentUser = await loadUser({ id: this.technicalUser.id }, { useCache: false });\n if (this.preferredLanguage) {\n await setLanguage(this.preferredLanguage);\n }\n return this.currentUser;\n },\n resetUser() {\n this.technicalUser = technicalUser(\"\", \"\", \"\");\n },\n },\n});\n\ntype Permission =\n | \"edit\"\n | \"nonTeamZoom\"\n | \"deleteBoard\"\n | \"cockpit\"\n | \"useWithoutLicense\"\n | \"editBoard\"\n | \"duplicateFlex\";\n\nconst permissions: { [role in Role]: Permission[] } = {\n observer: [],\n user: [\"edit\"],\n admin: [\n \"edit\",\n \"nonTeamZoom\",\n \"deleteBoard\",\n \"cockpit\",\n \"useWithoutLicense\",\n \"editBoard\",\n \"duplicateFlex\",\n ],\n planning_interval_admin: [\n \"edit\",\n \"nonTeamZoom\",\n \"deleteBoard\",\n \"cockpit\",\n \"editBoard\",\n \"duplicateFlex\",\n ],\n};\n","import { defineStore } from \"pinia\";\n\nimport type { Team } from \"@/model/session\";\nimport { i18n } from \"@/translations/i18n\";\n\nimport { NO_ART, useArtStore } from \"./art\";\nimport { useUserStore } from \"./user\";\n\nexport const NO_TEAM = { id: \"\", name: \"\" };\n\ninterface State {\n teams: Team[];\n current: Team;\n}\n\nexport const useTeamStore = defineStore(\"team\", {\n state: (): State => ({ teams: [], current: NO_TEAM }),\n getters: {\n findTeam(state) {\n return (team: { id?: string; name?: string }) => {\n if (team.id) {\n return state.teams.find((t) => t.id === team.id);\n }\n if (team.name) {\n return state.teams.find((t) => t.name === team.name);\n }\n };\n },\n teamsInArt(state) {\n return (artId: string): Team[] => {\n // REN-9638 backward compatibility fix\n if (artId === \"\") {\n return state.teams;\n }\n return state.teams.filter((team) => team.artId === artId);\n };\n },\n teamsInCurrentArt(state): Team[] {\n const artId = useArtStore().current.id;\n return artId ? this.teamsInArt(artId) : state.teams;\n },\n noTeam: () => ({ id: NO_TEAM.id, name: i18n.global.t(\"general.noTeam\") }),\n },\n actions: {\n setTeams(teams: Team[]) {\n this.teams = teams;\n this.setCurrent(NO_TEAM);\n },\n setCurrent(team: Team) {\n this.current = team;\n useArtStore().setCurrent(useArtStore().artById(team.artId) || NO_ART);\n },\n },\n});\n\nexport function userTeamsFirst() {\n const userTeams = useUserStore().technicalUser.teams;\n return (t1: Team, t2: Team) => {\n const t1InUserTeams = userTeams.some((team) => team.id === t1.id);\n const t2InUserTeams = userTeams.some((team) => team.id === t2.id);\n\n if (t1InUserTeams && !t2InUserTeams) return -1;\n if (!t1InUserTeams && t2InUserTeams) return 1;\n\n return 0;\n };\n}\n","import type { SyncRouter } from \"./types\";\n\nlet router: SyncRouter;\n\nexport function setRouter(routerImpl: SyncRouter) {\n router = routerImpl;\n}\n\nexport function getRouter() {\n return router;\n}\n","import type { RouteLocationNamedRaw, Router } from \"vue-router\";\n\nimport type { BoardType } from \"@/model/baseTypes\";\nimport type { Team } from \"@/model/session\";\n\nexport const PARAM = {\n CURRENT_TEAM: \"_\",\n // the team the user last accessed\n LAST_TEAM: \"^\",\n // used when the app is initially loaded, without session/team/board params\n INITIAL: \"-\",\n // when there's no session at all\n NONE: \"?\",\n};\n\nexport const ANY_TEAM = \"*\";\n\nexport type SyncRouter = Router & {\n syncPush: (f: () => RouteLocationNamedRaw) => ReturnType;\n syncReplace: (f: () => RouteLocationNamedRaw) => ReturnType;\n};\n\nexport type AppParams = {\n [param in \"session\" | \"team\" | \"board\" | \"name\" | \"query\"]: string;\n};\n\nexport type LogoutReason =\n | \"jwt-revoked\"\n | \"refresh-failed\"\n | \"connection-refused\"\n | \"user-invoked\"\n | \"inactivity\"\n | \"unknown\";\n\nexport type BoardTarget =\n | BoardType\n | { type: \"flex\"; name?: string; session?: string }\n | {\n type: Exclude;\n team?: Team;\n artId?: string;\n session?: string;\n };\n\nconst queryProps = [\n \"zoom\",\n \"scrollX\",\n \"scrollY\",\n \"feature\",\n \"category\",\n \"stickyId\",\n \"searchText\",\n \"searchFlag\",\n \"searchAssignee\",\n \"searchTeam\",\n \"searchArt\",\n \"searchIteration\",\n \"searchType\",\n \"searchLink\",\n \"searchStatusClass\",\n \"searchPos\",\n \"searchDepLink\",\n] as const;\n\nexport type QueryImpl = Partial<{\n [key in (typeof queryProps)[number]]: string;\n}>;\n\nexport function toQueryImpl(query: Iterable<[string, string]>): QueryImpl {\n return Object.fromEntries([...query].filter(([key, _]) => queryProps.includes(key as any)));\n}\n\nexport interface Params {\n session?: string;\n team?: string;\n art?: string;\n board?: string;\n name?: string;\n}\n\nexport interface Query {\n zoom?: string;\n scrollX?: string;\n scrollY?: string;\n search?: SearchQuery;\n category?: string;\n stickyId?: string;\n modal?: string;\n}\n\nexport interface SearchQuery {\n text?: string;\n flag?: string;\n assignee?: string;\n team?: string;\n art?: string;\n iteration?: string;\n type?: string;\n depLink?: string;\n link?: string;\n statusClass?: string;\n pos?: string;\n}\n","import { isString, throttle } from \"lodash-es\";\nimport type {\n LocationQueryRaw,\n RouteLocationNamedRaw,\n RouteParamsRawGeneric,\n RouteRecordNameGeneric,\n} from \"vue-router\";\nimport { isNavigationFailure } from \"vue-router\";\n\nimport type { BoardType } from \"@/model/baseTypes\";\nimport { useNavigationStore } from \"@/store/navigation\";\nimport { useTeamStore } from \"@/store/team\";\nimport { useZoomStore } from \"@/store/zoom\";\n\nimport { getRouter } from \".\";\nimport type { BoardTarget, LogoutReason, Params, Query, QueryImpl } from \"./types\";\nimport { PARAM, toQueryImpl } from \"./types\";\n\nexport async function goToLogin() {\n return goTo({ name: \"login\" });\n}\n\nexport function goToLogout(reason: LogoutReason = \"unknown\") {\n return goTo({ name: \"logout\", query: { reason } });\n}\n\nexport function goToBoard(board: BoardTarget, query?: QueryImpl) {\n return goTo(mergeParams(boardParams(board), query));\n}\n\nfunction goTo(spec: { name?: RouteRecordNameGeneric; params?: Params; query?: LocationQueryRaw }) {\n return getRouter()\n .syncPush(() => ({\n name: spec?.name,\n params: spec?.params as RouteParamsRawGeneric,\n query: { feature: currentRoute().query?.feature, ...spec?.query },\n }))\n .catch(handleRouterFail);\n}\n\nexport async function replaceQuery(query: Query) {\n return getRouter()\n .syncReplace(() => {\n const current = currentRoute().query as QueryImpl;\n const newQuery: QueryImpl = {\n zoom: query.zoom || current.zoom,\n scrollX: query.scrollX || current.scrollX,\n scrollY: query.scrollY || current.scrollY,\n searchText:\n query.search?.text !== undefined\n ? query.search.text // keep empty search text to keep search dialog open\n : current.searchText,\n stickyId: \"stickyId\" in query ? query.stickyId : current.stickyId,\n searchFlag:\n query.search?.flag !== undefined ? query.search.flag || undefined : current.searchFlag,\n searchAssignee:\n query.search?.assignee !== undefined\n ? query.search.assignee || undefined\n : current.searchAssignee,\n searchTeam:\n query.search?.team !== undefined ? query.search.team || undefined : current.searchTeam,\n searchArt:\n query.search?.art !== undefined ? query.search.art || undefined : current.searchArt,\n searchIteration:\n query.search?.iteration !== undefined\n ? query.search.iteration || undefined\n : current.searchIteration,\n searchType:\n query.search?.type !== undefined ? query.search.type || undefined : current.searchType,\n searchDepLink:\n query.search?.depLink !== undefined\n ? query.search.depLink || undefined\n : current.searchDepLink,\n searchStatusClass:\n query.search?.statusClass !== undefined\n ? query.search.statusClass || undefined\n : current.searchStatusClass,\n searchLink:\n query.search?.link !== undefined ? query.search.link || undefined : current.searchLink,\n searchPos: query.search ? query.search.pos || undefined : current.searchPos,\n feature: current.feature,\n category: \"category\" in query ? query.category : current.category,\n };\n\n return {\n query: {\n ...current,\n ...(newQuery as Record),\n },\n };\n })\n .catch(handleRouterFail);\n}\n\nconst throttledReplaceQuery = throttle(() => {\n void replaceQuery({\n zoom: \"\" + useZoomStore().factor,\n scrollX: \"\" + Math.round(window.scrollX),\n scrollY: \"\" + Math.round(window.scrollY),\n });\n}, 100);\n\nexport function pushZoomState() {\n if (currentRoute()?.name === \"app\" && !useZoomStore().zooming) {\n throttledReplaceQuery();\n }\n}\n\nexport function boardUrl(\n session: string | undefined,\n board: BoardType,\n spec?: string,\n query?: string,\n) {\n const params = boardParams({\n type: board,\n team: board === \"team\" && spec ? { id: \"\", name: spec } : undefined,\n name: board === \"flex\" && spec ? spec : undefined,\n });\n if (!params.team) {\n params.team = PARAM.CURRENT_TEAM;\n }\n if (session) {\n params.session = session;\n }\n const queryImpl = query ? toQueryImpl(new URLSearchParams(query).entries()) : {};\n const router = getRouter();\n\n return router.resolve(mergeParams(params, queryImpl));\n}\n\nexport function fullUrl(query: QueryImpl) {\n const base = window.location.origin + window.location.pathname;\n const search = Object.entries(query)\n .map(([key, value]) => key + \"=\" + value)\n .join(\"&\");\n return base + \"#\" + currentRoute().path + \"?\" + search;\n}\n\nexport function currentRoute() {\n return getRouter()?.currentRoute?.value;\n}\n\nfunction handleRouterFail(fail?: unknown) {\n if (!isNavigationFailure(fail)) {\n return Promise.reject(fail);\n }\n}\n\nfunction mergeParams(params: Params, query?: QueryImpl): RouteLocationNamedRaw {\n return {\n params: {\n ...currentRoute().params,\n ...{ name: undefined },\n ...params,\n } as unknown as Record, // the typing of vue-router is wrong: params can be undefined to remove them from the route\n query: { ...currentRoute().query, zoom: \"1\", ...query },\n };\n}\n\nfunction boardParams(target: BoardTarget): Params {\n if (isString(target)) {\n return { board: target };\n }\n if (target.session) {\n return {\n board: target.type,\n team: PARAM.LAST_TEAM,\n session: target.session,\n };\n }\n if (target.type === \"flex\") {\n const name = target.name;\n return { board: \"flex\", ...(name && { name }) };\n }\n const team = target.team?.name || teamInArt(target.artId);\n return { board: target.type, ...(team && { team }) };\n\n function teamInArt(artId?: string) {\n if (artId) {\n const teamId = useNavigationStore().lastSelectedTeamInArtId(artId);\n const teams = useTeamStore().teams;\n const team =\n teams.find((team) => team.id === teamId) || teams.find((team) => team.artId === artId);\n return team?.name;\n }\n }\n}\n","import { defineStore } from \"pinia\";\n\nimport { addBreadcrumb, captureMessage } from \"@/error/sentry\";\nimport { MINUTES } from \"@/model/Settings\";\nimport type { Id } from \"@/model/baseTypes\";\nimport type { BoardData } from \"@/model/board\";\nimport { relativeCoord } from \"@/model/coordinates\";\nimport type { Iteration, Session, SessionAlmStatus } from \"@/model/session\";\nimport { goToLogout } from \"@/router/navigation\";\nimport { isAfter, isBefore, weekDaysBetween } from \"@/utils/date\";\n\ninterface IterationProgress {\n daysInIteration: number;\n daysPassedInIteration: number;\n iterationsPassed: number;\n}\n\nconst EMPTY_ITERATION = {\n id: 0,\n name: \"\",\n start: new Date(0),\n end: new Date(0),\n};\nexport const EMPTY_SESSION: Session = {\n id: \"\",\n name: \"\",\n creationDate: 0,\n planningStart: null,\n planningEnd: null,\n archived: false,\n iterations: [EMPTY_ITERATION, EMPTY_ITERATION],\n almStatus: \"running\",\n};\n\nconst EMPTY_BOARD_ITERATION = {\n load: 0,\n velocity: 0,\n state: { status: null, detail: null },\n};\n\nexport const EMPTY_BOARD: BoardData<\"team\"> = {\n id: \"0\",\n type: \"team\",\n team: { id: \"\", name: \"empty\" },\n cards: {},\n cardSize: { ...relativeCoord(0.1, 0.1), factor: 3 },\n maxZ: 0,\n loaded: 1,\n iterations: [EMPTY_BOARD_ITERATION, EMPTY_BOARD_ITERATION],\n almSources: [],\n selected: {},\n shapes: [],\n objectives: [],\n stretchObjectives: [],\n};\n\nexport const useSessionStore = defineStore(\"session\", {\n state: () => {\n return {\n isSessionLoading: false,\n sessions: new Array(),\n current: EMPTY_SESSION,\n userSync: \"unsyncedSession\" satisfies \"unsyncedSession\" | \"unsynced\" | \"synced\",\n };\n },\n getters: {\n iterations: (state) => state.current.iterations || [],\n uniqueSessionName: (state) => (session?: Session) => {\n if (!session) {\n session = state.current;\n }\n let index = 1;\n for (const ss of state.sessions) {\n if (ss.id === session.id) {\n break;\n }\n if (ss.name === session.name) {\n index++;\n }\n }\n return (index > 1 ? `_${index}_` : \"\") + session.name;\n },\n findByNameOrId: (state) => (query: string) =>\n state.sessions.find((session) => session.name === query || session.id === query),\n findByIndexedName: (state) => (sessionName: string) => {\n const indexed = /_(\\d+)_(.+)/.exec(sessionName || \"\");\n if (indexed) {\n return state.sessions.filter((session) => session.name === indexed[2])[+indexed[1] - 1];\n }\n },\n filterArchived: (state) => (archived: boolean) =>\n archived ? state.sessions : state.sessions.filter((session) => !session.archived),\n currentlyDifferentSession() {\n return (sessionName: string) =>\n !this.current ||\n (sessionName !== this.uniqueSessionName() && sessionName !== this.current.id);\n },\n iterationProgress:\n (state) =>\n (date: Date, iteration?: Iteration): IterationProgress => {\n const iters = state.current.iterations;\n if (isBefore(date, iters[0].start)) {\n return {\n daysInIteration: 0,\n daysPassedInIteration: 0,\n iterationsPassed: 0,\n };\n }\n if (!isBefore(date, iters[iters.length - 1].end)) {\n return {\n daysInIteration: 0,\n daysPassedInIteration: 0,\n iterationsPassed: iters.length,\n };\n }\n let i = iters.length - 1;\n while (i > 0 && isAfter(iters[i].start, date)) {\n i--;\n }\n\n if (!iteration) {\n iteration = iters[i];\n } else {\n if (iteration.id !== iters[i].id) {\n date = isBefore(date, iteration.start) ? iteration.start : iteration.end;\n }\n i = 0;\n }\n\n const daysInIteration = weekDaysBetween(iteration.start, iteration.end);\n const daysPassedInIteration = Math.min(\n daysInIteration,\n weekDaysBetween(iteration.start, date),\n );\n\n return {\n daysInIteration,\n daysPassedInIteration,\n iterationsPassed: i + daysPassedInIteration / daysInIteration,\n };\n },\n /**\n * Get the name for the given iteration, by id\n *\n * @param id iteration number (0-based index)\n * @returns iteration name\n */\n getIterationName:\n (state) =>\n (id?: number | null): string => {\n if (id === null || id === undefined) return \"\";\n return state.current.iterations.find((i) => i.id === id)?.name || \"\";\n },\n getIterationById:\n (state) =>\n (id?: number | null): Iteration | undefined => {\n if (id === null || id === undefined) return undefined;\n return state.current.iterations.find((i) => i.id === id) || undefined;\n },\n currentIteration: (state) => {\n const iterations = state.current.iterations;\n if (isBefore(new Date(), iterations[0].start)) {\n return iterations[0];\n }\n if (isAfter(new Date(), iterations[iterations.length - 1].end)) {\n return iterations[1];\n }\n return iterations.find(\n (iter) => isAfter(new Date(), iter.start) && isBefore(new Date(), iter.end),\n )!;\n },\n daysSinceStart: (state): number | null => {\n const iterations = state.current.iterations;\n if (!iterations?.length) {\n return null;\n }\n\n const start = iterations[0].start;\n const DAY_IN_MS = 24 * 60 * MINUTES;\n return Math.floor((new Date().getTime() - start.getTime()) / DAY_IN_MS);\n },\n sessionHasStarted(): boolean {\n return (this.daysSinceStart || -1) >= 0;\n },\n },\n actions: {\n setSessions(sessions: Session[]) {\n // if we are in a session, try to find it in the list\n // set current/selected if session is found or logout if not\n this.sessions = sessions;\n if (this.current.id) {\n const currentSession = sessions.find((session) => session.id === this.current.id);\n if (!currentSession) {\n void goToLogout();\n } else {\n this.current = currentSession;\n }\n }\n },\n setSessionAlmStatus(status: SessionAlmStatus) {\n this.current.almStatus = status;\n },\n setSession({ id: sessionId }: Id) {\n void addBreadcrumb(\"store\", {\n message: `Setting current and selected session to ${sessionId}`,\n data: { sessionId },\n });\n this.current = this.sessions.find((session) => session.id === sessionId) || EMPTY_SESSION;\n if (this.current.id === EMPTY_SESSION.id) {\n const sessionIds = this.sessions.map(({ id }) => id);\n void captureMessage(\"Could not find the Session ID in the list of active sessions\", {\n info: { sessionId, availableSessions: sessionIds },\n });\n }\n },\n },\n});\n","import { defineStore } from \"pinia\";\nimport { ref, watch } from \"vue\";\n\nimport type { BoardType } from \"@/model/baseTypes\";\nimport type { BoardData } from \"@/model/board\";\nimport type { FlexType } from \"@/model/flexboard\";\nimport type { Art, Session, Team } from \"@/model/session\";\nimport { LocalStore, versioned } from \"@/utils/LocalStore\";\n\nimport { useSessionStore } from \"./session\";\n\ntype State = { sessionId?: Session[\"id\"] } & Record;\n\ninterface SessionNavigation {\n boardType?: BoardType;\n artId?: string;\n teamInArt: Record;\n flexInType: Record[\"id\"]>;\n}\n\nexport const useNavigationStore = defineStore(\"navigation\", () => {\n const store = new LocalStore(\"navigation\", { sedes: versioned(1) });\n const state = ref(load());\n\n watch(state, () => store.save(state.value), { deep: true });\n\n function load() {\n const state = store.load() ?? {};\n // stored values may not have flexInType\n for (const session in state) {\n if (session !== \"sessionId\") {\n state[session].flexInType = state[session].flexInType ?? {};\n }\n }\n return state;\n }\n\n function lastSelectedSessionId() {\n return state.value.sessionId;\n }\n\n function lastSelectedBoard(sessionId?: Session[\"id\"]) {\n return sessionState(sessionId).boardType;\n }\n\n function lastSelectedArtId(sessionId?: Session[\"id\"]) {\n return sessionState(sessionId).artId;\n }\n\n function lastSelectedTeamInArtId(artId: string) {\n return sessionState().teamInArt[artId];\n }\n\n function lastSelectedTeamId(sessionId?: Session[\"id\"]) {\n const artId = lastSelectedArtId(sessionId);\n if (artId) {\n return sessionState(sessionId).teamInArt[artId];\n }\n }\n\n function lastSelectedFlexId(flexTypeId: string) {\n return sessionState().flexInType[flexTypeId];\n }\n\n function sessionSelected(sessionId: Session[\"id\"]) {\n state.value.sessionId = sessionId;\n }\n\n function boardSelected(board: BoardType) {\n sessionState().boardType = board;\n }\n\n function artSelected(art: Art) {\n sessionState().artId = art.id;\n }\n\n function teamSelected(team: Team) {\n sessionState().teamInArt[team.artId || \"\"] = team.id;\n }\n\n function flexSelected(flex: BoardData<\"flex\">) {\n sessionState().flexInType[flex.flexType.id] = flex.id;\n }\n\n function sessionState(id?: Session[\"id\"]) {\n const sessionId = id || useSessionStore().current.id;\n if (!(sessionId in state.value)) {\n state.value[sessionId] = { teamInArt: {}, flexInType: {} };\n }\n return state.value[sessionId];\n }\n\n return {\n lastSelectedSessionId,\n lastSelectedBoard,\n lastSelectedArtId,\n lastSelectedTeamInArtId,\n lastSelectedTeamId,\n lastSelectedFlexId,\n sessionSelected,\n boardSelected,\n artSelected,\n teamSelected,\n flexSelected,\n };\n});\n","import { defineStore } from \"pinia\";\n\nimport type { IdMap } from \"@/model/baseTypes\";\nimport type { BoardData } from \"@/model/board\";\nimport type { FlexBackground, FlexType } from \"@/model/flexboard\";\n\nimport { useBoardsStore } from \"./boards\";\nimport { useNavigationStore } from \"./navigation\";\n\nexport const useFlexStore = defineStore(\"flex\", {\n state: () => ({\n currentFlexBoard: null as BoardData<\"flex\"> | null,\n flexBackgrounds: {} as IdMap,\n flexTypes: [] as FlexType[],\n }),\n getters: {\n flexBoards: () =>\n Object.values(useBoardsStore().boards).filter((board) => board.type === \"flex\"),\n\n flexBoardByName() {\n return (name: string) => this.flexBoards.find((board) => board.name === name);\n },\n\n flexBoardById() {\n return (id: string) => this.flexBoards.find((board) => board.id === id);\n },\n\n flexBoardsByType() {\n return (type: string) => this.flexBoards.filter((board) => board.flexType.id === type);\n },\n\n infoLink(state) {\n return (flexType: FlexType) => state.flexBackgrounds[flexType.background]?.infoLink;\n },\n },\n actions: {\n setCurrentFlexBoard(flex: BoardData<\"flex\">) {\n useNavigationStore().flexSelected(flex);\n this.currentFlexBoard = flex;\n },\n setFlexBackgrounds(backgrounds: FlexBackground[]) {\n this.flexBackgrounds = Object.fromEntries(\n backgrounds.map((background) => [background.id, background]),\n );\n },\n setFlexModel(flexTypes: FlexType[], flexBoards: Array>) {\n this.flexTypes = flexTypes;\n useBoardsStore().updateBoards(\"flex\", flexBoards, (exist, board) => {\n exist.name = board.name;\n exist.flexType = board.flexType;\n });\n },\n },\n});\n","import { times } from \"@/math/coordinates\";\nimport { zoomFactor } from \"@/model/Settings\";\nimport type { BoardData } from \"@/model/board\";\nimport type { FlexType } from \"@/model/flexboard\";\nimport { generateId } from \"@/utils/general\";\n\nimport { useArtStore } from \"../art\";\n\nexport function objectivesBoard(): BoardData<\"objectives\"> {\n return {\n ...frontendBoard(objectivesBoardId()),\n type: \"objectives\",\n };\n}\n\nexport function flexBoard(id: string, name: string, flexType: FlexType): BoardData<\"flex\"> {\n return {\n ...frontendBoard(id),\n type: \"flex\",\n name,\n flexType,\n };\n}\n\nexport function emptyFlexBoard(): BoardData<\"flex\"> {\n return flexBoard(generateId(\"2\"), \"\", {\n id: \"\",\n name: \"\",\n background: \"BLANK\",\n });\n}\n\nfunction frontendBoard(id: string) {\n return {\n id,\n stickyTypes: [],\n almSources: [],\n cards: {},\n maxZ: 0,\n loaded: 1,\n cardSize: { factor: 3, ...times(zoomFactor, 3) },\n selected: {},\n shapes: [],\n };\n}\n\nexport function objectivesBoardId() {\n return generateId(\"1\", useArtStore().current.id);\n}\n","import { captureException } from \"@/error/sentry\";\nimport type { BoardType, IdMap } from \"@/model/baseTypes\";\nimport type { Board, BoardData } from \"@/model/board\";\n\nimport { useArtStore } from \"../art\";\nimport { useFlexStore } from \"../flex\";\nimport { useTeamStore } from \"../team\";\nimport { emptyFlexBoard } from \"./frontendBoard\";\n\nexport interface BoardByTypeOptions {\n teamId?: string;\n artId?: string;\n}\n\nexport function boardByType(\n boards: IdMap,\n type: T,\n options: BoardByTypeOptions = {},\n): BoardData {\n const board = boardByTypeOptional(boards, type, options);\n if (board) {\n return board;\n }\n\n void captureException(new Error(`board type '${type}' not found`), {\n data: {\n info: {\n type,\n teamId: options.teamId,\n artId: options.artId,\n boards: Object.values(boards).map(({ id, type }) => ({ id, type })),\n team: useTeamStore().current,\n art: useArtStore().current,\n },\n },\n });\n\n // NOTE: Loading of boards may take a few seconds, especially if the board is large.\n // It's okay to return an empty object here, as it will be reactively updated once the missing board is loaded.\n // TODO not sure this is true\n return {} as BoardData;\n}\n\nexport function boardByTypeOptional(\n boards: IdMap,\n type: T,\n { teamId, artId }: BoardByTypeOptions = {},\n): BoardData | undefined {\n const board = Object.values(boards).find((board) => {\n const isTypeMatch = board.type === type;\n const isTeamMatch = boardBelongsToTeam(board, teamId || useTeamStore().current.id);\n\n const isArtMatch = boardBelongsToArt(board, artId || useArtStore().current.id);\n const isFlexMatch = boardIsCurrentFlex(board, useFlexStore().currentFlexBoard);\n return isTypeMatch && isTeamMatch && isArtMatch && isFlexMatch;\n });\n\n if (board) {\n return board as BoardData;\n }\n\n if (type === \"flex\" && useFlexStore().currentFlexBoard === null) {\n // boards are so FlexBoard is still alive even when the user deletes the last flex board\n return emptyFlexBoard() as unknown as BoardData;\n }\n}\n\nfunction boardBelongsToTeam(board: Board, teamId?: string | null) {\n return board.type !== \"team\" || !teamId || board.team.id === teamId;\n}\n\nfunction boardBelongsToArt(board: Board, artId?: string) {\n return (\n [\"team\", \"flex\", \"objectives\"].includes(board.type) ||\n !board.artId ||\n !artId ||\n useArtStore().arts.length <= 1 ||\n board.artId === artId\n );\n}\n\nfunction boardIsCurrentFlex(board: Board, flexBoard: BoardData<\"flex\"> | null) {\n return board.type !== \"flex\" || !flexBoard || board.id === flexBoard.id;\n}\n","import type { Board } from \"@/model/board\";\nimport type { Card } from \"@/model/card\";\nimport { isDependency } from \"@/model/stickyType\";\n\nimport { useTeamStore } from \"../team\";\n\nexport function cardsMirrorableToNonFlexBoard(cards: Card[], board: Board) {\n if (![\"program\", \"solution\", \"risk\", \"team\"].includes(board.type)) {\n return false;\n }\n if (board.artId && board.artId !== useTeamStore().current.artId) {\n return false;\n }\n return (\n cardTypesMirrorableToBoard(cards, board) &&\n anyNonOriginCard(cards, board) &&\n cardsMatchingTeam(cards, board)\n );\n}\n\nfunction cardTypesMirrorableToBoard(cards: Card[], board: Board) {\n return cards.every((card) =>\n card.type.usable.some(\n (boardType) =>\n boardType === board.type &&\n (boardType !== \"program\" || card.teamId) &&\n (boardType !== \"solution\" || cardMirrorableToSolutionBoard(card)),\n ),\n );\n}\n\n// We can always mirror to the solution board if card has artId, otherwise card functionality should\n// be dependency and should depend on the team from another ART\nfunction cardMirrorableToSolutionBoard(card: Card): boolean {\n return !!card.artId || (isDependency(card) && card.precondTeam?.artId !== card.dependTeam?.artId);\n}\n\nfunction anyNonOriginCard(cards: Card[], board: Board) {\n return cards.some((card) => board.type !== card.type.origin);\n}\n\nfunction cardsMatchingTeam(cards: Card[], board: Board) {\n return (\n board.type !== \"team\" || cards.every((card) => !card.teamId || board.team.id === card.teamId)\n );\n}\n","import { defineStore } from \"pinia\";\n\nimport { captureMessage } from \"@/error/sentry\";\nimport { windowToRelative } from \"@/math/coordinate-systems\";\nimport { times } from \"@/math/coordinates\";\nimport { zoomFactor } from \"@/model/Settings\";\nimport type { BoardType, Id } from \"@/model/baseTypes\";\nimport { boardTitle } from \"@/model/baseTypes\";\nimport type { Board, BoardData, BoardId, IterationStatus } from \"@/model/board\";\nimport { isSolutionBoard } from \"@/model/board\";\nimport type { BoardCard, Card } from \"@/model/card\";\nimport type { RelativeCoordinate, WindowCoordinate } from \"@/model/coordinates\";\nimport type { FlexType } from \"@/model/flexboard\";\nimport type { Shape } from \"@/model/shape\";\nimport type { StickyType } from \"@/model/stickyType\";\nimport { translate } from \"@/translations/i18n\";\n\nimport { useArtStore } from \"./art\";\nimport { useBoardStore } from \"./board\";\nimport { animateCardMove } from \"./helpers/animator\";\nimport { type BoardByTypeOptions, boardByType, boardByTypeOptional } from \"./helpers/boardByType\";\nimport { flexBoard, objectivesBoard, objectivesBoardId } from \"./helpers/frontendBoard\";\nimport { cardsMirrorableToNonFlexBoard } from \"./helpers/mirror\";\nimport { useUserStore } from \"./user\";\n\ntype BoardMap = Record;\n\nexport const useBoardsStore = defineStore(\"boards\", {\n state: () => {\n return {\n boards: {} as BoardMap,\n loading: false,\n };\n },\n getters: {\n findIterations: (state) => {\n return (cardId: keyof Board[\"cards\"]) => {\n for (const board of Object.values(state.boards)) {\n if (board.cards[cardId] && \"iterations\" in board) {\n return board.iterations;\n }\n }\n };\n },\n boardById: (state) => {\n return (boardId: Board[\"id\"]): Board => {\n const board = state.boards[boardId];\n if (!board) {\n void captureMessage(\"Could not find board\", { info: { boardId } });\n return { id: boardId } as Board;\n }\n return board;\n };\n },\n boardByType: (state) => {\n return (type: T, options: BoardByTypeOptions = {}) =>\n boardByType(state.boards, type, options);\n },\n boardByTypeOptional: (state) => {\n return (type: T, options: BoardByTypeOptions = {}) =>\n boardByTypeOptional(state.boards, type, options);\n },\n stickyTypeOriginBoard() {\n return (type: StickyType, pos: WindowCoordinate) => {\n const teamId =\n useBoardStore().positionalCardProperties(windowToRelative(pos)).teamId ?? undefined;\n return this.boardByType(type.origin, { teamId });\n };\n },\n planningBoards() {\n return (artLevelOnly = false) => [\n this.boardByType(\"program\"),\n ...(!artLevelOnly && this.hasSolutionBoard ? [this.boardByType(\"solution\")] : []),\n ];\n },\n artBoardsToLoad() {\n return (force = false) =>\n [...this.currentArtBoards, ...this.solutionBoards]\n .filter((board) => {\n const wasLoaded = board.loaded && !force;\n return board !== useBoardStore().currentBoard() && !wasLoaded;\n })\n .sort((boardA, boardB) => order(boardA) - order(boardB));\n\n function order(board: Board) {\n const art = board.artId === useArtStore().current.id ? 0 : 5;\n const type = board.type === \"backlog\" ? 0 : board.type === \"team\" ? 1 : 2;\n return art + type;\n }\n },\n artTeamBoards: (state) => {\n const teamBoards = Object.values(state.boards).filter(\n (board): board is BoardData<\"team\"> => board.type === \"team\",\n );\n return () => {\n return teamBoards.filter((board) => useArtStore().isCurrentArt(board.team.artId));\n };\n },\n currentArtBoards: (state) =>\n Object.values(state.boards).filter(\n (board) => (board.artId || \"\") === (useArtStore().current.id || \"\"),\n ),\n solutionBoards: (state) =>\n Object.values(state.boards).filter((board) => isSolutionBoard(board.type)),\n boardsInited: (state) => Object.keys(state.boards).some((boardId) => !boardId.startsWith(\"$\")),\n backlogStickies(): BoardCard[] {\n return Object.values({\n ...this.boardByType(\"backlog\").cards,\n ...(this.hasSolutionBacklogBoard ? this.boardByType(\"solution_backlog\").cards : {}),\n });\n },\n hasSolutionBacklogBoard: (state) =>\n Object.values(state.boards).some((board) => board.type === \"solution_backlog\"),\n hasSolutionBoard: (state) =>\n Object.values(state.boards).some((board) => board.type === \"solution\"),\n mirrorTargetBoards: (state) => {\n return (cards: Card[]) =>\n Object.values(state.boards).filter(\n (board) => !isCurrentBoard(board) && cardsMirrorableToNonFlexBoard(cards, board),\n );\n },\n boardTitle() {\n return (id?: string) => {\n const board = id ? this.boardById(id) : useBoardStore().board;\n return board ? translate(boardTitle(board, useArtStore().artById(board.artId))) : \"\";\n };\n },\n },\n actions: {\n addBoards(boards: BoardMap) {\n this.boards = { ...this.boards, ...boards };\n },\n addBoard(board: BoardData): BoardData {\n this.boards = { ...this.boards, [board.id]: board };\n return board;\n },\n addFlexBoard(id: string, name: string, flexType: FlexType) {\n return this.addBoard<\"flex\">(flexBoard(id, name, flexType));\n },\n removeFlexBoard(id: string) {\n delete this.boards[id];\n },\n updateObjectiveBoardId() {\n Object.values(this.boards).forEach((board) => {\n if (board.type === \"objectives\") {\n board.id = objectivesBoardId();\n }\n });\n },\n resetBoards() {\n this.boards = { objectives: objectivesBoard() };\n },\n updateBoards(\n type: T,\n boards: Array>,\n update: (exist: BoardData, board: BoardData) => void,\n ) {\n const bs = this.boards;\n for (const id in bs) {\n if (bs[id].type === type && !boards.find((board) => board.id === bs[id].id)) {\n delete this.boards[id];\n }\n }\n boards.forEach((board) => {\n const found = this.boards[board.id] as BoardData;\n if (found) {\n update(found, board);\n } else {\n this.boards[board.id] = board;\n }\n });\n },\n setVelocity(e: { id: string; velocity: number; iteration: number }) {\n const board = this.boards[e.id] as BoardData<\"team\">;\n board.iterations[e.iteration] = {\n velocity: e.velocity,\n load: board.iterations[e.iteration].load,\n state: board.iterations[e.iteration].state,\n };\n },\n setCardSize(e: BoardId & { factor: number }) {\n if (\n !useUserStore().isAllowed(\"edit\") ||\n !useUserStore().isNonTeamZoomAllowed(useBoardStore().currentBoard())\n ) {\n return false;\n }\n\n if (!(e.boardId in this.boards)) {\n // Board is not present: it could be a flex board, which is not loaded\n // until it is visited for the first time. However, we could receive an\n // update from someone else on the board. Since the flex board content\n // will be loaded the first time we access it, it's safe to ignore the\n // event.\n return false;\n }\n\n this.boards[e.boardId].cardSize = {\n factor: e.factor,\n ...times(zoomFactor, e.factor),\n };\n\n return true;\n },\n setIterationStatus(e: {\n boardId?: string;\n id: number;\n status: IterationStatus;\n detail?: string;\n }) {\n const boardId = e.boardId || useBoardStore().currentBoard().id;\n const board = this.boards[boardId] as BoardData<\"team\">;\n const iter = board.iterations[e.id];\n if (iter) {\n iter.state.status = e.status;\n iter.state.detail = e.detail || null;\n if (e.status === \"success\") {\n setTimeout(() => this.setIterationStatus({ boardId, id: e.id, status: \"synced\" }), 5000);\n }\n }\n },\n cardToFront(e: Id & Partial) {\n const board = e.boardId ? this.boards[e.boardId] : useBoardStore().board;\n if (!board) {\n // Board is not present: it could be a flex board, which is not loaded\n // until it is visited for the first time. However, we could receive an\n // update from someone else on the board. Since the flex board content\n // will be loaded the first time we access it, it's safe to ignore the\n // event.\n return false;\n }\n const boardCard = board.cards[e.id];\n if (boardCard) {\n // card might just have been deleted\n boardCard.meta.zIndex = ++board.maxZ;\n return true;\n }\n },\n setCardPos(e: Id & BoardId & RelativeCoordinate, endFn?: () => void) {\n const boardCard = this.boards[e.boardId].cards[e.id];\n animateCardMove(\n boardCard,\n e,\n (pos) => {\n boardCard.meta.pos.x = pos.x;\n boardCard.meta.pos.y = pos.y;\n },\n endFn,\n );\n },\n addShape(boardId: string, shape: Shape) {\n const { shapes, index } = this.findShape(boardId, shape.id);\n if (index >= 0) {\n return shapes[index];\n }\n shapes.push(shape);\n return shape;\n },\n editShape(boardId: string, shape: Shape) {\n const { shapes, index } = this.findShape(boardId, shape.id);\n if (index >= 0) {\n shapes[index] = shape;\n }\n },\n removeShape(boardId: string, id: string) {\n const { shapes, index } = this.findShape(boardId, id);\n if (index >= 0) {\n shapes.splice(index, 1);\n }\n },\n findShape(boardId: string, id: string) {\n const shapes = this.boards[boardId]?.shapes;\n return { shapes, index: shapes.findIndex((s) => s.id === id) };\n },\n },\n});\n\nfunction isCurrentBoard(board: Board) {\n return board.id === useBoardStore().board?.id;\n}\n","\n\n\n\n\n","import { type InfoLevel, infoLevelInfo } from \"@/model/baseTypes\";\nimport { useServerSettingsStore } from \"@/store/serverSettings\";\n\n/**\n * Returns the state of the load based on the load and capacity.\n */\nexport function loadState(load: number, capacity: number): InfoLevel {\n if (!load || !capacity) {\n return \"default\";\n }\n const ratio = (100 * load) / capacity;\n\n const error = useServerSettingsStore().iterationLoadCritical ?? 100;\n if (ratio > error) {\n return \"error\";\n }\n\n const warn = useServerSettingsStore().iterationLoadWarn;\n if (warn && ratio > warn) {\n return \"warn\";\n }\n\n return \"ok\";\n}\n\n/**\n * For the load/capacity charts.\n * Returns the load color (CSS color) based on the load and capacity.\n * When there is load, but capacity is 0, return the error color\n */\nexport function loadColor(load: number, capacity: number): string {\n if (!capacity && load > 0) {\n return infoLevelInfo[\"error\"].color;\n }\n\n return infoLevelInfo[loadState(load, capacity)].color;\n}\n","\n\n\n\n\n","\n\n\n\n\n","import type { PieData } from \"@/components/PieChart/PieChart.vue\";\nimport type { Color } from \"@/model/baseTypes\";\nimport type { Board, BoardIteration } from \"@/model/board\";\nimport { useSessionStore } from \"@/store/session\";\n\nimport type { LoadCapacityItem } from \"./MetricsModalLoadCapacityBody.vue\";\n\nexport interface CapacityAllocation {\n total: number;\n values: PieData[];\n}\n\nexport function calcCapacityAllocation(boards: Board[], iteration?: number): CapacityAllocation {\n const loads: Record = {};\n let total = 0;\n for (const board of boards) {\n for (const id in board.cards) {\n const card = board.cards[id].data;\n if (iteration === undefined || card.iterationId === iteration) {\n const type = card.type;\n if (!loads[type.name]) {\n loads[type.name] = { value: 0, color: type.color };\n }\n const value = card.points;\n loads[type.name].value += value;\n total += value;\n }\n }\n }\n const data = [];\n for (const id in loads) {\n data.push({ name: id, value: loads[id].value, color: loads[id].color });\n }\n data.sort((a, b) => b.value - a.value);\n return { total, values: data };\n}\n\nexport function toLoadCapacityItem(teamIterations: BoardIteration[]): LoadCapacityItem[] {\n return teamIterations.map((teamIteration, i) => {\n return {\n load: teamIteration.load,\n capacity: teamIteration.velocity,\n title: useSessionStore().iterations[i].name,\n id: useSessionStore().iterations[i].id,\n };\n });\n}\n","\n\n\n\n\n","import type { Line, RelativeCoordinate } from \"./coordinates\";\n\nexport type LabelAlign = \"start\" | \"center\" | \"end\";\n\nexport interface Shape extends Line {\n id: string;\n type: ShapeType;\n fixed: boolean;\n label?: {\n text: string;\n align: LabelAlign;\n };\n}\n\nexport type ShapeType = \"line\";\n\nexport function fixLine(id: string, p0: RelativeCoordinate, p1: RelativeCoordinate): Shape {\n return { id, type: \"line\", p0, p1, fixed: true };\n}\n","import { rectangle } from \"@/math/coordinates\";\nimport type { Board } from \"@/model/board\";\nimport type { BoardCard } from \"@/model/card\";\nimport type { Rectangle, RelativeCoordinate } from \"@/model/coordinates\";\nimport { relativeCoord } from \"@/model/coordinates\";\nimport type { Shape } from \"@/model/shape\";\nimport { fixLine } from \"@/model/shape\";\n\nexport const borderLines = [\n fixLine(\"bv1\", relativeCoord(0, 0), relativeCoord(0, 1)),\n fixLine(\"bv2\", relativeCoord(1, 0), relativeCoord(1, 1)),\n fixLine(\"bh1\", relativeCoord(0, 0), relativeCoord(1, 0)),\n fixLine(\"bh2\", relativeCoord(0, 1), relativeCoord(1, 1)),\n];\n\nexport interface BoardLocation {\n name: string;\n bounds: Rectangle;\n shapes: Shape[];\n\n matches(coord: RelativeCoordinate): boolean;\n\n index(): number[];\n}\n\nexport const fullBoardLocation: BoardLocation = {\n name: \"\",\n bounds: rectangle({ from: relativeCoord(0, 0), to: relativeCoord(1, 1) }),\n shapes: [...borderLines],\n matches() {\n return true;\n },\n index() {\n return [];\n },\n};\n\nexport function cardsInLocation(board: Board, loc: BoardLocation): BoardCard[] {\n const cards = new Array();\n for (const id in board.cards) {\n if (loc.matches(board.cards[id].meta.pos)) {\n cards.push(board.cards[id]);\n }\n }\n return cards;\n}\n","import type { InjectionKey, Ref } from \"vue\";\n\nimport type { Board } from \"@/model/board\";\nimport type { BoardCoordinate } from \"@/model/coordinates\";\n\nexport const boardKey: InjectionKey>> = Symbol(\"board\");\nexport const boardMetaKey: InjectionKey> = Symbol(\"boardMeta\");\n\n// provided from the FluidBoard down to each child\nexport interface BoardMeta {\n size: BoardCoordinate;\n}\n","import type { InjectionKey } from \"vue\";\n\nimport type { Card } from \"@/model/card\";\nimport type { RelativeCoordinate } from \"@/model/coordinates\";\n\nexport const cardKey: InjectionKey = Symbol(\"card\");\nexport const cardMetaKey: InjectionKey> = Symbol(\"cardMeta\");\nexport const cardMethodsKey: InjectionKey = Symbol(\"cardMethods\");\n\ntype Animation = \"mirroring\" | \"deleting\" | \"moving\" | \"zooming\";\n\nexport interface CardMethods {\n animate?: (animation: Animation) => Promise;\n}\n\n// provided from the StickyNote down to each child\nexport type CardMetaInjected = Readonly<{\n rootEl: HTMLDivElement | undefined;\n pos: RelativeCoordinate;\n isLinkingTarget: boolean;\n isSelected: boolean;\n isEnlarged: boolean;\n pin: (event?: Event) => void;\n unpin: (event?: Event) => void;\n isPinned: boolean;\n isPinningDisabled: boolean;\n levelOfDetails: 0 | 1 | 2;\n isReadonly: boolean;\n wasActivatedByKeyboard?: boolean;\n}>;\n","import { defineStore } from \"pinia\";\n\nimport type { ExecutionMode } from \"@/model/action\";\nimport type { IdMap } from \"@/model/baseTypes\";\n\nimport { useBoardStore } from \"./board\";\nimport { useBoardsStore } from \"./boards\";\nimport { useCardStore } from \"./card\";\n\nexport interface SelectionAction {\n name: string;\n execute: (mode: ExecutionMode, state: T) => void | Promise;\n saveState: () => T;\n resetToState: (state: T) => void | Promise;\n}\n\nexport interface HistoryEntry {\n stateBeforeAction: T;\n action: SelectionAction;\n}\n\nexport const useSelectionStore = defineStore(\"selection\", {\n state: () => {\n return {\n selecting: \"no\" satisfies \"no\" | \"hover\" | \"click\" | \"rect\",\n singleCard: false,\n historyPerBoard: {} as IdMap>>,\n };\n },\n getters: {\n history: (state) => {\n const boardId = useBoardStore().currentBoard().id;\n if (!(boardId in state.historyPerBoard)) {\n state.historyPerBoard[boardId] = [];\n }\n return state.historyPerBoard[boardId];\n },\n lastHistoryEntry(): HistoryEntry | undefined {\n return this.history[this.history.length - 1];\n },\n mirrorTargets() {\n const cards = useBoardStore().selectedStickyIds.map((id) => useCardStore().cards[id]);\n return useBoardsStore().mirrorTargetBoards(cards);\n },\n isSelectingWithRect: (state) => state.selecting === \"rect\",\n },\n actions: {\n async undo() {\n if (this.history.length === 0) {\n return Promise.resolve();\n }\n const [historyEntry] = this.history.splice(-1);\n return historyEntry.action.resetToState(historyEntry.stateBeforeAction) || Promise.resolve();\n },\n async execute(mode: ExecutionMode, action: SelectionAction) {\n if (mode === \"undo\") {\n return this.undo();\n }\n if (mode !== \"confirm\") {\n this.history.push({ stateBeforeAction: action.saveState(), action });\n }\n return action.execute(mode, this.lastHistoryEntry!.stateBeforeAction) || Promise.resolve();\n },\n },\n});\n","import { defineStore } from \"pinia\";\n\nimport { useSelectionStore } from \"./selection\";\n\nexport const usePanModeStore = defineStore(\"panMode\", {\n state: () => ({\n active: false,\n }),\n actions: {\n toggleActive() {\n this.active ? this.inactivate() : this.activate();\n },\n activate() {\n if (!useSelectionStore().isSelectingWithRect) {\n useSelectionStore().selecting = \"click\";\n this.active = true;\n return true;\n }\n return false;\n },\n inactivate() {\n useSelectionStore().selecting = \"no\";\n this.active = false;\n },\n },\n});\n","import type { MutableProperties } from \"@/utils/type\";\n\ntype StyleObject = { [key in MutableProperties]?: string };\n\nfunction removeNodesWithAttribute(element: HTMLElement, attributeName: string): void {\n element.querySelectorAll(`[${attributeName}]`).forEach((node) => node.remove());\n}\n\nfunction applyTransitionStyles(element: HTMLElement, styles: StyleObject, duration: string): void {\n element.style.transition = Object.keys(styles)\n .map((prop) => `${prop} ${duration}`)\n .join(\", \");\n\n Object.entries(styles).forEach(([property, value]) => {\n if (property === \"transform\" && element.style.transform) {\n element.style.transform = `${element.style.transform} ${value}`.trim();\n } else {\n element.style[property as keyof StyleObject] = value as any;\n }\n });\n}\n\nfunction animateElement(el: HTMLElement, styles: StyleObject, duration: string): Promise {\n return new Promise((resolve) => {\n removeNodesWithAttribute(el, \"data-no-animate\");\n\n requestAnimationFrame(() => {\n applyTransitionStyles(el, styles, duration);\n\n el.addEventListener(\"transitionend\", () => resolve(), { once: true });\n el.addEventListener(\"transitioncancel\", () => resolve(), { once: true });\n });\n });\n}\n\nexport async function move(el?: HTMLElement) {\n if (!el) return;\n const styles = { transform: \"translateX(100px)\", opacity: \"0\" };\n await animateElement(el, styles, \"1s\");\n}\n\nexport async function mirror(el?: HTMLElement) {\n if (!el) return;\n const elCopy = el.cloneNode(true) as HTMLElement;\n el.insertAdjacentElement(\"afterend\", elCopy);\n\n const styles = { transform: \"translateX(100px)\", opacity: \"0\" };\n await animateElement(elCopy, styles, \"1s\");\n elCopy.remove();\n}\n\nexport async function remove(el?: HTMLElement) {\n if (!el) return;\n await animateElement(el, { opacity: \"0\" }, \".5s\");\n}\n","import { defineStore } from \"pinia\";\nimport { computed } from \"vue\";\n\nimport type { Card } from \"@/model/card\";\nimport type { ChangeTypeItem } from \"@/model/change\";\nimport { serverStickyActivityKeys } from \"@/model/change\";\nimport type { Iteration } from \"@/model/session\";\nimport type { StickyType } from \"@/model/stickyType\";\nimport { boardHistoryFilterChanged, boardHistoryTabChanged } from \"@/utils/analytics/events\";\nimport { trackEvent } from \"@/utils/analytics/track\";\nimport { endOfDay, lastWeekDay, plusDays, startOfDay, startOfWeek } from \"@/utils/date\";\nimport { isFeatureEnabled, parseUrlWithoutRouter } from \"@/utils/env/feature\";\nimport { toKebabCase } from \"@/utils/text/text\";\n\nimport { useBoardStore } from \"./board\";\nimport { useCardStore } from \"./card\";\nimport { useSessionStore } from \"./session\";\n\nexport interface DateItem {\n id: string;\n fromDate: Date;\n toDate: Date;\n}\n\nexport interface DateFilter {\n id: \"now\" | \"workday\" | \"iteration\" | \"pi\" | \"planning_start\" | \"week\" | \"24_hours\" | \"custom\";\n name: string;\n fromDate: () => Date;\n toDate: () => Date;\n show: () => boolean;\n}\n\nexport interface EventFilter {\n property: string;\n values: any[];\n}\n\nexport type BoardHistoryTab = \"log\" | \"compare\";\n\nconst dateFilterValues: DateFilter[] = [\n {\n id: \"24_hours\",\n name: /*$t*/ \"boardDiff.last24Hours\",\n fromDate: () => plusDays(new Date(), -1),\n toDate: () => new Date(),\n show: () => true,\n },\n {\n id: \"workday\",\n name: /*$t*/ \"boardDiff.lastWorkday\",\n fromDate: () => startOfDay(lastWeekDay(new Date())),\n toDate: () => new Date(),\n show: () => true,\n },\n {\n id: \"week\",\n name: /*$t*/ \"boardDiff.thisWeek\",\n fromDate: () => startOfDay(startOfWeek(new Date())),\n toDate: () => new Date(),\n show: () => ![1, 2].includes(new Date().getDay()), // the filter isn't useful on monday/tuesday\n },\n {\n id: \"iteration\",\n name: /*$t*/ \"boardDiff.thisIteration\",\n fromDate: () => useSessionStore().currentIteration.start,\n toDate: () => new Date(),\n show: () => useSessionStore().sessionHasStarted, // show during the PI\n },\n {\n id: \"pi\",\n name: /*$t*/ \"boardDiff.thisPI\",\n fromDate: () => useSessionStore().iterations[0].start,\n toDate: () => new Date(),\n show: () => useSessionStore().sessionHasStarted, // show during the PI\n },\n {\n id: \"planning_start\",\n name: /*$t*/ \"boardDiff.planningDates\",\n fromDate: () => startOfDay(useSessionStore().current.planningStart as Date),\n toDate: () => endOfDay(useSessionStore().current.planningEnd as Date),\n show: () =>\n !useSessionStore().sessionHasStarted && // show during planning, if dates provided\n !!useSessionStore().current.planningStart &&\n !!useSessionStore().current.planningEnd,\n },\n];\n\nconst defaultDate: DateItem = {\n id: dateFilterValues[0].id,\n fromDate: dateFilterValues[0].fromDate(),\n toDate: dateFilterValues[0].toDate(),\n};\n\nconst isLogEnabled = computed(() =>\n isFeatureEnabled({ query: parseUrlWithoutRouter() }, \"board-log\"),\n);\n\ninterface State {\n card: Card | null;\n board: boolean;\n tab: BoardHistoryTab;\n selectedIterationIds: Set;\n selectedStickyTypeIds: Set;\n selectedDate: DateItem;\n selectedChangeTypes: ChangeTypeItem[];\n}\n\nexport const useActivityStore = defineStore(\"activity\", {\n state: (): State => ({\n card: null as Card | null,\n board: false,\n tab: isLogEnabled.value ? \"log\" : \"compare\",\n selectedIterationIds: new Set(),\n selectedStickyTypeIds: new Set(),\n selectedDate: defaultDate,\n selectedChangeTypes: [],\n }),\n getters: {\n // Active State\n active: (state) => !!state.card || !!state.board,\n isBoardActivityOpen: (state) => state.board,\n isCardActivityOpen: (state) => !!state.card,\n // Filters\n anyFilterCriteria: (state): boolean =>\n state.selectedStickyTypeIds.size !== 0 || state.selectedIterationIds.size !== 0,\n allFilters(state) {\n // Fetch the server-version of change types, and add the unlink/unmirror\n // types if the reciprocal is already in the list\n // (for the user, this means that selecting 'link' changes will also show unlink changes)\n const changeTypes = state.selectedChangeTypes.map((t) => serverStickyActivityKeys[t.id]);\n if (changeTypes.includes(\"link\")) {\n changeTypes.push(\"unlink\");\n }\n if (changeTypes.includes(\"mirror\")) {\n changeTypes.push(\"unmirror\");\n }\n\n return {\n board: state.board,\n date: state.selectedDate,\n iterations: [...state.selectedIterationIds],\n types: [...state.selectedStickyTypeIds],\n changeTypes,\n };\n },\n serverFilters: (state): EventFilter[] => {\n const filters = [];\n if (state.selectedIterationIds.size) {\n filters.push({\n property: \"iteration_number\",\n values: [...state.selectedIterationIds],\n });\n }\n if (state.selectedStickyTypeIds.size) {\n filters.push({\n property: \"type_id\",\n values: [...state.selectedStickyTypeIds],\n });\n }\n\n return filters;\n },\n // Date Filter\n dateFilterOptions: (): DateFilter[] => dateFilterValues.filter((i) => i.show()),\n // Iterations\n allIterations: (): Iteration[] => useSessionStore().iterations,\n selectedIterations(state): Iteration[] {\n return this.allIterations.filter((iteration) => state.selectedIterationIds.has(iteration.id));\n },\n // Sticky Types\n selectedStickyTypes: (state): StickyType[] =>\n useBoardStore().possibleStickyTypes.filter((type) =>\n state.selectedStickyTypeIds.has(type.id),\n ),\n },\n actions: {\n // Active State\n toggleCard(id: string) {\n if (this.card?.id === id) return this.inactivate();\n\n this.card = useCardStore().cards[id];\n this.board = false;\n },\n toggleBoard() {\n if (this.board) return this.inactivate();\n\n this.board = true;\n this.card = null;\n },\n inactivate() {\n this.card = null;\n this.board = false;\n this.resetFilters();\n this.resetTab();\n },\n toggleTab() {\n if (!isLogEnabled.value) return;\n\n this.tab = this.tab === \"log\" ? \"compare\" : \"log\";\n trackEvent(boardHistoryTabChanged(this.tab));\n },\n resetTab() {\n this.tab = isLogEnabled.value ? \"log\" : \"compare\";\n },\n // Filters\n resetFilters() {\n this.selectedIterationIds = new Set();\n this.selectedStickyTypeIds = new Set();\n this.selectedDate = defaultDate;\n this.selectedChangeTypes = [];\n },\n selectIterations(iterations: Iteration[]) {\n this.selectedIterationIds = new Set(iterations.map((i) => i.id));\n trackEvent(\n boardHistoryFilterChanged({\n filterName: \"iteration\",\n selectedValues: iterations.map((i) => i.id.toString()),\n tab: this.tab,\n }),\n );\n },\n selectStickyTypes(stickyTypes: StickyType[]) {\n this.selectedStickyTypeIds = new Set(stickyTypes.map((t) => t.id));\n trackEvent(\n boardHistoryFilterChanged({\n filterName: \"sticky-type\",\n selectedValues: stickyTypes.map((i) => i.id),\n tab: this.tab,\n }),\n );\n },\n selectChangeTypes(changeTypes: ChangeTypeItem[]) {\n this.selectedChangeTypes = changeTypes;\n trackEvent(\n boardHistoryFilterChanged({\n filterName: \"change-type\",\n selectedValues: changeTypes.map((i) => toKebabCase(i.id)),\n tab: this.tab,\n }),\n );\n },\n },\n});\n","import type { InjectionKey } from \"vue\";\n\ninterface MenuListConfig {\n selectable?: boolean;\n multiselect?: boolean;\n}\n\nexport const MenuListConfigKey: InjectionKey = Symbol();\n","\n\n\n\n\n","\n\n\n\n\n","import type { Directive } from \"vue\";\nimport { nextTick } from \"vue\";\n\n// Small shared state to let other components know if autofocus is pending\nexport const autofocusStatus: { pending: boolean } = { pending: false };\n\n/**\n * Autofocuses to the element on mount and sets tabindex=0\n * To autofocus later/conditionally, pass a value of false\n *\n * @param value if false, autofocus will not initialize (note: with any other value, including undefined, it will initialize)\n */\nexport function autofocus(): Directive {\n /**\n * Focus on the element and give it a tabindex if necessary\n */\n const initAutofocus = (el: HTMLElement) => {\n autofocusStatus.pending = true;\n void nextTick(() => {\n if (el.nodeName === \"LABEL\") {\n el.click();\n } else {\n el.tabIndex = el.tabIndex ?? 0;\n el.focus();\n }\n autofocusStatus.pending = false;\n });\n };\n\n return {\n mounted(el, { value }) {\n if (value === false) {\n return;\n }\n\n initAutofocus(el);\n },\n\n updated(el, { value, oldValue }) {\n if (oldValue === false && value !== false) {\n initAutofocus(el);\n }\n },\n };\n}\n","import { clamp } from \"lodash-es\";\nimport { v4 as uuid } from \"uuid\";\nimport type { Directive } from \"vue\";\nimport { nextTick } from \"vue\";\n\nimport { isElementInViewport, terminateEvent } from \"@/utils/dom/dom\";\n\nimport { autofocusStatus } from \"./autofocus\";\n\n/**\n * Enable keyboard navigation through a list of '.list-item's\n * using the up- / down-arrow keys\n *\n * Modifiers:\n * select: Automatically selects the next/previous item on key press\n * no-wrap: Keyboard navigation will not wrap around the end of the list\n * soft-focus: Only focus on the current item if the focus is already on the list\n * (if true, soft-focus-initial is effectively true as well)\n * soft-focus-initial: When the list initializes, don't pull focus to the first item\n * ignore-trigger: Key presses on the trigger element will be ignored\n * horizontal: Navigate horizontally (left/right arrow keys). Default is vertical (up/down)\n * buttons: The list items are buttons (use 'activated' class instead of 'current')\n *\n * Value:\n * Value.selector: The css selector to identify the list items (default: '.list-item')\n *\n */\nexport function keyboardNavigation(): Directive {\n const navId = uuid();\n let listenerController = new AbortController();\n let currentIndex = 0;\n let activeElement: HTMLElement | null = null;\n let listItems = new Array();\n let autoSelect = false;\n let wrapDisabled = false;\n let ignoreTrigger = false;\n let pullFocus = false;\n let pullFocusInitial = false;\n let horizontal = false;\n let itemSelector = \"\";\n let current = \"current\";\n\n return {\n async mounted(el, binding) {\n /* eslint-disable @typescript-eslint/dot-notation */\n autoSelect = binding.modifiers[\"select\"];\n wrapDisabled = binding.modifiers[\"no-wrap\"];\n ignoreTrigger = binding.modifiers[\"ignore-trigger\"];\n pullFocus = !binding.modifiers[\"soft-focus\"];\n pullFocusInitial = !binding.modifiers[\"soft-focus-initial\"];\n horizontal = binding.modifiers[\"horizontal\"];\n current = binding.modifiers[\"buttons\"] ? \"activated\" : \"current\";\n /* eslint-enable @typescript-eslint/dot-notation */\n\n itemSelector = binding.value?.selector || \".list-item\";\n\n // Small delay to ensure any previous keyboard-navigation is unmounted first\n // (eg. when using TabbedModal with keyboard-navigation in multiple tabs)\n await nextTick();\n el.setAttribute(\"data-nav-id\", navId);\n\n initListItems(el);\n initCurrent(el);\n activeElement = await initActiveElement();\n\n el.addEventListener(\"keydown\", keyHandler);\n void setCurrent(currentIndex, true);\n },\n\n updated(el) {\n initListItems(el);\n initCurrent(el);\n },\n\n unmounted(el) {\n listenerController.abort();\n\n if (!ignoreTrigger) {\n activeElement?.removeEventListener(\"keydown\", keyHandler);\n }\n\n el.removeEventListener(\"keydown\", keyHandler);\n currentIndex = -1;\n\n el.removeAttribute(\"data-nav-id\");\n },\n };\n\n function initListItems(el: HTMLElement) {\n listenerController.abort();\n listenerController = new AbortController();\n listItems = Array.from(el.querySelectorAll(`${itemSelector}:not(.static):not(.disabled)`));\n if (autoSelect) {\n initClickListeners();\n } else {\n initPointerListeners();\n }\n\n /**\n * Ensure the currentIndex gets updated when the user clicks on a list item\n */\n function initClickListeners() {\n listItems.forEach((item, index) => {\n item.addEventListener(\"click\", () => void setCurrent(index), {\n signal: listenerController.signal,\n capture: true,\n });\n });\n }\n\n /**\n * Ensure the currentIndex is updated when the user hovers over a list item\n */\n function initPointerListeners() {\n listItems.forEach((item, index) => {\n item.classList.add(\"no-hover\");\n item.addEventListener(\"pointerenter\", () => void setCurrent(index), {\n signal: listenerController.signal,\n });\n item.addEventListener(\"focus\", () => setCurrentIfDifferent(index), {\n signal: listenerController.signal,\n });\n });\n }\n }\n\n /**\n * When the list initializes, either focus on the active (selected) item,\n * or focus on the first item if none are active\n */\n function initCurrent(el: HTMLElement) {\n const active = el.querySelector(\n `.selected, .active, .activated, .${current}`, // our commonly-used classes for active elements\n );\n if (active) {\n currentIndex = listItems.indexOf(active);\n } else {\n currentIndex = 0;\n }\n }\n\n async function initActiveElement() {\n if (ignoreTrigger) {\n return null;\n }\n // Wait for any autofocus directive to finish\n let retries = 10;\n while (autofocusStatus.pending && retries > 0) {\n await nextTick();\n retries--;\n }\n // Add key listener to both the trigger and the list\n const active = document.activeElement as HTMLElement | null;\n active?.addEventListener(\"keydown\", keyHandler);\n return active;\n }\n\n /**\n * Set the current item if the given index is different from the current one\n * (avoids infinite loop when setting focus on the current item)\n */\n function setCurrentIfDifferent(index: number) {\n if (index !== currentIndex || !currentItem()?.classList.contains(current)) {\n void setCurrent(index);\n simulatePointerEvent();\n }\n }\n\n async function setCurrent(index: number, initial?: boolean) {\n currentItem()?.classList.remove(current);\n currentIndex = index;\n currentItem()?.classList.add(current);\n // the currentItem might not yet be correctly positioned (context menu)\n // wait for it not to scroll the board with the focus\n await nextTick();\n await nextTick();\n // Only move focus to the current item if the focus is already somewhere on the list\n // (or if in 'pull focus' mode)\n if (shouldPullFocus(initial) || hasListFocus()) {\n currentItem()?.focus();\n\n // Scroll into view only if the element is not visible in the viewport\n const current = currentItem();\n if (initial && current && !isElementInViewport(current)) {\n current.scrollIntoView({ block: \"nearest\", behavior: \"smooth\" });\n }\n }\n }\n\n function shouldPullFocus(initial?: boolean) {\n return pullFocus && (!initial || pullFocusInitial);\n }\n\n function hasListFocus() {\n return document.activeElement?.closest(`[data-nav-id=\"${navId}\"]`);\n }\n\n function simulatePointerEvent() {\n const newItem = currentItem();\n if (newItem) {\n newItem.dispatchEvent(new PointerEvent(\"pointerenter\"));\n if (autoSelect) {\n newItem.click();\n }\n newItem.scrollIntoView({ block: \"nearest\", behavior: \"smooth\" });\n }\n }\n\n function currentItem() {\n return listItems[currentIndex];\n }\n\n /**\n * Return the wrapped or non-wrapped index, depending on the\n * given wrapDisabled modifier\n */\n function adjustIndex(index: number) {\n return wrapDisabled ? noWrap(index) : wrap(index);\n }\n\n /**\n * Return the given index if it's within 0 <= index <= listItems.length-1,\n * or give the nearest valid index (i.e. -1 --> 0, length --> length-1)\n */\n function noWrap(index: number) {\n return clamp(index, 0, listItems.length ? listItems.length - 1 : 0);\n }\n\n /**\n * Return the given index if it's within the array of listItems,\n * or give the index that simulates the list wrapping (i.e. -1 --> last item)\n */\n function wrap(index: number) {\n const len = listItems.length;\n return len === undefined ? -1 : (index + len) % len;\n }\n\n function keyHandler(event: KeyboardEvent) {\n switch (event.key) {\n case !horizontal && \"ArrowUp\":\n case horizontal && \"ArrowLeft\":\n terminateEvent(event);\n void setCurrent(adjustIndex(currentIndex - 1));\n simulatePointerEvent();\n break;\n case !horizontal && \"ArrowDown\":\n case horizontal && \"ArrowRight\":\n terminateEvent(event);\n void setCurrent(adjustIndex(currentIndex + 1));\n simulatePointerEvent();\n break;\n case \"Enter\":\n terminateEvent(event);\n currentItem()?.click();\n break;\n case \" \":\n if (!(document.activeElement instanceof HTMLInputElement)) {\n terminateEvent(event);\n currentItem()?.click();\n }\n break;\n }\n }\n}\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n","\n\n\n","\n\n\n\n\n","import { nextTick } from \"vue\";\n\nimport { removeBoardScrollMargin } from \"@/math/coordinate-systems\";\nimport { fakeZoom } from \"@/model/Settings\";\nimport type { WindowCoordinate } from \"@/model/coordinates\";\nimport type { ZoomedSize } from \"@/model/size\";\nimport { pushZoomState } from \"@/router/navigation\";\nimport { useBoardStore } from \"@/store/board\";\nimport { useBoardSizeStore } from \"@/store/boardSize\";\nimport { useZoomStore } from \"@/store/zoom\";\n\nexport function applyZoom(\n zoom: number,\n scrollTo?: { target: WindowCoordinate; smooth?: boolean; push?: boolean },\n) {\n if (!useBoardStore().currentBoard().cardSize) {\n return;\n }\n useZoomStore().setZoomFactor(zoom);\n // wait for the zoom to update the DOM before calculating the coordinates\n void nextTick(() => {\n if (scrollTo) {\n window.scrollTo({\n left: scrollTo.target.x,\n top: scrollTo.target.y,\n behavior: scrollTo.smooth ? \"smooth\" : \"auto\",\n });\n if (scrollTo.push) {\n pushZoomState();\n }\n } else {\n window.scrollTo({\n left: (document.documentElement.scrollWidth - window.innerWidth) / 2,\n top: (document.documentElement.scrollHeight - window.innerHeight) / 2,\n behavior: \"auto\",\n });\n }\n });\n}\n\nexport function applyFluidBoardSize(size: ZoomedSize) {\n const rightBottom = useBoardSizeStore().rightBottomMargin;\n applyBoardSize({\n scale: size.zoom / fakeZoom,\n top: size.top + \"px\",\n left: size.left + \"px\",\n height: size.height + \"px\",\n width: size.width + \"px\",\n right: rightBottom.x + \"px\",\n bottom: rightBottom.y + \"px\",\n });\n}\n\nexport function applyFullBoardSize() {\n // Board needs to be downscaled, so we follow the pattern of fluid boards:\n // - first scale down x 0.1 here then scale back up x 10 in styling of individual full sized board\n // We need to keep this behavior to avoid bad-looking zooming in and out when switching\n // between boards during transition animation.\n applyBoardSize({\n scale: 1 / fakeZoom,\n top: \"0\",\n left: \"0\",\n height: \"100vh\",\n width: \"100%\",\n bottom: \"0\",\n right: \"0\",\n });\n}\n\nfunction applyBoardSize(size: {\n scale: number;\n top: string;\n left: string;\n height: string;\n width: string;\n bottom: string;\n right: string;\n}) {\n const boardElem = document.getElementById(\"boards\");\n const borderElem = document.getElementById(\"boards-border\");\n if (boardElem && borderElem) {\n const boardStyle = boardElem.style;\n boardStyle.transform = `scale(${size.scale})`;\n boardStyle.top = size.top;\n boardStyle.left = size.left;\n boardStyle.height = size.height;\n boardStyle.width = size.width;\n\n const borderStyle = borderElem.style;\n borderStyle.transform = `scale(${1 / size.scale})`;\n borderStyle.height = size.bottom;\n borderStyle.width = size.right;\n }\n}\n\nexport function keepBoardScrollPos(action: () => void) {\n // wait to assure useBoardSizeStore().size.left is applied to DOM\n void nextTick(() => {\n const scrollPos = window.scrollX - useBoardSizeStore().size.left;\n action();\n void nextTick(() => {\n window.scrollTo({ left: scrollPos + useBoardSizeStore().size.left });\n pushZoomState();\n });\n });\n}\n\nexport function resetBoardScrollMargin() {\n if (!useBoardSizeStore().scrollableMarginLocked) {\n keepBoardScrollPos(removeBoardScrollMargin);\n } else {\n pushZoomState();\n }\n}\n","import { clamp, minBy, range } from \"lodash-es\";\n\nimport { boardActions } from \"@/action/boardActions\";\nimport { sender } from \"@/backend/Sender\";\nimport { calcBoardSize, relativeToWindow, visibleWindowSize } from \"@/math/coordinate-systems\";\nimport { add, distance2, divided, minus, plus, rectangleSize, times } from \"@/math/coordinates\";\nimport { boardAspect, fakeZoom } from \"@/model/Settings\";\nimport type { IdMap } from \"@/model/baseTypes\";\nimport type { Board } from \"@/model/board\";\nimport type { PositionedCard } from \"@/model/card\";\nimport type { Rectangle, RelativeCoordinate } from \"@/model/coordinates\";\nimport { relativeCoord } from \"@/model/coordinates\";\nimport { useBoardStore } from \"@/store/board\";\nimport { useBoardSizeStore } from \"@/store/boardSize\";\nimport { useBoardsStore } from \"@/store/boards\";\nimport { useZoomStore } from \"@/store/zoom\";\n\nimport { applyZoom } from \"./boardSize\";\n\nexport function arrangeCards(\n board: Board,\n cards: PositionedCard[],\n bounds: Rectangle,\n) {\n const width = useBoardSizeStore().size.width * fakeZoom;\n const height = useBoardSizeStore().size.height * fakeZoom;\n const field = times(rectangleSize(bounds), width, height);\n const offset = relativeCoord(0, 0.08);\n const gap = { x: 1.1, y: 1.1 };\n let cardSize;\n let xc;\n let yc;\n let factor = 1;\n // eslint-disable-next-line no-constant-condition\n while (true) {\n cardSize = times(board.cardSize, gap.x * factor, gap.y * factor);\n xc = Math.floor((field.x - offset.x * width) / (cardSize.x * width));\n yc = Math.floor((field.y - offset.y * height) / (cardSize.y * height));\n if (xc * yc >= cards.length) {\n break;\n }\n factor = (field.x - offset.x * width) / (xc + 1.1) / (gap.x * board.cardSize.x * width);\n }\n boardActions.setCardSize(\"internal\", board.id, board.cardSize.factor * factor);\n const base = plus(bounds.p0, plus(offset, divided(cardSize, 2)));\n const used: IdMap = {};\n for (let i = 0; i < cards.length; i++) {\n let minDist = 1e9;\n let minC = 0;\n const target = plus(base, times(cardSize, i % xc, Math.floor(i / xc)));\n for (let c = 0; c < cards.length; c++) {\n if (!used[c]) {\n const dist = distance2(cards[c].meta.pos, target);\n if (dist < minDist) {\n minDist = dist;\n minC = c;\n }\n }\n }\n used[minC] = true;\n const id = cards[minC].data.id;\n const boardId = board.id;\n useBoardsStore().setCardPos({ id, boardId, ...target });\n sender.moveCard(boardId, id, target);\n }\n}\n\nexport function alignCards(\n cards: PositionedCard[],\n direction: \"horizontal\" | \"vertical\",\n): PositionedCard[] {\n const sum = relativeCoord(0, 0);\n for (const card of cards) {\n add(sum, card.meta.pos);\n }\n return cards.map((card) => {\n const pos =\n direction === \"horizontal\"\n ? relativeCoord(card.meta.pos.x, sum.y / cards.length)\n : relativeCoord(sum.x / cards.length, card.meta.pos.y);\n return { data: { id: card.data.id }, meta: { pos } };\n });\n}\n\nexport function distributeCards(\n cards: PositionedCard[],\n direction: \"horizontal\" | \"vertical\",\n): PositionedCard[] {\n const comp = direction === \"horizontal\" ? \"x\" : \"y\";\n const sorted = [...cards].sort((a, b) => a.meta.pos[comp] - b.meta.pos[comp]);\n const start = sorted[0].meta.pos[comp];\n const end = sorted[sorted.length - 1].meta.pos[comp];\n const dist = (end - start) / (cards.length - 1);\n return sorted.map((card, index) => {\n const pos =\n direction === \"horizontal\"\n ? relativeCoord(start + dist * index, card.meta.pos.y)\n : relativeCoord(card.meta.pos.x, start + dist * index);\n return { data: { id: card.data.id }, meta: { pos } };\n });\n}\n\nexport function lineupCards(\n cards: PositionedCard[],\n cardSize: RelativeCoordinate,\n cardDistance: number,\n regionOf: (pos: RelativeCoordinate) => Rectangle,\n): PositionedCard[] {\n const bounds = boundsOf(cards);\n const columns = similarColumnCount(cards, cardSize, bounds);\n const region = regionOf(bounds.min);\n return moveCards(cards, (card, index) => {\n const pos = plus(\n bounds.min,\n relativeCoord(\n cardSize.x * cardDistance * (index % columns),\n cardSize.y * cardDistance * Math.floor(index / columns),\n ),\n );\n return assureInsideRegion(pos, region, cardSize);\n });\n}\n\nfunction similarColumnCount(\n cards: PositionedCard[],\n cardSize: RelativeCoordinate,\n bounds: {\n min: RelativeCoordinate;\n max: RelativeCoordinate;\n },\n) {\n const aspectOfBounds =\n ((cardSize.x + bounds.max.x - bounds.min.x) / (cardSize.y + bounds.max.y - bounds.min.y)) *\n boardAspect;\n return minBy(range(1, cards.length + 1), (cols) => {\n const aspect = cols / Math.ceil(cards.length / cols);\n return Math.abs(aspectOfBounds - aspect);\n })!;\n}\n\nfunction assureInsideRegion(\n pos: RelativeCoordinate,\n region: Rectangle,\n cardSize: RelativeCoordinate,\n) {\n return relativeCoord(\n clamp(pos.x, region.p0.x + cardSize.x / 2, region.p1.x - cardSize.x / 2),\n clamp(pos.y, region.p0.y + cardSize.y / 2, region.p1.y - cardSize.y / 2),\n );\n}\n\nfunction boundsOf(cards: PositionedCard[]) {\n const min = relativeCoord(1, 1);\n const max = relativeCoord(0, 0);\n cards.forEach((card) => {\n min.x = Math.min(min.x, card.meta.pos.x);\n min.y = Math.min(min.y, card.meta.pos.y);\n max.x = Math.max(max.x, card.meta.pos.x);\n max.y = Math.max(max.y, card.meta.pos.y);\n });\n return { min, max };\n}\n\nfunction moveCards(\n cards: PositionedCard[],\n calcNewPos: (card: PositionedCard, index: number) => RelativeCoordinate,\n): PositionedCard[] {\n const movedCards = new Set();\n return cards.map((card, index) => {\n const newPos = calcNewPos(card, index);\n const nearest = nearestCard(newPos);\n return { data: { id: nearest.data.id }, meta: { pos: newPos } };\n });\n\n function nearestCard(pos: RelativeCoordinate) {\n let minDist = 10;\n let nearest = cards[0];\n cards.forEach((card) => {\n if (!movedCards.has(card.data.id)) {\n const dist = distance2(card.meta.pos, pos);\n if (dist < minDist) {\n minDist = dist;\n nearest = card;\n }\n }\n });\n movedCards.add(nearest.data.id);\n return nearest;\n }\n}\n\nexport function zoomToRegion(bounds: Rectangle, adjustZoom = 0.95) {\n const targetSize = minus(relativeToWindow(bounds.p1), relativeToWindow(bounds.p0));\n const windowSize = visibleWindowSize();\n const zooms = {\n x: windowSize.x / targetSize.x,\n y: windowSize.y / targetSize.y,\n };\n const zoom = useZoomStore().factor * adjustZoom * Math.min(zooms.x, zooms.y);\n const zoomedSize = calcBoardSize(zoom);\n const zoomedTopLeft = relativeToWindow(bounds.p0, zoomedSize);\n const zoomedTargetSize = minus(relativeToWindow(bounds.p1, zoomedSize), zoomedTopLeft);\n const overhang = minus(windowSize, zoomedTargetSize);\n const centered = minus(zoomedTopLeft, divided(overhang, 2));\n applyZoom(zoom, {\n target: minus(centered, useBoardSizeStore().windowMargin.leftTop),\n smooth: true,\n });\n}\n\nexport function findFreePosition(\n coord: RelativeCoordinate,\n step: RelativeCoordinate,\n): RelativeCoordinate {\n const minDist = Math.min(step.x, step.y);\n const cardSize = useBoardStore().currentBoard().cardSize;\n const min = { x: cardSize.x / 2, y: cardSize.y / 2 };\n const max = { x: 1 - cardSize.x / 2, y: 1 - cardSize.y / 2 };\n const c = { ...coord };\n const cards = useBoardStore().currentBoard().cards;\n let notFree;\n do {\n notFree = false;\n for (const id in cards) {\n const card = cards[id];\n if (distance2(card.meta.pos, c) < 0.9 * minDist * minDist) {\n notFree = true;\n // Position 'c' already has a sticky -> adjust by step\n c.x = clamp(c.x + step.x, min.x, max.x);\n c.y = clamp(c.y + step.y, min.y, max.y);\n break;\n }\n }\n } while (notFree && (c.x > min.x || c.y > min.y) && (c.x < max.x || c.y < max.y));\n return c;\n}\n","import { defineStore } from \"pinia\";\nimport type { DefineComponent, EmitsOptions, PropType, Raw } from \"vue\";\nimport { markRaw } from \"vue\";\n\nimport type { WindowCoordinate } from \"@/model/coordinates\";\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\nexport type VueComponent> = DefineComponent<\n PropTypes,\n object,\n unknown,\n Record,\n Record,\n Record,\n Record,\n E\n>;\n/* eslint-enable */\n\ntype RequiredProps = {\n [K in keyof T]: { type: PropType; required: true };\n};\n\ninterface ContextMenu {\n component: Raw>;\n props: PositionProps;\n eventHandlers?: EventHandlers;\n}\n\nexport interface PositionProps {\n position: WindowCoordinate;\n}\n\nexport type EventHandlers = Record void>;\n\nexport const useContextMenuStore = defineStore(\"contextMenu\", {\n state: () => ({\n menu: null as ContextMenu | null,\n nextMenu: null as ContextMenu | null,\n }),\n actions: {\n open(\n component: VueComponent, E>,\n props: T,\n eventHandlers?: EventHandlers,\n ) {\n const newMenu = {\n component: markRaw(component) as Raw>,\n props,\n eventHandlers,\n };\n if (!this.menu) {\n this.menu = newMenu;\n } else {\n this.nextMenu = newMenu;\n }\n },\n close() {\n this.menu = null;\n if (this.nextMenu) {\n this.menu = this.nextMenu;\n this.nextMenu = null;\n }\n },\n },\n});\n","import { defineStore } from \"pinia\";\n\nimport type { IdMap } from \"@/model/baseTypes\";\nimport type { BoardCard } from \"@/model/card\";\nimport type { RelativeCoordinate } from \"@/model/coordinates\";\n\nimport { useBoardStore } from \"./board\";\nimport { useCardStore } from \"./card\";\nimport { linkId, useLinkStore } from \"./link\";\n\nexport interface Drag {\n id: string;\n type: \"card\" | \"link\";\n pos: RelativeCoordinate;\n fromPalette?: boolean;\n}\n\nexport const useDraggingStore = defineStore(\"dragging\", {\n state: () => ({\n dragging: {} as IdMap,\n }),\n getters: {\n findById:\n (state) =>\n (id: string): Drag | undefined => {\n for (const dragId in state.dragging) {\n if (state.dragging[dragId].id === id) {\n return state.dragging[dragId];\n }\n }\n },\n isLinkDragging: (state) => Object.values(state.dragging).some((drag) => drag.type === \"link\"),\n draggedLinks: (state) =>\n Object.values(state.dragging).flatMap((drag) => {\n const card = useBoardStore().currentBoard().cards[drag.id.substring(2)];\n if (!card || drag.type !== \"link\") {\n return [];\n }\n return { card, drag };\n }),\n },\n actions: {\n startCardDragging(\n id: string,\n options: { fromPalette?: boolean } = {},\n pos: RelativeCoordinate,\n ) {\n const board = useBoardStore().currentBoard();\n const boardCard = board.cards[id];\n boardCard.meta.dragging = true;\n if (!(id in this.dragging)) {\n this.dragging[id] = {\n id,\n type: \"card\",\n fromPalette: !!options.fromPalette,\n pos,\n };\n }\n },\n startLinkDragging(id: string, dragId: number, pos: RelativeCoordinate) {\n const card = useCardStore().cards[id];\n this.dragging[dragId] = {\n id: \"l_\" + id,\n type: \"link\",\n pos,\n };\n card.links.unshift({\n id: \"l_\" + id,\n from: linkId(card),\n to: \"\",\n state: \"default\",\n });\n useLinkStore().linking.from = card;\n },\n dragCard(id: string, pos: RelativeCoordinate) {\n this.dragging[id].pos = pos;\n },\n dragLink(dragId: number, pos: RelativeCoordinate) {\n this.dragging[dragId].pos = pos;\n },\n endCardDragging(id: string, pos: RelativeCoordinate) {\n delete this.dragging[id];\n const boardCard = useBoardStore().currentBoard().cards[id];\n if (!boardCard) {\n return;\n }\n boardCard.meta.pos.x = pos.x;\n boardCard.meta.pos.y = pos.y;\n boardCard.meta.zIndex = ++useBoardStore().currentBoard().maxZ;\n boardCard.meta.dragging = false;\n },\n endLinkDragging(\n id: string,\n dragId: number,\n boardCard: BoardCard,\n linkDragEl?: HTMLElement, // the element with .link-drag class\n ) {\n if (linkDragEl) {\n linkDragEl.style.display = \"block\";\n }\n\n const link_id = \"l_\" + id;\n const link = boardCard.data.links.find((l) => l.id === link_id);\n if (link?.to === \"\") {\n const linkIndex = boardCard.data.links.findIndex((l) => l.id === link_id);\n boardCard.data.links.splice(linkIndex, 1);\n }\n delete this.dragging[dragId];\n },\n },\n});\n","import { defineStore } from \"pinia\";\n\nimport type { Toast } from \"@/model/toast\";\n\nexport const useToastStore = defineStore(\"toast\", {\n state: () => {\n return {\n toast: { messageKey: \"\", duration: 0, closeable: false } as Toast,\n };\n },\n actions: {\n show(messageKey: string, options?: Partial) {\n if (!localStorage.getItem(hideKey(messageKey))) {\n this.toast = {\n messageKey,\n duration: 5000,\n closeable: false,\n ...options,\n };\n if (this.toast.duration > 0) {\n setTimeout(this.hide, this.toast.duration);\n }\n }\n },\n hide(noShowAgain?: boolean) {\n if (noShowAgain && this.toast.messageKey) {\n localStorage.setItem(hideKey(this.toast.messageKey), \"true\");\n }\n this.toast.messageKey = \"\";\n },\n },\n});\n\nfunction hideKey(key: string) {\n return `hide-${key}`;\n}\n","import { sender } from \"@/backend/Sender\";\nimport type { Id } from \"@/model/baseTypes\";\nimport type { BoardCard, Card } from \"@/model/card\";\nimport type { CardLink, Link, StickyLink } from \"@/model/link\";\nimport { useBoardStore } from \"@/store/board\";\nimport { useBoardsStore } from \"@/store/boards\";\nimport { useCardStore } from \"@/store/card\";\nimport { useDraggingStore } from \"@/store/dragging\";\nimport { animateLinkMove } from \"@/store/helpers/animator\";\nimport {\n highlightCard,\n linkFadeOutCard,\n linkHighlightCard,\n resetCardMark,\n} from \"@/store/helpers/mark\";\nimport { useLinkStore } from \"@/store/link\";\nimport { useToastStore } from \"@/store/toast\";\n\nimport { action, ctxAction, defineActions } from \"./actions\";\nimport { boardActions } from \"./boardActions\";\nimport type { ActionContext } from \"./types\";\n\nexport const linkActions = defineActions(\"link\", {\n add: ctxAction(async (ctx, cardLink: { fromId: Link[\"from\"]; toId: Link[\"to\"] }) => {\n ctx.track({\n fromId: cardLink.fromId,\n fromFunctionality: useCardStore().cards[cardLink.fromId]?.type.functionality,\n fromBoard: useBoardStore().currentBoard().type,\n toId: cardLink.toId,\n toFunctionality: useCardStore().cards[cardLink.toId]?.type.functionality,\n });\n const link = await sender.addLink(cardLink.fromId, cardLink.toId);\n // this is used for performance reasons, there is a second call in subscriptionHandlers\n useLinkStore().add({\n id: link.id,\n from: link.from_sticky_id,\n to: link.to_sticky_id,\n type: link.link_type_id,\n state: \"default\",\n });\n }),\n remove: ctxAction(async (ctx, linkId: Link[\"id\"], info?: { from: string; to: string }) => {\n ctx.track({\n fromId: info?.from,\n fromFunctionality: useCardStore().cards[info?.from || \"\"]?.type.functionality,\n fromBoard: useBoardStore().currentBoard().type,\n toId: info?.to,\n toFunctionality: useCardStore().cards[info?.to || \"\"]?.type.functionality,\n });\n await sender.deleteLink(linkId);\n // this is used for performance reasons, there is a second call in subscriptionHandlers\n useLinkStore().remove(linkId);\n linkActions.updateCardLinkedMarks(\"internal\");\n }),\n addObjective: ctxAction(addObjective),\n removeObjective: ctxAction(removeObjective),\n setCardLinkLabel: action(async (card: Card, cardLink: CardLink) => {\n if (cardLink.kind === \"sticky\") {\n await recreateStickyLink(cardLink);\n } else {\n await recreateObjectiveLink(card, cardLink.boardId, cardLink.objectiveId);\n }\n\n async function recreateStickyLink(stickyLink: StickyLink) {\n const link = useLinkStore().linksById[stickyLink.id];\n await linkActions.remove(\"internal\", stickyLink.id);\n if (!link) return;\n\n await linkActions.add(\"internal\", { fromId: link.from, toId: link.to });\n }\n\n async function recreateObjectiveLink(card: Card, boardId: string, objectiveId: string) {\n await linkActions.removeObjective(\"internal\", card.id, boardId, objectiveId);\n await linkActions.addObjective(\"internal\", card.id, boardId, objectiveId);\n }\n }),\n\n addByDrag: ctxAction(async (ctx, dragInfo: Id & { el: HTMLElement; dragId: number }) => {\n const currentBoard = useBoardStore().currentBoard();\n const boardCard = currentBoard.cards[dragInfo.id];\n const { from: linkFrom, to: linkTo } = useLinkStore().linking;\n\n useLinkStore().linking.from = null;\n useLinkStore().linking.to = null;\n ctx.track(null);\n if (linkFrom && linkTo) {\n if (linkTo.type === \"sticky\") {\n await linkActions.add(\"drag\", { fromId: linkFrom.id, toId: linkTo.id });\n resetCardMark(useBoardStore().currentBoard().cards[linkTo.id]);\n linkActions.updateCardLinkedMarks(\"internal\");\n } else {\n await linkActions.addObjective(\"drag\", linkFrom.id, currentBoard.id, linkTo.id);\n }\n useDraggingStore().endLinkDragging(dragInfo.id, dragInfo.dragId, boardCard, dragInfo.el);\n } else {\n animateLinkMove(\n boardCard,\n useDraggingStore().dragging[dragInfo.dragId].pos,\n (coord) => useDraggingStore().dragLink(dragInfo.dragId, coord),\n () =>\n useDraggingStore().endLinkDragging(dragInfo.id, dragInfo.dragId, boardCard, dragInfo.el),\n );\n }\n }),\n markCardLinkedCards: action((card: BoardCard) => markCardLinkedCards(card)),\n updateCardLinkedMarks: action(() => {\n const card = useLinkStore().markingCardLinkedCards;\n if (card) {\n markCardLinkedCards(card);\n }\n }),\n});\n\nasync function addObjective(\n ctx: ActionContext,\n cardId: string,\n boardId: string,\n objectiveId: string,\n) {\n ctx.track(getLinkObjectiveData(cardId, boardId, objectiveId));\n await sender.addObjectiveLink(cardId, boardId, objectiveId);\n useLinkStore().addObjectiveLink(cardId, { boardId, objectiveId });\n}\n\nasync function removeObjective(\n ctx: ActionContext,\n cardId: string,\n boardId: string,\n objectiveId: string,\n) {\n ctx.track(getLinkObjectiveData(cardId, boardId, objectiveId));\n await sender.deleteObjectiveLink(cardId, boardId, objectiveId);\n useLinkStore().removeObjectiveLink(cardId, { boardId, objectiveId });\n\n // Notify screen reader users that link was removed\n useToastStore().show(/*$t*/ \"linkableCardRow.linkRemoved\", { invisible: true });\n}\n\nfunction getLinkObjectiveData(cardId: string, boardId: string, objectiveId: string) {\n const fromCard = useCardStore().cards[cardId];\n return {\n fromId: fromCard.id,\n fromFunctionality: fromCard.type.functionality,\n fromBoard: useBoardStore().currentBoard().type,\n toId: objectiveId,\n toBoard: useBoardsStore().boardById(boardId).type,\n };\n}\n\nfunction markCardLinkedCards(card: BoardCard) {\n useLinkStore().markCardLinkedCard(card);\n const distances = useLinkStore().linkedCardDistances(card);\n Object.values(useBoardStore().currentBoard().cards).forEach((boardCard) =>\n markLinkedCard(boardCard, distances[boardCard.data.id]),\n );\n}\n\nfunction markLinkedCard(card: BoardCard, distance?: number) {\n if (distance === undefined || distance > 2) {\n linkFadeOutCard(card);\n } else if (distance > 0) {\n linkHighlightCard(card, distance === 1);\n boardActions.cardToFront(\"internal\", card.data.id);\n } else {\n highlightCard(card);\n boardActions.cardToFront(\"internal\", card.data.id);\n }\n}\n","import { nextTick } from \"vue\";\n\nimport { sender } from \"@/backend/Sender\";\nimport CardCreationMenu from \"@/components/card/CardCreationMenu.vue\";\nimport { findFreePosition } from \"@/components/utils/layout\";\nimport { sendStickyNoteAction } from \"@/composables/useEventBus\";\nimport { relativeToWindow, windowToRelative } from \"@/math/coordinate-systems\";\nimport { minus, plus, times } from \"@/math/coordinates\";\nimport CardFlag from \"@/model/CardFlag\";\nimport type { Trigger } from \"@/model/action\";\nimport type { AlmSourceId } from \"@/model/baseTypes\";\nimport type { BoardCard } from \"@/model/card\";\nimport type { WindowCoordinate } from \"@/model/coordinates\";\nimport { windowCoord } from \"@/model/coordinates\";\nimport type { StickyType } from \"@/model/stickyType\";\nimport { useAlmItemTypeStore } from \"@/store/almItemType\";\nimport { useBoardStore } from \"@/store/board\";\nimport { useBoardsStore } from \"@/store/boards\";\nimport type { CardEvent } from \"@/store/card\";\nimport { useCardStore } from \"@/store/card\";\nimport { useClientSettingsStore } from \"@/store/clientSettings\";\nimport { useContextMenuStore } from \"@/store/contextMenu\";\nimport { linkHighlightCard } from \"@/store/helpers/mark\";\nimport { useLinkStore } from \"@/store/link\";\nimport { isStickyTypeAlmSynced } from \"@/store/stickyType\";\nimport { useUserStore } from \"@/store/user\";\nimport { stickyNoteCreated } from \"@/utils/analytics/events\";\nimport { trackEvent } from \"@/utils/analytics/track\";\nimport { centerCoord, scrollCoord } from \"@/utils/dom/coordinates\";\nimport { removeNonPrintable } from \"@/utils/general\";\n\nimport { boardActions } from \"./boardActions\";\nimport { linkActions } from \"./linkActions\";\nimport { toggleActions } from \"./toggleActions\";\nimport type { ActionContext } from \"./types\";\n\nexport interface CardCreateProps {\n type: StickyType;\n pos: WindowCoordinate;\n text?: string;\n almSourceId?: AlmSourceId;\n onClose?: () => void;\n}\n\nexport async function startAddCard(\n ctx: ActionContext,\n props: Partial = {},\n focus = true,\n) {\n if (!useUserStore().isAllowed(\"edit\")) return;\n\n assurePos(props);\n props.type ??= getDefaultStickyNoteType();\n\n if (props.type && isAlmSourceOk(props) && !props.text?.includes(\"\\n\")) {\n return addAndTrack(props.type, focus, {});\n }\n\n useContextMenuStore().open(\n CardCreationMenu,\n { position: props.pos!, card: props },\n { select, close: () => props.onClose?.() },\n );\n\n async function select(\n type: StickyType,\n almSourceId: AlmSourceId | undefined,\n multiCreate: boolean,\n ) {\n if (multiCreate) {\n const addPromises = props\n .text!.split(\"\\n\")\n .map((line) => line.trim())\n .filter((line) => line.length > 0)\n .map((text, index) => {\n const pos = plus(props.pos!, relativeToWindow(times(cardPosStep(), index)));\n return addAndTrack(type, false, { almSourceId, text, pos });\n });\n const boardId = useBoardStore().currentBoard().id;\n for (const id of await Promise.all(addPromises)) {\n boardActions.cardToFront(\"internal\", id, boardId);\n useBoardStore().selectSticky(id);\n }\n } else {\n addAndTrack(type, focus, { almSourceId });\n }\n }\n\n function addAndTrack(type: StickyType, focus: boolean, additional: Record) {\n trackCreateStickyNoteEvent(type, !!getDefaultStickyNoteType(), ctx.source);\n return addCard({ ...props, type, ...additional } as CardCreateProps, focus);\n }\n}\n\nfunction getDefaultStickyNoteType() {\n const id = useClientSettingsStore().defaultStickyTypeId;\n return useBoardStore().creatableStickyTypes.find((type) => type.id === id);\n}\n\nfunction assurePos(props: Partial) {\n if (!props.pos) {\n const activeElement = document.activeElement;\n\n // If the user is focused on a board element, create the new sticky at that location\n if (activeElement?.closest(\".board\")) {\n const { left, top, width, height } = activeElement.getBoundingClientRect();\n const f = activeElement.classList.contains(\"sticky-note\") ? 1.5 : 2; // Avoid creating a sticky note on top of another one\n\n props.pos = windowCoord(left + width / f, top + height / f);\n } else {\n // Otherwise, create the new sticky in the center of the board\n props.pos = centerCoord();\n }\n }\n}\n\nfunction trackCreateStickyNoteEvent(\n type: StickyType,\n defaultStickyType: boolean,\n trigger: Trigger,\n) {\n trackEvent(stickyNoteCreated(type.functionality, type.origin, trigger, defaultStickyType));\n}\n\nfunction isAlmSourceOk(props: Partial) {\n const { type, pos } = props;\n if (!pos || !type) return false;\n const originBoard = useBoardsStore().stickyTypeOriginBoard(type, pos);\n return props.almSourceId !== undefined || originBoard.almSources.length <= 1;\n}\n\nexport async function addCard(props: CardCreateProps, focus = true) {\n toggleActions.hidePanMode(\"internal\");\n const board = useBoardStore().currentBoard();\n props = sanitize(props);\n const originBoard = useBoardsStore().stickyTypeOriginBoard(props.type, props.pos);\n const almSourceId = props.almSourceId ?? originBoard.almSources[0]?.id;\n const status = useAlmItemTypeStore().calcStatus(\n undefined,\n props.type,\n board.type === \"team\" ? board.team.id : undefined,\n board.artId,\n almSourceId,\n );\n const pos = windowToRelative(props.pos);\n const ev: CardEvent = {\n id: \"\",\n boardId: board.id,\n pos,\n text: props.text,\n type: props.type,\n status,\n priority: 0,\n iterationId: null,\n teamId: null,\n zIndex: 0,\n flagType: CardFlag.emptyFlag(),\n objectives: [],\n almSourceId,\n artId: board.artId || null,\n ...useBoardStore().positionalCardProperties(pos),\n };\n ev.id = await sender.addCard(board.id, { ...ev, ...ev.pos });\n useCardStore().add(ev);\n // Make sure the new card matches the current faded state (eg. when a card is pinned)\n linkActions.updateCardLinkedMarks(\"internal\");\n const pinned = useLinkStore().markingCardLinkedCards;\n if (pinned) {\n void linkActions.add(\"pin-create\", { fromId: pinned.data.id, toId: ev.id });\n linkHighlightCard(board.cards[ev.id], true);\n boardActions.cardToFront(\"internal\", ev.id);\n }\n\n if (focus) {\n await nextTick();\n sendStickyNoteAction(ev.id, {\n action: \"enlarge\",\n focus: true,\n trigger: \"after-create\",\n });\n }\n return ev.id;\n}\n\nfunction sanitize(event: CardCreateProps): CardCreateProps {\n if (event.text && isStickyTypeAlmSynced(event.type)) {\n event.text = removeNonPrintable(event.text);\n }\n return event;\n}\n\nexport function cardCreateProps(\n card: BoardCard,\n options?: { findFreePos?: boolean },\n): CardCreateProps {\n return {\n text: card.data.text,\n type: card.data.type,\n pos: minus(\n relativeToWindow(\n options?.findFreePos\n ? findFreePosition(card.meta.pos, cardPosStep())\n : plus(card.meta.pos, cardPosStep()),\n ),\n scrollCoord(),\n ),\n almSourceId: card.data.almSourceId ?? undefined,\n };\n}\n\nexport function cardPosStep() {\n const cardSize = useBoardStore().currentBoard().cardSize;\n return times(cardSize, 0.4);\n}\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n","\n\n\n\n\n\n","\n\n\n\n\n\n","\n\n\n","import type { InjectionKey } from \"vue\";\n\nimport type { ActionSource } from \"@/model/action\";\n\nexport const actionSourceKey: InjectionKey = Symbol(\"actionSource\");\n","\n\n\n","\n\n\n\n\n","\n\n\n","\n\n\n\n\n","\n\n\n","import type { FlagColor, FlagIcon } from \"@/model/CardFlag\";\nimport type CardFlag from \"@/model/CardFlag\";\nimport type { StickerIcon } from \"@/model/icon\";\nimport { i18n } from \"@/translations/i18n\";\n\nexport const iconMap: Record = {\n // fuck you prettier\n none: { icon: \"sticker/none\", key: /*$t*/ \"label.icon.stickers/none\" },\n flag: { icon: \"sticker/flag\", key: /*$t*/ \"label.icon.stickers/flag\" },\n check: {\n icon: \"sticker/checkmark\",\n key: /*$t*/ \"label.icon.stickers/checkmark\",\n },\n round: { icon: \"sticker/dot\", key: /*$t*/ \"label.icon.stickers/dot\" },\n star: { icon: \"sticker/star\", key: /*$t*/ \"label.icon.stickers/star\" },\n question: {\n icon: \"sticker/question-mark\",\n key: /*$t*/ \"label.icon.stickers/question-mark\",\n },\n exclam: {\n icon: \"sticker/exclamation-mark\",\n key: /*$t*/ \"label.icon.stickers/exclamation-mark\",\n },\n};\n\nexport const colorMap: Record = {\n 0: { color: \"red\", key: /*$t*/ \"label.color.red\" },\n 1: { color: \"orange\", key: /*$t*/ \"label.color.orange\" },\n 2: { color: \"yellow\", key: /*$t*/ \"label.color.yellow\" },\n 3: { color: \"blue\", key: /*$t*/ \"label.color.blue\" },\n 4: { color: \"purple\", key: /*$t*/ \"label.color.purple\" },\n 5: { color: \"green\", key: /*$t*/ \"label.color.green\" },\n};\n\n/**\n * Returns the name of the flag (color + type)\n */\nexport const flagName = (flag: CardFlag): string => {\n const type = i18n.global.t(iconMap[flag.icon].key);\n const color = flag.icon !== \"none\" ? i18n.global.t(colorMap[flag.colorIndex].key) : \"\";\n return i18n.global.t(\"label.stickyNote.sticker\", { type, color });\n};\n","import type { BoardType, InfoLevel, StatusClass } from \"./baseTypes\";\nimport color from \"./color.module.scss\";\n\nexport const linkColors: { [state in InfoLevel]: string } = {\n default: color.textSecondary,\n ok: color.ok,\n warn: color.altWarn,\n error: color.altError,\n};\n\nexport const flagColors = [\n color.flag1,\n color.flag2,\n color.flag3,\n color.flag4,\n color.flag5,\n color.flag6,\n];\n\ntype LinkBoardType = Extract;\n\nexport const normalLinkColors: {\n [state in LinkBoardType]: string;\n} = {\n program: color.link2,\n risk: color.link1,\n team: color.link1,\n flex: color.link1,\n};\n\nexport const statusClassColors: {\n [key in StatusClass]: string;\n} = {\n undefined: color.statusClassUndefined,\n todo: color.statusClassTodo,\n \"in-progress\": color.statusClassProgress,\n done: color.statusClassDone,\n};\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n","import type { LinkableCard, LinkableItem, LinkableObjective } from \"@/model/link\";\nimport { useUserStore } from \"@/store/user\";\n\n/**\n Links should be sorted alphabetically by text, but\n prioritizing the following order:\n 1. ART work items\n - items which belong to the user team\n 2. Dependencies\n - user team is a dependent team\n - user team is a precond team\n 3. Team Work Items\n 4. Objectives\n - Committed\n - Uncommitted\n 5. All Others\n */\nexport function sortLinkableItems(links: LinkableItem[]): LinkableItem[] {\n const artWorkItems = new Array();\n const dependencies = new Array();\n const teamWorkItems = new Array();\n const objectivesCommitted = new Array();\n const objectivesUncommitted = new Array();\n const others = new Array();\n\n links.forEach((link) => {\n switch (link.kind) {\n case \"sticky\":\n // ART work item\n if (isARTWorkItem(link)) {\n artWorkItems.push(link);\n }\n // Dependency\n else if (isDependency(link)) {\n dependencies.push(link);\n }\n // Team work item\n else if (isTeamWorkItem(link)) {\n teamWorkItems.push(link);\n }\n // Others\n else if (isOtherItem(link)) {\n others.push(link);\n }\n break;\n case \"objective\":\n if (link.type === \"committed\") {\n objectivesCommitted.push(link);\n } else {\n objectivesUncommitted.push(link);\n }\n break;\n }\n });\n\n // Sort each classification alphabetically by text\n const sortAlphabetically = (a: LinkableItem, b: LinkableItem) => a.text.localeCompare(b.text);\n\n artWorkItems.sort(sortAlphabetically);\n dependencies.sort(sortAlphabetically);\n teamWorkItems.sort(sortAlphabetically);\n objectivesCommitted.sort(sortAlphabetically);\n objectivesUncommitted.sort(sortAlphabetically);\n others.sort(sortAlphabetically);\n\n // Further prioritize within the classified groups\n const isUserTeam = (teamId: string) =>\n useUserStore().technicalUser.teams.some((userTeam) => userTeam.id === teamId);\n\n const userTeamArtWorkItems = artWorkItems.filter((link) => link.team && isUserTeam(link.team.id));\n const restArtWorkItems = artWorkItems.filter((link) => !link.team || !isUserTeam(link.team.id));\n\n const userDependTeamDependencies = dependencies.filter(\n (link) => link.dependTeam && isUserTeam(link.dependTeam.id),\n );\n const userPrecondTeamDependencies = dependencies.filter(\n (link) => link.precondTeam && isUserTeam(link.precondTeam.id),\n );\n const restDependencies = dependencies.filter(\n (link) =>\n (!link.dependTeam || !isUserTeam(link.dependTeam.id)) &&\n (!link.precondTeam || !isUserTeam(link.precondTeam.id)),\n );\n\n return [\n ...userTeamArtWorkItems,\n ...restArtWorkItems,\n ...userDependTeamDependencies,\n ...userPrecondTeamDependencies,\n ...restDependencies,\n ...teamWorkItems,\n ...objectivesCommitted,\n ...objectivesUncommitted,\n ...others,\n ];\n}\n\nexport function isSticky(link: LinkableItem): link is LinkableCard {\n return link.kind === \"sticky\";\n}\n\nexport function isARTWorkItem(link: LinkableItem): link is LinkableCard {\n return (\n link.kind === \"sticky\" &&\n [\"backlog\", \"program\", \"risk\"].includes(link.type.origin) &&\n !isDependency(link)\n );\n}\n\nexport function isDependency(link: LinkableItem): link is LinkableCard {\n return link.kind === \"sticky\" && link.type.functionality === \"dependency\";\n}\n\nexport function isTeamWorkItem(link: LinkableItem): link is LinkableCard {\n return link.kind === \"sticky\" && link.type.origin === \"team\" && !isDependency(link);\n}\n\nexport function isOtherItem(link: LinkableItem): link is LinkableCard {\n return (\n link.kind === \"sticky\" && !isARTWorkItem(link) && !isDependency(link) && !isTeamWorkItem(link)\n );\n}\n\nexport function isObjective(link: LinkableItem): link is LinkableObjective {\n return link.kind === \"objective\";\n}\n","import { defineStore } from \"pinia\";\n\nimport type { WorkingMode } from \"@/model/baseTypes\";\n\nimport { useClientSettingsStore } from \"./clientSettings\";\n\ninterface State {\n workingMode: WorkingMode;\n}\n\nexport const useWorkModeStore = defineStore(\"workMode\", {\n state: (): State => ({\n workingMode: \"planning\",\n }),\n getters: {\n isExecutionMode(): boolean {\n return this.workingMode === \"execution\";\n },\n isPlanningMode(): boolean {\n return this.workingMode === \"planning\";\n },\n },\n actions: {\n setWorkingMode(mode: WorkingMode) {\n this.workingMode = mode;\n useClientSettingsStore().setWorkingMode(mode);\n },\n toggle() {\n this.setWorkingMode(this.isExecutionMode ? \"planning\" : \"execution\");\n },\n },\n});\n","\n\n\n\n\n","\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","import type {\n ArtContext,\n EmptyContext,\n SolutionTrainContext,\n TeamContext,\n} from \"@/components/OrganizationBaseTree/types\";\nimport type { Color } from \"@/model/baseTypes\";\nimport type { LinkableItem } from \"@/model/link\";\n\nexport const NO_ART = \"NO-ART\";\n\nexport type Level = \"solution-train\" | \"art\" | \"team\" | \"none\";\n\ninterface BaseSearchContext {\n query: string;\n}\n\nexport type SearchContext = BaseSearchContext &\n (EmptyContext | SolutionTrainContext | ArtContext | TeamContext);\n\nexport type LinkableItemGroups = Record;\n\nexport interface LinkableItemGroup {\n level: Level;\n items: LinkableItem[];\n}\n\nexport interface GroupedLinkableItems {\n currentLevel: LinkableItemGroup;\n otherLevels: LinkableItemGroups;\n}\n\ninterface StickyFilterItem {\n id: string;\n kind: \"sticky\";\n name: string;\n color: Color;\n}\n\ninterface ObjectiveFilterItem {\n id: string;\n kind: \"objective\";\n name: string;\n}\n\nexport type FilterItem = StickyFilterItem | ObjectiveFilterItem;\n\nexport const EMPTY_GROUPED_LINKABLE_ITEMS = {\n currentLevel: { level: \"none\" as const, items: [] },\n otherLevels: {},\n};\n","\n\n\n\n\n","import type { InjectionKey } from \"vue\";\n\ninterface DropdownMenuProvide {\n close: () => void;\n}\n\nexport const dropdownKey: InjectionKey = Symbol(\"dropdown-menu\");\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","import { hasBoardObjectives } from \"@/model/board\";\nimport type { Card } from \"@/model/card\";\nimport type { LinkableObjective } from \"@/model/link\";\nimport type { Objective } from \"@/model/objective\";\nimport { useBoardsStore } from \"@/store/boards\";\nimport { useObjectiveStore } from \"@/store/objective\";\n\nimport type {\n GroupedLinkableItems,\n LinkableItemGroup,\n LinkableItemGroups,\n SearchContext,\n} from \"../types\";\nimport { NO_ART } from \"../types\";\n\nexport function groupedLinkableObjectives(\n targetCards: Card[],\n searchContext: SearchContext,\n): GroupedLinkableItems {\n return getGroupedObjectives();\n\n function getGroupedObjectives(): GroupedLinkableItems {\n const groupedObjectives = getGroupObjectivesByBoardGroups(searchContext.query);\n\n return {\n currentLevel: extractCurrentLevel(groupedObjectives),\n otherLevels: searchContext.query ? groupedObjectives : {},\n };\n }\n\n function extractCurrentLevel(groupedObjectives: LinkableItemGroups): LinkableItemGroup {\n if (searchContext.level === \"none\" || searchContext.level === \"solution-train\") {\n return { level: searchContext.level, items: [] };\n }\n const id = searchContext.id || NO_ART;\n const currentLevelItems = groupedObjectives[id]?.items ?? [];\n delete groupedObjectives[id];\n return { level: searchContext.level, items: currentLevelItems };\n }\n\n function getGroupObjectivesByBoardGroups(query: string): LinkableItemGroups {\n const boards = Object.values(useBoardsStore().boards);\n const objectiveGroups: LinkableItemGroups = {};\n\n boards.forEach((board) => {\n if (hasBoardObjectives(board)) {\n const objectives = [...board.objectives, ...board.stretchObjectives]\n .map((objective) => makeObjectiveLink(objective, board.id))\n .filter(\n (objective) =>\n query.length === 0 ||\n objective.text.toLowerCase().includes(query) ||\n objective.description.toLowerCase().includes(query),\n );\n if (objectives.length !== 0) {\n const isTeam = board.type === \"team\";\n objectiveGroups[isTeam ? board.team.id : board.artId ?? NO_ART] = {\n level: isTeam ? \"team\" : \"art\",\n items: objectives,\n };\n }\n }\n });\n return objectiveGroups;\n }\n\n function makeObjectiveLink(objective: Objective, boardId: string): LinkableObjective {\n const linked = targetCards.every((card) =>\n card.objectives.some(({ id }) => objective.id === id),\n );\n return {\n kind: \"objective\",\n linked,\n id: objective.id,\n text: objective.text,\n boardId: boardId,\n description: objective.description,\n type: useObjectiveStore().objectiveTypeById(objective.id, {\n boardId,\n }),\n };\n }\n}\n","import { groupBy, mapValues, sortBy } from \"lodash-es\";\n\nimport { searchStickies } from \"@/backend/Backend\";\nimport { boardTypes } from \"@/model/baseTypes\";\nimport type { Board, BoardData } from \"@/model/board\";\nimport { isArtBoard, isSolutionBoard, isTeamBoard } from \"@/model/board\";\nimport type { Card } from \"@/model/card\";\nimport type { LinkableCard } from \"@/model/link\";\nimport type { SearchResult } from \"@/model/search\";\nimport type { Team } from \"@/model/session\";\nimport { useArtStore } from \"@/store/art\";\nimport { useBoardsStore } from \"@/store/boards\";\nimport { linkBetween } from \"@/store/link\";\nimport { useSessionStore } from \"@/store/session\";\nimport { useStickyTypeStore } from \"@/store/stickyType\";\nimport { useTeamStore } from \"@/store/team\";\n\nimport type {\n GroupedLinkableItems,\n LinkableItemGroup,\n LinkableItemGroups,\n SearchContext,\n} from \"../types\";\nimport { NO_ART } from \"../types\";\n\ntype LinkableCardWithBoardId = LinkableCard & { boardId: string };\n\nexport async function groupedLinkableStickies(\n targetCards: Card[],\n searchContext: SearchContext,\n): Promise {\n const linkableStickies = (await getStickies()).filter(isNotTargetGroup).map(makeLinkableCard);\n return groupStickies(linkableStickies);\n\n async function getStickies() {\n if (searchContext.query) {\n return await searchStickies({ text: searchContext.query });\n }\n const boards = getCurrentLevelBoards();\n return boards.length ? await searchStickies({ boards }) : [];\n }\n\n function groupStickies(stickies: LinkableCardWithBoardId[]): GroupedLinkableItems {\n const groupedStickiesByBoardGroups = groupStickiesByBoardGroups(stickies);\n\n return {\n currentLevel: extractCurrentLevel(groupedStickiesByBoardGroups),\n otherLevels: groupedStickiesByBoardGroups,\n };\n }\n\n function extractCurrentLevel(\n groupedStickiesByBoardGroups: LinkableItemGroups,\n ): LinkableItemGroup {\n if (searchContext.level === \"none\") {\n return { level: \"none\", items: [] };\n }\n\n const id =\n searchContext.level === \"solution-train\" ? \"solution-train\" : searchContext.id || NO_ART;\n const currentLevelItems = groupedStickiesByBoardGroups[id]?.items ?? [];\n delete groupedStickiesByBoardGroups[id];\n return { level: searchContext.level, items: currentLevelItems };\n }\n\n function groupStickiesByBoardGroups(stickies: LinkableCardWithBoardId[]): LinkableItemGroups {\n const boards = Object.values(useBoardsStore().boards);\n const boardGroups = {\n team: boards.filter((board) => isTeamBoard(board.type)).map((board) => board.id),\n art: boards.filter((board) => isArtBoard(board.type)).map((board) => board.id),\n solution: boards.filter((board) => isSolutionBoard(board.type)).map((board) => board.id),\n };\n\n const teamStickies = stickies.filter((sticky) => boardGroups.team.includes(sticky.boardId));\n\n const artStickies = stickies.filter((sticky) => boardGroups.art.includes(sticky.boardId));\n\n const solutionStickies = sortStickies(\n stickies.filter((sticky) => boardGroups.solution.includes(sticky.boardId)),\n );\n\n const groupedByTeam = groupBy(sortStickies(teamStickies), (sticky) => {\n const board = useBoardsStore().boardById(sticky.boardId) as BoardData<\"team\">;\n return board.team.id;\n });\n\n const groupedByART = groupBy(sortStickies(artStickies), (sticky) => {\n const board = useBoardsStore().boardById(sticky.boardId);\n return board.artId ?? NO_ART;\n });\n\n return {\n ...mapValues(groupedByTeam, (group) => ({\n items: removeDuplicatedStickies(group),\n level: \"team\",\n })),\n ...mapValues(groupedByART, (group) => ({\n items: removeDuplicatedStickies(group),\n level: \"art\",\n })),\n ...(solutionStickies.length\n ? {\n \"solution-train\": {\n items: removeDuplicatedStickies(solutionStickies),\n level: \"solution-train\",\n },\n }\n : undefined),\n };\n }\n\n function sortStickies(stickies: LinkableCardWithBoardId[]) {\n return sortBy(stickies, [sameTeam, sameArt, teamName, artName, text]);\n\n function sameTeam(card: LinkableCardWithBoardId) {\n return card.team?.id === useTeamStore().current.id ? 0 : 1;\n }\n\n function sameArt(card: LinkableCardWithBoardId) {\n return card.artId === useArtStore().current.id ? 0 : 1;\n }\n\n function artName(card: LinkableCardWithBoardId) {\n return useArtStore().artById(card.artId)?.name;\n }\n\n function teamName(card: LinkableCardWithBoardId) {\n return useTeamStore().findTeam({ id: card.team?.id })?.name;\n }\n\n function text(card: LinkableCardWithBoardId) {\n return card.text.toLowerCase();\n }\n }\n\n function getCurrentLevelBoards(): Board[] {\n switch (searchContext.level) {\n case \"solution-train\":\n return solutionLevelBoards();\n case \"art\":\n return artLevelBoards(searchContext.id);\n case \"team\":\n return teamLevelBoards(searchContext.id);\n case \"none\":\n return [];\n }\n }\n\n function solutionLevelBoards(): Board[] {\n return useBoardsStore().hasSolutionBacklogBoard\n ? boardTypes.filter(isSolutionBoard).map((type) => useBoardsStore().boardByType(type))\n : [];\n }\n\n function artLevelBoards(artId: string): Board[] {\n return boardTypes\n .filter(isArtBoard)\n .map((type) => useBoardsStore().boardByType(type, { artId }));\n }\n\n function teamLevelBoards(teamId: string): Board[] {\n return boardTypes\n .filter(isTeamBoard)\n .map((type) => useBoardsStore().boardByType(type, { teamId }));\n }\n\n function removeDuplicatedStickies(\n stickies: LinkableCardWithBoardId[],\n ): LinkableCardWithBoardId[] {\n const groupTracker = new Map();\n\n stickies.forEach((sticky) => {\n const { groupId, id } = sticky;\n\n if (!groupId) {\n // Stickies without groupId should be kept as they are unique.\n groupTracker.set(id, sticky);\n return;\n }\n\n const existingSticky = groupTracker.get(groupId);\n if (!existingSticky || (id === groupId && existingSticky.id !== groupId)) {\n groupTracker.set(groupId, sticky);\n }\n });\n\n return Array.from(groupTracker.values());\n }\n\n function isNotTargetGroup(card: SearchResult) {\n return !targetCards.some(\n (target) => (target.groupId ?? target.id) === (card.groupId ?? card.id),\n );\n }\n\n function makeLinkableCard(card: SearchResult): LinkableCardWithBoardId {\n const type = useStickyTypeStore().findStickyType(card.typeId);\n const getTeam = (id: string | undefined): Team | undefined =>\n id ? useTeamStore().findTeam({ id }) : undefined;\n const linked = targetCards.every((c) => !!linkBetween(c, card));\n return {\n kind: \"sticky\",\n linked,\n id: card.id,\n text: card.text,\n boardId: card.boardId,\n groupId: card.groupId,\n type: type,\n flag: card.flag,\n iteration: useSessionStore().getIterationById(card.iterationId),\n team: getTeam(card.teamId),\n artId: card.artId ?? undefined,\n almId: card.almId,\n status: card.status,\n points: card.points || 0,\n precondTeam: getTeam(card.precondTeamId),\n dependTeam: getTeam(card.dependTeamId),\n };\n }\n}\n","\n\n\n\n\n","\n\n\n\n\n","import { noop, sortBy } from \"lodash-es\";\n\nimport { sender } from \"@/backend/Sender\";\nimport MirrorModal from \"@/components/modal/MirrorModal.vue\";\nimport TeamModal from \"@/components/modal/TeamModal.vue\";\nimport StickyLinkModal from \"@/components/modal/stickyLink/StickyLinkModal.vue\";\nimport { alignCards, distributeCards, lineupCards } from \"@/components/utils/layout\";\nimport type { ExecutionMode } from \"@/model/action\";\nimport type { Board } from \"@/model/board\";\nimport type { PositionedCard } from \"@/model/card\";\nimport type { Team } from \"@/model/session\";\nimport { fullUrl } from \"@/router/navigation\";\nimport { useBoardStore } from \"@/store/board\";\nimport { useBoardsStore } from \"@/store/boards\";\nimport { useCardStore } from \"@/store/card\";\nimport { useClientSettingsStore } from \"@/store/clientSettings\";\nimport { useSelectionStore } from \"@/store/selection\";\nimport { i18n } from \"@/translations/i18n\";\nimport { ensureResolve } from \"@/utils/async/utils\";\n\nimport { action, ctxAction, defineActions, previewAction } from \"./actions\";\nimport type { CardCreateProps } from \"./addCard\";\nimport { boardActions } from \"./boardActions\";\nimport { cardActions } from \"./cardActions\";\nimport { linkActions } from \"./linkActions\";\nimport { navigationActions } from \"./navigationActions\";\nimport type { ActionContext } from \"./types\";\n\ninterface MirroringState {\n id: string;\n teamId: string | null;\n mirroredId: string | undefined;\n}\n\nexport const selectionActions = defineActions(\"selection\", {\n alignHorizontal: previewAction(alignHorizontal, {\n name: /*$t*/ \"action.alignHorizontal\",\n icon: \"selection/align-horizontal\",\n }),\n alignVertical: previewAction(alignVertical, {\n name: /*$t*/ \"action.alignVertical\",\n icon: \"selection/align-vertical\",\n }),\n distributeHorizontal: previewAction(distributeHorizontal, {\n name: /*$t*/ \"action.distributeHorizontal\",\n icon: \"selection/distribute-horizontal\",\n }),\n distributeVertical: previewAction(distributeVertical, {\n name: /*$t*/ \"action.distributeVertical\",\n icon: \"selection/distribute-vertical\",\n }),\n lineup: previewAction(lineup, {\n name: /*$t*/ \"action.lineup\",\n icon: \"selection/grid\",\n }),\n openLinkModal: ctxAction(openLinkModal, {\n name: /*$t*/ \"action.linkMultiple\",\n icon: \"action/link\",\n }),\n link: ctxAction(link),\n openMirrorModal: ctxAction((ctx) => navigationActions.openModal(ctx, MirrorModal), {\n name: /*$t*/ \"action.mirrorMultiple\",\n icon: \"action/mirror\",\n }),\n mirror: ctxAction(mirror),\n openTeamModal: ctxAction((ctx) => navigationActions.openModal(ctx, TeamModal), {\n name: /*$t*/ \"action.team\",\n icon: \"org/team\",\n }),\n setTeam: ctxAction(setTeam),\n paste: ctxAction(paste),\n duplicate: ctxAction(duplicate),\n share: action(\n () =>\n navigator.clipboard.writeText(\n fullUrl({ stickyId: useBoardStore().selectedStickyIds.join(\",\") }),\n ),\n { name: /*$t*/ \"action.share\", icon: \"action/share\" },\n ),\n undo: action(() => useSelectionStore().undo(), { icon: \"arrow/undo\" }),\n});\n\nfunction alignHorizontal(ctx: ActionContext) {\n return useSelectionStore().execute(ctx.mode, {\n name: i18n.global.t(ctx.data.name),\n execute(mode) {\n const cards = useBoardStore().selectedStickies;\n moveCards(alignCards(cards, \"horizontal\"), mode);\n },\n saveState: saveCardPositions,\n resetToState: resetCardPositions,\n });\n}\n\nfunction alignVertical(ctx: ActionContext) {\n return useSelectionStore().execute(ctx.mode, {\n name: i18n.global.t(ctx.data.name),\n execute(mode) {\n const cards = useBoardStore().selectedStickies;\n moveCards(alignCards(cards, \"vertical\"), mode);\n },\n saveState: saveCardPositions,\n resetToState: resetCardPositions,\n });\n}\n\nfunction distributeHorizontal(ctx: ActionContext) {\n return useSelectionStore().execute(ctx.mode, {\n name: i18n.global.t(ctx.data.name),\n execute(mode) {\n const cards = useBoardStore().selectedStickies;\n moveCards(distributeCards(alignCards(cards, \"horizontal\"), \"horizontal\"), mode);\n },\n saveState: saveCardPositions,\n resetToState: resetCardPositions,\n });\n}\n\nfunction distributeVertical(ctx: ActionContext) {\n return useSelectionStore().execute(ctx.mode, {\n name: i18n.global.t(ctx.data.name),\n execute(mode) {\n const cards = useBoardStore().selectedStickies;\n moveCards(distributeCards(alignCards(cards, \"vertical\"), \"vertical\"), mode);\n },\n saveState: saveCardPositions,\n resetToState: resetCardPositions,\n });\n}\n\nfunction lineup(ctx: ActionContext) {\n return useSelectionStore().execute(ctx.mode, {\n name: i18n.global.t(ctx.data.name),\n execute(mode) {\n moveCards(\n lineupCards(\n useBoardStore().selectedStickies,\n useBoardStore().currentBoard().cardSize,\n 0.01 * useClientSettingsStore().initialLineupDistance,\n (pos) => useBoardStore().boardLocation(pos).bounds,\n ),\n mode,\n );\n },\n saveState: saveCardPositions,\n resetToState: resetCardPositions,\n });\n}\n\nfunction openLinkModal(ctx: ActionContext) {\n const cardIds = useBoardStore().selectedStickyIds;\n if (cardIds.length) {\n navigationActions.openModal(ctx, StickyLinkModal, {\n attrs: { cardIds },\n });\n }\n}\n\nfunction link(ctx: ActionContext) {\n const stateToBeSaved = useBoardStore().selectedStickies.map((card) => ({\n id: card.data.id,\n links: [...card.data.links],\n objectives: [...card.data.objectives],\n }));\n useSelectionStore().execute(\"normal\", {\n name: selectionActions.openLinkModal.data.name,\n execute() {\n // linking is done in LinkModal\n },\n saveState: () => stateToBeSaved,\n resetToState(cardStates) {\n for (const cardState of cardStates) {\n const card = useCardStore().cards[cardState.id];\n card.links.forEach((newLink) => {\n if (!cardState.links.some((oldLink) => oldLink.id === newLink.id)) {\n void linkActions.remove(ctx, newLink.id, newLink);\n }\n });\n cardState.links.forEach((oldLink) => {\n if (!card.links.some((newLink) => oldLink.id === newLink.id)) {\n void linkActions.add(ctx, { fromId: oldLink.from, toId: oldLink.to });\n }\n });\n card.objectives.forEach((newObj) => {\n if (!cardState.objectives.some((oldObj) => oldObj.id === newObj.id)) {\n void linkActions.removeObjective(\n ctx,\n card.id,\n useBoardStore().currentBoard().id,\n newObj.id,\n );\n }\n });\n cardState.objectives.forEach((oldObj) => {\n if (!card.objectives.some((newObj) => oldObj.id === newObj.id)) {\n void linkActions.addObjective(\n ctx,\n card.id,\n useBoardStore().currentBoard().id,\n oldObj.id,\n );\n }\n });\n }\n },\n });\n}\n\nfunction mirror(ctx: ActionContext, board: Board) {\n useSelectionStore().execute(\"normal\", {\n name: selectionActions.openMirrorModal.data.name,\n execute(_, cardStates) {\n ctx.track({});\n cardStates.forEach((cardState) => {\n void cardActions\n .mirror(ctx, cardState.id, cardState.teamId, board)\n .then((mirroredId) => (cardState.mirroredId = mirroredId));\n });\n },\n saveState: () =>\n useBoardStore().selectedStickies.map(\n (card): MirroringState => ({\n id: card.data.id,\n teamId: card.data.teamId,\n mirroredId: undefined,\n }),\n ),\n resetToState(cardStates) {\n cardStates.forEach((cardState) => {\n if (cardState.mirroredId) {\n cardActions.delete(ctx, cardState.mirroredId, board.id);\n }\n if (!cardState.teamId) {\n cardActions.setTeam(ctx, cardState.id, null);\n }\n });\n },\n });\n}\n\nfunction setTeam(ctx: ActionContext, team: Team) {\n useSelectionStore().execute(\"normal\", {\n name: selectionActions.setTeam.data.name,\n execute() {\n ctx.track({});\n useBoardStore().selectedStickyIds.forEach((id) => {\n cardActions.setTeamAction(ctx, id, team.id);\n });\n },\n saveState: () =>\n useBoardStore().selectedStickies.map((card) => ({\n id: card.data.id,\n teamId: card.data.teamId,\n iterationId: card.data.iterationId,\n })),\n resetToState(cardStates) {\n cardStates.forEach((cardState) => {\n cardActions.setTeam(ctx, cardState.id, cardState.teamId);\n cardActions.setIteration(ctx, cardState.id, cardState.iterationId);\n });\n },\n });\n}\n\nfunction paste(ctx: ActionContext, cards: CardCreateProps[]) {\n useSelectionStore().execute(\"normal\", {\n name: cardActions.pasteMultiple.data.name,\n async execute(mode, state) {\n state.push(...(await cardActions.pasteMultiple(ctx, cards)));\n },\n saveState: () => new Array(),\n resetToState(cardStates) {\n cardStates.forEach((cardState) => {\n cardActions.delete(ctx, cardState, useBoardStore().currentBoard().id);\n });\n },\n });\n}\n\nfunction duplicate(ctx: ActionContext, cardIds: string[]) {\n useSelectionStore().execute(\"normal\", {\n name: cardActions.duplicate.data.name,\n execute() {\n //cards are already duplicated, just register the action for undo\n },\n saveState: () => cardIds,\n resetToState(cardStates) {\n cardStates.forEach((cardState) => {\n cardActions.delete(ctx, cardState, useBoardStore().currentBoard().id);\n });\n },\n });\n}\n\nfunction moveCards(cards: PositionedCard[], mode: ExecutionMode) {\n void setCardPositions(cards, mode);\n if (mode !== \"preview\") {\n toFront(cards);\n }\n}\n\nfunction saveCardPositions(): PositionedCard[] {\n return useBoardStore().selectedStickies.map((card) => ({\n data: { id: card.data.id },\n meta: { pos: { ...card.meta.pos } },\n }));\n}\n\nfunction resetCardPositions(cardStates: PositionedCard[]) {\n return setCardPositions(cardStates, \"normal\");\n}\n\nfunction setCardPositions(cards: PositionedCard[], mode: ExecutionMode) {\n const boardId = useBoardStore().currentBoard().id;\n return ensureResolve((resolver) => {\n cards.forEach((card, index) => {\n if (mode !== \"confirm\") {\n const pos = { id: card.data.id, boardId, ...card.meta.pos };\n useBoardsStore().setCardPos(pos, index === cards.length - 1 ? resolver() : noop);\n }\n if (mode !== \"preview\") {\n sender.moveCard(boardId, card.data.id, card.meta.pos);\n }\n });\n });\n}\n\nfunction toFront(cards: PositionedCard[]) {\n sortBy(\n cards,\n (card) => card.meta.pos.y,\n (card) => card.meta.pos.x,\n ).forEach((card) => boardActions.cardToFront(\"internal\", card.data.id));\n}\n","import { noop } from \"lodash-es\";\n\nimport { sender } from \"@/backend/Sender\";\nimport type CardFlag from \"@/model/CardFlag\";\nimport type { AlmSourceId, RiskType } from \"@/model/baseTypes\";\nimport type { Board } from \"@/model/board\";\nimport type { Card, Reaction } from \"@/model/card\";\nimport type { RelativeCoordinate } from \"@/model/coordinates\";\nimport type { Team } from \"@/model/session\";\nimport type { TargetStatus } from \"@/model/status\";\nimport type { StickyType } from \"@/model/stickyType\";\nimport type { AuthUser } from \"@/model/user\";\nimport { fullUrl } from \"@/router/navigation\";\nimport { useActivityStore } from \"@/store/activity\";\nimport { useBoardStore } from \"@/store/board\";\nimport { useBoardsStore } from \"@/store/boards\";\nimport { useCardStore } from \"@/store/card\";\nimport { NO_TEAM, useTeamStore } from \"@/store/team\";\n\nimport { action, ctxAction, defineActions } from \"./actions\";\nimport type { CardCreateProps } from \"./addCard\";\nimport { addCard, cardCreateProps, startAddCard } from \"./addCard\";\nimport { boardActions } from \"./boardActions\";\nimport { selectionActions } from \"./selectionActions\";\nimport type { ActionContext } from \"./types\";\n\nexport const cardActions = defineActions(\"card\", {\n add: ctxAction(startAddCard, { name: /*$t*/ \"contextMenu.createNew\" }),\n togglePalette: action(noop, {\n icon: \"action/add-new\",\n name: /*$t*/ \"action.addSticky\",\n }),\n copy: action(noop),\n paste: ctxAction(startAddCard),\n pasteMultiple: action(addMultipleCards, { name: /*$t*/ \"action.paste\" }),\n pasteText: ctxAction(startAddCard),\n duplicate: ctxAction(duplicate, { name: /*$t*/ \"action.duplicate\" }),\n delete: action((id: string, boardId: string) => {\n if (useCardStore().delete({ id, boardId })) {\n sender.deleteCard(boardId, id);\n }\n }),\n\n mirror: ctxAction((ctx, id: string, teamId: string | null, board: Board) => {\n ctx.track({\n functionality: useCardStore().cards[id].type.functionality,\n fromBoard: useBoardStore().currentBoard().type,\n toBoard: board.type,\n });\n if (!teamId && board.type === \"team\") {\n cardActions.setTeam(\"internal\", id, board.team.id);\n }\n return sender.mirror(id, board.id);\n }),\n\n move: action((id: string, teamId: string) => sender.move(id, teamId)),\n\n toProgram: action((id: string) => sender.mirror(id, useBoardsStore().boardByType(\"program\").id)),\n\n toSolution: action((id: string) =>\n sender.mirror(id, useBoardsStore().boardByType(\"solution\").id),\n ),\n\n toRisk: action((id: string, teamId: string) => {\n const boardId = useBoardsStore().boardByType(\"risk\", {\n artId: useTeamStore().current.artId,\n }).id;\n const card = useCardStore().cards[id];\n sender.toRisk(id, boardId, card.text, card.type.id, teamId);\n }),\n\n toggleReaction: action(async (cardId: string, reaction: Reaction) => {\n if (useCardStore().hasCurrentUserReaction(cardId, reaction)) {\n await sender.removeReaction(cardId, reaction);\n } else {\n await sender.addReaction(cardId, reaction);\n }\n }),\n\n startAlter: action((id: string) => sender.startAlterCard(useBoardStore().currentBoard().id, id)),\n\n stopAlter: action((id: string) => {\n const card = useBoardStore().currentBoard().cards[id];\n // could have just been deleted\n // don't stop alter when card is selected\n if (card && !useBoardStore().isStickySelected(id)) {\n sender.stopAlterCard(useBoardStore().currentBoard().id, id, {\n type: card.data.type,\n x: card.meta.pos.x,\n y: card.meta.pos.y,\n });\n }\n }),\n\n setAlmSource: ctxAction((ctx, card: Card, almSourceId: AlmSourceId | null) => {\n useCardStore().setAlmSource({ id: card.id, almSourceId });\n sender.alterCard(useBoardStore().currentBoard().id, card.id, { almSourceId });\n ctx.track({ functionality: card.type.functionality });\n }),\n\n setPriority: ctxAction((ctx, card: Card, priority: number, priorities?: boolean) => {\n ctx.track({ functionality: card.type.functionality });\n const { use, priority: prio } = useCardStore().setPriority({\n id: card.id,\n priority,\n priorities,\n });\n alterCard(useBoardStore().currentBoard().id, card.id, { id: card.id, priority: prio }, use);\n }),\n\n setPoints: ctxAction((ctx, card: Card, points: number) => {\n useCardStore().setPoints({ id: card.id, points });\n alterCard(useBoardStore().currentBoard().id, card.id, { points });\n ctx.track({ functionality: card.type.functionality });\n }),\n\n setFlag: action((id: string, flagType: CardFlag) => {\n useCardStore().setFlag({ id, flagType });\n alterCard(useBoardStore().currentBoard().id, id, { flagType });\n }),\n\n setRisk: action((id: string, risk: RiskType) => {\n useCardStore().setRisk({ id, risk });\n alterCard(useBoardStore().currentBoard().id, id, { risk });\n }),\n\n setText: action(\n (id: string, text: string) => {\n useCardStore().setText({ id, text });\n sender.alterCard(useBoardStore().currentBoard().id, id, { text });\n },\n { history: { merge: true, saveState: (id) => ({ id }) } },\n ),\n\n setIteration: action((id: string, iterationId: number | null) => {\n if (useCardStore().setIteration({ id, iterationId })) {\n sender.alterCard(useBoardStore().currentBoard().id, id, { iterationId });\n }\n }),\n\n setTeam: action((cardId: string, teamId: string | null) => {\n useCardStore().setTeam({ id: cardId, teamId });\n alterCard(useBoardStore().currentBoard().id, cardId, { teamId });\n }),\n\n setTeamAction: action((id: string, teamId: string) => {\n if (teamId === NO_TEAM.id) {\n cardActions.setTeam(\"internal\", id, null);\n cardActions.setIteration(\"internal\", id, null);\n } else {\n cardActions.setTeam(\"internal\", id, teamId);\n }\n }),\n\n setDepend: ctxAction((ctx, id: string, team: Team | null) => {\n const { board, card } = useCardStore().setDependAction({\n id,\n teamId: team?.id || NO_TEAM.id,\n });\n sender.mirror(id, board.id, {\n flagType: card.flagType,\n precondTeam: card.precondTeam,\n dependTeam: card.dependTeam,\n });\n alterCard(useBoardStore().currentBoard().id, id, {\n flagType: card.flagType,\n precondTeam: card.precondTeam,\n dependTeam: card.dependTeam,\n });\n\n ctx.track({\n functionality: card.type.functionality,\n isSameArt: card.artId === team?.artId,\n });\n }),\n\n setArt: action((id: string, artId: string | null) => {\n useCardStore().setArt({ id, artId });\n alterCard(useBoardStore().currentBoard().id, id, { artId });\n }),\n\n setAssignee: action((id: string, assignee: AuthUser | null) => {\n useCardStore().setAssignee(id, assignee);\n alterCard(useBoardStore().currentBoard().id, id, { assignee });\n }),\n\n setType: ctxAction((ctx, card: Card, type: StickyType) => {\n ctx.track({\n fromFunctionality: card.type.functionality,\n toFunctionality: type.functionality,\n });\n\n const { board, props, priorities } = useCardStore().setType({\n id: card.id,\n type: type.id,\n });\n sender.alterCard(board.id, card.id, props, priorities);\n }),\n\n setStatus: ctxAction((ctx, board: Board, card: Card, target: TargetStatus) => {\n ctx.track({\n functionality: card.type.functionality,\n fromStatus: card.status?.statusClass || \"undefined\",\n toStatus: target.status.statusClass,\n });\n const status = useCardStore().setStatus(board, card.id, target.status.name, {\n transition: target.transition.id,\n });\n alterCard(board.id, card.id, {\n status,\n transition: target.transition.id,\n });\n }),\n\n // the actual moving is done continuously by mouse dragging\n // we need this here to track the action\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n setPosition: action((_: string[]) => {}, {\n history: { merge: true, saveState: (ids) => ({ id: ids.join(\"-\") }) },\n }),\n\n toggleActivity: action((id: string) => useActivityStore().toggleCard(id)),\n\n /**\n * When 1 card is selected, open the assignee dropdown\n * by clicking on the chip (if it exists)\n */\n openAssigneeDropdown: ctxAction(\n (ctx) => {\n const cardIds = useBoardStore().selectedStickyIds;\n if (cardIds.length === 1) {\n const chipEl = document.getElementById(assigneeChipId(cardIds[0]));\n chipEl?.click();\n } else {\n ctx.track(null);\n }\n },\n { name: /*$t*/ \"action.assign\" },\n ),\n shareLink: action((card: Card) => navigator.clipboard.writeText(fullUrl({ stickyId: card.id }))),\n shareAlmLink: action((card: Card) => navigator.clipboard.writeText(card.almIssueUrl!)),\n shareAlmId: action((card: Card) => navigator.clipboard.writeText(card.almId!)),\n});\n\nasync function duplicate(ctx: ActionContext) {\n const cards = useBoardStore().selectedOrActiveStickies;\n if (cards.length === 1) {\n ctx.track({ functionality: cards[0].data.type.functionality });\n startAddCard(ctx, cardCreateProps(cards[0], { findFreePos: true }), true);\n } else {\n const ids = await addMultipleCards(cards.map((card) => cardCreateProps(card)));\n selectionActions.duplicate(ctx, ids);\n }\n}\n\nexport const assigneeChipId = (cardId: string) => `${cardId}-assignee-chip`;\n\nasync function addMultipleCards(cards: CardCreateProps[]) {\n boardActions.clearCardSelection(\"internal\");\n return await Promise.all(\n cards.map(async (card) => {\n const id = await addCard(card, false);\n useBoardStore().selectSticky(id);\n return id;\n }),\n );\n}\n\n/**\n * If the card is currently locked by the user (editing or selected),\n * send alterCard. Otherwise, send stopAlterCard.\n *\n * This ensures that the changes are persisted, but the card isn't unlocked accidentally\n */\nexport function alterCard(\n boardId: string,\n id: string,\n props: Partial,\n priorities?: boolean,\n) {\n if (useBoardStore().isStickyIdSelectedOrActive(id)) {\n sender.alterCard(boardId, id, props, priorities);\n } else {\n sender.stopAlterCard(boardId, id, props);\n }\n}\n","import { nextTick, ref } from \"vue\";\n\nimport { boardActions } from \"@/action/boardActions\";\nimport { cardActions } from \"@/action/cardActions\";\nimport { sender } from \"@/backend/Sender\";\nimport type { CardMetaInjected } from \"@/components/card/injectKeys\";\nimport { cardInsideBoardRelative } from \"@/math/coordinate-systems\";\nimport { divided, plus, times } from \"@/math/coordinates\";\nimport type { Card } from \"@/model/card\";\nimport type { RelativeCoordinate } from \"@/model/coordinates\";\nimport { relativeCoord } from \"@/model/coordinates\";\nimport { useBoardStore } from \"@/store/board\";\nimport { useDraggingStore } from \"@/store/dragging\";\nimport { i18n } from \"@/translations/i18n\";\nimport {\n stickyNoteDragEnded,\n stickyNoteDragMoved,\n stickyNoteDragStarted,\n} from \"@/utils/analytics/events\";\nimport { trackEvent } from \"@/utils/analytics/track\";\nimport { terminateEvent } from \"@/utils/dom/dom\";\n\nexport type Props = Readonly<{\n card: Card;\n cardMeta: CardMetaInjected;\n deactivate: () => void;\n}>;\n\nexport function useKeyboardDrag({ card, cardMeta, deactivate }: Props) {\n const { t } = i18n.global;\n const moveMode = ref(false);\n const screenReaderMessage = ref(\"\");\n const boardStore = useBoardStore();\n\n /**\n * Treat the user moving the sticky by keyboard as a drag operation\n * (so eg. the action menu is hidden)\n */\n const startMove = () => {\n cardActions.startAlter(\"drag\", card.id);\n boardActions.cardToFront(\"internal\", card.id);\n screenReaderMessage.value = t(\"label.moveSticky.controlsActivated\");\n trackEvent(stickyNoteDragStarted(\"accessibility-controls\"));\n\n useDraggingStore().startCardDragging(card.id, {}, cardMeta.pos);\n moveMode.value = true;\n };\n /**\n * Returns the current position of the sticky note, taking into account the current drag position\n */\n const getCurrentPos = (): RelativeCoordinate => {\n const dragCoords = { ...useDraggingStore().findById(card.id)?.pos };\n return relativeCoord(dragCoords.x || cardMeta.pos.x, dragCoords.y || cardMeta.pos.y);\n };\n\n /**\n * Key handler for the sticky note accessibility controls\n * If user is in moveMode, passes the event to handleMoveKey\n * Otherwise:\n * - Enter/Space/M: Start moving the sticky note\n * - Escape: Deactivate (focus on sticky)\n */\n const handleKeydown = (event: KeyboardEvent) => {\n if (moveMode.value) {\n event.preventDefault();\n event.stopImmediatePropagation();\n\n handleMoveKey(event);\n } else if ([\"Enter\", \" \", \"m\"].includes(event.key)) {\n terminateEvent(event);\n startMove();\n } else if (event.key === \"Escape\") {\n terminateEvent(event);\n deactivate();\n }\n };\n\n /**\n * Handle the keyboard interaction while user is moving the sticky note\n * - Escape: Cancel the move (reset to original position)\n * - Enter/Space: Save the new position and stop dragging\n * - M: Stop dragging, save the new position, and focus on the sticky\n * - Arrow keys: Move the sticky note in the given direction\n */\n const handleMoveKey = (event: KeyboardEvent) => {\n switch (event.key) {\n case \"Escape\":\n useDraggingStore().dragCard(card.id, cardMeta.pos);\n stopMove();\n screenReaderMessage.value = t(\"label.moveSticky.moveCancelled\");\n break;\n case \"Enter\":\n case \" \":\n stopMove();\n break;\n case \"m\":\n // Save the new position, stop dragging, and focus on the sticky\n stopMove();\n deactivate();\n break;\n case \"ArrowUp\":\n moveSticky(0, -1);\n break;\n case \"ArrowDown\":\n moveSticky(0, 1);\n break;\n case \"ArrowLeft\":\n moveSticky(-1, 0);\n break;\n case \"ArrowRight\":\n moveSticky(1, 0);\n break;\n default:\n break;\n }\n };\n\n /**\n * Move the sticky note in the given direction\n * (in increments of 1/3 of the current card size)\n * and announce the change to screen reader users\n */\n const moveSticky = (x: number, y: number) => {\n const distance = divided(boardStore.currentBoard().cardSize, 3);\n const currentPos = getCurrentPos();\n const movedPos = plus(currentPos, times(relativeCoord(x, y), distance.x, distance.y));\n const [newPos, delta] = cardInsideBoardRelative(movedPos);\n\n sender.moveCard(useBoardStore().currentBoard().id, card.id, newPos);\n useDraggingStore().dragCard(card.id, newPos);\n\n trackEvent(stickyNoteDragMoved(\"accessibility-controls\"));\n\n /*\n Finally, communicate the changes to screen-reader users\n */\n\n const originalSection = boardStore.boardLocation(currentPos);\n const newSection = boardStore.boardLocation(newPos);\n\n const reachedEdge = delta.x || delta.y;\n\n // If the sticky note is moved into a new section, announce it\n if (originalSection.index().toString() !== newSection.index().toString()) {\n screenReaderMessage.value = t(\"label.moveSticky.intoSection\", {\n from: originalSection.name,\n to: newSection.name,\n });\n } else if (reachedEdge) {\n // If the sticky note is at the edge of the board, let the user know\n screenReaderMessage.value = t(\"label.moveSticky.edgeOfBoard\");\n } else {\n // otherwise announce how far across the board the sticky is\n const left = Math.round(newPos.x * 100);\n const top = Math.round(newPos.y * 100);\n const msgPosition = { top, left, section: newSection.name };\n\n screenReaderMessage.value = t(\"label.moveSticky.moved\", msgPosition);\n }\n\n // Scroll the sticky note into view (after the new position is rendered)\n void nextTick(() => document.getElementById(card.id)?.scrollIntoView({ block: \"nearest\" }));\n };\n\n /**\n * If moving, end the drag operation and save the new position\n */\n const stopMove = () => {\n if (moveMode.value) {\n screenReaderMessage.value = t(\"label.moveSticky.controlsDeactivated\");\n const newPos = getCurrentPos();\n\n useDraggingStore().endCardDragging(card.id, newPos);\n sender.moveCard(boardStore.currentBoard().id, card.id, newPos);\n cardActions.stopAlter(\"internal\", card.id);\n trackEvent(stickyNoteDragEnded(\"accessibility-controls\"));\n } else {\n screenReaderMessage.value = \"\";\n }\n\n moveMode.value = false;\n };\n\n return { screenReaderMessage, moveMode, handleKeydown, startMove, stopMove };\n}\n","\n\n\n\n\n","import type { InjectionKey, Ref } from \"vue\";\n\nimport type { Shape } from \"@/model/shape\";\n\nexport const shapeKey: InjectionKey>> = Symbol(\"shape\");\n","\n\n\n\n\n","import { type MenuActionType } from \"@/components/card/actions\";\nimport type { Board } from \"@/model/board\";\nimport type { Card } from \"@/model/card\";\nimport { isDependency, isRisk } from \"@/model/stickyType\";\nimport { useBoardsStore } from \"@/store/boards\";\nimport { useServerSettingsStore } from \"@/store/serverSettings\";\n\ntype ActionMenuAction = Omit;\n\nconst flexBoardActions = [\"delete\", \"link\", \"activity\"];\n\n// actions visible on the ART Risk board\nconst artRiskBoardActions = [\n \"delete\",\n \"almSource\", // project\n \"mirror\",\n \"link\",\n \"activity\",\n];\n\n// actions visible on the ART Backlog board\nconst artBacklogBoardActions = [\n \"delete\",\n \"almSource\", // project\n \"mirror\",\n \"team\",\n \"link\",\n \"activity\",\n];\n\n// actions visible on the ART Planning board\nconst artPlanningBoardActions = [\n \"delete\",\n \"almSource\", // project\n \"mirror\",\n \"link\",\n \"activity\",\n];\n\n// actions visible on the Solution Planning board\nconst solutionPlanningBoardActions = [\n \"delete\",\n \"almSource\", // project\n \"mirror\",\n \"link\",\n \"activity\",\n];\n\n// actions visible on the Solution Backlog board\nconst solutionBacklogBoardActions = [\"delete\", \"almSource\", \"mirror\", \"art\", \"link\", \"activity\"];\n\nconst teamBaseActions = [\"delete\", \"almSource\", \"move\", \"link\", \"activity\"];\nconst teamBoardDefaultActions = [...teamBaseActions, \"mirror\"];\nconst teamRiskActions = [...teamBaseActions, \"mirror\"];\nconst teamDependActions = [...teamBaseActions, \"program\"];\nconst teamProgramActions = [...teamBaseActions, \"depend\"];\n\nconst cardWasCreatedOnDifferentTeamBoard = (card: Card, board: Board) => {\n return card.precondTeam && (board.type !== \"team\" || card.precondTeam.id !== board.team.id);\n};\n\nexport const cardWasCreatedOnDifferentBoard = (card: Card, board: Board) => {\n return card.type.origin !== board.type || cardWasCreatedOnDifferentTeamBoard(card, board);\n};\n\n/**\n * Actions that a sticky note can have depending on the board type\n */\nconst getActionsByBoardType = (card: Card, board: Board): ActionMenuAction[] => {\n switch (board.type) {\n case \"solution\":\n return solutionPlanningBoardActions;\n case \"solution_backlog\":\n return solutionBacklogBoardActions;\n case \"risk\":\n return artRiskBoardActions;\n case \"backlog\":\n return artBacklogBoardActions;\n case \"flex\":\n return flexBoardActions;\n case \"program\":\n return artPlanningBoardActions;\n case \"team\":\n return teamBoardActions(card);\n default:\n return [];\n }\n};\n\nconst teamBoardActions = (card: Card): ActionMenuAction[] => {\n switch (card.type.functionality) {\n case \"risk\":\n return teamRiskActions;\n case \"dependency\":\n return card.dependTeam ? teamDependActions : teamProgramActions;\n default:\n return teamBoardDefaultActions;\n }\n};\n\nexport const isStickyMovable = (card: Card, board: Board) => {\n const isOnOriginBoard = card.type.origin === board.type; // sticky note was created on this board\n const moveBetweenTeams = useServerSettingsStore().moveBetweenTeams; // is allowed to be moved in the cockpit\n\n return isOnOriginBoard && (moveBetweenTeams || isRisk(card)) && !isDependency(card);\n};\n\nexport const isStickyMirrorable = (card: Card) => {\n return useBoardsStore().mirrorTargetBoards([card]).length;\n};\n\n/**\n * Determines if specific action should be visible in the action menu\n */\nexport const isActionVisible = (action: ActionMenuAction, card: Card, board: Board): boolean => {\n if (!card || !board) return false;\n return getActionsByBoardType(card, board).includes(action);\n};\n","\n\n\n\n\n","\n\n\n","\n\n\n","\n\n\n","\n\n\n\n\n","\n\n\n","\n\n\n","\n\n\n","\n\n\n","\n\n\n\n\n","\n\n\n","\n\n\n","\n\n\n\n\n","\n\n\n","\n\n\n","\n\n\n","\n\n\n","\n\n\n","\n\n\n\n\n","\n\n\n","\n\n\n","\n\n\n","\n\n\n","\n\n\n","\n\n\n","\n\n\n","\n\n\n\n\n","\n\n\n","\n\n\n","\n\n\n","\n\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","export const toElipsis = (value: string) => (value.length > 2 ? \"...\" : value);\n","\n\n\n\n\n","\n\n\n","\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n","export type MarkMode =\n | \"normal\"\n | \"highlight\"\n | \"fade-out\"\n | \"semi-fade-out\"\n | \"filter-out\"\n | \"hidden\";\n\nexport function isFullyFaded(mode: MarkMode) {\n return mode === \"fade-out\" || mode === \"filter-out\";\n}\n\nexport function isFaded(mode: MarkMode) {\n return isFullyFaded(mode) || mode === \"semi-fade-out\";\n}\n\n/**\n * Return the 'mark' of the most visible mode\n */\nexport function minFaded(a: MarkMode, b: MarkMode): \"fade-out\" | \"semi-fade-out\" | \"normal\" {\n if (!isFaded(a) || !isFaded(b)) {\n return \"normal\";\n }\n if (!isFullyFaded(a) || !isFullyFaded(b)) {\n return \"semi-fade-out\";\n }\n return \"fade-out\";\n}\n","\n\n\n\n","import type { Ref } from \"vue\";\nimport { onUnmounted, ref, watch } from \"vue\";\nimport type { TippyOptions } from \"vue-tippy\";\nimport { useTippy } from \"vue-tippy\";\n\nimport { useModalStore } from \"@/store/modal\";\n\nexport type TooltipProp = TippyOptions | TippyOptions[\"content\"] | undefined;\n\ntype Props = Readonly<{\n el: Ref;\n tooltip: Ref;\n aria?: TippyOptions[\"aria\"];\n}>;\n\nexport function useTooltip({ el, tooltip, aria }: Props) {\n const tippyRef = ref>();\n\n onUnmounted(() => {\n tippyRef.value?.destroy();\n });\n\n watch(\n [tooltip, el],\n ([newTooltip, newEl]) => {\n if (!newTooltip) return;\n\n // note: even though typescript tells us that the value of\n // tippyRef.value.state is a 'Ref' this is not the case.\n\n const opts = getTippyOpts(newTooltip, newEl, aria);\n if (tippyRef.value) {\n tippyRef.value.setProps(opts);\n } else {\n tippyRef.value = useTippy(el, opts);\n }\n },\n { immediate: true, deep: true },\n );\n\n return tippyRef.value;\n}\n\nconst getTippyOpts = (tooltip: TooltipProp, el?: HTMLElement, aria?: TippyOptions[\"aria\"]) => {\n const opts: TippyOptions = { delay: [500, 0], animation: false };\n\n opts.onShow = () => {\n // Prevent tooltip from showing if modal is open and tooltip is outside the modal\n if (useModalStore().isModalOpen() && !isTooltipWithinModal(el)) {\n return false;\n }\n };\n\n if (typeof tooltip === \"object\" && \"content\" in tooltip) {\n Object.assign(opts, tooltip);\n } else {\n Object.assign(opts, { content: tooltip });\n }\n\n if (aria) {\n opts.aria = aria;\n }\n\n return opts;\n};\n\nconst isTooltipWithinModal = (el: HTMLElement | undefined): boolean => {\n if (!el) return false;\n\n const baseModalElement = document.getElementById(\"base-modal\");\n return baseModalElement?.contains(el) ?? false;\n};\n","\n\n\n\n\n","\n\n\n","\n\n\n\n\n","\n\n\n","\n\n\n\n\n","import { useI18n } from \"vue-i18n\";\n\nimport { getAlmInfo } from \"@/backend/Backend\";\nimport type { AuthUser } from \"@/model/user\";\nimport { isUnknownUser } from \"@/model/user\";\n\nexport function useUser() {\n const { t } = useI18n();\n\n function userName(user: AuthUser | null, fallback: string): string;\n function userName(user: AuthUser): string;\n function userName(user: AuthUser | null, fallback?: string) {\n if (!user) {\n return fallback;\n }\n return isUnknownUser(user)\n ? t(\"boardUsers.unknown\")\n : user.almMapping === \"alm-only\"\n ? t(\"assignee.unknownAlmUser\", { almType: getAlmInfo().name })\n : user.name;\n }\n\n return { userName };\n}\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","import { nextTick } from \"vue\";\n\nexport function animateCopy(\n el: Element,\n animationClass: string,\n started?: (el: HTMLElement) => void,\n) {\n void nextTick(() => {\n const copy = el.cloneNode(true) as HTMLElement;\n copy.querySelectorAll(\"[data-no-animate]\").forEach((e) => e.parentElement!.removeChild(e));\n const parent = el.parentElement!;\n parent.appendChild(copy);\n setTimeout(() => {\n started?.(copy);\n copy.classList.add(animationClass);\n }, 20);\n setTimeout(() => parent.removeChild(copy), 1000);\n });\n}\n","\n\n\n\n\n\n\n","\n\n\n","import { reactive } from \"vue\";\n\nimport { hasMappedAlmUser, isSessionAlmSynced } from \"@/backend/Backend\";\nimport { MINUTES } from \"@/model/Settings\";\nimport type { Team } from \"@/model/session\";\nimport type { AuthUser } from \"@/model/user\";\nimport { SimpleCache } from \"@/utils/SimpleCache\";\n\nimport type { UserWithTeams } from \"./userAdmin.service\";\n\nconst almMappingCache = new SimpleCache({ timeout: 60 * MINUTES });\n\nasync function almMapping(id: string) {\n if (!isSessionAlmSynced()) {\n return \"complete\";\n }\n const isMapped = await almMappingCache.loadItem(id, () => hasMappedAlmUser(id));\n return isMapped ? \"complete\" : \"pip-only\";\n}\n\nexport async function addAlmMapping(user: AuthUser, teams?: Team[]): Promise {\n return {\n ...user,\n almMapping: await almMapping(user.id),\n teams: teams || [],\n };\n}\n\nexport function addReactiveAlmMapping(user: T): T {\n if (user.almMapping === \"alm-only\") {\n return user;\n }\n const res = reactive({ ...user, almMapping: \"complete\" }) as T;\n void almMapping(user.id).then((mapping) => (res.almMapping = mapping));\n return res;\n}\n","import { mapUser, mapUserTeams } from \"@/backend/mapper/mapBackendData\";\nimport type { ServerAuthUser, ServerUserTeam } from \"@/backend/serverModel\";\nimport { MINUTES } from \"@/model/Settings\";\nimport type { Team } from \"@/model/session\";\nimport type { AuthUser } from \"@/model/user\";\nimport { SimpleCache } from \"@/utils/SimpleCache\";\nimport * as Environment from \"@/utils/env/Environment\";\n\nimport { createApiClient, modernInterceptor } from \"./api.config\";\nimport { addAlmMapping } from \"./userAlmMapping.service\";\n\nconst emptyListApi = modernInterceptor(createApiClient(Environment.authAPIUrl), {\n defaultValue: { results: [] },\n});\n\nexport type UserWithTeams = AuthUser & { teams: Team[] };\n\nexport async function searchUsers(query: string): Promise {\n const res = await emptyListApi.get(\"/v1/users/search\", { params: { query } });\n return await Promise.all(\n res.data.map((user: ServerAuthUser & { teams: ServerUserTeam[] }) =>\n addAlmMapping(mapUser(user), mapUserTeams(user.teams)),\n ),\n );\n}\n\nconst teamUsers = new SimpleCache({ timeout: 60 * MINUTES });\n\nexport async function usersInTeam(team: Team): Promise {\n return await teamUsers.loadItem(team.id, () => getUsersInTeam(team));\n}\n\nasync function getUsersInTeam(team: Team): Promise {\n const res = await emptyListApi.get(`/v1/teams/${team.id}/members`);\n return await Promise.all(res.data.map((user: ServerAuthUser) => addAlmMapping(mapUser(user))));\n}\n\nexport async function getUserTeams(userId: string): Promise {\n const res = await emptyListApi.get(`/v1/users/${userId}/teams`);\n return mapUserTeams(res.data);\n}\n","\n\n\n","\n\n\n\n\n","\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n","\n\n\n\n\n","\n\n\n","\n\n\n\n\n","\n\n\n","\n\n\n","\n\n\n\n\n","\n\n\n","\n\n\n","\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","import { defineStore } from \"pinia\";\n\nimport CardFlag from \"@/model/CardFlag\";\nimport type { InfoLevel, StatusClass } from \"@/model/baseTypes\";\nimport { statusClassNames, statusClasses } from \"@/model/baseTypes\";\nimport type { BoardCard } from \"@/model/card\";\nimport { statusClassColors } from \"@/model/colors\";\nimport type { Link } from \"@/model/link\";\nimport type { DependencyTeamFilter, DependencyTeamItem } from \"@/model/search\";\nimport type { Art, Iteration, Team } from \"@/model/session\";\nimport type { StickyType } from \"@/model/stickyType\";\nimport { isDependency } from \"@/model/stickyType\";\nimport type { AuthUser } from \"@/model/user\";\nimport { i18n } from \"@/translations/i18n\";\nimport { toCssColor, white } from \"@/utils/color\";\n\nimport { NO_ART, useArtStore } from \"./art\";\nimport { useBoardStore } from \"./board\";\nimport { useSessionStore } from \"./session\";\nimport { NO_TEAM, useTeamStore, userTeamsFirst } from \"./team\";\nimport { noUser, useUserStore } from \"./user\";\n\nexport const dependencyLinks = [\"Linked\", \"Not Linked\"];\nexport type DependencyLink = (typeof dependencyLinks)[number];\n\ninterface DependencyLinkItem {\n id: DependencyLink;\n name: string;\n}\n\nexport const dependencyLinkItems: DependencyLinkItem[] = [\n { id: \"Linked\", name: /*$t*/ \"dependency.linked\" },\n { id: \"Not Linked\", name: /*$t*/ \"dependency.notLinked\" },\n];\n\nexport const statusClassItems = statusClasses.map((statusClass) => ({\n id: statusClass,\n name: statusClassNames[statusClass],\n color: statusClassColors[statusClass],\n}));\n\nexport interface State {\n text: string;\n isSearchSidebarOpen: boolean; // Whether the search sidebar is open\n // (see anyFilterCriteria for whether there are any active filters / search terms)\n selectedStickyTypeIds: Set;\n selectedDependencyLink: Set;\n selectedDependencyTeamFilter: DependencyTeamFilter;\n selectedLinkStates: Set;\n selectedAssigneeIds: Set;\n selectedTeamIds: Set;\n selectedArtIds: Set;\n selectedIterationIds: Set;\n selectedFlagStrings: Set;\n selectedStatusClasses: Set;\n}\n\nexport const useSearchMenuStore = defineStore(\"searchMenu\", {\n state: (): State => {\n return {\n text: \"\",\n isSearchSidebarOpen: false,\n selectedStickyTypeIds: new Set(),\n selectedLinkStates: new Set(),\n selectedAssigneeIds: new Set(),\n selectedTeamIds: new Set(),\n selectedArtIds: new Set(),\n selectedIterationIds: new Set(),\n selectedFlagStrings: new Set(),\n selectedStatusClasses: new Set(),\n selectedDependencyLink: new Set(),\n selectedDependencyTeamFilter: \"IncomingAndOutgoing\",\n };\n },\n getters: {\n selectedRiskyLinks(state): InfoLevel[] {\n return Array.from(state.selectedLinkStates);\n },\n selectedStickyTypes(state): StickyType[] {\n return useBoardStore().possibleStickyTypes.filter((type) =>\n state.selectedStickyTypeIds.has(type.id),\n );\n },\n selectedDependencyLinks(state): DependencyLink[] {\n return Array.from(state.selectedDependencyLink);\n },\n selectedDependencyLinkItems(state) {\n return dependencyLinkItems.filter((item) => state.selectedDependencyLink.has(item.id));\n },\n isDependencySearch(state): boolean {\n return useBoardStore().possibleStickyTypes.some(\n (stickyType) =>\n stickyType.functionality === \"dependency\" &&\n state.selectedStickyTypeIds.has(stickyType.id),\n );\n },\n allAssignees(_state): AuthUser[] {\n const res: Record = {};\n const cards = useBoardStore().currentBoard().cards;\n for (const id in cards) {\n const a = cards[id].data.assignee;\n if (a) {\n res[a.id] = a;\n }\n }\n // Add the current user to the list of assignees\n // (so they can confirm they have no cards assigned)\n const currentUser = useUserStore().currentUser;\n if (currentUser) {\n res[currentUser.id] ??= currentUser;\n }\n\n return [...Object.values(res), noUser(toCssColor(white))];\n },\n selectedAssignees(state): AuthUser[] {\n return this.allAssignees.filter((assignee) => state.selectedAssigneeIds.has(assignee.id));\n },\n allTeams(_state): Team[] {\n return [\n ...useTeamStore().teamsInCurrentArt.toSorted(userTeamsFirst()),\n useTeamStore().noTeam,\n ];\n },\n selectedTeams(state): Team[] {\n return this.allTeams.filter((team) => state.selectedTeamIds.has(team.id));\n },\n effectiveTeamIds(): Set {\n return useBoardStore().currentBoard().type === \"solution\"\n ? this.teamIdsOfSelectedArts\n : this.selectedTeamIds;\n },\n teamIdsOfSelectedArts(state): Set {\n return new Set(\n useTeamStore()\n .teams.filter((team) => state.selectedArtIds.has(team.artId || \"\"))\n .map((team) => team.id),\n );\n },\n isTeamSelected() {\n return (teamId: Team[\"id\"] | undefined) => this.effectiveTeamIds.has(teamId || NO_TEAM.id);\n },\n allArts(_state): Art[] {\n return [...useArtStore().arts, useArtStore().noArt];\n },\n selectedArts(state): Art[] {\n return this.allArts.filter((art) => state.selectedArtIds.has(art.id));\n },\n isArtSelected() {\n return (artId: Art[\"id\"] | undefined) => this.selectedArtIds.has(artId || NO_ART.id);\n },\n flags(state) {\n return Array.from(state.selectedFlagStrings).map(CardFlag.fromFlagString);\n },\n statusClasses(state) {\n return Array.from(state.selectedStatusClasses);\n },\n selectedStatusClassItems(state) {\n return statusClassItems.filter((item) => state.selectedStatusClasses.has(item.id));\n },\n allIterations(): Iteration[] {\n return useSessionStore().iterations;\n },\n selectedIterations(state): Iteration[] {\n return this.allIterations.filter((iteration) => state.selectedIterationIds.has(iteration.id));\n },\n anyFilterCriteria(state) {\n return (\n state.text !== \"\" ||\n state.selectedStickyTypeIds.size !== 0 ||\n state.selectedLinkStates.size !== 0 ||\n state.selectedAssigneeIds.size !== 0 ||\n state.selectedTeamIds.size !== 0 ||\n state.selectedArtIds.size !== 0 ||\n state.selectedIterationIds.size !== 0 ||\n state.selectedFlagStrings.size !== 0 ||\n state.selectedStatusClasses.size !== 0\n );\n },\n dependencyFilterItems(state): DependencyTeamItem[] {\n return [\n {\n id: \"IncomingAndOutgoing\",\n name: i18n.global.t(\"dependencyTeamFilter.incomingAndOutgoing\"),\n },\n {\n id: \"Incoming\",\n name: i18n.global.t(\"dependencyTeamFilter.incoming\"),\n },\n {\n id: \"Outgoing\",\n name: i18n.global.t(\"dependencyTeamFilter.outgoing\"),\n },\n ...(state.selectedTeamIds.size < 2\n ? []\n : [\n {\n id: \"Mutual\" as DependencyTeamFilter,\n name: i18n.global.t(\"dependencyTeamFilter.mutual\"),\n },\n ]),\n ];\n },\n selectedDependencyFilterItem(state): DependencyTeamItem {\n return this.dependencyFilterItems.find(\n (item) => item.id === state.selectedDependencyTeamFilter,\n )!;\n },\n showDependencyTeamFilter(state): boolean {\n return this.isDependencySearch && state.selectedTeamIds.size > 0;\n },\n matchesLinkStates:\n (state) =>\n (link: Link, emptyMatch = false) => {\n const states = state.selectedLinkStates;\n return (emptyMatch && states.size === 0) || Array.from(states).some(matchesLinkState);\n\n function matchesLinkState(linkState: InfoLevel) {\n switch (linkState) {\n case \"default\":\n return true;\n case \"warn\":\n return link.state === \"warn\";\n case \"error\":\n return link.state === \"error\";\n }\n }\n },\n showCardLinks() {\n return (card: BoardCard) => {\n const acid = useBoardStore().activeCardId;\n const showForSelectedCard = acid === card.data.id;\n\n return (\n (isDependency(card.data) && this.isDependencySearch) ||\n showForSelectedCard ||\n card.meta.dragging ||\n card.meta.isHighlighted ||\n card.meta.isRelatedToHighlighted\n );\n };\n },\n },\n actions: {\n expandSearch() {\n this.isSearchSidebarOpen = true;\n },\n collapseSearch() {\n this.isSearchSidebarOpen = false;\n },\n toggleSearch() {\n this.isSearchSidebarOpen ? this.collapseSearch() : this.expandSearch();\n },\n resetCriteria() {\n this.text = \"\";\n this.selectedStickyTypeIds = new Set();\n this.selectedLinkStates = new Set();\n this.selectedAssigneeIds = new Set();\n this.selectedTeamIds = new Set();\n this.selectedArtIds = new Set();\n this.selectedIterationIds = new Set();\n this.clearFlags();\n this.selectedStatusClasses = new Set();\n this.selectedDependencyLink = new Set();\n this.selectedDependencyTeamFilter = \"IncomingAndOutgoing\";\n },\n toggleFlag(flag: CardFlag) {\n const flagString = flag.toString();\n if (this.selectedFlagStrings.has(flagString)) {\n this.selectedFlagStrings.delete(flagString);\n } else {\n this.selectedFlagStrings.add(flagString);\n }\n this.selectedFlagStrings = new Set(this.selectedFlagStrings);\n },\n clearFlags() {\n this.selectedFlagStrings = new Set();\n },\n // Filter setters\n selectIterations(iterations: Iteration[]) {\n this.selectedIterationIds = new Set(iterations.map((i) => i.id));\n },\n selectStickyTypes(stickyTypes: StickyType[]) {\n this.selectedStickyTypeIds = new Set(stickyTypes.map((t) => t.id));\n },\n },\n});\n","import type { Rectangle, RelativeCoordinate } from \"@/model/coordinates\";\nimport { relativeCoord } from \"@/model/coordinates\";\n\nimport { insideRectangle, minus } from \"./coordinates\";\n\nexport default class QuadraticSpline {\n static forLink(from: RelativeCoordinate, to: RelativeCoordinate) {\n return new QuadraticSpline(\n from,\n to,\n relativeCoord((from.x + to.x) / 2, Math.max(from.y, to.y) + Math.abs(from.x - to.x) / 3),\n );\n }\n\n constructor(\n private from: RelativeCoordinate,\n private to: RelativeCoordinate,\n private via: RelativeCoordinate,\n ) {}\n\n interpolate(t: number): RelativeCoordinate {\n return relativeCoord(\n (1 - t) * (1 - t) * this.from.x + 2 * (1 - t) * t * this.via.x + t * t * this.to.x,\n\n (1 - t) * (1 - t) * this.from.y + 2 * (1 - t) * t * this.via.y + t * t * this.to.y,\n );\n }\n\n tAtX(x: number): number | undefined {\n return tAtVal(this.from.x, this.via.x, this.to.x, x);\n }\n\n tAtY(y: number): number | undefined {\n return tAtVal(this.from.y, this.via.y, this.to.y, y);\n }\n\n tAtMiddle(aspectRatio: number) {\n // try to find t where the distance to this.from and this.to is the same\n // this.interpolate(0.5) does not work because spline length is not proportional to t\n // so find t at middle x and middle y and return a wighted mean of them, depending on dx/dy\n // not perfect, but okish\n const tMiddleX = this.tAtX((this.from.x + this.to.x) / 2)!;\n const tMiddleY = this.tAtY((this.from.y + this.to.y) / 2)!;\n const d = minus(this.to, this.from);\n if (d.x === 0) {\n return tMiddleY;\n }\n const slope = Math.abs(d.y / (d.x * aspectRatio));\n return (tMiddleX + slope * tMiddleY) / (slope + 1);\n }\n\n tMaxAtRectangle(a: RelativeCoordinate, b: RelativeCoordinate): number {\n const x0 = this.tAtX(a.x) || 0;\n const x1 = this.tAtX(b.x) || 0;\n const y0 = this.tAtY(a.y) || 0;\n const y1 = this.tAtY(b.y) || 0;\n return Math.max(x0, x1, y0, y1);\n }\n\n angleAtT(t: number): number {\n const dx = -(1 - t) * this.from.x + (1 - 2 * t) * this.via.x + t * this.to.x;\n const dy = -(1 - t) * this.from.y + (1 - 2 * t) * this.via.y + t * this.to.y;\n return Math.atan2(dy, dx);\n }\n\n asPath(width: number, height: number) {\n return (\n `M ${this.from.x * width} ${this.from.y * height}` +\n ` Q ${this.via.x * width} ${this.via.y * height} ${this.to.x * width} ${this.to.y * height}`\n );\n }\n\n iconPosition(width: number, height: number, aspectRatio: number): RelativeCoordinate {\n const radius = 10;\n const middle = this.interpolate(this.tAtMiddle(aspectRatio));\n return relativeCoord(middle.x * width - radius, middle.y * height - radius);\n }\n\n /**\n * Find a point on the spline this is outside 2 given rectangles.\n */\n pointOutsideRectangles(\n from: Rectangle,\n to: Rectangle,\n ): RelativeCoordinate | undefined {\n for (let t = 0; t < 1; t += 0.005) {\n const pos = this.interpolate(t);\n if (!insideRectangle(pos, from)) {\n return pos;\n }\n if (insideRectangle(pos, to)) {\n return;\n }\n }\n }\n}\n\nfunction ok(val: number) {\n return val >= 0 && val <= 1 ? val : undefined;\n}\n\nfunction tAtVal(from: number, via: number, to: number, val: number): number | undefined {\n const a = from - 2 * via + to;\n const b = 2 * (via - from);\n const c = from - val;\n if (Math.abs(a) < 1e-6) {\n return ok(-c / b);\n }\n const d = b * b - 4 * a * c;\n if (d < 0) {\n return;\n }\n const r = Math.sqrt(d);\n return ok((-b + r) / (2 * a)) || ok((-b - r) / (2 * a));\n}\n","import QuadraticSpline from \"@/math/QuadraticSpline\";\nimport { boardToRelativeSimple, relativeToBoard } from \"@/math/coordinate-systems\";\nimport { minus, plus, rectangle, times } from \"@/math/coordinates\";\nimport type { BoardCoordinate, RelativeCoordinate } from \"@/model/coordinates\";\nimport { useBoardStore } from \"@/store/board\";\n\nexport function findDeleteIconPos(\n from: RelativeCoordinate,\n fromScale: number,\n to: RelativeCoordinate,\n offset: BoardCoordinate, // Offset of the 'from' sticky if it was moved into the viewport when enlarged\n): BoardCoordinate | undefined {\n const unscaledSize = useBoardStore().currentBoard().cardSize;\n const scaledSize = times(unscaledSize, fromScale);\n\n // If the from sticky is moved into the viewport when enlarged, the sticky (fromRect)\n // won't be centered on the link 'from' position. Here, we're correctly positioning the fromRect\n const adjustment = boardToRelativeSimple(offset);\n const adjustedFrom = plus(from, adjustment);\n\n // make the rectangle a bit bigger than the sticky, this is the space the delete icon will be in\n const fromRect = rectangle({\n center: adjustedFrom,\n size: times(scaledSize, 1.13),\n });\n const toRect = rectangle({ center: to, size: times(unscaledSize, 1.13) });\n const spline = QuadraticSpline.forLink(from, to);\n const pos = spline.pointOutsideRectangles(fromRect, toRect);\n if (pos) {\n // Again, if the enlarged sticky is not centered on the link 'from' position,\n // move the delete icons so they appear above the links\n const adjustedPos = minus(pos, adjustment);\n return relativeToBoard(times(minus(adjustedPos, from), 1 / fromScale));\n }\n}\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","import type { StatusClass } from \"@/model/baseTypes\";\nimport { statusClasses } from \"@/model/baseTypes\";\nimport type { Card } from \"@/model/card\";\nimport type { LinkableCardTree } from \"@/model/link\";\nimport { isWorkitem } from \"@/model/stickyType\";\nimport { useCardStore } from \"@/store/card\";\nimport { getLinkTargetId, useLinkStore } from \"@/store/link\";\n\nimport type { GroupedValues } from \"./components/StackedBarChart\";\n\nexport type StatusDistributionData = GroupedValues;\n\nexport type StatusDistributionSource = \"sticky\" | \"objective\" | \"iteration\" | \"team\" | \"art\";\n\nexport function cardStatusDistribution(\n card: Card,\n criteria?: (card: Card) => boolean,\n): StatusDistributionData {\n const data = initData();\n card.links.forEach((link) => {\n const linkedCard = useLinkStore().cardsByLink(getLinkTargetId(card, link))[0];\n addValue(data, linkedCard, criteria);\n });\n return removeEmptyStatusClasses(data);\n}\n\nexport function dependencyCardStatusDistribution(card: Card): StatusDistributionData {\n return cardStatusDistribution(card, (linkedCard: Card) => {\n return shouldAffectStatusDistribution(linkedCard) && card.dependTeam?.id === linkedCard.teamId;\n });\n}\n\nexport function iterationStatusDistribution(\n cards: Card[],\n iterationId: number,\n): StatusDistributionData {\n const data = initData();\n cards.forEach((card) => {\n if (card.iterationId === iterationId) {\n addValue(data, card);\n }\n });\n return removeEmptyStatusClasses(data);\n}\n\nexport function teamStatusDistribution(cards: Card[], teamId: string): StatusDistributionData {\n const data = initData();\n cards.forEach((card) => {\n if (card.teamId === teamId) {\n addValue(data, card);\n }\n });\n return removeEmptyStatusClasses(data);\n}\n\nexport function objectiveStatusDistribution(tree: LinkableCardTree): StatusDistributionData {\n const linkedCards = [\n ...tree.cards,\n ...tree.indirectLinkedIds.map((id) => useCardStore().cards[id]),\n ];\n\n const data: StatusDistributionData = linkedCards.reduce(\n (acc, curr) => addValue(acc, curr),\n initData(),\n );\n\n return removeEmptyStatusClasses(data);\n}\n\n/**\n * Adds a value to the status distribution data map for a given linked card, if it meets certain criteria.\n *\n * @returns {StatusDistributionData} - The updated status distribution data map.\n */\nfunction addValue(\n data: StatusDistributionData,\n linkedCard: Card,\n criteria = shouldAffectStatusDistribution,\n): StatusDistributionData {\n const newData = new Map([...data.entries()]);\n if (criteria(linkedCard)) {\n const value = newData.get(linkedCard.status!.statusClass)!;\n value.value++;\n value.points += linkedCard.points;\n }\n return newData;\n}\n\nfunction initData(): StatusDistributionData {\n const data = new Map();\n // set all status classes to ensure they are ordered correctly\n for (const statusClass of statusClasses) {\n data.set(statusClass, { points: 0, value: 0 });\n }\n return data;\n}\n\nfunction removeEmptyStatusClasses(data: StatusDistributionData) {\n for (const [statusClass, value] of data) {\n if (value.value === 0) {\n data.delete(statusClass);\n }\n }\n return data;\n}\n\nfunction shouldAffectStatusDistribution(card: Card): boolean {\n // Don't aggregate status from linked ART/Solution Backlog/Planning items, or Risk board workitems\n const excludedBoards = [\n \"backlog\",\n \"program\",\n \"solution_backlog\",\n \"solution\",\n \"risk\", // ART Risks are workitems (by default -- there is no 'risk' functionality on this board)\n ];\n\n return (\n !!card?.status?.statusClass && isWorkitem(card) && !excludedBoards.includes(card.type.origin)\n );\n}\n","import { i18n } from \"@/translations/i18n\";\n\nimport { atDayStart, dayDiff, minuteDiff } from \"./date\";\n\ntype FormatterMap = Record;\n\nconst timeFormatters: { time: FormatterMap; offset: FormatterMap } = {\n time: {},\n offset: {},\n};\n\n/**\n * Get a time formatter for a specific time zone. If the time zone is invalid, UTC is used.\n */\nexport function getTimeFormatterForZone(zone?: string) {\n const z = zone && isValidTimeZone(zone) ? zone : \"UTC\";\n\n if (timeFormatters.time[z]) {\n return timeFormatters.time[z];\n }\n\n const options = {\n hour: \"2-digit\",\n minute: \"2-digit\",\n timeZone: z,\n } as const;\n timeFormatters.time[z] = new Intl.DateTimeFormat(navigator.languages as string[], options);\n\n return timeFormatters.time[z];\n}\n\n/**\n * Format a Date object into a long date format (day, month, year)\n */\nexport function formatLongDate(date: Date) {\n return date.toLocaleString(navigator.languages, {\n day: \"2-digit\",\n month: \"2-digit\",\n year: \"numeric\",\n });\n}\n\n/**\n * Format a Date object into a short date format (month, day)\n */\nexport function formatShortDate(date: Date) {\n return date.toLocaleString(navigator.languages, {\n month: \"short\",\n day: \"numeric\",\n });\n}\n\n// Eg. \"12/12/23, 02:15 PM\" (for en-US)\nexport function formatTimestamp(date: Date) {\n return date.toLocaleString(navigator.languages, {\n day: \"2-digit\",\n month: \"2-digit\",\n year: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n timeZone: \"UTC\",\n });\n}\n\n// Eg: \"Tue, December 12, 2023 at 3:15 PM\" (for en-US)\nexport function formatTimestampFriendly(date: Date) {\n return date.toLocaleString(navigator.languages, {\n weekday: \"short\",\n year: \"numeric\",\n month: \"long\",\n day: \"numeric\",\n hour: \"numeric\",\n minute: \"2-digit\",\n });\n}\n\nexport function formatTime(date: Date) {\n return date.toLocaleString(navigator.languages, {\n hour: \"2-digit\",\n minute: \"2-digit\",\n });\n}\n\nfunction isValidTimeZone(timeZone: string) {\n try {\n return !!Intl.DateTimeFormat(undefined, { timeZone: timeZone });\n } catch (e: unknown) {\n return false;\n }\n}\n\nconst relativeDateName = [\n i18n.global.t(\"date.yesterday\"),\n i18n.global.t(\"date.today\"),\n i18n.global.t(\"date.tomorrow\"),\n];\n\nexport function relativeDate(d: Date) {\n const diff = dayDiff(atDayStart(new Date()), d) + 1;\n if (diff < 0 || diff >= 3) {\n return formatLongDate(d);\n }\n return relativeDateName[Math.floor(diff)];\n}\n\nexport function relativeTime(d: Date) {\n const diff = minuteDiff(new Date(), d);\n const key = diff < 0 ? /*$t*/ \"date.ago\" : /*$t*/ \"date.in\";\n const value = Math.abs(diff);\n if (value >= 90) {\n return formatTime(d);\n }\n if (value >= 60) {\n return i18n.global.t(key, {\n time: i18n.global.t(\"date.hour\", { count: Math.round(value / 60) }),\n });\n }\n if (value >= 1) {\n return i18n.global.t(key, {\n time: i18n.global.t(\"date.minute\", { count: Math.round(value) }),\n });\n }\n return i18n.global.t(\"date.now\");\n}\n","import color from \"@/model/color.module.scss\";\n\nexport type GroupedValues = Map;\n\ninterface BarChartItem {\n key: K;\n value: number;\n color: string;\n x: number;\n width: number;\n}\n\nexport interface BarChartData {\n total: number;\n items: Array & T>;\n}\n\nconst totalWidth = 100;\n\nexport function createBarChartData(\n values: GroupedValues,\n enrichFn: (key: K, value: { value: number } & T) => T,\n): BarChartData | BarChartData {\n const total = [...values.values()].reduce((sum, item) => sum + item.value, 0);\n\n if (total <= 0) {\n return {\n total: 0,\n items: [\n {\n key: \"\",\n value: 0,\n color: \"\",\n x: 0,\n width: totalWidth,\n },\n ],\n } as BarChartData;\n }\n const res: BarChartData = { total, items: [] };\n let width = totalWidth;\n values.forEach((value, key) => {\n res.items.push({\n key,\n value: value.value,\n color: color.ok,\n x: 0,\n width,\n ...enrichFn(key, value),\n });\n width -= (totalWidth * value.value) / total;\n });\n return res;\n}\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","const emojis = [\n [\":)\", \"😀\"],\n [\";)\", \"😉\"],\n [\":(\", \"🙁\"],\n [\":-)\", \"😀\"],\n [\";-)\", \"😉\"],\n [\":-(\", \"🙁\"],\n [\":+1:\", \"👍\"],\n [\":-1:\", \"👎\"],\n [\":cool:\", \"😎\"],\n [\":heart:\", \"❤️\"],\n [\":fire:\", \"🔥\"],\n [\":shit:\", \"💩\"],\n [\":party:\", \"🎉\"],\n [\":100:\", \"💯\"],\n [\":ren:\", \"🦌\"],\n [\":rentouch:\", \"🦌\"],\n [\":ahirsch:\", \"🦌\"],\n [\":pizza:\", \"🍕\"],\n [\":coffee:\", \"☕\"],\n [\"->\", \"→\"],\n [\"=>\", \"⇒\"],\n [\"<-\", \"←\"],\n [\"<=\", \"⇐\"],\n];\n\ninterface Replacement {\n text: string;\n updatePos: (pos: number) => number;\n}\n\nexport function replaceEmoji(text: string): Replacement | undefined {\n const emoji = emojis.find((em) => text.includes(em[0]));\n if (emoji) {\n const start = text.indexOf(emoji[0]);\n if (start >= 0) {\n return {\n text: text.substring(0, start) + emoji[1] + text.substring(start + emoji[0].length),\n updatePos(pos: number) {\n return pos > start && pos < start + emoji[0].length //avoid placing the cursor inside the emoji\n ? start + emoji[1].length\n : pos - emoji[0].length + emoji[1].length;\n },\n };\n }\n }\n}\n","\n\n\n\n\n","export interface PaintFunctions {\n canvasFontSize: number;\n canvasFont: string;\n fontSizeForOneLine: number;\n lineHeight: number;\n widthInCanvas: number;\n heightInCanvas: number;\n\n setCanvasFont(size: number): void;\n\n setElementFontSize(size: number): void;\n\n stringWidth(s: string): number;\n\n charWidth(char1: string, char2?: string): number;\n\n // display text lines on the canvas (for debugging reasons only)\n displayLines(x: number, y: number, text: string, lines: Array<[number, number]>): void;\n}\n\nexport interface PaintLayer {\n init(el: SVGElement | HTMLElement): PaintFunctions | null;\n}\n\nexport let thePaintLayer: PaintLayer;\n\nexport function registerPaintLayer(paintLayer: PaintLayer) {\n thePaintLayer = paintLayer;\n}\n","export type Lines = Array<[number, number]>;\n\nexport function breakLines(\n text: string,\n width: number,\n measure: (chars: string[], from: number, to: number) => number,\n): Lines {\n const chars = Array.from(text);\n const lines = new Array<[number, number]>();\n let lineStart = 0;\n for (let i = 0; i < chars.length; i++) {\n if (chars[i] === \"\\n\") {\n setLine(i, i + 1);\n } else if (measure(chars, lineStart, i + 1) > width) {\n switch (chars[i]) {\n case \" \": {\n const p = i;\n while (i < chars.length + 1 && chars[i + 1] === \" \") {\n i++;\n }\n setLine(p, i + 1);\n break;\n }\n default: {\n for (let p = i - 1; ; p--) {\n if (chars[p] === \" \") {\n setLine(p, p + 1);\n break;\n }\n if (chars[p] === \"-\") {\n setLine(p + 1, p + 1);\n break;\n }\n if (p <= lineStart) {\n setLine(i, i);\n break;\n }\n }\n break;\n }\n }\n }\n }\n setLine(chars.length, 0);\n return asStringPositions(chars, lines);\n\n function setLine(to: number, from: number) {\n lines.push([lineStart, to]);\n lineStart = from;\n }\n}\n\n// positions in Lines assume that each character has length 1 (because we use Array.from(s))\n// this is not true for strings e.g. \"😇\".length==2\n// so convert the positions back so that they are usable with string functions like substring etc.\nfunction asStringPositions(chars: string[], lines: Lines) {\n const stringLines = lines.map((line) => line.slice()) as Lines;\n for (let i = 0; i < chars.length; i++) {\n const len = chars[i].length;\n if (len > 1) {\n for (let j = 0; j < lines.length; j++) {\n if (lines[j][0] > i) {\n stringLines[j][0] += len - 1;\n }\n if (lines[j][1] > i) {\n stringLines[j][1] += len - 1;\n }\n }\n }\n }\n return stringLines;\n}\n","import type { PaintFunctions } from \"./PaintLayer\";\nimport { thePaintLayer } from \"./PaintLayer\";\nimport type { Lines } from \"./lineBreaker\";\nimport { breakLines } from \"./lineBreaker\";\n\nconst shortText = { maxLen: 50, smallestFontSize: 0.23, minWordLen: 4 };\n\ninterface TextMeasure {\n height: number;\n lines: Lines;\n}\n\nexport default class TextMeasurer {\n static of(elem: SVGElement | HTMLElement) {\n const paintFunctions = thePaintLayer.init(elem);\n return paintFunctions ? new TextMeasurer(paintFunctions) : null;\n }\n\n private constructor(private paintFunctions: PaintFunctions) {}\n\n setFontSize(size: number) {\n this.paintFunctions.setElementFontSize(size);\n }\n\n maxFontSize() {\n return this.paintFunctions.fontSizeForOneLine;\n }\n\n maxFontSizeForText(): (s: string) => number {\n this.paintFunctions.setCanvasFont(this.maxFontSize());\n return (s) => this.paintFunctions.widthInCanvas / this.paintFunctions.stringWidth(s);\n }\n\n measureLines(size: number, text: string, debug?: boolean): TextMeasure {\n this.paintFunctions.setCanvasFont(size);\n const lines = breakLines(text, this.paintFunctions.widthInCanvas, (chars, from, to) => {\n let width = 0;\n // widths of single characters\n for (let i = from; i < to; i++) {\n width += this.paintFunctions.charWidth(chars[i]);\n }\n // plus width diff of character pairs (e.g. 'AV' takes less space than a 'A' and a 'V')\n for (let i = from; i < to - 1; i++) {\n width += this.paintFunctions.charWidth(chars[i], chars[i + 1]);\n }\n return width;\n });\n if (debug) {\n this.paintFunctions.displayLines(200, 200, text, lines);\n }\n return {\n height: lines.length * this.paintFunctions.lineHeight,\n lines,\n };\n }\n}\n\n// downsize fontSize to assure long words in short texts are not wrapped\nexport function wordDownsize(fontSize: (s: string) => number, text: string) {\n if (text.length > shortText.maxLen) {\n return 1;\n }\n const minWordFontSize = minFontSize(text.split(/\\s+/));\n return Math.max(shortText.smallestFontSize, minWordFontSize);\n\n function minFontSize(ss: string[]): number {\n const wordFontSize = (s: string) => (s.length < shortText.minWordLen ? 1 : fontSize(s));\n return ss.reduce((min, word) => Math.min(min, wordFontSize(word)), 1);\n }\n}\n","import { LRUMap } from \"lru_map\";\n\nimport { SECONDS } from \"@/model/Settings\";\nimport { fontsLoaded } from \"@/utils/dom/dom\";\n\nimport { LocalStore, versioned } from \"../LocalStore\";\n\n//TODO remove when all(?) users have run this\nlocalStorage.removeItem(\"pipFontCache\");\nlocalStorage.removeItem(\"pipFontCacheVersion\");\n\ninterface StoreEntry {\n key: string;\n value: FontInfo;\n}\n\nconst store = new LocalStore(\"fontCache\", {\n sedes: versioned(1),\n saveDelay: 5 * SECONDS,\n});\nconst capacity = 10000;\nconst cache = loadCache();\n\n// font might not have been loaded, so wait with font size calculation until ready\nfunction calcPromise(calc: () => FontData): Promise> {\n return fontsLoaded().then(calc);\n}\n\ninterface FontInfo {\n raw?: RawFontData;\n text?: TextFontData;\n}\n\nexport type FontData = EDIT extends true ? RawFontData : TextFontData;\n\n// font data for text with unprocessed links (used for edit mode)\nexport interface RawFontData {\n cache: boolean;\n size: number;\n}\n\n// font data for text with processed links (used for non-edit mode)\nexport interface TextFontData extends RawFontData {\n htmlLines: string[];\n textLines: string[];\n}\n\nexport function fontSizeCache(\n text: string,\n width: number,\n height: number,\n edit: EDIT,\n font: string,\n calcFontData: () => FontData,\n): Promise> {\n const ratio = Math.round((100 * width) / height);\n const key = `${ratio}/${font}/${text}`;\n const info = getInfo(key);\n const sub = edit ? \"raw\" : \"text\";\n const cached = info[sub] as FontData;\n\n if (cached && isFinite(ratio)) {\n return Promise.resolve(cached);\n }\n\n return calcPromise(() => {\n const fontData = calcFontData();\n if (!fontData.size) {\n fontData.size = edit ? 100 : 500;\n return fontData;\n }\n\n if (fontData.cache) {\n (info[sub] as FontData) = fontData;\n saveCache();\n }\n\n return fontData;\n });\n}\n\nfunction getInfo(key: string): FontInfo {\n let info = cache.get(key);\n if (!info) {\n info = {};\n cache.set(key, info);\n }\n return info;\n}\n\nfunction loadCache(): LRUMap {\n const entries: Array<[string, FontInfo]> = (store.load() || []).map((it) => [it.key, it.value]);\n return new LRUMap(capacity, entries);\n}\n\nfunction saveCache() {\n store.save(cache.toJSON());\n}\n\nexport function clearCache() {\n cache.clear();\n saveCache();\n}\n","import { captureMessage } from \"@/error/sentry\";\nimport type { BoardType } from \"@/model/baseTypes\";\nimport { boardTypeName, isBoardType } from \"@/model/baseTypes\";\nimport { boardUrl } from \"@/router/navigation\";\nimport type { AppParams } from \"@/router/types\";\nimport { i18n } from \"@/translations/i18n\";\n\nimport type { Lines } from \"./lineBreaker\";\nimport { convertCharToHtmlEntity } from \"./text\";\n\ninterface TextAndLinks {\n text: string;\n links: PositionedLink[];\n}\n\ninterface PositionedLink extends Link {\n pos: number;\n}\n\n// router.resolve should do this, but does not work as expected\nfunction resolveAppUrl(url: string): AppParams | undefined {\n const [hash, app, session, team, rawBoard, rawName] = url.substring(url.indexOf(\"#\")).split(\"/\");\n if (hash === \"#\" && app === \"app\" && rawBoard) {\n if (rawName) {\n const [name, query] = splitQuery(rawName);\n return { session, team, board: rawBoard, name, query };\n }\n const [board, query] = splitQuery(rawBoard);\n return { session, team, board, name: \"\", query };\n }\n}\n\nfunction splitQuery(s: string) {\n const pos = s.indexOf(\"?\");\n return pos < 0 ? [s, \"\"] : [s.substring(0, pos), s.substring(pos + 1)];\n}\n\nexport function replaceLinks(s: string): TextAndLinks {\n const links = new Array();\n let delta = 0;\n return {\n links,\n text: s.replace(/(https?:\\/\\/)(\\S*)|#(\\S*)/g, (all, protocol, path, hash, pos) => {\n if (protocol) {\n const urlParts = parseUrl(path);\n const link = urlParts ? urlPartsToLink(urlParts) : { href: all, newTab: true, text: path };\n return addLink(all, pos, link);\n }\n const hashParts = parseHash(hash);\n return hashParts ? addLink(all, pos, urlPartsToLink(hashParts)) : all;\n }),\n };\n\n function addLink(source: string, pos: number, link: Link) {\n links.push({ pos: pos + delta, ...link });\n delta += link.text.length - source.length;\n return link.text;\n }\n}\n\nexport function toHtmlWithLinks(s: string, links: PositionedLink[], lines: Lines): string[] {\n const res = new Array();\n let text = \"\";\n let delta = 0;\n let linkIndex = 0;\n let link = links[linkIndex];\n let linkStart = 0;\n let lineEnd = 0;\n for (const [startPos, endPos] of lines) {\n const skipped = startPos - lineEnd;\n delta -= skipped;\n if (linkStart) {\n linkStart += skipped;\n }\n const lineStart = startPos + delta;\n for (let pos = startPos; pos < endPos; ) {\n if (pos === link?.pos || linkStart) {\n const target = link.newTab ? ' target=\"_blank\"' : \"\";\n const linkEnd = Math.min(link.text.length, linkStart + endPos - pos);\n const linkText = link.text.substring(linkStart, linkEnd);\n pos += append(\n `${linkText}`,\n linkEnd - linkStart,\n );\n if (linkEnd === link.text.length) {\n linkStart = 0;\n link = links[++linkIndex];\n } else {\n linkStart = linkEnd;\n }\n } else {\n pos += append(convertCharToHtmlEntity(s, pos), 1);\n }\n }\n lineEnd = endPos;\n res.push(text.substring(lineStart, endPos + delta));\n }\n return res;\n\n function append(a: string, consume: number) {\n text += a;\n delta += a.length - consume;\n return consume;\n }\n}\n\nfunction normalizeUrlParam(param: string | string[]) {\n // this is ok as route params can only be arrays when it's a repeatable param\n const s = param as string;\n try {\n return s ? decodeURIComponent(s) : s;\n } catch (e) {\n // when the url contains a % that is not part of an encoded char\n void captureMessage(`Invalid url parameter '${s}'`);\n return s;\n }\n}\n\ninterface UrlParts {\n session?: string;\n board: BoardType;\n spec?: string;\n query?: string;\n}\n\ninterface Link {\n href: string;\n newTab: boolean;\n text: string;\n}\n\nfunction urlPartsToLink(url: UrlParts): Link {\n return {\n href: boardUrl(url.session, url.board, url.spec, url.query).href,\n newTab: false,\n text:\n //TODO use boardTitle()\n i18n.global.t(boardTypeName(url.board)) + (url.spec ? \" \" + url.spec : \"\"),\n };\n}\n\nfunction parseUrl(url: string): UrlParts | null {\n if (url.startsWith(location.host)) {\n const params = resolveAppUrl(url);\n if (params && isBoardType(params.board)) {\n return {\n session: normalizeUrlParam(params.session),\n board: params.board as BoardType,\n spec:\n params.board === \"flex\"\n ? normalizeUrlParam(params.name)\n : params.board === \"team\"\n ? normalizeUrlParam(params.team)\n : undefined,\n query: params.query,\n };\n }\n }\n return null;\n}\n\nfunction parseHash(hash: string): UrlParts | null {\n const parts = hash.split(\"/\");\n if (parts.length >= 3) {\n const second = boardType(parts[1]);\n return second ? { session: parts[0], board: second, spec: parts[2] } : null;\n }\n const first = boardType(parts[0]);\n if (first) {\n return { session: undefined, board: first, spec: parts[1] };\n }\n const secondOnly = boardType(parts[1]);\n return secondOnly ? { session: parts[0], board: secondOnly, spec: undefined } : null;\n}\n\nfunction boardType(s: string): BoardType | null {\n const r = s === \"canvas\" ? \"flex\" : s;\n return isBoardType(r) ? (r as BoardType) : null;\n}\n","import TextMeasurer, { wordDownsize } from \"./TextMeasurer\";\nimport type { FontData, RawFontData, TextFontData } from \"./fontSizeCache\";\nimport { fontSizeCache } from \"./fontSizeCache\";\nimport { replaceLinks, toHtmlWithLinks } from \"./linkParser\";\n\nconst maxSteps = 7;\n\nexport async function optimalFontSize(\n el: HTMLElement,\n inputText: string,\n font: string,\n edit: EDIT,\n options: {\n isDependency?: boolean;\n nonStandardCardSize?: boolean; // For rendering cards off-board\n } = {},\n): Promise> {\n let width = 224;\n let height = options.isDependency ? 132 : 160;\n\n // When rendering cards off-board (eg. plan readout), use the el's actual size\n // instead of the standard card size (performance is less of a concern, because\n // we're only rendering 1 card at a time)\n if (options.nonStandardCardSize) {\n width = el.clientWidth;\n height = el.clientHeight;\n }\n\n return fontSizeCache(inputText, width, height, edit, font, () => {\n const { text, links } = edit ? { text: inputText, links: [] } : replaceLinks(inputText);\n\n const measurer = TextMeasurer.of(el)!;\n\n const maxFontSize = measurer.maxFontSize();\n const maxFontSizeForText = measurer.maxFontSizeForText();\n const wordSize = wordDownsize(maxFontSizeForText, text);\n let max = maxFontSize * wordSize;\n\n let min = max / 20;\n for (let i = 0; i < maxSteps; i++) {\n const size = (min + max) / 2;\n const measure = measurer.measureLines(size, text);\n\n if (measure.height <= el.clientHeight) {\n min = size;\n } else {\n max = size;\n }\n }\n min = Math.round(min * 1000) / 1000;\n\n measurer.setFontSize(min);\n const minMeasure = measurer.measureLines(min, text);\n //textareaButNotEdit happens for the sticky that has the cursor during zoom\n //this is ok, but we should not cache the result as it's wrong after zooming has finished\n const textareaButNotEdit = !edit && el.nodeName === \"TEXTAREA\";\n const raw: RawFontData = { size: min, cache: !textareaButNotEdit };\n const res = edit\n ? raw\n : ({\n ...raw,\n htmlLines: toHtmlWithLinks(text, links, minMeasure.lines),\n textLines: minMeasure.lines.map(([startPos, endPos]) => text.substring(startPos, endPos)),\n } as TextFontData);\n return res as FontData;\n });\n}\n","\n\n\n\n\n","\n\n\n\n\n","import type { WindowCoordinate } from \"@/model/coordinates\";\n\nexport function scrollNearBoarder(pos: WindowCoordinate) {\n const el = document.documentElement;\n const scrollX = check(pos.x, el.scrollLeft, el.clientWidth);\n const scrollY = check(pos.y, el.scrollTop, el.clientHeight);\n if (scrollX !== undefined || scrollY !== undefined) {\n el.scrollTo({ left: scrollX, top: scrollY });\n }\n\n function check(pos: number, scroll: number, size: number) {\n let d = 20 - pos;\n if (d > 0) {\n return scroll - d;\n }\n d = 20 - size + pos;\n if (d > 0) {\n return scroll + d;\n }\n }\n}\n","import { noop } from \"lodash-es\";\n\nimport { releaseCapture } from \"@/utils/dom/dom\";\n\nimport { isDragging } from \"./drag\";\nimport { isPinching } from \"./pinch\";\n\n//TODO make this a composable after boards are migrated to vue3\n\nlet dragScrolling = false;\nlet onDragScrollEnd = noop;\n\nexport function executeAfterDragScroll(action: () => void) {\n if (dragScrolling) {\n onDragScrollEnd = action;\n } else {\n action();\n }\n}\n\nexport function dragScroll(el: HTMLElement) {\n let x: number;\n let y: number;\n\n /**\n * Enables drag-based scrolling on an element.\n *\n * @param immediate - If `true`, starts scrolling immediately when the function is called\n * instead of waiting for the next `pointerdown` event.\n *\n * - Use `dragScroll(el)` to enable standard drag scrolling.\n * - Use `dragScroll(el, true)` when calling from an existing `pointerdown` handler\n * to immediately initiate scrolling without waiting for another event.\n * When `dragScroll` is triggered inside a `pointerdown` event (e.g., right-click),\n * the listeners are registered *after* the event has already occurred. This means\n * that `pointerdown` won't fire again until the user clicks again. The `immediate` flag\n * ensures that scrolling starts immediately by manually triggering `onPointerDown`\n * on the first `pointermove` event.\n */\n function enable(immediate?: boolean) {\n if (immediate) {\n el.addEventListener(\"pointermove\", onPointerDown, { once: true });\n }\n\n el.addEventListener(\"pointerdown\", onPointerDown);\n el.addEventListener(\"pointerenter\", onPointerEnter);\n el.addEventListener(\"pointermove\", onPointerMove);\n }\n\n function disable() {\n el.removeEventListener(\"pointerdown\", onPointerDown);\n el.removeEventListener(\"pointerenter\", onPointerEnter);\n el.removeEventListener(\"pointermove\", onPointerMove);\n }\n\n return { enable, disable };\n\n function setPos(e: PointerEvent) {\n x = Math.trunc(e.clientX) + window.scrollX;\n y = Math.trunc(e.clientY) + window.scrollY;\n }\n\n function onPointerDown(e: PointerEvent) {\n releaseCapture(e);\n dragScrolling = true;\n setPos(e);\n\n el.addEventListener(\"pointerup\", onPointerUp, { once: true });\n }\n\n function onPointerUp() {\n endDragScroll();\n el.style.removeProperty(\"cursor\");\n }\n\n function onPointerEnter() {\n endDragScroll();\n el.style.removeProperty(\"cursor\");\n }\n\n function onPointerMove(e: PointerEvent) {\n if (dragScrolling && !isPinching() && !isDragging()) {\n el.style.cursor = \"grabbing\";\n window.scrollTo(x - Math.trunc(e.clientX), y - Math.trunc(e.clientY));\n setPos(e);\n }\n }\n}\n\nfunction endDragScroll() {\n dragScrolling = false;\n onDragScrollEnd();\n onDragScrollEnd = noop;\n}\n","import { clamp } from \"lodash-es\";\n\nimport { maxZoom, minZoom } from \"@/model/Settings\";\nimport type { WindowCoordinate } from \"@/model/coordinates\";\nimport { useBoardsStore } from \"@/store/boards\";\nimport { useSelectionStore } from \"@/store/selection\";\nimport { useZoomStore } from \"@/store/zoom\";\n\nimport { executeAfterDragScroll } from \"./dragScroll\";\n\nlet zoomEnd = 0;\n\nexport function processZoom(\n center: WindowCoordinate,\n factor: number,\n mode: \"absolute\" | \"relative\",\n) {\n if (useBoardsStore().loading || useSelectionStore().isSelectingWithRect) return;\n\n const base = mode === \"relative\" ? useZoomStore().dynamicFactor : useZoomStore().factor;\n const newFactor = clamp(base * factor, minZoom, maxZoom);\n if (useZoomStore().dynamicFactor !== newFactor) {\n useZoomStore().setDynamicZoomFactor(newFactor);\n window.clearTimeout(zoomEnd);\n zoomEnd = window.setTimeout(emitZoom, 400);\n if (!useZoomStore().zooming) {\n emitZoom(center);\n }\n }\n}\n\nfunction emitZoom(center?: WindowCoordinate) {\n if (center) {\n useZoomStore().startZoom(center);\n } else {\n executeAfterDragScroll(useZoomStore().endZoom);\n }\n}\n","import { distance2, interpolate } from \"@/math/coordinates\";\nimport type { WindowCoordinate } from \"@/model/coordinates\";\n\nimport { getPointer, otherPointer } from \"./pointer\";\nimport { processZoom } from \"./zoom\";\n\ninterface PinchZoom {\n a: number;\n b: number;\n dist: number;\n}\n\nlet pinchZoom: PinchZoom | undefined;\n\nexport function isPinching(id?: number) {\n return !!pinchZoom && (id === undefined || id === pinchZoom.a || id === pinchZoom.b);\n}\n\nexport function handlePinchPointerDown(id: number, pos: WindowCoordinate) {\n const other = otherPointer(id);\n if (other) {\n const dist = distance2(getPointer(other).pos, pos);\n pinchZoom = { a: other, b: id, dist };\n }\n}\n\nexport function handlePinchPointerMove(id: number) {\n if (pinchZoom && isPinching(id)) {\n const pa = getPointer(pinchZoom.a).pos;\n const pb = getPointer(pinchZoom.b).pos;\n const dist = distance2(pa, pb);\n const f = Math.sqrt(dist / pinchZoom.dist);\n if (Math.abs(f - 1) > 0.01) {\n processZoom(interpolate(0.5, pa, pb), f, \"absolute\");\n }\n }\n}\n\nexport function handlePinchPointerUp(id: number) {\n if (isPinching(id)) {\n pinchZoom = undefined;\n }\n}\n","import { resetBoardScrollMargin } from \"@/components/utils/boardSize\";\nimport type { WindowCoordinate } from \"@/model/coordinates\";\nimport { clientCoord } from \"@/utils/dom/coordinates\";\nimport { eventTarget, isLeftClick, releaseCapture } from \"@/utils/dom/dom\";\n\nimport { handleDragPointerMove, handleDragPointerUp } from \"./drag\";\nimport { handlePinchPointerDown, handlePinchPointerMove, handlePinchPointerUp } from \"./pinch\";\n\ninterface Pointer {\n draggable: boolean;\n pos: WindowCoordinate;\n downPos: WindowCoordinate;\n}\n\nconst mouse = { downs: 0, ups: 0 };\nconst pointer: Record = {};\n\nexport function mouseState() {\n const downs = mouse.downs;\n return {\n isButtonDownOnce: () => mouse.downs > mouse.ups && mouse.downs === downs + 1,\n };\n}\n\nexport function getPointer(id: number) {\n return pointer[id];\n}\n\nexport function otherPointer(id: number): number | undefined {\n for (const key in pointer) {\n if (!pointer[key].draggable && +key !== id) {\n return +key;\n }\n }\n}\n\nexport function pointerDown(id: number, pos: WindowCoordinate, draggable: boolean) {\n pointer[id] = { draggable, pos, downPos: { ...pos } };\n}\n\nexport function initPointerHandler() {\n document.addEventListener(\"pointerdown\", (e: PointerEvent) => {\n releaseCapture(e);\n if (isLeftClick(e)) {\n down(e.pointerId, clientCoord(e));\n }\n });\n\n document.addEventListener(\"pointermove\", (e: PointerEvent) => {\n move(e.pointerId, clientCoord(e));\n });\n\n document.addEventListener(\"pointerup\", (e: PointerEvent) => {\n if (e.pointerType === \"mouse\") {\n mouse.ups = mouse.downs;\n }\n up(e.pointerId, eventTarget(e)!);\n });\n\n document.addEventListener(\"pointerleave\", (e: PointerEvent) => {\n if (isLeftClick(e)) {\n up(e.pointerId);\n }\n });\n\n document.addEventListener(\"pointerenter\", (e: PointerEvent) => {\n if (!isLeftClick(e)) {\n if (e.pointerType === \"mouse\") {\n mouse.ups = mouse.downs;\n }\n }\n });\n}\n\nfunction down(id: number, pos: WindowCoordinate) {\n mouse.downs++;\n pointerDown(id, pos, false);\n handlePinchPointerDown(id, pos);\n}\n\nfunction move(id: number, pos: WindowCoordinate) {\n if (!pointer[id]) {\n return;\n }\n pointer[id].pos = pos;\n handlePinchPointerMove(id);\n handleDragPointerMove(id, pos, move);\n}\n\nfunction up(id: number, target?: HTMLElement) {\n if (pointer[id]) {\n handleDragPointerUp(id, pointer[id].pos, target);\n }\n handlePinchPointerUp(id);\n delete pointer[id];\n resetBoardScrollMargin();\n}\n","import { scrollNearBoarder } from \"@/components/utils/scroll\";\nimport { add, distance2, minus, plus } from \"@/math/coordinates\";\nimport { dragStartDist } from \"@/model/Settings\";\nimport type { IdMap } from \"@/model/baseTypes\";\nimport type { BoardCoordinate, WindowCoordinate } from \"@/model/coordinates\";\nimport { windowCoord } from \"@/model/coordinates\";\nimport {\n boundsCoord,\n clientCoord,\n offsetCoord,\n offsetSize,\n scrollCoord,\n scrollSize,\n} from \"@/utils/dom/coordinates\";\nimport { eventTarget, isLeftClick, releaseCapture } from \"@/utils/dom/dom\";\nimport { firstValue } from \"@/utils/general\";\n\nimport { pointerDown } from \"./pointer\";\n\nconst drags: IdMap> = {};\n\nexport interface Drag {\n pos: WindowCoordinate;\n el: HTMLElement;\n cursor: string;\n imageEl: HTMLElement;\n target: HTMLElement;\n scrollable?: Scrollable;\n pointerId: number;\n startFn: (d: Drag & T, data: unknown) => boolean;\n moveFn: (d: Drag & T) => WindowCoordinate | BoardCoordinate;\n stopFn: (d: Drag & T) => WindowCoordinate | BoardCoordinate | void;\n dragging: boolean;\n start: WindowCoordinate;\n offset: WindowCoordinate;\n type: \"card\" | \"link\";\n}\n\nexport function isDragging() {\n return firstValue(drags)?.dragging;\n}\n\nexport interface DragHandlers {\n start: (this: M, d: Drag & T, data: any) => boolean;\n move: (this: M, d: Drag & T) => WindowCoordinate | BoardCoordinate;\n stop: (this: M, d: Drag & T) => WindowCoordinate | BoardCoordinate | void;\n}\n\nexport function registerDrag(\n obj: unknown,\n event: PointerEvent,\n options: DragHandlers & { imageEl?: HTMLElement | null },\n) {\n if (options.imageEl) {\n const imageStyle = options.imageEl.style;\n imageStyle.position = \"absolute\";\n imageStyle.pointerEvents = \"none\";\n }\n\n releaseCapture(event);\n if (isLeftClick(event)) {\n event.stopPropagation();\n down(\n event.pointerId,\n event.currentTarget as HTMLElement,\n eventTarget(event)!,\n plus(clientCoord(event), scrollCoord()),\n offsetCoord(event),\n );\n }\n\n function down(\n id: number,\n el: HTMLElement,\n target: HTMLElement,\n pos: WindowCoordinate,\n offset: WindowCoordinate,\n ) {\n pointerDown(id, pos, true);\n const scrollable = findScrollable(el);\n const d = scrollable\n ? windowCoord(scrollable.el.scrollLeft, scrollable.el.scrollTop)\n : windowCoord(0, 0);\n drags[id] = {\n el,\n cursor: el.style.cursor,\n imageEl: options.imageEl || el,\n target,\n scrollable,\n startFn: options.start.bind(obj),\n moveFn: options.move.bind(obj),\n stopFn: options.stop.bind(obj),\n pointerId: id,\n pos: windowCoord(0, 0),\n dragging: false,\n offset,\n start: minus(plus(pos, d)),\n type: target.classList.contains(\"link-drag\") ? \"link\" : \"card\",\n };\n }\n}\n\nexport function handleDragPointerMove(\n id: number,\n pos: WindowCoordinate,\n moveFn: (id: number, pos: WindowCoordinate) => void,\n) {\n const drag = drags[id];\n if (!drag) {\n return;\n }\n drag.pos = plus(pos, plus(drag.start, scrollCoord()));\n if (drag.scrollable) {\n add(drag.pos, windowCoord(drag.scrollable.el.scrollLeft, drag.scrollable.el.scrollTop));\n scrollInScrollable(pos, drag.scrollable, () => moveFn(id, pos));\n } else {\n scrollNearBoarder(pos);\n }\n if (drag.dragging) {\n setPosition(drag.imageEl, drag.moveFn(drag));\n } else if (distance2(drag.pos, windowCoord(0, 0)) > dragStartDist) {\n drag.el.style.cursor = \"grabbing\";\n drag.dragging = true;\n if (drag.el !== drag.imageEl) {\n setPosition(drag.imageEl, drag.pos);\n const imageDist = minus(boundsCoord(drag.el), boundsCoord(drag.imageEl));\n add(drag.start, imageDist);\n add(drag.pos, imageDist);\n setPosition(drag.imageEl, drag.pos);\n drag.imageEl.style.width = drag.el.offsetWidth + \"px\";\n drag.imageEl.style.height = drag.el.offsetHeight + \"px\";\n }\n if (!drag.startFn(drag, null)) {\n release(id);\n }\n }\n}\n\nexport function handleDragPointerUp(id: number, pos: WindowCoordinate, target?: HTMLElement) {\n const drag = drags[id];\n if (!drag) {\n return;\n }\n try {\n if (drag.dragging) {\n // if we dragged a link, avoid following it\n if (target?.nodeName === \"A\") {\n target.onclick = () => false;\n window.setTimeout(() => (target.onclick = null), 100);\n }\n drag.pos = plus(pos, plus(drag.start, scrollCoord()));\n const stopPos = drag.stopFn(drag);\n if (stopPos) {\n setPosition(drag.imageEl, stopPos);\n }\n }\n } finally {\n release(id);\n }\n}\n\nfunction setPosition(el: HTMLElement, pos: WindowCoordinate | BoardCoordinate) {\n el.style.left = pos.x + \"px\";\n el.style.top = pos.y + \"px\";\n}\n\nfunction release(id: number) {\n drags[id].el.style.cursor = drags[id].cursor;\n\n // fix for the position of the link drag in the new sticky note\n if (drags[id].el.hasAttribute(\"data-sticky-note\")) {\n drags[id].el.style.left = \"\";\n drags[id].el.style.top = \"\";\n }\n\n delete drags[id];\n}\n\ninterface Scrollable {\n el: HTMLElement;\n scrollSize: WindowCoordinate;\n timeout?: number;\n}\n\nfunction findScrollable(el: HTMLElement | null): Scrollable | undefined {\n while (el !== null) {\n if (el.classList.contains(\"scrollable\")) {\n return {\n el,\n scrollSize: minus(scrollSize(el), offsetSize(el)),\n };\n }\n el = el.parentElement;\n }\n}\n\nfunction scrollInScrollable(pos: WindowCoordinate, scrollable: Scrollable, recur: () => void) {\n window.clearTimeout(scrollable.timeout);\n const rect = scrollable.el.getBoundingClientRect();\n if (pos.y - rect.top < 20) {\n scrollBy(-2);\n } else if (\n rect.top + rect.height - pos.y < 20 &&\n scrollable.el.scrollTop < scrollable.scrollSize.y\n ) {\n scrollBy(2);\n }\n\n function scrollBy(delta: number) {\n scrollable.el.scrollBy({ top: delta });\n scrollable.timeout = window.setTimeout(recur, 20);\n }\n}\n","import { sortBy } from \"lodash-es\";\n\nimport { boardActions } from \"@/action/boardActions\";\nimport { cardActions } from \"@/action/cardActions\";\nimport { linkActions } from \"@/action/linkActions\";\nimport { sender } from \"@/backend/Sender\";\nimport type { Drag } from \"@/components/gestures/drag\";\nimport { registerDrag } from \"@/components/gestures/drag\";\nimport { sendStickyNoteAction } from \"@/composables/useEventBus\";\nimport { captureMessage } from \"@/error/sentry\";\nimport {\n boardSize,\n boardToRelative,\n boardToWindow,\n boardToWindowSimple,\n windowToBoard,\n windowToBoardSimple,\n windowToRelative,\n} from \"@/math/coordinate-systems\";\nimport { plus, times } from \"@/math/coordinates\";\nimport type { Card } from \"@/model/card\";\nimport type { BoardCoordinate, Rectangle, WindowCoordinate } from \"@/model/coordinates\";\nimport { boardCoord, windowCoord } from \"@/model/coordinates\";\nimport { useBoardStore } from \"@/store/board\";\nimport { useDraggingStore } from \"@/store/dragging\";\nimport { useSelectionStore } from \"@/store/selection\";\nimport { useZoomStore } from \"@/store/zoom\";\nimport {\n stickyNoteDragEnded,\n stickyNoteDragStarted,\n stickyNoteLinkDragStarted,\n} from \"@/utils/analytics/events\";\nimport { trackEvent } from \"@/utils/analytics/track\";\n\ninterface CardDrag {\n origin: WindowCoordinate;\n boardSize: Rectangle;\n selectedCards: CardInfo[];\n}\n\ninterface CardInfo {\n id: string;\n el: HTMLElement;\n offset: WindowCoordinate;\n}\n\nexport function registerCardDrag(card: Card, onEnd: () => void, e: PointerEvent) {\n registerDrag({}, e, {\n start(drag) {\n if (drag.type === \"link\") {\n trackEvent(stickyNoteLinkDragStarted(card.type.functionality, \"mouse\"));\n drag.el = drag.imageEl = drag.target;\n drag.origin = windowCoord(drag.el.offsetLeft, drag.el.offsetTop);\n drag.start = windowCoord(0, 0);\n drag.el.style.display = \"none\";\n useDraggingStore().startLinkDragging(\n card.id,\n drag.pointerId,\n windowToRelative(windowCoord(e.clientX, e.clientY)),\n );\n } else {\n trackEvent(stickyNoteDragStarted(\"mouse\"));\n const windowPos = boardToWindow(boardCoord(drag.el.offsetLeft, drag.el.offsetTop));\n\n // When dragging from palette, grab the center of the sticky note\n // (the normal logic causes a bug when the palette is outside the board)\n const { fromPalette } = useDraggingStore().findById(card.id) || {};\n drag.start = fromPalette ? windowCoord(0, 0) : plus(drag.start, windowPos);\n\n drag.boardSize = boardSize();\n const selected = useBoardStore().selectedStickyIds;\n const availableSelectedCards =\n !useSelectionStore().singleCard &&\n selected.length > 0 &&\n useBoardStore().isStickySelected(card.id)\n ? selected.map((id) => selectedCardInfo(id, drag))\n : [selectedCardInfo(card.id, drag)];\n const board = useBoardStore().currentBoard();\n // sort multiselected cards by z-index to keep their relative z-positions when moving them to the front\n drag.selectedCards = sortBy(\n availableSelectedCards.filter((card) => card !== null) as CardInfo[],\n (info) => {\n const cardOnBoard = board.cards[info.id];\n if (cardOnBoard) {\n return cardOnBoard.meta.zIndex;\n } else {\n void captureMessage(\"Drag error - selected card not found on board\", {\n info: {\n boardId: board.id,\n cardId: info.id,\n availableSelectedCards,\n },\n });\n return 0;\n }\n },\n );\n\n for (const card of drag.selectedCards) {\n const zoom = useZoomStore().factor;\n const distance = times(card.offset, zoom);\n const wc = windowCoord(e.clientX, e.clientY);\n const startPos = windowToRelative(plus(plus(drag.start, wc), distance));\n\n boardActions.cardToFront(\"internal\", card.id);\n sender.startAlterCard(board.id, card.id);\n useDraggingStore().startCardDragging(card.id, undefined, startPos);\n }\n cardActions.setPosition(\n \"board\",\n drag.selectedCards.map((c) => c.id),\n );\n }\n return true;\n },\n move(drag) {\n if (drag.origin) {\n const limitCoords = drag.type === \"link\" ? \"none\" : \"output\";\n useDraggingStore().dragLink(\n drag.pointerId,\n boardToRelative(windowToBoard(drag.pos, limitCoords)),\n );\n return drag.pos;\n } else {\n return doWithSelected(drag, dragCard);\n }\n },\n stop(drag) {\n if (drag.origin) {\n const val = { dragId: drag.pointerId, id: card.id, el: drag.el };\n linkActions.addByDrag(\"drag\", val);\n onEnd();\n return { ...drag.origin };\n } else {\n trackEvent(stickyNoteDragEnded(\"mouse\"));\n const pos = doWithSelected(drag, endDragCard);\n onEnd();\n return pos;\n }\n },\n });\n\n function selectedCardInfo(cardId: string, drag: Drag): CardInfo | null {\n const el = document.getElementById(cardId);\n if (el) {\n return { id: cardId, el, offset: cardOffset(el, drag) };\n }\n return null;\n }\n\n function doWithSelected(\n drag: Drag & CardDrag,\n action: (card: CardInfo, coordinate: BoardCoordinate) => void,\n ): BoardCoordinate {\n const pos = windowToBoard(drag.pos, \"output\", drag.selectedCards);\n for (const card of drag.selectedCards) {\n action(card, cardCoordinate(card, pos));\n }\n return pos;\n }\n\n function dragCard(card: CardInfo, coordinate: BoardCoordinate) {\n const pos = boardToRelative(coordinate);\n sender.moveCard(useBoardStore().currentBoard().id, card.id, pos);\n useDraggingStore().dragCard(card.id, pos);\n }\n\n function endDragCard(card: CardInfo, coordinate: BoardCoordinate) {\n const pos = boardToRelative(coordinate);\n sender.moveCard(useBoardStore().currentBoard().id, card.id, pos);\n if (useDraggingStore().dragging[card.id].fromPalette) {\n setTimeout(() => {\n sendStickyNoteAction(card.id, {\n action: \"enlarge\",\n focus: true,\n trigger: \"after-create\",\n });\n }, 100);\n }\n useDraggingStore().endCardDragging(card.id, pos);\n }\n}\n\nfunction cardOffset(el: HTMLElement, drag: Drag) {\n return boardToWindowSimple(\n boardCoord(el.offsetLeft - drag.el.offsetLeft, el.offsetTop - drag.el.offsetTop),\n );\n}\n\nfunction cardCoordinate(card: CardInfo, pos: BoardCoordinate) {\n return plus(pos, windowToBoardSimple(card.offset));\n}\n","import type { Ref } from \"vue\";\nimport { onMounted } from \"vue\";\n\nimport { cardActions } from \"@/action/cardActions\";\nimport { registerCardDrag } from \"@/components/card/cardDragHandler\";\nimport type { Card } from \"@/model/card\";\nimport { eventTarget } from \"@/utils/dom/dom\";\n\nexport type Props = Readonly<{\n el?: Ref;\n card: Card;\n disabled?: Ref>;\n}>;\n\nexport function useDrag({ el, card, disabled }: Props) {\n onMounted(() => {\n if (disabled?.value) return;\n el?.value?.addEventListener(\"pointerdown\", handlePointerDown);\n });\n\n const handlePointerDown = (event: PointerEvent) => {\n const target = eventTarget(event)!;\n\n const isLinkDrag = target.classList.contains(\"link-drag\");\n if (disabled?.value || isLinkDrag) return;\n\n registerCardDrag(card, onDragEnd, event);\n };\n\n const onDragEnd = () => {\n cardActions.stopAlter(\"internal\", card.id);\n\n // Prevent the focus ring from appearing if you shift-select after dragging\n el?.value?.setAttribute(\"data-blur-on-shift\", \"true\");\n el?.value?.addEventListener(\"focusin\", () => el?.value?.removeAttribute(\"data-blur-on-shift\"), {\n once: true,\n });\n };\n}\n","import { isFunction } from \"lodash-es\";\n\nimport type { Action } from \"@/action/types\";\nimport { captureMessage } from \"@/error/sentry\";\nimport { eventTarget, isInput } from \"@/utils/dom/dom\";\n\nimport type { Key, KeyAccept, SimpleKeyEvent } from \"./key\";\nimport { accept, noAccept } from \"./key\";\n\n/**\n * Register a shortcut that will never be unregistered.\n */\nexport function registerGlobalShortcut(\n action: Action | AdHocAction,\n options?: ShortcutOptions,\n): void {\n if (isFunction(action)) {\n if (action.data.shortcut.accept === noAccept) {\n captureMessage(\"register shortcut without shortcut\", {\n info: { action: action.data.id },\n });\n return;\n }\n doRegisterShortcut(\"\", action.data.shortcut.accept, () => action(\"keyboard-shortcut\"), options);\n } else {\n doRegisterShortcut(\"\", action.key.accept, action.exec, options);\n }\n}\n\nexport interface AdHocAction {\n key: Key;\n exec: (e: KeyboardEvent) => void;\n}\n\nexport interface ShortcutOptions {\n prevent?: boolean;\n repeat?: boolean;\n withEvent?: boolean;\n up?: () => void;\n}\n\n/**\n * Don't use directly, but useShortcuts.ts or registerGlobalShortcut\n */\nexport function doRegisterShortcut(\n component: T,\n k: string | KeyAccept,\n exec: (e: KeyboardEvent) => void,\n options?: ShortcutOptions,\n) {\n shortcuts.push({\n component,\n accept: accept(k),\n exec,\n prevent: options?.prevent,\n repeat: options?.repeat,\n up: options?.up?.bind(component),\n });\n}\n\n/* Don't use directly, but useShortcuts.ts */\nexport function doUnregisterShortcuts(component: unknown) {\n shortcuts = shortcuts.filter((shortcut) => shortcut.component !== component);\n}\n\ninterface Shortcut {\n component: unknown;\n accept: KeyAccept;\n prevent?: boolean;\n repeat?: boolean;\n exec: (e: KeyboardEvent) => void;\n up?: () => void;\n}\n\nlet shortcuts = new Array();\nconst down: Record = {};\n\ndocument.addEventListener(\"keydown\", keyDown);\ndocument.addEventListener(\"keyup\", keyUp);\nwindow.addEventListener(\"blur\", allKeysUp);\n\nexport function isKeyDown(codeOrKey: string) {\n return codeOrKey in down || Object.values(down).some((e) => e === codeOrKey);\n}\n\nfunction keyDown(e: KeyboardEvent) {\n const elem = eventTarget(e)!;\n\n const isActive = !elem.readOnly && !elem.disabled;\n const isAllowedInput =\n elem.classList.contains(\"allow-shortcuts\") &&\n (e.altKey || e.ctrlKey || e.metaKey || e.key.length > 1) &&\n e.key !== \"Backspace\";\n\n const wasDown = e.code in down;\n down[e.code] = e.key;\n\n if (!isInput(elem) || !isActive || isAllowedInput) {\n if (e.key === \" \") {\n // prevent scrolling\n e.preventDefault();\n }\n for (const cut of shortcuts) {\n if (cut.accept(e)) {\n if (cut.prevent !== false) {\n e.preventDefault();\n }\n if (cut.repeat || !wasDown) {\n cut.exec(e);\n }\n }\n }\n }\n}\n\nfunction allKeysUp() {\n for (const code in down) {\n keyUp({\n code,\n key: down[code],\n keyCode: 0,\n shiftKey: false,\n altKey: false,\n ctrlKey: false,\n metaKey: false,\n });\n }\n}\n\nfunction keyUp(e: SimpleKeyEvent) {\n delete down[e.code];\n for (const cut of shortcuts) {\n if (cut.up && cut.accept(e)) {\n cut.up();\n }\n }\n\n if (e.key === \"Meta\") {\n // on Mac, releasing any key together with command (=Meta), causes only a keyup event for Meta, but not the key\n // so assume that when releasing Meta every other key is also released\n allKeysUp();\n }\n if (e.key === \"Escape\") {\n // Adding this as a shortcut to reset the state of down[], because sometimes\n // the keyup event is not received (eg. on mac, after making a screenshot with cmd+shift+4)\n // which causes buggy behaviour since the app thinks some keys are still down\n allKeysUp();\n }\n}\n","import type { Ref } from \"vue\";\nimport { ref, watch } from \"vue\";\n\ninterface Hooks {\n onEnd?: VoidFunction;\n onStart?: VoidFunction;\n}\n\n/**\n * Creates an transition utility for a given element.\n *\n * @param el - The element to transition.\n * @returns An object containing the `transition` and `transitionOn` functions.\n */\nexport function useTransition(el: Ref) {\n const classes = ref>({});\n\n async function transition(cssClass: string, hooks: Hooks = {}) {\n classes.value[cssClass] = true;\n\n const handleTransitionEnd = () => {\n hooks.onEnd?.();\n delete classes.value[cssClass];\n };\n const handleTransitionStart = () => {\n hooks.onStart?.();\n };\n\n await new Promise((resolve) => {\n el.value?.addEventListener(\n \"transitionend\",\n () => {\n handleTransitionEnd();\n resolve();\n },\n {\n once: true,\n },\n );\n el.value?.addEventListener(\"transitionstart\", handleTransitionStart, {\n once: true,\n });\n });\n }\n\n function transitionOn(value: Ref, cssClass: string, hooks: Hooks = {}) {\n watch(value, () => transition(cssClass, hooks));\n }\n\n return { transition, transitionOn, classes };\n}\n","import { onUnmounted } from \"vue\";\n\ntype DelayedAction = (...args: T) => void;\n\nexport function useDelayedAction(\n action: DelayedAction,\n delay: number,\n): [DelayedAction, () => void] {\n let timeoutId: ReturnType | null = null;\n\n const clear = () => {\n if (timeoutId !== null) {\n clearTimeout(timeoutId);\n timeoutId = null;\n }\n };\n\n // Cleanup on unmount\n onUnmounted(clear);\n\n // Start the delayed action\n const execute: DelayedAction = (...args: T) => {\n clear(); // Clear any existing timeouts\n timeoutId = setTimeout(() => {\n action(...args);\n clear(); // Clear the timeout after the action is executed\n }, delay);\n };\n\n // Cancel the delayed action\n const cancel = () => {\n clear();\n };\n\n return [execute, cancel];\n}\n","import type { Ref, WatchStopHandle } from \"vue\";\nimport { computed, nextTick, onMounted, ref, watch } from \"vue\";\n\nimport { TEXT_INPUT_WRAPPER_CLASS } from \"@/components/StickyNote/components/StickyNoteText/StickyNoteTextEditable.vue\";\nimport { isKeyDown } from \"@/components/shortcut/shortcuts\";\nimport type { StickyNoteEnlarge, StickyNoteShrink } from \"@/composables/useEventBus\";\nimport { useEventBus } from \"@/composables/useEventBus\";\nimport { useTransition } from \"@/composables/useTransition\";\nimport { useDelayedAction } from \"@/composables/utils/useDelayedAction\";\nimport type { StickyEnlargeTrigger } from \"@/model/action\";\nimport type { Card } from \"@/model/card\";\nimport { useBoardStore } from \"@/store/board\";\nimport { useDraggingStore } from \"@/store/dragging\";\nimport { useZoomStore } from \"@/store/zoom\";\nimport { stickyNoteEnlarged, stickyNoteShrunk } from \"@/utils/analytics/events\";\nimport { trackEvent } from \"@/utils/analytics/track\";\nimport { eventTarget } from \"@/utils/dom/dom\";\n\nexport interface Props {\n el: Ref;\n card: Card;\n disabled?: Ref>;\n}\n\nexport function useEnlarge({ el, card, disabled }: Props) {\n const boardStore = useBoardStore();\n const dragStore = useDraggingStore();\n\n const isDragged = computed(() => !!dragStore.dragging[card.id]);\n const isActive = computed(() => boardStore.activeCardId === card.id);\n const isEnlarging = ref(false);\n // change to this value will trigger the \"transform: scale()\" in useStyles\n const isEnlarged = ref(false);\n\n const { classes, transition } = useTransition(el);\n\n const zoomWatcher = ref(null);\n const enlargedWatcher = ref(null);\n\n onMounted(() => {\n if (disabled?.value) return;\n\n el?.value?.addEventListener(\"pointerenter\", handleStickyNotePointerEnter);\n // global listeners so that the sticky note can be enlarged/shrunk from outside\n const { onStickyNoteAction } = useEventBus();\n onStickyNoteAction(null, \"enlarge\", handleEnlargeAction);\n onStickyNoteAction(card.id, \"shrink\", handleShrinkAction);\n });\n\n // dbl click enlarge\n const registerDblClickEventListener = () => {\n el.value?.addEventListener(\"dblclick\", handleStickyNoteDblClick);\n };\n\n const removeDblClickEventListeners = () => {\n el.value?.removeEventListener(\"dblclick\", handleStickyNoteDblClick);\n };\n\n const [action, cancel] = useDelayedAction(removeDblClickEventListeners, 500);\n watch(isActive, (active) => (active ? action() : cancel()));\n\n const handleStickyNoteDblClick = (event: MouseEvent) => {\n void enlarge(\"double-click\"); // no need to focus since the user already cliked on the sticky note\n removeDblClickEventListeners();\n event.stopPropagation();\n };\n\n // listen to enlarge event on the event bus and then enlarge the sticky note\n const handleEnlargeAction = async (action: StickyNoteEnlarge) => {\n if (disabled?.value) return;\n\n // another sticky note was enlarged, we shrink this one\n if (isEnlarged.value && action.id !== card.id) {\n void shrink();\n return;\n }\n\n // the sticky note was not enlarged and the event is for this sticky note\n if (!isEnlarged.value && action.id === card.id) {\n document.addEventListener(\"pointerdown\", shrinkOnBoardClick, {\n capture: true,\n });\n\n await enlarge(action.trigger);\n if (action.focus) focus();\n }\n };\n\n const handleShrinkAction = (action: StickyNoteShrink) => {\n if (isEnlarged.value && action.id === card.id) {\n void shrink();\n }\n };\n\n // used only when the sticky note was enlarged from outside\n const shrinkOnBoardClick = (event: MouseEvent) => {\n const target = eventTarget(event)!;\n // the click come from the same sticky note\n if (el.value?.contains(target)) {\n return;\n }\n // we ignore clicks from any html element that has data-ignore-click attribute so the sticky note\n // does not get deselected when we click on an item which was teleported to the body\n if (target.closest(\"[data-ignore-click]\")) {\n return;\n }\n\n // the click came outside from the board\n if (!target.closest(\"#boards > .board\")) return;\n\n void shrink();\n };\n\n const unregisterKeyUpAndPointerLeaveEvents = () => {\n el.value?.removeEventListener(\"pointerleave\", handleStickyNotePointerLeave);\n };\n\n const enlarge = async (trigger: StickyEnlargeTrigger) => {\n isEnlarged.value = true;\n isEnlarging.value = true;\n\n boardStore.setEnlargedStickyNoteId(card.id);\n\n await transition(\"enlarge-transition\");\n isEnlarging.value = false;\n\n const cardType = card.type.functionality;\n trackEvent(stickyNoteEnlarged(cardType, trigger));\n\n zoomWatcher.value = watch(\n () => useZoomStore().factor,\n () => shrink({ immediate: true }),\n { once: true },\n );\n\n enlargedWatcher.value = watch(\n () => boardStore.enlargedStickyNoteId,\n () => {\n if (boardStore.enlargedStickyNoteId !== card.id && isEnlarged.value) {\n void shrink();\n }\n },\n { once: true },\n );\n };\n\n const shrink = async ({ immediate = false } = {}) => {\n enlargedWatcher.value?.();\n zoomWatcher.value?.();\n\n trackEvent(stickyNoteShrunk(card.type.functionality));\n\n document.removeEventListener(\"pointerdown\", shrinkOnBoardClick, {\n capture: true,\n });\n\n isEnlarged.value = false;\n boardStore.setEnlargedStickyNoteId(null);\n\n if (immediate) return;\n\n isEnlarging.value = true;\n await transition(\"enlarge-transition\");\n isEnlarging.value = false;\n };\n\n // focus the sticky note by clicking on it\n const focus = () => {\n el.value?.querySelector(`.${TEXT_INPUT_WRAPPER_CLASS}`)?.click();\n };\n\n // This will enlarge the sticky note when the user hovers over it, with X key\n // pressed down.\n const handleStickyNotePointerEnter = async (_event: PointerEvent) => {\n await nextTick();\n if (disabled?.value || isActive.value || isEnlarged.value) {\n return;\n }\n\n // when dragged, the pointer leaves and enters the sticky note many times\n if (isDragged.value) return;\n\n // allow the user to enlarge the sticky note by double clicking on it\n registerDblClickEventListener();\n\n if (isKeyDown(\"KeyX\")) {\n void enlarge(\"key-x\");\n }\n\n el.value?.addEventListener(\"pointerleave\", handleStickyNotePointerLeave);\n };\n\n // This will reset the enlarged sticky note when the user leaves the sticky note while\n // holding space bar/ This means the sticky was not selected by releasing the space bar\n\n const handleStickyNotePointerLeave = async () => {\n await nextTick();\n\n // when dragged, the pointer leaves and enters the sticky note many times\n if (isDragged.value) return;\n\n if (isEnlarged.value && isActive.value) return;\n if (isEnlarged.value && !isActive.value) {\n void shrink();\n }\n\n unregisterKeyUpAndPointerLeaveEvents();\n removeDblClickEventListeners();\n };\n\n return { isEnlarged, isEnlarging, classes };\n}\n","import type { ComputedRef, Ref } from \"vue\";\nimport { computed, onMounted, ref, watch } from \"vue\";\n\nimport { registerCardDrag } from \"@/components/card/cardDragHandler\";\nimport { sendStickyNoteAction } from \"@/composables/useEventBus\";\nimport { windowToRelative } from \"@/math/coordinate-systems\";\nimport type { Card } from \"@/model/card\";\nimport { windowCoord } from \"@/model/coordinates\";\nimport { useBoardStore } from \"@/store/board\";\nimport { useDraggingStore } from \"@/store/dragging\";\nimport { linkBetween, useLinkStore } from \"@/store/link\";\nimport { eventTarget } from \"@/utils/dom/dom\";\n\ninterface Props {\n el: Ref;\n card: Card;\n disabled?: Ref>;\n}\n\ninterface UseLinkDragReturn {\n isLinkingTarget: ComputedRef>;\n isLinkingSource: ComputedRef>;\n}\n\nexport function useLinkDrag({ el, card, disabled }: Props): UseLinkDragReturn {\n onMounted(() => {\n if (disabled?.value) return;\n el?.value?.addEventListener(\"pointerenter\", handlePointerEnter);\n el.value?.addEventListener(\"pointerdown\", handlePointerDown);\n });\n\n const linkStore = useLinkStore();\n const boardStore = useBoardStore();\n\n // the sticky note is being linked to\n const isLinkingTarget = computed(() => linkStore.linking.to?.id === card.id);\n // the sticky note is being linked from\n const isLinkingSource = computed(() => linkStore.linking.from?.id === card.id);\n const enlargeAfterLinking = ref(false);\n\n watch(isLinkingTarget, (val) => {\n if (val) {\n el?.value?.addEventListener(\"pointerleave\", handlePointerLeave, {\n once: true,\n });\n }\n });\n\n // used to enlarge the sticky note after linking\n const handleDocumentPointerUp = (event: PointerEvent) => {\n if (!el.value) return;\n\n // this sends the enlarge event\n onLinkDragEnd();\n\n // hide the links\n const boardCard = boardStore.currentBoard().cards[card.id];\n useDraggingStore().endLinkDragging(card.id, event.pointerId, boardCard);\n linkStore.linking.from = null;\n };\n\n const handlePointerDown = (event: PointerEvent) => {\n const target = eventTarget(event)!;\n const isLinkDrag = target.classList.contains(\"link-drag\");\n\n if (disabled?.value || !isLinkDrag) return;\n\n if (boardStore.enlargedStickyNoteId === card.id) {\n enlargeAfterLinking.value = true;\n boardStore.setEnlargedStickyNoteId(null);\n\n useDraggingStore().startLinkDragging(\n card.id,\n event.pointerId,\n windowToRelative(windowCoord(event.clientX, event.clientY)),\n );\n\n document.addEventListener(\"pointerup\", handleDocumentPointerUp, {\n once: true,\n });\n }\n\n registerCardDrag(card, onLinkDragEnd, event);\n };\n\n const onLinkDragEnd = () => {\n if (enlargeAfterLinking.value) {\n enlargeAfterLinking.value = false;\n sendStickyNoteAction(card.id, {\n action: \"enlarge\",\n focus: true,\n trigger: \"after-link-drag\",\n });\n }\n };\n\n const handlePointerEnter = () => {\n if (\n !disabled?.value &&\n linkStore.linking.from?.id &&\n !linkStore.isLinkedFrom(card.id) &&\n !linkBetween(card, linkStore.linking.from)\n ) {\n useLinkStore().setLinkingTarget({ id: card.id, type: \"sticky\" });\n }\n };\n\n const handlePointerLeave = () => {\n if (linkStore.linking.to?.id === card.id) {\n useLinkStore().resetLinkingTarget();\n }\n };\n\n return {\n isLinkingTarget,\n isLinkingSource,\n };\n}\n","import type { Ref } from \"vue\";\nimport { computed, onMounted, watch } from \"vue\";\n\nimport { linkActions } from \"@/action/linkActions\";\nimport { useDelayedAction } from \"@/composables/utils/useDelayedAction\";\nimport type { Board } from \"@/model/board\";\nimport type { Card } from \"@/model/card\";\nimport { useDraggingStore } from \"@/store/dragging\";\nimport { useLinkStore } from \"@/store/link\";\nimport { stickyNotePinned, stickyNoteUnpinned } from \"@/utils/analytics/events\";\nimport { trackEvent } from \"@/utils/analytics/track\";\nimport { eventTarget } from \"@/utils/dom/dom\";\n\nexport interface Props {\n el?: Ref;\n board: Ref>;\n card: Card;\n disabled?: Ref>;\n delay?: number; // delay in milliseconds\n}\n\nexport function usePin({ el, card, board, disabled, delay = 500 }: Props) {\n const isPinned = computed(() => useLinkStore().isPinned(card.id));\n\n onMounted(() => {\n if (disabled?.value) return;\n\n el?.value?.addEventListener(\"pointerdown\", handlePointerDown);\n el?.value?.addEventListener(\"pointerup\", handlePointerUp);\n });\n\n watch(\n () => useDraggingStore().dragging[card.id],\n () => {\n cancelPin();\n cancelUnpin();\n },\n );\n\n const handlePointerDown = (event: PointerEvent) => {\n const target = eventTarget(event)!;\n const isLinkDrag = target.classList.contains(\"link-drag\");\n\n if (disabled?.value || isLinkDrag) return;\n\n if (isPinned.value) {\n delayedUnpin(event);\n } else {\n delayedPin(event);\n }\n };\n\n const handlePointerUp = () => {\n cancelPin();\n cancelUnpin();\n };\n\n // used to analytics\n const trackStateChange = (state: \"pinned\" | \"unpinned\") => {\n const stickyType = card.type.functionality;\n if (state === \"pinned\") {\n trackEvent(stickyNotePinned(stickyType, \"long-press\"));\n } else {\n trackEvent(stickyNoteUnpinned(stickyType, \"long-press\"));\n }\n };\n\n // prevent clicks on links when pinning/unpinning\n const linkClickPrevent = (target: HTMLElement | null) => {\n if (target instanceof HTMLAnchorElement) {\n target.addEventListener(\n \"click\",\n (e) => {\n e.preventDefault();\n },\n { once: true },\n );\n }\n };\n\n const pin = (event?: Event) => {\n if (event) {\n linkClickPrevent(eventTarget(event));\n }\n if (isPinned.value || useDraggingStore().isLinkDragging) return;\n\n linkActions.markCardLinkedCards(\"mouse\", board.value.cards[card.id]);\n\n trackStateChange(\"pinned\");\n };\n\n const unpin = (event?: Event) => {\n if (event) {\n linkClickPrevent(eventTarget(event));\n }\n if (!isPinned.value || useDraggingStore().isLinkDragging) return;\n\n useLinkStore().removeAllMarks();\n\n trackStateChange(\"unpinned\");\n };\n\n const [delayedPin, cancelPin] = useDelayedAction(pin, delay);\n const [delayedUnpin, cancelUnpin] = useDelayedAction(unpin, delay);\n\n return { isPinned, unpin, pin };\n}\n","import type { Directive } from \"vue\";\nimport { createApp, ref } from \"vue\";\n\nimport type { BoardLocation } from \"@/board/location/BoardLocation\";\nimport { cardsInLocation } from \"@/board/location/BoardLocation\";\nimport CardsSkipButton from \"@/components/a11y/CardsSkipButton.vue\";\nimport type { Board } from \"@/model/board\";\nimport type { BoardCard } from \"@/model/card\";\nimport { i18n } from \"@/translations/i18n\";\n\n/**\n * Sort cards by their position on the board\n */\nexport const byPosition = (a: BoardCard, b: BoardCard) => {\n const yDiff = a.meta.pos.y - b.meta.pos.y;\n const xDiff = a.meta.pos.x - b.meta.pos.x;\n return yDiff * 10 + xDiff;\n};\n\n/**\n * Generate the id for the cards-skip-button button in a board location\n */\nexport const skipButtonId = (location: BoardLocation) => `${location.name}-skip-button`;\n\n/**\n * Set the el's aria-owns to the ids of all associated Cards,\n * sorted by their position on the board\n *\n * @param el The element to set the aria-owns attribute on\n * @param board The board the element is on\n * @param location The board location the element represents\n */\nconst setAriaOwns = (el: HTMLElement, board: Board, location: BoardLocation) => {\n const cards = cardsInLocation(board, location);\n\n // Sort cards by their position, so that the\n // screen readers read them in the correct order\n const sortedCards = cards.sort(byPosition);\n const cardIds = sortedCards.map((card) => card.data.id).join(\" \");\n\n el.setAttribute(\"aria-owns\", cardIds);\n};\n\n/**\n * Focus on the first card in the board location (based on parent's aria-owns property)\n */\nconst focusFirstCard = (e: MouseEvent) => {\n const el = e.currentTarget as HTMLElement;\n const firstCardId = el.closest(\"[aria-owns]\")?.getAttribute(\"aria-owns\")?.split(\" \")?.[0];\n if (firstCardId) {\n document.getElementById(firstCardId)?.focus();\n }\n};\n\n/**\n * Add a cards-skip-button button to the board location that allows\n * the keyboard user to interact with the cards in that location\n */\nconst addSkipToCardsButton = (el: HTMLElement, location: BoardLocation, tabindex?: string) => {\n // Find the cards-skip-button button if it already exists in this element\n const existingButton = el.querySelector(\".cards-skip-button\");\n\n // If it already exists, update with appropriate id, tabindex, and click handler\n if (existingButton) {\n existingButton.id = skipButtonId(location);\n existingButton.addEventListener(\"click\", focusFirstCard);\n if (tabindex) {\n existingButton.setAttribute(\"tabindex\", tabindex);\n }\n return;\n }\n\n // Otherwise, add a cards-skip-button button to the board location\n const div = document.createElement(\"div\");\n el.appendChild(div);\n\n const buttonProps = { id: skipButtonId(location), tabindex: tabindex || \"0\" };\n\n createApp(CardsSkipButton, buttonProps).use(i18n).mount(div);\n div.addEventListener(\"click\", focusFirstCard);\n};\n\n/**\n * Directive to set the aria-owns attribute of an element\n * (representing a board location) to the ids of all cards\n * in that location.\n *\n * This allows screen readers to associate cards with their 'parent'\n * board location, so they can be navigated to *in logical order* while\n * navigating the board.\n *\n * The calculation is triggered when the element is focused, which is much\n * more efficient than to calculate it while the cards are loading.\n *\n * Usage: v-owned-cards=\"{\n * board: { the Board the element is on },\n * location: { the BoardLocation represented by the element}\n * tabindex: \"{ optional string value to set on the skip button element }\"\n * }\"\n */\nexport function ownedCards(): Directive {\n const focusedLocation = ref(null); // Shared across all instances of directive\n return {\n mounted(el, { value: { board, location, tabindex } }) {\n addSkipToCardsButton(el, location, tabindex);\n\n // On focusin, update the el's aria-owns attribute to reflect\n // the cards currently in the location\n el.addEventListener(\"focusin\", () => {\n if (focusedLocation.value?.index()?.toString() !== location.index()?.toString()) {\n setAriaOwns(el, board, location);\n }\n focusedLocation.value = location;\n });\n },\n };\n}\n","import type { ComputedRef, Ref } from \"vue\";\nimport { computed, onMounted, ref, watch } from \"vue\";\n\nimport { boardActions } from \"@/action/boardActions\";\nimport { cardActions } from \"@/action/cardActions\";\nimport { cardsInLocation } from \"@/board/location/BoardLocation\";\nimport type StickyNoteTextEditable from \"@/components/StickyNote/components/StickyNoteText/StickyNoteTextEditable.vue\";\nimport { TEXT_INPUT_WRAPPER_CLASS } from \"@/components/StickyNote/components/StickyNoteText/StickyNoteTextEditable.vue\";\nimport { isKeyDown } from \"@/components/shortcut/shortcuts\";\nimport { sendStickyNoteAction } from \"@/composables/useEventBus\";\nimport { useDelayedAction } from \"@/composables/utils/useDelayedAction\";\nimport { byPosition, skipButtonId } from \"@/directives/ownedCards\";\nimport { longClick } from \"@/model/Settings\";\nimport type { Board } from \"@/model/board\";\nimport { isBacklogBoard } from \"@/model/board\";\nimport type { Card, CardMeta } from \"@/model/card\";\nimport { useBoardStore } from \"@/store/board\";\nimport { useDraggingStore } from \"@/store/dragging\";\nimport { usePanModeStore } from \"@/store/panMode\";\nimport { useSelectionStore } from \"@/store/selection\";\nimport { eventTarget } from \"@/utils/dom/dom\";\n\nexport interface Props {\n el: Ref;\n // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents\n textInput: Ref;\n card: Card;\n board: Ref;\n cardMeta: CardMeta;\n disabled?: Ref;\n}\n\ninterface UseSelectReturn {\n isSelected: ComputedRef>;\n deactivateSticky: () => void;\n tabindex: number;\n wasActivatedByKeyboard: Ref;\n}\n\nexport function useSelect({\n el,\n textInput,\n board,\n card,\n cardMeta,\n disabled,\n}: Props): UseSelectReturn {\n const wasDragged = ref(false);\n const wasDraggedFromPalette = ref(false);\n\n const panModeClickCount = ref(0);\n\n // Tracks whether the sticky note was activated by keyboard\n const wasActivatedByKeyboard = ref(false);\n\n // Props for managing cards' tab order within board sections (on non-backlog boards)\n const managedTabOrder = computed(() => !isBacklogBoard(board.value?.type));\n const nextTabTarget = ref(null);\n const previousTabTarget = ref(null);\n\n const boardStore = useBoardStore();\n const dragStore = useDraggingStore();\n\n const isSelected = computed(() => boardStore.isStickySelected(card.id));\n const isActive = computed(() => boardStore.activeCardId === card.id);\n\n // Used to cancel the selection of the sticky note when the user\n // holds the left mouse button pressed on the board for more than 500ms\n const wasLongPressed = ref(false);\n const [setWasLongPressed, cancelSetWasLongPressed] = useDelayedAction(() => {\n if (wasDragged.value) return;\n wasLongPressed.value = true;\n }, longClick);\n\n onMounted(() => {\n if (disabled?.value) return;\n\n // event listeners for selecting the sticky note\n el.value?.addEventListener(\"click\", handleStickyNoteClick);\n el.value?.addEventListener(\"pointerdown\", handlePointerDown);\n el.value?.addEventListener(\"keydown\", handleKeyDown);\n el.value?.addEventListener(\"focusin\", handleFocusIn);\n });\n\n // set wasDragged to true when the user drags the sticky note\n watch(\n () => dragStore.dragging[card.id],\n (drag) => {\n if (drag?.fromPalette) wasDraggedFromPalette.value = true;\n if (drag) wasDragged.value = true;\n },\n );\n\n const handleStickyNoteClick = (event: UIEvent, fromKeyboard?: boolean) => {\n // Track whether the sticky note was activated by keyboard, so focus\n // can be returned to the sticky note after deactivation if needed\n wasActivatedByKeyboard.value = !!fromKeyboard;\n // if the action was already executed, this is a noop\n cancelSetWasLongPressed();\n\n if (wasLongPressed.value) {\n wasLongPressed.value = false;\n return;\n }\n\n // select sticky notes with a single click when the user has the\n // single click select mode enabled\n const isSingleClickSelect = useSelectionStore().selecting === \"click\";\n if (usePanModeStore().active && isSingleClickSelect && !wasDragged.value) {\n panModeClickCount.value =\n useBoardStore().activeCardId !== card.id ? 1 : panModeClickCount.value + 1;\n\n if (panModeClickCount.value === 1) {\n boardActions.clearCardSelection(\"mouse\");\n boardStore.setActiveCardId(card.id);\n boardActions.toggleCardSelection(\"mouse\", card.id);\n } else {\n panModeClickCount.value = 0;\n // Delay focusing to allow the dblclick event in useEnlarge.ts to register properly.\n // This is doen in order to enlarge a sticky note when preforming a dblclick on the TextEditable.\n // Without this, focusing on the input immediately after the second click\n // can prevent the dblclick event from firing.\n setTimeout(() => {\n textInput.value?.focus();\n }, 0);\n }\n return true;\n }\n\n // Multi select when the user clicks on the sticky note\n // while holding cmd on MacOS or ctrl on Windows or\n const isMultiSelect = isKeyDown(\"Meta\") || isKeyDown(\"Shift\");\n if (isMultiSelect && boardStore.activeCardId !== card.id) {\n boardStore.setActiveCardId(null);\n boardActions.toggleCardSelection(\"mouse\", card.id);\n return;\n }\n\n const target = eventTarget(event)!;\n\n // don't set the sticky note as active if the\n // user clicks on [data-ignore-click] element\n if (target.closest(\"[data-ignore-click]\")) return;\n\n // If the button is disabled (eg. in overview modal), ignore click\n if (\n el.value?.getAttribute(\"aria-disabled\") &&\n el.value?.getAttribute(\"aria-disabled\") !== \"false\"\n ) {\n return;\n }\n\n // We'll only focus the textInput when the user clicked on the text area\n // (makes it easier for the user to copy/paste the card)\n const clickedInput = !!target.closest(`.${TEXT_INPUT_WRAPPER_CLASS}`);\n\n if (\n isActive.value &&\n !document.activeElement?.querySelector(\".sticky-note-text-input\") &&\n clickedInput\n ) {\n textInput.value?.focus();\n return;\n }\n\n if (isActive.value) return;\n\n // disable clicks when the X key is down\n if (isKeyDown(\"KeyX\")) return;\n // // clicking was disabled from the outside\n if (disabled?.value) return;\n\n // Prevents the card from being selected when the user drags the card.\n // Ignore drag events from the sticky note palette\n if (wasDragged.value && !wasDraggedFromPalette.value) {\n wasDragged.value = false;\n wasDraggedFromPalette.value = false;\n return;\n }\n\n document.addEventListener(\"pointerdown\", handleOutsideClick, true);\n\n if (clickedInput) {\n textInput.value?.focus();\n }\n cardActions.startAlter(\"internal\", card.id);\n boardActions.cardToFront(\"internal\", card.id);\n\n boardActions.clearCardSelection(\"action-menu\");\n\n boardStore.selectSticky(card.id);\n boardStore.setActiveCardId(card.id);\n };\n\n // Set the activeCardId to null when the user clicks outside the card\n const handleOutsideClick = (event: MouseEvent) => {\n const target = eventTarget(event)!;\n\n // the click came from sticky note\n if (target.closest(`[id=\"${card.id}\"].sticky-note `)) {\n return;\n }\n\n // we ignore clicks from any html element that has data-ignore-click attribute so the sticky note\n // does not get deselected when we slick on an item which was teleported to the body\n if (target.closest(\"[data-ignore-click]\")) {\n return;\n }\n\n // the click was outside of a sticky note\n boardStore.setActiveCardId(null);\n sendStickyNoteAction(card.id, { action: \"shrink\" });\n boardActions.clearCardSelection(\"mouse\");\n\n document.removeEventListener(\"pointerdown\", handleOutsideClick, true);\n };\n\n // used to deselect all selected cards when the user clicks on a sticky note\n // while not holding the cmd or ctrl keys\n const handlePointerDown = (event: PointerEvent) => {\n const target = eventTarget(event)!;\n if (target.closest(\"[data-ignore-click]\")) return;\n\n // ignore clicks on the link drag icon\n const isLinkDrag = target.classList.contains(\"link-drag\");\n if (isLinkDrag) return;\n\n setWasLongPressed();\n\n const isMultiSelect = isKeyDown(\"Meta\") || isKeyDown(\"Shift\");\n const isSingleClickSelect = useSelectionStore().selecting === \"click\";\n const isOneOfSelected = boardStore.isStickySelected(card.id);\n\n if (\n !isSingleClickSelect &&\n !isMultiSelect &&\n !isOneOfSelected &&\n target.closest(\".sticky-note\")\n ) {\n boardActions.clearCardSelection(\"action-menu\");\n boardStore.setActiveCardId(null);\n }\n };\n\n /**\n * Handle keyboard events on the sticky note\n * Escape: Deactivate sticky note\n * Enter: Activate sticky note (if not yet active)\n */\n const handleKeyDown = (e: KeyboardEvent) => {\n switch (e.key) {\n case \"Enter\":\n // Activate sticky (equivalent to clicking on it)\n if (e.target !== el.value) return;\n e.preventDefault();\n handleStickyNoteClick(e, true);\n break;\n case e.shiftKey && \"Tab\":\n if (isActive.value || !managedTabOrder.value) return;\n e.preventDefault();\n previousTabTarget.value?.focus();\n break;\n case \"Tab\":\n if (isActive.value || !managedTabOrder.value) return;\n e.preventDefault();\n nextTabTarget.value?.focus();\n break;\n case \"Escape\":\n deactivateSticky();\n break;\n }\n };\n\n /**\n * When the sticky note is focused, deactivate the previous sticky\n * so that its action menu closes\n */\n const handleFocusIn = () => {\n const lastCard = useBoardStore().activeCardId;\n const isMultiSelecting =\n useSelectionStore().selecting !== \"no\" || isKeyDown(\"Meta\") || isKeyDown(\"Shift\");\n\n if (lastCard && lastCard !== card?.id && !isMultiSelecting) {\n useBoardStore().setActiveCardId(null);\n useBoardStore().unselectSticky(lastCard);\n // TODO: If the user moves to a different sticky with Shift+Tab, the previous\n // sticky stays selected. This will be fixed when we implement tab-nav on stickies\n }\n\n // Calculate the next and previous stickies for tab navigation\n updateTabNavTargets();\n };\n\n /**\n * Deactivates the sticky note in two steps\n * 1. (if active) Deselects sticky and closes open menu(s)\n * (calls stopAlter to persist changes)\n * 2. Blurs the sticky note (to remove focus ring)\n */\n const deactivateSticky = () => {\n if (isActive.value) {\n useBoardStore().unselectSticky(card?.id);\n useBoardStore().setActiveCardId(null);\n useBoardStore().setEnlargedStickyNoteId(null);\n document.removeEventListener(\"pointerdown\", handleOutsideClick, true);\n\n cardActions.stopAlter(\"internal\", card?.id);\n\n if (wasActivatedByKeyboard.value) {\n el.value?.focus();\n wasActivatedByKeyboard.value = false;\n }\n } else {\n el.value?.blur();\n }\n };\n\n /**\n * Determine the next and previous stickies (within the board section) for tab navigation\n * (tab order doesn't loop, instead it focuses on the section's 'cards-skip-button' button at\n * the beginning and end of the section)\n */\n const updateTabNavTargets = () => {\n if (!board.value || !cardMeta || !managedTabOrder.value) return;\n\n const location = useBoardStore().boardLocation(cardMeta.pos);\n\n const cards = cardsInLocation(board.value, location);\n const sortedCards = cards.sort(byPosition);\n\n const currentCardIndex = sortedCards.findIndex((c) => c.data.id === card.id);\n\n const nextTargetId =\n sortedCards.length > currentCardIndex + 1\n ? sortedCards[currentCardIndex + 1].data.id\n : skipButtonId(location);\n\n const prevTargetId =\n currentCardIndex > 0 ? sortedCards[currentCardIndex - 1].data.id : skipButtonId(location);\n\n nextTabTarget.value = document.getElementById(nextTargetId) || document.querySelector(\".board\");\n previousTabTarget.value =\n document.getElementById(prevTargetId) || document.querySelector(\".board\");\n };\n\n const tabindex = managedTabOrder.value ? -1 : 0;\n\n return { isSelected, deactivateSticky, tabindex, wasActivatedByKeyboard };\n}\n","import { createPopper } from \"@popperjs/core\";\nimport type { Placement } from \"@popperjs/core/lib/enums\";\nimport type { Ref } from \"vue\";\nimport { computed, nextTick, ref, watch } from \"vue\";\n\nimport { useUserStore } from \"@/store/user\";\nimport { useZoomStore } from \"@/store/zoom\";\n\nexport interface ActionMenuConfig {\n placement: Placement;\n offset: [number, number];\n}\n\ninterface Props {\n referenceEl: Ref;\n open: Ref;\n disabled: Ref>;\n config: Ref;\n}\n\nexport function useActionMenu({ referenceEl, open, disabled, config }: Props) {\n const isOpen = computed(() => {\n return (\n !!referenceEl.value &&\n open.value &&\n !disabled.value &&\n !useZoomStore().zooming &&\n useUserStore().isAllowed(\"edit\")\n );\n });\n\n const popperEl = ref();\n const popper = ref | null>(null);\n\n watch(isOpen, () => {\n if (isOpen.value) {\n void newPopper();\n } else {\n destroyPopper();\n }\n });\n\n watch(config, () => {\n void popper.value?.setOptions(popperOptions(config));\n });\n\n watch(referenceEl, async () => {\n await nextTick();\n destroyPopper();\n void newPopper();\n });\n\n async function newPopper() {\n if (popper.value) return;\n\n await nextTick();\n\n if (!referenceEl.value || !popperEl.value) return;\n\n popper.value = createPopper(\n referenceEl.value,\n popperEl.value,\n popperOptions(config, { name: \"flip\", enabled: false }),\n );\n }\n\n function popperOptions(config: Ref, ...modifiers: object[]) {\n return {\n placement: config.value.placement,\n modifiers: [{ name: \"offset\", options: { offset: config.value.offset } }, ...modifiers],\n };\n }\n\n function destroyPopper() {\n popper.value?.destroy();\n popper.value = null;\n }\n\n function updateRef(ref: HTMLElement) {\n popperEl.value = ref;\n }\n\n function updateMenu() {\n popper.value?.update();\n }\n\n function isInMenu(node: Node) {\n return popperEl.value?.contains(node);\n }\n\n return { isOpen, isInMenu, updateMenu, updateRef };\n}\n","import type { Ref } from \"vue\";\nimport { computed, watch } from \"vue\";\n\nimport type { ActionMenuConfig } from \"@/components/ActionMenu/useActionMenu\";\nimport { useActionMenu } from \"@/components/ActionMenu/useActionMenu\";\nimport type { Card } from \"@/model/card\";\nimport variables from \"@/model/variable.module.scss\";\nimport { useBoardStore } from \"@/store/board\";\nimport { useDraggingStore } from \"@/store/dragging\";\nimport { useLinkStore } from \"@/store/link\";\nimport { isElementInViewport } from \"@/utils/dom/dom\";\n\ninterface Props {\n referenceEl: Ref;\n card: Card;\n isPinned: Ref>;\n disabled: Ref>;\n}\n\nexport function useStickyActionMenu({ referenceEl, card, disabled, isPinned }: Props) {\n const open = computed(() => {\n return (\n useBoardStore().activeCardId === card.id &&\n !useDraggingStore().dragging[card.id] &&\n !useLinkStore().linking.from\n );\n });\n\n const size = parseInt(variables.stickySize.replace(\"px\", \"\"));\n const config = computed(() => {\n return {\n placement: \"top\",\n offset: referenceEl.value ? calculateOffset(referenceEl.value, isPinned.value, size) : [0, 0],\n };\n });\n\n const { isOpen, updateMenu, updateRef } = useActionMenu({\n referenceEl,\n open,\n disabled,\n config,\n });\n\n watch(isOpen, () => {\n // hide the action menu if the sticky note is not in the viewport\n if (isOpen.value && !isElementInViewport(referenceEl.value)) {\n useBoardStore().activeCardId = null;\n useBoardStore().unselectSticky(card.id);\n }\n });\n\n // update the action menu position when the card type, or priority changes\n watch([() => card.type, () => card.priority], updateMenu);\n\n return { isOpen, updateRef };\n}\n\n/**\n * Calculates the offset for the action menu of a sticky note.\n *\n * @param referenceEl - The reference element to which the action menu is positioned.\n * @param isPinned - A boolean indicating whether the sticky note is pinned.\n * @param size - The initial size of the sticky note, 240px\n * @returns A tuple containing the x and y offsets for the action menu.\n */\nfunction calculateOffset(referenceEl: Element, isPinned: boolean, size: number): [number, number] {\n const multiplier = size / referenceEl.getBoundingClientRect().height;\n const offsetY = isPinned ? 11 : 5;\n\n return [0, offsetY / multiplier];\n}\n","import type { CSSProperties, Ref } from \"vue\";\nimport { computed } from \"vue\";\n\nimport type { BoardMeta } from \"@/components/board/injectKeys\";\nimport { validateCardPositionInBoard } from \"@/math/coordinate-systems\";\nimport { cardZoomHeight, stickySize, zoomFactor } from \"@/model/Settings\";\nimport { type Board } from \"@/model/board\";\nimport type { Card, CardMeta } from \"@/model/card\";\nimport { boardCoord } from \"@/model/coordinates\";\nimport { isFullyFaded } from \"@/model/markMode\";\nimport variables from \"@/model/variable.module.scss\";\nimport { cardColor } from \"@/store/card\";\nimport { useDraggingStore } from \"@/store/dragging\";\nimport { useZoomStore } from \"@/store/zoom\";\nimport { contrastCssColor, toCssColor } from \"@/utils/color\";\n\ntype Args = Readonly<{\n card: Ref;\n cardMeta: Ref;\n board: Ref;\n isEnlarged: Ref>;\n isActive: Ref>;\n boardMeta: BoardMeta;\n}>;\n\nexport const useStyles = ({ card, board, cardMeta, isEnlarged, isActive, boardMeta }: Args) => {\n const sizes = computed(() => {\n const normalSize = boardMeta.size.x * board.value.cardSize.factor * zoomFactor.x;\n\n const enlargedSize = isEnlarged.value\n ? (cardZoomHeight * boardMeta.size.y) / useZoomStore().factor\n : 0;\n\n return enlargedSize > normalSize\n ? { effective: enlargedSize, enlarged: enlargedSize / normalSize }\n : { effective: normalSize, enlarged: 1 };\n });\n\n const zIndex = computed(() => {\n if (isEnlarged.value) {\n return board.value.maxZ + 100;\n }\n\n return isFullyFaded(cardMeta.value.mark) && !isActive.value\n ? +variables.zIndexLinks - 1\n : cardMeta.value.zIndex;\n });\n\n const position = computed(() => {\n const dragPos = useDraggingStore().dragging[card.value.id]?.pos;\n const relativePos = dragPos || cardMeta.value.pos;\n const size = sizes.value.effective;\n\n const pos = boardCoord(\n relativePos.x * boardMeta.size.x - size / 2,\n relativePos.y * boardMeta.size.y - size / 2,\n );\n\n const o = validateCardPositionInBoard(pos, { width: size, height: size }, isEnlarged.value);\n return { ...pos, offset: boardCoord(o.offsetX, o.offsetY) };\n });\n\n const backgroundColor = computed(() => cardColor(card.value, board.value));\n\n const contrastingTextColor = computed(() => contrastCssColor(backgroundColor.value));\n\n const styles = computed(() => ({\n zIndex: zIndex.value,\n color: contrastingTextColor.value,\n backgroundColor: toCssColor(backgroundColor.value),\n top: position.value.y + \"px\",\n left: position.value.x + \"px\",\n transform: `scale(${sizes.value.effective / stickySize})`,\n }));\n\n return { styles, sizes, position };\n};\n","\n\n\n\n\n","\n\n\n\n\n","import type { InjectionKey } from \"vue\";\n\nexport const tabStateKey: InjectionKey = Symbol(\"tabState\");\n\nexport interface Tab {\n id: string;\n title: string;\n}\n\nexport interface TabState {\n activeId: Tab[\"id\"] | null;\n tabs: Tab[];\n}\n","\n\n\n","\n\n\n\n\n","\n\n\n\n\n","import { sender } from \"@/backend/Sender\";\nimport type { BoardId } from \"@/model/board\";\nimport type { Objective } from \"@/model/objective\";\nimport { useObjectiveStore } from \"@/store/objective\";\nimport { useToastStore } from \"@/store/toast\";\n\nimport { action, ctxAction, defineActions } from \"./actions\";\n\nexport const objectiveActions = defineActions(\"objective\", {\n add: ctxAction((ctx, e: Partial & BoardId, isCommitted = true) => {\n const obj = useObjectiveStore().add(e, isCommitted);\n ctx.track({ objectiveId: obj.id, isStretch: !isCommitted });\n sender.addObjective(e.boardId, obj);\n if (!isCommitted) {\n //todo: this should be refactored by changing addObjective API to cover setting stretch\n setTimeout(() => sender.moveObjective(e.boardId, obj.id, true, 0), 500);\n }\n return obj;\n }),\n remove: action((boardId: string, objectiveId: string) => {\n useObjectiveStore().remove({ id: objectiveId, boardId });\n sender.deleteObjective(boardId, objectiveId);\n useToastStore().show(/*$t*/ \"objective.deleted\", { invisible: true });\n }),\n move: action((boardId: string, objectiveId: string, data: { stretch: boolean; rank: number }) => {\n useObjectiveStore().move({ id: objectiveId, boardId, ...data });\n sender.moveObjective(boardId, objectiveId, data.stretch, data.rank);\n }),\n setTitle: action(\n (boardId: string, objective: Objective, title: string) => {\n objective.text = title;\n useObjectiveStore().update({ boardId, ...objective });\n sender.updateObjective(boardId, objective);\n },\n { history: { merge: true, saveState: (_, obj) => ({ id: obj.id }) } },\n ),\n setDescription: action(\n (boardId: string, objective: Objective, description: string) => {\n objective.description = description;\n useObjectiveStore().update({ boardId, ...objective });\n sender.updateObjective(boardId, objective);\n },\n { history: { merge: true, saveState: (_, obj) => ({ id: obj.id }) } },\n ),\n setAv: ctxAction(\n (ctx, boardId: string, objective: Objective, isCommitted: boolean, av: number) => {\n ctx.track({\n hadPreviousValue: (objective.av ?? 0) !== 0,\n hasNewValue: true,\n objectiveId: objective.id,\n isStretch: !isCommitted,\n });\n objective.av = av;\n useObjectiveStore().update({ boardId, ...objective });\n sender.updateObjective(boardId, objective);\n },\n ),\n setBv: ctxAction(\n (ctx, boardId: string, objective: Objective, isCommitted: boolean, bv: number) => {\n ctx.track({\n hadPreviousValue: (objective.bv ?? 0) !== 0,\n hasNewValue: true,\n objectiveId: objective.id,\n isStretch: !isCommitted,\n });\n objective.bv = bv;\n useObjectiveStore().update({ boardId, ...objective });\n sender.updateObjective(boardId, objective);\n },\n ),\n});\n","import { Vue } from \"vue-class-component\";\n\nimport type { Action } from \"@/action/types\";\nimport type { Key } from \"@/components/shortcut/key\";\nimport { accept, key, noAccept } from \"@/components/shortcut/key\";\nimport type { ShortcutOptions } from \"@/components/shortcut/shortcuts\";\nimport { doRegisterShortcut, doUnregisterShortcuts } from \"@/components/shortcut/shortcuts\";\nimport { useModalStore } from \"@/store/modal\";\n\n// TODO a stack of focuses instead?\nlet focus: ShortcutUser | null = null;\n\nexport default class ShortcutUser extends Vue {\n private focusObj = {};\n\n globalShortcut(key: Key, handler: (e: KeyboardEvent) => void, options?: ShortcutOptions) {\n doRegisterShortcut(\n this,\n (e) => !useModalStore().isModalOpen() && accept(key.accept)(e),\n handler,\n options,\n );\n }\n\n globalActionShortcut(action: Action | Action<[e: KeyboardEvent]>, options?: ShortcutOptions) {\n if (action.data.shortcut.accept !== noAccept) {\n this.globalShortcut(\n action.data.shortcut,\n (e: KeyboardEvent) =>\n options?.withEvent && action.length === 2\n ? action(\"keyboard-shortcut\", e)\n : (action as Action)(\"keyboard-shortcut\"),\n options,\n );\n }\n }\n\n shortcut(k: string, handler: (e: KeyboardEvent) => void, options?: ShortcutOptions) {\n if (focus && focus !== this) {\n doUnregisterShortcuts(focus.focusObj);\n }\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n focus = this;\n doRegisterShortcut(this.focusObj, key(k).accept, handler, options);\n }\n\n unmounted() {\n this.unregisterShortcuts();\n }\n\n unregisterShortcuts() {\n doUnregisterShortcuts(this);\n doUnregisterShortcuts(this.focusObj);\n if (focus === this) {\n focus = null;\n }\n }\n}\n","\n\n\n","\n\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n\n","\n\n\n\n\n\n\n\n","\n\n\n\n","\n\n\n\n\n\n\n","\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n","\n\n\n\n\n","\n\n\n","\n\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n\n","\n\n\n\n\n","import { defineStore } from \"pinia\";\n\ntype MenuPosition = \"right\" | \"left\";\n\ninterface State {\n defaultPosition: MenuPosition;\n position: MenuPosition;\n disabledShiftButton: boolean;\n}\n\nfunction togglePosition(position: string) {\n return position === \"left\" ? \"right\" : \"left\";\n}\n\nexport const useBoardMenuStore = defineStore(\"boardMenu\", {\n state: (): State => {\n return {\n defaultPosition: \"left\",\n position: \"left\",\n disabledShiftButton: false,\n };\n },\n actions: {\n toggleMenuPosition() {\n this.position = togglePosition(this.position);\n this.defaultPosition = togglePosition(this.defaultPosition);\n },\n setMenuPosition(position: MenuPosition | \"default\") {\n if (position === \"default\") {\n this.position = this.defaultPosition;\n this.disabledShiftButton = false;\n } else {\n this.position = position;\n this.disabledShiftButton = true;\n }\n },\n },\n});\n","export default \"__VITE_ASSET__BiP6bR9P__\"","import { defineStore } from \"pinia\";\n\nimport drawLines from \"@/assets/draw-lines.gif\";\nimport type { BoardType } from \"@/model/baseTypes\";\nimport { isBacklogBoard, isObjectivesBoard } from \"@/model/board\";\nimport type { Line, LineComponent, RelativeCoordinate } from \"@/model/coordinates\";\nimport type { Shape } from \"@/model/shape\";\n\nimport { useToastStore } from \"./toast\";\n\ninterface DrawState {\n active: boolean;\n selected: SelectedShape | null;\n}\n\ntype SelectedShape = { shape: Shape } & Selected;\nexport type Selected =\n | { anchor: LineComponent | null }\n | { anchor: \"line\"; offset: Line };\n\nexport const useDrawStore = defineStore(\"draw\", {\n state: (): DrawState => ({\n active: false,\n selected: null,\n }),\n getters: {\n isSupportedBoard() {\n return (boardType: BoardType) => !isObjectivesBoard(boardType) && !isBacklogBoard(boardType);\n },\n },\n actions: {\n toggleActive() {\n this.active = !this.active;\n this.updateSelected();\n },\n inactivate() {\n this.active = false;\n this.updateSelected();\n },\n updateSelected() {\n if (this.active) {\n useToastStore().show(/*$t*/ \"message.lineTool\", {\n titleKey: /*$t*/ \"action.lineTool\",\n imageUrl: drawLines,\n closeable: true,\n });\n } else {\n this.selected = null;\n }\n },\n },\n});\n","import { defineStore } from \"pinia\";\n\nexport const useSwitchSessionStore = defineStore(\"switchSession\", {\n state: () => ({\n active: false,\n }),\n actions: {\n toggleActive() {\n this.active = !this.active;\n },\n inactivate() {\n this.active = false;\n },\n },\n});\n","import OverviewModal from \"@/components/modal/OverviewModal.vue\";\nimport ShortcutsModal from \"@/components/modal/ShortcutsModal.vue\";\nimport TeamObjectivesModal from \"@/components/modal/TeamObjectivesModal.vue\";\nimport MetricsModal from \"@/components/modal/metrics/MetricsModal.vue\";\nimport OverallMetricsModal from \"@/components/modal/metrics/OverallMetricsModal.vue\";\nimport SettingsModal from \"@/components/modal/settings/SettingsModal.vue\";\nimport { useActivityStore } from \"@/store/activity\";\nimport { useBoardStore } from \"@/store/board\";\nimport { useBoardMenuStore } from \"@/store/boardMenu\";\nimport { useClientSettingsStore } from \"@/store/clientSettings\";\nimport { useDrawStore } from \"@/store/draw\";\nimport { usePanModeStore } from \"@/store/panMode\";\nimport { usePointerStore } from \"@/store/pointer\";\nimport { useSearchMenuStore } from \"@/store/searchMenu\";\nimport { useSwitchSessionStore } from \"@/store/switchSession\";\nimport { useTimerStore } from \"@/store/timer\";\nimport { useWorkModeStore } from \"@/store/workMode\";\nimport {\n boardHistoryClosed,\n boardHistoryOpened,\n searchClosed,\n searchOpened,\n} from \"@/utils/analytics/events\";\n\nimport { action, ctxAction, defineActions } from \"./actions\";\nimport { boardActions } from \"./boardActions\";\nimport { navigationActions } from \"./navigationActions\";\nimport type { ActionContext } from \"./types\";\n\nexport const toggleActions = defineActions(\"toggle\", {\n showTrailingPointer: action(() => usePointerStore().togglePointerActivation(), {\n name: /*$t*/ \"action.pointer\",\n icon: \"menu-bottom/pointer\",\n }),\n togglePanMode: action(() => usePanModeStore().toggleActive(), {\n name: /*$t*/ \"action.panMode\",\n icon: \"action/pan\",\n }),\n showPanMode: action(() => {\n if (usePanModeStore().activate()) {\n boardActions.clearCardSelection(\"internal\");\n }\n }),\n hidePanMode: action(() => {\n usePanModeStore().inactivate();\n boardActions.clearCardSelection(\"internal\");\n }),\n toggleWorkMode: ctxAction(\n (ctx) => {\n useWorkModeStore().toggle();\n ctx.track({ workMode: useWorkModeStore().workingMode });\n },\n { name: /*$t*/ \"action.toggleWorkMode\" },\n ),\n showTimer: action(toggleTimer, {\n name: /*$t*/ \"action.timer\",\n icon: \"menu-top/timer\",\n }),\n toggleBoardDiff: ctxAction(toggleBoardDiff, {\n name: /*$t*/ \"boardDiff.boardTitle\",\n icon: \"menu-top/history\",\n }),\n showSwitchSession: ctxAction(\n (ctx) => {\n if (useSwitchSessionStore().active) {\n ctx.track(null);\n }\n useSwitchSessionStore().toggleActive();\n },\n { name: /*$t*/ \"switchSession.title\" },\n ),\n showSearch: ctxAction(toggleSearch, { name: /*$t*/ \"action.search\" }),\n showTeamObjectives: ctxAction(showTeamObjectives, {\n name: /*$t*/ \"action.teamObjectives\",\n }),\n showOverview: ctxAction(\n (ctx, attrs) => navigationActions.openModal(ctx, OverviewModal, { attrs }),\n { name: /*$t*/ \"action.showOverview\" },\n ),\n showProgramMetrics: ctxAction((ctx) => navigationActions.openModal(ctx, OverallMetricsModal), {\n name: /*$t*/ \"action.programMetrics\",\n icon: \"menu-top/metrics\",\n }),\n showTeamMetrics: ctxAction((ctx) => navigationActions.openModal(ctx, MetricsModal), {\n name: /*$t*/ \"action.teamMetrics\",\n icon: \"menu-top/metrics\",\n }),\n shiftMenu: action(() => useBoardMenuStore().toggleMenuPosition(), {\n name: /*$t*/ \"action.shiftMenu\",\n icon: \"arrow/right-shift\",\n }),\n showStats: action(() => useClientSettingsStore().toggleShowStats(1)),\n showStatGraphs: action(() => useClientSettingsStore().toggleShowStats(2)),\n showDraw: action(() => useDrawStore().toggleActive(), {\n name: /*$t*/ \"contextMenu.drawModeOn\",\n icon: \"draw/line\",\n }),\n hideDraw: action(() => useDrawStore().toggleActive(), {\n name: /*$t*/ \"contextMenu.drawModeOff\",\n icon: \"draw/line\",\n }),\n showSettings: ctxAction(\n (ctx) =>\n navigationActions.openModal(ctx, SettingsModal, {\n attrs: { isUserOnBoard: true },\n }),\n { name: /*$t*/ \"action.settings\" },\n ),\n showShortcuts: ctxAction((ctx) => navigationActions.openModal(ctx, ShortcutsModal), {\n name: /*$t*/ \"action.shortcuts\",\n }),\n toggleArchivedSessions: action(() => useClientSettingsStore().toggleArchivedSessions(), {\n name: /*$t*/ \"sessionSelectionModal.showArchived\",\n }),\n});\n\nfunction toggleTimer() {\n useTimerStore().toggleTimer();\n useBoardMenuStore().setMenuPosition(useTimerStore().active ? \"left\" : \"default\");\n}\n\nfunction toggleBoardDiff(ctx: ActionContext) {\n const isActive = useActivityStore().isBoardActivityOpen;\n ctx.track(isActive ? boardHistoryClosed(ctx.source) : boardHistoryOpened(ctx.source));\n useActivityStore().toggleBoard();\n}\n\nfunction toggleSearch(ctx: ActionContext, keepFilters?: boolean) {\n const isActive = useSearchMenuStore().isSearchSidebarOpen;\n ctx.track(isActive ? searchClosed(ctx.source, keepFilters) : searchOpened(ctx.source));\n useSearchMenuStore().toggleSearch();\n}\n\nfunction showTeamObjectives(ctx: ActionContext) {\n const board = useBoardStore().currentBoard();\n if (board.type === \"team\") {\n navigationActions.openModal(ctx, TeamObjectivesModal, {\n attrs: { boardId: board.id },\n });\n }\n}\n","import type { Session } from \"@/model/session\";\nimport { i18n } from \"@/translations/i18n\";\n\nimport { isAfter, isBefore, plusDays } from \"./date\";\nimport { formatLongDate } from \"./dateFormat\";\n\nconst formatDate = formatLongDate;\n\ninterface Range {\n from: Date;\n to: Date;\n}\n\nexport function sessionExecution(session: Session): Range {\n return {\n from: sessionStartDate(session),\n to: plusDays(sessionEndDate(session), -1),\n };\n}\n\nexport function sessionPlanning(session: Session): Range | undefined {\n return session.planningStart\n ? { from: session.planningStart, to: planningEndDate(session) }\n : undefined;\n}\n\nexport function rangeText(range: Range) {\n return i18n.global.t(\"date.range\", {\n from: formatDate(range.from),\n to: formatDate(range.to),\n });\n}\n\nexport function isRangeActive(range?: Range) {\n return !!(range && isBefore(range.from, new Date()) && isAfter(range.to, new Date()));\n}\n\nfunction sessionStartDate(session: Session) {\n return session.planningStart || session.iterations[0].start;\n}\n\nfunction sessionEndDate(session: Session) {\n return session.iterations[session.iterations.length - 1].end;\n}\n\nfunction planningEndDate(session: Session) {\n return session.planningEnd ? plusDays(session.planningEnd, 1) : session.iterations[0].start;\n}\n","\n\n\n\n\n","import SessionSelectionModal from \"@/components/modal/SessionSelectionModal.vue\";\n\nexport const staticModals = [SessionSelectionModal];\n","import { isArray } from \"lodash-es\";\nimport type { LocationQuery, LocationQueryValue } from \"vue-router\";\n\ntype QueryValue = LocationQueryValue | LocationQueryValue[];\n\nexport function firstQueryParam(query: LocationQuery, name: string) {\n return firstQueryValue(query[name]);\n}\n\nexport function serializeObject(obj: object, prefix: string): LocationQuery {\n return Object.fromEntries(\n Object.entries(obj).map(([key, value]) => [prefix + key, serialize(value)]),\n );\n}\n\nexport function deserializeObject(query: LocationQuery, prefix: string) {\n return Object.fromEntries(\n Object.entries(query).flatMap(([key, value]) =>\n key.startsWith(prefix)\n ? [[key.substring(prefix.length), deserialize(firstQueryValue(value))]]\n : [],\n ),\n );\n}\n\nexport function removePropsWithPrefix(query: LocationQuery, prefix: string) {\n return Object.fromEntries(\n Object.entries(query).flatMap(([key, value]) => (key.startsWith(prefix) ? [] : [[key, value]])),\n );\n}\n\nfunction firstQueryValue(value?: QueryValue): LocationQueryValue | undefined {\n return isArray(value) ? value[0] : value;\n}\n\nfunction serialize(value: unknown[] | string): LocationQueryValue {\n if (isArray(value)) {\n return \"[\" + value.join() + \"]\";\n }\n return value;\n}\n\nfunction deserialize(value?: LocationQueryValue): QueryValue {\n if (!value) {\n return null;\n }\n return value.startsWith(\"[\") && value.endsWith(\"]\")\n ? value.substring(1, value.length - 1).split(\",\")\n : value;\n}\n","import { defineStore } from \"pinia\";\nimport type { Component, ComponentOptionsBase } from \"vue\";\nimport { computed, markRaw, ref, watch } from \"vue\";\nimport { useRoute } from \"vue-router\";\n\nimport { getRouter } from \"@/router\";\nimport { staticModals } from \"@/utils/staticModals\";\nimport {\n deserializeObject,\n firstQueryParam,\n removePropsWithPrefix,\n serializeObject,\n} from \"@/utils/vue/queryParam\";\n\ninterface Modal {\n component: Component | null;\n attrs?: Record;\n openedAt: ReturnType;\n}\n\nconst QUERY_PREFIX = \"modal\";\n\nexport const useModalStore = defineStore(\"modal\", () => {\n const modal = ref({\n component: null,\n attrs: {},\n openedAt: 0,\n });\n\n const isModalOpen = (component?: Modal[\"component\"]) => {\n return !!modal.value.component && (!component || component === modal.value.component);\n };\n\n const wasModalJustOpened = computed(() => Date.now() - modal.value.openedAt < 100);\n\n const route = useRoute();\n\n function open(component: Component, options?: { attrs?: Record }) {\n updateQuery(component, options?.attrs || {});\n }\n\n function changeAttrs(attrs: Record) {\n if (modal.value.component) {\n updateQuery(modal.value.component, { ...modal.value.attrs, ...attrs });\n }\n }\n\n function updateQuery(component: Component, props: Record) {\n void getRouter().syncPush(() => ({\n query: {\n ...route.query,\n modal: componentName(component),\n ...serializeObject(props, QUERY_PREFIX),\n },\n }));\n }\n\n function close() {\n void getRouter().syncPush(() => ({\n query: removePropsWithPrefix(route.query, QUERY_PREFIX),\n }));\n }\n\n watch(route, async (route) => {\n const queryModal = firstQueryParam(route.query, \"modal\");\n if (!queryModal && modal.value.component) {\n modal.value = {\n component: null,\n attrs: {},\n openedAt: 0,\n };\n } else if (queryModal) {\n const component = await findModal(queryModal);\n if (component) {\n modal.value = {\n component: markRaw(component),\n attrs: deserializeObject(route.query, QUERY_PREFIX),\n openedAt: Date.now(),\n };\n }\n }\n });\n\n async function findModal(name: string) {\n return doFindModal(staticModals, name) || (await findDynamicModal(name));\n }\n\n const dynamicModals = new Array();\n\n async function findDynamicModal(name: string) {\n if (dynamicModals.length === 0) {\n dynamicModals.push(...(await import(\"@/utils/dynamicModals\")).dynamicModals);\n }\n return doFindModal(dynamicModals, name);\n }\n\n function doFindModal(modals: Component[], name: string) {\n return modals.find((comp) => componentName(comp) === name);\n }\n\n return { modal, isModalOpen, wasModalJustOpened, open, close, changeAttrs };\n});\n\nexport function componentName(comp: Component) {\n /* eslint-disable @typescript-eslint/no-explicit-any */\n return comp.name || (comp as ComponentOptionsBase).__name;\n /* eslint-enable */\n}\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","import { defineStore } from \"pinia\";\n\nimport type { Id } from \"@/model/baseTypes\";\nimport type { Category } from \"@/model/flexboard\";\n\nexport const useCategoryStore = defineStore(\"category\", {\n state: () => ({\n categories: [] as Category[],\n }),\n\n getters: {\n getCategoryById: (state) => (id: string) => {\n return state.categories.find((c) => c.id === id);\n },\n getCategoryByName: (state) => (name?: string) => {\n return name && state.categories.find((c) => c.name === name);\n },\n getCategories: (state) => {\n return state.categories;\n },\n },\n\n actions: {\n add(id: string, name: string) {\n this.categories.push({\n id,\n name,\n boardIds: [],\n fresh: true,\n });\n },\n\n update(payload: Id & { name?: string; position?: number }) {\n const i = this.categories.findIndex((c) => c.id === payload.id);\n const cat = this.categories[i];\n if (payload.name !== undefined) {\n cat.name = payload.name;\n }\n if (payload.position !== undefined) {\n this.categories.splice(i, 1);\n this.categories.splice(payload.position, 0, cat);\n }\n },\n\n remove(e: Id) {\n const index = this.categories.findIndex((c) => c.id === e.id);\n if (index !== -1) {\n this.categories.splice(index, 1);\n }\n },\n\n addBoard(e: { boardId: string; categoryId: string }) {\n const cat = this.categories.find((c) => c.id === e.categoryId)!;\n cat.boardIds.push(e.boardId);\n },\n\n removeBoard(payload: { boardId: string; categoryId: string }) {\n const cat = this.categories.find((c) => c.id === payload.categoryId)!;\n const index = cat.boardIds.findIndex((b) => b === payload.boardId);\n if (index !== -1) {\n cat.boardIds.splice(index, 1);\n }\n },\n },\n});\n","import { sender } from \"@/backend/Sender\";\nimport { useCategoryStore } from \"@/store/category\";\n\nimport { action, defineActions } from \"./actions\";\n\nexport const categoryActions = defineActions(\"category\", {\n add: action((name: string) => {\n sender.addCategory(name).then((id) => useCategoryStore().add(id, name));\n }),\n update: action((id: string, data: { name?: string; position?: number }) => {\n sender.updateCategory(id, data);\n useCategoryStore().update({ id, ...data });\n }),\n remove: action((id: string) => {\n sender.deleteCategory(id);\n useCategoryStore().remove({ id });\n }),\n addBoard: action((boardId: string, categoryId: string) => {\n if (categoryId) {\n sender.addBoardToCategory(boardId, categoryId);\n useCategoryStore().addBoard({ boardId, categoryId });\n }\n }),\n removeBoard: action((boardId: string, categoryId: string) => {\n if (categoryId) {\n sender.removeBoardFromCategory(boardId, categoryId);\n useCategoryStore().removeBoard({ boardId, categoryId });\n }\n }),\n});\n","import { sender } from \"@/backend/Sender\";\nimport type { BoardData } from \"@/model/board\";\nimport type { FlexType } from \"@/model/flexboard\";\nimport { useBoardsStore } from \"@/store/boards\";\n\nimport { action, defineActions } from \"./actions\";\n\nexport const flexActions = defineActions(\"flex\", {\n add: action((type: FlexType, name: string) => {\n return sender\n .addBoard(type.id, name)\n .then((id) => useBoardsStore().addFlexBoard(id, name, type));\n }),\n update: action((id: string, name: string) => {\n sender.updateBoard(id, name);\n (useBoardsStore().boardById(id) as BoardData<\"flex\">).name = name;\n }),\n delete: action((id: string) => {\n sender.deleteBoard(id);\n useBoardsStore().removeFlexBoard(id);\n }),\n});\n","\n\n\n\n\n","\n\n\n","import { getAlmConnectionId, getAlmInfo } from \"@/backend/Backend\";\nimport type { BoardType } from \"@/model/baseTypes\";\nimport { useSessionStore } from \"@/store/session\";\nimport { useUserStore } from \"@/store/user\";\nimport { adminUrl } from \"@/utils/env/Environment\";\n\nexport function cockpitSessionUrl(boardType?: BoardType) {\n const sessionId = useSessionStore().current.id;\n const path = boardTypeSetupPath[boardType!] || \"generalInformation\";\n return sessionId\n ? `${adminUrl}/edit-session?id=${sessionId}&path=${path}`\n : `${adminUrl}/safepiplannings`;\n}\n\nexport function cockpitProfileUrl(path?: string) {\n const sessionId = useSessionStore().current.id;\n path = encodeURIComponent(path || \"\");\n return sessionId && path\n ? `${adminUrl}/profile?mapping=${sessionId}&path=${path}`\n : `${adminUrl}/profile`;\n}\n\nexport function cockpitConnectionUrl() {\n const almConnectionId = getAlmConnectionId() || \"\";\n const almPath = getAlmInfo().cockpitPath;\n return `${adminUrl}/alm-connections/${almPath}/${almConnectionId}`;\n}\n\nexport function cockpitBillingUrl() {\n return useUserStore().isTraining ? `${adminUrl}/trainingBilling` : `${adminUrl}/billing`;\n}\n\nconst boardTypeSetupPath: { [type in BoardType]?: string } = {\n backlog: \"programBacklogBoard\",\n program: \"programBoard\",\n solution: \"solutionPlanningBoard\",\n solution_backlog: \"solutionBacklogBoard\",\n risk: \"riskBoard\",\n team: \"teamBoards\",\n flex: \"flexBoards\",\n};\n","import { isString } from \"lodash-es\";\n\nfunction get(a: T, prop?: Key): T | T[Key] {\n return prop ? a[prop] : a;\n}\n\nexport function contains(\n as: T[],\n a: T | T[Key] | null | undefined,\n prop?: Key,\n): boolean {\n return as.some((b) => normalize(get(b, prop)) === normalize(a));\n}\n\n// transform all falsy values except 0 to undefined, so they can be compared with ===\nfunction normalize(value: unknown): unknown {\n return !value && value !== 0 ? undefined : value;\n}\n\nexport function matches(\n as: T[],\n a: T | T[Key] | null | undefined,\n prop?: Key,\n) {\n return as.length === 0 || contains(as, a, prop);\n}\n\nexport function toggle(as: T[], a: T, single: boolean, prop?: Key) {\n const i = as.findIndex((b) => get(b, prop) === get(a, prop));\n if (i < 0) {\n if (single) {\n as.splice(0, as.length, a);\n } else {\n as.push(a);\n }\n } else {\n if (single) {\n as.splice(0, as.length);\n } else {\n as.splice(i, 1);\n }\n }\n}\n\n/**\n * Joins input array by comma\n * @param as - input array\n * @param prop - key to project input array\n * @returns Comma separated input array values\n */\nexport function join(as: T[], prop?: Key): string {\n return as.map((a) => get(a, prop)).join();\n}\n\n/**\n * Filter input array by comma separated values\n * @template T - Element type\n * @param as - List of elements\n * @param str - String to parse from\n * @param prop - Key of parsed property\n * @returns Objects from the input array filtered by the given key\n */\nexport function fromString(\n as: readonly T[],\n str: string | undefined,\n prop?: Key,\n): T[] {\n const res = [];\n if (str) {\n const ns = str.split(\",\");\n for (const n of ns) {\n const a = as.find((b) => {\n const value = get(b, prop);\n if (!isString(value)) {\n return false;\n }\n // eslint-disable-next-line eqeqeq\n return value == n;\n });\n if (a) {\n res.push(a);\n }\n }\n }\n return res;\n}\n\nexport function equals(as: T[], bs: T[]) {\n return as.length === bs.length && as.every((a) => bs.some((b) => a === b));\n}\n\nexport function nextIndex(list: unknown[], startIndex: number, offset: number): number {\n const len = list.length;\n if (startIndex === -1 && offset < 0) {\n startIndex = len;\n }\n return (startIndex + offset + len) % len;\n}\n\nexport function nextElement(list: T[], isStartElement: (item: T) => boolean, offset: number): T {\n const startIndex = list.findIndex(isStartElement);\n return list[nextIndex(list, startIndex, offset)];\n}\n","import { isArray } from \"lodash-es\";\nimport { nextTick } from \"vue\";\nimport { Vue } from \"vue-class-component\";\n\nimport type { IdMap } from \"@/model/baseTypes\";\nimport { nextIndex } from \"@/utils/list\";\n\nexport default class SearchBase extends Vue {\n foundIndex = 0;\n found = new Array();\n foundDOM = new Array();\n\n async search(\n items: S[] | Record,\n match: (item: S) => boolean,\n {\n mapResult = (item) => item as unknown as T,\n sortBy,\n }: {\n mapResult?: (item: S) => T;\n sortBy?: (item: T) => number;\n } = {},\n ) {\n const foundItemId = this.foundItem()?.id;\n this.found = [];\n this.foundDOM = [];\n if (isArray(items)) {\n for (const item of items) {\n if (match(item)) {\n this.found.push(mapResult(item));\n }\n }\n } else {\n for (const id in items) {\n if (match(items[id])) {\n this.found.push(mapResult(items[id]));\n }\n }\n }\n if (sortBy) {\n this.found.sort((a, b) => sortBy(b) - sortBy(a));\n }\n const newFound = foundItemId ? this.found.findIndex((item) => item.id === foundItemId) + 1 : 0;\n this.setFound(newFound);\n await nextTick();\n this.findNewElementOrderInDOM();\n }\n\n findNewElementOrderInDOM() {\n // This function is a workaround for the CurrentBoardSearchResults component.\n // The issue is that the CurrentBoardSearchResults component is responsible for sorting search results,\n // but it doesn't share/update the sorted order with the SearchItem component. The SearchItem component\n // handle key events (e.g., ArrowUp and ArrowDown) based on the y-axis position of items, but rather needs\n // to do that based on how they are sorted by CurrentBoardSearchResults component.\n\n // To address this, we need to determine the order of the search results as they are currently represented\n // in the DOM. This function updates the `foundDOM` array with the correct order of elements based on their\n // positions in the DOM, allowing us to handle key events properly.\n const searchItemsContainer = document.querySelector(\".base-search-items\");\n\n if (searchItemsContainer) {\n const baseSearchItems = searchItemsContainer.querySelectorAll(\".base-search-item\");\n\n const foundDict = this.found.reduce((acc: IdMap, item) => {\n acc[item.id] = item;\n return acc;\n }, {});\n\n baseSearchItems.forEach((item) => {\n const itemId = item.getAttribute(\"data-id\");\n if (itemId) {\n const matchingElement = foundDict[itemId];\n\n // If a matching element is found, add it to foundDOM\n if (matchingElement) {\n this.foundDOM.push(matchingElement);\n }\n }\n });\n } else {\n this.foundDOM = this.found;\n }\n }\n\n findNext(offset: number) {\n if (this.foundDOM.length > 0) {\n this.setFound(nextIndex(this.foundDOM, this.foundIndex - 1, offset) + 1);\n }\n }\n\n foundItem() {\n return this.foundDOM[this.foundIndex - 1];\n }\n\n setFound(c: number, focus?: boolean) {\n if (c !== this.foundIndex) {\n this.$markFound(false, false);\n this.foundIndex = c;\n this.$markFound(true, focus);\n }\n }\n\n $markFound(mark: boolean, focus?: boolean) {\n if (this.foundIndex) {\n this.markFound(this.foundItem(), mark, !!focus);\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n markFound(_item: T, _mark: boolean, _focus: boolean) {}\n}\n","import { Options as Component, mixins } from \"vue-class-component\";\n\nimport { nextIndex } from \"@/utils/list\";\n\nimport ShortcutUser from \"./ShortcutUser\";\n\n@Component({})\nexport default class SelectList extends mixins(ShortcutUser) {\n selectList: TItem[] = [];\n selectIndex = -1;\n scrollable: HTMLElement | null | undefined = undefined;\n upDownOffset = 1;\n leftRightOffset = 0;\n\n created() {\n if (this.upDownOffset !== 0) {\n this.shortcut(\"ArrowDown\", () => this.selectNext(this.upDownOffset), {\n repeat: true,\n });\n this.shortcut(\"ArrowUp\", () => this.selectNext(-this.upDownOffset), {\n repeat: true,\n });\n }\n if (this.leftRightOffset !== 0) {\n this.shortcut(\"ArrowRight\", () => this.selectNext(this.leftRightOffset), {\n repeat: true,\n });\n this.shortcut(\"ArrowLeft\", () => this.selectNext(-this.leftRightOffset), {\n repeat: true,\n });\n }\n this.shortcut(\"Enter\", (e) => {\n this.select(this.selectedItem(), e);\n });\n }\n\n selectNext(offset: number) {\n if (this.selectList.length > 0) {\n this.setSelected(nextIndex(this.selectList, this.selectIndex, offset));\n }\n }\n\n selectedItem() {\n return this.selectIndex < 0 ? undefined : this.selectList[this.selectIndex];\n }\n\n setSelected(i: number) {\n this.selectIndex = i;\n if (i >= 0) {\n const item = this.selectedItem();\n if (item) {\n const elem = document.getElementById(this.optionId(item));\n elem?.scrollIntoView({ block: \"nearest\" });\n elem?.focus();\n }\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n select(_value: TItem | undefined, _event: Event) {}\n\n optionId(_item: TItem): string {\n return \"\";\n }\n}\n","\n\n\n","\n\n\n","\n\n\n\n\n","import { Vue } from \"vue-class-component\";\n\nexport default class LabeledInput extends Vue {\n setForId(id?: string) {\n if (id) {\n this.parentComponent.setForId?.(id);\n }\n }\n\n get error() {\n return !!this.parentComponent?.error;\n }\n\n get parentComponent() {\n return this.$parent as any;\n }\n}\n","\n\n\n\n\n","\n\n\n","\n\n\n\n\n","\n\n\n\n\n\n","\n\n\n\n\n","import { noop } from \"lodash-es\";\nimport type { ComponentPublicInstance, ObjectDirective } from \"vue\";\n\nimport type { DragHandlers } from \"@/components/gestures/drag\";\nimport { registerDrag } from \"@/components/gestures/drag\";\n\nexport interface DragInfo {\n data: T | null;\n}\n\ninterface DraggableValue {\n enabled?: boolean;\n drag: any;\n data: unknown;\n image: string;\n}\n\nexport function initDrag(\n props: U,\n handlers?: Partial>,\n): U & DragInfo & DragHandlers {\n return {\n data: null,\n start() {\n return true;\n },\n move(drag) {\n return drag.pos;\n },\n stop: noop,\n ...handlers,\n ...props,\n };\n}\n\n/**\n * Make an element draggable by adding a v-draggable attribute to it:\n * v-draggable=\"{\n * enabled: if dragging is enabled\n * drag: binding to a DragInfo object\n * data: binding to the data that is dragged\n * image: id of an HTML element to be used as dragging image\n * }\"\n */\nexport const Draggable: ObjectDirective = {\n beforeMount(el, binding) {\n const { value, instance } = binding;\n\n if (!instance) return;\n\n if (!value.drag || !value.data) {\n throw Error(\"draggable directive needs 'drag' and 'data' props\");\n }\n\n const dragHandler = createDragHandler(this, value, instance);\n if (value.enabled === undefined || value.enabled) {\n (instance as any).$dragHandler = dragHandler;\n el.addEventListener(\"pointerdown\", dragHandler);\n }\n },\n beforeUnmount(el, binding) {\n const { instance } = binding;\n el.removeEventListener(\"pointerdown\", (instance as any).$dragHandler);\n },\n};\n\nfunction createDragHandler(\n obj: typeof Draggable,\n value: DraggableValue,\n instance: ComponentPublicInstance | Record | null,\n) {\n return (event: PointerEvent) => {\n return registerDrag(obj, event, {\n imageEl: document.getElementById(value.image),\n start(drag) {\n if (value.drag.start(drag, value.data)) {\n value.drag.data = value.data;\n instance?.$emit(\"dragStart\");\n return true;\n }\n return false;\n },\n move(drag) {\n return value.drag.move(drag);\n },\n stop(drag) {\n value.drag.stop(drag);\n value.drag.data = null;\n },\n });\n };\n}\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","import { throttle } from \"lodash-es\";\nimport { type Ref, ref, watch } from \"vue\";\n\nimport { kanbanBoardHorizontalScrollUsed } from \"@/utils/analytics/events\";\nimport { trackEvent } from \"@/utils/analytics/track\";\n\nexport function useDragScrolling(container: Ref) {\n let scrollInterval: number | null = null;\n let currentIntervalTime: number | null = null;\n let currentScrollDirection: number | null = null;\n\n // used for tracking\n const horizontalScrollUsed = ref(false);\n watch(horizontalScrollUsed, (value) => {\n if (value) {\n trackEvent(kanbanBoardHorizontalScrollUsed());\n }\n });\n\n const threshold = 50; // Distance in pixels from the left/right edge to activate scrolling\n const scrollStep = 5; // Pixels to scroll per interval\n const minIntervalTime = 15; // Minimum delay (faster scrolling)\n const maxIntervalTime = 30; // Maximum delay (slower scrolling)\n\n function handleDragOver(event: DragEvent) {\n const containerElement = container.value;\n if (!containerElement) return;\n\n const rect = containerElement.getBoundingClientRect();\n let scrollDirection = 0;\n let newIntervalTime = maxIntervalTime;\n\n // Determine scroll direction and calculate new interval time based on pointer distance\n if (event.clientX < rect.left + threshold) {\n const distance = rect.left + threshold - event.clientX;\n scrollDirection = -1;\n newIntervalTime = Math.floor(\n maxIntervalTime - (maxIntervalTime - minIntervalTime) * (distance / threshold),\n );\n } else if (event.clientX > rect.right - threshold) {\n const distance = event.clientX - (rect.right - threshold);\n scrollDirection = 1;\n newIntervalTime = Math.floor(\n maxIntervalTime - (maxIntervalTime - minIntervalTime) * (distance / threshold),\n );\n } else {\n scrollDirection = 0;\n }\n\n // Start or cancel scrolling based on pointer position and new parameters.\n if (scrollDirection === 0) {\n if (scrollInterval) {\n clearInterval(scrollInterval);\n scrollInterval = null;\n currentIntervalTime = null;\n currentScrollDirection = null;\n }\n } else {\n if (\n scrollInterval &&\n currentScrollDirection === scrollDirection &&\n currentIntervalTime === newIntervalTime\n ) {\n // Parameters unchanged; do nothing.\n } else {\n if (scrollInterval) {\n clearInterval(scrollInterval);\n }\n\n horizontalScrollUsed.value = true;\n\n scrollInterval = window.setInterval(() => {\n containerElement.scrollLeft += scrollDirection * scrollStep;\n }, newIntervalTime);\n currentIntervalTime = newIntervalTime;\n currentScrollDirection = scrollDirection;\n }\n }\n }\n\n const throttledHandleDragOver = throttle(handleDragOver, 100);\n\n function cancelScrolling() {\n if (scrollInterval) {\n clearInterval(scrollInterval);\n scrollInterval = null;\n currentIntervalTime = null;\n currentScrollDirection = null;\n }\n }\n\n return {\n handleDragOver: throttledHandleDragOver,\n cancelScrolling,\n };\n}\n","import type { MoveEvent, SortableEvent } from \"sortablejs\";\nimport { ref } from \"vue\";\n\nimport { cardActions } from \"@/action/cardActions\";\nimport type { TargetStatus } from \"@/model/status\";\nimport { useBoardStore } from \"@/store/board\";\nimport { useCardStore } from \"@/store/card\";\n\nimport type { Column } from \"../types\";\n\nexport function useStickyDrag() {\n // next possible statuses for the current dragging card\n const targetStatuses = ref([]);\n // the id of the column that the mouse is over when dragging\n const dragOverColumnId = ref(undefined);\n\n const onStartDragging = (event: SortableEvent, column: Column) => {\n const id = event.item.dataset.id;\n const typeId = event.item.dataset.typeId;\n const oldIndex = event.oldIndex;\n\n if (!id || !typeId || oldIndex === undefined) return;\n\n const sticky = column.stickies[oldIndex];\n targetStatuses.value = sticky.data.status?.next || [];\n };\n\n const onEndDragging = (event: SortableEvent) => {\n const fromStatusId = event.from?.dataset?.statusId;\n const toStatusId = event.to?.dataset?.statusId;\n\n if (!fromStatusId || !toStatusId) {\n return;\n }\n\n // If dropped in the same column, do nothing.\n if (fromStatusId === toStatusId) {\n targetStatuses.value = [];\n return;\n }\n\n const board = useBoardStore().currentBoard();\n const targetStatus = targetStatuses.value.find((status) => status.status.id === toStatusId);\n\n if (!targetStatus) {\n return;\n }\n\n const stickyId = event.item.dataset.id;\n if (!stickyId) return;\n\n const sticky = useCardStore().cards[stickyId];\n if (!sticky) return;\n\n targetStatuses.value = [];\n cardActions.setStatus(\"kanban-board-drag\", board, sticky, targetStatus);\n };\n\n const onMove = (event: MoveEvent, _originalEvent: MouseEvent) => {\n const target = event.to as HTMLElement;\n let targetStatusId = target.dataset?.statusId;\n if (!targetStatusId) {\n const parent = target.closest(\"[data-status-id]\") as HTMLElement;\n targetStatusId = parent?.dataset?.statusId;\n }\n dragOverColumnId.value = targetStatusId;\n };\n\n return {\n targetStatuses,\n dragOverColumnId,\n onStartDragging,\n onEndDragging,\n onMove,\n };\n}\n","\n\n\n\n\n","\n\n\n\n\n\n\n","import type { FilterListItem, UnassignedListItem } from \"./types\";\n\n/**\n * Adds an unassigned item to the list of items.\n *\n * @param items - The list of items.\n * @param label - The label for the unassigned item.\n *\n * @returns The list of items with the unassigned item added.\n */\n// Define a type for the unassigned item\n\nexport function withUnassigned(\n items: T[],\n label = \"Unassigned\",\n): Array {\n const unassigned: UnassignedListItem = {\n type: \"unassigned\",\n id: \"unassigned\",\n label,\n };\n return [...items, unassigned];\n}\n","\n\n\n","\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n","import { ref } from \"vue\";\n\nimport { kanbanBoardFilterUsed, kanbanBoardFiltersCleared } from \"@/utils/analytics/events\";\nimport { trackEvent } from \"@/utils/analytics/track\";\n\ntype FilterType = \"team\" | \"user\" | \"art\" | \"type\" | \"text\";\n\nexport function useFilterTracking>(\n filterTypes: Record,\n) {\n const trackedFilters = ref>({\n clear: false,\n });\n\n // Initialize tracking state for each filter type\n Object.values(filterTypes).forEach((type) => {\n trackedFilters.value[type] = false;\n });\n\n const onFilterChange = (filters: T, _oldFilters?: T) => {\n // Check each filter property and track if needed\n (Object.entries(filterTypes) as Array<[keyof T & string, FilterType]>).forEach(\n ([filterKey, filterType]) => {\n const value = filters[filterKey];\n const hasValue = Array.isArray(value) ? value.length > 0 : Boolean(value);\n\n if (hasValue && !trackedFilters.value[filterType]) {\n trackEvent(kanbanBoardFilterUsed(filterType));\n trackedFilters.value[filterType] = true;\n }\n },\n );\n };\n\n const onFilterClear = () => {\n if (!trackedFilters.value.clear) {\n trackEvent(kanbanBoardFiltersCleared());\n trackedFilters.value.clear = true;\n }\n };\n\n return {\n onFilterChange,\n onFilterClear,\n };\n}\n","import { type Ref, computed, ref } from \"vue\";\n\nimport { statusClasses } from \"@/model/baseTypes\";\nimport type { BoardCard } from \"@/model/card\";\nimport { useAlmItemTypeStore } from \"@/store/almItemType\";\n\nimport type { Columns } from \"../types\";\n\nexport function useKanbanColumns(\n allStickies: Ref,\n filteredStickies: Ref,\n selectedTypeIds: Ref = ref([]),\n) {\n // Create a map of \"status name\" -> { status, typeIds, stickies }\n const columns = computed(() => {\n const statusMap: Columns = new Map();\n const almItemTypeStore = useAlmItemTypeStore();\n\n // Build column structure and collect type IDs\n for (const card of allStickies.value) {\n const almItemType = almItemTypeStore.findAlmItemType(\n card.data.type,\n card.data.teamId,\n card.data.artId,\n card.data.almSourceId,\n );\n\n for (const status of almItemType.statuses) {\n if (!statusMap.has(status.name)) {\n statusMap.set(status.name, {\n status,\n typeIds: [card.data.type.id],\n stickies: [],\n });\n } else if (!statusMap.get(status.name)?.typeIds.includes(card.data.type.id)) {\n // Add type ID if not already present\n statusMap.get(status.name)?.typeIds.push(card.data.type.id);\n }\n }\n }\n\n // Add filtered stickies to their respective columns\n for (const card of filteredStickies.value) {\n if (card.data.status && statusMap.has(card.data.status.name)) {\n statusMap.get(card.data.status.name)?.stickies.push(card);\n }\n }\n\n // Sort columns by status class order\n const sortedEntries = Array.from(statusMap.entries()).sort((a, b) => {\n return (\n statusClasses.indexOf(a[1].status.statusClass) -\n statusClasses.indexOf(b[1].status.statusClass)\n );\n });\n\n // Filter by type IDs if specified\n if (selectedTypeIds.value.length > 0) {\n return new Map(\n sortedEntries.filter(([_, columnData]) =>\n columnData.typeIds.some((typeId) => selectedTypeIds.value.includes(typeId)),\n ),\n );\n }\n\n return new Map(sortedEntries);\n });\n\n return { columns };\n}\n","import type { ComputedRef } from \"vue\";\nimport { computed, onMounted, ref, watch } from \"vue\";\n\nimport { captureMessage } from \"@/error/sentry\";\nimport type { KanbanFilters } from \"@/model/board\";\nimport type { BoardCard } from \"@/model/card\";\nimport { useClientSettingsStore } from \"@/store/clientSettings\";\n\nimport type { FilterArtId, FilterTeamId, FilterUserId } from \"../types\";\n\nexport function useKanbanFilters(\n stickies: ComputedRef,\n emptyFilters: TFilters,\n filterFuncs: Array<(stickies: BoardCard[], filters: TFilters) => BoardCard[]>,\n options?: {\n onFilterChange?: (filters: TFilters, oldFilters: TFilters) => void;\n onFilterClear?: () => void;\n },\n) {\n const filtersRef = ref({ ...emptyFilters, ...useClientSettingsStore().kanbanFilter });\n\n watch(filtersRef, (filters) => useClientSettingsStore().setKanbanFilter(filters), { deep: true });\n\n onMounted(() => {\n const filterKeysCount = Object.keys(emptyFilters).length;\n if (filterKeysCount !== filterFuncs.length) {\n void captureMessage(\n `Warning: The number of filters (${filterKeysCount}) does not match the number of provided filter functions (${filterFuncs.length}). ` +\n `Perhaps you forgot to add a filter function for one or more filter criteria.`,\n );\n }\n });\n\n const filteredStickies = computed(() => {\n return filterFuncs.reduce(\n (result, filterFn) => filterFn(result, filtersRef.value),\n stickies.value,\n );\n });\n\n const selectedTypeIds = computed(() => filtersRef.value.typeIds);\n\n const resetFilters = () => {\n Object.assign(filtersRef.value, emptyFilters);\n options?.onFilterClear?.();\n };\n\n const updateFilters = (newFilters: TFilters) => {\n const oldFilters = { ...filtersRef.value };\n Object.assign(filtersRef.value, newFilters);\n options?.onFilterChange?.(filtersRef.value, oldFilters);\n };\n\n return {\n value: filtersRef.value as TFilters,\n filteredStickies,\n selectedTypeIds,\n resetFilters,\n updateFilters,\n };\n}\n\nexport function filterByType(stickies: BoardCard[], filters: { typeIds: string[] }): BoardCard[] {\n const { typeIds } = filters;\n return typeIds.length === 0\n ? stickies\n : stickies.filter((sticky) => typeIds.includes(sticky.data.type.id));\n}\n\nexport function filterByText(stickies: BoardCard[], filters: { text: string }): BoardCard[] {\n const { text } = filters;\n if (!text) return stickies;\n\n const lowerCaseText = text.toLowerCase();\n const hasText = (text: string | undefined) => text?.toLowerCase().includes(lowerCaseText);\n\n return stickies.filter((sticky) => hasText(sticky.data.almId) || hasText(sticky.data.text));\n}\n\nexport function filterByUserId(\n stickies: BoardCard[],\n filters: { userIds: FilterUserId[] },\n): BoardCard[] {\n const { userIds } = filters;\n if (userIds.length === 0) return stickies;\n\n return stickies.filter((sticky) => {\n if (userIds.includes(\"unassigned\") && !sticky.data.assignee) {\n return true;\n }\n const assigneeId = sticky.data.assignee?.id;\n return assigneeId && userIds.includes(assigneeId);\n });\n}\n\nexport function filterByTeamId(\n stickies: BoardCard[],\n filters: { teamIds: FilterTeamId[] },\n): BoardCard[] {\n const { teamIds } = filters;\n if (teamIds.length === 0) return stickies;\n\n return stickies.filter((sticky) => {\n if (isUnassigned(teamIds) && !sticky.data.teamId) {\n return true;\n }\n\n const teamId = sticky.data.teamId;\n return teamId && teamIds.includes(teamId);\n });\n}\n\nexport function filterByArtId(\n stickies: BoardCard[],\n filters: { artIds: FilterArtId[] },\n): BoardCard[] {\n const { artIds } = filters;\n if (artIds.length === 0) return stickies;\n\n return stickies.filter((sticky) => {\n if (isUnassigned(artIds) && !sticky.data.artId) {\n return true;\n }\n\n const artId = sticky.data.artId;\n return artId && artIds.includes(artId);\n });\n}\n\nfunction isUnassigned(list: string[]): boolean {\n return list.includes(\"unassigned\");\n}\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","import { computed } from \"vue\";\n\nimport { useBoardsStore } from \"@/store/boards\";\n\nexport const useStickies = (boardType: \"program\" | \"backlog\") => {\n return computed(() => {\n const cards = useBoardsStore().boardByType(boardType).cards;\n\n return Object.values(cards).filter((boardCard) => {\n // must be a work item\n const cardData = boardCard.data;\n if (cardData.type.functionality === \"workitem\") {\n return true;\n }\n });\n });\n};\n","import { computed } from \"vue\";\n\nimport type { Team } from \"@/model/session\";\nimport { useArtStore } from \"@/store/art\";\nimport { useTeamStore } from \"@/store/team\";\n\nexport const useTeams = () => {\n return computed(() => {\n const currentArtId = useArtStore().current.id;\n return useTeamStore().teamsInArt(currentArtId);\n });\n};\n","\n\n\n","\n\n\n","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n width: \"20\",\n height: \"20\",\n viewBox: \"0 0 20 20\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\"\n}\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, _cache[0] || (_cache[0] = [\n _createElementVNode(\"rect\", {\n width: \"20\",\n height: \"20\",\n rx: \"10\",\n fill: \"black\",\n \"fill-opacity\": \"0.4\"\n }, null, -1),\n _createElementVNode(\"path\", {\n d: \"M9.99972 10.7989C11.9666 10.7989 13.561 9.27692 13.561 7.39945C13.561 5.52199 11.9666 4 9.99972 4C8.03289 4 6.43845 5.52199 6.43845 7.39945C6.43845 9.27692 8.03289 10.7989 9.99972 10.7989Z\",\n fill: \"#FAFAFA\"\n }, null, -1),\n _createElementVNode(\"path\", {\n d: \"M16 15.4202C15.9302 15.4955 15.8588 15.5696 15.7858 15.6423C14.3275 17.0953 12.2744 18 10 18C7.72556 18 5.67248 17.0953 4.2142 15.6423C4.14125 15.5696 4.06982 15.4955 4 15.4202C4 13.0659 5.43034 11.8168 10 11.8168C14.7389 11.8168 16 13.2745 16 15.4202Z\",\n fill: \"#FAFAFA\"\n }, null, -1)\n ])))\n}\nexport default { render: render }","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","import { computed } from \"vue\";\n\nimport { useBoardsStore } from \"@/store/boards\";\nimport { useTeamStore } from \"@/store/team\";\n\nexport function useStickies(iterationId: number) {\n const stickies = computed(() => {\n const teamId = useTeamStore().current.id;\n const cards = useBoardsStore().boardByType(\"team\", { teamId }).cards;\n\n const currentTeamId = useTeamStore().current.id;\n\n return Object.values(cards).filter((boardCard) => {\n const cardData = boardCard.data;\n\n // sticky notes must be in the current iteration and team\n if (cardData.iterationId !== iterationId || cardData.teamId !== currentTeamId) {\n return false;\n }\n\n // sticky notes must be work items and team board origin\n const { type } = cardData;\n if (type.functionality !== \"workitem\" || type?.origin !== \"team\") {\n return false;\n }\n\n return true;\n });\n });\n\n return stickies;\n}\n","import { type Ref, computed } from \"vue\";\n\nimport type { BoardCard } from \"@/model/card\";\nimport type { AuthUser } from \"@/model/user\";\nimport { useUserStore } from \"@/store/user\";\n\nexport function useStickyAssignees(stickies: Ref) {\n return computed(() => {\n const currentUser = useUserStore().currentUser;\n\n return stickies.value.reduce((acc, sticky) => {\n // if the assignee is alm-only, we don't want to show them in the filter list\n if (sticky.data.assignee?.almMapping === \"alm-only\") {\n return acc;\n }\n\n const assignee = sticky.data.assignee;\n const foundIndex = acc.findIndex((user) => user.id === assignee?.id);\n if (assignee && foundIndex === -1) {\n // if the assignee is the current user, we want to show them first\n if (assignee.id === currentUser?.id) {\n acc.splice(0, 0, assignee);\n } else {\n acc.push(assignee);\n }\n }\n return acc;\n }, []);\n });\n}\n","\n\n\n","\n\n\n","\n\n\n","\n\n\n\n\n","import { computed } from \"vue\";\n\nimport { useBoardsStore } from \"@/store/boards\";\n\nexport const useStickies = (boardType: \"solution\" | \"solution_backlog\") => {\n return computed(() => {\n const cards = useBoardsStore().boardByType(boardType).cards;\n\n return Object.values(cards).filter((boardCard) => {\n // must be a work item\n const cardData = boardCard.data;\n if (cardData.type.functionality === \"workitem\") {\n return true;\n }\n });\n });\n};\n","\n\n\n","\n\n\n","import type { Component } from \"vue\";\n\nimport PlanReadoutModal from \"@/components/PlanReadout/PlanReadoutModal.vue\";\nimport SessionSelectionModal from \"@/components/modal/SessionSelectionModal.vue\";\nimport FlexModal from \"@/components/modal/flex/FlexModal.vue\";\nimport ArtKanbanModal from \"@/components/modal/kanban/ArtKanbanModal.vue\";\nimport IterationKanbanModal from \"@/components/modal/kanban/IterationKanbanModal.vue\";\nimport SolutionKanbanModal from \"@/components/modal/kanban/SolutionKanbanModal.vue\";\nimport { sendOpenNavigation } from \"@/composables/useEventBus\";\nimport type { BoardType } from \"@/model/baseTypes\";\nimport { isFlexBoard } from \"@/model/board\";\nimport type { Art, Session, Team } from \"@/model/session\";\nimport { currentRoute, goToBoard } from \"@/router/navigation\";\nimport { useBoardStore } from \"@/store/board\";\nimport { componentName, useModalStore } from \"@/store/modal\";\nimport { useNavigationStore } from \"@/store/navigation\";\nimport { useSessionStore } from \"@/store/session\";\nimport { modalClosed, modalOpened } from \"@/utils/analytics/events\";\nimport type { TrackingParams } from \"@/utils/analytics/types\";\n\nimport { action, ctxAction, defineActions } from \"./actions\";\nimport type { ActionContext } from \"./types\";\n\nexport const navigationActions = defineActions(\"navigation\", {\n changeBoard: ctxAction((ctx, board) => trackedGoToBoard(ctx, board)),\n goToBacklog: ctxAction((ctx) => trackedGoToBoard(ctx, \"backlog\"), {\n name: /*$t*/ \"action.backlogBoard\",\n icon: \"board/backlog\",\n }),\n goToProgram: ctxAction((ctx) => trackedGoToBoard(ctx, \"program\"), {\n name: /*$t*/ \"action.programBoard\",\n icon: \"board/planning\",\n }),\n showArtKanban: ctxAction((ctx, attrs) => openModal(ctx, ArtKanbanModal, { attrs }), {\n name: /*$t*/ \"contextMenu.kanban\",\n }),\n showSolutionKanban: ctxAction((ctx, attrs) => openModal(ctx, SolutionKanbanModal, { attrs }), {\n name: /*$t*/ \"contextMenu.kanban\",\n }),\n showIterationKanban: ctxAction((ctx, attrs) => openModal(ctx, IterationKanbanModal, { attrs }), {\n name: /*$t*/ \"contextMenu.kanban\",\n }),\n goToSolutionBacklog: ctxAction((ctx) => trackedGoToBoard(ctx, \"solution_backlog\"), {\n name: /*$t*/ \"action.solutionBacklogBoard\",\n icon: \"board/solution-backlog\",\n }),\n goToSolution: ctxAction((ctx) => trackedGoToBoard(ctx, \"solution\"), {\n name: /*$t*/ \"action.solutionBoard\",\n icon: \"board/solution\",\n }),\n goToRisk: ctxAction((ctx) => trackedGoToBoard(ctx, \"risk\"), {\n name: /*$t*/ \"action.riskBoard\",\n icon: \"board/risk\",\n }),\n goToTeam: ctxAction(\n (ctx) => {\n if (currentRoute().params.board === \"team\") {\n sendOpenNavigation(\"team\");\n } else {\n trackedGoToBoard(ctx, \"team\");\n }\n },\n {\n name: /*$t*/ \"action.teamBoard\",\n icon: \"board/team\",\n },\n ),\n\n goToCanvas: ctxAction((ctx) => openModal(ctx, FlexModal), {\n name: /*$t*/ \"action.canvases\",\n icon: \"board/canvas\",\n }),\n changeCanvas: action((name: string) => goToBoard({ type: \"flex\", name })),\n\n goToObjectives: ctxAction((ctx) => trackedGoToBoard(ctx, \"objectives\"), {\n name: /*$t*/ \"action.objectivesBoard\",\n icon: \"board/objectives\",\n }),\n selectSession: action((session: Session, boardType: BoardType) =>\n goToBoard({\n type: boardType,\n session: useSessionStore().uniqueSessionName(session),\n }),\n ),\n changeSession: ctxAction((ctx) => {\n ctx.track({});\n openModal(ctx, SessionSelectionModal);\n }),\n changeArt: action((art: Art) => {\n useNavigationStore().artSelected(art);\n goToBoard({ type: useBoardStore().currentBoard().type, artId: art.id });\n }),\n changeTeam: action((team: Team) => {\n useNavigationStore().teamSelected(team);\n goToBoard({ type: useBoardStore().currentBoard().type, team });\n }),\n goToPlanReadout: ctxAction((ctx) => openModal(ctx, PlanReadoutModal), {\n name: /*$t*/ \"planReadout.title\",\n icon: \"menu-top/plan-readout\",\n }),\n openModal: ctxAction(openModal),\n closeModal: ctxAction((ctx) => {\n const component = useModalStore().modal.component || { name: \"unknown\" };\n ctx.track(modalClosed(ctx.source, componentName(component)));\n useModalStore().close();\n }),\n});\n\nfunction trackedGoToBoard(ctx: ActionContext, board: BoardType) {\n ctx.track({ fromBoard: useBoardStore().currentBoard().type, toBoard: board });\n useNavigationStore().boardSelected(board);\n if (isFlexBoard(board)) {\n openModal(ctx, FlexModal);\n } else {\n void goToBoard(board);\n }\n}\n\nfunction openModal(\n ctx: ActionContext,\n component: Component,\n options?: {\n attrs?: Record;\n trackingParams?: TrackingParams;\n },\n) {\n useModalStore().open(component, options);\n ctx.track(modalOpened(ctx.source, componentName(component), options?.trackingParams));\n}\n","\n\n\n\n\n","\n\n\n\n\n","import { ApplicationError } from \"@/error/ApplicationError\";\n\nexport class TimeoutError extends ApplicationError {\n constructor(contexts: { request: Record; response: Record }) {\n super(\"TimeoutError\", \"\", contexts);\n }\n}\n","\n\n\n","\n\n\n","export function stickyNotes() {\n return document.querySelectorAll(\".sticky-note\");\n}\n\nexport function svgElementsOnBoard() {\n return document.querySelectorAll(\".board svg, .draw-layer\");\n}\n\nexport function removeBoxShadows(el: HTMLElement) {\n el.setAttribute(\"old-box-shadow\", el.style.boxShadow);\n el.style.boxShadow = \"none\";\n}\n\nexport function resetBoxShadows(el: HTMLElement) {\n el.style.boxShadow = el.getAttribute(\"old-box-shadow\") || \"\";\n el.removeAttribute(\"old-box-shadow\");\n}\n\nexport function setExplicitCurrentColor(svg: SVGSVGElement) {\n setAll(\"stroke\");\n setAll(\"fill\");\n\n function setAll(attribute: \"stroke\" | \"fill\") {\n if (svg.getAttribute(attribute) === \"currentColor\") {\n set(svg, attribute);\n }\n svg.querySelectorAll(`[${attribute}=currentColor]`).forEach((el) => set(el, attribute));\n }\n\n function set(el: Element, attribute: \"stroke\" | \"fill\") {\n el.setAttribute(`${attribute}-current-color`, \"\");\n el.setAttribute(attribute, window.getComputedStyle(el)[attribute]);\n }\n}\n\nexport function resetExplicitCurrentColor(svg: SVGSVGElement) {\n resetAll(\"stroke\");\n resetAll(\"fill\");\n\n function resetAll(attribute: \"stroke\" | \"fill\") {\n if (svg.getAttribute(`${attribute}-current-color`) !== null) {\n reset(svg, attribute);\n }\n svg.querySelectorAll(`[${attribute}-current-color]`).forEach((el) => reset(el, attribute));\n }\n\n function reset(el: Element, attribute: \"stroke\" | \"fill\") {\n el.removeAttribute(`${attribute}-current-color`);\n el.setAttribute(attribute, \"currentColor\");\n }\n}\n\nexport function setExplicitSize(svg: SVGSVGElement) {\n svg.setAttribute(\n \"old-values\",\n JSON.stringify({\n width: svg.getAttribute(\"width\"),\n height: svg.getAttribute(\"height\"),\n } satisfies SavedSvgAttributes),\n );\n setAllAttributes(svg, {\n width: \"\" + svg.clientWidth,\n height: \"\" + svg.clientHeight,\n });\n}\n\nexport function resetExplicitSize(svg: SVGSVGElement) {\n const oldValues = JSON.parse(svg.getAttribute(\"old-values\")!) as SavedSvgAttributes;\n svg.removeAttribute(\"old-values\");\n setAllAttributes(svg, oldValues);\n}\n\ninterface SavedSvgAttributes {\n width: string | null;\n height: string | null;\n}\n\nfunction setAllAttributes(svg: SVGSVGElement, attrs: SavedSvgAttributes) {\n setAttribute(svg, \"width\", attrs.width);\n setAttribute(svg, \"height\", attrs.height);\n}\n\nfunction setAttribute(svg: SVGSVGElement, name: string, value: string | null) {\n if (value) {\n svg.setAttribute(name, value);\n } else {\n svg.removeAttribute(name);\n }\n}\n","import { saveAs } from \"file-saver\";\n\nimport { captureException, captureMessage } from \"@/error/sentry\";\nimport { boardAspect, screenShotWidth } from \"@/model/Settings\";\nimport { useArtStore } from \"@/store/art\";\nimport { useBoardStore } from \"@/store/board\";\nimport { useBoardSizeStore } from \"@/store/boardSize\";\nimport { useSessionStore } from \"@/store/session\";\nimport { useToastStore } from \"@/store/toast\";\nimport { useZoomStore } from \"@/store/zoom\";\n\nimport {\n removeBoxShadows,\n resetBoxShadows,\n resetExplicitCurrentColor,\n resetExplicitSize,\n setExplicitCurrentColor,\n setExplicitSize,\n stickyNotes,\n svgElementsOnBoard,\n} from \"./screenshotDom\";\n\nexport function screenShot() {\n useToastStore().show(/*$t*/ \"message.generateImage\", { duration: 0 });\n setTimeout(async () => {\n try {\n await screenShotWithAdjustedDom();\n } finally {\n useToastStore().hide();\n }\n }, 100);\n}\n\n// adjust the DOM to avoid element styles that are not supported by html2canvas\nasync function screenShotWithAdjustedDom() {\n try {\n stickyNotes().forEach(removeBoxShadows);\n svgElementsOnBoard().forEach((svg) => {\n setExplicitCurrentColor(svg);\n setExplicitSize(svg);\n });\n await doScreenShot();\n } catch (fail) {\n void captureException(fail);\n } finally {\n stickyNotes().forEach(resetBoxShadows);\n svgElementsOnBoard().forEach((svg) => {\n resetExplicitCurrentColor(svg);\n resetExplicitSize(svg);\n });\n }\n}\n\nasync function doScreenShot() {\n const { default: html2canvas } = await import(\"@nidi/html2canvas\");\n const scale = screenShotScale();\n const canvas = await html2canvas(document.body, {\n scale,\n logging: false,\n ignoreElements: (e: any) => e.getAttribute(\"data-no-screenshot\") !== null,\n });\n cutOutBoard(canvas, scale).toBlob((blob) => {\n if (blob) {\n saveAs(blob, screenShotName());\n } else {\n void captureMessage(\"Could not generate screenshot blob\");\n }\n });\n}\n\nfunction screenShotScale() {\n return screenShotWidth / (useZoomStore().factor * effectiveBoardWidth());\n}\n\nfunction effectiveBoardWidth() {\n return parseInt(document.getElementById(\"boards\")!.style.width);\n}\n\nfunction cutOutBoard(canvas: HTMLCanvasElement, scale: number) {\n const target = document.createElement(\"canvas\");\n target.width = screenShotWidth;\n target.height = screenShotWidth / boardAspect;\n target\n .getContext(\"2d\")!\n .drawImage(\n canvas,\n -useBoardSizeStore().size.left * scale,\n -useBoardSizeStore().size.top * scale,\n );\n return target;\n}\n\nfunction screenShotName() {\n const session = safeFilename(useSessionStore().current.name);\n const art = useArtStore().isMultiArt ? \"-\" + safeFilename(useArtStore().current.name) : \"\";\n return `${session}${art}-${boardName()}.png`;\n}\n\nfunction safeFilename(s: string) {\n return s.replace(/[^A-Za-z0-9]+/g, \"_\");\n}\n\nfunction boardName() {\n const board = useBoardStore().currentBoard();\n switch (board.type) {\n case \"team\":\n return \"team-\" + safeFilename(board.team.name || \"\");\n case \"flex\":\n return safeFilename(board.name || \"\");\n default:\n return board.type;\n }\n}\n","import { clamp } from \"lodash-es\";\n\nimport { sender } from \"@/backend/Sender\";\nimport ConfirmArrangeModal from \"@/components/modal/ConfirmArrangeModal.vue\";\nimport ConfirmSyncBacklogModal from \"@/components/modal/ConfirmSyncBacklogModal.vue\";\nimport ConfirmSyncIterationModal from \"@/components/modal/ConfirmSyncIterationModal.vue\";\nimport { arrangeCards, zoomToRegion } from \"@/components/utils/layout\";\nimport type { Board } from \"@/model/board\";\nimport type { PositionedCard } from \"@/model/card\";\nimport type { Rectangle, RelativeCoordinate } from \"@/model/coordinates\";\nimport type { Team } from \"@/model/session\";\nimport { useBoardStore } from \"@/store/board\";\nimport { useBoardsStore } from \"@/store/boards\";\nimport { useTeamStore } from \"@/store/team\";\n\nimport { action, ctxAction, defineActions } from \"./actions\";\nimport { internalActions } from \"./internalActions\";\nimport { navigationActions } from \"./navigationActions\";\nimport { screenShot } from \"./utils/screenshot\";\n\nexport const boardActions = defineActions(\"board\", {\n screenshot: action(\n (event?: KeyboardEvent) => {\n const board = useBoardStore().currentBoard();\n\n if (board.type === \"objectives\") {\n return;\n }\n\n screenShot();\n event?.preventDefault();\n },\n { name: /*$t*/ \"contextMenu.saveBoardImage\" },\n ),\n confirmArrange: ctxAction(\n (ctx, boardId: string, location: number[]) =>\n navigationActions.openModal(ctx, ConfirmArrangeModal, {\n attrs: { boardId, location },\n }),\n { name: /*$t*/ \"boardBase.arrangeStickies\" },\n ),\n arrange: action(\n (board: Board, cards: PositionedCard[], bounds: Rectangle) => {\n arrangeCards(board, cards, bounds);\n },\n ),\n confirmSyncBacklog: ctxAction(\n (ctx) => navigationActions.openModal(ctx, ConfirmSyncBacklogModal),\n { name: /*$t*/ \"contextMenu.synchronizeBacklog\" },\n ),\n syncBacklog: action(async (artId?: number) => {\n await sender.syncBacklog(artId);\n }),\n confirmSyncIteration: ctxAction(\n (ctx, iteration: number | null, status: string | null) =>\n navigationActions.openModal(ctx, ConfirmSyncIterationModal, {\n attrs: { iteration, status },\n }),\n { name: /*$t*/ \"contextMenu.synchronizeIteration\" },\n ),\n syncIteration: action(async (team: Team, iteration: number) => {\n await sender.syncIteration(team.id, iteration);\n }),\n zoomToRegion: action((bounds: Rectangle) => zoomToRegion(bounds), {\n name: /*$t*/ \"contextMenu.zoomToRegion\",\n }),\n toggleCardSelection: action((cardId: string) => {\n const board = useBoardStore().currentBoard();\n if (cardId in board.selected) {\n unselectSticky(cardId);\n } else {\n selectSticky(cardId);\n }\n }),\n clearCardSelection: action(() => {\n useBoardStore().setActiveCardId(null);\n const board = useBoardStore().currentBoard();\n internalActions.clearCardSelection(board);\n }),\n setVelocity: action((boardId: string, iteration: number, velocity: number) => {\n useBoardsStore().setVelocity({ id: boardId, iteration, velocity });\n sender.setVelocity(boardId, iteration, velocity);\n }),\n setCardSize: action((boardId: string, factor: number) =>\n setCardSize(useBoardsStore().boardById(boardId), factor),\n ),\n smallerCardSize: action(\n () => {\n const board = useBoardStore().currentBoard();\n setCardSize(board, board.cardSize.factor - 0.5);\n },\n { name: /*$t*/ \"board.smallerCards\" },\n ),\n biggerCardSize: action(\n () => {\n const board = useBoardStore().currentBoard();\n setCardSize(board, board.cardSize.factor + 0.5);\n },\n { name: /*$t*/ \"board.biggerCards\" },\n ),\n cardToFront: action((cardId: string, boardId?: string) => {\n if (useBoardsStore().cardToFront({ id: cardId, boardId })) {\n sender.frontCard(useBoardStore().currentBoard().id, cardId);\n }\n }),\n switchTeam: action((team: Team) => {\n useTeamStore().setCurrent(team);\n // team and/or art has changed -> switch to board of current type with the new team/art\n internalActions.switchBoard();\n }),\n});\n\nfunction selectSticky(stickyId: string) {\n useBoardStore().selectSticky(stickyId);\n sender.startAlterCard(useBoardStore().currentBoard().id, stickyId);\n}\n\nfunction unselectSticky(stickyId: string) {\n useBoardStore().unselectSticky(stickyId);\n sender.stopAlterCard(useBoardStore().currentBoard().id, stickyId);\n}\n\nfunction setCardSize(board: Board, factor: number) {\n const val = clamp(factor, 1, 8);\n\n if (useBoardsStore().setCardSize({ boardId: board.id, factor: val })) {\n sender.scaleBoard(board.id, val);\n }\n}\n","import { applyActionParams } from \"@/action/actions\";\nimport { boardActions } from \"@/action/boardActions\";\nimport { toggleActions } from \"@/action/toggleActions\";\nimport type { Action } from \"@/action/types\";\nimport type { BoardType } from \"@/model/baseTypes\";\nimport type { BoardData } from \"@/model/board\";\nimport type { Card } from \"@/model/card\";\nimport type { RelativeCoordinate } from \"@/model/coordinates\";\nimport type { StickyType } from \"@/model/stickyType\";\nimport { useDrawStore } from \"@/store/draw\";\nimport { useUserStore } from \"@/store/user\";\n\nimport type { BoardLocation } from \"./location/BoardLocation\";\nimport { fullBoardLocation } from \"./location/BoardLocation\";\nimport type { GroupIterations } from \"./location/PlanningBoardLocation\";\n\ninterface ContextActions {\n board?: BoardContextActions;\n selection?: SelectionContextActions;\n}\n\ninterface BoardContextActions {\n syncProgramBacklog?: Action;\n draw?: Action;\n kanban?: Action;\n}\n\ninterface SelectionContextActions {\n stickyMove?: boolean;\n link?: boolean;\n mirror?: boolean;\n team?: boolean;\n}\n\ninterface PositionalActions {\n region?: RegionContextActions;\n}\n\ninterface RegionContextActions {\n name: string;\n arrange?: Action;\n overview?: Action;\n sync?: Action;\n zoom?: Action;\n kanban?: Action;\n}\n\n/* eslint-disable @typescript-eslint/class-literal-property-style */\nexport abstract class BaseBoard {\n constructor(protected board: BoardData) {}\n\n get groups(): GroupIterations[] {\n return [];\n }\n\n location(_pos: RelativeCoordinate | number, _top?: number): BoardLocation {\n return fullBoardLocation;\n }\n\n positionalCardProperties(_pos: RelativeCoordinate): Partial {\n return {};\n }\n\n get showPermanentLinks() {\n return false;\n }\n\n get showRiskyLinks() {\n return false;\n }\n\n abstract get possibleStickyTypes(): StickyType[];\n\n get creatableStickyTypes(): StickyType[] {\n return this.possibleStickyTypes;\n }\n\n abstract get contextActions(): ContextActions;\n\n positionalActions(_pos: RelativeCoordinate): PositionalActions {\n return {};\n }\n\n drawAction(): Action | undefined {\n if (useUserStore().isAllowed(\"editBoard\") && useDrawStore().isSupportedBoard(this.board.type)) {\n // Show the appropriate action based on whether the draw mode is active\n return useDrawStore().active ? toggleActions.hideDraw : toggleActions.showDraw;\n }\n }\n\n arrangeAction(loc: BoardLocation): Action | undefined {\n if (useUserStore().isAllowed(\"edit\")) {\n return applyActionParams(boardActions.confirmArrange, this.board.id, loc.index());\n }\n }\n\n zoomAction(loc: BoardLocation): Action | undefined {\n return applyActionParams(boardActions.zoomToRegion, loc.bounds);\n }\n}\n","import { applyActionParams } from \"@/action/actions\";\nimport { boardActions } from \"@/action/boardActions\";\nimport { navigationActions } from \"@/action/navigationActions\";\nimport type { Action } from \"@/action/types\";\nimport { isSessionAlmSynced } from \"@/backend/Backend\";\nimport type { BoardType } from \"@/model/baseTypes\";\nimport { useConnectionStore } from \"@/store/connection\";\nimport { useUserStore } from \"@/store/user\";\n\nimport { BaseBoard } from \"./BaseBoard\";\n\nexport abstract class BaseBacklogBoard extends BaseBoard {\n get contextActions() {\n return {\n board: {\n syncProgramBacklog: this.syncAction(),\n draw: this.drawAction(),\n kanban: this.showKanbanBoard(this.board.type),\n },\n selection: {\n link: true,\n mirror: true,\n team: true,\n },\n };\n }\n\n syncAction(): Action | undefined {\n if (useUserStore().isAllowed(\"edit\") && isSessionAlmSynced() && useConnectionStore().alm) {\n return boardActions.confirmSyncBacklog;\n }\n }\n\n showKanbanBoard(boardType: BoardType): Action | undefined {\n if (boardType === \"backlog\") {\n return applyActionParams(navigationActions.showArtKanban, { boardType });\n }\n if (boardType === \"solution_backlog\") {\n return applyActionParams(navigationActions.showSolutionKanban, { boardType });\n }\n return undefined;\n }\n}\n","import { useStickyTypeStore } from \"@/store/stickyType\";\n\nimport { BaseBacklogBoard } from \"./BaseBacklogBoard\";\n\nexport class BacklogBoard extends BaseBacklogBoard<\"backlog\"> {\n positionalCardProperties() {\n return { priority: 0 };\n }\n\n get possibleStickyTypes() {\n return useStickyTypeStore().nonFlexBoardStickyTypes(\"backlog\");\n }\n}\n","import { useStickyTypeStore } from \"@/store/stickyType\";\n\nimport { BaseBoard } from \"./BaseBoard\";\n\nexport class FlexBoard extends BaseBoard<\"flex\"> {\n get possibleStickyTypes() {\n return useStickyTypeStore().flexBoardStickyTypes(this.board.flexType.id);\n }\n\n get contextActions() {\n return {\n board: { draw: this.drawAction() },\n selection: { stickyMove: true },\n };\n }\n}\n","import { applyActionParams } from \"@/action/actions\";\nimport { navigationActions } from \"@/action/navigationActions\";\nimport { toggleActions } from \"@/action/toggleActions\";\nimport type { Action } from \"@/action/types\";\nimport { relativeClientCoord } from \"@/math/coordinate-systems\";\nimport type { BoardType } from \"@/model/baseTypes\";\nimport type { RelativeCoordinate } from \"@/model/coordinates\";\nimport { useSessionStore } from \"@/store/session\";\n\nimport { BaseBoard } from \"./BaseBoard\";\nimport type { PlanningBoardLocation } from \"./location/PlanningBoardLocation\";\n\n/* eslint-disable @typescript-eslint/class-literal-property-style */\nexport abstract class BasePlanningBoard extends BaseBoard {\n nonTeamGroup(name: string) {\n return { id: \"\", name, iterations: useSessionStore().iterations };\n }\n\n get showRiskyLinks() {\n return true;\n }\n\n abstract location(pos: RelativeCoordinate | number, top?: number): PlanningBoardLocation;\n\n get contextActions() {\n return {\n board: {\n draw: this.drawAction(),\n kanban: this.showKanbanBoard(this.board.type),\n },\n selection: {\n stickyMove: true,\n link: true,\n },\n };\n }\n\n positionalActions(c: RelativeCoordinate) {\n const loc = this.location(c);\n return {\n region: {\n name: loc.names().join(\" \"),\n overview: this.overviewAction(loc),\n },\n };\n }\n\n overview(e: MouseEvent) {\n this.overviewAction(this.location(relativeClientCoord(e)))?.(\"mouse\");\n }\n\n overviewAction(\n loc: PlanningBoardLocation,\n setReturnFocus?: string, // Selector of element to be focused when overview is closed\n ) {\n return applyActionParams(toggleActions.showOverview, {\n boardId: this.board.id,\n location: loc.index(),\n load: loc.groupIteration?.load,\n velocity: loc.groupIteration?.velocity,\n setReturnFocus,\n });\n }\n\n showKanbanBoard(boardType: BoardType): Action | undefined {\n if (boardType === \"program\") {\n return applyActionParams(navigationActions.showArtKanban, { boardType });\n }\n if (boardType === \"solution\") {\n return applyActionParams(navigationActions.showSolutionKanban, { boardType });\n }\n return undefined;\n }\n}\n","import { range } from \"lodash-es\";\n\nimport { rectangle } from \"@/math/coordinates\";\nimport type { GroupIteration } from \"@/model/board\";\nimport type { Rectangle, RelativeCoordinate } from \"@/model/coordinates\";\nimport { isCoordinate, relativeCoord } from \"@/model/coordinates\";\nimport type { Iteration } from \"@/model/session\";\nimport { fixLine } from \"@/model/shape\";\nimport { i18n } from \"@/translations/i18n\";\n\nimport type { BoardLocation } from \"./BoardLocation\";\nimport { borderLines } from \"./BoardLocation\";\n\nconst backlogColumn = -2;\nconst groupColumn = -1;\nconst iterationRow = -1;\n\ntype PlanningBoardType = \"team\" | \"art\";\nconst i18nMap = {\n team: {\n row: /*$t*/ \"general.namedTeam\",\n backlog: /*$t*/ \"backlogBoard.programBacklog\",\n },\n art: {\n row: /*$t*/ \"general.namedArt\",\n backlog: /*$t*/ \"backlogBoard.solutionBacklog\",\n },\n};\n\nexport interface GroupIterations {\n id: string;\n name: string;\n current?: boolean;\n iterations: GroupIteration[];\n}\n\nexport class PlanningBoardLocation implements BoardLocation {\n private readonly iterations: Iteration[];\n private readonly iteration: Iteration;\n private readonly group?: GroupIterations;\n readonly groupIteration?: GroupIteration;\n readonly iterationId: number | null;\n readonly groupId: string | null;\n\n constructor(\n private type: PlanningBoardType,\n private groups: GroupIterations[],\n public left: number,\n public top: number,\n ) {\n this.iterations = groups[0].iterations;\n this.iteration = this.iterations[left];\n this.iterationId = this.iteration?.id ?? null;\n this.group = groups[top];\n this.groupIteration = this.group?.iterations ? this.group.iterations[left] : undefined;\n this.groupId = this.group?.id || null;\n }\n\n static of(\n type: PlanningBoardType,\n groups: GroupIterations[],\n coordOrLeft: RelativeCoordinate | number,\n top?: number,\n ): PlanningBoardLocation {\n return isCoordinate(coordOrLeft)\n ? PlanningBoardLocation.fromCoordinate(type, groups, coordOrLeft)\n : new PlanningBoardLocation(type, groups, coordOrLeft, top!);\n }\n\n static ofTeams(\n teams: GroupIterations[],\n coordOrLeft: RelativeCoordinate | number,\n top?: number,\n ): PlanningBoardLocation {\n return PlanningBoardLocation.of(\"team\", teams, coordOrLeft, top);\n }\n\n static ofArts(\n arts: GroupIterations[],\n coordOrLeft: RelativeCoordinate | number,\n top?: number,\n ): PlanningBoardLocation {\n return PlanningBoardLocation.of(\"art\", arts, coordOrLeft, top);\n }\n\n static fromCoordinate(\n type: PlanningBoardType,\n groups: GroupIterations[],\n coord: RelativeCoordinate,\n ): PlanningBoardLocation {\n const rawLeft = coord.x * (groups[0].iterations.length + 1) - 1;\n const left = rawLeft < -0.5 ? backlogColumn : Math.floor(rawLeft);\n const top = Math.floor(coord.y * (groups.length + 0.5) - 0.5);\n return new PlanningBoardLocation(type, groups, left, top);\n }\n\n matches(coord: RelativeCoordinate) {\n const loc = PlanningBoardLocation.fromCoordinate(this.type, this.groups, coord);\n return (\n ((this.left === backlogColumn || this.top === iterationRow) && this.left === loc.left) ||\n ((this.left === groupColumn || this.left === loc.left) && this.top === loc.top)\n );\n }\n\n iterationName() {\n switch (this.left) {\n case backlogColumn:\n return i18n.global.t(i18nMap[this.type].backlog);\n case groupColumn:\n return \"\";\n default:\n return i18n.global.t(\"general.namedIteration\", { name: this.iteration.name });\n }\n }\n\n groupName() {\n if (this.left === backlogColumn || !this.group) {\n return \"\";\n }\n if (!this.group.id) {\n return this.group.name;\n }\n return i18n.global.t(i18nMap[this.type].row, { name: this.group.name });\n }\n\n names() {\n return [this.groupName(), this.iterationName()].filter((name) => !!name);\n }\n\n get name() {\n return this.iterationName() + \" \" + this.groupName();\n }\n\n get bounds(): Rectangle {\n const cols = this.iterations.length + 1;\n const rows = this.groups.length + 0.5;\n const [x, width] =\n this.left < 0 ? [(this.left / 2 + 1) / cols, 0.5 / cols] : [(this.left + 1) / cols, 1 / cols];\n const [y, height] = this.top < 0 ? [0, 0.5 / rows] : [(this.top + 0.5) / rows, 1 / rows];\n if (this.left === backlogColumn && this.top >= 0) {\n return rectangle({\n from: relativeCoord(x, 0.5 / rows),\n size: relativeCoord(width, 1 - 0.5 / rows),\n });\n }\n return rectangle({\n from: relativeCoord(x, y),\n size: relativeCoord(width, height),\n });\n }\n\n get shapes() {\n const rows = this.groups.length + 0.5;\n const cols = this.iterations.length + 1;\n return [\n ...borderLines,\n fixLine(\"v0\", relativeCoord(0.5 / cols, 0), relativeCoord(0.5 / cols, 1)),\n ...range(1, cols).map((col) =>\n fixLine(\"v\" + col, relativeCoord(col / cols, 0), relativeCoord(col / cols, 1)),\n ),\n fixLine(\"h0\", relativeCoord(0.5 / cols, 0.5 / rows), relativeCoord(1, 0.5 / rows)),\n ...range(1.5, this.groups.length).map((row) =>\n fixLine(\"h\" + row, relativeCoord(0.5 / cols, row / rows), relativeCoord(1, row / rows)),\n ),\n ];\n }\n\n index() {\n return [this.left, this.top];\n }\n}\n","import type { RelativeCoordinate } from \"@/model/coordinates\";\nimport type { Team } from \"@/model/session\";\nimport { useArtStore } from \"@/store/art\";\nimport { useBoardsStore } from \"@/store/boards\";\nimport { useClientSettingsStore } from \"@/store/clientSettings\";\nimport { useSessionStore } from \"@/store/session\";\nimport { useStickyTypeStore } from \"@/store/stickyType\";\nimport { useTeamStore } from \"@/store/team\";\nimport { i18n } from \"@/translations/i18n\";\n\nimport { BasePlanningBoard } from \"./BasePlanningBoard\";\nimport { PlanningBoardLocation } from \"./location/PlanningBoardLocation\";\n\nexport class ProgramBoard extends BasePlanningBoard<\"program\"> {\n get groups() {\n const teamIterations = Object.fromEntries(\n useBoardsStore()\n .artTeamBoards()\n .map((board) => [\n board.team.id,\n board.iterations.map((bi, index) => ({\n load: bi.load,\n velocity: bi.velocity,\n ...useSessionStore().iterations[index],\n })),\n ]),\n );\n\n return [\n this.nonTeamGroup(i18n.global.t(\"programBoard.milestoneEvents\")),\n ...useTeamStore()\n .teamsInArt(this.board.artId || \"\")\n .map(teamGroup),\n ...(useArtStore().isMultiArt\n ? [this.nonTeamGroup(i18n.global.t(\"programBoard.otherArts\"))]\n : []),\n this.nonTeamGroup(\"\"),\n ];\n\n function teamGroup(team: Team) {\n return {\n id: team.id,\n name: team.name,\n current: team.id === useTeamStore().current.id,\n iterations: teamIterations[team.id],\n };\n }\n }\n\n location(pos: RelativeCoordinate | number, top?: number) {\n return PlanningBoardLocation.ofTeams(this.groups, pos, top);\n }\n\n positionalCardProperties(pos: RelativeCoordinate) {\n const loc = this.location(pos);\n return { iterationId: loc.iterationId, teamId: loc.groupId };\n }\n\n get showPermanentLinks() {\n return useClientSettingsStore().permanentProgramLinks;\n }\n\n get possibleStickyTypes() {\n return useStickyTypeStore().nonFlexBoardStickyTypes(\"program\");\n }\n}\n","import type { StickyType } from \"@/model/stickyType\";\n\nimport { BaseBoard } from \"./BaseBoard\";\n\nexport class ProgramObjectivesBoard extends BaseBoard<\"objectives\"> {\n get possibleStickyTypes(): StickyType[] {\n return [];\n }\n\n contextActions = {};\n}\n","import { rectangle } from \"@/math/coordinates\";\nimport type { Rectangle, RelativeCoordinate } from \"@/model/coordinates\";\nimport { isCoordinate, relativeCoord } from \"@/model/coordinates\";\nimport type { Shape } from \"@/model/shape\";\nimport { fixLine } from \"@/model/shape\";\nimport { i18n } from \"@/translations/i18n\";\n\nimport type { BoardLocation } from \"./BoardLocation\";\nimport { borderLines } from \"./BoardLocation\";\n\nconst names = [\n /*$t*/ \"risk.resolved\",\n /*$t*/ \"risk.owned\",\n /*$t*/ \"risk.accepted\",\n /*$t*/ \"risk.mitigated\",\n /*$t*/ \"riskBoardLocation.submissions\",\n];\nconst roam = [\"R\", \"O\", \"A\", \"M\", \"\"];\n\nexport class RiskBoardLocation implements BoardLocation {\n readonly shapes: Shape[] = [\n ...borderLines,\n fixLine(\"v\", relativeCoord(0.5, 0), relativeCoord(0.5, 0.85)),\n fixLine(\"h1\", relativeCoord(0, 0.5), relativeCoord(1, 0.5)),\n fixLine(\"h2\", relativeCoord(0, 0.85), relativeCoord(1, 0.85)),\n ];\n\n constructor(private regionIndex: number) {}\n\n static of(value: RelativeCoordinate | number): RiskBoardLocation {\n return isCoordinate(value)\n ? RiskBoardLocation.fromCoordinate(value)\n : new RiskBoardLocation(value);\n }\n\n static fromCoordinate(coord: RelativeCoordinate): RiskBoardLocation {\n if (coord.y < 0.5) {\n return new RiskBoardLocation(Math.floor(coord.x * 2));\n }\n if (coord.y < 0.85) {\n return new RiskBoardLocation(2 + Math.floor(coord.x * 2));\n }\n return new RiskBoardLocation(4);\n }\n\n get bounds(): Rectangle {\n return rectangle({\n from: this.topLeft,\n size: this.regionIndex < 4 ? relativeCoord(0.5, 0.34) : relativeCoord(1, 0.18),\n });\n }\n\n private get topLeft(): RelativeCoordinate {\n if (this.regionIndex < 2) {\n return relativeCoord(0.5 * (this.regionIndex % 2), 0.17);\n }\n if (this.regionIndex < 4) {\n return relativeCoord(0.5 * (this.regionIndex % 2), 0.52);\n }\n return relativeCoord(0, 0.82);\n }\n\n matches(coord: RelativeCoordinate) {\n return RiskBoardLocation.fromCoordinate(coord).regionIndex === this.regionIndex;\n }\n\n get roam() {\n return roam[this.regionIndex];\n }\n\n get name(): string {\n return i18n.global.t(names[this.regionIndex]);\n }\n\n index() {\n return [this.regionIndex];\n }\n}\n","import { applyActionParams } from \"@/action/actions\";\nimport { toggleActions } from \"@/action/toggleActions\";\nimport type { Action } from \"@/action/types\";\nimport { relativeClientCoord } from \"@/math/coordinate-systems\";\nimport type { RelativeCoordinate } from \"@/model/coordinates\";\nimport { useStickyTypeStore } from \"@/store/stickyType\";\n\nimport { BaseBoard } from \"./BaseBoard\";\nimport { RiskBoardLocation } from \"./location/RiskBoardLocation\";\n\nexport class RiskBoard extends BaseBoard<\"risk\"> {\n location(pos: RelativeCoordinate | number) {\n return RiskBoardLocation.of(pos);\n }\n\n get possibleStickyTypes() {\n return useStickyTypeStore().nonFlexBoardStickyTypes(\"risk\");\n }\n\n get creatableStickyTypes() {\n // we can’t select a team on the risk board, hence we should not allow creating team board stickies on the risk board\n return this.possibleStickyTypes.filter((type) => type.origin !== \"team\");\n }\n\n get contextActions() {\n return {\n board: { draw: this.drawAction() },\n selection: {\n stickyMove: true,\n link: true,\n },\n };\n }\n\n positionalActions(c: RelativeCoordinate) {\n const loc = this.location(c);\n return {\n region: {\n name: loc.name,\n arrange: this.arrangeAction(loc),\n overview: this.overviewAction(loc),\n zoom: this.zoomAction(loc),\n },\n };\n }\n\n overview(e: MouseEvent) {\n this.overviewAction(this.location(relativeClientCoord(e)))?.(\"mouse\");\n }\n\n overviewAction(loc: RiskBoardLocation): Action | undefined {\n return applyActionParams(toggleActions.showOverview, {\n boardId: this.board.id,\n location: loc.index(),\n });\n }\n}\n","import { useStickyTypeStore } from \"@/store/stickyType\";\n\nimport { BaseBacklogBoard } from \"./BaseBacklogBoard\";\n\nexport class SolutionBacklogBoard extends BaseBacklogBoard<\"solution_backlog\"> {\n get possibleStickyTypes() {\n return useStickyTypeStore().nonFlexBoardStickyTypes(\"solution_backlog\");\n }\n}\n","import type { RelativeCoordinate } from \"@/model/coordinates\";\nimport type { Art } from \"@/model/session\";\nimport { useArtStore } from \"@/store/art\";\nimport { useSessionStore } from \"@/store/session\";\nimport { useStickyTypeStore } from \"@/store/stickyType\";\nimport { i18n } from \"@/translations/i18n\";\n\nimport { BasePlanningBoard } from \"./BasePlanningBoard\";\nimport { PlanningBoardLocation } from \"./location/PlanningBoardLocation\";\n\n/* eslint-disable @typescript-eslint/class-literal-property-style */\nexport class SolutionBoard extends BasePlanningBoard<\"solution\"> {\n get groups() {\n // don't set load and capacity as we'd have to load all teams boards for it\n const artIterations = Object.fromEntries(\n useArtStore().arts.map((art) => [art.id, useSessionStore().iterations]),\n );\n return [\n this.nonTeamGroup(i18n.global.t(\"programBoard.milestoneEvents\")),\n ...useArtStore().arts.map(artGroup),\n this.nonTeamGroup(\"\"),\n ];\n\n function artGroup(art: Art) {\n return {\n id: art.id,\n name: art.name,\n current: art.id === useArtStore().current.id,\n iterations: artIterations[art.id],\n };\n }\n }\n\n location(pos: RelativeCoordinate | number, top?: number) {\n return PlanningBoardLocation.ofArts(this.groups, pos, top);\n }\n\n positionalCardProperties(pos: RelativeCoordinate) {\n const loc = this.location(pos);\n return { iterationId: loc.iterationId, artId: loc.groupId };\n }\n\n get showPermanentLinks() {\n return true;\n }\n\n get possibleStickyTypes() {\n return useStickyTypeStore().nonFlexBoardStickyTypes(\"solution\");\n }\n\n get creatableStickyTypes() {\n // we can't select a team on the solution-planning board, hence we should not allow creating team board stickies (dependencies)\n // also we should not allow creating art backlog stickies on the solution-planning board, because we do not automatically create\n // the origin on the art backlog board (not implemented in the backend)\n return this.possibleStickyTypes.filter(\n (type) => type.origin !== \"team\" && type.origin !== \"backlog\",\n );\n }\n}\n","import { range } from \"lodash-es\";\n\nimport { rectangle } from \"@/math/coordinates\";\nimport type { BoardIteration } from \"@/model/board\";\nimport type { Rectangle, RelativeCoordinate } from \"@/model/coordinates\";\nimport { isCoordinate, relativeCoord } from \"@/model/coordinates\";\nimport type { Shape } from \"@/model/shape\";\nimport { fixLine } from \"@/model/shape\";\nimport { useSessionStore } from \"@/store/session\";\nimport { i18n } from \"@/translations/i18n\";\n\nimport type { BoardLocation } from \"./BoardLocation\";\nimport { borderLines } from \"./BoardLocation\";\n\nexport const OBJECTIVES_INDEX = -1;\nexport const RISKS_INDEX = -2;\nexport const EMPTY_INDEX = -3;\n\nexport class TeamBoardLocation implements BoardLocation {\n constructor(\n private iterations: BoardIteration[],\n private regionIndex: number,\n ) {}\n\n static of(iterations: BoardIteration[], value: RelativeCoordinate | number): TeamBoardLocation {\n return isCoordinate(value)\n ? TeamBoardLocation.fromCoordinate(iterations, value)\n : new TeamBoardLocation(iterations, value);\n }\n\n static fromCoordinate(\n iterations: BoardIteration[],\n coord: RelativeCoordinate,\n ): TeamBoardLocation {\n const left = Math.floor(coord.x * columns(iterations));\n if (coord.y < 0.5) {\n return new TeamBoardLocation(iterations, left);\n }\n switch (left) {\n case 0:\n return new TeamBoardLocation(iterations, OBJECTIVES_INDEX);\n case 1:\n return new TeamBoardLocation(iterations, RISKS_INDEX);\n default: {\n const iter = left + columns(iterations) - 2;\n return iter < iterations.length\n ? new TeamBoardLocation(iterations, iter)\n : new TeamBoardLocation(iterations, EMPTY_INDEX);\n }\n }\n }\n\n matches(coord: RelativeCoordinate) {\n return (\n TeamBoardLocation.fromCoordinate(this.iterations, coord).regionIndex === this.regionIndex\n );\n }\n\n get iterationId(): number | null {\n return this.regionIndex < 0 ? null : this.regionIndex;\n }\n\n get isIteration() {\n return this.iterationId !== null;\n }\n\n get name() {\n switch (this.regionIndex) {\n case OBJECTIVES_INDEX:\n return i18n.global.t(\"general.objectives\");\n case RISKS_INDEX:\n return i18n.global.t(\"teamBoardLocation.risks\");\n case EMPTY_INDEX:\n return \" \";\n default:\n return i18n.global.t(\"general.namedIteration\", {\n name: useSessionStore().iterations[this.regionIndex].name,\n });\n }\n }\n\n get boardIteration(): BoardIteration | undefined {\n return this.iterations[this.regionIndex];\n }\n\n get bounds(): Rectangle {\n return rectangle({\n from: this.topLeft,\n size: relativeCoord(1 / this.columns, 0.5),\n });\n }\n\n get shapes(): Shape[] {\n return [\n ...borderLines,\n fixLine(\"h\", relativeCoord(0, 0.5), relativeCoord(1, 0.5)),\n ...range(1, this.columns).map((col) =>\n fixLine(\n \"v\" + col,\n relativeCoord(col / this.columns, 0),\n relativeCoord(col / this.columns, 1),\n ),\n ),\n ];\n }\n\n private get topLeft(): RelativeCoordinate {\n switch (this.regionIndex) {\n case OBJECTIVES_INDEX:\n return relativeCoord(0, 0.5);\n case RISKS_INDEX:\n return relativeCoord(1 / this.columns, 0.5);\n case EMPTY_INDEX:\n return relativeCoord(1 - 1 / this.columns, 0.5);\n default:\n return this.regionIndex < this.columns\n ? relativeCoord(this.regionIndex / this.columns, 0)\n : relativeCoord((this.regionIndex - this.columns + 2) / this.columns, 0.5);\n }\n }\n\n get columns() {\n return columns(this.iterations);\n }\n\n index() {\n return [this.regionIndex];\n }\n\n isObjectives() {\n return this.regionIndex === OBJECTIVES_INDEX;\n }\n\n isRisks() {\n return this.regionIndex === RISKS_INDEX;\n }\n\n isEmpty() {\n return this.regionIndex === EMPTY_INDEX;\n }\n}\n\nfunction columns(iterations: unknown[]) {\n return Math.ceil(1 + iterations.length / 2);\n}\n","import { applyActionParams } from \"@/action/actions\";\nimport { boardActions } from \"@/action/boardActions\";\nimport { navigationActions } from \"@/action/navigationActions\";\nimport { toggleActions } from \"@/action/toggleActions\";\nimport type { Action } from \"@/action/types\";\nimport { isSessionAlmSynced } from \"@/backend/Backend\";\nimport { relativeClientCoord } from \"@/math/coordinate-systems\";\nimport type { RelativeCoordinate } from \"@/model/coordinates\";\nimport { useClientSettingsStore } from \"@/store/clientSettings\";\nimport { useConnectionStore } from \"@/store/connection\";\nimport { useStickyTypeStore } from \"@/store/stickyType\";\nimport { useUserStore } from \"@/store/user\";\n\nimport { BaseBoard } from \"./BaseBoard\";\nimport { TeamBoardLocation } from \"./location/TeamBoardLocation\";\n\n/* eslint-disable @typescript-eslint/class-literal-property-style */\nexport class TeamBoard extends BaseBoard<\"team\"> {\n location(pos: RelativeCoordinate | number) {\n return TeamBoardLocation.of(this.board.iterations, pos);\n }\n\n positionalCardProperties(pos: RelativeCoordinate) {\n const loc = this.location(pos);\n return { iterationId: loc.iterationId, teamId: this.board.team.id };\n }\n\n get showPermanentLinks() {\n return useClientSettingsStore().permanentTeamLinks;\n }\n\n get showRiskyLinks() {\n return true;\n }\n\n get possibleStickyTypes() {\n return useStickyTypeStore().nonFlexBoardStickyTypes(\"team\");\n }\n\n get contextActions() {\n return {\n board: { draw: this.drawAction() },\n selection: {\n stickyMove: true,\n link: true,\n },\n };\n }\n\n positionalActions(c: RelativeCoordinate) {\n const loc = this.location(c);\n if (!loc.isIteration && !loc.isRisks()) {\n return {};\n }\n return {\n region: {\n name: loc.name,\n arrange: this.arrangeAction(loc),\n overview: this.overviewAction(loc),\n sync: this.syncAction(loc),\n zoom: this.zoomAction(loc),\n kanban: this.showKanbanBoard(loc),\n },\n };\n }\n\n showKanbanBoard(loc: TeamBoardLocation): Action | undefined {\n const iterationId = loc.iterationId;\n if (loc.isIteration && iterationId !== null) {\n return applyActionParams(navigationActions.showIterationKanban, { iterationId });\n }\n return undefined;\n }\n\n syncAction(loc: TeamBoardLocation): Action | undefined {\n if (\n useUserStore().isAllowed(\"edit\") &&\n useConnectionStore().alm &&\n isSessionAlmSynced() &&\n !!loc.boardIteration &&\n loc.boardIteration.state.status !== \"syncing\"\n ) {\n return applyActionParams(\n boardActions.confirmSyncIteration,\n loc.iterationId,\n loc.boardIteration?.state.status,\n );\n }\n }\n\n overview(e: MouseEvent) {\n this.overviewAction(this.location(relativeClientCoord(e)))?.(\"mouse\");\n }\n\n overviewAction(loc: TeamBoardLocation): Action | undefined {\n if (loc.isObjectives()) {\n return;\n }\n return applyActionParams(toggleActions.showOverview, {\n load: loc.boardIteration?.load,\n velocity: loc.boardIteration?.velocity,\n boardId: this.board.id,\n location: loc.index(),\n });\n }\n}\n","import type { BoardType } from \"@/model/baseTypes\";\nimport type { BoardData } from \"@/model/board\";\n\nimport { BacklogBoard } from \"./BacklogBoard\";\nimport type { BaseBoard } from \"./BaseBoard\";\nimport { FlexBoard } from \"./FlexBoard\";\nimport { ProgramBoard } from \"./ProgramBoard\";\nimport { ProgramObjectivesBoard } from \"./ProgramObjectivesBoard\";\nimport { RiskBoard } from \"./RiskBoard\";\nimport { SolutionBacklogBoard } from \"./SolutionBacklogBoard\";\nimport { SolutionBoard } from \"./SolutionBoard\";\nimport { TeamBoard } from \"./TeamBoard\";\n\nexport function boardOf(board?: BoardData): BaseBoard {\n switch (board?.type) {\n case \"backlog\":\n return new BacklogBoard(board);\n case \"program\":\n return new ProgramBoard(board);\n case \"solution_backlog\":\n return new SolutionBacklogBoard(board);\n case \"solution\":\n return new SolutionBoard(board);\n case \"risk\":\n return new RiskBoard(board);\n case \"team\":\n return new TeamBoard(board);\n case \"flex\":\n return new FlexBoard(board);\n case \"objectives\":\n return new ProgramObjectivesBoard(board);\n case undefined:\n return new ProgramObjectivesBoard(board as any);\n }\n}\n","import { sender } from \"@/backend/Sender\";\nimport { userHeartbeatInterval } from \"@/model/Settings\";\nimport { useBoardStore } from \"@/store/board\";\nimport { useUserStore } from \"@/store/user\";\nimport { useUsersOnBoardStore } from \"@/store/usersOnBoard\";\n\nconst heartbeatWorker = new Worker(\"/workers/heartbeat.js\");\n\nheartbeatWorker.addEventListener(\"message\", () => {\n _onHeartbeatTick();\n});\n\nexport function startUserHeartbeat() {\n heartbeatWorker.postMessage({\n action: \"start\",\n interval: userHeartbeatInterval,\n });\n}\n\nexport function stopUserHeartbeat() {\n heartbeatWorker.postMessage({ action: \"stop\" });\n}\n\nfunction _onHeartbeatTick() {\n sender.addUserOnBoard(useBoardStore().boardId(), useUserStore().technicalUser.id);\n useUsersOnBoardStore().expireUsersOnBoard();\n}\n","import { defineStore } from \"pinia\";\n\nimport { type BaseBoard } from \"@/board/BaseBoard\";\nimport { boardOf } from \"@/board/boardFactory\";\nimport type { BoardLocation } from \"@/board/location/BoardLocation\";\nimport { sendStickyNoteAction } from \"@/composables/useEventBus\";\nimport type { BoardType, Id } from \"@/model/baseTypes\";\nimport type { Board } from \"@/model/board\";\nimport type { BoardCard, Card } from \"@/model/card\";\nimport type { RelativeCoordinate } from \"@/model/coordinates\";\nimport type { StickyType } from \"@/model/stickyType\";\nimport { startUserHeartbeat, stopUserHeartbeat } from \"@/services/heartbeat.service\";\n\nimport { useBoardsStore } from \"./boards\";\nimport { usePointerStore } from \"./pointer\";\nimport { useUsersOnBoardStore } from \"./usersOnBoard\";\n\nclass BoardNotFoundError extends Error {}\n\nexport const useBoardStore = defineStore(\"board\", {\n state: () => {\n return {\n board: undefined as Board | undefined,\n activeCardId: null as string | null,\n enlargedStickyNoteId: null as string | null,\n magnifying: false,\n scaleDropdownOpen: false,\n };\n },\n getters: {\n baseBoard: (state): BaseBoard => boardOf(state.board),\n positionalCardProperties() {\n return (pos: RelativeCoordinate): Partial =>\n this.baseBoard.positionalCardProperties(pos);\n },\n boardLocation() {\n return (pos: RelativeCoordinate | number, top?: number): BoardLocation =>\n this.baseBoard.location(pos, top);\n },\n // sticky types that can possibly appear on the board\n possibleStickyTypes(): StickyType[] {\n return this.baseBoard.possibleStickyTypes;\n },\n // sticky types that can be used to create a new sticky note\n creatableStickyTypes(): StickyType[] {\n return this.baseBoard.creatableStickyTypes;\n },\n showRiskyLinks(): boolean {\n return this.baseBoard.showRiskyLinks;\n },\n hasCurrentBoard: (state) => {\n return typeof state.board !== \"undefined\";\n },\n currentBoard: (state) => (): Board => {\n if (state.board) {\n return state.board;\n }\n throw new BoardNotFoundError(\"No current board is set\");\n },\n boardId() {\n return () => this.currentBoard().id;\n },\n isCurrentBoardFluid: (state) => {\n return state.board?.type !== \"objectives\";\n },\n boardLocationFromIndex() {\n return (index: string[]): BoardLocation =>\n this.boardLocation(parseInt(index[0], 10), parseInt(index[1], 10));\n },\n selectedStickyIds: (state) => {\n return Object.keys(state.board?.selected || {});\n },\n selectedStickies(): BoardCard[] {\n return this.selectedStickyIds.flatMap((id) =>\n this.currentBoard().cards[id] ? [this.currentBoard().cards[id]] : [],\n );\n },\n selectedOrActiveStickies(): BoardCard[] {\n if (this.selectedStickyIds.length > 0) {\n return this.selectedStickies;\n }\n const active = this.activeCard;\n return active ? [active] : [];\n },\n isStickySelected: (state) => {\n return (cardId: string) => cardId in (state.board?.selected || {});\n },\n isStickyIdSelectedOrActive: (state) => {\n return (id: string) => id in (state.board?.selected || {}) || state.activeCardId === id;\n },\n areMultipleStickiesSelected() {\n return this.selectedStickyIds?.length > 1;\n },\n activeCard(): BoardCard | null {\n const activeCardId = this.activeCardId;\n return activeCardId ? this.currentBoard().cards[activeCardId] : null;\n },\n },\n actions: {\n switchBoard(board?: Board) {\n const newBoard =\n board || (this.board && useBoardsStore().boardByTypeOptional(this.board.type));\n const res = { switched: false, board: this.board, cards: new Array() };\n if (newBoard && newBoard.id !== this.board?.id) {\n res.switched = true;\n if (this.hasCurrentBoard) {\n res.cards = this.leaveBoard().cards;\n }\n this.board = newBoard;\n startUserHeartbeat();\n }\n return res;\n },\n leaveBoard() {\n const board = this.currentBoard();\n this.setActiveCardId(null);\n const cards = [];\n for (const id in board.cards) {\n const card = board.cards[id];\n if (card.meta.editing) {\n cards.push(card);\n card.meta.editing = false;\n }\n }\n stopUserHeartbeat();\n usePointerStore().reset();\n useUsersOnBoardStore().usersOnBoard = [];\n return { board, cards };\n },\n selectSticky(stickyId: string) {\n if (this.currentBoard().cards[stickyId]) {\n this.currentBoard().selected[stickyId] = true;\n }\n },\n setSelectedStickies(stickyIds: string[]) {\n this.currentBoard().selected = Object.fromEntries([...stickyIds].map((id) => [id, true]));\n },\n unselectSticky(stickyId: string, board?: Board) {\n delete (board ?? this.currentBoard()).selected[stickyId];\n },\n setActiveCardId(cardId: string | null) {\n if (this.activeCardId && cardId === null) {\n sendStickyNoteAction(this.activeCardId, { action: \"changed\" });\n }\n this.activeCardId = cardId;\n },\n setEnlargedStickyNoteId(id: string | null) {\n this.enlargedStickyNoteId = id;\n },\n setActiveCard(e: Id & { active: boolean }) {\n // don't clear active card if a different one is active\n if (!e.active && this.activeCardId !== e.id) {\n return;\n }\n this.setActiveCardId(e.active ? e.id : null);\n },\n setScaleDropdownOpen(open: boolean) {\n this.scaleDropdownOpen = open;\n },\n },\n});\n","import * as amplitude from \"@amplitude/analytics-browser\";\nimport { isBoolean, isNumber, isString } from \"lodash-es\";\n\nimport { captureMessage } from \"@/error/sentry\";\nimport { useBoardStore } from \"@/store/board\";\nimport { useLicenseStore } from \"@/store/license\";\nimport { useSessionStore } from \"@/store/session\";\nimport { amplitudeDebug, isCloud } from \"@/utils/env/Environment\";\nimport { toKebabCase } from \"@/utils/text/text\";\n\nimport type { AnalyticsEvent } from \"./types\";\n\nexport function initTracking(apiKey: string) {\n amplitude.init(apiKey, {\n defaultTracking: false,\n serverZone: \"EU\",\n trackingOptions: {\n ipAddress: false,\n },\n });\n}\n\nexport const trackEvent = (params: AnalyticsEvent) => {\n const { event, ...data } = params;\n\n if (amplitudeDebug) {\n // eslint-disable-next-line no-console\n console.info(\"trackEvent\", event, data);\n }\n\n const dataWithDefaults = addDefaultProperties(data);\n const formattedData = formatEventData(dataWithDefaults);\n\n const valid = isValidEventData(formattedData);\n if (!valid) {\n void captureMessage(\"Invalid event data\", { data: { params } });\n return;\n }\n\n if (!shouldTrack()) return;\n\n amplitude.track(event, formattedData);\n};\n\n/**\n * Enrich the event data with some default properties\n * - 'board' (board type)\n * - 'daysSinceStart' (number of days since the start of the first iteration)\n */\nfunction addDefaultProperties(data: Partial) {\n return {\n board: useBoardStore().board?.type,\n daysSinceStart: useSessionStore().daysSinceStart,\n ...data,\n };\n}\n\n/**\n * Format all strings in data to kebab case and all nullish values to null\n * (we need this to handle some existing values, eg. solution_backlog)\n */\nfunction formatEventData(data: Partial) {\n return Object.fromEntries(\n Object.entries(data).map(([key, value]) => {\n if (isString(value)) {\n return [key, toKebabCase(value)];\n }\n\n if (value === null || value === undefined) {\n return [key, null];\n }\n\n return [key, value];\n }),\n );\n}\n\n// validate event data\nfunction isValidEventData(data: Record): boolean {\n const kebabCaseRegex = /^[a-z0-9]+(-[a-z0-9: ]+)*$/;\n\n const testValue = (value: unknown) => {\n if (isString(value)) {\n return kebabCaseRegex.test(value);\n }\n if (isNumber(value) && isFinite(value)) {\n return true;\n }\n if (isBoolean(value)) {\n return true;\n }\n if (value === null) {\n return true;\n }\n if (Array.isArray(value)) {\n return value.every(testValue);\n }\n return false;\n };\n\n return Object.entries(data).every(([key, value]) => {\n if (value === undefined) {\n delete data[key];\n return true;\n }\n return testValue(value);\n });\n}\n\nfunction shouldTrack() {\n return isCloud && useLicenseStore().license.tracking;\n}\n","import { isBoolean, isInteger, isObject, isString } from \"lodash-es\";\nimport { defineStore } from \"pinia\";\n\nimport { sendSetting } from \"@/composables/useEventBus\";\nimport type { WorkingMode } from \"@/model/baseTypes\";\nimport type { Board, KanbanFilters } from \"@/model/board\";\nimport type { Session } from \"@/model/session\";\nimport type { StickyType } from \"@/model/stickyType\";\nimport { LocalStore } from \"@/utils/LocalStore\";\nimport { userSettingChanged } from \"@/utils/analytics/events\";\nimport { trackEvent } from \"@/utils/analytics/track\";\nimport { setUserProperty } from \"@/utils/analytics/trackUser\";\n\nimport { useBoardStore } from \"./board\";\nimport { useSessionStore } from \"./session\";\n\nexport const fonts = [\"Mulish\", \"Caveat\", \"Natural\", \"Child\", \"Lefthand\", \"Bedtime\"] as const;\n\nfunction isFont(name: unknown): name is (typeof fonts)[number] {\n return isString(name) && fonts.includes(name as any);\n}\n\nexport type StickyNoteTextAlignment = \"left\" | \"center\" | \"right\";\n\nexport const textAlignmentOptions: Array<{\n value: StickyNoteTextAlignment;\n label: string;\n}> = [\n { value: \"left\", label: /*$t*/ \"settings.stickyNoteTextAlignment.left\" },\n { value: \"center\", label: /*$t*/ \"settings.stickyNoteTextAlignment.center\" },\n { value: \"right\", label: /*$t*/ \"settings.stickyNoteTextAlignment.right\" },\n];\n\nfunction isAlignment(value: unknown): value is StickyNoteTextAlignment {\n return textAlignmentOptions.some((option) => option.value === value);\n}\n\nexport interface ClientSettings {\n workingModes: Record;\n stickyFont: (typeof fonts)[number];\n wheelZoom: boolean;\n overload: boolean;\n permanentTeamLinks: boolean;\n permanentProgramLinks: boolean;\n initialLineupDistance: number;\n showStats: number;\n overviewScale: number;\n defaultStickyTypes: Record;\n highContrastMode: boolean;\n panelWidths: Record;\n textAlignment: StickyNoteTextAlignment;\n archivedSessions: boolean;\n kanbanFilters: Record;\n}\n\nexport const useClientSettingsStore = defineStore(\"clientSettings\", {\n state: () => loadSettings(),\n getters: {\n defaultStickyTypeId(state): string {\n return state.defaultStickyTypes[this.defaultStickyTypeKey];\n },\n defaultStickyTypeKey: () => {\n const board = useBoardStore().currentBoard();\n return (\n useSessionStore().current.id +\n \"-\" +\n board.type +\n \"-\" +\n (board.type === \"flex\" ? board.flexType.id : \"\")\n );\n },\n panelWidth(state) {\n return (name: string) => state.panelWidths[name];\n },\n workingMode(state) {\n const sessionId = useSessionStore().current.id;\n const defaultWorkingMode = \"planning\";\n return state.workingModes[sessionId] || defaultWorkingMode;\n },\n kanbanFilter(state) {\n return state.kanbanFilters[useBoardStore().board!.id];\n },\n },\n actions: {\n init() {\n this.$subscribe((mutation, state) => {\n saveSettings(state);\n });\n },\n loadSettings() {\n this.$patch(loadSettings());\n },\n toggleShowStats(level: number) {\n this.showStats = this.showStats !== level ? level : 0;\n },\n toggleArchivedSessions() {\n this.archivedSessions = !this.archivedSessions;\n },\n setDefaultStickyType(type?: StickyType) {\n trackEvent(\n userSettingChanged({\n key: \"defaultStickyType\",\n toValue: type?.functionality,\n }),\n );\n if (type) {\n this.defaultStickyTypes[this.defaultStickyTypeKey] = type?.id;\n } else {\n delete this.defaultStickyTypes[this.defaultStickyTypeKey];\n }\n },\n setPanelWidth(name: string, width: number) {\n this.panelWidths[name] = width;\n },\n setWorkingMode(mode: WorkingMode) {\n const sessionId = useSessionStore().current.id;\n this.workingModes[sessionId] = mode;\n setUserProperty(\"workingMode\", mode);\n },\n setKanbanFilter(kanbanFilters: KanbanFilters) {\n this.kanbanFilters[useBoardStore().board!.id] = kanbanFilters;\n },\n },\n});\n\nconst settings: { [k in keyof ClientSettings]: LocalStore } = {\n workingModes: store(\"workingModes\", {}, isObject), // Working mode set per-session\n stickyFont: store(\"stickyFont\", \"Mulish\", isFont),\n wheelZoom: store(\"wheelZoom\", true, isBoolean),\n overload: store(\"overload\", true, isBoolean),\n permanentTeamLinks: store(\"permanentTeamLinks\", false, isBoolean),\n permanentProgramLinks: store(\"permanentProgramLinks\", true, isBoolean),\n initialLineupDistance: store(\"initialLineupDistance\", 110, isInteger),\n showStats: store(\"showStats\", 0, isInteger),\n overviewScale: store(\"overviewScale\", 6, isInteger),\n defaultStickyTypes: store(\"defaultStickyTypes\", {}, isObject),\n // To meet accessibility requirements\n highContrastMode: store(\"highContrastMode\", false, isBoolean),\n panelWidths: store(\"panelWidths\", {}, isObject),\n textAlignment: store(\"textAlignment\", \"left\", isAlignment),\n archivedSessions: store(\"archivedSessions\", false, isBoolean),\n kanbanFilters: store(\"kanbanFilters\", {}, isObject),\n};\n\nfunction loadSettings(): ClientSettings {\n const res = {} as any;\n for (const prop in settings) {\n const key = prop as keyof ClientSettings;\n res[prop] = settings[key].load();\n }\n return res as ClientSettings;\n}\n\nfunction saveSettings(data: ClientSettings) {\n for (const prop in settings) {\n const key = prop as keyof ClientSettings;\n settings[key].save(data[key] as any);\n }\n}\n\nfunction store(key: string, defaultVal: T, valid: (data: unknown) => boolean) {\n const store: LocalStore = new LocalStore(key, {\n sedes: {\n serialize: (value) => {\n sendSetting(key, value);\n return value;\n },\n deserialize: (data: unknown): T | undefined => {\n if (valid(data)) {\n return data as T;\n }\n store.save(defaultVal);\n return defaultVal;\n },\n },\n });\n return store;\n}\n","\n\n\n\n\n","\n\n\n\n\n","/**\n * Values of WheelEvent in different environments.\n * min: a faster movement results in a higher initial value\n * dyn: a faster movement results in higher non-initial values\n *\n * delta wheelDelta delta divisor result\n * TrackPad Chrome MacOs 1 3 (dyn) 1\n * TrackPad pinch Chrome MacOs 0.1.. 120 1\n * TrackPad FF MacOs 1 3 (dyn) 1\n * TrackPad pinch FF MacOs 0.1.. 0 (min) 1\n * Wheel Mouse Chrome MacOs 4... 120 (dyn) 1 4.. (a little big, but is anybody using this?)\n * Mac Mouse Chrome MacOs 1 3 (dyn) 1\n * Wheel Mouse FF MacOs 16 48 (dyn) 1 16 (ok because less dyn)\n * Mac Mouse FF MacOs 1 3 (dyn) 1\n * TrackPad Chrome Win 1 1 (min) 1\n * TrackPad pinch Chrome Win 0.1.. 120 1\n * TrackPad Edge Win 1 1 (min) 1\n * TrackPad pinch Edge Win 0.1.. 120 1\n * TrackPad FF Win 0.4.. 1 (min) 1\n * TrackPad pinch FF Win 0.1.. 0 (min) 1\n * Mouse Chrome Win 100 120 3 33.33 (because not dyn)\n * Mouse Edge Win 250 300 7.5 33.33 (because not dyn)\n * Mouse FF Win 108 120 3 36 (because not dyn)\n *\n */\n\n// events following each other in less than this time belong to the same wheel gesture\nconst EVENT_TIMEOUT = 150;\n// delta values for mouses on windows have at least this value\nconst WIN_MOUSE_DELTA = 100;\nconst BIG_WHEEL_DELTA = 120;\nconst WIN_MOUSE_DIVISOR = 40;\n\nlet lastTime = 0;\nlet lastFactor = 1;\n\nexport function normalizeWheelEvent(e: WheelEvent): {\n x: number;\n y: number;\n} {\n const time = Date.now();\n const factor = time - lastTime < EVENT_TIMEOUT ? lastFactor : calcFactor();\n lastTime = time;\n lastFactor = factor;\n return { x: e.deltaX / factor, y: e.deltaY / factor };\n\n function calcFactor() {\n if (!(\"wheelDelta\" in e)) {\n return 1;\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const wheelDelta = Math.abs((e as any).wheelDelta);\n const integerDelta = Number.isInteger(e.deltaX) && Number.isInteger(e.deltaY);\n const maxDelta = Math.max(Math.abs(e.deltaX), Math.abs(e.deltaY));\n // mouse on win\n if (wheelDelta >= BIG_WHEEL_DELTA && integerDelta && maxDelta >= WIN_MOUSE_DELTA) {\n return wheelDelta / WIN_MOUSE_DIVISOR;\n }\n return 1;\n }\n}\n","import { resetBoardScrollMargin } from \"@/components/utils/boardSize\";\nimport { pushZoomState } from \"@/router/navigation\";\nimport { useClientSettingsStore } from \"@/store/clientSettings\";\nimport { clientCoord } from \"@/utils/dom/coordinates\";\nimport { eventTarget } from \"@/utils/dom/dom\";\nimport { normalizeWheelEvent } from \"@/utils/dom/wheelEvent\";\n\nimport { processZoom } from \"./zoom\";\n\nconst scrollSensibility = 2;\nconst zoomSensibility = 0.014;\nconst debounceDelay = 150;\n\nlet moveTimeout: ReturnType | null = null;\n\nexport function initWheelHandler() {\n document.addEventListener(\"wheel\", handleWheelEvent, { passive: false });\n}\n\nfunction handleWheelEvent(e: WheelEvent) {\n if (isNoWheel(e)) {\n return;\n }\n e.preventDefault();\n\n const modifiers = e.ctrlKey || e.metaKey;\n const { x, y } = normalizeWheelEvent(e);\n\n // Handle movement or zoom\n const scroll = useClientSettingsStore().wheelZoom === modifiers;\n if (scroll) {\n window.scrollBy(scrollSensibility * x, scrollSensibility * y);\n } else {\n if (Math.abs(y) > Math.abs(x)) {\n const zoomFactor = y > 0 ? 1 / (1 + y * zoomSensibility) : 1 - y * zoomSensibility;\n processZoom(clientCoord(e), zoomFactor, \"relative\");\n }\n }\n\n // Debounce the \"stop moving\" logic\n if (moveTimeout) {\n clearTimeout(moveTimeout);\n }\n\n // Set the timeout to detect when the user has stopped moving\n moveTimeout = setTimeout(() => {\n if (scroll) {\n resetBoardScrollMargin();\n } else {\n pushZoomState();\n }\n }, debounceDelay);\n}\n\n// found a .scrollable parent -> don't zoom but let default scrolling happen (of scrollable element)\n// found a .no-wheel parent -> don't zoom and no default wheel action\n// else not default wheel action, but zoom\nfunction isNoWheel(e: MouseEvent): boolean {\n let el = eventTarget(e);\n while (el !== null) {\n if (el.classList.contains(\"scrollable\") && el.scrollHeight !== el.offsetHeight) {\n return true;\n }\n if (el.classList.contains(\"no-wheel\")) {\n e.preventDefault();\n return true;\n }\n el = el.parentElement;\n }\n e.preventDefault();\n return false;\n}\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","import type { Directive } from \"vue\";\n\nconst regions = new Set();\n\nexport function makeBoardRegionsUnfocusable() {\n for (const region of regions) {\n region.removeAttribute(\"tabindex\");\n }\n}\n\nexport function makeBoardRegionsFocusable() {\n for (const region of regions) {\n region.setAttribute(\"tabindex\", \"0\");\n }\n}\n\nexport function boardRegion(): Directive {\n return {\n mounted(el) {\n el.setAttribute(\"tabindex\", \"0\");\n regions.add(el);\n },\n beforeUnmount(el) {\n regions.delete(el);\n },\n };\n}\n","import type { FocusTarget, FocusTargetValue, FocusTrap, Options } from \"focus-trap\";\nimport { createFocusTrap } from \"focus-trap\";\nimport { isFunction, isString } from \"lodash-es\";\nimport { v4 as uuid } from \"uuid\";\nimport type { Directive, Ref } from \"vue\";\nimport { watch } from \"vue\";\n\n/**\n * Traps the focus inside an element. Usage: `v-focus-trap`\n *\n * By default, the trap is removed when the user clicks outside the trapped element.\n * This can be disabled by passing `{ disableOnOutsideClick: false }` as a value.\n */\nexport function focusTrap(): Directive<\n HTMLElement,\n Options & {\n disableOnOutsideClick?: boolean;\n rootEl?: HTMLElement;\n extraElements?: Ref;\n paused?: boolean;\n }\n> {\n const trapStack = new Array();\n const trapMap: Record = {};\n\n return {\n mounted(el, { value }) {\n // Make sure element has an ID, so we can track its focus trap\n el.id ||= uuid();\n\n // Clean up any existing focus trap for this element\n if (trapMap[el.id]) {\n trapMap[el.id].deactivate();\n delete trapMap[el.id];\n }\n\n if (value?.extraElements) {\n watch(value.extraElements, () => focusTrap.updateContainerElements(trapElements()));\n }\n\n const disableOnOutsideClick = value?.disableOnOutsideClick ?? true;\n\n const focusTrap = createFocusTrap(trapElements(), {\n initialFocus: false,\n trapStack,\n clickOutsideDeactivates: disableOnOutsideClick,\n ...(value || {}),\n fallbackFocus: evaluateFallbackFocus(value?.fallbackFocus),\n });\n focusTrap.activate();\n\n if (value?.paused) {\n focusTrap.pause();\n }\n\n trapMap[el.id] = focusTrap;\n\n function trapElements() {\n const extraIds = value?.extraElements?.value ?? [];\n return [\n value?.rootEl || el,\n ...extraIds.flatMap((id) => document.getElementById(id) ?? []),\n ];\n }\n },\n updated(el, { value }) {\n // Manage paused state\n const focusTrap = trapMap[el.id];\n\n if (!focusTrap || !value || !focusTrap.active) return;\n\n if (value.paused && !focusTrap.paused) {\n focusTrap.pause();\n }\n\n if (!value.paused && focusTrap.paused) {\n focusTrap.unpause();\n }\n },\n unmounted(el) {\n const focusTrap = trapMap[el.id];\n\n focusTrap?.deactivate();\n delete trapMap[el.id];\n },\n };\n}\n\n/**\n * Evaluates the fallback focus target. If it does not resolve to\n * a visible element, return \"body\" as the fallback.\n *\n * This ensures there will always be a valid focus target, even if\n * focus traps are unmounted in an unpredictable order (eg. when the user\n * navigates back in the browser history, with multiple traps active).\n */\nexport function evaluateFallbackFocus(fallbackFocus?: FocusTarget): FocusTargetValue {\n let el = fallbackFocus;\n if (isFunction(el)) {\n el = el();\n }\n\n if (isString(el)) {\n el = document.querySelector(el) ?? undefined;\n }\n\n return el || \"body\";\n}\n","import type { Directive } from \"vue\";\n\nimport { eventTarget, isInput, terminateEvent } from \"@/utils/dom/dom\";\n\n/**\n * Makes the element on the board scrollable by preventing the scroll event from bubbling up.\n *\n */\nexport function scrollableOnBoard(): Directive {\n function handleScroll(this: HTMLElement, event: Event) {\n event.stopPropagation();\n\n if (!isScrollable(eventTarget(event), this, event as WheelEvent)) {\n event.preventDefault();\n }\n }\n\n function handleArrowKeys(this: HTMLElement, event: KeyboardEvent) {\n const isArrowKey = [\"ArrowUp\", \"ArrowDown\", \"ArrowLeft\", \"ArrowRight\"].includes(event.key);\n\n // Don't prevent default if the event target is an input element\n const target = eventTarget(event);\n const isOnInput = target && isInput(target);\n\n if (isArrowKey && !isOnInput) {\n terminateEvent(event);\n }\n }\n\n return {\n mounted(el) {\n el.addEventListener(\"scroll\", handleScroll);\n el.addEventListener(\"wheel\", handleScroll);\n el.addEventListener(\"keydown\", handleArrowKeys);\n },\n\n unmounted(el) {\n el.removeEventListener(\"scroll\", handleScroll);\n el.removeEventListener(\"wheel\", handleScroll);\n el.removeEventListener(\"keydown\", handleArrowKeys);\n },\n };\n}\n\n/**\n * Checks if an element is scrollable within a given maximum parent element.\n *\n * @param el - The element to check for scrollability.\n * @param maxParentElement - The maximum parent element within which to check for scrollability.\n * @param event - The wheel event that triggered the check.\n * @returns A boolean indicating whether the element is scrollable.\n */\nconst isScrollable = (el: HTMLElement | null, maxParentElement: HTMLElement, event: WheelEvent) => {\n let parent: HTMLElement | null = el;\n while (parent && parent !== maxParentElement) {\n if (parent.scrollHeight > parent.clientHeight) {\n const isScrollingDown = event.deltaY > 0;\n const isAtBottom = parent.scrollTop + parent.clientHeight >= parent.scrollHeight - 1;\n const isAtTop = parent.scrollTop < 1;\n if ((isScrollingDown && !isAtBottom) || (!isScrollingDown && !isAtTop)) {\n return true;\n }\n }\n parent = parent.parentElement;\n }\n return false;\n};\n","import type { AxiosResponse } from \"axios\";\n\nimport type { Tenant } from \"@/model/session\";\nimport * as Environment from \"@/utils/env/Environment\";\n\nimport {\n createApiClient,\n isAuthenticated,\n login,\n loginPage,\n logout,\n refreshToken,\n} from \"./api.config\";\n\nconst apiClient = createApiClient(Environment.authAPIUrl);\n\nexport default {\n async ping(): Promise {\n return await apiClient.get(\"auth/user\");\n },\n isAuthenticated,\n logout,\n login,\n loginPage,\n refreshToken,\n};\n\nexport interface LoginRequest {\n email?: string;\n tenantId?: string;\n type?: string;\n path?: string;\n companyId?: string;\n}\n\nexport interface LoginResponse {\n success: boolean;\n tenants?: Tenant[];\n redirectUrl?: string;\n error?: string;\n}\n","const reverseRpcTopicMapping: Record = {\n \"info.get\": \"get_server_info\",\n \"license.get\": \"get_license_details\",\n \"sticky.get_scale\": \"get_sticky_scale\",\n \"timer.list\": \"get_events\",\n \"timer.delete\": \"delete_event\",\n \"timer.update\": \"timer.update_event\",\n \"timer.create\": \"timer.create_event\",\n \"sticky.list\": \"get_stickies\",\n \"iteration.list\": \"get_iterations\",\n \"objective.list\": \"get_objectives\",\n \"sticky.create\": \"new_sticky\",\n \"sticky.mirror\": \"mirror\",\n \"sticky.move\": \"move_to_team\",\n \"sticky.create_on_risk_board\": \"add_sticky_to_risk_board\",\n \"session.get\": \"alm.get_session_info\",\n \"item.get_by_alm_type\": \"item.get_alm_item_type\",\n \"item.get_by_sticky\": \"item.get_alm_item_type_for_sticky\",\n \"session.get_status\": \"session.get_status\",\n \"session.get_iteration_sync_status\": \"session.get_iteration_status\",\n \"session.sync_iteration\": \"session.start_iteration_sync\",\n \"session.sync_program_backlog\": \"session.start_program_backlog_sync\",\n \"project_source.list\": \"get_project_sources\",\n \"flexboard.add\": \"add_board\",\n \"flexboard.update\": \"update_board\",\n \"flexboard.delete\": \"delete_board\",\n \"background.list\": \"get_flexboard_backgrounds\",\n \"board_type.list\": \"get_flexboard_types\",\n \"category.list\": \"get_categories\",\n \"category.add\": \"add_category\",\n \"category.delete\": \"remove_category\",\n \"category.update\": \"update_category\",\n \"flexboard.add_to_category\": \"add_board_to_category\",\n \"flexboard.remove_from_category\": \"remove_board_from_category\",\n \"session.list\": \"get_sessions\",\n \"settings.get\": \"get_settings\",\n \"team.list\": \"get_teams\",\n \"art.list\": \"get_arts\",\n \"link.list\": \"get_links\",\n \"link_type.list\": \"get_link_types\",\n \"board.list\": \"get_boards\",\n \"sticky_type.list\": \"get_sticky_types\",\n \"link.create\": \"add_link\",\n \"objective_link.create\": \"add_objective_link\",\n \"link.delete\": \"remove_link\",\n \"objective_link.delete\": \"remove_objective_link\",\n \"sticky.search\": \"search_stickies\",\n \"sticky.get_group_board_ids\": \"get_board_ids_of_grouped_stickies\",\n \"sticky.changes\": \"get_sticky_changes\",\n \"shape.add\": \"add_shape\",\n \"shape.edit\": \"edit_shape\",\n \"shape.remove\": \"remove_shape\",\n \"flexboard.duplicate\": \"duplicate_flexboard\",\n \"status.get_random_data\": \"get_random_data\",\n};\n\n/**\n * A decorator that translates the given path to a new path using the reverseRpcTopicMapping object.\n * The decorator checks if the provided path exists in reverseRpcTopicMapping, and if it does,\n * it uses the new path as the first argument when calling the original method.\n * If the path is not found in reverseRpcTopicMapping, an error is thrown.\n *\n * @example\n * \\@translateRPCPathDecorator\n * someMethod(path, arg1, arg2) {\n * // ...implementation\n * }\n */\nexport function translateRPCPath(target: unknown, key: string, descriptor: PropertyDescriptor) {\n const originalMethod = descriptor.value;\n\n descriptor.value = function (path: string, ...restArgs: unknown[]) {\n if (!(path in reverseRpcTopicMapping)) {\n throw new Error(`We did not map ${path} to WAMP topic`);\n }\n const newPath = reverseRpcTopicMapping[path];\n return originalMethod.apply(this, [newPath, ...restArgs]);\n };\n\n return descriptor;\n}\n","import { natsRequestTimeout, natsTabInactiveRequestTimeout } from \"@/model/Settings\";\nimport { useClientStore } from \"@/store/client\";\nimport { isBrowserTabActive } from \"@/utils/dom/dom\";\n\nexport interface CallContext extends Record {\n path: string;\n args: unknown[];\n kwargs?: object;\n correlationId: string;\n tabActiveBefore: boolean;\n requestTimeout: number;\n issuedAt: string;\n retry?: number;\n}\n\nexport function createCallContext(\n path: string,\n args: unknown[],\n kwargs?: object,\n timeout?: number,\n retry?: number,\n): CallContext {\n return {\n path,\n args,\n kwargs,\n correlationId: useClientStore().newCorrelationId(),\n tabActiveBefore: isBrowserTabActive(),\n requestTimeout:\n timeout || (isBrowserTabActive() ? natsRequestTimeout : natsTabInactiveRequestTimeout),\n issuedAt: new Date().toISOString(),\n retry,\n };\n}\n\nexport function createCallHeaders(context: CallContext) {\n return {\n \"correlation-id\": context.correlationId,\n client_version: \"20220428r0\",\n issued_at: context.issuedAt,\n };\n}\n","import { BackendError } from \"./BackendError\";\nimport { NoSuccessError } from \"./NoSuccessError\";\nimport type { CallContext } from \"./requestHelper\";\n\ntype ServerResponse = SuccessServerResponse | ErrorServerResponse;\n\ninterface SuccessServerResponse {\n success: true;\n response: unknown;\n}\n\ninterface ErrorServerResponse {\n success: false;\n error: { message: string; code?: string; details?: unknown };\n}\n\nfunction hasResponseFormat(response: unknown): response is ServerResponse {\n return typeof response === \"object\" && response !== null && \"success\" in response;\n}\n\nfunction isSuccessResponse(response: unknown): response is SuccessServerResponse {\n return hasResponseFormat(response) && response.success && \"response\" in response;\n}\n\nfunction isErrorResponse(response: unknown): response is ErrorServerResponse {\n return (\n hasResponseFormat(response) &&\n !response.success &&\n \"error\" in response &&\n \"message\" in response.error\n );\n}\n\nexport function handleResponse(response: unknown, context: CallContext, methodName: string) {\n if (isSuccessResponse(response)) {\n return response.response;\n }\n if (isErrorResponse(response)) {\n throw new NoSuccessError(response.error.message, methodName, {\n request: context,\n response: response.error,\n });\n }\n throw new BackendError(\n \"Bad Response Format\",\n `Unexpected server response format calling RPC method ${methodName}`,\n { request: context, response: response as Record },\n );\n}\n","import { AxiosError } from \"axios\";\n\nimport { CancelError } from \"@/error/CancelError\";\nimport { createApiClient } from \"@/services/api.config\";\nimport { useStatisticsStore } from \"@/store/statistics\";\nimport { getConfig } from \"@/utils/env/Environment\";\n\nimport { BackendError } from \"./BackendError\";\nimport type { RpcBackend } from \"./RpcBackend\";\nimport { translateRPCPath } from \"./natsTopicMapper\";\nimport { createCallContext, createCallHeaders } from \"./requestHelper\";\nimport { handleResponse } from \"./responseHelper\";\n\nexport class HttpRpcBackend implements RpcBackend {\n private sessionId!: string;\n private apiClient = createApiClient(getConfig().piserverAPIUrl);\n\n init(sessionId: string) {\n this.sessionId = sessionId;\n }\n\n async doCall(\n path: string,\n args: unknown[] = [],\n kwargs?: object,\n timeout?: number,\n ): Promise {\n const context = createCallContext(path, args, kwargs, timeout, 0);\n try {\n const res = await this.apiClient.get(`ch/rentouch/${path}/${args.join(\"/\")}`, {\n params: kwargs,\n headers: createCallHeaders(context),\n timeout: context.requestTimeout,\n });\n useStatisticsStore().current.calls.addOk();\n return handleResponse(res.data, context, path) as T;\n // FIXME: Simply casting the response is not a good idea because we are\n // basically removing all advantages of Typescript on the calling\n // functions.\n //\n // To conform to the signature of BackendSession we are still casting here,\n // but this should be changed to a parsing strategy where the format is\n // validated before being converted.\n } catch (err) {\n useStatisticsStore().current.calls.addFail(err);\n if (err instanceof CancelError) {\n throw err;\n }\n if (err instanceof AxiosError) {\n if (err.code === AxiosError.ERR_BAD_RESPONSE && err.response?.data) {\n return handleResponse(err.response.data, context, path) as T;\n }\n }\n const message = (err as any).message || err;\n throw new BackendError(message, `HTTP Error while calling RPC method ${path}`, {\n request: context,\n response: { message },\n });\n }\n }\n\n @translateRPCPath\n async sessionCall(path: string, args: unknown[] = [], kwargs?: Record) {\n const fullPath = `piplanning/6/room/session/${path}`;\n return await this.doCall(fullPath, [this.sessionId, ...args], kwargs);\n }\n\n @translateRPCPath\n async staticSessionCall(path: string, args: unknown[] = [], kwargs?: Record) {\n const fullPath = `piplanning/6/room/session/${path}`;\n return await this.doCall(fullPath, args, kwargs);\n }\n\n @translateRPCPath\n async boardCall(path: string, args: unknown[], kwargs?: Record) {\n const fullPath = `piplanning/6/room/board/${path}`;\n return await this.doCall(fullPath, args, kwargs);\n }\n\n @translateRPCPath\n async flexBoardCall(path: string, args: unknown[] = [], kwargs?: Record) {\n const fullPath = `piplanning/6/room/session/${path}`;\n return await this.doCall(fullPath, args, kwargs);\n }\n\n @translateRPCPath\n async roomCall(path: string, args: unknown[] = []) {\n return await this.doCall(`piplanning/6/room/${path}`, args);\n }\n\n @translateRPCPath\n async adminCall(path: string, args: unknown[] = []) {\n return await this.doCall(`piplanning/6/room/${path}`, args);\n }\n\n @translateRPCPath\n async almCall(path: string, args: unknown[] = []) {\n return await this.doCall(`piplanning/6/room/${path}`, args);\n }\n\n @translateRPCPath\n almToolCall(_path: string, _args: unknown[], _timeout?: number): Promise {\n throw new Error(\"unsupported http call to almsync\");\n }\n\n @translateRPCPath\n async companyCall(path: string, args: unknown[] = []) {\n return await this.doCall(`piplanning/3/room/company/${path}`, args);\n }\n\n @translateRPCPath\n async serverCall(path: string) {\n return await this.doCall(`piplanning/6/room/server/${path}`);\n }\n\n @translateRPCPath\n async statusCall(path: string, args: unknown[] = []) {\n return await this.doCall(`piplanning/6/room/status/${path}`, args);\n }\n\n userCall(_path: string): Promise {\n throw new Error(\"unsupported http call to almsync\");\n }\n}\n","import { noop } from \"lodash-es\";\n\nimport type CardFlag from \"@/model/CardFlag\";\nimport type { ArtId, BoardType, StatusClass } from \"@/model/baseTypes\";\nimport type { Board } from \"@/model/board\";\nimport type { Reaction } from \"@/model/card\";\nimport type { Iteration, SessionAlmStatus, Team } from \"@/model/session\";\nimport type { Shape } from \"@/model/shape\";\nimport type { StickyType } from \"@/model/stickyType\";\nimport type { TimerData } from \"@/model/timer\";\nimport type { EventFilter } from \"@/store/activity\";\nimport { asyncNoop } from \"@/utils/general\";\n\nimport type { EventInfo } from \"./EventInfo\";\nimport type {\n ServerAlmItemType,\n ServerAlmItemTypeMap,\n ServerAlmSource,\n ServerAlmStickyTypeData,\n ServerAlmType,\n ServerArt,\n ServerBacklogSyncState,\n ServerBoard,\n ServerBoardEventsResponse,\n ServerBoardIteration,\n ServerCategory,\n ServerCompanySettings,\n ServerEvent,\n ServerFlexBackground,\n ServerFlexBoard,\n ServerFlexType,\n ServerInfo,\n ServerIteration,\n ServerIterationSyncState,\n ServerLicense,\n ServerLink,\n ServerLinkType,\n ServerMirrorResponse,\n ServerObjective,\n ServerObjectives,\n ServerSearchResult,\n ServerSession,\n ServerSettings,\n ServerStatusWithData,\n ServerStickiesUpdate,\n ServerSticky,\n ServerStickyChange,\n ServerStickyGroupBoardIds,\n ServerStickyType,\n ServerTeam,\n} from \"./serverModel\";\n\nexport type SubscriptionLevel = \"room\" | \"session\" | \"board\";\n\nexport interface SearchStickiesQuery {\n text?: string;\n teams?: Team[];\n types?: StickyType[];\n flags?: CardFlag[];\n statusClasses?: StatusClass[];\n boards?: Board[];\n iterations?: Iteration[];\n}\n\nexport interface Subscription {\n drain(): Promise;\n\n unsubscribe(): void;\n\n getID(): string | number;\n\n getSubject(): string;\n}\n\nexport function createDummySubscription(path: string) {\n return {\n drain: asyncNoop,\n unsubscribe: noop,\n getSubject: () => path,\n getID: () => \"\",\n };\n}\n\nexport type SubscriptionHandler = (\n args: TArgs,\n kwargs: TKwargs,\n event: EventInfo,\n) => void;\n\nexport interface BackendSession {\n unsubscribe(level: SubscriptionLevel, connectionOpen?: boolean): Promise;\n\n setSessionId(id: string): Promise;\n\n almSource(\n boardType: ServerBoard[\"board_type\"],\n { teamId, artId }: { teamId?: ServerBoard[\"user_id\"]; artId: ServerBoard[\"art_id\"] },\n ): ServerAlmSource | undefined;\n\n subscriptionCount(): number;\n\n getAlmType(): ServerAlmType;\n\n getAlmConnectionId(): string | undefined;\n\n getLicense(): Promise;\n\n getServerInfo(useHttp?: boolean): Promise;\n\n getStatusWithData(sizeMB: number, useHttp?: boolean): Promise;\n\n getSessions(): Promise;\n\n getAlmStatus(): Promise;\n\n hasMappedAlmUser(id?: string): Promise;\n\n getSettings(): Promise;\n\n getCompanySettings(): Promise;\n\n getTeams(sessionId?: string): Promise;\n\n getArts(sessionId?: string): Promise;\n\n getIterations(sessionId: string): Promise;\n\n getLinks(): Promise;\n\n getLinkTypes(): Promise;\n\n getBoards(sessionId?: string): Promise>;\n\n addBoard(type: string, name: string): Promise;\n\n updateBoard(id: string, name: string): Promise;\n\n deleteBoard(id: string): Promise;\n\n almSubscribe(\n path: string,\n handler: SubscriptionHandler,\n ): Promise | Subscription;\n\n roomSubscribe(\n path: string,\n handler: SubscriptionHandler,\n ): Promise | Subscription;\n\n getScale(boardId: string): Promise;\n\n getBoardStickies(boardId: string, since?: number): Promise;\n\n getStickies(stickyIds: string[]): Promise;\n\n getBoardIterations(boardId: string): Promise;\n\n getStickyTypes(): Promise;\n\n getAlmItemType(\n almType: string,\n boardType: BoardType,\n boardKeys: string[],\n ): Promise;\n\n getAlmItemTypeForSticky(stickyAlmId: string): Promise;\n\n getObjectives(boardId: string): Promise;\n\n newSticky(boardId: string, props: Partial): Promise;\n\n mirror(\n cardId: string,\n toBoardId: string,\n props?: Partial,\n ): Promise;\n\n move(cardId: string, teamId: string): void;\n\n toRisk(cardId: string, boardId: string, text: string, typeId: string, teamId: string): void;\n\n addLink(cardId: string, toId: string): Promise;\n\n addObjectiveLink(\n cardId: ServerSticky[\"_id\"],\n boardId: ServerBoard[\"board_id\"],\n objectiveId: ServerObjective[\"objective_id\"],\n ): Promise;\n\n deleteLink(id: string): Promise;\n\n deleteObjectiveLink(\n cardId: ServerSticky[\"_id\"],\n boardId: ServerBoard[\"board_id\"],\n objectiveId: ServerObjective[\"objective_id\"],\n ): Promise;\n\n syncIteration(teamId: string, iterationId: number): Promise;\n\n syncBacklog(artId?: ArtId): Promise;\n\n sessionSubscribe(\n path: string,\n handler: SubscriptionHandler,\n ): Promise | Subscription;\n\n boardSubscribe(\n boardId: string,\n path: string,\n level: SubscriptionLevel,\n handler: SubscriptionHandler,\n ): Promise | Subscription;\n\n boardPublish(boardId: string, path: string, value: unknown): void;\n\n getFlexBackgrounds(): Promise;\n\n getFlexTypes(sessionId?: string): Promise;\n\n getCategories(): Promise;\n\n addCategory(name: string): Promise;\n\n deleteCategory(id: string): Promise;\n\n updateCategory(id: string, update: { name?: string; position?: number }): Promise;\n\n addBoardToCategory(boardId: string, categoryId: string): Promise;\n\n removeBoardFromCategory(boardId: string, categoryId: string): Promise;\n\n searchStickies(query: SearchStickiesQuery): Promise;\n\n getEvents(): Promise;\n\n createTimerEvent(\n data: Partial,\n target: { boardId?: string; artId?: string },\n ): Promise;\n\n updateTimerEvent(id: string, data: Partial): Promise;\n\n deleteEvent(id: string): Promise;\n\n addReaction(cardId: string, reaction: Reaction): Promise;\n\n removeReaction(cardId: string, reaction: Reaction): Promise;\n\n addShape(boardId: string, shape: Shape): Promise;\n\n editShape(boardId: string, shape: Shape): Promise;\n\n removeShape(boardId: string, shapeId: string): Promise;\n\n getAlmStickyTypes(): Promise;\n\n getBoardIdsOfGroupedStickies(id: string): Promise;\n\n getStickyChanges(id: string): Promise;\n\n duplicateFlex(boardId: string, sessionId: string): Promise;\n\n getBoardDiff(\n id: string,\n from: Date,\n to: Date,\n filters?: EventFilter[],\n changeTypes?: string[],\n ): Promise;\n\n getBoardEventLog(\n id: string,\n from: Date,\n to: Date,\n filters?: EventFilter[],\n changeTypes?: string[],\n ): Promise;\n}\n","import type {\n NormalizedServerAlmItemType,\n NormalizedServerAlmItemTypeMap,\n ServerAlmItemTransition,\n ServerAlmItemType,\n ServerAlmItemTypeMap,\n TransitionHash,\n} from \"./serverModel\";\n\nexport function denormalizedServerAlmItemTypeMap(\n normalizedServerAlmItemTypeMap: NormalizedServerAlmItemTypeMap,\n): ServerAlmItemTypeMap {\n const { transitions, alm_item_types_by_board_key } = normalizedServerAlmItemTypeMap;\n\n const denormalizeNormalizedServerAlmItemTypeEntry = ([source_id, alm_item_type_response]: [\n string,\n NormalizedServerAlmItemType,\n ]): [string, ServerAlmItemType] => {\n return [\n source_id,\n {\n ...alm_item_type_response,\n transitions: alm_item_type_response.transitions.map(\n (transition_hash: TransitionHash) => transitions[transition_hash],\n ),\n },\n ];\n };\n\n return Object.fromEntries(\n Object.entries(alm_item_types_by_board_key).map(([board_key, alm_item_types_by_source]) => {\n return [\n board_key,\n Object.fromEntries(\n Object.entries(alm_item_types_by_source).map(denormalizeNormalizedServerAlmItemTypeEntry),\n ),\n ];\n }),\n );\n}\n","import type { AlmSourceId, BoardType, Color, RiskType, StatusClass } from \"@/model/baseTypes\";\nimport type { Reaction } from \"@/model/card\";\nimport type { Line, RelativeCoordinate } from \"@/model/coordinates\";\nimport type { LicenseType } from \"@/model/session\";\nimport type { ShapeType } from \"@/model/shape\";\nimport type { Functionality } from \"@/model/stickyType\";\nimport type { ServerTime, TimerState } from \"@/model/timer\";\n\nexport interface ServerIteration {\n id: number;\n name: string;\n start: number;\n end: number;\n order: number;\n}\n\nexport interface ServerLink {\n id: string;\n from_sticky_id: string;\n to_sticky_id: string;\n link_type_id?: string;\n}\n\nexport interface ServerLinkType {\n _id: string;\n from_sticky_type: string;\n to_sticky_type: string;\n}\n\nexport interface ServerBoardIteration {\n board_iteration_id: number;\n velocity: string | number;\n}\n\nexport interface ServerBoard {\n board_id: string;\n board_type: Exclude;\n team_name: string;\n user_id: number | null;\n art_id?: number;\n shapes?: ServerShape[];\n}\n\nexport interface ServerFlexBoard {\n board_id: string;\n board_type: \"flex\";\n name: string;\n flexboard_type: string;\n shapes?: ServerShape[];\n}\n\ninterface ServerShape extends Line {\n id: string;\n type: ShapeType;\n fixed: boolean;\n}\n\nexport interface ServerStickyType {\n step_estimate?: boolean;\n step_estimate_values?: Array<{ value: number; text: string }>;\n id: string;\n name: string;\n alm_type: string | null;\n color: Color;\n alt_color?: Color;\n index?: number;\n functionality: Functionality;\n origin_board_type: BoardType;\n origin_flexboard_type?: string;\n available_board_types: BoardType[];\n available_flexboard_types?: string[];\n}\n\n/* eslint-disable @typescript-eslint/consistent-indexed-object-style */\nexport interface ServerAlmItemTypeMap {\n [mappingId: string]: { [sourceId: string]: ServerAlmItemType };\n}\n\nexport type TransitionHash = string;\n\nexport interface NormalizedServerAlmItemTypeMap {\n transitions: Record;\n alm_item_types_by_board_key: {\n [mappingId: string]: { [sourceId: string]: NormalizedServerAlmItemType };\n };\n}\n\n/* eslint-enable */\n\nexport function isNormalizedServerAlmItemTypeMap(\n obj: ServerAlmItemTypeMap | NormalizedServerAlmItemTypeMap,\n): obj is NormalizedServerAlmItemTypeMap {\n return \"transitions\" in obj;\n}\n\nexport interface ServerAlmItemType {\n id: string;\n statuses: ServerAlmItemStatus[];\n transitions: ServerAlmItemTransition[];\n dynamic: boolean;\n}\n\nexport interface NormalizedServerAlmItemType {\n id: string;\n statuses: ServerAlmItemStatus[];\n transitions: TransitionHash[];\n dynamic: boolean;\n}\n\nexport interface ServerAlmItemStatus {\n id: string;\n name: string;\n category: StatusClass;\n order: number;\n}\n\nexport interface ServerAlmItemTransition {\n id: string;\n name: string;\n // initial: when a sticky is created, from_statuses is ignored\n // global: can be used from every status, from_statuses is ignored\n // normal: can be used when status is in from_statuses\n type: \"initial\" | \"global\" | \"normal\";\n from_statuses: string[];\n to_status: string;\n fields: ServerAlmItemTransitionField[];\n}\n\nexport interface ServerAlmItemTransitionField {\n id: string;\n name: string;\n required: boolean;\n type: string;\n item_type?: string;\n values?: ServerAlmItemTransitionFieldValue[];\n}\n\ninterface ServerAlmItemTransitionFieldValue {\n id: string;\n name: string;\n}\n\nexport interface ServerObjectives {\n objectives: ServerObjective[];\n stretches: ServerObjective[];\n}\n\ninterface ServerLinkedSticky {\n id: string;\n is_origin: boolean;\n}\n\nexport interface ServerObjective {\n text: string;\n description: string;\n bv: number;\n av: number | null;\n objective_id: string;\n stickies: ServerLinkedSticky[] | undefined;\n}\n\ninterface ServerLinkedObjective {\n id: ServerObjective[\"objective_id\"];\n board_id: ServerBoard[\"board_id\"];\n}\n\nexport interface ServerSticky {\n _id: string;\n sticky_group?: string;\n board_id: string;\n type_id: string;\n alm_issue_id?: string | number;\n alm_issue_url?: string;\n alm_source?: AlmSourceId | null;\n text: string;\n story_points?: number;\n WSJF_value?: number;\n step_value?: number;\n team_id?: number | null;\n precond_team?: string;\n precond_team_id?: number | null;\n depend_team?: string;\n depend_team_id?: number | null;\n iteration_number: number | null;\n a_center: [number, number];\n stack_pos: number;\n flag_type?: string | null;\n risk?: RiskType;\n // if sticky is workitem\n status?: string;\n // for dynamic status\n status_class?: StatusClass;\n transition?: string;\n objectives?: ServerLinkedObjective[];\n reactions?: { [reaction in Reaction]?: string[] };\n art_id?: string | null;\n assignee?: ServerUser;\n reporter?: ServerUser;\n}\n\nexport interface ServerUser {\n pip_id: string | null;\n alm_id: string | null;\n}\n\nexport interface ServerStickiesUpdateCacheHit {\n timestamp: number;\n updates: ServerStickyUpdate[];\n}\n\nexport interface ServerStickiesUpdateCacheMiss {\n timestamp: number;\n stickies: ServerSticky[];\n}\n\nexport type ServerStickiesUpdate = ServerStickiesUpdateCacheHit | ServerStickiesUpdateCacheMiss;\n\ninterface ServerStickyUpdate {\n event: \"alter_sticky\" | \"delete_sticky\";\n obj: ServerSticky;\n}\n\nexport interface ServerSettings {\n backlog_forbid_JIRA_sticky_delete?: boolean;\n backlog_forbid_WSJF_edit?: boolean;\n confirm_sticky_delete?: boolean;\n hide_program_backlog?: boolean;\n team_forbid_sticky_delete?: boolean;\n team_move_unmapped_to_backlog?: boolean;\n backlog_mirror_assigned_stickies_to_team_board?: boolean;\n move_activated?: boolean;\n iteration_load_warn?: number | null;\n iteration_load_critical?: number | null;\n}\n\nexport interface ServerCompanySettings {\n auto_logout_after?: number; // in minutes\n}\n\nexport interface ServerAlmInfo {\n alm_connection_type?: ServerAlmType;\n sync_session_id?: string;\n alm_connection_id?: string;\n}\n\nexport interface ServerAlmSource {\n user_id?: number;\n sources: Array<{ name: string; id: AlmSourceId }>;\n art_id?: number;\n type: \"team\" | \"art\";\n}\n\nexport interface ServerTeam {\n name: string;\n user_id: number;\n art_id?: number;\n}\n\nexport interface ServerUserTeam {\n id: number;\n name: string;\n art_id?: number;\n}\n\nexport interface ServerArt {\n id: number;\n name: string;\n}\n\nexport interface ServerSession {\n session_id: string;\n name: string;\n creation_date: number;\n archived: boolean;\n planning_dates: { start?: number; end?: number } | null | undefined;\n}\n\nexport interface ServerInfo {\n major_API_version: number;\n minor_API_version: number;\n time: number;\n}\n\nexport interface ServerStatusWithData {\n timestamp_in: number;\n timestamp_out: number;\n data: string;\n}\n\nexport interface ServerLicense {\n expiryDate: number;\n plan: \"standard\" | \"premium\" | \"enterprise\";\n type: LicenseType;\n tracking: boolean;\n onprem: boolean;\n}\n\nexport type ServerAlmType = \"jira\" | \"ac\" | \"ado\" | undefined;\n\nexport interface ServerIterationSubsState {\n team_id: number;\n status: ServerSyncStatus;\n pi_iteration_id: number;\n error: string;\n}\n\nexport interface ServerIterationSyncState {\n success: boolean;\n status: ServerSyncStatus;\n error: string;\n}\n\nexport type ServerSyncStatus = \"syncing\" | \"synced\";\n\ninterface SuccessServerBacklogSyncState {\n success: true;\n status: ServerSyncStatus;\n}\n\ninterface FailedServerBacklogSyncState {\n success: false;\n status?: \"synced\";\n error: string;\n error_short: string;\n}\n\nexport type ServerBacklogSyncState = SuccessServerBacklogSyncState | FailedServerBacklogSyncState;\n\nexport interface ServerFlexType {\n id: string;\n name: string;\n background: string;\n}\n\nexport interface ServerFlexBackground {\n id: string;\n name: string;\n info_link: string;\n}\n\nexport interface ServerCategory {\n _id: string;\n name: string;\n board_ids: string[];\n}\n\nexport interface ServerAuthUser {\n id: string;\n name: string;\n email: string;\n image_url?: string;\n color?: string;\n preferred_language: string;\n hash?: string;\n}\n\nexport interface ServerSearchResult {\n board_id: string;\n id: string;\n text: string;\n alm_issue_id?: string;\n flag_type?: string | null;\n team_id?: number;\n art_id?: string;\n type_id: string;\n sticky_group?: string;\n alm_source_id?: AlmSourceId;\n status?: string;\n status_class?: StatusClass;\n iteration_number?: number;\n depend_team_id?: number;\n precond_team_id?: number;\n story_points?: number;\n}\n\nexport interface ServerEvent {\n id: string;\n session_id: string;\n board_id?: string;\n art_id?: string;\n type: string;\n created_by: string;\n created_at: number;\n updated_by: string;\n updated_at: number;\n data: ServerTimerEvent;\n}\n\ninterface ServerTimerEvent {\n name: string;\n state: TimerState;\n duration: number;\n end: ServerTime;\n}\n\nexport interface ServerMirrorResponse {\n mirrored_id: string;\n created: boolean;\n}\n\nexport interface UserResponse {\n success: boolean;\n company: string;\n user_id: string;\n role: string;\n}\n\nexport interface ServerAlmStickyTypeData {\n id: string;\n is_mapped: boolean;\n}\n\nexport interface ServerStickyGroupBoardIds {\n board_ids: string[];\n}\n\ninterface ServerStickyChangeBase {\n sticky_id: string;\n timestamp: number;\n user_id: string;\n}\n\ninterface ServerStickyChangeCreate extends ServerStickyChangeBase {\n kind: \"create\";\n}\n\nexport interface ServerStickyChangeDelete extends ServerStickyChangeBase {\n kind: \"delete\";\n changes: ServerFieldChange[];\n}\n\nexport interface ServerStickyChangeUpdate extends ServerStickyChangeBase {\n kind: \"update\";\n changes: ServerFieldChange[];\n}\n\nexport interface ServerStickyChangeMirror extends ServerStickyChangeBase {\n kind: \"mirror\" | \"unmirror\";\n from_board: string;\n to_board: string;\n}\n\nexport interface ServerStickyChangeLink extends ServerStickyChangeBase {\n kind: \"link\" | \"unlink\";\n linked_to: string; // ID of the (un)linked sticky\n}\n\nexport type ServerStickyChange =\n | ServerStickyChangeCreate\n | ServerStickyChangeDelete\n | ServerStickyChangeUpdate\n | ServerStickyChangeLink\n | ServerStickyChangeMirror;\n\nexport interface ServerFieldChange {\n key: keyof ServerSticky;\n old?: T;\n new?: T;\n}\n\nexport type ServerReactionField = Record | undefined;\n\nexport interface ServerBoardEventsResponse {\n results: ServerStickyChange[];\n limit: number;\n total: number;\n offset: null;\n}\n","import { isString } from \"lodash-es\";\nimport { ErrorCode, NatsError } from \"nats.ws\";\n\nimport { captureException } from \"@/error/sentry\";\nimport { backlogSyncTimeout, iterationSyncTimeout } from \"@/model/Settings\";\nimport type { ArtId, BoardType } from \"@/model/baseTypes\";\nimport type { Reaction } from \"@/model/card\";\nimport type { SessionAlmStatus } from \"@/model/session\";\nimport type { Shape } from \"@/model/shape\";\nimport type { TimerData } from \"@/model/timer\";\nimport type { EventFilter } from \"@/store/activity\";\nimport { useArtStore } from \"@/store/art\";\nimport { useClientStore } from \"@/store/client\";\n\nimport type { SearchStickiesQuery, Subscription, SubscriptionLevel } from \"./BackendSession\";\nimport { denormalizedServerAlmItemTypeMap } from \"./BaseBackendSession.utils\";\nimport type { RpcBackend } from \"./RpcBackend\";\nimport type {\n NormalizedServerAlmItemTypeMap,\n ServerAlmInfo,\n ServerAlmItemType,\n ServerAlmItemTypeMap,\n ServerAlmSource,\n ServerAlmStickyTypeData,\n ServerAlmType,\n ServerArt,\n ServerBacklogSyncState,\n ServerBoard,\n ServerBoardEventsResponse,\n ServerBoardIteration,\n ServerCategory,\n ServerCompanySettings,\n ServerEvent,\n ServerFlexBackground,\n ServerFlexBoard,\n ServerFlexType,\n ServerInfo,\n ServerIteration,\n ServerIterationSyncState,\n ServerLicense,\n ServerLink,\n ServerLinkType,\n ServerMirrorResponse,\n ServerObjectives,\n ServerSearchResult,\n ServerSession,\n ServerSettings,\n ServerStatusWithData,\n ServerStickiesUpdate,\n ServerSticky,\n ServerStickyChange,\n ServerStickyGroupBoardIds,\n ServerStickyType,\n ServerSyncStatus,\n ServerTeam,\n} from \"./serverModel\";\nimport { isNormalizedServerAlmItemTypeMap } from \"./serverModel\";\n\nexport class BaseBackendSession {\n private almSources?: ServerAlmSource[];\n protected almType: ServerAlmType;\n protected almSyncId?: string;\n private almConnectionId?: string;\n protected subscriptions: { [level in SubscriptionLevel]: Subscription[] } = {\n room: [],\n session: [],\n board: [],\n };\n protected sessionId = \"\";\n\n constructor(\n protected company: string,\n protected rpcBackend: RpcBackend,\n ) {}\n\n almSource(\n boardType: ServerBoard[\"board_type\"],\n { teamId, artId }: { teamId?: ServerBoard[\"user_id\"]; artId: ServerBoard[\"art_id\"] },\n ): ServerAlmSource | undefined {\n if (boardType === \"team\") {\n return this.almSources?.find((s) => s.type === \"team\" && s.user_id === teamId);\n }\n if (boardType === \"backlog\" && useArtStore().isMultiArt) {\n return this.almSources?.find((source) => source.type === \"art\" && source.art_id === artId);\n }\n }\n\n subscriptionCount() {\n return Object.values(this.subscriptions).reduce(\n (count, subscriptions) => count + subscriptions.length,\n 0,\n );\n }\n\n getAlmType() {\n return this.almType;\n }\n\n getAlmConnectionId(): string | undefined {\n return this.almConnectionId;\n }\n\n async setSessionId(id: string): Promise {\n this.sessionId = id;\n const info = await this.getAlmSessionInfo();\n this.almType = info.alm_connection_type;\n this.rpcBackend.init(this.sessionId, this.almType);\n this.almSyncId = info.sync_session_id;\n this.almConnectionId = info.alm_connection_id;\n this.almSources = [];\n if (!this.almType) {\n return false;\n }\n this.almSources = await this.getAlmSources();\n return true;\n }\n\n async unsubscribe(level: SubscriptionLevel, connectionOpen = true) {\n const promises = new Array>();\n switch (level) {\n case \"room\":\n promises.push(...this.doUnsubscribe(\"room\", connectionOpen));\n // fall through\n case \"session\":\n promises.push(...this.doUnsubscribe(\"session\", connectionOpen));\n // fall through\n case \"board\":\n promises.push(...this.doUnsubscribe(\"board\", connectionOpen));\n }\n await Promise.all(promises);\n }\n\n doUnsubscribe(level: SubscriptionLevel, connectionOpen: boolean): Array> {\n const subscriptions = this.subscriptions[level];\n this.subscriptions[level] = [];\n if (!connectionOpen) {\n return [];\n }\n return subscriptions.map(async (subscription) => {\n try {\n return await this.drainAndUnsubscribe(subscription);\n } catch (error) {\n if (error instanceof NatsError) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison\n if (error.code === ErrorCode.Disconnect) {\n return;\n }\n }\n void captureException(error, {\n subscription: {\n id: subscription.getID(),\n subject: subscription.getSubject(),\n },\n });\n }\n });\n }\n\n drainAndUnsubscribe(subscription: Subscription) {\n return subscription.drain().finally(() => subscription.unsubscribe());\n }\n\n getLicense(): Promise {\n return this.rpcBackend.userCall(\"license.get\");\n }\n\n getSessions(): Promise {\n return this.rpcBackend.roomCall(\"session.list\", []);\n }\n\n getAlmSessionInfo(): Promise {\n return this.rpcBackend.almCall(\"session.get\", [this.sessionId]);\n }\n\n getAlmStatus(): Promise {\n return this.rpcBackend.almToolCall(\"session.get_status\", [this.almSyncId]);\n }\n\n async hasMappedAlmUser(id?: string): Promise {\n return this.rpcBackend.almToolCall(\"alm_user.is_mapped\", [this.almConnectionId, id]);\n }\n\n getAlmSources(): Promise {\n return this.rpcBackend.almToolCall(`project_source.list`, [this.almConnectionId]);\n }\n\n getSettings(): Promise {\n return this.rpcBackend.sessionCall(\"settings.get\");\n }\n\n getCompanySettings(): Promise {\n return this.rpcBackend.companyCall(\"settings.list\");\n }\n\n getTeams(sessionId?: string): Promise {\n return this.rpcBackend.staticSessionCall(\"team.list\", [sessionId || this.sessionId]);\n }\n\n getArts(sessionId?: string): Promise {\n return this.rpcBackend.staticSessionCall(\"art.list\", [\n sessionId || this.sessionId,\n ]);\n }\n\n getIterations(sessionId: string): Promise {\n return this.rpcBackend.roomCall(\"iteration.list\", [sessionId]);\n }\n\n getLinks(): Promise {\n return this.rpcBackend.sessionCall(\"link.list\");\n }\n\n getLinkTypes(): Promise {\n return this.rpcBackend.sessionCall(\"link_type.list\");\n }\n\n async getBoards(sessionId?: string) {\n return this.rpcBackend.roomCall>(\"board.list\", [\n sessionId || this.sessionId,\n ]);\n }\n\n addBoard(type: string, name: string): Promise {\n return this.rpcBackend.flexBoardCall(\"flexboard.add\", [this.sessionId], {\n board_type: \"flex\",\n flexboard_type: type,\n name,\n });\n }\n\n updateBoard(id: string, name: string): Promise {\n return this.rpcBackend.flexBoardCall(\"flexboard.update\", [id], { name });\n }\n\n deleteBoard(id: string): Promise {\n return this.rpcBackend.flexBoardCall(\"flexboard.delete\", [id]);\n }\n\n getScale(boardId: string): Promise {\n return this.rpcBackend.boardCall(\"sticky.get_scale\", [boardId]);\n }\n\n getBoardStickies(\n boardId: string,\n since?: number,\n ): Promise {\n return this.rpcBackend.boardCall(\"sticky.list\", [boardId], {\n timestamp: since,\n });\n }\n\n getStickies(stickyIds: string[]): Promise {\n return this.rpcBackend.staticSessionCall(\"sticky.list\", [stickyIds]);\n }\n\n getBoardIterations(boardId: string): Promise {\n return this.rpcBackend.boardCall(\"iteration.list\", [boardId]);\n }\n\n async getStickyTypes(): Promise {\n const ts = await this.rpcBackend.sessionCall(\"sticky_type.list\");\n return ts.sort((a, b) => (a.index || 0) - (b.index || 0));\n }\n\n async getAlmItemType(\n almType: string,\n boardType: BoardType,\n boardKeys: string[],\n ): Promise {\n const response: NormalizedServerAlmItemTypeMap | ServerAlmItemTypeMap =\n await this.rpcBackend.almToolCall(\"item.get_by_alm_type\", [\n this.almSyncId,\n almType,\n boardType,\n boardKeys,\n ]);\n\n return isNormalizedServerAlmItemTypeMap(response)\n ? denormalizedServerAlmItemTypeMap(response)\n : response;\n }\n\n getAlmItemTypeForSticky(stickyAlmId: string): Promise {\n return this.rpcBackend.almToolCall(\"item.get_by_sticky\", [this.almConnectionId, stickyAlmId]);\n }\n\n getObjectives(boardId: string): Promise {\n return this.rpcBackend.boardCall(\"objective.list\", [boardId]);\n }\n\n newSticky(\n boardId: ServerSticky[\"board_id\"],\n props: Partial,\n ): Promise {\n return this.rpcBackend.boardCall(\"sticky.create\", [boardId, null, props], {\n client_id: useClientStore().clientId,\n });\n }\n\n mirror(cardId: string, toBoardId: string, props?: Partial) {\n return this.rpcBackend.boardCall(\"sticky.mirror\", [\n cardId,\n toBoardId,\n props,\n ]);\n }\n\n move(cardId: string, teamId: string) {\n return this.rpcBackend.boardCall(\"sticky.move\", [cardId, +teamId]);\n }\n\n toRisk(cardId: string, boardId: string, text: string, typeId: string, teamId: string) {\n return this.rpcBackend.boardCall(\"sticky.create_on_risk_board\", [\n boardId,\n { id: cardId, text, type_id: typeId, team_id: +teamId },\n ]);\n }\n\n addLink(cardId: string, toId: string): Promise {\n return this.rpcBackend.sessionCall(\"link.create\", [cardId, toId]);\n }\n\n addObjectiveLink(cardId: string, boardId: string, objectiveId: string): Promise {\n return this.rpcBackend.staticSessionCall(\"objective_link.create\", [\n cardId,\n boardId,\n objectiveId,\n ]);\n }\n\n deleteLink(id: string): Promise {\n return this.rpcBackend.staticSessionCall(\"link.delete\", [id]);\n }\n\n deleteObjectiveLink(cardId: string, boardId: string, objectiveId: string): Promise {\n return this.rpcBackend.staticSessionCall(\"objective_link.delete\", [\n cardId,\n boardId,\n objectiveId,\n ]);\n }\n\n syncIteration(teamId: string, iterationId: number): Promise {\n return this.rpcBackend.almToolCall(\n \"session.sync_iteration\",\n [this.almSyncId, teamId, iterationId],\n iterationSyncTimeout,\n );\n }\n\n async syncBacklog(artId?: ArtId): Promise {\n const response = await this.rpcBackend.almToolCall(\n \"session.sync_program_backlog\",\n [this.almSyncId, artId],\n backlogSyncTimeout,\n );\n if (isString(response)) {\n return { success: true, status: response as ServerSyncStatus };\n }\n return response as ServerBacklogSyncState;\n }\n\n getFlexBackgrounds(): Promise {\n return this.rpcBackend.flexBoardCall(\"background.list\", []);\n }\n\n getFlexTypes(sessionId?: string): Promise {\n return this.rpcBackend.flexBoardCall(\"board_type.list\", [sessionId || this.sessionId]);\n }\n\n getCategories(): Promise {\n return this.rpcBackend.flexBoardCall(\"category.list\", [this.sessionId]);\n }\n\n addCategory(name: string): Promise {\n return this.rpcBackend.flexBoardCall(\"category.add\", [this.sessionId, name]);\n }\n\n deleteCategory(id: string): Promise {\n return this.rpcBackend.flexBoardCall(\"category.delete\", [id]);\n }\n\n updateCategory(id: string, update: { name?: string; position?: number }): Promise {\n return this.rpcBackend.flexBoardCall(\"category.update\", [id], update);\n }\n\n addBoardToCategory(boardId: string, categoryId: string): Promise {\n return this.rpcBackend.flexBoardCall(\"flexboard.add_to_category\", [boardId, categoryId]);\n }\n\n removeBoardFromCategory(boardId: string, categoryId: string): Promise {\n return this.rpcBackend.flexBoardCall(\"flexboard.remove_from_category\", [boardId, categoryId]);\n }\n\n searchStickies(query: SearchStickiesQuery): Promise {\n return this.rpcBackend.sessionCall(\"sticky.search\", [\n {\n text: query.text,\n team_id: query.teams?.map(({ id }) => (id ? +id : null)),\n type_id: query.types?.map(({ id }) => id),\n status_classes: query.statusClasses,\n flag_type: query.flags?.map((flag) => (flag.isEmpty() ? null : flag.toString())),\n board_id: query.boards?.map(({ id }) => id),\n },\n ]);\n }\n\n getEvents(): Promise {\n return this.rpcBackend.sessionCall(\"timer.list\");\n }\n\n createTimerEvent(\n data: Partial,\n target: { boardId?: string; artId?: string },\n ): Promise {\n return this.rpcBackend.sessionCall(\"timer.create\", [data], {\n board_id: target.boardId,\n art_id: target.artId,\n });\n }\n\n updateTimerEvent(id: string, data: Partial): Promise {\n return this.rpcBackend.sessionCall(\"timer.update\", [id, data]);\n }\n\n deleteEvent(id: string): Promise {\n return this.rpcBackend.sessionCall(\"timer.delete\", [id]);\n }\n\n getServerInfo(useHttp?: boolean): Promise {\n return this.rpcBackend.serverCall(\"info.get\", [], useHttp ? { useBackend: 1 } : undefined);\n }\n\n getStatusWithData(sizeMB: number, useHttp?: boolean): Promise {\n if (sizeMB < 0 || (useHttp && sizeMB > 2)) {\n throw Error(\"Size must be between 0-2 MB for HTTP request\");\n } else if (!useHttp && sizeMB > 0.5) {\n throw Error(\"Size must be between 0-0.5 MB for WS request\");\n }\n return this.rpcBackend.statusCall(\n \"status.get_random_data\",\n [sizeMB],\n useHttp ? { useBackend: 1 } : undefined,\n );\n }\n\n addReaction(cardId: string, reaction: Reaction): Promise {\n return this.rpcBackend.boardCall(\"reaction.add\", [cardId, reaction]);\n }\n\n removeReaction(cardId: string, reaction: Reaction): Promise {\n return this.rpcBackend.boardCall(\"reaction.remove\", [cardId, reaction]);\n }\n\n addShape(boardId: string, shape: Shape): Promise {\n return this.rpcBackend.boardCall(\"shape.add\", [boardId, shape]);\n }\n\n editShape(boardId: string, shape: Shape): Promise {\n return this.rpcBackend.boardCall(\"shape.edit\", [boardId, shape]);\n }\n\n removeShape(boardId: string, shapeId: string): Promise {\n return this.rpcBackend.boardCall(\"shape.remove\", [boardId, shapeId]);\n }\n\n async getAlmStickyTypes(): Promise {\n return this.almType ? this.rpcBackend.almToolCall(\"alm_type.list\", [this.almSyncId]) : [];\n }\n\n getBoardIdsOfGroupedStickies(stickyId: string) {\n return this.rpcBackend.staticSessionCall(\n \"sticky.get_group_board_ids\",\n [stickyId],\n );\n }\n\n getStickyChanges(id: string) {\n return this.rpcBackend.staticSessionCall(\"sticky.changes\", [id]);\n }\n\n duplicateFlex(boardId: string, sessionId: string) {\n return this.rpcBackend.flexBoardCall(\"flexboard.duplicate\", [boardId, sessionId]);\n }\n\n /**\n * Returns the sum of all changes made to the board's cards between the two dates.\n */\n getBoardDiff(id: string, from: Date, to: Date, filters?: EventFilter[], changeTypes?: string[]) {\n return (\n this.rpcBackend\n .boardCall(\"board.diff\", [], {\n board_id: id,\n from_time: from.getTime(),\n to_time: to.getTime(),\n filters,\n change_types: changeTypes,\n })\n // Handle both the old and new response format (TODO: Remove after backend is updated)\n .then((response) => (Array.isArray(response) ? response : response.results))\n );\n }\n\n /**\n * Returns the list of all changes made to the board's cards between the two dates.\n */\n getBoardEventLog(\n id: string,\n from: Date,\n to: Date,\n filters?: EventFilter[],\n changeTypes?: string[],\n ) {\n return this.rpcBackend.boardCall(\"board.event_log\", [], {\n board_id: id,\n from_time: from.getTime(),\n to_time: to.getTime(),\n filters,\n change_types: changeTypes,\n });\n }\n}\n","export class EventInfo {\n company: string;\n userId: string;\n sessionId: string;\n boardId: string;\n\n constructor(public topic: string) {\n // TODO how to config eslint to accept this??\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const [_app, _module, _version, company, userId, sessionId, boardId, ..._] = topic.split(\".\");\n this.company = company;\n this.userId = userId;\n this.sessionId = sessionId;\n this.boardId = boardId;\n }\n}\n","import type { NatsConnection } from \"nats.ws\";\nimport { ErrorCode, JSONCodec, headers } from \"nats.ws\";\n\nimport { captureException, captureMessage } from \"@/error/sentry\";\nimport { goToLogout } from \"@/router/navigation\";\nimport { useClientStore } from \"@/store/client\";\nimport { useStatisticsStore } from \"@/store/statistics\";\n\nimport { BackendError } from \"./BackendError\";\nimport type { BackendSession, SubscriptionHandler, SubscriptionLevel } from \"./BackendSession\";\nimport { createDummySubscription } from \"./BackendSession\";\nimport { BaseBackendSession } from \"./BaseBackendSession\";\nimport { EventInfo } from \"./EventInfo\";\nimport type { RpcBackend } from \"./RpcBackend\";\n\nexport class NatsBackendSession extends BaseBackendSession implements BackendSession {\n private readonly codec = JSONCodec();\n private readonly userId;\n private loggingOut = false;\n\n constructor(\n private connection: NatsConnection,\n user: { company: string; id: string },\n rpcBackend: RpcBackend,\n ) {\n super(user.company, rpcBackend);\n this.userId = user.id;\n }\n\n doSubscribe(path: string, handler: SubscriptionHandler, level: SubscriptionLevel) {\n try {\n const sub = this.connection.subscribe(path, {\n callback: (error, msg) => {\n if (error) {\n if (!this.loggingOut) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison\n this.loggingOut ||= error.code === ErrorCode.PermissionsViolation;\n void captureException(error, {\n subscriptions: {\n origin: \"subscription\",\n topic: path,\n },\n }).finally(() => {\n if (this.loggingOut) {\n void goToLogout();\n }\n });\n }\n return;\n }\n if (msg.headers?.get?.(\"clientId\") === useClientStore().clientId) {\n // Ignore the messages we sent ourselves\n return;\n }\n useStatisticsStore().current.receives.addOk();\n // TODO casting to TArgs is not safe\n const body = this.codec.decode(msg.data) as {\n args: TArgs;\n string: unknown;\n };\n const { args, ...kwargs } = body;\n const details = new EventInfo(msg.subject);\n handler(args, kwargs, details);\n },\n });\n this.subscriptions[level].push(sub);\n return sub;\n } catch (error) {\n throw new BackendError(\"Subscribe Error\", `Error subscribing ${path}`, {\n request: { path },\n response: error as Record,\n });\n }\n }\n\n doUnsubscribe(level: SubscriptionLevel, connectionOpen: boolean) {\n if (this.connection.isClosed()) {\n return super.doUnsubscribe(level, false);\n }\n return super.doUnsubscribe(level, connectionOpen);\n }\n\n almSubscribe(path: string, handler: SubscriptionHandler) {\n if (this.almSyncId) {\n return this.doSubscribe(this.almTopic(path, { subscribe: true }), handler, \"session\");\n }\n return createDummySubscription(path);\n }\n\n roomSubscribe(path: string, handler: SubscriptionHandler) {\n return this.doSubscribe(this.roomTopic(path, { subscribe: true }), handler, \"room\");\n }\n\n sessionSubscribe(path: string, handler: SubscriptionHandler) {\n return this.doSubscribe(this.sessionTopic(path, { subscribe: true }), handler, \"session\");\n }\n\n boardSubscribe(\n boardId: string,\n path: string,\n level: SubscriptionLevel,\n handler: SubscriptionHandler,\n ) {\n const topic = this.sessionBoardTopic(boardId, path, { subscribe: true });\n return this.doSubscribe(topic, handler, level);\n }\n\n boardPublish(boardId: string, path: string, value: unknown[]) {\n if (!boardId) {\n void captureMessage(\"Publish with empty boardId\", {\n info: { path, boardId },\n });\n return;\n }\n if (this.connection.isClosed()) {\n return;\n }\n try {\n const callHeaders = headers();\n callHeaders.append(\"correlation-id\", useClientStore().newCorrelationId());\n callHeaders.append(\"clientId\", useClientStore().clientId);\n\n const topic = this.sessionBoardTopic(boardId, path, {\n subscribe: false,\n });\n this.connection.publish(topic, this.codec.encode({ args: value }), {\n headers: callHeaders,\n });\n useStatisticsStore().current.publishes.addOk();\n } catch (error) {\n useStatisticsStore().current.publishes.addFail(error);\n throw error;\n }\n }\n\n private basePath(module: string, subscribe = true) {\n return `piplanning.${module}.6.${this.company}.${subscribe ? \"*\" : this.userId}`;\n }\n\n private sessionBoardTopic(boardId: string, path: string, { subscribe = true } = {}) {\n boardId = boardId === \"\" ? \"*\" : boardId;\n const base = this.basePath(\"board\", subscribe);\n\n return `${base}.${this.sessionId}.${boardId}.${path}`;\n }\n\n private roomTopic(path: string, { subscribe = true } = {}) {\n return `${this.basePath(\"session\", subscribe)}.${path}`;\n }\n\n private sessionTopic(path: string, { subscribe = true } = {}) {\n return `${this.basePath(\"session\", subscribe)}.${this.sessionId}.${path}`;\n }\n\n private almTopic(path: string, { subscribe = true } = {}) {\n return `${this.basePath(\"almsession\", subscribe)}.${this.almSyncId}.${path}`;\n }\n}\n","import type { Codec } from \"nats.ws\";\nimport { JSONCodec } from \"nats.ws\";\n\ninterface RPCRequestData {\n args?: unknown[];\n kwargs?: Record;\n}\n\nexport class NatsRPCPayload {\n args: unknown[];\n kwargs: Record;\n codec: Codec = JSONCodec();\n\n constructor({ args = [], kwargs = {} }: RPCRequestData = {}) {\n this.args = args;\n this.kwargs = kwargs;\n }\n\n encode(): Uint8Array {\n const RPCData = this.prepareRPCRequestData();\n if (Object.keys(RPCData).length === 0) {\n return new Uint8Array(0);\n }\n return this.codec.encode(RPCData);\n }\n\n private prepareRPCRequestData(): RPCRequestData {\n const RPCData: RPCRequestData = {};\n if (this.args.length > 0) {\n RPCData.args = this.args;\n }\n if (Object.keys(this.kwargs).length > 0) {\n RPCData.kwargs = this.kwargs;\n }\n return RPCData;\n }\n}\n","import { faro } from \"@grafana/faro-web-sdk\";\nimport type { NatsConnection } from \"nats.ws\";\nimport { JSONCodec, NatsError, headers, nuid } from \"nats.ws\";\n\nimport { CancelError } from \"@/error/CancelError\";\nimport { useConnectionStore } from \"@/store/connection\";\nimport { useStatisticsStore } from \"@/store/statistics\";\n\nimport { BackendError } from \"./BackendError\";\nimport { NatsRPCPayload } from \"./NatsRPCPayload\";\nimport type { RpcBackend } from \"./RpcBackend\";\nimport { TimeoutError } from \"./TimeoutError\";\nimport { createCallContext, createCallHeaders } from \"./requestHelper\";\nimport { handleResponse } from \"./responseHelper\";\nimport type { ServerAlmType } from \"./serverModel\";\n\nexport class NatsRpcBackend implements RpcBackend {\n private readonly codec = JSONCodec();\n private sessionId!: string;\n private almType?: ServerAlmType;\n\n constructor(\n private connection: NatsConnection,\n private company: string,\n private userId: string,\n ) {}\n\n init(sessionId: string, almType?: ServerAlmType) {\n this.sessionId = sessionId;\n this.almType = almType;\n }\n\n async doCall(\n path: string,\n args: unknown[] = [],\n kwargs?: Record,\n timeout?: number,\n retry = 0,\n ): Promise {\n const payload = new NatsRPCPayload({ args, kwargs });\n const context = createCallContext(path, args, kwargs, timeout, retry);\n const reconnects = useConnectionStore().reconnects;\n const callHeaders = headers();\n for (const [key, value] of Object.entries(createCallHeaders(context))) {\n callHeaders.append(key, value);\n }\n const [, methodName] = path.split(`${this.userId}.`);\n try {\n const startTime = performance.now();\n const rawResponse = await this.connection.request(path, payload.encode(), {\n timeout: context.requestTimeout,\n reply: `_INBOX.${this.userId}.${methodName || \"\"}.${nuid.next()}`,\n noMux: true,\n headers: callHeaders,\n });\n const elapsedTime = performance.now() - startTime;\n faro.api?.pushMeasurement({\n type: \"nats_rpc_\" + methodName,\n values: { elapsedTimeMs: elapsedTime },\n });\n useStatisticsStore().current.sends.addOk();\n const response = this.codec.decode(rawResponse.data);\n return handleResponse(response, context, methodName) as T;\n // FIXME: Simply casting the response is not a good idea because we are\n // basically removing all advantages of Typescript on the calling\n // functions.\n //\n // To conform to the signature of BackendSession we are still casting here,\n // but this should be changed to a parsing strategy where the format is\n // validated before being converted.\n } catch (err) {\n useStatisticsStore().current.sends.addFail(err);\n if (err instanceof NatsError) {\n if (err.code === \"TIMEOUT\") {\n if (!useConnectionStore().isConnected) {\n throw new CancelError(\"No Network connection\");\n }\n if (useConnectionStore().reconnects !== reconnects && retry < 3) {\n return this.doCall(path, args, kwargs, timeout, retry + 1);\n }\n throw new TimeoutError({\n request: context,\n response: {\n connections: useConnectionStore().wsStates.get().map(formatState),\n },\n });\n }\n throw new BackendError(err.name, `Nats Error while calling RPC method ${methodName}`, {\n request: context,\n response: {\n connections: useConnectionStore().wsStates.get().map(formatState),\n message: err.message,\n code: err.code,\n cause: err.chainedError,\n },\n });\n }\n throw err;\n }\n\n function formatState(entry: { timestamp: number; state: string }) {\n return `${new Date(entry.timestamp).toISOString()}: ${entry.state}`;\n }\n }\n\n async roomCall(path: string, args: unknown[] = []) {\n const fullPath = `piplanning.session.6.${this.company}.${this.userId}.${path}`;\n return await this.doCall(fullPath, args);\n }\n\n async adminCall(path: string, args: unknown[] = []) {\n const fullPath = `piplanning.admin.6.${this.company}.${this.userId}.${path}`;\n return await this.doCall(fullPath, args);\n }\n\n async almCall(path: string, args: unknown[] = []) {\n const fullPath = `piplanning.almsession.6.${this.company}.${this.userId}.${path}`;\n return await this.doCall(fullPath, args);\n }\n\n async almToolCall(path: string, args: unknown[], timeout?: number) {\n const almType = this.almType || \"none\";\n const fullPath = `piplanning.almsession.6.${this.company}.${this.userId}.${almType}.${path}`;\n return await this.doCall(fullPath, args, undefined, timeout);\n }\n\n async companyCall(path: string, args: unknown[] = []) {\n const fullPath = `piplanning.company.3.${this.company}.${this.userId}.${path}`;\n return await this.doCall(fullPath, args);\n }\n\n async sessionCall(path: string, args: unknown[] = [], kwargs?: Record) {\n const fullPath = `piplanning.session.6.${this.company}.${this.userId}.${path}`;\n return await this.doCall(fullPath, [this.sessionId, ...args], kwargs);\n }\n\n async staticSessionCall(path: string, args: unknown[] = [], kwargs?: Record) {\n const fullPath = `piplanning.session.6.${this.company}.${this.userId}.${path}`;\n return await this.doCall(fullPath, args, kwargs);\n }\n\n async serverCall(path: string) {\n const fullPath = `piplanning.server.6.${this.company}.${this.userId}.${path}`;\n return await this.doCall(fullPath);\n }\n\n async statusCall(path: string, args: unknown[] = [], kwargs?: Record) {\n const fullPath = `piplanning.session.6.${this.company}.${this.userId}.${path}`;\n return await this.doCall(fullPath, args, kwargs);\n }\n\n async boardCall(path: string, args: unknown[], kwargs?: Record) {\n const fullPath = `piplanning.board.6.${this.company}.${this.userId}.${path}`;\n return await this.doCall(fullPath, args, kwargs);\n }\n\n async flexBoardCall(path: string, args: unknown[] = [], kwargs?: Record) {\n const fullPath = `piplanning.flexboard.6.${this.company}.${this.userId}.${path}`;\n return await this.doCall(fullPath, args, kwargs);\n }\n\n async userCall(path: string) {\n const fullPath = `piplanning.authuser.2.${this.company}.${this.userId}.${path}`;\n return await this.doCall(fullPath);\n }\n}\n","import type { RpcBackend } from \"./RpcBackend\";\nimport type { ServerAlmType } from \"./serverModel\";\n\nexport class SwitchingRpcBackend implements RpcBackend {\n constructor(\n private backends: RpcBackend[],\n private choose: (path: string) => number,\n ) {}\n\n init(sessionId: string, almType?: ServerAlmType) {\n this.backends.forEach((backend) => backend.init(sessionId, almType));\n }\n\n backend(path: string, kwargs?: Record) {\n const useBackend = kwargs?.useBackend as number | undefined;\n return this.backends[useBackend ?? this.choose(path)];\n }\n\n roomCall(path: string, args?: unknown[]): Promise {\n return this.backend(path).roomCall(path, args);\n }\n\n sessionCall(path: string, args?: unknown[], kwargs?: Record): Promise {\n return this.backend(path).sessionCall(path, args, kwargs);\n }\n\n staticSessionCall(path: string, args?: unknown[], kwargs?: object): Promise {\n return this.backend(path).staticSessionCall(path, args, kwargs);\n }\n\n serverCall(path: string, args: unknown[], kwargs?: Record): Promise {\n return this.backend(path, kwargs).serverCall(path, args, kwargs);\n }\n\n statusCall(path: string, args: unknown[], kwargs?: Record): Promise {\n return this.backend(path, kwargs).statusCall(path, args, kwargs);\n }\n\n boardCall(path: string, args: unknown[], kwargs?: object): Promise {\n return this.backend(path).boardCall(path, args, kwargs);\n }\n\n flexBoardCall(path: string, args: unknown[], kwargs?: object): Promise {\n return this.backend(path).flexBoardCall(path, args, kwargs);\n }\n\n userCall(path: string): Promise {\n return this.backend(path).userCall(path);\n }\n\n adminCall(path: string, args?: unknown[]): Promise {\n return this.backend(path).adminCall(path, args);\n }\n\n almCall(path: string, args?: unknown[]): Promise {\n return this.backend(path).almCall(path, args);\n }\n\n almToolCall(path: string, args: unknown[], timeout?: number): Promise {\n return this.backend(path).almToolCall(path, args, timeout);\n }\n\n companyCall(path: string, args: unknown[] = []): Promise {\n return this.backend(path).companyCall(path, args);\n }\n}\n","import type { ConnectionOptions, NatsConnection } from \"nats.ws\";\nimport { DebugEvents, ErrorCode, Events, NatsError, connect } from \"nats.ws\";\n\nimport { captureException, captureMessage } from \"@/error/sentry\";\nimport type { LogoutReason } from \"@/router/types\";\nimport AuthService from \"@/services/auth.service\";\nimport { useBoardsStore } from \"@/store/boards\";\nimport { useConnectionStore } from \"@/store/connection\";\nimport { useLoadingStore } from \"@/store/loading\";\nimport { useStatisticsStore } from \"@/store/statistics\";\nimport { useUserStore } from \"@/store/user\";\nimport * as Environment from \"@/utils/env/Environment\";\n\nimport { closeSession, initSession, reload } from \"./Backend\";\nimport { HttpRpcBackend } from \"./HttpRpcBackend\";\nimport { NatsBackendSession } from \"./NatsBackendSession\";\nimport { NatsRpcBackend } from \"./NatsRpcBackend\";\nimport { SwitchingRpcBackend } from \"./SwitchingRpcBackend\";\n\nconst connectRetries = 1;\nconst httpCallPaths = [\"link.list\"];\n\nfunction useHttp(path: string) {\n return httpCallPaths.includes(path);\n}\n\nlet connection: NatsConnection | undefined;\n\nasync function initNatsSession(connection: NatsConnection) {\n const session = new NatsBackendSession(\n connection,\n useUserStore().technicalUser,\n new SwitchingRpcBackend(\n [\n new NatsRpcBackend(\n connection,\n useUserStore().technicalUser.company,\n useUserStore().technicalUser.id,\n ),\n new HttpRpcBackend(),\n ],\n (path) => (useHttp(path) ? 1 : 0),\n ),\n );\n await useLoadingStore().load(\"loading.initBackend\", initSession(session));\n return session;\n}\n\ninterface CloseHandler {\n login: () => void;\n logout: (reason: LogoutReason) => void;\n}\n\nexport async function openConnection(\n currentPath: () => string,\n onClose: CloseHandler,\n connectionName = \"\",\n): Promise {\n const refreshToken = async () => {\n try {\n await AuthService.refreshToken({ path: \"#\" + currentPath() });\n } catch (error) {\n onClose.logout(\"refresh-failed\");\n }\n window.location.reload();\n };\n const connection = await doConnect(\n {\n servers: [Environment.natsUrl],\n pingInterval: 4500,\n maxPingOut: 1,\n maxReconnectAttempts: -1,\n name: connectionName,\n waitOnFirstConnect: true,\n },\n refreshToken,\n );\n if (connection) {\n void addConnectionStateHandlers(connection);\n void addCloseConnectionHandlers(connection, refreshToken, onClose.logout);\n await initNatsSession(connection);\n useConnectionStore().netWs = true;\n if (useBoardsStore().boardsInited) {\n // it's a reconnect\n reload();\n }\n }\n}\n\nasync function doConnect(\n options: ConnectionOptions,\n refreshToken: () => Promise,\n retries = 0,\n) {\n const start = Date.now();\n try {\n return await connect(options);\n } catch (error) {\n if (shouldRefreshToken(error)) {\n await refreshToken();\n return;\n }\n if (shouldReload(error)) {\n if (retries < connectRetries) {\n return doConnect(options, refreshToken, retries + 1);\n }\n void captureException(error, {\n request: { timeout: Date.now() - start },\n });\n // TODO show a message somehow?\n throw error;\n }\n if (shouldLogout(error)) {\n // TODO show a message somehow?\n throw error;\n }\n void captureException(error);\n throw error;\n }\n}\n\nexport async function closeConnection() {\n try {\n if (connection) {\n const open = !connection.isClosed();\n closeSession(open);\n if (open) {\n await connection.close();\n }\n } else {\n closeSession();\n }\n } catch (e) {\n void captureException(e);\n }\n}\n\nasync function addConnectionStateHandlers(connection: NatsConnection) {\n for await (const status of connection.status()) {\n if (status.type !== DebugEvents.PingTimer) {\n useConnectionStore().addWebsocketState(status.type);\n }\n switch (status.type) {\n case Events.Disconnect:\n // avoid showing \"disconnected\" message when reloading the page\n if (!isReload()) {\n useConnectionStore().disconnectWebsocket();\n }\n break;\n case Events.Reconnect:\n useStatisticsStore().current.reconnects++;\n useConnectionStore().reconnectWebsocket();\n break;\n }\n }\n}\n\nfunction isReload() {\n const navigation = performance.getEntriesByType(\"navigation\")[0];\n return navigation?.type === \"reload\";\n}\n\nasync function addCloseConnectionHandlers(\n connection: NatsConnection,\n refreshToken: () => Promise,\n logout: (reason: LogoutReason) => void,\n) {\n const clientId = connection.info?.client_id;\n const error = await connection.closed();\n await closeConnection();\n if (!error) {\n return;\n }\n if (shouldRefreshToken(error)) {\n await refreshToken();\n return;\n }\n if (shouldReload(error)) {\n window.location.reload();\n return;\n }\n if (shouldLogout(error)) {\n logout(\"connection-refused\");\n return;\n }\n void captureMessage(`Unhandled connection error: ${error.message}`, {\n error: {\n clientId,\n info: connection.info,\n error,\n },\n });\n if (error instanceof NatsError && error.chainedError) {\n void captureException(error.chainedError);\n }\n logout(\"unknown\");\n}\n\nfunction shouldRefreshToken(error: unknown) {\n if (error instanceof NatsError) {\n const refreshErrors = [\n ErrorCode.AuthenticationExpired,\n ErrorCode.AuthorizationViolation,\n ErrorCode.Disconnect,\n ].map((err) => err.valueOf());\n if (refreshErrors.includes(error.code)) {\n return true;\n }\n\n const refreshServerErrors = [\"'User Authentication Revoked'\"];\n if (error.isProtocolError() && refreshServerErrors.includes(error.message)) {\n return true;\n }\n }\n}\n\nfunction shouldReload(error: unknown) {\n if (error instanceof NatsError) {\n const reloadServerErrors = [\"'Authentication Timeout'\", \"'Stale Connection'\"];\n if (error.isProtocolError() && reloadServerErrors.includes(error.message)) {\n return true;\n }\n }\n if (unexpectedServerMessage(error)?.startsWith(\"-ERR 'Authentication Timeout'\")) {\n return true;\n }\n}\n\nfunction shouldLogout(error: unknown) {\n if (error instanceof NatsError) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison\n return error.code === ErrorCode.ConnectionRefused;\n }\n}\n\nfunction unexpectedServerMessage(error: any): string | undefined {\n if (error.message === \"unexpected response from server\") {\n return error.contexts?.response?.data;\n }\n}\n","import { defineStore } from \"pinia\";\n\nexport const useMessengerStore = defineStore(\"messenger\", {\n state: () => {\n return {\n show: false,\n showBadge: false,\n unreadMessages: false,\n passiveNotification: false,\n };\n },\n getters: {\n // Show the new-message bage if there are any unread messages or passive notifications (eg. new news)\n showBadge(state) {\n return state.unreadMessages || state.passiveNotification;\n },\n },\n actions: {\n setUnreadMessages(anyMessages: boolean) {\n this.unreadMessages = anyMessages;\n },\n setPassiveNotification(anyNotifications: boolean) {\n this.passiveNotification = anyNotifications;\n },\n },\n});\n","import { throttle } from \"lodash-es\";\n\nexport const LAST_ACTIVITY_KEY = \"lastActivityTimestamp\";\nconst LOGOUT_CHANNEL_NAME = \"inactivity-logout-channel\";\nconst USER_EVENTS = [\"mousedown\", \"mousemove\", \"keydown\", \"scroll\", \"touchstart\"];\n\ninterface InactivityTimeoutOptions {\n timeoutMinutes: number;\n onTimeout: () => void;\n}\n\nexport function setupInactivityLogout({ timeoutMinutes, onTimeout }: InactivityTimeoutOptions) {\n if (!timeoutMinutes) return;\n\n let timeoutId: ReturnType | null = null;\n const channel = new BroadcastChannel(LOGOUT_CHANNEL_NAME);\n\n const throttledEventHandler = throttle(() => resetTimer(), 1000, {\n leading: true,\n trailing: false,\n });\n\n function cleanup() {\n if (timeoutId) {\n clearTimeout(timeoutId);\n timeoutId = null;\n }\n window.removeEventListener(\"storage\", handleStorageChange);\n USER_EVENTS.forEach((event) => {\n window.removeEventListener(event, throttledEventHandler);\n });\n localStorage.removeItem(LAST_ACTIVITY_KEY);\n channel.close();\n }\n\n function handleTimeout() {\n cleanup();\n const channel = new BroadcastChannel(LOGOUT_CHANNEL_NAME);\n channel.postMessage({ type: \"LOGOUT\" });\n channel.close();\n onTimeout();\n }\n\n function checkIfTimedOut() {\n const lastActivity = Number(localStorage.getItem(LAST_ACTIVITY_KEY) || Date.now());\n const timeSinceLastActivity = Date.now() - lastActivity;\n const timeoutDuration = timeoutMinutes * 60 * 1000;\n\n if (timeSinceLastActivity >= timeoutDuration) {\n handleTimeout();\n return true;\n }\n return false;\n }\n\n function resetTimer() {\n if (timeoutId) clearTimeout(timeoutId);\n\n localStorage.setItem(LAST_ACTIVITY_KEY, Date.now().toString());\n\n if (timeoutMinutes > 0) timeoutId = setTimeout(handleTimeout, timeoutMinutes * 60 * 1000);\n }\n\n function handleStorageChange(event: StorageEvent) {\n if (event.key === LAST_ACTIVITY_KEY && !checkIfTimedOut()) resetTimer();\n }\n\n function handleBroadcastMessage(event: MessageEvent) {\n if (event.data.type === \"LOGOUT\") {\n cleanup();\n onTimeout();\n }\n }\n\n if (!checkIfTimedOut() && timeoutMinutes > 0) {\n resetTimer();\n window.addEventListener(\"storage\", handleStorageChange);\n channel.addEventListener(\"message\", handleBroadcastMessage);\n USER_EVENTS.forEach((event) => {\n window.addEventListener(event, throttledEventHandler);\n });\n }\n}\n","import { getWebInstrumentations, initializeFaro } from \"@grafana/faro-web-sdk\";\nimport type { NavigationGuardReturn, RouteLocation } from \"vue-router\";\n\nimport { openConnection } from \"@/backend/Connection\";\nimport type { IntercomStatic } from \"@/declare/windowIntercom\";\nimport { setUser } from \"@/error/sentry\";\nimport type { AuthUser, Role, TechnicalUser } from \"@/model/user\";\nimport { getUserTeams } from \"@/services/userAdmin.service\";\nimport { useCompanySettingsStore } from \"@/store/companySettings\";\nimport { useLicenseStore } from \"@/store/license\";\nimport { useLoadingStore } from \"@/store/loading\";\nimport { useMessengerStore } from \"@/store/messenger\";\nimport { useUserStore } from \"@/store/user\";\nimport { initTracking } from \"@/utils/analytics/track\";\nimport { identifyUser, identifyUserSettings } from \"@/utils/analytics/trackUser\";\nimport { whenChildElementWithClass } from \"@/utils/dom/dom\";\nimport {\n amplitudeApiKey,\n faroUrl,\n intercomApi,\n intercomId,\n isCloud,\n} from \"@/utils/env/Environment\";\nimport { isFeatureEnabled, parseUrlWithoutRouter } from \"@/utils/env/feature\";\nimport { initFeatureToggles } from \"@/utils/env/featureToggles\";\nimport { setupInactivityLogout } from \"@/utils/inactivityLogout\";\n\nimport { currentRoute, goToLogin, goToLogout } from \"./navigation\";\n\ntype Target = RouteLocation[\"query\"] & { path: string };\n\nexport async function login(user: TechnicalUser, target: Target): Promise {\n setLastLoginAt();\n\n useUserStore().technicalUser = {\n ...user,\n teams: await getUserTeams(user.id),\n };\n void setUser(user.company, user.id);\n const authUser = await connect(user);\n void initUserTracking(authUser, user);\n initIntercom(authUser, user);\n initFaro(authUser, user);\n initInactivityTimeout();\n\n const query = { ...target } as RouteLocation[\"query\"];\n delete query.session;\n delete query.board;\n delete query.team;\n delete query.path;\n return { path: target.path || \"/page/session\", query };\n}\n\nasync function connect(user: TechnicalUser): Promise {\n const time = Math.floor(Date.now() / 1000);\n const connectionName = `${user.company}:${user.id}:${time}`;\n const [authUser] = await Promise.all([\n useLoadingStore().load(\"loading.user\", useUserStore().loadCurrentUser()),\n useLoadingStore().load(\"loading.featureToggles\", initFeatureToggles(user.company)),\n useLoadingStore().load(\n \"loading.connect\",\n openConnection(\n () => currentRoute().path,\n { login: goToLogin, logout: goToLogout },\n connectionName,\n ),\n ),\n ]);\n return authUser;\n}\n\nasync function initUserTracking(authUser: AuthUser, user: TechnicalUser) {\n if (amplitudeApiKey && isCloud && useLicenseStore().license.tracking) {\n initTracking(amplitudeApiKey);\n identifyUser(authUser, user);\n identifyUserSettings();\n }\n}\n\nfunction initInactivityTimeout() {\n const timeoutMinutes = useCompanySettingsStore().autoLogoutAfter;\n setupInactivityLogout({\n timeoutMinutes,\n onTimeout: () => goToLogout(\"inactivity\"),\n });\n}\n\nfunction initFaro(authUser: AuthUser, user: TechnicalUser) {\n if (!faroUrl || !isFeatureEnabled({ query: parseUrlWithoutRouter() }, \"faro\")) {\n return;\n }\n let sampleRate = 0.08;\n const sampleAll = isFeatureEnabled({ query: parseUrlWithoutRouter() }, \"faro-sample-all\");\n if (sampleAll) {\n sampleRate = 1;\n }\n\n const faro = initializeFaro({\n url: faroUrl,\n app: {\n name: \"piplanning\",\n version: window.BUILD_HASH,\n environment: window.ENVIRONMENT,\n },\n sessionTracking: {\n samplingRate: sampleRate,\n },\n instrumentations: [\n // Mandatory, overwriting the instrumentations array would cause the default instrumentations to be omitted\n ...getWebInstrumentations(),\n // This packages is optional because it increases the bundle size noticeably.\n // Only add it if you want tracing data.\n // new TracingInstrumentation(),\n ],\n });\n\n faro?.api.setUser({\n id: authUser.id,\n attributes: {\n company: user.company,\n },\n });\n}\n\nfunction initIntercom(authUser: AuthUser, user: TechnicalUser) {\n if (isCloud && intercomId && intercomApi && useLicenseStore().license.tracking) {\n window.Intercom = null as unknown as IntercomStatic; // delete existing intercom (dummy) instance\n window.loadIntercom(intercomId, intercomApi);\n }\n\n // show the custom intercom launcher only when the default launcher would be shown (it's in the DOM but made invisible by CSS)\n // the reason is that the default launcher can be configured to appear only in certain conditions (e.g. user role)\n // custom launcher cannot be configured like this.\n // Remove this code when we don't need this function anymore (because intercom launcher should always be shown)\n ifDefaultLauncherShown(() => (useMessengerStore().show = true));\n\n window.Intercom(\"boot\", {\n custom_launcher_selector: \".messenger-item\",\n email: authUser.email,\n name: authUser.name,\n user_id: authUser.id,\n user_hash: authUser.hash,\n role: intercomRoles[user.role],\n language_override: authUser.preferredLanguage,\n avatar: {\n type: \"avatar\",\n image_url: authUser.imageUrl || \"\",\n },\n company: {\n company_id: user.company,\n name: user.company,\n plan: useLicenseStore().license.plan,\n },\n });\n}\n\nfunction ifDefaultLauncherShown(action: () => void) {\n whenChildElementWithClass(document.body, \"intercom-lightweight-app\", (app) =>\n whenChildElementWithClass(app, \"intercom-launcher\", action),\n );\n}\n\nconst intercomRoles: { [role in Role]: string } = {\n observer: \"Observer\",\n user: \"Member\",\n admin: \"Admin\",\n planning_interval_admin: \"PI Admin\",\n};\n\nfunction setLastLoginAt() {\n localStorage.setItem(\"lastLoginAt\", Date.now().toString());\n}\n","import type { RouteLocationNormalized, RouteLocationRaw } from \"vue-router\";\n\nimport type { Params, Query } from \"../types\";\n\nexport function isSmallScreen() {\n return window.innerWidth <= 1000;\n}\n\nexport function companyParam() {\n const search = new URLSearchParams(document.location.search.substring(1));\n return search.get(\"company\");\n}\n\nexport function isBoardChange(from: RouteLocationNormalized, to: RouteLocationNormalized) {\n return (\n to.name !== from.name ||\n to.params.session !== from.params.session ||\n to.params.team !== from.params.team ||\n to.params.board !== from.params.board ||\n to.params.name !== from.params.name\n );\n}\n\nexport function replaceParams(to: RouteLocationNormalized, params: Params): RouteLocationRaw {\n return replaceRoute(to, { params });\n}\n\nexport interface ParamsAndQuery {\n params: Params;\n query: Omit;\n}\n\nexport function replaceRoute(\n to: RouteLocationNormalized,\n pq: Partial,\n): RouteLocationRaw {\n return {\n replace: true,\n name: to.name || undefined,\n params: { ...to.params, ...pq.params },\n query: { ...to.query, ...pq.query },\n };\n}\n","import type { RouteLocation, RouteLocationNormalized } from \"vue-router\";\n\nimport { loggedIn } from \"@/backend/Backend\";\nimport type { UserResponse } from \"@/backend/serverModel\";\nimport { CancelError } from \"@/error/CancelError\";\nimport { captureMessage } from \"@/error/sentry\";\nimport { technicalUser } from \"@/model/user\";\nimport AuthService from \"@/services/auth.service\";\nimport { useLoadingStore } from \"@/store/loading\";\n\nimport { login } from \"../login\";\nimport { companyParam } from \"./utils\";\n\nexport async function assertLoggedIn(to: RouteLocationNormalized) {\n // Check if authentication is needed for route\n if (to.matched.some((route) => route.meta.needsAuth === false) || loggedIn()) {\n return;\n }\n\n useLoadingStore().start();\n return await loginAndRedirect(to);\n}\n\nasync function loginAndRedirect(route: RouteLocation) {\n // In case we specify ?company=xxx as a query parameter, we should redirect the user directly to the login page.\n // This is used in case of SSO to direct the user directly to the login page where the can click on the SSO-button.\n // When the user never authenticated before, we don't recognize the e-mail thus need to\n // know the company (which in this case is passed as param).\n if (companyParam()) {\n return { name: \"login\" };\n }\n try {\n const response = await useLoadingStore().load(\n \"loading.checkAuth\",\n AuthService.isAuthenticated(),\n );\n if (response.success) {\n return await loginWithUser(response);\n }\n void captureMessage(\"Login unsuccessful with non-error status code\", {\n response: { ...response },\n route: { ...route },\n });\n return { name: \"login\" };\n } catch (e) {\n if (e instanceof CancelError) {\n return false;\n }\n void captureMessage(\"Login unsuccessful\", {\n response: { e },\n route: { ...route },\n });\n return { name: \"login\" };\n }\n\n function loginWithUser(response: UserResponse) {\n const user = technicalUser(response.user_id, response.company, response.role);\n return useLoadingStore().load(\n \"loading.login\",\n login(user, { ...route.query, path: route.path }),\n );\n }\n}\n","import type { RouteLocation, RouteLocationNormalized } from \"vue-router\";\n\nimport { useBoardsStore } from \"@/store/boards\";\nimport { useSessionStore } from \"@/store/session\";\nimport { i18n } from \"@/translations/i18n\";\n\nimport { isBoardChange } from \"./utils\";\n\nexport function setDocTitle(to: RouteLocationNormalized, from: RouteLocationNormalized) {\n if (isBoardChange(from, to)) {\n const boardTitle = to.params.board ? useBoardsStore().boardTitle() : \"\";\n const place = boardTitle || routeName(to);\n document.title = \"piplanning - \" + place;\n }\n}\n\nfunction routeName(route: RouteLocation) {\n const selectedSession = useSessionStore().current;\n const title = route.meta?.title as string;\n return (\n (title ? i18n.global.t(title.toString()) : \"\") +\n (selectedSession ? \" - \" + selectedSession.name : \"\")\n );\n}\n","import { captureException } from \"@sentry/vue\";\n\nimport { getArts, getTeams } from \"@/backend/Backend\";\nimport type { BoardType, Id } from \"@/model/baseTypes\";\nimport type { Session } from \"@/model/session\";\nimport type { TechnicalUser, UserOrgEntities } from \"@/model/user\";\nimport { getOrgEntities } from \"@/services/user.service\";\nimport { useArtStore } from \"@/store/art\";\nimport { useSessionStore } from \"@/store/session\";\nimport { useTeamStore } from \"@/store/team\";\nimport { isRangeActive, sessionExecution, sessionPlanning } from \"@/utils/session\";\n\n// - There's exactly one session the user is assigned to (via art or team) in planning -> return it\n// - There's exactly one session the user is assigned to (via art or team) in execution -> return it\nexport async function uniqueActiveSession(user: TechnicalUser): Promise {\n const userOrgEntities = await getOrgEntities(user.id);\n const sessions = useSessionStore().sessions;\n return (\n (await uniqueAssignedSession(\n sessions.filter((session) => isRangeActive(sessionPlanning(session))),\n userOrgEntities,\n )) ||\n (await uniqueAssignedSession(\n sessions.filter((session) => isRangeActive(sessionExecution(session))),\n userOrgEntities,\n ))\n );\n}\n\nasync function uniqueAssignedSession(\n sessions: Session[],\n entities: UserOrgEntities,\n): Promise {\n const sessionsArtsTeams = await Promise.all(\n sessions.map((session) =>\n Promise.all([getArts(session.id), getTeams(session.id)]).then(([arts, teams]) => ({\n session,\n arts,\n teams,\n })),\n ),\n );\n const artAssigned = sessionsArtsTeams.filter(({ arts }) => choose(arts, entities.art).length > 0);\n if (artAssigned.length === 1) {\n return artAssigned[0].session;\n }\n const teamAssigned = sessionsArtsTeams.filter(\n ({ teams }) => choose(teams, entities.team).length > 0,\n );\n if (teamAssigned.length === 1) {\n return teamAssigned[0].session;\n }\n}\n\ninterface TeamAndBoard {\n team: string;\n board: BoardType;\n}\n\n// - observer/user:\n// - the user is assigned to a team -> go to the team board of this team\n// - else -> go to program board, select first team of first ART\n// - pi-admin/admin:\n// - the user is assigned to an ART -> go to program board of this ART, select an assigned team\n// - the user is assigned to a team -> go where observer/user would go\n// - else -> go to the program board, select first team of first ART\nexport async function initialTeamAndBoard(user: TechnicalUser): Promise {\n try {\n return await appParams(user);\n } catch (fail) {\n captureException(fail);\n const team = useTeamStore().teams[0];\n return { board: \"team\", team: team.name };\n }\n}\n\nasync function appParams(user: TechnicalUser): Promise {\n switch (user.role) {\n case \"observer\":\n case \"user\":\n return handleUser(user);\n case \"admin\":\n case \"planning_interval_admin\":\n return await handleAdmin(user);\n default:\n throw new Error(\"Unhandled role\", user.role);\n }\n}\n\nfunction handleUser(user: TechnicalUser): TeamAndBoard {\n const teams = choose(useTeamStore().teams, user.teams);\n if (teams.length > 0) {\n return { team: teams[0].name, board: \"team\" };\n }\n // the user might belong to no team in the session, meaning he's from a participating team\n // in this case, select the first team of the first art\n const firstArtId = useArtStore().arts[0]?.id || \"\";\n const teamsInFirstArt = useTeamStore().teamsInArt(firstArtId);\n return { team: teamsInFirstArt[0].name, board: \"program\" };\n}\n\nasync function handleAdmin(user: TechnicalUser): Promise {\n const userOrgEntities = await getOrgEntities(user.id);\n\n const arts = choose(useArtStore().arts, userOrgEntities.art);\n const teams = choose(useTeamStore().teams, userOrgEntities.team);\n\n if (arts.length > 0) {\n const art = arts[0];\n const team = teams.find((t) => t.artId === art.id) ?? useTeamStore().teamsInArt(art.id)[0];\n return { board: \"program\", team: team.name };\n }\n\n if (teams.length > 0) {\n return handleUser(user);\n }\n\n const firstArt = useArtStore().arts[0];\n const team = useTeamStore().teamsInArt(firstArt.id)[0];\n return { board: \"program\", team: team.name };\n}\n\nfunction choose(all: T[], selected: S[]): T[] {\n const ids = new Set(selected.map((e) => e.id));\n return all.filter((entity) => ids.has(entity.id));\n}\n","import { clamp } from \"lodash-es\";\nimport type {\n LocationQuery,\n NavigationGuardReturn,\n RouteLocationNormalized,\n RouteLocationNormalizedLoaded,\n} from \"vue-router\";\n\nimport { boardActions } from \"@/action/boardActions\";\nimport { internalActions } from \"@/action/internalActions\";\nimport { loadBoard, loadOtherBoards } from \"@/backend/Backend\";\nimport { sendBoardSwitch } from \"@/composables/useEventBus\";\nimport { handleError } from \"@/error/errorHandler\";\nimport { addBreadcrumb } from \"@/error/sentry\";\nimport { maxZoom, minZoom } from \"@/model/Settings\";\nimport type { BoardType } from \"@/model/baseTypes\";\nimport { type Board, isFlexBoard } from \"@/model/board\";\nimport type { Team } from \"@/model/session\";\nimport { useBoardStore } from \"@/store/board\";\nimport { useBoardsStore } from \"@/store/boards\";\nimport { useFlexStore } from \"@/store/flex\";\nimport { useLoadingStore } from \"@/store/loading\";\nimport { useNavigationStore } from \"@/store/navigation\";\nimport { useSessionStore } from \"@/store/session\";\nimport { NO_TEAM, useTeamStore } from \"@/store/team\";\nimport { useUserStore } from \"@/store/user\";\nimport { useZoomStore } from \"@/store/zoom\";\n\nimport { ANY_TEAM, PARAM, type Params, type QueryImpl } from \"../types\";\nimport { initialTeamAndBoard } from \"./appNavigation\";\nimport { type ParamsAndQuery, isBoardChange, replaceRoute } from \"./utils\";\n\nlet scrollTimeout = 0;\n\nexport async function handleNonSessionParams(\n to: RouteLocationNormalized,\n from: RouteLocationNormalizedLoaded,\n): Promise {\n if (to.name !== \"app\" || to.params.team === PARAM.NONE || to.params.board === PARAM.NONE) {\n return;\n }\n\n try {\n const pq = { params: {}, query: {} };\n if (to.params.board === \"flex\") {\n await handleNameParam(pq, to.params.name as string | undefined);\n }\n await handleTeamAndBoardParams(\n pq,\n to.params.team as string,\n to.params.board as string,\n to.query,\n );\n handleQuery(pq, from, to);\n return routeChange(pq, to);\n } catch (fail) {\n return handleError(fail);\n } finally {\n useSessionStore().isSessionLoading = false;\n }\n}\n\n// load a flex board according to the \"name\" param\nasync function handleNameParam(pq: ParamsAndQuery, toName: string | undefined) {\n const changeFlex =\n (toName && toName !== currentFlexBoardName()) || (!toName && !currentFlexBoardName());\n if (!changeFlex) {\n return;\n }\n const board = useFlexStore().flexBoardByName(toName || \"\") || useFlexStore().flexBoards[0];\n if (!board) {\n pq.params.board = \"team\";\n return;\n }\n void addBreadcrumb(\"navigation\", {\n message: \"Selecting flexboard\",\n data: { id: board.id, name: board.name },\n });\n //TODO remove/add subscriptions from old/new flex board?\n useFlexStore().setCurrentFlexBoard(board);\n useBoardsStore().addBoard(board);\n internalActions.switchBoard(board);\n await loadBoard(board);\n pq.params.name = board.name;\n}\n\nasync function handleTeamAndBoardParams(\n pq: ParamsAndQuery,\n toTeam: string,\n toBoard: string,\n toQuery: LocationQuery,\n) {\n if (toTeam === PARAM.INITIAL || toBoard === PARAM.INITIAL) {\n const { team, board } = await initialTeamAndBoard(useUserStore().technicalUser);\n toTeam = team;\n toBoard = board;\n } else if (toTeam === PARAM.LAST_TEAM) {\n toTeam = useNavigationStore().lastSelectedTeamId(useSessionStore().current.id) || ANY_TEAM;\n } else if (toTeam === PARAM.CURRENT_TEAM) {\n toTeam = useTeamStore().current.id === NO_TEAM.id ? ANY_TEAM : useTeamStore().current.id;\n }\n\n const team = findTeam(toTeam);\n pq.params.team = team.name;\n\n const board = findBoard(toBoard, team);\n pq.params.board = board.type;\n\n const newSession = useSessionStore().isSessionLoading;\n\n void addBreadcrumb(\"navigation\", {\n message: \"Setting board/team\",\n data: {\n switchedSession: newSession,\n teamId: team.id,\n teamName: team.name,\n board: board.type,\n },\n });\n\n let boardReload = newSession;\n if (team.id !== useTeamStore().current.id) {\n boardActions.switchTeam(\"internal\", team);\n boardReload = true;\n }\n if (newSession || board.type !== useBoardStore().board?.type) {\n internalActions.switchBoard(board);\n boardReload = true;\n }\n\n applyZoomIfNeeded(pq, toQuery);\n if (boardReload) {\n const currentBoard = useBoardStore().currentBoard();\n const boardType = currentBoard.type;\n const teamName = boardType === \"team\" ? currentBoard.team?.name : undefined;\n\n void addBreadcrumb(\"xhr\", {\n message: \"Reloading board\",\n data: {\n id: useBoardStore().boardId(),\n name: currentFlexBoardName(),\n type: useBoardStore().currentBoard().type,\n team: teamName,\n },\n });\n\n sendBoardSwitch();\n useBoardsStore().loading = true;\n await loadBoard(useBoardStore().currentBoard());\n useBoardsStore().loading = false;\n if (newSession) {\n useLoadingStore().end();\n }\n loadOtherBoards();\n }\n}\n\nfunction currentFlexBoardName() {\n const currentBoard = useBoardStore().board;\n return isFlexBoard(currentBoard?.type) ? currentBoard.name : undefined;\n}\n\nfunction findTeam(target: string): Team {\n const match = useTeamStore().teams.find((team) => target === ANY_TEAM || matches(team));\n return match || useTeamStore().teams[0] || NO_TEAM;\n\n function matches(team: Team) {\n return team.name === target || team.id === target;\n }\n}\n\nfunction findBoard(target: string, team: Team): Board {\n return (\n useBoardsStore().boardByTypeOptional(target as BoardType, {\n teamId: team.id,\n artId: team.artId,\n }) ||\n useBoardsStore().boards[useBoardStore().board?.id || \"\"] ||\n useBoardsStore().boardByType(\"team\", { teamId: team.id })\n );\n}\n\nfunction handleQuery(\n pq: ParamsAndQuery,\n from: RouteLocationNormalized,\n to: RouteLocationNormalized,\n) {\n const newSession = useSessionStore().isSessionLoading;\n const stickyLink = isBoardChange(from, to) && to.query.zoom !== \"1\";\n scrollWindowIfNeeded(pq, to.query, newSession || stickyLink);\n}\n\nfunction applyZoomIfNeeded(pq: ParamsAndQuery, query: QueryImpl) {\n const newZoom = clamp(parseFloat(query.zoom!) || 1, minZoom, maxZoom);\n if (newZoom !== useZoomStore().factor) {\n useZoomStore().setZoomFactor(newZoom);\n pq.query.zoom = \"\" + newZoom;\n }\n}\n\nfunction scrollWindowIfNeeded(pq: ParamsAndQuery, query: QueryImpl, force: boolean) {\n const scrollX = +(query.scrollX || 68);\n const scrollY = +(query.scrollY || 0);\n window.clearTimeout(scrollTimeout);\n if (force || scrollX !== window.scrollX || scrollY !== window.scrollY) {\n const timeout = window.setTimeout(() => window.scrollTo(scrollX, scrollY), 50);\n // if it's an initial page load (=newSession) or a click on a sticky with a link to another page\n // scroll to the given position even if we get\n // another scroll position shortly afterwards\n scrollTimeout = force ? 0 : timeout;\n pq.query.scrollX = \"\" + scrollX;\n pq.query.scrollY = \"\" + scrollY;\n }\n}\n\nfunction routeChange(pq: ParamsAndQuery, to: RouteLocationNormalized): NavigationGuardReturn {\n const paramChanged = Object.keys(pq.params).some(\n (p) => pq.params[p as keyof Params] !== to.params[p],\n );\n const queryChanged = Object.keys(pq.query).some(\n (q) => pq.query[q as keyof ParamsAndQuery[\"query\"]] !== to.query[q],\n );\n\n if (paramChanged || queryChanged) {\n return replaceRoute(to, pq);\n }\n}\n","import type { SessionData } from \"@/backend/Backend\";\nimport { closeConnection } from \"@/backend/Connection\";\nimport { boardOf } from \"@/board/boardFactory\";\nimport { useBoardsStore } from \"@/store/boards\";\nimport { useCardStore } from \"@/store/card\";\nimport { useCategoryStore } from \"@/store/category\";\nimport { useFlexStore } from \"@/store/flex\";\nimport { useLicenseStore } from \"@/store/license\";\nimport { useLinkStore } from \"@/store/link\";\nimport { EMPTY_SESSION, useSessionStore } from \"@/store/session\";\nimport { useStickyTypeStore } from \"@/store/stickyType\";\nimport { useTeamStore } from \"@/store/team\";\nimport { useZoomStore } from \"@/store/zoom\";\n\nexport function setSessionData(data: SessionData) {\n useStickyTypeStore().stickyTypes = data.stickyTypes;\n useStickyTypeStore().almStickyTypes = data.almStickyTypes;\n useCategoryStore().categories = data.categories;\n useCardStore().cards = {};\n useBoardsStore().resetBoards();\n if (data.boards) {\n for (const id in data.boards) {\n const board = data.boards[id];\n board.shapes.push(...boardOf(board).location(0, 0).shapes);\n }\n useBoardsStore().addBoards(data.boards);\n }\n useLinkStore().linkTypes = data.linkTypes || [];\n useLinkStore().setLinks(data.links || []);\n useFlexStore().flexTypes = data.flexTypes;\n}\n\nexport function clearSessionData() {\n void closeConnection();\n useZoomStore().setZoomFactor(1);\n useSessionStore().sessions = [];\n useSessionStore().current = EMPTY_SESSION;\n useTeamStore().setTeams([]);\n useLicenseStore().license = {\n daysTillExpiration: null,\n usable: true,\n plan: \"standard\",\n tracking: false,\n type: \"trial\",\n onPrem: false,\n };\n\n useStickyTypeStore().stickyTypes = [];\n useCardStore().cards = {};\n useBoardsStore().resetBoards();\n useLinkStore().linkTypes = [];\n useLinkStore().setLinks([]);\n}\n","import type { NavigationGuardReturn, RouteLocationNormalized } from \"vue-router\";\n\nimport { loadSessionData, setSessionId } from \"@/backend/Backend\";\nimport { handleError } from \"@/error/errorHandler\";\nimport { addBreadcrumb } from \"@/error/sentry\";\nimport type { Session } from \"@/model/session\";\nimport { useBoardStore } from \"@/store/board\";\nimport { useBoardsStore } from \"@/store/boards\";\nimport { useLoadingStore } from \"@/store/loading\";\nimport { useNavigationStore } from \"@/store/navigation\";\nimport { EMPTY_BOARD, EMPTY_SESSION, useSessionStore } from \"@/store/session\";\nimport { useUserStore } from \"@/store/user\";\n\nimport { setSessionData } from \"../sessionData\";\nimport { PARAM } from \"../types\";\nimport { uniqueActiveSession } from \"./appNavigation\";\nimport { replaceParams, replaceRoute } from \"./utils\";\n\nexport async function handleSessionParam(\n to: RouteLocationNormalized,\n): Promise {\n if (to.name !== \"app\") {\n return;\n }\n\n // there can be only on session param, cast is ok\n const toSession = to.params.session as string;\n\n // no session at all -> use dummy session\n if (toSession === PARAM.NONE) {\n if (to.query.modal !== \"SessionSelectionModal\") {\n return replaceRoute(to, { query: { modal: \"SessionSelectionModal\" } });\n }\n useSessionStore().current = EMPTY_SESSION;\n useBoardStore().board = EMPTY_BOARD;\n useBoardsStore().boards = { [EMPTY_BOARD.id]: EMPTY_BOARD };\n return;\n }\n\n let session;\n if (toSession === PARAM.INITIAL) {\n if (to.query.modal !== \"SessionSelectionModal\") {\n const active = await uniqueActiveSession(useUserStore().technicalUser);\n // user has one active session -> go directly there\n if (active) {\n return replaceParams(to, {\n session: useSessionStore().uniqueSessionName(active),\n });\n }\n // go to last used session and show session selection modal\n return replaceRoute(to, { query: { modal: \"SessionSelectionModal\" } });\n }\n session = lastUsedSession();\n } else if (useSessionStore().currentlyDifferentSession(toSession)) {\n session = sessionByNameOrId(toSession);\n } else {\n session = useSessionStore().current;\n }\n session = session || useSessionStore().sessions[0];\n\n // no session found -> empty/dummy session\n if (!session || session.id === EMPTY_SESSION.id) {\n return replaceParams(to, {\n session: PARAM.NONE,\n board: PARAM.NONE,\n team: PARAM.NONE,\n });\n }\n\n const sessionName = useSessionStore().uniqueSessionName(session);\n if (toSession !== sessionName) {\n return replaceParams(to, { session: sessionName });\n }\n\n if (session.id !== useSessionStore().current.id) {\n try {\n useSessionStore().isSessionLoading = true;\n await loadSession(session);\n } catch (fail) {\n useSessionStore().isSessionLoading = false;\n return handleError(fail);\n }\n }\n}\n\nasync function loadSession(session: Session) {\n void addBreadcrumb(\"navigation\", {\n message: \"Changing session\",\n data: { id: session.id, name: session.name },\n });\n useSessionStore().setSession(session);\n await setSessionId(session.id);\n await useLoadingStore().load(\"loading.session\", loadSessionData().then(setSessionData));\n}\n\nfunction lastUsedSession(): Session | undefined {\n const lastSessionId = useNavigationStore().lastSelectedSessionId();\n if (lastSessionId) {\n const lastSession = useSessionStore().findByNameOrId(lastSessionId);\n if (lastSession) {\n return sessionByNameOrId(lastSession.name);\n }\n }\n}\n\nfunction sessionByNameOrId(target: string): Session | undefined {\n return useSessionStore().findByNameOrId(target) || useSessionStore().findByIndexedName(target);\n}\n","import type { RouteLocationNormalizedGeneric } from \"vue-router\";\n\nimport { CancelError } from \"@/error/CancelError\";\nimport { captureException } from \"@/error/sentry\";\n\nexport function logError(\n error: unknown,\n to: RouteLocationNormalizedGeneric,\n from: RouteLocationNormalizedGeneric,\n) {\n if (!(error instanceof CancelError)) {\n void captureException(error, {\n navigation: { from: from.fullPath, to: to.fullPath },\n });\n }\n}\n","import { sender } from \"@/backend/Sender\";\nimport type { Shape } from \"@/model/shape\";\nimport { useBoardStore } from \"@/store/board\";\nimport { useBoardsStore } from \"@/store/boards\";\nimport { useDrawStore } from \"@/store/draw\";\n\nimport { action, ctxAction, defineActions } from \"./actions\";\n\nexport const drawActions = defineActions(\"draw\", {\n addShape: action(async (shape: Shape) => {\n const boardId = useBoardStore().currentBoard().id;\n shape.id = await sender.addShape(boardId, shape);\n return useBoardsStore().addShape(boardId, shape);\n }),\n editShape: ctxAction((ctx, shape: Shape) => {\n const boardId = useBoardStore().currentBoard().id;\n useBoardsStore().editShape(boardId, shape);\n sender.editShape(boardId, shape);\n ctx.track(null);\n }),\n removeShape: action(\n (id: string) => {\n const boardId = useBoardStore().currentBoard().id;\n useBoardsStore().removeShape(boardId, id);\n sender.removeShape(boardId, id);\n useDrawStore().selected = null;\n },\n { name: /*$t*/ \"general.delete\" },\n ),\n});\n","import { type Ref, onBeforeUnmount, onMounted } from \"vue\";\n\nimport { dragScroll } from \"@/components/gestures/dragScroll\";\n\nexport function useDragScroll(el: Ref) {\n let dragScroller: ReturnType;\n\n onMounted(() => {\n dragScroller = dragScroll(el.value!);\n dragScroller.enable();\n });\n\n onBeforeUnmount(() => dragScroller.disable());\n}\n","\n\n\n\n\n","\n\n\n","\n\n\n","\n\n\n\n\n","\n\n\n","import type { Ref } from \"vue\";\nimport { computed, ref, watchEffect } from \"vue\";\n\nexport type TextAlign = \"start\" | \"center\" | \"end\";\nconst MARGIN = { start: 10, end: 30 };\nconst PADDING = 5;\n\n/**\n * Helper to split a line/rect into two parts by a text\n */\nexport function useTextElement(\n textElem: Ref,\n refs: {\n x: Ref;\n y: Ref;\n width: Ref;\n height: Ref;\n text: Ref;\n align: Ref;\n },\n) {\n watchEffect(() => {\n if (textElem.value && refs.text.value) {\n cutText(textElem.value, refs.text.value);\n }\n });\n\n const textLen = ref(0);\n\n function cutText(textElem: SVGTextElement, text: string) {\n textElem.textContent = text;\n const allSpaces = MARGIN.start + MARGIN.end + 2 * PADDING;\n const maxLen = Math.max(0, size.value - allSpaces);\n let chars = text.length + 1;\n let len;\n do {\n chars--;\n len = textElem.getSubStringLength(0, chars);\n } while (len > maxLen);\n textElem.textContent = text.substring(0, chars);\n textLen.value = len;\n }\n\n function calcFirstEnd() {\n switch (refs.align.value) {\n case undefined:\n case \"start\":\n return MARGIN.start;\n case \"center\":\n return (size.value - textLen.value - 2 * PADDING) / 2;\n case \"end\":\n return size.value - textLen.value - 2 * PADDING - MARGIN.start;\n }\n }\n\n const hasText = computed(() => textLen.value > 0);\n const size = computed(() => (horizontal.value ? refs.width.value : refs.height.value));\n const horizontal = computed(() => refs.width.value > refs.height.value);\n const firstEnd = computed(calcFirstEnd);\n const secondStart = computed(() => firstEnd.value + 2 * PADDING + textLen.value);\n const textAttrs = computed(() => {\n return {\n x: refs.x.value + firstEnd.value + PADDING,\n y: refs.y.value + 3,\n transform: horizontal.value ? \"\" : `rotate(90, ${refs.x.value}, ${refs.y.value})`,\n };\n });\n\n return {\n hasText,\n textAttrs,\n horizontal,\n firstEnd,\n secondStart,\n };\n}\n","\n\n\n","\n\n\n","import type { Ref } from \"vue\";\nimport { computed, ref } from \"vue\";\n\nimport { useActionMenu } from \"@/components/ActionMenu/useActionMenu\";\nimport { minus } from \"@/math/coordinates\";\nimport type { Shape } from \"@/model/shape\";\n\nexport function useDrawActionMenu(shape: Ref) {\n const selectedEl = computed(() => {\n return shape.value\n ? document.getElementById(`shape-${shape.value.id}`) ?? undefined\n : undefined;\n });\n\n const horizontal = computed(() => {\n if (!shape.value) {\n return true;\n }\n const size = minus(shape.value.p1, shape.value.p0);\n return Math.abs(size.x) >= Math.abs(size.y);\n });\n\n return useActionMenu({\n referenceEl: selectedEl,\n open: computed(() => !!shape.value),\n disabled: ref(false),\n config: computed(() =>\n horizontal.value\n ? { placement: \"top\", offset: [0, 5] }\n : { placement: \"right\", offset: [0, 5] },\n ),\n });\n}\n","import type { Ref } from \"vue\";\nimport { onMounted } from \"vue\";\n\nimport { useNativeEvents } from \"@/composables/useNativeEvents\";\nimport type { WindowCoordinate } from \"@/model/coordinates\";\nimport { windowCoord } from \"@/model/coordinates\";\nimport { clientCoord } from \"@/utils/dom/coordinates\";\n\nconst pointerPos: {\n down: WindowCoordinate | null;\n current: WindowCoordinate;\n} = {\n down: null,\n current: windowCoord(0, 0),\n};\n\nexport function usePointerPosition(elem: Ref) {\n const { addEventListener } = useNativeEvents();\n onMounted(() => {\n addEventListener(elem.value, \"pointerdown\", down);\n addEventListener(elem.value, \"pointermove\", move);\n addEventListener(elem.value, \"pointerup\", up);\n addEventListener(elem.value, \"pointerout\", up);\n });\n\n function down(e: PointerEvent) {\n pointerPos.down = clientCoord(e);\n }\n\n function move(e: PointerEvent) {\n pointerPos.current = clientCoord(e);\n }\n\n function up() {\n pointerPos.down = null;\n }\n\n return {\n pointerPos,\n };\n}\n","import { minus, times } from \"@/math/coordinates\";\nimport type { Line, RelativeCoordinate } from \"@/model/coordinates\";\nimport { relativeCoord } from \"@/model/coordinates\";\n\nexport function useSvgShapes(width: number, height: number) {\n function rectAround(pos: RelativeCoordinate, size: number) {\n return {\n ...minus(times(pos, width, height), relativeCoord(size / 2, size / 2)),\n width: size,\n height: size,\n };\n }\n\n function rectAlong(line: Line, size: number) {\n const x = line.p0.x < line.p1.x ? [line.p0.x, line.p1.x] : [line.p1.x, line.p0.x];\n const y = line.p0.y < line.p1.y ? [line.p0.y, line.p1.y] : [line.p1.y, line.p0.y];\n return {\n x: x[0] * width - size / 2,\n y: y[0] * height - size / 2,\n width: (x[1] - x[0]) * width + size,\n height: (y[1] - y[0]) * height + size,\n };\n }\n\n function line(line: Line) {\n return {\n x1: line.p0.x * width,\n y1: line.p0.y * height,\n x2: line.p1.x * width,\n y2: line.p1.y * height,\n };\n }\n\n return {\n line,\n rectAroundPoint(size: number) {\n return (pos: RelativeCoordinate) => rectAround(pos, size);\n },\n rectAlongLine(size: number) {\n return (line: Line) => rectAlong(line, size);\n },\n };\n}\n","\n\n\n\n\n","\n\n\n","import { isFunction } from \"lodash-es\";\nimport { onBeforeUnmount } from \"vue\";\n\nimport type { Action } from \"@/action/types\";\nimport { noAccept } from \"@/components/shortcut/key\";\nimport type { AdHocAction, ShortcutOptions } from \"@/components/shortcut/shortcuts\";\nimport { doRegisterShortcut, doUnregisterShortcuts } from \"@/components/shortcut/shortcuts\";\nimport { captureMessage } from \"@/error/sentry\";\n\nexport function useShortcuts() {\n const component = Symbol();\n\n function registerShortcut(action: Action | AdHocAction, options?: ShortcutOptions): void {\n if (isFunction(action)) {\n if (action.data.shortcut.accept === noAccept) {\n captureMessage(\"register shortcut without shortcut\", {\n info: { action: action.data.id },\n });\n return;\n }\n doRegisterShortcut(\n component,\n action.data.shortcut.accept,\n () => action(\"keyboard-shortcut\"),\n options,\n );\n } else {\n doRegisterShortcut(component, action.key.accept, action.exec, options);\n }\n }\n\n onBeforeUnmount(() => {\n doUnregisterShortcuts(component);\n });\n\n return { registerShortcut };\n}\n","\n\n\n","\n\n\n\n\n","import { type Quadtree, quadtree } from \"d3-quadtree\";\nimport { clamp, throttle } from \"lodash-es\";\nimport { computed, ref, watch } from \"vue\";\n\nimport { boardActions } from \"@/action/boardActions\";\nimport { scrollNearBoarder } from \"@/components/utils/scroll\";\nimport { useNativeEvents } from \"@/composables/useNativeEvents\";\nimport { relativeClientCoord } from \"@/math/coordinate-systems\";\nimport {\n divided,\n insideRectangle,\n max,\n min,\n minus,\n plus,\n rectangle,\n rectangleSize,\n times,\n toSize,\n} from \"@/math/coordinates\";\nimport type { BoardCard } from \"@/model/card\";\nimport type { Rectangle, RelativeCoordinate } from \"@/model/coordinates\";\nimport { relativeCoord } from \"@/model/coordinates\";\nimport { useBoardStore } from \"@/store/board\";\nimport { useDrawStore } from \"@/store/draw\";\nimport { useModalStore } from \"@/store/modal\";\nimport { usePanModeStore } from \"@/store/panMode\";\nimport { useSelectionStore } from \"@/store/selection\";\nimport { useZoomStore } from \"@/store/zoom\";\nimport { clientCoord } from \"@/utils/dom/coordinates\";\n\nexport function useMultiSelectRect(width: number, height: number) {\n const { addEventListener, removeEventListeners } = useNativeEvents();\n\n const start = ref(relativeCoord(0, 0));\n const current = ref(relativeCoord(0, 0));\n const rect = ref | null>(null);\n let quadTree: Quadtree | null = null;\n\n const isSelecting = computed(() => useSelectionStore().isSelectingWithRect);\n const zooming = computed(() => useZoomStore().zooming);\n\n const addPadding = (coord: RelativeCoordinate): RelativeCoordinate => {\n const padding = {\n x: 2 / width,\n y: 2 / height,\n };\n\n return relativeCoord(\n clamp(coord.x, padding.x, 1 - padding.x),\n clamp(coord.y, padding.y, 1 - padding.y),\n );\n };\n\n const startDrawingRectangle = (event: PointerEvent) => {\n const target = event.target as HTMLElement;\n if (\n target.closest(\"[data-no-rectangle-select]\") ||\n useDrawStore().active ||\n useModalStore().isModalOpen() ||\n zooming.value\n ) {\n return;\n }\n const relativeCoord = addPadding(relativeClientCoord(event));\n\n start.value = current.value = relativeCoord;\n useSelectionStore().selecting = \"rect\";\n // reset selection\n boardActions.clearCardSelection(\"mouse\");\n\n // Build a QuadTree for efficient spatial queries.\n // This is O(n).\n const { cards } = useBoardStore().currentBoard();\n quadTree = quadtree()\n .x((card) => card.meta.pos.x)\n .y((card) => card.meta.pos.y)\n .addAll(Object.values(cards));\n };\n\n const updateRectangle = (event: PointerEvent) => {\n if (!isSelecting.value) return;\n scrollNearBoarder(clientCoord(event));\n\n current.value = addPadding(relativeClientCoord(event));\n rect.value = rectangle({\n from: min(start.value, current.value),\n to: max(start.value, current.value),\n });\n\n if (quadTree && rect.value) {\n throttledSelectStickiesInRectWithQuadTree(quadTree, rect.value);\n }\n };\n\n const finishDrawingRectangle = () => {\n if (isSelecting.value) {\n useSelectionStore().selecting = \"no\";\n\n // Final selection pass via loop in case stickies moved/created by other users,\n // while user was drawing multi-select rect. Otherwise, we would need to recreate or\n // update a QuadTree, which will make things slower.\n if (rect.value) selectStickiesInRectWithLoop(rect.value);\n rect.value = null;\n quadTree = null;\n }\n };\n\n const addEventListeners = () => {\n addEventListener(document, \"pointerdown\", (event: PointerEvent) => {\n if (event.buttons === 1) startDrawingRectangle(event);\n });\n\n addEventListener(document, \"pointermove\", (event: PointerEvent) => {\n updateRectangle(event);\n });\n\n addEventListener(document, \"pointerup\", (event: PointerEvent) => {\n if (event.buttons === 0) finishDrawingRectangle();\n });\n };\n\n const isMultiSelectRectActive = () => {\n return !usePanModeStore().active && !useModalStore().isModalOpen();\n };\n\n watch(\n isMultiSelectRectActive,\n (isActive) => {\n isActive ? addEventListeners() : removeEventListeners();\n },\n { immediate: true },\n );\n\n const multiSelectRect = computed(() => {\n if (!rect.value) return;\n const from = times(rect.value.p0, width, height);\n const to = times(rectangleSize(rect.value), width, height);\n return { ...from, ...toSize(to) };\n });\n\n return { multiSelectRect };\n}\n\n/**\n * Efficiently selects stickies inside a rectangle using a QuadTree.\n * Time Complexity: O(log n) on average for search.\n */\nfunction selectStickiesInRectWithQuadTree(\n quadTree: Quadtree,\n rect: Rectangle,\n) {\n const selectedCardIds: string[] = [];\n const coverRect = getSelectionBounds(rect);\n\n quadTree.visit((node, x0, y0, x1, y1) => {\n // Prune branches of the QuadTree that are outside the multi-select rectangle.\n if (x1 < coverRect.p0.x || y1 < coverRect.p0.y || x0 > coverRect.p1.x || y0 > coverRect.p1.y) {\n return true; // terminate this branch visit\n }\n\n // If node is a leaf (contains a sticky)\n if (!node.length) {\n const card = node.data;\n if (isCardSelectable(card, coverRect)) {\n selectedCardIds.push(card.data.id);\n }\n }\n });\n\n useBoardStore().setSelectedStickies(selectedCardIds);\n}\n\nconst throttledSelectStickiesInRectWithQuadTree = throttle(\n (quadTree: Quadtree, rect: Rectangle) => {\n selectStickiesInRectWithQuadTree(quadTree, rect);\n },\n 100,\n { leading: true, trailing: true },\n);\n\n/**\n * Selects stickies inside a rectangle using a simple loop.\n * Time Complexity: O(n).\n */\nfunction selectStickiesInRectWithLoop(rect: Rectangle) {\n const coverRect = getSelectionBounds(rect);\n const { cards } = useBoardStore().currentBoard();\n\n const selectedCardIds = Object.keys(cards).filter((id) => isCardSelectable(cards[id], coverRect));\n\n useBoardStore().setSelectedStickies(Array.from(selectedCardIds));\n}\n\nfunction getSelectionBounds(rect: Rectangle) {\n const halfCardSize = divided(useBoardStore().currentBoard().cardSize, 2);\n return rectangle({\n from: minus(rect.p0, halfCardSize),\n to: plus(rect.p1, halfCardSize),\n });\n}\n\nfunction isCardSelectable(card: BoardCard, coverRect: Rectangle) {\n return (\n !card.data.editor &&\n insideRectangle(card.meta.pos, coverRect) &&\n card.meta.mark !== \"filter-out\"\n );\n}\n","import { type Ref, computed, ref, watch } from \"vue\";\n\nimport { useActionMenu } from \"@/components/ActionMenu/useActionMenu\";\n\nexport function useSelectionActionMenu(\n rect: Ref,\n open: Ref,\n attrs: Ref,\n) {\n const menu = useActionMenu({\n referenceEl: rect,\n open,\n disabled: ref(false),\n config: computed(() => ({ placement: \"top\", offset: [0, 5] })),\n });\n\n watch(attrs, menu.updateMenu, { deep: true });\n\n return menu;\n}\n","import { computed, ref, watch } from \"vue\";\n\nimport { divided, max, min, minus, plus, times, toSize } from \"@/math/coordinates\";\nimport type { IdMap } from \"@/model/baseTypes\";\nimport type { BoardCard } from \"@/model/card\";\nimport type { RelativeCoordinate } from \"@/model/coordinates\";\nimport { relativeCoord } from \"@/model/coordinates\";\nimport { useActionStore } from \"@/store/action\";\nimport { useBoardStore } from \"@/store/board\";\nimport type { Drag } from \"@/store/dragging\";\nimport { useDraggingStore } from \"@/store/dragging\";\n\nconst PADDING = relativeCoord(-0.5, -0.5);\n\nexport function useStickyBoundingRect(width: number, height: number) {\n const pos = ref([]);\n watch(\n selectionAndDrag,\n ([drag, selection]) => {\n if (!useActionStore().previewing) {\n pos.value = dragPos(drag) ?? selectionPos(selection) ?? [];\n }\n },\n { immediate: true, deep: true },\n );\n\n function selectionAndDrag(): [IdMap, BoardCard[]] {\n return [useDraggingStore().dragging, useBoardStore().selectedStickies];\n }\n\n function dragPos(drag: IdMap) {\n const drags = Object.values(drag);\n if (drags.length > 1 && drags[0].type === \"card\") {\n return drags.map((d) => d.pos);\n }\n }\n\n function selectionPos(selection: BoardCard[]) {\n if (selection.length > 1) {\n return selection.map((card) => ({ ...card.meta.pos }));\n }\n }\n\n const boundingRect = computed(() => {\n if (pos.value.length === 0) {\n return;\n }\n const cardSize = divided(useBoardStore().currentBoard().cardSize, 2);\n const start = minus(min(...pos.value), cardSize);\n const end = plus(max(...pos.value), cardSize);\n const scaledStart = times(start, width, height);\n const scaledSize = times(minus(end, start), width, height);\n\n const baseRect = {\n ...minus(scaledStart, PADDING),\n ...toSize(plus(scaledSize, times(PADDING, 2))),\n };\n\n // Extra margin which will cover the stiky note outline too\n const extraMargin = 0.4;\n\n return {\n x: baseRect.x - extraMargin,\n y: baseRect.y - extraMargin,\n width: baseRect.width + extraMargin * 2,\n height: baseRect.height + extraMargin * 2,\n };\n });\n\n return { boundingRect };\n}\n","\n\n\n\n\n","\n\n\n","\n\n\n","\n\n\n\n\n","import { distance2 } from \"@/math/coordinates\";\nimport { longClickDist } from \"@/model/Settings\";\nimport type { WindowCoordinate } from \"@/model/coordinates\";\nimport { scrollCoord } from \"@/utils/dom/coordinates\";\nimport { eventTarget } from \"@/utils/dom/dom\";\n\nimport { isPinching } from \"./pinch\";\nimport { getPointer, mouseState } from \"./pointer\";\n\n//TODO make this a composable after boards are migrated to vue3\n\nlet longClickTimeout: number;\n\nexport function onLongClick(\n el: HTMLElement,\n longClick: number,\n handler: (param: { element: HTMLElement; pos: WindowCoordinate }) => void,\n) {\n el.addEventListener(\"pointerdown\", (e: PointerEvent) => {\n // cancel clicks on link drag\n if (eventTarget(e)!.classList.contains(\"link-drag\")) return;\n\n const id = e.pointerId;\n const scrollBefore = scrollCoord();\n const mouse = mouseState();\n\n longClickTimeout = window.setTimeout(() => {\n const pointer = getPointer(id);\n const noMove = pointer && distance2(pointer.pos, pointer.downPos) < longClickDist;\n const noScroll = scrollBefore.x === window.scrollX && scrollBefore.y === window.scrollY;\n const noClick = e.pointerType !== \"mouse\" || mouse.isButtonDownOnce();\n if (noMove && noScroll && noClick && !isPinching(id)) {\n handler({ element: el, pos: pointer.pos });\n }\n }, longClick);\n });\n}\n\nexport function cancelLongClick() {\n window.clearTimeout(longClickTimeout);\n}\n","import { Vue } from \"vue-class-component\";\n\nimport EventBus from \"@/composables/EventBus\";\nimport type { EventType, StickyNoteAction } from \"@/composables/useEventBus\";\nimport type { Board } from \"@/model/board\";\nimport type { Card } from \"@/model/card\";\n\nexport default class EventBusUser extends Vue {\n callbacks: Record void> = {};\n\n onSetting(name: string, callback: (e: unknown) => void) {\n this._onKeyEvent(\"setting\", name, callback);\n }\n\n onBoardSwitch(callback: () => void) {\n this._onEvent(\"boardSwitch\", callback);\n }\n\n onBoardLoaded(callback: (boardId: Board[\"id\"]) => void) {\n this._onEvent(\"boardLoaded\", (boardId: Board[\"id\"]) => callback(boardId));\n }\n\n onStickyNoteAction(\n id: Card[\"id\"] | null,\n action: T,\n callback: (action: Extract) => void,\n ) {\n this._onEvent(\"stickyNoteAction\", (e: StickyNoteAction) => {\n if (id === null && e.action === action) {\n callback(e as Extract);\n return;\n }\n\n if (e.id === id && e.action === action) {\n callback(e as Extract);\n }\n });\n }\n\n _onEvent(name: EventType, callback: (e?: any) => void) {\n this.callbacks[name] = callback;\n EventBus.on(name, callback);\n }\n\n _onKeyEvent(name: EventType, key: string, callback: (e: unknown) => void) {\n this._onEvent(name, (e) => {\n if (e.key === key) {\n callback(e.value);\n }\n });\n }\n\n unmounted() {\n for (const name in this.callbacks) {\n EventBus.off(name, this.callbacks[name]);\n }\n }\n}\n","import { Options, mixins } from \"vue-class-component\";\n\nimport EventBusUser from \"@/mixins/EventBusUser\";\nimport ShortcutUser from \"@/mixins/ShortcutUser\";\nimport type { Board } from \"@/model/board\";\nimport { NO_TEAM } from \"@/store/team\";\nimport { boardActivated, boardDeactivated } from \"@/utils/analytics/events\";\nimport { trackEvent } from \"@/utils/analytics/track\";\n\nimport { applyFullBoardSize } from \"../utils/boardSize\";\n\n@Options({})\nexport default class BoardBase extends mixins(ShortcutUser, EventBusUser) {\n active = false;\n\n // must be overridden by subclasses\n get board(): Board {\n return {} as Board;\n }\n\n activated() {\n this.applyBoardSize();\n this.active = true;\n this.trackBoardEvent(boardActivated);\n }\n\n deactivated() {\n this.active = false;\n this.trackBoardEvent(boardDeactivated);\n }\n\n applyBoardSize() {\n applyFullBoardSize();\n }\n\n // This must be callable by the parent component\n focus() {\n this.$el?.focus();\n }\n\n /**\n * Tracks the given board event (boardActivated or boardDeactivated)\n */\n trackBoardEvent(boardEvent: typeof boardActivated | typeof boardDeactivated) {\n const teamId = \"team\" in this.board ? this.board.team?.id : undefined;\n // when no session is found, a dummy NO_TEAM board is activated, don't track this\n if (teamId !== NO_TEAM.id) {\n trackEvent(\n boardEvent({\n type: this.board.type,\n id: this.board.id,\n artId: this.board.artId,\n teamId,\n }),\n );\n }\n }\n}\n","import { computed, nextTick, reactive, watch } from \"vue\";\nimport { Provide, Watch } from \"vue-property-decorator\";\n\nimport { cardActions } from \"@/action/cardActions\";\nimport { toggleActions } from \"@/action/toggleActions\";\nimport { dragScroll } from \"@/components/gestures/dragScroll\";\nimport { onLongClick } from \"@/components/gestures/longClick\";\nimport type { BoardContextMenuMode } from \"@/components/menu/BoardContextMenu/BoardContextMenu.vue\";\nimport BoardContextMenu from \"@/components/menu/BoardContextMenu/BoardContextMenu.vue\";\nimport { key, keys } from \"@/components/shortcut/key\";\nimport { calcBoardSize } from \"@/math/coordinate-systems\";\nimport { fakeZoom, longClick } from \"@/model/Settings\";\nimport type { BoardCard } from \"@/model/card\";\nimport { boardCoord } from \"@/model/coordinates\";\nimport type { Size } from \"@/model/size\";\nimport { useBoardStore } from \"@/store/board\";\nimport { useBoardSizeStore } from \"@/store/boardSize\";\nimport { useClientSettingsStore } from \"@/store/clientSettings\";\nimport { useContextMenuStore } from \"@/store/contextMenu\";\nimport { useDrawStore } from \"@/store/draw\";\nimport { useLinkStore } from \"@/store/link\";\nimport { usePanModeStore } from \"@/store/panMode\";\nimport { useSelectionStore } from \"@/store/selection\";\nimport { useSessionStore } from \"@/store/session\";\nimport { useToastStore } from \"@/store/toast\";\nimport { useUserStore } from \"@/store/user\";\nimport { useWorkModeStore } from \"@/store/workMode\";\nimport { useZoomStore } from \"@/store/zoom\";\nimport { clientCoord } from \"@/utils/dom/coordinates\";\nimport { eventTarget } from \"@/utils/dom/dom\";\n\nimport { applyFluidBoardSize } from \"../utils/boardSize\";\nimport BoardBase from \"./BoardBase\";\nimport type { BoardMeta } from \"./injectKeys\";\nimport { boardKey, boardMetaKey } from \"./injectKeys\";\n\ninterface CardSize extends Size {\n id: string;\n}\n\nexport default class FluidBoard extends BoardBase {\n zoomed = false;\n fixedFS = 0;\n boardSize = { width: 0, height: 0 };\n boardStore = useBoardStore();\n levelOfDetails: 0 | 1 | 2 = 0;\n rightClickActivatedPanMode = false; // Tracks if right click activated pan mode\n dragScroll!: ReturnType;\n\n @Provide({ to: boardMetaKey as symbol })\n boardMeta: BoardMeta = reactive({\n size: boardCoord(this.width, this.height),\n });\n\n @Watch(\"height\")\n @Watch(\"width\")\n onPropertyChange() {\n this.boardMeta.size.x = this.width;\n this.boardMeta.size.y = this.height;\n }\n\n @Provide({ to: boardKey as symbol })\n get boardData() {\n return computed(() => this.board);\n }\n\n get isFirstLoginAfterIterationStart() {\n const iterStart = useSessionStore().iterations.at(0)?.start.getTime();\n const now = Date.now();\n const lastLoginAt = this.lastLoginAt;\n\n if (!iterStart || !lastLoginAt) return false;\n\n return now > iterStart && lastLoginAt < iterStart;\n }\n\n get lastLoginAt() {\n const val = localStorage.getItem(\"lastLoginAt\") || \"0\";\n return parseInt(val);\n }\n\n setWorkingMode() {\n if (this.isFirstLoginAfterIterationStart) {\n useWorkModeStore().setWorkingMode(\"execution\");\n return;\n }\n\n const workingMode = useClientSettingsStore().workingMode;\n useWorkModeStore().setWorkingMode(workingMode);\n }\n\n setupPanModeWatcher() {\n watch(\n () => usePanModeStore().active,\n (isActive) => {\n if (isActive) {\n this.dragScroll.enable(this.rightClickActivatedPanMode);\n } else {\n this.dragScroll.disable();\n }\n },\n { immediate: true },\n );\n }\n\n mounted() {\n this.setWorkingMode();\n\n const el = this.$el as HTMLElement;\n onLongClick(el, longClick, (e) => {\n if (!useDrawStore().active && !useBoardStore().enlargedStickyNoteId) {\n cardActions.add(\"long-press-on-board\", { pos: e.pos }, true);\n }\n });\n let spaceActivatedPanMode = false; // Tracks if spacebar activated pan mode\n this.dragScroll = dragScroll(el);\n this.setupPanModeWatcher();\n el.addEventListener(\"pointerdown\", (e) => {\n if (useSelectionStore().isSelectingWithRect || e.button !== 2) return; // Only right-click\n\n const startX = e.clientX;\n const startY = e.clientY;\n let dragged = false;\n\n const onPointerMove = (e: PointerEvent) => {\n const dx = Math.abs(e.clientX - startX);\n const dy = Math.abs(e.clientY - startY);\n\n if (dx > 5 || dy > 5) {\n dragged = true;\n }\n\n if (!usePanModeStore().active) {\n toggleActions.showPanMode(\"internal\");\n this.rightClickActivatedPanMode = true;\n }\n };\n\n const onPointerUp = (e: PointerEvent) => {\n el.removeEventListener(\"pointermove\", onPointerMove);\n el.removeEventListener(\"pointerup\", onPointerUp);\n\n if (this.rightClickActivatedPanMode) {\n toggleActions.hidePanMode(\"internal\");\n this.rightClickActivatedPanMode = false;\n } else if (!dragged) {\n // don't open the context menu when clicking on the sticky note > textarea\n if (eventTarget(e)?.classList.contains(\"sticky-note-text-input\")) return;\n\n // Open context menu only if there was **no drag**\n useContextMenuStore().open(BoardContextMenu, {\n position: clientCoord(e),\n mode: \"mouse\" as BoardContextMenuMode,\n });\n }\n };\n\n el.addEventListener(\"pointermove\", onPointerMove);\n el.addEventListener(\"pointerup\", onPointerUp, { once: true });\n });\n this.globalShortcut(\n keys(\"Meta\", \"Control\"),\n () => {\n useSelectionStore().singleCard = true;\n setTimeout(() => {\n if (useSelectionStore().singleCard && useBoardStore().selectedStickies.length > 1) {\n useToastStore().show(/*$t*/ \"message.singleCardMode\");\n }\n }, 1000);\n },\n {\n up() {\n useSelectionStore().singleCard = false;\n },\n },\n );\n this.globalShortcut(\n key(\"KeyX\"),\n () => {\n useBoardStore().magnifying = true;\n el.style.cursor = \"zoom-in\";\n this.zoomed = false;\n\n setTimeout(() => {\n if (!this.zoomed) {\n useToastStore().show(/*$t*/ \"message.keepXPressed\");\n }\n }, 1000);\n },\n {\n up() {\n useBoardStore().magnifying = false;\n el.style.removeProperty(\"cursor\");\n },\n },\n );\n this.globalShortcut(\n key(\" \"),\n () => {\n if (!usePanModeStore().active) {\n toggleActions.showPanMode(\"keyboard-shortcut\");\n spaceActivatedPanMode = true;\n }\n },\n {\n up() {\n if (spaceActivatedPanMode) {\n toggleActions.hidePanMode(\"keyboard-shortcut\");\n spaceActivatedPanMode = false;\n }\n },\n },\n );\n }\n\n beforeUnmount() {\n this.dragScroll.disable();\n }\n\n activated() {\n window.addEventListener(\"resize\", this.onWindowResize);\n }\n\n deactivated() {\n window.removeEventListener(\"resize\", this.onWindowResize);\n }\n\n onWindowResize() {\n this.applyBoardSize();\n }\n\n blur() {\n this.$el?.blur();\n }\n\n get zoomFactor() {\n return useZoomStore().factor;\n }\n\n get boardHasCards() {\n return Object.keys(this.board.cards).length > 0;\n }\n\n get isZooming() {\n return useZoomStore().zooming;\n }\n\n @Watch(\"isZooming\")\n @Watch(\"boardStore.board.cardSize.factor\")\n @Watch(\"boardHasCards\")\n async onLevelOfDetailsChange() {\n await nextTick();\n\n if (!this.boardHasCards || this.isZooming) return;\n\n const boardEl = this.$el as HTMLElement;\n const sticky = boardEl.querySelector(\".sticky-note\");\n if (!sticky) return;\n\n const currentSize = sticky.getBoundingClientRect().width;\n if (currentSize === 0) return;\n\n if (currentSize <= 50) {\n this.levelOfDetails = 0;\n } else if (currentSize > 50 && currentSize <= 90) {\n this.levelOfDetails = 1;\n } else {\n this.levelOfDetails = 2;\n }\n }\n\n @Watch(\"boardStore.board\")\n onBoardChange() {\n // clear all pinned sticky notes when changing the board\n useLinkStore().removeAllMarks();\n }\n\n get height() {\n return this.boardSize.height * fakeZoom;\n }\n\n get width() {\n return this.boardSize.width * fakeZoom;\n }\n\n get fixedFontSize() {\n if (this.active) {\n this.fixedFS = 100 / this.zoomFactor;\n }\n return this.fixedFS;\n }\n\n get readOnly() {\n return !useUserStore().isAllowed(\"edit\");\n }\n\n @Watch(\"zoomFactor\")\n @Watch(\"margin\", { deep: true })\n onZoomOrSpaceChange() {\n if (useBoardStore().isCurrentBoardFluid) {\n this.applyBoardSize();\n }\n }\n\n get margin() {\n return useBoardSizeStore().scrollableMargin;\n }\n\n applyBoardSize() {\n const newBoardSize = calcBoardSize();\n\n this.boardSize.height = newBoardSize.height;\n this.boardSize.width = newBoardSize.width;\n\n applyFluidBoardSize(newBoardSize);\n useBoardSizeStore().size = newBoardSize;\n }\n\n getRelativeCardSizes(): CardSize[] {\n const res = new Array();\n\n const selector = \".board > .sticky-note\";\n\n const elements = document.querySelectorAll(selector);\n\n elements.forEach((el) => {\n const id = el.getAttribute(\"id\");\n const zIndex = parseInt(el.style.zIndex);\n\n if (!id) {\n // eslint-disable-next-line no-console\n console.error(\"No id found\");\n return;\n }\n\n const card = this.board.cards[id];\n const order = zIndex || card.meta.zIndex;\n res.push(this.calcRelativeCardSize(card, order));\n });\n\n return res.sort((a, b) => a.order - b.order);\n }\n\n calcRelativeCardSize(card: BoardCard, order: number): CardSize & { order: number } {\n return {\n id: card.data.id,\n left: card.meta.pos.x - this.board.cardSize.x / 2,\n top: card.meta.pos.y - this.board.cardSize.y / 2,\n width: this.board.cardSize.x,\n height: this.board.cardSize.y,\n order,\n };\n }\n}\n\nexport function fluidBoard(board: BoardBase) {\n return (board as any).boardComponent?.() || board;\n}\n","\n\n\n\n\n","\n\n\n\n\n\n\n","\n\n\n","import type { BoardCard } from \"@/model/card\";\nimport type { Link } from \"@/model/link\";\nimport { minFaded } from \"@/model/markMode\";\nimport { useBoardStore } from \"@/store/board\";\nimport type { LinkedCards } from \"@/store/link\";\nimport { useSearchMenuStore } from \"@/store/searchMenu\";\n\nexport function showLink(linked: LinkedCards) {\n const markMode = showIcon(linked.link)\n ? \"normal\"\n : minFaded(linked.from.meta.mark, linked.to.meta.mark);\n const search = useSearchMenuStore();\n return (\n !isHidden(linked.from) &&\n !isHidden(linked.to) &&\n ((useBoardStore().baseBoard.showPermanentLinks && markMode !== \"fade-out\") ||\n search.showCardLinks(linked.from) ||\n search.showCardLinks(linked.to) ||\n search.matchesLinkStates(linked.link)) &&\n isStateShown(linked.link)\n );\n}\n\nexport function showIcon(link: Link): boolean {\n return (\n useBoardStore().showRiskyLinks &&\n useSearchMenuStore().matchesLinkStates(link) &&\n [\"warn\", \"error\"].includes(link.state)\n );\n}\n\nfunction isHidden(c: BoardCard) {\n return c.meta.mark === \"hidden\";\n}\n\nfunction isStateShown(link: Link) {\n return !useBoardStore().showRiskyLinks || useSearchMenuStore().matchesLinkStates(link, true);\n}\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n","\n\n\n","import { fakeZoom } from \"@/model/Settings\";\n\nconst scaleAttr = \"data-scale\";\nconst scrollbarAdjusted = \"scrollbar-adjusted\";\n\n/**\n * Scale the element and zoom out right after, so it appears as before scaling.\n * As result this will increase width of scroll bar and will fix the problem\n * of slow scrolling in Chrome. Scaling is computed based on the current element\n * fontSize but won't exceed 10x scaling (to avoid extremely large scroll bar when font size\n * is too large).\n */\nexport function adjustScrollbarWidth(el: HTMLElement) {\n if (isInBoard(el)) {\n const fontSize = getComputedStyle(el).fontSize;\n const fontSizeBasedZoom = parseInt(fontSize, 10) / fakeZoom;\n const zoom = Math.min(fontSizeBasedZoom, 10);\n el.classList.add(scrollbarAdjusted);\n el.setAttribute(scaleAttr, \"\" + zoom);\n el.style.transformOrigin = \"top left\";\n setElementScale(el);\n }\n}\n\nfunction setElementScale(el: HTMLElement, set = true) {\n const zoom = el.getAttribute(scaleAttr);\n if (zoom) {\n if (set) {\n el.style.transform = \"scale(\" + +zoom + \")\";\n const percent = 100 / +zoom + \"%\";\n el.style.height = el.style.width = el.style.fontSize = percent;\n } else {\n el.style.transform = \"\";\n el.style.height = el.style.width = el.style.fontSize = \"\";\n }\n }\n}\n\nfunction isInBoard(el: Element | null) {\n while (el) {\n if (el.id === \"boards\") {\n return true;\n }\n el = el.parentElement;\n }\n}\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n\n\n\n","\n\n\n\n\n","import type { InjectionKey } from \"vue\";\n\nexport const sidePanelKey: InjectionKey<{ close: () => void }> = Symbol(\"sidePanel\");\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n","\n\n\n\n\n","export default \"__VITE_ASSET__BO1LloI7__\"","export default \"data:image/svg+xml,%3csvg%20width='18'%20height='18'%20viewBox='0%200%2018%2018'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20filter='url(%23filter0_i_532_1239)'%3e%3crect%20width='18'%20height='18'%20rx='4'%20fill='url(%23paint0_linear_532_1239)'/%3e%3c/g%3e%3cpath%20d='M3.85718%209.67234H5.75626V11.5714H7.10095V9.67234H9.00003V8.32764H7.10095V6.42856H5.75626V8.32764H3.85718V9.67234Z'%20fill='url(%23paint1_linear_532_1239)'/%3e%3cpath%20d='M10.9285%2012.8571H12.857V3.85714L10.9285%205.76243V12.8571Z'%20fill='url(%23paint2_linear_532_1239)'/%3e%3cdefs%3e%3cfilter%20id='filter0_i_532_1239'%20x='0'%20y='0'%20width='18'%20height='20'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='BackgroundImageFix'%20result='shape'/%3e%3cfeColorMatrix%20in='SourceAlpha'%20type='matrix'%20values='0%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%200%20127%200'%20result='hardAlpha'/%3e%3cfeOffset%20dy='2'/%3e%3cfeGaussianBlur%20stdDeviation='3'/%3e%3cfeComposite%20in2='hardAlpha'%20operator='arithmetic'%20k2='-1'%20k3='1'/%3e%3cfeColorMatrix%20type='matrix'%20values='0%200%200%200%201%200%200%200%200%201%200%200%200%200%201%200%200%200%200.1%200'/%3e%3cfeBlend%20mode='normal'%20in2='shape'%20result='effect1_innerShadow_532_1239'/%3e%3c/filter%3e%3clinearGradient%20id='paint0_linear_532_1239'%20x1='9'%20y1='0'%20x2='9'%20y2='18'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%234449D9'/%3e%3cstop%20offset='1'%20stop-color='%233506EF'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_532_1239'%20x1='6.42861'%20y1='6.42856'%20x2='6.42861'%20y2='11.5714'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='white'/%3e%3cstop%20offset='0.979167'%20stop-color='white'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_532_1239'%20x1='11.8928'%20y1='3.85714'%20x2='11.8928'%20y2='12.8571'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='white'/%3e%3cstop%20offset='0.979167'%20stop-color='white'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e\"","export default \"__VITE_ASSET__Qd30rGCJ__\"","\n\n\n\n\n","\n\n\n","\n\n\n\n\n","\n\n\n","\n\n\n\n\n","import type { FieldChangeName } from \"@/model/change\";\nimport type { Icon } from \"@/model/icon\";\n\nimport BoardChange from \"./components/change/BoardChange.vue\";\nimport FlagChange from \"./components/change/FlagChange.vue\";\nimport IterationChange from \"./components/change/IterationChange.vue\";\nimport LinkChange from \"./components/change/LinkChange.vue\";\nimport PointsChange from \"./components/change/PointsChange.vue\";\nimport PriorityChange from \"./components/change/PriorityChange.vue\";\nimport ReactionsChange from \"./components/change/ReactionsChange.vue\";\nimport RiskChange from \"./components/change/RiskChange.vue\";\nimport StatusChange from \"./components/change/StatusChange.vue\";\nimport TeamChange from \"./components/change/TeamChange.vue\";\nimport TextChange from \"./components/change/TextChange.vue\";\nimport TypeChange from \"./components/change/TypeChange.vue\";\nimport UserChange from \"./components/change/UserChange.vue\";\n\ninterface StickyChangesMeta {\n key: string;\n keyNew: string;\n keyField: string;\n component: unknown;\n icon: Icon;\n}\n\nexport const stickyChanges: {\n [name in FieldChangeName]: StickyChangesMeta;\n} = {\n // field changes\n text: {\n key: /*$t*/ \"stickyChange.summary\",\n keyNew: /*$t*/ \"stickyChange.summary.new\",\n keyField: /*$t*/ \"stickyChange.summary.field\",\n component: TextChange,\n icon: \"general/summary\",\n },\n type: {\n key: /*$t*/ \"stickyChange.stickyType\",\n keyNew: /*$t*/ \"stickyChange.stickyType.new\",\n keyField: /*$t*/ \"stickyChange.stickyType.field\",\n component: TypeChange,\n icon: \"general/sticky\",\n },\n points: {\n key: /*$t*/ \"stickyChange.storyPoints\",\n keyNew: /*$t*/ \"stickyChange.storyPoints.new\",\n keyField: /*$t*/ \"stickyChange.storyPoints.field\",\n component: PointsChange,\n icon: \"general/points\",\n },\n priority: {\n key: /*$t*/ \"stickyChange.wsjf\",\n keyNew: /*$t*/ \"stickyChange.wsjf.new\",\n keyField: /*$t*/ \"stickyChange.wsjf.field\",\n component: PriorityChange,\n icon: \"general/points\",\n },\n risk: {\n key: /*$t*/ \"stickyChange.risk\",\n keyNew: /*$t*/ \"stickyChange.risk.new\",\n keyField: /*$t*/ \"stickyChange.risk.field\",\n component: RiskChange,\n icon: \"board/risk\",\n },\n iterationId: {\n key: /*$t*/ \"stickyChange.iteration\",\n keyNew: /*$t*/ \"stickyChange.iteration.new\",\n keyField: /*$t*/ \"stickyChange.iteration.field\",\n component: IterationChange,\n icon: \"general/iteration\",\n },\n teamId: {\n key: /*$t*/ \"stickyChange.team\",\n keyNew: /*$t*/ \"stickyChange.team.new\",\n keyField: /*$t*/ \"stickyChange.team.field\",\n component: TeamChange,\n icon: \"org/team\",\n },\n reactions: {\n key: /*$t*/ \"stickyChange.reactions\",\n keyNew: \"\",\n keyField: /*$t*/ \"stickyChange.reactions.field\",\n component: ReactionsChange,\n icon: \"reaction/emoji\",\n },\n flagType: {\n key: /*$t*/ \"stickyChange.flag\",\n keyNew: /*$t*/ \"stickyChange.flag.new\",\n keyField: /*$t*/ \"stickyChange.flag.field\",\n component: FlagChange,\n icon: \"general/sticker\",\n },\n dependTeamId: {\n key: /*$t*/ \"stickyChange.dependsOn\",\n keyNew: /*$t*/ \"stickyChange.dependsOn.new\",\n keyField: /*$t*/ \"stickyChange.dependsOn.field\",\n component: TeamChange,\n icon: \"general/depend-on-team\",\n },\n assignee: {\n key: /*$t*/ \"stickyChange.assignee\",\n keyNew: /*$t*/ \"stickyChange.assignee.new\",\n keyField: /*$t*/ \"stickyChange.assignee.field\",\n component: UserChange,\n icon: \"general/user\",\n },\n reporter: {\n key: /*$t*/ \"stickyChange.reporter\",\n keyNew: /*$t*/ \"stickyChange.reporter.new\",\n keyField: /*$t*/ \"stickyChange.reporter.field\",\n component: UserChange,\n icon: \"general/user\",\n },\n status: {\n key: /*$t*/ \"stickyChange.status\",\n keyNew: /*$t*/ \"stickyChange.status.new\",\n keyField: /*$t*/ \"stickyChange.status.field\",\n component: StatusChange,\n icon: \"general/status\",\n },\n // other changes\n mirrorBoard: {\n key: \"\",\n keyNew: \"\",\n keyField: /*$t*/ \"stickyChange.mirror.field\",\n component: BoardChange,\n icon: \"action/mirror\",\n },\n link: {\n key: \"\",\n keyNew: \"\",\n keyField: /*$t*/ \"stickyChange.link.field\",\n component: LinkChange,\n icon: \"action/link\",\n },\n create: {\n key: \"\",\n keyNew: \"\",\n keyField: /*$t*/ \"stickyChange.created.field\",\n component: null,\n icon: \"action/add-new\",\n },\n delete: {\n key: \"\",\n keyNew: \"\",\n keyField: /*$t*/ \"stickyChange.deleted.field\",\n component: null,\n icon: \"action/delete\",\n },\n} as const;\n","\n\n\n\n\n","\n\n\n\n\n","import { groupBy, mapValues, sortBy } from \"lodash-es\";\nimport { v4 as uuid } from \"uuid\";\n\nimport type { Color } from \"@/model/baseTypes\";\nimport type { FieldChange, StickyChange, StickyChangeKind } from \"@/model/change\";\nimport { stickyActivityKeys } from \"@/model/change\";\nimport { useCardStore } from \"@/store/card\";\nimport { useStickyTypeStore } from \"@/store/stickyType\";\nimport { i18n } from \"@/translations/i18n\";\nimport { atDayStart } from \"@/utils/date\";\n\n// StickyChange with properties related to how it should be rendered\nexport interface DisplayableStickyChange extends StickyChange {\n id: string;\n expandable: boolean;\n}\n\ninterface StickyChangesByDay {\n date: Date;\n changes: DisplayableStickyChange[];\n}\n\nexport interface StickyChangesBySticky {\n id: string;\n changes: StickyChangesByKind;\n}\n\ntype StickyChangesByKind = Record;\n\nexport function groupByDay(changes: StickyChange[]): StickyChangesByDay[] {\n return toByDayList(groupByDayStart(changes));\n}\n\nexport function groupBySticky(changes: StickyChange[]): StickyChangesBySticky[] {\n return toByStickyList(mapValues(groupByStickyId(sortFields(changes)), groupByKind));\n}\n\nfunction toByStickyList(obj: Record): StickyChangesBySticky[] {\n return Object.entries(obj).map(([id, changes]) => ({ id, changes }));\n}\n\nfunction toByDayList(obj: Record): StickyChangesByDay[] {\n return Object.entries(obj).map(([date, changes]) => ({\n date: new Date(+date),\n changes: changes.map(makeDisplayable),\n }));\n}\n\nfunction sortFields(changes: StickyChange[]): StickyChange[] {\n return changes.map((change) => ({\n ...change,\n fields: sortFieldChanges(change.fields),\n }));\n}\n\nfunction sortFieldChanges(fields: FieldChange[]): FieldChange[] {\n return sortBy(fields, (field) => Object.values(stickyActivityKeys).indexOf(field.name));\n}\n\nfunction groupByDayStart(changes: StickyChange[]) {\n return groupBy(changes, (change) => atDayStart(change.timestamp).getTime());\n}\n\nfunction groupByStickyId(changes: StickyChange[]) {\n return groupBy(changes, (change) => change.stickyId);\n}\n\nfunction groupByKind(changes: StickyChange[]) {\n return groupBy(changes, (change) => change.kind) as StickyChangesByKind;\n}\n\nfunction makeDisplayable(change: StickyChange) {\n return {\n ...change,\n id: uuid(),\n expandable: isExpandable(change),\n };\n}\n\nfunction isExpandable(change: StickyChange) {\n return [\"update\", \"mirror\", \"unmirror\", \"link\", \"unlink\"].includes(change.kind);\n}\n\nfunction deletedCardField(change: StickyChangesBySticky, name: \"text\" | \"type\") {\n const fields = change.changes.delete?.[0].fields || [];\n return fields.find((field) => field.name === name)?.old as string;\n}\n\n/**\n * Extract the text and color from the card that the (compare) change belongs to\n * (even if the sticky was deleted)\n */\nexport function cardFromStickyChange(change: StickyChangesBySticky): {\n text: string;\n color: Color;\n} {\n // Use the card if it exists\n const card = useCardStore().cards[change.id];\n if (card) {\n return { text: card.text, color: card.type.color };\n }\n\n // If the card was deleted, use the data from the deletion event\n return {\n text: deletedCardField(change, \"text\") || \"\",\n color: useStickyTypeStore().findStickyType(deletedCardField(change, \"type\"))?.color || [\n 0.5, 0.5, 0.5, 1,\n ],\n };\n}\n\n// Cache of deleted cards, to show the correct text/type for updates that took place\n// before the card was deleted. Only the deletion event can be guaranteed to contain\n// the card's text & type, but since we load changes in reverse order, we can assume\n// that card's deletion will be the first change we load, so we can cache the values.\n// (Note: this still doesn't handle the case where the card was deleted after the timeframe,\n// but there's no nice way to handle that, so we'll just label that card (deleted))\nconst deletedCardCache: Record = {};\n\n/**\n * Extract the text and color from the card that the (log) change belongs to\n * (even if the sticky was deleted)\n */\nexport function cardFromLogChange(change: DisplayableStickyChange): { text: string; color: Color } {\n const card = useCardStore().cards[change.stickyId];\n\n // If card still exists, extract needed values from that\n if (card) {\n return { text: card.text, color: card.type.color };\n }\n\n const cardName =\n (change.fields.find((field) => field.name === \"text\")?.old as string) || // If card was deleted in this change, fetch the text/type from the change itself\n deletedCardCache[change.stickyId]?.cardName || // if this was an update to a later-deleted sticky, try to find the cached value\n \"\";\n const text = i18n.global.t(\"boardDiff.deletedCardText\", { cardName }).trim(); // 'cardName (deleted)'\n\n const typeName =\n (change.fields.find((field) => field.name === \"type\")?.old as string) || // same here, try to fetch the type from the change itself\n deletedCardCache[change.stickyId]?.typeName; // or from the cache -> if not, undefined (which makes the color grey)\n\n if (change.kind === \"delete\") {\n deletedCardCache[change.stickyId] = { cardName, typeName }; // Update the cache\n }\n\n return {\n text,\n color: useStickyTypeStore().findStickyType(typeName)?.color || [0.5, 0.5, 0.5, 1],\n };\n}\n","\n\n\n\n\n","import { isEqual } from \"lodash-es\";\nimport { ref, watch } from \"vue\";\n\nimport { sendStickyNoteAction } from \"@/composables/useEventBus\";\nimport { useActivityStore } from \"@/store/activity\";\nimport { useBoardStore } from \"@/store/board\";\n\nconst expandedItemId = ref(null);\nconst enlargedStickyId = ref(null);\n\nexport function useStickyChangeEnlarge() {\n watch(\n () => ({ ...useActivityStore().allFilters, tab: useActivityStore().tab }),\n async (newState, prevState) => {\n const board = useBoardStore().board;\n const somethingChanged = !isEqual(newState, prevState);\n\n if (board && somethingChanged) {\n expandedItemId.value = null;\n if (enlargedStickyId.value) {\n sendStickyNoteAction(enlargedStickyId.value, { action: \"shrink\" });\n enlargedStickyId.value = null;\n }\n }\n },\n { immediate: true },\n );\n\n function handleExpanded(opened: boolean, stickyId: string, itemId?: string) {\n const isDifferentItem = expandedItemId.value !== itemId;\n const isDifferentSticky = enlargedStickyId.value !== stickyId;\n\n if (!itemId) itemId = stickyId;\n\n if (opened) {\n if (\n expandedItemId.value !== null &&\n isDifferentItem &&\n enlargedStickyId.value &&\n isDifferentSticky\n ) {\n sendStickyNoteAction(enlargedStickyId.value, { action: \"shrink\" });\n }\n\n expandedItemId.value = itemId;\n enlargedStickyId.value = stickyId;\n\n sendStickyNoteAction(stickyId, {\n action: \"enlarge\",\n focus: false,\n trigger: \"sticky-changes-item-selected\",\n });\n return;\n }\n\n if (expandedItemId.value === itemId) {\n expandedItemId.value = null;\n enlargedStickyId.value = null;\n sendStickyNoteAction(stickyId, { action: \"shrink\" });\n }\n }\n\n return {\n expandedItemId,\n handleExpanded,\n };\n}\n","\n\n\n","\n\n\n","\n\n\n\n\n\n","\n\n\n\n\n","\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n","\n\n\n","\n\n\n\n\n","import type { ServerTime, TimerData } from \"@/model/timer\";\nimport { pad } from \"@/utils/general\";\n\nexport default class Duration {\n readonly value: number;\n\n constructor(value: number) {\n this.value = value;\n }\n\n static fromEnd(end: ServerTime, now: ServerTime) {\n return new Duration(Math.round((end - now) / 1000));\n }\n\n static fromTimer(timer: TimerData, now: ServerTime) {\n if (timer.state === \"running\") {\n return timer.end < now ? new Duration(0) : Duration.fromEnd(timer.end, now);\n }\n return new Duration(timer.duration);\n }\n\n nonNegative() {\n return this.value < 0 ? new Duration(0) : this;\n }\n\n hasEnded(lessThan: number) {\n return this.value <= 0 && this.value >= -lessThan / 1000;\n }\n\n withHours(n: number) {\n return new Duration(this.value + (n - this.hours) * 3600);\n }\n\n get hours() {\n return Math.floor(this.value / 3600);\n }\n\n get hourStr() {\n return pad(this.hours, 2);\n }\n\n get hasHours() {\n return !!this.hours;\n }\n\n withMinutes(n: number) {\n return this.plusMinutes(n - this.minutes);\n }\n\n plusMinutes(n: number) {\n return new Duration(this.value + n * 60);\n }\n\n get minutes() {\n return Math.floor(this.value / 60) - this.hours * 60;\n }\n\n get minuteStr() {\n return pad(this.minutes, 2);\n }\n\n get hasMinutes() {\n return this.hasHours || !!this.minutes;\n }\n\n withSeconds(n: number) {\n return new Duration(this.value + n - this.seconds);\n }\n\n get seconds() {\n return this.value % 60;\n }\n\n get secondStr() {\n return pad(this.seconds, 2);\n }\n\n get hasSeconds() {\n return this.hasMinutes || !!this.seconds;\n }\n\n end(now: ServerTime): ServerTime {\n return (now + this.value * 1000) as ServerTime;\n }\n\n get hourFraction() {\n return Math.min(1, this.value / 3600);\n }\n}\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","import type { TippyOptions } from \"vue-tippy\";\n\nexport const TOP_MENU_OFFSET: TippyOptions[\"offset\"] = [0, 16];\n","import { searchFilterOpened } from \"@/utils/analytics/events\";\nimport { trackEvent } from \"@/utils/analytics/track\";\n\nexport function trackFilterOpen(name: string) {\n trackEvent(searchFilterOpened(name));\n}\n","\n\n\n","\n\n\n","\n\n\n\n\n","\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","import { defineStore } from \"pinia\";\nimport { ref, watch } from \"vue\";\nimport { useRoute } from \"vue-router\";\n\nimport EventBus from \"@/composables/EventBus\";\nimport { sendStickyNoteAction } from \"@/composables/useEventBus\";\nimport type { QueryImpl, SearchQuery } from \"@/router/types\";\n\nimport { useBoardStore } from \"./board\";\n\nexport const useUrlStore = defineStore(\"url\", () => {\n const search = ref({});\n\n const route = useRoute();\n\n let stickyIdsToEnlarge = new Array();\n EventBus.on(\"boardLoaded\", (boardId: string) => {\n if (boardId === useBoardStore().board?.id) {\n if (stickyIdsToEnlarge.length === 1) {\n sendStickyNoteAction(stickyIdsToEnlarge[0], {\n action: \"enlarge\",\n trigger: \"url\",\n });\n } else if (stickyIdsToEnlarge.length > 1) {\n stickyIdsToEnlarge.forEach(useBoardStore().selectSticky);\n }\n stickyIdsToEnlarge = [];\n }\n });\n\n let fromQuery: QueryImpl = {};\n watch(\n route,\n () => {\n const toQuery = route.query as QueryImpl;\n if (\n toQuery.searchText !== fromQuery.searchText ||\n toQuery.searchFlag !== fromQuery.searchFlag ||\n toQuery.searchAssignee !== fromQuery.searchAssignee ||\n toQuery.searchTeam !== fromQuery.searchTeam ||\n toQuery.searchArt !== fromQuery.searchArt ||\n toQuery.searchIteration !== fromQuery.searchIteration ||\n toQuery.searchType !== fromQuery.searchType ||\n toQuery.searchDepLink !== fromQuery.searchDepLink ||\n toQuery.searchStatusClass !== fromQuery.searchStatusClass ||\n toQuery.searchLink !== fromQuery.searchLink ||\n toQuery.searchPos !== fromQuery.searchPos\n ) {\n search.value = toSearchQuery(toQuery);\n }\n if (toQuery.stickyId) {\n stickyIdsToEnlarge = toQuery.stickyId.split(\",\");\n }\n fromQuery = { ...toQuery };\n },\n { immediate: true },\n );\n\n return { search };\n});\n\nfunction toSearchQuery(q: QueryImpl): SearchQuery {\n return {\n text: q.searchText,\n flag: q.searchFlag,\n assignee: q.searchAssignee,\n team: q.searchTeam,\n art: q.searchArt,\n iteration: q.searchIteration,\n type: q.searchType,\n depLink: q.searchDepLink,\n link: q.searchLink,\n statusClass: q.searchStatusClass,\n pos: q.searchPos,\n };\n}\n","\n\n\n\n\n","import type { Board } from \"@/model/board\";\nimport { isSolutionBoard } from \"@/model/board\";\nimport type { BoardCard } from \"@/model/card\";\nimport type { DependencyTeamFilter } from \"@/model/search\";\nimport { isDependency } from \"@/model/stickyType\";\nimport { useBoardStore } from \"@/store/board\";\nimport { getLinkTargetId, linkBetween, useLinkStore } from \"@/store/link\";\nimport { useSearchMenuStore } from \"@/store/searchMenu\";\nimport { noUser } from \"@/store/user\";\nimport { toCssColor, white } from \"@/utils/color\";\nimport { matches } from \"@/utils/list\";\n\nexport class CardMatcher {\n constructor(\n private searchMenuStore: ReturnType,\n private card: BoardCard,\n ) {}\n\n get textMatches(): boolean {\n // Use same matching algo as in the backend piplanningserver/piserver/repos/mongo/sticky.py\n // -> Match ALM id to full query string\n // -> Match any word in the query string to any word in the text\n const searchText = this.searchMenuStore.text.toLowerCase();\n const searchWords = searchText.split(/\\s+/).filter(Boolean);\n // filter(Boolean) to handle multiple spaces in the search query, since str.includes('') always returns true\n\n return (\n searchText.length === 0 ||\n (this.card.data.almId || \"\").toLowerCase().includes(searchText) ||\n searchWords.some((word) => this.card.data.text.toLowerCase().includes(word))\n );\n }\n\n get statusClassMatches(): boolean {\n return matches(this.searchMenuStore.statusClasses, this.card.data.status?.statusClass);\n }\n\n get flagMatches(): boolean {\n return (\n this.searchMenuStore.flags.length === 0 ||\n this.searchMenuStore.flags.some((flag) => flag.equals(this.card.data.flagType))\n );\n }\n\n get iterationMatches(): boolean {\n return matches(this.searchMenuStore.selectedIterations, this.card.data.iterationId, \"id\");\n }\n\n get assigneeMatches(): boolean {\n return matches(\n this.searchMenuStore.selectedAssignees,\n this.card.data.assignee?.id || noUser(toCssColor(white)).id,\n \"id\",\n );\n }\n\n get artMatches(): boolean {\n if (!isSolutionBoard(useBoardStore().currentBoard().type) || this.applyDependencySearch) {\n return true;\n }\n return matches(this.searchMenuStore.selectedArts, this.card.data.artId, \"id\");\n }\n\n get teamMatches(): [boolean, DependencyTeamFilter | null] {\n if (this.applyDependencySearch && this.searchMenuStore.effectiveTeamIds.size) {\n const dependTeamMatch = this.searchMenuStore.isTeamSelected(this.card.data.dependTeam?.id);\n const precondTeamMatch = this.searchMenuStore.isTeamSelected(this.card.data.precondTeam?.id);\n\n switch (this.searchMenuStore.selectedDependencyTeamFilter) {\n case \"Incoming\":\n return [precondTeamMatch, \"Incoming\"];\n case \"Outgoing\":\n return [dependTeamMatch, \"Outgoing\"];\n case \"Mutual\":\n return [dependTeamMatch && precondTeamMatch, \"Mutual\"];\n case \"IncomingAndOutgoing\":\n return [dependTeamMatch || precondTeamMatch, precondTeamMatch ? \"Incoming\" : \"Outgoing\"];\n }\n }\n if (useBoardStore().currentBoard().type === \"solution\") {\n return [true, null];\n }\n return [matches(this.searchMenuStore.selectedTeams, this.card.data.teamId, \"id\"), null];\n }\n\n get applyDependencySearch() {\n return this.searchMenuStore.isDependencySearch && isDependency(this.card.data);\n }\n\n typeMatches(board: Board): boolean {\n const typeMatch = matches(\n this.searchMenuStore.selectedStickyTypes,\n this.card.data.type.id,\n \"id\",\n );\n\n const selectedDependencyLink = this.searchMenuStore.selectedDependencyLink;\n\n if (typeMatch && isDependency(this.card.data) && selectedDependencyLink.size > 0) {\n const anyLinks: boolean = Object.values(board.cards).some((boardCard) =>\n linkBetween(boardCard.data, this.card.data),\n );\n\n return (\n (selectedDependencyLink.has(\"Linked\") && anyLinks) ||\n (selectedDependencyLink.has(\"Not Linked\") && !anyLinks)\n );\n }\n\n return typeMatch;\n }\n\n explicitLinkMatch(board: Board): boolean {\n return this.card.data.links.some(\n (link) =>\n useSearchMenuStore().matchesLinkStates(link) &&\n useLinkStore().boardCardByLink(getLinkTargetId(this.card.data, link), board),\n );\n }\n}\n","import { Vue } from \"vue-class-component\";\n\nimport type CardFlag from \"@/model/CardFlag\";\nimport type { InfoLevel, StatusClass } from \"@/model/baseTypes\";\nimport { statusClasses as allStatusClasses } from \"@/model/baseTypes\";\nimport type { Board } from \"@/model/board\";\nimport type { BoardCard } from \"@/model/card\";\nimport type { StickyType } from \"@/model/stickyType\";\nimport { replaceQuery } from \"@/router/navigation\";\nimport type { SearchQuery } from \"@/router/types\";\nimport { useBoardStore } from \"@/store/board\";\nimport { resetCardMark, setSearchCardMark } from \"@/store/helpers/mark\";\nimport type { DependencyLink } from \"@/store/searchMenu\";\nimport { dependencyLinks, useSearchMenuStore } from \"@/store/searchMenu\";\nimport { equals, fromString, join } from \"@/utils/list\";\n\nimport { CardMatcher } from \"./CardMatcher\";\n\nexport default class SearchItemBase extends Vue {\n store = useSearchMenuStore();\n\n get flags(): CardFlag[] {\n return this.store.flags;\n }\n\n get text() {\n return this.store.text;\n }\n\n set text(value: string) {\n this.store.text = value;\n }\n\n get selectedRiskyLinks() {\n return this.store.selectedRiskyLinks;\n }\n\n get selectedStatusClasses(): Set {\n return this.store.selectedStatusClasses;\n }\n\n get types() {\n return this.store.selectedStickyTypes;\n }\n\n get allTeams() {\n return this.store.allTeams;\n }\n\n get allArts() {\n return this.store.allArts;\n }\n\n get allIterations() {\n return this.store.allIterations;\n }\n\n get iterations() {\n return this.store.selectedIterations;\n }\n\n get assignees() {\n return this.store.selectedAssignees;\n }\n\n get teams() {\n return this.store.selectedTeams;\n }\n\n get arts() {\n return this.store.selectedArts;\n }\n\n get allTypes(): StickyType[] {\n return useBoardStore().possibleStickyTypes;\n }\n\n clearSearchCriteria() {\n this.store.resetCriteria();\n this.updateSearch();\n }\n\n /** Populates search criterias from search query\n * @returns {boolean | null} Indicates that the search got populated with some values.\n * Returns null if the input criteria matches the previous state.\n */\n applySearchQuery(value: SearchQuery): boolean | null {\n const anySearchCriteria =\n value.text !== undefined ||\n value.flag !== undefined ||\n value.assignee !== undefined ||\n value.team !== undefined ||\n value.art !== undefined ||\n value.iteration !== undefined ||\n value.type !== undefined ||\n value.depLink !== undefined ||\n value.link !== undefined ||\n value.statusClass !== undefined;\n if (!anySearchCriteria) {\n this.clearSearchCriteria();\n return false;\n }\n const text = value.text || \"\";\n const flags = value.flag ? value.flag.split(\",\") : [];\n const assignees = value.assignee ? value.assignee.split(\",\") : [];\n const teams = fromString(this.allTeams, value.team, \"name\");\n const arts = fromString(this.allArts, value.art, \"name\");\n const iterations = fromString(this.allIterations, value.iteration, \"name\");\n const types: StickyType[] = fromString(this.allTypes, value.type, \"name\");\n const depLinks: DependencyLink[] = types.some((type) => type.functionality === \"dependency\")\n ? fromString(dependencyLinks, value.depLink)\n : [];\n\n const statusClasses: StatusClass[] = fromString(allStatusClasses, value.statusClass);\n const links = value.link ? (value.link.split(\",\") as InfoLevel[]) : [];\n if (\n this.store.text === text &&\n equals(\n this.flags.map((f) => f.toString()),\n flags,\n ) &&\n equals(\n this.assignees.map(({ id }) => id),\n assignees,\n ) &&\n equals(this.teams, teams) &&\n equals(this.iterations, iterations) &&\n equals(this.arts, arts) &&\n equals(this.types, types) &&\n equals(this.store.statusClasses, statusClasses) &&\n equals(this.selectedRiskyLinks, links) &&\n equals(this.store.selectedDependencyLinks, depLinks)\n ) {\n return null;\n }\n\n this.store.text = text;\n this.store.selectedFlagStrings = new Set(flags);\n this.store.selectedAssigneeIds = new Set(assignees);\n this.store.selectedTeamIds = new Set(teams.map((team) => team.id));\n this.store.selectedArtIds = new Set(arts.map((art) => art.id));\n this.store.selectedIterationIds = new Set(iterations.map((iteration) => iteration.id));\n this.store.selectedStickyTypeIds = new Set(types.map((stickyType) => stickyType.id));\n this.store.selectedStatusClasses = new Set(statusClasses);\n this.store.selectedLinkStates = new Set(links);\n this.store.selectedDependencyLink = new Set(depLinks);\n return true;\n }\n\n updateSearch() {\n // implemented by firstUsers of this mixin\n }\n\n updateRoute(foundIndex: number) {\n const search: SearchQuery = {\n text: this.store.text,\n flag: join(this.flags),\n assignee: join(this.assignees, \"id\"),\n team: join(this.teams, \"name\"),\n art: join(this.arts, \"name\"),\n iteration: join(this.iterations, \"name\"),\n type: join(this.types, \"name\"),\n depLink: join(this.store.selectedDependencyLinks),\n statusClass: join(this.store.statusClasses),\n link: join(this.selectedRiskyLinks),\n };\n if (foundIndex) {\n search.pos = \"\" + foundIndex;\n }\n void replaceQuery({ search });\n }\n\n // TODO make the board responsible for marking search results? (like objectives board)\n matches(board: Board, card: BoardCard): boolean {\n // If there are no search criteria, don't list any results\n // (but don't grey out any cards, either)\n if (!this.store.anyFilterCriteria) {\n resetCardMark(card);\n return false;\n }\n const cardMatcher = new CardMatcher(this.store, card);\n const [teamMatch, dependencyTeamFilter] = cardMatcher.teamMatches;\n const typeMatch = cardMatcher.typeMatches(board);\n\n const explicitLinkMatch = cardMatcher.explicitLinkMatch(board);\n const linkMatch = !this.linkSearch || this.selectedRiskyLinks.length === 0 || explicitLinkMatch;\n const propMatch =\n (cardMatcher.flagMatches &&\n teamMatch &&\n cardMatcher.iterationMatches &&\n cardMatcher.assigneeMatches &&\n cardMatcher.artMatches &&\n typeMatch &&\n cardMatcher.statusClassMatches &&\n linkMatch) ||\n explicitLinkMatch;\n const matchesCard = cardMatcher.textMatches && propMatch;\n setSearchCardMark(card, matchesCard, !propMatch, dependencyTeamFilter);\n return matchesCard;\n }\n\n get selectedDependencyLink() {\n return this.store.selectedDependencyLink;\n }\n\n get selectedDependencyTeamFilter() {\n return this.store.selectedDependencyTeamFilter;\n }\n\n get linkSearch() {\n return useBoardStore().showRiskyLinks;\n }\n}\n","import { groupBy, sortBy } from \"lodash-es\";\n\nimport { boardTitle } from \"@/model/baseTypes\";\nimport { boardTypeOrder } from \"@/model/board\";\nimport type { BaseStickyInfo, BoardCard } from \"@/model/card\";\nimport type { SearchResult } from \"@/model/search\";\nimport type { Team } from \"@/model/session\";\nimport { useArtStore } from \"@/store/art\";\nimport { useBoardStore } from \"@/store/board\";\nimport { useBoardsStore } from \"@/store/boards\";\nimport { useSearchMenuStore } from \"@/store/searchMenu\";\nimport { useSessionStore } from \"@/store/session\";\nimport { useStickyTypeStore } from \"@/store/stickyType\";\nimport { i18n, translate } from \"@/translations/i18n\";\n\nexport type CardSearchResult = SearchResult & { card?: BoardCard };\n\nexport interface StickyInfoKey {\n id: string;\n boardId?: string;\n teamId?: string;\n}\n\nexport function toSearchResult(\n boardCard: BoardCard,\n boardId = useBoardStore().boardId(),\n): CardSearchResult {\n const card = boardCard.data;\n return {\n kind: \"sticky\",\n boardId,\n id: card.id,\n text: card.text,\n typeId: card.type.id,\n iterationId: card.iterationId || undefined,\n teamId: card.teamId || undefined,\n flag: card.flagType,\n almId: card.almId,\n card: boardCard,\n artId: useBoardsStore().boardById(boardId).artId,\n status: card.status,\n };\n}\n\ninterface SearchResultGroupByArt {\n artId: string;\n artName: string;\n boards: GroupedSearchResults[];\n}\n\nexport interface GroupedSearchResults {\n boardId: string;\n boardName: string;\n count: string;\n items: BaseStickyInfo[];\n}\n\nconst kindNames = {\n unknown: /*$t*/ \"searchResultsTs.results\",\n sticky: /*$t*/ \"searchResultsTs.stickies\",\n};\n\nexport function sortSearchResults(results: SearchResult[]): SearchResult[] {\n return sortBy(\n results,\n ({ boardId }) => boardTypeOrder(useBoardsStore().boardById(boardId).type),\n ({ boardId }) => translate(boardTitle(useBoardsStore().boardById(boardId))),\n );\n}\n\nexport function groupSearchResultsByArt(results: SearchResult[]): SearchResultGroupByArt[] {\n const groups = groupBy(results, (result) => result.artId);\n\n return Object.entries(groups).map(([artId, items]) => {\n const art = useArtStore().artById(artId);\n const artName = ` ${art?.name || \"\"}`;\n return {\n artId,\n artName: artName,\n boards: groupSearchResults(items),\n };\n });\n}\n\nfunction mapSearchResult(item: SearchResult): BaseStickyInfo {\n const type = useStickyTypeStore().findStickyType(item.typeId);\n const findTeamById = (teamId: Team[\"id\"] | undefined) =>\n useSearchMenuStore().allTeams.find((team: Team) => team.id === teamId);\n return {\n id: item.id,\n text: item.text,\n type,\n flag: item.flag,\n iteration: useSessionStore().getIterationById(item.iterationId),\n almId: item.almId,\n points: item.points || 0,\n team: findTeamById(item.teamId),\n status: item.status,\n };\n}\n\nexport function groupSearchResults(results: SearchResult[]): GroupedSearchResults[] {\n const groups = groupBy(results, (result) => result.boardId);\n return Object.entries(groups).map(([boardId, items]) => ({\n boardId,\n boardName: translate(boardTitle(useBoardsStore().boardById(boardId))),\n count: countSearchResults(items),\n items: items.map((item) => mapSearchResult(item)),\n }));\n}\n\nexport function groupSearchResultsByType(\n items: BaseStickyInfo[],\n): Record {\n return groupBy(items, (item) => item.type.name);\n}\n\nexport function groupByTeamName(items: BaseStickyInfo[]): Record {\n const searchResultsGroupedByTeam = groupBy(items, (item) => {\n const { team } = item;\n\n if (!team) {\n return i18n.global.t(\"general.noTeam\");\n }\n\n return team.name;\n });\n return Object.fromEntries(Object.entries(searchResultsGroupedByTeam));\n}\n\nfunction countSearchResults(results: SearchResult[]) {\n const kind = kindNames[results[0]?.kind || \"unknown\"];\n return i18n.global.t(kind, results.length);\n}\n","/**\n * Executes two async actions sequentially.\n * A pending second action can be cancelled either by calling `cancel` or by executing another pair of actions.\n */\nexport default class SinglePendingPromise {\n seq = 0;\n\n async execute(action: () => Promise, thenAction: (arg: T) => void) {\n this.cancel();\n const startSeq = this.seq;\n const res = await action();\n if (startSeq === this.seq) {\n thenAction(res);\n }\n }\n\n cancel() {\n this.seq++;\n }\n}\n","\n\n\n\n\n","import { groupBy } from \"lodash-es\";\n\nimport type { BaseStickyInfo } from \"@/model/card\";\nimport { useBoardStore } from \"@/store/board\";\nimport { useSearchMenuStore } from \"@/store/searchMenu\";\nimport { NO_TEAM, useTeamStore } from \"@/store/team\";\nimport { i18n } from \"@/translations/i18n\";\n\nimport { groupByTeamName, groupSearchResultsByType } from \"./SearchResult\";\n\nexport function groupResults(items: BaseStickyInfo[]): Record {\n const typeGroupItems = resultsByType(items);\n\n const searchMenuStore = useSearchMenuStore();\n if (!searchMenuStore.isDependencySearch || !searchMenuStore.selectedTeams.length) {\n return typeGroupItems;\n }\n\n const dependencyStickyTypes = new Set(\n useBoardStore().possibleStickyTypes.flatMap((stickyType) =>\n stickyType.functionality === \"dependency\" ? stickyType.name : [],\n ),\n );\n\n const groupResultEntities = Object.entries(typeGroupItems).reduce(\n (groupResultEntities, typeResultGroupEntity) => {\n const [typeName, typeResultGroupItems] = typeResultGroupEntity;\n if (!dependencyStickyTypes.has(typeName)) {\n return [...groupResultEntities, typeResultGroupEntity];\n }\n\n return [...groupResultEntities, ...groupDependencyResults(typeResultGroupItems)];\n },\n new Array<[string, BaseStickyInfo[]]>(),\n );\n\n return Object.fromEntries(groupResultEntities);\n}\n\nfunction groupDependencyResults(resultGroupItems: BaseStickyInfo[]) {\n const findTeamIndex = (teamName: string) =>\n useTeamStore().teamsInCurrentArt.findIndex((team) => team.name === teamName);\n\n const redundantTypeResultGroupItems: BaseStickyInfo[] = resultGroupItems.flatMap((item) => {\n const dependencyTeamFilter = useSearchMenuStore().selectedDependencyTeamFilter;\n const { data: card } = useBoardStore().currentBoard().cards[item.id];\n const duppedItems = [];\n\n if (\n (dependencyTeamFilter === \"Incoming\" || dependencyTeamFilter === \"IncomingAndOutgoing\") &&\n useSearchMenuStore().isTeamSelected(card.precondTeam?.id)\n ) {\n duppedItems.push({\n ...item,\n team: card.precondTeam ?? NO_TEAM,\n });\n }\n if (\n (dependencyTeamFilter === \"Outgoing\" || dependencyTeamFilter === \"IncomingAndOutgoing\") &&\n useSearchMenuStore().isTeamSelected(card.dependTeam?.id)\n ) {\n duppedItems.push({\n ...item,\n team: card.dependTeam ?? NO_TEAM,\n });\n }\n if (\n dependencyTeamFilter === \"Mutual\" &&\n useSearchMenuStore().isTeamSelected(card.precondTeam?.id) &&\n useSearchMenuStore().isTeamSelected(card.dependTeam?.id)\n ) {\n duppedItems.push({\n ...item,\n team: card.dependTeam ?? NO_TEAM,\n });\n duppedItems.push({\n ...item,\n team: card.precondTeam ?? NO_TEAM,\n });\n }\n\n return duppedItems;\n });\n\n return Object.entries(groupByTeamName(redundantTypeResultGroupItems)).sort(\n ([a], [b]) => findTeamIndex(a) - findTeamIndex(b),\n );\n}\n\nfunction resultsByType(items: BaseStickyInfo[]): Record {\n return groupSearchResultsByType(items);\n}\n\nexport function groupSearchResultsByDependencyTeamFilter(items: BaseStickyInfo[]) {\n return groupBy(items, (item) => {\n const card = useBoardStore().currentBoard().cards[item.id];\n\n if (!card || item.team?.id === undefined) {\n return \"\";\n }\n\n if (item.team.id === (card.data.precondTeam?.id || NO_TEAM.id)) {\n return i18n.global.t(\"dependencyTeamFilter.incoming\");\n } else if (item.team.id === (card.data.dependTeam?.id || NO_TEAM.id)) {\n return i18n.global.t(\"dependencyTeamFilter.outgoing\");\n }\n return \"\";\n });\n}\n\nexport function showDependencyGroupingHeader(items: BaseStickyInfo[]) {\n return (\n items.length > 0 &&\n (useBoardStore().currentBoard().type !== \"program\" ||\n useSearchMenuStore().selectedTeams.length > 0)\n );\n}\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n","\n\n\n","\n\n\n","\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n","\n\n\n","\n\n\n","\n\n\n\n\n","\n\n\n","\n\n\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n","export default \"__VITE_ASSET__DIWkloTJ__\"","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n","\n\n\n\n\n","\n\n\n","\n\n\n\n\n","import { ref } from \"vue\";\n\nexport function useHoverable() {\n const hovered = ref(false);\n let timeout = 0;\n\n function hover() {\n hovered.value = true;\n clearTimeout(timeout);\n }\n\n function keep() {\n if (hovered.value) {\n window.clearTimeout(timeout);\n }\n }\n\n function unhover() {\n timeout = window.setTimeout(() => (hovered.value = false), 500);\n }\n\n return { hovered, hover, keep, unhover };\n}\n","\n\n\n\n\n","\n\n\n\n\n","\n\n\n","\n\n\n\n\n","\n\n\n\n\n","const styles = new Map();\n\ninterface StyleInfo {\n minFontSize: number;\n maxFontSize: number;\n lineHeightFactor: number;\n fontWeight: string;\n fontFamily: string;\n}\n\nexport function getStyleInfo(elem: SVGElement | HTMLElement): StyleInfo {\n let measure = styles.get(elem.className);\n if (!measure) {\n const style = window.getComputedStyle(elem);\n const fontSize = elem.style.fontSize;\n elem.style.fontSize = \"1px\";\n const minFontSize = parseFloat(style.fontSize);\n elem.style.fontSize = \"10000px\";\n const maxFontSize = parseFloat(style.fontSize);\n elem.style.fontSize = fontSize;\n measure = {\n minFontSize,\n maxFontSize,\n lineHeightFactor:\n style.lineHeight === \"normal\"\n ? 1.2\n : parseFloat(style.lineHeight) / parseFloat(style.fontSize),\n fontWeight: style.fontWeight,\n fontFamily: style.fontFamily,\n };\n styles.set(elem.className, measure);\n }\n return measure;\n}\n\nexport function clearStyles() {\n styles.clear();\n}\n","\n\n\n\n\n","\n\n\n\n\n","import { toggleActions } from \"@/action/toggleActions\";\nimport { sender } from \"@/backend/Sender\";\nimport { key } from \"@/components/shortcut/key\";\nimport { windowToRelative } from \"@/math/coordinate-systems\";\nimport { distance2 } from \"@/math/coordinates\";\nimport type ShortcutUser from \"@/mixins/ShortcutUser\";\nimport { pointerPosInterval } from \"@/model/Settings\";\nimport type { RelativeCoordinate } from \"@/model/coordinates\";\nimport { offScreen, windowCoord } from \"@/model/coordinates\";\nimport { useBoardStore } from \"@/store/board\";\nimport { usePointerStore } from \"@/store/pointer\";\nimport { clientCoord } from \"@/utils/dom/coordinates\";\n\nlet trailTimeout = 0;\nlet pos = windowCoord(0, 0);\nlet lastPos = windowCoord(0, 0);\n\nexport function trail(start: boolean) {\n clearTimeout(trailTimeout);\n if (start) {\n sendPos();\n } else {\n doSendPos(offScreen);\n }\n}\n\nfunction sendPos() {\n if (distance2(pos, lastPos) > 25) {\n doSendPos(windowToRelative(pos));\n lastPos = pos;\n }\n trailTimeout = window.setTimeout(sendPos, pointerPosInterval);\n}\n\nfunction doSendPos(p: RelativeCoordinate) {\n void sender.pointerPos(useBoardStore().currentBoard().id, p);\n usePointerStore().set({ pos: p });\n}\n\nexport function pointerTrail(component: ShortcutUser) {\n registerPointerEvents(component.$el as HTMLElement);\n registerShortcuts(component);\n}\n\nfunction registerShortcuts(comp: ShortcutUser) {\n comp.globalActionShortcut(toggleActions.showTrailingPointer);\n comp.globalShortcut(\n key(\"KeyA\"),\n () => {\n usePointerStore().togglePointerActivation();\n },\n {\n up() {\n usePointerStore().activatePointer(false);\n },\n },\n );\n}\n\nfunction registerPointerEvents(el: HTMLElement) {\n el.addEventListener(\"pointermove\", (e) => {\n pos = clientCoord(e);\n });\n\n el.addEventListener(\"pointerleave\", (_) => {\n pos = windowCoord(-10, 10);\n lastPos = pos;\n doSendPos(offScreen);\n });\n}\n","\n\n\n\n\n","import type BoardBase from \"@/components/board/BoardBase\";\nimport { applyFluidBoardSize, resetBoardScrollMargin } from \"@/components/utils/boardSize\";\nimport { calcBoardSize } from \"@/math/coordinate-systems\";\nimport { useBoardStore } from \"@/store/board\";\nimport { useZoomStore } from \"@/store/zoom\";\nimport type { ElementState } from \"@/utils/dom/dom\";\nimport { hideElements, showElements } from \"@/utils/dom/dom\";\nimport { disconnectObservers, reconnectObservers } from \"@/utils/dom/mutationObserver\";\nimport { nextTicks } from \"@/utils/vue\";\n\nimport type { ZoomLayer } from \"./ZoomLayer\";\n\n// for a small number of stickies, it's faster to NOT use the zoom layer\nconst useZoomLayerStickyNumber = 100;\n\nexport function zoomHandler(zoomLayer: ZoomLayer, currentBoard: () => BoardBase) {\n let zoomFactor = 0;\n let cardNodes: ElementState | null = null;\n let checkZoomTimeout = 0;\n const store = useZoomStore();\n\n return { startZoom, endZoom };\n\n async function startZoom() {\n if (useBoardStore().isCurrentBoardFluid) {\n disconnectObservers();\n zoomFactor = store.factor;\n const useLayer =\n Object.keys(useBoardStore().currentBoard().cards).length > useZoomLayerStickyNumber;\n if ((store.useZoomLayer = useLayer)) {\n await initZoomLayer();\n }\n checkZoom();\n }\n }\n\n function endZoom() {\n if (useBoardStore().isCurrentBoardFluid) {\n // Make sure the latest zoom was registered, but do not trigger recursive checks\n checkZoom(true);\n store.updateZoomFactor();\n resetBoardScrollMargin();\n if (store.useZoomLayer) {\n hideZoomLayer();\n }\n window.cancelAnimationFrame(checkZoomTimeout);\n // 3 is found by trial: check that the last tick takes (nearly) no time\n nextTicks(3, reconnectObservers);\n }\n }\n\n /**\n * Checks if the zoom factor has changed and updates the board size accordingly\n * By default, called recursively with requestAnimationFrame\n *\n * @param stop if true, stops the recursive call (stop is a number when triggered through requestAnimationFrame)\n */\n function checkZoom(stop?: boolean | number) {\n if (zoomFactor !== store.dynamicFactor) {\n zoomFactor = store.dynamicFactor;\n const size = calcBoardSize(zoomFactor);\n applyFluidBoardSize(size);\n store.scrollToCenter(size);\n }\n\n if (stop !== true) {\n checkZoomTimeout = window.requestAnimationFrame(checkZoom);\n }\n }\n\n async function initZoomLayer() {\n await zoomLayer.paintCards(currentBoard(), useBoardStore().currentBoard());\n // removing and adding cards directly using DOM (.1ms, .75ms) is around 2x faster that using vue.js (.2ms, 1.5ms)\n cardNodes = hideElements(document.querySelectorAll(\".card,.sticky-note\"));\n }\n\n function hideZoomLayer() {\n if (cardNodes) {\n showElements(cardNodes);\n cardNodes = null;\n }\n zoomLayer.hide();\n }\n}\n","\n\n\n\n\n","export default \"__VITE_ASSET____n1yito__\"","\n\n\n\n\n","export default \"data:image/svg+xml,%3csvg%20viewBox='0%200%20960%201079'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M960%200H0V1079H960V0Z'%20fill='%23001688'/%3e%3cmask%20id='mask0_147_8904'%20style='mask-type:alpha'%20maskUnits='userSpaceOnUse'%20x='0'%20y='0'%20width='961'%20height='1079'%3e%3cpath%20d='M960%200H0.000488281V1079H960V0Z'%20fill='%23001688'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_147_8904)'%3e%3crect%20width='1164.67'%20height='1167.29'%20transform='matrix(-0.444625%200.895717%20-0.89702%20-0.441989%20871.925%20-222.334)'%20fill='url(%23paint0_linear_147_8904)'/%3e%3crect%20width='798.524'%20height='798.524'%20transform='matrix(0.708414%20-0.705797%200.708414%200.705797%20339%20995.993)'%20fill='url(%23paint1_linear_147_8904)'/%3e%3crect%20width='399.154'%20height='399.37'%20transform='matrix(-0.654685%20-0.755902%200.758293%20-0.651914%20-101.68%20670.674)'%20fill='url(%23paint2_linear_147_8904)'/%3e%3crect%20width='299.619'%20height='299.274'%20transform='matrix(-0.810705%20-0.585455%200.588303%20-0.808641%20568.87%201312.75)'%20fill='url(%23paint3_linear_147_8904)'/%3e%3crect%20width='299.802'%20height='299.091'%20transform='matrix(0.906679%200.421822%20-0.424393%200.905478%20853.932%20-162.398)'%20fill='url(%23paint4_linear_147_8904)'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_147_8904'%20x1='582.314'%20y1='1167.28'%20x2='582.314'%20y2='-0.0330492'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23ff0016'/%3e%3cstop%20offset='1'%20stop-color='%23001688'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_147_8904'%20x1='399.247'%20y1='798.517'%20x2='399.247'%20y2='-0.0226084'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23ff0016'/%3e%3cstop%20offset='1'%20stop-color='%23001688'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_147_8904'%20x1='199.569'%20y1='399.367'%20x2='199.569'%20y2='-0.0113073'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23ff0016'/%3e%3cstop%20offset='1'%20stop-color='%23001688'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint3_linear_147_8904'%20x1='149.804'%20y1='299.271'%20x2='149.804'%20y2='-0.00847327'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23ff0016'/%3e%3cstop%20offset='1'%20stop-color='%23001688'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint4_linear_147_8904'%20x1='149.895'%20y1='299.088'%20x2='149.895'%20y2='-0.00846808'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23ff0016'/%3e%3cstop%20offset='1'%20stop-color='%23001688'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e\"","import { handleError } from \"@/error/errorHandler\";\nimport { captureMessage } from \"@/error/sentry\";\nimport type { Tenant } from \"@/model/session\";\nimport AuthService from \"@/services/auth.service\";\nimport { neverResolve } from \"@/utils/general\";\n\nexport async function login(email: string, type = \"\", path = \"\", tenantId = \"\"): Promise {\n let res;\n try {\n res = await AuthService.login({\n tenantId,\n email,\n type,\n path,\n });\n } catch (err: any) {\n const errorMessage = err.response?.data?.error || err.message || \"Could not log in\";\n if (err.response?.status !== 401) {\n handleError(err, \"Unexpected error while trying to log in\");\n } else if (!isWrongEmail(errorMessage)) {\n void captureMessage(`Unauthorized to log in: ${errorMessage}`);\n }\n throw errorMessage;\n }\n\n if (!res.data.success) {\n const errorMessage = res.data.error;\n void captureMessage(\"Error while trying to log in\", {\n response: { error: res.data.error },\n });\n throw errorMessage;\n }\n\n if (res.data.redirectUrl) {\n window.location.assign(res.data.redirectUrl);\n return neverResolve();\n }\n\n if (res.data.tenants) {\n return res.data.tenants;\n }\n\n throw Error(\"No data returned while trying to log in\");\n}\n\nfunction isWrongEmail(errorMessage: string) {\n return errorMessage === \"Invalid email\" || errorMessage === \"Invalid login\";\n}\n","\n\n\n\n\n","\n\n\n\n\n","import { noop } from \"lodash-es\";\nimport { onMounted, ref } from \"vue\";\n\nimport { environment } from \"@/utils/env/Environment\";\n\nexport function useServicePopups() {\n const openServices = ref<() => void>(noop);\n const showServices = ref(false);\n\n onMounted(() => {\n const host = document.location.host;\n if (\n environment !== \"production\" &&\n (host.startsWith(\"local.piplanning.io\") || host.startsWith(\"app.local.piplanning.io\"))\n ) {\n showServices.value = true;\n const popups: Array<{ url: string; window?: Window | null }> = [\n { url: \"https://api.local.piplanning.io\" },\n { url: \"https://nats.local.piplanning.io\" },\n { url: \"https://local.piplanning.io\" },\n ];\n window.addEventListener(\"beforeunload\", closeAll);\n\n let current = 0;\n setInterval(() => {\n if (popups[current].window?.closed) {\n if (current + 1 < popups.length) {\n open(current + 1);\n }\n }\n }, 500);\n\n openServices.value = () => {\n closeAll();\n open(0);\n };\n\n // eslint-disable-next-line no-inner-declarations\n function open(index: number) {\n current = index;\n popups[current].window = window.open(popups[current].url, \"nats\", \"width=1000,height=2000\");\n }\n\n // eslint-disable-next-line no-inner-declarations\n function closeAll() {\n popups.forEach((popup) => popup.window?.close());\n }\n }\n });\n\n return { showServices, openServices };\n}\n","\n\n\n\n\n","\n\n\n","export default \"data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_511_926)'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M11.9045%203.05176e-05C18.4744%203.05176e-05%2023.8081%205.33392%2023.8081%2011.9036C23.8081%2018.4735%2018.4744%2023.8072%2011.9045%2023.8072C5.3348%2023.8072%200.000915527%2018.4735%200.000915527%2011.9036C0.000915527%205.33392%205.3348%203.05176e-05%2011.9045%203.05176e-05ZM11.9045%201.33083C17.7398%201.33083%2022.4773%206.06836%2022.4773%2011.9036C22.4773%2017.7389%2017.7398%2022.4764%2011.9045%2022.4764C6.06925%2022.4764%201.33172%2017.7389%201.33172%2011.9036C1.33172%206.06836%206.06925%201.33083%2011.9045%201.33083Z'%20fill='url(%23paint0_linear_511_926)'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M16.2699%2011.0819C16.181%2010.8691%2016.2815%2010.6239%2016.4945%2010.5349C16.7074%2010.4457%2016.9526%2010.5462%2017.0417%2010.7592V10.7593C18.1375%2013.3805%2016.8989%2016.3983%2014.2776%2017.494C11.6564%2018.5898%208.63859%2017.3513%207.54291%2014.73L7.54317%2014.7298C7.45708%2014.5179%207.55759%2014.2753%207.76916%2014.1869C7.98073%2014.0983%208.22421%2014.1972%208.31455%2014.4073H8.31468C9.23238%2016.6027%2011.7598%2017.6399%2013.955%2016.7222C16.1503%2015.8045%2017.1876%2013.2772%2016.2699%2011.0819ZM8.98323%2017.2122H4.9445C4.51261%2017.2122%204.16193%2016.8615%204.16193%2016.4296V10.9167C4.16193%2010.4848%204.51261%2010.1341%204.9445%2010.1341H10.4574C10.8893%2010.1341%2011.24%2010.4848%2011.24%2010.9167V16.4296C11.24%2016.4543%2011.2388%2016.4789%2011.2365%2016.5029C10.6928%2016.3503%2010.1968%2016.0826%209.77687%2015.7281C9.85924%2015.6407%209.90969%2015.523%209.90969%2015.3935V11.9528C9.90969%2011.6832%209.69091%2011.4644%209.4213%2011.4644H5.9806C5.71099%2011.4644%205.49208%2011.6832%205.49208%2011.9528V15.3935C5.49208%2015.6631%205.71099%2015.882%205.9806%2015.882H7.70224C8.05266%2016.3933%208.48622%2016.8433%208.98323%2017.2122ZM16.0841%2013.6731H13.3518C12.9198%2013.6731%2012.5691%2013.3225%2012.5691%2012.8906V7.37767C12.5691%206.94578%2012.9198%206.59509%2013.3518%206.59509H18.8646C19.2966%206.59509%2019.6471%206.94578%2019.6471%207.37767V12.8906C19.6471%2013.3225%2019.2966%2013.6731%2018.8646%2013.6731H17.7752C17.826%2013.3712%2017.8525%2013.0611%2017.8525%2012.7446C17.8525%2012.6095%2017.8478%2012.4755%2017.8383%2012.3429C18.1034%2012.3377%2018.317%2012.1209%2018.317%2011.8545V8.41376C18.317%208.14415%2018.0981%207.92538%2017.8285%207.92538H14.3878C14.1183%207.92538%2013.8994%208.14415%2013.8994%208.41376V11.8545C13.8994%2012.1241%2014.1183%2012.343%2014.3878%2012.343H16.1748C16.1884%2012.475%2016.1954%2012.609%2016.1954%2012.7446C16.1954%2013.0646%2016.1568%2013.3755%2016.0841%2013.6731Z'%20fill='url(%23paint1_linear_511_926)'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient%20id='paint0_linear_511_926'%20x1='-9.92546'%20y1='25.8712'%20x2='22.5049'%20y2='3.60751'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23DB012F'/%3e%3cstop%20offset='1'%20stop-color='%23001688'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_511_926'%20x1='2.42896'%20y1='17.8931'%20x2='54.6778'%20y2='-13.3798'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23DB012F'/%3e%3cstop%20offset='1'%20stop-color='%23001688'/%3e%3c/linearGradient%3e%3cclipPath%20id='clip0_511_926'%3e%3crect%20width='24'%20height='24'%20fill='white'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e\"","\n\n\n\n\n","import { isFunction } from \"lodash-es\";\nimport { onMounted, onUnmounted } from \"vue\";\n\nexport function useTimeout() {\n function repeated(action: () => unknown, interval: number, strictTiming?: boolean) {\n let timeout = -1;\n onMounted(execute);\n onUnmounted(() => window.clearTimeout(timeout));\n\n function execute() {\n const res = action();\n if (!strictTiming && isPromise(res)) {\n res.then(schedule);\n } else {\n schedule();\n }\n }\n\n function schedule() {\n timeout = window.setTimeout(execute, interval);\n }\n\n function updateInterval(newInterval: number) {\n window.clearTimeout(timeout);\n interval = newInterval;\n schedule();\n }\n\n return { updateInterval };\n }\n\n return { repeated };\n}\n\nfunction isPromise(value: any): value is PromiseLike {\n return isFunction(value?.then);\n}\n","\n\n\n\n\n","\n\n\n","\n\n\n","/**\n * Returns the current time in the format HH:MM:SS.mmm\n */\nexport function now(): string {\n const date = new Date();\n return (\n (\"\" + date.getUTCHours()).padStart(2, \"0\") +\n \":\" +\n (\"\" + date.getUTCMinutes()).padStart(2, \"0\") +\n \":\" +\n (\"\" + date.getUTCSeconds()).padStart(2, \"0\") +\n \".\" +\n (\"\" + date.getUTCMilliseconds()).padStart(3, \"0\")\n );\n}\n\n/**\n * Returns the current time, rounted to the minute (HH:MM)\n */\nexport function nowMinutes(): string {\n const date = new Date();\n return (\n (\"\" + date.getUTCHours()).padStart(2, \"0\") + \":\" + (\"\" + date.getUTCMinutes()).padStart(2, \"0\")\n );\n}\n\n/**\n * Fetches the Google favicon and returns the time it took to load it\n *\n * @param timeout Maximum time to wait for the image to load\n */\nexport function fetchGoogleIcon(timeout = 5000): Promise {\n return new Promise((resolve, reject) => {\n const start = performance.now();\n const t = window.setTimeout(() => reject(`Timeout: ${timeout} ms`), timeout);\n const img = new Image();\n img.onload = () => {\n resolve(performance.now() - start);\n clearTimeout(t);\n };\n img.onerror = () => {\n reject(\"Error\");\n clearTimeout(t);\n };\n const random = start.toString(16);\n // add a random query parameter to avoid caching\n img.src = `https://www.google.com/favicon.ico?no-cache=${random}`;\n });\n}\n","import { onMounted, onUnmounted, ref } from \"vue\";\n\n/**\n * Returns the online status of the client, based on \"offline\" and \"online\" events.\n *\n * @returns {\n * online: Ref - True when the client is online\n * }\n */\nexport function useOnlineStatus() {\n const online = ref(navigator.onLine);\n let listenerController: AbortController | null = null;\n\n onMounted(() => {\n listenerController = new AbortController();\n\n window.addEventListener(\"offline\", () => (online.value = false), {\n signal: listenerController?.signal,\n });\n window.addEventListener(\"online\", () => (online.value = true), {\n signal: listenerController?.signal,\n });\n });\n\n onUnmounted(() => {\n listenerController?.abort();\n });\n\n return { online };\n}\n","\n\n\n\n\n","\n\n\n","import { isSmallScreen } from \"./utils\";\n\nexport function assertSmallScreen() {\n if (!isSmallScreen()) {\n return { name: \"login\" };\n }\n}\n","import type { AxiosResponse } from \"axios\";\nimport type { RouteLocationNormalized } from \"vue-router\";\n\nimport type { LoginResponse } from \"@/services/auth.service\";\nimport AuthService from \"@/services/auth.service\";\nimport { getConfig } from \"@/utils/env/Environment\";\nimport { firstQueryParam } from \"@/utils/vue/queryParam\";\n\nimport { companyParam, isSmallScreen } from \"./utils\";\n\nexport async function beforeLogin(to: RouteLocationNormalized) {\n if (isSmallScreen() && getConfig().isCloud && localStorage.getItem(\"device\") !== \"desktop\") {\n return { name: \"mobile\" };\n }\n\n if (getConfig().isCloud) {\n const companyId = companyParam();\n if (!companyId) {\n return;\n }\n // go to FusionAuth login page with company already resolved\n const res = await AuthService.login({\n type: firstQueryParam(to.query, \"type\") || \"\",\n path: firstQueryParam(to.query, \"path\") || \"\",\n companyId,\n });\n return followRedirect(res);\n }\n\n // go to FusionAuth login page\n const res = await AuthService.loginPage({\n type: firstQueryParam(to.query, \"type\") || \"\",\n path: firstQueryParam(to.query, \"path\") || \"\",\n });\n return followRedirect(res);\n\n function followRedirect(res: AxiosResponse) {\n if (res.data.success && res.data.redirectUrl) {\n window.location.assign(res.data.redirectUrl);\n return false;\n }\n }\n}\n","import type { RouteRecordRaw } from \"vue-router\";\n\nimport AppPage from \"@/pages/AppPage/AppPage.vue\";\nimport BasePage from \"@/pages/BasePage.vue\";\nimport LoginPage from \"@/pages/LoginPage/LoginPage.vue\";\nimport LogoutPage from \"@/pages/LogoutPage/LogoutPage.vue\";\nimport MobileInfoPage from \"@/pages/MobileInfoPage/MobileInfoPage.vue\";\nimport StatusPage from \"@/pages/StatusPage/StatusPage.vue\";\nimport WheelTestPage from \"@/pages/WheelTestPage.vue\";\n\nimport { assertSmallScreen } from \"./guards/assertSmallScreen\";\nimport { beforeLogin } from \"./guards/beforeLogin\";\nimport { PARAM } from \"./types\";\n\nexport const routes: RouteRecordRaw[] = [\n {\n name: \"page\",\n path: \"/page\",\n component: BasePage,\n children: [\n {\n name: \"status\",\n path: \"status\",\n meta: { title: /*$t*/ \"page.status\" },\n component: StatusPage,\n },\n ],\n },\n {\n name: \"mobile\",\n path: \"/mobile\",\n component: MobileInfoPage,\n beforeEnter: assertSmallScreen,\n meta: { needsAuth: false },\n },\n {\n name: \"login\",\n path: \"/page/login\",\n meta: { title: /*$t*/ \"page.login\", needsAuth: false },\n component: LoginPage,\n beforeEnter: beforeLogin,\n },\n {\n path: \"/page/oauth\",\n redirect: { name: \"login\" },\n },\n {\n name: \"app\",\n path: \"/app/:session/:team/:board/:name?\",\n component: AppPage,\n },\n {\n name: \"logout\",\n path: \"/logout\",\n meta: { needsAuth: false },\n component: LogoutPage,\n },\n {\n name: \"all\",\n path: \"/:pathMatch(.*)*\",\n redirect: {\n name: \"app\",\n params: {\n session: PARAM.INITIAL,\n team: PARAM.INITIAL,\n board: PARAM.INITIAL,\n },\n },\n },\n {\n name: \"wheelTest\",\n path: \"/wheeltest\",\n meta: { needsAuth: false },\n component: WheelTestPage,\n },\n];\n","export default class Resolvable {\n promise: Promise;\n resolve!: (value: T | PromiseLike) => void;\n reject!: (reason?: unknown) => void;\n resolved = false;\n rejected = false;\n\n constructor() {\n this.promise = new Promise((resolve, reject) => {\n this.resolve = (value) => {\n this.resolved = true;\n resolve(value);\n };\n this.reject = (reason) => {\n this.rejected = true;\n reject(reason);\n };\n });\n }\n\n get pending() {\n return !this.resolved && !this.rejected;\n }\n}\n","import { captureMessage } from \"@/error/sentry\";\n\nimport Resolvable from \"./Resolvable\";\n\n/**\n * A queue containing functions that return a promise.\n * A function is executed when the promise of the previous function has been fulfilled.\n */\nexport function createSyncQueue() {\n const queue = new Array<[() => Promise, Resolvable, object]>();\n let running = false;\n\n function doJobs() {\n const item = queue.shift();\n if (!item) {\n running = false;\n } else {\n running = true;\n const [job, resolvable] = item;\n job()\n .then((result) => resolvable.resolve(result))\n .catch((fail) => resolvable.reject(fail))\n .finally(doJobs);\n }\n }\n\n return {\n add(func: () => Promise, desc: object): Promise {\n const resolvable = new Resolvable();\n queue.push([func, resolvable, { time: Date.now(), ...desc }]);\n if (queue.length > 5) {\n const info = { queues: queue.map((q) => q[2]) };\n void captureMessage(\"Long sync queue\", { info });\n }\n if (!running) {\n doJobs();\n }\n return resolvable.promise;\n },\n };\n}\n","import type {\n NavigationFailure,\n RouteLocation,\n RouteLocationNamedRaw,\n RouteLocationNormalizedGeneric,\n Router,\n} from \"vue-router\";\n\nimport Resolvable from \"@/utils/async/Resolvable\";\nimport { createSyncQueue } from \"@/utils/async/syncQueue\";\n\nimport type { SyncRouter } from \"./types\";\n\nexport function addSyncNav(router: Router): SyncRouter {\n // queue to synchronize programmatic changes to the URL\n const queue = createSyncQueue();\n\n // navigatingTo and navigating promise are set for the duration of a navigation action\n let navigatingTo: RouteLocation | undefined;\n let navigating = new Resolvable();\n navigating.resolve();\n\n router.beforeEach(startNavigating);\n router.afterEach(endNavigating);\n router.onError(endNavigating);\n\n const syncRouter = router as SyncRouter;\n syncRouter.syncPush = syncPush;\n syncRouter.syncReplace = syncReplace;\n return syncRouter;\n\n function startNavigating(to: RouteLocationNormalizedGeneric) {\n navigatingTo = to;\n // no new navigating promise while the old one is still pending\n // there might be syncPush/syncReplace waiting on the old promise, so it must be resolved\n if (!navigating.pending) {\n navigating = new Resolvable();\n }\n }\n\n function endNavigating() {\n navigatingTo = undefined;\n navigating.resolve();\n }\n\n function syncPush(routeFunc: () => RouteLocationNamedRaw) {\n return queue.add(() => navigating.promise.then(() => router.push(routeFunc())), {\n waitingOn: navigatingTo?.fullPath,\n target: routeFunc(),\n });\n }\n\n function syncReplace(routeFunc: () => RouteLocationNamedRaw) {\n return queue.add(() => navigating.promise.then(() => router.replace(routeFunc())), {\n waitingOn: navigatingTo?.fullPath,\n target: routeFunc(),\n });\n }\n}\n","import { createRouter, createWebHashHistory } from \"vue-router\";\n\nimport { setRouter } from \"@/router\";\n\nimport { assertLoggedIn } from \"./guards/assertLoggedIn\";\nimport { setDocTitle } from \"./guards/docTitle\";\nimport { handleNonSessionParams } from \"./guards/handleNonSessionParams\";\nimport { handleSessionParam } from \"./guards/handleSessionParam\";\nimport { logError } from \"./guards/logError\";\nimport { routes } from \"./routes\";\nimport { addSyncNav } from \"./syncNav\";\n\nexport const router = addSyncNav(createRouter({ history: createWebHashHistory(), routes }));\n\nrouter.beforeEach(assertLoggedIn);\nrouter.beforeEach(handleSessionParam);\nrouter.beforeEach(handleNonSessionParams);\nrouter.afterEach(setDocTitle);\nrouter.onError(logError);\n\nsetRouter(router);\n","import { assignShortcut } from \"@/action/actions\";\nimport { boardActions } from \"@/action/boardActions\";\nimport { cardActions } from \"@/action/cardActions\";\nimport { drawActions } from \"@/action/drawActions\";\nimport { selectionActions } from \"@/action/selectionActions\";\nimport { toggleActions } from \"@/action/toggleActions\";\nimport { dummyKey, key } from \"@/components/shortcut/key\";\nimport { i18n } from \"@/translations/i18n\";\n\nexport function assignShortcuts() {\n assignShortcut(boardActions.screenshot, key(\"KeyE\", \"altCtrl\"));\n assignShortcut(boardActions.smallerCardSize, key(\"ArrowDown\", \"altCtrl\"));\n assignShortcut(boardActions.biggerCardSize, key(\"ArrowUp\", \"altCtrl\"));\n\n assignShortcut(toggleActions.hideDraw, key(\"Escape\"));\n assignShortcut(toggleActions.showStatGraphs, key(\"KeyJ\", \"altCtrl\"));\n assignShortcut(toggleActions.showStats, key(\"KeyI\", \"altCtrl\"));\n assignShortcut(\n toggleActions.showOverview,\n dummyKey(() => i18n.global.t(\"mouse.doubleClick\")),\n );\n assignShortcut(toggleActions.showTeamObjectives, key(\"KeyO\", \"altCtrl\"));\n assignShortcut(toggleActions.showSearch, key(\"KeyF\", \"altCtrl\"));\n assignShortcut(toggleActions.toggleBoardDiff, key(\"KeyH\"));\n assignShortcut(toggleActions.showTimer, key(\"KeyT\", \"altCtrl\"));\n assignShortcut(toggleActions.showTrailingPointer, key(\"KeyA\", \"shift\"));\n assignShortcut(toggleActions.togglePanMode, key(\"Space\"));\n assignShortcut(toggleActions.showSettings, key(\",\", \"altCtrl\"));\n assignShortcut(toggleActions.showShortcuts, key(\"?\"));\n assignShortcut(toggleActions.toggleWorkMode, key(\"KeyM\", \"shift\"));\n\n assignShortcut(selectionActions.undo, key(\"z\", \"altCtrl\"));\n assignShortcut(selectionActions.openLinkModal, key(\"KeyL\"));\n\n assignShortcut(drawActions.removeShape, key(\"Backspace\"));\n\n assignShortcut(cardActions.openAssigneeDropdown, key(\"KeyA\"));\n assignShortcut(cardActions.add, key(\"KeyN\"));\n assignShortcut(cardActions.togglePalette, dummyKey(\"KeyN\"));\n assignShortcut(cardActions.duplicate, key(\"KeyD\", \"altCtrl\"));\n}\n","import { eventTarget } from \"./dom\";\n\n/**\n * Prevents the spacebar from triggering unintended click events when dragging with the mouse.\n *\n * Problem:\n * - By default, holding the spacebar while clicking (or dragging) can trigger unintended\n * accessibility behaviors, such as focusing elements or simulating a click.\n * - This also prevents spacebar from accidentally opening modals or activating UI elements mid-drag.\n */\nexport function preventSpacebarClickInterference() {\n let isMousePressed = false;\n\n document.addEventListener(\n \"keydown\",\n (e) => {\n if (e.key === \" \") {\n if (isMousePressed) {\n e.preventDefault();\n e.stopPropagation();\n const activeEl = document.activeElement as HTMLElement | null;\n if (activeEl) activeEl.blur(); // Prevents focus/outline\n }\n }\n },\n { capture: true },\n );\n\n const resetMousePress = () => {\n isMousePressed = false;\n };\n\n document.addEventListener(\"pointerdown\", () => {\n isMousePressed = true;\n });\n\n document.addEventListener(\"pointerup\", resetMousePress);\n document.addEventListener(\"pointercancel\", resetMousePress);\n}\n\nexport function disableDefaultContextMenu() {\n document.addEventListener(\"contextmenu\", (e: Event) => {\n if (eventTarget(e)?.nodeName !== \"TEXTAREA\") {\n e.preventDefault();\n }\n });\n}\n\nexport function disableImageDragging() {\n // CSS user-drag: none is not supported by firefox, therefore disable dragging links and images with JS\n document.addEventListener(\"dragstart\", (e) => {\n const targetNode = eventTarget(e)?.nodeName;\n if (targetNode === \"A\" || targetNode === \"IMG\") {\n e.preventDefault();\n }\n });\n}\n","import color from \"@/model/color.module.scss\";\n\n/* eslint-disable no-console */\nexport function showLogo() {\n const black = \"color:\" + color.textPrimary;\n const blue = \"color:\" + color.ok;\n const red = \"color:\" + color.error;\n console.log(\n \" %c███████████\\n\" +\n \" █ █\\n\" +\n \" █ █ %c (_) | | (_)\\n\" +\n \"%c███████████ %c█ █ %c _ __ _ _ __ | | __ _ _ __ _ __ _ _ __ __ _\\n\" +\n \"%c█ █ %c█ █ %c| '_ \\\\| | '_ \\\\| |/ _` | '_ \\\\| '_ \\\\| | '_ \\\\ / _` |\\n\" +\n \"%c█ █ %c█ █ %c| |_) | | |_) | | (_| | | | | | | | | | | | (_| |\\n\" +\n \"%c█ █ %c███████████ %c| .__/|_| .__/|_|\\\\__,_|_| |_|_| |_|_|_| |_|\\\\__, |\\n\" +\n \"%c█ █ %c| | | | __/ |\\n\" +\n \"%c█ █ %c|_| |_| |___/\\n\" +\n \"%c███████████\",\n blue + \";line-height: 12px\",\n black,\n red,\n blue,\n black,\n red,\n blue,\n black,\n red,\n blue,\n black,\n red,\n blue,\n black,\n red,\n black,\n red,\n black,\n red,\n );\n}\n\nwindow.baseSize = () => {\n const child = window.open(location.href, \"\", \"resizable=1\")!;\n child.addEventListener(\"load\", () => {\n const docElem = child.document.documentElement;\n const dw = 1920 - docElem.clientWidth;\n const dh = 1080 - docElem.clientHeight;\n child.resizeBy(dw, dh);\n });\n};\n","import { isArray } from \"lodash-es\";\n\nimport type { CardCreateProps } from \"@/action/addCard\";\nimport { cardPosStep } from \"@/action/addCard\";\nimport { cardActions } from \"@/action/cardActions\";\nimport { selectionActions } from \"@/action/selectionActions\";\nimport { registerGlobalShortcut } from \"@/components/shortcut/shortcuts\";\nimport { relativeToWindow, windowToRelative } from \"@/math/coordinate-systems\";\nimport { minus, plus } from \"@/math/coordinates\";\nimport type { AlmSourceId } from \"@/model/baseTypes\";\nimport type { BoardCard } from \"@/model/card\";\nimport type { RelativeCoordinate } from \"@/model/coordinates\";\nimport { useBoardStore } from \"@/store/board\";\nimport { useModalStore } from \"@/store/modal\";\nimport { useZoomStore } from \"@/store/zoom\";\nimport { centerCoord, scrollCoord } from \"@/utils/dom/coordinates\";\nimport { eventTarget, lineSeparator } from \"@/utils/dom/dom\";\n\nimport { findFreePosition } from \"./components/utils/layout\";\n\nexport function registerCopyPaste() {\n registerGlobalShortcut(cardActions.duplicate, { prevent: true });\n\n document.addEventListener(\"paste\", (e) => {\n if (cardPasteTarget(eventTarget(e))) {\n const data = parseJson(e.clipboardData?.getData(\"text/sticky\"));\n if (isArray(data) && data.every(isSerializedCard)) {\n // Calculate the 'center' of the pasted stickies\n // When zoomed in, paste the stickies in the center of the window\n const pasteInCenter = useZoomStore().factor >= 1.2;\n const initialPosition = pasteInCenter ? windowToRelative(centerCoord()) : data[0].pos;\n const freePos = findFreePosition(initialPosition, cardPosStep());\n selectionActions.paste(\n \"keyboard-shortcut\",\n data.map((d) => deserializeCard(data[0].pos, d, freePos)),\n );\n } else {\n const text = e.clipboardData?.getData(\"text\");\n if (text) {\n void cardActions.pasteText(\"keyboard-shortcut\", { text });\n }\n }\n }\n });\n\n document.addEventListener(\"copy\", (e) => {\n const cards = useBoardStore().selectedOrActiveStickies;\n if (cards.length > 0 && e.clipboardData) {\n cardActions.copy(\"keyboard-shortcut\");\n const text = selectedText(eventTarget(e));\n if (cards.length === 1 && text) {\n setClipboard(e.clipboardData, [cardWithText(cards[0], text)]);\n } else {\n setClipboard(e.clipboardData, cards);\n }\n e.preventDefault();\n }\n });\n}\n\nfunction cardWithText(card: BoardCard, text: string) {\n return { ...card, data: { ...card.data, text } };\n}\n\nfunction setClipboard(clipboard: DataTransfer, cards: BoardCard[]) {\n clipboard.setData(\"text/plain\", cards.map((card) => card.data.text).join(lineSeparator));\n clipboard.setData(\"text/sticky\", JSON.stringify(cards.map(serializeCard)));\n}\n\nfunction cardPasteTarget(e: HTMLElement | null) {\n return (\n !useModalStore().isModalOpen() && (!e || (e.nodeName !== \"INPUT\" && e.nodeName !== \"TEXTAREA\"))\n );\n}\n\nfunction selectedText(e: HTMLInputElement | null) {\n if (e?.value) {\n const start = e.selectionStart;\n const end = e.selectionEnd;\n if (start !== null && end !== null) {\n return e.value.substring(start, end);\n }\n }\n return null;\n}\n\nfunction parseJson(s?: string): any {\n try {\n return s ? JSON.parse(s) : null;\n } catch (e) {\n return null;\n }\n}\n\ninterface SerializedCardData {\n text: string;\n typeId: string;\n typeName: string;\n almSourceId: AlmSourceId | null;\n pos: RelativeCoordinate;\n}\n\nfunction isSerializedCard(data: object): data is SerializedCardData {\n return (\n \"text\" in data &&\n \"typeId\" in data &&\n \"typeName\" in data &&\n \"almSourceId\" in data &&\n \"pos\" in data\n );\n}\n\nfunction serializeCard(card: BoardCard): SerializedCardData {\n return {\n typeId: card.data.type.id,\n typeName: card.data.type.name,\n almSourceId: card.data.almSourceId,\n text: card.data.text,\n pos: card.meta.pos,\n };\n}\n\nfunction deserializeCard(\n base: RelativeCoordinate,\n data: SerializedCardData,\n newBase: RelativeCoordinate,\n): CardCreateProps {\n const stickyTypes = useBoardStore().creatableStickyTypes;\n const relativeToBase = minus(relativeToWindow(data.pos), relativeToWindow(base));\n\n const adjustedPos = plus(relativeToBase, relativeToWindow(newBase));\n const windowPos = minus(adjustedPos, scrollCoord());\n return {\n text: data.text,\n almSourceId: data.almSourceId ?? undefined,\n // cross board pasting -> try to match type name\n // if still not found, take the first sticky type\n // TODO improvement: ask the user how to map every sticky type\n type:\n stickyTypes.find((type) => type.id === data.typeId) ||\n stickyTypes.find((type) => type.name === data.typeName) ||\n stickyTypes[0],\n pos: windowPos,\n };\n}\n","import { boardActions } from \"@/action/boardActions\";\nimport { cardActions } from \"@/action/cardActions\";\nimport { navigationActions } from \"@/action/navigationActions\";\nimport { toggleActions } from \"@/action/toggleActions\";\nimport { key } from \"@/components/shortcut/key\";\nimport { registerGlobalShortcut } from \"@/components/shortcut/shortcuts\";\nimport { sendStickyNoteAction } from \"@/composables/useEventBus\";\nimport { useActivityStore } from \"@/store/activity\";\nimport { useBoardStore } from \"@/store/board\";\nimport { useDrawStore } from \"@/store/draw\";\nimport { useLinkStore } from \"@/store/link\";\nimport { useModalStore } from \"@/store/modal\";\nimport { usePanModeStore } from \"@/store/panMode\";\nimport { usePointerStore } from \"@/store/pointer\";\nimport { useSelectionStore } from \"@/store/selection\";\nimport { useSwitchSessionStore } from \"@/store/switchSession\";\nimport { useTimerStore } from \"@/store/timer\";\n\nexport function registerGlobalActions() {\n registerGlobalShortcut(cardActions.openAssigneeDropdown, { prevent: false });\n registerGlobalShortcut(toggleActions.showStats, { prevent: false });\n registerGlobalShortcut(toggleActions.showStatGraphs, { prevent: false });\n registerGlobalShortcut(toggleActions.toggleBoardDiff, { prevent: false });\n registerGlobalShortcut(\n {\n key: key(\"Escape\"),\n exec: () => {\n if (useModalStore().isModalOpen()) {\n navigationActions.closeModal(\"keyboard-shortcut\");\n } else if (usePanModeStore().active) {\n toggleActions.hidePanMode(\"keyboard-shortcut\");\n } else if (useDrawStore().active) {\n toggleActions.hideDraw(\"keyboard-shortcut\");\n } else if (useActivityStore().active) {\n useActivityStore().inactivate();\n } else if (useSwitchSessionStore().active) {\n useSwitchSessionStore().inactivate();\n } else if (useTimerStore().active) {\n toggleActions.showTimer(\"keyboard-shortcut\");\n } else {\n if (useBoardStore().selectedStickyIds.length > 0) {\n boardActions.clearCardSelection(\"keyboard-shortcut\");\n } else {\n useSelectionStore().selecting = \"no\";\n }\n\n // Clear pinned sticky\n if (useLinkStore().isMarkingLinks) {\n useLinkStore().removeAllMarks();\n }\n const enlargedStickyId = useBoardStore().enlargedStickyNoteId;\n if (enlargedStickyId) {\n sendStickyNoteAction(enlargedStickyId, { action: \"shrink\" });\n }\n }\n usePointerStore().activatePointer(false);\n },\n },\n { prevent: false },\n );\n}\n","import { noop } from \"lodash-es\";\nimport { createPinia } from \"pinia\";\nimport \"the-new-css-reset/css/reset.css\";\nimport type { App } from \"vue\";\nimport { createApp } from \"vue\";\n\nimport AppBase from \"@/components/AppBase/AppBase.vue\";\nimport type { IntercomStatic } from \"@/declare/windowIntercom\";\nimport { autofocus } from \"@/directives/autofocus\";\nimport { boardRegion } from \"@/directives/boardRegion\";\nimport { focusTrap } from \"@/directives/focusTrap\";\nimport { keyboardNavigation } from \"@/directives/keyboardNavigation\";\nimport { ownedCards } from \"@/directives/ownedCards\";\nimport { scrollableOnBoard } from \"@/directives/scrollableOnBoard\";\nimport { handleError } from \"@/error/errorHandler\";\nimport { captureException, initSentry } from \"@/error/sentry\";\nimport { setLanguage } from \"@/language\";\nimport { router } from \"@/router/router\";\nimport { assignShortcuts } from \"@/shortcuts\";\nimport { useClientSettingsStore } from \"@/store/clientSettings\";\nimport \"@/styles/global/theme-light.scss\";\nimport { i18n } from \"@/translations/i18n\";\nimport {\n disableDefaultContextMenu,\n disableImageDragging,\n preventSpacebarClickInterference,\n} from \"@/utils/dom/globalEvents\";\nimport { wrapMutationObserver } from \"@/utils/dom/mutationObserver\";\n\nimport { showLogo } from \"./console\";\nimport { registerCopyPaste } from \"./copyPaste\";\nimport { registerGlobalActions } from \"./globalActions\";\nimport { broadcastFeatures } from \"./utils/env/feature\";\n\nwrapMutationObserver();\n\nbroadcastFeatures();\n\nconst app = createApp(AppBase)\n .use(router)\n .use(createPinia())\n .use(i18n)\n .directive(\"focus-trap\", focusTrap())\n .directive(\"autofocus\", autofocus())\n .directive(\"scrollable-on-board\", scrollableOnBoard())\n .directive(\"owned-cards\", ownedCards())\n .directive(\"keyboard-nav\", keyboardNavigation())\n .directive(\"board-region\", boardRegion());\n\nvoid initSentry(app).then(() => {\n initErrorListeners(app);\n app.mount(\"#app\").$watch(\"$route.query.lang\", setLanguage);\n});\n\nuseClientSettingsStore().init();\n\n// real Intercom will be inited after login if enabled\n// dummy init here, so we can just call Intercom without always checking if it's available or not\nwindow.Intercom = noop as IntercomStatic;\n\nshowLogo();\nassignShortcuts();\nregisterGlobalActions();\nregisterCopyPaste();\npreventSpacebarClickInterference();\ndisableDefaultContextMenu();\ndisableImageDragging();\n\nfunction initErrorListeners(app: App) {\n window.onunhandledrejection = (event) => {\n event.preventDefault();\n handleError(event.reason);\n };\n window.onerror = (msg, url, line, col, error) => {\n void captureException(error);\n return true;\n };\n window.addEventListener(\"vite:preloadError\", (event) => {\n event.preventDefault();\n handleError(event.payload);\n });\n app.config.errorHandler = (err) => {\n handleError(err);\n };\n app.config.warnHandler = (err) => {\n handleError(err);\n };\n}\n"],"file":"assets/index-BnqLyX3Y.js"}