@rr0/ufoathome 0.175.0 → 0.177.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.
Files changed (73) hide show
  1. package/dist-embed-interview/rr0-interview.mjs +9 -6
  2. package/dist-embed-scene/{BeamEditor-lqfhEk0b.js → BeamEditor-zq64GorX.js} +1 -1
  3. package/dist-embed-scene/{LanternEditor-B70H4IHX.js → LanternEditor-2q5seAWj.js} +1 -1
  4. package/dist-embed-scene/{LaunchEditor-DnOCC18Z.js → LaunchEditor-Cupksu8A.js} +1 -1
  5. package/dist-embed-scene/{ParameterForm-B4kpfmg7.js → ParameterForm-BMIW4Gkh.js} +5 -5
  6. package/dist-embed-scene/{ReentryEditor-CAoYGTuQ.js → ReentryEditor-DJO_M-8-.js} +1 -1
  7. package/{dist-embed-sighting/TimelineTracks-Cl54dXfV.js → dist-embed-scene/TimelineTracks-B-bXAaF7.js} +1 -1
  8. package/dist-embed-scene/rr0-scene.mjs +318 -292
  9. package/dist-embed-scene/sightingSchema-BfOYR_OD.js +1 -0
  10. package/dist-embed-sighting/{AdsbLolArchiveProvider-CcD8HBKE.js → AdsbLolArchiveProvider-DK4qEYPv.js} +1 -1
  11. package/dist-embed-sighting/{BallesterGuaspAssessor-C3AZoSYJ.js → BallesterGuaspAssessor-FGskpWWG.js} +1 -1
  12. package/dist-embed-sighting/{BeamEditor-DhVematZ.js → BeamEditor-BglkfKa6.js} +1 -1
  13. package/dist-embed-sighting/{BeamSystem-B4to8Pi-.js → BeamSystem-DDtPjozC.js} +1 -1
  14. package/dist-embed-sighting/CaseMessages_en-DEyvxYxv.js +1 -0
  15. package/dist-embed-sighting/CaseMessages_es-DDsQ93tK.js +1 -0
  16. package/dist-embed-sighting/CaseMessages_fr-DoHbDEkG.js +1 -0
  17. package/dist-embed-sighting/CaseMessages_it-CF8sKknV.js +1 -0
  18. package/dist-embed-sighting/{ContrailSystem-DOuG7PiJ.js → ContrailSystem-DXV0DnrQ.js} +1 -1
  19. package/dist-embed-sighting/{Flightradar24Provider-Dpx8D7Mq.js → Flightradar24Provider-Ch4GdVJG.js} +1 -1
  20. package/dist-embed-sighting/GLTFLoader-BDyucwJ-.js +1 -0
  21. package/dist-embed-sighting/HeadlightSystem-DGUfgm2c.js +34 -0
  22. package/dist-embed-sighting/HynekAssessor-Cb8mZ9Ib.js +1 -0
  23. package/dist-embed-sighting/InterviewElement-Byb_sxbO.js +38 -0
  24. package/dist-embed-sighting/InterviewMessages_en-BNau2xU8.js +1 -0
  25. package/dist-embed-sighting/InterviewMessages_es-ypa0EDh9.js +1 -0
  26. package/dist-embed-sighting/InterviewMessages_fr-OCQdwn9j.js +1 -0
  27. package/dist-embed-sighting/InterviewMessages_it-awuOqf5v.js +1 -0
  28. package/dist-embed-sighting/{LanternEditor-DV_09Orv.js → LanternEditor-CaZ1JhZS.js} +1 -1
  29. package/dist-embed-sighting/{LaserBeam-DWr9CljY.js → LaserBeam-DkKFSSp_.js} +1 -1
  30. package/dist-embed-sighting/LaunchEditor-QRG2uHH8.js +22 -0
  31. package/dist-embed-sighting/LaunchPlume-DBINBQgQ.js +1 -0
  32. package/dist-embed-sighting/{LaunchSimulation-CUoqmEUv.js → LaunchSimulation-DUvH6_BB.js} +1 -1
  33. package/dist-embed-sighting/{ModuleSession-C0IGrROR.js → ModuleSession-GzfQ8_LE.js} +3 -3
  34. package/dist-embed-sighting/ModuleThree-tnKi-oul.js +1 -0
  35. package/dist-embed-sighting/{NearestApproach-Dm99M0L8.js → NearestApproach-BeKwz4vK.js} +1 -1
  36. package/dist-embed-sighting/{ParameterForm-DHI22UeD.js → ParameterForm-DW6cQmYI.js} +12 -15
  37. package/dist-embed-sighting/{PoherAssessor-BUqWHdc2.js → PoherAssessor-JLqDISRf.js} +1 -1
  38. package/dist-embed-sighting/{RailwaySystem-Bb0sdKJq.js → RailwaySystem-BfTJvmf3.js} +1 -1
  39. package/dist-embed-sighting/{ReentryEditor-MvS7QLW_.js → ReentryEditor-BHgPXlx3.js} +6 -6
  40. package/dist-embed-sighting/ReentrySimulation-C3BR2hs3.js +1 -0
  41. package/dist-embed-sighting/{ReferenceSystem-CK13CXoG.js → ReferenceSystem-B5diz1Lt.js} +1 -1
  42. package/dist-embed-sighting/{RoadMarkings-DiBAmqci.js → RoadMarkings-Dv3xdtFG.js} +1 -1
  43. package/dist-embed-sighting/{SceneNames_en-Cy3_acfm.js → SceneNames_en-BbQ55UYu.js} +1 -1
  44. package/dist-embed-sighting/{SceneNames_es-VxS6QttN.js → SceneNames_es-DsJpGSDK.js} +1 -1
  45. package/dist-embed-sighting/{SceneNames_fr-Dg8Zgkb7.js → SceneNames_fr-CKr5m8QL.js} +1 -1
  46. package/dist-embed-sighting/{SceneNames_it-Cf-I4HxZ.js → SceneNames_it-qSw1j95v.js} +1 -1
  47. package/dist-embed-sighting/{SightingMessages_en-BjIUyT4W.js → SightingMessages_en-DuokT218.js} +1 -1
  48. package/dist-embed-sighting/{SightingMessages_es-TueslN1u.js → SightingMessages_es-JO8WQ1_V.js} +1 -1
  49. package/dist-embed-sighting/{SightingMessages_fr-Dfp6mAcU.js → SightingMessages_fr-3C2RZVNA.js} +1 -1
  50. package/dist-embed-sighting/{SightingMessages_it-C0VvJY01.js → SightingMessages_it-BEMBUACg.js} +1 -1
  51. package/{dist-embed-scene/TimelineTracks-BMdiUSuh.js → dist-embed-sighting/TimelineTracks-XzShW15O.js} +2 -2
  52. package/dist-embed-sighting/{TraceSystem-Br5X73bm.js → TraceSystem-XybhI4uJ.js} +2 -2
  53. package/dist-embed-sighting/UfoMessages_en-CoSqGYwb.js +1 -0
  54. package/dist-embed-sighting/{WaterSystem-B1eVrX5D.js → WaterSystem-CcLIPQfy.js} +1 -1
  55. package/dist-embed-sighting/rr0-sighting.mjs +464 -337
  56. package/dist-embed-sighting/sightingSchema-BfOYR_OD.js +1 -0
  57. package/dist-embed-sighting/{trafficRuntime-eDpxCSB0.js → trafficRuntime-BAuwwA-Z.js} +1 -1
  58. package/dist-embed-sighting-editor/{InterviewEditorElement-HpLlL2F7.js → InterviewEditorElement-44XFadV4.js} +16 -13
  59. package/dist-embed-sighting-editor/{SightingFileEditor-CASP3L_i.js → SightingFileEditor-CnKF2ndt.js} +1 -1
  60. package/dist-embed-sighting-editor/rr0-sighting-editor.mjs +385 -359
  61. package/dist-embed-sighting-editor/sightingSchema-9xw8srxN.js +1 -0
  62. package/package.json +1 -1
  63. package/dist-embed-scene/sightingSchema-BqAGojjT.js +0 -1
  64. package/dist-embed-sighting/GLTFLoader-BbUDci9q.js +0 -1
  65. package/dist-embed-sighting/HeadlightSystem-B2L7iVgs.js +0 -34
  66. package/dist-embed-sighting/HynekAssessor-BNn-J5RL.js +0 -1
  67. package/dist-embed-sighting/LaunchEditor-CB_nUoqA.js +0 -22
  68. package/dist-embed-sighting/LaunchPlume-C83k71p6.js +0 -1
  69. package/dist-embed-sighting/ModuleThree-CIiYBmMI.js +0 -1
  70. package/dist-embed-sighting/ReentrySimulation-DniDRt4s.js +0 -1
  71. package/dist-embed-sighting/UfoMessages_en-Bau9u8Mz.js +0 -1
  72. package/dist-embed-sighting/sightingSchema-BqAGojjT.js +0 -1
  73. package/dist-embed-sighting-editor/sightingSchema-DbcXsOHL.js +0 -1
