<div class="fsc-rf">
    {{#if uiElementStates.compactView}}
        <div class="fsc-pj">
            {{#if compactViewDisplay.currentSeasonName }}
                <div class="fsc-o">
                    <div class="fsc-bl" data-tooltip="{{compactViewDisplay.currentSeasonName}}">{{{compactViewDisplay.currentSeasonIcon}}}</div>
                </div>
            {{/if}}
            <div class="fsc-da">
                {{#if (gt compactViewDisplay.selectedDayMoons.length 5)}}
                    <div class="fsc-xa">
                        <div class="fsc-wa {{compactViewDisplay.selectedDayMoons.0.phase.icon}}" data-tooltip="{{compactViewDisplay.selectedDayMoons.0.name}} - {{compactViewDisplay.selectedDayMoons.0.phase.name}}">{{{compactViewDisplay.selectedDayMoons.0.iconSVG}}}</div>
                        <span class="fsc-wa fa fa-caret-down"></span>
                        <div class="fsc-ya">
                            {{#each compactViewDisplay.selectedDayMoons}}
                                <div class="fsc-wa {{phase.icon}}" data-tooltip="{{name}} - {{phase.name}}">{{{iconSVG}}}</div>
                            {{/each}}
                        </div>
                    </div>
                {{else}}
                    {{#each compactViewDisplay.selectedDayMoons}}
                        <div class="fsc-wa {{phase.icon}}" data-tooltip="{{name}} - {{phase.name}}">{{{iconSVG}}}</div>
                    {{/each}}
                {{/if}}
            </div>
        </div>
        <div class="fsc-qj">
            <div class="fsc-rj">
                <button class="fsc-yb {{#if (gt calendar.selectedDay.noteCount 0)}} fsc-dc{{else}} fsc-lf{{/if}} fsc-bg" data-tooltip="{{localize 'FSC.Configuration.General.Notes'}}"><span class="fa-solid fa-note-sticky"></span>&nbsp;{{calendar.selectedDay.noteCount}}</button>
                {{#if (gt calendar.selectedDay.noteReminderCount 0)}}
                    <button class="fsc-yb fsc-mi fsc-cg" data-tooltip="{{localize 'FSC.Configuration.General.Notes'}}"><span class="fa fa-bell"></span>&nbsp;{{calendar.selectedDay.noteReminderCount}}</button>
                {{/if}}
                {{#if addNotes}}
                    <button class="fsc-yb fsc-uc fsc-ag" data-tooltip="{{localize 'FSC.Notes.AddNew'}}"><span class="fa-solid fa-note-sticky"></span>&nbsp;<span class="fa fa-plus"></span></button>
                {{/if}}
            </div>
        </div>
        <div class="fsc-sf">
            <div class="fsc-tf">
                <div class="fsc-uf">{{calendar.selectedDay.dateDisplay}}</div>
            </div>
        </div>
        {{#if showClock}}
        <div class="fsc-sf">
            <div class="fsc-vf">
                {{sc-clock id=calendar.clockDisplayId calendarId=calendar.id theme='none'}}
                {{#if changeDateTime}}
                    {{#if showTimeControls}}
                        {{#if isPrimary}}
                            <div class="fsc-gj">
                                <button class="fsc-yb fsc-fg {{#if (eq clockClass 'started')}} fsc-dc{{else}} fsc-uc{{/if}}" data-tooltip="{{localize 'FSC.Time.Start'}}"><span class="fa {{#if (eq clockClass 'started')}} fa-pause{{else}} fa-play{{/if}}"></span></button>
                                <button class="fsc-yb fsc-gg {{#if (eq clockClass 'stopped')}} fsc-lf{{else}} fsc-ic{{/if}}" data-tooltip="{{localize 'FSC.Time.Stop'}}"><span class="fa fa-stop"></span></button>
                            </div>

                        {{else if uiElementStates.primaryCheckRunning}}
                            <div class="fsc-hj"><span class="fas fa-spinner fa-spin"></span></div>
                        {{/if}}
                    {{/if}}
                {{/if}}
            </div>
        </div>
        {{/if}}
        {{#if changeDateTime}}
            <div class="fsc-sf">
                {{sc-date-time-controls showDateControls=showDateControls showTimeControls=showTimeControls displayType=compactViewDisplay.dateTimeControlDisplay fullDisplay=dateTimeFullDisplay largeSteps=uiElementStates.cvLargerSteps reverseTime=uiElementStates.cvReverseTime }}
            </div>
        {{/if}}
        <div class="fsc-sf">
            <div class="fsc-of fsc-jf {{sideDrawerDirection}} {{#if uiElementStates.fsc-jf}} fsc-c{{else}} fsc-d{{/if}}">
                <h2>{{localize 'FSC.Notes.For'}} {{calendar.selectedDay.dateDisplay}}</h2>
                {{#if calendar.selectedDay.notes.length}}
                    <div class="fsc-jf">
                        {{#each calendar.selectedDay.notes}}
                            <div class="fsc-jg" data-index="{{entryId}}" draggable="{{#if ../reorderNotes}}true{{else}}false{{/if}}">
                                <div class="fsc-dk">
                                    <h3 class="fsc-kh">{{title}}</h3>
                                    <div class="fsc-ek">
                                        {{#if ../isGM}}
                                            <div class="fsc-ck fsc-fk {{playerVisible.color}}" data-tooltip="{{playerVisible.players}}">
                                                <span class="fa {{playerVisible.icon}}"></span>
                                            </div>
                                        {{/if}}
                                        {{#if userReminderRegistered}}
                                            <div class="fsc-ck fsc-fk fsc-ch" data-tooltip="{{localize 'FSC.Notes.ReminderHelp'}}">
                                                <span class="fa fa-bell"></span>
                                            </div>
                                        {{/if}}
                                        {{#if (and canEdit (ne 'none' macro))}}
                                            <div class="fsc-ck fsc-fk" data-tooltip="{{localize 'DOCUMENT.Macro'}}">
                                                <span class="fas fa-scroll"></span>
                                            </div>
                                        {{/if}}
                                        <div class="fsc-cl fsc-ck" data-tooltip="{{localize 'FSC.Notes.Time'}}">
                                            <span class="fa fa-clock"></span>  {{#if allDay}}{{localize 'FSC.AllDay'}}{{else}}{{displayDate}}{{/if}}
                                        </div>
                                        {{#if authorDisplay}}
                                            <div class="fsc-ck" data-tooltip="{{localize 'FSC.Notes.Author'}}" style="background-color:{{authorDisplay.color}};color:{{authorDisplay.textColor}};">
                                                <span class="fa fa-pencil-alt"></span> {{authorDisplay.name}}
                                            </div>
                                        {{/if}}
                                        {{#each categories}}
                                            <div class="fsc-ck" style="background-color:{{color}};color:{{textColor}};">
                                                {{name}}
                                            </div>
                                        {{/each}}
                                    </div>
                                </div>
                                {{#if ../reorderNotes}}
                                    <div class="fsc-gk"><span class="fa fa-arrows-alt-v"></span></div>
                                {{/if}}
                            </div>
                        {{/each}}
                    </div>
                {{else}}
                    <em>{{localize 'FSC.Notes.Empty'}}</em>
                {{/if}}
            </div>
            <div class="fsc-ha {{sideDrawerDirection}} fsc-ia" data-id="">
                <div class="fsc-ka">
                    <div class="fsc-ta" data-action="remind"></div>
                    {{#if isGM}}
                        <div class="fsc-ta" data-action="showPlayers"><span class="fa fa-eye"></span>{{localize 'JOURNAL.ActionShow'}}</div>
                    {{/if}}
                    <div class="fsc-sa"></div>
                    <div class="fsc-ta" data-action="edit"><span class="fa fa-pen-to-square"></span>{{localize 'FSC.Edit'}}</div>
                    <div class="fsc-ta" data-action="delete"><span class="fa fa-trash"></span>{{localize 'FSC.Delete'}}</div>
                </div>
            </div>
        </div>

    {{else}}
        {{#unless (eq '' message)}}
            <div class="fsc-wj fsc-xj">{{{message}}}</div>
        {{/unless}}
        <div class="fsc-sf">
            <div class="fsc-hg">
                {{sc-full-calendar id=calendar.calendarDisplayId calendarId=calendar.id theme='none' date=calendar.visibleDate}}
            </div>
            <div class="fsc-xf">
                {{#if (gt mainViewDisplay.calendarList.length 1)}}
                    <button class="fsc-yb fsc-zb fsc-yf" data-tooltip="{{localize 'FSC.Calendars'}}"><span class="fa fa-calendar"></span></button>
                {{/if}}
                <button class="fsc-yb {{#if (gt calendar.selectedDay.noteCount 0)}} fsc-dc{{else}} fsc-lf{{/if}} fsc-bg" data-tooltip="{{localize 'FSC.Configuration.General.Notes'}}"><span class="fa fa-sticky-note"></span>&nbsp;{{calendar.selectedDay.noteCount}}</button>
                {{#if (gt calendar.selectedDay.noteReminderCount 0)}}
                    <button class="fsc-yb fsc-mi fsc-cg" data-tooltip="{{localize 'FSC.Configuration.General.Notes'}}"><span class="fa fa-bell"></span>&nbsp;{{calendar.selectedDay.noteReminderCount}}</button>
                {{/if}}
                {{#if addNotes}}
                    <button class="fsc-yb fsc-uc fsc-ag" data-tooltip="{{localize 'FSC.Notes.AddNew'}}"><span class="fa fa-sticky-note"></span>&nbsp;<span class="fa fa-plus"></span></button>
                {{/if}}
                <button class="fsc-yb fsc-lf fsc-_f" data-tooltip="{{localize 'FSC.Search.Title'}}"><span class="fa fa-search "></span></button>
                {{{mainViewDisplay.addonButtons}}}
                <span class="fsc-jh"></span>
                {{#if changeDateTime}}
                    {{#if showSetCurrentDate}}
                        <button class="fsc-yb fsc-uc fsc-eg " data-tooltip="{{localize 'FSC.SetCurrentDate'}}"><span class="fa fa-calendar-check"></span></button>
                    {{/if}}
                {{/if}}
                <button class="fsc-yb fsc-lf fsc-dg" data-tooltip="{{localize 'FSC.Today'}}"><span class="fa fa-calendar-day"></span></button>
                <button class="fsc-yb fsc-lf fsc-zf" data-tooltip="{{localize 'FSC.Configure'}}"><span class="fa fa-cog"></span></button>
            </div>
            {{#if (gt mainViewDisplay.calendarList.length 1)}}
                <div class="fsc-of fsc-df {{sideDrawerDirection}} {{#if uiElementStates.fsc-df}} fsc-c{{else}} fsc-d{{/if}}">
                    <h2>{{localize 'FSC.Calendars'}}</h2>
                    {{#each mainViewDisplay.calendarList}}
                        <div class="fsc-hg {{#if (eq id ../activeCalendarId)}} fsc-sh{{/if}} {{#if (eq id ../calendar.id)}} fsc-jj{{/if}} {{#unless ../mainViewDisplay.showChangeCalendarControls}} fsc-ij{{/unless}}" data-calid="{{id}}">
                            <div class="fsc-kj">
                                <div class="fsc-lj">{{name}}</div>
                                <div class="fsc-mj">
                                    <div class="fa fa-calendar-day"></div>
                                    <div>{{date}}</div>
                                    <div>{{time}}</div>
                                    {{#if clockRunning}}
                                        <div class="fsc-nb fsc-b">{{sc-icon name='clock'}}</div>
                                    {{/if}}
                                </div>
                                {{#if ../mainViewDisplay.showChangeCalendarControls}}
                                    {{#unless (eq id ../activeCalendarId)}}
                                        <div class="fsc-ig">
                                            <button class="fsc-yb fsc-uc"><span class="fa fa-check"></span> {{localize 'FSC.MakeActive'}}</button>
                                        </div>
                                    {{/unless}}
                                {{/if}}
                            </div>
                        </div>
                    {{/each}}
                </div>
            {{/if}}
            <div class="fsc-of fsc-jf {{sideDrawerDirection}} {{#if uiElementStates.fsc-jf}} fsc-c{{else}} fsc-d{{/if}}">
                <h2>{{localize 'FSC.Notes.For'}} {{calendar.selectedDay.dateDisplay}}</h2>
                {{#if calendar.selectedDay.notes.length}}
                    <div class="fsc-jf">
                        {{#each calendar.selectedDay.notes}}
                            <div class="fsc-jg" data-index="{{entryId}}" draggable="{{#if ../reorderNotes}}true{{else}}false{{/if}}">
                                <div class="fsc-dk">
                                    <h3 class="fsc-kh">{{title}}</h3>
                                    <div class="fsc-ek">
                                        {{#if ../isGM}}
                                            <div class="fsc-ck fsc-fk {{playerVisible.color}}" data-tooltip="{{playerVisible.players}}">
                                                <span class="fa {{playerVisible.icon}}"></span>
                                            </div>
                                        {{/if}}
                                        {{#if userReminderRegistered}}
                                            <div class="fsc-ck fsc-fk fsc-ch" data-tooltip="{{localize 'FSC.Notes.ReminderHelp'}}">
                                                <span class="fa fa-bell"></span>
                                            </div>
                                        {{/if}}
                                        {{#if (and canEdit (ne 'none' macro))}}
                                            <div class="fsc-ck fsc-fk" data-tooltip="{{localize 'DOCUMENT.Macro'}}">
                                                <span class="fas fa-scroll"></span>
                                            </div>
                                        {{/if}}
                                        <div class="fsc-cl fsc-ck" data-tooltip="{{localize 'FSC.Notes.Time'}}">
                                            <span class="fa fa-clock"></span>  {{#if allDay}}{{localize 'FSC.AllDay'}}{{else}}{{displayDate}}{{/if}}
                                        </div>
                                        {{#if authorDisplay}}
                                            <div class="fsc-ck" data-tooltip="{{localize 'FSC.Notes.Author'}}" style="background-color:{{authorDisplay.color}};color:{{authorDisplay.textColor}};">
                                                <span class="fa fa-pencil-alt"></span> {{authorDisplay.name}}
                                            </div>
                                        {{/if}}
                                        {{#each categories}}
                                            <div class="fsc-ck" style="background-color:{{color}};color:{{textColor}};">
                                                {{name}}
                                            </div>
                                        {{/each}}
                                    </div>
                                </div>
                                {{#if ../reorderNotes}}
                                    <div class="fsc-gk"><span class="fa fa-arrows-alt-v"></span></div>
                                {{/if}}
                            </div>
                        {{/each}}
                    </div>
                {{else}}
                    <em>{{localize 'FSC.Notes.Empty'}}</em>
                {{/if}}
            </div>
            <div class="fsc-of fsc-kf {{sideDrawerDirection}} {{#if uiElementStates.fsc-kf}} fsc-c{{else}} fsc-d{{/if}}">
                <h2>{{localize 'FSC.SearchNotes'}}</h2>
                <div class="fsc-kg">
                    <input id="simpleCalendarSearchBox" type="text" value="{{mainViewDisplay.search.term}}" aria-label="{{localize 'FSC.SearchNotes'}}" />
                    {{#if mainViewDisplay.search.results.length}}
                        <button class="fsc-yb fsc-dl" data-tooltip="{{localize 'FSC.Clear'}}"><span class="fa fa-times"></span></button>
                    {{/if}}
                    <button class="fsc-yb"><span class="fa fa-search"></span></button>
                </div>
                <h3 class="fsc-lg">{{localize 'FSC.Search.Options.Title'}} <span class="fa fa-caret-down"></span></h3>
                <div class="fsc-og {{#if uiElementStates.searchOptionsOpen}} fsc-c{{else}} fsc-d{{/if}}">
                    <p><strong>Fields:</strong>Select which fields to search on a note.</p>
                    <div class="fsc-mg">
                        <label><input type="checkbox" data-field="date" {{checked mainViewDisplay.search.options.fields.date}}> {{localize 'FSC.Search.Options.Fields.Date'}}</label>
                        <label><input type="checkbox" data-field="title" {{checked mainViewDisplay.search.options.fields.title}}> {{localize 'FSC.Search.Options.Fields.Title'}}</label>
                        <label><input type="checkbox" data-field="details" {{checked mainViewDisplay.search.options.fields.details}}> {{localize 'FSC.Search.Options.Fields.Details'}}</label>
                        <label><input type="checkbox" data-field="author" {{checked mainViewDisplay.search.options.fields.author}}> {{localize 'Author'}}</label>
                        <label><input type="checkbox" data-field="categories" {{checked mainViewDisplay.search.options.fields.categories}}> {{localize 'FSC.Search.Options.Fields.Categories'}}</label>
                    </div>
                </div>
                <div class="fsc-jf">
                    {{#if mainViewDisplay.search.results.length}}
                        {{#each mainViewDisplay.search.results}}
                            <div class="fsc-jg" data-index="{{entryId}}">
                                <div class="fsc-dk">
                                    <h3 class="fsc-kh">{{title}}</h3>
                                    <div class="fsc-ek">
                                        {{#if ../isGM}}
                                            <div class="fsc-ck fsc-fk {{playerVisible.color}}" data-tooltip="{{playerVisible.players}}">
                                                <span class="fa {{playerVisible.icon}}"></span>
                                            </div>
                                        {{/if}}
                                        {{#if reminder}}
                                            <div class="fsc-ck fsc-fk fsc-ch" data-tooltip="{{localize 'FSC.Notes.ReminderHelp'}}">
                                                <span class="fa fa-bell"></span>
                                            </div>
                                        {{/if}}
                                        {{#if (and canEdit (ne 'none' macro))}}
                                            <div class="fsc-ck fsc-fk" data-tooltip="{{localize 'DOCUMENT.Macro'}}">
                                                <span class="fas fa-scroll"></span>
                                            </div>
                                        {{/if}}
                                        <div class="fsc-cl fsc-ck" data-tooltip="{{localize 'FSC.Notes.Time'}}">
                                            <span class="fa fa-clock"></span>  {{#if allDay}}{{localize 'FSC.AllDay'}}{{else}}{{displayDate}}{{/if}}
                                        </div>
                                        {{#if authorDisplay}}
                                            <div class="fsc-ck" data-tooltip="{{localize 'FSC.Notes.Author'}}" style="background-color:{{authorDisplay.color}};color:{{authorDisplay.textColor}};">
                                                <span class="fa fa-pencil-alt"></span> {{authorDisplay.name}}
                                            </div>
                                        {{/if}}
                                        {{#each categories}}
                                            <div class="fsc-ck" style="background-color:{{color}};color:{{textColor}};">
                                                {{name}}
                                            </div>
                                        {{/each}}
                                    </div>
                                </div>
                            </div>
                        {{/each}}
                    {{else}}
                        <em>{{localize 'FSC.SearchEmpty'}}</em>
                    {{/if}}
                </div>
            </div>
            {{{mainViewDisplay.addonButtonSidePanels}}}
            <div class="fsc-ha {{sideDrawerDirection}} fsc-ia" data-id="">
                <div class="fsc-ka">
                    <div class="fsc-ta" data-action="remind"></div>
                    {{#if isGM}}
                        <div class="fsc-ta" data-action="showPlayers"><span class="fa fa-eye"></span>{{localize 'JOURNAL.ActionShow'}}</div>
                    {{/if}}
                    <div class="fsc-sa"></div>
                    <div class="fsc-ta" data-action="edit"><span class="fa fa-pen-to-square"></span>{{localize 'FSC.Edit'}}</div>
                    <div class="fsc-ta" data-action="delete"><span class="fa fa-trash"></span>{{localize 'FSC.Delete'}}</div>
                </div>
            </div>
        </div>
        {{#if showClock}}
            <div class="fsc-sf">
                <div class="fsc-vf">
                    {{sc-clock id=calendar.clockDisplayId calendarId=calendar.id theme='none'}}
                </div>
                <div class="fsc-xf">
                    {{#if changeDateTime}}
                        {{#if showTimeControls}}
                            {{#if isPrimary}}
                                <div class="fsc-gj">
                                    <button class="fsc-yb fsc-fg {{#if (eq clockClass 'started')}} fsc-dc{{else}} fsc-uc{{/if}}" data-tooltip="{{localize 'FSC.Time.Start'}}"><span class="fa {{#if (eq clockClass 'started')}} fa-pause{{else}} fa-play{{/if}}"></span></button>
                                    <button class="fsc-yb fsc-gg {{#if (eq clockClass 'stopped')}} fsc-lf{{else}} fsc-ic{{/if}}" data-tooltip="{{localize 'FSC.Time.Stop'}}"><span class="fa fa-stop"></span></button>
                                </div>

                            {{else if uiElementStates.primaryCheckRunning}}
                                <div class="fsc-hj"><span class="fas fa-spinner fa-spin"></span></div>
                            {{/if}}
                        {{/if}}
                    {{/if}}
                </div>
            </div>
        {{/if}}
        {{#if changeDateTime}}
            <div class="fsc-sf">
                {{sc-date-time-controls showDateControls=showDateControls showTimeControls=showTimeControls displayType='full' fullDisplay=dateTimeFullDisplay }}
            </div>
        {{/if}}
    {{/if}}
</div>



