Merge pull request 'Design election workspaces and Starport promotion calendars' (#403) from design/elections-starport-agenda into main

This commit is contained in:
unimatrix 2026-11-18 09:47:29 +00:00
commit 9fb4730238
26 changed files with 2015 additions and 128 deletions

View file

@ -0,0 +1,38 @@
# Elections and Starport advertising — commit 1 design
This batch contains presentation and local preview interactions only. No election, bank, key, booking or advertisement publication writer is added or changed. Existing Politics reference pages remain available. Commit 2 connects these interfaces to existing election and J.A.R.V.I.S. services.
## Navigation
- Clan CP / Household Affairs / Elections: Clan Delegate to the Landsraad only. Four tabs: Applications, Voting, Results, Calendar.
- Clan CP / Household Affairs / Advertising: own advertisement promotion agenda and shared card template gallery.
- User CP / Realm & Politics / Elections: Your Faction, Emperor, Bene Gesserit, Spacing Guild. Each election has the same four tabs.
- Company CP reuses these presentation components. Company Elections follows personal eligibility and creates no extra voting entitlement. Company Advertising uses its own promotion context.
- The shared organisation shell also exposes the design links from Politics CP. Office membership continues to follow existing office deeds.
## Two different calendars
The election Calendar tab displays the existing timetable, including application close and voting periods, as non-bookable reminders. Four-week elections, three-hour voting and immediate three-hour tie runoffs remain unchanged. No personal appointment feature is introduced.
Each candidature opens a separate campaign booking agenda for its own election, not a combined agenda or a list of other elections. One reusable FullCalendar component renders each isolated context. Ordinary visitors see active advertisements on Starport; the booking agenda is for advertisers. Clan and Company promotion agendas reuse the component with their own context.
FullCalendar Standard 7.1.5 is vendored with its MIT licence and provenance metadata, including the standard bundle, Monarch theme and CSS. All files are served from the CP origin through an exact allowlist. No Google account, external runtime script or Premium scheduler is required.
## Booking preview and agreed rules
- Advertising window: seven days before voting until voting starts. Advertisements stop at that boundary.
- Hourly selection, including multiple hours. Free, booked and selected have labels and different colours; a click or keyboard activation is enough. No mandatory drag or hover.
- Current preview availability and selections are explicit examples, held only in page memory. Confirm booking is disabled.
- Base prices per hour: Clan Delegate100DM; House, Bene Gesserit and Spacing Guild250DM; Emperor1000DM.
- Nine campaign Featured places: Atreides, Harkonnen, Ordos, Corrino, Fremen, Bene Gesserit, Spacing Guild, Emperor, Clan Delegate. Each place belongs to its corresponding election. Item promotion has its own inventory; three item places and10DM/hour remain a proposal.
- Featured surcharges are not final, including the proposed100DM Clan Delegate surcharge. Do not charge an invented surcharge.
- Commit 2 must atomically reserve the current balance and exact exclusive slots. A competing request must fail without a debit and return fresh availability. Ordinary concurrent advertisements do not consume the exclusive Featured place.
- Bookings and dossiers remain in the ledger after visibility ends. Existing J.A.R.V.I.S. processing publishes and expires the cards. Do not create a parallel election engine or change ranks/AD.
## Card templates
A shared presentation module defines item, kit, job, advertisement, campaign, quest, event, deed and key cards. Existing item/kit/vacancy actions keep their handlers. Campaign panels are wide, editorial and distinct from product cards: portrait/seal, candidate, office, headline, message, running time and View candidature, with no Buy/stock/item-price fields. Public previews are isolated in a clearly marked design gallery and are not real listings. The build copies the same card component and styles to the public Starport origin.
## Commit 2 integration contract
Reuse existing election applications, ballot, runoff and office-ledger code. J.A.R.V.I.S. supplies dossier references and status transitions. Results write the office deed; the office register retains term history; the existing office-deed adapter determines Polclan access. Advertising booking requires a valid scoped candidature or owned listing. Availability, campaign boundaries, fees and final booking are checked on the server. An agenda event is not an entitlement or permission.

View file

@ -1,7 +1,7 @@
export {workspacesForSurface} from './cp-v2-surface.mjs';
import {NATIVE_SERVICES,nativeServiceAccess} from './cp-v2-native-services.mjs';
import {canSubmitDevRequest} from '../dev-request-access.mjs';
const legacy={"account-authorisations":"web.bank.staff.view","tax-treasury":"web.bank.staff.manage","bank-dashboard":"web.bank.staff.view","company-finance":"web.bank.staff.view","loan-centre":"web.bank.personal.view","loan-administration":"web.bank.staff.view","electoral-roll":"web.menu.game","imperial-inbox":"web.mail.internal.view","faction-inbox":"web.mail.internal.view","staff-inbox":"web.mail.staff.view","clan-inbox":"web.mail.internal.view","company-inbox":"web.mail.internal.view","council-motd":"web.menu.game","applications":"web.menu.game","formal-council":"web.menu.game","shared-inbox":"web.mail.internal.view","house-elections":"web.menu.game","imperial-elections":"web.menu.game","imperial-command":"web.menu.game","imperial-water":"web.menu.game","imperial-spice":"web.menu.game","discord-link":"web.menu.security","support-management":"web.tickets.admin","landsraad":"web.menu.game","hosting-control":"web.menu.security","user-management":"web.accounts.view","manual-seals":"web.accounts.assign","company-management":"web.accounts.assign","community-goals":"web.community.manage","marketplace-home":"web.menu.inventory","adventure-home":"web.menu.game","account-home":"web.menu.security","server-kits":"web.ranks.manage","kit-checkout":"web.menu.inventory","rewards-codes":"web.menu.rewards","transactions":"web.menu.inventory","kits-exchange":"web.menu.inventory","redeem-code":"web.menu.rewards","discovery-rewards":"web.quests.view","shop-settings":"web.menu.inventory","exchange-settings":"web.menu.inventory","shop-admin":"web.shop.support","exchange-settings-admin":"web.exchange.manage","user-home":null,"staff-home":null,"exchange":"web.menu.game","clans":"web.menu.game","imperial-atelier":"web.menu.game","personal-bank":"web.bank.personal.view","staff-bank":"web.bank.staff.view","clan-portal":"web.menu.game","clan-shops":"web.menu.game","clan-kits":"web.menu.game","clan-bank":"web.menu.game","clan-settings":"web.menu.game","clan-quests":"web.menu.game","clan-quests-player":"web.menu.game","clan-quests-clan":"web.menu.game","clan-quests-guild":"web.menu.game","quests":"web.quests.view","quests-admin":"web.quests.manage","game":"web.menu.game","webmail":"web.menu.security","git-admin":"web.git.admin","git-control":"web.menu.security","site-profile":"web.menu.security","planetary-inventory":"web.menu.inventory","rewards":"web.menu.rewards","security":"web.menu.security","server-operations":"web.menu.servers","staff":"web.menu.administration","permissions":"web.menu.permissions","game-permissions":"web.ranks.manage","items":"web.menu.items","staff-manual":"web.menu.staffmanual","luckperms":"web.menu.luckperms","tickets":"web.menu.tickets","staff-tickets":"web.tickets.staff","forum-admin":"web.menu.forum","exchange-admin":"web.menu.exchange","website-posts":"web.menu.posts","bans":"web.menu.bans","ban-evidence":"web.menu.bans","kit-publishing":"web.ranks.manage","kit-claims":"web.ranks.manage","company-management-v2":"web.accounts.assign","company-audit":"web.accounts.assign","seal-generator":"web.accounts.assign","bank-audit":"web.bank.staff.view","stock-admin":"web.exchange.manage","stock-surveillance":"web.exchange.manage","git-repositories":"web.menu.security","mail-admin":"web.menu.administration"};
const legacy={"citizen-elections":"web.menu.game","account-authorisations":"web.bank.staff.view","tax-treasury":"web.bank.staff.manage","bank-dashboard":"web.bank.staff.view","company-finance":"web.bank.staff.view","loan-centre":"web.bank.personal.view","loan-administration":"web.bank.staff.view","electoral-roll":"web.menu.game","imperial-inbox":"web.mail.internal.view","faction-inbox":"web.mail.internal.view","staff-inbox":"web.mail.staff.view","clan-inbox":"web.mail.internal.view","company-inbox":"web.mail.internal.view","council-motd":"web.menu.game","applications":"web.menu.game","formal-council":"web.menu.game","shared-inbox":"web.mail.internal.view","house-elections":"web.menu.game","imperial-elections":"web.menu.game","imperial-command":"web.menu.game","imperial-water":"web.menu.game","imperial-spice":"web.menu.game","discord-link":"web.menu.security","support-management":"web.tickets.admin","landsraad":"web.menu.game","hosting-control":"web.menu.security","user-management":"web.accounts.view","manual-seals":"web.accounts.assign","company-management":"web.accounts.assign","community-goals":"web.community.manage","marketplace-home":"web.menu.inventory","adventure-home":"web.menu.game","account-home":"web.menu.security","server-kits":"web.ranks.manage","kit-checkout":"web.menu.inventory","rewards-codes":"web.menu.rewards","transactions":"web.menu.inventory","kits-exchange":"web.menu.inventory","redeem-code":"web.menu.rewards","discovery-rewards":"web.quests.view","shop-settings":"web.menu.inventory","exchange-settings":"web.menu.inventory","shop-admin":"web.shop.support","exchange-settings-admin":"web.exchange.manage","user-home":null,"staff-home":null,"exchange":"web.menu.game","clans":"web.menu.game","imperial-atelier":"web.menu.game","personal-bank":"web.bank.personal.view","staff-bank":"web.bank.staff.view","clan-portal":"web.menu.game","clan-shops":"web.menu.game","clan-kits":"web.menu.game","clan-bank":"web.menu.game","clan-settings":"web.menu.game","clan-quests":"web.menu.game","clan-quests-player":"web.menu.game","clan-quests-clan":"web.menu.game","clan-quests-guild":"web.menu.game","quests":"web.quests.view","quests-admin":"web.quests.manage","game":"web.menu.game","webmail":"web.menu.security","git-admin":"web.git.admin","git-control":"web.menu.security","site-profile":"web.menu.security","planetary-inventory":"web.menu.inventory","rewards":"web.menu.rewards","security":"web.menu.security","server-operations":"web.menu.servers","staff":"web.menu.administration","permissions":"web.menu.permissions","game-permissions":"web.ranks.manage","items":"web.menu.items","staff-manual":"web.menu.staffmanual","luckperms":"web.menu.luckperms","tickets":"web.menu.tickets","staff-tickets":"web.tickets.staff","forum-admin":"web.menu.forum","exchange-admin":"web.menu.exchange","website-posts":"web.menu.posts","bans":"web.menu.bans","ban-evidence":"web.menu.bans","kit-publishing":"web.ranks.manage","kit-claims":"web.ranks.manage","company-management-v2":"web.accounts.assign","company-audit":"web.accounts.assign","seal-generator":"web.accounts.assign","bank-audit":"web.bank.staff.view","stock-admin":"web.exchange.manage","stock-surveillance":"web.exchange.manage","git-repositories":"web.menu.security","mail-admin":"web.menu.administration"};
export function visibleCPItem(user,workspace,item){
if(item.id==='codex-management')return ['web.menu.items','web.menu.exchange','web.ranks.manage','web.cp.v2.items.view','web.cp.v2.server.kits.view','web.cp.v2.kit.publishing.view','web.cp.v2.kit.claims.view','web.cp.v2.exchange.admin.view'].some(node=>user?.permissions?.includes(node)||user?.permissions?.includes(node.replace(/^web\./,'cp.')));
if(workspace==='bank'&&item.id==='federal-reserve')return true;

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,20 @@
import {createCPV2Page,element as el} from './cp-v2-page-template.mjs';
import {mountPromotionAgenda,ELECTION_DESIGN_TYPES,electionDesignStyles} from './cp-v2-promotion-agenda.mjs';
import {createCardGallery,createListingCard} from './cp-v2-exchange-cards.mjs';
export function mountElectionDesign(host,{context='clan'}={}){
electionDesignStyles();let active=true,election=context==='clan'?'clan_delegate':'faction',disposeCalendar=()=>{},disposeBooking=()=>{};
const outer=el('div',undefined,'election-design');outer.dataset.mode='design-only';const scope=el('div',undefined,'election-scope-selector');if(context!=='clan'){const label=el('label','Election'),select=el('select');select.setAttribute('aria-label','Choose election');for(const id of ['faction','emperor','bene','guild']){const option=el('option',ELECTION_DESIGN_TYPES[id].name);option.value=id;select.append(option);}select.onchange=()=>{election=select.value;draw();};label.append(select);scope.append(label);}const content=el('div');outer.append(scope,content);host.replaceChildren(outer);
function draw(){disposeCalendar();disposeBooking();const type=ELECTION_DESIGN_TYPES[election],applications=el('section',undefined,'election-page-grid'),apply=el('article',undefined,'election-panel'),history=el('article',undefined,'election-panel');apply.append(el('small','YOUR CANDIDATURE','election-eyebrow'),el('h3','Stand before the banners'),el('p','Your verified character, eligibility and candidature dossier will appear here.'));
const form=el('form',undefined,'election-form');form.onsubmit=e=>e.preventDefault();for(const [text,tag,placeholder]of [['Campaign title','input','Your campaign headline'],['Motivation & programme','textarea','Your plans and responsibilities']]){const label=el('label',text),field=el(tag);field.placeholder=placeholder;field.disabled=true;label.append(field);form.append(label);}const submit=el('button','Submit candidature · backend in commit 2');submit.type='button';submit.disabled=true;form.append(submit);apply.append(form);history.append(el('small','J.A.R.V.I.S. REGISTER','election-eyebrow'),el('h3','My applications'),emptyTable(['Reference','Election','Status','Details'],'No live application records are loaded in this design preview.'));
const campaign=el('article',undefined,'election-panel election-campaign-panel'),booking=el('div'),book=el('button','Preview campaign booking agenda');book.type='button';campaign.append(el('small','STARPORT CAMPAIGN','election-eyebrow'),el('h3','Give your campaign a voice'),el('p',type.price+' DM per hour · campaign advertising only in the seven days before voting. Featured surcharge is separate and still to be confirmed.'),createListingCard({type:'campaign',image:'https://www.dunerealms.com/assets/seals/'+type.art,title:'Your campaign headline',subtitle:type.name+' · Example candidate',message:'Your candidate portrait, House seal and message become an advertisement on Starport.',featured:true,duration:'Example · 1 hour placement'},{preview:true}),book,booking);book.onclick=()=>{disposeBooking();disposeBooking=mountPromotionAgenda(booking,{election,organisationKind:context});book.hidden=true;};applications.append(apply,history,campaign);
const voting=el('section',undefined,'election-panel');voting.append(el('small','THE BALLOT CHAMBER','election-eyebrow'),el('h3','Voting'),el('p','The existing three-hour ballot, eligibility and vote allowance will be connected in commit 2.'));const candidates=el('div',undefined,'election-candidate-grid');for(const caption of ['Candidate portrait','Candidate portrait']){const card=el('article',undefined,'election-candidate-preview'),portrait=el('div','✦','election-portrait-placeholder');portrait.setAttribute('aria-label',caption);card.append(portrait,el('h4','Candidate record'),el('p','Character name · House identity'),el('p','Programme and linked campaign details.'));const button=el('button','Cast vote · not connected');button.type='button';button.disabled=true;card.append(button);candidates.append(card);}voting.append(candidates,el('p','No sample vote totals or real candidates are shown.','election-muted'));
const results=el('section',undefined,'election-panel');results.append(el('small','THE OFFICE REGISTER','election-eyebrow'),el('h3','Results & office history'),el('p','The result creates the office deed; the register preserves the history of the office. Current office deeds determine Polclan access.'),emptyTable(['Election','Winner','Term','Office deed','History'],'No result is inferred or changed by this preview.'),el('p','A tie retains the existing immediate three-hour runoff.'));
const calendar=el('section');let calendarMounted=false;const page=createCPV2Page({shellHost:host,title:context==='clan'?'Clan Elections · Landsraad Delegate':type.name+' Elections',description:context==='clan'?'Applications, voting, results and calendar for the Clan Delegate to the Landsraad.':'Citizen election workspace · eligibility follows your existing personal and political records.',artwork:'seals/'+type.art,tabs:[{id:'applications',label:'Applications',content:applications},{id:'voting',label:'Voting',content:voting},{id:'results',label:'Results',content:results},{id:'calendar',label:'Calendar',content:calendar}],onActivate:id=>{if(id==='calendar'&&!calendarMounted){calendarMounted=true;queueMicrotask(()=>{if(active)disposeCalendar=mountPromotionAgenda(calendar,{election,remindersOnly:true});});}}});
const notice=el('p','DESIGN PREVIEW · no applications, votes, bookings or payments are submitted. Existing election services remain unchanged.','election-preview-notice');content.replaceChildren(notice,page.root);if(context==='company')content.prepend(el('p','Company membership does not create extra votes. This page follows your personal election eligibility.','election-muted'));
}
draw();return()=>{active=false;disposeCalendar();disposeBooking();outer.remove();};
}
function emptyTable(headings,message){const wrap=el('div',undefined,'election-table-scroll'),table=el('table'),head=el('thead'),row=el('tr');for(const text of headings)row.append(el('th',text));head.append(row);const body=el('tbody'),empty=el('tr'),cell=el('td',message);cell.colSpan=headings.length;empty.append(cell);body.append(empty);table.append(head,body);wrap.append(table);return wrap;}
export function mountAdvertisingDesign(host,{context='clan'}={}){
electionDesignStyles();const root=el('div',undefined,'election-design'),intro=el('header',undefined,'election-panel');intro.append(el('small','STARPORT · PROMOTION STUDIO','election-eyebrow'),el('h2',context==='company'?'Company Advertising':'Clan Advertising'),el('p','Book publication hours and preview your Starport card. Election campaign booking opens separately from the corresponding candidature.'));const calendar=el('div'),gallery=el('details',undefined,'election-panel');gallery.append(el('summary','Card templates · items, kits, advertisements, jobs and campaigns'),createCardGallery());root.append(intro,calendar,gallery);host.replaceChildren(root);const dispose=mountPromotionAgenda(calendar,{election:'clan-promotion',organisationKind:context});return()=>{dispose();root.remove();};
}

View file

@ -0,0 +1,3 @@
.exchange-card{min-width:0;display:flex;flex-direction:column;border:1px solid #8f824f;border-radius:12px;background:linear-gradient(135deg,#163d36,#082622);padding:18px;color:#e9e0c7;overflow:hidden;box-shadow:0 5px 15px #0003}.exchange-card header{display:flex;gap:10px;justify-content:space-between;align-items:center;margin-bottom:14px}.exchange-card small{font:500 11px/1.6 Arial,sans-serif;color:#b6c6b5;letter-spacing:.07em}.exchange-card-body{display:flex;gap:18px;align-items:center;flex:1;min-width:0}.exchange-card-body>img{object-fit:contain;flex:none;width:84px;height:84px;filter:drop-shadow(0 4px 5px #0006)}.exchange-card-copy{min-width:0}.exchange-card h3{font:600 22px/1.3 'Cinzel',Georgia,serif;color:#f1d993;margin:7px 0;overflow-wrap:anywhere}.exchange-card p{font:14px/1.65 Arial,sans-serif;color:#c2cfbf;margin:8px 0}.exchange-card .minecraft-texture{image-rendering:pixelated}.exchange-card-item .exchange-card-body,.exchange-card-kit .exchange-card-body{flex-direction:column;text-align:center}.exchange-card-item .exchange-card-body>img,.exchange-card-kit .exchange-card-body>img{width:100px;height:100px}.exchange-card-facts{display:flex;gap:7px;flex-wrap:wrap;margin:15px 0}.exchange-card-facts span{border:1px solid #8f9c6c55;border-radius:20px;padding:4px 9px;font:11px/1.4 Arial,sans-serif;color:#c3d4c8}.exchange-card footer{display:flex;gap:10px;justify-content:space-between;align-items:center;padding-top:15px;margin-top:15px;border-top:1px solid #b4a36444}.exchange-card footer button{min-height:42px;border:1px solid #a68f50;border-radius:7px;background:#24483b;color:#efdda1;padding:9px 13px;cursor:pointer}.exchange-card footer button:disabled{opacity:.5;cursor:default}.exchange-card-featured{border-color:#ddbc65;box-shadow:inset 0 0 0 3px #c5a35a22,0 6px 18px #0004}.exchange-card-badge{font:700 10px Arial,sans-serif;color:#16291e;background:#d7ba72;padding:6px 9px;border-radius:4px;letter-spacing:.08em;text-transform:uppercase}.exchange-card-campaign{background:linear-gradient(100deg,#122e29ef,#182a28dd),url(https://www.dunerealms.com/assets/political-imperial-chamber-v1.png) center/cover;border-top:3px solid #ccb16b}.exchange-card-campaign .exchange-card-body>img{width:110px;height:110px;border:1px solid #c9a85a;border-radius:50%;padding:10px;background:#0b241f}.exchange-card-campaign h3{font-size:27px}.exchange-card-gallery-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}.exchange-card-gallery-grid>.exchange-card-campaign{grid-column:span 2}.exchange-card-gallery-note{color:#c7b978;font:13px/1.6 Arial,sans-serif}.exchange-card-gallery{margin:20px 0}.exchange-card-gallery-grid>.exchange-card-job{background:linear-gradient(130deg,#183d47,#122a28)}.exchange-card-gallery-grid>.exchange-card-ad{background:linear-gradient(130deg,#3b3547,#162d2a)}@media(max-width:1000px){.exchange-card-gallery-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:600px){.exchange-card-gallery-grid{grid-template-columns:minmax(0,1fr)}.exchange-card-gallery-grid>.exchange-card-campaign{grid-column:auto}.exchange-card-campaign .exchange-card-body{align-items:flex-start}.exchange-card-campaign .exchange-card-body>img{width:70px;height:70px}.exchange-card-campaign h3{font-size:22px}.exchange-card footer{flex-wrap:wrap}}
.exchange-card-art-sprite{width:90px;height:110px;flex:none;filter:drop-shadow(0 3px 5px #0007)}.exchange-card-art-deed{background:url(https://www.dunerealms.com/assets/organisation-deeds-company-tiers-v1.png) right center/300% 100% no-repeat}.exchange-card-art-key{background:url(https://www.dunerealms.com/assets/organisation-deed-keys-v1.png) left center/200% 100% no-repeat}

View file

@ -0,0 +1,22 @@
const asset='https://www.dunerealms.com/assets/';
const el=(tag,text,cls)=>{const n=document.createElement(tag);if(text!==undefined)n.textContent=text;if(cls)n.className=cls;return n;};
export const CARD_TYPES=Object.freeze({item:{label:'Minecraft item',art:'minecraft-items/diamond_pickaxe.png',action:'View item'},kit:{label:'Equipment kit',art:'minecraft-items/leather_chestplate.png',action:'View kit'},job:{label:'Recruitment',art:'exchange-clan-recruitment-v1.png',action:'View vacancy'},ad:{label:'Advertisement',art:'nav-exchange-v2.webp',action:'View advertisement'},campaign:{label:'Election campaign',art:'seals/emperor-v1.png',action:'View candidature'},quest:{label:'Quest',art:'exchange-quests-v1.png',action:'View quest'},event:{label:'Event',art:'nav-home-v2.webp',action:'View event'},deed:{label:'Registered deed',art:'organisation-deeds-company-tiers-v1.png',action:'View deed'},key:{label:'Charter key',art:'organisation-deed-keys-v1.png',action:'View entitlement'}});
export function createListingCard(record,{onOpen=null,preview=false}={}){
if(!document.querySelector('link[data-exchange-cards]')){const css=el('link');css.rel='stylesheet';css.href=new URL('./cp-v2-exchange-cards.css',import.meta.url).href;css.dataset.exchangeCards='';document.head.append(css);}
const type=Object.hasOwn(CARD_TYPES,record.type)?record.type:'ad',definition=CARD_TYPES[type],card=el('article',undefined,'exchange-card exchange-card-'+type+(record.featured?' exchange-card-featured':''));card.dataset.cardType=type;
const heading=el('header'),label=el('small',preview?'DESIGN EXAMPLE · '+definition.label:definition.label);heading.append(label);if(record.featured)heading.append(el('span','Featured','exchange-card-badge'));card.append(heading);
const body=el('div',undefined,'exchange-card-body'),image=el('img');image.src=record.image||asset+definition.art;image.alt='';image.loading='lazy';image.width=image.height=96;if(['item','kit'].includes(type))image.className='minecraft-texture';const copy=el('div',undefined,'exchange-card-copy');copy.append(el('small',record.subtitle||record.owner||'Registered listing'),el('h3',record.title),el('p',record.message||''));if(['deed','key'].includes(type)){const artwork=el('div',undefined,'exchange-card-art-sprite exchange-card-art-'+type);artwork.setAttribute('role','img');artwork.setAttribute('aria-label',definition.label+' artwork');body.append(artwork,copy);}else body.append(image,copy);card.append(body);
const facts=el('div',undefined,'exchange-card-facts');for(const text of record.facts||[])facts.append(el('span',text));if(facts.children.length)card.append(facts);
const footer=el('footer');if(record.price)footer.append(el('strong',record.price));else footer.append(el('small',record.duration||'Details on selection'));const open=el('button',definition.action);open.type='button';open.disabled=!onOpen;open.onclick=()=>onOpen?.(record);footer.append(open);card.append(footer);return card;
}
export function createCardGallery(){const root=el('section',undefined,'exchange-card-gallery');root.append(el('p','Design examples only · no listings, candidatures, charges or rewards are created.','exchange-card-gallery-note'));const grid=el('div',undefined,'exchange-card-gallery-grid');for(const sample of [
{type:'campaign',title:'A voice for the Landsraad',subtitle:'Example candidate · Clan Delegate',message:'A campaign message belongs here, beside the candidate portrait and organisation seal.',featured:true,duration:'1 hour campaign placement',facts:['Clan Delegate','Campaign closes at voting start']},
{type:'item',title:'Diamond Pickaxe',subtitle:'Example seller',message:'Actual Minecraft item artwork.',price:'25.00 DM',facts:['Rare','MK I','Alpha · example edition']},
{type:'kit',title:'House Expedition Kit',subtitle:'Clan kit · example',message:'Armour, tools and equipment contents are shown after selection.',price:'75.00 DM',facts:['Clan kit','MK I','Rare']},
{type:'job',title:'Join our caravan',subtitle:'Example household',message:'Role, homeworld and vacancy details.',facts:['Recruitment','Apply through J.A.R.V.I.S.']},
{type:'ad',title:'Trade across the stars',subtitle:'Example Company',message:'A branded advertisement with a clear call to action.',duration:'1 hour promotion',featured:true},
{type:'quest',title:'Supplies for the expedition',subtitle:'Example issuer',message:'Objective and reward summary.',facts:['Reward shown on details','Example quest']},
{type:'event',title:'The caravan assembles',subtitle:'Example organiser',message:'Event details and registration summary.',facts:['Date to be announced']},
{type:'deed',title:'Company charter',subtitle:'Example registered deed',message:'Ownership and charter details.',facts:['Royal · example']},
{type:'key',title:'Silver charter key',subtitle:'Example entitlement',message:'Public information only; private codes are never shown on cards.',facts:['Keyed upgrade · example']}
])grid.append(createListingCard(sample,{preview:true}));root.append(grid);return root;}

View file

@ -1,3 +1,4 @@
import {createCardGallery,createListingCard} from './cp-v2-exchange-cards.mjs';
import {JARVIS_EXPANSION} from '../jarvis-brand.mjs';
import {organisationTabs} from '../organisation-tabs.mjs';
const asset='https://www.dunerealms.com/assets/';
@ -24,8 +25,8 @@ export function mountExchangeDesign(host,{context='public',view='browse',fetcher
const promotions=el('div',undefined,'codex-exchange-promotion');promotions.append(el('h3','Promotions & delivery'),el('p','Basic: five initial shared credits. Each Board post costs one; each Discord post costs one. Choose any mix. Quest rewards may add credits. Keyed and Royal remove the Basic credit limit; configured promotion fees apply.'),empty(['Listing','Channel','Cost','State','Last attempt'],'Delivery history is not connected.'),el('p','Available credits: not connected. No charge is made in this preview.'));
const eligibility=el('p','Checking your deed…','codex-exchange-eligibility');if(context==='clan')root.append(eligibility);
let selectPost;const groups=[{id:'browse',title:'Browse',content:browse}];if(context!=='public'){groups.push({id:'mine',title:'My listings',content:mine},{id:'post',title:context==='user'?'Post an item':'Post a listing',content:post});if(context==='clan')groups.push({id:'applications',title:'Applications',content:applications},{id:'promotions',title:'Promotions',content:promotions});}const tabbed=organisationTabs(groups,{label:'Exchange sections',initial:view});selectPost=()=>tabbed.querySelector('[role=tab][aria-controls$="-post-panel"]')?.click();root.append(tabbed);
const footer=el('footer',undefined,'codex-exchange-logistics');footer.append(el('span',context==='public'?'Logistics by SPost':'Exchange logistics supplied by'),image('spost-logo-v1.svg'),el('small','part of'),image('corrino-group-v4.png'));root.append(footer);host.replaceChildren(root);
function render(){for(const [node,id]of buttons)node.setAttribute('aria-pressed',String(id===category));let matches=[...rows,...kitRows,...jarvisRows,...(examples?SAMPLES.filter(row=>context!=='clan'||['recruitment','quests','events'].includes(row.type)):[])].filter(row=>(category==='all'||row.category===category||row.type===category&&!(category==='recruitment'&&row.organisationKind==='company')||row.kitCategory===category)&&[row.title,row.owner,row.world].join(' ').toLowerCase().includes(search.input.value.toLowerCase()));if(stage.input.selectedIndex>0)matches=matches.filter(row=>row.edition?.stage===stage.input.value.toLowerCase());if(season.input.selectedIndex>0)matches=matches.filter(row=>row.edition&&currentEdition&&(season.input.selectedIndex===1?row.edition.season===currentEdition.season:row.edition.season!==currentEdition.season));if(quality.input.selectedIndex>0)matches=matches.filter(row=>words(row.quality).toLowerCase()===quality.input.value.toLowerCase());matches.sort((a,b)=>sort.input.selectedIndex===1?a.price-b.price:sort.input.selectedIndex===2?b.price-a.price:sort.input.selectedIndex===3?a.title.localeCompare(b.title):Number(b.createdAt||b.created_at||b.id)-Number(a.createdAt||a.created_at||a.id)||0);page=Math.min(page,Math.max(0,Math.ceil(matches.length/8)-1));cards.replaceChildren();if(!matches.length)cards.append(el('p',season.input.selectedIndex||quality.input.selectedIndex||stage.input.selectedIndex?'No listings match these edition and quality filters. Goods without edition metadata are excluded.':'No matching listings. Design examples can be enabled separately.','codex-exchange-empty'));for(const row of matches.slice(page*8,page*8+8)){const sample=String(row.id).startsWith('preview-'),type=TYPES.find(([id])=>id===(row.category||row.type)),card=el('article',undefined,'codex-exchange-card');card.append(el('small',sample?'DESIGN EXAMPLE':type?.[1]||'ITEM'));const art=row.type==='recruitment'&&row.organisationKind==='company'?'exchange-company-jobs-v1.png':row.type==='items'?'minecraft-items/'+String(row.material).toLowerCase()+'.png':row.type==='kits'?'minecraft-items/'+(row.quality==='legendary'?'netherite_chestplate':'leather_chestplate')+'.png':type?.[2],img=image(art,['items','kits'].includes(row.type)?'minecraft-texture':undefined);img.onerror=()=>{img.remove();card.prepend(el('span','▧','codex-exchange-missing-icon'));};if(row.edition)card.append(el('small',words(row.edition.stage)+' '+row.edition.version+' · '+row.edition.season,'codex-exchange-edition'));card.append(img,el('h3',row.title),el('p',row.owner+' · '+row.world),el('strong',row.type==='items'?row.price.toFixed(2)+' DM · '+row.quantity+' available':row.type==='kits'?row.price.toFixed(2)+' DM · '+words(row.quality):'View opportunity'),button(row.type==='items'?'View item':row.type==='kits'?'View kit':row.type==='recruitment'?'View vacancy':'View details',()=>detail(row,sample)));cards.append(card);}pager.replaceChildren(button('← Previous',()=>{page--;render();},page===0),el('span',(page+1)+' / '+Math.max(1,Math.ceil(matches.length/8))),button('Next →',()=>{page++;render();},(page+1)*8>=matches.length));}
const footer=el('footer',undefined,'codex-exchange-logistics');footer.append(el('span',context==='public'?'Logistics by SPost':'Exchange logistics supplied by'),image('spost-logo-v1.svg'),el('small','part of'),image('corrino-group-v4.png'));root.append(footer);const cardDesigns=el('details',undefined,'codex-exchange-legend');cardDesigns.append(el('summary','Card design previews · items, kits, campaigns, jobs and more'),createCardGallery());root.append(cardDesigns);host.replaceChildren(root);
function render(){for(const [node,id]of buttons)node.setAttribute('aria-pressed',String(id===category));let matches=[...rows,...kitRows,...jarvisRows,...(examples?SAMPLES.filter(row=>context!=='clan'||['recruitment','quests','events'].includes(row.type)):[])].filter(row=>(category==='all'||row.category===category||row.type===category&&!(category==='recruitment'&&row.organisationKind==='company')||row.kitCategory===category)&&[row.title,row.owner,row.world].join(' ').toLowerCase().includes(search.input.value.toLowerCase()));if(stage.input.selectedIndex>0)matches=matches.filter(row=>row.edition?.stage===stage.input.value.toLowerCase());if(season.input.selectedIndex>0)matches=matches.filter(row=>row.edition&&currentEdition&&(season.input.selectedIndex===1?row.edition.season===currentEdition.season:row.edition.season!==currentEdition.season));if(quality.input.selectedIndex>0)matches=matches.filter(row=>words(row.quality).toLowerCase()===quality.input.value.toLowerCase());matches.sort((a,b)=>sort.input.selectedIndex===1?a.price-b.price:sort.input.selectedIndex===2?b.price-a.price:sort.input.selectedIndex===3?a.title.localeCompare(b.title):Number(b.createdAt||b.created_at||b.id)-Number(a.createdAt||a.created_at||a.id)||0);page=Math.min(page,Math.max(0,Math.ceil(matches.length/8)-1));cards.replaceChildren();if(!matches.length)cards.append(el('p',season.input.selectedIndex||quality.input.selectedIndex||stage.input.selectedIndex?'No listings match these edition and quality filters. Goods without edition metadata are excluded.':'No matching listings. Design examples can be enabled separately.','codex-exchange-empty'));for(const row of matches.slice(page*8,page*8+8)){const sample=String(row.id).startsWith('preview-'),type=TYPES.find(([id])=>id===(row.category||row.type)),cardType=({'items':'item','kits':'kit','recruitment':'job','quests':'quest','events':'event','deeds':'deed'})[row.type]||'ad',art=row.type==='recruitment'&&row.organisationKind==='company'?'exchange-company-jobs-v1.png':row.type==='items'?'minecraft-items/'+String(row.material).toLowerCase()+'.png':row.type==='kits'?'minecraft-items/'+(row.quality==='legendary'?'netherite_chestplate':'leather_chestplate')+'.png':type?.[2]||'nav-exchange-v2.webp',facts=[row.world,...(row.edition?[words(row.edition.stage)+' '+row.edition.version+' · '+row.edition.season]:[]),...(row.type==='items'?[row.quantity+' available']:row.type==='kits'?[words(row.quality)]:[])].filter(Boolean),card=createListingCard({type:cardType,title:row.title,owner:row.owner,subtitle:row.owner,message:row.description||'',image:asset+art,facts,price:['items','kits'].includes(row.type)?Number(row.price).toFixed(2)+' DM':null},{preview:sample,onOpen:()=>detail(row,sample)});card.classList.add('codex-exchange-card');cards.append(card);}pager.replaceChildren(button('← Previous',()=>{page--;render();},page===0),el('span',(page+1)+' / '+Math.max(1,Math.ceil(matches.length/8))),button('Next →',()=>{page++;render();},(page+1)*8>=matches.length));}
function detail(row,sample){const dialog=el('dialog',undefined,'codex-exchange-dialog');dialog.append(el('h3',row.title),el('p',row.description||row.owner+' · '+row.world),el('p',sample?'Design example. Applications and purchases are disabled.':row.type==='kits'?(row.purchaseAvailable?'Continue to the existing kit checkout.':'Published design · purchase or delivery is not available yet.'):row.type==='recruitment'?'Applications are free. The organisation reviews your request before membership starts.':'Trade in Minecraft: /exchange buy '+row.id),button('Close',()=>dialog.close()));if(row.type==='kits'&&row.purchaseAvailable){const checkout=el('a','Open kit checkout →');checkout.href='https://cp.dunerealms.com/?kit-listing='+encodeURIComponent(row.listingId)+'#realm/kits-exchange';dialog.append(checkout);}if(!sample&&row.type==='recruitment'){const apply=el('a','Apply to this '+(row.organisationKind==='company'?'company':'clan')+' →');apply.href='https://cp.dunerealms.com/jarvis-application?listing='+encodeURIComponent(row.id);apply.target='_top';dialog.append(apply);}dialog.onclose=()=>dialog.remove();root.append(dialog);dialog.showModal();}
search.input.oninput=()=>{page=0;render();};sort.input.onchange=quality.input.onchange=stage.input.onchange=season.input.onchange=()=>{page=0;render();};
async function load(){try{const response=await fetcher(context==='public'?'/api/exchange/listings':'/api/exchange/listings?view=all',{credentials:'same-origin',signal:controller.signal});if(!response.ok)throw Error('unavailable');const data=await response.json();const source=Array.isArray(data)?data:Array.isArray(data.listings)?data.listings:Array.isArray(data.items)?data.items:[];rows=source.filter(row=>Number.isFinite(Number(row.price))&&Number.isFinite(Number(row.quantity))&&/^[A-Za-z0-9_]+$/.test(row.material||'')&&/^\d+$/.test(String(row.id))).map(row=>({...row,type:'items',title:row.displayName||words(row.material),owner:row.seller||row.seller_name||'Player listing',world:words(row.origin),price:Number(row.price),quantity:Number(row.quantity)}));if(!active)return;goodsState='ready';updateStatus();render();}catch{if(!active)return;rows=[];goodsState='error';updateStatus();render();}}
@ -35,4 +36,4 @@ export function mountExchangeDesign(host,{context='public',view='browse',fetcher
function updateStatus(){status.textContent=[goodsState==='ready'?rows.length+' Minecraft listings':goodsState==='error'?'Minecraft listings unavailable':'Loading Minecraft listings',kitState==='ready'?kitRows.length+' kit designs':kitState==='loading'?'Loading kits':kitState==='error'?'Kit catalogue unavailable':null,jarvisState==='ready'?jarvisRows.length+' recruitment listings':jarvisState==='error'?'Recruitment listings unavailable':'Loading recruitment'].filter(Boolean).join(' · ');}
async function loadJarvis(){try{const response=await fetcher(context==='public'?'https://cp.dunerealms.com/api/jarvis/listings':'/api/jarvis/listings',{credentials:context==='public'?'omit':'same-origin',cache:'no-store',signal:controller.signal});if(!response.ok)throw Error();const data=await response.json();if(!active)return;jarvisRows=(data.listings||[]).map(row=>({...row,price:0}));currentEdition=data.edition||null;jarvisState='ready';updateStatus();render();}catch{if(active){jarvisState='error';updateStatus();}}}
render();load();void loadJarvis();return()=>{active=false;disposeJarvis();controller.abort();root.remove();};
}
}

View file

@ -1,6 +1,6 @@
export const ORGANISATION_MENU_GROUPS=Object.freeze([
['Your organisation',[['overview','Dashboard'],['settings','Settings']]],
['Organisation affairs',[['boards','Boards'],['commerce','Exchange'],['tailor','Tailor']]],
['Organisation affairs',[['boards','Boards'],['elections','Elections'],['advertising','Advertising'],['commerce','Exchange'],['tailor','Tailor']]],
['Estates & relations',[['claims','Claims'],['subsidiaries','Subhouses'],['directory','Directory'],['projects','Expeditions'],['campaigns','Campaigns']]]
]);
export function organisationPage(hash=''){

View file

@ -1,3 +1,4 @@
import {mountElectionDesign,mountAdvertisingDesign} from './cp-v2-election-design.mjs';
import {mountCompanyMailboxSettings} from './cp-v2-company-mailbox.mjs';
import {loadCompanyTreasury,loadCompanyClaims,loadOfficeTreasury,loadProtectedClaims} from '../clan-dashboard-data.mjs';
import {mountCompanyEmblem} from './cp-v2-company-emblem.mjs';
@ -34,6 +35,8 @@ export function startOrganisationCP(kind){
for(let i=0;i<groups.length;i++){const [heading,items]=groups[i],host=i<2?left:right,block=el('section',undefined,'category-block'),links=el('div',undefined,'category-links');block.append(el('div',heading,'category-heading'));for(const[id,title]of items){const a=el('a',title==='Subhouses'&&company?'Subsidiaries':title,'navitem');a.href='#'+prefix+'/'+id;a.dataset.menuHref=(company?outer+'/':outer+'/government.html')+a.getAttribute('href');if(id===page)a.setAttribute('aria-current','page');links.append(a);}block.append(links);host.append(block);}left.append(reference());
const hero=el('header',undefined,'hero organisation-workspace-hero'),copy=el('div');copy.append(el('small',company?'SPACING GUILD · COMMERCIAL AFFAIRS':'IMPERIAL HOUSES · OFFICE DEEDS'),el('h1',record?.name||noun+' Dashboard'),el('p',company?'Your enterprise, its people and its next chapter.':'Protected Houses · membership follows current office deeds.'));hero.append(image(record?.emblem||fallback),copy);
const cards=el('div',undefined,'cards'),card=el('article',undefined,'card full citizen-page-full'),host=el('div',undefined,'citizen-live-host clan-center');card.append(host);cards.append(card);content.replaceChildren(hero,cards);
if(page==='elections'){dispose=mountElectionDesign(host,{context:company?'company':'citizen'});return;}
if(page==='advertising'){dispose=mountAdvertisingDesign(host,{context:kind});return;}
if(page==='directory'){dispose=mountOrganisationRegister(host,kind);return;}
if(!record&&company){dispose=mountCompanyRegistration(host,{onCreated:id=>{const url=new URL(location.href);url.searchParams.set('company',id);url.hash='company/overview';location.assign(url.href);}});return;}
if(!record){pending(host,'Your '+noun.toLowerCase()+' workspace',company?'No company is registered to you as founder or CEO.':'Political office membership could not be verified.');return;}

View file

@ -1,3 +1,4 @@
import {mountElectionDesign,mountAdvertisingDesign} from './cp-v2-election-design.mjs';
import {mountExchangeDesign} from './cp-v2-exchange-design.mjs';
import {mountPatronage} from './cp-v2-patronage.mjs';
import {mountClaims} from './cp-v2-claims.mjs';
@ -6,6 +7,8 @@ import {element as el} from './cp-v2-page-template.mjs';
import {mountNativeService} from './cp-v2-native-services.mjs';
import {mountUserPage} from './cp-v2-user-pages.mjs';
export function mountPlayWorkspace(host,workspace,id,options={}){
if(workspace==='clan'&&id==='clan-elections')return mountElectionDesign(host,{context:'clan'});
if(workspace==='clan'&&id==='clan-advertising')return mountAdvertisingDesign(host,{context:'clan'});
if(workspace==='clan'){if(['clan-shop','clan-listings','clan-post-listing'].includes(id))return mountExchangeDesign(host,{context:'clan',view:id==='clan-listings'?'mine':id==='clan-post-listing'?'post':'browse',fetcher:options.fetcher||fetch});if(id==='clan-boards')return mountNativeService(host,'clan-boards',{...options,singleHeading:true});if(id==='clan-patronage')return mountPatronage(host);if(id==='clan-claims')return mountClaims(host,{kind:'clan',fetcher:options.fetcher||fetch,clanId:new URLSearchParams(location.hash.split('?')[1]||'').get('clientclan')||options.accountId||null});if(id==='clan-subhouses'){const panel=el('section',undefined,'claims-workspace');panel.append(el('h2','Subhouses'),el('p','Clan allegiance, independence and rebellion are coming soon. Subhouses retain their identity, land and local access; political powers and final authority belong to the ruling clan.'),el('strong','Coming soon'));for(const title of ['Buy Independence','Rebel']){const button=el('button',title);button.type='button';button.disabled=true;panel.append(button);}host.replaceChildren(panel);return()=>panel.remove();}if(id==='clan-bank')return mountClanBank(host,options);
const registry={'clan-overview':'overview','clan-roster':'roster','clan-requests':'requests','clan-settings':'settings','clan-directory':'directory'};
if(registry[id])return mountNativeService(host,'clans',{...options,organisationId:options.accountId||new URLSearchParams(location.hash.split('?')[1]||'').get('clientclan')||undefined,singleHeading:true,initialTab:registry[id]});

View file

@ -0,0 +1,27 @@
import {electionDates,electionWindow} from '../election-rules.mjs';
import {createListingCard} from './cp-v2-exchange-cards.mjs';
const el=(tag,text,cls)=>{const n=document.createElement(tag);if(text!==undefined)n.textContent=text;if(cls)n.className=cls;return n;};
export const ELECTION_DESIGN_TYPES=Object.freeze({clan_delegate:{name:'Clan Delegate',kind:'clan_delegate',price:100,art:'office-house_leader.png'},faction:{name:'Your Faction',kind:'house',price:250,art:'house-aerdrecht-v1.png'},atreides:{name:'House Atreides',kind:'house',price:250,art:'house-aerdrecht-v1.png'},harkonnen:{name:'House Harkonnen',kind:'house',price:250,art:'house-harkveen-v1.png'},ordos:{name:'House Ordos',kind:'house',price:250,art:'house-oordwijk-v1.png'},corrino:{name:'House Corrino',kind:'house',price:250,art:'house-korenholt-v1.png'},fremen:{name:'Fremen',kind:'house',price:250,art:'office-house_leader.png'},bene:{name:'Bene Gesserit',kind:'bene',price:250,art:'veiled-concord-v1.png'},guild:{name:'Spacing Guild',kind:'guild',price:250,art:'office-landsraad.png'},emperor:{name:'Emperor',kind:'imperial',price:1000,art:'emperor-v1.png'}});
let libraryPromise;
function script(file){return new Promise((resolve,reject)=>{const node=el('script');node.src=new URL('./vendor/fullcalendar/'+file,import.meta.url).href;node.onload=resolve;node.onerror=()=>reject(Error('Calendar library unavailable.'));document.head.append(node);});}
export function electionDesignStyles(){if(document.querySelector('link[data-election-design]'))return;for(const file of ['./cp-v2-election-design.css','./vendor/fullcalendar/skeleton.css','./vendor/fullcalendar/monarch.css','./vendor/fullcalendar/palette.css']){const css=el('link');css.rel='stylesheet';css.href=new URL(file,import.meta.url).href;css.dataset.electionDesign='';document.head.append(css);}}
async function calendarLibrary(){electionDesignStyles();if(!libraryPromise)libraryPromise=script('fullcalendar.global.min.js').then(()=>script('monarch.global.min.js')).then(()=>globalThis.FullCalendar);return libraryPromise;}
export function mountPromotionAgenda(host,{election='clan_delegate',organisationKind='clan',remindersOnly=false}={}){
electionDesignStyles();const company=organisationKind==='company',generic=election==='clan-promotion',definition=ELECTION_DESIGN_TYPES[election];if(!generic&&!definition)throw Error('Choose a known election agenda.');
const kind=definition?.kind||'clan_delegate',start=electionDates(kind,Date.now(),1)[0],votingStart=new Date(start),campaignStart=new Date(votingStart.getTime()-7*86400000),initial=generic?new Date():new Date(campaignStart);initial.setUTCHours(0,0,0,0);
let active=true,calendar=null,featured=true;const selected=new Map(),busyDate=new Date(initial);busyDate.setUTCHours(generic?10:Math.min(23,campaignStart.getUTCHours()+1));const occupied=busyDate.toISOString();
const root=el('section',undefined,'promotion-agenda');root.dataset.election=generic?(company?'company-promotion':'clan-promotion'):election;const title=generic?(company?'Company Promotion Agenda':'Clan Promotion Agenda'):definition.name+' · '+(remindersOnly?'Election Calendar':'Campaign Agenda');
root.append(el('small',remindersOnly?'ELECTION TIMETABLE':'ADVERTISER WORKSPACE','election-eyebrow'),el('h2',title),el('p',remindersOnly?'Existing election timetable · all times GMT / UTC.':'DESIGN PREVIEW · example availability only. Selections are local to this screen; no slot or funds are reserved.','election-preview-notice'));
if(!generic&&!remindersOnly)root.append(el('p','This agenda belongs only to this election. Advertisements may run from seven days before voting until voting opens.','election-muted'));
const toolbar=el('div',undefined,'promotion-tools'),placement=el('select'),label=el('label','Placement');placement.setAttribute('aria-label','Advertisement placement');for(const [value,name]of [['featured','Featured · exclusive hourly slot'],['standard','Standard advertisement']]){const option=el('option',name);option.value=value;placement.append(option);}label.append(placement);toolbar.append(label);if(!remindersOnly)root.append(toolbar);
const layout=el('div',undefined,'promotion-booking-layout'),area=el('div',undefined,'promotion-calendar'),aside=el('aside',undefined,'promotion-summary'),summary=el('p','Select one or more free hours.'),timeButtons=el('div',undefined,'promotion-hour-buttons');area.setAttribute('aria-label',title);const calendarStatus=el('p','Loading the locally hosted calendar…');area.append(calendarStatus);aside.append(el('h3','Your booking preview'),summary,el('p',generic?'Promotion tariff to be confirmed.':definition.price+' DM per hour · base campaign rate.'),el('p','Featured surcharge to be confirmed.','election-muted'),el('strong','No payment or reservation is submitted.'));
const confirm=el('button','Confirm booking · available in commit 2');confirm.type='button';confirm.disabled=true;aside.append(confirm);layout.append(area);if(!remindersOnly)layout.append(aside);root.append(layout);if(!remindersOnly){const legend=el('div',undefined,'promotion-legend');for(const [state,text]of [['free','Free'],['booked','Booked · example'],['selected','Your selection'],['reminder','Election reminder · not bookable']])legend.append(el('span',text,'promotion-state-'+state));root.append(legend,el('h3','Choose hours with one click'),timeButtons);const preview=el('section',undefined,'promotion-ad-preview');preview.append(el('h3',company?'Starport advertisement preview':'Starport campaign panel preview'),createListingCard({type:generic?'ad':'campaign',image:generic?'https://www.dunerealms.com/assets/'+(company?'guild.webp':'nav-clan-v2.webp'):'https://www.dunerealms.com/assets/seals/'+definition.art,title:generic?(company?'Your company, your next chapter':'Your clan advertisement'):'Your campaign headline',subtitle:generic?(company?'Company advertisement':'Clan advertisement'):definition.name+' · Example candidate',message:company?'Your company logo and advertisement message appear here.':'Your portrait, House identity and campaign message appear here.',featured:true,duration:'1 hour · design example'},{preview:true}));root.append(preview);}
host.replaceChildren(root);
function sync(){summary.textContent=selected.size?selected.size+' hour(s) selected'+(!generic?' · base '+(selected.size*definition.price).toFixed(2)+' DM':'')+(featured?' · Featured surcharge pending.':'.'):'Select one or more free hours.';if(!calendar)return;for(const event of calendar.getEvents())if(event.id.startsWith('selection-'))event.remove();for(const [iso]of selected)calendar.addEvent({id:'selection-'+iso,title:'Your selection · preview',start:iso,end:new Date(Date.parse(iso)+3600000).toISOString(),classNames:['promotion-selected']});drawHours();}
function pick(date){if(remindersOnly)return;const value=new Date(date);value.setUTCMinutes(0,0,0);const iso=value.toISOString();if(!generic&&(value<campaignStart||value>=votingStart))return;if(featured&&iso===occupied)return;if(selected.has(iso))selected.delete(iso);else selected.set(iso,true);sync();}
function drawHours(){timeButtons.replaceChildren();if(remindersOnly)return;const day=new Date(calendar?.view?.activeStart||initial);day.setUTCHours(0,0,0,0);for(let hour=8;hour<20;hour++){const date=new Date(day);date.setUTCHours(hour);const iso=date.toISOString(),blocked=featured&&iso===occupied,outside=!generic&&(date<campaignStart||date>=votingStart),button=el('button',String(hour).padStart(2,'0')+':00 · '+(outside?'Outside campaign':blocked?'Booked':selected.has(iso)?'Selected':'Free'));button.type='button';button.disabled=blocked||outside;button.setAttribute('aria-pressed',String(selected.has(iso)));button.onclick=()=>pick(date);timeButtons.append(button);}}
placement.onchange=()=>{featured=placement.value==='featured';selected.clear();if(calendar){calendar.getEventById('preview-booked')?.remove();if(featured)calendar.addEvent({id:'preview-booked',title:'Booked · example',start:occupied,end:new Date(Date.parse(occupied)+3600000).toISOString(),classNames:['promotion-booked']});}sync();};
calendarLibrary().then(({Calendar})=>{if(!active)return;area.replaceChildren();const events=[];if(remindersOnly){events.push({id:'vote',title:'Voting · 3 hours',start,end:new Date(votingStart.getTime()+3*3600000).toISOString(),classNames:['promotion-reminder']},{id:'deadline',title:'Applications close · voting starts',start,classNames:['promotion-reminder']});}else{events.push({id:'preview-booked',title:'Booked · example',start:occupied,end:new Date(Date.parse(occupied)+3600000).toISOString(),classNames:['promotion-booked']});if(!generic)events.push({id:'campaign-close',title:'Campaign advertising closes · voting starts',start,classNames:['promotion-reminder']});}
calendar=new Calendar(area,{initialView:remindersOnly?'dayGridMonth':matchMedia('(max-width:700px)').matches?'timeGridDay':'timeGridWeek',initialDate:remindersOnly?start:initial.toISOString(),timeZone:'UTC',headerToolbar:{left:'prev,next',center:'title',right:remindersOnly?'dayGridMonth,listMonth':'timeGridWeek,timeGridDay'},height:remindersOnly?'auto':650,allDaySlot:false,slotDuration:'01:00:00',slotMinTime:'00:00:00',slotMaxTime:'24:00:00',scrollTime:'08:00:00',firstDay:0,weekends:true,nowIndicator:false,editable:false,selectable:false,events,eventClass:({event})=>event.id.startsWith('selection-')?'promotion-selected':event.id==='preview-booked'?'promotion-booked':'promotion-reminder',slotLabelFormat:{hour:'2-digit',minute:'2-digit',hour12:false},dateClick:info=>{if(!info.allDay)pick(info.dateStr);},eventClick:info=>{if(info.event.id.startsWith('selection-'))pick(info.event.startStr);},datesSet:()=>drawHours(),eventTimeFormat:{hour:'2-digit',minute:'2-digit',hour12:false}});calendar.render();drawHours();}).catch(error=>{if(active)calendarStatus.textContent=error.message;});
return()=>{active=false;calendar?.destroy();root.remove();};
}

View file

@ -1,51 +1,52 @@
import {createCPV2Page,element as el} from './cp-v2-page-template.mjs';
import {createUserAPI} from './cp-v2-user-api.mjs';
export function questRows(data,{query='',status='',page=1}={}){
if(typeof data?.linked!=='boolean'||!Array.isArray(data.quests))throw Error('Quest records could not be confirmed.');
const filtered=data.quests.filter(row=>(!status||row.status===status)&&[row.title,row.description,row.status].join(' ').toLowerCase().includes(query.trim().toLowerCase())).sort((a,b)=>Number(b.assignedAt||0)-Number(a.assignedAt||0));
const pages=Math.max(1,Math.ceil(filtered.length/12)),current=Math.max(1,Math.min(pages,Number.isSafeInteger(page)?page:1));
return {rows:filtered.slice((current-1)*12,current*12),pages,page:current,total:filtered.length};
}
export function mountUserPage(host,id,{fetcher=fetch,initialTab,listingId}={}){
let active=true,dispose=()=>{};const controller=new AbortController(),api=createUserAPI(fetcher,controller.signal);
host.replaceChildren(el('p','Opening your user workspace…','cp-v2-news-status'));
import {createCPV2Page,element as el} from './cp-v2-page-template.mjs';
import {createUserAPI} from './cp-v2-user-api.mjs';
export function questRows(data,{query='',status='',page=1}={}){
if(typeof data?.linked!=='boolean'||!Array.isArray(data.quests))throw Error('Quest records could not be confirmed.');
const filtered=data.quests.filter(row=>(!status||row.status===status)&&[row.title,row.description,row.status].join(' ').toLowerCase().includes(query.trim().toLowerCase())).sort((a,b)=>Number(b.assignedAt||0)-Number(a.assignedAt||0));
const pages=Math.max(1,Math.ceil(filtered.length/12)),current=Math.max(1,Math.min(pages,Number.isSafeInteger(page)?page:1));
return {rows:filtered.slice((current-1)*12,current*12),pages,page:current,total:filtered.length};
}
export function mountUserPage(host,id,{fetcher=fetch,initialTab,listingId}={}){
let active=true,dispose=()=>{};const controller=new AbortController(),api=createUserAPI(fetcher,controller.signal);
host.replaceChildren(el('p','Opening your user workspace…','cp-v2-news-status'));
async function mount(){
if(['item-exchange','item-listings','item-post'].includes(id)){const {mountExchangeDesign}=await import('./cp-v2-exchange-design.mjs');if(active)dispose=mountExchangeDesign(host,{context:'user',view:id==='item-listings'?'mine':id==='item-post'?'post':'browse',fetcher});return;}
const loaders={game:['./cp-v2-passport.mjs','mountPassport'],'site-profile':['./cp-v2-personal-records.mjs','mountPersonalRecords'],security:['./cp-v2-security.mjs','mountSecurity'],'rewards-codes':['./cp-v2-rewards.mjs','mountRewards']};
if(loaders[id]){const [path,key]=loaders[id],module=await import(path);if(active)dispose=module[key](host,{fetcher,initialTab});return;}
if(['personal-bank','transactions'].includes(id)){const {mountBankPage}=await import('./cp-v2-bank-pages.mjs');if(active)dispose=mountBankPage(host,id==='transactions'?'bank-statements':'personal-bank',{fetcher});return;}
if(['tickets','clans','shared-inbox','kits-exchange'].includes(id)){const {mountNativeService}=await import('./cp-v2-native-services.mjs');if(active)dispose=mountNativeService(host,id,{fetcher,singleHeading:true,initialTab,listingId});return;}
if(id==='planetary-inventory'){
const {mountInventory}=await import('/inventory/inventory-view.mjs');if(!active)return;
if(!document.querySelector('link[data-v2-inventory]')){const css=el('link');css.rel='stylesheet';css.href='/inventory/inventory.css';css.dataset.v2Inventory='true';document.head.append(css);}
const inventory=el('div',undefined,'cp-v2-user-inventory');
const {root}=createCPV2Page({shellHost:host,title:'My Inventory',description:'Your saved planetary equipment and exchange history, connected to the existing game inventory service.',artwork:'nav-account-v2.webp',tabs:[{id:'inventory-record',label:'Equipment & ledger',content:inventory}]});host.replaceChildren(root);
const view=mountInventory(inventory,{request:api.request,visibleTabs:['inventory','history'],title:'Saved inventory'});dispose=()=>{view.clear();root.remove();};return;
}
if(['shop-settings','exchange-settings'].includes(id)){const {mountUserCommerce}=await import('./cp-v2-user-commerce.mjs');if(active)dispose=mountUserCommerce(host,id,{fetcher});return;}
if(id==='quests'){mountQuests();return;}
if(id==='discord-link'){
const box=el('section',undefined,'cp-v2-personal-box'),{root}=createCPV2Page({shellHost:host,title:'Discord Link',description:'Your Discord community presence and account-linking availability.',artwork:'nav-discord-v2.webp',tabs:[{id:'discord-identity',label:'Discord identity',content:box}]});host.replaceChildren(root);
box.append(el('h4','Community connection'),el('p','Loading your public Discord record…'));const data=await api.request('/api/account/profile');if(!active)return;box.replaceChildren(el('h4','Community connection'));
const url=data.profile?.socials?.discord;let valid=false;try{const parsed=new URL(url);valid=parsed.protocol==='https:'&&!parsed.username&&!parsed.password&&['discord.com','discord.gg'].some(domain=>parsed.hostname===domain||parsed.hostname.endsWith('.'+domain));}catch{}
if(valid){const link=el('a','Open your saved Discord link ↗');link.href=url;link.target='_blank';link.rel='noopener noreferrer';box.append(link);}else box.append(el('p','No Discord social link is saved.'));
const edit=el('a','Edit social links');edit.href='#realm/site-profile';const unavailable=el('button','Verified account linking · not available');unavailable.type='button';unavailable.disabled=true;box.append(edit,el('p','Your saved social link is not a verified Discord account connection. The current API does not provide an account-linking service.'),unavailable);dispose=()=>root.remove();return;
}
throw Error('This user workspace has not been connected.');
}
function mountQuests(){
let data=null,page=1,loading=false;
const box=el('section'),status=el('p','Opening your quest record…'),tools=el('div',undefined,'cp-v2-company-actions'),search=el('input'),filter=el('select'),refresh=el('button','Refresh quests'),cards=el('div',undefined,'cp-v2-user-quests'),nav=el('nav',undefined,'cp-v2-company-actions');status.setAttribute('role','status');nav.setAttribute('aria-label','Quest history pages');search.type='search';search.placeholder='Search your quests';search.setAttribute('aria-label','Search your quests');filter.setAttribute('aria-label','Quest status');refresh.type='button';tools.append(search,filter,refresh);box.append(status,tools,cards,nav);
const {root}=createCPV2Page({shellHost:host,title:'Contracts & Quests',description:'Your current assignments and retained quest history from the game engine.',artwork:'nav-manual-v2.webp',tabs:[{id:'quest-record',label:'Quest journal',content:box}]});host.replaceChildren(root);
const date=value=>value?new Date(Number(value)).toLocaleString():'—';
function render(){cards.replaceChildren();nav.replaceChildren();if(!data.linked){const link=el('a','Open Citizen Passport to link Minecraft');link.href='#realm/game';cards.append(el('p','Link your Minecraft identity to see your quests.'),link);return;}
const result=questRows(data,{query:search.value,status:filter.value,page});page=result.page;for(const row of result.rows){const card=el('article');card.dataset.status=row.status;card.append(el('h4',row.title),el('p',row.description),el('strong',row.status),el('p','Assigned '+date(row.assignedAt)+' · Deadline '+date(row.deadlineAt)));if(row.completedAt)card.append(el('small','Completed '+date(row.completedAt)));cards.append(card);}if(!result.total)cards.append(el('p','No quests match this view. Assigned adventures will appear here.'));
const previous=el('button','← Previous'),next=el('button','Next →');previous.type=next.type='button';previous.disabled=page<=1;next.disabled=page>=result.pages;previous.onclick=()=>{page--;render();};next.onclick=()=>{page++;render();};nav.append(previous,el('span','Page '+page+' of '+result.pages),next);
}
async function load(){if(loading)return;loading=true;refresh.disabled=true;try{const result=await api.request('/api/quests');if(!active)return;if(result.linked===false&&!result.quests)result.quests=[];questRows(result);data=result;const chosen=filter.value;filter.replaceChildren();for(const value of ['',...new Set(data.quests.map(row=>row.status))]){const option=el('option',value||'All statuses');option.value=value;filter.append(option);}filter.value=[...filter.children].some(row=>row.value===chosen)?chosen:'';render();status.textContent='Quest state confirmed by the game engine.';}catch(error){if(active){status.textContent=error.message;cards.replaceChildren();nav.replaceChildren();}}finally{loading=false;if(active)refresh.disabled=false;}}
search.oninput=filter.onchange=()=>{page=1;if(data)render();};refresh.onclick=()=>void load();void load();dispose=()=>root.remove();
}
void mount().catch(error=>{if(active)host.replaceChildren(el('p',error.message,'cp-v2-news-status'));});
return()=>{active=false;controller.abort();dispose();};
}
if(id==='citizen-elections'){const {mountElectionDesign}=await import('./cp-v2-election-design.mjs');if(active)dispose=mountElectionDesign(host,{context:'citizen'});return;}
const loaders={game:['./cp-v2-passport.mjs','mountPassport'],'site-profile':['./cp-v2-personal-records.mjs','mountPersonalRecords'],security:['./cp-v2-security.mjs','mountSecurity'],'rewards-codes':['./cp-v2-rewards.mjs','mountRewards']};
if(loaders[id]){const [path,key]=loaders[id],module=await import(path);if(active)dispose=module[key](host,{fetcher,initialTab});return;}
if(['personal-bank','transactions'].includes(id)){const {mountBankPage}=await import('./cp-v2-bank-pages.mjs');if(active)dispose=mountBankPage(host,id==='transactions'?'bank-statements':'personal-bank',{fetcher});return;}
if(['tickets','clans','shared-inbox','kits-exchange'].includes(id)){const {mountNativeService}=await import('./cp-v2-native-services.mjs');if(active)dispose=mountNativeService(host,id,{fetcher,singleHeading:true,initialTab,listingId});return;}
if(id==='planetary-inventory'){
const {mountInventory}=await import('/inventory/inventory-view.mjs');if(!active)return;
if(!document.querySelector('link[data-v2-inventory]')){const css=el('link');css.rel='stylesheet';css.href='/inventory/inventory.css';css.dataset.v2Inventory='true';document.head.append(css);}
const inventory=el('div',undefined,'cp-v2-user-inventory');
const {root}=createCPV2Page({shellHost:host,title:'My Inventory',description:'Your saved planetary equipment and exchange history, connected to the existing game inventory service.',artwork:'nav-account-v2.webp',tabs:[{id:'inventory-record',label:'Equipment & ledger',content:inventory}]});host.replaceChildren(root);
const view=mountInventory(inventory,{request:api.request,visibleTabs:['inventory','history'],title:'Saved inventory'});dispose=()=>{view.clear();root.remove();};return;
}
if(['shop-settings','exchange-settings'].includes(id)){const {mountUserCommerce}=await import('./cp-v2-user-commerce.mjs');if(active)dispose=mountUserCommerce(host,id,{fetcher});return;}
if(id==='quests'){mountQuests();return;}
if(id==='discord-link'){
const box=el('section',undefined,'cp-v2-personal-box'),{root}=createCPV2Page({shellHost:host,title:'Discord Link',description:'Your Discord community presence and account-linking availability.',artwork:'nav-discord-v2.webp',tabs:[{id:'discord-identity',label:'Discord identity',content:box}]});host.replaceChildren(root);
box.append(el('h4','Community connection'),el('p','Loading your public Discord record…'));const data=await api.request('/api/account/profile');if(!active)return;box.replaceChildren(el('h4','Community connection'));
const url=data.profile?.socials?.discord;let valid=false;try{const parsed=new URL(url);valid=parsed.protocol==='https:'&&!parsed.username&&!parsed.password&&['discord.com','discord.gg'].some(domain=>parsed.hostname===domain||parsed.hostname.endsWith('.'+domain));}catch{}
if(valid){const link=el('a','Open your saved Discord link ↗');link.href=url;link.target='_blank';link.rel='noopener noreferrer';box.append(link);}else box.append(el('p','No Discord social link is saved.'));
const edit=el('a','Edit social links');edit.href='#realm/site-profile';const unavailable=el('button','Verified account linking · not available');unavailable.type='button';unavailable.disabled=true;box.append(edit,el('p','Your saved social link is not a verified Discord account connection. The current API does not provide an account-linking service.'),unavailable);dispose=()=>root.remove();return;
}
throw Error('This user workspace has not been connected.');
}
function mountQuests(){
let data=null,page=1,loading=false;
const box=el('section'),status=el('p','Opening your quest record…'),tools=el('div',undefined,'cp-v2-company-actions'),search=el('input'),filter=el('select'),refresh=el('button','Refresh quests'),cards=el('div',undefined,'cp-v2-user-quests'),nav=el('nav',undefined,'cp-v2-company-actions');status.setAttribute('role','status');nav.setAttribute('aria-label','Quest history pages');search.type='search';search.placeholder='Search your quests';search.setAttribute('aria-label','Search your quests');filter.setAttribute('aria-label','Quest status');refresh.type='button';tools.append(search,filter,refresh);box.append(status,tools,cards,nav);
const {root}=createCPV2Page({shellHost:host,title:'Contracts & Quests',description:'Your current assignments and retained quest history from the game engine.',artwork:'nav-manual-v2.webp',tabs:[{id:'quest-record',label:'Quest journal',content:box}]});host.replaceChildren(root);
const date=value=>value?new Date(Number(value)).toLocaleString():'—';
function render(){cards.replaceChildren();nav.replaceChildren();if(!data.linked){const link=el('a','Open Citizen Passport to link Minecraft');link.href='#realm/game';cards.append(el('p','Link your Minecraft identity to see your quests.'),link);return;}
const result=questRows(data,{query:search.value,status:filter.value,page});page=result.page;for(const row of result.rows){const card=el('article');card.dataset.status=row.status;card.append(el('h4',row.title),el('p',row.description),el('strong',row.status),el('p','Assigned '+date(row.assignedAt)+' · Deadline '+date(row.deadlineAt)));if(row.completedAt)card.append(el('small','Completed '+date(row.completedAt)));cards.append(card);}if(!result.total)cards.append(el('p','No quests match this view. Assigned adventures will appear here.'));
const previous=el('button','← Previous'),next=el('button','Next →');previous.type=next.type='button';previous.disabled=page<=1;next.disabled=page>=result.pages;previous.onclick=()=>{page--;render();};next.onclick=()=>{page++;render();};nav.append(previous,el('span','Page '+page+' of '+result.pages),next);
}
async function load(){if(loading)return;loading=true;refresh.disabled=true;try{const result=await api.request('/api/quests');if(!active)return;if(result.linked===false&&!result.quests)result.quests=[];questRows(result);data=result;const chosen=filter.value;filter.replaceChildren();for(const value of ['',...new Set(data.quests.map(row=>row.status))]){const option=el('option',value||'All statuses');option.value=value;filter.append(option);}filter.value=[...filter.children].some(row=>row.value===chosen)?chosen:'';render();status.textContent='Quest state confirmed by the game engine.';}catch(error){if(active){status.textContent=error.message;cards.replaceChildren();nav.replaceChildren();}}finally{loading=false;if(active)refresh.disabled=false;}}
search.oninput=filter.onchange=()=>{page=1;if(data)render();};refresh.onclick=()=>void load();void load();dispose=()=>root.remove();
}
void mount().catch(error=>{if(active)host.replaceChildren(el('p',error.message,'cp-v2-news-status'));});
return()=>{active=false;controller.abort();dispose();};
}

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,22 @@
MIT License
Copyright (c) 2026 Adam Shaw
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View file

@ -0,0 +1,7 @@
{
"package": "fullcalendar",
"version": "7.1.5",
"license": "MIT",
"source": "https://registry.npmjs.org/fullcalendar/7.1.5",
"premium": false
}

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,105 @@
:root {
/* primary */
--fc-monarch-primary: #6750A4;
--fc-monarch-primary-foreground: #FFFFFF;
--fc-monarch-primary-over: #7461ae;
--fc-monarch-primary-down: #8272b7;
/* secondary */
--fc-monarch-secondary: #EADDFF;
--fc-monarch-secondary-foreground: #4F378B;
--fc-monarch-secondary-over: #ddd1f1;
--fc-monarch-secondary-down: #d0c4e3;
/* tertiary */
--fc-monarch-tertiary: #895264;
--fc-monarch-tertiary-foreground: #FFFFFF;
--fc-monarch-tertiary-over: #956272;
--fc-monarch-tertiary-down: #a17381;
/* calendar content */
--fc-monarch-event: var(--fc-monarch-primary);
--fc-monarch-event-contrast: var(--fc-monarch-primary-foreground);
--fc-monarch-highlight: #eaddff4D;
--fc-monarch-now: #B3261E;
/* controls */
--fc-monarch-selected: #625B71;
--fc-monarch-selected-foreground: #FFFFFF;
--fc-monarch-selected-over: #706a7e;
--fc-monarch-selected-down: #7f798c;
--fc-monarch-outline: #ff9dbb;
/* popover */
--fc-monarch-popover: var(--fc-monarch-background);
/* neutral backgrounds */
--fc-monarch-background: #ffffff;
--fc-monarch-faint: #79697b1A;
--fc-monarch-muted: #79697b26;
--fc-monarch-strong: #79697b4D;
--fc-monarch-stronger: #79697b59;
--fc-monarch-strongest: #79697b66;
/* neutral foregrounds */
--fc-monarch-foreground: #0c090c;
--fc-monarch-faint-foreground: #bebebe;
--fc-monarch-muted-foreground: #8d8d8d;
/* neutral borders */
--fc-monarch-border: #dedce1;
--fc-monarch-strong-border: #bcbabe;
}
@media not print {
[data-color-scheme=dark] {
/* primary */
--fc-monarch-primary: #D0BCFF;
--fc-monarch-primary-foreground: #381E72;
--fc-monarch-primary-over: #d5c3ff;
--fc-monarch-primary-down: #d9caff;
/* secondary */
--fc-monarch-secondary: #4F378B;
--fc-monarch-secondary-foreground: #EADDFF;
--fc-monarch-secondary-over: #564191;
--fc-monarch-secondary-down: #5e4b97;
/* tertiary */
--fc-monarch-tertiary: #EFB8C8;
--fc-monarch-tertiary-foreground: #492532;
--fc-monarch-tertiary-over: #f1bfcd;
--fc-monarch-tertiary-down: #f3c6d3;
/* calendar content */
--fc-monarch-event: var(--fc-monarch-primary);
--fc-monarch-event-contrast: var(--fc-monarch-primary-foreground);
--fc-monarch-highlight: #4f378b4D;
--fc-monarch-now: #F2B8B5;
/* controls */
--fc-monarch-selected: #CCC2DC;
--fc-monarch-selected-foreground: #332D41;
--fc-monarch-selected-over: #d1c8e0;
--fc-monarch-selected-down: #d6cee3;
--fc-monarch-outline: #ff8a9e;
/* popover */
--fc-monarch-popover: rgb(26 17 15);
--fc-monarch-popover-foreground: rgb(241 223 218);
/* neutral backgrounds */
--fc-monarch-background: #030712;
/* neutral foregrounds */
--fc-monarch-foreground: #ffffff;
--fc-monarch-faint-foreground: #898989;
--fc-monarch-muted-foreground: #b0b0b0;
/* neutral borders */
--fc-monarch-border: #323036;
--fc-monarch-strong-border: #615d67;
}
}

View file

@ -0,0 +1,514 @@
:root {
--fc-sticky-header-footer-z: 3;
--fc-popover-z: 4;
}
/* Z-index */
/* ------------------------------------------------------------------------------------------------- */
/*
The stacking order is FullCalendar's, so these are !important, like the rest of this file. They come
before the sticky and popover rules, which win on an element that has both.
*/
.fc-5r {
z-index: 0 !important;
}
.fc-de {
z-index: 1 !important;
}
.fc-h9 {
z-index: 2 !important;
}
.fc-Ox {
z-index: 3 !important;
}
.fc-4g {
z-index: 4 !important;
}
.fc-zk {
z-index: 5 !important;
}
.fc-a0 {
z-index: 1000 !important;
}
.fc-ql {
z-index: 9999 !important;
}
.fc-RJ:focus-visible {
z-index: 2 !important;
}
.fc-7k {
z-index: var(--fc-popover-z) !important;
}
.fc-tX {
isolation: isolate !important;
}
/*
This will prevent all ancestors from customizing their box size unless they use .contentBox
*/
.fc-Wz,
.fc-Wz *,
.fc-Wz *:before,
.fc-Wz *:after {
box-sizing: border-box !important;
}
/* classes attached to <body> */
.fc-NA,
.fc-NA * {
cursor: not-allowed !important;
}
.fc-vt {
-ms-overflow-style: none !important; /* IE and Edge */
scrollbar-width: none !important; /* Firefox */
}
/* Hide scrollbar for Chrome, Safari and Opera */
.fc-vt::-webkit-scrollbar {
display: none !important;
}
.fc-YA {
flex-shrink: 0 !important;
}
.fc-uw .fc-De {
display: flex !important;
flex-direction: row !important;
flex-wrap: wrap !important;
}
/* HACK for Safari. Can't do break-inside:avoid with flexbox items, likely b/c it's not standard:
https://stackoverflow.com/a/60256345 */
.fc-ZA .fc-De > * {
float: left !important;
}
[dir=rtl] .fc-ZA .fc-De > *,
.fc-ZA[dir=rtl] .fc-De > * {
float: right !important;
}
.fc-ZA .fc-De::after {
content: "" !important;
display: block !important;
clear: both !important;
}
.fc-jF {
cursor: pointer !important;
}
.fc-TD {
cursor: n-resize !important;
}
.fc-3Z {
cursor: s-resize !important;
}
.fc-dx {
cursor: w-resize !important;
}
[dir=rtl] .fc-dx {
cursor: e-resize !important;
}
.fc-ec {
cursor: e-resize !important;
}
[dir=rtl] .fc-ec {
cursor: w-resize !important;
}
.fc-AA {
cursor: col-resize !important;
}
.fc-ai,
.fc-bx,
.fc-i9 {
position: absolute !important;
box-sizing: content-box !important;
width: 100% !important;
height: 100% !important;
}
.fc-ai {
padding: 10px !important;
margin: -10px !important;
}
.fc-bx {
padding-left: 10px !important;
padding-right: 10px !important;
margin-left: -10px !important;
margin-right: -10px !important;
}
.fc-i9 {
padding-top: 10px !important;
padding-bottom: 10px !important;
margin-top: -10px !important;
margin-bottom: -10px !important;
}
/* QUESTION: why not use -left -right instead of negative margins/padding for ALL? */
.fc-hx {
position: absolute !important;
top: 0 !important;
bottom: 0 !important;
left: -5px !important;
right: -5px !important;
}
.fc-fg {
-webkit-user-select: none !important;
-moz-user-select: none !important;
user-select: none !important;
}
/* Border Utils */
/* ------------------------------------------------------------------------------------------------- */
.fc-4z {
border: 0 !important;
}
.fc-ca {
border-left: 0 !important;
border-right: 0 !important;
}
.fc-Zq {
border-top: 0 !important;
border-bottom: 0 !important;
}
.fc-Im {
border-top: 0 !important;
}
.fc-67 {
border-bottom: 0 !important;
}
.fc-MR {
border-inline-start: 0 !important;
}
.fc-Y4 {
border-inline-end: 0 !important;
}
/* Flexbox Utils */
/* ------------------------------------------------------------------------------------------------- */
.fc-lJ {
display: flex !important;
flex-direction: row !important;
}
.fc-Xt {
display: flex !important;
flex-direction: column !important;
}
.fc-0U {
flex-grow: 1 !important;
}
.fc-6W {
flex-grow: 1 !important;
flex-basis: 0 !important;
min-width: 0 !important;
min-height: 0 !important;
}
.fc-jx {
min-height: 0 !important;
}
/*
TODO: use liquidX/Y elsewhere because frees up min other dimension; less collisions
*/
.fc-p5 {
flex-grow: 1 !important;
flex-basis: 0 !important;
min-width: 0 !important;
}
/* Semantic Print Table */
/* ------------------------------------------------------------------------------------------------- */
.fc-wU {
width: 100% !important;
table-layout: fixed !important;
border: 0 !important;
border-collapse: separate !important;
border-spacing: 0 !important;
}
.fc-wU > thead {
/* Both properties are needed for cross-browser repeated headers across printed pages. */
-moz-column-break-inside: avoid !important;
break-inside: avoid !important;
page-break-inside: avoid !important;
}
.fc-wU > tbody {
/* Timeline print-layout hack (resource and non-resource): lets shared absolute backgrounds show through. */
background: transparent !important;
}
.fc-wU > thead > tr > th,
.fc-wU > tbody > tr > th,
.fc-wU > tbody > tr > td {
vertical-align: top !important;
font-weight: inherit !important;
text-align: inherit !important;
}
/* Table Utils */
/* ------------------------------------------------------------------------------------------------- */
.fc-jj {
padding: 0 !important;
}
.fc-jf {
padding-top: 0 !important;
padding-bottom: 0 !important;
}
.fc-Kp {
margin: 0 !important;
}
.fc-G5 {
margin-top: 0 !important;
margin-bottom: 0 !important;
}
.fc-Ut {
margin-left: 0 !important;
margin-right: 0 !important;
}
.fc-Eu {
white-space: nowrap !important;
}
.fc-Ex {
white-space: pre !important;
}
/* Misc Utils */
/* ------------------------------------------------------------------------------------------------- */
.fc-FS {
overflow-anchor: none !important;
}
.fc-A2 {
pointer-events: none !important;
}
.fc-ip {
overflow: hidden !important;
}
/*
TODO: eventually use this on daygrid/timegrid events' inner, time, and title, FOR PRINT
Needed to prevent wrapping to multiple lines, increasing height, throwing off print-positioning,
which can't rely on dynamic height detection after print-flag activated.
*/
.fc-i0 {
white-space: nowrap !important;
overflow: hidden !important;
}
.fc-hC {
position: relative !important;
}
.fc-My {
position: absolute !important;
}
.fc-X7 {
inset-inline-start: 0 !important;
}
.fc-WB {
inset-inline-end: 0 !important;
}
.fc-YR {
position: absolute !important;
top: 0 !important;
left: 0 !important;
right: 0 !important;
bottom: 0 !important;
}
.fc-dz,
.fc-Db {
position: absolute !important;
left: 0 !important;
right: 0 !important;
}
.fc-QB,
.fc-3q {
position: absolute !important;
top: 0 !important;
bottom: 0 !important;
}
.fc-dz {
top: 0 !important;
}
.fc-3q {
left: 0 !important;
right: 0 !important;
width: 0 !important;
}
@media not print {
.fc-Jx {
position: sticky !important;
}
.fc-Gm {
position: sticky !important;
top: 0 !important;
}
/* Sticks to either left or right (the flex "start") depending on ltr/rtl */
.fc-HK {
position: sticky !important;
inset-inline-start: 0 !important;
}
.fc-cF {
position: sticky !important;
top: 0 !important;
z-index: var(--fc-sticky-header-footer-z) !important;
}
}
/* Only needed when padding/border must be separate from width/height */
.fc-KX {
box-sizing: content-box !important;
}
/* Out of view but keeps its real size, for measurement probes. For screen-reader text, use .srOnly.
Hidden also means not focusable, clickable, or read by screen readers */
.fc-Gb {
position: absolute !important;
left: -10000px !important;
visibility: hidden !important;
}
/* Visually hidden but read by screen readers. Unlike .offscreen, never causes scroll overflow */
.fc-8Z {
position: absolute !important;
width: 1px !important;
height: 1px !important;
margin: 0 !important;
padding: 0 !important;
border: 0 !important;
overflow: hidden !important;
clip-path: inset(50%) !important;
white-space: nowrap !important;
}
.fc-Id {
align-items: center !important;
}
.fc-PS {
align-items: flex-start !important;
}
.fc-Ot {
align-items: flex-end !important;
}
/* Footer Scrollbar */
/* ------------------------------------------------------------------------------------------------- */
.fc-Sm {
position: sticky !important;
bottom: 0 !important;
z-index: var(--fc-sticky-header-footer-z) !important;
}
.fc-Rw > * {
margin-top: -1px !important;
}
.fc-Rw > * > * {
height: 1px !important;
}
/* Print Utils */
/* ------------------------------------------------------------------------------------------------- */
.fc-AH {
-moz-column-break-inside: avoid !important;
break-inside: avoid !important;
page-break-inside: avoid !important;
}
.fc-Xq {
min-height: 4em !important;
}
.fc-sr {
display: flow-root !important;
}
/* INTERNAL MARKER -- used to mark an element for internal significance */
/* ------------------------------------------------------------------------------------------------- */
.fc-Lg {}
.fc-Bq {}
.fc-Nb {}
.fc-Wg {}
.fc-nT {}
.fc-sK {}
.fc-LZ {}
.fc-k1 {}
.fc-CC {}
.fc-Wh {}
.fc-ju {}
.fc-2b {}
.fc-bK {}
.fc-wB {}
.fc-TW {}

Some files were not shown because too many files have changed in this diff Show more