123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566 |
- import {
- C,
- t as t5
- } from "./chunk-LSDW2622.js";
- import {
- e as e4,
- t as t3
- } from "./chunk-IQNZZCQJ.js";
- import {
- w as w2
- } from "./chunk-TODU7HVH.js";
- import {
- n as n3
- } from "./chunk-PZKZIMMP.js";
- import {
- A,
- B,
- C as C2,
- K,
- O,
- P,
- R,
- U as U2,
- X,
- Y,
- Z,
- a,
- ie,
- k,
- l as l3,
- m as m3,
- ne,
- o as o3,
- oe,
- u as u3,
- w,
- y as y2
- } from "./chunk-YLVXZ2PS.js";
- import {
- dt,
- f as f2,
- j
- } from "./chunk-WFSV2B2I.js";
- import {
- n as n2,
- t as t4
- } from "./chunk-MFFE4I2S.js";
- import {
- a as a2,
- n
- } from "./chunk-XBH7TGC2.js";
- import {
- e as e5,
- h,
- i,
- o as o4
- } from "./chunk-K3NA3LQS.js";
- import {
- M,
- f as f3
- } from "./chunk-TRK7CKWP.js";
- import {
- r as r2,
- z
- } from "./chunk-6P6NA7JB.js";
- import {
- l as l2
- } from "./chunk-7XXXCK2A.js";
- import {
- m as m2,
- o as o2,
- u as u2
- } from "./chunk-N2663GRX.js";
- import {
- e as e3,
- u
- } from "./chunk-WEMIK25H.js";
- import {
- c as c3,
- o2 as o
- } from "./chunk-XNLG7T2T.js";
- import {
- c as c2,
- f,
- l,
- s as s3,
- y
- } from "./chunk-2Z6LERTI.js";
- import {
- c,
- e as e2
- } from "./chunk-OWVBLVP3.js";
- import {
- U
- } from "./chunk-VNFRAYHO.js";
- import {
- e
- } from "./chunk-WSRBH7BF.js";
- import {
- g
- } from "./chunk-ULGDPLM2.js";
- import {
- s,
- s3 as s2
- } from "./chunk-EMJ4ZSM2.js";
- import {
- m
- } from "./chunk-IKP3YN53.js";
- import {
- r,
- t,
- t2
- } from "./chunk-GZT4BVFP.js";
- // node_modules/@arcgis/core/core/BidiText.js
- var i2 = new C();
- function n4(r18) {
- if (!i2.hasBidiChar(r18))
- return [r18, false];
- let n17;
- return n17 = i2.checkContextual(r18) === "rtl" ? "IDNNN" : "ICNNN", [i2.bidiTransform(r18, n17, "VLYSN"), true];
- }
- // node_modules/@arcgis/core/symbols/cim/CIMResourceManager.js
- var o5 = ";base64,";
- var s4 = class {
- constructor() {
- this._resourceMap = new Map(), this._inFlightResourceMap = new Map(), this.geometryEngine = null;
- }
- destroy() {
- this._inFlightResourceMap.clear(), this._resourceMap.clear();
- }
- getResource(e11) {
- return this._resourceMap.get(e11) ?? null;
- }
- async fetchResource(e11, r18) {
- const t8 = { width: 0, height: 0 }, o11 = this._resourceMap, s10 = o11.get(e11);
- if (s10)
- return t8.width = s10.width, t8.height = s10.height, t8;
- let c9 = this._inFlightResourceMap.get(e11);
- return c9 || (c9 = i3(e11, r18), this._inFlightResourceMap.set(e11, c9), c9 = c9.then((r19) => {
- if (this._inFlightResourceMap.delete(e11), r19.ok) {
- o11.set(e11, r19.value);
- const s11 = r19.value;
- return t8.width = s11.width, t8.height = s11.height, t8;
- }
- return t8;
- }), c9);
- }
- deleteResource(e11) {
- this._inFlightResourceMap.delete(e11), this._resourceMap.delete(e11);
- }
- };
- function i3(s10, i8) {
- if (s10.includes(o5)) {
- const e11 = new Image();
- return e11.src = s10, e11.decode().then(() => ({ ok: true, value: e11 })).catch((e12) => g(e12) ? { ok: false, error: e12 } : { ok: false, error: new s2("invalid-resource", `Could not fetch requested resource at ${s10}`) });
- }
- return U(s10, { responseType: "image", ...i8 }).then((e11) => ({ ok: true, value: e11.data })).catch((e11) => g(e11) ? { ok: false, error: e11 } : { ok: false, error: new s2("invalid-resource", `Could not fetch requested resource at ${s10}`) });
- }
- // node_modules/@arcgis/core/symbols/cim/TextRasterizer.js
- function e6(t8) {
- return `rgb(${t8.slice(0, 3).toString()})`;
- }
- function i4(t8) {
- return `rgba(${t8.slice(0, 3).toString()},${t8[3]})`;
- }
- var s5 = class {
- rasterizeText(t8, s10) {
- this._textRasterizationCanvas || (this._textRasterizationCanvas = document.createElement("canvas"));
- const r18 = this._textRasterizationCanvas, o11 = r18.getContext("2d");
- this._setFontProperties(o11, s10), this.parameters = s10, this.textLines = t8.split(/\r?\n/), this.lineHeight = this._computeLineHeight();
- const h6 = this._computeTextWidth(o11, s10), { decoration: a10, weight: l9 } = s10.font;
- this.lineThroughWidthOffset = a10 && a10 === "line-through" ? 0.1 * this.lineHeight : 0;
- const d2 = this.lineHeight * this.textLines.length;
- r18.width = h6 + 2 * this.lineThroughWidthOffset, r18.height = d2, this.renderedLineHeight = Math.round(this.lineHeight * s10.pixelRatio), this.renderedHaloSize = s10.halo.size * s10.pixelRatio, this.renderedWidth = h6 * s10.pixelRatio, this.renderedHeight = d2 * s10.pixelRatio, this.lineThroughWidthOffset *= s10.pixelRatio, this.fillStyle = i4(s10.color), this.haloStyle = e6(s10.halo.color);
- const c9 = this.renderedLineHeight, g5 = this.renderedHaloSize;
- this._setFontProperties(o11, s10);
- const f8 = n5(o11.textAlign, this.renderedWidth) + g5, u9 = g5, p3 = g5 > 0;
- let x3 = this.lineThroughWidthOffset, m7 = 0;
- p3 && this._renderHalo(o11, f8, u9, x3, m7, s10), m7 += u9, x3 += f8;
- for (const e11 of this.textLines)
- o11.globalCompositeOperation = "destination-out", o11.fillStyle = "rgb(0, 0, 0)", o11.fillText(e11, x3, m7), o11.globalCompositeOperation = "source-over", o11.fillStyle = this.fillStyle, o11.fillText(e11, x3, m7), a10 && a10 !== "none" && this._renderDecoration(o11, x3, m7, a10, l9), m7 += c9;
- const _4 = this.renderedWidth + 2 * this.lineThroughWidthOffset, H3 = this.renderedHeight, z3 = o11.getImageData(0, 0, _4, H3), w4 = new Uint8Array(z3.data);
- if (s10.premultiplyColors) {
- let t9;
- for (let e11 = 0; e11 < w4.length; e11 += 4)
- t9 = w4[e11 + 3] / 255, w4[e11] = w4[e11] * t9, w4[e11 + 1] = w4[e11 + 1] * t9, w4[e11 + 2] = w4[e11 + 2] * t9;
- }
- return { size: [_4, H3], image: new Uint32Array(w4.buffer), sdf: false, simplePattern: false, anchorX: 0, anchorY: 0 };
- }
- _renderHalo(t8, e11, i8, s10, n17, r18) {
- const o11 = this.renderedWidth, h6 = this.renderedHeight;
- this._haloRasterizationCanvas || (this._haloRasterizationCanvas = document.createElement("canvas")), this._haloRasterizationCanvas.width = o11, this._haloRasterizationCanvas.height = h6;
- const a10 = this._haloRasterizationCanvas, l9 = a10.getContext("2d");
- l9.clearRect(0, 0, o11, h6), this._setFontProperties(l9, r18);
- const { decoration: d2, weight: c9 } = r18.font;
- l9.fillStyle = this.haloStyle, l9.strokeStyle = this.haloStyle;
- const g5 = this.renderedHaloSize < 3;
- l9.lineJoin = g5 ? "miter" : "round", g5 ? this._renderHaloEmulated(l9, e11, i8, d2, c9) : this._renderHaloNative(l9, e11, i8, d2, c9), t8.globalAlpha = this.parameters.halo.color[3], t8.drawImage(a10, 0, 0, o11, h6, s10, n17, o11, h6), t8.globalAlpha = 1;
- }
- _renderHaloEmulated(t8, e11, i8, s10, n17) {
- const o11 = this.renderedLineHeight, h6 = this.renderedHaloSize;
- for (const a10 of this.textLines) {
- for (const [s11, n18] of r3)
- t8.fillText(a10, e11 + h6 * s11, i8 + h6 * n18);
- s10 && s10 !== "none" && this._renderDecoration(t8, e11, i8, s10, n17), i8 += o11;
- }
- }
- _renderHaloNative(t8, e11, i8, s10, n17) {
- const r18 = this.renderedLineHeight, o11 = this.renderedHaloSize;
- for (const h6 of this.textLines) {
- const a10 = 2 * o11, l9 = 5, d2 = 0.1;
- for (let r19 = 0; r19 < l9; r19++) {
- const o12 = 1 - (l9 - 1) * d2 + r19 * d2;
- t8.lineWidth = o12 * a10, t8.strokeText(h6, e11, i8), s10 && s10 !== "none" && this._renderDecoration(t8, e11, i8, s10, n17);
- }
- i8 += r18;
- }
- }
- _setFontProperties(e11, i8) {
- const s10 = i8.font, n17 = `${s10.style} ${s10.weight} ${u(i8.size * i8.pixelRatio)}px ${s10.family}, sans-serif`;
- let r18;
- switch (e11.font = n17, e11.textBaseline = "top", i8.horizontalAlignment) {
- case "left":
- default:
- r18 = "left";
- break;
- case "right":
- r18 = "right";
- break;
- case "center":
- r18 = "center";
- }
- e11.textAlign = r18;
- }
- computeTextSize(t8, e11) {
- this._textRasterizationCanvas || (this._textRasterizationCanvas = document.createElement("canvas"));
- const i8 = this._textRasterizationCanvas, s10 = i8.getContext("2d");
- this._setFontProperties(s10, e11), this.parameters = e11, this.textLines = t8.split(/\r?\n/), this.lineHeight = this._computeLineHeight();
- const n17 = this._computeTextWidth(s10, e11), r18 = this.lineHeight * this.textLines.length;
- return i8.width = n17, i8.height = r18, [n17 * e11.pixelRatio, r18 * e11.pixelRatio];
- }
- _computeTextWidth(t8, e11) {
- let i8 = 0;
- for (const n17 of this.textLines)
- i8 = Math.max(i8, t8.measureText(n17).width);
- const s10 = e11.font;
- return (s10.style === "italic" || s10.style === "oblique" || typeof s10.weight == "string" && (s10.weight === "bold" || s10.weight === "bolder") || typeof s10.weight == "number" && s10.weight > 600) && (i8 += 0.3 * t8.measureText("w").width), i8 += 2 * this.parameters.halo.size, Math.round(i8);
- }
- _computeLineHeight() {
- let t8 = 1.275 * this.parameters.size;
- const e11 = this.parameters.font.decoration;
- return e11 && e11 === "underline" && (t8 *= 1.3), Math.round(t8 + 2 * this.parameters.halo.size);
- }
- _renderDecoration(t8, e11, i8, s10, n17) {
- const r18 = 0.9 * this.lineHeight, o11 = n17 === "bold" ? 0.06 : n17 === "bolder" ? 0.09 : 0.04;
- switch (t8.textAlign) {
- case "center":
- e11 -= this.renderedWidth / 2;
- break;
- case "right":
- e11 -= this.renderedWidth;
- }
- const h6 = t8.textBaseline;
- if (s10 === "underline")
- switch (h6) {
- case "top":
- i8 += r18;
- break;
- case "middle":
- i8 += r18 / 2;
- }
- else if (s10 === "line-through")
- switch (h6) {
- case "top":
- i8 += r18 / 1.5;
- break;
- case "middle":
- i8 += r18 / 3;
- }
- t8.save(), t8.beginPath(), t8.strokeStyle = t8.fillStyle, t8.lineWidth = Math.ceil(r18 * o11), t8.moveTo(e11 - this.lineThroughWidthOffset, i8), t8.lineTo(e11 + this.renderedWidth + 2 * this.lineThroughWidthOffset, i8), t8.stroke(), t8.restore();
- }
- };
- function n5(t8, e11) {
- return t8 === "center" ? 0.5 * e11 : t8 === "right" ? e11 : 0;
- }
- var r3 = [];
- {
- const t8 = 16;
- for (let e11 = 0; e11 < 360; e11 += 360 / t8)
- r3.push([Math.cos(Math.PI * e11 / 180), Math.sin(Math.PI * e11 / 180)]);
- }
- // node_modules/@arcgis/core/core/floatRGBA.js
- function o6(o11, r18, e11 = 0) {
- const i8 = o(o11, 0, f4);
- for (let t8 = 0; t8 < 4; t8++)
- r18[e11 + t8] = Math.floor(256 * l4(i8 * n6[t8]));
- }
- function r4(t8, o11 = 0) {
- let r18 = 0;
- for (let n17 = 0; n17 < 4; n17++)
- r18 += t8[o11 + n17] * e7[n17];
- return r18;
- }
- var n6 = [1, 256, 65536, 16777216];
- var e7 = [1 / 256, 1 / 65536, 1 / 16777216, 1 / 4294967296];
- var f4 = r4(new Uint8ClampedArray([255, 255, 255, 255]));
- function l4(t8) {
- return t8 - Math.floor(t8);
- }
- // node_modules/@arcgis/core/symbols/cim/CIMPlacements.js
- var t6 = class {
- constructor() {
- this.setIdentity();
- }
- getAngle() {
- return (this.rz == null || this.rz === 0 && this.rz_c !== 1 && this.rz_s !== 0) && (this.rz = Math.atan2(this.rz_s, this.rz_c)), this.rz;
- }
- setIdentity() {
- this.tx = 0, this.ty = 0, this.tz = 0, this.s = 1, this.rx = 0, this.ry = 0, this.rz = 0, this.rz_c = 1, this.rz_s = 0;
- }
- setTranslate(t8, s10) {
- this.tx = t8, this.ty = s10;
- }
- setTranslateZ(t8) {
- this.tz = t8;
- }
- setRotateCS(t8, s10) {
- this.rz = void 0, this.rz_c = t8, this.rz_s = s10;
- }
- setRotate(t8) {
- this.rz = t8, this.rz_c = void 0, this.rz_s = void 0;
- }
- setRotateY(t8) {
- this.ry = t8;
- }
- setScale(t8) {
- this.s = t8;
- }
- setMeasure(t8) {
- this.m = t8;
- }
- };
- // node_modules/@arcgis/core/symbols/cim/CIMEffects.js
- var r5 = class {
- constructor(t8) {
- this._geometry = t8;
- }
- next() {
- const t8 = this._geometry;
- return this._geometry = null, t8;
- }
- };
- // node_modules/@arcgis/core/symbols/cim/CIMCursor.js
- function a3(i8) {
- const n17 = m(i8);
- return P2(n17), n17;
- }
- function r6(t8) {
- if (!t8)
- return null;
- l(t8) ? t8.y = -t8.y : c2(t8) ? l5(t8.rings) : y(t8) ? l5(t8.paths) : f(t8) && u4(t8.points);
- }
- function u4(t8) {
- if (t8) {
- const i8 = t8.length;
- for (let n17 = 0; n17 < i8; n17++)
- t8[n17][1] = -t8[n17][1];
- }
- }
- function l5(t8) {
- if (t8)
- for (const i8 of t8)
- u4(i8);
- }
- function c4(t8) {
- if (t8) {
- for (let i8 = t8.length - 1; i8 > 0; --i8)
- t8[i8][0] -= t8[i8 - 1][0], t8[i8][1] -= t8[i8 - 1][1];
- }
- }
- function f5(t8) {
- if (t8)
- for (const i8 of t8)
- c4(i8);
- }
- function p(t8) {
- if (t8) {
- const i8 = t8.length;
- for (let n17 = 1; n17 < i8; ++n17)
- t8[n17][0] += t8[n17 - 1][0], t8[n17][1] += t8[n17 - 1][1];
- }
- }
- function m4(t8) {
- if (t8)
- for (const i8 of t8)
- p(i8);
- }
- function P2(t8) {
- t8 && (c2(t8) ? m4(t8.rings) : y(t8) ? m4(t8.paths) : f(t8) && p(t8.points), r6(t8));
- }
- function x(t8) {
- t8 && (r6(t8), c2(t8) ? f5(t8.rings) : y(t8) ? f5(t8.paths) : f(t8) && c4(t8.points));
- }
- function g2(t8) {
- if (t8)
- for (const i8 of t8)
- d(i8);
- }
- function d(t8) {
- t8 && t8.reverse();
- }
- function y3(t8, i8, n17) {
- return [t8[0] + (i8[0] - t8[0]) * n17, t8[1] + (i8[1] - t8[1]) * n17];
- }
- function C3(t8) {
- return !(!t8 || t8.length === 0) && (t8[0][0] === t8[t8.length - 1][0] && t8[0][1] === t8[t8.length - 1][1]);
- }
- function I(t8) {
- return t8[4];
- }
- function j2(t8, i8) {
- t8[4] = i8;
- }
- var G = class {
- constructor(t8, s10, e11, a10) {
- this.acceptPolygon = s10, this.acceptPolyline = e11, this.geomUnitsPerPoint = a10, this.pathCount = -1, this.pathIndex = -1, this.iteratePath = false, t8 && (c2(t8) ? s10 && (this.multiPath = t8.rings, this.isClosed = true) : y(t8) ? e11 && (this.multiPath = t8.paths, this.isClosed = false) : s3(t8) && s10 && (this.multiPath = b(t8).rings, this.isClosed = true), this.multiPath && (this.pathCount = this.multiPath.length)), this.internalPlacement = new t6();
- }
- next() {
- if (!this.multiPath)
- return null;
- for (; this.iteratePath || this.pathIndex < this.pathCount - 1; ) {
- this.iteratePath || this.pathIndex++;
- const t8 = this.processPath(this.multiPath[this.pathIndex]);
- if (t8)
- return t8;
- }
- return this.pathCount = -1, this.pathIndex = -1, this.multiPath = null, null;
- }
- };
- var U3 = class {
- constructor(t8, i8, n17, s10) {
- this.inputGeometries = t8, this.acceptPolygon = i8, this.acceptPolyline = n17, this.geomUnitsPerPoint = s10, this.pathCount = -1, this.pathIndex = -1, this.iteratePath = false;
- }
- next() {
- for (; ; ) {
- if (!this.multiPath) {
- let t8 = this.inputGeometries.next();
- for (; t8; ) {
- if (c2(t8) ? this.acceptPolygon && (this.multiPath = t8.rings, this.isClosed = true) : y(t8) ? this.acceptPolyline && (this.multiPath = t8.paths, this.isClosed = false) : s3(t8) && this.acceptPolygon && (this.multiPath = b(t8).rings, this.isClosed = true), this.multiPath) {
- this.pathCount = this.multiPath.length, this.pathIndex = -1;
- break;
- }
- t8 = this.inputGeometries.next();
- }
- if (!this.multiPath)
- return null;
- }
- for (; this.iteratePath || this.pathIndex < this.pathCount - 1; ) {
- this.iteratePath || this.pathIndex++;
- const t8 = this.processPath(this.multiPath[this.pathIndex]);
- if (t8)
- return t8;
- }
- this.pathCount = -1, this.pathIndex = -1, this.multiPath = null;
- }
- }
- };
- function b(t8) {
- return { rings: [[[t8.xmin, t8.ymin], [t8.xmin, t8.ymax], [t8.xmax, t8.ymax], [t8.xmax, t8.ymin], [t8.xmin, t8.ymin]]] };
- }
- // node_modules/@arcgis/core/symbols/cim/effects/EffectAddControlPoints.js
- var o7 = class {
- static local() {
- return o7.instance === null && (o7.instance = new o7()), o7.instance;
- }
- execute(s10, t8, e11, i8) {
- return new r7(s10, t8, e11);
- }
- };
- o7.instance = null;
- var r7 = class {
- constructor(s10, t8, e11) {
- this._inputGeometries = s10, this._angleTolerance = t8.angleTolerance !== void 0 ? t8.angleTolerance : 120, this._maxCosAngle = Math.cos((1 - Math.abs(this._angleTolerance) / 180) * Math.PI);
- }
- next() {
- let n17 = this._inputGeometries.next();
- for (; n17; ) {
- if (c2(n17)) {
- this._isClosed = true;
- const t8 = m(n17);
- return this._processMultipath(t8.rings), t8;
- }
- if (y(n17)) {
- this._isClosed = false;
- const t8 = m(n17);
- return this._processMultipath(t8.paths), t8;
- }
- if (s3(n17)) {
- if (this._maxCosAngle)
- return n17;
- this._isClosed = true;
- const s10 = [[n17.xmin, n17.ymin], [n17.xmin, n17.ymax], [n17.xmax, n17.ymax], [n17.xmax, n17.ymin], [n17.xmin, n17.ymin]];
- return this._processPath(s10), { rings: [s10] };
- }
- n17 = this._inputGeometries.next();
- }
- return null;
- }
- _processMultipath(s10) {
- if (s10)
- for (const t8 of s10)
- this._processPath(t8);
- }
- _processPath(s10) {
- if (s10) {
- let t8, e11, i8, o11, r18, l9, a10 = s10.length, h6 = s10[0];
- this._isClosed && ++a10;
- for (let c9 = 1; c9 < a10; ++c9) {
- let m7;
- m7 = this._isClosed && c9 === a10 - 1 ? s10[0] : s10[c9];
- const _4 = m7[0] - h6[0], u9 = m7[1] - h6[1], p3 = Math.sqrt(_4 * _4 + u9 * u9);
- if (c9 > 1 && p3 > 0 && i8 > 0) {
- (t8 * _4 + e11 * u9) / p3 / i8 <= this._maxCosAngle && j2(h6, 1);
- }
- c9 === 1 && (o11 = _4, r18 = u9, l9 = p3), p3 > 0 && (h6 = m7, t8 = _4, e11 = u9, i8 = p3);
- }
- if (this._isClosed && i8 > 0 && l9 > 0) {
- (t8 * o11 + e11 * r18) / l9 / i8 <= this._maxCosAngle && j2(s10[0], 1);
- }
- }
- }
- };
- // node_modules/@arcgis/core/symbols/cim/CurveHelper.js
- var e8 = 0.03;
- var s6 = class {
- constructor() {
- this._path = [];
- }
- path() {
- return this._path;
- }
- addPath(t8, e11) {
- e11 || t8.reverse(), Array.prototype.push.apply(this._path, t8), e11 || t8.reverse();
- }
- static mergePath(t8, e11) {
- e11 && Array.prototype.push.apply(t8, e11);
- }
- startPath(t8) {
- this._path.push(t8);
- }
- lineTo(t8) {
- this._path.push(t8);
- }
- close() {
- const t8 = this._path;
- t8.length > 1 && (t8[0][0] === t8[t8.length - 1][0] && t8[0][1] === t8[t8.length - 1][1] || t8.push([t8[0][0], t8[0][1]]));
- }
- };
- var n7 = class {
- constructor(t8 = 0, e11 = false) {
- }
- normalize(t8) {
- const e11 = Math.sqrt(t8[0] * t8[0] + t8[1] * t8[1]);
- e11 !== 0 && (t8[0] /= e11, t8[1] /= e11);
- }
- calculateLength(t8, e11) {
- const s10 = e11[0] - t8[0], n17 = e11[1] - t8[1];
- return Math.sqrt(s10 * s10 + n17 * n17);
- }
- calculateSegLength(t8, e11) {
- return this.calculateLength(t8[e11], t8[e11 + 1]);
- }
- calculatePathLength(t8) {
- let e11 = 0;
- const s10 = t8 ? t8.length : 0;
- for (let n17 = 0; n17 < s10 - 1; ++n17)
- e11 += this.calculateSegLength(t8, n17);
- return e11;
- }
- calculatePathArea(t8) {
- let e11 = 0;
- const s10 = t8 ? t8.length : 0;
- for (let n17 = 0; n17 < s10 - 1; ++n17)
- e11 += (t8[n17 + 1][0] - t8[n17][0]) * (t8[n17 + 1][1] + t8[n17][1]);
- return e11 / 2;
- }
- getCoord2D(t8, e11, s10) {
- return [t8[0] + (e11[0] - t8[0]) * s10, t8[1] + (e11[1] - t8[1]) * s10];
- }
- getSegCoord2D(t8, e11, s10) {
- return this.getCoord2D(t8[e11], t8[e11 + 1], s10);
- }
- getAngle(t8, e11, s10) {
- const n17 = e11[0] - t8[0], r18 = e11[1] - t8[1];
- return Math.atan2(r18, n17);
- }
- getSegAngle(t8, e11, s10) {
- return this.getAngle(t8[e11], t8[e11 + 1], s10);
- }
- getAngleCS(t8, e11, s10) {
- const n17 = e11[0] - t8[0], r18 = e11[1] - t8[1], h6 = Math.sqrt(n17 * n17 + r18 * r18);
- return h6 > 0 ? [n17 / h6, r18 / h6] : [1, 0];
- }
- getSegAngleCS(t8, e11, s10) {
- return this.getAngleCS(t8[e11], t8[e11 + 1], s10);
- }
- cut(t8, e11, s10, n17) {
- return [s10 <= 0 ? t8[e11] : this.getSegCoord2D(t8, e11, s10), n17 >= 1 ? t8[e11 + 1] : this.getSegCoord2D(t8, e11, n17)];
- }
- addSegment(t8, e11, s10) {
- s10 && t8.push(e11[0]), t8.push(e11[1]);
- }
- getSubCurve(t8, e11, s10) {
- const n17 = [];
- return this.appendSubCurve(n17, t8, e11, s10) ? n17 : null;
- }
- appendSubCurve(t8, e11, s10, n17) {
- const r18 = e11 ? e11.length - 1 : 0;
- let h6 = 0, l9 = true, o11 = 0;
- for (; o11 < r18; ) {
- const r19 = this.calculateSegLength(e11, o11);
- if (r19 !== 0) {
- if (l9) {
- if (h6 + r19 > s10) {
- const a10 = (s10 - h6) / r19;
- let u9 = 1, c9 = false;
- h6 + r19 >= n17 && (u9 = (n17 - h6) / r19, c9 = true);
- const i8 = this.cut(e11, o11, a10, u9);
- if (i8 && this.addSegment(t8, i8, l9), c9)
- break;
- l9 = false;
- }
- } else {
- if (h6 + r19 > n17) {
- const s11 = this.cut(e11, o11, 0, (n17 - h6) / r19);
- s11 && this.addSegment(t8, s11, l9);
- break;
- }
- this.addSegment(t8, [e11[o11], e11[o11 + 1]], l9);
- }
- h6 += r19, ++o11;
- } else
- ++o11;
- }
- return true;
- }
- getCIMPointAlong(t8, e11) {
- const s10 = t8 ? t8.length - 1 : 0;
- let n17 = 0, r18 = -1;
- for (; r18 < s10; ) {
- ++r18;
- const s11 = this.calculateSegLength(t8, r18);
- if (s11 !== 0) {
- if (n17 + s11 > e11) {
- const h6 = (e11 - n17) / s11;
- return this.getCoord2D(t8[r18], t8[r18 + 1], h6);
- }
- n17 += s11;
- }
- }
- return null;
- }
- isEmpty(t8, e11) {
- if (!t8 || t8.length <= 1)
- return true;
- const s10 = t8 ? t8.length - 1 : 0;
- let n17 = -1;
- for (; n17 < s10; ) {
- if (++n17, t8[n17 + 1][0] !== t8[n17][0] || t8[n17 + 1][1] !== t8[n17][1])
- return false;
- if (e11 && t8[n17 + 1][2] !== t8[n17][2])
- return false;
- }
- return true;
- }
- offset(e11, s10, n17, r18, h6) {
- if (!e11 || e11.length < 2)
- return null;
- let l9 = 0, o11 = e11[l9++], a10 = l9;
- for (; l9 < e11.length; ) {
- const t8 = e11[l9];
- t8[0] === o11[0] && t8[1] === o11[1] || (l9 !== a10 && (e11[a10] = e11[l9]), o11 = e11[a10++]), l9++;
- }
- const u9 = e11[0][0] === e11[a10 - 1][0] && e11[0][1] === e11[a10 - 1][1];
- if (u9 && --a10, a10 < (u9 ? 3 : 2))
- return null;
- const c9 = [];
- o11 = u9 ? e11[a10 - 1] : null;
- let i8 = e11[0];
- for (let g5 = 0; g5 < a10; g5++) {
- const h7 = g5 === a10 - 1 ? u9 ? e11[0] : null : e11[g5 + 1];
- if (o11)
- if (h7) {
- const e12 = [h7[0] - i8[0], h7[1] - i8[1]];
- this.normalize(e12);
- const l10 = [i8[0] - o11[0], i8[1] - o11[1]];
- this.normalize(l10);
- const a11 = l10[0] * e12[1] - l10[1] * e12[0], u10 = l10[0] * e12[0] + l10[1] * e12[1];
- if (a11 === 0 && u10 === 1) {
- i8 = h7;
- continue;
- }
- if (a11 >= 0 == s10 <= 0) {
- if (u10 < 1) {
- const t8 = [e12[0] - l10[0], e12[1] - l10[1]];
- this.normalize(t8);
- const n18 = Math.sqrt((1 + u10) / 2);
- if (n18 > 1 / r18) {
- const e13 = -Math.abs(s10) / n18;
- c9.push([i8[0] - t8[0] * e13, i8[1] - t8[1] * e13]);
- }
- }
- } else
- switch (n17) {
- case O.Mitered: {
- const t8 = Math.sqrt((1 + u10) / 2);
- if (t8 > 0 && 1 / t8 < r18) {
- const n18 = [e12[0] - l10[0], e12[1] - l10[1]];
- this.normalize(n18);
- const r19 = Math.abs(s10) / t8;
- c9.push([i8[0] - n18[0] * r19, i8[1] - n18[1] * r19]);
- break;
- }
- }
- case O.Bevelled:
- c9.push([i8[0] + l10[1] * s10, i8[1] - l10[0] * s10]), c9.push([i8[0] + e12[1] * s10, i8[1] - e12[0] * s10]);
- break;
- case O.Rounded:
- if (u10 < 1) {
- c9.push([i8[0] + l10[1] * s10, i8[1] - l10[0] * s10]);
- const t8 = Math.floor(2.5 * (1 - u10));
- if (t8 > 0) {
- const n18 = 1 / t8;
- let r19 = n18;
- for (let h8 = 1; h8 < t8; h8++, r19 += n18) {
- const t9 = [l10[1] * (1 - r19) + e12[1] * r19, -l10[0] * (1 - r19) - e12[0] * r19];
- this.normalize(t9), c9.push([i8[0] + t9[0] * s10, i8[1] + t9[1] * s10]);
- }
- }
- c9.push([i8[0] + e12[1] * s10, i8[1] - e12[0] * s10]);
- }
- break;
- case O.Square:
- default:
- if (a11 < 0)
- c9.push([i8[0] + (l10[1] + l10[0]) * s10, i8[1] + (l10[1] - l10[0]) * s10]), c9.push([i8[0] + (e12[1] - e12[0]) * s10, i8[1] - (e12[0] + e12[1]) * s10]);
- else {
- const t8 = Math.sqrt((1 + Math.abs(u10)) / 2), n18 = [e12[0] - l10[0], e12[1] - l10[1]];
- this.normalize(n18);
- const r19 = s10 / t8;
- c9.push([i8[0] - n18[0] * r19, i8[1] - n18[1] * r19]);
- }
- }
- } else {
- const t8 = [i8[0] - o11[0], i8[1] - o11[1]];
- this.normalize(t8), c9.push([i8[0] + t8[1] * s10, i8[1] - t8[0] * s10]);
- }
- else {
- const t8 = [h7[0] - i8[0], h7[1] - i8[1]];
- this.normalize(t8), c9.push([i8[0] + t8[1] * s10, i8[1] - t8[0] * s10]);
- }
- o11 = i8, i8 = h7;
- }
- return c9.length < (u9 ? 3 : 2) ? null : (u9 && c9.push([c9[0][0], c9[0][1]]), c9);
- }
- };
- // node_modules/@arcgis/core/symbols/cim/effects/EffectArrow.js
- var l6 = 1.7320508075688772;
- var c5 = 5;
- var u5 = P.OpenEnded;
- var h2 = class {
- static local() {
- return h2.instance === null && (h2.instance = new h2()), h2.instance;
- }
- execute(t8, e11, r18, n17) {
- return new a4(t8, e11, r18);
- }
- };
- h2.instance = null;
- var a4 = class extends U3 {
- constructor(t8, e11, o11) {
- super(t8, false, true), this._curveHelper = new n7(), this._width = (e11.width !== void 0 ? e11.width : c5) * o11, this._arrowType = e11.geometricEffectArrowType !== void 0 ? e11.geometricEffectArrowType : e11.arrowType !== void 0 ? e11.arrowType : u5, this._offsetFlattenError = e8 * o11;
- }
- processPath(t8) {
- switch (this._arrowType) {
- case P.OpenEnded:
- default:
- return this._constructSimpleArrow(t8, true);
- case P.Block:
- return this._constructSimpleArrow(t8, false);
- case P.Crossed:
- return this._constructCrossedArrow(t8);
- }
- }
- _constructSimpleArrow(t8, e11) {
- const r18 = this._curveHelper.calculatePathLength(t8);
- let n17 = this._width;
- r18 < 2 * n17 && (n17 = r18 / 2);
- const s10 = this._curveHelper.getSubCurve(t8, 0, r18 - n17);
- if (!s10)
- return null;
- const i8 = n17 / 2;
- if (this._curveHelper.isEmpty(s10, false))
- return null;
- const l9 = this._constructOffset(s10, -i8);
- if (!l9)
- return null;
- const c9 = this._constructOffset(s10, i8);
- if (!c9)
- return null;
- const u9 = this._constructArrowBasePoint(l9, -i8 / 2);
- if (!u9)
- return null;
- const h6 = this._constructArrowBasePoint(c9, i8 / 2);
- if (!h6)
- return null;
- const a10 = t8[t8.length - 1];
- e11 || (this._makeControlPoint(c9, true), this._makeControlPoint(l9, true));
- const _4 = new s6();
- return _4.addPath(c9, true), _4.lineTo(h6), this._makeControlPoint(_4.path()), _4.lineTo(a10), this._makeControlPoint(_4.path()), _4.lineTo(u9), this._makeControlPoint(_4.path()), _4.addPath(l9, false), e11 ? { paths: [_4.path()] } : (_4.close(), { rings: [_4.path()] });
- }
- _constructCrossedArrow(t8) {
- const e11 = this._curveHelper.calculatePathLength(t8);
- let r18 = this._width;
- e11 < r18 * (1 + l6 + 1) && (r18 = e11 / (1 + l6 + 1));
- const n17 = this._curveHelper.getSubCurve(t8, 0, e11 - r18 * (1 + l6));
- if (!n17)
- return null;
- const s10 = r18 / 2;
- if (this._curveHelper.isEmpty(n17, false))
- return null;
- const i8 = this._constructOffset(n17, s10);
- if (!i8)
- return null;
- const c9 = this._constructOffset(n17, -s10);
- if (!c9)
- return null;
- const u9 = this._curveHelper.getSubCurve(t8, 0, e11 - r18);
- if (!u9)
- return null;
- if (this._curveHelper.isEmpty(u9, false))
- return null;
- const h6 = this._constructOffset(u9, s10);
- if (!h6)
- return null;
- const a10 = this._constructOffset(u9, -s10);
- if (!a10)
- return null;
- const _4 = h6[h6.length - 1], f8 = this._constructArrowBasePoint(h6, s10 / 2);
- if (!f8)
- return null;
- const p3 = a10[a10.length - 1], m7 = this._constructArrowBasePoint(a10, -s10 / 2);
- if (!m7)
- return null;
- const d2 = t8[t8.length - 1];
- this._makeControlPoint(i8, false), this._makeControlPoint(c9, false);
- const w4 = new s6();
- return w4.addPath(i8, true), this._makeControlPoint(w4.path()), w4.lineTo(p3), w4.lineTo(m7), this._makeControlPoint(w4.path()), w4.lineTo(d2), this._makeControlPoint(w4.path()), w4.lineTo(f8), this._makeControlPoint(w4.path()), w4.lineTo(_4), this._makeControlPoint(w4.path()), w4.addPath(c9, false), { paths: [w4.path()] };
- }
- _constructOffset(t8, e11) {
- return this._curveHelper.offset(t8, e11, O.Rounded, 4, this._offsetFlattenError);
- }
- _constructArrowBasePoint(t8, e11) {
- if (!t8 || t8.length < 2)
- return null;
- const r18 = t8[t8.length - 2], n17 = t8[t8.length - 1], o11 = [n17[0] - r18[0], n17[1] - r18[1]];
- return this._curveHelper.normalize(o11), [n17[0] + o11[1] * e11, n17[1] - o11[0] * e11];
- }
- _makeControlPoint(t8, r18 = false) {
- j2(r18 ? t8[0] : t8[t8.length - 1], 1);
- }
- };
- // node_modules/@arcgis/core/symbols/cim/effects/EffectBuffer.js
- var f6 = class {
- static local() {
- return f6.instance === null && (f6.instance = new f6()), f6.instance;
- }
- execute(e11, t8, s10, i8) {
- return new h3(e11, t8, s10, i8);
- }
- };
- f6.instance = null;
- var h3 = class {
- constructor(e11, t8, s10, i8) {
- this._inputGeometries = e11, this._curveHelper = new n7(), this._size = (t8.size !== void 0 ? t8.size : 1) * s10, this._offsetFlattenError = e8 * s10;
- }
- next() {
- let n17 = this._inputGeometries.next();
- for (; n17; ) {
- if (s3(n17))
- if (this._size > 0) {
- const e11 = [[n17.xmin, n17.ymin], [n17.xmin, n17.ymax], [n17.xmax, n17.ymax], [n17.xmax, n17.ymin], [n17.xmin, n17.ymin]], t8 = this._curveHelper.offset(e11, this._size, O.Rounded, 4, this._offsetFlattenError);
- if (t8)
- return { rings: [t8] };
- } else {
- if (!(this._size < 0))
- return n17;
- if (Math.min(n17.xmax - n17.xmin, n17.ymax - n17.ymin) + 2 * this._size > 0)
- return { xmin: n17.xmin - this._size, xmax: n17.xmax + this._size, ymin: n17.ymin - this._size, ymax: n17.ymax + this._size };
- }
- if (c2(n17)) {
- if (this._size === 0)
- return n17;
- const e11 = [];
- for (const t8 of n17.rings) {
- const s10 = this._curveHelper.offset(t8, this._size, O.Rounded, 4, this._offsetFlattenError);
- s10 && e11.push(s10);
- }
- if (e11.length)
- return { rings: e11 };
- }
- if (y(n17) && this._size > 0) {
- const e11 = [];
- for (const t8 of n17.paths)
- if (t8 && t8.length > 1) {
- const s10 = this._curveHelper.offset(t8, this._size, O.Rounded, 4, this._offsetFlattenError), i8 = this._curveHelper.offset(t8, -this._size, O.Rounded, 4, this._offsetFlattenError);
- if (s10 && i8) {
- for (let e12 = i8.length - 1; e12 >= 0; e12--)
- s10.push(i8[e12]);
- s10.push([s10[0][0], s10[0][1]]), e11.push(s10);
- }
- }
- if (e11.length)
- return { rings: e11 };
- }
- l(n17) && this._size, n17 = this._inputGeometries.next();
- }
- return null;
- }
- };
- // node_modules/@arcgis/core/symbols/cim/effects/EffectControlMeasureLine.js
- var _ = class {
- static local() {
- return _.instance === null && (_.instance = new _()), _.instance;
- }
- execute(s10, t8, i8, h6) {
- return new c6(s10, t8, i8);
- }
- };
- _.instance = null;
- var c6 = class {
- constructor(s10, t8, i8) {
- this._default_point_size = 20, this._inputGeometries = s10, this._geomUnitsPerPoint = i8, this._rule = t8.rule ?? R.FullGeometry, this._default_size = this._default_point_size * i8;
- }
- next() {
- let e11;
- for (; e11 = this._inputGeometries.next(); ) {
- let r18;
- if (l(e11) ? r18 = this._processGeom([[[e11.x, e11.y]]]) : f(e11) ? r18 = this._processGeom([e11.points]) : y(e11) ? r18 = this._processGeom(e11.paths) : c2(e11) && (r18 = this._processGeom(e11.rings)), r18 && r18.length)
- return { paths: r18 };
- }
- return null;
- }
- _clone(s10) {
- return [s10[0], s10[1]];
- }
- _mid(s10, t8) {
- return [(s10[0] + t8[0]) / 2, (s10[1] + t8[1]) / 2];
- }
- _mix(s10, t8, i8, h6) {
- return [s10[0] * t8 + i8[0] * h6, s10[1] * t8 + i8[1] * h6];
- }
- _add(s10, t8) {
- return [s10[0] + t8[0], s10[1] + t8[1]];
- }
- _add2(s10, t8, i8) {
- return [s10[0] + t8, s10[1] + i8];
- }
- _sub(s10, t8) {
- return [s10[0] - t8[0], s10[1] - t8[1]];
- }
- _dist(s10, t8) {
- return Math.sqrt((s10[0] - t8[0]) * (s10[0] - t8[0]) + (s10[1] - t8[1]) * (s10[1] - t8[1]));
- }
- _norm(s10) {
- return Math.sqrt(s10[0] * s10[0] + s10[1] * s10[1]);
- }
- _normalize(s10, t8 = 1) {
- const i8 = t8 / this._norm(s10);
- s10[0] *= i8, s10[1] *= i8;
- }
- _leftPerpendicular(s10) {
- const t8 = -s10[1], i8 = s10[0];
- s10[0] = t8, s10[1] = i8;
- }
- _leftPerp(s10) {
- return [-s10[1], s10[0]];
- }
- _rightPerpendicular(s10) {
- const t8 = s10[1], i8 = -s10[0];
- s10[0] = t8, s10[1] = i8;
- }
- _rightPerp(s10) {
- return [s10[1], -s10[0]];
- }
- _dotProduct(s10, t8) {
- return s10[0] * t8[0] + s10[1] * t8[1];
- }
- _crossProduct(s10, t8) {
- return s10[0] * t8[1] - s10[1] * t8[0];
- }
- _rotateDirect(s10, t8, i8) {
- const h6 = s10[0] * t8 - s10[1] * i8, e11 = s10[0] * i8 + s10[1] * t8;
- s10[0] = h6, s10[1] = e11;
- }
- _makeCtrlPt(s10) {
- const t8 = [s10[0], s10[1]];
- return j2(t8, 1), t8;
- }
- _addAngledTicks(s10, t8, i8, h6) {
- const e11 = this._sub(i8, t8);
- this._normalize(e11);
- const r18 = this._crossProduct(e11, this._sub(h6, t8));
- let _4;
- _4 = r18 > 0 ? this._rightPerp(e11) : this._leftPerp(e11);
- const c9 = Math.abs(r18) / 2, u9 = [];
- u9.push([t8[0] + (_4[0] - e11[0]) * c9, t8[1] + (_4[1] - e11[1]) * c9]), u9.push(t8), u9.push(i8), u9.push([i8[0] + (_4[0] + e11[0]) * c9, i8[1] + (_4[1] + e11[1]) * c9]), s10.push(u9);
- }
- _addBezier2(s10, t8, i8, h6, e11) {
- if (e11-- == 0)
- return void s10.push(h6);
- const r18 = this._mid(t8, i8), _4 = this._mid(i8, h6), c9 = this._mid(r18, _4);
- this._addBezier2(s10, t8, r18, c9, e11), this._addBezier2(s10, c9, _4, h6, e11);
- }
- _addBezier3(s10, t8, i8, h6, e11, r18) {
- if (r18-- == 0)
- return void s10.push(e11);
- const _4 = this._mid(t8, i8), c9 = this._mid(i8, h6), u9 = this._mid(h6, e11), o11 = this._mid(_4, c9), n17 = this._mid(c9, u9), a10 = this._mid(o11, n17);
- this._addBezier3(s10, t8, _4, o11, a10, r18), this._addBezier3(s10, a10, n17, u9, e11, r18);
- }
- _add90DegArc(s10, t8, i8, h6, e11) {
- const r18 = e11 ?? this._crossProduct(this._sub(i8, t8), this._sub(h6, t8)) > 0, _4 = this._mid(t8, i8), c9 = this._sub(_4, t8);
- r18 ? this._leftPerpendicular(c9) : this._rightPerpendicular(c9), _4[0] += c9[0], _4[1] += c9[1], this._addBezier3(s10, t8, this._mix(t8, 0.33333, _4, 0.66667), this._mix(i8, 0.33333, _4, 0.66667), i8, 4);
- }
- _addArrow(s10, t8, i8) {
- const h6 = t8[0], e11 = t8[1], r18 = t8[t8.length - 1], _4 = this._sub(h6, e11);
- this._normalize(_4);
- const c9 = this._crossProduct(_4, this._sub(r18, e11)), u9 = 0.5 * c9, o11 = this._leftPerp(_4), n17 = [r18[0] - o11[0] * c9, r18[1] - o11[1] * c9], a10 = t8.length - 1, p3 = [];
- p3.push(i8 ? [-o11[0], -o11[1]] : o11);
- let l9 = [-_4[0], -_4[1]];
- for (let d2 = 1; d2 < a10 - 1; d2++) {
- const s11 = this._sub(t8[d2 + 1], t8[d2]);
- this._normalize(s11);
- const i9 = this._dotProduct(s11, l9), h7 = this._crossProduct(s11, l9), e12 = Math.sqrt((1 + i9) / 2), r19 = this._sub(s11, l9);
- this._normalize(r19), r19[0] /= e12, r19[1] /= e12, p3.push(h7 < 0 ? [-r19[0], -r19[1]] : r19), l9 = s11;
- }
- p3.push(this._rightPerp(l9));
- for (let d2 = p3.length - 1; d2 > 0; d2--)
- s10.push([t8[d2][0] + p3[d2][0] * u9, t8[d2][1] + p3[d2][1] * u9]);
- s10.push([n17[0] + p3[0][0] * u9, n17[1] + p3[0][1] * u9]), s10.push([n17[0] + p3[0][0] * c9, n17[1] + p3[0][1] * c9]), s10.push(h6), s10.push([n17[0] - p3[0][0] * c9, n17[1] - p3[0][1] * c9]), s10.push([n17[0] - p3[0][0] * u9, n17[1] - p3[0][1] * u9]);
- for (let d2 = 1; d2 < p3.length; d2++)
- s10.push([t8[d2][0] - p3[d2][0] * u9, t8[d2][1] - p3[d2][1] * u9]);
- }
- _cp2(s10, t8, i8) {
- return s10.length >= 2 ? s10[1] : this._add2(s10[0], t8 * this._default_size, i8 * this._default_size);
- }
- _cp3(s10, t8, i8, h6) {
- if (s10.length >= 3)
- return s10[2];
- const e11 = this._mix(s10[0], 1 - i8, t8, i8), r18 = this._sub(t8, s10[0]);
- return this._normalize(r18), this._rightPerpendicular(r18), [e11[0] + r18[0] * h6 * this._default_size, e11[1] + r18[1] * h6 * this._default_size];
- }
- _arrowPath(s10) {
- if (s10.length > 2)
- return s10;
- const t8 = s10[0], i8 = this._cp2(s10, -4, 0), h6 = this._sub(t8, i8);
- this._normalize(h6);
- const e11 = this._rightPerp(h6);
- return [t8, i8, [t8[0] + (e11[0] - h6[0]) * this._default_size, t8[1] + (e11[1] - h6[1]) * this._default_size]];
- }
- _arrowLastSeg(s10) {
- const t8 = s10[0], i8 = this._cp2(s10, -4, 0);
- let h6;
- if (s10.length >= 3)
- h6 = s10[s10.length - 1];
- else {
- const s11 = this._sub(t8, i8);
- this._normalize(s11);
- const e11 = this._rightPerp(s11);
- h6 = [t8[0] + (e11[0] - s11[0]) * this._default_size, t8[1] + (e11[1] - s11[1]) * this._default_size];
- }
- return [i8, h6];
- }
- _processGeom(s10) {
- if (!s10)
- return null;
- const t8 = [];
- for (const i8 of s10) {
- if (!i8 || i8.length === 0)
- continue;
- const s11 = i8.length;
- let h6 = i8[0];
- switch (this._rule) {
- case R.PerpendicularFromFirstSegment: {
- const s12 = this._cp2(i8, 0, -1), e11 = this._cp3(i8, s12, 0.5, 4), r18 = [];
- r18.push(e11), r18.push(this._mid(h6, s12)), t8.push(r18);
- break;
- }
- case R.ReversedFirstSegment: {
- const s12 = this._cp2(i8, 0, -1);
- t8.push([s12, h6]);
- break;
- }
- case R.PerpendicularToSecondSegment: {
- const s12 = this._cp2(i8, -4, 1), e11 = this._cp3(i8, s12, 0.882353, -1.94), r18 = [];
- r18.push(this._mid(s12, e11)), r18.push(h6), t8.push(r18);
- break;
- }
- case R.SecondSegmentWithTicks: {
- const s12 = this._cp2(i8, -4, 1), e11 = this._cp3(i8, s12, 0.882353, -1.94), r18 = this._sub(e11, s12);
- let _4;
- _4 = this._crossProduct(r18, this._sub(h6, s12)) > 0 ? this._rightPerp(_4) : this._leftPerp(r18);
- const c9 = [];
- c9.push([s12[0] + (_4[0] - r18[0]) / 3, s12[1] + (_4[1] - r18[1]) / 3]), c9.push(s12), c9.push(e11), c9.push([e11[0] + (_4[0] + r18[0]) / 3, e11[1] + (_4[1] + r18[1]) / 3]), t8.push(c9);
- break;
- }
- case R.DoublePerpendicular: {
- const s12 = this._cp2(i8, 0, -1), e11 = this._cp3(i8, s12, 0.5, 3), r18 = this._mid(h6, s12), _4 = this._sub(r18, e11);
- this._normalize(_4);
- const c9 = this._crossProduct(_4, this._sub(h6, e11));
- this._leftPerpendicular(_4);
- const u9 = [];
- u9.push(h6), u9.push([e11[0] + _4[0] * c9, e11[1] + _4[1] * c9]), t8.push(u9);
- const o11 = [];
- o11.push([e11[0] - _4[0] * c9, e11[1] - _4[1] * c9]), o11.push(s12), t8.push(o11);
- break;
- }
- case R.OppositeToFirstSegment: {
- const s12 = this._cp2(i8, 0, -1), e11 = this._cp3(i8, s12, 0.5, 3), r18 = this._mid(h6, s12), _4 = this._sub(r18, e11);
- this._normalize(_4);
- const c9 = this._crossProduct(_4, this._sub(h6, e11));
- this._leftPerpendicular(_4);
- const u9 = [];
- u9.push([e11[0] + _4[0] * c9, e11[1] + _4[1] * c9]), u9.push([e11[0] - _4[0] * c9, e11[1] - _4[1] * c9]), t8.push(u9);
- break;
- }
- case R.TriplePerpendicular: {
- const s12 = this._cp2(i8, 0, -1), e11 = this._cp3(i8, s12, 0.5, 4), r18 = this._mid(h6, s12), _4 = this._sub(r18, e11);
- this._normalize(_4);
- const c9 = this._crossProduct(_4, this._sub(h6, e11));
- this._leftPerpendicular(_4);
- const u9 = [];
- u9.push([e11[0] + _4[0] * c9 * 0.8, e11[1] + _4[1] * c9 * 0.8]), u9.push([r18[0] + 0.8 * (h6[0] - r18[0]), r18[1] + 0.8 * (h6[1] - r18[1])]), t8.push(u9), t8.push([e11, r18]);
- const o11 = [];
- o11.push([e11[0] - _4[0] * c9 * 0.8, e11[1] - _4[1] * c9 * 0.8]), o11.push([r18[0] + 0.8 * (s12[0] - r18[0]), r18[1] + 0.8 * (s12[1] - r18[1])]), t8.push(o11);
- break;
- }
- case R.HalfCircleFirstSegment: {
- const s12 = this._cp2(i8, 0, -1), e11 = this._cp3(i8, s12, 0.5, 4), r18 = this._mid(h6, s12);
- let _4 = this._sub(s12, h6);
- const c9 = Math.cos(Math.PI / 18), u9 = Math.sin(Math.PI / 18), o11 = Math.sqrt((1 + c9) / 2), n17 = Math.sqrt((1 - c9) / 2), a10 = [];
- let p3;
- this._crossProduct(_4, this._sub(e11, h6)) > 0 ? (a10.push(h6), _4 = this._sub(h6, r18), p3 = s12) : (a10.push(s12), _4 = this._sub(s12, r18), p3 = h6), this._rotateDirect(_4, o11, n17), _4[0] /= o11, _4[1] /= o11;
- for (let t9 = 1; t9 <= 18; t9++)
- a10.push(this._add(r18, _4)), this._rotateDirect(_4, c9, u9);
- a10.push(p3), t8.push(a10);
- break;
- }
- case R.HalfCircleSecondSegment: {
- const s12 = this._cp2(i8, 0, -1), e11 = this._cp3(i8, s12, 1, -1);
- let r18 = this._sub(h6, s12);
- this._normalize(r18);
- const _4 = this._crossProduct(r18, this._sub(e11, s12)) / 2;
- this._leftPerpendicular(r18);
- const c9 = [s12[0] + r18[0] * _4, s12[1] + r18[1] * _4];
- r18 = this._sub(s12, c9);
- const u9 = Math.cos(Math.PI / 18);
- let o11 = Math.sin(Math.PI / 18);
- _4 > 0 && (o11 = -o11);
- const n17 = [s12];
- for (let t9 = 1; t9 <= 18; t9++)
- this._rotateDirect(r18, u9, o11), n17.push(this._add(c9, r18));
- t8.push(n17);
- break;
- }
- case R.HalfCircleExtended: {
- const e11 = this._cp2(i8, 0, -2), r18 = this._cp3(i8, e11, 1, -1);
- let _4;
- if (s11 >= 4)
- _4 = i8[3];
- else {
- const s12 = this._sub(h6, e11);
- _4 = this._add(r18, s12);
- }
- const c9 = this._dist(e11, r18) / 2 / 0.75, u9 = this._sub(e11, h6);
- this._normalize(u9, c9);
- const o11 = this._sub(r18, _4);
- this._normalize(o11, c9);
- const n17 = [_4, r18];
- t8.push(n17);
- const a10 = [this._clone(r18)];
- this._addBezier3(a10, r18, this._add(r18, o11), this._add(e11, u9), e11, 4), a10.push(h6), t8.push(a10);
- break;
- }
- case R.OpenCircle: {
- const s12 = this._cp2(i8, -2, 0), e11 = this._sub(s12, h6), r18 = Math.cos(Math.PI / 18), _4 = -Math.sin(Math.PI / 18), c9 = [s12];
- for (let t9 = 1; t9 <= 33; t9++)
- this._rotateDirect(e11, r18, _4), c9.push(this._add(h6, e11));
- t8.push(c9);
- break;
- }
- case R.CoverageEdgesWithTicks: {
- const e11 = this._cp2(i8, 0, -1);
- let r18, _4;
- if (s11 >= 3)
- r18 = i8[2];
- else {
- const s12 = this._sub(e11, h6), t9 = this._leftPerp(s12);
- r18 = [h6[0] + t9[0] - 0.25 * s12[0], h6[1] + t9[1] - 0.25 * s12[1]];
- }
- if (s11 >= 4)
- _4 = i8[3];
- else {
- const s12 = this._mid(h6, e11), t9 = this._sub(h6, e11);
- this._normalize(t9), this._leftPerpendicular(t9);
- const i9 = this._crossProduct(t9, this._sub(r18, s12));
- this._rightPerpendicular(t9), _4 = [r18[0] + t9[0] * i9 * 2, r18[1] + t9[1] * i9 * 2];
- }
- const c9 = this._sub(e11, h6);
- let u9, o11;
- u9 = this._crossProduct(c9, this._sub(r18, h6)) > 0 ? this._rightPerp(c9) : this._leftPerp(c9), o11 = [], o11.push(r18), o11.push(h6), o11.push([h6[0] + (u9[0] - c9[0]) / 3, h6[1] + (u9[1] - c9[1]) / 3]), t8.push(o11), u9 = this._crossProduct(c9, this._sub(_4, e11)) > 0 ? this._rightPerp(u9) : this._leftPerp(c9), o11 = [], o11.push([e11[0] + (u9[0] + c9[0]) / 3, e11[1] + (u9[1] + c9[1]) / 3]), o11.push(e11), o11.push(_4), t8.push(o11);
- break;
- }
- case R.GapExtentWithDoubleTicks: {
- const e11 = this._cp2(i8, 0, 2), r18 = this._cp3(i8, e11, 0, 1);
- let _4;
- if (s11 >= 4)
- _4 = i8[3];
- else {
- const s12 = this._sub(e11, h6);
- _4 = this._add(r18, s12);
- }
- this._addAngledTicks(t8, h6, e11, this._mid(r18, _4)), this._addAngledTicks(t8, r18, _4, this._mid(h6, e11));
- break;
- }
- case R.GapExtentMidline: {
- const e11 = this._cp2(i8, 2, 0), r18 = this._cp3(i8, e11, 0, 1);
- let _4;
- if (s11 >= 4)
- _4 = i8[3];
- else {
- const s12 = this._sub(e11, h6);
- _4 = this._add(r18, s12);
- }
- const c9 = [];
- c9.push(this._mid(h6, r18)), c9.push(this._mid(e11, _4)), t8.push(c9);
- break;
- }
- case R.Chevron: {
- const e11 = this._cp2(i8, -1, -1);
- let r18;
- if (s11 >= 3)
- r18 = i8[2];
- else {
- const s12 = this._sub(e11, h6);
- this._leftPerpendicular(s12), r18 = this._add(h6, s12);
- }
- t8.push([e11, this._makeCtrlPt(h6), r18]);
- break;
- }
- case R.PerpendicularWithArc: {
- const s12 = this._cp2(i8, 0, -2), e11 = this._cp3(i8, s12, 0.5, -1);
- let r18 = this._sub(s12, h6);
- const _4 = this._norm(r18);
- r18[0] /= _4, r18[1] /= _4;
- const c9 = this._crossProduct(r18, this._sub(e11, h6));
- let u9 = this._dotProduct(r18, this._sub(e11, h6));
- u9 < 0.05 * _4 ? u9 = 0.05 * _4 : u9 > 0.95 * _4 && (u9 = 0.95 * _4);
- const o11 = [h6[0] + r18[0] * u9, h6[1] + r18[1] * u9];
- this._leftPerpendicular(r18);
- let n17 = [];
- n17.push([o11[0] - r18[0] * c9, o11[1] - r18[1] * c9]), n17.push([o11[0] + r18[0] * c9, o11[1] + r18[1] * c9]), t8.push(n17);
- const a10 = [s12[0] + r18[0] * c9, s12[1] + r18[1] * c9];
- r18 = this._sub(s12, a10);
- const p3 = Math.cos(Math.PI / 18);
- let l9 = Math.sin(Math.PI / 18);
- c9 < 0 && (l9 = -l9), n17 = [h6, s12];
- for (let t9 = 1; t9 <= 9; t9++)
- this._rotateDirect(r18, p3, l9), n17.push(this._add(a10, r18));
- t8.push(n17);
- break;
- }
- case R.ClosedHalfCircle: {
- const s12 = this._cp2(i8, 2, 0), e11 = this._mid(h6, s12), r18 = this._sub(s12, e11), _4 = Math.cos(Math.PI / 18), c9 = Math.sin(Math.PI / 18), u9 = [h6, s12];
- for (let t9 = 1; t9 <= 18; t9++)
- this._rotateDirect(r18, _4, c9), u9.push(this._add(e11, r18));
- t8.push(u9);
- break;
- }
- case R.TripleParallelExtended: {
- const s12 = this._cp2(i8, 0, -2), r18 = this._cp3(i8, s12, 1, -2), _4 = this._mid(h6, s12), c9 = this._sub(r18, s12);
- this._normalize(c9);
- const u9 = Math.abs(this._crossProduct(c9, this._sub(_4, s12))) / 2, o11 = this._dist(s12, r18), n17 = [s12, h6];
- n17.push([h6[0] + c9[0] * o11 * 0.5, h6[1] + c9[1] * o11 * 0.5]), t8.push(n17);
- const a10 = [];
- a10.push([_4[0] - c9[0] * u9, _4[1] - c9[1] * u9]), a10.push([_4[0] + c9[0] * o11 * 0.375, _4[1] + c9[1] * o11 * 0.375]), j2(a10[a10.length - 1], 1), a10.push([_4[0] + c9[0] * o11 * 0.75, _4[1] + c9[1] * o11 * 0.75]), t8.push(a10);
- const p3 = [s12, r18];
- t8.push(p3);
- break;
- }
- case R.ParallelWithTicks: {
- const s12 = this._cp2(i8, 3, 0), e11 = this._cp3(i8, s12, 0.5, -1), r18 = this._sub(e11, s12);
- this._normalize(r18);
- const _4 = this._crossProduct(r18, this._sub(e11, h6));
- this._leftPerpendicular(r18), this._addAngledTicks(t8, h6, s12, e11), this._addAngledTicks(t8, this._mix(h6, 1, r18, _4), this._mix(s12, 1, r18, _4), this._mid(h6, s12));
- break;
- }
- case R.Parallel: {
- const s12 = this._cp2(i8, 3, 0), e11 = this._cp3(i8, s12, 0.5, -1), r18 = this._sub(s12, h6);
- this._normalize(r18);
- const _4 = this._leftPerp(r18), c9 = this._crossProduct(r18, this._sub(e11, h6));
- let u9 = [h6, s12];
- t8.push(u9), u9 = [], u9.push([h6[0] + _4[0] * c9, h6[1] + _4[1] * c9]), u9.push([s12[0] + _4[0] * c9, s12[1] + _4[1] * c9]), t8.push(u9);
- break;
- }
- case R.PerpendicularToFirstSegment: {
- const s12 = this._cp2(i8, 3, 0), e11 = this._cp3(i8, s12, 0.5, -1), r18 = this._mid(h6, s12), _4 = this._sub(s12, h6);
- this._normalize(_4);
- const c9 = this._crossProduct(_4, this._sub(e11, h6));
- this._leftPerpendicular(_4);
- const u9 = [];
- u9.push([r18[0] - _4[0] * c9 * 0.25, r18[1] - _4[1] * c9 * 0.25]), u9.push([r18[0] + _4[0] * c9 * 1.25, r18[1] + _4[1] * c9 * 1.25]), t8.push(u9);
- break;
- }
- case R.ParallelOffset: {
- const s12 = this._cp2(i8, 3, 0), e11 = this._cp3(i8, s12, 0.5, -1), r18 = this._sub(s12, h6);
- this._normalize(r18);
- const _4 = this._crossProduct(r18, this._sub(e11, h6));
- this._leftPerpendicular(r18);
- const c9 = [];
- c9.push([h6[0] - r18[0] * _4, h6[1] - r18[1] * _4]), c9.push([s12[0] - r18[0] * _4, s12[1] - r18[1] * _4]), t8.push(c9);
- const u9 = [];
- u9.push([h6[0] + r18[0] * _4, h6[1] + r18[1] * _4]), u9.push([s12[0] + r18[0] * _4, s12[1] + r18[1] * _4]), t8.push(u9);
- break;
- }
- case R.OffsetOpposite: {
- const s12 = this._cp2(i8, 3, 0), e11 = this._cp3(i8, s12, 0.5, -1), r18 = this._sub(s12, h6);
- this._normalize(r18);
- const _4 = this._crossProduct(r18, this._sub(e11, h6));
- this._leftPerpendicular(r18);
- const c9 = [];
- c9.push([h6[0] - r18[0] * _4, h6[1] - r18[1] * _4]), c9.push([s12[0] - r18[0] * _4, s12[1] - r18[1] * _4]), t8.push(c9);
- break;
- }
- case R.OffsetSame: {
- const s12 = this._cp2(i8, 3, 0), e11 = this._cp3(i8, s12, 0.5, -1), r18 = this._sub(s12, h6);
- this._normalize(r18);
- const _4 = this._crossProduct(r18, this._sub(e11, h6));
- this._leftPerpendicular(r18);
- const c9 = [];
- c9.push([h6[0] + r18[0] * _4, h6[1] + r18[1] * _4]), c9.push([s12[0] + r18[0] * _4, s12[1] + r18[1] * _4]), t8.push(c9);
- break;
- }
- case R.CircleWithArc: {
- let r18 = this._cp2(i8, 3, 0);
- const _4 = this._cp3(i8, r18, 0.5, -1);
- let c9, u9;
- if (s11 >= 4)
- c9 = i8[3], u9 = this._crossProduct(this._sub(c9, r18), this._sub(_4, r18)) > 0;
- else {
- c9 = r18, u9 = this._crossProduct(this._sub(c9, h6), this._sub(_4, h6)) > 0;
- const s12 = 24 * this._geomUnitsPerPoint, t9 = this._sub(c9, h6);
- this._normalize(t9, s12);
- const i9 = Math.sqrt(2) / 2;
- this._rotateDirect(t9, i9, u9 ? i9 : -i9), r18 = this._add(h6, t9);
- }
- const o11 = this._sub(r18, h6), n17 = Math.cos(Math.PI / 18), a10 = Math.sin(Math.PI / 18), p3 = [r18];
- for (let s12 = 1; s12 <= 36; s12++)
- this._rotateDirect(o11, n17, a10), p3.push(this._add(h6, o11));
- this._add90DegArc(p3, r18, c9, _4, u9), j2(p3[p3.length - 8], 1), t8.push(p3);
- break;
- }
- case R.DoubleJog: {
- let e11, r18, _4 = this._cp2(i8, -3, 1);
- if (e11 = s11 >= 3 ? i8[2] : this._add(h6, this._sub(h6, _4)), s11 >= 4)
- r18 = i8[3];
- else {
- const s12 = h6;
- h6 = _4, r18 = e11;
- const t9 = this._dist(h6, s12), i9 = this._dist(r18, s12);
- let c10 = 30 * this._geomUnitsPerPoint;
- 0.5 * t9 < c10 && (c10 = 0.5 * t9), 0.5 * i9 < c10 && (c10 = 0.5 * i9), _4 = this._mix(h6, c10 / t9, s12, (t9 - c10) / t9), e11 = this._mix(r18, c10 / i9, s12, (i9 - c10) / i9);
- }
- const c9 = this._mid(h6, _4), u9 = this._mid(r18, e11), o11 = this._dist(h6, _4), n17 = this._dist(e11, r18);
- let a10 = Math.min(o11, n17) / 8;
- a10 = Math.min(a10, 24 * this._geomUnitsPerPoint);
- const p3 = Math.cos(Math.PI / 4);
- let l9 = this._sub(h6, _4);
- this._normalize(l9, a10), this._crossProduct(l9, this._sub(r18, _4)) > 0 ? this._rotateDirect(l9, p3, -p3) : this._rotateDirect(l9, p3, p3);
- let d2 = [];
- d2.push(_4), d2.push(this._add(c9, l9)), d2.push(this._sub(c9, l9)), d2.push(h6), t8.push(d2), l9 = this._sub(r18, e11), this._normalize(l9, a10), this._crossProduct(l9, this._sub(h6, e11)) < 0 ? this._rotateDirect(l9, p3, p3) : this._rotateDirect(l9, p3, -p3), d2 = [], d2.push(e11), d2.push(this._add(u9, l9)), d2.push(this._sub(u9, l9)), d2.push(r18), t8.push(d2);
- break;
- }
- case R.PerpendicularOffset: {
- const s12 = this._cp2(i8, -4, 1), e11 = this._cp3(i8, s12, 0.882353, -1.94), r18 = this._sub(e11, s12);
- this._crossProduct(r18, this._sub(h6, s12)) > 0 ? this._rightPerpendicular(r18) : this._leftPerpendicular(r18);
- const _4 = [r18[0] / 8, r18[1] / 8], c9 = this._sub(this._mid(s12, e11), _4);
- t8.push([c9, h6]);
- break;
- }
- case R.LineExcludingLastSegment: {
- const s12 = this._arrowPath(i8), h7 = [];
- let e11 = s12.length - 2;
- for (; e11--; )
- h7.push(s12[e11]);
- t8.push(h7);
- break;
- }
- case R.MultivertexArrow: {
- const s12 = this._arrowPath(i8), h7 = [];
- this._addArrow(h7, s12, false), t8.push(h7);
- break;
- }
- case R.CrossedArrow: {
- const s12 = this._arrowPath(i8), h7 = [];
- this._addArrow(h7, s12, true), t8.push(h7);
- break;
- }
- case R.ChevronArrow: {
- const [s12, e11] = this._arrowLastSeg(i8), r18 = 10 * this._geomUnitsPerPoint, _4 = this._sub(h6, s12);
- this._normalize(_4);
- const c9 = this._crossProduct(_4, this._sub(e11, s12)), u9 = this._leftPerp(_4), o11 = [e11[0] - u9[0] * c9 * 2, e11[1] - u9[1] * c9 * 2], n17 = [];
- n17.push([e11[0] + _4[0] * r18, e11[1] + _4[1] * r18]), n17.push(h6), n17.push([o11[0] + _4[0] * r18, o11[1] + _4[1] * r18]), t8.push(n17);
- break;
- }
- case R.ChevronArrowOffset: {
- const [s12, e11] = this._arrowLastSeg(i8), r18 = this._sub(h6, s12);
- this._normalize(r18);
- const _4 = this._crossProduct(r18, this._sub(e11, s12));
- this._leftPerpendicular(r18);
- const c9 = [e11[0] - r18[0] * _4, e11[1] - r18[1] * _4], u9 = [];
- u9.push([c9[0] + r18[0] * _4 * 0.5, c9[1] + r18[1] * _4 * 0.5]), u9.push(this._mid(c9, h6)), u9.push([c9[0] - r18[0] * _4 * 0.5, c9[1] - r18[1] * _4 * 0.5]), t8.push(u9);
- break;
- }
- case R.PartialFirstSegment: {
- const [s12, e11] = this._arrowLastSeg(i8), r18 = this._sub(h6, s12);
- this._normalize(r18);
- const _4 = this._crossProduct(r18, this._sub(e11, s12));
- this._leftPerpendicular(r18);
- const c9 = [e11[0] - r18[0] * _4, e11[1] - r18[1] * _4];
- t8.push([s12, c9]);
- break;
- }
- case R.Arch: {
- const s12 = this._cp2(i8, 0, -1), e11 = this._cp3(i8, s12, 0.5, 1), r18 = this._sub(h6, s12), _4 = this._mix(e11, 1, r18, 0.55), c9 = this._mix(e11, 1, r18, -0.55), u9 = [h6];
- this._addBezier2(u9, h6, _4, e11, 4), this._addBezier2(u9, e11, c9, s12, 4), t8.push(u9);
- break;
- }
- case R.CurvedParallelTicks: {
- const s12 = this._cp2(i8, -4, 1), e11 = this._cp3(i8, s12, 0.882353, -1.94), r18 = this._sub(e11, s12);
- this._crossProduct(r18, this._sub(h6, s12)) > 0 ? this._rightPerpendicular(r18) : this._leftPerpendicular(r18);
- const _4 = [r18[0] / 8, r18[1] / 8], c9 = this._sub(this._mid(s12, e11), _4), u9 = this._sub(this._mix(s12, 0.75, e11, 0.25), _4), o11 = this._sub(this._mix(s12, 0.25, e11, 0.75), _4), n17 = [s12];
- this._addBezier2(n17, s12, u9, c9, 3), this._addBezier2(n17, c9, o11, e11, 3), t8.push(n17);
- for (let i9 = 0; i9 < 8; i9++) {
- const s13 = n17[2 * i9 + 1], h7 = [this._clone(s13)];
- h7.push(this._add(s13, [r18[0] / 4, r18[1] / 4])), t8.push(h7);
- }
- break;
- }
- case R.Arc90Degrees: {
- const s12 = this._cp2(i8, 0, -1), e11 = this._cp3(i8, s12, 0.5, 1), r18 = [s12];
- this._add90DegArc(r18, s12, h6, e11), t8.push(r18);
- break;
- }
- case R.FullGeometry:
- default:
- t8.push(i8);
- }
- }
- return t8;
- }
- };
- // node_modules/@arcgis/core/symbols/cim/effects/EffectCut.js
- var u6 = class {
- static local() {
- return u6.instance === null && (u6.instance = new u6()), u6.instance;
- }
- execute(e11, t8, u9, i8) {
- return new s7(e11, t8, u9);
- }
- };
- u6.instance = null;
- var s7 = class extends U3 {
- constructor(e11, u9, s10) {
- super(e11, true, true), this._curveHelper = new n7(), this._beginCut = (u9.beginCut !== void 0 ? u9.beginCut : 1) * s10, this._endCut = (u9.endCut !== void 0 ? u9.endCut : 1) * s10, this._middleCut = (u9.middleCut !== void 0 ? u9.middleCut : 0) * s10, this._invert = u9.invert !== void 0 && u9.invert, this._beginCut < 0 && (this._beginCut = 0), this._endCut < 0 && (this._endCut = 0), this._middleCut < 0 && (this._middleCut = 0);
- }
- processPath(e11) {
- const t8 = this._beginCut, u9 = this._endCut, s10 = this._middleCut, i8 = this._curveHelper.calculatePathLength(e11), r18 = [];
- if (this._invert)
- if (t8 === 0 && u9 === 0 && s10 === 0)
- ;
- else if (t8 + u9 + s10 >= i8)
- r18.push(e11);
- else {
- let n17 = this._curveHelper.getSubCurve(e11, 0, t8);
- n17 && r18.push(n17), n17 = this._curveHelper.getSubCurve(e11, 0.5 * (i8 - s10), 0.5 * (i8 + s10)), n17 && r18.push(n17), n17 = this._curveHelper.getSubCurve(e11, i8 - u9, u9), n17 && r18.push(n17);
- }
- else if (t8 === 0 && u9 === 0 && s10 === 0)
- r18.push(e11);
- else if (t8 + u9 + s10 >= i8)
- ;
- else if (s10 === 0) {
- const s11 = this._curveHelper.getSubCurve(e11, t8, i8 - u9);
- s11 && r18.push(s11);
- } else {
- let n17 = this._curveHelper.getSubCurve(e11, t8, 0.5 * (i8 - s10));
- n17 && r18.push(n17), n17 = this._curveHelper.getSubCurve(e11, 0.5 * (i8 + s10), i8 - u9), n17 && r18.push(n17);
- }
- return r18.length === 0 ? null : { paths: r18 };
- }
- };
- // node_modules/@arcgis/core/symbols/cim/GeometryWalker.js
- var i5 = 1e-7;
- var n8 = class {
- constructor() {
- this._values = [], this.extPtGap = 0, this.ctrlPtGap = 0, this._length = 0, this._currentValue = 0;
- }
- isEmpty() {
- return this._values.length === 0;
- }
- size() {
- return this._values.length;
- }
- init(t8, s10, e11 = true) {
- if (this._setEmpty(), !t8 || t8.length === 0)
- return false;
- for (let n17 = 0; n17 < t8.length; n17++) {
- let s11 = Math.abs(t8[n17]);
- e11 && s11 < i5 && (s11 = i5), this._values.push(s11), this._length += s11;
- }
- return s10 && 1 & t8.length && (this._length *= 2), this._length !== 0 && (this.ctrlPtGap = this.extPtGap = 0, this._currentValue = -1, true);
- }
- scale(t8) {
- const s10 = this._values ? this._values.length : 0;
- for (let e11 = 0; e11 < s10; ++e11)
- this._values[e11] *= t8;
- this._length *= t8, this.extPtGap *= t8, this.ctrlPtGap *= t8;
- }
- addValue(t8) {
- this._length += t8, this._values.push(t8);
- }
- firstValue() {
- return this._values[0];
- }
- lastValue() {
- return this._values[this._values.length - 1];
- }
- nextValue() {
- return this._currentValue++, this._currentValue === this._values.length && (this._currentValue = 0), this._values[this._currentValue];
- }
- reset() {
- this._currentValue = -1;
- }
- length() {
- return this._length;
- }
- _setEmpty() {
- this.extPtGap = this.ctrlPtGap = this._length = 0, this._currentValue = -1, this._values.length = 0;
- }
- };
- var h4;
- !function(t8) {
- t8[t8.FAIL = 0] = "FAIL", t8[t8.END = 1] = "END", t8[t8.CONTINUE = 2] = "CONTINUE";
- }(h4 || (h4 = {}));
- var r8 = class {
- constructor() {
- this.reset();
- }
- reset() {
- this.segment = -1, this.segmentLength = 0, this.abscissa = 0, this.isPathEnd = false, this.isPartEnd = false;
- }
- isValid() {
- return this.segment !== -1;
- }
- copyTo(t8) {
- t8.segment = this.segment, t8.segmentLength = this.segmentLength, t8.abscissa = this.abscissa, t8.isPathEnd = this.isPathEnd, t8.isPartEnd = this.isPartEnd;
- }
- };
- var a5 = class extends n7 {
- constructor(t8 = 0, s10 = false) {
- super(t8, s10), this._tolerance = e8, this._currentPosition = new r8();
- }
- updateTolerance(t8) {
- this._tolerance = e8 * t8;
- }
- init(t8, s10, e11 = true) {
- return e11 ? (this._patternLength = s10.length(), this._partExtPtGap = s10.extPtGap, this._partCtrlPtGap = s10.ctrlPtGap) : (this._patternLength = 0, this._partExtPtGap = 0, this._partCtrlPtGap = 0), this._currentPosition.reset(), this._partSegCount = 0, this._path = t8, this._seg = -1, this._setPosAtNextPart();
- }
- curPositionIsValid() {
- return this._currentPosition.isValid();
- }
- nextPosition(t8, s10 = h4.FAIL) {
- const e11 = new r8();
- return !!this._nextPosition(t8, e11, null, s10) && (e11.copyTo(this._currentPosition), true);
- }
- curPointAndAngle(t8) {
- t8.pt = this._getPoint(this._currentPosition);
- const [s10, e11] = this._getAngle(this._currentPosition);
- t8.ca = s10, t8.sa = e11;
- }
- nextPointAndAngle(t8, s10, e11 = h4.FAIL) {
- const i8 = new r8();
- if (!this._nextPosition(t8, i8, null, e11))
- return false;
- i8.copyTo(this._currentPosition), s10.pt = this._getPoint(i8);
- const [n17, a10] = this._getAngle(i8);
- return s10.ca = n17, s10.sa = a10, true;
- }
- nextCurve(t8) {
- if (t8 === 0)
- return null;
- const s10 = [], e11 = new r8();
- return this._nextPosition(t8, e11, s10, h4.END) ? (e11.copyTo(this._currentPosition), s10) : null;
- }
- isPathEnd() {
- return this._currentPosition.isPathEnd;
- }
- getPathEnd() {
- if (this._currentPosition.segment === -1)
- throw new Error("missing segment");
- return this._path[this._currentPosition.segment + 1];
- }
- _nextPosition(t8, s10, e11, i8) {
- if (this._currentPosition.isPathEnd)
- return false;
- let n17 = this._currentPosition.abscissa;
- for (this._currentPosition.segmentLength > 0 && (n17 /= this._currentPosition.segmentLength), this._currentPosition.copyTo(s10); s10.abscissa + t8 * this._partLengthRatio > s10.segmentLength + this._tolerance; ) {
- if (e11) {
- if (e11.length === 0)
- if (n17 === 0) {
- const t10 = this._path[s10.segment];
- e11.push([t10[0], t10[1]]);
- } else
- e11.push(this.getSegCoord2D(this._path, s10.segment, n17));
- const t9 = this._path[s10.segment + 1];
- e11.push([t9[0], t9[1]]);
- }
- if (n17 = 0, t8 -= (s10.segmentLength - s10.abscissa) / this._partLengthRatio, this._partSegCount)
- s10.segment = this._nextSegment(), s10.segmentLength = this.calculateSegLength(this._path, s10.segment), s10.abscissa = 0, this._partSegCount--;
- else {
- if (!this._setPosAtNextPart())
- return i8 !== h4.FAIL && (s10.segmentLength = this.calculateSegLength(this._path, s10.segment), s10.isPartEnd = true, i8 === h4.END ? (s10.abscissa = s10.segmentLength, s10.isPathEnd = true) : s10.abscissa = s10.segmentLength + t8, true);
- this._currentPosition.copyTo(s10);
- }
- }
- if (s10.abscissa += t8 * this._partLengthRatio, e11) {
- if (e11.length === 0)
- if (n17 === 0) {
- const t10 = this._path[s10.segment];
- e11.push([t10[0], t10[1]]);
- } else
- e11.push(this.getSegCoord2D(this._path, s10.segment, n17));
- const t9 = s10.abscissa / s10.segmentLength;
- if (t9 === 1) {
- const t10 = this._path[s10.segment + 1];
- e11.push([t10[0], t10[1]]);
- } else
- e11.push(this.getSegCoord2D(this._path, s10.segment, t9));
- }
- return this._partSegCount || Math.abs(s10.abscissa - s10.segmentLength) < this._tolerance && (s10.isPathEnd = this._partIsLast, s10.isPartEnd = true), true;
- }
- _getPoint(t8) {
- if (t8.segment === -1)
- throw new Error("missing segment");
- const s10 = t8.segmentLength <= 0 ? 0 : t8.abscissa / t8.segmentLength;
- return this.getSegCoord2D(this._path, t8.segment, s10);
- }
- _getAngle(t8) {
- if (t8.segment === -1)
- throw new Error("missing segment");
- const s10 = t8.segmentLength <= 0 ? 0 : t8.abscissa / t8.segmentLength;
- return this.getSegAngleCS(this._path, t8.segment, s10);
- }
- _setPosAtNextPart() {
- for (; this._partSegCount; )
- this._hasNextSegment() && this._nextSegment(), this._partSegCount--;
- if (!this._hasNextSegment())
- return false;
- for (this._partLength = 0, this._partIsLast = true, this._partSegCount = 0; this._hasNextSegment(); )
- if (this._partLength += this.calculateSegLength(this._path, this._nextSegment()), this._partSegCount++, I(this._path[this._getEndPointIndex()]) === 1) {
- this._partIsLast = !this._hasNextSegment();
- break;
- }
- let s10 = this._partSegCount;
- for (; s10; )
- this._previousSegment(), --s10;
- this._currentPosition.segment = this._nextSegment(), this._currentPosition.segmentLength = this.calculateSegLength(this._path, this._currentPosition.segment), this._currentPosition.abscissa = 0, this._currentPosition.isPathEnd = this._currentPosition.isPartEnd = false, --this._partSegCount;
- const e11 = this._getStartPointIndex();
- this._ctrlPtBegin = I(this._path[e11]) === 1;
- let i8 = e11 + this._partSegCount + 1;
- if (i8 >= this._path.length && (i8 = 0), this._ctrlPtEnd = I(this._path[i8]) === 1, this._patternLength > 0) {
- const t8 = this._ctrlPtBegin ? this._partCtrlPtGap : this._partExtPtGap, s11 = this._ctrlPtEnd ? this._partCtrlPtGap : this._partExtPtGap;
- let e12 = Math.round((this._partLength - (t8 + s11)) / this._patternLength);
- e12 <= 0 && (e12 = t8 + s11 > 0 ? 0 : 1), this._partLengthRatio = this._partLength / (t8 + s11 + e12 * this._patternLength), this._partLengthRatio < 0.01 && (this._partLengthRatio = 1);
- } else
- this._partLengthRatio = 1;
- return true;
- }
- _hasNextSegment() {
- return this._seg < this._path.length - 2;
- }
- _previousSegment() {
- return --this._seg;
- }
- _nextSegment() {
- return ++this._seg;
- }
- _getStartPointIndex() {
- return this._seg;
- }
- _getEndPointIndex() {
- return this._seg + 1;
- }
- };
- // node_modules/@arcgis/core/symbols/cim/effects/EffectDashes.js
- var r9 = class {
- static local() {
- return r9.instance === null && (r9.instance = new r9()), r9.instance;
- }
- execute(t8, e11, s10, a10) {
- return new n9(t8, e11, s10);
- }
- };
- r9.instance = null;
- var n9 = class extends U3 {
- constructor(t8, e11, s10) {
- super(t8, true, true), this._walker = new a5(), this._walker.updateTolerance(s10), this._endings = e11.lineDashEnding, this._customDashPos = -(e11.offsetAlongLine ?? 0) * s10, this._offsetAtEnd = (e11.customEndingOffset ?? 0) * s10, this._pattern = new n8(), this._pattern.init(e11.dashTemplate, true), this._pattern.scale(s10);
- }
- processPath(t8) {
- if (this._pattern.length() === 0)
- return this.iteratePath = false, { paths: [t8] };
- if (!this.iteratePath) {
- let e11 = true;
- switch (this._endings) {
- case k.HalfPattern:
- case k.HalfGap:
- default:
- this._pattern.extPtGap = 0;
- break;
- case k.FullPattern:
- this.isClosed || (this._pattern.extPtGap = 0.5 * this._pattern.firstValue());
- break;
- case k.FullGap:
- this.isClosed || (this._pattern.extPtGap = 0.5 * this._pattern.lastValue());
- break;
- case k.NoConstraint:
- this.isClosed || (e11 = false);
- break;
- case k.Custom:
- this.isClosed || (this._pattern.extPtGap = 0.5 * this._offsetAtEnd);
- }
- const a11 = this._walker.calculatePathLength(t8);
- if (this._pattern.isEmpty() || a11 < 0.1 * this._pattern.length())
- return { paths: [t8] };
- if (!this._walker.init(t8, this._pattern, e11))
- return { paths: [t8] };
- }
- let a10;
- if (this.iteratePath)
- a10 = this._pattern.nextValue();
- else {
- let t9;
- switch (this._endings) {
- case k.HalfPattern:
- default:
- t9 = 0.5 * this._pattern.firstValue();
- break;
- case k.HalfGap:
- t9 = 0.5 * -this._pattern.lastValue();
- break;
- case k.FullGap:
- t9 = -this._pattern.lastValue();
- break;
- case k.FullPattern:
- t9 = 0;
- break;
- case k.NoConstraint:
- case k.Custom:
- t9 = -this._customDashPos;
- }
- let e11 = t9 / this._pattern.length();
- e11 -= Math.floor(e11), t9 = e11 * this._pattern.length(), this._pattern.reset(), a10 = this._pattern.nextValue();
- let i9 = false;
- for (; t9 >= a10; )
- t9 -= a10, a10 = this._pattern.nextValue(), i9 = !i9;
- a10 -= t9, i9 ? (this._walker.nextPosition(a10), a10 = this._pattern.nextValue()) : this.isClosed && (this._firstCurve = this._walker.nextCurve(a10), a10 = this._pattern.nextValue(), this._walker.nextPosition(a10), a10 = this._pattern.nextValue());
- }
- let i8 = this._walker.nextCurve(a10);
- return i8 ? this._walker.isPathEnd() ? (this.iteratePath = false, this._firstCurve && (this._firstCurve.splice(0, 1), s6.mergePath(i8, this._firstCurve), this._firstCurve = null)) : (a10 = this._pattern.nextValue(), !this._walker.nextPosition(a10) || this._walker.isPathEnd() ? (this.iteratePath = false, this._firstCurve && (i8 = this._firstCurve, this._firstCurve = null)) : this.iteratePath = true) : (this.iteratePath = false, i8 = this._firstCurve, this._firstCurve = null), { paths: [i8] };
- }
- };
- // node_modules/@arcgis/core/symbols/cim/effects/EffectDonut.js
- var r10 = class {
- static local() {
- return r10.instance === null && (r10.instance = new r10()), r10.instance;
- }
- execute(t8, i8, e11, s10) {
- return new m5(t8, i8, e11);
- }
- };
- r10.instance = null;
- var m5 = class {
- constructor(t8, i8, r18) {
- switch (this._inputGeometries = t8, this._curveHelper = new n7(), this._width = (i8.width !== void 0 ? i8.width : 2) * r18, i8.method) {
- case B.Mitered:
- default:
- this._method = O.Mitered;
- break;
- case B.Bevelled:
- this._method = O.Bevelled;
- break;
- case B.Rounded:
- case B.TrueBuffer:
- this._method = O.Rounded;
- break;
- case B.Square:
- this._method = O.Square;
- }
- this._option = i8.option, this._offsetFlattenError = e8 * r18;
- }
- next() {
- let e11 = this._inputGeometries.next();
- for (; e11; ) {
- if (s3(e11) && this._width > 0) {
- if (Math.min(e11.xmax - e11.xmin, e11.ymax - e11.ymin) - 2 * this._width < 0)
- return e11;
- const t8 = [];
- return t8.push([[e11.xmin, e11.ymin], [e11.xmin, e11.ymax], [e11.xmax, e11.ymax], [e11.xmax, e11.ymin], [e11.xmin, e11.ymin]]), t8.push([[e11.xmin + this._width, e11.ymin + this._width], [e11.xmax - this._width, e11.ymin + this._width], [e11.xmax - this._width, e11.ymax - this._width], [e11.xmin + this._width, e11.ymax - this._width], [e11.xmin + this._width, e11.ymin + this._width]]), { rings: t8 };
- }
- if (c2(e11) && this._width > 0) {
- const t8 = [];
- for (const i8 of e11.rings) {
- const e12 = this._curveHelper.calculatePathLength(i8), s10 = this._curveHelper.offset(i8, this._width, this._method, 4, this._offsetFlattenError);
- s10 && (e12 < 0 && s10.reverse(), t8.push(s10));
- }
- if (t8.length)
- return { rings: t8 };
- }
- e11 = this._inputGeometries.next();
- }
- return null;
- }
- };
- // node_modules/@arcgis/core/symbols/cim/effects/EffectJog.js
- var s8 = class {
- static local() {
- return s8.instance === null && (s8.instance = new s8()), s8.instance;
- }
- execute(t8, i8, s10, n17) {
- return new e9(t8, i8, s10);
- }
- };
- s8.instance = null;
- var e9 = class extends U3 {
- constructor(t8, s10, e11) {
- super(t8, false, true), this._curveHelper = new n7(), this._length = (s10.length !== void 0 ? s10.length : 20) * e11, this._angle = s10.angle !== void 0 ? s10.angle : 225, this._position = s10.position !== void 0 ? s10.position : 50, this._length < 0 && (this._length = -this._length), this._position < 20 && (this._position = 20), this._position > 80 && (this._position = 80), this._mirror = false;
- }
- processPath(t8) {
- if (this._curveHelper.isEmpty(t8, false))
- return null;
- const i8 = t8[0], s10 = t8[t8.length - 1], e11 = [s10[0] - i8[0], s10[1] - i8[1]];
- this._curveHelper.normalize(e11);
- const n17 = [i8[0] + (s10[0] - i8[0]) * this._position / 100, i8[1] + (s10[1] - i8[1]) * this._position / 100], h6 = Math.cos((90 - this._angle) / 180 * Math.PI);
- let r18 = Math.sin((90 - this._angle) / 180 * Math.PI);
- this._mirror && (r18 = -r18), this._mirror = !this._mirror;
- return { paths: [[i8, [n17[0] - this._length / 2 * h6, n17[1] - this._length / 2 * r18], [n17[0] + this._length / 2 * h6, n17[1] + this._length / 2 * r18], s10]] };
- }
- };
- // node_modules/@arcgis/core/symbols/cim/effects/EffectMove.js
- var n10 = class {
- static local() {
- return n10.instance === null && (n10.instance = new n10()), n10.instance;
- }
- execute(t8, s10, e11, i8) {
- return new r11(t8, s10, e11);
- }
- };
- n10.instance = null;
- var r11 = class {
- constructor(t8, s10, e11) {
- this._inputGeometries = t8, this._offsetX = s10.offsetX !== void 0 ? s10.offsetX * e11 : 0, this._offsetY = s10.offsetY !== void 0 ? -s10.offsetY * e11 : 0;
- }
- next() {
- let n17 = this._inputGeometries.next();
- for (; n17; ) {
- if (s3(n17))
- return { xmin: n17.xmin + this._offsetX, xmax: n17.xmax + this._offsetX, ymin: n17.ymin + this._offsetY, ymax: n17.ymax + this._offsetY };
- if (c2(n17)) {
- const s10 = m(n17);
- return this._moveMultipath(s10.rings, this._offsetX, this._offsetY), s10;
- }
- if (y(n17)) {
- const s10 = m(n17);
- return this._moveMultipath(s10.paths, this._offsetX, this._offsetY), s10;
- }
- if (f(n17)) {
- const s10 = m(n17);
- return this._movePath(s10.points, this._offsetX, this._offsetY), s10;
- }
- if (l(n17))
- return { x: n17.x + this._offsetX, y: n17.y + this._offsetY };
- n17 = this._inputGeometries.next();
- }
- return null;
- }
- _moveMultipath(t8, s10, e11) {
- if (t8)
- for (const i8 of t8)
- this._movePath(i8, s10, e11);
- }
- _movePath(t8, s10, e11) {
- if (t8)
- for (const i8 of t8)
- i8[0] += s10, i8[1] += e11;
- }
- };
- // node_modules/@arcgis/core/symbols/cim/effects/EffectOffset.js
- var r12 = class {
- static local() {
- return r12.instance === null && (r12.instance = new r12()), r12.instance;
- }
- execute(t8, e11, s10, i8) {
- return new f7(t8, e11, s10);
- }
- };
- r12.instance = null;
- var f7 = class {
- constructor(t8, e11, s10) {
- this._inputGeometries = t8, this._curveHelper = new n7(), this._offset = (e11.offset ?? 1) * s10, this._method = e11.method, this._option = e11.option, this._offsetFlattenError = e8 * s10;
- }
- next() {
- let i8 = this._inputGeometries.next();
- for (; i8; ) {
- if (this._offset === 0)
- return i8;
- if (s3(i8)) {
- if (this._method === O.Rounded && this._offset > 0) {
- const t8 = [[i8.xmin, i8.ymin], [i8.xmin, i8.ymax], [i8.xmax, i8.ymax], [i8.xmax, i8.ymin], [i8.xmin, i8.ymin]], e11 = this._curveHelper.offset(t8, -this._offset, this._method, 4, this._offsetFlattenError);
- return e11 ? { rings: [e11] } : null;
- }
- if (Math.min(i8.xmax - i8.xmin, i8.ymax - i8.ymin) + 2 * this._offset > 0)
- return { xmin: i8.xmin - this._offset, xmax: i8.xmax + this._offset, ymin: i8.ymin - this._offset, ymax: i8.ymax + this._offset };
- }
- if (c2(i8)) {
- const t8 = [];
- for (const e11 of i8.rings) {
- const s10 = this._curveHelper.offset(e11, -this._offset, this._method, 4, this._offsetFlattenError);
- s10 && t8.push(s10);
- }
- if (t8.length)
- return { rings: t8 };
- }
- if (y(i8)) {
- const t8 = [];
- for (const e11 of i8.paths) {
- const s10 = this._curveHelper.offset(e11, -this._offset, this._method, 4, this._offsetFlattenError);
- s10 && t8.push(s10);
- }
- if (t8.length)
- return { paths: t8 };
- }
- i8 = this._inputGeometries.next();
- }
- return null;
- }
- };
- // node_modules/@arcgis/core/symbols/cim/effects/EffectReverse.js
- var s9 = class {
- static local() {
- return s9.instance === null && (s9.instance = new s9()), s9.instance;
- }
- execute(e11, t8, r18, s10) {
- return new n11(e11, t8, r18);
- }
- };
- s9.instance = null;
- var n11 = class {
- constructor(e11, t8, r18) {
- this._inputGeometries = e11, this._reverse = t8.reverse === void 0 || t8.reverse;
- }
- next() {
- let s10 = this._inputGeometries.next();
- for (; s10; ) {
- if (!this._reverse)
- return s10;
- if (y(s10)) {
- const t8 = m(s10);
- return g2(t8.paths), t8;
- }
- s10 = this._inputGeometries.next();
- }
- return null;
- }
- };
- // node_modules/@arcgis/core/symbols/cim/effects/EffectRotate.js
- var u7 = class {
- static local() {
- return u7.instance === null && (u7.instance = new u7()), u7.instance;
- }
- execute(t8, n17, e11, r18) {
- return new c7(t8, n17, e11);
- }
- };
- u7.instance = null;
- var c7 = class {
- constructor(t8, n17, e11) {
- this._inputGeometries = t8, this._rotateAngle = n17.angle !== void 0 ? n17.angle * Math.PI / 180 : 0;
- }
- next() {
- let u9 = this._inputGeometries.next();
- for (; u9; ) {
- if (this._rotateAngle === 0)
- return u9;
- const c9 = u2();
- c(c9, u9);
- const l9 = (c9[2] + c9[0]) / 2, m7 = (c9[3] + c9[1]) / 2;
- if (s3(u9)) {
- const t8 = { rings: [[[u9.xmin, u9.ymin], [u9.xmin, u9.ymax], [u9.xmax, u9.ymax], [u9.xmax, u9.ymin], [u9.xmin, u9.ymin]]] };
- return this._rotateMultipath(t8.rings, l9, m7), t8;
- }
- if (c2(u9)) {
- const n17 = m(u9);
- return this._rotateMultipath(n17.rings, l9, m7), n17;
- }
- if (y(u9)) {
- const n17 = m(u9);
- return this._rotateMultipath(n17.paths, l9, m7), n17;
- }
- if (f(u9)) {
- const n17 = m(u9);
- return this._rotatePath(n17.points, l9, m7), n17;
- }
- if (l(u9))
- return u9;
- u9 = this._inputGeometries.next();
- }
- return null;
- }
- _rotateMultipath(t8, n17, e11) {
- if (t8)
- for (const r18 of t8)
- this._rotatePath(r18, n17, e11);
- }
- _rotatePath(t8, n17, e11) {
- if (t8) {
- const r18 = Math.cos(this._rotateAngle), i8 = Math.sin(this._rotateAngle);
- for (const o11 of t8) {
- const t9 = o11[0] - n17, s10 = o11[1] - e11;
- o11[0] = n17 + t9 * r18 - s10 * i8, o11[1] = e11 + t9 * i8 + s10 * r18;
- }
- }
- }
- };
- // node_modules/@arcgis/core/symbols/cim/effects/EffectScale.js
- var c8 = class {
- static local() {
- return c8.instance === null && (c8.instance = new c8()), c8.instance;
- }
- execute(t8, s10, i8, r18) {
- return new l7(t8, s10, i8);
- }
- };
- c8.instance = null;
- var l7 = class {
- constructor(t8, s10, i8) {
- this._inputGeometries = t8, this._xFactor = s10.xScaleFactor !== void 0 ? s10.xScaleFactor : 1.15, this._yFactor = s10.yScaleFactor !== void 0 ? s10.yScaleFactor : 1.15;
- }
- next() {
- let c9 = this._inputGeometries.next();
- for (; c9; ) {
- if (this._xFactor === 1 && this._yFactor === 1)
- return c9;
- const l9 = u2();
- c(l9, c9);
- const u9 = (l9[2] + l9[0]) / 2, m7 = (l9[3] + l9[1]) / 2;
- if (s3(c9)) {
- const t8 = { rings: [[[c9.xmin, c9.ymin], [c9.xmin, c9.ymax], [c9.xmax, c9.ymax], [c9.xmax, c9.ymin], [c9.xmin, c9.ymin]]] };
- return this._scaleMultipath(t8.rings, u9, m7), t8;
- }
- if (c2(c9)) {
- const s10 = m(c9);
- return this._scaleMultipath(s10.rings, u9, m7), s10;
- }
- if (y(c9)) {
- const s10 = m(c9);
- return this._scaleMultipath(s10.paths, u9, m7), s10;
- }
- if (f(c9)) {
- const s10 = m(c9);
- return this._scalePath(s10.points, u9, m7), s10;
- }
- if (l(c9))
- return c9;
- c9 = this._inputGeometries.next();
- }
- return null;
- }
- _scaleMultipath(t8, s10, i8) {
- if (t8)
- for (const r18 of t8)
- this._scalePath(r18, s10, i8);
- }
- _scalePath(t8, s10, i8) {
- if (t8)
- for (const r18 of t8) {
- const t9 = (r18[0] - s10) * this._xFactor, n17 = (r18[1] - i8) * this._yFactor;
- r18[0] = s10 + t9, r18[1] = i8 + n17;
- }
- }
- };
- // node_modules/@arcgis/core/symbols/cim/effects/EffectWave.js
- var r13 = class {
- static local() {
- return r13.instance === null && (r13.instance = new r13()), r13.instance;
- }
- execute(t8, e11, i8, s10) {
- return new a6(t8, e11, i8);
- }
- };
- r13.instance = null;
- var a6 = class {
- constructor(t8, e11, i8) {
- this._inputGeometries = t8, this._height = (e11.amplitude !== void 0 ? e11.amplitude : 2) * i8, this._period = (e11.period !== void 0 ? e11.period : 3) * i8, this._style = e11.waveform, this._height <= 0 && (this._height = Math.abs(this._height)), this._period <= 0 && (this._period = Math.abs(this._period)), this._pattern = new n8(), this._pattern.addValue(this._period), this._pattern.addValue(this._period), this._walker = new a5(), this._walker.updateTolerance(i8);
- }
- next() {
- let i8 = this._inputGeometries.next();
- for (; i8; ) {
- if (this._height === 0 || this._period === 0)
- return i8;
- if (y(i8)) {
- const t8 = this._processGeom(i8.paths);
- if (t8.length)
- return { paths: t8 };
- }
- if (c2(i8)) {
- const t8 = this._processGeom(i8.rings);
- if (t8.length)
- return { rings: t8 };
- }
- i8 = this._inputGeometries.next();
- }
- return null;
- }
- _processGeom(t8) {
- const e11 = [];
- for (const i8 of t8)
- if (this._walker.init(i8, this._pattern))
- switch (this._style) {
- case A.Sinus:
- default:
- e11.push(this._constructCurve(i8, false));
- break;
- case A.Square:
- e11.push(this._constructSquare(i8));
- break;
- case A.Triangle:
- e11.push(this._constructTriangle(i8));
- break;
- case A.Random:
- e11.push(this._constructCurve(i8, true));
- }
- else
- e11.push(i8);
- return e11;
- }
- _constructCurve(t8, e11) {
- const s10 = new s6(), h6 = this._walker.calculatePathLength(t8);
- let n17 = Math.round(h6 / this._period);
- n17 === 0 && (n17 = 1);
- const r18 = n17 * 16 + 1, a10 = h6 / n17, o11 = this._period / 16, l9 = 1 / r18, _4 = 2 * Math.PI * h6 / a10, c9 = 2 * Math.PI * Math.random(), p3 = 2 * Math.PI * Math.random(), u9 = 2 * Math.PI * Math.random(), d2 = 0.75 - Math.random() / 2, g5 = 0.75 - Math.random() / 2, w4 = {};
- this._walker.curPointAndAngle(w4), s10.startPath(w4.pt);
- let f8 = 0;
- for (; ; ) {
- if (!this._walker.nextPointAndAngle(o11, w4)) {
- s10.lineTo(t8[t8.length - 1]);
- break;
- }
- {
- const t9 = f8;
- let i8;
- if (f8 += l9, e11) {
- const e12 = this._height / 2 * (1 + 0.3 * Math.sin(d2 * _4 * t9 + c9));
- i8 = e12 * Math.sin(_4 * t9 + p3), i8 += e12 * Math.sin(g5 * _4 * t9 + u9), i8 /= 2;
- } else
- i8 = 0.5 * this._height * Math.sin(0.5 * _4 * t9);
- s10.lineTo([w4.pt[0] - i8 * w4.sa, w4.pt[1] + i8 * w4.ca]);
- }
- }
- return s10.path();
- }
- _constructSquare(t8) {
- const e11 = new s6(), s10 = this._walker.calculatePathLength(t8);
- Math.round(s10 / this._period);
- let h6 = true;
- for (; ; ) {
- let t9 = false;
- if (this._walker.curPositionIsValid()) {
- const i8 = {};
- this._walker.curPointAndAngle(i8);
- const s11 = {};
- if (this._walker.nextPointAndAngle(this._period, s11)) {
- const n17 = {};
- this._walker.nextPointAndAngle(this._period, n17) && (h6 ? (e11.startPath(i8.pt), h6 = false) : e11.lineTo(i8.pt), e11.lineTo([i8.pt[0] - this._height / 2 * i8.sa, i8.pt[1] + this._height / 2 * i8.ca]), e11.lineTo([s11.pt[0] - this._height / 2 * s11.sa, s11.pt[1] + this._height / 2 * s11.ca]), e11.lineTo([s11.pt[0] + this._height / 2 * s11.sa, s11.pt[1] - this._height / 2 * s11.ca]), e11.lineTo([n17.pt[0] + this._height / 2 * n17.sa, n17.pt[1] - this._height / 2 * n17.ca]), t9 = true);
- }
- }
- if (!t9) {
- e11.lineTo(this._walker.getPathEnd());
- break;
- }
- }
- return e11.path();
- }
- _constructTriangle(t8) {
- const e11 = new s6(), s10 = this._walker.calculatePathLength(t8);
- Math.round(s10 / this._period);
- let h6 = true;
- for (; ; ) {
- let t9 = false;
- if (this._walker.curPositionIsValid()) {
- const i8 = {};
- this._walker.curPointAndAngle(i8);
- const s11 = {};
- if (this._walker.nextPointAndAngle(this._period / 2, s11)) {
- const n17 = {};
- this._walker.nextPointAndAngle(this._period, n17) && (this._walker.nextPosition(this._period / 2) && (h6 ? (e11.startPath(i8.pt), h6 = false) : e11.lineTo(i8.pt), e11.lineTo([s11.pt[0] - this._height / 2 * s11.sa, s11.pt[1] + this._height / 2 * s11.ca]), e11.lineTo([n17.pt[0] + this._height / 2 * n17.sa, n17.pt[1] - this._height / 2 * n17.ca])), t9 = true);
- }
- }
- if (!t9) {
- e11.lineTo(this._walker.getPathEnd());
- break;
- }
- }
- return e11.path();
- }
- };
- // node_modules/@arcgis/core/symbols/cim/placements/PlacementAlongLineSameSize.js
- var n12 = class {
- static local() {
- return n12.instance === null && (n12.instance = new n12()), n12.instance;
- }
- execute(t8, e11, s10, i8) {
- return new a7(t8, e11, s10);
- }
- };
- n12.instance = null;
- var a7 = class extends G {
- constructor(t8, e11, n17) {
- super(t8, true, true), this._geometryWalker = new a5(), this._geometryWalker.updateTolerance(n17), this._angleToLine = e11.angleToLine ?? true, this._offset = (e11.offset ? e11.offset : 0) * n17, this._originalEndings = e11.endings, this._offsetAtEnd = (e11.customEndingOffset ? e11.customEndingOffset : 0) * n17, this._position = -(e11.offsetAlongLine ? e11.offsetAlongLine : 0) * n17, this._pattern = new n8(), this._pattern.init(e11.placementTemplate, false), this._pattern.scale(n17), this._endings = this._originalEndings;
- }
- processPath(t8) {
- if (this._pattern.isEmpty())
- return null;
- let s10;
- if (this.iteratePath)
- s10 = this._pattern.nextValue();
- else {
- this._originalEndings === X.WithFullGap && this.isClosed ? this._endings = X.WithMarkers : this._endings = this._originalEndings, this._pattern.extPtGap = 0;
- let i9, n17 = true;
- switch (this._endings) {
- case X.NoConstraint:
- i9 = -this._position, i9 = this._adjustPosition(i9), n17 = false;
- break;
- case X.WithHalfGap:
- default:
- i9 = -this._pattern.lastValue() / 2;
- break;
- case X.WithFullGap:
- i9 = -this._pattern.lastValue(), this._pattern.extPtGap = this._pattern.lastValue();
- break;
- case X.WithMarkers:
- i9 = 0;
- break;
- case X.Custom:
- i9 = -this._position, i9 = this._adjustPosition(i9), this._pattern.extPtGap = 0.5 * this._offsetAtEnd;
- }
- if (!this._geometryWalker.init(t8, this._pattern, n17))
- return null;
- this._pattern.reset();
- let a10 = 0;
- for (; i9 > a10; )
- i9 -= a10, a10 = this._pattern.nextValue();
- a10 -= i9, s10 = a10, this.iteratePath = true;
- }
- const i8 = {};
- return this._geometryWalker.nextPointAndAngle(s10, i8) ? this._endings === X.WithFullGap && this._geometryWalker.isPathEnd() ? (this.iteratePath = false, null) : this._endings === X.WithMarkers && this._geometryWalker.isPathEnd() && (this.iteratePath = false, this.isClosed) ? null : (this.internalPlacement.setTranslate(i8.pt[0] - this._offset * i8.sa, i8.pt[1] + this._offset * i8.ca), this._angleToLine && this.internalPlacement.setRotateCS(i8.ca, i8.sa), this.internalPlacement) : (this.iteratePath = false, null);
- }
- _adjustPosition(t8) {
- let e11 = t8 / this._pattern.length();
- return e11 -= Math.floor(e11), e11 * this._pattern.length();
- }
- };
- // node_modules/@arcgis/core/symbols/cim/placements/PlacementAtExtremities.js
- var n13 = class {
- static local() {
- return n13.instance === null && (n13.instance = new n13()), n13.instance;
- }
- execute(t8, e11, s10, i8) {
- return new r14(t8, e11, s10);
- }
- };
- n13.instance = null;
- var r14 = class extends G {
- constructor(t8, e11, i8) {
- super(t8, false, true), this._curveHelper = new n7(), this._angleToLine = e11.angleToLine === void 0 || e11.angleToLine, this._offset = e11.offset !== void 0 ? e11.offset * i8 : 0, this._type = e11.extremityPlacement, this._position = e11.offsetAlongLine !== void 0 ? e11.offsetAlongLine * i8 : 0, this._beginProcessed = false;
- }
- processPath(t8) {
- let e11;
- switch (this._type) {
- case o3.Both:
- default:
- this._beginProcessed ? (e11 = this._atExtremities(t8, this._position, false), this._beginProcessed = false, this.iteratePath = false) : (e11 = this._atExtremities(t8, this._position, true), this._beginProcessed = true, this.iteratePath = true);
- break;
- case o3.JustBegin:
- e11 = this._atExtremities(t8, this._position, true);
- break;
- case o3.JustEnd:
- e11 = this._atExtremities(t8, this._position, false);
- case o3.None:
- }
- return e11;
- }
- _atExtremities(t8, s10, i8) {
- const n17 = t8.length;
- if (n17 < 2)
- return null;
- const r18 = i8 ? 1 : n17 - 2, o11 = i8 ? n17 : -1, a10 = i8 ? 1 : -1;
- let l9, h6 = 0, c9 = i8 ? t8[0] : t8[n17 - 1];
- for (let _4 = r18; _4 !== o11; _4 += a10) {
- l9 = c9, c9 = t8[_4];
- const i9 = this._curveHelper.calculateLength(l9, c9);
- if (h6 + i9 > s10) {
- const t9 = (s10 - h6) / i9, [n18, r19] = this._curveHelper.getAngleCS(l9, c9, t9), o12 = y3(l9, c9, t9);
- return this.internalPlacement.setTranslate(o12[0] - this._offset * r19, o12[1] + this._offset * n18), this._angleToLine && this.internalPlacement.setRotateCS(-n18, -r19), this.internalPlacement;
- }
- h6 += i9;
- }
- return null;
- }
- };
- // node_modules/@arcgis/core/symbols/cim/placements/PlacementAtRatioPositions.js
- var n14 = class {
- static local() {
- return n14.instance === null && (n14.instance = new n14()), n14.instance;
- }
- execute(t8, i8, s10, e11) {
- return new a8(t8, i8, s10);
- }
- };
- n14.instance = null;
- var a8 = class extends G {
- constructor(t8, e11, n17) {
- super(t8, true, true), this._walker = new a5(), this._walker.updateTolerance(n17), this._angleToLine = e11.angleToLine === void 0 || e11.angleToLine, this._offset = e11.offset !== void 0 ? e11.offset * n17 : 0, this._beginGap = e11.beginPosition !== void 0 ? e11.beginPosition * n17 : 0, this._endGap = e11.endPosition !== void 0 ? e11.endPosition * n17 : 0, this._flipFirst = e11.flipFirst === void 0 || e11.flipFirst, this._pattern = new n8(), this._pattern.init(e11.positionArray, false, false), this._subPathLen = 0, this._posCount = this._pattern.size(), this._isFirst = true, this._prevPos = 0;
- }
- processPath(t8) {
- if (this._pattern.isEmpty())
- return null;
- let i8;
- if (this.iteratePath) {
- const t9 = this._pattern.nextValue() * this._subPathLen, s11 = this._beginGap + t9;
- i8 = s11 - this._prevPos, this._prevPos = s11;
- } else {
- if (this._posCount = this._pattern.size(), this._isFirst = true, this._prevPos = 0, this._subPathLen = this._walker.calculatePathLength(t8) - this._beginGap - this._endGap, this._subPathLen < 0)
- return this.iteratePath = false, null;
- if (!this._walker.init(t8, this._pattern, false))
- return null;
- this._pattern.reset();
- const s11 = this._pattern.nextValue() * this._subPathLen, e11 = this._beginGap + s11;
- i8 = e11 - this._prevPos, this._prevPos = e11, this.iteratePath = true;
- }
- const s10 = {};
- if (!this._walker.nextPointAndAngle(i8, s10, h4.END))
- return this.iteratePath = false, null;
- this.internalPlacement.setTranslate(s10.pt[0] - this._offset * s10.sa, s10.pt[1] + this._offset * s10.ca);
- const n17 = this._isFirst && this._flipFirst;
- let a10, r18;
- return this._angleToLine ? (a10 = s10.ca, r18 = s10.sa) : (a10 = 1, r18 = 0), n17 && (a10 = -a10, r18 = -r18), this.internalPlacement.setRotateCS(a10, r18), this._isFirst = false, this._posCount--, this._posCount === 0 && (this.iteratePath = false), this.internalPlacement;
- }
- };
- // node_modules/@arcgis/core/symbols/cim/placements/PlacementInsidePolygon.js
- function h5(t8) {
- return t8.rings !== void 0;
- }
- var e10 = class {
- static local() {
- return e10.instance === null && (e10.instance = new e10()), e10.instance;
- }
- execute(t8, s10, i8, h6) {
- return new n15(t8, s10, i8, h6);
- }
- };
- e10.instance = null;
- var n15 = class {
- constructor(e11, n17, _4, r18) {
- if (this._xMin = 0, this._xMax = 0, this._yMin = 0, this._yMax = 0, this._currentX = 0, this._currentY = 0, this._stepX = Math.abs(n17.stepX ?? 16) * _4, this._stepY = Math.abs(n17.stepY ?? 16) * _4, this._stepX !== 0 && this._stepY !== 0 && e11 && h5(e11) && e11.rings) {
- if (this._gridType = n17.gridType ?? Y.Fixed, this._gridType === Y.Random) {
- const s10 = n17.seed ?? 13, i8 = 1;
- this._randomLCG = new t2(s10 * i8), this._randomness = (n17.randomness ?? 100) / 100, this._gridAngle = 0, this._shiftOddRows = false, this._cosAngle = 1, this._sinAngle = 0, this._offsetX = 0, this._offsetY = 0;
- } else {
- if (this._randomness = 0, this._gridAngle = n17.gridAngle ?? 0, this._shiftOddRows = n17.shiftOddRows ?? false, this._offsetX = (n17.offsetX ?? 0) * _4, this._offsetY = (n17.offsetY ?? 0) * _4, this._cosAngle = Math.cos(this._gridAngle / 180 * Math.PI), this._sinAngle = -Math.sin(this._gridAngle / 180 * Math.PI), this._stepX)
- if (this._offsetX < 0)
- for (; this._offsetX < -0.5 * this._stepX; )
- this._offsetX += this._stepX;
- else
- for (; this._offsetX >= 0.5 * this._stepX; )
- this._offsetX -= this._stepX;
- if (this._stepY)
- if (this._offsetY < 0)
- for (; this._offsetY < -0.5 * this._stepY; )
- this._offsetY += this._stepY;
- else
- for (; this._offsetY >= 0.5 * this._stepY; )
- this._offsetY -= this._stepY;
- }
- this._graphicOriginX = 0, this._graphicOriginY = 0, this._internalPlacement = new t6(), this._calculateMinMax(e11), this._geometry = e11;
- }
- }
- next() {
- return this._geometry ? this._nextInside() : null;
- }
- _calculateMinMax(t8) {
- let s10, i8, h6, e11, n17, _4, r18, o11;
- this._xMin = 0, this._xMax = 0, this._yMin = 0, this._yMax = 0, n17 = _4 = Number.MAX_VALUE, r18 = o11 = -Number.MAX_VALUE;
- for (const a10 of t8.rings) {
- const t9 = a10 ? a10.length : 0;
- for (let f8 = 0; f8 < t9; ++f8)
- s10 = a10[f8][0] - this._graphicOriginX - this._offsetX, i8 = a10[f8][1] - this._graphicOriginY - this._offsetY, h6 = this._cosAngle * s10 - this._sinAngle * i8, e11 = this._sinAngle * s10 + this._cosAngle * i8, n17 = Math.min(n17, h6), r18 = Math.max(r18, h6), _4 = Math.min(_4, e11), o11 = Math.max(o11, e11);
- }
- n17 += this._graphicOriginX, r18 += this._graphicOriginX, _4 += this._graphicOriginY, o11 += this._graphicOriginY, this._xMin = Math.round(n17 / this._stepX), this._xMax = Math.round(r18 / this._stepX), this._yMin = Math.round(_4 / this._stepY), this._yMax = Math.round(o11 / this._stepY), this._currentX = this._xMax + 1, this._currentY = this._yMin - 1;
- }
- _nextInside() {
- for (; ; ) {
- if (this._currentX > this._xMax) {
- if (this._currentY++, this._currentY > this._yMax)
- return null;
- this._currentX = this._xMin, this._shiftOddRows && this._currentY % 2 && this._currentX--;
- }
- let t8 = this._currentX * this._stepX + this._offsetX;
- this._shiftOddRows && this._currentY % 2 && (t8 += 0.5 * this._stepX);
- const s10 = this._currentY * this._stepY + this._offsetY;
- let h6, e11;
- return this._currentX++, this._gridType === Y.Random ? (h6 = this._graphicOriginX + t8 + this._stepX * this._randomness * (0.5 - this._randomLCG.getFloat()) * 2 / 3, e11 = this._graphicOriginY + s10 + this._stepY * this._randomness * (0.5 - this._randomLCG.getFloat()) * 2 / 3) : (h6 = this._graphicOriginX + this._cosAngle * t8 + this._sinAngle * s10, e11 = this._graphicOriginY - this._sinAngle * t8 + this._cosAngle * s10), this._internalPlacement.setTranslate(h6, e11), this._internalPlacement;
- }
- }
- };
- // node_modules/@arcgis/core/symbols/cim/placements/PlacementOnLine.js
- var r15 = 1e-3;
- var l8 = class {
- static local() {
- return l8.instance === null && (l8.instance = new l8()), l8.instance;
- }
- execute(e11, t8, n17, i8) {
- return new o8(e11, t8, n17);
- }
- };
- l8.instance = null;
- var o8 = class extends G {
- constructor(e11, t8, n17) {
- super(e11, true, true), this._curveHelper = new n7(), this._angleToLine = t8.angleToLine === void 0 || t8.angleToLine, this._offset = t8.offset !== void 0 ? t8.offset * n17 : 0, this._relativeTo = t8.relativeTo, this._position = t8.startPointOffset !== void 0 ? t8.startPointOffset * n17 : 0, this._epsilon = r15 * n17;
- }
- processPath(e11) {
- const i8 = this._position;
- if (this._relativeTo === Z.SegmentMidpoint) {
- for (this.iteratePath || (this._segmentCount = e11.length, this._curSegment = 1, this.iteratePath = true); this._curSegment < this._segmentCount; ) {
- const n17 = this._curSegment;
- this._curSegment++;
- const i9 = e11[n17 - 1], s10 = e11[n17], r19 = this._curveHelper.calculateLength(i9, s10);
- if (r19 < this._epsilon)
- continue;
- const l9 = 0.5 + this._position / r19, [o11, a10] = this._curveHelper.getAngleCS(i9, s10, l9), h6 = y3(i9, s10, l9);
- return this.internalPlacement.setTranslate(h6[0] - this._offset * a10, h6[1] + this._offset * o11), this._angleToLine && this.internalPlacement.setRotateCS(o11, a10), this.internalPlacement;
- }
- return this.iteratePath = false, null;
- }
- this._relativeTo === Z.LineEnd && d(e11);
- const r18 = this.onLine(e11, i8);
- return this._relativeTo === Z.LineEnd && d(e11), r18;
- }
- onLine(e11, n17) {
- let i8, r18 = false;
- switch (this._relativeTo) {
- case Z.LineMiddle:
- default:
- i8 = this._curveHelper.calculatePathLength(e11) / 2 + n17;
- break;
- case Z.LineBeginning:
- i8 = n17;
- break;
- case Z.LineEnd:
- i8 = n17, r18 = true;
- }
- const l9 = e11.length;
- let o11, a10 = 0, h6 = e11[0];
- for (let s10 = 1; s10 < l9; ++s10) {
- o11 = h6, h6 = e11[s10];
- const n18 = this._curveHelper.calculateLength(o11, h6);
- if (a10 + n18 > i8) {
- const e12 = (i8 - a10) / n18, [s11, l10] = this._curveHelper.getAngleCS(o11, h6, e12), c9 = y3(o11, h6, e12), u9 = r18 ? -this._offset : this._offset;
- return this.internalPlacement.setTranslate(c9[0] - u9 * l10, c9[1] + u9 * s11), this._angleToLine && (r18 ? this.internalPlacement.setRotateCS(-s11, -l10) : this.internalPlacement.setRotateCS(s11, l10)), this.internalPlacement;
- }
- a10 += n18;
- }
- return null;
- }
- };
- // node_modules/@arcgis/core/symbols/cim/placements/PlacementOnVertices.js
- var n16 = class {
- static local() {
- return n16.instance === null && (n16.instance = new n16()), n16.instance;
- }
- execute(t8, s10, e11, i8) {
- return new a9(t8, s10, e11);
- }
- };
- n16.instance = null;
- var r16 = 1e-15;
- var a9 = class extends G {
- constructor(t8, s10, e11) {
- super(t8, true, true), this._curveHelper = new n7(), this._angleToLine = s10.angleToLine === void 0 || s10.angleToLine, this._offset = s10.offset !== void 0 ? s10.offset * e11 : 0, this._endPoints = s10.placeOnEndPoints === void 0 || s10.placeOnEndPoints, this._controlPoints = s10.placeOnControlPoints === void 0 || s10.placeOnControlPoints, this._regularVertices = s10.placeOnRegularVertices === void 0 || s10.placeOnRegularVertices, this._tags = [], this._tagIterator = 0;
- }
- processPath(t8) {
- if (this.iteratePath || (this._preparePath(t8), this.iteratePath = true), this._tagIterator >= this._tags.length)
- return this._tags.length = 0, this._tagIterator = 0, this.iteratePath = false, null;
- const s10 = this._tags[this._tagIterator];
- this._angleToLine && this.internalPlacement.setRotate(s10[2]);
- let e11 = s10[0], i8 = s10[1];
- if (this._offset !== 0) {
- const t9 = Math.cos(s10[2]), n17 = Math.sin(s10[2]);
- e11 -= this._offset * n17, i8 += this._offset * t9;
- }
- return this.internalPlacement.setTranslate(e11, i8), this._tagIterator++, this.internalPlacement;
- }
- _preparePath(t8) {
- this._tags.length = 0, this._tagIterator = 0;
- const i8 = C3(t8), n17 = t8.length - 1;
- let r18, a10, h6 = 0, l9 = 0, _4 = 0, c9 = 0, g5 = 0;
- for (; h6 < n17; ) {
- h6++, r18 = t8[h6 - 1], a10 = t8[h6];
- const s10 = I(r18), u9 = I(a10);
- (this._angleToLine || this._offset !== 0) && (c9 = this._curveHelper.getAngle(r18, a10, 0)), h6 === 1 ? i8 ? (l9 = c9, _4 = s10) : (this._endPoints || this._controlPoints && s10 === 1) && this._tags.push([r18[0], r18[1], c9]) : s10 === 1 ? this._controlPoints && this._tags.push([r18[0], r18[1], o9(g5, c9)]) : this._regularVertices && this._tags.push([r18[0], r18[1], o9(g5, c9)]), (this._angleToLine || this._offset !== 0) && (g5 = this._curveHelper.getAngle(r18, a10, 1)), h6 === n17 && (i8 ? u9 === 1 || _4 === 1 ? this._controlPoints && this._tags.push([a10[0], a10[1], o9(g5, l9)]) : this._regularVertices && this._tags.push([a10[0], a10[1], o9(g5, l9)]) : (this._endPoints || this._controlPoints && u9 === 1) && this._tags.push([a10[0], a10[1], g5]));
- }
- this._tagIterator = 0;
- }
- };
- function o9(t8, s10) {
- const e11 = Math.PI;
- for (; Math.abs(s10 - t8) > e11 + 2 * r16; )
- s10 - t8 > e11 ? s10 -= 2 * e11 : s10 += 2 * e11;
- return (t8 + s10) / 2;
- }
- // node_modules/@arcgis/core/symbols/cim/placements/PlacementPolygonCenter.js
- function o10(t8) {
- return t8.rings !== void 0;
- }
- var r17 = class {
- static local() {
- return r17.instance === null && (r17.instance = new r17()), r17.instance;
- }
- execute(t8, e11, n17, s10) {
- return new i6(t8, e11, n17);
- }
- };
- r17.instance = null;
- var i6 = class {
- constructor(t8, e11, o11) {
- this._geometry = t8, this._offsetX = e11.offsetX !== void 0 ? e11.offsetX * o11 : 0, this._offsetY = e11.offsetY !== void 0 ? e11.offsetY * o11 : 0, this._method = e11.method !== void 0 ? e11.method : K.OnPolygon, this._internalPlacement = new t6();
- }
- next() {
- const t8 = this._geometry;
- return this._geometry = null, t8 && o10(t8) ? this._polygonCenter(t8) : null;
- }
- _polygonCenter(n17) {
- let o11 = false;
- switch (this._method) {
- case K.OnPolygon:
- default:
- case K.CenterOfMass:
- case K.BoundingBoxCenter: {
- const s10 = u2();
- c(s10, n17), this._internalPlacement.setTranslate((s10[2] + s10[0]) / 2 + this._offsetX, (s10[3] + s10[1]) / 2 + this._offsetY), o11 = true;
- break;
- }
- }
- return o11 ? this._internalPlacement : null;
- }
- };
- // node_modules/@arcgis/core/symbols/cim/CIMOperators.js
- function A2(p3) {
- if (!p3)
- return null;
- switch (p3.type) {
- case "CIMGeometricEffectAddControlPoints":
- return o7.local();
- case "CIMGeometricEffectArrow":
- return h2.local();
- case "CIMGeometricEffectBuffer":
- return f6.local();
- case "CIMGeometricEffectControlMeasureLine":
- return _.local();
- case "CIMGeometricEffectCut":
- return u6.local();
- case "CIMGeometricEffectDashes":
- return r9.local();
- case "CIMGeometricEffectDonut":
- return r10.local();
- case "CIMGeometricEffectJog":
- return s8.local();
- case "CIMGeometricEffectMove":
- return n10.local();
- case "CIMGeometricEffectOffset":
- return r12.local();
- case "CIMGeometricEffectReverse":
- return s9.local();
- case "CIMGeometricEffectRotate":
- return u7.local();
- case "CIMGeometricEffectScale":
- return c8.local();
- case "CIMGeometricEffectWave":
- return r13.local();
- }
- return null;
- }
- function g3(e11) {
- if (!e11)
- return null;
- switch (e11.type) {
- case "CIMMarkerPlacementAlongLineSameSize":
- return n12.local();
- case "CIMMarkerPlacementAtExtremities":
- return n13.local();
- case "CIMMarkerPlacementAtRatioPositions":
- return n14.local();
- case "CIMMarkerPlacementInsidePolygon":
- return e10.local();
- case "CIMMarkerPlacementOnLine":
- return l8.local();
- case "CIMMarkerPlacementOnVertices":
- return n16.local();
- case "CIMMarkerPlacementPolygonCenter":
- return r17.local();
- }
- return null;
- }
- // node_modules/@arcgis/core/symbols/cim/Rect.js
- var t7 = class {
- constructor(t8 = 0, h6 = 0, i8 = 0, s10 = 0) {
- this.x = t8, this.y = h6, this.width = i8, this.height = s10;
- }
- get isEmpty() {
- return this.width <= 0 || this.height <= 0;
- }
- union(t8) {
- this.x = Math.min(this.x, t8.x), this.y = Math.min(this.y, t8.y), this.width = Math.max(this.width, t8.width), this.height = Math.max(this.height, t8.height);
- }
- };
- // node_modules/@arcgis/core/views/2d/engine/webgl/collisions/BoundingBox.js
- var i7 = class {
- constructor(i8, e11, s10, r18) {
- this.center = t4(i8, e11), this.centerT = n2(), this.halfWidth = s10 / 2, this.halfHeight = r18 / 2, this.width = s10, this.height = r18;
- }
- get x() {
- return this.center[0];
- }
- get y() {
- return this.center[1];
- }
- get blX() {
- return this.center[0] + this.halfWidth;
- }
- get blY() {
- return this.center[1] + this.halfHeight;
- }
- get trX() {
- return this.center[0] - this.halfWidth;
- }
- get trY() {
- return this.center[1] - this.halfHeight;
- }
- get xmin() {
- return this.x - this.halfWidth;
- }
- get xmax() {
- return this.x + this.halfWidth;
- }
- get ymin() {
- return this.y - this.halfHeight;
- }
- get ymax() {
- return this.y + this.halfHeight;
- }
- set x(t8) {
- this.center[0] = t8;
- }
- set y(t8) {
- this.center[1] = t8;
- }
- clone() {
- return new i7(this.x, this.y, this.width, this.height);
- }
- serialize(t8) {
- return t8.writeF32(this.center[0]), t8.writeF32(this.center[1]), t8.push(this.width), t8.push(this.height), t8;
- }
- findCollisionDelta(t8, h6 = 4) {
- const i8 = Math.abs(t8.centerT[0] - this.centerT[0]), e11 = Math.abs(t8.centerT[1] - this.centerT[1]), s10 = (t8.halfWidth + this.halfWidth + h6) / i8, r18 = (t8.halfHeight + this.halfHeight + h6) / e11, n17 = Math.min(s10, r18);
- return Math.log2(n17);
- }
- extend(t8) {
- const h6 = Math.min(this.xmin, t8.xmin), i8 = Math.min(this.ymin, t8.ymin), e11 = Math.max(this.xmax, t8.xmax) - h6, s10 = Math.max(this.ymax, t8.ymax) - i8, r18 = h6 + e11 / 2, n17 = i8 + s10 / 2;
- this.width = e11, this.height = s10, this.halfWidth = e11 / 2, this.halfHeight = s10 / 2, this.x = r18, this.y = n17;
- }
- static deserialize(t8) {
- const h6 = t8.readF32(), e11 = t8.readF32(), s10 = t8.readInt32(), r18 = t8.readInt32();
- return new i7(h6, e11, s10, r18);
- }
- };
- // node_modules/@arcgis/core/views/2d/engine/webgl/mesh/templates/shapingUtils.js
- var m6 = 26;
- var u8 = 4;
- var g4 = m6 + u8;
- var _2 = m6 - 6;
- var p2 = 3;
- var x2 = 8;
- var w3 = Math.PI / 180;
- var y4 = class {
- constructor(t8, s10, e11, i8) {
- this._rotationT = n(), this._xBounds = 0, this._yBounds = 0, this.minZoom = 0, this.maxZoom = 255, this._bounds = null;
- const n17 = e11.rect, o11 = new Float32Array(8);
- t8 *= i8, s10 *= i8;
- const r18 = e11.code ? n17.width * i8 : e11.metrics.width, a10 = e11.code ? n17.height * i8 : e11.metrics.height;
- o11[0] = t8, o11[1] = s10, o11[2] = t8 + r18, o11[3] = s10, o11[4] = t8, o11[5] = s10 + a10, o11[6] = t8 + r18, o11[7] = s10 + a10, this._data = o11, this._setTextureCoords(n17), this._scale = i8, this._mosaic = e11, this.x = t8, this.y = s10, this.maxOffset = Math.max(t8 + r18, s10 + a10);
- }
- get width() {
- return this._mosaic.metrics.width * this._scale;
- }
- get mosaic() {
- return this._mosaic;
- }
- set angle(s10) {
- this._angle = s10, h(this._rotationT, -s10), this._setOffsets(this._data);
- }
- get angle() {
- return this._angle;
- }
- get xTopLeft() {
- return this._data[0];
- }
- get yTopLeft() {
- return this._data[1];
- }
- get xBottomRight() {
- return this._data[6];
- }
- get yBottomRight() {
- return this._data[7];
- }
- get texcoords() {
- return this._texcoords;
- }
- get textureBinding() {
- return this._mosaic.textureBinding;
- }
- get offsets() {
- return this._offsets || this._setOffsets(this._data), this._offsets;
- }
- get char() {
- return String.fromCharCode(this._mosaic.code);
- }
- get code() {
- return this._mosaic.code;
- }
- get bounds() {
- if (!this._bounds) {
- const { height: t8, width: e11 } = this._mosaic.metrics, i8 = e11 * this._scale, o11 = Math.abs(t8) * this._scale, r18 = new Float32Array(8);
- r18[0] = this.x, r18[1] = this.y, r18[2] = this.x + i8, r18[3] = this.y, r18[4] = this.x, r18[5] = this.y + o11, r18[6] = this.x + i8, r18[7] = this.y + o11;
- const a10 = o4(n(), this._rotationT, this._T);
- a2(r18, r18, a10);
- let c9 = 1 / 0, d2 = 1 / 0, f8 = 0, m7 = 0;
- for (let s10 = 0; s10 < 4; s10++) {
- const t9 = r18[2 * s10], e12 = r18[2 * s10 + 1];
- c9 = Math.min(c9, t9), d2 = Math.min(d2, e12), f8 = Math.max(f8, t9), m7 = Math.max(m7, e12);
- }
- const u9 = f8 - c9, g5 = m7 - d2, _4 = c9 + u9 / 2, p3 = d2 + g5 / 2;
- this._bounds = new i7(_4, p3, u9, g5);
- }
- return this._bounds;
- }
- setTransform(t8) {
- this._T = t8, this._offsets = null;
- }
- _setOffsets(t8) {
- this._offsets || (this._offsets = { upperLeft: 0, upperRight: 0, lowerLeft: 0, lowerRight: 0 });
- const e11 = this._offsets, i8 = new Float32Array(8), o11 = o4(n(), this._rotationT, this._T);
- a2(i8, t8, o11), e11.upperLeft = w2(i8[0] * x2, i8[1] * x2), e11.upperRight = w2(i8[2] * x2, i8[3] * x2), e11.lowerLeft = w2(i8[4] * x2, i8[5] * x2), e11.lowerRight = w2(i8[6] * x2, i8[7] * x2);
- }
- _setTextureCoords({ x: t8, y: s10, width: e11, height: i8 }) {
- this._texcoords = { upperLeft: w2(t8, s10), upperRight: w2(t8 + e11, s10), lowerLeft: w2(t8, s10 + i8), lowerRight: w2(t8 + e11, s10 + i8) };
- }
- };
- var M2 = (t8, s10) => ({ code: 0, page: 0, sdf: true, rect: new t5(0, 0, 11, 8), textureBinding: s10, metrics: { advance: 0, height: 4, width: t8, left: 0, top: 0 } });
- var T = class {
- constructor(t8, s10, e11) {
- this._rotation = 0, this._decorate(t8, s10, e11), this.glyphs = t8, this.bounds = this._createBounds(t8), this.isMultiline = s10.length > 1, this._hasRotation = e11.angle !== 0, this._T = this._createGlyphTransform(this.bounds, e11);
- for (const i8 of t8)
- i8.setTransform(this._T);
- }
- setRotation(e11) {
- if (e11 === 0 && this._rotation === 0)
- return;
- this._rotation = e11;
- const i8 = this._T, n17 = h(n(), e11);
- o4(i8, n17, i8);
- for (const t8 of this.glyphs)
- t8.setTransform(this._T);
- }
- _decorate(t8, s10, e11) {
- if (!e11.decoration || e11.decoration === "none" || !t8.length)
- return;
- const i8 = e11.scale, h6 = e11.decoration === "underline" ? g4 : _2, n17 = t8[0].textureBinding;
- for (const o11 of s10) {
- const s11 = o11.startX * i8, e12 = o11.startY * i8, r18 = (o11.width + o11.glyphWidthEnd) * i8;
- t8.push(new y4(s11, e12 + h6 * i8, M2(r18, n17), 1));
- }
- }
- get boundsT() {
- const t8 = this.bounds, s10 = r2(n2(), t8.x, t8.y);
- if (z(s10, s10, this._T), this._hasRotation) {
- const e11 = Math.max(t8.width, t8.height);
- return new i7(s10[0], s10[1], e11, e11);
- }
- return new i7(s10[0], s10[1], t8.width, t8.height);
- }
- _createBounds(t8) {
- let s10 = 1 / 0, e11 = 1 / 0, i8 = 0, h6 = 0;
- for (const r18 of t8)
- s10 = Math.min(s10, r18.xTopLeft), e11 = Math.min(e11, r18.yTopLeft), i8 = Math.max(i8, r18.xTopLeft + r18.width), h6 = Math.max(h6, r18.yBottomRight);
- const n17 = i8 - s10, o11 = h6 - e11;
- return new i7(s10 + n17 / 2, e11 + o11 / 2, n17, o11);
- }
- _createGlyphTransform(t8, s10) {
- const n17 = w3 * s10.angle, r18 = n(), c9 = n2();
- return i(r18, r18, r2(c9, s10.xOffset, -s10.yOffset)), s10.isCIM ? e5(r18, r18, n17) : (i(r18, r18, r2(c9, t8.x, t8.y)), e5(r18, r18, n17), i(r18, r18, r2(c9, -t8.x, -t8.y))), r18;
- }
- };
- var B2 = class {
- constructor(t8, s10, e11, i8, h6, n17) {
- this.glyphWidthEnd = 0, this.startX = 0, this.startY = 0, this.start = Math.max(0, Math.min(s10, e11)), this.end = Math.max(0, Math.max(s10, e11)), this.end < t8.length && (this.glyphWidthEnd = t8[this.end].metrics.width), this.width = i8, this.yMin = h6, this.yMax = n17;
- }
- };
- var R2 = (t8) => t8 === 10;
- var b2 = (t8) => t8 === 32;
- function L(t8, s10, e11) {
- const i8 = new Array(), h6 = 1 / e11.scale, n17 = e11.maxLineWidth * h6, o11 = s10 ? t8.length - 1 : 0, r18 = s10 ? -1 : t8.length, a10 = s10 ? -1 : 1;
- let c9 = o11, d2 = 0, f8 = 0, l9 = c9, m7 = l9, u9 = 0, g5 = 1 / 0, _4 = 0;
- for (; c9 !== r18; ) {
- const { code: s11, metrics: e12 } = t8[c9], h7 = Math.abs(e12.top);
- if (R2(s11) || b2(s11) || (g5 = Math.min(g5, h7), _4 = Math.max(_4, h7 + e12.height)), R2(s11))
- c9 !== o11 && (i8.push(new B2(t8, l9, c9 - a10, d2, g5, _4)), g5 = 1 / 0, _4 = 0), d2 = 0, l9 = c9 + a10, m7 = c9 + a10, f8 = 0;
- else if (b2(s11))
- m7 = c9 + a10, f8 = 0, u9 = e12.advance, d2 += e12.advance;
- else if (d2 > n17) {
- if (m7 !== l9) {
- const s12 = m7 - 2 * a10;
- d2 -= u9, i8.push(new B2(t8, l9, s12, d2 - f8, g5, _4)), g5 = 1 / 0, _4 = 0, l9 = m7, d2 = f8;
- } else
- i8.push(new B2(t8, l9, c9 - a10, d2, g5, _4)), g5 = 1 / 0, _4 = 0, l9 = c9, m7 = c9, d2 = 0;
- d2 += e12.advance, f8 += e12.advance;
- } else
- d2 += e12.advance, f8 += e12.advance;
- c9 += a10;
- }
- const p3 = new B2(t8, l9, c9 - a10, d2, g5, _4);
- return p3.start >= 0 && p3.end < t8.length && i8.push(p3), i8;
- }
- function v(t8, s10) {
- let e11 = 0;
- for (let n17 = 0; n17 < t8.length; n17++) {
- const { width: s11 } = t8[n17];
- e11 = Math.max(s11, e11);
- }
- const i8 = s10.decoration === "underline" ? u8 : 0, h6 = t8[0].yMin;
- return { x: 0, y: h6, height: t8[t8.length - 1].yMax + s10.lineHeight * (t8.length - 1) + i8 - h6, width: e11 };
- }
- function j3(t8, s10, e11) {
- const i8 = e11.scale, h6 = new Array(), n17 = L(t8, s10, e11), o11 = v(n17, e11), { vAlign: r18, hAlign: a10 } = e11, d2 = r18 === t3.Baseline ? 1 : 0, f8 = d2 ? 0 : r18 - 1, l9 = (1 - d2) * -o11.y + f8 * (o11.height / 2) + (d2 ? 1 : 0) * -m6;
- for (let c9 = 0; c9 < n17.length; c9++) {
- const { start: s11, end: o12, width: r19 } = n17[c9];
- let d3 = -1 * (a10 + 1) * (r19 / 2) - p2;
- const f9 = c9 * e11.lineHeight + l9 - p2;
- n17[c9].startX = d3, n17[c9].startY = f9;
- for (let e12 = s11; e12 <= o12; e12++) {
- const s12 = t8[e12];
- if (R2(s12.code))
- continue;
- const n18 = new y4(d3 + s12.metrics.left, f9 - s12.metrics.top, s12, i8);
- d3 += s12.metrics.advance, h6.push(n18);
- }
- }
- return new T(h6, n17, e11);
- }
- // node_modules/@arcgis/core/symbols/cim/CIMSymbolDrawHelper.js
- var I2 = Math.PI / 180;
- var v2 = 10;
- var L2 = s.getLogger("esri.symbols.cim.CIMSymbolDrawHelper");
- var z2 = class {
- constructor(t8) {
- this._t = t8;
- }
- static createIdentity() {
- return new z2([1, 0, 0, 0, 1, 0]);
- }
- clone() {
- const t8 = this._t;
- return new z2(t8.slice());
- }
- transform(t8) {
- const e11 = this._t;
- return [e11[0] * t8[0] + e11[1] * t8[1] + e11[2], e11[3] * t8[0] + e11[4] * t8[1] + e11[5]];
- }
- static createScale(t8, e11) {
- return new z2([t8, 0, 0, 0, e11, 0]);
- }
- scale(t8, e11) {
- const s10 = this._t;
- return s10[0] *= t8, s10[1] *= t8, s10[2] *= t8, s10[3] *= e11, s10[4] *= e11, s10[5] *= e11, this;
- }
- scaleRatio() {
- return Math.sqrt(this._t[0] * this._t[0] + this._t[1] * this._t[1]);
- }
- static createTranslate(t8, e11) {
- return new z2([0, 0, t8, 0, 0, e11]);
- }
- translate(t8, e11) {
- const s10 = this._t;
- return s10[2] += t8, s10[5] += e11, this;
- }
- static createRotate(t8) {
- const e11 = Math.cos(t8), s10 = Math.sin(t8);
- return new z2([e11, -s10, 0, s10, e11, 0]);
- }
- rotate(t8) {
- return z2.multiply(this, z2.createRotate(t8), this);
- }
- static multiply(t8, e11, s10) {
- const i8 = t8._t, r18 = e11._t, n17 = i8[0] * r18[0] + i8[3] * r18[1], o11 = i8[1] * r18[0] + i8[4] * r18[1], a10 = i8[2] * r18[0] + i8[5] * r18[1] + r18[2], h6 = i8[0] * r18[3] + i8[3] * r18[4], l9 = i8[1] * r18[3] + i8[4] * r18[4], c9 = i8[2] * r18[3] + i8[5] * r18[4] + r18[5], m7 = s10._t;
- return m7[0] = n17, m7[1] = o11, m7[2] = a10, m7[3] = h6, m7[4] = l9, m7[5] = c9, s10;
- }
- invert() {
- const t8 = this._t;
- let e11 = t8[0] * t8[4] - t8[1] * t8[3];
- if (e11 === 0)
- return new z2([0, 0, 0, 0, 0, 0]);
- e11 = 1 / e11;
- const s10 = (t8[1] * t8[5] - t8[2] * t8[4]) * e11, i8 = (t8[2] * t8[3] - t8[0] * t8[5]) * e11, r18 = t8[4] * e11, n17 = -t8[1] * e11, o11 = -t8[3] * e11, a10 = t8[0] * e11;
- return new z2([r18, n17, s10, o11, a10, i8]);
- }
- };
- var F = class {
- constructor(t8, e11) {
- this._transfos = [], this._sizeTransfos = [], this._geomUnitsPerPoint = 1, this._placementPool = new e(t6, null, null, 100), this._earlyReturn = false, this._mapRotation = 0, this._resourceManager = t8 || new s4(), this._transfos.push(e11 || z2.createIdentity()), this._sizeTransfos.push(e11 ? e11.scaleRatio() : 1);
- }
- setTransform(t8, e11) {
- this._transfos = [t8 || z2.createIdentity()], this._sizeTransfos = [e11 || (t8 ? t8.scaleRatio() : 1)];
- }
- setGeomUnitsPerPoint(t8) {
- this._geomUnitsPerPoint = t8;
- }
- transformPt(t8) {
- return this._transfos[this._transfos.length - 1].transform(t8);
- }
- transformSize(t8) {
- return t8 * this._sizeTransfos[this._sizeTransfos.length - 1];
- }
- reverseTransformPt(t8) {
- return this._transfos[this._transfos.length - 1].invert().transform(t8);
- }
- reverseTransformSize(t8) {
- return t8 / this._sizeTransfos[this._sizeTransfos.length - 1];
- }
- geomUnitsPerPoint() {
- return this.isEmbedded() ? 1 : this._geomUnitsPerPoint;
- }
- isEmbedded() {
- return this._transfos.length > 1;
- }
- back() {
- return this._transfos[this._transfos.length - 1];
- }
- push(t8, e11) {
- const s10 = e11 ? t8.scaleRatio() : 1;
- z2.multiply(t8, this.back(), t8), this._transfos.push(t8), this._sizeTransfos.push(this._sizeTransfos[this._sizeTransfos.length - 1] * s10);
- }
- pop() {
- this._transfos.splice(-1, 1), this._sizeTransfos.splice(-1, 1);
- }
- drawSymbol(t8, e11) {
- if (t8)
- switch (t8.type) {
- case "CIMPointSymbol":
- case "CIMLineSymbol":
- case "CIMPolygonSymbol":
- this.drawMultiLayerSymbol(t8, e11);
- break;
- case "CIMTextSymbol":
- this.drawTextSymbol(t8, e11);
- }
- }
- drawMultiLayerSymbol(t8, e11) {
- if (!t8)
- return;
- const s10 = t8.symbolLayers;
- if (!s10)
- return;
- const i8 = t8.effects;
- if (i8 && i8.length > 0) {
- const t9 = this.executeEffects(i8, e11);
- if (t9) {
- let e12 = t9.next();
- for (; e12; )
- this.drawSymbolLayers(s10, e12), e12 = t9.next();
- }
- } else
- this.drawSymbolLayers(s10, e11);
- }
- executeEffects(t8, e11) {
- const s10 = this._resourceManager.geometryEngine;
- let i8 = new r5(e11);
- for (const r18 of t8) {
- const t9 = A2(r18);
- t9 && (i8 = t9.execute(i8, r18, this.geomUnitsPerPoint(), s10));
- }
- return i8;
- }
- drawSymbolLayers(t8, e11) {
- let s10 = t8.length;
- for (; s10--; ) {
- const i8 = t8[s10];
- if (!i8 || i8.enable === false)
- continue;
- const r18 = i8.effects;
- if (r18 && r18.length > 0) {
- const t9 = this.executeEffects(r18, e11);
- if (t9) {
- let e12 = null;
- for (; (e12 = t9.next()) && (this.drawSymbolLayer(i8, e12), !this._earlyReturn); )
- ;
- }
- } else
- this.drawSymbolLayer(i8, e11);
- if (this._earlyReturn)
- return;
- }
- }
- drawSymbolLayer(t8, e11) {
- switch (t8.type) {
- case "CIMSolidFill":
- this.drawSolidFill(e11, t8.color);
- break;
- case "CIMHatchFill":
- this.drawHatchFill(e11, t8);
- break;
- case "CIMPictureFill":
- this.drawPictureFill(e11, t8);
- break;
- case "CIMGradientFill":
- this.drawGradientFill(e11, t8);
- break;
- case "CIMSolidStroke":
- this.drawSolidStroke(e11, t8.color, t8.width, t8.capStyle, t8.joinStyle, t8.miterLimit);
- break;
- case "CIMPictureStroke":
- this.drawPictureStroke(e11, t8);
- break;
- case "CIMGradientStroke":
- this.drawGradientStroke(e11, t8);
- break;
- case "CIMCharacterMarker":
- case "CIMPictureMarker":
- case "CIMVectorMarker":
- this.drawMarkerLayer(t8, e11);
- }
- }
- drawHatchFill(t8, e11) {
- const s10 = this._buildHatchPolyline(e11, t8, this.geomUnitsPerPoint());
- s10 && (this.pushClipPath(t8), this.drawMultiLayerSymbol(e11.lineSymbol, s10), this.popClipPath());
- }
- drawPictureFill(t8, e11) {
- }
- drawGradientFill(t8, e11) {
- }
- drawPictureStroke(t8, e11) {
- }
- drawGradientStroke(t8, e11) {
- }
- drawMarkerLayer(t8, e11) {
- const s10 = t8.markerPlacement;
- if (s10) {
- const i8 = g3(s10);
- if (i8) {
- const r18 = s10.type === "CIMMarkerPlacementInsidePolygon";
- r18 && this.pushClipPath(e11);
- const n17 = i8.execute(e11, s10, this.geomUnitsPerPoint(), this._resourceManager.geometryEngine);
- if (n17) {
- let e12 = null;
- for (; (e12 = n17.next()) && (this.drawMarker(t8, e12), !this._earlyReturn); )
- ;
- }
- r18 && this.popClipPath();
- }
- } else {
- const s11 = this._placementPool.acquire();
- if (l(e11))
- s11.tx = e11.x, s11.ty = e11.y, this.drawMarker(t8, s11);
- else if (c2(e11))
- [s11.tx, s11.ty] = e2(e11), this.drawMarker(t8, s11);
- else
- for (const i8 of e11.points)
- if (s11.tx = i8[0], s11.ty = i8[1], this.drawMarker(t8, s11), this._earlyReturn)
- break;
- this._placementPool.release(s11);
- }
- }
- drawMarker(t8, e11) {
- switch (t8.type) {
- case "CIMCharacterMarker":
- case "CIMPictureMarker":
- this.drawPictureMarker(t8, e11);
- break;
- case "CIMVectorMarker":
- this.drawVectorMarker(t8, e11);
- }
- }
- drawPictureMarker(t8, e11) {
- if (!t8)
- return;
- const i8 = this._resourceManager.getResource(t8.url), r18 = t8.size ?? 10;
- if (t(i8) || r18 <= 0)
- return;
- const n17 = i8.width, o11 = i8.height;
- if (!n17 || !o11)
- return;
- const a10 = n17 / o11, h6 = t8.scaleX ?? 1, l9 = z2.createIdentity(), c9 = t8.anchorPoint;
- if (c9) {
- let e12 = c9.x, s10 = c9.y;
- t8.anchorPointUnits !== "Absolute" && (e12 *= r18 * a10 * h6, s10 *= r18), l9.translate(-e12, -s10);
- }
- let m7 = t8.rotation ?? 0;
- t8.rotateClockwise && (m7 = -m7), this._mapRotation && (m7 += this._mapRotation), m7 && l9.rotate(m7 * I2);
- let f8 = t8.offsetX ?? 0, u9 = t8.offsetY ?? 0;
- if (f8 || u9) {
- if (this._mapRotation) {
- const t9 = I2 * this._mapRotation, e12 = Math.cos(t9), s10 = Math.sin(t9), i9 = f8 * s10 + u9 * e12;
- f8 = f8 * e12 - u9 * s10, u9 = i9;
- }
- l9.translate(f8, u9);
- }
- const _4 = this.geomUnitsPerPoint();
- _4 !== 1 && l9.scale(_4, _4);
- const d2 = e11.getAngle();
- d2 && l9.rotate(d2), l9.translate(e11.tx, e11.ty), this.push(l9, false), this.drawImage(t8.url, r18, t8.scaleX), this.pop();
- }
- drawVectorMarker(t8, e11) {
- if (!t8)
- return;
- const s10 = t8.markerGraphics;
- if (!s10)
- return;
- const i8 = t8.size ?? 10, r18 = t8.frame, n17 = r18 ? r18.ymax - r18.ymin : 0, o11 = i8 && n17 ? i8 / n17 : 1, a10 = z2.createIdentity();
- r18 && a10.translate(0.5 * -(r18.xmax + r18.xmin), 0.5 * -(r18.ymax + r18.ymin));
- const h6 = t8.anchorPoint;
- if (h6) {
- let e12 = h6.x, s11 = h6.y;
- t8.anchorPointUnits !== "Absolute" ? r18 && (e12 *= r18.xmax - r18.xmin, s11 *= r18.ymax - r18.ymin) : (e12 /= o11, s11 /= o11), a10.translate(-e12, -s11);
- }
- o11 !== 1 && a10.scale(o11, o11);
- let l9 = t8.rotation ?? 0;
- t8.rotateClockwise && (l9 = -l9), this._mapRotation && (l9 += this._mapRotation), l9 && a10.rotate(l9 * I2);
- let c9 = t8.offsetX ?? 0, m7 = t8.offsetY ?? 0;
- if (c9 || m7) {
- if (this._mapRotation) {
- const t9 = I2 * this._mapRotation, e12 = Math.cos(t9), s11 = Math.sin(t9), i9 = c9 * s11 + m7 * e12;
- c9 = c9 * e12 - m7 * s11, m7 = i9;
- }
- a10.translate(c9, m7);
- }
- const f8 = this.geomUnitsPerPoint();
- f8 !== 1 && a10.scale(f8, f8);
- const u9 = e11.getAngle();
- u9 && a10.rotate(u9), a10.translate(e11.tx, e11.ty), this.push(a10, t8.scaleSymbolsProportionally);
- for (const _4 of s10)
- if (_4 && _4.symbol && _4.geometry || L2.error("Invalid marker graphic", _4), this.drawSymbol(_4.symbol, _4.geometry), this._earlyReturn)
- break;
- this.pop();
- }
- drawTextSymbol(t8, e11) {
- if (!t8)
- return;
- if (!l(e11))
- return;
- if ((t8.height ?? 10) <= 0)
- return;
- const s10 = z2.createIdentity();
- let i8 = t8.angle ?? 0;
- i8 = -i8, i8 && s10.rotate(i8 * I2);
- const r18 = t8.offsetX ?? 0, n17 = t8.offsetY ?? 0;
- (r18 || n17) && s10.translate(r18, n17);
- const o11 = this.geomUnitsPerPoint();
- o11 !== 1 && s10.scale(o11, o11), s10.translate(e11.x, e11.y), this.push(s10, false), this.drawText(t8), this.pop();
- }
- _buildHatchPolyline(t8, e11, s10) {
- let i8 = (t8.separation !== void 0 ? t8.separation : 4) * s10, r18 = t8.rotation !== void 0 ? t8.rotation : 0;
- if (i8 === 0)
- return null;
- i8 < 0 && (i8 = -i8);
- let n17 = 0;
- const a10 = 0.5 * i8;
- for (; n17 > a10; )
- n17 -= i8;
- for (; n17 < -a10; )
- n17 += i8;
- const l9 = u2();
- c(l9, e11), l9[0] -= a10, l9[1] -= a10, l9[2] += a10, l9[3] += a10;
- const c9 = [[l9[0], l9[1]], [l9[0], l9[3]], [l9[2], l9[3]], [l9[2], l9[1]]];
- for (; r18 > 180; )
- r18 -= 180;
- for (; r18 < 0; )
- r18 += 180;
- const m7 = Math.cos(r18 * I2), f8 = Math.sin(r18 * I2), u9 = -i8 * f8, _4 = i8 * m7;
- let d2, p3, y5, g5;
- n17 = (t8.offsetX !== void 0 ? t8.offsetX * s10 : 0) * f8 - (t8.offsetY !== void 0 ? t8.offsetY * s10 : 0) * m7, d2 = y5 = Number.MAX_VALUE, p3 = g5 = -Number.MAX_VALUE;
- for (const o11 of c9) {
- const t9 = o11[0], e12 = o11[1], s11 = m7 * t9 + f8 * e12, i9 = -f8 * t9 + m7 * e12;
- d2 = Math.min(d2, s11), y5 = Math.min(y5, i9), p3 = Math.max(p3, s11), g5 = Math.max(g5, i9);
- }
- y5 = Math.floor(y5 / i8) * i8;
- let P3 = m7 * d2 - f8 * y5 - u9 * n17 / i8, x3 = f8 * d2 + m7 * y5 - _4 * n17 / i8, w4 = m7 * p3 - f8 * y5 - u9 * n17 / i8, M3 = f8 * p3 + m7 * y5 - _4 * n17 / i8;
- const b3 = 1 + Math.round((g5 - y5) / i8), S = [];
- for (let o11 = 0; o11 < b3; o11++)
- P3 += u9, x3 += _4, w4 += u9, M3 += _4, S.push([[P3, x3], [w4, M3]]);
- return { paths: S };
- }
- };
- var U4 = class extends F {
- constructor(t8, e11) {
- super(t8, e11), this.reset();
- }
- reset() {
- this._xmin = this._ymin = 1 / 0, this._xmax = this._ymax = -1 / 0, this._clipCount = 0;
- }
- envelope() {
- return new t7(this._xmin, this._ymin, this._xmax - this._xmin, this._ymax - this._ymin);
- }
- bounds() {
- return o2(this._xmin, this._ymin, this._xmax, this._ymax);
- }
- drawSolidFill(t8) {
- if (t8 && !(this._clipCount > 0))
- if (c2(t8))
- this._processPath(t8.rings, 0);
- else if (y(t8))
- this._processPath(t8.paths, 0);
- else if (s3(t8)) {
- const e11 = G2(t8);
- e11 && this._processPath(e11.rings, 0);
- } else
- console.error("drawSolidFill Unexpected geometry type!");
- }
- drawSolidStroke(t8, e11, s10) {
- if (!t8 || this._clipCount > 0)
- return;
- const i8 = 0.5 * this.transformSize(s10);
- if (c2(t8))
- this._processPath(t8.rings, i8);
- else if (y(t8))
- this._processPath(t8.paths, i8);
- else if (s3(t8)) {
- const e12 = G2(t8);
- e12 && this._processPath(e12.rings, i8);
- } else
- console.error("drawSolidStroke unexpected geometry type!");
- }
- pushClipPath(t8) {
- this.drawSolidFill(t8), ++this._clipCount;
- }
- popClipPath() {
- --this._clipCount;
- }
- drawImage(t8, e11, s10) {
- let r18 = s10 * e11, n17 = e11;
- const o11 = this._resourceManager.getResource(t8);
- !e11 && r(o11) && (r18 = s10 * o11.width, n17 = o11.height), this._merge(this.transformPt([-r18 / 2, -n17 / 2]), 0), this._merge(this.transformPt([-r18 / 2, n17 / 2]), 0), this._merge(this.transformPt([r18 / 2, -n17 / 2]), 0), this._merge(this.transformPt([r18 / 2, n17 / 2]), 0);
- }
- drawText(t8) {
- this._textRasterizer || (this._textRasterizer = new s5());
- }
- _processPath(t8, e11) {
- if (t8)
- for (const s10 of t8) {
- const t9 = s10 ? s10.length : 0;
- if (t9 > 1) {
- this._merge(this.transformPt(s10[0]), e11);
- for (let i8 = 1; i8 < t9; ++i8)
- this._merge(this.transformPt(s10[i8]), e11);
- }
- }
- }
- _merge(t8, e11) {
- t8[0] - e11 < this._xmin && (this._xmin = t8[0] - e11), t8[0] + e11 > this._xmax && (this._xmax = t8[0] + e11), t8[1] - e11 < this._ymin && (this._ymin = t8[1] - e11), t8[1] + e11 > this._ymax && (this._ymax = t8[1] + e11);
- }
- };
- var j4 = class extends F {
- constructor() {
- super(...arguments), this._searchPoint = [0, 0], this._searchDistPoint = 0;
- }
- hitTest(t8, e11, s10, i8, r18, o11) {
- const a10 = o11 * u(1);
- this.setTransform(), this.setGeomUnitsPerPoint(a10), this._searchPoint = [(t8[0] + t8[2]) / 2, (t8[1] + t8[3]) / 2], this._searchDistPoint = (t8[2] - t8[0]) / 2 / a10, this._textInfo = i8;
- const h6 = e11 && (e11.type === "CIMPointSymbol" && e11.angleAlignment !== "Map" || e11.type === "CIMTextSymbol");
- return this._mapRotation = h6 ? r18 : 0, this._earlyReturn = false, this.drawSymbol(e11, s10), this._earlyReturn;
- }
- drawSolidFill(t8, e11) {
- this._hitTestFill(t8);
- }
- drawHatchFill(t8, e11) {
- this._hitTestFill(t8);
- }
- drawPictureFill(t8, e11) {
- this._hitTestFill(t8);
- }
- drawGradientFill(t8, e11) {
- this._hitTestFill(t8);
- }
- drawSolidStroke(t8, e11, s10, i8, r18, n17) {
- this._hitTestStroke(t8, s10);
- }
- drawPictureStroke(t8, e11) {
- this._hitTestStroke(t8, e11.width);
- }
- drawGradientStroke(t8, e11) {
- this._hitTestStroke(t8, e11.width);
- }
- drawMarkerLayer(t8, e11) {
- t8.markerPlacement && t8.markerPlacement.type === "CIMMarkerPlacementInsidePolygon" ? this._hitTestFill(e11) : super.drawMarkerLayer(t8, e11);
- }
- pushClipPath(t8) {
- }
- popClipPath() {
- }
- drawImage(t8, e11, i8) {
- const r18 = this._resourceManager.getResource(t8);
- if (t(r18) || r18.height === 0 || e11 === 0)
- return;
- const n17 = e11 * this.geomUnitsPerPoint(), o11 = n17 * i8 * (r18.width / r18.height), a10 = this.reverseTransformPt(this._searchPoint), h6 = this._searchDistPoint;
- Math.abs(a10[0]) < o11 / 2 + h6 && Math.abs(a10[1]) < n17 / 2 + h6 && (this._earlyReturn = true);
- }
- drawText(e11) {
- const s10 = this._textInfo;
- if (!s10)
- return;
- const i8 = s10.get(e11);
- if (!i8)
- return;
- const { text: r18, mosaicItem: n17 } = i8;
- if (!n17 || n17.glyphMosaicItems.length === 0)
- return;
- const o11 = e11.height ?? v2, a10 = B3(e11.lineGapType, e11.lineGap ?? 0, o11), h6 = n4(r18)[1], l9 = n17.glyphMosaicItems, c9 = j3(l9, h6, { scale: o11 / j, angle: 0, xOffset: 0, yOffset: 0, hAlign: E(e11.horizontalAlignment), vAlign: H(e11.verticalAlignment), maxLineWidth: 512, lineHeight: f2 * Math.max(0.25, Math.min(a10 || 1, 4)), decoration: e11.font.decoration || "none", isCIM: true }), m7 = this.reverseTransformPt(this._searchPoint), f8 = m7[0], u9 = m7[1];
- for (const t8 of c9.glyphs)
- if (f8 > t8.xTopLeft && f8 < t8.xBottomRight && u9 > -t8.yBottomRight && u9 < -t8.yTopLeft) {
- this._earlyReturn = true;
- break;
- }
- }
- _hitTestFill(t8) {
- let e11 = null;
- if (s3(t8)) {
- const s11 = t8;
- e11 = [[[s11.xmin, s11.ymin], [s11.xmin, s11.ymax], [s11.xmax, s11.ymax], [s11.xmax, s11.ymin], [s11.xmin, s11.ymin]]];
- } else if (c2(t8))
- e11 = t8.rings;
- else {
- if (!y(t8))
- return;
- e11 = t8.paths;
- }
- const s10 = this.reverseTransformPt(this._searchPoint);
- if (this._pointInPolygon(s10, e11) && (this._earlyReturn = true), !this._earlyReturn) {
- const t9 = this.reverseTransformSize(this._searchDistPoint) * this.geomUnitsPerPoint();
- this._nearLine(s10, e11, t9) && (this._earlyReturn = true);
- }
- }
- _hitTestStroke(t8, e11) {
- let s10 = null;
- if (s3(t8)) {
- const e12 = t8;
- s10 = [[[e12.xmin, e12.ymin], [e12.xmin, e12.ymax], [e12.xmax, e12.ymax], [e12.xmax, e12.ymin], [e12.xmin, e12.ymin]]];
- } else if (c2(t8))
- s10 = t8.rings;
- else {
- if (!y(t8))
- return;
- s10 = t8.paths;
- }
- const i8 = this.reverseTransformPt(this._searchPoint), r18 = e11 * this.geomUnitsPerPoint(), n17 = this.reverseTransformSize(this._searchDistPoint) * this.geomUnitsPerPoint();
- this._nearLine(i8, s10, r18 / 2 + n17) && (this._earlyReturn = true);
- }
- _pointInPolygon(t8, e11) {
- let s10 = 0;
- for (const i8 of e11) {
- const e12 = i8.length;
- for (let r18 = 1; r18 < e12; ++r18) {
- const e13 = i8[r18 - 1], n17 = i8[r18];
- if (e13[1] > t8[1] == n17[1] > t8[1])
- continue;
- (n17[0] - e13[0]) * (t8[1] - e13[1]) - (n17[1] - e13[1]) * (t8[0] - e13[0]) > 0 ? s10++ : s10--;
- }
- }
- return s10 !== 0;
- }
- _nearLine(t8, e11, s10) {
- for (const i8 of e11) {
- const e12 = i8.length;
- for (let r18 = 1; r18 < e12; ++r18) {
- const e13 = i8[r18 - 1], n17 = i8[r18];
- let o11 = (n17[0] - e13[0]) * (n17[0] - e13[0]) + (n17[1] - e13[1]) * (n17[1] - e13[1]);
- if (o11 === 0)
- continue;
- o11 = Math.sqrt(o11);
- const a10 = ((n17[0] - e13[0]) * (t8[1] - e13[1]) - (n17[1] - e13[1]) * (t8[0] - e13[0])) / o11;
- if (Math.abs(a10) < s10) {
- const i9 = ((n17[0] - e13[0]) * (t8[0] - e13[0]) + (n17[1] - e13[1]) * (t8[1] - e13[1])) / o11;
- if (i9 > -s10 && i9 < o11 + s10)
- return true;
- }
- }
- }
- return false;
- }
- };
- var A3 = class extends F {
- constructor(t8, e11, s10) {
- super(e11, s10), this._ctx = t8;
- }
- drawSolidFill(t8, e11) {
- if (!t8)
- return;
- if (c2(t8))
- this._buildPath(t8.rings, true);
- else if (y(t8))
- this._buildPath(t8.paths, true);
- else if (s3(t8))
- this._buildPath(G2(t8).rings, true);
- else {
- if (!f(t8))
- return;
- console.log("CanvasDrawHelper.drawSolidFill - No implementation!");
- }
- const s10 = this._ctx;
- s10.fillStyle = typeof e11 == "string" ? e11 : "rgba(" + Math.round(e11[0]) + "," + Math.round(e11[1]) + "," + Math.round(e11[2]) + "," + e11[3] / 255 + ")", s10.fill("evenodd");
- }
- drawSolidStroke(t8, e11, s10, i8, r18, n17) {
- if (!t8 || !e11 || s10 === 0)
- return;
- if (c2(t8))
- this._buildPath(t8.rings, true);
- else if (y(t8))
- this._buildPath(t8.paths, false);
- else {
- if (!s3(t8))
- return void console.log("CanvasDrawHelper.drawSolidStroke isn't implemented!");
- this._buildPath(G2(t8).rings, true);
- }
- const o11 = this._ctx;
- o11.strokeStyle = typeof e11 == "string" ? e11 : "rgba(" + Math.round(e11[0]) + "," + Math.round(e11[1]) + "," + Math.round(e11[2]) + "," + e11[3] / 255 + ")", o11.lineWidth = this.transformSize(s10) + 0.5, this._setCapStyle(i8), this._setJoinStyle(r18), o11.miterLimit = n17, o11.stroke();
- }
- pushClipPath(t8) {
- if (this._ctx.save(), c2(t8))
- this._buildPath(t8.rings, true);
- else if (y(t8))
- this._buildPath(t8.paths, true);
- else {
- if (!s3(t8))
- return;
- this._buildPath(G2(t8).rings, true);
- }
- this._ctx.clip("evenodd");
- }
- popClipPath() {
- this._ctx.restore();
- }
- drawImage(t8, e11, i8) {
- const r18 = this._resourceManager.getResource(t8);
- if (t(r18))
- return;
- const n17 = this._ctx, o11 = n17.canvas.width, a10 = n17.canvas.height;
- let h6 = e11 * i8 * (r18.width / r18.height), l9 = i8 * e11;
- e11 || (h6 = i8 * r18.width, l9 = i8 * r18.height);
- const c9 = this.transformPt([0, 0]), m7 = this.transformSize(h6), f8 = this.transformSize(l9);
- this._ctx.drawImage(r18, 0, 0, r18.width, r18.height, c9[0] - m7 / 2, c9[1] - f8 / 2, Math.min(m7, o11), Math.min(f8, a10));
- }
- drawText(t8) {
- this._textRasterizer || (this._textRasterizer = new s5());
- }
- _buildPath(t8, e11) {
- const s10 = this._ctx;
- if (s10.beginPath(), t8)
- for (const i8 of t8) {
- const t9 = i8 ? i8.length : 0;
- if (t9 > 1) {
- let r18 = this.transformPt(i8[0]);
- s10.moveTo(r18[0], r18[1]);
- for (let e12 = 1; e12 < t9; ++e12)
- r18 = this.transformPt(i8[e12]), s10.lineTo(r18[0], r18[1]);
- e11 && s10.closePath();
- }
- }
- }
- _setCapStyle(t8) {
- switch (t8) {
- case U2.Butt:
- this._ctx.lineCap = "butt";
- break;
- case U2.Round:
- this._ctx.lineCap = "round";
- break;
- case U2.Square:
- this._ctx.lineCap = "square";
- }
- }
- _setJoinStyle(t8) {
- switch (t8) {
- case w.Bevel:
- this._ctx.lineJoin = "bevel";
- break;
- case w.Round:
- this._ctx.lineJoin = "round";
- break;
- case w.Miter:
- this._ctx.lineJoin = "miter";
- }
- }
- };
- var G2 = (t8) => t8 ? { spatialReference: t8.spatialReference, rings: [[[t8.xmin, t8.ymin], [t8.xmin, t8.ymax], [t8.xmax, t8.ymax], [t8.xmax, t8.ymin], [t8.xmin, t8.ymin]]] } : null;
- var E = (t8) => {
- switch (t8) {
- case "Left":
- return e4.Left;
- case "Right":
- return e4.Right;
- case "Center":
- return e4.Center;
- case "Justify":
- return L2.warnOnce("Horizontal alignment 'justify' is not implemented. Falling back to 'center'."), e4.Center;
- }
- };
- var H = (t8) => {
- switch (t8) {
- case "Top":
- return t3.Top;
- case "Center":
- return t3.Center;
- case "Bottom":
- return t3.Bottom;
- case "Baseline":
- return t3.Baseline;
- }
- };
- var B3 = (t8, e11, s10) => {
- switch (t8) {
- case "ExtraLeading":
- return 1 + e11 / s10;
- case "Multiple":
- return e11;
- case "Exact":
- return e11 / s10;
- }
- };
- // node_modules/@arcgis/core/symbols/cim/CIMSymbolHelper.js
- var V = Math.PI;
- var B4 = V / 2;
- var X2 = 4;
- var U5 = 10;
- var _3 = 96 / 72;
- var H2 = Math.PI / 180;
- var Y2 = s.getLogger("esri.symbols.cim.CIMSymbolHelper");
- function q(e11) {
- if (!e11 || !e11.type)
- return null;
- let t8;
- switch (e11.type) {
- case "cim":
- return e11.data;
- case "web-style":
- return e11;
- case "simple-marker":
- t8 = Z2.fromSimpleMarker(e11);
- break;
- case "picture-marker":
- t8 = Z2.fromPictureMarker(e11);
- break;
- case "simple-line":
- t8 = Z2.fromSimpleLineSymbol(e11);
- break;
- case "simple-fill":
- t8 = Z2.fromSimpleFillSymbol(e11);
- break;
- case "picture-fill":
- t8 = Z2.fromPictureFillSymbol(e11);
- break;
- case "text":
- t8 = Z2.fromTextSymbol(e11);
- }
- return { type: "CIMSymbolReference", symbol: t8 };
- }
- function W(e11, t8) {
- switch (t8.type) {
- case "CIMSymbolReference":
- return W(e11, t8.symbol);
- case "CIMPointSymbol": {
- const r18 = { x: 0, y: 0 };
- e11.drawSymbol(t8, r18);
- break;
- }
- case "CIMLineSymbol": {
- const r18 = { paths: [[[0, 0], [0, 1]]] };
- e11.drawSymbol(t8, r18);
- break;
- }
- case "CIMPolygonSymbol": {
- const r18 = { rings: [[[0, 0], [0, 1], [0, 0]]] };
- e11.drawSymbol(t8, r18);
- break;
- }
- case "CIMTextSymbol": {
- const r18 = { x: 0, y: 0 };
- e11.drawSymbol(t8, r18);
- break;
- }
- case "CIMVectorMarker": {
- const r18 = new t6();
- e11.drawMarker(t8, r18);
- break;
- }
- }
- return e11.envelope();
- }
- function $(e11) {
- if (!e11)
- return 0;
- switch (e11.type) {
- case "CIMMarkerPlacementAlongLineSameSize":
- case "CIMMarkerPlacementAlongLineRandomSize":
- case "CIMMarkerPlacementAtExtremities":
- case "CIMMarkerPlacementAtMeasuredUnits":
- case "CIMMarkerPlacementAtRatioPositions":
- case "CIMMarkerPlacementOnLine":
- case "CIMMarkerPlacementOnVertices":
- return Math.abs(e11.offset);
- default:
- return 0;
- }
- }
- function J(e11) {
- if (!e11)
- return 0;
- switch (e11.type) {
- case "CIMGeometricEffectArrow":
- return Math.abs(0.5 * e11.width);
- case "CIMGeometricEffectBuffer":
- return Math.abs(e11.size);
- case "CIMGeometricEffectExtension":
- case "CIMGeometricEffectRadial":
- return Math.abs(e11.length);
- case "CIMGeometricEffectJog":
- return Math.abs(0.5 * e11.length);
- case "CIMGeometricEffectMove":
- return Math.max(Math.abs(M(e11.offsetX)), Math.abs(M(e11.offsetY)));
- case "CIMGeometricEffectOffset":
- case "CIMGeometricEffectOffsetTangent":
- return Math.abs(e11.offset);
- case "CIMGeometricEffectRegularPolygon":
- return Math.abs(e11.radius);
- case "CIMGeometricEffectRotate":
- case "CIMGeometricEffectScale":
- default:
- return 0;
- case "CIMGeometricEffectTaperedPolygon":
- return 0.5 * Math.max(Math.abs(e11.fromWidth), Math.abs(e11.toWidth));
- case "CIMGeometricEffectWave":
- return Math.abs(e11.amplitude);
- }
- }
- function K2(e11) {
- if (!e11)
- return 0;
- let t8 = 0;
- for (const r18 of e11)
- t8 += J(r18);
- return t8;
- }
- var Q = class {
- getSymbolInflateSize(e11, t8, r18, o11, a10) {
- return e11 || (e11 = [0, 0, 0, 0]), t8 ? this._getInflateSize(e11, t8, r18, o11, a10) : e11;
- }
- static safeSize(e11) {
- const t8 = Math.max(Math.abs(e11[0]), Math.abs(e11[2])), r18 = Math.max(Math.abs(e11[1]), Math.abs(e11[3]));
- return Math.sqrt(t8 * t8 + r18 * r18);
- }
- _vectorMarkerBounds(e11, t8, r18, o11) {
- let a10 = true;
- const i8 = u2();
- if (t8 && t8.markerGraphics)
- for (const s10 of t8.markerGraphics) {
- const t9 = [0, 0, 0, 0];
- s10.geometry && (c(i8, s10.geometry), t9[0] = 0, t9[1] = 0, t9[2] = 0, t9[3] = 0, this.getSymbolInflateSize(t9, s10.symbol, r18, 0, o11), i8[0] += t9[0], i8[1] += t9[1], i8[2] += t9[2], i8[3] += t9[3], a10 ? (e11[0] = i8[0], e11[1] = i8[1], e11[2] = i8[2], e11[3] = i8[3], a10 = false) : (e11[0] = Math.min(e11[0], i8[0]), e11[1] = Math.min(e11[1], i8[1]), e11[2] = Math.max(e11[2], i8[2]), e11[3] = Math.max(e11[3], i8[3])));
- }
- return e11;
- }
- _getInflateSize(e11, t8, r18, o11, a10) {
- if (fe(t8)) {
- const i8 = this._getLayersInflateSize(e11, t8.symbolLayers, r18, o11, a10), s10 = K2(t8.effects);
- return s10 > 0 && (i8[0] -= s10, i8[1] -= s10, i8[2] += s10, i8[3] += s10), i8;
- }
- return this._getTextInflatedSize(e11, t8, a10);
- }
- _getLayersInflateSize(e11, t8, r18, o11, a10) {
- let i8 = true;
- if (!t8)
- return e11;
- for (const n17 of t8) {
- if (!n17)
- continue;
- let t9 = [0, 0, 0, 0];
- switch (n17.type) {
- case "CIMSolidFill":
- case "CIMPictureFill":
- case "CIMHatchFill":
- case "CIMGradientFill":
- break;
- case "CIMSolidStroke":
- case "CIMPictureStroke":
- case "CIMGradientStroke": {
- const e12 = n17;
- let r19 = e12.width;
- e12.capStyle === U2.Square || e12.joinStyle === w.Miter ? r19 /= 1.4142135623730951 : r19 /= 2, t9[0] = -r19, t9[1] = -r19, t9[2] = r19, t9[3] = r19;
- break;
- }
- case "CIMCharacterMarker":
- case "CIMVectorMarker":
- case "CIMPictureMarker": {
- const e12 = n17;
- if (n17.type === "CIMVectorMarker") {
- const e13 = n17;
- if (t9 = this._vectorMarkerBounds(t9, e13, r18, a10), e13.frame) {
- const r19 = (e13.frame.xmin + e13.frame.xmax) / 2, o12 = (e13.frame.ymin + e13.frame.ymax) / 2;
- t9[0] -= r19, t9[1] -= o12, t9[2] -= r19, t9[3] -= o12;
- const a11 = e13.size / (e13.frame.ymax - e13.frame.ymin);
- t9[0] *= a11, t9[1] *= a11, t9[2] *= a11, t9[3] *= a11;
- }
- } else if (n17.type === "CIMPictureMarker") {
- const o12 = n17, a11 = r18.getResource(o12.url);
- let i10 = 1;
- r(a11) && a11.height && (i10 = a11.width / a11.height);
- const l11 = e12.size / 2, c10 = e12.size * i10 * o12.scaleX / 2;
- t9 = [-c10, -l11, c10, l11];
- } else {
- const r19 = e12.size / 2;
- t9 = [-r19, -r19, r19, r19];
- }
- if (e12.anchorPoint) {
- let r19, o12;
- e12.anchorPointUnits === "Absolute" ? (r19 = e12.anchorPoint.x, o12 = e12.anchorPoint.y) : (r19 = e12.anchorPoint.x * (t9[2] - t9[0]), o12 = e12.anchorPoint.y * (t9[3] - t9[1])), t9[0] -= r19, t9[1] -= o12, t9[2] -= r19, t9[3] -= o12;
- }
- let i9 = M(e12.rotation);
- if (e12.rotateClockwise && (i9 = -i9), o11 && (i9 -= o11), i9) {
- const e13 = H2 * i9, r19 = Math.cos(e13), o12 = Math.sin(e13), a11 = u2([n3, n3, -n3, -n3]);
- m2(a11, [t9[0] * r19 - t9[1] * o12, t9[0] * o12 + t9[1] * r19]), m2(a11, [t9[0] * r19 - t9[3] * o12, t9[0] * o12 + t9[3] * r19]), m2(a11, [t9[2] * r19 - t9[1] * o12, t9[2] * o12 + t9[1] * r19]), m2(a11, [t9[2] * r19 - t9[3] * o12, t9[2] * o12 + t9[3] * r19]), t9 = a11;
- }
- let l10 = M(e12.offsetX), c9 = M(e12.offsetY);
- if (o11) {
- const e13 = H2 * o11, t10 = Math.cos(e13), r19 = Math.sin(e13), a11 = l10 * r19 + c9 * t10;
- l10 = l10 * t10 - c9 * r19, c9 = a11;
- }
- t9[0] += l10, t9[1] += c9, t9[2] += l10, t9[3] += c9;
- const m7 = $(e12.markerPlacement);
- m7 > 0 && (t9[0] -= m7, t9[1] -= m7, t9[2] += m7, t9[3] += m7);
- break;
- }
- }
- const l9 = K2(n17.effects);
- l9 > 0 && (t9[0] -= l9, t9[1] -= l9, t9[2] += l9, t9[3] += l9), i8 ? (e11[0] = t9[0], e11[1] = t9[1], e11[2] = t9[2], e11[3] = t9[3], i8 = false) : (e11[0] = Math.min(e11[0], t9[0]), e11[1] = Math.min(e11[1], t9[1]), e11[2] = Math.max(e11[2], t9[2]), e11[3] = Math.max(e11[3], t9[3]));
- }
- return e11;
- }
- _getTextInflatedSize(e11, r18, o11) {
- const a10 = r18.height ?? U5;
- if (e11[0] = -a10 / 2, e11[1] = -a10 / 2, e11[2] = a10 / 2, e11[3] = a10 / 2, !o11)
- return e11;
- const i8 = o11.get(r18);
- if (!i8)
- return e11;
- const { text: s10, mosaicItem: n17 } = i8;
- if (!n17 || n17.glyphMosaicItems.length === 0)
- return e11;
- const l9 = B3(r18.lineGapType, r18.lineGap ?? 0, a10), c9 = n4(s10)[1], m7 = n17.glyphMosaicItems, f8 = j3(m7, c9, { scale: a10 / j, angle: M(r18.angle), xOffset: M(r18.offsetX), yOffset: M(r18.offsetY), hAlign: E(r18.horizontalAlignment), vAlign: H(r18.verticalAlignment), maxLineWidth: 512, lineHeight: f2 * Math.max(0.25, Math.min(l9 || 1, 4)), decoration: r18.font.decoration || "none", isCIM: true }).boundsT;
- return e11[0] = f8.x - f8.halfWidth, e11[1] = -f8.y - f8.halfHeight, e11[2] = f8.x + f8.halfWidth, e11[3] = -f8.y + f8.halfHeight, e11;
- }
- };
- var Z2 = class {
- static getEnvelope(e11, t8) {
- const r18 = new U4(t8);
- if (Array.isArray(e11)) {
- let t9;
- for (const o11 of e11)
- t9 ? t9.union(W(r18, o11)) : t9 = W(r18, o11);
- return t9;
- }
- return W(r18, e11);
- }
- static getTextureAnchor(e11, t8) {
- const r18 = this.getEnvelope(e11, t8);
- if (!r18)
- return [0, 0, 0];
- const o11 = (r18.x + 0.5 * r18.width) * _3, a10 = -(r18.y + 0.5 * r18.height) * _3, i8 = r18.width * _3 + 2, s10 = r18.height * _3 + 2;
- return [o11 / i8, a10 / s10, s10];
- }
- static rasterize(e11, t8, r18, o11, a10 = true) {
- const i8 = r18 || this.getEnvelope(t8, o11);
- if (!i8)
- return [null, 0, 0, 0, 0];
- const s10 = (i8.x + 0.5 * i8.width) * _3, n17 = (i8.y + 0.5 * i8.height) * _3;
- e11.width = i8.width * _3, e11.height = i8.height * _3, r18 || (e11.width += 2, e11.height += 2);
- const l9 = e11.getContext("2d"), c9 = z2.createScale(_3, -_3);
- c9.translate(0.5 * e11.width - s10, 0.5 * e11.height + n17);
- const m7 = new A3(l9, o11, c9);
- switch (t8.type) {
- case "CIMPointSymbol": {
- const e12 = { type: "point", x: 0, y: 0 };
- m7.drawSymbol(t8, e12);
- break;
- }
- case "CIMVectorMarker": {
- const e12 = new t6();
- m7.drawMarker(t8, e12);
- break;
- }
- }
- const f8 = l9.getImageData(0, 0, e11.width, e11.height), y5 = new Uint8Array(f8.data);
- if (a10) {
- let e12;
- for (let t9 = 0; t9 < y5.length; t9 += 4)
- e12 = y5[t9 + 3] / 255, y5[t9] = y5[t9] * e12, y5[t9 + 1] = y5[t9 + 1] * e12, y5[t9 + 2] = y5[t9 + 2] * e12;
- }
- return [y5, e11.width, e11.height, -s10 / e11.width, -n17 / e11.height];
- }
- static fromTextSymbol(e11) {
- const { angle: r18, color: o11, font: a10, haloColor: i8, haloSize: s10, horizontalAlignment: n17, kerning: l9, text: c9, verticalAlignment: m7, xoffset: f8, yoffset: y5 } = e11;
- let h6, M3, p3, u9, S;
- a10 && (h6 = a10.family, M3 = a10.style, p3 = a10.weight, u9 = a10.size, S = a10.decoration);
- let d2 = false;
- if (c9) {
- d2 = n4(c9)[1];
- }
- return { type: "CIMPointSymbol", symbolLayers: [{ type: "CIMVectorMarker", enable: true, anchorPointUnits: "Relative", dominantSizeAxis3D: "Y", size: 10, billboardMode3D: "FaceNearPlane", frame: { xmin: -5, ymin: -5, xmax: 5, ymax: 5 }, markerGraphics: [{ type: "CIMMarkerGraphic", geometry: { x: 0, y: 0 }, symbol: { type: "CIMTextSymbol", angle: r18, blockProgression: C2.BTT, depth3D: 1, extrapolateBaselines: true, fontEffects: l3.Normal, fontEncoding: a.Unicode, fontFamilyName: h6 || "Arial", fontStyleName: ne2(M3, p3), fontType: u3.Unspecified, haloSize: s10, height: u9, hinting: y2.Default, horizontalAlignment: ae(n17 ?? "center"), kerning: l9, letterWidth: 100, ligatures: true, lineGapType: "Multiple", offsetX: M(f8), offsetY: M(y5), strikethrough: S === "line-through", underline: S === "underline", symbol: { type: "CIMPolygonSymbol", symbolLayers: [{ type: "CIMSolidFill", enable: true, color: se(o11) }] }, haloSymbol: { type: "CIMPolygonSymbol", symbolLayers: [{ type: "CIMSolidFill", enable: true, color: se(i8) }] }, shadowColor: [0, 0, 0, 255], shadowOffsetX: 1, shadowOffsetY: 1, textCase: "Normal", textDirection: d2 ? ne.RTL : ne.LTR, verticalAlignment: ie2(m7 ?? "baseline"), verticalGlyphOrientation: oe.Right, wordSpacing: 100, billboardMode3D: m3.FaceNearPlane }, textString: c9 }], scaleSymbolsProportionally: true, respectFrame: true }], scaleX: 1, angleAlignment: "Display" };
- }
- static fromPictureFillSymbol(e11) {
- const { height: t8, outline: r18, width: o11, xoffset: a10, xscale: i8, yoffset: s10, yscale: n17 } = e11, l9 = [], c9 = { type: "CIMPolygonSymbol", symbolLayers: l9 };
- if (r18) {
- const { cap: e12, join: t9, miterLimit: o12, width: a11 } = r18;
- l9.push({ type: "CIMSolidStroke", color: se(r18.color), capStyle: re(e12), joinStyle: oe2(t9), miterLimit: o12, width: a11 });
- }
- let m7 = e11.url;
- e11.type === "esriPFS" && e11.imageData && (m7 = e11.imageData);
- const f8 = "angle" in e11 ? e11.angle : 0, y5 = o11 * (i8 || 1), h6 = t8 * (n17 || 1);
- return l9.push({ type: "CIMPictureFill", invertBackfaceTexture: false, scaleX: 1, textureFilter: ie.Picture, tintColor: null, url: m7, height: h6, width: y5, offsetX: M(a10), offsetY: M(s10), rotation: M(-f8), colorSubstitutions: null }), c9;
- }
- static fromSimpleFillSymbol(e11) {
- const { color: t8, style: r18, outline: a10 } = e11, s10 = [], n17 = { type: "CIMPolygonSymbol", symbolLayers: s10 };
- let l9 = null;
- if (a10) {
- const { cap: e12, join: t9, style: r19 } = a10;
- r19 !== "solid" && r19 !== "none" && r19 !== "esriSLSSolid" && r19 !== "esriSLSNull" && (l9 = [{ type: "CIMGeometricEffectDashes", dashTemplate: me(r19, e12), lineDashEnding: "NoConstraint", scaleDash: true, offsetAlongLine: null }]), s10.push({ type: "CIMSolidStroke", color: se(a10.color), capStyle: re(e12), joinStyle: oe2(t9), miterLimit: a10.miterLimit, width: a10.width, effects: l9 });
- }
- if (r18 && r18 !== "solid" && r18 !== "none" && r18 !== "esriSFSSolid" && r18 !== "esriSFSNull") {
- const e12 = { type: "CIMLineSymbol", symbolLayers: [{ type: "CIMSolidStroke", color: se(t8), capStyle: U2.Butt, joinStyle: w.Miter, width: 0.75 }] };
- let a11 = 0;
- const n18 = c3(Math.ceil(window.devicePixelRatio)), l10 = he(r18) ? 8 * n18 : 10 * n18;
- switch (r18) {
- case "vertical":
- case "esriSFSVertical":
- a11 = 90;
- break;
- case "forward-diagonal":
- case "esriSFSForwardDiagonal":
- case "diagonal-cross":
- case "esriSFSDiagonalCross":
- a11 = -45;
- break;
- case "backward-diagonal":
- case "esriSFSBackwardDiagonal":
- a11 = 45;
- break;
- case "cross":
- case "esriSFSCross":
- a11 = 0;
- }
- s10.push({ type: "CIMHatchFill", lineSymbol: e12, offsetX: 0, offsetY: 0, rotation: a11, separation: l10 }), r18 === "cross" || r18 === "esriSFSCross" ? s10.push({ type: "CIMHatchFill", lineSymbol: m(e12), offsetX: 0, offsetY: 0, rotation: 90, separation: l10 }) : r18 !== "diagonal-cross" && r18 !== "esriSFSDiagonalCross" || s10.push({ type: "CIMHatchFill", lineSymbol: m(e12), offsetX: 0, offsetY: 0, rotation: 45, separation: l10 });
- } else
- !r18 || r18 !== "solid" && r18 !== "esriSFSSolid" || s10.push({ type: "CIMSolidFill", enable: true, color: se(t8) });
- return n17;
- }
- static fromSimpleLineSymbol(e11) {
- const { cap: t8, color: r18, join: o11, marker: a10, miterLimit: i8, style: s10, width: n17 } = e11;
- let l9 = null;
- s10 !== "solid" && s10 !== "none" && s10 !== "esriSLSSolid" && s10 !== "esriSLSNull" && (l9 = [{ type: "CIMGeometricEffectDashes", dashTemplate: me(s10, t8), lineDashEnding: "NoConstraint", scaleDash: true, offsetAlongLine: null }]);
- const c9 = [];
- if (a10) {
- let e12;
- switch (a10.placement) {
- case "begin-end":
- e12 = o3.Both;
- break;
- case "begin":
- e12 = o3.JustBegin;
- break;
- case "end":
- e12 = o3.JustEnd;
- break;
- default:
- e12 = o3.None;
- }
- const t9 = Z2.fromSimpleMarker(a10, n17, r18).symbolLayers[0];
- t9.markerPlacement = { type: "CIMMarkerPlacementAtExtremities", angleToLine: true, offset: 0, extremityPlacement: e12, offsetAlongLine: 0 }, c9.push(t9);
- }
- return s10 !== "none" && s10 !== "esriSLSNull" && c9.push({ type: "CIMSolidStroke", color: se(r18), capStyle: re(t8), joinStyle: oe2(o11), miterLimit: i8, width: n17, effects: l9 }), { type: "CIMLineSymbol", symbolLayers: c9 };
- }
- static fromPictureMarker(e11) {
- const { angle: t8, height: r18, width: o11, xoffset: a10, yoffset: i8 } = e11;
- let s10 = e11.url;
- return e11.type === "esriPMS" && e11.imageData && (s10 = e11.imageData), { type: "CIMPointSymbol", symbolLayers: [{ type: "CIMPictureMarker", invertBackfaceTexture: false, scaleX: 1, textureFilter: ie.Picture, tintColor: null, url: s10, size: r18, width: o11, offsetX: M(a10), offsetY: M(i8), rotation: M(-t8) }] };
- }
- static fromSimpleMarker(e11, t8, r18) {
- const { style: o11 } = e11, a10 = e11.color ?? r18;
- if (o11 === "path") {
- const t9 = [];
- if ("outline" in e11 && e11.outline) {
- const r20 = e11.outline;
- t9.push({ type: "CIMSolidStroke", enable: true, width: u(Math.round(e3(r20.width))), color: se(r20.color) });
- }
- t9.push({ type: "CIMSolidFill", enable: true, color: se(a10), path: e11.path });
- const [r19, o12] = ye("square");
- return { type: "CIMPointSymbol", symbolLayers: [{ type: "CIMVectorMarker", enable: true, rotation: M(-e11.angle), size: M(e11.size || 6), offsetX: M(e11.xoffset), offsetY: M(e11.yoffset), frame: r19, markerGraphics: [{ type: "CIMMarkerGraphic", geometry: o12, symbol: { type: "CIMPolygonSymbol", symbolLayers: t9 } }] }] };
- }
- const [i8, s10] = ye(o11);
- let n17;
- if (s10 && i8) {
- const r19 = [];
- if ("outline" in e11 && e11.outline) {
- const t9 = e11.outline;
- r19.push({ type: "CIMSolidStroke", enable: true, width: t9.width > 0.667 ? u(Math.round(e3(t9.width))) : t9.width, color: se(t9.color) });
- } else
- !t8 || e11.type !== "line-marker" || e11.style !== "cross" && e11.style !== "x" || r19.push({ type: "CIMSolidStroke", enable: true, width: t8, color: se(a10) });
- r19.push({ type: "CIMSolidFill", enable: true, color: se(a10) });
- const o12 = { type: "CIMPolygonSymbol", symbolLayers: r19 };
- n17 = { type: "CIMPointSymbol", symbolLayers: [{ type: "CIMVectorMarker", enable: true, rotation: M(-e11.angle), size: M(e11.size || 6 * t8), offsetX: M(e11.xoffset), offsetY: M(e11.yoffset), frame: i8, markerGraphics: [{ type: "CIMMarkerGraphic", geometry: s10, symbol: o12 }] }] };
- }
- return n17;
- }
- static fromCIMHatchFill(e11) {
- const t8 = e11.separation ?? X2, r18 = t8 / 2, o11 = 4, a10 = e11.lineSymbol;
- let i8 = this._getLineSymbolPeriod(e11.lineSymbol) || o11;
- for (; i8 < o11; )
- i8 *= 2;
- const s10 = i8 / 2;
- return { type: "CIMVectorMarker", frame: { xmin: -s10, xmax: s10, ymin: -r18, ymax: r18 }, markerGraphics: [{ type: "CIMMarkerGraphic", geometry: { paths: [[[-s10, 0], [s10, 0]]] }, symbol: a10 }], size: t8 };
- }
- static _getLineSymbolPeriod(e11) {
- if (e11) {
- const t8 = this._getEffectsRepeat(e11.effects);
- if (t8)
- return t8;
- if (e11.symbolLayers) {
- for (const r18 of e11.symbolLayers)
- if (r18) {
- const e12 = this._getEffectsRepeat(r18.effects);
- if (e12)
- return e12;
- switch (r18.type) {
- case "CIMCharacterMarker":
- case "CIMPictureMarker":
- case "CIMVectorMarker":
- case "CIMObjectMarker3D":
- case "CIMglTFMarker3D": {
- const e13 = this._getPlacementRepeat(r18.markerPlacement);
- if (e13)
- return e13;
- }
- }
- }
- }
- }
- return 0;
- }
- static _getEffectsRepeat(e11) {
- if (e11) {
- for (const t8 of e11)
- if (t8)
- switch (t8.type) {
- case "CIMGeometricEffectDashes": {
- const e12 = t8.dashTemplate;
- if (e12 && e12.length) {
- let t9 = 0;
- for (const r18 of e12)
- t9 += r18;
- return 1 & e12.length && (t9 *= 2), t9;
- }
- break;
- }
- case "CIMGeometricEffectWave":
- return t8.period;
- default:
- Y2.error(`unsupported geometric effect type ${t8.type}`);
- }
- }
- return 0;
- }
- static _getPlacementRepeat(e11) {
- if (e11)
- switch (e11.type) {
- case "CIMMarkerPlacementAlongLineSameSize":
- case "CIMMarkerPlacementAlongLineRandomSize":
- case "CIMMarkerPlacementAlongLineVariableSize": {
- const t8 = e11.placementTemplate;
- if (t8 && t8.length) {
- let e12 = 0;
- for (const r18 of t8)
- e12 += r18;
- return 1 & t8.length && (e12 *= 2), e12;
- }
- break;
- }
- }
- return 0;
- }
- static fromCIMInsidePolygon(e11) {
- const t8 = e11.markerPlacement, r18 = { type: e11.type, ...e11 };
- r18.markerPlacement = null, r18.anchorPoint = null;
- const o11 = Math.abs(t8.stepX), a10 = Math.abs(t8.stepY), i8 = (t8.randomness ?? 100) / 100;
- let s10, n17, c9, f8;
- if (t8.gridType === "Random") {
- const e12 = e3(dt), r19 = Math.max(Math.floor(e12 / o11), 1), y5 = Math.max(Math.floor(e12 / a10), 1);
- s10 = r19 * o11 / 2, n17 = y5 * a10 / 2, c9 = 2 * n17;
- const h6 = new t2(t8.seed), M3 = i8 * o11 / 1.5, p3 = i8 * a10 / 1.5;
- f8 = [];
- for (let t9 = 0; t9 < r19; t9++)
- for (let e13 = 0; e13 < y5; e13++) {
- const r20 = t9 * o11 - s10 + M3 * (0.5 - h6.getFloat()), i9 = e13 * a10 - n17 + p3 * (0.5 - h6.getFloat());
- f8.push({ x: r20, y: i9 }), t9 === 0 && f8.push({ x: r20 + 2 * s10, y: i9 }), e13 === 0 && f8.push({ x: r20, y: i9 + 2 * n17 });
- }
- } else
- t8.shiftOddRows === true ? (s10 = o11 / 2, n17 = a10, c9 = 2 * a10, f8 = [{ x: -s10, y: 0 }, { x: s10, y: 0 }, { x: 0, y: n17 }, { x: 0, y: -n17 }]) : (s10 = o11 / 2, n17 = a10 / 2, c9 = a10, f8 = [{ x: 0, y: 0 }]);
- return { type: "CIMVectorMarker", frame: { xmin: -s10, xmax: s10, ymin: -n17, ymax: n17 }, markerGraphics: f8.map((e12) => ({ type: "CIMMarkerGraphic", geometry: e12, symbol: { type: "CIMPointSymbol", symbolLayers: [r18] } })), size: c9 };
- }
- static getFillColor(e11) {
- if (!e11)
- return null;
- switch (e11.type) {
- case "CIMPolygonSymbol":
- if (e11.symbolLayers)
- for (const t8 of e11.symbolLayers) {
- const e12 = Z2.getFillColor(t8);
- if (e12 != null)
- return e12;
- }
- break;
- case "CIMTextSymbol":
- return Z2.getFillColor(e11.symbol);
- case "CIMSolidFill":
- return e11.color;
- }
- }
- static getStrokeColor(e11) {
- if (e11)
- switch (e11.type) {
- case "CIMPolygonSymbol":
- case "CIMLineSymbol":
- if (e11.symbolLayers)
- for (const t8 of e11.symbolLayers) {
- const e12 = Z2.getStrokeColor(t8);
- if (e12 !== void 0)
- return e12;
- }
- break;
- case "CIMTextSymbol":
- return Z2.getStrokeColor(e11.symbol);
- case "CIMSolidStroke":
- return e11.color;
- }
- }
- static getStrokeWidth(e11) {
- if (e11)
- switch (e11.type) {
- case "CIMPolygonSymbol":
- case "CIMLineSymbol":
- if (e11.symbolLayers)
- for (const t8 of e11.symbolLayers) {
- const e12 = Z2.getStrokeWidth(t8);
- if (e12 !== void 0)
- return e12;
- }
- break;
- case "CIMTextSymbol":
- return Z2.getStrokeWidth(e11.symbol);
- case "CIMSolidStroke":
- case "CIMGradientStroke":
- case "CIMPictureStroke":
- return e11.width;
- }
- }
- static getSize(e11) {
- if (e11)
- switch (e11.type) {
- case "CIMTextSymbol":
- return e11.height;
- case "CIMPointSymbol": {
- let t8 = 0;
- if (e11.symbolLayers) {
- for (const r18 of e11.symbolLayers)
- if (r18)
- switch (r18.type) {
- case "CIMCharacterMarker":
- case "CIMPictureMarker":
- case "CIMVectorMarker":
- case "CIMObjectMarker3D":
- case "CIMglTFMarker3D": {
- const e12 = r18.size;
- e12 > t8 && (t8 = e12);
- break;
- }
- }
- }
- return t8;
- }
- case "CIMLineSymbol":
- case "CIMPolygonSymbol": {
- let t8 = 0;
- if (e11.symbolLayers) {
- for (const r18 of e11.symbolLayers)
- if (r18)
- switch (r18.type) {
- case "CIMSolidStroke":
- case "CIMPictureStroke":
- case "CIMGradientStroke": {
- const e12 = r18.width;
- e12 > t8 && (t8 = e12);
- break;
- }
- case "CIMCharacterMarker":
- case "CIMPictureMarker":
- case "CIMVectorMarker":
- case "CIMObjectMarker3D":
- case "CIMglTFMarker3D":
- if (f3(r18.markerPlacement)) {
- const e12 = r18.size;
- e12 > t8 && (t8 = e12);
- }
- }
- }
- return t8;
- }
- }
- }
- static getMarkerScaleRatio(e11) {
- if (e11 && e11.type === "CIMVectorMarker") {
- if (e11.scaleSymbolsProportionally !== false && e11.frame) {
- const t8 = e11.frame.ymax - e11.frame.ymin;
- return e11.size / t8;
- }
- }
- return 1;
- }
- };
- var ee = class {
- static rasterizeSimpleFill(e11, t8, r18) {
- t8 !== "solid" && t8 !== "none" && t8 !== "esriSFSSolid" && t8 !== "esriSFSNull" || console.error("Unexpected: style does not require rasterization");
- const o11 = c3(Math.ceil(r18)), a10 = he(t8) ? 8 * o11 : 16 * o11, s10 = 2 * o11;
- e11.width = a10, e11.height = a10;
- const n17 = e11.getContext("2d");
- n17.strokeStyle = "#FFFFFF", n17.lineWidth = o11, n17.beginPath(), t8 !== "vertical" && t8 !== "cross" && t8 !== "esriSFSCross" && t8 !== "esriSFSVertical" || (n17.moveTo(a10 / 2, -s10), n17.lineTo(a10 / 2, a10 + s10)), t8 !== "horizontal" && t8 !== "cross" && t8 !== "esriSFSCross" && t8 !== "esriSFSHorizontal" || (n17.moveTo(-s10, a10 / 2), n17.lineTo(a10 + s10, a10 / 2)), t8 !== "forward-diagonal" && t8 !== "diagonal-cross" && t8 !== "esriSFSDiagonalCross" && t8 !== "esriSFSForwardDiagonal" || (n17.moveTo(-s10, -s10), n17.lineTo(a10 + s10, a10 + s10), n17.moveTo(a10 - s10, -s10), n17.lineTo(a10 + s10, s10), n17.moveTo(-s10, a10 - s10), n17.lineTo(s10, a10 + s10)), t8 !== "backward-diagonal" && t8 !== "diagonal-cross" && t8 !== "esriSFSBackwardDiagonal" && t8 !== "esriSFSDiagonalCross" || (n17.moveTo(a10 + s10, -s10), n17.lineTo(-s10, a10 + s10), n17.moveTo(s10, -s10), n17.lineTo(-s10, s10), n17.moveTo(a10 + s10, a10 - s10), n17.lineTo(a10 - s10, a10 + s10)), n17.stroke();
- const l9 = n17.getImageData(0, 0, e11.width, e11.height), c9 = new Uint8Array(l9.data);
- let m7;
- for (let i8 = 0; i8 < c9.length; i8 += 4)
- m7 = c9[i8 + 3] / 255, c9[i8] = c9[i8] * m7, c9[i8 + 1] = c9[i8 + 1] * m7, c9[i8 + 2] = c9[i8 + 2] * m7;
- return [c9, e11.width, e11.height];
- }
- static rasterizeSimpleLine(e11, t8) {
- return this.rasterizeDash(e11, t8);
- }
- static rasterizeDash(e11, t8) {
- const o11 = t8 === "Butt", a10 = t8 === "Square", i8 = !o11 && !a10;
- e11.length % 2 == 1 && (e11 = [...e11, ...e11]);
- const s10 = 15.5, n17 = 2 * s10;
- let l9 = 0;
- for (const r18 of e11)
- l9 += r18;
- const c9 = Math.round(l9 * s10), m7 = new Float32Array(c9 * n17), f8 = 0.5 * s10;
- let y5 = 0, h6 = 0, M3 = 0.5, p3 = true;
- for (const r18 of e11) {
- for (y5 = h6, h6 += r18 * s10; M3 <= h6; ) {
- let e12 = 0.5;
- for (; e12 < n17; ) {
- const t9 = (e12 - 0.5) * c9 + M3 - 0.5, r19 = i8 ? (e12 - s10) * (e12 - s10) : Math.abs(e12 - s10);
- m7[t9] = p3 ? o11 ? Math.max(Math.max(y5 + f8 - M3, r19), Math.max(M3 - h6 + f8, r19)) : r19 : i8 ? Math.min((M3 - y5) * (M3 - y5) + r19, (M3 - h6) * (M3 - h6) + r19) : a10 ? Math.min(Math.max(M3 - y5, r19), Math.max(h6 - M3, r19)) : Math.min(Math.max(M3 - y5 + f8, r19), Math.max(h6 + f8 - M3, r19)), e12++;
- }
- M3++;
- }
- p3 = !p3;
- }
- const u9 = m7.length, S = new Uint8Array(4 * u9);
- for (let d2 = 0; d2 < u9; ++d2) {
- const e12 = (i8 ? Math.sqrt(m7[d2]) : m7[d2]) / s10;
- o6(e12, S, 4 * d2);
- }
- return [S, c9, n17];
- }
- };
- var te = class {
- static findApplicableOverrides(e11, t8, r18) {
- if (e11 && t8) {
- if (e11.primitiveName) {
- let o11 = false;
- for (const t9 of r18)
- if (t9.primitiveName === e11.primitiveName) {
- o11 = true;
- break;
- }
- if (!o11)
- for (const a10 of t8)
- a10.primitiveName === e11.primitiveName && r18.push(a10);
- }
- switch (e11.type) {
- case "CIMPointSymbol":
- case "CIMLineSymbol":
- case "CIMPolygonSymbol":
- if (e11.effects)
- for (const o11 of e11.effects)
- te.findApplicableOverrides(o11, t8, r18);
- if (e11.symbolLayers)
- for (const o11 of e11.symbolLayers)
- te.findApplicableOverrides(o11, t8, r18);
- break;
- case "CIMTextSymbol":
- break;
- case "CIMSolidStroke":
- case "CIMPictureStroke":
- case "CIMGradientStroke":
- case "CIMSolidFill":
- case "CIMPictureFill":
- case "CIMHatchFill":
- case "CIMGradientFill":
- case "CIMVectorMarker":
- case "CIMCharacterMarker":
- case "CIMPictureMarker":
- if (e11.effects)
- for (const o11 of e11.effects)
- te.findApplicableOverrides(o11, t8, r18);
- if (e11.markerPlacement && te.findApplicableOverrides(e11.markerPlacement, t8, r18), e11.type === "CIMVectorMarker") {
- if (e11.markerGraphics)
- for (const o11 of e11.markerGraphics)
- te.findApplicableOverrides(o11, t8, r18), te.findApplicableOverrides(o11.symbol, t8, r18);
- } else
- e11.type === "CIMCharacterMarker" ? te.findApplicableOverrides(e11.symbol, t8, r18) : e11.type === "CIMHatchFill" ? te.findApplicableOverrides(e11.lineSymbol, t8, r18) : e11.type === "CIMPictureMarker" && te.findApplicableOverrides(e11.animatedSymbolProperties, t8, r18);
- }
- }
- }
- static findEffectOverrides(e11, t8, r18) {
- if (!t8 || !e11)
- return;
- const o11 = e11.length;
- for (let a10 = 0; a10 < o11; a10++) {
- const o12 = e11[a10]?.primitiveName;
- if (o12) {
- let e12 = false;
- for (const t9 of r18)
- if (t9.primitiveName === o12) {
- e12 = true;
- break;
- }
- if (!e12)
- for (const a11 of t8)
- a11.primitiveName === o12 && r18.push(a11);
- }
- }
- }
- static applyOverrides(e11, t8, r18, o11) {
- if (!t8)
- return;
- const a10 = (e12) => e12 ? e12.charAt(0).toLowerCase() + e12.substr(1) : e12;
- if (e11.primitiveName) {
- for (const i8 of t8)
- if (i8.primitiveName === e11.primitiveName) {
- const t9 = a10(i8.propertyName);
- if (o11 && o11.push({ cim: e11, nocapPropertyName: t9, value: e11[t9] }), i8.expression && (i8.value = te.toValue(i8.propertyName, i8.expression)), r18) {
- let t10 = false;
- for (const o12 of r18)
- o12.primitiveName === e11.primitiveName && (t10 = true);
- t10 || r18.push(i8);
- }
- e11[t9] = i8.value;
- }
- }
- switch (e11.type) {
- case "CIMPointSymbol":
- case "CIMLineSymbol":
- case "CIMPolygonSymbol":
- if (e11.effects)
- for (const a11 of e11.effects)
- te.applyOverrides(a11, t8, r18, o11);
- if (e11.symbolLayers)
- for (const a11 of e11.symbolLayers)
- te.applyOverrides(a11, t8, r18, o11);
- break;
- case "CIMTextSymbol":
- break;
- case "CIMSolidStroke":
- case "CIMSolidFill":
- case "CIMVectorMarker":
- if (e11.effects)
- for (const a11 of e11.effects)
- te.applyOverrides(a11, t8, r18, o11);
- if (e11.type === "CIMVectorMarker" && e11.markerGraphics)
- for (const a11 of e11.markerGraphics)
- te.applyOverrides(a11, t8, r18, o11), te.applyOverrides(a11.symbol, t8, r18, o11);
- }
- }
- static restoreOverrides(e11) {
- for (const t8 of e11)
- t8.cim[t8.nocapPropertyName] = t8.value;
- }
- static buildOverrideKey(e11) {
- let t8 = "";
- for (const r18 of e11)
- r18.value !== void 0 && (t8 += `${r18.primitiveName}${r18.propertyName}${JSON.stringify(r18.value)}`);
- return t8;
- }
- static toValue(t8, r18) {
- if (t8 === "DashTemplate")
- return r18.split(" ").map((e11) => Number(e11));
- if (t8 === "Color") {
- const t9 = new l2(r18).toRgba();
- return t9[3] *= 255, t9;
- }
- return r18;
- }
- };
- var re = (e11) => {
- if (!e11)
- return U2.Butt;
- switch (e11) {
- case "butt":
- return U2.Butt;
- case "square":
- return U2.Square;
- case "round":
- return U2.Round;
- }
- };
- var oe2 = (e11) => {
- if (!e11)
- return w.Miter;
- switch (e11) {
- case "miter":
- return w.Miter;
- case "round":
- return w.Round;
- case "bevel":
- return w.Bevel;
- }
- };
- var ae = (e11) => {
- if (t(e11))
- return "Center";
- switch (e11) {
- case "left":
- return "Left";
- case "right":
- return "Right";
- case "center":
- return "Center";
- }
- };
- var ie2 = (e11) => {
- if (t(e11))
- return "Center";
- switch (e11) {
- case "baseline":
- return "Baseline";
- case "top":
- return "Top";
- case "middle":
- return "Center";
- case "bottom":
- return "Bottom";
- }
- };
- var se = (e11) => {
- if (!e11)
- return [0, 0, 0, 0];
- const { r: t8, g: r18, b: o11, a: a10 } = e11;
- return [t8, r18, o11, 255 * a10];
- };
- var ne2 = (e11, t8) => {
- const r18 = le(t8), o11 = ce(e11);
- return r18 && o11 ? `${r18}-${o11}` : `${r18}${o11}`;
- };
- var le = (e11) => {
- if (!e11)
- return "";
- switch (e11.toLowerCase()) {
- case "bold":
- case "bolder":
- return "bold";
- }
- return "";
- };
- var ce = (e11) => {
- if (!e11)
- return "";
- switch (e11.toLowerCase()) {
- case "italic":
- case "oblique":
- return "italic";
- }
- return "";
- };
- var me = (e11, t8) => {
- const r18 = t8 === "butt";
- switch (e11) {
- case "dash":
- case "esriSLSDash":
- return r18 ? [4, 3] : [3, 4];
- case "dash-dot":
- case "esriSLSDashDot":
- return r18 ? [4, 3, 1, 3] : [3, 4, 0, 4];
- case "dot":
- case "esriSLSDot":
- return r18 ? [1, 3] : [0, 4];
- case "long-dash":
- case "esriSLSLongDash":
- return r18 ? [8, 3] : [7, 4];
- case "long-dash-dot":
- case "esriSLSLongDashDot":
- return r18 ? [8, 3, 1, 3] : [7, 4, 0, 4];
- case "long-dash-dot-dot":
- case "esriSLSDashDotDot":
- return r18 ? [8, 3, 1, 3, 1, 3] : [7, 4, 0, 4, 0, 4];
- case "short-dash":
- case "esriSLSShortDash":
- return r18 ? [4, 1] : [3, 2];
- case "short-dash-dot":
- case "esriSLSShortDashDot":
- return r18 ? [4, 1, 1, 1] : [3, 2, 0, 2];
- case "short-dash-dot-dot":
- case "esriSLSShortDashDotDot":
- return r18 ? [4, 1, 1, 1, 1, 1] : [3, 2, 0, 2, 0, 2];
- case "short-dot":
- case "esriSLSShortDot":
- return r18 ? [1, 1] : [0, 2];
- case "solid":
- case "esriSLSSolid":
- case "none":
- return Y2.error("Unexpected: style does not require rasterization"), [0, 0];
- default:
- return Y2.error(`Tried to rasterize SLS, but found an unexpected style: ${e11}!`), [0, 0];
- }
- };
- function fe(e11) {
- return e11.symbolLayers !== void 0;
- }
- var ye = (e11) => {
- const t8 = 100, r18 = 50;
- let o11, a10;
- const i8 = e11;
- if (i8 === "circle" || i8 === "esriSMSCircle") {
- const e12 = 0.25;
- let t9 = Math.acos(1 - e12 / r18), i9 = Math.ceil(V / t9 / 4);
- i9 === 0 && (i9 = 1), t9 = B4 / i9, i9 *= 4;
- const s10 = [];
- s10.push([r18, 0]);
- for (let o12 = 1; o12 < i9; o12++)
- s10.push([r18 * Math.cos(o12 * t9), -r18 * Math.sin(o12 * t9)]);
- s10.push([r18, 0]), o11 = { rings: [s10] }, a10 = { xmin: -r18, ymin: -r18, xmax: r18, ymax: r18 };
- } else if (i8 === "cross" || i8 === "esriSMSCross") {
- const e12 = 0;
- o11 = { rings: [[[e12, r18], [e12, e12], [r18, e12], [r18, -e12], [e12, -e12], [e12, -r18], [-e12, -r18], [-e12, -e12], [-r18, -e12], [-r18, e12], [-e12, e12], [-e12, r18], [e12, r18]]] }, a10 = { xmin: -r18, ymin: -r18, xmax: r18, ymax: r18 };
- } else if (i8 === "diamond" || i8 === "esriSMSDiamond")
- o11 = { rings: [[[-r18, 0], [0, r18], [r18, 0], [0, -r18], [-r18, 0]]] }, a10 = { xmin: -r18, ymin: -r18, xmax: r18, ymax: r18 };
- else if (i8 === "square" || i8 === "esriSMSSquare")
- o11 = { rings: [[[-r18, -r18], [-r18, r18], [r18, r18], [r18, -r18], [-r18, -r18]]] }, a10 = { xmin: -r18, ymin: -r18, xmax: r18, ymax: r18 };
- else if (i8 === "x" || i8 === "esriSMSX") {
- const e12 = 0;
- o11 = { rings: [[[0, e12], [r18 - e12, r18], [r18, r18 - e12], [e12, 0], [r18, e12 - r18], [r18 - e12, -r18], [0, -e12], [e12 - r18, -r18], [-r18, e12 - r18], [-e12, 0], [-r18, r18 - e12], [e12 - r18, r18], [0, e12]]] }, a10 = { xmin: -r18, ymin: -r18, xmax: r18, ymax: r18 };
- } else if (i8 === "triangle" || i8 === "esriSMSTriangle") {
- const e12 = t8 * 0.5773502691896257, r19 = -e12, i9 = 2 / 3 * t8, s10 = i9 - t8;
- o11 = { rings: [[[r19, s10], [0, i9], [e12, s10], [r19, s10]]] }, a10 = { xmin: r19, ymin: s10, xmax: e12, ymax: i9 };
- } else
- i8 === "arrow" && (o11 = { rings: [[[-50, 50], [50, 0], [-50, -50], [-33, -20], [-33, 20], [-50, 50]]] }, a10 = { xmin: -r18, ymin: -r18, xmax: r18, ymax: r18 });
- return [a10, o11];
- };
- var he = (e11) => e11 === "vertical" || e11 === "horizontal" || e11 === "cross" || e11 === "esriSFSCross" || e11 === "esriSFSVertical" || e11 === "esriSFSHorizontal";
- export {
- n4 as n,
- a3 as a,
- x,
- A2 as A,
- g3 as g,
- j3 as j,
- r5 as r,
- o6 as o,
- r4 as r2,
- s4 as s,
- t7 as t,
- s5 as s2,
- j4 as j2,
- q,
- Q,
- Z2 as Z,
- ee,
- te,
- me
- };
- //# sourceMappingURL=chunk-MWIFVNKP.js.map
|