leaderline.js 172 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986
  1. /*! LeaderLine v1.0.5 (c) anseki https://anseki.github.io/leader-line/ */
  2. var LeaderLine = function () {
  3. "use strict";
  4. var te, g, y, S, _, o, t, h, f, p, a, i, l, v = "leader-line",
  5. M = 1,
  6. I = 2,
  7. C = 3,
  8. L = 4,
  9. n = {
  10. top: M,
  11. right: I,
  12. bottom: C,
  13. left: L
  14. },
  15. A = 1,
  16. V = 2,
  17. P = 3,
  18. N = 4,
  19. T = 5,
  20. m = {
  21. straight: A,
  22. arc: V,
  23. fluid: P,
  24. magnet: N,
  25. grid: T
  26. },
  27. ne = "behind",
  28. r = v + "-defs",
  29. s = '<svg xmlns="http://www.w3.org/2000/svg" version="1.1" id="leader-line-defs"><style><![CDATA[.leader-line{position:absolute;overflow:visible!important;pointer-events:none!important;font-size:16px}#leader-line-defs{width:0;height:0;position:absolute;left:0;top:0}.leader-line-line-path{fill:none}.leader-line-mask-bg-rect{fill:#fff}.leader-line-caps-mask-anchor,.leader-line-caps-mask-marker-shape{fill:#000}.leader-line-caps-mask-anchor{stroke:#000}.leader-line-caps-mask-line,.leader-line-plugs-face{stroke:transparent}.leader-line-line-mask-shape{stroke:#fff}.leader-line-line-outline-mask-shape{stroke:#000}.leader-line-plug-mask-shape{fill:#fff;stroke:#000}.leader-line-plug-outline-mask-shape{fill:#000;stroke:#fff}.leader-line-areaAnchor{position:absolute;overflow:visible!important}]]></style><defs><circle id="leader-line-disc" cx="0" cy="0" r="5"/><rect id="leader-line-square" x="-5" y="-5" width="10" height="10"/><polygon id="leader-line-arrow1" points="-8,-8 8,0 -8,8 -5,0"/><polygon id="leader-line-arrow2" points="-4,-8 4,0 -4,8 -7,5 -2,0 -7,-5"/><polygon id="leader-line-arrow3" points="-4,-5 8,0 -4,5"/><g id="leader-line-hand"><path style="fill: #fcfcfc" d="M9.19 11.14h4.75c1.38 0 2.49-1.11 2.49-2.49 0-.51-.15-.98-.41-1.37h1.3c1.38 0 2.49-1.11 2.49-2.49s-1.11-2.53-2.49-2.53h1.02c1.38 0 2.49-1.11 2.49-2.49s-1.11-2.49-2.49-2.49h14.96c1.37 0 2.49-1.11 2.49-2.49s-1.11-2.49-2.49-2.49H16.58C16-9.86 14.28-11.14 9.7-11.14c-4.79 0-6.55 3.42-7.87 4.73H-2.14v13.23h3.68C3.29 9.97 5.47 11.14 9.19 11.14L9.19 11.14Z"/><path style="fill: black" d="M13.95 12c1.85 0 3.35-1.5 3.35-3.35 0-.17-.02-.34-.04-.51h.07c1.85 0 3.35-1.5 3.35-3.35 0-.79-.27-1.51-.72-2.08 1.03-.57 1.74-1.67 1.74-2.93 0-.59-.16-1.15-.43-1.63h12.04c1.85 0 3.35-1.5 3.35-3.35 0-1.85-1.5-3.35-3.35-3.35H17.2C16.26-10.93 13.91-12 9.7-12 5.36-12 3.22-9.4 1.94-7.84c0 0-.29.33-.5.57-.63 0-3.58 0-3.58 0C-2.61-7.27-3-6.88-3-6.41v13.23c0 .47.39.86.86.86 0 0 2.48 0 3.2 0C2.9 10.73 5.29 12 9.19 12L13.95 12ZM9.19 10.28c-3.46 0-5.33-1.05-6.9-3.87-.15-.27-.44-.44-.75-.44 0 0-1.81 0-2.82 0V-5.55c1.06 0 3.11 0 3.11 0 .25 0 .44-.06.61-.25l.83-.95c1.23-1.49 2.91-3.53 6.43-3.53 3.45 0 4.9.74 5.57 1.72h-4.3c-.48 0-.86.38-.86.86s.39.86.86.86h22.34c.9 0 1.63.73 1.63 1.63 0 .9-.73 1.63-1.63 1.63H15.83c-.48 0-.86.38-.86.86 0 .47.39.86.86.86h2.52c.9 0 1.63.73 1.63 1.63s-.73 1.63-1.63 1.63h-3.12c-.48 0-.86.38-.86.86 0 .47.39.86.86.86h2.11c.88 0 1.63.76 1.63 1.67 0 .9-.73 1.63-1.63 1.63h-3.2c-.48 0-.86.39-.86.86 0 .47.39.86.86.86h1.36c.05.16.09.34.09.51 0 .9-.73 1.63-1.63 1.63C13.95 10.28 9.19 10.28 9.19 10.28Z"/></g><g id="leader-line-crosshair"><path d="M0-78.97c-43.54 0-78.97 35.43-78.97 78.97 0 43.54 35.43 78.97 78.97 78.97s78.97-35.43 78.97-78.97C78.97-43.54 43.55-78.97 0-78.97ZM76.51-1.21h-9.91v-9.11h-2.43v9.11h-11.45c-.64-28.12-23.38-50.86-51.5-51.5V-64.17h9.11V-66.6h-9.11v-9.91C42.46-75.86 75.86-42.45 76.51-1.21ZM-1.21-30.76h-9.11v2.43h9.11V-4.2c-1.44.42-2.57 1.54-2.98 2.98H-28.33v-9.11h-2.43v9.11H-50.29C-49.65-28-27.99-49.65-1.21-50.29V-30.76ZM-30.76 1.21v9.11h2.43v-9.11H-4.2c.42 1.44 1.54 2.57 2.98 2.98v24.13h-9.11v2.43h9.11v19.53C-27.99 49.65-49.65 28-50.29 1.21H-30.76ZM1.22 30.75h9.11v-2.43h-9.11V4.2c1.44-.42 2.56-1.54 2.98-2.98h24.13v9.11h2.43v-9.11h19.53C49.65 28 28 49.65 1.22 50.29V30.75ZM30.76-1.21v-9.11h-2.43v9.11H4.2c-.42-1.44-1.54-2.56-2.98-2.98V-28.33h9.11v-2.43h-9.11V-50.29C28-49.65 49.65-28 50.29-1.21H30.76ZM-1.21-76.51v9.91h-9.11v2.43h9.11v11.45c-28.12.64-50.86 23.38-51.5 51.5H-64.17v-9.11H-66.6v9.11h-9.91C-75.86-42.45-42.45-75.86-1.21-76.51ZM-76.51 1.21h9.91v9.11h2.43v-9.11h11.45c.64 28.12 23.38 50.86 51.5 51.5v11.45h-9.11v2.43h9.11v9.91C-42.45 75.86-75.86 42.45-76.51 1.21ZM1.22 76.51v-9.91h9.11v-2.43h-9.11v-11.45c28.12-.64 50.86-23.38 51.5-51.5h11.45v9.11h2.43v-9.11h9.91C75.86 42.45 42.45 75.86 1.22 76.51Z"/><path d="M0 83.58-7.1 96 7.1 96Z"/><path d="M0-83.58 7.1-96-7.1-96"/><path d="M83.58 0 96 7.1 96-7.1Z"/><path d="M-83.58 0-96-7.1-96 7.1Z"/></g></defs></svg>',
  30. ae = {
  31. disc: {
  32. elmId: "leader-line-disc",
  33. noRotate: !0,
  34. bBox: {
  35. left: -5,
  36. top: -5,
  37. width: 10,
  38. height: 10,
  39. right: 5,
  40. bottom: 5
  41. },
  42. widthR: 2.5,
  43. heightR: 2.5,
  44. bCircle: 5,
  45. sideLen: 5,
  46. backLen: 5,
  47. overhead: 0,
  48. outlineBase: 1,
  49. outlineMax: 4
  50. },
  51. square: {
  52. elmId: "leader-line-square",
  53. noRotate: !0,
  54. bBox: {
  55. left: -5,
  56. top: -5,
  57. width: 10,
  58. height: 10,
  59. right: 5,
  60. bottom: 5
  61. },
  62. widthR: 2.5,
  63. heightR: 2.5,
  64. bCircle: 5,
  65. sideLen: 5,
  66. backLen: 5,
  67. overhead: 0,
  68. outlineBase: 1,
  69. outlineMax: 4
  70. },
  71. arrow1: {
  72. elmId: "leader-line-arrow1",
  73. bBox: {
  74. left: -8,
  75. top: -8,
  76. width: 16,
  77. height: 16,
  78. right: 8,
  79. bottom: 8
  80. },
  81. widthR: 4,
  82. heightR: 4,
  83. bCircle: 8,
  84. sideLen: 8,
  85. backLen: 8,
  86. overhead: 8,
  87. outlineBase: 2,
  88. outlineMax: 1.5
  89. },
  90. arrow2: {
  91. elmId: "leader-line-arrow2",
  92. bBox: {
  93. left: -7,
  94. top: -8,
  95. width: 11,
  96. height: 16,
  97. right: 4,
  98. bottom: 8
  99. },
  100. widthR: 2.75,
  101. heightR: 4,
  102. bCircle: 8,
  103. sideLen: 8,
  104. backLen: 7,
  105. overhead: 4,
  106. outlineBase: 1,
  107. outlineMax: 1.75
  108. },
  109. arrow3: {
  110. elmId: "leader-line-arrow3",
  111. bBox: {
  112. left: -4,
  113. top: -5,
  114. width: 12,
  115. height: 10,
  116. right: 8,
  117. bottom: 5
  118. },
  119. widthR: 3,
  120. heightR: 2.5,
  121. bCircle: 8,
  122. sideLen: 5,
  123. backLen: 4,
  124. overhead: 8,
  125. outlineBase: 1,
  126. outlineMax: 2.5
  127. },
  128. hand: {
  129. elmId: "leader-line-hand",
  130. bBox: {
  131. left: -3,
  132. top: -12,
  133. width: 40,
  134. height: 24,
  135. right: 37,
  136. bottom: 12
  137. },
  138. widthR: 10,
  139. heightR: 6,
  140. bCircle: 37,
  141. sideLen: 12,
  142. backLen: 3,
  143. overhead: 37
  144. },
  145. crosshair: {
  146. elmId: "leader-line-crosshair",
  147. noRotate: !0,
  148. bBox: {
  149. left: -96,
  150. top: -96,
  151. width: 192,
  152. height: 192,
  153. right: 96,
  154. bottom: 96
  155. },
  156. widthR: 48,
  157. heightR: 48,
  158. bCircle: 96,
  159. sideLen: 96,
  160. backLen: 96,
  161. overhead: 0
  162. }
  163. },
  164. E = {
  165. behind: ne,
  166. disc: "disc",
  167. square: "square",
  168. arrow1: "arrow1",
  169. arrow2: "arrow2",
  170. arrow3: "arrow3",
  171. hand: "hand",
  172. crosshair: "crosshair"
  173. },
  174. ie = {
  175. disc: "disc",
  176. square: "square",
  177. arrow1: "arrow1",
  178. arrow2: "arrow2",
  179. arrow3: "arrow3",
  180. hand: "hand",
  181. crosshair: "crosshair"
  182. },
  183. W = [M, I, C, L],
  184. x = "auto",
  185. oe = {
  186. x: "left",
  187. y: "top",
  188. width: "width",
  189. height: "height"
  190. },
  191. B = 80,
  192. R = 4,
  193. F = 5,
  194. G = 120,
  195. D = 8,
  196. z = 3.75,
  197. j = 10,
  198. H = 30,
  199. U = .5522847,
  200. Z = .25 * Math.PI,
  201. u = /^\s*(\-?[\d\.]+)\s*(\%)?\s*$/,
  202. b = "http://www.w3.org/2000/svg",
  203. e = "-ms-scroll-limit" in document.documentElement.style && "-ms-ime-align" in document.documentElement.style && !window.navigator.msPointerEnabled,
  204. le = !e && !!document.uniqueID,
  205. re = "MozAppearance" in document.documentElement.style,
  206. se = !(e || re || !window.chrome || !window.CSS),
  207. ue = !e && !le && !re && !se && !window.chrome && "WebkitAppearance" in document.documentElement.style,
  208. he = le || e ? .2 : .1,
  209. pe = {
  210. path: P,
  211. lineColor: "coral",
  212. lineSize: 4,
  213. plugSE: [ne, "arrow1"],
  214. plugSizeSE: [1, 1],
  215. lineOutlineEnabled: !1,
  216. lineOutlineColor: "indianred",
  217. lineOutlineSize: .25,
  218. plugOutlineEnabledSE: [!1, !1],
  219. plugOutlineSizeSE: [1, 1]
  220. },
  221. k = (a = {}.toString, i = {}.hasOwnProperty.toString, l = i.call(Object), function (e) {
  222. var t, n;
  223. return e && "[object Object]" === a.call(e) && (!(t = Object.getPrototypeOf(e)) || (n = t.hasOwnProperty("constructor") && t.constructor) && "function" == typeof n && i.call(n) === l)
  224. }),
  225. w = Number.isFinite || function (e) {
  226. return "number" == typeof e && window.isFinite(e)
  227. },
  228. c = function () {
  229. var e, x = {
  230. ease: [.25, .1, .25, 1],
  231. linear: [0, 0, 1, 1],
  232. "ease-in": [.42, 0, 1, 1],
  233. "ease-out": [0, 0, .58, 1],
  234. "ease-in-out": [.42, 0, .58, 1]
  235. },
  236. b = 1e3 / 60 / 2,
  237. t = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame || function (e) {
  238. setTimeout(e, b)
  239. },
  240. n = window.cancelAnimationFrame || window.mozCancelAnimationFrame || window.webkitCancelAnimationFrame || window.msCancelAnimationFrame || function (e) {
  241. clearTimeout(e)
  242. },
  243. a = Number.isFinite || function (e) {
  244. return "number" == typeof e && window.isFinite(e)
  245. },
  246. k = [],
  247. w = 0;
  248. function l() {
  249. var i = Date.now(),
  250. o = !1;
  251. e && (n.call(window, e), e = null), k.forEach(function (e) {
  252. var t, n, a;
  253. if (e.framesStart) {
  254. if ((t = i - e.framesStart) >= e.duration && e.count && e.loopsLeft <= 1) return a = e.frames[e.lastFrame = e.reverse ? 0 : e.frames.length - 1], e.frameCallback(a.value, !0, a.timeRatio, a.outputRatio), void (e.framesStart = null);
  255. if (t > e.duration) {
  256. if (n = Math.floor(t / e.duration), e.count) {
  257. if (n >= e.loopsLeft) return a = e.frames[e.lastFrame = e.reverse ? 0 : e.frames.length - 1], e.frameCallback(a.value, !0, a.timeRatio, a.outputRatio), void (e.framesStart = null);
  258. e.loopsLeft -= n
  259. }
  260. e.framesStart += e.duration * n, t = i - e.framesStart
  261. }
  262. e.reverse && (t = e.duration - t), a = e.frames[e.lastFrame = Math.round(t / b)], !1 !== e.frameCallback(a.value, !1, a.timeRatio, a.outputRatio) ? o = !0 : e.framesStart = null
  263. }
  264. }), o && (e = t.call(window, l))
  265. }
  266. function O(e, t) {
  267. e.framesStart = Date.now(), null != t && (e.framesStart -= e.duration * (e.reverse ? 1 - t : t)), e.loopsLeft = e.count, e.lastFrame = null, l()
  268. }
  269. return {
  270. add: function (n, e, t, a, i, o, l) {
  271. var r, s, u, h, p, c, d, f, y, S, m, g, _, v = ++w;
  272. function E(e, t) {
  273. return {
  274. value: n(t),
  275. timeRatio: e,
  276. outputRatio: t
  277. }
  278. }
  279. if ("string" == typeof i && (i = x[i]), n = n || function () { }, t < b) s = [E(0, 0), E(1, 1)];
  280. else {
  281. if (u = b / t, s = [E(0, 0)], 0 === i[0] && 0 === i[1] && 1 === i[2] && 1 === i[3])
  282. for (p = u; p <= 1; p += u) s.push(E(p, p));
  283. else
  284. for (c = h = (p = u) / 10; c <= 1; c += h) void 0, S = (y = (f = c) * f) * f, _ = 3 * (m = 1 - f) * y, p <= (d = {
  285. x: (g = 3 * (m * m) * f) * i[0] + _ * i[2] + S,
  286. y: g * i[1] + _ * i[3] + S
  287. }).x && (s.push(E(d.x, d.y)), p += u);
  288. s.push(E(1, 1))
  289. }
  290. return r = {
  291. animId: v,
  292. frameCallback: e,
  293. duration: t,
  294. count: a,
  295. frames: s,
  296. reverse: !!o
  297. }, k.push(r), !1 !== l && O(r, l), v
  298. },
  299. remove: function (n) {
  300. var a;
  301. k.some(function (e, t) {
  302. return e.animId === n && (a = t, !(e.framesStart = null))
  303. }) && k.splice(a, 1)
  304. },
  305. start: function (t, n, a) {
  306. k.some(function (e) {
  307. return e.animId === t && (e.reverse = !!n, O(e, a), !0)
  308. })
  309. },
  310. stop: function (t, n) {
  311. var a;
  312. return k.some(function (e) {
  313. return e.animId === t && (n ? null != e.lastFrame && (a = e.frames[e.lastFrame].timeRatio) : (a = (Date.now() - e.framesStart) / e.duration, e.reverse && (a = 1 - a), a < 0 ? a = 0 : 1 < a && (a = 1)), !(e.framesStart = null))
  314. }), a
  315. },
  316. validTiming: function (t) {
  317. return "string" == typeof t ? x[t] : Array.isArray(t) && [0, 1, 2, 3].every(function (e) {
  318. return a(t[e]) && 0 <= t[e] && t[e] <= 1
  319. }) ? [t[0], t[1], t[2], t[3]] : null
  320. }
  321. }
  322. }(),
  323. d = function (e) {
  324. e.SVGPathElement.prototype.getPathData && e.SVGPathElement.prototype.setPathData || function () {
  325. var i = {
  326. Z: "Z",
  327. M: "M",
  328. L: "L",
  329. C: "C",
  330. Q: "Q",
  331. A: "A",
  332. H: "H",
  333. V: "V",
  334. S: "S",
  335. T: "T",
  336. z: "Z",
  337. m: "m",
  338. l: "l",
  339. c: "c",
  340. q: "q",
  341. a: "a",
  342. h: "h",
  343. v: "v",
  344. s: "s",
  345. t: "t"
  346. },
  347. o = function (e) {
  348. this._string = e, this._currentIndex = 0, this._endIndex = this._string.length, this._prevCommand = null, this._skipOptionalSpaces()
  349. },
  350. l = -1 !== e.navigator.userAgent.indexOf("MSIE ");
  351. o.prototype = {
  352. parseSegment: function () {
  353. var e = this._string[this._currentIndex],
  354. t = i[e] ? i[e] : null;
  355. if (null === t) {
  356. if (null === this._prevCommand) return null;
  357. if (null === (t = ("+" === e || "-" === e || "." === e || "0" <= e && e <= "9") && "Z" !== this._prevCommand ? "M" === this._prevCommand ? "L" : "m" === this._prevCommand ? "l" : this._prevCommand : null)) return null
  358. } else this._currentIndex += 1;
  359. var n = null,
  360. a = (this._prevCommand = t).toUpperCase();
  361. return "H" === a || "V" === a ? n = [this._parseNumber()] : "M" === a || "L" === a || "T" === a ? n = [this._parseNumber(), this._parseNumber()] : "S" === a || "Q" === a ? n = [this._parseNumber(), this._parseNumber(), this._parseNumber(), this._parseNumber()] : "C" === a ? n = [this._parseNumber(), this._parseNumber(), this._parseNumber(), this._parseNumber(), this._parseNumber(), this._parseNumber()] : "A" === a ? n = [this._parseNumber(), this._parseNumber(), this._parseNumber(), this._parseArcFlag(), this._parseArcFlag(), this._parseNumber(), this._parseNumber()] : "Z" === a && (this._skipOptionalSpaces(), n = []), null === n || 0 <= n.indexOf(null) ? null : {
  362. type: t,
  363. values: n
  364. }
  365. },
  366. hasMoreData: function () {
  367. return this._currentIndex < this._endIndex
  368. },
  369. peekSegmentType: function () {
  370. var e = this._string[this._currentIndex];
  371. return i[e] ? i[e] : null
  372. },
  373. initialCommandIsMoveTo: function () {
  374. if (!this.hasMoreData()) return !0;
  375. var e = this.peekSegmentType();
  376. return "M" === e || "m" === e
  377. },
  378. _isCurrentSpace: function () {
  379. var e = this._string[this._currentIndex];
  380. return e <= " " && (" " === e || "\n" === e || "\t" === e || "\r" === e || "\f" === e)
  381. },
  382. _skipOptionalSpaces: function () {
  383. for (; this._currentIndex < this._endIndex && this._isCurrentSpace();) this._currentIndex += 1;
  384. return this._currentIndex < this._endIndex
  385. },
  386. _skipOptionalSpacesOrDelimiter: function () {
  387. return !(this._currentIndex < this._endIndex && !this._isCurrentSpace() && "," !== this._string[this._currentIndex]) && (this._skipOptionalSpaces() && this._currentIndex < this._endIndex && "," === this._string[this._currentIndex] && (this._currentIndex += 1, this._skipOptionalSpaces()), this._currentIndex < this._endIndex)
  388. },
  389. _parseNumber: function () {
  390. var e = 0,
  391. t = 0,
  392. n = 1,
  393. a = 0,
  394. i = 1,
  395. o = 1,
  396. l = this._currentIndex;
  397. if (this._skipOptionalSpaces(), this._currentIndex < this._endIndex && "+" === this._string[this._currentIndex] ? this._currentIndex += 1 : this._currentIndex < this._endIndex && "-" === this._string[this._currentIndex] && (this._currentIndex += 1, i = -1), this._currentIndex === this._endIndex || (this._string[this._currentIndex] < "0" || "9" < this._string[this._currentIndex]) && "." !== this._string[this._currentIndex]) return null;
  398. for (var r = this._currentIndex; this._currentIndex < this._endIndex && "0" <= this._string[this._currentIndex] && this._string[this._currentIndex] <= "9";) this._currentIndex += 1;
  399. if (this._currentIndex !== r)
  400. for (var s = this._currentIndex - 1, u = 1; r <= s;) t += u * (this._string[s] - "0"), s -= 1, u *= 10;
  401. if (this._currentIndex < this._endIndex && "." === this._string[this._currentIndex]) {
  402. if (this._currentIndex += 1, this._currentIndex >= this._endIndex || this._string[this._currentIndex] < "0" || "9" < this._string[this._currentIndex]) return null;
  403. for (; this._currentIndex < this._endIndex && "0" <= this._string[this._currentIndex] && this._string[this._currentIndex] <= "9";) n *= 10, a += (this._string.charAt(this._currentIndex) - "0") / n, this._currentIndex += 1
  404. }
  405. if (this._currentIndex !== l && this._currentIndex + 1 < this._endIndex && ("e" === this._string[this._currentIndex] || "E" === this._string[this._currentIndex]) && "x" !== this._string[this._currentIndex + 1] && "m" !== this._string[this._currentIndex + 1]) {
  406. if (this._currentIndex += 1, "+" === this._string[this._currentIndex] ? this._currentIndex += 1 : "-" === this._string[this._currentIndex] && (this._currentIndex += 1, o = -1), this._currentIndex >= this._endIndex || this._string[this._currentIndex] < "0" || "9" < this._string[this._currentIndex]) return null;
  407. for (; this._currentIndex < this._endIndex && "0" <= this._string[this._currentIndex] && this._string[this._currentIndex] <= "9";) e *= 10, e += this._string[this._currentIndex] - "0", this._currentIndex += 1
  408. }
  409. var h = t + a;
  410. return h *= i, e && (h *= Math.pow(10, o * e)), l === this._currentIndex ? null : (this._skipOptionalSpacesOrDelimiter(), h)
  411. },
  412. _parseArcFlag: function () {
  413. if (this._currentIndex >= this._endIndex) return null;
  414. var e = null,
  415. t = this._string[this._currentIndex];
  416. if (this._currentIndex += 1, "0" === t) e = 0;
  417. else {
  418. if ("1" !== t) return null;
  419. e = 1
  420. }
  421. return this._skipOptionalSpacesOrDelimiter(), e
  422. }
  423. };
  424. var a = function (e) {
  425. if (!e || 0 === e.length) return [];
  426. var t = new o(e),
  427. n = [];
  428. if (t.initialCommandIsMoveTo())
  429. for (; t.hasMoreData();) {
  430. var a = t.parseSegment();
  431. if (null === a) break;
  432. n.push(a)
  433. }
  434. return n
  435. },
  436. n = e.SVGPathElement.prototype.setAttribute,
  437. r = e.SVGPathElement.prototype.removeAttribute,
  438. d = e.Symbol ? e.Symbol() : "__cachedPathData",
  439. f = e.Symbol ? e.Symbol() : "__cachedNormalizedPathData",
  440. U = function (e, t, n, a, i, o, l, r, s, u) {
  441. var h, p, c, d, f, y = function (e, t, n) {
  442. return {
  443. x: e * Math.cos(n) - t * Math.sin(n),
  444. y: e * Math.sin(n) + t * Math.cos(n)
  445. }
  446. },
  447. S = (h = l, Math.PI * h / 180),
  448. m = [];
  449. if (u) p = u[0], c = u[1], d = u[2], f = u[3];
  450. else {
  451. var g = y(e, t, -S);
  452. e = g.x, t = g.y;
  453. var _ = y(n, a, -S),
  454. v = (e - (n = _.x)) / 2,
  455. E = (t - (a = _.y)) / 2,
  456. x = v * v / (i * i) + E * E / (o * o);
  457. 1 < x && (i *= x = Math.sqrt(x), o *= x);
  458. var b = i * i,
  459. k = o * o,
  460. w = b * k - b * E * E - k * v * v,
  461. O = b * E * E + k * v * v,
  462. M = (r === s ? -1 : 1) * Math.sqrt(Math.abs(w / O));
  463. d = M * i * E / o + (e + n) / 2, f = M * -o * v / i + (t + a) / 2, p = Math.asin(parseFloat(((t - f) / o).toFixed(9))), c = Math.asin(parseFloat(((a - f) / o).toFixed(9))), e < d && (p = Math.PI - p), n < d && (c = Math.PI - c), p < 0 && (p = 2 * Math.PI + p), c < 0 && (c = 2 * Math.PI + c), s && c < p && (p -= 2 * Math.PI), !s && p < c && (c -= 2 * Math.PI)
  464. }
  465. var I = c - p;
  466. if (Math.abs(I) > 120 * Math.PI / 180) {
  467. var C = c,
  468. L = n,
  469. A = a;
  470. c = s && p < c ? p + 120 * Math.PI / 180 * 1 : p + 120 * Math.PI / 180 * -1, n = d + i * Math.cos(c), a = f + o * Math.sin(c), m = U(n, a, L, A, i, o, l, 0, s, [c, C, d, f])
  471. }
  472. I = c - p;
  473. var V = Math.cos(p),
  474. P = Math.sin(p),
  475. N = Math.cos(c),
  476. T = Math.sin(c),
  477. W = Math.tan(I / 4),
  478. B = 4 / 3 * i * W,
  479. R = 4 / 3 * o * W,
  480. F = [e, t],
  481. G = [e + B * P, t - R * V],
  482. D = [n + B * T, a - R * N],
  483. z = [n, a];
  484. if (G[0] = 2 * F[0] - G[0], G[1] = 2 * F[1] - G[1], u) return [G, D, z].concat(m);
  485. m = [G, D, z].concat(m).join().split(",");
  486. var j = [],
  487. H = [];
  488. return m.forEach(function (e, t) {
  489. t % 2 ? H.push(y(m[t - 1], m[t], S).y) : H.push(y(m[t], m[t + 1], S).x), 6 === H.length && (j.push(H), H = [])
  490. }), j
  491. },
  492. y = function (e) {
  493. return e.map(function (e) {
  494. return {
  495. type: e.type,
  496. values: Array.prototype.slice.call(e.values)
  497. }
  498. })
  499. },
  500. S = function (e) {
  501. var S = [],
  502. m = null,
  503. g = null,
  504. _ = null,
  505. v = null,
  506. E = null,
  507. x = null,
  508. b = null;
  509. return e.forEach(function (e) {
  510. if ("M" === e.type) {
  511. var t = e.values[0],
  512. n = e.values[1];
  513. S.push({
  514. type: "M",
  515. values: [t, n]
  516. }), v = x = t, E = b = n
  517. } else if ("C" === e.type) {
  518. var a = e.values[0],
  519. i = e.values[1],
  520. o = e.values[2],
  521. l = e.values[3];
  522. t = e.values[4], n = e.values[5];
  523. S.push({
  524. type: "C",
  525. values: [a, i, o, l, t, n]
  526. }), g = o, _ = l, v = t, E = n
  527. } else if ("L" === e.type) {
  528. t = e.values[0], n = e.values[1];
  529. S.push({
  530. type: "L",
  531. values: [t, n]
  532. }), v = t, E = n
  533. } else if ("H" === e.type) {
  534. t = e.values[0];
  535. S.push({
  536. type: "L",
  537. values: [t, E]
  538. }), v = t
  539. } else if ("V" === e.type) {
  540. n = e.values[0];
  541. S.push({
  542. type: "L",
  543. values: [v, n]
  544. }), E = n
  545. } else if ("S" === e.type) {
  546. o = e.values[0], l = e.values[1], t = e.values[2], n = e.values[3];
  547. "C" === m || "S" === m ? (r = v + (v - g), s = E + (E - _)) : (r = v, s = E), S.push({
  548. type: "C",
  549. values: [r, s, o, l, t, n]
  550. }), g = o, _ = l, v = t, E = n
  551. } else if ("T" === e.type) {
  552. t = e.values[0], n = e.values[1];
  553. "Q" === m || "T" === m ? (a = v + (v - g), i = E + (E - _)) : (a = v, i = E);
  554. var r = v + 2 * (a - v) / 3,
  555. s = E + 2 * (i - E) / 3,
  556. u = t + 2 * (a - t) / 3,
  557. h = n + 2 * (i - n) / 3;
  558. S.push({
  559. type: "C",
  560. values: [r, s, u, h, t, n]
  561. }), g = a, _ = i, v = t, E = n
  562. } else if ("Q" === e.type) {
  563. a = e.values[0], i = e.values[1], t = e.values[2], n = e.values[3], r = v + 2 * (a - v) / 3, s = E + 2 * (i - E) / 3, u = t + 2 * (a - t) / 3, h = n + 2 * (i - n) / 3;
  564. S.push({
  565. type: "C",
  566. values: [r, s, u, h, t, n]
  567. }), g = a, _ = i, v = t, E = n
  568. } else if ("A" === e.type) {
  569. var p = e.values[0],
  570. c = e.values[1],
  571. d = e.values[2],
  572. f = e.values[3],
  573. y = e.values[4];
  574. t = e.values[5], n = e.values[6];
  575. if (0 === p || 0 === c) S.push({
  576. type: "C",
  577. values: [v, E, t, n, t, n]
  578. }), v = t, E = n;
  579. else if (v !== t || E !== n) U(v, E, t, n, p, c, d, f, y).forEach(function (e) {
  580. S.push({
  581. type: "C",
  582. values: e
  583. }), v = t, E = n
  584. })
  585. } else "Z" === e.type && (S.push(e), v = x, E = b);
  586. m = e.type
  587. }), S
  588. };
  589. e.SVGPathElement.prototype.setAttribute = function (e, t) {
  590. "d" === e && (this[d] = null, this[f] = null), n.call(this, e, t)
  591. }, e.SVGPathElement.prototype.removeAttribute = function (e, t) {
  592. "d" === e && (this[d] = null, this[f] = null), r.call(this, e)
  593. }, e.SVGPathElement.prototype.getPathData = function (e) {
  594. if (e && e.normalize) {
  595. if (this[f]) return y(this[f]);
  596. this[d] ? n = y(this[d]) : (n = a(this.getAttribute("d") || ""), this[d] = y(n));
  597. var t = S((s = [], c = p = h = u = null, n.forEach(function (e) {
  598. var t = e.type;
  599. if ("M" === t) {
  600. var n = e.values[0],
  601. a = e.values[1];
  602. s.push({
  603. type: "M",
  604. values: [n, a]
  605. }), u = p = n, h = c = a
  606. } else if ("m" === t) n = u + e.values[0], a = h + e.values[1], s.push({
  607. type: "M",
  608. values: [n, a]
  609. }), u = p = n, h = c = a;
  610. else if ("L" === t) n = e.values[0], a = e.values[1], s.push({
  611. type: "L",
  612. values: [n, a]
  613. }), u = n, h = a;
  614. else if ("l" === t) n = u + e.values[0], a = h + e.values[1], s.push({
  615. type: "L",
  616. values: [n, a]
  617. }), u = n, h = a;
  618. else if ("C" === t) {
  619. var i = e.values[0],
  620. o = e.values[1],
  621. l = e.values[2],
  622. r = e.values[3];
  623. n = e.values[4], a = e.values[5], s.push({
  624. type: "C",
  625. values: [i, o, l, r, n, a]
  626. }), u = n, h = a
  627. } else "c" === t ? (i = u + e.values[0], o = h + e.values[1], l = u + e.values[2], r = h + e.values[3], n = u + e.values[4], a = h + e.values[5], s.push({
  628. type: "C",
  629. values: [i, o, l, r, n, a]
  630. }), u = n, h = a) : "Q" === t ? (i = e.values[0], o = e.values[1], n = e.values[2], a = e.values[3], s.push({
  631. type: "Q",
  632. values: [i, o, n, a]
  633. }), u = n, h = a) : "q" === t ? (i = u + e.values[0], o = h + e.values[1], n = u + e.values[2], a = h + e.values[3], s.push({
  634. type: "Q",
  635. values: [i, o, n, a]
  636. }), u = n, h = a) : "A" === t ? (n = e.values[5], a = e.values[6], s.push({
  637. type: "A",
  638. values: [e.values[0], e.values[1], e.values[2], e.values[3], e.values[4], n, a]
  639. }), u = n, h = a) : "a" === t ? (n = u + e.values[5], a = h + e.values[6], s.push({
  640. type: "A",
  641. values: [e.values[0], e.values[1], e.values[2], e.values[3], e.values[4], n, a]
  642. }), u = n, h = a) : "H" === t ? (n = e.values[0], s.push({
  643. type: "H",
  644. values: [n]
  645. }), u = n) : "h" === t ? (n = u + e.values[0], s.push({
  646. type: "H",
  647. values: [n]
  648. }), u = n) : "V" === t ? (a = e.values[0], s.push({
  649. type: "V",
  650. values: [a]
  651. }), h = a) : "v" === t ? (a = h + e.values[0], s.push({
  652. type: "V",
  653. values: [a]
  654. }), h = a) : "S" === t ? (l = e.values[0], r = e.values[1], n = e.values[2], a = e.values[3], s.push({
  655. type: "S",
  656. values: [l, r, n, a]
  657. }), u = n, h = a) : "s" === t ? (l = u + e.values[0], r = h + e.values[1], n = u + e.values[2], a = h + e.values[3], s.push({
  658. type: "S",
  659. values: [l, r, n, a]
  660. }), u = n, h = a) : "T" === t ? (n = e.values[0], a = e.values[1], s.push({
  661. type: "T",
  662. values: [n, a]
  663. }), u = n, h = a) : "t" === t ? (n = u + e.values[0], a = h + e.values[1], s.push({
  664. type: "T",
  665. values: [n, a]
  666. }), u = n, h = a) : "Z" !== t && "z" !== t || (s.push({
  667. type: "Z",
  668. values: []
  669. }), u = p, h = c)
  670. }), s));
  671. return this[f] = y(t), t
  672. }
  673. if (this[d]) return y(this[d]);
  674. var s, u, h, p, c, n = a(this.getAttribute("d") || "");
  675. return this[d] = y(n), n
  676. }, e.SVGPathElement.prototype.setPathData = function (e) {
  677. if (0 === e.length) l ? this.setAttribute("d", "") : this.removeAttribute("d");
  678. else {
  679. for (var t = "", n = 0, a = e.length; n < a; n += 1) {
  680. var i = e[n];
  681. 0 < n && (t += " "), t += i.type, i.values && 0 < i.values.length && (t += " " + i.values.join(" "))
  682. }
  683. this.setAttribute("d", t)
  684. }
  685. }, e.SVGRectElement.prototype.getPathData = function (e) {
  686. var t = this.x.baseVal.value,
  687. n = this.y.baseVal.value,
  688. a = this.width.baseVal.value,
  689. i = this.height.baseVal.value,
  690. o = this.hasAttribute("rx") ? this.rx.baseVal.value : this.ry.baseVal.value,
  691. l = this.hasAttribute("ry") ? this.ry.baseVal.value : this.rx.baseVal.value;
  692. a / 2 < o && (o = a / 2), i / 2 < l && (l = i / 2);
  693. var r = [{
  694. type: "M",
  695. values: [t + o, n]
  696. }, {
  697. type: "H",
  698. values: [t + a - o]
  699. }, {
  700. type: "A",
  701. values: [o, l, 0, 0, 1, t + a, n + l]
  702. }, {
  703. type: "V",
  704. values: [n + i - l]
  705. }, {
  706. type: "A",
  707. values: [o, l, 0, 0, 1, t + a - o, n + i]
  708. }, {
  709. type: "H",
  710. values: [t + o]
  711. }, {
  712. type: "A",
  713. values: [o, l, 0, 0, 1, t, n + i - l]
  714. }, {
  715. type: "V",
  716. values: [n + l]
  717. }, {
  718. type: "A",
  719. values: [o, l, 0, 0, 1, t + o, n]
  720. }, {
  721. type: "Z",
  722. values: []
  723. }];
  724. return r = r.filter(function (e) {
  725. return "A" !== e.type || 0 !== e.values[0] && 0 !== e.values[1]
  726. }), e && !0 === e.normalize && (r = S(r)), r
  727. }, e.SVGCircleElement.prototype.getPathData = function (e) {
  728. var t = this.cx.baseVal.value,
  729. n = this.cy.baseVal.value,
  730. a = this.r.baseVal.value,
  731. i = [{
  732. type: "M",
  733. values: [t + a, n]
  734. }, {
  735. type: "A",
  736. values: [a, a, 0, 0, 1, t, n + a]
  737. }, {
  738. type: "A",
  739. values: [a, a, 0, 0, 1, t - a, n]
  740. }, {
  741. type: "A",
  742. values: [a, a, 0, 0, 1, t, n - a]
  743. }, {
  744. type: "A",
  745. values: [a, a, 0, 0, 1, t + a, n]
  746. }, {
  747. type: "Z",
  748. values: []
  749. }];
  750. return e && !0 === e.normalize && (i = S(i)), i
  751. }, e.SVGEllipseElement.prototype.getPathData = function (e) {
  752. var t = this.cx.baseVal.value,
  753. n = this.cy.baseVal.value,
  754. a = this.rx.baseVal.value,
  755. i = this.ry.baseVal.value,
  756. o = [{
  757. type: "M",
  758. values: [t + a, n]
  759. }, {
  760. type: "A",
  761. values: [a, i, 0, 0, 1, t, n + i]
  762. }, {
  763. type: "A",
  764. values: [a, i, 0, 0, 1, t - a, n]
  765. }, {
  766. type: "A",
  767. values: [a, i, 0, 0, 1, t, n - i]
  768. }, {
  769. type: "A",
  770. values: [a, i, 0, 0, 1, t + a, n]
  771. }, {
  772. type: "Z",
  773. values: []
  774. }];
  775. return e && !0 === e.normalize && (o = S(o)), o
  776. }, e.SVGLineElement.prototype.getPathData = function () {
  777. return [{
  778. type: "M",
  779. values: [this.x1.baseVal.value, this.y1.baseVal.value]
  780. }, {
  781. type: "L",
  782. values: [this.x2.baseVal.value, this.y2.baseVal.value]
  783. }]
  784. }, e.SVGPolylineElement.prototype.getPathData = function () {
  785. for (var e = [], t = 0; t < this.points.numberOfItems; t += 1) {
  786. var n = this.points.getItem(t);
  787. e.push({
  788. type: 0 === t ? "M" : "L",
  789. values: [n.x, n.y]
  790. })
  791. }
  792. return e
  793. }, e.SVGPolygonElement.prototype.getPathData = function () {
  794. for (var e = [], t = 0; t < this.points.numberOfItems; t += 1) {
  795. var n = this.points.getItem(t);
  796. e.push({
  797. type: 0 === t ? "M" : "L",
  798. values: [n.x, n.y]
  799. })
  800. }
  801. return e.push({
  802. type: "Z",
  803. values: []
  804. }), e
  805. }
  806. }()
  807. },
  808. O = function (n) {
  809. var a = {};
  810. function i(e) {
  811. if (a[e]) return a[e].exports;
  812. var t = a[e] = {
  813. i: e,
  814. l: !1,
  815. exports: {}
  816. };
  817. return n[e].call(t.exports, t, t.exports, i), t.l = !0, t.exports
  818. }
  819. return i.m = n, i.c = a, i.d = function (e, t, n) {
  820. i.o(e, t) || Object.defineProperty(e, t, {
  821. configurable: !1,
  822. enumerable: !0,
  823. get: n
  824. })
  825. }, i.r = function (e) {
  826. Object.defineProperty(e, "__esModule", {
  827. value: !0
  828. })
  829. }, i.n = function (e) {
  830. var t = e && e.__esModule ? function () {
  831. return e.default
  832. } : function () {
  833. return e
  834. };
  835. return i.d(t, "a", t), t
  836. }, i.o = function (e, t) {
  837. return Object.prototype.hasOwnProperty.call(e, t)
  838. }, i.p = "", i(i.s = 0)
  839. }([function (e, t, n) {
  840. n.r(t);
  841. var a = 500,
  842. i = [],
  843. o = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame || function (e) {
  844. return setTimeout(e, 1e3 / 60)
  845. },
  846. l = window.cancelAnimationFrame || window.mozCancelAnimationFrame || window.webkitCancelAnimationFrame || window.msCancelAnimationFrame || function (e) {
  847. return clearTimeout(e)
  848. },
  849. r = void 0,
  850. s = Date.now();
  851. function u() {
  852. var t = void 0,
  853. e = void 0;
  854. r && (l.call(window, r), r = null), i.forEach(function (e) {
  855. e.event && (e.listener(e.event), e.event = null, t = !0)
  856. }), t ? (s = Date.now(), e = !0) : Date.now() - s < a && (e = !0), e && (r = o.call(window, u))
  857. }
  858. function h(n) {
  859. var a = -1;
  860. return i.some(function (e, t) {
  861. return e.listener === n && (a = t, !0)
  862. }), a
  863. }
  864. var p = {
  865. add: function (e) {
  866. var t = void 0;
  867. return -1 === h(e) ? (i.push(t = {
  868. listener: e
  869. }), function (e) {
  870. t.event = e, r || u()
  871. }) : null
  872. },
  873. remove: function (e) {
  874. var t; - 1 < (t = h(e)) && (i.splice(t, 1), !i.length && r && (l.call(window, r), r = null))
  875. }
  876. };
  877. t.default = p
  878. }]).default,
  879. Y = {
  880. line_altColor: {
  881. iniValue: !1
  882. },
  883. line_color: {},
  884. line_colorTra: {
  885. iniValue: !1
  886. },
  887. line_strokeWidth: {},
  888. plug_enabled: {
  889. iniValue: !1
  890. },
  891. plug_enabledSE: {
  892. hasSE: !0,
  893. iniValue: !1
  894. },
  895. plug_plugSE: {
  896. hasSE: !0,
  897. iniValue: ne
  898. },
  899. plug_colorSE: {
  900. hasSE: !0
  901. },
  902. plug_colorTraSE: {
  903. hasSE: !0,
  904. iniValue: !1
  905. },
  906. plug_markerWidthSE: {
  907. hasSE: !0
  908. },
  909. plug_markerHeightSE: {
  910. hasSE: !0
  911. },
  912. lineOutline_enabled: {
  913. iniValue: !1
  914. },
  915. lineOutline_color: {},
  916. lineOutline_colorTra: {
  917. iniValue: !1
  918. },
  919. lineOutline_strokeWidth: {},
  920. lineOutline_inStrokeWidth: {},
  921. plugOutline_enabledSE: {
  922. hasSE: !0,
  923. iniValue: !1
  924. },
  925. plugOutline_plugSE: {
  926. hasSE: !0,
  927. iniValue: ne
  928. },
  929. plugOutline_colorSE: {
  930. hasSE: !0
  931. },
  932. plugOutline_colorTraSE: {
  933. hasSE: !0,
  934. iniValue: !1
  935. },
  936. plugOutline_strokeWidthSE: {
  937. hasSE: !0
  938. },
  939. plugOutline_inStrokeWidthSE: {
  940. hasSE: !0
  941. },
  942. position_socketXYSE: {
  943. hasSE: !0,
  944. hasProps: !0
  945. },
  946. position_plugOverheadSE: {
  947. hasSE: !0
  948. },
  949. position_path: {},
  950. position_lineStrokeWidth: {},
  951. position_socketGravitySE: {
  952. hasSE: !0
  953. },
  954. path_pathData: {},
  955. path_edge: {
  956. hasProps: !0
  957. },
  958. viewBox_bBox: {
  959. hasProps: !0
  960. },
  961. viewBox_plugBCircleSE: {
  962. hasSE: !0
  963. },
  964. lineMask_enabled: {
  965. iniValue: !1
  966. },
  967. lineMask_outlineMode: {
  968. iniValue: !1
  969. },
  970. lineMask_x: {},
  971. lineMask_y: {},
  972. lineOutlineMask_x: {},
  973. lineOutlineMask_y: {},
  974. maskBGRect_x: {},
  975. maskBGRect_y: {},
  976. capsMaskAnchor_enabledSE: {
  977. hasSE: !0,
  978. iniValue: !1
  979. },
  980. capsMaskAnchor_pathDataSE: {
  981. hasSE: !0
  982. },
  983. capsMaskAnchor_strokeWidthSE: {
  984. hasSE: !0
  985. },
  986. capsMaskMarker_enabled: {
  987. iniValue: !1
  988. },
  989. capsMaskMarker_enabledSE: {
  990. hasSE: !0,
  991. iniValue: !1
  992. },
  993. capsMaskMarker_plugSE: {
  994. hasSE: !0,
  995. iniValue: ne
  996. },
  997. capsMaskMarker_markerWidthSE: {
  998. hasSE: !0
  999. },
  1000. capsMaskMarker_markerHeightSE: {
  1001. hasSE: !0
  1002. },
  1003. caps_enabled: {
  1004. iniValue: !1
  1005. },
  1006. attach_plugSideLenSE: {
  1007. hasSE: !0
  1008. },
  1009. attach_plugBackLenSE: {
  1010. hasSE: !0
  1011. }
  1012. },
  1013. X = {
  1014. show_on: {},
  1015. show_effect: {},
  1016. show_animOptions: {},
  1017. show_animId: {},
  1018. show_inAnim: {}
  1019. },
  1020. q = "fade",
  1021. Q = [],
  1022. K = {},
  1023. J = 0,
  1024. $ = {},
  1025. ee = 0;
  1026. function ce(t, n) {
  1027. var e, a;
  1028. return typeof t != typeof n || (e = k(t) ? "obj" : Array.isArray(t) ? "array" : "") != (k(n) ? "obj" : Array.isArray(n) ? "array" : "") || ("obj" === e ? ce(a = Object.keys(t).sort(), Object.keys(n).sort()) || a.some(function (e) {
  1029. return ce(t[e], n[e])
  1030. }) : "array" === e ? t.length !== n.length || t.some(function (e, t) {
  1031. return ce(e, n[t])
  1032. }) : t !== n)
  1033. }
  1034. function de(n) {
  1035. return n ? k(n) ? Object.keys(n).reduce(function (e, t) {
  1036. return e[t] = de(n[t]), e
  1037. }, {}) : Array.isArray(n) ? n.map(de) : n : n
  1038. }
  1039. function fe(e) {
  1040. var t, n, a, i = 1,
  1041. o = e = (e + "").trim();
  1042. function l(e) {
  1043. var t = 1,
  1044. n = u.exec(e);
  1045. return n && (t = parseFloat(n[1]), n[2] ? t = 0 <= t && t <= 100 ? t / 100 : 1 : (t < 0 || 1 < t) && (t = 1)), t
  1046. }
  1047. return (t = /^(rgba|hsla|hwb|gray|device\-cmyk)\s*\(([\s\S]+)\)$/i.exec(e)) ? (n = t[1].toLowerCase(), a = t[2].trim().split(/\s*,\s*/), "rgba" === n && 4 === a.length ? (i = l(a[3]), o = "rgb(" + a.slice(0, 3).join(", ") + ")") : "hsla" === n && 4 === a.length ? (i = l(a[3]), o = "hsl(" + a.slice(0, 3).join(", ") + ")") : "hwb" === n && 4 === a.length ? (i = l(a[3]), o = "hwb(" + a.slice(0, 3).join(", ") + ")") : "gray" === n && 2 === a.length ? (i = l(a[1]), o = "gray(" + a[0] + ")") : "device-cmyk" === n && 5 <= a.length && (i = l(a[4]), o = "device-cmyk(" + a.slice(0, 4).join(", ") + ")")) : (t = /^\#(?:([\da-f]{6})([\da-f]{2})|([\da-f]{3})([\da-f]))$/i.exec(e)) ? t[1] ? (i = parseInt(t[2], 16) / 255, o = "#" + t[1]) : (i = parseInt(t[4] + t[4], 16) / 255, o = "#" + t[3]) : "transparent" === e.toLocaleLowerCase() && (i = 0), [i, o]
  1048. }
  1049. function ye(e) {
  1050. return !(!e || e.nodeType !== Node.ELEMENT_NODE || "function" != typeof e.getBoundingClientRect)
  1051. }
  1052. function Se(e, t) {
  1053. var n, a, i, o, l = {};
  1054. if (!(i = e.ownerDocument)) return console.error("Cannot get document that contains the element."), null;
  1055. if (e.compareDocumentPosition(i) & Node.DOCUMENT_POSITION_DISCONNECTED) return console.error("A disconnected element was passed."), null;
  1056. for (a in n = e.getBoundingClientRect()) l[a] = n[a];
  1057. if (!t) {
  1058. if (!(o = i.defaultView)) return console.error("Cannot get window that contains the element."), null;
  1059. l.left += o.pageXOffset, l.right += o.pageXOffset, l.top += o.pageYOffset, l.bottom += o.pageYOffset
  1060. }
  1061. return l
  1062. }
  1063. function me(e, t) {
  1064. var n, a, i = [],
  1065. o = e;
  1066. for (t = t || window; ;) {
  1067. if (!(n = o.ownerDocument)) return console.error("Cannot get document that contains the element."), null;
  1068. if (!(a = n.defaultView)) return console.error("Cannot get window that contains the element."), null;
  1069. if (a === t) break;
  1070. if (!(o = a.frameElement)) return console.error("`baseWindow` was not found."), null;
  1071. i.unshift(o)
  1072. }
  1073. return i
  1074. }
  1075. function ge(e, t) {
  1076. var n, a, o = 0,
  1077. l = 0;
  1078. return (a = me(e, t = t || window)) ? a.length ? (a.forEach(function (e, t) {
  1079. var n, a, i = Se(e, 0 < t);
  1080. o += i.left, l += i.top, a = (n = e).ownerDocument.defaultView.getComputedStyle(n, ""), i = {
  1081. left: n.clientLeft + parseFloat(a.paddingLeft),
  1082. top: n.clientTop + parseFloat(a.paddingTop)
  1083. }, o += i.left, l += i.top
  1084. }), (n = Se(e, !0)).left += o, n.right += o, n.top += l, n.bottom += l, n) : Se(e) : null
  1085. }
  1086. function _e(e, t) {
  1087. var n = e.x - t.x,
  1088. a = e.y - t.y;
  1089. return Math.sqrt(n * n + a * a)
  1090. }
  1091. function ve(e, t, n) {
  1092. var a = t.x - e.x,
  1093. i = t.y - e.y;
  1094. return {
  1095. x: e.x + a * n,
  1096. y: e.y + i * n,
  1097. angle: Math.atan2(i, a) / (Math.PI / 180)
  1098. }
  1099. }
  1100. function Ee(e, t, n) {
  1101. var a = Math.atan2(e.y - t.y, t.x - e.x);
  1102. return {
  1103. x: t.x + Math.cos(a) * n,
  1104. y: t.y + Math.sin(a) * n * -1
  1105. }
  1106. }
  1107. function xe(e, t, n, a, i) {
  1108. var o = i * i,
  1109. l = o * i,
  1110. r = 1 - i,
  1111. s = r * r,
  1112. u = s * r,
  1113. h = u * e.x + 3 * s * i * t.x + 3 * r * o * n.x + l * a.x,
  1114. p = u * e.y + 3 * s * i * t.y + 3 * r * o * n.y + l * a.y,
  1115. c = e.x + 2 * i * (t.x - e.x) + o * (n.x - 2 * t.x + e.x),
  1116. d = e.y + 2 * i * (t.y - e.y) + o * (n.y - 2 * t.y + e.y),
  1117. f = t.x + 2 * i * (n.x - t.x) + o * (a.x - 2 * n.x + t.x),
  1118. y = t.y + 2 * i * (n.y - t.y) + o * (a.y - 2 * n.y + t.y),
  1119. S = r * e.x + i * t.x,
  1120. m = r * e.y + i * t.y,
  1121. g = r * n.x + i * a.x,
  1122. _ = r * n.y + i * a.y,
  1123. v = 90 - 180 * Math.atan2(c - f, d - y) / Math.PI;
  1124. return {
  1125. x: h,
  1126. y: p,
  1127. fromP2: {
  1128. x: c,
  1129. y: d
  1130. },
  1131. toP1: {
  1132. x: f,
  1133. y: y
  1134. },
  1135. fromP1: {
  1136. x: S,
  1137. y: m
  1138. },
  1139. toP2: {
  1140. x: g,
  1141. y: _
  1142. },
  1143. angle: v += 180 < v ? -180 : 180
  1144. }
  1145. }
  1146. function be(n, a, i, o, e) {
  1147. function l(e, t, n, a, i) {
  1148. return e * (e * (-3 * t + 9 * n - 9 * a + 3 * i) + 6 * t - 12 * n + 6 * a) - 3 * t + 3 * n
  1149. }
  1150. var r, s, u, h, p, c = [.2491, .2491, .2335, .2335, .2032, .2032, .1601, .1601, .1069, .1069, .0472, .0472],
  1151. d = 0;
  1152. return r = (e = null == e || 1 < e ? 1 : e < 0 ? 0 : e) / 2, [-.1252, .1252, -.3678, .3678, -.5873, .5873, -.7699, .7699, -.9041, .9041, -.9816, .9816].forEach(function (e, t) {
  1153. u = l(s = r * e + r, n.x, a.x, i.x, o.x), h = l(s, n.y, a.y, i.y, o.y), p = u * u + h * h, d += c[t] * Math.sqrt(p)
  1154. }), r * d
  1155. }
  1156. function ke(e, t, n, a, i) {
  1157. for (var o, l = .5, r = 1 - l; o = be(e, t, n, a, r), !(Math.abs(o - i) <= .01);) r += (o < i ? 1 : -1) * (l /= 2);
  1158. return r
  1159. }
  1160. function we(e, n) {
  1161. var a;
  1162. return e.forEach(function (e) {
  1163. var t = n ? e.map(function (e) {
  1164. var t = {
  1165. x: e.x,
  1166. y: e.y
  1167. };
  1168. return n(t), t
  1169. }) : e;
  1170. a || (a = [{
  1171. type: "M",
  1172. values: [t[0].x, t[0].y]
  1173. }]), a.push(t.length ? 2 === t.length ? {
  1174. type: "L",
  1175. values: [t[1].x, t[1].y]
  1176. } : {
  1177. type: "C",
  1178. values: [t[1].x, t[1].y, t[2].x, t[2].y, t[3].x, t[3].y]
  1179. } : {
  1180. type: "Z",
  1181. values: []
  1182. })
  1183. }), a
  1184. }
  1185. function Oe(e) {
  1186. var n = [],
  1187. a = 0;
  1188. return e.forEach(function (e) {
  1189. var t = (2 === e.length ? _e : be).apply(null, e);
  1190. n.push(t), a += t
  1191. }), {
  1192. segsLen: n,
  1193. lenAll: a
  1194. }
  1195. }
  1196. function Me(e, a) {
  1197. return null == e || null == a || e.length !== a.length || e.some(function (e, t) {
  1198. var n = a[t];
  1199. return e.type !== n.type || e.values.some(function (e, t) {
  1200. return e !== n.values[t]
  1201. })
  1202. })
  1203. }
  1204. function Ie(e, t, n) {
  1205. e.events[t] ? e.events[t].indexOf(n) < 0 && e.events[t].push(n) : e.events[t] = [n]
  1206. }
  1207. function Ce(e, t, n) {
  1208. var a;
  1209. e.events[t] && -1 < (a = e.events[t].indexOf(n)) && e.events[t].splice(a, 1)
  1210. }
  1211. function Le(e) {
  1212. t && clearTimeout(t), Q.push(e), t = setTimeout(function () {
  1213. Q.forEach(function (e) {
  1214. e()
  1215. }), Q = []
  1216. }, 0)
  1217. }
  1218. function Ae(e, t) {
  1219. e.reflowTargets.indexOf(t) < 0 && e.reflowTargets.push(t)
  1220. }
  1221. function Ve(e) {
  1222. e.reflowTargets.forEach(function (e) {
  1223. var n;
  1224. n = e, setTimeout(function () {
  1225. var e = n.parentNode,
  1226. t = n.nextSibling;
  1227. e.insertBefore(e.removeChild(n), t)
  1228. }, 0)
  1229. }), e.reflowTargets = []
  1230. }
  1231. function Pe(e, t, n, a, i, o, l) {
  1232. var r, s, u;
  1233. "auto-start-reverse" === n ? ("boolean" != typeof h && (t.setAttribute("orient", "auto-start-reverse"), h = t.orientType.baseVal === SVGMarkerElement.SVG_MARKER_ORIENT_UNKNOWN), h ? t.setAttribute("orient", n) : ((r = i.createSVGTransform()).setRotate(180, 0, 0), o.transform.baseVal.appendItem(r), t.setAttribute("orient", "auto"), u = !0)) : (t.setAttribute("orient", n), !1 === h && o.transform.baseVal.clear()), s = t.viewBox.baseVal, u ? (s.x = -a.right, s.y = -a.bottom) : (s.x = a.left, s.y = a.top), s.width = a.width, s.height = a.height, le && Ae(e, l)
  1234. }
  1235. function Ne(e, t) {
  1236. return {
  1237. prop: e ? "markerEnd" : "markerStart",
  1238. orient: t ? t.noRotate ? "0" : e ? "auto" : "auto-start-reverse" : null
  1239. }
  1240. }
  1241. function Te(n, a) {
  1242. Object.keys(a).forEach(function (e) {
  1243. var t = a[e];
  1244. n[e] = null != t.iniValue ? t.hasSE ? [t.iniValue, t.iniValue] : t.iniValue : t.hasSE ? t.hasProps ? [{}, {}] : [] : t.hasProps ? {} : null
  1245. })
  1246. }
  1247. function We(t, e, n, a, i) {
  1248. return a !== e[n] && (e[n] = a, i && i.forEach(function (e) {
  1249. e(t, a, n)
  1250. }), !0)
  1251. }
  1252. function Be(e) {
  1253. function t(e, t) {
  1254. return e + parseFloat(t)
  1255. }
  1256. var n = e.document,
  1257. a = e.getComputedStyle(n.documentElement, ""),
  1258. i = e.getComputedStyle(n.body, ""),
  1259. o = {
  1260. x: 0,
  1261. y: 0
  1262. };
  1263. return "static" !== i.position ? (o.x -= [a.marginLeft, a.borderLeftWidth, a.paddingLeft, i.marginLeft, i.borderLeftWidth].reduce(t, 0), o.y -= [a.marginTop, a.borderTopWidth, a.paddingTop, i.marginTop, i.borderTopWidth].reduce(t, 0)) : "static" !== a.position && (o.x -= [a.marginLeft, a.borderLeftWidth].reduce(t, 0), o.y -= [a.marginTop, a.borderTopWidth].reduce(t, 0)), o
  1264. }
  1265. function Re(e) {
  1266. var t, n = e.document;
  1267. n.getElementById(r) || (t = (new e.DOMParser).parseFromString(s, "image/svg+xml"), n.body.appendChild(t.documentElement), d(e))
  1268. }
  1269. function Fe(u) {
  1270. var _, f, v, e, n, a, i, y, s, h, p, t, o, l, r, c, d, S, m, g = u.options,
  1271. E = u.curStats,
  1272. x = u.aplStats,
  1273. b = E.position_socketXYSE,
  1274. k = !1;
  1275. function w(e, t) {
  1276. var n = t === M ? {
  1277. x: e.left + e.width / 2,
  1278. y: e.top
  1279. } : t === I ? {
  1280. x: e.right,
  1281. y: e.top + e.height / 2
  1282. } : t === C ? {
  1283. x: e.left + e.width / 2,
  1284. y: e.bottom
  1285. } : {
  1286. x: e.left,
  1287. y: e.top + e.height / 2
  1288. };
  1289. return n.socketId = t, n
  1290. }
  1291. function O(e) {
  1292. return {
  1293. x: e.x,
  1294. y: e.y
  1295. }
  1296. }
  1297. if (E.position_path = g.path, E.position_lineStrokeWidth = E.line_strokeWidth, E.position_socketGravitySE = _ = de(g.socketGravitySE), f = [0, 1].map(function (e) {
  1298. var t, n, a, i = g.anchorSE[e],
  1299. o = u.optionIsAttach.anchorSE[e],
  1300. l = !1 !== o ? $[i._id] : null,
  1301. r = !1 !== o && l.conf.getStrokeWidth ? l.conf.getStrokeWidth(l, u) : 0,
  1302. s = !1 !== o && l.conf.getBBoxNest ? l.conf.getBBoxNest(l, u, r) : ge(i, u.baseWindow);
  1303. return E.capsMaskAnchor_pathDataSE[e] = !1 !== o && l.conf.getPathData ? l.conf.getPathData(l, u, r) : (n = null != (t = s).right ? t.right : t.left + t.width, a = null != t.bottom ? t.bottom : t.top + t.height, [{
  1304. type: "M",
  1305. values: [t.left, t.top]
  1306. }, {
  1307. type: "L",
  1308. values: [n, t.top]
  1309. }, {
  1310. type: "L",
  1311. values: [n, a]
  1312. }, {
  1313. type: "L",
  1314. values: [t.left, a]
  1315. }, {
  1316. type: "Z",
  1317. values: []
  1318. }]), E.capsMaskAnchor_strokeWidthSE[e] = r, s
  1319. }), i = -1, g.socketSE[0] && g.socketSE[1] ? (b[0] = w(f[0], g.socketSE[0]), b[1] = w(f[1], g.socketSE[1])) : (g.socketSE[0] || g.socketSE[1] ? (g.socketSE[0] ? (n = 0, a = 1) : (n = 1, a = 0), b[n] = w(f[n], g.socketSE[n]), (e = W.map(function (e) {
  1320. return w(f[a], e)
  1321. })).forEach(function (e) {
  1322. var t = _e(e, b[n]);
  1323. (t < i || -1 === i) && (b[a] = e, i = t)
  1324. })) : (e = W.map(function (e) {
  1325. return w(f[1], e)
  1326. }), W.map(function (e) {
  1327. return w(f[0], e)
  1328. }).forEach(function (n) {
  1329. e.forEach(function (e) {
  1330. var t = _e(n, e);
  1331. (t < i || -1 === i) && (b[0] = n, b[1] = e, i = t)
  1332. })
  1333. })), [0, 1].forEach(function (e) {
  1334. var t, n;
  1335. g.socketSE[e] || (f[e].width || f[e].height ? f[e].width || b[e].socketId !== L && b[e].socketId !== I ? f[e].height || b[e].socketId !== M && b[e].socketId !== C || (b[e].socketId = 0 <= b[e ? 0 : 1].y - f[e].top ? C : M) : b[e].socketId = 0 <= b[e ? 0 : 1].x - f[e].left ? I : L : (t = b[e ? 0 : 1].x - f[e].left, n = b[e ? 0 : 1].y - f[e].top, b[e].socketId = Math.abs(t) >= Math.abs(n) ? 0 <= t ? I : L : 0 <= n ? C : M))
  1336. })), E.position_path !== x.position_path || E.position_lineStrokeWidth !== x.position_lineStrokeWidth || [0, 1].some(function (e) {
  1337. return E.position_plugOverheadSE[e] !== x.position_plugOverheadSE[e] || (i = b[e], o = x.position_socketXYSE[e], i.x !== o.x || i.y !== o.y || i.socketId !== o.socketId) || (t = _[e], n = x.position_socketGravitySE[e], (a = null == t ? "auto" : Array.isArray(t) ? "array" : "number") !== (null == n ? "auto" : Array.isArray(n) ? "array" : "number") || ("array" === a ? t[0] !== n[0] || t[1] !== n[1] : t !== n));
  1338. var t, n, a, i, o
  1339. })) {
  1340. switch (u.pathList.baseVal = v = [], u.pathList.animVal = null, E.position_path) {
  1341. case A:
  1342. v.push([O(b[0]), O(b[1])]);
  1343. break;
  1344. case V:
  1345. t = "number" == typeof _[0] && 0 < _[0] || "number" == typeof _[1] && 0 < _[1], o = Z * (t ? -1 : 1), l = Math.atan2(b[1].y - b[0].y, b[1].x - b[0].x), r = -l + o, c = Math.PI - l - o, d = _e(b[0], b[1]) / Math.sqrt(2) * U, S = {
  1346. x: b[0].x + Math.cos(r) * d,
  1347. y: b[0].y + Math.sin(r) * d * -1
  1348. }, m = {
  1349. x: b[1].x + Math.cos(c) * d,
  1350. y: b[1].y + Math.sin(c) * d * -1
  1351. }, v.push([O(b[0]), S, m, O(b[1])]);
  1352. break;
  1353. case P:
  1354. case N:
  1355. s = [_[0], E.position_path === N ? 0 : _[1]], h = [], p = [], b.forEach(function (e, t) {
  1356. var n, a, i, o, l, r = s[t];
  1357. Array.isArray(r) ? n = {
  1358. x: r[0],
  1359. y: r[1]
  1360. } : "number" == typeof r ? n = e.socketId === M ? {
  1361. x: 0,
  1362. y: -r
  1363. } : e.socketId === I ? {
  1364. x: r,
  1365. y: 0
  1366. } : e.socketId === C ? {
  1367. x: 0,
  1368. y: r
  1369. } : {
  1370. x: -r,
  1371. y: 0
  1372. } : (a = b[t ? 0 : 1], o = 0 < (i = E.position_plugOverheadSE[t]) ? G + (D < i ? (i - D) * z : 0) : B + (E.position_lineStrokeWidth > R ? (E.position_lineStrokeWidth - R) * F : 0), e.socketId === M ? ((l = (e.y - a.y) / 2) < o && (l = o), n = {
  1373. x: 0,
  1374. y: -l
  1375. }) : e.socketId === I ? ((l = (a.x - e.x) / 2) < o && (l = o), n = {
  1376. x: l,
  1377. y: 0
  1378. }) : e.socketId === C ? ((l = (a.y - e.y) / 2) < o && (l = o), n = {
  1379. x: 0,
  1380. y: l
  1381. }) : ((l = (e.x - a.x) / 2) < o && (l = o), n = {
  1382. x: -l,
  1383. y: 0
  1384. })), h[t] = e.x + n.x, p[t] = e.y + n.y
  1385. }), v.push([O(b[0]), {
  1386. x: h[0],
  1387. y: p[0]
  1388. }, {
  1389. x: h[1],
  1390. y: p[1]
  1391. }, O(b[1])]);
  1392. break;
  1393. case T:
  1394. ! function () {
  1395. var a, o = 1,
  1396. l = 2,
  1397. r = 3,
  1398. s = 4,
  1399. u = [
  1400. [],
  1401. []
  1402. ],
  1403. h = [];
  1404. function p(e) {
  1405. return e === o ? r : e === l ? s : e === r ? o : l
  1406. }
  1407. function c(e) {
  1408. return e === l || e === s ? "x" : "y"
  1409. }
  1410. function d(e, t, n) {
  1411. var a = {
  1412. x: e.x,
  1413. y: e.y
  1414. };
  1415. if (n) {
  1416. if (n === p(e.dirId)) throw new Error("Invalid dirId: " + n);
  1417. a.dirId = n
  1418. } else a.dirId = e.dirId;
  1419. return a.dirId === o ? a.y -= t : a.dirId === l ? a.x += t : a.dirId === r ? a.y += t : a.x -= t, a
  1420. }
  1421. function f(e, t) {
  1422. return t.dirId === o ? e.y <= t.y : t.dirId === l ? e.x >= t.x : t.dirId === r ? e.y >= t.y : e.x <= t.x
  1423. }
  1424. function y(e, t) {
  1425. return t.dirId === o || t.dirId === r ? e.x === t.x : e.y === t.y
  1426. }
  1427. function S(e) {
  1428. return e[0] ? {
  1429. contain: 0,
  1430. notContain: 1
  1431. } : {
  1432. contain: 1,
  1433. notContain: 0
  1434. }
  1435. }
  1436. function m(e, t, n) {
  1437. return Math.abs(t[n] - e[n])
  1438. }
  1439. function g(e, t, n) {
  1440. return "x" === n ? e.x < t.x ? l : s : e.y < t.y ? r : o
  1441. }
  1442. function e() {
  1443. var e, t, a, i, n = [f(h[1], h[0]), f(h[0], h[1])],
  1444. o = [c(h[0].dirId), c(h[1].dirId)];
  1445. if (o[0] === o[1]) {
  1446. if (n[0] && n[1]) return y(h[1], h[0]) || (h[0][o[0]] === h[1][o[1]] ? (u[0].push(h[0]), u[1].push(h[1])) : (e = h[0][o[0]] + (h[1][o[1]] - h[0][o[0]]) / 2, u[0].push(d(h[0], Math.abs(e - h[0][o[0]]))), u[1].push(d(h[1], Math.abs(e - h[1][o[1]]))))), !1;
  1447. n[0] !== n[1] ? (t = S(n), (a = m(h[t.notContain], h[t.contain], o[t.notContain])) < H && (h[t.notContain] = d(h[t.notContain], H - a)), u[t.notContain].push(h[t.notContain]), h[t.notContain] = d(h[t.notContain], H, y(h[t.contain], h[t.notContain]) ? "x" === o[t.notContain] ? r : l : g(h[t.notContain], h[t.contain], "x" === o[t.notContain] ? "y" : "x"))) : (a = m(h[0], h[1], "x" === o[0] ? "y" : "x"), u.forEach(function (e, t) {
  1448. var n = 0 === t ? 1 : 0;
  1449. e.push(h[t]), h[t] = d(h[t], H, 2 * H <= a ? g(h[t], h[n], "x" === o[t] ? "y" : "x") : "x" === o[t] ? r : l)
  1450. }))
  1451. } else {
  1452. if (n[0] && n[1]) return y(h[1], h[0]) ? u[1].push(h[1]) : y(h[0], h[1]) ? u[0].push(h[0]) : u[0].push("x" === o[0] ? {
  1453. x: h[1].x,
  1454. y: h[0].y
  1455. } : {
  1456. x: h[0].x,
  1457. y: h[1].y
  1458. }), !1;
  1459. n[0] !== n[1] ? (t = S(n), u[t.notContain].push(h[t.notContain]), h[t.notContain] = d(h[t.notContain], H, m(h[t.notContain], h[t.contain], o[t.contain]) >= H ? g(h[t.notContain], h[t.contain], o[t.contain]) : h[t.contain].dirId)) : (i = [{
  1460. x: h[0].x,
  1461. y: h[0].y
  1462. }, {
  1463. x: h[1].x,
  1464. y: h[1].y
  1465. }], u.forEach(function (e, t) {
  1466. var n = 0 === t ? 1 : 0,
  1467. a = m(i[t], i[n], o[t]);
  1468. a < H && (h[t] = d(h[t], H - a)), e.push(h[t]), h[t] = d(h[t], H, g(h[t], h[n], o[n]))
  1469. }))
  1470. }
  1471. return !0
  1472. }
  1473. for (b.forEach(function (e, t) {
  1474. var n, a = O(e),
  1475. i = _[t];
  1476. n = Array.isArray(i) ? i[0] < 0 ? [s, -i[0]] : 0 < i[0] ? [l, i[0]] : i[1] < 0 ? [o, -i[1]] : 0 < i[1] ? [r, i[1]] : [e.socketId, 0] : "number" != typeof i ? [e.socketId, H] : 0 <= i ? [e.socketId, i] : [p(e.socketId), -i], a.dirId = n[0], i = n[1], u[t].push(a), h[t] = d(a, i)
  1477. }); e(););
  1478. u[1].reverse(), u[0].concat(u[1]).forEach(function (e, t) {
  1479. var n = {
  1480. x: e.x,
  1481. y: e.y
  1482. };
  1483. 0 < t && v.push([a, n]), a = n
  1484. })
  1485. }()
  1486. }
  1487. y = [], E.position_plugOverheadSE.forEach(function (e, t) {
  1488. var n, a, i, o, l, r, s, u, h, p, c, d = !t;
  1489. 0 < e ? 2 === (n = v[a = d ? 0 : v.length - 1]).length ? (y[a] = y[a] || _e.apply(null, n), y[a] > j && (y[a] - e < j && (e = y[a] - j), i = ve(n[0], n[1], (d ? e : y[a] - e) / y[a]), v[a] = d ? [i, n[1]] : [n[0], i], y[a] -= e)) : (y[a] = y[a] || be.apply(null, n), y[a] > j && (y[a] - e < j && (e = y[a] - j), i = xe(n[0], n[1], n[2], n[3], ke(n[0], n[1], n[2], n[3], d ? e : y[a] - e)), d ? (o = n[0], l = i.toP1) : (o = n[3], l = i.fromP2), r = Math.atan2(o.y - i.y, i.x - o.x), s = _e(i, l), i.x = o.x + Math.cos(r) * e, i.y = o.y + Math.sin(r) * e * -1, l.x = i.x + Math.cos(r) * s, l.y = i.y + Math.sin(r) * s * -1, v[a] = d ? [i, i.toP1, i.toP2, n[3]] : [n[0], i.fromP1, i.fromP2, i], y[a] = null)) : e < 0 && (n = v[a = d ? 0 : v.length - 1], u = b[t].socketId, h = u === L || u === I ? "x" : "y", e < (c = -f[t]["x" === h ? "width" : "height"]) && (e = c), p = e * (u === L || u === M ? -1 : 1), 2 === n.length ? n[d ? 0 : n.length - 1][h] += p : (d ? [0, 1] : [n.length - 2, n.length - 1]).forEach(function (e) {
  1490. n[e][h] += p
  1491. }), y[a] = null)
  1492. }), x.position_socketXYSE = de(b), x.position_plugOverheadSE = de(E.position_plugOverheadSE), x.position_path = E.position_path, x.position_lineStrokeWidth = E.position_lineStrokeWidth, x.position_socketGravitySE = de(_), k = !0, u.events.apl_position && u.events.apl_position.forEach(function (e) {
  1493. e(u, v)
  1494. })
  1495. }
  1496. return k
  1497. }
  1498. function Ge(t, n) {
  1499. n !== t.isShown && (!!n != !!t.isShown && (t.svg.style.visibility = n ? "" : "hidden"), t.isShown = n, t.events && t.events.svgShow && t.events.svgShow.forEach(function (e) {
  1500. e(t, n)
  1501. }))
  1502. }
  1503. function De(e, t) {
  1504. var n, a, i, o, l, h, p, c, d, f, r, s, u, y, S, m, g, _, v, E, x, b, k, w, O, M, I, C, L, A, V, P, N, T, W, B, R, F, G, D, z, j, H, U, Z, Y, X, q, Q, K, J, $, ee = {};
  1505. t.line && (ee.line = (a = (n = e).options, i = n.curStats, o = n.events, l = !1, l = We(n, i, "line_color", a.lineColor, o.cur_line_color) || l, l = We(n, i, "line_colorTra", fe(i.line_color)[0] < 1) || l, l = We(n, i, "line_strokeWidth", a.lineSize, o.cur_line_strokeWidth) || l)), (t.plug || ee.line) && (ee.plug = (p = (h = e).options, c = h.curStats, d = h.events, f = !1, [0, 1].forEach(function (e) {
  1506. var t, n, a, i, o, l, r, s, u = p.plugSE[e];
  1507. f = We(h, c.plug_enabledSE, e, u !== ne) || f, f = We(h, c.plug_plugSE, e, u) || f, f = We(h, c.plug_colorSE, e, s = p.plugColorSE[e] || c.line_color, d.cur_plug_colorSE) || f, f = We(h, c.plug_colorTraSE, e, fe(s)[0] < 1) || f, u !== ne && (i = n = (t = ae[ie[u]]).widthR * p.plugSizeSE[e], o = a = t.heightR * p.plugSizeSE[e], ue && (i *= c.line_strokeWidth, o *= c.line_strokeWidth), f = We(h, c.plug_markerWidthSE, e, i) || f, f = We(h, c.plug_markerHeightSE, e, o) || f, c.capsMaskMarker_markerWidthSE[e] = n, c.capsMaskMarker_markerHeightSE[e] = a), c.plugOutline_plugSE[e] = c.capsMaskMarker_plugSE[e] = u, c.plug_enabledSE[e] ? (s = c.line_strokeWidth / pe.lineSize * p.plugSizeSE[e], c.position_plugOverheadSE[e] = t.overhead * s, c.viewBox_plugBCircleSE[e] = t.bCircle * s, l = t.sideLen * s, r = t.backLen * s) : (c.position_plugOverheadSE[e] = -c.line_strokeWidth / 2, c.viewBox_plugBCircleSE[e] = l = r = 0), We(h, c.attach_plugSideLenSE, e, l, d.cur_attach_plugSideLenSE), We(h, c.attach_plugBackLenSE, e, r, d.cur_attach_plugBackLenSE), c.capsMaskAnchor_enabledSE[e] = !c.plug_enabledSE[e]
  1508. }), f = We(h, c, "plug_enabled", c.plug_enabledSE[0] || c.plug_enabledSE[1]) || f)), (t.lineOutline || ee.line) && (ee.lineOutline = (u = (r = e).options, y = r.curStats, S = !1, S = We(r, y, "lineOutline_enabled", u.lineOutlineEnabled) || S, S = We(r, y, "lineOutline_color", u.lineOutlineColor) || S, S = We(r, y, "lineOutline_colorTra", fe(y.lineOutline_color)[0] < 1) || S, s = y.line_strokeWidth * u.lineOutlineSize, S = We(r, y, "lineOutline_strokeWidth", y.line_strokeWidth - 2 * s) || S, S = We(r, y, "lineOutline_inStrokeWidth", y.lineOutline_colorTra ? y.lineOutline_strokeWidth + 2 * he : y.line_strokeWidth - s) || S)), (t.plugOutline || ee.line || ee.plug || ee.lineOutline) && (ee.plugOutline = (g = (m = e).options, _ = m.curStats, v = !1, [0, 1].forEach(function (e) {
  1509. var t, n = _.plugOutline_plugSE[e],
  1510. a = n !== ne ? ae[ie[n]] : null;
  1511. v = We(m, _.plugOutline_enabledSE, e, g.plugOutlineEnabledSE[e] && _.plug_enabled && _.plug_enabledSE[e] && !!a && !!a.outlineBase) || v, v = We(m, _.plugOutline_colorSE, e, t = g.plugOutlineColorSE[e] || _.lineOutline_color) || v, v = We(m, _.plugOutline_colorTraSE, e, fe(t)[0] < 1) || v, a && a.outlineBase && ((t = g.plugOutlineSizeSE[e]) > a.outlineMax && (t = a.outlineMax), t *= 2 * a.outlineBase, v = We(m, _.plugOutline_strokeWidthSE, e, t) || v, v = We(m, _.plugOutline_inStrokeWidthSE, e, _.plugOutline_colorTraSE[e] ? t - he / (_.line_strokeWidth / pe.lineSize) / g.plugSizeSE[e] * 2 : t / 2) || v)
  1512. }), v)), (t.faces || ee.line || ee.plug || ee.lineOutline || ee.plugOutline) && (ee.faces = (b = (E = e).curStats, k = E.aplStats, w = E.events, O = !1, !b.line_altColor && We(E, k, "line_color", x = b.line_color, w.apl_line_color) && (E.lineFace.style.stroke = x, O = !0), We(E, k, "line_strokeWidth", x = b.line_strokeWidth, w.apl_line_strokeWidth) && (E.lineShape.style.strokeWidth = x + "px", O = !0, (re || le) && (Ae(E, E.lineShape), le && (Ae(E, E.lineFace), Ae(E, E.lineMaskCaps)))), We(E, k, "lineOutline_enabled", x = b.lineOutline_enabled, w.apl_lineOutline_enabled) && (E.lineOutlineFace.style.display = x ? "inline" : "none", O = !0), b.lineOutline_enabled && (We(E, k, "lineOutline_color", x = b.lineOutline_color, w.apl_lineOutline_color) && (E.lineOutlineFace.style.stroke = x, O = !0), We(E, k, "lineOutline_strokeWidth", x = b.lineOutline_strokeWidth, w.apl_lineOutline_strokeWidth) && (E.lineOutlineMaskShape.style.strokeWidth = x + "px", O = !0, le && (Ae(E, E.lineOutlineMaskCaps), Ae(E, E.lineOutlineFace))), We(E, k, "lineOutline_inStrokeWidth", x = b.lineOutline_inStrokeWidth, w.apl_lineOutline_inStrokeWidth) && (E.lineMaskShape.style.strokeWidth = x + "px", O = !0, le && (Ae(E, E.lineOutlineMaskCaps), Ae(E, E.lineOutlineFace)))), We(E, k, "plug_enabled", x = b.plug_enabled, w.apl_plug_enabled) && (E.plugsFace.style.display = x ? "inline" : "none", O = !0), b.plug_enabled && [0, 1].forEach(function (n) {
  1513. var e = b.plug_plugSE[n],
  1514. t = e !== ne ? ae[ie[e]] : null,
  1515. a = Ne(n, t);
  1516. We(E, k.plug_enabledSE, n, x = b.plug_enabledSE[n], w.apl_plug_enabledSE) && (E.plugsFace.style[a.prop] = x ? "url(#" + E.plugMarkerIdSE[n] + ")" : "none", O = !0), b.plug_enabledSE[n] && (We(E, k.plug_plugSE, n, e, w.apl_plug_plugSE) && (E.plugFaceSE[n].href.baseVal = "#" + t.elmId, Pe(E, E.plugMarkerSE[n], a.orient, t.bBox, E.svg, E.plugMarkerShapeSE[n], E.plugsFace), O = !0, re && Ae(E, E.plugsFace)), We(E, k.plug_colorSE, n, x = b.plug_colorSE[n], w.apl_plug_colorSE) && (E.plugFaceSE[n].style.fill = x, O = !0, (se || ue || le) && !b.line_colorTra && Ae(E, le ? E.lineMaskCaps : E.capsMaskLine)), ["markerWidth", "markerHeight"].forEach(function (e) {
  1517. var t = "plug_" + e + "SE";
  1518. We(E, k[t], n, x = b[t][n], w["apl_" + t]) && (E.plugMarkerSE[n][e].baseVal.value = x, O = !0)
  1519. }), We(E, k.plugOutline_enabledSE, n, x = b.plugOutline_enabledSE[n], w.apl_plugOutline_enabledSE) && (x ? (E.plugFaceSE[n].style.mask = "url(#" + E.plugMaskIdSE[n] + ")", E.plugOutlineFaceSE[n].style.display = "inline") : (E.plugFaceSE[n].style.mask = "none", E.plugOutlineFaceSE[n].style.display = "none"), O = !0), b.plugOutline_enabledSE[n] && (We(E, k.plugOutline_plugSE, n, e, w.apl_plugOutline_plugSE) && (E.plugOutlineFaceSE[n].href.baseVal = E.plugMaskShapeSE[n].href.baseVal = E.plugOutlineMaskShapeSE[n].href.baseVal = "#" + t.elmId, [E.plugMaskSE[n], E.plugOutlineMaskSE[n]].forEach(function (e) {
  1520. e.x.baseVal.value = t.bBox.left, e.y.baseVal.value = t.bBox.top, e.width.baseVal.value = t.bBox.width, e.height.baseVal.value = t.bBox.height
  1521. }), O = !0), We(E, k.plugOutline_colorSE, n, x = b.plugOutline_colorSE[n], w.apl_plugOutline_colorSE) && (E.plugOutlineFaceSE[n].style.fill = x, O = !0, le && (Ae(E, E.lineMaskCaps), Ae(E, E.lineOutlineMaskCaps))), We(E, k.plugOutline_strokeWidthSE, n, x = b.plugOutline_strokeWidthSE[n], w.apl_plugOutline_strokeWidthSE) && (E.plugOutlineMaskShapeSE[n].style.strokeWidth = x + "px", O = !0), We(E, k.plugOutline_inStrokeWidthSE, n, x = b.plugOutline_inStrokeWidthSE[n], w.apl_plugOutline_inStrokeWidthSE) && (E.plugMaskShapeSE[n].style.strokeWidth = x + "px", O = !0)))
  1522. }), O)), (t.position || ee.line || ee.plug) && (ee.position = Fe(e)), (t.path || ee.position) && (ee.path = (C = (M = e).curStats, L = M.aplStats, A = M.pathList.animVal || M.pathList.baseVal, V = C.path_edge, P = !1, A && (V.x1 = V.x2 = A[0][0].x, V.y1 = V.y2 = A[0][0].y, C.path_pathData = I = we(A, function (e) {
  1523. e.x < V.x1 && (V.x1 = e.x), e.y < V.y1 && (V.y1 = e.y), e.x > V.x2 && (V.x2 = e.x), e.y > V.y2 && (V.y2 = e.y)
  1524. }), Me(I, L.path_pathData) && (M.linePath.setPathData(I), L.path_pathData = I, P = !0, le ? (Ae(M, M.plugsFace), Ae(M, M.lineMaskCaps)) : re && Ae(M, M.linePath), M.events.apl_path && M.events.apl_path.forEach(function (e) {
  1525. e(M, I)
  1526. }))), P)), ee.viewBox = (B = (N = e).curStats, R = N.aplStats, F = B.path_edge, G = B.viewBox_bBox, D = R.viewBox_bBox, z = N.svg.viewBox.baseVal, j = N.svg.style, H = !1, T = Math.max(B.line_strokeWidth / 2, B.viewBox_plugBCircleSE[0] || 0, B.viewBox_plugBCircleSE[1] || 0), W = {
  1527. x1: F.x1 - T,
  1528. y1: F.y1 - T,
  1529. x2: F.x2 + T,
  1530. y2: F.y2 + T
  1531. }, N.events.new_edge4viewBox && N.events.new_edge4viewBox.forEach(function (e) {
  1532. e(N, W)
  1533. }), G.x = B.lineMask_x = B.lineOutlineMask_x = B.maskBGRect_x = W.x1, G.y = B.lineMask_y = B.lineOutlineMask_y = B.maskBGRect_y = W.y1, G.width = W.x2 - W.x1, G.height = W.y2 - W.y1, ["x", "y", "width", "height"].forEach(function (e) {
  1534. var t;
  1535. (t = G[e]) !== D[e] && (z[e] = D[e] = t, j[oe[e]] = t + ("x" === e || "y" === e ? N.bodyOffset[e] : 0) + "px", H = !0)
  1536. }), H), ee.mask = (Y = (U = e).curStats, X = U.aplStats, q = !1, Y.plug_enabled ? [0, 1].forEach(function (e) {
  1537. Y.capsMaskMarker_enabledSE[e] = Y.plug_enabledSE[e] && Y.plug_colorTraSE[e] || Y.plugOutline_enabledSE[e] && Y.plugOutline_colorTraSE[e]
  1538. }) : Y.capsMaskMarker_enabledSE[0] = Y.capsMaskMarker_enabledSE[1] = !1, Y.capsMaskMarker_enabled = Y.capsMaskMarker_enabledSE[0] || Y.capsMaskMarker_enabledSE[1], Y.lineMask_outlineMode = Y.lineOutline_enabled, Y.caps_enabled = Y.capsMaskMarker_enabled || Y.capsMaskAnchor_enabledSE[0] || Y.capsMaskAnchor_enabledSE[1], Y.lineMask_enabled = Y.caps_enabled || Y.lineMask_outlineMode, (Y.lineMask_enabled && !Y.lineMask_outlineMode || Y.lineOutline_enabled) && ["x", "y"].forEach(function (e) {
  1539. var t = "maskBGRect_" + e;
  1540. We(U, X, t, Z = Y[t]) && (U.maskBGRect[e].baseVal.value = Z, q = !0)
  1541. }), We(U, X, "lineMask_enabled", Z = Y.lineMask_enabled) && (U.lineFace.style.mask = Z ? "url(#" + U.lineMaskId + ")" : "none", q = !0, ue && Ae(U, U.lineMask)), Y.lineMask_enabled && (We(U, X, "lineMask_outlineMode", Z = Y.lineMask_outlineMode) && (Z ? (U.lineMaskBG.style.display = "none", U.lineMaskShape.style.display = "inline") : (U.lineMaskBG.style.display = "inline", U.lineMaskShape.style.display = "none"), q = !0), ["x", "y"].forEach(function (e) {
  1542. var t = "lineMask_" + e;
  1543. We(U, X, t, Z = Y[t]) && (U.lineMask[e].baseVal.value = Z, q = !0)
  1544. }), We(U, X, "caps_enabled", Z = Y.caps_enabled) && (U.lineMaskCaps.style.display = U.lineOutlineMaskCaps.style.display = Z ? "inline" : "none", q = !0, ue && Ae(U, U.capsMaskLine)), Y.caps_enabled && ([0, 1].forEach(function (e) {
  1545. var t;
  1546. We(U, X.capsMaskAnchor_enabledSE, e, Z = Y.capsMaskAnchor_enabledSE[e]) && (U.capsMaskAnchorSE[e].style.display = Z ? "inline" : "none", q = !0, ue && Ae(U, U.lineMask)), Y.capsMaskAnchor_enabledSE[e] && (Me(t = Y.capsMaskAnchor_pathDataSE[e], X.capsMaskAnchor_pathDataSE[e]) && (U.capsMaskAnchorSE[e].setPathData(t), X.capsMaskAnchor_pathDataSE[e] = t, q = !0), We(U, X.capsMaskAnchor_strokeWidthSE, e, Z = Y.capsMaskAnchor_strokeWidthSE[e]) && (U.capsMaskAnchorSE[e].style.strokeWidth = Z + "px", q = !0))
  1547. }), We(U, X, "capsMaskMarker_enabled", Z = Y.capsMaskMarker_enabled) && (U.capsMaskLine.style.display = Z ? "inline" : "none", q = !0), Y.capsMaskMarker_enabled && [0, 1].forEach(function (n) {
  1548. var e = Y.capsMaskMarker_plugSE[n],
  1549. t = e !== ne ? ae[ie[e]] : null,
  1550. a = Ne(n, t);
  1551. We(U, X.capsMaskMarker_enabledSE, n, Z = Y.capsMaskMarker_enabledSE[n]) && (U.capsMaskLine.style[a.prop] = Z ? "url(#" + U.lineMaskMarkerIdSE[n] + ")" : "none", q = !0), Y.capsMaskMarker_enabledSE[n] && (We(U, X.capsMaskMarker_plugSE, n, e) && (U.capsMaskMarkerShapeSE[n].href.baseVal = "#" + t.elmId, Pe(U, U.capsMaskMarkerSE[n], a.orient, t.bBox, U.svg, U.capsMaskMarkerShapeSE[n], U.capsMaskLine), q = !0, re && (Ae(U, U.capsMaskLine), Ae(U, U.lineFace))), ["markerWidth", "markerHeight"].forEach(function (e) {
  1552. var t = "capsMaskMarker_" + e + "SE";
  1553. We(U, X[t], n, Z = Y[t][n]) && (U.capsMaskMarkerSE[n][e].baseVal.value = Z, q = !0)
  1554. }))
  1555. }))), Y.lineOutline_enabled && ["x", "y"].forEach(function (e) {
  1556. var t = "lineOutlineMask_" + e;
  1557. We(U, X, t, Z = Y[t]) && (U.lineOutlineMask[e].baseVal.value = Z, q = !0)
  1558. }), q), t.effect && (J = (Q = e).curStats, $ = Q.aplStats, Object.keys(te).forEach(function (e) {
  1559. var t = te[e],
  1560. n = e + "_enabled",
  1561. a = e + "_options",
  1562. i = J[a];
  1563. We(Q, $, n, K = J[n]) ? (K && ($[a] = de(i)), t[K ? "init" : "remove"](Q)) : K && ce(i, $[a]) && (t.remove(Q), $[n] = !0, $[a] = de(i), t.init(Q))
  1564. })), (se || ue) && ee.line && !ee.path && Ae(e, e.lineShape), se && ee.plug && !ee.line && Ae(e, e.plugsFace), Ve(e)
  1565. }
  1566. function ze(e, t) {
  1567. return {
  1568. duration: w(e.duration) && 0 < e.duration ? e.duration : t.duration,
  1569. timing: c.validTiming(e.timing) ? e.timing : de(t.timing)
  1570. }
  1571. }
  1572. function je(e, t, n, a) {
  1573. var i, o = e.curStats,
  1574. l = e.aplStats,
  1575. r = {};
  1576. function s() {
  1577. ["show_on", "show_effect", "show_animOptions"].forEach(function (e) {
  1578. l[e] = o[e]
  1579. })
  1580. }
  1581. o.show_on = t, n && g[n] && (o.show_effect = n, o.show_animOptions = ze(k(a) ? a : {}, g[n].defaultAnimOptions)), r.show_on = o.show_on !== l.show_on, r.show_effect = o.show_effect !== l.show_effect, r.show_animOptions = ce(o.show_animOptions, l.show_animOptions), r.show_effect || r.show_animOptions ? o.show_inAnim ? (i = r.show_effect ? g[l.show_effect].stop(e, !0, !0) : g[l.show_effect].stop(e), s(), g[l.show_effect].init(e, i)) : r.show_on && (l.show_effect && r.show_effect && g[l.show_effect].stop(e, !0, !0), s(), g[l.show_effect].init(e)) : r.show_on && (s(), g[l.show_effect].start(e))
  1582. }
  1583. function He(e, t, n) {
  1584. var a = {
  1585. props: e,
  1586. optionName: n
  1587. };
  1588. return !(!(e.attachments.indexOf(t) < 0) || t.conf.bind && !t.conf.bind(t, a)) && (e.attachments.push(t), t.boundTargets.push(a), !0)
  1589. }
  1590. function Ue(n, a, e) {
  1591. var i = n.attachments.indexOf(a); - 1 < i && n.attachments.splice(i, 1), a.boundTargets.some(function (e, t) {
  1592. return e.props === n && (a.conf.unbind && a.conf.unbind(a, e), i = t, !0)
  1593. }) && (a.boundTargets.splice(i, 1), e || Le(function () {
  1594. a.boundTargets.length || o(a)
  1595. }))
  1596. }
  1597. function Ze(s, u) {
  1598. var e, i, h = s.options,
  1599. p = {};
  1600. function f(e, t, n, a, i) {
  1601. var o = {};
  1602. return n ? null != a ? (o.container = e[n], o.key = a) : (o.container = e, o.key = n) : (o.container = e, o.key = t), o.default = i, o.acceptsAuto = null == o.default, o
  1603. }
  1604. function c(e, t, n, a, i, o, l) {
  1605. var r, s, u, h = f(e, n, i, o, l);
  1606. return null != t[n] && (s = (t[n] + "").toLowerCase()) && (h.acceptsAuto && s === x || (u = a[s])) && u !== h.container[h.key] && (h.container[h.key] = u, r = !0), null != h.container[h.key] || h.acceptsAuto || (h.container[h.key] = h.default, r = !0), r
  1607. }
  1608. function d(e, t, n, a, i, o, l, r, s) {
  1609. var u, h, p, c, d = f(e, n, i, o, l);
  1610. if (!a) {
  1611. if (null == d.default) throw new Error("Invalid `type`: " + n);
  1612. a = typeof d.default
  1613. }
  1614. return null != t[n] && (d.acceptsAuto && (t[n] + "").toLowerCase() === x || (p = h = t[n], ("number" === (c = a) ? w(p) : typeof p === c) && (h = s && "string" === a && h ? h.trim() : h, 1) && (!r || r(h)))) && h !== d.container[d.key] && (d.container[d.key] = h, u = !0), null != d.container[d.key] || d.acceptsAuto || (d.container[d.key] = d.default, u = !0), u
  1615. }
  1616. if (u = u || {}, ["start", "end"].forEach(function (e, t) {
  1617. var n = u[e],
  1618. a = !1;
  1619. if (n && (ye(n) || (a = _(n, "anchor"))) && n !== h.anchorSE[t]) {
  1620. if (!1 !== s.optionIsAttach.anchorSE[t] && Ue(s, $[h.anchorSE[t]._id]), a && !He(s, $[n._id], e)) throw new Error("Can't bind attachment");
  1621. h.anchorSE[t] = n, s.optionIsAttach.anchorSE[t] = a, i = p.position = !0
  1622. }
  1623. }), !h.anchorSE[0] || !h.anchorSE[1] || h.anchorSE[0] === h.anchorSE[1]) throw new Error("`start` and `end` are required.");
  1624. i && (e = function (e, t) {
  1625. var n, a, i;
  1626. if (!(n = me(e)) || !(a = me(t))) throw new Error("Cannot get frames.");
  1627. return n.length && a.length && (n.reverse(), a.reverse(), n.some(function (t) {
  1628. return a.some(function (e) {
  1629. return e === t && (i = e.contentWindow, !0)
  1630. })
  1631. })), i || window
  1632. }(!1 !== s.optionIsAttach.anchorSE[0] ? $[h.anchorSE[0]._id].element : h.anchorSE[0], !1 !== s.optionIsAttach.anchorSE[1] ? $[h.anchorSE[1]._id].element : h.anchorSE[1])) !== s.baseWindow && (! function (a, e) {
  1633. var t, n, i, o, l, r, s, u, h, p, c = a.aplStats,
  1634. d = e.document,
  1635. f = v + "-" + a._id;
  1636. function y(e) {
  1637. var t = n.appendChild(d.createElementNS(b, "mask"));
  1638. return t.id = e, t.maskUnits.baseVal = SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE, [t.x, t.y, t.width, t.height].forEach(function (e) {
  1639. e.baseVal.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PX, 0)
  1640. }), t
  1641. }
  1642. function S(e) {
  1643. var t = n.appendChild(d.createElementNS(b, "marker"));
  1644. return t.id = e, t.markerUnits.baseVal = SVGMarkerElement.SVG_MARKERUNITS_STROKEWIDTH, t.viewBox.baseVal || t.setAttribute("viewBox", "0 0 0 0"), t
  1645. }
  1646. function m(e) {
  1647. return [e.width, e.height].forEach(function (e) {
  1648. e.baseVal.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PERCENTAGE, 100)
  1649. }), e
  1650. }
  1651. a.pathList = {}, Te(c, Y), Object.keys(te).forEach(function (e) {
  1652. var t = e + "_enabled";
  1653. c[t] && (te[e].remove(a), c[t] = !1)
  1654. }), a.baseWindow && a.svg && a.baseWindow.document.body.removeChild(a.svg), Re(a.baseWindow = e), a.bodyOffset = Be(e), a.svg = t = d.createElementNS(b, "svg"), t.className.baseVal = v, t.viewBox.baseVal || t.setAttribute("viewBox", "0 0 0 0"), a.defs = n = t.appendChild(d.createElementNS(b, "defs")), a.linePath = o = n.appendChild(d.createElementNS(b, "path")), o.id = l = f + "-line-path", o.className.baseVal = v + "-line-path", ue && (o.style.fill = "none"), a.lineShape = o = n.appendChild(d.createElementNS(b, "use")), o.id = r = f + "-line-shape", o.href.baseVal = "#" + l, (i = n.appendChild(d.createElementNS(b, "g"))).id = s = f + "-caps", a.capsMaskAnchorSE = [0, 1].map(function () {
  1655. var e = i.appendChild(d.createElementNS(b, "path"));
  1656. return e.className.baseVal = v + "-caps-mask-anchor", e
  1657. }), a.lineMaskMarkerIdSE = [f + "-caps-mask-marker-0", f + "-caps-mask-marker-1"], a.capsMaskMarkerSE = [0, 1].map(function (e) {
  1658. return S(a.lineMaskMarkerIdSE[e])
  1659. }), a.capsMaskMarkerShapeSE = [0, 1].map(function (e) {
  1660. var t = a.capsMaskMarkerSE[e].appendChild(d.createElementNS(b, "use"));
  1661. return t.className.baseVal = v + "-caps-mask-marker-shape", t
  1662. }), a.capsMaskLine = o = i.appendChild(d.createElementNS(b, "use")), o.className.baseVal = v + "-caps-mask-line", o.href.baseVal = "#" + r, a.maskBGRect = o = m(n.appendChild(d.createElementNS(b, "rect"))), o.id = u = f + "-mask-bg-rect", o.className.baseVal = v + "-mask-bg-rect", ue && (o.style.fill = "white"), a.lineMask = m(y(a.lineMaskId = f + "-line-mask")), a.lineMaskBG = o = a.lineMask.appendChild(d.createElementNS(b, "use")), o.href.baseVal = "#" + u, a.lineMaskShape = o = a.lineMask.appendChild(d.createElementNS(b, "use")), o.className.baseVal = v + "-line-mask-shape", o.href.baseVal = "#" + l, o.style.display = "none", a.lineMaskCaps = o = a.lineMask.appendChild(d.createElementNS(b, "use")), o.href.baseVal = "#" + s, a.lineOutlineMask = m(y(h = f + "-line-outline-mask")), (o = a.lineOutlineMask.appendChild(d.createElementNS(b, "use"))).href.baseVal = "#" + u, a.lineOutlineMaskShape = o = a.lineOutlineMask.appendChild(d.createElementNS(b, "use")), o.className.baseVal = v + "-line-outline-mask-shape", o.href.baseVal = "#" + l, a.lineOutlineMaskCaps = o = a.lineOutlineMask.appendChild(d.createElementNS(b, "use")), o.href.baseVal = "#" + s, a.face = t.appendChild(d.createElementNS(b, "g")), a.lineFace = o = a.face.appendChild(d.createElementNS(b, "use")), o.href.baseVal = "#" + r, a.lineOutlineFace = o = a.face.appendChild(d.createElementNS(b, "use")), o.href.baseVal = "#" + r, o.style.mask = "url(#" + h + ")", o.style.display = "none", a.plugMaskIdSE = [f + "-plug-mask-0", f + "-plug-mask-1"], a.plugMaskSE = [0, 1].map(function (e) {
  1663. return y(a.plugMaskIdSE[e])
  1664. }), a.plugMaskShapeSE = [0, 1].map(function (e) {
  1665. var t = a.plugMaskSE[e].appendChild(d.createElementNS(b, "use"));
  1666. return t.className.baseVal = v + "-plug-mask-shape", t
  1667. }), p = [], a.plugOutlineMaskSE = [0, 1].map(function (e) {
  1668. return y(p[e] = f + "-plug-outline-mask-" + e)
  1669. }), a.plugOutlineMaskShapeSE = [0, 1].map(function (e) {
  1670. var t = a.plugOutlineMaskSE[e].appendChild(d.createElementNS(b, "use"));
  1671. return t.className.baseVal = v + "-plug-outline-mask-shape", t
  1672. }), a.plugMarkerIdSE = [f + "-plug-marker-0", f + "-plug-marker-1"], a.plugMarkerSE = [0, 1].map(function (e) {
  1673. var t = S(a.plugMarkerIdSE[e]);
  1674. return ue && (t.markerUnits.baseVal = SVGMarkerElement.SVG_MARKERUNITS_USERSPACEONUSE), t
  1675. }), a.plugMarkerShapeSE = [0, 1].map(function (e) {
  1676. return a.plugMarkerSE[e].appendChild(d.createElementNS(b, "g"))
  1677. }), a.plugFaceSE = [0, 1].map(function (e) {
  1678. return a.plugMarkerShapeSE[e].appendChild(d.createElementNS(b, "use"))
  1679. }), a.plugOutlineFaceSE = [0, 1].map(function (e) {
  1680. var t = a.plugMarkerShapeSE[e].appendChild(d.createElementNS(b, "use"));
  1681. return t.style.mask = "url(#" + p[e] + ")", t.style.display = "none", t
  1682. }), a.plugsFace = o = a.face.appendChild(d.createElementNS(b, "use")), o.className.baseVal = v + "-plugs-face", o.href.baseVal = "#" + r, o.style.display = "none", a.curStats.show_inAnim ? (a.isShown = 1, g[c.show_effect].stop(a, !0)) : a.isShown || (t.style.visibility = "hidden"), d.body.appendChild(t), [0, 1, 2].forEach(function (e) {
  1683. var t, n = a.options.labelSEM[e];
  1684. n && _(n, "label") && (t = $[n._id]).conf.initSvg && t.conf.initSvg(t, a)
  1685. })
  1686. }(s, e), p.line = p.plug = p.lineOutline = p.plugOutline = p.faces = p.effect = !0), p.position = c(h, u, "path", m, null, null, pe.path) || p.position, p.position = c(h, u, "startSocket", n, "socketSE", 0) || p.position, p.position = c(h, u, "endSocket", n, "socketSE", 1) || p.position, [u.startSocketGravity, u.endSocketGravity].forEach(function (e, t) {
  1687. var n, a, i = !1;
  1688. null != e && (Array.isArray(e) ? w(e[0]) && w(e[1]) && (i = [e[0], e[1]], Array.isArray(h.socketGravitySE[t]) && (n = i, a = h.socketGravitySE[t], n.length === a.length && n.every(function (e, t) {
  1689. return e === a[t]
  1690. })) && (i = !1)) : ((e + "").toLowerCase() === x ? i = null : w(e) && 0 <= e && (i = e), i === h.socketGravitySE[t] && (i = !1)), !1 !== i && (h.socketGravitySE[t] = i, p.position = !0))
  1691. }), p.line = d(h, u, "color", null, "lineColor", null, pe.lineColor, null, !0) || p.line, p.line = d(h, u, "size", null, "lineSize", null, pe.lineSize, function (e) {
  1692. return 0 < e
  1693. }) || p.line, ["startPlug", "endPlug"].forEach(function (e, t) {
  1694. p.plug = c(h, u, e, E, "plugSE", t, pe.plugSE[t]) || p.plug, p.plug = d(h, u, e + "Color", "string", "plugColorSE", t, null, null, !0) || p.plug, p.plug = d(h, u, e + "Size", null, "plugSizeSE", t, pe.plugSizeSE[t], function (e) {
  1695. return 0 < e
  1696. }) || p.plug
  1697. }), p.lineOutline = d(h, u, "outline", null, "lineOutlineEnabled", null, pe.lineOutlineEnabled) || p.lineOutline, p.lineOutline = d(h, u, "outlineColor", null, "lineOutlineColor", null, pe.lineOutlineColor, null, !0) || p.lineOutline, p.lineOutline = d(h, u, "outlineSize", null, "lineOutlineSize", null, pe.lineOutlineSize, function (e) {
  1698. return 0 < e && e <= .48
  1699. }) || p.lineOutline, ["startPlugOutline", "endPlugOutline"].forEach(function (e, t) {
  1700. p.plugOutline = d(h, u, e, null, "plugOutlineEnabledSE", t, pe.plugOutlineEnabledSE[t]) || p.plugOutline, p.plugOutline = d(h, u, e + "Color", "string", "plugOutlineColorSE", t, null, null, !0) || p.plugOutline, p.plugOutline = d(h, u, e + "Size", null, "plugOutlineSizeSE", t, pe.plugOutlineSizeSE[t], function (e) {
  1701. return 1 <= e
  1702. }) || p.plugOutline
  1703. }), ["startLabel", "endLabel", "middleLabel"].forEach(function (e, t) {
  1704. var n, a, i, o = u[e],
  1705. l = h.labelSEM[t] && !s.optionIsAttach.labelSEM[t] ? $[h.labelSEM[t]._id].text : h.labelSEM[t],
  1706. r = !1;
  1707. if ((n = "string" == typeof o) && (o = o.trim()), (n || o && (r = _(o, "label"))) && o !== l) {
  1708. if (h.labelSEM[t] && (Ue(s, $[h.labelSEM[t]._id]), h.labelSEM[t] = ""), o) {
  1709. if (r ? (a = $[(i = o)._id]).boundTargets.slice().forEach(function (e) {
  1710. a.conf.removeOption(a, e)
  1711. }) : i = new S(y.captionLabel, [o]), !He(s, $[i._id], e)) throw new Error("Can't bind attachment");
  1712. h.labelSEM[t] = i
  1713. }
  1714. s.optionIsAttach.labelSEM[t] = r
  1715. }
  1716. }), Object.keys(te).forEach(function (a) {
  1717. var e, t, o = te[a],
  1718. n = a + "_enabled",
  1719. i = a + "_options";
  1720. function l(a) {
  1721. var i = {};
  1722. return o.optionsConf.forEach(function (e) {
  1723. var t = e[0],
  1724. n = e[3];
  1725. null == e[4] || i[n] || (i[n] = []), ("function" == typeof t ? t : "id" === t ? c : d).apply(null, [i, a].concat(e.slice(1)))
  1726. }), i
  1727. }
  1728. function r(e) {
  1729. var t, n = a + "_animOptions";
  1730. return e.hasOwnProperty("animation") ? k(e.animation) ? t = s.curStats[n] = ze(e.animation, o.defaultAnimOptions) : (t = !!e.animation, s.curStats[n] = t ? ze({}, o.defaultAnimOptions) : null) : (t = !!o.defaultEnabled, s.curStats[n] = t ? ze({}, o.defaultAnimOptions) : null), t
  1731. }
  1732. u.hasOwnProperty(a) && (e = u[a], k(e) ? (s.curStats[n] = !0, t = s.curStats[i] = l(e), o.anim && (s.curStats[i].animation = r(e))) : (t = s.curStats[n] = !!e) && (s.curStats[i] = l({}), o.anim && (s.curStats[i].animation = r({}))), ce(t, h[a]) && (h[a] = t, p.effect = !0))
  1733. }), De(s, p)
  1734. }
  1735. function Ye(e, t, n) {
  1736. var a = {
  1737. options: {
  1738. anchorSE: [],
  1739. socketSE: [],
  1740. socketGravitySE: [],
  1741. plugSE: [],
  1742. plugColorSE: [],
  1743. plugSizeSE: [],
  1744. plugOutlineEnabledSE: [],
  1745. plugOutlineColorSE: [],
  1746. plugOutlineSizeSE: [],
  1747. labelSEM: ["", "", ""]
  1748. },
  1749. optionIsAttach: {
  1750. anchorSE: [!1, !1],
  1751. labelSEM: [!1, !1, !1]
  1752. },
  1753. curStats: {},
  1754. aplStats: {},
  1755. attachments: [],
  1756. events: {},
  1757. reflowTargets: []
  1758. };
  1759. Te(a.curStats, Y), Te(a.aplStats, Y), Object.keys(te).forEach(function (e) {
  1760. var t = te[e].stats;
  1761. Te(a.curStats, t), Te(a.aplStats, t), a.options[e] = !1
  1762. }), Te(a.curStats, X), Te(a.aplStats, X), a.curStats.show_effect = q, a.curStats.show_animOptions = de(g[q].defaultAnimOptions), Object.defineProperty(this, "_id", {
  1763. value: ++J
  1764. }), a._id = this._id, K[this._id] = a, 1 === arguments.length && (n = e, e = null), n = n || {}, (e || t) && (n = de(n), e && (n.start = e), t && (n.end = t)), a.isShown = a.aplStats.show_on = !n.hide, this.setOptions(n)
  1765. }
  1766. return te = {
  1767. dash: {
  1768. stats: {
  1769. dash_len: {},
  1770. dash_gap: {},
  1771. dash_maxOffset: {}
  1772. },
  1773. anim: !0,
  1774. defaultAnimOptions: {
  1775. duration: 1e3,
  1776. timing: "linear"
  1777. },
  1778. optionsConf: [
  1779. ["type", "len", "number", null, null, null, function (e) {
  1780. return 0 < e
  1781. }],
  1782. ["type", "gap", "number", null, null, null, function (e) {
  1783. return 0 < e
  1784. }]
  1785. ],
  1786. init: function (e) {
  1787. Ie(e, "apl_line_strokeWidth", te.dash.update), e.lineFace.style.strokeDashoffset = 0, te.dash.update(e)
  1788. },
  1789. remove: function (e) {
  1790. var t = e.curStats;
  1791. Ce(e, "apl_line_strokeWidth", te.dash.update), t.dash_animId && (c.remove(t.dash_animId), t.dash_animId = null), e.lineFace.style.strokeDasharray = "none", e.lineFace.style.strokeDashoffset = 0, Te(e.aplStats, te.dash.stats)
  1792. },
  1793. update: function (t) {
  1794. var e, n = t.curStats,
  1795. a = t.aplStats,
  1796. i = a.dash_options,
  1797. o = !1;
  1798. n.dash_len = i.len || 2 * a.line_strokeWidth, n.dash_gap = i.gap || a.line_strokeWidth, n.dash_maxOffset = n.dash_len + n.dash_gap, o = We(t, a, "dash_len", n.dash_len) || o, (o = We(t, a, "dash_gap", n.dash_gap) || o) && (t.lineFace.style.strokeDasharray = a.dash_len + "," + a.dash_gap), n.dash_animOptions ? (o = We(t, a, "dash_maxOffset", n.dash_maxOffset), a.dash_animOptions && (o || ce(n.dash_animOptions, a.dash_animOptions)) && (n.dash_animId && (e = c.stop(n.dash_animId), c.remove(n.dash_animId)), a.dash_animOptions = null), a.dash_animOptions || (n.dash_animId = c.add(function (e) {
  1799. return (1 - e) * a.dash_maxOffset + "px"
  1800. }, function (e) {
  1801. t.lineFace.style.strokeDashoffset = e
  1802. }, n.dash_animOptions.duration, 0, n.dash_animOptions.timing, !1, e), a.dash_animOptions = de(n.dash_animOptions))) : a.dash_animOptions && (n.dash_animId && (c.remove(n.dash_animId), n.dash_animId = null), t.lineFace.style.strokeDashoffset = 0, a.dash_animOptions = null)
  1803. }
  1804. },
  1805. gradient: {
  1806. stats: {
  1807. gradient_colorSE: {
  1808. hasSE: !0
  1809. },
  1810. gradient_pointSE: {
  1811. hasSE: !0,
  1812. hasProps: !0
  1813. }
  1814. },
  1815. optionsConf: [
  1816. ["type", "startColor", "string", "colorSE", 0, null, null, !0],
  1817. ["type", "endColor", "string", "colorSE", 1, null, null, !0]
  1818. ],
  1819. init: function (e) {
  1820. var t, a = e.baseWindow.document,
  1821. n = e.defs,
  1822. i = v + "-" + e._id + "-gradient";
  1823. e.efc_gradient_gradient = t = n.appendChild(a.createElementNS(b, "linearGradient")), t.id = i, t.gradientUnits.baseVal = SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE, [t.x1, t.y1, t.x2, t.y2].forEach(function (e) {
  1824. e.baseVal.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PX, 0)
  1825. }), e.efc_gradient_stopSE = [0, 1].map(function (t) {
  1826. var n = e.efc_gradient_gradient.appendChild(a.createElementNS(b, "stop"));
  1827. try {
  1828. n.offset.baseVal = t
  1829. } catch (e) {
  1830. if (e.code !== DOMException.NO_MODIFICATION_ALLOWED_ERR) throw e;
  1831. n.setAttribute("offset", t)
  1832. }
  1833. return n
  1834. }), Ie(e, "cur_plug_colorSE", te.gradient.update), Ie(e, "apl_path", te.gradient.update), e.curStats.line_altColor = !0, e.lineFace.style.stroke = "url(#" + i + ")", te.gradient.update(e)
  1835. },
  1836. remove: function (e) {
  1837. e.efc_gradient_gradient && (e.defs.removeChild(e.efc_gradient_gradient), e.efc_gradient_gradient = e.efc_gradient_stopSE = null), Ce(e, "cur_plug_colorSE", te.gradient.update), Ce(e, "apl_path", te.gradient.update), e.curStats.line_altColor = !1, e.lineFace.style.stroke = e.curStats.line_color, Te(e.aplStats, te.gradient.stats)
  1838. },
  1839. update: function (a) {
  1840. var e, t, i = a.curStats,
  1841. o = a.aplStats,
  1842. n = o.gradient_options,
  1843. l = a.pathList.animVal || a.pathList.baseVal;
  1844. [0, 1].forEach(function (e) {
  1845. i.gradient_colorSE[e] = n.colorSE[e] || i.plug_colorSE[e]
  1846. }), t = l[0][0], i.gradient_pointSE[0] = {
  1847. x: t.x,
  1848. y: t.y
  1849. }, t = (e = l[l.length - 1])[e.length - 1], i.gradient_pointSE[1] = {
  1850. x: t.x,
  1851. y: t.y
  1852. }, [0, 1].forEach(function (t) {
  1853. var n;
  1854. We(a, o.gradient_colorSE, t, n = i.gradient_colorSE[t]) && (ue ? (n = fe(n), a.efc_gradient_stopSE[t].style.stopColor = n[1], a.efc_gradient_stopSE[t].style.stopOpacity = n[0]) : a.efc_gradient_stopSE[t].style.stopColor = n), ["x", "y"].forEach(function (e) {
  1855. (n = i.gradient_pointSE[t][e]) !== o.gradient_pointSE[t][e] && (a.efc_gradient_gradient[e + (t + 1)].baseVal.value = o.gradient_pointSE[t][e] = n)
  1856. })
  1857. })
  1858. }
  1859. },
  1860. dropShadow: {
  1861. stats: {
  1862. dropShadow_dx: {},
  1863. dropShadow_dy: {},
  1864. dropShadow_blur: {},
  1865. dropShadow_color: {},
  1866. dropShadow_opacity: {},
  1867. dropShadow_x: {},
  1868. dropShadow_y: {}
  1869. },
  1870. optionsConf: [
  1871. ["type", "dx", null, null, null, 2],
  1872. ["type", "dy", null, null, null, 4],
  1873. ["type", "blur", null, null, null, 3, function (e) {
  1874. return 0 <= e
  1875. }],
  1876. ["type", "color", null, null, null, "#000", null, !0],
  1877. ["type", "opacity", null, null, null, .8, function (e) {
  1878. return 0 <= e && e <= 1
  1879. }]
  1880. ],
  1881. init: function (t) {
  1882. var e, n, a, i, o, l = t.baseWindow.document,
  1883. r = t.defs,
  1884. s = v + "-" + t._id + "-dropShadow",
  1885. u = (e = l, n = s, o = {}, "boolean" != typeof p && (p = !!window.SVGFEDropShadowElement && !ue), o.elmsAppend = [o.elmFilter = a = e.createElementNS(b, "filter")], a.filterUnits.baseVal = SVGUnitTypes.SVG_UNIT_TYPE_USERSPACEONUSE, a.x.baseVal.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PX, 0), a.y.baseVal.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PX, 0), a.width.baseVal.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PERCENTAGE, 100), a.height.baseVal.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PERCENTAGE, 100), a.id = n, p ? (o.elmOffset = o.elmBlur = i = a.appendChild(e.createElementNS(b, "feDropShadow")), o.styleFlood = i.style) : (o.elmBlur = a.appendChild(e.createElementNS(b, "feGaussianBlur")), o.elmOffset = i = a.appendChild(e.createElementNS(b, "feOffset")), i.result.baseVal = "offsetblur", i = a.appendChild(e.createElementNS(b, "feFlood")), o.styleFlood = i.style, (i = a.appendChild(e.createElementNS(b, "feComposite"))).in2.baseVal = "offsetblur", i.operator.baseVal = SVGFECompositeElement.SVG_FECOMPOSITE_OPERATOR_IN, (i = a.appendChild(e.createElementNS(b, "feMerge"))).appendChild(e.createElementNS(b, "feMergeNode")), i.appendChild(e.createElementNS(b, "feMergeNode")).in1.baseVal = "SourceGraphic"), o);
  1886. ["elmFilter", "elmOffset", "elmBlur", "styleFlood", "elmsAppend"].forEach(function (e) {
  1887. t["efc_dropShadow_" + e] = u[e]
  1888. }), u.elmsAppend.forEach(function (e) {
  1889. r.appendChild(e)
  1890. }), t.face.setAttribute("filter", "url(#" + s + ")"), Ie(t, "new_edge4viewBox", te.dropShadow.adjustEdge), te.dropShadow.update(t)
  1891. },
  1892. remove: function (e) {
  1893. var t = e.defs;
  1894. e.efc_dropShadow_elmsAppend && (e.efc_dropShadow_elmsAppend.forEach(function (e) {
  1895. t.removeChild(e)
  1896. }), e.efc_dropShadow_elmFilter = e.efc_dropShadow_elmOffset = e.efc_dropShadow_elmBlur = e.efc_dropShadow_styleFlood = e.efc_dropShadow_elmsAppend = null), Ce(e, "new_edge4viewBox", te.dropShadow.adjustEdge), De(e, {}), e.face.removeAttribute("filter"), Te(e.aplStats, te.dropShadow.stats)
  1897. },
  1898. update: function (e) {
  1899. var t, n, a = e.curStats,
  1900. i = e.aplStats,
  1901. o = i.dropShadow_options;
  1902. a.dropShadow_dx = t = o.dx, We(e, i, "dropShadow_dx", t) && (e.efc_dropShadow_elmOffset.dx.baseVal = t, n = !0), a.dropShadow_dy = t = o.dy, We(e, i, "dropShadow_dy", t) && (e.efc_dropShadow_elmOffset.dy.baseVal = t, n = !0), a.dropShadow_blur = t = o.blur, We(e, i, "dropShadow_blur", t) && (e.efc_dropShadow_elmBlur.setStdDeviation(t, t), n = !0), n && De(e, {}), a.dropShadow_color = t = o.color, We(e, i, "dropShadow_color", t) && (e.efc_dropShadow_styleFlood.floodColor = t), a.dropShadow_opacity = t = o.opacity, We(e, i, "dropShadow_opacity", t) && (e.efc_dropShadow_styleFlood.floodOpacity = t)
  1903. },
  1904. adjustEdge: function (a, i) {
  1905. var e, t, o = a.curStats,
  1906. l = a.aplStats;
  1907. null != o.dropShadow_dx && (e = 3 * o.dropShadow_blur, (t = {
  1908. x1: i.x1 - e + o.dropShadow_dx,
  1909. y1: i.y1 - e + o.dropShadow_dy,
  1910. x2: i.x2 + e + o.dropShadow_dx,
  1911. y2: i.y2 + e + o.dropShadow_dy
  1912. }).x1 < i.x1 && (i.x1 = t.x1), t.y1 < i.y1 && (i.y1 = t.y1), t.x2 > i.x2 && (i.x2 = t.x2), t.y2 > i.y2 && (i.y2 = t.y2), ["x", "y"].forEach(function (e) {
  1913. var t, n = "dropShadow_" + e;
  1914. o[n] = t = i[e + "1"], We(a, l, n, t) && (a.efc_dropShadow_elmFilter[e].baseVal.value = t)
  1915. }))
  1916. }
  1917. }
  1918. }, Object.keys(te).forEach(function (e) {
  1919. var t = te[e],
  1920. n = t.stats;
  1921. n[e + "_enabled"] = {
  1922. iniValue: !1
  1923. }, n[e + "_options"] = {
  1924. hasProps: !0
  1925. }, t.anim && (n[e + "_animOptions"] = {}, n[e + "_animId"] = {})
  1926. }), g = {
  1927. none: {
  1928. defaultAnimOptions: {},
  1929. init: function (e, t) {
  1930. var n = e.curStats;
  1931. n.show_animId && (c.remove(n.show_animId), n.show_animId = null), g.none.start(e, t)
  1932. },
  1933. start: function (e, t) {
  1934. g.none.stop(e, !0)
  1935. },
  1936. stop: function (e, t, n) {
  1937. var a = e.curStats;
  1938. return n = null != n ? n : e.aplStats.show_on, a.show_inAnim = !1, t && Ge(e, n), n ? 1 : 0
  1939. }
  1940. },
  1941. fade: {
  1942. defaultAnimOptions: {
  1943. duration: 300,
  1944. timing: "linear"
  1945. },
  1946. init: function (n, e) {
  1947. var t = n.curStats,
  1948. a = n.aplStats;
  1949. t.show_animId && c.remove(t.show_animId), t.show_animId = c.add(function (e) {
  1950. return e
  1951. }, function (e, t) {
  1952. t ? g.fade.stop(n, !0) : (n.svg.style.opacity = e + "", le && (Ae(n, n.svg), Ve(n)))
  1953. }, a.show_animOptions.duration, 1, a.show_animOptions.timing, null, !1), g.fade.start(n, e)
  1954. },
  1955. start: function (e, t) {
  1956. var n, a = e.curStats;
  1957. a.show_inAnim && (n = c.stop(a.show_animId)), Ge(e, 1), a.show_inAnim = !0, c.start(a.show_animId, !e.aplStats.show_on, null != t ? t : n)
  1958. },
  1959. stop: function (e, t, n) {
  1960. var a, i = e.curStats;
  1961. return n = null != n ? n : e.aplStats.show_on, a = i.show_inAnim ? c.stop(i.show_animId) : n ? 1 : 0, i.show_inAnim = !1, t && (e.svg.style.opacity = n ? "" : "0", Ge(e, n)), a
  1962. }
  1963. },
  1964. draw: {
  1965. defaultAnimOptions: {
  1966. duration: 500,
  1967. timing: [.58, 0, .42, 1]
  1968. },
  1969. init: function (n, e) {
  1970. var t = n.curStats,
  1971. a = n.aplStats,
  1972. l = n.pathList.baseVal,
  1973. i = Oe(l),
  1974. r = i.segsLen,
  1975. s = i.lenAll;
  1976. t.show_animId && c.remove(t.show_animId), t.show_animId = c.add(function (e) {
  1977. var t, n, a, i, o = -1;
  1978. if (0 === e) n = [
  1979. [l[0][0], l[0][0]]
  1980. ];
  1981. else if (1 === e) n = l;
  1982. else {
  1983. for (t = s * e, n = []; t >= r[++o];) n.push(l[o]), t -= r[o];
  1984. t && (2 === (a = l[o]).length ? n.push([a[0], ve(a[0], a[1], t / r[o])]) : (i = xe(a[0], a[1], a[2], a[3], ke(a[0], a[1], a[2], a[3], t)), n.push([a[0], i.fromP1, i.fromP2, i])))
  1985. }
  1986. return n
  1987. }, function (e, t) {
  1988. t ? g.draw.stop(n, !0) : (n.pathList.animVal = e, De(n, {
  1989. path: !0
  1990. }))
  1991. }, a.show_animOptions.duration, 1, a.show_animOptions.timing, null, !1), g.draw.start(n, e)
  1992. },
  1993. start: function (e, t) {
  1994. var n, a = e.curStats;
  1995. a.show_inAnim && (n = c.stop(a.show_animId)), Ge(e, 1), a.show_inAnim = !0, Ie(e, "apl_position", g.draw.update), c.start(a.show_animId, !e.aplStats.show_on, null != t ? t : n)
  1996. },
  1997. stop: function (e, t, n) {
  1998. var a, i = e.curStats;
  1999. return n = null != n ? n : e.aplStats.show_on, a = i.show_inAnim ? c.stop(i.show_animId) : n ? 1 : 0, i.show_inAnim = !1, t && (e.pathList.animVal = n ? null : [
  2000. [e.pathList.baseVal[0][0], e.pathList.baseVal[0][0]]
  2001. ], De(e, {
  2002. path: !0
  2003. }), Ge(e, n)), a
  2004. },
  2005. update: function (e) {
  2006. Ce(e, "apl_position", g.draw.update), e.curStats.show_inAnim ? g.draw.init(e, g.draw.stop(e)) : e.aplStats.show_animOptions = {}
  2007. }
  2008. }
  2009. },
  2010. function () {
  2011. function r(n) {
  2012. return function (e) {
  2013. var t = {};
  2014. t[n] = e, this.setOptions(t)
  2015. }
  2016. } [
  2017. ["start", "anchorSE", 0],
  2018. ["end", "anchorSE", 1],
  2019. ["color", "lineColor"],
  2020. ["size", "lineSize"],
  2021. ["startSocketGravity", "socketGravitySE", 0],
  2022. ["endSocketGravity", "socketGravitySE", 1],
  2023. ["startPlugColor", "plugColorSE", 0],
  2024. ["endPlugColor", "plugColorSE", 1],
  2025. ["startPlugSize", "plugSizeSE", 0],
  2026. ["endPlugSize", "plugSizeSE", 1],
  2027. ["outline", "lineOutlineEnabled"],
  2028. ["outlineColor", "lineOutlineColor"],
  2029. ["outlineSize", "lineOutlineSize"],
  2030. ["startPlugOutline", "plugOutlineEnabledSE", 0],
  2031. ["endPlugOutline", "plugOutlineEnabledSE", 1],
  2032. ["startPlugOutlineColor", "plugOutlineColorSE", 0],
  2033. ["endPlugOutlineColor", "plugOutlineColorSE", 1],
  2034. ["startPlugOutlineSize", "plugOutlineSizeSE", 0],
  2035. ["endPlugOutlineSize", "plugOutlineSizeSE", 1]
  2036. ].forEach(function (e) {
  2037. var t = e[0],
  2038. n = e[1],
  2039. a = e[2];
  2040. Object.defineProperty(Ye.prototype, t, {
  2041. get: function () {
  2042. var e = null != a ? K[this._id].options[n][a] : n ? K[this._id].options[n] : K[this._id].options[t];
  2043. return null == e ? x : de(e)
  2044. },
  2045. set: r(t),
  2046. enumerable: !0
  2047. })
  2048. }), [
  2049. ["path", m],
  2050. ["startSocket", n, "socketSE", 0],
  2051. ["endSocket", n, "socketSE", 1],
  2052. ["startPlug", E, "plugSE", 0],
  2053. ["endPlug", E, "plugSE", 1]
  2054. ].forEach(function (e) {
  2055. var a = e[0],
  2056. i = e[1],
  2057. o = e[2],
  2058. l = e[3];
  2059. Object.defineProperty(Ye.prototype, a, {
  2060. get: function () {
  2061. var t, n = null != l ? K[this._id].options[o][l] : o ? K[this._id].options[o] : K[this._id].options[a];
  2062. return n ? Object.keys(i).some(function (e) {
  2063. return i[e] === n && (t = e, !0)
  2064. }) ? t : new Error("It's broken") : x
  2065. },
  2066. set: r(a),
  2067. enumerable: !0
  2068. })
  2069. }), Object.keys(te).forEach(function (n) {
  2070. var a = te[n];
  2071. Object.defineProperty(Ye.prototype, n, {
  2072. get: function () {
  2073. var u, e, t = K[this._id].options[n];
  2074. return k(t) ? (u = t, e = a.optionsConf.reduce(function (e, t) {
  2075. var n, a = t[0],
  2076. i = t[1],
  2077. o = t[2],
  2078. l = t[3],
  2079. r = t[4],
  2080. s = null != r ? u[l][r] : l ? u[l] : u[i];
  2081. return e[i] = "id" === a ? s ? Object.keys(o).some(function (e) {
  2082. return o[e] === s && (n = e, !0)
  2083. }) ? n : new Error("It's broken") : x : null == s ? x : de(s), e
  2084. }, {}), a.anim && (e.animation = de(u.animation)), e) : t
  2085. },
  2086. set: r(n),
  2087. enumerable: !0
  2088. })
  2089. }), ["startLabel", "endLabel", "middleLabel"].forEach(function (e, n) {
  2090. Object.defineProperty(Ye.prototype, e, {
  2091. get: function () {
  2092. var e = K[this._id],
  2093. t = e.options;
  2094. return t.labelSEM[n] && !e.optionIsAttach.labelSEM[n] ? $[t.labelSEM[n]._id].text : t.labelSEM[n] || ""
  2095. },
  2096. set: r(e),
  2097. enumerable: !0
  2098. })
  2099. })
  2100. }(), Ye.prototype.setOptions = function (e) {
  2101. return Ze(K[this._id], e), this
  2102. }, Ye.prototype.position = function () {
  2103. return De(K[this._id], {
  2104. position: !0
  2105. }), this
  2106. }, Ye.prototype.remove = function () {
  2107. var t = K[this._id],
  2108. n = t.curStats;
  2109. Object.keys(te).forEach(function (e) {
  2110. var t = e + "_animId";
  2111. n[t] && c.remove(n[t])
  2112. }), n.show_animId && c.remove(n.show_animId), t.attachments.slice().forEach(function (e) {
  2113. Ue(t, e)
  2114. }), t.baseWindow && t.svg && t.baseWindow.document.body.removeChild(t.svg), delete K[this._id]
  2115. }, Ye.prototype.show = function (e, t) {
  2116. return je(K[this._id], !0, e, t), this
  2117. }, Ye.prototype.hide = function (e, t) {
  2118. return je(K[this._id], !1, e, t), this
  2119. }, o = function (t) {
  2120. t && $[t._id] && (t.boundTargets.slice().forEach(function (e) {
  2121. Ue(e.props, t, !0)
  2122. }), t.conf.remove && t.conf.remove(t), delete $[t._id])
  2123. }, S = function () {
  2124. function e(e, t) {
  2125. var n, a = {
  2126. conf: e,
  2127. curStats: {},
  2128. aplStats: {},
  2129. boundTargets: []
  2130. },
  2131. i = {};
  2132. e.argOptions.every(function (e) {
  2133. return !(!t.length || ("string" == typeof e.type ? typeof t[0] !== e.type : "function" != typeof e.type || !e.type(t[0]))) && (i[e.optionName] = t.shift(), !0)
  2134. }), n = t.length && k(t[0]) ? de(t[0]) : {}, Object.keys(i).forEach(function (e) {
  2135. n[e] = i[e]
  2136. }), e.stats && (Te(a.curStats, e.stats), Te(a.aplStats, e.stats)), Object.defineProperty(this, "_id", {
  2137. value: ++ee
  2138. }), Object.defineProperty(this, "isRemoved", {
  2139. get: function () {
  2140. return !$[this._id]
  2141. }
  2142. }), a._id = this._id, e.init && !e.init(a, n) || ($[this._id] = a)
  2143. }
  2144. return e.prototype.remove = function () {
  2145. var t = this,
  2146. n = $[t._id];
  2147. n && (n.boundTargets.slice().forEach(function (e) {
  2148. n.conf.removeOption(n, e)
  2149. }), Le(function () {
  2150. var e = $[t._id];
  2151. e && (console.error("LeaderLineAttachment was not removed by removeOption"), o(e))
  2152. }))
  2153. }, e
  2154. }(), window.LeaderLineAttachment = S, _ = function (e, t) {
  2155. return e instanceof S && (!(e.isRemoved || t && $[e._id].conf.type !== t) || null)
  2156. }, y = {
  2157. pointAnchor: {
  2158. type: "anchor",
  2159. argOptions: [{
  2160. optionName: "element",
  2161. type: ye
  2162. }],
  2163. init: function (e, t) {
  2164. return e.element = y.pointAnchor.checkElement(t.element), e.x = y.pointAnchor.parsePercent(t.x, !0) || [.5, !0], e.y = y.pointAnchor.parsePercent(t.y, !0) || [.5, !0], !0
  2165. },
  2166. removeOption: function (e, t) {
  2167. var n = t.props,
  2168. a = {},
  2169. i = e.element,
  2170. o = n.options.anchorSE["start" === t.optionName ? 1 : 0];
  2171. i === o && (i = o === document.body ? new S(y.pointAnchor, [i]) : document.body), a[t.optionName] = i, Ze(n, a)
  2172. },
  2173. getBBoxNest: function (e, t) {
  2174. var n = ge(e.element, t.baseWindow),
  2175. a = n.width,
  2176. i = n.height;
  2177. return n.width = n.height = 0, n.left = n.right = n.left + e.x[0] * (e.x[1] ? a : 1), n.top = n.bottom = n.top + e.y[0] * (e.y[1] ? i : 1), n
  2178. },
  2179. parsePercent: function (e, t) {
  2180. var n, a, i = !1;
  2181. return w(e) ? a = e : "string" == typeof e && (n = u.exec(e)) && n[2] && (i = 0 !== (a = parseFloat(n[1]) / 100)), null != a && (t || 0 <= a) ? [a, i] : null
  2182. },
  2183. checkElement: function (e) {
  2184. if (null == e) e = document.body;
  2185. else if (!ye(e)) throw new Error("`element` must be Element");
  2186. return e
  2187. }
  2188. },
  2189. areaAnchor: {
  2190. type: "anchor",
  2191. argOptions: [{
  2192. optionName: "element",
  2193. type: ye
  2194. }, {
  2195. optionName: "shape",
  2196. type: "string"
  2197. }],
  2198. stats: {
  2199. color: {},
  2200. strokeWidth: {},
  2201. elementWidth: {},
  2202. elementHeight: {},
  2203. elementLeft: {},
  2204. elementTop: {},
  2205. pathListRel: {},
  2206. bBoxRel: {},
  2207. pathData: {},
  2208. viewBoxBBox: {
  2209. hasProps: !0
  2210. },
  2211. dashLen: {},
  2212. dashGap: {}
  2213. },
  2214. init: function (i, e) {
  2215. var t, n, a, o = [];
  2216. return i.element = y.pointAnchor.checkElement(e.element), "string" == typeof e.color && (i.color = e.color.trim()), "string" == typeof e.fillColor && (i.fill = e.fillColor.trim()), w(e.size) && 0 <= e.size && (i.size = e.size), e.dash && (i.dash = !0, w(e.dash.len) && 0 < e.dash.len && (i.dashLen = e.dash.len), w(e.dash.gap) && 0 < e.dash.gap && (i.dashGap = e.dash.gap)), "circle" === e.shape ? i.shape = e.shape : "polygon" === e.shape && Array.isArray(e.points) && 3 <= e.points.length && e.points.every(function (e) {
  2217. var t = {};
  2218. return !(!(t.x = y.pointAnchor.parsePercent(e[0], !0)) || !(t.y = y.pointAnchor.parsePercent(e[1], !0))) && (o.push(t), (t.x[1] || t.y[1]) && (i.hasRatio = !0), !0)
  2219. }) ? (i.shape = e.shape, i.points = o) : (i.shape = "rect", i.radius = w(e.radius) && 0 <= e.radius ? e.radius : 0), "rect" !== i.shape && "circle" !== i.shape || (i.x = y.pointAnchor.parsePercent(e.x, !0) || [-.05, !0], i.y = y.pointAnchor.parsePercent(e.y, !0) || [-.05, !0], i.width = y.pointAnchor.parsePercent(e.width) || [1.1, !0], i.height = y.pointAnchor.parsePercent(e.height) || [1.1, !0], (i.x[1] || i.y[1] || i.width[1] || i.height[1]) && (i.hasRatio = !0)), t = i.element.ownerDocument, i.svg = n = t.createElementNS(b, "svg"), n.className.baseVal = v + "-areaAnchor", n.viewBox.baseVal || n.setAttribute("viewBox", "0 0 0 0"), i.path = n.appendChild(t.createElementNS(b, "path")), i.path.style.fill = i.fill || "none", i.isShown = !1, n.style.visibility = "hidden", t.body.appendChild(n), Re(a = t.defaultView), i.bodyOffset = Be(a), i.updateColor = function () {
  2220. var e, t = i.curStats,
  2221. n = i.aplStats,
  2222. a = i.boundTargets.length ? i.boundTargets[0].props.curStats : null;
  2223. t.color = e = i.color || (a ? a.line_color : pe.lineColor), We(i, n, "color", e) && (i.path.style.stroke = e)
  2224. }, i.updateShow = function () {
  2225. Ge(i, i.boundTargets.some(function (e) {
  2226. return !0 === e.props.isShown
  2227. }))
  2228. }, !0
  2229. },
  2230. bind: function (e, t) {
  2231. var n = t.props;
  2232. return e.color || Ie(n, "cur_line_color", e.updateColor), Ie(n, "svgShow", e.updateShow), Le(function () {
  2233. e.updateColor(), e.updateShow()
  2234. }), !0
  2235. },
  2236. unbind: function (e, t) {
  2237. var n = t.props;
  2238. e.color || Ce(n, "cur_line_color", e.updateColor), Ce(n, "svgShow", e.updateShow), 1 < e.boundTargets.length && Le(function () {
  2239. e.updateColor(), e.updateShow(), y.areaAnchor.update(e) && e.boundTargets.forEach(function (e) {
  2240. De(e.props, {
  2241. position: !0
  2242. })
  2243. })
  2244. })
  2245. },
  2246. removeOption: function (e, t) {
  2247. y.pointAnchor.removeOption(e, t)
  2248. },
  2249. remove: function (t) {
  2250. t.boundTargets.length && (console.error("LeaderLineAttachment was not unbound by remove"), t.boundTargets.forEach(function (e) {
  2251. y.areaAnchor.unbind(t, e)
  2252. })), t.svg.parentNode.removeChild(t.svg)
  2253. },
  2254. getStrokeWidth: function (e, t) {
  2255. return y.areaAnchor.update(e) && 1 < e.boundTargets.length && Le(function () {
  2256. e.boundTargets.forEach(function (e) {
  2257. e.props !== t && De(e.props, {
  2258. position: !0
  2259. })
  2260. })
  2261. }), e.curStats.strokeWidth
  2262. },
  2263. getPathData: function (e, t) {
  2264. var n = ge(e.element, t.baseWindow);
  2265. return we(e.curStats.pathListRel, function (e) {
  2266. e.x += n.left, e.y += n.top
  2267. })
  2268. },
  2269. getBBoxNest: function (e, t) {
  2270. var n = ge(e.element, t.baseWindow),
  2271. a = e.curStats.bBoxRel;
  2272. return {
  2273. left: a.left + n.left,
  2274. top: a.top + n.top,
  2275. right: a.right + n.left,
  2276. bottom: a.bottom + n.top,
  2277. width: a.width,
  2278. height: a.height
  2279. }
  2280. },
  2281. update: function (t) {
  2282. var a, n, i, o, e, l, r, s, u, h, p, c, d, f, y, S, m, g, _, v, E, x, b, k, w, O, M, I, C, L, A, V, P = t.curStats,
  2283. N = t.aplStats,
  2284. T = t.boundTargets.length ? t.boundTargets[0].props.curStats : null,
  2285. W = {};
  2286. if (W.strokeWidth = We(t, P, "strokeWidth", null != t.size ? t.size : T ? T.line_strokeWidth : pe.lineSize), a = Se(t.element), W.elementWidth = We(t, P, "elementWidth", a.width), W.elementHeight = We(t, P, "elementHeight", a.height), W.elementLeft = We(t, P, "elementLeft", a.left), W.elementTop = We(t, P, "elementTop", a.top), W.strokeWidth || t.hasRatio && (W.elementWidth || W.elementHeight)) {
  2287. switch (t.shape) {
  2288. case "rect":
  2289. (v = {
  2290. left: t.x[0] * (t.x[1] ? a.width : 1),
  2291. top: t.y[0] * (t.y[1] ? a.height : 1),
  2292. width: t.width[0] * (t.width[1] ? a.width : 1),
  2293. height: t.height[0] * (t.height[1] ? a.height : 1)
  2294. }).right = v.left + v.width, v.bottom = v.top + v.height, k = P.strokeWidth / 2, x = (b = Math.min(v.width, v.height)) ? b / 2 * Math.SQRT2 + k : 0, (E = t.radius ? t.radius <= x ? t.radius : x : 0) ? (O = E - (w = (E - k) / Math.SQRT2), I = E * U, M = [{
  2295. x: v.left - O,
  2296. y: v.top + w
  2297. }, {
  2298. x: v.left + w,
  2299. y: v.top - O
  2300. }, {
  2301. x: v.right - w,
  2302. y: v.top - O
  2303. }, {
  2304. x: v.right + O,
  2305. y: v.top + w
  2306. }, {
  2307. x: v.right + O,
  2308. y: v.bottom - w
  2309. }, {
  2310. x: v.right - w,
  2311. y: v.bottom + O
  2312. }, {
  2313. x: v.left + w,
  2314. y: v.bottom + O
  2315. }, {
  2316. x: v.left - O,
  2317. y: v.bottom - w
  2318. }], P.pathListRel = [
  2319. [M[0], {
  2320. x: M[0].x,
  2321. y: M[0].y - I
  2322. }, {
  2323. x: M[1].x - I,
  2324. y: M[1].y
  2325. }, M[1]]
  2326. ], M[1].x !== M[2].x && P.pathListRel.push([M[1], M[2]]), P.pathListRel.push([M[2], {
  2327. x: M[2].x + I,
  2328. y: M[2].y
  2329. }, {
  2330. x: M[3].x,
  2331. y: M[3].y - I
  2332. }, M[3]]), M[3].y !== M[4].y && P.pathListRel.push([M[3], M[4]]), P.pathListRel.push([M[4], {
  2333. x: M[4].x,
  2334. y: M[4].y + I
  2335. }, {
  2336. x: M[5].x + I,
  2337. y: M[5].y
  2338. }, M[5]]), M[5].x !== M[6].x && P.pathListRel.push([M[5], M[6]]), P.pathListRel.push([M[6], {
  2339. x: M[6].x - I,
  2340. y: M[6].y
  2341. }, {
  2342. x: M[7].x,
  2343. y: M[7].y + I
  2344. }, M[7]]), M[7].y !== M[0].y && P.pathListRel.push([M[7], M[0]]), P.pathListRel.push([]), O = E - w + P.strokeWidth / 2, M = [{
  2345. x: v.left - O,
  2346. y: v.top - O
  2347. }, {
  2348. x: v.right + O,
  2349. y: v.bottom + O
  2350. }]) : (O = P.strokeWidth / 2, M = [{
  2351. x: v.left - O,
  2352. y: v.top - O
  2353. }, {
  2354. x: v.right + O,
  2355. y: v.bottom + O
  2356. }], P.pathListRel = [
  2357. [M[0], {
  2358. x: M[1].x,
  2359. y: M[0].y
  2360. }],
  2361. [{
  2362. x: M[1].x,
  2363. y: M[0].y
  2364. }, M[1]],
  2365. [M[1], {
  2366. x: M[0].x,
  2367. y: M[1].y
  2368. }],
  2369. []
  2370. ], M = [{
  2371. x: v.left - P.strokeWidth,
  2372. y: v.top - P.strokeWidth
  2373. }, {
  2374. x: v.right + P.strokeWidth,
  2375. y: v.bottom + P.strokeWidth
  2376. }]), P.bBoxRel = {
  2377. left: M[0].x,
  2378. top: M[0].y,
  2379. right: M[1].x,
  2380. bottom: M[1].y,
  2381. width: M[1].x - M[0].x,
  2382. height: M[1].y - M[0].y
  2383. };
  2384. break;
  2385. case "circle":
  2386. (r = {
  2387. left: t.x[0] * (t.x[1] ? a.width : 1),
  2388. top: t.y[0] * (t.y[1] ? a.height : 1),
  2389. width: t.width[0] * (t.width[1] ? a.width : 1),
  2390. height: t.height[0] * (t.height[1] ? a.height : 1)
  2391. }).width || r.height || (r.width = r.height = 10), r.width || (r.width = r.height), r.height || (r.height = r.width), r.right = r.left + r.width, r.bottom = r.top + r.height, s = r.left + r.width / 2, u = r.top + r.height / 2, f = P.strokeWidth / 2, y = r.width / 2, S = r.height / 2, h = y * Math.SQRT2 + f, p = S * Math.SQRT2 + f, c = h * U, d = p * U, _ = [{
  2392. x: s - h,
  2393. y: u
  2394. }, {
  2395. x: s,
  2396. y: u - p
  2397. }, {
  2398. x: s + h,
  2399. y: u
  2400. }, {
  2401. x: s,
  2402. y: u + p
  2403. }], P.pathListRel = [
  2404. [_[0], {
  2405. x: _[0].x,
  2406. y: _[0].y - d
  2407. }, {
  2408. x: _[1].x - c,
  2409. y: _[1].y
  2410. }, _[1]],
  2411. [_[1], {
  2412. x: _[1].x + c,
  2413. y: _[1].y
  2414. }, {
  2415. x: _[2].x,
  2416. y: _[2].y - d
  2417. }, _[2]],
  2418. [_[2], {
  2419. x: _[2].x,
  2420. y: _[2].y + d
  2421. }, {
  2422. x: _[3].x + c,
  2423. y: _[3].y
  2424. }, _[3]],
  2425. [_[3], {
  2426. x: _[3].x - c,
  2427. y: _[3].y
  2428. }, {
  2429. x: _[0].x,
  2430. y: _[0].y + d
  2431. }, _[0]],
  2432. []
  2433. ], m = h - y + P.strokeWidth / 2, g = p - S + P.strokeWidth / 2, _ = [{
  2434. x: r.left - m,
  2435. y: r.top - g
  2436. }, {
  2437. x: r.right + m,
  2438. y: r.bottom + g
  2439. }], P.bBoxRel = {
  2440. left: _[0].x,
  2441. top: _[0].y,
  2442. right: _[1].x,
  2443. bottom: _[1].y,
  2444. width: _[1].x - _[0].x,
  2445. height: _[1].y - _[0].y
  2446. };
  2447. break;
  2448. case "polygon":
  2449. t.points.forEach(function (e) {
  2450. var t = e.x[0] * (e.x[1] ? a.width : 1),
  2451. n = e.y[0] * (e.y[1] ? a.height : 1);
  2452. i ? (t < i.left && (i.left = t), t > i.right && (i.right = t), n < i.top && (i.top = n), n > i.bottom && (i.bottom = n)) : i = {
  2453. left: t,
  2454. right: t,
  2455. top: n,
  2456. bottom: n
  2457. }, o ? P.pathListRel.push([o, {
  2458. x: t,
  2459. y: n
  2460. }]) : P.pathListRel = [], o = {
  2461. x: t,
  2462. y: n
  2463. }
  2464. }), P.pathListRel.push([]), e = P.strokeWidth / 2, l = [{
  2465. x: i.left - e,
  2466. y: i.top - e
  2467. }, {
  2468. x: i.right + e,
  2469. y: i.bottom + e
  2470. }], P.bBoxRel = {
  2471. left: l[0].x,
  2472. top: l[0].y,
  2473. right: l[1].x,
  2474. bottom: l[1].y,
  2475. width: l[1].x - l[0].x,
  2476. height: l[1].y - l[0].y
  2477. }
  2478. }
  2479. W.pathListRel = W.bBoxRel = !0
  2480. }
  2481. return (W.pathListRel || W.elementLeft || W.elementTop) && (P.pathData = we(P.pathListRel, function (e) {
  2482. e.x += a.left, e.y += a.top
  2483. })), We(t, N, "strokeWidth", n = P.strokeWidth) && (t.path.style.strokeWidth = n + "px"), Me(n = P.pathData, N.pathData) && (t.path.setPathData(n), N.pathData = n, W.pathData = !0), t.dash && (!W.pathData && (!W.strokeWidth || t.dashLen && t.dashGap) || (P.dashLen = t.dashLen || 2 * P.strokeWidth, P.dashGap = t.dashGap || P.strokeWidth), W.dash = We(t, N, "dashLen", P.dashLen) || W.dash, W.dash = We(t, N, "dashGap", P.dashGap) || W.dash, W.dash && (t.path.style.strokeDasharray = N.dashLen + "," + N.dashGap)), C = P.viewBoxBBox, L = N.viewBoxBBox, A = t.svg.viewBox.baseVal, V = t.svg.style, C.x = P.bBoxRel.left + a.left, C.y = P.bBoxRel.top + a.top, C.width = P.bBoxRel.width, C.height = P.bBoxRel.height, ["x", "y", "width", "height"].forEach(function (e) {
  2484. (n = C[e]) !== L[e] && (A[e] = L[e] = n, V[oe[e]] = n + ("x" === e || "y" === e ? t.bodyOffset[e] : 0) + "px")
  2485. }), W.strokeWidth || W.pathListRel || W.bBoxRel
  2486. }
  2487. },
  2488. mouseHoverAnchor: {
  2489. type: "anchor",
  2490. argOptions: [{
  2491. optionName: "element",
  2492. type: ye
  2493. }, {
  2494. optionName: "showEffectName",
  2495. type: "string"
  2496. }],
  2497. style: {
  2498. backgroundImage: "url('data:image/svg+xml;charset=utf-8;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjI0IiBoZWlnaHQ9IjI0Ij48cG9seWdvbiBwb2ludHM9IjI0LDAgMCw4IDgsMTEgMCwxOSA1LDI0IDEzLDE2IDE2LDI0IiBmaWxsPSJjb3JhbCIvPjwvc3ZnPg==')",
  2499. backgroundSize: "",
  2500. backgroundRepeat: "no-repeat",
  2501. backgroundColor: "#f8f881",
  2502. cursor: "default"
  2503. },
  2504. hoverStyle: {
  2505. backgroundImage: "none",
  2506. backgroundColor: "#fadf8f"
  2507. },
  2508. padding: {
  2509. top: 1,
  2510. right: 15,
  2511. bottom: 1,
  2512. left: 2
  2513. },
  2514. minHeight: 15,
  2515. backgroundPosition: {
  2516. right: 2,
  2517. top: 2
  2518. },
  2519. backgroundSize: {
  2520. width: 12,
  2521. height: 12
  2522. },
  2523. dirKeys: [
  2524. ["top", "Top"],
  2525. ["right", "Right"],
  2526. ["bottom", "Bottom"],
  2527. ["left", "Left"]
  2528. ],
  2529. init: function (a, i) {
  2530. var o, t, e, n, l, r, s, u, h, p, c, d = y.mouseHoverAnchor,
  2531. f = {};
  2532. if (a.element = y.pointAnchor.checkElement(i.element), u = a.element, !((p = u.ownerDocument) && (h = p.defaultView) && h.HTMLElement && u instanceof h.HTMLElement)) throw new Error("`element` must be HTML element");
  2533. return d.style.backgroundSize = d.backgroundSize.width + "px " + d.backgroundSize.height + "px", ["style", "hoverStyle"].forEach(function (e) {
  2534. var n = d[e];
  2535. a[e] = Object.keys(n).reduce(function (e, t) {
  2536. return e[t] = n[t], e
  2537. }, {})
  2538. }), "inline" === (o = a.element.ownerDocument.defaultView.getComputedStyle(a.element, "")).display ? a.style.display = "inline-block" : "none" === o.display && (a.style.display = "block"), y.mouseHoverAnchor.dirKeys.forEach(function (e) {
  2539. var t = e[0],
  2540. n = "padding" + e[1];
  2541. parseFloat(o[n]) < d.padding[t] && (a.style[n] = d.padding[t] + "px")
  2542. }), a.style.display && (n = a.element.style.display, a.element.style.display = a.style.display), y.mouseHoverAnchor.dirKeys.forEach(function (e) {
  2543. var t = "padding" + e[1];
  2544. a.style[t] && (f[t] = a.element.style[t], a.element.style[t] = a.style[t])
  2545. }), (e = a.element.getBoundingClientRect()).height < d.minHeight && (le ? (c = d.minHeight, "content-box" === o.boxSizing ? c -= parseFloat(o.borderTopWidth) + parseFloat(o.borderBottomWidth) + parseFloat(o.paddingTop) + parseFloat(o.paddingBottom) : "padding-box" === o.boxSizing && (c -= parseFloat(o.borderTopWidth) + parseFloat(o.borderBottomWidth)), a.style.height = c + "px") : a.style.height = parseFloat(o.height) + (d.minHeight - e.height) + "px"), a.style.backgroundPosition = ue ? e.width - d.backgroundSize.width - d.backgroundPosition.right + "px " + d.backgroundPosition.top + "px" : "right " + d.backgroundPosition.right + "px top " + d.backgroundPosition.top + "px", a.style.display && (a.element.style.display = n), y.mouseHoverAnchor.dirKeys.forEach(function (e) {
  2546. var t = "padding" + e[1];
  2547. a.style[t] && (a.element.style[t] = f[t])
  2548. }), ["style", "hoverStyle"].forEach(function (e) {
  2549. var t = a[e],
  2550. n = i[e];
  2551. k(n) && Object.keys(n).forEach(function (e) {
  2552. "string" == typeof n[e] || w(n[e]) ? t[e] = n[e] : null == n[e] && delete t[e]
  2553. })
  2554. }), "function" == typeof i.onSwitch && (s = i.onSwitch), i.showEffectName && g[i.showEffectName] && (a.showEffectName = l = i.showEffectName), r = i.animOptions, a.elmStyle = t = a.element.style, a.mouseenter = function (e) {
  2555. a.hoverStyleSave = d.getStyles(t, Object.keys(a.hoverStyle)), d.setStyles(t, a.hoverStyle), a.boundTargets.forEach(function (e) {
  2556. je(e.props, !0, l, r)
  2557. }), s && s(e)
  2558. }, a.mouseleave = function (e) {
  2559. d.setStyles(t, a.hoverStyleSave), a.boundTargets.forEach(function (e) {
  2560. je(e.props, !1, l, r)
  2561. }), s && s(e)
  2562. }, !0
  2563. },
  2564. bind: function (e, t) {
  2565. var n, a, i, o, l;
  2566. return t.props.svg ? y.mouseHoverAnchor.llShow(t.props, !1, e.showEffectName) : Le(function () {
  2567. y.mouseHoverAnchor.llShow(t.props, !1, e.showEffectName)
  2568. }), e.enabled || (e.styleSave = y.mouseHoverAnchor.getStyles(e.elmStyle, Object.keys(e.style)), y.mouseHoverAnchor.setStyles(e.elmStyle, e.style), e.removeEventListener = (n = e.element, a = e.mouseenter, i = e.mouseleave, "onmouseenter" in n && "onmouseleave" in n ? (n.addEventListener("mouseenter", a, !1), n.addEventListener("mouseleave", i, !1), function () {
  2569. n.removeEventListener("mouseenter", a, !1), n.removeEventListener("mouseleave", i, !1)
  2570. }) : (console.warn("mouseenter and mouseleave events polyfill is enabled."), o = function (e) {
  2571. e.relatedTarget && (e.relatedTarget === this || this.compareDocumentPosition(e.relatedTarget) & Node.DOCUMENT_POSITION_CONTAINED_BY) || a.apply(this, arguments)
  2572. }, n.addEventListener("mouseover", o), l = function (e) {
  2573. e.relatedTarget && (e.relatedTarget === this || this.compareDocumentPosition(e.relatedTarget) & Node.DOCUMENT_POSITION_CONTAINED_BY) || i.apply(this, arguments)
  2574. }, n.addEventListener("mouseout", l), function () {
  2575. n.removeEventListener("mouseover", o, !1), n.removeEventListener("mouseout", l, !1)
  2576. })), e.enabled = !0), !0
  2577. },
  2578. unbind: function (e, t) {
  2579. e.enabled && e.boundTargets.length <= 1 && (e.removeEventListener(), y.mouseHoverAnchor.setStyles(e.elmStyle, e.styleSave), e.enabled = !1), y.mouseHoverAnchor.llShow(t.props, !0, e.showEffectName)
  2580. },
  2581. removeOption: function (e, t) {
  2582. y.pointAnchor.removeOption(e, t)
  2583. },
  2584. remove: function (t) {
  2585. t.boundTargets.length && (console.error("LeaderLineAttachment was not unbound by remove"), t.boundTargets.forEach(function (e) {
  2586. y.mouseHoverAnchor.unbind(t, e)
  2587. }))
  2588. },
  2589. getBBoxNest: function (e, t) {
  2590. return ge(e.element, t.baseWindow)
  2591. },
  2592. llShow: function (e, t, n) {
  2593. g[n || e.curStats.show_effect].stop(e, !0, t), e.aplStats.show_on = t
  2594. },
  2595. getStyles: function (n, e) {
  2596. return e.reduce(function (e, t) {
  2597. return e[t] = n[t], e
  2598. }, {})
  2599. },
  2600. setStyles: function (t, n) {
  2601. Object.keys(n).forEach(function (e) {
  2602. t[e] = n[e]
  2603. })
  2604. }
  2605. },
  2606. captionLabel: {
  2607. type: "label",
  2608. argOptions: [{
  2609. optionName: "text",
  2610. type: "string"
  2611. }],
  2612. stats: {
  2613. color: {},
  2614. x: {},
  2615. y: {}
  2616. },
  2617. textStyleProps: ["fontFamily", "fontStyle", "fontVariant", "fontWeight", "fontStretch", "fontSize", "fontSizeAdjust", "kerning", "letterSpacing", "wordSpacing", "textDecoration"],
  2618. init: function (u, t) {
  2619. return "string" == typeof t.text && (u.text = t.text.trim()), !!u.text && ("string" == typeof t.color && (u.color = t.color.trim()), u.outlineColor = "string" == typeof t.outlineColor ? t.outlineColor.trim() : "#fff", Array.isArray(t.offset) && w(t.offset[0]) && w(t.offset[1]) && (u.offset = {
  2620. x: t.offset[0],
  2621. y: t.offset[1]
  2622. }), w(t.lineOffset) && (u.lineOffset = t.lineOffset), y.captionLabel.textStyleProps.forEach(function (e) {
  2623. null != t[e] && (u[e] = t[e])
  2624. }), u.updateColor = function (e) {
  2625. y.captionLabel.updateColor(u, e)
  2626. }, u.updateSocketXY = function (e) {
  2627. var t, n, a, i, o = u.curStats,
  2628. l = u.aplStats,
  2629. r = e.curStats,
  2630. s = r.position_socketXYSE[u.socketIndex];
  2631. null != s.x && (u.offset ? (o.x = s.x + u.offset.x, o.y = s.y + u.offset.y) : (t = u.height / 2, n = Math.max(r.attach_plugSideLenSE[u.socketIndex] || 0, r.line_strokeWidth / 2), a = r.position_socketXYSE[u.socketIndex ? 0 : 1], s.socketId === L || s.socketId === I ? (o.x = s.socketId === L ? s.x - t - u.width : s.x + t, o.y = a.y < s.y ? s.y + n + t : s.y - n - t - u.height) : (o.x = a.x < s.x ? s.x + n + t : s.x - n - t - u.width, o.y = s.socketId === M ? s.y - t - u.height : s.y + t)), We(u, l, "x", i = o.x) && (u.elmPosition.x.baseVal.getItem(0).value = i), We(u, l, "y", i = o.y) && (u.elmPosition.y.baseVal.getItem(0).value = i + u.height))
  2632. }, u.updatePath = function (e) {
  2633. var t, n, a = u.curStats,
  2634. i = u.aplStats,
  2635. o = e.pathList.animVal || e.pathList.baseVal;
  2636. o && (t = y.captionLabel.getMidPoint(o, u.lineOffset), a.x = t.x - u.width / 2, a.y = t.y - u.height / 2, We(u, i, "x", n = a.x) && (u.elmPosition.x.baseVal.getItem(0).value = n), We(u, i, "y", n = a.y) && (u.elmPosition.y.baseVal.getItem(0).value = n + u.height))
  2637. }, u.updateShow = function (e) {
  2638. y.captionLabel.updateShow(u, e)
  2639. }, ue && (u.adjustEdge = function (e, t) {
  2640. var n = u.curStats;
  2641. null != n.x && y.captionLabel.adjustEdge(t, {
  2642. x: n.x,
  2643. y: n.y,
  2644. width: u.width,
  2645. height: u.height
  2646. }, u.strokeWidth / 2)
  2647. }), !0)
  2648. },
  2649. updateColor: function (e, t) {
  2650. var n, a = e.curStats,
  2651. i = e.aplStats,
  2652. o = t.curStats;
  2653. a.color = n = e.color || o.line_color, We(e, i, "color", n) && (e.styleFill.fill = n)
  2654. },
  2655. updateShow: function (e, t) {
  2656. var n = !0 === t.isShown;
  2657. n !== e.isShown && (e.styleShow.visibility = n ? "" : "hidden", e.isShown = n)
  2658. },
  2659. adjustEdge: function (e, t, n) {
  2660. var a = {
  2661. x1: t.x - n,
  2662. y1: t.y - n,
  2663. x2: t.x + t.width + n,
  2664. y2: t.y + t.height + n
  2665. };
  2666. a.x1 < e.x1 && (e.x1 = a.x1), a.y1 < e.y1 && (e.y1 = a.y1), a.x2 > e.x2 && (e.x2 = a.x2), a.y2 > e.y2 && (e.y2 = a.y2)
  2667. },
  2668. newText: function (e, t, n, a, i) {
  2669. var o, l, r, s, u, h;
  2670. return (o = t.createElementNS(b, "text")).textContent = e, [o.x, o.y].forEach(function (e) {
  2671. var t = n.createSVGLength();
  2672. t.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PX, 0), e.baseVal.initialize(t)
  2673. }), "boolean" != typeof f && (f = "paintOrder" in o.style), i && !f ? (r = t.createElementNS(b, "defs"), o.id = a, r.appendChild(o), (u = (l = t.createElementNS(b, "g")).appendChild(t.createElementNS(b, "use"))).href.baseVal = "#" + a, (s = l.appendChild(t.createElementNS(b, "use"))).href.baseVal = "#" + a, (h = u.style).strokeLinejoin = "round", {
  2674. elmPosition: o,
  2675. styleText: o.style,
  2676. styleFill: s.style,
  2677. styleStroke: h,
  2678. styleShow: l.style,
  2679. elmsAppend: [r, l]
  2680. }) : (h = o.style, i && (h.strokeLinejoin = "round", h.paintOrder = "stroke"), {
  2681. elmPosition: o,
  2682. styleText: h,
  2683. styleFill: h,
  2684. styleStroke: i ? h : null,
  2685. styleShow: h,
  2686. elmsAppend: [o]
  2687. })
  2688. },
  2689. getMidPoint: function (e, t) {
  2690. var n, a, i, o = Oe(e),
  2691. l = o.segsLen,
  2692. r = o.lenAll,
  2693. s = -1;
  2694. if ((n = r / 2 + (t || 0)) <= 0) return 2 === (a = e[0]).length ? ve(a[0], a[1], 0) : xe(a[0], a[1], a[2], a[3], 0);
  2695. if (r <= n) return 2 === (a = e[e.length - 1]).length ? ve(a[0], a[1], 1) : xe(a[0], a[1], a[2], a[3], 1);
  2696. for (i = []; n > l[++s];) i.push(e[s]), n -= l[s];
  2697. return 2 === (a = e[s]).length ? ve(a[0], a[1], n / l[s]) : xe(a[0], a[1], a[2], a[3], ke(a[0], a[1], a[2], a[3], n))
  2698. },
  2699. initSvg: function (t, n) {
  2700. var e, a, i = y.captionLabel.newText(t.text, n.baseWindow.document, n.svg, v + "-captionLabel-" + t._id, t.outlineColor);
  2701. ["elmPosition", "styleFill", "styleShow", "elmsAppend"].forEach(function (e) {
  2702. t[e] = i[e]
  2703. }), t.isShown = !1, t.styleShow.visibility = "hidden", y.captionLabel.textStyleProps.forEach(function (e) {
  2704. null != t[e] && (i.styleText[e] = t[e])
  2705. }), i.elmsAppend.forEach(function (e) {
  2706. n.svg.appendChild(e)
  2707. }), e = i.elmPosition.getBBox(), t.width = e.width, t.height = e.height, t.outlineColor && (a = 10 < (a = e.height / 9) ? 10 : a < 2 ? 2 : a, i.styleStroke.strokeWidth = a + "px", i.styleStroke.stroke = t.outlineColor), t.strokeWidth = a || 0, Te(t.aplStats, y.captionLabel.stats), t.updateColor(n), t.refSocketXY ? t.updateSocketXY(n) : t.updatePath(n), ue && De(n, {}), t.updateShow(n)
  2708. },
  2709. bind: function (e, t) {
  2710. var n = t.props;
  2711. return e.color || Ie(n, "cur_line_color", e.updateColor), (e.refSocketXY = "startLabel" === t.optionName || "endLabel" === t.optionName) ? (e.socketIndex = "startLabel" === t.optionName ? 0 : 1, Ie(n, "apl_position", e.updateSocketXY), e.offset || (Ie(n, "cur_attach_plugSideLenSE", e.updateSocketXY), Ie(n, "cur_line_strokeWidth", e.updateSocketXY))) : Ie(n, "apl_path", e.updatePath), Ie(n, "svgShow", e.updateShow), ue && Ie(n, "new_edge4viewBox", e.adjustEdge), y.captionLabel.initSvg(e, n), !0
  2712. },
  2713. unbind: function (e, t) {
  2714. var n = t.props;
  2715. e.elmsAppend && (e.elmsAppend.forEach(function (e) {
  2716. n.svg.removeChild(e)
  2717. }), e.elmPosition = e.styleFill = e.styleShow = e.elmsAppend = null), Te(e.curStats, y.captionLabel.stats), Te(e.aplStats, y.captionLabel.stats), e.color || Ce(n, "cur_line_color", e.updateColor), e.refSocketXY ? (Ce(n, "apl_position", e.updateSocketXY), e.offset || (Ce(n, "cur_attach_plugSideLenSE", e.updateSocketXY), Ce(n, "cur_line_strokeWidth", e.updateSocketXY))) : Ce(n, "apl_path", e.updatePath), Ce(n, "svgShow", e.updateShow), ue && (Ce(n, "new_edge4viewBox", e.adjustEdge), De(n, {}))
  2718. },
  2719. removeOption: function (e, t) {
  2720. var n = t.props,
  2721. a = {};
  2722. a[t.optionName] = "", Ze(n, a)
  2723. },
  2724. remove: function (t) {
  2725. t.boundTargets.length && (console.error("LeaderLineAttachment was not unbound by remove"), t.boundTargets.forEach(function (e) {
  2726. y.captionLabel.unbind(t, e)
  2727. }))
  2728. }
  2729. },
  2730. pathLabel: {
  2731. type: "label",
  2732. argOptions: [{
  2733. optionName: "text",
  2734. type: "string"
  2735. }],
  2736. stats: {
  2737. color: {},
  2738. startOffset: {},
  2739. pathData: {}
  2740. },
  2741. init: function (s, t) {
  2742. return "string" == typeof t.text && (s.text = t.text.trim()), !!s.text && ("string" == typeof t.color && (s.color = t.color.trim()), s.outlineColor = "string" == typeof t.outlineColor ? t.outlineColor.trim() : "#fff", w(t.lineOffset) && (s.lineOffset = t.lineOffset), y.captionLabel.textStyleProps.forEach(function (e) {
  2743. null != t[e] && (s[e] = t[e])
  2744. }), s.updateColor = function (e) {
  2745. y.captionLabel.updateColor(s, e)
  2746. }, s.updatePath = function (e) {
  2747. var t, n = s.curStats,
  2748. a = s.aplStats,
  2749. i = e.curStats,
  2750. o = e.pathList.animVal || e.pathList.baseVal;
  2751. o && (n.pathData = t = y.pathLabel.getOffsetPathData(o, i.line_strokeWidth / 2 + s.strokeWidth / 2 + s.height / 4, 1.25 * s.height), Me(t, a.pathData) && (s.elmPath.setPathData(t), a.pathData = t, s.bBox = s.elmPosition.getBBox(), s.updateStartOffset(e)))
  2752. }, s.updateStartOffset = function (e) {
  2753. var t, n, a, i, o = s.curStats,
  2754. l = s.aplStats,
  2755. r = e.curStats;
  2756. o.pathData && ((2 !== s.semIndex || s.lineOffset) && (t = o.pathData.reduce(function (e, t) {
  2757. var n, a = t.values;
  2758. switch (t.type) {
  2759. case "M":
  2760. i = {
  2761. x: a[0],
  2762. y: a[1]
  2763. };
  2764. break;
  2765. case "L":
  2766. n = {
  2767. x: a[0],
  2768. y: a[1]
  2769. }, i && (e += _e(i, n)), i = n;
  2770. break;
  2771. case "C":
  2772. n = {
  2773. x: a[4],
  2774. y: a[5]
  2775. }, i && (e += be(i, {
  2776. x: a[0],
  2777. y: a[1]
  2778. }, {
  2779. x: a[2],
  2780. y: a[3]
  2781. }, n)), i = n
  2782. }
  2783. return e
  2784. }, 0), a = 0 === s.semIndex ? 0 : 1 === s.semIndex ? t : t / 2, 2 !== s.semIndex && (n = Math.max(r.attach_plugBackLenSE[s.semIndex] || 0, r.line_strokeWidth / 2) + s.strokeWidth / 2 + s.height / 4, a = (a += 0 === s.semIndex ? n : -n) < 0 ? 0 : t < a ? t : a), s.lineOffset && (a = (a += s.lineOffset) < 0 ? 0 : t < a ? t : a), o.startOffset = a, We(s, l, "startOffset", a) && (s.elmOffset.startOffset.baseVal.value = a)))
  2785. }, s.updateShow = function (e) {
  2786. y.captionLabel.updateShow(s, e)
  2787. }, ue && (s.adjustEdge = function (e, t) {
  2788. s.bBox && y.captionLabel.adjustEdge(t, s.bBox, s.strokeWidth / 2)
  2789. }), !0)
  2790. },
  2791. getOffsetPathData: function (e, x, n) {
  2792. var b, a, i = 3,
  2793. k = [];
  2794. function w(e, t) {
  2795. return Math.abs(e.x - t.x) < i && Math.abs(e.y - t.y) < i
  2796. }
  2797. return e.forEach(function (e) {
  2798. var t, n, a, i, o, l, r, s, u, h, p, c, d, f, y, S, m, g, _, v, E;
  2799. 2 === e.length ? (g = e[0], _ = e[1], v = x, E = Math.atan2(g.y - _.y, _.x - g.x) + .5 * Math.PI, t = [{
  2800. x: g.x + Math.cos(E) * v,
  2801. y: g.y + Math.sin(E) * v * -1
  2802. }, {
  2803. x: _.x + Math.cos(E) * v,
  2804. y: _.y + Math.sin(E) * v * -1
  2805. }], b ? (a = b.points, 0 <= (i = Math.atan2(a[1].y - a[0].y, a[0].x - a[1].x) - Math.atan2(e[0].y - e[1].y, e[1].x - e[0].x)) && i <= Math.PI ? n = {
  2806. type: "line",
  2807. points: t,
  2808. inside: !0
  2809. } : (l = Ee(a[0], a[1], x), o = Ee(t[1], t[0], x), s = a[0], h = o, p = t[1], c = (u = l).x - s.x, d = u.y - s.y, f = p.x - h.x, y = p.y - h.y, S = (-d * (s.x - h.x) + c * (s.y - h.y)) / (-f * d + c * y), m = (f * (s.y - h.y) - y * (s.x - h.x)) / (-f * d + c * y), (r = 0 <= S && S <= 1 && 0 <= m && m <= 1 ? {
  2810. x: s.x + m * c,
  2811. y: s.y + m * d
  2812. } : null) ? n = {
  2813. type: "line",
  2814. points: [a[1] = r, t[1]]
  2815. } : (a[1] = w(o, l) ? o : l, n = {
  2816. type: "line",
  2817. points: [o, t[1]]
  2818. }), b.len = _e(a[0], a[1]))) : n = {
  2819. type: "line",
  2820. points: t
  2821. }, n.len = _e(n.points[0], n.points[1]), k.push(b = n)) : (k.push({
  2822. type: "cubic",
  2823. points: function (e, t, n, a, i, o) {
  2824. for (var l, r, s = be(e, t, n, a) / o, u = 1 / (o < i ? s * (i / o) : s), h = [], p = 0; r = (90 - (l = xe(e, t, n, a, p)).angle) * (Math.PI / 180), h.push({
  2825. x: l.x + Math.cos(r) * i,
  2826. y: l.y + Math.sin(r) * i * -1
  2827. }), !(1 <= p);) 1 < (p += u) && (p = 1);
  2828. return h
  2829. }(e[0], e[1], e[2], e[3], x, 16)
  2830. }), b = null)
  2831. }), b = null, k.forEach(function (e) {
  2832. var t;
  2833. "line" === e.type ? (e.inside && (b.len > x ? ((t = b.points)[1] = Ee(t[0], t[1], -x), b.len = _e(t[0], t[1])) : (b.points = null, b.len = 0), e.len > x + n ? ((t = e.points)[0] = Ee(t[1], t[0], -(x + n)), e.len = _e(t[0], t[1])) : (e.points = null, e.len = 0)), b = e) : b = null
  2834. }), k.reduce(function (t, e) {
  2835. var n = e.points;
  2836. return n && (a && w(n[0], a) || t.push({
  2837. type: "M",
  2838. values: [n[0].x, n[0].y]
  2839. }), "line" === e.type ? t.push({
  2840. type: "L",
  2841. values: [n[1].x, n[1].y]
  2842. }) : (n.shift(), n.forEach(function (e) {
  2843. t.push({
  2844. type: "L",
  2845. values: [e.x, e.y]
  2846. })
  2847. })), a = n[n.length - 1]), t
  2848. }, [])
  2849. },
  2850. newText: function (e, t, n, a) {
  2851. var i, o, l, r, s, u, h, p, c, d;
  2852. return (r = (l = t.createElementNS(b, "defs")).appendChild(t.createElementNS(b, "path"))).id = i = n + "-path", (u = (s = t.createElementNS(b, "text")).appendChild(t.createElementNS(b, "textPath"))).href.baseVal = "#" + i, u.startOffset.baseVal.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PX, 0), u.textContent = e, "boolean" != typeof f && (f = "paintOrder" in s.style), a && !f ? (s.id = o = n + "-text", l.appendChild(s), (c = (h = t.createElementNS(b, "g")).appendChild(t.createElementNS(b, "use"))).href.baseVal = "#" + o, (p = h.appendChild(t.createElementNS(b, "use"))).href.baseVal = "#" + o, (d = c.style).strokeLinejoin = "round", {
  2853. elmPosition: s,
  2854. elmPath: r,
  2855. elmOffset: u,
  2856. styleText: s.style,
  2857. styleFill: p.style,
  2858. styleStroke: d,
  2859. styleShow: h.style,
  2860. elmsAppend: [l, h]
  2861. }) : (d = s.style, a && (d.strokeLinejoin = "round", d.paintOrder = "stroke"), {
  2862. elmPosition: s,
  2863. elmPath: r,
  2864. elmOffset: u,
  2865. styleText: d,
  2866. styleFill: d,
  2867. styleStroke: a ? d : null,
  2868. styleShow: d,
  2869. elmsAppend: [l, s]
  2870. })
  2871. },
  2872. initSvg: function (t, n) {
  2873. var e, a, i = y.pathLabel.newText(t.text, n.baseWindow.document, v + "-pathLabel-" + t._id, t.outlineColor);
  2874. ["elmPosition", "elmPath", "elmOffset", "styleFill", "styleShow", "elmsAppend"].forEach(function (e) {
  2875. t[e] = i[e]
  2876. }), t.isShown = !1, t.styleShow.visibility = "hidden", y.captionLabel.textStyleProps.forEach(function (e) {
  2877. null != t[e] && (i.styleText[e] = t[e])
  2878. }), i.elmsAppend.forEach(function (e) {
  2879. n.svg.appendChild(e)
  2880. }), i.elmPath.setPathData([{
  2881. type: "M",
  2882. values: [0, 100]
  2883. }, {
  2884. type: "h",
  2885. values: [100]
  2886. }]), e = i.elmPosition.getBBox(), i.styleText.textAnchor = ["start", "end", "middle"][t.semIndex], 2 !== t.semIndex || t.lineOffset || i.elmOffset.startOffset.baseVal.newValueSpecifiedUnits(SVGLength.SVG_LENGTHTYPE_PERCENTAGE, 50), t.height = e.height, t.outlineColor && (a = 10 < (a = e.height / 9) ? 10 : a < 2 ? 2 : a, i.styleStroke.strokeWidth = a + "px", i.styleStroke.stroke = t.outlineColor), t.strokeWidth = a || 0, Te(t.aplStats, y.pathLabel.stats), t.updateColor(n), t.updatePath(n), t.updateStartOffset(n), ue && De(n, {}), t.updateShow(n)
  2887. },
  2888. bind: function (e, t) {
  2889. var n = t.props;
  2890. return e.color || Ie(n, "cur_line_color", e.updateColor), Ie(n, "cur_line_strokeWidth", e.updatePath), Ie(n, "apl_path", e.updatePath), e.semIndex = "startLabel" === t.optionName ? 0 : "endLabel" === t.optionName ? 1 : 2, (2 !== e.semIndex || e.lineOffset) && Ie(n, "cur_attach_plugBackLenSE", e.updateStartOffset), Ie(n, "svgShow", e.updateShow), ue && Ie(n, "new_edge4viewBox", e.adjustEdge), y.pathLabel.initSvg(e, n), !0
  2891. },
  2892. unbind: function (e, t) {
  2893. var n = t.props;
  2894. e.elmsAppend && (e.elmsAppend.forEach(function (e) {
  2895. n.svg.removeChild(e)
  2896. }), e.elmPosition = e.elmPath = e.elmOffset = e.styleFill = e.styleShow = e.elmsAppend = null), Te(e.curStats, y.pathLabel.stats), Te(e.aplStats, y.pathLabel.stats), e.color || Ce(n, "cur_line_color", e.updateColor), Ce(n, "cur_line_strokeWidth", e.updatePath), Ce(n, "apl_path", e.updatePath), (2 !== e.semIndex || e.lineOffset) && Ce(n, "cur_attach_plugBackLenSE", e.updateStartOffset), Ce(n, "svgShow", e.updateShow), ue && (Ce(n, "new_edge4viewBox", e.adjustEdge), De(n, {}))
  2897. },
  2898. removeOption: function (e, t) {
  2899. var n = t.props,
  2900. a = {};
  2901. a[t.optionName] = "", Ze(n, a)
  2902. },
  2903. remove: function (t) {
  2904. t.boundTargets.length && (console.error("LeaderLineAttachment was not unbound by remove"), t.boundTargets.forEach(function (e) {
  2905. y.pathLabel.unbind(t, e)
  2906. }))
  2907. }
  2908. }
  2909. }, Object.keys(y).forEach(function (e) {
  2910. Ye[e] = function () {
  2911. return new S(y[e], Array.prototype.slice.call(arguments))
  2912. }
  2913. }), Ye.positionByWindowResize = !0, window.addEventListener("resize", O.add(function () {
  2914. Ye.positionByWindowResize && Object.keys(K).forEach(function (e) {
  2915. De(K[e], {
  2916. position: !0
  2917. })
  2918. })
  2919. }), !1), Ye
  2920. }();
  2921. export default LeaderLine;