From df53171f7dad872476b124ef8dd8ad2e1a404693 Mon Sep 17 00:00:00 2001 From: PostHog Bot Date: Mon, 6 Jan 2025 18:11:59 +0000 Subject: [PATCH] Storybook build for 0c6d721767bbdf615c3db384828267267bf9a97c --- docs/33876.a40c6c2e.iframe.bundle.js | 1 - docs/33876.b0b8736a.iframe.bundle.js | 1 + docs/iframe.html | 2 +- docs/project.json | 2 +- ....iframe.bundle.js => runtime~main.a7a6d726.iframe.bundle.js} | 2 +- 5 files changed, 4 insertions(+), 4 deletions(-) delete mode 100644 docs/33876.a40c6c2e.iframe.bundle.js create mode 100644 docs/33876.b0b8736a.iframe.bundle.js rename docs/{runtime~main.6ffb29da.iframe.bundle.js => runtime~main.a7a6d726.iframe.bundle.js} (99%) diff --git a/docs/33876.a40c6c2e.iframe.bundle.js b/docs/33876.a40c6c2e.iframe.bundle.js deleted file mode 100644 index 7a50aee53..000000000 --- a/docs/33876.a40c6c2e.iframe.bundle.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunkposthog=self.webpackChunkposthog||[]).push([[33876],{"./frontend/src/lib/components/CompactList/CompactList.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{a:()=>CompactList_CompactList_CompactList});var injectStylesIntoStyleTag=__webpack_require__("./node_modules/.pnpm/style-loader@2.0.0_webpack@5.88.2/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),injectStylesIntoStyleTag_default=__webpack_require__.n(injectStylesIntoStyleTag),CompactList=__webpack_require__("./node_modules/.pnpm/css-loader@3.6.0_webpack@5.88.2/node_modules/css-loader/dist/cjs.js!./node_modules/.pnpm/postcss-loader@4.3.0_postcss@8.4.31_webpack@5.88.2/node_modules/postcss-loader/dist/cjs.js!./node_modules/.pnpm/sass-loader@10.3.1_sass@1.56.0_webpack@5.88.2/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./frontend/src/lib/components/CompactList/CompactList.scss"),CompactList_default=__webpack_require__.n(CompactList),options={};options.insert="head",options.singleton=!1,injectStylesIntoStyleTag_default()(CompactList_default(),options),CompactList_default().locals;var clsx_m=__webpack_require__("./node_modules/.pnpm/clsx@1.2.1/node_modules/clsx/dist/clsx.m.js"),index_esm=__webpack_require__("./node_modules/.pnpm/kea@3.1.5_react@18.2.0/node_modules/kea/lib/index.esm.js"),LemonButton=__webpack_require__("./frontend/src/lib/lemon-ui/LemonButton/index.ts"),LemonDivider=__webpack_require__("./frontend/src/lib/lemon-ui/LemonDivider/index.ts"),LemonSkeleton=__webpack_require__("./frontend/src/lib/lemon-ui/LemonSkeleton/index.ts"),themeLogic=__webpack_require__("./frontend/src/layout/navigation-3000/themeLogic.ts"),EmptyMessage=__webpack_require__("./frontend/src/lib/components/EmptyMessage/EmptyMessage.tsx"),jsx_runtime=__webpack_require__("./node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js");function CompactList_CompactList_CompactList(_ref){let{title,viewAllURL,loading,items,emptyMessage,renderRow,contentHeightBehavior="fixed"}=_ref,{theme}=(0,index_esm.useValues)(themeLogic.b);return(0,jsx_runtime.jsxs)("div",{className:"CompactList",style:theme?.boxStyle,children:[title&&(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsxs)("div",{className:"CompactList__header",children:[(0,jsx_runtime.jsx)("h3",{className:"px-2 truncate",title:"string"==typeof title?title:void 0,children:title}),viewAllURL&&(0,jsx_runtime.jsx)(LemonButton.J,{to:viewAllURL,children:"View all"})]}),(0,jsx_runtime.jsx)("div",{className:"mx-2",children:(0,jsx_runtime.jsx)(LemonDivider.p,{className:"my-0"})})]}),(0,jsx_runtime.jsx)("div",{className:(0,clsx_m.default)("CompactList__content","shrink"===contentHeightBehavior&&"max-h-[16rem] h-auto"),children:loading?(0,jsx_runtime.jsx)("div",{className:"p-2 space-y-6",children:Array.from({length:6},(_,index)=>(0,jsx_runtime.jsx)(LemonSkeleton.y,{},index))}):0===items.length&&emptyMessage?(0,jsx_runtime.jsx)(EmptyMessage.M,{...emptyMessage}):(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:items.map((item,index)=>renderRow(item,index))})})]})}},"./frontend/src/lib/lemon-ui/LemonSegmentedSelect/LemonSegmentedSelect.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{S:()=>LemonSegmentedSelect});var lib_hooks_useWindowSize__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./frontend/src/lib/hooks/useWindowSize.js");__webpack_require__("./node_modules/.pnpm/react@18.2.0/node_modules/react/index.js");var _LemonSegmentedButton__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./frontend/src/lib/lemon-ui/LemonSegmentedButton/index.ts"),_LemonSelect__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./frontend/src/lib/lemon-ui/LemonSelect/index.ts"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js");function LemonSegmentedSelect(_ref){let{shrinkOn,...props}=_ref,{width=0}=(0,lib_hooks_useWindowSize__WEBPACK_IMPORTED_MODULE_0__.i)();return props.options.length>=shrinkOn||width<100*props.options.length?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_LemonSelect__WEBPACK_IMPORTED_MODULE_3__.Yv,{...props}):(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_LemonSegmentedButton__WEBPACK_IMPORTED_MODULE_2__.P,{...props})}},"./frontend/src/queries/schema-guards.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{X:()=>isWebAnalyticsPropertyFilters,a:()=>isSessionPropertyFilters});var ajv__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/.pnpm/ajv@8.12.0/node_modules/ajv/dist/ajv.js"),ajv__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(ajv__WEBPACK_IMPORTED_MODULE_0__),_schema_json__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./frontend/src/queries/schema.json");let ajv=new(ajv__WEBPACK_IMPORTED_MODULE_0___default())({allowUnionTypes:!0});ajv.addSchema(_schema_json__WEBPACK_IMPORTED_MODULE_1__);let isWebAnalyticsPropertyFilters=data=>{let validator=ajv.getSchema("#/definitions/WebAnalyticsPropertyFilters");if(!validator)throw Error("Could not find validator for WebAnalyticsPropertyFilters");return validator(data)},isSessionPropertyFilters=data=>{let validator=ajv.getSchema("#/definitions/SessionPropertyFilter");if(!validator)throw Error("Could not find validator for SessionPropertyFilter");return!!Array.isArray(data)&&data.every(item=>validator(item))}},"./frontend/src/scenes/error-tracking/queries.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{QT:()=>errorTrackingIssueEventsQuery,mx:()=>errorTrackingQuery,zx:()=>errorTrackingIssueQuery});var lib_dayjs__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./frontend/src/lib/dayjs.ts"),lib_utils__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./frontend/src/lib/utils.tsx"),_queries_schema__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./frontend/src/queries/schema.ts");__webpack_require__("./frontend/src/types.ts");let SPARKLINE_CONFIGURATIONS={"-1d1h":{value:60,displayAs:"minute",offsetHours:24},"-1d24h":{value:24,displayAs:"hour",offsetHours:24},"1h":{value:60,displayAs:"minute"},"24h":{value:24,displayAs:"hour"},"7d":{value:168,displayAs:"hour"},"14d":{value:336,displayAs:"hour"},"90d":{value:90,displayAs:"day"},"180d":{value:26,displayAs:"week"},mStart:{value:31,displayAs:"day"},yStart:{value:52,displayAs:"week"}},toStartOfIntervalFn={minute:"toStartOfMinute",hour:"toStartOfHour",day:"toStartOfDay",week:"toStartOfWeek",month:"toStartOfMonth"},errorTrackingQuery=_ref=>{let{orderBy,dateRange,assignee,filterTestAccounts,filterGroup,searchQuery,sparklineSelectedPeriod,columns,limit=50}=_ref,select=[];if(sparklineSelectedPeriod){let{value,displayAs,offsetHours}=parseSparklineSelection(sparklineSelectedPeriod),{labels,data}=generateSparklineProps({value,displayAs,offsetHours});select.splice(1,0,` as volume`),columns.splice(1,0,"volume")}return{kind:_queries_schema__WEBPACK_IMPORTED_MODULE_2__.OH.DataTableNode,source:{kind:_queries_schema__WEBPACK_IMPORTED_MODULE_2__.OH.ErrorTrackingQuery,select:select,orderBy:orderBy,dateRange:dateRange,assignee:assignee,filterGroup:filterGroup,filterTestAccounts:filterTestAccounts,searchQuery:searchQuery,limit:limit},showActions:!1,showTimings:!1,columns:columns}},parseSparklineSelection=selection=>{if(selection in SPARKLINE_CONFIGURATIONS)return SPARKLINE_CONFIGURATIONS[selection];let result=selection.match(/\d+|\D+/g);if(result){let[value,unit]=result;return{value:Number(value)*("y"===unit?12:1),displayAs:"h"===unit?"hour":"d"===unit?"day":"w"===unit?"week":"month"}}return{value:24,displayAs:"hour"}},generateSparklineProps=_ref2=>{let{value,displayAs,offsetHours}=_ref2,offset=null!=offsetHours?offsetHours:0,now=(0,lib_dayjs__WEBPACK_IMPORTED_MODULE_0__.Bv)().subtract(offset,"hours").startOf(displayAs),dates=(0,lib_utils__WEBPACK_IMPORTED_MODULE_1__.w6)(value).map(idx=>now.subtract(value-(idx+1),displayAs)),labels=dates.map(d=>`'${d.format("D MMM, YYYY HH:mm")} (UTC)'`),toStartOfInterval=toStartOfIntervalFn[displayAs],data=`reverse(arrayMap(x -> countEqual(groupArray(dateDiff('${displayAs}', ${toStartOfInterval}(timestamp), ${toStartOfInterval}(subtractHours(now(), ${offset})))), x), range(${value})))`;return{labels,data}},errorTrackingIssueQuery=_ref3=>{let{issueId,dateRange,filterTestAccounts,filterGroup}=_ref3;return{kind:_queries_schema__WEBPACK_IMPORTED_MODULE_2__.OH.ErrorTrackingQuery,issueId:issueId,dateRange:dateRange,filterGroup:filterGroup,filterTestAccounts:filterTestAccounts}},errorTrackingIssueEventsQuery=_ref4=>{let{select,issueId,dateRange,filterTestAccounts,filterGroup,offset}=_ref4,group=filterGroup.values[0],properties=group.values,where=[`'${issueId}' == properties.$exception_issue_id`],query={kind:_queries_schema__WEBPACK_IMPORTED_MODULE_2__.OH.EventsQuery,event:"$exception",select,where,properties,filterTestAccounts:filterTestAccounts,offset:offset,limit:50};return dateRange.date_from&&(query.after=dateRange.date_from),dateRange.date_to&&(query.before=dateRange.date_to),query}},"./frontend/src/scenes/project-homepage/ProjectHomePageCompactListItem.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{x:()=>ProjectHomePageCompactListItem});var _posthog_lemon_ui__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./frontend/@posthog/lemon-ui/src/index.ts");__webpack_require__("./node_modules/.pnpm/react@18.2.0/node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js");function ProjectHomePageCompactListItem(_ref){let{to,onClick,title,subtitle,prefix,suffix}=_ref;return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_posthog_lemon_ui__WEBPACK_IMPORTED_MODULE_0__.Jp,{fullWidth:!0,to:to,onClick:onClick,className:"h-12",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div",{className:"flex items-start justify-between overflow-hidden gap-2 flex-1",children:[prefix?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("span",{className:"flex shrink-0 text-muted text-xl",children:prefix}):null,(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div",{className:"truncate space-y-0.5 flex-1",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div",{className:"text-link truncate",children:title}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div",{className:"truncate text-muted font-normal text-xs",children:subtitle})]}),suffix?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("span",{className:"shrink-0",children:suffix}):null]})})}},"./frontend/src/scenes/project-homepage/WatchNextPanel.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{ZB:()=>RecordingRow,d4:()=>WatchNextList,rt:()=>WatchNextPanel}),__webpack_require__("./frontend/src/scenes/project-homepage/ProjectHomepage.scss");var _posthog_icons__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/.pnpm/@posthog+icons@0.9.2_react-dom@18.2.0_react@18.2.0/node_modules/@posthog/icons/dist/posthog-icons.es.js"),clsx__WEBPACK_IMPORTED_MODULE_17__=__webpack_require__("./node_modules/.pnpm/clsx@1.2.1/node_modules/clsx/dist/clsx.m.js"),kea__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/.pnpm/kea@3.1.5_react@18.2.0/node_modules/kea/lib/index.esm.js"),lib_components_CompactList_CompactList__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./frontend/src/lib/components/CompactList/CompactList.tsx"),lib_lemon_ui_icons__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./frontend/src/lib/lemon-ui/icons/index.ts"),lib_lemon_ui_LemonSnack__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./frontend/src/lib/lemon-ui/LemonSnack/index.ts"),lib_lemon_ui_ProfilePicture__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./frontend/src/lib/lemon-ui/ProfilePicture/index.ts"),lib_lemon_ui_Tooltip__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./frontend/src/lib/lemon-ui/Tooltip/index.ts"),lib_utils__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./frontend/src/lib/utils.tsx"),lib_utils_eventUsageLogic__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./frontend/src/lib/utils/eventUsageLogic.ts"),scenes_persons_person_utils__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("./frontend/src/scenes/persons/person-utils.ts"),scenes_session_recordings_player_modal_sessionPlayerModalLogic__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__("./frontend/src/scenes/session-recordings/player/modal/sessionPlayerModalLogic.ts"),scenes_session_recordings_playlist_sessionRecordingsPlaylistLogic__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__("./frontend/src/scenes/session-recordings/playlist/sessionRecordingsPlaylistLogic.ts"),scenes_teamLogic__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__("./frontend/src/scenes/teamLogic.tsx"),scenes_urls__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__("./frontend/src/scenes/urls.ts"),_ProjectHomePageCompactListItem__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__("./frontend/src/scenes/project-homepage/ProjectHomePageCompactListItem.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__("./node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js");function ActivityScoreLabel(_ref){let{score}=_ref,n=null!=score?score:0,backgroundColor="bg-primary-alt-highlight",description="very low";return n>=90?(backgroundColor="bg-success-highlight",description="very high"):n>=75?(backgroundColor="bg-success-highlight",description="high"):n>=50?(backgroundColor="bg-warning-highlight",description="medium"):n>=25&&(backgroundColor="bg-warning-highlight",description="low"),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(lib_lemon_ui_LemonSnack__WEBPACK_IMPORTED_MODULE_5__.L,{className:(0,clsx__WEBPACK_IMPORTED_MODULE_17__.default)(backgroundColor,"text-xs"),children:["activity: ",description]})}function RecordingRow(_ref2){let{recording}=_ref2,{openSessionPlayer}=(0,kea__WEBPACK_IMPORTED_MODULE_2__.useActions)(scenes_session_recordings_player_modal_sessionPlayerModalLogic__WEBPACK_IMPORTED_MODULE_11__.A),{reportRecordingOpenedFromRecentRecordingList}=(0,kea__WEBPACK_IMPORTED_MODULE_2__.useActions)(lib_utils_eventUsageLogic__WEBPACK_IMPORTED_MODULE_9__.vx);return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_ProjectHomePageCompactListItem__WEBPACK_IMPORTED_MODULE_15__.x,{title:(0,scenes_persons_person_utils__WEBPACK_IMPORTED_MODULE_10__.y)(recording.person),subtitle:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(ActivityScoreLabel,{score:recording.activity_score}),prefix:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(lib_lemon_ui_ProfilePicture__WEBPACK_IMPORTED_MODULE_6__.Y,{name:(0,scenes_persons_person_utils__WEBPACK_IMPORTED_MODULE_10__.y)(recording.person)}),suffix:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)("div",{className:"flex items-center justify-end text-text-3000",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("span",{children:(0,lib_utils__WEBPACK_IMPORTED_MODULE_8__.C7)(recording.recording_duration)}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(lib_lemon_ui_icons__WEBPACK_IMPORTED_MODULE_4__.Ud,{className:"text-2xl ml-2"})]}),onClick:()=>{openSessionPlayer({id:recording.id}),reportRecordingOpenedFromRecentRecordingList()}})}function WatchNextList(_ref3){let{sessionRecordings,loading,recordingsOptIn}=_ref3;return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(lib_components_CompactList_CompactList__WEBPACK_IMPORTED_MODULE_3__.a,{title:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(lib_lemon_ui_Tooltip__WEBPACK_IMPORTED_MODULE_7__.u,{title:"A selection of the most interesting recordings. We use multiple signals to calculate an activity score.",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("span",{children:"Watch next"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_posthog_icons__WEBPACK_IMPORTED_MODULE_1__.IconInfo,{className:"text-lg"})]})}),viewAllURL:scenes_urls__WEBPACK_IMPORTED_MODULE_14__.j.replay(),loading:loading,emptyMessage:recordingsOptIn?{title:"There are no recordings for this project",description:"Make sure you have the javascript snippet setup in your website.",buttonText:"Learn more",buttonTo:"https://posthog.com/docs/user-guides/recordings"}:{title:"Recordings are not enabled for this project",description:"Once recordings are enabled, recordings will display here.",buttonText:"Enable recordings",buttonTo:scenes_urls__WEBPACK_IMPORTED_MODULE_14__.j.settings("project-replay")},items:sessionRecordings.slice(0,5),renderRow:(recording,index)=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(RecordingRow,{recording:recording},index)})}function WatchNextPanel(){let{currentTeam}=(0,kea__WEBPACK_IMPORTED_MODULE_2__.useValues)(scenes_teamLogic__WEBPACK_IMPORTED_MODULE_13__.H),sessionRecordingsListLogicInstance=(0,scenes_session_recordings_playlist_sessionRecordingsPlaylistLogic__WEBPACK_IMPORTED_MODULE_12__.YV)({logicKey:"projectHomepage",filters:{...scenes_session_recordings_playlist_sessionRecordingsPlaylistLogic__WEBPACK_IMPORTED_MODULE_12__.I4,duration:[{...scenes_session_recordings_playlist_sessionRecordingsPlaylistLogic__WEBPACK_IMPORTED_MODULE_12__.dK,value:60}],date_to:"-15M",order:"activity_score"}}),{sessionRecordings,sessionRecordingsResponseLoading}=(0,kea__WEBPACK_IMPORTED_MODULE_2__.useValues)(sessionRecordingsListLogicInstance);return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(WatchNextList,{recordingsOptIn:currentTeam?.session_recording_opt_in,sessionRecordings:sessionRecordings,loading:sessionRecordingsResponseLoading})}},"./frontend/src/scenes/web-analytics/WebAnalyticsScene.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{WebAnalyticsScene:()=>WebAnalyticsScene,scene:()=>scene});var PageHeader=__webpack_require__("./frontend/src/lib/components/PageHeader.tsx"),posthog_icons_es=__webpack_require__("./node_modules/.pnpm/@posthog+icons@0.9.2_react-dom@18.2.0_react@18.2.0/node_modules/@posthog/icons/dist/posthog-icons.es.js"),index_esm=__webpack_require__("./node_modules/.pnpm/kea@3.1.5_react@18.2.0/node_modules/kea/lib/index.esm.js"),lib=__webpack_require__("./node_modules/.pnpm/kea-loaders@3.0.0_kea@3.1.5/node_modules/kea-loaders/lib/index.js"),kea_router_lib=__webpack_require__("./node_modules/.pnpm/kea-router@3.2.0_kea@3.1.5/node_modules/kea-router/lib/index.js"),kea_window_values_lib=__webpack_require__("./node_modules/.pnpm/kea-window-values@3.0.0_kea@3.1.5/node_modules/kea-window-values/lib/index.js"),api=__webpack_require__("./frontend/src/lib/api.ts"),constants=__webpack_require__("./frontend/src/lib/constants.tsx"),dayjs=__webpack_require__("./frontend/src/lib/dayjs.ts"),LemonButton=__webpack_require__("./frontend/src/lib/lemon-ui/LemonButton/index.ts"),LemonSwitch=__webpack_require__("./frontend/src/lib/lemon-ui/LemonSwitch/index.ts"),Link=__webpack_require__("./frontend/src/lib/lemon-ui/Link/Link.tsx"),Tooltip=__webpack_require__("./frontend/src/lib/lemon-ui/Tooltip/index.ts"),featureFlagLogic=__webpack_require__("./frontend/src/lib/logic/featureFlagLogic.ts"),utils=__webpack_require__("./frontend/src/lib/utils.tsx"),queries=__webpack_require__("./frontend/src/scenes/error-tracking/queries.ts"),urls=__webpack_require__("./frontend/src/scenes/urls.ts"),query=__webpack_require__("./frontend/src/queries/query.ts"),schema=__webpack_require__("./frontend/src/queries/schema.ts"),schema_guards=__webpack_require__("./frontend/src/queries/schema-guards.ts"),types=__webpack_require__("./frontend/src/types.ts"),jsx_runtime=__webpack_require__("./node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js");let TileId=function(TileId){return TileId.OVERVIEW="OVERVIEW",TileId.GRAPHS="GRAPHS",TileId.PATHS="PATHS",TileId.SOURCES="SOURCES",TileId.DEVICES="DEVICES",TileId.GEOGRAPHY="GEOGRAPHY",TileId.RETENTION="RETENTION",TileId.REPLAY="REPLAY",TileId.ERROR_TRACKING="ERROR_TRACKING",TileId.GOALS="GOALS",TileId}({}),loadPriorityMap={[TileId.OVERVIEW]:1,[TileId.GRAPHS]:2,[TileId.PATHS]:3,[TileId.SOURCES]:4,[TileId.DEVICES]:5,[TileId.GEOGRAPHY]:6,[TileId.RETENTION]:7,[TileId.REPLAY]:8,[TileId.ERROR_TRACKING]:9,[TileId.GOALS]:10},GraphsTab=function(GraphsTab){return GraphsTab.UNIQUE_USERS="UNIQUE_USERS",GraphsTab.PAGE_VIEWS="PAGE_VIEWS",GraphsTab.NUM_SESSION="NUM_SESSION",GraphsTab.UNIQUE_CONVERSIONS="UNIQUE_CONVERSIONS",GraphsTab.TOTAL_CONVERSIONS="TOTAL_CONVERSIONS",GraphsTab.CONVERSION_RATE="CONVERSION_RATE",GraphsTab}({}),SourceTab=function(SourceTab){return SourceTab.CHANNEL="CHANNEL",SourceTab.REFERRING_DOMAIN="REFERRING_DOMAIN",SourceTab.UTM_SOURCE="UTM_SOURCE",SourceTab.UTM_MEDIUM="UTM_MEDIUM",SourceTab.UTM_CAMPAIGN="UTM_CAMPAIGN",SourceTab.UTM_CONTENT="UTM_CONTENT",SourceTab.UTM_TERM="UTM_TERM",SourceTab.UTM_SOURCE_MEDIUM_CAMPAIGN="UTM_SOURCE_MEDIUM_CAMPAIGN",SourceTab}({}),DeviceTab=function(DeviceTab){return DeviceTab.BROWSER="BROWSER",DeviceTab.OS="OS",DeviceTab.DEVICE_TYPE="DEVICE_TYPE",DeviceTab.VIEWPORT="VIEWPORT",DeviceTab}({}),PathTab=function(PathTab){return PathTab.PATH="PATH",PathTab.INITIAL_PATH="INITIAL_PATH",PathTab.END_PATH="END_PATH",PathTab.EXIT_CLICK="EXIT_CLICK",PathTab.SCREEN_NAME="SCREEN_NAME",PathTab}({}),GeographyTab=function(GeographyTab){return GeographyTab.MAP="MAP",GeographyTab.COUNTRIES="COUNTRIES",GeographyTab.REGIONS="REGIONS",GeographyTab.CITIES="CITIES",GeographyTab.TIMEZONES="TIMEZONES",GeographyTab.LANGUAGES="LANGUAGES",GeographyTab}({}),ConversionGoalWarning=function(ConversionGoalWarning){return ConversionGoalWarning.CustomEventWithNoSessionId="CustomEventWithNoSessionId",ConversionGoalWarning}({}),GEOIP_PLUGIN_URLS=["https://github.com/PostHog/posthog-plugin-geoip","https://www.npmjs.com/package/@posthog/geoip-plugin"],WEB_ANALYTICS_DATA_COLLECTION_NODE_ID="web-analytics",initialInterval=(0,utils.Rx)("-7d",null),getDashboardItemId=(section,tab,isModal)=>`new-AdHoc.web-analytics.${section}.${tab||"default"}.${isModal?"modal":"default"}`,teamId=window.POSTHOG_APP_CONTEXT?.current_team?.id,persistConfig={persist:!0,prefix:`${teamId}__`},webAnalyticsLogic=(0,index_esm.kea)([(0,index_esm.path)(["scenes","webAnalytics","webAnalyticsSceneLogic"]),(0,index_esm.connect)(()=>({values:[featureFlagLogic.h,["featureFlags"]]})),(0,index_esm.actions)({setWebAnalyticsFilters:webAnalyticsFilters=>({webAnalyticsFilters}),togglePropertyFilter:(type,key,value,tabChange)=>({type,key,value,tabChange}),setGraphsTab:tab=>({tab}),setSourceTab:tab=>({tab}),setDeviceTab:tab=>({tab}),setPathTab:tab=>({tab}),setGeographyTab:tab=>({tab}),setDates:(dateFrom,dateTo)=>({dateFrom,dateTo}),setInterval:interval=>({interval}),setDatesAndInterval:(dateFrom,dateTo,interval)=>({dateFrom,dateTo,interval}),setIsPathCleaningEnabled:isPathCleaningEnabled=>({isPathCleaningEnabled}),setShouldFilterTestAccounts:shouldFilterTestAccounts=>({shouldFilterTestAccounts}),setShouldStripQueryParams:shouldStripQueryParams=>({shouldStripQueryParams}),setConversionGoal:conversionGoal=>({conversionGoal}),openModal:(tileId,tabId)=>({tileId,tabId}),closeModal:()=>!0,openAsNewInsight:(tileId,tabId)=>({tileId,tabId}),setConversionGoalWarning:warning=>({warning}),setCompareFilter:compareFilter=>({compareFilter})}),(0,index_esm.reducers)({webAnalyticsFilters:[[],persistConfig,{setWebAnalyticsFilters:(_,_ref)=>{let{webAnalyticsFilters}=_ref;return webAnalyticsFilters},togglePropertyFilter:(oldPropertyFilters,_ref2)=>{let{key,value,type}=_ref2;if(null===value){let isNotSetFilterExists=oldPropertyFilters.some(f=>f.type===type||f.key===key||f.operator===types.WV.IsNotSet);return isNotSetFilterExists?oldPropertyFilters.filter(f=>f.type!==type||f.key!==key||f.operator!==types.WV.IsNotSet):[...oldPropertyFilters,{type,key,operator:types.WV.IsNotSet}]}let similarFilterExists=oldPropertyFilters.some(f=>f.type===type&&f.key===key&&f.operator===types.WV.Exact);if(similarFilterExists)return oldPropertyFilters.map(f=>{let newValue;if(f.key!==key||f.type!==type||![types.WV.Exact,types.WV.IsNotSet].includes(f.operator))return f;let oldValue=(Array.isArray(f.value)?f.value:[f.value]).filter(utils.DX);if(oldValue.includes(value)){if(!(oldValue.length>1))return null;newValue=[value]}else newValue=[...oldValue,value];return{type:types.FT.Event,key,operator:types.WV.Exact,value:newValue}}).filter(utils.DX);let newFilter={type,key,value,operator:types.WV.Exact};return[...oldPropertyFilters,newFilter]}}],_graphsTab:[null,persistConfig,{setGraphsTab:(_,_ref3)=>{let{tab}=_ref3;return tab},togglePropertyFilter:(oldTab,_ref4)=>{let{tabChange}=_ref4;return tabChange?.graphsTab||oldTab}}],_sourceTab:[null,persistConfig,{setSourceTab:(_,_ref5)=>{let{tab}=_ref5;return tab},togglePropertyFilter:(oldTab,_ref6)=>{let{tabChange}=_ref6;return tabChange?.sourceTab||oldTab}}],_deviceTab:[null,persistConfig,{setDeviceTab:(_,_ref7)=>{let{tab}=_ref7;return tab},togglePropertyFilter:(oldTab,_ref8)=>{let{tabChange}=_ref8;return tabChange?.deviceTab||oldTab}}],_pathTab:[null,persistConfig,{setPathTab:(_,_ref9)=>{let{tab}=_ref9;return tab},togglePropertyFilter:(oldTab,_ref10)=>{let{tabChange}=_ref10;return tabChange?.pathTab||oldTab}}],_geographyTab:[null,persistConfig,{setGeographyTab:(_,_ref11)=>{let{tab}=_ref11;return tab},togglePropertyFilter:(oldTab,_ref12)=>{let{tabChange}=_ref12;return tabChange?.geographyTab||oldTab}}],isPathCleaningEnabled:[null,persistConfig,{setIsPathCleaningEnabled:(_,_ref13)=>{let{isPathCleaningEnabled}=_ref13;return isPathCleaningEnabled}}],_modalTileAndTab:[null,{openModal:(_,_ref14)=>{let{tileId,tabId}=_ref14;return{tileId,tabId}},closeModal:()=>null}],dateFilter:[{dateFrom:"-7d",dateTo:null,interval:initialInterval},persistConfig,{setDates:(_,_ref15)=>{let{dateTo,dateFrom}=_ref15;return{dateTo,dateFrom,interval:(0,utils.Rx)(dateFrom,dateTo)}},setInterval:(_ref16,_ref17)=>{let{dateFrom:oldDateFrom,dateTo:oldDateTo}=_ref16,{interval}=_ref17,{dateFrom,dateTo}=(0,utils.pQ)(interval,oldDateFrom,oldDateTo);return{dateTo,dateFrom,interval}},setDatesAndInterval:(_,_ref18)=>{let{dateTo,dateFrom,interval}=_ref18;return dateFrom||dateTo||(dateFrom="-7d",dateTo=null),{dateTo,dateFrom,interval:interval||(0,utils.Rx)(dateFrom,dateTo)}}}],shouldFilterTestAccounts:[!1,persistConfig,{setShouldFilterTestAccounts:(_,_ref19)=>{let{shouldFilterTestAccounts}=_ref19;return shouldFilterTestAccounts}}],shouldStripQueryParams:[!1,persistConfig,{setShouldStripQueryParams:(_,_ref20)=>{let{shouldStripQueryParams}=_ref20;return shouldStripQueryParams}}],conversionGoal:[null,persistConfig,{setConversionGoal:(_,_ref21)=>{let{conversionGoal}=_ref21;return conversionGoal}}],conversionGoalWarning:[null,{setConversionGoalWarning:(_,_ref22)=>{let{warning}=_ref22;return warning}}],compareFilter:[{compare:!0},persistConfig,{setCompareFilter:(_,_ref23)=>{let{compareFilter}=_ref23;return compareFilter}}]}),(0,index_esm.selectors)(_ref24=>{let{actions,values}=_ref24;return{graphsTab:[s=>[s._graphsTab],graphsTab=>graphsTab||GraphsTab.UNIQUE_USERS],sourceTab:[s=>[s._sourceTab],sourceTab=>sourceTab||SourceTab.CHANNEL],deviceTab:[s=>[s._deviceTab],deviceTab=>deviceTab||DeviceTab.DEVICE_TYPE],pathTab:[s=>[s._pathTab],pathTab=>pathTab||PathTab.PATH],geographyTab:[s=>[s._geographyTab],geographyTab=>geographyTab||GeographyTab.MAP],tabs:[s=>[s.graphsTab,s.sourceTab,s.deviceTab,s.pathTab,s.geographyTab,()=>values.shouldShowGeographyTile],(graphsTab,sourceTab,deviceTab,pathTab,geographyTab,shouldShowGeographyTile)=>({graphsTab,sourceTab,deviceTab,pathTab,geographyTab,shouldShowGeographyTile})],controls:[s=>[s.isPathCleaningEnabled,s.shouldFilterTestAccounts,s.shouldStripQueryParams],(isPathCleaningEnabled,filterTestAccounts,shouldStripQueryParams)=>({isPathCleaningEnabled,filterTestAccounts,shouldStripQueryParams})],filters:[s=>[s.webAnalyticsFilters,s.replayFilters,s.dateFilter,s.compareFilter,()=>values.conversionGoal],(webAnalyticsFilters,replayFilters,dateFilter,compareFilter,conversionGoal)=>({webAnalyticsFilters,replayFilters,dateFilter,compareFilter,conversionGoal})],tiles:[s=>[s.tabs,s.controls,s.filters,()=>values.featureFlags,()=>values.isGreaterThanMd],(_ref25,_ref26,_ref27,featureFlags,isGreaterThanMd)=>{let{graphsTab,sourceTab,deviceTab,pathTab,geographyTab,shouldShowGeographyTile}=_ref25,{isPathCleaningEnabled,filterTestAccounts,shouldStripQueryParams}=_ref26,{webAnalyticsFilters,replayFilters,dateFilter:{dateFrom,dateTo,interval},conversionGoal,compareFilter}=_ref27,dateRange={date_from:dateFrom,date_to:dateTo},sampling={enabled:!1,forceSamplingRate:{numerator:1,denominator:10}},createInsightProps=(tile,tab)=>({dashboardItemId:getDashboardItemId(tile,tab,!1),loadPriority:loadPriorityMap[tile],dataNodeCollectionId:WEB_ANALYTICS_DATA_COLLECTION_NODE_ID}),uniqueUserSeries={event:featureFlags[constants.y8.WEB_ANALYTICS_FOR_MOBILE]?"$screen":"$pageview",kind:schema.OH.EventsNode,math:types.vN.UniqueUsers,name:"Pageview",custom_name:"Unique visitors"},pageViewsSeries={...uniqueUserSeries,math:types.vN.TotalCount,custom_name:featureFlags[constants.y8.WEB_ANALYTICS_FOR_MOBILE]?"Screen Views":"Page views"},sessionsSeries={...uniqueUserSeries,math:types.vN.UniqueSessions,custom_name:"Sessions"},uniqueConversionsSeries=conversionGoal?"actionId"in conversionGoal?{kind:schema.OH.ActionsNode,id:conversionGoal.actionId,math:types.vN.UniqueUsers,name:"Unique conversions",custom_name:"Unique conversions"}:{kind:schema.OH.EventsNode,event:conversionGoal.customEventName,math:types.vN.UniqueUsers,name:"Unique conversions",custom_name:"Unique conversions"}:void 0,totalConversionSeries=uniqueConversionsSeries?{...uniqueConversionsSeries,math:types.vN.TotalCount,name:"Total conversions",custom_name:"Total conversions"}:void 0,createGraphsTrendsTab=(id,title,linkText,series,trendsFilter)=>({id,title,linkText,query:{kind:schema.OH.InsightVizNode,source:{kind:schema.OH.TrendsQuery,dateRange,interval,series:series,trendsFilter:{display:types.Qb.ActionsLineGraph,...trendsFilter},compareFilter,filterTestAccounts,conversionGoal:featureFlags[constants.y8.WEB_ANALYTICS_CONVERSION_GOAL_FILTERS]?conversionGoal:void 0,properties:webAnalyticsFilters},hidePersonsModal:!0,embedded:!0},showIntervalSelect:!0,insightProps:createInsightProps(TileId.GRAPHS,id),canOpenInsight:!0}),createTableTab=(tileId,tabId,title,linkText,breakdownBy,source,tab)=>{let columns=["breakdown_value","visitors","views"];return source?.includeBounceRate&&columns.push("bounce_rate"),{id:tabId,title,linkText,query:{full:!0,kind:schema.OH.DataTableNode,source:{kind:schema.OH.WebStatsTableQuery,properties:webAnalyticsFilters,breakdownBy:breakdownBy,dateRange,sampling,compareFilter,limit:10,filterTestAccounts,conversionGoal:featureFlags[constants.y8.WEB_ANALYTICS_CONVERSION_GOAL_FILTERS]?conversionGoal:void 0,...source||{}},embedded:!1,columns},insightProps:createInsightProps(tileId,tabId),canOpenModal:!0,...tab||{}}},pathCleaningSettingsUrl=urls.j.settings("project-product-analytics","path-cleaning"),customChannelTypesUrl=urls.j.settings("environment-web-analytics","channel-type"),pathCleaningControl=(0,jsx_runtime.jsx)(LemonSwitch.f,{label:(0,jsx_runtime.jsxs)("div",{className:"flex flex-row space-x-2",children:[(0,jsx_runtime.jsx)(Tooltip.u,{title:(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:["Check"," ",(0,jsx_runtime.jsx)(Link.r,{to:"https://posthog.com/docs/product-analytics/paths#path-cleaning-rules",children:"our path cleaning rules documentation"})," ","to learn more about path cleaning"]}),interactive:!0,children:(0,jsx_runtime.jsx)("span",{children:"Enable path cleaning"})}),(0,jsx_runtime.jsx)(LemonButton.J,{icon:(0,jsx_runtime.jsx)(posthog_icons_es.IconGear,{}),type:"tertiary",status:"alt",size:"small",noPadding:!0,tooltip:"Edit path cleaning settings",to:pathCleaningSettingsUrl})]}),checked:!!isPathCleaningEnabled,onChange:value=>actions.setIsPathCleaningEnabled(value),className:"h-full"}),allTiles=[{kind:"query",tileId:TileId.OVERVIEW,layout:{colSpanClassName:"md:col-span-full",orderWhenLargeClassName:"xxl:order-0"},query:{kind:schema.OH.WebOverviewQuery,properties:webAnalyticsFilters,dateRange,sampling,compareFilter,filterTestAccounts,conversionGoal,includeLCPScore:!0},insightProps:createInsightProps(TileId.OVERVIEW),canOpenModal:!1},{kind:"tabs",tileId:TileId.GRAPHS,layout:{colSpanClassName:"md:col-span-2",orderWhenLargeClassName:"xxl:order-1"},activeTabId:graphsTab,setTabId:actions.setGraphsTab,tabs:[createGraphsTrendsTab(GraphsTab.UNIQUE_USERS,"Unique visitors","Visitors",[uniqueUserSeries]),conversionGoal?null:createGraphsTrendsTab(GraphsTab.PAGE_VIEWS,"Page views","Views",[pageViewsSeries]),conversionGoal?null:createGraphsTrendsTab(GraphsTab.NUM_SESSION,"Unique sessions","Sessions",[sessionsSeries]),conversionGoal&&uniqueConversionsSeries?createGraphsTrendsTab(GraphsTab.UNIQUE_CONVERSIONS,"Unique conversions","Unique conversions",[uniqueConversionsSeries]):null,conversionGoal&&totalConversionSeries?createGraphsTrendsTab(GraphsTab.TOTAL_CONVERSIONS,"Total conversions","Total conversions",[totalConversionSeries]):null,conversionGoal&&uniqueUserSeries&&uniqueConversionsSeries?createGraphsTrendsTab(GraphsTab.CONVERSION_RATE,"Conversion rate","Conversion rate",[uniqueConversionsSeries,uniqueUserSeries],{formula:"A / B",aggregationAxisFormat:"percentage_scaled"}):null].filter(utils.DX)},{kind:"tabs",tileId:TileId.PATHS,layout:{colSpanClassName:"md:col-span-2",orderWhenLargeClassName:"xxl:order-4"},activeTabId:pathTab,setTabId:actions.setPathTab,tabs:featureFlags[constants.y8.WEB_ANALYTICS_FOR_MOBILE]?[createTableTab(TileId.PATHS,PathTab.SCREEN_NAME,"Screens","Screen",schema.GI.ScreenName,{},{})]:[createTableTab(TileId.PATHS,PathTab.PATH,"Paths","Path",schema.GI.Page,{includeScrollDepth:!1,includeBounceRate:!0,doPathCleaning:!!isPathCleaningEnabled},{control:pathCleaningControl,docs:{url:"https://posthog.com/docs/web-analytics/dashboard#paths",title:"Paths",description:(0,jsx_runtime.jsxs)("div",{children:[(0,jsx_runtime.jsx)("p",{children:"In this view you can validate all of the paths that were accessed in your application, regardless of when they were accessed through the lifetime of a user session."}),conversionGoal?(0,jsx_runtime.jsx)("p",{children:"The conversion rate is the percentage of users who completed the conversion goal in this specific path."}):(0,jsx_runtime.jsxs)("p",{children:["The"," ",(0,jsx_runtime.jsx)(Link.r,{to:"https://posthog.com/docs/web-analytics/dashboard#bounce-rate",children:"bounce rate"})," ","indicates the percentage of users who left your page immediately after visiting without capturing any event."]})]})}}),createTableTab(TileId.PATHS,PathTab.INITIAL_PATH,"Entry paths","Entry path",schema.GI.InitialPage,{includeBounceRate:!0,includeScrollDepth:!1,doPathCleaning:!!isPathCleaningEnabled},{control:pathCleaningControl,docs:{url:"https://posthog.com/docs/web-analytics/dashboard#paths",title:"Entry Path",description:(0,jsx_runtime.jsxs)("div",{children:[(0,jsx_runtime.jsx)("p",{children:"Entry paths are the paths a user session started, i.e. the first path they saw when they opened your website."}),conversionGoal&&(0,jsx_runtime.jsx)("p",{children:"The conversion rate is the percentage of users who completed the conversion goal after the first path in their session being this path."})]})}}),createTableTab(TileId.PATHS,PathTab.END_PATH,"End paths","End path",schema.GI.ExitPage,{includeBounceRate:!1,includeScrollDepth:!1,doPathCleaning:!!isPathCleaningEnabled},{control:pathCleaningControl,docs:{url:"https://posthog.com/docs/web-analytics/dashboard#paths",title:"End Path",description:(0,jsx_runtime.jsx)("div",{children:"End paths are the last path a user visited before their session ended, i.e. the last path they saw before leaving your website/closing the browser/turning their computer off."})}}),{id:PathTab.EXIT_CLICK,title:"Outbound link clicks",linkText:"Outbound clicks",query:{full:!0,kind:schema.OH.DataTableNode,source:{kind:schema.OH.WebExternalClicksTableQuery,properties:webAnalyticsFilters,dateRange,compareFilter,sampling,limit:10,filterTestAccounts,conversionGoal:featureFlags[constants.y8.WEB_ANALYTICS_CONVERSION_GOAL_FILTERS]?conversionGoal:void 0,stripQueryParams:shouldStripQueryParams},embedded:!1,columns:["url","visitors","clicks"]},insightProps:createInsightProps(TileId.PATHS,PathTab.END_PATH),canOpenModal:!0,docs:{title:"Outbound Clicks",description:(0,jsx_runtime.jsx)("div",{children:"You'll be able to verify when someone leaves your website by clicking an outbound link (to a separate domain)"})}}].filter(utils.DX)},{kind:"tabs",tileId:TileId.SOURCES,layout:{colSpanClassName:"md:col-span-1",orderWhenLargeClassName:"xxl:order-2"},activeTabId:sourceTab,setTabId:actions.setSourceTab,tabs:[createTableTab(TileId.SOURCES,SourceTab.CHANNEL,"Channels","Channel",schema.GI.InitialChannelType,{},{control:(0,jsx_runtime.jsxs)("div",{className:"flex flex-row space-x-2 font-medium",children:[(0,jsx_runtime.jsx)("span",{children:"Customize channel types"}),(0,jsx_runtime.jsx)(LemonButton.J,{icon:(0,jsx_runtime.jsx)(posthog_icons_es.IconGear,{}),type:"tertiary",status:"alt",size:"small",noPadding:!0,tooltip:"Customize channel types",to:customChannelTypesUrl})]}),docs:{url:"https://posthog.com/docs/data/channel-type",title:"Channels",description:(0,jsx_runtime.jsxs)("div",{children:[(0,jsx_runtime.jsx)("p",{children:"Channels are the different sources that bring traffic to your website, e.g. Paid Search, Organic Social, Direct, etc."}),(0,jsx_runtime.jsxs)("p",{children:["You can also"," ",(0,jsx_runtime.jsx)(Link.r,{to:urls.j.settings("environment-web-analytics","channel-type"),children:"create custom channel types"}),", allowing you to further categorize your channels."]}),(0,jsx_runtime.jsxs)("p",{children:["Something unexpected? Try the"," ",(0,jsx_runtime.jsx)(Link.r,{to:urls.j.sessionAttributionExplorer(),children:"Session attribution explorer"})]})]})}}),createTableTab(TileId.SOURCES,SourceTab.REFERRING_DOMAIN,"Referrers","Referring domain",schema.GI.InitialReferringDomain,{},{docs:{url:"https://posthog.com/docs/web-analytics/dashboard#referrers-channels-utms",title:"Referrers",description:"Understand where your users are coming from"}}),createTableTab(TileId.SOURCES,SourceTab.UTM_SOURCE,"UTM sources","UTM source",schema.GI.InitialUTMSource,{},{docs:{url:"https://posthog.com/docs/web-analytics/dashboard#utms",title:"UTM source",description:(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:["Understand where your users are coming from - filtered down by their"," ",(0,jsx_runtime.jsx)("code",{children:"utm_source"})," parameter"]})}}),createTableTab(TileId.SOURCES,SourceTab.UTM_MEDIUM,"UTM medium","UTM medium",schema.GI.InitialUTMMedium,{},{docs:{url:"https://posthog.com/docs/web-analytics/dashboard#utms",title:"UTM medium",description:(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:["Understand where your users are coming from - filtered down by their"," ",(0,jsx_runtime.jsx)("code",{children:"utm_medium"})," parameter"]})}}),createTableTab(TileId.SOURCES,SourceTab.UTM_CAMPAIGN,"UTM campaigns","UTM campaign",schema.GI.InitialUTMCampaign,{},{docs:{url:"https://posthog.com/docs/web-analytics/dashboard#utms",title:"UTM campaign",description:(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:["Understand where your users are coming from - filtered down by their"," ",(0,jsx_runtime.jsx)("code",{children:"utm_campaign"})," parameter"]})}}),createTableTab(TileId.SOURCES,SourceTab.UTM_CONTENT,"UTM content","UTM content",schema.GI.InitialUTMContent,{},{docs:{url:"https://posthog.com/docs/web-analytics/dashboard#utms",title:"UTM content",description:(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:["Understand where your users are coming from - filtered down by their"," ",(0,jsx_runtime.jsx)("code",{children:"utm_content"})," parameter"]})}}),createTableTab(TileId.SOURCES,SourceTab.UTM_TERM,"UTM terms","UTM term",schema.GI.InitialUTMTerm,{},{docs:{url:"https://posthog.com/docs/web-analytics/dashboard#utms",title:"UTM term",description:(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:["Understand where your users are coming from - filtered down by their"," ",(0,jsx_runtime.jsx)("code",{children:"utm_term"})," parameter"]})}}),createTableTab(TileId.SOURCES,SourceTab.UTM_SOURCE_MEDIUM_CAMPAIGN,"Source / Medium / Campaign","UTM s/m/c",schema.GI.InitialUTMSourceMediumCampaign,{},{docs:{url:"https://posthog.com/docs/web-analytics/dashboard#utms",title:"UTM parameters",description:(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:["Understand where your users are coming from - filtered down by a tuple of their ",(0,jsx_runtime.jsx)("code",{children:"utm_source"}),", ",(0,jsx_runtime.jsx)("code",{children:"utm_medium"}),", and"," ",(0,jsx_runtime.jsx)("code",{children:"utm_campaign"})," parameters"]})}})]},{kind:"tabs",tileId:TileId.DEVICES,layout:{colSpanClassName:"md:col-span-1",orderWhenLargeClassName:"xxl:order-3"},activeTabId:deviceTab,setTabId:actions.setDeviceTab,tabs:[createTableTab(TileId.DEVICES,DeviceTab.DEVICE_TYPE,"Device type","Device type",schema.GI.DeviceType),createTableTab(TileId.DEVICES,DeviceTab.BROWSER,"Browsers","Browser",schema.GI.Browser),createTableTab(TileId.DEVICES,DeviceTab.OS,"OS","OS",schema.GI.OS),createTableTab(TileId.DEVICES,DeviceTab.VIEWPORT,"Viewports","Viewport",schema.GI.Viewport)]},shouldShowGeographyTile?{kind:"tabs",tileId:TileId.GEOGRAPHY,layout:{colSpanClassName:"md:col-span-full"},activeTabId:geographyTab||GeographyTab.MAP,setTabId:actions.setGeographyTab,tabs:[{id:GeographyTab.MAP,title:"World map",linkText:"Map",query:{kind:schema.OH.InsightVizNode,source:{kind:schema.OH.TrendsQuery,breakdownFilter:{breakdown:"$geoip_country_code",breakdown_type:"event"},dateRange,series:[{event:"$pageview",name:"Pageview",kind:schema.OH.EventsNode,math:types.vN.UniqueUsers}],trendsFilter:{display:types.Qb.WorldMap},conversionGoal:featureFlags[constants.y8.WEB_ANALYTICS_CONVERSION_GOAL_FILTERS]?conversionGoal:void 0,filterTestAccounts,properties:webAnalyticsFilters},hidePersonsModal:!0,embedded:!0},insightProps:createInsightProps(TileId.GEOGRAPHY,GeographyTab.MAP),canOpenInsight:!0},createTableTab(TileId.GEOGRAPHY,GeographyTab.COUNTRIES,"Countries","Countries",schema.GI.Country),createTableTab(TileId.GEOGRAPHY,GeographyTab.REGIONS,"Regions","Regions",schema.GI.Region),createTableTab(TileId.GEOGRAPHY,GeographyTab.CITIES,"Cities","Cities",schema.GI.City),createTableTab(TileId.GEOGRAPHY,GeographyTab.TIMEZONES,"Timezones","Timezones",schema.GI.Timezone),createTableTab(TileId.GEOGRAPHY,GeographyTab.LANGUAGES,"Languages","Languages",schema.GI.Language)]}:null,conversionGoal?null:{kind:"query",tileId:TileId.RETENTION,title:"Retention",layout:{colSpanClassName:"md:col-span-2"},query:{kind:schema.OH.InsightVizNode,source:{kind:schema.OH.RetentionQuery,properties:webAnalyticsFilters,dateRange,filterTestAccounts,retentionFilter:{retentionType:constants.qL,retentionReference:"total",totalIntervals:isGreaterThanMd?8:5,period:types.xW.Week}},vizSpecificOptions:{[types.dw.RETENTION]:{hideLineGraph:!0,hideSizeColumn:!isGreaterThanMd,useSmallLayout:!isGreaterThanMd}},embedded:!0},insightProps:createInsightProps(TileId.RETENTION),canOpenInsight:!1,canOpenModal:!0,docs:{url:"https://posthog.com/docs/web-analytics/dashboard#retention",title:"Retention",description:(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:(0,jsx_runtime.jsxs)("div",{children:[(0,jsx_runtime.jsx)("p",{children:"Retention creates a cohort of unique users who performed any event for the first time in the last week. It then tracks the percentage of users who return to perform any event in the following weeks."}),(0,jsx_runtime.jsx)("p",{children:"You want the numbers to be the highest possible, suggesting that people that come to your page continue coming to your page - and performing an actions. Also, the further down the table the higher the numbers should be (or at least as high), which would indicate that you're either increasing or keeping your retention at the same level."})]})})}},conversionGoal?null:{kind:"query",tileId:TileId.GOALS,title:"Goals",layout:{colSpanClassName:"md:col-span-2"},query:{full:!0,kind:schema.OH.DataTableNode,source:{kind:schema.OH.WebGoalsQuery,properties:webAnalyticsFilters,dateRange,compareFilter,sampling,limit:10,filterTestAccounts},embedded:!0,columns:["breakdown_value","visitors","views"]},insightProps:createInsightProps(TileId.GOALS),canOpenInsight:!1,canOpenModal:!1,docs:{url:"https://posthog.com/docs/web-analytics/dashboard#goals",title:"Goals",description:(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:(0,jsx_runtime.jsx)("div",{children:(0,jsx_runtime.jsxs)("p",{children:["Goals shows your pinned or most recently created actions and the number of conversions they've had. You can set a custom event or action as a"," ",(0,jsx_runtime.jsx)(Link.r,{to:"https://posthog.com/docs/web-analytics/conversion-goals",children:"conversion goal"})," ","at the top of the dashboard for more specific metrics."]})})})}},conversionGoal?null:{kind:"replay",tileId:TileId.REPLAY,layout:{colSpanClassName:conversionGoal?"md:col-span-full":"md:col-span-1"},docs:{url:"https://posthog.com/docs/session-replay",title:"Session Replay",description:"Play back sessions to diagnose UI issues, improve support, and get context for nuanced user behavior."}},!conversionGoal&&featureFlags[constants.y8.ERROR_TRACKING]?{kind:"error_tracking",tileId:TileId.ERROR_TRACKING,layout:{colSpanClassName:"md:col-span-1"},query:(0,queries.mx)({orderBy:"users",dateRange:dateRange,filterTestAccounts:filterTestAccounts,filterGroup:replayFilters.filter_group,sparklineSelectedPeriod:null,columns:["error","users","occurrences"],limit:4}),docs:{url:"https://posthog.com/docs/error-tracking",title:"Error Tracking",description:(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:(0,jsx_runtime.jsxs)("div",{children:[(0,jsx_runtime.jsx)("p",{children:"Error tracking allows you to track, investigate, and resolve exceptions your customers face."}),(0,jsx_runtime.jsxs)("p",{children:["Errors are captured as ",(0,jsx_runtime.jsx)("code",{children:"$exception"})," events which means that you can create insights, filter recordings and trigger surveys based on them exactly the same way you can for any other type of event."]})]})})}}:null];return allTiles.filter(utils.DX)}],modal:[s=>[s.tiles,s._modalTileAndTab],(tiles,modalTileAndTab)=>{if(!modalTileAndTab)return null;let{tileId,tabId}=modalTileAndTab,tile=tiles.find(tile=>tile.tileId===tileId);if(!tile)return null;let extendQuery=query=>query.kind===schema.OH.DataTableNode&&(query.source.kind===schema.OH.WebStatsTableQuery||query.source.kind===schema.OH.WebExternalClicksTableQuery||query.source.kind===schema.OH.WebGoalsQuery)?{...query,source:{...query.source,limit:50}}:query;if("tabs"===tile.kind){let tab=tile.tabs.find(tab=>tab.id===tabId);return tab?{tileId,tabId,title:tab.title,showIntervalSelect:tab.showIntervalSelect,control:tab.control,insightProps:{dashboardItemId:getDashboardItemId(tileId,tabId,!0),loadPriority:0,doNotLoad:!1,dataNodeCollectionId:WEB_ANALYTICS_DATA_COLLECTION_NODE_ID},query:extendQuery(tab.query),canOpenInsight:tab.canOpenInsight}:null}return"query"===tile.kind?{tileId,title:tile.title,showIntervalSelect:tile.showIntervalSelect,control:tile.control,insightProps:{dashboardItemId:getDashboardItemId(tileId,void 0,!0),loadPriority:0,dataNodeCollectionId:WEB_ANALYTICS_DATA_COLLECTION_NODE_ID},query:extendQuery(tile.query)}:null}],hasCountryFilter:[s=>[s.webAnalyticsFilters],webAnalyticsFilters=>webAnalyticsFilters.some(filter=>"$geoip_country_code"===filter.key)],hasDeviceTypeFilter:[s=>[s.webAnalyticsFilters],webAnalyticsFilters=>webAnalyticsFilters.some(filter=>"$device_type"===filter.key)],hasBrowserFilter:[s=>[s.webAnalyticsFilters],webAnalyticsFilters=>webAnalyticsFilters.some(filter=>"$browser"===filter.key)],hasOSFilter:[s=>[s.webAnalyticsFilters],webAnalyticsFilters=>webAnalyticsFilters.some(filter=>"$os"===filter.key)],replayFilters:[s=>[s.webAnalyticsFilters,s.dateFilter,s.shouldFilterTestAccounts,s.conversionGoal,s.featureFlags],(webAnalyticsFilters,dateFilter,shouldFilterTestAccounts,conversionGoal,featureFlags)=>{let filters=[...webAnalyticsFilters];return conversionGoal&&featureFlags[constants.y8.WEB_ANALYTICS_CONVERSION_GOAL_FILTERS]&&("actionId"in conversionGoal?filters.push({id:conversionGoal.actionId,name:String(conversionGoal.actionId),type:"actions"}):"customEventName"in conversionGoal&&filters.push({id:conversionGoal.customEventName,name:conversionGoal.customEventName,type:"events"})),{filter_test_accounts:shouldFilterTestAccounts,date_from:dateFilter.dateFrom,date_to:dateFilter.dateTo,filter_group:{type:types.J2.And,values:[{type:types.J2.And,values:filters}]},duration:[{type:types.FT.Recording,key:"active_seconds",operator:types.WV.GreaterThan,value:1}]}}],getNewInsightUrl:[s=>[s.tiles],tiles=>function getNewInsightUrl(tileId,tabId){let formatQueryForNewInsight=query=>query.kind===schema.OH.InsightVizNode?{...query,embedded:void 0,hidePersonsModal:void 0}:query,tile=tiles.find(tile=>tile.tileId===tileId);if(tile){if("tabs"===tile.kind){let tab=tile.tabs.find(tab=>tab.id===tabId);if(!tab)return;return urls.j.insightNew(void 0,void 0,formatQueryForNewInsight(tab.query))}if("query"===tile.kind)return urls.j.insightNew(void 0,void 0,formatQueryForNewInsight(tile.query));if("replay"===tile.kind)return urls.j.replay()}}]}}),(0,lib.loaders)(()=>({statusCheck:{__default:null,loadStatusCheck:async()=>{let[pageviewResult,pageleaveResult,pageleaveScroll]=await Promise.allSettled([api.ZP.eventDefinitions.list({event_type:types.uW.Event,search:"$pageview"}),api.ZP.eventDefinitions.list({event_type:types.uW.Event,search:"$pageleave"}),api.ZP.propertyDefinitions.list({event_names:["$pageleave"],properties:["$prev_pageview_max_content_percentage"]})]),pageviewEntry="fulfilled"===pageviewResult.status?pageviewResult.value.results.find(r=>"$pageview"===r.name):void 0,pageleaveEntry="fulfilled"===pageleaveResult.status?pageleaveResult.value.results.find(r=>"$pageleave"===r.name):void 0,pageleaveScrollEntry="fulfilled"===pageleaveScroll.status?pageleaveScroll.value.results.find(r=>"$prev_pageview_max_content_percentage"===r.name):void 0,isSendingPageViews=!!pageviewEntry&&!isDefinitionStale(pageviewEntry),isSendingPageLeaves=!!pageleaveEntry&&!isDefinitionStale(pageleaveEntry),isSendingPageLeavesScroll=!!pageleaveScrollEntry&&!isDefinitionStale(pageleaveScrollEntry);return{isSendingPageViews,isSendingPageLeaves,isSendingPageLeavesScroll}}},shouldShowGeographyTile:{_default:null,loadShouldShowGeographyTile:async()=>{let[propertiesResponse,pluginsResponse,pluginsConfigResponse]=await Promise.allSettled([api.ZP.propertyDefinitions.list({event_names:["$pageview"],properties:["$geoip_country_code"]}),api.ZP.loadPaginatedResults("api/organizations/@current/plugins"),api.ZP.loadPaginatedResults("api/plugin_config")]),hasNonStaleCountryCodeDefinition="fulfilled"===propertiesResponse.status&&propertiesResponse.value.results.some(property=>"$geoip_country_code"===property.name&&!isDefinitionStale(property));if(!hasNonStaleCountryCodeDefinition)return!1;let geoIpPlugin="fulfilled"===pluginsResponse.status&&pluginsResponse.value.find(plugin=>plugin.url&&GEOIP_PLUGIN_URLS.includes(plugin.url)),geoIpPluginId=geoIpPlugin?geoIpPlugin.id:void 0,geoIpPluginConfig=(0,utils.DX)(geoIpPluginId)&&"fulfilled"===pluginsConfigResponse.status&&pluginsConfigResponse.value.find(plugin=>plugin.plugin===geoIpPluginId);return!!geoIpPluginConfig&&geoIpPluginConfig.enabled}}})),(0,index_esm.afterMount)(_ref28=>{let{actions}=_ref28;actions.loadStatusCheck(),actions.loadShouldShowGeographyTile()}),(0,kea_window_values_lib.windowValues)({isGreaterThanMd:window1=>window1.innerWidth>768}),(0,kea_router_lib.actionToUrl)(_ref29=>{let{values}=_ref29,stateToUrl=()=>{let{webAnalyticsFilters,conversionGoal,dateFilter:{dateTo,dateFrom,interval},_sourceTab,_deviceTab,_pathTab,_geographyTab,_graphsTab,isPathCleaningEnabled,shouldFilterTestAccounts,compareFilter}=values,urlParams=new URLSearchParams;return webAnalyticsFilters.length>0&&urlParams.set("filters",JSON.stringify(webAnalyticsFilters)),conversionGoal&&("actionId"in conversionGoal?urlParams.set("conversionGoal.actionId",conversionGoal.actionId.toString()):urlParams.set("conversionGoal.customEventName",conversionGoal.customEventName)),("-7d"!==dateFrom||null!==dateTo||interval!==initialInterval)&&(urlParams.set("date_from",null!=dateFrom?dateFrom:""),urlParams.set("date_to",null!=dateTo?dateTo:""),urlParams.set("interval",null!=interval?interval:"")),_deviceTab&&urlParams.set("device_tab",_deviceTab),_sourceTab&&urlParams.set("source_tab",_sourceTab),_graphsTab&&urlParams.set("graphs_tab",_graphsTab),_pathTab&&urlParams.set("path_tab",_pathTab),_geographyTab&&urlParams.set("geography_tab",_geographyTab),null!=isPathCleaningEnabled&&urlParams.set("path_cleaning",isPathCleaningEnabled.toString()),null!=shouldFilterTestAccounts&&urlParams.set("filter_test_accounts",shouldFilterTestAccounts.toString()),compareFilter&&urlParams.set("compare_filter",JSON.stringify(compareFilter)),`/web?${urlParams.toString()}`};return{setWebAnalyticsFilters:stateToUrl,togglePropertyFilter:stateToUrl,setConversionGoal:stateToUrl,setDates:stateToUrl,setInterval:stateToUrl,setDeviceTab:stateToUrl,setSourceTab:stateToUrl,setGraphsTab:stateToUrl,setPathTab:stateToUrl,setGeographyTab:stateToUrl,setCompareFilter:stateToUrl}}),(0,kea_router_lib.urlToAction)(_ref30=>{let{actions,values}=_ref30;return{"/web":(_,_ref31)=>{let{filters,"conversionGoal.actionId":conversionGoalActionId,"conversionGoal.customEventName":conversionGoalCustomEventName,date_from,date_to,interval,device_tab,source_tab,graphs_tab,path_tab,geography_tab,path_cleaning,filter_test_accounts,compare_filter}=_ref31,parsedFilters=(0,schema_guards.X)(filters)?filters:void 0;parsedFilters&&!(0,utils.h0)(parsedFilters,values.webAnalyticsFilters)&&actions.setWebAnalyticsFilters(parsedFilters),conversionGoalActionId&&conversionGoalActionId!==values.conversionGoal?.actionId?actions.setConversionGoal({actionId:parseInt(conversionGoalActionId,10)}):conversionGoalCustomEventName&&conversionGoalCustomEventName!==values.conversionGoal?.customEventName&&actions.setConversionGoal({customEventName:conversionGoalCustomEventName}),(date_from&&date_from!==values.dateFilter.dateFrom||date_to&&date_to!==values.dateFilter.dateTo||interval&&interval!==values.dateFilter.interval)&&actions.setDatesAndInterval(date_from,date_to,interval),device_tab&&device_tab!==values._deviceTab&&actions.setDeviceTab(device_tab),source_tab&&source_tab!==values._sourceTab&&actions.setSourceTab(source_tab),graphs_tab&&graphs_tab!==values._graphsTab&&actions.setGraphsTab(graphs_tab),path_tab&&path_tab!==values._pathTab&&actions.setPathTab(path_tab),geography_tab&&geography_tab!==values._geographyTab&&actions.setGeographyTab(geography_tab),path_cleaning&&path_cleaning!==values.isPathCleaningEnabled&&actions.setIsPathCleaningEnabled([!0,"true",1,"1"].includes(path_cleaning)),filter_test_accounts&&filter_test_accounts!==values.shouldFilterTestAccounts&&actions.setShouldFilterTestAccounts([!0,"true",1,"1"].includes(filter_test_accounts)),compare_filter&&!(0,utils.h0)(compare_filter,values.compareFilter)&&actions.setCompareFilter(compare_filter)}}}),(0,index_esm.listeners)(_ref32=>{let{values,actions}=_ref32,checkGraphsTabIsCompatibleWithConversionGoal=(tab,conversionGoal)=>{conversionGoal?(tab===GraphsTab.PAGE_VIEWS||tab===GraphsTab.NUM_SESSION)&&actions.setGraphsTab(GraphsTab.UNIQUE_USERS):(tab===GraphsTab.TOTAL_CONVERSIONS||tab===GraphsTab.CONVERSION_RATE||tab===GraphsTab.UNIQUE_CONVERSIONS)&&actions.setGraphsTab(GraphsTab.UNIQUE_USERS)};return{setGraphsTab:_ref33=>{let{tab}=_ref33;checkGraphsTabIsCompatibleWithConversionGoal(tab,values.conversionGoal)},setConversionGoal:[_ref34=>{let{conversionGoal}=_ref34;checkGraphsTabIsCompatibleWithConversionGoal(values.graphsTab,conversionGoal)},(_ref35,breakpoint)=>{let{conversionGoal}=_ref35;return checkCustomEventConversionGoalHasSessionIdsHelper(conversionGoal,breakpoint,actions.setConversionGoalWarning)}]}}),(0,index_esm.afterMount)(_ref36=>{let{actions,values}=_ref36;checkCustomEventConversionGoalHasSessionIdsHelper(values.conversionGoal,void 0,actions.setConversionGoalWarning).catch(()=>{})})]),isDefinitionStale=definition=>{let parsedLastSeen=definition.last_seen_at?(0,dayjs.Bv)(definition.last_seen_at):null;return!!parsedLastSeen&&(0,dayjs.Bv)().diff(parsedLastSeen,"seconds")>constants.Mo},checkCustomEventConversionGoalHasSessionIdsHelper=async(conversionGoal,breakpoint,setConversionGoalWarning)=>{if(!conversionGoal||!("customEventName"in conversionGoal)||!conversionGoal.customEventName){setConversionGoalWarning(null);return}let{customEventName}=conversionGoal,response=await (0,query.Uu)("select count() from events where timestamp >= (now() - toIntervalHour(24)) AND ($session_id IS NULL OR $session_id = '') AND event = {event}",{event:customEventName});breakpoint?.();let row=response.results[0];setConversionGoalWarning(row[0]?ConversionGoalWarning.CustomEventWithNoSessionId:null)};var LemonMenu=__webpack_require__("./frontend/src/lib/lemon-ui/LemonMenu/index.ts");let WebAnalyticsMenu=()=>{let{shouldFilterTestAccounts}=(0,index_esm.useValues)(webAnalyticsLogic),{setShouldFilterTestAccounts}=(0,index_esm.useActions)(webAnalyticsLogic);return(0,jsx_runtime.jsx)(LemonMenu.d,{items:[{label:"Session Attribution Explorer",to:urls.j.sessionAttributionExplorer(),icon:(0,jsx_runtime.jsx)(posthog_icons_es.IconSearch,{})},{label:()=>(0,jsx_runtime.jsx)(LemonSwitch.f,{checked:shouldFilterTestAccounts,onChange:()=>{setShouldFilterTestAccounts(!shouldFilterTestAccounts)},fullWidth:!0,label:"Filter test accounts"})}],closeOnClickInside:!1,children:(0,jsx_runtime.jsx)(LemonButton.J,{icon:(0,jsx_runtime.jsx)(posthog_icons_es.IconEllipsis,{}),size:"small"})})};var clsx_m=__webpack_require__("./node_modules/.pnpm/clsx@1.2.1/node_modules/clsx/dist/clsx.m.js"),CompareFilter=__webpack_require__("./frontend/src/lib/components/CompareFilter/CompareFilter.tsx"),DateFilter=__webpack_require__("./frontend/src/lib/components/DateFilter/DateFilter.tsx"),VersionCheckerBanner=__webpack_require__("./frontend/src/lib/components/VersionChecker/VersionCheckerBanner.tsx"),icons=__webpack_require__("./frontend/src/lib/lemon-ui/icons/index.ts"),LemonSegmentedSelect=__webpack_require__("./frontend/src/lib/lemon-ui/LemonSegmentedSelect/LemonSegmentedSelect.tsx"),Popover=__webpack_require__("./frontend/src/lib/lemon-ui/Popover/index.ts"),react=__webpack_require__("./node_modules/.pnpm/react@18.2.0/node_modules/react/index.js"),TZLabel=__webpack_require__("./frontend/src/lib/components/TZLabel/index.tsx"),LemonTableLink=__webpack_require__("./frontend/src/lib/lemon-ui/LemonTable/LemonTableLink.tsx"),queryFeatures=__webpack_require__("./frontend/src/queries/nodes/DataTable/queryFeatures.ts"),Query=__webpack_require__("./frontend/src/queries/Query/Query.tsx");let context={extraDataTableQueryFeatures:[queryFeatures.P.hideLoadNextButton],showOpenEditorButton:!1,showQueryEditor:!1,columns:{error:{width:"50%",render:props=>{let record=props.record;return(0,jsx_runtime.jsx)("div",{className:"flex items-start space-x-1.5 group",children:(0,jsx_runtime.jsx)(LemonTableLink.i,{title:record.name||"Unknown Type",description:(0,jsx_runtime.jsxs)("div",{className:"space-y-1",children:[(0,jsx_runtime.jsx)("div",{className:"line-clamp-1",children:record.description}),(0,jsx_runtime.jsx)("div",{className:"space-x-1",children:(0,jsx_runtime.jsx)(TZLabel.w,{time:record.last_seen,className:"border-dotted border-b"})})]}),className:"flex-1",to:urls.j.errorTrackingIssue(record.id)})})}},users:{align:"right"},occurrences:{align:"right"}}},WebAnalyticsErrorTrackingTile=_ref=>{var _layout$colSpanClassN,_layout$rowSpanClassN,_layout$orderWhenLarg;let{tile}=_ref,{layout,query}=tile,to=urls.j.errorTracking();return(0,jsx_runtime.jsxs)("div",{className:(0,clsx_m.default)("col-span-1 row-span-1 flex flex-col",null!==(_layout$colSpanClassN=layout.colSpanClassName)&&void 0!==_layout$colSpanClassN?_layout$colSpanClassN:"md:col-span-6",null!==(_layout$rowSpanClassN=layout.rowSpanClassName)&&void 0!==_layout$rowSpanClassN?_layout$rowSpanClassN:"md:row-span-1",null!==(_layout$orderWhenLarg=layout.orderWhenLargeClassName)&&void 0!==_layout$orderWhenLarg?_layout$orderWhenLarg:"xxl:order-12",layout.className),children:[(0,jsx_runtime.jsx)("h2",{className:"m-0 mb-3",children:"Error tracking"}),(0,jsx_runtime.jsx)("div",{className:"border rounded bg-bg-light flex-1 flex flex-col py-2 px-1",children:(0,jsx_runtime.jsx)(Query.A,{query:query,embedded:!0,context:context})}),(0,jsx_runtime.jsx)("div",{className:"flex flex-row-reverse my-2",children:(0,jsx_runtime.jsx)(LemonButton.J,{to:to,icon:(0,jsx_runtime.jsx)(icons.pF,{}),size:"small",type:"secondary",children:"View all"})})]})};var EmptyMessage=__webpack_require__("./frontend/src/lib/components/EmptyMessage/EmptyMessage.tsx"),LemonSkeleton=__webpack_require__("./frontend/src/lib/lemon-ui/LemonSkeleton/index.ts"),WatchNextPanel=__webpack_require__("./frontend/src/scenes/project-homepage/WatchNextPanel.tsx"),sessionRecordingsPlaylistLogic=__webpack_require__("./frontend/src/scenes/session-recordings/playlist/sessionRecordingsPlaylistLogic.ts"),teamLogic=__webpack_require__("./frontend/src/scenes/teamLogic.tsx");function WebAnalyticsRecordingsTile(_ref){var _layout$colSpanClassN,_layout$rowSpanClassN,_layout$orderWhenLarg;let{tile}=_ref,{layout}=tile,{replayFilters,webAnalyticsFilters}=(0,index_esm.useValues)(webAnalyticsLogic),{currentTeam}=(0,index_esm.useValues)(teamLogic.H),sessionRecordingsListLogicInstance=(0,sessionRecordingsPlaylistLogic.YV)({logicKey:"webAnalytics",filters:replayFilters}),{sessionRecordings,sessionRecordingsResponseLoading}=(0,index_esm.useValues)(sessionRecordingsListLogicInstance),items=sessionRecordings.slice(0,5),emptyMessage=currentTeam?.session_recording_opt_in?webAnalyticsFilters.length>0?{title:"There are no recordings matching the current filters",description:"Try changing the filters, or view all recordings.",buttonText:"View all",buttonTo:urls.j.replay()}:{title:"There are no recordings matching this date range",description:"Make sure you have the javascript snippet setup in your website.",buttonText:"Learn more",buttonTo:"https://posthog.com/docs/user-guides/recordings"}:{title:"Recordings are not enabled for this project",description:"Once recordings are enabled, new recordings will display here.",buttonText:"Enable recordings",buttonTo:urls.j.settings("project-replay")},to=items.length>0?urls.j.replay(types.yd.Home,replayFilters):urls.j.replay();return(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:(0,jsx_runtime.jsxs)("div",{className:(0,clsx_m.default)("col-span-1 row-span-1 flex flex-col",null!==(_layout$colSpanClassN=layout.colSpanClassName)&&void 0!==_layout$colSpanClassN?_layout$colSpanClassN:"md:col-span-6",null!==(_layout$rowSpanClassN=layout.rowSpanClassName)&&void 0!==_layout$rowSpanClassN?_layout$rowSpanClassN:"md:row-span-1",null!==(_layout$orderWhenLarg=layout.orderWhenLargeClassName)&&void 0!==_layout$orderWhenLarg?_layout$orderWhenLarg:"xxl:order-12",layout.className),children:[(0,jsx_runtime.jsx)("h2",{className:"m-0 mb-3",children:"Session replay"}),(0,jsx_runtime.jsx)("div",{className:"border rounded bg-bg-light flex-1 flex flex-col py-2 px-1",children:sessionRecordingsResponseLoading?(0,jsx_runtime.jsx)("div",{className:"p-2 space-y-6",children:Array.from({length:6},(_,index)=>(0,jsx_runtime.jsx)(LemonSkeleton.y,{},index))}):0===items.length&&emptyMessage?(0,jsx_runtime.jsx)(EmptyMessage.M,{...emptyMessage}):items.map((item,index)=>(0,jsx_runtime.jsx)(WatchNextPanel.ZB,{recording:item},index))}),(0,jsx_runtime.jsx)("div",{className:"flex flex-row-reverse my-2",children:(0,jsx_runtime.jsx)(LemonButton.J,{to:to,icon:(0,jsx_runtime.jsx)(icons.pF,{}),size:"small",type:"secondary",children:"View all"})})]})})}var src=__webpack_require__("./frontend/@posthog/lemon-ui/src/index.ts"),colors=__webpack_require__("./frontend/src/lib/colors.ts"),IntervalFilter=__webpack_require__("./frontend/src/lib/components/IntervalFilter/index.ts"),ProductIntroduction=__webpack_require__("./frontend/src/lib/components/ProductIntroduction/ProductIntroduction.tsx"),NewActionButton=__webpack_require__("./frontend/src/scenes/actions/NewActionButton.tsx"),WorldMap=__webpack_require__("./frontend/src/scenes/insights/views/WorldMap/index.ts"),countryCodes=__webpack_require__("./frontend/src/scenes/insights/views/WorldMap/countryCodes.ts"),userLogic=__webpack_require__("./frontend/src/scenes/userLogic.ts"),actionsModel=__webpack_require__("./frontend/src/models/actionsModel.ts");let toUtcOffsetFormat=value=>{if(0===value)return"UTC";let integerPart=Math.floor(value),decimalPartAsMinutes=60*(value-integerPart),formattedMinutes=decimalPartAsMinutes>0?`:${decimalPartAsMinutes}`:"";return`UTC${integerPart>0?"+":"-"}${integerPart}${formattedMinutes}`},VariationCell=function(){let{isPercentage,reverseColors}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{isPercentage:!1,reverseColors:!1},formatNumber=value=>{var _value$toLocaleString;return isPercentage?`${(100*value).toFixed(1)}%`:null!==(_value$toLocaleString=value?.toLocaleString())&&void 0!==_value$toLocaleString?_value$toLocaleString:"(empty)"};return function Cell(_ref){let{value}=_ref,{compareFilter}=(0,index_esm.useValues)(webAnalyticsLogic);if(!value)return null;if(!Array.isArray(value))return(0,jsx_runtime.jsx)("span",{children:String(value)});let[current,previous]=value,pctChangeFromPrevious=0===previous&&0===current?0:null!==current&&compareFilter&&!1!==compareFilter.compare?null===previous||0===previous?1/0:current/previous-1:null,trend=null===pctChangeFromPrevious?null:0===pctChangeFromPrevious?{Icon:icons.cs,color:(0,colors.cM)("muted")}:pctChangeFromPrevious>0?{Icon:posthog_icons_es.IconTrending,color:reverseColors?(0,colors.cM)("danger"):(0,colors.cM)("success")}:{Icon:icons.j4,color:reverseColors?(0,colors.cM)("success"):(0,colors.cM)("danger")},tooltip=null!==pctChangeFromPrevious?`${current>=previous?"Increased":"Decreased"} by ${(0,utils.e9)(Math.abs(pctChangeFromPrevious),0)} since last period (from ${formatNumber(previous)} to ${formatNumber(current)})`:null;return(0,jsx_runtime.jsx)("div",{className:(0,clsx_m.default)({"pr-4":!trend}),children:(0,jsx_runtime.jsx)(src.u,{title:tooltip,children:(0,jsx_runtime.jsxs)("span",{children:[formatNumber(current),"\xa0",trend&&(0,jsx_runtime.jsx)("span",{style:{color:trend.color},children:(0,jsx_runtime.jsx)(trend.Icon,{color:trend.color,className:"ml-1"})})]})})})}},webStatsBreakdownToPropertyName=breakdownBy=>{switch(breakdownBy){case schema.GI.Page:return{key:"$pathname",type:types.FT.Event};case schema.GI.InitialPage:return{key:"$entry_pathname",type:types.FT.Session};case schema.GI.ExitPage:return{key:"$end_pathname",type:types.FT.Session};case schema.GI.ExitClick:return{key:"$last_external_click_url",type:types.FT.Session};case schema.GI.ScreenName:return{key:"$screen_name",type:types.FT.Event};case schema.GI.InitialChannelType:return{key:"$channel_type",type:types.FT.Session};case schema.GI.InitialReferringDomain:return{key:"$entry_referring_domain",type:types.FT.Session};case schema.GI.InitialUTMSource:return{key:"$entry_utm_source",type:types.FT.Session};case schema.GI.InitialUTMCampaign:return{key:"$entry_utm_campaign",type:types.FT.Session};case schema.GI.InitialUTMMedium:return{key:"$entry_utm_medium",type:types.FT.Session};case schema.GI.InitialUTMContent:return{key:"$entry_utm_content",type:types.FT.Session};case schema.GI.InitialUTMTerm:return{key:"$entry_utm_term",type:types.FT.Session};case schema.GI.Browser:return{key:"$browser",type:types.FT.Event};case schema.GI.OS:return{key:"$os",type:types.FT.Event};case schema.GI.Viewport:return{key:"$viewport",type:types.FT.Event};case schema.GI.DeviceType:return{key:"$device_type",type:types.FT.Event};case schema.GI.Country:return{key:"$geoip_country_code",type:types.FT.Event};case schema.GI.Region:return{key:"$geoip_subdivision_1_code",type:types.FT.Event};case schema.GI.City:return{key:"$geoip_city_name",type:types.FT.Event};case schema.GI.Timezone:return{key:"$timezone",type:types.FT.Event};case schema.GI.Language:return{key:"$geoip_language",type:types.FT.Event};case schema.GI.InitialUTMSourceMediumCampaign:return;default:throw new utils.q0(breakdownBy)}},webAnalyticsDataTableQueryContext={columns:{breakdown_value:{renderTitle:props=>{let{query}=props,{source}=query;if(source.kind!==schema.OH.WebStatsTableQuery)return null;let{breakdownBy}=source;switch(breakdownBy){case schema.GI.Page:return(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:"Path"});case schema.GI.InitialPage:return(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:"Initial Path"});case schema.GI.ExitPage:return(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:"End Path"});case schema.GI.ExitClick:return(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:"Exit Click"});case schema.GI.ScreenName:return(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:"Screen Name"});case schema.GI.InitialChannelType:return(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:"Initial Channel Type"});case schema.GI.InitialReferringDomain:return(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:"Referring Domain"});case schema.GI.InitialUTMSource:return(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:"UTM Source"});case schema.GI.InitialUTMCampaign:return(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:"UTM Campaign"});case schema.GI.InitialUTMMedium:return(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:"UTM Medium"});case schema.GI.InitialUTMTerm:return(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:"UTM Term"});case schema.GI.InitialUTMContent:return(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:"UTM Content"});case schema.GI.Browser:return(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:"Browser"});case schema.GI.OS:return(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:"OS"});case schema.GI.Viewport:return(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:"Viewport"});case schema.GI.DeviceType:return(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:"Device Type"});case schema.GI.Country:return(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:"Country"});case schema.GI.Region:return(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:"Region"});case schema.GI.City:return(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:"City"});case schema.GI.Timezone:return(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:"Timezone"});case schema.GI.Language:return(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:"Language"});case schema.GI.InitialUTMSourceMediumCampaign:return(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:"Source / Medium / Campaign"});default:throw new utils.q0(breakdownBy)}},render:props=>{let{value,query}=props,{source}=query;if(source.kind!==schema.OH.WebStatsTableQuery)return null;let{breakdownBy}=source;switch(breakdownBy){case schema.GI.Viewport:if(Array.isArray(value)){let[width,height]=value;return(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[width,"x",height]})}break;case schema.GI.Country:if("string"==typeof value)return(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,WorldMap.q9)(value)," ",WorldMap.XJ[value]||value]});break;case schema.GI.Region:if(Array.isArray(value)){let[countryCode,regionCode,regionName]=value;return(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,WorldMap.q9)(countryCode)," ",WorldMap.XJ[countryCode]||countryCode," -"," ",regionName||regionCode]})}break;case schema.GI.City:if(Array.isArray(value)){let[countryCode,cityName]=value;return(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,WorldMap.q9)(countryCode)," ",WorldMap.XJ[countryCode]||countryCode," - ",cityName]})}break;case schema.GI.Timezone:if("number"==typeof value)return(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:toUtcOffsetFormat(value)});break;case schema.GI.Language:if("string"==typeof value){var _countryCode$match$,_countryCodeToFlag;let[languageCode,countryCode]=value.split("-"),parsedCountryCode=null!==(_countryCode$match$=countryCode?.match(/([A-Z]{2})/)?.[0])&&void 0!==_countryCode$match$?_countryCode$match$:"";return(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[null!==(_countryCodeToFlag=(0,WorldMap.q9)(parsedCountryCode))&&void 0!==_countryCodeToFlag?_countryCodeToFlag:(0,countryCodes.RD)(languageCode),"\xa0",countryCodes.lY[languageCode]||languageCode]})}}return"string"==typeof value?(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:value}):null}},bounce_rate:{title:(0,jsx_runtime.jsx)("span",{className:"pr-5",children:"Bounce Rate"}),render:VariationCell({isPercentage:!0,reverseColors:!0}),align:"right"},views:{title:(0,jsx_runtime.jsx)("span",{className:"pr-5",children:"Views"}),render:VariationCell(),align:"right"},clicks:{title:(0,jsx_runtime.jsx)("span",{className:"pr-5",children:"Clicks"}),render:VariationCell(),align:"right"},visitors:{title:(0,jsx_runtime.jsx)("span",{className:"pr-5",children:"Visitors"}),render:VariationCell(),align:"right"},average_scroll_percentage:{title:(0,jsx_runtime.jsx)("span",{className:"pr-5",children:"Average Scroll"}),render:VariationCell({isPercentage:!0}),align:"right"},scroll_gt80_percentage:{title:(0,jsx_runtime.jsx)("span",{className:"pr-5",children:"Deep Scroll Rate"}),render:VariationCell({isPercentage:!0}),align:"right"},total_conversions:{title:(0,jsx_runtime.jsx)("span",{className:"pr-5",children:"Total Conversions"}),render:VariationCell(),align:"right"},unique_conversions:{title:(0,jsx_runtime.jsx)("span",{className:"pr-5",children:"Unique Conversions"}),render:VariationCell(),align:"right"},conversion_rate:{title:(0,jsx_runtime.jsx)("span",{className:"pr-5",children:"Conversion Rate"}),render:VariationCell({isPercentage:!0}),align:"right"},converting_users:{title:(0,jsx_runtime.jsx)("span",{className:"pr-5",children:"Converting Users"}),render:VariationCell(),align:"right"},action_name:{title:"Action"}}},WebStatsTrendTile=_ref2=>{let{query,showIntervalTile,insightProps}=_ref2,{togglePropertyFilter,setInterval:setInterval1}=(0,index_esm.useActions)(webAnalyticsLogic),{hasCountryFilter,deviceTab,hasDeviceTypeFilter,hasBrowserFilter,hasOSFilter,dateFilter:{interval}}=(0,index_esm.useValues)(webAnalyticsLogic),worldMapPropertyName=webStatsBreakdownToPropertyName(schema.GI.Country)?.key,deviceTypePropertyName=webStatsBreakdownToPropertyName(schema.GI.DeviceType)?.key,onWorldMapClick=(0,react.useCallback)(breakdownValue=>{worldMapPropertyName&&togglePropertyFilter(types.FT.Event,worldMapPropertyName,breakdownValue,{geographyTab:hasCountryFilter?void 0:GeographyTab.REGIONS})},[togglePropertyFilter,worldMapPropertyName]),onDeviceTilePieChartClick=(0,react.useCallback)(graphPoint=>{let newTab;if(null==graphPoint.seriesId)return;let dataset=graphPoint.crossDataset?.[graphPoint.seriesId];if(!dataset)return;let breakdownValues=dataset.breakdownValues?.[graphPoint.index],breakdownValue=Array.isArray(breakdownValues)?breakdownValues[0]:breakdownValues;breakdownValue&&deviceTypePropertyName&&(deviceTab===DeviceTab.DEVICE_TYPE||hasDeviceTypeFilter?deviceTab===DeviceTab.BROWSER||hasBrowserFilter?deviceTab===DeviceTab.OS||hasOSFilter||(newTab=DeviceTab.OS):newTab=DeviceTab.BROWSER:newTab=DeviceTab.DEVICE_TYPE,togglePropertyFilter(types.FT.Event,deviceTypePropertyName,breakdownValue,{deviceTab:newTab}))},[togglePropertyFilter,deviceTypePropertyName,deviceTab,hasDeviceTypeFilter,hasBrowserFilter,hasOSFilter]),context=(0,react.useMemo)(()=>({...webAnalyticsDataTableQueryContext,chartRenderingMetadata:{[types.Qb.WorldMap]:{countryProps:(countryCode,values)=>({onClick:values&&(values.count>0||values.aggregated_value>0)?()=>onWorldMapClick(countryCode):void 0})},[types.Qb.ActionsPie]:{onSegmentClick:onDeviceTilePieChartClick}},insightProps:{...insightProps,query}}),[onWorldMapClick,insightProps]);return(0,jsx_runtime.jsxs)("div",{className:"border rounded bg-bg-light flex-1 flex flex-col",children:[showIntervalTile&&(0,jsx_runtime.jsx)("div",{className:"flex flex-row items-center justify-end m-2 mr-4",children:(0,jsx_runtime.jsxs)("div",{className:"flex flex-row items-center",children:[(0,jsx_runtime.jsx)("span",{className:"mr-2",children:"Group by"}),(0,jsx_runtime.jsx)(IntervalFilter.T,{interval:interval,onIntervalChange:setInterval1,options:[{value:"hour",label:"Hour"},{value:"day",label:"Day"},{value:"week",label:"Week"},{value:"month",label:"Month"}]})]})}),(0,jsx_runtime.jsx)(Query.A,{query:query,readOnly:!0,context:context})]})},WebStatsTableTile=_ref3=>{let{query,breakdownBy,insightProps,control}=_ref3,{togglePropertyFilter}=(0,index_esm.useActions)(webAnalyticsLogic),{isPathCleaningEnabled}=(0,index_esm.useValues)(webAnalyticsLogic),{key,type}=webStatsBreakdownToPropertyName(breakdownBy)||{},onClick=(0,react.useCallback)(breakdownValue=>{key&&type&&togglePropertyFilter(type,key,breakdownValue)},[togglePropertyFilter,type,key]),context=(0,react.useMemo)(()=>({...webAnalyticsDataTableQueryContext,insightProps,rowProps:record=>{if((breakdownBy===schema.GI.InitialPage||breakdownBy===schema.GI.Page)&&isPathCleaningEnabled||breakdownBy===schema.GI.Language||breakdownBy===schema.GI.Timezone)return{};let breakdownValue=getBreakdownValue(record,breakdownBy);return void 0===breakdownValue?{}:{onClick:key&&type?()=>onClick(breakdownValue):void 0}}}),[onClick,insightProps]);return(0,jsx_runtime.jsxs)("div",{className:"border rounded bg-bg-light flex-1 flex flex-col",children:[null!=control&&(0,jsx_runtime.jsx)("div",{className:"flex flex-row items-center justify-end m-2 mr-4",children:control}),(0,jsx_runtime.jsx)(Query.A,{query:query,readOnly:!0,context:context})]})},getBreakdownValue=(record,breakdownBy)=>{if("object"!=typeof record||!record||!("result"in record))return;let result=record.result;if(!Array.isArray(result))return;let breakdownValue=result[0];switch(breakdownBy){case schema.GI.Country:if(Array.isArray(breakdownValue))return breakdownValue[0];break;case schema.GI.Region:case schema.GI.City:if(Array.isArray(breakdownValue))return breakdownValue[1]}return null===breakdownValue?null:"string"==typeof breakdownValue?breakdownValue:void 0},WebGoalsTile=_ref4=>{let{query,insightProps}=_ref4,{actions,actionsLoading}=(0,index_esm.useValues)(actionsModel.D),{updateHasSeenProductIntroFor}=(0,index_esm.useActions)(userLogic.userLogic);return actionsLoading?null:actions.length?(0,jsx_runtime.jsxs)("div",{className:"border rounded bg-bg-light flex-1",children:[(0,jsx_runtime.jsx)("div",{className:"flex flex-row-reverse p-2",children:(0,jsx_runtime.jsx)(LemonButton.J,{to:urls.j.actions(),sideIcon:(0,jsx_runtime.jsx)(icons.pF,{}),type:"secondary",size:"small",children:"Manage actions"})}),(0,jsx_runtime.jsx)(Query.A,{query:query,readOnly:!0,context:{...webAnalyticsDataTableQueryContext,insightProps}})]}):(0,jsx_runtime.jsx)(ProductIntroduction.C,{productName:"Actions",productKey:types.Md.ACTIONS,thingName:"action",isEmpty:!0,description:"Use actions to combine events that you want to have tracked together or to make detailed Autocapture events easier to reuse.",docsURL:"https://posthog.com/docs/data/actions",actionElementOverride:(0,jsx_runtime.jsx)(NewActionButton.O,{onSelectOption:()=>updateHasSeenProductIntroFor(types.Md.ACTIONS,!0)})})},WebExternalClicksTile=_ref5=>{let{query,insightProps}=_ref5,{shouldStripQueryParams}=(0,index_esm.useValues)(webAnalyticsLogic),{setShouldStripQueryParams}=(0,index_esm.useActions)(webAnalyticsLogic);return(0,jsx_runtime.jsxs)("div",{className:"border rounded bg-bg-light flex-1 flex flex-col",children:[(0,jsx_runtime.jsx)("div",{className:"flex flex-row items-center justify-end m-2 mr-4",children:(0,jsx_runtime.jsx)("div",{className:"flex flex-row items-center space-x-2",children:(0,jsx_runtime.jsx)(LemonSwitch.f,{label:"Strip query parameters",checked:shouldStripQueryParams,onChange:setShouldStripQueryParams,className:"h-full"})})}),(0,jsx_runtime.jsx)(Query.A,{query:query,readOnly:!0,context:{...webAnalyticsDataTableQueryContext,insightProps}})]})},WebQuery=_ref6=>{let{query,showIntervalSelect,control,insightProps}=_ref6;return query.kind===schema.OH.DataTableNode&&query.source.kind===schema.OH.WebStatsTableQuery?(0,jsx_runtime.jsx)(WebStatsTableTile,{query:query,breakdownBy:query.source.breakdownBy,insightProps:insightProps,control:control}):query.kind===schema.OH.DataTableNode&&query.source.kind===schema.OH.WebExternalClicksTableQuery?(0,jsx_runtime.jsx)(WebExternalClicksTile,{query:query,insightProps:insightProps}):query.kind===schema.OH.InsightVizNode?(0,jsx_runtime.jsx)(WebStatsTrendTile,{query:query,showIntervalTile:showIntervalSelect,insightProps:insightProps}):query.kind===schema.OH.DataTableNode&&query.source.kind===schema.OH.WebGoalsQuery?(0,jsx_runtime.jsx)(WebGoalsTile,{query:query,insightProps:insightProps}):(0,jsx_runtime.jsx)(Query.A,{query:query,readOnly:!0,context:{...webAnalyticsDataTableQueryContext,insightProps}})};var LemonBanner=__webpack_require__("./frontend/src/lib/lemon-ui/LemonBanner/index.ts"),lemon_ui_Link=__webpack_require__("./frontend/src/lib/lemon-ui/Link/index.ts");let WebAnalyticsHealthCheck=()=>{let{statusCheck,conversionGoalWarning}=(0,index_esm.useValues)(webAnalyticsLogic);return conversionGoalWarning&&conversionGoalWarning===ConversionGoalWarning.CustomEventWithNoSessionId?(0,jsx_runtime.jsxs)(LemonBanner.V,{type:"warning",className:"mt-2",children:[(0,jsx_runtime.jsxs)("p",{children:["A custom event has been set as a conversion goal, but it has been seen with no"," ",(0,jsx_runtime.jsx)("code",{children:"$session_id"}),". This means that some queries will not be able to include these events."]}),(0,jsx_runtime.jsxs)("p",{children:["To fix this, please see"," ",(0,jsx_runtime.jsx)(lemon_ui_Link.r,{to:"https://posthog.com/docs/data/sessions#custom-session-ids",children:"documentation for custom session IDs"}),"."]})]}):statusCheck?statusCheck.isSendingPageViews?statusCheck.isSendingPageLeaves?null:(0,jsx_runtime.jsxs)(LemonBanner.V,{type:"warning",className:"mt-2",children:[(0,jsx_runtime.jsxs)("p",{children:["No ",(0,jsx_runtime.jsx)("code",{children:"$pageleave"})," events have been received, this means that Bounce rate and Session duration might be inaccurate."]}),(0,jsx_runtime.jsxs)("p",{children:["Please see"," ",(0,jsx_runtime.jsx)(lemon_ui_Link.r,{to:"https://posthog.com/docs/libraries/js",children:"documentation for how to set up posthog-js"}),"."]})]}):(0,jsx_runtime.jsxs)(LemonBanner.V,{type:"warning",className:"mt-2",children:[(0,jsx_runtime.jsxs)("p",{children:["No ",(0,jsx_runtime.jsx)("code",{children:"$pageview"})," ",statusCheck.isSendingPageLeaves?null:(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:["or ",(0,jsx_runtime.jsx)("code",{children:"$pageleave"})," "]}),"events have been received. Web analytics won't work correctly (it'll be a little empty!)"]}),(0,jsx_runtime.jsxs)("p",{children:["Please see"," ",(0,jsx_runtime.jsx)(lemon_ui_Link.r,{to:"https://posthog.com/docs/libraries/js",children:"documentation for how to set up posthog-js"}),"."]})]}):null};var LemonModal=__webpack_require__("./frontend/src/lib/lemon-ui/LemonModal/index.ts"),PropertyFilters=__webpack_require__("./frontend/src/lib/components/PropertyFilters/PropertyFilters.tsx"),PropertyFilters_utils=__webpack_require__("./frontend/src/lib/components/PropertyFilters/utils.ts"),TaxonomicFilter_types=__webpack_require__("./frontend/src/lib/components/TaxonomicFilter/types.ts");let WebPropertyFilters=_ref=>{let{webAnalyticsFilters,setWebAnalyticsFilters}=_ref;return(0,jsx_runtime.jsx)(PropertyFilters.t,{taxonomicGroupTypes:[TaxonomicFilter_types.t.EventProperties,TaxonomicFilter_types.t.PersonProperties,TaxonomicFilter_types.t.SessionProperties],onChange:filters=>setWebAnalyticsFilters(filters.filter(PropertyFilters_utils.WO)),propertyFilters:webAnalyticsFilters,pageKey:"web-analytics",eventNames:["$pageview"]})},WebAnalyticsModal=()=>{let{modal,dateFilter:{dateFrom,dateTo},webAnalyticsFilters}=(0,index_esm.useValues)(webAnalyticsLogic),{closeModal,setDates,setWebAnalyticsFilters}=(0,index_esm.useActions)(webAnalyticsLogic);return modal?(0,jsx_runtime.jsx)(LemonModal.f,{isOpen:!!modal,onClose:closeModal,simple:!1,title:modal?.title||"",width:1600,fullScreen:!1,closable:!0,children:(0,jsx_runtime.jsxs)("div",{className:"WebAnalyticsModal space-y-4",children:[(0,jsx_runtime.jsxs)("div",{className:"flex flex-row flex-wrap gap-2",children:[(0,jsx_runtime.jsx)(WebPropertyFilters,{setWebAnalyticsFilters:setWebAnalyticsFilters,webAnalyticsFilters:webAnalyticsFilters}),(0,jsx_runtime.jsx)(DateFilter.f,{dateFrom:dateFrom,dateTo:dateTo,onChange:setDates})]}),(0,jsx_runtime.jsx)(LemonModal.f.Content,{embedded:!0,children:(0,jsx_runtime.jsx)(WebQuery,{query:modal.query,insightProps:modal.insightProps,showIntervalSelect:modal.showIntervalSelect,control:modal.control})}),(0,jsx_runtime.jsx)("div",{className:"flex flex-row justify-end",children:modal.canOpenInsight?(0,jsx_runtime.jsx)(LemonButton.J,{to:urls.j.insightNew(void 0,void 0,modal.query),icon:(0,jsx_runtime.jsx)(icons.pF,{}),size:"small",type:"secondary",children:"Open as new Insight"}):null})]})}):null};var TaxonomicPopover=__webpack_require__("./frontend/src/lib/components/TaxonomicPopover/TaxonomicPopover.tsx");let WebConversionGoal=()=>{let{conversionGoal}=(0,index_esm.useValues)(webAnalyticsLogic),{setConversionGoal}=(0,index_esm.useActions)(webAnalyticsLogic),{actions}=(0,index_esm.useValues)(actionsModel.D),[group,setGroup]=(0,react.useState)(TaxonomicFilter_types.t.CustomEvents),value=conversionGoal&&"actionId"in conversionGoal?conversionGoal.actionId:conversionGoal?.customEventName;return(0,jsx_runtime.jsx)(TaxonomicPopover.b,{groupType:group,"data-attr":"web-analytics-conversion-filter",value:value,onChange:(changedValue,groupType)=>{groupType===TaxonomicFilter_types.t.Actions&&"number"==typeof changedValue?(setConversionGoal({actionId:changedValue}),setGroup(TaxonomicFilter_types.t.Actions)):groupType===TaxonomicFilter_types.t.CustomEvents&&"string"==typeof changedValue&&changedValue?(setConversionGoal({customEventName:changedValue}),setGroup(TaxonomicFilter_types.t.CustomEvents)):setConversionGoal(null)},renderValue:()=>{if(!conversionGoal)return null;if("actionId"in conversionGoal){var _conversionGoalAction;let conversionGoalAction=actions.find(a=>a.id===conversionGoal.actionId);return(0,jsx_runtime.jsx)("span",{className:"text-overflow max-w-full",children:null!==(_conversionGoalAction=conversionGoalAction?.name)&&void 0!==_conversionGoalAction?_conversionGoalAction:"Conversion goal"})}return(0,jsx_runtime.jsx)("span",{className:"text-overflow max-w-full",children:conversionGoal?.customEventName})},groupTypes:[TaxonomicFilter_types.t.CustomEvents,TaxonomicFilter_types.t.Actions],placeholder:"Add conversion goal",placeholderClass:"",allowClear:!0,size:"small"})};var navigationLogic=__webpack_require__("./frontend/src/layout/navigation/navigationLogic.ts"),dataNodeCollectionLogic=__webpack_require__("./frontend/src/queries/nodes/DataNode/dataNodeCollectionLogic.ts"),Reload=__webpack_require__("./frontend/src/queries/nodes/DataNode/Reload.tsx"),apiHost=__webpack_require__("./frontend/src/lib/utils/apiHost.ts");let liveEventsTableLogic=(0,index_esm.kea)([(0,index_esm.path)(["scenes","activity","live-events","liveEventsTableLogic"]),(0,index_esm.connect)({values:[teamLogic.H,["currentTeam"],featureFlagLogic.h,["featureFlags"]]}),(0,index_esm.actions)(()=>({pollStats:!0,setLiveUserCount:_ref=>{let{liveUserCount,now}=_ref;return{liveUserCount,now}},setNow:_ref2=>{let{now}=_ref2;return{now}}})),(0,index_esm.reducers)({liveUserCount:[null,{setLiveUserCount:(_,_ref3)=>{let{liveUserCount}=_ref3;return liveUserCount}}],statsUpdatedTime:[null,{setLiveUserCount:(_,_ref4)=>{let{now}=_ref4;return now}}],now:[null,{setNow:(_,_ref5)=>{let{now}=_ref5;return now},setLiveUserCount:(_,_ref6)=>{let{now}=_ref6;return now}}]}),(0,index_esm.selectors)({liveUserUpdatedSecondsAgo:[s=>[s.statsUpdatedTime,s.now],(statsUpdatedTime,now)=>{if(!statsUpdatedTime||!now)return null;let seconds=Math.ceil((now.getTime()-statsUpdatedTime.getTime())/1e3);return seconds<0||seconds>=300?null:seconds}]}),(0,index_esm.listeners)(_ref7=>{let{actions,values}=_ref7;return{pollStats:async()=>{try{if(!values.currentTeam)return;let response=await fetch(`${(0,apiHost.K)()}/stats`,{headers:{Authorization:`Bearer ${values.currentTeam.live_events_token}`}}),data=await response.json(),liveUserCount=data.users_on_product||0;actions.setLiveUserCount({liveUserCount,now:new Date})}catch(error){console.error("Failed to poll stats:",error)}}}}),(0,index_esm.events)(_ref8=>{let{actions,cache}=_ref8;return{afterMount:()=>{actions.setNow({now:new Date}),actions.pollStats(),cache.statsInterval=setInterval(()=>{actions.pollStats()},3e4),cache.nowInterval=setInterval(()=>{actions.setNow({now:new Date})},500)},beforeUnmount:()=>{cache.statsInterval&&(clearInterval(cache.statsInterval),cache.statsInterval=null)}}})]),WebAnalyticsLiveUserCount=()=>{let{liveUserCount,liveUserUpdatedSecondsAgo}=(0,index_esm.useValues)(liveEventsTableLogic),{currentTeam}=(0,index_esm.useValues)(teamLogic.H);if(null==liveUserCount)return null;let usersOnlineString=`${(0,utils.Lc)(liveUserCount)} ${1===liveUserCount?"user is":"users are"} online`,inTeamString=currentTeam?` in ${currentTeam.name}`:"",updatedAgoString=0===liveUserUpdatedSecondsAgo?" (updated just now)":null==liveUserUpdatedSecondsAgo?"":` (updated ${liveUserUpdatedSecondsAgo} seconds ago)`,tooltip=`${usersOnlineString}${inTeamString}${updatedAgoString}`;return(0,jsx_runtime.jsxs)("div",{className:"flex-row",children:[(0,jsx_runtime.jsx)(Tooltip.u,{title:tooltip,children:(0,jsx_runtime.jsxs)("span",{children:[(0,jsx_runtime.jsx)(posthog_icons_es.IconLive,{})," ",(0,jsx_runtime.jsx)("strong",{children:(0,utils.d$)(liveUserCount)})," currently online"]})}),(0,jsx_runtime.jsx)("div",{className:"bg-border h-px w-full mt-2"})]})},Filters=()=>{let{webAnalyticsFilters,dateFilter:{dateTo,dateFrom},compareFilter}=(0,index_esm.useValues)(webAnalyticsLogic),{setWebAnalyticsFilters,setDates,setCompareFilter}=(0,index_esm.useActions)(webAnalyticsLogic),{mobileLayout}=(0,index_esm.useValues)(navigationLogic.f),{featureFlags}=(0,index_esm.useValues)(featureFlagLogic.h);return(0,jsx_runtime.jsxs)("div",{className:(0,clsx_m.default)("sticky z-20 pt-2 bg-bg-3000",mobileLayout?"top-[var(--breadcrumbs-height-full)]":"top-[var(--breadcrumbs-height-compact)]"),children:[(0,jsx_runtime.jsxs)("div",{className:"flex flex-row flex-wrap gap-2",children:[(0,jsx_runtime.jsx)(DateFilter.f,{dateFrom:dateFrom,dateTo:dateTo,onChange:setDates}),featureFlags[constants.y8.WEB_ANALYTICS_PERIOD_COMPARISON]?(0,jsx_runtime.jsx)(CompareFilter.m,{compareFilter:compareFilter,updateCompareFilter:setCompareFilter}):null,(0,jsx_runtime.jsx)(WebPropertyFilters,{setWebAnalyticsFilters:setWebAnalyticsFilters,webAnalyticsFilters:webAnalyticsFilters}),(0,jsx_runtime.jsx)(WebConversionGoal,{}),(0,jsx_runtime.jsx)(Reload.H,{})]}),(0,jsx_runtime.jsx)("div",{className:"bg-border h-px w-full mt-2"})]})},Tiles=()=>{let{tiles}=(0,index_esm.useValues)(webAnalyticsLogic);return(0,jsx_runtime.jsx)("div",{className:"mt-2 grid grid-cols-1 md:grid-cols-2 xxl:grid-cols-3 gap-x-4 gap-y-12",children:tiles.map((tile,i)=>"query"===tile.kind?(0,jsx_runtime.jsx)(QueryTileItem,{tile:tile},i):"tabs"===tile.kind?(0,jsx_runtime.jsx)(TabsTileItem,{tile:tile},i):"replay"===tile.kind?(0,jsx_runtime.jsx)(WebAnalyticsRecordingsTile,{tile:tile},i):"error_tracking"===tile.kind?(0,jsx_runtime.jsx)(WebAnalyticsErrorTrackingTile,{tile:tile},i):null)})},QueryTileItem=_ref=>{var _layout$colSpanClassN,_layout$rowSpanClassN,_layout$orderWhenLarg;let{tile}=_ref,{query,title,layout,insightProps,control,showIntervalSelect,docs}=tile,{openModal}=(0,index_esm.useActions)(webAnalyticsLogic),{getNewInsightUrl}=(0,index_esm.useValues)(webAnalyticsLogic),buttonsRow=[tile.canOpenInsight?(0,jsx_runtime.jsx)(LemonButton.J,{to:getNewInsightUrl(tile.tileId),icon:(0,jsx_runtime.jsx)(icons.pF,{}),size:"small",type:"secondary",children:"Open as new Insight"},"open-insight-button"):null,tile.canOpenModal?(0,jsx_runtime.jsx)(LemonButton.J,{onClick:()=>openModal(tile.tileId),icon:(0,jsx_runtime.jsx)(posthog_icons_es.IconExpand45,{}),size:"small",type:"secondary",children:"Show more"},"open-modal-button"):null].filter(utils.DX);return(0,jsx_runtime.jsxs)("div",{className:(0,clsx_m.default)("col-span-1 row-span-1 flex flex-col",null!==(_layout$colSpanClassN=layout.colSpanClassName)&&void 0!==_layout$colSpanClassN?_layout$colSpanClassN:"md:col-span-6",null!==(_layout$rowSpanClassN=layout.rowSpanClassName)&&void 0!==_layout$rowSpanClassN?_layout$rowSpanClassN:"md:row-span-1",null!==(_layout$orderWhenLarg=layout.orderWhenLargeClassName)&&void 0!==_layout$orderWhenLarg?_layout$orderWhenLarg:"xxl:order-12",layout.className),children:[title&&(0,jsx_runtime.jsxs)("h2",{className:"flex-1 m-0 flex flex-row ml-1",children:[title,docs&&(0,jsx_runtime.jsx)(LearnMorePopover,{url:docs.url,title:docs.title,description:docs.description})]}),(0,jsx_runtime.jsx)(WebQuery,{query:query,insightProps:insightProps,control:control,showIntervalSelect:showIntervalSelect}),buttonsRow.length>0?(0,jsx_runtime.jsx)("div",{className:"flex justify-end my-2 space-x-2",children:buttonsRow}):null]})},TabsTileItem=_ref2=>{let{tile}=_ref2,{layout}=tile,{openModal}=(0,index_esm.useActions)(webAnalyticsLogic),{getNewInsightUrl}=(0,index_esm.useValues)(webAnalyticsLogic);return(0,jsx_runtime.jsx)(WebTabs,{className:(0,clsx_m.default)("col-span-1 row-span-1",layout.colSpanClassName||"md:col-span-1",layout.rowSpanClassName||"md:row-span-1",layout.orderWhenLargeClassName||"xxl:order-12",layout.className),activeTabId:tile.activeTabId,setActiveTabId:tile.setTabId,tabs:tile.tabs.map(tab=>({id:tab.id,content:(0,jsx_runtime.jsx)(WebQuery,{query:tab.query,showIntervalSelect:tab.showIntervalSelect,control:tab.control,insightProps:tab.insightProps},tab.id),linkText:tab.linkText,title:tab.title,canOpenModal:!!tab.canOpenModal,canOpenInsight:!!tab.canOpenInsight,query:tab.query,docs:tab.docs})),tileId:tile.tileId,openModal:openModal,getNewInsightUrl:getNewInsightUrl})},WebTabs=_ref3=>{let{className,activeTabId,tabs,setActiveTabId,openModal,getNewInsightUrl,tileId}=_ref3,activeTab=tabs.find(t=>t.id===activeTabId),newInsightUrl=getNewInsightUrl(tileId,activeTabId),buttonsRow=[activeTab?.canOpenInsight&&newInsightUrl?(0,jsx_runtime.jsx)(LemonButton.J,{to:newInsightUrl,icon:(0,jsx_runtime.jsx)(icons.pF,{}),size:"small",type:"secondary",children:"Open as new Insight"},"open-insight-button"):null,activeTab?.canOpenModal?(0,jsx_runtime.jsx)(LemonButton.J,{onClick:()=>openModal(tileId,activeTabId),icon:(0,jsx_runtime.jsx)(posthog_icons_es.IconExpand45,{}),size:"small",type:"secondary",children:"Show more"},"open-modal-button"):null].filter(utils.DX);return(0,jsx_runtime.jsxs)("div",{className:(0,clsx_m.default)(className,"flex flex-col"),children:[(0,jsx_runtime.jsxs)("div",{className:"flex flex-row items-center self-stretch mb-3",children:[(0,jsx_runtime.jsxs)("h2",{className:"flex-1 m-0 flex flex-row ml-1",children:[activeTab?.title,activeTab?.docs&&(0,jsx_runtime.jsx)(LearnMorePopover,{url:activeTab.docs.url,title:activeTab.docs.title,description:activeTab.docs.description})]}),(0,jsx_runtime.jsx)(LemonSegmentedSelect.S,{shrinkOn:7,size:"small",disabled:!1,value:activeTabId,dropdownMatchSelectWidth:!1,onChange:setActiveTabId,options:tabs.map(_ref4=>{let{id,linkText}=_ref4;return{value:id,label:linkText}})})]}),(0,jsx_runtime.jsx)("div",{className:"flex-1 flex flex-col",children:activeTab?.content}),buttonsRow.length>0?(0,jsx_runtime.jsx)("div",{className:"flex justify-end my-2 space-x-2",children:buttonsRow}):null]})},LearnMorePopover=_ref5=>{let{url,title,description}=_ref5,[isOpen,setIsOpen]=(0,react.useState)(!1);return(0,jsx_runtime.jsx)(Popover.J2,{visible:isOpen,onClickOutside:()=>setIsOpen(!1),overlay:(0,jsx_runtime.jsxs)("div",{className:"p-4",children:[(0,jsx_runtime.jsxs)("div",{className:"flex flex-row w-full",children:[(0,jsx_runtime.jsx)("h2",{className:"flex-1",children:title}),(0,jsx_runtime.jsx)(LemonButton.J,{targetBlank:!0,type:"tertiary",onClick:()=>setIsOpen(!1),size:"small",icon:(0,jsx_runtime.jsx)(posthog_icons_es.IconX,{})})]}),(0,jsx_runtime.jsx)("div",{className:"text-sm text-gray-700",children:description}),url&&(0,jsx_runtime.jsx)("div",{className:"flex justify-end mt-4",children:(0,jsx_runtime.jsx)(LemonButton.J,{to:url,onClick:()=>setIsOpen(!1),targetBlank:!0,sideIcon:(0,jsx_runtime.jsx)(posthog_icons_es.IconOpenSidebar,{}),children:"Learn more"})})]}),children:(0,jsx_runtime.jsx)(LemonButton.J,{onClick:()=>setIsOpen(!isOpen),size:"small",icon:(0,jsx_runtime.jsx)(posthog_icons_es.IconInfo,{}),className:"ml-1 mb-1"})})},WebAnalyticsDashboard=()=>(0,jsx_runtime.jsx)(index_esm.BindLogic,{logic:webAnalyticsLogic,props:{},children:(0,jsx_runtime.jsxs)(index_esm.BindLogic,{logic:dataNodeCollectionLogic.y,props:{key:WEB_ANALYTICS_DATA_COLLECTION_NODE_ID},children:[(0,jsx_runtime.jsx)(WebAnalyticsModal,{}),(0,jsx_runtime.jsx)(VersionCheckerBanner.o,{}),(0,jsx_runtime.jsxs)("div",{className:"WebAnalyticsDashboard w-full flex flex-col",children:[(0,jsx_runtime.jsx)(WebAnalyticsLiveUserCount,{}),(0,jsx_runtime.jsx)(Filters,{}),(0,jsx_runtime.jsx)(WebAnalyticsHealthCheck,{}),(0,jsx_runtime.jsx)(Tiles,{})]})]})});function WebAnalyticsScene(){return(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)(PageHeader.m,{buttons:(0,jsx_runtime.jsx)(WebAnalyticsMenu,{})}),(0,jsx_runtime.jsx)(WebAnalyticsDashboard,{})]})}let scene={component:WebAnalyticsScene,logic:webAnalyticsLogic}},"./node_modules/.pnpm/css-loader@3.6.0_webpack@5.88.2/node_modules/css-loader/dist/cjs.js!./node_modules/.pnpm/postcss-loader@4.3.0_postcss@8.4.31_webpack@5.88.2/node_modules/postcss-loader/dist/cjs.js!./node_modules/.pnpm/sass-loader@10.3.1_sass@1.56.0_webpack@5.88.2/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./frontend/src/lib/components/CompactList/CompactList.scss":(module,exports,__webpack_require__)=>{(exports=__webpack_require__("./node_modules/.pnpm/css-loader@3.6.0_webpack@5.88.2/node_modules/css-loader/dist/runtime/api.js")(!1)).push([module.id,".CompactList{background:var(--bg-light);border:1px solid var(--border);border-radius:var(--radius);box-sizing:initial;display:flex;flex:1;flex-direction:column;overflow:hidden}.CompactList .CompactList__header{align-items:center;display:flex;justify-content:space-between;padding:.5rem}.CompactList .CompactList__header h3{font-size:.9rem;font-weight:600;line-height:1.4;margin-bottom:0}.CompactList .CompactList__content{height:16rem;overflow-y:auto;padding:.5rem}.CompactList .LemonButton{font-family:var(--font-sans)!important}",""]),module.exports=exports},"./node_modules/.pnpm/css-loader@3.6.0_webpack@5.88.2/node_modules/css-loader/dist/cjs.js!./node_modules/.pnpm/postcss-loader@4.3.0_postcss@8.4.31_webpack@5.88.2/node_modules/postcss-loader/dist/cjs.js!./node_modules/.pnpm/sass-loader@10.3.1_sass@1.56.0_webpack@5.88.2/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./frontend/src/scenes/project-homepage/ProjectHomepage.scss":(module,exports,__webpack_require__)=>{(exports=__webpack_require__("./node_modules/.pnpm/css-loader@3.6.0_webpack@5.88.2/node_modules/css-loader/dist/runtime/api.js")(!1)).push([module.id,".ProjectHomepage{container-type:inline-size}.ProjectHomepage .ProjectHomepage__dashboardheader{align-items:center;display:flex;justify-content:space-between;margin-top:1rem}.ProjectHomepage .ProjectHomepage__dashboardheader .ProjectHomepage__dashboardheader__title{align-items:center;display:flex;flex-direction:row}.ProjectHomepage .ProjectHomepage__dashboardheader .ProjectHomepage__dashboardheader__title a{color:var(--text-3000)}.ProjectHomepage .ProjectHomepage__dashboardheader .ProjectHomepage__dashboardheader__title a:hover{color:var(--primary-3000)}.ProjectHomepage .ProjectHomepage__lists{display:flex;gap:1rem}@container (max-width: 800px){.ProjectHomepage .ProjectHomepage__lists{flex-direction:column}}.ProjectHomepage .empty-state-container{align-items:center;background-color:var(--bg-3000);display:flex;flex-direction:column;justify-content:center;padding:4rem;width:100%}",""]),module.exports=exports},"./frontend/src/scenes/project-homepage/ProjectHomepage.scss":(__unused_webpack_module,__unused_webpack___webpack_exports__,__webpack_require__)=>{"use strict";var _node_modules_pnpm_style_loader_2_0_0_webpack_5_88_2_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/.pnpm/style-loader@2.0.0_webpack@5.88.2/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),_node_modules_pnpm_style_loader_2_0_0_webpack_5_88_2_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(_node_modules_pnpm_style_loader_2_0_0_webpack_5_88_2_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__),_node_modules_pnpm_css_loader_3_6_0_webpack_5_88_2_node_modules_css_loader_dist_cjs_js_node_modules_pnpm_postcss_loader_4_3_0_postcss_8_4_31_webpack_5_88_2_node_modules_postcss_loader_dist_cjs_js_node_modules_pnpm_sass_loader_10_3_1_sass_1_56_0_webpack_5_88_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_ProjectHomepage_scss__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/.pnpm/css-loader@3.6.0_webpack@5.88.2/node_modules/css-loader/dist/cjs.js!./node_modules/.pnpm/postcss-loader@4.3.0_postcss@8.4.31_webpack@5.88.2/node_modules/postcss-loader/dist/cjs.js!./node_modules/.pnpm/sass-loader@10.3.1_sass@1.56.0_webpack@5.88.2/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./frontend/src/scenes/project-homepage/ProjectHomepage.scss"),_node_modules_pnpm_css_loader_3_6_0_webpack_5_88_2_node_modules_css_loader_dist_cjs_js_node_modules_pnpm_postcss_loader_4_3_0_postcss_8_4_31_webpack_5_88_2_node_modules_postcss_loader_dist_cjs_js_node_modules_pnpm_sass_loader_10_3_1_sass_1_56_0_webpack_5_88_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_ProjectHomepage_scss__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(_node_modules_pnpm_css_loader_3_6_0_webpack_5_88_2_node_modules_css_loader_dist_cjs_js_node_modules_pnpm_postcss_loader_4_3_0_postcss_8_4_31_webpack_5_88_2_node_modules_postcss_loader_dist_cjs_js_node_modules_pnpm_sass_loader_10_3_1_sass_1_56_0_webpack_5_88_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_ProjectHomepage_scss__WEBPACK_IMPORTED_MODULE_1__),options={};options.insert="head",options.singleton=!1,_node_modules_pnpm_style_loader_2_0_0_webpack_5_88_2_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_pnpm_css_loader_3_6_0_webpack_5_88_2_node_modules_css_loader_dist_cjs_js_node_modules_pnpm_postcss_loader_4_3_0_postcss_8_4_31_webpack_5_88_2_node_modules_postcss_loader_dist_cjs_js_node_modules_pnpm_sass_loader_10_3_1_sass_1_56_0_webpack_5_88_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_ProjectHomepage_scss__WEBPACK_IMPORTED_MODULE_1___default(),options),_node_modules_pnpm_css_loader_3_6_0_webpack_5_88_2_node_modules_css_loader_dist_cjs_js_node_modules_pnpm_postcss_loader_4_3_0_postcss_8_4_31_webpack_5_88_2_node_modules_postcss_loader_dist_cjs_js_node_modules_pnpm_sass_loader_10_3_1_sass_1_56_0_webpack_5_88_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_ProjectHomepage_scss__WEBPACK_IMPORTED_MODULE_1___default().locals}}]); \ No newline at end of file diff --git a/docs/33876.b0b8736a.iframe.bundle.js b/docs/33876.b0b8736a.iframe.bundle.js new file mode 100644 index 000000000..bd8ad4636 --- /dev/null +++ b/docs/33876.b0b8736a.iframe.bundle.js @@ -0,0 +1 @@ +(self.webpackChunkposthog=self.webpackChunkposthog||[]).push([[33876],{"./frontend/src/lib/components/CompactList/CompactList.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{a:()=>CompactList_CompactList_CompactList});var injectStylesIntoStyleTag=__webpack_require__("./node_modules/.pnpm/style-loader@2.0.0_webpack@5.88.2/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),injectStylesIntoStyleTag_default=__webpack_require__.n(injectStylesIntoStyleTag),CompactList=__webpack_require__("./node_modules/.pnpm/css-loader@3.6.0_webpack@5.88.2/node_modules/css-loader/dist/cjs.js!./node_modules/.pnpm/postcss-loader@4.3.0_postcss@8.4.31_webpack@5.88.2/node_modules/postcss-loader/dist/cjs.js!./node_modules/.pnpm/sass-loader@10.3.1_sass@1.56.0_webpack@5.88.2/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./frontend/src/lib/components/CompactList/CompactList.scss"),CompactList_default=__webpack_require__.n(CompactList),options={};options.insert="head",options.singleton=!1,injectStylesIntoStyleTag_default()(CompactList_default(),options),CompactList_default().locals;var clsx_m=__webpack_require__("./node_modules/.pnpm/clsx@1.2.1/node_modules/clsx/dist/clsx.m.js"),index_esm=__webpack_require__("./node_modules/.pnpm/kea@3.1.5_react@18.2.0/node_modules/kea/lib/index.esm.js"),LemonButton=__webpack_require__("./frontend/src/lib/lemon-ui/LemonButton/index.ts"),LemonDivider=__webpack_require__("./frontend/src/lib/lemon-ui/LemonDivider/index.ts"),LemonSkeleton=__webpack_require__("./frontend/src/lib/lemon-ui/LemonSkeleton/index.ts"),themeLogic=__webpack_require__("./frontend/src/layout/navigation-3000/themeLogic.ts"),EmptyMessage=__webpack_require__("./frontend/src/lib/components/EmptyMessage/EmptyMessage.tsx"),jsx_runtime=__webpack_require__("./node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js");function CompactList_CompactList_CompactList(_ref){let{title,viewAllURL,loading,items,emptyMessage,renderRow,contentHeightBehavior="fixed"}=_ref,{theme}=(0,index_esm.useValues)(themeLogic.b);return(0,jsx_runtime.jsxs)("div",{className:"CompactList",style:theme?.boxStyle,children:[title&&(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsxs)("div",{className:"CompactList__header",children:[(0,jsx_runtime.jsx)("h3",{className:"px-2 truncate",title:"string"==typeof title?title:void 0,children:title}),viewAllURL&&(0,jsx_runtime.jsx)(LemonButton.J,{to:viewAllURL,children:"View all"})]}),(0,jsx_runtime.jsx)("div",{className:"mx-2",children:(0,jsx_runtime.jsx)(LemonDivider.p,{className:"my-0"})})]}),(0,jsx_runtime.jsx)("div",{className:(0,clsx_m.default)("CompactList__content","shrink"===contentHeightBehavior&&"max-h-[16rem] h-auto"),children:loading?(0,jsx_runtime.jsx)("div",{className:"p-2 space-y-6",children:Array.from({length:6},(_,index)=>(0,jsx_runtime.jsx)(LemonSkeleton.y,{},index))}):0===items.length&&emptyMessage?(0,jsx_runtime.jsx)(EmptyMessage.M,{...emptyMessage}):(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:items.map((item,index)=>renderRow(item,index))})})]})}},"./frontend/src/lib/lemon-ui/LemonSegmentedSelect/LemonSegmentedSelect.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{S:()=>LemonSegmentedSelect});var lib_hooks_useWindowSize__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./frontend/src/lib/hooks/useWindowSize.js");__webpack_require__("./node_modules/.pnpm/react@18.2.0/node_modules/react/index.js");var _LemonSegmentedButton__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./frontend/src/lib/lemon-ui/LemonSegmentedButton/index.ts"),_LemonSelect__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./frontend/src/lib/lemon-ui/LemonSelect/index.ts"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js");function LemonSegmentedSelect(_ref){let{shrinkOn,...props}=_ref,{width=0}=(0,lib_hooks_useWindowSize__WEBPACK_IMPORTED_MODULE_0__.i)();return props.options.length>=shrinkOn||width<100*props.options.length?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_LemonSelect__WEBPACK_IMPORTED_MODULE_3__.Yv,{...props}):(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_LemonSegmentedButton__WEBPACK_IMPORTED_MODULE_2__.P,{...props})}},"./frontend/src/queries/schema-guards.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{X:()=>isWebAnalyticsPropertyFilters,a:()=>isSessionPropertyFilters});var ajv__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/.pnpm/ajv@8.12.0/node_modules/ajv/dist/ajv.js"),ajv__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(ajv__WEBPACK_IMPORTED_MODULE_0__),_schema_json__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./frontend/src/queries/schema.json");let ajv=new(ajv__WEBPACK_IMPORTED_MODULE_0___default())({allowUnionTypes:!0});ajv.addSchema(_schema_json__WEBPACK_IMPORTED_MODULE_1__);let isWebAnalyticsPropertyFilters=data=>{let validator=ajv.getSchema("#/definitions/WebAnalyticsPropertyFilters");if(!validator)throw Error("Could not find validator for WebAnalyticsPropertyFilters");return validator(data)},isSessionPropertyFilters=data=>{let validator=ajv.getSchema("#/definitions/SessionPropertyFilter");if(!validator)throw Error("Could not find validator for SessionPropertyFilter");return!!Array.isArray(data)&&data.every(item=>validator(item))}},"./frontend/src/scenes/error-tracking/queries.ts":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{QT:()=>errorTrackingIssueEventsQuery,mx:()=>errorTrackingQuery,zx:()=>errorTrackingIssueQuery});var lib_dayjs__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./frontend/src/lib/dayjs.ts"),lib_utils__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./frontend/src/lib/utils.tsx"),_queries_schema__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./frontend/src/queries/schema.ts");__webpack_require__("./frontend/src/types.ts");let SPARKLINE_CONFIGURATIONS={"-1d1h":{value:60,displayAs:"minute",offsetHours:24},"-1d24h":{value:24,displayAs:"hour",offsetHours:24},"1h":{value:60,displayAs:"minute"},"24h":{value:24,displayAs:"hour"},"7d":{value:168,displayAs:"hour"},"14d":{value:336,displayAs:"hour"},"90d":{value:90,displayAs:"day"},"180d":{value:26,displayAs:"week"},mStart:{value:31,displayAs:"day"},yStart:{value:52,displayAs:"week"}},toStartOfIntervalFn={minute:"toStartOfMinute",hour:"toStartOfHour",day:"toStartOfDay",week:"toStartOfWeek",month:"toStartOfMonth"},errorTrackingQuery=_ref=>{let{orderBy,dateRange,assignee,filterTestAccounts,filterGroup,searchQuery,sparklineSelectedPeriod,columns,limit=50}=_ref,select=[];if(sparklineSelectedPeriod){let{value,displayAs,offsetHours}=parseSparklineSelection(sparklineSelectedPeriod),{labels,data}=generateSparklineProps({value,displayAs,offsetHours});select.splice(1,0,` as volume`),columns.splice(1,0,"volume")}return{kind:_queries_schema__WEBPACK_IMPORTED_MODULE_2__.OH.DataTableNode,source:{kind:_queries_schema__WEBPACK_IMPORTED_MODULE_2__.OH.ErrorTrackingQuery,select:select,orderBy:orderBy,dateRange:dateRange,assignee:assignee,filterGroup:filterGroup,filterTestAccounts:filterTestAccounts,searchQuery:searchQuery,limit:limit},showActions:!1,showTimings:!1,columns:columns}},parseSparklineSelection=selection=>{if(selection in SPARKLINE_CONFIGURATIONS)return SPARKLINE_CONFIGURATIONS[selection];let result=selection.match(/\d+|\D+/g);if(result){let[value,unit]=result;return{value:Number(value)*("y"===unit?12:1),displayAs:"h"===unit?"hour":"d"===unit?"day":"w"===unit?"week":"month"}}return{value:24,displayAs:"hour"}},generateSparklineProps=_ref2=>{let{value,displayAs,offsetHours}=_ref2,offset=null!=offsetHours?offsetHours:0,now=(0,lib_dayjs__WEBPACK_IMPORTED_MODULE_0__.Bv)().subtract(offset,"hours").startOf(displayAs),dates=(0,lib_utils__WEBPACK_IMPORTED_MODULE_1__.w6)(value).map(idx=>now.subtract(value-(idx+1),displayAs)),labels=dates.map(d=>`'${d.format("D MMM, YYYY HH:mm")} (UTC)'`),toStartOfInterval=toStartOfIntervalFn[displayAs],data=`reverse(arrayMap(x -> countEqual(groupArray(dateDiff('${displayAs}', ${toStartOfInterval}(timestamp), ${toStartOfInterval}(subtractHours(now(), ${offset})))), x), range(${value})))`;return{labels,data}},errorTrackingIssueQuery=_ref3=>{let{issueId,dateRange,filterTestAccounts,filterGroup}=_ref3;return{kind:_queries_schema__WEBPACK_IMPORTED_MODULE_2__.OH.ErrorTrackingQuery,issueId:issueId,dateRange:dateRange,filterGroup:filterGroup,filterTestAccounts:filterTestAccounts}},errorTrackingIssueEventsQuery=_ref4=>{let{select,issueId,dateRange,filterTestAccounts,filterGroup,offset}=_ref4,group=filterGroup.values[0],properties=group.values,where=[`'${issueId}' == properties.$exception_issue_id`],query={kind:_queries_schema__WEBPACK_IMPORTED_MODULE_2__.OH.EventsQuery,event:"$exception",select,where,properties,filterTestAccounts:filterTestAccounts,offset:offset,limit:50};return dateRange.date_from&&(query.after=dateRange.date_from),dateRange.date_to&&(query.before=dateRange.date_to),query}},"./frontend/src/scenes/project-homepage/ProjectHomePageCompactListItem.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{x:()=>ProjectHomePageCompactListItem});var _posthog_lemon_ui__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./frontend/@posthog/lemon-ui/src/index.ts");__webpack_require__("./node_modules/.pnpm/react@18.2.0/node_modules/react/index.js");var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js");function ProjectHomePageCompactListItem(_ref){let{to,onClick,title,subtitle,prefix,suffix}=_ref;return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_posthog_lemon_ui__WEBPACK_IMPORTED_MODULE_0__.Jp,{fullWidth:!0,to:to,onClick:onClick,className:"h-12",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div",{className:"flex items-start justify-between overflow-hidden gap-2 flex-1",children:[prefix?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("span",{className:"flex shrink-0 text-muted text-xl",children:prefix}):null,(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div",{className:"truncate space-y-0.5 flex-1",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div",{className:"text-link truncate",children:title}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div",{className:"truncate text-muted font-normal text-xs",children:subtitle})]}),suffix?(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("span",{className:"shrink-0",children:suffix}):null]})})}},"./frontend/src/scenes/project-homepage/WatchNextPanel.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{ZB:()=>RecordingRow,d4:()=>WatchNextList,rt:()=>WatchNextPanel}),__webpack_require__("./frontend/src/scenes/project-homepage/ProjectHomepage.scss");var _posthog_icons__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/.pnpm/@posthog+icons@0.9.2_react-dom@18.2.0_react@18.2.0/node_modules/@posthog/icons/dist/posthog-icons.es.js"),clsx__WEBPACK_IMPORTED_MODULE_17__=__webpack_require__("./node_modules/.pnpm/clsx@1.2.1/node_modules/clsx/dist/clsx.m.js"),kea__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__("./node_modules/.pnpm/kea@3.1.5_react@18.2.0/node_modules/kea/lib/index.esm.js"),lib_components_CompactList_CompactList__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__("./frontend/src/lib/components/CompactList/CompactList.tsx"),lib_lemon_ui_icons__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__("./frontend/src/lib/lemon-ui/icons/index.ts"),lib_lemon_ui_LemonSnack__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__("./frontend/src/lib/lemon-ui/LemonSnack/index.ts"),lib_lemon_ui_ProfilePicture__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__("./frontend/src/lib/lemon-ui/ProfilePicture/index.ts"),lib_lemon_ui_Tooltip__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__("./frontend/src/lib/lemon-ui/Tooltip/index.ts"),lib_utils__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__("./frontend/src/lib/utils.tsx"),lib_utils_eventUsageLogic__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__("./frontend/src/lib/utils/eventUsageLogic.ts"),scenes_persons_person_utils__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__("./frontend/src/scenes/persons/person-utils.ts"),scenes_session_recordings_player_modal_sessionPlayerModalLogic__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__("./frontend/src/scenes/session-recordings/player/modal/sessionPlayerModalLogic.ts"),scenes_session_recordings_playlist_sessionRecordingsPlaylistLogic__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__("./frontend/src/scenes/session-recordings/playlist/sessionRecordingsPlaylistLogic.ts"),scenes_teamLogic__WEBPACK_IMPORTED_MODULE_13__=__webpack_require__("./frontend/src/scenes/teamLogic.tsx"),scenes_urls__WEBPACK_IMPORTED_MODULE_14__=__webpack_require__("./frontend/src/scenes/urls.ts"),_ProjectHomePageCompactListItem__WEBPACK_IMPORTED_MODULE_15__=__webpack_require__("./frontend/src/scenes/project-homepage/ProjectHomePageCompactListItem.tsx"),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__=__webpack_require__("./node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js");function ActivityScoreLabel(_ref){let{score}=_ref,n=null!=score?score:0,backgroundColor="bg-primary-alt-highlight",description="very low";return n>=90?(backgroundColor="bg-success-highlight",description="very high"):n>=75?(backgroundColor="bg-success-highlight",description="high"):n>=50?(backgroundColor="bg-warning-highlight",description="medium"):n>=25&&(backgroundColor="bg-warning-highlight",description="low"),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(lib_lemon_ui_LemonSnack__WEBPACK_IMPORTED_MODULE_5__.L,{className:(0,clsx__WEBPACK_IMPORTED_MODULE_17__.default)(backgroundColor,"text-xs"),children:["activity: ",description]})}function RecordingRow(_ref2){let{recording}=_ref2,{openSessionPlayer}=(0,kea__WEBPACK_IMPORTED_MODULE_2__.useActions)(scenes_session_recordings_player_modal_sessionPlayerModalLogic__WEBPACK_IMPORTED_MODULE_11__.A),{reportRecordingOpenedFromRecentRecordingList}=(0,kea__WEBPACK_IMPORTED_MODULE_2__.useActions)(lib_utils_eventUsageLogic__WEBPACK_IMPORTED_MODULE_9__.vx);return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_ProjectHomePageCompactListItem__WEBPACK_IMPORTED_MODULE_15__.x,{title:(0,scenes_persons_person_utils__WEBPACK_IMPORTED_MODULE_10__.y)(recording.person),subtitle:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(ActivityScoreLabel,{score:recording.activity_score}),prefix:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(lib_lemon_ui_ProfilePicture__WEBPACK_IMPORTED_MODULE_6__.Y,{name:(0,scenes_persons_person_utils__WEBPACK_IMPORTED_MODULE_10__.y)(recording.person)}),suffix:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)("div",{className:"flex items-center justify-end text-text-3000",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("span",{children:(0,lib_utils__WEBPACK_IMPORTED_MODULE_8__.C7)(recording.recording_duration)}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(lib_lemon_ui_icons__WEBPACK_IMPORTED_MODULE_4__.Ud,{className:"text-2xl ml-2"})]}),onClick:()=>{openSessionPlayer({id:recording.id}),reportRecordingOpenedFromRecentRecordingList()}})}function WatchNextList(_ref3){let{sessionRecordings,loading,recordingsOptIn}=_ref3;return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(lib_components_CompactList_CompactList__WEBPACK_IMPORTED_MODULE_3__.a,{title:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(lib_lemon_ui_Tooltip__WEBPACK_IMPORTED_MODULE_7__.u,{title:"A selection of the most interesting recordings. We use multiple signals to calculate an activity score.",children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("span",{children:"Watch next"}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_posthog_icons__WEBPACK_IMPORTED_MODULE_1__.IconInfo,{className:"text-lg"})]})}),viewAllURL:scenes_urls__WEBPACK_IMPORTED_MODULE_14__.j.replay(),loading:loading,emptyMessage:recordingsOptIn?{title:"There are no recordings for this project",description:"Make sure you have the javascript snippet setup in your website.",buttonText:"Learn more",buttonTo:"https://posthog.com/docs/user-guides/recordings"}:{title:"Recordings are not enabled for this project",description:"Once recordings are enabled, recordings will display here.",buttonText:"Enable recordings",buttonTo:scenes_urls__WEBPACK_IMPORTED_MODULE_14__.j.settings("project-replay")},items:sessionRecordings.slice(0,5),renderRow:(recording,index)=>(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(RecordingRow,{recording:recording},index)})}function WatchNextPanel(){let{currentTeam}=(0,kea__WEBPACK_IMPORTED_MODULE_2__.useValues)(scenes_teamLogic__WEBPACK_IMPORTED_MODULE_13__.H),sessionRecordingsListLogicInstance=(0,scenes_session_recordings_playlist_sessionRecordingsPlaylistLogic__WEBPACK_IMPORTED_MODULE_12__.YV)({logicKey:"projectHomepage",filters:{...scenes_session_recordings_playlist_sessionRecordingsPlaylistLogic__WEBPACK_IMPORTED_MODULE_12__.I4,duration:[{...scenes_session_recordings_playlist_sessionRecordingsPlaylistLogic__WEBPACK_IMPORTED_MODULE_12__.dK,value:60}],date_to:"-15M",order:"activity_score"}}),{sessionRecordings,sessionRecordingsResponseLoading}=(0,kea__WEBPACK_IMPORTED_MODULE_2__.useValues)(sessionRecordingsListLogicInstance);return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(WatchNextList,{recordingsOptIn:currentTeam?.session_recording_opt_in,sessionRecordings:sessionRecordings,loading:sessionRecordingsResponseLoading})}},"./frontend/src/scenes/web-analytics/WebAnalyticsScene.tsx":(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{WebAnalyticsScene:()=>WebAnalyticsScene,scene:()=>scene});var PageHeader=__webpack_require__("./frontend/src/lib/components/PageHeader.tsx"),posthog_icons_es=__webpack_require__("./node_modules/.pnpm/@posthog+icons@0.9.2_react-dom@18.2.0_react@18.2.0/node_modules/@posthog/icons/dist/posthog-icons.es.js"),index_esm=__webpack_require__("./node_modules/.pnpm/kea@3.1.5_react@18.2.0/node_modules/kea/lib/index.esm.js"),lib=__webpack_require__("./node_modules/.pnpm/kea-loaders@3.0.0_kea@3.1.5/node_modules/kea-loaders/lib/index.js"),kea_router_lib=__webpack_require__("./node_modules/.pnpm/kea-router@3.2.0_kea@3.1.5/node_modules/kea-router/lib/index.js"),kea_window_values_lib=__webpack_require__("./node_modules/.pnpm/kea-window-values@3.0.0_kea@3.1.5/node_modules/kea-window-values/lib/index.js"),api=__webpack_require__("./frontend/src/lib/api.ts"),constants=__webpack_require__("./frontend/src/lib/constants.tsx"),dayjs=__webpack_require__("./frontend/src/lib/dayjs.ts"),LemonButton=__webpack_require__("./frontend/src/lib/lemon-ui/LemonButton/index.ts"),LemonSwitch=__webpack_require__("./frontend/src/lib/lemon-ui/LemonSwitch/index.ts"),Link=__webpack_require__("./frontend/src/lib/lemon-ui/Link/Link.tsx"),Tooltip=__webpack_require__("./frontend/src/lib/lemon-ui/Tooltip/index.ts"),featureFlagLogic=__webpack_require__("./frontend/src/lib/logic/featureFlagLogic.ts"),utils=__webpack_require__("./frontend/src/lib/utils.tsx"),queries=__webpack_require__("./frontend/src/scenes/error-tracking/queries.ts"),urls=__webpack_require__("./frontend/src/scenes/urls.ts"),query=__webpack_require__("./frontend/src/queries/query.ts"),schema=__webpack_require__("./frontend/src/queries/schema.ts"),schema_guards=__webpack_require__("./frontend/src/queries/schema-guards.ts"),types=__webpack_require__("./frontend/src/types.ts"),jsx_runtime=__webpack_require__("./node_modules/.pnpm/react@18.2.0/node_modules/react/jsx-runtime.js");let TileId=function(TileId){return TileId.OVERVIEW="OVERVIEW",TileId.GRAPHS="GRAPHS",TileId.PATHS="PATHS",TileId.SOURCES="SOURCES",TileId.DEVICES="DEVICES",TileId.GEOGRAPHY="GEOGRAPHY",TileId.RETENTION="RETENTION",TileId.REPLAY="REPLAY",TileId.ERROR_TRACKING="ERROR_TRACKING",TileId.GOALS="GOALS",TileId}({}),loadPriorityMap={[TileId.OVERVIEW]:1,[TileId.GRAPHS]:2,[TileId.PATHS]:3,[TileId.SOURCES]:4,[TileId.DEVICES]:5,[TileId.GEOGRAPHY]:6,[TileId.RETENTION]:7,[TileId.REPLAY]:8,[TileId.ERROR_TRACKING]:9,[TileId.GOALS]:10},GraphsTab=function(GraphsTab){return GraphsTab.UNIQUE_USERS="UNIQUE_USERS",GraphsTab.PAGE_VIEWS="PAGE_VIEWS",GraphsTab.NUM_SESSION="NUM_SESSION",GraphsTab.UNIQUE_CONVERSIONS="UNIQUE_CONVERSIONS",GraphsTab.TOTAL_CONVERSIONS="TOTAL_CONVERSIONS",GraphsTab.CONVERSION_RATE="CONVERSION_RATE",GraphsTab}({}),SourceTab=function(SourceTab){return SourceTab.CHANNEL="CHANNEL",SourceTab.REFERRING_DOMAIN="REFERRING_DOMAIN",SourceTab.UTM_SOURCE="UTM_SOURCE",SourceTab.UTM_MEDIUM="UTM_MEDIUM",SourceTab.UTM_CAMPAIGN="UTM_CAMPAIGN",SourceTab.UTM_CONTENT="UTM_CONTENT",SourceTab.UTM_TERM="UTM_TERM",SourceTab.UTM_SOURCE_MEDIUM_CAMPAIGN="UTM_SOURCE_MEDIUM_CAMPAIGN",SourceTab}({}),DeviceTab=function(DeviceTab){return DeviceTab.BROWSER="BROWSER",DeviceTab.OS="OS",DeviceTab.DEVICE_TYPE="DEVICE_TYPE",DeviceTab.VIEWPORT="VIEWPORT",DeviceTab}({}),PathTab=function(PathTab){return PathTab.PATH="PATH",PathTab.INITIAL_PATH="INITIAL_PATH",PathTab.END_PATH="END_PATH",PathTab.EXIT_CLICK="EXIT_CLICK",PathTab.SCREEN_NAME="SCREEN_NAME",PathTab}({}),GeographyTab=function(GeographyTab){return GeographyTab.MAP="MAP",GeographyTab.COUNTRIES="COUNTRIES",GeographyTab.REGIONS="REGIONS",GeographyTab.CITIES="CITIES",GeographyTab.TIMEZONES="TIMEZONES",GeographyTab.LANGUAGES="LANGUAGES",GeographyTab}({}),ConversionGoalWarning=function(ConversionGoalWarning){return ConversionGoalWarning.CustomEventWithNoSessionId="CustomEventWithNoSessionId",ConversionGoalWarning}({}),GEOIP_PLUGIN_URLS=["https://github.com/PostHog/posthog-plugin-geoip","https://www.npmjs.com/package/@posthog/geoip-plugin"],WEB_ANALYTICS_DATA_COLLECTION_NODE_ID="web-analytics",initialInterval=(0,utils.Rx)("-7d",null),getDashboardItemId=(section,tab,isModal)=>`new-AdHoc.web-analytics.${section}.${tab||"default"}.${isModal?"modal":"default"}`,teamId=window.POSTHOG_APP_CONTEXT?.current_team?.id,persistConfig={persist:!0,prefix:`${teamId}__`},webAnalyticsLogic=(0,index_esm.kea)([(0,index_esm.path)(["scenes","webAnalytics","webAnalyticsSceneLogic"]),(0,index_esm.connect)(()=>({values:[featureFlagLogic.h,["featureFlags"]]})),(0,index_esm.actions)({setWebAnalyticsFilters:webAnalyticsFilters=>({webAnalyticsFilters}),togglePropertyFilter:(type,key,value,tabChange)=>({type,key,value,tabChange}),setGraphsTab:tab=>({tab}),setSourceTab:tab=>({tab}),setDeviceTab:tab=>({tab}),setPathTab:tab=>({tab}),setGeographyTab:tab=>({tab}),setDates:(dateFrom,dateTo)=>({dateFrom,dateTo}),setInterval:interval=>({interval}),setDatesAndInterval:(dateFrom,dateTo,interval)=>({dateFrom,dateTo,interval}),setIsPathCleaningEnabled:isPathCleaningEnabled=>({isPathCleaningEnabled}),setShouldFilterTestAccounts:shouldFilterTestAccounts=>({shouldFilterTestAccounts}),setShouldStripQueryParams:shouldStripQueryParams=>({shouldStripQueryParams}),setConversionGoal:conversionGoal=>({conversionGoal}),openModal:(tileId,tabId)=>({tileId,tabId}),closeModal:()=>!0,openAsNewInsight:(tileId,tabId)=>({tileId,tabId}),setConversionGoalWarning:warning=>({warning}),setCompareFilter:compareFilter=>({compareFilter})}),(0,index_esm.reducers)({webAnalyticsFilters:[[],persistConfig,{setWebAnalyticsFilters:(_,_ref)=>{let{webAnalyticsFilters}=_ref;return webAnalyticsFilters},togglePropertyFilter:(oldPropertyFilters,_ref2)=>{let{key,value,type}=_ref2;if(null===value){let isNotSetFilterExists=oldPropertyFilters.some(f=>f.type===type||f.key===key||f.operator===types.WV.IsNotSet);return isNotSetFilterExists?oldPropertyFilters.filter(f=>f.type!==type||f.key!==key||f.operator!==types.WV.IsNotSet):[...oldPropertyFilters,{type,key,operator:types.WV.IsNotSet}]}let similarFilterExists=oldPropertyFilters.some(f=>f.type===type&&f.key===key&&f.operator===types.WV.Exact);if(similarFilterExists)return oldPropertyFilters.map(f=>{let newValue;if(f.key!==key||f.type!==type||![types.WV.Exact,types.WV.IsNotSet].includes(f.operator))return f;let oldValue=(Array.isArray(f.value)?f.value:[f.value]).filter(utils.DX);if(oldValue.includes(value)){if(!(oldValue.length>1))return null;newValue=[value]}else newValue=[...oldValue,value];return{type:types.FT.Event,key,operator:types.WV.Exact,value:newValue}}).filter(utils.DX);let newFilter={type,key,value,operator:types.WV.Exact};return[...oldPropertyFilters,newFilter]}}],_graphsTab:[null,persistConfig,{setGraphsTab:(_,_ref3)=>{let{tab}=_ref3;return tab},togglePropertyFilter:(oldTab,_ref4)=>{let{tabChange}=_ref4;return tabChange?.graphsTab||oldTab}}],_sourceTab:[null,persistConfig,{setSourceTab:(_,_ref5)=>{let{tab}=_ref5;return tab},togglePropertyFilter:(oldTab,_ref6)=>{let{tabChange}=_ref6;return tabChange?.sourceTab||oldTab}}],_deviceTab:[null,persistConfig,{setDeviceTab:(_,_ref7)=>{let{tab}=_ref7;return tab},togglePropertyFilter:(oldTab,_ref8)=>{let{tabChange}=_ref8;return tabChange?.deviceTab||oldTab}}],_pathTab:[null,persistConfig,{setPathTab:(_,_ref9)=>{let{tab}=_ref9;return tab},togglePropertyFilter:(oldTab,_ref10)=>{let{tabChange}=_ref10;return tabChange?.pathTab||oldTab}}],_geographyTab:[null,persistConfig,{setGeographyTab:(_,_ref11)=>{let{tab}=_ref11;return tab},togglePropertyFilter:(oldTab,_ref12)=>{let{tabChange}=_ref12;return tabChange?.geographyTab||oldTab}}],isPathCleaningEnabled:[null,persistConfig,{setIsPathCleaningEnabled:(_,_ref13)=>{let{isPathCleaningEnabled}=_ref13;return isPathCleaningEnabled}}],_modalTileAndTab:[null,{openModal:(_,_ref14)=>{let{tileId,tabId}=_ref14;return{tileId,tabId}},closeModal:()=>null}],dateFilter:[{dateFrom:"-7d",dateTo:null,interval:initialInterval},persistConfig,{setDates:(_,_ref15)=>{let{dateTo,dateFrom}=_ref15;return{dateTo,dateFrom,interval:(0,utils.Rx)(dateFrom,dateTo)}},setInterval:(_ref16,_ref17)=>{let{dateFrom:oldDateFrom,dateTo:oldDateTo}=_ref16,{interval}=_ref17,{dateFrom,dateTo}=(0,utils.pQ)(interval,oldDateFrom,oldDateTo);return{dateTo,dateFrom,interval}},setDatesAndInterval:(_,_ref18)=>{let{dateTo,dateFrom,interval}=_ref18;return dateFrom||dateTo||(dateFrom="-7d",dateTo=null),{dateTo,dateFrom,interval:interval||(0,utils.Rx)(dateFrom,dateTo)}}}],shouldFilterTestAccounts:[!1,persistConfig,{setShouldFilterTestAccounts:(_,_ref19)=>{let{shouldFilterTestAccounts}=_ref19;return shouldFilterTestAccounts}}],shouldStripQueryParams:[!1,persistConfig,{setShouldStripQueryParams:(_,_ref20)=>{let{shouldStripQueryParams}=_ref20;return shouldStripQueryParams}}],conversionGoal:[null,persistConfig,{setConversionGoal:(_,_ref21)=>{let{conversionGoal}=_ref21;return conversionGoal}}],conversionGoalWarning:[null,{setConversionGoalWarning:(_,_ref22)=>{let{warning}=_ref22;return warning}}],compareFilter:[{compare:!0},persistConfig,{setCompareFilter:(_,_ref23)=>{let{compareFilter}=_ref23;return compareFilter}}]}),(0,index_esm.selectors)(_ref24=>{let{actions,values}=_ref24;return{graphsTab:[s=>[s._graphsTab],graphsTab=>graphsTab||GraphsTab.UNIQUE_USERS],sourceTab:[s=>[s._sourceTab],sourceTab=>sourceTab||SourceTab.CHANNEL],deviceTab:[s=>[s._deviceTab],deviceTab=>deviceTab||DeviceTab.DEVICE_TYPE],pathTab:[s=>[s._pathTab],pathTab=>pathTab||PathTab.PATH],geographyTab:[s=>[s._geographyTab],geographyTab=>geographyTab||GeographyTab.MAP],tabs:[s=>[s.graphsTab,s.sourceTab,s.deviceTab,s.pathTab,s.geographyTab,()=>values.shouldShowGeographyTile],(graphsTab,sourceTab,deviceTab,pathTab,geographyTab,shouldShowGeographyTile)=>({graphsTab,sourceTab,deviceTab,pathTab,geographyTab,shouldShowGeographyTile})],controls:[s=>[s.isPathCleaningEnabled,s.shouldFilterTestAccounts,s.shouldStripQueryParams],(isPathCleaningEnabled,filterTestAccounts,shouldStripQueryParams)=>({isPathCleaningEnabled,filterTestAccounts,shouldStripQueryParams})],filters:[s=>[s.webAnalyticsFilters,s.replayFilters,s.dateFilter,s.compareFilter,()=>values.conversionGoal],(webAnalyticsFilters,replayFilters,dateFilter,compareFilter,conversionGoal)=>({webAnalyticsFilters,replayFilters,dateFilter,compareFilter,conversionGoal})],tiles:[s=>[s.tabs,s.controls,s.filters,()=>values.featureFlags,()=>values.isGreaterThanMd],(_ref25,_ref26,_ref27,featureFlags,isGreaterThanMd)=>{let{graphsTab,sourceTab,deviceTab,pathTab,geographyTab,shouldShowGeographyTile}=_ref25,{isPathCleaningEnabled,filterTestAccounts,shouldStripQueryParams}=_ref26,{webAnalyticsFilters,replayFilters,dateFilter:{dateFrom,dateTo,interval},conversionGoal,compareFilter}=_ref27,dateRange={date_from:dateFrom,date_to:dateTo},sampling={enabled:!1,forceSamplingRate:{numerator:1,denominator:10}},createInsightProps=(tile,tab)=>({dashboardItemId:getDashboardItemId(tile,tab,!1),loadPriority:loadPriorityMap[tile],dataNodeCollectionId:WEB_ANALYTICS_DATA_COLLECTION_NODE_ID}),uniqueUserSeries={event:featureFlags[constants.y8.WEB_ANALYTICS_FOR_MOBILE]?"$screen":"$pageview",kind:schema.OH.EventsNode,math:types.vN.UniqueUsers,name:"Pageview",custom_name:"Unique visitors"},pageViewsSeries={...uniqueUserSeries,math:types.vN.TotalCount,custom_name:featureFlags[constants.y8.WEB_ANALYTICS_FOR_MOBILE]?"Screen Views":"Page views"},sessionsSeries={...uniqueUserSeries,math:types.vN.UniqueSessions,custom_name:"Sessions"},uniqueConversionsSeries=conversionGoal?"actionId"in conversionGoal?{kind:schema.OH.ActionsNode,id:conversionGoal.actionId,math:types.vN.UniqueUsers,name:"Unique conversions",custom_name:"Unique conversions"}:{kind:schema.OH.EventsNode,event:conversionGoal.customEventName,math:types.vN.UniqueUsers,name:"Unique conversions",custom_name:"Unique conversions"}:void 0,totalConversionSeries=uniqueConversionsSeries?{...uniqueConversionsSeries,math:types.vN.TotalCount,name:"Total conversions",custom_name:"Total conversions"}:void 0,createGraphsTrendsTab=(id,title,linkText,series,trendsFilter)=>({id,title,linkText,query:{kind:schema.OH.InsightVizNode,source:{kind:schema.OH.TrendsQuery,dateRange,interval,series:series,trendsFilter:{display:types.Qb.ActionsLineGraph,...trendsFilter},compareFilter,filterTestAccounts,conversionGoal:featureFlags[constants.y8.WEB_ANALYTICS_CONVERSION_GOAL_FILTERS]?conversionGoal:void 0,properties:webAnalyticsFilters},hidePersonsModal:!0,embedded:!0},showIntervalSelect:!0,insightProps:createInsightProps(TileId.GRAPHS,id),canOpenInsight:!0}),createTableTab=(tileId,tabId,title,linkText,breakdownBy,source,tab)=>{let columns=["breakdown_value","visitors","views"];return source?.includeBounceRate&&columns.push("bounce_rate"),{id:tabId,title,linkText,query:{full:!0,kind:schema.OH.DataTableNode,source:{kind:schema.OH.WebStatsTableQuery,properties:webAnalyticsFilters,breakdownBy:breakdownBy,dateRange,sampling,compareFilter,limit:10,filterTestAccounts,conversionGoal:featureFlags[constants.y8.WEB_ANALYTICS_CONVERSION_GOAL_FILTERS]?conversionGoal:void 0,...source||{}},embedded:!1,columns},insightProps:createInsightProps(tileId,tabId),canOpenModal:!0,...tab||{}}},pathCleaningSettingsUrl=urls.j.settings("project-product-analytics","path-cleaning"),customChannelTypesUrl=urls.j.settings("environment-web-analytics","channel-type"),pathCleaningControl=(0,jsx_runtime.jsx)(LemonSwitch.f,{label:(0,jsx_runtime.jsxs)("div",{className:"flex flex-row space-x-2",children:[(0,jsx_runtime.jsx)(Tooltip.u,{title:(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:["Check"," ",(0,jsx_runtime.jsx)(Link.r,{to:"https://posthog.com/docs/product-analytics/paths#path-cleaning-rules",children:"our path cleaning rules documentation"})," ","to learn more about path cleaning"]}),interactive:!0,children:(0,jsx_runtime.jsx)("span",{children:"Enable path cleaning"})}),(0,jsx_runtime.jsx)(LemonButton.J,{icon:(0,jsx_runtime.jsx)(posthog_icons_es.IconGear,{}),type:"tertiary",status:"alt",size:"small",noPadding:!0,tooltip:"Edit path cleaning settings",to:pathCleaningSettingsUrl})]}),checked:!!isPathCleaningEnabled,onChange:value=>actions.setIsPathCleaningEnabled(value),className:"h-full"}),allTiles=[{kind:"query",tileId:TileId.OVERVIEW,layout:{colSpanClassName:"md:col-span-full",orderWhenLargeClassName:"xxl:order-0"},query:{kind:schema.OH.WebOverviewQuery,properties:webAnalyticsFilters,dateRange,sampling,compareFilter,filterTestAccounts,conversionGoal,includeLCPScore:!0},insightProps:createInsightProps(TileId.OVERVIEW),canOpenModal:!1},{kind:"tabs",tileId:TileId.GRAPHS,layout:{colSpanClassName:"md:col-span-2",orderWhenLargeClassName:"xxl:order-1"},activeTabId:graphsTab,setTabId:actions.setGraphsTab,tabs:[createGraphsTrendsTab(GraphsTab.UNIQUE_USERS,"Unique visitors","Visitors",[uniqueUserSeries]),conversionGoal?null:createGraphsTrendsTab(GraphsTab.PAGE_VIEWS,"Page views","Views",[pageViewsSeries]),conversionGoal?null:createGraphsTrendsTab(GraphsTab.NUM_SESSION,"Unique sessions","Sessions",[sessionsSeries]),conversionGoal&&uniqueConversionsSeries?createGraphsTrendsTab(GraphsTab.UNIQUE_CONVERSIONS,"Unique conversions","Unique conversions",[uniqueConversionsSeries]):null,conversionGoal&&totalConversionSeries?createGraphsTrendsTab(GraphsTab.TOTAL_CONVERSIONS,"Total conversions","Total conversions",[totalConversionSeries]):null,conversionGoal&&uniqueUserSeries&&uniqueConversionsSeries?createGraphsTrendsTab(GraphsTab.CONVERSION_RATE,"Conversion rate","Conversion rate",[uniqueConversionsSeries,uniqueUserSeries],{formula:"A / B",aggregationAxisFormat:"percentage_scaled"}):null].filter(utils.DX)},{kind:"tabs",tileId:TileId.PATHS,layout:{colSpanClassName:"md:col-span-2",orderWhenLargeClassName:"xxl:order-4"},activeTabId:pathTab,setTabId:actions.setPathTab,tabs:featureFlags[constants.y8.WEB_ANALYTICS_FOR_MOBILE]?[createTableTab(TileId.PATHS,PathTab.SCREEN_NAME,"Screens","Screen",schema.GI.ScreenName,{},{})]:[createTableTab(TileId.PATHS,PathTab.PATH,"Paths","Path",schema.GI.Page,{includeScrollDepth:!1,includeBounceRate:!0,doPathCleaning:!!isPathCleaningEnabled},{control:pathCleaningControl,docs:{url:"https://posthog.com/docs/web-analytics/dashboard#paths",title:"Paths",description:(0,jsx_runtime.jsxs)("div",{children:[(0,jsx_runtime.jsx)("p",{children:"In this view you can validate all of the paths that were accessed in your application, regardless of when they were accessed through the lifetime of a user session."}),conversionGoal?(0,jsx_runtime.jsx)("p",{children:"The conversion rate is the percentage of users who completed the conversion goal in this specific path."}):(0,jsx_runtime.jsxs)("p",{children:["The"," ",(0,jsx_runtime.jsx)(Link.r,{to:"https://posthog.com/docs/web-analytics/dashboard#bounce-rate",children:"bounce rate"})," ","indicates the percentage of users who left your page immediately after visiting without capturing any event."]})]})}}),createTableTab(TileId.PATHS,PathTab.INITIAL_PATH,"Entry paths","Entry path",schema.GI.InitialPage,{includeBounceRate:!0,includeScrollDepth:!1,doPathCleaning:!!isPathCleaningEnabled},{control:pathCleaningControl,docs:{url:"https://posthog.com/docs/web-analytics/dashboard#paths",title:"Entry Path",description:(0,jsx_runtime.jsxs)("div",{children:[(0,jsx_runtime.jsx)("p",{children:"Entry paths are the paths a user session started, i.e. the first path they saw when they opened your website."}),conversionGoal&&(0,jsx_runtime.jsx)("p",{children:"The conversion rate is the percentage of users who completed the conversion goal after the first path in their session being this path."})]})}}),createTableTab(TileId.PATHS,PathTab.END_PATH,"End paths","End path",schema.GI.ExitPage,{includeBounceRate:!1,includeScrollDepth:!1,doPathCleaning:!!isPathCleaningEnabled},{control:pathCleaningControl,docs:{url:"https://posthog.com/docs/web-analytics/dashboard#paths",title:"End Path",description:(0,jsx_runtime.jsx)("div",{children:"End paths are the last path a user visited before their session ended, i.e. the last path they saw before leaving your website/closing the browser/turning their computer off."})}}),{id:PathTab.EXIT_CLICK,title:"Outbound link clicks",linkText:"Outbound clicks",query:{full:!0,kind:schema.OH.DataTableNode,source:{kind:schema.OH.WebExternalClicksTableQuery,properties:webAnalyticsFilters,dateRange,compareFilter,sampling,limit:10,filterTestAccounts,conversionGoal:featureFlags[constants.y8.WEB_ANALYTICS_CONVERSION_GOAL_FILTERS]?conversionGoal:void 0,stripQueryParams:shouldStripQueryParams},embedded:!1,columns:["url","visitors","clicks"]},insightProps:createInsightProps(TileId.PATHS,PathTab.END_PATH),canOpenModal:!0,docs:{title:"Outbound Clicks",description:(0,jsx_runtime.jsx)("div",{children:"You'll be able to verify when someone leaves your website by clicking an outbound link (to a separate domain)"})}}].filter(utils.DX)},{kind:"tabs",tileId:TileId.SOURCES,layout:{colSpanClassName:"md:col-span-1",orderWhenLargeClassName:"xxl:order-2"},activeTabId:sourceTab,setTabId:actions.setSourceTab,tabs:[createTableTab(TileId.SOURCES,SourceTab.CHANNEL,"Channels","Channel",schema.GI.InitialChannelType,{},{control:(0,jsx_runtime.jsxs)("div",{className:"flex flex-row space-x-2 font-medium",children:[(0,jsx_runtime.jsx)("span",{children:"Customize channel types"}),(0,jsx_runtime.jsx)(LemonButton.J,{icon:(0,jsx_runtime.jsx)(posthog_icons_es.IconGear,{}),type:"tertiary",status:"alt",size:"small",noPadding:!0,tooltip:"Customize channel types",to:customChannelTypesUrl})]}),docs:{url:"https://posthog.com/docs/data/channel-type",title:"Channels",description:(0,jsx_runtime.jsxs)("div",{children:[(0,jsx_runtime.jsx)("p",{children:"Channels are the different sources that bring traffic to your website, e.g. Paid Search, Organic Social, Direct, etc."}),(0,jsx_runtime.jsxs)("p",{children:["You can also"," ",(0,jsx_runtime.jsx)(Link.r,{to:urls.j.settings("environment-web-analytics","channel-type"),children:"create custom channel types"}),", allowing you to further categorize your channels."]}),(0,jsx_runtime.jsxs)("p",{children:["Something unexpected? Try the"," ",(0,jsx_runtime.jsx)(Link.r,{to:urls.j.sessionAttributionExplorer(),children:"Session attribution explorer"})]})]})}}),createTableTab(TileId.SOURCES,SourceTab.REFERRING_DOMAIN,"Referrers","Referring domain",schema.GI.InitialReferringDomain,{},{docs:{url:"https://posthog.com/docs/web-analytics/dashboard#referrers-channels-utms",title:"Referrers",description:"Understand where your users are coming from"}}),createTableTab(TileId.SOURCES,SourceTab.UTM_SOURCE,"UTM sources","UTM source",schema.GI.InitialUTMSource,{},{docs:{url:"https://posthog.com/docs/web-analytics/dashboard#utms",title:"UTM source",description:(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:["Understand where your users are coming from - filtered down by their"," ",(0,jsx_runtime.jsx)("code",{children:"utm_source"})," parameter"]})}}),createTableTab(TileId.SOURCES,SourceTab.UTM_MEDIUM,"UTM medium","UTM medium",schema.GI.InitialUTMMedium,{},{docs:{url:"https://posthog.com/docs/web-analytics/dashboard#utms",title:"UTM medium",description:(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:["Understand where your users are coming from - filtered down by their"," ",(0,jsx_runtime.jsx)("code",{children:"utm_medium"})," parameter"]})}}),createTableTab(TileId.SOURCES,SourceTab.UTM_CAMPAIGN,"UTM campaigns","UTM campaign",schema.GI.InitialUTMCampaign,{},{docs:{url:"https://posthog.com/docs/web-analytics/dashboard#utms",title:"UTM campaign",description:(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:["Understand where your users are coming from - filtered down by their"," ",(0,jsx_runtime.jsx)("code",{children:"utm_campaign"})," parameter"]})}}),createTableTab(TileId.SOURCES,SourceTab.UTM_CONTENT,"UTM content","UTM content",schema.GI.InitialUTMContent,{},{docs:{url:"https://posthog.com/docs/web-analytics/dashboard#utms",title:"UTM content",description:(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:["Understand where your users are coming from - filtered down by their"," ",(0,jsx_runtime.jsx)("code",{children:"utm_content"})," parameter"]})}}),createTableTab(TileId.SOURCES,SourceTab.UTM_TERM,"UTM terms","UTM term",schema.GI.InitialUTMTerm,{},{docs:{url:"https://posthog.com/docs/web-analytics/dashboard#utms",title:"UTM term",description:(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:["Understand where your users are coming from - filtered down by their"," ",(0,jsx_runtime.jsx)("code",{children:"utm_term"})," parameter"]})}}),createTableTab(TileId.SOURCES,SourceTab.UTM_SOURCE_MEDIUM_CAMPAIGN,"Source / Medium / Campaign","UTM s/m/c",schema.GI.InitialUTMSourceMediumCampaign,{},{docs:{url:"https://posthog.com/docs/web-analytics/dashboard#utms",title:"UTM parameters",description:(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:["Understand where your users are coming from - filtered down by a tuple of their ",(0,jsx_runtime.jsx)("code",{children:"utm_source"}),", ",(0,jsx_runtime.jsx)("code",{children:"utm_medium"}),", and"," ",(0,jsx_runtime.jsx)("code",{children:"utm_campaign"})," parameters"]})}})]},{kind:"tabs",tileId:TileId.DEVICES,layout:{colSpanClassName:"md:col-span-1",orderWhenLargeClassName:"xxl:order-3"},activeTabId:deviceTab,setTabId:actions.setDeviceTab,tabs:[createTableTab(TileId.DEVICES,DeviceTab.DEVICE_TYPE,"Device type","Device type",schema.GI.DeviceType),createTableTab(TileId.DEVICES,DeviceTab.BROWSER,"Browsers","Browser",schema.GI.Browser),createTableTab(TileId.DEVICES,DeviceTab.OS,"OS","OS",schema.GI.OS),createTableTab(TileId.DEVICES,DeviceTab.VIEWPORT,"Viewports","Viewport",schema.GI.Viewport)]},shouldShowGeographyTile?{kind:"tabs",tileId:TileId.GEOGRAPHY,layout:{colSpanClassName:"md:col-span-full"},activeTabId:geographyTab||GeographyTab.MAP,setTabId:actions.setGeographyTab,tabs:[{id:GeographyTab.MAP,title:"World map",linkText:"Map",query:{kind:schema.OH.InsightVizNode,source:{kind:schema.OH.TrendsQuery,breakdownFilter:{breakdown:"$geoip_country_code",breakdown_type:"event"},dateRange,series:[{event:"$pageview",name:"Pageview",kind:schema.OH.EventsNode,math:types.vN.UniqueUsers}],trendsFilter:{display:types.Qb.WorldMap},conversionGoal:featureFlags[constants.y8.WEB_ANALYTICS_CONVERSION_GOAL_FILTERS]?conversionGoal:void 0,filterTestAccounts,properties:webAnalyticsFilters},hidePersonsModal:!0,embedded:!0},insightProps:createInsightProps(TileId.GEOGRAPHY,GeographyTab.MAP),canOpenInsight:!0},createTableTab(TileId.GEOGRAPHY,GeographyTab.COUNTRIES,"Countries","Countries",schema.GI.Country),createTableTab(TileId.GEOGRAPHY,GeographyTab.REGIONS,"Regions","Regions",schema.GI.Region),createTableTab(TileId.GEOGRAPHY,GeographyTab.CITIES,"Cities","Cities",schema.GI.City),createTableTab(TileId.GEOGRAPHY,GeographyTab.TIMEZONES,"Timezones","Timezones",schema.GI.Timezone),createTableTab(TileId.GEOGRAPHY,GeographyTab.LANGUAGES,"Languages","Languages",schema.GI.Language)]}:null,conversionGoal?null:{kind:"query",tileId:TileId.RETENTION,title:"Retention",layout:{colSpanClassName:"md:col-span-2"},query:{kind:schema.OH.InsightVizNode,source:{kind:schema.OH.RetentionQuery,properties:webAnalyticsFilters,dateRange,filterTestAccounts,retentionFilter:{retentionType:constants.qL,retentionReference:"total",totalIntervals:isGreaterThanMd?8:5,period:types.xW.Week}},vizSpecificOptions:{[types.dw.RETENTION]:{hideLineGraph:!0,hideSizeColumn:!isGreaterThanMd,useSmallLayout:!isGreaterThanMd}},embedded:!0},insightProps:createInsightProps(TileId.RETENTION),canOpenInsight:!1,canOpenModal:!0,docs:{url:"https://posthog.com/docs/web-analytics/dashboard#retention",title:"Retention",description:(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:(0,jsx_runtime.jsxs)("div",{children:[(0,jsx_runtime.jsx)("p",{children:"Retention creates a cohort of unique users who performed any event for the first time in the last week. It then tracks the percentage of users who return to perform any event in the following weeks."}),(0,jsx_runtime.jsx)("p",{children:"You want the numbers to be the highest possible, suggesting that people that come to your page continue coming to your page - and performing an actions. Also, the further down the table the higher the numbers should be (or at least as high), which would indicate that you're either increasing or keeping your retention at the same level."})]})})}},conversionGoal?null:{kind:"query",tileId:TileId.GOALS,title:"Goals",layout:{colSpanClassName:"md:col-span-2"},query:{full:!0,kind:schema.OH.DataTableNode,source:{kind:schema.OH.WebGoalsQuery,properties:webAnalyticsFilters,dateRange,compareFilter,sampling,limit:10,filterTestAccounts},embedded:!0,columns:["breakdown_value","visitors","views"]},insightProps:createInsightProps(TileId.GOALS),canOpenInsight:!1,canOpenModal:!1,docs:{url:"https://posthog.com/docs/web-analytics/dashboard#goals",title:"Goals",description:(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:(0,jsx_runtime.jsx)("div",{children:(0,jsx_runtime.jsxs)("p",{children:["Goals shows your pinned or most recently created actions and the number of conversions they've had. You can set a custom event or action as a"," ",(0,jsx_runtime.jsx)(Link.r,{to:"https://posthog.com/docs/web-analytics/conversion-goals",children:"conversion goal"})," ","at the top of the dashboard for more specific metrics."]})})})}},conversionGoal?null:{kind:"replay",tileId:TileId.REPLAY,layout:{colSpanClassName:conversionGoal?"md:col-span-full":"md:col-span-1"},docs:{url:"https://posthog.com/docs/session-replay",title:"Session Replay",description:"Play back sessions to diagnose UI issues, improve support, and get context for nuanced user behavior."}},!conversionGoal&&featureFlags[constants.y8.ERROR_TRACKING]?{kind:"error_tracking",tileId:TileId.ERROR_TRACKING,layout:{colSpanClassName:"md:col-span-1"},query:(0,queries.mx)({orderBy:"users",dateRange:dateRange,filterTestAccounts:filterTestAccounts,filterGroup:replayFilters.filter_group,sparklineSelectedPeriod:null,columns:["error","users","occurrences"],limit:4}),docs:{url:"https://posthog.com/docs/error-tracking",title:"Error Tracking",description:(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:(0,jsx_runtime.jsxs)("div",{children:[(0,jsx_runtime.jsx)("p",{children:"Error tracking allows you to track, investigate, and resolve exceptions your customers face."}),(0,jsx_runtime.jsxs)("p",{children:["Errors are captured as ",(0,jsx_runtime.jsx)("code",{children:"$exception"})," events which means that you can create insights, filter recordings and trigger surveys based on them exactly the same way you can for any other type of event."]})]})})}}:null];return allTiles.filter(utils.DX)}],modal:[s=>[s.tiles,s._modalTileAndTab],(tiles,modalTileAndTab)=>{if(!modalTileAndTab)return null;let{tileId,tabId}=modalTileAndTab,tile=tiles.find(tile=>tile.tileId===tileId);if(!tile)return null;let extendQuery=query=>query.kind===schema.OH.DataTableNode&&(query.source.kind===schema.OH.WebStatsTableQuery||query.source.kind===schema.OH.WebExternalClicksTableQuery||query.source.kind===schema.OH.WebGoalsQuery)?{...query,source:{...query.source,limit:50}}:query;if("tabs"===tile.kind){let tab=tile.tabs.find(tab=>tab.id===tabId);return tab?{tileId,tabId,title:tab.title,showIntervalSelect:tab.showIntervalSelect,control:tab.control,insightProps:{dashboardItemId:getDashboardItemId(tileId,tabId,!0),loadPriority:0,doNotLoad:!1,dataNodeCollectionId:WEB_ANALYTICS_DATA_COLLECTION_NODE_ID},query:extendQuery(tab.query),canOpenInsight:tab.canOpenInsight}:null}return"query"===tile.kind?{tileId,title:tile.title,showIntervalSelect:tile.showIntervalSelect,control:tile.control,insightProps:{dashboardItemId:getDashboardItemId(tileId,void 0,!0),loadPriority:0,dataNodeCollectionId:WEB_ANALYTICS_DATA_COLLECTION_NODE_ID},query:extendQuery(tile.query)}:null}],hasCountryFilter:[s=>[s.webAnalyticsFilters],webAnalyticsFilters=>webAnalyticsFilters.some(filter=>"$geoip_country_code"===filter.key)],hasDeviceTypeFilter:[s=>[s.webAnalyticsFilters],webAnalyticsFilters=>webAnalyticsFilters.some(filter=>"$device_type"===filter.key)],hasBrowserFilter:[s=>[s.webAnalyticsFilters],webAnalyticsFilters=>webAnalyticsFilters.some(filter=>"$browser"===filter.key)],hasOSFilter:[s=>[s.webAnalyticsFilters],webAnalyticsFilters=>webAnalyticsFilters.some(filter=>"$os"===filter.key)],replayFilters:[s=>[s.webAnalyticsFilters,s.dateFilter,s.shouldFilterTestAccounts,s.conversionGoal,s.featureFlags],(webAnalyticsFilters,dateFilter,shouldFilterTestAccounts,conversionGoal,featureFlags)=>{let filters=[...webAnalyticsFilters];return conversionGoal&&featureFlags[constants.y8.WEB_ANALYTICS_CONVERSION_GOAL_FILTERS]&&("actionId"in conversionGoal?filters.push({id:conversionGoal.actionId,name:String(conversionGoal.actionId),type:"actions"}):"customEventName"in conversionGoal&&filters.push({id:conversionGoal.customEventName,name:conversionGoal.customEventName,type:"events"})),{filter_test_accounts:shouldFilterTestAccounts,date_from:dateFilter.dateFrom,date_to:dateFilter.dateTo,filter_group:{type:types.J2.And,values:[{type:types.J2.And,values:filters}]},duration:[{type:types.FT.Recording,key:"active_seconds",operator:types.WV.GreaterThan,value:1}]}}],getNewInsightUrl:[s=>[s.tiles],tiles=>function getNewInsightUrl(tileId,tabId){let formatQueryForNewInsight=query=>query.kind===schema.OH.InsightVizNode?{...query,embedded:void 0,hidePersonsModal:void 0}:query,tile=tiles.find(tile=>tile.tileId===tileId);if(tile){if("tabs"===tile.kind){let tab=tile.tabs.find(tab=>tab.id===tabId);if(!tab)return;return urls.j.insightNew(void 0,void 0,formatQueryForNewInsight(tab.query))}if("query"===tile.kind)return urls.j.insightNew(void 0,void 0,formatQueryForNewInsight(tile.query));if("replay"===tile.kind)return urls.j.replay()}}]}}),(0,lib.loaders)(()=>({statusCheck:{__default:null,loadStatusCheck:async()=>{let[pageviewResult,pageleaveResult,pageleaveScroll,pageViewsWithoutSessionsResult]=await Promise.allSettled([api.ZP.eventDefinitions.list({event_type:types.uW.Event,search:"$pageview"}),api.ZP.eventDefinitions.list({event_type:types.uW.Event,search:"$pageleave"}),api.ZP.propertyDefinitions.list({event_names:["$pageleave"],properties:["$prev_pageview_max_content_percentage"]}),api.ZP.query({kind:schema.OH.HogQLQuery,query:"SELECT events.properties.$lib as lib FROM events WHERE event='$pageview' AND or(events.$session_id IS NULL, events.$session_id = '') AND timestamp > today() LIMIT 1"})]),pageviewEntry="fulfilled"===pageviewResult.status?pageviewResult.value.results.find(r=>"$pageview"===r.name):void 0,pageleaveEntry="fulfilled"===pageleaveResult.status?pageleaveResult.value.results.find(r=>"$pageleave"===r.name):void 0,pageleaveScrollEntry="fulfilled"===pageleaveScroll.status?pageleaveScroll.value.results.find(r=>"$prev_pageview_max_content_percentage"===r.name):void 0,libSendingPageViewsWithoutSessionIds="fulfilled"===pageViewsWithoutSessionsResult.status?pageViewsWithoutSessionsResult.value.results?.[0]?.[0]:void 0,isSendingPageViews=!!pageviewEntry&&!isDefinitionStale(pageviewEntry),isSendingPageLeaves=!!pageleaveEntry&&!isDefinitionStale(pageleaveEntry),isSendingPageLeavesScroll=!!pageleaveScrollEntry&&!isDefinitionStale(pageleaveScrollEntry);return{isSendingPageViews,isSendingPageLeaves,isSendingPageLeavesScroll,libSendingPageViewsWithoutSessionIds}}},shouldShowGeographyTile:{_default:null,loadShouldShowGeographyTile:async()=>{let[propertiesResponse,pluginsResponse,pluginsConfigResponse]=await Promise.allSettled([api.ZP.propertyDefinitions.list({event_names:["$pageview"],properties:["$geoip_country_code"]}),api.ZP.loadPaginatedResults("api/organizations/@current/plugins"),api.ZP.loadPaginatedResults("api/plugin_config")]),hasNonStaleCountryCodeDefinition="fulfilled"===propertiesResponse.status&&propertiesResponse.value.results.some(property=>"$geoip_country_code"===property.name&&!isDefinitionStale(property));if(!hasNonStaleCountryCodeDefinition)return!1;let geoIpPlugin="fulfilled"===pluginsResponse.status&&pluginsResponse.value.find(plugin=>plugin.url&&GEOIP_PLUGIN_URLS.includes(plugin.url)),geoIpPluginId=geoIpPlugin?geoIpPlugin.id:void 0,geoIpPluginConfig=(0,utils.DX)(geoIpPluginId)&&"fulfilled"===pluginsConfigResponse.status&&pluginsConfigResponse.value.find(plugin=>plugin.plugin===geoIpPluginId);return!!geoIpPluginConfig&&geoIpPluginConfig.enabled}}})),(0,index_esm.afterMount)(_ref28=>{let{actions}=_ref28;actions.loadStatusCheck(),actions.loadShouldShowGeographyTile()}),(0,kea_window_values_lib.windowValues)({isGreaterThanMd:window1=>window1.innerWidth>768}),(0,kea_router_lib.actionToUrl)(_ref29=>{let{values}=_ref29,stateToUrl=()=>{let{webAnalyticsFilters,conversionGoal,dateFilter:{dateTo,dateFrom,interval},_sourceTab,_deviceTab,_pathTab,_geographyTab,_graphsTab,isPathCleaningEnabled,shouldFilterTestAccounts,compareFilter}=values,urlParams=new URLSearchParams;return webAnalyticsFilters.length>0&&urlParams.set("filters",JSON.stringify(webAnalyticsFilters)),conversionGoal&&("actionId"in conversionGoal?urlParams.set("conversionGoal.actionId",conversionGoal.actionId.toString()):urlParams.set("conversionGoal.customEventName",conversionGoal.customEventName)),("-7d"!==dateFrom||null!==dateTo||interval!==initialInterval)&&(urlParams.set("date_from",null!=dateFrom?dateFrom:""),urlParams.set("date_to",null!=dateTo?dateTo:""),urlParams.set("interval",null!=interval?interval:"")),_deviceTab&&urlParams.set("device_tab",_deviceTab),_sourceTab&&urlParams.set("source_tab",_sourceTab),_graphsTab&&urlParams.set("graphs_tab",_graphsTab),_pathTab&&urlParams.set("path_tab",_pathTab),_geographyTab&&urlParams.set("geography_tab",_geographyTab),null!=isPathCleaningEnabled&&urlParams.set("path_cleaning",isPathCleaningEnabled.toString()),null!=shouldFilterTestAccounts&&urlParams.set("filter_test_accounts",shouldFilterTestAccounts.toString()),compareFilter&&urlParams.set("compare_filter",JSON.stringify(compareFilter)),`/web?${urlParams.toString()}`};return{setWebAnalyticsFilters:stateToUrl,togglePropertyFilter:stateToUrl,setConversionGoal:stateToUrl,setDates:stateToUrl,setInterval:stateToUrl,setDeviceTab:stateToUrl,setSourceTab:stateToUrl,setGraphsTab:stateToUrl,setPathTab:stateToUrl,setGeographyTab:stateToUrl,setCompareFilter:stateToUrl}}),(0,kea_router_lib.urlToAction)(_ref30=>{let{actions,values}=_ref30;return{"/web":(_,_ref31)=>{let{filters,"conversionGoal.actionId":conversionGoalActionId,"conversionGoal.customEventName":conversionGoalCustomEventName,date_from,date_to,interval,device_tab,source_tab,graphs_tab,path_tab,geography_tab,path_cleaning,filter_test_accounts,compare_filter}=_ref31,parsedFilters=(0,schema_guards.X)(filters)?filters:void 0;parsedFilters&&!(0,utils.h0)(parsedFilters,values.webAnalyticsFilters)&&actions.setWebAnalyticsFilters(parsedFilters),conversionGoalActionId&&conversionGoalActionId!==values.conversionGoal?.actionId?actions.setConversionGoal({actionId:parseInt(conversionGoalActionId,10)}):conversionGoalCustomEventName&&conversionGoalCustomEventName!==values.conversionGoal?.customEventName&&actions.setConversionGoal({customEventName:conversionGoalCustomEventName}),(date_from&&date_from!==values.dateFilter.dateFrom||date_to&&date_to!==values.dateFilter.dateTo||interval&&interval!==values.dateFilter.interval)&&actions.setDatesAndInterval(date_from,date_to,interval),device_tab&&device_tab!==values._deviceTab&&actions.setDeviceTab(device_tab),source_tab&&source_tab!==values._sourceTab&&actions.setSourceTab(source_tab),graphs_tab&&graphs_tab!==values._graphsTab&&actions.setGraphsTab(graphs_tab),path_tab&&path_tab!==values._pathTab&&actions.setPathTab(path_tab),geography_tab&&geography_tab!==values._geographyTab&&actions.setGeographyTab(geography_tab),path_cleaning&&path_cleaning!==values.isPathCleaningEnabled&&actions.setIsPathCleaningEnabled([!0,"true",1,"1"].includes(path_cleaning)),filter_test_accounts&&filter_test_accounts!==values.shouldFilterTestAccounts&&actions.setShouldFilterTestAccounts([!0,"true",1,"1"].includes(filter_test_accounts)),compare_filter&&!(0,utils.h0)(compare_filter,values.compareFilter)&&actions.setCompareFilter(compare_filter)}}}),(0,index_esm.listeners)(_ref32=>{let{values,actions}=_ref32,checkGraphsTabIsCompatibleWithConversionGoal=(tab,conversionGoal)=>{conversionGoal?(tab===GraphsTab.PAGE_VIEWS||tab===GraphsTab.NUM_SESSION)&&actions.setGraphsTab(GraphsTab.UNIQUE_USERS):(tab===GraphsTab.TOTAL_CONVERSIONS||tab===GraphsTab.CONVERSION_RATE||tab===GraphsTab.UNIQUE_CONVERSIONS)&&actions.setGraphsTab(GraphsTab.UNIQUE_USERS)};return{setGraphsTab:_ref33=>{let{tab}=_ref33;checkGraphsTabIsCompatibleWithConversionGoal(tab,values.conversionGoal)},setConversionGoal:[_ref34=>{let{conversionGoal}=_ref34;checkGraphsTabIsCompatibleWithConversionGoal(values.graphsTab,conversionGoal)},(_ref35,breakpoint)=>{let{conversionGoal}=_ref35;return checkCustomEventConversionGoalHasSessionIdsHelper(conversionGoal,breakpoint,actions.setConversionGoalWarning)}]}}),(0,index_esm.afterMount)(_ref36=>{let{actions,values}=_ref36;checkCustomEventConversionGoalHasSessionIdsHelper(values.conversionGoal,void 0,actions.setConversionGoalWarning).catch(()=>{})})]),isDefinitionStale=definition=>{let parsedLastSeen=definition.last_seen_at?(0,dayjs.Bv)(definition.last_seen_at):null;return!!parsedLastSeen&&(0,dayjs.Bv)().diff(parsedLastSeen,"seconds")>constants.Mo},checkCustomEventConversionGoalHasSessionIdsHelper=async(conversionGoal,breakpoint,setConversionGoalWarning)=>{if(!conversionGoal||!("customEventName"in conversionGoal)||!conversionGoal.customEventName){setConversionGoalWarning(null);return}let{customEventName}=conversionGoal,response=await (0,query.Uu)("select count() from events where timestamp >= (now() - toIntervalHour(24)) AND ($session_id IS NULL OR $session_id = '') AND event = {event}",{event:customEventName});breakpoint?.();let row=response.results[0];setConversionGoalWarning(row[0]?ConversionGoalWarning.CustomEventWithNoSessionId:null)};var LemonMenu=__webpack_require__("./frontend/src/lib/lemon-ui/LemonMenu/index.ts");let WebAnalyticsMenu=()=>{let{shouldFilterTestAccounts}=(0,index_esm.useValues)(webAnalyticsLogic),{setShouldFilterTestAccounts}=(0,index_esm.useActions)(webAnalyticsLogic);return(0,jsx_runtime.jsx)(LemonMenu.d,{items:[{label:"Session Attribution Explorer",to:urls.j.sessionAttributionExplorer(),icon:(0,jsx_runtime.jsx)(posthog_icons_es.IconSearch,{})},{label:()=>(0,jsx_runtime.jsx)(LemonSwitch.f,{checked:shouldFilterTestAccounts,onChange:()=>{setShouldFilterTestAccounts(!shouldFilterTestAccounts)},fullWidth:!0,label:"Filter test accounts"})}],closeOnClickInside:!1,children:(0,jsx_runtime.jsx)(LemonButton.J,{icon:(0,jsx_runtime.jsx)(posthog_icons_es.IconEllipsis,{}),size:"small"})})};var clsx_m=__webpack_require__("./node_modules/.pnpm/clsx@1.2.1/node_modules/clsx/dist/clsx.m.js"),CompareFilter=__webpack_require__("./frontend/src/lib/components/CompareFilter/CompareFilter.tsx"),DateFilter=__webpack_require__("./frontend/src/lib/components/DateFilter/DateFilter.tsx"),VersionCheckerBanner=__webpack_require__("./frontend/src/lib/components/VersionChecker/VersionCheckerBanner.tsx"),icons=__webpack_require__("./frontend/src/lib/lemon-ui/icons/index.ts"),LemonSegmentedSelect=__webpack_require__("./frontend/src/lib/lemon-ui/LemonSegmentedSelect/LemonSegmentedSelect.tsx"),Popover=__webpack_require__("./frontend/src/lib/lemon-ui/Popover/index.ts"),react=__webpack_require__("./node_modules/.pnpm/react@18.2.0/node_modules/react/index.js"),TZLabel=__webpack_require__("./frontend/src/lib/components/TZLabel/index.tsx"),LemonTableLink=__webpack_require__("./frontend/src/lib/lemon-ui/LemonTable/LemonTableLink.tsx"),queryFeatures=__webpack_require__("./frontend/src/queries/nodes/DataTable/queryFeatures.ts"),Query=__webpack_require__("./frontend/src/queries/Query/Query.tsx");let context={extraDataTableQueryFeatures:[queryFeatures.P.hideLoadNextButton],showOpenEditorButton:!1,showQueryEditor:!1,columns:{error:{width:"50%",render:props=>{let record=props.record;return(0,jsx_runtime.jsx)("div",{className:"flex items-start space-x-1.5 group",children:(0,jsx_runtime.jsx)(LemonTableLink.i,{title:record.name||"Unknown Type",description:(0,jsx_runtime.jsxs)("div",{className:"space-y-1",children:[(0,jsx_runtime.jsx)("div",{className:"line-clamp-1",children:record.description}),(0,jsx_runtime.jsx)("div",{className:"space-x-1",children:(0,jsx_runtime.jsx)(TZLabel.w,{time:record.last_seen,className:"border-dotted border-b"})})]}),className:"flex-1",to:urls.j.errorTrackingIssue(record.id)})})}},users:{align:"right"},occurrences:{align:"right"}}},WebAnalyticsErrorTrackingTile=_ref=>{var _layout$colSpanClassN,_layout$rowSpanClassN,_layout$orderWhenLarg;let{tile}=_ref,{layout,query}=tile,to=urls.j.errorTracking();return(0,jsx_runtime.jsxs)("div",{className:(0,clsx_m.default)("col-span-1 row-span-1 flex flex-col",null!==(_layout$colSpanClassN=layout.colSpanClassName)&&void 0!==_layout$colSpanClassN?_layout$colSpanClassN:"md:col-span-6",null!==(_layout$rowSpanClassN=layout.rowSpanClassName)&&void 0!==_layout$rowSpanClassN?_layout$rowSpanClassN:"md:row-span-1",null!==(_layout$orderWhenLarg=layout.orderWhenLargeClassName)&&void 0!==_layout$orderWhenLarg?_layout$orderWhenLarg:"xxl:order-12",layout.className),children:[(0,jsx_runtime.jsx)("h2",{className:"m-0 mb-3",children:"Error tracking"}),(0,jsx_runtime.jsx)("div",{className:"border rounded bg-bg-light flex-1 flex flex-col py-2 px-1",children:(0,jsx_runtime.jsx)(Query.A,{query:query,embedded:!0,context:context})}),(0,jsx_runtime.jsx)("div",{className:"flex flex-row-reverse my-2",children:(0,jsx_runtime.jsx)(LemonButton.J,{to:to,icon:(0,jsx_runtime.jsx)(icons.pF,{}),size:"small",type:"secondary",children:"View all"})})]})};var EmptyMessage=__webpack_require__("./frontend/src/lib/components/EmptyMessage/EmptyMessage.tsx"),LemonSkeleton=__webpack_require__("./frontend/src/lib/lemon-ui/LemonSkeleton/index.ts"),WatchNextPanel=__webpack_require__("./frontend/src/scenes/project-homepage/WatchNextPanel.tsx"),sessionRecordingsPlaylistLogic=__webpack_require__("./frontend/src/scenes/session-recordings/playlist/sessionRecordingsPlaylistLogic.ts"),teamLogic=__webpack_require__("./frontend/src/scenes/teamLogic.tsx");function WebAnalyticsRecordingsTile(_ref){var _layout$colSpanClassN,_layout$rowSpanClassN,_layout$orderWhenLarg;let{tile}=_ref,{layout}=tile,{replayFilters,webAnalyticsFilters}=(0,index_esm.useValues)(webAnalyticsLogic),{currentTeam}=(0,index_esm.useValues)(teamLogic.H),sessionRecordingsListLogicInstance=(0,sessionRecordingsPlaylistLogic.YV)({logicKey:"webAnalytics",filters:replayFilters}),{sessionRecordings,sessionRecordingsResponseLoading}=(0,index_esm.useValues)(sessionRecordingsListLogicInstance),items=sessionRecordings.slice(0,5),emptyMessage=currentTeam?.session_recording_opt_in?webAnalyticsFilters.length>0?{title:"There are no recordings matching the current filters",description:"Try changing the filters, or view all recordings.",buttonText:"View all",buttonTo:urls.j.replay()}:{title:"There are no recordings matching this date range",description:"Make sure you have the javascript snippet setup in your website.",buttonText:"Learn more",buttonTo:"https://posthog.com/docs/user-guides/recordings"}:{title:"Recordings are not enabled for this project",description:"Once recordings are enabled, new recordings will display here.",buttonText:"Enable recordings",buttonTo:urls.j.settings("project-replay")},to=items.length>0?urls.j.replay(types.yd.Home,replayFilters):urls.j.replay();return(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:(0,jsx_runtime.jsxs)("div",{className:(0,clsx_m.default)("col-span-1 row-span-1 flex flex-col",null!==(_layout$colSpanClassN=layout.colSpanClassName)&&void 0!==_layout$colSpanClassN?_layout$colSpanClassN:"md:col-span-6",null!==(_layout$rowSpanClassN=layout.rowSpanClassName)&&void 0!==_layout$rowSpanClassN?_layout$rowSpanClassN:"md:row-span-1",null!==(_layout$orderWhenLarg=layout.orderWhenLargeClassName)&&void 0!==_layout$orderWhenLarg?_layout$orderWhenLarg:"xxl:order-12",layout.className),children:[(0,jsx_runtime.jsx)("h2",{className:"m-0 mb-3",children:"Session replay"}),(0,jsx_runtime.jsx)("div",{className:"border rounded bg-bg-light flex-1 flex flex-col py-2 px-1",children:sessionRecordingsResponseLoading?(0,jsx_runtime.jsx)("div",{className:"p-2 space-y-6",children:Array.from({length:6},(_,index)=>(0,jsx_runtime.jsx)(LemonSkeleton.y,{},index))}):0===items.length&&emptyMessage?(0,jsx_runtime.jsx)(EmptyMessage.M,{...emptyMessage}):items.map((item,index)=>(0,jsx_runtime.jsx)(WatchNextPanel.ZB,{recording:item},index))}),(0,jsx_runtime.jsx)("div",{className:"flex flex-row-reverse my-2",children:(0,jsx_runtime.jsx)(LemonButton.J,{to:to,icon:(0,jsx_runtime.jsx)(icons.pF,{}),size:"small",type:"secondary",children:"View all"})})]})})}var src=__webpack_require__("./frontend/@posthog/lemon-ui/src/index.ts"),colors=__webpack_require__("./frontend/src/lib/colors.ts"),IntervalFilter=__webpack_require__("./frontend/src/lib/components/IntervalFilter/index.ts"),ProductIntroduction=__webpack_require__("./frontend/src/lib/components/ProductIntroduction/ProductIntroduction.tsx"),NewActionButton=__webpack_require__("./frontend/src/scenes/actions/NewActionButton.tsx"),WorldMap=__webpack_require__("./frontend/src/scenes/insights/views/WorldMap/index.ts"),countryCodes=__webpack_require__("./frontend/src/scenes/insights/views/WorldMap/countryCodes.ts"),userLogic=__webpack_require__("./frontend/src/scenes/userLogic.ts"),actionsModel=__webpack_require__("./frontend/src/models/actionsModel.ts");let toUtcOffsetFormat=value=>{if(0===value)return"UTC";let integerPart=Math.floor(value),decimalPartAsMinutes=60*(value-integerPart),formattedMinutes=decimalPartAsMinutes>0?`:${decimalPartAsMinutes}`:"";return`UTC${integerPart>0?"+":"-"}${integerPart}${formattedMinutes}`},VariationCell=function(){let{isPercentage,reverseColors}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{isPercentage:!1,reverseColors:!1},formatNumber=value=>{var _value$toLocaleString;return isPercentage?`${(100*value).toFixed(1)}%`:null!==(_value$toLocaleString=value?.toLocaleString())&&void 0!==_value$toLocaleString?_value$toLocaleString:"(empty)"};return function Cell(_ref){let{value}=_ref,{compareFilter}=(0,index_esm.useValues)(webAnalyticsLogic);if(!value)return null;if(!Array.isArray(value))return(0,jsx_runtime.jsx)("span",{children:String(value)});let[current,previous]=value,pctChangeFromPrevious=0===previous&&0===current?0:null!==current&&compareFilter&&!1!==compareFilter.compare?null===previous||0===previous?1/0:current/previous-1:null,trend=null===pctChangeFromPrevious?null:0===pctChangeFromPrevious?{Icon:icons.cs,color:(0,colors.cM)("muted")}:pctChangeFromPrevious>0?{Icon:posthog_icons_es.IconTrending,color:reverseColors?(0,colors.cM)("danger"):(0,colors.cM)("success")}:{Icon:icons.j4,color:reverseColors?(0,colors.cM)("success"):(0,colors.cM)("danger")},tooltip=null!==pctChangeFromPrevious?`${current>=previous?"Increased":"Decreased"} by ${(0,utils.e9)(Math.abs(pctChangeFromPrevious),0)} since last period (from ${formatNumber(previous)} to ${formatNumber(current)})`:null;return(0,jsx_runtime.jsx)("div",{className:(0,clsx_m.default)({"pr-4":!trend}),children:(0,jsx_runtime.jsx)(src.u,{title:tooltip,children:(0,jsx_runtime.jsxs)("span",{children:[formatNumber(current),"\xa0",trend&&(0,jsx_runtime.jsx)("span",{style:{color:trend.color},children:(0,jsx_runtime.jsx)(trend.Icon,{color:trend.color,className:"ml-1"})})]})})})}},webStatsBreakdownToPropertyName=breakdownBy=>{switch(breakdownBy){case schema.GI.Page:return{key:"$pathname",type:types.FT.Event};case schema.GI.InitialPage:return{key:"$entry_pathname",type:types.FT.Session};case schema.GI.ExitPage:return{key:"$end_pathname",type:types.FT.Session};case schema.GI.ExitClick:return{key:"$last_external_click_url",type:types.FT.Session};case schema.GI.ScreenName:return{key:"$screen_name",type:types.FT.Event};case schema.GI.InitialChannelType:return{key:"$channel_type",type:types.FT.Session};case schema.GI.InitialReferringDomain:return{key:"$entry_referring_domain",type:types.FT.Session};case schema.GI.InitialUTMSource:return{key:"$entry_utm_source",type:types.FT.Session};case schema.GI.InitialUTMCampaign:return{key:"$entry_utm_campaign",type:types.FT.Session};case schema.GI.InitialUTMMedium:return{key:"$entry_utm_medium",type:types.FT.Session};case schema.GI.InitialUTMContent:return{key:"$entry_utm_content",type:types.FT.Session};case schema.GI.InitialUTMTerm:return{key:"$entry_utm_term",type:types.FT.Session};case schema.GI.Browser:return{key:"$browser",type:types.FT.Event};case schema.GI.OS:return{key:"$os",type:types.FT.Event};case schema.GI.Viewport:return{key:"$viewport",type:types.FT.Event};case schema.GI.DeviceType:return{key:"$device_type",type:types.FT.Event};case schema.GI.Country:return{key:"$geoip_country_code",type:types.FT.Event};case schema.GI.Region:return{key:"$geoip_subdivision_1_code",type:types.FT.Event};case schema.GI.City:return{key:"$geoip_city_name",type:types.FT.Event};case schema.GI.Timezone:return{key:"$timezone",type:types.FT.Event};case schema.GI.Language:return{key:"$geoip_language",type:types.FT.Event};case schema.GI.InitialUTMSourceMediumCampaign:return;default:throw new utils.q0(breakdownBy)}},webAnalyticsDataTableQueryContext={columns:{breakdown_value:{renderTitle:props=>{let{query}=props,{source}=query;if(source.kind!==schema.OH.WebStatsTableQuery)return null;let{breakdownBy}=source;switch(breakdownBy){case schema.GI.Page:return(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:"Path"});case schema.GI.InitialPage:return(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:"Initial Path"});case schema.GI.ExitPage:return(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:"End Path"});case schema.GI.ExitClick:return(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:"Exit Click"});case schema.GI.ScreenName:return(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:"Screen Name"});case schema.GI.InitialChannelType:return(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:"Initial Channel Type"});case schema.GI.InitialReferringDomain:return(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:"Referring Domain"});case schema.GI.InitialUTMSource:return(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:"UTM Source"});case schema.GI.InitialUTMCampaign:return(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:"UTM Campaign"});case schema.GI.InitialUTMMedium:return(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:"UTM Medium"});case schema.GI.InitialUTMTerm:return(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:"UTM Term"});case schema.GI.InitialUTMContent:return(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:"UTM Content"});case schema.GI.Browser:return(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:"Browser"});case schema.GI.OS:return(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:"OS"});case schema.GI.Viewport:return(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:"Viewport"});case schema.GI.DeviceType:return(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:"Device Type"});case schema.GI.Country:return(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:"Country"});case schema.GI.Region:return(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:"Region"});case schema.GI.City:return(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:"City"});case schema.GI.Timezone:return(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:"Timezone"});case schema.GI.Language:return(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:"Language"});case schema.GI.InitialUTMSourceMediumCampaign:return(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:"Source / Medium / Campaign"});default:throw new utils.q0(breakdownBy)}},render:props=>{let{value,query}=props,{source}=query;if(source.kind!==schema.OH.WebStatsTableQuery)return null;let{breakdownBy}=source;switch(breakdownBy){case schema.GI.Viewport:if(Array.isArray(value)){let[width,height]=value;return(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[width,"x",height]})}break;case schema.GI.Country:if("string"==typeof value)return(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,WorldMap.q9)(value)," ",WorldMap.XJ[value]||value]});break;case schema.GI.Region:if(Array.isArray(value)){let[countryCode,regionCode,regionName]=value;return(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,WorldMap.q9)(countryCode)," ",WorldMap.XJ[countryCode]||countryCode," -"," ",regionName||regionCode]})}break;case schema.GI.City:if(Array.isArray(value)){let[countryCode,cityName]=value;return(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,WorldMap.q9)(countryCode)," ",WorldMap.XJ[countryCode]||countryCode," - ",cityName]})}break;case schema.GI.Timezone:if("number"==typeof value)return(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:toUtcOffsetFormat(value)});break;case schema.GI.Language:if("string"==typeof value){var _countryCode$match$,_countryCodeToFlag;let[languageCode,countryCode]=value.split("-"),parsedCountryCode=null!==(_countryCode$match$=countryCode?.match(/([A-Z]{2})/)?.[0])&&void 0!==_countryCode$match$?_countryCode$match$:"";return(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[null!==(_countryCodeToFlag=(0,WorldMap.q9)(parsedCountryCode))&&void 0!==_countryCodeToFlag?_countryCodeToFlag:(0,countryCodes.RD)(languageCode),"\xa0",countryCodes.lY[languageCode]||languageCode]})}}return"string"==typeof value?(0,jsx_runtime.jsx)(jsx_runtime.Fragment,{children:value}):null}},bounce_rate:{title:(0,jsx_runtime.jsx)("span",{className:"pr-5",children:"Bounce Rate"}),render:VariationCell({isPercentage:!0,reverseColors:!0}),align:"right"},views:{title:(0,jsx_runtime.jsx)("span",{className:"pr-5",children:"Views"}),render:VariationCell(),align:"right"},clicks:{title:(0,jsx_runtime.jsx)("span",{className:"pr-5",children:"Clicks"}),render:VariationCell(),align:"right"},visitors:{title:(0,jsx_runtime.jsx)("span",{className:"pr-5",children:"Visitors"}),render:VariationCell(),align:"right"},average_scroll_percentage:{title:(0,jsx_runtime.jsx)("span",{className:"pr-5",children:"Average Scroll"}),render:VariationCell({isPercentage:!0}),align:"right"},scroll_gt80_percentage:{title:(0,jsx_runtime.jsx)("span",{className:"pr-5",children:"Deep Scroll Rate"}),render:VariationCell({isPercentage:!0}),align:"right"},total_conversions:{title:(0,jsx_runtime.jsx)("span",{className:"pr-5",children:"Total Conversions"}),render:VariationCell(),align:"right"},unique_conversions:{title:(0,jsx_runtime.jsx)("span",{className:"pr-5",children:"Unique Conversions"}),render:VariationCell(),align:"right"},conversion_rate:{title:(0,jsx_runtime.jsx)("span",{className:"pr-5",children:"Conversion Rate"}),render:VariationCell({isPercentage:!0}),align:"right"},converting_users:{title:(0,jsx_runtime.jsx)("span",{className:"pr-5",children:"Converting Users"}),render:VariationCell(),align:"right"},action_name:{title:"Action"}}},WebStatsTrendTile=_ref2=>{let{query,showIntervalTile,insightProps}=_ref2,{togglePropertyFilter,setInterval:setInterval1}=(0,index_esm.useActions)(webAnalyticsLogic),{hasCountryFilter,deviceTab,hasDeviceTypeFilter,hasBrowserFilter,hasOSFilter,dateFilter:{interval}}=(0,index_esm.useValues)(webAnalyticsLogic),worldMapPropertyName=webStatsBreakdownToPropertyName(schema.GI.Country)?.key,deviceTypePropertyName=webStatsBreakdownToPropertyName(schema.GI.DeviceType)?.key,onWorldMapClick=(0,react.useCallback)(breakdownValue=>{worldMapPropertyName&&togglePropertyFilter(types.FT.Event,worldMapPropertyName,breakdownValue,{geographyTab:hasCountryFilter?void 0:GeographyTab.REGIONS})},[togglePropertyFilter,worldMapPropertyName]),onDeviceTilePieChartClick=(0,react.useCallback)(graphPoint=>{let newTab;if(null==graphPoint.seriesId)return;let dataset=graphPoint.crossDataset?.[graphPoint.seriesId];if(!dataset)return;let breakdownValues=dataset.breakdownValues?.[graphPoint.index],breakdownValue=Array.isArray(breakdownValues)?breakdownValues[0]:breakdownValues;breakdownValue&&deviceTypePropertyName&&(deviceTab===DeviceTab.DEVICE_TYPE||hasDeviceTypeFilter?deviceTab===DeviceTab.BROWSER||hasBrowserFilter?deviceTab===DeviceTab.OS||hasOSFilter||(newTab=DeviceTab.OS):newTab=DeviceTab.BROWSER:newTab=DeviceTab.DEVICE_TYPE,togglePropertyFilter(types.FT.Event,deviceTypePropertyName,breakdownValue,{deviceTab:newTab}))},[togglePropertyFilter,deviceTypePropertyName,deviceTab,hasDeviceTypeFilter,hasBrowserFilter,hasOSFilter]),context=(0,react.useMemo)(()=>({...webAnalyticsDataTableQueryContext,chartRenderingMetadata:{[types.Qb.WorldMap]:{countryProps:(countryCode,values)=>({onClick:values&&(values.count>0||values.aggregated_value>0)?()=>onWorldMapClick(countryCode):void 0})},[types.Qb.ActionsPie]:{onSegmentClick:onDeviceTilePieChartClick}},insightProps:{...insightProps,query}}),[onWorldMapClick,insightProps]);return(0,jsx_runtime.jsxs)("div",{className:"border rounded bg-bg-light flex-1 flex flex-col",children:[showIntervalTile&&(0,jsx_runtime.jsx)("div",{className:"flex flex-row items-center justify-end m-2 mr-4",children:(0,jsx_runtime.jsxs)("div",{className:"flex flex-row items-center",children:[(0,jsx_runtime.jsx)("span",{className:"mr-2",children:"Group by"}),(0,jsx_runtime.jsx)(IntervalFilter.T,{interval:interval,onIntervalChange:setInterval1,options:[{value:"hour",label:"Hour"},{value:"day",label:"Day"},{value:"week",label:"Week"},{value:"month",label:"Month"}]})]})}),(0,jsx_runtime.jsx)(Query.A,{query:query,readOnly:!0,context:context})]})},WebStatsTableTile=_ref3=>{let{query,breakdownBy,insightProps,control}=_ref3,{togglePropertyFilter}=(0,index_esm.useActions)(webAnalyticsLogic),{isPathCleaningEnabled}=(0,index_esm.useValues)(webAnalyticsLogic),{key,type}=webStatsBreakdownToPropertyName(breakdownBy)||{},onClick=(0,react.useCallback)(breakdownValue=>{key&&type&&togglePropertyFilter(type,key,breakdownValue)},[togglePropertyFilter,type,key]),context=(0,react.useMemo)(()=>({...webAnalyticsDataTableQueryContext,insightProps,rowProps:record=>{if((breakdownBy===schema.GI.InitialPage||breakdownBy===schema.GI.Page)&&isPathCleaningEnabled||breakdownBy===schema.GI.Language||breakdownBy===schema.GI.Timezone)return{};let breakdownValue=getBreakdownValue(record,breakdownBy);return void 0===breakdownValue?{}:{onClick:key&&type?()=>onClick(breakdownValue):void 0}}}),[onClick,insightProps]);return(0,jsx_runtime.jsxs)("div",{className:"border rounded bg-bg-light flex-1 flex flex-col",children:[null!=control&&(0,jsx_runtime.jsx)("div",{className:"flex flex-row items-center justify-end m-2 mr-4",children:control}),(0,jsx_runtime.jsx)(Query.A,{query:query,readOnly:!0,context:context})]})},getBreakdownValue=(record,breakdownBy)=>{if("object"!=typeof record||!record||!("result"in record))return;let result=record.result;if(!Array.isArray(result))return;let breakdownValue=result[0];switch(breakdownBy){case schema.GI.Country:if(Array.isArray(breakdownValue))return breakdownValue[0];break;case schema.GI.Region:case schema.GI.City:if(Array.isArray(breakdownValue))return breakdownValue[1]}return null===breakdownValue?null:"string"==typeof breakdownValue?breakdownValue:void 0},WebGoalsTile=_ref4=>{let{query,insightProps}=_ref4,{actions,actionsLoading}=(0,index_esm.useValues)(actionsModel.D),{updateHasSeenProductIntroFor}=(0,index_esm.useActions)(userLogic.userLogic);return actionsLoading?null:actions.length?(0,jsx_runtime.jsxs)("div",{className:"border rounded bg-bg-light flex-1",children:[(0,jsx_runtime.jsx)("div",{className:"flex flex-row-reverse p-2",children:(0,jsx_runtime.jsx)(LemonButton.J,{to:urls.j.actions(),sideIcon:(0,jsx_runtime.jsx)(icons.pF,{}),type:"secondary",size:"small",children:"Manage actions"})}),(0,jsx_runtime.jsx)(Query.A,{query:query,readOnly:!0,context:{...webAnalyticsDataTableQueryContext,insightProps}})]}):(0,jsx_runtime.jsx)(ProductIntroduction.C,{productName:"Actions",productKey:types.Md.ACTIONS,thingName:"action",isEmpty:!0,description:"Use actions to combine events that you want to have tracked together or to make detailed Autocapture events easier to reuse.",docsURL:"https://posthog.com/docs/data/actions",actionElementOverride:(0,jsx_runtime.jsx)(NewActionButton.O,{onSelectOption:()=>updateHasSeenProductIntroFor(types.Md.ACTIONS,!0)})})},WebExternalClicksTile=_ref5=>{let{query,insightProps}=_ref5,{shouldStripQueryParams}=(0,index_esm.useValues)(webAnalyticsLogic),{setShouldStripQueryParams}=(0,index_esm.useActions)(webAnalyticsLogic);return(0,jsx_runtime.jsxs)("div",{className:"border rounded bg-bg-light flex-1 flex flex-col",children:[(0,jsx_runtime.jsx)("div",{className:"flex flex-row items-center justify-end m-2 mr-4",children:(0,jsx_runtime.jsx)("div",{className:"flex flex-row items-center space-x-2",children:(0,jsx_runtime.jsx)(LemonSwitch.f,{label:"Strip query parameters",checked:shouldStripQueryParams,onChange:setShouldStripQueryParams,className:"h-full"})})}),(0,jsx_runtime.jsx)(Query.A,{query:query,readOnly:!0,context:{...webAnalyticsDataTableQueryContext,insightProps}})]})},WebQuery=_ref6=>{let{query,showIntervalSelect,control,insightProps}=_ref6;return query.kind===schema.OH.DataTableNode&&query.source.kind===schema.OH.WebStatsTableQuery?(0,jsx_runtime.jsx)(WebStatsTableTile,{query:query,breakdownBy:query.source.breakdownBy,insightProps:insightProps,control:control}):query.kind===schema.OH.DataTableNode&&query.source.kind===schema.OH.WebExternalClicksTableQuery?(0,jsx_runtime.jsx)(WebExternalClicksTile,{query:query,insightProps:insightProps}):query.kind===schema.OH.InsightVizNode?(0,jsx_runtime.jsx)(WebStatsTrendTile,{query:query,showIntervalTile:showIntervalSelect,insightProps:insightProps}):query.kind===schema.OH.DataTableNode&&query.source.kind===schema.OH.WebGoalsQuery?(0,jsx_runtime.jsx)(WebGoalsTile,{query:query,insightProps:insightProps}):(0,jsx_runtime.jsx)(Query.A,{query:query,readOnly:!0,context:{...webAnalyticsDataTableQueryContext,insightProps}})};var LemonBanner=__webpack_require__("./frontend/src/lib/lemon-ui/LemonBanner/index.ts"),lemon_ui_Link=__webpack_require__("./frontend/src/lib/lemon-ui/Link/index.ts");let KNOWN_SERVER_SIDE_SDKS=["segment","posthog-node","posthog-ruby","posthog-go","posthog-php","posthog-java"],WebAnalyticsHealthCheck=()=>{let{statusCheck,conversionGoalWarning}=(0,index_esm.useValues)(webAnalyticsLogic);return conversionGoalWarning&&conversionGoalWarning===ConversionGoalWarning.CustomEventWithNoSessionId?(0,jsx_runtime.jsxs)(LemonBanner.V,{type:"warning",className:"mt-2",children:[(0,jsx_runtime.jsxs)("p",{children:["A custom event has been set as a conversion goal, but it has been seen with no"," ",(0,jsx_runtime.jsx)("code",{children:"$session_id"}),". This means that some queries will not be able to include these events."]}),(0,jsx_runtime.jsxs)("p",{children:["To fix this, please see"," ",(0,jsx_runtime.jsx)(lemon_ui_Link.r,{to:"https://posthog.com/docs/data/sessions#custom-session-ids",children:"documentation for custom session IDs"}),"."]})]}):statusCheck?statusCheck.isSendingPageViews?statusCheck.libSendingPageViewsWithoutSessionIds?(0,jsx_runtime.jsxs)(LemonBanner.V,{type:"warning",className:"mt-2",children:[(0,jsx_runtime.jsxs)("p",{children:["Some ",(0,jsx_runtime.jsx)("code",{children:"$pageview"})," events have been sent without a ",(0,jsx_runtime.jsx)("code",{children:"$session_id"}),". This page is optimized for session-based analytics, and some features may not work correctly."]}),KNOWN_SERVER_SIDE_SDKS.includes(statusCheck.libSendingPageViewsWithoutSessionIds.toLowerCase())?(0,jsx_runtime.jsxs)("p",{children:["Please see"," ",(0,jsx_runtime.jsx)(lemon_ui_Link.r,{to:"https://posthog.com/docs/data/sessions#server-sdks-and-sessions",children:"documentation for using Sessions with server-side SDKs"})]}):(0,jsx_runtime.jsxs)("p",{children:["Please see"," ",(0,jsx_runtime.jsx)(lemon_ui_Link.r,{to:"https://posthog.com/docs/libraries/js",children:"documentation for how to set up posthog-js"}),"."]})]}):statusCheck.isSendingPageLeaves?null:(0,jsx_runtime.jsxs)(LemonBanner.V,{type:"warning",className:"mt-2",children:[(0,jsx_runtime.jsxs)("p",{children:["No ",(0,jsx_runtime.jsx)("code",{children:"$pageleave"})," events have been received, this means that Bounce rate and Session duration might be inaccurate."]}),(0,jsx_runtime.jsxs)("p",{children:["Please see"," ",(0,jsx_runtime.jsx)(lemon_ui_Link.r,{to:"https://posthog.com/docs/libraries/js",children:"documentation for how to set up posthog-js"}),"."]})]}):(0,jsx_runtime.jsxs)(LemonBanner.V,{type:"warning",className:"mt-2",children:[(0,jsx_runtime.jsxs)("p",{children:["No ",(0,jsx_runtime.jsx)("code",{children:"$pageview"})," ",statusCheck.isSendingPageLeaves?null:(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:["or ",(0,jsx_runtime.jsx)("code",{children:"$pageleave"})," "]}),"events have been received. Web analytics won't work correctly (it'll be a little empty!)"]}),(0,jsx_runtime.jsxs)("p",{children:["Please see"," ",(0,jsx_runtime.jsx)(lemon_ui_Link.r,{to:"https://posthog.com/docs/libraries/js",children:"documentation for how to set up posthog-js"}),"."]})]}):null};var LemonModal=__webpack_require__("./frontend/src/lib/lemon-ui/LemonModal/index.ts"),PropertyFilters=__webpack_require__("./frontend/src/lib/components/PropertyFilters/PropertyFilters.tsx"),PropertyFilters_utils=__webpack_require__("./frontend/src/lib/components/PropertyFilters/utils.ts"),TaxonomicFilter_types=__webpack_require__("./frontend/src/lib/components/TaxonomicFilter/types.ts");let WebPropertyFilters=_ref=>{let{webAnalyticsFilters,setWebAnalyticsFilters}=_ref;return(0,jsx_runtime.jsx)(PropertyFilters.t,{taxonomicGroupTypes:[TaxonomicFilter_types.t.EventProperties,TaxonomicFilter_types.t.PersonProperties,TaxonomicFilter_types.t.SessionProperties],onChange:filters=>setWebAnalyticsFilters(filters.filter(PropertyFilters_utils.WO)),propertyFilters:webAnalyticsFilters,pageKey:"web-analytics",eventNames:["$pageview"]})},WebAnalyticsModal=()=>{let{modal,dateFilter:{dateFrom,dateTo},webAnalyticsFilters}=(0,index_esm.useValues)(webAnalyticsLogic),{closeModal,setDates,setWebAnalyticsFilters}=(0,index_esm.useActions)(webAnalyticsLogic);return modal?(0,jsx_runtime.jsx)(LemonModal.f,{isOpen:!!modal,onClose:closeModal,simple:!1,title:modal?.title||"",width:1600,fullScreen:!1,closable:!0,children:(0,jsx_runtime.jsxs)("div",{className:"WebAnalyticsModal space-y-4",children:[(0,jsx_runtime.jsxs)("div",{className:"flex flex-row flex-wrap gap-2",children:[(0,jsx_runtime.jsx)(WebPropertyFilters,{setWebAnalyticsFilters:setWebAnalyticsFilters,webAnalyticsFilters:webAnalyticsFilters}),(0,jsx_runtime.jsx)(DateFilter.f,{dateFrom:dateFrom,dateTo:dateTo,onChange:setDates})]}),(0,jsx_runtime.jsx)(LemonModal.f.Content,{embedded:!0,children:(0,jsx_runtime.jsx)(WebQuery,{query:modal.query,insightProps:modal.insightProps,showIntervalSelect:modal.showIntervalSelect,control:modal.control})}),(0,jsx_runtime.jsx)("div",{className:"flex flex-row justify-end",children:modal.canOpenInsight?(0,jsx_runtime.jsx)(LemonButton.J,{to:urls.j.insightNew(void 0,void 0,modal.query),icon:(0,jsx_runtime.jsx)(icons.pF,{}),size:"small",type:"secondary",children:"Open as new Insight"}):null})]})}):null};var TaxonomicPopover=__webpack_require__("./frontend/src/lib/components/TaxonomicPopover/TaxonomicPopover.tsx");let WebConversionGoal=()=>{let{conversionGoal}=(0,index_esm.useValues)(webAnalyticsLogic),{setConversionGoal}=(0,index_esm.useActions)(webAnalyticsLogic),{actions}=(0,index_esm.useValues)(actionsModel.D),[group,setGroup]=(0,react.useState)(TaxonomicFilter_types.t.CustomEvents),value=conversionGoal&&"actionId"in conversionGoal?conversionGoal.actionId:conversionGoal?.customEventName;return(0,jsx_runtime.jsx)(TaxonomicPopover.b,{groupType:group,"data-attr":"web-analytics-conversion-filter",value:value,onChange:(changedValue,groupType)=>{groupType===TaxonomicFilter_types.t.Actions&&"number"==typeof changedValue?(setConversionGoal({actionId:changedValue}),setGroup(TaxonomicFilter_types.t.Actions)):groupType===TaxonomicFilter_types.t.CustomEvents&&"string"==typeof changedValue&&changedValue?(setConversionGoal({customEventName:changedValue}),setGroup(TaxonomicFilter_types.t.CustomEvents)):setConversionGoal(null)},renderValue:()=>{if(!conversionGoal)return null;if("actionId"in conversionGoal){var _conversionGoalAction;let conversionGoalAction=actions.find(a=>a.id===conversionGoal.actionId);return(0,jsx_runtime.jsx)("span",{className:"text-overflow max-w-full",children:null!==(_conversionGoalAction=conversionGoalAction?.name)&&void 0!==_conversionGoalAction?_conversionGoalAction:"Conversion goal"})}return(0,jsx_runtime.jsx)("span",{className:"text-overflow max-w-full",children:conversionGoal?.customEventName})},groupTypes:[TaxonomicFilter_types.t.CustomEvents,TaxonomicFilter_types.t.Actions],placeholder:"Add conversion goal",placeholderClass:"",allowClear:!0,size:"small"})};var navigationLogic=__webpack_require__("./frontend/src/layout/navigation/navigationLogic.ts"),dataNodeCollectionLogic=__webpack_require__("./frontend/src/queries/nodes/DataNode/dataNodeCollectionLogic.ts"),Reload=__webpack_require__("./frontend/src/queries/nodes/DataNode/Reload.tsx"),apiHost=__webpack_require__("./frontend/src/lib/utils/apiHost.ts");let liveEventsTableLogic=(0,index_esm.kea)([(0,index_esm.path)(["scenes","activity","live-events","liveEventsTableLogic"]),(0,index_esm.connect)({values:[teamLogic.H,["currentTeam"],featureFlagLogic.h,["featureFlags"]]}),(0,index_esm.actions)(()=>({pollStats:!0,setLiveUserCount:_ref=>{let{liveUserCount,now}=_ref;return{liveUserCount,now}},setNow:_ref2=>{let{now}=_ref2;return{now}}})),(0,index_esm.reducers)({liveUserCount:[null,{setLiveUserCount:(_,_ref3)=>{let{liveUserCount}=_ref3;return liveUserCount}}],statsUpdatedTime:[null,{setLiveUserCount:(_,_ref4)=>{let{now}=_ref4;return now}}],now:[null,{setNow:(_,_ref5)=>{let{now}=_ref5;return now},setLiveUserCount:(_,_ref6)=>{let{now}=_ref6;return now}}]}),(0,index_esm.selectors)({liveUserUpdatedSecondsAgo:[s=>[s.statsUpdatedTime,s.now],(statsUpdatedTime,now)=>{if(!statsUpdatedTime||!now)return null;let seconds=Math.ceil((now.getTime()-statsUpdatedTime.getTime())/1e3);return seconds<0||seconds>=300?null:seconds}]}),(0,index_esm.listeners)(_ref7=>{let{actions,values}=_ref7;return{pollStats:async()=>{try{if(!values.currentTeam)return;let response=await fetch(`${(0,apiHost.K)()}/stats`,{headers:{Authorization:`Bearer ${values.currentTeam.live_events_token}`}}),data=await response.json(),liveUserCount=data.users_on_product||0;actions.setLiveUserCount({liveUserCount,now:new Date})}catch(error){console.error("Failed to poll stats:",error)}}}}),(0,index_esm.events)(_ref8=>{let{actions,cache}=_ref8;return{afterMount:()=>{actions.setNow({now:new Date}),actions.pollStats(),cache.statsInterval=setInterval(()=>{actions.pollStats()},3e4),cache.nowInterval=setInterval(()=>{actions.setNow({now:new Date})},500)},beforeUnmount:()=>{cache.statsInterval&&(clearInterval(cache.statsInterval),cache.statsInterval=null)}}})]),WebAnalyticsLiveUserCount=()=>{let{liveUserCount,liveUserUpdatedSecondsAgo}=(0,index_esm.useValues)(liveEventsTableLogic),{currentTeam}=(0,index_esm.useValues)(teamLogic.H);if(null==liveUserCount)return null;let usersOnlineString=`${(0,utils.Lc)(liveUserCount)} ${1===liveUserCount?"user is":"users are"} online`,inTeamString=currentTeam?` in ${currentTeam.name}`:"",updatedAgoString=0===liveUserUpdatedSecondsAgo?" (updated just now)":null==liveUserUpdatedSecondsAgo?"":` (updated ${liveUserUpdatedSecondsAgo} seconds ago)`,tooltip=`${usersOnlineString}${inTeamString}${updatedAgoString}`;return(0,jsx_runtime.jsxs)("div",{className:"flex-row",children:[(0,jsx_runtime.jsx)(Tooltip.u,{title:tooltip,children:(0,jsx_runtime.jsxs)("span",{children:[(0,jsx_runtime.jsx)(posthog_icons_es.IconLive,{})," ",(0,jsx_runtime.jsx)("strong",{children:(0,utils.d$)(liveUserCount)})," currently online"]})}),(0,jsx_runtime.jsx)("div",{className:"bg-border h-px w-full mt-2"})]})},Filters=()=>{let{webAnalyticsFilters,dateFilter:{dateTo,dateFrom},compareFilter}=(0,index_esm.useValues)(webAnalyticsLogic),{setWebAnalyticsFilters,setDates,setCompareFilter}=(0,index_esm.useActions)(webAnalyticsLogic),{mobileLayout}=(0,index_esm.useValues)(navigationLogic.f),{featureFlags}=(0,index_esm.useValues)(featureFlagLogic.h);return(0,jsx_runtime.jsxs)("div",{className:(0,clsx_m.default)("sticky z-20 pt-2 bg-bg-3000",mobileLayout?"top-[var(--breadcrumbs-height-full)]":"top-[var(--breadcrumbs-height-compact)]"),children:[(0,jsx_runtime.jsxs)("div",{className:"flex flex-row flex-wrap gap-2",children:[(0,jsx_runtime.jsx)(DateFilter.f,{dateFrom:dateFrom,dateTo:dateTo,onChange:setDates}),featureFlags[constants.y8.WEB_ANALYTICS_PERIOD_COMPARISON]?(0,jsx_runtime.jsx)(CompareFilter.m,{compareFilter:compareFilter,updateCompareFilter:setCompareFilter}):null,(0,jsx_runtime.jsx)(WebPropertyFilters,{setWebAnalyticsFilters:setWebAnalyticsFilters,webAnalyticsFilters:webAnalyticsFilters}),(0,jsx_runtime.jsx)(WebConversionGoal,{}),(0,jsx_runtime.jsx)(Reload.H,{})]}),(0,jsx_runtime.jsx)("div",{className:"bg-border h-px w-full mt-2"})]})},Tiles=()=>{let{tiles}=(0,index_esm.useValues)(webAnalyticsLogic);return(0,jsx_runtime.jsx)("div",{className:"mt-2 grid grid-cols-1 md:grid-cols-2 xxl:grid-cols-3 gap-x-4 gap-y-12",children:tiles.map((tile,i)=>"query"===tile.kind?(0,jsx_runtime.jsx)(QueryTileItem,{tile:tile},i):"tabs"===tile.kind?(0,jsx_runtime.jsx)(TabsTileItem,{tile:tile},i):"replay"===tile.kind?(0,jsx_runtime.jsx)(WebAnalyticsRecordingsTile,{tile:tile},i):"error_tracking"===tile.kind?(0,jsx_runtime.jsx)(WebAnalyticsErrorTrackingTile,{tile:tile},i):null)})},QueryTileItem=_ref=>{var _layout$colSpanClassN,_layout$rowSpanClassN,_layout$orderWhenLarg;let{tile}=_ref,{query,title,layout,insightProps,control,showIntervalSelect,docs}=tile,{openModal}=(0,index_esm.useActions)(webAnalyticsLogic),{getNewInsightUrl}=(0,index_esm.useValues)(webAnalyticsLogic),buttonsRow=[tile.canOpenInsight?(0,jsx_runtime.jsx)(LemonButton.J,{to:getNewInsightUrl(tile.tileId),icon:(0,jsx_runtime.jsx)(icons.pF,{}),size:"small",type:"secondary",children:"Open as new Insight"},"open-insight-button"):null,tile.canOpenModal?(0,jsx_runtime.jsx)(LemonButton.J,{onClick:()=>openModal(tile.tileId),icon:(0,jsx_runtime.jsx)(posthog_icons_es.IconExpand45,{}),size:"small",type:"secondary",children:"Show more"},"open-modal-button"):null].filter(utils.DX);return(0,jsx_runtime.jsxs)("div",{className:(0,clsx_m.default)("col-span-1 row-span-1 flex flex-col",null!==(_layout$colSpanClassN=layout.colSpanClassName)&&void 0!==_layout$colSpanClassN?_layout$colSpanClassN:"md:col-span-6",null!==(_layout$rowSpanClassN=layout.rowSpanClassName)&&void 0!==_layout$rowSpanClassN?_layout$rowSpanClassN:"md:row-span-1",null!==(_layout$orderWhenLarg=layout.orderWhenLargeClassName)&&void 0!==_layout$orderWhenLarg?_layout$orderWhenLarg:"xxl:order-12",layout.className),children:[title&&(0,jsx_runtime.jsxs)("h2",{className:"flex-1 m-0 flex flex-row ml-1",children:[title,docs&&(0,jsx_runtime.jsx)(LearnMorePopover,{url:docs.url,title:docs.title,description:docs.description})]}),(0,jsx_runtime.jsx)(WebQuery,{query:query,insightProps:insightProps,control:control,showIntervalSelect:showIntervalSelect}),buttonsRow.length>0?(0,jsx_runtime.jsx)("div",{className:"flex justify-end my-2 space-x-2",children:buttonsRow}):null]})},TabsTileItem=_ref2=>{let{tile}=_ref2,{layout}=tile,{openModal}=(0,index_esm.useActions)(webAnalyticsLogic),{getNewInsightUrl}=(0,index_esm.useValues)(webAnalyticsLogic);return(0,jsx_runtime.jsx)(WebTabs,{className:(0,clsx_m.default)("col-span-1 row-span-1",layout.colSpanClassName||"md:col-span-1",layout.rowSpanClassName||"md:row-span-1",layout.orderWhenLargeClassName||"xxl:order-12",layout.className),activeTabId:tile.activeTabId,setActiveTabId:tile.setTabId,tabs:tile.tabs.map(tab=>({id:tab.id,content:(0,jsx_runtime.jsx)(WebQuery,{query:tab.query,showIntervalSelect:tab.showIntervalSelect,control:tab.control,insightProps:tab.insightProps},tab.id),linkText:tab.linkText,title:tab.title,canOpenModal:!!tab.canOpenModal,canOpenInsight:!!tab.canOpenInsight,query:tab.query,docs:tab.docs})),tileId:tile.tileId,openModal:openModal,getNewInsightUrl:getNewInsightUrl})},WebTabs=_ref3=>{let{className,activeTabId,tabs,setActiveTabId,openModal,getNewInsightUrl,tileId}=_ref3,activeTab=tabs.find(t=>t.id===activeTabId),newInsightUrl=getNewInsightUrl(tileId,activeTabId),buttonsRow=[activeTab?.canOpenInsight&&newInsightUrl?(0,jsx_runtime.jsx)(LemonButton.J,{to:newInsightUrl,icon:(0,jsx_runtime.jsx)(icons.pF,{}),size:"small",type:"secondary",children:"Open as new Insight"},"open-insight-button"):null,activeTab?.canOpenModal?(0,jsx_runtime.jsx)(LemonButton.J,{onClick:()=>openModal(tileId,activeTabId),icon:(0,jsx_runtime.jsx)(posthog_icons_es.IconExpand45,{}),size:"small",type:"secondary",children:"Show more"},"open-modal-button"):null].filter(utils.DX);return(0,jsx_runtime.jsxs)("div",{className:(0,clsx_m.default)(className,"flex flex-col"),children:[(0,jsx_runtime.jsxs)("div",{className:"flex flex-row items-center self-stretch mb-3",children:[(0,jsx_runtime.jsxs)("h2",{className:"flex-1 m-0 flex flex-row ml-1",children:[activeTab?.title,activeTab?.docs&&(0,jsx_runtime.jsx)(LearnMorePopover,{url:activeTab.docs.url,title:activeTab.docs.title,description:activeTab.docs.description})]}),(0,jsx_runtime.jsx)(LemonSegmentedSelect.S,{shrinkOn:7,size:"small",disabled:!1,value:activeTabId,dropdownMatchSelectWidth:!1,onChange:setActiveTabId,options:tabs.map(_ref4=>{let{id,linkText}=_ref4;return{value:id,label:linkText}})})]}),(0,jsx_runtime.jsx)("div",{className:"flex-1 flex flex-col",children:activeTab?.content}),buttonsRow.length>0?(0,jsx_runtime.jsx)("div",{className:"flex justify-end my-2 space-x-2",children:buttonsRow}):null]})},LearnMorePopover=_ref5=>{let{url,title,description}=_ref5,[isOpen,setIsOpen]=(0,react.useState)(!1);return(0,jsx_runtime.jsx)(Popover.J2,{visible:isOpen,onClickOutside:()=>setIsOpen(!1),overlay:(0,jsx_runtime.jsxs)("div",{className:"p-4",children:[(0,jsx_runtime.jsxs)("div",{className:"flex flex-row w-full",children:[(0,jsx_runtime.jsx)("h2",{className:"flex-1",children:title}),(0,jsx_runtime.jsx)(LemonButton.J,{targetBlank:!0,type:"tertiary",onClick:()=>setIsOpen(!1),size:"small",icon:(0,jsx_runtime.jsx)(posthog_icons_es.IconX,{})})]}),(0,jsx_runtime.jsx)("div",{className:"text-sm text-gray-700",children:description}),url&&(0,jsx_runtime.jsx)("div",{className:"flex justify-end mt-4",children:(0,jsx_runtime.jsx)(LemonButton.J,{to:url,onClick:()=>setIsOpen(!1),targetBlank:!0,sideIcon:(0,jsx_runtime.jsx)(posthog_icons_es.IconOpenSidebar,{}),children:"Learn more"})})]}),children:(0,jsx_runtime.jsx)(LemonButton.J,{onClick:()=>setIsOpen(!isOpen),size:"small",icon:(0,jsx_runtime.jsx)(posthog_icons_es.IconInfo,{}),className:"ml-1 mb-1"})})},WebAnalyticsDashboard=()=>(0,jsx_runtime.jsx)(index_esm.BindLogic,{logic:webAnalyticsLogic,props:{},children:(0,jsx_runtime.jsxs)(index_esm.BindLogic,{logic:dataNodeCollectionLogic.y,props:{key:WEB_ANALYTICS_DATA_COLLECTION_NODE_ID},children:[(0,jsx_runtime.jsx)(WebAnalyticsModal,{}),(0,jsx_runtime.jsx)(VersionCheckerBanner.o,{}),(0,jsx_runtime.jsxs)("div",{className:"WebAnalyticsDashboard w-full flex flex-col",children:[(0,jsx_runtime.jsx)(WebAnalyticsLiveUserCount,{}),(0,jsx_runtime.jsx)(Filters,{}),(0,jsx_runtime.jsx)(WebAnalyticsHealthCheck,{}),(0,jsx_runtime.jsx)(Tiles,{})]})]})});function WebAnalyticsScene(){return(0,jsx_runtime.jsxs)(jsx_runtime.Fragment,{children:[(0,jsx_runtime.jsx)(PageHeader.m,{buttons:(0,jsx_runtime.jsx)(WebAnalyticsMenu,{})}),(0,jsx_runtime.jsx)(WebAnalyticsDashboard,{})]})}let scene={component:WebAnalyticsScene,logic:webAnalyticsLogic}},"./node_modules/.pnpm/css-loader@3.6.0_webpack@5.88.2/node_modules/css-loader/dist/cjs.js!./node_modules/.pnpm/postcss-loader@4.3.0_postcss@8.4.31_webpack@5.88.2/node_modules/postcss-loader/dist/cjs.js!./node_modules/.pnpm/sass-loader@10.3.1_sass@1.56.0_webpack@5.88.2/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./frontend/src/lib/components/CompactList/CompactList.scss":(module,exports,__webpack_require__)=>{(exports=__webpack_require__("./node_modules/.pnpm/css-loader@3.6.0_webpack@5.88.2/node_modules/css-loader/dist/runtime/api.js")(!1)).push([module.id,".CompactList{background:var(--bg-light);border:1px solid var(--border);border-radius:var(--radius);box-sizing:initial;display:flex;flex:1;flex-direction:column;overflow:hidden}.CompactList .CompactList__header{align-items:center;display:flex;justify-content:space-between;padding:.5rem}.CompactList .CompactList__header h3{font-size:.9rem;font-weight:600;line-height:1.4;margin-bottom:0}.CompactList .CompactList__content{height:16rem;overflow-y:auto;padding:.5rem}.CompactList .LemonButton{font-family:var(--font-sans)!important}",""]),module.exports=exports},"./node_modules/.pnpm/css-loader@3.6.0_webpack@5.88.2/node_modules/css-loader/dist/cjs.js!./node_modules/.pnpm/postcss-loader@4.3.0_postcss@8.4.31_webpack@5.88.2/node_modules/postcss-loader/dist/cjs.js!./node_modules/.pnpm/sass-loader@10.3.1_sass@1.56.0_webpack@5.88.2/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./frontend/src/scenes/project-homepage/ProjectHomepage.scss":(module,exports,__webpack_require__)=>{(exports=__webpack_require__("./node_modules/.pnpm/css-loader@3.6.0_webpack@5.88.2/node_modules/css-loader/dist/runtime/api.js")(!1)).push([module.id,".ProjectHomepage{container-type:inline-size}.ProjectHomepage .ProjectHomepage__dashboardheader{align-items:center;display:flex;justify-content:space-between;margin-top:1rem}.ProjectHomepage .ProjectHomepage__dashboardheader .ProjectHomepage__dashboardheader__title{align-items:center;display:flex;flex-direction:row}.ProjectHomepage .ProjectHomepage__dashboardheader .ProjectHomepage__dashboardheader__title a{color:var(--text-3000)}.ProjectHomepage .ProjectHomepage__dashboardheader .ProjectHomepage__dashboardheader__title a:hover{color:var(--primary-3000)}.ProjectHomepage .ProjectHomepage__lists{display:flex;gap:1rem}@container (max-width: 800px){.ProjectHomepage .ProjectHomepage__lists{flex-direction:column}}.ProjectHomepage .empty-state-container{align-items:center;background-color:var(--bg-3000);display:flex;flex-direction:column;justify-content:center;padding:4rem;width:100%}",""]),module.exports=exports},"./frontend/src/scenes/project-homepage/ProjectHomepage.scss":(__unused_webpack_module,__unused_webpack___webpack_exports__,__webpack_require__)=>{"use strict";var _node_modules_pnpm_style_loader_2_0_0_webpack_5_88_2_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__("./node_modules/.pnpm/style-loader@2.0.0_webpack@5.88.2/node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js"),_node_modules_pnpm_style_loader_2_0_0_webpack_5_88_2_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(_node_modules_pnpm_style_loader_2_0_0_webpack_5_88_2_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0__),_node_modules_pnpm_css_loader_3_6_0_webpack_5_88_2_node_modules_css_loader_dist_cjs_js_node_modules_pnpm_postcss_loader_4_3_0_postcss_8_4_31_webpack_5_88_2_node_modules_postcss_loader_dist_cjs_js_node_modules_pnpm_sass_loader_10_3_1_sass_1_56_0_webpack_5_88_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_ProjectHomepage_scss__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__("./node_modules/.pnpm/css-loader@3.6.0_webpack@5.88.2/node_modules/css-loader/dist/cjs.js!./node_modules/.pnpm/postcss-loader@4.3.0_postcss@8.4.31_webpack@5.88.2/node_modules/postcss-loader/dist/cjs.js!./node_modules/.pnpm/sass-loader@10.3.1_sass@1.56.0_webpack@5.88.2/node_modules/sass-loader/dist/cjs.js??ruleSet[1].rules[2].use[3]!./frontend/src/scenes/project-homepage/ProjectHomepage.scss"),_node_modules_pnpm_css_loader_3_6_0_webpack_5_88_2_node_modules_css_loader_dist_cjs_js_node_modules_pnpm_postcss_loader_4_3_0_postcss_8_4_31_webpack_5_88_2_node_modules_postcss_loader_dist_cjs_js_node_modules_pnpm_sass_loader_10_3_1_sass_1_56_0_webpack_5_88_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_ProjectHomepage_scss__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(_node_modules_pnpm_css_loader_3_6_0_webpack_5_88_2_node_modules_css_loader_dist_cjs_js_node_modules_pnpm_postcss_loader_4_3_0_postcss_8_4_31_webpack_5_88_2_node_modules_postcss_loader_dist_cjs_js_node_modules_pnpm_sass_loader_10_3_1_sass_1_56_0_webpack_5_88_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_ProjectHomepage_scss__WEBPACK_IMPORTED_MODULE_1__),options={};options.insert="head",options.singleton=!1,_node_modules_pnpm_style_loader_2_0_0_webpack_5_88_2_node_modules_style_loader_dist_runtime_injectStylesIntoStyleTag_js__WEBPACK_IMPORTED_MODULE_0___default()(_node_modules_pnpm_css_loader_3_6_0_webpack_5_88_2_node_modules_css_loader_dist_cjs_js_node_modules_pnpm_postcss_loader_4_3_0_postcss_8_4_31_webpack_5_88_2_node_modules_postcss_loader_dist_cjs_js_node_modules_pnpm_sass_loader_10_3_1_sass_1_56_0_webpack_5_88_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_ProjectHomepage_scss__WEBPACK_IMPORTED_MODULE_1___default(),options),_node_modules_pnpm_css_loader_3_6_0_webpack_5_88_2_node_modules_css_loader_dist_cjs_js_node_modules_pnpm_postcss_loader_4_3_0_postcss_8_4_31_webpack_5_88_2_node_modules_postcss_loader_dist_cjs_js_node_modules_pnpm_sass_loader_10_3_1_sass_1_56_0_webpack_5_88_2_node_modules_sass_loader_dist_cjs_js_ruleSet_1_rules_2_use_3_ProjectHomepage_scss__WEBPACK_IMPORTED_MODULE_1___default().locals}}]); \ No newline at end of file diff --git a/docs/iframe.html b/docs/iframe.html index 9d66ed66c..7cf82f1b3 100644 --- a/docs/iframe.html +++ b/docs/iframe.html @@ -348,7 +348,7 @@ window['DOCS_OPTIONS'] = {"defaultName":"Docs","autodocs":"tag"};