{#if isLoaded}
{#each allList as item} changeWatchList(item)} class="text-sm sm:text-[1rem] {item?.id === displayWatchList?.id ? 'bg-gray-200 dark:bg-primary' : ''} cursor-pointer sm:hover:bg-gray-200 dark:sm:hover:bg-primary" > {item?.title} ({item?.ticker?.length}) {/each}
{#if editMode} {/if}
{#if inputValue?.length > 0} {#each searchBarData as item} handleAddTicker(e, item?.symbol)} >
{item?.symbol} {item?.name}
{:else} No results found {/each} {:else} No results found {/if}
{#if searchQuery?.length > 0} {/if}
{#each searchQuery?.length !== 0 ? testList : allRows as item}
{#if defaultRules?.includes(item?.rule)} {:else if ["Pro", "Plus"]?.includes(data?.user?.tier) || excludedRules?.has(item?.rule)} {:else} {item?.name} {/if}
{/each}
{data?.user?.credits} Credits left {#each bulkData as item} {/each}
= Credit Cost {totalCreditCost}
{#if allList.length === 0}
Empty Watchlist Fill it up with your favorite stocks and get realtime data and the latest news in one place! {#if !data?.user} Get Started {/if}
{:else} {#if watchList?.length !== 0}

{watchList?.length} Stocks

{#each watchList as item} {#each ruleOfList as row} {#if isChecked(row?.name)} {/if} {/each} {/each}
handleFilter(item?.symbol)} class="text-blue-700 dark:text-blue-400 text-sm sm:text-[1rem] whitespace-nowrap text-start flex flex-row items-center" > {#if editMode} {:else} {/if} {item?.name?.length > charNumber ? item?.name?.slice(0, charNumber) + "..." : item?.name} {#if item?.[row?.rule] !== undefined && item?.[row?.rule] !== null} {#if row?.type === "int"} {@html abbreviateNumber( item[row?.rule], false, true, )} {:else if row?.type === "str"} {item[row?.rule] !== null ? item[row?.rule] : "n/a"} {:else if row?.type === "float"}
{#if item?.previous !== null && item?.previous !== undefined && Math.abs(item?.previous - item[row?.rule]) >= 0.01 && row?.rule === "price"} {/if} {item[row?.rule] !== null ? item[row?.rule]?.toFixed(2) : "n/a"}
{:else if row?.type === "percent"} {item[row?.rule] !== null ? item[row?.rule]?.toFixed(2) + "%" : "n/a"} {:else if row?.type === "percentSign"} {#if item[row?.rule] >= 0} +{item[row?.rule]?.toFixed(2)}% {:else} {item[row?.rule]?.toFixed(2)}% {/if} {:else if row?.type === "rating"} {#if ["Strong Buy", "Buy"].includes(item[row?.rule])} {item[row?.rule]} {:else if ["Strong Sell", "Sell"].includes(item[row?.rule])} {item[row?.rule]} {:else if item[row?.rule] === "Hold"} {item[row?.rule]} {/if} {/if} {:else} n/a {/if}
{#each tabs as item, i} {#if !["Pro", "Plus"]?.includes(data?.user?.tier) && i > 0} {:else} {/if} {/each}
{#if activeIdx === 0} {#if groupedNews?.length > 0} {#each displayList as [date, titleGroups]}

{date}

{#each titleGroups as { title, items, symbols }}

{title}

{new Date( items[0].publishedDate, ).toLocaleTimeString("en-US", { hour: "2-digit", minute: "2-digit", hour12: true, })}
{items[0].site}
·
{#each symbols as symbol} {symbol} {/each}
{/each}
{/each} {:else} No news yet. Add some stocks to the watchlist to see the latest news. {/if} {:else if groupedEarnings?.length > 0} {#each displayList as [date, titleGroups]}

{date}

{#each titleGroups as item}
{removeCompanyStrings(item?.name)} () will report {#if item?.time} {#if compareTimes(item?.time, "16:00") >= 0} after market closes. {:else if compareTimes(item?.time, "09:30") <= 0} before market opens. {:else} during market. {/if} {/if} Analysts estimate {abbreviateNumber( item?.revenueEst, )} in revenue ({( (item?.revenueEst / item?.revenuePrior - 1) * 100 )?.toFixed(2)}% YoY) and {item?.epsEst} in earnings per share {#if item?.epsPrior !== 0} ({( (item?.epsEst / item?.epsPrior - 1) * 100 )?.toFixed(2)}% YoY). {/if}
{formatTime(item?.time)}
{/each}
{/each} {:else}
{/if}
{:else}
Empty Watchlist Fill it up with your favorite stocks and get realtime data and the latest news in one place!
{/if} {/if} {:else}
{/if}