@tempo-kit/plugin-roman 0.0.0-stage → 2.0.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2 @@
1
+ export * from './index.js';
2
+ export { RomanPlugin, default } from './index.js';
@@ -0,0 +1 @@
1
+ "use strict";var Magma;((Magma||={}).plugins||={}).roman=(()=>{var Ve=Object.create;var te=Object.defineProperty;var Ge=Object.getOwnPropertyDescriptor;var Je=Object.getOwnPropertyNames;var qe=Object.getPrototypeOf,Xe=Object.prototype.hasOwnProperty;var Qe=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(r){throw t=0,r}},Ne=(e,t)=>{for(var r in t)te(e,r,{get:t[r],enumerable:!0})},ee=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Je(t))!Xe.call(e,n)&&n!==r&&te(e,n,{get:()=>t[n],enumerable:!(i=Ge(t,n))||i.enumerable});return e},H=(e,t,r)=>(ee(e,t,"default"),r&&ee(r,t,"default")),_e=(e,t,r)=>(r=e!=null?Ve(qe(e)):{},ee(t||!e||!e.__esModule?te(r,"default",{value:e,enumerable:!0}):r,e)),je=e=>ee(te({},"__esModule",{value:!0}),e);var de=Qe((Dt,De)=>{"use strict";De.exports=window.Magma.pluginSdk});var Nt={};Ne(Nt,{ANCHOR_ABLATIVE:()=>M,ANCHOR_ACCUSATIVE:()=>_,ANCHOR_NOMINATIVE:()=>K,ANCHOR_SHORT:()=>A,AUC_OFFSET:()=>W,COUNT_WORDS_ABLATIVE:()=>Re,COUNT_WORDS_ACCUSATIVE:()=>B,LANDMARK_CONSULS:()=>Oe,MOMJ_MONTHS:()=>ue,MONTH_ABLATIVE:()=>x,MONTH_ACCUSATIVE:()=>D,MONTH_NOMINATIVE:()=>Z,MONTH_SHORT:()=>w,RomanPlugin:()=>Q,aucToYear:()=>we,calculateClassicalRomanDate:()=>C,calculateGregorianFromRoman:()=>X,createRomanTokenEvaluator:()=>Ae,default:()=>Ze,findConsulYears:()=>G,formatClassicalRomanDate:()=>E,formatConsuls:()=>$,getConsulCatalog:()=>Rt,getConsulsByYear:()=>Ce,getIdesDay:()=>q,getNonesDay:()=>J,parseClassicalRomanDate:()=>pe,registerConsuls:()=>Ee,resetConsulCatalog:()=>Ot,toAblativeConsulName:()=>ze,yearToAuc:()=>z});var m={};Ne(m,{definePlugin:()=>ye,defineTerm:()=>et});H(m,_e(de()));var ne=_e(de()),ye=e=>(0,ne.definePlugin)({...e,version:"2.0.0-rc.0"}),et=e=>(0,ne.defineTerm)({...e,version:"2.0.0-rc.0"});function re(e,t,r,i,n,o){function s(b){if(b!==void 0&&typeof b!="function")throw new TypeError("Function expected");return b}for(var a=i.kind,c=a==="getter"?"get":a==="setter"?"set":"value",d=!t&&e?i.static?e:e.prototype:null,u=t||(d?Object.getOwnPropertyDescriptor(d,i.name):{}),p,l=!1,f=r.length-1;f>=0;f--){var y={};for(var g in i)y[g]=g==="access"?{}:i[g];for(var g in i.access)y.access[g]=i.access[g];y.addInitializer=function(b){if(l)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(b||null))};var h=(0,r[f])(a==="accessor"?{get:u.get,set:u.set}:u[c],y);if(a==="accessor"){if(h===void 0)continue;if(h===null||typeof h!="object")throw new TypeError("Object expected");(p=s(h.get))&&(u.get=p),(p=s(h.set))&&(u.set=p),(p=s(h.init))&&n.unshift(p)}else(p=s(h))&&(a==="field"?n.unshift(p):u[c]=p)}d&&Object.defineProperty(d,i.name,u),l=!0}function ie(e,t,r){for(var i=arguments.length>2,n=0;n<t.length;n++)r=i?t[n].call(e,r):t[n].call(e);return i?r:void 0}var tt=Symbol.for("$LibraryTarget"),nt=Symbol.for("$LibraryDiscover"),rt=Symbol.for("$LibraryExtensible"),it=Symbol.for("nodejs.util.inspect.custom"),ot=Symbol.for("$LibraryLogConfig"),st=Symbol.for("$LibraryRegistry"),at=Symbol.for("$LibraryRegister"),ct=Symbol.for("$LibrarySerializerRegistry"),lt=Symbol.for("$LibraryMutable"),ut=Symbol.for("$LibraryIdentity"),ft=Symbol.for("$LibraryUnwrapped"),O={$Target:tt,$Discover:nt,$Extensible:rt,$Inspect:it,$LogConfig:ot,$Registry:st,$Register:at,$SerializerRegistry:ct,$Identity:ut,$Mutable:lt,$Unwrapped:ft};function oe(e){let t=e,r=0,i=50;for(;t;){let n=t[O.$Target];if(!n||r>=i)break;t=n,r++}return t}function L(e,t,...r){if(e===null||typeof e!="object"&&typeof e!="function")return!1;let i=oe(e);if(!Object.hasOwn(i,t))return!1;if(r.length===0)return!0;let n=i[t];return Pe(n,r)}function v(e,t,...r){if(e===null||typeof e!="object"&&typeof e!="function")return!1;let i=oe(e);if(!(t in i))return!1;if(r.length===0)return!0;let n=i[t];return Pe(n,r)}function Pe(e,t){for(let r=0;r<t.length;r++){let i=t[r];if(typeof i=="function"){if(i(e))return!0}else if(typeof i=="string"&&mt(e,i.trim().toLowerCase()))return!0}return!1}function mt(e,t){switch(t){case"string":case"number":case"boolean":case"function":case"bigint":case"symbol":case"undefined":return typeof e===t;case"array":return Array.isArray(e);case"null":return e===null;case"object":return e!==null&&!Array.isArray(e)&&typeof e=="object";case"any":case"unknown":return!0;default:return!1}}var pt=[],Me=e=>{if(e===null)return"Null";if(e===void 0)return"Undefined";let t=typeof e;if(t==="string")return"String";if(t==="number")return"Number";if(t==="boolean")return"Boolean";if(t==="bigint")return"BigInt";if(t==="symbol")return"Symbol";try{let r=t==="object"?oe(e):e;return Object.prototype.toString.call(r).slice(8,-1)}catch{return t==="function"?"Function":"Object"}},ge=e=>{try{let t=e?.[Symbol.toStringTag]??e?.prototype?.[Symbol.toStringTag];if(typeof t=="string")return t}catch{}},xe=(e,...t)=>{let r=e;try{r=e?.[O.$Target]??e}catch{r=e}let i=Me(r);switch(i){case"Function":try{return yt(r)?"Class":"Function"}catch{return"Function"}case"Object":{try{if("length"in r&&Object.keys(r).every(o=>o==="length"||Number.isFinite(Number(o))))return"ArrayLike";for(let o of t){let s=o.class?.[O.$Target]??o.class;if(r===s||s&&r instanceof s)return o.type}let n=globalThis[O.$Registry]??[];for(let o of[...pt,...n]){let s=o.class?.[O.$Target]??o.class;if(r===s||s&&r instanceof s)return o.type}}catch{return"Object"}return"Object"}default:return i}};var dt=/^\s*(class\s|\[native code\])/,yt=e=>{if(typeof e!="function")return!1;let t=e?.[O.$Target]??e;if(!("prototype"in t))return!1;let r=t?.name,i=ge(t);if(t?.[O.$Identity]||t?.prototype?.[O.$Identity]||typeof i=="string"&&i.startsWith("Temporal."))return!0;if(typeof i=="string"&&i.endsWith("Function"))return!1;if((globalThis[O.$Registry]??[]).some(o=>(o.class?.[O.$Target]??o.class)===t||r&&o.type===r||i&&o.type===i))return!0;try{let o=Function.prototype.toString.call(t);if(dt.test(o))return!0;let s=Object.getOwnPropertyDescriptor(t,"prototype");if(s&&s.writable===!1&&!Object.isFrozen(t))return!0;let a=t.prototype;if(a&&Object.getOwnPropertyNames(a).length>2)return!0}catch{return!1}return!1};var he=(e,...t)=>t.includes(xe(e)),gt=e=>e===null||typeof e!="object"&&typeof e!="function",be=e=>!gt(e);var I=e=>typeof e=="string";var $e=e=>he(e,"Object");var se=e=>typeof e=="symbol";var Y=e=>e!=null,k=e=>e===void 0;var Fe=e=>he(e,"Function","AsyncFunction","GeneratorFunction","AsyncGeneratorFunction"),Te=e=>typeof e=="function";var Le=(e,t)=>he(e,"Error")&&(t?e instanceof t:!0);var ve=(e,t)=>{if(!e||typeof e!="object"&&typeof e!="function")return!1;try{return e[t]===!0}catch{return!1}};var ke=e=>e?e.charAt(0).toUpperCase()+e.slice(1):"";function ht(e,t){return ge(e)??(k(t)?e.name||void 0:String(t))}function ae(e,t){let r=(i,n,o,s)=>{let a=o??(I(n)?n:void 0)??(se(n)&&n.description?n.description:void 0)??ht(i,s),c=a?String(a).replace(/^\$/,""):"Instance",d=I(n)||I(o),u=se(n)?n:d?Symbol.for(`Brand.${c}`):Symbol(`Brand.${c}`),p=y=>ve(y,u),l=i.prototype;if(l&&!L(l,u)&&Object.defineProperty(l,u,{value:!0,configurable:!1,writable:!1,enumerable:!1}),l&&!L(l,Symbol.toStringTag)&&Object.defineProperty(l,Symbol.toStringTag,{value:c,configurable:!0,writable:!1,enumerable:!1}),!i.name||i.name!==c)try{Object.defineProperty(i,"name",{value:c,configurable:!0,writable:!1,enumerable:!1})}catch{}let f=`is${ke(c)}`;if(!L(i,f))try{Object.defineProperty(i,f,{value:p,configurable:!0,writable:!1,enumerable:!1})}catch{}if(!L(i,Symbol.hasInstance))try{Object.defineProperty(i,Symbol.hasInstance,{value:function(y){if(L(this,f)){let g=this[f];if(Te(g))return g.call(this,y)}return be(y)&&be(this?.prototype)&&Object.prototype.isPrototypeOf.call(this.prototype,y)},configurable:!0,writable:!1,enumerable:!1})}catch{}return i};return Te(e)&&t?.kind==="class"?r(e,void 0,void 0,t.name):(i,n)=>{let o=I(e)||se(e)?e:void 0,s=I(t)?t:void 0;return r(i,o,s,n?.name)}}var cn=BigInt(Number.MAX_SAFE_INTEGER),ln=BigInt(Number.MIN_SAFE_INTEGER);function Ue(e){if(Le(e))return e;let t=new Error(v(e,"message",I)?e.message:String(e));return $e(e)&&(t.name=v(e,"name","string")?e.name:"Error",v(e,"code","string","number")&&(t.code=e.code),v(e,"stack","string")&&(t.stack=e.stack)),t}var ce=new FinalizationRegistry(e=>{try{Fe(e)&&e()}catch(t){console.error("Finalizer callback error:",t)}}),Se=(()=>{let e=[ae("Finalizer")],t,r=[],i;return class{static{i=this}static{let n=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;re(null,t={value:i},e,{kind:"class",name:i.name,metadata:n},null,r),i=t.value,n&&Object.defineProperty(i,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:n}),ie(i,r)}#e;constructor(n){this.#e=n}register(n,o,s){let a=s??Object.create(null),c=this.#e;ce.register(n,()=>{c(o)},a)}unregister(n){return ce.unregister(n)}static register(n,o,s){let a=s??Object.create(null);return ce.register(n,o,a),()=>ce.unregister(a)}},i})(),dn=Se.isFinalizer;if(typeof globalThis.Temporal>"u")throw new Error("Temporal API is not available. Node 20+ with a polyfill (e.g. @js-temporal/polyfill) is highly recommended. Native Temporal is fully reliable only on Node 26+ (while Node 22 may have instabilities).");try{if(typeof Temporal.Now.zonedDateTimeISO=="function"&&typeof Temporal.Now.zonedDateTimeISO().add!="function")throw new Error("Incomplete Temporal implementation")}catch(e){let t=Ue(e);if(console.warn("Tempo: Native Temporal implementation appears incomplete. Consider loading a polyfill.",t),t.message!=="Incomplete Temporal implementation")throw t}var le=(()=>{let e=[ae("WeakCache")],t,r=[],i;return class{static{i=this}static{let n=typeof Symbol=="function"&&Symbol.metadata?Object.create(null):void 0;re(null,t={value:i},e,{kind:"class",name:i.name,metadata:n},null,r),i=t.value,n&&Object.defineProperty(i,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:n})}#e=new Map;#t;static isWeakCache=n=>typeof n=="object"&&n!==null&&#e in n;constructor(){this.#t=new Se(n=>{let o=this.#e.get(n.key);o&&o.token===n.token&&this.#e.delete(n.key)})}set(n,o){this.delete(n);let s=Object.create(null);return this.#e.set(n,{ref:new WeakRef(o),token:s}),this.#t.register(o,{key:n,token:s},s),this}get(n){let o=this.#e.get(n);if(k(o))return;let s=o.ref.deref();if(k(s)){this.#t.unregister(o.token),this.#e.delete(n);return}return s}has(n){return Y(this.get(n))}getOrSet(n,o){let s=this.get(n);if(Y(s))return s;let a=o(n);return this.set(n,a),a}delete(n){let o=this.#e.get(n);return Y(o)?(this.#e.delete(n),this.#t.unregister(o.token),!0):!1}clear(){for(let n of this.#e.values())this.#t.unregister(n.token);this.#e.clear()}static{ie(i,r)}},i})(),On=le.isWeakCache;var In=new le,Nn=new le;var bt=Object.freeze({MO:1,TU:2,WE:3,TH:4,FR:5,SA:6,SU:7,MON:1,TUE:2,WED:3,THU:4,FRI:5,SAT:6,SUN:7}),Tt=Object.freeze({JAN:1,FEB:2,MAR:3,APR:4,MAY:5,JUN:6,JUL:7,AUG:8,SEP:9,OCT:10,NOV:11,DEC:12}),St=Object.freeze({1:"Monday",2:"Tuesday",3:"Wednesday",4:"Thursday",5:"Friday",6:"Saturday",7:"Sunday"}),We=[0,31,28,31,30,31,30,31,31,30,31,30,31];function N(e,t=!1){return t?(e%4+4)%4===0:e%4===0&&e%100!==0||e%400===0}function U(e,t,r=!1){if(t>=1&&t<=12)return t===2?N(e,r)?29:28:We[t];let i=e+Math.floor((t-1)/12),n=((t-1)%12+12)%12+1;return n===2?N(i,r)?29:28:We[n]}var W=753,ue=new Set([3,5,7,10]),K=Object.freeze({Kalends:"Kalendae",Nones:"Nonae",Ides:"Idus"}),M=Object.freeze({Kalends:"Kalendis",Nones:"Nonis",Ides:"Idibus"}),_=Object.freeze({Kalends:"Kalendas",Nones:"Nonas",Ides:"Idus"}),A=Object.freeze({Kalends:"Kal.",Nones:"Non.",Ides:"Id."}),Z=Object.freeze(["","Januariae","Februariae","Martiae","Apriles","Maiae","Juniae","Juliae","Augustae","Septembres","Octobres","Novembres","Decembres"]),D=Object.freeze(["","Januarias","Februarias","Martias","Apriles","Maias","Junias","Julias","Augustas","Septembres","Octobres","Novembres","Decembres"]),x=Object.freeze(["","Januariis","Februariis","Martiis","Aprilibus","Maiis","Juniis","Juliis","Augustis","Septembribus","Octobribus","Novembribus","Decembribus"]),w=Object.freeze(["","Jan.","Feb.","Mart.","Apr.","Mai.","Jun.","Jul.","Aug.","Sept.","Oct.","Nov.","Dec."]),B=Object.freeze(["","","pridie","tertium","quartum","quintum","sextum","septimum","octavum","nonum","decimum","undecimum","duodecimum","tertium decimum","quartum decimum","quintum decimum","sextum decimum","septimum decimum","duodevicesimum","undevicesimum"]),Re=Object.freeze(["","","pridie","tertio","quarto","quinto","sexto","septimo","octavo","nono","decimo","undecimo","duodecimo","tertio decimo","quarto decimo","quinto decimo","sexto decimo","septimo decimo","duodevicesimo","undevicesimo"]);var Oe=Object.freeze({"-508":["L. Junius Brutus","L. Tarquinius Collatinus"],"-320":["T. Veturius Calvinus II","Sp. Postumius Albinus Caudinus II"],"-279":["P. Valerius Laevinus","Ti. Coruncanius"],"-215":["C. Terentius Varro","L. Aemilius Paullus II"],"-201":["M. Servilius Pulex Geminus","Ti. Claudius Nero"],"-132":["P. Mucius Scaevola","L. Calpurnius Piso Frugi"],"-106":["C. Marius I","L. Cassius Longinus"],"-62":["M. Tullius Cicero","C. Antonius Hybrida"],"-58":["C. Julius Caesar","M. Calpurnius Bibulus"],"-54":["Cn. Pompeius Magnus II","M. Licinius Crassus II"],"-47":["C. Julius Caesar II","P. Servilius Isauricus"],"-43":["C. Julius Caesar V","M. Antonius"],"-42":["C. Vibius Pansa Caetronianus","A. Hirtius"],"-30":["M. Antonius III","Imp. Caesar III"],"-27":["Imp. Caesar VI","M. Agrippa II"],"-26":["Imp. Caesar Augustus VII","M. Agrippa III"],14:["Sex. Pompeius","Sex. Appuleius"],69:["Ser. Galba Caesar Augustus II","T. Vinius"],541:["Anicius Faustus Albinus Basilius"]}),fe=Symbol.for("@tempo-kit/plugin-roman/consuls");function V(){let e=globalThis;return e[fe]||(e[fe]={...Oe}),e[fe]}function Ee(e){let t=V();Object.assign(t,e)}function Rt(){return V()}function Ot(){let e=globalThis;e[fe]={...Oe}}function Ce(e){return V()[e]}function $(e,t="ablative"){let r=V()[e];if(!r||r.length===0)return;if(t==="nominative")return r.join(", ");let i=r.map(ze),n=r.length>1?"coss.":"cos.";return`${i.join(", ")} ${n}`}var Be=Object.freeze({Pulex:"Pulice",pulex:"pulice",Pulcher:"Pulchro",pulcher:"pulchro",Niger:"Nigro",niger:"nigro",Aper:"Apro",aper:"apro"});function ze(e){return e.split(" ").map(t=>/^[A-Z]['a-z]?\.$/.test(t)||/^[IVXLCDM]+$/.test(t)?t:Be[t]?Be[t]:t.endsWith("ius")?t.slice(0,-3)+"io":t.endsWith("us")?t.slice(0,-2)+"o":t.endsWith("o")?t+"ne":t.endsWith("or")||t.endsWith("ar")?t+"e":t.endsWith("as")?t.slice(0,-2)+"a":t.endsWith("es")||t.endsWith("is")?t.slice(0,-2)+"e":t.endsWith("x")?t.slice(0,-1)+"ce":/[bcdfghjklmnpqrstvz]$/i.test(t)?t+"e":t).join(" ")}function G(e){let t=e.trim().toLowerCase();if(!t)return[];let r=t.replace(/[.,;:!?]/g," ").split(/\s+/).filter(o=>o&&!["et","ac","atque","coss","cos","consulibus","consule"].includes(o));if(r.length===0)return[];let i=[],n=V();for(let[o,s]of Object.entries(n)){let a=Number(o),c=s.join(" ").toLowerCase();r.every(u=>!!(c.includes(u)||u.endsWith("one")&&c.includes(u.slice(0,-3)+"o")||u.endsWith("e")&&c.includes(u.slice(0,-1))||u.endsWith("o")&&c.includes(u.slice(0,-1))))&&i.push({year:a,consuls:s,formatted:$(a)})}return i.sort((o,s)=>o.year-s.year)}function E(e,t){let r=t?.case??"customary",i=t?.style??"classical",n=t?.words??!1,o=i==="short",s="";if(e.isBissextile)o?s="a.d. bis VI Kal. Mart.":s="ante diem bis sextum Kalendas Martias";else if(e.relation==="on")if(o)s=`${A[e.anchor]} ${w[e.anchorMonth]}`;else switch(r){case"nominative":s=`${K[e.anchor]} ${Z[e.anchorMonth]}`;break;case"accusative":s=`${_[e.anchor]} ${D[e.anchorMonth]}`;break;default:s=`${M[e.anchor]} ${x[e.anchorMonth]}`;break}else if(e.relation==="pridie")if(o)s=`Prid. ${A[e.anchor]} ${w[e.anchorMonth]}`;else switch(r){case"nominative":s=`Pridie ${K[e.anchor]} ${Z[e.anchorMonth]}`;break;case"ablative":s=`Pridie ${M[e.anchor]} ${x[e.anchorMonth]}`;break;default:s=`Pridie ${_[e.anchor]} ${D[e.anchorMonth]}`;break}else{let a=n&&B[e.count]?B[e.count]:e.romanNumeral||(0,m.toRoman)(e.count);if(o)s=`a.d. ${e.romanNumeral||(0,m.toRoman)(e.count)} ${A[e.anchor]} ${w[e.anchorMonth]}`;else switch(r){case"nominative":s=`ante diem ${a} ${K[e.anchor]} ${Z[e.anchorMonth]}`;break;case"ablative":s=`ante diem ${a} ${M[e.anchor]} ${x[e.anchorMonth]}`;break;default:s=`ante diem ${a} ${_[e.anchor]} ${D[e.anchorMonth]}`;break}}if(t?.auc){let a=t.aucFormat==="numeric"?`AUC ${e.auc}`:`AUC ${(0,m.toRoman)(e.auc)}`;s=`${s} ${a}`}if(t?.casing)switch(t.casing){case"upper":s=s.toUpperCase();break;case"lower":s=s.toLowerCase();break;case"capitalize":s=s.charAt(0).toUpperCase()+s.slice(1);break;default:break}return s}function Ae(e){return(t,r)=>{let n=(r?.modifiers??[]).map(a=>a.toLowerCase());if(n.includes("auc")&&!n.includes("classical")&&!n.includes("short")&&!n.includes("nominative")&&!n.includes("accusative")&&!n.includes("ablative")&&!n.includes("consul")){let a=t.year+753,c=n.includes("num")||n.includes("numeric")?String(a):n.includes("raw")?(0,m.toRoman)(a)||String(a):`AUC ${(0,m.toRoman)(a)||a}`;return n.includes("upper")&&(c=c.toUpperCase()),n.includes("lower")&&(c=c.toLowerCase()),c}if(n.includes("consul")||n.includes("consuls")){let a=n.includes("nominative")||n.includes("nom")?"nominative":"ablative",c=$(t.year,a)??"";return n.includes("upper")&&(c=c.toUpperCase()),n.includes("lower")&&(c=c.toLowerCase()),c}let o=e(t.year,t.month,t.day),s={};return n.includes("short")?s.style="short":s.style="classical",n.includes("nominative")?s.case="nominative":n.includes("accusative")?s.case="accusative":n.includes("ablative")?s.case="ablative":s.case="customary",n.includes("words")&&(s.words=!0),n.includes("auc")&&(s.auc=!0),(n.includes("num")||n.includes("numeric"))&&(s.aucFormat="numeric"),n.includes("upper")?s.casing="upper":n.includes("lower")?s.casing="lower":n.includes("capitalize")&&(s.casing="capitalize"),E(o,s)}}function J(e){return ue.has(e)?7:5}function q(e){return ue.has(e)?15:13}function z(e,t){return t==="BCE"?754-Math.abs(e):t==="CE"?Math.abs(e)+753:e+753}function we(e,t="astronomical"){return t==="historical"?e>=754?Object.freeze({year:e-753,era:"CE"}):e>=1?Object.freeze({year:754-e,era:"BCE"}):Object.freeze({year:Math.abs(e-754)+1,era:"BCE"}):e-753}function C(e,t,r,i){let n=i?.isJulian??!1,o=i?.bissextile??!0,s=N(e,n),a=J(t),c=q(t),d,u=t,p=e,l,f=1,y=!1;r===1?(d="Kalends",l="on",f=1):r<a?(d="Nones",f=a-r+1,l=f===2?"pridie":"ante_diem"):r===a?(d="Nones",l="on",f=1):r<c?(d="Ides",f=c-r+1,l=f===2?"pridie":"ante_diem"):r===c?(d="Ides",l="on",f=1):(d="Kalends",u=t===12?1:t+1,p=t===12?e+1:e,t===2&&s&&o?r===24?(f=6,l="ante_diem",y=!0):r===25?(f=6,l="ante_diem",y=!1):r>25?(f=29-r+2,l=f===2?"pridie":"ante_diem"):(f=30-r,l="ante_diem"):(f=U(e,t,n)-r+2,l=f===2?"pridie":"ante_diem"));let g=l==="ante_diem"&&!y?(0,m.toRoman)(f):"",h="",b="";y?(h="ante diem bis sextum Kalendas Martias",b="a.d. bis VI Kal. Mart."):l==="on"?(h=`${M[d]} ${x[u]}`,b=`${A[d]} ${w[u]}`):l==="pridie"?(h=`Pridie ${_[d]} ${D[u]}`,b=`Prid. ${A[d]} ${w[u]}`):(h=`ante diem ${g} ${_[d]} ${D[u]}`,b=`a.d. ${g} ${A[d]} ${w[u]}`);let Ie=z(e),T={anchor:d,anchorMonth:u,anchorYear:p,relation:l,count:f,romanNumeral:y?"bis VI":g,isBissextile:y,day:r,month:t,year:e,auc:Ie,latin:h,shortLatin:b},S=E(T,{case:"nominative",style:"classical"}),R=E(T,{case:"accusative",style:"classical"}),F=E(T,{case:"ablative",style:"classical"});return Object.freeze({...T,nominative:S,accusative:R,ablative:F,format(j){return E(this,j)}})}function X(e,t,r,i,n=1,o=!1,s=!1,a=!0){if(e==="Kalends"){if(i==="on")return Object.freeze({year:r,month:t,day:1});let u=t===1?12:t-1,p=t===1?r-1:r,l=N(p,s),f=i==="pridie"?2:n;if(u===2&&l&&a)return o?Object.freeze({year:p,month:2,day:24}):f===6&&!o?Object.freeze({year:p,month:2,day:25}):f<6?Object.freeze({year:p,month:2,day:29-f+2}):Object.freeze({year:p,month:2,day:30-f});let y=U(p,u,s);return Object.freeze({year:p,month:u,day:y-f+2})}if(e==="Nones"){let u=J(t);return Object.freeze(i==="on"?{year:r,month:t,day:u}:{year:r,month:t,day:u-(i==="pridie"?2:n)+1})}let c=q(t);return Object.freeze(i==="on"?{year:r,month:t,day:c}:{year:r,month:t,day:c-(i==="pridie"?2:n)+1})}var Ke=e=>e.toLowerCase().replace(/j/g,"i"),Et=Object.freeze({ian:1,feb:2,mar:3,apr:4,mai:5,iun:6,iul:7,aug:8,sep:9,oct:10,nov:11,dec:12}),me=(()=>{let e=new Map;for(let t of[B,Re])t.forEach((r,i)=>{r&&i>2&&e.set(Ke(r),i)});return e})(),Ct=new Set(["bce","bc","ac","aec"]),At=new Set(["ce","ad","ce."]);function He(e){if(e){if(e==="kal"||e.startsWith("kalend")||e==="cal"||e.startsWith("calend"))return"Kalends";if(e==="non"||e==="nonis"||e==="nonas"||e==="nonae"||e==="nones")return"Nones";if(e==="id"||e==="idus"||e==="idibus")return"Ides"}}function wt(e){if(!(!e||e.length<3))return Et[e.slice(0,3)]}function Ye(e){return/^\d+$/.test(e)?Number(e):(0,m.fromRoman)(e)}function pe(e,t){if(typeof e!="string"||!e.trim())throw new TypeError("Tempo.roman.parse requires a non-empty Latin date string");let r=S=>{throw new RangeError(`Unrecognised classical Roman date "${e}": ${S}`)},i=Ke(e).replace(/ab urbe condita/g,"auc").replace(/[.,;()]/g," ").split(/\s+/).filter(Boolean),n=0,o=(S=0)=>i[n+S],s=!1;o()==="ante"&&o(1)==="diem"||o()==="a"&&o(1)==="d"?(n+=2,s=!0):(o()==="ad"||o()==="die")&&(n+=1,s=!0);let a,c=1,d=!1;if(o()==="pridie"||o()==="prid")n+=1,a="pridie",c=2;else if(He(o())&&!s)a="on";else{o()==="bis"&&(n+=1,d=!0);let S=o(1)?`${o()} ${o(1)}`:void 0,R=o()?Ye(o()):NaN;if(S&&me.has(S))c=me.get(S),n+=2;else if(o()&&me.has(o()))c=me.get(o()),n+=1;else if(Number.isFinite(R)&&R>=2)c=R,n+=1;else return r('expected a day count, "pridie", or an anchor (Kalends, Nones, Ides)');c>19&&r("the day count is out of range"),a=c===2?"pridie":"ante_diem"}o()==="ante"&&(n+=1);let u=He(o());if(!u)return r("expected Kalends, Nones or Ides");n+=1;let p=wt(o());if(!p)return r("expected a Latin month name");n+=1,d&&!(c===6&&u==="Kalends"&&p===3)&&r('"bis" is only valid for "ante diem bis sextum Kalendas Martias"');let l=i.slice(n),f;if(l.length){let S=l.indexOf("auc");if(S>=0){let R=Ye(l[S===0?1:S-1]??"");if(!Number.isFinite(R)||R<1||l.length!==2)return r("invalid AUC year");f=R-753}else if(l.length===2&&Ct.has(l[1])&&/^\d+$/.test(l[0]))f=1-Number(l[0]);else if(l.length===2&&At.has(l[1])&&/^\d+$/.test(l[0]))f=Number(l[0]);else if(l.length===1&&/^-?\d+$/.test(l[0]))f=Number(l[0]);else{let R=l.join(" ").replace(/\b(coss?|consulibus|consule)\b/g,"").trim(),F=R?G(R):[];if(F.length===1)f=F[0].year;else return F.length>1?r(`ambiguous consular dating "${R}": multiple years match (${F.map(j=>j.year).join(", ")})`):r(`unexpected trailing text "${l.join(" ")}"`)}}if(f??=t?.year,f===void 0)return r('no year given; add "AUC", "BCE"/"CE", or pass options.year');let y=u==="Kalends"&&p===1&&a!=="on"?f+1:f,{month:g,day:h,year:b}=X(u,p,y,a,c,d,t?.isJulian??!1,t?.bissextile??!0),T=g>=1&&g<=12&&h>=1&&h<=U(b,g,t?.isJulian??!1)?C(b,g,h,t):void 0;return!T||T.anchor!==u||T.anchorMonth!==p||T.relation!==a||T.count!==c||T.isBissextile!==d?r("that expression does not describe a real calendar date"):Object.freeze({year:b,month:g,day:h,auc:T.auc,classical:T})}function P(e){if(!e)throw new TypeError("Invalid date input provided to Tempo.roman");if((0,m.isNumber)(e.yy)&&(0,m.isNumber)(e.mm)&&(0,m.isNumber)(e.dd))return{year:e.yy,month:e.mm,day:e.dd};if((0,m.isNumber)(e.year)&&(0,m.isNumber)(e.month)&&(0,m.isNumber)(e.day))return{year:e.year,month:e.month,day:e.day};if(e instanceof Date)return{year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate()};if((0,m.isFunction)(e.toDateTime)){let t=e.toDateTime();return{year:t.year,month:t.month,day:t.day}}throw new TypeError("Invalid date input provided to Tempo.roman")}function It(e){return{parse(t,r){let{year:i,month:n,day:o}=pe(t,r);return new e({year:i,month:n,day:o})},parseDate(t,r){return pe(t,r)},toClassical(t,r){let{year:i,month:n,day:o}=P(t);return C(i,n,o,r)},yearToAuc(t,r){return z(t,r)},aucToYear(t,r="astronomical"){return we(t,r)},getNonesDay(t){return J(t)},getIdesDay(t){return q(t)},isLeapYear(t,r){return N(t,r)},fromClassical(t,r,i,n,o=1,s=!1,a=!1,c=!0){return X(t,r,i,n,o,s,a,c)},format(t,r){let{year:i,month:n,day:o}=P(t),s=C(i,n,o,r);return E(s,r)},getConsuls(t){return Ce(t)},formatConsuls(t,r){return $(t,r)},findConsuls(t){return G(t)},registerConsuls(t){Ee(t)}}}var Q=ye({name:"roman",install(e){let t=It(e);Object.defineProperty(e,"roman",{value:(0,m.deepFreeze)(t),writable:!1,configurable:!0,enumerable:!1}),e.prototype.toRomanClassical||(e.prototype.toRomanClassical=function(i){let{year:n,month:o,day:s}=P(this);return C(n,o,s,i)}),e.prototype.formatRoman||(e.prototype.formatRoman=function(i){let{year:n,month:o,day:s}=P(this),a=C(n,o,s,i);return E(a,i)}),e.prototype.toAUC||(e.prototype.toAUC=function(){let{year:i}=P(this);return z(i)}),Object.getOwnPropertyDescriptor(e.prototype,"auc")||Object.defineProperty(e.prototype,"auc",{get(){let{year:i}=P(this);return z(i)},configurable:!0,enumerable:!1}),Object.getOwnPropertyDescriptor(e.prototype,"roman")||Object.defineProperty(e.prototype,"roman",{get(){let{year:i,month:n,day:o}=P(this);return C(i,n,o)},configurable:!0,enumerable:!1}),Object.getOwnPropertyDescriptor(e.prototype,"consuls")||Object.defineProperty(e.prototype,"consuls",{get(){let{year:i}=P(this);return $(i)},configurable:!0,enumerable:!1});let r=Ae((i,n,o)=>C(i,n,o));e.use({registry:{tokens:{roman:r}}})}}),Ze=Q;(0,m.autoInstall)(Q);return je(Nt);})();