chunk-25BNEBXZ.js 147 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943
  1. import {
  2. p as p2,
  3. s
  4. } from "./chunk-3ZFH4KQV.js";
  5. import {
  6. y
  7. } from "./chunk-BJHM4JNS.js";
  8. import {
  9. f,
  10. m,
  11. m2,
  12. v2 as v
  13. } from "./chunk-OWVBLVP3.js";
  14. import {
  15. l
  16. } from "./chunk-XH7RUGVZ.js";
  17. import {
  18. M2 as M,
  19. j2 as j,
  20. p
  21. } from "./chunk-ECW2QABR.js";
  22. import {
  23. t
  24. } from "./chunk-GZT4BVFP.js";
  25. // node_modules/@arcgis/core/arcade/ImmutableArray.js
  26. var t2 = class {
  27. constructor(t5 = []) {
  28. this._elements = t5;
  29. }
  30. length() {
  31. return this._elements.length;
  32. }
  33. get(t5) {
  34. return this._elements[t5];
  35. }
  36. toArray() {
  37. const t5 = [];
  38. for (let e = 0; e < this.length(); e++)
  39. t5.push(this.get(e));
  40. return t5;
  41. }
  42. };
  43. // node_modules/@arcgis/core/arcade/FunctionWrapper.js
  44. var t3 = class {
  45. constructor(t5, i3) {
  46. this.definition = null, this.context = null, this.definition = t5, this.context = i3;
  47. }
  48. };
  49. // node_modules/@arcgis/core/arcade/ImmutablePointArray.js
  50. var i = class extends t2 {
  51. constructor(t5, s3, i3, e, h2, a) {
  52. super(t5), this._lazyPt = [], this._hasZ = false, this._hasM = false, this._spRef = s3, this._hasZ = i3, this._hasM = e, this._cacheId = h2, this._partId = a;
  53. }
  54. get(t5) {
  55. if (this._lazyPt[t5] === void 0) {
  56. const i3 = this._elements[t5];
  57. if (i3 === void 0)
  58. return;
  59. const e = this._hasZ, h2 = this._hasM;
  60. let a = null;
  61. a = e && !h2 ? new j(i3[0], i3[1], i3[2], void 0, this._spRef) : h2 && !e ? new j(i3[0], i3[1], void 0, i3[2], this._spRef) : e && h2 ? new j(i3[0], i3[1], i3[2], i3[3], this._spRef) : new j(i3[0], i3[1], this._spRef), a.cache._arcadeCacheId = this._cacheId.toString() + "-" + this._partId.toString() + "-" + t5.toString(), this._lazyPt[t5] = a;
  62. }
  63. return this._lazyPt[t5];
  64. }
  65. equalityTest(t5) {
  66. return t5 === this || t5 !== null && (t5 instanceof i != false && t5.getUniqueHash() === this.getUniqueHash());
  67. }
  68. getUniqueHash() {
  69. return this._cacheId.toString() + "-" + this._partId.toString();
  70. }
  71. };
  72. // node_modules/@arcgis/core/arcade/ImmutablePathArray.js
  73. var h = class extends t2 {
  74. constructor(t5, s3, h2, i3, e) {
  75. super(t5), this._lazyPath = [], this._hasZ = false, this._hasM = false, this._hasZ = h2, this._hasM = i3, this._spRef = s3, this._cacheId = e;
  76. }
  77. get(t5) {
  78. if (this._lazyPath[t5] === void 0) {
  79. const h2 = this._elements[t5];
  80. if (h2 === void 0)
  81. return;
  82. this._lazyPath[t5] = new i(h2, this._spRef, this._hasZ, this._hasM, this._cacheId, t5);
  83. }
  84. return this._lazyPath[t5];
  85. }
  86. equalityTest(t5) {
  87. return t5 === this || t5 !== null && (t5 instanceof h != false && t5.getUniqueHash() === this.getUniqueHash());
  88. }
  89. getUniqueHash() {
  90. return this._cacheId.toString();
  91. }
  92. };
  93. // node_modules/@arcgis/core/arcade/featureset/support/shared.js
  94. var t4;
  95. var i2;
  96. function n(e) {
  97. return y.fromJSON(e.toJSON());
  98. }
  99. function o(e) {
  100. return e.toJSON ? e.toJSON() : e;
  101. }
  102. function l2(e) {
  103. return typeof e == "string" || e instanceof String;
  104. }
  105. function y2(e) {
  106. return typeof e == "number";
  107. }
  108. function p3(e) {
  109. return e instanceof Date;
  110. }
  111. function c(e, r) {
  112. return e === r || !(!p3(e) || !p3(r)) && e.getTime() === r.getTime();
  113. }
  114. function m3(e) {
  115. if (e === void 0)
  116. return null;
  117. if (typeof e == "number")
  118. return e;
  119. switch (e.toLowerCase()) {
  120. case "meters":
  121. case "meter":
  122. return 109404;
  123. case "miles":
  124. case "mile":
  125. return 109413;
  126. case "kilometers":
  127. case "kilometer":
  128. case "km":
  129. return 109414;
  130. }
  131. return null;
  132. }
  133. function d(r) {
  134. if (r === null)
  135. return null;
  136. switch (r.type) {
  137. case "polygon":
  138. case "multipoint":
  139. case "polyline":
  140. return r.extent;
  141. case "point":
  142. return new M({ xmin: r.x, ymin: r.y, xmax: r.x, ymax: r.y, spatialReference: r.spatialReference });
  143. case "extent":
  144. return r;
  145. }
  146. return null;
  147. }
  148. function f2(e) {
  149. if (e === void 0)
  150. return null;
  151. if (typeof e == "number")
  152. return e;
  153. if (typeof e == "number")
  154. return e;
  155. switch (e.toLowerCase()) {
  156. case "meters":
  157. case "meter":
  158. return 9001;
  159. case "miles":
  160. case "mile":
  161. return 9035;
  162. case "kilometers":
  163. case "kilometer":
  164. case "km":
  165. return 9036;
  166. }
  167. return null;
  168. }
  169. !function(e) {
  170. e[e.Standardised = 0] = "Standardised", e[e.StandardisedNoInterval = 1] = "StandardisedNoInterval", e[e.SqlServer = 2] = "SqlServer", e[e.Oracle = 3] = "Oracle", e[e.Postgres = 4] = "Postgres", e[e.PGDB = 5] = "PGDB", e[e.FILEGDB = 6] = "FILEGDB", e[e.NotEvaluated = 7] = "NotEvaluated";
  171. }(t4 || (t4 = {})), function(e) {
  172. e[e.InFeatureSet = 0] = "InFeatureSet", e[e.NotInFeatureSet = 1] = "NotInFeatureSet", e[e.Unknown = 2] = "Unknown";
  173. }(i2 || (i2 = {}));
  174. var F = 1e3;
  175. var S = { point: "point", polygon: "polygon", polyline: "polyline", multipoint: "multipoint", extent: "extent", esriGeometryPoint: "point", esriGeometryPolygon: "polygon", esriGeometryPolyline: "polyline", esriGeometryMultipoint: "multipoint", esriGeometryEnvelope: "extent", envelope: "extent" };
  176. var v2 = { point: "esriGeometryPoint", polygon: "esriGeometryPolygon", polyline: "esriGeometryPolyline", multipoint: "esriGeometryMultipoint", extent: "esriGeometryEnvelope", esriGeometryPoint: "esriGeometryPoint", esriGeometryPolygon: "esriGeometryPolygon", esriGeometryPolyline: "esriGeometryPolyline", esriGeometryMultipoint: "esriGeometryMultipoint", esriGeometryEnvelope: "esriGeometryEnvelope", envelope: "esriGeometryEnvelope" };
  177. var P = { "small-integer": "esriFieldTypeSmallInteger", integer: "esriFieldTypeInteger", long: "esriFieldTypeLong", single: "esriFieldTypeSingle", double: "esriFieldTypeDouble", string: "esriFieldTypeString", date: "esriFieldTypeDate", oid: "esriFieldTypeOID", geometry: "esriFieldTypeGeometry", blob: "esriFieldTypeBlob", raster: "esriFieldTypeRaster", guid: "esriFieldTypeGUID", "global-id": "esriFieldTypeGlobalID", xml: "eesriFieldTypeXML", esriFieldTypeSmallInteger: "esriFieldTypeSmallInteger", esriFieldTypeInteger: "esriFieldTypeInteger", esriFieldTypeLong: "esriFieldTypeLong", esriFieldTypeSingle: "esriFieldTypeSingle", esriFieldTypeDouble: "esriFieldTypeDouble", esriFieldTypeString: "esriFieldTypeString", esriFieldTypeDate: "esriFieldTypeDate", esriFieldTypeOID: "esriFieldTypeOID", esriFieldTypeGeometry: "esriFieldTypeGeometry", esriFieldTypeBlob: "esriFieldTypeBlob", esriFieldTypeRaster: "esriFieldTypeRaster", esriFieldTypeGUID: "esriFieldTypeGUID", esriFieldTypeGlobalID: "esriFieldTypeGlobalID", esriFieldTypeXML: "eesriFieldTypeXML" };
  178. function b(e) {
  179. return e === void 0 ? "" : e = (e = (e = e.replace(/\/featureserver\/[0-9]*/i, "/FeatureServer")).replace(/\/mapserver\/[0-9]*/i, "/MapServer")).split("?")[0];
  180. }
  181. function D(e, r) {
  182. r || (r = {}), typeof r == "function" && (r = { cmp: r });
  183. const t5 = typeof r.cycles == "boolean" && r.cycles, i3 = r.cmp && (n3 = r.cmp, function(e2) {
  184. return function(r2, t6) {
  185. const i4 = { key: r2, value: e2[r2] }, o3 = { key: t6, value: e2[t6] };
  186. return n3(i4, o3);
  187. };
  188. });
  189. var n3;
  190. const o2 = [];
  191. return function e2(r2) {
  192. if (r2 && r2.toJSON && typeof r2.toJSON == "function" && (r2 = r2.toJSON()), r2 === void 0)
  193. return;
  194. if (typeof r2 == "number")
  195. return isFinite(r2) ? "" + r2 : "null";
  196. if (typeof r2 != "object")
  197. return JSON.stringify(r2);
  198. let n4, l4;
  199. if (Array.isArray(r2)) {
  200. for (l4 = "[", n4 = 0; n4 < r2.length; n4++)
  201. n4 && (l4 += ","), l4 += e2(r2[n4]) || "null";
  202. return l4 + "]";
  203. }
  204. if (r2 === null)
  205. return "null";
  206. if (o2.includes(r2)) {
  207. if (t5)
  208. return JSON.stringify("__cycle__");
  209. throw new TypeError("Converting circular structure to JSON");
  210. }
  211. const s3 = o2.push(r2) - 1, y3 = Object.keys(r2).sort(i3 && i3(r2));
  212. for (l4 = "", n4 = 0; n4 < y3.length; n4++) {
  213. const t6 = y3[n4], i4 = e2(r2[t6]);
  214. i4 && (l4 && (l4 += ","), l4 += JSON.stringify(t6) + ":" + i4);
  215. }
  216. return o2.splice(s3, 1), "{" + l4 + "}";
  217. }(e);
  218. }
  219. // node_modules/luxon/src/errors.js
  220. var LuxonError = class extends Error {
  221. };
  222. var InvalidDateTimeError = class extends LuxonError {
  223. constructor(reason) {
  224. super(`Invalid DateTime: ${reason.toMessage()}`);
  225. }
  226. };
  227. var InvalidIntervalError = class extends LuxonError {
  228. constructor(reason) {
  229. super(`Invalid Interval: ${reason.toMessage()}`);
  230. }
  231. };
  232. var InvalidDurationError = class extends LuxonError {
  233. constructor(reason) {
  234. super(`Invalid Duration: ${reason.toMessage()}`);
  235. }
  236. };
  237. var ConflictingSpecificationError = class extends LuxonError {
  238. };
  239. var InvalidUnitError = class extends LuxonError {
  240. constructor(unit) {
  241. super(`Invalid unit ${unit}`);
  242. }
  243. };
  244. var InvalidArgumentError = class extends LuxonError {
  245. };
  246. var ZoneIsAbstractError = class extends LuxonError {
  247. constructor() {
  248. super("Zone is an abstract class");
  249. }
  250. };
  251. // node_modules/luxon/src/impl/formats.js
  252. var n2 = "numeric";
  253. var s2 = "short";
  254. var l3 = "long";
  255. var DATE_SHORT = {
  256. year: n2,
  257. month: n2,
  258. day: n2
  259. };
  260. var DATE_MED = {
  261. year: n2,
  262. month: s2,
  263. day: n2
  264. };
  265. var DATE_MED_WITH_WEEKDAY = {
  266. year: n2,
  267. month: s2,
  268. day: n2,
  269. weekday: s2
  270. };
  271. var DATE_FULL = {
  272. year: n2,
  273. month: l3,
  274. day: n2
  275. };
  276. var DATE_HUGE = {
  277. year: n2,
  278. month: l3,
  279. day: n2,
  280. weekday: l3
  281. };
  282. var TIME_SIMPLE = {
  283. hour: n2,
  284. minute: n2
  285. };
  286. var TIME_WITH_SECONDS = {
  287. hour: n2,
  288. minute: n2,
  289. second: n2
  290. };
  291. var TIME_WITH_SHORT_OFFSET = {
  292. hour: n2,
  293. minute: n2,
  294. second: n2,
  295. timeZoneName: s2
  296. };
  297. var TIME_WITH_LONG_OFFSET = {
  298. hour: n2,
  299. minute: n2,
  300. second: n2,
  301. timeZoneName: l3
  302. };
  303. var TIME_24_SIMPLE = {
  304. hour: n2,
  305. minute: n2,
  306. hourCycle: "h23"
  307. };
  308. var TIME_24_WITH_SECONDS = {
  309. hour: n2,
  310. minute: n2,
  311. second: n2,
  312. hourCycle: "h23"
  313. };
  314. var TIME_24_WITH_SHORT_OFFSET = {
  315. hour: n2,
  316. minute: n2,
  317. second: n2,
  318. hourCycle: "h23",
  319. timeZoneName: s2
  320. };
  321. var TIME_24_WITH_LONG_OFFSET = {
  322. hour: n2,
  323. minute: n2,
  324. second: n2,
  325. hourCycle: "h23",
  326. timeZoneName: l3
  327. };
  328. var DATETIME_SHORT = {
  329. year: n2,
  330. month: n2,
  331. day: n2,
  332. hour: n2,
  333. minute: n2
  334. };
  335. var DATETIME_SHORT_WITH_SECONDS = {
  336. year: n2,
  337. month: n2,
  338. day: n2,
  339. hour: n2,
  340. minute: n2,
  341. second: n2
  342. };
  343. var DATETIME_MED = {
  344. year: n2,
  345. month: s2,
  346. day: n2,
  347. hour: n2,
  348. minute: n2
  349. };
  350. var DATETIME_MED_WITH_SECONDS = {
  351. year: n2,
  352. month: s2,
  353. day: n2,
  354. hour: n2,
  355. minute: n2,
  356. second: n2
  357. };
  358. var DATETIME_MED_WITH_WEEKDAY = {
  359. year: n2,
  360. month: s2,
  361. day: n2,
  362. weekday: s2,
  363. hour: n2,
  364. minute: n2
  365. };
  366. var DATETIME_FULL = {
  367. year: n2,
  368. month: l3,
  369. day: n2,
  370. hour: n2,
  371. minute: n2,
  372. timeZoneName: s2
  373. };
  374. var DATETIME_FULL_WITH_SECONDS = {
  375. year: n2,
  376. month: l3,
  377. day: n2,
  378. hour: n2,
  379. minute: n2,
  380. second: n2,
  381. timeZoneName: s2
  382. };
  383. var DATETIME_HUGE = {
  384. year: n2,
  385. month: l3,
  386. day: n2,
  387. weekday: l3,
  388. hour: n2,
  389. minute: n2,
  390. timeZoneName: l3
  391. };
  392. var DATETIME_HUGE_WITH_SECONDS = {
  393. year: n2,
  394. month: l3,
  395. day: n2,
  396. weekday: l3,
  397. hour: n2,
  398. minute: n2,
  399. second: n2,
  400. timeZoneName: l3
  401. };
  402. // node_modules/luxon/src/impl/util.js
  403. function isUndefined(o2) {
  404. return typeof o2 === "undefined";
  405. }
  406. function isNumber(o2) {
  407. return typeof o2 === "number";
  408. }
  409. function isInteger(o2) {
  410. return typeof o2 === "number" && o2 % 1 === 0;
  411. }
  412. function isString(o2) {
  413. return typeof o2 === "string";
  414. }
  415. function isDate(o2) {
  416. return Object.prototype.toString.call(o2) === "[object Date]";
  417. }
  418. function hasRelative() {
  419. try {
  420. return typeof Intl !== "undefined" && !!Intl.RelativeTimeFormat;
  421. } catch (e) {
  422. return false;
  423. }
  424. }
  425. function maybeArray(thing) {
  426. return Array.isArray(thing) ? thing : [thing];
  427. }
  428. function bestBy(arr, by, compare) {
  429. if (arr.length === 0) {
  430. return void 0;
  431. }
  432. return arr.reduce((best, next) => {
  433. const pair = [by(next), next];
  434. if (!best) {
  435. return pair;
  436. } else if (compare(best[0], pair[0]) === best[0]) {
  437. return best;
  438. } else {
  439. return pair;
  440. }
  441. }, null)[1];
  442. }
  443. function pick(obj, keys) {
  444. return keys.reduce((a, k2) => {
  445. a[k2] = obj[k2];
  446. return a;
  447. }, {});
  448. }
  449. function hasOwnProperty(obj, prop) {
  450. return Object.prototype.hasOwnProperty.call(obj, prop);
  451. }
  452. function integerBetween(thing, bottom, top) {
  453. return isInteger(thing) && thing >= bottom && thing <= top;
  454. }
  455. function floorMod(x2, n3) {
  456. return x2 - n3 * Math.floor(x2 / n3);
  457. }
  458. function padStart(input, n3 = 2) {
  459. const isNeg = input < 0;
  460. let padded;
  461. if (isNeg) {
  462. padded = "-" + ("" + -input).padStart(n3, "0");
  463. } else {
  464. padded = ("" + input).padStart(n3, "0");
  465. }
  466. return padded;
  467. }
  468. function parseInteger(string) {
  469. if (isUndefined(string) || string === null || string === "") {
  470. return void 0;
  471. } else {
  472. return parseInt(string, 10);
  473. }
  474. }
  475. function parseFloating(string) {
  476. if (isUndefined(string) || string === null || string === "") {
  477. return void 0;
  478. } else {
  479. return parseFloat(string);
  480. }
  481. }
  482. function parseMillis(fraction) {
  483. if (isUndefined(fraction) || fraction === null || fraction === "") {
  484. return void 0;
  485. } else {
  486. const f3 = parseFloat("0." + fraction) * 1e3;
  487. return Math.floor(f3);
  488. }
  489. }
  490. function roundTo(number, digits, towardZero = false) {
  491. const factor = 10 ** digits, rounder = towardZero ? Math.trunc : Math.round;
  492. return rounder(number * factor) / factor;
  493. }
  494. function isLeapYear(year) {
  495. return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
  496. }
  497. function daysInYear(year) {
  498. return isLeapYear(year) ? 366 : 365;
  499. }
  500. function daysInMonth(year, month) {
  501. const modMonth = floorMod(month - 1, 12) + 1, modYear = year + (month - modMonth) / 12;
  502. if (modMonth === 2) {
  503. return isLeapYear(modYear) ? 29 : 28;
  504. } else {
  505. return [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][modMonth - 1];
  506. }
  507. }
  508. function objToLocalTS(obj) {
  509. let d2 = Date.UTC(obj.year, obj.month - 1, obj.day, obj.hour, obj.minute, obj.second, obj.millisecond);
  510. if (obj.year < 100 && obj.year >= 0) {
  511. d2 = new Date(d2);
  512. d2.setUTCFullYear(d2.getUTCFullYear() - 1900);
  513. }
  514. return +d2;
  515. }
  516. function weeksInWeekYear(weekYear) {
  517. const p1 = (weekYear + Math.floor(weekYear / 4) - Math.floor(weekYear / 100) + Math.floor(weekYear / 400)) % 7, last = weekYear - 1, p22 = (last + Math.floor(last / 4) - Math.floor(last / 100) + Math.floor(last / 400)) % 7;
  518. return p1 === 4 || p22 === 3 ? 53 : 52;
  519. }
  520. function untruncateYear(year) {
  521. if (year > 99) {
  522. return year;
  523. } else
  524. return year > 60 ? 1900 + year : 2e3 + year;
  525. }
  526. function parseZoneInfo(ts, offsetFormat, locale, timeZone = null) {
  527. const date = new Date(ts), intlOpts = {
  528. hourCycle: "h23",
  529. year: "numeric",
  530. month: "2-digit",
  531. day: "2-digit",
  532. hour: "2-digit",
  533. minute: "2-digit"
  534. };
  535. if (timeZone) {
  536. intlOpts.timeZone = timeZone;
  537. }
  538. const modified = { timeZoneName: offsetFormat, ...intlOpts };
  539. const parsed = new Intl.DateTimeFormat(locale, modified).formatToParts(date).find((m4) => m4.type.toLowerCase() === "timezonename");
  540. return parsed ? parsed.value : null;
  541. }
  542. function signedOffset(offHourStr, offMinuteStr) {
  543. let offHour = parseInt(offHourStr, 10);
  544. if (Number.isNaN(offHour)) {
  545. offHour = 0;
  546. }
  547. const offMin = parseInt(offMinuteStr, 10) || 0, offMinSigned = offHour < 0 || Object.is(offHour, -0) ? -offMin : offMin;
  548. return offHour * 60 + offMinSigned;
  549. }
  550. function asNumber(value) {
  551. const numericValue = Number(value);
  552. if (typeof value === "boolean" || value === "" || Number.isNaN(numericValue))
  553. throw new InvalidArgumentError(`Invalid unit value ${value}`);
  554. return numericValue;
  555. }
  556. function normalizeObject(obj, normalizer) {
  557. const normalized = {};
  558. for (const u in obj) {
  559. if (hasOwnProperty(obj, u)) {
  560. const v4 = obj[u];
  561. if (v4 === void 0 || v4 === null)
  562. continue;
  563. normalized[normalizer(u)] = asNumber(v4);
  564. }
  565. }
  566. return normalized;
  567. }
  568. function formatOffset(offset2, format) {
  569. const hours = Math.trunc(Math.abs(offset2 / 60)), minutes = Math.trunc(Math.abs(offset2 % 60)), sign = offset2 >= 0 ? "+" : "-";
  570. switch (format) {
  571. case "short":
  572. return `${sign}${padStart(hours, 2)}:${padStart(minutes, 2)}`;
  573. case "narrow":
  574. return `${sign}${hours}${minutes > 0 ? `:${minutes}` : ""}`;
  575. case "techie":
  576. return `${sign}${padStart(hours, 2)}${padStart(minutes, 2)}`;
  577. default:
  578. throw new RangeError(`Value format ${format} is out of range for property format`);
  579. }
  580. }
  581. function timeObject(obj) {
  582. return pick(obj, ["hour", "minute", "second", "millisecond"]);
  583. }
  584. var ianaRegex = /[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;
  585. // node_modules/luxon/src/impl/english.js
  586. var monthsLong = [
  587. "January",
  588. "February",
  589. "March",
  590. "April",
  591. "May",
  592. "June",
  593. "July",
  594. "August",
  595. "September",
  596. "October",
  597. "November",
  598. "December"
  599. ];
  600. var monthsShort = [
  601. "Jan",
  602. "Feb",
  603. "Mar",
  604. "Apr",
  605. "May",
  606. "Jun",
  607. "Jul",
  608. "Aug",
  609. "Sep",
  610. "Oct",
  611. "Nov",
  612. "Dec"
  613. ];
  614. var monthsNarrow = ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"];
  615. function months(length) {
  616. switch (length) {
  617. case "narrow":
  618. return [...monthsNarrow];
  619. case "short":
  620. return [...monthsShort];
  621. case "long":
  622. return [...monthsLong];
  623. case "numeric":
  624. return ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"];
  625. case "2-digit":
  626. return ["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"];
  627. default:
  628. return null;
  629. }
  630. }
  631. var weekdaysLong = [
  632. "Monday",
  633. "Tuesday",
  634. "Wednesday",
  635. "Thursday",
  636. "Friday",
  637. "Saturday",
  638. "Sunday"
  639. ];
  640. var weekdaysShort = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
  641. var weekdaysNarrow = ["M", "T", "W", "T", "F", "S", "S"];
  642. function weekdays(length) {
  643. switch (length) {
  644. case "narrow":
  645. return [...weekdaysNarrow];
  646. case "short":
  647. return [...weekdaysShort];
  648. case "long":
  649. return [...weekdaysLong];
  650. case "numeric":
  651. return ["1", "2", "3", "4", "5", "6", "7"];
  652. default:
  653. return null;
  654. }
  655. }
  656. var meridiems = ["AM", "PM"];
  657. var erasLong = ["Before Christ", "Anno Domini"];
  658. var erasShort = ["BC", "AD"];
  659. var erasNarrow = ["B", "A"];
  660. function eras(length) {
  661. switch (length) {
  662. case "narrow":
  663. return [...erasNarrow];
  664. case "short":
  665. return [...erasShort];
  666. case "long":
  667. return [...erasLong];
  668. default:
  669. return null;
  670. }
  671. }
  672. function meridiemForDateTime(dt) {
  673. return meridiems[dt.hour < 12 ? 0 : 1];
  674. }
  675. function weekdayForDateTime(dt, length) {
  676. return weekdays(length)[dt.weekday - 1];
  677. }
  678. function monthForDateTime(dt, length) {
  679. return months(length)[dt.month - 1];
  680. }
  681. function eraForDateTime(dt, length) {
  682. return eras(length)[dt.year < 0 ? 0 : 1];
  683. }
  684. function formatRelativeTime(unit, count, numeric = "always", narrow = false) {
  685. const units = {
  686. years: ["year", "yr."],
  687. quarters: ["quarter", "qtr."],
  688. months: ["month", "mo."],
  689. weeks: ["week", "wk."],
  690. days: ["day", "day", "days"],
  691. hours: ["hour", "hr."],
  692. minutes: ["minute", "min."],
  693. seconds: ["second", "sec."]
  694. };
  695. const lastable = ["hours", "minutes", "seconds"].indexOf(unit) === -1;
  696. if (numeric === "auto" && lastable) {
  697. const isDay = unit === "days";
  698. switch (count) {
  699. case 1:
  700. return isDay ? "tomorrow" : `next ${units[unit][0]}`;
  701. case -1:
  702. return isDay ? "yesterday" : `last ${units[unit][0]}`;
  703. case 0:
  704. return isDay ? "today" : `this ${units[unit][0]}`;
  705. default:
  706. }
  707. }
  708. const isInPast = Object.is(count, -0) || count < 0, fmtValue = Math.abs(count), singular = fmtValue === 1, lilUnits = units[unit], fmtUnit = narrow ? singular ? lilUnits[1] : lilUnits[2] || lilUnits[1] : singular ? units[unit][0] : unit;
  709. return isInPast ? `${fmtValue} ${fmtUnit} ago` : `in ${fmtValue} ${fmtUnit}`;
  710. }
  711. // node_modules/luxon/src/impl/formatter.js
  712. function stringifyTokens(splits, tokenToString) {
  713. let s3 = "";
  714. for (const token of splits) {
  715. if (token.literal) {
  716. s3 += token.val;
  717. } else {
  718. s3 += tokenToString(token.val);
  719. }
  720. }
  721. return s3;
  722. }
  723. var macroTokenToFormatOpts = {
  724. D: DATE_SHORT,
  725. DD: DATE_MED,
  726. DDD: DATE_FULL,
  727. DDDD: DATE_HUGE,
  728. t: TIME_SIMPLE,
  729. tt: TIME_WITH_SECONDS,
  730. ttt: TIME_WITH_SHORT_OFFSET,
  731. tttt: TIME_WITH_LONG_OFFSET,
  732. T: TIME_24_SIMPLE,
  733. TT: TIME_24_WITH_SECONDS,
  734. TTT: TIME_24_WITH_SHORT_OFFSET,
  735. TTTT: TIME_24_WITH_LONG_OFFSET,
  736. f: DATETIME_SHORT,
  737. ff: DATETIME_MED,
  738. fff: DATETIME_FULL,
  739. ffff: DATETIME_HUGE,
  740. F: DATETIME_SHORT_WITH_SECONDS,
  741. FF: DATETIME_MED_WITH_SECONDS,
  742. FFF: DATETIME_FULL_WITH_SECONDS,
  743. FFFF: DATETIME_HUGE_WITH_SECONDS
  744. };
  745. var Formatter = class {
  746. static create(locale, opts = {}) {
  747. return new Formatter(locale, opts);
  748. }
  749. static parseFormat(fmt) {
  750. let current = null, currentFull = "", bracketed = false;
  751. const splits = [];
  752. for (let i3 = 0; i3 < fmt.length; i3++) {
  753. const c2 = fmt.charAt(i3);
  754. if (c2 === "'") {
  755. if (currentFull.length > 0) {
  756. splits.push({ literal: bracketed, val: currentFull });
  757. }
  758. current = null;
  759. currentFull = "";
  760. bracketed = !bracketed;
  761. } else if (bracketed) {
  762. currentFull += c2;
  763. } else if (c2 === current) {
  764. currentFull += c2;
  765. } else {
  766. if (currentFull.length > 0) {
  767. splits.push({ literal: false, val: currentFull });
  768. }
  769. currentFull = c2;
  770. current = c2;
  771. }
  772. }
  773. if (currentFull.length > 0) {
  774. splits.push({ literal: bracketed, val: currentFull });
  775. }
  776. return splits;
  777. }
  778. static macroTokenToFormatOpts(token) {
  779. return macroTokenToFormatOpts[token];
  780. }
  781. constructor(locale, formatOpts) {
  782. this.opts = formatOpts;
  783. this.loc = locale;
  784. this.systemLoc = null;
  785. }
  786. formatWithSystemDefault(dt, opts) {
  787. if (this.systemLoc === null) {
  788. this.systemLoc = this.loc.redefaultToSystem();
  789. }
  790. const df = this.systemLoc.dtFormatter(dt, { ...this.opts, ...opts });
  791. return df.format();
  792. }
  793. formatDateTime(dt, opts = {}) {
  794. const df = this.loc.dtFormatter(dt, { ...this.opts, ...opts });
  795. return df.format();
  796. }
  797. formatDateTimeParts(dt, opts = {}) {
  798. const df = this.loc.dtFormatter(dt, { ...this.opts, ...opts });
  799. return df.formatToParts();
  800. }
  801. resolvedOptions(dt, opts = {}) {
  802. const df = this.loc.dtFormatter(dt, { ...this.opts, ...opts });
  803. return df.resolvedOptions();
  804. }
  805. num(n3, p4 = 0) {
  806. if (this.opts.forceSimple) {
  807. return padStart(n3, p4);
  808. }
  809. const opts = { ...this.opts };
  810. if (p4 > 0) {
  811. opts.padTo = p4;
  812. }
  813. return this.loc.numberFormatter(opts).format(n3);
  814. }
  815. formatDateTimeFromString(dt, fmt) {
  816. const knownEnglish = this.loc.listingMode() === "en", useDateTimeFormatter = this.loc.outputCalendar && this.loc.outputCalendar !== "gregory", string = (opts, extract) => this.loc.extract(dt, opts, extract), formatOffset2 = (opts) => {
  817. if (dt.isOffsetFixed && dt.offset === 0 && opts.allowZ) {
  818. return "Z";
  819. }
  820. return dt.isValid ? dt.zone.formatOffset(dt.ts, opts.format) : "";
  821. }, meridiem = () => knownEnglish ? meridiemForDateTime(dt) : string({ hour: "numeric", hourCycle: "h12" }, "dayperiod"), month = (length, standalone) => knownEnglish ? monthForDateTime(dt, length) : string(standalone ? { month: length } : { month: length, day: "numeric" }, "month"), weekday = (length, standalone) => knownEnglish ? weekdayForDateTime(dt, length) : string(standalone ? { weekday: length } : { weekday: length, month: "long", day: "numeric" }, "weekday"), maybeMacro = (token) => {
  822. const formatOpts = Formatter.macroTokenToFormatOpts(token);
  823. if (formatOpts) {
  824. return this.formatWithSystemDefault(dt, formatOpts);
  825. } else {
  826. return token;
  827. }
  828. }, era = (length) => knownEnglish ? eraForDateTime(dt, length) : string({ era: length }, "era"), tokenToString = (token) => {
  829. switch (token) {
  830. case "S":
  831. return this.num(dt.millisecond);
  832. case "u":
  833. case "SSS":
  834. return this.num(dt.millisecond, 3);
  835. case "s":
  836. return this.num(dt.second);
  837. case "ss":
  838. return this.num(dt.second, 2);
  839. case "uu":
  840. return this.num(Math.floor(dt.millisecond / 10), 2);
  841. case "uuu":
  842. return this.num(Math.floor(dt.millisecond / 100));
  843. case "m":
  844. return this.num(dt.minute);
  845. case "mm":
  846. return this.num(dt.minute, 2);
  847. case "h":
  848. return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12);
  849. case "hh":
  850. return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12, 2);
  851. case "H":
  852. return this.num(dt.hour);
  853. case "HH":
  854. return this.num(dt.hour, 2);
  855. case "Z":
  856. return formatOffset2({ format: "narrow", allowZ: this.opts.allowZ });
  857. case "ZZ":
  858. return formatOffset2({ format: "short", allowZ: this.opts.allowZ });
  859. case "ZZZ":
  860. return formatOffset2({ format: "techie", allowZ: this.opts.allowZ });
  861. case "ZZZZ":
  862. return dt.zone.offsetName(dt.ts, { format: "short", locale: this.loc.locale });
  863. case "ZZZZZ":
  864. return dt.zone.offsetName(dt.ts, { format: "long", locale: this.loc.locale });
  865. case "z":
  866. return dt.zoneName;
  867. case "a":
  868. return meridiem();
  869. case "d":
  870. return useDateTimeFormatter ? string({ day: "numeric" }, "day") : this.num(dt.day);
  871. case "dd":
  872. return useDateTimeFormatter ? string({ day: "2-digit" }, "day") : this.num(dt.day, 2);
  873. case "c":
  874. return this.num(dt.weekday);
  875. case "ccc":
  876. return weekday("short", true);
  877. case "cccc":
  878. return weekday("long", true);
  879. case "ccccc":
  880. return weekday("narrow", true);
  881. case "E":
  882. return this.num(dt.weekday);
  883. case "EEE":
  884. return weekday("short", false);
  885. case "EEEE":
  886. return weekday("long", false);
  887. case "EEEEE":
  888. return weekday("narrow", false);
  889. case "L":
  890. return useDateTimeFormatter ? string({ month: "numeric", day: "numeric" }, "month") : this.num(dt.month);
  891. case "LL":
  892. return useDateTimeFormatter ? string({ month: "2-digit", day: "numeric" }, "month") : this.num(dt.month, 2);
  893. case "LLL":
  894. return month("short", true);
  895. case "LLLL":
  896. return month("long", true);
  897. case "LLLLL":
  898. return month("narrow", true);
  899. case "M":
  900. return useDateTimeFormatter ? string({ month: "numeric" }, "month") : this.num(dt.month);
  901. case "MM":
  902. return useDateTimeFormatter ? string({ month: "2-digit" }, "month") : this.num(dt.month, 2);
  903. case "MMM":
  904. return month("short", false);
  905. case "MMMM":
  906. return month("long", false);
  907. case "MMMMM":
  908. return month("narrow", false);
  909. case "y":
  910. return useDateTimeFormatter ? string({ year: "numeric" }, "year") : this.num(dt.year);
  911. case "yy":
  912. return useDateTimeFormatter ? string({ year: "2-digit" }, "year") : this.num(dt.year.toString().slice(-2), 2);
  913. case "yyyy":
  914. return useDateTimeFormatter ? string({ year: "numeric" }, "year") : this.num(dt.year, 4);
  915. case "yyyyyy":
  916. return useDateTimeFormatter ? string({ year: "numeric" }, "year") : this.num(dt.year, 6);
  917. case "G":
  918. return era("short");
  919. case "GG":
  920. return era("long");
  921. case "GGGGG":
  922. return era("narrow");
  923. case "kk":
  924. return this.num(dt.weekYear.toString().slice(-2), 2);
  925. case "kkkk":
  926. return this.num(dt.weekYear, 4);
  927. case "W":
  928. return this.num(dt.weekNumber);
  929. case "WW":
  930. return this.num(dt.weekNumber, 2);
  931. case "o":
  932. return this.num(dt.ordinal);
  933. case "ooo":
  934. return this.num(dt.ordinal, 3);
  935. case "q":
  936. return this.num(dt.quarter);
  937. case "qq":
  938. return this.num(dt.quarter, 2);
  939. case "X":
  940. return this.num(Math.floor(dt.ts / 1e3));
  941. case "x":
  942. return this.num(dt.ts);
  943. default:
  944. return maybeMacro(token);
  945. }
  946. };
  947. return stringifyTokens(Formatter.parseFormat(fmt), tokenToString);
  948. }
  949. formatDurationFromString(dur, fmt) {
  950. const tokenToField = (token) => {
  951. switch (token[0]) {
  952. case "S":
  953. return "millisecond";
  954. case "s":
  955. return "second";
  956. case "m":
  957. return "minute";
  958. case "h":
  959. return "hour";
  960. case "d":
  961. return "day";
  962. case "w":
  963. return "week";
  964. case "M":
  965. return "month";
  966. case "y":
  967. return "year";
  968. default:
  969. return null;
  970. }
  971. }, tokenToString = (lildur) => (token) => {
  972. const mapped = tokenToField(token);
  973. if (mapped) {
  974. return this.num(lildur.get(mapped), token.length);
  975. } else {
  976. return token;
  977. }
  978. }, tokens = Formatter.parseFormat(fmt), realTokens = tokens.reduce((found, { literal, val }) => literal ? found : found.concat(val), []), collapsed = dur.shiftTo(...realTokens.map(tokenToField).filter((t5) => t5));
  979. return stringifyTokens(tokens, tokenToString(collapsed));
  980. }
  981. };
  982. // node_modules/luxon/src/impl/invalid.js
  983. var Invalid = class {
  984. constructor(reason, explanation) {
  985. this.reason = reason;
  986. this.explanation = explanation;
  987. }
  988. toMessage() {
  989. if (this.explanation) {
  990. return `${this.reason}: ${this.explanation}`;
  991. } else {
  992. return this.reason;
  993. }
  994. }
  995. };
  996. // node_modules/luxon/src/zone.js
  997. var Zone = class {
  998. get type() {
  999. throw new ZoneIsAbstractError();
  1000. }
  1001. get name() {
  1002. throw new ZoneIsAbstractError();
  1003. }
  1004. get ianaName() {
  1005. return this.name;
  1006. }
  1007. get isUniversal() {
  1008. throw new ZoneIsAbstractError();
  1009. }
  1010. offsetName(ts, opts) {
  1011. throw new ZoneIsAbstractError();
  1012. }
  1013. formatOffset(ts, format) {
  1014. throw new ZoneIsAbstractError();
  1015. }
  1016. offset(ts) {
  1017. throw new ZoneIsAbstractError();
  1018. }
  1019. equals(otherZone) {
  1020. throw new ZoneIsAbstractError();
  1021. }
  1022. get isValid() {
  1023. throw new ZoneIsAbstractError();
  1024. }
  1025. };
  1026. // node_modules/luxon/src/zones/systemZone.js
  1027. var singleton = null;
  1028. var SystemZone = class extends Zone {
  1029. static get instance() {
  1030. if (singleton === null) {
  1031. singleton = new SystemZone();
  1032. }
  1033. return singleton;
  1034. }
  1035. get type() {
  1036. return "system";
  1037. }
  1038. get name() {
  1039. return new Intl.DateTimeFormat().resolvedOptions().timeZone;
  1040. }
  1041. get isUniversal() {
  1042. return false;
  1043. }
  1044. offsetName(ts, { format, locale }) {
  1045. return parseZoneInfo(ts, format, locale);
  1046. }
  1047. formatOffset(ts, format) {
  1048. return formatOffset(this.offset(ts), format);
  1049. }
  1050. offset(ts) {
  1051. return -new Date(ts).getTimezoneOffset();
  1052. }
  1053. equals(otherZone) {
  1054. return otherZone.type === "system";
  1055. }
  1056. get isValid() {
  1057. return true;
  1058. }
  1059. };
  1060. // node_modules/luxon/src/zones/IANAZone.js
  1061. var dtfCache = {};
  1062. function makeDTF(zone) {
  1063. if (!dtfCache[zone]) {
  1064. dtfCache[zone] = new Intl.DateTimeFormat("en-US", {
  1065. hour12: false,
  1066. timeZone: zone,
  1067. year: "numeric",
  1068. month: "2-digit",
  1069. day: "2-digit",
  1070. hour: "2-digit",
  1071. minute: "2-digit",
  1072. second: "2-digit",
  1073. era: "short"
  1074. });
  1075. }
  1076. return dtfCache[zone];
  1077. }
  1078. var typeToPos = {
  1079. year: 0,
  1080. month: 1,
  1081. day: 2,
  1082. era: 3,
  1083. hour: 4,
  1084. minute: 5,
  1085. second: 6
  1086. };
  1087. function hackyOffset(dtf, date) {
  1088. const formatted = dtf.format(date).replace(/\u200E/g, ""), parsed = /(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(formatted), [, fMonth, fDay, fYear, fadOrBc, fHour, fMinute, fSecond] = parsed;
  1089. return [fYear, fMonth, fDay, fadOrBc, fHour, fMinute, fSecond];
  1090. }
  1091. function partsOffset(dtf, date) {
  1092. const formatted = dtf.formatToParts(date);
  1093. const filled = [];
  1094. for (let i3 = 0; i3 < formatted.length; i3++) {
  1095. const { type, value } = formatted[i3];
  1096. const pos = typeToPos[type];
  1097. if (type === "era") {
  1098. filled[pos] = value;
  1099. } else if (!isUndefined(pos)) {
  1100. filled[pos] = parseInt(value, 10);
  1101. }
  1102. }
  1103. return filled;
  1104. }
  1105. var ianaZoneCache = {};
  1106. var IANAZone = class extends Zone {
  1107. static create(name) {
  1108. if (!ianaZoneCache[name]) {
  1109. ianaZoneCache[name] = new IANAZone(name);
  1110. }
  1111. return ianaZoneCache[name];
  1112. }
  1113. static resetCache() {
  1114. ianaZoneCache = {};
  1115. dtfCache = {};
  1116. }
  1117. static isValidSpecifier(s3) {
  1118. return this.isValidZone(s3);
  1119. }
  1120. static isValidZone(zone) {
  1121. if (!zone) {
  1122. return false;
  1123. }
  1124. try {
  1125. new Intl.DateTimeFormat("en-US", { timeZone: zone }).format();
  1126. return true;
  1127. } catch (e) {
  1128. return false;
  1129. }
  1130. }
  1131. constructor(name) {
  1132. super();
  1133. this.zoneName = name;
  1134. this.valid = IANAZone.isValidZone(name);
  1135. }
  1136. get type() {
  1137. return "iana";
  1138. }
  1139. get name() {
  1140. return this.zoneName;
  1141. }
  1142. get isUniversal() {
  1143. return false;
  1144. }
  1145. offsetName(ts, { format, locale }) {
  1146. return parseZoneInfo(ts, format, locale, this.name);
  1147. }
  1148. formatOffset(ts, format) {
  1149. return formatOffset(this.offset(ts), format);
  1150. }
  1151. offset(ts) {
  1152. const date = new Date(ts);
  1153. if (isNaN(date))
  1154. return NaN;
  1155. const dtf = makeDTF(this.name);
  1156. let [year, month, day, adOrBc, hour, minute, second] = dtf.formatToParts ? partsOffset(dtf, date) : hackyOffset(dtf, date);
  1157. if (adOrBc === "BC") {
  1158. year = -Math.abs(year) + 1;
  1159. }
  1160. const adjustedHour = hour === 24 ? 0 : hour;
  1161. const asUTC = objToLocalTS({
  1162. year,
  1163. month,
  1164. day,
  1165. hour: adjustedHour,
  1166. minute,
  1167. second,
  1168. millisecond: 0
  1169. });
  1170. let asTS = +date;
  1171. const over = asTS % 1e3;
  1172. asTS -= over >= 0 ? over : 1e3 + over;
  1173. return (asUTC - asTS) / (60 * 1e3);
  1174. }
  1175. equals(otherZone) {
  1176. return otherZone.type === "iana" && otherZone.name === this.name;
  1177. }
  1178. get isValid() {
  1179. return this.valid;
  1180. }
  1181. };
  1182. // node_modules/luxon/src/zones/fixedOffsetZone.js
  1183. var singleton2 = null;
  1184. var FixedOffsetZone = class extends Zone {
  1185. static get utcInstance() {
  1186. if (singleton2 === null) {
  1187. singleton2 = new FixedOffsetZone(0);
  1188. }
  1189. return singleton2;
  1190. }
  1191. static instance(offset2) {
  1192. return offset2 === 0 ? FixedOffsetZone.utcInstance : new FixedOffsetZone(offset2);
  1193. }
  1194. static parseSpecifier(s3) {
  1195. if (s3) {
  1196. const r = s3.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);
  1197. if (r) {
  1198. return new FixedOffsetZone(signedOffset(r[1], r[2]));
  1199. }
  1200. }
  1201. return null;
  1202. }
  1203. constructor(offset2) {
  1204. super();
  1205. this.fixed = offset2;
  1206. }
  1207. get type() {
  1208. return "fixed";
  1209. }
  1210. get name() {
  1211. return this.fixed === 0 ? "UTC" : `UTC${formatOffset(this.fixed, "narrow")}`;
  1212. }
  1213. get ianaName() {
  1214. if (this.fixed === 0) {
  1215. return "Etc/UTC";
  1216. } else {
  1217. return `Etc/GMT${formatOffset(-this.fixed, "narrow")}`;
  1218. }
  1219. }
  1220. offsetName() {
  1221. return this.name;
  1222. }
  1223. formatOffset(ts, format) {
  1224. return formatOffset(this.fixed, format);
  1225. }
  1226. get isUniversal() {
  1227. return true;
  1228. }
  1229. offset() {
  1230. return this.fixed;
  1231. }
  1232. equals(otherZone) {
  1233. return otherZone.type === "fixed" && otherZone.fixed === this.fixed;
  1234. }
  1235. get isValid() {
  1236. return true;
  1237. }
  1238. };
  1239. // node_modules/luxon/src/zones/invalidZone.js
  1240. var InvalidZone = class extends Zone {
  1241. constructor(zoneName) {
  1242. super();
  1243. this.zoneName = zoneName;
  1244. }
  1245. get type() {
  1246. return "invalid";
  1247. }
  1248. get name() {
  1249. return this.zoneName;
  1250. }
  1251. get isUniversal() {
  1252. return false;
  1253. }
  1254. offsetName() {
  1255. return null;
  1256. }
  1257. formatOffset() {
  1258. return "";
  1259. }
  1260. offset() {
  1261. return NaN;
  1262. }
  1263. equals() {
  1264. return false;
  1265. }
  1266. get isValid() {
  1267. return false;
  1268. }
  1269. };
  1270. // node_modules/luxon/src/impl/zoneUtil.js
  1271. function normalizeZone(input, defaultZone2) {
  1272. let offset2;
  1273. if (isUndefined(input) || input === null) {
  1274. return defaultZone2;
  1275. } else if (input instanceof Zone) {
  1276. return input;
  1277. } else if (isString(input)) {
  1278. const lowered = input.toLowerCase();
  1279. if (lowered === "local" || lowered === "system")
  1280. return defaultZone2;
  1281. else if (lowered === "utc" || lowered === "gmt")
  1282. return FixedOffsetZone.utcInstance;
  1283. else
  1284. return FixedOffsetZone.parseSpecifier(lowered) || IANAZone.create(input);
  1285. } else if (isNumber(input)) {
  1286. return FixedOffsetZone.instance(input);
  1287. } else if (typeof input === "object" && input.offset && typeof input.offset === "number") {
  1288. return input;
  1289. } else {
  1290. return new InvalidZone(input);
  1291. }
  1292. }
  1293. // node_modules/luxon/src/settings.js
  1294. var now = () => Date.now();
  1295. var defaultZone = "system";
  1296. var defaultLocale = null;
  1297. var defaultNumberingSystem = null;
  1298. var defaultOutputCalendar = null;
  1299. var throwOnInvalid;
  1300. var Settings = class {
  1301. static get now() {
  1302. return now;
  1303. }
  1304. static set now(n3) {
  1305. now = n3;
  1306. }
  1307. static set defaultZone(zone) {
  1308. defaultZone = zone;
  1309. }
  1310. static get defaultZone() {
  1311. return normalizeZone(defaultZone, SystemZone.instance);
  1312. }
  1313. static get defaultLocale() {
  1314. return defaultLocale;
  1315. }
  1316. static set defaultLocale(locale) {
  1317. defaultLocale = locale;
  1318. }
  1319. static get defaultNumberingSystem() {
  1320. return defaultNumberingSystem;
  1321. }
  1322. static set defaultNumberingSystem(numberingSystem) {
  1323. defaultNumberingSystem = numberingSystem;
  1324. }
  1325. static get defaultOutputCalendar() {
  1326. return defaultOutputCalendar;
  1327. }
  1328. static set defaultOutputCalendar(outputCalendar) {
  1329. defaultOutputCalendar = outputCalendar;
  1330. }
  1331. static get throwOnInvalid() {
  1332. return throwOnInvalid;
  1333. }
  1334. static set throwOnInvalid(t5) {
  1335. throwOnInvalid = t5;
  1336. }
  1337. static resetCaches() {
  1338. Locale.resetCache();
  1339. IANAZone.resetCache();
  1340. }
  1341. };
  1342. // node_modules/luxon/src/impl/locale.js
  1343. var intlLFCache = {};
  1344. function getCachedLF(locString, opts = {}) {
  1345. const key = JSON.stringify([locString, opts]);
  1346. let dtf = intlLFCache[key];
  1347. if (!dtf) {
  1348. dtf = new Intl.ListFormat(locString, opts);
  1349. intlLFCache[key] = dtf;
  1350. }
  1351. return dtf;
  1352. }
  1353. var intlDTCache = {};
  1354. function getCachedDTF(locString, opts = {}) {
  1355. const key = JSON.stringify([locString, opts]);
  1356. let dtf = intlDTCache[key];
  1357. if (!dtf) {
  1358. dtf = new Intl.DateTimeFormat(locString, opts);
  1359. intlDTCache[key] = dtf;
  1360. }
  1361. return dtf;
  1362. }
  1363. var intlNumCache = {};
  1364. function getCachedINF(locString, opts = {}) {
  1365. const key = JSON.stringify([locString, opts]);
  1366. let inf = intlNumCache[key];
  1367. if (!inf) {
  1368. inf = new Intl.NumberFormat(locString, opts);
  1369. intlNumCache[key] = inf;
  1370. }
  1371. return inf;
  1372. }
  1373. var intlRelCache = {};
  1374. function getCachedRTF(locString, opts = {}) {
  1375. const { base, ...cacheKeyOpts } = opts;
  1376. const key = JSON.stringify([locString, cacheKeyOpts]);
  1377. let inf = intlRelCache[key];
  1378. if (!inf) {
  1379. inf = new Intl.RelativeTimeFormat(locString, opts);
  1380. intlRelCache[key] = inf;
  1381. }
  1382. return inf;
  1383. }
  1384. var sysLocaleCache = null;
  1385. function systemLocale() {
  1386. if (sysLocaleCache) {
  1387. return sysLocaleCache;
  1388. } else {
  1389. sysLocaleCache = new Intl.DateTimeFormat().resolvedOptions().locale;
  1390. return sysLocaleCache;
  1391. }
  1392. }
  1393. function parseLocaleString(localeStr) {
  1394. const uIndex = localeStr.indexOf("-u-");
  1395. if (uIndex === -1) {
  1396. return [localeStr];
  1397. } else {
  1398. let options;
  1399. const smaller = localeStr.substring(0, uIndex);
  1400. try {
  1401. options = getCachedDTF(localeStr).resolvedOptions();
  1402. } catch (e) {
  1403. options = getCachedDTF(smaller).resolvedOptions();
  1404. }
  1405. const { numberingSystem, calendar } = options;
  1406. return [smaller, numberingSystem, calendar];
  1407. }
  1408. }
  1409. function intlConfigString(localeStr, numberingSystem, outputCalendar) {
  1410. if (outputCalendar || numberingSystem) {
  1411. localeStr += "-u";
  1412. if (outputCalendar) {
  1413. localeStr += `-ca-${outputCalendar}`;
  1414. }
  1415. if (numberingSystem) {
  1416. localeStr += `-nu-${numberingSystem}`;
  1417. }
  1418. return localeStr;
  1419. } else {
  1420. return localeStr;
  1421. }
  1422. }
  1423. function mapMonths(f3) {
  1424. const ms = [];
  1425. for (let i3 = 1; i3 <= 12; i3++) {
  1426. const dt = DateTime.utc(2016, i3, 1);
  1427. ms.push(f3(dt));
  1428. }
  1429. return ms;
  1430. }
  1431. function mapWeekdays(f3) {
  1432. const ms = [];
  1433. for (let i3 = 1; i3 <= 7; i3++) {
  1434. const dt = DateTime.utc(2016, 11, 13 + i3);
  1435. ms.push(f3(dt));
  1436. }
  1437. return ms;
  1438. }
  1439. function listStuff(loc, length, defaultOK, englishFn, intlFn) {
  1440. const mode = loc.listingMode(defaultOK);
  1441. if (mode === "error") {
  1442. return null;
  1443. } else if (mode === "en") {
  1444. return englishFn(length);
  1445. } else {
  1446. return intlFn(length);
  1447. }
  1448. }
  1449. function supportsFastNumbers(loc) {
  1450. if (loc.numberingSystem && loc.numberingSystem !== "latn") {
  1451. return false;
  1452. } else {
  1453. return loc.numberingSystem === "latn" || !loc.locale || loc.locale.startsWith("en") || new Intl.DateTimeFormat(loc.intl).resolvedOptions().numberingSystem === "latn";
  1454. }
  1455. }
  1456. var PolyNumberFormatter = class {
  1457. constructor(intl, forceSimple, opts) {
  1458. this.padTo = opts.padTo || 0;
  1459. this.floor = opts.floor || false;
  1460. const { padTo, floor, ...otherOpts } = opts;
  1461. if (!forceSimple || Object.keys(otherOpts).length > 0) {
  1462. const intlOpts = { useGrouping: false, ...opts };
  1463. if (opts.padTo > 0)
  1464. intlOpts.minimumIntegerDigits = opts.padTo;
  1465. this.inf = getCachedINF(intl, intlOpts);
  1466. }
  1467. }
  1468. format(i3) {
  1469. if (this.inf) {
  1470. const fixed = this.floor ? Math.floor(i3) : i3;
  1471. return this.inf.format(fixed);
  1472. } else {
  1473. const fixed = this.floor ? Math.floor(i3) : roundTo(i3, 3);
  1474. return padStart(fixed, this.padTo);
  1475. }
  1476. }
  1477. };
  1478. var PolyDateFormatter = class {
  1479. constructor(dt, intl, opts) {
  1480. this.opts = opts;
  1481. let z2;
  1482. if (dt.zone.isUniversal) {
  1483. const gmtOffset = -1 * (dt.offset / 60);
  1484. const offsetZ = gmtOffset >= 0 ? `Etc/GMT+${gmtOffset}` : `Etc/GMT${gmtOffset}`;
  1485. if (dt.offset !== 0 && IANAZone.create(offsetZ).valid) {
  1486. z2 = offsetZ;
  1487. this.dt = dt;
  1488. } else {
  1489. z2 = "UTC";
  1490. if (opts.timeZoneName) {
  1491. this.dt = dt;
  1492. } else {
  1493. this.dt = dt.offset === 0 ? dt : DateTime.fromMillis(dt.ts + dt.offset * 60 * 1e3);
  1494. }
  1495. }
  1496. } else if (dt.zone.type === "system") {
  1497. this.dt = dt;
  1498. } else {
  1499. this.dt = dt;
  1500. z2 = dt.zone.name;
  1501. }
  1502. const intlOpts = { ...this.opts };
  1503. if (z2) {
  1504. intlOpts.timeZone = z2;
  1505. }
  1506. this.dtf = getCachedDTF(intl, intlOpts);
  1507. }
  1508. format() {
  1509. return this.dtf.format(this.dt.toJSDate());
  1510. }
  1511. formatToParts() {
  1512. return this.dtf.formatToParts(this.dt.toJSDate());
  1513. }
  1514. resolvedOptions() {
  1515. return this.dtf.resolvedOptions();
  1516. }
  1517. };
  1518. var PolyRelFormatter = class {
  1519. constructor(intl, isEnglish, opts) {
  1520. this.opts = { style: "long", ...opts };
  1521. if (!isEnglish && hasRelative()) {
  1522. this.rtf = getCachedRTF(intl, opts);
  1523. }
  1524. }
  1525. format(count, unit) {
  1526. if (this.rtf) {
  1527. return this.rtf.format(count, unit);
  1528. } else {
  1529. return formatRelativeTime(unit, count, this.opts.numeric, this.opts.style !== "long");
  1530. }
  1531. }
  1532. formatToParts(count, unit) {
  1533. if (this.rtf) {
  1534. return this.rtf.formatToParts(count, unit);
  1535. } else {
  1536. return [];
  1537. }
  1538. }
  1539. };
  1540. var Locale = class {
  1541. static fromOpts(opts) {
  1542. return Locale.create(opts.locale, opts.numberingSystem, opts.outputCalendar, opts.defaultToEN);
  1543. }
  1544. static create(locale, numberingSystem, outputCalendar, defaultToEN = false) {
  1545. const specifiedLocale = locale || Settings.defaultLocale;
  1546. const localeR = specifiedLocale || (defaultToEN ? "en-US" : systemLocale());
  1547. const numberingSystemR = numberingSystem || Settings.defaultNumberingSystem;
  1548. const outputCalendarR = outputCalendar || Settings.defaultOutputCalendar;
  1549. return new Locale(localeR, numberingSystemR, outputCalendarR, specifiedLocale);
  1550. }
  1551. static resetCache() {
  1552. sysLocaleCache = null;
  1553. intlDTCache = {};
  1554. intlNumCache = {};
  1555. intlRelCache = {};
  1556. }
  1557. static fromObject({ locale, numberingSystem, outputCalendar } = {}) {
  1558. return Locale.create(locale, numberingSystem, outputCalendar);
  1559. }
  1560. constructor(locale, numbering, outputCalendar, specifiedLocale) {
  1561. const [parsedLocale, parsedNumberingSystem, parsedOutputCalendar] = parseLocaleString(locale);
  1562. this.locale = parsedLocale;
  1563. this.numberingSystem = numbering || parsedNumberingSystem || null;
  1564. this.outputCalendar = outputCalendar || parsedOutputCalendar || null;
  1565. this.intl = intlConfigString(this.locale, this.numberingSystem, this.outputCalendar);
  1566. this.weekdaysCache = { format: {}, standalone: {} };
  1567. this.monthsCache = { format: {}, standalone: {} };
  1568. this.meridiemCache = null;
  1569. this.eraCache = {};
  1570. this.specifiedLocale = specifiedLocale;
  1571. this.fastNumbersCached = null;
  1572. }
  1573. get fastNumbers() {
  1574. if (this.fastNumbersCached == null) {
  1575. this.fastNumbersCached = supportsFastNumbers(this);
  1576. }
  1577. return this.fastNumbersCached;
  1578. }
  1579. listingMode() {
  1580. const isActuallyEn = this.isEnglish();
  1581. const hasNoWeirdness = (this.numberingSystem === null || this.numberingSystem === "latn") && (this.outputCalendar === null || this.outputCalendar === "gregory");
  1582. return isActuallyEn && hasNoWeirdness ? "en" : "intl";
  1583. }
  1584. clone(alts) {
  1585. if (!alts || Object.getOwnPropertyNames(alts).length === 0) {
  1586. return this;
  1587. } else {
  1588. return Locale.create(alts.locale || this.specifiedLocale, alts.numberingSystem || this.numberingSystem, alts.outputCalendar || this.outputCalendar, alts.defaultToEN || false);
  1589. }
  1590. }
  1591. redefaultToEN(alts = {}) {
  1592. return this.clone({ ...alts, defaultToEN: true });
  1593. }
  1594. redefaultToSystem(alts = {}) {
  1595. return this.clone({ ...alts, defaultToEN: false });
  1596. }
  1597. months(length, format = false, defaultOK = true) {
  1598. return listStuff(this, length, defaultOK, months, () => {
  1599. const intl = format ? { month: length, day: "numeric" } : { month: length }, formatStr = format ? "format" : "standalone";
  1600. if (!this.monthsCache[formatStr][length]) {
  1601. this.monthsCache[formatStr][length] = mapMonths((dt) => this.extract(dt, intl, "month"));
  1602. }
  1603. return this.monthsCache[formatStr][length];
  1604. });
  1605. }
  1606. weekdays(length, format = false, defaultOK = true) {
  1607. return listStuff(this, length, defaultOK, weekdays, () => {
  1608. const intl = format ? { weekday: length, year: "numeric", month: "long", day: "numeric" } : { weekday: length }, formatStr = format ? "format" : "standalone";
  1609. if (!this.weekdaysCache[formatStr][length]) {
  1610. this.weekdaysCache[formatStr][length] = mapWeekdays((dt) => this.extract(dt, intl, "weekday"));
  1611. }
  1612. return this.weekdaysCache[formatStr][length];
  1613. });
  1614. }
  1615. meridiems(defaultOK = true) {
  1616. return listStuff(this, void 0, defaultOK, () => meridiems, () => {
  1617. if (!this.meridiemCache) {
  1618. const intl = { hour: "numeric", hourCycle: "h12" };
  1619. this.meridiemCache = [DateTime.utc(2016, 11, 13, 9), DateTime.utc(2016, 11, 13, 19)].map((dt) => this.extract(dt, intl, "dayperiod"));
  1620. }
  1621. return this.meridiemCache;
  1622. });
  1623. }
  1624. eras(length, defaultOK = true) {
  1625. return listStuff(this, length, defaultOK, eras, () => {
  1626. const intl = { era: length };
  1627. if (!this.eraCache[length]) {
  1628. this.eraCache[length] = [DateTime.utc(-40, 1, 1), DateTime.utc(2017, 1, 1)].map((dt) => this.extract(dt, intl, "era"));
  1629. }
  1630. return this.eraCache[length];
  1631. });
  1632. }
  1633. extract(dt, intlOpts, field) {
  1634. const df = this.dtFormatter(dt, intlOpts), results = df.formatToParts(), matching = results.find((m4) => m4.type.toLowerCase() === field);
  1635. return matching ? matching.value : null;
  1636. }
  1637. numberFormatter(opts = {}) {
  1638. return new PolyNumberFormatter(this.intl, opts.forceSimple || this.fastNumbers, opts);
  1639. }
  1640. dtFormatter(dt, intlOpts = {}) {
  1641. return new PolyDateFormatter(dt, this.intl, intlOpts);
  1642. }
  1643. relFormatter(opts = {}) {
  1644. return new PolyRelFormatter(this.intl, this.isEnglish(), opts);
  1645. }
  1646. listFormatter(opts = {}) {
  1647. return getCachedLF(this.intl, opts);
  1648. }
  1649. isEnglish() {
  1650. return this.locale === "en" || this.locale.toLowerCase() === "en-us" || new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us");
  1651. }
  1652. equals(other) {
  1653. return this.locale === other.locale && this.numberingSystem === other.numberingSystem && this.outputCalendar === other.outputCalendar;
  1654. }
  1655. };
  1656. // node_modules/luxon/src/impl/regexParser.js
  1657. function combineRegexes(...regexes) {
  1658. const full = regexes.reduce((f3, r) => f3 + r.source, "");
  1659. return RegExp(`^${full}$`);
  1660. }
  1661. function combineExtractors(...extractors) {
  1662. return (m4) => extractors.reduce(([mergedVals, mergedZone, cursor], ex) => {
  1663. const [val, zone, next] = ex(m4, cursor);
  1664. return [{ ...mergedVals, ...val }, zone || mergedZone, next];
  1665. }, [{}, null, 1]).slice(0, 2);
  1666. }
  1667. function parse(s3, ...patterns) {
  1668. if (s3 == null) {
  1669. return [null, null];
  1670. }
  1671. for (const [regex, extractor] of patterns) {
  1672. const m4 = regex.exec(s3);
  1673. if (m4) {
  1674. return extractor(m4);
  1675. }
  1676. }
  1677. return [null, null];
  1678. }
  1679. function simpleParse(...keys) {
  1680. return (match2, cursor) => {
  1681. const ret = {};
  1682. let i3;
  1683. for (i3 = 0; i3 < keys.length; i3++) {
  1684. ret[keys[i3]] = parseInteger(match2[cursor + i3]);
  1685. }
  1686. return [ret, null, cursor + i3];
  1687. };
  1688. }
  1689. var offsetRegex = /(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/;
  1690. var isoExtendedZone = `(?:${offsetRegex.source}?(?:\\[(${ianaRegex.source})\\])?)?`;
  1691. var isoTimeBaseRegex = /(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/;
  1692. var isoTimeRegex = RegExp(`${isoTimeBaseRegex.source}${isoExtendedZone}`);
  1693. var isoTimeExtensionRegex = RegExp(`(?:T${isoTimeRegex.source})?`);
  1694. var isoYmdRegex = /([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/;
  1695. var isoWeekRegex = /(\d{4})-?W(\d\d)(?:-?(\d))?/;
  1696. var isoOrdinalRegex = /(\d{4})-?(\d{3})/;
  1697. var extractISOWeekData = simpleParse("weekYear", "weekNumber", "weekDay");
  1698. var extractISOOrdinalData = simpleParse("year", "ordinal");
  1699. var sqlYmdRegex = /(\d{4})-(\d\d)-(\d\d)/;
  1700. var sqlTimeRegex = RegExp(`${isoTimeBaseRegex.source} ?(?:${offsetRegex.source}|(${ianaRegex.source}))?`);
  1701. var sqlTimeExtensionRegex = RegExp(`(?: ${sqlTimeRegex.source})?`);
  1702. function int(match2, pos, fallback) {
  1703. const m4 = match2[pos];
  1704. return isUndefined(m4) ? fallback : parseInteger(m4);
  1705. }
  1706. function extractISOYmd(match2, cursor) {
  1707. const item = {
  1708. year: int(match2, cursor),
  1709. month: int(match2, cursor + 1, 1),
  1710. day: int(match2, cursor + 2, 1)
  1711. };
  1712. return [item, null, cursor + 3];
  1713. }
  1714. function extractISOTime(match2, cursor) {
  1715. const item = {
  1716. hours: int(match2, cursor, 0),
  1717. minutes: int(match2, cursor + 1, 0),
  1718. seconds: int(match2, cursor + 2, 0),
  1719. milliseconds: parseMillis(match2[cursor + 3])
  1720. };
  1721. return [item, null, cursor + 4];
  1722. }
  1723. function extractISOOffset(match2, cursor) {
  1724. const local = !match2[cursor] && !match2[cursor + 1], fullOffset = signedOffset(match2[cursor + 1], match2[cursor + 2]), zone = local ? null : FixedOffsetZone.instance(fullOffset);
  1725. return [{}, zone, cursor + 3];
  1726. }
  1727. function extractIANAZone(match2, cursor) {
  1728. const zone = match2[cursor] ? IANAZone.create(match2[cursor]) : null;
  1729. return [{}, zone, cursor + 1];
  1730. }
  1731. var isoTimeOnly = RegExp(`^T?${isoTimeBaseRegex.source}$`);
  1732. var isoDuration = /^-?P(?:(?:(-?\d{1,9}(?:\.\d{1,9})?)Y)?(?:(-?\d{1,9}(?:\.\d{1,9})?)M)?(?:(-?\d{1,9}(?:\.\d{1,9})?)W)?(?:(-?\d{1,9}(?:\.\d{1,9})?)D)?(?:T(?:(-?\d{1,9}(?:\.\d{1,9})?)H)?(?:(-?\d{1,9}(?:\.\d{1,9})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,9}))?S)?)?)$/;
  1733. function extractISODuration(match2) {
  1734. const [s3, yearStr, monthStr, weekStr, dayStr, hourStr, minuteStr, secondStr, millisecondsStr] = match2;
  1735. const hasNegativePrefix = s3[0] === "-";
  1736. const negativeSeconds = secondStr && secondStr[0] === "-";
  1737. const maybeNegate = (num, force = false) => num !== void 0 && (force || num && hasNegativePrefix) ? -num : num;
  1738. return [
  1739. {
  1740. years: maybeNegate(parseFloating(yearStr)),
  1741. months: maybeNegate(parseFloating(monthStr)),
  1742. weeks: maybeNegate(parseFloating(weekStr)),
  1743. days: maybeNegate(parseFloating(dayStr)),
  1744. hours: maybeNegate(parseFloating(hourStr)),
  1745. minutes: maybeNegate(parseFloating(minuteStr)),
  1746. seconds: maybeNegate(parseFloating(secondStr), secondStr === "-0"),
  1747. milliseconds: maybeNegate(parseMillis(millisecondsStr), negativeSeconds)
  1748. }
  1749. ];
  1750. }
  1751. var obsOffsets = {
  1752. GMT: 0,
  1753. EDT: -4 * 60,
  1754. EST: -5 * 60,
  1755. CDT: -5 * 60,
  1756. CST: -6 * 60,
  1757. MDT: -6 * 60,
  1758. MST: -7 * 60,
  1759. PDT: -7 * 60,
  1760. PST: -8 * 60
  1761. };
  1762. function fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr) {
  1763. const result = {
  1764. year: yearStr.length === 2 ? untruncateYear(parseInteger(yearStr)) : parseInteger(yearStr),
  1765. month: monthsShort.indexOf(monthStr) + 1,
  1766. day: parseInteger(dayStr),
  1767. hour: parseInteger(hourStr),
  1768. minute: parseInteger(minuteStr)
  1769. };
  1770. if (secondStr)
  1771. result.second = parseInteger(secondStr);
  1772. if (weekdayStr) {
  1773. result.weekday = weekdayStr.length > 3 ? weekdaysLong.indexOf(weekdayStr) + 1 : weekdaysShort.indexOf(weekdayStr) + 1;
  1774. }
  1775. return result;
  1776. }
  1777. var rfc2822 = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;
  1778. function extractRFC2822(match2) {
  1779. const [
  1780. ,
  1781. weekdayStr,
  1782. dayStr,
  1783. monthStr,
  1784. yearStr,
  1785. hourStr,
  1786. minuteStr,
  1787. secondStr,
  1788. obsOffset,
  1789. milOffset,
  1790. offHourStr,
  1791. offMinuteStr
  1792. ] = match2, result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);
  1793. let offset2;
  1794. if (obsOffset) {
  1795. offset2 = obsOffsets[obsOffset];
  1796. } else if (milOffset) {
  1797. offset2 = 0;
  1798. } else {
  1799. offset2 = signedOffset(offHourStr, offMinuteStr);
  1800. }
  1801. return [result, new FixedOffsetZone(offset2)];
  1802. }
  1803. function preprocessRFC2822(s3) {
  1804. return s3.replace(/\([^)]*\)|[\n\t]/g, " ").replace(/(\s\s+)/g, " ").trim();
  1805. }
  1806. var rfc1123 = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/;
  1807. var rfc850 = /^(Monday|Tuesday|Wedsday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/;
  1808. var ascii = /^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;
  1809. function extractRFC1123Or850(match2) {
  1810. const [, weekdayStr, dayStr, monthStr, yearStr, hourStr, minuteStr, secondStr] = match2, result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);
  1811. return [result, FixedOffsetZone.utcInstance];
  1812. }
  1813. function extractASCII(match2) {
  1814. const [, weekdayStr, monthStr, dayStr, hourStr, minuteStr, secondStr, yearStr] = match2, result = fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, secondStr);
  1815. return [result, FixedOffsetZone.utcInstance];
  1816. }
  1817. var isoYmdWithTimeExtensionRegex = combineRegexes(isoYmdRegex, isoTimeExtensionRegex);
  1818. var isoWeekWithTimeExtensionRegex = combineRegexes(isoWeekRegex, isoTimeExtensionRegex);
  1819. var isoOrdinalWithTimeExtensionRegex = combineRegexes(isoOrdinalRegex, isoTimeExtensionRegex);
  1820. var isoTimeCombinedRegex = combineRegexes(isoTimeRegex);
  1821. var extractISOYmdTimeAndOffset = combineExtractors(extractISOYmd, extractISOTime, extractISOOffset, extractIANAZone);
  1822. var extractISOWeekTimeAndOffset = combineExtractors(extractISOWeekData, extractISOTime, extractISOOffset, extractIANAZone);
  1823. var extractISOOrdinalDateAndTime = combineExtractors(extractISOOrdinalData, extractISOTime, extractISOOffset, extractIANAZone);
  1824. var extractISOTimeAndOffset = combineExtractors(extractISOTime, extractISOOffset, extractIANAZone);
  1825. function parseISODate(s3) {
  1826. return parse(s3, [isoYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset], [isoWeekWithTimeExtensionRegex, extractISOWeekTimeAndOffset], [isoOrdinalWithTimeExtensionRegex, extractISOOrdinalDateAndTime], [isoTimeCombinedRegex, extractISOTimeAndOffset]);
  1827. }
  1828. function parseRFC2822Date(s3) {
  1829. return parse(preprocessRFC2822(s3), [rfc2822, extractRFC2822]);
  1830. }
  1831. function parseHTTPDate(s3) {
  1832. return parse(s3, [rfc1123, extractRFC1123Or850], [rfc850, extractRFC1123Or850], [ascii, extractASCII]);
  1833. }
  1834. function parseISODuration(s3) {
  1835. return parse(s3, [isoDuration, extractISODuration]);
  1836. }
  1837. var extractISOTimeOnly = combineExtractors(extractISOTime);
  1838. function parseISOTimeOnly(s3) {
  1839. return parse(s3, [isoTimeOnly, extractISOTimeOnly]);
  1840. }
  1841. var sqlYmdWithTimeExtensionRegex = combineRegexes(sqlYmdRegex, sqlTimeExtensionRegex);
  1842. var sqlTimeCombinedRegex = combineRegexes(sqlTimeRegex);
  1843. var extractISOTimeOffsetAndIANAZone = combineExtractors(extractISOTime, extractISOOffset, extractIANAZone);
  1844. function parseSQL(s3) {
  1845. return parse(s3, [sqlYmdWithTimeExtensionRegex, extractISOYmdTimeAndOffset], [sqlTimeCombinedRegex, extractISOTimeOffsetAndIANAZone]);
  1846. }
  1847. // node_modules/luxon/src/duration.js
  1848. var INVALID = "Invalid Duration";
  1849. var lowOrderMatrix = {
  1850. weeks: {
  1851. days: 7,
  1852. hours: 7 * 24,
  1853. minutes: 7 * 24 * 60,
  1854. seconds: 7 * 24 * 60 * 60,
  1855. milliseconds: 7 * 24 * 60 * 60 * 1e3
  1856. },
  1857. days: {
  1858. hours: 24,
  1859. minutes: 24 * 60,
  1860. seconds: 24 * 60 * 60,
  1861. milliseconds: 24 * 60 * 60 * 1e3
  1862. },
  1863. hours: { minutes: 60, seconds: 60 * 60, milliseconds: 60 * 60 * 1e3 },
  1864. minutes: { seconds: 60, milliseconds: 60 * 1e3 },
  1865. seconds: { milliseconds: 1e3 }
  1866. };
  1867. var casualMatrix = {
  1868. years: {
  1869. quarters: 4,
  1870. months: 12,
  1871. weeks: 52,
  1872. days: 365,
  1873. hours: 365 * 24,
  1874. minutes: 365 * 24 * 60,
  1875. seconds: 365 * 24 * 60 * 60,
  1876. milliseconds: 365 * 24 * 60 * 60 * 1e3
  1877. },
  1878. quarters: {
  1879. months: 3,
  1880. weeks: 13,
  1881. days: 91,
  1882. hours: 91 * 24,
  1883. minutes: 91 * 24 * 60,
  1884. seconds: 91 * 24 * 60 * 60,
  1885. milliseconds: 91 * 24 * 60 * 60 * 1e3
  1886. },
  1887. months: {
  1888. weeks: 4,
  1889. days: 30,
  1890. hours: 30 * 24,
  1891. minutes: 30 * 24 * 60,
  1892. seconds: 30 * 24 * 60 * 60,
  1893. milliseconds: 30 * 24 * 60 * 60 * 1e3
  1894. },
  1895. ...lowOrderMatrix
  1896. };
  1897. var daysInYearAccurate = 146097 / 400;
  1898. var daysInMonthAccurate = 146097 / 4800;
  1899. var accurateMatrix = {
  1900. years: {
  1901. quarters: 4,
  1902. months: 12,
  1903. weeks: daysInYearAccurate / 7,
  1904. days: daysInYearAccurate,
  1905. hours: daysInYearAccurate * 24,
  1906. minutes: daysInYearAccurate * 24 * 60,
  1907. seconds: daysInYearAccurate * 24 * 60 * 60,
  1908. milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1e3
  1909. },
  1910. quarters: {
  1911. months: 3,
  1912. weeks: daysInYearAccurate / 28,
  1913. days: daysInYearAccurate / 4,
  1914. hours: daysInYearAccurate * 24 / 4,
  1915. minutes: daysInYearAccurate * 24 * 60 / 4,
  1916. seconds: daysInYearAccurate * 24 * 60 * 60 / 4,
  1917. milliseconds: daysInYearAccurate * 24 * 60 * 60 * 1e3 / 4
  1918. },
  1919. months: {
  1920. weeks: daysInMonthAccurate / 7,
  1921. days: daysInMonthAccurate,
  1922. hours: daysInMonthAccurate * 24,
  1923. minutes: daysInMonthAccurate * 24 * 60,
  1924. seconds: daysInMonthAccurate * 24 * 60 * 60,
  1925. milliseconds: daysInMonthAccurate * 24 * 60 * 60 * 1e3
  1926. },
  1927. ...lowOrderMatrix
  1928. };
  1929. var orderedUnits = [
  1930. "years",
  1931. "quarters",
  1932. "months",
  1933. "weeks",
  1934. "days",
  1935. "hours",
  1936. "minutes",
  1937. "seconds",
  1938. "milliseconds"
  1939. ];
  1940. var reverseUnits = orderedUnits.slice(0).reverse();
  1941. function clone(dur, alts, clear = false) {
  1942. const conf = {
  1943. values: clear ? alts.values : { ...dur.values, ...alts.values || {} },
  1944. loc: dur.loc.clone(alts.loc),
  1945. conversionAccuracy: alts.conversionAccuracy || dur.conversionAccuracy
  1946. };
  1947. return new Duration(conf);
  1948. }
  1949. function antiTrunc(n3) {
  1950. return n3 < 0 ? Math.floor(n3) : Math.ceil(n3);
  1951. }
  1952. function convert(matrix, fromMap, fromUnit, toMap, toUnit) {
  1953. const conv = matrix[toUnit][fromUnit], raw = fromMap[fromUnit] / conv, sameSign = Math.sign(raw) === Math.sign(toMap[toUnit]), added = !sameSign && toMap[toUnit] !== 0 && Math.abs(raw) <= 1 ? antiTrunc(raw) : Math.trunc(raw);
  1954. toMap[toUnit] += added;
  1955. fromMap[fromUnit] -= added * conv;
  1956. }
  1957. function normalizeValues(matrix, vals) {
  1958. reverseUnits.reduce((previous, current) => {
  1959. if (!isUndefined(vals[current])) {
  1960. if (previous) {
  1961. convert(matrix, vals, previous, vals, current);
  1962. }
  1963. return current;
  1964. } else {
  1965. return previous;
  1966. }
  1967. }, null);
  1968. }
  1969. var Duration = class {
  1970. constructor(config) {
  1971. const accurate = config.conversionAccuracy === "longterm" || false;
  1972. this.values = config.values;
  1973. this.loc = config.loc || Locale.create();
  1974. this.conversionAccuracy = accurate ? "longterm" : "casual";
  1975. this.invalid = config.invalid || null;
  1976. this.matrix = accurate ? accurateMatrix : casualMatrix;
  1977. this.isLuxonDuration = true;
  1978. }
  1979. static fromMillis(count, opts) {
  1980. return Duration.fromObject({ milliseconds: count }, opts);
  1981. }
  1982. static fromObject(obj, opts = {}) {
  1983. if (obj == null || typeof obj !== "object") {
  1984. throw new InvalidArgumentError(`Duration.fromObject: argument expected to be an object, got ${obj === null ? "null" : typeof obj}`);
  1985. }
  1986. return new Duration({
  1987. values: normalizeObject(obj, Duration.normalizeUnit),
  1988. loc: Locale.fromObject(opts),
  1989. conversionAccuracy: opts.conversionAccuracy
  1990. });
  1991. }
  1992. static fromDurationLike(durationLike) {
  1993. if (isNumber(durationLike)) {
  1994. return Duration.fromMillis(durationLike);
  1995. } else if (Duration.isDuration(durationLike)) {
  1996. return durationLike;
  1997. } else if (typeof durationLike === "object") {
  1998. return Duration.fromObject(durationLike);
  1999. } else {
  2000. throw new InvalidArgumentError(`Unknown duration argument ${durationLike} of type ${typeof durationLike}`);
  2001. }
  2002. }
  2003. static fromISO(text, opts) {
  2004. const [parsed] = parseISODuration(text);
  2005. if (parsed) {
  2006. return Duration.fromObject(parsed, opts);
  2007. } else {
  2008. return Duration.invalid("unparsable", `the input "${text}" can't be parsed as ISO 8601`);
  2009. }
  2010. }
  2011. static fromISOTime(text, opts) {
  2012. const [parsed] = parseISOTimeOnly(text);
  2013. if (parsed) {
  2014. return Duration.fromObject(parsed, opts);
  2015. } else {
  2016. return Duration.invalid("unparsable", `the input "${text}" can't be parsed as ISO 8601`);
  2017. }
  2018. }
  2019. static invalid(reason, explanation = null) {
  2020. if (!reason) {
  2021. throw new InvalidArgumentError("need to specify a reason the Duration is invalid");
  2022. }
  2023. const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);
  2024. if (Settings.throwOnInvalid) {
  2025. throw new InvalidDurationError(invalid);
  2026. } else {
  2027. return new Duration({ invalid });
  2028. }
  2029. }
  2030. static normalizeUnit(unit) {
  2031. const normalized = {
  2032. year: "years",
  2033. years: "years",
  2034. quarter: "quarters",
  2035. quarters: "quarters",
  2036. month: "months",
  2037. months: "months",
  2038. week: "weeks",
  2039. weeks: "weeks",
  2040. day: "days",
  2041. days: "days",
  2042. hour: "hours",
  2043. hours: "hours",
  2044. minute: "minutes",
  2045. minutes: "minutes",
  2046. second: "seconds",
  2047. seconds: "seconds",
  2048. millisecond: "milliseconds",
  2049. milliseconds: "milliseconds"
  2050. }[unit ? unit.toLowerCase() : unit];
  2051. if (!normalized)
  2052. throw new InvalidUnitError(unit);
  2053. return normalized;
  2054. }
  2055. static isDuration(o2) {
  2056. return o2 && o2.isLuxonDuration || false;
  2057. }
  2058. get locale() {
  2059. return this.isValid ? this.loc.locale : null;
  2060. }
  2061. get numberingSystem() {
  2062. return this.isValid ? this.loc.numberingSystem : null;
  2063. }
  2064. toFormat(fmt, opts = {}) {
  2065. const fmtOpts = {
  2066. ...opts,
  2067. floor: opts.round !== false && opts.floor !== false
  2068. };
  2069. return this.isValid ? Formatter.create(this.loc, fmtOpts).formatDurationFromString(this, fmt) : INVALID;
  2070. }
  2071. toHuman(opts = {}) {
  2072. const l4 = orderedUnits.map((unit) => {
  2073. const val = this.values[unit];
  2074. if (isUndefined(val)) {
  2075. return null;
  2076. }
  2077. return this.loc.numberFormatter({ style: "unit", unitDisplay: "long", ...opts, unit: unit.slice(0, -1) }).format(val);
  2078. }).filter((n3) => n3);
  2079. return this.loc.listFormatter({ type: "conjunction", style: opts.listStyle || "narrow", ...opts }).format(l4);
  2080. }
  2081. toObject() {
  2082. if (!this.isValid)
  2083. return {};
  2084. return { ...this.values };
  2085. }
  2086. toISO() {
  2087. if (!this.isValid)
  2088. return null;
  2089. let s3 = "P";
  2090. if (this.years !== 0)
  2091. s3 += this.years + "Y";
  2092. if (this.months !== 0 || this.quarters !== 0)
  2093. s3 += this.months + this.quarters * 3 + "M";
  2094. if (this.weeks !== 0)
  2095. s3 += this.weeks + "W";
  2096. if (this.days !== 0)
  2097. s3 += this.days + "D";
  2098. if (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0)
  2099. s3 += "T";
  2100. if (this.hours !== 0)
  2101. s3 += this.hours + "H";
  2102. if (this.minutes !== 0)
  2103. s3 += this.minutes + "M";
  2104. if (this.seconds !== 0 || this.milliseconds !== 0)
  2105. s3 += roundTo(this.seconds + this.milliseconds / 1e3, 3) + "S";
  2106. if (s3 === "P")
  2107. s3 += "T0S";
  2108. return s3;
  2109. }
  2110. toISOTime(opts = {}) {
  2111. if (!this.isValid)
  2112. return null;
  2113. const millis = this.toMillis();
  2114. if (millis < 0 || millis >= 864e5)
  2115. return null;
  2116. opts = {
  2117. suppressMilliseconds: false,
  2118. suppressSeconds: false,
  2119. includePrefix: false,
  2120. format: "extended",
  2121. ...opts
  2122. };
  2123. const value = this.shiftTo("hours", "minutes", "seconds", "milliseconds");
  2124. let fmt = opts.format === "basic" ? "hhmm" : "hh:mm";
  2125. if (!opts.suppressSeconds || value.seconds !== 0 || value.milliseconds !== 0) {
  2126. fmt += opts.format === "basic" ? "ss" : ":ss";
  2127. if (!opts.suppressMilliseconds || value.milliseconds !== 0) {
  2128. fmt += ".SSS";
  2129. }
  2130. }
  2131. let str = value.toFormat(fmt);
  2132. if (opts.includePrefix) {
  2133. str = "T" + str;
  2134. }
  2135. return str;
  2136. }
  2137. toJSON() {
  2138. return this.toISO();
  2139. }
  2140. toString() {
  2141. return this.toISO();
  2142. }
  2143. toMillis() {
  2144. return this.as("milliseconds");
  2145. }
  2146. valueOf() {
  2147. return this.toMillis();
  2148. }
  2149. plus(duration) {
  2150. if (!this.isValid)
  2151. return this;
  2152. const dur = Duration.fromDurationLike(duration), result = {};
  2153. for (const k2 of orderedUnits) {
  2154. if (hasOwnProperty(dur.values, k2) || hasOwnProperty(this.values, k2)) {
  2155. result[k2] = dur.get(k2) + this.get(k2);
  2156. }
  2157. }
  2158. return clone(this, { values: result }, true);
  2159. }
  2160. minus(duration) {
  2161. if (!this.isValid)
  2162. return this;
  2163. const dur = Duration.fromDurationLike(duration);
  2164. return this.plus(dur.negate());
  2165. }
  2166. mapUnits(fn) {
  2167. if (!this.isValid)
  2168. return this;
  2169. const result = {};
  2170. for (const k2 of Object.keys(this.values)) {
  2171. result[k2] = asNumber(fn(this.values[k2], k2));
  2172. }
  2173. return clone(this, { values: result }, true);
  2174. }
  2175. get(unit) {
  2176. return this[Duration.normalizeUnit(unit)];
  2177. }
  2178. set(values) {
  2179. if (!this.isValid)
  2180. return this;
  2181. const mixed = { ...this.values, ...normalizeObject(values, Duration.normalizeUnit) };
  2182. return clone(this, { values: mixed });
  2183. }
  2184. reconfigure({ locale, numberingSystem, conversionAccuracy } = {}) {
  2185. const loc = this.loc.clone({ locale, numberingSystem }), opts = { loc };
  2186. if (conversionAccuracy) {
  2187. opts.conversionAccuracy = conversionAccuracy;
  2188. }
  2189. return clone(this, opts);
  2190. }
  2191. as(unit) {
  2192. return this.isValid ? this.shiftTo(unit).get(unit) : NaN;
  2193. }
  2194. normalize() {
  2195. if (!this.isValid)
  2196. return this;
  2197. const vals = this.toObject();
  2198. normalizeValues(this.matrix, vals);
  2199. return clone(this, { values: vals }, true);
  2200. }
  2201. shiftTo(...units) {
  2202. if (!this.isValid)
  2203. return this;
  2204. if (units.length === 0) {
  2205. return this;
  2206. }
  2207. units = units.map((u) => Duration.normalizeUnit(u));
  2208. const built = {}, accumulated = {}, vals = this.toObject();
  2209. let lastUnit;
  2210. for (const k2 of orderedUnits) {
  2211. if (units.indexOf(k2) >= 0) {
  2212. lastUnit = k2;
  2213. let own = 0;
  2214. for (const ak in accumulated) {
  2215. own += this.matrix[ak][k2] * accumulated[ak];
  2216. accumulated[ak] = 0;
  2217. }
  2218. if (isNumber(vals[k2])) {
  2219. own += vals[k2];
  2220. }
  2221. const i3 = Math.trunc(own);
  2222. built[k2] = i3;
  2223. accumulated[k2] = (own * 1e3 - i3 * 1e3) / 1e3;
  2224. for (const down in vals) {
  2225. if (orderedUnits.indexOf(down) > orderedUnits.indexOf(k2)) {
  2226. convert(this.matrix, vals, down, built, k2);
  2227. }
  2228. }
  2229. } else if (isNumber(vals[k2])) {
  2230. accumulated[k2] = vals[k2];
  2231. }
  2232. }
  2233. for (const key in accumulated) {
  2234. if (accumulated[key] !== 0) {
  2235. built[lastUnit] += key === lastUnit ? accumulated[key] : accumulated[key] / this.matrix[lastUnit][key];
  2236. }
  2237. }
  2238. return clone(this, { values: built }, true).normalize();
  2239. }
  2240. negate() {
  2241. if (!this.isValid)
  2242. return this;
  2243. const negated = {};
  2244. for (const k2 of Object.keys(this.values)) {
  2245. negated[k2] = this.values[k2] === 0 ? 0 : -this.values[k2];
  2246. }
  2247. return clone(this, { values: negated }, true);
  2248. }
  2249. get years() {
  2250. return this.isValid ? this.values.years || 0 : NaN;
  2251. }
  2252. get quarters() {
  2253. return this.isValid ? this.values.quarters || 0 : NaN;
  2254. }
  2255. get months() {
  2256. return this.isValid ? this.values.months || 0 : NaN;
  2257. }
  2258. get weeks() {
  2259. return this.isValid ? this.values.weeks || 0 : NaN;
  2260. }
  2261. get days() {
  2262. return this.isValid ? this.values.days || 0 : NaN;
  2263. }
  2264. get hours() {
  2265. return this.isValid ? this.values.hours || 0 : NaN;
  2266. }
  2267. get minutes() {
  2268. return this.isValid ? this.values.minutes || 0 : NaN;
  2269. }
  2270. get seconds() {
  2271. return this.isValid ? this.values.seconds || 0 : NaN;
  2272. }
  2273. get milliseconds() {
  2274. return this.isValid ? this.values.milliseconds || 0 : NaN;
  2275. }
  2276. get isValid() {
  2277. return this.invalid === null;
  2278. }
  2279. get invalidReason() {
  2280. return this.invalid ? this.invalid.reason : null;
  2281. }
  2282. get invalidExplanation() {
  2283. return this.invalid ? this.invalid.explanation : null;
  2284. }
  2285. equals(other) {
  2286. if (!this.isValid || !other.isValid) {
  2287. return false;
  2288. }
  2289. if (!this.loc.equals(other.loc)) {
  2290. return false;
  2291. }
  2292. function eq(v1, v22) {
  2293. if (v1 === void 0 || v1 === 0)
  2294. return v22 === void 0 || v22 === 0;
  2295. return v1 === v22;
  2296. }
  2297. for (const u of orderedUnits) {
  2298. if (!eq(this.values[u], other.values[u])) {
  2299. return false;
  2300. }
  2301. }
  2302. return true;
  2303. }
  2304. };
  2305. // node_modules/luxon/src/interval.js
  2306. var INVALID2 = "Invalid Interval";
  2307. function validateStartEnd(start, end) {
  2308. if (!start || !start.isValid) {
  2309. return Interval.invalid("missing or invalid start");
  2310. } else if (!end || !end.isValid) {
  2311. return Interval.invalid("missing or invalid end");
  2312. } else if (end < start) {
  2313. return Interval.invalid("end before start", `The end of an interval must be after its start, but you had start=${start.toISO()} and end=${end.toISO()}`);
  2314. } else {
  2315. return null;
  2316. }
  2317. }
  2318. var Interval = class {
  2319. constructor(config) {
  2320. this.s = config.start;
  2321. this.e = config.end;
  2322. this.invalid = config.invalid || null;
  2323. this.isLuxonInterval = true;
  2324. }
  2325. static invalid(reason, explanation = null) {
  2326. if (!reason) {
  2327. throw new InvalidArgumentError("need to specify a reason the Interval is invalid");
  2328. }
  2329. const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);
  2330. if (Settings.throwOnInvalid) {
  2331. throw new InvalidIntervalError(invalid);
  2332. } else {
  2333. return new Interval({ invalid });
  2334. }
  2335. }
  2336. static fromDateTimes(start, end) {
  2337. const builtStart = friendlyDateTime(start), builtEnd = friendlyDateTime(end);
  2338. const validateError = validateStartEnd(builtStart, builtEnd);
  2339. if (validateError == null) {
  2340. return new Interval({
  2341. start: builtStart,
  2342. end: builtEnd
  2343. });
  2344. } else {
  2345. return validateError;
  2346. }
  2347. }
  2348. static after(start, duration) {
  2349. const dur = Duration.fromDurationLike(duration), dt = friendlyDateTime(start);
  2350. return Interval.fromDateTimes(dt, dt.plus(dur));
  2351. }
  2352. static before(end, duration) {
  2353. const dur = Duration.fromDurationLike(duration), dt = friendlyDateTime(end);
  2354. return Interval.fromDateTimes(dt.minus(dur), dt);
  2355. }
  2356. static fromISO(text, opts) {
  2357. const [s3, e] = (text || "").split("/", 2);
  2358. if (s3 && e) {
  2359. let start, startIsValid;
  2360. try {
  2361. start = DateTime.fromISO(s3, opts);
  2362. startIsValid = start.isValid;
  2363. } catch (e2) {
  2364. startIsValid = false;
  2365. }
  2366. let end, endIsValid;
  2367. try {
  2368. end = DateTime.fromISO(e, opts);
  2369. endIsValid = end.isValid;
  2370. } catch (e2) {
  2371. endIsValid = false;
  2372. }
  2373. if (startIsValid && endIsValid) {
  2374. return Interval.fromDateTimes(start, end);
  2375. }
  2376. if (startIsValid) {
  2377. const dur = Duration.fromISO(e, opts);
  2378. if (dur.isValid) {
  2379. return Interval.after(start, dur);
  2380. }
  2381. } else if (endIsValid) {
  2382. const dur = Duration.fromISO(s3, opts);
  2383. if (dur.isValid) {
  2384. return Interval.before(end, dur);
  2385. }
  2386. }
  2387. }
  2388. return Interval.invalid("unparsable", `the input "${text}" can't be parsed as ISO 8601`);
  2389. }
  2390. static isInterval(o2) {
  2391. return o2 && o2.isLuxonInterval || false;
  2392. }
  2393. get start() {
  2394. return this.isValid ? this.s : null;
  2395. }
  2396. get end() {
  2397. return this.isValid ? this.e : null;
  2398. }
  2399. get isValid() {
  2400. return this.invalidReason === null;
  2401. }
  2402. get invalidReason() {
  2403. return this.invalid ? this.invalid.reason : null;
  2404. }
  2405. get invalidExplanation() {
  2406. return this.invalid ? this.invalid.explanation : null;
  2407. }
  2408. length(unit = "milliseconds") {
  2409. return this.isValid ? this.toDuration(...[unit]).get(unit) : NaN;
  2410. }
  2411. count(unit = "milliseconds") {
  2412. if (!this.isValid)
  2413. return NaN;
  2414. const start = this.start.startOf(unit), end = this.end.startOf(unit);
  2415. return Math.floor(end.diff(start, unit).get(unit)) + 1;
  2416. }
  2417. hasSame(unit) {
  2418. return this.isValid ? this.isEmpty() || this.e.minus(1).hasSame(this.s, unit) : false;
  2419. }
  2420. isEmpty() {
  2421. return this.s.valueOf() === this.e.valueOf();
  2422. }
  2423. isAfter(dateTime) {
  2424. if (!this.isValid)
  2425. return false;
  2426. return this.s > dateTime;
  2427. }
  2428. isBefore(dateTime) {
  2429. if (!this.isValid)
  2430. return false;
  2431. return this.e <= dateTime;
  2432. }
  2433. contains(dateTime) {
  2434. if (!this.isValid)
  2435. return false;
  2436. return this.s <= dateTime && this.e > dateTime;
  2437. }
  2438. set({ start, end } = {}) {
  2439. if (!this.isValid)
  2440. return this;
  2441. return Interval.fromDateTimes(start || this.s, end || this.e);
  2442. }
  2443. splitAt(...dateTimes) {
  2444. if (!this.isValid)
  2445. return [];
  2446. const sorted = dateTimes.map(friendlyDateTime).filter((d2) => this.contains(d2)).sort(), results = [];
  2447. let { s: s3 } = this, i3 = 0;
  2448. while (s3 < this.e) {
  2449. const added = sorted[i3] || this.e, next = +added > +this.e ? this.e : added;
  2450. results.push(Interval.fromDateTimes(s3, next));
  2451. s3 = next;
  2452. i3 += 1;
  2453. }
  2454. return results;
  2455. }
  2456. splitBy(duration) {
  2457. const dur = Duration.fromDurationLike(duration);
  2458. if (!this.isValid || !dur.isValid || dur.as("milliseconds") === 0) {
  2459. return [];
  2460. }
  2461. let { s: s3 } = this, idx = 1, next;
  2462. const results = [];
  2463. while (s3 < this.e) {
  2464. const added = this.start.plus(dur.mapUnits((x2) => x2 * idx));
  2465. next = +added > +this.e ? this.e : added;
  2466. results.push(Interval.fromDateTimes(s3, next));
  2467. s3 = next;
  2468. idx += 1;
  2469. }
  2470. return results;
  2471. }
  2472. divideEqually(numberOfParts) {
  2473. if (!this.isValid)
  2474. return [];
  2475. return this.splitBy(this.length() / numberOfParts).slice(0, numberOfParts);
  2476. }
  2477. overlaps(other) {
  2478. return this.e > other.s && this.s < other.e;
  2479. }
  2480. abutsStart(other) {
  2481. if (!this.isValid)
  2482. return false;
  2483. return +this.e === +other.s;
  2484. }
  2485. abutsEnd(other) {
  2486. if (!this.isValid)
  2487. return false;
  2488. return +other.e === +this.s;
  2489. }
  2490. engulfs(other) {
  2491. if (!this.isValid)
  2492. return false;
  2493. return this.s <= other.s && this.e >= other.e;
  2494. }
  2495. equals(other) {
  2496. if (!this.isValid || !other.isValid) {
  2497. return false;
  2498. }
  2499. return this.s.equals(other.s) && this.e.equals(other.e);
  2500. }
  2501. intersection(other) {
  2502. if (!this.isValid)
  2503. return this;
  2504. const s3 = this.s > other.s ? this.s : other.s, e = this.e < other.e ? this.e : other.e;
  2505. if (s3 >= e) {
  2506. return null;
  2507. } else {
  2508. return Interval.fromDateTimes(s3, e);
  2509. }
  2510. }
  2511. union(other) {
  2512. if (!this.isValid)
  2513. return this;
  2514. const s3 = this.s < other.s ? this.s : other.s, e = this.e > other.e ? this.e : other.e;
  2515. return Interval.fromDateTimes(s3, e);
  2516. }
  2517. static merge(intervals) {
  2518. const [found, final] = intervals.sort((a, b3) => a.s - b3.s).reduce(([sofar, current], item) => {
  2519. if (!current) {
  2520. return [sofar, item];
  2521. } else if (current.overlaps(item) || current.abutsStart(item)) {
  2522. return [sofar, current.union(item)];
  2523. } else {
  2524. return [sofar.concat([current]), item];
  2525. }
  2526. }, [[], null]);
  2527. if (final) {
  2528. found.push(final);
  2529. }
  2530. return found;
  2531. }
  2532. static xor(intervals) {
  2533. let start = null, currentCount = 0;
  2534. const results = [], ends = intervals.map((i3) => [
  2535. { time: i3.s, type: "s" },
  2536. { time: i3.e, type: "e" }
  2537. ]), flattened = Array.prototype.concat(...ends), arr = flattened.sort((a, b3) => a.time - b3.time);
  2538. for (const i3 of arr) {
  2539. currentCount += i3.type === "s" ? 1 : -1;
  2540. if (currentCount === 1) {
  2541. start = i3.time;
  2542. } else {
  2543. if (start && +start !== +i3.time) {
  2544. results.push(Interval.fromDateTimes(start, i3.time));
  2545. }
  2546. start = null;
  2547. }
  2548. }
  2549. return Interval.merge(results);
  2550. }
  2551. difference(...intervals) {
  2552. return Interval.xor([this].concat(intervals)).map((i3) => this.intersection(i3)).filter((i3) => i3 && !i3.isEmpty());
  2553. }
  2554. toString() {
  2555. if (!this.isValid)
  2556. return INVALID2;
  2557. return `[${this.s.toISO()} \u2013 ${this.e.toISO()})`;
  2558. }
  2559. toISO(opts) {
  2560. if (!this.isValid)
  2561. return INVALID2;
  2562. return `${this.s.toISO(opts)}/${this.e.toISO(opts)}`;
  2563. }
  2564. toISODate() {
  2565. if (!this.isValid)
  2566. return INVALID2;
  2567. return `${this.s.toISODate()}/${this.e.toISODate()}`;
  2568. }
  2569. toISOTime(opts) {
  2570. if (!this.isValid)
  2571. return INVALID2;
  2572. return `${this.s.toISOTime(opts)}/${this.e.toISOTime(opts)}`;
  2573. }
  2574. toFormat(dateFormat, { separator = " \u2013 " } = {}) {
  2575. if (!this.isValid)
  2576. return INVALID2;
  2577. return `${this.s.toFormat(dateFormat)}${separator}${this.e.toFormat(dateFormat)}`;
  2578. }
  2579. toDuration(unit, opts) {
  2580. if (!this.isValid) {
  2581. return Duration.invalid(this.invalidReason);
  2582. }
  2583. return this.e.diff(this.s, unit, opts);
  2584. }
  2585. mapEndpoints(mapFn) {
  2586. return Interval.fromDateTimes(mapFn(this.s), mapFn(this.e));
  2587. }
  2588. };
  2589. // node_modules/luxon/src/info.js
  2590. var Info = class {
  2591. static hasDST(zone = Settings.defaultZone) {
  2592. const proto = DateTime.now().setZone(zone).set({ month: 12 });
  2593. return !zone.isUniversal && proto.offset !== proto.set({ month: 6 }).offset;
  2594. }
  2595. static isValidIANAZone(zone) {
  2596. return IANAZone.isValidZone(zone);
  2597. }
  2598. static normalizeZone(input) {
  2599. return normalizeZone(input, Settings.defaultZone);
  2600. }
  2601. static months(length = "long", { locale = null, numberingSystem = null, locObj = null, outputCalendar = "gregory" } = {}) {
  2602. return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length);
  2603. }
  2604. static monthsFormat(length = "long", { locale = null, numberingSystem = null, locObj = null, outputCalendar = "gregory" } = {}) {
  2605. return (locObj || Locale.create(locale, numberingSystem, outputCalendar)).months(length, true);
  2606. }
  2607. static weekdays(length = "long", { locale = null, numberingSystem = null, locObj = null } = {}) {
  2608. return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length);
  2609. }
  2610. static weekdaysFormat(length = "long", { locale = null, numberingSystem = null, locObj = null } = {}) {
  2611. return (locObj || Locale.create(locale, numberingSystem, null)).weekdays(length, true);
  2612. }
  2613. static meridiems({ locale = null } = {}) {
  2614. return Locale.create(locale).meridiems();
  2615. }
  2616. static eras(length = "short", { locale = null } = {}) {
  2617. return Locale.create(locale, null, "gregory").eras(length);
  2618. }
  2619. static features() {
  2620. return { relative: hasRelative() };
  2621. }
  2622. };
  2623. // node_modules/luxon/src/impl/diff.js
  2624. function dayDiff(earlier, later) {
  2625. const utcDayStart = (dt) => dt.toUTC(0, { keepLocalTime: true }).startOf("day").valueOf(), ms = utcDayStart(later) - utcDayStart(earlier);
  2626. return Math.floor(Duration.fromMillis(ms).as("days"));
  2627. }
  2628. function highOrderDiffs(cursor, later, units) {
  2629. const differs = [
  2630. ["years", (a, b3) => b3.year - a.year],
  2631. ["quarters", (a, b3) => b3.quarter - a.quarter],
  2632. ["months", (a, b3) => b3.month - a.month + (b3.year - a.year) * 12],
  2633. [
  2634. "weeks",
  2635. (a, b3) => {
  2636. const days = dayDiff(a, b3);
  2637. return (days - days % 7) / 7;
  2638. }
  2639. ],
  2640. ["days", dayDiff]
  2641. ];
  2642. const results = {};
  2643. let lowestOrder, highWater;
  2644. for (const [unit, differ] of differs) {
  2645. if (units.indexOf(unit) >= 0) {
  2646. lowestOrder = unit;
  2647. let delta = differ(cursor, later);
  2648. highWater = cursor.plus({ [unit]: delta });
  2649. if (highWater > later) {
  2650. cursor = cursor.plus({ [unit]: delta - 1 });
  2651. delta -= 1;
  2652. } else {
  2653. cursor = highWater;
  2654. }
  2655. results[unit] = delta;
  2656. }
  2657. }
  2658. return [cursor, results, highWater, lowestOrder];
  2659. }
  2660. function diff_default(earlier, later, units, opts) {
  2661. let [cursor, results, highWater, lowestOrder] = highOrderDiffs(earlier, later, units);
  2662. const remainingMillis = later - cursor;
  2663. const lowerOrderUnits = units.filter((u) => ["hours", "minutes", "seconds", "milliseconds"].indexOf(u) >= 0);
  2664. if (lowerOrderUnits.length === 0) {
  2665. if (highWater < later) {
  2666. highWater = cursor.plus({ [lowestOrder]: 1 });
  2667. }
  2668. if (highWater !== cursor) {
  2669. results[lowestOrder] = (results[lowestOrder] || 0) + remainingMillis / (highWater - cursor);
  2670. }
  2671. }
  2672. const duration = Duration.fromObject(results, opts);
  2673. if (lowerOrderUnits.length > 0) {
  2674. return Duration.fromMillis(remainingMillis, opts).shiftTo(...lowerOrderUnits).plus(duration);
  2675. } else {
  2676. return duration;
  2677. }
  2678. }
  2679. // node_modules/luxon/src/impl/digits.js
  2680. var numberingSystems = {
  2681. arab: "[\u0660-\u0669]",
  2682. arabext: "[\u06F0-\u06F9]",
  2683. bali: "[\u1B50-\u1B59]",
  2684. beng: "[\u09E6-\u09EF]",
  2685. deva: "[\u0966-\u096F]",
  2686. fullwide: "[\uFF10-\uFF19]",
  2687. gujr: "[\u0AE6-\u0AEF]",
  2688. hanidec: "[\u3007|\u4E00|\u4E8C|\u4E09|\u56DB|\u4E94|\u516D|\u4E03|\u516B|\u4E5D]",
  2689. khmr: "[\u17E0-\u17E9]",
  2690. knda: "[\u0CE6-\u0CEF]",
  2691. laoo: "[\u0ED0-\u0ED9]",
  2692. limb: "[\u1946-\u194F]",
  2693. mlym: "[\u0D66-\u0D6F]",
  2694. mong: "[\u1810-\u1819]",
  2695. mymr: "[\u1040-\u1049]",
  2696. orya: "[\u0B66-\u0B6F]",
  2697. tamldec: "[\u0BE6-\u0BEF]",
  2698. telu: "[\u0C66-\u0C6F]",
  2699. thai: "[\u0E50-\u0E59]",
  2700. tibt: "[\u0F20-\u0F29]",
  2701. latn: "\\d"
  2702. };
  2703. var numberingSystemsUTF16 = {
  2704. arab: [1632, 1641],
  2705. arabext: [1776, 1785],
  2706. bali: [6992, 7001],
  2707. beng: [2534, 2543],
  2708. deva: [2406, 2415],
  2709. fullwide: [65296, 65303],
  2710. gujr: [2790, 2799],
  2711. khmr: [6112, 6121],
  2712. knda: [3302, 3311],
  2713. laoo: [3792, 3801],
  2714. limb: [6470, 6479],
  2715. mlym: [3430, 3439],
  2716. mong: [6160, 6169],
  2717. mymr: [4160, 4169],
  2718. orya: [2918, 2927],
  2719. tamldec: [3046, 3055],
  2720. telu: [3174, 3183],
  2721. thai: [3664, 3673],
  2722. tibt: [3872, 3881]
  2723. };
  2724. var hanidecChars = numberingSystems.hanidec.replace(/[\[|\]]/g, "").split("");
  2725. function parseDigits(str) {
  2726. let value = parseInt(str, 10);
  2727. if (isNaN(value)) {
  2728. value = "";
  2729. for (let i3 = 0; i3 < str.length; i3++) {
  2730. const code = str.charCodeAt(i3);
  2731. if (str[i3].search(numberingSystems.hanidec) !== -1) {
  2732. value += hanidecChars.indexOf(str[i3]);
  2733. } else {
  2734. for (const key in numberingSystemsUTF16) {
  2735. const [min, max] = numberingSystemsUTF16[key];
  2736. if (code >= min && code <= max) {
  2737. value += code - min;
  2738. }
  2739. }
  2740. }
  2741. }
  2742. return parseInt(value, 10);
  2743. } else {
  2744. return value;
  2745. }
  2746. }
  2747. function digitRegex({ numberingSystem }, append = "") {
  2748. return new RegExp(`${numberingSystems[numberingSystem || "latn"]}${append}`);
  2749. }
  2750. // node_modules/luxon/src/impl/tokenParser.js
  2751. var MISSING_FTP = "missing Intl.DateTimeFormat.formatToParts support";
  2752. function intUnit(regex, post = (i3) => i3) {
  2753. return { regex, deser: ([s3]) => post(parseDigits(s3)) };
  2754. }
  2755. var NBSP = String.fromCharCode(160);
  2756. var spaceOrNBSP = `[ ${NBSP}]`;
  2757. var spaceOrNBSPRegExp = new RegExp(spaceOrNBSP, "g");
  2758. function fixListRegex(s3) {
  2759. return s3.replace(/\./g, "\\.?").replace(spaceOrNBSPRegExp, spaceOrNBSP);
  2760. }
  2761. function stripInsensitivities(s3) {
  2762. return s3.replace(/\./g, "").replace(spaceOrNBSPRegExp, " ").toLowerCase();
  2763. }
  2764. function oneOf(strings, startIndex) {
  2765. if (strings === null) {
  2766. return null;
  2767. } else {
  2768. return {
  2769. regex: RegExp(strings.map(fixListRegex).join("|")),
  2770. deser: ([s3]) => strings.findIndex((i3) => stripInsensitivities(s3) === stripInsensitivities(i3)) + startIndex
  2771. };
  2772. }
  2773. }
  2774. function offset(regex, groups) {
  2775. return { regex, deser: ([, h2, m4]) => signedOffset(h2, m4), groups };
  2776. }
  2777. function simple(regex) {
  2778. return { regex, deser: ([s3]) => s3 };
  2779. }
  2780. function escapeToken(value) {
  2781. return value.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
  2782. }
  2783. function unitForToken(token, loc) {
  2784. const one = digitRegex(loc), two = digitRegex(loc, "{2}"), three = digitRegex(loc, "{3}"), four = digitRegex(loc, "{4}"), six = digitRegex(loc, "{6}"), oneOrTwo = digitRegex(loc, "{1,2}"), oneToThree = digitRegex(loc, "{1,3}"), oneToSix = digitRegex(loc, "{1,6}"), oneToNine = digitRegex(loc, "{1,9}"), twoToFour = digitRegex(loc, "{2,4}"), fourToSix = digitRegex(loc, "{4,6}"), literal = (t5) => ({ regex: RegExp(escapeToken(t5.val)), deser: ([s3]) => s3, literal: true }), unitate = (t5) => {
  2785. if (token.literal) {
  2786. return literal(t5);
  2787. }
  2788. switch (t5.val) {
  2789. case "G":
  2790. return oneOf(loc.eras("short", false), 0);
  2791. case "GG":
  2792. return oneOf(loc.eras("long", false), 0);
  2793. case "y":
  2794. return intUnit(oneToSix);
  2795. case "yy":
  2796. return intUnit(twoToFour, untruncateYear);
  2797. case "yyyy":
  2798. return intUnit(four);
  2799. case "yyyyy":
  2800. return intUnit(fourToSix);
  2801. case "yyyyyy":
  2802. return intUnit(six);
  2803. case "M":
  2804. return intUnit(oneOrTwo);
  2805. case "MM":
  2806. return intUnit(two);
  2807. case "MMM":
  2808. return oneOf(loc.months("short", true, false), 1);
  2809. case "MMMM":
  2810. return oneOf(loc.months("long", true, false), 1);
  2811. case "L":
  2812. return intUnit(oneOrTwo);
  2813. case "LL":
  2814. return intUnit(two);
  2815. case "LLL":
  2816. return oneOf(loc.months("short", false, false), 1);
  2817. case "LLLL":
  2818. return oneOf(loc.months("long", false, false), 1);
  2819. case "d":
  2820. return intUnit(oneOrTwo);
  2821. case "dd":
  2822. return intUnit(two);
  2823. case "o":
  2824. return intUnit(oneToThree);
  2825. case "ooo":
  2826. return intUnit(three);
  2827. case "HH":
  2828. return intUnit(two);
  2829. case "H":
  2830. return intUnit(oneOrTwo);
  2831. case "hh":
  2832. return intUnit(two);
  2833. case "h":
  2834. return intUnit(oneOrTwo);
  2835. case "mm":
  2836. return intUnit(two);
  2837. case "m":
  2838. return intUnit(oneOrTwo);
  2839. case "q":
  2840. return intUnit(oneOrTwo);
  2841. case "qq":
  2842. return intUnit(two);
  2843. case "s":
  2844. return intUnit(oneOrTwo);
  2845. case "ss":
  2846. return intUnit(two);
  2847. case "S":
  2848. return intUnit(oneToThree);
  2849. case "SSS":
  2850. return intUnit(three);
  2851. case "u":
  2852. return simple(oneToNine);
  2853. case "uu":
  2854. return simple(oneOrTwo);
  2855. case "uuu":
  2856. return intUnit(one);
  2857. case "a":
  2858. return oneOf(loc.meridiems(), 0);
  2859. case "kkkk":
  2860. return intUnit(four);
  2861. case "kk":
  2862. return intUnit(twoToFour, untruncateYear);
  2863. case "W":
  2864. return intUnit(oneOrTwo);
  2865. case "WW":
  2866. return intUnit(two);
  2867. case "E":
  2868. case "c":
  2869. return intUnit(one);
  2870. case "EEE":
  2871. return oneOf(loc.weekdays("short", false, false), 1);
  2872. case "EEEE":
  2873. return oneOf(loc.weekdays("long", false, false), 1);
  2874. case "ccc":
  2875. return oneOf(loc.weekdays("short", true, false), 1);
  2876. case "cccc":
  2877. return oneOf(loc.weekdays("long", true, false), 1);
  2878. case "Z":
  2879. case "ZZ":
  2880. return offset(new RegExp(`([+-]${oneOrTwo.source})(?::(${two.source}))?`), 2);
  2881. case "ZZZ":
  2882. return offset(new RegExp(`([+-]${oneOrTwo.source})(${two.source})?`), 2);
  2883. case "z":
  2884. return simple(/[a-z_+-/]{1,256}?/i);
  2885. default:
  2886. return literal(t5);
  2887. }
  2888. };
  2889. const unit = unitate(token) || {
  2890. invalidReason: MISSING_FTP
  2891. };
  2892. unit.token = token;
  2893. return unit;
  2894. }
  2895. var partTypeStyleToTokenVal = {
  2896. year: {
  2897. "2-digit": "yy",
  2898. numeric: "yyyyy"
  2899. },
  2900. month: {
  2901. numeric: "M",
  2902. "2-digit": "MM",
  2903. short: "MMM",
  2904. long: "MMMM"
  2905. },
  2906. day: {
  2907. numeric: "d",
  2908. "2-digit": "dd"
  2909. },
  2910. weekday: {
  2911. short: "EEE",
  2912. long: "EEEE"
  2913. },
  2914. dayperiod: "a",
  2915. dayPeriod: "a",
  2916. hour: {
  2917. numeric: "h",
  2918. "2-digit": "hh"
  2919. },
  2920. minute: {
  2921. numeric: "m",
  2922. "2-digit": "mm"
  2923. },
  2924. second: {
  2925. numeric: "s",
  2926. "2-digit": "ss"
  2927. }
  2928. };
  2929. function tokenForPart(part, locale, formatOpts) {
  2930. const { type, value } = part;
  2931. if (type === "literal") {
  2932. return {
  2933. literal: true,
  2934. val: value
  2935. };
  2936. }
  2937. const style = formatOpts[type];
  2938. let val = partTypeStyleToTokenVal[type];
  2939. if (typeof val === "object") {
  2940. val = val[style];
  2941. }
  2942. if (val) {
  2943. return {
  2944. literal: false,
  2945. val
  2946. };
  2947. }
  2948. return void 0;
  2949. }
  2950. function buildRegex(units) {
  2951. const re2 = units.map((u) => u.regex).reduce((f3, r) => `${f3}(${r.source})`, "");
  2952. return [`^${re2}$`, units];
  2953. }
  2954. function match(input, regex, handlers) {
  2955. const matches = input.match(regex);
  2956. if (matches) {
  2957. const all = {};
  2958. let matchIndex = 1;
  2959. for (const i3 in handlers) {
  2960. if (hasOwnProperty(handlers, i3)) {
  2961. const h2 = handlers[i3], groups = h2.groups ? h2.groups + 1 : 1;
  2962. if (!h2.literal && h2.token) {
  2963. all[h2.token.val[0]] = h2.deser(matches.slice(matchIndex, matchIndex + groups));
  2964. }
  2965. matchIndex += groups;
  2966. }
  2967. }
  2968. return [matches, all];
  2969. } else {
  2970. return [matches, {}];
  2971. }
  2972. }
  2973. function dateTimeFromMatches(matches) {
  2974. const toField = (token) => {
  2975. switch (token) {
  2976. case "S":
  2977. return "millisecond";
  2978. case "s":
  2979. return "second";
  2980. case "m":
  2981. return "minute";
  2982. case "h":
  2983. case "H":
  2984. return "hour";
  2985. case "d":
  2986. return "day";
  2987. case "o":
  2988. return "ordinal";
  2989. case "L":
  2990. case "M":
  2991. return "month";
  2992. case "y":
  2993. return "year";
  2994. case "E":
  2995. case "c":
  2996. return "weekday";
  2997. case "W":
  2998. return "weekNumber";
  2999. case "k":
  3000. return "weekYear";
  3001. case "q":
  3002. return "quarter";
  3003. default:
  3004. return null;
  3005. }
  3006. };
  3007. let zone = null;
  3008. let specificOffset;
  3009. if (!isUndefined(matches.z)) {
  3010. zone = IANAZone.create(matches.z);
  3011. }
  3012. if (!isUndefined(matches.Z)) {
  3013. if (!zone) {
  3014. zone = new FixedOffsetZone(matches.Z);
  3015. }
  3016. specificOffset = matches.Z;
  3017. }
  3018. if (!isUndefined(matches.q)) {
  3019. matches.M = (matches.q - 1) * 3 + 1;
  3020. }
  3021. if (!isUndefined(matches.h)) {
  3022. if (matches.h < 12 && matches.a === 1) {
  3023. matches.h += 12;
  3024. } else if (matches.h === 12 && matches.a === 0) {
  3025. matches.h = 0;
  3026. }
  3027. }
  3028. if (matches.G === 0 && matches.y) {
  3029. matches.y = -matches.y;
  3030. }
  3031. if (!isUndefined(matches.u)) {
  3032. matches.S = parseMillis(matches.u);
  3033. }
  3034. const vals = Object.keys(matches).reduce((r, k2) => {
  3035. const f3 = toField(k2);
  3036. if (f3) {
  3037. r[f3] = matches[k2];
  3038. }
  3039. return r;
  3040. }, {});
  3041. return [vals, zone, specificOffset];
  3042. }
  3043. var dummyDateTimeCache = null;
  3044. function getDummyDateTime() {
  3045. if (!dummyDateTimeCache) {
  3046. dummyDateTimeCache = DateTime.fromMillis(1555555555555);
  3047. }
  3048. return dummyDateTimeCache;
  3049. }
  3050. function maybeExpandMacroToken(token, locale) {
  3051. if (token.literal) {
  3052. return token;
  3053. }
  3054. const formatOpts = Formatter.macroTokenToFormatOpts(token.val);
  3055. if (!formatOpts) {
  3056. return token;
  3057. }
  3058. const formatter = Formatter.create(locale, formatOpts);
  3059. const parts = formatter.formatDateTimeParts(getDummyDateTime());
  3060. const tokens = parts.map((p4) => tokenForPart(p4, locale, formatOpts));
  3061. if (tokens.includes(void 0)) {
  3062. return token;
  3063. }
  3064. return tokens;
  3065. }
  3066. function expandMacroTokens(tokens, locale) {
  3067. return Array.prototype.concat(...tokens.map((t5) => maybeExpandMacroToken(t5, locale)));
  3068. }
  3069. function explainFromTokens(locale, input, format) {
  3070. const tokens = expandMacroTokens(Formatter.parseFormat(format), locale), units = tokens.map((t5) => unitForToken(t5, locale)), disqualifyingUnit = units.find((t5) => t5.invalidReason);
  3071. if (disqualifyingUnit) {
  3072. return { input, tokens, invalidReason: disqualifyingUnit.invalidReason };
  3073. } else {
  3074. const [regexString, handlers] = buildRegex(units), regex = RegExp(regexString, "i"), [rawMatches, matches] = match(input, regex, handlers), [result, zone, specificOffset] = matches ? dateTimeFromMatches(matches) : [null, null, void 0];
  3075. if (hasOwnProperty(matches, "a") && hasOwnProperty(matches, "H")) {
  3076. throw new ConflictingSpecificationError("Can't include meridiem when specifying 24-hour format");
  3077. }
  3078. return { input, tokens, regex, rawMatches, matches, result, zone, specificOffset };
  3079. }
  3080. }
  3081. function parseFromTokens(locale, input, format) {
  3082. const { result, zone, specificOffset, invalidReason } = explainFromTokens(locale, input, format);
  3083. return [result, zone, specificOffset, invalidReason];
  3084. }
  3085. // node_modules/luxon/src/impl/conversions.js
  3086. var nonLeapLadder = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334];
  3087. var leapLadder = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335];
  3088. function unitOutOfRange(unit, value) {
  3089. return new Invalid("unit out of range", `you specified ${value} (of type ${typeof value}) as a ${unit}, which is invalid`);
  3090. }
  3091. function dayOfWeek(year, month, day) {
  3092. const d2 = new Date(Date.UTC(year, month - 1, day));
  3093. if (year < 100 && year >= 0) {
  3094. d2.setUTCFullYear(d2.getUTCFullYear() - 1900);
  3095. }
  3096. const js = d2.getUTCDay();
  3097. return js === 0 ? 7 : js;
  3098. }
  3099. function computeOrdinal(year, month, day) {
  3100. return day + (isLeapYear(year) ? leapLadder : nonLeapLadder)[month - 1];
  3101. }
  3102. function uncomputeOrdinal(year, ordinal) {
  3103. const table = isLeapYear(year) ? leapLadder : nonLeapLadder, month0 = table.findIndex((i3) => i3 < ordinal), day = ordinal - table[month0];
  3104. return { month: month0 + 1, day };
  3105. }
  3106. function gregorianToWeek(gregObj) {
  3107. const { year, month, day } = gregObj, ordinal = computeOrdinal(year, month, day), weekday = dayOfWeek(year, month, day);
  3108. let weekNumber = Math.floor((ordinal - weekday + 10) / 7), weekYear;
  3109. if (weekNumber < 1) {
  3110. weekYear = year - 1;
  3111. weekNumber = weeksInWeekYear(weekYear);
  3112. } else if (weekNumber > weeksInWeekYear(year)) {
  3113. weekYear = year + 1;
  3114. weekNumber = 1;
  3115. } else {
  3116. weekYear = year;
  3117. }
  3118. return { weekYear, weekNumber, weekday, ...timeObject(gregObj) };
  3119. }
  3120. function weekToGregorian(weekData) {
  3121. const { weekYear, weekNumber, weekday } = weekData, weekdayOfJan4 = dayOfWeek(weekYear, 1, 4), yearInDays = daysInYear(weekYear);
  3122. let ordinal = weekNumber * 7 + weekday - weekdayOfJan4 - 3, year;
  3123. if (ordinal < 1) {
  3124. year = weekYear - 1;
  3125. ordinal += daysInYear(year);
  3126. } else if (ordinal > yearInDays) {
  3127. year = weekYear + 1;
  3128. ordinal -= daysInYear(weekYear);
  3129. } else {
  3130. year = weekYear;
  3131. }
  3132. const { month, day } = uncomputeOrdinal(year, ordinal);
  3133. return { year, month, day, ...timeObject(weekData) };
  3134. }
  3135. function gregorianToOrdinal(gregData) {
  3136. const { year, month, day } = gregData;
  3137. const ordinal = computeOrdinal(year, month, day);
  3138. return { year, ordinal, ...timeObject(gregData) };
  3139. }
  3140. function ordinalToGregorian(ordinalData) {
  3141. const { year, ordinal } = ordinalData;
  3142. const { month, day } = uncomputeOrdinal(year, ordinal);
  3143. return { year, month, day, ...timeObject(ordinalData) };
  3144. }
  3145. function hasInvalidWeekData(obj) {
  3146. const validYear = isInteger(obj.weekYear), validWeek = integerBetween(obj.weekNumber, 1, weeksInWeekYear(obj.weekYear)), validWeekday = integerBetween(obj.weekday, 1, 7);
  3147. if (!validYear) {
  3148. return unitOutOfRange("weekYear", obj.weekYear);
  3149. } else if (!validWeek) {
  3150. return unitOutOfRange("week", obj.week);
  3151. } else if (!validWeekday) {
  3152. return unitOutOfRange("weekday", obj.weekday);
  3153. } else
  3154. return false;
  3155. }
  3156. function hasInvalidOrdinalData(obj) {
  3157. const validYear = isInteger(obj.year), validOrdinal = integerBetween(obj.ordinal, 1, daysInYear(obj.year));
  3158. if (!validYear) {
  3159. return unitOutOfRange("year", obj.year);
  3160. } else if (!validOrdinal) {
  3161. return unitOutOfRange("ordinal", obj.ordinal);
  3162. } else
  3163. return false;
  3164. }
  3165. function hasInvalidGregorianData(obj) {
  3166. const validYear = isInteger(obj.year), validMonth = integerBetween(obj.month, 1, 12), validDay = integerBetween(obj.day, 1, daysInMonth(obj.year, obj.month));
  3167. if (!validYear) {
  3168. return unitOutOfRange("year", obj.year);
  3169. } else if (!validMonth) {
  3170. return unitOutOfRange("month", obj.month);
  3171. } else if (!validDay) {
  3172. return unitOutOfRange("day", obj.day);
  3173. } else
  3174. return false;
  3175. }
  3176. function hasInvalidTimeData(obj) {
  3177. const { hour, minute, second, millisecond } = obj;
  3178. const validHour = integerBetween(hour, 0, 23) || hour === 24 && minute === 0 && second === 0 && millisecond === 0, validMinute = integerBetween(minute, 0, 59), validSecond = integerBetween(second, 0, 59), validMillisecond = integerBetween(millisecond, 0, 999);
  3179. if (!validHour) {
  3180. return unitOutOfRange("hour", hour);
  3181. } else if (!validMinute) {
  3182. return unitOutOfRange("minute", minute);
  3183. } else if (!validSecond) {
  3184. return unitOutOfRange("second", second);
  3185. } else if (!validMillisecond) {
  3186. return unitOutOfRange("millisecond", millisecond);
  3187. } else
  3188. return false;
  3189. }
  3190. // node_modules/luxon/src/datetime.js
  3191. var INVALID3 = "Invalid DateTime";
  3192. var MAX_DATE = 864e13;
  3193. function unsupportedZone(zone) {
  3194. return new Invalid("unsupported zone", `the zone "${zone.name}" is not supported`);
  3195. }
  3196. function possiblyCachedWeekData(dt) {
  3197. if (dt.weekData === null) {
  3198. dt.weekData = gregorianToWeek(dt.c);
  3199. }
  3200. return dt.weekData;
  3201. }
  3202. function clone2(inst, alts) {
  3203. const current = {
  3204. ts: inst.ts,
  3205. zone: inst.zone,
  3206. c: inst.c,
  3207. o: inst.o,
  3208. loc: inst.loc,
  3209. invalid: inst.invalid
  3210. };
  3211. return new DateTime({ ...current, ...alts, old: current });
  3212. }
  3213. function fixOffset(localTS, o2, tz) {
  3214. let utcGuess = localTS - o2 * 60 * 1e3;
  3215. const o22 = tz.offset(utcGuess);
  3216. if (o2 === o22) {
  3217. return [utcGuess, o2];
  3218. }
  3219. utcGuess -= (o22 - o2) * 60 * 1e3;
  3220. const o3 = tz.offset(utcGuess);
  3221. if (o22 === o3) {
  3222. return [utcGuess, o22];
  3223. }
  3224. return [localTS - Math.min(o22, o3) * 60 * 1e3, Math.max(o22, o3)];
  3225. }
  3226. function tsToObj(ts, offset2) {
  3227. ts += offset2 * 60 * 1e3;
  3228. const d2 = new Date(ts);
  3229. return {
  3230. year: d2.getUTCFullYear(),
  3231. month: d2.getUTCMonth() + 1,
  3232. day: d2.getUTCDate(),
  3233. hour: d2.getUTCHours(),
  3234. minute: d2.getUTCMinutes(),
  3235. second: d2.getUTCSeconds(),
  3236. millisecond: d2.getUTCMilliseconds()
  3237. };
  3238. }
  3239. function objToTS(obj, offset2, zone) {
  3240. return fixOffset(objToLocalTS(obj), offset2, zone);
  3241. }
  3242. function adjustTime(inst, dur) {
  3243. const oPre = inst.o, year = inst.c.year + Math.trunc(dur.years), month = inst.c.month + Math.trunc(dur.months) + Math.trunc(dur.quarters) * 3, c2 = {
  3244. ...inst.c,
  3245. year,
  3246. month,
  3247. day: Math.min(inst.c.day, daysInMonth(year, month)) + Math.trunc(dur.days) + Math.trunc(dur.weeks) * 7
  3248. }, millisToAdd = Duration.fromObject({
  3249. years: dur.years - Math.trunc(dur.years),
  3250. quarters: dur.quarters - Math.trunc(dur.quarters),
  3251. months: dur.months - Math.trunc(dur.months),
  3252. weeks: dur.weeks - Math.trunc(dur.weeks),
  3253. days: dur.days - Math.trunc(dur.days),
  3254. hours: dur.hours,
  3255. minutes: dur.minutes,
  3256. seconds: dur.seconds,
  3257. milliseconds: dur.milliseconds
  3258. }).as("milliseconds"), localTS = objToLocalTS(c2);
  3259. let [ts, o2] = fixOffset(localTS, oPre, inst.zone);
  3260. if (millisToAdd !== 0) {
  3261. ts += millisToAdd;
  3262. o2 = inst.zone.offset(ts);
  3263. }
  3264. return { ts, o: o2 };
  3265. }
  3266. function parseDataToDateTime(parsed, parsedZone, opts, format, text, specificOffset) {
  3267. const { setZone, zone } = opts;
  3268. if (parsed && Object.keys(parsed).length !== 0) {
  3269. const interpretationZone = parsedZone || zone, inst = DateTime.fromObject(parsed, {
  3270. ...opts,
  3271. zone: interpretationZone,
  3272. specificOffset
  3273. });
  3274. return setZone ? inst : inst.setZone(zone);
  3275. } else {
  3276. return DateTime.invalid(new Invalid("unparsable", `the input "${text}" can't be parsed as ${format}`));
  3277. }
  3278. }
  3279. function toTechFormat(dt, format, allowZ = true) {
  3280. return dt.isValid ? Formatter.create(Locale.create("en-US"), {
  3281. allowZ,
  3282. forceSimple: true
  3283. }).formatDateTimeFromString(dt, format) : null;
  3284. }
  3285. function toISODate(o2, extended) {
  3286. const longFormat = o2.c.year > 9999 || o2.c.year < 0;
  3287. let c2 = "";
  3288. if (longFormat && o2.c.year >= 0)
  3289. c2 += "+";
  3290. c2 += padStart(o2.c.year, longFormat ? 6 : 4);
  3291. if (extended) {
  3292. c2 += "-";
  3293. c2 += padStart(o2.c.month);
  3294. c2 += "-";
  3295. c2 += padStart(o2.c.day);
  3296. } else {
  3297. c2 += padStart(o2.c.month);
  3298. c2 += padStart(o2.c.day);
  3299. }
  3300. return c2;
  3301. }
  3302. function toISOTime(o2, extended, suppressSeconds, suppressMilliseconds, includeOffset, extendedZone) {
  3303. let c2 = padStart(o2.c.hour);
  3304. if (extended) {
  3305. c2 += ":";
  3306. c2 += padStart(o2.c.minute);
  3307. if (o2.c.second !== 0 || !suppressSeconds) {
  3308. c2 += ":";
  3309. }
  3310. } else {
  3311. c2 += padStart(o2.c.minute);
  3312. }
  3313. if (o2.c.second !== 0 || !suppressSeconds) {
  3314. c2 += padStart(o2.c.second);
  3315. if (o2.c.millisecond !== 0 || !suppressMilliseconds) {
  3316. c2 += ".";
  3317. c2 += padStart(o2.c.millisecond, 3);
  3318. }
  3319. }
  3320. if (includeOffset) {
  3321. if (o2.isOffsetFixed && o2.offset === 0 && !extendedZone) {
  3322. c2 += "Z";
  3323. } else if (o2.o < 0) {
  3324. c2 += "-";
  3325. c2 += padStart(Math.trunc(-o2.o / 60));
  3326. c2 += ":";
  3327. c2 += padStart(Math.trunc(-o2.o % 60));
  3328. } else {
  3329. c2 += "+";
  3330. c2 += padStart(Math.trunc(o2.o / 60));
  3331. c2 += ":";
  3332. c2 += padStart(Math.trunc(o2.o % 60));
  3333. }
  3334. }
  3335. if (extendedZone) {
  3336. c2 += "[" + o2.zone.ianaName + "]";
  3337. }
  3338. return c2;
  3339. }
  3340. var defaultUnitValues = {
  3341. month: 1,
  3342. day: 1,
  3343. hour: 0,
  3344. minute: 0,
  3345. second: 0,
  3346. millisecond: 0
  3347. };
  3348. var defaultWeekUnitValues = {
  3349. weekNumber: 1,
  3350. weekday: 1,
  3351. hour: 0,
  3352. minute: 0,
  3353. second: 0,
  3354. millisecond: 0
  3355. };
  3356. var defaultOrdinalUnitValues = {
  3357. ordinal: 1,
  3358. hour: 0,
  3359. minute: 0,
  3360. second: 0,
  3361. millisecond: 0
  3362. };
  3363. var orderedUnits2 = ["year", "month", "day", "hour", "minute", "second", "millisecond"];
  3364. var orderedWeekUnits = [
  3365. "weekYear",
  3366. "weekNumber",
  3367. "weekday",
  3368. "hour",
  3369. "minute",
  3370. "second",
  3371. "millisecond"
  3372. ];
  3373. var orderedOrdinalUnits = ["year", "ordinal", "hour", "minute", "second", "millisecond"];
  3374. function normalizeUnit(unit) {
  3375. const normalized = {
  3376. year: "year",
  3377. years: "year",
  3378. month: "month",
  3379. months: "month",
  3380. day: "day",
  3381. days: "day",
  3382. hour: "hour",
  3383. hours: "hour",
  3384. minute: "minute",
  3385. minutes: "minute",
  3386. quarter: "quarter",
  3387. quarters: "quarter",
  3388. second: "second",
  3389. seconds: "second",
  3390. millisecond: "millisecond",
  3391. milliseconds: "millisecond",
  3392. weekday: "weekday",
  3393. weekdays: "weekday",
  3394. weeknumber: "weekNumber",
  3395. weeksnumber: "weekNumber",
  3396. weeknumbers: "weekNumber",
  3397. weekyear: "weekYear",
  3398. weekyears: "weekYear",
  3399. ordinal: "ordinal"
  3400. }[unit.toLowerCase()];
  3401. if (!normalized)
  3402. throw new InvalidUnitError(unit);
  3403. return normalized;
  3404. }
  3405. function quickDT(obj, opts) {
  3406. const zone = normalizeZone(opts.zone, Settings.defaultZone), loc = Locale.fromObject(opts), tsNow = Settings.now();
  3407. let ts, o2;
  3408. if (!isUndefined(obj.year)) {
  3409. for (const u of orderedUnits2) {
  3410. if (isUndefined(obj[u])) {
  3411. obj[u] = defaultUnitValues[u];
  3412. }
  3413. }
  3414. const invalid = hasInvalidGregorianData(obj) || hasInvalidTimeData(obj);
  3415. if (invalid) {
  3416. return DateTime.invalid(invalid);
  3417. }
  3418. const offsetProvis = zone.offset(tsNow);
  3419. [ts, o2] = objToTS(obj, offsetProvis, zone);
  3420. } else {
  3421. ts = tsNow;
  3422. }
  3423. return new DateTime({ ts, zone, loc, o: o2 });
  3424. }
  3425. function diffRelative(start, end, opts) {
  3426. const round = isUndefined(opts.round) ? true : opts.round, format = (c2, unit) => {
  3427. c2 = roundTo(c2, round || opts.calendary ? 0 : 2, true);
  3428. const formatter = end.loc.clone(opts).relFormatter(opts);
  3429. return formatter.format(c2, unit);
  3430. }, differ = (unit) => {
  3431. if (opts.calendary) {
  3432. if (!end.hasSame(start, unit)) {
  3433. return end.startOf(unit).diff(start.startOf(unit), unit).get(unit);
  3434. } else
  3435. return 0;
  3436. } else {
  3437. return end.diff(start, unit).get(unit);
  3438. }
  3439. };
  3440. if (opts.unit) {
  3441. return format(differ(opts.unit), opts.unit);
  3442. }
  3443. for (const unit of opts.units) {
  3444. const count = differ(unit);
  3445. if (Math.abs(count) >= 1) {
  3446. return format(count, unit);
  3447. }
  3448. }
  3449. return format(start > end ? -0 : 0, opts.units[opts.units.length - 1]);
  3450. }
  3451. function lastOpts(argList) {
  3452. let opts = {}, args;
  3453. if (argList.length > 0 && typeof argList[argList.length - 1] === "object") {
  3454. opts = argList[argList.length - 1];
  3455. args = Array.from(argList).slice(0, argList.length - 1);
  3456. } else {
  3457. args = Array.from(argList);
  3458. }
  3459. return [opts, args];
  3460. }
  3461. var DateTime = class {
  3462. constructor(config) {
  3463. const zone = config.zone || Settings.defaultZone;
  3464. let invalid = config.invalid || (Number.isNaN(config.ts) ? new Invalid("invalid input") : null) || (!zone.isValid ? unsupportedZone(zone) : null);
  3465. this.ts = isUndefined(config.ts) ? Settings.now() : config.ts;
  3466. let c2 = null, o2 = null;
  3467. if (!invalid) {
  3468. const unchanged = config.old && config.old.ts === this.ts && config.old.zone.equals(zone);
  3469. if (unchanged) {
  3470. [c2, o2] = [config.old.c, config.old.o];
  3471. } else {
  3472. const ot = zone.offset(this.ts);
  3473. c2 = tsToObj(this.ts, ot);
  3474. invalid = Number.isNaN(c2.year) ? new Invalid("invalid input") : null;
  3475. c2 = invalid ? null : c2;
  3476. o2 = invalid ? null : ot;
  3477. }
  3478. }
  3479. this._zone = zone;
  3480. this.loc = config.loc || Locale.create();
  3481. this.invalid = invalid;
  3482. this.weekData = null;
  3483. this.c = c2;
  3484. this.o = o2;
  3485. this.isLuxonDateTime = true;
  3486. }
  3487. static now() {
  3488. return new DateTime({});
  3489. }
  3490. static local() {
  3491. const [opts, args] = lastOpts(arguments), [year, month, day, hour, minute, second, millisecond] = args;
  3492. return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);
  3493. }
  3494. static utc() {
  3495. const [opts, args] = lastOpts(arguments), [year, month, day, hour, minute, second, millisecond] = args;
  3496. opts.zone = FixedOffsetZone.utcInstance;
  3497. return quickDT({ year, month, day, hour, minute, second, millisecond }, opts);
  3498. }
  3499. static fromJSDate(date, options = {}) {
  3500. const ts = isDate(date) ? date.valueOf() : NaN;
  3501. if (Number.isNaN(ts)) {
  3502. return DateTime.invalid("invalid input");
  3503. }
  3504. const zoneToUse = normalizeZone(options.zone, Settings.defaultZone);
  3505. if (!zoneToUse.isValid) {
  3506. return DateTime.invalid(unsupportedZone(zoneToUse));
  3507. }
  3508. return new DateTime({
  3509. ts,
  3510. zone: zoneToUse,
  3511. loc: Locale.fromObject(options)
  3512. });
  3513. }
  3514. static fromMillis(milliseconds, options = {}) {
  3515. if (!isNumber(milliseconds)) {
  3516. throw new InvalidArgumentError(`fromMillis requires a numerical input, but received a ${typeof milliseconds} with value ${milliseconds}`);
  3517. } else if (milliseconds < -MAX_DATE || milliseconds > MAX_DATE) {
  3518. return DateTime.invalid("Timestamp out of range");
  3519. } else {
  3520. return new DateTime({
  3521. ts: milliseconds,
  3522. zone: normalizeZone(options.zone, Settings.defaultZone),
  3523. loc: Locale.fromObject(options)
  3524. });
  3525. }
  3526. }
  3527. static fromSeconds(seconds, options = {}) {
  3528. if (!isNumber(seconds)) {
  3529. throw new InvalidArgumentError("fromSeconds requires a numerical input");
  3530. } else {
  3531. return new DateTime({
  3532. ts: seconds * 1e3,
  3533. zone: normalizeZone(options.zone, Settings.defaultZone),
  3534. loc: Locale.fromObject(options)
  3535. });
  3536. }
  3537. }
  3538. static fromObject(obj, opts = {}) {
  3539. obj = obj || {};
  3540. const zoneToUse = normalizeZone(opts.zone, Settings.defaultZone);
  3541. if (!zoneToUse.isValid) {
  3542. return DateTime.invalid(unsupportedZone(zoneToUse));
  3543. }
  3544. const tsNow = Settings.now(), offsetProvis = !isUndefined(opts.specificOffset) ? opts.specificOffset : zoneToUse.offset(tsNow), normalized = normalizeObject(obj, normalizeUnit), containsOrdinal = !isUndefined(normalized.ordinal), containsGregorYear = !isUndefined(normalized.year), containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day), containsGregor = containsGregorYear || containsGregorMD, definiteWeekDef = normalized.weekYear || normalized.weekNumber, loc = Locale.fromObject(opts);
  3545. if ((containsGregor || containsOrdinal) && definiteWeekDef) {
  3546. throw new ConflictingSpecificationError("Can't mix weekYear/weekNumber units with year/month/day or ordinals");
  3547. }
  3548. if (containsGregorMD && containsOrdinal) {
  3549. throw new ConflictingSpecificationError("Can't mix ordinal dates with month/day");
  3550. }
  3551. const useWeekData = definiteWeekDef || normalized.weekday && !containsGregor;
  3552. let units, defaultValues, objNow = tsToObj(tsNow, offsetProvis);
  3553. if (useWeekData) {
  3554. units = orderedWeekUnits;
  3555. defaultValues = defaultWeekUnitValues;
  3556. objNow = gregorianToWeek(objNow);
  3557. } else if (containsOrdinal) {
  3558. units = orderedOrdinalUnits;
  3559. defaultValues = defaultOrdinalUnitValues;
  3560. objNow = gregorianToOrdinal(objNow);
  3561. } else {
  3562. units = orderedUnits2;
  3563. defaultValues = defaultUnitValues;
  3564. }
  3565. let foundFirst = false;
  3566. for (const u of units) {
  3567. const v4 = normalized[u];
  3568. if (!isUndefined(v4)) {
  3569. foundFirst = true;
  3570. } else if (foundFirst) {
  3571. normalized[u] = defaultValues[u];
  3572. } else {
  3573. normalized[u] = objNow[u];
  3574. }
  3575. }
  3576. const higherOrderInvalid = useWeekData ? hasInvalidWeekData(normalized) : containsOrdinal ? hasInvalidOrdinalData(normalized) : hasInvalidGregorianData(normalized), invalid = higherOrderInvalid || hasInvalidTimeData(normalized);
  3577. if (invalid) {
  3578. return DateTime.invalid(invalid);
  3579. }
  3580. const gregorian = useWeekData ? weekToGregorian(normalized) : containsOrdinal ? ordinalToGregorian(normalized) : normalized, [tsFinal, offsetFinal] = objToTS(gregorian, offsetProvis, zoneToUse), inst = new DateTime({
  3581. ts: tsFinal,
  3582. zone: zoneToUse,
  3583. o: offsetFinal,
  3584. loc
  3585. });
  3586. if (normalized.weekday && containsGregor && obj.weekday !== inst.weekday) {
  3587. return DateTime.invalid("mismatched weekday", `you can't specify both a weekday of ${normalized.weekday} and a date of ${inst.toISO()}`);
  3588. }
  3589. return inst;
  3590. }
  3591. static fromISO(text, opts = {}) {
  3592. const [vals, parsedZone] = parseISODate(text);
  3593. return parseDataToDateTime(vals, parsedZone, opts, "ISO 8601", text);
  3594. }
  3595. static fromRFC2822(text, opts = {}) {
  3596. const [vals, parsedZone] = parseRFC2822Date(text);
  3597. return parseDataToDateTime(vals, parsedZone, opts, "RFC 2822", text);
  3598. }
  3599. static fromHTTP(text, opts = {}) {
  3600. const [vals, parsedZone] = parseHTTPDate(text);
  3601. return parseDataToDateTime(vals, parsedZone, opts, "HTTP", opts);
  3602. }
  3603. static fromFormat(text, fmt, opts = {}) {
  3604. if (isUndefined(text) || isUndefined(fmt)) {
  3605. throw new InvalidArgumentError("fromFormat requires an input string and a format");
  3606. }
  3607. const { locale = null, numberingSystem = null } = opts, localeToUse = Locale.fromOpts({
  3608. locale,
  3609. numberingSystem,
  3610. defaultToEN: true
  3611. }), [vals, parsedZone, specificOffset, invalid] = parseFromTokens(localeToUse, text, fmt);
  3612. if (invalid) {
  3613. return DateTime.invalid(invalid);
  3614. } else {
  3615. return parseDataToDateTime(vals, parsedZone, opts, `format ${fmt}`, text, specificOffset);
  3616. }
  3617. }
  3618. static fromString(text, fmt, opts = {}) {
  3619. return DateTime.fromFormat(text, fmt, opts);
  3620. }
  3621. static fromSQL(text, opts = {}) {
  3622. const [vals, parsedZone] = parseSQL(text);
  3623. return parseDataToDateTime(vals, parsedZone, opts, "SQL", text);
  3624. }
  3625. static invalid(reason, explanation = null) {
  3626. if (!reason) {
  3627. throw new InvalidArgumentError("need to specify a reason the DateTime is invalid");
  3628. }
  3629. const invalid = reason instanceof Invalid ? reason : new Invalid(reason, explanation);
  3630. if (Settings.throwOnInvalid) {
  3631. throw new InvalidDateTimeError(invalid);
  3632. } else {
  3633. return new DateTime({ invalid });
  3634. }
  3635. }
  3636. static isDateTime(o2) {
  3637. return o2 && o2.isLuxonDateTime || false;
  3638. }
  3639. get(unit) {
  3640. return this[unit];
  3641. }
  3642. get isValid() {
  3643. return this.invalid === null;
  3644. }
  3645. get invalidReason() {
  3646. return this.invalid ? this.invalid.reason : null;
  3647. }
  3648. get invalidExplanation() {
  3649. return this.invalid ? this.invalid.explanation : null;
  3650. }
  3651. get locale() {
  3652. return this.isValid ? this.loc.locale : null;
  3653. }
  3654. get numberingSystem() {
  3655. return this.isValid ? this.loc.numberingSystem : null;
  3656. }
  3657. get outputCalendar() {
  3658. return this.isValid ? this.loc.outputCalendar : null;
  3659. }
  3660. get zone() {
  3661. return this._zone;
  3662. }
  3663. get zoneName() {
  3664. return this.isValid ? this.zone.name : null;
  3665. }
  3666. get year() {
  3667. return this.isValid ? this.c.year : NaN;
  3668. }
  3669. get quarter() {
  3670. return this.isValid ? Math.ceil(this.c.month / 3) : NaN;
  3671. }
  3672. get month() {
  3673. return this.isValid ? this.c.month : NaN;
  3674. }
  3675. get day() {
  3676. return this.isValid ? this.c.day : NaN;
  3677. }
  3678. get hour() {
  3679. return this.isValid ? this.c.hour : NaN;
  3680. }
  3681. get minute() {
  3682. return this.isValid ? this.c.minute : NaN;
  3683. }
  3684. get second() {
  3685. return this.isValid ? this.c.second : NaN;
  3686. }
  3687. get millisecond() {
  3688. return this.isValid ? this.c.millisecond : NaN;
  3689. }
  3690. get weekYear() {
  3691. return this.isValid ? possiblyCachedWeekData(this).weekYear : NaN;
  3692. }
  3693. get weekNumber() {
  3694. return this.isValid ? possiblyCachedWeekData(this).weekNumber : NaN;
  3695. }
  3696. get weekday() {
  3697. return this.isValid ? possiblyCachedWeekData(this).weekday : NaN;
  3698. }
  3699. get ordinal() {
  3700. return this.isValid ? gregorianToOrdinal(this.c).ordinal : NaN;
  3701. }
  3702. get monthShort() {
  3703. return this.isValid ? Info.months("short", { locObj: this.loc })[this.month - 1] : null;
  3704. }
  3705. get monthLong() {
  3706. return this.isValid ? Info.months("long", { locObj: this.loc })[this.month - 1] : null;
  3707. }
  3708. get weekdayShort() {
  3709. return this.isValid ? Info.weekdays("short", { locObj: this.loc })[this.weekday - 1] : null;
  3710. }
  3711. get weekdayLong() {
  3712. return this.isValid ? Info.weekdays("long", { locObj: this.loc })[this.weekday - 1] : null;
  3713. }
  3714. get offset() {
  3715. return this.isValid ? +this.o : NaN;
  3716. }
  3717. get offsetNameShort() {
  3718. if (this.isValid) {
  3719. return this.zone.offsetName(this.ts, {
  3720. format: "short",
  3721. locale: this.locale
  3722. });
  3723. } else {
  3724. return null;
  3725. }
  3726. }
  3727. get offsetNameLong() {
  3728. if (this.isValid) {
  3729. return this.zone.offsetName(this.ts, {
  3730. format: "long",
  3731. locale: this.locale
  3732. });
  3733. } else {
  3734. return null;
  3735. }
  3736. }
  3737. get isOffsetFixed() {
  3738. return this.isValid ? this.zone.isUniversal : null;
  3739. }
  3740. get isInDST() {
  3741. if (this.isOffsetFixed) {
  3742. return false;
  3743. } else {
  3744. return this.offset > this.set({ month: 1, day: 1 }).offset || this.offset > this.set({ month: 5 }).offset;
  3745. }
  3746. }
  3747. get isInLeapYear() {
  3748. return isLeapYear(this.year);
  3749. }
  3750. get daysInMonth() {
  3751. return daysInMonth(this.year, this.month);
  3752. }
  3753. get daysInYear() {
  3754. return this.isValid ? daysInYear(this.year) : NaN;
  3755. }
  3756. get weeksInWeekYear() {
  3757. return this.isValid ? weeksInWeekYear(this.weekYear) : NaN;
  3758. }
  3759. resolvedLocaleOptions(opts = {}) {
  3760. const { locale, numberingSystem, calendar } = Formatter.create(this.loc.clone(opts), opts).resolvedOptions(this);
  3761. return { locale, numberingSystem, outputCalendar: calendar };
  3762. }
  3763. toUTC(offset2 = 0, opts = {}) {
  3764. return this.setZone(FixedOffsetZone.instance(offset2), opts);
  3765. }
  3766. toLocal() {
  3767. return this.setZone(Settings.defaultZone);
  3768. }
  3769. setZone(zone, { keepLocalTime = false, keepCalendarTime = false } = {}) {
  3770. zone = normalizeZone(zone, Settings.defaultZone);
  3771. if (zone.equals(this.zone)) {
  3772. return this;
  3773. } else if (!zone.isValid) {
  3774. return DateTime.invalid(unsupportedZone(zone));
  3775. } else {
  3776. let newTS = this.ts;
  3777. if (keepLocalTime || keepCalendarTime) {
  3778. const offsetGuess = zone.offset(this.ts);
  3779. const asObj = this.toObject();
  3780. [newTS] = objToTS(asObj, offsetGuess, zone);
  3781. }
  3782. return clone2(this, { ts: newTS, zone });
  3783. }
  3784. }
  3785. reconfigure({ locale, numberingSystem, outputCalendar } = {}) {
  3786. const loc = this.loc.clone({ locale, numberingSystem, outputCalendar });
  3787. return clone2(this, { loc });
  3788. }
  3789. setLocale(locale) {
  3790. return this.reconfigure({ locale });
  3791. }
  3792. set(values) {
  3793. if (!this.isValid)
  3794. return this;
  3795. const normalized = normalizeObject(values, normalizeUnit), settingWeekStuff = !isUndefined(normalized.weekYear) || !isUndefined(normalized.weekNumber) || !isUndefined(normalized.weekday), containsOrdinal = !isUndefined(normalized.ordinal), containsGregorYear = !isUndefined(normalized.year), containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day), containsGregor = containsGregorYear || containsGregorMD, definiteWeekDef = normalized.weekYear || normalized.weekNumber;
  3796. if ((containsGregor || containsOrdinal) && definiteWeekDef) {
  3797. throw new ConflictingSpecificationError("Can't mix weekYear/weekNumber units with year/month/day or ordinals");
  3798. }
  3799. if (containsGregorMD && containsOrdinal) {
  3800. throw new ConflictingSpecificationError("Can't mix ordinal dates with month/day");
  3801. }
  3802. let mixed;
  3803. if (settingWeekStuff) {
  3804. mixed = weekToGregorian({ ...gregorianToWeek(this.c), ...normalized });
  3805. } else if (!isUndefined(normalized.ordinal)) {
  3806. mixed = ordinalToGregorian({ ...gregorianToOrdinal(this.c), ...normalized });
  3807. } else {
  3808. mixed = { ...this.toObject(), ...normalized };
  3809. if (isUndefined(normalized.day)) {
  3810. mixed.day = Math.min(daysInMonth(mixed.year, mixed.month), mixed.day);
  3811. }
  3812. }
  3813. const [ts, o2] = objToTS(mixed, this.o, this.zone);
  3814. return clone2(this, { ts, o: o2 });
  3815. }
  3816. plus(duration) {
  3817. if (!this.isValid)
  3818. return this;
  3819. const dur = Duration.fromDurationLike(duration);
  3820. return clone2(this, adjustTime(this, dur));
  3821. }
  3822. minus(duration) {
  3823. if (!this.isValid)
  3824. return this;
  3825. const dur = Duration.fromDurationLike(duration).negate();
  3826. return clone2(this, adjustTime(this, dur));
  3827. }
  3828. startOf(unit) {
  3829. if (!this.isValid)
  3830. return this;
  3831. const o2 = {}, normalizedUnit = Duration.normalizeUnit(unit);
  3832. switch (normalizedUnit) {
  3833. case "years":
  3834. o2.month = 1;
  3835. case "quarters":
  3836. case "months":
  3837. o2.day = 1;
  3838. case "weeks":
  3839. case "days":
  3840. o2.hour = 0;
  3841. case "hours":
  3842. o2.minute = 0;
  3843. case "minutes":
  3844. o2.second = 0;
  3845. case "seconds":
  3846. o2.millisecond = 0;
  3847. break;
  3848. case "milliseconds":
  3849. break;
  3850. }
  3851. if (normalizedUnit === "weeks") {
  3852. o2.weekday = 1;
  3853. }
  3854. if (normalizedUnit === "quarters") {
  3855. const q2 = Math.ceil(this.month / 3);
  3856. o2.month = (q2 - 1) * 3 + 1;
  3857. }
  3858. return this.set(o2);
  3859. }
  3860. endOf(unit) {
  3861. return this.isValid ? this.plus({ [unit]: 1 }).startOf(unit).minus(1) : this;
  3862. }
  3863. toFormat(fmt, opts = {}) {
  3864. return this.isValid ? Formatter.create(this.loc.redefaultToEN(opts)).formatDateTimeFromString(this, fmt) : INVALID3;
  3865. }
  3866. toLocaleString(formatOpts = DATE_SHORT, opts = {}) {
  3867. return this.isValid ? Formatter.create(this.loc.clone(opts), formatOpts).formatDateTime(this) : INVALID3;
  3868. }
  3869. toLocaleParts(opts = {}) {
  3870. return this.isValid ? Formatter.create(this.loc.clone(opts), opts).formatDateTimeParts(this) : [];
  3871. }
  3872. toISO({
  3873. format = "extended",
  3874. suppressSeconds = false,
  3875. suppressMilliseconds = false,
  3876. includeOffset = true,
  3877. extendedZone = false
  3878. } = {}) {
  3879. if (!this.isValid) {
  3880. return null;
  3881. }
  3882. const ext = format === "extended";
  3883. let c2 = toISODate(this, ext);
  3884. c2 += "T";
  3885. c2 += toISOTime(this, ext, suppressSeconds, suppressMilliseconds, includeOffset, extendedZone);
  3886. return c2;
  3887. }
  3888. toISODate({ format = "extended" } = {}) {
  3889. if (!this.isValid) {
  3890. return null;
  3891. }
  3892. return toISODate(this, format === "extended");
  3893. }
  3894. toISOWeekDate() {
  3895. return toTechFormat(this, "kkkk-'W'WW-c");
  3896. }
  3897. toISOTime({
  3898. suppressMilliseconds = false,
  3899. suppressSeconds = false,
  3900. includeOffset = true,
  3901. includePrefix = false,
  3902. extendedZone = false,
  3903. format = "extended"
  3904. } = {}) {
  3905. if (!this.isValid) {
  3906. return null;
  3907. }
  3908. let c2 = includePrefix ? "T" : "";
  3909. return c2 + toISOTime(this, format === "extended", suppressSeconds, suppressMilliseconds, includeOffset, extendedZone);
  3910. }
  3911. toRFC2822() {
  3912. return toTechFormat(this, "EEE, dd LLL yyyy HH:mm:ss ZZZ", false);
  3913. }
  3914. toHTTP() {
  3915. return toTechFormat(this.toUTC(), "EEE, dd LLL yyyy HH:mm:ss 'GMT'");
  3916. }
  3917. toSQLDate() {
  3918. if (!this.isValid) {
  3919. return null;
  3920. }
  3921. return toISODate(this, true);
  3922. }
  3923. toSQLTime({ includeOffset = true, includeZone = false, includeOffsetSpace = true } = {}) {
  3924. let fmt = "HH:mm:ss.SSS";
  3925. if (includeZone || includeOffset) {
  3926. if (includeOffsetSpace) {
  3927. fmt += " ";
  3928. }
  3929. if (includeZone) {
  3930. fmt += "z";
  3931. } else if (includeOffset) {
  3932. fmt += "ZZ";
  3933. }
  3934. }
  3935. return toTechFormat(this, fmt, true);
  3936. }
  3937. toSQL(opts = {}) {
  3938. if (!this.isValid) {
  3939. return null;
  3940. }
  3941. return `${this.toSQLDate()} ${this.toSQLTime(opts)}`;
  3942. }
  3943. toString() {
  3944. return this.isValid ? this.toISO() : INVALID3;
  3945. }
  3946. valueOf() {
  3947. return this.toMillis();
  3948. }
  3949. toMillis() {
  3950. return this.isValid ? this.ts : NaN;
  3951. }
  3952. toSeconds() {
  3953. return this.isValid ? this.ts / 1e3 : NaN;
  3954. }
  3955. toUnixInteger() {
  3956. return this.isValid ? Math.floor(this.ts / 1e3) : NaN;
  3957. }
  3958. toJSON() {
  3959. return this.toISO();
  3960. }
  3961. toBSON() {
  3962. return this.toJSDate();
  3963. }
  3964. toObject(opts = {}) {
  3965. if (!this.isValid)
  3966. return {};
  3967. const base = { ...this.c };
  3968. if (opts.includeConfig) {
  3969. base.outputCalendar = this.outputCalendar;
  3970. base.numberingSystem = this.loc.numberingSystem;
  3971. base.locale = this.loc.locale;
  3972. }
  3973. return base;
  3974. }
  3975. toJSDate() {
  3976. return new Date(this.isValid ? this.ts : NaN);
  3977. }
  3978. diff(otherDateTime, unit = "milliseconds", opts = {}) {
  3979. if (!this.isValid || !otherDateTime.isValid) {
  3980. return Duration.invalid("created by diffing an invalid DateTime");
  3981. }
  3982. const durOpts = { locale: this.locale, numberingSystem: this.numberingSystem, ...opts };
  3983. const units = maybeArray(unit).map(Duration.normalizeUnit), otherIsLater = otherDateTime.valueOf() > this.valueOf(), earlier = otherIsLater ? this : otherDateTime, later = otherIsLater ? otherDateTime : this, diffed = diff_default(earlier, later, units, durOpts);
  3984. return otherIsLater ? diffed.negate() : diffed;
  3985. }
  3986. diffNow(unit = "milliseconds", opts = {}) {
  3987. return this.diff(DateTime.now(), unit, opts);
  3988. }
  3989. until(otherDateTime) {
  3990. return this.isValid ? Interval.fromDateTimes(this, otherDateTime) : this;
  3991. }
  3992. hasSame(otherDateTime, unit) {
  3993. if (!this.isValid)
  3994. return false;
  3995. const inputMs = otherDateTime.valueOf();
  3996. const adjustedToZone = this.setZone(otherDateTime.zone, { keepLocalTime: true });
  3997. return adjustedToZone.startOf(unit) <= inputMs && inputMs <= adjustedToZone.endOf(unit);
  3998. }
  3999. equals(other) {
  4000. return this.isValid && other.isValid && this.valueOf() === other.valueOf() && this.zone.equals(other.zone) && this.loc.equals(other.loc);
  4001. }
  4002. toRelative(options = {}) {
  4003. if (!this.isValid)
  4004. return null;
  4005. const base = options.base || DateTime.fromObject({}, { zone: this.zone }), padding = options.padding ? this < base ? -options.padding : options.padding : 0;
  4006. let units = ["years", "months", "days", "hours", "minutes", "seconds"];
  4007. let unit = options.unit;
  4008. if (Array.isArray(options.unit)) {
  4009. units = options.unit;
  4010. unit = void 0;
  4011. }
  4012. return diffRelative(base, this.plus(padding), {
  4013. ...options,
  4014. numeric: "always",
  4015. units,
  4016. unit
  4017. });
  4018. }
  4019. toRelativeCalendar(options = {}) {
  4020. if (!this.isValid)
  4021. return null;
  4022. return diffRelative(options.base || DateTime.fromObject({}, { zone: this.zone }), this, {
  4023. ...options,
  4024. numeric: "auto",
  4025. units: ["years", "months", "days"],
  4026. calendary: true
  4027. });
  4028. }
  4029. static min(...dateTimes) {
  4030. if (!dateTimes.every(DateTime.isDateTime)) {
  4031. throw new InvalidArgumentError("min requires all arguments be DateTimes");
  4032. }
  4033. return bestBy(dateTimes, (i3) => i3.valueOf(), Math.min);
  4034. }
  4035. static max(...dateTimes) {
  4036. if (!dateTimes.every(DateTime.isDateTime)) {
  4037. throw new InvalidArgumentError("max requires all arguments be DateTimes");
  4038. }
  4039. return bestBy(dateTimes, (i3) => i3.valueOf(), Math.max);
  4040. }
  4041. static fromFormatExplain(text, fmt, options = {}) {
  4042. const { locale = null, numberingSystem = null } = options, localeToUse = Locale.fromOpts({
  4043. locale,
  4044. numberingSystem,
  4045. defaultToEN: true
  4046. });
  4047. return explainFromTokens(localeToUse, text, fmt);
  4048. }
  4049. static fromStringExplain(text, fmt, options = {}) {
  4050. return DateTime.fromFormatExplain(text, fmt, options);
  4051. }
  4052. static get DATE_SHORT() {
  4053. return DATE_SHORT;
  4054. }
  4055. static get DATE_MED() {
  4056. return DATE_MED;
  4057. }
  4058. static get DATE_MED_WITH_WEEKDAY() {
  4059. return DATE_MED_WITH_WEEKDAY;
  4060. }
  4061. static get DATE_FULL() {
  4062. return DATE_FULL;
  4063. }
  4064. static get DATE_HUGE() {
  4065. return DATE_HUGE;
  4066. }
  4067. static get TIME_SIMPLE() {
  4068. return TIME_SIMPLE;
  4069. }
  4070. static get TIME_WITH_SECONDS() {
  4071. return TIME_WITH_SECONDS;
  4072. }
  4073. static get TIME_WITH_SHORT_OFFSET() {
  4074. return TIME_WITH_SHORT_OFFSET;
  4075. }
  4076. static get TIME_WITH_LONG_OFFSET() {
  4077. return TIME_WITH_LONG_OFFSET;
  4078. }
  4079. static get TIME_24_SIMPLE() {
  4080. return TIME_24_SIMPLE;
  4081. }
  4082. static get TIME_24_WITH_SECONDS() {
  4083. return TIME_24_WITH_SECONDS;
  4084. }
  4085. static get TIME_24_WITH_SHORT_OFFSET() {
  4086. return TIME_24_WITH_SHORT_OFFSET;
  4087. }
  4088. static get TIME_24_WITH_LONG_OFFSET() {
  4089. return TIME_24_WITH_LONG_OFFSET;
  4090. }
  4091. static get DATETIME_SHORT() {
  4092. return DATETIME_SHORT;
  4093. }
  4094. static get DATETIME_SHORT_WITH_SECONDS() {
  4095. return DATETIME_SHORT_WITH_SECONDS;
  4096. }
  4097. static get DATETIME_MED() {
  4098. return DATETIME_MED;
  4099. }
  4100. static get DATETIME_MED_WITH_SECONDS() {
  4101. return DATETIME_MED_WITH_SECONDS;
  4102. }
  4103. static get DATETIME_MED_WITH_WEEKDAY() {
  4104. return DATETIME_MED_WITH_WEEKDAY;
  4105. }
  4106. static get DATETIME_FULL() {
  4107. return DATETIME_FULL;
  4108. }
  4109. static get DATETIME_FULL_WITH_SECONDS() {
  4110. return DATETIME_FULL_WITH_SECONDS;
  4111. }
  4112. static get DATETIME_HUGE() {
  4113. return DATETIME_HUGE;
  4114. }
  4115. static get DATETIME_HUGE_WITH_SECONDS() {
  4116. return DATETIME_HUGE_WITH_SECONDS;
  4117. }
  4118. };
  4119. function friendlyDateTime(dateTimeish) {
  4120. if (DateTime.isDateTime(dateTimeish)) {
  4121. return dateTimeish;
  4122. } else if (dateTimeish && dateTimeish.valueOf && isNumber(dateTimeish.valueOf())) {
  4123. return DateTime.fromJSDate(dateTimeish);
  4124. } else if (dateTimeish && typeof dateTimeish === "object") {
  4125. return DateTime.fromObject(dateTimeish);
  4126. } else {
  4127. throw new InvalidArgumentError(`Unknown datetime argument: ${dateTimeish}, of type ${typeof dateTimeish}`);
  4128. }
  4129. }
  4130. // node_modules/@arcgis/core/chunks/languageUtils.js
  4131. var S2 = class {
  4132. constructor(e) {
  4133. this.value = e;
  4134. }
  4135. };
  4136. var x = class {
  4137. constructor(e) {
  4138. this.value = e;
  4139. }
  4140. };
  4141. var b2 = class {
  4142. constructor(e) {
  4143. this.fn = e;
  4144. }
  4145. };
  4146. var T = class {
  4147. constructor(e, t5) {
  4148. this.paramCount = t5, this.fn = e;
  4149. }
  4150. };
  4151. var N = b2;
  4152. var k = x;
  4153. var D2 = S2;
  4154. var M2 = T;
  4155. var j2 = { type: "VOID" };
  4156. var A = { type: "BREAK" };
  4157. var R = { type: "CONTINUE" };
  4158. function F2(e, t5, n3) {
  4159. return t5 === "" || t5 == null || t5 === n3 || t5 === n3 ? e : e = e.split(t5).join(n3);
  4160. }
  4161. function v3(t5) {
  4162. return t5 instanceof b2 || t5 instanceof t3 || t5 instanceof T;
  4163. }
  4164. function C(e) {
  4165. return !!w(e) || (!!O(e) || (!!z(e) || (!!_(e) || (e === null || (e === j2 || typeof e == "number")))));
  4166. }
  4167. function I(e, t5) {
  4168. return e === void 0 ? t5 : e;
  4169. }
  4170. function w(e) {
  4171. return typeof e == "string" || e instanceof String;
  4172. }
  4173. function _(e) {
  4174. return typeof e == "boolean";
  4175. }
  4176. function O(e) {
  4177. return typeof e == "number";
  4178. }
  4179. function Z(e) {
  4180. return typeof e == "number" && isFinite(e) && Math.floor(e) === e;
  4181. }
  4182. function L(e) {
  4183. return e instanceof Array;
  4184. }
  4185. function Y(e) {
  4186. return e?.arcadeDeclaredClass === "esri.arcade.Feature";
  4187. }
  4188. function J(e) {
  4189. return (e && e.declaredRootClass && e.declaredRootClass === "esri.arcade.featureset.support.FeatureSet") === true;
  4190. }
  4191. function P2(e) {
  4192. return (e && e.declaredRootClass && e.declaredRootClass === "esri.arcade.featureSetCollection") === true;
  4193. }
  4194. function E(e) {
  4195. return e instanceof t2;
  4196. }
  4197. function z(e) {
  4198. return e instanceof Date;
  4199. }
  4200. function G(e, t5, n3) {
  4201. if (e.length < t5 || e.length > n3)
  4202. throw new Error("Function called with wrong number of Parameters");
  4203. }
  4204. function V(e) {
  4205. return e < 0 ? -Math.round(-e) : Math.round(e);
  4206. }
  4207. function H() {
  4208. let e = Date.now();
  4209. return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(t5) {
  4210. const n3 = (e + 16 * Math.random()) % 16 | 0;
  4211. return e = Math.floor(e / 16), (t5 === "x" ? n3 : 3 & n3 | 8).toString(16);
  4212. });
  4213. }
  4214. function U(e, t5) {
  4215. return isNaN(e) === false ? t5 == null || t5 === "" ? e.toString() : (t5 = F2(t5, "\u2030", ""), t5 = F2(t5, "\xA4", ""), s(e, { pattern: t5 })) : e.toString();
  4216. }
  4217. function q(e, t5) {
  4218. const n3 = DateTime.fromJSDate(e);
  4219. return t5 == null || t5 === "" ? n3.toISO({ suppressMilliseconds: true }) : n3.toFormat($(t5), { locale: l(), numberingSystem: "latn" });
  4220. }
  4221. function $(e) {
  4222. e = e.replace(/LTS|LT|LL?L?L?|l{1,4}/g, "[$&]");
  4223. let t5 = "";
  4224. const n3 = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;
  4225. for (const r of e.match(n3))
  4226. switch (r) {
  4227. case "D":
  4228. t5 += "d";
  4229. break;
  4230. case "DD":
  4231. t5 += "dd";
  4232. break;
  4233. case "DDD":
  4234. t5 += "o";
  4235. break;
  4236. case "d":
  4237. t5 += "c";
  4238. break;
  4239. case "ddd":
  4240. t5 += "ccc";
  4241. break;
  4242. case "dddd":
  4243. t5 += "cccc";
  4244. break;
  4245. case "M":
  4246. t5 += "L";
  4247. break;
  4248. case "MM":
  4249. t5 += "LL";
  4250. break;
  4251. case "MMM":
  4252. t5 += "LLL";
  4253. break;
  4254. case "MMMM":
  4255. t5 += "LLLL";
  4256. break;
  4257. case "YY":
  4258. t5 += "yy";
  4259. break;
  4260. case "Y":
  4261. case "YYYY":
  4262. t5 += "yyyy";
  4263. break;
  4264. case "Q":
  4265. t5 += "q";
  4266. break;
  4267. case "Z":
  4268. t5 += "ZZ";
  4269. break;
  4270. case "ZZ":
  4271. t5 += "ZZZ";
  4272. break;
  4273. case "S":
  4274. t5 += "'S'";
  4275. break;
  4276. case "SS":
  4277. t5 += "'SS'";
  4278. break;
  4279. case "SSS":
  4280. t5 += "u";
  4281. break;
  4282. case "A":
  4283. case "a":
  4284. t5 += "a";
  4285. break;
  4286. case "m":
  4287. case "mm":
  4288. case "h":
  4289. case "hh":
  4290. case "H":
  4291. case "HH":
  4292. case "s":
  4293. case "ss":
  4294. case "X":
  4295. case "x":
  4296. t5 += r;
  4297. break;
  4298. default:
  4299. r.length >= 2 && r.slice(0, 1) === "[" && r.slice(-1) === "]" ? t5 += `'${r.slice(1, -1)}'` : t5 += `'${r}'`;
  4300. }
  4301. return t5;
  4302. }
  4303. function B(e, t5, n3) {
  4304. switch (n3) {
  4305. case ">":
  4306. return e > t5;
  4307. case "<":
  4308. return e < t5;
  4309. case ">=":
  4310. return e >= t5;
  4311. case "<=":
  4312. return e <= t5;
  4313. }
  4314. return false;
  4315. }
  4316. function W(e, t5, n3) {
  4317. if (e === null) {
  4318. if (t5 === null || t5 === j2)
  4319. return B(null, null, n3);
  4320. if (O(t5))
  4321. return B(0, t5, n3);
  4322. if (w(t5))
  4323. return B(0, ne(t5), n3);
  4324. if (_(t5))
  4325. return B(0, ne(t5), n3);
  4326. if (z(t5))
  4327. return B(0, t5.getTime(), n3);
  4328. }
  4329. if (e === j2) {
  4330. if (t5 === null || t5 === j2)
  4331. return B(null, null, n3);
  4332. if (O(t5))
  4333. return B(0, t5, n3);
  4334. if (w(t5))
  4335. return B(0, ne(t5), n3);
  4336. if (_(t5))
  4337. return B(0, ne(t5), n3);
  4338. if (z(t5))
  4339. return B(0, t5.getTime(), n3);
  4340. } else if (O(e)) {
  4341. if (O(t5))
  4342. return B(e, t5, n3);
  4343. if (_(t5))
  4344. return B(e, ne(t5), n3);
  4345. if (t5 === null || t5 === j2)
  4346. return B(e, 0, n3);
  4347. if (w(t5))
  4348. return B(e, ne(t5), n3);
  4349. if (z(t5))
  4350. return B(e, t5.getTime(), n3);
  4351. } else if (w(e)) {
  4352. if (w(t5))
  4353. return B(X(e), X(t5), n3);
  4354. if (z(t5))
  4355. return B(ne(e), t5.getTime(), n3);
  4356. if (O(t5))
  4357. return B(ne(e), t5, n3);
  4358. if (t5 === null || t5 === j2)
  4359. return B(ne(e), 0, n3);
  4360. if (_(t5))
  4361. return B(ne(e), ne(t5), n3);
  4362. } else if (z(e)) {
  4363. if (z(t5))
  4364. return B(e, t5, n3);
  4365. if (t5 === null || t5 === j2)
  4366. return B(e.getTime(), 0, n3);
  4367. if (O(t5))
  4368. return B(e.getTime(), t5, n3);
  4369. if (_(t5))
  4370. return B(e.getTime(), ne(t5), n3);
  4371. if (w(t5))
  4372. return B(e.getTime(), ne(t5), n3);
  4373. } else if (_(e)) {
  4374. if (_(t5))
  4375. return B(e, t5, n3);
  4376. if (O(t5))
  4377. return B(ne(e), ne(t5), n3);
  4378. if (z(t5))
  4379. return B(ne(e), t5.getTime(), n3);
  4380. if (t5 === null || t5 === j2)
  4381. return B(ne(e), 0, n3);
  4382. if (w(t5))
  4383. return B(ne(e), ne(t5), n3);
  4384. }
  4385. return !!Q(e, t5) && (n3 === "<=" || n3 === ">=");
  4386. }
  4387. function Q(e, t5) {
  4388. if (e === t5)
  4389. return true;
  4390. if (e === null && t5 === j2 || t5 === null && e === j2)
  4391. return true;
  4392. if (z(e) && z(t5))
  4393. return e.getTime() === t5.getTime();
  4394. if (e instanceof h)
  4395. return e.equalityTest(t5);
  4396. if (e instanceof i)
  4397. return e.equalityTest(t5);
  4398. if (e instanceof j && t5 instanceof j) {
  4399. const n3 = e.cache._arcadeCacheId, r = t5.cache._arcadeCacheId;
  4400. if (n3 != null)
  4401. return n3 === r;
  4402. }
  4403. if (e !== void 0 && t5 !== void 0 && e !== null && t5 !== null && typeof e == "object" && typeof t5 == "object") {
  4404. if (e._arcadeCacheId === t5._arcadeCacheId && e._arcadeCacheId !== void 0 && e._arcadeCacheId !== null)
  4405. return true;
  4406. if (e._underlyingGraphic === t5._underlyingGraphic && e._underlyingGraphic !== void 0 && e._underlyingGraphic !== null)
  4407. return true;
  4408. }
  4409. return false;
  4410. }
  4411. function X(e, n3) {
  4412. if (w(e))
  4413. return e;
  4414. if (e === null)
  4415. return "";
  4416. if (O(e))
  4417. return U(e, n3);
  4418. if (_(e))
  4419. return e.toString();
  4420. if (z(e))
  4421. return q(e, n3);
  4422. if (e instanceof p)
  4423. return JSON.stringify(e.toJSON());
  4424. if (L(e)) {
  4425. const t5 = [];
  4426. for (let n4 = 0; n4 < e.length; n4++)
  4427. t5[n4] = te(e[n4]);
  4428. return "[" + t5.join(",") + "]";
  4429. }
  4430. if (e instanceof t2) {
  4431. const t5 = [];
  4432. for (let n4 = 0; n4 < e.length(); n4++)
  4433. t5[n4] = te(e.get(n4));
  4434. return "[" + t5.join(",") + "]";
  4435. }
  4436. return e !== null && typeof e == "object" && e.castToText !== void 0 ? e.castToText() : v3(e) ? "object, Function" : "";
  4437. }
  4438. function K(e) {
  4439. const n3 = [];
  4440. if (L(e) === false)
  4441. return null;
  4442. if (e instanceof t2) {
  4443. for (let t5 = 0; t5 < e.length(); t5++)
  4444. n3[t5] = ne(e.get(t5));
  4445. return n3;
  4446. }
  4447. for (let t5 = 0; t5 < e.length; t5++)
  4448. n3[t5] = ne(e[t5]);
  4449. return n3;
  4450. }
  4451. function ee(e, n3) {
  4452. if (w(e))
  4453. return e;
  4454. if (e === null)
  4455. return "";
  4456. if (O(e))
  4457. return U(e, n3);
  4458. if (_(e))
  4459. return e.toString();
  4460. if (z(e))
  4461. return q(e, n3);
  4462. if (e instanceof p)
  4463. return e instanceof M ? '{"xmin":' + e.xmin.toString() + ',"ymin":' + e.ymin.toString() + "," + (e.hasZ ? '"zmin":' + e.zmin.toString() + "," : "") + (e.hasM ? '"mmin":' + e.mmin.toString() + "," : "") + '"xmax":' + e.xmax.toString() + ',"ymax":' + e.ymax.toString() + "," + (e.hasZ ? '"zmax":' + e.zmax.toString() + "," : "") + (e.hasM ? '"mmax":' + e.mmax.toString() + "," : "") + '"spatialReference":' + de(e.spatialReference) + "}" : de(e.toJSON(), (e2, t5) => e2.key === t5.key ? 0 : e2.key === "spatialReference" ? 1 : t5.key === "spatialReference" || e2.key < t5.key ? -1 : e2.key > t5.key ? 1 : 0);
  4464. if (L(e)) {
  4465. const t5 = [];
  4466. for (let n4 = 0; n4 < e.length; n4++)
  4467. t5[n4] = te(e[n4]);
  4468. return "[" + t5.join(",") + "]";
  4469. }
  4470. if (e instanceof t2) {
  4471. const t5 = [];
  4472. for (let n4 = 0; n4 < e.length(); n4++)
  4473. t5[n4] = te(e.get(n4));
  4474. return "[" + t5.join(",") + "]";
  4475. }
  4476. return e !== null && typeof e == "object" && e.castToText !== void 0 ? e.castToText() : v3(e) ? "object, Function" : "";
  4477. }
  4478. function te(e) {
  4479. if (e === null)
  4480. return "null";
  4481. if (_(e) || O(e) || w(e))
  4482. return JSON.stringify(e);
  4483. if (e instanceof p)
  4484. return ee(e);
  4485. if (e instanceof t2)
  4486. return ee(e);
  4487. if (e instanceof Array)
  4488. return ee(e);
  4489. if (e instanceof Date)
  4490. return JSON.stringify(q(e, ""));
  4491. if (e !== null && typeof e == "object") {
  4492. if (e.castToText !== void 0)
  4493. return e.castToText();
  4494. } else if (e === j2)
  4495. return "null";
  4496. return "null";
  4497. }
  4498. function ne(e, t5) {
  4499. return O(e) ? e : e === null || e === "" ? 0 : z(e) ? NaN : _(e) ? e ? 1 : 0 : L(e) || e === "" || e === void 0 ? NaN : t5 !== void 0 && w(e) ? (t5 = F2(t5, "\u2030", ""), t5 = F2(t5, "\xA4", ""), p2(e, { pattern: t5 })) : e === j2 ? 0 : Number(e);
  4500. }
  4501. function re(e) {
  4502. if (z(e))
  4503. return e;
  4504. if (w(e)) {
  4505. const t5 = ae(e);
  4506. if (t5)
  4507. return t5.toJSDate();
  4508. }
  4509. return null;
  4510. }
  4511. function ie(e) {
  4512. return z(e) ? DateTime.fromJSDate(e) : w(e) ? ae(e) : null;
  4513. }
  4514. function ae(e) {
  4515. const t5 = / (\d\d)/;
  4516. let n3 = DateTime.fromISO(e);
  4517. return n3.isValid || t5.test(e) && (e = e.replace(t5, "T$1"), n3 = DateTime.fromISO(e), n3.isValid) ? n3 : null;
  4518. }
  4519. function oe(e) {
  4520. return _(e) ? e : w(e) ? (e = e.toLowerCase()) === "true" : !!O(e) && (e !== 0 && !isNaN(e));
  4521. }
  4522. function se(e, t5) {
  4523. return t(e) ? null : (e.spatialReference !== null && e.spatialReference !== void 0 || (e.spatialReference = t5), e);
  4524. }
  4525. function ue(e) {
  4526. if (e === null)
  4527. return null;
  4528. if (e instanceof j)
  4529. return e.x === "NaN" || e.x === null || isNaN(e.x) ? null : e;
  4530. if (e instanceof v) {
  4531. if (e.rings.length === 0)
  4532. return null;
  4533. for (const t5 of e.rings)
  4534. if (t5.length > 0)
  4535. return e;
  4536. return null;
  4537. }
  4538. if (e instanceof m2) {
  4539. if (e.paths.length === 0)
  4540. return null;
  4541. for (const t5 of e.paths)
  4542. if (t5.length > 0)
  4543. return e;
  4544. return null;
  4545. }
  4546. return e instanceof m ? e.points.length === 0 ? null : e : e instanceof M ? e.xmin === "NaN" || e.xmin === null || isNaN(e.xmin) ? null : e : null;
  4547. }
  4548. function le(e, t5) {
  4549. if (!e)
  4550. return t5;
  4551. if (!e.domain)
  4552. return t5;
  4553. let n3 = null;
  4554. if (e.field.type === "string" || e.field.type === "esriFieldTypeString")
  4555. t5 = X(t5);
  4556. else {
  4557. if (t5 == null)
  4558. return null;
  4559. if (t5 === "")
  4560. return t5;
  4561. t5 = ne(t5);
  4562. }
  4563. for (let r = 0; r < e.domain.codedValues.length; r++) {
  4564. const i3 = e.domain.codedValues[r];
  4565. i3.code === t5 && (n3 = i3);
  4566. }
  4567. return n3 === null ? t5 : n3.name;
  4568. }
  4569. function fe(e, t5) {
  4570. if (!e)
  4571. return t5;
  4572. if (!e.domain)
  4573. return t5;
  4574. let n3 = null;
  4575. t5 = X(t5);
  4576. for (let r = 0; r < e.domain.codedValues.length; r++) {
  4577. const i3 = e.domain.codedValues[r];
  4578. i3.name === t5 && (n3 = i3);
  4579. }
  4580. return n3 === null ? t5 : n3.code;
  4581. }
  4582. function ce(e, t5, n3 = null, r = null) {
  4583. if (!t5)
  4584. return null;
  4585. if (!t5.fields)
  4586. return null;
  4587. let i3, a, o2 = null;
  4588. for (let s3 = 0; s3 < t5.fields.length; s3++) {
  4589. const n4 = t5.fields[s3];
  4590. n4.name.toLowerCase() === e.toString().toLowerCase() && (o2 = n4);
  4591. }
  4592. if (o2 === null)
  4593. throw new Error("Field not found");
  4594. return r === null && n3 && t5.typeIdField && (r = n3.hasField(t5.typeIdField) ? n3.field(t5.typeIdField) : null), r != null && t5.types.some(function(e2) {
  4595. return e2.id === r && (i3 = e2.domains && e2.domains[o2.name], i3 && i3.type === "inherited" && (i3 = me(o2.name, t5), a = true), true);
  4596. }), a || i3 || (i3 = me(e, t5)), { field: o2, domain: i3 };
  4597. }
  4598. function me(e, t5) {
  4599. let n3;
  4600. return t5.fields.some(function(t6) {
  4601. return t6.name.toLowerCase() === e.toLowerCase() && (n3 = t6.domain), !!n3;
  4602. }), n3;
  4603. }
  4604. function de(e, t5) {
  4605. t5 || (t5 = {}), typeof t5 == "function" && (t5 = { cmp: t5 });
  4606. const n3 = typeof t5.cycles == "boolean" && t5.cycles, r = t5.cmp && (i3 = t5.cmp, function(e2) {
  4607. return function(t6, n4) {
  4608. const r2 = { key: t6, value: e2[t6] }, a2 = { key: n4, value: e2[n4] };
  4609. return i3(r2, a2);
  4610. };
  4611. });
  4612. var i3;
  4613. const a = [];
  4614. return function e2(t6) {
  4615. if (t6 && t6.toJSON && typeof t6.toJSON == "function" && (t6 = t6.toJSON()), t6 === void 0)
  4616. return;
  4617. if (typeof t6 == "number")
  4618. return isFinite(t6) ? "" + t6 : "null";
  4619. if (typeof t6 != "object")
  4620. return JSON.stringify(t6);
  4621. let i4, o2;
  4622. if (Array.isArray(t6)) {
  4623. for (o2 = "[", i4 = 0; i4 < t6.length; i4++)
  4624. i4 && (o2 += ","), o2 += e2(t6[i4]) || "null";
  4625. return o2 + "]";
  4626. }
  4627. if (t6 === null)
  4628. return "null";
  4629. if (a.includes(t6)) {
  4630. if (n3)
  4631. return JSON.stringify("__cycle__");
  4632. throw new TypeError("Converting circular structure to JSON");
  4633. }
  4634. const s3 = a.push(t6) - 1, u = Object.keys(t6).sort(r && r(t6));
  4635. for (o2 = "", i4 = 0; i4 < u.length; i4++) {
  4636. const n4 = u[i4], r2 = e2(t6[n4]);
  4637. r2 && (o2 && (o2 += ","), o2 += JSON.stringify(n4) + ":" + r2);
  4638. }
  4639. return a.splice(s3, 1), "{" + o2 + "}";
  4640. }(e);
  4641. }
  4642. function ye(e) {
  4643. if (e === null)
  4644. return null;
  4645. const t5 = [];
  4646. for (const n3 of e)
  4647. n3 && n3.arcadeDeclaredClass && n3.arcadeDeclaredClass === "esri.arcade.Feature" ? t5.push(n3.geometry()) : t5.push(n3);
  4648. return t5;
  4649. }
  4650. function pe(e, t5) {
  4651. if (!(t5 instanceof j))
  4652. throw new Error("Invalid Argument");
  4653. e.push(t5.hasZ ? t5.hasM ? [t5.x, t5.y, t5.z, t5.m] : [t5.x, t5.y, t5.z] : [t5.x, t5.y]);
  4654. }
  4655. function ge(e, t5) {
  4656. if (L(e) || E(e)) {
  4657. let n3 = false, i3 = false, a = [], o2 = t5;
  4658. if (L(e)) {
  4659. for (const t6 of e)
  4660. pe(a, t6);
  4661. a.length > 0 && (o2 = e[0].spatialReference, n3 = e[0].hasZ, i3 = e[0].hasM);
  4662. } else if (e instanceof i)
  4663. a = e._elements, a.length > 0 && (n3 = e._hasZ, i3 = e._hasM, o2 = e.get(0).spatialReference);
  4664. else {
  4665. if (!E(e))
  4666. throw new Error("Invalid Argument");
  4667. for (const t6 of e.toArray())
  4668. pe(a, t6);
  4669. a.length > 0 && (o2 = e.get(0).spatialReference, n3 = e.get(0).hasZ === true, i3 = e.get(0).hasM === true);
  4670. }
  4671. if (a.length === 0)
  4672. return null;
  4673. return f(a, i3, n3) === false && (a = a.slice(0).reverse()), new v({ rings: [a], spatialReference: o2, hasZ: n3, hasM: i3 });
  4674. }
  4675. return e;
  4676. }
  4677. function he(e, t5) {
  4678. if (L(e) || E(e)) {
  4679. let n3 = false, i3 = false, a = [], o2 = t5;
  4680. if (L(e)) {
  4681. for (const t6 of e)
  4682. pe(a, t6);
  4683. a.length > 0 && (o2 = e[0].spatialReference, n3 = e[0].hasZ === true, i3 = e[0].hasM === true);
  4684. } else if (e instanceof i)
  4685. a = e._elements, a.length > 0 && (n3 = e._hasZ, i3 = e._hasM, o2 = e.get(0).spatialReference);
  4686. else if (E(e)) {
  4687. for (const t6 of e.toArray())
  4688. pe(a, t6);
  4689. a.length > 0 && (o2 = e.get(0).spatialReference, n3 = e.get(0).hasZ === true, i3 = e.get(0).hasM === true);
  4690. }
  4691. return a.length === 0 ? null : new m2({ paths: [a], spatialReference: o2, hasZ: n3, hasM: i3 });
  4692. }
  4693. return e;
  4694. }
  4695. function Se(e, t5) {
  4696. if (L(e) || E(e)) {
  4697. let n3 = false, i3 = false, a = [], s3 = t5;
  4698. if (L(e)) {
  4699. for (const t6 of e)
  4700. pe(a, t6);
  4701. a.length > 0 && (s3 = e[0].spatialReference, n3 = e[0].hasZ === true, i3 = e[0].hasM === true);
  4702. } else if (e instanceof i)
  4703. a = e._elements, a.length > 0 && (n3 = e._hasZ, i3 = e._hasM, s3 = e.get(0).spatialReference);
  4704. else if (E(e)) {
  4705. for (const t6 of e.toArray())
  4706. pe(a, t6);
  4707. a.length > 0 && (s3 = e.get(0).spatialReference, n3 = e.get(0).hasZ === true, i3 = e.get(0).hasM === true);
  4708. }
  4709. return a.length === 0 ? null : new m({ points: a, spatialReference: s3, hasZ: n3, hasM: i3 });
  4710. }
  4711. return e;
  4712. }
  4713. function xe(e, n3 = false) {
  4714. const r = [];
  4715. if (e === null)
  4716. return r;
  4717. if (L(e) === true) {
  4718. for (let t5 = 0; t5 < e.length; t5++) {
  4719. const i3 = X(e[t5]);
  4720. i3 === "" && n3 !== true || r.push(i3);
  4721. }
  4722. return r;
  4723. }
  4724. if (e instanceof t2) {
  4725. for (let t5 = 0; t5 < e.length(); t5++) {
  4726. const i3 = X(e.get(t5));
  4727. i3 === "" && n3 !== true || r.push(i3);
  4728. }
  4729. return r;
  4730. }
  4731. if (C(e)) {
  4732. const t5 = X(e);
  4733. return t5 === "" && n3 !== true || r.push(t5), r;
  4734. }
  4735. return [];
  4736. }
  4737. var be = 0;
  4738. function Te(e) {
  4739. return be++, be % 100 == 0 ? (be = 0, new Promise((t5) => {
  4740. setTimeout(() => {
  4741. t5(e);
  4742. }, 0);
  4743. })) : e;
  4744. }
  4745. function Ne(e, t5, n3) {
  4746. switch (n3) {
  4747. case "&":
  4748. return e & t5;
  4749. case "|":
  4750. return e | t5;
  4751. case "^":
  4752. return e ^ t5;
  4753. case "<<":
  4754. return e << t5;
  4755. case ">>":
  4756. return e >> t5;
  4757. case ">>>":
  4758. return e >>> t5;
  4759. }
  4760. }
  4761. function ke(e, n3 = null) {
  4762. return e == null ? null : _(e) || O(e) || w(e) ? e : e instanceof p ? n3?.keepGeometryType === true ? e : e.toJSON() : e instanceof t2 ? e.toArray().map((e2) => ke(e2, n3)) : e instanceof Array ? e.map((e2) => ke(e2, n3)) : e instanceof Date ? e : e !== null && typeof e == "object" && e.castAsJson !== void 0 ? e.castAsJson(n3) : null;
  4763. }
  4764. async function De(e, t5, n3, r, i3) {
  4765. const a = await Me(e, t5, n3);
  4766. i3[r] = a;
  4767. }
  4768. async function Me(e, n3 = null, r = null) {
  4769. if (e instanceof t2 && (e = e.toArray()), e == null)
  4770. return null;
  4771. if (C(e) || e instanceof p || e instanceof Date)
  4772. return ke(e, r);
  4773. if (e instanceof Array) {
  4774. const t5 = [], i3 = [];
  4775. for (const o2 of e)
  4776. o2 === null || C(o2) || o2 instanceof p || o2 instanceof Date ? i3.push(ke(o2, r)) : (i3.push(null), t5.push(De(o2, n3, r, i3.length - 1, i3)));
  4777. return t5.length > 0 && await Promise.all(t5), i3;
  4778. }
  4779. return e !== null && typeof e == "object" && e.castAsJsonAsync !== void 0 ? e.castAsJsonAsync(n3, r) : null;
  4780. }
  4781. function je(e, t5, n3) {
  4782. const r = e.fullSchema();
  4783. if (r === null)
  4784. return null;
  4785. if (!r.fields)
  4786. return null;
  4787. return ce(t5, r, e, n3);
  4788. }
  4789. function Ae(e) {
  4790. const t5 = e.fullSchema();
  4791. return t5 === null ? null : t5.fields && t5.typeIdField ? { subtypeField: t5.typeIdField, subtypes: t5.types ? t5.types.map((e2) => ({ name: e2.name, code: e2.id })) : [] } : null;
  4792. }
  4793. function Re(e, t5, n3, r) {
  4794. const i3 = e.fullSchema();
  4795. if (i3 === null)
  4796. return null;
  4797. if (!i3.fields)
  4798. return null;
  4799. const a = ce(t5, i3, e, r);
  4800. if (n3 === void 0)
  4801. try {
  4802. n3 = e.field(t5);
  4803. } catch (o2) {
  4804. return null;
  4805. }
  4806. return le(a, n3);
  4807. }
  4808. function Fe(e, t5, n3, r) {
  4809. const i3 = e.fullSchema();
  4810. if (i3 === null)
  4811. return null;
  4812. if (!i3.fields)
  4813. return null;
  4814. if (n3 === void 0) {
  4815. try {
  4816. n3 = e.field(t5);
  4817. } catch (a) {
  4818. return null;
  4819. }
  4820. return n3;
  4821. }
  4822. return fe(ce(t5, i3, e, r), n3);
  4823. }
  4824. function ve(e) {
  4825. const t5 = e.fullSchema();
  4826. if (t5 === null)
  4827. return null;
  4828. if (!t5.fields)
  4829. return null;
  4830. const n3 = [];
  4831. for (const r of t5.fields)
  4832. n3.push(o(r));
  4833. return { objectIdField: t5.objectIdField, globalIdField: t5.globalIdField, geometryType: v2[t5.geometryType] === void 0 ? "" : v2[t5.geometryType], fields: n3 };
  4834. }
  4835. var Ce = Object.freeze(Object.defineProperty({ __proto__: null, ReturnResultE: S2, ImplicitResultE: x, NativeFunctionE: b2, SizzleFunctionE: T, NativeFunction: N, ImplicitResult: k, ReturnResult: D2, SizzleFunction: M2, voidOperation: j2, breakResult: A, continueResult: R, multiReplace: F2, isFunctionParameter: v3, isSimpleType: C, defaultUndefined: I, isString: w, isBoolean: _, isNumber: O, isInteger: Z, isArray: L, isFeature: Y, isFeatureSet: J, isFeatureSetCollection: P2, isImmutableArray: E, isDate: z, pcCheck: G, absRound: V, generateUUID: H, formatNumber: U, formatDate: q, standardiseDateFormat: $, greaterThanLessThan: W, equalityTest: Q, toString: X, toNumberArray: K, toStringExplicit: ee, toNumber: ne, toDate: re, toDateTime: ie, toBoolean: oe, fixSpatialReference: se, fixNullGeometry: ue, getDomainValue: le, getDomainCode: fe, getDomain: ce, stableStringify: de, autoCastFeatureToGeometry: ye, autoCastArrayOfPointsToPolygon: ge, autoCastArrayOfPointsToPolyline: he, autoCastArrayOfPointsToMultiPoint: Se, toStringArray: xe, tick: Te, binaryOperator: Ne, castAsJson: ke, castAsJsonAsync: Me, featureFullDomain: je, featureSubtypes: Ae, featureDomainValueLookup: Re, featureDomainCodeLookup: Fe, featureSchema: ve }, Symbol.toStringTag, { value: "Module" }));
  4836. export {
  4837. t2 as t,
  4838. t3 as t2,
  4839. i,
  4840. h,
  4841. DateTime,
  4842. t4 as t3,
  4843. i2,
  4844. n,
  4845. o,
  4846. l2 as l,
  4847. y2 as y,
  4848. c,
  4849. m3 as m,
  4850. d,
  4851. f2 as f,
  4852. F,
  4853. S,
  4854. v2 as v,
  4855. P,
  4856. b,
  4857. D,
  4858. N,
  4859. k,
  4860. D2,
  4861. M2 as M,
  4862. j2 as j,
  4863. A,
  4864. R,
  4865. F2,
  4866. v3 as v2,
  4867. C,
  4868. I,
  4869. w,
  4870. _,
  4871. O,
  4872. Z,
  4873. L,
  4874. Y,
  4875. J,
  4876. P2,
  4877. E,
  4878. z,
  4879. G,
  4880. V,
  4881. H,
  4882. $,
  4883. W,
  4884. Q,
  4885. X,
  4886. K,
  4887. ee,
  4888. ne,
  4889. re,
  4890. ie,
  4891. oe,
  4892. se,
  4893. ue,
  4894. le,
  4895. fe,
  4896. ce,
  4897. ye,
  4898. ge,
  4899. he,
  4900. Se,
  4901. xe,
  4902. Te,
  4903. Ne,
  4904. ke,
  4905. Me,
  4906. je,
  4907. Ae,
  4908. Re,
  4909. Fe,
  4910. ve,
  4911. Ce
  4912. };
  4913. //# sourceMappingURL=chunk-25BNEBXZ.js.map