@@ -1,11 +1,11 @@
1
- class z extends Error{}class oe{constructor(t){this.name=t}validate(t){return!0}}class kr extends oe{min;max;constructor(t,e,r){super(t),this.min=e,this.max=r}validate(t){if(typeof t!="number")throw new z(`${this.name} value must be a number, but was ${t}`);if(t<this.min||t>this.max)throw new z(`${this.name} value must be >= ${this.min} and <= ${this.max}, but was ${t}`);return super.validate(t)}}class G{name;min;max;duration;subUnit;validator;constructor(t,e,r,n,o=new kr(t,e,r)){this.name=t,this.min=e,this.max=r,this.subUnit=n,this.duration=n?(n.max-n.min+1)*n.duration:1,this.validator=o}validate(t){return this.validator.validate(t)}[Symbol.iterator](){let t=this.min;return{next:()=>{const e={done:t>this.max,value:t};return t++,e}}}}class Ee{millisecond;second;minute;hour;day;month;year}class Br extends Ee{}class Rr extends Br{millisecond=new G("millisecond",0,999,void 0);second=new G("second",0,59,this.millisecond);minute=new G("minute",0,59,this.second);hour=new G("hour",0,23,this.minute);day=new G("day",1,31,this.hour);month=new G("month",1,12,this.day);year=new G("year",0,9999,this.month)}const f=new Rr;class Fr extends kr{constructor(t=1,e=12){super("month",t,e)}}class wt extends G{static Month28=new wt(28);static Month29=new wt(29);static ThirtyDays=new wt(30);static ThirtyOneDays=new wt(31);constructor(t,e=new Fr(1,t)){super("month",1,t,f.day,e)}static create(t,e){switch(t){case 1:case 3:case 5:case 7:case 8:case 10:case 12:return this.ThirtyOneDays;case 2:return e%4===0?this.Month29:this.Month28;case 4:case 6:case 9:case 11:return this.ThirtyDays;default:throw new z("Unsupported month",t,e)}}}class H{static instance=new H;render(t){return t.value.toString()}}class j{unit;#t;constructor(t,e){this.unit=e,this.value=typeof t=="number"?t:t.value}get value(){return this.#t}set value(t){this.unit.validate(t),this.#t=t}get duration(){return this.value*this.unit.duration}#e(t){if(this.constructor.name!==t.constructor.name)throw new oe(`${this.unit.name} "${this.toString()}" cannot be compared with ${t.unit?.name} "${t.toString()}"`)}compare(t){return this.#e(t),this.value-t.value}isEqual(t){return this.compare(t)===0}isBefore(t){return this.compare(t)<0}isAfter(t){return this.compare(t)>0}previous(t=this.unit){const e=this.value-1;return new this.constructor(e,t)}next(t=this.unit){const e=this.value+1;return new this.constructor(e,t)}toString(t=H.instance){return t.render(this)}toSpec(){return{value:this.value}}toJSON(){return this.toSpec()}}class h{static#t=new Map;static register(t,e){h.#t.set(t,e)}static get(t){const e=h.#t.get(t);if(!e)throw new z(`No default parser registered for ${t.name}: import "@rr0/time/defaults" or pass a parser to fromString()`);return e()}}class Et extends j{constructor(t=new Date().getFullYear(),e=f.year){super(t,e)}static fromString(t,e=h.get(Et)){return new Et(e.parse(t))}}class D extends H{static default=new D("0",2);constructor(t,e){super(),this.char=t,this.size=e}render(t){return super.render(t).padStart(this.size,this.char)}}class Gt extends j{constructor(t=new Date().getMonth()+1,e=f.month){super(t,e)}static fromString(t,e=h.get(Gt)){return new Gt(e.parse(t))}toString(t=D.default){return super.toString(t)}}class Nt extends j{constructor(t=new Date().getDate(),e=f.day){super(t,e)}static fromString(t,e=h.get(Nt)){const r=e.parse(t);return new Nt(r)}toString(t=D.default){return super.toString(t)}}class vt extends j{constructor(t=new Date().getHours(),e=f.hour){super(t,e)}static fromString(t,e=h.get(vt)){return new vt(e.parse(t))}toString(t=D.default){return super.toString(t)}}class Tt extends j{constructor(t=new Date().getMinutes(),e=f.minute){super(t,e)}static fromString(t,e=h.get(Tt)){return new Tt(e.parse(t))}toString(t=D.default){return super.toString(t)}}class At extends j{constructor(t=new Date().getSeconds(),e=f.second){super(t,e)}static fromString(t,e=h.get(At)){return new At(e.parse(t),f.second)}toString(t=D.default){return super.toString(t)}}class mt extends j{static renderer=new D("0",3);constructor(t,e=f.millisecond){super(t,e)}static parseFraction(t){return parseInt(t.padEnd(3,"0").substring(0,3),10)}toString(t=mt.renderer){return super.toString(t)}}class zr{render(t){return t.toString()}}class Yr extends zr{render(t){const e=t.value,r=Math.abs(e),n=Math.floor(r/60),o=r%60;if(n===0&&o===0)return"Z";{const u=e<0?"-":"+",i=n.toString().padStart(2,"0"),d=o>0?":"+o.toString().padEnd(2,"0"):"";return u+i+d}}}class ct{value;name="timeshift";renderer;constructor(t=0){this.value=t}static fromString(t,e=h.get(ct),r=void 0){const n=e.parse(t,r);return new ct(n)}toString(t=new Yr){return t.render(this)}toSpec(){return{value:this.value}}toJSON(){return this.toSpec()}}class V{static timeshift(t,e){return t+(V.isDaylight(e)?60:0)}static isDaylight(t){const{year:e,month:r,day:n}=t,o=t.hour??12;if(![e,r,n].every(Number.isInteger))throw new RangeError("Daylight saving time depends on the year, month and day");const u=V.rule(e);if(!u)return!1;const i=V.rank(r,n,o);return i>=V.rank(u.start.month,u.start.day,2)&&i<V.rank(u.end.month,u.end.day,2)}static rule(t){if(t<1967)return;const e={month:10,day:V.sunday(t,10,-1)};return t>=2007?{start:{month:3,day:V.sunday(t,3,2)},end:{month:11,day:V.sunday(t,11,1)}}:t>=1987?{start:{month:4,day:V.sunday(t,4,1)},end:e}:t===1975?{start:{month:2,day:23},end:e}:t===1974?{start:{month:1,day:6},end:e}:{start:{month:4,day:V.sunday(t,4,-1)},end:e}}static sunday(t,e,r){const n=new Date(Date.UTC(2e3,e-1,1));n.setUTCFullYear(t);const o=1+(7-n.getUTCDay())%7;if(r>0)return o+7*(r-1);const u=[31,V.isLeap(t)?29:28,31,30,31,30,31,31,30,31,30,31][e-1];let i=o;for(;i+7<=u;)i+=7;return i}static isLeap(t){return t%4===0&&(t%100!==0||t%400===0)}static rank(t,e,r){return(t*100+e)*100+r}}const qr={name:"PST",timeshift:"-08",title:"Pacific Standard Time (US)"},Hr={name:"PDT",timeshift:"-07",title:"Pacific Daylight Time (US)"},Xr={name:"MDT",timeshift:"-06",title:"Mountain Standard Time (US)"},Wr={name:"MST",timeshift:"-07",title:"Mountain Daylight Time (US)"},Dr={name:"PT",timeshift:s=>V.timeshift(-480,s),title:"Pacific Time (US)"},Kr={name:"MT",timeshift:s=>V.timeshift(-420,s),title:"Mountain Time (US)"},Jr={name:"CT",timeshift:s=>V.timeshift(-360,s),title:"Central Time (US)"},Zr={name:"ET",timeshift:s=>V.timeshift(-300,s),title:"Eastern Time (US)"},Qr={name:"CWT",timeshift:"-05",title:"Central War Time (US)"},Pr={name:"CDT",timeshift:"-05",title:"Central Daylight Time"},Lr={name:"EST",timeshift:"-05",title:"Eastern Standard Time (US)"},_r={name:"EDT",timeshift:"-04",title:"Eastern Time (US)"},tn={name:"AST",timeshift:"-04",title:"Atlantic Standard Time (US)"},en={name:"ADT",timeshift:"-03",title:"Atlantic Daylight Time (US)"},rn={name:"UTC",timeshift:"Z",title:"Coordinated Universal Time"},nn={name:"Z",timeshift:"Z",title:"UTC"},sn={name:"GMT",timeshift:"Z",title:"Greenwich Mean Time"},on={name:"BST",timeshift:"+01",title:"British Summer Time"},an={name:"CEST",timeshift:"+02",title:"Central European Summer Time"},un={name:"CET",timeshift:"+01",title:"Central European Time"},cn={name:"MSK",timeshift:"+03",title:"Moscow Time (RU)"},mn={name:"IST",timeshift:"+05:30",title:"Indian Standard Time"},dn={name:"BJT",timeshift:"+08",title:"Beijing Time"},pn={name:"CST",timeshift:"-06",title:"Central Standard Time"},hn={name:"JST",timeshift:"+09",title:"Japan Standard Time"},ln={name:"AEST",timeshift:"+10",title:"Australian Eastern Standard Time"},fn={name:"NZST",timeshift:"+12",title:"New Zealand Standard Time"},gn={name:"LST",timeshift:"?",title:"Local Sideral Time"},Ie=[en,ln,tn,dn,on,pn,Pr,un,an,Jr,Qr,_r,Lr,Zr,sn,mn,hn,gn,Xr,cn,Wr,Kr,fn,Hr,qr,Dr,rn,nn];class ae{static instance=new ae;renderComponent(t,e){return t[e].toString()}renderSecond(t){return this.renderComponent(t,"second")+(t.millisecond?"."+t.millisecond.toString():"")}render(t){const e=[];t.year&&e.push(this.renderComponent(t,"year")),t.month&&e.push(this.renderComponent(t,"month")),t.day&&e.push(this.renderComponent(t,"day"));const r=[];t.hour&&r.push(this.renderComponent(t,"hour")),t.minute&&r.push(this.renderComponent(t,"minute")),t.second&&r.push(this.renderSecond(t));const n=e.join("-"),o=t.timeshift?t.timeshift.toString():"",u=r.join(":")+o;return n+(u.length>0?"T"+u:"")}}class dt extends z{constructor(t="method is abstract"){super(t)}}class Ge{units;constructor(t){this.units=t}newYear(t){throw new dt}newMonth(t){throw new dt}newDay(t){throw new dt}newHour(t){throw new dt}newMinute(t){throw new dt}newSecond(t){throw new dt}}class wn extends Ee{millisecond=new G("milliseconds",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,void 0);second=new G("seconds",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.millisecond);minute=new G("minutes",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.second);hour=new G("hours",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.minutes);day=new G("days",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.hour);month=new G("months",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.day);year=new G("years",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.month)}const _t=new wn;class ie{static instance=new ie;render(t){const e=q.toSpec(t);let r="P";const n=e.years;n&&(r+=n.toString()+"Y");const o=e.months;o&&(r+=o.toString(H.instance)+"MM");const u=e.days;u&&(r+=u.toString(H.instance)+"D");const i=e.hours;i&&(r+=i.toString(H.instance)+"H");const d=e.minutes;d&&(r+=d.toString(H.instance)+"M");const c=e.seconds;return c&&(r+=c.toString(H.instance)+"S"),r}}class q extends j{constructor(t={years:new Date().getFullYear(),months:new Date().getMonth(),days:new Date().getDate(),hours:new Date().getHours(),minutes:new Date().getMinutes(),seconds:new Date().getSeconds(),milliseconds:new Date().getMilliseconds()}){super({value:typeof t=="number"?t:+(t.years?t.years*f.year.duration:0)+(t.months?t.months*f.month.duration:0)+(t.days?t.days*f.day.duration:0)+(t.hours?t.hours*f.hour.duration:0)+(t.minutes?t.minutes*f.minute.duration:0)+(t.seconds?t.seconds*f.second.duration:0)},new G("millisecond",0,Number.MAX_SAFE_INTEGER,void 0))}static toSpec(t,e=yn){let r=typeof t=="number"?t:t.value;const n=r>0?1:-1;r=Math.abs(r);const o={},u=r/f.year.duration,i=Math.floor(u);i>0&&(o.years=e.newYear(n*i),r-=i*f.year.duration);const d=r/f.month.duration,c=Math.floor(d);c>0&&(o.months=e.newMonth(n*c),r-=c*f.month.duration);const p=r/f.day.duration,m=Math.floor(p);m>0&&(o.days=e.newDay(n*m),r-=m*f.day.duration);const w=r/f.hour.duration,y=Math.floor(w);y>0&&(o.hours=e.newHour(n*y),r-=y*f.hour.duration);const x=r/f.minute.duration,S=Math.floor(x);S>0&&(o.minutes=e.newMinute(n*S),r-=S*f.minute.duration);const T=r/f.second.duration,g=Math.floor(n*T);return g>0&&(o.seconds=e.newSecond(g)),o}static fromString(t,e=h.get(q)){return new q(e.parse(t))}static between(t,e){const r=e.getTime(),n=t.getTime();return new q(r-n)}toSpec(){return q.toSpec(this)}toString(t=ie.instance){return t.render(this)}}class $r extends Ge{constructor(t){super(t)}newYear(t){return new Et(t,this.units.year)}newMonth(t){return new Gt(t,this.units.month)}newDay(t){return new Nt(t,this.units.day)}newHour(t){return new vt(t,this.units.hour)}newMinute(t){return new Tt(t,this.units.minute)}newSecond(t){return new At(t,this.units.second)}newMillisecond(t){return new mt(t,this.units.millisecond)}newTimeshift(t){return new ct(typeof t=="number"?t:t.value)}}const Sn=new $r(f),yn=new $r(_t);class I{#t;#e;#r;#n;#s;#o;#a;#i;constructor(t={year:new Date().getFullYear(),month:new Date().getMonth()+1,day:new Date().getDate(),hour:new Date().getHours(),minute:new Date().getMinutes(),second:new Date().getSeconds(),timeshift:I.timeshiftOf(new Date)}){this.year=t.year,this.month=t.month,this.day=t.day,this.hour=t.hour,this.minute=t.minute,this.second=t.second,this.millisecond=t.millisecond,this.timeshift=t.timeshift}get year(){return this.#t}set year(t){const e=typeof t=="number";this.#t&&e?this.#t.value=t:this.#t=e?this.factory.newYear(t):!t||t.start||t instanceof j?t:this.factory.newYear(t)}get month(){return this.#e}set month(t){const e=typeof t=="number";this.#e&&e?this.#e.value=t:this.#e=e?this.factory.newMonth(t):!t||t.start||t instanceof j?t:this.factory.newMonth(t)}get day(){return this.#r}set day(t){const e=typeof t=="number";this.#r&&e?this.#r.value=t:this.#r=e?this.factory.newDay(t):!t||t.start||t instanceof j?t:this.factory.newDay(t)}get hour(){return this.#n}set hour(t){const e=typeof t=="number";this.#n&&e?this.#n.value=t:this.#n=e?this.factory.newHour(t):!t||t.start||t instanceof j?t:this.factory.newHour(t)}get minute(){return this.#s}set minute(t){const e=typeof t=="number";this.#s&&e?this.#s.value=t:this.#s=e?this.factory.newMinute(t):!t||t.start||t instanceof j?t:this.factory.newMinute(t)}get second(){return this.#o}set second(t){const e=typeof t=="number";this.#o&&e?this.#o.value=t:this.#o=e?this.factory.newSecond(t):!t||t.start||t instanceof j?t:this.factory.newSecond(t)}get millisecond(){return this.#a}set millisecond(t){const e=typeof t=="number";this.#a&&e?this.#a.value=t:this.#a=e||t&&!(t instanceof j)?this.factory.newMillisecond(t):t}get timeshift(){return this.#i}set timeshift(t){const e=typeof t=="number";this.#i&&e?this.#i.value=t:this.#i=e||t&&!(t instanceof ct)?this.factory.newTimeshift(t):t}get factory(){return Sn}static fromString(t,e=h.get(I)){const{year:r,month:n,day:o,hour:u,minute:i,second:d,millisecond:c,timeshift:p}=e.parse(t);return new I({year:r,month:n,day:o,hour:u,minute:i,second:d,millisecond:c,timeshift:p})}static timeshiftOf(t){return-t.getTimezoneOffset()||0}static fromDate(t){return new I({year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate(),hour:t.getHours(),minute:t.getMinutes(),second:t.getSeconds(),timeshift:I.timeshiftOf(t)})}static newInstance(){const t=new Date().toISOString(),e=t.indexOf("."),r=t.substring(0,e)+t.substring(e+4);return I.fromString(r)}#u(t){if(this.constructor.name!==t.constructor.name)throw new oe(`Date "${this.toString()}" cannot be compared with "${t.toString()}"`)}compare(t){return this.#u(t),this.getTime()-t.getTime()}delta(t){const e=this.compare(t);return new q(e)}getTime(){return(this.year?.duration||0)+(this.month?.duration||0)+(this.day?.duration||0)+(this.hour?.duration||0)+(this.minute?.duration||0)+(this.second?.duration||0)+(this.millisecond?.duration||0)}isEqual(t){return this.compare(t)===0}isBefore(t){return this.compare(t)<0}isAfter(t){return this.compare(t)>0}clone(){return new I(this.toSpec())}previous(){let t=this.clone();try{t.second=this.second.previous()}catch{try{t.minute=this.minute.previous()}catch{try{t.hour=this.hour.previous()}catch{try{t.day=this.day.previous()}catch{try{t.month=this.month.previous()}catch{t.year=this.year.previous()}}}}}return t}next(){let t=this.clone();try{t.second=this.second.next()}catch{try{t.minute=this.minute.next()}catch{try{t.hour=this.hour.next()}catch{try{t.day=this.day.next()}catch{try{t.month=this.month.next()}catch{t.year=this.year.next()}}}}}return t}toString(t=ae.instance){return t.render(this)}toSpec(){const t={},e=this.year?.toSpec();e&&(t.year=e);const r=this.month?.toSpec();r&&(t.month=r);const n=this.day?.toSpec();n&&(t.day=n);const o=this.hour?.toSpec();o&&(t.hour=o);const u=this.minute?.toSpec();u&&(t.minute=u);const i=this.second?.toSpec();i&&(t.second=i);const d=this.millisecond?.toSpec();d&&(t.millisecond=d);const c=this.timeshift?.toSpec();return c&&(t.timeshift=c),t}toJSON(){return this.toSpec()}}class Ne{static instance=new Ne;render(t){return(t.start?t.start.toString():"")+"/"+(t.end?t.end.toString():"")}}class It{constructor(t,e){this.start=t,this.end=e}_start;get start(){return this._start}set start(t){if(typeof t=="string"&&(t=I.fromString(t)),t&&!(t instanceof I)&&!(t instanceof q))throw new z("Interval start is not a level 0 date or duration: "+t);this._start=t}_end;get end(){return this._end}set end(t){if(typeof t=="string"&&(t=I.fromString(t)),t&&!(t instanceof I)&&!(t instanceof q))throw new z("Interval end is not a level 0 date or duration: "+t);this._end=t}static fromString(t,e=h.get(It)){const{start:r,end:n}=e.parse(t);return new It(r,n)}toString(t=Ne.instance){return t.render(this)}[Symbol.iterator](){let t=this.start;return{next:()=>{const e={done:t>this.end,value:t};return t++,e}}}}class te extends H{static instance=new te(D.default);constructor(t){super(),this.valueRenderer=t}render(t){return(this.valueRenderer?this.valueRenderer.render(t):super.render(t))+this.qualifier(t)}qualifier(t){return t.uncertain?t.approximate?"%":"?":t.approximate?"~":""}}class W extends j{#t;#e;constructor(t,e){super(t,e),this.#t=t.uncertain||!1,this.#e=t.approximate||!1}get uncertain(){return this.#t}set uncertain(t){return this.#t=t}get approximate(){return this.#e}set approximate(t){return this.#e=t}isCertainAndPrecise(){return!this.approximate&&!this.uncertain}isEqual(t){return this.isCertainAndPrecise()&&super.isEqual(t)}isBefore(t){return this.isCertainAndPrecise()&&super.isBefore(t)}isAfter(t){return this.isCertainAndPrecise()&&super.isAfter(t)}toString(t=te.instance){return super.toString(t)}toSpec(){return{...super.toSpec(),uncertain:this.uncertain,approximate:this.approximate}}toJSON(){return this.toSpec()}}class Ir extends Rr{year=new G("year",-9999,9999,this.month);yearExtended=new G("year",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.month)}const re=new Ir;class nt extends W{constructor(t,e=re.year){super(t,e)}static fromString(t,e=re.year,r=h.get(nt)){const n=r.parse(t),o=n.value.start;if(t.startsWith("Y")&&(e=re.yearExtended),o!==void 0){const u=new nt(Object.assign({...n},{value:Math.max(o,e.min)})),i=new nt(Object.assign({...n},{value:Math.min(n.value.end,e.max)}));return{start:u,end:i}}else return new nt(n,e)}}class Cr extends oe{monthValidator=new Fr;validate(t){switch(t){case 21:case 22:case 23:case 24:return!0;default:return this.monthValidator.validate(t)}}}class st extends W{constructor(t,e=new G(f.month.name,1,24,f.day,new Cr)){super(t,e)}static fromString(t,e=h.get(st)){const r=e.parse(t),n=r.value.start;if(n!==void 0){let o=f.month;const u=new st(Object.assign({...r},{value:Math.max(n,o.min)})),i=new st(Object.assign({...r},{value:Math.min(r.value.end,o.max)}));return{start:u,end:i}}else return new st(r)}toString(t){return super.toString(t).padStart(2,"0")}}class ot extends W{constructor(t,e=f.day){super(t,e)}static fromString(t,e=h.get(ot)){const r=e.parse(t),n=r.value.start;if(n!==void 0){let o=f.day;const u=new ot(Object.assign({...r},{value:Math.max(n,o.min)})),i=new ot(Object.assign({...r},{value:Math.min(r.value.end,o.max)}));return{start:u,end:i}}else return new ot(r)}toString(t){return super.toString(t).padStart(2,"0")}}class at extends W{constructor(t,e=f.hour){super(t,e)}static fromString(t,e=h.get(at)){const r=e.parse(t),n=r.value.start;if(n!==void 0){let o=f.hour;const u=new at(Object.assign({...r},{value:Math.max(n,o.min)})),i=new at(Object.assign({...r},{value:Math.min(r.value.end,o.max)}));return{start:u,end:i}}else return new at(r)}}class it extends W{constructor(t,e=f.minute){super(t,e)}static fromString(t,e=h.get(it)){const r=e.parse(t),n=r.value.start;if(n!==void 0){const o=f.minute,u=new it(Object.assign({...r},{value:Math.max(n,o.min)})),i=new it(Object.assign({...r},{value:Math.min(r.value.end,o.max)}));return{start:u,end:i}}else return new it(r)}toString(t=te.instance){return super.toString(t)}}class ut extends W{constructor(t,e=f.second){super(t,e)}static fromString(t,e=h.get(ut)){const r=e.parse(t),n=r.value.start;if(n!==void 0){const o=f.second,u=new ut(Object.assign({...r},{value:Math.max(n,o.min)})),i=new ut(Object.assign({...r},{value:Math.min(r.value.end,o.max)}));return{start:u,end:i}}else return new ut(r)}}class lt extends ct{static fromString(t,e=h.get(lt),r=void 0){return new lt(e.parse(t,r))}}class Ur extends Ge{constructor(t){super(t)}newYear(t){return new nt(t,this.units.year)}newMonth(t){return new st(t,this.units.month)}newDay(t){return new ot(t,this.units.day)}newHour(t){return new at(t,this.units.hour)}newMinute(t){return new it(t,this.units.minute)}newSecond(t){return new ut(t,this.units.second)}newMillisecond(t){return new mt(t,this.units.millisecond)}newTimeshift(t){return new lt(typeof t=="number"?t:t.value)}}const xn=new Ur(re),Mn=new Ur(_t);class O extends I{constructor(t){super(t)}get factory(){return xn}get uncertain(){return this.year?.uncertain===!0||this.month?.uncertain===!0||this.day?.uncertain===!0||this.hour?.uncertain===!0||this.minute?.uncertain===!0||this.second?.uncertain===!0}get approximate(){return this.year?.approximate===!0||this.month?.approximate===!0||this.day?.approximate===!0||this.hour?.approximate===!0||this.minute?.approximate===!0||this.second?.approximate===!0}static fromDate(t){return new O({year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate(),hour:t.getHours(),minute:t.getMinutes(),second:t.getSeconds(),timeshift:I.timeshiftOf(t)})}static fromString(t,e=h.get(O)){const r=e.parse(t);return new O(r)}static newInstance(){const t=new Date().toISOString(),e=t.indexOf("."),r=t.substring(0,e)+t.substring(e+4);return O.fromString(r)}clone(){return new O(this.toSpec())}}const R=Object.freeze({year:"year",month:"month",day:"day",hour:"hour",minute:"minute",second:"second",timeshift:"timeshift",uncertain:"uncertain",approximate:"approx"});class ue extends ie{static instance=new ue;render(t){return super.render(t)}}class k extends W{constructor(t){super(typeof t=="number"||t.hasOwnProperty("value")?t:{value:k.getValue(t,R.year)+k.getValue(t,R.month)+k.getValue(t,R.day)+k.getValue(t,R.hour)+k.getValue(t,R.minute)+k.getValue(t,R.second),uncertain:k.getBoolean(t,R.uncertain),approximate:k.getBoolean(t,"approximate")},_t.millisecond)}static getBoolean(t,e){return t[e]||t[R.year+"s"]?.[e]||t[R.month+"s"]?.[e]||t[R.day+"s"]?.[e]||t[R.hour+"s"]?.[e]||t[R.minute+"s"]?.[e]||t[R.second+"s"]?.[e]||!1}static getValue(t,e){let r=0,n=t[e+"s"];if(n instanceof W?n=n.value:typeof t=="number"&&(n=t),n){const o=f[e];r=n*o.duration}return r}static toSpec(t,e=Mn){return{...q.toSpec(t,e),uncertain:t.uncertain||!1,approximate:t.approximate||!1}}static fromString(t,e=h.get(k)){const r=e.parse(t);return new k(r)}static between(t,e){const r=e.getTime(),n=t.getTime();return new k(r-n)}toString(t=ue.instance){return super.toString(t)}toSpec(){return k.toSpec(this)}}class Ct extends It{constructor(t,e){super(t,e)}get start(){return this._start}set start(t){if(typeof t=="string"&&(super.start=O.fromString(t)),t&&!(t instanceof O)&&!(t instanceof k))throw new z("Interval start is not a level 1 date or duration: "+t);this._start=t}get end(){return this._end}set end(t){if(typeof t=="string"&&(t=O.fromString(t)),t&&!(t instanceof O)&&!(t instanceof k))throw new z("Interval end is not a level 1 date or duration: "+t);this._end=t}static fromString(t,e=h.get(Ct)){const{start:r,end:n}=e.parse(t);return new Ct(r,n)}}class Rt extends W{uncertainComponent;approximateComponent;constructor(t,e){super(t,e),this.uncertainComponent=t.uncertainComponent||!1,this.approximateComponent=t.approximateComponent||!1}get uncertain(){return super.uncertain||this.uncertainComponent}set uncertain(t){return super.uncertain=t}get approximate(){return super.approximate||this.approximateComponent}set approximate(t){return super.approximate=t}get uncertainGroup(){return super.uncertain}get approximateGroup(){return super.approximate}toSpec(){return{...super.toSpec(),uncertain:this.uncertainGroup,approximate:this.approximateGroup,uncertainComponent:this.uncertainComponent,approximateComponent:this.approximateComponent}}toJSON(){return this.toSpec()}}class bn extends Ir{year=new G("year",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.month)}const be=new bn;class J extends Rt{constructor(t,e=be.year){super(t,e)}static fromString(t,e=be.year,r=h.get(J)){const n=r.parse(t),o=n.value.start;if(o!==void 0){const u=new J(Object.assign({...n},{value:Math.max(o,e.min)})),i=new J(Object.assign({...n},{value:Math.min(n.value.end,e.max)})),d={start:u,end:i},c=n.value.estimate;return c&&(d.estimate=c),d}else return new J(n)}}class En extends Cr{validate(t){switch(t){case 25:case 26:case 27:case 28:case 29:case 30:case 31:case 32:case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:return!0;default:return super.validate(t)}}}class Z extends Rt{constructor(t,e=new G(f.month.name,1,41,f.day,new En)){super(t,e)}static fromString(t,e=h.get(Z)){const r=e.parse(t),n=r.value.start;if(n!==void 0){const o=f.month,u=new Z(Object.assign({...r},{value:Math.max(n,o.min)})),i=new Z(Object.assign({...r},{value:Math.min(r.value.end,o.max)}));return{start:u,end:i}}else return new Z(r)}toString(t){return super.toString(t).padStart(2,"0")}}class Q extends Rt{constructor(t,e=f.day){super(t,e)}static fromString(t,e=h.get(Q)){const r=e.parse(t),n=r.value.start;if(n!==void 0){const o=f.day,u=new Q(Object.assign({...r},{value:Math.max(n,o.min)})),i=new Q(Object.assign({...r},{value:Math.min(r.value.end,o.max)}));return{start:u,end:i}}else return new Q(r)}toString(t){return super.toString(t).padStart(2,"0")}}class P extends Rt{constructor(t,e=f.hour){super(t,e)}static fromString(t,e=h.get(P)){const r=e.parse(t),n=r.value.start;if(n!==void 0){const o=f.hour,u=new P(Object.assign({...r},{value:Math.max(n,o.min)})),i=new P(Object.assign({...r},{value:Math.min(r.value.end,o.max)}));return{start:u,end:i}}else return new P(r)}}class L extends Rt{constructor(t,e=f.minute){super(t,e)}static fromString(t,e=h.get(L)){const r=e.parse(t),n=r.value.start;if(n!==void 0){const o=f.minute,u=new L(Object.assign({...r},{value:Math.max(n,o.min)})),i=new L(Object.assign({...r},{value:Math.min(r.value.end,o.max)}));return{start:u,end:i}}else return new L(r)}}class _ extends Rt{constructor(t,e=f.second){super(t,e)}static fromString(t,e=f.second,r=h.get(_)){const n=r.parse(t),o=n.value.start;if(o!==void 0){const u=new _(Object.assign({...n},{value:Math.max(o,e.min)})),i=new _(Object.assign({...n},{value:Math.min(n.value.end,e.max)}));return{start:u,end:i}}else return new _(n,e)}}class Vr extends lt{}class Gn extends te{qualifier(){return""}}class rt extends ae{static instance=new rt;static valueRenderer=new Gn(D.default);static names=["year","month","day","hour","minute","second"];static qualifier(t,e){return t?e?"%":"?":e?"~":""}renderComponent(t,e){const r=t[e],n=rt.names.slice(rt.names.indexOf(e)+1).map(i=>t[i]).filter(Boolean),o=rt.qualifier(r.uncertainComponent,r.approximateComponent),u=rt.qualifier(r.uncertainGroup&&!r.uncertainComponent&&!n.some(i=>i.uncertain),r.approximateGroup&&!r.approximateComponent&&!n.some(i=>i.approximate));return o+r.toString(rt.valueRenderer)+u}}class jr extends Ge{constructor(t){super(t)}newYear(t){return new J(t,this.units.year)}newMonth(t){return new Z(t,this.units.month)}newDay(t){return new Q(t,this.units.day)}newHour(t){return new P(t,this.units.hour)}newMinute(t){return new L(t,this.units.minute)}newSecond(t){return new _(t,this.units.second)}newMillisecond(t){return new mt(t,this.units.millisecond)}newTimeshift(t){return new Vr(typeof t=="number"?t:t.value)}}const Nn=new jr(be),vn=new jr(_t);class B extends O{constructor(t){super(t)}toString(t=rt.instance){return super.toString(t)}get year(){return super.year}set year(t){super.year=t}get month(){return super.month}set month(t){super.month=t}get factory(){return Nn}static fromDate(t){return new B({year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate(),hour:t.getHours(),minute:t.getMinutes(),second:t.getSeconds(),timeshift:I.timeshiftOf(t)})}static fromString(t,e=h.get(B)){const r=e.parse(t);return new B(r)}static newInstance(){const t=new Date().toISOString(),e=t.indexOf("."),r=t.substring(0,e)+t.substring(e+4);return B.fromString(r)}clone(){return new B(this.toSpec())}}class tt{regExp;constructor(t,e){this.name=t,this.regExp=new RegExp(`^(?:${e})$`)}regexGroups(t){const e=this.regExp.exec(t);if(!e)throw new z(`Invalid ${this.name} "${t}"`);return e.groups}parseGroups(t){throw new dt(`${this.constructor.name} is abstract`)}parse(t){const e=this.regexGroups(t);return this.parseGroups(e)}}class St extends ue{static instance=new St;static designators=[["years","Y"],["months","MM"],["days","D"],["hours","H"],["minutes","M"],["seconds","S"]];static qualifier(t,e){return t?e?"%":"?":e?"~":""}render(t){const e=St.qualifier(t.uncertainDuration,t.approximateDuration);if(!t.hasQualifiedComponent)return e+super.render(t);let r=e+"P";for(const[n,o]of St.designators){const u=t.components[n];u&&(r+=St.qualifier(u.uncertainComponent,u.approximateComponent)+u.value+o)}return r}}class A extends k{#t;constructor(t){if(super(typeof t=="number"?t:{value:A.valueFromSpec(t),uncertain:t.uncertain===!0,approximate:t.approximate===!0},_t.millisecond),typeof t!="number"){const e={};for(const r of A.componentNames)t[r]instanceof W&&(e[r]=t[r]);Object.keys(e).length>0&&(this.#t=e)}}static componentNames=["years","months","days","hours","minutes","seconds"];get components(){return this.#t}#e(t){return this.#t?Object.values(this.#t).some(e=>e[t]):!1}get uncertainDuration(){return super.uncertain}get approximateDuration(){return super.approximate}get uncertain(){return super.uncertain||this.#e("uncertain")}set uncertain(t){super.uncertain=t}get approximate(){return super.approximate||this.#e("approximate")}set approximate(t){super.approximate=t}get hasQualifiedComponent(){return this.#t?Object.values(this.#t).some(t=>t.uncertainComponent||t.approximateComponent):!1}static valueFromSpec(t){return A.getValue(t,R.year)+A.getValue(t,R.month)+A.getValue(t,R.day)+A.getValue(t,R.hour)+A.getValue(t,R.minute)+A.getValue(t,R.second)}static toSpec(t,e=vn){const r=k.toSpec(t,e);if(t instanceof A&&t.hasQualifiedComponent)for(const n of A.componentNames)delete r[n],t.components[n]&&(r[n]=t.components[n]);return r}static fromString(t,e=h.get(A)){const r=e.parse(t);return new A(r)}static between(t,e){const r=e.getTime(),n=t.getTime();return new A(r-n)}toSpec(){return A.toSpec(this)}toString(t=St.instance){return super.toString(t)}}class Ut extends Ct{get start(){return this._start}set start(t){if(typeof t=="string"&&(super.start=B.fromString(t)),t&&!(t instanceof B)&&!(t instanceof A))throw new z("Interval start is not a level 2 date or duration: "+t);this._start=t}get end(){return this._end}set end(t){if(typeof t=="string"&&(t=B.fromString(t)),t&&!(t instanceof B)&&!(t instanceof A))throw new z("Interval end is not a level 2 date or duration: "+t);this._end=t}static fromString(t,e=h.get(Ut)){const{start:r,end:n}=e.parse(t);return new Ut(r,n)}}class ne extends Set{constructor(t,e){super(t),this.exclusive=e}has(t){const e=t.toString().replace("..","/");for(const r of this)if(r.toString()===e)return!0;return!1}static fromString(t,e=h.get(ne)){const{exclusive:r,values:n}=e.parse(t);return new ne(n,r)}}class et extends tt{constructor(t,e){super(t,e)}static read(t){return{value:t?parseInt(t,10):void 0}}parseGroups(t){return et.read(t[this.name])}parse(t){if(t.startsWith("-"))throw new z(`${this.name} cannot be negative`);return super.parse(t)}}class a{static groupName(...t){return t.reduce((e,r)=>e?e+r.charAt(0).toUpperCase()+r.substring(1):r,"")}static group(t,...e){return`(?<${t}>${e.join("")})`}static optional(t){return t+"?"}static nonCapturingGroup(...t){return`(?:${t.join("")})`}static optionalGroup(t,...e){return a.optional(a.group(t,...e))}static optionalNonCapturingGroup(...t){return a.optional(a.nonCapturingGroup(...t))}static numberGroup(t,e,r,n="\\d"){return a.group(t,`${r||""}[${n}]${e}`)}}const Ce="yearValue";class Vt extends et{static format(t=""){return a.numberGroup(a.groupName(t,Ce),"{4}",void 0)}constructor(){super(Ce,Vt.format())}}const Ue="monthValue";class jt extends et{static format(t=""){return a.numberGroup(a.groupName(t,Ue),"{1,2}",void 0)}constructor(){super(Ue,jt.format())}}const Ve="dayValue";class Mt extends et{static format(t=""){return a.numberGroup(a.groupName(t,Ve),"{1,2}",void 0)}constructor(){super(Ve,Mt.format())}}const je="hourValue";class bt extends et{static format(t=""){return a.numberGroup(a.groupName(t,je),"{1,2}",void 0)}constructor(){super(je,bt.format())}}const Oe="minuteValue";class Ot extends et{static format(t=""){return a.numberGroup(a.groupName(t,Oe),"{1,2}",void 0)}constructor(){super(Oe,Ot.format())}}const Be="secondValue";class Bt extends et{static format(t=""){return a.numberGroup(a.groupName(t,Be),"{1,2}",void 0)}constructor(){super(Be,Bt.format())}}const ze="timeshiftValue",Ye="shiftHour",qe="shiftMinute";class kt extends tt{static format(t=""){return Ie.map(e=>e.name).join("|")+"|"+a.nonCapturingGroup(a.group(t+Ye,a.numberGroup(a.groupName(t,ze),"{2}","[+-]")),a.optionalNonCapturingGroup(":?",a.numberGroup(a.groupName(t,qe),"{2}",void 0)))}constructor(){super(ze,kt.format())}parse(t,e){let r=0;const n=Ie.find(o=>o.name===t);if(n){if(typeof n.timeshift=="function")try{return n.timeshift(e??{})}catch(o){throw new z(`The time zone ${t} depends on the date: ${o.message}`)}t=n.timeshift}if(t!=="Z"){const o=this.regexGroups(t),u=o[Ye];u&&(r+=parseInt(u,10)*60);const i=o[qe];i&&(r+=parseInt(i,10))}return r}}const He="year",Xe="month",We="day",De="hour",Ke="minute",Je="second",Ze="millisecond",Qe="timeshift";class pt extends tt{static format(t=""){return a.group(a.groupName(t,He),Vt.format(t))+a.optionalNonCapturingGroup("-",a.group(a.groupName(t,Xe),jt.format(t)),a.optionalNonCapturingGroup("-",a.group(a.groupName(t,We),Mt.format(t)),a.optionalNonCapturingGroup("[T ]",a.group(a.groupName(t,De),bt.format(t)),":?",a.group(a.groupName(t,Ke),Ot.format(t)),a.optionalNonCapturingGroup(":",a.group(a.groupName(t,Je),Bt.format(t)),a.optionalNonCapturingGroup("[.,]",a.group(a.groupName(t,Ze),"\\d+"))),"\\s*",a.optionalGroup(a.groupName(t,Qe),kt.format(t)))))}constructor(){super("date",pt.format())}parse(t){const e=this.regexGroups(t),r=e[He],n=e[Xe],o=e[We],u=e[De],i=e[Ke],d=e[Je],c=e[Ze],p=e[Qe],m=r?new Et(Vt.read(r)):void 0,w=n?jt.read(n):void 0;return{year:m,month:w?new Gt(w,wt.create(w.value,m?.value)):void 0,day:o?new Nt(Mt.read(o)):void 0,hour:u?new vt(bt.read(u)):void 0,minute:i?new Tt(Ot.read(i)):void 0,second:d?new At(Bt.read(d)):void 0,millisecond:c?mt.parseFraction(c):void 0,timeshift:p?ct.fromString(p,new kt,{year:m?.value,month:w?.value,day:o?Mt.read(o).value:void 0,hour:u?bt.read(u).value:void 0}):void 0}}}const Pe="years",de="months",Tn="days",Le="hours",_e="minutes",tr="seconds";class ve extends tt{static format(t=""){return"P"+a.optionalNonCapturingGroup(a.numberGroup(a.groupName(t,Pe),"+",void 0,"\\d"),"Y")+a.optionalNonCapturingGroup(a.numberGroup(a.groupName(t,de),"+",void 0,"\\d"),"MM")+a.optionalNonCapturingGroup(a.numberGroup(a.groupName(t,Tn),"+",void 0,"\\d"),"D")+a.optionalNonCapturingGroup(a.numberGroup(a.groupName(t,Le),"+",void 0,"\\d"),"H")+a.optionalNonCapturingGroup(a.numberGroup(a.groupName(t,_e),"+",void 0,"\\d"),"M")+a.optionalNonCapturingGroup(a.numberGroup(a.groupName(t,tr),"+",void 0,"\\d"),"S")}constructor(){super("duration",ve.format())}parseGroups(t){return{years:t[Pe],months:t[de],days:t[de],hours:t[Le],minutes:t[_e],seconds:t[tr]}}}const pe="start",he="end";class Te extends tt{static format=a.group(pe,pt.format(pe))+"/"+a.group(he,pt.format(he));constructor(){super("interval",Te.format)}parse(t){const e=this.regexGroups(t),r=e[pe],n=e[he];return{start:r?I.fromString(r,new pt):void 0,end:n?I.fromString(n,new pt):void 0}}}h.register(I,()=>new pt);h.register(Nt,()=>new Mt);h.register(q,()=>new ve);h.register(vt,()=>new bt);h.register(It,()=>new Te);h.register(Tt,()=>new Ot);h.register(Gt,()=>new jt);h.register(At,()=>new Bt);h.register(ct,()=>new kt);h.register(Et,()=>new Vt);class N extends et{static uncertainGroup="uncertain";static approximateGroup="approx";static uncertainAndApproximateGroup=N.uncertainGroup+N.approximateGroup;constructor(t,e){super(t,e)}static qualifierFormat(t,e){return a.optionalGroup(t,`\\${e}`)}static formatSuffix(t){return this.qualifierFormat(a.groupName(N.uncertainGroup,t),"?")+this.qualifierFormat(a.groupName(N.approximateGroup,t),"~")+this.qualifierFormat(a.groupName(N.uncertainAndApproximateGroup,t),"%")}static numberFormat(t,e,r){return a.numberGroup(t,e,r,"\\dX")+this.formatSuffix(t)}getValueAndSign(t){let e=t[this.name],r;return e.charAt(0)==="-"?(r=-1,e=e.substring(1)):r=1,{valueStr:e,sign:r}}parseGroups(t){const{valueStr:e,sign:r}=this.getValueAndSign(t);let n=0,o;for(o=0;o<e.length;o++){const c=e[o];if(c==="X")break;n=n*10+parseInt(c,10)}if(o<e.length){let c=1;for(let w=0;w<e.length-o;w++)c*=10;const p=r*n*c,m=p+c-1;n={start:p,end:m}}else n*=r;const u=t[a.groupName(N.uncertainAndApproximateGroup,this.name)],i=t[a.groupName(N.approximateGroup,this.name)]||u,d=t[a.groupName(N.uncertainGroup,this.name)]||u;return{value:n,approximate:i?!!i:!1,uncertain:d?!!d:!1}}}const er="yearValue";class zt extends N{constructor(){super(er,zt.format())}static format(t=""){return"Y?"+N.numberFormat(a.groupName(t,er),"+","[-]?")}parse(t){const e=this.regexGroups(t);return this.parseGroups(e)}}const rr="monthValue";class Yt extends N{static format(t=""){return N.numberFormat(a.groupName(t,rr),"{1,2}",void 0)}constructor(){super(rr,Yt.format())}}const nr="dayValue";class qt extends N{static format(t=""){return N.numberFormat(a.groupName(t,nr),"{1,2}",void 0)}constructor(){super(nr,qt.format())}}const sr="hourValue";class Ht extends N{static format(t=""){return N.numberFormat(a.groupName(t,sr),"{1,2}",void 0)}constructor(){super(sr,Ht.format())}}const or="minuteValue";class Xt extends N{static format(t=""){return N.numberFormat(a.groupName(t,or),"{1,2}",void 0)}constructor(){super(or,Xt.format())}}const ar="secondValue";class Wt extends N{static format(t=""){return N.numberFormat(a.groupName(t,ar),"{1,2}",void 0)}constructor(){super(ar,Wt.format())}}class Dt extends kt{}class v extends tt{static yearGroup="year";static monthGroup="month";static dayGroup="day";static hourGroup="hour";static minuteGroup="minute";static secondGroup="second";static millisecondGroup="millisecond";static timeshiftGroup="timeshift";constructor(t=v.format()){super("date",t)}static format(t=""){return a.group(a.groupName(t,v.yearGroup),zt.format(t))+a.optionalNonCapturingGroup("-",a.group(a.groupName(t,v.monthGroup),Yt.format(t)),a.optionalNonCapturingGroup("-",a.group(a.groupName(t,v.dayGroup),qt.format(t)),a.optionalNonCapturingGroup("[T ]",a.group(a.groupName(t,v.hourGroup),Ht.format(t)),":",a.group(a.groupName(t,v.minuteGroup),Xt.format(t)),a.optionalNonCapturingGroup(":",a.group(a.groupName(t,v.secondGroup),Wt.format(t)),a.optionalNonCapturingGroup("[.,]",a.group(a.groupName(t,v.millisecondGroup),"\\d+"))),a.optionalGroup(a.groupName(t,v.timeshiftGroup),Dt.format(t)))))}parseGroups(t){const e=t[v.millisecondGroup],r=e?mt.parseFraction(e):void 0,n=t[v.secondGroup],o=n?ut.fromString(n,new Wt):void 0,u=t[v.minuteGroup];let i;u&&(i=it.fromString(u,new Xt),i.uncertain=i.uncertain||o?.uncertain||!1,i.approximate=i.approximate||o?.approximate||!1);const d=t[v.hourGroup];let c;d&&(c=at.fromString(d,new Ht),c.uncertain=c.uncertain||i?.uncertain||!1,c.approximate=c.approximate||i?.approximate||!1);const p=t[v.dayGroup];let m;p&&(m=ot.fromString(p,new qt),m.uncertain=m.uncertain||c?.uncertain||!1,m.approximate=m.approximate||c?.approximate||!1);const w=t[v.monthGroup];let y;w&&(y=st.fromString(w,new Yt),y.uncertain=y.uncertain||m?.uncertain||!1,y.approximate=y.approximate||m?.approximate||!1);const x=t[v.yearGroup];let S;x&&(S=nt.fromString(x,void 0,new zt),S.uncertain=S.uncertain||y?.uncertain||!1,S.approximate=S.approximate||y?.approximate||!1);const T=t[v.timeshiftGroup],g=T?lt.fromString(T,new Dt,{year:S?.value,month:y?.value,day:m?.value,hour:c?.value}):void 0;return{year:S,month:y,day:m,hour:c,minute:i,second:o,millisecond:r,timeshift:g}}}const ir="years",ur="months",cr="days",mr="hours",dr="minutes",pr="seconds";class ht extends N{static format(t=""){return"P"+a.optionalNonCapturingGroup(a.numberGroup(a.groupName(t,ir),"+",void 0,"\\d"),"Y")+a.optionalNonCapturingGroup(a.numberGroup(a.groupName(t,ur),"+",void 0,"\\d"),"MM")+a.optionalNonCapturingGroup(a.numberGroup(a.groupName(t,cr),"+",void 0,"\\d"),"D")+a.optionalNonCapturingGroup(a.numberGroup(a.groupName(t,mr),"+",void 0,"\\d"),"H")+a.optionalNonCapturingGroup(a.numberGroup(a.groupName(t,dr),"+",void 0,"\\d"),"M")+a.optionalNonCapturingGroup(a.numberGroup(a.groupName(t,pr),"+",void 0,"\\d"),"S")+this.formatSuffix(t)}constructor(){super("duration",ht.format())}parseGroups(t){return{years:t[ir],months:t[ur],days:t[cr],hours:t[mr],minutes:t[dr],seconds:t[pr],uncertain:!!t[N.uncertainGroup],approximate:!!t[N.approximateGroup]}}}const An="dates",le="start",fe="end",hr="durations",ge="durationMin",we="durationMax";class Ae extends tt{static format=a.group(An,a.optionalGroup(le,a.group("openStart","\\.\\.")+"|"+v.format(le))+"/"+a.optionalGroup(fe,a.group("openEnd","\\.\\.")+"|"+v.format(fe)))+"|"+a.group(hr,a.group(ge,ht.format(ge))+"/"+a.group(we,ht.format(we)));constructor(t="interval",e=Ae.format){super(t,e)}parseGroups(t){let e,r;if(t[hr]){const o=t[ge];e=k.fromString(o,new ht);const u=t[we];r=k.fromString(u,new ht)}else{const o=t[le];switch(o){case void 0:e=null;break;case"..":e=void 0;break;default:e=O.fromString(o,new v)}const u=t[fe];switch(u){case void 0:r=null;break;case"..":r=void 0;break;default:r=O.fromString(u,new v)}}return{start:e,end:r}}}h.register(O,()=>new v);h.register(ot,()=>new qt);h.register(k,()=>new ht);h.register(at,()=>new Ht);h.register(Ct,()=>new Ae);h.register(it,()=>new Xt);h.register(st,()=>new Yt);h.register(ut,()=>new Wt);h.register(lt,()=>new Dt);h.register(nt,()=>new zt);class b extends N{static uncertainGroup="uncertain1";static approximateGroup="approx1";static uncertainAndApproximateGroup=b.uncertainGroup+b.approximateGroup;constructor(t,e){super(t,e)}static numberFormat(t,e,r){return this.qualifierFormat(a.groupName(b.uncertainGroup,t),"?")+this.qualifierFormat(a.groupName(b.approximateGroup,t),"~")+this.qualifierFormat(a.groupName(b.uncertainAndApproximateGroup,t),"%")+N.numberFormat(t,e,r)}parseGroups(t){const e=super.parseGroups(t),r=t[a.groupName(b.uncertainAndApproximateGroup,this.name)];return(t[a.groupName(b.uncertainGroup,this.name)]||r)&&(e.uncertainComponent=!0),(t[a.groupName(b.approximateGroup,this.name)]||r)&&(e.approximateComponent=!0),e}}const Ft="yearValue",lr="exp",fr="signif";class Kt extends b{constructor(){super(Ft,Kt.format())}static format(t=""){return"Y?"+a.nonCapturingGroup(a.group(a.groupName(t,lr),"[-]?\\d+E\\d+")+"|"+b.numberFormat(a.groupName(t,Ft),"+","[-]?")+a.optionalGroup(a.groupName(t,fr),"S\\d+"))}parseGroups(t){const e=t[lr];if(e){const u=e.indexOf("E"),i=parseInt(e.substring(u+1),10),c=parseInt(e.substring(0,u),10)*Math.pow(10,i);t[Ft]=c.toString()}const r=t[fr],n=t[Ft];if(r){const u=parseInt(r.substring(1),10),{valueStr:i,sign:d}=this.getValueAndSign(t);let c="";for(let p=0;p<i.length;p++)c+=p<u?i.charAt(p):"X";t[Ft]=(d<0?"-":"")+c}const o=super.parseGroups(t);return r&&(o.value.estimate=parseInt(n,10)),o}parse(t){const e=this.regexGroups(t);return this.parseGroups(e)}}const gr="monthValue";class Jt extends b{static format(t=""){return b.numberFormat(a.groupName(t,gr),"{1,2}",void 0)}constructor(){super(gr,Jt.format())}}const wr="dayValue";class Zt extends b{static format(t=""){return b.numberFormat(a.groupName(t,wr),"{1,2}",void 0)}constructor(){super(wr,Zt.format())}}const Sr="hourValue";class Qt extends b{static format(t=""){return b.numberFormat(a.groupName(t,Sr),"{1,2}",void 0)}constructor(){super(Sr,Qt.format())}}const yr="secondValue";class Pt extends b{static format(t=""){return b.numberFormat(a.groupName(t,yr),"{1,2}",void 0)}constructor(){super(yr,Pt.format())}}const xr="minuteValue";class Lt extends b{static format(t=""){return b.numberFormat(a.groupName(t,xr),"{1,2}",void 0)}constructor(){super(xr,Lt.format())}}class kn extends Dt{}class E extends tt{static yearGroup=v.yearGroup;static monthGroup="month";static dayGroup="day";static hourGroup="hour";static minuteGroup="minute";static secondGroup="second";static millisecondGroup="millisecond";static timeshiftGroup="timeshift";constructor(){super("date",E.format())}static format(t=""){return a.group(a.groupName(t,E.yearGroup),Kt.format(t))+a.optionalNonCapturingGroup("-",a.group(a.groupName(t,E.monthGroup),Jt.format(t)),a.optionalNonCapturingGroup("-",a.group(a.groupName(t,E.dayGroup),Zt.format(t)),a.optionalNonCapturingGroup("[T ]",a.group(a.groupName(t,E.hourGroup),Qt.format(t)),":",a.group(a.groupName(t,E.minuteGroup),Lt.format(t)),a.optionalNonCapturingGroup(":",a.group(a.groupName(t,E.secondGroup),Pt.format(t)),a.optionalNonCapturingGroup("[.,]",a.group(a.groupName(t,E.millisecondGroup),"\\d+"))),a.optionalGroup(a.groupName(t,E.timeshiftGroup),kn.format(t)))))}parseGroups(t){const e=t[E.millisecondGroup],r=e?mt.parseFraction(e):void 0,n=t[E.secondGroup];let o;n&&(o=_.fromString(n,void 0,new Pt),o.uncertain=o?.uncertain||!1,o.approximate=o?.approximate||!1);const u=t[E.minuteGroup];let i;u&&(i=L.fromString(u,new Lt),i.uncertain=i.uncertain||o?.uncertain||!1,i.approximate=i.approximate||o?.approximate||!1);const d=t[E.hourGroup];let c;d&&(c=P.fromString(d,new Qt),c.uncertain=c.uncertain||i?.uncertain||!1,c.approximate=c.approximate||i?.approximate||!1);const p=t[E.dayGroup];let m;p&&(m=Q.fromString(p,new Zt),m.uncertain=m.uncertain||c?.uncertain||!1,m.approximate=m.approximate||c?.approximate||!1);const w=t[E.monthGroup];let y;w&&(y=Z.fromString(w,new Jt),y.uncertain=y.uncertain||m?.uncertain||!1,y.approximate=y.approximate||m?.approximate||!1);const x=t[E.yearGroup];let S;x&&(S=J.fromString(x,void 0,new Kt),S.uncertain=S.uncertain||y?.uncertain||!1,S.approximate=S.approximate||y?.approximate||!1);const T=t[E.timeshiftGroup],g=T?Vr.fromString(T,new Dt,{year:S?.value,month:y?.value,day:m?.value,hour:c?.value}):void 0;return{year:S,month:y,day:m,hour:c,minute:i,second:o,millisecond:r,timeshift:g}}}const Mr="durationValue";class ke extends b{static format(t=""){return"^"+b.numberFormat(a.groupName(t,Mr),"+",void 0)}constructor(){super(Mr,ke.format())}}class Rn extends Ee{millisecond=new G("millisecond",0,Number.MAX_SAFE_INTEGER,void 0);second=new G("second",0,Number.MAX_SAFE_INTEGER,this.millisecond);minute=new G("minute",0,Number.MAX_SAFE_INTEGER,this.second);hour=new G("hour",0,Number.MAX_SAFE_INTEGER,this.minute);day=new G("day",1,Number.MAX_SAFE_INTEGER,this.hour);month=new G("month",1,Number.MAX_SAFE_INTEGER,this.day);year=new G("year",0,Number.MAX_SAFE_INTEGER,this.month)}const ft=new Rn;class l extends b{static yearsGroup="years";static monthsGroup="months";static isoMonthsGroup="isoMonths";static daysGroup="days";static hoursGroup="hours";static minutesGroup="minutes";static secondsGroup="seconds";static durationGroup="duration";static suffixGroup="durationSuffix";static componentParser=new ke;static componentFormat(t,e,r,n,o=""){const u=a.group(a.groupName(t,l.quantityGroup(e)),b.numberFormat(a.groupName(t,r),"+",void 0,"\\d"));return a.group(a.groupName(t,e),u,n,o)}static quantityGroup(t){return t+"Quantity"}static isoMonthsLookahead="(?=[?~%]?\\d+D|T)";constructor(){super("duration",l.format())}static format(t=""){const e=a.groupName(t,l.durationGroup);return this.qualifierFormat(a.groupName(b.uncertainGroup,e),"?")+this.qualifierFormat(a.groupName(b.approximateGroup,e),"~")+this.qualifierFormat(a.groupName(b.uncertainAndApproximateGroup,e),"%")+"P"+a.optional(l.componentFormat(t,l.yearsGroup,E.yearGroup,"Y"))+a.optionalNonCapturingGroup(l.componentFormat(t,l.monthsGroup,E.monthGroup,"MM")+"|"+l.componentFormat(t,l.isoMonthsGroup,"isoMonth","M",l.isoMonthsLookahead))+a.optional(l.componentFormat(t,l.daysGroup,E.dayGroup,"D"))+"T?"+a.optional(l.componentFormat(t,l.hoursGroup,E.hourGroup,"H"))+a.optional(l.componentFormat(t,l.minutesGroup,E.minuteGroup,"M"))+a.optional(l.componentFormat(t,l.secondsGroup,E.secondGroup,"S"))+a.optionalGroup(a.groupName(t,l.suffixGroup),"[?~%]")}static parseComponent(t,e,r){const n=l.componentParser.parse(t);return new e(n,r)}parseGroups(t){const e=t[l.quantityGroup(l.secondsGroup)];let r;e&&(r=l.parseComponent(e,_,ft.second),r.uncertain=!!t[a.groupName(b.uncertainGroup,l.secondsGroup)]||!1,r.approximate=!!t[a.groupName(b.approximateGroup,l.secondsGroup)]||!1);const n=t[l.quantityGroup(l.minutesGroup)];let o;n&&(o=l.parseComponent(n,L,ft.minute),o.uncertain=o.uncertain||r?.uncertain||!1,o.approximate=o.approximate||r?.approximate||!1);const u=t[l.quantityGroup(l.hoursGroup)];let i;u&&(i=l.parseComponent(u,P,ft.hour),i.uncertain=i.uncertain||o?.uncertain||!1,i.approximate=i.approximate||o?.approximate||!1);const d=t[l.quantityGroup(l.daysGroup)];let c;d&&(c=l.parseComponent(d,Q,ft.day),c.uncertain=c.uncertain||i?.uncertain||!1,c.approximate=c.approximate||i?.approximate||!1);const p=t[l.quantityGroup(l.monthsGroup)]||t[l.quantityGroup(l.isoMonthsGroup)];let m;p&&(m=l.parseComponent(p,Z,ft.month),m.uncertain=m.uncertain||c?.uncertain||!1,m.approximate=m.approximate||c?.approximate||!1);const w=t[l.quantityGroup(l.yearsGroup)];let y;w&&(y=l.parseComponent(w,J,ft.year),y.uncertain=y.uncertain||m?.uncertain||!1,y.approximate=y.approximate||m?.approximate||!1);const x=t[l.suffixGroup],S=!!t[a.groupName(b.uncertainAndApproximateGroup,l.durationGroup)]||x==="%",T=S||!!t[a.groupName(b.uncertainGroup,l.durationGroup)]||x==="?",g=S||!!t[a.groupName(b.approximateGroup,l.durationGroup)]||x==="~";return{years:y,months:m,days:c,hours:i,minutes:o,seconds:r,uncertain:T,approximate:g}}}const Fn="dates",Se="start",ye="end",br="durations",xe="durationMin",Me="durationMax";class ce extends tt{static format=a.group(Fn,a.optionalGroup(Se,a.group("openStart","\\.\\.")+"|"+E.format(Se))+"/"+a.optionalGroup(ye,a.group("openEnd","\\.\\.")+"|"+E.format(ye)))+"|"+a.group(br,a.group(xe,l.format(xe))+"/"+a.group(Me,l.format(Me)));constructor(t="interval",e=ce.format){super(t,e)}parseGroups(t){let e,r;if(t[br]){const o=t[xe];e=A.fromString(o,new l);const u=t[Me];r=A.fromString(u,new l)}else{const o=t[Se];switch(o){case void 0:e=null;break;case"..":e=void 0;break;default:e=B.fromString(o,new E)}const u=t[ye];switch(u){case void 0:r=null;break;case"..":r=void 0;break;default:r=B.fromString(u,new E)}}return{start:e,end:r}}}class $n{parse(t){t=t.trim();const e=t.startsWith("["),n=t.substring(1,t.length-1).split(","),o=[];for(const u of n){let i;u.includes("..")?i=Ut.fromString(u.replace("..","/"),new ce):i=B.fromString(u,new E),o.push(i)}return{values:o,exclusive:e}}}h.register(B,()=>new E);h.register(Q,()=>new Zt);h.register(A,()=>new l);h.register(P,()=>new Qt);h.register(Ut,()=>new ce);h.register(L,()=>new Lt);h.register(Z,()=>new Jt);h.register(_,()=>new Pt);h.register(ne,()=>new $n);h.register(J,()=>new Kt);class X{constructor(t){this.preferences=t}read(t){var e,r;if(t===void 0)return;if(typeof t=="string")return t===""?void 0:t;for(const o of this.preferences){const u=(e=t[o])!==null&&e!==void 0?e:t[X.base(o)];if(u)return u}const n=new Set(this.preferences.map(o=>X.base(o)));for(const[o,u]of Object.entries(t))if(u&&n.has(X.base(o)))return u;return(r=Object.values(t).find(o=>o))!==null&&r!==void 0?r:void 0}write(t,e,r){var n,o;const u=e?.trim()?e.trim():void 0;if(t===void 0||typeof t=="string")return u;const i={...t},d=(o=(n=Object.keys(i).find(c=>c===r))!==null&&n!==void 0?n:Object.keys(i).find(c=>X.base(c)===X.base(r)))!==null&&o!==void 0?o:r;return u===void 0?delete i[d]:i[d]=u,Object.keys(i).length===0?void 0:i}static base(t){return t.toLowerCase().split("-")[0]}}X.any=new X([]);var Er;(function(s){s.abductee="abductee",s.actor="actor",s.artist="artist",s.anthropologist="anthropologist",s.archeologist="archeologist",s.astronaut="astronaut",s.astronomer="astronomer",s.astrologist="astrologist",s.astrophysicist="astrophysicist",s.banker="banker",s.barman="barman",s.biologist="biologist",s.biochemist="biochemist",s.biophysicist="biophysicist",s.bishop="bishop",s.businessman="businessman",s.botanist="botanist",s.cameraman="cameraman",s.chemist="chemist",s.contactee="contactee",s.cryptozoologist="cryptozoologist",s.dentist="dentist",s.director="director",s.diplomat="diplomat",s.diver="diver",s.electronics="electronics",s.engineer="engineer",s.ethnologist="ethnologist",s.exobiologist="exobiologist",s.farmer="farmer",s.firefighter="firefighter",s.flightAttendant="flightAttendant",s.geologist="geologist",s.geophysicist="geophysicist",s.geographer="geographer",s.historian="historian",s.houseWife="houseWife",s.hypnotherapist="hypnotherapist",s.illusionist="illusionist",s.journalist="journalist",s.judge="judge",s.lawyer="lawyer",s.leader="leader",s.librarian="librarian",s.logger="logger",s.mathematician="mathematician",s.mechanic="mechanic",s.meteorologist="meteorologist",s.military="military",s.musician="musician",s.neurologist="neurologist",s.neuroscientist="neuroscientist",s.neuropsychiatrist="neuropsychiatrist",s.nurse="nurse",s.oceanographer="oceanographer",s.painter="painter",s.parapsychologist="parapsychologist",s.philosopher="philosopher",s.photographer="photographer",s.physician="physician",s.physicist="physicist",s.pilot="pilot",s.politician="politician",s.policeman="policeman",s.priest="priest",s.producer="producer",s.prospector="prospector",s.psychologist="psychologist",s.psychiatrist="psychiatrist",s.radioastronomer="radioastronomer",s.radioamateur="radioamateur",s.salesman="salesman",s.sailor="sailor",s.sociologist="sociologist",s.softwareEngineer="softwareEngineer",s.stuntman="stuntman",s.taxiDriver="taxiDriver",s.teacher="teacher",s.telegrapher="telegrapher",s.truckDriver="truckDriver",s.ufologist="ufologist",s.ufoWitness="ufoWitness",s.ufoWitness2="ufoWitness2",s.worker="worker",s.writer="writer"})(Er||(Er={}));var Gr;(function(s){s.neutral="neutral",s.male="male",s.female="female"})(Gr||(Gr={}));const In="modulepreload",Cn=function(s,t){return new URL(s,t).href},Nr={},ee=function(t,e,r){let n=Promise.resolve();if(e&&e.length>0){let u=function(p){return Promise.all(p.map(m=>Promise.resolve(m).then(w=>({status:"fulfilled",value:w}),w=>({status:"rejected",reason:w}))))};const i=document.getElementsByTagName("link"),d=document.querySelector("meta[property=csp-nonce]"),c=d?.nonce||d?.getAttribute("nonce");n=u(e.map(p=>{if(p=Cn(p,r),p in Nr)return;Nr[p]=!0;const m=p.endsWith(".css"),w=m?'[rel="stylesheet"]':"";if(!!r)for(let S=i.length-1;S>=0;S--){const T=i[S];if(T.href===p&&(!m||T.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${p}"]${w}`))return;const x=document.createElement("link");if(x.rel=m?"stylesheet":In,m||(x.as="script"),x.crossOrigin="",x.href=p,c&&x.setAttribute("nonce",c),document.head.appendChild(x),m)return new Promise((S,T)=>{x.addEventListener("load",S),x.addEventListener("error",()=>T(new Error(`Unable to preload CSS for ${p}`)))})}))}function o(u){const i=new Event("vite:preloadError",{cancelable:!0});if(i.payload=u,window.dispatchEvent(i),!i.defaultPrevented)throw u}return n.then(u=>{for(const i of u||[])i.status==="rejected"&&o(i.reason);return t().catch(o)})};class Un extends Error{constructor(t,e){super(t),this.cause=e}}class Re extends Un{constructor(t=Re.defaultMessage,e){super(t,e)}}Re.defaultMessage="Assertion failed";var vr;(function(s){s.country="country",s.region="region",s.department="department",s.city="city",s.company="company"})(vr||(vr={}));var Tr;(function(s){s.at="at",s.au="au",s.ar="ar",s.be="be",s.br="br",s.ca="ca",s.ch="ch",s.cn="cn",s.cl="cl",s.co="co",s.cy="cy",s.de="de",s.dk="dk",s.do="do",s.dz="dz",s.gr="gr",s.ec="ec",s.eg="eg",s.es="es",s.fi="fi",s.fr="fr",s.ga="ga",s.ge="ge",s.hu="hu",s.in="in",s.ie="ie",s.ir="ir",s.il="il",s.it="it",s.jp="jp",s.kr="kr",s.ma="ma",s.mx="mx",s.my="my",s.mz="mz",s.nl="nl",s.no="no",s.nz="nz",s.pa="pa",s.pe="pe",s.ph="ph",s.pl="pl",s.pt="pt",s.ro="ro",s.ru="ru",s.sc="sc",s.tr="tr",s.ua="ua",s.uk="uk",s.us="us",s.sa="sa",s.se="se",s.su="su",s.tn="tn",s.tw="tw",s.ve="ve",s.za="za"})(Tr||(Tr={}));class K{static NAMES=["weather","place","lightPollution","decor"];static KEYS={weather:["weatherTrack","weatherSource"],place:["place"],lightPollution:["lightPollution"],decor:["decor"]};static annexName(t,e){return`${t}.${e.replace(/[A-Z]/g,r=>`-${r.toLowerCase()}`)}.json`}static taken(t,e){const r={};if(t==="decor")return Array.isArray(e.decor)&&(r.decor=e.decor.filter(K.surveyed)),r;for(const n of K.KEYS[t])e[n]!==void 0&&(r[n]=e[n]);return r}static strip(t,e){if(t==="decor"){const r=Array.isArray(e.decor)?e.decor.filter(n=>!K.surveyed(n)):[];r.length>0?e.decor=r:delete e.decor;return}for(const r of K.KEYS[t])delete e[r]}static put(t,e,r){if(t==="decor"){if(!Array.isArray(r.decor))return;const n=Array.isArray(e.decor)?e.decor.filter(o=>!K.surveyed(o)):[];e.decor=[...n,...r.decor];return}for(const n of K.KEYS[t])r[n]!==void 0&&(e[n]=r[n])}static surveyed(t){return typeof t=="object"&&t!==null&&typeof t.origin=="string"}static fromFile(t,e){return t?.[e]!==void 0&&t[e].live!==!0}}class $t{static MAX_SPECKS=4;static BROADCAST_35MM={framesPerSecond:24,contrast:1.6,tint:[.99,.98,.92],softness:1.6/480,specksPerFrame:1.15,speckRadius:1.6/480,speckRadiusMax:4.5/480,weave:[.25/640,.6/480],grain:.008};static hash(t,e){const r=Math.sin(t*127.1+e*311.7)*43758.5453;return r-Math.floor(r)}static frameAt(t,e){return Math.floor(e*t.framesPerSecond/1e3)}static frame(t,e){const r=i=>$t.hash(e,i),n=i=>(r(i)+r(i+1)+r(i+2)-1.5)*2,o=Math.min(1,t.specksPerFrame/$t.MAX_SPECKS),u=[];for(let i=0;i<$t.MAX_SPECKS;i++){const d=10+i*6;if(r(d)>=o)continue;const c=r(d+3)**3;u.push({u:r(d+1),v:r(d+2),radius:t.speckRadius*.6+c*(t.speckRadiusMax-t.speckRadius*.6),kept:.25+.4*r(d+4)})}return{weave:[n(1)*t.weave[0],n(4)*t.weave[1]],specks:u,seed:r(7)}}}class yt{static DEFAULT_FOCAL_MM=50;static FOCAL_RANGE_MM={minMm:14,maxMm:135};static BODIES=[{id:"eos-450d",name:"Canon EOS 450D (APS-C)",widthMm:22.2,heightMm:14.8,pixelUm:5.2,year:2008},{id:"eos-60da",name:"Canon EOS 60Da (APS-C)",widthMm:22.3,heightMm:14.9,pixelUm:4.3,year:2012},{id:"eos-70d",name:"Canon EOS 70D (APS-C)",widthMm:22.5,heightMm:15,pixelUm:4.1,year:2013},{id:"eos-80d",name:"Canon EOS 80D (APS-C)",widthMm:22.3,heightMm:14.9,pixelUm:3.7,year:2016},{id:"eos-7d",name:"Canon EOS 7D (APS-C)",widthMm:22.3,heightMm:14.9,pixelUm:4.1,year:2009},{id:"eos-7d-ii",name:"Canon EOS 7D Mark II (APS-C)",widthMm:22.4,heightMm:15,pixelUm:4.1,year:2014},{id:"eos-5d",name:"Canon EOS 5D (full frame)",widthMm:35.8,heightMm:23.9,pixelUm:8.2,year:2005},{id:"eos-5d-ii",name:"Canon EOS 5D Mark II (full frame)",widthMm:36,heightMm:24,pixelUm:6.4,year:2008},{id:"eos-5d-iii",name:"Canon EOS 5D Mark III (full frame)",widthMm:36,heightMm:24,pixelUm:6.25,year:2012},{id:"eos-5d-iv",name:"Canon EOS 5D Mark IV (full frame)",widthMm:36,heightMm:24,pixelUm:5.36,year:2016},{id:"eos-6d",name:"Canon EOS 6D (full frame)",widthMm:35.8,heightMm:23.9,pixelUm:6.55,year:2012},{id:"eos-6d-ii",name:"Canon EOS 6D Mark II (full frame)",widthMm:36,heightMm:24,pixelUm:5.77,year:2017},{id:"nikon-d3",name:"Nikon D3 / D700 (full frame)",widthMm:36,heightMm:23.9,pixelUm:8.44,year:2007},{id:"nikon-d7000",name:"Nikon D7000 (DX)",widthMm:23.6,heightMm:15.6,pixelUm:4.78,year:2010},{id:"nikon-d7100",name:"Nikon D7100 / D7200 (DX)",widthMm:23.5,heightMm:15.6,pixelUm:3.9,year:2013},{id:"nikon-d500",name:"Nikon D500 / D7500 (DX)",widthMm:23.5,heightMm:15.7,pixelUm:4.2,year:2016}];static instruments(){return yt.BODIES.map(t=>({id:t.id,category:"dslr",name:t.name,projection:"rectilinear",frame:{widthMm:t.widthMm,heightMm:t.heightMm,focalLengthMm:yt.DEFAULT_FOCAL_MM,focalRangeMm:yt.FOCAL_RANGE_MM},fNumber:8,fNumberRange:{min:1.4,max:22},exposureSeconds:1/250,exposureRangeSeconds:{min:1/8e3,max:3600},years:{from:t.year},apertureBlades:7,detailUm:t.pixelUm,medium:{kind:"sensor",iso:100}}))}static names(){return Object.fromEntries(yt.BODIES.map(t=>[t.id,t.name]))}}class Y{static DEFAULT_EYEPIECE_MM=26;static DEFAULT_APPARENT_FIELD_DEG=52;static FIELD_STOP_MM=2*Y.DEFAULT_EYEPIECE_MM*Math.tan(Y.DEFAULT_APPARENT_FIELD_DEG*Math.PI/360);static RANGE={min:26/40*.63,max:26/6*3};static BINOCULARS=[{id:"binoculars-zeiss-6x30",name:"Carl Zeiss 6x30",magnification:6,apertureMm:30,trueFieldDeg:5,fromYear:1960},{id:"binoculars-zeiss-dialyt-10x40",name:"Carl Zeiss Dialyt 10x40 B T*",magnification:10,apertureMm:40,trueFieldDeg:6.3,fromYear:1975},{id:"binoculars-jenoptem-10x50",name:"Jenoptem 10x50 W",magnification:10,apertureMm:50,trueFieldDeg:7.3,fromYear:1960},{id:"binoculars-swarovski-7x50-habicht",name:"Swarovski 7x50 SL Habicht",magnification:7,apertureMm:50,trueFieldDeg:6.6,fromYear:1960},{id:"binoculars-swarovski-7x50-slc",name:"Swarovski 7x50 SLC",magnification:7,apertureMm:50,trueFieldDeg:7.1,fromYear:1990},{id:"binoculars-nikon-10x42-edg",name:"Nikon 10x42 EDG",magnification:10,apertureMm:42,trueFieldDeg:6.5,fromYear:2011},{id:"binoculars-canon-15x50-is",name:"Canon 15x50 IS All Weather",magnification:15,apertureMm:50,trueFieldDeg:4.5,fromYear:2008},{id:"binoculars-celestron-15x70",name:"Celestron 15x70 SkyMaster",magnification:15,apertureMm:70,trueFieldDeg:4.4,fromYear:1990},{id:"binoculars-miyauchi-25x141",name:"Miyauchi BR-141 Galaxy 45 25x141",magnification:25,apertureMm:141,trueFieldDeg:2.6,fromYear:2e3}];static TELESCOPES=[{id:"telescope-generic-60-700",name:"Telescope 60/700",apertureMm:60,focalLengthMm:700},{id:"telescope-generic-60-1000",name:"Telescope 60/1000",apertureMm:60,focalLengthMm:1e3},{id:"telescope-celestron-onyx-80edf",name:"Celestron Onyx 80EDF",apertureMm:80,focalLengthMm:500,fromYear:2010},{id:"telescope-celestron-c5",name:"Celestron C5 f/10",apertureMm:125,focalLengthMm:1250,fromYear:1970},{id:"telescope-celestron-c8",name:"Celestron C8 f/10",apertureMm:203,focalLengthMm:2032,fromYear:1970},{id:"telescope-celestron-c11",name:"Celestron C11 f/10",apertureMm:280,focalLengthMm:2800,fromYear:1970},{id:"telescope-celestron-c14",name:"Celestron C14 f/11",apertureMm:355.6,focalLengthMm:3910,fromYear:1970},{id:"telescope-meade-etx-80",name:"Meade ETX 80 f/5",apertureMm:80,focalLengthMm:400,fromYear:1996},{id:"telescope-meade-etx-90",name:"Meade ETX 90 f/13.8",apertureMm:90,focalLengthMm:1242,fromYear:1996},{id:"telescope-meade-etx-125",name:"Meade ETX 125 f/15",apertureMm:127,focalLengthMm:1900,fromYear:1996},{id:"telescope-meade-lx200-8",name:"Meade LX200 8 in f/10",apertureMm:200,focalLengthMm:2e3,fromYear:1992},{id:"telescope-meade-lx200-10",name:"Meade LX200 10 in f/10",apertureMm:250,focalLengthMm:2500,fromYear:1992},{id:"telescope-meade-lx200-12",name:"Meade LX200 12 in f/10",apertureMm:305,focalLengthMm:3048,fromYear:1992},{id:"telescope-meade-lx200-14",name:"Meade LX200 14 in f/10",apertureMm:355,focalLengthMm:3556,fromYear:1992},{id:"telescope-meade-lx200-16",name:"Meade LX200 16 in f/10",apertureMm:406,focalLengthMm:4064,fromYear:1992}];static instruments(){const t=Y.BINOCULARS.map(n=>({id:n.id,category:"binoculars",name:n.name,projection:"rectilinear",visualAid:{apertureMm:n.apertureMm,magnification:n.magnification,trueFieldDeg:n.trueFieldDeg},...n.fromYear!==void 0?{years:{from:n.fromYear}}:{}})),e=Y.FIELD_STOP_MM,r=Y.TELESCOPES.map(n=>({id:n.id,category:"telescope",name:n.name,projection:"rectilinear",frame:{widthMm:e*16/9,heightMm:e,focalLengthMm:n.focalLengthMm,focalRangeMm:{minMm:n.focalLengthMm*Y.RANGE.min,maxMm:n.focalLengthMm*Y.RANGE.max}},visualAid:{apertureMm:n.apertureMm,eyepieceFocalMm:Y.DEFAULT_EYEPIECE_MM},...n.fromYear!==void 0?{years:{from:n.fromYear}}:{}}));return[...t,...r]}static names(){return Object.fromEntries(Y.instruments().map(t=>[t.id,t.name]))}}[(1/250,1/1e3),1/50,1/90,(1/250,1/1e3),(1/48,1/96,1/24,$t.BROADCAST_35MM),(1/250,1/1e3),(1/120,1/8e3),(1/120,1/8e3),(1/30,1/1e4,1/30),(1/50,1/1e5,1/50),...yt.instruments(),...Y.instruments()];const Vn=["spring","summer","autumn","winter"],jn=21;function On(s){if(s.raw!==void 0)return s.raw;if(s.year===void 0){if(s.hour===void 0)return"";let e=`${String(s.hour).padStart(2,"0")}:${String(s.minute??0).padStart(2,"0")}`;return s.second!==void 0&&(e+=`:${String(s.second).padStart(2,"0")}`),e}let t=String(s.year).padStart(4,"0");return s.season!==void 0?`${t}-${jn+Vn.indexOf(s.season)}`:(s.month===void 0||(t+=`-${String(s.month).padStart(2,"0")}`,s.day===void 0)||(t+=`-${String(s.day).padStart(2,"0")}`,s.hour===void 0)||(t+=`T${String(s.hour).padStart(2,"0")}:${String(s.minute??0).padStart(2,"0")}`,s.second!==void 0&&(t+=`:${String(s.second).padStart(2,"0")}`)),t)}class U{static toCurrent(t){const e=t.version,r=typeof e=="object"&&e!==null&&"value"in e?e.value:e;if(r!==void 0&&r!==1&&r!==2&&r!==3)return t;let n=t;return(r===void 0||r===1)&&(n=U.fromVersion1(n)),r!==3&&(n=U.fromVersion2(n)),U.fromVersion3(n)}static fromVersion3(t){const e={};for(const[r,n]of Object.entries(t))r==="frozen"?e.snapshots=n:e[r]=n;return e.version=4,e}static observerIdOf(t){return t.observer?.id??"observer"}static fromVersion2(t){const e={...t,version:3},r={...t.timeline??{keyframes:[]}},n=new Set,o=r.keyframes??[];for(const p of o)for(const m of p.shapes??[])n.add(m.sourceId);const u=[],i=p=>{let m=p;for(let w=u.length+1;m===void 0||n.has(m);w++)m=`group-${w}`;return n.add(m),m},d=Array.isArray(r.groups)?r.groups:[];for(const p of d)Array.isArray(p)?u.push({id:i(),members:[...p]}):typeof p=="object"&&p!==null&&u.push(p);const c=Array.isArray(t.events)?t.events.map(p=>({...p})):void 0;if(c){const p=U.observerIdOf(t),m=c.filter(g=>g.who==="phenomenon"),w=new Set(n);for(const g of m){const F=U.unwrapped(g.params?.parts);if(g.eventType==="appearance"&&Array.isArray(F))for(const C of F)C.sourceId&&w.add(C.sourceId)}for(const g of w)n.add(g);const y=g=>u.find(F=>F.members.includes(g)),x=g=>{const F=y(g);return F?x(F.id):g},S=[...new Set([...w].map(x))],T=S.length===1?S[0]:S.length>1?i("phenomenon"):"phenomenon";S.length>1&&u.push({id:T,members:S});for(const g of c)if(g.who===void 0||g.who==="observer")g.who=p;else if(g.who==="phenomenon"){g.who=T;const F=g.params;if(g.eventType!=="blink"||!F||!Array.isArray(F.parts))continue;const C=F.parts,{parts:me,...Or}=F;g.params=Or,g.who=U.groupFor(C,u,i)??T}e.events=c}return(u.length>0||d.length>0)&&(e.timeline={...r,groups:u}),e}static groupFor(t,e,r){if(t.length===1)return t[0];const n=c=>{const p=e.find(m=>m.id===c);return p?p.members.flatMap(n):[c]},o=e.find(c=>{const p=n(c.id);return p.length===t.length&&t.every(m=>p.includes(m))});if(o)return o.id;const u=new Set(t.map(c=>e.find(p=>p.members.includes(c))));if(u.size!==1)return;const[i]=u,d=r();if(i){const c=i.members.findIndex(p=>t.includes(p));i.members=i.members.filter(p=>!t.includes(p)),i.members.splice(c,0,d)}return e.push({id:d,members:[...t]}),d}static unwrapped(t){return U.isWrapped(t)?t.value:t}static fromVersion1(t){const e={...t,version:2};for(const r of["time","endTime"])t[r]!==void 0&&(e[r]=U.edtf(t[r]));if(Array.isArray(t.place)){const r=U.place(t.place);r===void 0?delete e.place:e.place=r}return e}static edtf(t){if(U.isWrapped(t)){const c=U.edtf(t.value);return c===void 0?void 0:{...t,value:c}}if(typeof t=="string")return t;const e=t,r=Object.values(e).find(c=>U.isWrapped(c)),n=Object.fromEntries(Object.entries(e).map(([c,p])=>[c,U.isWrapped(p)?p.value:p])),o=On(n);if(o==="")return;if(!r)return o;const{basis:u,rationale:i,how:d}=r;return{value:o,...u===void 0?{}:{basis:u},...i===void 0?{}:{rationale:i},...d===void 0?{}:{how:d}}}static place(t){if(t.length===0)return;const e=t.map(c=>U.isWrapped(c)?c.value:c),r=e.find(c=>c.name)?.name,n={...r?{name:r}:{},locations:e.map(({lat:c,lng:p})=>({lat:c,lng:p}))},o=t.find(c=>U.isWrapped(c));if(!o)return n;const{basis:u,rationale:i,how:d}=o;return{value:n,...u===void 0?{}:{basis:u},...i===void 0?{}:{rationale:i},...d===void 0?{}:{how:d}}}static isWrapped(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&"value"in t}}class gt extends Error{constructor(t,e,r){super(`${t}: ${e}${r===void 0?"":` (HTTP ${r})`}`),this.kind=t,this.url=e,this.status=r,this.name="SightingFetchError"}}class se{static async recording(t){const e=await se.json(t);for(const r of K.NAMES){const n=e?.snapshots?.[r];if(!(!n?.src||n.live))try{const o=U.toCurrent(await se.json(new URL(n.src,new URL(t,location.href)).href));K.put(r,e,o)}catch{}}return e}static async json(t){const e=new URL(t,location.href);if(location.protocol==="https:"&&e.protocol==="http:")throw new gt("mixed-content",t);let r;try{r=await fetch(t)}catch{throw await this.diagnose(t,e)}if(!r.ok)throw new gt("status",t,r.status);try{return await r.json()}catch{throw new gt("malformed",t)}}static async diagnose(t,e){if(e.origin===location.origin)return new gt("unreachable",t);try{return await fetch(t,{mode:"no-cors"}),new gt("cors",t)}catch{return new gt("unreachable",t)}}}function Bn(s,t){for(const e of s){const r=e.toLowerCase().split("-")[0];if(t.includes(r))return r}return"en"}class zn{static preferencesFor(t){const e=navigator.languages??[],r=this.declaredFor(t);return r?[r,...e]:e}static declaredFor(t){for(let e=t;e;){const r=e.closest("[lang]")?.getAttribute("lang")?.trim();if(r)return r;const n=e.getRootNode();e=n instanceof ShadowRoot?n.host:void 0}}}const Yn=["en","fr","es","it"];class Fe{static catalog(t){const e=new Map;return{load(r){const n=Fe.languageOf(r);let o=e.get(n);return o||(o=t[n](),e.set(n,o),o.catch(()=>e.delete(n))),o}}}static none(){return new Proxy({},{get:()=>""})}static blank(){const t=new Proxy(()=>t,{get:(e,r)=>r===Symbol.toPrimitive?()=>"":r===Symbol.iterator?function*(){}:r==="toString"||r==="valueOf"?()=>"":r==="then"?void 0:t,apply:()=>t,has:()=>!1,ownKeys:()=>[],getOwnPropertyDescriptor:()=>{}});return t}static languageOf(t){const e=t.toLowerCase().split("-")[0];return Yn.includes(e)?e:"en"}}const qn=["en","fr","es","it"],Hn={en:()=>ee(()=>import("./InterviewMessages_en-BNau2xU8.js"),[],import.meta.url).then(s=>s.interviewMessages_en),fr:()=>ee(()=>import("./InterviewMessages_fr-OCQdwn9j.js"),[],import.meta.url).then(s=>s.interviewMessages_fr),es:()=>ee(()=>import("./InterviewMessages_es-ypa0EDh9.js"),[],import.meta.url).then(s=>s.interviewMessages_es),it:()=>ee(()=>import("./InterviewMessages_it-awuOqf5v.js"),[],import.meta.url).then(s=>s.interviewMessages_it)},Xn=Fe.catalog(Hn),Wn="interviewseek";class Dn extends Error{constructor(t,e,r){super(typeof e=="number"&&Number.isInteger(e)&&e>r?`This ${t} file is in version ${e} of its format; this UFO@home reads up to version ${r}. Read it with a newer UFO@home.`:`This ${t} file states ${JSON.stringify(e)} as its format version, which is not a version.`),this.format=t,this.found=e,this.supported=r,this.name="FormatVersionError"}said(t){return t.replace("{found}",typeof this.found=="number"?String(this.found):JSON.stringify(this.found)).replace("{supported}",String(this.supported))}}class xt{static CURRENT={sighting:4,case:1,interview:1};static SCHEMA_BASE="https://ufoathome.org/schema";static schemaUrl(t,e=xt.CURRENT[t]){return`${xt.SCHEMA_BASE}/${e}/${t}.schema.json`}static of(t){if(typeof t!="object"||t===null)return 1;const e=t.version;return e===void 0?1:typeof e=="object"&&e!==null&&"value"in e?e.value:e}static check(t,e){const r=xt.of(t),n=xt.CURRENT[e];if(typeof r!="number"||!Number.isInteger(r)||r<1||r>n)throw new Dn(e,r,n);return t}}class ${static read(t){return xt.check(t,"interview")}static isProofread(t){const e=Object.keys(t.speakers);return e.length>0&&e.every(r=>{const n=t.proofreading?.[r]?.status;return n==="approved"||n==="covered"})}static said(t){return t.parts?t.parts.map(e=>"redacted"in e?"…":$.plain(e.text)).join(" "):t.redacted?void 0:$.plain(t.text??"")}static ENTITIES={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" "};static plain(t){return/[<&]/.test(t)?t.replace(/<br\s*\/?>/gi,`
2
- `).replace(/<\/?[a-z][^>]*>/gi,"").replace(/&#x([0-9a-f]+);/gi,(e,r)=>String.fromCodePoint(parseInt(r,16))).replace(/&#(\d+);/g,(e,r)=>String.fromCodePoint(Number(r))).replace(/&(\w+);/g,(e,r)=>$.ENTITIES[r.toLowerCase()]??e):t}static sightingsOf(t){return[t.interviewOf].flat().filter(e=>typeof e=="string")}static passagesAbout(t,e){const r=$.sightingsOf(t),n=[];return t.segments.forEach((o,u)=>{for(const i of o.refs??[]){if(i.sighting===void 0?!r.includes(e):i.sighting!==e)continue;const d=$.said(o);n.push({index:u,speaker:o.speaker,at:i.at,...d!==void 0?{text:d}:{},...i.range?{range:i.range}:{}})}}),n.sort((o,u)=>o.at-u.at||o.index-u.index)}static clock(t,e=!1){const r=Math.round(t*10),n=Math.floor(r/10),o=d=>String(d).padStart(2,"0"),u=Math.floor(n/3600),i=`${u>0||e?o(Math.floor(n/60)%60):Math.floor(n/60)}:${o(n%60)}`;return`${u>0?`${u}:`:""}${i}${e||r%10!==0?`.${r%10}`:""}`}static speakerName(t,e){const r=t.speakers[e];if(!r)return e;const n=typeof r.title=="string"?r.title:r.title?Object.values(r.title)[0]:void 0;return n||r.by&&$.agentName(r.by)||r.role}static agentName(t){if("people"in t){const[e,...r]=t.people.replace(/([a-z])([A-Z])/g,"$1 $2").split(" ");return[...r,e].join(" ")}return"org"in t?t.org:t.title??""}static stamp(t){const e=Math.round(t*1e3),r=(n,o=2)=>String(n).padStart(o,"0");return`${r(Math.floor(e/36e5))}:${r(Math.floor(e/6e4)%60)}:${r(Math.floor(e/1e3)%60)}.${r(e%1e3,3)}`}static toVtt(t){const e=o=>o.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),r=t.segments.filter(o=>o.start!==void 0);return`WEBVTT
1
+ class z extends Error{}class ee{constructor(t){this.name=t}validate(t){return!0}}class Mn extends ee{min;max;constructor(t,e,n){super(t),this.min=e,this.max=n}validate(t){if(typeof t!="number")throw new z(`${this.name} value must be a number, but was ${t}`);if(t<this.min||t>this.max)throw new z(`${this.name} value must be >= ${this.min} and <= ${this.max}, but was ${t}`);return super.validate(t)}}class N{name;min;max;duration;subUnit;validator;constructor(t,e,n,r,o=new Mn(t,e,n)){this.name=t,this.min=e,this.max=n,this.subUnit=r,this.duration=r?(r.max-r.min+1)*r.duration:1,this.validator=o}validate(t){return this.validator.validate(t)}[Symbol.iterator](){let t=this.min;return{next:()=>{const e={done:t>this.max,value:t};return t++,e}}}}class Se{millisecond;second;minute;hour;day;month;year}class jn extends Se{}class vn extends jn{millisecond=new N("millisecond",0,999,void 0);second=new N("second",0,59,this.millisecond);minute=new N("minute",0,59,this.second);hour=new N("hour",0,23,this.minute);day=new N("day",1,31,this.hour);month=new N("month",1,12,this.day);year=new N("year",0,9999,this.month)}const l=new vn;class An extends Mn{constructor(t=1,e=12){super("month",t,e)}}class ft extends N{static Month28=new ft(28);static Month29=new ft(29);static ThirtyDays=new ft(30);static ThirtyOneDays=new ft(31);constructor(t,e=new An(1,t)){super("month",1,t,l.day,e)}static create(t,e){switch(t){case 1:case 3:case 5:case 7:case 8:case 10:case 12:return this.ThirtyOneDays;case 2:return e%4===0?this.Month29:this.Month28;case 4:case 6:case 9:case 11:return this.ThirtyDays;default:throw new z("Unsupported month",t,e)}}}class B{static instance=new B;render(t){return t.value.toString()}}class I{unit;#t;constructor(t,e){this.unit=e,this.value=typeof t=="number"?t:t.value}get value(){return this.#t}set value(t){this.unit.validate(t),this.#t=t}get duration(){return this.value*this.unit.duration}#e(t){if(this.constructor.name!==t.constructor.name)throw new ee(`${this.unit.name} "${this.toString()}" cannot be compared with ${t.unit?.name} "${t.toString()}"`)}compare(t){return this.#e(t),this.value-t.value}isEqual(t){return this.compare(t)===0}isBefore(t){return this.compare(t)<0}isAfter(t){return this.compare(t)>0}previous(t=this.unit){const e=this.value-1;return new this.constructor(e,t)}next(t=this.unit){const e=this.value+1;return new this.constructor(e,t)}toString(t=B.instance){return t.render(this)}toSpec(){return{value:this.value}}toJSON(){return this.toSpec()}}class d{static#t=new Map;static register(t,e){d.#t.set(t,e)}static get(t){const e=d.#t.get(t);if(!e)throw new z(`No default parser registered for ${t.name}: import "@rr0/time/defaults" or pass a parser to fromString()`);return e()}}class yt extends I{constructor(t=new Date().getFullYear(),e=l.year){super(t,e)}static fromString(t,e=d.get(yt)){return new yt(e.parse(t))}}class O extends B{static default=new O("0",2);constructor(t,e){super(),this.char=t,this.size=e}render(t){return super.render(t).padStart(this.size,this.char)}}class bt extends I{constructor(t=new Date().getMonth()+1,e=l.month){super(t,e)}static fromString(t,e=d.get(bt)){return new bt(e.parse(t))}toString(t=O.default){return super.toString(t)}}class Gt extends I{constructor(t=new Date().getDate(),e=l.day){super(t,e)}static fromString(t,e=d.get(Gt)){const n=e.parse(t);return new Gt(n)}toString(t=O.default){return super.toString(t)}}class xt extends I{constructor(t=new Date().getHours(),e=l.hour){super(t,e)}static fromString(t,e=d.get(xt)){return new xt(e.parse(t))}toString(t=O.default){return super.toString(t)}}class Nt extends I{constructor(t=new Date().getMinutes(),e=l.minute){super(t,e)}static fromString(t,e=d.get(Nt)){return new Nt(e.parse(t))}toString(t=O.default){return super.toString(t)}}class Et extends I{constructor(t=new Date().getSeconds(),e=l.second){super(t,e)}static fromString(t,e=d.get(Et)){return new Et(e.parse(t),l.second)}toString(t=O.default){return super.toString(t)}}class ut extends I{static renderer=new O("0",3);constructor(t,e=l.millisecond){super(t,e)}static parseFraction(t){return parseInt(t.padEnd(3,"0").substring(0,3),10)}toString(t=ut.renderer){return super.toString(t)}}class Un{render(t){return t.toString()}}class zn extends Un{render(t){const e=t.value,n=Math.abs(e),r=Math.floor(n/60),o=n%60;if(r===0&&o===0)return"Z";{const a=e<0?"-":"+",u=r.toString().padStart(2,"0"),p=o>0?":"+o.toString().padEnd(2,"0"):"";return a+u+p}}}class at{value;name="timeshift";renderer;constructor(t=0){this.value=t}static fromString(t,e=d.get(at),n=void 0){const r=e.parse(t,n);return new at(r)}toString(t=new zn){return t.render(this)}toSpec(){return{value:this.value}}toJSON(){return this.toSpec()}}class V{static timeshift(t,e){return t+(V.isDaylight(e)?60:0)}static isDaylight(t){const{year:e,month:n,day:r}=t,o=t.hour??12;if(![e,n,r].every(Number.isInteger))throw new RangeError("Daylight saving time depends on the year, month and day");const a=V.rule(e);if(!a)return!1;const u=V.rank(n,r,o);return u>=V.rank(a.start.month,a.start.day,2)&&u<V.rank(a.end.month,a.end.day,2)}static rule(t){if(t<1967)return;const e={month:10,day:V.sunday(t,10,-1)};return t>=2007?{start:{month:3,day:V.sunday(t,3,2)},end:{month:11,day:V.sunday(t,11,1)}}:t>=1987?{start:{month:4,day:V.sunday(t,4,1)},end:e}:t===1975?{start:{month:2,day:23},end:e}:t===1974?{start:{month:1,day:6},end:e}:{start:{month:4,day:V.sunday(t,4,-1)},end:e}}static sunday(t,e,n){const r=new Date(Date.UTC(2e3,e-1,1));r.setUTCFullYear(t);const o=1+(7-r.getUTCDay())%7;if(n>0)return o+7*(n-1);const a=[31,V.isLeap(t)?29:28,31,30,31,30,31,31,30,31,30,31][e-1];let u=o;for(;u+7<=a;)u+=7;return u}static isLeap(t){return t%4===0&&(t%100!==0||t%400===0)}static rank(t,e,n){return(t*100+e)*100+n}}const Cn={name:"PST",timeshift:"-08",title:"Pacific Standard Time (US)"},qn={name:"PDT",timeshift:"-07",title:"Pacific Daylight Time (US)"},Bn={name:"MDT",timeshift:"-06",title:"Mountain Standard Time (US)"},Hn={name:"MST",timeshift:"-07",title:"Mountain Daylight Time (US)"},Yn={name:"PT",timeshift:s=>V.timeshift(-480,s),title:"Pacific Time (US)"},On={name:"MT",timeshift:s=>V.timeshift(-420,s),title:"Mountain Time (US)"},Xn={name:"CT",timeshift:s=>V.timeshift(-360,s),title:"Central Time (US)"},Wn={name:"ET",timeshift:s=>V.timeshift(-300,s),title:"Eastern Time (US)"},Jn={name:"CWT",timeshift:"-05",title:"Central War Time (US)"},Kn={name:"CDT",timeshift:"-05",title:"Central Daylight Time"},Zn={name:"EST",timeshift:"-05",title:"Eastern Standard Time (US)"},Qn={name:"EDT",timeshift:"-04",title:"Eastern Time (US)"},Dn={name:"AST",timeshift:"-04",title:"Atlantic Standard Time (US)"},Pn={name:"ADT",timeshift:"-03",title:"Atlantic Daylight Time (US)"},Ln={name:"UTC",timeshift:"Z",title:"Coordinated Universal Time"},_n={name:"Z",timeshift:"Z",title:"UTC"},tr={name:"GMT",timeshift:"Z",title:"Greenwich Mean Time"},er={name:"BST",timeshift:"+01",title:"British Summer Time"},nr={name:"CEST",timeshift:"+02",title:"Central European Summer Time"},rr={name:"CET",timeshift:"+01",title:"Central European Time"},sr={name:"MSK",timeshift:"+03",title:"Moscow Time (RU)"},or={name:"IST",timeshift:"+05:30",title:"Indian Standard Time"},ir={name:"BJT",timeshift:"+08",title:"Beijing Time"},ar={name:"CST",timeshift:"-06",title:"Central Standard Time"},ur={name:"JST",timeshift:"+09",title:"Japan Standard Time"},cr={name:"AEST",timeshift:"+10",title:"Australian Eastern Standard Time"},mr={name:"NZST",timeshift:"+12",title:"New Zealand Standard Time"},dr={name:"LST",timeshift:"?",title:"Local Sideral Time"},ke=[Pn,cr,Dn,ir,er,ar,Kn,rr,nr,Xn,Jn,Qn,Zn,Wn,tr,or,ur,dr,Bn,sr,Hn,On,mr,qn,Cn,Yn,Ln,_n];class ne{static instance=new ne;renderComponent(t,e){return t[e].toString()}renderSecond(t){return this.renderComponent(t,"second")+(t.millisecond?"."+t.millisecond.toString():"")}render(t){const e=[];t.year&&e.push(this.renderComponent(t,"year")),t.month&&e.push(this.renderComponent(t,"month")),t.day&&e.push(this.renderComponent(t,"day"));const n=[];t.hour&&n.push(this.renderComponent(t,"hour")),t.minute&&n.push(this.renderComponent(t,"minute")),t.second&&n.push(this.renderSecond(t));const r=e.join("-"),o=t.timeshift?t.timeshift.toString():"",a=n.join(":")+o;return r+(a.length>0?"T"+a:"")}}class ct extends z{constructor(t="method is abstract"){super(t)}}class ye{units;constructor(t){this.units=t}newYear(t){throw new ct}newMonth(t){throw new ct}newDay(t){throw new ct}newHour(t){throw new ct}newMinute(t){throw new ct}newSecond(t){throw new ct}}class pr extends Se{millisecond=new N("milliseconds",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,void 0);second=new N("seconds",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.millisecond);minute=new N("minutes",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.second);hour=new N("hours",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.minutes);day=new N("days",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.hour);month=new N("months",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.day);year=new N("years",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.month)}const Qt=new pr;class re{static instance=new re;render(t){const e=q.toSpec(t);let n="P";const r=e.years;r&&(n+=r.toString()+"Y");const o=e.months;o&&(n+=o.toString(B.instance)+"MM");const a=e.days;a&&(n+=a.toString(B.instance)+"D");const u=e.hours;u&&(n+=u.toString(B.instance)+"H");const p=e.minutes;p&&(n+=p.toString(B.instance)+"M");const c=e.seconds;return c&&(n+=c.toString(B.instance)+"S"),n}}class q extends I{constructor(t={years:new Date().getFullYear(),months:new Date().getMonth(),days:new Date().getDate(),hours:new Date().getHours(),minutes:new Date().getMinutes(),seconds:new Date().getSeconds(),milliseconds:new Date().getMilliseconds()}){super({value:typeof t=="number"?t:+(t.years?t.years*l.year.duration:0)+(t.months?t.months*l.month.duration:0)+(t.days?t.days*l.day.duration:0)+(t.hours?t.hours*l.hour.duration:0)+(t.minutes?t.minutes*l.minute.duration:0)+(t.seconds?t.seconds*l.second.duration:0)},new N("millisecond",0,Number.MAX_SAFE_INTEGER,void 0))}static toSpec(t,e=lr){let n=typeof t=="number"?t:t.value;const r=n>0?1:-1;n=Math.abs(n);const o={},a=n/l.year.duration,u=Math.floor(a);u>0&&(o.years=e.newYear(r*u),n-=u*l.year.duration);const p=n/l.month.duration,c=Math.floor(p);c>0&&(o.months=e.newMonth(r*c),n-=c*l.month.duration);const f=n/l.day.duration,m=Math.floor(f);m>0&&(o.days=e.newDay(r*m),n-=m*l.day.duration);const b=n/l.hour.duration,g=Math.floor(b);g>0&&(o.hours=e.newHour(r*g),n-=g*l.hour.duration);const G=n/l.minute.duration,w=Math.floor(G);w>0&&(o.minutes=e.newMinute(r*w),n-=w*l.minute.duration);const F=n/l.second.duration,M=Math.floor(r*F);return M>0&&(o.seconds=e.newSecond(M)),o}static fromString(t,e=d.get(q)){return new q(e.parse(t))}static between(t,e){const n=e.getTime(),r=t.getTime();return new q(n-r)}toSpec(){return q.toSpec(this)}toString(t=re.instance){return t.render(this)}}class kn extends ye{constructor(t){super(t)}newYear(t){return new yt(t,this.units.year)}newMonth(t){return new bt(t,this.units.month)}newDay(t){return new Gt(t,this.units.day)}newHour(t){return new xt(t,this.units.hour)}newMinute(t){return new Nt(t,this.units.minute)}newSecond(t){return new Et(t,this.units.second)}newMillisecond(t){return new ut(t,this.units.millisecond)}newTimeshift(t){return new at(typeof t=="number"?t:t.value)}}const hr=new kn(l),lr=new kn(Qt);class R{#t;#e;#n;#r;#s;#o;#i;#a;constructor(t={year:new Date().getFullYear(),month:new Date().getMonth()+1,day:new Date().getDate(),hour:new Date().getHours(),minute:new Date().getMinutes(),second:new Date().getSeconds(),timeshift:R.timeshiftOf(new Date)}){this.year=t.year,this.month=t.month,this.day=t.day,this.hour=t.hour,this.minute=t.minute,this.second=t.second,this.millisecond=t.millisecond,this.timeshift=t.timeshift}get year(){return this.#t}set year(t){const e=typeof t=="number";this.#t&&e?this.#t.value=t:this.#t=e?this.factory.newYear(t):!t||t.start||t instanceof I?t:this.factory.newYear(t)}get month(){return this.#e}set month(t){const e=typeof t=="number";this.#e&&e?this.#e.value=t:this.#e=e?this.factory.newMonth(t):!t||t.start||t instanceof I?t:this.factory.newMonth(t)}get day(){return this.#n}set day(t){const e=typeof t=="number";this.#n&&e?this.#n.value=t:this.#n=e?this.factory.newDay(t):!t||t.start||t instanceof I?t:this.factory.newDay(t)}get hour(){return this.#r}set hour(t){const e=typeof t=="number";this.#r&&e?this.#r.value=t:this.#r=e?this.factory.newHour(t):!t||t.start||t instanceof I?t:this.factory.newHour(t)}get minute(){return this.#s}set minute(t){const e=typeof t=="number";this.#s&&e?this.#s.value=t:this.#s=e?this.factory.newMinute(t):!t||t.start||t instanceof I?t:this.factory.newMinute(t)}get second(){return this.#o}set second(t){const e=typeof t=="number";this.#o&&e?this.#o.value=t:this.#o=e?this.factory.newSecond(t):!t||t.start||t instanceof I?t:this.factory.newSecond(t)}get millisecond(){return this.#i}set millisecond(t){const e=typeof t=="number";this.#i&&e?this.#i.value=t:this.#i=e||t&&!(t instanceof I)?this.factory.newMillisecond(t):t}get timeshift(){return this.#a}set timeshift(t){const e=typeof t=="number";this.#a&&e?this.#a.value=t:this.#a=e||t&&!(t instanceof at)?this.factory.newTimeshift(t):t}get factory(){return hr}static fromString(t,e=d.get(R)){const{year:n,month:r,day:o,hour:a,minute:u,second:p,millisecond:c,timeshift:f}=e.parse(t);return new R({year:n,month:r,day:o,hour:a,minute:u,second:p,millisecond:c,timeshift:f})}static timeshiftOf(t){return-t.getTimezoneOffset()||0}static fromDate(t){return new R({year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate(),hour:t.getHours(),minute:t.getMinutes(),second:t.getSeconds(),timeshift:R.timeshiftOf(t)})}static newInstance(){const t=new Date().toISOString(),e=t.indexOf("."),n=t.substring(0,e)+t.substring(e+4);return R.fromString(n)}#u(t){if(this.constructor.name!==t.constructor.name)throw new ee(`Date "${this.toString()}" cannot be compared with "${t.toString()}"`)}compare(t){return this.#u(t),this.getTime()-t.getTime()}delta(t){const e=this.compare(t);return new q(e)}getTime(){return(this.year?.duration||0)+(this.month?.duration||0)+(this.day?.duration||0)+(this.hour?.duration||0)+(this.minute?.duration||0)+(this.second?.duration||0)+(this.millisecond?.duration||0)}isEqual(t){return this.compare(t)===0}isBefore(t){return this.compare(t)<0}isAfter(t){return this.compare(t)>0}clone(){return new R(this.toSpec())}previous(){let t=this.clone();try{t.second=this.second.previous()}catch{try{t.minute=this.minute.previous()}catch{try{t.hour=this.hour.previous()}catch{try{t.day=this.day.previous()}catch{try{t.month=this.month.previous()}catch{t.year=this.year.previous()}}}}}return t}next(){let t=this.clone();try{t.second=this.second.next()}catch{try{t.minute=this.minute.next()}catch{try{t.hour=this.hour.next()}catch{try{t.day=this.day.next()}catch{try{t.month=this.month.next()}catch{t.year=this.year.next()}}}}}return t}toString(t=ne.instance){return t.render(this)}toSpec(){const t={},e=this.year?.toSpec();e&&(t.year=e);const n=this.month?.toSpec();n&&(t.month=n);const r=this.day?.toSpec();r&&(t.day=r);const o=this.hour?.toSpec();o&&(t.hour=o);const a=this.minute?.toSpec();a&&(t.minute=a);const u=this.second?.toSpec();u&&(t.second=u);const p=this.millisecond?.toSpec();p&&(t.millisecond=p);const c=this.timeshift?.toSpec();return c&&(t.timeshift=c),t}toJSON(){return this.toSpec()}}class be{static instance=new be;render(t){return(t.start?t.start.toString():"")+"/"+(t.end?t.end.toString():"")}}class kt{constructor(t,e){this.start=t,this.end=e}_start;get start(){return this._start}set start(t){if(typeof t=="string"&&(t=R.fromString(t)),t&&!(t instanceof R)&&!(t instanceof q))throw new z("Interval start is not a level 0 date or duration: "+t);this._start=t}_end;get end(){return this._end}set end(t){if(typeof t=="string"&&(t=R.fromString(t)),t&&!(t instanceof R)&&!(t instanceof q))throw new z("Interval end is not a level 0 date or duration: "+t);this._end=t}static fromString(t,e=d.get(kt)){const{start:n,end:r}=e.parse(t);return new kt(n,r)}toString(t=be.instance){return t.render(this)}[Symbol.iterator](){let t=this.start;return{next:()=>{const e={done:t>this.end,value:t};return t++,e}}}}class Dt extends B{static instance=new Dt(O.default);constructor(t){super(),this.valueRenderer=t}render(t){return(this.valueRenderer?this.valueRenderer.render(t):super.render(t))+this.qualifier(t)}qualifier(t){return t.uncertain?t.approximate?"%":"?":t.approximate?"~":""}}class Y extends I{#t;#e;constructor(t,e){super(t,e),this.#t=t.uncertain||!1,this.#e=t.approximate||!1}get uncertain(){return this.#t}set uncertain(t){return this.#t=t}get approximate(){return this.#e}set approximate(t){return this.#e=t}isCertainAndPrecise(){return!this.approximate&&!this.uncertain}isEqual(t){return this.isCertainAndPrecise()&&super.isEqual(t)}isBefore(t){return this.isCertainAndPrecise()&&super.isBefore(t)}isAfter(t){return this.isCertainAndPrecise()&&super.isAfter(t)}toString(t=Dt.instance){return super.toString(t)}toSpec(){return{...super.toSpec(),uncertain:this.uncertain,approximate:this.approximate}}toJSON(){return this.toSpec()}}class $n extends vn{year=new N("year",-9999,9999,this.month);yearExtended=new N("year",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.month)}const Lt=new $n;class et extends Y{constructor(t,e=Lt.year){super(t,e)}static fromString(t,e=Lt.year,n=d.get(et)){const r=n.parse(t),o=r.value.start;if(t.startsWith("Y")&&(e=Lt.yearExtended),o!==void 0){const a=new et(Object.assign({...r},{value:Math.max(o,e.min)})),u=new et(Object.assign({...r},{value:Math.min(r.value.end,e.max)}));return{start:a,end:u}}else return new et(r,e)}}class Rn extends ee{monthValidator=new An;validate(t){switch(t){case 21:case 22:case 23:case 24:return!0;default:return this.monthValidator.validate(t)}}}class nt extends Y{constructor(t,e=new N(l.month.name,1,24,l.day,new Rn)){super(t,e)}static fromString(t,e=d.get(nt)){const n=e.parse(t),r=n.value.start;if(r!==void 0){let o=l.month;const a=new nt(Object.assign({...n},{value:Math.max(r,o.min)})),u=new nt(Object.assign({...n},{value:Math.min(n.value.end,o.max)}));return{start:a,end:u}}else return new nt(n)}toString(t){return super.toString(t).padStart(2,"0")}}class rt extends Y{constructor(t,e=l.day){super(t,e)}static fromString(t,e=d.get(rt)){const n=e.parse(t),r=n.value.start;if(r!==void 0){let o=l.day;const a=new rt(Object.assign({...n},{value:Math.max(r,o.min)})),u=new rt(Object.assign({...n},{value:Math.min(n.value.end,o.max)}));return{start:a,end:u}}else return new rt(n)}toString(t){return super.toString(t).padStart(2,"0")}}class st extends Y{constructor(t,e=l.hour){super(t,e)}static fromString(t,e=d.get(st)){const n=e.parse(t),r=n.value.start;if(r!==void 0){let o=l.hour;const a=new st(Object.assign({...n},{value:Math.max(r,o.min)})),u=new st(Object.assign({...n},{value:Math.min(n.value.end,o.max)}));return{start:a,end:u}}else return new st(n)}}class ot extends Y{constructor(t,e=l.minute){super(t,e)}static fromString(t,e=d.get(ot)){const n=e.parse(t),r=n.value.start;if(r!==void 0){const o=l.minute,a=new ot(Object.assign({...n},{value:Math.max(r,o.min)})),u=new ot(Object.assign({...n},{value:Math.min(n.value.end,o.max)}));return{start:a,end:u}}else return new ot(n)}toString(t=Dt.instance){return super.toString(t)}}class it extends Y{constructor(t,e=l.second){super(t,e)}static fromString(t,e=d.get(it)){const n=e.parse(t),r=n.value.start;if(r!==void 0){const o=l.second,a=new it(Object.assign({...n},{value:Math.max(r,o.min)})),u=new it(Object.assign({...n},{value:Math.min(n.value.end,o.max)}));return{start:a,end:u}}else return new it(n)}}class pt extends at{static fromString(t,e=d.get(pt),n=void 0){return new pt(e.parse(t,n))}}class Fn extends ye{constructor(t){super(t)}newYear(t){return new et(t,this.units.year)}newMonth(t){return new nt(t,this.units.month)}newDay(t){return new rt(t,this.units.day)}newHour(t){return new st(t,this.units.hour)}newMinute(t){return new ot(t,this.units.minute)}newSecond(t){return new it(t,this.units.second)}newMillisecond(t){return new ut(t,this.units.millisecond)}newTimeshift(t){return new pt(typeof t=="number"?t:t.value)}}const fr=new Fn(Lt),gr=new Fn(Qt);class j extends R{constructor(t){super(t)}get factory(){return fr}get uncertain(){return this.year?.uncertain===!0||this.month?.uncertain===!0||this.day?.uncertain===!0||this.hour?.uncertain===!0||this.minute?.uncertain===!0||this.second?.uncertain===!0}get approximate(){return this.year?.approximate===!0||this.month?.approximate===!0||this.day?.approximate===!0||this.hour?.approximate===!0||this.minute?.approximate===!0||this.second?.approximate===!0}static fromDate(t){return new j({year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate(),hour:t.getHours(),minute:t.getMinutes(),second:t.getSeconds(),timeshift:R.timeshiftOf(t)})}static fromString(t,e=d.get(j)){const n=e.parse(t);return new j(n)}static newInstance(){const t=new Date().toISOString(),e=t.indexOf("."),n=t.substring(0,e)+t.substring(e+4);return j.fromString(n)}clone(){return new j(this.toSpec())}}const $=Object.freeze({year:"year",month:"month",day:"day",hour:"hour",minute:"minute",second:"second",timeshift:"timeshift",uncertain:"uncertain",approximate:"approx"});class se extends re{static instance=new se;render(t){return super.render(t)}}class k extends Y{constructor(t){super(typeof t=="number"||t.hasOwnProperty("value")?t:{value:k.getValue(t,$.year)+k.getValue(t,$.month)+k.getValue(t,$.day)+k.getValue(t,$.hour)+k.getValue(t,$.minute)+k.getValue(t,$.second),uncertain:k.getBoolean(t,$.uncertain),approximate:k.getBoolean(t,"approximate")},Qt.millisecond)}static getBoolean(t,e){return t[e]||t[$.year+"s"]?.[e]||t[$.month+"s"]?.[e]||t[$.day+"s"]?.[e]||t[$.hour+"s"]?.[e]||t[$.minute+"s"]?.[e]||t[$.second+"s"]?.[e]||!1}static getValue(t,e){let n=0,r=t[e+"s"];if(r instanceof Y?r=r.value:typeof t=="number"&&(r=t),r){const o=l[e];n=r*o.duration}return n}static toSpec(t,e=gr){return{...q.toSpec(t,e),uncertain:t.uncertain||!1,approximate:t.approximate||!1}}static fromString(t,e=d.get(k)){const n=e.parse(t);return new k(n)}static between(t,e){const n=e.getTime(),r=t.getTime();return new k(n-r)}toString(t=se.instance){return super.toString(t)}toSpec(){return k.toSpec(this)}}class $t extends kt{constructor(t,e){super(t,e)}get start(){return this._start}set start(t){if(typeof t=="string"&&(super.start=j.fromString(t)),t&&!(t instanceof j)&&!(t instanceof k))throw new z("Interval start is not a level 1 date or duration: "+t);this._start=t}get end(){return this._end}set end(t){if(typeof t=="string"&&(t=j.fromString(t)),t&&!(t instanceof j)&&!(t instanceof k))throw new z("Interval end is not a level 1 date or duration: "+t);this._end=t}static fromString(t,e=d.get($t)){const{start:n,end:r}=e.parse(t);return new $t(n,r)}}class Mt extends Y{uncertainComponent;approximateComponent;constructor(t,e){super(t,e),this.uncertainComponent=t.uncertainComponent||!1,this.approximateComponent=t.approximateComponent||!1}get uncertain(){return super.uncertain||this.uncertainComponent}set uncertain(t){return super.uncertain=t}get approximate(){return super.approximate||this.approximateComponent}set approximate(t){return super.approximate=t}get uncertainGroup(){return super.uncertain}get approximateGroup(){return super.approximate}toSpec(){return{...super.toSpec(),uncertain:this.uncertainGroup,approximate:this.approximateGroup,uncertainComponent:this.uncertainComponent,approximateComponent:this.approximateComponent}}toJSON(){return this.toSpec()}}class wr extends $n{year=new N("year",Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,this.month)}const we=new wr;class W extends Mt{constructor(t,e=we.year){super(t,e)}static fromString(t,e=we.year,n=d.get(W)){const r=n.parse(t),o=r.value.start;if(o!==void 0){const a=new W(Object.assign({...r},{value:Math.max(o,e.min)})),u=new W(Object.assign({...r},{value:Math.min(r.value.end,e.max)})),p={start:a,end:u},c=r.value.estimate;return c&&(p.estimate=c),p}else return new W(r)}}class Sr extends Rn{validate(t){switch(t){case 25:case 26:case 27:case 28:case 29:case 30:case 31:case 32:case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:return!0;default:return super.validate(t)}}}class J extends Mt{constructor(t,e=new N(l.month.name,1,41,l.day,new Sr)){super(t,e)}static fromString(t,e=d.get(J)){const n=e.parse(t),r=n.value.start;if(r!==void 0){const o=l.month,a=new J(Object.assign({...n},{value:Math.max(r,o.min)})),u=new J(Object.assign({...n},{value:Math.min(n.value.end,o.max)}));return{start:a,end:u}}else return new J(n)}toString(t){return super.toString(t).padStart(2,"0")}}class K extends Mt{constructor(t,e=l.day){super(t,e)}static fromString(t,e=d.get(K)){const n=e.parse(t),r=n.value.start;if(r!==void 0){const o=l.day,a=new K(Object.assign({...n},{value:Math.max(r,o.min)})),u=new K(Object.assign({...n},{value:Math.min(n.value.end,o.max)}));return{start:a,end:u}}else return new K(n)}toString(t){return super.toString(t).padStart(2,"0")}}class Z extends Mt{constructor(t,e=l.hour){super(t,e)}static fromString(t,e=d.get(Z)){const n=e.parse(t),r=n.value.start;if(r!==void 0){const o=l.hour,a=new Z(Object.assign({...n},{value:Math.max(r,o.min)})),u=new Z(Object.assign({...n},{value:Math.min(n.value.end,o.max)}));return{start:a,end:u}}else return new Z(n)}}class Q extends Mt{constructor(t,e=l.minute){super(t,e)}static fromString(t,e=d.get(Q)){const n=e.parse(t),r=n.value.start;if(r!==void 0){const o=l.minute,a=new Q(Object.assign({...n},{value:Math.max(r,o.min)})),u=new Q(Object.assign({...n},{value:Math.min(n.value.end,o.max)}));return{start:a,end:u}}else return new Q(n)}}class D extends Mt{constructor(t,e=l.second){super(t,e)}static fromString(t,e=l.second,n=d.get(D)){const r=n.parse(t),o=r.value.start;if(o!==void 0){const a=new D(Object.assign({...r},{value:Math.max(o,e.min)})),u=new D(Object.assign({...r},{value:Math.min(r.value.end,e.max)}));return{start:a,end:u}}else return new D(r,e)}}class Vn extends pt{}class yr extends Dt{qualifier(){return""}}class _ extends ne{static instance=new _;static valueRenderer=new yr(O.default);static names=["year","month","day","hour","minute","second"];static qualifier(t,e){return t?e?"%":"?":e?"~":""}renderComponent(t,e){const n=t[e],r=_.names.slice(_.names.indexOf(e)+1).map(u=>t[u]).filter(Boolean),o=_.qualifier(n.uncertainComponent,n.approximateComponent),a=_.qualifier(n.uncertainGroup&&!n.uncertainComponent&&!r.some(u=>u.uncertain),n.approximateGroup&&!n.approximateComponent&&!r.some(u=>u.approximate));return o+n.toString(_.valueRenderer)+a}}class In extends ye{constructor(t){super(t)}newYear(t){return new W(t,this.units.year)}newMonth(t){return new J(t,this.units.month)}newDay(t){return new K(t,this.units.day)}newHour(t){return new Z(t,this.units.hour)}newMinute(t){return new Q(t,this.units.minute)}newSecond(t){return new D(t,this.units.second)}newMillisecond(t){return new ut(t,this.units.millisecond)}newTimeshift(t){return new Vn(typeof t=="number"?t:t.value)}}const br=new In(we),Gr=new In(Qt);class U extends j{constructor(t){super(t)}toString(t=_.instance){return super.toString(t)}get year(){return super.year}set year(t){super.year=t}get month(){return super.month}set month(t){super.month=t}get factory(){return br}static fromDate(t){return new U({year:t.getFullYear(),month:t.getMonth()+1,day:t.getDate(),hour:t.getHours(),minute:t.getMinutes(),second:t.getSeconds(),timeshift:R.timeshiftOf(t)})}static fromString(t,e=d.get(U)){const n=e.parse(t);return new U(n)}static newInstance(){const t=new Date().toISOString(),e=t.indexOf("."),n=t.substring(0,e)+t.substring(e+4);return U.fromString(n)}clone(){return new U(this.toSpec())}}class P{regExp;constructor(t,e){this.name=t,this.regExp=new RegExp(`^(?:${e})$`)}regexGroups(t){const e=this.regExp.exec(t);if(!e)throw new z(`Invalid ${this.name} "${t}"`);return e.groups}parseGroups(t){throw new ct(`${this.constructor.name} is abstract`)}parse(t){const e=this.regexGroups(t);return this.parseGroups(e)}}class gt extends se{static instance=new gt;static designators=[["years","Y"],["months","MM"],["days","D"],["hours","H"],["minutes","M"],["seconds","S"]];static qualifier(t,e){return t?e?"%":"?":e?"~":""}render(t){const e=gt.qualifier(t.uncertainDuration,t.approximateDuration);if(!t.hasQualifiedComponent)return e+super.render(t);let n=e+"P";for(const[r,o]of gt.designators){const a=t.components[r];a&&(n+=gt.qualifier(a.uncertainComponent,a.approximateComponent)+a.value+o)}return n}}class A extends k{#t;constructor(t){if(super(typeof t=="number"?t:{value:A.valueFromSpec(t),uncertain:t.uncertain===!0,approximate:t.approximate===!0},Qt.millisecond),typeof t!="number"){const e={};for(const n of A.componentNames)t[n]instanceof Y&&(e[n]=t[n]);Object.keys(e).length>0&&(this.#t=e)}}static componentNames=["years","months","days","hours","minutes","seconds"];get components(){return this.#t}#e(t){return this.#t?Object.values(this.#t).some(e=>e[t]):!1}get uncertainDuration(){return super.uncertain}get approximateDuration(){return super.approximate}get uncertain(){return super.uncertain||this.#e("uncertain")}set uncertain(t){super.uncertain=t}get approximate(){return super.approximate||this.#e("approximate")}set approximate(t){super.approximate=t}get hasQualifiedComponent(){return this.#t?Object.values(this.#t).some(t=>t.uncertainComponent||t.approximateComponent):!1}static valueFromSpec(t){return A.getValue(t,$.year)+A.getValue(t,$.month)+A.getValue(t,$.day)+A.getValue(t,$.hour)+A.getValue(t,$.minute)+A.getValue(t,$.second)}static toSpec(t,e=Gr){const n=k.toSpec(t,e);if(t instanceof A&&t.hasQualifiedComponent)for(const r of A.componentNames)delete n[r],t.components[r]&&(n[r]=t.components[r]);return n}static fromString(t,e=d.get(A)){const n=e.parse(t);return new A(n)}static between(t,e){const n=e.getTime(),r=t.getTime();return new A(n-r)}toSpec(){return A.toSpec(this)}toString(t=gt.instance){return super.toString(t)}}class Rt extends $t{get start(){return this._start}set start(t){if(typeof t=="string"&&(super.start=U.fromString(t)),t&&!(t instanceof U)&&!(t instanceof A))throw new z("Interval start is not a level 2 date or duration: "+t);this._start=t}get end(){return this._end}set end(t){if(typeof t=="string"&&(t=U.fromString(t)),t&&!(t instanceof U)&&!(t instanceof A))throw new z("Interval end is not a level 2 date or duration: "+t);this._end=t}static fromString(t,e=d.get(Rt)){const{start:n,end:r}=e.parse(t);return new Rt(n,r)}}class _t extends Set{constructor(t,e){super(t),this.exclusive=e}has(t){const e=t.toString().replace("..","/");for(const n of this)if(n.toString()===e)return!0;return!1}static fromString(t,e=d.get(_t)){const{exclusive:n,values:r}=e.parse(t);return new _t(r,n)}}class L extends P{constructor(t,e){super(t,e)}static read(t){return{value:t?parseInt(t,10):void 0}}parseGroups(t){return L.read(t[this.name])}parse(t){if(t.startsWith("-"))throw new z(`${this.name} cannot be negative`);return super.parse(t)}}class i{static groupName(...t){return t.reduce((e,n)=>e?e+n.charAt(0).toUpperCase()+n.substring(1):n,"")}static group(t,...e){return`(?<${t}>${e.join("")})`}static optional(t){return t+"?"}static nonCapturingGroup(...t){return`(?:${t.join("")})`}static optionalGroup(t,...e){return i.optional(i.group(t,...e))}static optionalNonCapturingGroup(...t){return i.optional(i.nonCapturingGroup(...t))}static numberGroup(t,e,n,r="\\d"){return i.group(t,`${n||""}[${r}]${e}`)}}const $e="yearValue";class Ft extends L{static format(t=""){return i.numberGroup(i.groupName(t,$e),"{4}",void 0)}constructor(){super($e,Ft.format())}}const Re="monthValue";class Vt extends L{static format(t=""){return i.numberGroup(i.groupName(t,Re),"{1,2}",void 0)}constructor(){super(Re,Vt.format())}}const Fe="dayValue";class wt extends L{static format(t=""){return i.numberGroup(i.groupName(t,Fe),"{1,2}",void 0)}constructor(){super(Fe,wt.format())}}const Ve="hourValue";class St extends L{static format(t=""){return i.numberGroup(i.groupName(t,Ve),"{1,2}",void 0)}constructor(){super(Ve,St.format())}}const Ie="minuteValue";class It extends L{static format(t=""){return i.numberGroup(i.groupName(t,Ie),"{1,2}",void 0)}constructor(){super(Ie,It.format())}}const je="secondValue";class jt extends L{static format(t=""){return i.numberGroup(i.groupName(t,je),"{1,2}",void 0)}constructor(){super(je,jt.format())}}const Ue="timeshiftValue",ze="shiftHour",Ce="shiftMinute";class Tt extends P{static format(t=""){return ke.map(e=>e.name).join("|")+"|"+i.nonCapturingGroup(i.group(t+ze,i.numberGroup(i.groupName(t,Ue),"{2}","[+-]")),i.optionalNonCapturingGroup(":?",i.numberGroup(i.groupName(t,Ce),"{2}",void 0)))}constructor(){super(Ue,Tt.format())}parse(t,e){let n=0;const r=ke.find(o=>o.name===t);if(r){if(typeof r.timeshift=="function")try{return r.timeshift(e??{})}catch(o){throw new z(`The time zone ${t} depends on the date: ${o.message}`)}t=r.timeshift}if(t!=="Z"){const o=this.regexGroups(t),a=o[ze];a&&(n+=parseInt(a,10)*60);const u=o[Ce];u&&(n+=parseInt(u,10))}return n}}const qe="year",Be="month",He="day",Ye="hour",Oe="minute",Xe="second",We="millisecond",Je="timeshift";class mt extends P{static format(t=""){return i.group(i.groupName(t,qe),Ft.format(t))+i.optionalNonCapturingGroup("-",i.group(i.groupName(t,Be),Vt.format(t)),i.optionalNonCapturingGroup("-",i.group(i.groupName(t,He),wt.format(t)),i.optionalNonCapturingGroup("[T ]",i.group(i.groupName(t,Ye),St.format(t)),":?",i.group(i.groupName(t,Oe),It.format(t)),i.optionalNonCapturingGroup(":",i.group(i.groupName(t,Xe),jt.format(t)),i.optionalNonCapturingGroup("[.,]",i.group(i.groupName(t,We),"\\d+"))),"\\s*",i.optionalGroup(i.groupName(t,Je),Tt.format(t)))))}constructor(){super("date",mt.format())}parse(t){const e=this.regexGroups(t),n=e[qe],r=e[Be],o=e[He],a=e[Ye],u=e[Oe],p=e[Xe],c=e[We],f=e[Je],m=n?new yt(Ft.read(n)):void 0,b=r?Vt.read(r):void 0;return{year:m,month:b?new bt(b,ft.create(b.value,m?.value)):void 0,day:o?new Gt(wt.read(o)):void 0,hour:a?new xt(St.read(a)):void 0,minute:u?new Nt(It.read(u)):void 0,second:p?new Et(jt.read(p)):void 0,millisecond:c?ut.parseFraction(c):void 0,timeshift:f?at.fromString(f,new Tt,{year:m?.value,month:b?.value,day:o?wt.read(o).value:void 0,hour:a?St.read(a).value:void 0}):void 0}}}const Ke="years",ie="months",xr="days",Ze="hours",Qe="minutes",De="seconds";class Ge extends P{static format(t=""){return"P"+i.optionalNonCapturingGroup(i.numberGroup(i.groupName(t,Ke),"+",void 0,"\\d"),"Y")+i.optionalNonCapturingGroup(i.numberGroup(i.groupName(t,ie),"+",void 0,"\\d"),"MM")+i.optionalNonCapturingGroup(i.numberGroup(i.groupName(t,xr),"+",void 0,"\\d"),"D")+i.optionalNonCapturingGroup(i.numberGroup(i.groupName(t,Ze),"+",void 0,"\\d"),"H")+i.optionalNonCapturingGroup(i.numberGroup(i.groupName(t,Qe),"+",void 0,"\\d"),"M")+i.optionalNonCapturingGroup(i.numberGroup(i.groupName(t,De),"+",void 0,"\\d"),"S")}constructor(){super("duration",Ge.format())}parseGroups(t){return{years:t[Ke],months:t[ie],days:t[ie],hours:t[Ze],minutes:t[Qe],seconds:t[De]}}}const ae="start",ue="end";class xe extends P{static format=i.group(ae,mt.format(ae))+"/"+i.group(ue,mt.format(ue));constructor(){super("interval",xe.format)}parse(t){const e=this.regexGroups(t),n=e[ae],r=e[ue];return{start:n?R.fromString(n,new mt):void 0,end:r?R.fromString(r,new mt):void 0}}}d.register(R,()=>new mt);d.register(Gt,()=>new wt);d.register(q,()=>new Ge);d.register(xt,()=>new St);d.register(kt,()=>new xe);d.register(Nt,()=>new It);d.register(bt,()=>new Vt);d.register(Et,()=>new jt);d.register(at,()=>new Tt);d.register(yt,()=>new Ft);class E extends L{static uncertainGroup="uncertain";static approximateGroup="approx";static uncertainAndApproximateGroup=E.uncertainGroup+E.approximateGroup;constructor(t,e){super(t,e)}static qualifierFormat(t,e){return i.optionalGroup(t,`\\${e}`)}static formatSuffix(t){return this.qualifierFormat(i.groupName(E.uncertainGroup,t),"?")+this.qualifierFormat(i.groupName(E.approximateGroup,t),"~")+this.qualifierFormat(i.groupName(E.uncertainAndApproximateGroup,t),"%")}static numberFormat(t,e,n){return i.numberGroup(t,e,n,"\\dX")+this.formatSuffix(t)}getValueAndSign(t){let e=t[this.name],n;return e.charAt(0)==="-"?(n=-1,e=e.substring(1)):n=1,{valueStr:e,sign:n}}parseGroups(t){const{valueStr:e,sign:n}=this.getValueAndSign(t);let r=0,o;for(o=0;o<e.length;o++){const c=e[o];if(c==="X")break;r=r*10+parseInt(c,10)}if(o<e.length){let c=1;for(let b=0;b<e.length-o;b++)c*=10;const f=n*r*c,m=f+c-1;r={start:f,end:m}}else r*=n;const a=t[i.groupName(E.uncertainAndApproximateGroup,this.name)],u=t[i.groupName(E.approximateGroup,this.name)]||a,p=t[i.groupName(E.uncertainGroup,this.name)]||a;return{value:r,approximate:u?!!u:!1,uncertain:p?!!p:!1}}}const Pe="yearValue";class Ut extends E{constructor(){super(Pe,Ut.format())}static format(t=""){return"Y?"+E.numberFormat(i.groupName(t,Pe),"+","[-]?")}parse(t){const e=this.regexGroups(t);return this.parseGroups(e)}}const Le="monthValue";class zt extends E{static format(t=""){return E.numberFormat(i.groupName(t,Le),"{1,2}",void 0)}constructor(){super(Le,zt.format())}}const _e="dayValue";class Ct extends E{static format(t=""){return E.numberFormat(i.groupName(t,_e),"{1,2}",void 0)}constructor(){super(_e,Ct.format())}}const tn="hourValue";class qt extends E{static format(t=""){return E.numberFormat(i.groupName(t,tn),"{1,2}",void 0)}constructor(){super(tn,qt.format())}}const en="minuteValue";class Bt extends E{static format(t=""){return E.numberFormat(i.groupName(t,en),"{1,2}",void 0)}constructor(){super(en,Bt.format())}}const nn="secondValue";class Ht extends E{static format(t=""){return E.numberFormat(i.groupName(t,nn),"{1,2}",void 0)}constructor(){super(nn,Ht.format())}}class Yt extends Tt{}class T extends P{static yearGroup="year";static monthGroup="month";static dayGroup="day";static hourGroup="hour";static minuteGroup="minute";static secondGroup="second";static millisecondGroup="millisecond";static timeshiftGroup="timeshift";constructor(t=T.format()){super("date",t)}static format(t=""){return i.group(i.groupName(t,T.yearGroup),Ut.format(t))+i.optionalNonCapturingGroup("-",i.group(i.groupName(t,T.monthGroup),zt.format(t)),i.optionalNonCapturingGroup("-",i.group(i.groupName(t,T.dayGroup),Ct.format(t)),i.optionalNonCapturingGroup("[T ]",i.group(i.groupName(t,T.hourGroup),qt.format(t)),":",i.group(i.groupName(t,T.minuteGroup),Bt.format(t)),i.optionalNonCapturingGroup(":",i.group(i.groupName(t,T.secondGroup),Ht.format(t)),i.optionalNonCapturingGroup("[.,]",i.group(i.groupName(t,T.millisecondGroup),"\\d+"))),i.optionalGroup(i.groupName(t,T.timeshiftGroup),Yt.format(t)))))}parseGroups(t){const e=t[T.millisecondGroup],n=e?ut.parseFraction(e):void 0,r=t[T.secondGroup],o=r?it.fromString(r,new Ht):void 0,a=t[T.minuteGroup];let u;a&&(u=ot.fromString(a,new Bt),u.uncertain=u.uncertain||o?.uncertain||!1,u.approximate=u.approximate||o?.approximate||!1);const p=t[T.hourGroup];let c;p&&(c=st.fromString(p,new qt),c.uncertain=c.uncertain||u?.uncertain||!1,c.approximate=c.approximate||u?.approximate||!1);const f=t[T.dayGroup];let m;f&&(m=rt.fromString(f,new Ct),m.uncertain=m.uncertain||c?.uncertain||!1,m.approximate=m.approximate||c?.approximate||!1);const b=t[T.monthGroup];let g;b&&(g=nt.fromString(b,new zt),g.uncertain=g.uncertain||m?.uncertain||!1,g.approximate=g.approximate||m?.approximate||!1);const G=t[T.yearGroup];let w;G&&(w=et.fromString(G,void 0,new Ut),w.uncertain=w.uncertain||g?.uncertain||!1,w.approximate=w.approximate||g?.approximate||!1);const F=t[T.timeshiftGroup],M=F?pt.fromString(F,new Yt,{year:w?.value,month:g?.value,day:m?.value,hour:c?.value}):void 0;return{year:w,month:g,day:m,hour:c,minute:u,second:o,millisecond:n,timeshift:M}}}const rn="years",sn="months",on="days",an="hours",un="minutes",cn="seconds";class dt extends E{static format(t=""){return"P"+i.optionalNonCapturingGroup(i.numberGroup(i.groupName(t,rn),"+",void 0,"\\d"),"Y")+i.optionalNonCapturingGroup(i.numberGroup(i.groupName(t,sn),"+",void 0,"\\d"),"MM")+i.optionalNonCapturingGroup(i.numberGroup(i.groupName(t,on),"+",void 0,"\\d"),"D")+i.optionalNonCapturingGroup(i.numberGroup(i.groupName(t,an),"+",void 0,"\\d"),"H")+i.optionalNonCapturingGroup(i.numberGroup(i.groupName(t,un),"+",void 0,"\\d"),"M")+i.optionalNonCapturingGroup(i.numberGroup(i.groupName(t,cn),"+",void 0,"\\d"),"S")+this.formatSuffix(t)}constructor(){super("duration",dt.format())}parseGroups(t){return{years:t[rn],months:t[sn],days:t[on],hours:t[an],minutes:t[un],seconds:t[cn],uncertain:!!t[E.uncertainGroup],approximate:!!t[E.approximateGroup]}}}const Nr="dates",ce="start",me="end",mn="durations",de="durationMin",pe="durationMax";class Ne extends P{static format=i.group(Nr,i.optionalGroup(ce,i.group("openStart","\\.\\.")+"|"+T.format(ce))+"/"+i.optionalGroup(me,i.group("openEnd","\\.\\.")+"|"+T.format(me)))+"|"+i.group(mn,i.group(de,dt.format(de))+"/"+i.group(pe,dt.format(pe)));constructor(t="interval",e=Ne.format){super(t,e)}parseGroups(t){let e,n;if(t[mn]){const o=t[de];e=k.fromString(o,new dt);const a=t[pe];n=k.fromString(a,new dt)}else{const o=t[ce];switch(o){case void 0:e=null;break;case"..":e=void 0;break;default:e=j.fromString(o,new T)}const a=t[me];switch(a){case void 0:n=null;break;case"..":n=void 0;break;default:n=j.fromString(a,new T)}}return{start:e,end:n}}}d.register(j,()=>new T);d.register(rt,()=>new Ct);d.register(k,()=>new dt);d.register(st,()=>new qt);d.register($t,()=>new Ne);d.register(ot,()=>new Bt);d.register(nt,()=>new zt);d.register(it,()=>new Ht);d.register(pt,()=>new Yt);d.register(et,()=>new Ut);class y extends E{static uncertainGroup="uncertain1";static approximateGroup="approx1";static uncertainAndApproximateGroup=y.uncertainGroup+y.approximateGroup;constructor(t,e){super(t,e)}static numberFormat(t,e,n){return this.qualifierFormat(i.groupName(y.uncertainGroup,t),"?")+this.qualifierFormat(i.groupName(y.approximateGroup,t),"~")+this.qualifierFormat(i.groupName(y.uncertainAndApproximateGroup,t),"%")+E.numberFormat(t,e,n)}parseGroups(t){const e=super.parseGroups(t),n=t[i.groupName(y.uncertainAndApproximateGroup,this.name)];return(t[i.groupName(y.uncertainGroup,this.name)]||n)&&(e.uncertainComponent=!0),(t[i.groupName(y.approximateGroup,this.name)]||n)&&(e.approximateComponent=!0),e}}const At="yearValue",dn="exp",pn="signif";class Ot extends y{constructor(){super(At,Ot.format())}static format(t=""){return"Y?"+i.nonCapturingGroup(i.group(i.groupName(t,dn),"[-]?\\d+E\\d+")+"|"+y.numberFormat(i.groupName(t,At),"+","[-]?")+i.optionalGroup(i.groupName(t,pn),"S\\d+"))}parseGroups(t){const e=t[dn];if(e){const a=e.indexOf("E"),u=parseInt(e.substring(a+1),10),c=parseInt(e.substring(0,a),10)*Math.pow(10,u);t[At]=c.toString()}const n=t[pn],r=t[At];if(n){const a=parseInt(n.substring(1),10),{valueStr:u,sign:p}=this.getValueAndSign(t);let c="";for(let f=0;f<u.length;f++)c+=f<a?u.charAt(f):"X";t[At]=(p<0?"-":"")+c}const o=super.parseGroups(t);return n&&(o.value.estimate=parseInt(r,10)),o}parse(t){const e=this.regexGroups(t);return this.parseGroups(e)}}const hn="monthValue";class Xt extends y{static format(t=""){return y.numberFormat(i.groupName(t,hn),"{1,2}",void 0)}constructor(){super(hn,Xt.format())}}const ln="dayValue";class Wt extends y{static format(t=""){return y.numberFormat(i.groupName(t,ln),"{1,2}",void 0)}constructor(){super(ln,Wt.format())}}const fn="hourValue";class Jt extends y{static format(t=""){return y.numberFormat(i.groupName(t,fn),"{1,2}",void 0)}constructor(){super(fn,Jt.format())}}const gn="secondValue";class Kt extends y{static format(t=""){return y.numberFormat(i.groupName(t,gn),"{1,2}",void 0)}constructor(){super(gn,Kt.format())}}const wn="minuteValue";class Zt extends y{static format(t=""){return y.numberFormat(i.groupName(t,wn),"{1,2}",void 0)}constructor(){super(wn,Zt.format())}}class Er extends Yt{}class x extends P{static yearGroup=T.yearGroup;static monthGroup="month";static dayGroup="day";static hourGroup="hour";static minuteGroup="minute";static secondGroup="second";static millisecondGroup="millisecond";static timeshiftGroup="timeshift";constructor(){super("date",x.format())}static format(t=""){return i.group(i.groupName(t,x.yearGroup),Ot.format(t))+i.optionalNonCapturingGroup("-",i.group(i.groupName(t,x.monthGroup),Xt.format(t)),i.optionalNonCapturingGroup("-",i.group(i.groupName(t,x.dayGroup),Wt.format(t)),i.optionalNonCapturingGroup("[T ]",i.group(i.groupName(t,x.hourGroup),Jt.format(t)),":",i.group(i.groupName(t,x.minuteGroup),Zt.format(t)),i.optionalNonCapturingGroup(":",i.group(i.groupName(t,x.secondGroup),Kt.format(t)),i.optionalNonCapturingGroup("[.,]",i.group(i.groupName(t,x.millisecondGroup),"\\d+"))),i.optionalGroup(i.groupName(t,x.timeshiftGroup),Er.format(t)))))}parseGroups(t){const e=t[x.millisecondGroup],n=e?ut.parseFraction(e):void 0,r=t[x.secondGroup];let o;r&&(o=D.fromString(r,void 0,new Kt),o.uncertain=o?.uncertain||!1,o.approximate=o?.approximate||!1);const a=t[x.minuteGroup];let u;a&&(u=Q.fromString(a,new Zt),u.uncertain=u.uncertain||o?.uncertain||!1,u.approximate=u.approximate||o?.approximate||!1);const p=t[x.hourGroup];let c;p&&(c=Z.fromString(p,new Jt),c.uncertain=c.uncertain||u?.uncertain||!1,c.approximate=c.approximate||u?.approximate||!1);const f=t[x.dayGroup];let m;f&&(m=K.fromString(f,new Wt),m.uncertain=m.uncertain||c?.uncertain||!1,m.approximate=m.approximate||c?.approximate||!1);const b=t[x.monthGroup];let g;b&&(g=J.fromString(b,new Xt),g.uncertain=g.uncertain||m?.uncertain||!1,g.approximate=g.approximate||m?.approximate||!1);const G=t[x.yearGroup];let w;G&&(w=W.fromString(G,void 0,new Ot),w.uncertain=w.uncertain||g?.uncertain||!1,w.approximate=w.approximate||g?.approximate||!1);const F=t[x.timeshiftGroup],M=F?Vn.fromString(F,new Yt,{year:w?.value,month:g?.value,day:m?.value,hour:c?.value}):void 0;return{year:w,month:g,day:m,hour:c,minute:u,second:o,millisecond:n,timeshift:M}}}const Sn="durationValue";class Ee extends y{static format(t=""){return"^"+y.numberFormat(i.groupName(t,Sn),"+",void 0)}constructor(){super(Sn,Ee.format())}}class Tr extends Se{millisecond=new N("millisecond",0,Number.MAX_SAFE_INTEGER,void 0);second=new N("second",0,Number.MAX_SAFE_INTEGER,this.millisecond);minute=new N("minute",0,Number.MAX_SAFE_INTEGER,this.second);hour=new N("hour",0,Number.MAX_SAFE_INTEGER,this.minute);day=new N("day",1,Number.MAX_SAFE_INTEGER,this.hour);month=new N("month",1,Number.MAX_SAFE_INTEGER,this.day);year=new N("year",0,Number.MAX_SAFE_INTEGER,this.month)}const ht=new Tr;class h extends y{static yearsGroup="years";static monthsGroup="months";static isoMonthsGroup="isoMonths";static daysGroup="days";static hoursGroup="hours";static minutesGroup="minutes";static secondsGroup="seconds";static durationGroup="duration";static suffixGroup="durationSuffix";static componentParser=new Ee;static componentFormat(t,e,n,r,o=""){const a=i.group(i.groupName(t,h.quantityGroup(e)),y.numberFormat(i.groupName(t,n),"+",void 0,"\\d"));return i.group(i.groupName(t,e),a,r,o)}static quantityGroup(t){return t+"Quantity"}static isoMonthsLookahead="(?=[?~%]?\\d+D|T)";constructor(){super("duration",h.format())}static format(t=""){const e=i.groupName(t,h.durationGroup);return this.qualifierFormat(i.groupName(y.uncertainGroup,e),"?")+this.qualifierFormat(i.groupName(y.approximateGroup,e),"~")+this.qualifierFormat(i.groupName(y.uncertainAndApproximateGroup,e),"%")+"P"+i.optional(h.componentFormat(t,h.yearsGroup,x.yearGroup,"Y"))+i.optionalNonCapturingGroup(h.componentFormat(t,h.monthsGroup,x.monthGroup,"MM")+"|"+h.componentFormat(t,h.isoMonthsGroup,"isoMonth","M",h.isoMonthsLookahead))+i.optional(h.componentFormat(t,h.daysGroup,x.dayGroup,"D"))+"T?"+i.optional(h.componentFormat(t,h.hoursGroup,x.hourGroup,"H"))+i.optional(h.componentFormat(t,h.minutesGroup,x.minuteGroup,"M"))+i.optional(h.componentFormat(t,h.secondsGroup,x.secondGroup,"S"))+i.optionalGroup(i.groupName(t,h.suffixGroup),"[?~%]")}static parseComponent(t,e,n){const r=h.componentParser.parse(t);return new e(r,n)}parseGroups(t){const e=t[h.quantityGroup(h.secondsGroup)];let n;e&&(n=h.parseComponent(e,D,ht.second),n.uncertain=!!t[i.groupName(y.uncertainGroup,h.secondsGroup)]||!1,n.approximate=!!t[i.groupName(y.approximateGroup,h.secondsGroup)]||!1);const r=t[h.quantityGroup(h.minutesGroup)];let o;r&&(o=h.parseComponent(r,Q,ht.minute),o.uncertain=o.uncertain||n?.uncertain||!1,o.approximate=o.approximate||n?.approximate||!1);const a=t[h.quantityGroup(h.hoursGroup)];let u;a&&(u=h.parseComponent(a,Z,ht.hour),u.uncertain=u.uncertain||o?.uncertain||!1,u.approximate=u.approximate||o?.approximate||!1);const p=t[h.quantityGroup(h.daysGroup)];let c;p&&(c=h.parseComponent(p,K,ht.day),c.uncertain=c.uncertain||u?.uncertain||!1,c.approximate=c.approximate||u?.approximate||!1);const f=t[h.quantityGroup(h.monthsGroup)]||t[h.quantityGroup(h.isoMonthsGroup)];let m;f&&(m=h.parseComponent(f,J,ht.month),m.uncertain=m.uncertain||c?.uncertain||!1,m.approximate=m.approximate||c?.approximate||!1);const b=t[h.quantityGroup(h.yearsGroup)];let g;b&&(g=h.parseComponent(b,W,ht.year),g.uncertain=g.uncertain||m?.uncertain||!1,g.approximate=g.approximate||m?.approximate||!1);const G=t[h.suffixGroup],w=!!t[i.groupName(y.uncertainAndApproximateGroup,h.durationGroup)]||G==="%",F=w||!!t[i.groupName(y.uncertainGroup,h.durationGroup)]||G==="?",M=w||!!t[i.groupName(y.approximateGroup,h.durationGroup)]||G==="~";return{years:g,months:m,days:c,hours:u,minutes:o,seconds:n,uncertain:F,approximate:M}}}const Mr="dates",he="start",le="end",yn="durations",fe="durationMin",ge="durationMax";class oe extends P{static format=i.group(Mr,i.optionalGroup(he,i.group("openStart","\\.\\.")+"|"+x.format(he))+"/"+i.optionalGroup(le,i.group("openEnd","\\.\\.")+"|"+x.format(le)))+"|"+i.group(yn,i.group(fe,h.format(fe))+"/"+i.group(ge,h.format(ge)));constructor(t="interval",e=oe.format){super(t,e)}parseGroups(t){let e,n;if(t[yn]){const o=t[fe];e=A.fromString(o,new h);const a=t[ge];n=A.fromString(a,new h)}else{const o=t[he];switch(o){case void 0:e=null;break;case"..":e=void 0;break;default:e=U.fromString(o,new x)}const a=t[le];switch(a){case void 0:n=null;break;case"..":n=void 0;break;default:n=U.fromString(a,new x)}}return{start:e,end:n}}}class vr{parse(t){t=t.trim();const e=t.startsWith("["),r=t.substring(1,t.length-1).split(","),o=[];for(const a of r){let u;a.includes("..")?u=Rt.fromString(a.replace("..","/"),new oe):u=U.fromString(a,new x),o.push(u)}return{values:o,exclusive:e}}}d.register(U,()=>new x);d.register(K,()=>new Wt);d.register(A,()=>new h);d.register(Z,()=>new Jt);d.register(Rt,()=>new oe);d.register(Q,()=>new Zt);d.register(J,()=>new Xt);d.register(D,()=>new Kt);d.register(_t,()=>new vr);d.register(W,()=>new Ot);class H{constructor(t){this.preferences=t}read(t){var e,n;if(t===void 0)return;if(typeof t=="string")return t===""?void 0:t;for(const o of this.preferences){const a=(e=t[o])!==null&&e!==void 0?e:t[H.base(o)];if(a)return a}const r=new Set(this.preferences.map(o=>H.base(o)));for(const[o,a]of Object.entries(t))if(a&&r.has(H.base(o)))return a;return(n=Object.values(t).find(o=>o))!==null&&n!==void 0?n:void 0}write(t,e,n){var r,o;const a=e?.trim()?e.trim():void 0;if(t===void 0||typeof t=="string")return a;const u={...t},p=(o=(r=Object.keys(u).find(c=>c===n))!==null&&r!==void 0?r:Object.keys(u).find(c=>H.base(c)===H.base(n)))!==null&&o!==void 0?o:n;return a===void 0?delete u[p]:u[p]=a,Object.keys(u).length===0?void 0:u}static base(t){return t.toLowerCase().split("-")[0]}}H.any=new H([]);var bn;(function(s){s.abductee="abductee",s.actor="actor",s.artist="artist",s.anthropologist="anthropologist",s.archeologist="archeologist",s.astronaut="astronaut",s.astronomer="astronomer",s.astrologist="astrologist",s.astrophysicist="astrophysicist",s.banker="banker",s.barman="barman",s.biologist="biologist",s.biochemist="biochemist",s.biophysicist="biophysicist",s.bishop="bishop",s.businessman="businessman",s.botanist="botanist",s.cameraman="cameraman",s.chemist="chemist",s.contactee="contactee",s.cryptozoologist="cryptozoologist",s.dentist="dentist",s.director="director",s.diplomat="diplomat",s.diver="diver",s.electronics="electronics",s.engineer="engineer",s.ethnologist="ethnologist",s.exobiologist="exobiologist",s.farmer="farmer",s.firefighter="firefighter",s.flightAttendant="flightAttendant",s.geologist="geologist",s.geophysicist="geophysicist",s.geographer="geographer",s.historian="historian",s.houseWife="houseWife",s.hypnotherapist="hypnotherapist",s.illusionist="illusionist",s.journalist="journalist",s.judge="judge",s.lawyer="lawyer",s.leader="leader",s.librarian="librarian",s.logger="logger",s.mathematician="mathematician",s.mechanic="mechanic",s.meteorologist="meteorologist",s.military="military",s.musician="musician",s.neurologist="neurologist",s.neuroscientist="neuroscientist",s.neuropsychiatrist="neuropsychiatrist",s.nurse="nurse",s.oceanographer="oceanographer",s.painter="painter",s.parapsychologist="parapsychologist",s.philosopher="philosopher",s.photographer="photographer",s.physician="physician",s.physicist="physicist",s.pilot="pilot",s.politician="politician",s.policeman="policeman",s.priest="priest",s.producer="producer",s.prospector="prospector",s.psychologist="psychologist",s.psychiatrist="psychiatrist",s.radioastronomer="radioastronomer",s.radioamateur="radioamateur",s.salesman="salesman",s.sailor="sailor",s.sociologist="sociologist",s.softwareEngineer="softwareEngineer",s.stuntman="stuntman",s.taxiDriver="taxiDriver",s.teacher="teacher",s.telegrapher="telegrapher",s.truckDriver="truckDriver",s.ufologist="ufologist",s.ufoWitness="ufoWitness",s.ufoWitness2="ufoWitness2",s.worker="worker",s.writer="writer"})(bn||(bn={}));var Gn;(function(s){s.neutral="neutral",s.male="male",s.female="female"})(Gn||(Gn={}));const Ar="modulepreload",kr=function(s,t){return new URL(s,t).href},xn={},Pt=function(t,e,n){let r=Promise.resolve();if(e&&e.length>0){let a=function(f){return Promise.all(f.map(m=>Promise.resolve(m).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};const u=document.getElementsByTagName("link"),p=document.querySelector("meta[property=csp-nonce]"),c=p?.nonce||p?.getAttribute("nonce");r=a(e.map(f=>{if(f=kr(f,n),f in xn)return;xn[f]=!0;const m=f.endsWith(".css"),b=m?'[rel="stylesheet"]':"";if(!!n)for(let w=u.length-1;w>=0;w--){const F=u[w];if(F.href===f&&(!m||F.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${f}"]${b}`))return;const G=document.createElement("link");if(G.rel=m?"stylesheet":Ar,m||(G.as="script"),G.crossOrigin="",G.href=f,c&&G.setAttribute("nonce",c),document.head.appendChild(G),m)return new Promise((w,F)=>{G.addEventListener("load",w),G.addEventListener("error",()=>F(new Error(`Unable to preload CSS for ${f}`)))})}))}function o(a){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=a,window.dispatchEvent(u),!u.defaultPrevented)throw a}return r.then(a=>{for(const u of a||[])u.status==="rejected"&&o(u.reason);return t().catch(o)})};class $r extends Error{constructor(t,e){super(t),this.cause=e}}class Te extends $r{constructor(t=Te.defaultMessage,e){super(t,e)}}Te.defaultMessage="Assertion failed";var Nn;(function(s){s.country="country",s.region="region",s.department="department",s.city="city",s.company="company"})(Nn||(Nn={}));var En;(function(s){s.at="at",s.au="au",s.ar="ar",s.be="be",s.br="br",s.ca="ca",s.ch="ch",s.cn="cn",s.cl="cl",s.co="co",s.cy="cy",s.de="de",s.dk="dk",s.do="do",s.dz="dz",s.gr="gr",s.ec="ec",s.eg="eg",s.es="es",s.fi="fi",s.fr="fr",s.ga="ga",s.ge="ge",s.hu="hu",s.in="in",s.ie="ie",s.ir="ir",s.il="il",s.it="it",s.jp="jp",s.kr="kr",s.ma="ma",s.mx="mx",s.my="my",s.mz="mz",s.nl="nl",s.no="no",s.nz="nz",s.pa="pa",s.pe="pe",s.ph="ph",s.pl="pl",s.pt="pt",s.ro="ro",s.ru="ru",s.sc="sc",s.tr="tr",s.ua="ua",s.uk="uk",s.us="us",s.sa="sa",s.se="se",s.su="su",s.tn="tn",s.tw="tw",s.ve="ve",s.za="za"})(En||(En={}));class Rr extends Error{constructor(t,e,n){super(typeof e=="number"&&Number.isInteger(e)&&e>=1?`This ${t} file is in version ${e} of its format; this UFO@home reads version ${n}. Read it with the UFO@home that reads its version.`:`This ${t} file states ${JSON.stringify(e)} as its format version, which is not a version.`),this.format=t,this.found=e,this.supported=n,this.name="FormatVersionError"}said(t){return t.replace("{found}",typeof this.found=="number"?String(this.found):JSON.stringify(this.found)).replace("{supported}",String(this.supported))}}class tt{static CURRENT={sighting:4,case:1,interview:1};static SCHEMA_BASE="https://ufoathome.org/schema";static schemaUrl(t,e=tt.CURRENT[t]){return`${tt.SCHEMA_BASE}/${e}/${t}.schema.json`}static of(t){if(typeof t!="object"||t===null)return 1;const e=t.version;return e===void 0?1:typeof e=="object"&&e!==null&&"value"in e?e.value:e}static recording(t){return tt.check(t,"sighting")}static check(t,e){const n=tt.of(t),r=tt.CURRENT[e];if(typeof n!="number"||!Number.isInteger(n)||n!==r)throw new Rr(e,n,r);return t}}class X{static NAMES=["weather","place","lightPollution","decor"];static KEYS={weather:["weatherTrack","weatherSource"],place:["place"],lightPollution:["lightPollution"],decor:["decor"]};static annexName(t,e){return`${t}.${e.replace(/[A-Z]/g,n=>`-${n.toLowerCase()}`)}.json`}static taken(t,e){const n={};if(t==="decor")return Array.isArray(e.decor)&&(n.decor=e.decor.filter(X.surveyed)),n;for(const r of X.KEYS[t])e[r]!==void 0&&(n[r]=e[r]);return n}static strip(t,e){if(t==="decor"){const n=Array.isArray(e.decor)?e.decor.filter(r=>!X.surveyed(r)):[];n.length>0?e.decor=n:delete e.decor;return}for(const n of X.KEYS[t])delete e[n]}static put(t,e,n){if(t==="decor"){if(!Array.isArray(n.decor))return;const r=Array.isArray(e.decor)?e.decor.filter(o=>!X.surveyed(o)):[];e.decor=[...r,...n.decor];return}for(const r of X.KEYS[t])n[r]!==void 0&&(e[r]=n[r])}static surveyed(t){return typeof t=="object"&&t!==null&&typeof t.origin=="string"}static fromFile(t,e){return t?.[e]!==void 0&&t[e].live!==!0}}class lt extends Error{constructor(t,e,n){super(`${t}: ${e}${n===void 0?"":` (HTTP ${n})`}`),this.kind=t,this.url=e,this.status=n,this.name="SightingFetchError"}}class te{static async recording(t){const e=await te.json(t);for(const n of X.NAMES){const r=e?.snapshots?.[n];if(!(!r?.src||r.live))try{const o=tt.recording(await te.json(new URL(r.src,new URL(t,location.href)).href));X.put(n,e,o)}catch{}}return e}static async json(t){const e=new URL(t,location.href);if(location.protocol==="https:"&&e.protocol==="http:")throw new lt("mixed-content",t);let n;try{n=await fetch(t)}catch{throw await this.diagnose(t,e)}if(!n.ok)throw new lt("status",t,n.status);try{return await n.json()}catch{throw new lt("malformed",t)}}static async diagnose(t,e){if(e.origin===location.origin)return new lt("unreachable",t);try{return await fetch(t,{mode:"no-cors"}),new lt("cors",t)}catch{return new lt("unreachable",t)}}}function Fr(s,t){for(const e of s){const n=e.toLowerCase().split("-")[0];if(t.includes(n))return n}return"en"}class Vr{static preferencesFor(t){const e=navigator.languages??[],n=this.declaredFor(t);return n?[n,...e]:e}static declaredFor(t){for(let e=t;e;){const n=e.closest("[lang]")?.getAttribute("lang")?.trim();if(n)return n;const r=e.getRootNode();e=r instanceof ShadowRoot?r.host:void 0}}}const Ir=["en","fr","es","it"];class Me{static catalog(t){const e=new Map;return{load(n){const r=Me.languageOf(n);let o=e.get(r);return o||(o=t[r](),e.set(r,o),o.catch(()=>e.delete(r))),o}}}static none(){return new Proxy({},{get:()=>""})}static blank(){const t=new Proxy(()=>t,{get:(e,n)=>n===Symbol.toPrimitive?()=>"":n===Symbol.iterator?function*(){}:n==="toString"||n==="valueOf"?()=>"":n==="then"?void 0:t,apply:()=>t,has:()=>!1,ownKeys:()=>[],getOwnPropertyDescriptor:()=>{}});return t}static languageOf(t){const e=t.toLowerCase().split("-")[0];return Ir.includes(e)?e:"en"}}const jr=["en","fr","es","it"],Ur={en:()=>Pt(()=>import("./InterviewMessages_en-BNau2xU8.js"),[],import.meta.url).then(s=>s.interviewMessages_en),fr:()=>Pt(()=>import("./InterviewMessages_fr-OCQdwn9j.js"),[],import.meta.url).then(s=>s.interviewMessages_fr),es:()=>Pt(()=>import("./InterviewMessages_es-ypa0EDh9.js"),[],import.meta.url).then(s=>s.interviewMessages_es),it:()=>Pt(()=>import("./InterviewMessages_it-awuOqf5v.js"),[],import.meta.url).then(s=>s.interviewMessages_it)},zr=Me.catalog(Ur),Cr="interviewseek";class v{static read(t){return tt.check(t,"interview")}static isProofread(t){const e=Object.keys(t.speakers);return e.length>0&&e.every(n=>{const r=t.proofreading?.[n]?.status;return r==="approved"||r==="covered"})}static said(t){return t.parts?t.parts.map(e=>"redacted"in e?"…":v.plain(e.text)).join(" "):t.redacted?void 0:v.plain(t.text??"")}static ENTITIES={amp:"&",lt:"<",gt:">",quot:'"',apos:"'",nbsp:" "};static plain(t){return/[<&]/.test(t)?t.replace(/<br\s*\/?>/gi,`
2
+ `).replace(/<\/?[a-z][^>]*>/gi,"").replace(/&#x([0-9a-f]+);/gi,(e,n)=>String.fromCodePoint(parseInt(n,16))).replace(/&#(\d+);/g,(e,n)=>String.fromCodePoint(Number(n))).replace(/&(\w+);/g,(e,n)=>v.ENTITIES[n.toLowerCase()]??e):t}static sightingsOf(t){return[t.interviewOf].flat().filter(e=>typeof e=="string")}static passagesAbout(t,e){const n=v.sightingsOf(t),r=[];return t.segments.forEach((o,a)=>{for(const u of o.refs??[]){if(u.sighting===void 0?!n.includes(e):u.sighting!==e)continue;const p=v.said(o);r.push({index:a,speaker:o.speaker,at:u.at,...p!==void 0?{text:p}:{},...u.range?{range:u.range}:{}})}}),r.sort((o,a)=>o.at-a.at||o.index-a.index)}static clock(t,e=!1){const n=Math.round(t*10),r=Math.floor(n/10),o=p=>String(p).padStart(2,"0"),a=Math.floor(r/3600),u=`${a>0||e?o(Math.floor(r/60)%60):Math.floor(r/60)}:${o(r%60)}`;return`${a>0?`${a}:`:""}${u}${e||n%10!==0?`.${n%10}`:""}`}static speakerName(t,e){const n=t.speakers[e];if(!n)return e;const r=typeof n.title=="string"?n.title:n.title?Object.values(n.title)[0]:void 0;return r||n.by&&v.agentName(n.by)||n.role}static agentName(t){if("people"in t){const[e,...n]=t.people.replace(/([a-z])([A-Z])/g,"$1 $2").split(" ");return[...n,e].join(" ")}return"org"in t?t.org:t.title??""}static stamp(t){const e=Math.round(t*1e3),n=(r,o=2)=>String(r).padStart(o,"0");return`${n(Math.floor(e/36e5))}:${n(Math.floor(e/6e4)%60)}:${n(Math.floor(e/1e3)%60)}.${n(e%1e3,3)}`}static toVtt(t){const e=o=>o.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),n=t.segments.filter(o=>o.start!==void 0);return`WEBVTT
3
3
 
4
- ${r.map((o,u)=>{const i=r[u+1],d=o.end??i?.start??o.start+5,c=i&&i.start<d?Math.max(o.start,i.start):d;return`${$.stamp(o.start)} --> ${$.stamp(c)}
5
- <v ${e($.speakerName(t,o.speaker))}>${e($.said(o)??"[…]")}`}).join(`
4
+ ${n.map((o,a)=>{const u=n[a+1],p=o.end??u?.start??o.start+5,c=u&&u.start<p?Math.max(o.start,u.start):p;return`${v.stamp(o.start)} --> ${v.stamp(c)}
5
+ <v ${e(v.speakerName(t,o.speaker))}>${e(v.said(o)??"[…]")}`}).join(`
6
6
 
7
7
  `)}
8
- `}}class M{static svg(t){return`<svg viewBox="0 0 24 24" width="1.5em" height="1.5em" aria-hidden="true" focusable="false"><path d="${t}" fill="currentColor"/></svg>`}static outline(t){return`<svg viewBox="0 0 24 24" width="1.5em" height="1.5em" aria-hidden="true" focusable="false"><path d="${t}" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round" stroke-linecap="round"/></svg>`}static solid(t){return`<svg viewBox="0 0 24 24" width="1.5em" height="1.5em" aria-hidden="true" focusable="false"><path d="${t}" fill="currentColor" fill-rule="evenodd"/></svg>`}static BOOKMARK="M6 3.5h12a.5.5 0 0 1 .5.5v16.5L12 16.8l-6.5 3.7V4a.5.5 0 0 1 .5-.5z";static PICTURE="M5 4h14a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z";static PICTURE_HILLS="M4.5 17.5l4.5-6 3 4 2.5-3 5 5z";static PIN="M12 21.5s-6.5-5.7-6.5-10.8a6.5 6.5 0 0 1 13 0c0 5.1-6.5 10.8-6.5 10.8z";static PIN_HOLE="M12 8.4a2.4 2.4 0 1 0 0 4.8 2.4 2.4 0 0 0 0-4.8z";static MILESTONES_OFF=M.outline(M.BOOKMARK);static MILESTONES_ON=M.solid(M.BOOKMARK);static PICTURES_OFF=M.outline(`${M.PICTURE}${M.PICTURE_HILLS}`);static PICTURES_ON=M.solid(`${M.PICTURE}${M.PICTURE_HILLS}`);static TRACE_LINE="M3 19.5l2.2-2.2 1.4 1.4L4.4 20.9zM8 14.5l2.2-2.2 1.4 1.4-2.2 2.2zM13 9.5l2.2-2.2 1.4 1.4-2.2 2.2z";static TRACE_MARK="M18.5 2.5l3.5 3.5-3.5 3.5-3.5-3.5z";static TRACES_OFF=M.outline(`${M.TRACE_LINE}${M.TRACE_MARK}`);static TRACES_ON=M.solid(`${M.TRACE_LINE}${M.TRACE_MARK}`);static MAP_OFF=M.outline(`${M.PIN}${M.PIN_HOLE}`);static MAP_ON=M.solid(`${M.PIN}${M.PIN_HOLE}`);static SHARE=M.outline("M14 4l7 7-7 7v-4.2C8.6 13.8 5.4 15.6 3.5 19c.6-5.6 3.4-9.6 10.5-10.8V4z");static FOLDED=M.svg("M15.4 7.4 14 6l-6 6 6 6 1.4-1.4L10.8 12z");static UNFOLDED=M.svg("M8.6 16.6 10 18l6-6-6-6-1.4 1.4 4.6 4.6z");static PLAY=M.svg("M7.4 5v14l11-7z");static PAUSE=M.svg("M6 5h4v14H6zM14 5h4v14h-4z");static VOLUME=M.svg("M2 9.5v5h3.5l4.5 4.5V5L5.5 9.5H2zm12.5 2.5A4 4 0 0 0 12.5 8.5v7A4 4 0 0 0 14.5 12zM12.5 4.2v2.1a6.5 6.5 0 0 1 0 11.4v2.1a8.6 8.6 0 0 0 0-15.6z");static MUTED=M.svg("M2 9.5v5h3.5l4.5 4.5V5L5.5 9.5H2zM15 9.8l1.4-1.4 2.6 2.6 2.6-2.6 1.4 1.4-2.6 2.6 2.6 2.6-1.4 1.4-2.6-2.6-2.6 2.6-1.4-1.4 2.6-2.6z");static ENTER_FULLSCREEN=M.svg("M5 5h5v2H7v3H5V5zm9 0h5v5h-2V7h-3V5zM5 14h2v3h3v2H5v-5zm12 0h2v5h-5v-2h3v-3z");static EXIT_FULLSCREEN=M.svg("M8 5h2v5H5V8h3V5zm6 0h2v3h3v2h-5V5zM5 14h5v5H8v-3H5v-2zm9 0h5v2h-3v3h-2v-5z")}const Ar="rr0-interview",Kn=`
8
+ `}}class S{static svg(t){return`<svg viewBox="0 0 24 24" width="1.5em" height="1.5em" aria-hidden="true" focusable="false"><path d="${t}" fill="currentColor"/></svg>`}static outline(t){return`<svg viewBox="0 0 24 24" width="1.5em" height="1.5em" aria-hidden="true" focusable="false"><path d="${t}" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round" stroke-linecap="round"/></svg>`}static solid(t){return`<svg viewBox="0 0 24 24" width="1.5em" height="1.5em" aria-hidden="true" focusable="false"><path d="${t}" fill="currentColor" fill-rule="evenodd"/></svg>`}static BOOKMARK="M6 3.5h12a.5.5 0 0 1 .5.5v16.5L12 16.8l-6.5 3.7V4a.5.5 0 0 1 .5-.5z";static PICTURE="M5 4h14a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z";static PICTURE_HILLS="M4.5 17.5l4.5-6 3 4 2.5-3 5 5z";static PIN="M12 21.5s-6.5-5.7-6.5-10.8a6.5 6.5 0 0 1 13 0c0 5.1-6.5 10.8-6.5 10.8z";static PIN_HOLE="M12 8.4a2.4 2.4 0 1 0 0 4.8 2.4 2.4 0 0 0 0-4.8z";static MILESTONES_OFF=S.outline(S.BOOKMARK);static MILESTONES_ON=S.solid(S.BOOKMARK);static PICTURES_OFF=S.outline(`${S.PICTURE}${S.PICTURE_HILLS}`);static PICTURES_ON=S.solid(`${S.PICTURE}${S.PICTURE_HILLS}`);static TRACE_LINE="M3 19.5l2.2-2.2 1.4 1.4L4.4 20.9zM8 14.5l2.2-2.2 1.4 1.4-2.2 2.2zM13 9.5l2.2-2.2 1.4 1.4-2.2 2.2z";static TRACE_MARK="M18.5 2.5l3.5 3.5-3.5 3.5-3.5-3.5z";static TRACES_OFF=S.outline(`${S.TRACE_LINE}${S.TRACE_MARK}`);static TRACES_ON=S.solid(`${S.TRACE_LINE}${S.TRACE_MARK}`);static MAP_OFF=S.outline(`${S.PIN}${S.PIN_HOLE}`);static MAP_ON=S.solid(`${S.PIN}${S.PIN_HOLE}`);static SHARE=S.outline("M14 4l7 7-7 7v-4.2C8.6 13.8 5.4 15.6 3.5 19c.6-5.6 3.4-9.6 10.5-10.8V4z");static FOLDED=S.svg("M15.4 7.4 14 6l-6 6 6 6 1.4-1.4L10.8 12z");static UNFOLDED=S.svg("M8.6 16.6 10 18l6-6-6-6-1.4 1.4 4.6 4.6z");static PLAY=S.svg("M7.4 5v14l11-7z");static PAUSE=S.svg("M6 5h4v14H6zM14 5h4v14h-4z");static VOLUME=S.svg("M2 9.5v5h3.5l4.5 4.5V5L5.5 9.5H2zm12.5 2.5A4 4 0 0 0 12.5 8.5v7A4 4 0 0 0 14.5 12zM12.5 4.2v2.1a6.5 6.5 0 0 1 0 11.4v2.1a8.6 8.6 0 0 0 0-15.6z");static MUTED=S.svg("M2 9.5v5h3.5l4.5 4.5V5L5.5 9.5H2zM15 9.8l1.4-1.4 2.6 2.6 2.6-2.6 1.4 1.4-2.6 2.6 2.6 2.6-1.4 1.4-2.6-2.6-2.6 2.6-1.4-1.4 2.6-2.6z");static ENTER_FULLSCREEN=S.svg("M5 5h5v2H7v3H5V5zm9 0h5v5h-2V7h-3V5zM5 14h2v3h3v2H5v-5zm12 0h2v5h-5v-2h3v-3z");static EXIT_FULLSCREEN=S.svg("M8 5h2v5H5V8h3V5zm6 0h2v3h3v2h-5V5zM5 14h5v5H8v-3H5v-2zm9 0h5v2h-3v3h-2v-5z")}const Tn="rr0-interview",qr=`
9
9
  rr0-interview { display: block; --rr0-interview-line: color-mix(in srgb, currentColor 35%, transparent); }
10
10
  rr0-interview [hidden] { display: none !important; }
11
11
  rr0-interview .rr0-interview-status { font-size: .85em; opacity: .85; margin: 0 0 .5em; }
@@ -17,6 +17,9 @@ rr0-interview .intervention { margin: 0 0 .4em; border-left: 3px solid var(--spe
17
17
  rr0-interview .intervention:hover { background: color-mix(in srgb, var(--speaker) 7%, transparent); }
18
18
  rr0-interview .turn { position: relative; padding: .2em .5em; }
19
19
  rr0-interview .turn.flash { background: color-mix(in srgb, #fc3 28%, transparent); }
20
+ /* The passage the replay is inside stays lit while it is there, instead of a flash that is over before anyone looks. Nothing marks the
21
+ passages that are merely tied to a moment: each already carries its timecode, which says it (dicté). */
22
+ rr0-interview .turn.synced { background: color-mix(in srgb, #fc3 12%, transparent); }
20
23
  rr0-interview .turn .who { font-size: .85em; font-weight: 600; color: var(--speaker); overflow-wrap: anywhere; }
21
24
  rr0-interview .turn.is-redacted .who, rr0-interview .turn.goes-on .who { display: none; }
22
25
  rr0-interview .turn .said, rr0-interview .turn .redacted { margin: 0; padding: 0; text-indent: 0; white-space: pre-wrap; }
@@ -32,4 +35,4 @@ rr0-interview .turn .refs { display: flex; flex-wrap: wrap; gap: .25em; }
32
35
  rr0-interview .turn .ref { font: inherit; font-size: .8em; cursor: pointer; border: 1px solid var(--rr0-interview-line); border-radius: 999px; background: transparent; color: inherit;
33
36
  padding: 0 .35em; font-variant-numeric: tabular-nums; white-space: nowrap; display: inline-flex; align-items: center; gap: .15em; }
34
37
  rr0-interview .turn .ref svg { width: 1.1em; height: 1.1em; }
35
- `;class $e extends HTMLElement{messages;said=new X(["en"]);localeToken=0;loadToken=0;json;loading;base;status=document.createElement("p");turns=document.createElement("div");blocks=new Map;constructor(){super(),this.status.className="rr0-interview-status",this.status.setAttribute("role","status"),this.turns.className="rr0-interview-turns"}static get observedAttributes(){return["src"]}attributeChangedCallback(t,e,r){t==="src"&&r!==e&&this.isConnected&&this.load()}connectedCallback(){$e.styleRoot(this.getRootNode()),this.contains(this.turns)||this.replaceChildren(this.status,this.turns),this.loadLocale(),this.hasAttribute("src")&&this.json===void 0&&this.loading!==this.getAttribute("src")&&this.load()}get interview(){return this.json}set interview(t){this.loadToken++,this.json=t,this.draw()}set documentUrl(t){this.base=t}static styleRoot(t){const e=t instanceof ShadowRoot?t:document.head;if(e.querySelector("style[data-rr0-interview]"))return;const r=document.createElement("style");r.dataset.rr0Interview="",r.textContent=Kn,e.append(r)}async load(){const t=this.getAttribute("src"),e=++this.loadToken;if(this.loading=t??void 0,!t)return;const r=new URL(t,location.href).href;let n;try{n=$.read(await se.json(r))}catch{n=void 0}e===this.loadToken&&(this.base=r,this.json=n,this.draw())}async loadLocale(){const t=++this.localeToken,e=zn.preferencesFor(this),r=Bn(e,qn),n=await Xn.load(r);t===this.localeToken&&(this.said=new X(e),this.messages=n,this.draw())}speakerName(t,e){const r=$.speakerName(t,e),n=t.speakers?.[e]?.role;return r===n&&n in this.messages.roles?this.messages.roles[n]:r}seek(t,e){const r=this.json,n=e?$.said(e):void 0,o={sighting:t.sighting??$.sightingsOf(r)[0],at:t.at,...n?{quote:n}:{}};this.dispatchEvent(new CustomEvent(Wn,{bubbles:!0,composed:!0,detail:o}));const u=this.getAttribute("player");if(!u)return;const d=this.getRootNode().getElementById?.(u);typeof d?.seekTo=="function"&&(d.scrollIntoView?.({block:"center",behavior:"smooth"}),d.seekTo(o.at,o.sighting))}gap(t,e){const r=document.createElement(e),n=document.createElement("span");n.className="bar";const o=`${this.messages.redacted}${this.messages.colon}${this.said.read(t)??""}`;return n.dataset.tip=o,n.tabIndex=0,n.setAttribute("role","img"),n.setAttribute("aria-label",o),r.append(n),r}saidNodes(t){if(!/[<&]/.test(t))return[document.createTextNode(t)];const e=document.createElement("template");e.innerHTML=t;for(const r of e.content.querySelectorAll("*")){if(["SCRIPT","STYLE","IFRAME","OBJECT","EMBED"].includes(r.tagName)){r.remove();continue}for(const n of[...r.attributes])if(/^on/i.test(n.name)||/^\s*javascript:/i.test(n.value))r.removeAttribute(n.name);else if(["href","src"].includes(n.name))try{n.value=new URL(n.value,this.base??location.href).href}catch{}}return[...e.content.childNodes]}draw(){if(!this.messages)return;const t=this.messages,e=this.json;this.blocks.clear();const r=Array.isArray(e?.segments)?e.segments:[];if(!e||r.length===0){this.status.hidden=!0;const m=document.createElement("p");m.textContent=t.exchangesEmpty,this.turns.replaceChildren(m);return}const n=e.speakers??{},o=Object.keys(n);if(e.proofreading){const m=o.filter(w=>!["approved","covered"].includes(e.proofreading?.[w]?.status??""));this.status.textContent=m.length===0?t.proofreadAll:t.proofreadPending.replace("{names}",m.map(w=>this.speakerName(e,w)).join(", ")),this.status.hidden=!1}else this.status.hidden=!0;const u=[];let i,d=!1,c,p;r.forEach((m,w)=>{const y=m.redacted?JSON.stringify(m.redacted.reason):void 0;if(y!==void 0&&c?.reason===y){this.blocks.set(w,c.block),m.speaker!==p&&(p=void 0);return}const x=document.createElement("div");x.className="turn",x.dataset.segment=String(w);const S=document.createElement("div");S.className="who";const T=document.createElement("span");if(T.textContent=m.redacted?"":this.speakerName(e,m.speaker),m.start!==void 0&&(x.dataset.time=$.clock(m.start,!0)),p!==m.speaker&&(i=document.createElement("div"),i.className="intervention",i.style.setProperty("--speaker-hue",String((Math.max(0,o.indexOf(m.speaker))*67+210)%360)),u.push(i),d=!1),m.redacted||(d&&x.classList.add("goes-on"),d=!0),i.append(x),p=m.speaker,S.append(T),m.redacted){x.classList.add("is-redacted");const g=this.gap(m.redacted.reason,"p");g.className="redacted",c={block:x,reason:y},x.append(S,g)}else{const g=document.createElement("p");if(g.className="said",m.parts){let F="";for(const C of m.parts){const me="redacted"in C?"▮":$.plain(C.text);/[\p{L}\p{N}.,;:!?)»”…▮]$/u.test(F)&&/^[\p{L}\p{N}(«“▮]/u.test(me)&&g.append(" "),"redacted"in C?g.append(this.gap(C.redacted.reason,"span")):g.append(...this.saidNodes(C.text)),F=me}}else g.append(...this.saidNodes(m.text??""));c=void 0,x.append(S,g)}if(m.refs?.length){const g=document.createElement("div");g.className="refs";for(const F of m.refs){const C=document.createElement("button");C.type="button",C.className="ref",C.innerHTML=M.PLAY,C.append($.clock(F.at,!0)),C.addEventListener("click",()=>this.seek(F,m)),g.append(C)}x.append(g)}this.blocks.set(w,x)}),this.turns.replaceChildren(...u)}revealSegment(t){const e=this.blocks.get(t);e&&(e.scrollIntoView?.({block:"center"}),e.classList.add("flash"),window.setTimeout(()=>e.classList.remove("flash"),1600))}}function Jn(){customElements.get(Ar)||customElements.define(Ar,$e)}Jn();
38
+ `;class ve extends HTMLElement{messages;said=new H(["en"]);localeToken=0;loadToken=0;json;loading;base;status=document.createElement("p");turns=document.createElement("div");blocks=new Map;lastRevealed;syncedIndex;constructor(){super(),this.status.className="rr0-interview-status",this.status.setAttribute("role","status"),this.turns.className="rr0-interview-turns"}static get observedAttributes(){return["src"]}attributeChangedCallback(t,e,n){t==="src"&&n!==e&&this.isConnected&&this.load()}connectedCallback(){ve.styleRoot(this.getRootNode()),this.contains(this.turns)||this.replaceChildren(this.status,this.turns),this.loadLocale(),this.hasAttribute("src")&&this.json===void 0&&this.loading!==this.getAttribute("src")&&this.load()}get interview(){return this.json}set interview(t){this.loadToken++,this.json=t,this.draw()}set documentUrl(t){this.base=t}static styleRoot(t){const e=t instanceof ShadowRoot?t:document.head;if(e.querySelector("style[data-rr0-interview]"))return;const n=document.createElement("style");n.dataset.rr0Interview="",n.textContent=qr,e.append(n)}async load(){const t=this.getAttribute("src"),e=++this.loadToken;if(this.loading=t??void 0,!t)return;const n=new URL(t,location.href).href;let r;try{r=v.read(await te.json(n))}catch{r=void 0}e===this.loadToken&&(this.base=n,this.json=r,this.draw())}async loadLocale(){const t=++this.localeToken,e=Vr.preferencesFor(this),n=Fr(e,jr),r=await zr.load(n);t===this.localeToken&&(this.said=new H(e),this.messages=r,this.draw())}speakerName(t,e){const n=v.speakerName(t,e),r=t.speakers?.[e]?.role;return n===r&&r in this.messages.roles?this.messages.roles[r]:n}seek(t,e){const n=this.json,r=e?v.said(e):void 0,o={sighting:t.sighting??v.sightingsOf(n)[0],at:t.at,...r?{quote:r}:{}};this.dispatchEvent(new CustomEvent(Cr,{bubbles:!0,composed:!0,detail:o}));const a=this.getAttribute("player");if(!a)return;const p=this.getRootNode().getElementById?.(a);typeof p?.seekTo=="function"&&(p.scrollIntoView?.({block:"center",behavior:"smooth"}),p.seekTo(o.at,o.sighting))}gap(t,e){const n=document.createElement(e),r=document.createElement("span");r.className="bar";const o=`${this.messages.redacted}${this.messages.colon}${this.said.read(t)??""}`;return r.dataset.tip=o,r.tabIndex=0,r.setAttribute("role","img"),r.setAttribute("aria-label",o),n.append(r),n}saidNodes(t){if(!/[<&]/.test(t))return[document.createTextNode(t)];const e=document.createElement("template");e.innerHTML=t;for(const n of e.content.querySelectorAll("*")){if(["SCRIPT","STYLE","IFRAME","OBJECT","EMBED"].includes(n.tagName)){n.remove();continue}for(const r of[...n.attributes])if(/^on/i.test(r.name)||/^\s*javascript:/i.test(r.value))n.removeAttribute(r.name);else if(["href","src"].includes(r.name))try{r.value=new URL(r.value,this.base??location.href).href}catch{}}return[...e.content.childNodes]}draw(){if(!this.messages)return;const t=this.messages,e=this.json;this.blocks.clear();const n=Array.isArray(e?.segments)?e.segments:[];if(!e||n.length===0){this.status.hidden=!0;const m=document.createElement("p");m.textContent=t.exchangesEmpty,this.turns.replaceChildren(m);return}const r=e.speakers??{},o=Object.keys(r);if(e.proofreading){const m=o.filter(b=>!["approved","covered"].includes(e.proofreading?.[b]?.status??""));this.status.textContent=m.length===0?t.proofreadAll:t.proofreadPending.replace("{names}",m.map(b=>this.speakerName(e,b)).join(", ")),this.status.hidden=!1}else this.status.hidden=!0;const a=[];let u,p=!1,c,f;n.forEach((m,b)=>{const g=m.redacted?JSON.stringify(m.redacted.reason):void 0;if(g!==void 0&&c?.reason===g){this.blocks.set(b,c.block),m.speaker!==f&&(f=void 0);return}const G=document.createElement("div");G.className="turn",G.dataset.segment=String(b);const w=document.createElement("div");w.className="who";const F=document.createElement("span");if(F.textContent=m.redacted?"":this.speakerName(e,m.speaker),m.start!==void 0&&(G.dataset.time=v.clock(m.start,!0)),f!==m.speaker&&(u=document.createElement("div"),u.className="intervention",u.style.setProperty("--speaker-hue",String((Math.max(0,o.indexOf(m.speaker))*67+210)%360)),a.push(u),p=!1),m.redacted||(p&&G.classList.add("goes-on"),p=!0),u.append(G),f=m.speaker,w.append(F),m.redacted){G.classList.add("is-redacted");const M=this.gap(m.redacted.reason,"p");M.className="redacted",c={block:G,reason:g},G.append(w,M)}else{const M=document.createElement("p");if(M.className="said",m.parts){let vt="";for(const C of m.parts){const Ae="redacted"in C?"▮":v.plain(C.text);/[\p{L}\p{N}.,;:!?)»”…▮]$/u.test(vt)&&/^[\p{L}\p{N}(«“▮]/u.test(Ae)&&M.append(" "),"redacted"in C?M.append(this.gap(C.redacted.reason,"span")):M.append(...this.saidNodes(C.text)),vt=Ae}}else M.append(...this.saidNodes(m.text??""));c=void 0,G.append(w,M)}if(m.refs?.length){const M=document.createElement("div");M.className="refs";for(const vt of m.refs){const C=document.createElement("button");C.type="button",C.className="ref",C.innerHTML=S.PLAY,C.append(v.clock(vt.at,!0)),C.addEventListener("click",()=>this.seek(vt,m)),M.append(C)}G.append(M)}this.blocks.set(b,G)}),this.turns.replaceChildren(...a)}revealAt(t,e){const n=this.json;if(!n)return;const r=v.sightingsOf(n)[0];let o;if(n.segments?.forEach((a,u)=>{for(const p of a.refs??[]){const c=p.sighting??r;e!==void 0&&c!==void 0&&c!==e||p.at>t+.001||(!o||p.at>o.at)&&(o={index:u,at:p.at})}}),!!o)return o.index!==this.lastRevealed&&(this.lastRevealed=o.index,this.revealSegment(o.index)),this.markSynced(o.index),o.index}momentsCited(t){const e=this.json;if(!e)return[];const n=v.sightingsOf(e)[0],r=[];for(const o of e.segments??[])for(const a of o.refs??[]){const u=a.sighting??n;t!==void 0&&u!==void 0&&u!==t||r.push({at:a.at,quote:v.said(o)??""})}return r.sort((o,a)=>o.at-a.at)}markSynced(t){t!==this.syncedIndex&&(this.syncedIndex!==void 0&&this.blocks.get(this.syncedIndex)?.classList.remove("synced"),this.syncedIndex=t,this.blocks.get(t)?.classList.add("synced"))}revealSegment(t){const e=this.blocks.get(t);e&&(e.scrollIntoView?.({block:"center"}),e.classList.add("flash"),window.setTimeout(()=>e.classList.remove("flash"),1600))}}function Br(){customElements.get(Tn)||customElements.define(Tn,ve)}Br();
@@ -1,4 +1,4 @@
1
- import{aT as T,_ as c,aU as E}from"./rr0-scene.mjs";import{P as I,S as L,a as p,b as M,I as x,E as w,c as f}from"./ParameterForm-B4kpfmg7.js";import{L as u}from"./LaserBeam-DmH2JeMa.js";import{T as _}from"./TimelineTracks-BMdiUSuh.js";const O=T.catalog({en:()=>c(()=>import("./BeamParameterTexts_en-DZB75ouZ.js"),[],import.meta.url).then(l=>l.beamParameterTexts_en),fr:()=>c(()=>import("./BeamParameterTexts_fr-BHG3fW40.js"),[],import.meta.url).then(l=>l.beamParameterTexts_fr),es:()=>c(()=>import("./BeamParameterTexts_es-AeZmsufG.js"),[],import.meta.url).then(l=>l.beamParameterTexts_es),it:()=>c(()=>import("./BeamParameterTexts_it-CPwmQX-g.js"),[],import.meta.url).then(l=>l.beamParameterTexts_it)});class h{static LIGHT_TITLE="light";static BEAM="beam";static WHEN="when";static nextPlace(e){const t=e[e.length-1]??{lat:0,lng:0,altitudeM:0},i=e[e.length-2];return i?{lat:2*t.lat-i.lat,lng:2*t.lng-i.lng,altitudeM:2*t.altitudeM-i.altitudeM}:{lat:t.lat,lng:t.lng+500/(111320*Math.max(.05,Math.cos(t.lat*Math.PI/180))),altitudeM:t.altitudeM}}static instant(e,t,i,s=!1){return{type:"number",key:e,min:-3600,max:36e3,step:.1,unit:"s",scale:.001,label:t,hint:i,...s?{required:s}:{}}}static SET={kind:"beam",title:"beam",parameters:[{type:"said",key:"title",label:"name",group:h.BEAM},{type:"number",key:"divergenceMrad",min:.001,max:1e3,step:.001,unit:"mrad",group:h.BEAM,effective:()=>u.DEFAULT_DIVERGENCE_MRAD,label:"divergence",hint:"howFastItWidensFullAngle"},{type:"number",key:"apertureM",min:.001,max:10,step:.001,unit:"m",group:h.BEAM,effective:()=>u.DEFAULT_APERTURE_M,label:"widthAtTheEmitter"},{type:"number",key:"patchiness",min:0,max:100,step:1,unit:"%",scale:100,group:h.BEAM,effective:()=>u.DEFAULT_PATCHINESS,label:"unevenHaze",hint:"howUnevenlyTheHazeItCrosses"}]};static WAVELENGTH_HINT="itsColour532ForTheGreen";static POWER_HINT="theOpticalPowerItCarriesIts";static WAVELENGTH_LABEL="wavelength";static POWER_LABEL="power";static LIGHT={kind:"beam-light",title:h.LIGHT_TITLE,parameters:[{type:"number",key:"wavelengthNm",min:380,max:780,step:1,unit:"nm",required:!0,label:h.WAVELENGTH_LABEL,hint:h.WAVELENGTH_HINT},{type:"number",key:"powerW",min:.001,max:1e5,step:.001,unit:"W",required:!0,label:h.POWER_LABEL,hint:h.POWER_HINT}]};static LIGHT_KEY={kind:"beam-light-key",title:h.LIGHT_TITLE,parameters:[h.instant("t","time","secondsOfTheRecording",!0),{type:"number",key:"wavelengthNm",min:380,max:780,step:1,unit:"nm",label:h.WAVELENGTH_LABEL,hint:h.WAVELENGTH_HINT,effective:(e,t)=>t?.wavelengthNm},{type:"number",key:"powerW",min:.001,max:1e5,step:.001,unit:"W",label:h.POWER_LABEL,hint:h.POWER_HINT,effective:(e,t)=>t?.powerW}]};static ON={kind:"beam-on",title:h.WHEN,parameters:[h.instant("fromT","onFrom","secondsOfTheRecordingEmptyFrom"),h.instant("untilT","offAt","secondsOfTheRecordingEmptyUntil")]};static MOVE_KEY={kind:"beam-move-key",title:"pathAtAnInstant",parameters:[h.instant("t","time","secondsOfTheRecording",!0)]};static hexOf(e){const t=u.colourOf(e),i=Math.max(...t,1e-9),s=n=>{const o=Math.min(1,Math.max(0,n/i)),a=o<=.0031308?12.92*o:1.055*o**(1/2.4)-.055;return Math.round(a*255).toString(16).padStart(2,"0")};return`#${t.map(s).join("")}`}static wavelengthOf(e){const t=h.hueOf(e);let i=532,s=1/0;for(let n=400;n<=700;n++){const o=Math.abs((h.hueOf(h.hexOf(n))-t+540)%360-180);o<s&&(s=o,i=n)}return i}static hueOf(e){const t=Number.parseInt(e.replace("#",""),16),[i,s,n]=[t>>16&255,t>>8&255,t&255].map(b=>b/255),o=Math.max(i,s,n),a=Math.min(i,s,n);if(o===a)return 0;const r=o-a;return((o===i?(s-n)/r%6:o===s?(n-i)/r+2:(i-s)/r+4)*60+360)%360}static PLACE={kind:"beam-place",title:"pointOfThePath",parameters:[{type:"position",key:"lat",secondKey:"lng",saidKey:"saidPosition",native:"geo",step:.1,label:"position"},{type:"number",key:"altitudeM",min:-500,max:1e5,step:.1,unit:"m",required:!0,label:"altitude",hint:"aboveTheSeaNotTheGround"}]};static publish(){I.publish(h.SET)}}const A=T.catalog({en:()=>c(()=>import("./BeamEditorMessages_en-DDvPWAdd.js"),[],import.meta.url).then(l=>l.beamEditorMessages_en),fr:()=>c(()=>import("./BeamEditorMessages_fr-CtX6uP-x.js"),[],import.meta.url).then(l=>l.beamEditorMessages_fr),es:()=>c(()=>import("./BeamEditorMessages_es-BhCkhUkN.js"),[],import.meta.url).then(l=>l.beamEditorMessages_es),it:()=>c(()=>import("./BeamEditorMessages_it-DVweRQFi.js"),[],import.meta.url).then(l=>l.beamEditorMessages_it)});class g{constructor(e,t,i){this.container=e,this.host=t,this.language=i,L.attach(e,"beam-editor",g.STYLE),I.of("beam")||h.publish(),this.ready=this.setLanguage(i)}messages;ready;parameterTexts;languageToken=0;currentId;form;list;timeline;row="on";onForm;lightForm;lightKeyForm;lightIndex;moveKeyForm;moveIndex;places;placeForm;placeIndex=0;language;shown=[];static STYLE='.beam-editor { flex-basis: 100%; min-width: 0; } .beam-editor #beam-timeline { flex-basis: 100%; min-width: 0; padding: 4px 0; } .beam-editor #beam-list, .beam-editor #beam-places { flex-basis: 100%; min-width: 0; } .beam-editor .launch-editor, .beam-editor .launch-fields { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; } .beam-editor .launch-fields { flex-basis: 100%; min-width: 0; } .beam-editor [hidden] { display: none !important; } .beam-editor select { min-width: 0; width: 100%; } .beam-editor .launch-intro { flex-basis: 100%; margin: 0; } .beam-editor .launch-track { flex-basis: 100%; margin: 0; } .beam-editor .launch-parameters { flex-basis: 100%; min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; } .beam-editor .parameter-group { flex: 1 1 14em; min-width: 0; box-sizing: border-box; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: flex-start; align-content: flex-start; } .beam-editor input, .beam-editor select { max-width: 100%; box-sizing: border-box; } .beam-editor input[type="text"] { width: 12em; } .beam-editor #launch-title { width: 18em; } .beam-editor label { min-width: 0; max-width: 100%; } .beam-editor input.parameter-derived::placeholder { opacity: .65; } .beam-editor .launch-path { flex: 1 1 100%; min-width: 0; box-sizing: border-box; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: flex-start; }';async setLanguage(e){const t=++this.languageToken;this.language=e;const[i,s]=await Promise.all([A.load(e),O.load(e)]);t===this.languageToken&&(this.messages=i,this.parameterTexts=s,this.render(),this.sync())}sync(){if(!this.messages)return;const e=this.beams;this.shown=[...e],e.some(s=>s.id===this.currentId)||(this.currentId=e[0]?.id),this.list?.setItems(e.map(s=>({id:s.id,label:this.labelOf(s)})),this.currentId),this.syncAddState();const t=this.current;if(this.element("beam-fields").hidden=t===void 0,!t)return;const i={said:()=>this.host.said(),writingLanguage:()=>this.host.writingLanguage()};this.form??=new p(this.element("beam-parameters"),this.language,"beam.",i),this.form.show(this.resolved(h.SET),this.targetOfBeam(),()=>this.written()),this.syncDetail(!0)}refresh(){if(!this.messages)return;this.syncAddState();const e=this.beams;if(e.length===this.shown.length&&e.every((t,i)=>t.id===this.shown[i].id)){this.syncTimeline();return}this.sync()}setTime(e){this.messages&&this.timeline?.setTime(e)}syncAddState(){const e=this.pathOfNew()!==void 0;this.list?.setAddState(e,e?void 0:this.messages.addBeamNowhere)}get current(){return this.beams.find(e=>e.id===this.currentId)}show(e){this.messages&&(this.currentId=e,this.row="on",this.lightIndex=void 0,this.moveIndex=void 0,this.placeIndex=0,this.sync())}resolved(e){return M.resolve(e,this.parameterTexts)}render(){if(!this.messages)return;const e=this.messages;this.form=void 0,this.container.innerHTML=`<div class="launch-editor">
1
+ import{aT as T,_ as c,aU as E}from"./rr0-scene.mjs";import{P as I,S as L,a as p,b as M,I as x,E as w,c as f}from"./ParameterForm-BMIW4Gkh.js";import{L as u}from"./LaserBeam-DmH2JeMa.js";import{T as _}from"./TimelineTracks-B-bXAaF7.js";const O=T.catalog({en:()=>c(()=>import("./BeamParameterTexts_en-DZB75ouZ.js"),[],import.meta.url).then(l=>l.beamParameterTexts_en),fr:()=>c(()=>import("./BeamParameterTexts_fr-BHG3fW40.js"),[],import.meta.url).then(l=>l.beamParameterTexts_fr),es:()=>c(()=>import("./BeamParameterTexts_es-AeZmsufG.js"),[],import.meta.url).then(l=>l.beamParameterTexts_es),it:()=>c(()=>import("./BeamParameterTexts_it-CPwmQX-g.js"),[],import.meta.url).then(l=>l.beamParameterTexts_it)});class h{static LIGHT_TITLE="light";static BEAM="beam";static WHEN="when";static nextPlace(e){const t=e[e.length-1]??{lat:0,lng:0,altitudeM:0},i=e[e.length-2];return i?{lat:2*t.lat-i.lat,lng:2*t.lng-i.lng,altitudeM:2*t.altitudeM-i.altitudeM}:{lat:t.lat,lng:t.lng+500/(111320*Math.max(.05,Math.cos(t.lat*Math.PI/180))),altitudeM:t.altitudeM}}static instant(e,t,i,s=!1){return{type:"number",key:e,min:-3600,max:36e3,step:.1,unit:"s",scale:.001,label:t,hint:i,...s?{required:s}:{}}}static SET={kind:"beam",title:"beam",parameters:[{type:"said",key:"title",label:"name",group:h.BEAM},{type:"number",key:"divergenceMrad",min:.001,max:1e3,step:.001,unit:"mrad",group:h.BEAM,effective:()=>u.DEFAULT_DIVERGENCE_MRAD,label:"divergence",hint:"howFastItWidensFullAngle"},{type:"number",key:"apertureM",min:.001,max:10,step:.001,unit:"m",group:h.BEAM,effective:()=>u.DEFAULT_APERTURE_M,label:"widthAtTheEmitter"},{type:"number",key:"patchiness",min:0,max:100,step:1,unit:"%",scale:100,group:h.BEAM,effective:()=>u.DEFAULT_PATCHINESS,label:"unevenHaze",hint:"howUnevenlyTheHazeItCrosses"}]};static WAVELENGTH_HINT="itsColour532ForTheGreen";static POWER_HINT="theOpticalPowerItCarriesIts";static WAVELENGTH_LABEL="wavelength";static POWER_LABEL="power";static LIGHT={kind:"beam-light",title:h.LIGHT_TITLE,parameters:[{type:"number",key:"wavelengthNm",min:380,max:780,step:1,unit:"nm",required:!0,label:h.WAVELENGTH_LABEL,hint:h.WAVELENGTH_HINT},{type:"number",key:"powerW",min:.001,max:1e5,step:.001,unit:"W",required:!0,label:h.POWER_LABEL,hint:h.POWER_HINT}]};static LIGHT_KEY={kind:"beam-light-key",title:h.LIGHT_TITLE,parameters:[h.instant("t","time","secondsOfTheRecording",!0),{type:"number",key:"wavelengthNm",min:380,max:780,step:1,unit:"nm",label:h.WAVELENGTH_LABEL,hint:h.WAVELENGTH_HINT,effective:(e,t)=>t?.wavelengthNm},{type:"number",key:"powerW",min:.001,max:1e5,step:.001,unit:"W",label:h.POWER_LABEL,hint:h.POWER_HINT,effective:(e,t)=>t?.powerW}]};static ON={kind:"beam-on",title:h.WHEN,parameters:[h.instant("fromT","onFrom","secondsOfTheRecordingEmptyFrom"),h.instant("untilT","offAt","secondsOfTheRecordingEmptyUntil")]};static MOVE_KEY={kind:"beam-move-key",title:"pathAtAnInstant",parameters:[h.instant("t","time","secondsOfTheRecording",!0)]};static hexOf(e){const t=u.colourOf(e),i=Math.max(...t,1e-9),s=n=>{const o=Math.min(1,Math.max(0,n/i)),a=o<=.0031308?12.92*o:1.055*o**(1/2.4)-.055;return Math.round(a*255).toString(16).padStart(2,"0")};return`#${t.map(s).join("")}`}static wavelengthOf(e){const t=h.hueOf(e);let i=532,s=1/0;for(let n=400;n<=700;n++){const o=Math.abs((h.hueOf(h.hexOf(n))-t+540)%360-180);o<s&&(s=o,i=n)}return i}static hueOf(e){const t=Number.parseInt(e.replace("#",""),16),[i,s,n]=[t>>16&255,t>>8&255,t&255].map(b=>b/255),o=Math.max(i,s,n),a=Math.min(i,s,n);if(o===a)return 0;const r=o-a;return((o===i?(s-n)/r%6:o===s?(n-i)/r+2:(i-s)/r+4)*60+360)%360}static PLACE={kind:"beam-place",title:"pointOfThePath",parameters:[{type:"position",key:"lat",secondKey:"lng",saidKey:"saidPosition",native:"geo",step:.1,label:"position"},{type:"number",key:"altitudeM",min:-500,max:1e5,step:.1,unit:"m",required:!0,label:"altitude",hint:"aboveTheSeaNotTheGround"}]};static publish(){I.publish(h.SET)}}const A=T.catalog({en:()=>c(()=>import("./BeamEditorMessages_en-DDvPWAdd.js"),[],import.meta.url).then(l=>l.beamEditorMessages_en),fr:()=>c(()=>import("./BeamEditorMessages_fr-CtX6uP-x.js"),[],import.meta.url).then(l=>l.beamEditorMessages_fr),es:()=>c(()=>import("./BeamEditorMessages_es-BhCkhUkN.js"),[],import.meta.url).then(l=>l.beamEditorMessages_es),it:()=>c(()=>import("./BeamEditorMessages_it-DVweRQFi.js"),[],import.meta.url).then(l=>l.beamEditorMessages_it)});class g{constructor(e,t,i){this.container=e,this.host=t,this.language=i,L.attach(e,"beam-editor",g.STYLE),I.of("beam")||h.publish(),this.ready=this.setLanguage(i)}messages;ready;parameterTexts;languageToken=0;currentId;form;list;timeline;row="on";onForm;lightForm;lightKeyForm;lightIndex;moveKeyForm;moveIndex;places;placeForm;placeIndex=0;language;shown=[];static STYLE='.beam-editor { flex-basis: 100%; min-width: 0; } .beam-editor #beam-timeline { flex-basis: 100%; min-width: 0; padding: 4px 0; } .beam-editor #beam-list, .beam-editor #beam-places { flex-basis: 100%; min-width: 0; } .beam-editor .launch-editor, .beam-editor .launch-fields { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; } .beam-editor .launch-fields { flex-basis: 100%; min-width: 0; } .beam-editor [hidden] { display: none !important; } .beam-editor select { min-width: 0; width: 100%; } .beam-editor .launch-intro { flex-basis: 100%; margin: 0; } .beam-editor .launch-track { flex-basis: 100%; margin: 0; } .beam-editor .launch-parameters { flex-basis: 100%; min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; } .beam-editor .parameter-group { flex: 1 1 14em; min-width: 0; box-sizing: border-box; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: flex-start; align-content: flex-start; } .beam-editor input, .beam-editor select { max-width: 100%; box-sizing: border-box; } .beam-editor input[type="text"] { width: 12em; } .beam-editor #launch-title { width: 18em; } .beam-editor label { min-width: 0; max-width: 100%; } .beam-editor input.parameter-derived::placeholder { opacity: .65; } .beam-editor .launch-path { flex: 1 1 100%; min-width: 0; box-sizing: border-box; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: flex-start; }';async setLanguage(e){const t=++this.languageToken;this.language=e;const[i,s]=await Promise.all([A.load(e),O.load(e)]);t===this.languageToken&&(this.messages=i,this.parameterTexts=s,this.render(),this.sync())}sync(){if(!this.messages)return;const e=this.beams;this.shown=[...e],e.some(s=>s.id===this.currentId)||(this.currentId=e[0]?.id),this.list?.setItems(e.map(s=>({id:s.id,label:this.labelOf(s)})),this.currentId),this.syncAddState();const t=this.current;if(this.element("beam-fields").hidden=t===void 0,!t)return;const i={said:()=>this.host.said(),writingLanguage:()=>this.host.writingLanguage()};this.form??=new p(this.element("beam-parameters"),this.language,"beam.",i),this.form.show(this.resolved(h.SET),this.targetOfBeam(),()=>this.written()),this.syncDetail(!0)}refresh(){if(!this.messages)return;this.syncAddState();const e=this.beams;if(e.length===this.shown.length&&e.every((t,i)=>t.id===this.shown[i].id)){this.syncTimeline();return}this.sync()}setTime(e){this.messages&&this.timeline?.setTime(e)}syncAddState(){const e=this.pathOfNew()!==void 0;this.list?.setAddState(e,e?void 0:this.messages.addBeamNowhere)}get current(){return this.beams.find(e=>e.id===this.currentId)}show(e){this.messages&&(this.currentId=e,this.row="on",this.lightIndex=void 0,this.moveIndex=void 0,this.placeIndex=0,this.sync())}resolved(e){return M.resolve(e,this.parameterTexts)}render(){if(!this.messages)return;const e=this.messages;this.form=void 0,this.container.innerHTML=`<div class="launch-editor">
2
2
  <p class="launch-intro">${e.intro}</p>
3
3
  <div id="beam-list"></div>
4
4
  <div id="beam-fields" class="launch-fields">
@@ -1,4 +1,4 @@
1
- import{aT as d,_ as l,b6 as o,b7 as m,b8 as g,b9 as f}from"./rr0-scene.mjs";import{P as u,S as b,a as y,c as T,b as A,E}from"./ParameterForm-B4kpfmg7.js";const w=d.catalog({en:()=>l(()=>import("./LanternParameterTexts_en-CcnGd8UH.js"),[],import.meta.url).then(a=>a.lanternParameterTexts_en),fr:()=>l(()=>import("./LanternParameterTexts_fr-P2JwYOUy.js"),[],import.meta.url).then(a=>a.lanternParameterTexts_fr),es:()=>l(()=>import("./LanternParameterTexts_es-CUTgNutZ.js"),[],import.meta.url).then(a=>a.lanternParameterTexts_es),it:()=>l(()=>import("./LanternParameterTexts_it-CzNnIUrX.js"),[],import.meta.url).then(a=>a.lanternParameterTexts_it)});class i{static RELEASE="letGo";static LANTERNS="lanterns";static AIR="air";static LANTERN="eachLantern";static instant(e,t,n){return{type:"number",key:e,min:-36e3,max:36e3,step:1,unit:"s",scale:.001,required:!0,label:t,hint:n,group:i.LANTERNS}}static wind(e,t,n,s){return[{type:"number",key:`${e}.towardDeg`,min:0,max:360,step:1,unit:"°",group:i.AIR,hint:s,label:t},{type:"number",key:`${e}.speedMS`,min:0,max:60,step:.1,unit:"m/s",group:i.AIR,label:n}]}static SET={kind:"lantern",title:"skyLanterns",parameters:[{type:"said",key:"title",label:"name",group:i.RELEASE},{type:"position",key:"site.eastM",secondKey:"site.northM",saidKey:"site.saidPosition",native:"local",step:1,rangeM:1e5,group:i.RELEASE,label:"whereTheyAreLetGo",hint:"whereTheyAreLetGoFrom"},{type:"number",key:"site.altitudeM",min:-1e3,max:5e3,step:.1,unit:"m",group:i.RELEASE,effective:()=>0,label:"heightAboveThePlaceSGround",hint:"aGardenOnAHillAbove"},{type:"number",key:"site.originElevationM",min:-500,max:6e3,step:1,unit:"m",group:i.RELEASE,effective:()=>0,label:"thePlaceSGroundAboveThe",hint:"whatSetsHowThinTheAir"},{type:"number",key:"group.count",min:1,max:200,step:1,required:!0,group:i.LANTERNS,label:"howMany"},i.instant("group.fromT","firstLetGoAt","secondsOfTheRecordingBeforeIts"),i.instant("group.untilT","lastLetGoAt","secondsOfTheRecordingTheOthers"),{type:"number",key:"group.radiusM",min:0,max:5e3,step:1,unit:"m",group:i.LANTERNS,effective:()=>20,label:"letGoWithin",hint:"aCrowdLetsThemGoA"},{type:"number",key:"group.burnS.min",min:10,max:3600,step:1,unit:"s",group:i.LANTERNS,effective:()=>480,label:"burnsAtLeast",hint:"howLongEachBurnsFromWhen"},{type:"number",key:"group.burnS.max",min:10,max:3600,step:1,unit:"s",group:i.LANTERNS,effective:()=>900,label:"burnsAtMost"},{type:"number",key:"group.insideExcessK.min",min:10,max:400,step:1,unit:"K",group:i.LANTERNS,effective:()=>125,label:"hotterThanTheAirAtLeast",hint:"howMuchHotterThanTheAir"},{type:"number",key:"group.insideExcessK.max",min:10,max:400,step:1,unit:"K",group:i.LANTERNS,effective:()=>175,label:"hotterThanTheAirAtMost"},{type:"number",key:"group.burnedS",min:0,max:3600,step:1,unit:"s",group:i.LANTERNS,effective:()=>0,label:"alreadyBurntWhenLetGo",hint:"forLanternsTheAccountOnlyHas"},{type:"number",key:"group.seed",min:0,max:4294967295,step:1,group:i.LANTERNS,effective:()=>1,label:"draw",hint:"whatTheDrawsStartFromAnother"},{type:"set",key:"group.explains",group:i.LANTERNS,label:"standForTheShapes",options:(e,t)=>{const n=t?.shapes??[],s=(e.group?.explains??[]).filter(r=>!n.some(h=>h.value===r));return[...n,...s.map(r=>({value:r,label:r}))]},empty:"noShape"},...i.wind("wind","windAtTheGroundTowards","windAtTheGroundSpeed","whereItBlowsTowardsWhichIs"),...i.wind("windAloft","windAloftTowards","windAloftSpeed","theWindHigherUpBlendedWith"),{type:"number",key:"windAloft.atM",min:10,max:1e4,step:10,unit:"m",group:i.AIR,label:"windAloftAt",hint:"metresAboveWhereTheyAreLet"},{type:"number",key:"airTemperatureC",min:-60,max:50,step:.5,unit:"°C",group:i.AIR,effective:()=>10,label:"airTemperature",hint:"atTheGroundFallingBy6"},{type:"number",key:"turbulence.horizontalMS",min:0,max:10,step:.1,unit:"m/s",group:i.AIR,effective:()=>o.TURBULENCE.horizontalMS,label:"gustsAcross",hint:"howFarTheAirSSpeed"},{type:"number",key:"turbulence.verticalMS",min:0,max:10,step:.1,unit:"m/s",group:i.AIR,effective:()=>o.TURBULENCE.verticalMS,label:"gustsUpAndDown"},{type:"number",key:"turbulence.timescaleS",min:1,max:600,step:1,unit:"s",group:i.AIR,effective:()=>o.TURBULENCE.timescaleS,label:"aGustLasts"},{type:"number",key:"lantern.luminousIntensityCd",min:.1,max:1e3,step:.1,unit:"cd",group:i.LANTERN,effective:()=>o.COMMON.luminousIntensityCd,label:"light",hint:"itsFlameSLightThroughThe"},{type:"choice",key:"lantern.shape",group:i.LANTERN,effective:()=>o.COMMON.shape,label:"shape",choices:[{value:"classic",label:"roundAtTheMouthSquareAt"},{value:"balloon",label:"balloonLobedTop"}]},{type:"colour",key:"lantern.paperColor",group:i.LANTERN,fallback:o.COMMON.paperColor,label:"paperColour",hint:"whatItLooksLikeByDay"},{type:"colour",key:"lantern.color",group:i.LANTERN,fallback:o.COMMON.color,label:"flameLight",hint:"itsFlameSLightThroughWhite"},{type:"number",key:"lantern.envelopeVolumeM3",min:.01,max:10,step:.01,unit:"m³",group:i.LANTERN,effective:()=>o.COMMON.envelopeVolumeM3,label:"airItHolds"},{type:"number",key:"lantern.massKg",min:.005,max:5,step:.001,unit:"kg",group:i.LANTERN,effective:()=>o.COMMON.massKg,label:"weightWhenLetGo"}]};static publish(){u.publish(i.SET)}}const v=d.catalog({en:()=>l(()=>import("./LanternEditorMessages_en-DaT3UNfD.js"),[],import.meta.url).then(a=>a.lanternEditorMessages_en),fr:()=>l(()=>import("./LanternEditorMessages_fr-9mByTFMG.js"),[],import.meta.url).then(a=>a.lanternEditorMessages_fr),es:()=>l(()=>import("./LanternEditorMessages_es-TDV5lKeJ.js"),[],import.meta.url).then(a=>a.lanternEditorMessages_es),it:()=>l(()=>import("./LanternEditorMessages_it-MRkJnDQp.js"),[],import.meta.url).then(a=>a.lanternEditorMessages_it)});class p{constructor(e,t,n){this.container=e,this.host=t,b.attach(e,"lantern-editor-part",p.STYLE),this.language=n,u.of("lantern")||i.publish(),this.ready=this.setLanguage(n)}messages;ready;parameterTexts;languageToken=0;currentId;form;list;language;shown=[];static STYLE='.lantern-editor-part { flex-basis: 100%; min-width: 0; } .lantern-editor-part #lantern-list { flex-basis: 100%; min-width: 0; } .lantern-editor-part .launch-editor, .lantern-editor-part .launch-fields { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; } .lantern-editor-part .launch-fields { flex-basis: 100%; min-width: 0; } .lantern-editor-part [hidden] { display: none !important; } .lantern-editor-part select { min-width: 0; width: 100%; } .lantern-editor-part .launch-intro { flex-basis: 100%; margin: 0; } .lantern-editor-part .launch-parameters { flex-basis: 100%; min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; } .lantern-editor-part .parameter-group { flex: 1 1 14em; min-width: 0; box-sizing: border-box; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: flex-start; align-content: flex-start; } .lantern-editor-part input, .lantern-editor-part select { max-width: 100%; box-sizing: border-box; } .lantern-editor-part input[type="text"] { width: 12em; } .lantern-editor-part label { min-width: 0; max-width: 100%; } .lantern-editor-part input.parameter-derived::placeholder { opacity: .65; }';async setLanguage(e){const t=++this.languageToken;this.language=e;const[n,s]=await Promise.all([v.load(e),w.load(e)]);t===this.languageToken&&(this.messages=n,this.parameterTexts=s,this.render(),this.sync())}sync(){if(!this.messages)return;const e=this.launches;this.shown=[...e],e.some(r=>r.id===this.currentId)||(this.currentId=e[0]?.id),this.list?.setItems(e.map(r=>({id:r.id,label:this.labelOf(r)})),this.currentId),this.syncAddState();const t=this.current;if(this.element("lantern-fields").hidden=t===void 0,!t)return;const n=t.releases?.length??0,s=this.element("lantern-releases");s.hidden=n===0,s.textContent=this.messages.releasesNote.replace("{n}",String(n)),this.form??=new y(this.element("lantern-parameters"),this.language,"lantern.",{said:()=>this.host.said(),writingLanguage:()=>this.host.writingLanguage()}),this.form.show(this.resolved(i.SET),new T(()=>this.current,r=>this.editLaunch(h=>r(h)),()=>({shapes:this.host.shapes().map(r=>({value:r.id,label:r.label}))}),this.host.positionPlace?.()),()=>this.written())}refresh(){if(!this.messages)return;this.syncAddState();const e=this.launches;e.length===this.shown.length&&e.every((t,n)=>t.id===this.shown[n].id)||this.sync()}syncAddState(){const e=this.siteOfNew()!==void 0;this.list?.setAddState(e,e?void 0:this.messages.addLaunchNowhere)}get current(){return this.launches.find(e=>e.id===this.currentId)}resolved(e){return A.resolve(e,this.parameterTexts)}render(){if(!this.messages)return;const e=this.messages;this.form=void 0,this.container.innerHTML=`<div class="launch-editor">
1
+ import{aT as d,_ as l,b6 as o,b7 as m,b8 as g,b9 as f}from"./rr0-scene.mjs";import{P as u,S as b,a as y,c as T,b as A,E}from"./ParameterForm-BMIW4Gkh.js";const w=d.catalog({en:()=>l(()=>import("./LanternParameterTexts_en-CcnGd8UH.js"),[],import.meta.url).then(a=>a.lanternParameterTexts_en),fr:()=>l(()=>import("./LanternParameterTexts_fr-P2JwYOUy.js"),[],import.meta.url).then(a=>a.lanternParameterTexts_fr),es:()=>l(()=>import("./LanternParameterTexts_es-CUTgNutZ.js"),[],import.meta.url).then(a=>a.lanternParameterTexts_es),it:()=>l(()=>import("./LanternParameterTexts_it-CzNnIUrX.js"),[],import.meta.url).then(a=>a.lanternParameterTexts_it)});class i{static RELEASE="letGo";static LANTERNS="lanterns";static AIR="air";static LANTERN="eachLantern";static instant(e,t,n){return{type:"number",key:e,min:-36e3,max:36e3,step:1,unit:"s",scale:.001,required:!0,label:t,hint:n,group:i.LANTERNS}}static wind(e,t,n,s){return[{type:"number",key:`${e}.towardDeg`,min:0,max:360,step:1,unit:"°",group:i.AIR,hint:s,label:t},{type:"number",key:`${e}.speedMS`,min:0,max:60,step:.1,unit:"m/s",group:i.AIR,label:n}]}static SET={kind:"lantern",title:"skyLanterns",parameters:[{type:"said",key:"title",label:"name",group:i.RELEASE},{type:"position",key:"site.eastM",secondKey:"site.northM",saidKey:"site.saidPosition",native:"local",step:1,rangeM:1e5,group:i.RELEASE,label:"whereTheyAreLetGo",hint:"whereTheyAreLetGoFrom"},{type:"number",key:"site.altitudeM",min:-1e3,max:5e3,step:.1,unit:"m",group:i.RELEASE,effective:()=>0,label:"heightAboveThePlaceSGround",hint:"aGardenOnAHillAbove"},{type:"number",key:"site.originElevationM",min:-500,max:6e3,step:1,unit:"m",group:i.RELEASE,effective:()=>0,label:"thePlaceSGroundAboveThe",hint:"whatSetsHowThinTheAir"},{type:"number",key:"group.count",min:1,max:200,step:1,required:!0,group:i.LANTERNS,label:"howMany"},i.instant("group.fromT","firstLetGoAt","secondsOfTheRecordingBeforeIts"),i.instant("group.untilT","lastLetGoAt","secondsOfTheRecordingTheOthers"),{type:"number",key:"group.radiusM",min:0,max:5e3,step:1,unit:"m",group:i.LANTERNS,effective:()=>20,label:"letGoWithin",hint:"aCrowdLetsThemGoA"},{type:"number",key:"group.burnS.min",min:10,max:3600,step:1,unit:"s",group:i.LANTERNS,effective:()=>480,label:"burnsAtLeast",hint:"howLongEachBurnsFromWhen"},{type:"number",key:"group.burnS.max",min:10,max:3600,step:1,unit:"s",group:i.LANTERNS,effective:()=>900,label:"burnsAtMost"},{type:"number",key:"group.insideExcessK.min",min:10,max:400,step:1,unit:"K",group:i.LANTERNS,effective:()=>125,label:"hotterThanTheAirAtLeast",hint:"howMuchHotterThanTheAir"},{type:"number",key:"group.insideExcessK.max",min:10,max:400,step:1,unit:"K",group:i.LANTERNS,effective:()=>175,label:"hotterThanTheAirAtMost"},{type:"number",key:"group.burnedS",min:0,max:3600,step:1,unit:"s",group:i.LANTERNS,effective:()=>0,label:"alreadyBurntWhenLetGo",hint:"forLanternsTheAccountOnlyHas"},{type:"number",key:"group.seed",min:0,max:4294967295,step:1,group:i.LANTERNS,effective:()=>1,label:"draw",hint:"whatTheDrawsStartFromAnother"},{type:"set",key:"group.explains",group:i.LANTERNS,label:"standForTheShapes",options:(e,t)=>{const n=t?.shapes??[],s=(e.group?.explains??[]).filter(r=>!n.some(h=>h.value===r));return[...n,...s.map(r=>({value:r,label:r}))]},empty:"noShape"},...i.wind("wind","windAtTheGroundTowards","windAtTheGroundSpeed","whereItBlowsTowardsWhichIs"),...i.wind("windAloft","windAloftTowards","windAloftSpeed","theWindHigherUpBlendedWith"),{type:"number",key:"windAloft.atM",min:10,max:1e4,step:10,unit:"m",group:i.AIR,label:"windAloftAt",hint:"metresAboveWhereTheyAreLet"},{type:"number",key:"airTemperatureC",min:-60,max:50,step:.5,unit:"°C",group:i.AIR,effective:()=>10,label:"airTemperature",hint:"atTheGroundFallingBy6"},{type:"number",key:"turbulence.horizontalMS",min:0,max:10,step:.1,unit:"m/s",group:i.AIR,effective:()=>o.TURBULENCE.horizontalMS,label:"gustsAcross",hint:"howFarTheAirSSpeed"},{type:"number",key:"turbulence.verticalMS",min:0,max:10,step:.1,unit:"m/s",group:i.AIR,effective:()=>o.TURBULENCE.verticalMS,label:"gustsUpAndDown"},{type:"number",key:"turbulence.timescaleS",min:1,max:600,step:1,unit:"s",group:i.AIR,effective:()=>o.TURBULENCE.timescaleS,label:"aGustLasts"},{type:"number",key:"lantern.luminousIntensityCd",min:.1,max:1e3,step:.1,unit:"cd",group:i.LANTERN,effective:()=>o.COMMON.luminousIntensityCd,label:"light",hint:"itsFlameSLightThroughThe"},{type:"choice",key:"lantern.shape",group:i.LANTERN,effective:()=>o.COMMON.shape,label:"shape",choices:[{value:"classic",label:"roundAtTheMouthSquareAt"},{value:"balloon",label:"balloonLobedTop"}]},{type:"colour",key:"lantern.paperColor",group:i.LANTERN,fallback:o.COMMON.paperColor,label:"paperColour",hint:"whatItLooksLikeByDay"},{type:"colour",key:"lantern.color",group:i.LANTERN,fallback:o.COMMON.color,label:"flameLight",hint:"itsFlameSLightThroughWhite"},{type:"number",key:"lantern.envelopeVolumeM3",min:.01,max:10,step:.01,unit:"m³",group:i.LANTERN,effective:()=>o.COMMON.envelopeVolumeM3,label:"airItHolds"},{type:"number",key:"lantern.massKg",min:.005,max:5,step:.001,unit:"kg",group:i.LANTERN,effective:()=>o.COMMON.massKg,label:"weightWhenLetGo"}]};static publish(){u.publish(i.SET)}}const v=d.catalog({en:()=>l(()=>import("./LanternEditorMessages_en-DaT3UNfD.js"),[],import.meta.url).then(a=>a.lanternEditorMessages_en),fr:()=>l(()=>import("./LanternEditorMessages_fr-9mByTFMG.js"),[],import.meta.url).then(a=>a.lanternEditorMessages_fr),es:()=>l(()=>import("./LanternEditorMessages_es-TDV5lKeJ.js"),[],import.meta.url).then(a=>a.lanternEditorMessages_es),it:()=>l(()=>import("./LanternEditorMessages_it-MRkJnDQp.js"),[],import.meta.url).then(a=>a.lanternEditorMessages_it)});class p{constructor(e,t,n){this.container=e,this.host=t,b.attach(e,"lantern-editor-part",p.STYLE),this.language=n,u.of("lantern")||i.publish(),this.ready=this.setLanguage(n)}messages;ready;parameterTexts;languageToken=0;currentId;form;list;language;shown=[];static STYLE='.lantern-editor-part { flex-basis: 100%; min-width: 0; } .lantern-editor-part #lantern-list { flex-basis: 100%; min-width: 0; } .lantern-editor-part .launch-editor, .lantern-editor-part .launch-fields { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; } .lantern-editor-part .launch-fields { flex-basis: 100%; min-width: 0; } .lantern-editor-part [hidden] { display: none !important; } .lantern-editor-part select { min-width: 0; width: 100%; } .lantern-editor-part .launch-intro { flex-basis: 100%; margin: 0; } .lantern-editor-part .launch-parameters { flex-basis: 100%; min-width: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; } .lantern-editor-part .parameter-group { flex: 1 1 14em; min-width: 0; box-sizing: border-box; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: flex-start; align-content: flex-start; } .lantern-editor-part input, .lantern-editor-part select { max-width: 100%; box-sizing: border-box; } .lantern-editor-part input[type="text"] { width: 12em; } .lantern-editor-part label { min-width: 0; max-width: 100%; } .lantern-editor-part input.parameter-derived::placeholder { opacity: .65; }';async setLanguage(e){const t=++this.languageToken;this.language=e;const[n,s]=await Promise.all([v.load(e),w.load(e)]);t===this.languageToken&&(this.messages=n,this.parameterTexts=s,this.render(),this.sync())}sync(){if(!this.messages)return;const e=this.launches;this.shown=[...e],e.some(r=>r.id===this.currentId)||(this.currentId=e[0]?.id),this.list?.setItems(e.map(r=>({id:r.id,label:this.labelOf(r)})),this.currentId),this.syncAddState();const t=this.current;if(this.element("lantern-fields").hidden=t===void 0,!t)return;const n=t.releases?.length??0,s=this.element("lantern-releases");s.hidden=n===0,s.textContent=this.messages.releasesNote.replace("{n}",String(n)),this.form??=new y(this.element("lantern-parameters"),this.language,"lantern.",{said:()=>this.host.said(),writingLanguage:()=>this.host.writingLanguage()}),this.form.show(this.resolved(i.SET),new T(()=>this.current,r=>this.editLaunch(h=>r(h)),()=>({shapes:this.host.shapes().map(r=>({value:r.id,label:r.label}))}),this.host.positionPlace?.()),()=>this.written())}refresh(){if(!this.messages)return;this.syncAddState();const e=this.launches;e.length===this.shown.length&&e.every((t,n)=>t.id===this.shown[n].id)||this.sync()}syncAddState(){const e=this.siteOfNew()!==void 0;this.list?.setAddState(e,e?void 0:this.messages.addLaunchNowhere)}get current(){return this.launches.find(e=>e.id===this.currentId)}resolved(e){return A.resolve(e,this.parameterTexts)}render(){if(!this.messages)return;const e=this.messages;this.form=void 0,this.container.innerHTML=`<div class="launch-editor">
2
2
  <p class="launch-intro">${e.intro}</p>
3
3
  <div id="lantern-list"></div>
4
4
  <div id="lantern-fields" class="launch-fields">