graphdb-workbench 2.6.0-TR2 → 10.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/dist/{0.4ddeb8379f96458f632e.bundle.js → 0.f8448f998a59db17e94e.bundle.js} +1 -1
  2. package/dist/{9.abf23c64b5f041197641.bundle.js → 10.a26ae97905866618b14e.bundle.js} +1 -1
  3. package/dist/{100.30b22eaf2bc647082625.bundle.js → 100.aef098a33fbb925e0d2d.bundle.js} +1 -1
  4. package/dist/{101.4093fce7d4115fcf21dc.bundle.js → 101.42eacc63e0fb5834b78a.bundle.js} +1 -1
  5. package/dist/{102.a98125e7cbe44cf536e2.bundle.js → 102.4f78eeab62aac245879e.bundle.js} +1 -1
  6. package/dist/{103.4d162f7df14c8d81157b.bundle.js → 103.f38f3cd69ff610955aaf.bundle.js} +1 -1
  7. package/dist/{104.f0696d49ede65b342317.bundle.js → 104.2e21f1462021dca17db1.bundle.js} +1 -1
  8. package/dist/{105.097830cf884ff7d82859.bundle.js → 105.76381cb7984bcbc9ba9a.bundle.js} +1 -1
  9. package/dist/{106.2e488f1a9b4b22ad4026.bundle.js → 106.23e14c6b280756d04533.bundle.js} +1 -1
  10. package/dist/{107.0495c9673045f1f68bdf.bundle.js → 107.75e40619cb45972dc39f.bundle.js} +1 -1
  11. package/dist/{108.20ec9347815ab00c4f28.bundle.js → 108.f09444e990531d27e0be.bundle.js} +1 -1
  12. package/dist/{109.9699fc25bc788fe01bb3.bundle.js → 109.ef97393181ee534042d8.bundle.js} +1 -1
  13. package/dist/{110.f101a1762899931179a6.bundle.js → 110.d59b8565d2255a282669.bundle.js} +1 -1
  14. package/dist/{111.782fffba201a2ef304d0.bundle.js → 111.fff9f089f65f01013923.bundle.js} +1 -1
  15. package/dist/{112.529d6e279b6d0bbaff2e.bundle.js → 112.5bd3fcd7c37f1024fe26.bundle.js} +1 -1
  16. package/dist/{113.94c8128e0dc2ff349d42.bundle.js → 113.2fa29eca15d32deb3320.bundle.js} +1 -1
  17. package/dist/{114.2fa7a38692c626887bfe.bundle.js → 114.d78615087abe68db7b2f.bundle.js} +1 -1
  18. package/dist/{115.8f90e89fb972eacc5c33.bundle.js → 115.558ce3da00d3be87d18a.bundle.js} +1 -1
  19. package/dist/{116.dd7d9db80081251674c2.bundle.js → 116.577aab1d9bafd0053623.bundle.js} +1 -1
  20. package/dist/{117.4d04f878d3c445436ca8.bundle.js → 117.c20f037799328c931eba.bundle.js} +1 -1
  21. package/dist/118.39c8b47405ab93c40847.bundle.js +1 -0
  22. package/dist/12.7877dd6008df9acf44e1.bundle.js +1 -0
  23. package/dist/{125.abd9c932b04bf1918f0a.bundle.js → 125.9e925ae0dd1217d81d89.bundle.js} +1 -1
  24. package/dist/{126.3beb08441d05b3056596.bundle.js → 126.a32b57d6108545746ed3.bundle.js} +1 -1
  25. package/dist/{13.def661d2d5c02515c46c.bundle.js → 13.fe78f15334507bcc08ae.bundle.js} +1 -1
  26. package/dist/{130.50cab19d9a05679b290f.bundle.js → 130.f8e68ac86e17b3622d40.bundle.js} +1 -1
  27. package/dist/{132.7eda30b601ebb4631b38.bundle.js → 132.7815ab1168a254cb0d47.bundle.js} +1 -1
  28. package/dist/{135.5efd7db8f7bf674d66d4.bundle.js → 135.c07268699f76ef7a02ff.bundle.js} +1 -1
  29. package/dist/{136.2b898a27e978ab15bc3e.bundle.js → 136.908f1f6fe3054f99b560.bundle.js} +1 -1
  30. package/dist/{14.1dfee181edb0d04c106b.bundle.js → 14.0bb211bcdc29c6d8b3b5.bundle.js} +2 -2
  31. package/dist/{140.f76f2bc779661b218a98.bundle.js → 140.6b3c57ffec700081328b.bundle.js} +1 -1
  32. package/dist/{144.eb8b50eebf16a7196b12.bundle.js → 144.3f85f8eacae521d52355.bundle.js} +1 -1
  33. package/dist/{146.29a91af34c64ed2fe1e3.bundle.js → 146.51d2987de4defe7df7c7.bundle.js} +1 -1
  34. package/dist/{148.9042ca5db63f1ab3fb40.bundle.js → 148.ad95b30f508a0bd02970.bundle.js} +1 -1
  35. package/dist/149.8dd1281617389f8c189b.bundle.js +1 -0
  36. package/dist/{15.9e572627540e9ccd1274.bundle.js → 15.6a74adbd30b4d2930e10.bundle.js} +1 -1
  37. package/dist/{150.4db7163e83efe461fc24.bundle.js → 150.5e0ee4350f8edd0e7b9a.bundle.js} +1 -1
  38. package/dist/{151.a3d78e05b8802fb4db40.bundle.js → 151.6b81c99a1ec1b184b82d.bundle.js} +1 -1
  39. package/dist/{155.691eea60dddb31013b32.bundle.js → 155.a4511849c1001c5f2ba6.bundle.js} +1 -1
  40. package/dist/{16.942efd726d9ff25c0ed7.bundle.js → 16.2f60fbeaccd97aefaae2.bundle.js} +1 -1
  41. package/dist/{17.a5217a46072ac762cb3b.bundle.js → 17.2bff7856b13fd72e2db4.bundle.js} +1 -1
  42. package/dist/178.e10370553beb5c6bb839.bundle.js +1 -1
  43. package/dist/{18.8351ac2380235200c997.bundle.js → 18.d6be3e6583bf3dacd54f.bundle.js} +2 -2
  44. package/dist/180.d37db50f3ce1b3a04a65.bundle.js +1 -1
  45. package/dist/183.a086e00d4dc3c7855611.bundle.js +1 -1
  46. package/dist/{20.a767f3f92d8510e602d4.bundle.js → 20.8fd969e3860ddffedcc3.bundle.js} +1 -1
  47. package/dist/{201.ec71ced13a1fefb48ac2.bundle.js → 201.a1b147e78f43a3bc99c3.bundle.js} +1 -1
  48. package/dist/21.c981976c6528073c0a2f.bundle.js +1 -0
  49. package/dist/210.1ac38e393ca959703d4b.bundle.js +1 -1
  50. package/dist/{23.e3de3e200d80d72afe02.bundle.js → 23.87ca8226d464e3699b8e.bundle.js} +2 -2
  51. package/dist/24.9076b75f45ce0579f7be.bundle.js +1 -0
  52. package/dist/{25.9299f9388d96ed4b97be.bundle.js → 25.073791b8dd02c5b31183.bundle.js} +1 -1
  53. package/dist/{26.7ddc010c3aa4c7a3f0eb.bundle.js → 26.6e06be7172a866ad45f9.bundle.js} +1 -1
  54. package/dist/{28.833c206dedf826927b2e.bundle.js → 28.90b784e728e3d5e4c6aa.bundle.js} +1 -1
  55. package/dist/{29.bea28befc9ef8e1f184d.bundle.js → 29.e2309b858706718f1732.bundle.js} +1 -1
  56. package/dist/{30.030d90c9357b6a09a423.bundle.js → 30.32fb84930c42bae43a74.bundle.js} +1 -1
  57. package/dist/31.31b7b4bd073b82c09fda.bundle.js +1 -0
  58. package/dist/{33.4946380f783ad92bf587.bundle.js → 33.fa9f0e662060f2e97267.bundle.js} +1 -1
  59. package/dist/{35.c6277b1733bb56ebb77f.bundle.js → 35.e601e19e63c6ddaf2484.bundle.js} +1 -1
  60. package/dist/{36.72e6e6001da4167c42fc.bundle.js → 36.df47a70d8efbf1cd033b.bundle.js} +1 -1
  61. package/dist/{37.15eb38b5e7c67604d2df.bundle.js → 37.085cdb373f74d55eee07.bundle.js} +1 -1
  62. package/dist/{4.17e90cc8791b3078f7f2.bundle.js → 4.851f9ade6202116ecfb9.bundle.js} +1 -1
  63. package/dist/{41.aba092368b9345fe062a.bundle.js → 41.3870740f1d24570cb415.bundle.js} +1 -1
  64. package/dist/{42.3d78a3aa611c675962fb.bundle.js → 42.b926c2c8620df5c7ed6d.bundle.js} +1 -1
  65. package/dist/{43.144a809e888a9f3e6035.bundle.js → 43.d4551e1f6cac0a1a77e5.bundle.js} +1 -1
  66. package/dist/{47.19d84d51353da324399f.bundle.js → 47.4fbfdaa63628c501a30c.bundle.js} +1 -1
  67. package/dist/{48.5334aa76217b85ac729a.bundle.js → 48.3fbd50adcb0c7dd7ec60.bundle.js} +1 -1
  68. package/dist/{50.d8c0fe9c4a8bbf8cbf58.bundle.js → 50.8f6cc698b42c96f2b41f.bundle.js} +1 -1
  69. package/dist/{51.4f3e41ab41b59f359e84.bundle.js → 51.514a339efd6cd11db0f8.bundle.js} +1 -1
  70. package/dist/{52.ed08d9de32fbb03170a1.bundle.js → 52.410a7d8b4cb433fb24ca.bundle.js} +1 -1
  71. package/dist/{53.0e96b9739e67da831aeb.bundle.js → 53.174d18435f7bf3bf05a0.bundle.js} +1 -1
  72. package/dist/{54.220668833b7f4732d146.bundle.js → 54.7cb3bd3ae8055e350629.bundle.js} +1 -1
  73. package/dist/{55.917f9fc02948849b1185.bundle.js → 55.f0762e755ba58cbaac26.bundle.js} +1 -1
  74. package/dist/{56.d0fe2e2f05bb3e45c0b7.bundle.js → 56.3b0312e77f8607a4d957.bundle.js} +1 -1
  75. package/dist/{57.f3097d895908a5c14d56.bundle.js → 57.dfb7a710da8ca09c725b.bundle.js} +1 -1
  76. package/dist/{58.ff2b52ebb6d6bb67b9f6.bundle.js → 58.ac0fa95bbbe4b2dfb0fc.bundle.js} +1 -1
  77. package/dist/{59.11001f666650393fdaf8.bundle.js → 59.273ffcd48e856d2752ff.bundle.js} +1 -1
  78. package/dist/{60.7e65a6c5670a1ac562e2.bundle.js → 60.00a29320ea162becd718.bundle.js} +1 -1
  79. package/dist/{61.3ba84cc3819eb17de234.bundle.js → 61.3794de8b6d022738bafa.bundle.js} +1 -1
  80. package/dist/{62.2d331d4634959f64f7ce.bundle.js → 62.cf39ad55adb1616560ec.bundle.js} +1 -1
  81. package/dist/{63.96b16e7916f446e1a74d.bundle.js → 63.8880f667c958d12b338b.bundle.js} +1 -1
  82. package/dist/{65.385dff0daed228cead67.bundle.js → 65.cdc961a8042c385c49c6.bundle.js} +1 -1
  83. package/dist/{66.49324c26c968bb61453b.bundle.js → 66.c3b906de2fcf69089b7b.bundle.js} +1 -1
  84. package/dist/{67.cd23d15626be33cc84c7.bundle.js → 67.9c851e5930459a5f5903.bundle.js} +1 -1
  85. package/dist/{69.1255e8072e739c4b3486.bundle.js → 69.c5561c83fe410ea9a908.bundle.js} +1 -1
  86. package/dist/{70.fe6fbd7331d2373c8a24.bundle.js → 70.f2557c225be5923bab24.bundle.js} +1 -1
  87. package/dist/{72.6e8d51e0d240af360ab5.bundle.js → 72.0780a8424293909f94a4.bundle.js} +1 -1
  88. package/dist/{74.042e0bb0fcc0661d32b0.bundle.js → 74.48e90caf0b5ecd351f1d.bundle.js} +1 -1
  89. package/dist/{78.569dd71e4cc7ac3a4383.bundle.js → 78.66f3e9630550f20287ff.bundle.js} +1 -1
  90. package/dist/{8.1893fcb7fc2f0fc7c83e.bundle.js → 8.b5e29f80f8a5766d70d5.bundle.js} +1 -1
  91. package/dist/{81.c378171b96d12cdf8bcc.bundle.js → 81.2ff1f5047ab4e0591585.bundle.js} +1 -1
  92. package/dist/{86.62f32aad4394438158a1.bundle.js → 86.637667a4555ae621aff0.bundle.js} +1 -1
  93. package/dist/{87.7efe382329921dae6a63.bundle.js → 87.b76338a62297ad83960b.bundle.js} +1 -1
  94. package/dist/{88.f442fbeb61fe955ce244.bundle.js → 88.532e7295b49b1071d45c.bundle.js} +1 -1
  95. package/dist/{89.560e5a053d8dcbaca38a.bundle.js → 89.90bb1cf65f183ecce47c.bundle.js} +1 -1
  96. package/dist/9.610b595b60a0fc51466a.bundle.js +1 -0
  97. package/dist/{90.3fedce156ebc83022f47.bundle.js → 90.683c4d5b142356f274ef.bundle.js} +1 -1
  98. package/dist/{91.08b1de35f973e0283974.bundle.js → 91.2437dfc2ea1bc89f53f3.bundle.js} +1 -1
  99. package/dist/{92.fcea4fdca795fa33f2fb.bundle.js → 92.a12cfd3b602e98b344de.bundle.js} +1 -1
  100. package/dist/{93.420c7a3794d642e35e63.bundle.js → 93.a5cb6192d32cb016bb60.bundle.js} +1 -1
  101. package/dist/{94.cf5b0e70e34e60663eb5.bundle.js → 94.f6a3e7628449796419b6.bundle.js} +1 -1
  102. package/dist/{95.a6ad56ceb5d5a63c2b8d.bundle.js → 95.15f0e472c49c81a68c3a.bundle.js} +1 -1
  103. package/dist/{96.524be695eddce9b9905c.bundle.js → 96.2bf3b75fb0efb6b9e7e8.bundle.js} +1 -1
  104. package/dist/{97.7173fb835cc5b1ac4cda.bundle.js → 97.bd1988af419f7373b569.bundle.js} +1 -1
  105. package/dist/{98.18b00fa95b6f5b1cf072.bundle.js → 98.060c6842b3a8ed94dd20.bundle.js} +1 -1
  106. package/dist/{99.a89c13f7abc4e0374809.bundle.js → 99.6360b70da56083cd76fe.bundle.js} +1 -1
  107. package/dist/{bundle.3b4bcf1d306742531790.bundle.js → bundle.39b836d40f0926aeec16.bundle.js} +6 -6
  108. package/dist/i18n/locale-en.json +0 -2
  109. package/dist/i18n/locale-fr.json +0 -2
  110. package/dist/index.html +3 -3
  111. package/dist/js/angular/core/directives/autocomplete/templates/autocomplete.html +1 -1
  112. package/dist/js/angular/core/directives/operations-statuses-monitor/templates/operations-statuses-monitor.html +1 -1
  113. package/dist/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html +1 -1
  114. package/dist/js/angular/import/templates/settingsModal.html +1 -17
  115. package/dist/js/angular/security/templates/user.html +1 -1
  116. package/dist/license-checker.json +2 -2
  117. package/dist/pages/aclmanagement.html +1 -1
  118. package/dist/pages/autocomplete.html +1 -1
  119. package/dist/pages/choose-repository-type.html +1 -1
  120. package/dist/pages/cluster-management/clusterInfo.html +9 -8
  121. package/dist/pages/create-index.html +4 -4
  122. package/dist/pages/dependencies.html +1 -1
  123. package/dist/pages/domainRangeInfo.html +2 -2
  124. package/dist/pages/edit.html +1 -1
  125. package/dist/pages/explore.html +1 -1
  126. package/dist/pages/export.html +1 -1
  127. package/dist/pages/find.html +1 -1
  128. package/dist/pages/graph-config/saveGraphConfig.html +11 -11
  129. package/dist/pages/graphs-visualizations.html +7 -7
  130. package/dist/pages/guides.html +1 -1
  131. package/dist/pages/import.html +1 -1
  132. package/dist/pages/jdbc-create.html +5 -5
  133. package/dist/pages/monitor/backup-and-restore.html +1 -1
  134. package/dist/pages/monitor/queries.html +1 -1
  135. package/dist/pages/monitor/resources.html +1 -1
  136. package/dist/pages/namespaces.html +2 -2
  137. package/dist/pages/plugins.html +1 -1
  138. package/dist/pages/rdfClassHierarchyInfo.html +7 -7
  139. package/dist/pages/rdfrank.html +2 -2
  140. package/dist/pages/repositories.html +1 -1
  141. package/dist/pages/repository.html +1 -1
  142. package/dist/pages/similarity-indexes.html +1 -1
  143. package/dist/pages/sparql-template-create.html +5 -5
  144. package/dist/pages/sparql.html +3 -3
  145. package/dist/pages/webapi.html +2 -2
  146. package/dist/res/swagger/index.html +27 -27
  147. package/package.json +1 -1
  148. package/dist/10.9b05de3fe8a117488185.bundle.js +0 -1
  149. package/dist/118.617f073c1c06392bd6c0.bundle.js +0 -1
  150. package/dist/12.398d835e04b0488b2ed8.bundle.js +0 -1
  151. package/dist/149.3880824512c5fa745836.bundle.js +0 -1
  152. package/dist/21.8209c5bb8d6226be6ea6.bundle.js +0 -1
  153. package/dist/24.057349cb66120daf4c4e.bundle.js +0 -1
  154. package/dist/31.ce2be87bd69611496fdf.bundle.js +0 -1
@@ -1,4 +1,4 @@
1
- !function(e){function t(t){for(var n,i,o=t[0],a=t[1],s=0,l=[];s<o.length;s++)i=o[s],Object.prototype.hasOwnProperty.call(r,i)&&r[i]&&l.push(r[i][0]),r[i]=0;for(n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);for(u&&u(t);l.length;)l.shift()()}var n={},r={165:0};function i(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,i),r.l=!0,r.exports}i.e=function(e){var t=[],n=r[e];if(0!==n)if(n)t.push(n[2]);else{var o=new Promise((function(t,i){n=r[e]=[t,i]}));t.push(n[2]=o);var a,s=document.createElement("script");s.charset="utf-8",s.timeout=120,i.nc&&s.setAttribute("nonce",i.nc),s.src=function(e){return i.p+""+({}[e]||e)+"."+{0:"4ddeb8379f96458f632e",1:"46d9ecd4119bac145f3b",2:"78b4e53269171c9c08a5",3:"cf89087c137e759ecd19",4:"17e90cc8791b3078f7f2",5:"7cfbc07050f137932ffe",6:"c5eea752e1f541f494e8",7:"14f008aaac190939acd3",8:"1893fcb7fc2f0fc7c83e",9:"abf23c64b5f041197641",10:"9b05de3fe8a117488185",11:"0fc995ac096734b915c6",12:"398d835e04b0488b2ed8",13:"def661d2d5c02515c46c",14:"1dfee181edb0d04c106b",15:"9e572627540e9ccd1274",16:"942efd726d9ff25c0ed7",17:"a5217a46072ac762cb3b",18:"8351ac2380235200c997",19:"c2a5c3e7a49a4acba486",20:"a767f3f92d8510e602d4",21:"8209c5bb8d6226be6ea6",22:"9d339503774f4f6c0a8b",23:"e3de3e200d80d72afe02",24:"057349cb66120daf4c4e",25:"9299f9388d96ed4b97be",26:"7ddc010c3aa4c7a3f0eb",27:"5152c2a1f3b1369e21b0",28:"833c206dedf826927b2e",29:"bea28befc9ef8e1f184d",30:"030d90c9357b6a09a423",31:"ce2be87bd69611496fdf",32:"6725d94946764db833b8",33:"4946380f783ad92bf587",34:"af22bc6d5ed2bcb72a09",35:"c6277b1733bb56ebb77f",36:"72e6e6001da4167c42fc",37:"15eb38b5e7c67604d2df",38:"fc172c7b0d24ab0f8a35",39:"5ca9fa51ec3c63459317",40:"309ec5212fd53fe696bb",41:"aba092368b9345fe062a",42:"3d78a3aa611c675962fb",43:"144a809e888a9f3e6035",44:"46c9e2d54a9f07d78368",45:"a916daee1f0c6873c890",46:"4f57238bd032edc81d6d",47:"19d84d51353da324399f",48:"5334aa76217b85ac729a",49:"0707795b3b6e40387da8",50:"d8c0fe9c4a8bbf8cbf58",51:"4f3e41ab41b59f359e84",52:"ed08d9de32fbb03170a1",53:"0e96b9739e67da831aeb",54:"220668833b7f4732d146",55:"917f9fc02948849b1185",56:"d0fe2e2f05bb3e45c0b7",57:"f3097d895908a5c14d56",58:"ff2b52ebb6d6bb67b9f6",59:"11001f666650393fdaf8",60:"7e65a6c5670a1ac562e2",61:"3ba84cc3819eb17de234",62:"2d331d4634959f64f7ce",63:"96b16e7916f446e1a74d",64:"fdd90fedc8a5dc3cacaf",65:"385dff0daed228cead67",66:"49324c26c968bb61453b",67:"cd23d15626be33cc84c7",68:"05bba948c414a1e21c8f",69:"1255e8072e739c4b3486",70:"fe6fbd7331d2373c8a24",71:"e9c3c5ccc70f443c97cf",72:"6e8d51e0d240af360ab5",73:"57e88cee0af3f67aee77",74:"042e0bb0fcc0661d32b0",75:"c75a824264d0e67421ed",76:"2ad0f5373462bc70bebf",77:"303a075d21928354102c",78:"569dd71e4cc7ac3a4383",79:"29d39a29721f936ae688",80:"8af0388db859fcc9fbf3",81:"c378171b96d12cdf8bcc",82:"27bb51dfeb4898504e96",83:"a59d34bc50cf323af43d",84:"a4ee7bb5d3ed2e6ead5e",85:"1f1b07562fbf97ab3e11",86:"62f32aad4394438158a1",87:"7efe382329921dae6a63",88:"f442fbeb61fe955ce244",89:"560e5a053d8dcbaca38a",90:"3fedce156ebc83022f47",91:"08b1de35f973e0283974",92:"fcea4fdca795fa33f2fb",93:"420c7a3794d642e35e63",94:"cf5b0e70e34e60663eb5",95:"a6ad56ceb5d5a63c2b8d",96:"524be695eddce9b9905c",97:"7173fb835cc5b1ac4cda",98:"18b00fa95b6f5b1cf072",99:"a89c13f7abc4e0374809",100:"30b22eaf2bc647082625",101:"4093fce7d4115fcf21dc",102:"a98125e7cbe44cf536e2",103:"4d162f7df14c8d81157b",104:"f0696d49ede65b342317",105:"097830cf884ff7d82859",106:"2e488f1a9b4b22ad4026",107:"0495c9673045f1f68bdf",108:"20ec9347815ab00c4f28",109:"9699fc25bc788fe01bb3",110:"f101a1762899931179a6",111:"782fffba201a2ef304d0",112:"529d6e279b6d0bbaff2e",113:"94c8128e0dc2ff349d42",114:"2fa7a38692c626887bfe",115:"8f90e89fb972eacc5c33",116:"dd7d9db80081251674c2",117:"4d04f878d3c445436ca8",118:"617f073c1c06392bd6c0",119:"19ee7b3ae143f817c5b1",120:"b944d5e63424d4307fc8",121:"3a8954e4c885c56a9817",122:"71a8cf0330504672fffc",123:"c6957ecb441d8a09932a",124:"27e85a0284e2ebeb7d6e",125:"abd9c932b04bf1918f0a",126:"3beb08441d05b3056596",127:"90d1975083eef3d4a715",128:"544f1a82e19dd245c7de",129:"64ec11449e0c734500c2",130:"50cab19d9a05679b290f",131:"4868fc3a837277c30273",132:"7eda30b601ebb4631b38",133:"f87e1685dd5ed920f9b5",134:"8998ff724a077ecff2ce",135:"5efd7db8f7bf674d66d4",136:"2b898a27e978ab15bc3e",137:"8262ca9736e9818284cd",138:"8c149cad49010a65b3ca",139:"97ee12e7a3c05be03456",140:"f76f2bc779661b218a98",141:"4981056237955a34b2e2",142:"4d60c1795eed3a9570f9",143:"b7057852f7859cf39e75",144:"eb8b50eebf16a7196b12",145:"9281069e9e77978b640a",146:"29a91af34c64ed2fe1e3",147:"54016549674d35bc2869",148:"9042ca5db63f1ab3fb40",149:"3880824512c5fa745836",150:"4db7163e83efe461fc24",151:"a3d78e05b8802fb4db40",152:"2e1aa910a68f0086825b",153:"7a64973115bdaec26406",154:"5938248b52830d0a80a2",155:"691eea60dddb31013b32",156:"bbcaf52acb0cecbc6257",157:"51181d03518519f84b5e",158:"640e412f6002ee1d7341",159:"10457cbb053c1315d93a",160:"c46bfdf09357a4c62a53",161:"0f35ee11981f0ea0455f",162:"fef28120701e7d200b01",163:"38565d40ac5f71d1c875",164:"b2116f472aa847618aee",168:"2d4b5a75da5430c73efc",169:"6897f56896e3664e8b53",170:"d5c0d475c5b6ad84ef77",171:"60cdc91b2bf682a20911",172:"1fb9ead3e508a7cfa5f3",173:"95602c81a2692624a015",174:"aac1982e67b5ca1731c1",175:"5e49a28397900168f816",176:"2e6d1a9f4eac4fdd8422",177:"3b6aabf3c4db8519ea74",178:"e10370553beb5c6bb839",179:"784cbd536b8e636c1272",180:"d37db50f3ce1b3a04a65",181:"f307cabdc4ed7a10ff64",182:"e8fe148e90fcd334b9b9",183:"a086e00d4dc3c7855611",184:"ff8a39692d0ff666c9e6",185:"8b9f0b866e848f8a1aac",186:"798880846274da7033da",187:"eb92a35d38294bc21703",188:"641582484af80415d29a",189:"7ccbb0ef67513ae7001a",190:"a3609218c5d8e873a46f",191:"4c817606bf66c16d9ad1",192:"21f366a1ea7e6905f120",193:"4d40b788bd7ddcf16788",194:"0170093f1daf20e82b5f",195:"d7d8af61458f9416878f",196:"6e6b7589cd1342a0b2b5",197:"c071fa1fe9e081a3b053",198:"3c5ca9ac5a745b4b23a1",199:"00ac5221a334189ea09a",200:"aa3f4dcf9cf98409dbf5",201:"ec71ced13a1fefb48ac2",202:"20e71b18f57e7d234ff0",203:"0219c2ba2d4fe4881af2",204:"cc169603e18b84e7e65b",205:"99fb3c89cd9b9183ddbf",206:"43b04d2170165e13353c",207:"798c195e1d7d3f301131",208:"34f042066a757f4fd8c0",209:"288844c6a42ff4d5685a",210:"1ac38e393ca959703d4b",211:"d2721b9785e609e2f817",212:"b6b19c939f21132b451c",213:"5a5116f764e6357e53ab",214:"a2640be51c42d820bb83",215:"209396a71f130477e2b3",216:"16e2e982acc750b4045a",217:"8540eb1d1a0946e72dbf",218:"ef33580c82d20f39f75f",219:"1652bc940cdd0088dc18",220:"f8f9c348b1fc0cc72bd6",221:"b18a92f0ba880edaebbf",222:"a52ebecd1d5201437ebe"}[e]+".bundle.js"}(e);var u=new Error;a=function(t){s.onerror=s.onload=null,clearTimeout(l);var n=r[e];if(0!==n){if(n){var i=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;u.message="Loading chunk "+e+" failed.\n("+i+": "+o+")",u.name="ChunkLoadError",u.type=i,u.request=o,n[1](u)}r[e]=void 0}};var l=setTimeout((function(){a({type:"timeout",target:s})}),12e4);s.onerror=s.onload=a,document.head.appendChild(s)}return Promise.all(t)},i.m=e,i.c=n,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(n,r,function(t){return e[t]}.bind(null,r));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i.oe=function(e){throw console.error(e),e};var o=window.webpackJsonp=window.webpackJsonp||[],a=o.push.bind(o);o.push=t,o=o.slice();for(var s=0;s<o.length;s++)t(o[s]);var u=a;i(i.s=0)}([function(e,t,n){"use strict";n.r(t),n.d(t,"decodeHTML",(function(){return r}));n(7),n(40),n(46),n(249),n(55),n(250),n(34),n(35),n(47),n(48),n(49),n(50),n(51),n(52);const r=function(e){let t=document.createElement("textarea");return t.innerHTML=e,t.value},i=["ngRoute","graphdb.workbench.se.controllers","graphdb.framework.core","angularCancelOnNavigateModule","oc.lazyLoad","pascalprecht.translate","graphdb.framework.core.interceptors.unauthorized","graphdb.framework.core.interceptors.authentication","graphdb.framework.core.directives.rdfresourcesearch.rdfresourcesearch","graphdb.framework.core.directives.languageselector.languageselector","graphdb.framework.core.directives.angular-tooltips","graphdb.framework.core.directives.uppercased","graphdb.framework.guides.services","graphdb.framework.core.directives.operationsstatusesmonitor","graphdb.framework.core.directives.autocomplete"],o=["$routeProvider","$locationProvider","$menuItemsProvider","toastrConfig","localStorageServiceProvider","$uibTooltipProvider","$httpProvider","$templateRequestProvider","$translateProvider"];$.get("rest/info/version?local=1",(function(e){const t=e.productVersion.match(/^(\d+\.\d+)/);t.length?e.productShortVersion=t[1]:e.productShortVersion=e.productVersion;const a=e.productVersion.match(/(-.*?)(-|$)/);a&&a.length&&(e.productShortVersion=e.productShortVersion+a[1]),function(e){const t=angular.module("graphdb.workbench",i);t.config([...o,function(t,r,i,o,a,s,u,l,c){c.useStaticFilesLoader({prefix:"i18n/locale-",suffix:".json?v=2.6.0-TR2"}),c.preferredLanguage("en"),c.useSanitizeValueStrategy("escape"),angular.extend(o,{timeOut:5e3,positionClass:"toast-bottom-right",tapToDismiss:!1,extendedTimeOut:5e3}),a.setStorageType("localStorage").setNotify(!0,!0);var p=t.$get[t.$get.length-1]({$on:function(){}});t.when("_openid_implicit_",{controller:function(){},template:"<div></div>"}),p.routes._openid_implicit_.regexp=/[&/](?:id_token=.*&access_token=|access_token=.*&id_token=)/;let h=PluginRegistry.get("route");angular.forEach(h,(function(e){t.when(e.url,{controller:e.controller,templateUrl:e.templateUrl,title:e.title,helpInfo:e.helpInfo,reloadOnSearch:void 0===e.reloadOnSearch||e.reloadOnSearch,resolve:{preload:["$ocLazyLoad","$q",function(t,r){return e.path?n(251)("./"+e.path).then(n=>{t.inject(e.module)}):r.defer().resolve()}]}})})),t.otherwise({templateUrl:"pages/not_found.html"}),r.html5Mode(!0),s.setTriggers({show:"hide"}),s.options({appendToBody:!0}),i.setProductInfo(e),PluginRegistry.get("main.menu").forEach((function(e){e.items.forEach((function(e){i.addItem(e)}))})),u.interceptors.push("$unauthorizedInterceptor"),u.interceptors.push("$authenticationInterceptor");const d=l.$get[3];"function"==typeof d&&(l.$get[3]=function(e,t,n){const r=d(e,t,n);return function(t,n){return e.get(t)||(t+="?v=2.6.0-TR2"),r(t,n)}})}]),t.constant("productInfo",e),t.run(["$rootScope","$route","toastr","$sce","$translate","ThemeService","WorkbenchSettingsStorageService","LSKeys","GuidesService",function(e,t,n,i,o,a,s,u,l){function c(){t.current.title?document.title=r(o.instant(t.current.title))+" | GraphDB Workbench":document.title="GraphDB Workbench",e.helpInfo=i.trustAsHtml(r(o.instant(t.current.helpInfo))),e.title=r(o.instant(t.current.title))}e.$on("$routeChangeSuccess",(function(){c(),n.clear()})),e.$on("$translateChangeSuccess",(function(){c()}));const p=s.getThemeName();a.applyTheme(p),a.applyDarkThemeMode(),l.init()}]),t.filter("titlecase",(function(){return function(e){var t=""+e;return t.charAt(0).toUpperCase()+t.slice(1)}})),angular.bootstrap(document,["graphdb.workbench"])}(e)}))},function(e,t,n){"use strict";n.r(t),n.d(t,"OPERATION_GROUP_TYPE",(function(){return r}));const r={IMPORT_OPERATION:"IMPORT_OPERATION",QUERIES_OPERATION:"QUERIES_OPERATION",BACKUP_AND_RESTORE_OPERATION:"BACKUP_AND_RESTORE_OPERATION",CLUSTER_OPERATION:"CLUSTER_OPERATION"}},function(e,t,n){"use strict";n.r(t),n.d(t,"GuideUtils",(function(){return r}));const r=function(){const e=function(e,t){return r.clickOnElement(r.getGuideElementSelector(e,t))},t=function(e,t=1,n=!0){const r=c(e);return new Promise((function(e,i){let o=1e3*t|1e3;const a=setInterval(()=>{try{const t=document.querySelector(r);null!=t?!n||angular.element(t).is(":visible")?(clearInterval(a),setTimeout(()=>{e(angular.element(t))},0)):(o-=100,o<0&&(clearInterval(a),console.log("Element is not visible: "+r),i())):(o-=100,o<0&&(clearInterval(a),console.log("Element is not found: "+r),i()))}catch(e){clearInterval(a),console.log("Error when processing selector: "+r),console.log(e),i(e)}},100)}))},n=function(e){const t=document.querySelector(e);return t&&angular.element(t).is(":visible")},i=function(e,t){return`[guide-selector="${e}"] ${t||""}`},o=(e,t,n,r)=>{const i=e.use();let o;return angular.isObject(n)?(o=n[i],o||(o=n.en),o=t(o)(r)):o=a(e.instant(n,r)),o},a=e=>{const t=document.createElement("div");return t.innerHTML=e,t.innerText},s=e=>i("queryEditor",e?".CodeMirror-code "+e:".CodeMirror-code"),u=e=>i("yasrResults",e),l=e=>angular.element(e).is(":checked"),c=e=>angular.isFunction(e)?e():e;return{GUIDES_LIST_URL:"rest/guides",GUIDES_DOWNLOAD_URL:"rest/guides/download/",waitFor:t,clickOnElement:function(e){return()=>t(e).then(e=>e.click())},clickOnGuideElement:e,getGuideElementSelector:i,isVisible:n,isGuideElementVisible:function(e){return n(i(e))},awaitAlphaDropD3:function(e,t,r=2,i=.1){return()=>new Promise((function(o){n(e)?o():setTimeout(()=>{let e=1e3*r;const n=setInterval(()=>{t.d3alpha<i?(clearInterval(n),o()):(e-=100,e<0&&(clearInterval(n),o()))},100)},150)}))},graphVizExpandNode:function(e){const t=d3.select(e),n=new CustomEvent("gdb-expand-node",{detail:t.datum()});t.node().dispatchEvent(n)},graphVizShowNodeInfo:function(e){const t=d3.select(e),n=new CustomEvent("gdb-show-node-info",{detail:t.datum()});t.node().dispatchEvent(n)},classHierarchyFocus:function(e){const t=d3.select(e),n=new CustomEvent("gdb-focus",{detail:t.datum()});t.node().dispatchEvent(n)},classHierarchyZoom:function(e){const t=d3.select(e),n=new CustomEvent("gdb-zoom",{detail:t.datum()});t.node().dispatchEvent(n)},validateTextInput:function(e,t,n=!0){const r=$(e).val();return""===r&&n?($(e).val(t),$(e).trigger("change"),!0):r===t},translateLocalMessage:o,unescapeHtml:a,noNextErrorToast:(e,t,n,r,i)=>{e.error(a(o(t,n,r,i)),a(o(t,n,"guide.validate.no-next",i)),{allowHtml:!0})},deferredShow:e=>()=>new Promise((function(t){setTimeout(()=>{t()},e)})),scrollToTop:()=>{window.scrollTo(0,0)},removeWhiteSpaces:e=>e.replace(/\s+/g,""),toResourceDownloadUrl:e=>"rest/guides/download/"+e.resourcePath+"/"+e.resourceFile,getSparqlEditorSelector:s,getSparqlResultsSelector:u,getSparqlResultsSelectorForIri:e=>u("a[title='"+e+"']"),getSparqlResultsSelectorForRow:e=>u("tbody tr:nth-child("+e+")"),isChecked:l,isGuideElementChecked:(e,t)=>l(r.getGuideElementSelector("autocompleteCheckbox",t)),defaultInitPreviousStep:(e,t)=>new Promise((function(n,r){const i=e.ShepherdService.getPreviousStepFromHistory(t);i?i.options.initPreviousStep(e,i.options.id).then(()=>n()).catch(e=>r(e)):n()})),getElementSelector:c,executeSparqlQuery:(n,r,i,o=!1)=>new Promise((a,u)=>{o?(n.url("/sparql"),r.reload(),t(s()).then(()=>{t(".no-query-run").then(()=>{window.editor.setValue(i),e("runSparqlQuery")().then(()=>a()).catch(e=>u(e))}).catch(e=>u(e))}).catch(e=>u(e))):(window.editor.setValue(i),e("runSparqlQuery")().then(()=>a()).catch(e=>u(e)))})}}()},function(e,t,n){"use strict";n.r(t),n.d(t,"OPERATION_TYPE",(function(){return r})),n.d(t,"OPERATION_TYPE_SORT_ORDER",(function(){return i}));const r={CLUSTER_STATUS:"clusterHealth",BACKUP_RESTORE:"backupAndRestore",QUERIES:"queries",UPDATES:"updates",IMPORTS:"imports"},i={clusterHealth:0,backupAndRestore:1,queries:3,updates:4,imports:2}},function(e,t,n){"use strict";n.r(t),n.d(t,"OPERATION_STATUS",(function(){return r})),n.d(t,"OPERATION_STATUS_SORT_ORDER",(function(){return i}));const r={CRITICAL:"CRITICAL",WARNING:"WARNING",INFORMATION:"INFORMATION"},i={INFORMATION:0,WARNING:1,CRITICAL:2,getOrder:e=>{switch(e){case r.WARNING:return i.WARNING;case r.CRITICAL:return i.CRITICAL;default:return i.INFORMATION}}}},function(e,t,n){"use strict";n.r(t),n.d(t,"UserType",(function(){return i})),n.d(t,"UserRole",(function(){return r})),n.d(t,"UserUtils",(function(){return o}));const r=Object.freeze({ROLE_ADMIN:"ROLE_ADMIN",ROLE_USER:"ROLE_USER",ROLE_REPO_MANAGER:"ROLE_REPO_MANAGER",ROLE_MONITORING:"ROLE_MONITORING"}),i=Object.freeze({ADMIN:"admin",USER:"user",REPO_MANAGER:"repoManager"}),o={getUserRoleName:function(e){switch(e){case i.USER:return"User";case i.REPO_MANAGER:return"Repository manager";case i.ADMIN:return"Administrator";default:return"Unknown"}}}},function(e,t,n){(function(e){var n,r,i,o,a,s,u,l,c,p,h,d={userAgent:!1},f={},g=g||(n=Math,i=(r={}).lib={},o=i.Base=function(){function e(){}return{extend:function(t){e.prototype=this;var n=new e;return t&&n.mixIn(t),n.hasOwnProperty("init")||(n.init=function(){n.$super.init.apply(this,arguments)}),n.init.prototype=n,n.$super=this,n},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),a=i.WordArray=o.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||u).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,i=e.sigBytes;if(this.clamp(),r%4)for(var o=0;o<i;o++){var a=n[o>>>2]>>>24-o%4*8&255;t[r+o>>>2]|=a<<24-(r+o)%4*8}else for(o=0;o<i;o+=4)t[r+o>>>2]=n[o>>>2];return this.sigBytes+=i,this},clamp:function(){var e=this.words,t=this.sigBytes;e[t>>>2]&=4294967295<<32-t%4*8,e.length=n.ceil(t/4)},clone:function(){var e=o.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],r=0;r<e;r+=4)t.push(4294967296*n.random()|0);return new a.init(t,e)}}),s=r.enc={},u=s.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var o=t[i>>>2]>>>24-i%4*8&255;r.push((o>>>4).toString(16)),r.push((15&o).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new a.init(n,t/2)}},l=s.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var o=t[i>>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(o))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new a.init(n,t)}},c=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(l.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return l.parse(unescape(encodeURIComponent(e)))}},p=i.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=c.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(e){var t=this._data,r=t.words,i=t.sigBytes,o=this.blockSize,s=i/(4*o),u=(s=e?n.ceil(s):n.max((0|s)-this._minBufferSize,0))*o,l=n.min(4*u,i);if(u){for(var c=0;c<u;c+=o)this._doProcessBlock(r,c);var p=r.splice(0,u);t.sigBytes-=l}return new a.init(p,l)},clone:function(){var e=o.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),i.Hasher=p.extend({cfg:o.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){p.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new h.HMAC.init(e,n).finalize(t)}}}),h=r.algo={},r);!function(e){var t,n=(t=g).lib,r=n.Base,i=n.WordArray;(t=t.x64={}).Word=r.extend({init:function(e,t){this.high=e,this.low=t}}),t.WordArray=r.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:8*e.length},toX32:function(){for(var e=this.words,t=e.length,n=[],r=0;r<t;r++){var o=e[r];n.push(o.high),n.push(o.low)}return i.create(n,this.sigBytes)},clone:function(){for(var e=r.clone.call(this),t=e.words=this.words.slice(0),n=t.length,i=0;i<n;i++)t[i]=t[i].clone();return e}})}(),g.lib.Cipher||function(e){var t=(d=g).lib,n=t.Base,r=t.WordArray,i=t.BufferedBlockAlgorithm,o=d.enc.Base64,a=d.algo.EvpKDF,s=t.Cipher=i.extend({cfg:n.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,n){this.cfg=this.cfg.extend(n),this._xformMode=e,this._key=t,this.reset()},reset:function(){i.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(e){return{encrypt:function(t,n,r){return("string"==typeof n?f:h).encrypt(e,t,n,r)},decrypt:function(t,n,r){return("string"==typeof n?f:h).decrypt(e,t,n,r)}}}});t.StreamCipher=s.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var u=d.mode={},l=function(e,t,n){var r=this._iv;r?this._iv=void 0:r=this._prevBlock;for(var i=0;i<n;i++)e[t+i]^=r[i]},c=(t.BlockCipherMode=n.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}})).extend();c.Encryptor=c.extend({processBlock:function(e,t){var n=this._cipher,r=n.blockSize;l.call(this,e,t,r),n.encryptBlock(e,t),this._prevBlock=e.slice(t,t+r)}}),c.Decryptor=c.extend({processBlock:function(e,t){var n=this._cipher,r=n.blockSize,i=e.slice(t,t+r);n.decryptBlock(e,t),l.call(this,e,t,r),this._prevBlock=i}}),u=u.CBC=c,c=(d.pad={}).Pkcs7={pad:function(e,t){for(var n,i=(n=(n=4*t)-e.sigBytes%n)<<24|n<<16|n<<8|n,o=[],a=0;a<n;a+=4)o.push(i);n=r.create(o,n),e.concat(n)},unpad:function(e){e.sigBytes-=255&e.words[e.sigBytes-1>>>2]}},t.BlockCipher=s.extend({cfg:s.cfg.extend({mode:u,padding:c}),reset:function(){s.reset.call(this);var e=(t=this.cfg).iv,t=t.mode;if(this._xformMode==this._ENC_XFORM_MODE)var n=t.createEncryptor;else n=t.createDecryptor,this._minBufferSize=1;this._mode=n.call(t,this,e&&e.words)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else t=this._process(!0),e.unpad(t);return t},blockSize:4});var p=t.CipherParams=n.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),h=(u=(d.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext;return((e=e.salt)?r.create([1398893684,1701076831]).concat(e).concat(t):t).toString(o)},parse:function(e){var t=(e=o.parse(e)).words;if(1398893684==t[0]&&1701076831==t[1]){var n=r.create(t.slice(2,4));t.splice(0,4),e.sigBytes-=16}return p.create({ciphertext:e,salt:n})}},t.SerializableCipher=n.extend({cfg:n.extend({format:u}),encrypt:function(e,t,n,r){r=this.cfg.extend(r);var i=e.createEncryptor(n,r);return t=i.finalize(t),i=i.cfg,p.create({ciphertext:t,key:n,iv:i.iv,algorithm:e,mode:i.mode,padding:i.padding,blockSize:e.blockSize,formatter:r.format})},decrypt:function(e,t,n,r){return r=this.cfg.extend(r),t=this._parse(t,r.format),e.createDecryptor(n,r).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}})),d=(d.kdf={}).OpenSSL={execute:function(e,t,n,i){return i||(i=r.random(8)),e=a.create({keySize:t+n}).compute(e,i),n=r.create(e.words.slice(t),4*n),e.sigBytes=4*t,p.create({key:e,iv:n,salt:i})}},f=t.PasswordBasedCipher=h.extend({cfg:h.cfg.extend({kdf:d}),encrypt:function(e,t,n,r){return n=(r=this.cfg.extend(r)).kdf.execute(n,e.keySize,e.ivSize),r.iv=n.iv,(e=h.encrypt.call(this,e,t,n.key,r)).mixIn(n),e},decrypt:function(e,t,n,r){return r=this.cfg.extend(r),t=this._parse(t,r.format),n=r.kdf.execute(n,e.keySize,e.ivSize,t.salt),r.iv=n.iv,h.decrypt.call(this,e,t,n.key,r)}})}(),function(){for(var e=g,t=e.lib.BlockCipher,n=e.algo,r=[],i=[],o=[],a=[],s=[],u=[],l=[],c=[],p=[],h=[],d=[],f=0;256>f;f++)d[f]=128>f?f<<1:f<<1^283;var m=0,v=0;for(f=0;256>f;f++){var y=(y=v^v<<1^v<<2^v<<3^v<<4)>>>8^255&y^99;r[m]=y,i[y]=m;var b=d[m],w=d[b],x=d[w],S=257*d[y]^16843008*y;o[m]=S<<24|S>>>8,a[m]=S<<16|S>>>16,s[m]=S<<8|S>>>24,u[m]=S,S=16843009*x^65537*w^257*b^16843008*m,l[y]=S<<24|S>>>8,c[y]=S<<16|S>>>16,p[y]=S<<8|S>>>24,h[y]=S,m?(m=b^d[d[d[x^b]]],v^=d[d[v]]):m=v=1}var E=[0,1,2,4,8,16,32,64,128,27,54];n=n.AES=t.extend({_doReset:function(){for(var e=(n=this._key).words,t=n.sigBytes/4,n=4*((this._nRounds=t+6)+1),i=this._keySchedule=[],o=0;o<n;o++)if(o<t)i[o]=e[o];else{var a=i[o-1];o%t?6<t&&4==o%t&&(a=r[a>>>24]<<24|r[a>>>16&255]<<16|r[a>>>8&255]<<8|r[255&a]):(a=r[(a=a<<8|a>>>24)>>>24]<<24|r[a>>>16&255]<<16|r[a>>>8&255]<<8|r[255&a],a^=E[o/t|0]<<24),i[o]=i[o-t]^a}for(e=this._invKeySchedule=[],t=0;t<n;t++)o=n-t,a=t%4?i[o]:i[o-4],e[t]=4>t||4>=o?a:l[r[a>>>24]]^c[r[a>>>16&255]]^p[r[a>>>8&255]]^h[r[255&a]]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,o,a,s,u,r)},decryptBlock:function(e,t){var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n,this._doCryptBlock(e,t,this._invKeySchedule,l,c,p,h,i),n=e[t+1],e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function(e,t,n,r,i,o,a,s){for(var u=this._nRounds,l=e[t]^n[0],c=e[t+1]^n[1],p=e[t+2]^n[2],h=e[t+3]^n[3],d=4,f=1;f<u;f++){var g=r[l>>>24]^i[c>>>16&255]^o[p>>>8&255]^a[255&h]^n[d++],m=r[c>>>24]^i[p>>>16&255]^o[h>>>8&255]^a[255&l]^n[d++],v=r[p>>>24]^i[h>>>16&255]^o[l>>>8&255]^a[255&c]^n[d++];h=r[h>>>24]^i[l>>>16&255]^o[c>>>8&255]^a[255&p]^n[d++],l=g,c=m,p=v}g=(s[l>>>24]<<24|s[c>>>16&255]<<16|s[p>>>8&255]<<8|s[255&h])^n[d++],m=(s[c>>>24]<<24|s[p>>>16&255]<<16|s[h>>>8&255]<<8|s[255&l])^n[d++],v=(s[p>>>24]<<24|s[h>>>16&255]<<16|s[l>>>8&255]<<8|s[255&c])^n[d++],h=(s[h>>>24]<<24|s[l>>>16&255]<<16|s[c>>>8&255]<<8|s[255&p])^n[d++],e[t]=g,e[t+1]=m,e[t+2]=v,e[t+3]=h},keySize:8});e.AES=t._createHelper(n)}(),function(){function e(e,t){var n=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=n,this._lBlock^=n<<e}function t(e,t){var n=(this._rBlock>>>e^this._lBlock)&t;this._lBlock^=n,this._rBlock^=n<<e}var n=g,r=(i=n.lib).WordArray,i=i.BlockCipher,o=n.algo,a=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],s=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],u=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],l=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],c=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],p=o.DES=i.extend({_doReset:function(){for(var e=this._key.words,t=[],n=0;56>n;n++){var r=a[n]-1;t[n]=e[r>>>5]>>>31-r%32&1}for(e=this._subKeys=[],r=0;16>r;r++){var i=e[r]=[],o=u[r];for(n=0;24>n;n++)i[n/6|0]|=t[(s[n]-1+o)%28]<<31-n%6,i[4+(n/6|0)]|=t[28+(s[n+24]-1+o)%28]<<31-n%6;for(i[0]=i[0]<<1|i[0]>>>31,n=1;7>n;n++)i[n]>>>=4*(n-1)+3;i[7]=i[7]<<5|i[7]>>>27}for(t=this._invSubKeys=[],n=0;16>n;n++)t[n]=e[15-n]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(n,r,i){this._lBlock=n[r],this._rBlock=n[r+1],e.call(this,4,252645135),e.call(this,16,65535),t.call(this,2,858993459),t.call(this,8,16711935),e.call(this,1,1431655765);for(var o=0;16>o;o++){for(var a=i[o],s=this._lBlock,u=this._rBlock,p=0,h=0;8>h;h++)p|=l[h][((u^a[h])&c[h])>>>0];this._lBlock=u,this._rBlock=s^p}i=this._lBlock,this._lBlock=this._rBlock,this._rBlock=i,e.call(this,1,1431655765),t.call(this,8,16711935),t.call(this,2,858993459),e.call(this,16,65535),e.call(this,4,252645135),n[r]=this._lBlock,n[r+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});n.DES=i._createHelper(p),o=o.TripleDES=i.extend({_doReset:function(){var e=this._key.words;this._des1=p.createEncryptor(r.create(e.slice(0,2))),this._des2=p.createEncryptor(r.create(e.slice(2,4))),this._des3=p.createEncryptor(r.create(e.slice(4,6)))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:6,ivSize:2,blockSize:2}),n.TripleDES=i._createHelper(o)}(),function(){var e=g,t=e.lib.WordArray;e.enc.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,r=this._map;e.clamp(),e=[];for(var i=0;i<n;i+=3)for(var o=(t[i>>>2]>>>24-i%4*8&255)<<16|(t[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|t[i+2>>>2]>>>24-(i+2)%4*8&255,a=0;4>a&&i+.75*a<n;a++)e.push(r.charAt(o>>>6*(3-a)&63));if(t=r.charAt(64))for(;e.length%4;)e.push(t);return e.join("")},parse:function(e){var n=e.length,r=this._map;(i=r.charAt(64))&&(-1!=(i=e.indexOf(i))&&(n=i));for(var i=[],o=0,a=0;a<n;a++)if(a%4){var s=r.indexOf(e.charAt(a-1))<<a%4*2,u=r.indexOf(e.charAt(a))>>>6-a%4*2;i[o>>>2]|=(s|u)<<24-o%4*8,o++}return t.create(i,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),function(e){function t(e,t,n,r,i,o,a){return((e=e+(t&n|~t&r)+i+a)<<o|e>>>32-o)+t}function n(e,t,n,r,i,o,a){return((e=e+(t&r|n&~r)+i+a)<<o|e>>>32-o)+t}function r(e,t,n,r,i,o,a){return((e=e+(t^n^r)+i+a)<<o|e>>>32-o)+t}function i(e,t,n,r,i,o,a){return((e=e+(n^(t|~r))+i+a)<<o|e>>>32-o)+t}for(var o=g,a=(u=o.lib).WordArray,s=u.Hasher,u=o.algo,l=[],c=0;64>c;c++)l[c]=4294967296*e.abs(e.sin(c+1))|0;u=u.MD5=s.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,o){for(var a=0;16>a;a++){var s=e[u=o+a];e[u]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}a=this._hash.words;var u=e[o+0],c=(s=e[o+1],e[o+2]),p=e[o+3],h=e[o+4],d=e[o+5],f=e[o+6],g=e[o+7],m=e[o+8],v=e[o+9],y=e[o+10],b=e[o+11],w=e[o+12],x=e[o+13],S=e[o+14],E=e[o+15],A=t(A=a[0],$=a[1],C=a[2],F=a[3],u,7,l[0]),F=t(F,A,$,C,s,12,l[1]),C=t(C,F,A,$,c,17,l[2]),$=t($,C,F,A,p,22,l[3]);A=t(A,$,C,F,h,7,l[4]),F=t(F,A,$,C,d,12,l[5]),C=t(C,F,A,$,f,17,l[6]),$=t($,C,F,A,g,22,l[7]),A=t(A,$,C,F,m,7,l[8]),F=t(F,A,$,C,v,12,l[9]),C=t(C,F,A,$,y,17,l[10]),$=t($,C,F,A,b,22,l[11]),A=t(A,$,C,F,w,7,l[12]),F=t(F,A,$,C,x,12,l[13]),C=t(C,F,A,$,S,17,l[14]),A=n(A,$=t($,C,F,A,E,22,l[15]),C,F,s,5,l[16]),F=n(F,A,$,C,f,9,l[17]),C=n(C,F,A,$,b,14,l[18]),$=n($,C,F,A,u,20,l[19]),A=n(A,$,C,F,d,5,l[20]),F=n(F,A,$,C,y,9,l[21]),C=n(C,F,A,$,E,14,l[22]),$=n($,C,F,A,h,20,l[23]),A=n(A,$,C,F,v,5,l[24]),F=n(F,A,$,C,S,9,l[25]),C=n(C,F,A,$,p,14,l[26]),$=n($,C,F,A,m,20,l[27]),A=n(A,$,C,F,x,5,l[28]),F=n(F,A,$,C,c,9,l[29]),C=n(C,F,A,$,g,14,l[30]),A=r(A,$=n($,C,F,A,w,20,l[31]),C,F,d,4,l[32]),F=r(F,A,$,C,m,11,l[33]),C=r(C,F,A,$,b,16,l[34]),$=r($,C,F,A,S,23,l[35]),A=r(A,$,C,F,s,4,l[36]),F=r(F,A,$,C,h,11,l[37]),C=r(C,F,A,$,g,16,l[38]),$=r($,C,F,A,y,23,l[39]),A=r(A,$,C,F,x,4,l[40]),F=r(F,A,$,C,u,11,l[41]),C=r(C,F,A,$,p,16,l[42]),$=r($,C,F,A,f,23,l[43]),A=r(A,$,C,F,v,4,l[44]),F=r(F,A,$,C,w,11,l[45]),C=r(C,F,A,$,E,16,l[46]),A=i(A,$=r($,C,F,A,c,23,l[47]),C,F,u,6,l[48]),F=i(F,A,$,C,g,10,l[49]),C=i(C,F,A,$,S,15,l[50]),$=i($,C,F,A,d,21,l[51]),A=i(A,$,C,F,w,6,l[52]),F=i(F,A,$,C,p,10,l[53]),C=i(C,F,A,$,y,15,l[54]),$=i($,C,F,A,s,21,l[55]),A=i(A,$,C,F,m,6,l[56]),F=i(F,A,$,C,E,10,l[57]),C=i(C,F,A,$,f,15,l[58]),$=i($,C,F,A,x,21,l[59]),A=i(A,$,C,F,h,6,l[60]),F=i(F,A,$,C,b,10,l[61]),C=i(C,F,A,$,c,15,l[62]),$=i($,C,F,A,v,21,l[63]);a[0]=a[0]+A|0,a[1]=a[1]+$|0,a[2]=a[2]+C|0,a[3]=a[3]+F|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;n[i>>>5]|=128<<24-i%32;var o=e.floor(r/4294967296);for(n[15+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),n[14+(i+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),t.sigBytes=4*(n.length+1),this._process(),n=(t=this._hash).words,r=0;4>r;r++)i=n[r],n[r]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8);return t},clone:function(){var e=s.clone.call(this);return e._hash=this._hash.clone(),e}}),o.MD5=s._createHelper(u),o.HmacMD5=s._createHmacHelper(u)}(Math),function(){var e=g,t=(i=e.lib).WordArray,n=i.Hasher,r=[],i=e.algo.SHA1=n.extend({_doReset:function(){this._hash=new t.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=this._hash.words,i=n[0],o=n[1],a=n[2],s=n[3],u=n[4],l=0;80>l;l++){if(16>l)r[l]=0|e[t+l];else{var c=r[l-3]^r[l-8]^r[l-14]^r[l-16];r[l]=c<<1|c>>>31}c=(i<<5|i>>>27)+u+r[l],c=20>l?c+(1518500249+(o&a|~o&s)):40>l?c+(1859775393+(o^a^s)):60>l?c+((o&a|o&s|a&s)-1894007588):c+((o^a^s)-899497514),u=s,s=a,a=o<<30|o>>>2,o=i,i=c}n[0]=n[0]+i|0,n[1]=n[1]+o|0,n[2]=n[2]+a|0,n[3]=n[3]+s|0,n[4]=n[4]+u|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(r+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e}});e.SHA1=n._createHelper(i),e.HmacSHA1=n._createHmacHelper(i)}(),function(e){for(var t=g,n=(i=t.lib).WordArray,r=i.Hasher,i=t.algo,o=[],a=[],s=function(e){return 4294967296*(e-(0|e))|0},u=2,l=0;64>l;){var c;e:{c=u;for(var p=e.sqrt(c),h=2;h<=p;h++)if(!(c%h)){c=!1;break e}c=!0}c&&(8>l&&(o[l]=s(e.pow(u,.5))),a[l]=s(e.pow(u,1/3)),l++),u++}var d=[];i=i.SHA256=r.extend({_doReset:function(){this._hash=new n.init(o.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],o=n[2],s=n[3],u=n[4],l=n[5],c=n[6],p=n[7],h=0;64>h;h++){if(16>h)d[h]=0|e[t+h];else{var f=d[h-15],g=d[h-2];d[h]=((f<<25|f>>>7)^(f<<14|f>>>18)^f>>>3)+d[h-7]+((g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10)+d[h-16]}f=p+((u<<26|u>>>6)^(u<<21|u>>>11)^(u<<7|u>>>25))+(u&l^~u&c)+a[h]+d[h],g=((r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22))+(r&i^r&o^i&o),p=c,c=l,l=u,u=s+f|0,s=o,o=i,i=r,r=f+g|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+o|0,n[3]=n[3]+s|0,n[4]=n[4]+u|0,n[5]=n[5]+l|0,n[6]=n[6]+c|0,n[7]=n[7]+p|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;return n[i>>>5]|=128<<24-i%32,n[14+(i+64>>>9<<4)]=e.floor(r/4294967296),n[15+(i+64>>>9<<4)]=r,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=r._createHelper(i),t.HmacSHA256=r._createHmacHelper(i)}(Math),function(){var e=g,t=e.lib.WordArray,n=(r=e.algo).SHA256,r=r.SHA224=n.extend({_doReset:function(){this._hash=new t.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=n._doFinalize.call(this);return e.sigBytes-=4,e}});e.SHA224=n._createHelper(r),e.HmacSHA224=n._createHmacHelper(r)}(),function(){function e(){return r.create.apply(r,arguments)}for(var t=g,n=t.lib.Hasher,r=(o=t.x64).Word,i=o.WordArray,o=t.algo,a=[e(1116352408,3609767458),e(1899447441,602891725),e(3049323471,3964484399),e(3921009573,2173295548),e(961987163,4081628472),e(1508970993,3053834265),e(2453635748,2937671579),e(2870763221,3664609560),e(3624381080,2734883394),e(310598401,1164996542),e(607225278,1323610764),e(1426881987,3590304994),e(1925078388,4068182383),e(2162078206,991336113),e(2614888103,633803317),e(3248222580,3479774868),e(3835390401,2666613458),e(4022224774,944711139),e(264347078,2341262773),e(604807628,2007800933),e(770255983,1495990901),e(1249150122,1856431235),e(1555081692,3175218132),e(1996064986,2198950837),e(2554220882,3999719339),e(2821834349,766784016),e(2952996808,2566594879),e(3210313671,3203337956),e(3336571891,1034457026),e(3584528711,2466948901),e(113926993,3758326383),e(338241895,168717936),e(666307205,1188179964),e(773529912,1546045734),e(1294757372,1522805485),e(1396182291,2643833823),e(1695183700,2343527390),e(1986661051,1014477480),e(2177026350,1206759142),e(2456956037,344077627),e(2730485921,1290863460),e(2820302411,3158454273),e(3259730800,3505952657),e(3345764771,106217008),e(3516065817,3606008344),e(3600352804,1432725776),e(4094571909,1467031594),e(275423344,851169720),e(430227734,3100823752),e(506948616,1363258195),e(659060556,3750685593),e(883997877,3785050280),e(958139571,3318307427),e(1322822218,3812723403),e(1537002063,2003034995),e(1747873779,3602036899),e(1955562222,1575990012),e(2024104815,1125592928),e(2227730452,2716904306),e(2361852424,442776044),e(2428436474,593698344),e(2756734187,3733110249),e(3204031479,2999351573),e(3329325298,3815920427),e(3391569614,3928383900),e(3515267271,566280711),e(3940187606,3454069534),e(4118630271,4000239992),e(116418474,1914138554),e(174292421,2731055270),e(289380356,3203993006),e(460393269,320620315),e(685471733,587496836),e(852142971,1086792851),e(1017036298,365543100),e(1126000580,2618297676),e(1288033470,3409855158),e(1501505948,4234509866),e(1607167915,987167468),e(1816402316,1246189591)],s=[],u=0;80>u;u++)s[u]=e();o=o.SHA512=n.extend({_doReset:function(){this._hash=new i.init([new r.init(1779033703,4089235720),new r.init(3144134277,2227873595),new r.init(1013904242,4271175723),new r.init(2773480762,1595750129),new r.init(1359893119,2917565137),new r.init(2600822924,725511199),new r.init(528734635,4215389547),new r.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var n=(p=this._hash.words)[0],r=p[1],i=p[2],o=p[3],u=p[4],l=p[5],c=p[6],p=p[7],h=n.high,d=n.low,f=r.high,g=r.low,m=i.high,v=i.low,y=o.high,b=o.low,w=u.high,x=u.low,S=l.high,E=l.low,A=c.high,F=c.low,C=p.high,$=p.low,D=h,T=d,I=f,R=g,P=m,O=v,k=y,_=b,j=w,N=x,L=S,B=E,U=A,M=F,H=C,V=$,q=0;80>q;q++){var K=s[q];if(16>q)var z=K.high=0|e[t+2*q],G=K.low=0|e[t+2*q+1];else{z=((G=(z=s[q-15]).high)>>>1|(W=z.low)<<31)^(G>>>8|W<<24)^G>>>7;var W=(W>>>1|G<<31)^(W>>>8|G<<24)^(W>>>7|G<<25),Y=((G=(Y=s[q-2]).high)>>>19|(X=Y.low)<<13)^(G<<3|X>>>29)^G>>>6,X=(X>>>19|G<<13)^(X<<3|G>>>29)^(X>>>6|G<<26),J=(G=s[q-7]).high,Z=(Q=s[q-16]).high,Q=Q.low;z=(z=(z=z+J+((G=W+G.low)>>>0<W>>>0?1:0))+Y+((G=G+X)>>>0<X>>>0?1:0))+Z+((G=G+Q)>>>0<Q>>>0?1:0);K.high=z,K.low=G}J=j&L^~j&U,Q=N&B^~N&M,K=D&I^D&P^I&P;var ee=T&R^T&O^R&O,te=(W=(D>>>28|T<<4)^(D<<30|T>>>2)^(D<<25|T>>>7),Y=(T>>>28|D<<4)^(T<<30|D>>>2)^(T<<25|D>>>7),(X=a[q]).high),ne=X.low;Z=H+((j>>>14|N<<18)^(j>>>18|N<<14)^(j<<23|N>>>9))+((X=V+((N>>>14|j<<18)^(N>>>18|j<<14)^(N<<23|j>>>9)))>>>0<V>>>0?1:0),H=U,V=M,U=L,M=B,L=j,B=N,j=k+(Z=(Z=(Z=Z+J+((X=X+Q)>>>0<Q>>>0?1:0))+te+((X=X+ne)>>>0<ne>>>0?1:0))+z+((X=X+G)>>>0<G>>>0?1:0))+((N=_+X|0)>>>0<_>>>0?1:0)|0,k=P,_=O,P=I,O=R,I=D,R=T,D=Z+(K=W+K+((G=Y+ee)>>>0<Y>>>0?1:0))+((T=X+G|0)>>>0<X>>>0?1:0)|0}d=n.low=d+T,n.high=h+D+(d>>>0<T>>>0?1:0),g=r.low=g+R,r.high=f+I+(g>>>0<R>>>0?1:0),v=i.low=v+O,i.high=m+P+(v>>>0<O>>>0?1:0),b=o.low=b+_,o.high=y+k+(b>>>0<_>>>0?1:0),x=u.low=x+N,u.high=w+j+(x>>>0<N>>>0?1:0),E=l.low=E+B,l.high=S+L+(E>>>0<B>>>0?1:0),F=c.low=F+M,c.high=A+U+(F>>>0<M>>>0?1:0),$=p.low=$+V,p.high=C+H+($>>>0<V>>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[30+(r+128>>>10<<5)]=Math.floor(n/4294967296),t[31+(r+128>>>10<<5)]=n,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32}),t.SHA512=n._createHelper(o),t.HmacSHA512=n._createHmacHelper(o)}(),function(){var e=g,t=(i=e.x64).Word,n=i.WordArray,r=(i=e.algo).SHA512,i=i.SHA384=r.extend({_doReset:function(){this._hash=new n.init([new t.init(3418070365,3238371032),new t.init(1654270250,914150663),new t.init(2438529370,812702999),new t.init(355462360,4144912697),new t.init(1731405415,4290775857),new t.init(2394180231,1750603025),new t.init(3675008525,1694076839),new t.init(1203062813,3204075428)])},_doFinalize:function(){var e=r._doFinalize.call(this);return e.sigBytes-=16,e}});e.SHA384=r._createHelper(i),e.HmacSHA384=r._createHmacHelper(i)}(),function(){var e=g,t=(r=e.lib).WordArray,n=r.Hasher,r=e.algo,i=t.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),o=t.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),a=t.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),s=t.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),u=t.create([0,1518500249,1859775393,2400959708,2840853838]),l=t.create([1352829926,1548603684,1836072691,2053994217,0]);r=r.RIPEMD160=n.extend({_doReset:function(){this._hash=t.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=0;16>n;n++){var r=e[w=t+n];e[w]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8)}var c,p,h,d,f,g,m,v,y,b,w=this._hash.words,x=(r=u.words,l.words),S=i.words,E=o.words,A=a.words,F=s.words;g=c=w[0],m=p=w[1],v=h=w[2],y=d=w[3],b=f=w[4];var C;for(n=0;80>n;n+=1)C=c+e[t+S[n]]|0,C=16>n?C+((p^h^d)+r[0]):32>n?C+((p&h|~p&d)+r[1]):48>n?C+(((p|~h)^d)+r[2]):64>n?C+((p&d|h&~d)+r[3]):C+((p^(h|~d))+r[4]),C=(C=(C|=0)<<A[n]|C>>>32-A[n])+f|0,c=f,f=d,d=h<<10|h>>>22,h=p,p=C,C=g+e[t+E[n]]|0,C=16>n?C+((m^(v|~y))+x[0]):32>n?C+((m&y|v&~y)+x[1]):48>n?C+(((m|~v)^y)+x[2]):64>n?C+((m&v|~m&y)+x[3]):C+((m^v^y)+x[4]),C=(C=(C|=0)<<F[n]|C>>>32-F[n])+b|0,g=b,b=y,y=v<<10|v>>>22,v=m,m=C;C=w[1]+h+y|0,w[1]=w[2]+d+b|0,w[2]=w[3]+f+g|0,w[3]=w[4]+c+m|0,w[4]=w[0]+p+v|0,w[0]=C},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;for(t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),e.sigBytes=4*(t.length+1),this._process(),t=(e=this._hash).words,n=0;5>n;n++)r=t[n],t[n]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8);return e},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e}});e.RIPEMD160=n._createHelper(r),e.HmacRIPEMD160=n._createHmacHelper(r)}(Math),function(){var e=g,t=e.enc.Utf8;e.algo.HMAC=e.lib.Base.extend({init:function(e,n){e=this._hasher=new e.init,"string"==typeof n&&(n=t.parse(n));var r=e.blockSize,i=4*r;n.sigBytes>i&&(n=e.finalize(n)),n.clamp();for(var o=this._oKey=n.clone(),a=this._iKey=n.clone(),s=o.words,u=a.words,l=0;l<r;l++)s[l]^=1549556828,u[l]^=909522486;o.sigBytes=a.sigBytes=i,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher;return e=t.finalize(e),t.reset(),t.finalize(this._oKey.clone().concat(e))}})}(),function(){var e,t=g,n=(e=t.lib).Base,r=e.WordArray,i=(e=t.algo).HMAC,o=e.PBKDF2=n.extend({cfg:n.extend({keySize:4,hasher:e.SHA1,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){var n=this.cfg,o=i.create(n.hasher,e),a=r.create(),s=r.create([1]),u=a.words,l=s.words,c=n.keySize;for(n=n.iterations;u.length<c;){var p=o.update(t).finalize(s);o.reset();for(var h=p.words,d=h.length,f=p,g=1;g<n;g++){f=o.finalize(f),o.reset();for(var m=f.words,v=0;v<d;v++)h[v]^=m[v]}a.concat(p),l[0]++}return a.sigBytes=4*c,a}});t.PBKDF2=function(e,t,n){return o.create(n).compute(e,t)}}();
1
+ !function(e){function t(t){for(var n,i,o=t[0],a=t[1],s=0,l=[];s<o.length;s++)i=o[s],Object.prototype.hasOwnProperty.call(r,i)&&r[i]&&l.push(r[i][0]),r[i]=0;for(n in a)Object.prototype.hasOwnProperty.call(a,n)&&(e[n]=a[n]);for(u&&u(t);l.length;)l.shift()()}var n={},r={165:0};function i(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,i),r.l=!0,r.exports}i.e=function(e){var t=[],n=r[e];if(0!==n)if(n)t.push(n[2]);else{var o=new Promise((function(t,i){n=r[e]=[t,i]}));t.push(n[2]=o);var a,s=document.createElement("script");s.charset="utf-8",s.timeout=120,i.nc&&s.setAttribute("nonce",i.nc),s.src=function(e){return i.p+""+({}[e]||e)+"."+{0:"f8448f998a59db17e94e",1:"46d9ecd4119bac145f3b",2:"78b4e53269171c9c08a5",3:"cf89087c137e759ecd19",4:"851f9ade6202116ecfb9",5:"7cfbc07050f137932ffe",6:"c5eea752e1f541f494e8",7:"14f008aaac190939acd3",8:"b5e29f80f8a5766d70d5",9:"610b595b60a0fc51466a",10:"a26ae97905866618b14e",11:"0fc995ac096734b915c6",12:"7877dd6008df9acf44e1",13:"fe78f15334507bcc08ae",14:"0bb211bcdc29c6d8b3b5",15:"6a74adbd30b4d2930e10",16:"2f60fbeaccd97aefaae2",17:"2bff7856b13fd72e2db4",18:"d6be3e6583bf3dacd54f",19:"c2a5c3e7a49a4acba486",20:"8fd969e3860ddffedcc3",21:"c981976c6528073c0a2f",22:"9d339503774f4f6c0a8b",23:"87ca8226d464e3699b8e",24:"9076b75f45ce0579f7be",25:"073791b8dd02c5b31183",26:"6e06be7172a866ad45f9",27:"5152c2a1f3b1369e21b0",28:"90b784e728e3d5e4c6aa",29:"e2309b858706718f1732",30:"32fb84930c42bae43a74",31:"31b7b4bd073b82c09fda",32:"6725d94946764db833b8",33:"fa9f0e662060f2e97267",34:"af22bc6d5ed2bcb72a09",35:"e601e19e63c6ddaf2484",36:"df47a70d8efbf1cd033b",37:"085cdb373f74d55eee07",38:"fc172c7b0d24ab0f8a35",39:"5ca9fa51ec3c63459317",40:"309ec5212fd53fe696bb",41:"3870740f1d24570cb415",42:"b926c2c8620df5c7ed6d",43:"d4551e1f6cac0a1a77e5",44:"46c9e2d54a9f07d78368",45:"a916daee1f0c6873c890",46:"4f57238bd032edc81d6d",47:"4fbfdaa63628c501a30c",48:"3fbd50adcb0c7dd7ec60",49:"0707795b3b6e40387da8",50:"8f6cc698b42c96f2b41f",51:"514a339efd6cd11db0f8",52:"410a7d8b4cb433fb24ca",53:"174d18435f7bf3bf05a0",54:"7cb3bd3ae8055e350629",55:"f0762e755ba58cbaac26",56:"3b0312e77f8607a4d957",57:"dfb7a710da8ca09c725b",58:"ac0fa95bbbe4b2dfb0fc",59:"273ffcd48e856d2752ff",60:"00a29320ea162becd718",61:"3794de8b6d022738bafa",62:"cf39ad55adb1616560ec",63:"8880f667c958d12b338b",64:"fdd90fedc8a5dc3cacaf",65:"cdc961a8042c385c49c6",66:"c3b906de2fcf69089b7b",67:"9c851e5930459a5f5903",68:"05bba948c414a1e21c8f",69:"c5561c83fe410ea9a908",70:"f2557c225be5923bab24",71:"e9c3c5ccc70f443c97cf",72:"0780a8424293909f94a4",73:"57e88cee0af3f67aee77",74:"48e90caf0b5ecd351f1d",75:"c75a824264d0e67421ed",76:"2ad0f5373462bc70bebf",77:"303a075d21928354102c",78:"66f3e9630550f20287ff",79:"29d39a29721f936ae688",80:"8af0388db859fcc9fbf3",81:"2ff1f5047ab4e0591585",82:"27bb51dfeb4898504e96",83:"a59d34bc50cf323af43d",84:"a4ee7bb5d3ed2e6ead5e",85:"1f1b07562fbf97ab3e11",86:"637667a4555ae621aff0",87:"b76338a62297ad83960b",88:"532e7295b49b1071d45c",89:"90bb1cf65f183ecce47c",90:"683c4d5b142356f274ef",91:"2437dfc2ea1bc89f53f3",92:"a12cfd3b602e98b344de",93:"a5cb6192d32cb016bb60",94:"f6a3e7628449796419b6",95:"15f0e472c49c81a68c3a",96:"2bf3b75fb0efb6b9e7e8",97:"bd1988af419f7373b569",98:"060c6842b3a8ed94dd20",99:"6360b70da56083cd76fe",100:"aef098a33fbb925e0d2d",101:"42eacc63e0fb5834b78a",102:"4f78eeab62aac245879e",103:"f38f3cd69ff610955aaf",104:"2e21f1462021dca17db1",105:"76381cb7984bcbc9ba9a",106:"23e14c6b280756d04533",107:"75e40619cb45972dc39f",108:"f09444e990531d27e0be",109:"ef97393181ee534042d8",110:"d59b8565d2255a282669",111:"fff9f089f65f01013923",112:"5bd3fcd7c37f1024fe26",113:"2fa29eca15d32deb3320",114:"d78615087abe68db7b2f",115:"558ce3da00d3be87d18a",116:"577aab1d9bafd0053623",117:"c20f037799328c931eba",118:"39c8b47405ab93c40847",119:"19ee7b3ae143f817c5b1",120:"b944d5e63424d4307fc8",121:"3a8954e4c885c56a9817",122:"71a8cf0330504672fffc",123:"c6957ecb441d8a09932a",124:"27e85a0284e2ebeb7d6e",125:"9e925ae0dd1217d81d89",126:"a32b57d6108545746ed3",127:"90d1975083eef3d4a715",128:"544f1a82e19dd245c7de",129:"64ec11449e0c734500c2",130:"f8e68ac86e17b3622d40",131:"4868fc3a837277c30273",132:"7815ab1168a254cb0d47",133:"f87e1685dd5ed920f9b5",134:"8998ff724a077ecff2ce",135:"c07268699f76ef7a02ff",136:"908f1f6fe3054f99b560",137:"8262ca9736e9818284cd",138:"8c149cad49010a65b3ca",139:"97ee12e7a3c05be03456",140:"6b3c57ffec700081328b",141:"4981056237955a34b2e2",142:"4d60c1795eed3a9570f9",143:"b7057852f7859cf39e75",144:"3f85f8eacae521d52355",145:"9281069e9e77978b640a",146:"51d2987de4defe7df7c7",147:"54016549674d35bc2869",148:"ad95b30f508a0bd02970",149:"8dd1281617389f8c189b",150:"5e0ee4350f8edd0e7b9a",151:"6b81c99a1ec1b184b82d",152:"2e1aa910a68f0086825b",153:"7a64973115bdaec26406",154:"5938248b52830d0a80a2",155:"a4511849c1001c5f2ba6",156:"bbcaf52acb0cecbc6257",157:"51181d03518519f84b5e",158:"640e412f6002ee1d7341",159:"10457cbb053c1315d93a",160:"c46bfdf09357a4c62a53",161:"0f35ee11981f0ea0455f",162:"fef28120701e7d200b01",163:"38565d40ac5f71d1c875",164:"b2116f472aa847618aee",168:"2d4b5a75da5430c73efc",169:"6897f56896e3664e8b53",170:"d5c0d475c5b6ad84ef77",171:"60cdc91b2bf682a20911",172:"1fb9ead3e508a7cfa5f3",173:"95602c81a2692624a015",174:"aac1982e67b5ca1731c1",175:"5e49a28397900168f816",176:"2e6d1a9f4eac4fdd8422",177:"3b6aabf3c4db8519ea74",178:"e10370553beb5c6bb839",179:"784cbd536b8e636c1272",180:"d37db50f3ce1b3a04a65",181:"f307cabdc4ed7a10ff64",182:"e8fe148e90fcd334b9b9",183:"a086e00d4dc3c7855611",184:"ff8a39692d0ff666c9e6",185:"8b9f0b866e848f8a1aac",186:"798880846274da7033da",187:"eb92a35d38294bc21703",188:"641582484af80415d29a",189:"7ccbb0ef67513ae7001a",190:"a3609218c5d8e873a46f",191:"4c817606bf66c16d9ad1",192:"21f366a1ea7e6905f120",193:"4d40b788bd7ddcf16788",194:"0170093f1daf20e82b5f",195:"d7d8af61458f9416878f",196:"6e6b7589cd1342a0b2b5",197:"c071fa1fe9e081a3b053",198:"3c5ca9ac5a745b4b23a1",199:"00ac5221a334189ea09a",200:"aa3f4dcf9cf98409dbf5",201:"a1b147e78f43a3bc99c3",202:"20e71b18f57e7d234ff0",203:"0219c2ba2d4fe4881af2",204:"cc169603e18b84e7e65b",205:"99fb3c89cd9b9183ddbf",206:"43b04d2170165e13353c",207:"798c195e1d7d3f301131",208:"34f042066a757f4fd8c0",209:"288844c6a42ff4d5685a",210:"1ac38e393ca959703d4b",211:"d2721b9785e609e2f817",212:"b6b19c939f21132b451c",213:"5a5116f764e6357e53ab",214:"a2640be51c42d820bb83",215:"209396a71f130477e2b3",216:"16e2e982acc750b4045a",217:"8540eb1d1a0946e72dbf",218:"ef33580c82d20f39f75f",219:"1652bc940cdd0088dc18",220:"f8f9c348b1fc0cc72bd6",221:"b18a92f0ba880edaebbf",222:"a52ebecd1d5201437ebe"}[e]+".bundle.js"}(e);var u=new Error;a=function(t){s.onerror=s.onload=null,clearTimeout(l);var n=r[e];if(0!==n){if(n){var i=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;u.message="Loading chunk "+e+" failed.\n("+i+": "+o+")",u.name="ChunkLoadError",u.type=i,u.request=o,n[1](u)}r[e]=void 0}};var l=setTimeout((function(){a({type:"timeout",target:s})}),12e4);s.onerror=s.onload=a,document.head.appendChild(s)}return Promise.all(t)},i.m=e,i.c=n,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(n,r,function(t){return e[t]}.bind(null,r));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i.oe=function(e){throw console.error(e),e};var o=window.webpackJsonp=window.webpackJsonp||[],a=o.push.bind(o);o.push=t,o=o.slice();for(var s=0;s<o.length;s++)t(o[s]);var u=a;i(i.s=0)}([function(e,t,n){"use strict";n.r(t),n.d(t,"decodeHTML",(function(){return r}));n(7),n(40),n(46),n(249),n(55),n(250),n(34),n(35),n(47),n(48),n(49),n(50),n(51),n(52);const r=function(e){let t=document.createElement("textarea");return t.innerHTML=e,t.value},i=["ngRoute","graphdb.workbench.se.controllers","graphdb.framework.core","angularCancelOnNavigateModule","oc.lazyLoad","pascalprecht.translate","graphdb.framework.core.interceptors.unauthorized","graphdb.framework.core.interceptors.authentication","graphdb.framework.core.directives.rdfresourcesearch.rdfresourcesearch","graphdb.framework.core.directives.languageselector.languageselector","graphdb.framework.core.directives.angular-tooltips","graphdb.framework.core.directives.uppercased","graphdb.framework.guides.services","graphdb.framework.core.directives.operationsstatusesmonitor","graphdb.framework.core.directives.autocomplete"],o=["$routeProvider","$locationProvider","$menuItemsProvider","toastrConfig","localStorageServiceProvider","$uibTooltipProvider","$httpProvider","$templateRequestProvider","$translateProvider"];$.get("rest/info/version?local=1",(function(e){const t=e.productVersion.match(/^(\d+\.\d+)/);t.length?e.productShortVersion=t[1]:e.productShortVersion=e.productVersion;const a=e.productVersion.match(/(-.*?)(-|$)/);a&&a.length&&(e.productShortVersion=e.productShortVersion+a[1]),function(e){const t=angular.module("graphdb.workbench",i);t.config([...o,function(t,r,i,o,a,s,u,l,c){c.useStaticFilesLoader({prefix:"i18n/locale-",suffix:".json?v=10.5.1"}),c.preferredLanguage("en"),c.useSanitizeValueStrategy("escape"),angular.extend(o,{timeOut:5e3,positionClass:"toast-bottom-right",tapToDismiss:!1,extendedTimeOut:5e3}),a.setStorageType("localStorage").setNotify(!0,!0);var p=t.$get[t.$get.length-1]({$on:function(){}});t.when("_openid_implicit_",{controller:function(){},template:"<div></div>"}),p.routes._openid_implicit_.regexp=/[&/](?:id_token=.*&access_token=|access_token=.*&id_token=)/;let h=PluginRegistry.get("route");angular.forEach(h,(function(e){t.when(e.url,{controller:e.controller,templateUrl:e.templateUrl,title:e.title,helpInfo:e.helpInfo,reloadOnSearch:void 0===e.reloadOnSearch||e.reloadOnSearch,resolve:{preload:["$ocLazyLoad","$q",function(t,r){return e.path?n(251)("./"+e.path).then(n=>{t.inject(e.module)}):r.defer().resolve()}]}})})),t.otherwise({templateUrl:"pages/not_found.html"}),r.html5Mode(!0),s.setTriggers({show:"hide"}),s.options({appendToBody:!0}),i.setProductInfo(e),PluginRegistry.get("main.menu").forEach((function(e){e.items.forEach((function(e){i.addItem(e)}))})),u.interceptors.push("$unauthorizedInterceptor"),u.interceptors.push("$authenticationInterceptor");const d=l.$get[3];"function"==typeof d&&(l.$get[3]=function(e,t,n){const r=d(e,t,n);return function(t,n){return e.get(t)||(t+="?v=10.5.1"),r(t,n)}})}]),t.constant("productInfo",e),t.run(["$rootScope","$route","toastr","$sce","$translate","ThemeService","WorkbenchSettingsStorageService","LSKeys","GuidesService",function(e,t,n,i,o,a,s,u,l){function c(){t.current.title?document.title=r(o.instant(t.current.title))+" | GraphDB Workbench":document.title="GraphDB Workbench",e.helpInfo=i.trustAsHtml(r(o.instant(t.current.helpInfo))),e.title=r(o.instant(t.current.title))}e.$on("$routeChangeSuccess",(function(){c(),n.clear()})),e.$on("$translateChangeSuccess",(function(){c()}));const p=s.getThemeName();a.applyTheme(p),a.applyDarkThemeMode(),l.init()}]),t.filter("titlecase",(function(){return function(e){var t=""+e;return t.charAt(0).toUpperCase()+t.slice(1)}})),angular.bootstrap(document,["graphdb.workbench"])}(e)}))},function(e,t,n){"use strict";n.r(t),n.d(t,"OPERATION_GROUP_TYPE",(function(){return r}));const r={IMPORT_OPERATION:"IMPORT_OPERATION",QUERIES_OPERATION:"QUERIES_OPERATION",BACKUP_AND_RESTORE_OPERATION:"BACKUP_AND_RESTORE_OPERATION",CLUSTER_OPERATION:"CLUSTER_OPERATION"}},function(e,t,n){"use strict";n.r(t),n.d(t,"GuideUtils",(function(){return r}));const r=function(){const e=function(e,t){return r.clickOnElement(r.getGuideElementSelector(e,t))},t=function(e,t=1,n=!0){const r=c(e);return new Promise((function(e,i){let o=1e3*t|1e3;const a=setInterval(()=>{try{const t=document.querySelector(r);null!=t?!n||angular.element(t).is(":visible")?(clearInterval(a),setTimeout(()=>{e(angular.element(t))},0)):(o-=100,o<0&&(clearInterval(a),console.log("Element is not visible: "+r),i())):(o-=100,o<0&&(clearInterval(a),console.log("Element is not found: "+r),i()))}catch(e){clearInterval(a),console.log("Error when processing selector: "+r),console.log(e),i(e)}},100)}))},n=function(e){const t=document.querySelector(e);return t&&angular.element(t).is(":visible")},i=function(e,t){return`[guide-selector="${e}"] ${t||""}`},o=(e,t,n,r)=>{const i=e.use();let o;return angular.isObject(n)?(o=n[i],o||(o=n.en),o=t(o)(r)):o=a(e.instant(n,r)),o},a=e=>{const t=document.createElement("div");return t.innerHTML=e,t.innerText},s=e=>i("queryEditor",e?".CodeMirror-code "+e:".CodeMirror-code"),u=e=>i("yasrResults",e),l=e=>angular.element(e).is(":checked"),c=e=>angular.isFunction(e)?e():e;return{GUIDES_LIST_URL:"rest/guides",GUIDES_DOWNLOAD_URL:"rest/guides/download/",waitFor:t,clickOnElement:function(e){return()=>t(e).then(e=>e.click())},clickOnGuideElement:e,getGuideElementSelector:i,isVisible:n,isGuideElementVisible:function(e){return n(i(e))},awaitAlphaDropD3:function(e,t,r=2,i=.1){return()=>new Promise((function(o){n(e)?o():setTimeout(()=>{let e=1e3*r;const n=setInterval(()=>{t.d3alpha<i?(clearInterval(n),o()):(e-=100,e<0&&(clearInterval(n),o()))},100)},150)}))},graphVizExpandNode:function(e){const t=d3.select(e),n=new CustomEvent("gdb-expand-node",{detail:t.datum()});t.node().dispatchEvent(n)},graphVizShowNodeInfo:function(e){const t=d3.select(e),n=new CustomEvent("gdb-show-node-info",{detail:t.datum()});t.node().dispatchEvent(n)},classHierarchyFocus:function(e){const t=d3.select(e),n=new CustomEvent("gdb-focus",{detail:t.datum()});t.node().dispatchEvent(n)},classHierarchyZoom:function(e){const t=d3.select(e),n=new CustomEvent("gdb-zoom",{detail:t.datum()});t.node().dispatchEvent(n)},validateTextInput:function(e,t,n=!0){const r=$(e).val();return""===r&&n?($(e).val(t),$(e).trigger("change"),!0):r===t},translateLocalMessage:o,unescapeHtml:a,noNextErrorToast:(e,t,n,r,i)=>{e.error(a(o(t,n,r,i)),a(o(t,n,"guide.validate.no-next",i)),{allowHtml:!0})},deferredShow:e=>()=>new Promise((function(t){setTimeout(()=>{t()},e)})),scrollToTop:()=>{window.scrollTo(0,0)},removeWhiteSpaces:e=>e.replace(/\s+/g,""),toResourceDownloadUrl:e=>"rest/guides/download/"+e.resourcePath+"/"+e.resourceFile,getSparqlEditorSelector:s,getSparqlResultsSelector:u,getSparqlResultsSelectorForIri:e=>u("a[title='"+e+"']"),getSparqlResultsSelectorForRow:e=>u("tbody tr:nth-child("+e+")"),isChecked:l,isGuideElementChecked:(e,t)=>l(r.getGuideElementSelector("autocompleteCheckbox",t)),defaultInitPreviousStep:(e,t)=>new Promise((function(n,r){const i=e.ShepherdService.getPreviousStepFromHistory(t);i?i.options.initPreviousStep(e,i.options.id).then(()=>n()).catch(e=>r(e)):n()})),getElementSelector:c,executeSparqlQuery:(n,r,i,o=!1)=>new Promise((a,u)=>{o?(n.url("/sparql"),r.reload(),t(s()).then(()=>{t(".no-query-run").then(()=>{window.editor.setValue(i),e("runSparqlQuery")().then(()=>a()).catch(e=>u(e))}).catch(e=>u(e))}).catch(e=>u(e))):(window.editor.setValue(i),e("runSparqlQuery")().then(()=>a()).catch(e=>u(e)))})}}()},function(e,t,n){"use strict";n.r(t),n.d(t,"OPERATION_TYPE",(function(){return r})),n.d(t,"OPERATION_TYPE_SORT_ORDER",(function(){return i}));const r={CLUSTER_STATUS:"clusterHealth",BACKUP_RESTORE:"backupAndRestore",QUERIES:"queries",UPDATES:"updates",IMPORTS:"imports"},i={clusterHealth:0,backupAndRestore:1,queries:3,updates:4,imports:2}},function(e,t,n){"use strict";n.r(t),n.d(t,"OPERATION_STATUS",(function(){return r})),n.d(t,"OPERATION_STATUS_SORT_ORDER",(function(){return i}));const r={CRITICAL:"CRITICAL",WARNING:"WARNING",INFORMATION:"INFORMATION"},i={INFORMATION:0,WARNING:1,CRITICAL:2,getOrder:e=>{switch(e){case r.WARNING:return i.WARNING;case r.CRITICAL:return i.CRITICAL;default:return i.INFORMATION}}}},function(e,t,n){"use strict";n.r(t),n.d(t,"UserType",(function(){return i})),n.d(t,"UserRole",(function(){return r})),n.d(t,"UserUtils",(function(){return o}));const r=Object.freeze({ROLE_ADMIN:"ROLE_ADMIN",ROLE_USER:"ROLE_USER",ROLE_REPO_MANAGER:"ROLE_REPO_MANAGER",ROLE_MONITORING:"ROLE_MONITORING"}),i=Object.freeze({ADMIN:"admin",USER:"user",REPO_MANAGER:"repoManager"}),o={getUserRoleName:function(e){switch(e){case i.USER:return"User";case i.REPO_MANAGER:return"Repository manager";case i.ADMIN:return"Administrator";default:return"Unknown"}}}},function(e,t,n){(function(e){var n,r,i,o,a,s,u,l,c,p,h,d={userAgent:!1},f={},g=g||(n=Math,i=(r={}).lib={},o=i.Base=function(){function e(){}return{extend:function(t){e.prototype=this;var n=new e;return t&&n.mixIn(t),n.hasOwnProperty("init")||(n.init=function(){n.$super.init.apply(this,arguments)}),n.init.prototype=n,n.$super=this,n},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),a=i.WordArray=o.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||u).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,i=e.sigBytes;if(this.clamp(),r%4)for(var o=0;o<i;o++){var a=n[o>>>2]>>>24-o%4*8&255;t[r+o>>>2]|=a<<24-(r+o)%4*8}else for(o=0;o<i;o+=4)t[r+o>>>2]=n[o>>>2];return this.sigBytes+=i,this},clamp:function(){var e=this.words,t=this.sigBytes;e[t>>>2]&=4294967295<<32-t%4*8,e.length=n.ceil(t/4)},clone:function(){var e=o.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],r=0;r<e;r+=4)t.push(4294967296*n.random()|0);return new a.init(t,e)}}),s=r.enc={},u=s.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var o=t[i>>>2]>>>24-i%4*8&255;r.push((o>>>4).toString(16)),r.push((15&o).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new a.init(n,t/2)}},l=s.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var o=t[i>>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(o))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new a.init(n,t)}},c=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(l.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return l.parse(unescape(encodeURIComponent(e)))}},p=i.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=c.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(e){var t=this._data,r=t.words,i=t.sigBytes,o=this.blockSize,s=i/(4*o),u=(s=e?n.ceil(s):n.max((0|s)-this._minBufferSize,0))*o,l=n.min(4*u,i);if(u){for(var c=0;c<u;c+=o)this._doProcessBlock(r,c);var p=r.splice(0,u);t.sigBytes-=l}return new a.init(p,l)},clone:function(){var e=o.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),i.Hasher=p.extend({cfg:o.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){p.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new h.HMAC.init(e,n).finalize(t)}}}),h=r.algo={},r);!function(e){var t,n=(t=g).lib,r=n.Base,i=n.WordArray;(t=t.x64={}).Word=r.extend({init:function(e,t){this.high=e,this.low=t}}),t.WordArray=r.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:8*e.length},toX32:function(){for(var e=this.words,t=e.length,n=[],r=0;r<t;r++){var o=e[r];n.push(o.high),n.push(o.low)}return i.create(n,this.sigBytes)},clone:function(){for(var e=r.clone.call(this),t=e.words=this.words.slice(0),n=t.length,i=0;i<n;i++)t[i]=t[i].clone();return e}})}(),g.lib.Cipher||function(e){var t=(d=g).lib,n=t.Base,r=t.WordArray,i=t.BufferedBlockAlgorithm,o=d.enc.Base64,a=d.algo.EvpKDF,s=t.Cipher=i.extend({cfg:n.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,n){this.cfg=this.cfg.extend(n),this._xformMode=e,this._key=t,this.reset()},reset:function(){i.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(e){return{encrypt:function(t,n,r){return("string"==typeof n?f:h).encrypt(e,t,n,r)},decrypt:function(t,n,r){return("string"==typeof n?f:h).decrypt(e,t,n,r)}}}});t.StreamCipher=s.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var u=d.mode={},l=function(e,t,n){var r=this._iv;r?this._iv=void 0:r=this._prevBlock;for(var i=0;i<n;i++)e[t+i]^=r[i]},c=(t.BlockCipherMode=n.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}})).extend();c.Encryptor=c.extend({processBlock:function(e,t){var n=this._cipher,r=n.blockSize;l.call(this,e,t,r),n.encryptBlock(e,t),this._prevBlock=e.slice(t,t+r)}}),c.Decryptor=c.extend({processBlock:function(e,t){var n=this._cipher,r=n.blockSize,i=e.slice(t,t+r);n.decryptBlock(e,t),l.call(this,e,t,r),this._prevBlock=i}}),u=u.CBC=c,c=(d.pad={}).Pkcs7={pad:function(e,t){for(var n,i=(n=(n=4*t)-e.sigBytes%n)<<24|n<<16|n<<8|n,o=[],a=0;a<n;a+=4)o.push(i);n=r.create(o,n),e.concat(n)},unpad:function(e){e.sigBytes-=255&e.words[e.sigBytes-1>>>2]}},t.BlockCipher=s.extend({cfg:s.cfg.extend({mode:u,padding:c}),reset:function(){s.reset.call(this);var e=(t=this.cfg).iv,t=t.mode;if(this._xformMode==this._ENC_XFORM_MODE)var n=t.createEncryptor;else n=t.createDecryptor,this._minBufferSize=1;this._mode=n.call(t,this,e&&e.words)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else t=this._process(!0),e.unpad(t);return t},blockSize:4});var p=t.CipherParams=n.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),h=(u=(d.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext;return((e=e.salt)?r.create([1398893684,1701076831]).concat(e).concat(t):t).toString(o)},parse:function(e){var t=(e=o.parse(e)).words;if(1398893684==t[0]&&1701076831==t[1]){var n=r.create(t.slice(2,4));t.splice(0,4),e.sigBytes-=16}return p.create({ciphertext:e,salt:n})}},t.SerializableCipher=n.extend({cfg:n.extend({format:u}),encrypt:function(e,t,n,r){r=this.cfg.extend(r);var i=e.createEncryptor(n,r);return t=i.finalize(t),i=i.cfg,p.create({ciphertext:t,key:n,iv:i.iv,algorithm:e,mode:i.mode,padding:i.padding,blockSize:e.blockSize,formatter:r.format})},decrypt:function(e,t,n,r){return r=this.cfg.extend(r),t=this._parse(t,r.format),e.createDecryptor(n,r).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}})),d=(d.kdf={}).OpenSSL={execute:function(e,t,n,i){return i||(i=r.random(8)),e=a.create({keySize:t+n}).compute(e,i),n=r.create(e.words.slice(t),4*n),e.sigBytes=4*t,p.create({key:e,iv:n,salt:i})}},f=t.PasswordBasedCipher=h.extend({cfg:h.cfg.extend({kdf:d}),encrypt:function(e,t,n,r){return n=(r=this.cfg.extend(r)).kdf.execute(n,e.keySize,e.ivSize),r.iv=n.iv,(e=h.encrypt.call(this,e,t,n.key,r)).mixIn(n),e},decrypt:function(e,t,n,r){return r=this.cfg.extend(r),t=this._parse(t,r.format),n=r.kdf.execute(n,e.keySize,e.ivSize,t.salt),r.iv=n.iv,h.decrypt.call(this,e,t,n.key,r)}})}(),function(){for(var e=g,t=e.lib.BlockCipher,n=e.algo,r=[],i=[],o=[],a=[],s=[],u=[],l=[],c=[],p=[],h=[],d=[],f=0;256>f;f++)d[f]=128>f?f<<1:f<<1^283;var m=0,v=0;for(f=0;256>f;f++){var y=(y=v^v<<1^v<<2^v<<3^v<<4)>>>8^255&y^99;r[m]=y,i[y]=m;var b=d[m],w=d[b],x=d[w],S=257*d[y]^16843008*y;o[m]=S<<24|S>>>8,a[m]=S<<16|S>>>16,s[m]=S<<8|S>>>24,u[m]=S,S=16843009*x^65537*w^257*b^16843008*m,l[y]=S<<24|S>>>8,c[y]=S<<16|S>>>16,p[y]=S<<8|S>>>24,h[y]=S,m?(m=b^d[d[d[x^b]]],v^=d[d[v]]):m=v=1}var E=[0,1,2,4,8,16,32,64,128,27,54];n=n.AES=t.extend({_doReset:function(){for(var e=(n=this._key).words,t=n.sigBytes/4,n=4*((this._nRounds=t+6)+1),i=this._keySchedule=[],o=0;o<n;o++)if(o<t)i[o]=e[o];else{var a=i[o-1];o%t?6<t&&4==o%t&&(a=r[a>>>24]<<24|r[a>>>16&255]<<16|r[a>>>8&255]<<8|r[255&a]):(a=r[(a=a<<8|a>>>24)>>>24]<<24|r[a>>>16&255]<<16|r[a>>>8&255]<<8|r[255&a],a^=E[o/t|0]<<24),i[o]=i[o-t]^a}for(e=this._invKeySchedule=[],t=0;t<n;t++)o=n-t,a=t%4?i[o]:i[o-4],e[t]=4>t||4>=o?a:l[r[a>>>24]]^c[r[a>>>16&255]]^p[r[a>>>8&255]]^h[r[255&a]]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,o,a,s,u,r)},decryptBlock:function(e,t){var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n,this._doCryptBlock(e,t,this._invKeySchedule,l,c,p,h,i),n=e[t+1],e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function(e,t,n,r,i,o,a,s){for(var u=this._nRounds,l=e[t]^n[0],c=e[t+1]^n[1],p=e[t+2]^n[2],h=e[t+3]^n[3],d=4,f=1;f<u;f++){var g=r[l>>>24]^i[c>>>16&255]^o[p>>>8&255]^a[255&h]^n[d++],m=r[c>>>24]^i[p>>>16&255]^o[h>>>8&255]^a[255&l]^n[d++],v=r[p>>>24]^i[h>>>16&255]^o[l>>>8&255]^a[255&c]^n[d++];h=r[h>>>24]^i[l>>>16&255]^o[c>>>8&255]^a[255&p]^n[d++],l=g,c=m,p=v}g=(s[l>>>24]<<24|s[c>>>16&255]<<16|s[p>>>8&255]<<8|s[255&h])^n[d++],m=(s[c>>>24]<<24|s[p>>>16&255]<<16|s[h>>>8&255]<<8|s[255&l])^n[d++],v=(s[p>>>24]<<24|s[h>>>16&255]<<16|s[l>>>8&255]<<8|s[255&c])^n[d++],h=(s[h>>>24]<<24|s[l>>>16&255]<<16|s[c>>>8&255]<<8|s[255&p])^n[d++],e[t]=g,e[t+1]=m,e[t+2]=v,e[t+3]=h},keySize:8});e.AES=t._createHelper(n)}(),function(){function e(e,t){var n=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=n,this._lBlock^=n<<e}function t(e,t){var n=(this._rBlock>>>e^this._lBlock)&t;this._lBlock^=n,this._rBlock^=n<<e}var n=g,r=(i=n.lib).WordArray,i=i.BlockCipher,o=n.algo,a=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],s=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],u=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],l=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],c=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],p=o.DES=i.extend({_doReset:function(){for(var e=this._key.words,t=[],n=0;56>n;n++){var r=a[n]-1;t[n]=e[r>>>5]>>>31-r%32&1}for(e=this._subKeys=[],r=0;16>r;r++){var i=e[r]=[],o=u[r];for(n=0;24>n;n++)i[n/6|0]|=t[(s[n]-1+o)%28]<<31-n%6,i[4+(n/6|0)]|=t[28+(s[n+24]-1+o)%28]<<31-n%6;for(i[0]=i[0]<<1|i[0]>>>31,n=1;7>n;n++)i[n]>>>=4*(n-1)+3;i[7]=i[7]<<5|i[7]>>>27}for(t=this._invSubKeys=[],n=0;16>n;n++)t[n]=e[15-n]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(n,r,i){this._lBlock=n[r],this._rBlock=n[r+1],e.call(this,4,252645135),e.call(this,16,65535),t.call(this,2,858993459),t.call(this,8,16711935),e.call(this,1,1431655765);for(var o=0;16>o;o++){for(var a=i[o],s=this._lBlock,u=this._rBlock,p=0,h=0;8>h;h++)p|=l[h][((u^a[h])&c[h])>>>0];this._lBlock=u,this._rBlock=s^p}i=this._lBlock,this._lBlock=this._rBlock,this._rBlock=i,e.call(this,1,1431655765),t.call(this,8,16711935),t.call(this,2,858993459),e.call(this,16,65535),e.call(this,4,252645135),n[r]=this._lBlock,n[r+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});n.DES=i._createHelper(p),o=o.TripleDES=i.extend({_doReset:function(){var e=this._key.words;this._des1=p.createEncryptor(r.create(e.slice(0,2))),this._des2=p.createEncryptor(r.create(e.slice(2,4))),this._des3=p.createEncryptor(r.create(e.slice(4,6)))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:6,ivSize:2,blockSize:2}),n.TripleDES=i._createHelper(o)}(),function(){var e=g,t=e.lib.WordArray;e.enc.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,r=this._map;e.clamp(),e=[];for(var i=0;i<n;i+=3)for(var o=(t[i>>>2]>>>24-i%4*8&255)<<16|(t[i+1>>>2]>>>24-(i+1)%4*8&255)<<8|t[i+2>>>2]>>>24-(i+2)%4*8&255,a=0;4>a&&i+.75*a<n;a++)e.push(r.charAt(o>>>6*(3-a)&63));if(t=r.charAt(64))for(;e.length%4;)e.push(t);return e.join("")},parse:function(e){var n=e.length,r=this._map;(i=r.charAt(64))&&(-1!=(i=e.indexOf(i))&&(n=i));for(var i=[],o=0,a=0;a<n;a++)if(a%4){var s=r.indexOf(e.charAt(a-1))<<a%4*2,u=r.indexOf(e.charAt(a))>>>6-a%4*2;i[o>>>2]|=(s|u)<<24-o%4*8,o++}return t.create(i,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),function(e){function t(e,t,n,r,i,o,a){return((e=e+(t&n|~t&r)+i+a)<<o|e>>>32-o)+t}function n(e,t,n,r,i,o,a){return((e=e+(t&r|n&~r)+i+a)<<o|e>>>32-o)+t}function r(e,t,n,r,i,o,a){return((e=e+(t^n^r)+i+a)<<o|e>>>32-o)+t}function i(e,t,n,r,i,o,a){return((e=e+(n^(t|~r))+i+a)<<o|e>>>32-o)+t}for(var o=g,a=(u=o.lib).WordArray,s=u.Hasher,u=o.algo,l=[],c=0;64>c;c++)l[c]=4294967296*e.abs(e.sin(c+1))|0;u=u.MD5=s.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,o){for(var a=0;16>a;a++){var s=e[u=o+a];e[u]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}a=this._hash.words;var u=e[o+0],c=(s=e[o+1],e[o+2]),p=e[o+3],h=e[o+4],d=e[o+5],f=e[o+6],g=e[o+7],m=e[o+8],v=e[o+9],y=e[o+10],b=e[o+11],w=e[o+12],x=e[o+13],S=e[o+14],E=e[o+15],A=t(A=a[0],$=a[1],C=a[2],F=a[3],u,7,l[0]),F=t(F,A,$,C,s,12,l[1]),C=t(C,F,A,$,c,17,l[2]),$=t($,C,F,A,p,22,l[3]);A=t(A,$,C,F,h,7,l[4]),F=t(F,A,$,C,d,12,l[5]),C=t(C,F,A,$,f,17,l[6]),$=t($,C,F,A,g,22,l[7]),A=t(A,$,C,F,m,7,l[8]),F=t(F,A,$,C,v,12,l[9]),C=t(C,F,A,$,y,17,l[10]),$=t($,C,F,A,b,22,l[11]),A=t(A,$,C,F,w,7,l[12]),F=t(F,A,$,C,x,12,l[13]),C=t(C,F,A,$,S,17,l[14]),A=n(A,$=t($,C,F,A,E,22,l[15]),C,F,s,5,l[16]),F=n(F,A,$,C,f,9,l[17]),C=n(C,F,A,$,b,14,l[18]),$=n($,C,F,A,u,20,l[19]),A=n(A,$,C,F,d,5,l[20]),F=n(F,A,$,C,y,9,l[21]),C=n(C,F,A,$,E,14,l[22]),$=n($,C,F,A,h,20,l[23]),A=n(A,$,C,F,v,5,l[24]),F=n(F,A,$,C,S,9,l[25]),C=n(C,F,A,$,p,14,l[26]),$=n($,C,F,A,m,20,l[27]),A=n(A,$,C,F,x,5,l[28]),F=n(F,A,$,C,c,9,l[29]),C=n(C,F,A,$,g,14,l[30]),A=r(A,$=n($,C,F,A,w,20,l[31]),C,F,d,4,l[32]),F=r(F,A,$,C,m,11,l[33]),C=r(C,F,A,$,b,16,l[34]),$=r($,C,F,A,S,23,l[35]),A=r(A,$,C,F,s,4,l[36]),F=r(F,A,$,C,h,11,l[37]),C=r(C,F,A,$,g,16,l[38]),$=r($,C,F,A,y,23,l[39]),A=r(A,$,C,F,x,4,l[40]),F=r(F,A,$,C,u,11,l[41]),C=r(C,F,A,$,p,16,l[42]),$=r($,C,F,A,f,23,l[43]),A=r(A,$,C,F,v,4,l[44]),F=r(F,A,$,C,w,11,l[45]),C=r(C,F,A,$,E,16,l[46]),A=i(A,$=r($,C,F,A,c,23,l[47]),C,F,u,6,l[48]),F=i(F,A,$,C,g,10,l[49]),C=i(C,F,A,$,S,15,l[50]),$=i($,C,F,A,d,21,l[51]),A=i(A,$,C,F,w,6,l[52]),F=i(F,A,$,C,p,10,l[53]),C=i(C,F,A,$,y,15,l[54]),$=i($,C,F,A,s,21,l[55]),A=i(A,$,C,F,m,6,l[56]),F=i(F,A,$,C,E,10,l[57]),C=i(C,F,A,$,f,15,l[58]),$=i($,C,F,A,x,21,l[59]),A=i(A,$,C,F,h,6,l[60]),F=i(F,A,$,C,b,10,l[61]),C=i(C,F,A,$,c,15,l[62]),$=i($,C,F,A,v,21,l[63]);a[0]=a[0]+A|0,a[1]=a[1]+$|0,a[2]=a[2]+C|0,a[3]=a[3]+F|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;n[i>>>5]|=128<<24-i%32;var o=e.floor(r/4294967296);for(n[15+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),n[14+(i+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),t.sigBytes=4*(n.length+1),this._process(),n=(t=this._hash).words,r=0;4>r;r++)i=n[r],n[r]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8);return t},clone:function(){var e=s.clone.call(this);return e._hash=this._hash.clone(),e}}),o.MD5=s._createHelper(u),o.HmacMD5=s._createHmacHelper(u)}(Math),function(){var e=g,t=(i=e.lib).WordArray,n=i.Hasher,r=[],i=e.algo.SHA1=n.extend({_doReset:function(){this._hash=new t.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=this._hash.words,i=n[0],o=n[1],a=n[2],s=n[3],u=n[4],l=0;80>l;l++){if(16>l)r[l]=0|e[t+l];else{var c=r[l-3]^r[l-8]^r[l-14]^r[l-16];r[l]=c<<1|c>>>31}c=(i<<5|i>>>27)+u+r[l],c=20>l?c+(1518500249+(o&a|~o&s)):40>l?c+(1859775393+(o^a^s)):60>l?c+((o&a|o&s|a&s)-1894007588):c+((o^a^s)-899497514),u=s,s=a,a=o<<30|o>>>2,o=i,i=c}n[0]=n[0]+i|0,n[1]=n[1]+o|0,n[2]=n[2]+a|0,n[3]=n[3]+s|0,n[4]=n[4]+u|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(r+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e}});e.SHA1=n._createHelper(i),e.HmacSHA1=n._createHmacHelper(i)}(),function(e){for(var t=g,n=(i=t.lib).WordArray,r=i.Hasher,i=t.algo,o=[],a=[],s=function(e){return 4294967296*(e-(0|e))|0},u=2,l=0;64>l;){var c;e:{c=u;for(var p=e.sqrt(c),h=2;h<=p;h++)if(!(c%h)){c=!1;break e}c=!0}c&&(8>l&&(o[l]=s(e.pow(u,.5))),a[l]=s(e.pow(u,1/3)),l++),u++}var d=[];i=i.SHA256=r.extend({_doReset:function(){this._hash=new n.init(o.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],o=n[2],s=n[3],u=n[4],l=n[5],c=n[6],p=n[7],h=0;64>h;h++){if(16>h)d[h]=0|e[t+h];else{var f=d[h-15],g=d[h-2];d[h]=((f<<25|f>>>7)^(f<<14|f>>>18)^f>>>3)+d[h-7]+((g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10)+d[h-16]}f=p+((u<<26|u>>>6)^(u<<21|u>>>11)^(u<<7|u>>>25))+(u&l^~u&c)+a[h]+d[h],g=((r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22))+(r&i^r&o^i&o),p=c,c=l,l=u,u=s+f|0,s=o,o=i,i=r,r=f+g|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+o|0,n[3]=n[3]+s|0,n[4]=n[4]+u|0,n[5]=n[5]+l|0,n[6]=n[6]+c|0,n[7]=n[7]+p|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;return n[i>>>5]|=128<<24-i%32,n[14+(i+64>>>9<<4)]=e.floor(r/4294967296),n[15+(i+64>>>9<<4)]=r,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=r._createHelper(i),t.HmacSHA256=r._createHmacHelper(i)}(Math),function(){var e=g,t=e.lib.WordArray,n=(r=e.algo).SHA256,r=r.SHA224=n.extend({_doReset:function(){this._hash=new t.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=n._doFinalize.call(this);return e.sigBytes-=4,e}});e.SHA224=n._createHelper(r),e.HmacSHA224=n._createHmacHelper(r)}(),function(){function e(){return r.create.apply(r,arguments)}for(var t=g,n=t.lib.Hasher,r=(o=t.x64).Word,i=o.WordArray,o=t.algo,a=[e(1116352408,3609767458),e(1899447441,602891725),e(3049323471,3964484399),e(3921009573,2173295548),e(961987163,4081628472),e(1508970993,3053834265),e(2453635748,2937671579),e(2870763221,3664609560),e(3624381080,2734883394),e(310598401,1164996542),e(607225278,1323610764),e(1426881987,3590304994),e(1925078388,4068182383),e(2162078206,991336113),e(2614888103,633803317),e(3248222580,3479774868),e(3835390401,2666613458),e(4022224774,944711139),e(264347078,2341262773),e(604807628,2007800933),e(770255983,1495990901),e(1249150122,1856431235),e(1555081692,3175218132),e(1996064986,2198950837),e(2554220882,3999719339),e(2821834349,766784016),e(2952996808,2566594879),e(3210313671,3203337956),e(3336571891,1034457026),e(3584528711,2466948901),e(113926993,3758326383),e(338241895,168717936),e(666307205,1188179964),e(773529912,1546045734),e(1294757372,1522805485),e(1396182291,2643833823),e(1695183700,2343527390),e(1986661051,1014477480),e(2177026350,1206759142),e(2456956037,344077627),e(2730485921,1290863460),e(2820302411,3158454273),e(3259730800,3505952657),e(3345764771,106217008),e(3516065817,3606008344),e(3600352804,1432725776),e(4094571909,1467031594),e(275423344,851169720),e(430227734,3100823752),e(506948616,1363258195),e(659060556,3750685593),e(883997877,3785050280),e(958139571,3318307427),e(1322822218,3812723403),e(1537002063,2003034995),e(1747873779,3602036899),e(1955562222,1575990012),e(2024104815,1125592928),e(2227730452,2716904306),e(2361852424,442776044),e(2428436474,593698344),e(2756734187,3733110249),e(3204031479,2999351573),e(3329325298,3815920427),e(3391569614,3928383900),e(3515267271,566280711),e(3940187606,3454069534),e(4118630271,4000239992),e(116418474,1914138554),e(174292421,2731055270),e(289380356,3203993006),e(460393269,320620315),e(685471733,587496836),e(852142971,1086792851),e(1017036298,365543100),e(1126000580,2618297676),e(1288033470,3409855158),e(1501505948,4234509866),e(1607167915,987167468),e(1816402316,1246189591)],s=[],u=0;80>u;u++)s[u]=e();o=o.SHA512=n.extend({_doReset:function(){this._hash=new i.init([new r.init(1779033703,4089235720),new r.init(3144134277,2227873595),new r.init(1013904242,4271175723),new r.init(2773480762,1595750129),new r.init(1359893119,2917565137),new r.init(2600822924,725511199),new r.init(528734635,4215389547),new r.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var n=(p=this._hash.words)[0],r=p[1],i=p[2],o=p[3],u=p[4],l=p[5],c=p[6],p=p[7],h=n.high,d=n.low,f=r.high,g=r.low,m=i.high,v=i.low,y=o.high,b=o.low,w=u.high,x=u.low,S=l.high,E=l.low,A=c.high,F=c.low,C=p.high,$=p.low,D=h,T=d,I=f,R=g,P=m,O=v,k=y,_=b,j=w,N=x,L=S,B=E,U=A,M=F,H=C,V=$,q=0;80>q;q++){var K=s[q];if(16>q)var z=K.high=0|e[t+2*q],G=K.low=0|e[t+2*q+1];else{z=((G=(z=s[q-15]).high)>>>1|(W=z.low)<<31)^(G>>>8|W<<24)^G>>>7;var W=(W>>>1|G<<31)^(W>>>8|G<<24)^(W>>>7|G<<25),Y=((G=(Y=s[q-2]).high)>>>19|(X=Y.low)<<13)^(G<<3|X>>>29)^G>>>6,X=(X>>>19|G<<13)^(X<<3|G>>>29)^(X>>>6|G<<26),J=(G=s[q-7]).high,Z=(Q=s[q-16]).high,Q=Q.low;z=(z=(z=z+J+((G=W+G.low)>>>0<W>>>0?1:0))+Y+((G=G+X)>>>0<X>>>0?1:0))+Z+((G=G+Q)>>>0<Q>>>0?1:0);K.high=z,K.low=G}J=j&L^~j&U,Q=N&B^~N&M,K=D&I^D&P^I&P;var ee=T&R^T&O^R&O,te=(W=(D>>>28|T<<4)^(D<<30|T>>>2)^(D<<25|T>>>7),Y=(T>>>28|D<<4)^(T<<30|D>>>2)^(T<<25|D>>>7),(X=a[q]).high),ne=X.low;Z=H+((j>>>14|N<<18)^(j>>>18|N<<14)^(j<<23|N>>>9))+((X=V+((N>>>14|j<<18)^(N>>>18|j<<14)^(N<<23|j>>>9)))>>>0<V>>>0?1:0),H=U,V=M,U=L,M=B,L=j,B=N,j=k+(Z=(Z=(Z=Z+J+((X=X+Q)>>>0<Q>>>0?1:0))+te+((X=X+ne)>>>0<ne>>>0?1:0))+z+((X=X+G)>>>0<G>>>0?1:0))+((N=_+X|0)>>>0<_>>>0?1:0)|0,k=P,_=O,P=I,O=R,I=D,R=T,D=Z+(K=W+K+((G=Y+ee)>>>0<Y>>>0?1:0))+((T=X+G|0)>>>0<X>>>0?1:0)|0}d=n.low=d+T,n.high=h+D+(d>>>0<T>>>0?1:0),g=r.low=g+R,r.high=f+I+(g>>>0<R>>>0?1:0),v=i.low=v+O,i.high=m+P+(v>>>0<O>>>0?1:0),b=o.low=b+_,o.high=y+k+(b>>>0<_>>>0?1:0),x=u.low=x+N,u.high=w+j+(x>>>0<N>>>0?1:0),E=l.low=E+B,l.high=S+L+(E>>>0<B>>>0?1:0),F=c.low=F+M,c.high=A+U+(F>>>0<M>>>0?1:0),$=p.low=$+V,p.high=C+H+($>>>0<V>>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[30+(r+128>>>10<<5)]=Math.floor(n/4294967296),t[31+(r+128>>>10<<5)]=n,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32}),t.SHA512=n._createHelper(o),t.HmacSHA512=n._createHmacHelper(o)}(),function(){var e=g,t=(i=e.x64).Word,n=i.WordArray,r=(i=e.algo).SHA512,i=i.SHA384=r.extend({_doReset:function(){this._hash=new n.init([new t.init(3418070365,3238371032),new t.init(1654270250,914150663),new t.init(2438529370,812702999),new t.init(355462360,4144912697),new t.init(1731405415,4290775857),new t.init(2394180231,1750603025),new t.init(3675008525,1694076839),new t.init(1203062813,3204075428)])},_doFinalize:function(){var e=r._doFinalize.call(this);return e.sigBytes-=16,e}});e.SHA384=r._createHelper(i),e.HmacSHA384=r._createHmacHelper(i)}(),function(){var e=g,t=(r=e.lib).WordArray,n=r.Hasher,r=e.algo,i=t.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),o=t.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),a=t.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),s=t.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),u=t.create([0,1518500249,1859775393,2400959708,2840853838]),l=t.create([1352829926,1548603684,1836072691,2053994217,0]);r=r.RIPEMD160=n.extend({_doReset:function(){this._hash=t.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=0;16>n;n++){var r=e[w=t+n];e[w]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8)}var c,p,h,d,f,g,m,v,y,b,w=this._hash.words,x=(r=u.words,l.words),S=i.words,E=o.words,A=a.words,F=s.words;g=c=w[0],m=p=w[1],v=h=w[2],y=d=w[3],b=f=w[4];var C;for(n=0;80>n;n+=1)C=c+e[t+S[n]]|0,C=16>n?C+((p^h^d)+r[0]):32>n?C+((p&h|~p&d)+r[1]):48>n?C+(((p|~h)^d)+r[2]):64>n?C+((p&d|h&~d)+r[3]):C+((p^(h|~d))+r[4]),C=(C=(C|=0)<<A[n]|C>>>32-A[n])+f|0,c=f,f=d,d=h<<10|h>>>22,h=p,p=C,C=g+e[t+E[n]]|0,C=16>n?C+((m^(v|~y))+x[0]):32>n?C+((m&y|v&~y)+x[1]):48>n?C+(((m|~v)^y)+x[2]):64>n?C+((m&v|~m&y)+x[3]):C+((m^v^y)+x[4]),C=(C=(C|=0)<<F[n]|C>>>32-F[n])+b|0,g=b,b=y,y=v<<10|v>>>22,v=m,m=C;C=w[1]+h+y|0,w[1]=w[2]+d+b|0,w[2]=w[3]+f+g|0,w[3]=w[4]+c+m|0,w[4]=w[0]+p+v|0,w[0]=C},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;for(t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),e.sigBytes=4*(t.length+1),this._process(),t=(e=this._hash).words,n=0;5>n;n++)r=t[n],t[n]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8);return e},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e}});e.RIPEMD160=n._createHelper(r),e.HmacRIPEMD160=n._createHmacHelper(r)}(Math),function(){var e=g,t=e.enc.Utf8;e.algo.HMAC=e.lib.Base.extend({init:function(e,n){e=this._hasher=new e.init,"string"==typeof n&&(n=t.parse(n));var r=e.blockSize,i=4*r;n.sigBytes>i&&(n=e.finalize(n)),n.clamp();for(var o=this._oKey=n.clone(),a=this._iKey=n.clone(),s=o.words,u=a.words,l=0;l<r;l++)s[l]^=1549556828,u[l]^=909522486;o.sigBytes=a.sigBytes=i,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher;return e=t.finalize(e),t.reset(),t.finalize(this._oKey.clone().concat(e))}})}(),function(){var e,t=g,n=(e=t.lib).Base,r=e.WordArray,i=(e=t.algo).HMAC,o=e.PBKDF2=n.extend({cfg:n.extend({keySize:4,hasher:e.SHA1,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){var n=this.cfg,o=i.create(n.hasher,e),a=r.create(),s=r.create([1]),u=a.words,l=s.words,c=n.keySize;for(n=n.iterations;u.length<c;){var p=o.update(t).finalize(s);o.reset();for(var h=p.words,d=h.length,f=p,g=1;g<n;g++){f=o.finalize(f),o.reset();for(var m=f.words,v=0;v<d;v++)h[v]^=m[v]}a.concat(p),l[0]++}return a.sigBytes=4*c,a}});t.PBKDF2=function(e,t,n){return o.create(n).compute(e,t)}}();
2
2
  /*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
3
3
  */
4
4
  var m,v="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function y(e){var t,n,r="";for(t=0;t+3<=e.length;t+=3)n=parseInt(e.substring(t,t+3),16),r+=v.charAt(n>>6)+v.charAt(63&n);for(t+1==e.length?(n=parseInt(e.substring(t,t+1),16),r+=v.charAt(n<<2)):t+2==e.length&&(n=parseInt(e.substring(t,t+2),16),r+=v.charAt(n>>2)+v.charAt((3&n)<<4)),"=";(3&r.length)>0;)r+="=";return r}function b(e){var t,n,r,i="",o=0;for(t=0;t<e.length&&"="!=e.charAt(t);++t)(r=v.indexOf(e.charAt(t)))<0||(0==o?(i+=C(r>>2),n=3&r,o=1):1==o?(i+=C(n<<2|r>>4),n=15&r,o=2):2==o?(i+=C(n),i+=C(r>>2),n=3&r,o=3):(i+=C(n<<2|r>>4),i+=C(15&r),o=0));return 1==o&&(i+=C(n<<2)),i}function w(e){var t,n=b(e),r=new Array;for(t=0;2*t<n.length;++t)r[t]=parseInt(n.substring(2*t,2*t+2),16);return r}function x(e,t,n){null!=e&&("number"==typeof e?this.fromNumber(e,t,n):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}function S(){return new x(null)}"Microsoft Internet Explorer"==d.appName?(x.prototype.am=function(e,t,n,r,i,o){for(var a=32767&t,s=t>>15;--o>=0;){var u=32767&this[e],l=this[e++]>>15,c=s*u+l*a;i=((u=a*u+((32767&c)<<15)+n[r]+(1073741823&i))>>>30)+(c>>>15)+s*l+(i>>>30),n[r++]=1073741823&u}return i},m=30):"Netscape"!=d.appName?(x.prototype.am=function(e,t,n,r,i,o){for(;--o>=0;){var a=t*this[e++]+n[r]+i;i=Math.floor(a/67108864),n[r++]=67108863&a}return i},m=26):(x.prototype.am=function(e,t,n,r,i,o){for(var a=16383&t,s=t>>14;--o>=0;){var u=16383&this[e],l=this[e++]>>14,c=s*u+l*a;i=((u=a*u+((16383&c)<<14)+n[r]+i)>>28)+(c>>14)+s*l,n[r++]=268435455&u}return i},m=28),x.prototype.DB=m,x.prototype.DM=(1<<m)-1,x.prototype.DV=1<<m;x.prototype.FV=Math.pow(2,52),x.prototype.F1=52-m,x.prototype.F2=2*m-52;var E,A,F=new Array;for(E="0".charCodeAt(0),A=0;A<=9;++A)F[E++]=A;for(E="a".charCodeAt(0),A=10;A<36;++A)F[E++]=A;for(E="A".charCodeAt(0),A=10;A<36;++A)F[E++]=A;function C(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function $(e,t){var n=F[e.charCodeAt(t)];return null==n?-1:n}function D(e){var t=S();return t.fromInt(e),t}function T(e){var t,n=1;return 0!=(t=e>>>16)&&(e=t,n+=16),0!=(t=e>>8)&&(e=t,n+=8),0!=(t=e>>4)&&(e=t,n+=4),0!=(t=e>>2)&&(e=t,n+=2),0!=(t=e>>1)&&(e=t,n+=1),n}function I(e){this.m=e}function R(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function P(e,t){return e&t}function O(e,t){return e|t}function k(e,t){return e^t}function _(e,t){return e&~t}function j(e){if(0==e)return-1;var t=0;return 0==(65535&e)&&(e>>=16,t+=16),0==(255&e)&&(e>>=8,t+=8),0==(15&e)&&(e>>=4,t+=4),0==(3&e)&&(e>>=2,t+=2),0==(1&e)&&++t,t}function N(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function L(){}function B(e){return e}function U(e){this.r2=S(),this.q3=S(),x.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}I.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},I.prototype.revert=function(e){return e},I.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},I.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),this.reduce(n)},I.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},R.prototype.convert=function(e){var t=S();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(x.ZERO)>0&&this.m.subTo(t,t),t},R.prototype.revert=function(e){var t=S();return e.copyTo(t),this.reduce(t),t},R.prototype.reduce=function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t<this.m.t;++t){var n=32767&e[t],r=n*this.mpl+((n*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(e[n=t+this.m.t]+=this.m.am(0,r,e,t,0,this.m.t);e[n]>=e.DV;)e[n]-=e.DV,e[++n]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},R.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),this.reduce(n)},R.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},x.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s},x.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0},x.prototype.fromString=function(e,t){var n;if(16==t)n=4;else if(8==t)n=3;else if(256==t)n=8;else if(2==t)n=1;else if(32==t)n=5;else{if(4!=t)return void this.fromRadix(e,t);n=2}this.t=0,this.s=0;for(var r=e.length,i=!1,o=0;--r>=0;){var a=8==n?255&e[r]:$(e,r);a<0?"-"==e.charAt(r)&&(i=!0):(i=!1,0==o?this[this.t++]=a:o+n>this.DB?(this[this.t-1]|=(a&(1<<this.DB-o)-1)<<o,this[this.t++]=a>>this.DB-o):this[this.t-1]|=a<<o,(o+=n)>=this.DB&&(o-=this.DB))}8==n&&0!=(128&e[0])&&(this.s=-1,o>0&&(this[this.t-1]|=(1<<this.DB-o)-1<<o)),this.clamp(),i&&x.ZERO.subTo(this,this)},x.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t},x.prototype.dlShiftTo=function(e,t){var n;for(n=this.t-1;n>=0;--n)t[n+e]=this[n];for(n=e-1;n>=0;--n)t[n]=0;t.t=this.t+e,t.s=this.s},x.prototype.drShiftTo=function(e,t){for(var n=e;n<this.t;++n)t[n-e]=this[n];t.t=Math.max(this.t-e,0),t.s=this.s},x.prototype.lShiftTo=function(e,t){var n,r=e%this.DB,i=this.DB-r,o=(1<<i)-1,a=Math.floor(e/this.DB),s=this.s<<r&this.DM;for(n=this.t-1;n>=0;--n)t[n+a+1]=this[n]>>i|s,s=(this[n]&o)<<r;for(n=a-1;n>=0;--n)t[n]=0;t[a]=s,t.t=this.t+a+1,t.s=this.s,t.clamp()},x.prototype.rShiftTo=function(e,t){t.s=this.s;var n=Math.floor(e/this.DB);if(n>=this.t)t.t=0;else{var r=e%this.DB,i=this.DB-r,o=(1<<r)-1;t[0]=this[n]>>r;for(var a=n+1;a<this.t;++a)t[a-n-1]|=(this[a]&o)<<i,t[a-n]=this[a]>>r;r>0&&(t[this.t-n-1]|=(this.s&o)<<i),t.t=this.t-n,t.clamp()}},x.prototype.subTo=function(e,t){for(var n=0,r=0,i=Math.min(e.t,this.t);n<i;)r+=this[n]-e[n],t[n++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r-=e.s;n<this.t;)r+=this[n],t[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<e.t;)r-=e[n],t[n++]=r&this.DM,r>>=this.DB;r-=e.s}t.s=r<0?-1:0,r<-1?t[n++]=this.DV+r:r>0&&(t[n++]=r),t.t=n,t.clamp()},x.prototype.multiplyTo=function(e,t){var n=this.abs(),r=e.abs(),i=n.t;for(t.t=i+r.t;--i>=0;)t[i]=0;for(i=0;i<r.t;++i)t[i+n.t]=n.am(0,r[i],t,i,0,n.t);t.s=0,t.clamp(),this.s!=e.s&&x.ZERO.subTo(t,t)},x.prototype.squareTo=function(e){for(var t=this.abs(),n=e.t=2*t.t;--n>=0;)e[n]=0;for(n=0;n<t.t-1;++n){var r=t.am(n,t[n],e,2*n,0,1);(e[n+t.t]+=t.am(n+1,2*t[n],e,2*n+1,r,t.t-n-1))>=t.DV&&(e[n+t.t]-=t.DV,e[n+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(n,t[n],e,2*n,0,1)),e.s=0,e.clamp()},x.prototype.divRemTo=function(e,t,n){var r=e.abs();if(!(r.t<=0)){var i=this.abs();if(i.t<r.t)return null!=t&&t.fromInt(0),void(null!=n&&this.copyTo(n));null==n&&(n=S());var o=S(),a=this.s,s=e.s,u=this.DB-T(r[r.t-1]);u>0?(r.lShiftTo(u,o),i.lShiftTo(u,n)):(r.copyTo(o),i.copyTo(n));var l=o.t,c=o[l-1];if(0!=c){var p=c*(1<<this.F1)+(l>1?o[l-2]>>this.F2:0),h=this.FV/p,d=(1<<this.F1)/p,f=1<<this.F2,g=n.t,m=g-l,v=null==t?S():t;for(o.dlShiftTo(m,v),n.compareTo(v)>=0&&(n[n.t++]=1,n.subTo(v,n)),x.ONE.dlShiftTo(l,v),v.subTo(o,o);o.t<l;)o[o.t++]=0;for(;--m>=0;){var y=n[--g]==c?this.DM:Math.floor(n[g]*h+(n[g-1]+f)*d);if((n[g]+=o.am(0,y,n,m,0,l))<y)for(o.dlShiftTo(m,v),n.subTo(v,n);n[g]<--y;)n.subTo(v,n)}null!=t&&(n.drShiftTo(l,t),a!=s&&x.ZERO.subTo(t,t)),n.t=l,n.clamp(),u>0&&n.rShiftTo(u,n),a<0&&x.ZERO.subTo(n,n)}}},x.prototype.invDigit=function(){if(this.t<1)return 0;var e=this[0];if(0==(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},x.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},x.prototype.exp=function(e,t){if(e>4294967295||e<1)return x.ONE;var n=S(),r=S(),i=t.convert(this),o=T(e)-1;for(i.copyTo(n);--o>=0;)if(t.sqrTo(n,r),(e&1<<o)>0)t.mulTo(r,i,n);else{var a=n;n=r,r=a}return t.revert(n)},x.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var n,r=(1<<t)-1,i=!1,o="",a=this.t,s=this.DB-a*this.DB%t;if(a-- >0)for(s<this.DB&&(n=this[a]>>s)>0&&(i=!0,o=C(n));a>=0;)s<t?(n=(this[a]&(1<<s)-1)<<t-s,n|=this[--a]>>(s+=this.DB-t)):(n=this[a]>>(s-=t)&r,s<=0&&(s+=this.DB,--a)),n>0&&(i=!0),i&&(o+=C(n));return i?o:"0"},x.prototype.negate=function(){var e=S();return x.ZERO.subTo(this,e),e},x.prototype.abs=function(){return this.s<0?this.negate():this},x.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var n=this.t;if(0!=(t=n-e.t))return this.s<0?-t:t;for(;--n>=0;)if(0!=(t=this[n]-e[n]))return t;return 0},x.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+T(this[this.t-1]^this.s&this.DM)},x.prototype.mod=function(e){var t=S();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(x.ZERO)>0&&e.subTo(t,t),t},x.prototype.modPowInt=function(e,t){var n;return n=e<256||t.isEven()?new I(t):new R(t),this.exp(e,n)},x.ZERO=D(0),x.ONE=D(1),L.prototype.convert=B,L.prototype.revert=B,L.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n)},L.prototype.sqrTo=function(e,t){e.squareTo(t)},U.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=S();return e.copyTo(t),this.reduce(t),t},U.prototype.revert=function(e){return e},U.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},U.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),this.reduce(n)},U.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var M=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],H=(1<<26)/M[M.length-1];
@@ -24,8 +24,8 @@ function(e,t){for(var n=e.toByteArray(),r=0;r<n.length&&0==n[r];)++r;if(n.length
24
24
  ie.prototype.getByteLength=function(){return Math.floor((this.toBigInteger().bitLength()+7)/8)},oe.prototype.getEncoded=function(e){var t=function(e,t){var n=e.toByteArrayUnsigned();if(t<n.length)n=n.slice(n.length-t);else for(;t>n.length;)n.unshift(0);return n},n=this.getX().toBigInteger(),r=this.getY().toBigInteger(),i=t(n,32);return e?r.isEven()?i.unshift(2):i.unshift(3):(i.unshift(4),i=i.concat(t(r,32))),i},oe.decodeFrom=function(e,t){t[0];var n=t.length-1,r=t.slice(1,1+n/2),i=t.slice(1+n/2,1+n);r.unshift(0),i.unshift(0);var o=new x(r),a=new x(i);return new oe(e,e.fromBigInteger(o),e.fromBigInteger(a))},oe.decodeFromHex=function(e,t){t.substr(0,2);var n=t.length-2,r=t.substr(2,n/2),i=t.substr(2+n/2,n/2),o=new x(r,16),a=new x(i,16);return new oe(e,e.fromBigInteger(o),e.fromBigInteger(a))},oe.prototype.add2D=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;if(this.x.equals(e.x))return this.y.equals(e.y)?this.twice():this.curve.getInfinity();var t=e.x.subtract(this.x),n=e.y.subtract(this.y).divide(t),r=n.square().subtract(this.x).subtract(e.x),i=n.multiply(this.x.subtract(r)).subtract(this.y);return new oe(this.curve,r,i)},oe.prototype.twice2D=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var e=this.curve.fromBigInteger(x.valueOf(2)),t=this.curve.fromBigInteger(x.valueOf(3)),n=this.x.square().multiply(t).add(this.curve.a).divide(this.y.multiply(e)),r=n.square().subtract(this.x.multiply(e)),i=n.multiply(this.x.subtract(r)).subtract(this.y);return new oe(this.curve,r,i)},oe.prototype.multiply2D=function(e){if(this.isInfinity())return this;if(0==e.signum())return this.curve.getInfinity();var t,n=e,r=n.multiply(new x("3")),i=this.negate(),o=this;for(t=r.bitLength()-2;t>0;--t){o=o.twice();var a=r.testBit(t);a!=n.testBit(t)&&(o=o.add2D(a?this:i))}return o},oe.prototype.isOnCurve=function(){var e=this.getX().toBigInteger(),t=this.getY().toBigInteger(),n=this.curve.getA().toBigInteger(),r=this.curve.getB().toBigInteger(),i=this.curve.getQ(),o=t.multiply(t).mod(i),a=e.multiply(e).multiply(e).add(n.multiply(e)).add(r).mod(i);return o.equals(a)},oe.prototype.toString=function(){return"("+this.getX().toBigInteger().toString()+","+this.getY().toBigInteger().toString()+")"},oe.prototype.validate=function(){var e=this.curve.getQ();if(this.isInfinity())throw new Error("Point is at infinity.");var t=this.getX().toBigInteger(),n=this.getY().toBigInteger();if(t.compareTo(x.ONE)<0||t.compareTo(e.subtract(x.ONE))>0)throw new Error("x coordinate out of bounds");if(n.compareTo(x.ONE)<0||n.compareTo(e.subtract(x.ONE))>0)throw new Error("y coordinate out of bounds");if(!this.isOnCurve())throw new Error("Point is not on the curve.");if(this.multiply(e).isInfinity())throw new Error("Point is not a scalar multiple of G.");return!0};
25
25
  /*! Mike Samuel (c) 2009 | code.google.com/p/json-sans-eval
26
26
  */
27
- var se=function(){var e=new RegExp('(?:false|true|null|[\\{\\}\\[\\]]|(?:-?\\b(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?(?:[eE][+-]?[0-9]+)?\\b)|(?:"(?:[^\\0-\\x08\\x0a-\\x1f"\\\\]|\\\\(?:["/\\\\bfnrt]|u[0-9A-Fa-f]{4}))*"))',"g"),t=new RegExp("\\\\(?:([^u])|u(.{4}))","g"),n={'"':'"',"/":"/","\\":"\\",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};function r(e,t,r){return t?n[t]:String.fromCharCode(parseInt(r,16))}var i=new String(""),o=Object.hasOwnProperty;return function(n,a){var s,u,l=n.match(e),c=l[0],p=!1;"{"===c?s={}:"["===c?s=[]:(s=[],p=!0);for(var h=[s],d=1-p,f=l.length;d<f;++d){var g;switch((c=l[d]).charCodeAt(0)){default:(g=h[0])[u||g.length]=+c,u=void 0;break;case 34:if(-1!==(c=c.substring(1,c.length-1)).indexOf("\\")&&(c=c.replace(t,r)),g=h[0],!u){if(!(g instanceof Array)){u=c||i;break}u=g.length}g[u]=c,u=void 0;break;case 91:g=h[0],h.unshift(g[u||g.length]=[]),u=void 0;break;case 93:h.shift();break;case 102:(g=h[0])[u||g.length]=!1,u=void 0;break;case 110:(g=h[0])[u||g.length]=null,u=void 0;break;case 116:(g=h[0])[u||g.length]=!0,u=void 0;break;case 123:g=h[0],h.unshift(g[u||g.length]={}),u=void 0;break;case 125:h.shift()}}if(p){if(1!==h.length)throw new Error;s=s[0]}else if(h.length)throw new Error;if(a){var m=function(e,t){var n=e[t];if(n&&"object"==typeof n){var r=null;for(var i in n)if(o.call(n,i)&&n!==e){var s=m(n,i);void 0!==s?n[i]=s:(r||(r=[]),r.push(i))}if(r)for(var u=r.length;--u>=0;)delete n[r[u]]}return a.call(e,t,n)};s=m({"":s},"")}return s}}();void 0!==ue&&ue||(ue={}),void 0!==ue.asn1&&ue.asn1||(ue.asn1={}),ue.asn1.ASN1Util=new function(){this.integerToByteHex=function(e){var t=e.toString(16);return t.length%2==1&&(t="0"+t),t},this.bigIntToMinTwosComplementsHex=function(e){var t=e.toString(16);if("-"!=t.substr(0,1))t.length%2==1?t="0"+t:t.match(/^[0-7]/)||(t="00"+t);else{var n=t.substr(1).length;n%2==1?n+=1:t.match(/^[0-7]/)||(n+=2);for(var r="",i=0;i<n;i++)r+="f";t=new x(r,16).xor(e).add(x.ONE).toString(16).replace(/^-/,"")}return t},this.getPEMStringFromHex=function(e,t){return De(e,t)},this.newObject=function(e){var t=ue.asn1,n=t.ASN1Object,r=t.DERBoolean,i=t.DERInteger,o=t.DERBitString,a=t.DEROctetString,s=t.DERNull,u=t.DERObjectIdentifier,l=t.DEREnumerated,c=t.DERUTF8String,p=t.DERNumericString,h=t.DERPrintableString,d=t.DERTeletexString,f=t.DERIA5String,g=t.DERUTCTime,m=t.DERGeneralizedTime,v=t.DERVisibleString,y=t.DERBMPString,b=t.DERSequence,w=t.DERSet,x=t.DERTaggedObject,S=t.ASN1Util.newObject;if(e instanceof t.ASN1Object)return e;var E=Object.keys(e);if(1!=E.length)throw new Error("key of param shall be only one.");var A=E[0];if(-1==":asn1:bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:visstr:bmpstr:seq:set:tag:".indexOf(":"+A+":"))throw new Error("undefined key: "+A);if("bool"==A)return new r(e[A]);if("int"==A)return new i(e[A]);if("bitstr"==A)return new o(e[A]);if("octstr"==A)return new a(e[A]);if("null"==A)return new s(e[A]);if("oid"==A)return new u(e[A]);if("enum"==A)return new l(e[A]);if("utf8str"==A)return new c(e[A]);if("numstr"==A)return new p(e[A]);if("prnstr"==A)return new h(e[A]);if("telstr"==A)return new d(e[A]);if("ia5str"==A)return new f(e[A]);if("utctime"==A)return new g(e[A]);if("gentime"==A)return new m(e[A]);if("visstr"==A)return new v(e[A]);if("bmpstr"==A)return new y(e[A]);if("asn1"==A)return new n(e[A]);if("seq"==A){for(var F=e[A],C=[],$=0;$<F.length;$++){var D=S(F[$]);C.push(D)}return new b({array:C})}if("set"==A){for(F=e[A],C=[],$=0;$<F.length;$++){D=S(F[$]);C.push(D)}return new w({array:C})}if("tag"==A){var T=e[A];if("[object Array]"===Object.prototype.toString.call(T)&&3==T.length){var I=S(T[2]);return new x({tag:T[0],explicit:T[1],obj:I})}return new x(T)}},this.jsonToASN1HEX=function(e){return this.newObject(e).tohex()}},ue.asn1.ASN1Util.oidHexToInt=function(e){for(var t="",n=parseInt(e.substr(0,2),16),r=(t=Math.floor(n/40)+"."+n%40,""),i=2;i<e.length;i+=2){var o=("00000000"+parseInt(e.substr(i,2),16).toString(2)).slice(-8);if(r+=o.substr(1,7),"0"==o.substr(0,1))t=t+"."+new x(r,2).toString(10),r=""}return t},ue.asn1.ASN1Util.oidIntToHex=function(e){var t=function(e){var t=e.toString(16);return 1==t.length&&(t="0"+t),t},n=function(e){var n="",r=new x(e,10).toString(2),i=7-r.length%7;7==i&&(i=0);for(var o="",a=0;a<i;a++)o+="0";r=o+r;for(a=0;a<r.length-1;a+=7){var s=r.substr(a,7);a!=r.length-7&&(s="1"+s),n+=t(parseInt(s,2))}return n};if(!e.match(/^[0-9.]+$/))throw"malformed oid string: "+e;var r="",i=e.split("."),o=40*parseInt(i[0])+parseInt(i[1]);r+=t(o),i.splice(0,2);for(var a=0;a<i.length;a++)r+=n(i[a]);return r},ue.asn1.ASN1Object=function(e){this.params=null,this.getLengthHexFromValue=function(){if(void 0===this.hV||null==this.hV)throw new Error("this.hV is null or undefined");if(this.hV.length%2==1)throw new Error("value hex must be even length: n="+"".length+",v="+this.hV);var e=this.hV.length/2,t=e.toString(16);if(t.length%2==1&&(t="0"+t),e<128)return t;var n=t.length/2;if(n>15)throw new Error("ASN.1 length too long to represent by 8x: n = "+e.toString(16));return(128+n).toString(16)+t},this.tohex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getEncodedHex=function(){return this.tohex()},this.getValueHex=function(){return this.tohex(),this.hV},this.getFreshValueHex=function(){return""},this.setByParam=function(e){this.params=e},null!=e&&null!=e.tlv&&(this.hTLV=e.tlv,this.isModified=!1)},ue.asn1.DERAbstractString=function(e){ue.asn1.DERAbstractString.superclass.constructor.call(this);this.getString=function(){return this.s},this.setString=function(e){this.hTLV=null,this.isModified=!0,this.s=e,this.hV=we(this.s).toLowerCase()},this.setStringHex=function(e){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"==typeof e?this.setString(e):void 0!==e.str?this.setString(e.str):void 0!==e.hex&&this.setStringHex(e.hex))},et(ue.asn1.DERAbstractString,ue.asn1.ASN1Object),ue.asn1.DERAbstractTime=function(e){ue.asn1.DERAbstractTime.superclass.constructor.call(this);this.localDateToUTC=function(e){var t=e.getTime()+6e4*e.getTimezoneOffset();return new Date(t)},this.formatDate=function(e,t,n){var r=this.zeroPadding,i=this.localDateToUTC(e),o=String(i.getFullYear());"utc"==t&&(o=o.substr(2,2));var a=o+r(String(i.getMonth()+1),2)+r(String(i.getDate()),2)+r(String(i.getHours()),2)+r(String(i.getMinutes()),2)+r(String(i.getSeconds()),2);if(!0===n){var s=i.getMilliseconds();if(0!=s){var u=r(String(s),3);a=a+"."+(u=u.replace(/[0]+$/,""))}}return a+"Z"},this.zeroPadding=function(e,t){return e.length>=t?e:new Array(t-e.length+1).join("0")+e},this.setByParam=function(e){this.hV=null,this.hTLV=null,this.params=e},this.getString=function(){},this.setString=function(e){this.hTLV=null,this.isModified=!0,null==this.params&&(this.params={}),this.params.str=e},this.setByDate=function(e){this.hTLV=null,this.isModified=!0,null==this.params&&(this.params={}),this.params.date=e},this.setByDateValue=function(e,t,n,r,i,o){var a=new Date(Date.UTC(e,t-1,n,r,i,o,0));this.setByDate(a)},this.getFreshValueHex=function(){return this.hV}},et(ue.asn1.DERAbstractTime,ue.asn1.ASN1Object),ue.asn1.DERAbstractStructured=function(e){ue.asn1.DERAbstractString.superclass.constructor.call(this);this.setByASN1ObjectArray=function(e){this.hTLV=null,this.isModified=!0,this.asn1Array=e},this.appendASN1Object=function(e){this.hTLV=null,this.isModified=!0,this.asn1Array.push(e)},this.asn1Array=new Array,void 0!==e&&void 0!==e.array&&(this.asn1Array=e.array)},et(ue.asn1.DERAbstractStructured,ue.asn1.ASN1Object),ue.asn1.DERBoolean=function(e){ue.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV=0==e?"010100":"0101ff"},et(ue.asn1.DERBoolean,ue.asn1.ASN1Object),ue.asn1.DERInteger=function(e){ue.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.params=null;var t=ue.asn1.ASN1Util.bigIntToMinTwosComplementsHex;this.setByBigInteger=function(e){this.isModified=!0,this.params={bigint:e}},this.setByInteger=function(e){this.isModified=!0,this.params=e},this.setValueHex=function(e){this.isModified=!0,this.params={hex:e}},this.getFreshValueHex=function(){var e=this.params,n=null;if(null==e)throw new Error("value not set");if("object"==typeof e&&null!=e.hex)return this.hV=e.hex,this.hV;if("number"==typeof e)n=new x(String(e),10);else if(null!=e.int)n=new x(String(e.int),10);else{if(null==e.bigint)throw new Error("wrong parameter");n=e.bigint}return this.hV=t(n),this.hV},null!=e&&(this.params=e)},et(ue.asn1.DERInteger,ue.asn1.ASN1Object),ue.asn1.DERBitString=function(e){if(void 0!==e&&void 0!==e.obj){var t=ue.asn1.ASN1Util.newObject(e.obj);e.hex="00"+t.tohex()}ue.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(e){this.hTLV=null,this.isModified=!0,this.hV=e},this.setUnusedBitsAndHexValue=function(e,t){if(e<0||7<e)throw"unused bits shall be from 0 to 7: u = "+e;var n="0"+e;this.hTLV=null,this.isModified=!0,this.hV=n+t},this.setByBinaryString=function(e){var t=8-(e=e.replace(/0+$/,"")).length%8;8==t&&(t=0),e+="0000000".substr(0,t);for(var n="",r=0;r<e.length-1;r+=8){var i=e.substr(r,8),o=parseInt(i,2).toString(16);1==o.length&&(o="0"+o),n+=o}this.hTLV=null,this.isModified=!0,this.hV="0"+t+n},this.setByBooleanArray=function(e){for(var t="",n=0;n<e.length;n++)1==e[n]?t+="1":t+="0";this.setByBinaryString(t)},this.newFalseArray=function(e){for(var t=new Array(e),n=0;n<e;n++)t[n]=!1;return t},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"==typeof e&&e.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(e):void 0!==e.hex?this.setHexValueIncludingUnusedBits(e.hex):void 0!==e.bin?this.setByBinaryString(e.bin):void 0!==e.array&&this.setByBooleanArray(e.array))},et(ue.asn1.DERBitString,ue.asn1.ASN1Object),ue.asn1.DEROctetString=function(e){if(void 0!==e&&void 0!==e.obj){var t=ue.asn1.ASN1Util.newObject(e.obj);e.hex=t.tohex()}ue.asn1.DEROctetString.superclass.constructor.call(this,e),this.hT="04"},et(ue.asn1.DEROctetString,ue.asn1.DERAbstractString),ue.asn1.DERNull=function(){ue.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},et(ue.asn1.DERNull,ue.asn1.ASN1Object),ue.asn1.DERObjectIdentifier=function(e){ue.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(e){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.setValueOidString=function(e){var t=ze(e);if(null==t)throw new Error("malformed oid string: "+e);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.setValueName=function(e){var t=ue.asn1.x509.OID.name2oid(e);if(""===t)throw new Error("DERObjectIdentifier oidName undefined: "+e);this.setValueOidString(t)},this.setValueNameOrOid=function(e){e.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(e):this.setValueName(e)},this.getFreshValueHex=function(){return this.hV},this.setByParam=function(e){"string"==typeof e?this.setValueNameOrOid(e):void 0!==e.oid?this.setValueNameOrOid(e.oid):void 0!==e.name?this.setValueNameOrOid(e.name):void 0!==e.hex&&this.setValueHex(e.hex)},void 0!==e&&this.setByParam(e)},et(ue.asn1.DERObjectIdentifier,ue.asn1.ASN1Object),ue.asn1.DEREnumerated=function(e){ue.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=ue.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new x(String(e),10);this.setByBigInteger(t)},this.setValueHex=function(e){this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&(void 0!==e.int?this.setByInteger(e.int):"number"==typeof e?this.setByInteger(e):void 0!==e.hex&&this.setValueHex(e.hex))},et(ue.asn1.DEREnumerated,ue.asn1.ASN1Object),ue.asn1.DERUTF8String=function(e){ue.asn1.DERUTF8String.superclass.constructor.call(this,e),this.hT="0c"},et(ue.asn1.DERUTF8String,ue.asn1.DERAbstractString),ue.asn1.DERNumericString=function(e){ue.asn1.DERNumericString.superclass.constructor.call(this,e),this.hT="12"},et(ue.asn1.DERNumericString,ue.asn1.DERAbstractString),ue.asn1.DERPrintableString=function(e){ue.asn1.DERPrintableString.superclass.constructor.call(this,e),this.hT="13"},et(ue.asn1.DERPrintableString,ue.asn1.DERAbstractString),ue.asn1.DERTeletexString=function(e){ue.asn1.DERTeletexString.superclass.constructor.call(this,e),this.hT="14"},et(ue.asn1.DERTeletexString,ue.asn1.DERAbstractString),ue.asn1.DERIA5String=function(e){ue.asn1.DERIA5String.superclass.constructor.call(this,e),this.hT="16"},et(ue.asn1.DERIA5String,ue.asn1.DERAbstractString),ue.asn1.DERVisibleString=function(e){ue.asn1.DERIA5String.superclass.constructor.call(this,e),this.hT="1a"},et(ue.asn1.DERVisibleString,ue.asn1.DERAbstractString),ue.asn1.DERBMPString=function(e){ue.asn1.DERBMPString.superclass.constructor.call(this,e),this.hT="1e"},et(ue.asn1.DERBMPString,ue.asn1.DERAbstractString),ue.asn1.DERUTCTime=function(e){ue.asn1.DERUTCTime.superclass.constructor.call(this,e),this.hT="17",this.params=void 0,this.getFreshValueHex=function(){var e=this.params;if(null==this.params&&(e={date:new Date}),"string"==typeof e){if(!e.match(/^[0-9]{12}Z$/)&&!e.match(/^[0-9]{12}\.[0-9]+Z$/))throw new Error("malformed string for UTCTime: "+e);this.hV=ge(e)}else if(null!=e.str)this.hV=ge(e.str);else if(null==e.date&&1==e.millis){var t=new Date;this.hV=ge(this.formatDate(t,"utc",!0))}else if(null!=e.date&&e.date instanceof Date){var n=!0===e.millis;this.hV=ge(this.formatDate(e.date,"utc",n))}else e instanceof Date&&(this.hV=ge(this.formatDate(e,"utc")));if(null==this.hV)throw new Error("parameter not specified properly for UTCTime");return this.hV},null!=e&&this.setByParam(e)},et(ue.asn1.DERUTCTime,ue.asn1.DERAbstractTime),ue.asn1.DERGeneralizedTime=function(e){ue.asn1.DERGeneralizedTime.superclass.constructor.call(this,e),this.hT="18",this.params=e,this.getFreshValueHex=function(){var e=this.params;if(null==this.params&&(e={date:new Date}),"string"==typeof e){if(!e.match(/^[0-9]{14}Z$/)&&!e.match(/^[0-9]{14}\.[0-9]+Z$/))throw new Error("malformed string for GeneralizedTime: "+e);this.hV=ge(e)}else if(null!=e.str)this.hV=ge(e.str);else if(null==e.date&&1==e.millis){var t=new Date;this.hV=ge(this.formatDate(t,"gen",!0))}else if(null!=e.date&&e.date instanceof Date){var n=!0===e.millis;this.hV=ge(this.formatDate(e.date,"gen",n))}else e instanceof Date&&(this.hV=ge(this.formatDate(e,"gen")));if(null==this.hV)throw new Error("parameter not specified properly for GeneralizedTime");return this.hV},null!=e&&this.setByParam(e)},et(ue.asn1.DERGeneralizedTime,ue.asn1.DERAbstractTime),ue.asn1.DERSequence=function(e){ue.asn1.DERSequence.superclass.constructor.call(this,e),this.hT="30",this.getFreshValueHex=function(){for(var e="",t=0;t<this.asn1Array.length;t++){e+=this.asn1Array[t].tohex()}return this.hV=e,this.hV}},et(ue.asn1.DERSequence,ue.asn1.DERAbstractStructured),ue.asn1.DERSet=function(e){ue.asn1.DERSet.superclass.constructor.call(this,e),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var e=new Array,t=0;t<this.asn1Array.length;t++){var n=this.asn1Array[t];e.push(n.tohex())}return 1==this.sortFlag&&e.sort(),this.hV=e.join(""),this.hV},void 0!==e&&void 0!==e.sortflag&&0==e.sortflag&&(this.sortFlag=!1)},et(ue.asn1.DERSet,ue.asn1.DERAbstractStructured),ue.asn1.DERTaggedObject=function(e){ue.asn1.DERTaggedObject.superclass.constructor.call(this);var t=ue.asn1,n=pe,r=n.getV,i=(n.isASN1HEX,t.ASN1Util.newObject);this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.params={tag:"a0",explicit:!0},this.setASN1Object=function(e,t,n){this.params={tag:t,explicit:e,obj:n}},this.getFreshValueHex=function(){var e=this.params;if(null==e.explicit&&(e.explicit=!0),null!=e.tage&&(e.tag=e.tage,e.explicit=!0),null!=e.tagi&&(e.tag=e.tagi,e.explicit=!1),null!=e.str)this.hV=we(e.str);else if(null!=e.hex)this.hV=e.hex;else{if(null==e.obj)throw new Error("str, hex nor obj not specified");var n;e.obj instanceof t.ASN1Object?n=e.obj.tohex():"object"==typeof e.obj&&(n=i(e.obj).tohex()),e.explicit?this.hV=n:this.hV=r(n,0)}return null==e.tag&&(e.tag="a0"),this.hT=e.tag,this.hTLV=null,this.isModified=!0,this.hV},this.setByParam=function(e){this.params=e},void 0!==e&&this.setByParam(e)},et(ue.asn1.DERTaggedObject,ue.asn1.ASN1Object);var ue,le,ce,pe=new function(){};function he(e){for(var t=new Array,n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}function de(e){for(var t="",n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t}function fe(e){for(var t="",n=0;n<e.length;n++){var r=e[n].toString(16);1==r.length&&(r="0"+r),t+=r}return t}function ge(e){return fe(he(e))}function me(e){return e=(e=(e=e.replace(/\=/g,"")).replace(/\+/g,"-")).replace(/\//g,"_")}function ve(e){return e.length%4==2?e+="==":e.length%4==3&&(e+="="),e=(e=e.replace(/-/g,"+")).replace(/_/g,"/")}function ye(e){return e.length%2==1&&(e="0"+e),me(y(e))}function be(e){return b(ve(e))}function we(e){return Oe(He(e)).toLowerCase()}function xe(e){try{return decodeURIComponent(ke(e))}catch(e){return null}}function Se(e){return xe(function(e){for(var t=e.match(/.{1,2}/g),n=[],r=0;r<t.length;r++){var i=parseInt(t[r],16);161<=i&&i<=191?(n.push("c2"),n.push(t[r])):192<=i&&i<=255?(n.push("c3"),n.push((i-64).toString(16))):n.push(t[r])}return n.join("")}(e))}function Ee(e){for(var t="",n=0;n<e.length-1;n+=2)t+=String.fromCharCode(parseInt(e.substr(n,2),16));return t}function Ae(e){for(var t="",n=0;n<e.length;n++)t+=("0"+e.charCodeAt(n).toString(16)).slice(-2);return t}function Fe(e){return y(e)}function Ce(e,t){return e=(e=e.replace(new RegExp("(.{"+t+"})","g"),"$1\r\n")).replace(/\s+$/,"")}function $e(e){return b(e.replace(/[^0-9A-Za-z\/+=]*/g,""))}function De(e,t){return"-----BEGIN "+t+"-----\r\n"+Ce(Fe(e),64)+"\r\n-----END "+t+"-----\r\n"}function Te(e,t){if(-1==e.indexOf("-----BEGIN "))throw new Error("can't find PEM header");return $e(e=void 0!==t?(e=e.replace(new RegExp("^[^]*-----BEGIN "+t+"-----"),"")).replace(new RegExp("-----END "+t+"-----[^]*$"),""):(e=e.replace(/^[^]*-----BEGIN [^-]+-----/,"")).replace(/-----END [^-]+-----[^]*$/,""))}function Ie(e){var t,n,r,i,o,a,s,u,l,c;if(c=(e=Pe(e)).match(/^(\d{4})(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(|\.\d+)Z$/))return t=parseInt(c[1]),n=parseInt(c[2])-1,r=parseInt(c[3]),i=parseInt(c[4]),o=parseInt(c[5]),a=parseInt(c[6]),s=0,""!==(u=c[7])&&(l=(u.substr(1)+"00").substr(0,3),s=parseInt(l)),Date.UTC(t,n,r,i,o,a,s);throw new Error("unsupported zulu format: "+e)}function Re(e){return Math.round(Ie(e)/1e3)}function Pe(e){return e.match(/^[0-9]{12}Z$/)||e.match(/^[0-9]{12}[.][0-9]*Z$/)?e.match(/^[0-4]/)?"20"+e:"19"+e:e}function Oe(e){return e.replace(/%/g,"")}function ke(e){return e.replace(/(..)/g,"%$1")}function _e(e){var t="malformed IPv6 address";if(!e.match(/^[0-9A-Fa-f:]+$/))throw t;var n=(e=e.toLowerCase()).split(":").length-1;if(n<2)throw t;var r=":".repeat(7-n+2),i=(e=e.replace("::",r)).split(":");if(8!=i.length)throw t;for(var o=0;o<8;o++)i[o]=("0000"+i[o]).slice(-4);return i.join("")}function je(e){if(!e.match(/^[0-9A-Fa-f]{32}$/))throw new Error("malformed IPv6 address: "+e);var t=(e=e.toLowerCase()).match(/.{1,4}/g),n=(e=":"+(t=(t=t.map((function(e){return e.replace(/^0+/,"")}))).map((function(e){return""==e?"0":e}))).join(":")+":").match(/:(0:){2,}/g);if(null==n)return e.slice(1,-1);var r=n.sort().slice(-1)[0];return"::"!=(e=e.replace(r.substr(0,r.length-1),":")).substr(0,2)&&(e=e.substr(1)),"::"!=e.substr(-2,2)&&(e=e.substr(0,e.length-1)),e}function Ne(e){var t=new Error("malformed hex value");if(!e.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/))throw t;if(8==e.length){try{return parseInt(e.substr(0,2),16)+"."+parseInt(e.substr(2,2),16)+"."+parseInt(e.substr(4,2),16)+"."+parseInt(e.substr(6,2),16)}catch(e){throw t}}else{if(16!=e.length){if(32==e.length)return je(e);if(64==e.length){try{return je(e.substr(0,32))+"/"+Le(e.substr(32))}catch(e){throw t}return}return e}try{return Ne(e.substr(0,8))+"/"+Le(e.substr(8))}catch(e){throw t}}}function Le(e){var t,n=new Error("malformed mask");try{t=new x(e,16).toString(2)}catch(e){throw n}if(!t.match(/^1*0*$/))throw n;return t.replace(/0+$/,"").length}function Be(e){var t=new Error("malformed IP address");if(!(e=e.toLowerCase(e)).match(/^[0-9a-f.:/]+$/))throw t;if(!e.match(/^[0-9.]+$/)){var n;if(e.match(/^[0-9.]+\/[0-9]+$/))return Be((n=e.split("/"))[0])+Ue(parseInt(n[1]),32);if(e.match(/^[0-9a-f:]+$/)&&-1!==e.indexOf(":"))return _e(e);if(e.match(/^[0-9a-f:]+\/[0-9]+$/)&&-1!==e.indexOf(":"))return _e((n=e.split("/"))[0])+Ue(parseInt(n[1]),128);throw t}var r=e.split(".");if(4!==r.length)throw t;var i="";try{for(var o=0;o<4;o++){i+=("0"+parseInt(r[o]).toString(16)).slice(-2)}return i}catch(e){throw t}}function Ue(e,t){return 32==t&&0==e?"00000000":128==t&&0==e?"00000000000000000000000000000000":new x(Array(e+1).join("1")+Array(t-e+1).join("0"),2).toString(16)}function Me(e){return e.match(/.{4}/g).map((function(e){var t=parseInt(e.substr(0,2),16),n=parseInt(e.substr(2),16);if(0==t&n<128)return String.fromCharCode(n);if(t<8){var r=128|63&n;return xe((192|(7&t)<<3|(192&n)>>6).toString(16)+r.toString(16))}r=128|(15&t)<<2|(192&n)>>6;var i=128|63&n;return xe((224|(240&t)>>4).toString(16)+r.toString(16)+i.toString(16))})).join("")}function He(e){for(var t=encodeURIComponent(e),n="",r=0;r<t.length;r++)"%"==t[r]?(n+=t.substr(r,3),r+=2):n=n+"%"+ge(t[r]);return n}function Ve(e){return!(e.length%2!=0||!e.match(/^[0-9a-f]+$/)&&!e.match(/^[0-9A-F]+$/))}function qe(e){return!!e.match(/^[0-9A-Za-z-_.]+$/)}function Ke(e){return e.length%2==1?"0"+e:e.substr(0,1)>"7"?"00"+e:e}pe.getLblen=function(e,t){if("8"!=e.substr(t+2,1))return 1;var n=parseInt(e.substr(t+3,1));return 0==n?-1:0<n&&n<10?n+1:-2},pe.getL=function(e,t){var n=pe.getLblen(e,t);return n<1?"":e.substr(t+2,2*n)},pe.getVblen=function(e,t){var n;return""==(n=pe.getL(e,t))?-1:("8"===n.substr(0,1)?new x(n.substr(2),16):new x(n,16)).intValue()},pe.getVidx=function(e,t){var n=pe.getLblen(e,t);return n<0?n:t+2*(n+1)},pe.getV=function(e,t){var n=pe.getVidx(e,t),r=pe.getVblen(e,t);return e.substr(n,2*r)},pe.getTLV=function(e,t){return e.substr(t,2)+pe.getL(e,t)+pe.getV(e,t)},pe.getTLVblen=function(e,t){return 2+2*pe.getLblen(e,t)+2*pe.getVblen(e,t)},pe.getNextSiblingIdx=function(e,t){return pe.getVidx(e,t)+2*pe.getVblen(e,t)},pe.getChildIdx=function(e,t){var n,r,i,o=pe,a=[];n=o.getVidx(e,t),r=2*o.getVblen(e,t),"03"==e.substr(t,2)&&(n+=2,r-=2),i=0;for(var s=n;i<=r;){var u=o.getTLVblen(e,s);if((i+=u)<=r&&a.push(s),s+=u,i>=r)break}return a},pe.getNthChildIdx=function(e,t,n){return pe.getChildIdx(e,t)[n]},pe.getIdxbyList=function(e,t,n,r){var i,o,a=pe;return 0==n.length?void 0!==r&&e.substr(t,2)!==r?-1:t:(i=n.shift())>=(o=a.getChildIdx(e,t)).length?-1:a.getIdxbyList(e,o[i],n,r)},pe.getIdxbyListEx=function(e,t,n,r){var i,o,a=pe;if(0==n.length)return void 0!==r&&e.substr(t,2)!==r?-1:t;i=n.shift(),o=a.getChildIdx(e,t);for(var s=0,u=0;u<o.length;u++){var l=e.substr(o[u],2);if("number"==typeof i&&!a.isContextTag(l)&&s==i||"string"==typeof i&&a.isContextTag(l,i))return a.getIdxbyListEx(e,o[u],n,r);a.isContextTag(l)||s++}return-1},pe.getTLVbyList=function(e,t,n,r){var i=pe,o=i.getIdxbyList(e,t,n,r);return-1==o||o>=e.length?null:i.getTLV(e,o)},pe.getTLVbyListEx=function(e,t,n,r){var i=pe,o=i.getIdxbyListEx(e,t,n,r);return-1==o?null:i.getTLV(e,o)},pe.getVbyList=function(e,t,n,r,i){var o,a,s=pe;return-1==(o=s.getIdxbyList(e,t,n,r))||o>=e.length?null:(a=s.getV(e,o),!0===i&&(a=a.substr(2)),a)},pe.getVbyListEx=function(e,t,n,r,i){var o,a,s=pe;return-1==(o=s.getIdxbyListEx(e,t,n,r))?null:(a=s.getV(e,o),"03"==e.substr(o,2)&&!1!==i&&(a=a.substr(2)),a)},pe.getInt=function(e,t,n){null==n&&(n=-1);try{var r=e.substr(t,2);if("02"!=r&&"03"!=r)return n;var i=pe.getV(e,t);return"02"==r?parseInt(i,16):Ye(i)}catch(e){return n}},pe.getOID=function(e,t,n){null==n&&(n=null);try{return"06"!=e.substr(t,2)?n:Ge(pe.getV(e,t))}catch(e){return n}},pe.getOIDName=function(e,t,n){null==n&&(n=null);try{var r=pe.getOID(e,t,n);if(r==n)return n;var i=ue.asn1.x509.OID.oid2name(r);return""==i?r:i}catch(e){return n}},pe.getString=function(e,t,n){null==n&&(n=null);try{return Ee(pe.getV(e,t))}catch(e){return n}},pe.hextooidstr=function(e){var t=function(e,t){return e.length>=t?e:new Array(t-e.length+1).join("0")+e},n=[],r=e.substr(0,2),i=parseInt(r,16);n[0]=new String(Math.floor(i/40)),n[1]=new String(i%40);for(var o=e.substr(2),a=[],s=0;s<o.length/2;s++)a.push(parseInt(o.substr(2*s,2),16));var u=[],l="";for(s=0;s<a.length;s++)128&a[s]?l+=t((127&a[s]).toString(2),7):(l+=t((127&a[s]).toString(2),7),u.push(new String(parseInt(l,2))),l="");var c=n.join(".");return u.length>0&&(c=c+"."+u.join(".")),c},pe.dump=function(e,t,n,r){var i=pe,o=i.getV,a=i.dump,s=i.getChildIdx,u=e;e instanceof ue.asn1.ASN1Object&&(u=e.tohex());var l=function(e,t){return e.length<=2*t?e:e.substr(0,t)+"..(total "+e.length/2+"bytes).."+e.substr(e.length-t,t)};void 0===t&&(t={ommit_long_octet:32}),void 0===n&&(n=0),void 0===r&&(r="");var c,p=t.ommit_long_octet;if("01"==(c=u.substr(n,2)))return"00"==(h=o(u,n))?r+"BOOLEAN FALSE\n":r+"BOOLEAN TRUE\n";if("02"==c)return r+"INTEGER "+l(h=o(u,n),p)+"\n";if("03"==c){var h=o(u,n);if(i.isASN1HEX(h.substr(2))){var d=r+"BITSTRING, encapsulates\n";return d+=a(h.substr(2),t,0,r+" ")}return r+"BITSTRING "+l(h,p)+"\n"}if("04"==c){h=o(u,n);if(i.isASN1HEX(h)){d=r+"OCTETSTRING, encapsulates\n";return d+=a(h,t,0,r+" ")}return r+"OCTETSTRING "+l(h,p)+"\n"}if("05"==c)return r+"NULL\n";if("06"==c){var f=o(u,n),g=ue.asn1.ASN1Util.oidHexToInt(f),m=ue.asn1.x509.OID.oid2name(g),v=g.replace(/\./g," ");return""!=m?r+"ObjectIdentifier "+m+" ("+v+")\n":r+"ObjectIdentifier ("+v+")\n"}if("0a"==c)return r+"ENUMERATED "+parseInt(o(u,n))+"\n";if("0c"==c)return r+"UTF8String '"+xe(o(u,n))+"'\n";if("13"==c)return r+"PrintableString '"+xe(o(u,n))+"'\n";if("14"==c)return r+"TeletexString '"+xe(o(u,n))+"'\n";if("16"==c)return r+"IA5String '"+xe(o(u,n))+"'\n";if("17"==c)return r+"UTCTime "+xe(o(u,n))+"\n";if("18"==c)return r+"GeneralizedTime "+xe(o(u,n))+"\n";if("1a"==c)return r+"VisualString '"+xe(o(u,n))+"'\n";if("1e"==c)return r+"BMPString '"+Me(o(u,n))+"'\n";if("30"==c){if("3000"==u.substr(n,4))return r+"SEQUENCE {}\n";d=r+"SEQUENCE\n";var y=t;if((2==(x=s(u,n)).length||3==x.length)&&"06"==u.substr(x[0],2)&&"04"==u.substr(x[x.length-1],2)){m=i.oidname(o(u,x[0]));var b=JSON.parse(JSON.stringify(t));b.x509ExtName=m,y=b}for(var w=0;w<x.length;w++)d+=a(u,y,x[w],r+" ");return d}if("31"==c){d=r+"SET\n";var x=s(u,n);for(w=0;w<x.length;w++)d+=a(u,t,x[w],r+" ");return d}if(0!=(128&(c=parseInt(c,16)))){var S=31&c;if(0!=(32&c)){for(d=r+"["+S+"]\n",x=s(u,n),w=0;w<x.length;w++)d+=a(u,t,x[w],r+" ");return d}h=o(u,n);if(pe.isASN1HEX(h)){var d=r+"["+S+"]\n";return d+=a(h,t,0,r+" ")}return("68747470"==h.substr(0,8)||"subjectAltName"===t.x509ExtName&&2==S)&&(h=xe(h)),d=r+"["+S+"] "+h+"\n"}return r+"UNKNOWN("+c+") "+o(u,n)+"\n"},pe.parse=function(e){var t=pe,n=t.parse,r=t.isASN1HEX,i=t.getV,o=t.getTLV,a=t.getChildIdx,s=ue.asn1,u=s.ASN1Util.oidHexToInt,l=s.x509.OID.oid2name,c=xe,p=Me,h=Se,d={"0c":"utf8str",12:"numstr",13:"prnstr",14:"telstr",16:"ia5str",17:"utctime",18:"gentime","1a":"visstr","1e":"bmpstr",30:"seq",31:"set"},f=e.substr(0,2),g={},m=i(e,0);if("01"==f)return"0101ff"==e?{bool:!0}:{bool:!1};if("02"==f)return{int:{hex:m}};if("03"==f)try{if("00"!=m.substr(0,2))throw"not encap";var v=m.substr(2);if(!r(v))throw"not encap";return{bitstr:{obj:n(v)}}}catch(e){var y=null;return m.length<=10&&(y=Je(m)),null==y?{bitstr:{hex:m}}:{bitstr:{bin:y}}}else if("04"==f)try{if(!r(m))throw"not encap";return{octstr:{obj:n(m)}}}catch(e){return{octstr:{hex:m}}}else{if("05"==f)return{null:""};if("06"==f){var b=u(m),w=l(b);return""==w?{oid:b}:{oid:w}}if("0a"==f)return m.length>4?{enum:{hex:m}}:{enum:parseInt(m,16)};if("30"==f||"31"==f)return g[d[f]]=function(e){for(var t=[],r=a(e,0),i=0;i<r.length;i++){var s=r[i],u=o(e,s),l=n(u);t.push(l)}return t}(e),g;if("14"==f){var x=h(m);return g[d[f]]={str:x},g}if("1e"==f){x=p(m);return g[d[f]]={str:x},g}if(-1!=":0c:12:13:16:17:18:1a:".indexOf(f)){x=c(m);return g[d[f]]={str:x},g}if(f.match(/^8[0-9]$/))return null==(x=c(m))|""==x||null!=x.match(/[\x00-\x1F\x7F-\x9F]/)||null!=x.match(/[\u0000-\u001F\u0080–\u009F]/)?{tag:{tag:f,explicit:!1,hex:m}}:{tag:{tag:f,explicit:!1,str:x}};if(!f.match(/^a[0-9]$/)){var S=new ue.asn1.ASN1Object;return S.hV=m,{asn1:{tlv:f+S.getLengthHexFromValue()+m}}}try{if(!r(m))throw new Error("not encap");return{tag:{tag:f,explicit:!0,obj:n(m)}}}catch(e){return{tag:{tag:f,explicit:!0,hex:m}}}}},pe.isContextTag=function(e,t){var n,r;e=e.toLowerCase();try{n=parseInt(e,16)}catch(e){return-1}if(void 0===t)return 128==(192&n);try{return null!=t.match(/^\[[0-9]+\]$/)&&(!((r=parseInt(t.substr(1,t.length-1),10))>31)&&(128==(192&n)&&(31&n)==r))}catch(e){return!1}},pe.isASN1HEX=function(e){var t=pe;if(e.length%2==1)return!1;var n=t.getVblen(e,0),r=e.substr(0,2),i=t.getL(e,0);return e.length-r.length-i.length==2*n},pe.checkStrictDER=function(e,t,n,r,i){var o=pe;if(void 0===n){if("string"!=typeof e)throw new Error("not hex string");if(e=e.toLowerCase(),!ue.lang.String.isHex(e))throw new Error("not hex string");n=e.length,i=(r=e.length/2)<128?1:Math.ceil(r.toString(16))+1}if(o.getL(e,t).length>2*i)throw new Error("L of TLV too long: idx="+t);var a=o.getVblen(e,t);if(a>r)throw new Error("value of L too long than hex: idx="+t);var s=o.getTLV(e,t),u=s.length-2-o.getL(e,t).length;if(u!==2*a)throw new Error("V string length and L's value not the same:"+u+"/"+2*a);if(0===t&&e.length!=s.length)throw new Error("total length and TLV length unmatch:"+e.length+"!="+s.length);var l=e.substr(t,2);if("02"===l){var c=o.getVidx(e,t);if("00"==e.substr(c,2)&&e.charCodeAt(c+2)<56)throw new Error("not least zeros for DER INTEGER")}if(32&parseInt(l,16)){for(var p=o.getVblen(e,t),h=0,d=o.getChildIdx(e,t),f=0;f<d.length;f++){h+=o.getTLV(e,d[f]).length,o.checkStrictDER(e,d[f],n,r,i)}if(2*p!=h)throw new Error("sum of children's TLV length and L unmatch: "+2*p+"!="+h)}},pe.oidname=function(e){var t=ue.asn1;ue.lang.String.isHex(e)&&(e=t.ASN1Util.oidHexToInt(e));var n=t.x509.OID.oid2name(e);return""===n&&(n=e),n},void 0!==ue&&ue||(ue={}),void 0!==ue.asn1&&ue.asn1||(ue.asn1={}),void 0!==ue.asn1.x509&&ue.asn1.x509||(ue.asn1.x509={}),ue.asn1.x509.Certificate=function(e){ue.asn1.x509.Certificate.superclass.constructor.call(this);var t=ue.asn1,n=t.DERBitString,r=t.DERSequence,i=t.x509,o=i.TBSCertificate,a=i.AlgorithmIdentifier;this.params=void 0,this.setByParam=function(e){this.params=e},this.sign=function(){var e=this.params,t=e.sigalg;null!=e.sigalg.name&&(t=e.sigalg.name);var n=e.tbsobj.tohex(),r=new ue.crypto.Signature({alg:t});r.init(e.cakey),r.updateHex(n),e.sighex=r.sign()},this.getPEM=function(){return De(this.tohex(),"CERTIFICATE")},this.tohex=function(){var e=this.params;if(null!=e.tbsobj&&null!=e.tbsobj||(e.tbsobj=new o(e)),null==e.sighex&&null!=e.cakey&&this.sign(),null==e.sighex)throw new Error("sighex or cakey parameter not defined");var t=[];return t.push(e.tbsobj),t.push(new a({name:e.sigalg})),t.push(new n({hex:"00"+e.sighex})),new r({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&(this.params=e)},et(ue.asn1.x509.Certificate,ue.asn1.ASN1Object),ue.asn1.x509.TBSCertificate=function(e){ue.asn1.x509.TBSCertificate.superclass.constructor.call(this);var t=ue.asn1,n=t.x509,r=t.DERTaggedObject,i=t.DERInteger,o=t.DERSequence,a=n.AlgorithmIdentifier,s=n.Time,u=n.X500Name,l=n.Extensions,c=n.SubjectPublicKeyInfo;this.params=null,this.setByParam=function(e){this.params=e},this.tohex=function(){var e=[],t=this.params;if(null!=t.version||1!=t.version){var n=2;null!=t.version&&(n=t.version-1);var p=new r({obj:new i({int:n})});e.push(p)}return e.push(new i(t.serial)),e.push(new a({name:t.sigalg})),e.push(new u(t.issuer)),e.push(new o({array:[new s(t.notbefore),new s(t.notafter)]})),e.push(new u(t.subject)),e.push(new c(tt.getKey(t.sbjpubkey))),void 0!==t.ext&&t.ext.length>0&&e.push(new r({tag:"a3",obj:new l(t.ext)})),new ue.asn1.DERSequence({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},et(ue.asn1.x509.TBSCertificate,ue.asn1.ASN1Object),ue.asn1.x509.Extensions=function(e){ue.asn1.x509.Extensions.superclass.constructor.call(this);var t=ue.asn1,n=t.DERSequence,r=t.x509;this.aParam=[],this.setByParam=function(e){this.aParam=e},this.tohex=function(){for(var e=[],t=0;t<this.aParam.length;t++){var i=this.aParam[t],o=i.extname,a=null;if(null!=i.extn)a=new r.PrivateExtension(i);else if("subjectKeyIdentifier"==o)a=new r.SubjectKeyIdentifier(i);else if("keyUsage"==o)a=new r.KeyUsage(i);else if("subjectAltName"==o)a=new r.SubjectAltName(i);else if("issuerAltName"==o)a=new r.IssuerAltName(i);else if("basicConstraints"==o)a=new r.BasicConstraints(i);else if("nameConstraints"==o)a=new r.NameConstraints(i);else if("cRLDistributionPoints"==o)a=new r.CRLDistributionPoints(i);else if("certificatePolicies"==o)a=new r.CertificatePolicies(i);else if("policyMappings"==o)a=new r.PolicyMappings(i);else if("policyConstraints"==o)a=new r.PolicyConstraints(i);else if("inhibitAnyPolicy"==o)a=new r.InhibitAnyPolicy(i);else if("authorityKeyIdentifier"==o)a=new r.AuthorityKeyIdentifier(i);else if("extKeyUsage"==o)a=new r.ExtKeyUsage(i);else if("authorityInfoAccess"==o)a=new r.AuthorityInfoAccess(i);else if("cRLNumber"==o)a=new r.CRLNumber(i);else if("cRLReason"==o)a=new r.CRLReason(i);else if("ocspNonce"==o)a=new r.OCSPNonce(i);else if("ocspNoCheck"==o)a=new r.OCSPNoCheck(i);else if("adobeTimeStamp"==o)a=new r.AdobeTimeStamp(i);else{if("subjectDirectoryAttributes"!=o)throw new Error("extension not supported:"+JSON.stringify(i));a=new r.SubjectDirectoryAttributes(i)}null!=a&&e.push(a)}return new n({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(ue.asn1.x509.Extensions,ue.asn1.ASN1Object),ue.asn1.x509.Extension=function(e){ue.asn1.x509.Extension.superclass.constructor.call(this);var t=ue.asn1,n=t.DERObjectIdentifier,r=t.DEROctetString,i=(t.DERBitString,t.DERBoolean),o=t.DERSequence;this.tohex=function(){var e=new n({oid:this.oid}),t=new r({hex:this.getExtnValueHex()}),a=new Array;return a.push(e),this.critical&&a.push(new i),a.push(t),new o({array:a}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.critical=!1,void 0!==e&&void 0!==e.critical&&(this.critical=e.critical)},et(ue.asn1.x509.Extension,ue.asn1.ASN1Object),ue.asn1.x509.KeyUsage=function(e){ue.asn1.x509.KeyUsage.superclass.constructor.call(this,e);var t=Error,n={digitalSignature:0,nonRepudiation:1,keyEncipherment:2,dataEncipherment:3,keyAgreement:4,keyCertSign:5,cRLSign:6,encipherOnly:7,decipherOnly:8};this.getExtnValueHex=function(){var e=this.getBinValue();return this.asn1ExtnValue=new ue.asn1.DERBitString({bin:e}),this.asn1ExtnValue.tohex()},this.getBinValue=function(){var e=this.params;if("object"!=typeof e||"object"!=typeof e.names&&"string"!=typeof e.bin)throw new t("parameter not yet set");if(null!=e.names)return Ze(e.names,n);if(null!=e.bin)return e.bin;throw new t("parameter not set properly")},this.oid="2.5.29.15",void 0!==e&&(this.params=e)},et(ue.asn1.x509.KeyUsage,ue.asn1.x509.Extension),ue.asn1.x509.BasicConstraints=function(e){ue.asn1.x509.BasicConstraints.superclass.constructor.call(this,e);var t=ue.asn1,n=t.DERBoolean,r=t.DERInteger,i=t.DERSequence;this.getExtnValueHex=function(){var e=new Array;this.cA&&e.push(new n),this.pathLen>-1&&e.push(new r({int:this.pathLen}));var t=new i({array:e});return this.asn1ExtnValue=t,this.asn1ExtnValue.tohex()},this.oid="2.5.29.19",this.cA=!1,this.pathLen=-1,void 0!==e&&(void 0!==e.cA&&(this.cA=e.cA),void 0!==e.pathLen&&(this.pathLen=e.pathLen))},et(ue.asn1.x509.BasicConstraints,ue.asn1.x509.Extension),ue.asn1.x509.CRLDistributionPoints=function(e){ue.asn1.x509.CRLDistributionPoints.superclass.constructor.call(this,e);var t=ue.asn1,n=t.x509;this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.setByDPArray=function(e){for(var r=[],i=0;i<e.length;i++)if(e[i]instanceof ue.asn1.ASN1Object)r.push(e[i]);else{var o=new n.DistributionPoint(e[i]);r.push(o)}this.asn1ExtnValue=new t.DERSequence({array:r})},this.setByOneURI=function(e){var t=new n.DistributionPoint({fulluri:e});this.setByDPArray([t])},this.oid="2.5.29.31",void 0!==e&&(void 0!==e.array?this.setByDPArray(e.array):void 0!==e.uri&&this.setByOneURI(e.uri))},et(ue.asn1.x509.CRLDistributionPoints,ue.asn1.x509.Extension),ue.asn1.x509.DistributionPoint=function(e){ue.asn1.x509.DistributionPoint.superclass.constructor.call(this);var t=ue.asn1,n=t.x509.DistributionPointName;this.tohex=function(){var e=new t.DERSequence;if(null!=this.asn1DP){var n=new t.DERTaggedObject({explicit:!0,tag:"a0",obj:this.asn1DP});e.appendASN1Object(n)}return this.hTLV=e.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&(void 0!==e.dpobj?this.asn1DP=e.dpobj:void 0!==e.dpname?this.asn1DP=new n(e.dpname):void 0!==e.fulluri&&(this.asn1DP=new n({full:[{uri:e.fulluri}]})))},et(ue.asn1.x509.DistributionPoint,ue.asn1.ASN1Object),ue.asn1.x509.DistributionPointName=function(e){ue.asn1.x509.DistributionPointName.superclass.constructor.call(this);var t=ue.asn1,n=t.DERTaggedObject;if(this.tohex=function(){if("full"!=this.type)throw new Error("currently type shall be 'full': "+this.type);return this.asn1Obj=new n({explicit:!1,tag:this.tag,obj:this.asn1V}),this.hTLV=this.asn1Obj.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==e)if(t.x509.GeneralNames.prototype.isPrototypeOf(e))this.type="full",this.tag="a0",this.asn1V=e;else{if(void 0===e.full)throw new Error("This class supports GeneralNames only as argument");this.type="full",this.tag="a0",this.asn1V=new t.x509.GeneralNames(e.full)}},et(ue.asn1.x509.DistributionPointName,ue.asn1.ASN1Object),ue.asn1.x509.CertificatePolicies=function(e){ue.asn1.x509.CertificatePolicies.superclass.constructor.call(this,e);var t=ue.asn1,n=t.x509,r=t.DERSequence,i=n.PolicyInformation;this.params=null,this.getExtnValueHex=function(){for(var e=[],t=0;t<this.params.array.length;t++)e.push(new i(this.params.array[t]));var n=new r({array:e});return this.asn1ExtnValue=n,this.asn1ExtnValue.tohex()},this.oid="2.5.29.32",void 0!==e&&(this.params=e)},et(ue.asn1.x509.CertificatePolicies,ue.asn1.x509.Extension),ue.asn1.x509.PolicyInformation=function(e){ue.asn1.x509.PolicyInformation.superclass.constructor.call(this,e);var t=ue.asn1,n=t.DERSequence,r=t.DERObjectIdentifier,i=t.x509.PolicyQualifierInfo;this.params=null,this.tohex=function(){if(void 0===this.params.policyoid&&void 0===this.params.array)throw new Error("parameter oid and array missing");var e=[new r(this.params.policyoid)];if(void 0!==this.params.array){for(var t=[],o=0;o<this.params.array.length;o++)t.push(new i(this.params.array[o]));t.length>0&&e.push(new n({array:t}))}return new n({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&(this.params=e)},et(ue.asn1.x509.PolicyInformation,ue.asn1.ASN1Object),ue.asn1.x509.PolicyQualifierInfo=function(e){ue.asn1.x509.PolicyQualifierInfo.superclass.constructor.call(this,e);var t=ue.asn1,n=t.DERSequence,r=t.DERIA5String,i=t.DERObjectIdentifier,o=t.x509.UserNotice;this.params=null,this.tohex=function(){return void 0!==this.params.cps?new n({array:[new i({oid:"1.3.6.1.5.5.7.2.1"}),new r({str:this.params.cps})]}).tohex():null!=this.params.unotice?new n({array:[new i({oid:"1.3.6.1.5.5.7.2.2"}),new o(this.params.unotice)]}).tohex():void 0},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&(this.params=e)},et(ue.asn1.x509.PolicyQualifierInfo,ue.asn1.ASN1Object),ue.asn1.x509.UserNotice=function(e){ue.asn1.x509.UserNotice.superclass.constructor.call(this,e);var t=ue.asn1.DERSequence,n=(ue.asn1.DERInteger,ue.asn1.x509.DisplayText),r=ue.asn1.x509.NoticeReference;this.params=null,this.tohex=function(){var e=[];return void 0!==this.params.noticeref&&e.push(new r(this.params.noticeref)),void 0!==this.params.exptext&&e.push(new n(this.params.exptext)),new t({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&(this.params=e)},et(ue.asn1.x509.UserNotice,ue.asn1.ASN1Object),ue.asn1.x509.NoticeReference=function(e){ue.asn1.x509.NoticeReference.superclass.constructor.call(this,e);var t=ue.asn1.DERSequence,n=ue.asn1.DERInteger,r=ue.asn1.x509.DisplayText;this.params=null,this.tohex=function(){var e=[];if(void 0!==this.params.org&&e.push(new r(this.params.org)),void 0!==this.params.noticenum){for(var i=[],o=this.params.noticenum,a=0;a<o.length;a++)i.push(new n(o[a]));e.push(new t({array:i}))}if(0==e.length)throw new Error("parameter is empty");return new t({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&(this.params=e)},et(ue.asn1.x509.NoticeReference,ue.asn1.ASN1Object),ue.asn1.x509.DisplayText=function(e){ue.asn1.x509.DisplayText.superclass.constructor.call(this,e),this.hT="0c",void 0!==e&&("ia5"===e.type?this.hT="16":"vis"===e.type?this.hT="1a":"bmp"===e.type&&(this.hT="1e"))},et(ue.asn1.x509.DisplayText,ue.asn1.DERAbstractString),ue.asn1.x509.PolicyMappings=function(e){ue.asn1.x509.PolicyMappings.superclass.constructor.call(this,e);var t=ue.asn1,n=(t.x509,t.ASN1Util.newObject);this.params=null,this.getExtnValueHex=function(){for(var e=this.params,t=[],r=0;r<e.array.length;r++){var i=e.array[r];t.push({seq:[{oid:i[0]},{oid:i[1]}]})}return this.asn1ExtnValue=n({seq:t}),this.asn1ExtnValue.tohex()},this.oid="2.5.29.33",void 0!==e&&(this.params=e)},et(ue.asn1.x509.PolicyMappings,ue.asn1.x509.Extension),ue.asn1.x509.PolicyConstraints=function(e){ue.asn1.x509.PolicyConstraints.superclass.constructor.call(this,e);var t=ue.asn1,n=(t.x509,t.ASN1Util.newObject);this.params=null,this.getExtnValueHex=function(){var e=this.params,t=[];return null!=e.reqexp&&t.push({tag:{tagi:"80",obj:{int:e.reqexp}}}),null!=e.inhibit&&t.push({tag:{tagi:"81",obj:{int:e.inhibit}}}),this.asn1ExtnValue=n({seq:t}),this.asn1ExtnValue.tohex()},this.oid="2.5.29.36",void 0!==e&&(this.params=e)},et(ue.asn1.x509.PolicyConstraints,ue.asn1.x509.Extension),ue.asn1.x509.InhibitAnyPolicy=function(e){ue.asn1.x509.InhibitAnyPolicy.superclass.constructor.call(this,e);var t=ue.asn1,n=(t.x509,t.ASN1Util.newObject);this.params=null,this.getExtnValueHex=function(){return this.asn1ExtnValue=n({int:this.params.skip}),this.asn1ExtnValue.tohex()},this.oid="2.5.29.54",void 0!==e&&(this.params=e)},et(ue.asn1.x509.InhibitAnyPolicy,ue.asn1.x509.Extension),ue.asn1.x509.NameConstraints=function(e){ue.asn1.x509.NameConstraints.superclass.constructor.call(this,e);var t=ue.asn1,n=t.x509,r=t.ASN1Util.newObject,i=n.GeneralSubtree;this.params=null,this.getExtnValueHex=function(){var e=this.params,t=[];if(null!=e.permit&&null!=e.permit.length){for(var n=[],o=0;o<e.permit.length;o++)n.push(new i(e.permit[o]));t.push({tag:{tagi:"a0",obj:{seq:n}}})}if(null!=e.exclude&&null!=e.exclude.length){var a=[];for(o=0;o<e.exclude.length;o++)a.push(new i(e.exclude[o]));t.push({tag:{tagi:"a1",obj:{seq:a}}})}return this.asn1ExtnValue=r({seq:t}),this.asn1ExtnValue.tohex()},this.oid="2.5.29.30",void 0!==e&&(this.params=e)},et(ue.asn1.x509.NameConstraints,ue.asn1.x509.Extension),ue.asn1.x509.GeneralSubtree=function(e){ue.asn1.x509.GeneralSubtree.superclass.constructor.call(this);var t=ue.asn1,n=t.x509.GeneralName,r=t.ASN1Util.newObject;this.params=null,this.setByParam=function(e){this.params=e},this.tohex=function(){var e=this.params,t=[new n(e)];return null!=e.min&&t.push({tag:{tagi:"80",obj:{int:e.min}}}),null!=e.max&&t.push({tag:{tagi:"81",obj:{int:e.max}}}),r({seq:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},et(ue.asn1.x509.GeneralSubtree,ue.asn1.ASN1Object),ue.asn1.x509.ExtKeyUsage=function(e){ue.asn1.x509.ExtKeyUsage.superclass.constructor.call(this,e);var t=ue.asn1;this.setPurposeArray=function(e){this.asn1ExtnValue=new t.DERSequence;for(var n=0;n<e.length;n++){var r=new t.DERObjectIdentifier(e[n]);this.asn1ExtnValue.appendASN1Object(r)}},this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.oid="2.5.29.37",void 0!==e&&void 0!==e.array&&this.setPurposeArray(e.array)},et(ue.asn1.x509.ExtKeyUsage,ue.asn1.x509.Extension),ue.asn1.x509.AuthorityKeyIdentifier=function(e){ue.asn1.x509.AuthorityKeyIdentifier.superclass.constructor.call(this,e);var t=ue,n=t.asn1,r=n.DERTaggedObject,i=n.x509.GeneralNames;t.crypto.Util.isKey;this.asn1KID=null,this.asn1CertIssuer=null,this.asn1CertSN=null,this.getExtnValueHex=function(){var e=new Array;this.asn1KID&&e.push(new r({explicit:!1,tag:"80",obj:this.asn1KID})),this.asn1CertIssuer&&e.push(new r({explicit:!1,tag:"a1",obj:new i([{dn:this.asn1CertIssuer}])})),this.asn1CertSN&&e.push(new r({explicit:!1,tag:"82",obj:this.asn1CertSN}));var t=new n.DERSequence({array:e});return this.asn1ExtnValue=t,this.asn1ExtnValue.tohex()},this.setKIDByParam=function(e){if(void 0!==e.str||void 0!==e.hex)this.asn1KID=new ue.asn1.DEROctetString(e);else if("object"==typeof e&&ue.crypto.Util.isKey(e)||"string"==typeof e&&-1!=e.indexOf("BEGIN ")){var t=e;"string"==typeof e&&(t=tt.getKey(e));var n=tt.getKeyID(t);this.asn1KID=new ue.asn1.DEROctetString({hex:n})}},this.setCertIssuerByParam=function(e){void 0!==e.str||void 0!==e.ldapstr||void 0!==e.hex||void 0!==e.certsubject||void 0!==e.certissuer?this.asn1CertIssuer=new ue.asn1.x509.X500Name(e):"string"==typeof e&&-1!=e.indexOf("BEGIN ")&&-1!=e.indexOf("CERTIFICATE")&&(this.asn1CertIssuer=new ue.asn1.x509.X500Name({certissuer:e}))},this.setCertSNByParam=function(e){if(void 0!==e.str||void 0!==e.bigint||void 0!==e.hex)this.asn1CertSN=new ue.asn1.DERInteger(e);else if("string"==typeof e&&-1!=e.indexOf("BEGIN ")&&e.indexOf("CERTIFICATE")){var t=new ot;t.readCertPEM(e);var n=t.getSerialNumberHex();this.asn1CertSN=new ue.asn1.DERInteger({hex:n})}},this.oid="2.5.29.35",void 0!==e&&(void 0!==e.kid&&this.setKIDByParam(e.kid),void 0!==e.issuer&&this.setCertIssuerByParam(e.issuer),void 0!==e.sn&&this.setCertSNByParam(e.sn),void 0!==e.issuersn&&"string"==typeof e.issuersn&&-1!=e.issuersn.indexOf("BEGIN ")&&e.issuersn.indexOf("CERTIFICATE")&&(this.setCertSNByParam(e.issuersn),this.setCertIssuerByParam(e.issuersn)))},et(ue.asn1.x509.AuthorityKeyIdentifier,ue.asn1.x509.Extension),ue.asn1.x509.SubjectKeyIdentifier=function(e){ue.asn1.x509.SubjectKeyIdentifier.superclass.constructor.call(this,e);var t=ue.asn1.DEROctetString;this.asn1KID=null,this.getExtnValueHex=function(){return this.asn1ExtnValue=this.asn1KID,this.asn1ExtnValue.tohex()},this.setKIDByParam=function(e){if(void 0!==e.str||void 0!==e.hex)this.asn1KID=new t(e);else if("object"==typeof e&&ue.crypto.Util.isKey(e)||"string"==typeof e&&-1!=e.indexOf("BEGIN")){var n=e;"string"==typeof e&&(n=tt.getKey(e));var r=tt.getKeyID(n);this.asn1KID=new ue.asn1.DEROctetString({hex:r})}},this.oid="2.5.29.14",void 0!==e&&void 0!==e.kid&&this.setKIDByParam(e.kid)},et(ue.asn1.x509.SubjectKeyIdentifier,ue.asn1.x509.Extension),ue.asn1.x509.AuthorityInfoAccess=function(e){ue.asn1.x509.AuthorityInfoAccess.superclass.constructor.call(this,e),this.setAccessDescriptionArray=function(e){for(var t=new Array,n=ue.asn1,r=n.DERSequence,i=n.DERObjectIdentifier,o=n.x509.GeneralName,a=0;a<e.length;a++){var s,u=e[a];if(void 0!==u.ocsp)s=new r({array:[new i({oid:"1.3.6.1.5.5.7.48.1"}),new o({uri:u.ocsp})]});else{if(void 0===u.caissuer)throw new Error("unknown AccessMethod parameter: "+JSON.stringify(u));s=new r({array:[new i({oid:"1.3.6.1.5.5.7.48.2"}),new o({uri:u.caissuer})]})}t.push(s)}this.asn1ExtnValue=new r({array:t})},this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.oid="1.3.6.1.5.5.7.1.1",void 0!==e&&void 0!==e.array&&this.setAccessDescriptionArray(e.array)},et(ue.asn1.x509.AuthorityInfoAccess,ue.asn1.x509.Extension),ue.asn1.x509.SubjectAltName=function(e){ue.asn1.x509.SubjectAltName.superclass.constructor.call(this,e),this.setNameArray=function(e){this.asn1ExtnValue=new ue.asn1.x509.GeneralNames(e)},this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.oid="2.5.29.17",void 0!==e&&void 0!==e.array&&this.setNameArray(e.array)},et(ue.asn1.x509.SubjectAltName,ue.asn1.x509.Extension),ue.asn1.x509.IssuerAltName=function(e){ue.asn1.x509.IssuerAltName.superclass.constructor.call(this,e),this.setNameArray=function(e){this.asn1ExtnValue=new ue.asn1.x509.GeneralNames(e)},this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.oid="2.5.29.18",void 0!==e&&void 0!==e.array&&this.setNameArray(e.array)},et(ue.asn1.x509.IssuerAltName,ue.asn1.x509.Extension),ue.asn1.x509.SubjectDirectoryAttributes=function(e){ue.asn1.x509.SubjectDirectoryAttributes.superclass.constructor.call(this,e);var t=ue.asn1,n=t.DERSequence,r=t.ASN1Util.newObject,i=t.x509.OID.name2oid;this.params=null,this.getExtnValueHex=function(){for(var e=[],t=0;t<this.params.array.length;t++){var o=this.params.array[t];if(null==o.attr||null==o.array){var a={seq:[{oid:"1.2.3.4"},{set:[{utf8str:"DE"}]}]};if("dateOfBirth"==o.attr)a.seq[0].oid=i(o.attr),a.seq[1].set[0]={gentime:o.str};else if("placeOfBirth"==o.attr)a.seq[0].oid=i(o.attr),a.seq[1].set[0]={utf8str:o.str};else if("gender"==o.attr)a.seq[0].oid=i(o.attr),a.seq[1].set[0]={prnstr:o.str};else if("countryOfCitizenship"==o.attr)a.seq[0].oid=i(o.attr),a.seq[1].set[0]={prnstr:o.str};else{if("countryOfResidence"!=o.attr)throw new Error("unsupported attribute: "+o.attr);a.seq[0].oid=i(o.attr),a.seq[1].set[0]={prnstr:o.str}}e.push(new r(a))}else{var s={seq:[{oid:o.attr},{set:o.array}]};e.push(r(s))}}var u=new n({array:e});return this.asn1ExtnValue=u,this.asn1ExtnValue.tohex()},this.oid="2.5.29.9",void 0!==e&&(this.params=e)},et(ue.asn1.x509.SubjectDirectoryAttributes,ue.asn1.x509.Extension),ue.asn1.x509.PrivateExtension=function(e){ue.asn1.x509.PrivateExtension.superclass.constructor.call(this,e);var t=ue,n=t.lang.String.isHex,r=t.asn1,i=r.x509.OID.name2oid,o=r.ASN1Util.newObject;this.params=null,this.setByParam=function(e){this.oid=i(e.extname),this.params=e},this.getExtnValueHex=function(){if(null==this.params.extname||null==this.params.extn)throw new Error("extname or extnhex not specified");var e=this.params.extn;if("string"==typeof e&&n(e))return e;if("object"==typeof e)try{return o(e).tohex()}catch(e){}throw new Error("unsupported extn value")},null!=e&&this.setByParam(e)},et(ue.asn1.x509.PrivateExtension,ue.asn1.x509.Extension),ue.asn1.x509.CRL=function(e){ue.asn1.x509.CRL.superclass.constructor.call(this);var t=ue.asn1,n=t.DERSequence,r=t.DERBitString,i=t.x509,o=i.AlgorithmIdentifier,a=i.TBSCertList;this.params=void 0,this.setByParam=function(e){this.params=e},this.sign=function(){var e=new a(this.params).tohex(),t=new ue.crypto.Signature({alg:this.params.sigalg});t.init(this.params.cakey),t.updateHex(e);var n=t.sign();this.params.sighex=n},this.getPEM=function(){return De(this.tohex(),"X509 CRL")},this.tohex=function(){var e=this.params;if(null==e.tbsobj&&(e.tbsobj=new a(e)),null==e.sighex&&null!=e.cakey&&this.sign(),null==e.sighex)throw new Error("sighex or cakey parameter not defined");var t=[];return t.push(e.tbsobj),t.push(new o({name:e.sigalg})),t.push(new r({hex:"00"+e.sighex})),new n({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&(this.params=e)},et(ue.asn1.x509.CRL,ue.asn1.ASN1Object),ue.asn1.x509.TBSCertList=function(e){ue.asn1.x509.TBSCertList.superclass.constructor.call(this);var t=ue.asn1,n=t.DERInteger,r=t.DERSequence,i=t.DERTaggedObject,o=(t.DERObjectIdentifier,t.x509),a=o.AlgorithmIdentifier,s=o.Time,u=o.Extensions,l=o.X500Name;this.params=null,this.setByParam=function(e){this.params=e},this.getRevCertSequence=function(){for(var e=[],t=this.params.revcert,i=0;i<t.length;i++){var o=[new n(t[i].sn),new s(t[i].date)];null!=t[i].ext&&o.push(new u(t[i].ext)),e.push(new r({array:o}))}return new r({array:e})},this.tohex=function(){var e=[],t=this.params;if(null!=t.version){var o=t.version-1,c=new n({int:o});e.push(c)}if(e.push(new a({name:t.sigalg})),e.push(new l(t.issuer)),e.push(new s(t.thisupdate)),null!=t.nextupdate&&e.push(new s(t.nextupdate)),null!=t.revcert&&e.push(this.getRevCertSequence()),null!=t.ext){var p=new u(t.ext);e.push(new i({tag:"a0",explicit:!0,obj:p}))}return new r({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},et(ue.asn1.x509.TBSCertList,ue.asn1.ASN1Object),ue.asn1.x509.CRLEntry=function(e){ue.asn1.x509.CRLEntry.superclass.constructor.call(this);var t=ue.asn1;this.setCertSerial=function(e){this.sn=new t.DERInteger(e)},this.setRevocationDate=function(e){this.time=new t.x509.Time(e)},this.tohex=function(){var e=new t.DERSequence({array:[this.sn,this.time]});return this.TLV=e.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&(void 0!==e.time&&this.setRevocationDate(e.time),void 0!==e.sn&&this.setCertSerial(e.sn))},et(ue.asn1.x509.CRLEntry,ue.asn1.ASN1Object),ue.asn1.x509.CRLNumber=function(e){ue.asn1.x509.CRLNumber.superclass.constructor.call(this,e),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new ue.asn1.DERInteger(this.params.num),this.asn1ExtnValue.tohex()},this.oid="2.5.29.20",null!=e&&(this.params=e)},et(ue.asn1.x509.CRLNumber,ue.asn1.x509.Extension),ue.asn1.x509.CRLReason=function(e){ue.asn1.x509.CRLReason.superclass.constructor.call(this,e),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new ue.asn1.DEREnumerated(this.params.code),this.asn1ExtnValue.tohex()},this.oid="2.5.29.21",null!=e&&(this.params=e)},et(ue.asn1.x509.CRLReason,ue.asn1.x509.Extension),ue.asn1.x509.OCSPNonce=function(e){ue.asn1.x509.OCSPNonce.superclass.constructor.call(this,e),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new ue.asn1.DEROctetString(this.params),this.asn1ExtnValue.tohex()},this.oid="1.3.6.1.5.5.7.48.1.2",null!=e&&(this.params=e)},et(ue.asn1.x509.OCSPNonce,ue.asn1.x509.Extension),ue.asn1.x509.OCSPNoCheck=function(e){ue.asn1.x509.OCSPNoCheck.superclass.constructor.call(this,e),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new ue.asn1.DERNull,this.asn1ExtnValue.tohex()},this.oid="1.3.6.1.5.5.7.48.1.5",null!=e&&(this.params=e)},et(ue.asn1.x509.OCSPNoCheck,ue.asn1.x509.Extension),ue.asn1.x509.AdobeTimeStamp=function(e){ue.asn1.x509.AdobeTimeStamp.superclass.constructor.call(this,e);var t=ue.asn1,n=t.DERInteger,r=t.DERBoolean,i=t.DERSequence,o=t.x509.GeneralName;this.params=null,this.getExtnValueHex=function(){var e=this.params,t=[new n(1)];return t.push(new o({uri:e.uri})),null!=e.reqauth&&t.push(new r(e.reqauth)),this.asn1ExtnValue=new i({array:t}),this.asn1ExtnValue.tohex()},this.oid="1.2.840.113583.1.1.9.1",void 0!==e&&this.setByParam(e)},et(ue.asn1.x509.AdobeTimeStamp,ue.asn1.x509.Extension),ue.asn1.x509.X500Name=function(e){ue.asn1.x509.X500Name.superclass.constructor.call(this),this.asn1Array=[],this.paramArray=[],this.sRule="utf8";var t=ue.asn1,n=t.x509,r=n.RDN;this.setByString=function(e,t){void 0!==t&&(this.sRule=t);var n=e.split("/");n.shift();for(var i=[],o=0;o<n.length;o++)if(n[o].match(/^[^=]+=.+$/))i.push(n[o]);else{var a=i.length-1;i[a]=i[a]+"/"+n[o]}for(o=0;o<i.length;o++)this.asn1Array.push(new r({str:i[o],rule:this.sRule}))},this.setByLdapString=function(e,t){void 0!==t&&(this.sRule=t);var r=n.X500Name.ldapToCompat(e);this.setByString(r,t)},this.setByObject=function(e,t){for(var n in void 0!==t&&(this.sRule=t),e)if(e.hasOwnProperty(n)){var i=new r({str:n+"="+e[n],rule:this.sRule});this.asn1Array?this.asn1Array.push(i):this.asn1Array=[i]}},this.setByParam=function(e){var t;(void 0!==e.rule&&(this.sRule=e.rule),void 0!==e.array)?this.paramArray=e.array:void 0!==e.str?this.setByString(e.str):void 0!==e.ldapstr?this.setByLdapString(e.ldapstr):void 0!==e.hex?this.hTLV=e.hex:void 0!==e.certissuer?((t=new ot).readCertPEM(e.certissuer),this.hTLV=t.getIssuerHex()):void 0!==e.certsubject?((t=new ot).readCertPEM(e.certsubject),this.hTLV=t.getSubjectHex()):"object"==typeof e&&void 0===e.certsubject&&void 0===e.certissuer&&this.setByObject(e)},this.tohex=function(){if("string"==typeof this.hTLV)return this.hTLV;if(0==this.asn1Array.length&&this.paramArray.length>0)for(var e=0;e<this.paramArray.length;e++){var n={array:this.paramArray[e]};"utf8"!=this.sRule&&(n.rule=this.sRule);var i=new r(n);this.asn1Array.push(i)}var o=new t.DERSequence({array:this.asn1Array});return this.hTLV=o.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},et(ue.asn1.x509.X500Name,ue.asn1.ASN1Object),ue.asn1.x509.X500Name.compatToLDAP=function(e){if("/"!==e.substr(0,1))throw"malformed input";var t=(e=e.substr(1)).split("/");return t.reverse(),(t=t.map((function(e){return e.replace(/,/,"\\,")}))).join(",")},ue.asn1.x509.X500Name.onelineToLDAP=function(e){return ue.asn1.x509.X500Name.compatToLDAP(e)},ue.asn1.x509.X500Name.ldapToCompat=function(e){for(var t=e.split(","),n=!1,r=[],i=0;t.length>0;i++){var o=t.shift();if(!0===n){var a=(r.pop()+","+o).replace(/\\,/g,",");r.push(a),n=!1}else r.push(o);"\\"===o.substr(-1,1)&&(n=!0)}return(r=r.map((function(e){return e.replace("/","\\/")}))).reverse(),"/"+r.join("/")},ue.asn1.x509.X500Name.ldapToOneline=function(e){return ue.asn1.x509.X500Name.ldapToCompat(e)},ue.asn1.x509.RDN=function(e){ue.asn1.x509.RDN.superclass.constructor.call(this),this.asn1Array=[],this.paramArray=[],this.sRule="utf8";var t=ue.asn1.x509.AttributeTypeAndValue;this.setByParam=function(e){void 0!==e.rule&&(this.sRule=e.rule),void 0!==e.str&&this.addByMultiValuedString(e.str),void 0!==e.array&&(this.paramArray=e.array)},this.addByString=function(e){this.asn1Array.push(new ue.asn1.x509.AttributeTypeAndValue({str:e,rule:this.sRule}))},this.addByMultiValuedString=function(e){for(var t=ue.asn1.x509.RDN.parseString(e),n=0;n<t.length;n++)this.addByString(t[n])},this.tohex=function(){if(0==this.asn1Array.length&&this.paramArray.length>0)for(var e=0;e<this.paramArray.length;e++){var n=this.paramArray[e];void 0!==n.rule&&"utf8"!=this.sRule&&(n.rule=this.sRule);var r=new t(n);this.asn1Array.push(r)}var i=new ue.asn1.DERSet({array:this.asn1Array});return this.TLV=i.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},et(ue.asn1.x509.RDN,ue.asn1.ASN1Object),ue.asn1.x509.RDN.parseString=function(e){for(var t=e.split(/\+/),n=!1,r=[],i=0;t.length>0;i++){var o=t.shift();if(!0===n){var a=(r.pop()+"+"+o).replace(/\\\+/g,"+");r.push(a),n=!1}else r.push(o);"\\"===o.substr(-1,1)&&(n=!0)}var s=!1,u=[];for(i=0;r.length>0;i++){o=r.shift();if(!0===s){var l=u.pop();if(o.match(/"$/)){a=(l+"+"+o).replace(/^([^=]+)="(.*)"$/,"$1=$2");u.push(a),s=!1}else u.push(l+"+"+o)}else u.push(o);o.match(/^[^=]+="/)&&(s=!0)}return u},ue.asn1.x509.AttributeTypeAndValue=function(e){ue.asn1.x509.AttributeTypeAndValue.superclass.constructor.call(this),this.sRule="utf8",this.sType=null,this.sValue=null,this.dsType=null;var t=ue,n=t.asn1,r=n.DERSequence,i=n.DERUTF8String,o=n.DERPrintableString,a=n.DERTeletexString,s=n.DERIA5String,u=n.DERVisibleString,l=n.DERBMPString,c=t.lang.String.isMail,p=t.lang.String.isPrintable;this.setByParam=function(e){if(void 0!==e.rule&&(this.sRule=e.rule),void 0!==e.ds&&(this.dsType=e.ds),void 0===e.value&&void 0!==e.str){var t=e.str.match(/^([^=]+)=(.+)$/);if(!t)throw new Error("malformed attrTypeAndValueStr: "+attrTypeAndValueStr);this.sType=t[1],this.sValue=t[2]}else this.sType=e.type,this.sValue=e.value},this.setByString=function(e,t){void 0!==t&&(this.sRule=t);var n=e.match(/^([^=]+)=(.+)$/);if(!n)throw new Error("malformed attrTypeAndValueStr: "+attrTypeAndValueStr);this.setByAttrTypeAndValueStr(n[1],n[2])},this._getDsType=function(){var e=this.sType,t=this.sValue,n=this.sRule;return"prn"===n?"CN"==e&&c(t)?"ia5":p(t)?"prn":"utf8":"utf8"===n?"CN"==e&&c(t)?"ia5":"C"==e?"prn":"utf8":"utf8"},this.setByAttrTypeAndValueStr=function(e,t,n){void 0!==n&&(this.sRule=n),this.sType=e,this.sValue=t},this.getValueObj=function(e,t){if("utf8"==e)return new i({str:t});if("prn"==e)return new o({str:t});if("tel"==e)return new a({str:t});if("ia5"==e)return new s({str:t});if("vis"==e)return new u({str:t});if("bmp"==e)return new l({str:t});throw new Error("unsupported directory string type: type="+e+" value="+t)},this.tohex=function(){null==this.dsType&&(this.dsType=this._getDsType());var e=ue.asn1.x509.OID.atype2obj(this.sType),t=this.getValueObj(this.dsType,this.sValue),n=new r({array:[e,t]});return this.TLV=n.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},et(ue.asn1.x509.AttributeTypeAndValue,ue.asn1.ASN1Object),ue.asn1.x509.SubjectPublicKeyInfo=function(e){ue.asn1.x509.SubjectPublicKeyInfo.superclass.constructor.call(this);var t=ue,n=t.asn1,r=n.DERInteger,i=n.DERBitString,o=n.DERObjectIdentifier,a=n.DERSequence,s=n.ASN1Util.newObject,u=n.x509.AlgorithmIdentifier,l=t.crypto;l.ECDSA,l.DSA;this.getASN1Object=function(){if(null==this.asn1AlgId||null==this.asn1SubjPKey)throw"algId and/or subjPubKey not set";return new a({array:[this.asn1AlgId,this.asn1SubjPKey]})},this.tohex=function(){var e=this.getASN1Object();return this.hTLV=e.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},this.setPubKey=function(e){try{if(e instanceof ne){var t=s({seq:[{int:{bigint:e.n}},{int:{int:e.e}}]}).tohex();this.asn1AlgId=new u({name:"rsaEncryption"}),this.asn1SubjPKey=new i({hex:"00"+t})}}catch(e){}try{if(e instanceof ue.crypto.ECDSA){var n=new o({name:e.curveName});this.asn1AlgId=new u({name:"ecPublicKey",asn1params:n}),this.asn1SubjPKey=new i({hex:"00"+e.pubKeyHex})}}catch(e){}try{if(e instanceof ue.crypto.DSA){n=new s({seq:[{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.g}}]});this.asn1AlgId=new u({name:"dsa",asn1params:n});var a=new r({bigint:e.y});this.asn1SubjPKey=new i({hex:"00"+a.tohex()})}}catch(e){}},void 0!==e&&this.setPubKey(e)},et(ue.asn1.x509.SubjectPublicKeyInfo,ue.asn1.ASN1Object),ue.asn1.x509.Time=function(e){ue.asn1.x509.Time.superclass.constructor.call(this);var t=ue.asn1,n=t.DERUTCTime,r=t.DERGeneralizedTime;this.params=null,this.type=null,this.setTimeParams=function(e){this.timeParams=e},this.setByParam=function(e){this.params=e},this.getType=function(e){return e.match(/^[0-9]{12}Z$/)?"utc":e.match(/^[0-9]{14}Z$/)?"gen":e.match(/^[0-9]{12}\.[0-9]+Z$/)?"utc":e.match(/^[0-9]{14}\.[0-9]+Z$/)?"gen":null},this.tohex=function(){var e=this.params,t=null;if("string"==typeof e&&(e={str:e}),null==e||!e.str||null!=e.type&&null!=e.type||(e.type=this.getType(e.str)),null!=e&&e.str?("utc"==e.type&&(t=new n(e.str)),"gen"==e.type&&(t=new r(e.str))):t="gen"==this.type?new r:new n,null==t)throw new Error("wrong setting for Time");return this.TLV=t.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},ue.asn1.x509.Time_bak=function(e){ue.asn1.x509.Time_bak.superclass.constructor.call(this);var t=ue.asn1,n=t.DERUTCTime,r=t.DERGeneralizedTime;this.setTimeParams=function(e){this.timeParams=e},this.tohex=function(){var e=null;return e=null!=this.timeParams?"utc"==this.type?new n(this.timeParams):new r(this.timeParams):"utc"==this.type?new n:new r,this.TLV=e.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},this.type="utc",void 0!==e&&(void 0!==e.type?this.type=e.type:void 0!==e.str&&(e.str.match(/^[0-9]{12}Z$/)&&(this.type="utc"),e.str.match(/^[0-9]{14}Z$/)&&(this.type="gen")),this.timeParams=e)},et(ue.asn1.x509.Time,ue.asn1.ASN1Object),ue.asn1.x509.AlgorithmIdentifier=function(e){ue.asn1.x509.AlgorithmIdentifier.superclass.constructor.call(this),this.nameAlg=null,this.asn1Alg=null,this.asn1Params=null,this.paramEmpty=!1;var t=ue.asn1,n=t.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV;if(this.tohex=function(){if(null===this.nameAlg&&null===this.asn1Alg)throw new Error("algorithm not specified");if(null!==this.nameAlg){var e=null;for(var r in n)r===this.nameAlg&&(e=n[r]);if(null!==e)return this.hTLV=e,this.hTLV}null!==this.nameAlg&&null===this.asn1Alg&&(this.asn1Alg=t.x509.OID.name2obj(this.nameAlg));var i=[this.asn1Alg];null!==this.asn1Params&&i.push(this.asn1Params);var o=new t.DERSequence({array:i});return this.hTLV=o.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&(void 0!==e.name&&(this.nameAlg=e.name),void 0!==e.asn1params&&(this.asn1Params=e.asn1params),void 0!==e.paramempty&&(this.paramEmpty=e.paramempty)),null===this.asn1Params&&!1===this.paramEmpty&&null!==this.nameAlg){void 0!==this.nameAlg.name&&(this.nameAlg=this.nameAlg.name);var r=this.nameAlg.toLowerCase();"withdsa"!==r.substr(-7,7)&&"withecdsa"!==r.substr(-9,9)&&(this.asn1Params=new t.DERNull)}},et(ue.asn1.x509.AlgorithmIdentifier,ue.asn1.ASN1Object),ue.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV={SHAwithRSAandMGF1:"300d06092a864886f70d01010a3000",SHA256withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040201a11a301806092a864886f70d010108300b0609608648016503040201a203020120",SHA384withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040202a11a301806092a864886f70d010108300b0609608648016503040202a203020130",SHA512withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040203a11a301806092a864886f70d010108300b0609608648016503040203a203020140"},ue.asn1.x509.GeneralName=function(e){ue.asn1.x509.GeneralName.superclass.constructor.call(this);var t=ue.asn1,n=t.x509,r=n.X500Name,i=n.OtherName,o=t.DERIA5String,a=(t.DERPrintableString,t.DEROctetString),s=t.DERTaggedObject,u=t.ASN1Object,l=Error;this.params=null,this.setByParam=function(e){this.params=e},this.tohex=function(){var e,t,n=this.params,c=!1;if(void 0!==n.other)e="a0",t=new i(n.other);else if(void 0!==n.rfc822)e="81",t=new o({str:n.rfc822});else if(void 0!==n.dns)e="82",t=new o({str:n.dns});else if(void 0!==n.dn)e="a4",c=!0,t="string"==typeof n.dn?new r({str:n.dn}):n.dn instanceof ue.asn1.x509.X500Name?n.dn:new r(n.dn);else if(void 0!==n.ldapdn)e="a4",c=!0,t=new r({ldapstr:n.ldapdn});else if(void 0!==n.certissuer||void 0!==n.certsubj){var p,h;e="a4",c=!0;var d=null;if(void 0!==n.certsubj?(p=!1,h=n.certsubj):(p=!0,h=n.certissuer),h.match(/^[0-9A-Fa-f]+$/),-1!=h.indexOf("-----BEGIN ")&&(d=Te(h)),null==d)throw new Error("certsubj/certissuer not cert");var f,g=new ot;g.hex=d,f=p?g.getIssuerHex():g.getSubjectHex(),(t=new u).hTLV=f}else if(void 0!==n.uri)e="86",t=new o({str:n.uri});else{if(void 0===n.ip)throw new l("improper params");var m;e="87";var v=n.ip;try{if(v.match(/^[0-9a-f]+$/)){var y=v.length;if(8!=y&&16!=y&&32!=y&&64!=y)throw"err";m=v}else m=Be(v)}catch(e){throw new l("malformed IP address: "+n.ip+":"+e.message)}t=new a({hex:m})}return new s({tag:e,explicit:c,obj:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},et(ue.asn1.x509.GeneralName,ue.asn1.ASN1Object),ue.asn1.x509.GeneralNames=function(e){ue.asn1.x509.GeneralNames.superclass.constructor.call(this);var t=ue.asn1;this.setByParamArray=function(e){for(var n=0;n<e.length;n++){var r=new t.x509.GeneralName(e[n]);this.asn1Array.push(r)}},this.tohex=function(){return new t.DERSequence({array:this.asn1Array}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.asn1Array=new Array,void 0!==e&&this.setByParamArray(e)},et(ue.asn1.x509.GeneralNames,ue.asn1.ASN1Object),ue.asn1.x509.OtherName=function(e){ue.asn1.x509.OtherName.superclass.constructor.call(this);var t=ue.asn1,n=t.DERObjectIdentifier,r=t.DERSequence,i=t.ASN1Util.newObject;this.params=null,this.setByParam=function(e){this.params=e},this.tohex=function(){var e=this.params;if(null==e.oid||null==e.value)throw new Error("oid or value not specified");var t=new n({oid:e.oid}),o=i({tag:{tag:"a0",explicit:!0,obj:e.value}});return new r({array:[t,o]}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},et(ue.asn1.x509.OtherName,ue.asn1.ASN1Object),ue.asn1.x509.OID=new function(){var e=ue.asn1.DERObjectIdentifier;this.name2oidList={sha1:"1.3.14.3.2.26",sha256:"2.16.840.1.101.3.4.2.1",sha384:"2.16.840.1.101.3.4.2.2",sha512:"2.16.840.1.101.3.4.2.3",sha224:"2.16.840.1.101.3.4.2.4",md5:"1.2.840.113549.2.5",md2:"1.3.14.7.2.2.1",ripemd160:"1.3.36.3.2.1",MD2withRSA:"1.2.840.113549.1.1.2",MD4withRSA:"1.2.840.113549.1.1.3",MD5withRSA:"1.2.840.113549.1.1.4",SHA1withRSA:"1.2.840.113549.1.1.5","pkcs1-MGF":"1.2.840.113549.1.1.8",rsaPSS:"1.2.840.113549.1.1.10",SHA224withRSA:"1.2.840.113549.1.1.14",SHA256withRSA:"1.2.840.113549.1.1.11",SHA384withRSA:"1.2.840.113549.1.1.12",SHA512withRSA:"1.2.840.113549.1.1.13",SHA1withECDSA:"1.2.840.10045.4.1",SHA224withECDSA:"1.2.840.10045.4.3.1",SHA256withECDSA:"1.2.840.10045.4.3.2",SHA384withECDSA:"1.2.840.10045.4.3.3",SHA512withECDSA:"1.2.840.10045.4.3.4",dsa:"1.2.840.10040.4.1",SHA1withDSA:"1.2.840.10040.4.3",SHA224withDSA:"2.16.840.1.101.3.4.3.1",SHA256withDSA:"2.16.840.1.101.3.4.3.2",rsaEncryption:"1.2.840.113549.1.1.1",commonName:"2.5.4.3",countryName:"2.5.4.6",localityName:"2.5.4.7",stateOrProvinceName:"2.5.4.8",streetAddress:"2.5.4.9",organizationName:"2.5.4.10",organizationalUnitName:"2.5.4.11",domainComponent:"0.9.2342.19200300.100.1.25",userId:"0.9.2342.19200300.100.1.1",surname:"2.5.4.4",givenName:"2.5.4.42",title:"2.5.4.12",distinguishedName:"2.5.4.49",emailAddress:"1.2.840.113549.1.9.1",description:"2.5.4.13",businessCategory:"2.5.4.15",postalCode:"2.5.4.17",uniqueIdentifier:"2.5.4.45",organizationIdentifier:"2.5.4.97",jurisdictionOfIncorporationL:"1.3.6.1.4.1.311.60.2.1.1",jurisdictionOfIncorporationSP:"1.3.6.1.4.1.311.60.2.1.2",jurisdictionOfIncorporationC:"1.3.6.1.4.1.311.60.2.1.3",subjectDirectoryAttributes:"2.5.29.9",subjectKeyIdentifier:"2.5.29.14",keyUsage:"2.5.29.15",subjectAltName:"2.5.29.17",issuerAltName:"2.5.29.18",basicConstraints:"2.5.29.19",cRLNumber:"2.5.29.20",cRLReason:"2.5.29.21",nameConstraints:"2.5.29.30",cRLDistributionPoints:"2.5.29.31",certificatePolicies:"2.5.29.32",anyPolicy:"2.5.29.32.0",policyMappings:"2.5.29.33",authorityKeyIdentifier:"2.5.29.35",policyConstraints:"2.5.29.36",extKeyUsage:"2.5.29.37",inhibitAnyPolicy:"2.5.29.54",authorityInfoAccess:"1.3.6.1.5.5.7.1.1",ocsp:"1.3.6.1.5.5.7.48.1",ocspBasic:"1.3.6.1.5.5.7.48.1.1",ocspNonce:"1.3.6.1.5.5.7.48.1.2",ocspNoCheck:"1.3.6.1.5.5.7.48.1.5",caIssuers:"1.3.6.1.5.5.7.48.2",anyExtendedKeyUsage:"2.5.29.37.0",serverAuth:"1.3.6.1.5.5.7.3.1",clientAuth:"1.3.6.1.5.5.7.3.2",codeSigning:"1.3.6.1.5.5.7.3.3",emailProtection:"1.3.6.1.5.5.7.3.4",timeStamping:"1.3.6.1.5.5.7.3.8",ocspSigning:"1.3.6.1.5.5.7.3.9",smtpUTF8Mailbox:"1.3.6.1.5.5.7.8.9",dateOfBirth:"1.3.6.1.5.5.7.9.1",placeOfBirth:"1.3.6.1.5.5.7.9.2",gender:"1.3.6.1.5.5.7.9.3",countryOfCitizenship:"1.3.6.1.5.5.7.9.4",countryOfResidence:"1.3.6.1.5.5.7.9.5",ecPublicKey:"1.2.840.10045.2.1","P-256":"1.2.840.10045.3.1.7",secp256r1:"1.2.840.10045.3.1.7",secp256k1:"1.3.132.0.10",secp384r1:"1.3.132.0.34",secp521r1:"1.3.132.0.35",pkcs5PBES2:"1.2.840.113549.1.5.13",pkcs5PBKDF2:"1.2.840.113549.1.5.12","des-EDE3-CBC":"1.2.840.113549.3.7",data:"1.2.840.113549.1.7.1","signed-data":"1.2.840.113549.1.7.2","enveloped-data":"1.2.840.113549.1.7.3","digested-data":"1.2.840.113549.1.7.5","encrypted-data":"1.2.840.113549.1.7.6","authenticated-data":"1.2.840.113549.1.9.16.1.2",tstinfo:"1.2.840.113549.1.9.16.1.4",signingCertificate:"1.2.840.113549.1.9.16.2.12",timeStampToken:"1.2.840.113549.1.9.16.2.14",signaturePolicyIdentifier:"1.2.840.113549.1.9.16.2.15",etsArchiveTimeStamp:"1.2.840.113549.1.9.16.2.27",signingCertificateV2:"1.2.840.113549.1.9.16.2.47",etsArchiveTimeStampV2:"1.2.840.113549.1.9.16.2.48",extensionRequest:"1.2.840.113549.1.9.14",contentType:"1.2.840.113549.1.9.3",messageDigest:"1.2.840.113549.1.9.4",signingTime:"1.2.840.113549.1.9.5",counterSignature:"1.2.840.113549.1.9.6",archiveTimeStampV3:"0.4.0.1733.2.4",pdfRevocationInfoArchival:"1.2.840.113583.1.1.8",adobeTimeStamp:"1.2.840.113583.1.1.9.1",smimeMailboxLegacy:"2.23.140.1.5.1.1",smimeMailboxMulti:"2.23.140.1.5.1.2",smimeMailboxStrict:"2.23.140.1.5.1.3",smimeOrganizationLegacy:"2.23.140.1.5.2.1",smimeOrganizationMulti:"2.23.140.1.5.2.2",smimeOrganizationStrict:"2.23.140.1.5.2.3",smimeSponsorLegacy:"2.23.140.1.5.3.1",smimeSponsorMulti:"2.23.140.1.5.3.2",smimeSponsorStrict:"2.23.140.1.5.3.3",smimeIndividualLegacy:"2.23.140.1.5.4.1",smimeIndividualMulti:"2.23.140.1.5.4.2",smimeIndividualStrict:"2.23.140.1.5.4.3"},this.atype2oidList={CN:"2.5.4.3",L:"2.5.4.7",ST:"2.5.4.8",O:"2.5.4.10",OU:"2.5.4.11",C:"2.5.4.6",STREET:"2.5.4.9",DC:"0.9.2342.19200300.100.1.25",UID:"0.9.2342.19200300.100.1.1",SN:"2.5.4.4",T:"2.5.4.12",GN:"2.5.4.42",DN:"2.5.4.49",E:"1.2.840.113549.1.9.1",description:"2.5.4.13",businessCategory:"2.5.4.15",postalCode:"2.5.4.17",serialNumber:"2.5.4.5",uniqueIdentifier:"2.5.4.45",organizationIdentifier:"2.5.4.97",jurisdictionOfIncorporationL:"1.3.6.1.4.1.311.60.2.1.1",jurisdictionOfIncorporationSP:"1.3.6.1.4.1.311.60.2.1.2",jurisdictionOfIncorporationC:"1.3.6.1.4.1.311.60.2.1.3"},this.objCache={},this.name2obj=function(t){if(void 0!==this.objCache[t])return this.objCache[t];if(void 0===this.name2oidList[t])throw"Name of ObjectIdentifier not defined: "+t;var n=this.name2oidList[t],r=new e({oid:n});return this.objCache[t]=r,r},this.atype2obj=function(t){if(void 0!==this.objCache[t])return this.objCache[t];var n;if(t.match(/^\d+\.\d+\.[0-9.]+$/))n=t;else if(void 0!==this.atype2oidList[t])n=this.atype2oidList[t];else{if(void 0===this.name2oidList[t])throw new Error("AttributeType name undefined: "+t);n=this.name2oidList[t]}var r=new e({oid:n});return this.objCache[t]=r,r},this.registerOIDs=function(e){if(this.checkOIDs(e))for(var t in e)this.name2oidList[t]=e[t]},this.checkOIDs=function(e){try{var t=Object.keys(e);return 0!=t.length&&(t.map((function(e,t,n){if(!this[e].match(/^[0-2]\.[0-9.]+$/))throw new Error("value is not OID")}),e),!0)}catch(e){return!1}}},ue.asn1.x509.OID.oid2name=function(e){var t=ue.asn1.x509.OID.name2oidList;for(var n in t)if(t[n]==e)return n;return""},ue.asn1.x509.OID.oid2atype=function(e){var t=ue.asn1.x509.OID.atype2oidList;for(var n in t)if(t[n]==e)return n;return e},ue.asn1.x509.OID.name2oid=function(e){if(e.match(/^[0-9.]+$/))return e;var t=ue.asn1.x509.OID.name2oidList;return void 0===t[e]?"":t[e]},ue.asn1.x509.X509Util={},ue.asn1.x509.X509Util.newCertPEM=function(e){var t=ue.asn1.x509;t.TBSCertificate;return new(0,t.Certificate)(e).getPEM()},void 0!==ue&&ue||(ue={}),void 0!==ue.asn1&&ue.asn1||(ue.asn1={}),void 0!==ue.asn1.cms&&ue.asn1.cms||(ue.asn1.cms={}),ue.asn1.cms.Attribute=function(e){var t=Error,n=ue.asn1,r=n.DERSequence,i=n.DERSet,o=n.DERObjectIdentifier;this.params=null,this.typeOid=null,this.setByParam=function(e){this.params=e},this.getValueArray=function(){throw new t("not yet implemented abstract")},this.tohex=function(){var e=new o({oid:this.typeOid}),t=new i({array:this.getValueArray()});return new r({array:[e,t]}).tohex()},this.getEncodedHex=function(){return this.tohex()}},et(ue.asn1.cms.Attribute,ue.asn1.ASN1Object),ue.asn1.cms.ContentType=function(e){var t=ue.asn1;t.cms.ContentType.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.3",this.getValueArray=function(){return[new t.DERObjectIdentifier(this.params.type)]},null!=e&&this.setByParam(e)},et(ue.asn1.cms.ContentType,ue.asn1.cms.Attribute),ue.asn1.cms.MessageDigest=function(e){var t=ue.asn1,n=t.DEROctetString;t.cms.MessageDigest.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.4",this.getValueArray=function(){return[new n(this.params)]},null!=e&&this.setByParam(e)},et(ue.asn1.cms.MessageDigest,ue.asn1.cms.Attribute),ue.asn1.cms.SigningTime=function(e){var t=ue.asn1;t.cms.SigningTime.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.5",this.getValueArray=function(){return[new t.x509.Time(this.params)]},null!=e&&this.setByParam(e)},et(ue.asn1.cms.SigningTime,ue.asn1.cms.Attribute),ue.asn1.cms.SigningCertificate=function(e){var t=Error,n=ue,r=n.asn1,i=r.DERSequence,o=r.cms,a=o.ESSCertID;n.crypto;o.SigningCertificate.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.16.2.12",this.getValueArray=function(){if(null==this.params||null==this.params||null==this.params.array)throw new t("parameter 'array' not specified");for(var n=this.params.array,r=[],o=0;o<n.length;o++){var s=n[o];0!=e.hasis||"string"!=typeof s||-1==s.indexOf("-----BEGIN")&&!pe.isASN1HEX(s)||(s={cert:s}),0!=s.hasis&&0==e.hasis&&(s.hasis=!1),r.push(new a(s))}var u=new i({array:r});return[new i({array:[u]})]},null!=e&&this.setByParam(e)},et(ue.asn1.cms.SigningCertificate,ue.asn1.cms.Attribute),ue.asn1.cms.ESSCertID=function(e){ue.asn1.cms.ESSCertID.superclass.constructor.call(this);var t=Error,n=ue,r=n.asn1,i=r.DEROctetString,o=r.DERSequence,a=r.cms.IssuerSerial;this.params=null,this.getCertHash=function(e,r){if(null!=e.hash)return e.hash;if("string"==typeof e&&-1==e.indexOf("-----BEGIN")&&!pe.isASN1HEX(e))return e;var i,o,a;if("string"==typeof e)i=e;else{if(null==e.cert)throw new t("hash nor cert unspecified");i=e.cert}if(o=-1!=i.indexOf("-----BEGIN")?Te(i):i,"string"==typeof e&&(-1!=e.indexOf("-----BEGIN")?o=Te(e):pe.isASN1HEX(e)&&(o=e)),null!=e.alg)a=e.alg;else{if(null==r)throw new t("hash alg unspecified");a=r}return n.crypto.Util.hashHex(o,a)},this.tohex=function(){var e=this.params,t=this.getCertHash(e,"sha1"),n=[];return n.push(new i({hex:t})),("string"==typeof e&&-1!=e.indexOf("-----BEGIN")||null!=e.cert&&0!=e.hasis||null!=e.issuer&&null!=e.serial)&&n.push(new a(e)),new o({array:n}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(ue.asn1.cms.ESSCertID,ue.asn1.ASN1Object),ue.asn1.cms.SigningCertificateV2=function(e){var t=Error,n=ue,r=n.asn1,i=r.DERSequence,o=(r.x509,r.cms),a=o.ESSCertIDv2;n.crypto;o.SigningCertificateV2.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.16.2.47",this.getValueArray=function(){if(null==this.params||null==this.params||null==this.params.array)throw new t("parameter 'array' not specified");for(var n=this.params.array,r=[],o=0;o<n.length;o++){var s=n[o];null==e.alg&&0!=e.hasis||"string"!=typeof s||-1==s.indexOf("-----BEGIN")&&!pe.isASN1HEX(s)||(s={cert:s}),null==s.alg&&null!=e.alg&&(s.alg=e.alg),0!=s.hasis&&0==e.hasis&&(s.hasis=!1),r.push(new a(s))}var u=new i({array:r});return[new i({array:[u]})]},null!=e&&this.setByParam(e)},et(ue.asn1.cms.SigningCertificateV2,ue.asn1.cms.Attribute),ue.asn1.cms.ESSCertIDv2=function(e){ue.asn1.cms.ESSCertIDv2.superclass.constructor.call(this);Error;var t=ue.asn1,n=t.DEROctetString,r=t.DERSequence,i=t.cms.IssuerSerial,o=t.x509.AlgorithmIdentifier;this.params=null,this.tohex=function(){var e=this.params,t=this.getCertHash(e,"sha256"),a=[];return null!=e.alg&&"sha256"!=e.alg&&a.push(new o({name:e.alg})),a.push(new n({hex:t})),("string"==typeof e&&-1!=e.indexOf("-----BEGIN")||null!=e.cert&&0!=e.hasis||null!=e.issuer&&null!=e.serial)&&a.push(new i(e)),new r({array:a}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(ue.asn1.cms.ESSCertIDv2,ue.asn1.cms.ESSCertID),ue.asn1.cms.IssuerSerial=function(e){var t=Error,n=ue.asn1,r=n.DERInteger,i=n.DERSequence,o=n.cms,a=n.x509.GeneralNames,s=ot;o.IssuerSerial.superclass.constructor.call(this),this.setByParam=function(e){this.params=e},this.tohex=function(){var e,n,o=this.params;if("string"==typeof o&&-1!=o.indexOf("-----BEGIN")||null!=o.cert){var u;u=null!=o.cert?o.cert:o;var l=new s;l.readCertPEM(u),e=l.getIssuer(),n={hex:l.getSerialNumberHex()}}else{if(null==o.issuer||!o.serial)throw new t("cert or issuer and serial parameter not specified");e=o.issuer,n=o.serial}var c=new a([{dn:e}]),p=new r(n);return new i({array:[c,p]}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(ue.asn1.cms.IssuerSerial,ue.asn1.ASN1Object),ue.asn1.cms.SignerIdentifier=function(e){var t=ue.asn1,n=(t.DERInteger,t.DERSequence,t.cms),r=n.IssuerAndSerialNumber,i=n.SubjectKeyIdentifier;t.x509.X500Name,Error;n.SignerIdentifier.superclass.constructor.call(this),this.params=null,this.tohex=function(){var e=this.params;if("isssn"==e.type)return new r(e).tohex();if("skid"==e.type)return new i(e).tohex();throw new Error("wrong property for isssn or skid")},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(ue.asn1.cms.SignerIdentifier,ue.asn1.ASN1Object),ue.asn1.cms.IssuerAndSerialNumber=function(e){var t=ue.asn1,n=t.DERInteger,r=t.DERSequence,i=t.cms,o=t.x509.X500Name,a=ot,s=Error;i.IssuerAndSerialNumber.superclass.constructor.call(this),this.params=null,this.tohex=function(){var e,t,i=this.params;if("string"==typeof i&&-1!=i.indexOf("-----BEGIN")||null!=i.cert){var u;u=null!=i.cert?i.cert:i;var l=new a;l.readCertPEM(u),e=l.getIssuer(),t={hex:l.getSerialNumberHex()}}else{if(null==i.issuer||!i.serial)throw new s("cert or issuer and serial parameter not specified");e=i.issuer,t=i.serial}var c=new o(e),p=new n(t);return new r({array:[c,p]}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(e){this.params=e},null!=e&&this.setByParam(e)},et(ue.asn1.cms.IssuerAndSerialNumber,ue.asn1.ASN1Object),ue.asn1.cms.SubjectKeyIdentifier=function(e){var t=ue.asn1,n=(t.DERInteger,t.DERSequence,t.ASN1Util.newObject),r=t.cms,i=(r.IssuerAndSerialName,r.SubjectKeyIdentifier,t.x509.X500Name,ot),o=Error;r.SubjectKeyIdentifier.superclass.constructor.call(this),this.tohex=function(){var e,t=this.params;if(null==t.cert&&null==t.skid)throw new o("property cert nor skid undefined");null!=t.cert?e=new i(t.cert).getExtSubjectKeyIdentifier().kid.hex:null!=t.skid&&(e=t.skid);return n({tag:{tage:"a0",obj:{octstr:{hex:e}}}}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(ue.asn1.cms.SubjectKeyIdentifier,ue.asn1.ASN1Object),ue.asn1.cms.AttributeList=function(e){var t=Error,n=ue.asn1,r=n.DERSet,i=n.cms;i.AttributeList.superclass.constructor.call(this),this.params=null,this.hTLV=null,this.setByParam=function(e){this.params=e},this.tohex=function(){var e=this.params;if(null!=this.hTLV)return this.hTLV;var n=!0;null!=e.sortflag&&(n=e.sortflag);for(var o=e.array,a=[],s=0;s<o.length;s++){var u=o[s],l=u.attr;if("contentType"==l)a.push(new i.ContentType(u));else if("messageDigest"==l)a.push(new i.MessageDigest(u));else if("signingTime"==l)a.push(new i.SigningTime(u));else if("signingCertificate"==l)a.push(new i.SigningCertificate(u));else if("signingCertificateV2"==l)a.push(new i.SigningCertificateV2(u));else if("signaturePolicyIdentifier"==l)a.push(new ue.asn1.cades.SignaturePolicyIdentifier(u));else{if("signatureTimeStamp"!=l&&"timeStampToken"!=l)throw new t("unknown attr: "+l);a.push(new ue.asn1.cades.SignatureTimeStamp(u))}}var c=new r({array:a,sortflag:n});return this.hTLV=c.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(ue.asn1.cms.AttributeList,ue.asn1.ASN1Object),ue.asn1.cms.SignerInfo=function(e){var t=Error,n=ue,r=n.asn1,i=r.DERInteger,o=r.DEROctetString,a=r.DERSequence,s=r.DERTaggedObject,u=r.cms,l=u.SignerIdentifier,c=u.AttributeList,p=(u.ContentType,u.EncapsulatedContentInfo,u.MessageDigest,u.SignedData,r.x509.AlgorithmIdentifier),h=n.crypto,d=tt;u.SignerInfo.superclass.constructor.call(this),this.params=null,this.sign=function(){var e=this.params,t=e.sigalg,n=new c(e.sattrs).tohex(),r=d.getKey(e.signkey),i=new h.Signature({alg:t});i.init(r),i.updateHex(n);var o=i.sign();e.sighex=o},this.tohex=function(){var e=this.params,n=[];if(n.push(new i({int:e.version})),n.push(new l(e.id)),n.push(new p({name:e.hashalg})),null!=e.sattrs){var r=new c(e.sattrs);try{n.push(new s({tag:"a0",explicit:!1,obj:r}))}catch(e){throw new t("si sattr error: "+e)}}if(null!=e.sigalgfield?n.push(new p({name:e.sigalgfield})):n.push(new p({name:e.sigalg})),null==e.sighex&&null!=e.signkey&&this.sign(),n.push(new o({hex:e.sighex})),null!=e.uattrs){r=new c(e.uattrs);try{n.push(new s({tag:"a1",explicit:!1,obj:r}))}catch(e){throw new t("si uattr error: "+e)}}return new a({array:n}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(ue.asn1.cms.SignerInfo,ue.asn1.ASN1Object),ue.asn1.cms.EncapsulatedContentInfo=function(e){var t=ue.asn1,n=t.DERTaggedObject,r=t.DERSequence,i=t.DERObjectIdentifier,o=t.DEROctetString;t.cms.EncapsulatedContentInfo.superclass.constructor.call(this),this.params=null,this.tohex=function(){var e=this.params,t=[];if(t.push(new i(e.type)),null!=e.content&&(null!=e.content.hex||null!=e.content.str)&&1!=e.isDetached){var a=new o(e.content),s=new n({tag:"a0",explicit:!0,obj:a});t.push(s)}return new r({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(e){this.params=e},null!=e&&this.setByParam(e)},et(ue.asn1.cms.EncapsulatedContentInfo,ue.asn1.ASN1Object),ue.asn1.cms.ContentInfo=function(e){var t=ue.asn1,n=t.DERTaggedObject,r=t.DERSequence,i=t.DERObjectIdentifier;t.x509.OID.name2obj;ue.asn1.cms.ContentInfo.superclass.constructor.call(this),this.params=null,this.tohex=function(){var e=this.params,t=[];t.push(new i(e.type));var o=new n({tag:"a0",explicit:!0,obj:e.obj});return t.push(o),new r({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(e){this.params=e},null!=e&&this.setByParam(e)},et(ue.asn1.cms.ContentInfo,ue.asn1.ASN1Object),ue.asn1.cms.SignedData=function(e){Error;var t=ue.asn1,n=(t.ASN1Object,t.DERInteger),r=t.DERSet,i=t.DERSequence,o=(t.DERTaggedObject,t.cms),a=o.EncapsulatedContentInfo,s=o.SignerInfo,u=o.ContentInfo,l=o.CertificateSet,c=o.RevocationInfoChoices,p=t.x509.AlgorithmIdentifier;ue.asn1.cms.SignedData.superclass.constructor.call(this),this.params=null,this.checkAndFixParam=function(){var e=this.params;this._setDigestAlgs(e),this._setContentTypeByEContent(e),this._setMessageDigestByEContent(e),this._setSignerInfoVersion(e),this._setSignedDataVersion(e)},this._setDigestAlgs=function(e){for(var t={},n=e.sinfos,r=0;r<n.length;r++){t[n[r].hashalg]=1}e.hashalgs=Object.keys(t).sort()},this._setContentTypeByEContent=function(e){for(var t=e.econtent.type,n=e.sinfos,r=0;r<n.length;r++){var i=n[r];this._getAttrParamByName(i,"contentType").type=t}},this._setMessageDigestByEContent=function(e){var t=e.econtent,n=(e.econtent.type,t.content.hex);null==n&&"data"==t.type&&null!=t.content.str&&(n=Ae(t.content.str));for(var r=e.sinfos,i=0;i<r.length;i++){var o=r[i],a=o.hashalg,s=this._getAttrParamByName(o,"messageDigest"),u=ue.crypto.Util.hashHex(n,a);s.hex=u}},this._getAttrParamByName=function(e,t){for(var n=e.sattrs.array,r=0;r<n.length;r++)if(n[r].attr==t)return n[r]},this._setSignerInfoVersion=function(e){for(var t=e.sinfos,n=0;n<t.length;n++){var r=t[n],i=1;"skid"==r.id.type&&(i=3),r.version=i}},this._setSignedDataVersion=function(e){var t=this._getSignedDataVersion(e);e.version=t},this._getSignedDataVersion=function(e){if(null!=e.revinfos)for(var t=e.revinfos,n=0;n<t.length;n++){if(null!=t[n].ocsp)return 5}var r=e.sinfos;for(n=0;n<r.length;n++){if(3==e.sinfos[n].version)return 3}return"data"!=e.econtent.type?3:1},this.tohex=function(){var e=this.params;null!=this.getEncodedHexPrepare&&this.getEncodedHexPrepare(),1!=e.fixed&&this.checkAndFixParam();var t=[];t.push(new n({int:e.version}));for(var o=[],u=0;u<e.hashalgs.length;u++){var h=e.hashalgs[u];o.push(new p({name:h}))}t.push(new r({array:o})),t.push(new a(e.econtent)),null!=e.certs&&t.push(new l(e.certs)),null!=e.revinfos&&t.push(new c(e.revinfos));var d=[];for(u=0;u<e.sinfos.length;u++){var f=e.sinfos[u];d.push(new s(f))}return t.push(new r({array:d})),new i({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.getContentInfo=function(){return new u({type:"signed-data",obj:this})},this.getContentInfoEncodedHex=function(){return this.getContentInfo().tohex()},null!=e&&this.setByParam(e)},et(ue.asn1.cms.SignedData,ue.asn1.ASN1Object),ue.asn1.cms.CertificateSet=function(e){ue.asn1.cms.CertificateSet.superclass.constructor.call(this);var t=Error,n=ue.asn1,r=n.DERTaggedObject,i=n.DERSet,o=n.ASN1Object;this.params=null,this.tohex=function(){var e,n=this.params,a=[];if(n instanceof Array)e=n;else{if(null==n.array)throw new t("cert array not specified");e=n.array}for(var s=0;s<e.length;s++){var u=Te(e[s]),l=new o;l.hTLV=u,a.push(l)}var c={array:a};0==n.sortflag&&(c.sortflag=!1);var p=new i(c);return new r({tag:"a0",explicit:!1,obj:p}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(ue.asn1.cms.CertificateSet,ue.asn1.ASN1Object),ue.asn1.cms.RevocationInfoChoices=function(e){ue.asn1.cms.RevocationInfoChoices.superclass.constructor.call(this),this.params=null,this.tohex=function(){var e=this.params;if(!e instanceof Array)throw new Error("params is not array");for(var t=[],n=0;n<e.length;n++)t.push(new ue.asn1.cms.RevocationInfoChoice(e[n]));return ue.asn1.ASN1Util.newObject({tag:{tagi:"a1",obj:{set:t}}}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(ue.asn1.cms.RevocationInfoChoices,ue.asn1.ASN1Object),ue.asn1.cms.RevocationInfoChoice=function(e){ue.asn1.cms.RevocationInfoChoice.superclass.constructor.call(this),this.params=null,this.tohex=function(){var e=this.params;if(null!=e.crl&&"string"==typeof e.crl){var t=e.crl;return-1!=e.crl.indexOf("-----BEGIN")&&(t=Te(e.crl)),t}if(null!=e.ocsp)return ue.asn1.ASN1Util.newObject({tag:{tagi:"a1",obj:new ue.asn1.cms.OtherRevocationFormat(e)}}).tohex();throw new Error("property crl or ocsp undefined")},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(ue.asn1.cms.RevocationInfoChoice,ue.asn1.ASN1Object),ue.asn1.cms.OtherRevocationFormat=function(e){ue.asn1.cms.OtherRevocationFormat.superclass.constructor.call(this);var t=Error,n=ue,r=n.asn1.ASN1Util.newObject,i=n.lang.String.isHex;this.params=null,this.tohex=function(){var e=this.params;if(null==e.ocsp)throw new t("property ocsp not specified");if(!i(e.ocsp)||!pe.isASN1HEX(e.ocsp))throw new t("ocsp value not ASN.1 hex string");return r({seq:[{oid:"1.3.6.1.5.5.7.16.2"},{asn1:{tlv:e.ocsp}}]}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(ue.asn1.cms.OtherRevocationFormat,ue.asn1.ASN1Object),ue.asn1.cms.CMSUtil=new function(){},ue.asn1.cms.CMSUtil.newSignedData=function(e){return new ue.asn1.cms.SignedData(e)},ue.asn1.cms.CMSUtil.verifySignedData=function(e){var t=ue,n=t.asn1,r=n.cms,i=(r.SignerInfo,r.SignedData,r.SigningTime,r.SigningCertificate,r.SigningCertificateV2,n.cades.SignaturePolicyIdentifier,t.lang.String.isHex),o=pe,a=o.getVbyList,s=o.getTLVbyList,u=o.getIdxbyList,l=o.getChildIdx,c=o.getTLV,p=o.oidname,h=t.crypto.Util.hashHex;void 0===e.cms&&i(e.cms);var d=e.cms,f=function(e,t){var n=t.idx;t.signerid_issuer1=s(e,n,[1,0],"30"),t.signerid_serial1=a(e,n,[1,1],"02"),t.hashalg=p(a(e,n,[2,0],"06"));var r=u(e,n,[3],"a0");t.idxSignedAttrs=r,g(e,t,r);var i=l(e,n).length;if(i<6)throw"malformed SignerInfo";t.sigalg=p(a(e,n,[i-2,0],"06")),t.sigval=a(e,n,[i-1],"04")},g=function(e,t,n){var r=l(e,n);t.signedAttrIdxList=r;for(var i=0;i<r.length;i++){var o,s=r[i],u=a(e,s,[0],"06");"2a864886f70d010905"===u?(o=xe(a(e,s,[1,0])),t.saSigningTime=o):"2a864886f70d010904"===u&&(o=a(e,s,[1,0],"04"),t.saMessageDigest=o)}},m=function(e,t,n,r){n.verifyDetail={};var i=n.verifyDetail,o=t.parse.econtent,a=n.hashalg,s=n.saMessageDigest;i.validMessageDigest=!1,h(o,a)===s&&(i.validMessageDigest=!0),function(e,t,n,r){var i,o=t.parse.certsIdx;if(void 0===t.certs){i=[],t.certkeys=[];for(var a=l(e,o),s=0;s<a.length;s++){var u=c(e,a[s]),p=new ot;p.readCertHex(u),i[s]=p,t.certkeys[s]=p.getPublicKey()}t.certs=i}else i=t.certs;t.cccc=i.length,t.cccci=a.length;for(s=0;s<i.length;s++){var h=p.getIssuerHex(),d=p.getSerialNumberHex();n.signerid_issuer1===h&&n.signerid_serial1===d&&(n.certkey_idx=s)}}(e,t,n),i.validSignatureValue=!1;var u=n.sigalg,p="31"+c(e,n.idxSignedAttrs).substr(2);n.signedattrshex=p;var d=t.certs[n.certkey_idx].getPublicKey(),f=new ue.crypto.Signature({alg:u});f.init(d),f.updateHex(p);var g=f.verify(n.sigval);i.validSignatureValue_isValid=g,!0===g&&(i.validSignatureValue=!0),n.isValid=!1,i.validMessageDigest&&i.validSignatureValue&&(n.isValid=!0)},v={isValid:!1,parse:{}};return function(e,t){if("2a864886f70d010702"!==a(e,0,[0],"06"))return t;t.cmsType="signedData",t.econtent=a(e,0,[1,0,2,1,0]),function(e,t){for(var n,r=3;r<6;r++)if(void 0!==(n=u(e,0,[1,0,r]))){var i=e.substr(n,2);"a0"===i&&(t.certsIdx=n),"a1"===i&&(t.revinfosIdx=n),"31"===i&&(t.signerinfosIdx=n)}}(e,t),t.signerInfos=[],function(e,t){var n=t.signerinfosIdx;if(void 0!==n){var r=l(e,n);t.signerInfoIdxList=r;for(var i=0;i<r.length;i++){var o={idx:r[i]};f(e,o),t.signerInfos.push(o)}}}(e,t)}(d,v.parse),function(e,t){for(var n=t.parse.signerInfos,r=n.length,i=!0,o=0;o<r;o++){var a=n[o];m(e,t,a,o),a.isValid||(i=!1)}t.isValid=i}(d,v),v},ue.asn1.cms.CMSParser=function(){var e=Error,t=ot,n=new t,r=pe,i=r.getV,o=r.getTLV,a=(r.getIdxbyList,r.getTLVbyList),s=r.getTLVbyListEx,u=r.getVbyList,l=r.getVbyListEx,c=r.getChildIdx;this.getCMSSignedData=function(e){var t=a(e,0,[1,0]);return this.getSignedData(t)},this.getSignedData=function(e){var t=c(e,0),n={},r=i(e,t[0]),a=parseInt(r,16);n.version=a;var u=o(e,t[1]);n.hashalgs=this.getHashAlgArray(u);var l=o(e,t[2]);n.econtent=this.getEContent(l);var p=s(e,0,["[0]"]);null!=p&&(n.certs=this.getCertificateSet(p));s(e,0,["[1]"]);var h=s(e,0,[3]);return n.sinfos=this.getSignerInfos(h),n},this.getHashAlgArray=function(e){for(var n=c(e,0),r=new t,i=[],a=0;a<n.length;a++){var s=o(e,n[a]),u=r.getAlgorithmIdentifierName(s);i.push(u)}return i},this.getEContent=function(e){var t={},n=u(e,0,[0]),r=u(e,0,[1,0]);return t.type=ue.asn1.x509.OID.oid2name(pe.hextooidstr(n)),t.content={hex:r},t},this.getSignerInfos=function(e){for(var t=[],n=c(e,0),r=0;r<n.length;r++){var i=o(e,n[r]),a=this.getSignerInfo(i);t.push(a)}return t},this.getSignerInfo=function(e){var t={},i=c(e,0),a=r.getInt(e,i[0],-1);-1!=a&&(t.version=a);var u=o(e,i[1]),p=this.getIssuerAndSerialNumber(u);t.id=p;var h=o(e,i[2]),d=n.getAlgorithmIdentifierName(h);t.hashalg=d;var f=s(e,0,["[0]"]);if(null!=f){var g=this.getAttributeList(f);t.sattrs=g}var m=s(e,0,[3]),v=n.getAlgorithmIdentifierName(m);t.sigalg=v;var y=l(e,0,[4]);t.sighex=y;var b=s(e,0,["[1]"]);if(null!=b){var w=this.getAttributeList(b);t.uattrs=w}return t},this.getSignerIdentifier=function(e){if("30"==e.substr(0,2))return this.getIssuerAndSerialNumber(e);throw new Error("SKID of signerIdentifier not supported")},this.getIssuerAndSerialNumber=function(e){var t={type:"isssn"},r=c(e,0),a=o(e,r[0]);t.issuer=n.getX500Name(a);var s=i(e,r[1]);return t.serial={hex:s},t},this.getAttributeList=function(e){for(var t=[],n=c(e,0),r=0;r<n.length;r++){var i=o(e,n[r]),a=this.getAttribute(i);t.push(a)}return{array:t}},this.getAttribute=function(e){var t={},n=c(e,0),i=r.getOID(e,n[0]),a=ue.asn1.x509.OID.oid2name(i);t.attr=a;var s=o(e,n[1]),u=c(s,0);if(1==u.length)t.valhex=o(s,u[0]);else{for(var l=[],p=0;p<u.length;p++)l.push(o(s,u[p]));t.valhex=l}return"contentType"==a?this.setContentType(t):"messageDigest"==a?this.setMessageDigest(t):"signingTime"==a?this.setSigningTime(t):"signingCertificate"==a?this.setSigningCertificate(t):"signingCertificateV2"==a?this.setSigningCertificateV2(t):"signaturePolicyIdentifier"==a&&this.setSignaturePolicyIdentifier(t),t},this.setContentType=function(e){var t=r.getOIDName(e.valhex,0,null);null!=t&&(e.type=t,delete e.valhex)},this.setSigningTime=function(e){var t=xe(i(e.valhex,0));e.str=t,delete e.valhex},this.setMessageDigest=function(e){var t=i(e.valhex,0);e.hex=t,delete e.valhex},this.setSigningCertificate=function(e){var t=c(e.valhex,0);if(t.length>0){for(var n=o(e.valhex,t[0]),r=c(n,0),i=[],a=0;a<r.length;a++){var s=o(n,r[a]),u=this.getESSCertID(s);i.push(u)}e.array=i}if(t.length>1){var l=o(e.valhex,t[1]);e.polhex=l}delete e.valhex},this.setSignaturePolicyIdentifier=function(e){var n=c(e.valhex,0);if(n.length>0){var a=r.getOID(e.valhex,n[0]);e.oid=a}if(n.length>1){var s=new t,u=c(e.valhex,n[1]),l=o(e.valhex,u[0]),p=s.getAlgorithmIdentifierName(l);e.alg=p;var h=i(e.valhex,u[1]);e.hash=h}delete e.valhex},this.setSigningCertificateV2=function(e){var t=c(e.valhex,0);if(t.length>0){for(var n=o(e.valhex,t[0]),r=c(n,0),i=[],a=0;a<r.length;a++){var s=o(n,r[a]),u=this.getESSCertIDv2(s);i.push(u)}e.array=i}if(t.length>1){var l=o(e.valhex,t[1]);e.polhex=l}delete e.valhex},this.getESSCertID=function(e){var t={},n=c(e,0);if(n.length>0){var r=i(e,n[0]);t.hash=r}if(n.length>1){var a=o(e,n[1]),s=this.getIssuerSerial(a);null!=s.serial&&(t.serial=s.serial),null!=s.issuer&&(t.issuer=s.issuer)}return t},this.getESSCertIDv2=function(t){var r={},a=c(t,0);if(a.length<1||3<a.length)throw new e("wrong number of elements");var s=0;if("30"==t.substr(a[0],2)){var u=o(t,a[0]);r.alg=n.getAlgorithmIdentifierName(u),s++}else r.alg="sha256";var l=i(t,a[s]);if(r.hash=l,a.length>s+1){var p=o(t,a[s+1]),h=this.getIssuerSerial(p);r.issuer=h.issuer,r.serial=h.serial}return r},this.getIssuerSerial=function(e){var t={},r=c(e,0),a=o(e,r[0]),s=n.getGeneralNames(a)[0].dn;t.issuer=s;var u=i(e,r[1]);return t.serial={hex:u},t},this.getCertificateSet=function(e){for(var t=c(e,0),n=[],r=0;r<t.length;r++){var i=o(e,t[r]);if("30"==i.substr(0,2)){var a=De(i,"CERTIFICATE");n.push(a)}}return{array:n,sortflag:!1}}},void 0!==ue&&ue||(ue={}),void 0!==ue.asn1&&ue.asn1||(ue.asn1={}),void 0!==ue.asn1.tsp&&ue.asn1.tsp||(ue.asn1.tsp={}),ue.asn1.tsp.TimeStampToken=function(e){var t=ue.asn1.tsp;t.TimeStampToken.superclass.constructor.call(this),this.params=null,this.getEncodedHexPrepare=function(){var e=new t.TSTInfo(this.params.econtent.content);this.params.econtent.content.hex=e.tohex()},null!=e&&this.setByParam(e)},et(ue.asn1.tsp.TimeStampToken,ue.asn1.cms.SignedData),ue.asn1.tsp.TSTInfo=function(e){Error;var t=ue.asn1,n=t.DERSequence,r=t.DERInteger,i=t.DERBoolean,o=t.DERGeneralizedTime,a=t.DERObjectIdentifier,s=t.DERTaggedObject,u=t.tsp,l=u.MessageImprint,c=u.Accuracy,p=(t.x509.X500Name,t.x509.GeneralName);if(u.TSTInfo.superclass.constructor.call(this),this.dVersion=new r({int:1}),this.dPolicy=null,this.dMessageImprint=null,this.dSerial=null,this.dGenTime=null,this.dAccuracy=null,this.dOrdering=null,this.dNonce=null,this.dTsa=null,this.tohex=function(){var e=[this.dVersion];if(null==this.dPolicy)throw new Error("policy shall be specified.");if(e.push(this.dPolicy),null==this.dMessageImprint)throw new Error("messageImprint shall be specified.");if(e.push(this.dMessageImprint),null==this.dSerial)throw new Error("serialNumber shall be specified.");if(e.push(this.dSerial),null==this.dGenTime)throw new Error("genTime shall be specified.");e.push(this.dGenTime),null!=this.dAccuracy&&e.push(this.dAccuracy),null!=this.dOrdering&&e.push(this.dOrdering),null!=this.dNonce&&e.push(this.dNonce),null!=this.dTsa&&e.push(this.dTsa);var t=new n({array:e});return this.hTLV=t.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==e){if("string"==typeof e.policy){if(!e.policy.match(/^[0-9.]+$/))throw"policy shall be oid like 0.1.4.134";this.dPolicy=new a({oid:e.policy})}void 0!==e.messageImprint&&(this.dMessageImprint=new l(e.messageImprint)),void 0!==e.serial&&(this.dSerial=new r(e.serial)),void 0!==e.genTime&&(this.dGenTime=new o(e.genTime)),void 0!==e.accuracy&&(this.dAccuracy=new c(e.accuracy)),void 0!==e.ordering&&1==e.ordering&&(this.dOrdering=new i),void 0!==e.nonce&&(this.dNonce=new r(e.nonce)),void 0!==e.tsa&&(this.dTsa=new s({tag:"a0",explicit:!0,obj:new p({dn:e.tsa})}))}},et(ue.asn1.tsp.TSTInfo,ue.asn1.ASN1Object),ue.asn1.tsp.Accuracy=function(e){var t=ue.asn1,n=t.ASN1Util.newObject;t.tsp.Accuracy.superclass.constructor.call(this),this.params=null,this.tohex=function(){var e=this.params,t=[];return null!=e.seconds&&"number"==typeof e.seconds&&t.push({int:e.seconds}),null!=e.millis&&"number"==typeof e.millis&&t.push({tag:{tagi:"80",obj:{int:e.millis}}}),null!=e.micros&&"number"==typeof e.micros&&t.push({tag:{tagi:"81",obj:{int:e.micros}}}),n({seq:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(ue.asn1.tsp.Accuracy,ue.asn1.ASN1Object),ue.asn1.tsp.MessageImprint=function(e){var t=ue.asn1,n=t.DERSequence,r=t.DEROctetString,i=t.x509.AlgorithmIdentifier;t.tsp.MessageImprint.superclass.constructor.call(this),this.params=null,this.tohex=function(){var e=this.params,t=new i({name:e.alg}),o=new r({hex:e.hash});return new n({array:[t,o]}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},et(ue.asn1.tsp.MessageImprint,ue.asn1.ASN1Object),ue.asn1.tsp.TimeStampReq=function(e){var t=ue.asn1,n=t.DERSequence,r=t.DERInteger,i=t.DERBoolean,o=(t.ASN1Object,t.DERObjectIdentifier),a=t.tsp,s=a.MessageImprint;a.TimeStampReq.superclass.constructor.call(this),this.params=null,this.tohex=function(){var e=this.params,t=[];return t.push(new r({int:1})),e.messageImprint instanceof ue.asn1.ASN1Object?t.push(e.messageImprint):t.push(new s(e.messageImprint)),null!=e.policy&&t.push(new o(e.policy)),null!=e.nonce&&t.push(new r(e.nonce)),1==e.certreq&&t.push(new i),new n({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(ue.asn1.tsp.TimeStampReq,ue.asn1.ASN1Object),ue.asn1.tsp.TimeStampResp=function(e){var t=ue.asn1,n=t.DERSequence,r=(t.ASN1Object,t.tsp),i=r.PKIStatusInfo;r.TimeStampResp.superclass.constructor.call(this),this.params=null,this.tohex=function(){var e=this.params,o=[];if(null!=e.econtent||null!=e.tst)if(null!=e.statusinfo?o.push(new i(e.statusinfo)):o.push(new i("granted")),null!=e.econtent)o.push(new r.TimeStampToken(e).getContentInfo());else{if(!(e.tst instanceof t.ASN1Object))throw new Error("improper member tst value");o.push(e.tst)}else{if(null==e.statusinfo)throw new Error("parameter for token nor statusinfo not specified");o.push(new i(e.statusinfo))}return new n({array:o}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(ue.asn1.tsp.TimeStampResp,ue.asn1.ASN1Object),ue.asn1.tsp.PKIStatusInfo=function(e){var t=Error,n=ue.asn1,r=n.DERSequence,i=n.tsp,o=i.PKIStatus,a=i.PKIFreeText,s=i.PKIFailureInfo;i.PKIStatusInfo.superclass.constructor.call(this),this.params=null,this.tohex=function(){var e=this.params,n=[];if("string"==typeof e)n.push(new o(e));else{if(null==e.status)throw new t("property 'status' unspecified");n.push(new o(e.status)),null!=e.statusstr&&n.push(new a(e.statusstr)),null!=e.failinfo&&n.push(new s(e.failinfo))}return new r({array:n}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(ue.asn1.tsp.PKIStatusInfo,ue.asn1.ASN1Object),ue.asn1.tsp.PKIStatus=function(e){var t=Error,n=ue.asn1,r=n.DERInteger;n.tsp.PKIStatus.superclass.constructor.call(this);var i={granted:0,grantedWithMods:1,rejection:2,waiting:3,revocationWarning:4,revocationNotification:5};this.params=null,this.tohex=function(){var e,n=this.params;if("string"==typeof n)try{e=i[n]}catch(e){throw new t("undefined name: "+n)}else{if("number"!=typeof n)throw new t("unsupported params");e=n}return new r({int:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(ue.asn1.tsp.PKIStatus,ue.asn1.ASN1Object),ue.asn1.tsp.PKIFreeText=function(e){var t=Error,n=ue.asn1,r=n.DERSequence,i=n.DERUTF8String;n.tsp.PKIFreeText.superclass.constructor.call(this),this.params=null,this.tohex=function(){var e=this.params;if(!e instanceof Array)throw new t("wrong params: not array");for(var n=[],o=0;o<e.length;o++)n.push(new i({str:e[o]}));return new r({array:n}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(ue.asn1.tsp.PKIFreeText,ue.asn1.ASN1Object),ue.asn1.tsp.PKIFailureInfo=function(e){var t=Error,n=ue.asn1,r=n.DERBitString,i=n.tsp.PKIFailureInfo,o={badAlg:0,badRequest:2,badDataFormat:5,timeNotAvailable:14,unacceptedPolicy:15,unacceptedExtension:16,addInfoNotAvailable:17,systemFailure:25};i.superclass.constructor.call(this),this.params=null,this.getBinValue=function(){var e=this.params,n=0;if("number"==typeof e&&0<=e&&e<=25){for(var r=(n|=1<<e).toString(2),i="",a=r.length-1;a>=0;a--)i+=r[a];return i}if("string"==typeof e&&null!=o[e])return Ze([e],o);if("object"==typeof e&&null!=e.length)return Ze(e,o);throw new t("wrong params")},this.tohex=function(){this.params;var e=this.getBinValue();return new r({bin:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(ue.asn1.tsp.PKIFailureInfo,ue.asn1.ASN1Object),ue.asn1.tsp.AbstractTSAAdapter=function(e){this.getTSTHex=function(e,t){throw"not implemented yet"}},ue.asn1.tsp.SimpleTSAAdapter=function(e){var t=ue,n=t.asn1.tsp,r=t.crypto.Util.hashHex;n.SimpleTSAAdapter.superclass.constructor.call(this),this.params=null,this.serial=0,this.getTSTHex=function(e,t){var i=r(e,t);this.params.econtent.content.messageImprint={alg:t,hash:i},this.params.econtent.content.serial={int:this.serial++};var o=Math.floor(1e9*Math.random());return this.params.econtent.content.nonce={int:o},new n.TimeStampToken(this.params).getContentInfoEncodedHex()},void 0!==e&&(this.params=e)},et(ue.asn1.tsp.SimpleTSAAdapter,ue.asn1.tsp.AbstractTSAAdapter),ue.asn1.tsp.FixedTSAAdapter=function(e){var t=ue,n=t.asn1.tsp,r=t.crypto.Util.hashHex;n.FixedTSAAdapter.superclass.constructor.call(this),this.params=null,this.getTSTHex=function(e,t){var i=r(e,t);return this.params.econtent.content.messageImprint={alg:t,hash:i},new n.TimeStampToken(this.params).getContentInfoEncodedHex()},void 0!==e&&(this.params=e)},et(ue.asn1.tsp.FixedTSAAdapter,ue.asn1.tsp.AbstractTSAAdapter),ue.asn1.tsp.TSPUtil=new function(){},ue.asn1.tsp.TSPUtil.newTimeStampToken=function(e){return new ue.asn1.tsp.TimeStampToken(e)},ue.asn1.tsp.TSPUtil.parseTimeStampReq=function(e){return(new ue.asn1.tsp.TSPParser).getTimeStampReq(e)},ue.asn1.tsp.TSPUtil.parseMessageImprint=function(e){return(new ue.asn1.tsp.TSPParser).getMessageImprint(e)},ue.asn1.tsp.TSPParser=function(){Error;var e=new ot,t=pe,n=t.getV,r=t.getTLV,i=t.getIdxbyList,o=(t.getTLVbyListEx,t.getChildIdx),a=["granted","grantedWithMods","rejection","waiting","revocationWarning","revocationNotification"],s={0:"badAlg",2:"badRequest",5:"badDataFormat",14:"timeNotAvailable",15:"unacceptedPolicy",16:"unacceptedExtension",17:"addInfoNotAvailable",25:"systemFailure"};this.getResponse=function(e){var t=o(e,0);if(1==t.length)return this.getPKIStatusInfo(r(e,t[0]));if(t.length>1){var n=this.getPKIStatusInfo(r(e,t[0])),i=r(e,t[1]),a=this.getToken(i);return a.statusinfo=n,a}},this.getToken=function(e){var t=(new ue.asn1.cms.CMSParser).getCMSSignedData(e);return this.setTSTInfo(t),t},this.setTSTInfo=function(e){var t=e.econtent;if("tstinfo"==t.type){var n=t.content.hex,r=this.getTSTInfo(n);t.content=r}},this.getTSTInfo=function(t){var i={},a=o(t,0),s=n(t,a[1]);i.policy=Ge(s);var u=r(t,a[2]);i.messageImprint=this.getMessageImprint(u);var l=n(t,a[3]);i.serial={hex:l};var c=n(t,a[4]);i.genTime={str:xe(c)};var p=0;if(a.length>5&&"30"==t.substr(a[5],2)){var h=r(t,a[5]);i.accuracy=this.getAccuracy(h),p++}a.length>5+p&&"01"==t.substr(a[5+p],2)&&("ff"==n(t,a[5+p])&&(i.ordering=!0),p++);if(a.length>5+p&&"02"==t.substr(a[5+p],2)){var d=n(t,a[5+p]);i.nonce={hex:d},p++}if(a.length>5+p&&"a0"==t.substr(a[5+p],2)){var f=r(t,a[5+p]);f="30"+f.substr(2),pGeneralNames=e.getGeneralNames(f);var g=pGeneralNames[0].dn;i.tsa=g,p++}if(a.length>5+p&&"a1"==t.substr(a[5+p],2)){var m=r(t,a[5+p]);m="30"+m.substr(2);var v=e.getExtParamArray(m);i.ext=v,p++}return i},this.getAccuracy=function(e){for(var t={},r=o(e,0),i=0;i<r.length;i++){var a=e.substr(r[i],2),s=n(e,r[i]),u=parseInt(s,16);"02"==a?t.seconds=u:"80"==a?t.millis=u:"81"==a&&(t.micros=u)}return t},this.getMessageImprint=function(e){if("30"!=e.substr(0,2))throw new Error("head of messageImprint hex shall be x30");var r={},a=(o(e,0),i(e,0,[0,0])),s=n(e,a),u=t.hextooidstr(s),l=ue.asn1.x509.OID.oid2name(u);if(""==l)throw new Error("hashAlg name undefined: "+u);var c=l,p=i(e,0,[1]);return r.alg=c,r.hash=n(e,p),r},this.getPKIStatusInfo=function(e){var t={},i=o(e,0),s=0;try{var u=n(e,i[0]),l=parseInt(u,16);t.status=a[l]}catch(e){}if(i.length>1&&"30"==e.substr(i[1],2)){var c=r(e,i[1]);t.statusstr=this.getPKIFreeText(c),s++}if(i.length>s&&"03"==e.substr(i[1+s],2)){var p=r(e,i[1+s]);t.failinfo=this.getPKIFailureInfo(p)}return t},this.getPKIFreeText=function(e){for(var n=[],r=o(e,0),i=0;i<r.length;i++)n.push(t.getString(e,r[i]));return n},this.getPKIFailureInfo=function(e){var n=t.getInt(e,0);return null!=s[n]?s[n]:n},this.getTimeStampReq=function(e){var i={certreq:!1},a=o(e,0);if(a.length<2)throw new Error("TimeStampReq must have at least 2 items");var s=r(e,a[1]);i.messageImprint=ue.asn1.tsp.TSPUtil.parseMessageImprint(s);for(var u=2;u<a.length;u++){var l=a[u],c=e.substr(l,2);if("06"==c){var p=n(e,l);i.policy=t.hextooidstr(p)}"02"==c&&(i.nonce=n(e,l)),"01"==c&&(i.certreq=!0)}return i}},void 0!==ue&&ue||(ue={}),void 0!==ue.asn1&&ue.asn1||(ue.asn1={}),void 0!==ue.asn1.cades&&ue.asn1.cades||(ue.asn1.cades={}),ue.asn1.cades.SignaturePolicyIdentifier=function(e){var t=ue.asn1.cades,n=t.SignaturePolicyId;t.SignaturePolicyIdentifier.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.16.2.15",this.params=null,this.getValueArray=function(){return[new n(this.params)]},this.setByParam=function(e){this.params=e},null!=e&&this.setByParam(e)},et(ue.asn1.cades.SignaturePolicyIdentifier,ue.asn1.cms.Attribute),ue.asn1.cades.SignaturePolicyId=function(e){var t=ue.asn1,n=t.DERSequence,r=t.DERObjectIdentifier,i=(t.x509.AlgorithmIdentifier,t.cades),o=i.SignaturePolicyId,a=i.OtherHashAlgAndValue;o.superclass.constructor.call(this),this.params=null,this.tohex=function(){var e=this.params,t=[];return t.push(new r(e.oid)),t.push(new a(e)),new n({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(e){this.params=e},null!=e&&this.setByParam(e)},et(ue.asn1.cades.SignaturePolicyId,ue.asn1.ASN1Object),ue.asn1.cades.OtherHashAlgAndValue=function(e){var t=Error,n=ue.asn1,r=n.DERSequence,i=n.DEROctetString,o=n.x509.AlgorithmIdentifier;n.cades.OtherHashAlgAndValue.superclass.constructor.call(this),this.params=null,this.tohex=function(){var e=this.params;if(null==e.alg)throw new t("property 'alg' not specified");if(null==e.hash&&null==e.cert)throw new t("property 'hash' nor 'cert' not specified");var n=null;if(null!=e.hash)n=e.hash;else if(null!=e.cert){if("string"!=typeof e.cert)throw new t("cert not string");var a=e.cert;-1!=e.cert.indexOf("-----BEGIN")&&(a=Te(e.cert)),n=ue.crypto.Util.hashHex(a,e.alg)}var s=[];return s.push(new o({name:e.alg})),s.push(new i({hex:n})),new r({array:s}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(ue.asn1.cades.OtherHashAlgAndValue,ue.asn1.ASN1Object),ue.asn1.cades.OtherHashValue=function(e){ue.asn1.cades.OtherHashValue.superclass.constructor.call(this);var t=Error,n=ue,r=(n.lang.String.isHex,n.asn1.DEROctetString);n.crypto.Util.hashHex;this.params=null,this.tohex=function(){var e=this.params;if(null==e.hash&&null==e.cert)throw new t("hash or cert not specified");var n=null;if(null!=e.hash)n=e.hash;else if(null!=e.cert){if("string"!=typeof e.cert)throw new t("cert not string");var i=e.cert;-1!=e.cert.indexOf("-----BEGIN")&&(i=Te(e.cert)),n=ue.crypto.Util.hashHex(i,"sha1")}return new r({hex:n}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(ue.asn1.cades.OtherHashValue,ue.asn1.ASN1Object),ue.asn1.cades.SignatureTimeStamp=function(e){var t=Error,n=ue,r=n.lang.String.isHex,i=n.asn1,o=i.ASN1Object;i.x509;i.cades.SignatureTimeStamp.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.16.2.14",this.params=null,this.getValueArray=function(){var e=this.params;if(null!=e.tst){if(r(e.tst))return(i=new o).hTLV=e.tst,[i];if(e.tst instanceof o)return[e.tst];throw new t("params.tst has wrong value")}if(null!=e.res){var n=e.res;if(n instanceof o&&(n=n.tohex()),"string"!=typeof n||!r(n))throw new t("params.res has wrong value");var i;pe.getTLVbyList(n,0,[1]);return(i=new o).hTLV=e.tst,[i]}},null!=e&&this.setByParam(e)},et(ue.asn1.cades.SignatureTimeStamp,ue.asn1.cms.Attribute),ue.asn1.cades.CompleteCertificateRefs=function(e){var t=Error,n=ue,r=n.asn1,i=r.DERSequence,o=r.cades,a=o.OtherCertID,s=n.lang.String.isHex;o.CompleteCertificateRefs.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.16.2.21",this.params=null,this.getValueArray=function(){for(var e=this.params,n=[],r=0;r<e.array.length;r++){var o=e.array[r];if("string"==typeof o)if(-1!=o.indexOf("-----BEGIN"))o={cert:o};else{if(!s(o))throw new t("unsupported value: "+o);o={hash:o}}null!=e.alg&&null==o.alg&&(o.alg=e.alg),null!=e.hasis&&null==o.hasis&&(o.hasis=e.hasis);var u=new a(o);n.push(u)}return[new i({array:n})]},null!=e&&this.setByParam(e)},et(ue.asn1.cades.CompleteCertificateRefs,ue.asn1.cms.Attribute),ue.asn1.cades.OtherCertID=function(e){var t=ue.asn1,n=t.DERSequence,r=t.cms.IssuerSerial,i=t.cades,o=i.OtherHashValue,a=i.OtherHashAlgAndValue;i.OtherCertID.superclass.constructor.call(this),this.params=e,this.tohex=function(){var e=this.params;"string"==typeof e&&(-1!=e.indexOf("-----BEGIN")?e={cert:e}:_isHex(e)&&(e={hash:e}));var t=[],i=null;if(i=null!=e.alg?new a(e):new o(e),t.push(i),null!=e.cert&&1==e.hasis||null!=e.issuer&&null!=e.serial){var s=new r(e);t.push(s)}return new n({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(ue.asn1.cades.OtherCertID,ue.asn1.ASN1Object),ue.asn1.cades.OtherHash=function(e){Error;var t=ue,n=t.asn1,r=(n.cms,n.cades),i=r.OtherHashAlgAndValue,o=r.OtherHashValue,a=(t.crypto.Util.hashHex,t.lang.String.isHex);r.OtherHash.superclass.constructor.call(this),this.params=null,this.tohex=function(){var e=this.params;"string"==typeof e&&(-1!=e.indexOf("-----BEGIN")?e={cert:e}:a(e)&&(e={hash:e}));return(null!=e.alg?new i(e):new o(e)).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(ue.asn1.cades.OtherHash,ue.asn1.ASN1Object),ue.asn1.cades.CAdESUtil=new function(){},ue.asn1.cades.CAdESUtil.parseSignedDataForAddingUnsigned=function(e){return(new ue.asn1.cms.CMSParser).getCMSSignedData(e)},ue.asn1.cades.CAdESUtil.parseSignerInfoForAddingUnsigned=function(e,t,n){var r=pe,i=r.getChildIdx,o=r.getTLV,a=r.getV,s=ue.asn1,u=s.ASN1Object,l=s.cms,c=l.AttributeList,p=l.SignerInfo,h={},d=i(e,t);if(6!=d.length)throw"not supported items for SignerInfo (!=6)";var f=d.shift();h.version=o(e,f);var g=d.shift();h.si=o(e,g);var m=d.shift();h.digalg=o(e,m);var v=d.shift();h.sattrs=o(e,v);var y=d.shift();h.sigalg=o(e,y);var b=d.shift();h.sig=o(e,b),h.sigval=a(e,b);var w=null;return h.obj=new p,(w=new u).hTLV=h.version,h.obj.dCMSVersion=w,(w=new u).hTLV=h.si,h.obj.dSignerIdentifier=w,(w=new u).hTLV=h.digalg,h.obj.dDigestAlgorithm=w,(w=new u).hTLV=h.sattrs,h.obj.dSignedAttrs=w,(w=new u).hTLV=h.sigalg,h.obj.dSigAlg=w,(w=new u).hTLV=h.sig,h.obj.dSig=w,h.obj.dUnsignedAttrs=new c,h},void 0!==ue.asn1.csr&&ue.asn1.csr||(ue.asn1.csr={}),ue.asn1.csr.CertificationRequest=function(e){var t=ue.asn1,n=t.DERBitString,r=t.DERSequence,i=t.csr,o=(t.x509,i.CertificationRequestInfo);i.CertificationRequest.superclass.constructor.call(this),this.setByParam=function(e){this.params=e},this.sign=function(){var e=new o(this.params).tohex(),t=new ue.crypto.Signature({alg:this.params.sigalg});t.init(this.params.sbjprvkey),t.updateHex(e);var n=t.sign();this.params.sighex=n},this.getPEM=function(){return De(this.tohex(),"CERTIFICATE REQUEST")},this.tohex=function(){var e=this.params,t=new ue.asn1.csr.CertificationRequestInfo(this.params),i=new ue.asn1.x509.AlgorithmIdentifier({name:e.sigalg});if(null==e.sighex&&null!=e.sbjprvkey&&this.sign(),null==e.sighex)throw new Error("sighex or sbjprvkey parameter not defined");var o=new n({hex:"00"+e.sighex});return new r({array:[t,i,o]}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},et(ue.asn1.csr.CertificationRequest,ue.asn1.ASN1Object),ue.asn1.csr.CertificationRequestInfo=function(e){var t=ue.asn1,n=(t.DERBitString,t.DERSequence),r=t.DERInteger,i=t.DERUTF8String,o=t.DERTaggedObject,a=t.ASN1Util.newObject,s=t.csr,u=t.x509,l=u.X500Name,c=u.Extensions,p=u.SubjectPublicKeyInfo;s.AttributeList;s.CertificationRequestInfo.superclass.constructor.call(this),this.params=null,this.setByParam=function(e){null!=e&&(this.params=e)},this.tohex=function(){var e=this.params,t=[];if(t.push(new r({int:0})),t.push(new l(e.subject)),t.push(new p(tt.getKey(e.sbjpubkey))),null!=e.attrs){var s=function(e){for(var t=Error,n=ue.asn1.x509.Extensions,r=[],i=0;i<e.length;i++){var o=e[i],a=o.attr;if("extensionRequest"==a){var s={seq:[{oid:"1.2.840.113549.1.9.14"},{set:[new n(o.ext)]}]};r.push(s)}else if("unstructuredName"==a){s={seq:[{oid:"1.2.840.113549.1.9.2"},{set:o.names}]};r.push(s)}else{if("challengePassword"!=a)throw new t("unknown CSR attribute");s={seq:[{oid:"1.2.840.113549.1.9.7"},{set:[{utf8str:o.password}]}]};r.push(s)}}return{set:r}}(e.attrs),u=a({tag:{tage:"a0",obj:s}});t.push(u)}else if(null!=e.extreq){var h=new c(e.extreq);u=a({tag:{tage:"a0",obj:{seq:[{oid:"1.2.840.113549.1.9.14"},{set:[h]}]}}});t.push(u)}else t.push(new o({tag:"a0",explicit:!1,obj:new i({str:""})}));return new n({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(ue.asn1.csr.CertificationRequestInfo,ue.asn1.ASN1Object),ue.asn1.csr.AttributeList=function(e){},et(ue.asn1.csr.AttributeList,ue.asn1.ASN1Object),ue.asn1.csr.CSRUtil=new function(){},ue.asn1.csr.CSRUtil.newCSRPEM=function(e){return new ue.asn1.csr.CertificationRequest(e).getPEM()},ue.asn1.csr.CSRUtil.getParam=function(e,t){var n=pe,r=n.getV,i=n.getIdxbyList,o=n.getTLVbyList,a=n.getTLVbyListEx,s=n.getVbyListEx,u={};if(-1==e.indexOf("-----BEGIN CERTIFICATE REQUEST"))throw new Error("argument is not PEM file");var l=Te(e,"CERTIFICATE REQUEST");t&&(u.tbs=o(l,0,[0]));try{var c=a(l,0,[0,1]);if("3000"==c)u.subject={};else{var p=new ot;u.subject=p.getX500Name(c)}}catch(e){}var h=a(l,0,[0,2]),d=tt.getKey(h,null,"pkcs8pub");u.sbjpubkey=tt.getPEM(d,"PKCS8PUB");var f=function(e){var t=i(e,0,[0,3,0,0],"06");return"2a864886f70d01090e"!=r(e,t)?null:o(e,0,[0,3,0,1,0],"30")}(l);p=new ot;null!=f&&(u.extreq=p.getExtParamArray(f));try{var g=a(l,0,[1],"30");p=new ot;u.sigalg=p.getAlgorithmIdentifierName(g)}catch(e){}try{var m=s(l,0,[2]);u.sighex=m}catch(e){}return u},ue.asn1.csr.CSRUtil.verifySignature=function(e){try{var t=null;if("string"==typeof e&&-1!=e.indexOf("-----BEGIN CERTIFICATE REQUEST")?t=ue.asn1.csr.CSRUtil.getParam(e,!0):"object"==typeof e&&null!=e.sbjpubkey&&null!=e.sigalg&&null!=e.sighex&&null!=e.tbs&&(t=e),null==t)return!1;var n=new ue.crypto.Signature({alg:t.sigalg});return n.init(t.sbjpubkey),n.updateHex(t.tbs),n.verify(t.sighex)}catch(e){return alert(e),!1}},void 0!==ue&&ue||(ue={}),void 0!==ue.asn1&&ue.asn1||(ue.asn1={}),void 0!==ue.asn1.ocsp&&ue.asn1.ocsp||(ue.asn1.ocsp={}),ue.asn1.ocsp.DEFAULT_HASH="sha1",ue.asn1.ocsp.OCSPResponse=function(e){ue.asn1.ocsp.OCSPResponse.superclass.constructor.call(this);ue.asn1.DEREnumerated;var t=ue.asn1.ASN1Util.newObject,n=ue.asn1.ocsp.ResponseBytes,r=["successful","malformedRequest","internalError","tryLater","_not_used_","sigRequired","unauthorized"];this.params=null,this._getStatusCode=function(){var e=this.params.resstatus;return"number"==typeof e?e:"string"!=typeof e?-1:r.indexOf(e)},this.setByParam=function(e){this.params=e},this.tohex=function(){var e=this.params,r=this._getStatusCode();if(-1==r)throw new Error("responseStatus not supported: "+e.resstatus);if(0!=r)return t({seq:[{enum:{int:r}}]}).tohex();var i=new n(e);return t({seq:[{enum:{int:0}},{tag:{tag:"a0",explicit:!0,obj:i}}]}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},et(ue.asn1.ocsp.OCSPResponse,ue.asn1.ASN1Object),ue.asn1.ocsp.ResponseBytes=function(e){ue.asn1.ocsp.ResponseBytes.superclass.constructor.call(this);var t=ue.asn1,n=t.DERSequence,r=t.DERObjectIdentifier,i=t.DEROctetString,o=t.ocsp.BasicOCSPResponse;this.params=null,this.setByParam=function(e){this.params=e},this.tohex=function(){var e=this.params;if("ocspBasic"!=e.restype)throw new Error("not supported responseType: "+e.restype);var t=new o(e),a=[];return a.push(new r({name:"ocspBasic"})),a.push(new i({hex:t.tohex()})),new n({array:a}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},et(ue.asn1.ocsp.ResponseBytes,ue.asn1.ASN1Object),ue.asn1.ocsp.BasicOCSPResponse=function(e){ue.asn1.ocsp.BasicOCSPResponse.superclass.constructor.call(this);var t=Error,n=ue.asn1,r=n.ASN1Object,i=n.DERSequence,o=(n.DERGeneralizedTime,n.DERTaggedObject),a=n.DERBitString,s=(n.x509.Extensions,n.x509.AlgorithmIdentifier),u=n.ocsp;u.ResponderID;_SingleResponseList=u.SingleResponseList,_ResponseData=u.ResponseData,this.params=null,this.setByParam=function(e){this.params=e},this.sign=function(){var e=this.params,t=e.tbsresp.tohex(),n=new ue.crypto.Signature({alg:e.sigalg});n.init(e.reskey),n.updateHex(t),e.sighex=n.sign()},this.tohex=function(){var e=this.params;null==e.tbsresp&&(e.tbsresp=new _ResponseData(e)),null==e.sighex&&null!=e.reskey&&this.sign();var n=[];if(n.push(e.tbsresp),n.push(new s({name:e.sigalg})),n.push(new a({hex:"00"+e.sighex})),null!=e.certs&&null!=e.certs.length){for(var u=[],l=0;l<e.certs.length;l++){var c=e.certs[l],p=null;if(pe.isASN1HEX(c))p=c;else{if(!c.match(/-----BEGIN/))throw new t("certs["+l+"] not hex or PEM");p=Te(c)}u.push(new r({tlv:p}))}var h=new i({array:u});n.push(new o({tag:"a0",explicit:!0,obj:h}))}return new i({array:n}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},et(ue.asn1.ocsp.BasicOCSPResponse,ue.asn1.ASN1Object),ue.asn1.ocsp.ResponseData=function(e){ue.asn1.ocsp.ResponseData.superclass.constructor.call(this);var t=Error,n=ue.asn1,r=n.DERSequence,i=n.DERGeneralizedTime,o=n.DERTaggedObject,a=n.x509.Extensions,s=n.ocsp,u=s.ResponderID;_SingleResponseList=s.SingleResponseList,this.params=null,this.tohex=function(){var e=this.params;null!=e.respid&&new t("respid not specified"),null!=e.prodat&&new t("prodat not specified"),null!=e.array&&new t("array not specified");var n=[];if(n.push(new u(e.respid)),n.push(new i(e.prodat)),n.push(new _SingleResponseList(e.array)),null!=e.ext){var s=new a(e.ext);n.push(new o({tag:"a1",explicit:!0,obj:s}))}return new r({array:n}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(e){this.params=e},void 0!==e&&this.setByParam(e)},et(ue.asn1.ocsp.ResponseData,ue.asn1.ASN1Object),ue.asn1.ocsp.ResponderID=function(e){ue.asn1.ocsp.ResponderID.superclass.constructor.call(this);var t=ue,n=t.asn1,r=n.ASN1Util.newObject,i=n.x509.X500Name,o=t.lang.String.isHex,a=Error;this.params=null,this.tohex=function(){var e=this.params;if(null!=e.key){var t,n=null;if("string"==typeof e.key){if(o(e.key)&&(n=e.key),e.key.match(/-----BEGIN CERTIFICATE/))null!=(t=new ot(e.key).getExtSubjectKeyIdentifier())&&(n=t.kid.hex)}else if(e.key instanceof ot)null!=(t=e.key.getExtSubjectKeyIdentifier())&&(n=t.kid.hex);if(null==n)throw new a("wrong key member value");return r({tag:{tag:"a2",explicit:!0,obj:{octstr:{hex:n}}}}).tohex()}if(null!=e.name){var s=null;if("string"==typeof e.name&&e.name.match(/-----BEGIN CERTIFICATE/))s=new ot(e.name).getSubject();else e.name instanceof ot?s=e.name.getSubject():"object"!=typeof e.name||null==e.name.array&&null==e.name.str||(s=e.name);if(null==s)throw new a("wrong name member value");return r({tag:{tag:"a1",explicit:!0,obj:new i(s)}}).tohex()}throw new a("key or name not specified")},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(e){this.params=e},void 0!==e&&this.setByParam(e)},et(ue.asn1.ocsp.ResponderID,ue.asn1.ASN1Object),ue.asn1.ocsp.SingleResponseList=function(e){ue.asn1.ocsp.SingleResponseList.superclass.constructor.call(this);var t=ue.asn1,n=t.DERSequence,r=t.ocsp.SingleResponse;this.params=null,this.tohex=function(){var e=this.params;if("object"!=typeof e||null==e.length)throw new Error("params not specified properly");for(var t=[],i=0;i<e.length;i++)t.push(new r(e[i]));return new n({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(e){this.params=e},void 0!==e&&this.setByParam(e)},et(ue.asn1.ocsp.SingleResponseList,ue.asn1.ASN1Object),ue.asn1.ocsp.SingleResponse=function(e){var t=Error,n=ue.asn1,r=n.DERSequence,i=n.DERGeneralizedTime,o=n.DERTaggedObject,a=n.ocsp,s=a.CertID,u=a.CertStatus,l=n.x509.Extensions;a.SingleResponse.superclass.constructor.call(this),this.params=null,this.tohex=function(){var e=this.params,n=[];if(null==e.certid)throw new t("certid unspecified");if(null==e.status)throw new t("status unspecified");if(null==e.thisupdate)throw new t("thisupdate unspecified");if(n.push(new s(e.certid)),n.push(new u(e.status)),n.push(new i(e.thisupdate)),null!=e.nextupdate){var a=new i(e.nextupdate);n.push(new o({tag:"a0",explicit:!0,obj:a}))}if(null!=e.ext){var c=new l(e.ext);n.push(new o({tag:"a1",explicit:!0,obj:c}))}return new r({array:n}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(e){this.params=e},void 0!==e&&this.setByParam(e)},et(ue.asn1.ocsp.SingleResponse,ue.asn1.ASN1Object),ue.asn1.ocsp.CertID=function(e){var t=ue,n=t.asn1,r=n.DEROctetString,i=n.DERInteger,o=n.DERSequence,a=n.x509.AlgorithmIdentifier,s=n.ocsp,u=(s.DEFAULT_HASH,t.crypto.Util.hashHex),l=ot,c=pe.getVbyList;s.CertID.superclass.constructor.call(this),this.DEFAULT_HASH="sha1",this.params=null,this.setByValue=function(e,t,n,r){null==r&&(r=this.DEFAULT_HASH),this.params={alg:r,issname:e,isskey:t,sbjsn:n}},this.setByCert=function(e,t,n){null==n&&(n=this.DEFAULT_HASH),this.params={alg:n,issuerCert:e,subjectCert:t}},this.getParamByCerts=function(e,t,n){null==n&&(n=this.DEFAULT_HASH);var r=new l(e),i=new l(t),o=u(r.getSubjectHex(),n),a=r.getPublicKeyHex();return{alg:n,issname:o,isskey:u(c(a,0,[1],"03",!0),n),sbjsn:i.getSerialNumberHex()}},this.tohex=function(){if("object"!=typeof this.params)throw new Error("params not set");var e,t,n,s,u=this.params;if(s=null==u.alg?this.DEFAULT_HASH:u.alg,null!=u.issuerCert&&null!=u.subjectCert){var l=this.getParamByCerts(u.issuerCert,u.subjectCert,s);e=l.issname,t=l.isskey,n=l.sbjsn}else{if(null==u.issname||null==u.isskey||null==u.sbjsn)throw new Error("required param members not defined");e=u.issname,t=u.isskey,n=u.sbjsn}var c=new a({name:s}),p=new r({hex:e}),h=new r({hex:t}),d=new i({hex:n}),f=new o({array:[c,p,h,d]});return this.hTLV=f.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},et(ue.asn1.ocsp.CertID,ue.asn1.ASN1Object),ue.asn1.ocsp.CertStatus=function(e){ue.asn1.ocsp.CertStatus.superclass.constructor.call(this),this.params=null,this.tohex=function(){var e=this.params;if("good"==e.status)return"8000";if("unknown"==e.status)return"8200";if("revoked"==e.status){var t=[{gentime:{str:e.time}}];null!=e.reason&&t.push({tag:{tag:"a0",explicit:!0,obj:{enum:{int:e.reason}}}});var n={tag:"a1",explicit:!1,obj:{seq:t}};return ue.asn1.ASN1Util.newObject({tag:n}).tohex()}throw new Error("bad status")},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(e){this.params=e},void 0!==e&&this.setByParam(e)},et(ue.asn1.ocsp.CertStatus,ue.asn1.ASN1Object),ue.asn1.ocsp.Request=function(e){var t=ue.asn1,n=t.DERSequence,r=t.ocsp;if(r.Request.superclass.constructor.call(this),this.dReqCert=null,this.dExt=null,this.tohex=function(){var e=[];if(null===this.dReqCert)throw"reqCert not set";e.push(this.dReqCert);var t=new n({array:e});return this.hTLV=t.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==e){var i=new r.CertID(e);this.dReqCert=i}},et(ue.asn1.ocsp.Request,ue.asn1.ASN1Object),ue.asn1.ocsp.TBSRequest=function(e){var t=ue.asn1,n=t.DERSequence,r=t.ocsp;r.TBSRequest.superclass.constructor.call(this),this.version=0,this.dRequestorName=null,this.dRequestList=[],this.dRequestExt=null,this.setRequestListByParam=function(e){for(var t=[],n=0;n<e.length;n++){var i=new r.Request(e[0]);t.push(i)}this.dRequestList=t},this.tohex=function(){var e=[];if(0!==this.version)throw"not supported version: "+this.version;if(null!==this.dRequestorName)throw"requestorName not supported";var t=new n({array:this.dRequestList});if(e.push(t),null!==this.dRequestExt)throw"requestExtensions not supported";var r=new n({array:e});return this.hTLV=r.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&void 0!==e.reqList&&this.setRequestListByParam(e.reqList)},et(ue.asn1.ocsp.TBSRequest,ue.asn1.ASN1Object),ue.asn1.ocsp.OCSPRequest=function(e){var t=ue.asn1,n=t.DERSequence,r=t.ocsp;if(r.OCSPRequest.superclass.constructor.call(this),this.dTbsRequest=null,this.dOptionalSignature=null,this.tohex=function(){var e=[];if(null===this.dTbsRequest)throw"tbsRequest not set";if(e.push(this.dTbsRequest),null!==this.dOptionalSignature)throw"optionalSignature not supported";var t=new n({array:e});return this.hTLV=t.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&void 0!==e.reqList){var i=new r.TBSRequest(e);this.dTbsRequest=i}},et(ue.asn1.ocsp.OCSPRequest,ue.asn1.ASN1Object),ue.asn1.ocsp.OCSPUtil={},ue.asn1.ocsp.OCSPUtil.getRequestHex=function(e,t,n){var r=ue.asn1.ocsp;void 0===n&&(n=r.DEFAULT_HASH);var i={alg:n,issuerCert:e,subjectCert:t};return new r.OCSPRequest({reqList:[i]}).tohex()},ue.asn1.ocsp.OCSPUtil.getOCSPResponseInfo=function(e){var t=pe,n=t.getVbyList,r=t.getVbyListEx,i=t.getIdxbyList,o=(t.getIdxbyListEx,t.getV),a={};try{var s=r(e,0,[0],"0a");a.responseStatus=parseInt(s,16)}catch(e){}if(0!==a.responseStatus)return a;try{var u=i(e,0,[1,0,1,0,0,2,0,1]);"80"===e.substr(u,2)?a.certStatus="good":"a1"===e.substr(u,2)?(a.certStatus="revoked",a.revocationTime=xe(n(e,u,[0]))):"82"===e.substr(u,2)&&(a.certStatus="unknown")}catch(e){}try{var l=i(e,0,[1,0,1,0,0,2,0,2]);a.thisUpdate=xe(o(e,l))}catch(e){}try{var c=i(e,0,[1,0,1,0,0,2,0,3]);"a0"===e.substr(c,2)&&(a.nextUpdate=xe(n(e,c,[0])))}catch(e){}return a},ue.asn1.ocsp.OCSPParser=function(){var e=Error,t=ot,n=new t,r=pe,i=r.getV,o=r.getTLV,a=r.getIdxbyList,s=r.getVbyList,u=r.getTLVbyList,l=r.getVbyListEx,c=r.getTLVbyListEx,p=r.getChildIdx;this.getOCSPRequest=function(t){var n=p(t,0);if(1!=n.length&&2!=n.length)throw new e("wrong number elements: "+n.length);return this.getTBSRequest(o(t,n[0]))},this.getTBSRequest=function(e){var t={},r=c(e,0,[0],"30");t.array=this.getRequestList(r);var i=c(e,0,["[2]",0],"30");return null!=i&&(t.ext=n.getExtParamArray(i)),t},this.getRequestList=function(e){for(var t=[],n=p(e,0),r=0;r<n.length;r++){e=o(e,n[r]);t.push(this.getRequest(e))}return t},this.getRequest=function(t){var r=p(t,0);if(1!=r.length&&2!=r.length)throw new e("wrong number elements: "+r.length);var i=this.getCertID(o(t,r[0]));if(2==r.length){var s=a(t,0,[1,0]);i.ext=n.getExtParamArray(o(t,s))}return i},this.getCertID=function(n){var r=p(n,0);if(4!=r.length)throw new e("wrong number elements: "+r.length);var a=new t,s={};return s.alg=a.getAlgorithmIdentifierName(o(n,r[0])),s.issname=i(n,r[1]),s.isskey=i(n,r[2]),s.sbjsn=i(n,r[3]),s},this.getOCSPResponse=function(e){var t,n=p(e,0),r=i(e,n[0]),o=parseInt(r);if(1==n.length)return{resstatus:o};var a=u(e,0,[1,0]);return(t=this.getResponseBytes(a)).resstatus=o,t},this.getResponseBytes=function(e){var t,n=p(e,0),r=u(e,0,[1,0]);t=this.getBasicOCSPResponse(r);var o=i(e,n[0]);return t.restype=ue.asn1.x509.OID.oid2name(Ge(o)),t},this.getBasicOCSPResponse=function(e){var t,n=p(e,0);t=this.getResponseData(o(e,n[0]));var r=new ot;t.alg=r.getAlgorithmIdentifierName(o(e,n[1]));var a=i(e,n[2]);t.sighex=a.substr(2);var s=l(e,0,["[0]"]);if(null!=s){for(var u=p(s,0),c=[],h=0;h<u.length;h++){var d=o(s,u[h]);c.push(d)}t.certs=c}return t},this.getResponseData=function(e){var t=p(e,0),n=t.length,r={},a=0;"a0"==e.substr(t[0],2)&&a++,r.respid=this.getResponderID(o(e,t[a++]));var s=i(e,t[a++]);if(r.prodat=xe(s),r.array=this.getSingleResponseList(o(e,t[a++])),"a1"==e.substr(t[n-1],2)){var l=u(e,t[n-1],[0]),c=new ot;r.ext=c.getExtParamArray(l)}return r},this.getResponderID=function(e){var t={};if("a2"==e.substr(0,2)){var n=s(e,0,[0]);t.key=n}if("a1"==e.substr(0,2)){var r=u(e,0,[0]),i=new ot;t.name=i.getX500Name(r)}return t},this.getSingleResponseList=function(e){for(var t=p(e,0),n=[],r=0;r<t.length;r++){var i=this.getSingleResponse(o(e,t[r]));n.push(i)}return n},this.getSingleResponse=function(e){var t=p(e,0),n={},r=this.getCertID(o(e,t[0]));n.certid=r;var a=this.getCertStatus(o(e,t[1]));if(n.status=a,"18"==e.substr(t[2],2)){var l=i(e,t[2]);n.thisupdate=xe(l)}for(var c=3;c<t.length;c++){if("a0"==e.substr(t[c],2)){var h=s(e,t[c],[0],"18");n.nextupdate=xe(h)}if("a1"==e.substr(t[c],2)){var d=new ot,f=u(e,0,[c,0]);n.ext=d.getExtParamArray(f)}}return n},this.getCertStatus=function(e){var t={};if("8000"==e)return{status:"good"};if("8200"==e)return{status:"unknown"};if("a1"==e.substr(0,2)){t.status="revoked";var n=xe(s(e,0,[0]));t.time=n}return t}},void 0!==ue&&ue||(ue={}),void 0!==ue.lang&&ue.lang||(ue.lang={}),ue.lang.String=function(){},"function"==typeof e?(le=function(t){return me(e.from(t,"utf8").toString("base64"))},ce=function(t){return e.from(ve(t),"base64").toString("utf8")}):(le=function(e){return ye(Oe(He(e)))},ce=function(e){return decodeURIComponent(ke(be(e)))}),ue.lang.String.isInteger=function(e){return!!e.match(/^[0-9]+$/)||!!e.match(/^-[0-9]+$/)},ue.lang.String.isHex=function(e){return Ve(e)},ue.lang.String.isBase64=function(e){return!(!(e=e.replace(/\s+/g,"")).match(/^[0-9A-Za-z+\/]+={0,3}$/)||e.length%4!=0)},ue.lang.String.isBase64URL=function(e){return!e.match(/[+/=]/)&&(e=ve(e),ue.lang.String.isBase64(e))},ue.lang.String.isIntegerArray=function(e){return!!(e=e.replace(/\s+/g,"")).match(/^\[[0-9,]+\]$/)},ue.lang.String.isPrintable=function(e){return null!==e.match(/^[0-9A-Za-z '()+,-./:=?]*$/)},ue.lang.String.isIA5=function(e){return null!==e.match(/^[\x20-\x21\x23-\x7f]*$/)},ue.lang.String.isMail=function(e){return null!==e.match(/^[A-Za-z0-9]{1}[A-Za-z0-9_.-]*@{1}[A-Za-z0-9_.-]{1,}\.[A-Za-z0-9]{1,}$/)};function ze(e){var t=function(e){var t=e.toString(16);return 1==t.length&&(t="0"+t),t},n=function(e){var n="",r=parseInt(e,10).toString(2),i=7-r.length%7;7==i&&(i=0);for(var o="",a=0;a<i;a++)o+="0";r=o+r;for(a=0;a<r.length-1;a+=7){var s=r.substr(a,7);a!=r.length-7&&(s="1"+s),n+=t(parseInt(s,2))}return n};try{if(!e.match(/^[0-9.]+$/))return null;var r="",i=e.split("."),o=40*parseInt(i[0],10)+parseInt(i[1],10);r+=t(o),i.splice(0,2);for(var a=0;a<i.length;a++)r+=n(i[a]);return r}catch(e){return null}}function Ge(e){if(!Ve(e))return null;try{var t=[],n=e.substr(0,2),r=parseInt(n,16);t[0]=new String(Math.floor(r/40)),t[1]=new String(r%40);for(var i=e.substr(2),o=[],a=0;a<i.length/2;a++)o.push(parseInt(i.substr(2*a,2),16));var s=[],u="";for(a=0;a<o.length;a++)128&o[a]?u+=We((127&o[a]).toString(2),7):(u+=We((127&o[a]).toString(2),7),s.push(new String(parseInt(u,2))),u="");var l=t.join(".");return s.length>0&&(l=l+"."+s.join(".")),l}catch(e){return null}}var We=function(e,t,n){return null==n&&(n="0"),e.length>=t?e:new Array(t-e.length+1).join(n)+e};function Ye(e){if(e.length%2!=0)return-1;if(null==(e=e.toLowerCase()).match(/^[0-9a-f]+$/))return-1;try{var t=e.substr(0,2);if("00"==t)return parseInt(e.substr(2),16);var n=parseInt(t,16);if(n>7)return-1;var r=e.substr(2),i=parseInt(r,16).toString(2);"0"==i&&(i="00000000"),i=i.slice(0,0-n);var o=parseInt(i,2);return NaN==o?-1:o}catch(e){return-1}}function Xe(e){if("number"!=typeof e)return null;if(e<0)return null;var t=Number(e).toString(2),n=8-t.length%8;8==n&&(n=0),t+=We("",n,"0");var r=parseInt(t,2).toString(16);return r.length%2==1&&(r="0"+r),"0"+n+r}function Je(e){if("string"!=typeof e)return null;if(e.length%2!=0)return null;if(!e.match(/^[0-9a-f]+$/))return null;try{var t=parseInt(e.substr(0,2),16);if(t<0||7<t)return null;for(var n=e.substr(2),r="",i=0;i<n.length;i+=2){var o=n.substr(i,2),a=parseInt(o,16).toString(2);r+=a=("0000000"+a).slice(-8)}return r.substr(0,r.length-t)}catch(e){return null}}function Ze(e,t){for(var n=0,r=0;r<e.length;r++)n|=1<<t[e[r]];var i=n.toString(2),o="";for(r=i.length-1;r>=0;r--)o+=i[r];return o}function Qe(e,t,n){if("object"==typeof e){t=String(t).split(".");for(var r=0;r<t.length&&e;r++){var i=t[r];i.match(/^[0-9]+$/)&&(i=parseInt(i)),e=e[i]}return e||!1===e?e:n}}function et(e,t){var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e,e.superclass=t.prototype,t.prototype.constructor==Object.prototype.constructor&&(t.prototype.constructor=t)}void 0!==ue&&ue||(ue={}),void 0!==ue.crypto&&ue.crypto||(ue.crypto={}),ue.crypto.Util=new function(){this.DIGESTINFOHEAD={sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",ripemd160:"3021300906052b2403020105000414"},this.DEFAULTPROVIDER={md5:"cryptojs",sha1:"cryptojs",sha224:"cryptojs",sha256:"cryptojs",sha384:"cryptojs",sha512:"cryptojs",ripemd160:"cryptojs",hmacmd5:"cryptojs",hmacsha1:"cryptojs",hmacsha224:"cryptojs",hmacsha256:"cryptojs",hmacsha384:"cryptojs",hmacsha512:"cryptojs",hmacripemd160:"cryptojs",MD5withRSA:"cryptojs/jsrsa",SHA1withRSA:"cryptojs/jsrsa",SHA224withRSA:"cryptojs/jsrsa",SHA256withRSA:"cryptojs/jsrsa",SHA384withRSA:"cryptojs/jsrsa",SHA512withRSA:"cryptojs/jsrsa",RIPEMD160withRSA:"cryptojs/jsrsa",MD5withECDSA:"cryptojs/jsrsa",SHA1withECDSA:"cryptojs/jsrsa",SHA224withECDSA:"cryptojs/jsrsa",SHA256withECDSA:"cryptojs/jsrsa",SHA384withECDSA:"cryptojs/jsrsa",SHA512withECDSA:"cryptojs/jsrsa",RIPEMD160withECDSA:"cryptojs/jsrsa",SHA1withDSA:"cryptojs/jsrsa",SHA224withDSA:"cryptojs/jsrsa",SHA256withDSA:"cryptojs/jsrsa",MD5withRSAandMGF1:"cryptojs/jsrsa",SHAwithRSAandMGF1:"cryptojs/jsrsa",SHA1withRSAandMGF1:"cryptojs/jsrsa",SHA224withRSAandMGF1:"cryptojs/jsrsa",SHA256withRSAandMGF1:"cryptojs/jsrsa",SHA384withRSAandMGF1:"cryptojs/jsrsa",SHA512withRSAandMGF1:"cryptojs/jsrsa",RIPEMD160withRSAandMGF1:"cryptojs/jsrsa"},this.CRYPTOJSMESSAGEDIGESTNAME={md5:g.algo.MD5,sha1:g.algo.SHA1,sha224:g.algo.SHA224,sha256:g.algo.SHA256,sha384:g.algo.SHA384,sha512:g.algo.SHA512,ripemd160:g.algo.RIPEMD160},this.getDigestInfoHex=function(e,t){if(void 0===this.DIGESTINFOHEAD[t])throw"alg not supported in Util.DIGESTINFOHEAD: "+t;return this.DIGESTINFOHEAD[t]+e},this.getPaddedDigestInfoHex=function(e,t,n){var r=this.getDigestInfoHex(e,t),i=n/4;if(r.length+22>i)throw"key is too short for SigAlg: keylen="+n+","+t;for(var o="0001",a="00"+r,s="",u=i-o.length-a.length,l=0;l<u;l+=2)s+="ff";return o+s+a},this.hashString=function(e,t){return new ue.crypto.MessageDigest({alg:t}).digestString(e)},this.hashHex=function(e,t){return new ue.crypto.MessageDigest({alg:t}).digestHex(e)},this.sha1=function(e){return this.hashString(e,"sha1")},this.sha256=function(e){return this.hashString(e,"sha256")},this.sha256Hex=function(e){return this.hashHex(e,"sha256")},this.sha512=function(e){return this.hashString(e,"sha512")},this.sha512Hex=function(e){return this.hashHex(e,"sha512")},this.isKey=function(e){return e instanceof ne||e instanceof ue.crypto.DSA||e instanceof ue.crypto.ECDSA}},ue.crypto.Util.md5=function(e){return new ue.crypto.MessageDigest({alg:"md5",prov:"cryptojs"}).digestString(e)},ue.crypto.Util.ripemd160=function(e){return new ue.crypto.MessageDigest({alg:"ripemd160",prov:"cryptojs"}).digestString(e)},ue.crypto.Util.SECURERANDOMGEN=new Q,ue.crypto.Util.getRandomHexOfNbytes=function(e){var t=new Array(e);return ue.crypto.Util.SECURERANDOMGEN.nextBytes(t),fe(t)},ue.crypto.Util.getRandomBigIntegerOfNbytes=function(e){return new x(ue.crypto.Util.getRandomHexOfNbytes(e),16)},ue.crypto.Util.getRandomHexOfNbits=function(e){var t=e%8,n=new Array((e-t)/8+1);return ue.crypto.Util.SECURERANDOMGEN.nextBytes(n),n[0]=(255<<t&255^255)&n[0],fe(n)},ue.crypto.Util.getRandomBigIntegerOfNbits=function(e){return new x(ue.crypto.Util.getRandomHexOfNbits(e),16)},ue.crypto.Util.getRandomBigIntegerZeroToMax=function(e){for(var t=e.bitLength();;){var n=ue.crypto.Util.getRandomBigIntegerOfNbits(t);if(-1!=e.compareTo(n))return n}},ue.crypto.Util.getRandomBigIntegerMinToMax=function(e,t){var n=e.compareTo(t);if(1==n)throw"biMin is greater than biMax";if(0==n)return e;var r=t.subtract(e);return ue.crypto.Util.getRandomBigIntegerZeroToMax(r).add(e)},ue.crypto.MessageDigest=function(e){this.setAlgAndProvider=function(e,t){if(null!==(e=ue.crypto.MessageDigest.getCanonicalAlgName(e))&&void 0===t&&(t=ue.crypto.Util.DEFAULTPROVIDER[e]),-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(e)&&"cryptojs"==t){try{this.md=ue.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[e].create()}catch(t){throw"setAlgAndProvider hash alg set fail alg="+e+"/"+t}this.updateString=function(e){this.md.update(e)},this.updateHex=function(e){var t=g.enc.Hex.parse(e);this.md.update(t)},this.digest=function(){return this.md.finalize().toString(g.enc.Hex)},this.digestString=function(e){return this.updateString(e),this.digest()},this.digestHex=function(e){return this.updateHex(e),this.digest()}}if(-1!=":sha256:".indexOf(e)&&"sjcl"==t){try{this.md=new sjcl.hash.sha256}catch(t){throw"setAlgAndProvider hash alg set fail alg="+e+"/"+t}this.updateString=function(e){this.md.update(e)},this.updateHex=function(e){var t=sjcl.codec.hex.toBits(e);this.md.update(t)},this.digest=function(){var e=this.md.finalize();return sjcl.codec.hex.fromBits(e)},this.digestString=function(e){return this.updateString(e),this.digest()},this.digestHex=function(e){return this.updateHex(e),this.digest()}}},this.updateString=function(e){throw"updateString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.updateHex=function(e){throw"updateHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digest=function(){throw"digest() not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestString=function(e){throw"digestString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestHex=function(e){throw"digestHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},void 0!==e&&void 0!==e.alg&&(this.algName=e.alg,void 0===e.prov&&(this.provName=ue.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName))},ue.crypto.MessageDigest.getCanonicalAlgName=function(e){return"string"==typeof e&&(e=(e=e.toLowerCase()).replace(/-/,"")),e},ue.crypto.MessageDigest.getHashLength=function(e){var t=ue.crypto.MessageDigest,n=t.getCanonicalAlgName(e);if(void 0===t.HASHLENGTH[n])throw"not supported algorithm: "+e;return t.HASHLENGTH[n]},ue.crypto.MessageDigest.HASHLENGTH={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,ripemd160:20},ue.crypto.Mac=function(e){this.setAlgAndProvider=function(e,t){if(null==(e=e.toLowerCase())&&(e="hmacsha1"),"hmac"!=(e=e.toLowerCase()).substr(0,4))throw"setAlgAndProvider unsupported HMAC alg: "+e;void 0===t&&(t=ue.crypto.Util.DEFAULTPROVIDER[e]),this.algProv=e+"/"+t;var n=e.substr(4);if(-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(n)&&"cryptojs"==t){try{var r=ue.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[n];this.mac=g.algo.HMAC.create(r,this.pass)}catch(e){throw"setAlgAndProvider hash alg set fail hashAlg="+n+"/"+e}this.updateString=function(e){this.mac.update(e)},this.updateHex=function(e){var t=g.enc.Hex.parse(e);this.mac.update(t)},this.doFinal=function(){return this.mac.finalize().toString(g.enc.Hex)},this.doFinalString=function(e){return this.updateString(e),this.doFinal()},this.doFinalHex=function(e){return this.updateHex(e),this.doFinal()}}},this.updateString=function(e){throw"updateString(str) not supported for this alg/prov: "+this.algProv},this.updateHex=function(e){throw"updateHex(hex) not supported for this alg/prov: "+this.algProv},this.doFinal=function(){throw"digest() not supported for this alg/prov: "+this.algProv},this.doFinalString=function(e){throw"digestString(str) not supported for this alg/prov: "+this.algProv},this.doFinalHex=function(e){throw"digestHex(hex) not supported for this alg/prov: "+this.algProv},this.setPassword=function(e){if("string"==typeof e){var t=e;return e.length%2!=1&&e.match(/^[0-9A-Fa-f]+$/)||(t=Ae(e)),void(this.pass=g.enc.Hex.parse(t))}if("object"!=typeof e)throw"KJUR.crypto.Mac unsupported password type: "+e;t=null;if(void 0!==e.hex){if(e.hex.length%2!=0||!e.hex.match(/^[0-9A-Fa-f]+$/))throw"Mac: wrong hex password: "+e.hex;t=e.hex}if(void 0!==e.utf8&&(t=we(e.utf8)),void 0!==e.rstr&&(t=Ae(e.rstr)),void 0!==e.b64&&(t=b(e.b64)),void 0!==e.b64u&&(t=be(e.b64u)),null==t)throw"KJUR.crypto.Mac unsupported password type: "+e;this.pass=g.enc.Hex.parse(t)},void 0!==e&&(void 0!==e.pass&&this.setPassword(e.pass),void 0!==e.alg&&(this.algName=e.alg,void 0===e.prov&&(this.provName=ue.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName)))},ue.crypto.Signature=function(e){var t=null;if(this._setAlgNames=function(){var e=this.algName.match(/^(.+)with(.+)$/);e&&(this.mdAlgName=e[1].toLowerCase(),this.pubkeyAlgName=e[2].toLowerCase(),"rsaandmgf1"==this.pubkeyAlgName&&"sha"==this.mdAlgName&&(this.mdAlgName="sha1"))},this._zeroPaddingOfSignature=function(e,t){for(var n="",r=t/4-e.length,i=0;i<r;i++)n+="0";return n+e},this.setAlgAndProvider=function(e,t){if(this._setAlgNames(),"cryptojs/jsrsa"!=t)throw new Error("provider not supported: "+t);if(-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(this.mdAlgName)){try{this.md=new ue.crypto.MessageDigest({alg:this.mdAlgName})}catch(e){throw new Error("setAlgAndProvider hash alg set fail alg="+this.mdAlgName+"/"+e)}this.init=function(e,t){var n=null;try{n=void 0===t?tt.getKey(e):tt.getKey(e,t)}catch(e){throw"init failed:"+e}if(!0===n.isPrivate)this.prvKey=n,this.state="SIGN";else{if(!0!==n.isPublic)throw"init failed.:"+n;this.pubKey=n,this.state="VERIFY"}},this.updateString=function(e){this.md.updateString(e)},this.updateHex=function(e){this.md.updateHex(e)},this.sign=function(){if(this.sHashHex=this.md.digest(),void 0===this.prvKey&&void 0!==this.ecprvhex&&void 0!==this.eccurvename&&void 0!==ue.crypto.ECDSA&&(this.prvKey=new ue.crypto.ECDSA({curve:this.eccurvename,prv:this.ecprvhex})),this.prvKey instanceof ne&&"rsaandmgf1"===this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHashPSS(this.sHashHex,this.mdAlgName,this.pssSaltLen);else if(this.prvKey instanceof ne&&"rsa"===this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex,this.mdAlgName);else if(this.prvKey instanceof ue.crypto.ECDSA)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex);else{if(!(this.prvKey instanceof ue.crypto.DSA))throw"Signature: unsupported private key alg: "+this.pubkeyAlgName;this.hSign=this.prvKey.signWithMessageHash(this.sHashHex)}return this.hSign},this.signString=function(e){return this.updateString(e),this.sign()},this.signHex=function(e){return this.updateHex(e),this.sign()},this.verify=function(e){if(this.sHashHex=this.md.digest(),void 0===this.pubKey&&void 0!==this.ecpubhex&&void 0!==this.eccurvename&&void 0!==ue.crypto.ECDSA&&(this.pubKey=new ue.crypto.ECDSA({curve:this.eccurvename,pub:this.ecpubhex})),this.pubKey instanceof ne&&"rsaandmgf1"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHashPSS(this.sHashHex,e,this.mdAlgName,this.pssSaltLen);if(this.pubKey instanceof ne&&"rsa"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHash(this.sHashHex,e);if(void 0!==ue.crypto.ECDSA&&this.pubKey instanceof ue.crypto.ECDSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,e);if(void 0!==ue.crypto.DSA&&this.pubKey instanceof ue.crypto.DSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,e);throw"Signature: unsupported public key alg: "+this.pubkeyAlgName}}},this.init=function(e,t){throw"init(key, pass) not supported for this alg:prov="+this.algProvName},this.updateString=function(e){throw"updateString(str) not supported for this alg:prov="+this.algProvName},this.updateHex=function(e){throw"updateHex(hex) not supported for this alg:prov="+this.algProvName},this.sign=function(){throw"sign() not supported for this alg:prov="+this.algProvName},this.signString=function(e){throw"digestString(str) not supported for this alg:prov="+this.algProvName},this.signHex=function(e){throw"digestHex(hex) not supported for this alg:prov="+this.algProvName},this.verify=function(e){throw"verify(hSigVal) not supported for this alg:prov="+this.algProvName},this.initParams=e,void 0!==e&&(void 0!==e.alg&&(this.algName=e.alg,void 0===e.prov?this.provName=ue.crypto.Util.DEFAULTPROVIDER[this.algName]:this.provName=e.prov,this.algProvName=this.algName+":"+this.provName,this.setAlgAndProvider(this.algName,this.provName),this._setAlgNames()),void 0!==e.psssaltlen&&(this.pssSaltLen=e.psssaltlen),void 0!==e.prvkeypem)){if(void 0!==e.prvkeypas)throw"both prvkeypem and prvkeypas parameters not supported";try{t=tt.getKey(e.prvkeypem);this.init(t)}catch(e){throw"fatal error to load pem private key: "+e}}},ue.crypto.Cipher=function(e){},ue.crypto.Cipher.encrypt=function(e,t,n){if(t instanceof ne&&t.isPublic){var r=ue.crypto.Cipher.getAlgByKeyAndName(t,n);if("RSA"===r)return t.encrypt(e);if("RSAOAEP"===r)return t.encryptOAEP(e,"sha1");var i=r.match(/^RSAOAEP(\d+)$/);if(null!==i)return t.encryptOAEP(e,"sha"+i[1]);throw"Cipher.encrypt: unsupported algorithm for RSAKey: "+n}throw"Cipher.encrypt: unsupported key or algorithm"},ue.crypto.Cipher.decrypt=function(e,t,n){if(t instanceof ne&&t.isPrivate){var r=ue.crypto.Cipher.getAlgByKeyAndName(t,n);if("RSA"===r)return t.decrypt(e);if("RSAOAEP"===r)return t.decryptOAEP(e,"sha1");var i=r.match(/^RSAOAEP(\d+)$/);if(null!==i)return t.decryptOAEP(e,"sha"+i[1]);throw"Cipher.decrypt: unsupported algorithm for RSAKey: "+n}throw"Cipher.decrypt: unsupported key or algorithm"},ue.crypto.Cipher.getAlgByKeyAndName=function(e,t){if(e instanceof ne){if(-1!=":RSA:RSAOAEP:RSAOAEP224:RSAOAEP256:RSAOAEP384:RSAOAEP512:".indexOf(t))return t;if(null==t)return"RSA";throw"getAlgByKeyAndName: not supported algorithm name for RSAKey: "+t}throw"getAlgByKeyAndName: not supported algorithm name: "+t},ue.crypto.OID=new function(){this.oidhex2name={"2a864886f70d010101":"rsaEncryption","2a8648ce3d0201":"ecPublicKey","2a8648ce380401":"dsa","2a8648ce3d030107":"secp256r1","2b8104001f":"secp192k1","2b81040021":"secp224r1","2b8104000a":"secp256k1","2b81040022":"secp384r1","2b81040023":"secp521r1","2a8648ce380403":"SHA1withDSA","608648016503040301":"SHA224withDSA","608648016503040302":"SHA256withDSA"}},void 0!==ue&&ue||(ue={}),void 0!==ue.crypto&&ue.crypto||(ue.crypto={}),ue.crypto.ECDSA=function(e){var t=Error,n=x,r=oe,i=ue.crypto.ECDSA,o=ue.crypto.ECParameterDB,a=i.getName,s=pe,u=s.getVbyListEx,l=s.isASN1HEX,c=new Q;this.type="EC",this.isPrivate=!1,this.isPublic=!1,this.getBigRandom=function(e){return new n(e.bitLength(),c).mod(e.subtract(n.ONE)).add(n.ONE)},this.setNamedCurve=function(e){this.ecparams=o.getByName(e),this.prvKeyHex=null,this.pubKeyHex=null,this.curveName=e},this.setPrivateKeyHex=function(e){this.isPrivate=!0,this.prvKeyHex=e},this.setPublicKeyHex=function(e){this.isPublic=!0,this.pubKeyHex=e},this.getPublicKeyXYHex=function(){var e=this.pubKeyHex;if("04"!==e.substr(0,2))throw"this method supports uncompressed format(04) only";var t=this.ecparams.keycharlen;if(e.length!==2+2*t)throw"malformed public key hex length";var n={};return n.x=e.substr(2,t),n.y=e.substr(2+t),n},this.getShortNISTPCurveName=function(){var e=this.curveName;return"secp256r1"===e||"NIST P-256"===e||"P-256"===e||"prime256v1"===e?"P-256":"secp384r1"===e||"NIST P-384"===e||"P-384"===e?"P-384":"secp521r1"===e||"NIST P-521"===e||"P-521"===e?"P-521":null},this.generateKeyPairHex=function(){var e=this.ecparams.n,t=this.getBigRandom(e),n=this.ecparams.keycharlen,r=("0000000000"+t.toString(16)).slice(-n);return this.setPrivateKeyHex(r),{ecprvhex:r,ecpubhex:this.generatePublicKeyHex()}},this.generatePublicKeyHex=function(){var e=new n(this.prvKeyHex,16),t=this.ecparams.G.multiply(e),r=t.getX().toBigInteger(),i=t.getY().toBigInteger(),o=this.ecparams.keycharlen,a="04"+("0000000000"+r.toString(16)).slice(-o)+("0000000000"+i.toString(16)).slice(-o);return this.setPublicKeyHex(a),a},this.signWithMessageHash=function(e){return this.signHex(e,this.prvKeyHex)},this.signHex=function(e,t){var r=new n(t,16),o=this.ecparams.n,a=new n(e.substring(0,this.ecparams.keycharlen),16);do{var s=this.getBigRandom(o),u=this.ecparams.G.multiply(s).getX().toBigInteger().mod(o)}while(u.compareTo(n.ZERO)<=0);var l=s.modInverse(o).multiply(a.add(r.multiply(u))).mod(o);return i.biRSSigToASN1Sig(u,l)},this.sign=function(e,t){var r=t,i=this.ecparams.n,o=n.fromByteArrayUnsigned(e);do{var a=this.getBigRandom(i),s=this.ecparams.G.multiply(a).getX().toBigInteger().mod(i)}while(s.compareTo(x.ZERO)<=0);var u=a.modInverse(i).multiply(o.add(r.multiply(s))).mod(i);return this.serializeSig(s,u)},this.verifyWithMessageHash=function(e,t){return this.verifyHex(e,t,this.pubKeyHex)},this.verifyHex=function(e,t,o){try{var a,s,u=i.parseSigHex(t);a=u.r,s=u.s;var l=r.decodeFromHex(this.ecparams.curve,o),c=new n(e.substring(0,this.ecparams.keycharlen),16);return this.verifyRaw(c,a,s,l)}catch(e){return!1}},this.verify=function(e,t,i){var o,a,s;if(Bitcoin.Util.isArray(t)){var u=this.parseSig(t);o=u.r,a=u.s}else{if("object"!=typeof t||!t.r||!t.s)throw"Invalid value for signature";o=t.r,a=t.s}if(i instanceof oe)s=i;else{if(!Bitcoin.Util.isArray(i))throw"Invalid format for pubkey value, must be byte array or ECPointFp";s=r.decodeFrom(this.ecparams.curve,i)}var l=n.fromByteArrayUnsigned(e);return this.verifyRaw(l,o,a,s)},this.verifyRaw=function(e,t,r,i){var o=this.ecparams.n,a=this.ecparams.G;if(t.compareTo(n.ONE)<0||t.compareTo(o)>=0)return!1;if(r.compareTo(n.ONE)<0||r.compareTo(o)>=0)return!1;var s=r.modInverse(o),u=e.multiply(s).mod(o),l=t.multiply(s).mod(o);return a.multiply(u).add(i.multiply(l)).getX().toBigInteger().mod(o).equals(t)},this.serializeSig=function(e,t){var n=e.toByteArraySigned(),r=t.toByteArraySigned(),i=[];return i.push(2),i.push(n.length),(i=i.concat(n)).push(2),i.push(r.length),(i=i.concat(r)).unshift(i.length),i.unshift(48),i},this.parseSig=function(e){var t;if(48!=e[0])throw new Error("Signature not a valid DERSequence");if(2!=e[t=2])throw new Error("First element in signature must be a DERInteger");var r=e.slice(t+2,t+2+e[t+1]);if(2!=e[t+=2+e[t+1]])throw new Error("Second element in signature must be a DERInteger");var i=e.slice(t+2,t+2+e[t+1]);return t+=2+e[t+1],{r:n.fromByteArrayUnsigned(r),s:n.fromByteArrayUnsigned(i)}},this.parseSigCompact=function(e){if(65!==e.length)throw"Signature has the wrong length";var t=e[0]-27;if(t<0||t>7)throw"Invalid signature type";var r=this.ecparams.n;return{r:n.fromByteArrayUnsigned(e.slice(1,33)).mod(r),s:n.fromByteArrayUnsigned(e.slice(33,65)).mod(r),i:t}},this.readPKCS5PrvKeyHex=function(e){if(!1===l(e))throw new Error("not ASN.1 hex string");var t,n,r;try{t=u(e,0,["[0]",0],"06"),n=u(e,0,[1],"04");try{r=u(e,0,["[1]",0],"03")}catch(e){}}catch(e){throw new Error("malformed PKCS#1/5 plain ECC private key")}if(this.curveName=a(t),void 0===this.curveName)throw"unsupported curve name";this.setNamedCurve(this.curveName),this.setPublicKeyHex(r),this.setPrivateKeyHex(n),this.isPublic=!1},this.readPKCS8PrvKeyHex=function(e){if(!1===l(e))throw new t("not ASN.1 hex string");var n,r,i;try{u(e,0,[1,0],"06"),n=u(e,0,[1,1],"06"),r=u(e,0,[2,0,1],"04");try{i=u(e,0,[2,0,"[1]",0],"03")}catch(e){}}catch(e){throw new t("malformed PKCS#8 plain ECC private key")}if(this.curveName=a(n),void 0===this.curveName)throw new t("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(i),this.setPrivateKeyHex(r),this.isPublic=!1},this.readPKCS8PubKeyHex=function(e){if(!1===l(e))throw new t("not ASN.1 hex string");var n,r;try{u(e,0,[0,0],"06"),n=u(e,0,[0,1],"06"),r=u(e,0,[1],"03")}catch(e){throw new t("malformed PKCS#8 ECC public key")}if(this.curveName=a(n),null===this.curveName)throw new t("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(r)},this.readCertPubKeyHex=function(e,n){if(!1===l(e))throw new t("not ASN.1 hex string");var r,i;try{r=u(e,0,[0,5,0,1],"06"),i=u(e,0,[0,5,1],"03")}catch(e){throw new t("malformed X.509 certificate ECC public key")}if(this.curveName=a(r),null===this.curveName)throw new t("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(i)},void 0!==e&&void 0!==e.curve&&(this.curveName=e.curve),void 0===this.curveName&&(this.curveName="secp256r1"),this.setNamedCurve(this.curveName),void 0!==e&&(void 0!==e.prv&&this.setPrivateKeyHex(e.prv),void 0!==e.pub&&this.setPublicKeyHex(e.pub))},ue.crypto.ECDSA.parseSigHex=function(e){var t=ue.crypto.ECDSA.parseSigHexInHexRS(e);return{r:new x(t.r,16),s:new x(t.s,16)}},ue.crypto.ECDSA.parseSigHexInHexRS=function(e){var t=pe,n=t.getChildIdx,r=t.getV;if(t.checkStrictDER(e,0),"30"!=e.substr(0,2))throw new Error("signature is not a ASN.1 sequence");var i=n(e,0);if(2!=i.length)throw new Error("signature shall have two elements");var o=i[0],a=i[1];if("02"!=e.substr(o,2))throw new Error("1st item not ASN.1 integer");if("02"!=e.substr(a,2))throw new Error("2nd item not ASN.1 integer");return{r:r(e,o),s:r(e,a)}},ue.crypto.ECDSA.asn1SigToConcatSig=function(e){var t=ue.crypto.ECDSA.parseSigHexInHexRS(e),n=t.r,r=t.s;if(n.length>=130&&n.length<=134){if(n.length%2!=0)throw Error("unknown ECDSA sig r length error");if(r.length%2!=0)throw Error("unknown ECDSA sig s length error");"00"==n.substr(0,2)&&(n=n.substr(2)),"00"==r.substr(0,2)&&(r=r.substr(2));var i=Math.max(n.length,r.length);return(n=("000000"+n).slice(-i))+(r=("000000"+r).slice(-i))}if("00"==n.substr(0,2)&&n.length%32==2&&(n=n.substr(2)),"00"==r.substr(0,2)&&r.length%32==2&&(r=r.substr(2)),n.length%32==30&&(n="00"+n),r.length%32==30&&(r="00"+r),n.length%32!=0)throw Error("unknown ECDSA sig r length error");if(r.length%32!=0)throw Error("unknown ECDSA sig s length error");return n+r},ue.crypto.ECDSA.concatSigToASN1Sig=function(e){if(e.length%4!=0)throw Error("unknown ECDSA concatinated r-s sig length error");var t=e.substr(0,e.length/2),n=e.substr(e.length/2);return ue.crypto.ECDSA.hexRSSigToASN1Sig(t,n)},ue.crypto.ECDSA.hexRSSigToASN1Sig=function(e,t){var n=new x(e,16),r=new x(t,16);return ue.crypto.ECDSA.biRSSigToASN1Sig(n,r)},ue.crypto.ECDSA.biRSSigToASN1Sig=function(e,t){var n=ue.asn1,r=new n.DERInteger({bigint:e}),i=new n.DERInteger({bigint:t});return new n.DERSequence({array:[r,i]}).tohex()},ue.crypto.ECDSA.getName=function(e){return"2b8104001f"===e?"secp192k1":"2a8648ce3d030107"===e?"secp256r1":"2b8104000a"===e?"secp256k1":"2b81040021"===e?"secp224r1":"2b81040022"===e?"secp384r1":"2b81040023"===e?"secp521r1":-1!=="|secp256r1|NIST P-256|P-256|prime256v1|".indexOf(e)?"secp256r1":-1!=="|secp256k1|".indexOf(e)?"secp256k1":-1!=="|secp224r1|NIST P-224|P-224|".indexOf(e)?"secp224r1":-1!=="|secp384r1|NIST P-384|P-384|".indexOf(e)?"secp384r1":-1!=="|secp521r1|NIST P-521|P-521|".indexOf(e)?"secp521r1":null},void 0!==ue&&ue||(ue={}),void 0!==ue.crypto&&ue.crypto||(ue.crypto={}),ue.crypto.ECParameterDB=new function(){var e={},t={};function n(e){return new x(e,16)}this.getByName=function(n){var r=n;if(void 0!==t[r]&&(r=t[n]),void 0!==e[r])return e[r];throw"unregistered EC curve name: "+r},this.regist=function(r,i,o,a,s,u,l,c,p,h,d,f){e[r]={};var g=n(o),m=n(a),v=n(s),y=n(u),b=n(l),w=new ae(g,m,v),x=w.decodePointHex("04"+c+p);e[r].name=r,e[r].keylen=i,e[r].keycharlen=2*Math.ceil(i/8),e[r].curve=w,e[r].G=x,e[r].n=y,e[r].h=b,e[r].oid=d,e[r].info=f;for(var S=0;S<h.length;S++)t[h[S]]=r}},ue.crypto.ECParameterDB.regist("secp128r1",128,"FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF","FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC","E87579C11079F43DD824993C2CEE5ED3","FFFFFFFE0000000075A30D1B9038A115","1","161FF7528B899B2D0C28607CA52C5B86","CF5AC8395BAFEB13C02DA292DDED7A83",[],"","secp128r1 : SECG curve over a 128 bit prime field"),ue.crypto.ECParameterDB.regist("secp160k1",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73","0","7","0100000000000000000001B8FA16DFAB9ACA16B6B3","1","3B4C382CE37AA192A4019E763036F4F5DD4D7EBB","938CF935318FDCED6BC28286531733C3F03C4FEE",[],"","secp160k1 : SECG curve over a 160 bit prime field"),ue.crypto.ECParameterDB.regist("secp160r1",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC","1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45","0100000000000000000001F4C8F927AED3CA752257","1","4A96B5688EF573284664698968C38BB913CBFC82","23A628553168947D59DCC912042351377AC5FB32",[],"","secp160r1 : SECG curve over a 160 bit prime field"),ue.crypto.ECParameterDB.regist("secp192k1",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37","0","3","FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D","1","DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D","9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D",[]),ue.crypto.ECParameterDB.regist("secp192r1",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC","64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1","FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831","1","188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012","07192B95FFC8DA78631011ED6B24CDD573F977A11E794811",[]),ue.crypto.ECParameterDB.regist("secp224r1",224,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE","B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4","FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D","1","B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21","BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34",[]),ue.crypto.ECParameterDB.regist("secp256k1",256,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F","0","7","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141","1","79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798","483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8",[]),ue.crypto.ECParameterDB.regist("secp256r1",256,"FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF","FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC","5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B","FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551","1","6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296","4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5",["NIST P-256","P-256","prime256v1"]),ue.crypto.ECParameterDB.regist("secp384r1",384,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFC","B3312FA7E23EE7E4988E056BE3F82D19181D9C6EFE8141120314088F5013875AC656398D8A2ED19D2A85C8EDD3EC2AEF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973","1","AA87CA22BE8B05378EB1C71EF320AD746E1D3B628BA79B9859F741E082542A385502F25DBF55296C3A545E3872760AB7","3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f",["NIST P-384","P-384"]),ue.crypto.ECParameterDB.regist("secp521r1",521,"1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF","1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC","051953EB9618E1C9A1F929A21A0B68540EEA2DA725B99B315F3B8B489918EF109E156193951EC7E937B1652C0BD3BB1BF073573DF883D2C34F1EF451FD46B503F00","1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409","1","00C6858E06B70404E9CD9E3ECB662395B4429C648139053FB521F828AF606B4D3DBAA14B5E77EFE75928FE1DC127A2FFA8DE3348B3C1856A429BF97E7E31C2E5BD66","011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650",["NIST P-521","P-521"]),void 0!==ue&&ue||(ue={}),void 0!==ue.crypto&&ue.crypto||(ue.crypto={}),ue.crypto.DSA=function(){var e=pe,t=(e.getVbyList,e.getVbyListEx),n=e.isASN1HEX,r=x;this.p=null,this.q=null,this.g=null,this.y=null,this.x=null,this.type="DSA",this.isPrivate=!1,this.isPublic=!1,this.setPrivate=function(e,t,n,r,i){this.isPrivate=!0,this.p=e,this.q=t,this.g=n,this.y=r,this.x=i},this.setPrivateHex=function(e,t,n,r,i){var o,a,s,u,l;o=new x(e,16),a=new x(t,16),s=new x(n,16),u="string"==typeof r&&r.length>1?new x(r,16):null,l=new x(i,16),this.setPrivate(o,a,s,u,l)},this.setPublic=function(e,t,n,r){this.isPublic=!0,this.p=e,this.q=t,this.g=n,this.y=r,this.x=null},this.setPublicHex=function(e,t,n,r){var i,o,a,s;i=new x(e,16),o=new x(t,16),a=new x(n,16),s=new x(r,16),this.setPublic(i,o,a,s)},this.signWithMessageHash=function(e){var t=this.p,n=this.q,r=this.g,i=(this.y,this.x),o=ue.crypto.Util.getRandomBigIntegerMinToMax(x.ONE.add(x.ONE),n.subtract(x.ONE)),a=new x(e.substr(0,n.bitLength()/4),16),s=r.modPow(o,t).mod(n),u=o.modInverse(n).multiply(a.add(i.multiply(s))).mod(n);return ue.asn1.ASN1Util.jsonToASN1HEX({seq:[{int:{bigint:s}},{int:{bigint:u}}]})},this.verifyWithMessageHash=function(e,t){var n=this.p,r=this.q,i=this.g,o=this.y,a=this.parseASN1Signature(t),s=a[0],u=a[1],l=new x(e.substr(0,r.bitLength()/4),16);if(x.ZERO.compareTo(s)>0||s.compareTo(r)>0)throw"invalid DSA signature";if(x.ZERO.compareTo(u)>=0||u.compareTo(r)>0)throw"invalid DSA signature";var c=u.modInverse(r),p=l.multiply(c).mod(r),h=s.multiply(c).mod(r);return 0==i.modPow(p,n).multiply(o.modPow(h,n)).mod(n).mod(r).compareTo(s)},this.parseASN1Signature=function(e){try{return[new r(t(e,0,[0],"02"),16),new r(t(e,0,[1],"02"),16)]}catch(e){throw new Error("malformed ASN.1 DSA signature")}},this.readPKCS5PrvKeyHex=function(e){var r,i,o,a,s;if(!1===n(e))throw new Error("not ASN.1 hex string");try{r=t(e,0,[1],"02"),i=t(e,0,[2],"02"),o=t(e,0,[3],"02"),a=t(e,0,[4],"02"),s=t(e,0,[5],"02")}catch(e){throw new Error("malformed PKCS#1/5 plain DSA private key")}this.setPrivateHex(r,i,o,a,s)},this.readPKCS8PrvKeyHex=function(e){var r,i,o,a;if(!1===n(e))throw new Error("not ASN.1 hex string");try{r=t(e,0,[1,1,0],"02"),i=t(e,0,[1,1,1],"02"),o=t(e,0,[1,1,2],"02"),a=t(e,0,[2,0],"02")}catch(e){throw new Error("malformed PKCS#8 plain DSA private key")}this.setPrivateHex(r,i,o,null,a)},this.readPKCS8PubKeyHex=function(e){var r,i,o,a;if(!1===n(e))throw new Error("not ASN.1 hex string");try{r=t(e,0,[0,1,0],"02"),i=t(e,0,[0,1,1],"02"),o=t(e,0,[0,1,2],"02"),a=t(e,0,[1,0],"02")}catch(e){throw new Error("malformed PKCS#8 DSA public key")}this.setPublicHex(r,i,o,a)},this.readCertPubKeyHex=function(e,r){var i,o,a,s;if(!1===n(e))throw new Error("not ASN.1 hex string");try{i=t(e,0,[0,5,0,1,0],"02"),o=t(e,0,[0,5,0,1,1],"02"),a=t(e,0,[0,5,0,1,2],"02"),s=t(e,0,[0,5,1,0],"02")}catch(e){throw new Error("malformed X.509 certificate DSA public key")}this.setPublicHex(i,o,a,s)}};var tt=function(){var e=function(e,n,r){return t(g.AES,e,n,r)},t=function(e,t,n,r){var i=g.enc.Hex.parse(t),o=g.enc.Hex.parse(n),a=g.enc.Hex.parse(r),s={};s.key=o,s.iv=a,s.ciphertext=i;var u=e.decrypt(s,o,{iv:a});return g.enc.Hex.stringify(u)},n=function(e,t,n){return r(g.AES,e,t,n)},r=function(e,t,n,r){var i=g.enc.Hex.parse(t),o=g.enc.Hex.parse(n),a=g.enc.Hex.parse(r),s=e.encrypt(i,o,{iv:a}),u=g.enc.Hex.parse(s.toString());return g.enc.Base64.stringify(u)},i={"AES-256-CBC":{proc:e,eproc:n,keylen:32,ivlen:16},"AES-192-CBC":{proc:e,eproc:n,keylen:24,ivlen:16},"AES-128-CBC":{proc:e,eproc:n,keylen:16,ivlen:16},"DES-EDE3-CBC":{proc:function(e,n,r){return t(g.TripleDES,e,n,r)},eproc:function(e,t,n){return r(g.TripleDES,e,t,n)},keylen:24,ivlen:8},"DES-CBC":{proc:function(e,n,r){return t(g.DES,e,n,r)},eproc:function(e,t,n){return r(g.DES,e,t,n)},keylen:8,ivlen:8}},o=function(e){var t={},n=e.match(new RegExp("DEK-Info: ([^,]+),([0-9A-Fa-f]+)","m"));n&&(t.cipher=n[1],t.ivsalt=n[2]);var r=e.match(new RegExp("-----BEGIN ([A-Z]+) PRIVATE KEY-----"));r&&(t.type=r[1]);var i=-1,o=0;-1!=e.indexOf("\r\n\r\n")&&(i=e.indexOf("\r\n\r\n"),o=2),-1!=e.indexOf("\n\n")&&(i=e.indexOf("\n\n"),o=1);var a=e.indexOf("-----END");if(-1!=i&&-1!=a){var s=e.substring(i+2*o,a-o);s=s.replace(/\s+/g,""),t.data=s}return t},a=function(e,t,n){for(var r=n.substring(0,16),o=g.enc.Hex.parse(r),a=g.enc.Utf8.parse(t),s=i[e].keylen+i[e].ivlen,u="",l=null;;){var c=g.algo.MD5.create();if(null!=l&&c.update(l),c.update(a),c.update(o),l=c.finalize(),(u+=g.enc.Hex.stringify(l)).length>=2*s)break}var p={};return p.keyhex=u.substr(0,2*i[e].keylen),p.ivhex=u.substr(2*i[e].keylen,2*i[e].ivlen),p},s=function(e,t,n,r){var o=g.enc.Base64.parse(e),a=g.enc.Hex.stringify(o);return(0,i[t].proc)(a,n,r)};return{version:"1.0.0",parsePKCS5PEM:function(e){return o(e)},getKeyAndUnusedIvByPasscodeAndIvsalt:function(e,t,n){return a(e,t,n)},decryptKeyB64:function(e,t,n,r){return s(e,t,n,r)},getDecryptedKeyHex:function(e,t){var n=o(e),r=(n.type,n.cipher),i=n.ivsalt,u=n.data,l=a(r,t,i).keyhex;return s(u,r,l,i)},getEncryptedPKCS5PEMFromPrvKeyHex:function(e,t,n,r,o){var s="";if(void 0!==r&&null!=r||(r="AES-256-CBC"),void 0===i[r])throw new Error("KEYUTIL unsupported algorithm: "+r);void 0!==o&&null!=o||(o=function(e){var t=g.lib.WordArray.random(e);return g.enc.Hex.stringify(t)}(i[r].ivlen).toUpperCase());var u=function(e,t,n,r){return(0,i[t].eproc)(e,n,r)}(t,r,a(r,n,o).keyhex,o);s="-----BEGIN "+e+" PRIVATE KEY-----\r\n";return s+="Proc-Type: 4,ENCRYPTED\r\n",s+="DEK-Info: "+r+","+o+"\r\n",s+="\r\n",s+=u.replace(/(.{64})/g,"$1\r\n"),s+="\r\n-----END "+e+" PRIVATE KEY-----\r\n"},parseHexOfEncryptedPKCS8:function(e){var t=pe,n=t.getChildIdx,r=t.getV,i={},o=n(e,0);if(2!=o.length)throw new Error("malformed format: SEQUENCE(0).items != 2: "+o.length);i.ciphertext=r(e,o[1]);var a=n(e,o[0]);if(2!=a.length)throw new Error("malformed format: SEQUENCE(0.0).items != 2: "+a.length);if("2a864886f70d01050d"!=r(e,a[0]))throw new Error("this only supports pkcs5PBES2");var s=n(e,a[1]);if(2!=a.length)throw new Error("malformed format: SEQUENCE(0.0.1).items != 2: "+s.length);var u=n(e,s[1]);if(2!=u.length)throw new Error("malformed format: SEQUENCE(0.0.1.1).items != 2: "+u.length);if("2a864886f70d0307"!=r(e,u[0]))throw"this only supports TripleDES";i.encryptionSchemeAlg="TripleDES",i.encryptionSchemeIV=r(e,u[1]);var l=n(e,s[0]);if(2!=l.length)throw new Error("malformed format: SEQUENCE(0.0.1.0).items != 2: "+l.length);if("2a864886f70d01050c"!=r(e,l[0]))throw new Error("this only supports pkcs5PBKDF2");var c=n(e,l[1]);if(c.length<2)throw new Error("malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+c.length);i.pbkdf2Salt=r(e,c[0]);var p=r(e,c[1]);try{i.pbkdf2Iter=parseInt(p,16)}catch(e){throw new Error("malformed format pbkdf2Iter: "+p)}return i},getPBKDF2KeyHexFromParam:function(e,t){var n=g.enc.Hex.parse(e.pbkdf2Salt),r=e.pbkdf2Iter,i=g.PBKDF2(t,n,{keySize:6,iterations:r});return g.enc.Hex.stringify(i)},_getPlainPKCS8HexFromEncryptedPKCS8PEM:function(e,t){var n=Te(e,"ENCRYPTED PRIVATE KEY"),r=this.parseHexOfEncryptedPKCS8(n),i=tt.getPBKDF2KeyHexFromParam(r,t),o={};o.ciphertext=g.enc.Hex.parse(r.ciphertext);var a=g.enc.Hex.parse(i),s=g.enc.Hex.parse(r.encryptionSchemeIV),u=g.TripleDES.decrypt(o,a,{iv:s});return g.enc.Hex.stringify(u)},getKeyFromEncryptedPKCS8PEM:function(e,t){var n=this._getPlainPKCS8HexFromEncryptedPKCS8PEM(e,t);return this.getKeyFromPlainPrivatePKCS8Hex(n)},parsePlainPrivatePKCS8Hex:function(e){var t=pe,n=t.getChildIdx,r=t.getV,i={algparam:null};if("30"!=e.substr(0,2))throw new Error("malformed plain PKCS8 private key(code:001)");var o=n(e,0);if(o.length<3)throw new Error("malformed plain PKCS8 private key(code:002)");if("30"!=e.substr(o[1],2))throw new Error("malformed PKCS8 private key(code:003)");var a=n(e,o[1]);if(2!=a.length)throw new Error("malformed PKCS8 private key(code:004)");if("06"!=e.substr(a[0],2))throw new Error("malformed PKCS8 private key(code:005)");if(i.algoid=r(e,a[0]),"06"==e.substr(a[1],2)&&(i.algparam=r(e,a[1])),"04"!=e.substr(o[2],2))throw new Error("malformed PKCS8 private key(code:006)");return i.keyidx=t.getVidx(e,o[2]),i},getKeyFromPlainPrivatePKCS8PEM:function(e){var t=Te(e,"PRIVATE KEY");return this.getKeyFromPlainPrivatePKCS8Hex(t)},getKeyFromPlainPrivatePKCS8Hex:function(e){var t,n=this.parsePlainPrivatePKCS8Hex(e);if("2a864886f70d010101"==n.algoid)t=new ne;else if("2a8648ce380401"==n.algoid)t=new ue.crypto.DSA;else{if("2a8648ce3d0201"!=n.algoid)throw new Error("unsupported private key algorithm");t=new ue.crypto.ECDSA}return t.readPKCS8PrvKeyHex(e),t},_getKeyFromPublicPKCS8Hex:function(e){var t,n=pe.getVbyList(e,0,[0,0],"06");if("2a864886f70d010101"===n)t=new ne;else if("2a8648ce380401"===n)t=new ue.crypto.DSA;else{if("2a8648ce3d0201"!==n)throw new Error("unsupported PKCS#8 public key hex");t=new ue.crypto.ECDSA}return t.readPKCS8PubKeyHex(e),t},parsePublicRawRSAKeyHex:function(e){var t=pe,n=t.getChildIdx,r=t.getV,i={};if("30"!=e.substr(0,2))throw new Error("malformed RSA key(code:001)");var o=n(e,0);if(2!=o.length)throw new Error("malformed RSA key(code:002)");if("02"!=e.substr(o[0],2))throw new Error("malformed RSA key(code:003)");if(i.n=r(e,o[0]),"02"!=e.substr(o[1],2))throw new Error("malformed RSA key(code:004)");return i.e=r(e,o[1]),i},parsePublicPKCS8Hex:function(e){var t=pe,n=t.getChildIdx,r=t.getV,i={algparam:null},o=n(e,0);if(2!=o.length)throw new Error("outer DERSequence shall have 2 elements: "+o.length);var a=o[0];if("30"!=e.substr(a,2))throw new Error("malformed PKCS8 public key(code:001)");var s=n(e,a);if(2!=s.length)throw new Error("malformed PKCS8 public key(code:002)");if("06"!=e.substr(s[0],2))throw new Error("malformed PKCS8 public key(code:003)");if(i.algoid=r(e,s[0]),"06"==e.substr(s[1],2)?i.algparam=r(e,s[1]):"30"==e.substr(s[1],2)&&(i.algparam={},i.algparam.p=t.getVbyList(e,s[1],[0],"02"),i.algparam.q=t.getVbyList(e,s[1],[1],"02"),i.algparam.g=t.getVbyList(e,s[1],[2],"02")),"03"!=e.substr(o[1],2))throw new Error("malformed PKCS8 public key(code:004)");return i.key=r(e,o[1]).substr(2),i}}}();tt.getKey=function(e,t,n){var r=(m=pe).getChildIdx,i=(m.getV,m.getVbyList),o=ue.crypto,a=o.ECDSA,s=o.DSA,u=ne,l=Te,c=tt;if(void 0!==u&&e instanceof u)return e;if(void 0!==a&&e instanceof a)return e;if(void 0!==s&&e instanceof s)return e;if(void 0!==e.curve&&void 0!==e.xy&&void 0===e.d)return new a({pub:e.xy,curve:e.curve});if(void 0!==e.curve&&void 0!==e.d)return new a({prv:e.d,curve:e.curve});if(void 0===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0===e.d)return(D=new u).setPublic(e.n,e.e),D;if(void 0===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0!==e.d&&void 0!==e.p&&void 0!==e.q&&void 0!==e.dp&&void 0!==e.dq&&void 0!==e.co&&void 0===e.qi)return(D=new u).setPrivateEx(e.n,e.e,e.d,e.p,e.q,e.dp,e.dq,e.co),D;if(void 0===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0!==e.d&&void 0===e.p)return(D=new u).setPrivate(e.n,e.e,e.d),D;if(void 0!==e.p&&void 0!==e.q&&void 0!==e.g&&void 0!==e.y&&void 0===e.x)return(D=new s).setPublic(e.p,e.q,e.g,e.y),D;if(void 0!==e.p&&void 0!==e.q&&void 0!==e.g&&void 0!==e.y&&void 0!==e.x)return(D=new s).setPrivate(e.p,e.q,e.g,e.y,e.x),D;if("RSA"===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0===e.d)return(D=new u).setPublic(be(e.n),be(e.e)),D;if("RSA"===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0!==e.d&&void 0!==e.p&&void 0!==e.q&&void 0!==e.dp&&void 0!==e.dq&&void 0!==e.qi)return(D=new u).setPrivateEx(be(e.n),be(e.e),be(e.d),be(e.p),be(e.q),be(e.dp),be(e.dq),be(e.qi)),D;if("RSA"===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0!==e.d)return(D=new u).setPrivate(be(e.n),be(e.e),be(e.d)),D;if("EC"===e.kty&&void 0!==e.crv&&void 0!==e.x&&void 0!==e.y&&void 0===e.d){var p=($=new a({curve:e.crv})).ecparams.keycharlen,h="04"+("0000000000"+be(e.x)).slice(-p)+("0000000000"+be(e.y)).slice(-p);return $.setPublicKeyHex(h),$}if("EC"===e.kty&&void 0!==e.crv&&void 0!==e.x&&void 0!==e.y&&void 0!==e.d){p=($=new a({curve:e.crv})).ecparams.keycharlen,h="04"+("0000000000"+be(e.x)).slice(-p)+("0000000000"+be(e.y)).slice(-p);var d=("0000000000"+be(e.d)).slice(-p);return $.setPublicKeyHex(h),$.setPrivateKeyHex(d),$}if("pkcs5prv"===n){var f,g=e,m=pe;if(9===(f=r(g,0)).length)(D=new u).readPKCS5PrvKeyHex(g);else if(6===f.length)(D=new s).readPKCS5PrvKeyHex(g);else{if(!(f.length>2&&"04"===g.substr(f[1],2)))throw new Error("unsupported PKCS#1/5 hexadecimal key");(D=new a).readPKCS5PrvKeyHex(g)}return D}if("pkcs8prv"===n)return D=c.getKeyFromPlainPrivatePKCS8Hex(e);if("pkcs8pub"===n)return c._getKeyFromPublicPKCS8Hex(e);if("x509pub"===n)return ot.getPublicKeyFromCertHex(e);if(-1!=e.indexOf("-END CERTIFICATE-",0)||-1!=e.indexOf("-END X509 CERTIFICATE-",0)||-1!=e.indexOf("-END TRUSTED CERTIFICATE-",0))return ot.getPublicKeyFromCertPEM(e);if(-1!=e.indexOf("-END PUBLIC KEY-")){var v=Te(e,"PUBLIC KEY");return c._getKeyFromPublicPKCS8Hex(v)}if(-1!=e.indexOf("-END RSA PRIVATE KEY-")&&-1==e.indexOf("4,ENCRYPTED")){var y=l(e,"RSA PRIVATE KEY");return c.getKey(y,null,"pkcs5prv")}if(-1!=e.indexOf("-END DSA PRIVATE KEY-")&&-1==e.indexOf("4,ENCRYPTED")){var b=i(R=l(e,"DSA PRIVATE KEY"),0,[1],"02"),w=i(R,0,[2],"02"),S=i(R,0,[3],"02"),E=i(R,0,[4],"02"),A=i(R,0,[5],"02");return(D=new s).setPrivate(new x(b,16),new x(w,16),new x(S,16),new x(E,16),new x(A,16)),D}if(-1!=e.indexOf("-END EC PRIVATE KEY-")&&-1==e.indexOf("4,ENCRYPTED")){y=l(e,"EC PRIVATE KEY");return c.getKey(y,null,"pkcs5prv")}if(-1!=e.indexOf("-END PRIVATE KEY-"))return c.getKeyFromPlainPrivatePKCS8PEM(e);if(-1!=e.indexOf("-END RSA PRIVATE KEY-")&&-1!=e.indexOf("4,ENCRYPTED")){var F=c.getDecryptedKeyHex(e,t),C=new ne;return C.readPKCS5PrvKeyHex(F),C}if(-1!=e.indexOf("-END EC PRIVATE KEY-")&&-1!=e.indexOf("4,ENCRYPTED")){var $,D=i(R=c.getDecryptedKeyHex(e,t),0,[1],"04"),T=i(R,0,[2,0],"06"),I=i(R,0,[3,0],"03").substr(2);if(void 0===ue.crypto.OID.oidhex2name[T])throw new Error("undefined OID(hex) in KJUR.crypto.OID: "+T);return($=new a({curve:ue.crypto.OID.oidhex2name[T]})).setPublicKeyHex(I),$.setPrivateKeyHex(D),$.isPublic=!1,$}if(-1!=e.indexOf("-END DSA PRIVATE KEY-")&&-1!=e.indexOf("4,ENCRYPTED")){var R;b=i(R=c.getDecryptedKeyHex(e,t),0,[1],"02"),w=i(R,0,[2],"02"),S=i(R,0,[3],"02"),E=i(R,0,[4],"02"),A=i(R,0,[5],"02");return(D=new s).setPrivate(new x(b,16),new x(w,16),new x(S,16),new x(E,16),new x(A,16)),D}if(-1!=e.indexOf("-END ENCRYPTED PRIVATE KEY-"))return c.getKeyFromEncryptedPKCS8PEM(e,t);throw new Error("not supported argument")},tt.generateKeypair=function(e,t){if("RSA"==e){var n=t;(a=new ne).generate(n,"10001"),a.isPrivate=!0,a.isPublic=!0;var r=new ne,i=a.n.toString(16),o=a.e.toString(16);return r.setPublic(i,o),r.isPrivate=!1,r.isPublic=!0,(s={}).prvKeyObj=a,s.pubKeyObj=r,s}if("EC"==e){var a,s,u=t,l=new ue.crypto.ECDSA({curve:u}).generateKeyPairHex();return(a=new ue.crypto.ECDSA({curve:u})).setPublicKeyHex(l.ecpubhex),a.setPrivateKeyHex(l.ecprvhex),a.isPrivate=!0,a.isPublic=!1,(r=new ue.crypto.ECDSA({curve:u})).setPublicKeyHex(l.ecpubhex),r.isPrivate=!1,r.isPublic=!0,(s={}).prvKeyObj=a,s.pubKeyObj=r,s}throw new Error("unknown algorithm: "+e)},tt.getPEM=function(e,t,n,r,i,o){var a=ue,s=a.asn1,u=s.DERObjectIdentifier,l=s.DERInteger,c=s.ASN1Util.newObject,p=s.x509.SubjectPublicKeyInfo,h=a.crypto,d=h.DSA,f=h.ECDSA,m=ne;function v(e){return c({seq:[{int:0},{int:{bigint:e.n}},{int:e.e},{int:{bigint:e.d}},{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.dmp1}},{int:{bigint:e.dmq1}},{int:{bigint:e.coeff}}]})}function y(e){return c({seq:[{int:1},{octstr:{hex:e.prvKeyHex}},{tag:["a0",!0,{oid:{name:e.curveName}}]},{tag:["a1",!0,{bitstr:{hex:"00"+e.pubKeyHex}}]}]})}function b(e){return c({seq:[{int:0},{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.g}},{int:{bigint:e.y}},{int:{bigint:e.x}}]})}if((void 0!==m&&e instanceof m||void 0!==d&&e instanceof d||void 0!==f&&e instanceof f)&&1==e.isPublic&&(void 0===t||"PKCS8PUB"==t))return De(E=new p(e).tohex(),"PUBLIC KEY");if("PKCS1PRV"==t&&void 0!==m&&e instanceof m&&(void 0===n||null==n)&&1==e.isPrivate)return De(E=v(e).tohex(),"RSA PRIVATE KEY");if("PKCS1PRV"==t&&void 0!==f&&e instanceof f&&(void 0===n||null==n)&&1==e.isPrivate){var w=new u({name:e.curveName}).tohex(),x=y(e).tohex(),S="";return S+=De(w,"EC PARAMETERS"),S+=De(x,"EC PRIVATE KEY")}if("PKCS1PRV"==t&&void 0!==d&&e instanceof d&&(void 0===n||null==n)&&1==e.isPrivate)return De(E=b(e).tohex(),"DSA PRIVATE KEY");if("PKCS5PRV"==t&&void 0!==m&&e instanceof m&&void 0!==n&&null!=n&&1==e.isPrivate){var E=v(e).tohex();return void 0===r&&(r="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("RSA",E,n,r,o)}if("PKCS5PRV"==t&&void 0!==f&&e instanceof f&&void 0!==n&&null!=n&&1==e.isPrivate){E=y(e).tohex();return void 0===r&&(r="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("EC",E,n,r,o)}if("PKCS5PRV"==t&&void 0!==d&&e instanceof d&&void 0!==n&&null!=n&&1==e.isPrivate){E=b(e).tohex();return void 0===r&&(r="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("DSA",E,n,r,o)}var A=function(e,t){var n=F(e,t);return new c({seq:[{seq:[{oid:{name:"pkcs5PBES2"}},{seq:[{seq:[{oid:{name:"pkcs5PBKDF2"}},{seq:[{octstr:{hex:n.pbkdf2Salt}},{int:n.pbkdf2Iter}]}]},{seq:[{oid:{name:"des-EDE3-CBC"}},{octstr:{hex:n.encryptionSchemeIV}}]}]}]},{octstr:{hex:n.ciphertext}}]}).tohex()},F=function(e,t){var n=g.lib.WordArray.random(8),r=g.lib.WordArray.random(8),i=g.PBKDF2(t,n,{keySize:6,iterations:100}),o=g.enc.Hex.parse(e),a=g.TripleDES.encrypt(o,i,{iv:r})+"",s={};return s.ciphertext=a,s.pbkdf2Salt=g.enc.Hex.stringify(n),s.pbkdf2Iter=100,s.encryptionSchemeAlg="DES-EDE3-CBC",s.encryptionSchemeIV=g.enc.Hex.stringify(r),s};if("PKCS8PRV"==t&&null!=m&&e instanceof m&&1==e.isPrivate){var C=v(e).tohex();E=c({seq:[{int:0},{seq:[{oid:{name:"rsaEncryption"}},{null:!0}]},{octstr:{hex:C}}]}).tohex();return void 0===n||null==n?De(E,"PRIVATE KEY"):De(x=A(E,n),"ENCRYPTED PRIVATE KEY")}if("PKCS8PRV"==t&&void 0!==f&&e instanceof f&&1==e.isPrivate){var $={seq:[{int:1},{octstr:{hex:e.prvKeyHex}}]};"string"==typeof e.pubKeyHex&&$.seq.push({tag:["a1",!0,{bitstr:{hex:"00"+e.pubKeyHex}}]});C=new c($).tohex(),E=c({seq:[{int:0},{seq:[{oid:{name:"ecPublicKey"}},{oid:{name:e.curveName}}]},{octstr:{hex:C}}]}).tohex();return void 0===n||null==n?De(E,"PRIVATE KEY"):De(x=A(E,n),"ENCRYPTED PRIVATE KEY")}if("PKCS8PRV"==t&&void 0!==d&&e instanceof d&&1==e.isPrivate){C=new l({bigint:e.x}).tohex(),E=c({seq:[{int:0},{seq:[{oid:{name:"dsa"}},{seq:[{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.g}}]}]},{octstr:{hex:C}}]}).tohex();return void 0===n||null==n?De(E,"PRIVATE KEY"):De(x=A(E,n),"ENCRYPTED PRIVATE KEY")}throw new Error("unsupported object nor format")},tt.getKeyFromCSRPEM=function(e){var t=Te(e,"CERTIFICATE REQUEST");return tt.getKeyFromCSRHex(t)},tt.getKeyFromCSRHex=function(e){var t=tt.parseCSRHex(e);return tt.getKey(t.p8pubkeyhex,null,"pkcs8pub")},tt.parseCSRHex=function(e){var t=pe,n=t.getChildIdx,r=t.getTLV,i={},o=e;if("30"!=o.substr(0,2))throw new Error("malformed CSR(code:001)");var a=n(o,0);if(a.length<1)throw new Error("malformed CSR(code:002)");if("30"!=o.substr(a[0],2))throw new Error("malformed CSR(code:003)");var s=n(o,a[0]);if(s.length<3)throw new Error("malformed CSR(code:004)");return i.p8pubkeyhex=r(o,s[2]),i},tt.getKeyID=function(e){var t=tt,n=pe;"string"==typeof e&&-1!=e.indexOf("BEGIN ")&&(e=t.getKey(e));var r=Te(t.getPEM(e)),i=n.getIdxbyList(r,0,[1]),o=n.getV(r,i).substring(2);return ue.crypto.Util.hashHex(o,"sha1")},tt.getJWK=function(e,t,n,r,i){var o,a,s={},u=ue.crypto.Util.hashHex;if("string"==typeof e)o=tt.getKey(e),-1!=e.indexOf("CERTIFICATE")&&(a=Te(e));else{if("object"!=typeof e)throw new Error("unsupported keyinfo type");e instanceof ot?(o=e.getPublicKey(),a=e.hex):o=e}if(o instanceof ne&&o.isPrivate)s.kty="RSA",s.n=ye(o.n.toString(16)),s.e=ye(o.e.toString(16)),s.d=ye(o.d.toString(16)),s.p=ye(o.p.toString(16)),s.q=ye(o.q.toString(16)),s.dp=ye(o.dmp1.toString(16)),s.dq=ye(o.dmq1.toString(16)),s.qi=ye(o.coeff.toString(16));else if(o instanceof ne&&o.isPublic)s.kty="RSA",s.n=ye(o.n.toString(16)),s.e=ye(o.e.toString(16));else if(o instanceof ue.crypto.ECDSA&&o.isPrivate){if("P-256"!==(c=o.getShortNISTPCurveName())&&"P-384"!==c&&"P-521"!==c)throw new Error("unsupported curve name for JWT: "+c);var l=o.getPublicKeyXYHex();s.kty="EC",s.crv=c,s.x=ye(l.x),s.y=ye(l.y),s.d=ye(o.prvKeyHex)}else if(o instanceof ue.crypto.ECDSA&&o.isPublic){var c;if("P-256"!==(c=o.getShortNISTPCurveName())&&"P-384"!==c&&"P-521"!==c)throw new Error("unsupported curve name for JWT: "+c);l=o.getPublicKeyXYHex();s.kty="EC",s.crv=c,s.x=ye(l.x),s.y=ye(l.y)}if(null==s.kty)throw new Error("unsupported keyinfo");return o.isPrivate||1==t||(s.kid=ue.jws.JWS.getJWKthumbprint(s)),null!=a&&1!=n&&(s.x5c=[y(a)]),null!=a&&1!=r&&(s.x5t=me(y(u(a,"sha1")))),null!=a&&1!=i&&(s["x5t#S256"]=me(y(u(a,"sha256")))),s},tt.getJWKFromKey=function(e){return tt.getJWK(e,!0,!0,!0,!0)},ne.getPosArrayOfChildrenFromHex=function(e){return pe.getChildIdx(e,0)},ne.getHexValueArrayOfChildrenFromHex=function(e){var t,n=pe.getV,r=n(e,(t=ne.getPosArrayOfChildrenFromHex(e))[0]),i=n(e,t[1]),o=n(e,t[2]),a=n(e,t[3]),s=n(e,t[4]),u=n(e,t[5]),l=n(e,t[6]),c=n(e,t[7]),p=n(e,t[8]);return(t=new Array).push(r,i,o,a,s,u,l,c,p),t},ne.prototype.readPrivateKeyFromPEMString=function(e){var t=Te(e),n=ne.getHexValueArrayOfChildrenFromHex(t);this.setPrivateEx(n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8])},ne.prototype.readPKCS5PrvKeyHex=function(e){var t=ne.getHexValueArrayOfChildrenFromHex(e);this.setPrivateEx(t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},ne.prototype.readPKCS8PrvKeyHex=function(e){var t,n,r,i,o,a,s,u,l=pe,c=l.getVbyListEx;if(!1===l.isASN1HEX(e))throw new Error("not ASN.1 hex string");try{t=c(e,0,[2,0,1],"02"),n=c(e,0,[2,0,2],"02"),r=c(e,0,[2,0,3],"02"),i=c(e,0,[2,0,4],"02"),o=c(e,0,[2,0,5],"02"),a=c(e,0,[2,0,6],"02"),s=c(e,0,[2,0,7],"02"),u=c(e,0,[2,0,8],"02")}catch(e){throw new Error("malformed PKCS#8 plain RSA private key")}this.setPrivateEx(t,n,r,i,o,a,s,u)},ne.prototype.readPKCS5PubKeyHex=function(e){var t=pe,n=t.getV;if(!1===t.isASN1HEX(e))throw new Error("keyHex is not ASN.1 hex string");var r=t.getChildIdx(e,0);if(2!==r.length||"02"!==e.substr(r[0],2)||"02"!==e.substr(r[1],2))throw new Error("wrong hex for PKCS#5 public key");var i=n(e,r[0]),o=n(e,r[1]);this.setPublic(i,o)},ne.prototype.readPKCS8PubKeyHex=function(e){var t=pe;if(!1===t.isASN1HEX(e))throw new Error("not ASN.1 hex string");if("06092a864886f70d010101"!==t.getTLVbyListEx(e,0,[0,0]))throw new Error("not PKCS8 RSA public key");var n=t.getTLVbyListEx(e,0,[1,0]);this.readPKCS5PubKeyHex(n)},ne.prototype.readCertPubKeyHex=function(e,t){var n,r;(n=new ot).readCertHex(e),r=n.getPublicKeyHex(),this.readPKCS8PubKeyHex(r)};new RegExp("[^0-9a-f]","gi");function nt(e,t){for(var n="",r=t/4-e.length,i=0;i<r;i++)n+="0";return n+e}function rt(e,t,n){for(var r="",i=0;r.length<t;)r+=Ee(n(Ae(e+String.fromCharCode.apply(String,[(4278190080&i)>>24,(16711680&i)>>16,(65280&i)>>8,255&i])))),i+=1;return r}function it(e){for(var t in ue.crypto.Util.DIGESTINFOHEAD){var n=ue.crypto.Util.DIGESTINFOHEAD[t],r=n.length;if(e.substring(0,r)==n)return[t,e.substring(r)]}return[]}function ot(e){var t,n=pe,r=n.getChildIdx,i=n.getV,o=(n.dump,n.parse),a=n.getTLV,s=n.getVbyList,u=n.getVbyListEx,l=n.getTLVbyList,c=n.getTLVbyListEx,p=n.getIdxbyList,h=n.getIdxbyListEx,d=n.getVidx,f=n.getInt,g=n.oidname,m=n.hextooidstr,v=Te,y=Error;try{t=ue.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV}catch(e){}this.HEX2STAG={"0c":"utf8",13:"prn",16:"ia5","1a":"vis","1e":"bmp"},this.hex=null,this.version=0,this.foffset=0,this.aExtInfo=null,this.getVersion=function(){if(null===this.hex||0!==this.version)return this.version;var e=l(this.hex,0,[0,0]);if("a0"==e.substr(0,2)){var t=l(e,0,[0]),n=f(t,0);if(n<0||2<n)throw new Error("malformed version field");return this.version=n+1,this.version}return this.version=1,this.foffset=-1,1},this.getSerialNumberHex=function(){return u(this.hex,0,[0,0],"02")},this.getSignatureAlgorithmField=function(){var e=c(this.hex,0,[0,1]);return this.getAlgorithmIdentifierName(e)},this.getAlgorithmIdentifierName=function(e){for(var n in t)if(e===t[n])return n;return g(u(e,0,[0],"06"))},this.getIssuer=function(e,t){return this.getX500Name(this.getIssuerHex(),e,t)},this.getIssuerHex=function(){return l(this.hex,0,[0,3+this.foffset],"30")},this.getIssuerString=function(){return this.getIssuer().str},this.getSubject=function(e,t){return this.getX500Name(this.getSubjectHex(),e,t)},this.getSubjectHex=function(){return l(this.hex,0,[0,5+this.foffset],"30")},this.getSubjectString=function(){return this.getSubject().str},this.getNotBefore=function(){var e=s(this.hex,0,[0,4+this.foffset,0]);return e=e.replace(/(..)/g,"%$1"),e=decodeURIComponent(e)},this.getNotAfter=function(){var e=s(this.hex,0,[0,4+this.foffset,1]);return e=e.replace(/(..)/g,"%$1"),e=decodeURIComponent(e)},this.getPublicKeyHex=function(){return this.getSPKI()},this.getSPKI=function(){return l(this.hex,0,[0,6+this.foffset],"30")},this.getSPKIValue=function(){var e=this.getSPKI();return null==e?null:s(e,0,[1],"03",!0)},this.getPublicKeyIdx=function(){return p(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyContentIdx=function(){var e=this.getPublicKeyIdx();return p(this.hex,e,[1,0],"30")},this.getPublicKey=function(){return tt.getKey(this.getPublicKeyHex(),null,"pkcs8pub")},this.getSignatureAlgorithmName=function(){var e=l(this.hex,0,[1],"30");return this.getAlgorithmIdentifierName(e)},this.getSignatureValueHex=function(){return s(this.hex,0,[2],"03",!0)},this.verifySignature=function(e){var t=this.getSignatureAlgorithmField(),n=this.getSignatureValueHex(),r=l(this.hex,0,[0],"30"),i=new ue.crypto.Signature({alg:t});return i.init(e),i.updateHex(r),i.verify(n)},this.parseExt=function(e){var t,o,a;if(void 0===e){if(a=this.hex,3!==this.version)return-1;t=p(a,0,[0,7,0],"30"),o=r(a,t)}else{a=Te(e);var u=p(a,0,[0,3,0,0],"06");if("2a864886f70d01090e"!=i(a,u))return void(this.aExtInfo=new Array);t=p(a,0,[0,3,0,1,0],"30"),o=r(a,t),this.hex=a}this.aExtInfo=new Array;for(var l=0;l<o.length;l++){var c={critical:!1},h=0;3===r(a,o[l]).length&&(c.critical=!0,h=1),c.oid=n.hextooidstr(s(a,o[l],[0],"06"));var f=p(a,o[l],[1+h]);c.vidx=d(a,f),this.aExtInfo.push(c)}},this.getExtInfo=function(e){var t=this.aExtInfo,n=e;if(e.match(/^[0-9.]+$/)||(n=ue.asn1.x509.OID.name2oid(e)),""!==n)for(var r=0;r<t.length;r++)if(t[r].oid===n)return t[r]},this.getCriticalExtV=function(e,t,n){if(null!=t)return[t,n];var r=this.getExtInfo(e);return null==r?[null,null]:[a(this.hex,r.vidx),r.critical]},this.getExtBasicConstraints=function(e,t){if(void 0===e&&void 0===t){var n=this.getExtInfo("basicConstraints");if(void 0===n)return;e=a(this.hex,n.vidx),t=n.critical}var r={extname:"basicConstraints"};if(t&&(r.critical=!0),"3000"===e)return r;if("30030101ff"===e)return r.cA=!0,r;if("30060101ff02"===e.substr(0,12)){var o=i(e,10),s=parseInt(o,16);return r.cA=!0,r.pathLen=s,r}throw new Error("hExtV parse error: "+e)},this.getExtNameConstraints=function(e,t){var n=this.getCriticalExtV("nameConstraints",e,t);if(e=n[0],t=n[1],null!=e){var i={extname:"nameConstraints"};t&&(i.critical=!0);for(var o=r(e,0),s=0;s<o.length;s++){for(var u=[],l=r(e,o[s]),c=0;c<l.length;c++){var p=a(e,l[c]),h=this.getGeneralSubtree(p);u.push(h)}var d=e.substr(o[s],2);"a0"==d?i.permit=u:"a1"==d&&(i.exclude=u)}return i}},this.getGeneralSubtree=function(e){var t=r(e,0),n=t.length;if(n<1||2<n)throw new Error("wrong num elements");for(var o=this.getGeneralName(a(e,t[0])),s=1;s<n;s++){var u=e.substr(t[s],2),l=i(e,t[s]),c=parseInt(l,16);"80"==u&&(o.min=c),"81"==u&&(o.max=c)}return o},this.getExtKeyUsage=function(e,t){var n=this.getCriticalExtV("keyUsage",e,t);if(e=n[0],t=n[1],null!=e){var r={extname:"keyUsage"};return t&&(r.critical=!0),r.names=this.getExtKeyUsageString(e).split(","),r}},this.getExtKeyUsageBin=function(e){if(void 0===e){var t=this.getExtInfo("keyUsage");if(void 0===t)return"";e=a(this.hex,t.vidx)}if(8!=e.length&&10!=e.length)throw new Error("malformed key usage value: "+e);var n="000000000000000"+parseInt(e.substr(6),16).toString(2);return 8==e.length&&(n=n.slice(-8)),10==e.length&&(n=n.slice(-16)),""==(n=n.replace(/0+$/,""))&&(n="0"),n},this.getExtKeyUsageString=function(e){for(var t=this.getExtKeyUsageBin(e),n=new Array,r=0;r<t.length;r++)"1"==t.substr(r,1)&&n.push(ot.KEYUSAGE_NAME[r]);return n.join(",")},this.getExtSubjectKeyIdentifier=function(e,t){if(void 0===e&&void 0===t){var n=this.getExtInfo("subjectKeyIdentifier");if(void 0===n)return;e=a(this.hex,n.vidx),t=n.critical}var r={extname:"subjectKeyIdentifier"};t&&(r.critical=!0);var o=i(e,0);return r.kid={hex:o},r},this.getExtAuthorityKeyIdentifier=function(e,t){if(void 0===e&&void 0===t){var n=this.getExtInfo("authorityKeyIdentifier");if(void 0===n)return;e=a(this.hex,n.vidx),t=n.critical}var o={extname:"authorityKeyIdentifier"};t&&(o.critical=!0);for(var s=r(e,0),u=0;u<s.length;u++){var l=e.substr(s[u],2);if("80"===l&&(o.kid={hex:i(e,s[u])}),"a1"===l){var c=a(e,s[u]),p=this.getGeneralNames(c);o.issuer=p[0].dn}"82"===l&&(o.sn={hex:i(e,s[u])})}return o},this.getExtExtKeyUsage=function(e,t){if(void 0===e&&void 0===t){var n=this.getExtInfo("extKeyUsage");if(void 0===n)return;e=a(this.hex,n.vidx),t=n.critical}var o={extname:"extKeyUsage",array:[]};t&&(o.critical=!0);for(var s=r(e,0),u=0;u<s.length;u++)o.array.push(g(i(e,s[u])));return o},this.getExtExtKeyUsageName=function(){var e=this.getExtInfo("extKeyUsage");if(void 0===e)return e;var t=new Array,n=a(this.hex,e.vidx);if(""===n)return t;for(var o=r(n,0),s=0;s<o.length;s++)t.push(g(i(n,o[s])));return t},this.getExtSubjectAltName=function(e,t){if(void 0===e&&void 0===t){var n=this.getExtInfo("subjectAltName");if(void 0===n)return;e=a(this.hex,n.vidx),t=n.critical}var r={extname:"subjectAltName",array:[]};return t&&(r.critical=!0),r.array=this.getGeneralNames(e),r},this.getExtIssuerAltName=function(e,t){if(void 0===e&&void 0===t){var n=this.getExtInfo("issuerAltName");if(void 0===n)return;e=a(this.hex,n.vidx),t=n.critical}var r={extname:"issuerAltName",array:[]};return t&&(r.critical=!0),r.array=this.getGeneralNames(e),r},this.getGeneralNames=function(e){for(var t=r(e,0),n=[],i=0;i<t.length;i++){var o=this.getGeneralName(a(e,t[i]));void 0!==o&&n.push(o)}return n},this.getGeneralName=function(e){var t=e.substr(0,2),n=i(e,0),r=Ee(n);return"81"==t?{rfc822:r}:"82"==t?{dns:r}:"86"==t?{uri:r}:"87"==t?{ip:Ne(n)}:"a4"==t?{dn:this.getX500Name(n)}:"a0"==t?{other:this.getOtherName(e)}:void 0},this.getExtSubjectAltName2=function(){var e,t,n,o=this.getExtInfo("subjectAltName");if(void 0===o)return o;for(var s=new Array,u=a(this.hex,o.vidx),l=r(u,0),c=0;c<l.length;c++)n=u.substr(l[c],2),e=i(u,l[c]),"81"===n&&(t=xe(e),s.push(["MAIL",t])),"82"===n&&(t=xe(e),s.push(["DNS",t])),"84"===n&&(t=ot.hex2dn(e,0),s.push(["DN",t])),"86"===n&&(t=xe(e),s.push(["URI",t])),"87"===n&&(t=Ne(e),s.push(["IP",t]));return s},this.getExtCRLDistributionPoints=function(e,t){if(void 0===e&&void 0===t){var n=this.getExtInfo("cRLDistributionPoints");if(void 0===n)return;e=a(this.hex,n.vidx),t=n.critical}var i={extname:"cRLDistributionPoints",array:[]};t&&(i.critical=!0);for(var o=r(e,0),s=0;s<o.length;s++){var u=a(e,o[s]);i.array.push(this.getDistributionPoint(u))}return i},this.getDistributionPoint=function(e){for(var t={},n=r(e,0),i=0;i<n.length;i++){var o=e.substr(n[i],2),s=a(e,n[i]);"a0"==o&&(t.dpname=this.getDistributionPointName(s))}return t},this.getDistributionPointName=function(e){for(var t={},n=r(e,0),i=0;i<n.length;i++){var o=e.substr(n[i],2),s=a(e,n[i]);"a0"==o&&(t.full=this.getGeneralNames(s))}return t},this.getExtCRLDistributionPointsURI=function(){var e=this.getExtCRLDistributionPoints();if(null==e)return e;for(var t=e.array,n=[],r=0;r<t.length;r++)try{null!=t[r].dpname.full[0].uri&&n.push(t[r].dpname.full[0].uri)}catch(e){}return n},this.getExtAIAInfo=function(){var e=this.getExtInfo("authorityInfoAccess");if(void 0===e)return e;for(var t={ocsp:[],caissuer:[]},n=r(this.hex,e.vidx),i=0;i<n.length;i++){var o=s(this.hex,n[i],[0],"06"),a=s(this.hex,n[i],[1],"86");"2b06010505073001"===o&&t.ocsp.push(xe(a)),"2b06010505073002"===o&&t.caissuer.push(xe(a))}return t},this.getExtAuthorityInfoAccess=function(e,t){if(void 0===e&&void 0===t){var n=this.getExtInfo("authorityInfoAccess");if(void 0===n)return;e=a(this.hex,n.vidx),t=n.critical}var i={extname:"authorityInfoAccess",array:[]};t&&(i.critical=!0);for(var o=r(e,0),l=0;l<o.length;l++){var c=u(e,o[l],[0],"06"),p=xe(s(e,o[l],[1],"86"));if("2b06010505073001"==c)i.array.push({ocsp:p});else{if("2b06010505073002"!=c)throw new Error("unknown method: "+c);i.array.push({caissuer:p})}}return i},this.getExtCertificatePolicies=function(e,t){if(void 0===e&&void 0===t){var n=this.getExtInfo("certificatePolicies");if(void 0===n)return;e=a(this.hex,n.vidx),t=n.critical}var i={extname:"certificatePolicies",array:[]};t&&(i.critical=!0);for(var o=r(e,0),s=0;s<o.length;s++){var u=a(e,o[s]),l=this.getPolicyInformation(u);i.array.push(l)}return i},this.getPolicyInformation=function(e){var t={},n=s(e,0,[0],"06");t.policyoid=g(n);var i=h(e,0,[1],"30");if(-1!=i){t.array=[];for(var o=r(e,i),u=0;u<o.length;u++){var l=a(e,o[u]),c=this.getPolicyQualifierInfo(l);t.array.push(c)}}return t},this.getOtherName=function(e){var t={},n=r(e,0),i=s(e,n[0],[],"06"),a=s(e,n[1],[]);return t.oid=g(i),t.value=o(a),t},this.getPolicyQualifierInfo=function(e){var t={},n=s(e,0,[0],"06");if("2b06010505070201"===n){var r=u(e,0,[1],"16");t.cps=Ee(r)}else if("2b06010505070202"===n){var i=l(e,0,[1],"30");t.unotice=this.getUserNotice(i)}return t},this.getUserNotice=function(e){var t=null;try{return t=n.parse(e),this._asn1ToUnotice(t)}catch(e){return}},this._asn1ToUnotice=function(e){try{for(var t={},n=Qe(e,"seq"),r=0;r<n.length;r++){var i=this._asn1ToNoticeRef(n[r]);null!=i&&(t.noticeref=i);var o=this.asn1ToDisplayText(n[r]);null!=o&&(t.exptext=o)}return Object.keys(t).length>0?t:void 0}catch(e){return}},this._asn1ToNoticeRef=function(e){try{for(var t={},n=Qe(e,"seq"),r=0;r<n.length;r++){var i=this._asn1ToNoticeNum(n[r]);null!=i&&(t.noticenum=i);var o=this.asn1ToDisplayText(n[r]);null!=o&&(t.org=o)}return Object.keys(t).length>0?t:void 0}catch(e){return}},this._asn1ToNoticeNum=function(e){try{for(var t=Qe(e,"seq"),n=[],r=0;r<t.length;r++){var i=t[r];n.push(parseInt(Qe(i,"int.hex"),16))}return n}catch(e){return}},this.getDisplayText=function(e){var t={};return t.type={"0c":"utf8",16:"ia5","1a":"vis","1e":"bmp"}[e.substr(0,2)],t.str=Ee(i(e,0)),t},this.asn1ToDisplayText=function(e){return null!=e.utf8str?{type:"utf8",str:e.utf8str.str}:null!=e.ia5str?{type:"ia5",str:e.ia5str.str}:null!=e.visstr?{type:"vis",str:e.visstr.str}:null!=e.bmpstr?{type:"bmp",str:e.bmpstr.str}:null!=e.prnstr?{type:"prn",str:e.prnstr.str}:void 0},this.getExtPolicyMappings=function(e,t){var n=this.getCriticalExtV("policyMappings",e,t);if(e=n[0],t=n[1],null!=e){var r={extname:"policyMappings"};t&&(r.critical=!0);try{for(var i=o(e).seq,a=[],s=0;s<i.length;s++){var u=i[s].seq;a.push([u[0].oid,u[1].oid])}r.array=a}catch(e){throw new y("malformed policyMappings")}return r}},this.getExtPolicyConstraints=function(e,t){var n=this.getCriticalExtV("policyConstraints",e,t);if(e=n[0],t=n[1],null!=e){var r={extname:"policyConstraints"};t&&(r.critical=!0);var i=o(e);try{for(var a=i.seq,s=0;s<a.length;s++){var u=a[s].tag;0==u.explicit&&("80"==u.tag&&(r.reqexp=parseInt(u.hex,16)),"81"==u.tag&&(r.inhibit=parseInt(u.hex,16)))}}catch(e){return new y("malformed policyConstraints value")}return r}},this.getExtInhibitAnyPolicy=function(e,t){var n=this.getCriticalExtV("inhibitAnyPolicy",e,t);if(e=n[0],t=n[1],null!=e){var r={extname:"inhibitAnyPolicy"};t&&(r.critical=!0);var i=f(e,0);return-1==i?new y("wrong value"):(r.skip=i,r)}},this.getExtCRLNumber=function(e,t){var n={extname:"cRLNumber"};if(t&&(n.critical=!0),"02"==e.substr(0,2))return n.num={hex:i(e,0)},n;throw new y("hExtV parse error: "+e)},this.getExtCRLReason=function(e,t){var n={extname:"cRLReason"};if(t&&(n.critical=!0),"0a"==e.substr(0,2))return n.code=parseInt(i(e,0),16),n;throw new Error("hExtV parse error: "+e)},this.getExtOcspNonce=function(e,t){var n={extname:"ocspNonce"};t&&(n.critical=!0);var r=i(e,0);return n.hex=r,n},this.getExtOcspNoCheck=function(e,t){var n={extname:"ocspNoCheck"};return t&&(n.critical=!0),n},this.getExtAdobeTimeStamp=function(e,t){if(void 0===e&&void 0===t){var n=this.getExtInfo("adobeTimeStamp");if(void 0===n)return;e=a(this.hex,n.vidx),t=n.critical}var i={extname:"adobeTimeStamp"};t&&(i.critical=!0);var o=r(e,0);if(o.length>1){var s=a(e,o[1]),u=this.getGeneralName(s);null!=u.uri&&(i.uri=u.uri)}if(o.length>2){var l=a(e,o[2]);"0101ff"==l&&(i.reqauth=!0),"010100"==l&&(i.reqauth=!1)}return i},this.getExtSubjectDirectoryAttributes=function(e,t){if(void 0===e&&void 0===t){var n=this.getExtInfo("subjectDirectoryAttributes");if(void 0===n)return;e=a(this.hex,n.vidx),t=n.critical}var r={extname:"subjectDirectoryAttributes"};t&&(r.critical=!0);try{for(var i=o(e),s=[],u=0;u<i.seq.length;u++){var l=i.seq[u],c=Qe(l,"seq.0.oid"),p=Qe(l,"seq.1.set");if(null==c||null==p)throw"error";s.push({attr:c,array:p})}return r.array=s,r}catch(e){throw new Error("malformed subjectDirectoryAttributes extension value")}};var b=function(e){var t={};try{var n=e.seq[0].oid,r=ue.asn1.x509.OID.name2oid(n);t.type=ue.asn1.x509.OID.oid2atype(r);var i=e.seq[1];if(null!=i.utf8str)t.ds="utf8",t.value=i.utf8str.str;else if(null!=i.numstr)t.ds="num",t.value=i.numstr.str;else if(null!=i.telstr)t.ds="tel",t.value=i.telstr.str;else if(null!=i.prnstr)t.ds="prn",t.value=i.prnstr.str;else if(null!=i.ia5str)t.ds="ia5",t.value=i.ia5str.str;else if(null!=i.visstr)t.ds="vis",t.value=i.visstr.str;else{if(null==i.bmpstr)throw"error";t.ds="bmp",t.value=i.bmpstr.str}return t}catch(e){throw new Erorr("improper ASN.1 parsed AttrTypeAndValue")}},w=function(e){try{return e.set.map((function(e){return b(e)}))}catch(e){throw new Error("improper ASN.1 parsed RDN: "+e)}};this.getX500NameRule=function(e){for(var t=null,n=[],r=0;r<e.length;r++)for(var i=e[r],o=0;o<i.length;o++)n.push(i[o]);for(r=0;r<n.length;r++){var a=n[r],s=a.ds,u=a.value,l=a.type;if(":"+s,"prn"!=s&&"utf8"!=s&&"ia5"!=s)return"mixed";if("ia5"==s){if("CN"!=l)return"mixed";if(ue.lang.String.isMail(u))continue;return"mixed"}if("C"==l){if("prn"==s)continue;return"mixed"}if(":"+s,null==t)t=s;else if(t!==s)return"mixed"}return null==t?"prn":t},this.getAttrTypeAndValue=function(e){var t=o(e);return b(t)},this.getRDN=function(e){var t=o(e);return w(t)},this.getX500NameArray=function(e){return function(e){try{return e.seq.map((function(e){return w(e)}))}catch(e){throw new Error("improper ASN.1 parsed X500Name: "+e)}}(o(e))},this.getX500Name=function(e,t,n){var r=this.getX500NameArray(e),i={str:this.dnarraytostr(r)};return i.array=r,1==n&&(i.hex=e),1==t&&(i.canon=this.c14nRDNArray(r)),i},this.readCertPEM=function(e){this.readCertHex(v(e))},this.readCertHex=function(e){this.hex=e,this.getVersion();try{p(this.hex,0,[0,7],"a3"),this.parseExt()}catch(e){}},this.getParam=function(e){var t={};return null==e&&(e={}),t.version=this.getVersion(),t.serial={hex:this.getSerialNumberHex()},t.sigalg=this.getSignatureAlgorithmField(),t.issuer=this.getIssuer(e.dncanon,e.dnhex),t.notbefore=this.getNotBefore(),t.notafter=this.getNotAfter(),t.subject=this.getSubject(e.dncanon,e.dnhex),t.sbjpubkey=De(this.getPublicKeyHex(),"PUBLIC KEY"),null!=this.aExtInfo&&this.aExtInfo.length>0&&(t.ext=this.getExtParamArray()),t.sighex=this.getSignatureValueHex(),1==e.tbshex&&(t.tbshex=l(this.hex,0,[0])),1==e.nodnarray&&(delete t.issuer.array,delete t.subject.array),t},this.getExtParamArray=function(e){null==e&&(-1!=h(this.hex,0,[0,"[3]"])&&(e=c(this.hex,0,[0,"[3]",0],"30")));for(var t=[],n=r(e,0),i=0;i<n.length;i++){var o=a(e,n[i]),s=this.getExtParam(o);null!=s&&t.push(s)}return t},this.getExtParam=function(e){var t=r(e,0).length;if(2!=t&&3!=t)throw new Error("wrong number elements in Extension: "+t+" "+e);var n=m(s(e,0,[0],"06")),i=!1;3==t&&"0101ff"==l(e,0,[1])&&(i=!0);var a=l(e,0,[t-1,0]),u=void 0;if("2.5.29.14"==n?u=this.getExtSubjectKeyIdentifier(a,i):"2.5.29.15"==n?u=this.getExtKeyUsage(a,i):"2.5.29.17"==n?u=this.getExtSubjectAltName(a,i):"2.5.29.18"==n?u=this.getExtIssuerAltName(a,i):"2.5.29.19"==n?u=this.getExtBasicConstraints(a,i):"2.5.29.30"==n?u=this.getExtNameConstraints(a,i):"2.5.29.31"==n?u=this.getExtCRLDistributionPoints(a,i):"2.5.29.32"==n?u=this.getExtCertificatePolicies(a,i):"2.5.29.33"==n?u=this.getExtPolicyMappings(a,i):"2.5.29.35"==n?u=this.getExtAuthorityKeyIdentifier(a,i):"2.5.29.36"==n?u=this.getExtPolicyConstraints(a,i):"2.5.29.37"==n?u=this.getExtExtKeyUsage(a,i):"2.5.29.54"==n?u=this.getExtInhibitAnyPolicy(a,i):"1.3.6.1.5.5.7.1.1"==n?u=this.getExtAuthorityInfoAccess(a,i):"2.5.29.20"==n?u=this.getExtCRLNumber(a,i):"2.5.29.21"==n?u=this.getExtCRLReason(a,i):"2.5.29.9"==n?u=this.getExtSubjectDirectoryAttributes(a,i):"1.3.6.1.5.5.7.48.1.2"==n?u=this.getExtOcspNonce(a,i):"1.3.6.1.5.5.7.48.1.5"==n?u=this.getExtOcspNoCheck(a,i):"1.2.840.113583.1.1.9.1"==n?u=this.getExtAdobeTimeStamp(a,i):null!=ot.EXT_PARSER[n]&&(u=ot.EXT_PARSER[n](n,i,a)),null!=u)return u;var c={extname:n,extn:a};try{c.extn=o(a)}catch(e){}return i&&(c.critical=!0),c},this.findExt=function(e,t){for(var n=0;n<e.length;n++)if(e[n].extname==t)return e[n];return null},this.updateExtCDPFullURI=function(e,t){var n=this.findExt(e,"cRLDistributionPoints");if(null!=n&&null!=n.array)for(var r=n.array,i=0;i<r.length;i++)if(null!=r[i].dpname&&null!=r[i].dpname.full)for(var o=r[i].dpname.full,a=0;a<o.length;a++){var s=o[i];null!=s.uri&&(s.uri=t)}},this.updateExtAIAOCSP=function(e,t){var n=this.findExt(e,"authorityInfoAccess");if(null!=n&&null!=n.array)for(var r=n.array,i=0;i<r.length;i++)null!=r[i].ocsp&&(r[i].ocsp=t)},this.updateExtAIACAIssuer=function(e,t){var n=this.findExt(e,"authorityInfoAccess");if(null!=n&&null!=n.array)for(var r=n.array,i=0;i<r.length;i++)null!=r[i].caissuer&&(r[i].caissuer=t)},this.dnarraytostr=function(e){return"/"+e.map((function(e){return function(e){return e.map((function(e){return function(e){return e.type+"="+e.value}(e).replace(/\+/,"\\+")})).join("+")}(e).replace(/\//,"\\/")})).join("/")},this.setCanonicalizedDN=function(e){var t;if(null!=e.str&&null==e.array){var n=new ue.asn1.x509.X500Name({str:e.str}).tohex();t=this.getX500NameArray(n)}else t=e.array;null==e.canon&&(e.canon=this.c14nRDNArray(t))},this.c14nRDNArray=function(e){for(var t=[],n=0;n<e.length;n++){for(var r=e[n],i=[],o=0;o<r.length;o++){var a=r[o],s=a.value;s=(s=(s=(s=s.replace(/^\s*/,"")).replace(/\s*$/,"")).replace(/\s+/g," ")).toLowerCase(),i.push(a.type.toLowerCase()+"="+s)}t.push(i.join("+"))}return"/"+t.join("/")},this.getInfo=function(){var e,t,n,r=function(e){for(var t="",n=" ",r="\n",i=e.array,o=0;o<i.length;o++){var a=i[o];if(null!=a.dn&&(t+=n+"dn: "+a.dn.str+r),null!=a.ip&&(t+=n+"ip: "+a.ip+r),null!=a.rfc822&&(t+=n+"rfc822: "+a.rfc822+r),null!=a.dns&&(t+=n+"dns: "+a.dns+r),null!=a.uri&&(t+=n+"uri: "+a.uri+r),null!=a.other)t+=n+"other: "+a.other.oid+"="+JSON.stringify(a.other.value).replace(/\"/g,"")+r}return t=t.replace(/\n$/,"")},i=function(e){for(var t="",n=e.array,r=0;r<n.length;r++){var i=n[r];if(t+=" policy oid: "+i.policyoid+"\n",void 0!==i.array)for(var o=0;o<i.array.length;o++){var a=i.array[o];void 0!==a.cps&&(t+=" cps: "+a.cps+"\n")}}return t},o=function(e){for(var t="",n=e.array,r=0;r<n.length;r++){var i=n[r];try{void 0!==i.dpname.full[0].uri&&(t+=" "+i.dpname.full[0].uri+"\n")}catch(e){}try{void 0!==i.dname.full[0].dn.hex&&(t+=" "+ot.hex2dn(i.dpname.full[0].dn.hex)+"\n")}catch(e){}}return t},a=function(e){for(var t="",n=e.array,r=0;r<n.length;r++){var i=n[r];void 0!==i.caissuer&&(t+=" caissuer: "+i.caissuer+"\n"),void 0!==i.ocsp&&(t+=" ocsp: "+i.ocsp+"\n")}return t};if(e="Basic Fields\n",e+=" serial number: "+this.getSerialNumberHex()+"\n",e+=" signature algorithm: "+this.getSignatureAlgorithmField()+"\n",e+=" issuer: "+this.getIssuerString()+"\n",e+=" notBefore: "+this.getNotBefore()+"\n",e+=" notAfter: "+this.getNotAfter()+"\n",e+=" subject: "+this.getSubjectString()+"\n",e+=" subject public key info: \n",e+=" key algorithm: "+(t=this.getPublicKey()).type+"\n","RSA"===t.type&&(e+=" n="+Ke(t.n.toString(16)).substr(0,16)+"...\n",e+=" e="+Ke(t.e.toString(16))+"\n"),null!=(n=this.aExtInfo)){e+="X509v3 Extensions:\n";for(var s=0;s<n.length;s++){var u=n[s],l=ue.asn1.x509.OID.oid2name(u.oid);""===l&&(l=u.oid);var c="";if(!0===u.critical&&(c="CRITICAL"),e+=" "+l+" "+c+":\n","basicConstraints"===l){var p=this.getExtBasicConstraints();void 0===p.cA?e+=" {}\n":(e+=" cA=true",void 0!==p.pathLen&&(e+=", pathLen="+p.pathLen),e+="\n")}else{var h;if("policyMappings"==l)e+=" "+this.getExtPolicyMappings().array.map((function(e){var t=e;return t[0]+":"+t[1]})).join(", ")+"\n";else if("policyConstraints"==l)e+=" ",null!=(h=this.getExtPolicyConstraints()).reqexp&&(e+=" reqexp="+h.reqexp),null!=h.inhibit&&(e+=" inhibit="+h.inhibit),e+="\n";else if("inhibitAnyPolicy"==l)e+=" skip="+(h=this.getExtInhibitAnyPolicy()).skip+"\n";else if("keyUsage"==l)e+=" "+this.getExtKeyUsageString()+"\n";else if("subjectKeyIdentifier"==l)e+=" "+this.getExtSubjectKeyIdentifier().kid.hex+"\n";else if("authorityKeyIdentifier"==l){var d=this.getExtAuthorityKeyIdentifier();void 0!==d.kid&&(e+=" kid="+d.kid.hex+"\n")}else{if("extKeyUsage"==l)e+=" "+this.getExtExtKeyUsage().array.join(", ")+"\n";else if("subjectAltName"==l)e+=r(this.getExtSubjectAltName())+"\n";else if("cRLDistributionPoints"==l)e+=o(this.getExtCRLDistributionPoints());else if("authorityInfoAccess"==l)e+=a(this.getExtAuthorityInfoAccess());else"certificatePolicies"==l&&(e+=i(this.getExtCertificatePolicies()))}}}}return e+="signature algorithm: "+this.getSignatureAlgorithmName()+"\n",e+="signature: "+this.getSignatureValueHex().substr(0,16)+"...\n"},"string"==typeof e&&(-1!=e.indexOf("-----BEGIN")?this.readCertPEM(e):ue.lang.String.isHex(e)&&this.readCertHex(e))}ne.prototype.sign=function(e,t){var n=function(e){return ue.crypto.Util.hashString(e,t)}(e);return this.signWithMessageHash(n,t)},ne.prototype.signWithMessageHash=function(e,t){var n=ee(ue.crypto.Util.getPaddedDigestInfoHex(e,t,this.n.bitLength()),16);return nt(this.doPrivate(n).toString(16),this.n.bitLength())},ne.prototype.signPSS=function(e,t,n){var r,i=(r=Ae(e),ue.crypto.Util.hashHex(r,t));return void 0===n&&(n=-1),this.signWithMessageHashPSS(i,t,n)},ne.prototype.signWithMessageHashPSS=function(e,t,n){var r,i=Ee(e),o=i.length,a=this.n.bitLength()-1,s=Math.ceil(a/8),u=function(e){return ue.crypto.Util.hashHex(e,t)};if(-1===n||void 0===n)n=o;else if(-2===n)n=s-o-2;else if(n<-2)throw new Error("invalid salt length");if(s<o+n+2)throw new Error("data too long");var l="";n>0&&(l=new Array(n),(new Q).nextBytes(l),l=String.fromCharCode.apply(String,l));var c=Ee(u(Ae("\0\0\0\0\0\0\0\0"+i+l))),p=[];for(r=0;r<s-n-o-2;r+=1)p[r]=0;var h=String.fromCharCode.apply(String,p)+""+l,d=rt(c,h.length,u),f=[];for(r=0;r<h.length;r+=1)f[r]=h.charCodeAt(r)^d.charCodeAt(r);var g=65280>>8*s-a&255;for(f[0]&=~g,r=0;r<o;r++)f.push(c.charCodeAt(r));return f.push(188),nt(this.doPrivate(new x(f)).toString(16),this.n.bitLength())},ne.prototype.verify=function(e,t){if(null==(t=t.toLowerCase()).match(/^[0-9a-f]+$/))return!1;var n=ee(t,16),r=this.n.bitLength();if(n.bitLength()>r)return!1;var i=this.doPublic(n).toString(16);if(i.length+3!=r/4)return!1;var o=it(i.replace(/^1f+00/,""));if(0==o.length)return!1;var a=o[0];return o[1]==function(e){return ue.crypto.Util.hashString(e,a)}(e)},ne.prototype.verifyWithMessageHash=function(e,t){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var n=ee(t,16);if(n.bitLength()>this.n.bitLength())return 0;var r=it(this.doPublic(n).toString(16).replace(/^1f+00/,""));if(0==r.length)return!1;r[0];return r[1]==e},ne.prototype.verifyPSS=function(e,t,n,r){var i,o=(i=Ae(e),ue.crypto.Util.hashHex(i,n));return void 0===r&&(r=-1),this.verifyWithMessageHashPSS(o,t,n,r)},ne.prototype.verifyWithMessageHashPSS=function(e,t,n,r){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var i,o=new x(t,16),a=function(e){return ue.crypto.Util.hashHex(e,n)},s=Ee(e),u=s.length,l=this.n.bitLength()-1,c=Math.ceil(l/8);if(-1===r||void 0===r)r=u;else if(-2===r)r=c-u-2;else if(r<-2)throw new Error("invalid salt length");if(c<u+r+2)throw new Error("data too long");var p=this.doPublic(o).toByteArray();for(i=0;i<p.length;i+=1)p[i]&=255;for(;p.length<c;)p.unshift(0);if(188!==p[c-1])throw new Error("encoded message does not end in 0xbc");var h=(p=String.fromCharCode.apply(String,p)).substr(0,c-u-1),d=p.substr(h.length,u),f=65280>>8*c-l&255;if(0!=(h.charCodeAt(0)&f))throw new Error("bits beyond keysize not zero");var g=rt(d,h.length,a),m=[];for(i=0;i<h.length;i+=1)m[i]=h.charCodeAt(i)^g.charCodeAt(i);m[0]&=~f;var v=c-u-r-2;for(i=0;i<v;i+=1)if(0!==m[i])throw new Error("leftmost octets not zero");if(1!==m[v])throw new Error("0x01 marker not found");return d===Ee(a(Ae("\0\0\0\0\0\0\0\0"+s+String.fromCharCode.apply(String,m.slice(-r)))))},ne.SALT_LEN_HLEN=-1,ne.SALT_LEN_MAX=-2,ne.SALT_LEN_RECOVER=-2,ot.EXT_PARSER={},ot.registExtParser=function(e,t){ot.EXT_PARSER[e]=t},ot.hex2dn=function(e,t){void 0===t&&(t=0);var n=new ot;pe.getTLV(e,t);return n.getX500Name(e).str},ot.hex2rdn=function(e,t){if(void 0===t&&(t=0),"31"!==e.substr(t,2))throw new Error("malformed RDN");for(var n=new Array,r=pe.getChildIdx(e,t),i=0;i<r.length;i++)n.push(ot.hex2attrTypeValue(e,r[i]));return(n=n.map((function(e){return e.replace("+","\\+")}))).join("+")},ot.hex2attrTypeValue=function(e,t){var n=pe,r=n.getV;if(void 0===t&&(t=0),"30"!==e.substr(t,2))throw new Error("malformed attribute type and value");var i=n.getChildIdx(e,t);2!==i.length||e.substr(i[0],2);var o=r(e,i[0]),a=ue.asn1.ASN1Util.oidHexToInt(o);return ue.asn1.x509.OID.oid2atype(a)+"="+Ee(r(e,i[1]))},ot.getPublicKeyFromCertHex=function(e){var t=new ot;return t.readCertHex(e),t.getPublicKey()},ot.getPublicKeyFromCertPEM=function(e){var t=new ot;return t.readCertPEM(e),t.getPublicKey()},ot.getPublicKeyInfoPropOfCertPEM=function(e){var t,n,r=pe.getVbyList,i={};return i.algparam=null,(t=new ot).readCertPEM(e),n=t.getPublicKeyHex(),i.keyhex=r(n,0,[1],"03").substr(2),i.algoid=r(n,0,[0,0],"06"),"2a8648ce3d0201"===i.algoid&&(i.algparam=r(n,0,[0,1],"06")),i},ot.KEYUSAGE_NAME=["digitalSignature","nonRepudiation","keyEncipherment","dataEncipherment","keyAgreement","keyCertSign","cRLSign","encipherOnly","decipherOnly"];void 0!==ue&&ue||(ue={}),void 0!==ue.jws&&ue.jws||(ue.jws={}),ue.jws.JWS=function(){var e=ue.jws.JWS.isSafeJSONString;this.parseJWS=function(t,n){if(void 0===this.parsedJWS||!n&&void 0===this.parsedJWS.sigvalH){var r=t.match(/^([^.]+)\.([^.]+)\.([^.]+)$/);if(null==r)throw"JWS signature is not a form of 'Head.Payload.SigValue'.";var i=r[1],o=r[2],a=r[3],s=i+"."+o;if(this.parsedJWS={},this.parsedJWS.headB64U=i,this.parsedJWS.payloadB64U=o,this.parsedJWS.sigvalB64U=a,this.parsedJWS.si=s,!n){var u=be(a),l=ee(u,16);this.parsedJWS.sigvalH=u,this.parsedJWS.sigvalBI=l}var c=ce(i),p=ce(o);if(this.parsedJWS.headS=c,this.parsedJWS.payloadS=p,!e(c,this.parsedJWS,"headP"))throw"malformed JSON string for JWS Head: "+c}}},ue.jws.JWS.sign=function(e,t,n,r,i){var o,a,s,u=ue,l=u.jws.JWS,c=l.readSafeJSONString,p=l.isSafeJSONString,h=u.crypto,d=(h.ECDSA,h.Mac),f=h.Signature,g=JSON;if("string"!=typeof t&&"object"!=typeof t)throw"spHeader must be JSON string or object: "+t;if("object"==typeof t&&(a=t,o=g.stringify(a)),"string"==typeof t){if(!p(o=t))throw"JWS Head is not safe JSON string: "+o;a=c(o)}if(s=n,"object"==typeof n&&(s=g.stringify(n)),""!=e&&null!=e||void 0===a.alg||(e=a.alg),""!=e&&null!=e&&void 0===a.alg&&(a.alg=e,o=g.stringify(a)),e!==a.alg)throw"alg and sHeader.alg doesn't match: "+e+"!="+a.alg;var m=null;if(void 0===l.jwsalg2sigalg[e])throw"unsupported alg name: "+e;m=l.jwsalg2sigalg[e];var v=le(o)+"."+le(s),y="";if("Hmac"==m.substr(0,4)){if(void 0===r)throw"mac key shall be specified for HS* alg";var b=new d({alg:m,prov:"cryptojs",pass:r});b.updateString(v),y=b.doFinal()}else if(-1!=m.indexOf("withECDSA")){(x=new f({alg:m})).init(r,i),x.updateString(v);var w=x.sign();y=ue.crypto.ECDSA.asn1SigToConcatSig(w)}else{var x;if("none"!=m)(x=new f({alg:m})).init(r,i),x.updateString(v),y=x.sign()}return v+"."+ye(y)},ue.jws.JWS.verify=function(e,t,n){var r,i=ue,o=i.jws.JWS,a=o.readSafeJSONString,s=i.crypto,u=s.ECDSA,l=s.Mac,c=s.Signature;if(r=ne,!qe(e))return!1;var p=e.split(".");if(3!==p.length)return!1;var h=p[0]+"."+p[1],d=be(p[2]),f=a(ce(p[0])),g=null,m=null;if(void 0===f.alg)throw"algorithm not specified in header";if((m=(g=f.alg).substr(0,2),null!=n&&"[object Array]"===Object.prototype.toString.call(n)&&n.length>0)&&-1==(":"+n.join(":")+":").indexOf(":"+g+":"))throw"algorithm '"+g+"' not accepted in the list";if("none"!=g&&null===t)throw"key shall be specified to verify.";if("string"==typeof t&&-1!=t.indexOf("-----BEGIN ")&&(t=tt.getKey(t)),!("RS"!=m&&"PS"!=m||t instanceof r))throw"key shall be a RSAKey obj for RS* and PS* algs";if("ES"==m&&!(t instanceof u))throw"key shall be a ECDSA obj for ES* algs";var v=null;if(void 0===o.jwsalg2sigalg[f.alg])throw"unsupported alg name: "+g;if("none"==(v=o.jwsalg2sigalg[g]))throw"not supported";if("Hmac"==v.substr(0,4)){if(void 0===t)throw"hexadecimal key shall be specified for HMAC";var y=new l({alg:v,pass:t});return y.updateString(h),d==y.doFinal()}if(-1!=v.indexOf("withECDSA")){var b,w=null;try{w=u.concatSigToASN1Sig(d)}catch(e){return!1}return(b=new c({alg:v})).init(t),b.updateString(h),b.verify(w)}return(b=new c({alg:v})).init(t),b.updateString(h),b.verify(d)},ue.jws.JWS.parse=function(e){var t,n,r,i=e.split("."),o={};if(2!=i.length&&3!=i.length)throw"malformed sJWS: wrong number of '.' splitted elements";return t=i[0],n=i[1],3==i.length&&(r=i[2]),o.headerObj=ue.jws.JWS.readSafeJSONString(ce(t)),o.payloadObj=ue.jws.JWS.readSafeJSONString(ce(n)),o.headerPP=JSON.stringify(o.headerObj,null," "),null==o.payloadObj?o.payloadPP=ce(n):o.payloadPP=JSON.stringify(o.payloadObj,null," "),void 0!==r&&(o.sigHex=be(r)),o},ue.jws.JWS.verifyJWT=function(e,t,n){var r=ue.jws,i=r.JWS,o=i.readSafeJSONString,a=i.inArray,s=i.includedArray;if(!qe(e))return!1;var u=e.split(".");if(3!=u.length)return!1;var l=u[0],c=u[1],p=(be(u[2]),o(ce(l))),h=o(ce(c));if(void 0===p.alg)return!1;if(void 0===n.alg)throw"acceptField.alg shall be specified";if(!a(p.alg,n.alg))return!1;if(void 0!==h.iss&&"object"==typeof n.iss&&!a(h.iss,n.iss))return!1;if(void 0!==h.sub&&"object"==typeof n.sub&&!a(h.sub,n.sub))return!1;if(void 0!==h.aud&&"object"==typeof n.aud)if("string"==typeof h.aud){if(!a(h.aud,n.aud))return!1}else if("object"==typeof h.aud&&!s(h.aud,n.aud))return!1;var d=r.IntDate.getNow();return void 0!==n.verifyAt&&"number"==typeof n.verifyAt&&(d=n.verifyAt),void 0!==n.gracePeriod&&"number"==typeof n.gracePeriod||(n.gracePeriod=0),!(void 0!==h.exp&&"number"==typeof h.exp&&h.exp+n.gracePeriod<d)&&(!(void 0!==h.nbf&&"number"==typeof h.nbf&&d<h.nbf-n.gracePeriod)&&(!(void 0!==h.iat&&"number"==typeof h.iat&&d<h.iat-n.gracePeriod)&&((void 0===h.jti||void 0===n.jti||h.jti===n.jti)&&!!i.verify(e,t,n.alg))))},ue.jws.JWS.includedArray=function(e,t){var n=ue.jws.JWS.inArray;if(null===e)return!1;if("object"!=typeof e)return!1;if("number"!=typeof e.length)return!1;for(var r=0;r<e.length;r++)if(!n(e[r],t))return!1;return!0},ue.jws.JWS.inArray=function(e,t){if(null===t)return!1;if("object"!=typeof t)return!1;if("number"!=typeof t.length)return!1;for(var n=0;n<t.length;n++)if(t[n]==e)return!0;return!1},ue.jws.JWS.jwsalg2sigalg={HS256:"HmacSHA256",HS384:"HmacSHA384",HS512:"HmacSHA512",RS256:"SHA256withRSA",RS384:"SHA384withRSA",RS512:"SHA512withRSA",ES256:"SHA256withECDSA",ES384:"SHA384withECDSA",ES512:"SHA512withECDSA",PS256:"SHA256withRSAandMGF1",PS384:"SHA384withRSAandMGF1",PS512:"SHA512withRSAandMGF1",none:"none"},ue.jws.JWS.isSafeJSONString=function(e,t,n){var r=null;try{return"object"!=typeof(r=se(e))||r.constructor===Array?0:(t&&(t[n]=r),1)}catch(e){return 0}},ue.jws.JWS.readSafeJSONString=function(e){var t=null;try{return"object"!=typeof(t=se(e))||t.constructor===Array?null:t}catch(e){return null}},ue.jws.JWS.getEncodedSignatureValueFromJWS=function(e){var t=e.match(/^[^.]+\.[^.]+\.([^.]+)$/);if(null==t)throw"JWS signature is not a form of 'Head.Payload.SigValue'.";return t[1]},ue.jws.JWS.getJWKthumbprint=function(e){if("RSA"!==e.kty&&"EC"!==e.kty&&"oct"!==e.kty)throw"unsupported algorithm for JWK Thumprint";var t="{";if("RSA"===e.kty){if("string"!=typeof e.n||"string"!=typeof e.e)throw"wrong n and e value for RSA key";t+='"e":"'+e.e+'",',t+='"kty":"'+e.kty+'",',t+='"n":"'+e.n+'"}'}else if("EC"===e.kty){if("string"!=typeof e.crv||"string"!=typeof e.x||"string"!=typeof e.y)throw"wrong crv, x and y value for EC key";t+='"crv":"'+e.crv+'",',t+='"kty":"'+e.kty+'",',t+='"x":"'+e.x+'",',t+='"y":"'+e.y+'"}'}else if("oct"===e.kty){if("string"!=typeof e.k)throw"wrong k value for oct(symmetric) key";t+='"kty":"'+e.kty+'",',t+='"k":"'+e.k+'"}'}var n=Ae(t);return ye(ue.crypto.Util.hashHex(n,"sha256"))},ue.jws.IntDate={},ue.jws.IntDate.get=function(e){var t=ue.jws.IntDate,n=t.getNow,r=t.getZulu;if("now"==e)return n();if("now + 1hour"==e)return n()+3600;if("now + 1day"==e)return n()+86400;if("now + 1month"==e)return n()+2592e3;if("now + 1year"==e)return n()+31536e3;if(e.match(/Z$/))return r(e);if(e.match(/^[0-9]+$/))return parseInt(e);throw"unsupported format: "+e},ue.jws.IntDate.getZulu=function(e){return Re(e)},ue.jws.IntDate.getNow=function(){return~~(new Date/1e3)},ue.jws.IntDate.intDate2UTCString=function(e){return new Date(1e3*e).toUTCString()},ue.jws.IntDate.intDate2Zulu=function(e){var t=new Date(1e3*e);return("0000"+t.getUTCFullYear()).slice(-4)+("00"+(t.getUTCMonth()+1)).slice(-2)+("00"+t.getUTCDate()).slice(-2)+("00"+t.getUTCHours()).slice(-2)+("00"+t.getUTCMinutes()).slice(-2)+("00"+t.getUTCSeconds()).slice(-2)+"Z"},void 0!==ue&&ue||(ue={}),void 0!==ue.jws&&ue.jws||(ue.jws={}),ue.jws.JWSJS=function(){var e=ue.jws.JWS,t=e.readSafeJSONString;this.aHeader=[],this.sPayload="",this.aSignature=[],this.init=function(){this.aHeader=[],this.sPayload=void 0,this.aSignature=[]},this.initWithJWS=function(e){this.init();var t=e.split(".");if(3!=t.length)throw"malformed input JWS";this.aHeader.push(t[0]),this.sPayload=t[1],this.aSignature.push(t[2])},this.addSignature=function(e,t,n,r){if(void 0===this.sPayload||null===this.sPayload)throw"there's no JSON-JS signature to add.";var i=this.aHeader.length;if(this.aHeader.length!=this.aSignature.length)throw"aHeader.length != aSignature.length";try{var o=ue.jws.JWS.sign(e,t,this.sPayload,n,r).split(".");o[0],o[2];this.aHeader.push(o[0]),this.aSignature.push(o[2])}catch(e){throw this.aHeader.length>i&&this.aHeader.pop(),this.aSignature.length>i&&this.aSignature.pop(),"addSignature failed: "+e}},this.verifyAll=function(e){if(this.aHeader.length!==e.length||this.aSignature.length!==e.length)return!1;for(var t=0;t<e.length;t++){var n=e[t];if(2!==n.length)return!1;if(!1===this.verifyNth(t,n[0],n[1]))return!1}return!0},this.verifyNth=function(t,n,r){if(this.aHeader.length<=t||this.aSignature.length<=t)return!1;var i=this.aHeader[t],o=this.aSignature[t],a=i+"."+this.sPayload+"."+o,s=!1;try{s=e.verify(a,n,r)}catch(e){return!1}return s},this.readJWSJS=function(e){if("string"==typeof e){var n=t(e);if(null==n)throw"argument is not safe JSON object string";this.aHeader=n.headers,this.sPayload=n.payload,this.aSignature=n.signatures}else try{if(!(e.headers.length>0))throw"malformed header";if(this.aHeader=e.headers,"string"!=typeof e.payload)throw"malformed signatures";if(this.sPayload=e.payload,!(e.signatures.length>0))throw"malformed signatures";this.aSignature=e.signatures}catch(e){throw"malformed JWS-JS JSON object: "+e}},this.getJSON=function(){return{headers:this.aHeader,payload:this.sPayload,signatures:this.aSignature}},this.isEmpty=function(){return 0==this.aHeader.length?1:0}},t.SecureRandom=Q,t.rng_seed_time=G,t.BigInteger=x,t.RSAKey=ne,t.ECDSA=ue.crypto.ECDSA,t.DSA=ue.crypto.DSA,t.Signature=ue.crypto.Signature,t.MessageDigest=ue.crypto.MessageDigest,t.Mac=ue.crypto.Mac,t.Cipher=ue.crypto.Cipher,t.KEYUTIL=tt,t.ASN1HEX=pe,t.X509=ot,t.X509CRL=function(e){var t=ue.lang.String.isHex,n=pe,r=n.getV,i=n.getTLV,o=n.getVbyList,a=n.getTLVbyList,s=n.getTLVbyListEx,u=n.getIdxbyList,l=n.getIdxbyListEx,c=n.getChildIdx,p=new ot;this.hex=null,this.posSigAlg=null,this.posRevCert=null,this.parsed=null,this._setPos=function(){var e=u(this.hex,0,[0,0]),t=this.hex.substr(e,2);if("02"==t)this.posSigAlg=1;else{if("30"!=t)throw new Error("malformed 1st item of TBSCertList: "+t);this.posSigAlg=0}var n,r=u(this.hex,0,[0,this.posSigAlg+3]),i=this.hex.substr(r,2);if("17"==i||"18"==i)n=u(this.hex,0,[0,this.posSigAlg+4]),this.posRevCert=null,-1!=n&&"30"==this.hex.substr(n,2)&&(this.posRevCert=this.posSigAlg+4);else if("30"==i)this.posRevCert=this.posSigAlg+3;else{if("a0"!=i)throw new Error("malformed nextUpdate or revCert tag: "+i);this.posRevCert=null}},this.getVersion=function(){return 0==this.posSigAlg?null:parseInt(o(this.hex,0,[0,0],"02"),16)+1},this.getSignatureAlgorithmField=function(){var e=a(this.hex,0,[0,this.posSigAlg],"30");return p.getAlgorithmIdentifierName(e)},this.getIssuer=function(){return p.getX500Name(this.getIssuerHex())},this.getIssuerHex=function(){return a(this.hex,0,[0,this.posSigAlg+1],"30")},this.getThisUpdate=function(){var e=o(this.hex,0,[0,this.posSigAlg+2]);return result=Ee(e)},this.getNextUpdate=function(){var e=u(this.hex,0,[0,this.posSigAlg+3]),t=this.hex.substr(e,2);return"17"!=t&&"18"!=t?null:Ee(r(this.hex,e))},this.getRevCertArray=function(){if(null==this.posRevCert)return null;for(var e=[],t=u(this.hex,0,[0,this.posRevCert]),n=c(this.hex,t),r=0;r<n.length;r++){var o=i(this.hex,n[r]);e.push(this.getRevCert(o))}return e},this.getRevCert=function(e){var t={},n=c(e,0);return t.sn={hex:o(e,0,[0],"02")},t.date=Ee(o(e,0,[1])),3==n.length&&(t.ext=p.getExtParamArray(a(e,0,[2]))),t},this.findRevCert=function(e){var t=new ot(e).getSerialNumberHex();return this.findRevCertBySN(t)},this.findRevCertBySN=function(e){if(null==this.parsed&&this.getParam(),null==this.parsed.revcert)return null;for(var t=this.parsed.revcert,n=0;n<t.length;n++)if(e==t[n].sn.hex)return t[n];return null},this.getSignatureValueHex=function(){return o(this.hex,0,[2],"03",!0)},this.verifySignature=function(e){var t=this.getSignatureAlgorithmField(),n=this.getSignatureValueHex(),r=a(this.hex,0,[0],"30"),i=new ue.crypto.Signature({alg:t});return i.init(e),i.updateHex(r),i.verify(n)},this.getParam=function(e){var t={},n=this.getVersion();null!=n&&(t.version=n),t.sigalg=this.getSignatureAlgorithmField(),t.issuer=this.getIssuer(),t.thisupdate=this.getThisUpdate();var r=this.getNextUpdate();null!=r&&(t.nextupdate=r);var i=this.getRevCertArray();if(null!=i&&(t.revcert=i),-1!=l(this.hex,0,[0,"[0]"])){var o=s(this.hex,0,[0,"[0]",0]);t.ext=p.getExtParamArray(o)}return t.sighex=this.getSignatureValueHex(),this.parsed=t,"object"==typeof e&&(1==e.tbshex&&(t.tbshex=a(this.hex,0,[0])),1==e.nodnarray&&delete t.issuer.array),t},"string"==typeof e&&(t(e)?this.hex=e:e.match(/-----BEGIN X509 CRL/)&&(this.hex=Te(e)),this._setPos())},t.CryptoJS=g,t.b64tohex=b,t.b64toBA=w,t.ECFieldElementFp=ie,t.ECPointFp=oe,t.ECCurveFp=ae,t.stoBA=he,t.BAtos=de,t.BAtohex=fe,t.stohex=ge,t.stob64=function(e){return y(ge(e))},t.stob64u=function(e){return me(y(ge(e)))},t.b64utos=function(e){return de(w(ve(e)))},t.b64tob64u=me,t.b64utob64=ve,t.hex2b64=y,t.hextob64u=ye,t.b64utohex=be,t.utf8tob64u=le,t.b64utoutf8=ce,t.utf8tob64=function(e){return y(Oe(He(e)))},t.b64toutf8=function(e){return decodeURIComponent(ke(b(e)))},t.utf8tohex=we,t.hextoutf8=xe,t.hextorstr=Ee,t.rstrtohex=Ae,t.hextob64=Fe,t.hextob64nl=function(e){return Ce(Fe(e),64)},t.b64nltohex=$e,t.hextopem=De,t.pemtohex=Te,t.hextoArrayBuffer=function(e){if(e.length%2!=0)throw"input is not even length";if(null==e.match(/^[0-9A-Fa-f]+$/))throw"input is not hexadecimal";for(var t=new ArrayBuffer(e.length/2),n=new DataView(t),r=0;r<e.length/2;r++)n.setUint8(r,parseInt(e.substr(2*r,2),16));return t},t.ArrayBuffertohex=function(e){for(var t="",n=new DataView(e),r=0;r<e.byteLength;r++)t+=("00"+n.getUint8(r).toString(16)).slice(-2);return t},t.zulutomsec=Ie,t.msectozulu=function(e){var t=new Date(e),n=("0000"+t.getUTCFullYear()).slice(-4),r=("00"+(t.getUTCMonth()+1)).slice(-2),i=("00"+t.getUTCDate()).slice(-2),o=("00"+t.getUTCHours()).slice(-2),a=("00"+t.getUTCMinutes()).slice(-2),s=("00"+t.getUTCSeconds()).slice(-2),u=("000"+t.getUTCMilliseconds()).slice(-3);return n+r+i+o+a+s+(u=""!=(u=u.replace(/0+$/,""))?"."+u:u)+"Z"},t.zulutosec=Re,t.zulutodate=function(e){return new Date(Ie(e))},t.datetozulu=function(e,t,n){var r,i=e.getUTCFullYear();if(t){if(i<1950||2049<i)throw"not proper year for UTCTime: "+i;r=(""+i).slice(-2)}else r=("000"+i).slice(-4);if(r+=("0"+(e.getUTCMonth()+1)).slice(-2),r+=("0"+e.getUTCDate()).slice(-2),r+=("0"+e.getUTCHours()).slice(-2),r+=("0"+e.getUTCMinutes()).slice(-2),r+=("0"+e.getUTCSeconds()).slice(-2),n){var o=e.getUTCMilliseconds();0!==o&&(r+="."+(o=(o=("00"+o).slice(-3)).replace(/0+$/g,"")))}return r+="Z"},t.uricmptohex=Oe,t.hextouricmp=ke,t.ipv6tohex=_e,t.hextoipv6=je,t.hextoip=Ne,t.iptohex=Be,t.ucs2hextoutf8=Me,t.encodeURIComponentAll=He,t.newline_toUnix=function(e){return e=e.replace(/\r\n/gm,"\n")},t.newline_toDos=function(e){return e=(e=e.replace(/\r\n/gm,"\n")).replace(/\n/gm,"\r\n")},t.hextoposhex=Ke,t.intarystrtohex=function(e){e=(e=(e=e.replace(/^\s*\[\s*/,"")).replace(/\s*\]\s*$/,"")).replace(/\s*/g,"");try{return e.split(/,/).map((function(e,t,n){var r=parseInt(e);if(r<0||255<r)throw"integer not in range 0-255";return("00"+r.toString(16)).slice(-2)})).join("")}catch(e){throw"malformed integer array string: "+e}},t.strdiffidx=function(e,t){var n=e.length;e.length>t.length&&(n=t.length);for(var r=0;r<n;r++)if(e.charCodeAt(r)!=t.charCodeAt(r))return r;return e.length!=t.length?n:-1},t.oidtohex=ze,t.hextooid=Ge,t.strpad=We,t.bitstrtoint=Ye,t.inttobitstr=Xe,t.bitstrtobinstr=Je,t.binstrtobitstr=function(e){if("string"!=typeof e)return null;if(null==e.match(/^[01]+$/))return null;try{return Xe(parseInt(e,2))}catch(e){return null}},t.isBase64URLDot=qe,t.namearraytobinstr=Ze,t.extendClass=et,t.foldnl=Ce,t.b64topem=function(e,t){return"-----BEGIN "+t+"-----\r\n"+Ce(e,64)+"\r\n-----END "+t+"-----\r\n"},t.pemtob64=function(e){return-1==e.indexOf("-----BEGIN ")||-1==e.indexOf("-----END ")?null:(e=(e=(e=e.replace(/^[\s\S]*?-----BEGIN [^-]+-----/m,"")).replace(/-----END [\s\S]+$/m,"")).replace(/\s+/g,"")).match(/^[0-9a-zA-Z+/=]+$/)?e:null},t.timeogen=Pe,t.aryval=Qe,t.KJUR=ue,t.crypto=ue.crypto,t.asn1=ue.asn1,t.jws=ue.jws,t.lang=ue.lang,t.VERSION="10.8.6",t.VERSION_FULL="jsrsasign(all) 10.8.6 (2023-04-26) (c) 2010-2023 Kenji Urushima | kjur.github.io/jsrsasign/license"}).call(this,n(144).Buffer)},function(e,t,n){"use strict";n.r(t);n(235),n(236),n(237),n(238),n(239),n(240),n(74),n(243),n(244),n(39),n(245),n(23),n(29),n(55);function r(e,t,n){return{openSimpleModal:r,openCopyToClipboardModal:function(t){return e.open({templateUrl:"js/angular/core/templates/modal/copy-to-clipboard-modal.html",controller:"CopyToClipboardModalCtrl",resolve:{uri:function(){return t}}})},openConfirmation:function(e,t,n,i){r({title:e,message:t,warning:!0}).result.then((function(){angular.isFunction(n)&&n()}),(function(){angular.isFunction(i)&&i()}))}};function r(t){return e.open({templateUrl:t.warning?"js/angular/core/templates/modal/modal-warning.html":"js/angular/core/templates/modal/modal-simple.html",controller:"SimpleModalCtrl",size:t.size,resolve:{title:function(){return t.title},message:function(){return n.trustAsHtml(t.message)}}})}}function i(e){return{getDetails:function(t){return e.get("rest/explore/details",{params:{uri:t},headers:{Accept:"application/json"}})},getGraph:function(t){const n=encodeURIComponent(t);return e.get("rest/explore/graph?uri="+n+"&role=subject",{headers:{Accept:"application/rdf+json"}})},getNamespaceUriForPrefix:function(e,t){let n="";for(let r=0;r<e.length;r++)if(e[r].prefix===t){n=e[r].uri;break}return n},getNamespacePrefixForUri:function(e,t){let n="";for(let r=0;r<e.length;r++)if(e[r].uri===t){n=e[r].prefix;break}return n},getLocalName:function(e){if(angular.isUndefined(e))return e;{let t;const n=e.length-1;let r=e.toString().lastIndexOf("/");r===n&&(t=e.substr(0,n),r=t.lastIndexOf("/"));let i=e.toString().lastIndexOf("#");return i===n&&(t=e.substr(0,n),i=t.lastIndexOf("/")),e.toString().substring(Math.max(i,r)+1)}}}}angular.module("graphdb.framework.core",["ui.bootstrap","jlareau.bowser","LocalStorageModule","graphdb.framework.core.controllers","pascalprecht.translate"]).provider("$menuItems",(function(){const e=function(t,n){for(let r=0;r<t.length;r++){const i=t[r];if(i.label===n)return i;const o=e(i.children,n);if(!angular.isUndefined(o))return o}},t=function(e,t){for(let n=0;n<e.length;n++){if(e[n].label===t)return!0}return!1},n=function(e,t){return e.order<t.order?-1:e.order>t.order?1:0},r=function(e,t){return{label:e.label,labelKey:e.labelKey,href:e.href,hrefFun:e.hrefFun,order:e.order,role:e.role,editions:e.editions,icon:e.icon,guideSelector:e.guideSelector,children:t}};let i;const o=[];let a=[];this.addItem=function(e){angular.isUndefined(e.parent)?t(o,e.label)||(o.push(r(e,[])),this.updateItemsWithMissedParent()):this.addItemToParent(e)||a.push(e)},this.addItemToParent=function(n){const i=e(o,n.parent);return!angular.isUndefined(i)&&!t(i.children,n.label)&&(i.children.push(r(n,n.children?n.children:[])),!0)},this.updateItemsWithMissedParent=function(){if(a.length>0){const e=[];let t=this;a.forEach((function(n){t.addItemToParent(n)||e.push(n)})),a=e}},this.$get=function(){o.sort(n);for(let e=0;e<o.length;e++){o[e].children.sort(n)}return o},this.setProductInfo=function(e){i=e},this.getProductInfo=function(){return i}})).factory("ModalService",r).factory("ClassInstanceDetailsService",i).factory("AuthTokenService",(function(){const e="com.ontotext.graphdb.auth";return{AUTH_STORAGE_NAME:e,getAuthToken:function(){return localStorage.getItem(e)},setAuthToken:function(t){localStorage.setItem(e,t)},clearAuthToken:function(){localStorage.removeItem(e)},OPENID_CONFIG:{}}})),r.$inject=["$uibModal","$timeout","$sce"],i.$inject=["$http"]},function(e,t,n){"use strict";n.r(t),n.d(t,"ActiveOperationModel",(function(){return i}));var r=n(4);class i{constructor(){this.operationGroup=void 0,this.runningOperationCount=0,this.status=r.OPERATION_STATUS.INFORMATION,this.type=void 0,this.titleLabelKey="",this.monitoringViewUrl=""}}},function(e,t,n){"use strict";n.r(t),n.d(t,"OPERATION_MONITORING_CONSTANTS",(function(){return r}));const r={IMPORT_MONITORING_URL:"import",QUERIES_MONITORING_URL:"monitor/queries",BACKUP_AND_RESTORE_MONITORING_URL:"monitor/backup-and-restore",CLUSTER_MONITORING_URL:"cluster"}},function(e,t){function n(e,t){return{get:function(t){return e.get(t)},set:function(t,n){e.set(t,n)},keys:n,remove:r,clearAll:function(){e.clearAll()},clearClassHieararchyState:function(){n().forEach((function(e){0!==e.indexOf("classHierarchy-")||e===t.CLASS_HIERARCHY_HIDE_PREFIXES||e.startsWith("classHierarchy-selectedGraph-")||r(e)}))}};function n(){return e.keys()}function r(t){e.remove(t)}}angular.module("graphdb.framework.utils.localstorageadapter",[]).factory("LocalStorageAdapter",n).value("LSKeys",{TABS_STATE:"tabs-state",TABS_STATE_CURRENT_ID:"tabs-state-currentid",TABS_STATE_MAXID:"tabs-state-maxid",VIEW_MODE:"viewMode",CLASS_HIERARCHY_HIDE_PREFIXES:"classHierarchy-hidePrefixes",CLASS_HIERARCHY_CURRENT_SLIDER_VALUE:"classHierarchy-currentSliderValue",CLASS_HIERARCHY_SWITCH_PREFIXES:"classHierarchy-switchPrefixes",CLASS_HIERARCHY_LAST_SELECTED_CLASS:"classHierarchy-lastSelectedClass",DOMAIN_RANGE_WENT_BACK:"domainRange-wentBack",DOMAIN_RANGE_COLLAPSE_EDGES:"domainRange-collapseEdges",HIDE_SIMILARITY_HELP:"hide-similarity-help",TUTORIAL_STATE:"tutorial-state",MENU_STATE:"menu-state",HIDE_GRAPH_CONFIG_HELP:"hide-graph-config-help",GRAPHS_VIZ:"graphs-viz",AUTOCOMPLETE_ENABLED:"autocomplete.enabled",RDF_SEARCH_TYPE:"rdf-search.search-type",RDF_SEARCH_INPUT:"rdf-search.search-input",RDF_SEARCH_EXPANDED_URI:"rdf-search.search-expanded-uri",RDF_RESOURCE_DESCRIPTION:"rdf-search.resource-description",PREFERRED_LANG:"preferred-language",WORKBENCH_SETTINGS:"workbench-settings",REPOSITORY_ID:"repository-id",REPOSITORY_LOCATION:"repository-location"}),n.$inject=["localStorageService","LSKeys"]},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";n.r(t),n.d(t,"GUIDE_ID",(function(){return ln})),n.d(t,"GUIDE_CURRENT_STEP_ID",(function(){return cn})),n.d(t,"GUIDE_STEP_HISTORY",(function(){return pn})),n.d(t,"GUIDE_PAUSE",(function(){return hn}));var r=n(2),i=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===o}(e)}(e)};
28
- /*! shepherd.js 10.0.1 */var o="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function a(e,t){return!1!==t.clone&&t.isMergeableObject(e)?p((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function s(e,t,n){return e.concat(t).map((function(e){return a(e,n)}))}function u(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return e.propertyIsEnumerable(t)})):[]}(e))}function l(e,t){try{return t in e}catch(e){return!1}}function c(e,t,n){var r={};return n.isMergeableObject(e)&&u(e).forEach((function(t){r[t]=a(e[t],n)})),u(t).forEach((function(i){(function(e,t){return l(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,i)||(l(e,i)&&n.isMergeableObject(t[i])?r[i]=function(e,t){if(!t.customMerge)return p;var n=t.customMerge(e);return"function"==typeof n?n:p}(i,n)(e[i],t[i],n):r[i]=a(t[i],n))})),r}function p(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||s,n.isMergeableObject=n.isMergeableObject||i,n.cloneUnlessOtherwiseSpecified=a;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):c(e,t,n):a(t,n)}p.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return p(e,n,t)}),{})};var h=p;function d(e){return e instanceof HTMLElement}function f(e){return"function"==typeof e}function g(e){return"string"==typeof e}function m(e){return void 0===e}class v{on(e,t,n,r){return void 0===r&&(r=!1),m(this.bindings)&&(this.bindings={}),m(this.bindings[e])&&(this.bindings[e]=[]),this.bindings[e].push({handler:t,ctx:n,once:r}),this}once(e,t,n){return this.on(e,t,n,!0)}off(e,t){return m(this.bindings)||m(this.bindings[e])||(m(t)?delete this.bindings[e]:this.bindings[e].forEach((n,r)=>{n.handler===t&&this.bindings[e].splice(r,1)})),this}trigger(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return!m(this.bindings)&&this.bindings[e]&&this.bindings[e].forEach((t,r)=>{const{ctx:i,handler:o,once:a}=t,s=i||this;o.apply(s,n),a&&this.bindings[e].splice(r,1)}),this}}function y(e){const t=Object.getOwnPropertyNames(e.constructor.prototype);for(let n=0;n<t.length;n++){const r=t[n],i=e[r];"constructor"!==r&&"function"==typeof i&&(e[r]=i.bind(e))}return e}function b(e){const{event:t,selector:n}=e.options.advanceOn||{};if(!t)return console.error("advanceOn was defined, but no event name was passed.");{const r=function(e,t){return n=>{if(t.isOpen()){const r=t.el&&n.currentTarget===t.el;(!m(e)&&n.currentTarget.matches(e)||r)&&t.tour.next()}}}(n,e);let i;try{i=document.querySelector(n)}catch(e){}if(!m(n)&&!i)return console.error("No element was found for the selector supplied to advanceOn: "+n);i?(i.addEventListener(t,r),e.on("destroy",()=>i.removeEventListener(t,r))):(document.body.addEventListener(t,r,!0),e.on("destroy",()=>document.body.removeEventListener(t,r,!0)))}}var w="top",x="bottom",S="right",E="left",A=[w,x,S,E],F=A.reduce((function(e,t){return e.concat([t+"-start",t+"-end"])}),[]),C=[].concat(A,["auto"]).reduce((function(e,t){return e.concat([t,t+"-start",t+"-end"])}),[]),$=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function D(e){return e?(e.nodeName||"").toLowerCase():null}function T(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function I(e){return e instanceof T(e).Element||e instanceof Element}function R(e){return e instanceof T(e).HTMLElement||e instanceof HTMLElement}function P(e){return"undefined"!=typeof ShadowRoot&&(e instanceof T(e).ShadowRoot||e instanceof ShadowRoot)}var O={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},i=t.elements[e];R(i)&&D(i)&&(Object.assign(i.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?i.removeAttribute(e):i.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],i=t.attributes[e]||{},o=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});R(r)&&D(r)&&(Object.assign(r.style,o),Object.keys(i).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]};function k(e){return e.split("-")[0]}var _=Math.max,j=Math.min,N=Math.round;function L(e,t){void 0===t&&(t=!1);var n=e.getBoundingClientRect(),r=1,i=1;if(R(e)&&t){var o=e.offsetHeight,a=e.offsetWidth;a>0&&(r=N(n.width)/a||1),o>0&&(i=N(n.height)/o||1)}return{width:n.width/r,height:n.height/i,top:n.top/i,right:n.right/r,bottom:n.bottom/i,left:n.left/r,x:n.left/r,y:n.top/i}}function B(e){var t=L(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function U(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&P(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function M(e){return T(e).getComputedStyle(e)}function H(e){return["table","td","th"].indexOf(D(e))>=0}function V(e){return((I(e)?e.ownerDocument:e.document)||window.document).documentElement}function q(e){return"html"===D(e)?e:e.assignedSlot||e.parentNode||(P(e)?e.host:null)||V(e)}function K(e){return R(e)&&"fixed"!==M(e).position?e.offsetParent:null}function z(e){for(var t=T(e),n=K(e);n&&H(n)&&"static"===M(n).position;)n=K(n);return n&&("html"===D(n)||"body"===D(n)&&"static"===M(n).position)?t:n||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&R(e)&&"fixed"===M(e).position)return null;var n=q(e);for(P(n)&&(n=n.host);R(n)&&["html","body"].indexOf(D(n))<0;){var r=M(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}function G(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function W(e,t,n){return _(e,j(t,n))}function Y(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function X(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function J(e){return e.split("-")[1]}var Z={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Q(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,a=e.offsets,s=e.position,u=e.gpuAcceleration,l=e.adaptive,c=e.roundOffsets,p=e.isFixed,h=a.x,d=void 0===h?0:h,f=a.y,g=void 0===f?0:f,m="function"==typeof c?c({x:d,y:g}):{x:d,y:g};d=m.x,g=m.y;var v=a.hasOwnProperty("x"),y=a.hasOwnProperty("y"),b=E,A=w,F=window;if(l){var C=z(n),$="clientHeight",D="clientWidth";if(C===T(n)&&"static"!==M(C=V(n)).position&&"absolute"===s&&($="scrollHeight",D="scrollWidth"),C=C,i===w||(i===E||i===S)&&"end"===o)A=x,g-=(p&&C===F&&F.visualViewport?F.visualViewport.height:C[$])-r.height,g*=u?1:-1;if(i===E||(i===w||i===x)&&"end"===o)b=S,d-=(p&&C===F&&F.visualViewport?F.visualViewport.width:C[D])-r.width,d*=u?1:-1}var I,R=Object.assign({position:s},l&&Z),P=!0===c?function(e){var t=e.x,n=e.y,r=window.devicePixelRatio||1;return{x:N(t*r)/r||0,y:N(n*r)/r||0}}({x:d,y:g}):{x:d,y:g};return d=P.x,g=P.y,u?Object.assign({},R,((I={})[A]=y?"0":"",I[b]=v?"0":"",I.transform=(F.devicePixelRatio||1)<=1?"translate("+d+"px, "+g+"px)":"translate3d("+d+"px, "+g+"px, 0)",I)):Object.assign({},R,((t={})[A]=y?g+"px":"",t[b]=v?d+"px":"",t.transform="",t))}var ee={passive:!0};var te={left:"right",right:"left",bottom:"top",top:"bottom"};function ne(e){return e.replace(/left|right|bottom|top/g,(function(e){return te[e]}))}var re={start:"end",end:"start"};function ie(e){return e.replace(/start|end/g,(function(e){return re[e]}))}function oe(e){var t=T(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function ae(e){return L(V(e)).left+oe(e).scrollLeft}function se(e){var t=M(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function ue(e,t){var n;void 0===t&&(t=[]);var r=function e(t){return["html","body","#document"].indexOf(D(t))>=0?t.ownerDocument.body:R(t)&&se(t)?t:e(q(t))}(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),o=T(r),a=i?[o].concat(o.visualViewport||[],se(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(ue(q(a)))}function le(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function ce(e,t){return"viewport"===t?le(function(e){var t=T(e),n=V(e),r=t.visualViewport,i=n.clientWidth,o=n.clientHeight,a=0,s=0;return r&&(i=r.width,o=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=r.offsetLeft,s=r.offsetTop)),{width:i,height:o,x:a+ae(e),y:s}}(e)):I(t)?function(e){var t=L(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(t):le(function(e){var t,n=V(e),r=oe(e),i=null==(t=e.ownerDocument)?void 0:t.body,o=_(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=_(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+ae(e),u=-r.scrollTop;return"rtl"===M(i||n).direction&&(s+=_(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:u}}(V(e)))}function pe(e,t,n){var r="clippingParents"===t?function(e){var t=ue(q(e)),n=["absolute","fixed"].indexOf(M(e).position)>=0&&R(e)?z(e):e;return I(n)?t.filter((function(e){return I(e)&&U(e,n)&&"body"!==D(e)})):[]}(e):[].concat(t),i=[].concat(r,[n]),o=i[0],a=i.reduce((function(t,n){var r=ce(e,n);return t.top=_(r.top,t.top),t.right=j(r.right,t.right),t.bottom=j(r.bottom,t.bottom),t.left=_(r.left,t.left),t}),ce(e,o));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function he(e){var t,n=e.reference,r=e.element,i=e.placement,o=i?k(i):null,a=i?J(i):null,s=n.x+n.width/2-r.width/2,u=n.y+n.height/2-r.height/2;switch(o){case w:t={x:s,y:n.y-r.height};break;case x:t={x:s,y:n.y+n.height};break;case S:t={x:n.x+n.width,y:u};break;case E:t={x:n.x-r.width,y:u};break;default:t={x:n.x,y:n.y}}var l=o?G(o):null;if(null!=l){var c="y"===l?"height":"width";switch(a){case"start":t[l]=t[l]-(n[c]/2-r[c]/2);break;case"end":t[l]=t[l]+(n[c]/2-r[c]/2)}}return t}function de(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=void 0===r?e.placement:r,o=n.boundary,a=void 0===o?"clippingParents":o,s=n.rootBoundary,u=void 0===s?"viewport":s,l=n.elementContext,c=void 0===l?"popper":l,p=n.altBoundary,h=void 0!==p&&p,d=n.padding,f=void 0===d?0:d,g=Y("number"!=typeof f?f:X(f,A)),m="popper"===c?"reference":"popper",v=e.rects.popper,y=e.elements[h?m:c],b=pe(I(y)?y:y.contextElement||V(e.elements.popper),a,u),E=L(e.elements.reference),F=he({reference:E,element:v,strategy:"absolute",placement:i}),C=le(Object.assign({},v,F)),$="popper"===c?C:E,D={top:b.top-$.top+g.top,bottom:$.bottom-b.bottom+g.bottom,left:b.left-$.left+g.left,right:$.right-b.right+g.right},T=e.modifiersData.offset;if("popper"===c&&T){var R=T[i];Object.keys(D).forEach((function(e){var t=[S,x].indexOf(e)>=0?1:-1,n=[w,x].indexOf(e)>=0?"y":"x";D[e]+=R[n]*t}))}return D}function fe(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,u=n.allowedAutoPlacements,l=void 0===u?C:u,c=J(r),p=c?s?F:F.filter((function(e){return J(e)===c})):A,h=p.filter((function(e){return l.indexOf(e)>=0}));0===h.length&&(h=p);var d=h.reduce((function(t,n){return t[n]=de(e,{placement:n,boundary:i,rootBoundary:o,padding:a})[k(n)],t}),{});return Object.keys(d).sort((function(e,t){return d[e]-d[t]}))}function ge(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function me(e){return[w,S,x,E].some((function(t){return e[t]>=0}))}function ve(e,t,n){void 0===n&&(n=!1);var r,i,o=R(t),a=R(t)&&function(e){var t=e.getBoundingClientRect(),n=N(t.width)/e.offsetWidth||1,r=N(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),s=V(t),u=L(e,a),l={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(o||!o&&!n)&&(("body"!==D(t)||se(s))&&(l=(r=t)!==T(r)&&R(r)?{scrollLeft:(i=r).scrollLeft,scrollTop:i.scrollTop}:oe(r)),R(t)?((c=L(t,!0)).x+=t.clientLeft,c.y+=t.clientTop):s&&(c.x=ae(s))),{x:u.left+l.scrollLeft-c.x,y:u.top+l.scrollTop-c.y,width:u.width,height:u.height}}function ye(e){var t=new Map,n=new Set,r=[];return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||function e(i){n.add(i.name),[].concat(i.requires||[],i.requiresIfExists||[]).forEach((function(r){if(!n.has(r)){var i=t.get(r);i&&e(i)}})),r.push(i)}(e)})),r}var be={placement:"bottom",modifiers:[],strategy:"absolute"};function we(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function xe(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,r=void 0===n?[]:n,i=t.defaultOptions,o=void 0===i?be:i;return function(e,t,n){void 0===n&&(n=o);var i,a,s={placement:"bottom",orderedModifiers:[],options:Object.assign({},be,o),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},u=[],l=!1,c={state:s,setOptions:function(n){var i="function"==typeof n?n(s.options):n;p(),s.options=Object.assign({},o,s.options,i),s.scrollParents={reference:I(e)?ue(e):e.contextElement?ue(e.contextElement):[],popper:ue(t)};var a,l,h=function(e){var t=ye(e);return $.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}((a=[].concat(r,s.options.modifiers),l=a.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e}),{}),Object.keys(l).map((function(e){return l[e]}))));return s.orderedModifiers=h.filter((function(e){return e.enabled})),s.orderedModifiers.forEach((function(e){var t=e.name,n=e.options,r=void 0===n?{}:n,i=e.effect;if("function"==typeof i){var o=i({state:s,name:t,instance:c,options:r});u.push(o||function(){})}})),c.update()},forceUpdate:function(){if(!l){var e=s.elements,t=e.reference,n=e.popper;if(we(t,n)){s.rects={reference:ve(t,z(n),"fixed"===s.options.strategy),popper:B(n)},s.reset=!1,s.placement=s.options.placement,s.orderedModifiers.forEach((function(e){return s.modifiersData[e.name]=Object.assign({},e.data)}));for(var r=0;r<s.orderedModifiers.length;r++)if(!0!==s.reset){var i=s.orderedModifiers[r],o=i.fn,a=i.options,u=void 0===a?{}:a,p=i.name;"function"==typeof o&&(s=o({state:s,options:u,name:p,instance:c})||s)}else s.reset=!1,r=-1}}},update:(i=function(){return new Promise((function(e){c.forceUpdate(),e(s)}))},function(){return a||(a=new Promise((function(e){Promise.resolve().then((function(){a=void 0,e(i())}))}))),a}),destroy:function(){p(),l=!0}};if(!we(e,t))return c;function p(){u.forEach((function(e){return e()})),u=[]}return c.setOptions(n).then((function(e){!l&&n.onFirstUpdate&&n.onFirstUpdate(e)})),c}}var Se=xe({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=void 0===i||i,a=r.resize,s=void 0===a||a,u=T(t.elements.popper),l=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&l.forEach((function(e){e.addEventListener("scroll",n.update,ee)})),s&&u.addEventListener("resize",n.update,ee),function(){o&&l.forEach((function(e){e.removeEventListener("scroll",n.update,ee)})),s&&u.removeEventListener("resize",n.update,ee)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=he({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=void 0===r||r,o=n.adaptive,a=void 0===o||o,s=n.roundOffsets,u=void 0===s||s,l={placement:k(t.placement),variation:J(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,Q(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:u})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,Q(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},O,{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=void 0===i?[0,0]:i,a=C.reduce((function(e,n){return e[n]=function(e,t,n){var r=k(e),i=[E,w].indexOf(r)>=0?-1:1,o="function"==typeof n?n(Object.assign({},t,{placement:e})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*i,[E,S].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,o),e}),{}),s=a[t.placement],u=s.x,l=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=u,t.modifiersData.popperOffsets.y+=l),t.modifiersData[r]=a}},{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=void 0===i||i,a=n.altAxis,s=void 0===a||a,u=n.fallbackPlacements,l=n.padding,c=n.boundary,p=n.rootBoundary,h=n.altBoundary,d=n.flipVariations,f=void 0===d||d,g=n.allowedAutoPlacements,m=t.options.placement,v=k(m),y=u||(v===m||!f?[ne(m)]:function(e){if("auto"===k(e))return[];var t=ne(e);return[ie(e),t,ie(t)]}(m)),b=[m].concat(y).reduce((function(e,n){return e.concat("auto"===k(n)?fe(t,{placement:n,boundary:c,rootBoundary:p,padding:l,flipVariations:f,allowedAutoPlacements:g}):n)}),[]),A=t.rects.reference,F=t.rects.popper,C=new Map,$=!0,D=b[0],T=0;T<b.length;T++){var I=b[T],R=k(I),P="start"===J(I),O=[w,x].indexOf(R)>=0,_=O?"width":"height",j=de(t,{placement:I,boundary:c,rootBoundary:p,altBoundary:h,padding:l}),N=O?P?S:E:P?x:w;A[_]>F[_]&&(N=ne(N));var L=ne(N),B=[];if(o&&B.push(j[R]<=0),s&&B.push(j[N]<=0,j[L]<=0),B.every((function(e){return e}))){D=I,$=!1;break}C.set(I,B)}if($)for(var U=function(e){var t=b.find((function(t){var n=C.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return D=t,"break"},M=f?3:1;M>0;M--){if("break"===U(M))break}t.placement!==D&&(t.modifiersData[r]._skip=!0,t.placement=D,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=void 0===i||i,a=n.altAxis,s=void 0!==a&&a,u=n.boundary,l=n.rootBoundary,c=n.altBoundary,p=n.padding,h=n.tether,d=void 0===h||h,f=n.tetherOffset,g=void 0===f?0:f,m=de(t,{boundary:u,rootBoundary:l,padding:p,altBoundary:c}),v=k(t.placement),y=J(t.placement),b=!y,A=G(v),F="x"===A?"y":"x",C=t.modifiersData.popperOffsets,$=t.rects.reference,D=t.rects.popper,T="function"==typeof g?g(Object.assign({},t.rects,{placement:t.placement})):g,I="number"==typeof T?{mainAxis:T,altAxis:T}:Object.assign({mainAxis:0,altAxis:0},T),R=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,P={x:0,y:0};if(C){if(o){var O,N="y"===A?w:E,L="y"===A?x:S,U="y"===A?"height":"width",M=C[A],H=M+m[N],V=M-m[L],q=d?-D[U]/2:0,K="start"===y?$[U]:D[U],Y="start"===y?-D[U]:-$[U],X=t.elements.arrow,Z=d&&X?B(X):{width:0,height:0},Q=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},ee=Q[N],te=Q[L],ne=W(0,$[U],Z[U]),re=b?$[U]/2-q-ne-ee-I.mainAxis:K-ne-ee-I.mainAxis,ie=b?-$[U]/2+q+ne+te+I.mainAxis:Y+ne+te+I.mainAxis,oe=t.elements.arrow&&z(t.elements.arrow),ae=oe?"y"===A?oe.clientTop||0:oe.clientLeft||0:0,se=null!=(O=null==R?void 0:R[A])?O:0,ue=M+ie-se,le=W(d?j(H,M+re-se-ae):H,M,d?_(V,ue):V);C[A]=le,P[A]=le-M}if(s){var ce,pe="x"===A?w:E,he="x"===A?x:S,fe=C[F],ge="y"===F?"height":"width",me=fe+m[pe],ve=fe-m[he],ye=-1!==[w,E].indexOf(v),be=null!=(ce=null==R?void 0:R[F])?ce:0,we=ye?me:fe-$[ge]-D[ge]-be+I.altAxis,xe=ye?fe+$[ge]+D[ge]-be-I.altAxis:ve,Se=d&&ye?function(e,t,n){var r=W(e,t,n);return r>n?n:r}(we,fe,xe):W(d?we:me,fe,d?xe:ve);C[F]=Se,P[F]=Se-fe}t.modifiersData[r]=P}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=k(n.placement),u=G(s),l=[E,S].indexOf(s)>=0?"height":"width";if(o&&a){var c=function(e,t){return Y("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:X(e,A))}(i.padding,n),p=B(o),h="y"===u?w:E,d="y"===u?x:S,f=n.rects.reference[l]+n.rects.reference[u]-a[u]-n.rects.popper[l],g=a[u]-n.rects.reference[u],m=z(o),v=m?"y"===u?m.clientHeight||0:m.clientWidth||0:0,y=f/2-g/2,b=c[h],F=v-p[l]-c[d],C=v/2-p[l]/2+y,$=W(b,C,F),D=u;n.modifiersData[r]=((t={})[D]=$,t.centerOffset=$-C,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&U(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=de(t,{elementContext:"reference"}),s=de(t,{altBoundary:!0}),u=ge(a,r),l=ge(s,i,o),c=me(u),p=me(l);t.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:l,isReferenceHidden:c,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":p})}}]});function Ee(){return(Ee=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Ae(e){return{name:"focusAfterRender",enabled:!0,phase:"afterWrite",fn(){setTimeout(()=>{if(e.el){const t={preventScroll:!0};e.el.focus(t)}},300)}}}function Fe(e){const t=[{name:"applyStyles",fn(e){let{state:t}=e;Object.keys(t.elements).forEach(e=>{if("popper"!==e)return;const n=t.attributes[e]||{},r=t.elements[e];Object.assign(r.style,{position:"fixed",left:"50%",top:"50%",transform:"translate(-50%, -50%)"}),Object.keys(n).forEach(e=>{const t=n[e];!1===t?r.removeAttribute(e):r.setAttribute(e,!0===t?"":t)})})}},{name:"computeStyles",options:{adaptive:!1}}];let n={placement:"top",strategy:"fixed",modifiers:[Ae(e)]};return n=Ee({},n,{modifiers:Array.from(new Set([...n.modifiers,...t]))}),n}function Ce(e){return g(e)&&""!==e?"-"!==e.charAt(e.length-1)?e+"-":e:""}function $e(e){return null==e||(!e.element||!e.on)}function De(e){e.tooltip&&e.tooltip.destroy();const t=e._getResolvedAttachToOptions();let n=t.element;const r=function(e,t){let n={modifiers:[{name:"preventOverflow",options:{altAxis:!0,tether:!1}},Ae(t)],strategy:"absolute"};$e(e)?n=Fe(t):n.placement=e.on;const r=t.tour&&t.tour.options&&t.tour.options.defaultStepOptions;r&&(n=Ie(r,n));return n=Ie(t.options,n),n}(t,e);if($e(t)){n=document.body;e.shepherdElementComponent.getElement().classList.add("shepherd-centered")}return e.tooltip=Se(n,e.el,r),e.target=t.element,r}function Te(){let e=Date.now();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"==t?n:3&n|8).toString(16)})}function Ie(e,t){if(e.popperOptions){let n=Object.assign({},t,e.popperOptions);if(e.popperOptions.modifiers&&e.popperOptions.modifiers.length>0){const r=e.popperOptions.modifiers.map(e=>e.name),i=t.modifiers.filter(e=>!r.includes(e.name));n.modifiers=Array.from(new Set([...i,...e.popperOptions.modifiers]))}return n}return t}function Re(){}function Pe(e,t){for(const n in t)e[n]=t[n];return e}function Oe(e){return e()}function ke(){return Object.create(null)}function _e(e){e.forEach(Oe)}function je(e){return"function"==typeof e}function Ne(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}function Le(e,t){e.appendChild(t)}function Be(e,t,n){e.insertBefore(t,n||null)}function Ue(e){e.parentNode.removeChild(e)}function Me(e){return document.createElement(e)}function He(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function Ve(e){return document.createTextNode(e)}function qe(){return Ve(" ")}function Ke(e,t,n,r){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}function ze(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function Ge(e,t){const n=Object.getOwnPropertyDescriptors(e.__proto__);for(const r in t)null==t[r]?e.removeAttribute(r):"style"===r?e.style.cssText=t[r]:"__value"===r?e.value=e[r]=t[r]:n[r]&&n[r].set?e[r]=t[r]:ze(e,r,t[r])}function We(e,t,n){e.classList[n?"add":"remove"](t)}let Ye;function Xe(e){Ye=e}function Je(){if(!Ye)throw new Error("Function called outside component initialization");return Ye}function Ze(e){Je().$$.after_update.push(e)}const Qe=[],et=[],tt=[],nt=[],rt=Promise.resolve();let it=!1;function ot(e){tt.push(e)}const at=new Set;let st=0;function ut(){const e=Ye;do{for(;st<Qe.length;){const e=Qe[st];st++,Xe(e),lt(e.$$)}for(Xe(null),Qe.length=0,st=0;et.length;)et.pop()();for(let e=0;e<tt.length;e+=1){const t=tt[e];at.has(t)||(at.add(t),t())}tt.length=0}while(Qe.length);for(;nt.length;)nt.pop()();it=!1,at.clear(),Xe(e)}function lt(e){if(null!==e.fragment){e.update(),_e(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(ot)}}const ct=new Set;let pt;function ht(){pt={r:0,c:[],p:pt}}function dt(){pt.r||_e(pt.c),pt=pt.p}function ft(e,t){e&&e.i&&(ct.delete(e),e.i(t))}function gt(e,t,n,r){if(e&&e.o){if(ct.has(e))return;ct.add(e),pt.c.push(()=>{ct.delete(e),r&&(n&&e.d(1),r())}),e.o(t)}else r&&r()}function mt(e){e&&e.c()}function vt(e,t,n,r){const{fragment:i,on_mount:o,on_destroy:a,after_update:s}=e.$$;i&&i.m(t,n),r||ot(()=>{const t=o.map(Oe).filter(je);a?a.push(...t):_e(t),e.$$.on_mount=[]}),s.forEach(ot)}function yt(e,t){const n=e.$$;null!==n.fragment&&(_e(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function bt(e,t){-1===e.$$.dirty[0]&&(Qe.push(e),it||(it=!0,rt.then(ut)),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function wt(e,t,n,r,i,o,a,s){void 0===s&&(s=[-1]);const u=Ye;Xe(e);const l=e.$$={fragment:null,ctx:null,props:o,update:Re,not_equal:i,bound:ke(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(u?u.$$.context:[])),callbacks:ke(),dirty:s,skip_bound:!1,root:t.target||u.$$.root};a&&a(l.root);let c=!1;if(l.ctx=n?n(e,t.props||{},(function(t,n){const r=!(arguments.length<=2)&&arguments.length-2?arguments.length<=2?void 0:arguments[2]:n;return l.ctx&&i(l.ctx[t],l.ctx[t]=r)&&(!l.skip_bound&&l.bound[t]&&l.bound[t](r),c&&bt(e,t)),n})):[],l.update(),c=!0,_e(l.before_update),l.fragment=!!r&&r(l.ctx),t.target){if(t.hydrate){const e=(p=t.target,Array.from(p.childNodes));l.fragment&&l.fragment.l(e),e.forEach(Ue)}else l.fragment&&l.fragment.c();t.intro&&ft(e.$$.fragment),vt(e,t.target,t.anchor,t.customElement),ut()}var p;Xe(u)}class xt{$destroy(){yt(this,1),this.$destroy=Re}$on(e,t){const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}$set(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}function St(e){let t,n,r,i,o;return{c(){t=Me("button"),ze(t,"aria-label",n=e[3]?e[3]:null),ze(t,"class",r=`${e[1]||""} shepherd-button ${e[4]?"shepherd-button-secondary":""}`),t.disabled=e[2],ze(t,"tabindex","0")},m(n,r){Be(n,t,r),t.innerHTML=e[5],i||(o=Ke(t,"click",(function(){je(e[0])&&e[0].apply(this,arguments)})),i=!0)},p(i,o){let[a]=o;e=i,32&a&&(t.innerHTML=e[5]),8&a&&n!==(n=e[3]?e[3]:null)&&ze(t,"aria-label",n),18&a&&r!==(r=`${e[1]||""} shepherd-button ${e[4]?"shepherd-button-secondary":""}`)&&ze(t,"class",r),4&a&&(t.disabled=e[2])},i:Re,o:Re,d(e){e&&Ue(t),i=!1,o()}}}function Et(e,t,n){let r,i,o,a,s,u,{config:l,step:c}=t;function p(e){return f(e)?e.call(c):e}return e.$$set=e=>{"config"in e&&n(6,l=e.config),"step"in e&&n(7,c=e.step)},e.$$.update=()=>{192&e.$$.dirty&&(n(0,r=l.action?l.action.bind(c.tour):null),n(1,i=l.classes),n(2,o=!!l.disabled&&p(l.disabled)),n(3,a=l.label?p(l.label):null),n(4,s=l.secondary),n(5,u=l.text?p(l.text):null))},[r,i,o,a,s,u,l,c]}class At extends xt{constructor(e){super(),wt(this,e,Et,St,Ne,{config:6,step:7})}}function Ft(e,t,n){const r=e.slice();return r[2]=t[n],r}function Ct(e){let t,n,r=e[1],i=[];for(let t=0;t<r.length;t+=1)i[t]=$t(Ft(e,r,t));const o=e=>gt(i[e],1,1,()=>{i[e]=null});return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=Ve("")},m(e,r){for(let t=0;t<i.length;t+=1)i[t].m(e,r);Be(e,t,r),n=!0},p(e,n){if(3&n){let a;for(r=e[1],a=0;a<r.length;a+=1){const o=Ft(e,r,a);i[a]?(i[a].p(o,n),ft(i[a],1)):(i[a]=$t(o),i[a].c(),ft(i[a],1),i[a].m(t.parentNode,t))}for(ht(),a=r.length;a<i.length;a+=1)o(a);dt()}},i(e){if(!n){for(let e=0;e<r.length;e+=1)ft(i[e]);n=!0}},o(e){i=i.filter(Boolean);for(let e=0;e<i.length;e+=1)gt(i[e]);n=!1},d(e){!function(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}(i,e),e&&Ue(t)}}}function $t(e){let t,n;return t=new At({props:{config:e[2],step:e[0]}}),{c(){mt(t.$$.fragment)},m(e,r){vt(t,e,r),n=!0},p(e,n){const r={};2&n&&(r.config=e[2]),1&n&&(r.step=e[0]),t.$set(r)},i(e){n||(ft(t.$$.fragment,e),n=!0)},o(e){gt(t.$$.fragment,e),n=!1},d(e){yt(t,e)}}}function Dt(e){let t,n,r=e[1]&&Ct(e);return{c(){t=Me("footer"),r&&r.c(),ze(t,"class","shepherd-footer")},m(e,i){Be(e,t,i),r&&r.m(t,null),n=!0},p(e,n){let[i]=n;e[1]?r?(r.p(e,i),2&i&&ft(r,1)):(r=Ct(e),r.c(),ft(r,1),r.m(t,null)):r&&(ht(),gt(r,1,1,()=>{r=null}),dt())},i(e){n||(ft(r),n=!0)},o(e){gt(r),n=!1},d(e){e&&Ue(t),r&&r.d()}}}function Tt(e,t,n){let r,{step:i}=t;return e.$$set=e=>{"step"in e&&n(0,i=e.step)},e.$$.update=()=>{1&e.$$.dirty&&n(1,r=i.options.buttons)},[i,r]}class It extends xt{constructor(e){super(),wt(this,e,Tt,Dt,Ne,{step:0})}}function Rt(e){let t,n,r,i,o;return{c(){t=Me("button"),n=Me("span"),n.textContent="×",ze(n,"aria-hidden","true"),ze(t,"aria-label",r=e[0].label?e[0].label:"Close Tour"),ze(t,"class","shepherd-cancel-icon"),ze(t,"type","button")},m(r,a){Be(r,t,a),Le(t,n),i||(o=Ke(t,"click",e[1]),i=!0)},p(e,n){let[i]=n;1&i&&r!==(r=e[0].label?e[0].label:"Close Tour")&&ze(t,"aria-label",r)},i:Re,o:Re,d(e){e&&Ue(t),i=!1,o()}}}function Pt(e,t,n){let{cancelIcon:r,step:i}=t;return e.$$set=e=>{"cancelIcon"in e&&n(0,r=e.cancelIcon),"step"in e&&n(2,i=e.step)},[r,e=>{e.preventDefault(),i.cancel()},i]}class Ot extends xt{constructor(e){super(),wt(this,e,Pt,Rt,Ne,{cancelIcon:0,step:2})}}function kt(e){let t;return{c(){t=Me("h3"),ze(t,"id",e[1]),ze(t,"class","shepherd-title")},m(n,r){Be(n,t,r),e[3](t)},p(e,n){let[r]=n;2&r&&ze(t,"id",e[1])},i:Re,o:Re,d(n){n&&Ue(t),e[3](null)}}}function _t(e,t,n){let{labelId:r,element:i,title:o}=t;return Ze(()=>{f(o)&&n(2,o=o()),n(0,i.innerHTML=o,i)}),e.$$set=e=>{"labelId"in e&&n(1,r=e.labelId),"element"in e&&n(0,i=e.element),"title"in e&&n(2,o=e.title)},[i,r,o,function(e){et[e?"unshift":"push"](()=>{i=e,n(0,i)})}]}class jt extends xt{constructor(e){super(),wt(this,e,_t,kt,Ne,{labelId:1,element:0,title:2})}}function Nt(e){let t,n;return t=new jt({props:{labelId:e[0],title:e[2]}}),{c(){mt(t.$$.fragment)},m(e,r){vt(t,e,r),n=!0},p(e,n){const r={};1&n&&(r.labelId=e[0]),4&n&&(r.title=e[2]),t.$set(r)},i(e){n||(ft(t.$$.fragment,e),n=!0)},o(e){gt(t.$$.fragment,e),n=!1},d(e){yt(t,e)}}}function Lt(e){let t,n;return t=new Ot({props:{cancelIcon:e[3],step:e[1]}}),{c(){mt(t.$$.fragment)},m(e,r){vt(t,e,r),n=!0},p(e,n){const r={};8&n&&(r.cancelIcon=e[3]),2&n&&(r.step=e[1]),t.$set(r)},i(e){n||(ft(t.$$.fragment,e),n=!0)},o(e){gt(t.$$.fragment,e),n=!1},d(e){yt(t,e)}}}function Bt(e){let t,n,r,i=e[2]&&Nt(e),o=e[3]&&e[3].enabled&&Lt(e);return{c(){t=Me("header"),i&&i.c(),n=qe(),o&&o.c(),ze(t,"class","shepherd-header")},m(e,a){Be(e,t,a),i&&i.m(t,null),Le(t,n),o&&o.m(t,null),r=!0},p(e,r){let[a]=r;e[2]?i?(i.p(e,a),4&a&&ft(i,1)):(i=Nt(e),i.c(),ft(i,1),i.m(t,n)):i&&(ht(),gt(i,1,1,()=>{i=null}),dt()),e[3]&&e[3].enabled?o?(o.p(e,a),8&a&&ft(o,1)):(o=Lt(e),o.c(),ft(o,1),o.m(t,null)):o&&(ht(),gt(o,1,1,()=>{o=null}),dt())},i(e){r||(ft(i),ft(o),r=!0)},o(e){gt(i),gt(o),r=!1},d(e){e&&Ue(t),i&&i.d(),o&&o.d()}}}function Ut(e,t,n){let r,i,{labelId:o,step:a}=t;return e.$$set=e=>{"labelId"in e&&n(0,o=e.labelId),"step"in e&&n(1,a=e.step)},e.$$.update=()=>{2&e.$$.dirty&&(n(2,r=a.options.title),n(3,i=a.options.cancelIcon))},[o,a,r,i]}class Mt extends xt{constructor(e){super(),wt(this,e,Ut,Bt,Ne,{labelId:0,step:1})}}function Ht(e){let t;return{c(){t=Me("div"),ze(t,"class","shepherd-text"),ze(t,"id",e[1])},m(n,r){Be(n,t,r),e[3](t)},p(e,n){let[r]=n;2&r&&ze(t,"id",e[1])},i:Re,o:Re,d(n){n&&Ue(t),e[3](null)}}}function Vt(e,t,n){let{descriptionId:r,element:i,step:o}=t;return Ze(()=>{let{text:e}=o.options;f(e)&&(e=e.call(o)),d(e)?i.appendChild(e):n(0,i.innerHTML=e,i)}),e.$$set=e=>{"descriptionId"in e&&n(1,r=e.descriptionId),"element"in e&&n(0,i=e.element),"step"in e&&n(2,o=e.step)},[i,r,o,function(e){et[e?"unshift":"push"](()=>{i=e,n(0,i)})}]}class qt extends xt{constructor(e){super(),wt(this,e,Vt,Ht,Ne,{descriptionId:1,element:0,step:2})}}function Kt(e){let t,n;return t=new Mt({props:{labelId:e[1],step:e[2]}}),{c(){mt(t.$$.fragment)},m(e,r){vt(t,e,r),n=!0},p(e,n){const r={};2&n&&(r.labelId=e[1]),4&n&&(r.step=e[2]),t.$set(r)},i(e){n||(ft(t.$$.fragment,e),n=!0)},o(e){gt(t.$$.fragment,e),n=!1},d(e){yt(t,e)}}}function zt(e){let t,n;return t=new qt({props:{descriptionId:e[0],step:e[2]}}),{c(){mt(t.$$.fragment)},m(e,r){vt(t,e,r),n=!0},p(e,n){const r={};1&n&&(r.descriptionId=e[0]),4&n&&(r.step=e[2]),t.$set(r)},i(e){n||(ft(t.$$.fragment,e),n=!0)},o(e){gt(t.$$.fragment,e),n=!1},d(e){yt(t,e)}}}function Gt(e){let t,n;return t=new It({props:{step:e[2]}}),{c(){mt(t.$$.fragment)},m(e,r){vt(t,e,r),n=!0},p(e,n){const r={};4&n&&(r.step=e[2]),t.$set(r)},i(e){n||(ft(t.$$.fragment,e),n=!0)},o(e){gt(t.$$.fragment,e),n=!1},d(e){yt(t,e)}}}function Wt(e){let t,n,r,i,o=!m(e[2].options.title)||e[2].options.cancelIcon&&e[2].options.cancelIcon.enabled,a=!m(e[2].options.text),s=Array.isArray(e[2].options.buttons)&&e[2].options.buttons.length,u=o&&Kt(e),l=a&&zt(e),c=s&&Gt(e);return{c(){t=Me("div"),u&&u.c(),n=qe(),l&&l.c(),r=qe(),c&&c.c(),ze(t,"class","shepherd-content")},m(e,o){Be(e,t,o),u&&u.m(t,null),Le(t,n),l&&l.m(t,null),Le(t,r),c&&c.m(t,null),i=!0},p(e,i){let[p]=i;4&p&&(o=!m(e[2].options.title)||e[2].options.cancelIcon&&e[2].options.cancelIcon.enabled),o?u?(u.p(e,p),4&p&&ft(u,1)):(u=Kt(e),u.c(),ft(u,1),u.m(t,n)):u&&(ht(),gt(u,1,1,()=>{u=null}),dt()),4&p&&(a=!m(e[2].options.text)),a?l?(l.p(e,p),4&p&&ft(l,1)):(l=zt(e),l.c(),ft(l,1),l.m(t,r)):l&&(ht(),gt(l,1,1,()=>{l=null}),dt()),4&p&&(s=Array.isArray(e[2].options.buttons)&&e[2].options.buttons.length),s?c?(c.p(e,p),4&p&&ft(c,1)):(c=Gt(e),c.c(),ft(c,1),c.m(t,null)):c&&(ht(),gt(c,1,1,()=>{c=null}),dt())},i(e){i||(ft(u),ft(l),ft(c),i=!0)},o(e){gt(u),gt(l),gt(c),i=!1},d(e){e&&Ue(t),u&&u.d(),l&&l.d(),c&&c.d()}}}function Yt(e,t,n){let{descriptionId:r,labelId:i,step:o}=t;return e.$$set=e=>{"descriptionId"in e&&n(0,r=e.descriptionId),"labelId"in e&&n(1,i=e.labelId),"step"in e&&n(2,o=e.step)},[r,i,o]}class Xt extends xt{constructor(e){super(),wt(this,e,Yt,Wt,Ne,{descriptionId:0,labelId:1,step:2})}}function Jt(e){let t;return{c(){t=Me("div"),ze(t,"class","shepherd-arrow"),ze(t,"data-popper-arrow","")},m(e,n){Be(e,t,n)},d(e){e&&Ue(t)}}}function Zt(e){let t,n,r,i,o,a,s,u,l=e[4].options.arrow&&e[4].options.attachTo&&e[4].options.attachTo.element&&e[4].options.attachTo.on&&Jt();r=new Xt({props:{descriptionId:e[2],labelId:e[3],step:e[4]}});let c=[{"aria-describedby":i=m(e[4].options.text)?null:e[2]},{"aria-labelledby":o=e[4].options.title?e[3]:null},e[1],{role:"dialog"},{tabindex:"0"}],p={};for(let e=0;e<c.length;e+=1)p=Pe(p,c[e]);return{c(){t=Me("div"),l&&l.c(),n=qe(),mt(r.$$.fragment),Ge(t,p),We(t,"shepherd-has-cancel-icon",e[5]),We(t,"shepherd-has-title",e[6]),We(t,"shepherd-element",!0)},m(i,o){Be(i,t,o),l&&l.m(t,null),Le(t,n),vt(r,t,null),e[13](t),a=!0,s||(u=Ke(t,"keydown",e[7]),s=!0)},p(e,s){let[u]=s;e[4].options.arrow&&e[4].options.attachTo&&e[4].options.attachTo.element&&e[4].options.attachTo.on?l||(l=Jt(),l.c(),l.m(t,n)):l&&(l.d(1),l=null);const h={};4&u&&(h.descriptionId=e[2]),8&u&&(h.labelId=e[3]),16&u&&(h.step=e[4]),r.$set(h),Ge(t,p=function(e,t){const n={},r={},i={$$scope:1};let o=e.length;for(;o--;){const a=e[o],s=t[o];if(s){for(const e in a)e in s||(r[e]=1);for(const e in s)i[e]||(n[e]=s[e],i[e]=1);e[o]=s}else for(const e in a)i[e]=1}for(const e in r)e in n||(n[e]=void 0);return n}(c,[(!a||20&u&&i!==(i=m(e[4].options.text)?null:e[2]))&&{"aria-describedby":i},(!a||24&u&&o!==(o=e[4].options.title?e[3]:null))&&{"aria-labelledby":o},2&u&&e[1],{role:"dialog"},{tabindex:"0"}])),We(t,"shepherd-has-cancel-icon",e[5]),We(t,"shepherd-has-title",e[6]),We(t,"shepherd-element",!0)},i(e){a||(ft(r.$$.fragment,e),a=!0)},o(e){gt(r.$$.fragment,e),a=!1},d(n){n&&Ue(t),l&&l.d(),yt(r),e[13](null),s=!1,u()}}}function Qt(e){return e.split(" ").filter(e=>!!e.length)}function en(e,t,n){let r,i,o,{classPrefix:a,element:s,descriptionId:u,firstFocusableElement:l,focusableElements:c,labelId:p,lastFocusableElement:h,step:d,dataStepId:f}=t;var m;m=()=>{n(1,f={[`data-${a}shepherd-step-id`]:d.id}),n(9,c=s.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]')),n(8,l=c[0]),n(10,h=c[c.length-1])},Je().$$.on_mount.push(m),Ze(()=>{o!==d.options.classes&&(function(e){if(g(e)){const t=Qt(e);t.length&&s.classList.remove(...t)}}(o),o=d.options.classes,function(e){if(g(e)){const t=Qt(e);t.length&&s.classList.add(...t)}}(o))});return e.$$set=e=>{"classPrefix"in e&&n(11,a=e.classPrefix),"element"in e&&n(0,s=e.element),"descriptionId"in e&&n(2,u=e.descriptionId),"firstFocusableElement"in e&&n(8,l=e.firstFocusableElement),"focusableElements"in e&&n(9,c=e.focusableElements),"labelId"in e&&n(3,p=e.labelId),"lastFocusableElement"in e&&n(10,h=e.lastFocusableElement),"step"in e&&n(4,d=e.step),"dataStepId"in e&&n(1,f=e.dataStepId)},e.$$.update=()=>{16&e.$$.dirty&&(n(5,r=d.options&&d.options.cancelIcon&&d.options.cancelIcon.enabled),n(6,i=d.options&&d.options.title))},[s,f,u,p,d,r,i,e=>{const{tour:t}=d;switch(e.keyCode){case 9:if(0===c.length){e.preventDefault();break}e.shiftKey?(document.activeElement===l||document.activeElement.classList.contains("shepherd-element"))&&(e.preventDefault(),h.focus()):document.activeElement===h&&(e.preventDefault(),l.focus());break;case 27:t.options.exitOnEsc&&d.cancel();break;case 37:t.options.keyboardNavigation&&t.back();break;case 39:t.options.keyboardNavigation&&t.next()}},l,c,h,a,()=>s,function(e){et[e?"unshift":"push"](()=>{s=e,n(0,s)})}]}class tn extends xt{constructor(e){super(),wt(this,e,en,Zt,Ne,{classPrefix:11,element:0,descriptionId:2,firstFocusableElement:8,focusableElements:9,labelId:3,lastFocusableElement:10,step:4,dataStepId:1,getElement:12})}get getElement(){return this.$$.ctx[12]}}var nn=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e,t){e.exports={polyfill:function(){var e=window,t=document;if(!("scrollBehavior"in t.documentElement.style)||!0===e.__forceSmoothScrollPolyfill__){var n,r=e.HTMLElement||e.Element,i={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:r.prototype.scroll||s,scrollIntoView:r.prototype.scrollIntoView},o=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now,a=(n=e.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(n)?1:0);e.scroll=e.scrollTo=function(){void 0!==arguments[0]&&(!0!==u(arguments[0])?f.call(e,t.body,void 0!==arguments[0].left?~~arguments[0].left:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?~~arguments[0].top:e.scrollY||e.pageYOffset):i.scroll.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:e.scrollY||e.pageYOffset))},e.scrollBy=function(){void 0!==arguments[0]&&(u(arguments[0])?i.scrollBy.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:0,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:0):f.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset)))},r.prototype.scroll=r.prototype.scrollTo=function(){if(void 0!==arguments[0])if(!0!==u(arguments[0])){var e=arguments[0].left,t=arguments[0].top;f.call(this,this,void 0===e?this.scrollLeft:~~e,void 0===t?this.scrollTop:~~t)}else{if("number"==typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left:"object"!=typeof arguments[0]?~~arguments[0]:this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top:void 0!==arguments[1]?~~arguments[1]:this.scrollTop)}},r.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==u(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop))},r.prototype.scrollIntoView=function(){if(!0!==u(arguments[0])){var n=h(this),r=n.getBoundingClientRect(),o=this.getBoundingClientRect();n!==t.body?(f.call(this,n,n.scrollLeft+o.left-r.left,n.scrollTop+o.top-r.top),"fixed"!==e.getComputedStyle(n).position&&e.scrollBy({left:r.left,top:r.top,behavior:"smooth"})):e.scrollBy({left:o.left,top:o.top,behavior:"smooth"})}else i.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}function s(e,t){this.scrollLeft=e,this.scrollTop=t}function u(e){if(null===e||"object"!=typeof e||void 0===e.behavior||"auto"===e.behavior||"instant"===e.behavior)return!0;if("object"==typeof e&&"smooth"===e.behavior)return!1;throw new TypeError("behavior member of ScrollOptions "+e.behavior+" is not a valid value for enumeration ScrollBehavior.")}function l(e,t){return"Y"===t?e.clientHeight+a<e.scrollHeight:"X"===t?e.clientWidth+a<e.scrollWidth:void 0}function c(t,n){var r=e.getComputedStyle(t,null)["overflow"+n];return"auto"===r||"scroll"===r}function p(e){var t=l(e,"Y")&&c(e,"Y"),n=l(e,"X")&&c(e,"X");return t||n}function h(e){for(;e!==t.body&&!1===p(e);)e=e.parentNode||e.host;return e}function d(t){var n,r,i,a,s=(o()-t.startTime)/468;a=s=s>1?1:s,n=.5*(1-Math.cos(Math.PI*a)),r=t.startX+(t.x-t.startX)*n,i=t.startY+(t.y-t.startY)*n,t.method.call(t.scrollable,r,i),r===t.x&&i===t.y||e.requestAnimationFrame(d.bind(e,t))}function f(n,r,a){var u,l,c,p,h=o();n===t.body?(u=e,l=e.scrollX||e.pageXOffset,c=e.scrollY||e.pageYOffset,p=i.scroll):(u=n,l=n.scrollLeft,c=n.scrollTop,p=s),d({scrollable:u,method:p,startTime:h,startX:l,startY:c,x:r,y:a})}}}}));nn.polyfill,nn.polyfill();class rn extends v{constructor(e,t){return void 0===t&&(t={}),super(e,t),this.tour=e,this.classPrefix=this.tour.options?Ce(this.tour.options.classPrefix):"",this.styles=e.styles,this._resolvedAttachTo=null,y(this),this._setOptions(t),this}cancel(){this.tour.cancel(),this.trigger("cancel")}complete(){this.tour.complete(),this.trigger("complete")}destroy(){this.tooltip&&(this.tooltip.destroy(),this.tooltip=null),d(this.el)&&this.el.parentNode&&(this.el.parentNode.removeChild(this.el),this.el=null),this._updateStepTargetOnHide(),this.trigger("destroy")}getTour(){return this.tour}hide(){this.tour.modal.hide(),this.trigger("before-hide"),this.el&&(this.el.hidden=!0),this._updateStepTargetOnHide(),this.trigger("hide")}_resolveAttachToOptions(){return this._resolvedAttachTo=function(e){const t=e.options.attachTo||{},n=Object.assign({},t);if(f(n.element)&&(n.element=n.element.call(e)),g(n.element)){try{n.element=document.querySelector(n.element)}catch(e){}n.element||console.error("The element for this Shepherd step was not found "+t.element)}return n}(this),this._resolvedAttachTo}_getResolvedAttachToOptions(){return null===this._resolvedAttachTo?this._resolveAttachToOptions():this._resolvedAttachTo}isOpen(){return Boolean(this.el&&!this.el.hidden)}show(){if(f(this.options.beforeShowPromise)){const e=this.options.beforeShowPromise();if(!m(e))return e.then(()=>this._show())}this._show()}updateStepOptions(e){Object.assign(this.options,e),this.shepherdElementComponent&&this.shepherdElementComponent.$set({step:this})}getElement(){return this.el}getTarget(){return this.target}_createTooltipContent(){const e=this.id+"-description",t=this.id+"-label";return this.shepherdElementComponent=new tn({target:this.tour.options.stepsContainer||document.body,props:{classPrefix:this.classPrefix,descriptionId:e,labelId:t,step:this,styles:this.styles}}),this.shepherdElementComponent.getElement()}_scrollTo(e){const{element:t}=this._getResolvedAttachToOptions();f(this.options.scrollToHandler)?this.options.scrollToHandler(t):t instanceof Element&&"function"==typeof t.scrollIntoView&&t.scrollIntoView(e)}_getClassOptions(e){const t=this.tour&&this.tour.options&&this.tour.options.defaultStepOptions,n=e.classes?e.classes:"",r=t&&t.classes?t.classes:"",i=[...n.split(" "),...r.split(" ")],o=new Set(i);return Array.from(o).join(" ").trim()}_setOptions(e){void 0===e&&(e={});let t=this.tour&&this.tour.options&&this.tour.options.defaultStepOptions;t=h({},t||{}),this.options=Object.assign({arrow:!0},t,e);const{when:n}=this.options;this.options.classes=this._getClassOptions(e),this.destroy(),this.id=this.options.id||"step-"+Te(),n&&Object.keys(n).forEach(e=>{this.on(e,n[e],this)})}_setupElements(){m(this.el)||this.destroy(),this.el=this._createTooltipContent(),this.options.advanceOn&&b(this),De(this)}_show(){this.trigger("before-show"),this._resolveAttachToOptions(),this._setupElements(),this.tour.modal||this.tour._setupModal(),this.tour.modal.setupForStep(this),this._styleTargetElementForStep(this),this.el.hidden=!1,this.options.scrollTo&&setTimeout(()=>{this._scrollTo(this.options.scrollTo)}),this.el.hidden=!1;const e=this.shepherdElementComponent.getElement(),t=this.target||document.body;t.classList.add(this.classPrefix+"shepherd-enabled"),t.classList.add(this.classPrefix+"shepherd-target"),e.classList.add("shepherd-enabled"),this.trigger("show")}_styleTargetElementForStep(e){const t=e.target;t&&(e.options.highlightClass&&t.classList.add(e.options.highlightClass),t.classList.remove("shepherd-target-click-disabled"),!1===e.options.canClickTarget&&t.classList.add("shepherd-target-click-disabled"))}_updateStepTargetOnHide(){const e=this.target||document.body;this.options.highlightClass&&e.classList.remove(this.options.highlightClass),e.classList.remove("shepherd-target-click-disabled",this.classPrefix+"shepherd-enabled",this.classPrefix+"shepherd-target")}}function on(e){let t,n,r,i,o;return{c(){t=He("svg"),n=He("path"),ze(n,"d",e[2]),ze(t,"class",r=(e[1]?"shepherd-modal-is-visible":"")+" shepherd-modal-overlay-container")},m(r,a){Be(r,t,a),Le(t,n),e[11](t),i||(o=Ke(t,"touchmove",e[3]),i=!0)},p(e,i){let[o]=i;4&o&&ze(n,"d",e[2]),2&o&&r!==(r=(e[1]?"shepherd-modal-is-visible":"")+" shepherd-modal-overlay-container")&&ze(t,"class",r)},i:Re,o:Re,d(n){n&&Ue(t),e[11](null),i=!1,o()}}}function an(e,t,n){let{element:r,openingProperties:i}=t;Te();let o,a=!1,s=void 0;u();function u(){n(4,i={width:0,height:0,x:0,y:0,r:0})}function l(){n(1,a=!1),d()}function c(e,t,r,o){if(void 0===e&&(e=0),void 0===t&&(t=0),o){const{y:a,height:s}=function(e,t){const n=e.getBoundingClientRect();let r=n.y||n.top,i=n.bottom||r+n.height;if(t){const e=t.getBoundingClientRect(),n=e.y||e.top,o=e.bottom||n+e.height;r=Math.max(r,n),i=Math.min(i,o)}return{y:r,height:Math.max(i-r,0)}}(o,r),{x:u,width:l,left:c}=o.getBoundingClientRect();n(4,i={width:l+2*e,height:s+2*e,x:(u||c)-e,y:a-e,r:t})}else u()}function p(){n(1,a=!0)}const h=e=>{e.preventDefault()};function d(){s&&(cancelAnimationFrame(s),s=void 0),window.removeEventListener("touchmove",h,{passive:!1})}return e.$$set=e=>{"element"in e&&n(0,r=e.element),"openingProperties"in e&&n(4,i=e.openingProperties)},e.$$.update=()=>{16&e.$$.dirty&&n(2,o=function(e){let{width:t,height:n,x:r=0,y:i=0,r:o=0}=e;const{innerWidth:a,innerHeight:s}=window;return`M${a},${s}H0V0H${a}V${s}ZM${r+o},${i}a${o},${o},0,0,0-${o},${o}V${n+i-o}a${o},${o},0,0,0,${o},${o}H${t+r-o}a${o},${o},0,0,0,${o}-${o}V${i+o}a${o},${o},0,0,0-${o}-${o}Z`}(i))},[r,a,o,e=>{e.stopPropagation()},i,()=>r,u,l,c,function(e){d(),e.tour.options.useModalOverlay?(!function(e){const{modalOverlayOpeningPadding:t,modalOverlayOpeningRadius:n}=e.options,r=function e(t){if(!t)return null;const n=t instanceof HTMLElement&&window.getComputedStyle(t).overflowY;return"hidden"!==n&&"visible"!==n&&t.scrollHeight>=t.clientHeight?t:e(t.parentElement)}(e.target),i=()=>{s=void 0,c(t,n,r,e.target),s=requestAnimationFrame(i)};i(),window.addEventListener("touchmove",h,{passive:!1})}(e),p()):l()},p,function(e){et[e?"unshift":"push"](()=>{r=e,n(0,r)})}]}class sn extends xt{constructor(e){super(),wt(this,e,an,on,Ne,{element:0,openingProperties:4,getElement:5,closeModalOpening:6,hide:7,positionModal:8,setupForStep:9,show:10})}get getElement(){return this.$$.ctx[5]}get closeModalOpening(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[7]}get positionModal(){return this.$$.ctx[8]}get setupForStep(){return this.$$.ctx[9]}get show(){return this.$$.ctx[10]}}const un=new v;Object.assign(un,{Tour:class extends v{constructor(e){void 0===e&&(e={}),super(e),y(this);this.options=Object.assign({},{exitOnEsc:!0,keyboardNavigation:!0},e),this.classPrefix=Ce(this.options.classPrefix),this.steps=[],this.addSteps(this.options.steps);return["active","cancel","complete","inactive","show","start"].map(e=>{(e=>{this.on(e,t=>{(t=t||{}).tour=this,un.trigger(e,t)})})(e)}),this._setTourID(),this}addStep(e,t){let n=e;return n instanceof rn?n.tour=this:n=new rn(this,n),m(t)?this.steps.push(n):this.steps.splice(t,0,n),n}addSteps(e){return Array.isArray(e)&&e.forEach(e=>{this.addStep(e)}),this}back(){const e=this.steps.indexOf(this.currentStep);this.show(e-1,!1)}cancel(){if(this.options.confirmCancel){const e=this.options.confirmCancelMessage||"Are you sure you want to stop the tour?";window.confirm(e)&&this._done("cancel")}else this._done("cancel")}complete(){this._done("complete")}getById(e){return this.steps.find(t=>t.id===e)}getCurrentStep(){return this.currentStep}hide(){const e=this.getCurrentStep();if(e)return e.hide()}isActive(){return un.activeTour===this}next(){const e=this.steps.indexOf(this.currentStep);e===this.steps.length-1?this.complete():this.show(e+1,!0)}removeStep(e){const t=this.getCurrentStep();this.steps.some((t,n)=>{if(t.id===e)return t.isOpen()&&t.hide(),t.destroy(),this.steps.splice(n,1),!0}),t&&t.id===e&&(this.currentStep=void 0,this.steps.length?this.show(0):this.cancel())}show(e,t){void 0===e&&(e=0),void 0===t&&(t=!0);const n=g(e)?this.getById(e):this.steps[e];if(n){this._updateStateBeforeShow();f(n.options.showOn)&&!n.options.showOn()?this._skipStep(n,t):(this.trigger("show",{step:n,previous:this.currentStep}),this.currentStep=n,n.show())}}start(){this.trigger("start"),this.focusedElBeforeOpen=document.activeElement,this.currentStep=null,this._setupModal(),this._setupActiveTour(),this.next()}_done(e){const t=this.steps.indexOf(this.currentStep);if(Array.isArray(this.steps)&&this.steps.forEach(e=>e.destroy()),function(e){if(e){const{steps:t}=e;t.forEach(e=>{e.options&&!1===e.options.canClickTarget&&e.options.attachTo&&e.target instanceof HTMLElement&&e.target.classList.remove("shepherd-target-click-disabled")})}}(this),this.trigger(e,{index:t}),un.activeTour=null,this.trigger("inactive",{tour:this}),this.modal&&this.modal.hide(),("cancel"===e||"complete"===e)&&this.modal){const e=document.querySelector(".shepherd-modal-overlay-container");e&&e.remove()}d(this.focusedElBeforeOpen)&&this.focusedElBeforeOpen.focus()}_setupActiveTour(){this.trigger("active",{tour:this}),un.activeTour=this}_setupModal(){this.modal=new sn({target:this.options.modalContainer||document.body,props:{classPrefix:this.classPrefix,styles:this.styles}})}_skipStep(e,t){const n=this.steps.indexOf(e);if(n===this.steps.length-1)this.complete();else{const e=t?n+1:n-1;this.show(e,t)}}_updateStateBeforeShow(){this.currentStep&&this.currentStep.hide(),this.isActive()||this._setupActiveTour()}_setTourID(){const e=this.options.tourName||"tour";this.id=`${e}--${Te()}`}},Step:rn});const ln="shepherd.guide_id",cn="shepherd.guide.current.step.id",pn="shepherd.guide.step.history",hn="shepherd.guide.pause";function dn(e,t,n,i,o,a,s){this.guideCancelSubscription=void 0,this.onPause=()=>{},this.onCancel=()=>{},this.startGuide=(e,t,r,i=!0)=>{if(i&&n.remove(pn),!t)return;const o=this._createGuide(e);this._addGuideSteps(o,t),this._startGuide(o,r)},this.resumeGuide=(e,t,r)=>{n.set(hn,!1),this.startGuide(e,t,r,!1)},this.isActive=()=>un.activeTour&&!this.isPaused(),this.isPaused=()=>"true"===n.get(hn),this.getGuideId=()=>n.get(ln),this.getCurrentStepId=()=>n.get(cn),this.subscribeToGuideCancel=e=>{angular.isFunction(e)&&(this.onCancel=e)},this.subscribeToGuidePause=e=>{angular.isFunction(e)&&(this.onPause=e)},this._createGuide=e=>(this._subscribeToGuideCanceled(),new un.Tour({name:e,useModalOverlay:!0,confirmCancel:!0,confirmCancelMessage:t.instant("guide.confirm.cancel.message"),defaultStepOptions:{classes:"shadow-md bg-purple-dark",scrollTo:!0}})),this._addGuideSteps=(e,t)=>{if(t.length>0&&e.addStep(this._getFirstStep(e,t)),t.length>2)for(let n=1;n<t.length-1;n++)e.addStep(this._getMiddleStep(e,t,n));t.length>1&&e.addStep(this._getLastStep(e,t))},this._startGuide=(o,s)=>{n.remove(hn);let u=o.steps.findIndex(e=>e.options.id===s);u<0&&(u=0);const l=o.steps[u],c=l.options.url;c&&(e.url(c),i.reload()),l.options.attachTo?r.GuideUtils.waitFor(l.options.attachTo.element,l.options.maxWaitTime).then(()=>o.show(u)).catch(e=>{console.log(e),a.error(t.instant("guide.start.unexpected.error.message"))}):o.show(u)},this._subscribeToGuideCanceled=()=>{this.guideCancelSubscription||(this.guideCancelSubscription=un.on("cancel",()=>{this._clearLocaleStorage();const e=un.activeTour.getCurrentStep();e&&angular.isFunction(e.hide)&&e.hide(),this.onCancel&&this.onCancel()}))},this._getFirstStep=function(e,t){const n=t.length>1?t[1]:void 0;return this._toGuideStep(e,void 0,t[0],n)},this._getMiddleStep=(e,t,n)=>this._toGuideStep(e,t[n-1],t[n],t[n+1]),this._getLastStep=(e,t)=>{const n=this._toGuideStep(e,null,t[t.length-1]);return n.buttons.push(this._getBackToGuidesButton(e)),n.buttons.push(this._getCancelButton(e)),n},this._getBackToGuidesButton=e=>this._getButton(t.instant("back.to.guides.btn"),()=>this._backToGuidesButton(e),!0),this._getCancelButton=e=>this._getButton(t.instant("common.close"),()=>this._cancelGuide(e,!1),!0),this._backToGuidesButton=t=>{e.path("guides"),this._cancelGuide(t,!1)},this._cancelGuide=(e,t=!0)=>{e.options.confirmCancel=t,e.cancel(),this.onCancel()&&this.onCancel()},this._toGuideStep=(e,n,r,i)=>{const o=this._toBaseGuideStep(e,t,r,()=>this._updateLocalStorage()),a=[];return r.skipPoint&&a.push(this._getSkipButton(e)),n&&a.push(this._getPreviousButton(e)),i&&a.push(this._getNextButton(e,r,i)),o.buttons=a,o},this._getPauseButton=e=>this._getButton(t.instant("pause.btn"),()=>this._pauseGuide(e),!0),this._getSkipButton=e=>this._getButton(t.instant("skip.btn"),()=>this._skipSteps(e),!0),this._skipSteps=e=>{const t=e.getCurrentStep(),n=e.steps.findIndex(e=>t.id===e.id);this._startGuide(e,this._getNextSkipPointId(e.steps,n))},this._getNextSkipPointId=(e,t)=>{for(let n=t+1;n<e.length;n++){const t=e.at(n);if(t.options.skipPoint)return t.id}return e.at(e.length-1).id},this._pauseGuide=e=>{e.hide();const t=this._getStepWhichCanBePaused(e.steps,e.getCurrentStep().id);this._saveStep(t),n.set(hn,!0);let r=!1;for(;!r;){const e=this._getHistory();e&&e.length>0&&e.at(e.length-1)!==t.options.id?this._removeLastStepFromHistory():r=!0}this.onPause()&&this.onPause()},this._getStepWhichCanBePaused=(e,t)=>{const n=e.findIndex(e=>e.id===t),r=e[n];return r.options.canBePaused?r:n>0?this._getStepWhichCanBePaused(e,e[n-1].id):void 0},this._getPreviousButton=e=>{const n=t.instant("previous.btn"),r=this._getPreviousButtonAction(e);return this._getButton(n,r)},this._getPreviousButtonAction=n=>()=>{const i=this._getPreviousStepIdFromHistory();let o;o=-1===i?n.steps.at(0):n.steps.find(e=>e.options.id===i);const s=n.getCurrentStep();s.hide(),s.options.initPreviousStep({GuideUtils:r.GuideUtils,ShepherdService:this},s.options.id).then(()=>{angular.isFunction(s.options.onPreviousClick)?s.options.onPreviousClick(n).then(e=>{!angular.isUndefined(e)&&null!==e&&e||(s.hide(),n.show(o.id))}).catch(e=>{console.log(e),a.error(t.instant("guide.unexpected.error.message")),this._cancelGuide(n,!1)}):((o.options.forceReload||o.options.url&&o.options.url!==s.options.url)&&e.path(o.options.url),s.hide(),n.show(o.id))}).catch(e=>{console.log(e),a.error(t.instant("guide.unexpected.error.message")),this._cancelGuide(n,!1)})},this._getNextButton=(e,n,r)=>{const i=t.instant("next.btn"),o=u(e,n,r);return this._getButton(i,o)};const u=(n,r,i)=>()=>{let o=!0;if(angular.isFunction(r.onNextValidate)&&(o=r.onNextValidate(r)),o)if(angular.isFunction(r.onNextClick)){const e=r.onNextClick(n,r);e instanceof Promise&&e.catch(e=>{console.log(e),a.error(t.instant("guide.unexpected.error.message")),this._cancelGuide(n,!1)})}else(i.forceReload||i.url&&i.url!==r.url)&&e.path(i.url),n.next()};this._updateLocalStorage=()=>{const e=un.activeTour;if(!e)return;const t=e.getCurrentStep(),n=e.steps.findIndex(e=>e.id===t.id),r=this.getCurrentStepId(),i=e.steps.findIndex(e=>e.id===r);n>i?this._addStepToHistory(t):i>n&&this._removeLastStepFromHistory(),this._saveStep(t)},this._saveStep=e=>{e&&(n.set(ln,e.tour.options.name),n.set(cn,e.options.id))},this._addStepToHistory=e=>{const t=this._getHistory();t.push(e.options.id),n.set(pn,t)},this._getHistory=()=>{const e=n.get(pn);return e||[]},this._removeLastStepFromHistory=()=>{const e=this._getHistory();e.splice(e.length-1,1),n.set(pn,e)},this._getPreviousStepIdFromHistory=e=>{const t=this._getHistory()||[];if(e){const n=t.findIndex(t=>t===e);if(n>0)return t.at(n-1)}else if(t.length>1)return t.at(t.length-2);return-1},this.getPreviousStepFromHistory=e=>{const t=this._getPreviousStepIdFromHistory(e);return un.activeTour.steps.find(e=>e.id===t)},this._clearLocaleStorage=()=>{n.remove(ln),n.remove(hn),n.remove(cn),n.remove(pn)},this._toBaseGuideStep=(e,t,n,i)=>{let a;n.elementSelector&&(a={element:n.elementSelector,on:n.placement});const s=r.GuideUtils.unescapeHtml(r.GuideUtils.translateLocalMessage(t,o,n.title,n));let u="";if(n.stepsTotalN>1){const e=document.createElement("span");e.setAttribute("gdb-tooltip",t.instant("guide.block.progress.tooltip",{action:s})),e.setAttribute("tooltip-placement","bottom"),e.innerText=t.instant("guide.block.progress",{n:n.stepN+1,nn:n.stepsTotalN}),u="&nbsp;&mdash;&nbsp;"+e.outerHTML}const l="readonly"!==n.type,c=n.extraPadding?n.extraPadding:0,p={id:n.id,title:s+u,text:()=>{const e=this._toParagraph(r.GuideUtils.translateLocalMessage(t,o,n.content,n));let i="";return n.extraContent&&(i=r.GuideUtils.translateLocalMessage(t,o,n.extraContent,n),i=this._toParagraph(i,n.extraContentClass)),e+i},url:n.url,maxWaitTime:n.maxWaitTime,cancelIcon:{enabled:!0},attachTo:a,modalOverlayOpeningPadding:c,modalOverlayOpeningRadius:0,canBePaused:n.canBePaused,advanceOn:n.advanceOn,showOn:n.showOn,scrollToHandler:n.scrollToHandler,classes:"guide-dialog",beforeShowPromise:n.beforeShowPromise,canClickTarget:l,keyboardNavigation:!1,skipPoint:n.skipPoint,onPreviousClick:n.onPreviousClick,initPreviousStep:n.initPreviousStep,when:{show:this._getShowFunction(e,n,i)}};return angular.isFunction(n.hide)&&(p.when.hide=n.hide(e)),p},this._getShowFunction=(e,t,n)=>angular.isFunction(t.show)?()=>{t.show(e)(),n(),this._whenStepShow(t)}:()=>{n(),this._whenStepShow(t)},this._whenStepShow=e=>{const t=un.activeTour.getCurrentStep(),n=t.getElement();this._addTotalProgress(t,n),this._addTypeIcon(n,e);const r=angular.element(n).scope();angular.isFunction(e.onScope)&&e.onScope(r),setTimeout(()=>r.$apply(()=>s(n)(r)))},this._toParagraph=(e,t)=>{if(e){const n=document.createElement("p");return t&&(n.className=t),n.innerHTML=e,n.outerHTML}return""},this._addTotalProgress=(e,n)=>{const r=un.activeTour.steps,i=n.querySelector(".shepherd-content"),o=document.createElement("div");o.className="shepherd-progress";const a=document.createElement("span");a.className="text-muted",a.innerText=t.instant("guide.total.progress",{n:r.indexOf(e)+1,nn:r.length}),a.setAttribute("gdb-tooltip",t.instant("guide.total.progress.tooltip")),a.setAttribute("tooltip-placement","left"),o.appendChild(a),i.appendChild(o)},this._addTypeIcon=(e,n)=>{let r,i;switch(n.type){case"clickable":r="focus",i="mouse";break;case"input":r="edit",i="input";break;default:r="info",i="info"}const o=document.createElement("span");o.className="shepherd-step-type icon-"+r+" icon-1-25x",o.setAttribute("gdb-tooltip",t.instant("guide.step-type."+i)),o.setAttribute("tooltip-placement","bottom-right"),angular.element(e.querySelector(".shepherd-header")).prepend(o)},this._getButton=(e,t,n)=>{const r={text:e,classes:n?"btn btn-secondary":"btn btn-primary",action:e=>{e.stopPropagation(),t()}};return r}}angular.module("graphdb.framework.guides.shepherd.services",["graphdb.framework.utils.localstorageadapter"]).service("ShepherdService",dn),dn.$inject=["$location","$translate","LocalStorageAdapter","$route","$interpolate","toastr","$compile"]},function(e,t){angular.module("graphdb.framework.rest.license.service",["ngFileUpload"]).factory("LicenseRestService",r),r.$inject=["$http","Upload"];const n="rest/graphdb-settings/license";function r(e,t){return{getLicenseInfo:function(){return e.get(n)},getHardcodedLicense:function(){return e.get(n+"/hardcoded")},sendLicenseToValidate:function(t){return e.post("rest/info/license/validate",t,{headers:{Accept:"application/json","Content-Type":"text/plain"}})},extractFromLicenseFile:function(e){return t.upload({url:"rest/info/license/to-base-64",file:e,headers:{Accept:"text/plain"}})},checkLicenseHardcoded:function(){return e.get(n+"/hardcoded")},registerLicense:function(t){const r=new Uint8Array(t.length);for(let e=0;e<r.length;e++)r[e]=t.charCodeAt(e);return e({method:"POST",url:n,headers:{"Content-Type":"application/octet-stream"},data:r,transformRequest:[]})},unregisterLicense:function(){return e({method:"DELETE",url:"rest/graphdb-settings/license"})},getInfo:function(){return e.get("rest/info/properties")},getVersion:function(t){return e.get("rest/info/version",{headers:{"X-GraphDB-Repository-Location":t}})},getStatistics:function(){return e.get("rest/graphdb-settings/statistics")},toggleStatistics:function(t){return e({method:"POST",url:"rest/graphdb-settings/statistics",headers:{"Content-Type":"application/x-www-form-urlencoded"},data:"enabled="+t})}}}},function(e,t){angular.module("graphdb.framework.rest.repositories.service",[]).factory("RepositoriesRestService",n),n.$inject=["$http"];function n(e){return{getRepositories:function(t){return e.get("rest/repositories/all",{params:{location:t}})},getRepository:function(t){return e.get("rest/repositories/"+t.id,{params:{location:t.location}})},deleteRepository:function(t){return e.delete("rest/repositories/"+t.id,{params:{location:t.location}})},createRepository:function(t){return e.post("rest/repositories",t)},editRepository:function(t,n){return e.put("rest/repositories/"+t,n)},getRepositoryConfiguration:function(t){return e.get("rest/repositories/default-config/"+t)},getSize:function(t){return e.get(`rest/repositories/${t.id}/size`,{params:{location:t.location}})},getPrefix:function(t,n){return e.post(`rest/repositories/${t}/prefix`,null,{params:n})},getCluster:function(){return e.get("rest/repositories/cluster")},getRepositoryFileContent:function(t){return e.get("rest/repositories/file",{params:{fileLocation:t}})},updateRepositoryFileContent:function(t,n,r){return e.post("rest/repositories/file/update",JSON.stringify(n),{params:{fileLocation:t,location:r}})},validateOntopPropertiesConnection:function(t){return e.post("rest/repositories/ontop/test-connection",t.params.propertiesFile,{params:{location:t.location}})},restartRepository:function(t){return e.post(`rest/repositories/${t.id}/restart`,null,{params:{location:t.location}})},getSupportedDriversData:function(t){return e.get("rest/repositories/ontop/drivers",{params:{location:t.location}})},updatePropertiesFile:function(t,n,r,i){return e.post("rest/repositories/ontop/jdbc-properties",JSON.stringify(n),{params:{fileLocation:t,location:r,driverType:i}})},loadPropertiesFile:function(t,n,r){return e.get("rest/repositories/ontop/jdbc-properties",{params:{fileLocation:t,location:n,driverType:r}})},getRepositoriesFromKnownLocation:function(t){return e.get("rest/repositories?location="+t)},getRepositoryTurtleConfig:function(t){return e.get("rest/repositories/"+t.id,{headers:{Accept:"text/turtle"}})}}}},function(e,t,n){"use strict";n.r(t),n.d(t,"mapBackupAndRestoreResponseToModel",(function(){return o})),n.d(t,"mapSnapshotOptionsResponseToModel",(function(){return a}));var r=n(16),i=n(17);const o=e=>{const t=[],n=new r.BackupAndRestoreInfo;return 0===Object.keys(e).length||(n.id=e.id,n.username=e.username,n.operation=e.operation,n.affectedRepositories=e.affectedRepositories,n.secondsSinceCreated=e.msSinceCreated/1e3,n.snapshotOptions=a(e.snapshotOptions),n.nodePerformingClusterBackup=e.nodePerformingClusterBackup,t.push(n)),t},a=e=>{const t=new i.SnapshotOptionInfo;return t.withRepositoryData=e.withRepositoryData,t.withSystemData=e.withSystemData,t.withClusterData=e.withClusterData,t.cleanDataDir=e.cleanDataDir,t.removeCluster=e.removeCluster,t.repositories=e.repositories,t.replicationTimeoutMs=e.replicationTimeoutMs,t}},function(e,t,n){"use strict";n.r(t),n.d(t,"BackupAndRestoreInfo",(function(){return r}));class r{constructor(){this.id=void 0,this.username="",this.operation="",this.affectedRepositories=[],this.secondsSinceCreated=0,this.snapshotOptions=[],this.nodePerformingClusterBackup=""}}},function(e,t,n){"use strict";n.r(t),n.d(t,"SnapshotOptionInfo",(function(){return r}));class r{constructor(){this.withRepositoryData=!1,this.withSystemData=!1,this.withClusterData=!1,this.cleanDataDir=!1,this.removeCluster=!1,this.repositories=[],this.replicationTimeoutMs=0}}},function(e,t,n){"use strict";n.r(t),n.d(t,"mapActiveOperationResponseToModel",(function(){return u})),n.d(t,"mapActiveOperationToActiveOperationInfoModel",(function(){return c})),n.d(t,"mapImportActiveOperationToActiveOperationInfoModel",(function(){return p})),n.d(t,"mapQueriesActiveOperationToActiveOperationInfoModel",(function(){return h})),n.d(t,"mapBackupAndRestoreActiveOperationToActiveOperationInfoModel",(function(){return d})),n.d(t,"mapClusterActiveOperationToActiveOperationInfoModel",(function(){return f}));var r=n(3),i=n(8),o=n(1),a=n(19),s=n(9);const u=e=>{const t=new a.ActiveOperationsModel;return t.status=e.status,t.operations=l(e.allRunningOperations),t},l=(e=[])=>{const t=[];return e.forEach(e=>t.push(c(e))),t},c=e=>{switch(e.type){case r.OPERATION_TYPE.IMPORTS:return p(e);case r.OPERATION_TYPE.QUERIES:case r.OPERATION_TYPE.UPDATES:return h(e);case r.OPERATION_TYPE.BACKUP_RESTORE:return d(e);case r.OPERATION_TYPE.CLUSTER_STATUS:return f(e)}},p=e=>{const t=new i.ActiveOperationModel;return t.operationGroup=o.OPERATION_GROUP_TYPE.IMPORT_OPERATION,t.runningOperationCount=parseInt(e.value,10),t.status=e.status,t.type=e.type,t.titleLabelKey=e.type,t.monitoringViewUrl=s.OPERATION_MONITORING_CONSTANTS.IMPORT_MONITORING_URL,t},h=e=>{const t=new i.ActiveOperationModel;return t.operationGroup=o.OPERATION_GROUP_TYPE.QUERIES_OPERATION,t.runningOperationCount=parseInt(e.value,10),t.status=e.status,t.type=e.type,t.titleLabelKey=e.type,t.monitoringViewUrl=s.OPERATION_MONITORING_CONSTANTS.QUERIES_MONITORING_URL,t},d=e=>{const t=new i.ActiveOperationModel;return t.operationGroup=o.OPERATION_GROUP_TYPE.BACKUP_AND_RESTORE_OPERATION,t.status=e.status,t.type=e.type,t.titleLabelKey=e.value,t.monitoringViewUrl=s.OPERATION_MONITORING_CONSTANTS.BACKUP_AND_RESTORE_MONITORING_URL,t},f=e=>{const t=new i.ActiveOperationModel;return t.operationGroup=o.OPERATION_GROUP_TYPE.CLUSTER_OPERATION,t.status=e.status,t.type=e.type,t.titleLabelKey=e.value,t.monitoringViewUrl=s.OPERATION_MONITORING_CONSTANTS.CLUSTER_MONITORING_URL,t}},function(e,t,n){"use strict";n.r(t),n.d(t,"ActiveOperationsModel",(function(){return o}));var r=n(4),i=n(1);class o{constructor(){this.operations=[],this.status=r.OPERATION_STATUS.INFORMATION}hasClusterOperation(){return!!this.operations&&this.operations.some(e=>i.OPERATION_GROUP_TYPE.CLUSTER_OPERATION===e.operationGroup)}}},function(e,t,n){"use strict";n.r(t),n.d(t,"SequenceGeneratorUtil",(function(){return r}));class r{static getFibonacciSequenceGenerator(){return r.fibonacciSequenceGenerator()}static fibonacciSequenceGenerator(){let e=0,t=1;return{next:function(){const n=t;return t=e+t,e=n,n},reset:function(){e=0,t=1}}}}},function(e,t,n){"use strict";n.r(t),n.d(t,"mapUriAsNtripleAutocompleteResponse",(function(){return r}));const r=e=>e&&e.data&&e.data.suggestions?e.data.suggestions.map(e=>({type:e.type,value:e.value,description:e.description})):[]},function(e,t,n){"use strict";n.r(t);n(7),n(14),n(31),n(13),n(53),n(54);angular.module("graphdb.framework.core.services.repositories",["ngCookies","graphdb.framework.rest.repositories.service","graphdb.framework.rest.locations.service","graphdb.framework.rest.license.service","toastr"]).service("$repositories",["toastr","$rootScope","$timeout","$location","productInfo","$jwtAuth","RepositoriesRestService","LocationsRestService","LicenseRestService","$translate","$q","LocalStorageAdapter","LSKeys",function(e,t,n,r,i,o,a,s,u,l,c,p,h){this.location={uri:"",label:"Local",local:!0,isInCluster:!1},this.locationError="",this.loading=!0,this.locations=[this.location],this.repositories=new Map,this.locationsShouldReload=!0;const d=this,f=function(t,n){d.loading=!1,t&&(d.location={},d.locationError=n,d.repositories=new Map,d.setRepository(""),t.statusText?e.error(t.statusText,l.instant("repositories.service.error.loading.location")):e.error(l.instant("repositories.service.error.loading.location")))};let g;this.resetActiveRepository=function(){const e=this.getActiveRepositoryObjectFromStorage(),n=d.repositories.get(e.location);let r=!1;n&&(r=n.find(t=>t.id===e.id)),r?o.canReadRepo(e)?t.$broadcast("repositoryIsSet",{newRepo:!1}):this.setRepository(""):this.setRepository(this.location.defaultRepository?{id:this.location.defaultRepository,location:this.location.uri}:"")},this.checkLocationsDegraded=function(e){this.locations.forEach(t=>{t.local||(t.errorMsg&&d.repositories.delete(t.uri)&&d.resetActiveRepository(),u.getVersion(t.uri).success((function(e){"object"==typeof e?e.productVersion!==i.productVersion&&(t.degradedReason=l.instant("repositories.service.different.gdb.version",{location:t.name})):t.degradedReason=l.instant("repositories.service.different.gdb.version",{location:t.name})})).error((function(n){t.errorMsg=n,e||(d.locationsShouldReload=!0)})))})},this.getDegradedReason=function(){const e=this.getActiveRepositoryObjectFromStorage(),t=this.locations.find(t=>t.uri===e.location);return t?t.degradedReason:""},this.clearLocationErrorMsg=function(e){const t=this.locations.find(t=>t.uri===e);t&&t.errorMsg&&(t.errorMsg=null)},this.initQuick=function(){this.hasActiveLocation()&&this.init(null,null,!0)},this.init=function(e,n,r){return this.loading=!0,r||(this.locationsShouldReload=!0),s.getActiveLocation().then((function(i){if(i.data){const o=i.data;if(o.active)return a.getRepositories().then((function(n){d.location=o,Object.entries(n.data).forEach(([e,t])=>{d.clearLocationErrorMsg(e),d.repositories.set(e,t)}),d.resetActiveRepository(),f(),d.checkLocationsDegraded(r),t.globalLocation=d.location,t.globalRepositories=d.getRepositories(),e&&e()})).catch((function(e){f(e),n&&n()}))}else f(),r&&(d.locationsShouldReload=!0),d.location="",d.repositories=new Map,d.setRepository("");t.globalLocation=d.location,t.globalRepositories=d.getRepositories()})).catch((function(e){f(e),n&&n()}))},this.getLocations=function(e){if(this.locationsShouldReload||g)return g||(this.locationsShouldReload=!1,this.locations=[this.location],g=s.getLocations(e,!0).then(e=>(d.locations=e.data,this.locations)).catch((function(){n((function(){d.locationsShouldReload=!0}),2e3)})).finally(()=>{g=null})),g;const t=c.defer();return t.resolve(this.locations),t.promise},this.getActiveLocation=function(){return this.location},this.hasActiveLocation=function(){return!_.isEmpty(this.location)},this.getLocationError=function(){return this.locationError?this.locationError:l.instant("repositories.service.no.active.location")},this.isLoadingLocation=function(){return this.loading},this.getRepositories=function(){const e=[];return this.repositories.forEach(t=>e.push.apply(e,t)),e},this.getReadableRepositories=function(){return _.filter(this.getRepositories(),(function(e){return o.canReadRepo(e)}))},this.getWritableRepositories=function(){const e=this;return _.filter(this.getRepositories(),(function(t){return o.canWriteRepo(t)&&!e.isActiveRepoOntopType(t)}))},this.getActiveRepositoryObjectFromStorage=function(){return{id:p.get(h.REPOSITORY_ID)||"",location:p.get(h.REPOSITORY_LOCATION)||""}},this.getActiveRepository=function(){return p.get(h.REPOSITORY_ID)||void 0},this.getActiveRepositoryObject=function(){const e=this.getActiveRepositoryObjectFromStorage(),t=this.repositories.get(e.location);return t?t.find(t=>t.id===e.id):null},this.isSystemRepository=function(){return"SYSTEM"===this.getActiveRepositoryObjectFromStorage().id},this.isActiveRepoOntopType=function(e){const t=this;let n;return e||(e=t.getActiveRepositoryObject()),e&&(n=t.repositories.get(e.location).find(t=>t.id===e.id),n)?"graphdb:OntopRepository"===n.sesameType:void 0===n},this.isActiveRepoFedXType=function(){const e=this,t=e.getActiveRepositoryObject();let n;return t&&(n=e.repositories.get(t.location).find(e=>e.id===t.id),n)?"graphdb:FedXRepository"===n.sesameType:void 0===n},this.getLocationFromUri=function(e){return this.locations.find(t=>t.uri===e)},this.setRepositoryHeaders=function(e){$.ajaxSetup().headers=$.ajaxSetup().headers||{},$.ajaxSetup().headers["X-GraphDB-Repository"]=e?e.id:void 0,$.ajaxSetup().headers["X-GraphDB-Repository-Location"]=e?e.location:void 0},this.setRepository=function(e){e?(p.set(h.REPOSITORY_ID,e.id),p.set(h.REPOSITORY_LOCATION,e.location)):(p.remove(h.REPOSITORY_ID),p.remove(h.REPOSITORY_LOCATION)),this.setRepositoryHeaders(e),t.$broadcast("repositoryIsSet",{newRepo:!0}),e&&!o.canReadRepo(e)&&this.setRepository(""),t.deniedPermissions={}},this.getDefaultRepository=function(){return this.hasActiveLocation()?this.location.defaultRepository:""},this.setDefaultRepository=function(t){if(!this.hasActiveLocation())return void e.error(l.instant("repositories.service.no.active.location"),l.instant("common.error"));const n=this;s.setDefaultRepository(t).success((function(){n.location.defaultRepository=t})).error((function(t){const n=getError(t);e.error(n,l.instant("common.error"))}))},this.deleteLocation=function(t){return s.deleteLocation(encodeURIComponent(t)).success((function(){const e=d.getActiveRepositoryObject();e&&e.location===t&&(d.location="",d.setRepository("")),d.init()})).error((function(t){const n=getError(t);e.error(n,l.instant("common.error"))}))},this.deleteRepository=function(t){return a.deleteRepository(t).success((function(){d.init()})).error((function(t){const n=getError(t);e.error(n,l.instant("common.error"))})).finally(()=>{const e=d.getActiveRepositoryObject();e&&e.id===t.id&&e.location===t.location&&d.setRepository("")})},this.restartRepository=function(t){return a.restartRepository(t).success((function(){e.success(l.instant("repositories.service.restarting.repo",{repositoryId:t.id})),d.initQuick()})).error((function(t){const n=getError(t);e.error(n,l.instant("common.error"))}))},this.getRepositoryTurtleConfig=function(e){return a.getRepositoryTurtleConfig(e)},this.isRepoActive=function(e){const t=this.getActiveRepositoryObjectFromStorage();return!!t.id&&(e.id===t.id&&e.location===t.location)},this.getRepositoriesFromLocation=function(e){return this.repositories.get(e)},t.$on("securityInit",(function(e,t,r,i){g=null,(!t||r||i)&&n((function(){d.init()}))})),t.$on("reloadLocations",(function(){d.locationsShouldReload=!0,d.getLocations().then(()=>d.initQuick())}))}])},function(e,t,n){"use strict";n.r(t);n(10);var r=n(0);function i(){return{template:function(e,t){return'<object width="'+t.size+'" height="'+t.size+'" data="js/angular/templates/loader/ot-loader.svg?v=2.6.0-TR2">{{\'common.loading\' | translate}}</object>'}}}function o(){return{template:function(e,t){return'<object width="'+t.size+'" height="'+t.size+'" data="js/angular/templates/loader/ot-loader.svg?v=2.6.0-TR2"></object><div>{{\'common.loading\' | translate}}<div>'}}}function a(e){const t=function(e,n){n.timer=void 0,n.currentMessage=n.getMessage();const r=n.timeout[n.index%n.timeout.length];r&&(n.timer=e((function(){(n.index+1<n.message.length||0===n.message.length)&&(n.index++,t(e,n))}),1e3*r))};return{restrict:"EA",scope:{size:"@",trigger:"@",messageAttr:"=*message",timeoutAttr:"=*timeout",ngShow:"=",ngHide:"="},link:function(n){n.message=n.messageAttr,n.getMessage=function(){return n.message[n.index]},void 0===n.message?n.message=[""]:"function"==typeof n.message?(n.getMessage=n.message,n.message=[]):"object"!=typeof n.message&&(n.message=[n.message]),n.timeout=n.timeoutAttr,void 0===n.timeout?n.timeout=[0]:"object"!=typeof n.timeout&&(n.timeout=[n.timeout]),n.index=0,t(e,n);const r=function(r){n.timer&&e.cancel(n.timer),r&&(n.index=0,t(e,n))};n.$watch("ngShow",(function(e){r(e)})),n.$watch("ngHide",(function(e){r(!e)})),n.$on("$destroy",(function(){n.timer&&e.cancel(n.timer)}))},template:'<div class="ot-loader-new-content"><img width="{{size}}" height="{{size}}" src="js/angular/templates/loader/ot-loader.svg?v=2.6.0-TR2"/><div style="font-size: {{size/4}}px">{{currentMessage}}<div></div>'}}function s(e){return{restrict:"EA",transclude:!0,templateUrl:"js/angular/core/templates/core-errors.html",link:function(t,n,r){let i;t.setAttrs(r),t.setRestricted(),t.showRemoteLocations=!1,t.toggleShowRemoteLocations=()=>{t.showRemoteLocations=!t.showRemoteLocations},t.getAccessibleRepositories=function(){let e=e=>!0;return t.showRemoteLocations||(e=e=>e.local),t.isRestricted?t.getWritableRepositories().filter(e):t.getReadableRepositories().filter(e)},t.showPopoverForRepo=function(n,r){t.hidePopoverForRepo(),t.setPopoverRepo(r),e((function(){const e=$(n.toElement).find(".popover-anchor")[0];i=e,e&&!t.getActiveRepository()&&e.dispatchEvent(new Event("show"))})),n.stopPropagation()},t.hidePopoverForRepo=function(t){if(t){let e=t.relatedTarget;for(;e;){if(0===e.className.indexOf("popover"))return;e=e.parentElement}}i&&e((function(){i&&(i.dispatchEvent(new Event("hide")),i=null)})),t&&t.stopPropagation()}}}}function u(){return function(e,t){$(t).click((function(e){e.preventDefault(),e.stopPropagation()}))}}function l(){return{restrict:"A",require:"ngModel",link:function(e,t,n,r){e.multiRequired||(e.multiRequired=[]);const i=n.multiRequireElement,o=function(t){i&&i%1==0&&(e.multiRequired[i-1]=t)},a=function(){let t=!1,n=!1;for(let r=0;r<e.multiRequired.length;r++)e.multiRequired[r]?t=!0:n=!0;r.$setValidity("multiRequire",!(t&&n))};r.$parsers.unshift((function(e){return o(e),a(),e})),r.$formatters.unshift((function(e){return o(e),a(),e})),$("[multi-required]").on("blur keyup change focusout",(function(){a()}))}}}angular.module("graphdb.framework.core.directives",["graphdb.framework.core.services.repositories","graphdb.framework.utils.localstorageadapter"]).directive("ontoLoader",i).directive("ontoLoaderFancy",o).directive("ontoLoaderNew",a).directive("coreErrors",s).directive("eatClick",u).directive("multiRequired",l).directive("searchResourceInput",p).directive("keyboardShortcuts",h).directive("inactivePluginDirective",d),i.$inject=[],o.$inject=[],a.$inject=["$timeout"],s.$inject=["$timeout"],u.$inject=[],l.$inject=[];const c={table:"table",visual:"visual"};function p(e,t,n,i,o,a,s,u,l,p,h,d){return{restrict:"EA",scope:{namespacespromise:"=",autocompletepromisestatus:"=",textButton:"@",visualButton:"@",textCallback:"&",visualCallback:"&",placeholder:"@",uriValidation:"@",preserveInput:"@",empty:"=",clear:"=?clear",openInNewTab:"@",preserveSearch:"@",radioButtons:"@",clearInputIcon:"@"},templateUrl:"js/angular/core/templates/search-resource-input.html",link:function(f,g,m){g.autoCompleteStatus=void 0,g.autoCompleteWarning=!1,f.empty=!1,f.clear=!1,f.searchDisplayType=c;const v="true"===f.preserveSearch,y=g.find(".view-res-input");let b,w;f.textButtonLabel=f.textButton||"query.editor.table.btn",f.visualButtonLabel=f.visualButton||"query.editor.visual.btn",f.showClearInputIcon=!1,f.searchType=u.get(l.RDF_SEARCH_TYPE)||c.table,f.searchInput="",f.changeSearchType=function(e){f.searchType=e,u.set(l.RDF_SEARCH_TYPE,f.searchType)},f.$on("addStartFixedNodeAutomatically",(function(e,t){f.searchInput||!t.startIRI?f.checkIfValidAndSearchText():f.visualCallback({uri:t.startIRI,label:""})})),f.clearInput=function(){f.searchInput="",f.selectedElementIndex=-1,f.autoCompleteUriResults=[],f.showClearInputIcon=!1,u.remove(l.RDF_SEARCH_INPUT),u.remove(l.RDF_SEARCH_EXPANDED_URI),u.remove(l.RDF_RESOURCE_DESCRIPTION)},f.$watch("namespacespromise",(function(){angular.isDefined(f.namespacespromise)&&f.namespacespromise.success((function(e){g.namespaces=e.results.bindings.map((function(e){return{prefix:e.prefix.value,uri:e.namespace.value}}))})).error((function(e){const n=getError(e);t.error(n,h.instant("error.getting.namespaces.for.repo"))}))})),f.$watch("autocompletepromisestatus",(function(){!p.isActiveRepoFedXType()&&angular.isDefined(f.autocompletepromisestatus)&&f.autocompletepromisestatus.success((function(e){g.autoCompleteStatus=!!e,""!==f.searchInput&&f.onChange()})).error((function(){t.error(h.instant("explore.error.autocomplete"))}))})),f.$watch("empty",(function(){v||(f.searchInput="",f.empty=!1)})),f.$watch("clear",(function(){f.clear&&(f.clearInput(),f.clear=!1)})),o.$on("$translateChangeSuccess",(function(){m.$attr.placeholder?f.placeholder=m.$attr.placeholder:f.placeholder=h.instant("search.resources.msg")+"..."}));const x=function(t){const n=t.type||"uri";"true"===f.openInNewTab?E(!1,t):e.path("resource").search(n,t.uri)},S=function(t){const n=t.type||"uri";"true"===f.openInNewTab?E(!0,t):e.path("graphs-visualizations").search(n,t.uri)},E=function(e,t){const n=e?"graphs-visualizations":"resource";window.open(`${n}?uri=${encodeURIComponent(t.uri)}`)};angular.isUndefined(m.$attr.textCallback)&&(f.textCallback=x),angular.isUndefined(m.$attr.visualCallback)&&(f.visualCallback=S),m.$attr.textButton&&!f.textButton?f.textCallback=f.visualCallback:m.$attr.visualButton&&!f.visualButton&&(f.visualCallback=f.textCallback),m.$attr.placeholder?f.placeholder=m.$attr.placeholder:f.placeholder=h.instant("search.resources.msg")+"...",angular.isDefined(m.$attr.uriValidation)?f.uriValidation=m.$attr.uriValidation:f.uriValidation="true",angular.isDefined(m.$attr.preserveInput)&&(f.preserveInput=m.$attr.preserveInput),f.getResultItemHtml=function(e){return s.trustAsHtml(e.description)},f.searchRdfResource=function(e,t){if("prefix"===e.type)f.searchInput=D(e.value+":"),y.focus(),f.onChange();else{let n;n=angular.isUndefined(e)?f.searchInput:"object"==typeof e?e.value:e;let r="";if(e.description){const t=e.description.indexOf("&lt;"+n+"&gt;");t>0&&(r=e.description.substring(0,t).replace(/<\/?b>/g,""))}t({uri:n,description:e.description,label:r,type:e.type}),v?(f.selectedElementIndex=f.activeSearchElm,u.set(l.RDF_SEARCH_EXPANDED_URI,b),u.set(l.RDF_SEARCH_INPUT,f.searchInput),u.set(l.RDF_RESOURCE_DESCRIPTION,e.description)):"true"===f.preserveInput?(f.searchInput=n,f.autoCompleteUriResults=[]):(f.searchInput="",f.autoCompleteUriResults=[])}},f.searchRdfResourceByEvent=function(e,t){f.searchType===c.visual||t.ctrlKey||t.metaKey?f.searchRdfResource(e,f.visualCallback):f.searchRdfResource(e,f.textCallback)};const A=function(e){const n=f.searchInput;""!==n?"false"!==f.uriValidation?g.autoCompleteStatus&&f.autoCompleteUriResults&&f.autoCompleteUriResults.length>0?"prefix"===f.autoCompleteUriResults[f.activeSearchElm].type?(f.searchInput=D(f.autoCompleteUriResults[f.activeSearchElm].value+":"),f.autoCompleteUriResults=[]):f.searchRdfResource(f.autoCompleteUriResults[f.activeSearchElm],e):C(n)?f.searchRdfResource(n,e):t.error(h.instant("invalid.uri.msg")):f.searchRdfResource(n,e):t.error(h.instant("fill.input.field.msg"))};function F(){let e=-1;const n=u.get(l.RDF_RESOURCE_DESCRIPTION);n&&f.autoCompleteUriResults&&(e=f.autoCompleteUriResults.findIndex(e=>e.description===n),f.selectedElementIndex=e,new Promise(e=>{const t=document.getElementById("auto-complete-results-wrapper").getBoundingClientRect();setTimeout(()=>{e(t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth))})}).then((function(){!function(){const e=$("#auto-complete-results-wrapper"),t=$("#auto_"+f.selectedElementIndex);e.animate({scrollTop:t.offset().top-e.offset().top+e.scrollTop()})}()})).catch((function(e){t.error(getError(e),h.instant("no.prev.search.element"))}))),f.activeSearchElm=-1===e?0:e}function C(e){const t=e.indexOf("<")>=0&&e.indexOf(">")>=0,n=-1===e.indexOf("<")&&-1===e.lastIndexOf(">"),r=/^<?(http|urn).*>?/.test(e)&&(t||n);let i=!1;if(r)if(e.indexOf("http")>=0){const t=e.indexOf("//");i=t>4&&e.substring(t+2).length>0}else e.indexOf("urn")>=0&&(i=e.substring(4).length>0);return r&&i}function D(e){if(!/^<?(http|urn).*>?/.test(e)){const t=e.split(":"),r=t[0],i=t[1];if(!angular.isUndefined(i)){const e=n.getNamespaceUriForPrefix(g.namespaces,r);if(b=e!==b?e:b,b)return y.val(b),b+i}}return e}f.checkIfValidAndSearchText=function(){A(f.textCallback)},f.checkIfValidAndSearchVisual=function(){A(f.visualCallback)},f.checkIfValidAndSearchEvent=function(e){f.searchType===c.visual||e.ctrlKey||e.metaKey?A(f.visualCallback):A(f.textCallback)},f.onChange=function(){return f.showClearInputIcon=f.clearInputIcon,v&&u.set(l.RDF_SEARCH_INPUT,f.searchInput),"false"!==f.uriValidation&&(f.searchInput=D(f.searchInput),g.autoCompleteStatus)?function(e){let t=e.replace(b,b+";");if(g.autoCompleteStatus)return";"===t.charAt(0)&&(t=t.slice(1)),t=function(e){let t=e;if(-1===t.indexOf(";")&&C(t)){t=t.replace(/<|>/g,"");const e=/[^/^#]*$/.exec(t)[0];return t.split(e)[0]+";"+e}return t}(t),w&&w.resolve(),w=a.defer(),i.getAutocompleteSuggestions(t,w.promise).then((function(e){w=null,f.autoCompleteUriResults=e.data.suggestions,f.activeSearchElm=0}));return Promise.resolve()}(f.searchInput):Promise.resolve()},f.onKeyDown=function(e){if(13===e.keyCode){if(e.preventDefault(),d.isActive())return;"false"!==f.uriValidation?g.autoCompleteStatus?f.checkIfValidAndSearchEvent(e):C(e.target.value)?f.searchRdfResourceByEvent(e.target.value,e):t.error(h.instant("invalid.uri.msg")):f.searchRdfResourceByEvent(e.target.value,e)}else if(f.searchInput.length>0&&!g.autoCompleteWarning&&!g.autoCompleteStatus){g.autoCompleteWarning=!0;const e=Object(r.decodeHTML)(h.instant("explore.autocomplete.warning.msg"));t.warning("",`<div class="autocomplete-toast"><a href="autocomplete">${e}</a></div>`,{allowHtml:!0})}if(g.autoCompleteStatus&&!angular.isUndefined(f.autoCompleteUriResults)){if(40===e.keyCode&&f.activeSearchElm<f.autoCompleteUriResults.length-1&&(f.activeSearchElm++,f.searchInput=f.autoCompleteUriResults[f.activeSearchElm].value,function(){const e=$("#auto-complete-results-wrapper"),t=e.children("div"),n=e.children("div.active");void 0!==n[0]&&n[0].offsetTop-t.height()-6-e.scrollTop()>170&&e.scrollTop(n[0].offsetTop-t.height()-6-170)}()),38===e.keyCode&&f.activeSearchElm>0&&(e.preventDefault(),f.activeSearchElm--,f.searchInput=f.autoCompleteUriResults[f.activeSearchElm].value,function(){const e=$("#auto-complete-results-wrapper"),t=e.children("div"),n=e.children("div.active");void 0!==n[0]&&n[0].offsetTop-t.height()-40<=e.scrollTop()&&e.scrollTop(e.scrollTop()-34)}()),27===e.keyCode){if(v)return;f.searchInput="",f.autoCompleteUriResults=[]}f.searchInput||f.clearInput()}},f.$on("rdfResourceSearchExpanded",(function(){(v?(f.preserveInput="true",f.searchInput=u.get(l.RDF_SEARCH_INPUT)||"",b=u.get(l.RDF_SEARCH_EXPANDED_URI),f.onChange()):Promise.resolve()).then((function(){F()}))})),f.setActiveClassOnMouseMove=function(e){g.autoCompleteStatus&&(f.activeSearchElm=e)}}}}function h(e){return{restrict:"AE",link:function(t,n,r){function i(e){27===e.keyCode&&(t.toggleCheatSheet(),t.$apply())}t.getTemplateUrl=function(){return r.templateUrl},t.shortcutsVisible=!1,t.toggleCheatSheet=function(){t.shortcutsVisible=!t.shortcutsVisible,t.shortcutsVisible?e.on("keydown",i):e.off("keydown",i)}},template:'<ng-include src="getTemplateUrl()" />'}}function d(e,t,n,i,o,a){return{restrict:"E",transclude:!0,scope:{loadSaved:"&",setPluginActive:"&",pluginName:"@",humanReadablePluginName:"@"},templateUrl:"js/angular/core/templates/inactive-plugin-warning-page.html",link:function(s){function u(){if(o.isLicenseValid()&&i.getActiveRepository()&&!i.isActiveRepoOntopType()&&!i.isActiveRepoFedXType())return t.checkPluginIsActive(s.pluginName).then((function({data:e}){s.pluginIsActive=e.indexOf("true")>0,s.setPluginActive({isPluginActive:s.pluginIsActive})})).catch((function(t){e.error(getError(t),a.instant("check.active.plugin.failure"))}))}s.pluginIsActive=!0,s.activatePlugin=function(){const i=Object(r.decodeHTML)(a.instant("activate.plugin.warning.msg",{humanReadablePluginName:s.humanReadablePluginName}));n.openSimpleModal({title:a.instant("activate.plugin.confirmation"),message:`<p>${i}</p>`,warning:!0}).result.then((function(){t.activatePlugin(s.pluginName).then((function(){s.pluginIsActive=!0,s.setPluginActive({isPluginActive:s.pluginIsActive}),s.loadSaved()})).catch((function(t){e.error(getError(t),a.instant("activate.plugin.failure"))}))}))};const l=s.$on("repositoryIsSet",(function(){u()}));window.addEventListener("beforeunload",(function e(){l(),window.removeEventListener("beforeunload",e)})),s.$on("checkIsActive",u),u()}}}p.$inject=["$location","toastr","ClassInstanceDetailsService","AutocompleteRestService","$rootScope","$q","$sce","LocalStorageAdapter","LSKeys","$repositories","$translate","GuidesService"],h.$inject=["$document"],d.$inject=["toastr","RDF4JRepositoriesRestService","ModalService","$repositories","$licenseService","$translate"]},function(e,t,n){"use strict";n.r(t);n(7),n(37),n(38);var r=n(5);angular.module("graphdb.framework.core.services.jwtauth",["toastr","graphdb.framework.rest.security.service","graphdb.framework.core.services.openIDService"]).service("$jwtAuth",["$http","toastr","$location","$rootScope","SecurityRestService","$openIDAuth","$translate","$q","AuthTokenService","LSKeys","LocalStorageAdapter",function(e,t,n,i,o,a,s,u,l,c,p){const h=this;i.deniedPermissions={},i.setPermissionDenied=function(e){return!("/login"===e||!h.isAuthenticated())&&(i.deniedPermissions[e]=!0,!0)},i.hasPermission=function(){const e=n.path();return!i.deniedPermissions[e]},this.updateReturnUrl=()=>{0!==n.url().indexOf("/login")&&(i.returnToUrl=n.url())},i.redirectToLogin=function(e,t){return h.authTokenIsType("Bearer")&&(e=!0),h.clearAuthenticationInternal(),h.updateReturnUrl(),n.path("/login"),t?n.search("noaccess"):e&&n.search("expired"),new Promise(e=>{setTimeout(()=>{e(!0)},100)})},i.hasExternalAuthUser=function(){return h.hasExternalAuthUser()},this.securityEnabled=!0,this.freeAccess=!1,this.hasOverrideAuth=!1,this.externalAuthUser=!1,this.securityInitialized=!1;const d=this;this.getAuthenticatedUserFromBackend=function(e,t){o.getAuthenticatedUser().success((function(e,t,n){const r=l.getAuthToken();r&&r.startsWith("GDB")?(d.externalAuthUser=!1,d.principal=e,i.$broadcast("securityInit",d.securityEnabled,!0,d.freeAccess)):d.openIDEnabled&&r&&r.startsWith("Bearer")?d.authenticate(e,r):(d.externalAuthUser=!0,d.authenticate(e,""))})).error((function(){e||!d.freeAccess?i.redirectToLogin(!1,t):(d.securityInitialized=!0,d.hasExplicitAuthentication()||d.clearAuthentication())}))},this.initSecurity=function(){this.securityInitialized=!1,o.getSecurityConfig().then((function(e){if(d.securityEnabled=e.data.enabled,d.externalAuth=e.data.hasExternalAuth,d.authImplementation=e.data.authImplementation,d.openIDEnabled=e.data.openIdEnabled,d.passwordLoginEnabled=e.data.passwordLoginEnabled,d.securityEnabled){const t=e.data.freeAccess;d.freeAccess=t.enabled,d.freeAccess&&(d.freeAccessPrincipal={authorities:t.authorities,appSettings:t.appSettings}),d.openIDEnabled?(d.openIDConfig=e.data.methodSettings.openid,d.gdbUrl=n.absUrl().replace(n.url().substr(1),""),a.initOpenId(d.openIDConfig,d.gdbUrl,(function(e){l.setAuthToken(a.authHeaderGraphDB()),console.log("oidc: set id/access token as GraphDB auth"),d.getAuthenticatedUserFromBackend(!0,e)}),(function(){console.log("oidc: not logged or login error"),d.authTokenIsType("Bearer")?setTimeout(()=>{i.redirectToLogin(!0)},0):d.getAuthenticatedUserFromBackend()}))):d.getAuthenticatedUserFromBackend()}else{l.clearAuthToken();const t=e.data.overrideAuth;if(d.hasOverrideAuth=t.enabled,!d.hasOverrideAuth)return o.getAdminUser().then((function(e){d.principal={username:"admin",appSettings:e.data.appSettings,authorities:e.data.grantedAuthorities},i.$broadcast("securityInit",d.securityEnabled,!0,d.hasOverrideAuth)}));d.principal={username:"overrideauth",authorities:t.authorities,appSettings:t.appSettings},i.$broadcast("securityInit",d.securityEnabled,!0,d.hasOverrideAuth)}}))},this.initSecurity(),this.reinitializeSecurity=function(){this.securityInitialized||this.initSecurity()},this.isSecurityEnabled=function(){return this.securityEnabled},this.hasExternalAuth=function(){return this.externalAuth},this.getAuthImplementation=function(){return this.authImplementation},this.isFreeAccessEnabled=function(){return this.freeAccess},this.isDefaultAuthEnabled=function(){return this.hasOverrideAuth&&this.principal&&"overrideauth"===this.principal.username},this.authTokenIsType=function(e){const t=l.getAuthToken();return t&&t.startsWith(e)},this.loginOpenID=function(){a.login(this.openIDConfig,this.gdbUrl)},this.toggleSecurity=function(e){e!==this.securityEnabled&&o.toggleSecurity(e).then((function(){t.success(s.instant("jwt.auth.security.status",{status:s.instant(e?"enabled.status":"disabled.status")})),l.clearAuthToken(),d.initSecurity(),d.securityEnabled=e}),(function(e){t.error(e.data,s.instant("common.error"))}))},this.toggleFreeAccess=function(e,n,r,a){(e!==this.freeAccess||a)&&(this.freeAccess=e,this.freeAccessPrincipal=e?{authorities:n,appSettings:r}:void 0,o.setFreeAccess({enabled:e?"true":"false",authorities:n,appSettings:r}).then((function(){a?t.success(s.instant("jwt.auth.free.access.updated.msg")):t.success(s.instant("jwt.auth.free.access.status",{status:s.instant(e?"enabled.status":"disabled.status")}))}),(function(e){t.error(e.data.error.message,s.instant("common.error"))})),i.$broadcast("securityInit",this.securityEnabled,this.hasExplicitAuthentication(),this.freeAccess))},this.authenticate=function(e,t){return new Promise(n=>{t?(l.setAuthToken(t),this.externalAuthUser=!1):l.clearAuthToken(),this.principal=e,i.deniedPermissions={},this.securityInitialized=!0;const r={id:p.get(c.REPOSITORY_ID)||"",location:p.get(c.REPOSITORY_LOCATION)||""};h.canReadRepo(r)||(p.remove(c.REPOSITORY_ID),p.remove(c.REPOSITORY_LOCATION),i.deniedPermissions={}),i.$broadcast("securityInit",this.securityEnabled,d.hasExplicitAuthentication(),this.freeAccess),setTimeout(()=>{n(!0)})})},this.authenticateOpenID=function(e){l.clearAuthToken(),e&&(l.setAuthToken(e),this.externalAuthUser=!1)},this.hasExternalAuthUser=function(){return this.externalAuthUser},this.hasExplicitAuthentication=function(){return null!=l.getAuthToken()||this.externalAuthUser},this.getPrincipal=function(){if(this.principal)return Promise.resolve(this.principal);const e=u.defer();return i.$on("securityInit",()=>{e.resolve(this.principal)}),e.promise},this.clearAuthenticationInternal=function(){a.softLogout(),this.principal=this.freeAccessPrincipal,l.clearAuthToken()},this.clearAuthentication=function(){this.clearAuthenticationInternal(),i.$broadcast("securityInit",this.securityEnabled,!1,this.freeAccess)},this.isAuthenticated=function(){return!this.securityEnabled||this.hasExplicitAuthentication()},this.hasPermission=function(){},this.hasRole=function(e){if(void 0!==e&&(this.securityEnabled||this.hasOverrideAuth)){"string"==typeof e&&(e=[e]);const t=!_.isEmpty(this.principal);return!!t&&("IS_AUTHENTICATED_FULLY"===e[0]?t:_.intersection(e,this.principal.authorities).length>0)}return!0},this.isAdmin=function(){return this.hasRole(r.UserRole.ROLE_ADMIN)},this.isRepoManager=function(){return this.hasRole(r.UserRole.ROLE_REPO_MANAGER)},this.hasRoleMonitor=function(){return this.hasRole(r.UserRole.ROLE_MONITORING)},this.checkForWrite=function(e,t){return"WRITE_REPO"===e?this.canWriteRepo(t):this.hasRole(e)},this.hasAdminRole=function(){return this.isAdmin()||this.isRepoManager()},this.canWriteRepo=function(e){return!!e&&(!this.securityEnabled&&!this.hasOverrideAuth||!_.isEmpty(this.principal)&&(!!this.hasAdminRole()||this.checkRights(e,"WRITE")))},this.canReadRepo=function(e){return!!e&&(!this.securityEnabled||!_.isEmpty(this.principal)&&(!!this.hasAdminRole()||this.checkRights(e,"READ")))},this.checkRights=function(e,t){if(e)for(let n=0;n<this.principal.authorities.length;n++){const r=this.principal.authorities[n],i=r.split("_",2),o=r.slice(i[0].length+i[1].length+2),a=e.location?`${e.id}@${e.location}`:e.id;if(i[0]===t&&(a===o||"SYSTEM"!==e.id&&"*"===o))return!0}return!1}}])},function(e,t){let n;angular.module("graphdb.framework.utils.uriutils",[]).factory("UriUtils",r);try{n=new RegExp("^<?[a-z](?:[-a-z0-9\\+\\.])*:(?:\\/\\/(?:(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=:])*@)?(?:\\[(?:(?:(?:[0-9a-f]{1,4}:){6}(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(?:\\.(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3})|::(?:[0-9a-f]{1,4}:){5}(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(?:\\.(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3})|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(?:\\.(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3})|(?:[0-9a-f]{1,4}:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(?:\\.(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3})|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(?:\\.(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3})|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(?:\\.(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3})|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(?:\\.(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3})|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|v[0-9a-f]+[-a-z0-9\\._~!\\$&'\\(\\)\\*\\+,;=:]+)\\]|(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(?:\\.(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3}|(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=@])*)(?::[0-9]*)?(?:\\/(?:(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=:@]))*)*|\\/(?:(?:(?:(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=:@]))+)(?:\\/(?:(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=:@]))*)*)?|(?:(?:(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=:@]))+)(?:\\/(?:(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=:@]))*)*|(?!(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=:@])))(?:\\?(?:(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=:@])|[\\u{E000}-\\u{F8FF}\\u{F0000}-\\u{FFFFD}\\u{100000}-\\u{10FFFD}\\/\\?])*)?(?:#(?:(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=:@])|[\\/\\?])*)?>?$","ui")}catch(e){n=new RegExp("^<?[a-z](?:[-a-z0-9\\+\\.])*:>?","i")}function r(e){function t(e){const t=e.indexOf("<")>=0&&e.indexOf(">")>=0,n=-1===e.indexOf("<")&&-1===e.lastIndexOf(">"),r=/^<?(http|urn).*>?/.test(e)&&(t||n);let i=!1;if(r)if(e.indexOf("http")>=0){const t=e.indexOf("//");i=t>4&&e.substring(t+2).length>0}else e.indexOf("urn")>=0&&(i=e.substring(4).length>0);return r&&i}return{isValidIri:function(e,r){if(void 0!==e&&void 0!==r&&(t(r)||r.match(n)))return!0},validateRdfUri:t,shortenIri:function(e){const t=document.createElement("a");t.href=e;let n=t.hostname;return function(e){const t=e.split(".");for(let e=0,n=0;e<t.length;e++)if(parseInt(t[e],10)>=0&&parseInt(t[e],10)<=255?n++:n=0,4===n)return!0;return!1}(t.hostname)||(n=t.hostname.split(".")[0]),n+":"+t.port},expandPrefix:function(t,n){const r=/^<.*>$/.test(t);if(t=function(e,t){if(t.test(e))return e.substring(1,e.length-1);return e}(t,/^<.*>$/),!/^<?(http|urn).*>?/.test(t)){const i=t.split(":"),o=i[0],a=i[1];if(!angular.isUndefined(a)){const t=e.getNamespaceUriForPrefix(n,o);if(t)return t+a;if(!r)return""}}return t}}}r.$inject=["ClassInstanceDetailsService"]},function(e,t,n){"use strict";n.r(t);var r=n(15),i=n(18);angular.module("graphdb.framework.rest.monitoring.service",[]).factory("MonitoringRestService",o),o.$inject=["$http"];function o(e){return{monitorResources:function(){return e.get("rest/monitor/infrastructure")},monitorStructures:function(){return e.get("rest/monitor/structures")},monitorCluster:function(){return e.get("rest/monitor/cluster")},monitorGC:function(){return e.post("rest/monitor/infrastructure/gc")},monitorQuery:function(t){return e.get(`rest/monitor/repository/${t}/query/active`)},monitorBackup:function(){return e.get("rest/monitor/backup").then(e=>Object(r.mapBackupAndRestoreResponseToModel)(e.data))},monitorActiveOperations:function(t){return e.get(`rest/monitor/${t}/operations`).then(e=>Object(i.mapActiveOperationResponseToModel)(e.data))},deleteQuery:function(t,n){return e.delete(`rest/monitor/repository/${n}/query?query=${encodeURIComponent(t)}`)},getQueryCount:function(t){return e({url:`rest/monitor/repository/${t}/query/count`,method:"GET",timeout:1e4})},checkAutocompleteStatus:function(){return e.get("rest/autocomplete/enabled")},monitorQueryTransactionStatistics:function(t){return e.get("rest/monitor/repository/"+t)}}}},function(e,t){angular.module("graphdb.framework.rest.sparql.service",[]).factory("SparqlRestService",n),n.$inject=["$http"];function n(e){return{getSavedQueries:function(){return e.get("rest/sparql/saved-queries")},getSavedQuery:function(t,n){let r="";null!=n&&(r="&owner="+encodeURIComponent(n));return e.get(`rest/sparql/saved-queries?name=${encodeURIComponent(t)}${r}`)},addKnownPrefixes:function(t){return e.post("rest/sparql/add-known-prefixes",t)},editSavedQuery:function(t){return e.put("rest/sparql/saved-queries",t)},deleteSavedQuery:function(t){return e.delete("rest/sparql/saved-queries?name="+encodeURIComponent(t))},addNewSavedQuery:function(t){return e.post("rest/sparql/saved-queries",t)}}}},function(e,t){angular.module("graphdb.framework.rest.rdf4j.repositories.service",[]).factory("RDF4JRepositoriesRestService",r),r.$inject=["$http","$repositories","$translate"];const n="select ?o where {\n?s <http://www.ontotext.com/owlim/system#listplugins> ?o .\nfilter(str(?s) = '{{pluginName}}')\n} ";function r(e,t,r){return{getNamespaces:function(t){return e.get(`repositories/${t}/namespaces`)},getRepositoryNamespaces:function(){return e.get(`repositories/${t.getActiveRepository()}/namespaces`)},updateNamespacePrefix:function(t,n,r){return e({url:`repositories/${t}/namespaces/${r}`,method:"PUT",data:n})},deleteNamespacePrefix:function(t,n){return e({url:`repositories/${t}/namespaces/${n}`,method:"DELETE"})},addStatements:function(t,n){return e({url:`repositories/${t}/statements`,method:"POST",data:n,headers:{"Content-Type":"application/x-www-form-urlencoded"}})},activatePlugin:function(n){return e({method:"POST",url:`repositories/${t.getActiveRepository()}/statements`,params:{update:"INSERT DATA { <u:a> <http://www.ontotext.com/owlim/system#startplugin> '{{pluginName}}' .}".replace("{{pluginName}}",n)}})},checkPluginIsActive:function(r){return e({method:"GET",url:"repositories/"+t.getActiveRepository(),params:{query:n.replace("{{pluginName}}",r)},headers:{Accept:"*/*"}})},getRepositorySize:function(){return e.get(`repositories/${t.getActiveRepository()}/size`)},getGraphs:i,resolveGraphs:function(){const e=t.getActiveRepository();let n=[];if(e)return i(e).success((function(e){e.results.bindings.unshift({contextID:{type:"default",value:"import.default.graph"}}),Object.keys(e.results.bindings).forEach((function(t){const n=e.results.bindings[t];"bnode"===n.contextID.type?n.contextID.value="_:"+n.contextID.value:"default"===n.contextID.type?n.contextID.uri="http://www.openrdf.org/schema/sesame#nil":n.contextID.uri=n.contextID.value})),e.results.bindings.unshift(allGraphs),n=e.results.bindings}));return n},downloadResultsAsFile:function(t,n,r){const i=Object.entries(n).filter(([e,t])=>void 0!==t).map(([e,t])=>`${e}=${t}`).join("&");return e({method:"POST",url:"repositories/"+t,headers:{"Content-Type":"application/x-www-form-urlencoded;charset=utf-8",Accept:r},data:i,responseType:"blob"}).then((function(e){const t=e.data;let n=e.headers()["content-disposition"].split("filename=")[1];return n=n.substring(0,n.length),{data:t,filename:n}}))}};function i(t){return e.get(`repositories/${t}/contexts`)}}},function(e,t){function n(e,t,n,r){e.title=n,e.message=r,e.ok=function(){t.close()},e.cancel=function(){t.dismiss("cancel")}}function r(e,t,n,r,i,o){t.opened.then((function(){o(()=>{$("#clipboardURI")[0].select()},0)})),e.clipboardURI=n,e.ok=function(){try{document.getElementById("clipboardURI").select(),document.execCommand("copy"),r.success(i.instant("modal.ctr.copy.url.success"))}catch(e){r.error(i.instant("modal.ctr.copy.not.supported.warning"))}t.close()},e.cancel=function(){t.dismiss("cancel")}}function i(e,t,n,r,i){e.query=n,e.cancel=function(){t.dismiss("cancel")},e.selectQuery=function(){e.selectElement($("#create-query"))},e.copyQueryToClipboard=function(){try{e.selectQuery(),document.execCommand("copy"),t.close(),r.success(i.instant("modal.ctr.copy.query.success"))}catch(e){r.error(i.instant("modal.ctr.copy.not.supported.warning"))}},e.selectElement=function(e){if(e.length>0)if(window.getSelection){const t=window.getSelection();t.removeAllRanges();const n=document.createRange();n.selectNodeContents(e[0].firstChild),t.addRange(n)}else if(document.selection){const t=document.body.createTextRange();t.moveToElementText(e[0]),t.select()}}}angular.module("graphdb.framework.core.controllers",[]).controller("CopyToClipboardModalCtrl",r).controller("SimpleModalCtrl",n).controller("ViewQueryCtrl",i),n.$inject=["$scope","$uibModalInstance","title","message"],r.$inject=["$scope","$uibModalInstance","uri","toastr","$translate","$timeout"],i.$inject=["$scope","$uibModalInstance","query","toastr","$translate"]},function(e,t){angular.module("graphdb.framework.rest.plugins.service",[]).factory("PluginsRestService",n);function n(e){return{togglePlugin:function(t,n,r){return n?e.post(`repositories/${t}/statements`,void 0,{params:{update:`INSERT DATA { <u:a> <http://www.ontotext.com/owlim/system#stopplugin> "${r}".}`}}):e.post(`repositories/${t}/statements`,void 0,{params:{update:`INSERT DATA { <u:a> <http://www.ontotext.com/owlim/system#startplugin> "${r}".}`}})},getPlugins:function(t){return e.get("repositories/"+t,{params:{query:"select ?s ?o where { ?s <http://www.ontotext.com/owlim/system#listplugins> ?o .}"}})}}}n.$inject=["$http"]},function(e,t){angular.module("graphdb.framework.rest.locations.service",[]).factory("LocationsRestService",n),n.$inject=["$http"];function n(e){return{getLocations:function(t,n){return e.get("rest/locations",{params:{filterClusterLocations:n}},{timeout:t?t.promise:null})},addLocation:function(t){return e.post("rest/locations",t)},editLocation:function(t){return e.put("rest/locations",t)},deleteLocation:function(t){return e.delete("rest/locations?uri="+t)},getActiveLocation:function(){return e({method:"GET",url:"rest/locations/active",noCancelOnRouteChange:!0})},setDefaultRepository:function(t){return e({url:"rest/locations/active/default-repository",method:"POST",data:{defaultRepository:t}})},getLocationRpcAddress:function(t){return e.get("rest/info/rpc-address",{params:{location:t}})}}}},function(e,t){angular.module("graphdb.framework.rest.autocomplete.service",[]).factory("AutocompleteRestService",n);function n(e){return{checkAutocompleteStatus:function(){return e.get("rest/autocomplete/enabled")},refreshIndexStatus:function(){return e.get("rest/autocomplete/status")},refreshLabelConfig:function(){return e.get("rest/autocomplete/labels")},addLabelConfig:function(t){return e.put("rest/autocomplete/labels",t)},removeLabelConfig:function(t){return e.delete("rest/autocomplete/labels",{data:t,headers:{"Content-Type":"application/json;charset=utf-8"}})},toggleAutocomplete:function(t){return e.post("rest/autocomplete/enabled?enabled="+t)},refreshIndexIRIs:function(){return e.get("rest/autocomplete/iris")},toggleIndexIRIs:function(t){return e.post("rest/autocomplete/iris?enabled="+t)},buildIndex:function(){return e.post("rest/autocomplete/reindex")},interruptIndexing:function(){return e.post("rest/autocomplete/interrupt")},checkForPlugin:function(){return e.get("rest/autocomplete/plugin-found")},getAutocompleteSuggestions:function(t,n){return e.get("rest/autocomplete/query",{params:{q:t},timeout:n})}}}n.$inject=["$http"]},function(e,t,n){"use strict";n.r(t);n(10),n(12);var r=n(2);function i(e,t,n,i,o,a,s,u,l,c){this.guideResumeSubscription=void 0,this.languageChangeSubscription=void 0,this.guideCancelSubscription=void 0,this.init=()=>{this._subscribeToGuideResumed(),this._subscribeToGuideCancel(),this._subscribeToGuidePause()},this.startGuide=(e,s)=>{if(e&&e.options&&e.options.repositoryIdBase){const t=a.getRepositories();e.options.repositoryId=e.options.repositoryIdBase;for(let n=2;t.find(t=>t.id===e.options.repositoryId);n++)e.options.repositoryId=e.options.repositoryIdBase+n;e.options.translatedGuideName=r.GuideUtils.translateLocalMessage(n,i,e.guideName,{}),e.options.translatedGuideDescription=r.GuideUtils.translateLocalMessage(n,i,e.guideDescription,{})}const u=this._toStepsDescriptions(e);for(let e=0;e<u.length;e++)u[e].id=e;angular.isDefined(s)?o.resumeGuide(e.guideId,u,s):o.startGuide(e.guideId,u,s),t.$broadcast("guideStarted")},this.getGuides=()=>new Promise(t=>{e.get(r.GuideUtils.GUIDES_LIST_URL).success((function(e){angular.forEach(e,(e,t)=>{void 0===e.guideId&&(e.guideId=t)}),t(e)}))}),this.isActive=()=>o.isActive(),this._toStepsDescriptions=e=>{if(!e)return[];let t=[];return e.steps.forEach(n=>{t=t.concat(this._getSteps(n,e.options))}),t},this._getSteps=(e,p)=>{const h={$translate:n,$interpolate:i,GuideUtils:r.GuideUtils,$rootScope:t,toastr:s,$location:u,$route:l,$timeout:c,ShepherdService:o,$repositories:a};let d=[];if(angular.isArray(e))e.forEach(t=>{d=d.concat(this._getSteps(t,angular.extend({},e.options,p)))});else{const t=PluginRegistry.get("guide.step").find(t=>t.guideBlockName===e.guideBlockName);if(t){const n=angular.extend({},t.options,e.options,p);t.getSteps?d=d.concat(this._getSteps(_.cloneDeep(t.getSteps(n,h)),p)):t.getStep?d.push(_.cloneDeep(t.getStep(n,h))):d=d.concat(this._getSteps(_.cloneDeep(t,t.options),p))}}return d.forEach((e,t)=>{e.stepN=t,e.stepsTotalN=d.length,!e.title&&e.mainAction&&(e.title="guide.step-action."+e.mainAction)}),d},this._subscribeToGuideResumed=()=>{this.guideResumeSubscription||(this.guideResumeSubscription=t.$on("guideResume",()=>{const e=o.getGuideId();this.getGuides().then(t=>{const n=t.find(t=>t.guideId===e),r=o.getCurrentStepId();this.startGuide(n,r)})}))},this._subscribeToGuideCancel=()=>{o.subscribeToGuideCancel(()=>t.$broadcast("guideReset"))},this._subscribeToGuidePause=()=>{o.subscribeToGuidePause(()=>t.$broadcast("guidePaused"))}}angular.module("graphdb.framework.guides.services",["graphdb.framework.guides.shepherd.services"]).service("GuidesService",i),i.$inject=["$http","$rootScope","$translate","$interpolate","ShepherdService","$repositories","toastr","$location","$route","$timeout"]},function(e,t,n){"use strict";n.r(t);n(7);angular.module("graphdb.framework.core.interceptors.unauthorized",["ngCookies"]).factory("$unauthorizedInterceptor",["$q","$location","$rootScope","$translate",function(e,t,n,r){return{responseError:function(i){let o=!1;return 401===i.status?i.config.url.indexOf("rest/security/authenticated-user")<0&&!n.hasExternalAuthUser()&&(o=!0):403===i.status&&(n.setPermissionDenied(t.path())?console.log(r.instant("unauthorized.console.warning")):o=!0),o?Promise.resolve(n.redirectToLogin()).then(()=>e.reject(i)):e.reject(i)}}}])},function(e,t,n){"use strict";n.r(t);n(7);angular.module("graphdb.framework.core.interceptors.authentication",["ngCookies"]).factory("$authenticationInterceptor",["AuthTokenService","LocalStorageAdapter","LSKeys",function(e,t,n){return{request:function(r){const i=r.headers||{};if([e.OPENID_CONFIG.openIdKeysUri,e.OPENID_CONFIG.openIdTokenUrl].some(e=>r.url.indexOf(e)>-1))return r;i["X-Requested-With"]="XMLHttpRequest",i.Authorization=e.getAuthToken();const o=t.get(n.REPOSITORY_ID),a=t.get(n.REPOSITORY_LOCATION);return i["X-GraphDB-Repository"]=o||void 0,i["X-GraphDB-Repository-Location"]=a||void 0,r.headers=i,r}}}])},,function(e,t,n){"use strict";n.r(t);var r=n(6);const i={headers:{"X-GraphDB-Repository-Location":void 0,"X-GraphDB-Repository":void 0,"X-Requested-With":void 0,Authorization:void 0}};angular.module("graphdb.framework.core.services.openIDService",["toastr"]).service("$openIDAuth",["$http","$location","$window","toastr","$translate","AuthTokenService",function(e,t,n,o,a,s){const u="com.ontotext.graphdb.openid.",l=this;function c(e){const t=[];for(let n in e)e.hasOwnProperty(n)&&t.push(`${n}=${encodeURIComponent(e[n])}`);return t.join("&")}this.login=function(e,t){const r=l.generateRandomString(),i=e.authFlow;if("code"===i){l.setStorageItem("pkce_state",r);const i=l.generateRandomString();l.setStorageItem("pkce_code_verifier",i);const o=l.pkceChallengeFromVerifier(i);n.location.href=l.getLoginUrl(r,o,t,e)}else"code_no_pkce"===i?(l.removeStorageItem("pkce_code_verifier"),n.location.href=l.getLoginUrl(r,"",t,e)):"implicit"===i?(l.setStorageItem("nonce",r),n.location.href=l.getLoginUrl(r,"",t,e)):(console.log("oidc: unknown auth flow: "+i),o.error(a.instant("openid.auth.unknown.flow",{authFlow:i})))},this.getLoginUrl=function(e,t,n,r){const i=[];let o="";switch(r.authFlow){case"code":o="code",i.push("state="+encodeURIComponent(e)),i.push("code_challenge="+encodeURIComponent(t)),i.push("code_challenge_method=S256");break;case"code_no_pkce":o="code";break;case"implicit":o="token id_token",i.push("nonce="+encodeURIComponent(e));break;default:throw new Error(a.instant("openid.auth.unknown.flow",{authFlow:r.authFlow}))}return i.unshift("response_type="+encodeURIComponent(o),"scope="+encodeURIComponent(l.getScope(r.extraScopes)),"client_id="+encodeURIComponent(r.clientId),"redirect_uri="+encodeURIComponent(n)),r.oracleDomain&&i.push("domain="+encodeURIComponent(r.oracleDomain)),r.authorizeParameters&&i.push(r.authorizeParameters),`${r.oidcAuthorizationEndpoint}?${i.join("&")}`},this.withOpenIdKeys=function(t,n){e.get(t,i).success((function(e){s.OPENID_CONFIG.openIdKeys={},e.keys.forEach((function(e){s.OPENID_CONFIG.openIdKeys[e.kid]=e})),n()}))},this.initOpenId=function(e,t,r,u){l.clientId=e.clientId,l.tokenType=e.tokenType,l.idTokenAudience=e.clientId,l.idTokenIssuer=e.issuer,l.accessTokenAudience=e.tokenAudience,l.accessTokenIssuer=e.tokenIssuer,s.OPENID_CONFIG.openIdTokenUrl=e.oidcTokenEndpoint,s.OPENID_CONFIG.openIdKeysUri=e.oidcJwksUri,e.proxyOidc&&(s.OPENID_CONFIG.openIdKeysUri="rest/openid/jwks",s.OPENID_CONFIG.openIdTokenUrl="rest/openid/token"),s.OPENID_CONFIG.openIdEndSessionUrl=e.oidcEndSessionEndpoint,s.OPENID_CONFIG.supportsOfflineAccess=e.oidcScopesSupported.includes("offline_access"),e.oracleDomain&&(i.headers["X-OAuth-Identity-Domain-Name"]=e.oracleDomain),l.withOpenIdKeys(s.OPENID_CONFIG.openIdKeysUri,(function(){if(l.isLoggedIn=l.hasValidIdToken(),l.isLoggedIn)l.setupTokensRefresh(!1,r,u);else if(l.hasValidRefreshToken())l.refreshTokens(r,u);else{const i=r;r=function(){l.isLoggedIn=!0,i(!0)},l.softLogout();const s=l.parseQueryString(n.location.search.substring(1));if(s.code)"code"===e.authFlow?l.getStorageItem("pkce_state")!==s.state?(o.error(a.instant("openid.auth.invalid.pkce.state")),console.log("oidc: PKCE state mismatch "+l.getStorageItem("pkce_state")+" != "+s.state),u()):l.retrieveTokensByCode(s.code,t,r,u):"code_no_pkce"===e.authFlow&&l.retrieveTokensByCode(s.code,t,r,u);else{const e=l.parseQueryString(n.location.pathname.substring(1));e.id_token?l.saveTokens(e,!0,!1,r):u()}}}))},this.authHeaderGraphDB=function(){return"id"===l.getStorageItem("token_type")?"Bearer "+l.getToken("id"):"Bearer "+l.getToken("access")},this.softLogout=function(){l.isLoggedIn=!1,l.setToken("id",null),l.setToken("access",null),l.setToken("refresh",null)},this.hardLogout=function(e){l.softLogout(),s.OPENID_CONFIG.openIdEndSessionUrl&&(n.location.href=`${s.OPENID_CONFIG.openIdEndSessionUrl}?client_id=${encodeURIComponent(l.clientId)}&post_logout_redirect_uri=${encodeURIComponent(e)}`)},this.getToken=function(e){return l.getStorageItem(e+"_token")},this.setToken=function(e,t){t?l.setStorageItem(e+"_token",t):l.removeStorageItem(e+"_token")},this.tokenHeader=function(e){const t=l.getToken(e);if(t){try{const e=r.KJUR.jws.JWS.readSafeJSONString(Object(r.b64utoutf8)(t.split(".")[0]));if(e)return e}catch(e){}return{error:a.instant("openid.auth.not.jwt.token",{token:t})}}return{}},this.verifyToken=function(e){const t=l.getToken(e),n=l.tokenHeader(e);if(!n.kid)return"id"!==e?n.error?(console.log(`oidc: token ${e} is not a JWT token (token considered valid)`),!0):(console.log(`oidc: invalid token ${e} (token is empty)`),!1):(console.log("oidc: invalid token id (not a JWT token)"),!1);const i=s.OPENID_CONFIG.openIdKeys[n.kid];if(!i)return console.log("oidc: no key to verify JWT token (token considered invalid)"),!1;const o=r.KEYUTIL.getKey(i),a={alg:[n.alg],iss:[l.idTokenIssuer]};return"id"===e?(a.aud=[l.idTokenAudience,l.idTokenIssuer],a.nonce=[l.getStorageItem("nonce")]):"access"===e&&(a.aud=[l.accessTokenAudience],a.iss=[l.accessTokenIssuer]),r.KJUR.jws.JWS.verifyJWT(t,o,a)},this.hasValidIdToken=function(){return l.getToken("id")?l.verifyToken("id")?(console.log("oidc: valid id token found"),!0):(console.log("oidc: stale id token"),!1):(console.log("oidc: no id token"),!1)},this.tokenPayload=function(e){const t=l.getToken(e);if(t){try{const e=r.KJUR.jws.JWS.readSafeJSONString(Object(r.b64utoutf8)(t.split(".")[1]));if(e)return e}catch(e){}return{error:a.instant("openid.auth.not.jwt.token",{token:t})}}return{}},this.saveTokens=function(e,n,r,i){(n||e.refresh_token)&&l.setToken("refresh",e.refresh_token),l.setToken("access",e.access_token),l.setToken("id",e.id_token),l.setStorageItem("token_type",l.tokenType),console.log("oidc: saved tokens"),l.setupTokensRefresh(n||r,i),l.removeStorageItem("pkce_state"),l.removeStorageItem("pkce_code_verifier"),n&&t.url("/")},this.retrieveTokensByCode=function(t,n,r,u){const p={grant_type:"authorization_code",client_id:l.clientId,redirect_uri:n,code:t},h=l.getStorageItem("pkce_code_verifier");h&&(p.code_verifier=h);const d={...i.headers,"Content-type":"application/x-www-form-urlencoded; charset=utf-8"};e({method:"POST",url:s.OPENID_CONFIG.openIdTokenUrl,headers:d,transformRequest:c,data:p}).success((function(e){l.saveTokens(e,!0,!1,r)})).error((function(e){o.error(a.instant("openid.auth.cannot.retrieve.token.msg",{error:getError(e)})),u()}))},this.refreshTokens=function(t,n){if(l.hasValidRefreshToken()){const r={grant_type:"refresh_token",client_id:l.clientId,refresh_token:l.getToken("refresh")},u={...i.headers,"Content-type":"application/x-www-form-urlencoded; charset=utf-8"};e({method:"POST",url:s.OPENID_CONFIG.openIdTokenUrl,headers:u,transformRequest:c,data:r}).success((function(e){console.log("oidc: refreshed tokens"),l.saveTokens(e,!1,!0,t),l.isLoggedIn=!0})).error((function(e){console.log("oidc: could not refresh tokens"),o.error(a.instant("openid.auth.cannot.refresh.token.msg",{error:getError(e)})),n&&n()}))}else console.log("oidc: refresh requested without a valid refresh token")},this.hasValidRefreshToken=function(){const e=l.tokenPayload("refresh");return!(e.nbf&&1e3*e.nbf-Date.now()>5e3)&&(!(e.exp&&Date.now()-1e3*e.exp>5e3)&&!(!e.iat&&!e.error))},this.setupTokensRefresh=function(e,t,n){if(l.hasValidRefreshToken()){clearTimeout(l.previousTimer);const r=l.tokenPayload("id");if(r.exp>0){const i=1e3*r.exp-Date.now()-6e4;if(!(e||i>1e3))return l.previousTimer=null,console.log("oidc: tokens will refresh now, "+i+"; "+e),void l.refreshTokens(t,n);l.previousTimer=setTimeout((function(){l.refreshTokens(t)}),i),console.log("oidc: tokens will refresh in "+i/1e3+" seconds at "+new Date(Date.now()+i))}}else console.log("oidc: no valid refresh token");t()},this.parseQueryString=function(e){const t={access_token:null,code:null,id_token:null,state:null};if(""===e)return t;return e.split("&").map((function(e){return e.split("=")})).forEach((function(e){t[e[0]]=decodeURIComponent(e[1])})),t},this.generateRandomString=function(){const e=new Uint32Array(28);return window.crypto.getRandomValues(e),Array.from(e,(function(e){return("0"+e.toString(16)).substr(-2)})).join("")},this.pkceChallengeFromVerifier=function(e){const t=new r.KJUR.crypto.MessageDigest({alg:"sha256",prov:"cryptojs"});return Object(r.hextob64u)(t.digestString(e))},this.getScope=function(e){let t="openid"+(s.OPENID_CONFIG.supportsOfflineAccess?" offline_access":"");return e&&(t+=" "+e),console.log(`oidc: requesting scopes '${t}'`),t},this.setStorageItem=function(e,t){localStorage.setItem(u+e,t)},this.getStorageItem=function(e){return localStorage.getItem(u+e)},this.removeStorageItem=function(e){localStorage.removeItem(u+e)}}])},function(e,t){angular.module("graphdb.framework.rest.security.service",[]).factory("SecurityRestService",n),n.$inject=["$http"];function n(e){return{getUser:function(n){return e.get("rest/security/users/"+t(n))},getAdminUser:function(){return e.get("rest/security/users/admin")},getUsers:function(){return e.get("rest/security/users")},createUser:function(n){return e({method:"POST",url:"rest/security/users/"+t(n.username),data:{password:n.pass,appSettings:n.appSettings,grantedAuthorities:n.grantedAuthorities}})},updateUser:function(n){return e({method:"PUT",url:"rest/security/users/"+t(n.username),data:{password:n.pass,appSettings:n.appSettings,grantedAuthorities:n.grantedAuthorities}})},updateUserData:function(n){return e({method:"PATCH",url:"rest/security/users/"+t(n.username),data:{password:n.pass,appSettings:n.appSettings}})},deleteUser:function(n){return e.delete("rest/security/users/"+t(n))},getFreeAccess:function(){return e.get("rest/security/free-access")},setFreeAccess:function(t){return e.post("rest/security/free-access",t)},getSecurityConfig:function(){return e.get("rest/security/all")},toggleSecurity:function(t){return e.post("rest/security",t?"true":"false")},getRoles:function(){return e.get("rest/roles")},getRolesMapping:function(t){return e.get("rest/roles/mapping",{params:t})},getAuthenticatedUser:function(){return e.get("rest/security/authenticated-user")}};function t(e){return encodeURIComponent(e).replace(/[!'()*]/g,(function(e){return"%"+e.charCodeAt(0).toString(16)}))}}},function(e,t){!function(e){e.getError=function(e,t,n){if(angular.isObject(e)&&e.status&&e.data)return getError(e.data,t,n);if(t&&403===t)return"Access is restricted";if(e){let r="Generic error";if(angular.isString(e))-1===e.indexOf("<html>")&&(r=e,r=r.replace(/^(([a-z0-9_]+\.)+[a-zA-Z0-9_]+: )+/,""));else if(angular.isObject(e)){if("message"in e&&(r=e.message),"error"in e&&(r=e.error.message),"responseJSON"in e&&"message"in e.responseJSON)return getError(e.responseJSON,t,n);"responseText"in e&&(r=e.responseText)}return n>0&&r.length>n&&(r=r.substr(0,n)+"..."),r}return"There is an error"}}(window)},function(e,t,n){"use strict";n.r(t);n(7),n(41),n(27),n(32),n(30),n(26),n(13),n(14),n(28),n(53),n(54),n(24),n(22),n(42);var r=n(5),i=(n(10),n(43),n(25),n(44),n(0)),o=(n(33),n(45),n(12));function a(e,t,n,r,i,o,a,s,u,l,c){function p(){e.getActiveRepository()&&(e.getNamespacesPromise=l.getNamespaces(e.getActiveRepository()).success((function(){h()})),e.getActiveRepositorySize())}function h(){o.isLicenseValid()&&(e.getAutocompletePromise=a.checkAutocompleteStatus())}e.doClear=!1,e.getActiveRepositorySize=function(){const t=r.getActiveRepositoryObject();t&&(e.activeRepositorySizeError=void 0,u.getSize(t).then((function(t){e.activeRepositorySize=t.data})).catch((function(t){e.activeRepositorySizeError=t.data.message})))},e.$on("autocompleteStatus",(function(){h()})),e.$on("repositoryIsSet",p),e.$on("$routeChangeSuccess",(function(e,n,r){r&&(i.isAuthenticated()||i.isFreeAccessEnabled()?p():t.redirectToLogin())})),e.onKeyDown=function(t){27===t.keyCode&&(e.doClear=!0)}}function s(e,t,n,a,s,u,l,c,p,h,d,f,g,m,v,y,b,w,x,S,E,A,F,C,D,T,I,R){e.descr=A.instant("main.gdb.description"),e.documentation="",e.menu=t,e.tutorialState=1!==S.get(E.TUTORIAL_STATE),e.userLoggedIn=!1,e.embedded=u.search().embedded,e.productInfo=h,e.guidePaused="true"===S.get(o.GUIDE_PAUSE);!function(){const t=new Date;e.currentYear=t.getFullYear(),e.previousYear=2002}(),$("#repositorySelectDropdown").on("hide.bs.dropdown",(function(e){D.isActive()&&$("#repositorySelectDropdown.autoCloseOff").length>0&&e.preventDefault()})),e.$on("$routeChangeSuccess",(function(t,n,r){e.clicked=!1,$(".menu-element-root").removeClass("active"),d((function(){$(".menu-element.open a.menu-element-root").addClass("active"),$(".main-menu.collapsed .menu-element.open .menu-element-root").addClass("active")}),400),r&&c.checkLicenseStatus()})),e.resumeGuide=function(){p.$broadcast("guideResume")},p.$on("guideReset",(function(){e.guidePaused=!1,p.guidePaused=!1})),p.$on("guideStarted",(function(){e.guidePaused=!1,p.guidePaused=!1})),p.$on("guidePaused",(function(){e.guidePaused=!0,p.guidePaused=!0})),p.$on("$translateChangeSuccess",(function(){e.menu.forEach((function(e){e.label=A.instant(e.labelKey),e.children&&e.children.forEach((function(e){e.label=A.instant(e.labelKey)}))})),p.helpInfo=x.trustAsHtml(Object(i.decodeHTML)(A.instant(p.helpInfo))),p.title=Object(i.decodeHTML)(A.instant(p.title)),e.initTutorial()})),e.checkMenu=function(){return $(".main-menu").hasClass("collapsed")},e.copyToClipboard=function(e){f.openCopyToClipboardModal(e)},e.goToAddRepo=function(){u.path("/repository/create").search({previous:"home"})},e.goToEditRepo=function(e){u.path("repository/edit/"+e.id).search({previous:"home",location:e.location})},e.getLocationFromUri=function(e){return l.getLocationFromUri(e)},e.$on("$locationChangeSuccess",(function(){e.showFooter=!0})),e.$on("repositoryIsSet",(function(){e.setRestricted(),S.clearClassHieararchyState()})),e.graphdbVersion=e.engineVersion=h.productVersion,e.workbenchVersion=h.Workbench,e.connectorsVersion=h.connectors,e.sesameVersion=h.sesame,e.select=function(t,n,r){$(".main-menu").hasClass("collapsed")?$(n.target).parents(".menu-element").children(".menu-element-root").hasClass("active")?(e.selected=t,e.clicked=!r):(!$(n.target).parents(".menu-element").hasClass("open")&&r?e.clicked=!0:e.clicked=!r,e.selected===t?e.selected=-1:e.selected=t):(!$(n.target).parents(".menu-element").hasClass("open")&&r?e.clicked=!0:e.clicked=!r,0!==$(n.target).parent(".menu-element").find(".sub-menu").length?($(n.target).parents(".menu-element").children(".menu-element-root").hasClass("active")?$(".sub-menu li.active").parents(".menu-element").children(".menu-element-root").removeClass("active"):$(".sub-menu li.active").parents(".menu-element").children(".menu-element-root").addClass("active"),e.selected===t?e.selected=-1:e.selected=t):(d((function(){$(n.target).parents(".menu-element").children(".menu-element-root").addClass("active")}),50),e.selected=t))},$("body").bind("click",(function(t){!$(t.target).parents(".main-menu").length&&$(".main-menu").hasClass("collapsed")&&(e.clicked=!1,e.selected=-1)})),e.isCurrentPath=function(e){return u.path()==="/"+e},e.isCurrentSubmenuChildPath=function(t){return 0!==t.children.length&&t.children.some((function(t){return e.isCurrentPath(t.href)}))},"/"===u.path()?e.selected=-1:(d((function(){const t=u.path().replace("/",""),n=$('a[href^="'+t+'"]');e.selected=n.closest(".menu-element").index()-1}),200),e.isCurrentPath(u.path())),e.popoverTemplate="js/angular/templates/repositorySize.html",e.securityEnabled=!0,e.isSecurityEnabled=function(){return n.isSecurityEnabled()},e.isFreeAccessEnabled=function(){return n.isFreeAccessEnabled()},e.hasExternalAuthUser=function(){return n.hasExternalAuthUser()},e.isDefaultAuthEnabled=function(){return n.isDefaultAuthEnabled()},e.isUserLoggedIn=function(){return e.userLoggedIn},e.hasActiveLocation=function(){return l.hasActiveLocation()},e.getActiveLocation=function(){return l.getActiveLocation()},e.isLoadingLocation=function(){return l.isLoadingLocation()},e.getRepositories=function(){return l.getRepositories()},e.getReadableRepositories=function(){return l.getReadableRepositories()},e.getWritableRepositories=function(){return l.getWritableRepositories()},e.getActiveRepository=function(){return l.getActiveRepository()},e.canWriteRepoInLocation=function(e){return n.canWriteRepo(e)},e.canWriteActiveRepo=function(e){const t=l.getActiveRepositoryObject();return!!t&&(n.canWriteRepo(t)&&("SYSTEM"!==t.id||!e))},e.getActiveRepositoryObject=function(){return l.getActiveRepositoryObject()},e.getActiveRepositoryShortLocation=function(){const e=l.getActiveRepositoryObject();if(e){const t=e.location;if(t)return"@"+F.shortenIri(t)}return""},e.isActiveRepoOntopType=function(){return l.isActiveRepoOntopType()},e.isActiveRepoFedXType=function(){return l.isActiveRepoFedXType()},e.isLicenseValid=function(){return c.isLicenseValid()},e.setAttrs=function(t){e.attrs=t},e.setRestricted=function(){e.attrs&&(e.isRestricted=e.attrs.hasOwnProperty("license")&&!c.isLicenseValid()||e.attrs.hasOwnProperty("write")&&e.isSecurityEnabled()&&!e.canWriteActiveRepo()||e.attrs.hasOwnProperty("ontop")&&e.isActiveRepoOntopType()||e.attrs.hasOwnProperty("fedx")&&e.isActiveRepoFedXType())},e.toHumanReadableType=function(e){switch(e){case"graphdb":return"Graphdb";case"system":return"System";case"ontop":return"Ontop";case"fedx":return"FedX";default:return"Unknown"}},e.setRepository=function(e){l.setRepository(e)},e.logout=function(){n.clearAuthentication(),s.success("Signed out"),n.freeAccess?(l.resetActiveRepository(),n.updateReturnUrl()):n.isSecurityEnabled()&&p.redirectToLogin()},e.showMainManuAndStatusBar=()=>n.isAuthenticated()||e.isSecurityEnabled()&&e.isFreeAccessEnabled();const P=()=>{setTimeout(()=>{I.location.reload()},0)};let O=void 0;const k=e=>{if(R.AUTH_STORAGE_NAME===e.key){const e=n.isAuthenticated();n.updateReturnUrl(),O!==e&&(O=e,O?(u.url(p.returnToUrl||"/"),T.reload(),P()):(p.redirectToLogin(),P()))}};function j(e){e?$(":root").addClass("menu-collapsed"):$(":root").removeClass("menu-collapsed")}function N(){$(window).width()<=720?($(".container-fluid.main-container").addClass("expanded"),j(!0),$(".main-menu").addClass("collapsed"),$(".main-menu .icon-caret-left").toggleClass("icon-caret-left").toggleClass("icon-caret-right"),$(".toggle-menu").hide()):$(window).width()>720&&"collapsedMenu"===S.get(E.MENU_STATE)?($(".container-fluid.main-container").addClass("expanded"),j(!0),$(".main-menu").addClass("collapsed"),$(".toggle-menu").show(),$(".main-menu .icon-caret-left").toggleClass("icon-caret-left").toggleClass("icon-caret-right")):($(".container-fluid.main-container").removeClass("expanded"),j(!1),$(".main-menu").removeClass("collapsed"),$(".toggle-menu").show(),$(".main-menu .icon-caret-right").toggleClass("icon-caret-right").toggleClass("icon-caret-left"))}window.addEventListener("storage",k),e.$on("$destroy",()=>{window.removeEventListener("storage",k)}),e.isAdmin=function(){return e.hasRole(r.UserRole.ROLE_ADMIN)},e.isUser=function(){return e.hasRole(r.UserRole.ROLE_USER)},e.hasRole=function(e){return!!angular.isUndefined(e)||n.hasRole(e)},e.hasPermission=function(){return p.hasPermission()},e.canReadRepo=function(e){return n.canReadRepo(e)},e.checkForWrite=function(e,t){return n.checkForWrite(e,t)},e.setPopoverRepo=function(t){e.popoverRepo=t},e.isRepoActive=function(e){return l.isRepoActive(e)},e.getRepositorySize=function(){e.repositorySize={},e.popoverRepo&&(e.repositorySize.loading=!0,y.getSize(e.popoverRepo).then((function(t){e.repositorySize=t.data})))},e.getDegradedReason=function(){return l.getDegradedReason()},e.canManageRepositories=function(){return n.hasRole(r.UserRole.ROLE_REPO_MANAGER)&&!l.getDegradedReason()},e.getSavedQueries=function(){w.getSavedQueries().success((function(t){e.sampleQueries=t})).error((function(e){const t=getError(e);s.error(t,A.instant("query.editor.get.saved.queries.error"))}))},e.goToSparqlEditor=function(e){u.path("/sparql").search({savedQueryName:e.name,owner:e.owner,execute:!0})},e.declineTutorial=function(){S.set(E.TUTORIAL_STATE,1),e.tutorialState=!1},e.showTutorial=function(){e.tutorialState=!0,S.remove(E.TUTORIAL_STATE)},e.initTutorial=function(){if(!e.tutorialState&&"/"!==u.path())return;e.tutorialInfo=[{title:A.instant("main.info.title.welcome.page"),info:"<p>"+Object(i.decodeHTML)(A.instant("main.info.welcome.page"))+"</p><p>"+Object(i.decodeHTML)(A.instant("main.info.welcome.page.guides"))+"</p><p>"+Object(i.decodeHTML)(A.instant("main.info.welcome.page.footer"))+"</p>"},{title:A.instant("main.info.title.create.repo.page"),info:Object(i.decodeHTML)(A.instant("main.info.create.repo.page",{link:'<a href="https://graphdb.ontotext.com/documentation/'+h.productShortVersion+'/configuring-a-repository.html" target="_blank">'}))},{title:A.instant("main.info.title.load.sample.dataset"),info:A.instant("main.info.load.sample.dataset")},{title:A.instant("main.info.title.run.sparql.query"),info:Object(i.decodeHTML)(A.instant("main.info.run.sparql.query"))},{title:A.instant("menu.rest.api.label"),info:Object(i.decodeHTML)(A.instant("main.info.rest.api"))}],e.activePage=0,$(".pages-wrapper .page-slide").css("opacity",100);const t=$(".main-container")[0].offsetWidth+200;d((function(){const n=$(".pages-wrapper .page-slide");n.css("left",t+"px"),$(n[e.activePage]).css("left","0px"),$($(".btn-toolbar.pull-right .btn-group .btn")[0]).focus()}),50)},e.getTutorialPageHtml=function(e){return x.trustAsHtml(e.info)},e.checkSubMenuPosition=function(e){0===e?$(".main-menu.collapsed .sub-menu").removeClass("align-bottom"):$(window).height()<735?$(".main-menu.collapsed .sub-menu").addClass("align-bottom"):$(".main-menu.collapsed .sub-menu").removeClass("align-bottom")},N(),$(window).resize((function(){angular.isDefined(e.menuState)?$(window).width()<=720?($(".container-fluid.main-container").addClass("expanded"),j(!0),$(".main-menu").addClass("collapsed"),$(".toggle-menu").hide(),$(".main-menu .icon-caret-left").toggleClass("icon-caret-left").toggleClass("icon-caret-right")):$(window).width()>720&&e.menuState?$(".toggle-menu").show():($(".container-fluid.main-container").removeClass("expanded"),j(!1),$(".main-menu").removeClass("collapsed"),$(".toggle-menu").show(),$(".main-menu .icon-caret-right").toggleClass("icon-caret-right").toggleClass("icon-caret-left")):N(),e.tutorialState&&"/"===u.path()&&e.initTutorial(),$(window).height()<735?($(".sub-menu").addClass("align-bottom"),$(".main-menu.collapsed li:nth-child(2) .sub-menu").removeClass("align-bottom")):$(".sub-menu").removeClass("align-bottom")})),e.slideToPage=function(t){const n=$(".main-container")[0].offsetWidth,r=$(".pages-wrapper .page-slide");r.css("opacity","0").delay(200).css("left",n+"px"),e.activePage=t,$(r[e.activePage]).css("opacity","100").css("left","0px")},e.slideNext=function(){let t=++e.activePage;t>=e.tutorialInfo.length&&(t=0),e.slideToPage(t),$($(".btn-toolbar.pull-right .btn-group .btn")[e.activePage]).focus()},e.toggleNavigation=function(){const t=$(".main-menu"),n=$(".sub-menu li.active");if(t.hasClass("collapsed"))n.parents(".menu-element").hasClass("open")?n.parents(".menu-element").children(".menu-element-root").removeClass("active"):n.parents(".menu-element").children(".menu-element-root").addClass("active"),$(".container-fluid.main-container").removeClass("expanded"),j(!1),t.removeClass("collapsed"),$(".main-menu .icon-caret-right").toggleClass("icon-caret-right").toggleClass("icon-caret-left"),p.$broadcast("onToggleNavWidth",!1);else{n.parents(".menu-element").children(".menu-element-root").addClass("active");const r=$(".menu-element");r.hasClass("open")&&(r.removeClass("open"),e.clicked=!1,e.selected=-1),$(".container-fluid.main-container").addClass("expanded"),j(!0),t.addClass("collapsed"),$(".main-menu .icon-caret-left").toggleClass("icon-caret-left").toggleClass("icon-caret-right"),$(".main-menu.collapsed .menu-element.clicked").removeClass("clicked"),p.$broadcast("onToggleNavWidth",!0)}},e.$on("onToggleNavWidth",(function(t,n){if(e.menuState=n,n?S.set(E.MENU_STATE,"collapsedMenu"):S.set(E.MENU_STATE,"expandedMenu"),e.tutorialState&&"/"===u.path()){const t=$(".pages-wrapper")[0].offsetWidth+200;d((function(){const n=$(".pages-wrapper .page-slide");n.css("left",t+"px"),$(n[e.activePage]).css("left","0px")}),50)}})),n.securityInitialized&&e.getSavedQueries(),e.$on("securityInit",(function(t,r,i,o){e.securityEnabled=r,e.userLoggedIn=i,!r||i||o?(C.when(n.getPrincipal()).then(t=>{e.principal=t,e.isIgnoreSharedQueries=t&&t.appSettings.IGNORE_SHARED_QUERIES}),c.checkLicenseStatus(),setTimeout((function(){e.getSavedQueries()}))):"/login"!==u.path()&&p.redirectToLogin()})),e.isEnterprise=function(){return"enterprise"===e.getProductType()},e.isFreeEdition=function(){return"free"===e.getProductType()},e.checkEdition=function(t){return null==t||_.indexOf(t,e.getProductType())>=0},e.showLicense=function(){return c.showLicense},e.getLicense=function(){return c.license},e.isLicenseHardcoded=function(){return c.isLicenseHardcoded},e.getProductType=function(){return c.productType},e.getProductTypeHuman=function(){return c.productTypeHuman},e.getHumanReadableSeconds=function(e,t){const n=Math.floor(e/86400),r=Math.floor(e%86400/3600),i=Math.floor(e%3600/60);let o;o=t&&e<10?e<1?_.ceil(e%60,1):_.round(e%60,1):_.round(e%60,0);let a="";return n&&(a+=n+"d "),(n||r)&&(a+=r+"h "),(n||r||i)&&(a+=i+"m "),a+=o+"s",a.replace(/( 0[a-z])+$/,"")},e.getHumanReadableTimestamp=function(e){const t=Date.now(),n=(t-e)/1e3;if(n<60)return A.instant("timestamp.moments.ago");if(n<600)return A.instant("timestamp.minutes.ago");{const r=new Date(t),i=new Date(e);if(r.getYear()===i.getYear()&&r.getMonth()===i.getMonth()&&r.getDate()===i.getDate())return m("date")(e,"'"+A.instant("timestamp.today.at")+"' HH:mm");if(n<86400)return m("date")(e,"'"+A.instant("timestamp.yesterday.at")+"' HH:mm")}return m("date")(e,"'"+A.instant("timestamp.on")+"' yyyy-MM-dd '"+A.instant("timestamp.at")+"' HH:mm")}}function u(e,t,n){e.getRepositorySize=function(t){n.getSize(t).then((function(t){e.size=t.data}))}}function l(e,t,n){e.demoToast=function(e,t=!0){n[e]("Consectetur adipiscing elit. Sic transit gloria mundi.",t?"Lorem ipsum dolor sit amet":void 0,{timeOut:3e5,extendedTimeOut:3e5})},e.clearToasts=function(){n.clear()},e.clearRepo=function(){t.setRepository("")}}angular.module("graphdb.workbench.se.controllers",["graphdb.framework.core.services.jwtauth","graphdb.framework.core.services.repositories","graphdb.framework.core.services.licenseService","graphdb.framework.core.services.theme-service","ngCookies","ngFileUpload","graphdb.framework.core","graphdb.framework.core.controllers","graphdb.framework.core.directives","graphdb.framework.rest.license.service","graphdb.framework.rest.autocomplete.service","graphdb.framework.rest.repositories.service","graphdb.framework.rest.sparql.service","graphdb.framework.rest.plugins.service","graphdb.framework.rest.monitoring.service","graphdb.framework.rest.rdf4j.repositories.service","graphdb.framework.utils.localstorageadapter","graphdb.framework.utils.workbenchsettingsstorageservice","graphdb.framework.core.services.autocompleteStatus","graphdb.framework.utils.uriutils","graphdb.framework.guides.directives","graphdb.framework.guides.services"]).controller("mainCtrl",s).controller("homeCtrl",a).controller("repositorySizeCtrl",u).controller("uxTestCtrl",l),a.$inject=["$scope","$rootScope","$http","$repositories","$jwtAuth","$licenseService","AutocompleteRestService","LicenseRestService","RepositoriesRestService","RDF4JRepositoriesRestService","toastr"],s.$inject=["$scope","$menuItems","$jwtAuth","$http","toastr","$location","$repositories","$licenseService","$rootScope","productInfo","$timeout","ModalService","$interval","$filter","LicenseRestService","RepositoriesRestService","MonitoringRestService","SparqlRestService","$sce","LocalStorageAdapter","LSKeys","$translate","UriUtils","$q","GuidesService","$route","$window","AuthTokenService"],u.$inject=["$scope","$http","RepositoriesRestService"],l.$inject=["$scope","$repositories","toastr"]},function(e,t){angular.module("graphdb.framework.core.services.theme-service",[]).factory("ThemeService",r),r.$inject=["WorkbenchSettingsStorageService","$translate","toastr"];const n={name:null,label:null,variables:{"primary-color-hue":null,"primary-color-saturation":null,"primary-color-lightness":null,"secondary-color-hue":null,"secondary-color-saturation":null,"secondary-color-lightness":null,"tertiary-color-hue":null,"tertiary-color-saturation":null,"tertiary-color-lightness":null,"icon-on-primary-color":null,"gray-color":null,"gray-color-dark":null,"color-danger-dark":null,"color-success-dark":null,"color-warning-dark":null,"color-info-dark":null,"color-danger-light":null,"color-success-light":null,"color-warning-light":null,"color-info-light":null,"color-help-light":null,"logo-color":null,"logo-text-color":null,"logo-background-color":null}};function r(e,t,r){const i=()=>{const e=a();return{name:e.name,label:t.instant(e.label)||e.label}},o=e=>{const t=PluginRegistry.findPlugin("themes",t=>t.name===e);return t||("default-theme"!==e?a():void 0)},a=()=>o("default-theme"),s=e=>{const i=function e(t,n,r,i){return Object.keys(t).forEach(o=>{o in n?angular.isObject(t[o])&&e(t[o],n[o],r+o+".",i):i.push(r+o)}),i}(n,e,"",[]);return!i.length||(r.error(t.instant("security.workbench.settings.theme.validation.missing-fields")),console.error(`\n Color theme validation error. Missing definitions in plugin theme: ${i.join(", ")}.\n Check the developers guide how to create a valid color theme.`),!1)},u=e=>{function t(e,t,n){e[t]||(e[t]=n)}function n(e,n=!0){const r={};for(const[t,n]of Object.entries(e.variables))r["--"+t]=n;if("properties"in e)for(const[t,n]of Object.entries(e.properties))r[t]=n;if(n)for(const e of["primary","secondary","tertiary"])t(r,`--${e}-color-hsl`,`var(--${e}-color-hue), var(--${e}-color-saturation), var(--${e}-color-lightness)`),t(r,`--${e}-color`,`hsl(var(--${e}-color-hsl))`),t(r,`--${e}-color-light`,`hsl(var(--${e}-color-hue), var(--${e}-color-saturation), calc(var(--${e}-color-lightness)*1.2))`),t(r,`--${e}-color-dark`,`hsl(var(--${e}-color-hue), var(--${e}-color-saturation), calc(var(--${e}-color-lightness)*0.8))`);return i=r,Object.entries(i).map(e=>e[0]+": "+e[1]+";").join("\n");var i}const r=e.dark;return`\n :root {\n ${n(e)}\n }\n\n :root.dark {\n ${r?n(r,!1):""}\n }\n `};return{applyDarkThemeMode:()=>{if("dark"===e.getWorkbenchSettings().mode){document.querySelector(":root").classList.add("dark")}},toggleThemeMode:e=>{const t=document.querySelector(":root");"dark"===e?t.classList.add("dark"):t.classList.remove("dark")},getDefaultTheme:i,getThemeDefinition:()=>{const t=e.getThemeName();let n=PluginRegistry.findPlugin("themes",e=>e.name===t);return n||(n=a()),n},getTheme:()=>{let n;const r=(()=>{const t=e.getThemeName();return o(t)})();return n=r?{name:r.name,label:t.instant(r.label)||r.label}:i(),n},getThemes:()=>PluginRegistry.get("themes").filter(s).map(e=>({name:e.name,label:t.instant(e.label)||e.label})),applyTheme:e=>{const t=(e=>{const t=u(e),n=new CSSStyleSheet;return n.title=e.name,n.replaceSync(t),n})(o(e));document.adoptedStyleSheets=[t]}}}},function(e,t){angular.module("graphdb.framework.core.services.licenseService",[]).service("$licenseService",["$rootScope","LicenseRestService","$translate",function(e,t,n){const r=this;this.checkLicenseStatus=function(){r.loadingLicense=!0,t.getHardcodedLicense().success((function(e){r.isLicenseHardcoded="true"===e})).error((function(){r.isLicenseHardcoded=!0})).then((function(){t.getLicenseInfo().then((function(e){r.license=e.data,r.showLicense=!0,r.loadingLicense=!1,i(r.license)}),(function(){r.license={message:n.instant("no.license.set.msg"),valid:!1},r.showLicense=!0,r.loadingLicense=!1,i(r.license)}))}))};const i=function(e){r.productType=e.productType,"standard"===r.productType?r.productTypeHuman="Standard":"enterprise"===r.productType?r.productTypeHuman="Enterprise":"free"===r.productType?r.productTypeHuman="Free":"graphdb"===r.productType&&(r.productTypeHuman="GraphDB")};this.checkLicenseStatus(),this.isLicenseValid=function(){return r.license&&r.license.valid}}])},function(e,t){function n(e,t){const n={theme:"default-theme",mode:"light"},r=()=>{let r=e.get(t.WORKBENCH_SETTINGS);return r||(r=n),r};return{getWorkbenchSettings:r,saveWorkbenchSettings:n=>{e.set(t.WORKBENCH_SETTINGS,n)},getThemeName:()=>{const e=r();if(e&&e.theme)return e.theme},saveTheme:n=>{const i=r();i.theme=n,e.set(t.WORKBENCH_SETTINGS,i)}}}angular.module("graphdb.framework.utils.workbenchsettingsstorageservice",[]).factory("WorkbenchSettingsStorageService",n),n.$inject=["LocalStorageAdapter","LSKeys"]},function(e,t){angular.module("graphdb.framework.core.services.autocompleteStatus",[]).service("$autocompleteStatus",["$rootScope","AutocompleteRestService","LocalStorageAdapter","LSKeys","$repositories",function(e,t,n,r,i){const o=this;this.setAutocompleteStatus=function(t){n.set(r.AUTOCOMPLETE_ENABLED,t),e.$broadcast("autocompleteStatus",t)},e.$watch((function(){return n.get(r.AUTOCOMPLETE_ENABLED)}),(function(e){o.setAutocompleteStatus(e)}),!0),e.$on("repositoryIsSet",(function(){!i.getActiveRepository()||i.isActiveRepoOntopType()||i.isActiveRepoFedXType()||t.checkAutocompleteStatus().success((function(e){o.setAutocompleteStatus(e)}))}))}])},function(e,t){angular.module("graphdb.framework.guides.directives",[]).directive("guideSelector",(function(){return{}}))},function(e,t){
27
+ var se=function(){var e=new RegExp('(?:false|true|null|[\\{\\}\\[\\]]|(?:-?\\b(?:0|[1-9][0-9]*)(?:\\.[0-9]+)?(?:[eE][+-]?[0-9]+)?\\b)|(?:"(?:[^\\0-\\x08\\x0a-\\x1f"\\\\]|\\\\(?:["/\\\\bfnrt]|u[0-9A-Fa-f]{4}))*"))',"g"),t=new RegExp("\\\\(?:([^u])|u(.{4}))","g"),n={'"':'"',"/":"/","\\":"\\",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};function r(e,t,r){return t?n[t]:String.fromCharCode(parseInt(r,16))}var i=new String(""),o=Object.hasOwnProperty;return function(n,a){var s,u,l=n.match(e),c=l[0],p=!1;"{"===c?s={}:"["===c?s=[]:(s=[],p=!0);for(var h=[s],d=1-p,f=l.length;d<f;++d){var g;switch((c=l[d]).charCodeAt(0)){default:(g=h[0])[u||g.length]=+c,u=void 0;break;case 34:if(-1!==(c=c.substring(1,c.length-1)).indexOf("\\")&&(c=c.replace(t,r)),g=h[0],!u){if(!(g instanceof Array)){u=c||i;break}u=g.length}g[u]=c,u=void 0;break;case 91:g=h[0],h.unshift(g[u||g.length]=[]),u=void 0;break;case 93:h.shift();break;case 102:(g=h[0])[u||g.length]=!1,u=void 0;break;case 110:(g=h[0])[u||g.length]=null,u=void 0;break;case 116:(g=h[0])[u||g.length]=!0,u=void 0;break;case 123:g=h[0],h.unshift(g[u||g.length]={}),u=void 0;break;case 125:h.shift()}}if(p){if(1!==h.length)throw new Error;s=s[0]}else if(h.length)throw new Error;if(a){var m=function(e,t){var n=e[t];if(n&&"object"==typeof n){var r=null;for(var i in n)if(o.call(n,i)&&n!==e){var s=m(n,i);void 0!==s?n[i]=s:(r||(r=[]),r.push(i))}if(r)for(var u=r.length;--u>=0;)delete n[r[u]]}return a.call(e,t,n)};s=m({"":s},"")}return s}}();void 0!==ue&&ue||(ue={}),void 0!==ue.asn1&&ue.asn1||(ue.asn1={}),ue.asn1.ASN1Util=new function(){this.integerToByteHex=function(e){var t=e.toString(16);return t.length%2==1&&(t="0"+t),t},this.bigIntToMinTwosComplementsHex=function(e){var t=e.toString(16);if("-"!=t.substr(0,1))t.length%2==1?t="0"+t:t.match(/^[0-7]/)||(t="00"+t);else{var n=t.substr(1).length;n%2==1?n+=1:t.match(/^[0-7]/)||(n+=2);for(var r="",i=0;i<n;i++)r+="f";t=new x(r,16).xor(e).add(x.ONE).toString(16).replace(/^-/,"")}return t},this.getPEMStringFromHex=function(e,t){return De(e,t)},this.newObject=function(e){var t=ue.asn1,n=t.ASN1Object,r=t.DERBoolean,i=t.DERInteger,o=t.DERBitString,a=t.DEROctetString,s=t.DERNull,u=t.DERObjectIdentifier,l=t.DEREnumerated,c=t.DERUTF8String,p=t.DERNumericString,h=t.DERPrintableString,d=t.DERTeletexString,f=t.DERIA5String,g=t.DERUTCTime,m=t.DERGeneralizedTime,v=t.DERVisibleString,y=t.DERBMPString,b=t.DERSequence,w=t.DERSet,x=t.DERTaggedObject,S=t.ASN1Util.newObject;if(e instanceof t.ASN1Object)return e;var E=Object.keys(e);if(1!=E.length)throw new Error("key of param shall be only one.");var A=E[0];if(-1==":asn1:bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:visstr:bmpstr:seq:set:tag:".indexOf(":"+A+":"))throw new Error("undefined key: "+A);if("bool"==A)return new r(e[A]);if("int"==A)return new i(e[A]);if("bitstr"==A)return new o(e[A]);if("octstr"==A)return new a(e[A]);if("null"==A)return new s(e[A]);if("oid"==A)return new u(e[A]);if("enum"==A)return new l(e[A]);if("utf8str"==A)return new c(e[A]);if("numstr"==A)return new p(e[A]);if("prnstr"==A)return new h(e[A]);if("telstr"==A)return new d(e[A]);if("ia5str"==A)return new f(e[A]);if("utctime"==A)return new g(e[A]);if("gentime"==A)return new m(e[A]);if("visstr"==A)return new v(e[A]);if("bmpstr"==A)return new y(e[A]);if("asn1"==A)return new n(e[A]);if("seq"==A){for(var F=e[A],C=[],$=0;$<F.length;$++){var D=S(F[$]);C.push(D)}return new b({array:C})}if("set"==A){for(F=e[A],C=[],$=0;$<F.length;$++){D=S(F[$]);C.push(D)}return new w({array:C})}if("tag"==A){var T=e[A];if("[object Array]"===Object.prototype.toString.call(T)&&3==T.length){var I=S(T[2]);return new x({tag:T[0],explicit:T[1],obj:I})}return new x(T)}},this.jsonToASN1HEX=function(e){return this.newObject(e).tohex()}},ue.asn1.ASN1Util.oidHexToInt=function(e){for(var t="",n=parseInt(e.substr(0,2),16),r=(t=Math.floor(n/40)+"."+n%40,""),i=2;i<e.length;i+=2){var o=("00000000"+parseInt(e.substr(i,2),16).toString(2)).slice(-8);if(r+=o.substr(1,7),"0"==o.substr(0,1))t=t+"."+new x(r,2).toString(10),r=""}return t},ue.asn1.ASN1Util.oidIntToHex=function(e){var t=function(e){var t=e.toString(16);return 1==t.length&&(t="0"+t),t},n=function(e){var n="",r=new x(e,10).toString(2),i=7-r.length%7;7==i&&(i=0);for(var o="",a=0;a<i;a++)o+="0";r=o+r;for(a=0;a<r.length-1;a+=7){var s=r.substr(a,7);a!=r.length-7&&(s="1"+s),n+=t(parseInt(s,2))}return n};if(!e.match(/^[0-9.]+$/))throw"malformed oid string: "+e;var r="",i=e.split("."),o=40*parseInt(i[0])+parseInt(i[1]);r+=t(o),i.splice(0,2);for(var a=0;a<i.length;a++)r+=n(i[a]);return r},ue.asn1.ASN1Object=function(e){this.params=null,this.getLengthHexFromValue=function(){if(void 0===this.hV||null==this.hV)throw new Error("this.hV is null or undefined");if(this.hV.length%2==1)throw new Error("value hex must be even length: n="+"".length+",v="+this.hV);var e=this.hV.length/2,t=e.toString(16);if(t.length%2==1&&(t="0"+t),e<128)return t;var n=t.length/2;if(n>15)throw new Error("ASN.1 length too long to represent by 8x: n = "+e.toString(16));return(128+n).toString(16)+t},this.tohex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getEncodedHex=function(){return this.tohex()},this.getValueHex=function(){return this.tohex(),this.hV},this.getFreshValueHex=function(){return""},this.setByParam=function(e){this.params=e},null!=e&&null!=e.tlv&&(this.hTLV=e.tlv,this.isModified=!1)},ue.asn1.DERAbstractString=function(e){ue.asn1.DERAbstractString.superclass.constructor.call(this);this.getString=function(){return this.s},this.setString=function(e){this.hTLV=null,this.isModified=!0,this.s=e,this.hV=we(this.s).toLowerCase()},this.setStringHex=function(e){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"==typeof e?this.setString(e):void 0!==e.str?this.setString(e.str):void 0!==e.hex&&this.setStringHex(e.hex))},et(ue.asn1.DERAbstractString,ue.asn1.ASN1Object),ue.asn1.DERAbstractTime=function(e){ue.asn1.DERAbstractTime.superclass.constructor.call(this);this.localDateToUTC=function(e){var t=e.getTime()+6e4*e.getTimezoneOffset();return new Date(t)},this.formatDate=function(e,t,n){var r=this.zeroPadding,i=this.localDateToUTC(e),o=String(i.getFullYear());"utc"==t&&(o=o.substr(2,2));var a=o+r(String(i.getMonth()+1),2)+r(String(i.getDate()),2)+r(String(i.getHours()),2)+r(String(i.getMinutes()),2)+r(String(i.getSeconds()),2);if(!0===n){var s=i.getMilliseconds();if(0!=s){var u=r(String(s),3);a=a+"."+(u=u.replace(/[0]+$/,""))}}return a+"Z"},this.zeroPadding=function(e,t){return e.length>=t?e:new Array(t-e.length+1).join("0")+e},this.setByParam=function(e){this.hV=null,this.hTLV=null,this.params=e},this.getString=function(){},this.setString=function(e){this.hTLV=null,this.isModified=!0,null==this.params&&(this.params={}),this.params.str=e},this.setByDate=function(e){this.hTLV=null,this.isModified=!0,null==this.params&&(this.params={}),this.params.date=e},this.setByDateValue=function(e,t,n,r,i,o){var a=new Date(Date.UTC(e,t-1,n,r,i,o,0));this.setByDate(a)},this.getFreshValueHex=function(){return this.hV}},et(ue.asn1.DERAbstractTime,ue.asn1.ASN1Object),ue.asn1.DERAbstractStructured=function(e){ue.asn1.DERAbstractString.superclass.constructor.call(this);this.setByASN1ObjectArray=function(e){this.hTLV=null,this.isModified=!0,this.asn1Array=e},this.appendASN1Object=function(e){this.hTLV=null,this.isModified=!0,this.asn1Array.push(e)},this.asn1Array=new Array,void 0!==e&&void 0!==e.array&&(this.asn1Array=e.array)},et(ue.asn1.DERAbstractStructured,ue.asn1.ASN1Object),ue.asn1.DERBoolean=function(e){ue.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV=0==e?"010100":"0101ff"},et(ue.asn1.DERBoolean,ue.asn1.ASN1Object),ue.asn1.DERInteger=function(e){ue.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.params=null;var t=ue.asn1.ASN1Util.bigIntToMinTwosComplementsHex;this.setByBigInteger=function(e){this.isModified=!0,this.params={bigint:e}},this.setByInteger=function(e){this.isModified=!0,this.params=e},this.setValueHex=function(e){this.isModified=!0,this.params={hex:e}},this.getFreshValueHex=function(){var e=this.params,n=null;if(null==e)throw new Error("value not set");if("object"==typeof e&&null!=e.hex)return this.hV=e.hex,this.hV;if("number"==typeof e)n=new x(String(e),10);else if(null!=e.int)n=new x(String(e.int),10);else{if(null==e.bigint)throw new Error("wrong parameter");n=e.bigint}return this.hV=t(n),this.hV},null!=e&&(this.params=e)},et(ue.asn1.DERInteger,ue.asn1.ASN1Object),ue.asn1.DERBitString=function(e){if(void 0!==e&&void 0!==e.obj){var t=ue.asn1.ASN1Util.newObject(e.obj);e.hex="00"+t.tohex()}ue.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(e){this.hTLV=null,this.isModified=!0,this.hV=e},this.setUnusedBitsAndHexValue=function(e,t){if(e<0||7<e)throw"unused bits shall be from 0 to 7: u = "+e;var n="0"+e;this.hTLV=null,this.isModified=!0,this.hV=n+t},this.setByBinaryString=function(e){var t=8-(e=e.replace(/0+$/,"")).length%8;8==t&&(t=0),e+="0000000".substr(0,t);for(var n="",r=0;r<e.length-1;r+=8){var i=e.substr(r,8),o=parseInt(i,2).toString(16);1==o.length&&(o="0"+o),n+=o}this.hTLV=null,this.isModified=!0,this.hV="0"+t+n},this.setByBooleanArray=function(e){for(var t="",n=0;n<e.length;n++)1==e[n]?t+="1":t+="0";this.setByBinaryString(t)},this.newFalseArray=function(e){for(var t=new Array(e),n=0;n<e;n++)t[n]=!1;return t},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"==typeof e&&e.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(e):void 0!==e.hex?this.setHexValueIncludingUnusedBits(e.hex):void 0!==e.bin?this.setByBinaryString(e.bin):void 0!==e.array&&this.setByBooleanArray(e.array))},et(ue.asn1.DERBitString,ue.asn1.ASN1Object),ue.asn1.DEROctetString=function(e){if(void 0!==e&&void 0!==e.obj){var t=ue.asn1.ASN1Util.newObject(e.obj);e.hex=t.tohex()}ue.asn1.DEROctetString.superclass.constructor.call(this,e),this.hT="04"},et(ue.asn1.DEROctetString,ue.asn1.DERAbstractString),ue.asn1.DERNull=function(){ue.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},et(ue.asn1.DERNull,ue.asn1.ASN1Object),ue.asn1.DERObjectIdentifier=function(e){ue.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(e){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.setValueOidString=function(e){var t=ze(e);if(null==t)throw new Error("malformed oid string: "+e);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.setValueName=function(e){var t=ue.asn1.x509.OID.name2oid(e);if(""===t)throw new Error("DERObjectIdentifier oidName undefined: "+e);this.setValueOidString(t)},this.setValueNameOrOid=function(e){e.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(e):this.setValueName(e)},this.getFreshValueHex=function(){return this.hV},this.setByParam=function(e){"string"==typeof e?this.setValueNameOrOid(e):void 0!==e.oid?this.setValueNameOrOid(e.oid):void 0!==e.name?this.setValueNameOrOid(e.name):void 0!==e.hex&&this.setValueHex(e.hex)},void 0!==e&&this.setByParam(e)},et(ue.asn1.DERObjectIdentifier,ue.asn1.ASN1Object),ue.asn1.DEREnumerated=function(e){ue.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=ue.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new x(String(e),10);this.setByBigInteger(t)},this.setValueHex=function(e){this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&(void 0!==e.int?this.setByInteger(e.int):"number"==typeof e?this.setByInteger(e):void 0!==e.hex&&this.setValueHex(e.hex))},et(ue.asn1.DEREnumerated,ue.asn1.ASN1Object),ue.asn1.DERUTF8String=function(e){ue.asn1.DERUTF8String.superclass.constructor.call(this,e),this.hT="0c"},et(ue.asn1.DERUTF8String,ue.asn1.DERAbstractString),ue.asn1.DERNumericString=function(e){ue.asn1.DERNumericString.superclass.constructor.call(this,e),this.hT="12"},et(ue.asn1.DERNumericString,ue.asn1.DERAbstractString),ue.asn1.DERPrintableString=function(e){ue.asn1.DERPrintableString.superclass.constructor.call(this,e),this.hT="13"},et(ue.asn1.DERPrintableString,ue.asn1.DERAbstractString),ue.asn1.DERTeletexString=function(e){ue.asn1.DERTeletexString.superclass.constructor.call(this,e),this.hT="14"},et(ue.asn1.DERTeletexString,ue.asn1.DERAbstractString),ue.asn1.DERIA5String=function(e){ue.asn1.DERIA5String.superclass.constructor.call(this,e),this.hT="16"},et(ue.asn1.DERIA5String,ue.asn1.DERAbstractString),ue.asn1.DERVisibleString=function(e){ue.asn1.DERIA5String.superclass.constructor.call(this,e),this.hT="1a"},et(ue.asn1.DERVisibleString,ue.asn1.DERAbstractString),ue.asn1.DERBMPString=function(e){ue.asn1.DERBMPString.superclass.constructor.call(this,e),this.hT="1e"},et(ue.asn1.DERBMPString,ue.asn1.DERAbstractString),ue.asn1.DERUTCTime=function(e){ue.asn1.DERUTCTime.superclass.constructor.call(this,e),this.hT="17",this.params=void 0,this.getFreshValueHex=function(){var e=this.params;if(null==this.params&&(e={date:new Date}),"string"==typeof e){if(!e.match(/^[0-9]{12}Z$/)&&!e.match(/^[0-9]{12}\.[0-9]+Z$/))throw new Error("malformed string for UTCTime: "+e);this.hV=ge(e)}else if(null!=e.str)this.hV=ge(e.str);else if(null==e.date&&1==e.millis){var t=new Date;this.hV=ge(this.formatDate(t,"utc",!0))}else if(null!=e.date&&e.date instanceof Date){var n=!0===e.millis;this.hV=ge(this.formatDate(e.date,"utc",n))}else e instanceof Date&&(this.hV=ge(this.formatDate(e,"utc")));if(null==this.hV)throw new Error("parameter not specified properly for UTCTime");return this.hV},null!=e&&this.setByParam(e)},et(ue.asn1.DERUTCTime,ue.asn1.DERAbstractTime),ue.asn1.DERGeneralizedTime=function(e){ue.asn1.DERGeneralizedTime.superclass.constructor.call(this,e),this.hT="18",this.params=e,this.getFreshValueHex=function(){var e=this.params;if(null==this.params&&(e={date:new Date}),"string"==typeof e){if(!e.match(/^[0-9]{14}Z$/)&&!e.match(/^[0-9]{14}\.[0-9]+Z$/))throw new Error("malformed string for GeneralizedTime: "+e);this.hV=ge(e)}else if(null!=e.str)this.hV=ge(e.str);else if(null==e.date&&1==e.millis){var t=new Date;this.hV=ge(this.formatDate(t,"gen",!0))}else if(null!=e.date&&e.date instanceof Date){var n=!0===e.millis;this.hV=ge(this.formatDate(e.date,"gen",n))}else e instanceof Date&&(this.hV=ge(this.formatDate(e,"gen")));if(null==this.hV)throw new Error("parameter not specified properly for GeneralizedTime");return this.hV},null!=e&&this.setByParam(e)},et(ue.asn1.DERGeneralizedTime,ue.asn1.DERAbstractTime),ue.asn1.DERSequence=function(e){ue.asn1.DERSequence.superclass.constructor.call(this,e),this.hT="30",this.getFreshValueHex=function(){for(var e="",t=0;t<this.asn1Array.length;t++){e+=this.asn1Array[t].tohex()}return this.hV=e,this.hV}},et(ue.asn1.DERSequence,ue.asn1.DERAbstractStructured),ue.asn1.DERSet=function(e){ue.asn1.DERSet.superclass.constructor.call(this,e),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var e=new Array,t=0;t<this.asn1Array.length;t++){var n=this.asn1Array[t];e.push(n.tohex())}return 1==this.sortFlag&&e.sort(),this.hV=e.join(""),this.hV},void 0!==e&&void 0!==e.sortflag&&0==e.sortflag&&(this.sortFlag=!1)},et(ue.asn1.DERSet,ue.asn1.DERAbstractStructured),ue.asn1.DERTaggedObject=function(e){ue.asn1.DERTaggedObject.superclass.constructor.call(this);var t=ue.asn1,n=pe,r=n.getV,i=(n.isASN1HEX,t.ASN1Util.newObject);this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.params={tag:"a0",explicit:!0},this.setASN1Object=function(e,t,n){this.params={tag:t,explicit:e,obj:n}},this.getFreshValueHex=function(){var e=this.params;if(null==e.explicit&&(e.explicit=!0),null!=e.tage&&(e.tag=e.tage,e.explicit=!0),null!=e.tagi&&(e.tag=e.tagi,e.explicit=!1),null!=e.str)this.hV=we(e.str);else if(null!=e.hex)this.hV=e.hex;else{if(null==e.obj)throw new Error("str, hex nor obj not specified");var n;e.obj instanceof t.ASN1Object?n=e.obj.tohex():"object"==typeof e.obj&&(n=i(e.obj).tohex()),e.explicit?this.hV=n:this.hV=r(n,0)}return null==e.tag&&(e.tag="a0"),this.hT=e.tag,this.hTLV=null,this.isModified=!0,this.hV},this.setByParam=function(e){this.params=e},void 0!==e&&this.setByParam(e)},et(ue.asn1.DERTaggedObject,ue.asn1.ASN1Object);var ue,le,ce,pe=new function(){};function he(e){for(var t=new Array,n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}function de(e){for(var t="",n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t}function fe(e){for(var t="",n=0;n<e.length;n++){var r=e[n].toString(16);1==r.length&&(r="0"+r),t+=r}return t}function ge(e){return fe(he(e))}function me(e){return e=(e=(e=e.replace(/\=/g,"")).replace(/\+/g,"-")).replace(/\//g,"_")}function ve(e){return e.length%4==2?e+="==":e.length%4==3&&(e+="="),e=(e=e.replace(/-/g,"+")).replace(/_/g,"/")}function ye(e){return e.length%2==1&&(e="0"+e),me(y(e))}function be(e){return b(ve(e))}function we(e){return Oe(He(e)).toLowerCase()}function xe(e){try{return decodeURIComponent(ke(e))}catch(e){return null}}function Se(e){return xe(function(e){for(var t=e.match(/.{1,2}/g),n=[],r=0;r<t.length;r++){var i=parseInt(t[r],16);161<=i&&i<=191?(n.push("c2"),n.push(t[r])):192<=i&&i<=255?(n.push("c3"),n.push((i-64).toString(16))):n.push(t[r])}return n.join("")}(e))}function Ee(e){for(var t="",n=0;n<e.length-1;n+=2)t+=String.fromCharCode(parseInt(e.substr(n,2),16));return t}function Ae(e){for(var t="",n=0;n<e.length;n++)t+=("0"+e.charCodeAt(n).toString(16)).slice(-2);return t}function Fe(e){return y(e)}function Ce(e,t){return e=(e=e.replace(new RegExp("(.{"+t+"})","g"),"$1\r\n")).replace(/\s+$/,"")}function $e(e){return b(e.replace(/[^0-9A-Za-z\/+=]*/g,""))}function De(e,t){return"-----BEGIN "+t+"-----\r\n"+Ce(Fe(e),64)+"\r\n-----END "+t+"-----\r\n"}function Te(e,t){if(-1==e.indexOf("-----BEGIN "))throw new Error("can't find PEM header");return $e(e=void 0!==t?(e=e.replace(new RegExp("^[^]*-----BEGIN "+t+"-----"),"")).replace(new RegExp("-----END "+t+"-----[^]*$"),""):(e=e.replace(/^[^]*-----BEGIN [^-]+-----/,"")).replace(/-----END [^-]+-----[^]*$/,""))}function Ie(e){var t,n,r,i,o,a,s,u,l,c;if(c=(e=Pe(e)).match(/^(\d{4})(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(|\.\d+)Z$/))return t=parseInt(c[1]),n=parseInt(c[2])-1,r=parseInt(c[3]),i=parseInt(c[4]),o=parseInt(c[5]),a=parseInt(c[6]),s=0,""!==(u=c[7])&&(l=(u.substr(1)+"00").substr(0,3),s=parseInt(l)),Date.UTC(t,n,r,i,o,a,s);throw new Error("unsupported zulu format: "+e)}function Re(e){return Math.round(Ie(e)/1e3)}function Pe(e){return e.match(/^[0-9]{12}Z$/)||e.match(/^[0-9]{12}[.][0-9]*Z$/)?e.match(/^[0-4]/)?"20"+e:"19"+e:e}function Oe(e){return e.replace(/%/g,"")}function ke(e){return e.replace(/(..)/g,"%$1")}function _e(e){var t="malformed IPv6 address";if(!e.match(/^[0-9A-Fa-f:]+$/))throw t;var n=(e=e.toLowerCase()).split(":").length-1;if(n<2)throw t;var r=":".repeat(7-n+2),i=(e=e.replace("::",r)).split(":");if(8!=i.length)throw t;for(var o=0;o<8;o++)i[o]=("0000"+i[o]).slice(-4);return i.join("")}function je(e){if(!e.match(/^[0-9A-Fa-f]{32}$/))throw new Error("malformed IPv6 address: "+e);var t=(e=e.toLowerCase()).match(/.{1,4}/g),n=(e=":"+(t=(t=t.map((function(e){return e.replace(/^0+/,"")}))).map((function(e){return""==e?"0":e}))).join(":")+":").match(/:(0:){2,}/g);if(null==n)return e.slice(1,-1);var r=n.sort().slice(-1)[0];return"::"!=(e=e.replace(r.substr(0,r.length-1),":")).substr(0,2)&&(e=e.substr(1)),"::"!=e.substr(-2,2)&&(e=e.substr(0,e.length-1)),e}function Ne(e){var t=new Error("malformed hex value");if(!e.match(/^([0-9A-Fa-f][0-9A-Fa-f]){1,}$/))throw t;if(8==e.length){try{return parseInt(e.substr(0,2),16)+"."+parseInt(e.substr(2,2),16)+"."+parseInt(e.substr(4,2),16)+"."+parseInt(e.substr(6,2),16)}catch(e){throw t}}else{if(16!=e.length){if(32==e.length)return je(e);if(64==e.length){try{return je(e.substr(0,32))+"/"+Le(e.substr(32))}catch(e){throw t}return}return e}try{return Ne(e.substr(0,8))+"/"+Le(e.substr(8))}catch(e){throw t}}}function Le(e){var t,n=new Error("malformed mask");try{t=new x(e,16).toString(2)}catch(e){throw n}if(!t.match(/^1*0*$/))throw n;return t.replace(/0+$/,"").length}function Be(e){var t=new Error("malformed IP address");if(!(e=e.toLowerCase(e)).match(/^[0-9a-f.:/]+$/))throw t;if(!e.match(/^[0-9.]+$/)){var n;if(e.match(/^[0-9.]+\/[0-9]+$/))return Be((n=e.split("/"))[0])+Ue(parseInt(n[1]),32);if(e.match(/^[0-9a-f:]+$/)&&-1!==e.indexOf(":"))return _e(e);if(e.match(/^[0-9a-f:]+\/[0-9]+$/)&&-1!==e.indexOf(":"))return _e((n=e.split("/"))[0])+Ue(parseInt(n[1]),128);throw t}var r=e.split(".");if(4!==r.length)throw t;var i="";try{for(var o=0;o<4;o++){i+=("0"+parseInt(r[o]).toString(16)).slice(-2)}return i}catch(e){throw t}}function Ue(e,t){return 32==t&&0==e?"00000000":128==t&&0==e?"00000000000000000000000000000000":new x(Array(e+1).join("1")+Array(t-e+1).join("0"),2).toString(16)}function Me(e){return e.match(/.{4}/g).map((function(e){var t=parseInt(e.substr(0,2),16),n=parseInt(e.substr(2),16);if(0==t&n<128)return String.fromCharCode(n);if(t<8){var r=128|63&n;return xe((192|(7&t)<<3|(192&n)>>6).toString(16)+r.toString(16))}r=128|(15&t)<<2|(192&n)>>6;var i=128|63&n;return xe((224|(240&t)>>4).toString(16)+r.toString(16)+i.toString(16))})).join("")}function He(e){for(var t=encodeURIComponent(e),n="",r=0;r<t.length;r++)"%"==t[r]?(n+=t.substr(r,3),r+=2):n=n+"%"+ge(t[r]);return n}function Ve(e){return!(e.length%2!=0||!e.match(/^[0-9a-f]+$/)&&!e.match(/^[0-9A-F]+$/))}function qe(e){return!!e.match(/^[0-9A-Za-z-_.]+$/)}function Ke(e){return e.length%2==1?"0"+e:e.substr(0,1)>"7"?"00"+e:e}pe.getLblen=function(e,t){if("8"!=e.substr(t+2,1))return 1;var n=parseInt(e.substr(t+3,1));return 0==n?-1:0<n&&n<10?n+1:-2},pe.getL=function(e,t){var n=pe.getLblen(e,t);return n<1?"":e.substr(t+2,2*n)},pe.getVblen=function(e,t){var n;return""==(n=pe.getL(e,t))?-1:("8"===n.substr(0,1)?new x(n.substr(2),16):new x(n,16)).intValue()},pe.getVidx=function(e,t){var n=pe.getLblen(e,t);return n<0?n:t+2*(n+1)},pe.getV=function(e,t){var n=pe.getVidx(e,t),r=pe.getVblen(e,t);return e.substr(n,2*r)},pe.getTLV=function(e,t){return e.substr(t,2)+pe.getL(e,t)+pe.getV(e,t)},pe.getTLVblen=function(e,t){return 2+2*pe.getLblen(e,t)+2*pe.getVblen(e,t)},pe.getNextSiblingIdx=function(e,t){return pe.getVidx(e,t)+2*pe.getVblen(e,t)},pe.getChildIdx=function(e,t){var n,r,i,o=pe,a=[];n=o.getVidx(e,t),r=2*o.getVblen(e,t),"03"==e.substr(t,2)&&(n+=2,r-=2),i=0;for(var s=n;i<=r;){var u=o.getTLVblen(e,s);if((i+=u)<=r&&a.push(s),s+=u,i>=r)break}return a},pe.getNthChildIdx=function(e,t,n){return pe.getChildIdx(e,t)[n]},pe.getIdxbyList=function(e,t,n,r){var i,o,a=pe;return 0==n.length?void 0!==r&&e.substr(t,2)!==r?-1:t:(i=n.shift())>=(o=a.getChildIdx(e,t)).length?-1:a.getIdxbyList(e,o[i],n,r)},pe.getIdxbyListEx=function(e,t,n,r){var i,o,a=pe;if(0==n.length)return void 0!==r&&e.substr(t,2)!==r?-1:t;i=n.shift(),o=a.getChildIdx(e,t);for(var s=0,u=0;u<o.length;u++){var l=e.substr(o[u],2);if("number"==typeof i&&!a.isContextTag(l)&&s==i||"string"==typeof i&&a.isContextTag(l,i))return a.getIdxbyListEx(e,o[u],n,r);a.isContextTag(l)||s++}return-1},pe.getTLVbyList=function(e,t,n,r){var i=pe,o=i.getIdxbyList(e,t,n,r);return-1==o||o>=e.length?null:i.getTLV(e,o)},pe.getTLVbyListEx=function(e,t,n,r){var i=pe,o=i.getIdxbyListEx(e,t,n,r);return-1==o?null:i.getTLV(e,o)},pe.getVbyList=function(e,t,n,r,i){var o,a,s=pe;return-1==(o=s.getIdxbyList(e,t,n,r))||o>=e.length?null:(a=s.getV(e,o),!0===i&&(a=a.substr(2)),a)},pe.getVbyListEx=function(e,t,n,r,i){var o,a,s=pe;return-1==(o=s.getIdxbyListEx(e,t,n,r))?null:(a=s.getV(e,o),"03"==e.substr(o,2)&&!1!==i&&(a=a.substr(2)),a)},pe.getInt=function(e,t,n){null==n&&(n=-1);try{var r=e.substr(t,2);if("02"!=r&&"03"!=r)return n;var i=pe.getV(e,t);return"02"==r?parseInt(i,16):Ye(i)}catch(e){return n}},pe.getOID=function(e,t,n){null==n&&(n=null);try{return"06"!=e.substr(t,2)?n:Ge(pe.getV(e,t))}catch(e){return n}},pe.getOIDName=function(e,t,n){null==n&&(n=null);try{var r=pe.getOID(e,t,n);if(r==n)return n;var i=ue.asn1.x509.OID.oid2name(r);return""==i?r:i}catch(e){return n}},pe.getString=function(e,t,n){null==n&&(n=null);try{return Ee(pe.getV(e,t))}catch(e){return n}},pe.hextooidstr=function(e){var t=function(e,t){return e.length>=t?e:new Array(t-e.length+1).join("0")+e},n=[],r=e.substr(0,2),i=parseInt(r,16);n[0]=new String(Math.floor(i/40)),n[1]=new String(i%40);for(var o=e.substr(2),a=[],s=0;s<o.length/2;s++)a.push(parseInt(o.substr(2*s,2),16));var u=[],l="";for(s=0;s<a.length;s++)128&a[s]?l+=t((127&a[s]).toString(2),7):(l+=t((127&a[s]).toString(2),7),u.push(new String(parseInt(l,2))),l="");var c=n.join(".");return u.length>0&&(c=c+"."+u.join(".")),c},pe.dump=function(e,t,n,r){var i=pe,o=i.getV,a=i.dump,s=i.getChildIdx,u=e;e instanceof ue.asn1.ASN1Object&&(u=e.tohex());var l=function(e,t){return e.length<=2*t?e:e.substr(0,t)+"..(total "+e.length/2+"bytes).."+e.substr(e.length-t,t)};void 0===t&&(t={ommit_long_octet:32}),void 0===n&&(n=0),void 0===r&&(r="");var c,p=t.ommit_long_octet;if("01"==(c=u.substr(n,2)))return"00"==(h=o(u,n))?r+"BOOLEAN FALSE\n":r+"BOOLEAN TRUE\n";if("02"==c)return r+"INTEGER "+l(h=o(u,n),p)+"\n";if("03"==c){var h=o(u,n);if(i.isASN1HEX(h.substr(2))){var d=r+"BITSTRING, encapsulates\n";return d+=a(h.substr(2),t,0,r+" ")}return r+"BITSTRING "+l(h,p)+"\n"}if("04"==c){h=o(u,n);if(i.isASN1HEX(h)){d=r+"OCTETSTRING, encapsulates\n";return d+=a(h,t,0,r+" ")}return r+"OCTETSTRING "+l(h,p)+"\n"}if("05"==c)return r+"NULL\n";if("06"==c){var f=o(u,n),g=ue.asn1.ASN1Util.oidHexToInt(f),m=ue.asn1.x509.OID.oid2name(g),v=g.replace(/\./g," ");return""!=m?r+"ObjectIdentifier "+m+" ("+v+")\n":r+"ObjectIdentifier ("+v+")\n"}if("0a"==c)return r+"ENUMERATED "+parseInt(o(u,n))+"\n";if("0c"==c)return r+"UTF8String '"+xe(o(u,n))+"'\n";if("13"==c)return r+"PrintableString '"+xe(o(u,n))+"'\n";if("14"==c)return r+"TeletexString '"+xe(o(u,n))+"'\n";if("16"==c)return r+"IA5String '"+xe(o(u,n))+"'\n";if("17"==c)return r+"UTCTime "+xe(o(u,n))+"\n";if("18"==c)return r+"GeneralizedTime "+xe(o(u,n))+"\n";if("1a"==c)return r+"VisualString '"+xe(o(u,n))+"'\n";if("1e"==c)return r+"BMPString '"+Me(o(u,n))+"'\n";if("30"==c){if("3000"==u.substr(n,4))return r+"SEQUENCE {}\n";d=r+"SEQUENCE\n";var y=t;if((2==(x=s(u,n)).length||3==x.length)&&"06"==u.substr(x[0],2)&&"04"==u.substr(x[x.length-1],2)){m=i.oidname(o(u,x[0]));var b=JSON.parse(JSON.stringify(t));b.x509ExtName=m,y=b}for(var w=0;w<x.length;w++)d+=a(u,y,x[w],r+" ");return d}if("31"==c){d=r+"SET\n";var x=s(u,n);for(w=0;w<x.length;w++)d+=a(u,t,x[w],r+" ");return d}if(0!=(128&(c=parseInt(c,16)))){var S=31&c;if(0!=(32&c)){for(d=r+"["+S+"]\n",x=s(u,n),w=0;w<x.length;w++)d+=a(u,t,x[w],r+" ");return d}h=o(u,n);if(pe.isASN1HEX(h)){var d=r+"["+S+"]\n";return d+=a(h,t,0,r+" ")}return("68747470"==h.substr(0,8)||"subjectAltName"===t.x509ExtName&&2==S)&&(h=xe(h)),d=r+"["+S+"] "+h+"\n"}return r+"UNKNOWN("+c+") "+o(u,n)+"\n"},pe.parse=function(e){var t=pe,n=t.parse,r=t.isASN1HEX,i=t.getV,o=t.getTLV,a=t.getChildIdx,s=ue.asn1,u=s.ASN1Util.oidHexToInt,l=s.x509.OID.oid2name,c=xe,p=Me,h=Se,d={"0c":"utf8str",12:"numstr",13:"prnstr",14:"telstr",16:"ia5str",17:"utctime",18:"gentime","1a":"visstr","1e":"bmpstr",30:"seq",31:"set"},f=e.substr(0,2),g={},m=i(e,0);if("01"==f)return"0101ff"==e?{bool:!0}:{bool:!1};if("02"==f)return{int:{hex:m}};if("03"==f)try{if("00"!=m.substr(0,2))throw"not encap";var v=m.substr(2);if(!r(v))throw"not encap";return{bitstr:{obj:n(v)}}}catch(e){var y=null;return m.length<=10&&(y=Je(m)),null==y?{bitstr:{hex:m}}:{bitstr:{bin:y}}}else if("04"==f)try{if(!r(m))throw"not encap";return{octstr:{obj:n(m)}}}catch(e){return{octstr:{hex:m}}}else{if("05"==f)return{null:""};if("06"==f){var b=u(m),w=l(b);return""==w?{oid:b}:{oid:w}}if("0a"==f)return m.length>4?{enum:{hex:m}}:{enum:parseInt(m,16)};if("30"==f||"31"==f)return g[d[f]]=function(e){for(var t=[],r=a(e,0),i=0;i<r.length;i++){var s=r[i],u=o(e,s),l=n(u);t.push(l)}return t}(e),g;if("14"==f){var x=h(m);return g[d[f]]={str:x},g}if("1e"==f){x=p(m);return g[d[f]]={str:x},g}if(-1!=":0c:12:13:16:17:18:1a:".indexOf(f)){x=c(m);return g[d[f]]={str:x},g}if(f.match(/^8[0-9]$/))return null==(x=c(m))|""==x||null!=x.match(/[\x00-\x1F\x7F-\x9F]/)||null!=x.match(/[\u0000-\u001F\u0080–\u009F]/)?{tag:{tag:f,explicit:!1,hex:m}}:{tag:{tag:f,explicit:!1,str:x}};if(!f.match(/^a[0-9]$/)){var S=new ue.asn1.ASN1Object;return S.hV=m,{asn1:{tlv:f+S.getLengthHexFromValue()+m}}}try{if(!r(m))throw new Error("not encap");return{tag:{tag:f,explicit:!0,obj:n(m)}}}catch(e){return{tag:{tag:f,explicit:!0,hex:m}}}}},pe.isContextTag=function(e,t){var n,r;e=e.toLowerCase();try{n=parseInt(e,16)}catch(e){return-1}if(void 0===t)return 128==(192&n);try{return null!=t.match(/^\[[0-9]+\]$/)&&(!((r=parseInt(t.substr(1,t.length-1),10))>31)&&(128==(192&n)&&(31&n)==r))}catch(e){return!1}},pe.isASN1HEX=function(e){var t=pe;if(e.length%2==1)return!1;var n=t.getVblen(e,0),r=e.substr(0,2),i=t.getL(e,0);return e.length-r.length-i.length==2*n},pe.checkStrictDER=function(e,t,n,r,i){var o=pe;if(void 0===n){if("string"!=typeof e)throw new Error("not hex string");if(e=e.toLowerCase(),!ue.lang.String.isHex(e))throw new Error("not hex string");n=e.length,i=(r=e.length/2)<128?1:Math.ceil(r.toString(16))+1}if(o.getL(e,t).length>2*i)throw new Error("L of TLV too long: idx="+t);var a=o.getVblen(e,t);if(a>r)throw new Error("value of L too long than hex: idx="+t);var s=o.getTLV(e,t),u=s.length-2-o.getL(e,t).length;if(u!==2*a)throw new Error("V string length and L's value not the same:"+u+"/"+2*a);if(0===t&&e.length!=s.length)throw new Error("total length and TLV length unmatch:"+e.length+"!="+s.length);var l=e.substr(t,2);if("02"===l){var c=o.getVidx(e,t);if("00"==e.substr(c,2)&&e.charCodeAt(c+2)<56)throw new Error("not least zeros for DER INTEGER")}if(32&parseInt(l,16)){for(var p=o.getVblen(e,t),h=0,d=o.getChildIdx(e,t),f=0;f<d.length;f++){h+=o.getTLV(e,d[f]).length,o.checkStrictDER(e,d[f],n,r,i)}if(2*p!=h)throw new Error("sum of children's TLV length and L unmatch: "+2*p+"!="+h)}},pe.oidname=function(e){var t=ue.asn1;ue.lang.String.isHex(e)&&(e=t.ASN1Util.oidHexToInt(e));var n=t.x509.OID.oid2name(e);return""===n&&(n=e),n},void 0!==ue&&ue||(ue={}),void 0!==ue.asn1&&ue.asn1||(ue.asn1={}),void 0!==ue.asn1.x509&&ue.asn1.x509||(ue.asn1.x509={}),ue.asn1.x509.Certificate=function(e){ue.asn1.x509.Certificate.superclass.constructor.call(this);var t=ue.asn1,n=t.DERBitString,r=t.DERSequence,i=t.x509,o=i.TBSCertificate,a=i.AlgorithmIdentifier;this.params=void 0,this.setByParam=function(e){this.params=e},this.sign=function(){var e=this.params,t=e.sigalg;null!=e.sigalg.name&&(t=e.sigalg.name);var n=e.tbsobj.tohex(),r=new ue.crypto.Signature({alg:t});r.init(e.cakey),r.updateHex(n),e.sighex=r.sign()},this.getPEM=function(){return De(this.tohex(),"CERTIFICATE")},this.tohex=function(){var e=this.params;if(null!=e.tbsobj&&null!=e.tbsobj||(e.tbsobj=new o(e)),null==e.sighex&&null!=e.cakey&&this.sign(),null==e.sighex)throw new Error("sighex or cakey parameter not defined");var t=[];return t.push(e.tbsobj),t.push(new a({name:e.sigalg})),t.push(new n({hex:"00"+e.sighex})),new r({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&(this.params=e)},et(ue.asn1.x509.Certificate,ue.asn1.ASN1Object),ue.asn1.x509.TBSCertificate=function(e){ue.asn1.x509.TBSCertificate.superclass.constructor.call(this);var t=ue.asn1,n=t.x509,r=t.DERTaggedObject,i=t.DERInteger,o=t.DERSequence,a=n.AlgorithmIdentifier,s=n.Time,u=n.X500Name,l=n.Extensions,c=n.SubjectPublicKeyInfo;this.params=null,this.setByParam=function(e){this.params=e},this.tohex=function(){var e=[],t=this.params;if(null!=t.version||1!=t.version){var n=2;null!=t.version&&(n=t.version-1);var p=new r({obj:new i({int:n})});e.push(p)}return e.push(new i(t.serial)),e.push(new a({name:t.sigalg})),e.push(new u(t.issuer)),e.push(new o({array:[new s(t.notbefore),new s(t.notafter)]})),e.push(new u(t.subject)),e.push(new c(tt.getKey(t.sbjpubkey))),void 0!==t.ext&&t.ext.length>0&&e.push(new r({tag:"a3",obj:new l(t.ext)})),new ue.asn1.DERSequence({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},et(ue.asn1.x509.TBSCertificate,ue.asn1.ASN1Object),ue.asn1.x509.Extensions=function(e){ue.asn1.x509.Extensions.superclass.constructor.call(this);var t=ue.asn1,n=t.DERSequence,r=t.x509;this.aParam=[],this.setByParam=function(e){this.aParam=e},this.tohex=function(){for(var e=[],t=0;t<this.aParam.length;t++){var i=this.aParam[t],o=i.extname,a=null;if(null!=i.extn)a=new r.PrivateExtension(i);else if("subjectKeyIdentifier"==o)a=new r.SubjectKeyIdentifier(i);else if("keyUsage"==o)a=new r.KeyUsage(i);else if("subjectAltName"==o)a=new r.SubjectAltName(i);else if("issuerAltName"==o)a=new r.IssuerAltName(i);else if("basicConstraints"==o)a=new r.BasicConstraints(i);else if("nameConstraints"==o)a=new r.NameConstraints(i);else if("cRLDistributionPoints"==o)a=new r.CRLDistributionPoints(i);else if("certificatePolicies"==o)a=new r.CertificatePolicies(i);else if("policyMappings"==o)a=new r.PolicyMappings(i);else if("policyConstraints"==o)a=new r.PolicyConstraints(i);else if("inhibitAnyPolicy"==o)a=new r.InhibitAnyPolicy(i);else if("authorityKeyIdentifier"==o)a=new r.AuthorityKeyIdentifier(i);else if("extKeyUsage"==o)a=new r.ExtKeyUsage(i);else if("authorityInfoAccess"==o)a=new r.AuthorityInfoAccess(i);else if("cRLNumber"==o)a=new r.CRLNumber(i);else if("cRLReason"==o)a=new r.CRLReason(i);else if("ocspNonce"==o)a=new r.OCSPNonce(i);else if("ocspNoCheck"==o)a=new r.OCSPNoCheck(i);else if("adobeTimeStamp"==o)a=new r.AdobeTimeStamp(i);else{if("subjectDirectoryAttributes"!=o)throw new Error("extension not supported:"+JSON.stringify(i));a=new r.SubjectDirectoryAttributes(i)}null!=a&&e.push(a)}return new n({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(ue.asn1.x509.Extensions,ue.asn1.ASN1Object),ue.asn1.x509.Extension=function(e){ue.asn1.x509.Extension.superclass.constructor.call(this);var t=ue.asn1,n=t.DERObjectIdentifier,r=t.DEROctetString,i=(t.DERBitString,t.DERBoolean),o=t.DERSequence;this.tohex=function(){var e=new n({oid:this.oid}),t=new r({hex:this.getExtnValueHex()}),a=new Array;return a.push(e),this.critical&&a.push(new i),a.push(t),new o({array:a}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.critical=!1,void 0!==e&&void 0!==e.critical&&(this.critical=e.critical)},et(ue.asn1.x509.Extension,ue.asn1.ASN1Object),ue.asn1.x509.KeyUsage=function(e){ue.asn1.x509.KeyUsage.superclass.constructor.call(this,e);var t=Error,n={digitalSignature:0,nonRepudiation:1,keyEncipherment:2,dataEncipherment:3,keyAgreement:4,keyCertSign:5,cRLSign:6,encipherOnly:7,decipherOnly:8};this.getExtnValueHex=function(){var e=this.getBinValue();return this.asn1ExtnValue=new ue.asn1.DERBitString({bin:e}),this.asn1ExtnValue.tohex()},this.getBinValue=function(){var e=this.params;if("object"!=typeof e||"object"!=typeof e.names&&"string"!=typeof e.bin)throw new t("parameter not yet set");if(null!=e.names)return Ze(e.names,n);if(null!=e.bin)return e.bin;throw new t("parameter not set properly")},this.oid="2.5.29.15",void 0!==e&&(this.params=e)},et(ue.asn1.x509.KeyUsage,ue.asn1.x509.Extension),ue.asn1.x509.BasicConstraints=function(e){ue.asn1.x509.BasicConstraints.superclass.constructor.call(this,e);var t=ue.asn1,n=t.DERBoolean,r=t.DERInteger,i=t.DERSequence;this.getExtnValueHex=function(){var e=new Array;this.cA&&e.push(new n),this.pathLen>-1&&e.push(new r({int:this.pathLen}));var t=new i({array:e});return this.asn1ExtnValue=t,this.asn1ExtnValue.tohex()},this.oid="2.5.29.19",this.cA=!1,this.pathLen=-1,void 0!==e&&(void 0!==e.cA&&(this.cA=e.cA),void 0!==e.pathLen&&(this.pathLen=e.pathLen))},et(ue.asn1.x509.BasicConstraints,ue.asn1.x509.Extension),ue.asn1.x509.CRLDistributionPoints=function(e){ue.asn1.x509.CRLDistributionPoints.superclass.constructor.call(this,e);var t=ue.asn1,n=t.x509;this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.setByDPArray=function(e){for(var r=[],i=0;i<e.length;i++)if(e[i]instanceof ue.asn1.ASN1Object)r.push(e[i]);else{var o=new n.DistributionPoint(e[i]);r.push(o)}this.asn1ExtnValue=new t.DERSequence({array:r})},this.setByOneURI=function(e){var t=new n.DistributionPoint({fulluri:e});this.setByDPArray([t])},this.oid="2.5.29.31",void 0!==e&&(void 0!==e.array?this.setByDPArray(e.array):void 0!==e.uri&&this.setByOneURI(e.uri))},et(ue.asn1.x509.CRLDistributionPoints,ue.asn1.x509.Extension),ue.asn1.x509.DistributionPoint=function(e){ue.asn1.x509.DistributionPoint.superclass.constructor.call(this);var t=ue.asn1,n=t.x509.DistributionPointName;this.tohex=function(){var e=new t.DERSequence;if(null!=this.asn1DP){var n=new t.DERTaggedObject({explicit:!0,tag:"a0",obj:this.asn1DP});e.appendASN1Object(n)}return this.hTLV=e.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&(void 0!==e.dpobj?this.asn1DP=e.dpobj:void 0!==e.dpname?this.asn1DP=new n(e.dpname):void 0!==e.fulluri&&(this.asn1DP=new n({full:[{uri:e.fulluri}]})))},et(ue.asn1.x509.DistributionPoint,ue.asn1.ASN1Object),ue.asn1.x509.DistributionPointName=function(e){ue.asn1.x509.DistributionPointName.superclass.constructor.call(this);var t=ue.asn1,n=t.DERTaggedObject;if(this.tohex=function(){if("full"!=this.type)throw new Error("currently type shall be 'full': "+this.type);return this.asn1Obj=new n({explicit:!1,tag:this.tag,obj:this.asn1V}),this.hTLV=this.asn1Obj.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==e)if(t.x509.GeneralNames.prototype.isPrototypeOf(e))this.type="full",this.tag="a0",this.asn1V=e;else{if(void 0===e.full)throw new Error("This class supports GeneralNames only as argument");this.type="full",this.tag="a0",this.asn1V=new t.x509.GeneralNames(e.full)}},et(ue.asn1.x509.DistributionPointName,ue.asn1.ASN1Object),ue.asn1.x509.CertificatePolicies=function(e){ue.asn1.x509.CertificatePolicies.superclass.constructor.call(this,e);var t=ue.asn1,n=t.x509,r=t.DERSequence,i=n.PolicyInformation;this.params=null,this.getExtnValueHex=function(){for(var e=[],t=0;t<this.params.array.length;t++)e.push(new i(this.params.array[t]));var n=new r({array:e});return this.asn1ExtnValue=n,this.asn1ExtnValue.tohex()},this.oid="2.5.29.32",void 0!==e&&(this.params=e)},et(ue.asn1.x509.CertificatePolicies,ue.asn1.x509.Extension),ue.asn1.x509.PolicyInformation=function(e){ue.asn1.x509.PolicyInformation.superclass.constructor.call(this,e);var t=ue.asn1,n=t.DERSequence,r=t.DERObjectIdentifier,i=t.x509.PolicyQualifierInfo;this.params=null,this.tohex=function(){if(void 0===this.params.policyoid&&void 0===this.params.array)throw new Error("parameter oid and array missing");var e=[new r(this.params.policyoid)];if(void 0!==this.params.array){for(var t=[],o=0;o<this.params.array.length;o++)t.push(new i(this.params.array[o]));t.length>0&&e.push(new n({array:t}))}return new n({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&(this.params=e)},et(ue.asn1.x509.PolicyInformation,ue.asn1.ASN1Object),ue.asn1.x509.PolicyQualifierInfo=function(e){ue.asn1.x509.PolicyQualifierInfo.superclass.constructor.call(this,e);var t=ue.asn1,n=t.DERSequence,r=t.DERIA5String,i=t.DERObjectIdentifier,o=t.x509.UserNotice;this.params=null,this.tohex=function(){return void 0!==this.params.cps?new n({array:[new i({oid:"1.3.6.1.5.5.7.2.1"}),new r({str:this.params.cps})]}).tohex():null!=this.params.unotice?new n({array:[new i({oid:"1.3.6.1.5.5.7.2.2"}),new o(this.params.unotice)]}).tohex():void 0},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&(this.params=e)},et(ue.asn1.x509.PolicyQualifierInfo,ue.asn1.ASN1Object),ue.asn1.x509.UserNotice=function(e){ue.asn1.x509.UserNotice.superclass.constructor.call(this,e);var t=ue.asn1.DERSequence,n=(ue.asn1.DERInteger,ue.asn1.x509.DisplayText),r=ue.asn1.x509.NoticeReference;this.params=null,this.tohex=function(){var e=[];return void 0!==this.params.noticeref&&e.push(new r(this.params.noticeref)),void 0!==this.params.exptext&&e.push(new n(this.params.exptext)),new t({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&(this.params=e)},et(ue.asn1.x509.UserNotice,ue.asn1.ASN1Object),ue.asn1.x509.NoticeReference=function(e){ue.asn1.x509.NoticeReference.superclass.constructor.call(this,e);var t=ue.asn1.DERSequence,n=ue.asn1.DERInteger,r=ue.asn1.x509.DisplayText;this.params=null,this.tohex=function(){var e=[];if(void 0!==this.params.org&&e.push(new r(this.params.org)),void 0!==this.params.noticenum){for(var i=[],o=this.params.noticenum,a=0;a<o.length;a++)i.push(new n(o[a]));e.push(new t({array:i}))}if(0==e.length)throw new Error("parameter is empty");return new t({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&(this.params=e)},et(ue.asn1.x509.NoticeReference,ue.asn1.ASN1Object),ue.asn1.x509.DisplayText=function(e){ue.asn1.x509.DisplayText.superclass.constructor.call(this,e),this.hT="0c",void 0!==e&&("ia5"===e.type?this.hT="16":"vis"===e.type?this.hT="1a":"bmp"===e.type&&(this.hT="1e"))},et(ue.asn1.x509.DisplayText,ue.asn1.DERAbstractString),ue.asn1.x509.PolicyMappings=function(e){ue.asn1.x509.PolicyMappings.superclass.constructor.call(this,e);var t=ue.asn1,n=(t.x509,t.ASN1Util.newObject);this.params=null,this.getExtnValueHex=function(){for(var e=this.params,t=[],r=0;r<e.array.length;r++){var i=e.array[r];t.push({seq:[{oid:i[0]},{oid:i[1]}]})}return this.asn1ExtnValue=n({seq:t}),this.asn1ExtnValue.tohex()},this.oid="2.5.29.33",void 0!==e&&(this.params=e)},et(ue.asn1.x509.PolicyMappings,ue.asn1.x509.Extension),ue.asn1.x509.PolicyConstraints=function(e){ue.asn1.x509.PolicyConstraints.superclass.constructor.call(this,e);var t=ue.asn1,n=(t.x509,t.ASN1Util.newObject);this.params=null,this.getExtnValueHex=function(){var e=this.params,t=[];return null!=e.reqexp&&t.push({tag:{tagi:"80",obj:{int:e.reqexp}}}),null!=e.inhibit&&t.push({tag:{tagi:"81",obj:{int:e.inhibit}}}),this.asn1ExtnValue=n({seq:t}),this.asn1ExtnValue.tohex()},this.oid="2.5.29.36",void 0!==e&&(this.params=e)},et(ue.asn1.x509.PolicyConstraints,ue.asn1.x509.Extension),ue.asn1.x509.InhibitAnyPolicy=function(e){ue.asn1.x509.InhibitAnyPolicy.superclass.constructor.call(this,e);var t=ue.asn1,n=(t.x509,t.ASN1Util.newObject);this.params=null,this.getExtnValueHex=function(){return this.asn1ExtnValue=n({int:this.params.skip}),this.asn1ExtnValue.tohex()},this.oid="2.5.29.54",void 0!==e&&(this.params=e)},et(ue.asn1.x509.InhibitAnyPolicy,ue.asn1.x509.Extension),ue.asn1.x509.NameConstraints=function(e){ue.asn1.x509.NameConstraints.superclass.constructor.call(this,e);var t=ue.asn1,n=t.x509,r=t.ASN1Util.newObject,i=n.GeneralSubtree;this.params=null,this.getExtnValueHex=function(){var e=this.params,t=[];if(null!=e.permit&&null!=e.permit.length){for(var n=[],o=0;o<e.permit.length;o++)n.push(new i(e.permit[o]));t.push({tag:{tagi:"a0",obj:{seq:n}}})}if(null!=e.exclude&&null!=e.exclude.length){var a=[];for(o=0;o<e.exclude.length;o++)a.push(new i(e.exclude[o]));t.push({tag:{tagi:"a1",obj:{seq:a}}})}return this.asn1ExtnValue=r({seq:t}),this.asn1ExtnValue.tohex()},this.oid="2.5.29.30",void 0!==e&&(this.params=e)},et(ue.asn1.x509.NameConstraints,ue.asn1.x509.Extension),ue.asn1.x509.GeneralSubtree=function(e){ue.asn1.x509.GeneralSubtree.superclass.constructor.call(this);var t=ue.asn1,n=t.x509.GeneralName,r=t.ASN1Util.newObject;this.params=null,this.setByParam=function(e){this.params=e},this.tohex=function(){var e=this.params,t=[new n(e)];return null!=e.min&&t.push({tag:{tagi:"80",obj:{int:e.min}}}),null!=e.max&&t.push({tag:{tagi:"81",obj:{int:e.max}}}),r({seq:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},et(ue.asn1.x509.GeneralSubtree,ue.asn1.ASN1Object),ue.asn1.x509.ExtKeyUsage=function(e){ue.asn1.x509.ExtKeyUsage.superclass.constructor.call(this,e);var t=ue.asn1;this.setPurposeArray=function(e){this.asn1ExtnValue=new t.DERSequence;for(var n=0;n<e.length;n++){var r=new t.DERObjectIdentifier(e[n]);this.asn1ExtnValue.appendASN1Object(r)}},this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.oid="2.5.29.37",void 0!==e&&void 0!==e.array&&this.setPurposeArray(e.array)},et(ue.asn1.x509.ExtKeyUsage,ue.asn1.x509.Extension),ue.asn1.x509.AuthorityKeyIdentifier=function(e){ue.asn1.x509.AuthorityKeyIdentifier.superclass.constructor.call(this,e);var t=ue,n=t.asn1,r=n.DERTaggedObject,i=n.x509.GeneralNames;t.crypto.Util.isKey;this.asn1KID=null,this.asn1CertIssuer=null,this.asn1CertSN=null,this.getExtnValueHex=function(){var e=new Array;this.asn1KID&&e.push(new r({explicit:!1,tag:"80",obj:this.asn1KID})),this.asn1CertIssuer&&e.push(new r({explicit:!1,tag:"a1",obj:new i([{dn:this.asn1CertIssuer}])})),this.asn1CertSN&&e.push(new r({explicit:!1,tag:"82",obj:this.asn1CertSN}));var t=new n.DERSequence({array:e});return this.asn1ExtnValue=t,this.asn1ExtnValue.tohex()},this.setKIDByParam=function(e){if(void 0!==e.str||void 0!==e.hex)this.asn1KID=new ue.asn1.DEROctetString(e);else if("object"==typeof e&&ue.crypto.Util.isKey(e)||"string"==typeof e&&-1!=e.indexOf("BEGIN ")){var t=e;"string"==typeof e&&(t=tt.getKey(e));var n=tt.getKeyID(t);this.asn1KID=new ue.asn1.DEROctetString({hex:n})}},this.setCertIssuerByParam=function(e){void 0!==e.str||void 0!==e.ldapstr||void 0!==e.hex||void 0!==e.certsubject||void 0!==e.certissuer?this.asn1CertIssuer=new ue.asn1.x509.X500Name(e):"string"==typeof e&&-1!=e.indexOf("BEGIN ")&&-1!=e.indexOf("CERTIFICATE")&&(this.asn1CertIssuer=new ue.asn1.x509.X500Name({certissuer:e}))},this.setCertSNByParam=function(e){if(void 0!==e.str||void 0!==e.bigint||void 0!==e.hex)this.asn1CertSN=new ue.asn1.DERInteger(e);else if("string"==typeof e&&-1!=e.indexOf("BEGIN ")&&e.indexOf("CERTIFICATE")){var t=new ot;t.readCertPEM(e);var n=t.getSerialNumberHex();this.asn1CertSN=new ue.asn1.DERInteger({hex:n})}},this.oid="2.5.29.35",void 0!==e&&(void 0!==e.kid&&this.setKIDByParam(e.kid),void 0!==e.issuer&&this.setCertIssuerByParam(e.issuer),void 0!==e.sn&&this.setCertSNByParam(e.sn),void 0!==e.issuersn&&"string"==typeof e.issuersn&&-1!=e.issuersn.indexOf("BEGIN ")&&e.issuersn.indexOf("CERTIFICATE")&&(this.setCertSNByParam(e.issuersn),this.setCertIssuerByParam(e.issuersn)))},et(ue.asn1.x509.AuthorityKeyIdentifier,ue.asn1.x509.Extension),ue.asn1.x509.SubjectKeyIdentifier=function(e){ue.asn1.x509.SubjectKeyIdentifier.superclass.constructor.call(this,e);var t=ue.asn1.DEROctetString;this.asn1KID=null,this.getExtnValueHex=function(){return this.asn1ExtnValue=this.asn1KID,this.asn1ExtnValue.tohex()},this.setKIDByParam=function(e){if(void 0!==e.str||void 0!==e.hex)this.asn1KID=new t(e);else if("object"==typeof e&&ue.crypto.Util.isKey(e)||"string"==typeof e&&-1!=e.indexOf("BEGIN")){var n=e;"string"==typeof e&&(n=tt.getKey(e));var r=tt.getKeyID(n);this.asn1KID=new ue.asn1.DEROctetString({hex:r})}},this.oid="2.5.29.14",void 0!==e&&void 0!==e.kid&&this.setKIDByParam(e.kid)},et(ue.asn1.x509.SubjectKeyIdentifier,ue.asn1.x509.Extension),ue.asn1.x509.AuthorityInfoAccess=function(e){ue.asn1.x509.AuthorityInfoAccess.superclass.constructor.call(this,e),this.setAccessDescriptionArray=function(e){for(var t=new Array,n=ue.asn1,r=n.DERSequence,i=n.DERObjectIdentifier,o=n.x509.GeneralName,a=0;a<e.length;a++){var s,u=e[a];if(void 0!==u.ocsp)s=new r({array:[new i({oid:"1.3.6.1.5.5.7.48.1"}),new o({uri:u.ocsp})]});else{if(void 0===u.caissuer)throw new Error("unknown AccessMethod parameter: "+JSON.stringify(u));s=new r({array:[new i({oid:"1.3.6.1.5.5.7.48.2"}),new o({uri:u.caissuer})]})}t.push(s)}this.asn1ExtnValue=new r({array:t})},this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.oid="1.3.6.1.5.5.7.1.1",void 0!==e&&void 0!==e.array&&this.setAccessDescriptionArray(e.array)},et(ue.asn1.x509.AuthorityInfoAccess,ue.asn1.x509.Extension),ue.asn1.x509.SubjectAltName=function(e){ue.asn1.x509.SubjectAltName.superclass.constructor.call(this,e),this.setNameArray=function(e){this.asn1ExtnValue=new ue.asn1.x509.GeneralNames(e)},this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.oid="2.5.29.17",void 0!==e&&void 0!==e.array&&this.setNameArray(e.array)},et(ue.asn1.x509.SubjectAltName,ue.asn1.x509.Extension),ue.asn1.x509.IssuerAltName=function(e){ue.asn1.x509.IssuerAltName.superclass.constructor.call(this,e),this.setNameArray=function(e){this.asn1ExtnValue=new ue.asn1.x509.GeneralNames(e)},this.getExtnValueHex=function(){return this.asn1ExtnValue.tohex()},this.oid="2.5.29.18",void 0!==e&&void 0!==e.array&&this.setNameArray(e.array)},et(ue.asn1.x509.IssuerAltName,ue.asn1.x509.Extension),ue.asn1.x509.SubjectDirectoryAttributes=function(e){ue.asn1.x509.SubjectDirectoryAttributes.superclass.constructor.call(this,e);var t=ue.asn1,n=t.DERSequence,r=t.ASN1Util.newObject,i=t.x509.OID.name2oid;this.params=null,this.getExtnValueHex=function(){for(var e=[],t=0;t<this.params.array.length;t++){var o=this.params.array[t];if(null==o.attr||null==o.array){var a={seq:[{oid:"1.2.3.4"},{set:[{utf8str:"DE"}]}]};if("dateOfBirth"==o.attr)a.seq[0].oid=i(o.attr),a.seq[1].set[0]={gentime:o.str};else if("placeOfBirth"==o.attr)a.seq[0].oid=i(o.attr),a.seq[1].set[0]={utf8str:o.str};else if("gender"==o.attr)a.seq[0].oid=i(o.attr),a.seq[1].set[0]={prnstr:o.str};else if("countryOfCitizenship"==o.attr)a.seq[0].oid=i(o.attr),a.seq[1].set[0]={prnstr:o.str};else{if("countryOfResidence"!=o.attr)throw new Error("unsupported attribute: "+o.attr);a.seq[0].oid=i(o.attr),a.seq[1].set[0]={prnstr:o.str}}e.push(new r(a))}else{var s={seq:[{oid:o.attr},{set:o.array}]};e.push(r(s))}}var u=new n({array:e});return this.asn1ExtnValue=u,this.asn1ExtnValue.tohex()},this.oid="2.5.29.9",void 0!==e&&(this.params=e)},et(ue.asn1.x509.SubjectDirectoryAttributes,ue.asn1.x509.Extension),ue.asn1.x509.PrivateExtension=function(e){ue.asn1.x509.PrivateExtension.superclass.constructor.call(this,e);var t=ue,n=t.lang.String.isHex,r=t.asn1,i=r.x509.OID.name2oid,o=r.ASN1Util.newObject;this.params=null,this.setByParam=function(e){this.oid=i(e.extname),this.params=e},this.getExtnValueHex=function(){if(null==this.params.extname||null==this.params.extn)throw new Error("extname or extnhex not specified");var e=this.params.extn;if("string"==typeof e&&n(e))return e;if("object"==typeof e)try{return o(e).tohex()}catch(e){}throw new Error("unsupported extn value")},null!=e&&this.setByParam(e)},et(ue.asn1.x509.PrivateExtension,ue.asn1.x509.Extension),ue.asn1.x509.CRL=function(e){ue.asn1.x509.CRL.superclass.constructor.call(this);var t=ue.asn1,n=t.DERSequence,r=t.DERBitString,i=t.x509,o=i.AlgorithmIdentifier,a=i.TBSCertList;this.params=void 0,this.setByParam=function(e){this.params=e},this.sign=function(){var e=new a(this.params).tohex(),t=new ue.crypto.Signature({alg:this.params.sigalg});t.init(this.params.cakey),t.updateHex(e);var n=t.sign();this.params.sighex=n},this.getPEM=function(){return De(this.tohex(),"X509 CRL")},this.tohex=function(){var e=this.params;if(null==e.tbsobj&&(e.tbsobj=new a(e)),null==e.sighex&&null!=e.cakey&&this.sign(),null==e.sighex)throw new Error("sighex or cakey parameter not defined");var t=[];return t.push(e.tbsobj),t.push(new o({name:e.sigalg})),t.push(new r({hex:"00"+e.sighex})),new n({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&(this.params=e)},et(ue.asn1.x509.CRL,ue.asn1.ASN1Object),ue.asn1.x509.TBSCertList=function(e){ue.asn1.x509.TBSCertList.superclass.constructor.call(this);var t=ue.asn1,n=t.DERInteger,r=t.DERSequence,i=t.DERTaggedObject,o=(t.DERObjectIdentifier,t.x509),a=o.AlgorithmIdentifier,s=o.Time,u=o.Extensions,l=o.X500Name;this.params=null,this.setByParam=function(e){this.params=e},this.getRevCertSequence=function(){for(var e=[],t=this.params.revcert,i=0;i<t.length;i++){var o=[new n(t[i].sn),new s(t[i].date)];null!=t[i].ext&&o.push(new u(t[i].ext)),e.push(new r({array:o}))}return new r({array:e})},this.tohex=function(){var e=[],t=this.params;if(null!=t.version){var o=t.version-1,c=new n({int:o});e.push(c)}if(e.push(new a({name:t.sigalg})),e.push(new l(t.issuer)),e.push(new s(t.thisupdate)),null!=t.nextupdate&&e.push(new s(t.nextupdate)),null!=t.revcert&&e.push(this.getRevCertSequence()),null!=t.ext){var p=new u(t.ext);e.push(new i({tag:"a0",explicit:!0,obj:p}))}return new r({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},et(ue.asn1.x509.TBSCertList,ue.asn1.ASN1Object),ue.asn1.x509.CRLEntry=function(e){ue.asn1.x509.CRLEntry.superclass.constructor.call(this);var t=ue.asn1;this.setCertSerial=function(e){this.sn=new t.DERInteger(e)},this.setRevocationDate=function(e){this.time=new t.x509.Time(e)},this.tohex=function(){var e=new t.DERSequence({array:[this.sn,this.time]});return this.TLV=e.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&(void 0!==e.time&&this.setRevocationDate(e.time),void 0!==e.sn&&this.setCertSerial(e.sn))},et(ue.asn1.x509.CRLEntry,ue.asn1.ASN1Object),ue.asn1.x509.CRLNumber=function(e){ue.asn1.x509.CRLNumber.superclass.constructor.call(this,e),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new ue.asn1.DERInteger(this.params.num),this.asn1ExtnValue.tohex()},this.oid="2.5.29.20",null!=e&&(this.params=e)},et(ue.asn1.x509.CRLNumber,ue.asn1.x509.Extension),ue.asn1.x509.CRLReason=function(e){ue.asn1.x509.CRLReason.superclass.constructor.call(this,e),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new ue.asn1.DEREnumerated(this.params.code),this.asn1ExtnValue.tohex()},this.oid="2.5.29.21",null!=e&&(this.params=e)},et(ue.asn1.x509.CRLReason,ue.asn1.x509.Extension),ue.asn1.x509.OCSPNonce=function(e){ue.asn1.x509.OCSPNonce.superclass.constructor.call(this,e),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new ue.asn1.DEROctetString(this.params),this.asn1ExtnValue.tohex()},this.oid="1.3.6.1.5.5.7.48.1.2",null!=e&&(this.params=e)},et(ue.asn1.x509.OCSPNonce,ue.asn1.x509.Extension),ue.asn1.x509.OCSPNoCheck=function(e){ue.asn1.x509.OCSPNoCheck.superclass.constructor.call(this,e),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new ue.asn1.DERNull,this.asn1ExtnValue.tohex()},this.oid="1.3.6.1.5.5.7.48.1.5",null!=e&&(this.params=e)},et(ue.asn1.x509.OCSPNoCheck,ue.asn1.x509.Extension),ue.asn1.x509.AdobeTimeStamp=function(e){ue.asn1.x509.AdobeTimeStamp.superclass.constructor.call(this,e);var t=ue.asn1,n=t.DERInteger,r=t.DERBoolean,i=t.DERSequence,o=t.x509.GeneralName;this.params=null,this.getExtnValueHex=function(){var e=this.params,t=[new n(1)];return t.push(new o({uri:e.uri})),null!=e.reqauth&&t.push(new r(e.reqauth)),this.asn1ExtnValue=new i({array:t}),this.asn1ExtnValue.tohex()},this.oid="1.2.840.113583.1.1.9.1",void 0!==e&&this.setByParam(e)},et(ue.asn1.x509.AdobeTimeStamp,ue.asn1.x509.Extension),ue.asn1.x509.X500Name=function(e){ue.asn1.x509.X500Name.superclass.constructor.call(this),this.asn1Array=[],this.paramArray=[],this.sRule="utf8";var t=ue.asn1,n=t.x509,r=n.RDN;this.setByString=function(e,t){void 0!==t&&(this.sRule=t);var n=e.split("/");n.shift();for(var i=[],o=0;o<n.length;o++)if(n[o].match(/^[^=]+=.+$/))i.push(n[o]);else{var a=i.length-1;i[a]=i[a]+"/"+n[o]}for(o=0;o<i.length;o++)this.asn1Array.push(new r({str:i[o],rule:this.sRule}))},this.setByLdapString=function(e,t){void 0!==t&&(this.sRule=t);var r=n.X500Name.ldapToCompat(e);this.setByString(r,t)},this.setByObject=function(e,t){for(var n in void 0!==t&&(this.sRule=t),e)if(e.hasOwnProperty(n)){var i=new r({str:n+"="+e[n],rule:this.sRule});this.asn1Array?this.asn1Array.push(i):this.asn1Array=[i]}},this.setByParam=function(e){var t;(void 0!==e.rule&&(this.sRule=e.rule),void 0!==e.array)?this.paramArray=e.array:void 0!==e.str?this.setByString(e.str):void 0!==e.ldapstr?this.setByLdapString(e.ldapstr):void 0!==e.hex?this.hTLV=e.hex:void 0!==e.certissuer?((t=new ot).readCertPEM(e.certissuer),this.hTLV=t.getIssuerHex()):void 0!==e.certsubject?((t=new ot).readCertPEM(e.certsubject),this.hTLV=t.getSubjectHex()):"object"==typeof e&&void 0===e.certsubject&&void 0===e.certissuer&&this.setByObject(e)},this.tohex=function(){if("string"==typeof this.hTLV)return this.hTLV;if(0==this.asn1Array.length&&this.paramArray.length>0)for(var e=0;e<this.paramArray.length;e++){var n={array:this.paramArray[e]};"utf8"!=this.sRule&&(n.rule=this.sRule);var i=new r(n);this.asn1Array.push(i)}var o=new t.DERSequence({array:this.asn1Array});return this.hTLV=o.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},et(ue.asn1.x509.X500Name,ue.asn1.ASN1Object),ue.asn1.x509.X500Name.compatToLDAP=function(e){if("/"!==e.substr(0,1))throw"malformed input";var t=(e=e.substr(1)).split("/");return t.reverse(),(t=t.map((function(e){return e.replace(/,/,"\\,")}))).join(",")},ue.asn1.x509.X500Name.onelineToLDAP=function(e){return ue.asn1.x509.X500Name.compatToLDAP(e)},ue.asn1.x509.X500Name.ldapToCompat=function(e){for(var t=e.split(","),n=!1,r=[],i=0;t.length>0;i++){var o=t.shift();if(!0===n){var a=(r.pop()+","+o).replace(/\\,/g,",");r.push(a),n=!1}else r.push(o);"\\"===o.substr(-1,1)&&(n=!0)}return(r=r.map((function(e){return e.replace("/","\\/")}))).reverse(),"/"+r.join("/")},ue.asn1.x509.X500Name.ldapToOneline=function(e){return ue.asn1.x509.X500Name.ldapToCompat(e)},ue.asn1.x509.RDN=function(e){ue.asn1.x509.RDN.superclass.constructor.call(this),this.asn1Array=[],this.paramArray=[],this.sRule="utf8";var t=ue.asn1.x509.AttributeTypeAndValue;this.setByParam=function(e){void 0!==e.rule&&(this.sRule=e.rule),void 0!==e.str&&this.addByMultiValuedString(e.str),void 0!==e.array&&(this.paramArray=e.array)},this.addByString=function(e){this.asn1Array.push(new ue.asn1.x509.AttributeTypeAndValue({str:e,rule:this.sRule}))},this.addByMultiValuedString=function(e){for(var t=ue.asn1.x509.RDN.parseString(e),n=0;n<t.length;n++)this.addByString(t[n])},this.tohex=function(){if(0==this.asn1Array.length&&this.paramArray.length>0)for(var e=0;e<this.paramArray.length;e++){var n=this.paramArray[e];void 0!==n.rule&&"utf8"!=this.sRule&&(n.rule=this.sRule);var r=new t(n);this.asn1Array.push(r)}var i=new ue.asn1.DERSet({array:this.asn1Array});return this.TLV=i.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},et(ue.asn1.x509.RDN,ue.asn1.ASN1Object),ue.asn1.x509.RDN.parseString=function(e){for(var t=e.split(/\+/),n=!1,r=[],i=0;t.length>0;i++){var o=t.shift();if(!0===n){var a=(r.pop()+"+"+o).replace(/\\\+/g,"+");r.push(a),n=!1}else r.push(o);"\\"===o.substr(-1,1)&&(n=!0)}var s=!1,u=[];for(i=0;r.length>0;i++){o=r.shift();if(!0===s){var l=u.pop();if(o.match(/"$/)){a=(l+"+"+o).replace(/^([^=]+)="(.*)"$/,"$1=$2");u.push(a),s=!1}else u.push(l+"+"+o)}else u.push(o);o.match(/^[^=]+="/)&&(s=!0)}return u},ue.asn1.x509.AttributeTypeAndValue=function(e){ue.asn1.x509.AttributeTypeAndValue.superclass.constructor.call(this),this.sRule="utf8",this.sType=null,this.sValue=null,this.dsType=null;var t=ue,n=t.asn1,r=n.DERSequence,i=n.DERUTF8String,o=n.DERPrintableString,a=n.DERTeletexString,s=n.DERIA5String,u=n.DERVisibleString,l=n.DERBMPString,c=t.lang.String.isMail,p=t.lang.String.isPrintable;this.setByParam=function(e){if(void 0!==e.rule&&(this.sRule=e.rule),void 0!==e.ds&&(this.dsType=e.ds),void 0===e.value&&void 0!==e.str){var t=e.str.match(/^([^=]+)=(.+)$/);if(!t)throw new Error("malformed attrTypeAndValueStr: "+attrTypeAndValueStr);this.sType=t[1],this.sValue=t[2]}else this.sType=e.type,this.sValue=e.value},this.setByString=function(e,t){void 0!==t&&(this.sRule=t);var n=e.match(/^([^=]+)=(.+)$/);if(!n)throw new Error("malformed attrTypeAndValueStr: "+attrTypeAndValueStr);this.setByAttrTypeAndValueStr(n[1],n[2])},this._getDsType=function(){var e=this.sType,t=this.sValue,n=this.sRule;return"prn"===n?"CN"==e&&c(t)?"ia5":p(t)?"prn":"utf8":"utf8"===n?"CN"==e&&c(t)?"ia5":"C"==e?"prn":"utf8":"utf8"},this.setByAttrTypeAndValueStr=function(e,t,n){void 0!==n&&(this.sRule=n),this.sType=e,this.sValue=t},this.getValueObj=function(e,t){if("utf8"==e)return new i({str:t});if("prn"==e)return new o({str:t});if("tel"==e)return new a({str:t});if("ia5"==e)return new s({str:t});if("vis"==e)return new u({str:t});if("bmp"==e)return new l({str:t});throw new Error("unsupported directory string type: type="+e+" value="+t)},this.tohex=function(){null==this.dsType&&(this.dsType=this._getDsType());var e=ue.asn1.x509.OID.atype2obj(this.sType),t=this.getValueObj(this.dsType,this.sValue),n=new r({array:[e,t]});return this.TLV=n.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},et(ue.asn1.x509.AttributeTypeAndValue,ue.asn1.ASN1Object),ue.asn1.x509.SubjectPublicKeyInfo=function(e){ue.asn1.x509.SubjectPublicKeyInfo.superclass.constructor.call(this);var t=ue,n=t.asn1,r=n.DERInteger,i=n.DERBitString,o=n.DERObjectIdentifier,a=n.DERSequence,s=n.ASN1Util.newObject,u=n.x509.AlgorithmIdentifier,l=t.crypto;l.ECDSA,l.DSA;this.getASN1Object=function(){if(null==this.asn1AlgId||null==this.asn1SubjPKey)throw"algId and/or subjPubKey not set";return new a({array:[this.asn1AlgId,this.asn1SubjPKey]})},this.tohex=function(){var e=this.getASN1Object();return this.hTLV=e.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},this.setPubKey=function(e){try{if(e instanceof ne){var t=s({seq:[{int:{bigint:e.n}},{int:{int:e.e}}]}).tohex();this.asn1AlgId=new u({name:"rsaEncryption"}),this.asn1SubjPKey=new i({hex:"00"+t})}}catch(e){}try{if(e instanceof ue.crypto.ECDSA){var n=new o({name:e.curveName});this.asn1AlgId=new u({name:"ecPublicKey",asn1params:n}),this.asn1SubjPKey=new i({hex:"00"+e.pubKeyHex})}}catch(e){}try{if(e instanceof ue.crypto.DSA){n=new s({seq:[{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.g}}]});this.asn1AlgId=new u({name:"dsa",asn1params:n});var a=new r({bigint:e.y});this.asn1SubjPKey=new i({hex:"00"+a.tohex()})}}catch(e){}},void 0!==e&&this.setPubKey(e)},et(ue.asn1.x509.SubjectPublicKeyInfo,ue.asn1.ASN1Object),ue.asn1.x509.Time=function(e){ue.asn1.x509.Time.superclass.constructor.call(this);var t=ue.asn1,n=t.DERUTCTime,r=t.DERGeneralizedTime;this.params=null,this.type=null,this.setTimeParams=function(e){this.timeParams=e},this.setByParam=function(e){this.params=e},this.getType=function(e){return e.match(/^[0-9]{12}Z$/)?"utc":e.match(/^[0-9]{14}Z$/)?"gen":e.match(/^[0-9]{12}\.[0-9]+Z$/)?"utc":e.match(/^[0-9]{14}\.[0-9]+Z$/)?"gen":null},this.tohex=function(){var e=this.params,t=null;if("string"==typeof e&&(e={str:e}),null==e||!e.str||null!=e.type&&null!=e.type||(e.type=this.getType(e.str)),null!=e&&e.str?("utc"==e.type&&(t=new n(e.str)),"gen"==e.type&&(t=new r(e.str))):t="gen"==this.type?new r:new n,null==t)throw new Error("wrong setting for Time");return this.TLV=t.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},ue.asn1.x509.Time_bak=function(e){ue.asn1.x509.Time_bak.superclass.constructor.call(this);var t=ue.asn1,n=t.DERUTCTime,r=t.DERGeneralizedTime;this.setTimeParams=function(e){this.timeParams=e},this.tohex=function(){var e=null;return e=null!=this.timeParams?"utc"==this.type?new n(this.timeParams):new r(this.timeParams):"utc"==this.type?new n:new r,this.TLV=e.tohex(),this.TLV},this.getEncodedHex=function(){return this.tohex()},this.type="utc",void 0!==e&&(void 0!==e.type?this.type=e.type:void 0!==e.str&&(e.str.match(/^[0-9]{12}Z$/)&&(this.type="utc"),e.str.match(/^[0-9]{14}Z$/)&&(this.type="gen")),this.timeParams=e)},et(ue.asn1.x509.Time,ue.asn1.ASN1Object),ue.asn1.x509.AlgorithmIdentifier=function(e){ue.asn1.x509.AlgorithmIdentifier.superclass.constructor.call(this),this.nameAlg=null,this.asn1Alg=null,this.asn1Params=null,this.paramEmpty=!1;var t=ue.asn1,n=t.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV;if(this.tohex=function(){if(null===this.nameAlg&&null===this.asn1Alg)throw new Error("algorithm not specified");if(null!==this.nameAlg){var e=null;for(var r in n)r===this.nameAlg&&(e=n[r]);if(null!==e)return this.hTLV=e,this.hTLV}null!==this.nameAlg&&null===this.asn1Alg&&(this.asn1Alg=t.x509.OID.name2obj(this.nameAlg));var i=[this.asn1Alg];null!==this.asn1Params&&i.push(this.asn1Params);var o=new t.DERSequence({array:i});return this.hTLV=o.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&(void 0!==e.name&&(this.nameAlg=e.name),void 0!==e.asn1params&&(this.asn1Params=e.asn1params),void 0!==e.paramempty&&(this.paramEmpty=e.paramempty)),null===this.asn1Params&&!1===this.paramEmpty&&null!==this.nameAlg){void 0!==this.nameAlg.name&&(this.nameAlg=this.nameAlg.name);var r=this.nameAlg.toLowerCase();"withdsa"!==r.substr(-7,7)&&"withecdsa"!==r.substr(-9,9)&&(this.asn1Params=new t.DERNull)}},et(ue.asn1.x509.AlgorithmIdentifier,ue.asn1.ASN1Object),ue.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV={SHAwithRSAandMGF1:"300d06092a864886f70d01010a3000",SHA256withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040201a11a301806092a864886f70d010108300b0609608648016503040201a203020120",SHA384withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040202a11a301806092a864886f70d010108300b0609608648016503040202a203020130",SHA512withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040203a11a301806092a864886f70d010108300b0609608648016503040203a203020140"},ue.asn1.x509.GeneralName=function(e){ue.asn1.x509.GeneralName.superclass.constructor.call(this);var t=ue.asn1,n=t.x509,r=n.X500Name,i=n.OtherName,o=t.DERIA5String,a=(t.DERPrintableString,t.DEROctetString),s=t.DERTaggedObject,u=t.ASN1Object,l=Error;this.params=null,this.setByParam=function(e){this.params=e},this.tohex=function(){var e,t,n=this.params,c=!1;if(void 0!==n.other)e="a0",t=new i(n.other);else if(void 0!==n.rfc822)e="81",t=new o({str:n.rfc822});else if(void 0!==n.dns)e="82",t=new o({str:n.dns});else if(void 0!==n.dn)e="a4",c=!0,t="string"==typeof n.dn?new r({str:n.dn}):n.dn instanceof ue.asn1.x509.X500Name?n.dn:new r(n.dn);else if(void 0!==n.ldapdn)e="a4",c=!0,t=new r({ldapstr:n.ldapdn});else if(void 0!==n.certissuer||void 0!==n.certsubj){var p,h;e="a4",c=!0;var d=null;if(void 0!==n.certsubj?(p=!1,h=n.certsubj):(p=!0,h=n.certissuer),h.match(/^[0-9A-Fa-f]+$/),-1!=h.indexOf("-----BEGIN ")&&(d=Te(h)),null==d)throw new Error("certsubj/certissuer not cert");var f,g=new ot;g.hex=d,f=p?g.getIssuerHex():g.getSubjectHex(),(t=new u).hTLV=f}else if(void 0!==n.uri)e="86",t=new o({str:n.uri});else{if(void 0===n.ip)throw new l("improper params");var m;e="87";var v=n.ip;try{if(v.match(/^[0-9a-f]+$/)){var y=v.length;if(8!=y&&16!=y&&32!=y&&64!=y)throw"err";m=v}else m=Be(v)}catch(e){throw new l("malformed IP address: "+n.ip+":"+e.message)}t=new a({hex:m})}return new s({tag:e,explicit:c,obj:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},et(ue.asn1.x509.GeneralName,ue.asn1.ASN1Object),ue.asn1.x509.GeneralNames=function(e){ue.asn1.x509.GeneralNames.superclass.constructor.call(this);var t=ue.asn1;this.setByParamArray=function(e){for(var n=0;n<e.length;n++){var r=new t.x509.GeneralName(e[n]);this.asn1Array.push(r)}},this.tohex=function(){return new t.DERSequence({array:this.asn1Array}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.asn1Array=new Array,void 0!==e&&this.setByParamArray(e)},et(ue.asn1.x509.GeneralNames,ue.asn1.ASN1Object),ue.asn1.x509.OtherName=function(e){ue.asn1.x509.OtherName.superclass.constructor.call(this);var t=ue.asn1,n=t.DERObjectIdentifier,r=t.DERSequence,i=t.ASN1Util.newObject;this.params=null,this.setByParam=function(e){this.params=e},this.tohex=function(){var e=this.params;if(null==e.oid||null==e.value)throw new Error("oid or value not specified");var t=new n({oid:e.oid}),o=i({tag:{tag:"a0",explicit:!0,obj:e.value}});return new r({array:[t,o]}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},et(ue.asn1.x509.OtherName,ue.asn1.ASN1Object),ue.asn1.x509.OID=new function(){var e=ue.asn1.DERObjectIdentifier;this.name2oidList={sha1:"1.3.14.3.2.26",sha256:"2.16.840.1.101.3.4.2.1",sha384:"2.16.840.1.101.3.4.2.2",sha512:"2.16.840.1.101.3.4.2.3",sha224:"2.16.840.1.101.3.4.2.4",md5:"1.2.840.113549.2.5",md2:"1.3.14.7.2.2.1",ripemd160:"1.3.36.3.2.1",MD2withRSA:"1.2.840.113549.1.1.2",MD4withRSA:"1.2.840.113549.1.1.3",MD5withRSA:"1.2.840.113549.1.1.4",SHA1withRSA:"1.2.840.113549.1.1.5","pkcs1-MGF":"1.2.840.113549.1.1.8",rsaPSS:"1.2.840.113549.1.1.10",SHA224withRSA:"1.2.840.113549.1.1.14",SHA256withRSA:"1.2.840.113549.1.1.11",SHA384withRSA:"1.2.840.113549.1.1.12",SHA512withRSA:"1.2.840.113549.1.1.13",SHA1withECDSA:"1.2.840.10045.4.1",SHA224withECDSA:"1.2.840.10045.4.3.1",SHA256withECDSA:"1.2.840.10045.4.3.2",SHA384withECDSA:"1.2.840.10045.4.3.3",SHA512withECDSA:"1.2.840.10045.4.3.4",dsa:"1.2.840.10040.4.1",SHA1withDSA:"1.2.840.10040.4.3",SHA224withDSA:"2.16.840.1.101.3.4.3.1",SHA256withDSA:"2.16.840.1.101.3.4.3.2",rsaEncryption:"1.2.840.113549.1.1.1",commonName:"2.5.4.3",countryName:"2.5.4.6",localityName:"2.5.4.7",stateOrProvinceName:"2.5.4.8",streetAddress:"2.5.4.9",organizationName:"2.5.4.10",organizationalUnitName:"2.5.4.11",domainComponent:"0.9.2342.19200300.100.1.25",userId:"0.9.2342.19200300.100.1.1",surname:"2.5.4.4",givenName:"2.5.4.42",title:"2.5.4.12",distinguishedName:"2.5.4.49",emailAddress:"1.2.840.113549.1.9.1",description:"2.5.4.13",businessCategory:"2.5.4.15",postalCode:"2.5.4.17",uniqueIdentifier:"2.5.4.45",organizationIdentifier:"2.5.4.97",jurisdictionOfIncorporationL:"1.3.6.1.4.1.311.60.2.1.1",jurisdictionOfIncorporationSP:"1.3.6.1.4.1.311.60.2.1.2",jurisdictionOfIncorporationC:"1.3.6.1.4.1.311.60.2.1.3",subjectDirectoryAttributes:"2.5.29.9",subjectKeyIdentifier:"2.5.29.14",keyUsage:"2.5.29.15",subjectAltName:"2.5.29.17",issuerAltName:"2.5.29.18",basicConstraints:"2.5.29.19",cRLNumber:"2.5.29.20",cRLReason:"2.5.29.21",nameConstraints:"2.5.29.30",cRLDistributionPoints:"2.5.29.31",certificatePolicies:"2.5.29.32",anyPolicy:"2.5.29.32.0",policyMappings:"2.5.29.33",authorityKeyIdentifier:"2.5.29.35",policyConstraints:"2.5.29.36",extKeyUsage:"2.5.29.37",inhibitAnyPolicy:"2.5.29.54",authorityInfoAccess:"1.3.6.1.5.5.7.1.1",ocsp:"1.3.6.1.5.5.7.48.1",ocspBasic:"1.3.6.1.5.5.7.48.1.1",ocspNonce:"1.3.6.1.5.5.7.48.1.2",ocspNoCheck:"1.3.6.1.5.5.7.48.1.5",caIssuers:"1.3.6.1.5.5.7.48.2",anyExtendedKeyUsage:"2.5.29.37.0",serverAuth:"1.3.6.1.5.5.7.3.1",clientAuth:"1.3.6.1.5.5.7.3.2",codeSigning:"1.3.6.1.5.5.7.3.3",emailProtection:"1.3.6.1.5.5.7.3.4",timeStamping:"1.3.6.1.5.5.7.3.8",ocspSigning:"1.3.6.1.5.5.7.3.9",smtpUTF8Mailbox:"1.3.6.1.5.5.7.8.9",dateOfBirth:"1.3.6.1.5.5.7.9.1",placeOfBirth:"1.3.6.1.5.5.7.9.2",gender:"1.3.6.1.5.5.7.9.3",countryOfCitizenship:"1.3.6.1.5.5.7.9.4",countryOfResidence:"1.3.6.1.5.5.7.9.5",ecPublicKey:"1.2.840.10045.2.1","P-256":"1.2.840.10045.3.1.7",secp256r1:"1.2.840.10045.3.1.7",secp256k1:"1.3.132.0.10",secp384r1:"1.3.132.0.34",secp521r1:"1.3.132.0.35",pkcs5PBES2:"1.2.840.113549.1.5.13",pkcs5PBKDF2:"1.2.840.113549.1.5.12","des-EDE3-CBC":"1.2.840.113549.3.7",data:"1.2.840.113549.1.7.1","signed-data":"1.2.840.113549.1.7.2","enveloped-data":"1.2.840.113549.1.7.3","digested-data":"1.2.840.113549.1.7.5","encrypted-data":"1.2.840.113549.1.7.6","authenticated-data":"1.2.840.113549.1.9.16.1.2",tstinfo:"1.2.840.113549.1.9.16.1.4",signingCertificate:"1.2.840.113549.1.9.16.2.12",timeStampToken:"1.2.840.113549.1.9.16.2.14",signaturePolicyIdentifier:"1.2.840.113549.1.9.16.2.15",etsArchiveTimeStamp:"1.2.840.113549.1.9.16.2.27",signingCertificateV2:"1.2.840.113549.1.9.16.2.47",etsArchiveTimeStampV2:"1.2.840.113549.1.9.16.2.48",extensionRequest:"1.2.840.113549.1.9.14",contentType:"1.2.840.113549.1.9.3",messageDigest:"1.2.840.113549.1.9.4",signingTime:"1.2.840.113549.1.9.5",counterSignature:"1.2.840.113549.1.9.6",archiveTimeStampV3:"0.4.0.1733.2.4",pdfRevocationInfoArchival:"1.2.840.113583.1.1.8",adobeTimeStamp:"1.2.840.113583.1.1.9.1",smimeMailboxLegacy:"2.23.140.1.5.1.1",smimeMailboxMulti:"2.23.140.1.5.1.2",smimeMailboxStrict:"2.23.140.1.5.1.3",smimeOrganizationLegacy:"2.23.140.1.5.2.1",smimeOrganizationMulti:"2.23.140.1.5.2.2",smimeOrganizationStrict:"2.23.140.1.5.2.3",smimeSponsorLegacy:"2.23.140.1.5.3.1",smimeSponsorMulti:"2.23.140.1.5.3.2",smimeSponsorStrict:"2.23.140.1.5.3.3",smimeIndividualLegacy:"2.23.140.1.5.4.1",smimeIndividualMulti:"2.23.140.1.5.4.2",smimeIndividualStrict:"2.23.140.1.5.4.3"},this.atype2oidList={CN:"2.5.4.3",L:"2.5.4.7",ST:"2.5.4.8",O:"2.5.4.10",OU:"2.5.4.11",C:"2.5.4.6",STREET:"2.5.4.9",DC:"0.9.2342.19200300.100.1.25",UID:"0.9.2342.19200300.100.1.1",SN:"2.5.4.4",T:"2.5.4.12",GN:"2.5.4.42",DN:"2.5.4.49",E:"1.2.840.113549.1.9.1",description:"2.5.4.13",businessCategory:"2.5.4.15",postalCode:"2.5.4.17",serialNumber:"2.5.4.5",uniqueIdentifier:"2.5.4.45",organizationIdentifier:"2.5.4.97",jurisdictionOfIncorporationL:"1.3.6.1.4.1.311.60.2.1.1",jurisdictionOfIncorporationSP:"1.3.6.1.4.1.311.60.2.1.2",jurisdictionOfIncorporationC:"1.3.6.1.4.1.311.60.2.1.3"},this.objCache={},this.name2obj=function(t){if(void 0!==this.objCache[t])return this.objCache[t];if(void 0===this.name2oidList[t])throw"Name of ObjectIdentifier not defined: "+t;var n=this.name2oidList[t],r=new e({oid:n});return this.objCache[t]=r,r},this.atype2obj=function(t){if(void 0!==this.objCache[t])return this.objCache[t];var n;if(t.match(/^\d+\.\d+\.[0-9.]+$/))n=t;else if(void 0!==this.atype2oidList[t])n=this.atype2oidList[t];else{if(void 0===this.name2oidList[t])throw new Error("AttributeType name undefined: "+t);n=this.name2oidList[t]}var r=new e({oid:n});return this.objCache[t]=r,r},this.registerOIDs=function(e){if(this.checkOIDs(e))for(var t in e)this.name2oidList[t]=e[t]},this.checkOIDs=function(e){try{var t=Object.keys(e);return 0!=t.length&&(t.map((function(e,t,n){if(!this[e].match(/^[0-2]\.[0-9.]+$/))throw new Error("value is not OID")}),e),!0)}catch(e){return!1}}},ue.asn1.x509.OID.oid2name=function(e){var t=ue.asn1.x509.OID.name2oidList;for(var n in t)if(t[n]==e)return n;return""},ue.asn1.x509.OID.oid2atype=function(e){var t=ue.asn1.x509.OID.atype2oidList;for(var n in t)if(t[n]==e)return n;return e},ue.asn1.x509.OID.name2oid=function(e){if(e.match(/^[0-9.]+$/))return e;var t=ue.asn1.x509.OID.name2oidList;return void 0===t[e]?"":t[e]},ue.asn1.x509.X509Util={},ue.asn1.x509.X509Util.newCertPEM=function(e){var t=ue.asn1.x509;t.TBSCertificate;return new(0,t.Certificate)(e).getPEM()},void 0!==ue&&ue||(ue={}),void 0!==ue.asn1&&ue.asn1||(ue.asn1={}),void 0!==ue.asn1.cms&&ue.asn1.cms||(ue.asn1.cms={}),ue.asn1.cms.Attribute=function(e){var t=Error,n=ue.asn1,r=n.DERSequence,i=n.DERSet,o=n.DERObjectIdentifier;this.params=null,this.typeOid=null,this.setByParam=function(e){this.params=e},this.getValueArray=function(){throw new t("not yet implemented abstract")},this.tohex=function(){var e=new o({oid:this.typeOid}),t=new i({array:this.getValueArray()});return new r({array:[e,t]}).tohex()},this.getEncodedHex=function(){return this.tohex()}},et(ue.asn1.cms.Attribute,ue.asn1.ASN1Object),ue.asn1.cms.ContentType=function(e){var t=ue.asn1;t.cms.ContentType.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.3",this.getValueArray=function(){return[new t.DERObjectIdentifier(this.params.type)]},null!=e&&this.setByParam(e)},et(ue.asn1.cms.ContentType,ue.asn1.cms.Attribute),ue.asn1.cms.MessageDigest=function(e){var t=ue.asn1,n=t.DEROctetString;t.cms.MessageDigest.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.4",this.getValueArray=function(){return[new n(this.params)]},null!=e&&this.setByParam(e)},et(ue.asn1.cms.MessageDigest,ue.asn1.cms.Attribute),ue.asn1.cms.SigningTime=function(e){var t=ue.asn1;t.cms.SigningTime.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.5",this.getValueArray=function(){return[new t.x509.Time(this.params)]},null!=e&&this.setByParam(e)},et(ue.asn1.cms.SigningTime,ue.asn1.cms.Attribute),ue.asn1.cms.SigningCertificate=function(e){var t=Error,n=ue,r=n.asn1,i=r.DERSequence,o=r.cms,a=o.ESSCertID;n.crypto;o.SigningCertificate.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.16.2.12",this.getValueArray=function(){if(null==this.params||null==this.params||null==this.params.array)throw new t("parameter 'array' not specified");for(var n=this.params.array,r=[],o=0;o<n.length;o++){var s=n[o];0!=e.hasis||"string"!=typeof s||-1==s.indexOf("-----BEGIN")&&!pe.isASN1HEX(s)||(s={cert:s}),0!=s.hasis&&0==e.hasis&&(s.hasis=!1),r.push(new a(s))}var u=new i({array:r});return[new i({array:[u]})]},null!=e&&this.setByParam(e)},et(ue.asn1.cms.SigningCertificate,ue.asn1.cms.Attribute),ue.asn1.cms.ESSCertID=function(e){ue.asn1.cms.ESSCertID.superclass.constructor.call(this);var t=Error,n=ue,r=n.asn1,i=r.DEROctetString,o=r.DERSequence,a=r.cms.IssuerSerial;this.params=null,this.getCertHash=function(e,r){if(null!=e.hash)return e.hash;if("string"==typeof e&&-1==e.indexOf("-----BEGIN")&&!pe.isASN1HEX(e))return e;var i,o,a;if("string"==typeof e)i=e;else{if(null==e.cert)throw new t("hash nor cert unspecified");i=e.cert}if(o=-1!=i.indexOf("-----BEGIN")?Te(i):i,"string"==typeof e&&(-1!=e.indexOf("-----BEGIN")?o=Te(e):pe.isASN1HEX(e)&&(o=e)),null!=e.alg)a=e.alg;else{if(null==r)throw new t("hash alg unspecified");a=r}return n.crypto.Util.hashHex(o,a)},this.tohex=function(){var e=this.params,t=this.getCertHash(e,"sha1"),n=[];return n.push(new i({hex:t})),("string"==typeof e&&-1!=e.indexOf("-----BEGIN")||null!=e.cert&&0!=e.hasis||null!=e.issuer&&null!=e.serial)&&n.push(new a(e)),new o({array:n}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(ue.asn1.cms.ESSCertID,ue.asn1.ASN1Object),ue.asn1.cms.SigningCertificateV2=function(e){var t=Error,n=ue,r=n.asn1,i=r.DERSequence,o=(r.x509,r.cms),a=o.ESSCertIDv2;n.crypto;o.SigningCertificateV2.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.16.2.47",this.getValueArray=function(){if(null==this.params||null==this.params||null==this.params.array)throw new t("parameter 'array' not specified");for(var n=this.params.array,r=[],o=0;o<n.length;o++){var s=n[o];null==e.alg&&0!=e.hasis||"string"!=typeof s||-1==s.indexOf("-----BEGIN")&&!pe.isASN1HEX(s)||(s={cert:s}),null==s.alg&&null!=e.alg&&(s.alg=e.alg),0!=s.hasis&&0==e.hasis&&(s.hasis=!1),r.push(new a(s))}var u=new i({array:r});return[new i({array:[u]})]},null!=e&&this.setByParam(e)},et(ue.asn1.cms.SigningCertificateV2,ue.asn1.cms.Attribute),ue.asn1.cms.ESSCertIDv2=function(e){ue.asn1.cms.ESSCertIDv2.superclass.constructor.call(this);Error;var t=ue.asn1,n=t.DEROctetString,r=t.DERSequence,i=t.cms.IssuerSerial,o=t.x509.AlgorithmIdentifier;this.params=null,this.tohex=function(){var e=this.params,t=this.getCertHash(e,"sha256"),a=[];return null!=e.alg&&"sha256"!=e.alg&&a.push(new o({name:e.alg})),a.push(new n({hex:t})),("string"==typeof e&&-1!=e.indexOf("-----BEGIN")||null!=e.cert&&0!=e.hasis||null!=e.issuer&&null!=e.serial)&&a.push(new i(e)),new r({array:a}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(ue.asn1.cms.ESSCertIDv2,ue.asn1.cms.ESSCertID),ue.asn1.cms.IssuerSerial=function(e){var t=Error,n=ue.asn1,r=n.DERInteger,i=n.DERSequence,o=n.cms,a=n.x509.GeneralNames,s=ot;o.IssuerSerial.superclass.constructor.call(this),this.setByParam=function(e){this.params=e},this.tohex=function(){var e,n,o=this.params;if("string"==typeof o&&-1!=o.indexOf("-----BEGIN")||null!=o.cert){var u;u=null!=o.cert?o.cert:o;var l=new s;l.readCertPEM(u),e=l.getIssuer(),n={hex:l.getSerialNumberHex()}}else{if(null==o.issuer||!o.serial)throw new t("cert or issuer and serial parameter not specified");e=o.issuer,n=o.serial}var c=new a([{dn:e}]),p=new r(n);return new i({array:[c,p]}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(ue.asn1.cms.IssuerSerial,ue.asn1.ASN1Object),ue.asn1.cms.SignerIdentifier=function(e){var t=ue.asn1,n=(t.DERInteger,t.DERSequence,t.cms),r=n.IssuerAndSerialNumber,i=n.SubjectKeyIdentifier;t.x509.X500Name,Error;n.SignerIdentifier.superclass.constructor.call(this),this.params=null,this.tohex=function(){var e=this.params;if("isssn"==e.type)return new r(e).tohex();if("skid"==e.type)return new i(e).tohex();throw new Error("wrong property for isssn or skid")},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(ue.asn1.cms.SignerIdentifier,ue.asn1.ASN1Object),ue.asn1.cms.IssuerAndSerialNumber=function(e){var t=ue.asn1,n=t.DERInteger,r=t.DERSequence,i=t.cms,o=t.x509.X500Name,a=ot,s=Error;i.IssuerAndSerialNumber.superclass.constructor.call(this),this.params=null,this.tohex=function(){var e,t,i=this.params;if("string"==typeof i&&-1!=i.indexOf("-----BEGIN")||null!=i.cert){var u;u=null!=i.cert?i.cert:i;var l=new a;l.readCertPEM(u),e=l.getIssuer(),t={hex:l.getSerialNumberHex()}}else{if(null==i.issuer||!i.serial)throw new s("cert or issuer and serial parameter not specified");e=i.issuer,t=i.serial}var c=new o(e),p=new n(t);return new r({array:[c,p]}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(e){this.params=e},null!=e&&this.setByParam(e)},et(ue.asn1.cms.IssuerAndSerialNumber,ue.asn1.ASN1Object),ue.asn1.cms.SubjectKeyIdentifier=function(e){var t=ue.asn1,n=(t.DERInteger,t.DERSequence,t.ASN1Util.newObject),r=t.cms,i=(r.IssuerAndSerialName,r.SubjectKeyIdentifier,t.x509.X500Name,ot),o=Error;r.SubjectKeyIdentifier.superclass.constructor.call(this),this.tohex=function(){var e,t=this.params;if(null==t.cert&&null==t.skid)throw new o("property cert nor skid undefined");null!=t.cert?e=new i(t.cert).getExtSubjectKeyIdentifier().kid.hex:null!=t.skid&&(e=t.skid);return n({tag:{tage:"a0",obj:{octstr:{hex:e}}}}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(ue.asn1.cms.SubjectKeyIdentifier,ue.asn1.ASN1Object),ue.asn1.cms.AttributeList=function(e){var t=Error,n=ue.asn1,r=n.DERSet,i=n.cms;i.AttributeList.superclass.constructor.call(this),this.params=null,this.hTLV=null,this.setByParam=function(e){this.params=e},this.tohex=function(){var e=this.params;if(null!=this.hTLV)return this.hTLV;var n=!0;null!=e.sortflag&&(n=e.sortflag);for(var o=e.array,a=[],s=0;s<o.length;s++){var u=o[s],l=u.attr;if("contentType"==l)a.push(new i.ContentType(u));else if("messageDigest"==l)a.push(new i.MessageDigest(u));else if("signingTime"==l)a.push(new i.SigningTime(u));else if("signingCertificate"==l)a.push(new i.SigningCertificate(u));else if("signingCertificateV2"==l)a.push(new i.SigningCertificateV2(u));else if("signaturePolicyIdentifier"==l)a.push(new ue.asn1.cades.SignaturePolicyIdentifier(u));else{if("signatureTimeStamp"!=l&&"timeStampToken"!=l)throw new t("unknown attr: "+l);a.push(new ue.asn1.cades.SignatureTimeStamp(u))}}var c=new r({array:a,sortflag:n});return this.hTLV=c.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(ue.asn1.cms.AttributeList,ue.asn1.ASN1Object),ue.asn1.cms.SignerInfo=function(e){var t=Error,n=ue,r=n.asn1,i=r.DERInteger,o=r.DEROctetString,a=r.DERSequence,s=r.DERTaggedObject,u=r.cms,l=u.SignerIdentifier,c=u.AttributeList,p=(u.ContentType,u.EncapsulatedContentInfo,u.MessageDigest,u.SignedData,r.x509.AlgorithmIdentifier),h=n.crypto,d=tt;u.SignerInfo.superclass.constructor.call(this),this.params=null,this.sign=function(){var e=this.params,t=e.sigalg,n=new c(e.sattrs).tohex(),r=d.getKey(e.signkey),i=new h.Signature({alg:t});i.init(r),i.updateHex(n);var o=i.sign();e.sighex=o},this.tohex=function(){var e=this.params,n=[];if(n.push(new i({int:e.version})),n.push(new l(e.id)),n.push(new p({name:e.hashalg})),null!=e.sattrs){var r=new c(e.sattrs);try{n.push(new s({tag:"a0",explicit:!1,obj:r}))}catch(e){throw new t("si sattr error: "+e)}}if(null!=e.sigalgfield?n.push(new p({name:e.sigalgfield})):n.push(new p({name:e.sigalg})),null==e.sighex&&null!=e.signkey&&this.sign(),n.push(new o({hex:e.sighex})),null!=e.uattrs){r=new c(e.uattrs);try{n.push(new s({tag:"a1",explicit:!1,obj:r}))}catch(e){throw new t("si uattr error: "+e)}}return new a({array:n}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(ue.asn1.cms.SignerInfo,ue.asn1.ASN1Object),ue.asn1.cms.EncapsulatedContentInfo=function(e){var t=ue.asn1,n=t.DERTaggedObject,r=t.DERSequence,i=t.DERObjectIdentifier,o=t.DEROctetString;t.cms.EncapsulatedContentInfo.superclass.constructor.call(this),this.params=null,this.tohex=function(){var e=this.params,t=[];if(t.push(new i(e.type)),null!=e.content&&(null!=e.content.hex||null!=e.content.str)&&1!=e.isDetached){var a=new o(e.content),s=new n({tag:"a0",explicit:!0,obj:a});t.push(s)}return new r({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(e){this.params=e},null!=e&&this.setByParam(e)},et(ue.asn1.cms.EncapsulatedContentInfo,ue.asn1.ASN1Object),ue.asn1.cms.ContentInfo=function(e){var t=ue.asn1,n=t.DERTaggedObject,r=t.DERSequence,i=t.DERObjectIdentifier;t.x509.OID.name2obj;ue.asn1.cms.ContentInfo.superclass.constructor.call(this),this.params=null,this.tohex=function(){var e=this.params,t=[];t.push(new i(e.type));var o=new n({tag:"a0",explicit:!0,obj:e.obj});return t.push(o),new r({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(e){this.params=e},null!=e&&this.setByParam(e)},et(ue.asn1.cms.ContentInfo,ue.asn1.ASN1Object),ue.asn1.cms.SignedData=function(e){Error;var t=ue.asn1,n=(t.ASN1Object,t.DERInteger),r=t.DERSet,i=t.DERSequence,o=(t.DERTaggedObject,t.cms),a=o.EncapsulatedContentInfo,s=o.SignerInfo,u=o.ContentInfo,l=o.CertificateSet,c=o.RevocationInfoChoices,p=t.x509.AlgorithmIdentifier;ue.asn1.cms.SignedData.superclass.constructor.call(this),this.params=null,this.checkAndFixParam=function(){var e=this.params;this._setDigestAlgs(e),this._setContentTypeByEContent(e),this._setMessageDigestByEContent(e),this._setSignerInfoVersion(e),this._setSignedDataVersion(e)},this._setDigestAlgs=function(e){for(var t={},n=e.sinfos,r=0;r<n.length;r++){t[n[r].hashalg]=1}e.hashalgs=Object.keys(t).sort()},this._setContentTypeByEContent=function(e){for(var t=e.econtent.type,n=e.sinfos,r=0;r<n.length;r++){var i=n[r];this._getAttrParamByName(i,"contentType").type=t}},this._setMessageDigestByEContent=function(e){var t=e.econtent,n=(e.econtent.type,t.content.hex);null==n&&"data"==t.type&&null!=t.content.str&&(n=Ae(t.content.str));for(var r=e.sinfos,i=0;i<r.length;i++){var o=r[i],a=o.hashalg,s=this._getAttrParamByName(o,"messageDigest"),u=ue.crypto.Util.hashHex(n,a);s.hex=u}},this._getAttrParamByName=function(e,t){for(var n=e.sattrs.array,r=0;r<n.length;r++)if(n[r].attr==t)return n[r]},this._setSignerInfoVersion=function(e){for(var t=e.sinfos,n=0;n<t.length;n++){var r=t[n],i=1;"skid"==r.id.type&&(i=3),r.version=i}},this._setSignedDataVersion=function(e){var t=this._getSignedDataVersion(e);e.version=t},this._getSignedDataVersion=function(e){if(null!=e.revinfos)for(var t=e.revinfos,n=0;n<t.length;n++){if(null!=t[n].ocsp)return 5}var r=e.sinfos;for(n=0;n<r.length;n++){if(3==e.sinfos[n].version)return 3}return"data"!=e.econtent.type?3:1},this.tohex=function(){var e=this.params;null!=this.getEncodedHexPrepare&&this.getEncodedHexPrepare(),1!=e.fixed&&this.checkAndFixParam();var t=[];t.push(new n({int:e.version}));for(var o=[],u=0;u<e.hashalgs.length;u++){var h=e.hashalgs[u];o.push(new p({name:h}))}t.push(new r({array:o})),t.push(new a(e.econtent)),null!=e.certs&&t.push(new l(e.certs)),null!=e.revinfos&&t.push(new c(e.revinfos));var d=[];for(u=0;u<e.sinfos.length;u++){var f=e.sinfos[u];d.push(new s(f))}return t.push(new r({array:d})),new i({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.getContentInfo=function(){return new u({type:"signed-data",obj:this})},this.getContentInfoEncodedHex=function(){return this.getContentInfo().tohex()},null!=e&&this.setByParam(e)},et(ue.asn1.cms.SignedData,ue.asn1.ASN1Object),ue.asn1.cms.CertificateSet=function(e){ue.asn1.cms.CertificateSet.superclass.constructor.call(this);var t=Error,n=ue.asn1,r=n.DERTaggedObject,i=n.DERSet,o=n.ASN1Object;this.params=null,this.tohex=function(){var e,n=this.params,a=[];if(n instanceof Array)e=n;else{if(null==n.array)throw new t("cert array not specified");e=n.array}for(var s=0;s<e.length;s++){var u=Te(e[s]),l=new o;l.hTLV=u,a.push(l)}var c={array:a};0==n.sortflag&&(c.sortflag=!1);var p=new i(c);return new r({tag:"a0",explicit:!1,obj:p}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(ue.asn1.cms.CertificateSet,ue.asn1.ASN1Object),ue.asn1.cms.RevocationInfoChoices=function(e){ue.asn1.cms.RevocationInfoChoices.superclass.constructor.call(this),this.params=null,this.tohex=function(){var e=this.params;if(!e instanceof Array)throw new Error("params is not array");for(var t=[],n=0;n<e.length;n++)t.push(new ue.asn1.cms.RevocationInfoChoice(e[n]));return ue.asn1.ASN1Util.newObject({tag:{tagi:"a1",obj:{set:t}}}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(ue.asn1.cms.RevocationInfoChoices,ue.asn1.ASN1Object),ue.asn1.cms.RevocationInfoChoice=function(e){ue.asn1.cms.RevocationInfoChoice.superclass.constructor.call(this),this.params=null,this.tohex=function(){var e=this.params;if(null!=e.crl&&"string"==typeof e.crl){var t=e.crl;return-1!=e.crl.indexOf("-----BEGIN")&&(t=Te(e.crl)),t}if(null!=e.ocsp)return ue.asn1.ASN1Util.newObject({tag:{tagi:"a1",obj:new ue.asn1.cms.OtherRevocationFormat(e)}}).tohex();throw new Error("property crl or ocsp undefined")},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(ue.asn1.cms.RevocationInfoChoice,ue.asn1.ASN1Object),ue.asn1.cms.OtherRevocationFormat=function(e){ue.asn1.cms.OtherRevocationFormat.superclass.constructor.call(this);var t=Error,n=ue,r=n.asn1.ASN1Util.newObject,i=n.lang.String.isHex;this.params=null,this.tohex=function(){var e=this.params;if(null==e.ocsp)throw new t("property ocsp not specified");if(!i(e.ocsp)||!pe.isASN1HEX(e.ocsp))throw new t("ocsp value not ASN.1 hex string");return r({seq:[{oid:"1.3.6.1.5.5.7.16.2"},{asn1:{tlv:e.ocsp}}]}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(ue.asn1.cms.OtherRevocationFormat,ue.asn1.ASN1Object),ue.asn1.cms.CMSUtil=new function(){},ue.asn1.cms.CMSUtil.newSignedData=function(e){return new ue.asn1.cms.SignedData(e)},ue.asn1.cms.CMSUtil.verifySignedData=function(e){var t=ue,n=t.asn1,r=n.cms,i=(r.SignerInfo,r.SignedData,r.SigningTime,r.SigningCertificate,r.SigningCertificateV2,n.cades.SignaturePolicyIdentifier,t.lang.String.isHex),o=pe,a=o.getVbyList,s=o.getTLVbyList,u=o.getIdxbyList,l=o.getChildIdx,c=o.getTLV,p=o.oidname,h=t.crypto.Util.hashHex;void 0===e.cms&&i(e.cms);var d=e.cms,f=function(e,t){var n=t.idx;t.signerid_issuer1=s(e,n,[1,0],"30"),t.signerid_serial1=a(e,n,[1,1],"02"),t.hashalg=p(a(e,n,[2,0],"06"));var r=u(e,n,[3],"a0");t.idxSignedAttrs=r,g(e,t,r);var i=l(e,n).length;if(i<6)throw"malformed SignerInfo";t.sigalg=p(a(e,n,[i-2,0],"06")),t.sigval=a(e,n,[i-1],"04")},g=function(e,t,n){var r=l(e,n);t.signedAttrIdxList=r;for(var i=0;i<r.length;i++){var o,s=r[i],u=a(e,s,[0],"06");"2a864886f70d010905"===u?(o=xe(a(e,s,[1,0])),t.saSigningTime=o):"2a864886f70d010904"===u&&(o=a(e,s,[1,0],"04"),t.saMessageDigest=o)}},m=function(e,t,n,r){n.verifyDetail={};var i=n.verifyDetail,o=t.parse.econtent,a=n.hashalg,s=n.saMessageDigest;i.validMessageDigest=!1,h(o,a)===s&&(i.validMessageDigest=!0),function(e,t,n,r){var i,o=t.parse.certsIdx;if(void 0===t.certs){i=[],t.certkeys=[];for(var a=l(e,o),s=0;s<a.length;s++){var u=c(e,a[s]),p=new ot;p.readCertHex(u),i[s]=p,t.certkeys[s]=p.getPublicKey()}t.certs=i}else i=t.certs;t.cccc=i.length,t.cccci=a.length;for(s=0;s<i.length;s++){var h=p.getIssuerHex(),d=p.getSerialNumberHex();n.signerid_issuer1===h&&n.signerid_serial1===d&&(n.certkey_idx=s)}}(e,t,n),i.validSignatureValue=!1;var u=n.sigalg,p="31"+c(e,n.idxSignedAttrs).substr(2);n.signedattrshex=p;var d=t.certs[n.certkey_idx].getPublicKey(),f=new ue.crypto.Signature({alg:u});f.init(d),f.updateHex(p);var g=f.verify(n.sigval);i.validSignatureValue_isValid=g,!0===g&&(i.validSignatureValue=!0),n.isValid=!1,i.validMessageDigest&&i.validSignatureValue&&(n.isValid=!0)},v={isValid:!1,parse:{}};return function(e,t){if("2a864886f70d010702"!==a(e,0,[0],"06"))return t;t.cmsType="signedData",t.econtent=a(e,0,[1,0,2,1,0]),function(e,t){for(var n,r=3;r<6;r++)if(void 0!==(n=u(e,0,[1,0,r]))){var i=e.substr(n,2);"a0"===i&&(t.certsIdx=n),"a1"===i&&(t.revinfosIdx=n),"31"===i&&(t.signerinfosIdx=n)}}(e,t),t.signerInfos=[],function(e,t){var n=t.signerinfosIdx;if(void 0!==n){var r=l(e,n);t.signerInfoIdxList=r;for(var i=0;i<r.length;i++){var o={idx:r[i]};f(e,o),t.signerInfos.push(o)}}}(e,t)}(d,v.parse),function(e,t){for(var n=t.parse.signerInfos,r=n.length,i=!0,o=0;o<r;o++){var a=n[o];m(e,t,a,o),a.isValid||(i=!1)}t.isValid=i}(d,v),v},ue.asn1.cms.CMSParser=function(){var e=Error,t=ot,n=new t,r=pe,i=r.getV,o=r.getTLV,a=(r.getIdxbyList,r.getTLVbyList),s=r.getTLVbyListEx,u=r.getVbyList,l=r.getVbyListEx,c=r.getChildIdx;this.getCMSSignedData=function(e){var t=a(e,0,[1,0]);return this.getSignedData(t)},this.getSignedData=function(e){var t=c(e,0),n={},r=i(e,t[0]),a=parseInt(r,16);n.version=a;var u=o(e,t[1]);n.hashalgs=this.getHashAlgArray(u);var l=o(e,t[2]);n.econtent=this.getEContent(l);var p=s(e,0,["[0]"]);null!=p&&(n.certs=this.getCertificateSet(p));s(e,0,["[1]"]);var h=s(e,0,[3]);return n.sinfos=this.getSignerInfos(h),n},this.getHashAlgArray=function(e){for(var n=c(e,0),r=new t,i=[],a=0;a<n.length;a++){var s=o(e,n[a]),u=r.getAlgorithmIdentifierName(s);i.push(u)}return i},this.getEContent=function(e){var t={},n=u(e,0,[0]),r=u(e,0,[1,0]);return t.type=ue.asn1.x509.OID.oid2name(pe.hextooidstr(n)),t.content={hex:r},t},this.getSignerInfos=function(e){for(var t=[],n=c(e,0),r=0;r<n.length;r++){var i=o(e,n[r]),a=this.getSignerInfo(i);t.push(a)}return t},this.getSignerInfo=function(e){var t={},i=c(e,0),a=r.getInt(e,i[0],-1);-1!=a&&(t.version=a);var u=o(e,i[1]),p=this.getIssuerAndSerialNumber(u);t.id=p;var h=o(e,i[2]),d=n.getAlgorithmIdentifierName(h);t.hashalg=d;var f=s(e,0,["[0]"]);if(null!=f){var g=this.getAttributeList(f);t.sattrs=g}var m=s(e,0,[3]),v=n.getAlgorithmIdentifierName(m);t.sigalg=v;var y=l(e,0,[4]);t.sighex=y;var b=s(e,0,["[1]"]);if(null!=b){var w=this.getAttributeList(b);t.uattrs=w}return t},this.getSignerIdentifier=function(e){if("30"==e.substr(0,2))return this.getIssuerAndSerialNumber(e);throw new Error("SKID of signerIdentifier not supported")},this.getIssuerAndSerialNumber=function(e){var t={type:"isssn"},r=c(e,0),a=o(e,r[0]);t.issuer=n.getX500Name(a);var s=i(e,r[1]);return t.serial={hex:s},t},this.getAttributeList=function(e){for(var t=[],n=c(e,0),r=0;r<n.length;r++){var i=o(e,n[r]),a=this.getAttribute(i);t.push(a)}return{array:t}},this.getAttribute=function(e){var t={},n=c(e,0),i=r.getOID(e,n[0]),a=ue.asn1.x509.OID.oid2name(i);t.attr=a;var s=o(e,n[1]),u=c(s,0);if(1==u.length)t.valhex=o(s,u[0]);else{for(var l=[],p=0;p<u.length;p++)l.push(o(s,u[p]));t.valhex=l}return"contentType"==a?this.setContentType(t):"messageDigest"==a?this.setMessageDigest(t):"signingTime"==a?this.setSigningTime(t):"signingCertificate"==a?this.setSigningCertificate(t):"signingCertificateV2"==a?this.setSigningCertificateV2(t):"signaturePolicyIdentifier"==a&&this.setSignaturePolicyIdentifier(t),t},this.setContentType=function(e){var t=r.getOIDName(e.valhex,0,null);null!=t&&(e.type=t,delete e.valhex)},this.setSigningTime=function(e){var t=xe(i(e.valhex,0));e.str=t,delete e.valhex},this.setMessageDigest=function(e){var t=i(e.valhex,0);e.hex=t,delete e.valhex},this.setSigningCertificate=function(e){var t=c(e.valhex,0);if(t.length>0){for(var n=o(e.valhex,t[0]),r=c(n,0),i=[],a=0;a<r.length;a++){var s=o(n,r[a]),u=this.getESSCertID(s);i.push(u)}e.array=i}if(t.length>1){var l=o(e.valhex,t[1]);e.polhex=l}delete e.valhex},this.setSignaturePolicyIdentifier=function(e){var n=c(e.valhex,0);if(n.length>0){var a=r.getOID(e.valhex,n[0]);e.oid=a}if(n.length>1){var s=new t,u=c(e.valhex,n[1]),l=o(e.valhex,u[0]),p=s.getAlgorithmIdentifierName(l);e.alg=p;var h=i(e.valhex,u[1]);e.hash=h}delete e.valhex},this.setSigningCertificateV2=function(e){var t=c(e.valhex,0);if(t.length>0){for(var n=o(e.valhex,t[0]),r=c(n,0),i=[],a=0;a<r.length;a++){var s=o(n,r[a]),u=this.getESSCertIDv2(s);i.push(u)}e.array=i}if(t.length>1){var l=o(e.valhex,t[1]);e.polhex=l}delete e.valhex},this.getESSCertID=function(e){var t={},n=c(e,0);if(n.length>0){var r=i(e,n[0]);t.hash=r}if(n.length>1){var a=o(e,n[1]),s=this.getIssuerSerial(a);null!=s.serial&&(t.serial=s.serial),null!=s.issuer&&(t.issuer=s.issuer)}return t},this.getESSCertIDv2=function(t){var r={},a=c(t,0);if(a.length<1||3<a.length)throw new e("wrong number of elements");var s=0;if("30"==t.substr(a[0],2)){var u=o(t,a[0]);r.alg=n.getAlgorithmIdentifierName(u),s++}else r.alg="sha256";var l=i(t,a[s]);if(r.hash=l,a.length>s+1){var p=o(t,a[s+1]),h=this.getIssuerSerial(p);r.issuer=h.issuer,r.serial=h.serial}return r},this.getIssuerSerial=function(e){var t={},r=c(e,0),a=o(e,r[0]),s=n.getGeneralNames(a)[0].dn;t.issuer=s;var u=i(e,r[1]);return t.serial={hex:u},t},this.getCertificateSet=function(e){for(var t=c(e,0),n=[],r=0;r<t.length;r++){var i=o(e,t[r]);if("30"==i.substr(0,2)){var a=De(i,"CERTIFICATE");n.push(a)}}return{array:n,sortflag:!1}}},void 0!==ue&&ue||(ue={}),void 0!==ue.asn1&&ue.asn1||(ue.asn1={}),void 0!==ue.asn1.tsp&&ue.asn1.tsp||(ue.asn1.tsp={}),ue.asn1.tsp.TimeStampToken=function(e){var t=ue.asn1.tsp;t.TimeStampToken.superclass.constructor.call(this),this.params=null,this.getEncodedHexPrepare=function(){var e=new t.TSTInfo(this.params.econtent.content);this.params.econtent.content.hex=e.tohex()},null!=e&&this.setByParam(e)},et(ue.asn1.tsp.TimeStampToken,ue.asn1.cms.SignedData),ue.asn1.tsp.TSTInfo=function(e){Error;var t=ue.asn1,n=t.DERSequence,r=t.DERInteger,i=t.DERBoolean,o=t.DERGeneralizedTime,a=t.DERObjectIdentifier,s=t.DERTaggedObject,u=t.tsp,l=u.MessageImprint,c=u.Accuracy,p=(t.x509.X500Name,t.x509.GeneralName);if(u.TSTInfo.superclass.constructor.call(this),this.dVersion=new r({int:1}),this.dPolicy=null,this.dMessageImprint=null,this.dSerial=null,this.dGenTime=null,this.dAccuracy=null,this.dOrdering=null,this.dNonce=null,this.dTsa=null,this.tohex=function(){var e=[this.dVersion];if(null==this.dPolicy)throw new Error("policy shall be specified.");if(e.push(this.dPolicy),null==this.dMessageImprint)throw new Error("messageImprint shall be specified.");if(e.push(this.dMessageImprint),null==this.dSerial)throw new Error("serialNumber shall be specified.");if(e.push(this.dSerial),null==this.dGenTime)throw new Error("genTime shall be specified.");e.push(this.dGenTime),null!=this.dAccuracy&&e.push(this.dAccuracy),null!=this.dOrdering&&e.push(this.dOrdering),null!=this.dNonce&&e.push(this.dNonce),null!=this.dTsa&&e.push(this.dTsa);var t=new n({array:e});return this.hTLV=t.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==e){if("string"==typeof e.policy){if(!e.policy.match(/^[0-9.]+$/))throw"policy shall be oid like 0.1.4.134";this.dPolicy=new a({oid:e.policy})}void 0!==e.messageImprint&&(this.dMessageImprint=new l(e.messageImprint)),void 0!==e.serial&&(this.dSerial=new r(e.serial)),void 0!==e.genTime&&(this.dGenTime=new o(e.genTime)),void 0!==e.accuracy&&(this.dAccuracy=new c(e.accuracy)),void 0!==e.ordering&&1==e.ordering&&(this.dOrdering=new i),void 0!==e.nonce&&(this.dNonce=new r(e.nonce)),void 0!==e.tsa&&(this.dTsa=new s({tag:"a0",explicit:!0,obj:new p({dn:e.tsa})}))}},et(ue.asn1.tsp.TSTInfo,ue.asn1.ASN1Object),ue.asn1.tsp.Accuracy=function(e){var t=ue.asn1,n=t.ASN1Util.newObject;t.tsp.Accuracy.superclass.constructor.call(this),this.params=null,this.tohex=function(){var e=this.params,t=[];return null!=e.seconds&&"number"==typeof e.seconds&&t.push({int:e.seconds}),null!=e.millis&&"number"==typeof e.millis&&t.push({tag:{tagi:"80",obj:{int:e.millis}}}),null!=e.micros&&"number"==typeof e.micros&&t.push({tag:{tagi:"81",obj:{int:e.micros}}}),n({seq:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(ue.asn1.tsp.Accuracy,ue.asn1.ASN1Object),ue.asn1.tsp.MessageImprint=function(e){var t=ue.asn1,n=t.DERSequence,r=t.DEROctetString,i=t.x509.AlgorithmIdentifier;t.tsp.MessageImprint.superclass.constructor.call(this),this.params=null,this.tohex=function(){var e=this.params,t=new i({name:e.alg}),o=new r({hex:e.hash});return new n({array:[t,o]}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},et(ue.asn1.tsp.MessageImprint,ue.asn1.ASN1Object),ue.asn1.tsp.TimeStampReq=function(e){var t=ue.asn1,n=t.DERSequence,r=t.DERInteger,i=t.DERBoolean,o=(t.ASN1Object,t.DERObjectIdentifier),a=t.tsp,s=a.MessageImprint;a.TimeStampReq.superclass.constructor.call(this),this.params=null,this.tohex=function(){var e=this.params,t=[];return t.push(new r({int:1})),e.messageImprint instanceof ue.asn1.ASN1Object?t.push(e.messageImprint):t.push(new s(e.messageImprint)),null!=e.policy&&t.push(new o(e.policy)),null!=e.nonce&&t.push(new r(e.nonce)),1==e.certreq&&t.push(new i),new n({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(ue.asn1.tsp.TimeStampReq,ue.asn1.ASN1Object),ue.asn1.tsp.TimeStampResp=function(e){var t=ue.asn1,n=t.DERSequence,r=(t.ASN1Object,t.tsp),i=r.PKIStatusInfo;r.TimeStampResp.superclass.constructor.call(this),this.params=null,this.tohex=function(){var e=this.params,o=[];if(null!=e.econtent||null!=e.tst)if(null!=e.statusinfo?o.push(new i(e.statusinfo)):o.push(new i("granted")),null!=e.econtent)o.push(new r.TimeStampToken(e).getContentInfo());else{if(!(e.tst instanceof t.ASN1Object))throw new Error("improper member tst value");o.push(e.tst)}else{if(null==e.statusinfo)throw new Error("parameter for token nor statusinfo not specified");o.push(new i(e.statusinfo))}return new n({array:o}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(ue.asn1.tsp.TimeStampResp,ue.asn1.ASN1Object),ue.asn1.tsp.PKIStatusInfo=function(e){var t=Error,n=ue.asn1,r=n.DERSequence,i=n.tsp,o=i.PKIStatus,a=i.PKIFreeText,s=i.PKIFailureInfo;i.PKIStatusInfo.superclass.constructor.call(this),this.params=null,this.tohex=function(){var e=this.params,n=[];if("string"==typeof e)n.push(new o(e));else{if(null==e.status)throw new t("property 'status' unspecified");n.push(new o(e.status)),null!=e.statusstr&&n.push(new a(e.statusstr)),null!=e.failinfo&&n.push(new s(e.failinfo))}return new r({array:n}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(ue.asn1.tsp.PKIStatusInfo,ue.asn1.ASN1Object),ue.asn1.tsp.PKIStatus=function(e){var t=Error,n=ue.asn1,r=n.DERInteger;n.tsp.PKIStatus.superclass.constructor.call(this);var i={granted:0,grantedWithMods:1,rejection:2,waiting:3,revocationWarning:4,revocationNotification:5};this.params=null,this.tohex=function(){var e,n=this.params;if("string"==typeof n)try{e=i[n]}catch(e){throw new t("undefined name: "+n)}else{if("number"!=typeof n)throw new t("unsupported params");e=n}return new r({int:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(ue.asn1.tsp.PKIStatus,ue.asn1.ASN1Object),ue.asn1.tsp.PKIFreeText=function(e){var t=Error,n=ue.asn1,r=n.DERSequence,i=n.DERUTF8String;n.tsp.PKIFreeText.superclass.constructor.call(this),this.params=null,this.tohex=function(){var e=this.params;if(!e instanceof Array)throw new t("wrong params: not array");for(var n=[],o=0;o<e.length;o++)n.push(new i({str:e[o]}));return new r({array:n}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(ue.asn1.tsp.PKIFreeText,ue.asn1.ASN1Object),ue.asn1.tsp.PKIFailureInfo=function(e){var t=Error,n=ue.asn1,r=n.DERBitString,i=n.tsp.PKIFailureInfo,o={badAlg:0,badRequest:2,badDataFormat:5,timeNotAvailable:14,unacceptedPolicy:15,unacceptedExtension:16,addInfoNotAvailable:17,systemFailure:25};i.superclass.constructor.call(this),this.params=null,this.getBinValue=function(){var e=this.params,n=0;if("number"==typeof e&&0<=e&&e<=25){for(var r=(n|=1<<e).toString(2),i="",a=r.length-1;a>=0;a--)i+=r[a];return i}if("string"==typeof e&&null!=o[e])return Ze([e],o);if("object"==typeof e&&null!=e.length)return Ze(e,o);throw new t("wrong params")},this.tohex=function(){this.params;var e=this.getBinValue();return new r({bin:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(ue.asn1.tsp.PKIFailureInfo,ue.asn1.ASN1Object),ue.asn1.tsp.AbstractTSAAdapter=function(e){this.getTSTHex=function(e,t){throw"not implemented yet"}},ue.asn1.tsp.SimpleTSAAdapter=function(e){var t=ue,n=t.asn1.tsp,r=t.crypto.Util.hashHex;n.SimpleTSAAdapter.superclass.constructor.call(this),this.params=null,this.serial=0,this.getTSTHex=function(e,t){var i=r(e,t);this.params.econtent.content.messageImprint={alg:t,hash:i},this.params.econtent.content.serial={int:this.serial++};var o=Math.floor(1e9*Math.random());return this.params.econtent.content.nonce={int:o},new n.TimeStampToken(this.params).getContentInfoEncodedHex()},void 0!==e&&(this.params=e)},et(ue.asn1.tsp.SimpleTSAAdapter,ue.asn1.tsp.AbstractTSAAdapter),ue.asn1.tsp.FixedTSAAdapter=function(e){var t=ue,n=t.asn1.tsp,r=t.crypto.Util.hashHex;n.FixedTSAAdapter.superclass.constructor.call(this),this.params=null,this.getTSTHex=function(e,t){var i=r(e,t);return this.params.econtent.content.messageImprint={alg:t,hash:i},new n.TimeStampToken(this.params).getContentInfoEncodedHex()},void 0!==e&&(this.params=e)},et(ue.asn1.tsp.FixedTSAAdapter,ue.asn1.tsp.AbstractTSAAdapter),ue.asn1.tsp.TSPUtil=new function(){},ue.asn1.tsp.TSPUtil.newTimeStampToken=function(e){return new ue.asn1.tsp.TimeStampToken(e)},ue.asn1.tsp.TSPUtil.parseTimeStampReq=function(e){return(new ue.asn1.tsp.TSPParser).getTimeStampReq(e)},ue.asn1.tsp.TSPUtil.parseMessageImprint=function(e){return(new ue.asn1.tsp.TSPParser).getMessageImprint(e)},ue.asn1.tsp.TSPParser=function(){Error;var e=new ot,t=pe,n=t.getV,r=t.getTLV,i=t.getIdxbyList,o=(t.getTLVbyListEx,t.getChildIdx),a=["granted","grantedWithMods","rejection","waiting","revocationWarning","revocationNotification"],s={0:"badAlg",2:"badRequest",5:"badDataFormat",14:"timeNotAvailable",15:"unacceptedPolicy",16:"unacceptedExtension",17:"addInfoNotAvailable",25:"systemFailure"};this.getResponse=function(e){var t=o(e,0);if(1==t.length)return this.getPKIStatusInfo(r(e,t[0]));if(t.length>1){var n=this.getPKIStatusInfo(r(e,t[0])),i=r(e,t[1]),a=this.getToken(i);return a.statusinfo=n,a}},this.getToken=function(e){var t=(new ue.asn1.cms.CMSParser).getCMSSignedData(e);return this.setTSTInfo(t),t},this.setTSTInfo=function(e){var t=e.econtent;if("tstinfo"==t.type){var n=t.content.hex,r=this.getTSTInfo(n);t.content=r}},this.getTSTInfo=function(t){var i={},a=o(t,0),s=n(t,a[1]);i.policy=Ge(s);var u=r(t,a[2]);i.messageImprint=this.getMessageImprint(u);var l=n(t,a[3]);i.serial={hex:l};var c=n(t,a[4]);i.genTime={str:xe(c)};var p=0;if(a.length>5&&"30"==t.substr(a[5],2)){var h=r(t,a[5]);i.accuracy=this.getAccuracy(h),p++}a.length>5+p&&"01"==t.substr(a[5+p],2)&&("ff"==n(t,a[5+p])&&(i.ordering=!0),p++);if(a.length>5+p&&"02"==t.substr(a[5+p],2)){var d=n(t,a[5+p]);i.nonce={hex:d},p++}if(a.length>5+p&&"a0"==t.substr(a[5+p],2)){var f=r(t,a[5+p]);f="30"+f.substr(2),pGeneralNames=e.getGeneralNames(f);var g=pGeneralNames[0].dn;i.tsa=g,p++}if(a.length>5+p&&"a1"==t.substr(a[5+p],2)){var m=r(t,a[5+p]);m="30"+m.substr(2);var v=e.getExtParamArray(m);i.ext=v,p++}return i},this.getAccuracy=function(e){for(var t={},r=o(e,0),i=0;i<r.length;i++){var a=e.substr(r[i],2),s=n(e,r[i]),u=parseInt(s,16);"02"==a?t.seconds=u:"80"==a?t.millis=u:"81"==a&&(t.micros=u)}return t},this.getMessageImprint=function(e){if("30"!=e.substr(0,2))throw new Error("head of messageImprint hex shall be x30");var r={},a=(o(e,0),i(e,0,[0,0])),s=n(e,a),u=t.hextooidstr(s),l=ue.asn1.x509.OID.oid2name(u);if(""==l)throw new Error("hashAlg name undefined: "+u);var c=l,p=i(e,0,[1]);return r.alg=c,r.hash=n(e,p),r},this.getPKIStatusInfo=function(e){var t={},i=o(e,0),s=0;try{var u=n(e,i[0]),l=parseInt(u,16);t.status=a[l]}catch(e){}if(i.length>1&&"30"==e.substr(i[1],2)){var c=r(e,i[1]);t.statusstr=this.getPKIFreeText(c),s++}if(i.length>s&&"03"==e.substr(i[1+s],2)){var p=r(e,i[1+s]);t.failinfo=this.getPKIFailureInfo(p)}return t},this.getPKIFreeText=function(e){for(var n=[],r=o(e,0),i=0;i<r.length;i++)n.push(t.getString(e,r[i]));return n},this.getPKIFailureInfo=function(e){var n=t.getInt(e,0);return null!=s[n]?s[n]:n},this.getTimeStampReq=function(e){var i={certreq:!1},a=o(e,0);if(a.length<2)throw new Error("TimeStampReq must have at least 2 items");var s=r(e,a[1]);i.messageImprint=ue.asn1.tsp.TSPUtil.parseMessageImprint(s);for(var u=2;u<a.length;u++){var l=a[u],c=e.substr(l,2);if("06"==c){var p=n(e,l);i.policy=t.hextooidstr(p)}"02"==c&&(i.nonce=n(e,l)),"01"==c&&(i.certreq=!0)}return i}},void 0!==ue&&ue||(ue={}),void 0!==ue.asn1&&ue.asn1||(ue.asn1={}),void 0!==ue.asn1.cades&&ue.asn1.cades||(ue.asn1.cades={}),ue.asn1.cades.SignaturePolicyIdentifier=function(e){var t=ue.asn1.cades,n=t.SignaturePolicyId;t.SignaturePolicyIdentifier.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.16.2.15",this.params=null,this.getValueArray=function(){return[new n(this.params)]},this.setByParam=function(e){this.params=e},null!=e&&this.setByParam(e)},et(ue.asn1.cades.SignaturePolicyIdentifier,ue.asn1.cms.Attribute),ue.asn1.cades.SignaturePolicyId=function(e){var t=ue.asn1,n=t.DERSequence,r=t.DERObjectIdentifier,i=(t.x509.AlgorithmIdentifier,t.cades),o=i.SignaturePolicyId,a=i.OtherHashAlgAndValue;o.superclass.constructor.call(this),this.params=null,this.tohex=function(){var e=this.params,t=[];return t.push(new r(e.oid)),t.push(new a(e)),new n({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(e){this.params=e},null!=e&&this.setByParam(e)},et(ue.asn1.cades.SignaturePolicyId,ue.asn1.ASN1Object),ue.asn1.cades.OtherHashAlgAndValue=function(e){var t=Error,n=ue.asn1,r=n.DERSequence,i=n.DEROctetString,o=n.x509.AlgorithmIdentifier;n.cades.OtherHashAlgAndValue.superclass.constructor.call(this),this.params=null,this.tohex=function(){var e=this.params;if(null==e.alg)throw new t("property 'alg' not specified");if(null==e.hash&&null==e.cert)throw new t("property 'hash' nor 'cert' not specified");var n=null;if(null!=e.hash)n=e.hash;else if(null!=e.cert){if("string"!=typeof e.cert)throw new t("cert not string");var a=e.cert;-1!=e.cert.indexOf("-----BEGIN")&&(a=Te(e.cert)),n=ue.crypto.Util.hashHex(a,e.alg)}var s=[];return s.push(new o({name:e.alg})),s.push(new i({hex:n})),new r({array:s}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(ue.asn1.cades.OtherHashAlgAndValue,ue.asn1.ASN1Object),ue.asn1.cades.OtherHashValue=function(e){ue.asn1.cades.OtherHashValue.superclass.constructor.call(this);var t=Error,n=ue,r=(n.lang.String.isHex,n.asn1.DEROctetString);n.crypto.Util.hashHex;this.params=null,this.tohex=function(){var e=this.params;if(null==e.hash&&null==e.cert)throw new t("hash or cert not specified");var n=null;if(null!=e.hash)n=e.hash;else if(null!=e.cert){if("string"!=typeof e.cert)throw new t("cert not string");var i=e.cert;-1!=e.cert.indexOf("-----BEGIN")&&(i=Te(e.cert)),n=ue.crypto.Util.hashHex(i,"sha1")}return new r({hex:n}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(ue.asn1.cades.OtherHashValue,ue.asn1.ASN1Object),ue.asn1.cades.SignatureTimeStamp=function(e){var t=Error,n=ue,r=n.lang.String.isHex,i=n.asn1,o=i.ASN1Object;i.x509;i.cades.SignatureTimeStamp.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.16.2.14",this.params=null,this.getValueArray=function(){var e=this.params;if(null!=e.tst){if(r(e.tst))return(i=new o).hTLV=e.tst,[i];if(e.tst instanceof o)return[e.tst];throw new t("params.tst has wrong value")}if(null!=e.res){var n=e.res;if(n instanceof o&&(n=n.tohex()),"string"!=typeof n||!r(n))throw new t("params.res has wrong value");var i;pe.getTLVbyList(n,0,[1]);return(i=new o).hTLV=e.tst,[i]}},null!=e&&this.setByParam(e)},et(ue.asn1.cades.SignatureTimeStamp,ue.asn1.cms.Attribute),ue.asn1.cades.CompleteCertificateRefs=function(e){var t=Error,n=ue,r=n.asn1,i=r.DERSequence,o=r.cades,a=o.OtherCertID,s=n.lang.String.isHex;o.CompleteCertificateRefs.superclass.constructor.call(this),this.typeOid="1.2.840.113549.1.9.16.2.21",this.params=null,this.getValueArray=function(){for(var e=this.params,n=[],r=0;r<e.array.length;r++){var o=e.array[r];if("string"==typeof o)if(-1!=o.indexOf("-----BEGIN"))o={cert:o};else{if(!s(o))throw new t("unsupported value: "+o);o={hash:o}}null!=e.alg&&null==o.alg&&(o.alg=e.alg),null!=e.hasis&&null==o.hasis&&(o.hasis=e.hasis);var u=new a(o);n.push(u)}return[new i({array:n})]},null!=e&&this.setByParam(e)},et(ue.asn1.cades.CompleteCertificateRefs,ue.asn1.cms.Attribute),ue.asn1.cades.OtherCertID=function(e){var t=ue.asn1,n=t.DERSequence,r=t.cms.IssuerSerial,i=t.cades,o=i.OtherHashValue,a=i.OtherHashAlgAndValue;i.OtherCertID.superclass.constructor.call(this),this.params=e,this.tohex=function(){var e=this.params;"string"==typeof e&&(-1!=e.indexOf("-----BEGIN")?e={cert:e}:_isHex(e)&&(e={hash:e}));var t=[],i=null;if(i=null!=e.alg?new a(e):new o(e),t.push(i),null!=e.cert&&1==e.hasis||null!=e.issuer&&null!=e.serial){var s=new r(e);t.push(s)}return new n({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(ue.asn1.cades.OtherCertID,ue.asn1.ASN1Object),ue.asn1.cades.OtherHash=function(e){Error;var t=ue,n=t.asn1,r=(n.cms,n.cades),i=r.OtherHashAlgAndValue,o=r.OtherHashValue,a=(t.crypto.Util.hashHex,t.lang.String.isHex);r.OtherHash.superclass.constructor.call(this),this.params=null,this.tohex=function(){var e=this.params;"string"==typeof e&&(-1!=e.indexOf("-----BEGIN")?e={cert:e}:a(e)&&(e={hash:e}));return(null!=e.alg?new i(e):new o(e)).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(ue.asn1.cades.OtherHash,ue.asn1.ASN1Object),ue.asn1.cades.CAdESUtil=new function(){},ue.asn1.cades.CAdESUtil.parseSignedDataForAddingUnsigned=function(e){return(new ue.asn1.cms.CMSParser).getCMSSignedData(e)},ue.asn1.cades.CAdESUtil.parseSignerInfoForAddingUnsigned=function(e,t,n){var r=pe,i=r.getChildIdx,o=r.getTLV,a=r.getV,s=ue.asn1,u=s.ASN1Object,l=s.cms,c=l.AttributeList,p=l.SignerInfo,h={},d=i(e,t);if(6!=d.length)throw"not supported items for SignerInfo (!=6)";var f=d.shift();h.version=o(e,f);var g=d.shift();h.si=o(e,g);var m=d.shift();h.digalg=o(e,m);var v=d.shift();h.sattrs=o(e,v);var y=d.shift();h.sigalg=o(e,y);var b=d.shift();h.sig=o(e,b),h.sigval=a(e,b);var w=null;return h.obj=new p,(w=new u).hTLV=h.version,h.obj.dCMSVersion=w,(w=new u).hTLV=h.si,h.obj.dSignerIdentifier=w,(w=new u).hTLV=h.digalg,h.obj.dDigestAlgorithm=w,(w=new u).hTLV=h.sattrs,h.obj.dSignedAttrs=w,(w=new u).hTLV=h.sigalg,h.obj.dSigAlg=w,(w=new u).hTLV=h.sig,h.obj.dSig=w,h.obj.dUnsignedAttrs=new c,h},void 0!==ue.asn1.csr&&ue.asn1.csr||(ue.asn1.csr={}),ue.asn1.csr.CertificationRequest=function(e){var t=ue.asn1,n=t.DERBitString,r=t.DERSequence,i=t.csr,o=(t.x509,i.CertificationRequestInfo);i.CertificationRequest.superclass.constructor.call(this),this.setByParam=function(e){this.params=e},this.sign=function(){var e=new o(this.params).tohex(),t=new ue.crypto.Signature({alg:this.params.sigalg});t.init(this.params.sbjprvkey),t.updateHex(e);var n=t.sign();this.params.sighex=n},this.getPEM=function(){return De(this.tohex(),"CERTIFICATE REQUEST")},this.tohex=function(){var e=this.params,t=new ue.asn1.csr.CertificationRequestInfo(this.params),i=new ue.asn1.x509.AlgorithmIdentifier({name:e.sigalg});if(null==e.sighex&&null!=e.sbjprvkey&&this.sign(),null==e.sighex)throw new Error("sighex or sbjprvkey parameter not defined");var o=new n({hex:"00"+e.sighex});return new r({array:[t,i,o]}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},et(ue.asn1.csr.CertificationRequest,ue.asn1.ASN1Object),ue.asn1.csr.CertificationRequestInfo=function(e){var t=ue.asn1,n=(t.DERBitString,t.DERSequence),r=t.DERInteger,i=t.DERUTF8String,o=t.DERTaggedObject,a=t.ASN1Util.newObject,s=t.csr,u=t.x509,l=u.X500Name,c=u.Extensions,p=u.SubjectPublicKeyInfo;s.AttributeList;s.CertificationRequestInfo.superclass.constructor.call(this),this.params=null,this.setByParam=function(e){null!=e&&(this.params=e)},this.tohex=function(){var e=this.params,t=[];if(t.push(new r({int:0})),t.push(new l(e.subject)),t.push(new p(tt.getKey(e.sbjpubkey))),null!=e.attrs){var s=function(e){for(var t=Error,n=ue.asn1.x509.Extensions,r=[],i=0;i<e.length;i++){var o=e[i],a=o.attr;if("extensionRequest"==a){var s={seq:[{oid:"1.2.840.113549.1.9.14"},{set:[new n(o.ext)]}]};r.push(s)}else if("unstructuredName"==a){s={seq:[{oid:"1.2.840.113549.1.9.2"},{set:o.names}]};r.push(s)}else{if("challengePassword"!=a)throw new t("unknown CSR attribute");s={seq:[{oid:"1.2.840.113549.1.9.7"},{set:[{utf8str:o.password}]}]};r.push(s)}}return{set:r}}(e.attrs),u=a({tag:{tage:"a0",obj:s}});t.push(u)}else if(null!=e.extreq){var h=new c(e.extreq);u=a({tag:{tage:"a0",obj:{seq:[{oid:"1.2.840.113549.1.9.14"},{set:[h]}]}}});t.push(u)}else t.push(new o({tag:"a0",explicit:!1,obj:new i({str:""})}));return new n({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(ue.asn1.csr.CertificationRequestInfo,ue.asn1.ASN1Object),ue.asn1.csr.AttributeList=function(e){},et(ue.asn1.csr.AttributeList,ue.asn1.ASN1Object),ue.asn1.csr.CSRUtil=new function(){},ue.asn1.csr.CSRUtil.newCSRPEM=function(e){return new ue.asn1.csr.CertificationRequest(e).getPEM()},ue.asn1.csr.CSRUtil.getParam=function(e,t){var n=pe,r=n.getV,i=n.getIdxbyList,o=n.getTLVbyList,a=n.getTLVbyListEx,s=n.getVbyListEx,u={};if(-1==e.indexOf("-----BEGIN CERTIFICATE REQUEST"))throw new Error("argument is not PEM file");var l=Te(e,"CERTIFICATE REQUEST");t&&(u.tbs=o(l,0,[0]));try{var c=a(l,0,[0,1]);if("3000"==c)u.subject={};else{var p=new ot;u.subject=p.getX500Name(c)}}catch(e){}var h=a(l,0,[0,2]),d=tt.getKey(h,null,"pkcs8pub");u.sbjpubkey=tt.getPEM(d,"PKCS8PUB");var f=function(e){var t=i(e,0,[0,3,0,0],"06");return"2a864886f70d01090e"!=r(e,t)?null:o(e,0,[0,3,0,1,0],"30")}(l);p=new ot;null!=f&&(u.extreq=p.getExtParamArray(f));try{var g=a(l,0,[1],"30");p=new ot;u.sigalg=p.getAlgorithmIdentifierName(g)}catch(e){}try{var m=s(l,0,[2]);u.sighex=m}catch(e){}return u},ue.asn1.csr.CSRUtil.verifySignature=function(e){try{var t=null;if("string"==typeof e&&-1!=e.indexOf("-----BEGIN CERTIFICATE REQUEST")?t=ue.asn1.csr.CSRUtil.getParam(e,!0):"object"==typeof e&&null!=e.sbjpubkey&&null!=e.sigalg&&null!=e.sighex&&null!=e.tbs&&(t=e),null==t)return!1;var n=new ue.crypto.Signature({alg:t.sigalg});return n.init(t.sbjpubkey),n.updateHex(t.tbs),n.verify(t.sighex)}catch(e){return alert(e),!1}},void 0!==ue&&ue||(ue={}),void 0!==ue.asn1&&ue.asn1||(ue.asn1={}),void 0!==ue.asn1.ocsp&&ue.asn1.ocsp||(ue.asn1.ocsp={}),ue.asn1.ocsp.DEFAULT_HASH="sha1",ue.asn1.ocsp.OCSPResponse=function(e){ue.asn1.ocsp.OCSPResponse.superclass.constructor.call(this);ue.asn1.DEREnumerated;var t=ue.asn1.ASN1Util.newObject,n=ue.asn1.ocsp.ResponseBytes,r=["successful","malformedRequest","internalError","tryLater","_not_used_","sigRequired","unauthorized"];this.params=null,this._getStatusCode=function(){var e=this.params.resstatus;return"number"==typeof e?e:"string"!=typeof e?-1:r.indexOf(e)},this.setByParam=function(e){this.params=e},this.tohex=function(){var e=this.params,r=this._getStatusCode();if(-1==r)throw new Error("responseStatus not supported: "+e.resstatus);if(0!=r)return t({seq:[{enum:{int:r}}]}).tohex();var i=new n(e);return t({seq:[{enum:{int:0}},{tag:{tag:"a0",explicit:!0,obj:i}}]}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},et(ue.asn1.ocsp.OCSPResponse,ue.asn1.ASN1Object),ue.asn1.ocsp.ResponseBytes=function(e){ue.asn1.ocsp.ResponseBytes.superclass.constructor.call(this);var t=ue.asn1,n=t.DERSequence,r=t.DERObjectIdentifier,i=t.DEROctetString,o=t.ocsp.BasicOCSPResponse;this.params=null,this.setByParam=function(e){this.params=e},this.tohex=function(){var e=this.params;if("ocspBasic"!=e.restype)throw new Error("not supported responseType: "+e.restype);var t=new o(e),a=[];return a.push(new r({name:"ocspBasic"})),a.push(new i({hex:t.tohex()})),new n({array:a}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},et(ue.asn1.ocsp.ResponseBytes,ue.asn1.ASN1Object),ue.asn1.ocsp.BasicOCSPResponse=function(e){ue.asn1.ocsp.BasicOCSPResponse.superclass.constructor.call(this);var t=Error,n=ue.asn1,r=n.ASN1Object,i=n.DERSequence,o=(n.DERGeneralizedTime,n.DERTaggedObject),a=n.DERBitString,s=(n.x509.Extensions,n.x509.AlgorithmIdentifier),u=n.ocsp;u.ResponderID;_SingleResponseList=u.SingleResponseList,_ResponseData=u.ResponseData,this.params=null,this.setByParam=function(e){this.params=e},this.sign=function(){var e=this.params,t=e.tbsresp.tohex(),n=new ue.crypto.Signature({alg:e.sigalg});n.init(e.reskey),n.updateHex(t),e.sighex=n.sign()},this.tohex=function(){var e=this.params;null==e.tbsresp&&(e.tbsresp=new _ResponseData(e)),null==e.sighex&&null!=e.reskey&&this.sign();var n=[];if(n.push(e.tbsresp),n.push(new s({name:e.sigalg})),n.push(new a({hex:"00"+e.sighex})),null!=e.certs&&null!=e.certs.length){for(var u=[],l=0;l<e.certs.length;l++){var c=e.certs[l],p=null;if(pe.isASN1HEX(c))p=c;else{if(!c.match(/-----BEGIN/))throw new t("certs["+l+"] not hex or PEM");p=Te(c)}u.push(new r({tlv:p}))}var h=new i({array:u});n.push(new o({tag:"a0",explicit:!0,obj:h}))}return new i({array:n}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},et(ue.asn1.ocsp.BasicOCSPResponse,ue.asn1.ASN1Object),ue.asn1.ocsp.ResponseData=function(e){ue.asn1.ocsp.ResponseData.superclass.constructor.call(this);var t=Error,n=ue.asn1,r=n.DERSequence,i=n.DERGeneralizedTime,o=n.DERTaggedObject,a=n.x509.Extensions,s=n.ocsp,u=s.ResponderID;_SingleResponseList=s.SingleResponseList,this.params=null,this.tohex=function(){var e=this.params;null!=e.respid&&new t("respid not specified"),null!=e.prodat&&new t("prodat not specified"),null!=e.array&&new t("array not specified");var n=[];if(n.push(new u(e.respid)),n.push(new i(e.prodat)),n.push(new _SingleResponseList(e.array)),null!=e.ext){var s=new a(e.ext);n.push(new o({tag:"a1",explicit:!0,obj:s}))}return new r({array:n}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(e){this.params=e},void 0!==e&&this.setByParam(e)},et(ue.asn1.ocsp.ResponseData,ue.asn1.ASN1Object),ue.asn1.ocsp.ResponderID=function(e){ue.asn1.ocsp.ResponderID.superclass.constructor.call(this);var t=ue,n=t.asn1,r=n.ASN1Util.newObject,i=n.x509.X500Name,o=t.lang.String.isHex,a=Error;this.params=null,this.tohex=function(){var e=this.params;if(null!=e.key){var t,n=null;if("string"==typeof e.key){if(o(e.key)&&(n=e.key),e.key.match(/-----BEGIN CERTIFICATE/))null!=(t=new ot(e.key).getExtSubjectKeyIdentifier())&&(n=t.kid.hex)}else if(e.key instanceof ot)null!=(t=e.key.getExtSubjectKeyIdentifier())&&(n=t.kid.hex);if(null==n)throw new a("wrong key member value");return r({tag:{tag:"a2",explicit:!0,obj:{octstr:{hex:n}}}}).tohex()}if(null!=e.name){var s=null;if("string"==typeof e.name&&e.name.match(/-----BEGIN CERTIFICATE/))s=new ot(e.name).getSubject();else e.name instanceof ot?s=e.name.getSubject():"object"!=typeof e.name||null==e.name.array&&null==e.name.str||(s=e.name);if(null==s)throw new a("wrong name member value");return r({tag:{tag:"a1",explicit:!0,obj:new i(s)}}).tohex()}throw new a("key or name not specified")},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(e){this.params=e},void 0!==e&&this.setByParam(e)},et(ue.asn1.ocsp.ResponderID,ue.asn1.ASN1Object),ue.asn1.ocsp.SingleResponseList=function(e){ue.asn1.ocsp.SingleResponseList.superclass.constructor.call(this);var t=ue.asn1,n=t.DERSequence,r=t.ocsp.SingleResponse;this.params=null,this.tohex=function(){var e=this.params;if("object"!=typeof e||null==e.length)throw new Error("params not specified properly");for(var t=[],i=0;i<e.length;i++)t.push(new r(e[i]));return new n({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(e){this.params=e},void 0!==e&&this.setByParam(e)},et(ue.asn1.ocsp.SingleResponseList,ue.asn1.ASN1Object),ue.asn1.ocsp.SingleResponse=function(e){var t=Error,n=ue.asn1,r=n.DERSequence,i=n.DERGeneralizedTime,o=n.DERTaggedObject,a=n.ocsp,s=a.CertID,u=a.CertStatus,l=n.x509.Extensions;a.SingleResponse.superclass.constructor.call(this),this.params=null,this.tohex=function(){var e=this.params,n=[];if(null==e.certid)throw new t("certid unspecified");if(null==e.status)throw new t("status unspecified");if(null==e.thisupdate)throw new t("thisupdate unspecified");if(n.push(new s(e.certid)),n.push(new u(e.status)),n.push(new i(e.thisupdate)),null!=e.nextupdate){var a=new i(e.nextupdate);n.push(new o({tag:"a0",explicit:!0,obj:a}))}if(null!=e.ext){var c=new l(e.ext);n.push(new o({tag:"a1",explicit:!0,obj:c}))}return new r({array:n}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(e){this.params=e},void 0!==e&&this.setByParam(e)},et(ue.asn1.ocsp.SingleResponse,ue.asn1.ASN1Object),ue.asn1.ocsp.CertID=function(e){var t=ue,n=t.asn1,r=n.DEROctetString,i=n.DERInteger,o=n.DERSequence,a=n.x509.AlgorithmIdentifier,s=n.ocsp,u=(s.DEFAULT_HASH,t.crypto.Util.hashHex),l=ot,c=pe.getVbyList;s.CertID.superclass.constructor.call(this),this.DEFAULT_HASH="sha1",this.params=null,this.setByValue=function(e,t,n,r){null==r&&(r=this.DEFAULT_HASH),this.params={alg:r,issname:e,isskey:t,sbjsn:n}},this.setByCert=function(e,t,n){null==n&&(n=this.DEFAULT_HASH),this.params={alg:n,issuerCert:e,subjectCert:t}},this.getParamByCerts=function(e,t,n){null==n&&(n=this.DEFAULT_HASH);var r=new l(e),i=new l(t),o=u(r.getSubjectHex(),n),a=r.getPublicKeyHex();return{alg:n,issname:o,isskey:u(c(a,0,[1],"03",!0),n),sbjsn:i.getSerialNumberHex()}},this.tohex=function(){if("object"!=typeof this.params)throw new Error("params not set");var e,t,n,s,u=this.params;if(s=null==u.alg?this.DEFAULT_HASH:u.alg,null!=u.issuerCert&&null!=u.subjectCert){var l=this.getParamByCerts(u.issuerCert,u.subjectCert,s);e=l.issname,t=l.isskey,n=l.sbjsn}else{if(null==u.issname||null==u.isskey||null==u.sbjsn)throw new Error("required param members not defined");e=u.issname,t=u.isskey,n=u.sbjsn}var c=new a({name:s}),p=new r({hex:e}),h=new r({hex:t}),d=new i({hex:n}),f=new o({array:[c,p,h,d]});return this.hTLV=f.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},et(ue.asn1.ocsp.CertID,ue.asn1.ASN1Object),ue.asn1.ocsp.CertStatus=function(e){ue.asn1.ocsp.CertStatus.superclass.constructor.call(this),this.params=null,this.tohex=function(){var e=this.params;if("good"==e.status)return"8000";if("unknown"==e.status)return"8200";if("revoked"==e.status){var t=[{gentime:{str:e.time}}];null!=e.reason&&t.push({tag:{tag:"a0",explicit:!0,obj:{enum:{int:e.reason}}}});var n={tag:"a1",explicit:!1,obj:{seq:t}};return ue.asn1.ASN1Util.newObject({tag:n}).tohex()}throw new Error("bad status")},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(e){this.params=e},void 0!==e&&this.setByParam(e)},et(ue.asn1.ocsp.CertStatus,ue.asn1.ASN1Object),ue.asn1.ocsp.Request=function(e){var t=ue.asn1,n=t.DERSequence,r=t.ocsp;if(r.Request.superclass.constructor.call(this),this.dReqCert=null,this.dExt=null,this.tohex=function(){var e=[];if(null===this.dReqCert)throw"reqCert not set";e.push(this.dReqCert);var t=new n({array:e});return this.hTLV=t.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==e){var i=new r.CertID(e);this.dReqCert=i}},et(ue.asn1.ocsp.Request,ue.asn1.ASN1Object),ue.asn1.ocsp.TBSRequest=function(e){var t=ue.asn1,n=t.DERSequence,r=t.ocsp;r.TBSRequest.superclass.constructor.call(this),this.version=0,this.dRequestorName=null,this.dRequestList=[],this.dRequestExt=null,this.setRequestListByParam=function(e){for(var t=[],n=0;n<e.length;n++){var i=new r.Request(e[0]);t.push(i)}this.dRequestList=t},this.tohex=function(){var e=[];if(0!==this.version)throw"not supported version: "+this.version;if(null!==this.dRequestorName)throw"requestorName not supported";var t=new n({array:this.dRequestList});if(e.push(t),null!==this.dRequestExt)throw"requestExtensions not supported";var r=new n({array:e});return this.hTLV=r.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&void 0!==e.reqList&&this.setRequestListByParam(e.reqList)},et(ue.asn1.ocsp.TBSRequest,ue.asn1.ASN1Object),ue.asn1.ocsp.OCSPRequest=function(e){var t=ue.asn1,n=t.DERSequence,r=t.ocsp;if(r.OCSPRequest.superclass.constructor.call(this),this.dTbsRequest=null,this.dOptionalSignature=null,this.tohex=function(){var e=[];if(null===this.dTbsRequest)throw"tbsRequest not set";if(e.push(this.dTbsRequest),null!==this.dOptionalSignature)throw"optionalSignature not supported";var t=new n({array:e});return this.hTLV=t.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&void 0!==e.reqList){var i=new r.TBSRequest(e);this.dTbsRequest=i}},et(ue.asn1.ocsp.OCSPRequest,ue.asn1.ASN1Object),ue.asn1.ocsp.OCSPUtil={},ue.asn1.ocsp.OCSPUtil.getRequestHex=function(e,t,n){var r=ue.asn1.ocsp;void 0===n&&(n=r.DEFAULT_HASH);var i={alg:n,issuerCert:e,subjectCert:t};return new r.OCSPRequest({reqList:[i]}).tohex()},ue.asn1.ocsp.OCSPUtil.getOCSPResponseInfo=function(e){var t=pe,n=t.getVbyList,r=t.getVbyListEx,i=t.getIdxbyList,o=(t.getIdxbyListEx,t.getV),a={};try{var s=r(e,0,[0],"0a");a.responseStatus=parseInt(s,16)}catch(e){}if(0!==a.responseStatus)return a;try{var u=i(e,0,[1,0,1,0,0,2,0,1]);"80"===e.substr(u,2)?a.certStatus="good":"a1"===e.substr(u,2)?(a.certStatus="revoked",a.revocationTime=xe(n(e,u,[0]))):"82"===e.substr(u,2)&&(a.certStatus="unknown")}catch(e){}try{var l=i(e,0,[1,0,1,0,0,2,0,2]);a.thisUpdate=xe(o(e,l))}catch(e){}try{var c=i(e,0,[1,0,1,0,0,2,0,3]);"a0"===e.substr(c,2)&&(a.nextUpdate=xe(n(e,c,[0])))}catch(e){}return a},ue.asn1.ocsp.OCSPParser=function(){var e=Error,t=ot,n=new t,r=pe,i=r.getV,o=r.getTLV,a=r.getIdxbyList,s=r.getVbyList,u=r.getTLVbyList,l=r.getVbyListEx,c=r.getTLVbyListEx,p=r.getChildIdx;this.getOCSPRequest=function(t){var n=p(t,0);if(1!=n.length&&2!=n.length)throw new e("wrong number elements: "+n.length);return this.getTBSRequest(o(t,n[0]))},this.getTBSRequest=function(e){var t={},r=c(e,0,[0],"30");t.array=this.getRequestList(r);var i=c(e,0,["[2]",0],"30");return null!=i&&(t.ext=n.getExtParamArray(i)),t},this.getRequestList=function(e){for(var t=[],n=p(e,0),r=0;r<n.length;r++){e=o(e,n[r]);t.push(this.getRequest(e))}return t},this.getRequest=function(t){var r=p(t,0);if(1!=r.length&&2!=r.length)throw new e("wrong number elements: "+r.length);var i=this.getCertID(o(t,r[0]));if(2==r.length){var s=a(t,0,[1,0]);i.ext=n.getExtParamArray(o(t,s))}return i},this.getCertID=function(n){var r=p(n,0);if(4!=r.length)throw new e("wrong number elements: "+r.length);var a=new t,s={};return s.alg=a.getAlgorithmIdentifierName(o(n,r[0])),s.issname=i(n,r[1]),s.isskey=i(n,r[2]),s.sbjsn=i(n,r[3]),s},this.getOCSPResponse=function(e){var t,n=p(e,0),r=i(e,n[0]),o=parseInt(r);if(1==n.length)return{resstatus:o};var a=u(e,0,[1,0]);return(t=this.getResponseBytes(a)).resstatus=o,t},this.getResponseBytes=function(e){var t,n=p(e,0),r=u(e,0,[1,0]);t=this.getBasicOCSPResponse(r);var o=i(e,n[0]);return t.restype=ue.asn1.x509.OID.oid2name(Ge(o)),t},this.getBasicOCSPResponse=function(e){var t,n=p(e,0);t=this.getResponseData(o(e,n[0]));var r=new ot;t.alg=r.getAlgorithmIdentifierName(o(e,n[1]));var a=i(e,n[2]);t.sighex=a.substr(2);var s=l(e,0,["[0]"]);if(null!=s){for(var u=p(s,0),c=[],h=0;h<u.length;h++){var d=o(s,u[h]);c.push(d)}t.certs=c}return t},this.getResponseData=function(e){var t=p(e,0),n=t.length,r={},a=0;"a0"==e.substr(t[0],2)&&a++,r.respid=this.getResponderID(o(e,t[a++]));var s=i(e,t[a++]);if(r.prodat=xe(s),r.array=this.getSingleResponseList(o(e,t[a++])),"a1"==e.substr(t[n-1],2)){var l=u(e,t[n-1],[0]),c=new ot;r.ext=c.getExtParamArray(l)}return r},this.getResponderID=function(e){var t={};if("a2"==e.substr(0,2)){var n=s(e,0,[0]);t.key=n}if("a1"==e.substr(0,2)){var r=u(e,0,[0]),i=new ot;t.name=i.getX500Name(r)}return t},this.getSingleResponseList=function(e){for(var t=p(e,0),n=[],r=0;r<t.length;r++){var i=this.getSingleResponse(o(e,t[r]));n.push(i)}return n},this.getSingleResponse=function(e){var t=p(e,0),n={},r=this.getCertID(o(e,t[0]));n.certid=r;var a=this.getCertStatus(o(e,t[1]));if(n.status=a,"18"==e.substr(t[2],2)){var l=i(e,t[2]);n.thisupdate=xe(l)}for(var c=3;c<t.length;c++){if("a0"==e.substr(t[c],2)){var h=s(e,t[c],[0],"18");n.nextupdate=xe(h)}if("a1"==e.substr(t[c],2)){var d=new ot,f=u(e,0,[c,0]);n.ext=d.getExtParamArray(f)}}return n},this.getCertStatus=function(e){var t={};if("8000"==e)return{status:"good"};if("8200"==e)return{status:"unknown"};if("a1"==e.substr(0,2)){t.status="revoked";var n=xe(s(e,0,[0]));t.time=n}return t}},void 0!==ue&&ue||(ue={}),void 0!==ue.lang&&ue.lang||(ue.lang={}),ue.lang.String=function(){},"function"==typeof e?(le=function(t){return me(e.from(t,"utf8").toString("base64"))},ce=function(t){return e.from(ve(t),"base64").toString("utf8")}):(le=function(e){return ye(Oe(He(e)))},ce=function(e){return decodeURIComponent(ke(be(e)))}),ue.lang.String.isInteger=function(e){return!!e.match(/^[0-9]+$/)||!!e.match(/^-[0-9]+$/)},ue.lang.String.isHex=function(e){return Ve(e)},ue.lang.String.isBase64=function(e){return!(!(e=e.replace(/\s+/g,"")).match(/^[0-9A-Za-z+\/]+={0,3}$/)||e.length%4!=0)},ue.lang.String.isBase64URL=function(e){return!e.match(/[+/=]/)&&(e=ve(e),ue.lang.String.isBase64(e))},ue.lang.String.isIntegerArray=function(e){return!!(e=e.replace(/\s+/g,"")).match(/^\[[0-9,]+\]$/)},ue.lang.String.isPrintable=function(e){return null!==e.match(/^[0-9A-Za-z '()+,-./:=?]*$/)},ue.lang.String.isIA5=function(e){return null!==e.match(/^[\x20-\x21\x23-\x7f]*$/)},ue.lang.String.isMail=function(e){return null!==e.match(/^[A-Za-z0-9]{1}[A-Za-z0-9_.-]*@{1}[A-Za-z0-9_.-]{1,}\.[A-Za-z0-9]{1,}$/)};function ze(e){var t=function(e){var t=e.toString(16);return 1==t.length&&(t="0"+t),t},n=function(e){var n="",r=parseInt(e,10).toString(2),i=7-r.length%7;7==i&&(i=0);for(var o="",a=0;a<i;a++)o+="0";r=o+r;for(a=0;a<r.length-1;a+=7){var s=r.substr(a,7);a!=r.length-7&&(s="1"+s),n+=t(parseInt(s,2))}return n};try{if(!e.match(/^[0-9.]+$/))return null;var r="",i=e.split("."),o=40*parseInt(i[0],10)+parseInt(i[1],10);r+=t(o),i.splice(0,2);for(var a=0;a<i.length;a++)r+=n(i[a]);return r}catch(e){return null}}function Ge(e){if(!Ve(e))return null;try{var t=[],n=e.substr(0,2),r=parseInt(n,16);t[0]=new String(Math.floor(r/40)),t[1]=new String(r%40);for(var i=e.substr(2),o=[],a=0;a<i.length/2;a++)o.push(parseInt(i.substr(2*a,2),16));var s=[],u="";for(a=0;a<o.length;a++)128&o[a]?u+=We((127&o[a]).toString(2),7):(u+=We((127&o[a]).toString(2),7),s.push(new String(parseInt(u,2))),u="");var l=t.join(".");return s.length>0&&(l=l+"."+s.join(".")),l}catch(e){return null}}var We=function(e,t,n){return null==n&&(n="0"),e.length>=t?e:new Array(t-e.length+1).join(n)+e};function Ye(e){if(e.length%2!=0)return-1;if(null==(e=e.toLowerCase()).match(/^[0-9a-f]+$/))return-1;try{var t=e.substr(0,2);if("00"==t)return parseInt(e.substr(2),16);var n=parseInt(t,16);if(n>7)return-1;var r=e.substr(2),i=parseInt(r,16).toString(2);"0"==i&&(i="00000000"),i=i.slice(0,0-n);var o=parseInt(i,2);return NaN==o?-1:o}catch(e){return-1}}function Xe(e){if("number"!=typeof e)return null;if(e<0)return null;var t=Number(e).toString(2),n=8-t.length%8;8==n&&(n=0),t+=We("",n,"0");var r=parseInt(t,2).toString(16);return r.length%2==1&&(r="0"+r),"0"+n+r}function Je(e){if("string"!=typeof e)return null;if(e.length%2!=0)return null;if(!e.match(/^[0-9a-f]+$/))return null;try{var t=parseInt(e.substr(0,2),16);if(t<0||7<t)return null;for(var n=e.substr(2),r="",i=0;i<n.length;i+=2){var o=n.substr(i,2),a=parseInt(o,16).toString(2);r+=a=("0000000"+a).slice(-8)}return r.substr(0,r.length-t)}catch(e){return null}}function Ze(e,t){for(var n=0,r=0;r<e.length;r++)n|=1<<t[e[r]];var i=n.toString(2),o="";for(r=i.length-1;r>=0;r--)o+=i[r];return o}function Qe(e,t,n){if("object"==typeof e){t=String(t).split(".");for(var r=0;r<t.length&&e;r++){var i=t[r];i.match(/^[0-9]+$/)&&(i=parseInt(i)),e=e[i]}return e||!1===e?e:n}}function et(e,t){var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e,e.superclass=t.prototype,t.prototype.constructor==Object.prototype.constructor&&(t.prototype.constructor=t)}void 0!==ue&&ue||(ue={}),void 0!==ue.crypto&&ue.crypto||(ue.crypto={}),ue.crypto.Util=new function(){this.DIGESTINFOHEAD={sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",ripemd160:"3021300906052b2403020105000414"},this.DEFAULTPROVIDER={md5:"cryptojs",sha1:"cryptojs",sha224:"cryptojs",sha256:"cryptojs",sha384:"cryptojs",sha512:"cryptojs",ripemd160:"cryptojs",hmacmd5:"cryptojs",hmacsha1:"cryptojs",hmacsha224:"cryptojs",hmacsha256:"cryptojs",hmacsha384:"cryptojs",hmacsha512:"cryptojs",hmacripemd160:"cryptojs",MD5withRSA:"cryptojs/jsrsa",SHA1withRSA:"cryptojs/jsrsa",SHA224withRSA:"cryptojs/jsrsa",SHA256withRSA:"cryptojs/jsrsa",SHA384withRSA:"cryptojs/jsrsa",SHA512withRSA:"cryptojs/jsrsa",RIPEMD160withRSA:"cryptojs/jsrsa",MD5withECDSA:"cryptojs/jsrsa",SHA1withECDSA:"cryptojs/jsrsa",SHA224withECDSA:"cryptojs/jsrsa",SHA256withECDSA:"cryptojs/jsrsa",SHA384withECDSA:"cryptojs/jsrsa",SHA512withECDSA:"cryptojs/jsrsa",RIPEMD160withECDSA:"cryptojs/jsrsa",SHA1withDSA:"cryptojs/jsrsa",SHA224withDSA:"cryptojs/jsrsa",SHA256withDSA:"cryptojs/jsrsa",MD5withRSAandMGF1:"cryptojs/jsrsa",SHAwithRSAandMGF1:"cryptojs/jsrsa",SHA1withRSAandMGF1:"cryptojs/jsrsa",SHA224withRSAandMGF1:"cryptojs/jsrsa",SHA256withRSAandMGF1:"cryptojs/jsrsa",SHA384withRSAandMGF1:"cryptojs/jsrsa",SHA512withRSAandMGF1:"cryptojs/jsrsa",RIPEMD160withRSAandMGF1:"cryptojs/jsrsa"},this.CRYPTOJSMESSAGEDIGESTNAME={md5:g.algo.MD5,sha1:g.algo.SHA1,sha224:g.algo.SHA224,sha256:g.algo.SHA256,sha384:g.algo.SHA384,sha512:g.algo.SHA512,ripemd160:g.algo.RIPEMD160},this.getDigestInfoHex=function(e,t){if(void 0===this.DIGESTINFOHEAD[t])throw"alg not supported in Util.DIGESTINFOHEAD: "+t;return this.DIGESTINFOHEAD[t]+e},this.getPaddedDigestInfoHex=function(e,t,n){var r=this.getDigestInfoHex(e,t),i=n/4;if(r.length+22>i)throw"key is too short for SigAlg: keylen="+n+","+t;for(var o="0001",a="00"+r,s="",u=i-o.length-a.length,l=0;l<u;l+=2)s+="ff";return o+s+a},this.hashString=function(e,t){return new ue.crypto.MessageDigest({alg:t}).digestString(e)},this.hashHex=function(e,t){return new ue.crypto.MessageDigest({alg:t}).digestHex(e)},this.sha1=function(e){return this.hashString(e,"sha1")},this.sha256=function(e){return this.hashString(e,"sha256")},this.sha256Hex=function(e){return this.hashHex(e,"sha256")},this.sha512=function(e){return this.hashString(e,"sha512")},this.sha512Hex=function(e){return this.hashHex(e,"sha512")},this.isKey=function(e){return e instanceof ne||e instanceof ue.crypto.DSA||e instanceof ue.crypto.ECDSA}},ue.crypto.Util.md5=function(e){return new ue.crypto.MessageDigest({alg:"md5",prov:"cryptojs"}).digestString(e)},ue.crypto.Util.ripemd160=function(e){return new ue.crypto.MessageDigest({alg:"ripemd160",prov:"cryptojs"}).digestString(e)},ue.crypto.Util.SECURERANDOMGEN=new Q,ue.crypto.Util.getRandomHexOfNbytes=function(e){var t=new Array(e);return ue.crypto.Util.SECURERANDOMGEN.nextBytes(t),fe(t)},ue.crypto.Util.getRandomBigIntegerOfNbytes=function(e){return new x(ue.crypto.Util.getRandomHexOfNbytes(e),16)},ue.crypto.Util.getRandomHexOfNbits=function(e){var t=e%8,n=new Array((e-t)/8+1);return ue.crypto.Util.SECURERANDOMGEN.nextBytes(n),n[0]=(255<<t&255^255)&n[0],fe(n)},ue.crypto.Util.getRandomBigIntegerOfNbits=function(e){return new x(ue.crypto.Util.getRandomHexOfNbits(e),16)},ue.crypto.Util.getRandomBigIntegerZeroToMax=function(e){for(var t=e.bitLength();;){var n=ue.crypto.Util.getRandomBigIntegerOfNbits(t);if(-1!=e.compareTo(n))return n}},ue.crypto.Util.getRandomBigIntegerMinToMax=function(e,t){var n=e.compareTo(t);if(1==n)throw"biMin is greater than biMax";if(0==n)return e;var r=t.subtract(e);return ue.crypto.Util.getRandomBigIntegerZeroToMax(r).add(e)},ue.crypto.MessageDigest=function(e){this.setAlgAndProvider=function(e,t){if(null!==(e=ue.crypto.MessageDigest.getCanonicalAlgName(e))&&void 0===t&&(t=ue.crypto.Util.DEFAULTPROVIDER[e]),-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(e)&&"cryptojs"==t){try{this.md=ue.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[e].create()}catch(t){throw"setAlgAndProvider hash alg set fail alg="+e+"/"+t}this.updateString=function(e){this.md.update(e)},this.updateHex=function(e){var t=g.enc.Hex.parse(e);this.md.update(t)},this.digest=function(){return this.md.finalize().toString(g.enc.Hex)},this.digestString=function(e){return this.updateString(e),this.digest()},this.digestHex=function(e){return this.updateHex(e),this.digest()}}if(-1!=":sha256:".indexOf(e)&&"sjcl"==t){try{this.md=new sjcl.hash.sha256}catch(t){throw"setAlgAndProvider hash alg set fail alg="+e+"/"+t}this.updateString=function(e){this.md.update(e)},this.updateHex=function(e){var t=sjcl.codec.hex.toBits(e);this.md.update(t)},this.digest=function(){var e=this.md.finalize();return sjcl.codec.hex.fromBits(e)},this.digestString=function(e){return this.updateString(e),this.digest()},this.digestHex=function(e){return this.updateHex(e),this.digest()}}},this.updateString=function(e){throw"updateString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.updateHex=function(e){throw"updateHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digest=function(){throw"digest() not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestString=function(e){throw"digestString(str) not supported for this alg/prov: "+this.algName+"/"+this.provName},this.digestHex=function(e){throw"digestHex(hex) not supported for this alg/prov: "+this.algName+"/"+this.provName},void 0!==e&&void 0!==e.alg&&(this.algName=e.alg,void 0===e.prov&&(this.provName=ue.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName))},ue.crypto.MessageDigest.getCanonicalAlgName=function(e){return"string"==typeof e&&(e=(e=e.toLowerCase()).replace(/-/,"")),e},ue.crypto.MessageDigest.getHashLength=function(e){var t=ue.crypto.MessageDigest,n=t.getCanonicalAlgName(e);if(void 0===t.HASHLENGTH[n])throw"not supported algorithm: "+e;return t.HASHLENGTH[n]},ue.crypto.MessageDigest.HASHLENGTH={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,ripemd160:20},ue.crypto.Mac=function(e){this.setAlgAndProvider=function(e,t){if(null==(e=e.toLowerCase())&&(e="hmacsha1"),"hmac"!=(e=e.toLowerCase()).substr(0,4))throw"setAlgAndProvider unsupported HMAC alg: "+e;void 0===t&&(t=ue.crypto.Util.DEFAULTPROVIDER[e]),this.algProv=e+"/"+t;var n=e.substr(4);if(-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(n)&&"cryptojs"==t){try{var r=ue.crypto.Util.CRYPTOJSMESSAGEDIGESTNAME[n];this.mac=g.algo.HMAC.create(r,this.pass)}catch(e){throw"setAlgAndProvider hash alg set fail hashAlg="+n+"/"+e}this.updateString=function(e){this.mac.update(e)},this.updateHex=function(e){var t=g.enc.Hex.parse(e);this.mac.update(t)},this.doFinal=function(){return this.mac.finalize().toString(g.enc.Hex)},this.doFinalString=function(e){return this.updateString(e),this.doFinal()},this.doFinalHex=function(e){return this.updateHex(e),this.doFinal()}}},this.updateString=function(e){throw"updateString(str) not supported for this alg/prov: "+this.algProv},this.updateHex=function(e){throw"updateHex(hex) not supported for this alg/prov: "+this.algProv},this.doFinal=function(){throw"digest() not supported for this alg/prov: "+this.algProv},this.doFinalString=function(e){throw"digestString(str) not supported for this alg/prov: "+this.algProv},this.doFinalHex=function(e){throw"digestHex(hex) not supported for this alg/prov: "+this.algProv},this.setPassword=function(e){if("string"==typeof e){var t=e;return e.length%2!=1&&e.match(/^[0-9A-Fa-f]+$/)||(t=Ae(e)),void(this.pass=g.enc.Hex.parse(t))}if("object"!=typeof e)throw"KJUR.crypto.Mac unsupported password type: "+e;t=null;if(void 0!==e.hex){if(e.hex.length%2!=0||!e.hex.match(/^[0-9A-Fa-f]+$/))throw"Mac: wrong hex password: "+e.hex;t=e.hex}if(void 0!==e.utf8&&(t=we(e.utf8)),void 0!==e.rstr&&(t=Ae(e.rstr)),void 0!==e.b64&&(t=b(e.b64)),void 0!==e.b64u&&(t=be(e.b64u)),null==t)throw"KJUR.crypto.Mac unsupported password type: "+e;this.pass=g.enc.Hex.parse(t)},void 0!==e&&(void 0!==e.pass&&this.setPassword(e.pass),void 0!==e.alg&&(this.algName=e.alg,void 0===e.prov&&(this.provName=ue.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName)))},ue.crypto.Signature=function(e){var t=null;if(this._setAlgNames=function(){var e=this.algName.match(/^(.+)with(.+)$/);e&&(this.mdAlgName=e[1].toLowerCase(),this.pubkeyAlgName=e[2].toLowerCase(),"rsaandmgf1"==this.pubkeyAlgName&&"sha"==this.mdAlgName&&(this.mdAlgName="sha1"))},this._zeroPaddingOfSignature=function(e,t){for(var n="",r=t/4-e.length,i=0;i<r;i++)n+="0";return n+e},this.setAlgAndProvider=function(e,t){if(this._setAlgNames(),"cryptojs/jsrsa"!=t)throw new Error("provider not supported: "+t);if(-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(this.mdAlgName)){try{this.md=new ue.crypto.MessageDigest({alg:this.mdAlgName})}catch(e){throw new Error("setAlgAndProvider hash alg set fail alg="+this.mdAlgName+"/"+e)}this.init=function(e,t){var n=null;try{n=void 0===t?tt.getKey(e):tt.getKey(e,t)}catch(e){throw"init failed:"+e}if(!0===n.isPrivate)this.prvKey=n,this.state="SIGN";else{if(!0!==n.isPublic)throw"init failed.:"+n;this.pubKey=n,this.state="VERIFY"}},this.updateString=function(e){this.md.updateString(e)},this.updateHex=function(e){this.md.updateHex(e)},this.sign=function(){if(this.sHashHex=this.md.digest(),void 0===this.prvKey&&void 0!==this.ecprvhex&&void 0!==this.eccurvename&&void 0!==ue.crypto.ECDSA&&(this.prvKey=new ue.crypto.ECDSA({curve:this.eccurvename,prv:this.ecprvhex})),this.prvKey instanceof ne&&"rsaandmgf1"===this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHashPSS(this.sHashHex,this.mdAlgName,this.pssSaltLen);else if(this.prvKey instanceof ne&&"rsa"===this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex,this.mdAlgName);else if(this.prvKey instanceof ue.crypto.ECDSA)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex);else{if(!(this.prvKey instanceof ue.crypto.DSA))throw"Signature: unsupported private key alg: "+this.pubkeyAlgName;this.hSign=this.prvKey.signWithMessageHash(this.sHashHex)}return this.hSign},this.signString=function(e){return this.updateString(e),this.sign()},this.signHex=function(e){return this.updateHex(e),this.sign()},this.verify=function(e){if(this.sHashHex=this.md.digest(),void 0===this.pubKey&&void 0!==this.ecpubhex&&void 0!==this.eccurvename&&void 0!==ue.crypto.ECDSA&&(this.pubKey=new ue.crypto.ECDSA({curve:this.eccurvename,pub:this.ecpubhex})),this.pubKey instanceof ne&&"rsaandmgf1"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHashPSS(this.sHashHex,e,this.mdAlgName,this.pssSaltLen);if(this.pubKey instanceof ne&&"rsa"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHash(this.sHashHex,e);if(void 0!==ue.crypto.ECDSA&&this.pubKey instanceof ue.crypto.ECDSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,e);if(void 0!==ue.crypto.DSA&&this.pubKey instanceof ue.crypto.DSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,e);throw"Signature: unsupported public key alg: "+this.pubkeyAlgName}}},this.init=function(e,t){throw"init(key, pass) not supported for this alg:prov="+this.algProvName},this.updateString=function(e){throw"updateString(str) not supported for this alg:prov="+this.algProvName},this.updateHex=function(e){throw"updateHex(hex) not supported for this alg:prov="+this.algProvName},this.sign=function(){throw"sign() not supported for this alg:prov="+this.algProvName},this.signString=function(e){throw"digestString(str) not supported for this alg:prov="+this.algProvName},this.signHex=function(e){throw"digestHex(hex) not supported for this alg:prov="+this.algProvName},this.verify=function(e){throw"verify(hSigVal) not supported for this alg:prov="+this.algProvName},this.initParams=e,void 0!==e&&(void 0!==e.alg&&(this.algName=e.alg,void 0===e.prov?this.provName=ue.crypto.Util.DEFAULTPROVIDER[this.algName]:this.provName=e.prov,this.algProvName=this.algName+":"+this.provName,this.setAlgAndProvider(this.algName,this.provName),this._setAlgNames()),void 0!==e.psssaltlen&&(this.pssSaltLen=e.psssaltlen),void 0!==e.prvkeypem)){if(void 0!==e.prvkeypas)throw"both prvkeypem and prvkeypas parameters not supported";try{t=tt.getKey(e.prvkeypem);this.init(t)}catch(e){throw"fatal error to load pem private key: "+e}}},ue.crypto.Cipher=function(e){},ue.crypto.Cipher.encrypt=function(e,t,n){if(t instanceof ne&&t.isPublic){var r=ue.crypto.Cipher.getAlgByKeyAndName(t,n);if("RSA"===r)return t.encrypt(e);if("RSAOAEP"===r)return t.encryptOAEP(e,"sha1");var i=r.match(/^RSAOAEP(\d+)$/);if(null!==i)return t.encryptOAEP(e,"sha"+i[1]);throw"Cipher.encrypt: unsupported algorithm for RSAKey: "+n}throw"Cipher.encrypt: unsupported key or algorithm"},ue.crypto.Cipher.decrypt=function(e,t,n){if(t instanceof ne&&t.isPrivate){var r=ue.crypto.Cipher.getAlgByKeyAndName(t,n);if("RSA"===r)return t.decrypt(e);if("RSAOAEP"===r)return t.decryptOAEP(e,"sha1");var i=r.match(/^RSAOAEP(\d+)$/);if(null!==i)return t.decryptOAEP(e,"sha"+i[1]);throw"Cipher.decrypt: unsupported algorithm for RSAKey: "+n}throw"Cipher.decrypt: unsupported key or algorithm"},ue.crypto.Cipher.getAlgByKeyAndName=function(e,t){if(e instanceof ne){if(-1!=":RSA:RSAOAEP:RSAOAEP224:RSAOAEP256:RSAOAEP384:RSAOAEP512:".indexOf(t))return t;if(null==t)return"RSA";throw"getAlgByKeyAndName: not supported algorithm name for RSAKey: "+t}throw"getAlgByKeyAndName: not supported algorithm name: "+t},ue.crypto.OID=new function(){this.oidhex2name={"2a864886f70d010101":"rsaEncryption","2a8648ce3d0201":"ecPublicKey","2a8648ce380401":"dsa","2a8648ce3d030107":"secp256r1","2b8104001f":"secp192k1","2b81040021":"secp224r1","2b8104000a":"secp256k1","2b81040022":"secp384r1","2b81040023":"secp521r1","2a8648ce380403":"SHA1withDSA","608648016503040301":"SHA224withDSA","608648016503040302":"SHA256withDSA"}},void 0!==ue&&ue||(ue={}),void 0!==ue.crypto&&ue.crypto||(ue.crypto={}),ue.crypto.ECDSA=function(e){var t=Error,n=x,r=oe,i=ue.crypto.ECDSA,o=ue.crypto.ECParameterDB,a=i.getName,s=pe,u=s.getVbyListEx,l=s.isASN1HEX,c=new Q;this.type="EC",this.isPrivate=!1,this.isPublic=!1,this.getBigRandom=function(e){return new n(e.bitLength(),c).mod(e.subtract(n.ONE)).add(n.ONE)},this.setNamedCurve=function(e){this.ecparams=o.getByName(e),this.prvKeyHex=null,this.pubKeyHex=null,this.curveName=e},this.setPrivateKeyHex=function(e){this.isPrivate=!0,this.prvKeyHex=e},this.setPublicKeyHex=function(e){this.isPublic=!0,this.pubKeyHex=e},this.getPublicKeyXYHex=function(){var e=this.pubKeyHex;if("04"!==e.substr(0,2))throw"this method supports uncompressed format(04) only";var t=this.ecparams.keycharlen;if(e.length!==2+2*t)throw"malformed public key hex length";var n={};return n.x=e.substr(2,t),n.y=e.substr(2+t),n},this.getShortNISTPCurveName=function(){var e=this.curveName;return"secp256r1"===e||"NIST P-256"===e||"P-256"===e||"prime256v1"===e?"P-256":"secp384r1"===e||"NIST P-384"===e||"P-384"===e?"P-384":"secp521r1"===e||"NIST P-521"===e||"P-521"===e?"P-521":null},this.generateKeyPairHex=function(){var e=this.ecparams.n,t=this.getBigRandom(e),n=this.ecparams.keycharlen,r=("0000000000"+t.toString(16)).slice(-n);return this.setPrivateKeyHex(r),{ecprvhex:r,ecpubhex:this.generatePublicKeyHex()}},this.generatePublicKeyHex=function(){var e=new n(this.prvKeyHex,16),t=this.ecparams.G.multiply(e),r=t.getX().toBigInteger(),i=t.getY().toBigInteger(),o=this.ecparams.keycharlen,a="04"+("0000000000"+r.toString(16)).slice(-o)+("0000000000"+i.toString(16)).slice(-o);return this.setPublicKeyHex(a),a},this.signWithMessageHash=function(e){return this.signHex(e,this.prvKeyHex)},this.signHex=function(e,t){var r=new n(t,16),o=this.ecparams.n,a=new n(e.substring(0,this.ecparams.keycharlen),16);do{var s=this.getBigRandom(o),u=this.ecparams.G.multiply(s).getX().toBigInteger().mod(o)}while(u.compareTo(n.ZERO)<=0);var l=s.modInverse(o).multiply(a.add(r.multiply(u))).mod(o);return i.biRSSigToASN1Sig(u,l)},this.sign=function(e,t){var r=t,i=this.ecparams.n,o=n.fromByteArrayUnsigned(e);do{var a=this.getBigRandom(i),s=this.ecparams.G.multiply(a).getX().toBigInteger().mod(i)}while(s.compareTo(x.ZERO)<=0);var u=a.modInverse(i).multiply(o.add(r.multiply(s))).mod(i);return this.serializeSig(s,u)},this.verifyWithMessageHash=function(e,t){return this.verifyHex(e,t,this.pubKeyHex)},this.verifyHex=function(e,t,o){try{var a,s,u=i.parseSigHex(t);a=u.r,s=u.s;var l=r.decodeFromHex(this.ecparams.curve,o),c=new n(e.substring(0,this.ecparams.keycharlen),16);return this.verifyRaw(c,a,s,l)}catch(e){return!1}},this.verify=function(e,t,i){var o,a,s;if(Bitcoin.Util.isArray(t)){var u=this.parseSig(t);o=u.r,a=u.s}else{if("object"!=typeof t||!t.r||!t.s)throw"Invalid value for signature";o=t.r,a=t.s}if(i instanceof oe)s=i;else{if(!Bitcoin.Util.isArray(i))throw"Invalid format for pubkey value, must be byte array or ECPointFp";s=r.decodeFrom(this.ecparams.curve,i)}var l=n.fromByteArrayUnsigned(e);return this.verifyRaw(l,o,a,s)},this.verifyRaw=function(e,t,r,i){var o=this.ecparams.n,a=this.ecparams.G;if(t.compareTo(n.ONE)<0||t.compareTo(o)>=0)return!1;if(r.compareTo(n.ONE)<0||r.compareTo(o)>=0)return!1;var s=r.modInverse(o),u=e.multiply(s).mod(o),l=t.multiply(s).mod(o);return a.multiply(u).add(i.multiply(l)).getX().toBigInteger().mod(o).equals(t)},this.serializeSig=function(e,t){var n=e.toByteArraySigned(),r=t.toByteArraySigned(),i=[];return i.push(2),i.push(n.length),(i=i.concat(n)).push(2),i.push(r.length),(i=i.concat(r)).unshift(i.length),i.unshift(48),i},this.parseSig=function(e){var t;if(48!=e[0])throw new Error("Signature not a valid DERSequence");if(2!=e[t=2])throw new Error("First element in signature must be a DERInteger");var r=e.slice(t+2,t+2+e[t+1]);if(2!=e[t+=2+e[t+1]])throw new Error("Second element in signature must be a DERInteger");var i=e.slice(t+2,t+2+e[t+1]);return t+=2+e[t+1],{r:n.fromByteArrayUnsigned(r),s:n.fromByteArrayUnsigned(i)}},this.parseSigCompact=function(e){if(65!==e.length)throw"Signature has the wrong length";var t=e[0]-27;if(t<0||t>7)throw"Invalid signature type";var r=this.ecparams.n;return{r:n.fromByteArrayUnsigned(e.slice(1,33)).mod(r),s:n.fromByteArrayUnsigned(e.slice(33,65)).mod(r),i:t}},this.readPKCS5PrvKeyHex=function(e){if(!1===l(e))throw new Error("not ASN.1 hex string");var t,n,r;try{t=u(e,0,["[0]",0],"06"),n=u(e,0,[1],"04");try{r=u(e,0,["[1]",0],"03")}catch(e){}}catch(e){throw new Error("malformed PKCS#1/5 plain ECC private key")}if(this.curveName=a(t),void 0===this.curveName)throw"unsupported curve name";this.setNamedCurve(this.curveName),this.setPublicKeyHex(r),this.setPrivateKeyHex(n),this.isPublic=!1},this.readPKCS8PrvKeyHex=function(e){if(!1===l(e))throw new t("not ASN.1 hex string");var n,r,i;try{u(e,0,[1,0],"06"),n=u(e,0,[1,1],"06"),r=u(e,0,[2,0,1],"04");try{i=u(e,0,[2,0,"[1]",0],"03")}catch(e){}}catch(e){throw new t("malformed PKCS#8 plain ECC private key")}if(this.curveName=a(n),void 0===this.curveName)throw new t("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(i),this.setPrivateKeyHex(r),this.isPublic=!1},this.readPKCS8PubKeyHex=function(e){if(!1===l(e))throw new t("not ASN.1 hex string");var n,r;try{u(e,0,[0,0],"06"),n=u(e,0,[0,1],"06"),r=u(e,0,[1],"03")}catch(e){throw new t("malformed PKCS#8 ECC public key")}if(this.curveName=a(n),null===this.curveName)throw new t("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(r)},this.readCertPubKeyHex=function(e,n){if(!1===l(e))throw new t("not ASN.1 hex string");var r,i;try{r=u(e,0,[0,5,0,1],"06"),i=u(e,0,[0,5,1],"03")}catch(e){throw new t("malformed X.509 certificate ECC public key")}if(this.curveName=a(r),null===this.curveName)throw new t("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(i)},void 0!==e&&void 0!==e.curve&&(this.curveName=e.curve),void 0===this.curveName&&(this.curveName="secp256r1"),this.setNamedCurve(this.curveName),void 0!==e&&(void 0!==e.prv&&this.setPrivateKeyHex(e.prv),void 0!==e.pub&&this.setPublicKeyHex(e.pub))},ue.crypto.ECDSA.parseSigHex=function(e){var t=ue.crypto.ECDSA.parseSigHexInHexRS(e);return{r:new x(t.r,16),s:new x(t.s,16)}},ue.crypto.ECDSA.parseSigHexInHexRS=function(e){var t=pe,n=t.getChildIdx,r=t.getV;if(t.checkStrictDER(e,0),"30"!=e.substr(0,2))throw new Error("signature is not a ASN.1 sequence");var i=n(e,0);if(2!=i.length)throw new Error("signature shall have two elements");var o=i[0],a=i[1];if("02"!=e.substr(o,2))throw new Error("1st item not ASN.1 integer");if("02"!=e.substr(a,2))throw new Error("2nd item not ASN.1 integer");return{r:r(e,o),s:r(e,a)}},ue.crypto.ECDSA.asn1SigToConcatSig=function(e){var t=ue.crypto.ECDSA.parseSigHexInHexRS(e),n=t.r,r=t.s;if(n.length>=130&&n.length<=134){if(n.length%2!=0)throw Error("unknown ECDSA sig r length error");if(r.length%2!=0)throw Error("unknown ECDSA sig s length error");"00"==n.substr(0,2)&&(n=n.substr(2)),"00"==r.substr(0,2)&&(r=r.substr(2));var i=Math.max(n.length,r.length);return(n=("000000"+n).slice(-i))+(r=("000000"+r).slice(-i))}if("00"==n.substr(0,2)&&n.length%32==2&&(n=n.substr(2)),"00"==r.substr(0,2)&&r.length%32==2&&(r=r.substr(2)),n.length%32==30&&(n="00"+n),r.length%32==30&&(r="00"+r),n.length%32!=0)throw Error("unknown ECDSA sig r length error");if(r.length%32!=0)throw Error("unknown ECDSA sig s length error");return n+r},ue.crypto.ECDSA.concatSigToASN1Sig=function(e){if(e.length%4!=0)throw Error("unknown ECDSA concatinated r-s sig length error");var t=e.substr(0,e.length/2),n=e.substr(e.length/2);return ue.crypto.ECDSA.hexRSSigToASN1Sig(t,n)},ue.crypto.ECDSA.hexRSSigToASN1Sig=function(e,t){var n=new x(e,16),r=new x(t,16);return ue.crypto.ECDSA.biRSSigToASN1Sig(n,r)},ue.crypto.ECDSA.biRSSigToASN1Sig=function(e,t){var n=ue.asn1,r=new n.DERInteger({bigint:e}),i=new n.DERInteger({bigint:t});return new n.DERSequence({array:[r,i]}).tohex()},ue.crypto.ECDSA.getName=function(e){return"2b8104001f"===e?"secp192k1":"2a8648ce3d030107"===e?"secp256r1":"2b8104000a"===e?"secp256k1":"2b81040021"===e?"secp224r1":"2b81040022"===e?"secp384r1":"2b81040023"===e?"secp521r1":-1!=="|secp256r1|NIST P-256|P-256|prime256v1|".indexOf(e)?"secp256r1":-1!=="|secp256k1|".indexOf(e)?"secp256k1":-1!=="|secp224r1|NIST P-224|P-224|".indexOf(e)?"secp224r1":-1!=="|secp384r1|NIST P-384|P-384|".indexOf(e)?"secp384r1":-1!=="|secp521r1|NIST P-521|P-521|".indexOf(e)?"secp521r1":null},void 0!==ue&&ue||(ue={}),void 0!==ue.crypto&&ue.crypto||(ue.crypto={}),ue.crypto.ECParameterDB=new function(){var e={},t={};function n(e){return new x(e,16)}this.getByName=function(n){var r=n;if(void 0!==t[r]&&(r=t[n]),void 0!==e[r])return e[r];throw"unregistered EC curve name: "+r},this.regist=function(r,i,o,a,s,u,l,c,p,h,d,f){e[r]={};var g=n(o),m=n(a),v=n(s),y=n(u),b=n(l),w=new ae(g,m,v),x=w.decodePointHex("04"+c+p);e[r].name=r,e[r].keylen=i,e[r].keycharlen=2*Math.ceil(i/8),e[r].curve=w,e[r].G=x,e[r].n=y,e[r].h=b,e[r].oid=d,e[r].info=f;for(var S=0;S<h.length;S++)t[h[S]]=r}},ue.crypto.ECParameterDB.regist("secp128r1",128,"FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF","FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC","E87579C11079F43DD824993C2CEE5ED3","FFFFFFFE0000000075A30D1B9038A115","1","161FF7528B899B2D0C28607CA52C5B86","CF5AC8395BAFEB13C02DA292DDED7A83",[],"","secp128r1 : SECG curve over a 128 bit prime field"),ue.crypto.ECParameterDB.regist("secp160k1",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73","0","7","0100000000000000000001B8FA16DFAB9ACA16B6B3","1","3B4C382CE37AA192A4019E763036F4F5DD4D7EBB","938CF935318FDCED6BC28286531733C3F03C4FEE",[],"","secp160k1 : SECG curve over a 160 bit prime field"),ue.crypto.ECParameterDB.regist("secp160r1",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC","1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45","0100000000000000000001F4C8F927AED3CA752257","1","4A96B5688EF573284664698968C38BB913CBFC82","23A628553168947D59DCC912042351377AC5FB32",[],"","secp160r1 : SECG curve over a 160 bit prime field"),ue.crypto.ECParameterDB.regist("secp192k1",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37","0","3","FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D","1","DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D","9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D",[]),ue.crypto.ECParameterDB.regist("secp192r1",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC","64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1","FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831","1","188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012","07192B95FFC8DA78631011ED6B24CDD573F977A11E794811",[]),ue.crypto.ECParameterDB.regist("secp224r1",224,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE","B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4","FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D","1","B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21","BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34",[]),ue.crypto.ECParameterDB.regist("secp256k1",256,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F","0","7","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141","1","79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798","483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8",[]),ue.crypto.ECParameterDB.regist("secp256r1",256,"FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF","FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC","5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B","FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551","1","6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296","4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5",["NIST P-256","P-256","prime256v1"]),ue.crypto.ECParameterDB.regist("secp384r1",384,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFC","B3312FA7E23EE7E4988E056BE3F82D19181D9C6EFE8141120314088F5013875AC656398D8A2ED19D2A85C8EDD3EC2AEF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973","1","AA87CA22BE8B05378EB1C71EF320AD746E1D3B628BA79B9859F741E082542A385502F25DBF55296C3A545E3872760AB7","3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f",["NIST P-384","P-384"]),ue.crypto.ECParameterDB.regist("secp521r1",521,"1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF","1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC","051953EB9618E1C9A1F929A21A0B68540EEA2DA725B99B315F3B8B489918EF109E156193951EC7E937B1652C0BD3BB1BF073573DF883D2C34F1EF451FD46B503F00","1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409","1","00C6858E06B70404E9CD9E3ECB662395B4429C648139053FB521F828AF606B4D3DBAA14B5E77EFE75928FE1DC127A2FFA8DE3348B3C1856A429BF97E7E31C2E5BD66","011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650",["NIST P-521","P-521"]),void 0!==ue&&ue||(ue={}),void 0!==ue.crypto&&ue.crypto||(ue.crypto={}),ue.crypto.DSA=function(){var e=pe,t=(e.getVbyList,e.getVbyListEx),n=e.isASN1HEX,r=x;this.p=null,this.q=null,this.g=null,this.y=null,this.x=null,this.type="DSA",this.isPrivate=!1,this.isPublic=!1,this.setPrivate=function(e,t,n,r,i){this.isPrivate=!0,this.p=e,this.q=t,this.g=n,this.y=r,this.x=i},this.setPrivateHex=function(e,t,n,r,i){var o,a,s,u,l;o=new x(e,16),a=new x(t,16),s=new x(n,16),u="string"==typeof r&&r.length>1?new x(r,16):null,l=new x(i,16),this.setPrivate(o,a,s,u,l)},this.setPublic=function(e,t,n,r){this.isPublic=!0,this.p=e,this.q=t,this.g=n,this.y=r,this.x=null},this.setPublicHex=function(e,t,n,r){var i,o,a,s;i=new x(e,16),o=new x(t,16),a=new x(n,16),s=new x(r,16),this.setPublic(i,o,a,s)},this.signWithMessageHash=function(e){var t=this.p,n=this.q,r=this.g,i=(this.y,this.x),o=ue.crypto.Util.getRandomBigIntegerMinToMax(x.ONE.add(x.ONE),n.subtract(x.ONE)),a=new x(e.substr(0,n.bitLength()/4),16),s=r.modPow(o,t).mod(n),u=o.modInverse(n).multiply(a.add(i.multiply(s))).mod(n);return ue.asn1.ASN1Util.jsonToASN1HEX({seq:[{int:{bigint:s}},{int:{bigint:u}}]})},this.verifyWithMessageHash=function(e,t){var n=this.p,r=this.q,i=this.g,o=this.y,a=this.parseASN1Signature(t),s=a[0],u=a[1],l=new x(e.substr(0,r.bitLength()/4),16);if(x.ZERO.compareTo(s)>0||s.compareTo(r)>0)throw"invalid DSA signature";if(x.ZERO.compareTo(u)>=0||u.compareTo(r)>0)throw"invalid DSA signature";var c=u.modInverse(r),p=l.multiply(c).mod(r),h=s.multiply(c).mod(r);return 0==i.modPow(p,n).multiply(o.modPow(h,n)).mod(n).mod(r).compareTo(s)},this.parseASN1Signature=function(e){try{return[new r(t(e,0,[0],"02"),16),new r(t(e,0,[1],"02"),16)]}catch(e){throw new Error("malformed ASN.1 DSA signature")}},this.readPKCS5PrvKeyHex=function(e){var r,i,o,a,s;if(!1===n(e))throw new Error("not ASN.1 hex string");try{r=t(e,0,[1],"02"),i=t(e,0,[2],"02"),o=t(e,0,[3],"02"),a=t(e,0,[4],"02"),s=t(e,0,[5],"02")}catch(e){throw new Error("malformed PKCS#1/5 plain DSA private key")}this.setPrivateHex(r,i,o,a,s)},this.readPKCS8PrvKeyHex=function(e){var r,i,o,a;if(!1===n(e))throw new Error("not ASN.1 hex string");try{r=t(e,0,[1,1,0],"02"),i=t(e,0,[1,1,1],"02"),o=t(e,0,[1,1,2],"02"),a=t(e,0,[2,0],"02")}catch(e){throw new Error("malformed PKCS#8 plain DSA private key")}this.setPrivateHex(r,i,o,null,a)},this.readPKCS8PubKeyHex=function(e){var r,i,o,a;if(!1===n(e))throw new Error("not ASN.1 hex string");try{r=t(e,0,[0,1,0],"02"),i=t(e,0,[0,1,1],"02"),o=t(e,0,[0,1,2],"02"),a=t(e,0,[1,0],"02")}catch(e){throw new Error("malformed PKCS#8 DSA public key")}this.setPublicHex(r,i,o,a)},this.readCertPubKeyHex=function(e,r){var i,o,a,s;if(!1===n(e))throw new Error("not ASN.1 hex string");try{i=t(e,0,[0,5,0,1,0],"02"),o=t(e,0,[0,5,0,1,1],"02"),a=t(e,0,[0,5,0,1,2],"02"),s=t(e,0,[0,5,1,0],"02")}catch(e){throw new Error("malformed X.509 certificate DSA public key")}this.setPublicHex(i,o,a,s)}};var tt=function(){var e=function(e,n,r){return t(g.AES,e,n,r)},t=function(e,t,n,r){var i=g.enc.Hex.parse(t),o=g.enc.Hex.parse(n),a=g.enc.Hex.parse(r),s={};s.key=o,s.iv=a,s.ciphertext=i;var u=e.decrypt(s,o,{iv:a});return g.enc.Hex.stringify(u)},n=function(e,t,n){return r(g.AES,e,t,n)},r=function(e,t,n,r){var i=g.enc.Hex.parse(t),o=g.enc.Hex.parse(n),a=g.enc.Hex.parse(r),s=e.encrypt(i,o,{iv:a}),u=g.enc.Hex.parse(s.toString());return g.enc.Base64.stringify(u)},i={"AES-256-CBC":{proc:e,eproc:n,keylen:32,ivlen:16},"AES-192-CBC":{proc:e,eproc:n,keylen:24,ivlen:16},"AES-128-CBC":{proc:e,eproc:n,keylen:16,ivlen:16},"DES-EDE3-CBC":{proc:function(e,n,r){return t(g.TripleDES,e,n,r)},eproc:function(e,t,n){return r(g.TripleDES,e,t,n)},keylen:24,ivlen:8},"DES-CBC":{proc:function(e,n,r){return t(g.DES,e,n,r)},eproc:function(e,t,n){return r(g.DES,e,t,n)},keylen:8,ivlen:8}},o=function(e){var t={},n=e.match(new RegExp("DEK-Info: ([^,]+),([0-9A-Fa-f]+)","m"));n&&(t.cipher=n[1],t.ivsalt=n[2]);var r=e.match(new RegExp("-----BEGIN ([A-Z]+) PRIVATE KEY-----"));r&&(t.type=r[1]);var i=-1,o=0;-1!=e.indexOf("\r\n\r\n")&&(i=e.indexOf("\r\n\r\n"),o=2),-1!=e.indexOf("\n\n")&&(i=e.indexOf("\n\n"),o=1);var a=e.indexOf("-----END");if(-1!=i&&-1!=a){var s=e.substring(i+2*o,a-o);s=s.replace(/\s+/g,""),t.data=s}return t},a=function(e,t,n){for(var r=n.substring(0,16),o=g.enc.Hex.parse(r),a=g.enc.Utf8.parse(t),s=i[e].keylen+i[e].ivlen,u="",l=null;;){var c=g.algo.MD5.create();if(null!=l&&c.update(l),c.update(a),c.update(o),l=c.finalize(),(u+=g.enc.Hex.stringify(l)).length>=2*s)break}var p={};return p.keyhex=u.substr(0,2*i[e].keylen),p.ivhex=u.substr(2*i[e].keylen,2*i[e].ivlen),p},s=function(e,t,n,r){var o=g.enc.Base64.parse(e),a=g.enc.Hex.stringify(o);return(0,i[t].proc)(a,n,r)};return{version:"1.0.0",parsePKCS5PEM:function(e){return o(e)},getKeyAndUnusedIvByPasscodeAndIvsalt:function(e,t,n){return a(e,t,n)},decryptKeyB64:function(e,t,n,r){return s(e,t,n,r)},getDecryptedKeyHex:function(e,t){var n=o(e),r=(n.type,n.cipher),i=n.ivsalt,u=n.data,l=a(r,t,i).keyhex;return s(u,r,l,i)},getEncryptedPKCS5PEMFromPrvKeyHex:function(e,t,n,r,o){var s="";if(void 0!==r&&null!=r||(r="AES-256-CBC"),void 0===i[r])throw new Error("KEYUTIL unsupported algorithm: "+r);void 0!==o&&null!=o||(o=function(e){var t=g.lib.WordArray.random(e);return g.enc.Hex.stringify(t)}(i[r].ivlen).toUpperCase());var u=function(e,t,n,r){return(0,i[t].eproc)(e,n,r)}(t,r,a(r,n,o).keyhex,o);s="-----BEGIN "+e+" PRIVATE KEY-----\r\n";return s+="Proc-Type: 4,ENCRYPTED\r\n",s+="DEK-Info: "+r+","+o+"\r\n",s+="\r\n",s+=u.replace(/(.{64})/g,"$1\r\n"),s+="\r\n-----END "+e+" PRIVATE KEY-----\r\n"},parseHexOfEncryptedPKCS8:function(e){var t=pe,n=t.getChildIdx,r=t.getV,i={},o=n(e,0);if(2!=o.length)throw new Error("malformed format: SEQUENCE(0).items != 2: "+o.length);i.ciphertext=r(e,o[1]);var a=n(e,o[0]);if(2!=a.length)throw new Error("malformed format: SEQUENCE(0.0).items != 2: "+a.length);if("2a864886f70d01050d"!=r(e,a[0]))throw new Error("this only supports pkcs5PBES2");var s=n(e,a[1]);if(2!=a.length)throw new Error("malformed format: SEQUENCE(0.0.1).items != 2: "+s.length);var u=n(e,s[1]);if(2!=u.length)throw new Error("malformed format: SEQUENCE(0.0.1.1).items != 2: "+u.length);if("2a864886f70d0307"!=r(e,u[0]))throw"this only supports TripleDES";i.encryptionSchemeAlg="TripleDES",i.encryptionSchemeIV=r(e,u[1]);var l=n(e,s[0]);if(2!=l.length)throw new Error("malformed format: SEQUENCE(0.0.1.0).items != 2: "+l.length);if("2a864886f70d01050c"!=r(e,l[0]))throw new Error("this only supports pkcs5PBKDF2");var c=n(e,l[1]);if(c.length<2)throw new Error("malformed format: SEQUENCE(0.0.1.0.1).items < 2: "+c.length);i.pbkdf2Salt=r(e,c[0]);var p=r(e,c[1]);try{i.pbkdf2Iter=parseInt(p,16)}catch(e){throw new Error("malformed format pbkdf2Iter: "+p)}return i},getPBKDF2KeyHexFromParam:function(e,t){var n=g.enc.Hex.parse(e.pbkdf2Salt),r=e.pbkdf2Iter,i=g.PBKDF2(t,n,{keySize:6,iterations:r});return g.enc.Hex.stringify(i)},_getPlainPKCS8HexFromEncryptedPKCS8PEM:function(e,t){var n=Te(e,"ENCRYPTED PRIVATE KEY"),r=this.parseHexOfEncryptedPKCS8(n),i=tt.getPBKDF2KeyHexFromParam(r,t),o={};o.ciphertext=g.enc.Hex.parse(r.ciphertext);var a=g.enc.Hex.parse(i),s=g.enc.Hex.parse(r.encryptionSchemeIV),u=g.TripleDES.decrypt(o,a,{iv:s});return g.enc.Hex.stringify(u)},getKeyFromEncryptedPKCS8PEM:function(e,t){var n=this._getPlainPKCS8HexFromEncryptedPKCS8PEM(e,t);return this.getKeyFromPlainPrivatePKCS8Hex(n)},parsePlainPrivatePKCS8Hex:function(e){var t=pe,n=t.getChildIdx,r=t.getV,i={algparam:null};if("30"!=e.substr(0,2))throw new Error("malformed plain PKCS8 private key(code:001)");var o=n(e,0);if(o.length<3)throw new Error("malformed plain PKCS8 private key(code:002)");if("30"!=e.substr(o[1],2))throw new Error("malformed PKCS8 private key(code:003)");var a=n(e,o[1]);if(2!=a.length)throw new Error("malformed PKCS8 private key(code:004)");if("06"!=e.substr(a[0],2))throw new Error("malformed PKCS8 private key(code:005)");if(i.algoid=r(e,a[0]),"06"==e.substr(a[1],2)&&(i.algparam=r(e,a[1])),"04"!=e.substr(o[2],2))throw new Error("malformed PKCS8 private key(code:006)");return i.keyidx=t.getVidx(e,o[2]),i},getKeyFromPlainPrivatePKCS8PEM:function(e){var t=Te(e,"PRIVATE KEY");return this.getKeyFromPlainPrivatePKCS8Hex(t)},getKeyFromPlainPrivatePKCS8Hex:function(e){var t,n=this.parsePlainPrivatePKCS8Hex(e);if("2a864886f70d010101"==n.algoid)t=new ne;else if("2a8648ce380401"==n.algoid)t=new ue.crypto.DSA;else{if("2a8648ce3d0201"!=n.algoid)throw new Error("unsupported private key algorithm");t=new ue.crypto.ECDSA}return t.readPKCS8PrvKeyHex(e),t},_getKeyFromPublicPKCS8Hex:function(e){var t,n=pe.getVbyList(e,0,[0,0],"06");if("2a864886f70d010101"===n)t=new ne;else if("2a8648ce380401"===n)t=new ue.crypto.DSA;else{if("2a8648ce3d0201"!==n)throw new Error("unsupported PKCS#8 public key hex");t=new ue.crypto.ECDSA}return t.readPKCS8PubKeyHex(e),t},parsePublicRawRSAKeyHex:function(e){var t=pe,n=t.getChildIdx,r=t.getV,i={};if("30"!=e.substr(0,2))throw new Error("malformed RSA key(code:001)");var o=n(e,0);if(2!=o.length)throw new Error("malformed RSA key(code:002)");if("02"!=e.substr(o[0],2))throw new Error("malformed RSA key(code:003)");if(i.n=r(e,o[0]),"02"!=e.substr(o[1],2))throw new Error("malformed RSA key(code:004)");return i.e=r(e,o[1]),i},parsePublicPKCS8Hex:function(e){var t=pe,n=t.getChildIdx,r=t.getV,i={algparam:null},o=n(e,0);if(2!=o.length)throw new Error("outer DERSequence shall have 2 elements: "+o.length);var a=o[0];if("30"!=e.substr(a,2))throw new Error("malformed PKCS8 public key(code:001)");var s=n(e,a);if(2!=s.length)throw new Error("malformed PKCS8 public key(code:002)");if("06"!=e.substr(s[0],2))throw new Error("malformed PKCS8 public key(code:003)");if(i.algoid=r(e,s[0]),"06"==e.substr(s[1],2)?i.algparam=r(e,s[1]):"30"==e.substr(s[1],2)&&(i.algparam={},i.algparam.p=t.getVbyList(e,s[1],[0],"02"),i.algparam.q=t.getVbyList(e,s[1],[1],"02"),i.algparam.g=t.getVbyList(e,s[1],[2],"02")),"03"!=e.substr(o[1],2))throw new Error("malformed PKCS8 public key(code:004)");return i.key=r(e,o[1]).substr(2),i}}}();tt.getKey=function(e,t,n){var r=(m=pe).getChildIdx,i=(m.getV,m.getVbyList),o=ue.crypto,a=o.ECDSA,s=o.DSA,u=ne,l=Te,c=tt;if(void 0!==u&&e instanceof u)return e;if(void 0!==a&&e instanceof a)return e;if(void 0!==s&&e instanceof s)return e;if(void 0!==e.curve&&void 0!==e.xy&&void 0===e.d)return new a({pub:e.xy,curve:e.curve});if(void 0!==e.curve&&void 0!==e.d)return new a({prv:e.d,curve:e.curve});if(void 0===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0===e.d)return(D=new u).setPublic(e.n,e.e),D;if(void 0===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0!==e.d&&void 0!==e.p&&void 0!==e.q&&void 0!==e.dp&&void 0!==e.dq&&void 0!==e.co&&void 0===e.qi)return(D=new u).setPrivateEx(e.n,e.e,e.d,e.p,e.q,e.dp,e.dq,e.co),D;if(void 0===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0!==e.d&&void 0===e.p)return(D=new u).setPrivate(e.n,e.e,e.d),D;if(void 0!==e.p&&void 0!==e.q&&void 0!==e.g&&void 0!==e.y&&void 0===e.x)return(D=new s).setPublic(e.p,e.q,e.g,e.y),D;if(void 0!==e.p&&void 0!==e.q&&void 0!==e.g&&void 0!==e.y&&void 0!==e.x)return(D=new s).setPrivate(e.p,e.q,e.g,e.y,e.x),D;if("RSA"===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0===e.d)return(D=new u).setPublic(be(e.n),be(e.e)),D;if("RSA"===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0!==e.d&&void 0!==e.p&&void 0!==e.q&&void 0!==e.dp&&void 0!==e.dq&&void 0!==e.qi)return(D=new u).setPrivateEx(be(e.n),be(e.e),be(e.d),be(e.p),be(e.q),be(e.dp),be(e.dq),be(e.qi)),D;if("RSA"===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0!==e.d)return(D=new u).setPrivate(be(e.n),be(e.e),be(e.d)),D;if("EC"===e.kty&&void 0!==e.crv&&void 0!==e.x&&void 0!==e.y&&void 0===e.d){var p=($=new a({curve:e.crv})).ecparams.keycharlen,h="04"+("0000000000"+be(e.x)).slice(-p)+("0000000000"+be(e.y)).slice(-p);return $.setPublicKeyHex(h),$}if("EC"===e.kty&&void 0!==e.crv&&void 0!==e.x&&void 0!==e.y&&void 0!==e.d){p=($=new a({curve:e.crv})).ecparams.keycharlen,h="04"+("0000000000"+be(e.x)).slice(-p)+("0000000000"+be(e.y)).slice(-p);var d=("0000000000"+be(e.d)).slice(-p);return $.setPublicKeyHex(h),$.setPrivateKeyHex(d),$}if("pkcs5prv"===n){var f,g=e,m=pe;if(9===(f=r(g,0)).length)(D=new u).readPKCS5PrvKeyHex(g);else if(6===f.length)(D=new s).readPKCS5PrvKeyHex(g);else{if(!(f.length>2&&"04"===g.substr(f[1],2)))throw new Error("unsupported PKCS#1/5 hexadecimal key");(D=new a).readPKCS5PrvKeyHex(g)}return D}if("pkcs8prv"===n)return D=c.getKeyFromPlainPrivatePKCS8Hex(e);if("pkcs8pub"===n)return c._getKeyFromPublicPKCS8Hex(e);if("x509pub"===n)return ot.getPublicKeyFromCertHex(e);if(-1!=e.indexOf("-END CERTIFICATE-",0)||-1!=e.indexOf("-END X509 CERTIFICATE-",0)||-1!=e.indexOf("-END TRUSTED CERTIFICATE-",0))return ot.getPublicKeyFromCertPEM(e);if(-1!=e.indexOf("-END PUBLIC KEY-")){var v=Te(e,"PUBLIC KEY");return c._getKeyFromPublicPKCS8Hex(v)}if(-1!=e.indexOf("-END RSA PRIVATE KEY-")&&-1==e.indexOf("4,ENCRYPTED")){var y=l(e,"RSA PRIVATE KEY");return c.getKey(y,null,"pkcs5prv")}if(-1!=e.indexOf("-END DSA PRIVATE KEY-")&&-1==e.indexOf("4,ENCRYPTED")){var b=i(R=l(e,"DSA PRIVATE KEY"),0,[1],"02"),w=i(R,0,[2],"02"),S=i(R,0,[3],"02"),E=i(R,0,[4],"02"),A=i(R,0,[5],"02");return(D=new s).setPrivate(new x(b,16),new x(w,16),new x(S,16),new x(E,16),new x(A,16)),D}if(-1!=e.indexOf("-END EC PRIVATE KEY-")&&-1==e.indexOf("4,ENCRYPTED")){y=l(e,"EC PRIVATE KEY");return c.getKey(y,null,"pkcs5prv")}if(-1!=e.indexOf("-END PRIVATE KEY-"))return c.getKeyFromPlainPrivatePKCS8PEM(e);if(-1!=e.indexOf("-END RSA PRIVATE KEY-")&&-1!=e.indexOf("4,ENCRYPTED")){var F=c.getDecryptedKeyHex(e,t),C=new ne;return C.readPKCS5PrvKeyHex(F),C}if(-1!=e.indexOf("-END EC PRIVATE KEY-")&&-1!=e.indexOf("4,ENCRYPTED")){var $,D=i(R=c.getDecryptedKeyHex(e,t),0,[1],"04"),T=i(R,0,[2,0],"06"),I=i(R,0,[3,0],"03").substr(2);if(void 0===ue.crypto.OID.oidhex2name[T])throw new Error("undefined OID(hex) in KJUR.crypto.OID: "+T);return($=new a({curve:ue.crypto.OID.oidhex2name[T]})).setPublicKeyHex(I),$.setPrivateKeyHex(D),$.isPublic=!1,$}if(-1!=e.indexOf("-END DSA PRIVATE KEY-")&&-1!=e.indexOf("4,ENCRYPTED")){var R;b=i(R=c.getDecryptedKeyHex(e,t),0,[1],"02"),w=i(R,0,[2],"02"),S=i(R,0,[3],"02"),E=i(R,0,[4],"02"),A=i(R,0,[5],"02");return(D=new s).setPrivate(new x(b,16),new x(w,16),new x(S,16),new x(E,16),new x(A,16)),D}if(-1!=e.indexOf("-END ENCRYPTED PRIVATE KEY-"))return c.getKeyFromEncryptedPKCS8PEM(e,t);throw new Error("not supported argument")},tt.generateKeypair=function(e,t){if("RSA"==e){var n=t;(a=new ne).generate(n,"10001"),a.isPrivate=!0,a.isPublic=!0;var r=new ne,i=a.n.toString(16),o=a.e.toString(16);return r.setPublic(i,o),r.isPrivate=!1,r.isPublic=!0,(s={}).prvKeyObj=a,s.pubKeyObj=r,s}if("EC"==e){var a,s,u=t,l=new ue.crypto.ECDSA({curve:u}).generateKeyPairHex();return(a=new ue.crypto.ECDSA({curve:u})).setPublicKeyHex(l.ecpubhex),a.setPrivateKeyHex(l.ecprvhex),a.isPrivate=!0,a.isPublic=!1,(r=new ue.crypto.ECDSA({curve:u})).setPublicKeyHex(l.ecpubhex),r.isPrivate=!1,r.isPublic=!0,(s={}).prvKeyObj=a,s.pubKeyObj=r,s}throw new Error("unknown algorithm: "+e)},tt.getPEM=function(e,t,n,r,i,o){var a=ue,s=a.asn1,u=s.DERObjectIdentifier,l=s.DERInteger,c=s.ASN1Util.newObject,p=s.x509.SubjectPublicKeyInfo,h=a.crypto,d=h.DSA,f=h.ECDSA,m=ne;function v(e){return c({seq:[{int:0},{int:{bigint:e.n}},{int:e.e},{int:{bigint:e.d}},{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.dmp1}},{int:{bigint:e.dmq1}},{int:{bigint:e.coeff}}]})}function y(e){return c({seq:[{int:1},{octstr:{hex:e.prvKeyHex}},{tag:["a0",!0,{oid:{name:e.curveName}}]},{tag:["a1",!0,{bitstr:{hex:"00"+e.pubKeyHex}}]}]})}function b(e){return c({seq:[{int:0},{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.g}},{int:{bigint:e.y}},{int:{bigint:e.x}}]})}if((void 0!==m&&e instanceof m||void 0!==d&&e instanceof d||void 0!==f&&e instanceof f)&&1==e.isPublic&&(void 0===t||"PKCS8PUB"==t))return De(E=new p(e).tohex(),"PUBLIC KEY");if("PKCS1PRV"==t&&void 0!==m&&e instanceof m&&(void 0===n||null==n)&&1==e.isPrivate)return De(E=v(e).tohex(),"RSA PRIVATE KEY");if("PKCS1PRV"==t&&void 0!==f&&e instanceof f&&(void 0===n||null==n)&&1==e.isPrivate){var w=new u({name:e.curveName}).tohex(),x=y(e).tohex(),S="";return S+=De(w,"EC PARAMETERS"),S+=De(x,"EC PRIVATE KEY")}if("PKCS1PRV"==t&&void 0!==d&&e instanceof d&&(void 0===n||null==n)&&1==e.isPrivate)return De(E=b(e).tohex(),"DSA PRIVATE KEY");if("PKCS5PRV"==t&&void 0!==m&&e instanceof m&&void 0!==n&&null!=n&&1==e.isPrivate){var E=v(e).tohex();return void 0===r&&(r="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("RSA",E,n,r,o)}if("PKCS5PRV"==t&&void 0!==f&&e instanceof f&&void 0!==n&&null!=n&&1==e.isPrivate){E=y(e).tohex();return void 0===r&&(r="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("EC",E,n,r,o)}if("PKCS5PRV"==t&&void 0!==d&&e instanceof d&&void 0!==n&&null!=n&&1==e.isPrivate){E=b(e).tohex();return void 0===r&&(r="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("DSA",E,n,r,o)}var A=function(e,t){var n=F(e,t);return new c({seq:[{seq:[{oid:{name:"pkcs5PBES2"}},{seq:[{seq:[{oid:{name:"pkcs5PBKDF2"}},{seq:[{octstr:{hex:n.pbkdf2Salt}},{int:n.pbkdf2Iter}]}]},{seq:[{oid:{name:"des-EDE3-CBC"}},{octstr:{hex:n.encryptionSchemeIV}}]}]}]},{octstr:{hex:n.ciphertext}}]}).tohex()},F=function(e,t){var n=g.lib.WordArray.random(8),r=g.lib.WordArray.random(8),i=g.PBKDF2(t,n,{keySize:6,iterations:100}),o=g.enc.Hex.parse(e),a=g.TripleDES.encrypt(o,i,{iv:r})+"",s={};return s.ciphertext=a,s.pbkdf2Salt=g.enc.Hex.stringify(n),s.pbkdf2Iter=100,s.encryptionSchemeAlg="DES-EDE3-CBC",s.encryptionSchemeIV=g.enc.Hex.stringify(r),s};if("PKCS8PRV"==t&&null!=m&&e instanceof m&&1==e.isPrivate){var C=v(e).tohex();E=c({seq:[{int:0},{seq:[{oid:{name:"rsaEncryption"}},{null:!0}]},{octstr:{hex:C}}]}).tohex();return void 0===n||null==n?De(E,"PRIVATE KEY"):De(x=A(E,n),"ENCRYPTED PRIVATE KEY")}if("PKCS8PRV"==t&&void 0!==f&&e instanceof f&&1==e.isPrivate){var $={seq:[{int:1},{octstr:{hex:e.prvKeyHex}}]};"string"==typeof e.pubKeyHex&&$.seq.push({tag:["a1",!0,{bitstr:{hex:"00"+e.pubKeyHex}}]});C=new c($).tohex(),E=c({seq:[{int:0},{seq:[{oid:{name:"ecPublicKey"}},{oid:{name:e.curveName}}]},{octstr:{hex:C}}]}).tohex();return void 0===n||null==n?De(E,"PRIVATE KEY"):De(x=A(E,n),"ENCRYPTED PRIVATE KEY")}if("PKCS8PRV"==t&&void 0!==d&&e instanceof d&&1==e.isPrivate){C=new l({bigint:e.x}).tohex(),E=c({seq:[{int:0},{seq:[{oid:{name:"dsa"}},{seq:[{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.g}}]}]},{octstr:{hex:C}}]}).tohex();return void 0===n||null==n?De(E,"PRIVATE KEY"):De(x=A(E,n),"ENCRYPTED PRIVATE KEY")}throw new Error("unsupported object nor format")},tt.getKeyFromCSRPEM=function(e){var t=Te(e,"CERTIFICATE REQUEST");return tt.getKeyFromCSRHex(t)},tt.getKeyFromCSRHex=function(e){var t=tt.parseCSRHex(e);return tt.getKey(t.p8pubkeyhex,null,"pkcs8pub")},tt.parseCSRHex=function(e){var t=pe,n=t.getChildIdx,r=t.getTLV,i={},o=e;if("30"!=o.substr(0,2))throw new Error("malformed CSR(code:001)");var a=n(o,0);if(a.length<1)throw new Error("malformed CSR(code:002)");if("30"!=o.substr(a[0],2))throw new Error("malformed CSR(code:003)");var s=n(o,a[0]);if(s.length<3)throw new Error("malformed CSR(code:004)");return i.p8pubkeyhex=r(o,s[2]),i},tt.getKeyID=function(e){var t=tt,n=pe;"string"==typeof e&&-1!=e.indexOf("BEGIN ")&&(e=t.getKey(e));var r=Te(t.getPEM(e)),i=n.getIdxbyList(r,0,[1]),o=n.getV(r,i).substring(2);return ue.crypto.Util.hashHex(o,"sha1")},tt.getJWK=function(e,t,n,r,i){var o,a,s={},u=ue.crypto.Util.hashHex;if("string"==typeof e)o=tt.getKey(e),-1!=e.indexOf("CERTIFICATE")&&(a=Te(e));else{if("object"!=typeof e)throw new Error("unsupported keyinfo type");e instanceof ot?(o=e.getPublicKey(),a=e.hex):o=e}if(o instanceof ne&&o.isPrivate)s.kty="RSA",s.n=ye(o.n.toString(16)),s.e=ye(o.e.toString(16)),s.d=ye(o.d.toString(16)),s.p=ye(o.p.toString(16)),s.q=ye(o.q.toString(16)),s.dp=ye(o.dmp1.toString(16)),s.dq=ye(o.dmq1.toString(16)),s.qi=ye(o.coeff.toString(16));else if(o instanceof ne&&o.isPublic)s.kty="RSA",s.n=ye(o.n.toString(16)),s.e=ye(o.e.toString(16));else if(o instanceof ue.crypto.ECDSA&&o.isPrivate){if("P-256"!==(c=o.getShortNISTPCurveName())&&"P-384"!==c&&"P-521"!==c)throw new Error("unsupported curve name for JWT: "+c);var l=o.getPublicKeyXYHex();s.kty="EC",s.crv=c,s.x=ye(l.x),s.y=ye(l.y),s.d=ye(o.prvKeyHex)}else if(o instanceof ue.crypto.ECDSA&&o.isPublic){var c;if("P-256"!==(c=o.getShortNISTPCurveName())&&"P-384"!==c&&"P-521"!==c)throw new Error("unsupported curve name for JWT: "+c);l=o.getPublicKeyXYHex();s.kty="EC",s.crv=c,s.x=ye(l.x),s.y=ye(l.y)}if(null==s.kty)throw new Error("unsupported keyinfo");return o.isPrivate||1==t||(s.kid=ue.jws.JWS.getJWKthumbprint(s)),null!=a&&1!=n&&(s.x5c=[y(a)]),null!=a&&1!=r&&(s.x5t=me(y(u(a,"sha1")))),null!=a&&1!=i&&(s["x5t#S256"]=me(y(u(a,"sha256")))),s},tt.getJWKFromKey=function(e){return tt.getJWK(e,!0,!0,!0,!0)},ne.getPosArrayOfChildrenFromHex=function(e){return pe.getChildIdx(e,0)},ne.getHexValueArrayOfChildrenFromHex=function(e){var t,n=pe.getV,r=n(e,(t=ne.getPosArrayOfChildrenFromHex(e))[0]),i=n(e,t[1]),o=n(e,t[2]),a=n(e,t[3]),s=n(e,t[4]),u=n(e,t[5]),l=n(e,t[6]),c=n(e,t[7]),p=n(e,t[8]);return(t=new Array).push(r,i,o,a,s,u,l,c,p),t},ne.prototype.readPrivateKeyFromPEMString=function(e){var t=Te(e),n=ne.getHexValueArrayOfChildrenFromHex(t);this.setPrivateEx(n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8])},ne.prototype.readPKCS5PrvKeyHex=function(e){var t=ne.getHexValueArrayOfChildrenFromHex(e);this.setPrivateEx(t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},ne.prototype.readPKCS8PrvKeyHex=function(e){var t,n,r,i,o,a,s,u,l=pe,c=l.getVbyListEx;if(!1===l.isASN1HEX(e))throw new Error("not ASN.1 hex string");try{t=c(e,0,[2,0,1],"02"),n=c(e,0,[2,0,2],"02"),r=c(e,0,[2,0,3],"02"),i=c(e,0,[2,0,4],"02"),o=c(e,0,[2,0,5],"02"),a=c(e,0,[2,0,6],"02"),s=c(e,0,[2,0,7],"02"),u=c(e,0,[2,0,8],"02")}catch(e){throw new Error("malformed PKCS#8 plain RSA private key")}this.setPrivateEx(t,n,r,i,o,a,s,u)},ne.prototype.readPKCS5PubKeyHex=function(e){var t=pe,n=t.getV;if(!1===t.isASN1HEX(e))throw new Error("keyHex is not ASN.1 hex string");var r=t.getChildIdx(e,0);if(2!==r.length||"02"!==e.substr(r[0],2)||"02"!==e.substr(r[1],2))throw new Error("wrong hex for PKCS#5 public key");var i=n(e,r[0]),o=n(e,r[1]);this.setPublic(i,o)},ne.prototype.readPKCS8PubKeyHex=function(e){var t=pe;if(!1===t.isASN1HEX(e))throw new Error("not ASN.1 hex string");if("06092a864886f70d010101"!==t.getTLVbyListEx(e,0,[0,0]))throw new Error("not PKCS8 RSA public key");var n=t.getTLVbyListEx(e,0,[1,0]);this.readPKCS5PubKeyHex(n)},ne.prototype.readCertPubKeyHex=function(e,t){var n,r;(n=new ot).readCertHex(e),r=n.getPublicKeyHex(),this.readPKCS8PubKeyHex(r)};new RegExp("[^0-9a-f]","gi");function nt(e,t){for(var n="",r=t/4-e.length,i=0;i<r;i++)n+="0";return n+e}function rt(e,t,n){for(var r="",i=0;r.length<t;)r+=Ee(n(Ae(e+String.fromCharCode.apply(String,[(4278190080&i)>>24,(16711680&i)>>16,(65280&i)>>8,255&i])))),i+=1;return r}function it(e){for(var t in ue.crypto.Util.DIGESTINFOHEAD){var n=ue.crypto.Util.DIGESTINFOHEAD[t],r=n.length;if(e.substring(0,r)==n)return[t,e.substring(r)]}return[]}function ot(e){var t,n=pe,r=n.getChildIdx,i=n.getV,o=(n.dump,n.parse),a=n.getTLV,s=n.getVbyList,u=n.getVbyListEx,l=n.getTLVbyList,c=n.getTLVbyListEx,p=n.getIdxbyList,h=n.getIdxbyListEx,d=n.getVidx,f=n.getInt,g=n.oidname,m=n.hextooidstr,v=Te,y=Error;try{t=ue.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV}catch(e){}this.HEX2STAG={"0c":"utf8",13:"prn",16:"ia5","1a":"vis","1e":"bmp"},this.hex=null,this.version=0,this.foffset=0,this.aExtInfo=null,this.getVersion=function(){if(null===this.hex||0!==this.version)return this.version;var e=l(this.hex,0,[0,0]);if("a0"==e.substr(0,2)){var t=l(e,0,[0]),n=f(t,0);if(n<0||2<n)throw new Error("malformed version field");return this.version=n+1,this.version}return this.version=1,this.foffset=-1,1},this.getSerialNumberHex=function(){return u(this.hex,0,[0,0],"02")},this.getSignatureAlgorithmField=function(){var e=c(this.hex,0,[0,1]);return this.getAlgorithmIdentifierName(e)},this.getAlgorithmIdentifierName=function(e){for(var n in t)if(e===t[n])return n;return g(u(e,0,[0],"06"))},this.getIssuer=function(e,t){return this.getX500Name(this.getIssuerHex(),e,t)},this.getIssuerHex=function(){return l(this.hex,0,[0,3+this.foffset],"30")},this.getIssuerString=function(){return this.getIssuer().str},this.getSubject=function(e,t){return this.getX500Name(this.getSubjectHex(),e,t)},this.getSubjectHex=function(){return l(this.hex,0,[0,5+this.foffset],"30")},this.getSubjectString=function(){return this.getSubject().str},this.getNotBefore=function(){var e=s(this.hex,0,[0,4+this.foffset,0]);return e=e.replace(/(..)/g,"%$1"),e=decodeURIComponent(e)},this.getNotAfter=function(){var e=s(this.hex,0,[0,4+this.foffset,1]);return e=e.replace(/(..)/g,"%$1"),e=decodeURIComponent(e)},this.getPublicKeyHex=function(){return this.getSPKI()},this.getSPKI=function(){return l(this.hex,0,[0,6+this.foffset],"30")},this.getSPKIValue=function(){var e=this.getSPKI();return null==e?null:s(e,0,[1],"03",!0)},this.getPublicKeyIdx=function(){return p(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyContentIdx=function(){var e=this.getPublicKeyIdx();return p(this.hex,e,[1,0],"30")},this.getPublicKey=function(){return tt.getKey(this.getPublicKeyHex(),null,"pkcs8pub")},this.getSignatureAlgorithmName=function(){var e=l(this.hex,0,[1],"30");return this.getAlgorithmIdentifierName(e)},this.getSignatureValueHex=function(){return s(this.hex,0,[2],"03",!0)},this.verifySignature=function(e){var t=this.getSignatureAlgorithmField(),n=this.getSignatureValueHex(),r=l(this.hex,0,[0],"30"),i=new ue.crypto.Signature({alg:t});return i.init(e),i.updateHex(r),i.verify(n)},this.parseExt=function(e){var t,o,a;if(void 0===e){if(a=this.hex,3!==this.version)return-1;t=p(a,0,[0,7,0],"30"),o=r(a,t)}else{a=Te(e);var u=p(a,0,[0,3,0,0],"06");if("2a864886f70d01090e"!=i(a,u))return void(this.aExtInfo=new Array);t=p(a,0,[0,3,0,1,0],"30"),o=r(a,t),this.hex=a}this.aExtInfo=new Array;for(var l=0;l<o.length;l++){var c={critical:!1},h=0;3===r(a,o[l]).length&&(c.critical=!0,h=1),c.oid=n.hextooidstr(s(a,o[l],[0],"06"));var f=p(a,o[l],[1+h]);c.vidx=d(a,f),this.aExtInfo.push(c)}},this.getExtInfo=function(e){var t=this.aExtInfo,n=e;if(e.match(/^[0-9.]+$/)||(n=ue.asn1.x509.OID.name2oid(e)),""!==n)for(var r=0;r<t.length;r++)if(t[r].oid===n)return t[r]},this.getCriticalExtV=function(e,t,n){if(null!=t)return[t,n];var r=this.getExtInfo(e);return null==r?[null,null]:[a(this.hex,r.vidx),r.critical]},this.getExtBasicConstraints=function(e,t){if(void 0===e&&void 0===t){var n=this.getExtInfo("basicConstraints");if(void 0===n)return;e=a(this.hex,n.vidx),t=n.critical}var r={extname:"basicConstraints"};if(t&&(r.critical=!0),"3000"===e)return r;if("30030101ff"===e)return r.cA=!0,r;if("30060101ff02"===e.substr(0,12)){var o=i(e,10),s=parseInt(o,16);return r.cA=!0,r.pathLen=s,r}throw new Error("hExtV parse error: "+e)},this.getExtNameConstraints=function(e,t){var n=this.getCriticalExtV("nameConstraints",e,t);if(e=n[0],t=n[1],null!=e){var i={extname:"nameConstraints"};t&&(i.critical=!0);for(var o=r(e,0),s=0;s<o.length;s++){for(var u=[],l=r(e,o[s]),c=0;c<l.length;c++){var p=a(e,l[c]),h=this.getGeneralSubtree(p);u.push(h)}var d=e.substr(o[s],2);"a0"==d?i.permit=u:"a1"==d&&(i.exclude=u)}return i}},this.getGeneralSubtree=function(e){var t=r(e,0),n=t.length;if(n<1||2<n)throw new Error("wrong num elements");for(var o=this.getGeneralName(a(e,t[0])),s=1;s<n;s++){var u=e.substr(t[s],2),l=i(e,t[s]),c=parseInt(l,16);"80"==u&&(o.min=c),"81"==u&&(o.max=c)}return o},this.getExtKeyUsage=function(e,t){var n=this.getCriticalExtV("keyUsage",e,t);if(e=n[0],t=n[1],null!=e){var r={extname:"keyUsage"};return t&&(r.critical=!0),r.names=this.getExtKeyUsageString(e).split(","),r}},this.getExtKeyUsageBin=function(e){if(void 0===e){var t=this.getExtInfo("keyUsage");if(void 0===t)return"";e=a(this.hex,t.vidx)}if(8!=e.length&&10!=e.length)throw new Error("malformed key usage value: "+e);var n="000000000000000"+parseInt(e.substr(6),16).toString(2);return 8==e.length&&(n=n.slice(-8)),10==e.length&&(n=n.slice(-16)),""==(n=n.replace(/0+$/,""))&&(n="0"),n},this.getExtKeyUsageString=function(e){for(var t=this.getExtKeyUsageBin(e),n=new Array,r=0;r<t.length;r++)"1"==t.substr(r,1)&&n.push(ot.KEYUSAGE_NAME[r]);return n.join(",")},this.getExtSubjectKeyIdentifier=function(e,t){if(void 0===e&&void 0===t){var n=this.getExtInfo("subjectKeyIdentifier");if(void 0===n)return;e=a(this.hex,n.vidx),t=n.critical}var r={extname:"subjectKeyIdentifier"};t&&(r.critical=!0);var o=i(e,0);return r.kid={hex:o},r},this.getExtAuthorityKeyIdentifier=function(e,t){if(void 0===e&&void 0===t){var n=this.getExtInfo("authorityKeyIdentifier");if(void 0===n)return;e=a(this.hex,n.vidx),t=n.critical}var o={extname:"authorityKeyIdentifier"};t&&(o.critical=!0);for(var s=r(e,0),u=0;u<s.length;u++){var l=e.substr(s[u],2);if("80"===l&&(o.kid={hex:i(e,s[u])}),"a1"===l){var c=a(e,s[u]),p=this.getGeneralNames(c);o.issuer=p[0].dn}"82"===l&&(o.sn={hex:i(e,s[u])})}return o},this.getExtExtKeyUsage=function(e,t){if(void 0===e&&void 0===t){var n=this.getExtInfo("extKeyUsage");if(void 0===n)return;e=a(this.hex,n.vidx),t=n.critical}var o={extname:"extKeyUsage",array:[]};t&&(o.critical=!0);for(var s=r(e,0),u=0;u<s.length;u++)o.array.push(g(i(e,s[u])));return o},this.getExtExtKeyUsageName=function(){var e=this.getExtInfo("extKeyUsage");if(void 0===e)return e;var t=new Array,n=a(this.hex,e.vidx);if(""===n)return t;for(var o=r(n,0),s=0;s<o.length;s++)t.push(g(i(n,o[s])));return t},this.getExtSubjectAltName=function(e,t){if(void 0===e&&void 0===t){var n=this.getExtInfo("subjectAltName");if(void 0===n)return;e=a(this.hex,n.vidx),t=n.critical}var r={extname:"subjectAltName",array:[]};return t&&(r.critical=!0),r.array=this.getGeneralNames(e),r},this.getExtIssuerAltName=function(e,t){if(void 0===e&&void 0===t){var n=this.getExtInfo("issuerAltName");if(void 0===n)return;e=a(this.hex,n.vidx),t=n.critical}var r={extname:"issuerAltName",array:[]};return t&&(r.critical=!0),r.array=this.getGeneralNames(e),r},this.getGeneralNames=function(e){for(var t=r(e,0),n=[],i=0;i<t.length;i++){var o=this.getGeneralName(a(e,t[i]));void 0!==o&&n.push(o)}return n},this.getGeneralName=function(e){var t=e.substr(0,2),n=i(e,0),r=Ee(n);return"81"==t?{rfc822:r}:"82"==t?{dns:r}:"86"==t?{uri:r}:"87"==t?{ip:Ne(n)}:"a4"==t?{dn:this.getX500Name(n)}:"a0"==t?{other:this.getOtherName(e)}:void 0},this.getExtSubjectAltName2=function(){var e,t,n,o=this.getExtInfo("subjectAltName");if(void 0===o)return o;for(var s=new Array,u=a(this.hex,o.vidx),l=r(u,0),c=0;c<l.length;c++)n=u.substr(l[c],2),e=i(u,l[c]),"81"===n&&(t=xe(e),s.push(["MAIL",t])),"82"===n&&(t=xe(e),s.push(["DNS",t])),"84"===n&&(t=ot.hex2dn(e,0),s.push(["DN",t])),"86"===n&&(t=xe(e),s.push(["URI",t])),"87"===n&&(t=Ne(e),s.push(["IP",t]));return s},this.getExtCRLDistributionPoints=function(e,t){if(void 0===e&&void 0===t){var n=this.getExtInfo("cRLDistributionPoints");if(void 0===n)return;e=a(this.hex,n.vidx),t=n.critical}var i={extname:"cRLDistributionPoints",array:[]};t&&(i.critical=!0);for(var o=r(e,0),s=0;s<o.length;s++){var u=a(e,o[s]);i.array.push(this.getDistributionPoint(u))}return i},this.getDistributionPoint=function(e){for(var t={},n=r(e,0),i=0;i<n.length;i++){var o=e.substr(n[i],2),s=a(e,n[i]);"a0"==o&&(t.dpname=this.getDistributionPointName(s))}return t},this.getDistributionPointName=function(e){for(var t={},n=r(e,0),i=0;i<n.length;i++){var o=e.substr(n[i],2),s=a(e,n[i]);"a0"==o&&(t.full=this.getGeneralNames(s))}return t},this.getExtCRLDistributionPointsURI=function(){var e=this.getExtCRLDistributionPoints();if(null==e)return e;for(var t=e.array,n=[],r=0;r<t.length;r++)try{null!=t[r].dpname.full[0].uri&&n.push(t[r].dpname.full[0].uri)}catch(e){}return n},this.getExtAIAInfo=function(){var e=this.getExtInfo("authorityInfoAccess");if(void 0===e)return e;for(var t={ocsp:[],caissuer:[]},n=r(this.hex,e.vidx),i=0;i<n.length;i++){var o=s(this.hex,n[i],[0],"06"),a=s(this.hex,n[i],[1],"86");"2b06010505073001"===o&&t.ocsp.push(xe(a)),"2b06010505073002"===o&&t.caissuer.push(xe(a))}return t},this.getExtAuthorityInfoAccess=function(e,t){if(void 0===e&&void 0===t){var n=this.getExtInfo("authorityInfoAccess");if(void 0===n)return;e=a(this.hex,n.vidx),t=n.critical}var i={extname:"authorityInfoAccess",array:[]};t&&(i.critical=!0);for(var o=r(e,0),l=0;l<o.length;l++){var c=u(e,o[l],[0],"06"),p=xe(s(e,o[l],[1],"86"));if("2b06010505073001"==c)i.array.push({ocsp:p});else{if("2b06010505073002"!=c)throw new Error("unknown method: "+c);i.array.push({caissuer:p})}}return i},this.getExtCertificatePolicies=function(e,t){if(void 0===e&&void 0===t){var n=this.getExtInfo("certificatePolicies");if(void 0===n)return;e=a(this.hex,n.vidx),t=n.critical}var i={extname:"certificatePolicies",array:[]};t&&(i.critical=!0);for(var o=r(e,0),s=0;s<o.length;s++){var u=a(e,o[s]),l=this.getPolicyInformation(u);i.array.push(l)}return i},this.getPolicyInformation=function(e){var t={},n=s(e,0,[0],"06");t.policyoid=g(n);var i=h(e,0,[1],"30");if(-1!=i){t.array=[];for(var o=r(e,i),u=0;u<o.length;u++){var l=a(e,o[u]),c=this.getPolicyQualifierInfo(l);t.array.push(c)}}return t},this.getOtherName=function(e){var t={},n=r(e,0),i=s(e,n[0],[],"06"),a=s(e,n[1],[]);return t.oid=g(i),t.value=o(a),t},this.getPolicyQualifierInfo=function(e){var t={},n=s(e,0,[0],"06");if("2b06010505070201"===n){var r=u(e,0,[1],"16");t.cps=Ee(r)}else if("2b06010505070202"===n){var i=l(e,0,[1],"30");t.unotice=this.getUserNotice(i)}return t},this.getUserNotice=function(e){var t=null;try{return t=n.parse(e),this._asn1ToUnotice(t)}catch(e){return}},this._asn1ToUnotice=function(e){try{for(var t={},n=Qe(e,"seq"),r=0;r<n.length;r++){var i=this._asn1ToNoticeRef(n[r]);null!=i&&(t.noticeref=i);var o=this.asn1ToDisplayText(n[r]);null!=o&&(t.exptext=o)}return Object.keys(t).length>0?t:void 0}catch(e){return}},this._asn1ToNoticeRef=function(e){try{for(var t={},n=Qe(e,"seq"),r=0;r<n.length;r++){var i=this._asn1ToNoticeNum(n[r]);null!=i&&(t.noticenum=i);var o=this.asn1ToDisplayText(n[r]);null!=o&&(t.org=o)}return Object.keys(t).length>0?t:void 0}catch(e){return}},this._asn1ToNoticeNum=function(e){try{for(var t=Qe(e,"seq"),n=[],r=0;r<t.length;r++){var i=t[r];n.push(parseInt(Qe(i,"int.hex"),16))}return n}catch(e){return}},this.getDisplayText=function(e){var t={};return t.type={"0c":"utf8",16:"ia5","1a":"vis","1e":"bmp"}[e.substr(0,2)],t.str=Ee(i(e,0)),t},this.asn1ToDisplayText=function(e){return null!=e.utf8str?{type:"utf8",str:e.utf8str.str}:null!=e.ia5str?{type:"ia5",str:e.ia5str.str}:null!=e.visstr?{type:"vis",str:e.visstr.str}:null!=e.bmpstr?{type:"bmp",str:e.bmpstr.str}:null!=e.prnstr?{type:"prn",str:e.prnstr.str}:void 0},this.getExtPolicyMappings=function(e,t){var n=this.getCriticalExtV("policyMappings",e,t);if(e=n[0],t=n[1],null!=e){var r={extname:"policyMappings"};t&&(r.critical=!0);try{for(var i=o(e).seq,a=[],s=0;s<i.length;s++){var u=i[s].seq;a.push([u[0].oid,u[1].oid])}r.array=a}catch(e){throw new y("malformed policyMappings")}return r}},this.getExtPolicyConstraints=function(e,t){var n=this.getCriticalExtV("policyConstraints",e,t);if(e=n[0],t=n[1],null!=e){var r={extname:"policyConstraints"};t&&(r.critical=!0);var i=o(e);try{for(var a=i.seq,s=0;s<a.length;s++){var u=a[s].tag;0==u.explicit&&("80"==u.tag&&(r.reqexp=parseInt(u.hex,16)),"81"==u.tag&&(r.inhibit=parseInt(u.hex,16)))}}catch(e){return new y("malformed policyConstraints value")}return r}},this.getExtInhibitAnyPolicy=function(e,t){var n=this.getCriticalExtV("inhibitAnyPolicy",e,t);if(e=n[0],t=n[1],null!=e){var r={extname:"inhibitAnyPolicy"};t&&(r.critical=!0);var i=f(e,0);return-1==i?new y("wrong value"):(r.skip=i,r)}},this.getExtCRLNumber=function(e,t){var n={extname:"cRLNumber"};if(t&&(n.critical=!0),"02"==e.substr(0,2))return n.num={hex:i(e,0)},n;throw new y("hExtV parse error: "+e)},this.getExtCRLReason=function(e,t){var n={extname:"cRLReason"};if(t&&(n.critical=!0),"0a"==e.substr(0,2))return n.code=parseInt(i(e,0),16),n;throw new Error("hExtV parse error: "+e)},this.getExtOcspNonce=function(e,t){var n={extname:"ocspNonce"};t&&(n.critical=!0);var r=i(e,0);return n.hex=r,n},this.getExtOcspNoCheck=function(e,t){var n={extname:"ocspNoCheck"};return t&&(n.critical=!0),n},this.getExtAdobeTimeStamp=function(e,t){if(void 0===e&&void 0===t){var n=this.getExtInfo("adobeTimeStamp");if(void 0===n)return;e=a(this.hex,n.vidx),t=n.critical}var i={extname:"adobeTimeStamp"};t&&(i.critical=!0);var o=r(e,0);if(o.length>1){var s=a(e,o[1]),u=this.getGeneralName(s);null!=u.uri&&(i.uri=u.uri)}if(o.length>2){var l=a(e,o[2]);"0101ff"==l&&(i.reqauth=!0),"010100"==l&&(i.reqauth=!1)}return i},this.getExtSubjectDirectoryAttributes=function(e,t){if(void 0===e&&void 0===t){var n=this.getExtInfo("subjectDirectoryAttributes");if(void 0===n)return;e=a(this.hex,n.vidx),t=n.critical}var r={extname:"subjectDirectoryAttributes"};t&&(r.critical=!0);try{for(var i=o(e),s=[],u=0;u<i.seq.length;u++){var l=i.seq[u],c=Qe(l,"seq.0.oid"),p=Qe(l,"seq.1.set");if(null==c||null==p)throw"error";s.push({attr:c,array:p})}return r.array=s,r}catch(e){throw new Error("malformed subjectDirectoryAttributes extension value")}};var b=function(e){var t={};try{var n=e.seq[0].oid,r=ue.asn1.x509.OID.name2oid(n);t.type=ue.asn1.x509.OID.oid2atype(r);var i=e.seq[1];if(null!=i.utf8str)t.ds="utf8",t.value=i.utf8str.str;else if(null!=i.numstr)t.ds="num",t.value=i.numstr.str;else if(null!=i.telstr)t.ds="tel",t.value=i.telstr.str;else if(null!=i.prnstr)t.ds="prn",t.value=i.prnstr.str;else if(null!=i.ia5str)t.ds="ia5",t.value=i.ia5str.str;else if(null!=i.visstr)t.ds="vis",t.value=i.visstr.str;else{if(null==i.bmpstr)throw"error";t.ds="bmp",t.value=i.bmpstr.str}return t}catch(e){throw new Erorr("improper ASN.1 parsed AttrTypeAndValue")}},w=function(e){try{return e.set.map((function(e){return b(e)}))}catch(e){throw new Error("improper ASN.1 parsed RDN: "+e)}};this.getX500NameRule=function(e){for(var t=null,n=[],r=0;r<e.length;r++)for(var i=e[r],o=0;o<i.length;o++)n.push(i[o]);for(r=0;r<n.length;r++){var a=n[r],s=a.ds,u=a.value,l=a.type;if(":"+s,"prn"!=s&&"utf8"!=s&&"ia5"!=s)return"mixed";if("ia5"==s){if("CN"!=l)return"mixed";if(ue.lang.String.isMail(u))continue;return"mixed"}if("C"==l){if("prn"==s)continue;return"mixed"}if(":"+s,null==t)t=s;else if(t!==s)return"mixed"}return null==t?"prn":t},this.getAttrTypeAndValue=function(e){var t=o(e);return b(t)},this.getRDN=function(e){var t=o(e);return w(t)},this.getX500NameArray=function(e){return function(e){try{return e.seq.map((function(e){return w(e)}))}catch(e){throw new Error("improper ASN.1 parsed X500Name: "+e)}}(o(e))},this.getX500Name=function(e,t,n){var r=this.getX500NameArray(e),i={str:this.dnarraytostr(r)};return i.array=r,1==n&&(i.hex=e),1==t&&(i.canon=this.c14nRDNArray(r)),i},this.readCertPEM=function(e){this.readCertHex(v(e))},this.readCertHex=function(e){this.hex=e,this.getVersion();try{p(this.hex,0,[0,7],"a3"),this.parseExt()}catch(e){}},this.getParam=function(e){var t={};return null==e&&(e={}),t.version=this.getVersion(),t.serial={hex:this.getSerialNumberHex()},t.sigalg=this.getSignatureAlgorithmField(),t.issuer=this.getIssuer(e.dncanon,e.dnhex),t.notbefore=this.getNotBefore(),t.notafter=this.getNotAfter(),t.subject=this.getSubject(e.dncanon,e.dnhex),t.sbjpubkey=De(this.getPublicKeyHex(),"PUBLIC KEY"),null!=this.aExtInfo&&this.aExtInfo.length>0&&(t.ext=this.getExtParamArray()),t.sighex=this.getSignatureValueHex(),1==e.tbshex&&(t.tbshex=l(this.hex,0,[0])),1==e.nodnarray&&(delete t.issuer.array,delete t.subject.array),t},this.getExtParamArray=function(e){null==e&&(-1!=h(this.hex,0,[0,"[3]"])&&(e=c(this.hex,0,[0,"[3]",0],"30")));for(var t=[],n=r(e,0),i=0;i<n.length;i++){var o=a(e,n[i]),s=this.getExtParam(o);null!=s&&t.push(s)}return t},this.getExtParam=function(e){var t=r(e,0).length;if(2!=t&&3!=t)throw new Error("wrong number elements in Extension: "+t+" "+e);var n=m(s(e,0,[0],"06")),i=!1;3==t&&"0101ff"==l(e,0,[1])&&(i=!0);var a=l(e,0,[t-1,0]),u=void 0;if("2.5.29.14"==n?u=this.getExtSubjectKeyIdentifier(a,i):"2.5.29.15"==n?u=this.getExtKeyUsage(a,i):"2.5.29.17"==n?u=this.getExtSubjectAltName(a,i):"2.5.29.18"==n?u=this.getExtIssuerAltName(a,i):"2.5.29.19"==n?u=this.getExtBasicConstraints(a,i):"2.5.29.30"==n?u=this.getExtNameConstraints(a,i):"2.5.29.31"==n?u=this.getExtCRLDistributionPoints(a,i):"2.5.29.32"==n?u=this.getExtCertificatePolicies(a,i):"2.5.29.33"==n?u=this.getExtPolicyMappings(a,i):"2.5.29.35"==n?u=this.getExtAuthorityKeyIdentifier(a,i):"2.5.29.36"==n?u=this.getExtPolicyConstraints(a,i):"2.5.29.37"==n?u=this.getExtExtKeyUsage(a,i):"2.5.29.54"==n?u=this.getExtInhibitAnyPolicy(a,i):"1.3.6.1.5.5.7.1.1"==n?u=this.getExtAuthorityInfoAccess(a,i):"2.5.29.20"==n?u=this.getExtCRLNumber(a,i):"2.5.29.21"==n?u=this.getExtCRLReason(a,i):"2.5.29.9"==n?u=this.getExtSubjectDirectoryAttributes(a,i):"1.3.6.1.5.5.7.48.1.2"==n?u=this.getExtOcspNonce(a,i):"1.3.6.1.5.5.7.48.1.5"==n?u=this.getExtOcspNoCheck(a,i):"1.2.840.113583.1.1.9.1"==n?u=this.getExtAdobeTimeStamp(a,i):null!=ot.EXT_PARSER[n]&&(u=ot.EXT_PARSER[n](n,i,a)),null!=u)return u;var c={extname:n,extn:a};try{c.extn=o(a)}catch(e){}return i&&(c.critical=!0),c},this.findExt=function(e,t){for(var n=0;n<e.length;n++)if(e[n].extname==t)return e[n];return null},this.updateExtCDPFullURI=function(e,t){var n=this.findExt(e,"cRLDistributionPoints");if(null!=n&&null!=n.array)for(var r=n.array,i=0;i<r.length;i++)if(null!=r[i].dpname&&null!=r[i].dpname.full)for(var o=r[i].dpname.full,a=0;a<o.length;a++){var s=o[i];null!=s.uri&&(s.uri=t)}},this.updateExtAIAOCSP=function(e,t){var n=this.findExt(e,"authorityInfoAccess");if(null!=n&&null!=n.array)for(var r=n.array,i=0;i<r.length;i++)null!=r[i].ocsp&&(r[i].ocsp=t)},this.updateExtAIACAIssuer=function(e,t){var n=this.findExt(e,"authorityInfoAccess");if(null!=n&&null!=n.array)for(var r=n.array,i=0;i<r.length;i++)null!=r[i].caissuer&&(r[i].caissuer=t)},this.dnarraytostr=function(e){return"/"+e.map((function(e){return function(e){return e.map((function(e){return function(e){return e.type+"="+e.value}(e).replace(/\+/,"\\+")})).join("+")}(e).replace(/\//,"\\/")})).join("/")},this.setCanonicalizedDN=function(e){var t;if(null!=e.str&&null==e.array){var n=new ue.asn1.x509.X500Name({str:e.str}).tohex();t=this.getX500NameArray(n)}else t=e.array;null==e.canon&&(e.canon=this.c14nRDNArray(t))},this.c14nRDNArray=function(e){for(var t=[],n=0;n<e.length;n++){for(var r=e[n],i=[],o=0;o<r.length;o++){var a=r[o],s=a.value;s=(s=(s=(s=s.replace(/^\s*/,"")).replace(/\s*$/,"")).replace(/\s+/g," ")).toLowerCase(),i.push(a.type.toLowerCase()+"="+s)}t.push(i.join("+"))}return"/"+t.join("/")},this.getInfo=function(){var e,t,n,r=function(e){for(var t="",n=" ",r="\n",i=e.array,o=0;o<i.length;o++){var a=i[o];if(null!=a.dn&&(t+=n+"dn: "+a.dn.str+r),null!=a.ip&&(t+=n+"ip: "+a.ip+r),null!=a.rfc822&&(t+=n+"rfc822: "+a.rfc822+r),null!=a.dns&&(t+=n+"dns: "+a.dns+r),null!=a.uri&&(t+=n+"uri: "+a.uri+r),null!=a.other)t+=n+"other: "+a.other.oid+"="+JSON.stringify(a.other.value).replace(/\"/g,"")+r}return t=t.replace(/\n$/,"")},i=function(e){for(var t="",n=e.array,r=0;r<n.length;r++){var i=n[r];if(t+=" policy oid: "+i.policyoid+"\n",void 0!==i.array)for(var o=0;o<i.array.length;o++){var a=i.array[o];void 0!==a.cps&&(t+=" cps: "+a.cps+"\n")}}return t},o=function(e){for(var t="",n=e.array,r=0;r<n.length;r++){var i=n[r];try{void 0!==i.dpname.full[0].uri&&(t+=" "+i.dpname.full[0].uri+"\n")}catch(e){}try{void 0!==i.dname.full[0].dn.hex&&(t+=" "+ot.hex2dn(i.dpname.full[0].dn.hex)+"\n")}catch(e){}}return t},a=function(e){for(var t="",n=e.array,r=0;r<n.length;r++){var i=n[r];void 0!==i.caissuer&&(t+=" caissuer: "+i.caissuer+"\n"),void 0!==i.ocsp&&(t+=" ocsp: "+i.ocsp+"\n")}return t};if(e="Basic Fields\n",e+=" serial number: "+this.getSerialNumberHex()+"\n",e+=" signature algorithm: "+this.getSignatureAlgorithmField()+"\n",e+=" issuer: "+this.getIssuerString()+"\n",e+=" notBefore: "+this.getNotBefore()+"\n",e+=" notAfter: "+this.getNotAfter()+"\n",e+=" subject: "+this.getSubjectString()+"\n",e+=" subject public key info: \n",e+=" key algorithm: "+(t=this.getPublicKey()).type+"\n","RSA"===t.type&&(e+=" n="+Ke(t.n.toString(16)).substr(0,16)+"...\n",e+=" e="+Ke(t.e.toString(16))+"\n"),null!=(n=this.aExtInfo)){e+="X509v3 Extensions:\n";for(var s=0;s<n.length;s++){var u=n[s],l=ue.asn1.x509.OID.oid2name(u.oid);""===l&&(l=u.oid);var c="";if(!0===u.critical&&(c="CRITICAL"),e+=" "+l+" "+c+":\n","basicConstraints"===l){var p=this.getExtBasicConstraints();void 0===p.cA?e+=" {}\n":(e+=" cA=true",void 0!==p.pathLen&&(e+=", pathLen="+p.pathLen),e+="\n")}else{var h;if("policyMappings"==l)e+=" "+this.getExtPolicyMappings().array.map((function(e){var t=e;return t[0]+":"+t[1]})).join(", ")+"\n";else if("policyConstraints"==l)e+=" ",null!=(h=this.getExtPolicyConstraints()).reqexp&&(e+=" reqexp="+h.reqexp),null!=h.inhibit&&(e+=" inhibit="+h.inhibit),e+="\n";else if("inhibitAnyPolicy"==l)e+=" skip="+(h=this.getExtInhibitAnyPolicy()).skip+"\n";else if("keyUsage"==l)e+=" "+this.getExtKeyUsageString()+"\n";else if("subjectKeyIdentifier"==l)e+=" "+this.getExtSubjectKeyIdentifier().kid.hex+"\n";else if("authorityKeyIdentifier"==l){var d=this.getExtAuthorityKeyIdentifier();void 0!==d.kid&&(e+=" kid="+d.kid.hex+"\n")}else{if("extKeyUsage"==l)e+=" "+this.getExtExtKeyUsage().array.join(", ")+"\n";else if("subjectAltName"==l)e+=r(this.getExtSubjectAltName())+"\n";else if("cRLDistributionPoints"==l)e+=o(this.getExtCRLDistributionPoints());else if("authorityInfoAccess"==l)e+=a(this.getExtAuthorityInfoAccess());else"certificatePolicies"==l&&(e+=i(this.getExtCertificatePolicies()))}}}}return e+="signature algorithm: "+this.getSignatureAlgorithmName()+"\n",e+="signature: "+this.getSignatureValueHex().substr(0,16)+"...\n"},"string"==typeof e&&(-1!=e.indexOf("-----BEGIN")?this.readCertPEM(e):ue.lang.String.isHex(e)&&this.readCertHex(e))}ne.prototype.sign=function(e,t){var n=function(e){return ue.crypto.Util.hashString(e,t)}(e);return this.signWithMessageHash(n,t)},ne.prototype.signWithMessageHash=function(e,t){var n=ee(ue.crypto.Util.getPaddedDigestInfoHex(e,t,this.n.bitLength()),16);return nt(this.doPrivate(n).toString(16),this.n.bitLength())},ne.prototype.signPSS=function(e,t,n){var r,i=(r=Ae(e),ue.crypto.Util.hashHex(r,t));return void 0===n&&(n=-1),this.signWithMessageHashPSS(i,t,n)},ne.prototype.signWithMessageHashPSS=function(e,t,n){var r,i=Ee(e),o=i.length,a=this.n.bitLength()-1,s=Math.ceil(a/8),u=function(e){return ue.crypto.Util.hashHex(e,t)};if(-1===n||void 0===n)n=o;else if(-2===n)n=s-o-2;else if(n<-2)throw new Error("invalid salt length");if(s<o+n+2)throw new Error("data too long");var l="";n>0&&(l=new Array(n),(new Q).nextBytes(l),l=String.fromCharCode.apply(String,l));var c=Ee(u(Ae("\0\0\0\0\0\0\0\0"+i+l))),p=[];for(r=0;r<s-n-o-2;r+=1)p[r]=0;var h=String.fromCharCode.apply(String,p)+""+l,d=rt(c,h.length,u),f=[];for(r=0;r<h.length;r+=1)f[r]=h.charCodeAt(r)^d.charCodeAt(r);var g=65280>>8*s-a&255;for(f[0]&=~g,r=0;r<o;r++)f.push(c.charCodeAt(r));return f.push(188),nt(this.doPrivate(new x(f)).toString(16),this.n.bitLength())},ne.prototype.verify=function(e,t){if(null==(t=t.toLowerCase()).match(/^[0-9a-f]+$/))return!1;var n=ee(t,16),r=this.n.bitLength();if(n.bitLength()>r)return!1;var i=this.doPublic(n).toString(16);if(i.length+3!=r/4)return!1;var o=it(i.replace(/^1f+00/,""));if(0==o.length)return!1;var a=o[0];return o[1]==function(e){return ue.crypto.Util.hashString(e,a)}(e)},ne.prototype.verifyWithMessageHash=function(e,t){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var n=ee(t,16);if(n.bitLength()>this.n.bitLength())return 0;var r=it(this.doPublic(n).toString(16).replace(/^1f+00/,""));if(0==r.length)return!1;r[0];return r[1]==e},ne.prototype.verifyPSS=function(e,t,n,r){var i,o=(i=Ae(e),ue.crypto.Util.hashHex(i,n));return void 0===r&&(r=-1),this.verifyWithMessageHashPSS(o,t,n,r)},ne.prototype.verifyWithMessageHashPSS=function(e,t,n,r){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var i,o=new x(t,16),a=function(e){return ue.crypto.Util.hashHex(e,n)},s=Ee(e),u=s.length,l=this.n.bitLength()-1,c=Math.ceil(l/8);if(-1===r||void 0===r)r=u;else if(-2===r)r=c-u-2;else if(r<-2)throw new Error("invalid salt length");if(c<u+r+2)throw new Error("data too long");var p=this.doPublic(o).toByteArray();for(i=0;i<p.length;i+=1)p[i]&=255;for(;p.length<c;)p.unshift(0);if(188!==p[c-1])throw new Error("encoded message does not end in 0xbc");var h=(p=String.fromCharCode.apply(String,p)).substr(0,c-u-1),d=p.substr(h.length,u),f=65280>>8*c-l&255;if(0!=(h.charCodeAt(0)&f))throw new Error("bits beyond keysize not zero");var g=rt(d,h.length,a),m=[];for(i=0;i<h.length;i+=1)m[i]=h.charCodeAt(i)^g.charCodeAt(i);m[0]&=~f;var v=c-u-r-2;for(i=0;i<v;i+=1)if(0!==m[i])throw new Error("leftmost octets not zero");if(1!==m[v])throw new Error("0x01 marker not found");return d===Ee(a(Ae("\0\0\0\0\0\0\0\0"+s+String.fromCharCode.apply(String,m.slice(-r)))))},ne.SALT_LEN_HLEN=-1,ne.SALT_LEN_MAX=-2,ne.SALT_LEN_RECOVER=-2,ot.EXT_PARSER={},ot.registExtParser=function(e,t){ot.EXT_PARSER[e]=t},ot.hex2dn=function(e,t){void 0===t&&(t=0);var n=new ot;pe.getTLV(e,t);return n.getX500Name(e).str},ot.hex2rdn=function(e,t){if(void 0===t&&(t=0),"31"!==e.substr(t,2))throw new Error("malformed RDN");for(var n=new Array,r=pe.getChildIdx(e,t),i=0;i<r.length;i++)n.push(ot.hex2attrTypeValue(e,r[i]));return(n=n.map((function(e){return e.replace("+","\\+")}))).join("+")},ot.hex2attrTypeValue=function(e,t){var n=pe,r=n.getV;if(void 0===t&&(t=0),"30"!==e.substr(t,2))throw new Error("malformed attribute type and value");var i=n.getChildIdx(e,t);2!==i.length||e.substr(i[0],2);var o=r(e,i[0]),a=ue.asn1.ASN1Util.oidHexToInt(o);return ue.asn1.x509.OID.oid2atype(a)+"="+Ee(r(e,i[1]))},ot.getPublicKeyFromCertHex=function(e){var t=new ot;return t.readCertHex(e),t.getPublicKey()},ot.getPublicKeyFromCertPEM=function(e){var t=new ot;return t.readCertPEM(e),t.getPublicKey()},ot.getPublicKeyInfoPropOfCertPEM=function(e){var t,n,r=pe.getVbyList,i={};return i.algparam=null,(t=new ot).readCertPEM(e),n=t.getPublicKeyHex(),i.keyhex=r(n,0,[1],"03").substr(2),i.algoid=r(n,0,[0,0],"06"),"2a8648ce3d0201"===i.algoid&&(i.algparam=r(n,0,[0,1],"06")),i},ot.KEYUSAGE_NAME=["digitalSignature","nonRepudiation","keyEncipherment","dataEncipherment","keyAgreement","keyCertSign","cRLSign","encipherOnly","decipherOnly"];void 0!==ue&&ue||(ue={}),void 0!==ue.jws&&ue.jws||(ue.jws={}),ue.jws.JWS=function(){var e=ue.jws.JWS.isSafeJSONString;this.parseJWS=function(t,n){if(void 0===this.parsedJWS||!n&&void 0===this.parsedJWS.sigvalH){var r=t.match(/^([^.]+)\.([^.]+)\.([^.]+)$/);if(null==r)throw"JWS signature is not a form of 'Head.Payload.SigValue'.";var i=r[1],o=r[2],a=r[3],s=i+"."+o;if(this.parsedJWS={},this.parsedJWS.headB64U=i,this.parsedJWS.payloadB64U=o,this.parsedJWS.sigvalB64U=a,this.parsedJWS.si=s,!n){var u=be(a),l=ee(u,16);this.parsedJWS.sigvalH=u,this.parsedJWS.sigvalBI=l}var c=ce(i),p=ce(o);if(this.parsedJWS.headS=c,this.parsedJWS.payloadS=p,!e(c,this.parsedJWS,"headP"))throw"malformed JSON string for JWS Head: "+c}}},ue.jws.JWS.sign=function(e,t,n,r,i){var o,a,s,u=ue,l=u.jws.JWS,c=l.readSafeJSONString,p=l.isSafeJSONString,h=u.crypto,d=(h.ECDSA,h.Mac),f=h.Signature,g=JSON;if("string"!=typeof t&&"object"!=typeof t)throw"spHeader must be JSON string or object: "+t;if("object"==typeof t&&(a=t,o=g.stringify(a)),"string"==typeof t){if(!p(o=t))throw"JWS Head is not safe JSON string: "+o;a=c(o)}if(s=n,"object"==typeof n&&(s=g.stringify(n)),""!=e&&null!=e||void 0===a.alg||(e=a.alg),""!=e&&null!=e&&void 0===a.alg&&(a.alg=e,o=g.stringify(a)),e!==a.alg)throw"alg and sHeader.alg doesn't match: "+e+"!="+a.alg;var m=null;if(void 0===l.jwsalg2sigalg[e])throw"unsupported alg name: "+e;m=l.jwsalg2sigalg[e];var v=le(o)+"."+le(s),y="";if("Hmac"==m.substr(0,4)){if(void 0===r)throw"mac key shall be specified for HS* alg";var b=new d({alg:m,prov:"cryptojs",pass:r});b.updateString(v),y=b.doFinal()}else if(-1!=m.indexOf("withECDSA")){(x=new f({alg:m})).init(r,i),x.updateString(v);var w=x.sign();y=ue.crypto.ECDSA.asn1SigToConcatSig(w)}else{var x;if("none"!=m)(x=new f({alg:m})).init(r,i),x.updateString(v),y=x.sign()}return v+"."+ye(y)},ue.jws.JWS.verify=function(e,t,n){var r,i=ue,o=i.jws.JWS,a=o.readSafeJSONString,s=i.crypto,u=s.ECDSA,l=s.Mac,c=s.Signature;if(r=ne,!qe(e))return!1;var p=e.split(".");if(3!==p.length)return!1;var h=p[0]+"."+p[1],d=be(p[2]),f=a(ce(p[0])),g=null,m=null;if(void 0===f.alg)throw"algorithm not specified in header";if((m=(g=f.alg).substr(0,2),null!=n&&"[object Array]"===Object.prototype.toString.call(n)&&n.length>0)&&-1==(":"+n.join(":")+":").indexOf(":"+g+":"))throw"algorithm '"+g+"' not accepted in the list";if("none"!=g&&null===t)throw"key shall be specified to verify.";if("string"==typeof t&&-1!=t.indexOf("-----BEGIN ")&&(t=tt.getKey(t)),!("RS"!=m&&"PS"!=m||t instanceof r))throw"key shall be a RSAKey obj for RS* and PS* algs";if("ES"==m&&!(t instanceof u))throw"key shall be a ECDSA obj for ES* algs";var v=null;if(void 0===o.jwsalg2sigalg[f.alg])throw"unsupported alg name: "+g;if("none"==(v=o.jwsalg2sigalg[g]))throw"not supported";if("Hmac"==v.substr(0,4)){if(void 0===t)throw"hexadecimal key shall be specified for HMAC";var y=new l({alg:v,pass:t});return y.updateString(h),d==y.doFinal()}if(-1!=v.indexOf("withECDSA")){var b,w=null;try{w=u.concatSigToASN1Sig(d)}catch(e){return!1}return(b=new c({alg:v})).init(t),b.updateString(h),b.verify(w)}return(b=new c({alg:v})).init(t),b.updateString(h),b.verify(d)},ue.jws.JWS.parse=function(e){var t,n,r,i=e.split("."),o={};if(2!=i.length&&3!=i.length)throw"malformed sJWS: wrong number of '.' splitted elements";return t=i[0],n=i[1],3==i.length&&(r=i[2]),o.headerObj=ue.jws.JWS.readSafeJSONString(ce(t)),o.payloadObj=ue.jws.JWS.readSafeJSONString(ce(n)),o.headerPP=JSON.stringify(o.headerObj,null," "),null==o.payloadObj?o.payloadPP=ce(n):o.payloadPP=JSON.stringify(o.payloadObj,null," "),void 0!==r&&(o.sigHex=be(r)),o},ue.jws.JWS.verifyJWT=function(e,t,n){var r=ue.jws,i=r.JWS,o=i.readSafeJSONString,a=i.inArray,s=i.includedArray;if(!qe(e))return!1;var u=e.split(".");if(3!=u.length)return!1;var l=u[0],c=u[1],p=(be(u[2]),o(ce(l))),h=o(ce(c));if(void 0===p.alg)return!1;if(void 0===n.alg)throw"acceptField.alg shall be specified";if(!a(p.alg,n.alg))return!1;if(void 0!==h.iss&&"object"==typeof n.iss&&!a(h.iss,n.iss))return!1;if(void 0!==h.sub&&"object"==typeof n.sub&&!a(h.sub,n.sub))return!1;if(void 0!==h.aud&&"object"==typeof n.aud)if("string"==typeof h.aud){if(!a(h.aud,n.aud))return!1}else if("object"==typeof h.aud&&!s(h.aud,n.aud))return!1;var d=r.IntDate.getNow();return void 0!==n.verifyAt&&"number"==typeof n.verifyAt&&(d=n.verifyAt),void 0!==n.gracePeriod&&"number"==typeof n.gracePeriod||(n.gracePeriod=0),!(void 0!==h.exp&&"number"==typeof h.exp&&h.exp+n.gracePeriod<d)&&(!(void 0!==h.nbf&&"number"==typeof h.nbf&&d<h.nbf-n.gracePeriod)&&(!(void 0!==h.iat&&"number"==typeof h.iat&&d<h.iat-n.gracePeriod)&&((void 0===h.jti||void 0===n.jti||h.jti===n.jti)&&!!i.verify(e,t,n.alg))))},ue.jws.JWS.includedArray=function(e,t){var n=ue.jws.JWS.inArray;if(null===e)return!1;if("object"!=typeof e)return!1;if("number"!=typeof e.length)return!1;for(var r=0;r<e.length;r++)if(!n(e[r],t))return!1;return!0},ue.jws.JWS.inArray=function(e,t){if(null===t)return!1;if("object"!=typeof t)return!1;if("number"!=typeof t.length)return!1;for(var n=0;n<t.length;n++)if(t[n]==e)return!0;return!1},ue.jws.JWS.jwsalg2sigalg={HS256:"HmacSHA256",HS384:"HmacSHA384",HS512:"HmacSHA512",RS256:"SHA256withRSA",RS384:"SHA384withRSA",RS512:"SHA512withRSA",ES256:"SHA256withECDSA",ES384:"SHA384withECDSA",ES512:"SHA512withECDSA",PS256:"SHA256withRSAandMGF1",PS384:"SHA384withRSAandMGF1",PS512:"SHA512withRSAandMGF1",none:"none"},ue.jws.JWS.isSafeJSONString=function(e,t,n){var r=null;try{return"object"!=typeof(r=se(e))||r.constructor===Array?0:(t&&(t[n]=r),1)}catch(e){return 0}},ue.jws.JWS.readSafeJSONString=function(e){var t=null;try{return"object"!=typeof(t=se(e))||t.constructor===Array?null:t}catch(e){return null}},ue.jws.JWS.getEncodedSignatureValueFromJWS=function(e){var t=e.match(/^[^.]+\.[^.]+\.([^.]+)$/);if(null==t)throw"JWS signature is not a form of 'Head.Payload.SigValue'.";return t[1]},ue.jws.JWS.getJWKthumbprint=function(e){if("RSA"!==e.kty&&"EC"!==e.kty&&"oct"!==e.kty)throw"unsupported algorithm for JWK Thumprint";var t="{";if("RSA"===e.kty){if("string"!=typeof e.n||"string"!=typeof e.e)throw"wrong n and e value for RSA key";t+='"e":"'+e.e+'",',t+='"kty":"'+e.kty+'",',t+='"n":"'+e.n+'"}'}else if("EC"===e.kty){if("string"!=typeof e.crv||"string"!=typeof e.x||"string"!=typeof e.y)throw"wrong crv, x and y value for EC key";t+='"crv":"'+e.crv+'",',t+='"kty":"'+e.kty+'",',t+='"x":"'+e.x+'",',t+='"y":"'+e.y+'"}'}else if("oct"===e.kty){if("string"!=typeof e.k)throw"wrong k value for oct(symmetric) key";t+='"kty":"'+e.kty+'",',t+='"k":"'+e.k+'"}'}var n=Ae(t);return ye(ue.crypto.Util.hashHex(n,"sha256"))},ue.jws.IntDate={},ue.jws.IntDate.get=function(e){var t=ue.jws.IntDate,n=t.getNow,r=t.getZulu;if("now"==e)return n();if("now + 1hour"==e)return n()+3600;if("now + 1day"==e)return n()+86400;if("now + 1month"==e)return n()+2592e3;if("now + 1year"==e)return n()+31536e3;if(e.match(/Z$/))return r(e);if(e.match(/^[0-9]+$/))return parseInt(e);throw"unsupported format: "+e},ue.jws.IntDate.getZulu=function(e){return Re(e)},ue.jws.IntDate.getNow=function(){return~~(new Date/1e3)},ue.jws.IntDate.intDate2UTCString=function(e){return new Date(1e3*e).toUTCString()},ue.jws.IntDate.intDate2Zulu=function(e){var t=new Date(1e3*e);return("0000"+t.getUTCFullYear()).slice(-4)+("00"+(t.getUTCMonth()+1)).slice(-2)+("00"+t.getUTCDate()).slice(-2)+("00"+t.getUTCHours()).slice(-2)+("00"+t.getUTCMinutes()).slice(-2)+("00"+t.getUTCSeconds()).slice(-2)+"Z"},void 0!==ue&&ue||(ue={}),void 0!==ue.jws&&ue.jws||(ue.jws={}),ue.jws.JWSJS=function(){var e=ue.jws.JWS,t=e.readSafeJSONString;this.aHeader=[],this.sPayload="",this.aSignature=[],this.init=function(){this.aHeader=[],this.sPayload=void 0,this.aSignature=[]},this.initWithJWS=function(e){this.init();var t=e.split(".");if(3!=t.length)throw"malformed input JWS";this.aHeader.push(t[0]),this.sPayload=t[1],this.aSignature.push(t[2])},this.addSignature=function(e,t,n,r){if(void 0===this.sPayload||null===this.sPayload)throw"there's no JSON-JS signature to add.";var i=this.aHeader.length;if(this.aHeader.length!=this.aSignature.length)throw"aHeader.length != aSignature.length";try{var o=ue.jws.JWS.sign(e,t,this.sPayload,n,r).split(".");o[0],o[2];this.aHeader.push(o[0]),this.aSignature.push(o[2])}catch(e){throw this.aHeader.length>i&&this.aHeader.pop(),this.aSignature.length>i&&this.aSignature.pop(),"addSignature failed: "+e}},this.verifyAll=function(e){if(this.aHeader.length!==e.length||this.aSignature.length!==e.length)return!1;for(var t=0;t<e.length;t++){var n=e[t];if(2!==n.length)return!1;if(!1===this.verifyNth(t,n[0],n[1]))return!1}return!0},this.verifyNth=function(t,n,r){if(this.aHeader.length<=t||this.aSignature.length<=t)return!1;var i=this.aHeader[t],o=this.aSignature[t],a=i+"."+this.sPayload+"."+o,s=!1;try{s=e.verify(a,n,r)}catch(e){return!1}return s},this.readJWSJS=function(e){if("string"==typeof e){var n=t(e);if(null==n)throw"argument is not safe JSON object string";this.aHeader=n.headers,this.sPayload=n.payload,this.aSignature=n.signatures}else try{if(!(e.headers.length>0))throw"malformed header";if(this.aHeader=e.headers,"string"!=typeof e.payload)throw"malformed signatures";if(this.sPayload=e.payload,!(e.signatures.length>0))throw"malformed signatures";this.aSignature=e.signatures}catch(e){throw"malformed JWS-JS JSON object: "+e}},this.getJSON=function(){return{headers:this.aHeader,payload:this.sPayload,signatures:this.aSignature}},this.isEmpty=function(){return 0==this.aHeader.length?1:0}},t.SecureRandom=Q,t.rng_seed_time=G,t.BigInteger=x,t.RSAKey=ne,t.ECDSA=ue.crypto.ECDSA,t.DSA=ue.crypto.DSA,t.Signature=ue.crypto.Signature,t.MessageDigest=ue.crypto.MessageDigest,t.Mac=ue.crypto.Mac,t.Cipher=ue.crypto.Cipher,t.KEYUTIL=tt,t.ASN1HEX=pe,t.X509=ot,t.X509CRL=function(e){var t=ue.lang.String.isHex,n=pe,r=n.getV,i=n.getTLV,o=n.getVbyList,a=n.getTLVbyList,s=n.getTLVbyListEx,u=n.getIdxbyList,l=n.getIdxbyListEx,c=n.getChildIdx,p=new ot;this.hex=null,this.posSigAlg=null,this.posRevCert=null,this.parsed=null,this._setPos=function(){var e=u(this.hex,0,[0,0]),t=this.hex.substr(e,2);if("02"==t)this.posSigAlg=1;else{if("30"!=t)throw new Error("malformed 1st item of TBSCertList: "+t);this.posSigAlg=0}var n,r=u(this.hex,0,[0,this.posSigAlg+3]),i=this.hex.substr(r,2);if("17"==i||"18"==i)n=u(this.hex,0,[0,this.posSigAlg+4]),this.posRevCert=null,-1!=n&&"30"==this.hex.substr(n,2)&&(this.posRevCert=this.posSigAlg+4);else if("30"==i)this.posRevCert=this.posSigAlg+3;else{if("a0"!=i)throw new Error("malformed nextUpdate or revCert tag: "+i);this.posRevCert=null}},this.getVersion=function(){return 0==this.posSigAlg?null:parseInt(o(this.hex,0,[0,0],"02"),16)+1},this.getSignatureAlgorithmField=function(){var e=a(this.hex,0,[0,this.posSigAlg],"30");return p.getAlgorithmIdentifierName(e)},this.getIssuer=function(){return p.getX500Name(this.getIssuerHex())},this.getIssuerHex=function(){return a(this.hex,0,[0,this.posSigAlg+1],"30")},this.getThisUpdate=function(){var e=o(this.hex,0,[0,this.posSigAlg+2]);return result=Ee(e)},this.getNextUpdate=function(){var e=u(this.hex,0,[0,this.posSigAlg+3]),t=this.hex.substr(e,2);return"17"!=t&&"18"!=t?null:Ee(r(this.hex,e))},this.getRevCertArray=function(){if(null==this.posRevCert)return null;for(var e=[],t=u(this.hex,0,[0,this.posRevCert]),n=c(this.hex,t),r=0;r<n.length;r++){var o=i(this.hex,n[r]);e.push(this.getRevCert(o))}return e},this.getRevCert=function(e){var t={},n=c(e,0);return t.sn={hex:o(e,0,[0],"02")},t.date=Ee(o(e,0,[1])),3==n.length&&(t.ext=p.getExtParamArray(a(e,0,[2]))),t},this.findRevCert=function(e){var t=new ot(e).getSerialNumberHex();return this.findRevCertBySN(t)},this.findRevCertBySN=function(e){if(null==this.parsed&&this.getParam(),null==this.parsed.revcert)return null;for(var t=this.parsed.revcert,n=0;n<t.length;n++)if(e==t[n].sn.hex)return t[n];return null},this.getSignatureValueHex=function(){return o(this.hex,0,[2],"03",!0)},this.verifySignature=function(e){var t=this.getSignatureAlgorithmField(),n=this.getSignatureValueHex(),r=a(this.hex,0,[0],"30"),i=new ue.crypto.Signature({alg:t});return i.init(e),i.updateHex(r),i.verify(n)},this.getParam=function(e){var t={},n=this.getVersion();null!=n&&(t.version=n),t.sigalg=this.getSignatureAlgorithmField(),t.issuer=this.getIssuer(),t.thisupdate=this.getThisUpdate();var r=this.getNextUpdate();null!=r&&(t.nextupdate=r);var i=this.getRevCertArray();if(null!=i&&(t.revcert=i),-1!=l(this.hex,0,[0,"[0]"])){var o=s(this.hex,0,[0,"[0]",0]);t.ext=p.getExtParamArray(o)}return t.sighex=this.getSignatureValueHex(),this.parsed=t,"object"==typeof e&&(1==e.tbshex&&(t.tbshex=a(this.hex,0,[0])),1==e.nodnarray&&delete t.issuer.array),t},"string"==typeof e&&(t(e)?this.hex=e:e.match(/-----BEGIN X509 CRL/)&&(this.hex=Te(e)),this._setPos())},t.CryptoJS=g,t.b64tohex=b,t.b64toBA=w,t.ECFieldElementFp=ie,t.ECPointFp=oe,t.ECCurveFp=ae,t.stoBA=he,t.BAtos=de,t.BAtohex=fe,t.stohex=ge,t.stob64=function(e){return y(ge(e))},t.stob64u=function(e){return me(y(ge(e)))},t.b64utos=function(e){return de(w(ve(e)))},t.b64tob64u=me,t.b64utob64=ve,t.hex2b64=y,t.hextob64u=ye,t.b64utohex=be,t.utf8tob64u=le,t.b64utoutf8=ce,t.utf8tob64=function(e){return y(Oe(He(e)))},t.b64toutf8=function(e){return decodeURIComponent(ke(b(e)))},t.utf8tohex=we,t.hextoutf8=xe,t.hextorstr=Ee,t.rstrtohex=Ae,t.hextob64=Fe,t.hextob64nl=function(e){return Ce(Fe(e),64)},t.b64nltohex=$e,t.hextopem=De,t.pemtohex=Te,t.hextoArrayBuffer=function(e){if(e.length%2!=0)throw"input is not even length";if(null==e.match(/^[0-9A-Fa-f]+$/))throw"input is not hexadecimal";for(var t=new ArrayBuffer(e.length/2),n=new DataView(t),r=0;r<e.length/2;r++)n.setUint8(r,parseInt(e.substr(2*r,2),16));return t},t.ArrayBuffertohex=function(e){for(var t="",n=new DataView(e),r=0;r<e.byteLength;r++)t+=("00"+n.getUint8(r).toString(16)).slice(-2);return t},t.zulutomsec=Ie,t.msectozulu=function(e){var t=new Date(e),n=("0000"+t.getUTCFullYear()).slice(-4),r=("00"+(t.getUTCMonth()+1)).slice(-2),i=("00"+t.getUTCDate()).slice(-2),o=("00"+t.getUTCHours()).slice(-2),a=("00"+t.getUTCMinutes()).slice(-2),s=("00"+t.getUTCSeconds()).slice(-2),u=("000"+t.getUTCMilliseconds()).slice(-3);return n+r+i+o+a+s+(u=""!=(u=u.replace(/0+$/,""))?"."+u:u)+"Z"},t.zulutosec=Re,t.zulutodate=function(e){return new Date(Ie(e))},t.datetozulu=function(e,t,n){var r,i=e.getUTCFullYear();if(t){if(i<1950||2049<i)throw"not proper year for UTCTime: "+i;r=(""+i).slice(-2)}else r=("000"+i).slice(-4);if(r+=("0"+(e.getUTCMonth()+1)).slice(-2),r+=("0"+e.getUTCDate()).slice(-2),r+=("0"+e.getUTCHours()).slice(-2),r+=("0"+e.getUTCMinutes()).slice(-2),r+=("0"+e.getUTCSeconds()).slice(-2),n){var o=e.getUTCMilliseconds();0!==o&&(r+="."+(o=(o=("00"+o).slice(-3)).replace(/0+$/g,"")))}return r+="Z"},t.uricmptohex=Oe,t.hextouricmp=ke,t.ipv6tohex=_e,t.hextoipv6=je,t.hextoip=Ne,t.iptohex=Be,t.ucs2hextoutf8=Me,t.encodeURIComponentAll=He,t.newline_toUnix=function(e){return e=e.replace(/\r\n/gm,"\n")},t.newline_toDos=function(e){return e=(e=e.replace(/\r\n/gm,"\n")).replace(/\n/gm,"\r\n")},t.hextoposhex=Ke,t.intarystrtohex=function(e){e=(e=(e=e.replace(/^\s*\[\s*/,"")).replace(/\s*\]\s*$/,"")).replace(/\s*/g,"");try{return e.split(/,/).map((function(e,t,n){var r=parseInt(e);if(r<0||255<r)throw"integer not in range 0-255";return("00"+r.toString(16)).slice(-2)})).join("")}catch(e){throw"malformed integer array string: "+e}},t.strdiffidx=function(e,t){var n=e.length;e.length>t.length&&(n=t.length);for(var r=0;r<n;r++)if(e.charCodeAt(r)!=t.charCodeAt(r))return r;return e.length!=t.length?n:-1},t.oidtohex=ze,t.hextooid=Ge,t.strpad=We,t.bitstrtoint=Ye,t.inttobitstr=Xe,t.bitstrtobinstr=Je,t.binstrtobitstr=function(e){if("string"!=typeof e)return null;if(null==e.match(/^[01]+$/))return null;try{return Xe(parseInt(e,2))}catch(e){return null}},t.isBase64URLDot=qe,t.namearraytobinstr=Ze,t.extendClass=et,t.foldnl=Ce,t.b64topem=function(e,t){return"-----BEGIN "+t+"-----\r\n"+Ce(e,64)+"\r\n-----END "+t+"-----\r\n"},t.pemtob64=function(e){return-1==e.indexOf("-----BEGIN ")||-1==e.indexOf("-----END ")?null:(e=(e=(e=e.replace(/^[\s\S]*?-----BEGIN [^-]+-----/m,"")).replace(/-----END [\s\S]+$/m,"")).replace(/\s+/g,"")).match(/^[0-9a-zA-Z+/=]+$/)?e:null},t.timeogen=Pe,t.aryval=Qe,t.KJUR=ue,t.crypto=ue.crypto,t.asn1=ue.asn1,t.jws=ue.jws,t.lang=ue.lang,t.VERSION="10.8.6",t.VERSION_FULL="jsrsasign(all) 10.8.6 (2023-04-26) (c) 2010-2023 Kenji Urushima | kjur.github.io/jsrsasign/license"}).call(this,n(145).Buffer)},function(e,t,n){"use strict";n.r(t);n(235),n(236),n(237),n(238),n(239),n(240),n(74),n(243),n(244),n(39),n(245),n(23),n(29),n(55);function r(e,t,n){return{openSimpleModal:r,openCopyToClipboardModal:function(t){return e.open({templateUrl:"js/angular/core/templates/modal/copy-to-clipboard-modal.html",controller:"CopyToClipboardModalCtrl",resolve:{uri:function(){return t}}})},openConfirmation:function(e,t,n,i){r({title:e,message:t,warning:!0}).result.then((function(){angular.isFunction(n)&&n()}),(function(){angular.isFunction(i)&&i()}))}};function r(t){return e.open({templateUrl:t.warning?"js/angular/core/templates/modal/modal-warning.html":"js/angular/core/templates/modal/modal-simple.html",controller:"SimpleModalCtrl",size:t.size,resolve:{title:function(){return t.title},message:function(){return n.trustAsHtml(t.message)}}})}}function i(e){return{getDetails:function(t){return e.get("rest/explore/details",{params:{uri:t},headers:{Accept:"application/json"}})},getGraph:function(t){const n=encodeURIComponent(t);return e.get("rest/explore/graph?uri="+n+"&role=subject",{headers:{Accept:"application/rdf+json"}})},getNamespaceUriForPrefix:function(e,t){let n="";for(let r=0;r<e.length;r++)if(e[r].prefix===t){n=e[r].uri;break}return n},getNamespacePrefixForUri:function(e,t){let n="";for(let r=0;r<e.length;r++)if(e[r].uri===t){n=e[r].prefix;break}return n},getLocalName:function(e){if(angular.isUndefined(e))return e;{let t;const n=e.length-1;let r=e.toString().lastIndexOf("/");r===n&&(t=e.substr(0,n),r=t.lastIndexOf("/"));let i=e.toString().lastIndexOf("#");return i===n&&(t=e.substr(0,n),i=t.lastIndexOf("/")),e.toString().substring(Math.max(i,r)+1)}}}}angular.module("graphdb.framework.core",["ui.bootstrap","jlareau.bowser","LocalStorageModule","graphdb.framework.core.controllers","pascalprecht.translate"]).provider("$menuItems",(function(){const e=function(t,n){for(let r=0;r<t.length;r++){const i=t[r];if(i.label===n)return i;const o=e(i.children,n);if(!angular.isUndefined(o))return o}},t=function(e,t){for(let n=0;n<e.length;n++){if(e[n].label===t)return!0}return!1},n=function(e,t){return e.order<t.order?-1:e.order>t.order?1:0},r=function(e,t){return{label:e.label,labelKey:e.labelKey,href:e.href,hrefFun:e.hrefFun,order:e.order,role:e.role,editions:e.editions,icon:e.icon,guideSelector:e.guideSelector,children:t}};let i;const o=[];let a=[];this.addItem=function(e){angular.isUndefined(e.parent)?t(o,e.label)||(o.push(r(e,[])),this.updateItemsWithMissedParent()):this.addItemToParent(e)||a.push(e)},this.addItemToParent=function(n){const i=e(o,n.parent);return!angular.isUndefined(i)&&!t(i.children,n.label)&&(i.children.push(r(n,n.children?n.children:[])),!0)},this.updateItemsWithMissedParent=function(){if(a.length>0){const e=[];let t=this;a.forEach((function(n){t.addItemToParent(n)||e.push(n)})),a=e}},this.$get=function(){o.sort(n);for(let e=0;e<o.length;e++){o[e].children.sort(n)}return o},this.setProductInfo=function(e){i=e},this.getProductInfo=function(){return i}})).factory("ModalService",r).factory("ClassInstanceDetailsService",i).factory("AuthTokenService",(function(){const e="com.ontotext.graphdb.auth";return{AUTH_STORAGE_NAME:e,getAuthToken:function(){return localStorage.getItem(e)},setAuthToken:function(t){localStorage.setItem(e,t)},clearAuthToken:function(){localStorage.removeItem(e)},OPENID_CONFIG:{}}})),r.$inject=["$uibModal","$timeout","$sce"],i.$inject=["$http"]},function(e,t,n){"use strict";n.r(t),n.d(t,"ActiveOperationModel",(function(){return i}));var r=n(4);class i{constructor(){this.operationGroup=void 0,this.runningOperationCount=0,this.status=r.OPERATION_STATUS.INFORMATION,this.type=void 0,this.titleLabelKey="",this.monitoringViewUrl=""}}},function(e,t,n){"use strict";n.r(t),n.d(t,"OPERATION_MONITORING_CONSTANTS",(function(){return r}));const r={IMPORT_MONITORING_URL:"import",QUERIES_MONITORING_URL:"monitor/queries",BACKUP_AND_RESTORE_MONITORING_URL:"monitor/backup-and-restore",CLUSTER_MONITORING_URL:"cluster"}},function(e,t){function n(e,t){return{get:function(t){return e.get(t)},set:function(t,n){e.set(t,n)},keys:n,remove:r,clearAll:function(){e.clearAll()},clearClassHieararchyState:function(){n().forEach((function(e){0!==e.indexOf("classHierarchy-")||e===t.CLASS_HIERARCHY_HIDE_PREFIXES||e.startsWith("classHierarchy-selectedGraph-")||r(e)}))}};function n(){return e.keys()}function r(t){e.remove(t)}}angular.module("graphdb.framework.utils.localstorageadapter",[]).factory("LocalStorageAdapter",n).value("LSKeys",{TABS_STATE:"tabs-state",TABS_STATE_CURRENT_ID:"tabs-state-currentid",TABS_STATE_MAXID:"tabs-state-maxid",VIEW_MODE:"viewMode",CLASS_HIERARCHY_HIDE_PREFIXES:"classHierarchy-hidePrefixes",CLASS_HIERARCHY_CURRENT_SLIDER_VALUE:"classHierarchy-currentSliderValue",CLASS_HIERARCHY_SWITCH_PREFIXES:"classHierarchy-switchPrefixes",CLASS_HIERARCHY_LAST_SELECTED_CLASS:"classHierarchy-lastSelectedClass",DOMAIN_RANGE_WENT_BACK:"domainRange-wentBack",DOMAIN_RANGE_COLLAPSE_EDGES:"domainRange-collapseEdges",HIDE_SIMILARITY_HELP:"hide-similarity-help",TUTORIAL_STATE:"tutorial-state",MENU_STATE:"menu-state",HIDE_GRAPH_CONFIG_HELP:"hide-graph-config-help",GRAPHS_VIZ:"graphs-viz",AUTOCOMPLETE_ENABLED:"autocomplete.enabled",RDF_SEARCH_TYPE:"rdf-search.search-type",RDF_SEARCH_INPUT:"rdf-search.search-input",RDF_SEARCH_EXPANDED_URI:"rdf-search.search-expanded-uri",RDF_RESOURCE_DESCRIPTION:"rdf-search.resource-description",PREFERRED_LANG:"preferred-language",WORKBENCH_SETTINGS:"workbench-settings",REPOSITORY_ID:"repository-id",REPOSITORY_LOCATION:"repository-location"}),n.$inject=["localStorageService","LSKeys"]},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";n.r(t),n.d(t,"GUIDE_ID",(function(){return ln})),n.d(t,"GUIDE_CURRENT_STEP_ID",(function(){return cn})),n.d(t,"GUIDE_STEP_HISTORY",(function(){return pn})),n.d(t,"GUIDE_PAUSE",(function(){return hn}));var r=n(2),i=function(e){return function(e){return!!e&&"object"==typeof e}(e)&&!function(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||function(e){return e.$$typeof===o}(e)}(e)};
28
+ /*! shepherd.js 10.0.1 */var o="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function a(e,t){return!1!==t.clone&&t.isMergeableObject(e)?p((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function s(e,t,n){return e.concat(t).map((function(e){return a(e,n)}))}function u(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return e.propertyIsEnumerable(t)})):[]}(e))}function l(e,t){try{return t in e}catch(e){return!1}}function c(e,t,n){var r={};return n.isMergeableObject(e)&&u(e).forEach((function(t){r[t]=a(e[t],n)})),u(t).forEach((function(i){(function(e,t){return l(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,i)||(l(e,i)&&n.isMergeableObject(t[i])?r[i]=function(e,t){if(!t.customMerge)return p;var n=t.customMerge(e);return"function"==typeof n?n:p}(i,n)(e[i],t[i],n):r[i]=a(t[i],n))})),r}function p(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||s,n.isMergeableObject=n.isMergeableObject||i,n.cloneUnlessOtherwiseSpecified=a;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):c(e,t,n):a(t,n)}p.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return p(e,n,t)}),{})};var h=p;function d(e){return e instanceof HTMLElement}function f(e){return"function"==typeof e}function g(e){return"string"==typeof e}function m(e){return void 0===e}class v{on(e,t,n,r){return void 0===r&&(r=!1),m(this.bindings)&&(this.bindings={}),m(this.bindings[e])&&(this.bindings[e]=[]),this.bindings[e].push({handler:t,ctx:n,once:r}),this}once(e,t,n){return this.on(e,t,n,!0)}off(e,t){return m(this.bindings)||m(this.bindings[e])||(m(t)?delete this.bindings[e]:this.bindings[e].forEach((n,r)=>{n.handler===t&&this.bindings[e].splice(r,1)})),this}trigger(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return!m(this.bindings)&&this.bindings[e]&&this.bindings[e].forEach((t,r)=>{const{ctx:i,handler:o,once:a}=t,s=i||this;o.apply(s,n),a&&this.bindings[e].splice(r,1)}),this}}function y(e){const t=Object.getOwnPropertyNames(e.constructor.prototype);for(let n=0;n<t.length;n++){const r=t[n],i=e[r];"constructor"!==r&&"function"==typeof i&&(e[r]=i.bind(e))}return e}function b(e){const{event:t,selector:n}=e.options.advanceOn||{};if(!t)return console.error("advanceOn was defined, but no event name was passed.");{const r=function(e,t){return n=>{if(t.isOpen()){const r=t.el&&n.currentTarget===t.el;(!m(e)&&n.currentTarget.matches(e)||r)&&t.tour.next()}}}(n,e);let i;try{i=document.querySelector(n)}catch(e){}if(!m(n)&&!i)return console.error("No element was found for the selector supplied to advanceOn: "+n);i?(i.addEventListener(t,r),e.on("destroy",()=>i.removeEventListener(t,r))):(document.body.addEventListener(t,r,!0),e.on("destroy",()=>document.body.removeEventListener(t,r,!0)))}}var w="top",x="bottom",S="right",E="left",A=[w,x,S,E],F=A.reduce((function(e,t){return e.concat([t+"-start",t+"-end"])}),[]),C=[].concat(A,["auto"]).reduce((function(e,t){return e.concat([t,t+"-start",t+"-end"])}),[]),$=["beforeRead","read","afterRead","beforeMain","main","afterMain","beforeWrite","write","afterWrite"];function D(e){return e?(e.nodeName||"").toLowerCase():null}function T(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function I(e){return e instanceof T(e).Element||e instanceof Element}function R(e){return e instanceof T(e).HTMLElement||e instanceof HTMLElement}function P(e){return"undefined"!=typeof ShadowRoot&&(e instanceof T(e).ShadowRoot||e instanceof ShadowRoot)}var O={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},r=t.attributes[e]||{},i=t.elements[e];R(i)&&D(i)&&(Object.assign(i.style,n),Object.keys(r).forEach((function(e){var t=r[e];!1===t?i.removeAttribute(e):i.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var r=t.elements[e],i=t.attributes[e]||{},o=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});R(r)&&D(r)&&(Object.assign(r.style,o),Object.keys(i).forEach((function(e){r.removeAttribute(e)})))}))}},requires:["computeStyles"]};function k(e){return e.split("-")[0]}var _=Math.max,j=Math.min,N=Math.round;function L(e,t){void 0===t&&(t=!1);var n=e.getBoundingClientRect(),r=1,i=1;if(R(e)&&t){var o=e.offsetHeight,a=e.offsetWidth;a>0&&(r=N(n.width)/a||1),o>0&&(i=N(n.height)/o||1)}return{width:n.width/r,height:n.height/i,top:n.top/i,right:n.right/r,bottom:n.bottom/i,left:n.left/r,x:n.left/r,y:n.top/i}}function B(e){var t=L(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function U(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&P(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function M(e){return T(e).getComputedStyle(e)}function H(e){return["table","td","th"].indexOf(D(e))>=0}function V(e){return((I(e)?e.ownerDocument:e.document)||window.document).documentElement}function q(e){return"html"===D(e)?e:e.assignedSlot||e.parentNode||(P(e)?e.host:null)||V(e)}function K(e){return R(e)&&"fixed"!==M(e).position?e.offsetParent:null}function z(e){for(var t=T(e),n=K(e);n&&H(n)&&"static"===M(n).position;)n=K(n);return n&&("html"===D(n)||"body"===D(n)&&"static"===M(n).position)?t:n||function(e){var t=-1!==navigator.userAgent.toLowerCase().indexOf("firefox");if(-1!==navigator.userAgent.indexOf("Trident")&&R(e)&&"fixed"===M(e).position)return null;var n=q(e);for(P(n)&&(n=n.host);R(n)&&["html","body"].indexOf(D(n))<0;){var r=M(n);if("none"!==r.transform||"none"!==r.perspective||"paint"===r.contain||-1!==["transform","perspective"].indexOf(r.willChange)||t&&"filter"===r.willChange||t&&r.filter&&"none"!==r.filter)return n;n=n.parentNode}return null}(e)||t}function G(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function W(e,t,n){return _(e,j(t,n))}function Y(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function X(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}function J(e){return e.split("-")[1]}var Z={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Q(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,a=e.offsets,s=e.position,u=e.gpuAcceleration,l=e.adaptive,c=e.roundOffsets,p=e.isFixed,h=a.x,d=void 0===h?0:h,f=a.y,g=void 0===f?0:f,m="function"==typeof c?c({x:d,y:g}):{x:d,y:g};d=m.x,g=m.y;var v=a.hasOwnProperty("x"),y=a.hasOwnProperty("y"),b=E,A=w,F=window;if(l){var C=z(n),$="clientHeight",D="clientWidth";if(C===T(n)&&"static"!==M(C=V(n)).position&&"absolute"===s&&($="scrollHeight",D="scrollWidth"),C=C,i===w||(i===E||i===S)&&"end"===o)A=x,g-=(p&&C===F&&F.visualViewport?F.visualViewport.height:C[$])-r.height,g*=u?1:-1;if(i===E||(i===w||i===x)&&"end"===o)b=S,d-=(p&&C===F&&F.visualViewport?F.visualViewport.width:C[D])-r.width,d*=u?1:-1}var I,R=Object.assign({position:s},l&&Z),P=!0===c?function(e){var t=e.x,n=e.y,r=window.devicePixelRatio||1;return{x:N(t*r)/r||0,y:N(n*r)/r||0}}({x:d,y:g}):{x:d,y:g};return d=P.x,g=P.y,u?Object.assign({},R,((I={})[A]=y?"0":"",I[b]=v?"0":"",I.transform=(F.devicePixelRatio||1)<=1?"translate("+d+"px, "+g+"px)":"translate3d("+d+"px, "+g+"px, 0)",I)):Object.assign({},R,((t={})[A]=y?g+"px":"",t[b]=v?d+"px":"",t.transform="",t))}var ee={passive:!0};var te={left:"right",right:"left",bottom:"top",top:"bottom"};function ne(e){return e.replace(/left|right|bottom|top/g,(function(e){return te[e]}))}var re={start:"end",end:"start"};function ie(e){return e.replace(/start|end/g,(function(e){return re[e]}))}function oe(e){var t=T(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function ae(e){return L(V(e)).left+oe(e).scrollLeft}function se(e){var t=M(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function ue(e,t){var n;void 0===t&&(t=[]);var r=function e(t){return["html","body","#document"].indexOf(D(t))>=0?t.ownerDocument.body:R(t)&&se(t)?t:e(q(t))}(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),o=T(r),a=i?[o].concat(o.visualViewport||[],se(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(ue(q(a)))}function le(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function ce(e,t){return"viewport"===t?le(function(e){var t=T(e),n=V(e),r=t.visualViewport,i=n.clientWidth,o=n.clientHeight,a=0,s=0;return r&&(i=r.width,o=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=r.offsetLeft,s=r.offsetTop)),{width:i,height:o,x:a+ae(e),y:s}}(e)):I(t)?function(e){var t=L(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}(t):le(function(e){var t,n=V(e),r=oe(e),i=null==(t=e.ownerDocument)?void 0:t.body,o=_(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=_(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+ae(e),u=-r.scrollTop;return"rtl"===M(i||n).direction&&(s+=_(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:u}}(V(e)))}function pe(e,t,n){var r="clippingParents"===t?function(e){var t=ue(q(e)),n=["absolute","fixed"].indexOf(M(e).position)>=0&&R(e)?z(e):e;return I(n)?t.filter((function(e){return I(e)&&U(e,n)&&"body"!==D(e)})):[]}(e):[].concat(t),i=[].concat(r,[n]),o=i[0],a=i.reduce((function(t,n){var r=ce(e,n);return t.top=_(r.top,t.top),t.right=j(r.right,t.right),t.bottom=j(r.bottom,t.bottom),t.left=_(r.left,t.left),t}),ce(e,o));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function he(e){var t,n=e.reference,r=e.element,i=e.placement,o=i?k(i):null,a=i?J(i):null,s=n.x+n.width/2-r.width/2,u=n.y+n.height/2-r.height/2;switch(o){case w:t={x:s,y:n.y-r.height};break;case x:t={x:s,y:n.y+n.height};break;case S:t={x:n.x+n.width,y:u};break;case E:t={x:n.x-r.width,y:u};break;default:t={x:n.x,y:n.y}}var l=o?G(o):null;if(null!=l){var c="y"===l?"height":"width";switch(a){case"start":t[l]=t[l]-(n[c]/2-r[c]/2);break;case"end":t[l]=t[l]+(n[c]/2-r[c]/2)}}return t}function de(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=void 0===r?e.placement:r,o=n.boundary,a=void 0===o?"clippingParents":o,s=n.rootBoundary,u=void 0===s?"viewport":s,l=n.elementContext,c=void 0===l?"popper":l,p=n.altBoundary,h=void 0!==p&&p,d=n.padding,f=void 0===d?0:d,g=Y("number"!=typeof f?f:X(f,A)),m="popper"===c?"reference":"popper",v=e.rects.popper,y=e.elements[h?m:c],b=pe(I(y)?y:y.contextElement||V(e.elements.popper),a,u),E=L(e.elements.reference),F=he({reference:E,element:v,strategy:"absolute",placement:i}),C=le(Object.assign({},v,F)),$="popper"===c?C:E,D={top:b.top-$.top+g.top,bottom:$.bottom-b.bottom+g.bottom,left:b.left-$.left+g.left,right:$.right-b.right+g.right},T=e.modifiersData.offset;if("popper"===c&&T){var R=T[i];Object.keys(D).forEach((function(e){var t=[S,x].indexOf(e)>=0?1:-1,n=[w,x].indexOf(e)>=0?"y":"x";D[e]+=R[n]*t}))}return D}function fe(e,t){void 0===t&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,u=n.allowedAutoPlacements,l=void 0===u?C:u,c=J(r),p=c?s?F:F.filter((function(e){return J(e)===c})):A,h=p.filter((function(e){return l.indexOf(e)>=0}));0===h.length&&(h=p);var d=h.reduce((function(t,n){return t[n]=de(e,{placement:n,boundary:i,rootBoundary:o,padding:a})[k(n)],t}),{});return Object.keys(d).sort((function(e,t){return d[e]-d[t]}))}function ge(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function me(e){return[w,S,x,E].some((function(t){return e[t]>=0}))}function ve(e,t,n){void 0===n&&(n=!1);var r,i,o=R(t),a=R(t)&&function(e){var t=e.getBoundingClientRect(),n=N(t.width)/e.offsetWidth||1,r=N(t.height)/e.offsetHeight||1;return 1!==n||1!==r}(t),s=V(t),u=L(e,a),l={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(o||!o&&!n)&&(("body"!==D(t)||se(s))&&(l=(r=t)!==T(r)&&R(r)?{scrollLeft:(i=r).scrollLeft,scrollTop:i.scrollTop}:oe(r)),R(t)?((c=L(t,!0)).x+=t.clientLeft,c.y+=t.clientTop):s&&(c.x=ae(s))),{x:u.left+l.scrollLeft-c.x,y:u.top+l.scrollTop-c.y,width:u.width,height:u.height}}function ye(e){var t=new Map,n=new Set,r=[];return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||function e(i){n.add(i.name),[].concat(i.requires||[],i.requiresIfExists||[]).forEach((function(r){if(!n.has(r)){var i=t.get(r);i&&e(i)}})),r.push(i)}(e)})),r}var be={placement:"bottom",modifiers:[],strategy:"absolute"};function we(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some((function(e){return!(e&&"function"==typeof e.getBoundingClientRect)}))}function xe(e){void 0===e&&(e={});var t=e,n=t.defaultModifiers,r=void 0===n?[]:n,i=t.defaultOptions,o=void 0===i?be:i;return function(e,t,n){void 0===n&&(n=o);var i,a,s={placement:"bottom",orderedModifiers:[],options:Object.assign({},be,o),modifiersData:{},elements:{reference:e,popper:t},attributes:{},styles:{}},u=[],l=!1,c={state:s,setOptions:function(n){var i="function"==typeof n?n(s.options):n;p(),s.options=Object.assign({},o,s.options,i),s.scrollParents={reference:I(e)?ue(e):e.contextElement?ue(e.contextElement):[],popper:ue(t)};var a,l,h=function(e){var t=ye(e);return $.reduce((function(e,n){return e.concat(t.filter((function(e){return e.phase===n})))}),[])}((a=[].concat(r,s.options.modifiers),l=a.reduce((function(e,t){var n=e[t.name];return e[t.name]=n?Object.assign({},n,t,{options:Object.assign({},n.options,t.options),data:Object.assign({},n.data,t.data)}):t,e}),{}),Object.keys(l).map((function(e){return l[e]}))));return s.orderedModifiers=h.filter((function(e){return e.enabled})),s.orderedModifiers.forEach((function(e){var t=e.name,n=e.options,r=void 0===n?{}:n,i=e.effect;if("function"==typeof i){var o=i({state:s,name:t,instance:c,options:r});u.push(o||function(){})}})),c.update()},forceUpdate:function(){if(!l){var e=s.elements,t=e.reference,n=e.popper;if(we(t,n)){s.rects={reference:ve(t,z(n),"fixed"===s.options.strategy),popper:B(n)},s.reset=!1,s.placement=s.options.placement,s.orderedModifiers.forEach((function(e){return s.modifiersData[e.name]=Object.assign({},e.data)}));for(var r=0;r<s.orderedModifiers.length;r++)if(!0!==s.reset){var i=s.orderedModifiers[r],o=i.fn,a=i.options,u=void 0===a?{}:a,p=i.name;"function"==typeof o&&(s=o({state:s,options:u,name:p,instance:c})||s)}else s.reset=!1,r=-1}}},update:(i=function(){return new Promise((function(e){c.forceUpdate(),e(s)}))},function(){return a||(a=new Promise((function(e){Promise.resolve().then((function(){a=void 0,e(i())}))}))),a}),destroy:function(){p(),l=!0}};if(!we(e,t))return c;function p(){u.forEach((function(e){return e()})),u=[]}return c.setOptions(n).then((function(e){!l&&n.onFirstUpdate&&n.onFirstUpdate(e)})),c}}var Se=xe({defaultModifiers:[{name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=void 0===i||i,a=r.resize,s=void 0===a||a,u=T(t.elements.popper),l=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&l.forEach((function(e){e.addEventListener("scroll",n.update,ee)})),s&&u.addEventListener("resize",n.update,ee),function(){o&&l.forEach((function(e){e.removeEventListener("scroll",n.update,ee)})),s&&u.removeEventListener("resize",n.update,ee)}},data:{}},{name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=he({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}},{name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=void 0===r||r,o=n.adaptive,a=void 0===o||o,s=n.roundOffsets,u=void 0===s||s,l={placement:k(t.placement),variation:J(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,Q(Object.assign({},l,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:u})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,Q(Object.assign({},l,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},O,{name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=void 0===i?[0,0]:i,a=C.reduce((function(e,n){return e[n]=function(e,t,n){var r=k(e),i=[E,w].indexOf(r)>=0?-1:1,o="function"==typeof n?n(Object.assign({},t,{placement:e})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*i,[E,S].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,o),e}),{}),s=a[t.placement],u=s.x,l=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=u,t.modifiersData.popperOffsets.y+=l),t.modifiersData[r]=a}},{name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=void 0===i||i,a=n.altAxis,s=void 0===a||a,u=n.fallbackPlacements,l=n.padding,c=n.boundary,p=n.rootBoundary,h=n.altBoundary,d=n.flipVariations,f=void 0===d||d,g=n.allowedAutoPlacements,m=t.options.placement,v=k(m),y=u||(v===m||!f?[ne(m)]:function(e){if("auto"===k(e))return[];var t=ne(e);return[ie(e),t,ie(t)]}(m)),b=[m].concat(y).reduce((function(e,n){return e.concat("auto"===k(n)?fe(t,{placement:n,boundary:c,rootBoundary:p,padding:l,flipVariations:f,allowedAutoPlacements:g}):n)}),[]),A=t.rects.reference,F=t.rects.popper,C=new Map,$=!0,D=b[0],T=0;T<b.length;T++){var I=b[T],R=k(I),P="start"===J(I),O=[w,x].indexOf(R)>=0,_=O?"width":"height",j=de(t,{placement:I,boundary:c,rootBoundary:p,altBoundary:h,padding:l}),N=O?P?S:E:P?x:w;A[_]>F[_]&&(N=ne(N));var L=ne(N),B=[];if(o&&B.push(j[R]<=0),s&&B.push(j[N]<=0,j[L]<=0),B.every((function(e){return e}))){D=I,$=!1;break}C.set(I,B)}if($)for(var U=function(e){var t=b.find((function(t){var n=C.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return D=t,"break"},M=f?3:1;M>0;M--){if("break"===U(M))break}t.placement!==D&&(t.modifiersData[r]._skip=!0,t.placement=D,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}},{name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=void 0===i||i,a=n.altAxis,s=void 0!==a&&a,u=n.boundary,l=n.rootBoundary,c=n.altBoundary,p=n.padding,h=n.tether,d=void 0===h||h,f=n.tetherOffset,g=void 0===f?0:f,m=de(t,{boundary:u,rootBoundary:l,padding:p,altBoundary:c}),v=k(t.placement),y=J(t.placement),b=!y,A=G(v),F="x"===A?"y":"x",C=t.modifiersData.popperOffsets,$=t.rects.reference,D=t.rects.popper,T="function"==typeof g?g(Object.assign({},t.rects,{placement:t.placement})):g,I="number"==typeof T?{mainAxis:T,altAxis:T}:Object.assign({mainAxis:0,altAxis:0},T),R=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,P={x:0,y:0};if(C){if(o){var O,N="y"===A?w:E,L="y"===A?x:S,U="y"===A?"height":"width",M=C[A],H=M+m[N],V=M-m[L],q=d?-D[U]/2:0,K="start"===y?$[U]:D[U],Y="start"===y?-D[U]:-$[U],X=t.elements.arrow,Z=d&&X?B(X):{width:0,height:0},Q=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},ee=Q[N],te=Q[L],ne=W(0,$[U],Z[U]),re=b?$[U]/2-q-ne-ee-I.mainAxis:K-ne-ee-I.mainAxis,ie=b?-$[U]/2+q+ne+te+I.mainAxis:Y+ne+te+I.mainAxis,oe=t.elements.arrow&&z(t.elements.arrow),ae=oe?"y"===A?oe.clientTop||0:oe.clientLeft||0:0,se=null!=(O=null==R?void 0:R[A])?O:0,ue=M+ie-se,le=W(d?j(H,M+re-se-ae):H,M,d?_(V,ue):V);C[A]=le,P[A]=le-M}if(s){var ce,pe="x"===A?w:E,he="x"===A?x:S,fe=C[F],ge="y"===F?"height":"width",me=fe+m[pe],ve=fe-m[he],ye=-1!==[w,E].indexOf(v),be=null!=(ce=null==R?void 0:R[F])?ce:0,we=ye?me:fe-$[ge]-D[ge]-be+I.altAxis,xe=ye?fe+$[ge]+D[ge]-be-I.altAxis:ve,Se=d&&ye?function(e,t,n){var r=W(e,t,n);return r>n?n:r}(we,fe,xe):W(d?we:me,fe,d?xe:ve);C[F]=Se,P[F]=Se-fe}t.modifiersData[r]=P}},requiresIfExists:["offset"]},{name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=k(n.placement),u=G(s),l=[E,S].indexOf(s)>=0?"height":"width";if(o&&a){var c=function(e,t){return Y("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:X(e,A))}(i.padding,n),p=B(o),h="y"===u?w:E,d="y"===u?x:S,f=n.rects.reference[l]+n.rects.reference[u]-a[u]-n.rects.popper[l],g=a[u]-n.rects.reference[u],m=z(o),v=m?"y"===u?m.clientHeight||0:m.clientWidth||0:0,y=f/2-g/2,b=c[h],F=v-p[l]-c[d],C=v/2-p[l]/2+y,$=W(b,C,F),D=u;n.modifiersData[r]=((t={})[D]=$,t.centerOffset=$-C,t)}},effect:function(e){var t=e.state,n=e.options.element,r=void 0===n?"[data-popper-arrow]":n;null!=r&&("string"!=typeof r||(r=t.elements.popper.querySelector(r)))&&U(t.elements.popper,r)&&(t.elements.arrow=r)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]},{name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=de(t,{elementContext:"reference"}),s=de(t,{altBoundary:!0}),u=ge(a,r),l=ge(s,i,o),c=me(u),p=me(l);t.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:l,isReferenceHidden:c,hasPopperEscaped:p},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":p})}}]});function Ee(){return(Ee=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Ae(e){return{name:"focusAfterRender",enabled:!0,phase:"afterWrite",fn(){setTimeout(()=>{if(e.el){const t={preventScroll:!0};e.el.focus(t)}},300)}}}function Fe(e){const t=[{name:"applyStyles",fn(e){let{state:t}=e;Object.keys(t.elements).forEach(e=>{if("popper"!==e)return;const n=t.attributes[e]||{},r=t.elements[e];Object.assign(r.style,{position:"fixed",left:"50%",top:"50%",transform:"translate(-50%, -50%)"}),Object.keys(n).forEach(e=>{const t=n[e];!1===t?r.removeAttribute(e):r.setAttribute(e,!0===t?"":t)})})}},{name:"computeStyles",options:{adaptive:!1}}];let n={placement:"top",strategy:"fixed",modifiers:[Ae(e)]};return n=Ee({},n,{modifiers:Array.from(new Set([...n.modifiers,...t]))}),n}function Ce(e){return g(e)&&""!==e?"-"!==e.charAt(e.length-1)?e+"-":e:""}function $e(e){return null==e||(!e.element||!e.on)}function De(e){e.tooltip&&e.tooltip.destroy();const t=e._getResolvedAttachToOptions();let n=t.element;const r=function(e,t){let n={modifiers:[{name:"preventOverflow",options:{altAxis:!0,tether:!1}},Ae(t)],strategy:"absolute"};$e(e)?n=Fe(t):n.placement=e.on;const r=t.tour&&t.tour.options&&t.tour.options.defaultStepOptions;r&&(n=Ie(r,n));return n=Ie(t.options,n),n}(t,e);if($e(t)){n=document.body;e.shepherdElementComponent.getElement().classList.add("shepherd-centered")}return e.tooltip=Se(n,e.el,r),e.target=t.element,r}function Te(){let e=Date.now();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"==t?n:3&n|8).toString(16)})}function Ie(e,t){if(e.popperOptions){let n=Object.assign({},t,e.popperOptions);if(e.popperOptions.modifiers&&e.popperOptions.modifiers.length>0){const r=e.popperOptions.modifiers.map(e=>e.name),i=t.modifiers.filter(e=>!r.includes(e.name));n.modifiers=Array.from(new Set([...i,...e.popperOptions.modifiers]))}return n}return t}function Re(){}function Pe(e,t){for(const n in t)e[n]=t[n];return e}function Oe(e){return e()}function ke(){return Object.create(null)}function _e(e){e.forEach(Oe)}function je(e){return"function"==typeof e}function Ne(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}function Le(e,t){e.appendChild(t)}function Be(e,t,n){e.insertBefore(t,n||null)}function Ue(e){e.parentNode.removeChild(e)}function Me(e){return document.createElement(e)}function He(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function Ve(e){return document.createTextNode(e)}function qe(){return Ve(" ")}function Ke(e,t,n,r){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}function ze(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function Ge(e,t){const n=Object.getOwnPropertyDescriptors(e.__proto__);for(const r in t)null==t[r]?e.removeAttribute(r):"style"===r?e.style.cssText=t[r]:"__value"===r?e.value=e[r]=t[r]:n[r]&&n[r].set?e[r]=t[r]:ze(e,r,t[r])}function We(e,t,n){e.classList[n?"add":"remove"](t)}let Ye;function Xe(e){Ye=e}function Je(){if(!Ye)throw new Error("Function called outside component initialization");return Ye}function Ze(e){Je().$$.after_update.push(e)}const Qe=[],et=[],tt=[],nt=[],rt=Promise.resolve();let it=!1;function ot(e){tt.push(e)}const at=new Set;let st=0;function ut(){const e=Ye;do{for(;st<Qe.length;){const e=Qe[st];st++,Xe(e),lt(e.$$)}for(Xe(null),Qe.length=0,st=0;et.length;)et.pop()();for(let e=0;e<tt.length;e+=1){const t=tt[e];at.has(t)||(at.add(t),t())}tt.length=0}while(Qe.length);for(;nt.length;)nt.pop()();it=!1,at.clear(),Xe(e)}function lt(e){if(null!==e.fragment){e.update(),_e(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(ot)}}const ct=new Set;let pt;function ht(){pt={r:0,c:[],p:pt}}function dt(){pt.r||_e(pt.c),pt=pt.p}function ft(e,t){e&&e.i&&(ct.delete(e),e.i(t))}function gt(e,t,n,r){if(e&&e.o){if(ct.has(e))return;ct.add(e),pt.c.push(()=>{ct.delete(e),r&&(n&&e.d(1),r())}),e.o(t)}else r&&r()}function mt(e){e&&e.c()}function vt(e,t,n,r){const{fragment:i,on_mount:o,on_destroy:a,after_update:s}=e.$$;i&&i.m(t,n),r||ot(()=>{const t=o.map(Oe).filter(je);a?a.push(...t):_e(t),e.$$.on_mount=[]}),s.forEach(ot)}function yt(e,t){const n=e.$$;null!==n.fragment&&(_e(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function bt(e,t){-1===e.$$.dirty[0]&&(Qe.push(e),it||(it=!0,rt.then(ut)),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function wt(e,t,n,r,i,o,a,s){void 0===s&&(s=[-1]);const u=Ye;Xe(e);const l=e.$$={fragment:null,ctx:null,props:o,update:Re,not_equal:i,bound:ke(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(u?u.$$.context:[])),callbacks:ke(),dirty:s,skip_bound:!1,root:t.target||u.$$.root};a&&a(l.root);let c=!1;if(l.ctx=n?n(e,t.props||{},(function(t,n){const r=!(arguments.length<=2)&&arguments.length-2?arguments.length<=2?void 0:arguments[2]:n;return l.ctx&&i(l.ctx[t],l.ctx[t]=r)&&(!l.skip_bound&&l.bound[t]&&l.bound[t](r),c&&bt(e,t)),n})):[],l.update(),c=!0,_e(l.before_update),l.fragment=!!r&&r(l.ctx),t.target){if(t.hydrate){const e=(p=t.target,Array.from(p.childNodes));l.fragment&&l.fragment.l(e),e.forEach(Ue)}else l.fragment&&l.fragment.c();t.intro&&ft(e.$$.fragment),vt(e,t.target,t.anchor,t.customElement),ut()}var p;Xe(u)}class xt{$destroy(){yt(this,1),this.$destroy=Re}$on(e,t){const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}$set(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}function St(e){let t,n,r,i,o;return{c(){t=Me("button"),ze(t,"aria-label",n=e[3]?e[3]:null),ze(t,"class",r=`${e[1]||""} shepherd-button ${e[4]?"shepherd-button-secondary":""}`),t.disabled=e[2],ze(t,"tabindex","0")},m(n,r){Be(n,t,r),t.innerHTML=e[5],i||(o=Ke(t,"click",(function(){je(e[0])&&e[0].apply(this,arguments)})),i=!0)},p(i,o){let[a]=o;e=i,32&a&&(t.innerHTML=e[5]),8&a&&n!==(n=e[3]?e[3]:null)&&ze(t,"aria-label",n),18&a&&r!==(r=`${e[1]||""} shepherd-button ${e[4]?"shepherd-button-secondary":""}`)&&ze(t,"class",r),4&a&&(t.disabled=e[2])},i:Re,o:Re,d(e){e&&Ue(t),i=!1,o()}}}function Et(e,t,n){let r,i,o,a,s,u,{config:l,step:c}=t;function p(e){return f(e)?e.call(c):e}return e.$$set=e=>{"config"in e&&n(6,l=e.config),"step"in e&&n(7,c=e.step)},e.$$.update=()=>{192&e.$$.dirty&&(n(0,r=l.action?l.action.bind(c.tour):null),n(1,i=l.classes),n(2,o=!!l.disabled&&p(l.disabled)),n(3,a=l.label?p(l.label):null),n(4,s=l.secondary),n(5,u=l.text?p(l.text):null))},[r,i,o,a,s,u,l,c]}class At extends xt{constructor(e){super(),wt(this,e,Et,St,Ne,{config:6,step:7})}}function Ft(e,t,n){const r=e.slice();return r[2]=t[n],r}function Ct(e){let t,n,r=e[1],i=[];for(let t=0;t<r.length;t+=1)i[t]=$t(Ft(e,r,t));const o=e=>gt(i[e],1,1,()=>{i[e]=null});return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=Ve("")},m(e,r){for(let t=0;t<i.length;t+=1)i[t].m(e,r);Be(e,t,r),n=!0},p(e,n){if(3&n){let a;for(r=e[1],a=0;a<r.length;a+=1){const o=Ft(e,r,a);i[a]?(i[a].p(o,n),ft(i[a],1)):(i[a]=$t(o),i[a].c(),ft(i[a],1),i[a].m(t.parentNode,t))}for(ht(),a=r.length;a<i.length;a+=1)o(a);dt()}},i(e){if(!n){for(let e=0;e<r.length;e+=1)ft(i[e]);n=!0}},o(e){i=i.filter(Boolean);for(let e=0;e<i.length;e+=1)gt(i[e]);n=!1},d(e){!function(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}(i,e),e&&Ue(t)}}}function $t(e){let t,n;return t=new At({props:{config:e[2],step:e[0]}}),{c(){mt(t.$$.fragment)},m(e,r){vt(t,e,r),n=!0},p(e,n){const r={};2&n&&(r.config=e[2]),1&n&&(r.step=e[0]),t.$set(r)},i(e){n||(ft(t.$$.fragment,e),n=!0)},o(e){gt(t.$$.fragment,e),n=!1},d(e){yt(t,e)}}}function Dt(e){let t,n,r=e[1]&&Ct(e);return{c(){t=Me("footer"),r&&r.c(),ze(t,"class","shepherd-footer")},m(e,i){Be(e,t,i),r&&r.m(t,null),n=!0},p(e,n){let[i]=n;e[1]?r?(r.p(e,i),2&i&&ft(r,1)):(r=Ct(e),r.c(),ft(r,1),r.m(t,null)):r&&(ht(),gt(r,1,1,()=>{r=null}),dt())},i(e){n||(ft(r),n=!0)},o(e){gt(r),n=!1},d(e){e&&Ue(t),r&&r.d()}}}function Tt(e,t,n){let r,{step:i}=t;return e.$$set=e=>{"step"in e&&n(0,i=e.step)},e.$$.update=()=>{1&e.$$.dirty&&n(1,r=i.options.buttons)},[i,r]}class It extends xt{constructor(e){super(),wt(this,e,Tt,Dt,Ne,{step:0})}}function Rt(e){let t,n,r,i,o;return{c(){t=Me("button"),n=Me("span"),n.textContent="×",ze(n,"aria-hidden","true"),ze(t,"aria-label",r=e[0].label?e[0].label:"Close Tour"),ze(t,"class","shepherd-cancel-icon"),ze(t,"type","button")},m(r,a){Be(r,t,a),Le(t,n),i||(o=Ke(t,"click",e[1]),i=!0)},p(e,n){let[i]=n;1&i&&r!==(r=e[0].label?e[0].label:"Close Tour")&&ze(t,"aria-label",r)},i:Re,o:Re,d(e){e&&Ue(t),i=!1,o()}}}function Pt(e,t,n){let{cancelIcon:r,step:i}=t;return e.$$set=e=>{"cancelIcon"in e&&n(0,r=e.cancelIcon),"step"in e&&n(2,i=e.step)},[r,e=>{e.preventDefault(),i.cancel()},i]}class Ot extends xt{constructor(e){super(),wt(this,e,Pt,Rt,Ne,{cancelIcon:0,step:2})}}function kt(e){let t;return{c(){t=Me("h3"),ze(t,"id",e[1]),ze(t,"class","shepherd-title")},m(n,r){Be(n,t,r),e[3](t)},p(e,n){let[r]=n;2&r&&ze(t,"id",e[1])},i:Re,o:Re,d(n){n&&Ue(t),e[3](null)}}}function _t(e,t,n){let{labelId:r,element:i,title:o}=t;return Ze(()=>{f(o)&&n(2,o=o()),n(0,i.innerHTML=o,i)}),e.$$set=e=>{"labelId"in e&&n(1,r=e.labelId),"element"in e&&n(0,i=e.element),"title"in e&&n(2,o=e.title)},[i,r,o,function(e){et[e?"unshift":"push"](()=>{i=e,n(0,i)})}]}class jt extends xt{constructor(e){super(),wt(this,e,_t,kt,Ne,{labelId:1,element:0,title:2})}}function Nt(e){let t,n;return t=new jt({props:{labelId:e[0],title:e[2]}}),{c(){mt(t.$$.fragment)},m(e,r){vt(t,e,r),n=!0},p(e,n){const r={};1&n&&(r.labelId=e[0]),4&n&&(r.title=e[2]),t.$set(r)},i(e){n||(ft(t.$$.fragment,e),n=!0)},o(e){gt(t.$$.fragment,e),n=!1},d(e){yt(t,e)}}}function Lt(e){let t,n;return t=new Ot({props:{cancelIcon:e[3],step:e[1]}}),{c(){mt(t.$$.fragment)},m(e,r){vt(t,e,r),n=!0},p(e,n){const r={};8&n&&(r.cancelIcon=e[3]),2&n&&(r.step=e[1]),t.$set(r)},i(e){n||(ft(t.$$.fragment,e),n=!0)},o(e){gt(t.$$.fragment,e),n=!1},d(e){yt(t,e)}}}function Bt(e){let t,n,r,i=e[2]&&Nt(e),o=e[3]&&e[3].enabled&&Lt(e);return{c(){t=Me("header"),i&&i.c(),n=qe(),o&&o.c(),ze(t,"class","shepherd-header")},m(e,a){Be(e,t,a),i&&i.m(t,null),Le(t,n),o&&o.m(t,null),r=!0},p(e,r){let[a]=r;e[2]?i?(i.p(e,a),4&a&&ft(i,1)):(i=Nt(e),i.c(),ft(i,1),i.m(t,n)):i&&(ht(),gt(i,1,1,()=>{i=null}),dt()),e[3]&&e[3].enabled?o?(o.p(e,a),8&a&&ft(o,1)):(o=Lt(e),o.c(),ft(o,1),o.m(t,null)):o&&(ht(),gt(o,1,1,()=>{o=null}),dt())},i(e){r||(ft(i),ft(o),r=!0)},o(e){gt(i),gt(o),r=!1},d(e){e&&Ue(t),i&&i.d(),o&&o.d()}}}function Ut(e,t,n){let r,i,{labelId:o,step:a}=t;return e.$$set=e=>{"labelId"in e&&n(0,o=e.labelId),"step"in e&&n(1,a=e.step)},e.$$.update=()=>{2&e.$$.dirty&&(n(2,r=a.options.title),n(3,i=a.options.cancelIcon))},[o,a,r,i]}class Mt extends xt{constructor(e){super(),wt(this,e,Ut,Bt,Ne,{labelId:0,step:1})}}function Ht(e){let t;return{c(){t=Me("div"),ze(t,"class","shepherd-text"),ze(t,"id",e[1])},m(n,r){Be(n,t,r),e[3](t)},p(e,n){let[r]=n;2&r&&ze(t,"id",e[1])},i:Re,o:Re,d(n){n&&Ue(t),e[3](null)}}}function Vt(e,t,n){let{descriptionId:r,element:i,step:o}=t;return Ze(()=>{let{text:e}=o.options;f(e)&&(e=e.call(o)),d(e)?i.appendChild(e):n(0,i.innerHTML=e,i)}),e.$$set=e=>{"descriptionId"in e&&n(1,r=e.descriptionId),"element"in e&&n(0,i=e.element),"step"in e&&n(2,o=e.step)},[i,r,o,function(e){et[e?"unshift":"push"](()=>{i=e,n(0,i)})}]}class qt extends xt{constructor(e){super(),wt(this,e,Vt,Ht,Ne,{descriptionId:1,element:0,step:2})}}function Kt(e){let t,n;return t=new Mt({props:{labelId:e[1],step:e[2]}}),{c(){mt(t.$$.fragment)},m(e,r){vt(t,e,r),n=!0},p(e,n){const r={};2&n&&(r.labelId=e[1]),4&n&&(r.step=e[2]),t.$set(r)},i(e){n||(ft(t.$$.fragment,e),n=!0)},o(e){gt(t.$$.fragment,e),n=!1},d(e){yt(t,e)}}}function zt(e){let t,n;return t=new qt({props:{descriptionId:e[0],step:e[2]}}),{c(){mt(t.$$.fragment)},m(e,r){vt(t,e,r),n=!0},p(e,n){const r={};1&n&&(r.descriptionId=e[0]),4&n&&(r.step=e[2]),t.$set(r)},i(e){n||(ft(t.$$.fragment,e),n=!0)},o(e){gt(t.$$.fragment,e),n=!1},d(e){yt(t,e)}}}function Gt(e){let t,n;return t=new It({props:{step:e[2]}}),{c(){mt(t.$$.fragment)},m(e,r){vt(t,e,r),n=!0},p(e,n){const r={};4&n&&(r.step=e[2]),t.$set(r)},i(e){n||(ft(t.$$.fragment,e),n=!0)},o(e){gt(t.$$.fragment,e),n=!1},d(e){yt(t,e)}}}function Wt(e){let t,n,r,i,o=!m(e[2].options.title)||e[2].options.cancelIcon&&e[2].options.cancelIcon.enabled,a=!m(e[2].options.text),s=Array.isArray(e[2].options.buttons)&&e[2].options.buttons.length,u=o&&Kt(e),l=a&&zt(e),c=s&&Gt(e);return{c(){t=Me("div"),u&&u.c(),n=qe(),l&&l.c(),r=qe(),c&&c.c(),ze(t,"class","shepherd-content")},m(e,o){Be(e,t,o),u&&u.m(t,null),Le(t,n),l&&l.m(t,null),Le(t,r),c&&c.m(t,null),i=!0},p(e,i){let[p]=i;4&p&&(o=!m(e[2].options.title)||e[2].options.cancelIcon&&e[2].options.cancelIcon.enabled),o?u?(u.p(e,p),4&p&&ft(u,1)):(u=Kt(e),u.c(),ft(u,1),u.m(t,n)):u&&(ht(),gt(u,1,1,()=>{u=null}),dt()),4&p&&(a=!m(e[2].options.text)),a?l?(l.p(e,p),4&p&&ft(l,1)):(l=zt(e),l.c(),ft(l,1),l.m(t,r)):l&&(ht(),gt(l,1,1,()=>{l=null}),dt()),4&p&&(s=Array.isArray(e[2].options.buttons)&&e[2].options.buttons.length),s?c?(c.p(e,p),4&p&&ft(c,1)):(c=Gt(e),c.c(),ft(c,1),c.m(t,null)):c&&(ht(),gt(c,1,1,()=>{c=null}),dt())},i(e){i||(ft(u),ft(l),ft(c),i=!0)},o(e){gt(u),gt(l),gt(c),i=!1},d(e){e&&Ue(t),u&&u.d(),l&&l.d(),c&&c.d()}}}function Yt(e,t,n){let{descriptionId:r,labelId:i,step:o}=t;return e.$$set=e=>{"descriptionId"in e&&n(0,r=e.descriptionId),"labelId"in e&&n(1,i=e.labelId),"step"in e&&n(2,o=e.step)},[r,i,o]}class Xt extends xt{constructor(e){super(),wt(this,e,Yt,Wt,Ne,{descriptionId:0,labelId:1,step:2})}}function Jt(e){let t;return{c(){t=Me("div"),ze(t,"class","shepherd-arrow"),ze(t,"data-popper-arrow","")},m(e,n){Be(e,t,n)},d(e){e&&Ue(t)}}}function Zt(e){let t,n,r,i,o,a,s,u,l=e[4].options.arrow&&e[4].options.attachTo&&e[4].options.attachTo.element&&e[4].options.attachTo.on&&Jt();r=new Xt({props:{descriptionId:e[2],labelId:e[3],step:e[4]}});let c=[{"aria-describedby":i=m(e[4].options.text)?null:e[2]},{"aria-labelledby":o=e[4].options.title?e[3]:null},e[1],{role:"dialog"},{tabindex:"0"}],p={};for(let e=0;e<c.length;e+=1)p=Pe(p,c[e]);return{c(){t=Me("div"),l&&l.c(),n=qe(),mt(r.$$.fragment),Ge(t,p),We(t,"shepherd-has-cancel-icon",e[5]),We(t,"shepherd-has-title",e[6]),We(t,"shepherd-element",!0)},m(i,o){Be(i,t,o),l&&l.m(t,null),Le(t,n),vt(r,t,null),e[13](t),a=!0,s||(u=Ke(t,"keydown",e[7]),s=!0)},p(e,s){let[u]=s;e[4].options.arrow&&e[4].options.attachTo&&e[4].options.attachTo.element&&e[4].options.attachTo.on?l||(l=Jt(),l.c(),l.m(t,n)):l&&(l.d(1),l=null);const h={};4&u&&(h.descriptionId=e[2]),8&u&&(h.labelId=e[3]),16&u&&(h.step=e[4]),r.$set(h),Ge(t,p=function(e,t){const n={},r={},i={$$scope:1};let o=e.length;for(;o--;){const a=e[o],s=t[o];if(s){for(const e in a)e in s||(r[e]=1);for(const e in s)i[e]||(n[e]=s[e],i[e]=1);e[o]=s}else for(const e in a)i[e]=1}for(const e in r)e in n||(n[e]=void 0);return n}(c,[(!a||20&u&&i!==(i=m(e[4].options.text)?null:e[2]))&&{"aria-describedby":i},(!a||24&u&&o!==(o=e[4].options.title?e[3]:null))&&{"aria-labelledby":o},2&u&&e[1],{role:"dialog"},{tabindex:"0"}])),We(t,"shepherd-has-cancel-icon",e[5]),We(t,"shepherd-has-title",e[6]),We(t,"shepherd-element",!0)},i(e){a||(ft(r.$$.fragment,e),a=!0)},o(e){gt(r.$$.fragment,e),a=!1},d(n){n&&Ue(t),l&&l.d(),yt(r),e[13](null),s=!1,u()}}}function Qt(e){return e.split(" ").filter(e=>!!e.length)}function en(e,t,n){let r,i,o,{classPrefix:a,element:s,descriptionId:u,firstFocusableElement:l,focusableElements:c,labelId:p,lastFocusableElement:h,step:d,dataStepId:f}=t;var m;m=()=>{n(1,f={[`data-${a}shepherd-step-id`]:d.id}),n(9,c=s.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]')),n(8,l=c[0]),n(10,h=c[c.length-1])},Je().$$.on_mount.push(m),Ze(()=>{o!==d.options.classes&&(function(e){if(g(e)){const t=Qt(e);t.length&&s.classList.remove(...t)}}(o),o=d.options.classes,function(e){if(g(e)){const t=Qt(e);t.length&&s.classList.add(...t)}}(o))});return e.$$set=e=>{"classPrefix"in e&&n(11,a=e.classPrefix),"element"in e&&n(0,s=e.element),"descriptionId"in e&&n(2,u=e.descriptionId),"firstFocusableElement"in e&&n(8,l=e.firstFocusableElement),"focusableElements"in e&&n(9,c=e.focusableElements),"labelId"in e&&n(3,p=e.labelId),"lastFocusableElement"in e&&n(10,h=e.lastFocusableElement),"step"in e&&n(4,d=e.step),"dataStepId"in e&&n(1,f=e.dataStepId)},e.$$.update=()=>{16&e.$$.dirty&&(n(5,r=d.options&&d.options.cancelIcon&&d.options.cancelIcon.enabled),n(6,i=d.options&&d.options.title))},[s,f,u,p,d,r,i,e=>{const{tour:t}=d;switch(e.keyCode){case 9:if(0===c.length){e.preventDefault();break}e.shiftKey?(document.activeElement===l||document.activeElement.classList.contains("shepherd-element"))&&(e.preventDefault(),h.focus()):document.activeElement===h&&(e.preventDefault(),l.focus());break;case 27:t.options.exitOnEsc&&d.cancel();break;case 37:t.options.keyboardNavigation&&t.back();break;case 39:t.options.keyboardNavigation&&t.next()}},l,c,h,a,()=>s,function(e){et[e?"unshift":"push"](()=>{s=e,n(0,s)})}]}class tn extends xt{constructor(e){super(),wt(this,e,en,Zt,Ne,{classPrefix:11,element:0,descriptionId:2,firstFocusableElement:8,focusableElements:9,labelId:3,lastFocusableElement:10,step:4,dataStepId:1,getElement:12})}get getElement(){return this.$$.ctx[12]}}var nn=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e,t){e.exports={polyfill:function(){var e=window,t=document;if(!("scrollBehavior"in t.documentElement.style)||!0===e.__forceSmoothScrollPolyfill__){var n,r=e.HTMLElement||e.Element,i={scroll:e.scroll||e.scrollTo,scrollBy:e.scrollBy,elementScroll:r.prototype.scroll||s,scrollIntoView:r.prototype.scrollIntoView},o=e.performance&&e.performance.now?e.performance.now.bind(e.performance):Date.now,a=(n=e.navigator.userAgent,new RegExp(["MSIE ","Trident/","Edge/"].join("|")).test(n)?1:0);e.scroll=e.scrollTo=function(){void 0!==arguments[0]&&(!0!==u(arguments[0])?f.call(e,t.body,void 0!==arguments[0].left?~~arguments[0].left:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?~~arguments[0].top:e.scrollY||e.pageYOffset):i.scroll.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:e.scrollX||e.pageXOffset,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:e.scrollY||e.pageYOffset))},e.scrollBy=function(){void 0!==arguments[0]&&(u(arguments[0])?i.scrollBy.call(e,void 0!==arguments[0].left?arguments[0].left:"object"!=typeof arguments[0]?arguments[0]:0,void 0!==arguments[0].top?arguments[0].top:void 0!==arguments[1]?arguments[1]:0):f.call(e,t.body,~~arguments[0].left+(e.scrollX||e.pageXOffset),~~arguments[0].top+(e.scrollY||e.pageYOffset)))},r.prototype.scroll=r.prototype.scrollTo=function(){if(void 0!==arguments[0])if(!0!==u(arguments[0])){var e=arguments[0].left,t=arguments[0].top;f.call(this,this,void 0===e?this.scrollLeft:~~e,void 0===t?this.scrollTop:~~t)}else{if("number"==typeof arguments[0]&&void 0===arguments[1])throw new SyntaxError("Value could not be converted");i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left:"object"!=typeof arguments[0]?~~arguments[0]:this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top:void 0!==arguments[1]?~~arguments[1]:this.scrollTop)}},r.prototype.scrollBy=function(){void 0!==arguments[0]&&(!0!==u(arguments[0])?this.scroll({left:~~arguments[0].left+this.scrollLeft,top:~~arguments[0].top+this.scrollTop,behavior:arguments[0].behavior}):i.elementScroll.call(this,void 0!==arguments[0].left?~~arguments[0].left+this.scrollLeft:~~arguments[0]+this.scrollLeft,void 0!==arguments[0].top?~~arguments[0].top+this.scrollTop:~~arguments[1]+this.scrollTop))},r.prototype.scrollIntoView=function(){if(!0!==u(arguments[0])){var n=h(this),r=n.getBoundingClientRect(),o=this.getBoundingClientRect();n!==t.body?(f.call(this,n,n.scrollLeft+o.left-r.left,n.scrollTop+o.top-r.top),"fixed"!==e.getComputedStyle(n).position&&e.scrollBy({left:r.left,top:r.top,behavior:"smooth"})):e.scrollBy({left:o.left,top:o.top,behavior:"smooth"})}else i.scrollIntoView.call(this,void 0===arguments[0]||arguments[0])}}function s(e,t){this.scrollLeft=e,this.scrollTop=t}function u(e){if(null===e||"object"!=typeof e||void 0===e.behavior||"auto"===e.behavior||"instant"===e.behavior)return!0;if("object"==typeof e&&"smooth"===e.behavior)return!1;throw new TypeError("behavior member of ScrollOptions "+e.behavior+" is not a valid value for enumeration ScrollBehavior.")}function l(e,t){return"Y"===t?e.clientHeight+a<e.scrollHeight:"X"===t?e.clientWidth+a<e.scrollWidth:void 0}function c(t,n){var r=e.getComputedStyle(t,null)["overflow"+n];return"auto"===r||"scroll"===r}function p(e){var t=l(e,"Y")&&c(e,"Y"),n=l(e,"X")&&c(e,"X");return t||n}function h(e){for(;e!==t.body&&!1===p(e);)e=e.parentNode||e.host;return e}function d(t){var n,r,i,a,s=(o()-t.startTime)/468;a=s=s>1?1:s,n=.5*(1-Math.cos(Math.PI*a)),r=t.startX+(t.x-t.startX)*n,i=t.startY+(t.y-t.startY)*n,t.method.call(t.scrollable,r,i),r===t.x&&i===t.y||e.requestAnimationFrame(d.bind(e,t))}function f(n,r,a){var u,l,c,p,h=o();n===t.body?(u=e,l=e.scrollX||e.pageXOffset,c=e.scrollY||e.pageYOffset,p=i.scroll):(u=n,l=n.scrollLeft,c=n.scrollTop,p=s),d({scrollable:u,method:p,startTime:h,startX:l,startY:c,x:r,y:a})}}}}));nn.polyfill,nn.polyfill();class rn extends v{constructor(e,t){return void 0===t&&(t={}),super(e,t),this.tour=e,this.classPrefix=this.tour.options?Ce(this.tour.options.classPrefix):"",this.styles=e.styles,this._resolvedAttachTo=null,y(this),this._setOptions(t),this}cancel(){this.tour.cancel(),this.trigger("cancel")}complete(){this.tour.complete(),this.trigger("complete")}destroy(){this.tooltip&&(this.tooltip.destroy(),this.tooltip=null),d(this.el)&&this.el.parentNode&&(this.el.parentNode.removeChild(this.el),this.el=null),this._updateStepTargetOnHide(),this.trigger("destroy")}getTour(){return this.tour}hide(){this.tour.modal.hide(),this.trigger("before-hide"),this.el&&(this.el.hidden=!0),this._updateStepTargetOnHide(),this.trigger("hide")}_resolveAttachToOptions(){return this._resolvedAttachTo=function(e){const t=e.options.attachTo||{},n=Object.assign({},t);if(f(n.element)&&(n.element=n.element.call(e)),g(n.element)){try{n.element=document.querySelector(n.element)}catch(e){}n.element||console.error("The element for this Shepherd step was not found "+t.element)}return n}(this),this._resolvedAttachTo}_getResolvedAttachToOptions(){return null===this._resolvedAttachTo?this._resolveAttachToOptions():this._resolvedAttachTo}isOpen(){return Boolean(this.el&&!this.el.hidden)}show(){if(f(this.options.beforeShowPromise)){const e=this.options.beforeShowPromise();if(!m(e))return e.then(()=>this._show())}this._show()}updateStepOptions(e){Object.assign(this.options,e),this.shepherdElementComponent&&this.shepherdElementComponent.$set({step:this})}getElement(){return this.el}getTarget(){return this.target}_createTooltipContent(){const e=this.id+"-description",t=this.id+"-label";return this.shepherdElementComponent=new tn({target:this.tour.options.stepsContainer||document.body,props:{classPrefix:this.classPrefix,descriptionId:e,labelId:t,step:this,styles:this.styles}}),this.shepherdElementComponent.getElement()}_scrollTo(e){const{element:t}=this._getResolvedAttachToOptions();f(this.options.scrollToHandler)?this.options.scrollToHandler(t):t instanceof Element&&"function"==typeof t.scrollIntoView&&t.scrollIntoView(e)}_getClassOptions(e){const t=this.tour&&this.tour.options&&this.tour.options.defaultStepOptions,n=e.classes?e.classes:"",r=t&&t.classes?t.classes:"",i=[...n.split(" "),...r.split(" ")],o=new Set(i);return Array.from(o).join(" ").trim()}_setOptions(e){void 0===e&&(e={});let t=this.tour&&this.tour.options&&this.tour.options.defaultStepOptions;t=h({},t||{}),this.options=Object.assign({arrow:!0},t,e);const{when:n}=this.options;this.options.classes=this._getClassOptions(e),this.destroy(),this.id=this.options.id||"step-"+Te(),n&&Object.keys(n).forEach(e=>{this.on(e,n[e],this)})}_setupElements(){m(this.el)||this.destroy(),this.el=this._createTooltipContent(),this.options.advanceOn&&b(this),De(this)}_show(){this.trigger("before-show"),this._resolveAttachToOptions(),this._setupElements(),this.tour.modal||this.tour._setupModal(),this.tour.modal.setupForStep(this),this._styleTargetElementForStep(this),this.el.hidden=!1,this.options.scrollTo&&setTimeout(()=>{this._scrollTo(this.options.scrollTo)}),this.el.hidden=!1;const e=this.shepherdElementComponent.getElement(),t=this.target||document.body;t.classList.add(this.classPrefix+"shepherd-enabled"),t.classList.add(this.classPrefix+"shepherd-target"),e.classList.add("shepherd-enabled"),this.trigger("show")}_styleTargetElementForStep(e){const t=e.target;t&&(e.options.highlightClass&&t.classList.add(e.options.highlightClass),t.classList.remove("shepherd-target-click-disabled"),!1===e.options.canClickTarget&&t.classList.add("shepherd-target-click-disabled"))}_updateStepTargetOnHide(){const e=this.target||document.body;this.options.highlightClass&&e.classList.remove(this.options.highlightClass),e.classList.remove("shepherd-target-click-disabled",this.classPrefix+"shepherd-enabled",this.classPrefix+"shepherd-target")}}function on(e){let t,n,r,i,o;return{c(){t=He("svg"),n=He("path"),ze(n,"d",e[2]),ze(t,"class",r=(e[1]?"shepherd-modal-is-visible":"")+" shepherd-modal-overlay-container")},m(r,a){Be(r,t,a),Le(t,n),e[11](t),i||(o=Ke(t,"touchmove",e[3]),i=!0)},p(e,i){let[o]=i;4&o&&ze(n,"d",e[2]),2&o&&r!==(r=(e[1]?"shepherd-modal-is-visible":"")+" shepherd-modal-overlay-container")&&ze(t,"class",r)},i:Re,o:Re,d(n){n&&Ue(t),e[11](null),i=!1,o()}}}function an(e,t,n){let{element:r,openingProperties:i}=t;Te();let o,a=!1,s=void 0;u();function u(){n(4,i={width:0,height:0,x:0,y:0,r:0})}function l(){n(1,a=!1),d()}function c(e,t,r,o){if(void 0===e&&(e=0),void 0===t&&(t=0),o){const{y:a,height:s}=function(e,t){const n=e.getBoundingClientRect();let r=n.y||n.top,i=n.bottom||r+n.height;if(t){const e=t.getBoundingClientRect(),n=e.y||e.top,o=e.bottom||n+e.height;r=Math.max(r,n),i=Math.min(i,o)}return{y:r,height:Math.max(i-r,0)}}(o,r),{x:u,width:l,left:c}=o.getBoundingClientRect();n(4,i={width:l+2*e,height:s+2*e,x:(u||c)-e,y:a-e,r:t})}else u()}function p(){n(1,a=!0)}const h=e=>{e.preventDefault()};function d(){s&&(cancelAnimationFrame(s),s=void 0),window.removeEventListener("touchmove",h,{passive:!1})}return e.$$set=e=>{"element"in e&&n(0,r=e.element),"openingProperties"in e&&n(4,i=e.openingProperties)},e.$$.update=()=>{16&e.$$.dirty&&n(2,o=function(e){let{width:t,height:n,x:r=0,y:i=0,r:o=0}=e;const{innerWidth:a,innerHeight:s}=window;return`M${a},${s}H0V0H${a}V${s}ZM${r+o},${i}a${o},${o},0,0,0-${o},${o}V${n+i-o}a${o},${o},0,0,0,${o},${o}H${t+r-o}a${o},${o},0,0,0,${o}-${o}V${i+o}a${o},${o},0,0,0-${o}-${o}Z`}(i))},[r,a,o,e=>{e.stopPropagation()},i,()=>r,u,l,c,function(e){d(),e.tour.options.useModalOverlay?(!function(e){const{modalOverlayOpeningPadding:t,modalOverlayOpeningRadius:n}=e.options,r=function e(t){if(!t)return null;const n=t instanceof HTMLElement&&window.getComputedStyle(t).overflowY;return"hidden"!==n&&"visible"!==n&&t.scrollHeight>=t.clientHeight?t:e(t.parentElement)}(e.target),i=()=>{s=void 0,c(t,n,r,e.target),s=requestAnimationFrame(i)};i(),window.addEventListener("touchmove",h,{passive:!1})}(e),p()):l()},p,function(e){et[e?"unshift":"push"](()=>{r=e,n(0,r)})}]}class sn extends xt{constructor(e){super(),wt(this,e,an,on,Ne,{element:0,openingProperties:4,getElement:5,closeModalOpening:6,hide:7,positionModal:8,setupForStep:9,show:10})}get getElement(){return this.$$.ctx[5]}get closeModalOpening(){return this.$$.ctx[6]}get hide(){return this.$$.ctx[7]}get positionModal(){return this.$$.ctx[8]}get setupForStep(){return this.$$.ctx[9]}get show(){return this.$$.ctx[10]}}const un=new v;Object.assign(un,{Tour:class extends v{constructor(e){void 0===e&&(e={}),super(e),y(this);this.options=Object.assign({},{exitOnEsc:!0,keyboardNavigation:!0},e),this.classPrefix=Ce(this.options.classPrefix),this.steps=[],this.addSteps(this.options.steps);return["active","cancel","complete","inactive","show","start"].map(e=>{(e=>{this.on(e,t=>{(t=t||{}).tour=this,un.trigger(e,t)})})(e)}),this._setTourID(),this}addStep(e,t){let n=e;return n instanceof rn?n.tour=this:n=new rn(this,n),m(t)?this.steps.push(n):this.steps.splice(t,0,n),n}addSteps(e){return Array.isArray(e)&&e.forEach(e=>{this.addStep(e)}),this}back(){const e=this.steps.indexOf(this.currentStep);this.show(e-1,!1)}cancel(){if(this.options.confirmCancel){const e=this.options.confirmCancelMessage||"Are you sure you want to stop the tour?";window.confirm(e)&&this._done("cancel")}else this._done("cancel")}complete(){this._done("complete")}getById(e){return this.steps.find(t=>t.id===e)}getCurrentStep(){return this.currentStep}hide(){const e=this.getCurrentStep();if(e)return e.hide()}isActive(){return un.activeTour===this}next(){const e=this.steps.indexOf(this.currentStep);e===this.steps.length-1?this.complete():this.show(e+1,!0)}removeStep(e){const t=this.getCurrentStep();this.steps.some((t,n)=>{if(t.id===e)return t.isOpen()&&t.hide(),t.destroy(),this.steps.splice(n,1),!0}),t&&t.id===e&&(this.currentStep=void 0,this.steps.length?this.show(0):this.cancel())}show(e,t){void 0===e&&(e=0),void 0===t&&(t=!0);const n=g(e)?this.getById(e):this.steps[e];if(n){this._updateStateBeforeShow();f(n.options.showOn)&&!n.options.showOn()?this._skipStep(n,t):(this.trigger("show",{step:n,previous:this.currentStep}),this.currentStep=n,n.show())}}start(){this.trigger("start"),this.focusedElBeforeOpen=document.activeElement,this.currentStep=null,this._setupModal(),this._setupActiveTour(),this.next()}_done(e){const t=this.steps.indexOf(this.currentStep);if(Array.isArray(this.steps)&&this.steps.forEach(e=>e.destroy()),function(e){if(e){const{steps:t}=e;t.forEach(e=>{e.options&&!1===e.options.canClickTarget&&e.options.attachTo&&e.target instanceof HTMLElement&&e.target.classList.remove("shepherd-target-click-disabled")})}}(this),this.trigger(e,{index:t}),un.activeTour=null,this.trigger("inactive",{tour:this}),this.modal&&this.modal.hide(),("cancel"===e||"complete"===e)&&this.modal){const e=document.querySelector(".shepherd-modal-overlay-container");e&&e.remove()}d(this.focusedElBeforeOpen)&&this.focusedElBeforeOpen.focus()}_setupActiveTour(){this.trigger("active",{tour:this}),un.activeTour=this}_setupModal(){this.modal=new sn({target:this.options.modalContainer||document.body,props:{classPrefix:this.classPrefix,styles:this.styles}})}_skipStep(e,t){const n=this.steps.indexOf(e);if(n===this.steps.length-1)this.complete();else{const e=t?n+1:n-1;this.show(e,t)}}_updateStateBeforeShow(){this.currentStep&&this.currentStep.hide(),this.isActive()||this._setupActiveTour()}_setTourID(){const e=this.options.tourName||"tour";this.id=`${e}--${Te()}`}},Step:rn});const ln="shepherd.guide_id",cn="shepherd.guide.current.step.id",pn="shepherd.guide.step.history",hn="shepherd.guide.pause";function dn(e,t,n,i,o,a,s){this.guideCancelSubscription=void 0,this.onPause=()=>{},this.onCancel=()=>{},this.startGuide=(e,t,r,i=!0)=>{if(i&&n.remove(pn),!t)return;const o=this._createGuide(e);this._addGuideSteps(o,t),this._startGuide(o,r)},this.resumeGuide=(e,t,r)=>{n.set(hn,!1),this.startGuide(e,t,r,!1)},this.isActive=()=>un.activeTour&&!this.isPaused(),this.isPaused=()=>"true"===n.get(hn),this.getGuideId=()=>n.get(ln),this.getCurrentStepId=()=>n.get(cn),this.subscribeToGuideCancel=e=>{angular.isFunction(e)&&(this.onCancel=e)},this.subscribeToGuidePause=e=>{angular.isFunction(e)&&(this.onPause=e)},this._createGuide=e=>(this._subscribeToGuideCanceled(),new un.Tour({name:e,useModalOverlay:!0,confirmCancel:!0,confirmCancelMessage:t.instant("guide.confirm.cancel.message"),defaultStepOptions:{classes:"shadow-md bg-purple-dark",scrollTo:!0}})),this._addGuideSteps=(e,t)=>{if(t.length>0&&e.addStep(this._getFirstStep(e,t)),t.length>2)for(let n=1;n<t.length-1;n++)e.addStep(this._getMiddleStep(e,t,n));t.length>1&&e.addStep(this._getLastStep(e,t))},this._startGuide=(o,s)=>{n.remove(hn);let u=o.steps.findIndex(e=>e.options.id===s);u<0&&(u=0);const l=o.steps[u],c=l.options.url;c&&(e.url(c),i.reload()),l.options.attachTo?r.GuideUtils.waitFor(l.options.attachTo.element,l.options.maxWaitTime).then(()=>o.show(u)).catch(e=>{console.log(e),a.error(t.instant("guide.start.unexpected.error.message"))}):o.show(u)},this._subscribeToGuideCanceled=()=>{this.guideCancelSubscription||(this.guideCancelSubscription=un.on("cancel",()=>{this._clearLocaleStorage();const e=un.activeTour.getCurrentStep();e&&angular.isFunction(e.hide)&&e.hide(),this.onCancel&&this.onCancel()}))},this._getFirstStep=function(e,t){const n=t.length>1?t[1]:void 0;return this._toGuideStep(e,void 0,t[0],n)},this._getMiddleStep=(e,t,n)=>this._toGuideStep(e,t[n-1],t[n],t[n+1]),this._getLastStep=(e,t)=>{const n=this._toGuideStep(e,null,t[t.length-1]);return n.buttons.push(this._getBackToGuidesButton(e)),n.buttons.push(this._getCancelButton(e)),n},this._getBackToGuidesButton=e=>this._getButton(t.instant("back.to.guides.btn"),()=>this._backToGuidesButton(e),!0),this._getCancelButton=e=>this._getButton(t.instant("common.close"),()=>this._cancelGuide(e,!1),!0),this._backToGuidesButton=t=>{e.path("guides"),this._cancelGuide(t,!1)},this._cancelGuide=(e,t=!0)=>{e.options.confirmCancel=t,e.cancel(),this.onCancel()&&this.onCancel()},this._toGuideStep=(e,n,r,i)=>{const o=this._toBaseGuideStep(e,t,r,()=>this._updateLocalStorage()),a=[];return r.skipPoint&&a.push(this._getSkipButton(e)),n&&a.push(this._getPreviousButton(e)),i&&a.push(this._getNextButton(e,r,i)),o.buttons=a,o},this._getPauseButton=e=>this._getButton(t.instant("pause.btn"),()=>this._pauseGuide(e),!0),this._getSkipButton=e=>this._getButton(t.instant("skip.btn"),()=>this._skipSteps(e),!0),this._skipSteps=e=>{const t=e.getCurrentStep(),n=e.steps.findIndex(e=>t.id===e.id);this._startGuide(e,this._getNextSkipPointId(e.steps,n))},this._getNextSkipPointId=(e,t)=>{for(let n=t+1;n<e.length;n++){const t=e.at(n);if(t.options.skipPoint)return t.id}return e.at(e.length-1).id},this._pauseGuide=e=>{e.hide();const t=this._getStepWhichCanBePaused(e.steps,e.getCurrentStep().id);this._saveStep(t),n.set(hn,!0);let r=!1;for(;!r;){const e=this._getHistory();e&&e.length>0&&e.at(e.length-1)!==t.options.id?this._removeLastStepFromHistory():r=!0}this.onPause()&&this.onPause()},this._getStepWhichCanBePaused=(e,t)=>{const n=e.findIndex(e=>e.id===t),r=e[n];return r.options.canBePaused?r:n>0?this._getStepWhichCanBePaused(e,e[n-1].id):void 0},this._getPreviousButton=e=>{const n=t.instant("previous.btn"),r=this._getPreviousButtonAction(e);return this._getButton(n,r)},this._getPreviousButtonAction=n=>()=>{const i=this._getPreviousStepIdFromHistory();let o;o=-1===i?n.steps.at(0):n.steps.find(e=>e.options.id===i);const s=n.getCurrentStep();s.hide(),s.options.initPreviousStep({GuideUtils:r.GuideUtils,ShepherdService:this},s.options.id).then(()=>{angular.isFunction(s.options.onPreviousClick)?s.options.onPreviousClick(n).then(e=>{!angular.isUndefined(e)&&null!==e&&e||(s.hide(),n.show(o.id))}).catch(e=>{console.log(e),a.error(t.instant("guide.unexpected.error.message")),this._cancelGuide(n,!1)}):((o.options.forceReload||o.options.url&&o.options.url!==s.options.url)&&e.path(o.options.url),s.hide(),n.show(o.id))}).catch(e=>{console.log(e),a.error(t.instant("guide.unexpected.error.message")),this._cancelGuide(n,!1)})},this._getNextButton=(e,n,r)=>{const i=t.instant("next.btn"),o=u(e,n,r);return this._getButton(i,o)};const u=(n,r,i)=>()=>{let o=!0;if(angular.isFunction(r.onNextValidate)&&(o=r.onNextValidate(r)),o)if(angular.isFunction(r.onNextClick)){const e=r.onNextClick(n,r);e instanceof Promise&&e.catch(e=>{console.log(e),a.error(t.instant("guide.unexpected.error.message")),this._cancelGuide(n,!1)})}else(i.forceReload||i.url&&i.url!==r.url)&&e.path(i.url),n.next()};this._updateLocalStorage=()=>{const e=un.activeTour;if(!e)return;const t=e.getCurrentStep(),n=e.steps.findIndex(e=>e.id===t.id),r=this.getCurrentStepId(),i=e.steps.findIndex(e=>e.id===r);n>i?this._addStepToHistory(t):i>n&&this._removeLastStepFromHistory(),this._saveStep(t)},this._saveStep=e=>{e&&(n.set(ln,e.tour.options.name),n.set(cn,e.options.id))},this._addStepToHistory=e=>{const t=this._getHistory();t.push(e.options.id),n.set(pn,t)},this._getHistory=()=>{const e=n.get(pn);return e||[]},this._removeLastStepFromHistory=()=>{const e=this._getHistory();e.splice(e.length-1,1),n.set(pn,e)},this._getPreviousStepIdFromHistory=e=>{const t=this._getHistory()||[];if(e){const n=t.findIndex(t=>t===e);if(n>0)return t.at(n-1)}else if(t.length>1)return t.at(t.length-2);return-1},this.getPreviousStepFromHistory=e=>{const t=this._getPreviousStepIdFromHistory(e);return un.activeTour.steps.find(e=>e.id===t)},this._clearLocaleStorage=()=>{n.remove(ln),n.remove(hn),n.remove(cn),n.remove(pn)},this._toBaseGuideStep=(e,t,n,i)=>{let a;n.elementSelector&&(a={element:n.elementSelector,on:n.placement});const s=r.GuideUtils.unescapeHtml(r.GuideUtils.translateLocalMessage(t,o,n.title,n));let u="";if(n.stepsTotalN>1){const e=document.createElement("span");e.setAttribute("gdb-tooltip",t.instant("guide.block.progress.tooltip",{action:s})),e.setAttribute("tooltip-placement","bottom"),e.innerText=t.instant("guide.block.progress",{n:n.stepN+1,nn:n.stepsTotalN}),u="&nbsp;&mdash;&nbsp;"+e.outerHTML}const l="readonly"!==n.type,c=n.extraPadding?n.extraPadding:0,p={id:n.id,title:s+u,text:()=>{const e=this._toParagraph(r.GuideUtils.translateLocalMessage(t,o,n.content,n));let i="";return n.extraContent&&(i=r.GuideUtils.translateLocalMessage(t,o,n.extraContent,n),i=this._toParagraph(i,n.extraContentClass)),e+i},url:n.url,maxWaitTime:n.maxWaitTime,cancelIcon:{enabled:!0},attachTo:a,modalOverlayOpeningPadding:c,modalOverlayOpeningRadius:0,canBePaused:n.canBePaused,advanceOn:n.advanceOn,showOn:n.showOn,scrollToHandler:n.scrollToHandler,classes:"guide-dialog",beforeShowPromise:n.beforeShowPromise,canClickTarget:l,keyboardNavigation:!1,skipPoint:n.skipPoint,onPreviousClick:n.onPreviousClick,initPreviousStep:n.initPreviousStep,when:{show:this._getShowFunction(e,n,i)}};return angular.isFunction(n.hide)&&(p.when.hide=n.hide(e)),p},this._getShowFunction=(e,t,n)=>angular.isFunction(t.show)?()=>{t.show(e)(),n(),this._whenStepShow(t)}:()=>{n(),this._whenStepShow(t)},this._whenStepShow=e=>{const t=un.activeTour.getCurrentStep(),n=t.getElement();this._addTotalProgress(t,n),this._addTypeIcon(n,e);const r=angular.element(n).scope();angular.isFunction(e.onScope)&&e.onScope(r),setTimeout(()=>r.$apply(()=>s(n)(r)))},this._toParagraph=(e,t)=>{if(e){const n=document.createElement("p");return t&&(n.className=t),n.innerHTML=e,n.outerHTML}return""},this._addTotalProgress=(e,n)=>{const r=un.activeTour.steps,i=n.querySelector(".shepherd-content"),o=document.createElement("div");o.className="shepherd-progress";const a=document.createElement("span");a.className="text-muted",a.innerText=t.instant("guide.total.progress",{n:r.indexOf(e)+1,nn:r.length}),a.setAttribute("gdb-tooltip",t.instant("guide.total.progress.tooltip")),a.setAttribute("tooltip-placement","left"),o.appendChild(a),i.appendChild(o)},this._addTypeIcon=(e,n)=>{let r,i;switch(n.type){case"clickable":r="focus",i="mouse";break;case"input":r="edit",i="input";break;default:r="info",i="info"}const o=document.createElement("span");o.className="shepherd-step-type icon-"+r+" icon-1-25x",o.setAttribute("gdb-tooltip",t.instant("guide.step-type."+i)),o.setAttribute("tooltip-placement","bottom-right"),angular.element(e.querySelector(".shepherd-header")).prepend(o)},this._getButton=(e,t,n)=>{const r={text:e,classes:n?"btn btn-secondary":"btn btn-primary",action:e=>{e.stopPropagation(),t()}};return r}}angular.module("graphdb.framework.guides.shepherd.services",["graphdb.framework.utils.localstorageadapter"]).service("ShepherdService",dn),dn.$inject=["$location","$translate","LocalStorageAdapter","$route","$interpolate","toastr","$compile"]},function(e,t){angular.module("graphdb.framework.rest.license.service",["ngFileUpload"]).factory("LicenseRestService",r),r.$inject=["$http","Upload"];const n="rest/graphdb-settings/license";function r(e,t){return{getLicenseInfo:function(){return e.get(n)},getHardcodedLicense:function(){return e.get(n+"/hardcoded")},sendLicenseToValidate:function(t){return e.post("rest/info/license/validate",t,{headers:{Accept:"application/json","Content-Type":"text/plain"}})},extractFromLicenseFile:function(e){return t.upload({url:"rest/info/license/to-base-64",file:e,headers:{Accept:"text/plain"}})},checkLicenseHardcoded:function(){return e.get(n+"/hardcoded")},registerLicense:function(t){const r=new Uint8Array(t.length);for(let e=0;e<r.length;e++)r[e]=t.charCodeAt(e);return e({method:"POST",url:n,headers:{"Content-Type":"application/octet-stream"},data:r,transformRequest:[]})},unregisterLicense:function(){return e({method:"DELETE",url:"rest/graphdb-settings/license"})},getInfo:function(){return e.get("rest/info/properties")},getVersion:function(t){return e.get("rest/info/version",{headers:{"X-GraphDB-Repository-Location":t}})},getStatistics:function(){return e.get("rest/graphdb-settings/statistics")},toggleStatistics:function(t){return e({method:"POST",url:"rest/graphdb-settings/statistics",headers:{"Content-Type":"application/x-www-form-urlencoded"},data:"enabled="+t})}}}},function(e,t){angular.module("graphdb.framework.rest.repositories.service",[]).factory("RepositoriesRestService",n),n.$inject=["$http"];function n(e){return{getRepositories:function(t){return e.get("rest/repositories/all",{params:{location:t}})},getRepository:function(t){return e.get("rest/repositories/"+t.id,{params:{location:t.location}})},deleteRepository:function(t){return e.delete("rest/repositories/"+t.id,{params:{location:t.location}})},createRepository:function(t){return e.post("rest/repositories",t)},editRepository:function(t,n){return e.put("rest/repositories/"+t,n)},getRepositoryConfiguration:function(t){return e.get("rest/repositories/default-config/"+t)},getSize:function(t){return e.get(`rest/repositories/${t.id}/size`,{params:{location:t.location}})},getPrefix:function(t,n){return e.post(`rest/repositories/${t}/prefix`,null,{params:n})},getCluster:function(){return e.get("rest/repositories/cluster")},getRepositoryFileContent:function(t){return e.get("rest/repositories/file",{params:{fileLocation:t}})},updateRepositoryFileContent:function(t,n,r){return e.post("rest/repositories/file/update",JSON.stringify(n),{params:{fileLocation:t,location:r}})},validateOntopPropertiesConnection:function(t){return e.post("rest/repositories/ontop/test-connection",t.params.propertiesFile,{params:{location:t.location}})},restartRepository:function(t){return e.post(`rest/repositories/${t.id}/restart`,null,{params:{location:t.location}})},getSupportedDriversData:function(t){return e.get("rest/repositories/ontop/drivers",{params:{location:t.location}})},updatePropertiesFile:function(t,n,r,i){return e.post("rest/repositories/ontop/jdbc-properties",JSON.stringify(n),{params:{fileLocation:t,location:r,driverType:i}})},loadPropertiesFile:function(t,n,r){return e.get("rest/repositories/ontop/jdbc-properties",{params:{fileLocation:t,location:n,driverType:r}})},getRepositoriesFromKnownLocation:function(t){return e.get("rest/repositories?location="+t)},getRepositoryTurtleConfig:function(t){return e.get("rest/repositories/"+t.id,{headers:{Accept:"text/turtle"}})}}}},function(e,t,n){"use strict";n.r(t),n.d(t,"mapBackupAndRestoreResponseToModel",(function(){return o})),n.d(t,"mapSnapshotOptionsResponseToModel",(function(){return a}));var r=n(16),i=n(17);const o=e=>{const t=[],n=new r.BackupAndRestoreInfo;return 0===Object.keys(e).length||(n.id=e.id,n.username=e.username,n.operation=e.operation,n.affectedRepositories=e.affectedRepositories,n.secondsSinceCreated=e.msSinceCreated/1e3,n.snapshotOptions=a(e.snapshotOptions),n.nodePerformingClusterBackup=e.nodePerformingClusterBackup,t.push(n)),t},a=e=>{const t=new i.SnapshotOptionInfo;return t.withRepositoryData=e.withRepositoryData,t.withSystemData=e.withSystemData,t.withClusterData=e.withClusterData,t.cleanDataDir=e.cleanDataDir,t.removeCluster=e.removeCluster,t.repositories=e.repositories,t.replicationTimeoutMs=e.replicationTimeoutMs,t}},function(e,t,n){"use strict";n.r(t),n.d(t,"BackupAndRestoreInfo",(function(){return r}));class r{constructor(){this.id=void 0,this.username="",this.operation="",this.affectedRepositories=[],this.secondsSinceCreated=0,this.snapshotOptions=[],this.nodePerformingClusterBackup=""}}},function(e,t,n){"use strict";n.r(t),n.d(t,"SnapshotOptionInfo",(function(){return r}));class r{constructor(){this.withRepositoryData=!1,this.withSystemData=!1,this.withClusterData=!1,this.cleanDataDir=!1,this.removeCluster=!1,this.repositories=[],this.replicationTimeoutMs=0}}},function(e,t,n){"use strict";n.r(t),n.d(t,"mapActiveOperationResponseToModel",(function(){return u})),n.d(t,"mapActiveOperationToActiveOperationInfoModel",(function(){return c})),n.d(t,"mapImportActiveOperationToActiveOperationInfoModel",(function(){return p})),n.d(t,"mapQueriesActiveOperationToActiveOperationInfoModel",(function(){return h})),n.d(t,"mapBackupAndRestoreActiveOperationToActiveOperationInfoModel",(function(){return d})),n.d(t,"mapClusterActiveOperationToActiveOperationInfoModel",(function(){return f}));var r=n(3),i=n(8),o=n(1),a=n(19),s=n(9);const u=e=>{const t=new a.ActiveOperationsModel;return t.status=e.status,t.operations=l(e.allRunningOperations),t},l=(e=[])=>{const t=[];return e.forEach(e=>t.push(c(e))),t},c=e=>{switch(e.type){case r.OPERATION_TYPE.IMPORTS:return p(e);case r.OPERATION_TYPE.QUERIES:case r.OPERATION_TYPE.UPDATES:return h(e);case r.OPERATION_TYPE.BACKUP_RESTORE:return d(e);case r.OPERATION_TYPE.CLUSTER_STATUS:return f(e)}},p=e=>{const t=new i.ActiveOperationModel;return t.operationGroup=o.OPERATION_GROUP_TYPE.IMPORT_OPERATION,t.runningOperationCount=parseInt(e.value,10),t.status=e.status,t.type=e.type,t.titleLabelKey=e.type,t.monitoringViewUrl=s.OPERATION_MONITORING_CONSTANTS.IMPORT_MONITORING_URL,t},h=e=>{const t=new i.ActiveOperationModel;return t.operationGroup=o.OPERATION_GROUP_TYPE.QUERIES_OPERATION,t.runningOperationCount=parseInt(e.value,10),t.status=e.status,t.type=e.type,t.titleLabelKey=e.type,t.monitoringViewUrl=s.OPERATION_MONITORING_CONSTANTS.QUERIES_MONITORING_URL,t},d=e=>{const t=new i.ActiveOperationModel;return t.operationGroup=o.OPERATION_GROUP_TYPE.BACKUP_AND_RESTORE_OPERATION,t.status=e.status,t.type=e.type,t.titleLabelKey=e.value,t.monitoringViewUrl=s.OPERATION_MONITORING_CONSTANTS.BACKUP_AND_RESTORE_MONITORING_URL,t},f=e=>{const t=new i.ActiveOperationModel;return t.operationGroup=o.OPERATION_GROUP_TYPE.CLUSTER_OPERATION,t.status=e.status,t.type=e.type,t.titleLabelKey=e.value,t.monitoringViewUrl=s.OPERATION_MONITORING_CONSTANTS.CLUSTER_MONITORING_URL,t}},function(e,t,n){"use strict";n.r(t),n.d(t,"ActiveOperationsModel",(function(){return o}));var r=n(4),i=n(1);class o{constructor(){this.operations=[],this.status=r.OPERATION_STATUS.INFORMATION}hasClusterOperation(){return!!this.operations&&this.operations.some(e=>i.OPERATION_GROUP_TYPE.CLUSTER_OPERATION===e.operationGroup)}}},function(e,t,n){"use strict";n.r(t),n.d(t,"SequenceGeneratorUtil",(function(){return r}));class r{static getFibonacciSequenceGenerator(){return r.fibonacciSequenceGenerator()}static fibonacciSequenceGenerator(){let e=0,t=1;return{next:function(){const n=t;return t=e+t,e=n,n},reset:function(){e=0,t=1}}}}},function(e,t,n){"use strict";n.r(t),n.d(t,"mapUriAsNtripleAutocompleteResponse",(function(){return r}));const r=e=>e&&e.data&&e.data.suggestions?e.data.suggestions.map(e=>({type:e.type,value:e.value,description:e.description})):[]},function(e,t,n){"use strict";n.r(t);n(7),n(14),n(31),n(13),n(53),n(54);angular.module("graphdb.framework.core.services.repositories",["ngCookies","graphdb.framework.rest.repositories.service","graphdb.framework.rest.locations.service","graphdb.framework.rest.license.service","toastr"]).service("$repositories",["toastr","$rootScope","$timeout","$location","productInfo","$jwtAuth","RepositoriesRestService","LocationsRestService","LicenseRestService","$translate","$q","LocalStorageAdapter","LSKeys",function(e,t,n,r,i,o,a,s,u,l,c,p,h){this.location={uri:"",label:"Local",local:!0,isInCluster:!1},this.locationError="",this.loading=!0,this.locations=[this.location],this.repositories=new Map,this.locationsShouldReload=!0;const d=this,f=function(t,n){d.loading=!1,t&&(d.location={},d.locationError=n,d.repositories=new Map,d.setRepository(""),t.statusText?e.error(t.statusText,l.instant("repositories.service.error.loading.location")):e.error(l.instant("repositories.service.error.loading.location")))};let g;this.resetActiveRepository=function(){const e=this.getActiveRepositoryObjectFromStorage(),n=d.repositories.get(e.location);let r=!1;n&&(r=n.find(t=>t.id===e.id)),r?o.canReadRepo(e)?t.$broadcast("repositoryIsSet",{newRepo:!1}):this.setRepository(""):this.setRepository(this.location.defaultRepository?{id:this.location.defaultRepository,location:this.location.uri}:"")},this.checkLocationsDegraded=function(e){this.locations.forEach(t=>{t.local||(t.errorMsg&&d.repositories.delete(t.uri)&&d.resetActiveRepository(),u.getVersion(t.uri).success((function(e){"object"==typeof e?e.productVersion!==i.productVersion&&(t.degradedReason=l.instant("repositories.service.different.gdb.version",{location:t.name})):t.degradedReason=l.instant("repositories.service.different.gdb.version",{location:t.name})})).error((function(n){t.errorMsg=n,e||(d.locationsShouldReload=!0)})))})},this.getDegradedReason=function(){const e=this.getActiveRepositoryObjectFromStorage(),t=this.locations.find(t=>t.uri===e.location);return t?t.degradedReason:""},this.clearLocationErrorMsg=function(e){const t=this.locations.find(t=>t.uri===e);t&&t.errorMsg&&(t.errorMsg=null)},this.initQuick=function(){this.hasActiveLocation()&&this.init(null,null,!0)},this.init=function(e,n,r){return this.loading=!0,r||(this.locationsShouldReload=!0),s.getActiveLocation().then((function(i){if(i.data){const o=i.data;if(o.active)return a.getRepositories().then((function(n){d.location=o,Object.entries(n.data).forEach(([e,t])=>{d.clearLocationErrorMsg(e),d.repositories.set(e,t)}),d.resetActiveRepository(),f(),d.checkLocationsDegraded(r),t.globalLocation=d.location,t.globalRepositories=d.getRepositories(),e&&e()})).catch((function(e){f(e),n&&n()}))}else f(),r&&(d.locationsShouldReload=!0),d.location="",d.repositories=new Map,d.setRepository("");t.globalLocation=d.location,t.globalRepositories=d.getRepositories()})).catch((function(e){f(e),n&&n()}))},this.getLocations=function(e){if(this.locationsShouldReload||g)return g||(this.locationsShouldReload=!1,this.locations=[this.location],g=s.getLocations(e,!0).then(e=>(d.locations=e.data,this.locations)).catch((function(){n((function(){d.locationsShouldReload=!0}),2e3)})).finally(()=>{g=null})),g;const t=c.defer();return t.resolve(this.locations),t.promise},this.getActiveLocation=function(){return this.location},this.hasActiveLocation=function(){return!_.isEmpty(this.location)},this.getLocationError=function(){return this.locationError?this.locationError:l.instant("repositories.service.no.active.location")},this.isLoadingLocation=function(){return this.loading},this.getRepositories=function(){const e=[];return this.repositories.forEach(t=>e.push.apply(e,t)),e},this.getReadableRepositories=function(){return _.filter(this.getRepositories(),(function(e){return o.canReadRepo(e)}))},this.getWritableRepositories=function(){const e=this;return _.filter(this.getRepositories(),(function(t){return o.canWriteRepo(t)&&!e.isActiveRepoOntopType(t)}))},this.getActiveRepositoryObjectFromStorage=function(){return{id:p.get(h.REPOSITORY_ID)||"",location:p.get(h.REPOSITORY_LOCATION)||""}},this.getActiveRepository=function(){return p.get(h.REPOSITORY_ID)||void 0},this.getActiveRepositoryObject=function(){const e=this.getActiveRepositoryObjectFromStorage(),t=this.repositories.get(e.location);return t?t.find(t=>t.id===e.id):null},this.isSystemRepository=function(){return"SYSTEM"===this.getActiveRepositoryObjectFromStorage().id},this.isActiveRepoOntopType=function(e){const t=this;let n;return e||(e=t.getActiveRepositoryObject()),e&&(n=t.repositories.get(e.location).find(t=>t.id===e.id),n)?"graphdb:OntopRepository"===n.sesameType:void 0===n},this.isActiveRepoFedXType=function(){const e=this,t=e.getActiveRepositoryObject();let n;return t&&(n=e.repositories.get(t.location).find(e=>e.id===t.id),n)?"graphdb:FedXRepository"===n.sesameType:void 0===n},this.getLocationFromUri=function(e){return this.locations.find(t=>t.uri===e)},this.setRepositoryHeaders=function(e){$.ajaxSetup().headers=$.ajaxSetup().headers||{},$.ajaxSetup().headers["X-GraphDB-Repository"]=e?e.id:void 0,$.ajaxSetup().headers["X-GraphDB-Repository-Location"]=e?e.location:void 0},this.setRepository=function(e){e?(p.set(h.REPOSITORY_ID,e.id),p.set(h.REPOSITORY_LOCATION,e.location)):(p.remove(h.REPOSITORY_ID),p.remove(h.REPOSITORY_LOCATION)),this.setRepositoryHeaders(e),t.$broadcast("repositoryIsSet",{newRepo:!0}),e&&!o.canReadRepo(e)&&this.setRepository(""),t.deniedPermissions={}},this.getDefaultRepository=function(){return this.hasActiveLocation()?this.location.defaultRepository:""},this.setDefaultRepository=function(t){if(!this.hasActiveLocation())return void e.error(l.instant("repositories.service.no.active.location"),l.instant("common.error"));const n=this;s.setDefaultRepository(t).success((function(){n.location.defaultRepository=t})).error((function(t){const n=getError(t);e.error(n,l.instant("common.error"))}))},this.deleteLocation=function(t){return s.deleteLocation(encodeURIComponent(t)).success((function(){const e=d.getActiveRepositoryObject();e&&e.location===t&&(d.location="",d.setRepository("")),d.init()})).error((function(t){const n=getError(t);e.error(n,l.instant("common.error"))}))},this.deleteRepository=function(t){return a.deleteRepository(t).success((function(){d.init()})).error((function(t){const n=getError(t);e.error(n,l.instant("common.error"))})).finally(()=>{const e=d.getActiveRepositoryObject();e&&e.id===t.id&&e.location===t.location&&d.setRepository("")})},this.restartRepository=function(t){return a.restartRepository(t).success((function(){e.success(l.instant("repositories.service.restarting.repo",{repositoryId:t.id})),d.initQuick()})).error((function(t){const n=getError(t);e.error(n,l.instant("common.error"))}))},this.getRepositoryTurtleConfig=function(e){return a.getRepositoryTurtleConfig(e)},this.isRepoActive=function(e){const t=this.getActiveRepositoryObjectFromStorage();return!!t.id&&(e.id===t.id&&e.location===t.location)},this.getRepositoriesFromLocation=function(e){return this.repositories.get(e)},t.$on("securityInit",(function(e,t,r,i){g=null,(!t||r||i)&&n((function(){d.init()}))})),t.$on("reloadLocations",(function(){d.locationsShouldReload=!0,d.getLocations().then(()=>d.initQuick())}))}])},function(e,t,n){"use strict";n.r(t);n(10);var r=n(0);function i(){return{template:function(e,t){return'<object width="'+t.size+'" height="'+t.size+'" data="js/angular/templates/loader/ot-loader.svg?v=10.5.1">{{\'common.loading\' | translate}}</object>'}}}function o(){return{template:function(e,t){return'<object width="'+t.size+'" height="'+t.size+'" data="js/angular/templates/loader/ot-loader.svg?v=10.5.1"></object><div>{{\'common.loading\' | translate}}<div>'}}}function a(e){const t=function(e,n){n.timer=void 0,n.currentMessage=n.getMessage();const r=n.timeout[n.index%n.timeout.length];r&&(n.timer=e((function(){(n.index+1<n.message.length||0===n.message.length)&&(n.index++,t(e,n))}),1e3*r))};return{restrict:"EA",scope:{size:"@",trigger:"@",messageAttr:"=*message",timeoutAttr:"=*timeout",ngShow:"=",ngHide:"="},link:function(n){n.message=n.messageAttr,n.getMessage=function(){return n.message[n.index]},void 0===n.message?n.message=[""]:"function"==typeof n.message?(n.getMessage=n.message,n.message=[]):"object"!=typeof n.message&&(n.message=[n.message]),n.timeout=n.timeoutAttr,void 0===n.timeout?n.timeout=[0]:"object"!=typeof n.timeout&&(n.timeout=[n.timeout]),n.index=0,t(e,n);const r=function(r){n.timer&&e.cancel(n.timer),r&&(n.index=0,t(e,n))};n.$watch("ngShow",(function(e){r(e)})),n.$watch("ngHide",(function(e){r(!e)})),n.$on("$destroy",(function(){n.timer&&e.cancel(n.timer)}))},template:'<div class="ot-loader-new-content"><img width="{{size}}" height="{{size}}" src="js/angular/templates/loader/ot-loader.svg?v=10.5.1"/><div style="font-size: {{size/4}}px">{{currentMessage}}<div></div>'}}function s(e){return{restrict:"EA",transclude:!0,templateUrl:"js/angular/core/templates/core-errors.html",link:function(t,n,r){let i;t.setAttrs(r),t.setRestricted(),t.showRemoteLocations=!1,t.toggleShowRemoteLocations=()=>{t.showRemoteLocations=!t.showRemoteLocations},t.getAccessibleRepositories=function(){let e=e=>!0;return t.showRemoteLocations||(e=e=>e.local),t.isRestricted?t.getWritableRepositories().filter(e):t.getReadableRepositories().filter(e)},t.showPopoverForRepo=function(n,r){t.hidePopoverForRepo(),t.setPopoverRepo(r),e((function(){const e=$(n.toElement).find(".popover-anchor")[0];i=e,e&&!t.getActiveRepository()&&e.dispatchEvent(new Event("show"))})),n.stopPropagation()},t.hidePopoverForRepo=function(t){if(t){let e=t.relatedTarget;for(;e;){if(0===e.className.indexOf("popover"))return;e=e.parentElement}}i&&e((function(){i&&(i.dispatchEvent(new Event("hide")),i=null)})),t&&t.stopPropagation()}}}}function u(){return function(e,t){$(t).click((function(e){e.preventDefault(),e.stopPropagation()}))}}function l(){return{restrict:"A",require:"ngModel",link:function(e,t,n,r){e.multiRequired||(e.multiRequired=[]);const i=n.multiRequireElement,o=function(t){i&&i%1==0&&(e.multiRequired[i-1]=t)},a=function(){let t=!1,n=!1;for(let r=0;r<e.multiRequired.length;r++)e.multiRequired[r]?t=!0:n=!0;r.$setValidity("multiRequire",!(t&&n))};r.$parsers.unshift((function(e){return o(e),a(),e})),r.$formatters.unshift((function(e){return o(e),a(),e})),$("[multi-required]").on("blur keyup change focusout",(function(){a()}))}}}angular.module("graphdb.framework.core.directives",["graphdb.framework.core.services.repositories","graphdb.framework.utils.localstorageadapter"]).directive("ontoLoader",i).directive("ontoLoaderFancy",o).directive("ontoLoaderNew",a).directive("coreErrors",s).directive("eatClick",u).directive("multiRequired",l).directive("searchResourceInput",p).directive("keyboardShortcuts",h).directive("inactivePluginDirective",d),i.$inject=[],o.$inject=[],a.$inject=["$timeout"],s.$inject=["$timeout"],u.$inject=[],l.$inject=[];const c={table:"table",visual:"visual"};function p(e,t,n,i,o,a,s,u,l,p,h,d){return{restrict:"EA",scope:{namespacespromise:"=",autocompletepromisestatus:"=",textButton:"@",visualButton:"@",textCallback:"&",visualCallback:"&",placeholder:"@",uriValidation:"@",preserveInput:"@",empty:"=",clear:"=?clear",openInNewTab:"@",preserveSearch:"@",radioButtons:"@",clearInputIcon:"@"},templateUrl:"js/angular/core/templates/search-resource-input.html",link:function(f,g,m){g.autoCompleteStatus=void 0,g.autoCompleteWarning=!1,f.empty=!1,f.clear=!1,f.searchDisplayType=c;const v="true"===f.preserveSearch,y=g.find(".view-res-input");let b,w;f.textButtonLabel=f.textButton||"query.editor.table.btn",f.visualButtonLabel=f.visualButton||"query.editor.visual.btn",f.showClearInputIcon=!1,f.searchType=u.get(l.RDF_SEARCH_TYPE)||c.table,f.searchInput="",f.changeSearchType=function(e){f.searchType=e,u.set(l.RDF_SEARCH_TYPE,f.searchType)},f.$on("addStartFixedNodeAutomatically",(function(e,t){f.searchInput||!t.startIRI?f.checkIfValidAndSearchText():f.visualCallback({uri:t.startIRI,label:""})})),f.clearInput=function(){f.searchInput="",f.selectedElementIndex=-1,f.autoCompleteUriResults=[],f.showClearInputIcon=!1,u.remove(l.RDF_SEARCH_INPUT),u.remove(l.RDF_SEARCH_EXPANDED_URI),u.remove(l.RDF_RESOURCE_DESCRIPTION)},f.$watch("namespacespromise",(function(){angular.isDefined(f.namespacespromise)&&f.namespacespromise.success((function(e){g.namespaces=e.results.bindings.map((function(e){return{prefix:e.prefix.value,uri:e.namespace.value}}))})).error((function(e){const n=getError(e);t.error(n,h.instant("error.getting.namespaces.for.repo"))}))})),f.$watch("autocompletepromisestatus",(function(){!p.isActiveRepoFedXType()&&angular.isDefined(f.autocompletepromisestatus)&&f.autocompletepromisestatus.success((function(e){g.autoCompleteStatus=!!e,""!==f.searchInput&&f.onChange()})).error((function(){t.error(h.instant("explore.error.autocomplete"))}))})),f.$watch("empty",(function(){v||(f.searchInput="",f.empty=!1)})),f.$watch("clear",(function(){f.clear&&(f.clearInput(),f.clear=!1)})),o.$on("$translateChangeSuccess",(function(){m.$attr.placeholder?f.placeholder=m.$attr.placeholder:f.placeholder=h.instant("search.resources.msg")+"..."}));const x=function(t){const n=t.type||"uri";"true"===f.openInNewTab?E(!1,t):e.path("resource").search(n,t.uri)},S=function(t){const n=t.type||"uri";"true"===f.openInNewTab?E(!0,t):e.path("graphs-visualizations").search(n,t.uri)},E=function(e,t){const n=e?"graphs-visualizations":"resource";window.open(`${n}?uri=${encodeURIComponent(t.uri)}`)};angular.isUndefined(m.$attr.textCallback)&&(f.textCallback=x),angular.isUndefined(m.$attr.visualCallback)&&(f.visualCallback=S),m.$attr.textButton&&!f.textButton?f.textCallback=f.visualCallback:m.$attr.visualButton&&!f.visualButton&&(f.visualCallback=f.textCallback),m.$attr.placeholder?f.placeholder=m.$attr.placeholder:f.placeholder=h.instant("search.resources.msg")+"...",angular.isDefined(m.$attr.uriValidation)?f.uriValidation=m.$attr.uriValidation:f.uriValidation="true",angular.isDefined(m.$attr.preserveInput)&&(f.preserveInput=m.$attr.preserveInput),f.getResultItemHtml=function(e){return s.trustAsHtml(e.description)},f.searchRdfResource=function(e,t){if("prefix"===e.type)f.searchInput=D(e.value+":"),y.focus(),f.onChange();else{let n;n=angular.isUndefined(e)?f.searchInput:"object"==typeof e?e.value:e;let r="";if(e.description){const t=e.description.indexOf("&lt;"+n+"&gt;");t>0&&(r=e.description.substring(0,t).replace(/<\/?b>/g,""))}t({uri:n,description:e.description,label:r,type:e.type}),v?(f.selectedElementIndex=f.activeSearchElm,u.set(l.RDF_SEARCH_EXPANDED_URI,b),u.set(l.RDF_SEARCH_INPUT,f.searchInput),u.set(l.RDF_RESOURCE_DESCRIPTION,e.description)):"true"===f.preserveInput?(f.searchInput=n,f.autoCompleteUriResults=[]):(f.searchInput="",f.autoCompleteUriResults=[])}},f.searchRdfResourceByEvent=function(e,t){f.searchType===c.visual||t.ctrlKey||t.metaKey?f.searchRdfResource(e,f.visualCallback):f.searchRdfResource(e,f.textCallback)};const A=function(e){const n=f.searchInput;""!==n?"false"!==f.uriValidation?g.autoCompleteStatus&&f.autoCompleteUriResults&&f.autoCompleteUriResults.length>0?"prefix"===f.autoCompleteUriResults[f.activeSearchElm].type?(f.searchInput=D(f.autoCompleteUriResults[f.activeSearchElm].value+":"),f.autoCompleteUriResults=[]):f.searchRdfResource(f.autoCompleteUriResults[f.activeSearchElm],e):C(n)?f.searchRdfResource(n,e):t.error(h.instant("invalid.uri.msg")):f.searchRdfResource(n,e):t.error(h.instant("fill.input.field.msg"))};function F(){let e=-1;const n=u.get(l.RDF_RESOURCE_DESCRIPTION);n&&f.autoCompleteUriResults&&(e=f.autoCompleteUriResults.findIndex(e=>e.description===n),f.selectedElementIndex=e,new Promise(e=>{const t=document.getElementById("auto-complete-results-wrapper").getBoundingClientRect();setTimeout(()=>{e(t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth))})}).then((function(){!function(){const e=$("#auto-complete-results-wrapper"),t=$("#auto_"+f.selectedElementIndex);e.animate({scrollTop:t.offset().top-e.offset().top+e.scrollTop()})}()})).catch((function(e){t.error(getError(e),h.instant("no.prev.search.element"))}))),f.activeSearchElm=-1===e?0:e}function C(e){const t=e.indexOf("<")>=0&&e.indexOf(">")>=0,n=-1===e.indexOf("<")&&-1===e.lastIndexOf(">"),r=/^<?(http|urn).*>?/.test(e)&&(t||n);let i=!1;if(r)if(e.indexOf("http")>=0){const t=e.indexOf("//");i=t>4&&e.substring(t+2).length>0}else e.indexOf("urn")>=0&&(i=e.substring(4).length>0);return r&&i}function D(e){if(!/^<?(http|urn).*>?/.test(e)){const t=e.split(":"),r=t[0],i=t[1];if(!angular.isUndefined(i)){const e=n.getNamespaceUriForPrefix(g.namespaces,r);if(b=e!==b?e:b,b)return y.val(b),b+i}}return e}f.checkIfValidAndSearchText=function(){A(f.textCallback)},f.checkIfValidAndSearchVisual=function(){A(f.visualCallback)},f.checkIfValidAndSearchEvent=function(e){f.searchType===c.visual||e.ctrlKey||e.metaKey?A(f.visualCallback):A(f.textCallback)},f.onChange=function(){return f.showClearInputIcon=f.clearInputIcon,v&&u.set(l.RDF_SEARCH_INPUT,f.searchInput),"false"!==f.uriValidation&&(f.searchInput=D(f.searchInput),g.autoCompleteStatus)?function(e){let t=e.replace(b,b+";");if(g.autoCompleteStatus)return";"===t.charAt(0)&&(t=t.slice(1)),t=function(e){let t=e;if(-1===t.indexOf(";")&&C(t)){t=t.replace(/<|>/g,"");const e=/[^/^#]*$/.exec(t)[0];return t.split(e)[0]+";"+e}return t}(t),w&&w.resolve(),w=a.defer(),i.getAutocompleteSuggestions(t,w.promise).then((function(e){w=null,f.autoCompleteUriResults=e.data.suggestions,f.activeSearchElm=0}));return Promise.resolve()}(f.searchInput):Promise.resolve()},f.onKeyDown=function(e){if(13===e.keyCode){if(e.preventDefault(),d.isActive())return;"false"!==f.uriValidation?g.autoCompleteStatus?f.checkIfValidAndSearchEvent(e):C(e.target.value)?f.searchRdfResourceByEvent(e.target.value,e):t.error(h.instant("invalid.uri.msg")):f.searchRdfResourceByEvent(e.target.value,e)}else if(f.searchInput.length>0&&!g.autoCompleteWarning&&!g.autoCompleteStatus){g.autoCompleteWarning=!0;const e=Object(r.decodeHTML)(h.instant("explore.autocomplete.warning.msg"));t.warning("",`<div class="autocomplete-toast"><a href="autocomplete">${e}</a></div>`,{allowHtml:!0})}if(g.autoCompleteStatus&&!angular.isUndefined(f.autoCompleteUriResults)){if(40===e.keyCode&&f.activeSearchElm<f.autoCompleteUriResults.length-1&&(f.activeSearchElm++,f.searchInput=f.autoCompleteUriResults[f.activeSearchElm].value,function(){const e=$("#auto-complete-results-wrapper"),t=e.children("div"),n=e.children("div.active");void 0!==n[0]&&n[0].offsetTop-t.height()-6-e.scrollTop()>170&&e.scrollTop(n[0].offsetTop-t.height()-6-170)}()),38===e.keyCode&&f.activeSearchElm>0&&(e.preventDefault(),f.activeSearchElm--,f.searchInput=f.autoCompleteUriResults[f.activeSearchElm].value,function(){const e=$("#auto-complete-results-wrapper"),t=e.children("div"),n=e.children("div.active");void 0!==n[0]&&n[0].offsetTop-t.height()-40<=e.scrollTop()&&e.scrollTop(e.scrollTop()-34)}()),27===e.keyCode){if(v)return;f.searchInput="",f.autoCompleteUriResults=[]}f.searchInput||f.clearInput()}},f.$on("rdfResourceSearchExpanded",(function(){(v?(f.preserveInput="true",f.searchInput=u.get(l.RDF_SEARCH_INPUT)||"",b=u.get(l.RDF_SEARCH_EXPANDED_URI),f.onChange()):Promise.resolve()).then((function(){F()}))})),f.setActiveClassOnMouseMove=function(e){g.autoCompleteStatus&&(f.activeSearchElm=e)}}}}function h(e){return{restrict:"AE",link:function(t,n,r){function i(e){27===e.keyCode&&(t.toggleCheatSheet(),t.$apply())}t.getTemplateUrl=function(){return r.templateUrl},t.shortcutsVisible=!1,t.toggleCheatSheet=function(){t.shortcutsVisible=!t.shortcutsVisible,t.shortcutsVisible?e.on("keydown",i):e.off("keydown",i)}},template:'<ng-include src="getTemplateUrl()" />'}}function d(e,t,n,i,o,a){return{restrict:"E",transclude:!0,scope:{loadSaved:"&",setPluginActive:"&",pluginName:"@",humanReadablePluginName:"@"},templateUrl:"js/angular/core/templates/inactive-plugin-warning-page.html",link:function(s){function u(){if(o.isLicenseValid()&&i.getActiveRepository()&&!i.isActiveRepoOntopType()&&!i.isActiveRepoFedXType())return t.checkPluginIsActive(s.pluginName).then((function({data:e}){s.pluginIsActive=e.indexOf("true")>0,s.setPluginActive({isPluginActive:s.pluginIsActive})})).catch((function(t){e.error(getError(t),a.instant("check.active.plugin.failure"))}))}s.pluginIsActive=!0,s.activatePlugin=function(){const i=Object(r.decodeHTML)(a.instant("activate.plugin.warning.msg",{humanReadablePluginName:s.humanReadablePluginName}));n.openSimpleModal({title:a.instant("activate.plugin.confirmation"),message:`<p>${i}</p>`,warning:!0}).result.then((function(){t.activatePlugin(s.pluginName).then((function(){s.pluginIsActive=!0,s.setPluginActive({isPluginActive:s.pluginIsActive}),s.loadSaved()})).catch((function(t){e.error(getError(t),a.instant("activate.plugin.failure"))}))}))};const l=s.$on("repositoryIsSet",(function(){u()}));window.addEventListener("beforeunload",(function e(){l(),window.removeEventListener("beforeunload",e)})),s.$on("checkIsActive",u),u()}}}p.$inject=["$location","toastr","ClassInstanceDetailsService","AutocompleteRestService","$rootScope","$q","$sce","LocalStorageAdapter","LSKeys","$repositories","$translate","GuidesService"],h.$inject=["$document"],d.$inject=["toastr","RDF4JRepositoriesRestService","ModalService","$repositories","$licenseService","$translate"]},function(e,t,n){"use strict";n.r(t);n(7),n(37),n(38);var r=n(5);angular.module("graphdb.framework.core.services.jwtauth",["toastr","graphdb.framework.rest.security.service","graphdb.framework.core.services.openIDService"]).service("$jwtAuth",["$http","toastr","$location","$rootScope","SecurityRestService","$openIDAuth","$translate","$q","AuthTokenService","LSKeys","LocalStorageAdapter",function(e,t,n,i,o,a,s,u,l,c,p){const h=this;i.deniedPermissions={},i.setPermissionDenied=function(e){return!("/login"===e||!h.isAuthenticated())&&(i.deniedPermissions[e]=!0,!0)},i.hasPermission=function(){const e=n.path();return!i.deniedPermissions[e]},this.updateReturnUrl=()=>{0!==n.url().indexOf("/login")&&(i.returnToUrl=n.url())},i.redirectToLogin=function(e,t){return h.authTokenIsType("Bearer")&&(e=!0),h.clearAuthenticationInternal(),h.updateReturnUrl(),n.path("/login"),t?n.search("noaccess"):e&&n.search("expired"),new Promise(e=>{setTimeout(()=>{e(!0)},100)})},i.hasExternalAuthUser=function(){return h.hasExternalAuthUser()},this.securityEnabled=!0,this.freeAccess=!1,this.hasOverrideAuth=!1,this.externalAuthUser=!1,this.securityInitialized=!1;const d=this;this.getAuthenticatedUserFromBackend=function(e,t){o.getAuthenticatedUser().success((function(e,t,n){const r=l.getAuthToken();r&&r.startsWith("GDB")?(d.externalAuthUser=!1,d.principal=e,i.$broadcast("securityInit",d.securityEnabled,!0,d.freeAccess)):d.openIDEnabled&&r&&r.startsWith("Bearer")?d.authenticate(e,r):(d.externalAuthUser=!0,d.authenticate(e,""))})).error((function(){e||!d.freeAccess?i.redirectToLogin(!1,t):(d.securityInitialized=!0,d.hasExplicitAuthentication()||d.clearAuthentication())}))},this.initSecurity=function(){this.securityInitialized=!1,o.getSecurityConfig().then((function(e){if(d.securityEnabled=e.data.enabled,d.externalAuth=e.data.hasExternalAuth,d.authImplementation=e.data.authImplementation,d.openIDEnabled=e.data.openIdEnabled,d.passwordLoginEnabled=e.data.passwordLoginEnabled,d.securityEnabled){const t=e.data.freeAccess;d.freeAccess=t.enabled,d.freeAccess&&(d.freeAccessPrincipal={authorities:t.authorities,appSettings:t.appSettings}),d.openIDEnabled?(d.openIDConfig=e.data.methodSettings.openid,d.gdbUrl=n.absUrl().replace(n.url().substr(1),""),a.initOpenId(d.openIDConfig,d.gdbUrl,(function(e){l.setAuthToken(a.authHeaderGraphDB()),console.log("oidc: set id/access token as GraphDB auth"),d.getAuthenticatedUserFromBackend(!0,e)}),(function(){console.log("oidc: not logged or login error"),d.authTokenIsType("Bearer")?setTimeout(()=>{i.redirectToLogin(!0)},0):d.getAuthenticatedUserFromBackend()}))):d.getAuthenticatedUserFromBackend()}else{l.clearAuthToken();const t=e.data.overrideAuth;if(d.hasOverrideAuth=t.enabled,!d.hasOverrideAuth)return o.getAdminUser().then((function(e){d.principal={username:"admin",appSettings:e.data.appSettings,authorities:e.data.grantedAuthorities},i.$broadcast("securityInit",d.securityEnabled,!0,d.hasOverrideAuth)}));d.principal={username:"overrideauth",authorities:t.authorities,appSettings:t.appSettings},i.$broadcast("securityInit",d.securityEnabled,!0,d.hasOverrideAuth)}}))},this.initSecurity(),this.reinitializeSecurity=function(){this.securityInitialized||this.initSecurity()},this.isSecurityEnabled=function(){return this.securityEnabled},this.hasExternalAuth=function(){return this.externalAuth},this.getAuthImplementation=function(){return this.authImplementation},this.isFreeAccessEnabled=function(){return this.freeAccess},this.isDefaultAuthEnabled=function(){return this.hasOverrideAuth&&this.principal&&"overrideauth"===this.principal.username},this.authTokenIsType=function(e){const t=l.getAuthToken();return t&&t.startsWith(e)},this.loginOpenID=function(){a.login(this.openIDConfig,this.gdbUrl)},this.toggleSecurity=function(e){e!==this.securityEnabled&&(this.securityEnabled=e,o.toggleSecurity(e).then((function(){t.success(s.instant("jwt.auth.security.status",{status:s.instant(e?"enabled.status":"disabled.status")})),l.clearAuthToken(),d.initSecurity()}),(function(e){t.error(e.data.error.message,s.instant("common.error"))})))},this.toggleFreeAccess=function(e,n,r,a){(e!==this.freeAccess||a)&&(this.freeAccess=e,this.freeAccessPrincipal=e?{authorities:n,appSettings:r}:void 0,o.setFreeAccess({enabled:e?"true":"false",authorities:n,appSettings:r}).then((function(){a?t.success(s.instant("jwt.auth.free.access.updated.msg")):t.success(s.instant("jwt.auth.free.access.status",{status:s.instant(e?"enabled.status":"disabled.status")}))}),(function(e){t.error(e.data.error.message,s.instant("common.error"))})),i.$broadcast("securityInit",this.securityEnabled,this.hasExplicitAuthentication(),this.freeAccess))},this.authenticate=function(e,t){return new Promise(n=>{t?(l.setAuthToken(t),this.externalAuthUser=!1):l.clearAuthToken(),this.principal=e,i.deniedPermissions={},this.securityInitialized=!0;const r={id:p.get(c.REPOSITORY_ID)||"",location:p.get(c.REPOSITORY_LOCATION)||""};h.canReadRepo(r)||(p.remove(c.REPOSITORY_ID),p.remove(c.REPOSITORY_LOCATION),i.deniedPermissions={}),i.$broadcast("securityInit",this.securityEnabled,d.hasExplicitAuthentication(),this.freeAccess),setTimeout(()=>{n(!0)})})},this.authenticateOpenID=function(e){l.clearAuthToken(),e&&(l.setAuthToken(e),this.externalAuthUser=!1)},this.hasExternalAuthUser=function(){return this.externalAuthUser},this.hasExplicitAuthentication=function(){return null!=l.getAuthToken()||this.externalAuthUser},this.getPrincipal=function(){if(this.principal)return Promise.resolve(this.principal);const e=u.defer();return i.$on("securityInit",()=>{e.resolve(this.principal)}),e.promise},this.clearAuthenticationInternal=function(){a.softLogout(),this.principal=this.freeAccessPrincipal,l.clearAuthToken()},this.clearAuthentication=function(){this.clearAuthenticationInternal(),i.$broadcast("securityInit",this.securityEnabled,!1,this.freeAccess)},this.isAuthenticated=function(){return!this.securityEnabled||this.hasExplicitAuthentication()},this.hasPermission=function(){},this.hasRole=function(e){if(void 0!==e&&(this.securityEnabled||this.hasOverrideAuth)){"string"==typeof e&&(e=[e]);const t=!_.isEmpty(this.principal);return!!t&&("IS_AUTHENTICATED_FULLY"===e[0]?t:_.intersection(e,this.principal.authorities).length>0)}return!0},this.isAdmin=function(){return this.hasRole(r.UserRole.ROLE_ADMIN)},this.isRepoManager=function(){return this.hasRole(r.UserRole.ROLE_REPO_MANAGER)},this.hasRoleMonitor=function(){return this.hasRole(r.UserRole.ROLE_MONITORING)},this.checkForWrite=function(e,t){return"WRITE_REPO"===e?this.canWriteRepo(t):this.hasRole(e)},this.hasAdminRole=function(){return this.isAdmin()||this.isRepoManager()},this.canWriteRepo=function(e){return!!e&&(!this.securityEnabled&&!this.hasOverrideAuth||!_.isEmpty(this.principal)&&(!!this.hasAdminRole()||this.checkRights(e,"WRITE")))},this.canReadRepo=function(e){return!!e&&(!this.securityEnabled||!_.isEmpty(this.principal)&&(!!this.hasAdminRole()||this.checkRights(e,"READ")))},this.checkRights=function(e,t){if(e)for(let n=0;n<this.principal.authorities.length;n++){const r=this.principal.authorities[n],i=r.split("_",2),o=r.slice(i[0].length+i[1].length+2),a=e.location?`${e.id}@${e.location}`:e.id;if(i[0]===t&&(a===o||"SYSTEM"!==e.id&&"*"===o))return!0}return!1}}])},function(e,t){let n;angular.module("graphdb.framework.utils.uriutils",[]).factory("UriUtils",r);try{n=new RegExp("^<?[a-z](?:[-a-z0-9\\+\\.])*:(?:\\/\\/(?:(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=:])*@)?(?:\\[(?:(?:(?:[0-9a-f]{1,4}:){6}(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(?:\\.(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3})|::(?:[0-9a-f]{1,4}:){5}(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(?:\\.(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3})|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(?:\\.(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3})|(?:[0-9a-f]{1,4}:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(?:\\.(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3})|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(?:\\.(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3})|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(?:\\.(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3})|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(?:\\.(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3})|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|v[0-9a-f]+[-a-z0-9\\._~!\\$&'\\(\\)\\*\\+,;=:]+)\\]|(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(?:\\.(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3}|(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=@])*)(?::[0-9]*)?(?:\\/(?:(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=:@]))*)*|\\/(?:(?:(?:(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=:@]))+)(?:\\/(?:(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=:@]))*)*)?|(?:(?:(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=:@]))+)(?:\\/(?:(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=:@]))*)*|(?!(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=:@])))(?:\\?(?:(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=:@])|[\\u{E000}-\\u{F8FF}\\u{F0000}-\\u{FFFFD}\\u{100000}-\\u{10FFFD}\\/\\?])*)?(?:#(?:(?:%[0-9a-f][0-9a-f]|[-a-z0-9\\._~\\u{A0}-\\u{D7FF}\\u{F900}-\\u{FDCF}\\u{FDF0}-\\u{FFEF}\\u{10000}-\\u{1FFFD}\\u{20000}-\\u{2FFFD}\\u{30000}-\\u{3FFFD}\\u{40000}-\\u{4FFFD}\\u{50000}-\\u{5FFFD}\\u{60000}-\\u{6FFFD}\\u{70000}-\\u{7FFFD}\\u{80000}-\\u{8FFFD}\\u{90000}-\\u{9FFFD}\\u{A0000}-\\u{AFFFD}\\u{B0000}-\\u{BFFFD}\\u{C0000}-\\u{CFFFD}\\u{D0000}-\\u{DFFFD}\\u{E1000}-\\u{EFFFD}!\\$&'\\(\\)\\*\\+,;=:@])|[\\/\\?])*)?>?$","ui")}catch(e){n=new RegExp("^<?[a-z](?:[-a-z0-9\\+\\.])*:>?","i")}function r(e){function t(e){const t=e.indexOf("<")>=0&&e.indexOf(">")>=0,n=-1===e.indexOf("<")&&-1===e.lastIndexOf(">"),r=/^<?(http|urn).*>?/.test(e)&&(t||n);let i=!1;if(r)if(e.indexOf("http")>=0){const t=e.indexOf("//");i=t>4&&e.substring(t+2).length>0}else e.indexOf("urn")>=0&&(i=e.substring(4).length>0);return r&&i}return{isValidIri:function(e,r){if(void 0!==e&&void 0!==r&&(t(r)||r.match(n)))return!0},validateRdfUri:t,shortenIri:function(e){const t=document.createElement("a");t.href=e;let n=t.hostname;return function(e){const t=e.split(".");for(let e=0,n=0;e<t.length;e++)if(parseInt(t[e],10)>=0&&parseInt(t[e],10)<=255?n++:n=0,4===n)return!0;return!1}(t.hostname)||(n=t.hostname.split(".")[0]),n+":"+t.port},expandPrefix:function(t,n){const r=/^<.*>$/.test(t);if(t=function(e,t){if(t.test(e))return e.substring(1,e.length-1);return e}(t,/^<.*>$/),!/^<?(http|urn).*>?/.test(t)){const i=t.split(":"),o=i[0],a=i[1];if(!angular.isUndefined(a)){const t=e.getNamespaceUriForPrefix(n,o);if(t)return t+a;if(!r)return""}}return t}}}r.$inject=["ClassInstanceDetailsService"]},function(e,t,n){"use strict";n.r(t);var r=n(15),i=n(18);angular.module("graphdb.framework.rest.monitoring.service",[]).factory("MonitoringRestService",o),o.$inject=["$http"];function o(e){return{monitorResources:function(){return e.get("rest/monitor/infrastructure")},monitorStructures:function(){return e.get("rest/monitor/structures")},monitorCluster:function(){return e.get("rest/monitor/cluster")},monitorGC:function(){return e.post("rest/monitor/infrastructure/gc")},monitorQuery:function(t){return e.get(`rest/monitor/repository/${t}/query/active`)},monitorBackup:function(){return e.get("rest/monitor/backup").then(e=>Object(r.mapBackupAndRestoreResponseToModel)(e.data))},monitorActiveOperations:function(t){return e.get(`rest/monitor/${t}/operations`).then(e=>Object(i.mapActiveOperationResponseToModel)(e.data))},deleteQuery:function(t,n){return e.delete(`rest/monitor/repository/${n}/query?query=${encodeURIComponent(t)}`)},getQueryCount:function(t){return e({url:`rest/monitor/repository/${t}/query/count`,method:"GET",timeout:1e4})},checkAutocompleteStatus:function(){return e.get("rest/autocomplete/enabled")},monitorQueryTransactionStatistics:function(t){return e.get("rest/monitor/repository/"+t)}}}},function(e,t){angular.module("graphdb.framework.rest.sparql.service",[]).factory("SparqlRestService",n),n.$inject=["$http"];function n(e){return{getSavedQueries:function(){return e.get("rest/sparql/saved-queries")},getSavedQuery:function(t,n){let r="";null!=n&&(r="&owner="+encodeURIComponent(n));return e.get(`rest/sparql/saved-queries?name=${encodeURIComponent(t)}${r}`)},addKnownPrefixes:function(t){return e.post("rest/sparql/add-known-prefixes",t)},editSavedQuery:function(t){return e.put("rest/sparql/saved-queries",t)},deleteSavedQuery:function(t){return e.delete("rest/sparql/saved-queries?name="+encodeURIComponent(t))},addNewSavedQuery:function(t){return e.post("rest/sparql/saved-queries",t)}}}},function(e,t){angular.module("graphdb.framework.rest.rdf4j.repositories.service",[]).factory("RDF4JRepositoriesRestService",r),r.$inject=["$http","$repositories","$translate"];const n="select ?o where {\n?s <http://www.ontotext.com/owlim/system#listplugins> ?o .\nfilter(str(?s) = '{{pluginName}}')\n} ";function r(e,t,r){return{getNamespaces:function(t){return e.get(`repositories/${t}/namespaces`)},getRepositoryNamespaces:function(){return e.get(`repositories/${t.getActiveRepository()}/namespaces`)},updateNamespacePrefix:function(t,n,r){return e({url:`repositories/${t}/namespaces/${r}`,method:"PUT",data:n})},deleteNamespacePrefix:function(t,n){return e({url:`repositories/${t}/namespaces/${n}`,method:"DELETE"})},addStatements:function(t,n){return e({url:`repositories/${t}/statements`,method:"POST",data:n,headers:{"Content-Type":"application/x-www-form-urlencoded"}})},activatePlugin:function(n){return e({method:"POST",url:`repositories/${t.getActiveRepository()}/statements`,params:{update:"INSERT DATA { <u:a> <http://www.ontotext.com/owlim/system#startplugin> '{{pluginName}}' .}".replace("{{pluginName}}",n)}})},checkPluginIsActive:function(r){return e({method:"GET",url:"repositories/"+t.getActiveRepository(),params:{query:n.replace("{{pluginName}}",r)},headers:{Accept:"*/*"}})},getRepositorySize:function(){return e.get(`repositories/${t.getActiveRepository()}/size`)},getGraphs:i,resolveGraphs:function(){const e=t.getActiveRepository();let n=[];if(e)return i(e).success((function(e){e.results.bindings.unshift({contextID:{type:"default",value:"import.default.graph"}}),Object.keys(e.results.bindings).forEach((function(t){const n=e.results.bindings[t];"bnode"===n.contextID.type?n.contextID.value="_:"+n.contextID.value:"default"===n.contextID.type?n.contextID.uri="http://www.openrdf.org/schema/sesame#nil":n.contextID.uri=n.contextID.value})),e.results.bindings.unshift(allGraphs),n=e.results.bindings}));return n},downloadResultsAsFile:function(t,n,r){const i=Object.entries(n).filter(([e,t])=>void 0!==t).map(([e,t])=>`${e}=${t}`).join("&");return e({method:"POST",url:"repositories/"+t,headers:{"Content-Type":"application/x-www-form-urlencoded;charset=utf-8",Accept:r},data:i,responseType:"blob"}).then((function(e){const t=e.data;let n=e.headers()["content-disposition"].split("filename=")[1];return n=n.substring(0,n.length),{data:t,filename:n}}))}};function i(t){return e.get(`repositories/${t}/contexts`)}}},function(e,t){function n(e,t,n,r){e.title=n,e.message=r,e.ok=function(){t.close()},e.cancel=function(){t.dismiss("cancel")}}function r(e,t,n,r,i,o){t.opened.then((function(){o(()=>{$("#clipboardURI")[0].select()},0)})),e.clipboardURI=n,e.ok=function(){try{document.getElementById("clipboardURI").select(),document.execCommand("copy"),r.success(i.instant("modal.ctr.copy.url.success"))}catch(e){r.error(i.instant("modal.ctr.copy.not.supported.warning"))}t.close()},e.cancel=function(){t.dismiss("cancel")}}function i(e,t,n,r,i){e.query=n,e.cancel=function(){t.dismiss("cancel")},e.selectQuery=function(){e.selectElement($("#create-query"))},e.copyQueryToClipboard=function(){try{e.selectQuery(),document.execCommand("copy"),t.close(),r.success(i.instant("modal.ctr.copy.query.success"))}catch(e){r.error(i.instant("modal.ctr.copy.not.supported.warning"))}},e.selectElement=function(e){if(e.length>0)if(window.getSelection){const t=window.getSelection();t.removeAllRanges();const n=document.createRange();n.selectNodeContents(e[0].firstChild),t.addRange(n)}else if(document.selection){const t=document.body.createTextRange();t.moveToElementText(e[0]),t.select()}}}angular.module("graphdb.framework.core.controllers",[]).controller("CopyToClipboardModalCtrl",r).controller("SimpleModalCtrl",n).controller("ViewQueryCtrl",i),n.$inject=["$scope","$uibModalInstance","title","message"],r.$inject=["$scope","$uibModalInstance","uri","toastr","$translate","$timeout"],i.$inject=["$scope","$uibModalInstance","query","toastr","$translate"]},function(e,t){angular.module("graphdb.framework.rest.plugins.service",[]).factory("PluginsRestService",n);function n(e){return{togglePlugin:function(t,n,r){return n?e.post(`repositories/${t}/statements`,void 0,{params:{update:`INSERT DATA { <u:a> <http://www.ontotext.com/owlim/system#stopplugin> "${r}".}`}}):e.post(`repositories/${t}/statements`,void 0,{params:{update:`INSERT DATA { <u:a> <http://www.ontotext.com/owlim/system#startplugin> "${r}".}`}})},getPlugins:function(t){return e.get("repositories/"+t,{params:{query:"select ?s ?o where { ?s <http://www.ontotext.com/owlim/system#listplugins> ?o .}"}})}}}n.$inject=["$http"]},function(e,t){angular.module("graphdb.framework.rest.locations.service",[]).factory("LocationsRestService",n),n.$inject=["$http"];function n(e){return{getLocations:function(t,n){return e.get("rest/locations",{params:{filterClusterLocations:n}},{timeout:t?t.promise:null})},addLocation:function(t){return e.post("rest/locations",t)},editLocation:function(t){return e.put("rest/locations",t)},deleteLocation:function(t){return e.delete("rest/locations?uri="+t)},getActiveLocation:function(){return e({method:"GET",url:"rest/locations/active",noCancelOnRouteChange:!0})},setDefaultRepository:function(t){return e({url:"rest/locations/active/default-repository",method:"POST",data:{defaultRepository:t}})},getLocationRpcAddress:function(t){return e.get("rest/info/rpc-address",{params:{location:t}})}}}},function(e,t){angular.module("graphdb.framework.rest.autocomplete.service",[]).factory("AutocompleteRestService",n);function n(e){return{checkAutocompleteStatus:function(){return e.get("rest/autocomplete/enabled")},refreshIndexStatus:function(){return e.get("rest/autocomplete/status")},refreshLabelConfig:function(){return e.get("rest/autocomplete/labels")},addLabelConfig:function(t){return e.put("rest/autocomplete/labels",t)},removeLabelConfig:function(t){return e.delete("rest/autocomplete/labels",{data:t,headers:{"Content-Type":"application/json;charset=utf-8"}})},toggleAutocomplete:function(t){return e.post("rest/autocomplete/enabled?enabled="+t)},refreshIndexIRIs:function(){return e.get("rest/autocomplete/iris")},toggleIndexIRIs:function(t){return e.post("rest/autocomplete/iris?enabled="+t)},buildIndex:function(){return e.post("rest/autocomplete/reindex")},interruptIndexing:function(){return e.post("rest/autocomplete/interrupt")},checkForPlugin:function(){return e.get("rest/autocomplete/plugin-found")},getAutocompleteSuggestions:function(t,n){return e.get("rest/autocomplete/query",{params:{q:t},timeout:n})}}}n.$inject=["$http"]},function(e,t,n){"use strict";n.r(t);n(10),n(12);var r=n(2);function i(e,t,n,i,o,a,s,u,l,c){this.guideResumeSubscription=void 0,this.languageChangeSubscription=void 0,this.guideCancelSubscription=void 0,this.init=()=>{this._subscribeToGuideResumed(),this._subscribeToGuideCancel(),this._subscribeToGuidePause()},this.startGuide=(e,s)=>{if(e&&e.options&&e.options.repositoryIdBase){const t=a.getRepositories();e.options.repositoryId=e.options.repositoryIdBase;for(let n=2;t.find(t=>t.id===e.options.repositoryId);n++)e.options.repositoryId=e.options.repositoryIdBase+n;e.options.translatedGuideName=r.GuideUtils.translateLocalMessage(n,i,e.guideName,{}),e.options.translatedGuideDescription=r.GuideUtils.translateLocalMessage(n,i,e.guideDescription,{})}const u=this._toStepsDescriptions(e);for(let e=0;e<u.length;e++)u[e].id=e;angular.isDefined(s)?o.resumeGuide(e.guideId,u,s):o.startGuide(e.guideId,u,s),t.$broadcast("guideStarted")},this.getGuides=()=>new Promise(t=>{e.get(r.GuideUtils.GUIDES_LIST_URL).success((function(e){angular.forEach(e,(e,t)=>{void 0===e.guideId&&(e.guideId=t)}),t(e)}))}),this.isActive=()=>o.isActive(),this._toStepsDescriptions=e=>{if(!e)return[];let t=[];return e.steps.forEach(n=>{t=t.concat(this._getSteps(n,e.options))}),t},this._getSteps=(e,p)=>{const h={$translate:n,$interpolate:i,GuideUtils:r.GuideUtils,$rootScope:t,toastr:s,$location:u,$route:l,$timeout:c,ShepherdService:o,$repositories:a};let d=[];if(angular.isArray(e))e.forEach(t=>{d=d.concat(this._getSteps(t,angular.extend({},e.options,p)))});else{const t=PluginRegistry.get("guide.step").find(t=>t.guideBlockName===e.guideBlockName);if(t){const n=angular.extend({},t.options,e.options,p);t.getSteps?d=d.concat(this._getSteps(_.cloneDeep(t.getSteps(n,h)),p)):t.getStep?d.push(_.cloneDeep(t.getStep(n,h))):d=d.concat(this._getSteps(_.cloneDeep(t,t.options),p))}}return d.forEach((e,t)=>{e.stepN=t,e.stepsTotalN=d.length,!e.title&&e.mainAction&&(e.title="guide.step-action."+e.mainAction)}),d},this._subscribeToGuideResumed=()=>{this.guideResumeSubscription||(this.guideResumeSubscription=t.$on("guideResume",()=>{const e=o.getGuideId();this.getGuides().then(t=>{const n=t.find(t=>t.guideId===e),r=o.getCurrentStepId();this.startGuide(n,r)})}))},this._subscribeToGuideCancel=()=>{o.subscribeToGuideCancel(()=>t.$broadcast("guideReset"))},this._subscribeToGuidePause=()=>{o.subscribeToGuidePause(()=>t.$broadcast("guidePaused"))}}angular.module("graphdb.framework.guides.services",["graphdb.framework.guides.shepherd.services"]).service("GuidesService",i),i.$inject=["$http","$rootScope","$translate","$interpolate","ShepherdService","$repositories","toastr","$location","$route","$timeout"]},function(e,t,n){"use strict";n.r(t);n(7);angular.module("graphdb.framework.core.interceptors.unauthorized",["ngCookies"]).factory("$unauthorizedInterceptor",["$q","$location","$rootScope","$translate",function(e,t,n,r){return{responseError:function(i){let o=!1;return 401===i.status?i.config.url.indexOf("rest/security/authenticated-user")<0&&!n.hasExternalAuthUser()&&(o=!0):403===i.status&&(n.setPermissionDenied(t.path())?console.log(r.instant("unauthorized.console.warning")):o=!0),o?Promise.resolve(n.redirectToLogin()).then(()=>e.reject(i)):e.reject(i)}}}])},function(e,t,n){"use strict";n.r(t);n(7);angular.module("graphdb.framework.core.interceptors.authentication",["ngCookies"]).factory("$authenticationInterceptor",["AuthTokenService","LocalStorageAdapter","LSKeys",function(e,t,n){return{request:function(r){const i=r.headers||{};if([e.OPENID_CONFIG.openIdKeysUri,e.OPENID_CONFIG.openIdTokenUrl].some(e=>r.url.indexOf(e)>-1))return r;i["X-Requested-With"]="XMLHttpRequest",i.Authorization=e.getAuthToken();const o=t.get(n.REPOSITORY_ID),a=t.get(n.REPOSITORY_LOCATION);return i["X-GraphDB-Repository"]=o||void 0,i["X-GraphDB-Repository-Location"]=a||void 0,r.headers=i,r}}}])},,function(e,t,n){"use strict";n.r(t);var r=n(6);const i={headers:{"X-GraphDB-Repository-Location":void 0,"X-GraphDB-Repository":void 0,"X-Requested-With":void 0,Authorization:void 0}};angular.module("graphdb.framework.core.services.openIDService",["toastr"]).service("$openIDAuth",["$http","$location","$window","toastr","$translate","AuthTokenService",function(e,t,n,o,a,s){const u="com.ontotext.graphdb.openid.",l=this;function c(e){const t=[];for(let n in e)e.hasOwnProperty(n)&&t.push(`${n}=${encodeURIComponent(e[n])}`);return t.join("&")}this.login=function(e,t){const r=l.generateRandomString(),i=e.authFlow;if("code"===i){l.setStorageItem("pkce_state",r);const i=l.generateRandomString();l.setStorageItem("pkce_code_verifier",i);const o=l.pkceChallengeFromVerifier(i);n.location.href=l.getLoginUrl(r,o,t,e)}else"code_no_pkce"===i?(l.removeStorageItem("pkce_code_verifier"),n.location.href=l.getLoginUrl(r,"",t,e)):"implicit"===i?(l.setStorageItem("nonce",r),n.location.href=l.getLoginUrl(r,"",t,e)):(console.log("oidc: unknown auth flow: "+i),o.error(a.instant("openid.auth.unknown.flow",{authFlow:i})))},this.getLoginUrl=function(e,t,n,r){const i=[];let o="";switch(r.authFlow){case"code":o="code",i.push("state="+encodeURIComponent(e)),i.push("code_challenge="+encodeURIComponent(t)),i.push("code_challenge_method=S256");break;case"code_no_pkce":o="code";break;case"implicit":o="token id_token",i.push("nonce="+encodeURIComponent(e));break;default:throw new Error(a.instant("openid.auth.unknown.flow",{authFlow:r.authFlow}))}return i.unshift("response_type="+encodeURIComponent(o),"scope="+encodeURIComponent(l.getScope(r.extraScopes)),"client_id="+encodeURIComponent(r.clientId),"redirect_uri="+encodeURIComponent(n)),r.oracleDomain&&i.push("domain="+encodeURIComponent(r.oracleDomain)),r.authorizeParameters&&i.push(r.authorizeParameters),`${r.oidcAuthorizationEndpoint}?${i.join("&")}`},this.withOpenIdKeys=function(t,n){e.get(t,i).success((function(e){s.OPENID_CONFIG.openIdKeys={},e.keys.forEach((function(e){s.OPENID_CONFIG.openIdKeys[e.kid]=e})),n()}))},this.initOpenId=function(e,t,r,u){l.clientId=e.clientId,l.tokenType=e.tokenType,l.idTokenAudience=e.clientId,l.idTokenIssuer=e.issuer,l.accessTokenAudience=e.tokenAudience,l.accessTokenIssuer=e.tokenIssuer,s.OPENID_CONFIG.openIdTokenUrl=e.oidcTokenEndpoint,s.OPENID_CONFIG.openIdKeysUri=e.oidcJwksUri,e.proxyOidc&&(s.OPENID_CONFIG.openIdKeysUri="rest/openid/jwks",s.OPENID_CONFIG.openIdTokenUrl="rest/openid/token"),s.OPENID_CONFIG.openIdEndSessionUrl=e.oidcEndSessionEndpoint,s.OPENID_CONFIG.supportsOfflineAccess=e.oidcScopesSupported.includes("offline_access"),e.oracleDomain&&(i.headers["X-OAuth-Identity-Domain-Name"]=e.oracleDomain),l.withOpenIdKeys(s.OPENID_CONFIG.openIdKeysUri,(function(){if(l.isLoggedIn=l.hasValidIdToken(),l.isLoggedIn)l.setupTokensRefresh(!1,r,u);else if(l.hasValidRefreshToken())l.refreshTokens(r,u);else{const i=r;r=function(){l.isLoggedIn=!0,i(!0)},l.softLogout();const s=l.parseQueryString(n.location.search.substring(1));if(s.code)"code"===e.authFlow?l.getStorageItem("pkce_state")!==s.state?(o.error(a.instant("openid.auth.invalid.pkce.state")),console.log("oidc: PKCE state mismatch "+l.getStorageItem("pkce_state")+" != "+s.state),u()):l.retrieveTokensByCode(s.code,t,r,u):"code_no_pkce"===e.authFlow&&l.retrieveTokensByCode(s.code,t,r,u);else{const e=l.parseQueryString(n.location.pathname.substring(1));e.id_token?l.saveTokens(e,!0,!1,r):u()}}}))},this.authHeaderGraphDB=function(){return"id"===l.getStorageItem("token_type")?"Bearer "+l.getToken("id"):"Bearer "+l.getToken("access")},this.softLogout=function(){l.isLoggedIn=!1,l.setToken("id",null),l.setToken("access",null),l.setToken("refresh",null)},this.hardLogout=function(e){l.softLogout(),s.OPENID_CONFIG.openIdEndSessionUrl&&(n.location.href=`${s.OPENID_CONFIG.openIdEndSessionUrl}?client_id=${encodeURIComponent(l.clientId)}&post_logout_redirect_uri=${encodeURIComponent(e)}`)},this.getToken=function(e){return l.getStorageItem(e+"_token")},this.setToken=function(e,t){t?l.setStorageItem(e+"_token",t):l.removeStorageItem(e+"_token")},this.tokenHeader=function(e){const t=l.getToken(e);if(t){try{const e=r.KJUR.jws.JWS.readSafeJSONString(Object(r.b64utoutf8)(t.split(".")[0]));if(e)return e}catch(e){}return{error:a.instant("openid.auth.not.jwt.token",{token:t})}}return{}},this.verifyToken=function(e){const t=l.getToken(e),n=l.tokenHeader(e);if(!n.kid)return"id"!==e?n.error?(console.log(`oidc: token ${e} is not a JWT token (token considered valid)`),!0):(console.log(`oidc: invalid token ${e} (token is empty)`),!1):(console.log("oidc: invalid token id (not a JWT token)"),!1);const i=s.OPENID_CONFIG.openIdKeys[n.kid];if(!i)return console.log("oidc: no key to verify JWT token (token considered invalid)"),!1;const o=r.KEYUTIL.getKey(i),a={alg:[n.alg],iss:[l.idTokenIssuer]};return"id"===e?(a.aud=[l.idTokenAudience,l.idTokenIssuer],a.nonce=[l.getStorageItem("nonce")]):"access"===e&&(a.aud=[l.accessTokenAudience],a.iss=[l.accessTokenIssuer]),r.KJUR.jws.JWS.verifyJWT(t,o,a)},this.hasValidIdToken=function(){return l.getToken("id")?l.verifyToken("id")?(console.log("oidc: valid id token found"),!0):(console.log("oidc: stale id token"),!1):(console.log("oidc: no id token"),!1)},this.tokenPayload=function(e){const t=l.getToken(e);if(t){try{const e=r.KJUR.jws.JWS.readSafeJSONString(Object(r.b64utoutf8)(t.split(".")[1]));if(e)return e}catch(e){}return{error:a.instant("openid.auth.not.jwt.token",{token:t})}}return{}},this.saveTokens=function(e,n,r,i){(n||e.refresh_token)&&l.setToken("refresh",e.refresh_token),l.setToken("access",e.access_token),l.setToken("id",e.id_token),l.setStorageItem("token_type",l.tokenType),console.log("oidc: saved tokens"),l.setupTokensRefresh(n||r,i),l.removeStorageItem("pkce_state"),l.removeStorageItem("pkce_code_verifier"),n&&t.url("/")},this.retrieveTokensByCode=function(t,n,r,u){const p={grant_type:"authorization_code",client_id:l.clientId,redirect_uri:n,code:t},h=l.getStorageItem("pkce_code_verifier");h&&(p.code_verifier=h);const d={...i.headers,"Content-type":"application/x-www-form-urlencoded; charset=utf-8"};e({method:"POST",url:s.OPENID_CONFIG.openIdTokenUrl,headers:d,transformRequest:c,data:p}).success((function(e){l.saveTokens(e,!0,!1,r)})).error((function(e){o.error(a.instant("openid.auth.cannot.retrieve.token.msg",{error:getError(e)})),u()}))},this.refreshTokens=function(t,n){if(l.hasValidRefreshToken()){const r={grant_type:"refresh_token",client_id:l.clientId,refresh_token:l.getToken("refresh")},u={...i.headers,"Content-type":"application/x-www-form-urlencoded; charset=utf-8"};e({method:"POST",url:s.OPENID_CONFIG.openIdTokenUrl,headers:u,transformRequest:c,data:r}).success((function(e){console.log("oidc: refreshed tokens"),l.saveTokens(e,!1,!0,t),l.isLoggedIn=!0})).error((function(e){console.log("oidc: could not refresh tokens"),o.error(a.instant("openid.auth.cannot.refresh.token.msg",{error:getError(e)})),n&&n()}))}else console.log("oidc: refresh requested without a valid refresh token")},this.hasValidRefreshToken=function(){const e=l.tokenPayload("refresh");return!(e.nbf&&1e3*e.nbf-Date.now()>5e3)&&(!(e.exp&&Date.now()-1e3*e.exp>5e3)&&!(!e.iat&&!e.error))},this.setupTokensRefresh=function(e,t,n){if(l.hasValidRefreshToken()){clearTimeout(l.previousTimer);const r=l.tokenPayload("id");if(r.exp>0){const i=1e3*r.exp-Date.now()-6e4;if(!(e||i>1e3))return l.previousTimer=null,console.log("oidc: tokens will refresh now, "+i+"; "+e),void l.refreshTokens(t,n);l.previousTimer=setTimeout((function(){l.refreshTokens(t)}),i),console.log("oidc: tokens will refresh in "+i/1e3+" seconds at "+new Date(Date.now()+i))}}else console.log("oidc: no valid refresh token");t()},this.parseQueryString=function(e){const t={access_token:null,code:null,id_token:null,state:null};if(""===e)return t;return e.split("&").map((function(e){return e.split("=")})).forEach((function(e){t[e[0]]=decodeURIComponent(e[1])})),t},this.generateRandomString=function(){const e=new Uint32Array(28);return window.crypto.getRandomValues(e),Array.from(e,(function(e){return("0"+e.toString(16)).substr(-2)})).join("")},this.pkceChallengeFromVerifier=function(e){const t=new r.KJUR.crypto.MessageDigest({alg:"sha256",prov:"cryptojs"});return Object(r.hextob64u)(t.digestString(e))},this.getScope=function(e){let t="openid"+(s.OPENID_CONFIG.supportsOfflineAccess?" offline_access":"");return e&&(t+=" "+e),console.log(`oidc: requesting scopes '${t}'`),t},this.setStorageItem=function(e,t){localStorage.setItem(u+e,t)},this.getStorageItem=function(e){return localStorage.getItem(u+e)},this.removeStorageItem=function(e){localStorage.removeItem(u+e)}}])},function(e,t){angular.module("graphdb.framework.rest.security.service",[]).factory("SecurityRestService",n),n.$inject=["$http"];function n(e){return{getUser:function(n){return e.get("rest/security/users/"+t(n))},getAdminUser:function(){return e.get("rest/security/users/admin")},getUsers:function(){return e.get("rest/security/users")},createUser:function(n){return e({method:"POST",url:"rest/security/users/"+t(n.username),data:{password:n.pass,appSettings:n.appSettings,grantedAuthorities:n.grantedAuthorities}})},updateUser:function(n){return e({method:"PUT",url:"rest/security/users/"+t(n.username),data:{password:n.pass,appSettings:n.appSettings,grantedAuthorities:n.grantedAuthorities}})},updateUserData:function(n){return e({method:"PATCH",url:"rest/security/users/"+t(n.username),data:{password:n.pass,appSettings:n.appSettings}})},deleteUser:function(n){return e.delete("rest/security/users/"+t(n))},getFreeAccess:function(){return e.get("rest/security/free-access")},setFreeAccess:function(t){return e.post("rest/security/free-access",t)},getSecurityConfig:function(){return e.get("rest/security/all")},toggleSecurity:function(t){return e.post("rest/security",t?"true":"false")},getRoles:function(){return e.get("rest/roles")},getRolesMapping:function(t){return e.get("rest/roles/mapping",{params:t})},getAuthenticatedUser:function(){return e.get("rest/security/authenticated-user")}};function t(e){return encodeURIComponent(e).replace(/[!'()*]/g,(function(e){return"%"+e.charCodeAt(0).toString(16)}))}}},function(e,t){!function(e){e.getError=function(e,t,n){if(angular.isObject(e)&&e.status&&e.data)return getError(e.data,t,n);if(t&&403===t)return"Access is restricted";if(e){let r="Generic error";if(angular.isString(e))-1===e.indexOf("<html>")&&(r=e,r=r.replace(/^(([a-z0-9_]+\.)+[a-zA-Z0-9_]+: )+/,""));else if(angular.isObject(e)){if("message"in e&&(r=e.message),"error"in e&&(r=e.error.message),"responseJSON"in e&&"message"in e.responseJSON)return getError(e.responseJSON,t,n);"responseText"in e&&(r=e.responseText)}return n>0&&r.length>n&&(r=r.substr(0,n)+"..."),r}return"There is an error"}}(window)},function(e,t,n){"use strict";n.r(t);n(7),n(41),n(27),n(32),n(30),n(26),n(13),n(14),n(28),n(53),n(54),n(24),n(22),n(42);var r=n(5),i=(n(10),n(43),n(25),n(44),n(0)),o=(n(33),n(45),n(12));function a(e,t,n,r,i,o,a,s,u,l,c){function p(){e.getActiveRepository()&&(e.getNamespacesPromise=l.getNamespaces(e.getActiveRepository()).success((function(){h()})),e.getActiveRepositorySize())}function h(){o.isLicenseValid()&&(e.getAutocompletePromise=a.checkAutocompleteStatus())}e.doClear=!1,e.getActiveRepositorySize=function(){const t=r.getActiveRepositoryObject();t&&(e.activeRepositorySizeError=void 0,u.getSize(t).then((function(t){e.activeRepositorySize=t.data})).catch((function(t){e.activeRepositorySizeError=t.data.message})))},e.$on("autocompleteStatus",(function(){h()})),e.$on("repositoryIsSet",p),e.$on("$routeChangeSuccess",(function(e,n,r){r&&(i.isAuthenticated()||i.isFreeAccessEnabled()?p():t.redirectToLogin())})),e.onKeyDown=function(t){27===t.keyCode&&(e.doClear=!0)}}function s(e,t,n,a,s,u,l,c,p,h,d,f,g,m,v,y,b,w,x,S,E,A,F,C,D,T,I,R){e.descr=A.instant("main.gdb.description"),e.documentation="",e.menu=t,e.tutorialState=1!==S.get(E.TUTORIAL_STATE),e.userLoggedIn=!1,e.embedded=u.search().embedded,e.productInfo=h,e.guidePaused="true"===S.get(o.GUIDE_PAUSE);!function(){const t=new Date;e.currentYear=t.getFullYear(),e.previousYear=2002}(),$("#repositorySelectDropdown").on("hide.bs.dropdown",(function(e){D.isActive()&&$("#repositorySelectDropdown.autoCloseOff").length>0&&e.preventDefault()})),e.$on("$routeChangeSuccess",(function(t,n,r){e.clicked=!1,$(".menu-element-root").removeClass("active"),d((function(){$(".menu-element.open a.menu-element-root").addClass("active"),$(".main-menu.collapsed .menu-element.open .menu-element-root").addClass("active")}),400),r&&c.checkLicenseStatus()})),e.resumeGuide=function(){p.$broadcast("guideResume")},p.$on("guideReset",(function(){e.guidePaused=!1,p.guidePaused=!1})),p.$on("guideStarted",(function(){e.guidePaused=!1,p.guidePaused=!1})),p.$on("guidePaused",(function(){e.guidePaused=!0,p.guidePaused=!0})),p.$on("$translateChangeSuccess",(function(){e.menu.forEach((function(e){e.label=A.instant(e.labelKey),e.children&&e.children.forEach((function(e){e.label=A.instant(e.labelKey)}))})),p.helpInfo=x.trustAsHtml(Object(i.decodeHTML)(A.instant(p.helpInfo))),p.title=Object(i.decodeHTML)(A.instant(p.title)),e.initTutorial()})),e.checkMenu=function(){return $(".main-menu").hasClass("collapsed")},e.copyToClipboard=function(e){f.openCopyToClipboardModal(e)},e.goToAddRepo=function(){u.path("/repository/create").search({previous:"home"})},e.goToEditRepo=function(e){u.path("repository/edit/"+e.id).search({previous:"home",location:e.location})},e.getLocationFromUri=function(e){return l.getLocationFromUri(e)},e.$on("$locationChangeSuccess",(function(){e.showFooter=!0})),e.$on("repositoryIsSet",(function(){e.setRestricted(),S.clearClassHieararchyState()})),e.graphdbVersion=e.engineVersion=h.productVersion,e.workbenchVersion=h.Workbench,e.connectorsVersion=h.connectors,e.sesameVersion=h.sesame,e.select=function(t,n,r){$(".main-menu").hasClass("collapsed")?$(n.target).parents(".menu-element").children(".menu-element-root").hasClass("active")?(e.selected=t,e.clicked=!r):(!$(n.target).parents(".menu-element").hasClass("open")&&r?e.clicked=!0:e.clicked=!r,e.selected===t?e.selected=-1:e.selected=t):(!$(n.target).parents(".menu-element").hasClass("open")&&r?e.clicked=!0:e.clicked=!r,0!==$(n.target).parent(".menu-element").find(".sub-menu").length?($(n.target).parents(".menu-element").children(".menu-element-root").hasClass("active")?$(".sub-menu li.active").parents(".menu-element").children(".menu-element-root").removeClass("active"):$(".sub-menu li.active").parents(".menu-element").children(".menu-element-root").addClass("active"),e.selected===t?e.selected=-1:e.selected=t):(d((function(){$(n.target).parents(".menu-element").children(".menu-element-root").addClass("active")}),50),e.selected=t))},$("body").bind("click",(function(t){!$(t.target).parents(".main-menu").length&&$(".main-menu").hasClass("collapsed")&&(e.clicked=!1,e.selected=-1)})),e.isCurrentPath=function(e){return u.path()==="/"+e},e.isCurrentSubmenuChildPath=function(t){return 0!==t.children.length&&t.children.some((function(t){return e.isCurrentPath(t.href)}))},"/"===u.path()?e.selected=-1:(d((function(){const t=u.path().replace("/",""),n=$('a[href^="'+t+'"]');e.selected=n.closest(".menu-element").index()-1}),200),e.isCurrentPath(u.path())),e.popoverTemplate="js/angular/templates/repositorySize.html",e.securityEnabled=!0,e.isSecurityEnabled=function(){return n.isSecurityEnabled()},e.isFreeAccessEnabled=function(){return n.isFreeAccessEnabled()},e.hasExternalAuthUser=function(){return n.hasExternalAuthUser()},e.isDefaultAuthEnabled=function(){return n.isDefaultAuthEnabled()},e.isUserLoggedIn=function(){return e.userLoggedIn},e.hasActiveLocation=function(){return l.hasActiveLocation()},e.getActiveLocation=function(){return l.getActiveLocation()},e.isLoadingLocation=function(){return l.isLoadingLocation()},e.getRepositories=function(){return l.getRepositories()},e.getReadableRepositories=function(){return l.getReadableRepositories()},e.getWritableRepositories=function(){return l.getWritableRepositories()},e.getActiveRepository=function(){return l.getActiveRepository()},e.canWriteRepoInLocation=function(e){return n.canWriteRepo(e)},e.canWriteActiveRepo=function(e){const t=l.getActiveRepositoryObject();return!!t&&(n.canWriteRepo(t)&&("SYSTEM"!==t.id||!e))},e.getActiveRepositoryObject=function(){return l.getActiveRepositoryObject()},e.getActiveRepositoryShortLocation=function(){const e=l.getActiveRepositoryObject();if(e){const t=e.location;if(t)return"@"+F.shortenIri(t)}return""},e.isActiveRepoOntopType=function(){return l.isActiveRepoOntopType()},e.isActiveRepoFedXType=function(){return l.isActiveRepoFedXType()},e.isLicenseValid=function(){return c.isLicenseValid()},e.setAttrs=function(t){e.attrs=t},e.setRestricted=function(){e.attrs&&(e.isRestricted=e.attrs.hasOwnProperty("license")&&!c.isLicenseValid()||e.attrs.hasOwnProperty("write")&&e.isSecurityEnabled()&&!e.canWriteActiveRepo()||e.attrs.hasOwnProperty("ontop")&&e.isActiveRepoOntopType()||e.attrs.hasOwnProperty("fedx")&&e.isActiveRepoFedXType())},e.toHumanReadableType=function(e){switch(e){case"graphdb":return"Graphdb";case"system":return"System";case"ontop":return"Ontop";case"fedx":return"FedX";default:return"Unknown"}},e.setRepository=function(e){l.setRepository(e)},e.logout=function(){n.clearAuthentication(),s.success("Signed out"),n.freeAccess?(l.resetActiveRepository(),n.updateReturnUrl()):n.isSecurityEnabled()&&p.redirectToLogin()},e.showMainManuAndStatusBar=()=>n.isAuthenticated()||e.isSecurityEnabled()&&e.isFreeAccessEnabled();const P=()=>{setTimeout(()=>{I.location.reload()},0)};let O=void 0;const k=e=>{if(R.AUTH_STORAGE_NAME===e.key){const e=n.isAuthenticated();n.updateReturnUrl(),O!==e&&(O=e,O?(u.url(p.returnToUrl||"/"),T.reload(),P()):(p.redirectToLogin(),P()))}};function j(e){e?$(":root").addClass("menu-collapsed"):$(":root").removeClass("menu-collapsed")}function N(){$(window).width()<=720?($(".container-fluid.main-container").addClass("expanded"),j(!0),$(".main-menu").addClass("collapsed"),$(".main-menu .icon-caret-left").toggleClass("icon-caret-left").toggleClass("icon-caret-right"),$(".toggle-menu").hide()):$(window).width()>720&&"collapsedMenu"===S.get(E.MENU_STATE)?($(".container-fluid.main-container").addClass("expanded"),j(!0),$(".main-menu").addClass("collapsed"),$(".toggle-menu").show(),$(".main-menu .icon-caret-left").toggleClass("icon-caret-left").toggleClass("icon-caret-right")):($(".container-fluid.main-container").removeClass("expanded"),j(!1),$(".main-menu").removeClass("collapsed"),$(".toggle-menu").show(),$(".main-menu .icon-caret-right").toggleClass("icon-caret-right").toggleClass("icon-caret-left"))}window.addEventListener("storage",k),e.$on("$destroy",()=>{window.removeEventListener("storage",k)}),e.isAdmin=function(){return e.hasRole(r.UserRole.ROLE_ADMIN)},e.isUser=function(){return e.hasRole(r.UserRole.ROLE_USER)},e.hasRole=function(e){return!!angular.isUndefined(e)||n.hasRole(e)},e.hasPermission=function(){return p.hasPermission()},e.canReadRepo=function(e){return n.canReadRepo(e)},e.checkForWrite=function(e,t){return n.checkForWrite(e,t)},e.setPopoverRepo=function(t){e.popoverRepo=t},e.isRepoActive=function(e){return l.isRepoActive(e)},e.getRepositorySize=function(){e.repositorySize={},e.popoverRepo&&(e.repositorySize.loading=!0,y.getSize(e.popoverRepo).then((function(t){e.repositorySize=t.data})))},e.getDegradedReason=function(){return l.getDegradedReason()},e.canManageRepositories=function(){return n.hasRole(r.UserRole.ROLE_REPO_MANAGER)&&!l.getDegradedReason()},e.getSavedQueries=function(){w.getSavedQueries().success((function(t){e.sampleQueries=t})).error((function(e){const t=getError(e);s.error(t,A.instant("query.editor.get.saved.queries.error"))}))},e.goToSparqlEditor=function(e){u.path("/sparql").search({savedQueryName:e.name,owner:e.owner,execute:!0})},e.declineTutorial=function(){S.set(E.TUTORIAL_STATE,1),e.tutorialState=!1},e.showTutorial=function(){e.tutorialState=!0,S.remove(E.TUTORIAL_STATE)},e.initTutorial=function(){if(!e.tutorialState&&"/"!==u.path())return;e.tutorialInfo=[{title:A.instant("main.info.title.welcome.page"),info:"<p>"+Object(i.decodeHTML)(A.instant("main.info.welcome.page"))+"</p><p>"+Object(i.decodeHTML)(A.instant("main.info.welcome.page.guides"))+"</p><p>"+Object(i.decodeHTML)(A.instant("main.info.welcome.page.footer"))+"</p>"},{title:A.instant("main.info.title.create.repo.page"),info:Object(i.decodeHTML)(A.instant("main.info.create.repo.page",{link:'<a href="https://graphdb.ontotext.com/documentation/'+h.productShortVersion+'/configuring-a-repository.html" target="_blank">'}))},{title:A.instant("main.info.title.load.sample.dataset"),info:A.instant("main.info.load.sample.dataset")},{title:A.instant("main.info.title.run.sparql.query"),info:Object(i.decodeHTML)(A.instant("main.info.run.sparql.query"))},{title:A.instant("menu.rest.api.label"),info:Object(i.decodeHTML)(A.instant("main.info.rest.api"))}],e.activePage=0,$(".pages-wrapper .page-slide").css("opacity",100);const t=$(".main-container")[0].offsetWidth+200;d((function(){const n=$(".pages-wrapper .page-slide");n.css("left",t+"px"),$(n[e.activePage]).css("left","0px"),$($(".btn-toolbar.pull-right .btn-group .btn")[0]).focus()}),50)},e.getTutorialPageHtml=function(e){return x.trustAsHtml(e.info)},e.checkSubMenuPosition=function(e){0===e?$(".main-menu.collapsed .sub-menu").removeClass("align-bottom"):$(window).height()<735?$(".main-menu.collapsed .sub-menu").addClass("align-bottom"):$(".main-menu.collapsed .sub-menu").removeClass("align-bottom")},N(),$(window).resize((function(){angular.isDefined(e.menuState)?$(window).width()<=720?($(".container-fluid.main-container").addClass("expanded"),j(!0),$(".main-menu").addClass("collapsed"),$(".toggle-menu").hide(),$(".main-menu .icon-caret-left").toggleClass("icon-caret-left").toggleClass("icon-caret-right")):$(window).width()>720&&e.menuState?$(".toggle-menu").show():($(".container-fluid.main-container").removeClass("expanded"),j(!1),$(".main-menu").removeClass("collapsed"),$(".toggle-menu").show(),$(".main-menu .icon-caret-right").toggleClass("icon-caret-right").toggleClass("icon-caret-left")):N(),e.tutorialState&&"/"===u.path()&&e.initTutorial(),$(window).height()<735?($(".sub-menu").addClass("align-bottom"),$(".main-menu.collapsed li:nth-child(2) .sub-menu").removeClass("align-bottom")):$(".sub-menu").removeClass("align-bottom")})),e.slideToPage=function(t){const n=$(".main-container")[0].offsetWidth,r=$(".pages-wrapper .page-slide");r.css("opacity","0").delay(200).css("left",n+"px"),e.activePage=t,$(r[e.activePage]).css("opacity","100").css("left","0px")},e.slideNext=function(){let t=++e.activePage;t>=e.tutorialInfo.length&&(t=0),e.slideToPage(t),$($(".btn-toolbar.pull-right .btn-group .btn")[e.activePage]).focus()},e.toggleNavigation=function(){const t=$(".main-menu"),n=$(".sub-menu li.active");if(t.hasClass("collapsed"))n.parents(".menu-element").hasClass("open")?n.parents(".menu-element").children(".menu-element-root").removeClass("active"):n.parents(".menu-element").children(".menu-element-root").addClass("active"),$(".container-fluid.main-container").removeClass("expanded"),j(!1),t.removeClass("collapsed"),$(".main-menu .icon-caret-right").toggleClass("icon-caret-right").toggleClass("icon-caret-left"),p.$broadcast("onToggleNavWidth",!1);else{n.parents(".menu-element").children(".menu-element-root").addClass("active");const r=$(".menu-element");r.hasClass("open")&&(r.removeClass("open"),e.clicked=!1,e.selected=-1),$(".container-fluid.main-container").addClass("expanded"),j(!0),t.addClass("collapsed"),$(".main-menu .icon-caret-left").toggleClass("icon-caret-left").toggleClass("icon-caret-right"),$(".main-menu.collapsed .menu-element.clicked").removeClass("clicked"),p.$broadcast("onToggleNavWidth",!0)}},e.$on("onToggleNavWidth",(function(t,n){if(e.menuState=n,n?S.set(E.MENU_STATE,"collapsedMenu"):S.set(E.MENU_STATE,"expandedMenu"),e.tutorialState&&"/"===u.path()){const t=$(".pages-wrapper")[0].offsetWidth+200;d((function(){const n=$(".pages-wrapper .page-slide");n.css("left",t+"px"),$(n[e.activePage]).css("left","0px")}),50)}})),n.securityInitialized&&e.getSavedQueries(),e.$on("securityInit",(function(t,r,i,o){e.securityEnabled=r,e.userLoggedIn=i,!r||i||o?(C.when(n.getPrincipal()).then(t=>{e.principal=t,e.isIgnoreSharedQueries=t&&t.appSettings.IGNORE_SHARED_QUERIES}),c.checkLicenseStatus(),setTimeout((function(){e.getSavedQueries()}))):"/login"!==u.path()&&p.redirectToLogin()})),e.isEnterprise=function(){return"enterprise"===e.getProductType()},e.isFreeEdition=function(){return"free"===e.getProductType()},e.checkEdition=function(t){return null==t||_.indexOf(t,e.getProductType())>=0},e.showLicense=function(){return c.showLicense},e.getLicense=function(){return c.license},e.isLicenseHardcoded=function(){return c.isLicenseHardcoded},e.getProductType=function(){return c.productType},e.getProductTypeHuman=function(){return c.productTypeHuman},e.getHumanReadableSeconds=function(e,t){const n=Math.floor(e/86400),r=Math.floor(e%86400/3600),i=Math.floor(e%3600/60);let o;o=t&&e<10?e<1?_.ceil(e%60,1):_.round(e%60,1):_.round(e%60,0);let a="";return n&&(a+=n+"d "),(n||r)&&(a+=r+"h "),(n||r||i)&&(a+=i+"m "),a+=o+"s",a.replace(/( 0[a-z])+$/,"")},e.getHumanReadableTimestamp=function(e){const t=Date.now(),n=(t-e)/1e3;if(n<60)return A.instant("timestamp.moments.ago");if(n<600)return A.instant("timestamp.minutes.ago");{const r=new Date(t),i=new Date(e);if(r.getYear()===i.getYear()&&r.getMonth()===i.getMonth()&&r.getDate()===i.getDate())return m("date")(e,"'"+A.instant("timestamp.today.at")+"' HH:mm");if(n<86400)return m("date")(e,"'"+A.instant("timestamp.yesterday.at")+"' HH:mm")}return m("date")(e,"'"+A.instant("timestamp.on")+"' yyyy-MM-dd '"+A.instant("timestamp.at")+"' HH:mm")}}function u(e,t,n){e.getRepositorySize=function(t){n.getSize(t).then((function(t){e.size=t.data}))}}function l(e,t,n){e.demoToast=function(e,t=!0){n[e]("Consectetur adipiscing elit. Sic transit gloria mundi.",t?"Lorem ipsum dolor sit amet":void 0,{timeOut:3e5,extendedTimeOut:3e5})},e.clearToasts=function(){n.clear()},e.clearRepo=function(){t.setRepository("")}}angular.module("graphdb.workbench.se.controllers",["graphdb.framework.core.services.jwtauth","graphdb.framework.core.services.repositories","graphdb.framework.core.services.licenseService","graphdb.framework.core.services.theme-service","ngCookies","ngFileUpload","graphdb.framework.core","graphdb.framework.core.controllers","graphdb.framework.core.directives","graphdb.framework.rest.license.service","graphdb.framework.rest.autocomplete.service","graphdb.framework.rest.repositories.service","graphdb.framework.rest.sparql.service","graphdb.framework.rest.plugins.service","graphdb.framework.rest.monitoring.service","graphdb.framework.rest.rdf4j.repositories.service","graphdb.framework.utils.localstorageadapter","graphdb.framework.utils.workbenchsettingsstorageservice","graphdb.framework.core.services.autocompleteStatus","graphdb.framework.utils.uriutils","graphdb.framework.guides.directives","graphdb.framework.guides.services"]).controller("mainCtrl",s).controller("homeCtrl",a).controller("repositorySizeCtrl",u).controller("uxTestCtrl",l),a.$inject=["$scope","$rootScope","$http","$repositories","$jwtAuth","$licenseService","AutocompleteRestService","LicenseRestService","RepositoriesRestService","RDF4JRepositoriesRestService","toastr"],s.$inject=["$scope","$menuItems","$jwtAuth","$http","toastr","$location","$repositories","$licenseService","$rootScope","productInfo","$timeout","ModalService","$interval","$filter","LicenseRestService","RepositoriesRestService","MonitoringRestService","SparqlRestService","$sce","LocalStorageAdapter","LSKeys","$translate","UriUtils","$q","GuidesService","$route","$window","AuthTokenService"],u.$inject=["$scope","$http","RepositoriesRestService"],l.$inject=["$scope","$repositories","toastr"]},function(e,t){angular.module("graphdb.framework.core.services.theme-service",[]).factory("ThemeService",r),r.$inject=["WorkbenchSettingsStorageService","$translate","toastr"];const n={name:null,label:null,variables:{"primary-color-hue":null,"primary-color-saturation":null,"primary-color-lightness":null,"secondary-color-hue":null,"secondary-color-saturation":null,"secondary-color-lightness":null,"tertiary-color-hue":null,"tertiary-color-saturation":null,"tertiary-color-lightness":null,"icon-on-primary-color":null,"gray-color":null,"gray-color-dark":null,"color-danger-dark":null,"color-success-dark":null,"color-warning-dark":null,"color-info-dark":null,"color-danger-light":null,"color-success-light":null,"color-warning-light":null,"color-info-light":null,"color-help-light":null,"logo-color":null,"logo-text-color":null,"logo-background-color":null}};function r(e,t,r){const i=()=>{const e=a();return{name:e.name,label:t.instant(e.label)||e.label}},o=e=>{const t=PluginRegistry.findPlugin("themes",t=>t.name===e);return t||("default-theme"!==e?a():void 0)},a=()=>o("default-theme"),s=e=>{const i=function e(t,n,r,i){return Object.keys(t).forEach(o=>{o in n?angular.isObject(t[o])&&e(t[o],n[o],r+o+".",i):i.push(r+o)}),i}(n,e,"",[]);return!i.length||(r.error(t.instant("security.workbench.settings.theme.validation.missing-fields")),console.error(`\n Color theme validation error. Missing definitions in plugin theme: ${i.join(", ")}.\n Check the developers guide how to create a valid color theme.`),!1)},u=e=>{function t(e,t,n){e[t]||(e[t]=n)}function n(e,n=!0){const r={};for(const[t,n]of Object.entries(e.variables))r["--"+t]=n;if("properties"in e)for(const[t,n]of Object.entries(e.properties))r[t]=n;if(n)for(const e of["primary","secondary","tertiary"])t(r,`--${e}-color-hsl`,`var(--${e}-color-hue), var(--${e}-color-saturation), var(--${e}-color-lightness)`),t(r,`--${e}-color`,`hsl(var(--${e}-color-hsl))`),t(r,`--${e}-color-light`,`hsl(var(--${e}-color-hue), var(--${e}-color-saturation), calc(var(--${e}-color-lightness)*1.2))`),t(r,`--${e}-color-dark`,`hsl(var(--${e}-color-hue), var(--${e}-color-saturation), calc(var(--${e}-color-lightness)*0.8))`);return i=r,Object.entries(i).map(e=>e[0]+": "+e[1]+";").join("\n");var i}const r=e.dark;return`\n :root {\n ${n(e)}\n }\n\n :root.dark {\n ${r?n(r,!1):""}\n }\n `};return{applyDarkThemeMode:()=>{if("dark"===e.getWorkbenchSettings().mode){document.querySelector(":root").classList.add("dark")}},toggleThemeMode:e=>{const t=document.querySelector(":root");"dark"===e?t.classList.add("dark"):t.classList.remove("dark")},getDefaultTheme:i,getThemeDefinition:()=>{const t=e.getThemeName();let n=PluginRegistry.findPlugin("themes",e=>e.name===t);return n||(n=a()),n},getTheme:()=>{let n;const r=(()=>{const t=e.getThemeName();return o(t)})();return n=r?{name:r.name,label:t.instant(r.label)||r.label}:i(),n},getThemes:()=>PluginRegistry.get("themes").filter(s).map(e=>({name:e.name,label:t.instant(e.label)||e.label})),applyTheme:e=>{const t=(e=>{const t=u(e),n=new CSSStyleSheet;return n.title=e.name,n.replaceSync(t),n})(o(e));document.adoptedStyleSheets=[t]}}}},function(e,t){angular.module("graphdb.framework.core.services.licenseService",[]).service("$licenseService",["$rootScope","LicenseRestService","$translate",function(e,t,n){const r=this;this.checkLicenseStatus=function(){r.loadingLicense=!0,t.getHardcodedLicense().success((function(e){r.isLicenseHardcoded="true"===e})).error((function(){r.isLicenseHardcoded=!0})).then((function(){t.getLicenseInfo().then((function(e){r.license=e.data,r.showLicense=!0,r.loadingLicense=!1,i(r.license)}),(function(){r.license={message:n.instant("no.license.set.msg"),valid:!1},r.showLicense=!0,r.loadingLicense=!1,i(r.license)}))}))};const i=function(e){r.productType=e.productType,"standard"===r.productType?r.productTypeHuman="Standard":"enterprise"===r.productType?r.productTypeHuman="Enterprise":"free"===r.productType?r.productTypeHuman="Free":"graphdb"===r.productType&&(r.productTypeHuman="GraphDB")};this.checkLicenseStatus(),this.isLicenseValid=function(){return r.license&&r.license.valid}}])},function(e,t){function n(e,t){const n={theme:"default-theme",mode:"light"},r=()=>{let r=e.get(t.WORKBENCH_SETTINGS);return r||(r=n),r};return{getWorkbenchSettings:r,saveWorkbenchSettings:n=>{e.set(t.WORKBENCH_SETTINGS,n)},getThemeName:()=>{const e=r();if(e&&e.theme)return e.theme},saveTheme:n=>{const i=r();i.theme=n,e.set(t.WORKBENCH_SETTINGS,i)}}}angular.module("graphdb.framework.utils.workbenchsettingsstorageservice",[]).factory("WorkbenchSettingsStorageService",n),n.$inject=["LocalStorageAdapter","LSKeys"]},function(e,t){angular.module("graphdb.framework.core.services.autocompleteStatus",[]).service("$autocompleteStatus",["$rootScope","AutocompleteRestService","LocalStorageAdapter","LSKeys","$repositories",function(e,t,n,r,i){const o=this;this.setAutocompleteStatus=function(t){n.set(r.AUTOCOMPLETE_ENABLED,t),e.$broadcast("autocompleteStatus",t)},e.$watch((function(){return n.get(r.AUTOCOMPLETE_ENABLED)}),(function(e){o.setAutocompleteStatus(e)}),!0),e.$on("repositoryIsSet",(function(){!i.getActiveRepository()||i.isActiveRepoOntopType()||i.isActiveRepoFedXType()||t.checkAutocompleteStatus().success((function(e){o.setAutocompleteStatus(e)}))}))}])},function(e,t){angular.module("graphdb.framework.guides.directives",[]).directive("guideSelector",(function(){return{}}))},function(e,t){
29
29
  /**
30
30
  * angular-cancel-on-navigate - AngularJS module that cancels HTTP requests on location change (navigation)
31
31
  * @version v0.1.0
@@ -52,14 +52,14 @@ angular.module("angularCancelOnNavigateModule",[]).config(["$httpProvider",funct
52
52
  * Released under MIT license <https://lodash.com/license>
53
53
  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
54
54
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
55
- */(function(){var o="Expected a function",a="__lodash_placeholder__",s=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],u="[object Arguments]",l="[object Array]",c="[object Boolean]",p="[object Date]",h="[object Error]",d="[object Function]",f="[object GeneratorFunction]",g="[object Map]",m="[object Number]",v="[object Object]",y="[object RegExp]",b="[object Set]",w="[object String]",x="[object Symbol]",S="[object WeakMap]",E="[object ArrayBuffer]",A="[object DataView]",F="[object Float32Array]",C="[object Float64Array]",$="[object Int8Array]",D="[object Int16Array]",T="[object Int32Array]",I="[object Uint8Array]",R="[object Uint16Array]",P="[object Uint32Array]",O=/\b__p \+= '';/g,k=/\b(__p \+=) '' \+/g,_=/(__e\(.*?\)|\b__t\)) \+\n'';/g,j=/&(?:amp|lt|gt|quot|#39);/g,N=/[&<>"']/g,L=RegExp(j.source),B=RegExp(N.source),U=/<%-([\s\S]+?)%>/g,M=/<%([\s\S]+?)%>/g,H=/<%=([\s\S]+?)%>/g,V=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,q=/^\w*$/,K=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,z=/[\\^$.*+?()[\]{}|]/g,G=RegExp(z.source),W=/^\s+/,Y=/\s/,X=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,J=/\{\n\/\* \[wrapped with (.+)\] \*/,Z=/,? & /,Q=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ee=/[()=,{}\[\]\/\s]/,te=/\\(\\)?/g,ne=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,re=/\w*$/,ie=/^[-+]0x[0-9a-f]+$/i,oe=/^0b[01]+$/i,ae=/^\[object .+?Constructor\]$/,se=/^0o[0-7]+$/i,ue=/^(?:0|[1-9]\d*)$/,le=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ce=/($^)/,pe=/['\n\r\u2028\u2029\\]/g,he="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",de="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",fe="[\\ud800-\\udfff]",ge="["+de+"]",me="["+he+"]",ve="\\d+",ye="[\\u2700-\\u27bf]",be="[a-z\\xdf-\\xf6\\xf8-\\xff]",we="[^\\ud800-\\udfff"+de+ve+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",xe="\\ud83c[\\udffb-\\udfff]",Se="[^\\ud800-\\udfff]",Ee="(?:\\ud83c[\\udde6-\\uddff]){2}",Ae="[\\ud800-\\udbff][\\udc00-\\udfff]",Fe="[A-Z\\xc0-\\xd6\\xd8-\\xde]",Ce="(?:"+be+"|"+we+")",$e="(?:"+Fe+"|"+we+")",De="(?:"+me+"|"+xe+")"+"?",Te="[\\ufe0e\\ufe0f]?"+De+("(?:\\u200d(?:"+[Se,Ee,Ae].join("|")+")[\\ufe0e\\ufe0f]?"+De+")*"),Ie="(?:"+[ye,Ee,Ae].join("|")+")"+Te,Re="(?:"+[Se+me+"?",me,Ee,Ae,fe].join("|")+")",Pe=RegExp("['’]","g"),Oe=RegExp(me,"g"),ke=RegExp(xe+"(?="+xe+")|"+Re+Te,"g"),_e=RegExp([Fe+"?"+be+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[ge,Fe,"$"].join("|")+")",$e+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[ge,Fe+Ce,"$"].join("|")+")",Fe+"?"+Ce+"+(?:['’](?:d|ll|m|re|s|t|ve))?",Fe+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ve,Ie].join("|"),"g"),je=RegExp("[\\u200d\\ud800-\\udfff"+he+"\\ufe0e\\ufe0f]"),Ne=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Le=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Be=-1,Ue={};Ue[F]=Ue[C]=Ue[$]=Ue[D]=Ue[T]=Ue[I]=Ue["[object Uint8ClampedArray]"]=Ue[R]=Ue[P]=!0,Ue[u]=Ue[l]=Ue[E]=Ue[c]=Ue[A]=Ue[p]=Ue[h]=Ue[d]=Ue[g]=Ue[m]=Ue[v]=Ue[y]=Ue[b]=Ue[w]=Ue[S]=!1;var Me={};Me[u]=Me[l]=Me[E]=Me[A]=Me[c]=Me[p]=Me[F]=Me[C]=Me[$]=Me[D]=Me[T]=Me[g]=Me[m]=Me[v]=Me[y]=Me[b]=Me[w]=Me[x]=Me[I]=Me["[object Uint8ClampedArray]"]=Me[R]=Me[P]=!0,Me[h]=Me[d]=Me[S]=!1;var He={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ve=parseFloat,qe=parseInt,Ke="object"==typeof e&&e&&e.Object===Object&&e,ze="object"==typeof self&&self&&self.Object===Object&&self,Ge=Ke||ze||Function("return this")(),We=t&&!t.nodeType&&t,Ye=We&&"object"==typeof r&&r&&!r.nodeType&&r,Xe=Ye&&Ye.exports===We,Je=Xe&&Ke.process,Ze=function(){try{var e=Ye&&Ye.require&&Ye.require("util").types;return e||Je&&Je.binding&&Je.binding("util")}catch(e){}}(),Qe=Ze&&Ze.isArrayBuffer,et=Ze&&Ze.isDate,tt=Ze&&Ze.isMap,nt=Ze&&Ze.isRegExp,rt=Ze&&Ze.isSet,it=Ze&&Ze.isTypedArray;function ot(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function at(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(r,a,n(a),e)}return r}function st(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function ut(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function lt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function ct(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}function pt(e,t){return!!(null==e?0:e.length)&&xt(e,t,0)>-1}function ht(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function dt(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}function ft(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function gt(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function mt(e,t,n,r){var i=null==e?0:e.length;for(r&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function vt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var yt=Ft("length");function bt(e,t,n){var r;return n(e,(function(e,n,i){if(t(e,n,i))return r=n,!1})),r}function wt(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function xt(e,t,n){return t==t?function(e,t,n){var r=n-1,i=e.length;for(;++r<i;)if(e[r]===t)return r;return-1}(e,t,n):wt(e,Et,n)}function St(e,t,n,r){for(var i=n-1,o=e.length;++i<o;)if(r(e[i],t))return i;return-1}function Et(e){return e!=e}function At(e,t){var n=null==e?0:e.length;return n?Dt(e,t)/n:NaN}function Ft(e){return function(t){return null==t?void 0:t[e]}}function Ct(e){return function(t){return null==e?void 0:e[t]}}function $t(e,t,n,r,i){return i(e,(function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)})),n}function Dt(e,t){for(var n,r=-1,i=e.length;++r<i;){var o=t(e[r]);void 0!==o&&(n=void 0===n?o:n+o)}return n}function Tt(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function It(e){return e?e.slice(0,Wt(e)+1).replace(W,""):e}function Rt(e){return function(t){return e(t)}}function Pt(e,t){return dt(t,(function(t){return e[t]}))}function Ot(e,t){return e.has(t)}function kt(e,t){for(var n=-1,r=e.length;++n<r&&xt(t,e[n],0)>-1;);return n}function _t(e,t){for(var n=e.length;n--&&xt(t,e[n],0)>-1;);return n}function jt(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var Nt=Ct({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Lt=Ct({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function Bt(e){return"\\"+He[e]}function Ut(e){return je.test(e)}function Mt(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function Ht(e,t){return function(n){return e(t(n))}}function Vt(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var s=e[n];s!==t&&s!==a||(e[n]=a,o[i++]=n)}return o}function qt(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}function Kt(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=[e,e]})),n}function zt(e){return Ut(e)?function(e){var t=ke.lastIndex=0;for(;ke.test(e);)++t;return t}(e):yt(e)}function Gt(e){return Ut(e)?function(e){return e.match(ke)||[]}(e):function(e){return e.split("")}(e)}function Wt(e){for(var t=e.length;t--&&Y.test(e.charAt(t)););return t}var Yt=Ct({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"});var Xt=function e(t){var n,r=(t=null==t?Ge:Xt.defaults(Ge.Object(),t,Xt.pick(Ge,Le))).Array,i=t.Date,Y=t.Error,he=t.Function,de=t.Math,fe=t.Object,ge=t.RegExp,me=t.String,ve=t.TypeError,ye=r.prototype,be=he.prototype,we=fe.prototype,xe=t["__core-js_shared__"],Se=be.toString,Ee=we.hasOwnProperty,Ae=0,Fe=(n=/[^.]+$/.exec(xe&&xe.keys&&xe.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Ce=we.toString,$e=Se.call(fe),De=Ge._,Te=ge("^"+Se.call(Ee).replace(z,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ie=Xe?t.Buffer:void 0,Re=t.Symbol,ke=t.Uint8Array,je=Ie?Ie.allocUnsafe:void 0,He=Ht(fe.getPrototypeOf,fe),Ke=fe.create,ze=we.propertyIsEnumerable,We=ye.splice,Ye=Re?Re.isConcatSpreadable:void 0,Je=Re?Re.iterator:void 0,Ze=Re?Re.toStringTag:void 0,yt=function(){try{var e=eo(fe,"defineProperty");return e({},"",{}),e}catch(e){}}(),Ct=t.clearTimeout!==Ge.clearTimeout&&t.clearTimeout,Jt=i&&i.now!==Ge.Date.now&&i.now,Zt=t.setTimeout!==Ge.setTimeout&&t.setTimeout,Qt=de.ceil,en=de.floor,tn=fe.getOwnPropertySymbols,nn=Ie?Ie.isBuffer:void 0,rn=t.isFinite,on=ye.join,an=Ht(fe.keys,fe),sn=de.max,un=de.min,ln=i.now,cn=t.parseInt,pn=de.random,hn=ye.reverse,dn=eo(t,"DataView"),fn=eo(t,"Map"),gn=eo(t,"Promise"),mn=eo(t,"Set"),vn=eo(t,"WeakMap"),yn=eo(fe,"create"),bn=vn&&new vn,wn={},xn=Do(dn),Sn=Do(fn),En=Do(gn),An=Do(mn),Fn=Do(vn),Cn=Re?Re.prototype:void 0,$n=Cn?Cn.valueOf:void 0,Dn=Cn?Cn.toString:void 0;function Tn(e){if(Ka(e)&&!ka(e)&&!(e instanceof On)){if(e instanceof Pn)return e;if(Ee.call(e,"__wrapped__"))return To(e)}return new Pn(e)}var In=function(){function e(){}return function(t){if(!qa(t))return{};if(Ke)return Ke(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Rn(){}function Pn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function On(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function kn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function _n(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function jn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Nn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new jn;++t<n;)this.add(e[t])}function Ln(e){var t=this.__data__=new _n(e);this.size=t.size}function Bn(e,t){var n=ka(e),r=!n&&Oa(e),i=!n&&!r&&La(e),o=!n&&!r&&!i&&Qa(e),a=n||r||i||o,s=a?Tt(e.length,me):[],u=s.length;for(var l in e)!t&&!Ee.call(e,l)||a&&("length"==l||i&&("offset"==l||"parent"==l)||o&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||so(l,u))||s.push(l);return s}function Un(e){var t=e.length;return t?e[Nr(0,t-1)]:void 0}function Mn(e,t){return Fo(yi(e),Xn(t,0,e.length))}function Hn(e){return Fo(yi(e))}function Vn(e,t,n){(void 0!==n&&!Ia(e[t],n)||void 0===n&&!(t in e))&&Wn(e,t,n)}function qn(e,t,n){var r=e[t];Ee.call(e,t)&&Ia(r,n)&&(void 0!==n||t in e)||Wn(e,t,n)}function Kn(e,t){for(var n=e.length;n--;)if(Ia(e[n][0],t))return n;return-1}function zn(e,t,n,r){return tr(e,(function(e,i,o){t(r,e,n(e),o)})),r}function Gn(e,t){return e&&bi(t,xs(t),e)}function Wn(e,t,n){"__proto__"==t&&yt?yt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Yn(e,t){for(var n=-1,i=t.length,o=r(i),a=null==e;++n<i;)o[n]=a?void 0:ms(e,t[n]);return o}function Xn(e,t,n){return e==e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=e>=t?e:t)),e}function Jn(e,t,n,r,i,o){var a,s=1&t,l=2&t,h=4&t;if(n&&(a=i?n(e,r,i,o):n(e)),void 0!==a)return a;if(!qa(e))return e;var S=ka(e);if(S){if(a=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&Ee.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!s)return yi(e,a)}else{var O=ro(e),k=O==d||O==f;if(La(e))return hi(e,s);if(O==v||O==u||k&&!i){if(a=l||k?{}:oo(e),!s)return l?function(e,t){return bi(e,no(e),t)}(e,function(e,t){return e&&bi(t,Ss(t),e)}(a,e)):function(e,t){return bi(e,to(e),t)}(e,Gn(a,e))}else{if(!Me[O])return i?e:{};a=function(e,t,n){var r=e.constructor;switch(t){case E:return di(e);case c:case p:return new r(+e);case A:return function(e,t){var n=t?di(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case F:case C:case $:case D:case T:case I:case"[object Uint8ClampedArray]":case R:case P:return fi(e,n);case g:return new r;case m:case w:return new r(e);case y:return function(e){var t=new e.constructor(e.source,re.exec(e));return t.lastIndex=e.lastIndex,t}(e);case b:return new r;case x:return i=e,$n?fe($n.call(i)):{}}var i}(e,O,s)}}o||(o=new Ln);var _=o.get(e);if(_)return _;o.set(e,a),Xa(e)?e.forEach((function(r){a.add(Jn(r,t,n,r,e,o))})):za(e)&&e.forEach((function(r,i){a.set(i,Jn(r,t,n,i,e,o))}));var j=S?void 0:(h?l?Gi:zi:l?Ss:xs)(e);return st(j||e,(function(r,i){j&&(r=e[i=r]),qn(a,i,Jn(r,t,n,i,e,o))})),a}function Zn(e,t,n){var r=n.length;if(null==e)return!r;for(e=fe(e);r--;){var i=n[r],o=t[i],a=e[i];if(void 0===a&&!(i in e)||!o(a))return!1}return!0}function Qn(e,t,n){if("function"!=typeof e)throw new ve(o);return xo((function(){e.apply(void 0,n)}),t)}function er(e,t,n,r){var i=-1,o=pt,a=!0,s=e.length,u=[],l=t.length;if(!s)return u;n&&(t=dt(t,Rt(n))),r?(o=ht,a=!1):t.length>=200&&(o=Ot,a=!1,t=new Nn(t));e:for(;++i<s;){var c=e[i],p=null==n?c:n(c);if(c=r||0!==c?c:0,a&&p==p){for(var h=l;h--;)if(t[h]===p)continue e;u.push(c)}else o(t,p,r)||u.push(c)}return u}Tn.templateSettings={escape:U,evaluate:M,interpolate:H,variable:"",imports:{_:Tn}},Tn.prototype=Rn.prototype,Tn.prototype.constructor=Tn,Pn.prototype=In(Rn.prototype),Pn.prototype.constructor=Pn,On.prototype=In(Rn.prototype),On.prototype.constructor=On,kn.prototype.clear=function(){this.__data__=yn?yn(null):{},this.size=0},kn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},kn.prototype.get=function(e){var t=this.__data__;if(yn){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Ee.call(t,e)?t[e]:void 0},kn.prototype.has=function(e){var t=this.__data__;return yn?void 0!==t[e]:Ee.call(t,e)},kn.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=yn&&void 0===t?"__lodash_hash_undefined__":t,this},_n.prototype.clear=function(){this.__data__=[],this.size=0},_n.prototype.delete=function(e){var t=this.__data__,n=Kn(t,e);return!(n<0)&&(n==t.length-1?t.pop():We.call(t,n,1),--this.size,!0)},_n.prototype.get=function(e){var t=this.__data__,n=Kn(t,e);return n<0?void 0:t[n][1]},_n.prototype.has=function(e){return Kn(this.__data__,e)>-1},_n.prototype.set=function(e,t){var n=this.__data__,r=Kn(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},jn.prototype.clear=function(){this.size=0,this.__data__={hash:new kn,map:new(fn||_n),string:new kn}},jn.prototype.delete=function(e){var t=Zi(this,e).delete(e);return this.size-=t?1:0,t},jn.prototype.get=function(e){return Zi(this,e).get(e)},jn.prototype.has=function(e){return Zi(this,e).has(e)},jn.prototype.set=function(e,t){var n=Zi(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Nn.prototype.add=Nn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Nn.prototype.has=function(e){return this.__data__.has(e)},Ln.prototype.clear=function(){this.__data__=new _n,this.size=0},Ln.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Ln.prototype.get=function(e){return this.__data__.get(e)},Ln.prototype.has=function(e){return this.__data__.has(e)},Ln.prototype.set=function(e,t){var n=this.__data__;if(n instanceof _n){var r=n.__data__;if(!fn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new jn(r)}return n.set(e,t),this.size=n.size,this};var tr=Si(lr),nr=Si(cr,!0);function rr(e,t){var n=!0;return tr(e,(function(e,r,i){return n=!!t(e,r,i)})),n}function ir(e,t,n){for(var r=-1,i=e.length;++r<i;){var o=e[r],a=t(o);if(null!=a&&(void 0===s?a==a&&!Za(a):n(a,s)))var s=a,u=o}return u}function or(e,t){var n=[];return tr(e,(function(e,r,i){t(e,r,i)&&n.push(e)})),n}function ar(e,t,n,r,i){var o=-1,a=e.length;for(n||(n=ao),i||(i=[]);++o<a;){var s=e[o];t>0&&n(s)?t>1?ar(s,t-1,n,r,i):ft(i,s):r||(i[i.length]=s)}return i}var sr=Ei(),ur=Ei(!0);function lr(e,t){return e&&sr(e,t,xs)}function cr(e,t){return e&&ur(e,t,xs)}function pr(e,t){return ct(t,(function(t){return Ma(e[t])}))}function hr(e,t){for(var n=0,r=(t=ui(t,e)).length;null!=e&&n<r;)e=e[$o(t[n++])];return n&&n==r?e:void 0}function dr(e,t,n){var r=t(e);return ka(e)?r:ft(r,n(e))}function fr(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Ze&&Ze in fe(e)?function(e){var t=Ee.call(e,Ze),n=e[Ze];try{e[Ze]=void 0;var r=!0}catch(e){}var i=Ce.call(e);r&&(t?e[Ze]=n:delete e[Ze]);return i}(e):function(e){return Ce.call(e)}(e)}function gr(e,t){return e>t}function mr(e,t){return null!=e&&Ee.call(e,t)}function vr(e,t){return null!=e&&t in fe(e)}function yr(e,t,n){for(var i=n?ht:pt,o=e[0].length,a=e.length,s=a,u=r(a),l=1/0,c=[];s--;){var p=e[s];s&&t&&(p=dt(p,Rt(t))),l=un(p.length,l),u[s]=!n&&(t||o>=120&&p.length>=120)?new Nn(s&&p):void 0}p=e[0];var h=-1,d=u[0];e:for(;++h<o&&c.length<l;){var f=p[h],g=t?t(f):f;if(f=n||0!==f?f:0,!(d?Ot(d,g):i(c,g,n))){for(s=a;--s;){var m=u[s];if(!(m?Ot(m,g):i(e[s],g,n)))continue e}d&&d.push(g),c.push(f)}}return c}function br(e,t,n){var r=null==(e=vo(e,t=ui(t,e)))?e:e[$o(Uo(t))];return null==r?void 0:ot(r,e,n)}function wr(e){return Ka(e)&&fr(e)==u}function xr(e,t,n,r,i){return e===t||(null==e||null==t||!Ka(e)&&!Ka(t)?e!=e&&t!=t:function(e,t,n,r,i,o){var a=ka(e),s=ka(t),d=a?l:ro(e),f=s?l:ro(t),S=(d=d==u?v:d)==v,F=(f=f==u?v:f)==v,C=d==f;if(C&&La(e)){if(!La(t))return!1;a=!0,S=!1}if(C&&!S)return o||(o=new Ln),a||Qa(e)?qi(e,t,n,r,i,o):function(e,t,n,r,i,o,a){switch(n){case A:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case E:return!(e.byteLength!=t.byteLength||!o(new ke(e),new ke(t)));case c:case p:case m:return Ia(+e,+t);case h:return e.name==t.name&&e.message==t.message;case y:case w:return e==t+"";case g:var s=Mt;case b:var u=1&r;if(s||(s=qt),e.size!=t.size&&!u)return!1;var l=a.get(e);if(l)return l==t;r|=2,a.set(e,t);var d=qi(s(e),s(t),r,i,o,a);return a.delete(e),d;case x:if($n)return $n.call(e)==$n.call(t)}return!1}(e,t,d,n,r,i,o);if(!(1&n)){var $=S&&Ee.call(e,"__wrapped__"),D=F&&Ee.call(t,"__wrapped__");if($||D){var T=$?e.value():e,I=D?t.value():t;return o||(o=new Ln),i(T,I,n,r,o)}}if(!C)return!1;return o||(o=new Ln),function(e,t,n,r,i,o){var a=1&n,s=zi(e),u=s.length,l=zi(t).length;if(u!=l&&!a)return!1;var c=u;for(;c--;){var p=s[c];if(!(a?p in t:Ee.call(t,p)))return!1}var h=o.get(e),d=o.get(t);if(h&&d)return h==t&&d==e;var f=!0;o.set(e,t),o.set(t,e);var g=a;for(;++c<u;){p=s[c];var m=e[p],v=t[p];if(r)var y=a?r(v,m,p,t,e,o):r(m,v,p,e,t,o);if(!(void 0===y?m===v||i(m,v,n,r,o):y)){f=!1;break}g||(g="constructor"==p)}if(f&&!g){var b=e.constructor,w=t.constructor;b==w||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof w&&w instanceof w||(f=!1)}return o.delete(e),o.delete(t),f}(e,t,n,r,i,o)}(e,t,n,r,xr,i))}function Sr(e,t,n,r){var i=n.length,o=i,a=!r;if(null==e)return!o;for(e=fe(e);i--;){var s=n[i];if(a&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<o;){var u=(s=n[i])[0],l=e[u],c=s[1];if(a&&s[2]){if(void 0===l&&!(u in e))return!1}else{var p=new Ln;if(r)var h=r(l,c,u,e,t,p);if(!(void 0===h?xr(c,l,3,r,p):h))return!1}}return!0}function Er(e){return!(!qa(e)||(t=e,Fe&&Fe in t))&&(Ma(e)?Te:ae).test(Do(e));var t}function Ar(e){return"function"==typeof e?e:null==e?Gs:"object"==typeof e?ka(e)?Ir(e[0],e[1]):Tr(e):nu(e)}function Fr(e){if(!ho(e))return an(e);var t=[];for(var n in fe(e))Ee.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Cr(e){if(!qa(e))return function(e){var t=[];if(null!=e)for(var n in fe(e))t.push(n);return t}(e);var t=ho(e),n=[];for(var r in e)("constructor"!=r||!t&&Ee.call(e,r))&&n.push(r);return n}function $r(e,t){return e<t}function Dr(e,t){var n=-1,i=ja(e)?r(e.length):[];return tr(e,(function(e,r,o){i[++n]=t(e,r,o)})),i}function Tr(e){var t=Qi(e);return 1==t.length&&t[0][2]?go(t[0][0],t[0][1]):function(n){return n===e||Sr(n,e,t)}}function Ir(e,t){return lo(e)&&fo(t)?go($o(e),t):function(n){var r=ms(n,e);return void 0===r&&r===t?vs(n,e):xr(t,r,3)}}function Rr(e,t,n,r,i){e!==t&&sr(t,(function(o,a){if(i||(i=new Ln),qa(o))!function(e,t,n,r,i,o,a){var s=bo(e,n),u=bo(t,n),l=a.get(u);if(l)return void Vn(e,n,l);var c=o?o(s,u,n+"",e,t,a):void 0,p=void 0===c;if(p){var h=ka(u),d=!h&&La(u),f=!h&&!d&&Qa(u);c=u,h||d||f?ka(s)?c=s:Na(s)?c=yi(s):d?(p=!1,c=hi(u,!0)):f?(p=!1,c=fi(u,!0)):c=[]:Wa(u)||Oa(u)?(c=s,Oa(s)?c=ss(s):qa(s)&&!Ma(s)||(c=oo(u))):p=!1}p&&(a.set(u,c),i(c,u,r,o,a),a.delete(u));Vn(e,n,c)}(e,t,a,n,Rr,r,i);else{var s=r?r(bo(e,a),o,a+"",e,t,i):void 0;void 0===s&&(s=o),Vn(e,a,s)}}),Ss)}function Pr(e,t){var n=e.length;if(n)return so(t+=t<0?n:0,n)?e[t]:void 0}function Or(e,t,n){t=t.length?dt(t,(function(e){return ka(e)?function(t){return hr(t,1===e.length?e[0]:e)}:e})):[Gs];var r=-1;return t=dt(t,Rt(Ji())),function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}(Dr(e,(function(e,n,i){return{criteria:dt(t,(function(t){return t(e)})),index:++r,value:e}})),(function(e,t){return function(e,t,n){var r=-1,i=e.criteria,o=t.criteria,a=i.length,s=n.length;for(;++r<a;){var u=gi(i[r],o[r]);if(u){if(r>=s)return u;var l=n[r];return u*("desc"==l?-1:1)}}return e.index-t.index}(e,t,n)}))}function kr(e,t,n){for(var r=-1,i=t.length,o={};++r<i;){var a=t[r],s=hr(e,a);n(s,a)&&Hr(o,ui(a,e),s)}return o}function _r(e,t,n,r){var i=r?St:xt,o=-1,a=t.length,s=e;for(e===t&&(t=yi(t)),n&&(s=dt(e,Rt(n)));++o<a;)for(var u=0,l=t[o],c=n?n(l):l;(u=i(s,c,u,r))>-1;)s!==e&&We.call(s,u,1),We.call(e,u,1);return e}function jr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;so(i)?We.call(e,i,1):ei(e,i)}}return e}function Nr(e,t){return e+en(pn()*(t-e+1))}function Lr(e,t){var n="";if(!e||t<1||t>9007199254740991)return n;do{t%2&&(n+=e),(t=en(t/2))&&(e+=e)}while(t);return n}function Br(e,t){return So(mo(e,t,Gs),e+"")}function Ur(e){return Un(Is(e))}function Mr(e,t){var n=Is(e);return Fo(n,Xn(t,0,n.length))}function Hr(e,t,n,r){if(!qa(e))return e;for(var i=-1,o=(t=ui(t,e)).length,a=o-1,s=e;null!=s&&++i<o;){var u=$o(t[i]),l=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(i!=a){var c=s[u];void 0===(l=r?r(c,u,s):void 0)&&(l=qa(c)?c:so(t[i+1])?[]:{})}qn(s,u,l),s=s[u]}return e}var Vr=bn?function(e,t){return bn.set(e,t),e}:Gs,qr=yt?function(e,t){return yt(e,"toString",{configurable:!0,enumerable:!1,value:qs(t),writable:!0})}:Gs;function Kr(e){return Fo(Is(e))}function zr(e,t,n){var i=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var a=r(o);++i<o;)a[i]=e[i+t];return a}function Gr(e,t){var n;return tr(e,(function(e,r,i){return!(n=t(e,r,i))})),!!n}function Wr(e,t,n){var r=0,i=null==e?r:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;r<i;){var o=r+i>>>1,a=e[o];null!==a&&!Za(a)&&(n?a<=t:a<t)?r=o+1:i=o}return i}return Yr(e,t,Gs,n)}function Yr(e,t,n,r){var i=0,o=null==e?0:e.length;if(0===o)return 0;for(var a=(t=n(t))!=t,s=null===t,u=Za(t),l=void 0===t;i<o;){var c=en((i+o)/2),p=n(e[c]),h=void 0!==p,d=null===p,f=p==p,g=Za(p);if(a)var m=r||f;else m=l?f&&(r||h):s?f&&h&&(r||!d):u?f&&h&&!d&&(r||!g):!d&&!g&&(r?p<=t:p<t);m?i=c+1:o=c}return un(o,4294967294)}function Xr(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var a=e[n],s=t?t(a):a;if(!n||!Ia(s,u)){var u=s;o[i++]=0===a?0:a}}return o}function Jr(e){return"number"==typeof e?e:Za(e)?NaN:+e}function Zr(e){if("string"==typeof e)return e;if(ka(e))return dt(e,Zr)+"";if(Za(e))return Dn?Dn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Qr(e,t,n){var r=-1,i=pt,o=e.length,a=!0,s=[],u=s;if(n)a=!1,i=ht;else if(o>=200){var l=t?null:Li(e);if(l)return qt(l);a=!1,i=Ot,u=new Nn}else u=t?[]:s;e:for(;++r<o;){var c=e[r],p=t?t(c):c;if(c=n||0!==c?c:0,a&&p==p){for(var h=u.length;h--;)if(u[h]===p)continue e;t&&u.push(p),s.push(c)}else i(u,p,n)||(u!==s&&u.push(p),s.push(c))}return s}function ei(e,t){return null==(e=vo(e,t=ui(t,e)))||delete e[$o(Uo(t))]}function ti(e,t,n,r){return Hr(e,t,n(hr(e,t)),r)}function ni(e,t,n,r){for(var i=e.length,o=r?i:-1;(r?o--:++o<i)&&t(e[o],o,e););return n?zr(e,r?0:o,r?o+1:i):zr(e,r?o+1:0,r?i:o)}function ri(e,t){var n=e;return n instanceof On&&(n=n.value()),gt(t,(function(e,t){return t.func.apply(t.thisArg,ft([e],t.args))}),n)}function ii(e,t,n){var i=e.length;if(i<2)return i?Qr(e[0]):[];for(var o=-1,a=r(i);++o<i;)for(var s=e[o],u=-1;++u<i;)u!=o&&(a[o]=er(a[o]||s,e[u],t,n));return Qr(ar(a,1),t,n)}function oi(e,t,n){for(var r=-1,i=e.length,o=t.length,a={};++r<i;){var s=r<o?t[r]:void 0;n(a,e[r],s)}return a}function ai(e){return Na(e)?e:[]}function si(e){return"function"==typeof e?e:Gs}function ui(e,t){return ka(e)?e:lo(e,t)?[e]:Co(us(e))}var li=Br;function ci(e,t,n){var r=e.length;return n=void 0===n?r:n,!t&&n>=r?e:zr(e,t,n)}var pi=Ct||function(e){return Ge.clearTimeout(e)};function hi(e,t){if(t)return e.slice();var n=e.length,r=je?je(n):new e.constructor(n);return e.copy(r),r}function di(e){var t=new e.constructor(e.byteLength);return new ke(t).set(new ke(e)),t}function fi(e,t){var n=t?di(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function gi(e,t){if(e!==t){var n=void 0!==e,r=null===e,i=e==e,o=Za(e),a=void 0!==t,s=null===t,u=t==t,l=Za(t);if(!s&&!l&&!o&&e>t||o&&a&&u&&!s&&!l||r&&a&&u||!n&&u||!i)return 1;if(!r&&!o&&!l&&e<t||l&&n&&i&&!r&&!o||s&&n&&i||!a&&i||!u)return-1}return 0}function mi(e,t,n,i){for(var o=-1,a=e.length,s=n.length,u=-1,l=t.length,c=sn(a-s,0),p=r(l+c),h=!i;++u<l;)p[u]=t[u];for(;++o<s;)(h||o<a)&&(p[n[o]]=e[o]);for(;c--;)p[u++]=e[o++];return p}function vi(e,t,n,i){for(var o=-1,a=e.length,s=-1,u=n.length,l=-1,c=t.length,p=sn(a-u,0),h=r(p+c),d=!i;++o<p;)h[o]=e[o];for(var f=o;++l<c;)h[f+l]=t[l];for(;++s<u;)(d||o<a)&&(h[f+n[s]]=e[o++]);return h}function yi(e,t){var n=-1,i=e.length;for(t||(t=r(i));++n<i;)t[n]=e[n];return t}function bi(e,t,n,r){var i=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var s=t[o],u=r?r(n[s],e[s],s,n,e):void 0;void 0===u&&(u=e[s]),i?Wn(n,s,u):qn(n,s,u)}return n}function wi(e,t){return function(n,r){var i=ka(n)?at:zn,o=t?t():{};return i(n,e,Ji(r,2),o)}}function xi(e){return Br((function(t,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,a&&uo(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),t=fe(t);++r<i;){var s=n[r];s&&e(t,s,r,o)}return t}))}function Si(e,t){return function(n,r){if(null==n)return n;if(!ja(n))return e(n,r);for(var i=n.length,o=t?i:-1,a=fe(n);(t?o--:++o<i)&&!1!==r(a[o],o,a););return n}}function Ei(e){return function(t,n,r){for(var i=-1,o=fe(t),a=r(t),s=a.length;s--;){var u=a[e?s:++i];if(!1===n(o[u],u,o))break}return t}}function Ai(e){return function(t){var n=Ut(t=us(t))?Gt(t):void 0,r=n?n[0]:t.charAt(0),i=n?ci(n,1).join(""):t.slice(1);return r[e]()+i}}function Fi(e){return function(t){return gt(Ms(Os(t).replace(Pe,"")),e,"")}}function Ci(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=In(e.prototype),r=e.apply(n,t);return qa(r)?r:n}}function $i(e){return function(t,n,r){var i=fe(t);if(!ja(t)){var o=Ji(n,3);t=xs(t),n=function(e){return o(i[e],e,i)}}var a=e(t,n,r);return a>-1?i[o?t[a]:a]:void 0}}function Di(e){return Ki((function(t){var n=t.length,r=n,i=Pn.prototype.thru;for(e&&t.reverse();r--;){var a=t[r];if("function"!=typeof a)throw new ve(o);if(i&&!s&&"wrapper"==Yi(a))var s=new Pn([],!0)}for(r=s?r:n;++r<n;){var u=Yi(a=t[r]),l="wrapper"==u?Wi(a):void 0;s=l&&co(l[0])&&424==l[1]&&!l[4].length&&1==l[9]?s[Yi(l[0])].apply(s,l[3]):1==a.length&&co(a)?s[u]():s.thru(a)}return function(){var e=arguments,r=e[0];if(s&&1==e.length&&ka(r))return s.plant(r).value();for(var i=0,o=n?t[i].apply(this,e):r;++i<n;)o=t[i].call(this,o);return o}}))}function Ti(e,t,n,i,o,a,s,u,l,c){var p=128&t,h=1&t,d=2&t,f=24&t,g=512&t,m=d?void 0:Ci(e);return function v(){for(var y=arguments.length,b=r(y),w=y;w--;)b[w]=arguments[w];if(f)var x=Xi(v),S=jt(b,x);if(i&&(b=mi(b,i,o,f)),a&&(b=vi(b,a,s,f)),y-=S,f&&y<c){var E=Vt(b,x);return ji(e,t,Ti,v.placeholder,n,b,E,u,l,c-y)}var A=h?n:this,F=d?A[e]:e;return y=b.length,u?b=yo(b,u):g&&y>1&&b.reverse(),p&&l<y&&(b.length=l),this&&this!==Ge&&this instanceof v&&(F=m||Ci(F)),F.apply(A,b)}}function Ii(e,t){return function(n,r){return function(e,t,n,r){return lr(e,(function(e,i,o){t(r,n(e),i,o)})),r}(n,e,t(r),{})}}function Ri(e,t){return function(n,r){var i;if(void 0===n&&void 0===r)return t;if(void 0!==n&&(i=n),void 0!==r){if(void 0===i)return r;"string"==typeof n||"string"==typeof r?(n=Zr(n),r=Zr(r)):(n=Jr(n),r=Jr(r)),i=e(n,r)}return i}}function Pi(e){return Ki((function(t){return t=dt(t,Rt(Ji())),Br((function(n){var r=this;return e(t,(function(e){return ot(e,r,n)}))}))}))}function Oi(e,t){var n=(t=void 0===t?" ":Zr(t)).length;if(n<2)return n?Lr(t,e):t;var r=Lr(t,Qt(e/zt(t)));return Ut(t)?ci(Gt(r),0,e).join(""):r.slice(0,e)}function ki(e){return function(t,n,i){return i&&"number"!=typeof i&&uo(t,n,i)&&(n=i=void 0),t=rs(t),void 0===n?(n=t,t=0):n=rs(n),function(e,t,n,i){for(var o=-1,a=sn(Qt((t-e)/(n||1)),0),s=r(a);a--;)s[i?a:++o]=e,e+=n;return s}(t,n,i=void 0===i?t<n?1:-1:rs(i),e)}}function _i(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=as(t),n=as(n)),e(t,n)}}function ji(e,t,n,r,i,o,a,s,u,l){var c=8&t;t|=c?32:64,4&(t&=~(c?64:32))||(t&=-4);var p=[e,t,i,c?o:void 0,c?a:void 0,c?void 0:o,c?void 0:a,s,u,l],h=n.apply(void 0,p);return co(e)&&wo(h,p),h.placeholder=r,Eo(h,e,t)}function Ni(e){var t=de[e];return function(e,n){if(e=as(e),(n=null==n?0:un(is(n),292))&&rn(e)){var r=(us(e)+"e").split("e");return+((r=(us(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return t(e)}}var Li=mn&&1/qt(new mn([,-0]))[1]==1/0?function(e){return new mn(e)}:Zs;function Bi(e){return function(t){var n=ro(t);return n==g?Mt(t):n==b?Kt(t):function(e,t){return dt(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function Ui(e,t,n,i,s,u,l,c){var p=2&t;if(!p&&"function"!=typeof e)throw new ve(o);var h=i?i.length:0;if(h||(t&=-97,i=s=void 0),l=void 0===l?l:sn(is(l),0),c=void 0===c?c:is(c),h-=s?s.length:0,64&t){var d=i,f=s;i=s=void 0}var g=p?void 0:Wi(e),m=[e,t,n,i,s,d,f,u,l,c];if(g&&function(e,t){var n=e[1],r=t[1],i=n|r,o=i<131,s=128==r&&8==n||128==r&&256==n&&e[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==n;if(!o&&!s)return e;1&r&&(e[2]=t[2],i|=1&n?0:4);var u=t[3];if(u){var l=e[3];e[3]=l?mi(l,u,t[4]):u,e[4]=l?Vt(e[3],a):t[4]}(u=t[5])&&(l=e[5],e[5]=l?vi(l,u,t[6]):u,e[6]=l?Vt(e[5],a):t[6]);(u=t[7])&&(e[7]=u);128&r&&(e[8]=null==e[8]?t[8]:un(e[8],t[8]));null==e[9]&&(e[9]=t[9]);e[0]=t[0],e[1]=i}(m,g),e=m[0],t=m[1],n=m[2],i=m[3],s=m[4],!(c=m[9]=void 0===m[9]?p?0:e.length:sn(m[9]-h,0))&&24&t&&(t&=-25),t&&1!=t)v=8==t||16==t?function(e,t,n){var i=Ci(e);return function o(){for(var a=arguments.length,s=r(a),u=a,l=Xi(o);u--;)s[u]=arguments[u];var c=a<3&&s[0]!==l&&s[a-1]!==l?[]:Vt(s,l);if((a-=c.length)<n)return ji(e,t,Ti,o.placeholder,void 0,s,c,void 0,void 0,n-a);var p=this&&this!==Ge&&this instanceof o?i:e;return ot(p,this,s)}}(e,t,c):32!=t&&33!=t||s.length?Ti.apply(void 0,m):function(e,t,n,i){var o=1&t,a=Ci(e);return function t(){for(var s=-1,u=arguments.length,l=-1,c=i.length,p=r(c+u),h=this&&this!==Ge&&this instanceof t?a:e;++l<c;)p[l]=i[l];for(;u--;)p[l++]=arguments[++s];return ot(h,o?n:this,p)}}(e,t,n,i);else var v=function(e,t,n){var r=1&t,i=Ci(e);return function t(){var o=this&&this!==Ge&&this instanceof t?i:e;return o.apply(r?n:this,arguments)}}(e,t,n);return Eo((g?Vr:wo)(v,m),e,t)}function Mi(e,t,n,r){return void 0===e||Ia(e,we[n])&&!Ee.call(r,n)?t:e}function Hi(e,t,n,r,i,o){return qa(e)&&qa(t)&&(o.set(t,e),Rr(e,t,void 0,Hi,o),o.delete(t)),e}function Vi(e){return Wa(e)?void 0:e}function qi(e,t,n,r,i,o){var a=1&n,s=e.length,u=t.length;if(s!=u&&!(a&&u>s))return!1;var l=o.get(e),c=o.get(t);if(l&&c)return l==t&&c==e;var p=-1,h=!0,d=2&n?new Nn:void 0;for(o.set(e,t),o.set(t,e);++p<s;){var f=e[p],g=t[p];if(r)var m=a?r(g,f,p,t,e,o):r(f,g,p,e,t,o);if(void 0!==m){if(m)continue;h=!1;break}if(d){if(!vt(t,(function(e,t){if(!Ot(d,t)&&(f===e||i(f,e,n,r,o)))return d.push(t)}))){h=!1;break}}else if(f!==g&&!i(f,g,n,r,o)){h=!1;break}}return o.delete(e),o.delete(t),h}function Ki(e){return So(mo(e,void 0,_o),e+"")}function zi(e){return dr(e,xs,to)}function Gi(e){return dr(e,Ss,no)}var Wi=bn?function(e){return bn.get(e)}:Zs;function Yi(e){for(var t=e.name+"",n=wn[t],r=Ee.call(wn,t)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==e)return i.name}return t}function Xi(e){return(Ee.call(Tn,"placeholder")?Tn:e).placeholder}function Ji(){var e=Tn.iteratee||Ws;return e=e===Ws?Ar:e,arguments.length?e(arguments[0],arguments[1]):e}function Zi(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function Qi(e){for(var t=xs(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,fo(i)]}return t}function eo(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Er(n)?n:void 0}var to=tn?function(e){return null==e?[]:(e=fe(e),ct(tn(e),(function(t){return ze.call(e,t)})))}:ou,no=tn?function(e){for(var t=[];e;)ft(t,to(e)),e=He(e);return t}:ou,ro=fr;function io(e,t,n){for(var r=-1,i=(t=ui(t,e)).length,o=!1;++r<i;){var a=$o(t[r]);if(!(o=null!=e&&n(e,a)))break;e=e[a]}return o||++r!=i?o:!!(i=null==e?0:e.length)&&Va(i)&&so(a,i)&&(ka(e)||Oa(e))}function oo(e){return"function"!=typeof e.constructor||ho(e)?{}:In(He(e))}function ao(e){return ka(e)||Oa(e)||!!(Ye&&e&&e[Ye])}function so(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&ue.test(e))&&e>-1&&e%1==0&&e<t}function uo(e,t,n){if(!qa(n))return!1;var r=typeof t;return!!("number"==r?ja(n)&&so(t,n.length):"string"==r&&t in n)&&Ia(n[t],e)}function lo(e,t){if(ka(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Za(e))||(q.test(e)||!V.test(e)||null!=t&&e in fe(t))}function co(e){var t=Yi(e),n=Tn[t];if("function"!=typeof n||!(t in On.prototype))return!1;if(e===n)return!0;var r=Wi(n);return!!r&&e===r[0]}(dn&&ro(new dn(new ArrayBuffer(1)))!=A||fn&&ro(new fn)!=g||gn&&"[object Promise]"!=ro(gn.resolve())||mn&&ro(new mn)!=b||vn&&ro(new vn)!=S)&&(ro=function(e){var t=fr(e),n=t==v?e.constructor:void 0,r=n?Do(n):"";if(r)switch(r){case xn:return A;case Sn:return g;case En:return"[object Promise]";case An:return b;case Fn:return S}return t});var po=xe?Ma:au;function ho(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||we)}function fo(e){return e==e&&!qa(e)}function go(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in fe(n)))}}function mo(e,t,n){return t=sn(void 0===t?e.length-1:t,0),function(){for(var i=arguments,o=-1,a=sn(i.length-t,0),s=r(a);++o<a;)s[o]=i[t+o];o=-1;for(var u=r(t+1);++o<t;)u[o]=i[o];return u[t]=n(s),ot(e,this,u)}}function vo(e,t){return t.length<2?e:hr(e,zr(t,0,-1))}function yo(e,t){for(var n=e.length,r=un(t.length,n),i=yi(e);r--;){var o=t[r];e[r]=so(o,n)?i[o]:void 0}return e}function bo(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var wo=Ao(Vr),xo=Zt||function(e,t){return Ge.setTimeout(e,t)},So=Ao(qr);function Eo(e,t,n){var r=t+"";return So(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(X,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return st(s,(function(n){var r="_."+n[0];t&n[1]&&!pt(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(J);return t?t[1].split(Z):[]}(r),n)))}function Ao(e){var t=0,n=0;return function(){var r=ln(),i=16-(r-n);if(n=r,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Fo(e,t){var n=-1,r=e.length,i=r-1;for(t=void 0===t?r:t;++n<t;){var o=Nr(n,i),a=e[o];e[o]=e[n],e[n]=a}return e.length=t,e}var Co=function(e){var t=Aa(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(K,(function(e,n,r,i){t.push(r?i.replace(te,"$1"):n||e)})),t}));function $o(e){if("string"==typeof e||Za(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Do(e){if(null!=e){try{return Se.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function To(e){if(e instanceof On)return e.clone();var t=new Pn(e.__wrapped__,e.__chain__);return t.__actions__=yi(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Io=Br((function(e,t){return Na(e)?er(e,ar(t,1,Na,!0)):[]})),Ro=Br((function(e,t){var n=Uo(t);return Na(n)&&(n=void 0),Na(e)?er(e,ar(t,1,Na,!0),Ji(n,2)):[]})),Po=Br((function(e,t){var n=Uo(t);return Na(n)&&(n=void 0),Na(e)?er(e,ar(t,1,Na,!0),void 0,n):[]}));function Oo(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:is(n);return i<0&&(i=sn(r+i,0)),wt(e,Ji(t,3),i)}function ko(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=r-1;return void 0!==n&&(i=is(n),i=n<0?sn(r+i,0):un(i,r-1)),wt(e,Ji(t,3),i,!0)}function _o(e){return(null==e?0:e.length)?ar(e,1):[]}function jo(e){return e&&e.length?e[0]:void 0}var No=Br((function(e){var t=dt(e,ai);return t.length&&t[0]===e[0]?yr(t):[]})),Lo=Br((function(e){var t=Uo(e),n=dt(e,ai);return t===Uo(n)?t=void 0:n.pop(),n.length&&n[0]===e[0]?yr(n,Ji(t,2)):[]})),Bo=Br((function(e){var t=Uo(e),n=dt(e,ai);return(t="function"==typeof t?t:void 0)&&n.pop(),n.length&&n[0]===e[0]?yr(n,void 0,t):[]}));function Uo(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var Mo=Br(Ho);function Ho(e,t){return e&&e.length&&t&&t.length?_r(e,t):e}var Vo=Ki((function(e,t){var n=null==e?0:e.length,r=Yn(e,t);return jr(e,dt(t,(function(e){return so(e,n)?+e:e})).sort(gi)),r}));function qo(e){return null==e?e:hn.call(e)}var Ko=Br((function(e){return Qr(ar(e,1,Na,!0))})),zo=Br((function(e){var t=Uo(e);return Na(t)&&(t=void 0),Qr(ar(e,1,Na,!0),Ji(t,2))})),Go=Br((function(e){var t=Uo(e);return t="function"==typeof t?t:void 0,Qr(ar(e,1,Na,!0),void 0,t)}));function Wo(e){if(!e||!e.length)return[];var t=0;return e=ct(e,(function(e){if(Na(e))return t=sn(e.length,t),!0})),Tt(t,(function(t){return dt(e,Ft(t))}))}function Yo(e,t){if(!e||!e.length)return[];var n=Wo(e);return null==t?n:dt(n,(function(e){return ot(t,void 0,e)}))}var Xo=Br((function(e,t){return Na(e)?er(e,t):[]})),Jo=Br((function(e){return ii(ct(e,Na))})),Zo=Br((function(e){var t=Uo(e);return Na(t)&&(t=void 0),ii(ct(e,Na),Ji(t,2))})),Qo=Br((function(e){var t=Uo(e);return t="function"==typeof t?t:void 0,ii(ct(e,Na),void 0,t)})),ea=Br(Wo);var ta=Br((function(e){var t=e.length,n=t>1?e[t-1]:void 0;return n="function"==typeof n?(e.pop(),n):void 0,Yo(e,n)}));function na(e){var t=Tn(e);return t.__chain__=!0,t}function ra(e,t){return t(e)}var ia=Ki((function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,i=function(t){return Yn(t,e)};return!(t>1||this.__actions__.length)&&r instanceof On&&so(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:ra,args:[i],thisArg:void 0}),new Pn(r,this.__chain__).thru((function(e){return t&&!e.length&&e.push(void 0),e}))):this.thru(i)}));var oa=wi((function(e,t,n){Ee.call(e,n)?++e[n]:Wn(e,n,1)}));var aa=$i(Oo),sa=$i(ko);function ua(e,t){return(ka(e)?st:tr)(e,Ji(t,3))}function la(e,t){return(ka(e)?ut:nr)(e,Ji(t,3))}var ca=wi((function(e,t,n){Ee.call(e,n)?e[n].push(t):Wn(e,n,[t])}));var pa=Br((function(e,t,n){var i=-1,o="function"==typeof t,a=ja(e)?r(e.length):[];return tr(e,(function(e){a[++i]=o?ot(t,e,n):br(e,t,n)})),a})),ha=wi((function(e,t,n){Wn(e,n,t)}));function da(e,t){return(ka(e)?dt:Dr)(e,Ji(t,3))}var fa=wi((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));var ga=Br((function(e,t){if(null==e)return[];var n=t.length;return n>1&&uo(e,t[0],t[1])?t=[]:n>2&&uo(t[0],t[1],t[2])&&(t=[t[0]]),Or(e,ar(t,1),[])})),ma=Jt||function(){return Ge.Date.now()};function va(e,t,n){return t=n?void 0:t,Ui(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function ya(e,t){var n;if("function"!=typeof t)throw new ve(o);return e=is(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=void 0),n}}var ba=Br((function(e,t,n){var r=1;if(n.length){var i=Vt(n,Xi(ba));r|=32}return Ui(e,r,t,n,i)})),wa=Br((function(e,t,n){var r=3;if(n.length){var i=Vt(n,Xi(wa));r|=32}return Ui(t,r,e,n,i)}));function xa(e,t,n){var r,i,a,s,u,l,c=0,p=!1,h=!1,d=!0;if("function"!=typeof e)throw new ve(o);function f(t){var n=r,o=i;return r=i=void 0,c=t,s=e.apply(o,n)}function g(e){return c=e,u=xo(v,t),p?f(e):s}function m(e){var n=e-l;return void 0===l||n>=t||n<0||h&&e-c>=a}function v(){var e=ma();if(m(e))return y(e);u=xo(v,function(e){var n=t-(e-l);return h?un(n,a-(e-c)):n}(e))}function y(e){return u=void 0,d&&r?f(e):(r=i=void 0,s)}function b(){var e=ma(),n=m(e);if(r=arguments,i=this,l=e,n){if(void 0===u)return g(l);if(h)return pi(u),u=xo(v,t),f(l)}return void 0===u&&(u=xo(v,t)),s}return t=as(t)||0,qa(n)&&(p=!!n.leading,a=(h="maxWait"in n)?sn(as(n.maxWait)||0,t):a,d="trailing"in n?!!n.trailing:d),b.cancel=function(){void 0!==u&&pi(u),c=0,r=l=i=u=void 0},b.flush=function(){return void 0===u?s:y(ma())},b}var Sa=Br((function(e,t){return Qn(e,1,t)})),Ea=Br((function(e,t,n){return Qn(e,as(t)||0,n)}));function Aa(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new ve(o);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(Aa.Cache||jn),n}function Fa(e){if("function"!=typeof e)throw new ve(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Aa.Cache=jn;var Ca=li((function(e,t){var n=(t=1==t.length&&ka(t[0])?dt(t[0],Rt(Ji())):dt(ar(t,1),Rt(Ji()))).length;return Br((function(r){for(var i=-1,o=un(r.length,n);++i<o;)r[i]=t[i].call(this,r[i]);return ot(e,this,r)}))})),$a=Br((function(e,t){return Ui(e,32,void 0,t,Vt(t,Xi($a)))})),Da=Br((function(e,t){return Ui(e,64,void 0,t,Vt(t,Xi(Da)))})),Ta=Ki((function(e,t){return Ui(e,256,void 0,void 0,void 0,t)}));function Ia(e,t){return e===t||e!=e&&t!=t}var Ra=_i(gr),Pa=_i((function(e,t){return e>=t})),Oa=wr(function(){return arguments}())?wr:function(e){return Ka(e)&&Ee.call(e,"callee")&&!ze.call(e,"callee")},ka=r.isArray,_a=Qe?Rt(Qe):function(e){return Ka(e)&&fr(e)==E};function ja(e){return null!=e&&Va(e.length)&&!Ma(e)}function Na(e){return Ka(e)&&ja(e)}var La=nn||au,Ba=et?Rt(et):function(e){return Ka(e)&&fr(e)==p};function Ua(e){if(!Ka(e))return!1;var t=fr(e);return t==h||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Wa(e)}function Ma(e){if(!qa(e))return!1;var t=fr(e);return t==d||t==f||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Ha(e){return"number"==typeof e&&e==is(e)}function Va(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function qa(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ka(e){return null!=e&&"object"==typeof e}var za=tt?Rt(tt):function(e){return Ka(e)&&ro(e)==g};function Ga(e){return"number"==typeof e||Ka(e)&&fr(e)==m}function Wa(e){if(!Ka(e)||fr(e)!=v)return!1;var t=He(e);if(null===t)return!0;var n=Ee.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Se.call(n)==$e}var Ya=nt?Rt(nt):function(e){return Ka(e)&&fr(e)==y};var Xa=rt?Rt(rt):function(e){return Ka(e)&&ro(e)==b};function Ja(e){return"string"==typeof e||!ka(e)&&Ka(e)&&fr(e)==w}function Za(e){return"symbol"==typeof e||Ka(e)&&fr(e)==x}var Qa=it?Rt(it):function(e){return Ka(e)&&Va(e.length)&&!!Ue[fr(e)]};var es=_i($r),ts=_i((function(e,t){return e<=t}));function ns(e){if(!e)return[];if(ja(e))return Ja(e)?Gt(e):yi(e);if(Je&&e[Je])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Je]());var t=ro(e);return(t==g?Mt:t==b?qt:Is)(e)}function rs(e){return e?(e=as(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function is(e){var t=rs(e),n=t%1;return t==t?n?t-n:t:0}function os(e){return e?Xn(is(e),0,4294967295):0}function as(e){if("number"==typeof e)return e;if(Za(e))return NaN;if(qa(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=qa(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=It(e);var n=oe.test(e);return n||se.test(e)?qe(e.slice(2),n?2:8):ie.test(e)?NaN:+e}function ss(e){return bi(e,Ss(e))}function us(e){return null==e?"":Zr(e)}var ls=xi((function(e,t){if(ho(t)||ja(t))bi(t,xs(t),e);else for(var n in t)Ee.call(t,n)&&qn(e,n,t[n])})),cs=xi((function(e,t){bi(t,Ss(t),e)})),ps=xi((function(e,t,n,r){bi(t,Ss(t),e,r)})),hs=xi((function(e,t,n,r){bi(t,xs(t),e,r)})),ds=Ki(Yn);var fs=Br((function(e,t){e=fe(e);var n=-1,r=t.length,i=r>2?t[2]:void 0;for(i&&uo(t[0],t[1],i)&&(r=1);++n<r;)for(var o=t[n],a=Ss(o),s=-1,u=a.length;++s<u;){var l=a[s],c=e[l];(void 0===c||Ia(c,we[l])&&!Ee.call(e,l))&&(e[l]=o[l])}return e})),gs=Br((function(e){return e.push(void 0,Hi),ot(As,void 0,e)}));function ms(e,t,n){var r=null==e?void 0:hr(e,t);return void 0===r?n:r}function vs(e,t){return null!=e&&io(e,t,vr)}var ys=Ii((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ce.call(t)),e[t]=n}),qs(Gs)),bs=Ii((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ce.call(t)),Ee.call(e,t)?e[t].push(n):e[t]=[n]}),Ji),ws=Br(br);function xs(e){return ja(e)?Bn(e):Fr(e)}function Ss(e){return ja(e)?Bn(e,!0):Cr(e)}var Es=xi((function(e,t,n){Rr(e,t,n)})),As=xi((function(e,t,n,r){Rr(e,t,n,r)})),Fs=Ki((function(e,t){var n={};if(null==e)return n;var r=!1;t=dt(t,(function(t){return t=ui(t,e),r||(r=t.length>1),t})),bi(e,Gi(e),n),r&&(n=Jn(n,7,Vi));for(var i=t.length;i--;)ei(n,t[i]);return n}));var Cs=Ki((function(e,t){return null==e?{}:function(e,t){return kr(e,t,(function(t,n){return vs(e,n)}))}(e,t)}));function $s(e,t){if(null==e)return{};var n=dt(Gi(e),(function(e){return[e]}));return t=Ji(t),kr(e,n,(function(e,n){return t(e,n[0])}))}var Ds=Bi(xs),Ts=Bi(Ss);function Is(e){return null==e?[]:Pt(e,xs(e))}var Rs=Fi((function(e,t,n){return t=t.toLowerCase(),e+(n?Ps(t):t)}));function Ps(e){return Us(us(e).toLowerCase())}function Os(e){return(e=us(e))&&e.replace(le,Nt).replace(Oe,"")}var ks=Fi((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),_s=Fi((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),js=Ai("toLowerCase");var Ns=Fi((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));var Ls=Fi((function(e,t,n){return e+(n?" ":"")+Us(t)}));var Bs=Fi((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Us=Ai("toUpperCase");function Ms(e,t,n){return e=us(e),void 0===(t=n?void 0:t)?function(e){return Ne.test(e)}(e)?function(e){return e.match(_e)||[]}(e):function(e){return e.match(Q)||[]}(e):e.match(t)||[]}var Hs=Br((function(e,t){try{return ot(e,void 0,t)}catch(e){return Ua(e)?e:new Y(e)}})),Vs=Ki((function(e,t){return st(t,(function(t){t=$o(t),Wn(e,t,ba(e[t],e))})),e}));function qs(e){return function(){return e}}var Ks=Di(),zs=Di(!0);function Gs(e){return e}function Ws(e){return Ar("function"==typeof e?e:Jn(e,1))}var Ys=Br((function(e,t){return function(n){return br(n,e,t)}})),Xs=Br((function(e,t){return function(n){return br(e,n,t)}}));function Js(e,t,n){var r=xs(t),i=pr(t,r);null!=n||qa(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=pr(t,xs(t)));var o=!(qa(n)&&"chain"in n&&!n.chain),a=Ma(e);return st(i,(function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__),i=n.__actions__=yi(this.__actions__);return i.push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,ft([this.value()],arguments))})})),e}function Zs(){}var Qs=Pi(dt),eu=Pi(lt),tu=Pi(vt);function nu(e){return lo(e)?Ft($o(e)):function(e){return function(t){return hr(t,e)}}(e)}var ru=ki(),iu=ki(!0);function ou(){return[]}function au(){return!1}var su=Ri((function(e,t){return e+t}),0),uu=Ni("ceil"),lu=Ri((function(e,t){return e/t}),1),cu=Ni("floor");var pu,hu=Ri((function(e,t){return e*t}),1),du=Ni("round"),fu=Ri((function(e,t){return e-t}),0);return Tn.after=function(e,t){if("function"!=typeof t)throw new ve(o);return e=is(e),function(){if(--e<1)return t.apply(this,arguments)}},Tn.ary=va,Tn.assign=ls,Tn.assignIn=cs,Tn.assignInWith=ps,Tn.assignWith=hs,Tn.at=ds,Tn.before=ya,Tn.bind=ba,Tn.bindAll=Vs,Tn.bindKey=wa,Tn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return ka(e)?e:[e]},Tn.chain=na,Tn.chunk=function(e,t,n){t=(n?uo(e,t,n):void 0===t)?1:sn(is(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var o=0,a=0,s=r(Qt(i/t));o<i;)s[a++]=zr(e,o,o+=t);return s},Tn.compact=function(e){for(var t=-1,n=null==e?0:e.length,r=0,i=[];++t<n;){var o=e[t];o&&(i[r++]=o)}return i},Tn.concat=function(){var e=arguments.length;if(!e)return[];for(var t=r(e-1),n=arguments[0],i=e;i--;)t[i-1]=arguments[i];return ft(ka(n)?yi(n):[n],ar(t,1))},Tn.cond=function(e){var t=null==e?0:e.length,n=Ji();return e=t?dt(e,(function(e){if("function"!=typeof e[1])throw new ve(o);return[n(e[0]),e[1]]})):[],Br((function(n){for(var r=-1;++r<t;){var i=e[r];if(ot(i[0],this,n))return ot(i[1],this,n)}}))},Tn.conforms=function(e){return function(e){var t=xs(e);return function(n){return Zn(n,e,t)}}(Jn(e,1))},Tn.constant=qs,Tn.countBy=oa,Tn.create=function(e,t){var n=In(e);return null==t?n:Gn(n,t)},Tn.curry=function e(t,n,r){var i=Ui(t,8,void 0,void 0,void 0,void 0,void 0,n=r?void 0:n);return i.placeholder=e.placeholder,i},Tn.curryRight=function e(t,n,r){var i=Ui(t,16,void 0,void 0,void 0,void 0,void 0,n=r?void 0:n);return i.placeholder=e.placeholder,i},Tn.debounce=xa,Tn.defaults=fs,Tn.defaultsDeep=gs,Tn.defer=Sa,Tn.delay=Ea,Tn.difference=Io,Tn.differenceBy=Ro,Tn.differenceWith=Po,Tn.drop=function(e,t,n){var r=null==e?0:e.length;return r?zr(e,(t=n||void 0===t?1:is(t))<0?0:t,r):[]},Tn.dropRight=function(e,t,n){var r=null==e?0:e.length;return r?zr(e,0,(t=r-(t=n||void 0===t?1:is(t)))<0?0:t):[]},Tn.dropRightWhile=function(e,t){return e&&e.length?ni(e,Ji(t,3),!0,!0):[]},Tn.dropWhile=function(e,t){return e&&e.length?ni(e,Ji(t,3),!0):[]},Tn.fill=function(e,t,n,r){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&uo(e,t,n)&&(n=0,r=i),function(e,t,n,r){var i=e.length;for((n=is(n))<0&&(n=-n>i?0:i+n),(r=void 0===r||r>i?i:is(r))<0&&(r+=i),r=n>r?0:os(r);n<r;)e[n++]=t;return e}(e,t,n,r)):[]},Tn.filter=function(e,t){return(ka(e)?ct:or)(e,Ji(t,3))},Tn.flatMap=function(e,t){return ar(da(e,t),1)},Tn.flatMapDeep=function(e,t){return ar(da(e,t),1/0)},Tn.flatMapDepth=function(e,t,n){return n=void 0===n?1:is(n),ar(da(e,t),n)},Tn.flatten=_o,Tn.flattenDeep=function(e){return(null==e?0:e.length)?ar(e,1/0):[]},Tn.flattenDepth=function(e,t){return(null==e?0:e.length)?ar(e,t=void 0===t?1:is(t)):[]},Tn.flip=function(e){return Ui(e,512)},Tn.flow=Ks,Tn.flowRight=zs,Tn.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r},Tn.functions=function(e){return null==e?[]:pr(e,xs(e))},Tn.functionsIn=function(e){return null==e?[]:pr(e,Ss(e))},Tn.groupBy=ca,Tn.initial=function(e){return(null==e?0:e.length)?zr(e,0,-1):[]},Tn.intersection=No,Tn.intersectionBy=Lo,Tn.intersectionWith=Bo,Tn.invert=ys,Tn.invertBy=bs,Tn.invokeMap=pa,Tn.iteratee=Ws,Tn.keyBy=ha,Tn.keys=xs,Tn.keysIn=Ss,Tn.map=da,Tn.mapKeys=function(e,t){var n={};return t=Ji(t,3),lr(e,(function(e,r,i){Wn(n,t(e,r,i),e)})),n},Tn.mapValues=function(e,t){var n={};return t=Ji(t,3),lr(e,(function(e,r,i){Wn(n,r,t(e,r,i))})),n},Tn.matches=function(e){return Tr(Jn(e,1))},Tn.matchesProperty=function(e,t){return Ir(e,Jn(t,1))},Tn.memoize=Aa,Tn.merge=Es,Tn.mergeWith=As,Tn.method=Ys,Tn.methodOf=Xs,Tn.mixin=Js,Tn.negate=Fa,Tn.nthArg=function(e){return e=is(e),Br((function(t){return Pr(t,e)}))},Tn.omit=Fs,Tn.omitBy=function(e,t){return $s(e,Fa(Ji(t)))},Tn.once=function(e){return ya(2,e)},Tn.orderBy=function(e,t,n,r){return null==e?[]:(ka(t)||(t=null==t?[]:[t]),ka(n=r?void 0:n)||(n=null==n?[]:[n]),Or(e,t,n))},Tn.over=Qs,Tn.overArgs=Ca,Tn.overEvery=eu,Tn.overSome=tu,Tn.partial=$a,Tn.partialRight=Da,Tn.partition=fa,Tn.pick=Cs,Tn.pickBy=$s,Tn.property=nu,Tn.propertyOf=function(e){return function(t){return null==e?void 0:hr(e,t)}},Tn.pull=Mo,Tn.pullAll=Ho,Tn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?_r(e,t,Ji(n,2)):e},Tn.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?_r(e,t,void 0,n):e},Tn.pullAt=Vo,Tn.range=ru,Tn.rangeRight=iu,Tn.rearg=Ta,Tn.reject=function(e,t){return(ka(e)?ct:or)(e,Fa(Ji(t,3)))},Tn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var r=-1,i=[],o=e.length;for(t=Ji(t,3);++r<o;){var a=e[r];t(a,r,e)&&(n.push(a),i.push(r))}return jr(e,i),n},Tn.rest=function(e,t){if("function"!=typeof e)throw new ve(o);return Br(e,t=void 0===t?t:is(t))},Tn.reverse=qo,Tn.sampleSize=function(e,t,n){return t=(n?uo(e,t,n):void 0===t)?1:is(t),(ka(e)?Mn:Mr)(e,t)},Tn.set=function(e,t,n){return null==e?e:Hr(e,t,n)},Tn.setWith=function(e,t,n,r){return r="function"==typeof r?r:void 0,null==e?e:Hr(e,t,n,r)},Tn.shuffle=function(e){return(ka(e)?Hn:Kr)(e)},Tn.slice=function(e,t,n){var r=null==e?0:e.length;return r?(n&&"number"!=typeof n&&uo(e,t,n)?(t=0,n=r):(t=null==t?0:is(t),n=void 0===n?r:is(n)),zr(e,t,n)):[]},Tn.sortBy=ga,Tn.sortedUniq=function(e){return e&&e.length?Xr(e):[]},Tn.sortedUniqBy=function(e,t){return e&&e.length?Xr(e,Ji(t,2)):[]},Tn.split=function(e,t,n){return n&&"number"!=typeof n&&uo(e,t,n)&&(t=n=void 0),(n=void 0===n?4294967295:n>>>0)?(e=us(e))&&("string"==typeof t||null!=t&&!Ya(t))&&!(t=Zr(t))&&Ut(e)?ci(Gt(e),0,n):e.split(t,n):[]},Tn.spread=function(e,t){if("function"!=typeof e)throw new ve(o);return t=null==t?0:sn(is(t),0),Br((function(n){var r=n[t],i=ci(n,0,t);return r&&ft(i,r),ot(e,this,i)}))},Tn.tail=function(e){var t=null==e?0:e.length;return t?zr(e,1,t):[]},Tn.take=function(e,t,n){return e&&e.length?zr(e,0,(t=n||void 0===t?1:is(t))<0?0:t):[]},Tn.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?zr(e,(t=r-(t=n||void 0===t?1:is(t)))<0?0:t,r):[]},Tn.takeRightWhile=function(e,t){return e&&e.length?ni(e,Ji(t,3),!1,!0):[]},Tn.takeWhile=function(e,t){return e&&e.length?ni(e,Ji(t,3)):[]},Tn.tap=function(e,t){return t(e),e},Tn.throttle=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new ve(o);return qa(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),xa(e,t,{leading:r,maxWait:t,trailing:i})},Tn.thru=ra,Tn.toArray=ns,Tn.toPairs=Ds,Tn.toPairsIn=Ts,Tn.toPath=function(e){return ka(e)?dt(e,$o):Za(e)?[e]:yi(Co(us(e)))},Tn.toPlainObject=ss,Tn.transform=function(e,t,n){var r=ka(e),i=r||La(e)||Qa(e);if(t=Ji(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:qa(e)&&Ma(o)?In(He(e)):{}}return(i?st:lr)(e,(function(e,r,i){return t(n,e,r,i)})),n},Tn.unary=function(e){return va(e,1)},Tn.union=Ko,Tn.unionBy=zo,Tn.unionWith=Go,Tn.uniq=function(e){return e&&e.length?Qr(e):[]},Tn.uniqBy=function(e,t){return e&&e.length?Qr(e,Ji(t,2)):[]},Tn.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Qr(e,void 0,t):[]},Tn.unset=function(e,t){return null==e||ei(e,t)},Tn.unzip=Wo,Tn.unzipWith=Yo,Tn.update=function(e,t,n){return null==e?e:ti(e,t,si(n))},Tn.updateWith=function(e,t,n,r){return r="function"==typeof r?r:void 0,null==e?e:ti(e,t,si(n),r)},Tn.values=Is,Tn.valuesIn=function(e){return null==e?[]:Pt(e,Ss(e))},Tn.without=Xo,Tn.words=Ms,Tn.wrap=function(e,t){return $a(si(t),e)},Tn.xor=Jo,Tn.xorBy=Zo,Tn.xorWith=Qo,Tn.zip=ea,Tn.zipObject=function(e,t){return oi(e||[],t||[],qn)},Tn.zipObjectDeep=function(e,t){return oi(e||[],t||[],Hr)},Tn.zipWith=ta,Tn.entries=Ds,Tn.entriesIn=Ts,Tn.extend=cs,Tn.extendWith=ps,Js(Tn,Tn),Tn.add=su,Tn.attempt=Hs,Tn.camelCase=Rs,Tn.capitalize=Ps,Tn.ceil=uu,Tn.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=as(n))==n?n:0),void 0!==t&&(t=(t=as(t))==t?t:0),Xn(as(e),t,n)},Tn.clone=function(e){return Jn(e,4)},Tn.cloneDeep=function(e){return Jn(e,5)},Tn.cloneDeepWith=function(e,t){return Jn(e,5,t="function"==typeof t?t:void 0)},Tn.cloneWith=function(e,t){return Jn(e,4,t="function"==typeof t?t:void 0)},Tn.conformsTo=function(e,t){return null==t||Zn(e,t,xs(t))},Tn.deburr=Os,Tn.defaultTo=function(e,t){return null==e||e!=e?t:e},Tn.divide=lu,Tn.endsWith=function(e,t,n){e=us(e),t=Zr(t);var r=e.length,i=n=void 0===n?r:Xn(is(n),0,r);return(n-=t.length)>=0&&e.slice(n,i)==t},Tn.eq=Ia,Tn.escape=function(e){return(e=us(e))&&B.test(e)?e.replace(N,Lt):e},Tn.escapeRegExp=function(e){return(e=us(e))&&G.test(e)?e.replace(z,"\\$&"):e},Tn.every=function(e,t,n){var r=ka(e)?lt:rr;return n&&uo(e,t,n)&&(t=void 0),r(e,Ji(t,3))},Tn.find=aa,Tn.findIndex=Oo,Tn.findKey=function(e,t){return bt(e,Ji(t,3),lr)},Tn.findLast=sa,Tn.findLastIndex=ko,Tn.findLastKey=function(e,t){return bt(e,Ji(t,3),cr)},Tn.floor=cu,Tn.forEach=ua,Tn.forEachRight=la,Tn.forIn=function(e,t){return null==e?e:sr(e,Ji(t,3),Ss)},Tn.forInRight=function(e,t){return null==e?e:ur(e,Ji(t,3),Ss)},Tn.forOwn=function(e,t){return e&&lr(e,Ji(t,3))},Tn.forOwnRight=function(e,t){return e&&cr(e,Ji(t,3))},Tn.get=ms,Tn.gt=Ra,Tn.gte=Pa,Tn.has=function(e,t){return null!=e&&io(e,t,mr)},Tn.hasIn=vs,Tn.head=jo,Tn.identity=Gs,Tn.includes=function(e,t,n,r){e=ja(e)?e:Is(e),n=n&&!r?is(n):0;var i=e.length;return n<0&&(n=sn(i+n,0)),Ja(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&xt(e,t,n)>-1},Tn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:is(n);return i<0&&(i=sn(r+i,0)),xt(e,t,i)},Tn.inRange=function(e,t,n){return t=rs(t),void 0===n?(n=t,t=0):n=rs(n),function(e,t,n){return e>=un(t,n)&&e<sn(t,n)}(e=as(e),t,n)},Tn.invoke=ws,Tn.isArguments=Oa,Tn.isArray=ka,Tn.isArrayBuffer=_a,Tn.isArrayLike=ja,Tn.isArrayLikeObject=Na,Tn.isBoolean=function(e){return!0===e||!1===e||Ka(e)&&fr(e)==c},Tn.isBuffer=La,Tn.isDate=Ba,Tn.isElement=function(e){return Ka(e)&&1===e.nodeType&&!Wa(e)},Tn.isEmpty=function(e){if(null==e)return!0;if(ja(e)&&(ka(e)||"string"==typeof e||"function"==typeof e.splice||La(e)||Qa(e)||Oa(e)))return!e.length;var t=ro(e);if(t==g||t==b)return!e.size;if(ho(e))return!Fr(e).length;for(var n in e)if(Ee.call(e,n))return!1;return!0},Tn.isEqual=function(e,t){return xr(e,t)},Tn.isEqualWith=function(e,t,n){var r=(n="function"==typeof n?n:void 0)?n(e,t):void 0;return void 0===r?xr(e,t,void 0,n):!!r},Tn.isError=Ua,Tn.isFinite=function(e){return"number"==typeof e&&rn(e)},Tn.isFunction=Ma,Tn.isInteger=Ha,Tn.isLength=Va,Tn.isMap=za,Tn.isMatch=function(e,t){return e===t||Sr(e,t,Qi(t))},Tn.isMatchWith=function(e,t,n){return n="function"==typeof n?n:void 0,Sr(e,t,Qi(t),n)},Tn.isNaN=function(e){return Ga(e)&&e!=+e},Tn.isNative=function(e){if(po(e))throw new Y("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Er(e)},Tn.isNil=function(e){return null==e},Tn.isNull=function(e){return null===e},Tn.isNumber=Ga,Tn.isObject=qa,Tn.isObjectLike=Ka,Tn.isPlainObject=Wa,Tn.isRegExp=Ya,Tn.isSafeInteger=function(e){return Ha(e)&&e>=-9007199254740991&&e<=9007199254740991},Tn.isSet=Xa,Tn.isString=Ja,Tn.isSymbol=Za,Tn.isTypedArray=Qa,Tn.isUndefined=function(e){return void 0===e},Tn.isWeakMap=function(e){return Ka(e)&&ro(e)==S},Tn.isWeakSet=function(e){return Ka(e)&&"[object WeakSet]"==fr(e)},Tn.join=function(e,t){return null==e?"":on.call(e,t)},Tn.kebabCase=ks,Tn.last=Uo,Tn.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=r;return void 0!==n&&(i=(i=is(n))<0?sn(r+i,0):un(i,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,i):wt(e,Et,i,!0)},Tn.lowerCase=_s,Tn.lowerFirst=js,Tn.lt=es,Tn.lte=ts,Tn.max=function(e){return e&&e.length?ir(e,Gs,gr):void 0},Tn.maxBy=function(e,t){return e&&e.length?ir(e,Ji(t,2),gr):void 0},Tn.mean=function(e){return At(e,Gs)},Tn.meanBy=function(e,t){return At(e,Ji(t,2))},Tn.min=function(e){return e&&e.length?ir(e,Gs,$r):void 0},Tn.minBy=function(e,t){return e&&e.length?ir(e,Ji(t,2),$r):void 0},Tn.stubArray=ou,Tn.stubFalse=au,Tn.stubObject=function(){return{}},Tn.stubString=function(){return""},Tn.stubTrue=function(){return!0},Tn.multiply=hu,Tn.nth=function(e,t){return e&&e.length?Pr(e,is(t)):void 0},Tn.noConflict=function(){return Ge._===this&&(Ge._=De),this},Tn.noop=Zs,Tn.now=ma,Tn.pad=function(e,t,n){e=us(e);var r=(t=is(t))?zt(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Oi(en(i),n)+e+Oi(Qt(i),n)},Tn.padEnd=function(e,t,n){e=us(e);var r=(t=is(t))?zt(e):0;return t&&r<t?e+Oi(t-r,n):e},Tn.padStart=function(e,t,n){e=us(e);var r=(t=is(t))?zt(e):0;return t&&r<t?Oi(t-r,n)+e:e},Tn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),cn(us(e).replace(W,""),t||0)},Tn.random=function(e,t,n){if(n&&"boolean"!=typeof n&&uo(e,t,n)&&(t=n=void 0),void 0===n&&("boolean"==typeof t?(n=t,t=void 0):"boolean"==typeof e&&(n=e,e=void 0)),void 0===e&&void 0===t?(e=0,t=1):(e=rs(e),void 0===t?(t=e,e=0):t=rs(t)),e>t){var r=e;e=t,t=r}if(n||e%1||t%1){var i=pn();return un(e+i*(t-e+Ve("1e-"+((i+"").length-1))),t)}return Nr(e,t)},Tn.reduce=function(e,t,n){var r=ka(e)?gt:$t,i=arguments.length<3;return r(e,Ji(t,4),n,i,tr)},Tn.reduceRight=function(e,t,n){var r=ka(e)?mt:$t,i=arguments.length<3;return r(e,Ji(t,4),n,i,nr)},Tn.repeat=function(e,t,n){return t=(n?uo(e,t,n):void 0===t)?1:is(t),Lr(us(e),t)},Tn.replace=function(){var e=arguments,t=us(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Tn.result=function(e,t,n){var r=-1,i=(t=ui(t,e)).length;for(i||(i=1,e=void 0);++r<i;){var o=null==e?void 0:e[$o(t[r])];void 0===o&&(r=i,o=n),e=Ma(o)?o.call(e):o}return e},Tn.round=du,Tn.runInContext=e,Tn.sample=function(e){return(ka(e)?Un:Ur)(e)},Tn.size=function(e){if(null==e)return 0;if(ja(e))return Ja(e)?zt(e):e.length;var t=ro(e);return t==g||t==b?e.size:Fr(e).length},Tn.snakeCase=Ns,Tn.some=function(e,t,n){var r=ka(e)?vt:Gr;return n&&uo(e,t,n)&&(t=void 0),r(e,Ji(t,3))},Tn.sortedIndex=function(e,t){return Wr(e,t)},Tn.sortedIndexBy=function(e,t,n){return Yr(e,t,Ji(n,2))},Tn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=Wr(e,t);if(r<n&&Ia(e[r],t))return r}return-1},Tn.sortedLastIndex=function(e,t){return Wr(e,t,!0)},Tn.sortedLastIndexBy=function(e,t,n){return Yr(e,t,Ji(n,2),!0)},Tn.sortedLastIndexOf=function(e,t){if(null==e?0:e.length){var n=Wr(e,t,!0)-1;if(Ia(e[n],t))return n}return-1},Tn.startCase=Ls,Tn.startsWith=function(e,t,n){return e=us(e),n=null==n?0:Xn(is(n),0,e.length),t=Zr(t),e.slice(n,n+t.length)==t},Tn.subtract=fu,Tn.sum=function(e){return e&&e.length?Dt(e,Gs):0},Tn.sumBy=function(e,t){return e&&e.length?Dt(e,Ji(t,2)):0},Tn.template=function(e,t,n){var r=Tn.templateSettings;n&&uo(e,t,n)&&(t=void 0),e=us(e),t=ps({},t,r,Mi);var i,o,a=ps({},t.imports,r.imports,Mi),s=xs(a),u=Pt(a,s),l=0,c=t.interpolate||ce,p="__p += '",h=ge((t.escape||ce).source+"|"+c.source+"|"+(c===H?ne:ce).source+"|"+(t.evaluate||ce).source+"|$","g"),d="//# sourceURL="+(Ee.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Be+"]")+"\n";e.replace(h,(function(t,n,r,a,s,u){return r||(r=a),p+=e.slice(l,u).replace(pe,Bt),n&&(i=!0,p+="' +\n__e("+n+") +\n'"),s&&(o=!0,p+="';\n"+s+";\n__p += '"),r&&(p+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),l=u+t.length,t})),p+="';\n";var f=Ee.call(t,"variable")&&t.variable;if(f){if(ee.test(f))throw new Y("Invalid `variable` option passed into `_.template`")}else p="with (obj) {\n"+p+"\n}\n";p=(o?p.replace(O,""):p).replace(k,"$1").replace(_,"$1;"),p="function("+(f||"obj")+") {\n"+(f?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+p+"return __p\n}";var g=Hs((function(){return he(s,d+"return "+p).apply(void 0,u)}));if(g.source=p,Ua(g))throw g;return g},Tn.times=function(e,t){if((e=is(e))<1||e>9007199254740991)return[];var n=4294967295,r=un(e,4294967295);e-=4294967295;for(var i=Tt(r,t=Ji(t));++n<e;)t(n);return i},Tn.toFinite=rs,Tn.toInteger=is,Tn.toLength=os,Tn.toLower=function(e){return us(e).toLowerCase()},Tn.toNumber=as,Tn.toSafeInteger=function(e){return e?Xn(is(e),-9007199254740991,9007199254740991):0===e?e:0},Tn.toString=us,Tn.toUpper=function(e){return us(e).toUpperCase()},Tn.trim=function(e,t,n){if((e=us(e))&&(n||void 0===t))return It(e);if(!e||!(t=Zr(t)))return e;var r=Gt(e),i=Gt(t);return ci(r,kt(r,i),_t(r,i)+1).join("")},Tn.trimEnd=function(e,t,n){if((e=us(e))&&(n||void 0===t))return e.slice(0,Wt(e)+1);if(!e||!(t=Zr(t)))return e;var r=Gt(e);return ci(r,0,_t(r,Gt(t))+1).join("")},Tn.trimStart=function(e,t,n){if((e=us(e))&&(n||void 0===t))return e.replace(W,"");if(!e||!(t=Zr(t)))return e;var r=Gt(e);return ci(r,kt(r,Gt(t))).join("")},Tn.truncate=function(e,t){var n=30,r="...";if(qa(t)){var i="separator"in t?t.separator:i;n="length"in t?is(t.length):n,r="omission"in t?Zr(t.omission):r}var o=(e=us(e)).length;if(Ut(e)){var a=Gt(e);o=a.length}if(n>=o)return e;var s=n-zt(r);if(s<1)return r;var u=a?ci(a,0,s).join(""):e.slice(0,s);if(void 0===i)return u+r;if(a&&(s+=u.length-s),Ya(i)){if(e.slice(s).search(i)){var l,c=u;for(i.global||(i=ge(i.source,us(re.exec(i))+"g")),i.lastIndex=0;l=i.exec(c);)var p=l.index;u=u.slice(0,void 0===p?s:p)}}else if(e.indexOf(Zr(i),s)!=s){var h=u.lastIndexOf(i);h>-1&&(u=u.slice(0,h))}return u+r},Tn.unescape=function(e){return(e=us(e))&&L.test(e)?e.replace(j,Yt):e},Tn.uniqueId=function(e){var t=++Ae;return us(e)+t},Tn.upperCase=Bs,Tn.upperFirst=Us,Tn.each=ua,Tn.eachRight=la,Tn.first=jo,Js(Tn,(pu={},lr(Tn,(function(e,t){Ee.call(Tn.prototype,t)||(pu[t]=e)})),pu),{chain:!1}),Tn.VERSION="4.17.21",st(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Tn[e].placeholder=Tn})),st(["drop","take"],(function(e,t){On.prototype[e]=function(n){n=void 0===n?1:sn(is(n),0);var r=this.__filtered__&&!t?new On(this):this.clone();return r.__filtered__?r.__takeCount__=un(n,r.__takeCount__):r.__views__.push({size:un(n,4294967295),type:e+(r.__dir__<0?"Right":"")}),r},On.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),st(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;On.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Ji(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),st(["head","last"],(function(e,t){var n="take"+(t?"Right":"");On.prototype[e]=function(){return this[n](1).value()[0]}})),st(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");On.prototype[e]=function(){return this.__filtered__?new On(this):this[n](1)}})),On.prototype.compact=function(){return this.filter(Gs)},On.prototype.find=function(e){return this.filter(e).head()},On.prototype.findLast=function(e){return this.reverse().find(e)},On.prototype.invokeMap=Br((function(e,t){return"function"==typeof e?new On(this):this.map((function(n){return br(n,e,t)}))})),On.prototype.reject=function(e){return this.filter(Fa(Ji(e)))},On.prototype.slice=function(e,t){e=is(e);var n=this;return n.__filtered__&&(e>0||t<0)?new On(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=is(t))<0?n.dropRight(-t):n.take(t-e)),n)},On.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},On.prototype.toArray=function(){return this.take(4294967295)},lr(On.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),i=Tn[r?"take"+("last"==t?"Right":""):t],o=r||/^find/.test(t);i&&(Tn.prototype[t]=function(){var t=this.__wrapped__,a=r?[1]:arguments,s=t instanceof On,u=a[0],l=s||ka(t),c=function(e){var t=i.apply(Tn,ft([e],a));return r&&p?t[0]:t};l&&n&&"function"==typeof u&&1!=u.length&&(s=l=!1);var p=this.__chain__,h=!!this.__actions__.length,d=o&&!p,f=s&&!h;if(!o&&l){t=f?t:new On(this);var g=e.apply(t,a);return g.__actions__.push({func:ra,args:[c],thisArg:void 0}),new Pn(g,p)}return d&&f?e.apply(this,a):(g=this.thru(c),d?r?g.value()[0]:g.value():g)})})),st(["pop","push","shift","sort","splice","unshift"],(function(e){var t=ye[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Tn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(ka(i)?i:[],e)}return this[n]((function(n){return t.apply(ka(n)?n:[],e)}))}})),lr(On.prototype,(function(e,t){var n=Tn[t];if(n){var r=n.name+"";Ee.call(wn,r)||(wn[r]=[]),wn[r].push({name:t,func:n})}})),wn[Ti(void 0,2).name]=[{name:"wrapper",func:void 0}],On.prototype.clone=function(){var e=new On(this.__wrapped__);return e.__actions__=yi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=yi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=yi(this.__views__),e},On.prototype.reverse=function(){if(this.__filtered__){var e=new On(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},On.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=ka(e),r=t<0,i=n?e.length:0,o=function(e,t,n){var r=-1,i=n.length;for(;++r<i;){var o=n[r],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=un(t,e+a);break;case"takeRight":e=sn(e,t-a)}}return{start:e,end:t}}(0,i,this.__views__),a=o.start,s=o.end,u=s-a,l=r?s:a-1,c=this.__iteratees__,p=c.length,h=0,d=un(u,this.__takeCount__);if(!n||!r&&i==u&&d==u)return ri(e,this.__actions__);var f=[];e:for(;u--&&h<d;){for(var g=-1,m=e[l+=t];++g<p;){var v=c[g],y=v.iteratee,b=v.type,w=y(m);if(2==b)m=w;else if(!w){if(1==b)continue e;break e}}f[h++]=m}return f},Tn.prototype.at=ia,Tn.prototype.chain=function(){return na(this)},Tn.prototype.commit=function(){return new Pn(this.value(),this.__chain__)},Tn.prototype.next=function(){void 0===this.__values__&&(this.__values__=ns(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},Tn.prototype.plant=function(e){for(var t,n=this;n instanceof Rn;){var r=To(n);r.__index__=0,r.__values__=void 0,t?i.__wrapped__=r:t=r;var i=r;n=n.__wrapped__}return i.__wrapped__=e,t},Tn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof On){var t=e;return this.__actions__.length&&(t=new On(this)),(t=t.reverse()).__actions__.push({func:ra,args:[qo],thisArg:void 0}),new Pn(t,this.__chain__)}return this.thru(qo)},Tn.prototype.toJSON=Tn.prototype.valueOf=Tn.prototype.value=function(){return ri(this.__wrapped__,this.__actions__)},Tn.prototype.first=Tn.prototype.head,Je&&(Tn.prototype[Je]=function(){return this}),Tn}();Ge._=Xt,void 0===(i=function(){return Xt}.call(t,n,t,r))||(r.exports=i)}).call(this)}).call(this,n(11),n(242)(e))},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";(function(e){
55
+ */(function(){var o="Expected a function",a="__lodash_placeholder__",s=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],u="[object Arguments]",l="[object Array]",c="[object Boolean]",p="[object Date]",h="[object Error]",d="[object Function]",f="[object GeneratorFunction]",g="[object Map]",m="[object Number]",v="[object Object]",y="[object RegExp]",b="[object Set]",w="[object String]",x="[object Symbol]",S="[object WeakMap]",E="[object ArrayBuffer]",A="[object DataView]",F="[object Float32Array]",C="[object Float64Array]",$="[object Int8Array]",D="[object Int16Array]",T="[object Int32Array]",I="[object Uint8Array]",R="[object Uint16Array]",P="[object Uint32Array]",O=/\b__p \+= '';/g,k=/\b(__p \+=) '' \+/g,_=/(__e\(.*?\)|\b__t\)) \+\n'';/g,j=/&(?:amp|lt|gt|quot|#39);/g,N=/[&<>"']/g,L=RegExp(j.source),B=RegExp(N.source),U=/<%-([\s\S]+?)%>/g,M=/<%([\s\S]+?)%>/g,H=/<%=([\s\S]+?)%>/g,V=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,q=/^\w*$/,K=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,z=/[\\^$.*+?()[\]{}|]/g,G=RegExp(z.source),W=/^\s+/,Y=/\s/,X=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,J=/\{\n\/\* \[wrapped with (.+)\] \*/,Z=/,? & /,Q=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ee=/[()=,{}\[\]\/\s]/,te=/\\(\\)?/g,ne=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,re=/\w*$/,ie=/^[-+]0x[0-9a-f]+$/i,oe=/^0b[01]+$/i,ae=/^\[object .+?Constructor\]$/,se=/^0o[0-7]+$/i,ue=/^(?:0|[1-9]\d*)$/,le=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ce=/($^)/,pe=/['\n\r\u2028\u2029\\]/g,he="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",de="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",fe="[\\ud800-\\udfff]",ge="["+de+"]",me="["+he+"]",ve="\\d+",ye="[\\u2700-\\u27bf]",be="[a-z\\xdf-\\xf6\\xf8-\\xff]",we="[^\\ud800-\\udfff"+de+ve+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",xe="\\ud83c[\\udffb-\\udfff]",Se="[^\\ud800-\\udfff]",Ee="(?:\\ud83c[\\udde6-\\uddff]){2}",Ae="[\\ud800-\\udbff][\\udc00-\\udfff]",Fe="[A-Z\\xc0-\\xd6\\xd8-\\xde]",Ce="(?:"+be+"|"+we+")",$e="(?:"+Fe+"|"+we+")",De="(?:"+me+"|"+xe+")"+"?",Te="[\\ufe0e\\ufe0f]?"+De+("(?:\\u200d(?:"+[Se,Ee,Ae].join("|")+")[\\ufe0e\\ufe0f]?"+De+")*"),Ie="(?:"+[ye,Ee,Ae].join("|")+")"+Te,Re="(?:"+[Se+me+"?",me,Ee,Ae,fe].join("|")+")",Pe=RegExp("['’]","g"),Oe=RegExp(me,"g"),ke=RegExp(xe+"(?="+xe+")|"+Re+Te,"g"),_e=RegExp([Fe+"?"+be+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[ge,Fe,"$"].join("|")+")",$e+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[ge,Fe+Ce,"$"].join("|")+")",Fe+"?"+Ce+"+(?:['’](?:d|ll|m|re|s|t|ve))?",Fe+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",ve,Ie].join("|"),"g"),je=RegExp("[\\u200d\\ud800-\\udfff"+he+"\\ufe0e\\ufe0f]"),Ne=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Le=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Be=-1,Ue={};Ue[F]=Ue[C]=Ue[$]=Ue[D]=Ue[T]=Ue[I]=Ue["[object Uint8ClampedArray]"]=Ue[R]=Ue[P]=!0,Ue[u]=Ue[l]=Ue[E]=Ue[c]=Ue[A]=Ue[p]=Ue[h]=Ue[d]=Ue[g]=Ue[m]=Ue[v]=Ue[y]=Ue[b]=Ue[w]=Ue[S]=!1;var Me={};Me[u]=Me[l]=Me[E]=Me[A]=Me[c]=Me[p]=Me[F]=Me[C]=Me[$]=Me[D]=Me[T]=Me[g]=Me[m]=Me[v]=Me[y]=Me[b]=Me[w]=Me[x]=Me[I]=Me["[object Uint8ClampedArray]"]=Me[R]=Me[P]=!0,Me[h]=Me[d]=Me[S]=!1;var He={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Ve=parseFloat,qe=parseInt,Ke="object"==typeof e&&e&&e.Object===Object&&e,ze="object"==typeof self&&self&&self.Object===Object&&self,Ge=Ke||ze||Function("return this")(),We=t&&!t.nodeType&&t,Ye=We&&"object"==typeof r&&r&&!r.nodeType&&r,Xe=Ye&&Ye.exports===We,Je=Xe&&Ke.process,Ze=function(){try{var e=Ye&&Ye.require&&Ye.require("util").types;return e||Je&&Je.binding&&Je.binding("util")}catch(e){}}(),Qe=Ze&&Ze.isArrayBuffer,et=Ze&&Ze.isDate,tt=Ze&&Ze.isMap,nt=Ze&&Ze.isRegExp,rt=Ze&&Ze.isSet,it=Ze&&Ze.isTypedArray;function ot(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function at(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(r,a,n(a),e)}return r}function st(e,t){for(var n=-1,r=null==e?0:e.length;++n<r&&!1!==t(e[n],n,e););return e}function ut(e,t){for(var n=null==e?0:e.length;n--&&!1!==t(e[n],n,e););return e}function lt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(!t(e[n],n,e))return!1;return!0}function ct(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o}function pt(e,t){return!!(null==e?0:e.length)&&xt(e,t,0)>-1}function ht(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1}function dt(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}function ft(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}function gt(e,t,n,r){var i=-1,o=null==e?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}function mt(e,t,n,r){var i=null==e?0:e.length;for(r&&i&&(n=e[--i]);i--;)n=t(n,e[i],i,e);return n}function vt(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var yt=Ft("length");function bt(e,t,n){var r;return n(e,(function(e,n,i){if(t(e,n,i))return r=n,!1})),r}function wt(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}function xt(e,t,n){return t==t?function(e,t,n){var r=n-1,i=e.length;for(;++r<i;)if(e[r]===t)return r;return-1}(e,t,n):wt(e,Et,n)}function St(e,t,n,r){for(var i=n-1,o=e.length;++i<o;)if(r(e[i],t))return i;return-1}function Et(e){return e!=e}function At(e,t){var n=null==e?0:e.length;return n?Dt(e,t)/n:NaN}function Ft(e){return function(t){return null==t?void 0:t[e]}}function Ct(e){return function(t){return null==e?void 0:e[t]}}function $t(e,t,n,r,i){return i(e,(function(e,i,o){n=r?(r=!1,e):t(n,e,i,o)})),n}function Dt(e,t){for(var n,r=-1,i=e.length;++r<i;){var o=t(e[r]);void 0!==o&&(n=void 0===n?o:n+o)}return n}function Tt(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}function It(e){return e?e.slice(0,Wt(e)+1).replace(W,""):e}function Rt(e){return function(t){return e(t)}}function Pt(e,t){return dt(t,(function(t){return e[t]}))}function Ot(e,t){return e.has(t)}function kt(e,t){for(var n=-1,r=e.length;++n<r&&xt(t,e[n],0)>-1;);return n}function _t(e,t){for(var n=e.length;n--&&xt(t,e[n],0)>-1;);return n}function jt(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&++r;return r}var Nt=Ct({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),Lt=Ct({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function Bt(e){return"\\"+He[e]}function Ut(e){return je.test(e)}function Mt(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function Ht(e,t){return function(n){return e(t(n))}}function Vt(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var s=e[n];s!==t&&s!==a||(e[n]=a,o[i++]=n)}return o}function qt(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}function Kt(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=[e,e]})),n}function zt(e){return Ut(e)?function(e){var t=ke.lastIndex=0;for(;ke.test(e);)++t;return t}(e):yt(e)}function Gt(e){return Ut(e)?function(e){return e.match(ke)||[]}(e):function(e){return e.split("")}(e)}function Wt(e){for(var t=e.length;t--&&Y.test(e.charAt(t)););return t}var Yt=Ct({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"});var Xt=function e(t){var n,r=(t=null==t?Ge:Xt.defaults(Ge.Object(),t,Xt.pick(Ge,Le))).Array,i=t.Date,Y=t.Error,he=t.Function,de=t.Math,fe=t.Object,ge=t.RegExp,me=t.String,ve=t.TypeError,ye=r.prototype,be=he.prototype,we=fe.prototype,xe=t["__core-js_shared__"],Se=be.toString,Ee=we.hasOwnProperty,Ae=0,Fe=(n=/[^.]+$/.exec(xe&&xe.keys&&xe.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",Ce=we.toString,$e=Se.call(fe),De=Ge._,Te=ge("^"+Se.call(Ee).replace(z,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ie=Xe?t.Buffer:void 0,Re=t.Symbol,ke=t.Uint8Array,je=Ie?Ie.allocUnsafe:void 0,He=Ht(fe.getPrototypeOf,fe),Ke=fe.create,ze=we.propertyIsEnumerable,We=ye.splice,Ye=Re?Re.isConcatSpreadable:void 0,Je=Re?Re.iterator:void 0,Ze=Re?Re.toStringTag:void 0,yt=function(){try{var e=eo(fe,"defineProperty");return e({},"",{}),e}catch(e){}}(),Ct=t.clearTimeout!==Ge.clearTimeout&&t.clearTimeout,Jt=i&&i.now!==Ge.Date.now&&i.now,Zt=t.setTimeout!==Ge.setTimeout&&t.setTimeout,Qt=de.ceil,en=de.floor,tn=fe.getOwnPropertySymbols,nn=Ie?Ie.isBuffer:void 0,rn=t.isFinite,on=ye.join,an=Ht(fe.keys,fe),sn=de.max,un=de.min,ln=i.now,cn=t.parseInt,pn=de.random,hn=ye.reverse,dn=eo(t,"DataView"),fn=eo(t,"Map"),gn=eo(t,"Promise"),mn=eo(t,"Set"),vn=eo(t,"WeakMap"),yn=eo(fe,"create"),bn=vn&&new vn,wn={},xn=Do(dn),Sn=Do(fn),En=Do(gn),An=Do(mn),Fn=Do(vn),Cn=Re?Re.prototype:void 0,$n=Cn?Cn.valueOf:void 0,Dn=Cn?Cn.toString:void 0;function Tn(e){if(Ka(e)&&!ka(e)&&!(e instanceof On)){if(e instanceof Pn)return e;if(Ee.call(e,"__wrapped__"))return To(e)}return new Pn(e)}var In=function(){function e(){}return function(t){if(!qa(t))return{};if(Ke)return Ke(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Rn(){}function Pn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}function On(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function kn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function _n(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function jn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Nn(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new jn;++t<n;)this.add(e[t])}function Ln(e){var t=this.__data__=new _n(e);this.size=t.size}function Bn(e,t){var n=ka(e),r=!n&&Oa(e),i=!n&&!r&&La(e),o=!n&&!r&&!i&&Qa(e),a=n||r||i||o,s=a?Tt(e.length,me):[],u=s.length;for(var l in e)!t&&!Ee.call(e,l)||a&&("length"==l||i&&("offset"==l||"parent"==l)||o&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||so(l,u))||s.push(l);return s}function Un(e){var t=e.length;return t?e[Nr(0,t-1)]:void 0}function Mn(e,t){return Fo(yi(e),Xn(t,0,e.length))}function Hn(e){return Fo(yi(e))}function Vn(e,t,n){(void 0!==n&&!Ia(e[t],n)||void 0===n&&!(t in e))&&Wn(e,t,n)}function qn(e,t,n){var r=e[t];Ee.call(e,t)&&Ia(r,n)&&(void 0!==n||t in e)||Wn(e,t,n)}function Kn(e,t){for(var n=e.length;n--;)if(Ia(e[n][0],t))return n;return-1}function zn(e,t,n,r){return tr(e,(function(e,i,o){t(r,e,n(e),o)})),r}function Gn(e,t){return e&&bi(t,xs(t),e)}function Wn(e,t,n){"__proto__"==t&&yt?yt(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function Yn(e,t){for(var n=-1,i=t.length,o=r(i),a=null==e;++n<i;)o[n]=a?void 0:ms(e,t[n]);return o}function Xn(e,t,n){return e==e&&(void 0!==n&&(e=e<=n?e:n),void 0!==t&&(e=e>=t?e:t)),e}function Jn(e,t,n,r,i,o){var a,s=1&t,l=2&t,h=4&t;if(n&&(a=i?n(e,r,i,o):n(e)),void 0!==a)return a;if(!qa(e))return e;var S=ka(e);if(S){if(a=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&Ee.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!s)return yi(e,a)}else{var O=ro(e),k=O==d||O==f;if(La(e))return hi(e,s);if(O==v||O==u||k&&!i){if(a=l||k?{}:oo(e),!s)return l?function(e,t){return bi(e,no(e),t)}(e,function(e,t){return e&&bi(t,Ss(t),e)}(a,e)):function(e,t){return bi(e,to(e),t)}(e,Gn(a,e))}else{if(!Me[O])return i?e:{};a=function(e,t,n){var r=e.constructor;switch(t){case E:return di(e);case c:case p:return new r(+e);case A:return function(e,t){var n=t?di(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case F:case C:case $:case D:case T:case I:case"[object Uint8ClampedArray]":case R:case P:return fi(e,n);case g:return new r;case m:case w:return new r(e);case y:return function(e){var t=new e.constructor(e.source,re.exec(e));return t.lastIndex=e.lastIndex,t}(e);case b:return new r;case x:return i=e,$n?fe($n.call(i)):{}}var i}(e,O,s)}}o||(o=new Ln);var _=o.get(e);if(_)return _;o.set(e,a),Xa(e)?e.forEach((function(r){a.add(Jn(r,t,n,r,e,o))})):za(e)&&e.forEach((function(r,i){a.set(i,Jn(r,t,n,i,e,o))}));var j=S?void 0:(h?l?Gi:zi:l?Ss:xs)(e);return st(j||e,(function(r,i){j&&(r=e[i=r]),qn(a,i,Jn(r,t,n,i,e,o))})),a}function Zn(e,t,n){var r=n.length;if(null==e)return!r;for(e=fe(e);r--;){var i=n[r],o=t[i],a=e[i];if(void 0===a&&!(i in e)||!o(a))return!1}return!0}function Qn(e,t,n){if("function"!=typeof e)throw new ve(o);return xo((function(){e.apply(void 0,n)}),t)}function er(e,t,n,r){var i=-1,o=pt,a=!0,s=e.length,u=[],l=t.length;if(!s)return u;n&&(t=dt(t,Rt(n))),r?(o=ht,a=!1):t.length>=200&&(o=Ot,a=!1,t=new Nn(t));e:for(;++i<s;){var c=e[i],p=null==n?c:n(c);if(c=r||0!==c?c:0,a&&p==p){for(var h=l;h--;)if(t[h]===p)continue e;u.push(c)}else o(t,p,r)||u.push(c)}return u}Tn.templateSettings={escape:U,evaluate:M,interpolate:H,variable:"",imports:{_:Tn}},Tn.prototype=Rn.prototype,Tn.prototype.constructor=Tn,Pn.prototype=In(Rn.prototype),Pn.prototype.constructor=Pn,On.prototype=In(Rn.prototype),On.prototype.constructor=On,kn.prototype.clear=function(){this.__data__=yn?yn(null):{},this.size=0},kn.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},kn.prototype.get=function(e){var t=this.__data__;if(yn){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return Ee.call(t,e)?t[e]:void 0},kn.prototype.has=function(e){var t=this.__data__;return yn?void 0!==t[e]:Ee.call(t,e)},kn.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=yn&&void 0===t?"__lodash_hash_undefined__":t,this},_n.prototype.clear=function(){this.__data__=[],this.size=0},_n.prototype.delete=function(e){var t=this.__data__,n=Kn(t,e);return!(n<0)&&(n==t.length-1?t.pop():We.call(t,n,1),--this.size,!0)},_n.prototype.get=function(e){var t=this.__data__,n=Kn(t,e);return n<0?void 0:t[n][1]},_n.prototype.has=function(e){return Kn(this.__data__,e)>-1},_n.prototype.set=function(e,t){var n=this.__data__,r=Kn(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},jn.prototype.clear=function(){this.size=0,this.__data__={hash:new kn,map:new(fn||_n),string:new kn}},jn.prototype.delete=function(e){var t=Zi(this,e).delete(e);return this.size-=t?1:0,t},jn.prototype.get=function(e){return Zi(this,e).get(e)},jn.prototype.has=function(e){return Zi(this,e).has(e)},jn.prototype.set=function(e,t){var n=Zi(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Nn.prototype.add=Nn.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},Nn.prototype.has=function(e){return this.__data__.has(e)},Ln.prototype.clear=function(){this.__data__=new _n,this.size=0},Ln.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Ln.prototype.get=function(e){return this.__data__.get(e)},Ln.prototype.has=function(e){return this.__data__.has(e)},Ln.prototype.set=function(e,t){var n=this.__data__;if(n instanceof _n){var r=n.__data__;if(!fn||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new jn(r)}return n.set(e,t),this.size=n.size,this};var tr=Si(lr),nr=Si(cr,!0);function rr(e,t){var n=!0;return tr(e,(function(e,r,i){return n=!!t(e,r,i)})),n}function ir(e,t,n){for(var r=-1,i=e.length;++r<i;){var o=e[r],a=t(o);if(null!=a&&(void 0===s?a==a&&!Za(a):n(a,s)))var s=a,u=o}return u}function or(e,t){var n=[];return tr(e,(function(e,r,i){t(e,r,i)&&n.push(e)})),n}function ar(e,t,n,r,i){var o=-1,a=e.length;for(n||(n=ao),i||(i=[]);++o<a;){var s=e[o];t>0&&n(s)?t>1?ar(s,t-1,n,r,i):ft(i,s):r||(i[i.length]=s)}return i}var sr=Ei(),ur=Ei(!0);function lr(e,t){return e&&sr(e,t,xs)}function cr(e,t){return e&&ur(e,t,xs)}function pr(e,t){return ct(t,(function(t){return Ma(e[t])}))}function hr(e,t){for(var n=0,r=(t=ui(t,e)).length;null!=e&&n<r;)e=e[$o(t[n++])];return n&&n==r?e:void 0}function dr(e,t,n){var r=t(e);return ka(e)?r:ft(r,n(e))}function fr(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Ze&&Ze in fe(e)?function(e){var t=Ee.call(e,Ze),n=e[Ze];try{e[Ze]=void 0;var r=!0}catch(e){}var i=Ce.call(e);r&&(t?e[Ze]=n:delete e[Ze]);return i}(e):function(e){return Ce.call(e)}(e)}function gr(e,t){return e>t}function mr(e,t){return null!=e&&Ee.call(e,t)}function vr(e,t){return null!=e&&t in fe(e)}function yr(e,t,n){for(var i=n?ht:pt,o=e[0].length,a=e.length,s=a,u=r(a),l=1/0,c=[];s--;){var p=e[s];s&&t&&(p=dt(p,Rt(t))),l=un(p.length,l),u[s]=!n&&(t||o>=120&&p.length>=120)?new Nn(s&&p):void 0}p=e[0];var h=-1,d=u[0];e:for(;++h<o&&c.length<l;){var f=p[h],g=t?t(f):f;if(f=n||0!==f?f:0,!(d?Ot(d,g):i(c,g,n))){for(s=a;--s;){var m=u[s];if(!(m?Ot(m,g):i(e[s],g,n)))continue e}d&&d.push(g),c.push(f)}}return c}function br(e,t,n){var r=null==(e=vo(e,t=ui(t,e)))?e:e[$o(Uo(t))];return null==r?void 0:ot(r,e,n)}function wr(e){return Ka(e)&&fr(e)==u}function xr(e,t,n,r,i){return e===t||(null==e||null==t||!Ka(e)&&!Ka(t)?e!=e&&t!=t:function(e,t,n,r,i,o){var a=ka(e),s=ka(t),d=a?l:ro(e),f=s?l:ro(t),S=(d=d==u?v:d)==v,F=(f=f==u?v:f)==v,C=d==f;if(C&&La(e)){if(!La(t))return!1;a=!0,S=!1}if(C&&!S)return o||(o=new Ln),a||Qa(e)?qi(e,t,n,r,i,o):function(e,t,n,r,i,o,a){switch(n){case A:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case E:return!(e.byteLength!=t.byteLength||!o(new ke(e),new ke(t)));case c:case p:case m:return Ia(+e,+t);case h:return e.name==t.name&&e.message==t.message;case y:case w:return e==t+"";case g:var s=Mt;case b:var u=1&r;if(s||(s=qt),e.size!=t.size&&!u)return!1;var l=a.get(e);if(l)return l==t;r|=2,a.set(e,t);var d=qi(s(e),s(t),r,i,o,a);return a.delete(e),d;case x:if($n)return $n.call(e)==$n.call(t)}return!1}(e,t,d,n,r,i,o);if(!(1&n)){var $=S&&Ee.call(e,"__wrapped__"),D=F&&Ee.call(t,"__wrapped__");if($||D){var T=$?e.value():e,I=D?t.value():t;return o||(o=new Ln),i(T,I,n,r,o)}}if(!C)return!1;return o||(o=new Ln),function(e,t,n,r,i,o){var a=1&n,s=zi(e),u=s.length,l=zi(t).length;if(u!=l&&!a)return!1;var c=u;for(;c--;){var p=s[c];if(!(a?p in t:Ee.call(t,p)))return!1}var h=o.get(e),d=o.get(t);if(h&&d)return h==t&&d==e;var f=!0;o.set(e,t),o.set(t,e);var g=a;for(;++c<u;){p=s[c];var m=e[p],v=t[p];if(r)var y=a?r(v,m,p,t,e,o):r(m,v,p,e,t,o);if(!(void 0===y?m===v||i(m,v,n,r,o):y)){f=!1;break}g||(g="constructor"==p)}if(f&&!g){var b=e.constructor,w=t.constructor;b==w||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof w&&w instanceof w||(f=!1)}return o.delete(e),o.delete(t),f}(e,t,n,r,i,o)}(e,t,n,r,xr,i))}function Sr(e,t,n,r){var i=n.length,o=i,a=!r;if(null==e)return!o;for(e=fe(e);i--;){var s=n[i];if(a&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<o;){var u=(s=n[i])[0],l=e[u],c=s[1];if(a&&s[2]){if(void 0===l&&!(u in e))return!1}else{var p=new Ln;if(r)var h=r(l,c,u,e,t,p);if(!(void 0===h?xr(c,l,3,r,p):h))return!1}}return!0}function Er(e){return!(!qa(e)||(t=e,Fe&&Fe in t))&&(Ma(e)?Te:ae).test(Do(e));var t}function Ar(e){return"function"==typeof e?e:null==e?Gs:"object"==typeof e?ka(e)?Ir(e[0],e[1]):Tr(e):nu(e)}function Fr(e){if(!ho(e))return an(e);var t=[];for(var n in fe(e))Ee.call(e,n)&&"constructor"!=n&&t.push(n);return t}function Cr(e){if(!qa(e))return function(e){var t=[];if(null!=e)for(var n in fe(e))t.push(n);return t}(e);var t=ho(e),n=[];for(var r in e)("constructor"!=r||!t&&Ee.call(e,r))&&n.push(r);return n}function $r(e,t){return e<t}function Dr(e,t){var n=-1,i=ja(e)?r(e.length):[];return tr(e,(function(e,r,o){i[++n]=t(e,r,o)})),i}function Tr(e){var t=Qi(e);return 1==t.length&&t[0][2]?go(t[0][0],t[0][1]):function(n){return n===e||Sr(n,e,t)}}function Ir(e,t){return lo(e)&&fo(t)?go($o(e),t):function(n){var r=ms(n,e);return void 0===r&&r===t?vs(n,e):xr(t,r,3)}}function Rr(e,t,n,r,i){e!==t&&sr(t,(function(o,a){if(i||(i=new Ln),qa(o))!function(e,t,n,r,i,o,a){var s=bo(e,n),u=bo(t,n),l=a.get(u);if(l)return void Vn(e,n,l);var c=o?o(s,u,n+"",e,t,a):void 0,p=void 0===c;if(p){var h=ka(u),d=!h&&La(u),f=!h&&!d&&Qa(u);c=u,h||d||f?ka(s)?c=s:Na(s)?c=yi(s):d?(p=!1,c=hi(u,!0)):f?(p=!1,c=fi(u,!0)):c=[]:Wa(u)||Oa(u)?(c=s,Oa(s)?c=ss(s):qa(s)&&!Ma(s)||(c=oo(u))):p=!1}p&&(a.set(u,c),i(c,u,r,o,a),a.delete(u));Vn(e,n,c)}(e,t,a,n,Rr,r,i);else{var s=r?r(bo(e,a),o,a+"",e,t,i):void 0;void 0===s&&(s=o),Vn(e,a,s)}}),Ss)}function Pr(e,t){var n=e.length;if(n)return so(t+=t<0?n:0,n)?e[t]:void 0}function Or(e,t,n){t=t.length?dt(t,(function(e){return ka(e)?function(t){return hr(t,1===e.length?e[0]:e)}:e})):[Gs];var r=-1;return t=dt(t,Rt(Ji())),function(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}(Dr(e,(function(e,n,i){return{criteria:dt(t,(function(t){return t(e)})),index:++r,value:e}})),(function(e,t){return function(e,t,n){var r=-1,i=e.criteria,o=t.criteria,a=i.length,s=n.length;for(;++r<a;){var u=gi(i[r],o[r]);if(u){if(r>=s)return u;var l=n[r];return u*("desc"==l?-1:1)}}return e.index-t.index}(e,t,n)}))}function kr(e,t,n){for(var r=-1,i=t.length,o={};++r<i;){var a=t[r],s=hr(e,a);n(s,a)&&Hr(o,ui(a,e),s)}return o}function _r(e,t,n,r){var i=r?St:xt,o=-1,a=t.length,s=e;for(e===t&&(t=yi(t)),n&&(s=dt(e,Rt(n)));++o<a;)for(var u=0,l=t[o],c=n?n(l):l;(u=i(s,c,u,r))>-1;)s!==e&&We.call(s,u,1),We.call(e,u,1);return e}function jr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(n==r||i!==o){var o=i;so(i)?We.call(e,i,1):ei(e,i)}}return e}function Nr(e,t){return e+en(pn()*(t-e+1))}function Lr(e,t){var n="";if(!e||t<1||t>9007199254740991)return n;do{t%2&&(n+=e),(t=en(t/2))&&(e+=e)}while(t);return n}function Br(e,t){return So(mo(e,t,Gs),e+"")}function Ur(e){return Un(Is(e))}function Mr(e,t){var n=Is(e);return Fo(n,Xn(t,0,n.length))}function Hr(e,t,n,r){if(!qa(e))return e;for(var i=-1,o=(t=ui(t,e)).length,a=o-1,s=e;null!=s&&++i<o;){var u=$o(t[i]),l=n;if("__proto__"===u||"constructor"===u||"prototype"===u)return e;if(i!=a){var c=s[u];void 0===(l=r?r(c,u,s):void 0)&&(l=qa(c)?c:so(t[i+1])?[]:{})}qn(s,u,l),s=s[u]}return e}var Vr=bn?function(e,t){return bn.set(e,t),e}:Gs,qr=yt?function(e,t){return yt(e,"toString",{configurable:!0,enumerable:!1,value:qs(t),writable:!0})}:Gs;function Kr(e){return Fo(Is(e))}function zr(e,t,n){var i=-1,o=e.length;t<0&&(t=-t>o?0:o+t),(n=n>o?o:n)<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var a=r(o);++i<o;)a[i]=e[i+t];return a}function Gr(e,t){var n;return tr(e,(function(e,r,i){return!(n=t(e,r,i))})),!!n}function Wr(e,t,n){var r=0,i=null==e?r:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;r<i;){var o=r+i>>>1,a=e[o];null!==a&&!Za(a)&&(n?a<=t:a<t)?r=o+1:i=o}return i}return Yr(e,t,Gs,n)}function Yr(e,t,n,r){var i=0,o=null==e?0:e.length;if(0===o)return 0;for(var a=(t=n(t))!=t,s=null===t,u=Za(t),l=void 0===t;i<o;){var c=en((i+o)/2),p=n(e[c]),h=void 0!==p,d=null===p,f=p==p,g=Za(p);if(a)var m=r||f;else m=l?f&&(r||h):s?f&&h&&(r||!d):u?f&&h&&!d&&(r||!g):!d&&!g&&(r?p<=t:p<t);m?i=c+1:o=c}return un(o,4294967294)}function Xr(e,t){for(var n=-1,r=e.length,i=0,o=[];++n<r;){var a=e[n],s=t?t(a):a;if(!n||!Ia(s,u)){var u=s;o[i++]=0===a?0:a}}return o}function Jr(e){return"number"==typeof e?e:Za(e)?NaN:+e}function Zr(e){if("string"==typeof e)return e;if(ka(e))return dt(e,Zr)+"";if(Za(e))return Dn?Dn.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Qr(e,t,n){var r=-1,i=pt,o=e.length,a=!0,s=[],u=s;if(n)a=!1,i=ht;else if(o>=200){var l=t?null:Li(e);if(l)return qt(l);a=!1,i=Ot,u=new Nn}else u=t?[]:s;e:for(;++r<o;){var c=e[r],p=t?t(c):c;if(c=n||0!==c?c:0,a&&p==p){for(var h=u.length;h--;)if(u[h]===p)continue e;t&&u.push(p),s.push(c)}else i(u,p,n)||(u!==s&&u.push(p),s.push(c))}return s}function ei(e,t){return null==(e=vo(e,t=ui(t,e)))||delete e[$o(Uo(t))]}function ti(e,t,n,r){return Hr(e,t,n(hr(e,t)),r)}function ni(e,t,n,r){for(var i=e.length,o=r?i:-1;(r?o--:++o<i)&&t(e[o],o,e););return n?zr(e,r?0:o,r?o+1:i):zr(e,r?o+1:0,r?i:o)}function ri(e,t){var n=e;return n instanceof On&&(n=n.value()),gt(t,(function(e,t){return t.func.apply(t.thisArg,ft([e],t.args))}),n)}function ii(e,t,n){var i=e.length;if(i<2)return i?Qr(e[0]):[];for(var o=-1,a=r(i);++o<i;)for(var s=e[o],u=-1;++u<i;)u!=o&&(a[o]=er(a[o]||s,e[u],t,n));return Qr(ar(a,1),t,n)}function oi(e,t,n){for(var r=-1,i=e.length,o=t.length,a={};++r<i;){var s=r<o?t[r]:void 0;n(a,e[r],s)}return a}function ai(e){return Na(e)?e:[]}function si(e){return"function"==typeof e?e:Gs}function ui(e,t){return ka(e)?e:lo(e,t)?[e]:Co(us(e))}var li=Br;function ci(e,t,n){var r=e.length;return n=void 0===n?r:n,!t&&n>=r?e:zr(e,t,n)}var pi=Ct||function(e){return Ge.clearTimeout(e)};function hi(e,t){if(t)return e.slice();var n=e.length,r=je?je(n):new e.constructor(n);return e.copy(r),r}function di(e){var t=new e.constructor(e.byteLength);return new ke(t).set(new ke(e)),t}function fi(e,t){var n=t?di(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function gi(e,t){if(e!==t){var n=void 0!==e,r=null===e,i=e==e,o=Za(e),a=void 0!==t,s=null===t,u=t==t,l=Za(t);if(!s&&!l&&!o&&e>t||o&&a&&u&&!s&&!l||r&&a&&u||!n&&u||!i)return 1;if(!r&&!o&&!l&&e<t||l&&n&&i&&!r&&!o||s&&n&&i||!a&&i||!u)return-1}return 0}function mi(e,t,n,i){for(var o=-1,a=e.length,s=n.length,u=-1,l=t.length,c=sn(a-s,0),p=r(l+c),h=!i;++u<l;)p[u]=t[u];for(;++o<s;)(h||o<a)&&(p[n[o]]=e[o]);for(;c--;)p[u++]=e[o++];return p}function vi(e,t,n,i){for(var o=-1,a=e.length,s=-1,u=n.length,l=-1,c=t.length,p=sn(a-u,0),h=r(p+c),d=!i;++o<p;)h[o]=e[o];for(var f=o;++l<c;)h[f+l]=t[l];for(;++s<u;)(d||o<a)&&(h[f+n[s]]=e[o++]);return h}function yi(e,t){var n=-1,i=e.length;for(t||(t=r(i));++n<i;)t[n]=e[n];return t}function bi(e,t,n,r){var i=!n;n||(n={});for(var o=-1,a=t.length;++o<a;){var s=t[o],u=r?r(n[s],e[s],s,n,e):void 0;void 0===u&&(u=e[s]),i?Wn(n,s,u):qn(n,s,u)}return n}function wi(e,t){return function(n,r){var i=ka(n)?at:zn,o=t?t():{};return i(n,e,Ji(r,2),o)}}function xi(e){return Br((function(t,n){var r=-1,i=n.length,o=i>1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o=e.length>3&&"function"==typeof o?(i--,o):void 0,a&&uo(n[0],n[1],a)&&(o=i<3?void 0:o,i=1),t=fe(t);++r<i;){var s=n[r];s&&e(t,s,r,o)}return t}))}function Si(e,t){return function(n,r){if(null==n)return n;if(!ja(n))return e(n,r);for(var i=n.length,o=t?i:-1,a=fe(n);(t?o--:++o<i)&&!1!==r(a[o],o,a););return n}}function Ei(e){return function(t,n,r){for(var i=-1,o=fe(t),a=r(t),s=a.length;s--;){var u=a[e?s:++i];if(!1===n(o[u],u,o))break}return t}}function Ai(e){return function(t){var n=Ut(t=us(t))?Gt(t):void 0,r=n?n[0]:t.charAt(0),i=n?ci(n,1).join(""):t.slice(1);return r[e]()+i}}function Fi(e){return function(t){return gt(Ms(Os(t).replace(Pe,"")),e,"")}}function Ci(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var n=In(e.prototype),r=e.apply(n,t);return qa(r)?r:n}}function $i(e){return function(t,n,r){var i=fe(t);if(!ja(t)){var o=Ji(n,3);t=xs(t),n=function(e){return o(i[e],e,i)}}var a=e(t,n,r);return a>-1?i[o?t[a]:a]:void 0}}function Di(e){return Ki((function(t){var n=t.length,r=n,i=Pn.prototype.thru;for(e&&t.reverse();r--;){var a=t[r];if("function"!=typeof a)throw new ve(o);if(i&&!s&&"wrapper"==Yi(a))var s=new Pn([],!0)}for(r=s?r:n;++r<n;){var u=Yi(a=t[r]),l="wrapper"==u?Wi(a):void 0;s=l&&co(l[0])&&424==l[1]&&!l[4].length&&1==l[9]?s[Yi(l[0])].apply(s,l[3]):1==a.length&&co(a)?s[u]():s.thru(a)}return function(){var e=arguments,r=e[0];if(s&&1==e.length&&ka(r))return s.plant(r).value();for(var i=0,o=n?t[i].apply(this,e):r;++i<n;)o=t[i].call(this,o);return o}}))}function Ti(e,t,n,i,o,a,s,u,l,c){var p=128&t,h=1&t,d=2&t,f=24&t,g=512&t,m=d?void 0:Ci(e);return function v(){for(var y=arguments.length,b=r(y),w=y;w--;)b[w]=arguments[w];if(f)var x=Xi(v),S=jt(b,x);if(i&&(b=mi(b,i,o,f)),a&&(b=vi(b,a,s,f)),y-=S,f&&y<c){var E=Vt(b,x);return ji(e,t,Ti,v.placeholder,n,b,E,u,l,c-y)}var A=h?n:this,F=d?A[e]:e;return y=b.length,u?b=yo(b,u):g&&y>1&&b.reverse(),p&&l<y&&(b.length=l),this&&this!==Ge&&this instanceof v&&(F=m||Ci(F)),F.apply(A,b)}}function Ii(e,t){return function(n,r){return function(e,t,n,r){return lr(e,(function(e,i,o){t(r,n(e),i,o)})),r}(n,e,t(r),{})}}function Ri(e,t){return function(n,r){var i;if(void 0===n&&void 0===r)return t;if(void 0!==n&&(i=n),void 0!==r){if(void 0===i)return r;"string"==typeof n||"string"==typeof r?(n=Zr(n),r=Zr(r)):(n=Jr(n),r=Jr(r)),i=e(n,r)}return i}}function Pi(e){return Ki((function(t){return t=dt(t,Rt(Ji())),Br((function(n){var r=this;return e(t,(function(e){return ot(e,r,n)}))}))}))}function Oi(e,t){var n=(t=void 0===t?" ":Zr(t)).length;if(n<2)return n?Lr(t,e):t;var r=Lr(t,Qt(e/zt(t)));return Ut(t)?ci(Gt(r),0,e).join(""):r.slice(0,e)}function ki(e){return function(t,n,i){return i&&"number"!=typeof i&&uo(t,n,i)&&(n=i=void 0),t=rs(t),void 0===n?(n=t,t=0):n=rs(n),function(e,t,n,i){for(var o=-1,a=sn(Qt((t-e)/(n||1)),0),s=r(a);a--;)s[i?a:++o]=e,e+=n;return s}(t,n,i=void 0===i?t<n?1:-1:rs(i),e)}}function _i(e){return function(t,n){return"string"==typeof t&&"string"==typeof n||(t=as(t),n=as(n)),e(t,n)}}function ji(e,t,n,r,i,o,a,s,u,l){var c=8&t;t|=c?32:64,4&(t&=~(c?64:32))||(t&=-4);var p=[e,t,i,c?o:void 0,c?a:void 0,c?void 0:o,c?void 0:a,s,u,l],h=n.apply(void 0,p);return co(e)&&wo(h,p),h.placeholder=r,Eo(h,e,t)}function Ni(e){var t=de[e];return function(e,n){if(e=as(e),(n=null==n?0:un(is(n),292))&&rn(e)){var r=(us(e)+"e").split("e");return+((r=(us(t(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return t(e)}}var Li=mn&&1/qt(new mn([,-0]))[1]==1/0?function(e){return new mn(e)}:Zs;function Bi(e){return function(t){var n=ro(t);return n==g?Mt(t):n==b?Kt(t):function(e,t){return dt(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function Ui(e,t,n,i,s,u,l,c){var p=2&t;if(!p&&"function"!=typeof e)throw new ve(o);var h=i?i.length:0;if(h||(t&=-97,i=s=void 0),l=void 0===l?l:sn(is(l),0),c=void 0===c?c:is(c),h-=s?s.length:0,64&t){var d=i,f=s;i=s=void 0}var g=p?void 0:Wi(e),m=[e,t,n,i,s,d,f,u,l,c];if(g&&function(e,t){var n=e[1],r=t[1],i=n|r,o=i<131,s=128==r&&8==n||128==r&&256==n&&e[7].length<=t[8]||384==r&&t[7].length<=t[8]&&8==n;if(!o&&!s)return e;1&r&&(e[2]=t[2],i|=1&n?0:4);var u=t[3];if(u){var l=e[3];e[3]=l?mi(l,u,t[4]):u,e[4]=l?Vt(e[3],a):t[4]}(u=t[5])&&(l=e[5],e[5]=l?vi(l,u,t[6]):u,e[6]=l?Vt(e[5],a):t[6]);(u=t[7])&&(e[7]=u);128&r&&(e[8]=null==e[8]?t[8]:un(e[8],t[8]));null==e[9]&&(e[9]=t[9]);e[0]=t[0],e[1]=i}(m,g),e=m[0],t=m[1],n=m[2],i=m[3],s=m[4],!(c=m[9]=void 0===m[9]?p?0:e.length:sn(m[9]-h,0))&&24&t&&(t&=-25),t&&1!=t)v=8==t||16==t?function(e,t,n){var i=Ci(e);return function o(){for(var a=arguments.length,s=r(a),u=a,l=Xi(o);u--;)s[u]=arguments[u];var c=a<3&&s[0]!==l&&s[a-1]!==l?[]:Vt(s,l);if((a-=c.length)<n)return ji(e,t,Ti,o.placeholder,void 0,s,c,void 0,void 0,n-a);var p=this&&this!==Ge&&this instanceof o?i:e;return ot(p,this,s)}}(e,t,c):32!=t&&33!=t||s.length?Ti.apply(void 0,m):function(e,t,n,i){var o=1&t,a=Ci(e);return function t(){for(var s=-1,u=arguments.length,l=-1,c=i.length,p=r(c+u),h=this&&this!==Ge&&this instanceof t?a:e;++l<c;)p[l]=i[l];for(;u--;)p[l++]=arguments[++s];return ot(h,o?n:this,p)}}(e,t,n,i);else var v=function(e,t,n){var r=1&t,i=Ci(e);return function t(){var o=this&&this!==Ge&&this instanceof t?i:e;return o.apply(r?n:this,arguments)}}(e,t,n);return Eo((g?Vr:wo)(v,m),e,t)}function Mi(e,t,n,r){return void 0===e||Ia(e,we[n])&&!Ee.call(r,n)?t:e}function Hi(e,t,n,r,i,o){return qa(e)&&qa(t)&&(o.set(t,e),Rr(e,t,void 0,Hi,o),o.delete(t)),e}function Vi(e){return Wa(e)?void 0:e}function qi(e,t,n,r,i,o){var a=1&n,s=e.length,u=t.length;if(s!=u&&!(a&&u>s))return!1;var l=o.get(e),c=o.get(t);if(l&&c)return l==t&&c==e;var p=-1,h=!0,d=2&n?new Nn:void 0;for(o.set(e,t),o.set(t,e);++p<s;){var f=e[p],g=t[p];if(r)var m=a?r(g,f,p,t,e,o):r(f,g,p,e,t,o);if(void 0!==m){if(m)continue;h=!1;break}if(d){if(!vt(t,(function(e,t){if(!Ot(d,t)&&(f===e||i(f,e,n,r,o)))return d.push(t)}))){h=!1;break}}else if(f!==g&&!i(f,g,n,r,o)){h=!1;break}}return o.delete(e),o.delete(t),h}function Ki(e){return So(mo(e,void 0,_o),e+"")}function zi(e){return dr(e,xs,to)}function Gi(e){return dr(e,Ss,no)}var Wi=bn?function(e){return bn.get(e)}:Zs;function Yi(e){for(var t=e.name+"",n=wn[t],r=Ee.call(wn,t)?n.length:0;r--;){var i=n[r],o=i.func;if(null==o||o==e)return i.name}return t}function Xi(e){return(Ee.call(Tn,"placeholder")?Tn:e).placeholder}function Ji(){var e=Tn.iteratee||Ws;return e=e===Ws?Ar:e,arguments.length?e(arguments[0],arguments[1]):e}function Zi(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map}function Qi(e){for(var t=xs(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,fo(i)]}return t}function eo(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return Er(n)?n:void 0}var to=tn?function(e){return null==e?[]:(e=fe(e),ct(tn(e),(function(t){return ze.call(e,t)})))}:ou,no=tn?function(e){for(var t=[];e;)ft(t,to(e)),e=He(e);return t}:ou,ro=fr;function io(e,t,n){for(var r=-1,i=(t=ui(t,e)).length,o=!1;++r<i;){var a=$o(t[r]);if(!(o=null!=e&&n(e,a)))break;e=e[a]}return o||++r!=i?o:!!(i=null==e?0:e.length)&&Va(i)&&so(a,i)&&(ka(e)||Oa(e))}function oo(e){return"function"!=typeof e.constructor||ho(e)?{}:In(He(e))}function ao(e){return ka(e)||Oa(e)||!!(Ye&&e&&e[Ye])}function so(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&ue.test(e))&&e>-1&&e%1==0&&e<t}function uo(e,t,n){if(!qa(n))return!1;var r=typeof t;return!!("number"==r?ja(n)&&so(t,n.length):"string"==r&&t in n)&&Ia(n[t],e)}function lo(e,t){if(ka(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!Za(e))||(q.test(e)||!V.test(e)||null!=t&&e in fe(t))}function co(e){var t=Yi(e),n=Tn[t];if("function"!=typeof n||!(t in On.prototype))return!1;if(e===n)return!0;var r=Wi(n);return!!r&&e===r[0]}(dn&&ro(new dn(new ArrayBuffer(1)))!=A||fn&&ro(new fn)!=g||gn&&"[object Promise]"!=ro(gn.resolve())||mn&&ro(new mn)!=b||vn&&ro(new vn)!=S)&&(ro=function(e){var t=fr(e),n=t==v?e.constructor:void 0,r=n?Do(n):"";if(r)switch(r){case xn:return A;case Sn:return g;case En:return"[object Promise]";case An:return b;case Fn:return S}return t});var po=xe?Ma:au;function ho(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||we)}function fo(e){return e==e&&!qa(e)}function go(e,t){return function(n){return null!=n&&(n[e]===t&&(void 0!==t||e in fe(n)))}}function mo(e,t,n){return t=sn(void 0===t?e.length-1:t,0),function(){for(var i=arguments,o=-1,a=sn(i.length-t,0),s=r(a);++o<a;)s[o]=i[t+o];o=-1;for(var u=r(t+1);++o<t;)u[o]=i[o];return u[t]=n(s),ot(e,this,u)}}function vo(e,t){return t.length<2?e:hr(e,zr(t,0,-1))}function yo(e,t){for(var n=e.length,r=un(t.length,n),i=yi(e);r--;){var o=t[r];e[r]=so(o,n)?i[o]:void 0}return e}function bo(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var wo=Ao(Vr),xo=Zt||function(e,t){return Ge.setTimeout(e,t)},So=Ao(qr);function Eo(e,t,n){var r=t+"";return So(e,function(e,t){var n=t.length;if(!n)return e;var r=n-1;return t[r]=(n>1?"& ":"")+t[r],t=t.join(n>2?", ":" "),e.replace(X,"{\n/* [wrapped with "+t+"] */\n")}(r,function(e,t){return st(s,(function(n){var r="_."+n[0];t&n[1]&&!pt(e,r)&&e.push(r)})),e.sort()}(function(e){var t=e.match(J);return t?t[1].split(Z):[]}(r),n)))}function Ao(e){var t=0,n=0;return function(){var r=ln(),i=16-(r-n);if(n=r,i>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function Fo(e,t){var n=-1,r=e.length,i=r-1;for(t=void 0===t?r:t;++n<t;){var o=Nr(n,i),a=e[o];e[o]=e[n],e[n]=a}return e.length=t,e}var Co=function(e){var t=Aa(e,(function(e){return 500===n.size&&n.clear(),e})),n=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(K,(function(e,n,r,i){t.push(r?i.replace(te,"$1"):n||e)})),t}));function $o(e){if("string"==typeof e||Za(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Do(e){if(null!=e){try{return Se.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function To(e){if(e instanceof On)return e.clone();var t=new Pn(e.__wrapped__,e.__chain__);return t.__actions__=yi(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Io=Br((function(e,t){return Na(e)?er(e,ar(t,1,Na,!0)):[]})),Ro=Br((function(e,t){var n=Uo(t);return Na(n)&&(n=void 0),Na(e)?er(e,ar(t,1,Na,!0),Ji(n,2)):[]})),Po=Br((function(e,t){var n=Uo(t);return Na(n)&&(n=void 0),Na(e)?er(e,ar(t,1,Na,!0),void 0,n):[]}));function Oo(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:is(n);return i<0&&(i=sn(r+i,0)),wt(e,Ji(t,3),i)}function ko(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=r-1;return void 0!==n&&(i=is(n),i=n<0?sn(r+i,0):un(i,r-1)),wt(e,Ji(t,3),i,!0)}function _o(e){return(null==e?0:e.length)?ar(e,1):[]}function jo(e){return e&&e.length?e[0]:void 0}var No=Br((function(e){var t=dt(e,ai);return t.length&&t[0]===e[0]?yr(t):[]})),Lo=Br((function(e){var t=Uo(e),n=dt(e,ai);return t===Uo(n)?t=void 0:n.pop(),n.length&&n[0]===e[0]?yr(n,Ji(t,2)):[]})),Bo=Br((function(e){var t=Uo(e),n=dt(e,ai);return(t="function"==typeof t?t:void 0)&&n.pop(),n.length&&n[0]===e[0]?yr(n,void 0,t):[]}));function Uo(e){var t=null==e?0:e.length;return t?e[t-1]:void 0}var Mo=Br(Ho);function Ho(e,t){return e&&e.length&&t&&t.length?_r(e,t):e}var Vo=Ki((function(e,t){var n=null==e?0:e.length,r=Yn(e,t);return jr(e,dt(t,(function(e){return so(e,n)?+e:e})).sort(gi)),r}));function qo(e){return null==e?e:hn.call(e)}var Ko=Br((function(e){return Qr(ar(e,1,Na,!0))})),zo=Br((function(e){var t=Uo(e);return Na(t)&&(t=void 0),Qr(ar(e,1,Na,!0),Ji(t,2))})),Go=Br((function(e){var t=Uo(e);return t="function"==typeof t?t:void 0,Qr(ar(e,1,Na,!0),void 0,t)}));function Wo(e){if(!e||!e.length)return[];var t=0;return e=ct(e,(function(e){if(Na(e))return t=sn(e.length,t),!0})),Tt(t,(function(t){return dt(e,Ft(t))}))}function Yo(e,t){if(!e||!e.length)return[];var n=Wo(e);return null==t?n:dt(n,(function(e){return ot(t,void 0,e)}))}var Xo=Br((function(e,t){return Na(e)?er(e,t):[]})),Jo=Br((function(e){return ii(ct(e,Na))})),Zo=Br((function(e){var t=Uo(e);return Na(t)&&(t=void 0),ii(ct(e,Na),Ji(t,2))})),Qo=Br((function(e){var t=Uo(e);return t="function"==typeof t?t:void 0,ii(ct(e,Na),void 0,t)})),ea=Br(Wo);var ta=Br((function(e){var t=e.length,n=t>1?e[t-1]:void 0;return n="function"==typeof n?(e.pop(),n):void 0,Yo(e,n)}));function na(e){var t=Tn(e);return t.__chain__=!0,t}function ra(e,t){return t(e)}var ia=Ki((function(e){var t=e.length,n=t?e[0]:0,r=this.__wrapped__,i=function(t){return Yn(t,e)};return!(t>1||this.__actions__.length)&&r instanceof On&&so(n)?((r=r.slice(n,+n+(t?1:0))).__actions__.push({func:ra,args:[i],thisArg:void 0}),new Pn(r,this.__chain__).thru((function(e){return t&&!e.length&&e.push(void 0),e}))):this.thru(i)}));var oa=wi((function(e,t,n){Ee.call(e,n)?++e[n]:Wn(e,n,1)}));var aa=$i(Oo),sa=$i(ko);function ua(e,t){return(ka(e)?st:tr)(e,Ji(t,3))}function la(e,t){return(ka(e)?ut:nr)(e,Ji(t,3))}var ca=wi((function(e,t,n){Ee.call(e,n)?e[n].push(t):Wn(e,n,[t])}));var pa=Br((function(e,t,n){var i=-1,o="function"==typeof t,a=ja(e)?r(e.length):[];return tr(e,(function(e){a[++i]=o?ot(t,e,n):br(e,t,n)})),a})),ha=wi((function(e,t,n){Wn(e,n,t)}));function da(e,t){return(ka(e)?dt:Dr)(e,Ji(t,3))}var fa=wi((function(e,t,n){e[n?0:1].push(t)}),(function(){return[[],[]]}));var ga=Br((function(e,t){if(null==e)return[];var n=t.length;return n>1&&uo(e,t[0],t[1])?t=[]:n>2&&uo(t[0],t[1],t[2])&&(t=[t[0]]),Or(e,ar(t,1),[])})),ma=Jt||function(){return Ge.Date.now()};function va(e,t,n){return t=n?void 0:t,Ui(e,128,void 0,void 0,void 0,void 0,t=e&&null==t?e.length:t)}function ya(e,t){var n;if("function"!=typeof t)throw new ve(o);return e=is(e),function(){return--e>0&&(n=t.apply(this,arguments)),e<=1&&(t=void 0),n}}var ba=Br((function(e,t,n){var r=1;if(n.length){var i=Vt(n,Xi(ba));r|=32}return Ui(e,r,t,n,i)})),wa=Br((function(e,t,n){var r=3;if(n.length){var i=Vt(n,Xi(wa));r|=32}return Ui(t,r,e,n,i)}));function xa(e,t,n){var r,i,a,s,u,l,c=0,p=!1,h=!1,d=!0;if("function"!=typeof e)throw new ve(o);function f(t){var n=r,o=i;return r=i=void 0,c=t,s=e.apply(o,n)}function g(e){return c=e,u=xo(v,t),p?f(e):s}function m(e){var n=e-l;return void 0===l||n>=t||n<0||h&&e-c>=a}function v(){var e=ma();if(m(e))return y(e);u=xo(v,function(e){var n=t-(e-l);return h?un(n,a-(e-c)):n}(e))}function y(e){return u=void 0,d&&r?f(e):(r=i=void 0,s)}function b(){var e=ma(),n=m(e);if(r=arguments,i=this,l=e,n){if(void 0===u)return g(l);if(h)return pi(u),u=xo(v,t),f(l)}return void 0===u&&(u=xo(v,t)),s}return t=as(t)||0,qa(n)&&(p=!!n.leading,a=(h="maxWait"in n)?sn(as(n.maxWait)||0,t):a,d="trailing"in n?!!n.trailing:d),b.cancel=function(){void 0!==u&&pi(u),c=0,r=l=i=u=void 0},b.flush=function(){return void 0===u?s:y(ma())},b}var Sa=Br((function(e,t){return Qn(e,1,t)})),Ea=Br((function(e,t,n){return Qn(e,as(t)||0,n)}));function Aa(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new ve(o);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(Aa.Cache||jn),n}function Fa(e){if("function"!=typeof e)throw new ve(o);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Aa.Cache=jn;var Ca=li((function(e,t){var n=(t=1==t.length&&ka(t[0])?dt(t[0],Rt(Ji())):dt(ar(t,1),Rt(Ji()))).length;return Br((function(r){for(var i=-1,o=un(r.length,n);++i<o;)r[i]=t[i].call(this,r[i]);return ot(e,this,r)}))})),$a=Br((function(e,t){return Ui(e,32,void 0,t,Vt(t,Xi($a)))})),Da=Br((function(e,t){return Ui(e,64,void 0,t,Vt(t,Xi(Da)))})),Ta=Ki((function(e,t){return Ui(e,256,void 0,void 0,void 0,t)}));function Ia(e,t){return e===t||e!=e&&t!=t}var Ra=_i(gr),Pa=_i((function(e,t){return e>=t})),Oa=wr(function(){return arguments}())?wr:function(e){return Ka(e)&&Ee.call(e,"callee")&&!ze.call(e,"callee")},ka=r.isArray,_a=Qe?Rt(Qe):function(e){return Ka(e)&&fr(e)==E};function ja(e){return null!=e&&Va(e.length)&&!Ma(e)}function Na(e){return Ka(e)&&ja(e)}var La=nn||au,Ba=et?Rt(et):function(e){return Ka(e)&&fr(e)==p};function Ua(e){if(!Ka(e))return!1;var t=fr(e);return t==h||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!Wa(e)}function Ma(e){if(!qa(e))return!1;var t=fr(e);return t==d||t==f||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Ha(e){return"number"==typeof e&&e==is(e)}function Va(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function qa(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function Ka(e){return null!=e&&"object"==typeof e}var za=tt?Rt(tt):function(e){return Ka(e)&&ro(e)==g};function Ga(e){return"number"==typeof e||Ka(e)&&fr(e)==m}function Wa(e){if(!Ka(e)||fr(e)!=v)return!1;var t=He(e);if(null===t)return!0;var n=Ee.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Se.call(n)==$e}var Ya=nt?Rt(nt):function(e){return Ka(e)&&fr(e)==y};var Xa=rt?Rt(rt):function(e){return Ka(e)&&ro(e)==b};function Ja(e){return"string"==typeof e||!ka(e)&&Ka(e)&&fr(e)==w}function Za(e){return"symbol"==typeof e||Ka(e)&&fr(e)==x}var Qa=it?Rt(it):function(e){return Ka(e)&&Va(e.length)&&!!Ue[fr(e)]};var es=_i($r),ts=_i((function(e,t){return e<=t}));function ns(e){if(!e)return[];if(ja(e))return Ja(e)?Gt(e):yi(e);if(Je&&e[Je])return function(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}(e[Je]());var t=ro(e);return(t==g?Mt:t==b?qt:Is)(e)}function rs(e){return e?(e=as(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function is(e){var t=rs(e),n=t%1;return t==t?n?t-n:t:0}function os(e){return e?Xn(is(e),0,4294967295):0}function as(e){if("number"==typeof e)return e;if(Za(e))return NaN;if(qa(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=qa(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=It(e);var n=oe.test(e);return n||se.test(e)?qe(e.slice(2),n?2:8):ie.test(e)?NaN:+e}function ss(e){return bi(e,Ss(e))}function us(e){return null==e?"":Zr(e)}var ls=xi((function(e,t){if(ho(t)||ja(t))bi(t,xs(t),e);else for(var n in t)Ee.call(t,n)&&qn(e,n,t[n])})),cs=xi((function(e,t){bi(t,Ss(t),e)})),ps=xi((function(e,t,n,r){bi(t,Ss(t),e,r)})),hs=xi((function(e,t,n,r){bi(t,xs(t),e,r)})),ds=Ki(Yn);var fs=Br((function(e,t){e=fe(e);var n=-1,r=t.length,i=r>2?t[2]:void 0;for(i&&uo(t[0],t[1],i)&&(r=1);++n<r;)for(var o=t[n],a=Ss(o),s=-1,u=a.length;++s<u;){var l=a[s],c=e[l];(void 0===c||Ia(c,we[l])&&!Ee.call(e,l))&&(e[l]=o[l])}return e})),gs=Br((function(e){return e.push(void 0,Hi),ot(As,void 0,e)}));function ms(e,t,n){var r=null==e?void 0:hr(e,t);return void 0===r?n:r}function vs(e,t){return null!=e&&io(e,t,vr)}var ys=Ii((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ce.call(t)),e[t]=n}),qs(Gs)),bs=Ii((function(e,t,n){null!=t&&"function"!=typeof t.toString&&(t=Ce.call(t)),Ee.call(e,t)?e[t].push(n):e[t]=[n]}),Ji),ws=Br(br);function xs(e){return ja(e)?Bn(e):Fr(e)}function Ss(e){return ja(e)?Bn(e,!0):Cr(e)}var Es=xi((function(e,t,n){Rr(e,t,n)})),As=xi((function(e,t,n,r){Rr(e,t,n,r)})),Fs=Ki((function(e,t){var n={};if(null==e)return n;var r=!1;t=dt(t,(function(t){return t=ui(t,e),r||(r=t.length>1),t})),bi(e,Gi(e),n),r&&(n=Jn(n,7,Vi));for(var i=t.length;i--;)ei(n,t[i]);return n}));var Cs=Ki((function(e,t){return null==e?{}:function(e,t){return kr(e,t,(function(t,n){return vs(e,n)}))}(e,t)}));function $s(e,t){if(null==e)return{};var n=dt(Gi(e),(function(e){return[e]}));return t=Ji(t),kr(e,n,(function(e,n){return t(e,n[0])}))}var Ds=Bi(xs),Ts=Bi(Ss);function Is(e){return null==e?[]:Pt(e,xs(e))}var Rs=Fi((function(e,t,n){return t=t.toLowerCase(),e+(n?Ps(t):t)}));function Ps(e){return Us(us(e).toLowerCase())}function Os(e){return(e=us(e))&&e.replace(le,Nt).replace(Oe,"")}var ks=Fi((function(e,t,n){return e+(n?"-":"")+t.toLowerCase()})),_s=Fi((function(e,t,n){return e+(n?" ":"")+t.toLowerCase()})),js=Ai("toLowerCase");var Ns=Fi((function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}));var Ls=Fi((function(e,t,n){return e+(n?" ":"")+Us(t)}));var Bs=Fi((function(e,t,n){return e+(n?" ":"")+t.toUpperCase()})),Us=Ai("toUpperCase");function Ms(e,t,n){return e=us(e),void 0===(t=n?void 0:t)?function(e){return Ne.test(e)}(e)?function(e){return e.match(_e)||[]}(e):function(e){return e.match(Q)||[]}(e):e.match(t)||[]}var Hs=Br((function(e,t){try{return ot(e,void 0,t)}catch(e){return Ua(e)?e:new Y(e)}})),Vs=Ki((function(e,t){return st(t,(function(t){t=$o(t),Wn(e,t,ba(e[t],e))})),e}));function qs(e){return function(){return e}}var Ks=Di(),zs=Di(!0);function Gs(e){return e}function Ws(e){return Ar("function"==typeof e?e:Jn(e,1))}var Ys=Br((function(e,t){return function(n){return br(n,e,t)}})),Xs=Br((function(e,t){return function(n){return br(e,n,t)}}));function Js(e,t,n){var r=xs(t),i=pr(t,r);null!=n||qa(t)&&(i.length||!r.length)||(n=t,t=e,e=this,i=pr(t,xs(t)));var o=!(qa(n)&&"chain"in n&&!n.chain),a=Ma(e);return st(i,(function(n){var r=t[n];e[n]=r,a&&(e.prototype[n]=function(){var t=this.__chain__;if(o||t){var n=e(this.__wrapped__),i=n.__actions__=yi(this.__actions__);return i.push({func:r,args:arguments,thisArg:e}),n.__chain__=t,n}return r.apply(e,ft([this.value()],arguments))})})),e}function Zs(){}var Qs=Pi(dt),eu=Pi(lt),tu=Pi(vt);function nu(e){return lo(e)?Ft($o(e)):function(e){return function(t){return hr(t,e)}}(e)}var ru=ki(),iu=ki(!0);function ou(){return[]}function au(){return!1}var su=Ri((function(e,t){return e+t}),0),uu=Ni("ceil"),lu=Ri((function(e,t){return e/t}),1),cu=Ni("floor");var pu,hu=Ri((function(e,t){return e*t}),1),du=Ni("round"),fu=Ri((function(e,t){return e-t}),0);return Tn.after=function(e,t){if("function"!=typeof t)throw new ve(o);return e=is(e),function(){if(--e<1)return t.apply(this,arguments)}},Tn.ary=va,Tn.assign=ls,Tn.assignIn=cs,Tn.assignInWith=ps,Tn.assignWith=hs,Tn.at=ds,Tn.before=ya,Tn.bind=ba,Tn.bindAll=Vs,Tn.bindKey=wa,Tn.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return ka(e)?e:[e]},Tn.chain=na,Tn.chunk=function(e,t,n){t=(n?uo(e,t,n):void 0===t)?1:sn(is(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var o=0,a=0,s=r(Qt(i/t));o<i;)s[a++]=zr(e,o,o+=t);return s},Tn.compact=function(e){for(var t=-1,n=null==e?0:e.length,r=0,i=[];++t<n;){var o=e[t];o&&(i[r++]=o)}return i},Tn.concat=function(){var e=arguments.length;if(!e)return[];for(var t=r(e-1),n=arguments[0],i=e;i--;)t[i-1]=arguments[i];return ft(ka(n)?yi(n):[n],ar(t,1))},Tn.cond=function(e){var t=null==e?0:e.length,n=Ji();return e=t?dt(e,(function(e){if("function"!=typeof e[1])throw new ve(o);return[n(e[0]),e[1]]})):[],Br((function(n){for(var r=-1;++r<t;){var i=e[r];if(ot(i[0],this,n))return ot(i[1],this,n)}}))},Tn.conforms=function(e){return function(e){var t=xs(e);return function(n){return Zn(n,e,t)}}(Jn(e,1))},Tn.constant=qs,Tn.countBy=oa,Tn.create=function(e,t){var n=In(e);return null==t?n:Gn(n,t)},Tn.curry=function e(t,n,r){var i=Ui(t,8,void 0,void 0,void 0,void 0,void 0,n=r?void 0:n);return i.placeholder=e.placeholder,i},Tn.curryRight=function e(t,n,r){var i=Ui(t,16,void 0,void 0,void 0,void 0,void 0,n=r?void 0:n);return i.placeholder=e.placeholder,i},Tn.debounce=xa,Tn.defaults=fs,Tn.defaultsDeep=gs,Tn.defer=Sa,Tn.delay=Ea,Tn.difference=Io,Tn.differenceBy=Ro,Tn.differenceWith=Po,Tn.drop=function(e,t,n){var r=null==e?0:e.length;return r?zr(e,(t=n||void 0===t?1:is(t))<0?0:t,r):[]},Tn.dropRight=function(e,t,n){var r=null==e?0:e.length;return r?zr(e,0,(t=r-(t=n||void 0===t?1:is(t)))<0?0:t):[]},Tn.dropRightWhile=function(e,t){return e&&e.length?ni(e,Ji(t,3),!0,!0):[]},Tn.dropWhile=function(e,t){return e&&e.length?ni(e,Ji(t,3),!0):[]},Tn.fill=function(e,t,n,r){var i=null==e?0:e.length;return i?(n&&"number"!=typeof n&&uo(e,t,n)&&(n=0,r=i),function(e,t,n,r){var i=e.length;for((n=is(n))<0&&(n=-n>i?0:i+n),(r=void 0===r||r>i?i:is(r))<0&&(r+=i),r=n>r?0:os(r);n<r;)e[n++]=t;return e}(e,t,n,r)):[]},Tn.filter=function(e,t){return(ka(e)?ct:or)(e,Ji(t,3))},Tn.flatMap=function(e,t){return ar(da(e,t),1)},Tn.flatMapDeep=function(e,t){return ar(da(e,t),1/0)},Tn.flatMapDepth=function(e,t,n){return n=void 0===n?1:is(n),ar(da(e,t),n)},Tn.flatten=_o,Tn.flattenDeep=function(e){return(null==e?0:e.length)?ar(e,1/0):[]},Tn.flattenDepth=function(e,t){return(null==e?0:e.length)?ar(e,t=void 0===t?1:is(t)):[]},Tn.flip=function(e){return Ui(e,512)},Tn.flow=Ks,Tn.flowRight=zs,Tn.fromPairs=function(e){for(var t=-1,n=null==e?0:e.length,r={};++t<n;){var i=e[t];r[i[0]]=i[1]}return r},Tn.functions=function(e){return null==e?[]:pr(e,xs(e))},Tn.functionsIn=function(e){return null==e?[]:pr(e,Ss(e))},Tn.groupBy=ca,Tn.initial=function(e){return(null==e?0:e.length)?zr(e,0,-1):[]},Tn.intersection=No,Tn.intersectionBy=Lo,Tn.intersectionWith=Bo,Tn.invert=ys,Tn.invertBy=bs,Tn.invokeMap=pa,Tn.iteratee=Ws,Tn.keyBy=ha,Tn.keys=xs,Tn.keysIn=Ss,Tn.map=da,Tn.mapKeys=function(e,t){var n={};return t=Ji(t,3),lr(e,(function(e,r,i){Wn(n,t(e,r,i),e)})),n},Tn.mapValues=function(e,t){var n={};return t=Ji(t,3),lr(e,(function(e,r,i){Wn(n,r,t(e,r,i))})),n},Tn.matches=function(e){return Tr(Jn(e,1))},Tn.matchesProperty=function(e,t){return Ir(e,Jn(t,1))},Tn.memoize=Aa,Tn.merge=Es,Tn.mergeWith=As,Tn.method=Ys,Tn.methodOf=Xs,Tn.mixin=Js,Tn.negate=Fa,Tn.nthArg=function(e){return e=is(e),Br((function(t){return Pr(t,e)}))},Tn.omit=Fs,Tn.omitBy=function(e,t){return $s(e,Fa(Ji(t)))},Tn.once=function(e){return ya(2,e)},Tn.orderBy=function(e,t,n,r){return null==e?[]:(ka(t)||(t=null==t?[]:[t]),ka(n=r?void 0:n)||(n=null==n?[]:[n]),Or(e,t,n))},Tn.over=Qs,Tn.overArgs=Ca,Tn.overEvery=eu,Tn.overSome=tu,Tn.partial=$a,Tn.partialRight=Da,Tn.partition=fa,Tn.pick=Cs,Tn.pickBy=$s,Tn.property=nu,Tn.propertyOf=function(e){return function(t){return null==e?void 0:hr(e,t)}},Tn.pull=Mo,Tn.pullAll=Ho,Tn.pullAllBy=function(e,t,n){return e&&e.length&&t&&t.length?_r(e,t,Ji(n,2)):e},Tn.pullAllWith=function(e,t,n){return e&&e.length&&t&&t.length?_r(e,t,void 0,n):e},Tn.pullAt=Vo,Tn.range=ru,Tn.rangeRight=iu,Tn.rearg=Ta,Tn.reject=function(e,t){return(ka(e)?ct:or)(e,Fa(Ji(t,3)))},Tn.remove=function(e,t){var n=[];if(!e||!e.length)return n;var r=-1,i=[],o=e.length;for(t=Ji(t,3);++r<o;){var a=e[r];t(a,r,e)&&(n.push(a),i.push(r))}return jr(e,i),n},Tn.rest=function(e,t){if("function"!=typeof e)throw new ve(o);return Br(e,t=void 0===t?t:is(t))},Tn.reverse=qo,Tn.sampleSize=function(e,t,n){return t=(n?uo(e,t,n):void 0===t)?1:is(t),(ka(e)?Mn:Mr)(e,t)},Tn.set=function(e,t,n){return null==e?e:Hr(e,t,n)},Tn.setWith=function(e,t,n,r){return r="function"==typeof r?r:void 0,null==e?e:Hr(e,t,n,r)},Tn.shuffle=function(e){return(ka(e)?Hn:Kr)(e)},Tn.slice=function(e,t,n){var r=null==e?0:e.length;return r?(n&&"number"!=typeof n&&uo(e,t,n)?(t=0,n=r):(t=null==t?0:is(t),n=void 0===n?r:is(n)),zr(e,t,n)):[]},Tn.sortBy=ga,Tn.sortedUniq=function(e){return e&&e.length?Xr(e):[]},Tn.sortedUniqBy=function(e,t){return e&&e.length?Xr(e,Ji(t,2)):[]},Tn.split=function(e,t,n){return n&&"number"!=typeof n&&uo(e,t,n)&&(t=n=void 0),(n=void 0===n?4294967295:n>>>0)?(e=us(e))&&("string"==typeof t||null!=t&&!Ya(t))&&!(t=Zr(t))&&Ut(e)?ci(Gt(e),0,n):e.split(t,n):[]},Tn.spread=function(e,t){if("function"!=typeof e)throw new ve(o);return t=null==t?0:sn(is(t),0),Br((function(n){var r=n[t],i=ci(n,0,t);return r&&ft(i,r),ot(e,this,i)}))},Tn.tail=function(e){var t=null==e?0:e.length;return t?zr(e,1,t):[]},Tn.take=function(e,t,n){return e&&e.length?zr(e,0,(t=n||void 0===t?1:is(t))<0?0:t):[]},Tn.takeRight=function(e,t,n){var r=null==e?0:e.length;return r?zr(e,(t=r-(t=n||void 0===t?1:is(t)))<0?0:t,r):[]},Tn.takeRightWhile=function(e,t){return e&&e.length?ni(e,Ji(t,3),!1,!0):[]},Tn.takeWhile=function(e,t){return e&&e.length?ni(e,Ji(t,3)):[]},Tn.tap=function(e,t){return t(e),e},Tn.throttle=function(e,t,n){var r=!0,i=!0;if("function"!=typeof e)throw new ve(o);return qa(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),xa(e,t,{leading:r,maxWait:t,trailing:i})},Tn.thru=ra,Tn.toArray=ns,Tn.toPairs=Ds,Tn.toPairsIn=Ts,Tn.toPath=function(e){return ka(e)?dt(e,$o):Za(e)?[e]:yi(Co(us(e)))},Tn.toPlainObject=ss,Tn.transform=function(e,t,n){var r=ka(e),i=r||La(e)||Qa(e);if(t=Ji(t,4),null==n){var o=e&&e.constructor;n=i?r?new o:[]:qa(e)&&Ma(o)?In(He(e)):{}}return(i?st:lr)(e,(function(e,r,i){return t(n,e,r,i)})),n},Tn.unary=function(e){return va(e,1)},Tn.union=Ko,Tn.unionBy=zo,Tn.unionWith=Go,Tn.uniq=function(e){return e&&e.length?Qr(e):[]},Tn.uniqBy=function(e,t){return e&&e.length?Qr(e,Ji(t,2)):[]},Tn.uniqWith=function(e,t){return t="function"==typeof t?t:void 0,e&&e.length?Qr(e,void 0,t):[]},Tn.unset=function(e,t){return null==e||ei(e,t)},Tn.unzip=Wo,Tn.unzipWith=Yo,Tn.update=function(e,t,n){return null==e?e:ti(e,t,si(n))},Tn.updateWith=function(e,t,n,r){return r="function"==typeof r?r:void 0,null==e?e:ti(e,t,si(n),r)},Tn.values=Is,Tn.valuesIn=function(e){return null==e?[]:Pt(e,Ss(e))},Tn.without=Xo,Tn.words=Ms,Tn.wrap=function(e,t){return $a(si(t),e)},Tn.xor=Jo,Tn.xorBy=Zo,Tn.xorWith=Qo,Tn.zip=ea,Tn.zipObject=function(e,t){return oi(e||[],t||[],qn)},Tn.zipObjectDeep=function(e,t){return oi(e||[],t||[],Hr)},Tn.zipWith=ta,Tn.entries=Ds,Tn.entriesIn=Ts,Tn.extend=cs,Tn.extendWith=ps,Js(Tn,Tn),Tn.add=su,Tn.attempt=Hs,Tn.camelCase=Rs,Tn.capitalize=Ps,Tn.ceil=uu,Tn.clamp=function(e,t,n){return void 0===n&&(n=t,t=void 0),void 0!==n&&(n=(n=as(n))==n?n:0),void 0!==t&&(t=(t=as(t))==t?t:0),Xn(as(e),t,n)},Tn.clone=function(e){return Jn(e,4)},Tn.cloneDeep=function(e){return Jn(e,5)},Tn.cloneDeepWith=function(e,t){return Jn(e,5,t="function"==typeof t?t:void 0)},Tn.cloneWith=function(e,t){return Jn(e,4,t="function"==typeof t?t:void 0)},Tn.conformsTo=function(e,t){return null==t||Zn(e,t,xs(t))},Tn.deburr=Os,Tn.defaultTo=function(e,t){return null==e||e!=e?t:e},Tn.divide=lu,Tn.endsWith=function(e,t,n){e=us(e),t=Zr(t);var r=e.length,i=n=void 0===n?r:Xn(is(n),0,r);return(n-=t.length)>=0&&e.slice(n,i)==t},Tn.eq=Ia,Tn.escape=function(e){return(e=us(e))&&B.test(e)?e.replace(N,Lt):e},Tn.escapeRegExp=function(e){return(e=us(e))&&G.test(e)?e.replace(z,"\\$&"):e},Tn.every=function(e,t,n){var r=ka(e)?lt:rr;return n&&uo(e,t,n)&&(t=void 0),r(e,Ji(t,3))},Tn.find=aa,Tn.findIndex=Oo,Tn.findKey=function(e,t){return bt(e,Ji(t,3),lr)},Tn.findLast=sa,Tn.findLastIndex=ko,Tn.findLastKey=function(e,t){return bt(e,Ji(t,3),cr)},Tn.floor=cu,Tn.forEach=ua,Tn.forEachRight=la,Tn.forIn=function(e,t){return null==e?e:sr(e,Ji(t,3),Ss)},Tn.forInRight=function(e,t){return null==e?e:ur(e,Ji(t,3),Ss)},Tn.forOwn=function(e,t){return e&&lr(e,Ji(t,3))},Tn.forOwnRight=function(e,t){return e&&cr(e,Ji(t,3))},Tn.get=ms,Tn.gt=Ra,Tn.gte=Pa,Tn.has=function(e,t){return null!=e&&io(e,t,mr)},Tn.hasIn=vs,Tn.head=jo,Tn.identity=Gs,Tn.includes=function(e,t,n,r){e=ja(e)?e:Is(e),n=n&&!r?is(n):0;var i=e.length;return n<0&&(n=sn(i+n,0)),Ja(e)?n<=i&&e.indexOf(t,n)>-1:!!i&&xt(e,t,n)>-1},Tn.indexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=null==n?0:is(n);return i<0&&(i=sn(r+i,0)),xt(e,t,i)},Tn.inRange=function(e,t,n){return t=rs(t),void 0===n?(n=t,t=0):n=rs(n),function(e,t,n){return e>=un(t,n)&&e<sn(t,n)}(e=as(e),t,n)},Tn.invoke=ws,Tn.isArguments=Oa,Tn.isArray=ka,Tn.isArrayBuffer=_a,Tn.isArrayLike=ja,Tn.isArrayLikeObject=Na,Tn.isBoolean=function(e){return!0===e||!1===e||Ka(e)&&fr(e)==c},Tn.isBuffer=La,Tn.isDate=Ba,Tn.isElement=function(e){return Ka(e)&&1===e.nodeType&&!Wa(e)},Tn.isEmpty=function(e){if(null==e)return!0;if(ja(e)&&(ka(e)||"string"==typeof e||"function"==typeof e.splice||La(e)||Qa(e)||Oa(e)))return!e.length;var t=ro(e);if(t==g||t==b)return!e.size;if(ho(e))return!Fr(e).length;for(var n in e)if(Ee.call(e,n))return!1;return!0},Tn.isEqual=function(e,t){return xr(e,t)},Tn.isEqualWith=function(e,t,n){var r=(n="function"==typeof n?n:void 0)?n(e,t):void 0;return void 0===r?xr(e,t,void 0,n):!!r},Tn.isError=Ua,Tn.isFinite=function(e){return"number"==typeof e&&rn(e)},Tn.isFunction=Ma,Tn.isInteger=Ha,Tn.isLength=Va,Tn.isMap=za,Tn.isMatch=function(e,t){return e===t||Sr(e,t,Qi(t))},Tn.isMatchWith=function(e,t,n){return n="function"==typeof n?n:void 0,Sr(e,t,Qi(t),n)},Tn.isNaN=function(e){return Ga(e)&&e!=+e},Tn.isNative=function(e){if(po(e))throw new Y("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Er(e)},Tn.isNil=function(e){return null==e},Tn.isNull=function(e){return null===e},Tn.isNumber=Ga,Tn.isObject=qa,Tn.isObjectLike=Ka,Tn.isPlainObject=Wa,Tn.isRegExp=Ya,Tn.isSafeInteger=function(e){return Ha(e)&&e>=-9007199254740991&&e<=9007199254740991},Tn.isSet=Xa,Tn.isString=Ja,Tn.isSymbol=Za,Tn.isTypedArray=Qa,Tn.isUndefined=function(e){return void 0===e},Tn.isWeakMap=function(e){return Ka(e)&&ro(e)==S},Tn.isWeakSet=function(e){return Ka(e)&&"[object WeakSet]"==fr(e)},Tn.join=function(e,t){return null==e?"":on.call(e,t)},Tn.kebabCase=ks,Tn.last=Uo,Tn.lastIndexOf=function(e,t,n){var r=null==e?0:e.length;if(!r)return-1;var i=r;return void 0!==n&&(i=(i=is(n))<0?sn(r+i,0):un(i,r-1)),t==t?function(e,t,n){for(var r=n+1;r--;)if(e[r]===t)return r;return r}(e,t,i):wt(e,Et,i,!0)},Tn.lowerCase=_s,Tn.lowerFirst=js,Tn.lt=es,Tn.lte=ts,Tn.max=function(e){return e&&e.length?ir(e,Gs,gr):void 0},Tn.maxBy=function(e,t){return e&&e.length?ir(e,Ji(t,2),gr):void 0},Tn.mean=function(e){return At(e,Gs)},Tn.meanBy=function(e,t){return At(e,Ji(t,2))},Tn.min=function(e){return e&&e.length?ir(e,Gs,$r):void 0},Tn.minBy=function(e,t){return e&&e.length?ir(e,Ji(t,2),$r):void 0},Tn.stubArray=ou,Tn.stubFalse=au,Tn.stubObject=function(){return{}},Tn.stubString=function(){return""},Tn.stubTrue=function(){return!0},Tn.multiply=hu,Tn.nth=function(e,t){return e&&e.length?Pr(e,is(t)):void 0},Tn.noConflict=function(){return Ge._===this&&(Ge._=De),this},Tn.noop=Zs,Tn.now=ma,Tn.pad=function(e,t,n){e=us(e);var r=(t=is(t))?zt(e):0;if(!t||r>=t)return e;var i=(t-r)/2;return Oi(en(i),n)+e+Oi(Qt(i),n)},Tn.padEnd=function(e,t,n){e=us(e);var r=(t=is(t))?zt(e):0;return t&&r<t?e+Oi(t-r,n):e},Tn.padStart=function(e,t,n){e=us(e);var r=(t=is(t))?zt(e):0;return t&&r<t?Oi(t-r,n)+e:e},Tn.parseInt=function(e,t,n){return n||null==t?t=0:t&&(t=+t),cn(us(e).replace(W,""),t||0)},Tn.random=function(e,t,n){if(n&&"boolean"!=typeof n&&uo(e,t,n)&&(t=n=void 0),void 0===n&&("boolean"==typeof t?(n=t,t=void 0):"boolean"==typeof e&&(n=e,e=void 0)),void 0===e&&void 0===t?(e=0,t=1):(e=rs(e),void 0===t?(t=e,e=0):t=rs(t)),e>t){var r=e;e=t,t=r}if(n||e%1||t%1){var i=pn();return un(e+i*(t-e+Ve("1e-"+((i+"").length-1))),t)}return Nr(e,t)},Tn.reduce=function(e,t,n){var r=ka(e)?gt:$t,i=arguments.length<3;return r(e,Ji(t,4),n,i,tr)},Tn.reduceRight=function(e,t,n){var r=ka(e)?mt:$t,i=arguments.length<3;return r(e,Ji(t,4),n,i,nr)},Tn.repeat=function(e,t,n){return t=(n?uo(e,t,n):void 0===t)?1:is(t),Lr(us(e),t)},Tn.replace=function(){var e=arguments,t=us(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Tn.result=function(e,t,n){var r=-1,i=(t=ui(t,e)).length;for(i||(i=1,e=void 0);++r<i;){var o=null==e?void 0:e[$o(t[r])];void 0===o&&(r=i,o=n),e=Ma(o)?o.call(e):o}return e},Tn.round=du,Tn.runInContext=e,Tn.sample=function(e){return(ka(e)?Un:Ur)(e)},Tn.size=function(e){if(null==e)return 0;if(ja(e))return Ja(e)?zt(e):e.length;var t=ro(e);return t==g||t==b?e.size:Fr(e).length},Tn.snakeCase=Ns,Tn.some=function(e,t,n){var r=ka(e)?vt:Gr;return n&&uo(e,t,n)&&(t=void 0),r(e,Ji(t,3))},Tn.sortedIndex=function(e,t){return Wr(e,t)},Tn.sortedIndexBy=function(e,t,n){return Yr(e,t,Ji(n,2))},Tn.sortedIndexOf=function(e,t){var n=null==e?0:e.length;if(n){var r=Wr(e,t);if(r<n&&Ia(e[r],t))return r}return-1},Tn.sortedLastIndex=function(e,t){return Wr(e,t,!0)},Tn.sortedLastIndexBy=function(e,t,n){return Yr(e,t,Ji(n,2),!0)},Tn.sortedLastIndexOf=function(e,t){if(null==e?0:e.length){var n=Wr(e,t,!0)-1;if(Ia(e[n],t))return n}return-1},Tn.startCase=Ls,Tn.startsWith=function(e,t,n){return e=us(e),n=null==n?0:Xn(is(n),0,e.length),t=Zr(t),e.slice(n,n+t.length)==t},Tn.subtract=fu,Tn.sum=function(e){return e&&e.length?Dt(e,Gs):0},Tn.sumBy=function(e,t){return e&&e.length?Dt(e,Ji(t,2)):0},Tn.template=function(e,t,n){var r=Tn.templateSettings;n&&uo(e,t,n)&&(t=void 0),e=us(e),t=ps({},t,r,Mi);var i,o,a=ps({},t.imports,r.imports,Mi),s=xs(a),u=Pt(a,s),l=0,c=t.interpolate||ce,p="__p += '",h=ge((t.escape||ce).source+"|"+c.source+"|"+(c===H?ne:ce).source+"|"+(t.evaluate||ce).source+"|$","g"),d="//# sourceURL="+(Ee.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Be+"]")+"\n";e.replace(h,(function(t,n,r,a,s,u){return r||(r=a),p+=e.slice(l,u).replace(pe,Bt),n&&(i=!0,p+="' +\n__e("+n+") +\n'"),s&&(o=!0,p+="';\n"+s+";\n__p += '"),r&&(p+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),l=u+t.length,t})),p+="';\n";var f=Ee.call(t,"variable")&&t.variable;if(f){if(ee.test(f))throw new Y("Invalid `variable` option passed into `_.template`")}else p="with (obj) {\n"+p+"\n}\n";p=(o?p.replace(O,""):p).replace(k,"$1").replace(_,"$1;"),p="function("+(f||"obj")+") {\n"+(f?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+p+"return __p\n}";var g=Hs((function(){return he(s,d+"return "+p).apply(void 0,u)}));if(g.source=p,Ua(g))throw g;return g},Tn.times=function(e,t){if((e=is(e))<1||e>9007199254740991)return[];var n=4294967295,r=un(e,4294967295);e-=4294967295;for(var i=Tt(r,t=Ji(t));++n<e;)t(n);return i},Tn.toFinite=rs,Tn.toInteger=is,Tn.toLength=os,Tn.toLower=function(e){return us(e).toLowerCase()},Tn.toNumber=as,Tn.toSafeInteger=function(e){return e?Xn(is(e),-9007199254740991,9007199254740991):0===e?e:0},Tn.toString=us,Tn.toUpper=function(e){return us(e).toUpperCase()},Tn.trim=function(e,t,n){if((e=us(e))&&(n||void 0===t))return It(e);if(!e||!(t=Zr(t)))return e;var r=Gt(e),i=Gt(t);return ci(r,kt(r,i),_t(r,i)+1).join("")},Tn.trimEnd=function(e,t,n){if((e=us(e))&&(n||void 0===t))return e.slice(0,Wt(e)+1);if(!e||!(t=Zr(t)))return e;var r=Gt(e);return ci(r,0,_t(r,Gt(t))+1).join("")},Tn.trimStart=function(e,t,n){if((e=us(e))&&(n||void 0===t))return e.replace(W,"");if(!e||!(t=Zr(t)))return e;var r=Gt(e);return ci(r,kt(r,Gt(t))).join("")},Tn.truncate=function(e,t){var n=30,r="...";if(qa(t)){var i="separator"in t?t.separator:i;n="length"in t?is(t.length):n,r="omission"in t?Zr(t.omission):r}var o=(e=us(e)).length;if(Ut(e)){var a=Gt(e);o=a.length}if(n>=o)return e;var s=n-zt(r);if(s<1)return r;var u=a?ci(a,0,s).join(""):e.slice(0,s);if(void 0===i)return u+r;if(a&&(s+=u.length-s),Ya(i)){if(e.slice(s).search(i)){var l,c=u;for(i.global||(i=ge(i.source,us(re.exec(i))+"g")),i.lastIndex=0;l=i.exec(c);)var p=l.index;u=u.slice(0,void 0===p?s:p)}}else if(e.indexOf(Zr(i),s)!=s){var h=u.lastIndexOf(i);h>-1&&(u=u.slice(0,h))}return u+r},Tn.unescape=function(e){return(e=us(e))&&L.test(e)?e.replace(j,Yt):e},Tn.uniqueId=function(e){var t=++Ae;return us(e)+t},Tn.upperCase=Bs,Tn.upperFirst=Us,Tn.each=ua,Tn.eachRight=la,Tn.first=jo,Js(Tn,(pu={},lr(Tn,(function(e,t){Ee.call(Tn.prototype,t)||(pu[t]=e)})),pu),{chain:!1}),Tn.VERSION="4.17.21",st(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Tn[e].placeholder=Tn})),st(["drop","take"],(function(e,t){On.prototype[e]=function(n){n=void 0===n?1:sn(is(n),0);var r=this.__filtered__&&!t?new On(this):this.clone();return r.__filtered__?r.__takeCount__=un(n,r.__takeCount__):r.__views__.push({size:un(n,4294967295),type:e+(r.__dir__<0?"Right":"")}),r},On.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),st(["filter","map","takeWhile"],(function(e,t){var n=t+1,r=1==n||3==n;On.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:Ji(e,3),type:n}),t.__filtered__=t.__filtered__||r,t}})),st(["head","last"],(function(e,t){var n="take"+(t?"Right":"");On.prototype[e]=function(){return this[n](1).value()[0]}})),st(["initial","tail"],(function(e,t){var n="drop"+(t?"":"Right");On.prototype[e]=function(){return this.__filtered__?new On(this):this[n](1)}})),On.prototype.compact=function(){return this.filter(Gs)},On.prototype.find=function(e){return this.filter(e).head()},On.prototype.findLast=function(e){return this.reverse().find(e)},On.prototype.invokeMap=Br((function(e,t){return"function"==typeof e?new On(this):this.map((function(n){return br(n,e,t)}))})),On.prototype.reject=function(e){return this.filter(Fa(Ji(e)))},On.prototype.slice=function(e,t){e=is(e);var n=this;return n.__filtered__&&(e>0||t<0)?new On(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),void 0!==t&&(n=(t=is(t))<0?n.dropRight(-t):n.take(t-e)),n)},On.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},On.prototype.toArray=function(){return this.take(4294967295)},lr(On.prototype,(function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),r=/^(?:head|last)$/.test(t),i=Tn[r?"take"+("last"==t?"Right":""):t],o=r||/^find/.test(t);i&&(Tn.prototype[t]=function(){var t=this.__wrapped__,a=r?[1]:arguments,s=t instanceof On,u=a[0],l=s||ka(t),c=function(e){var t=i.apply(Tn,ft([e],a));return r&&p?t[0]:t};l&&n&&"function"==typeof u&&1!=u.length&&(s=l=!1);var p=this.__chain__,h=!!this.__actions__.length,d=o&&!p,f=s&&!h;if(!o&&l){t=f?t:new On(this);var g=e.apply(t,a);return g.__actions__.push({func:ra,args:[c],thisArg:void 0}),new Pn(g,p)}return d&&f?e.apply(this,a):(g=this.thru(c),d?r?g.value()[0]:g.value():g)})})),st(["pop","push","shift","sort","splice","unshift"],(function(e){var t=ye[e],n=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",r=/^(?:pop|shift)$/.test(e);Tn.prototype[e]=function(){var e=arguments;if(r&&!this.__chain__){var i=this.value();return t.apply(ka(i)?i:[],e)}return this[n]((function(n){return t.apply(ka(n)?n:[],e)}))}})),lr(On.prototype,(function(e,t){var n=Tn[t];if(n){var r=n.name+"";Ee.call(wn,r)||(wn[r]=[]),wn[r].push({name:t,func:n})}})),wn[Ti(void 0,2).name]=[{name:"wrapper",func:void 0}],On.prototype.clone=function(){var e=new On(this.__wrapped__);return e.__actions__=yi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=yi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=yi(this.__views__),e},On.prototype.reverse=function(){if(this.__filtered__){var e=new On(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},On.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,n=ka(e),r=t<0,i=n?e.length:0,o=function(e,t,n){var r=-1,i=n.length;for(;++r<i;){var o=n[r],a=o.size;switch(o.type){case"drop":e+=a;break;case"dropRight":t-=a;break;case"take":t=un(t,e+a);break;case"takeRight":e=sn(e,t-a)}}return{start:e,end:t}}(0,i,this.__views__),a=o.start,s=o.end,u=s-a,l=r?s:a-1,c=this.__iteratees__,p=c.length,h=0,d=un(u,this.__takeCount__);if(!n||!r&&i==u&&d==u)return ri(e,this.__actions__);var f=[];e:for(;u--&&h<d;){for(var g=-1,m=e[l+=t];++g<p;){var v=c[g],y=v.iteratee,b=v.type,w=y(m);if(2==b)m=w;else if(!w){if(1==b)continue e;break e}}f[h++]=m}return f},Tn.prototype.at=ia,Tn.prototype.chain=function(){return na(this)},Tn.prototype.commit=function(){return new Pn(this.value(),this.__chain__)},Tn.prototype.next=function(){void 0===this.__values__&&(this.__values__=ns(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?void 0:this.__values__[this.__index__++]}},Tn.prototype.plant=function(e){for(var t,n=this;n instanceof Rn;){var r=To(n);r.__index__=0,r.__values__=void 0,t?i.__wrapped__=r:t=r;var i=r;n=n.__wrapped__}return i.__wrapped__=e,t},Tn.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof On){var t=e;return this.__actions__.length&&(t=new On(this)),(t=t.reverse()).__actions__.push({func:ra,args:[qo],thisArg:void 0}),new Pn(t,this.__chain__)}return this.thru(qo)},Tn.prototype.toJSON=Tn.prototype.valueOf=Tn.prototype.value=function(){return ri(this.__wrapped__,this.__actions__)},Tn.prototype.first=Tn.prototype.head,Je&&(Tn.prototype[Je]=function(){return this}),Tn}();Ge._=Xt,void 0===(i=function(){return Xt}.call(t,n,t,r))||(r.exports=i)}).call(this)}).call(this,n(11),n(242)(e))},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,n){"use strict";(function(e){
56
56
  /*!
57
57
  * The buffer module from node.js, for the browser.
58
58
  *
59
59
  * @author Feross Aboukhadijeh <http://feross.org>
60
60
  * @license MIT
61
61
  */
62
- var r=n(246),i=n(247),o=n(248);function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()<t)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=u.prototype:(null===e&&(e=new u(t)),e.length=t),e}function u(e,t,n){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return p(this,e)}return l(this,e,t,n)}function l(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);u.TYPED_ARRAY_SUPPORT?(e=t).__proto__=u.prototype:e=h(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!u.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|f(t,n),i=(e=s(e,r)).write(t,n);i!==r&&(e=e.slice(0,i));return e}(e,t,n):function(e,t){if(u.isBuffer(t)){var n=0|d(t.length);return 0===(e=s(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?s(e,0):h(e,t);if("Buffer"===t.type&&o(t.data))return h(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function p(e,t){if(c(t),e=s(e,t<0?0:0|d(t)),!u.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function h(e,t){var n=t.length<0?0:0|d(t.length);e=s(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function d(e){if(e>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function f(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return U(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return M(e).length;default:if(r)return U(e).length;t=(""+t).toLowerCase(),r=!0}}function g(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return T(this,t,n);case"utf8":case"utf-8":return C(this,t,n);case"ascii":return $(this,t,n);case"latin1":case"binary":return D(this,t,n);case"base64":return F(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function m(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function v(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:y(e,t,n,r,i);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,r,i){var o,a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var c=-1;for(o=n;o<s;o++)if(l(e,o)===l(t,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===u)return c*a}else-1!==c&&(o-=o-c),c=-1}else for(n+u>s&&(n=s-u),o=n;o>=0;o--){for(var p=!0,h=0;h<u;h++)if(l(e,o+h)!==l(t,h)){p=!1;break}if(p)return o}return-1}function b(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a<r;++a){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))return a;e[n+a]=s}return a}function w(e,t,n,r){return H(U(t,e.length-n),e,n,r)}function x(e,t,n,r){return H(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function S(e,t,n,r){return x(e,t,n,r)}function E(e,t,n,r){return H(M(t),e,n,r)}function A(e,t,n,r){return H(function(e,t){for(var n,r,i,o=[],a=0;a<e.length&&!((t-=2)<0);++a)n=e.charCodeAt(a),r=n>>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function F(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function C(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var o,a,s,u,l=e[i],c=null,p=l>239?4:l>223?3:l>191?2:1;if(i+p<=n)switch(p){case 1:l<128&&(c=l);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&l)<<6|63&o)>127&&(c=u);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(u=(15&l)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(c=u)}null===c?(c=65533,p=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),i+=p}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=4096));return n}(r)}t.Buffer=u,t.SlowBuffer=function(e){+e!=e&&(e=0);return u.alloc(+e)},t.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=a(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,n){return l(null,e,t,n)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,n){return function(e,t,n,r){return c(t),t<=0?s(e,t):void 0!==n?"string"==typeof r?s(e,t).fill(n,r):s(e,t).fill(n):s(e,t)}(null,e,t,n)},u.allocUnsafe=function(e){return p(null,e)},u.allocUnsafeSlow=function(e){return p(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,o=Math.min(n,r);i<o;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!o(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=u.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var a=e[n];if(!u.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,i),i+=a.length}return r},u.byteLength=f,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)m(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},u.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?C(this,0,e):g.apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),"<Buffer "+e+">"},u.prototype.compare=function(e,t,n,r,i){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(o,a),l=this.slice(r,i),c=e.slice(t,n),p=0;p<s;++p)if(l[p]!==c[p]){o=l[p],a=c[p];break}return o<a?-1:a<o?1:0},u.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},u.prototype.indexOf=function(e,t,n){return v(this,e,t,n,!0)},u.prototype.lastIndexOf=function(e,t,n){return v(this,e,t,n,!1)},u.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return b(this,e,t,n);case"utf8":case"utf-8":return w(this,e,t,n);case"ascii":return x(this,e,t,n);case"latin1":case"binary":return S(this,e,t,n);case"base64":return E(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function $(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function D(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function T(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=t;o<n;++o)i+=B(e[o]);return i}function I(e,t,n){for(var r=e.slice(t,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function R(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function P(e,t,n,r,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function O(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i<o;++i)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function k(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i<o;++i)e[n+i]=t>>>8*(r?i:3-i)&255}function _(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function j(e,t,n,r,o){return o||_(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function N(e,t,n,r,o){return o||_(e,0,n,8),i.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),u.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=u.prototype;else{var i=t-e;n=new u(i,void 0);for(var o=0;o<i;++o)n[o]=this[o+e]}return n},u.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r},u.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},u.prototype.readUInt8=function(e,t){return t||R(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||R(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||R(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||R(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){t||R(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||R(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||R(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||R(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||R(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||P(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o<n&&(i*=256);)this[t+o]=e/i&255;return t+n},u.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||P(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):O(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):O(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):k(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):k(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);P(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o<n&&(a*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);P(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):O(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):O(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):k(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):k(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,n){return j(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return j(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return N(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return N(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i,o=r-n;if(this===e&&n<t&&t<r)for(i=o-1;i>=0;--i)e[i+t]=this[i+n];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+o),t);return o},u.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!u.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var o;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o<n;++o)this[o]=e;else{var a=u.isBuffer(e)?e:U(new u(e,r).toString()),s=a.length;for(o=0;o<n-t;++o)this[o+t]=a[o%s]}return this};var L=/[^+\/0-9A-Za-z-_]/g;function B(e){return e<16?"0"+e.toString(16):e.toString(16)}function U(e,t){var n;t=t||1/0;for(var r=e.length,i=null,o=[],a=0;a<r;++a){if((n=e.charCodeAt(a))>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function M(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(L,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function H(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}}).call(this,n(11))},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t){!function(e,t,n){"use strict";t.module("ngAnimate",["ng"]).directive("ngAnimateChildren",(function(){return function(e,n,r){r=r.ngAnimateChildren,t.isString(r)&&0===r.length?n.data("$$ngAnimateChildren",!0):e.$watch(r,(function(e){n.data("$$ngAnimateChildren",!!e)}))}})).factory("$$animateReflow",["$$rAF","$document",function(e,t){return function(t){return e((function(){t()}))}}]).config(["$provide","$animateProvider",function(r,i){function o(e){for(var t=0;t<e.length;t++){var n=e[t];if(1==n.nodeType)return n}}function a(e,t){return o(e)==o(t)}var s,u=t.noop,l=t.forEach,c=i.$$selectors,p=t.isArray,h=t.isString,d=t.isObject,f={running:!0};r.decorator("$animate",["$delegate","$$q","$injector","$sniffer","$rootElement","$$asyncCallback","$rootScope","$document","$templateRequest","$$jqLite",function(e,n,r,g,m,v,y,b,w,x){function S(e,t){var n=e.data("$$ngAnimateState")||{};return t&&(n.running=!0,n.structural=!0,e.data("$$ngAnimateState",n)),n.disabled||n.running&&n.structural}function E(e){var t,r=n.defer();return r.promise.$$cancelFn=function(){t&&t()},y.$$postDigest((function(){t=e((function(){r.resolve()}))})),r.promise}function A(e){if(d(e))return e.tempClasses&&h(e.tempClasses)&&(e.tempClasses=e.tempClasses.split(/\s+/)),e}function F(e,n,i,o){function a(e,t){var n=e[t],r=e["before"+t.charAt(0).toUpperCase()+t.substr(1)];if(n||r)return"leave"==t&&(r=n,n=null),A.push({event:t,fn:n}),x.push({event:t,fn:r}),!0}function s(t,n,r){var a=[];l(t,(function(e){e.fn&&a.push(e)}));var s=0;l(a,(function(t,l){var c=function(){e:{if(n){if((n[l]||u)(),++s<a.length)break e;n=null}r()}};switch(t.event){case"setClass":n.push(t.fn(e,d,f,c,o));break;case"animate":n.push(t.fn(e,i,o.from,o.to,c));break;case"addClass":n.push(t.fn(e,d||i,c,o));break;case"removeClass":n.push(t.fn(e,f||i,c,o));break;default:n.push(t.fn(e,c,o))}})),n&&0===n.length&&r()}var h=e[0];if(h){var d,f;o&&(o.to=o.to||{},o.from=o.from||{}),p(i)&&(d=i[0],f=i[1],d?f?i=d+" "+f:(i=d,n="addClass"):(i=f,n="removeClass"));var m="setClass"==n,v=m||"addClass"==n||"removeClass"==n||"animate"==n,y=e.attr("class")+" "+i;if(P(y)){var b=u,w=[],x=[],S=u,E=[],A=[];y=(" "+y).replace(/\s+/g,".");return l(function(e){if(e){var t=[],n={};e=e.substr(1).split("."),(g.transitions||g.animations)&&t.push(r.get(c[""]));for(var i=0;i<e.length;i++){var o=e[i],a=c[o];a&&!n[o]&&(t.push(r.get(a)),n[o]=!0)}return t}}(y),(function(e){!a(e,n)&&m&&(a(e,"addClass"),a(e,"removeClass"))})),{node:h,event:n,className:i,isClassBased:v,isSetClassOperation:m,applyStyles:function(){o&&e.css(t.extend(o.from||{},o.to||{}))},before:function(e){b=e,s(x,w,(function(){b=u,e()}))},after:function(e){S=e,s(A,E,(function(){S=u,e()}))},cancel:function(){w&&(l(w,(function(e){(e||u)(!0)})),b(!0)),E&&(l(E,(function(e){(e||u)(!0)})),S(!0))}}}}}function C(e,n,r,i,o,c,p,h){function d(t){var i="$animate:"+t;S&&S[i]&&0<S[i].length&&v((function(){r.triggerHandler(i,{event:e,className:n})}))}function g(){d("before")}function y(){d("after")}function b(){b.hasBeenRun||(b.hasBeenRun=!0,c())}function w(){if(!w.hasBeenRun){x&&x.applyStyles(),w.hasBeenRun=!0,p&&p.tempClasses&&l(p.tempClasses,(function(e){s.removeClass(r,e)}));var e=r.data("$$ngAnimateState");e&&(x&&x.isClassBased?D(r,n):(v((function(){var e=r.data("$$ngAnimateState")||{};T==e.index&&D(r,n)})),r.data("$$ngAnimateState",e))),d("close"),h()}}var x=F(r,e,n,p);if(!x)return b(),g(),y(),w(),u;e=x.event,n=x.className;var S=(S=t.element._data(x.node))&&S.events;if(i||(i=o?o.parent():r.parent()),function(e,n){if(f.disabled)return!0;if(a(e,m))return f.running;var r,i,o;do{if(0===n.length)break;var s=a(n,m),u=s?f:n.data("$$ngAnimateState")||{};if(u.disabled)return!0;s&&(o=!0),!1!==r&&(s=n.data("$$ngAnimateChildren"),t.isDefined(s)&&(r=s)),i=i||u.running||u.last&&!u.last.isClassBased}while(n=n.parent());return!o||!r&&i}(r,i))return b(),g(),y(),w(),u;var E=(i=r.data("$$ngAnimateState")||{}).active||{},A=i.totalActive||0,C=i.last;if(o=!1,0<A){if(A=[],x.isClassBased)"setClass"==C.event?(A.push(C),D(r,n)):E[n]&&(($=E[n]).event==e?o=!0:(A.push($),D(r,n)));else if("leave"==e&&E["ng-leave"])o=!0;else{for(var $ in E)A.push(E[$]);i={},D(r,!0)}0<A.length&&l(A,(function(e){e.cancel()}))}if(!x.isClassBased||x.isSetClassOperation||"animate"==e||o||(o="addClass"==e==r.hasClass(n)),o)return b(),g(),y(),d("close"),h(),u;E=i.active||{},A=i.totalActive||0,"leave"==e&&r.one("$destroy",(function(e){var n=(e=t.element(this)).data("$$ngAnimateState");n&&(n=n.active["ng-leave"])&&(n.cancel(),D(e,"ng-leave"))})),s.addClass(r,"ng-animate"),p&&p.tempClasses&&l(p.tempClasses,(function(e){s.addClass(r,e)}));var T=I++;return A++,E[n]=x,r.data("$$ngAnimateState",{last:x,active:E,index:T,totalActive:A}),g(),x.before((function(t){var i=r.data("$$ngAnimateState");t=t||!i||!i.active[n]||x.isClassBased&&i.active[n].event!=e,b(),!0===t?w():(y(),x.after(w))})),x.cancel}function $(e){(e=o(e))&&(e=t.isFunction(e.getElementsByClassName)?e.getElementsByClassName("ng-animate"):e.querySelectorAll(".ng-animate"),l(e,(function(e){(e=(e=t.element(e)).data("$$ngAnimateState"))&&e.active&&l(e.active,(function(e){e.cancel()}))})))}function D(e,t){if(a(e,m))f.disabled||(f.running=!1,f.structural=!1);else if(t){var n=e.data("$$ngAnimateState")||{},r=!0===t;!r&&n.active&&n.active[t]&&(n.totalActive--,delete n.active[t]),!r&&n.totalActive||(s.removeClass(e,"ng-animate"),e.removeData("$$ngAnimateState"))}}s=x,m.data("$$ngAnimateState",f);var T=y.$watch((function(){return w.totalPendingRequests}),(function(e,t){0===e&&(T(),y.$$postDigest((function(){y.$$postDigest((function(){f.running=!1}))})))})),I=0,R=i.classNameFilter(),P=R?function(e){return R.test(e)}:function(){return!0};return{animate:function(e,n,r,i,a){return i=i||"ng-inline-animate",(a=A(a)||{}).from=r?n:null,a.to=r||n,E((function(n){return C("animate",i,t.element(o(e)),null,null,u,a,n)}))},enter:function(n,r,i,a){return a=A(a),n=t.element(n),r=r&&t.element(r),i=i&&t.element(i),S(n,!0),e.enter(n,r,i),E((function(e){return C("enter","ng-enter",t.element(o(n)),r,i,u,a,e)}))},leave:function(n,r){return r=A(r),$(n=t.element(n)),S(n,!0),E((function(i){return C("leave","ng-leave",t.element(o(n)),null,null,(function(){e.leave(n)}),r,i)}))},move:function(n,r,i,a){return a=A(a),n=t.element(n),r=r&&t.element(r),i=i&&t.element(i),$(n),S(n,!0),e.move(n,r,i),E((function(e){return C("move","ng-move",t.element(o(n)),r,i,u,a,e)}))},addClass:function(e,t,n){return this.setClass(e,t,[],n)},removeClass:function(e,t,n){return this.setClass(e,[],t,n)},setClass:function(n,r,i,a){if(a=A(a),n=t.element(n),S(n=t.element(o(n))))return e.$$setClassImmediately(n,r,i,a);var s,u=n.data("$$animateClasses"),c=!!u;return u||(u={classes:{}}),s=u.classes,r=p(r)?r:r.split(" "),l(r,(function(e){e&&e.length&&(s[e]=!0)})),i=p(i)?i:i.split(" "),l(i,(function(e){e&&e.length&&(s[e]=!1)})),c?(a&&u.options&&(u.options=t.extend(u.options||{},a)),u.promise):(n.data("$$animateClasses",u={classes:s,options:a}),u.promise=E((function(t){var r=n.parent(),i=o(n);if((a=i.parentNode)&&!a.$$NG_REMOVED&&!i.$$NG_REMOVED){i=n.data("$$animateClasses"),n.removeData("$$animateClasses");var a=n.data("$$ngAnimateState")||{},s=function(e,t,n){var r={};l(n=n||{},(function(e,t){l(t.split(" "),(function(t){r[t]=e}))}));var i=Object.create(null);l((e.attr("class")||"").split(/\s+/),(function(e){i[e]=!0}));var o=[],a=[];return l(t&&t.classes||[],(function(e,t){var n=i[t],s=r[t]||{};!1===e?(n||"addClass"==s.event)&&a.push(t):!0===e&&(n&&"removeClass"!=s.event||o.push(t))})),0<o.length+a.length&&[o.join(" "),a.join(" ")]}(n,i,a.active);return s?C("setClass",s,n,r,null,(function(){s[0]&&e.$$addClassImmediately(n,s[0]),s[1]&&e.$$removeClassImmediately(n,s[1])}),i.options,t):t()}t()})))},cancel:function(e){e.$$cancelFn()},enabled:function(e,t){switch(arguments.length){case 2:if(e)D(t);else{var n=t.data("$$ngAnimateState")||{};n.disabled=!0,t.data("$$ngAnimateState",n)}break;case 1:f.disabled=!e;break;default:e=!f.disabled}return!!e}}}]),i.register("",["$window","$sniffer","$timeout","$$animateReflow",function(r,i,a,c){function d(){I||(I=c((function(){O=[],I=null,R={}})))}function f(e,t){I&&I(),O.push(t),I=c((function(){l(O,(function(e){e()})),O=[],I=null,R={}}))}function g(e,n){var r=o(e);e=t.element(r),j.push(e),(r=Date.now()+n)<=_||(a.cancel(k),_=r,k=a((function(){!function(e){l(e,(function(e){(e=e.data("$$ngAnimateCSS3Data"))&&l(e.closeAnimationFns,(function(e){e()}))}))}(j),j=[]}),n,!1))}function m(e,t){var n=t?R[t]:null;if(!n){var i=0,o=0,a=0,s=0;l(e,(function(e){if(1==e.nodeType){e=r.getComputedStyle(e)||{},i=Math.max(v(e[F+"Duration"]),i),o=Math.max(v(e[F+"Delay"]),o),s=Math.max(v(e[$+"Delay"]),s);var t=v(e[$+"Duration"]);0<t&&(t*=parseInt(e[$+"IterationCount"],10)||1),a=Math.max(t,a)}})),n={total:0,transitionDelay:o,transitionDuration:i,animationDelay:s,animationDuration:a},t&&(R[t]=n)}return n}function v(e){var t=0;return e=h(e)?e.split(/\s*,\s*/):[],l(e,(function(e){t=Math.max(parseFloat(e)||0,t)})),t}function y(e,t,n,r){var i;e=0<=["ng-enter","ng-leave","ng-move"].indexOf(n),(u=(a=t.parent()).data("$$ngAnimateKey"))||(a.data("$$ngAnimateKey",++P),u=P),i=u+"-"+o(t).getAttribute("class");var a,u,l={};0<(u=R[a=i+" "+n]?++R[a].total:0)&&((i=!R[l=i+" "+(c=n+"-stagger")])&&s.addClass(t,c),l=m(t,l),i&&s.removeClass(t,c));s.addClass(t,n);var c=t.data("$$ngAnimateCSS3Data")||{},p=m(t,a);return i=p.transitionDuration,p=p.animationDuration,e&&0===i&&0===p?(s.removeClass(t,n),!1):(n=r||e&&0<i,e=0<p&&0<l.animationDelay&&0===l.animationDuration,t.data("$$ngAnimateCSS3Data",{stagger:l,cacheKey:a,running:c.running||0,itemIndex:u,blockTransition:n,closeAnimationFns:c.closeAnimationFns||[]}),a=o(t),n&&(b(a,!0),r&&t.css(r)),e&&(a.style[$+"PlayState"]="paused"),!0)}function b(e,t){e.style[F+"Property"]=t?"none":""}function w(e,t,n,r){if(y(e,t,n,r))return function(e){e&&E(t,n)}}function x(e,t,n,r,i){if(t.data("$$ngAnimateCSS3Data"))return function(e,t,n,r,i){function u(){t.off(P,c),s.removeClass(t,h),s.removeClass(t,d),I&&a.cancel(I),E(t,n);var e,r=o(t);for(e in f)r.style.removeProperty(f[e])}function c(e){e.stopPropagation();var t=e.originalEvent||e;e=t.$manualTimeStamp||t.timeStamp||Date.now(),t=parseFloat(t.elapsedTime.toFixed(3)),Math.max(e-R,0)>=F&&t>=A&&r()}var p=o(t);if(e=t.data("$$ngAnimateCSS3Data"),-1!=p.getAttribute("class").indexOf(n)&&e){var h="",d="";l(n.split(" "),(function(e,t){var n=(0<t?" ":"")+e;h+=n+"-active",d+=n+"-pending"}));var f=[],v=e.itemIndex,y=e.stagger,w=0;if(0<v){w=0,0<y.transitionDelay&&0===y.transitionDuration&&(w=y.transitionDelay*v);var x=0;0<y.animationDelay&&0===y.animationDuration&&(x=y.animationDelay*v,f.push(T+"animation-play-state")),w=Math.round(100*Math.max(w,x))/100}w||(s.addClass(t,h),e.blockTransition&&b(p,!1));var S=m(t,e.cacheKey+" "+h),A=Math.max(S.transitionDuration,S.animationDuration);if(0!==A){!w&&i&&(S.transitionDuration||(t.css("transition",S.animationDuration+"s linear all"),f.push("transition")),t.css(i));var F=1e3*(v=Math.max(S.transitionDelay,S.animationDelay));0<f.length&&(";"!==(y=p.getAttribute("style")||"").charAt(y.length-1)&&(y+=";"),p.setAttribute("style",y+" "));var I,R=Date.now(),P=D+" "+C;v=1e3*(w+1.5*(v+A));return 0<w&&(s.addClass(t,d),I=a((function(){I=null,0<S.transitionDuration&&b(p,!1),0<S.animationDuration&&(p.style[$+"PlayState"]=""),s.addClass(t,h),s.removeClass(t,d),i&&(0===S.transitionDuration&&t.css("transition",S.animationDuration+"s linear all"),t.css(i),f.push("transition"))}),1e3*w,!1)),t.on(P,c),e.closeAnimationFns.push((function(){u(),r()})),e.running++,g(t,v),u}s.removeClass(t,h),E(t,n),r()}else r()}(e,t,n,r,i);E(t,n),r()}function S(e,t,n,r,i){var o=w(e,t,n,i.from);if(o){var a=o;return f(0,(function(){a=x(e,t,n,r,i.to)})),function(e){(a||u)(e)}}d(),r()}function E(e,t){s.removeClass(e,t);var n=e.data("$$ngAnimateCSS3Data");n&&(n.running&&n.running--,n.running&&0!==n.running||e.removeData("$$ngAnimateCSS3Data"))}function A(e,t){var n="";return e=p(e)?e:e.split(/\s+/),l(e,(function(e,r){e&&0<e.length&&(n+=(0<r?" ":"")+e+t)})),n}var F,C,$,D,T="";e.ontransitionend===n&&e.onwebkittransitionend!==n?(T="-webkit-",F="WebkitTransition",C="webkitTransitionEnd transitionend"):(F="transition",C="transitionend"),e.onanimationend===n&&e.onwebkitanimationend!==n?(T="-webkit-",$="WebkitAnimation",D="webkitAnimationEnd animationend"):($="animation",D="animationend");var I,R={},P=0,O=[],k=null,_=0,j=[];return{animate:function(e,t,n,r,i,o){return(o=o||{}).from=n,o.to=r,S("animate",e,t,i,o)},enter:function(e,t,n){return S("enter",e,"ng-enter",t,n=n||{})},leave:function(e,t,n){return S("leave",e,"ng-leave",t,n=n||{})},move:function(e,t,n){return S("move",e,"ng-move",t,n=n||{})},beforeSetClass:function(e,t,n,r,i){if(i=i||{},i=w("setClass",e,t=A(n,"-remove")+" "+A(t,"-add"),i.from))return f(0,r),i;d(),r()},beforeAddClass:function(e,t,n,r){if(r=r||{},t=w("addClass",e,A(t,"-add"),r.from))return f(0,n),t;d(),n()},beforeRemoveClass:function(e,t,n,r){if(r=r||{},t=w("removeClass",e,A(t,"-remove"),r.from))return f(0,n),t;d(),n()},setClass:function(e,t,n,r,i){return i=i||{},x("setClass",e,(n=A(n,"-remove"))+" "+(t=A(t,"-add")),r,i.to)},addClass:function(e,t,n,r){return r=r||{},x("addClass",e,A(t,"-add"),n,r.to)},removeClass:function(e,t,n,r){return r=r||{},x("removeClass",e,A(t,"-remove"),n,r.to)}}}])}])}(window,window.angular)},function(e,t){!function(e,t,n){"use strict";t.module("ngCookies",["ng"]).factory("$cookies",["$rootScope","$browser",function(e,n){var r,i={},o={},a=!1,s=t.copy,u=t.isUndefined;return n.addPollFn((function(){var t=n.cookies();r!=t&&(r=t,s(t,o),s(t,i),a&&e.$apply())}))(),a=!0,e.$watch((function(){var e,r,a;for(e in o)u(i[e])&&n.cookies(e,void 0);for(e in i)r=i[e],t.isString(r)||(r=""+r,i[e]=r),r!==o[e]&&(n.cookies(e,r),a=!0);if(a)for(e in r=n.cookies(),i)i[e]!==r[e]&&(u(r[e])?delete i[e]:i[e]=r[e])})),i}]).factory("$cookieStore",["$cookies",function(e){return{get:function(n){return(n=e[n])?t.fromJson(n):n},put:function(n,r){e[n]=t.toJson(r)},remove:function(t){delete e[t]}}}])}(window,window.angular)},function(e,t){!function(e,t,n){"use strict";function r(e,n,r){return{restrict:"ECA",terminal:!0,priority:400,transclude:"element",link:function(i,o,a,s,u){function l(){d&&(r.cancel(d),d=null),p&&(p.$destroy(),p=null),h&&((d=r.leave(h)).then((function(){d=null})),h=null)}function c(){var a=e.current&&e.current.locals;if(t.isDefined(a&&a.$template)){a=i.$new();var s=e.current;h=u(a,(function(e){r.enter(e,null,h||o).then((function(){!t.isDefined(f)||f&&!i.$eval(f)||n()})),l()})),(p=s.scope=a).$emit("$viewContentLoaded"),p.$eval(g)}else l()}var p,h,d,f=a.autoscroll,g=a.onload||"";i.$on("$routeChangeSuccess",c),c()}}}function i(e,t,n){return{restrict:"ECA",priority:-400,link:function(r,i){var o=n.current,a=o.locals;i.html(a.$template);var s=e(i.contents());o.controller&&(a.$scope=r,a=t(o.controller,a),o.controllerAs&&(r[o.controllerAs]=a),i.data("$ngControllerController",a),i.children().data("$ngControllerController",a)),s(r)}}}e=t.module("ngRoute",["ng"]).provider("$route",(function(){function e(e,n){return t.extend(Object.create(e),n)}function n(e,t){var n=t.caseInsensitiveMatch,r={originalPath:e,regexp:e},i=r.keys=[];return e=e.replace(/([().])/g,"\\$1").replace(/(\/)?:(\w+)([\?\*])?/g,(function(e,t,n,r){return e="?"===r?r:null,r="*"===r?r:null,i.push({name:n,optional:!!e}),t=t||"",(e?"":t)+"(?:"+(e?t:"")+(r?"(.+?)":"([^/]+)")+(e||"")+")"+(e||"")})).replace(/([\/$\*])/g,"\\$1"),r.regexp=new RegExp("^"+e+"$",n?"i":""),r}var r={};this.when=function(e,i){var o=t.copy(i);if(t.isUndefined(o.reloadOnSearch)&&(o.reloadOnSearch=!0),t.isUndefined(o.caseInsensitiveMatch)&&(o.caseInsensitiveMatch=this.caseInsensitiveMatch),r[e]=t.extend(o,e&&n(e,o)),e){var a="/"==e[e.length-1]?e.substr(0,e.length-1):e+"/";r[a]=t.extend({redirectTo:e},n(a,o))}return this},this.caseInsensitiveMatch=!1,this.otherwise=function(e){return"string"==typeof e&&(e={redirectTo:e}),this.when(null,e),this},this.$get=["$rootScope","$location","$routeParams","$q","$injector","$templateRequest","$sce",function(n,i,a,s,u,l,c){function p(o){var a=v.current;(g=(f=function(){var n,o;return t.forEach(r,(function(r,a){var s;if(s=!o){var u=i.path();s=r.keys;var l={};if(r.regexp)if(u=r.regexp.exec(u)){for(var c=1,p=u.length;c<p;++c){var h=s[c-1],d=u[c];h&&d&&(l[h.name]=d)}s=l}else s=null;else s=null;s=n=s}s&&((o=e(r,{params:t.extend({},i.search(),n),pathParams:n})).$$route=r)})),o||r.null&&e(r.null,{params:{},pathParams:{}})}())&&a&&f.$$route===a.$$route&&t.equals(f.pathParams,a.pathParams)&&!f.reloadOnSearch&&!m)||!a&&!f||n.$broadcast("$routeChangeStart",f,a).defaultPrevented&&o&&o.preventDefault()}function h(){var e=v.current,r=f;g?(e.params=r.params,t.copy(e.params,a),n.$broadcast("$routeUpdate",e)):(r||e)&&(m=!1,(v.current=r)&&r.redirectTo&&(t.isString(r.redirectTo)?i.path(d(r.redirectTo,r.params)).search(r.params).replace():i.url(r.redirectTo(r.pathParams,i.path(),i.search())).replace()),s.when(r).then((function(){if(r){var e,n,i=t.extend({},r.resolve);return t.forEach(i,(function(e,n){i[n]=t.isString(e)?u.get(e):u.invoke(e,null,null,n)})),t.isDefined(e=r.template)?t.isFunction(e)&&(e=e(r.params)):t.isDefined(n=r.templateUrl)&&(t.isFunction(n)&&(n=n(r.params)),n=c.getTrustedResourceUrl(n),t.isDefined(n)&&(r.loadedTemplateUrl=n,e=l(n))),t.isDefined(e)&&(i.$template=e),s.all(i)}})).then((function(i){r==v.current&&(r&&(r.locals=i,t.copy(r.params,a)),n.$broadcast("$routeChangeSuccess",r,e))}),(function(t){r==v.current&&n.$broadcast("$routeChangeError",r,e,t)})))}function d(e,n){var r=[];return t.forEach((e||"").split(":"),(function(e,t){if(0===t)r.push(e);else{var i=e.match(/(\w+)(?:[?*])?(.*)/),o=i[1];r.push(n[o]),r.push(i[2]||""),delete n[o]}})),r.join("")}var f,g,m=!1,v={routes:r,reload:function(){m=!0,n.$evalAsync((function(){p(),h()}))},updateParams:function(e){if(!this.current||!this.current.$$route)throw o("norout");var n={},r=this;t.forEach(Object.keys(e),(function(t){r.current.pathParams[t]||(n[t]=e[t])})),e=t.extend({},this.current.params,e),i.path(d(this.current.$$route.originalPath,e)),i.search(t.extend({},i.search(),n))}};return n.$on("$locationChangeStart",p),n.$on("$locationChangeSuccess",h),v}]}));var o=t.$$minErr("ngRoute");e.provider("$routeParams",(function(){this.$get=function(){return{}}})),e.directive("ngView",r),e.directive("ngView",i),r.$inject=["$route","$anchorScroll","$animate"],i.$inject=["$compile","$controller","$route"]}(window,window.angular)},function(e,t){
62
+ var r=n(246),i=n(247),o=n(248);function a(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(e,t){if(a()<t)throw new RangeError("Invalid typed array length");return u.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=u.prototype:(null===e&&(e=new u(t)),e.length=t),e}function u(e,t,n){if(!(u.TYPED_ARRAY_SUPPORT||this instanceof u))return new u(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return p(this,e)}return l(this,e,t,n)}function l(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);u.TYPED_ARRAY_SUPPORT?(e=t).__proto__=u.prototype:e=h(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!u.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|f(t,n),i=(e=s(e,r)).write(t,n);i!==r&&(e=e.slice(0,i));return e}(e,t,n):function(e,t){if(u.isBuffer(t)){var n=0|d(t.length);return 0===(e=s(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?s(e,0):h(e,t);if("Buffer"===t.type&&o(t.data))return h(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function p(e,t){if(c(t),e=s(e,t<0?0:0|d(t)),!u.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function h(e,t){var n=t.length<0?0:0|d(t.length);e=s(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function d(e){if(e>=a())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a().toString(16)+" bytes");return 0|e}function f(e,t){if(u.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return U(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return M(e).length;default:if(r)return U(e).length;t=(""+t).toLowerCase(),r=!0}}function g(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return T(this,t,n);case"utf8":case"utf-8":return C(this,t,n);case"ascii":return $(this,t,n);case"latin1":case"binary":return D(this,t,n);case"base64":return F(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function m(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function v(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:y(e,t,n,r,i);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):y(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function y(e,t,n,r,i){var o,a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var c=-1;for(o=n;o<s;o++)if(l(e,o)===l(t,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===u)return c*a}else-1!==c&&(o-=o-c),c=-1}else for(n+u>s&&(n=s-u),o=n;o>=0;o--){for(var p=!0,h=0;h<u;h++)if(l(e,o+h)!==l(t,h)){p=!1;break}if(p)return o}return-1}function b(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a<r;++a){var s=parseInt(t.substr(2*a,2),16);if(isNaN(s))return a;e[n+a]=s}return a}function w(e,t,n,r){return H(U(t,e.length-n),e,n,r)}function x(e,t,n,r){return H(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function S(e,t,n,r){return x(e,t,n,r)}function E(e,t,n,r){return H(M(t),e,n,r)}function A(e,t,n,r){return H(function(e,t){for(var n,r,i,o=[],a=0;a<e.length&&!((t-=2)<0);++a)n=e.charCodeAt(a),r=n>>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function F(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function C(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var o,a,s,u,l=e[i],c=null,p=l>239?4:l>223?3:l>191?2:1;if(i+p<=n)switch(p){case 1:l<128&&(c=l);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&l)<<6|63&o)>127&&(c=u);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(u=(15&l)<<12|(63&o)<<6|63&a)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(u=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&u<1114112&&(c=u)}null===c?(c=65533,p=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),i+=p}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=4096));return n}(r)}t.Buffer=u,t.SlowBuffer=function(e){+e!=e&&(e=0);return u.alloc(+e)},t.INSPECT_MAX_BYTES=50,u.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=a(),u.poolSize=8192,u._augment=function(e){return e.__proto__=u.prototype,e},u.from=function(e,t,n){return l(null,e,t,n)},u.TYPED_ARRAY_SUPPORT&&(u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0})),u.alloc=function(e,t,n){return function(e,t,n,r){return c(t),t<=0?s(e,t):void 0!==n?"string"==typeof r?s(e,t).fill(n,r):s(e,t).fill(n):s(e,t)}(null,e,t,n)},u.allocUnsafe=function(e){return p(null,e)},u.allocUnsafeSlow=function(e){return p(null,e)},u.isBuffer=function(e){return!(null==e||!e._isBuffer)},u.compare=function(e,t){if(!u.isBuffer(e)||!u.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,o=Math.min(n,r);i<o;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){if(!o(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=u.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var a=e[n];if(!u.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,i),i+=a.length}return r},u.byteLength=f,u.prototype._isBuffer=!0,u.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)m(this,t,t+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},u.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?C(this,0,e):g.apply(this,arguments)},u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){var e="",n=t.INSPECT_MAX_BYTES;return this.length>0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),"<Buffer "+e+">"},u.prototype.compare=function(e,t,n,r,i){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(r>>>=0),a=(n>>>=0)-(t>>>=0),s=Math.min(o,a),l=this.slice(r,i),c=e.slice(t,n),p=0;p<s;++p)if(l[p]!==c[p]){o=l[p],a=c[p];break}return o<a?-1:a<o?1:0},u.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},u.prototype.indexOf=function(e,t,n){return v(this,e,t,n,!0)},u.prototype.lastIndexOf=function(e,t,n){return v(this,e,t,n,!1)},u.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return b(this,e,t,n);case"utf8":case"utf-8":return w(this,e,t,n);case"ascii":return x(this,e,t,n);case"latin1":case"binary":return S(this,e,t,n);case"base64":return E(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function $(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function D(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function T(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=t;o<n;++o)i+=B(e[o]);return i}function I(e,t,n){for(var r=e.slice(t,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function R(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function P(e,t,n,r,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function O(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i<o;++i)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function k(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i<o;++i)e[n+i]=t>>>8*(r?i:3-i)&255}function _(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function j(e,t,n,r,o){return o||_(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function N(e,t,n,r,o){return o||_(e,0,n,8),i.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),u.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=u.prototype;else{var i=t-e;n=new u(i,void 0);for(var o=0;o<i;++o)n[o]=this[o+e]}return n},u.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r},u.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},u.prototype.readUInt8=function(e,t){return t||R(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||R(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||R(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=this[e],i=1,o=0;++o<t&&(i*=256);)r+=this[e+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||R(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){t||R(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||R(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||R(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||R(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||R(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||P(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[t]=255&e;++o<n&&(i*=256);)this[t+o]=e/i&255;return t+n},u.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||P(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):O(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):O(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):k(this,e,t,!0),t+4},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):k(this,e,t,!1),t+4},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);P(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o<n&&(a*=256);)e<0&&0===s&&0!==this[t+o-1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);P(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):O(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):O(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):k(this,e,t,!0),t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||P(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):k(this,e,t,!1),t+4},u.prototype.writeFloatLE=function(e,t,n){return j(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return j(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return N(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return N(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i,o=r-n;if(this===e&&n<t&&t<r)for(i=o-1;i>=0;--i)e[i+t]=this[i+n];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+o),t);return o},u.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!u.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var o;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(o=t;o<n;++o)this[o]=e;else{var a=u.isBuffer(e)?e:U(new u(e,r).toString()),s=a.length;for(o=0;o<n-t;++o)this[o+t]=a[o%s]}return this};var L=/[^+\/0-9A-Za-z-_]/g;function B(e){return e<16?"0"+e.toString(16):e.toString(16)}function U(e,t){var n;t=t||1/0;for(var r=e.length,i=null,o=[],a=0;a<r;++a){if((n=e.charCodeAt(a))>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function M(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(L,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function H(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}}).call(this,n(11))},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t){!function(e,t,n){"use strict";t.module("ngAnimate",["ng"]).directive("ngAnimateChildren",(function(){return function(e,n,r){r=r.ngAnimateChildren,t.isString(r)&&0===r.length?n.data("$$ngAnimateChildren",!0):e.$watch(r,(function(e){n.data("$$ngAnimateChildren",!!e)}))}})).factory("$$animateReflow",["$$rAF","$document",function(e,t){return function(t){return e((function(){t()}))}}]).config(["$provide","$animateProvider",function(r,i){function o(e){for(var t=0;t<e.length;t++){var n=e[t];if(1==n.nodeType)return n}}function a(e,t){return o(e)==o(t)}var s,u=t.noop,l=t.forEach,c=i.$$selectors,p=t.isArray,h=t.isString,d=t.isObject,f={running:!0};r.decorator("$animate",["$delegate","$$q","$injector","$sniffer","$rootElement","$$asyncCallback","$rootScope","$document","$templateRequest","$$jqLite",function(e,n,r,g,m,v,y,b,w,x){function S(e,t){var n=e.data("$$ngAnimateState")||{};return t&&(n.running=!0,n.structural=!0,e.data("$$ngAnimateState",n)),n.disabled||n.running&&n.structural}function E(e){var t,r=n.defer();return r.promise.$$cancelFn=function(){t&&t()},y.$$postDigest((function(){t=e((function(){r.resolve()}))})),r.promise}function A(e){if(d(e))return e.tempClasses&&h(e.tempClasses)&&(e.tempClasses=e.tempClasses.split(/\s+/)),e}function F(e,n,i,o){function a(e,t){var n=e[t],r=e["before"+t.charAt(0).toUpperCase()+t.substr(1)];if(n||r)return"leave"==t&&(r=n,n=null),A.push({event:t,fn:n}),x.push({event:t,fn:r}),!0}function s(t,n,r){var a=[];l(t,(function(e){e.fn&&a.push(e)}));var s=0;l(a,(function(t,l){var c=function(){e:{if(n){if((n[l]||u)(),++s<a.length)break e;n=null}r()}};switch(t.event){case"setClass":n.push(t.fn(e,d,f,c,o));break;case"animate":n.push(t.fn(e,i,o.from,o.to,c));break;case"addClass":n.push(t.fn(e,d||i,c,o));break;case"removeClass":n.push(t.fn(e,f||i,c,o));break;default:n.push(t.fn(e,c,o))}})),n&&0===n.length&&r()}var h=e[0];if(h){var d,f;o&&(o.to=o.to||{},o.from=o.from||{}),p(i)&&(d=i[0],f=i[1],d?f?i=d+" "+f:(i=d,n="addClass"):(i=f,n="removeClass"));var m="setClass"==n,v=m||"addClass"==n||"removeClass"==n||"animate"==n,y=e.attr("class")+" "+i;if(P(y)){var b=u,w=[],x=[],S=u,E=[],A=[];y=(" "+y).replace(/\s+/g,".");return l(function(e){if(e){var t=[],n={};e=e.substr(1).split("."),(g.transitions||g.animations)&&t.push(r.get(c[""]));for(var i=0;i<e.length;i++){var o=e[i],a=c[o];a&&!n[o]&&(t.push(r.get(a)),n[o]=!0)}return t}}(y),(function(e){!a(e,n)&&m&&(a(e,"addClass"),a(e,"removeClass"))})),{node:h,event:n,className:i,isClassBased:v,isSetClassOperation:m,applyStyles:function(){o&&e.css(t.extend(o.from||{},o.to||{}))},before:function(e){b=e,s(x,w,(function(){b=u,e()}))},after:function(e){S=e,s(A,E,(function(){S=u,e()}))},cancel:function(){w&&(l(w,(function(e){(e||u)(!0)})),b(!0)),E&&(l(E,(function(e){(e||u)(!0)})),S(!0))}}}}}function C(e,n,r,i,o,c,p,h){function d(t){var i="$animate:"+t;S&&S[i]&&0<S[i].length&&v((function(){r.triggerHandler(i,{event:e,className:n})}))}function g(){d("before")}function y(){d("after")}function b(){b.hasBeenRun||(b.hasBeenRun=!0,c())}function w(){if(!w.hasBeenRun){x&&x.applyStyles(),w.hasBeenRun=!0,p&&p.tempClasses&&l(p.tempClasses,(function(e){s.removeClass(r,e)}));var e=r.data("$$ngAnimateState");e&&(x&&x.isClassBased?D(r,n):(v((function(){var e=r.data("$$ngAnimateState")||{};T==e.index&&D(r,n)})),r.data("$$ngAnimateState",e))),d("close"),h()}}var x=F(r,e,n,p);if(!x)return b(),g(),y(),w(),u;e=x.event,n=x.className;var S=(S=t.element._data(x.node))&&S.events;if(i||(i=o?o.parent():r.parent()),function(e,n){if(f.disabled)return!0;if(a(e,m))return f.running;var r,i,o;do{if(0===n.length)break;var s=a(n,m),u=s?f:n.data("$$ngAnimateState")||{};if(u.disabled)return!0;s&&(o=!0),!1!==r&&(s=n.data("$$ngAnimateChildren"),t.isDefined(s)&&(r=s)),i=i||u.running||u.last&&!u.last.isClassBased}while(n=n.parent());return!o||!r&&i}(r,i))return b(),g(),y(),w(),u;var E=(i=r.data("$$ngAnimateState")||{}).active||{},A=i.totalActive||0,C=i.last;if(o=!1,0<A){if(A=[],x.isClassBased)"setClass"==C.event?(A.push(C),D(r,n)):E[n]&&(($=E[n]).event==e?o=!0:(A.push($),D(r,n)));else if("leave"==e&&E["ng-leave"])o=!0;else{for(var $ in E)A.push(E[$]);i={},D(r,!0)}0<A.length&&l(A,(function(e){e.cancel()}))}if(!x.isClassBased||x.isSetClassOperation||"animate"==e||o||(o="addClass"==e==r.hasClass(n)),o)return b(),g(),y(),d("close"),h(),u;E=i.active||{},A=i.totalActive||0,"leave"==e&&r.one("$destroy",(function(e){var n=(e=t.element(this)).data("$$ngAnimateState");n&&(n=n.active["ng-leave"])&&(n.cancel(),D(e,"ng-leave"))})),s.addClass(r,"ng-animate"),p&&p.tempClasses&&l(p.tempClasses,(function(e){s.addClass(r,e)}));var T=I++;return A++,E[n]=x,r.data("$$ngAnimateState",{last:x,active:E,index:T,totalActive:A}),g(),x.before((function(t){var i=r.data("$$ngAnimateState");t=t||!i||!i.active[n]||x.isClassBased&&i.active[n].event!=e,b(),!0===t?w():(y(),x.after(w))})),x.cancel}function $(e){(e=o(e))&&(e=t.isFunction(e.getElementsByClassName)?e.getElementsByClassName("ng-animate"):e.querySelectorAll(".ng-animate"),l(e,(function(e){(e=(e=t.element(e)).data("$$ngAnimateState"))&&e.active&&l(e.active,(function(e){e.cancel()}))})))}function D(e,t){if(a(e,m))f.disabled||(f.running=!1,f.structural=!1);else if(t){var n=e.data("$$ngAnimateState")||{},r=!0===t;!r&&n.active&&n.active[t]&&(n.totalActive--,delete n.active[t]),!r&&n.totalActive||(s.removeClass(e,"ng-animate"),e.removeData("$$ngAnimateState"))}}s=x,m.data("$$ngAnimateState",f);var T=y.$watch((function(){return w.totalPendingRequests}),(function(e,t){0===e&&(T(),y.$$postDigest((function(){y.$$postDigest((function(){f.running=!1}))})))})),I=0,R=i.classNameFilter(),P=R?function(e){return R.test(e)}:function(){return!0};return{animate:function(e,n,r,i,a){return i=i||"ng-inline-animate",(a=A(a)||{}).from=r?n:null,a.to=r||n,E((function(n){return C("animate",i,t.element(o(e)),null,null,u,a,n)}))},enter:function(n,r,i,a){return a=A(a),n=t.element(n),r=r&&t.element(r),i=i&&t.element(i),S(n,!0),e.enter(n,r,i),E((function(e){return C("enter","ng-enter",t.element(o(n)),r,i,u,a,e)}))},leave:function(n,r){return r=A(r),$(n=t.element(n)),S(n,!0),E((function(i){return C("leave","ng-leave",t.element(o(n)),null,null,(function(){e.leave(n)}),r,i)}))},move:function(n,r,i,a){return a=A(a),n=t.element(n),r=r&&t.element(r),i=i&&t.element(i),$(n),S(n,!0),e.move(n,r,i),E((function(e){return C("move","ng-move",t.element(o(n)),r,i,u,a,e)}))},addClass:function(e,t,n){return this.setClass(e,t,[],n)},removeClass:function(e,t,n){return this.setClass(e,[],t,n)},setClass:function(n,r,i,a){if(a=A(a),n=t.element(n),S(n=t.element(o(n))))return e.$$setClassImmediately(n,r,i,a);var s,u=n.data("$$animateClasses"),c=!!u;return u||(u={classes:{}}),s=u.classes,r=p(r)?r:r.split(" "),l(r,(function(e){e&&e.length&&(s[e]=!0)})),i=p(i)?i:i.split(" "),l(i,(function(e){e&&e.length&&(s[e]=!1)})),c?(a&&u.options&&(u.options=t.extend(u.options||{},a)),u.promise):(n.data("$$animateClasses",u={classes:s,options:a}),u.promise=E((function(t){var r=n.parent(),i=o(n);if((a=i.parentNode)&&!a.$$NG_REMOVED&&!i.$$NG_REMOVED){i=n.data("$$animateClasses"),n.removeData("$$animateClasses");var a=n.data("$$ngAnimateState")||{},s=function(e,t,n){var r={};l(n=n||{},(function(e,t){l(t.split(" "),(function(t){r[t]=e}))}));var i=Object.create(null);l((e.attr("class")||"").split(/\s+/),(function(e){i[e]=!0}));var o=[],a=[];return l(t&&t.classes||[],(function(e,t){var n=i[t],s=r[t]||{};!1===e?(n||"addClass"==s.event)&&a.push(t):!0===e&&(n&&"removeClass"!=s.event||o.push(t))})),0<o.length+a.length&&[o.join(" "),a.join(" ")]}(n,i,a.active);return s?C("setClass",s,n,r,null,(function(){s[0]&&e.$$addClassImmediately(n,s[0]),s[1]&&e.$$removeClassImmediately(n,s[1])}),i.options,t):t()}t()})))},cancel:function(e){e.$$cancelFn()},enabled:function(e,t){switch(arguments.length){case 2:if(e)D(t);else{var n=t.data("$$ngAnimateState")||{};n.disabled=!0,t.data("$$ngAnimateState",n)}break;case 1:f.disabled=!e;break;default:e=!f.disabled}return!!e}}}]),i.register("",["$window","$sniffer","$timeout","$$animateReflow",function(r,i,a,c){function d(){I||(I=c((function(){O=[],I=null,R={}})))}function f(e,t){I&&I(),O.push(t),I=c((function(){l(O,(function(e){e()})),O=[],I=null,R={}}))}function g(e,n){var r=o(e);e=t.element(r),j.push(e),(r=Date.now()+n)<=_||(a.cancel(k),_=r,k=a((function(){!function(e){l(e,(function(e){(e=e.data("$$ngAnimateCSS3Data"))&&l(e.closeAnimationFns,(function(e){e()}))}))}(j),j=[]}),n,!1))}function m(e,t){var n=t?R[t]:null;if(!n){var i=0,o=0,a=0,s=0;l(e,(function(e){if(1==e.nodeType){e=r.getComputedStyle(e)||{},i=Math.max(v(e[F+"Duration"]),i),o=Math.max(v(e[F+"Delay"]),o),s=Math.max(v(e[$+"Delay"]),s);var t=v(e[$+"Duration"]);0<t&&(t*=parseInt(e[$+"IterationCount"],10)||1),a=Math.max(t,a)}})),n={total:0,transitionDelay:o,transitionDuration:i,animationDelay:s,animationDuration:a},t&&(R[t]=n)}return n}function v(e){var t=0;return e=h(e)?e.split(/\s*,\s*/):[],l(e,(function(e){t=Math.max(parseFloat(e)||0,t)})),t}function y(e,t,n,r){var i;e=0<=["ng-enter","ng-leave","ng-move"].indexOf(n),(u=(a=t.parent()).data("$$ngAnimateKey"))||(a.data("$$ngAnimateKey",++P),u=P),i=u+"-"+o(t).getAttribute("class");var a,u,l={};0<(u=R[a=i+" "+n]?++R[a].total:0)&&((i=!R[l=i+" "+(c=n+"-stagger")])&&s.addClass(t,c),l=m(t,l),i&&s.removeClass(t,c));s.addClass(t,n);var c=t.data("$$ngAnimateCSS3Data")||{},p=m(t,a);return i=p.transitionDuration,p=p.animationDuration,e&&0===i&&0===p?(s.removeClass(t,n),!1):(n=r||e&&0<i,e=0<p&&0<l.animationDelay&&0===l.animationDuration,t.data("$$ngAnimateCSS3Data",{stagger:l,cacheKey:a,running:c.running||0,itemIndex:u,blockTransition:n,closeAnimationFns:c.closeAnimationFns||[]}),a=o(t),n&&(b(a,!0),r&&t.css(r)),e&&(a.style[$+"PlayState"]="paused"),!0)}function b(e,t){e.style[F+"Property"]=t?"none":""}function w(e,t,n,r){if(y(e,t,n,r))return function(e){e&&E(t,n)}}function x(e,t,n,r,i){if(t.data("$$ngAnimateCSS3Data"))return function(e,t,n,r,i){function u(){t.off(P,c),s.removeClass(t,h),s.removeClass(t,d),I&&a.cancel(I),E(t,n);var e,r=o(t);for(e in f)r.style.removeProperty(f[e])}function c(e){e.stopPropagation();var t=e.originalEvent||e;e=t.$manualTimeStamp||t.timeStamp||Date.now(),t=parseFloat(t.elapsedTime.toFixed(3)),Math.max(e-R,0)>=F&&t>=A&&r()}var p=o(t);if(e=t.data("$$ngAnimateCSS3Data"),-1!=p.getAttribute("class").indexOf(n)&&e){var h="",d="";l(n.split(" "),(function(e,t){var n=(0<t?" ":"")+e;h+=n+"-active",d+=n+"-pending"}));var f=[],v=e.itemIndex,y=e.stagger,w=0;if(0<v){w=0,0<y.transitionDelay&&0===y.transitionDuration&&(w=y.transitionDelay*v);var x=0;0<y.animationDelay&&0===y.animationDuration&&(x=y.animationDelay*v,f.push(T+"animation-play-state")),w=Math.round(100*Math.max(w,x))/100}w||(s.addClass(t,h),e.blockTransition&&b(p,!1));var S=m(t,e.cacheKey+" "+h),A=Math.max(S.transitionDuration,S.animationDuration);if(0!==A){!w&&i&&(S.transitionDuration||(t.css("transition",S.animationDuration+"s linear all"),f.push("transition")),t.css(i));var F=1e3*(v=Math.max(S.transitionDelay,S.animationDelay));0<f.length&&(";"!==(y=p.getAttribute("style")||"").charAt(y.length-1)&&(y+=";"),p.setAttribute("style",y+" "));var I,R=Date.now(),P=D+" "+C;v=1e3*(w+1.5*(v+A));return 0<w&&(s.addClass(t,d),I=a((function(){I=null,0<S.transitionDuration&&b(p,!1),0<S.animationDuration&&(p.style[$+"PlayState"]=""),s.addClass(t,h),s.removeClass(t,d),i&&(0===S.transitionDuration&&t.css("transition",S.animationDuration+"s linear all"),t.css(i),f.push("transition"))}),1e3*w,!1)),t.on(P,c),e.closeAnimationFns.push((function(){u(),r()})),e.running++,g(t,v),u}s.removeClass(t,h),E(t,n),r()}else r()}(e,t,n,r,i);E(t,n),r()}function S(e,t,n,r,i){var o=w(e,t,n,i.from);if(o){var a=o;return f(0,(function(){a=x(e,t,n,r,i.to)})),function(e){(a||u)(e)}}d(),r()}function E(e,t){s.removeClass(e,t);var n=e.data("$$ngAnimateCSS3Data");n&&(n.running&&n.running--,n.running&&0!==n.running||e.removeData("$$ngAnimateCSS3Data"))}function A(e,t){var n="";return e=p(e)?e:e.split(/\s+/),l(e,(function(e,r){e&&0<e.length&&(n+=(0<r?" ":"")+e+t)})),n}var F,C,$,D,T="";e.ontransitionend===n&&e.onwebkittransitionend!==n?(T="-webkit-",F="WebkitTransition",C="webkitTransitionEnd transitionend"):(F="transition",C="transitionend"),e.onanimationend===n&&e.onwebkitanimationend!==n?(T="-webkit-",$="WebkitAnimation",D="webkitAnimationEnd animationend"):($="animation",D="animationend");var I,R={},P=0,O=[],k=null,_=0,j=[];return{animate:function(e,t,n,r,i,o){return(o=o||{}).from=n,o.to=r,S("animate",e,t,i,o)},enter:function(e,t,n){return S("enter",e,"ng-enter",t,n=n||{})},leave:function(e,t,n){return S("leave",e,"ng-leave",t,n=n||{})},move:function(e,t,n){return S("move",e,"ng-move",t,n=n||{})},beforeSetClass:function(e,t,n,r,i){if(i=i||{},i=w("setClass",e,t=A(n,"-remove")+" "+A(t,"-add"),i.from))return f(0,r),i;d(),r()},beforeAddClass:function(e,t,n,r){if(r=r||{},t=w("addClass",e,A(t,"-add"),r.from))return f(0,n),t;d(),n()},beforeRemoveClass:function(e,t,n,r){if(r=r||{},t=w("removeClass",e,A(t,"-remove"),r.from))return f(0,n),t;d(),n()},setClass:function(e,t,n,r,i){return i=i||{},x("setClass",e,(n=A(n,"-remove"))+" "+(t=A(t,"-add")),r,i.to)},addClass:function(e,t,n,r){return r=r||{},x("addClass",e,A(t,"-add"),n,r.to)},removeClass:function(e,t,n,r){return r=r||{},x("removeClass",e,A(t,"-remove"),n,r.to)}}}])}])}(window,window.angular)},function(e,t){!function(e,t,n){"use strict";t.module("ngCookies",["ng"]).factory("$cookies",["$rootScope","$browser",function(e,n){var r,i={},o={},a=!1,s=t.copy,u=t.isUndefined;return n.addPollFn((function(){var t=n.cookies();r!=t&&(r=t,s(t,o),s(t,i),a&&e.$apply())}))(),a=!0,e.$watch((function(){var e,r,a;for(e in o)u(i[e])&&n.cookies(e,void 0);for(e in i)r=i[e],t.isString(r)||(r=""+r,i[e]=r),r!==o[e]&&(n.cookies(e,r),a=!0);if(a)for(e in r=n.cookies(),i)i[e]!==r[e]&&(u(r[e])?delete i[e]:i[e]=r[e])})),i}]).factory("$cookieStore",["$cookies",function(e){return{get:function(n){return(n=e[n])?t.fromJson(n):n},put:function(n,r){e[n]=t.toJson(r)},remove:function(t){delete e[t]}}}])}(window,window.angular)},function(e,t){!function(e,t,n){"use strict";function r(e,n,r){return{restrict:"ECA",terminal:!0,priority:400,transclude:"element",link:function(i,o,a,s,u){function l(){d&&(r.cancel(d),d=null),p&&(p.$destroy(),p=null),h&&((d=r.leave(h)).then((function(){d=null})),h=null)}function c(){var a=e.current&&e.current.locals;if(t.isDefined(a&&a.$template)){a=i.$new();var s=e.current;h=u(a,(function(e){r.enter(e,null,h||o).then((function(){!t.isDefined(f)||f&&!i.$eval(f)||n()})),l()})),(p=s.scope=a).$emit("$viewContentLoaded"),p.$eval(g)}else l()}var p,h,d,f=a.autoscroll,g=a.onload||"";i.$on("$routeChangeSuccess",c),c()}}}function i(e,t,n){return{restrict:"ECA",priority:-400,link:function(r,i){var o=n.current,a=o.locals;i.html(a.$template);var s=e(i.contents());o.controller&&(a.$scope=r,a=t(o.controller,a),o.controllerAs&&(r[o.controllerAs]=a),i.data("$ngControllerController",a),i.children().data("$ngControllerController",a)),s(r)}}}e=t.module("ngRoute",["ng"]).provider("$route",(function(){function e(e,n){return t.extend(Object.create(e),n)}function n(e,t){var n=t.caseInsensitiveMatch,r={originalPath:e,regexp:e},i=r.keys=[];return e=e.replace(/([().])/g,"\\$1").replace(/(\/)?:(\w+)([\?\*])?/g,(function(e,t,n,r){return e="?"===r?r:null,r="*"===r?r:null,i.push({name:n,optional:!!e}),t=t||"",(e?"":t)+"(?:"+(e?t:"")+(r?"(.+?)":"([^/]+)")+(e||"")+")"+(e||"")})).replace(/([\/$\*])/g,"\\$1"),r.regexp=new RegExp("^"+e+"$",n?"i":""),r}var r={};this.when=function(e,i){var o=t.copy(i);if(t.isUndefined(o.reloadOnSearch)&&(o.reloadOnSearch=!0),t.isUndefined(o.caseInsensitiveMatch)&&(o.caseInsensitiveMatch=this.caseInsensitiveMatch),r[e]=t.extend(o,e&&n(e,o)),e){var a="/"==e[e.length-1]?e.substr(0,e.length-1):e+"/";r[a]=t.extend({redirectTo:e},n(a,o))}return this},this.caseInsensitiveMatch=!1,this.otherwise=function(e){return"string"==typeof e&&(e={redirectTo:e}),this.when(null,e),this},this.$get=["$rootScope","$location","$routeParams","$q","$injector","$templateRequest","$sce",function(n,i,a,s,u,l,c){function p(o){var a=v.current;(g=(f=function(){var n,o;return t.forEach(r,(function(r,a){var s;if(s=!o){var u=i.path();s=r.keys;var l={};if(r.regexp)if(u=r.regexp.exec(u)){for(var c=1,p=u.length;c<p;++c){var h=s[c-1],d=u[c];h&&d&&(l[h.name]=d)}s=l}else s=null;else s=null;s=n=s}s&&((o=e(r,{params:t.extend({},i.search(),n),pathParams:n})).$$route=r)})),o||r.null&&e(r.null,{params:{},pathParams:{}})}())&&a&&f.$$route===a.$$route&&t.equals(f.pathParams,a.pathParams)&&!f.reloadOnSearch&&!m)||!a&&!f||n.$broadcast("$routeChangeStart",f,a).defaultPrevented&&o&&o.preventDefault()}function h(){var e=v.current,r=f;g?(e.params=r.params,t.copy(e.params,a),n.$broadcast("$routeUpdate",e)):(r||e)&&(m=!1,(v.current=r)&&r.redirectTo&&(t.isString(r.redirectTo)?i.path(d(r.redirectTo,r.params)).search(r.params).replace():i.url(r.redirectTo(r.pathParams,i.path(),i.search())).replace()),s.when(r).then((function(){if(r){var e,n,i=t.extend({},r.resolve);return t.forEach(i,(function(e,n){i[n]=t.isString(e)?u.get(e):u.invoke(e,null,null,n)})),t.isDefined(e=r.template)?t.isFunction(e)&&(e=e(r.params)):t.isDefined(n=r.templateUrl)&&(t.isFunction(n)&&(n=n(r.params)),n=c.getTrustedResourceUrl(n),t.isDefined(n)&&(r.loadedTemplateUrl=n,e=l(n))),t.isDefined(e)&&(i.$template=e),s.all(i)}})).then((function(i){r==v.current&&(r&&(r.locals=i,t.copy(r.params,a)),n.$broadcast("$routeChangeSuccess",r,e))}),(function(t){r==v.current&&n.$broadcast("$routeChangeError",r,e,t)})))}function d(e,n){var r=[];return t.forEach((e||"").split(":"),(function(e,t){if(0===t)r.push(e);else{var i=e.match(/(\w+)(?:[?*])?(.*)/),o=i[1];r.push(n[o]),r.push(i[2]||""),delete n[o]}})),r.join("")}var f,g,m=!1,v={routes:r,reload:function(){m=!0,n.$evalAsync((function(){p(),h()}))},updateParams:function(e){if(!this.current||!this.current.$$route)throw o("norout");var n={},r=this;t.forEach(Object.keys(e),(function(t){r.current.pathParams[t]||(n[t]=e[t])})),e=t.extend({},this.current.params,e),i.path(d(this.current.$$route.originalPath,e)),i.search(t.extend({},i.search(),n))}};return n.$on("$locationChangeStart",p),n.$on("$locationChangeSuccess",h),v}]}));var o=t.$$minErr("ngRoute");e.provider("$routeParams",(function(){this.$get=function(){return{}}})),e.directive("ngView",r),e.directive("ngView",i),r.$inject=["$route","$anchorScroll","$animate"],i.$inject=["$compile","$controller","$route"]}(window,window.angular)},function(e,t){
63
63
  /**
64
64
  * An Angular module that gives you access to the browsers local storage
65
65
  * @version v0.1.5 - 2014-11-04
@@ -88,4 +88,4 @@ t.read=function(e,t,n,r,i){var o,a,s=8*i-r-1,u=(1<<s)-1,l=u>>1,c=-7,p=n?i-1:0,h=
88
88
  * angular-translate - v2.19.0 - 2021-09-02
89
89
  *
90
90
  * Copyright (c) 2021 The angular-translate team, Pascal Precht; Licensed MIT
91
- */void 0===(r=function(){return function(){function e(e,t){"use strict";return function(n){if(!n||!(angular.isArray(n.files)||angular.isString(n.prefix)&&angular.isString(n.suffix)))throw new Error("Couldn't load static files, no files and prefix or suffix specified!");n.files||(n.files=[{prefix:n.prefix,suffix:n.suffix}]);for(var r=function(r){if(!r||!angular.isString(r.prefix)||!angular.isString(r.suffix))throw new Error("Couldn't load static file, no prefix or suffix specified!");var i=[r.prefix,n.key,r.suffix].join("");return angular.isObject(n.fileMap)&&n.fileMap[i]&&(i=n.fileMap[i]),t(angular.extend({url:i,method:"GET"},n.$http)).then((function(e){return e.data}),(function(){return e.reject(n.key)}))},i=[],o=n.files.length,a=0;a<o;a++)i.push(r({prefix:n.files[a].prefix,key:n.key,suffix:n.files[a].suffix}));return e.all(i).then((function(e){for(var t=e.length,n={},r=0;r<t;r++)for(var i in e[r])n[i]=e[r][i];return n}))}}return e.$inject=["$q","$http"],angular.module("pascalprecht.translate").factory("$translateStaticFilesLoader",e),e.displayName="$translateStaticFilesLoader","pascalprecht.translate"}()}.apply(t,[]))||(e.exports=r)},function(e,t,n){var r={"./aclmanagement/app":[145,9,6,20],"./aclmanagement/app.js":[145,9,6,20],"./aclmanagement/controllers":[80,9,22],"./aclmanagement/controllers.js":[80,9,22],"./aclmanagement/model":[63,9,68],"./aclmanagement/model.js":[63,9,68],"./aclmanagement/plugin":[146,7,69],"./aclmanagement/plugin.js":[146,7,69],"./autocomplete/app":[147,9,33],"./autocomplete/app.js":[147,9,33],"./autocomplete/controllers":[81,9,40],"./autocomplete/controllers.js":[81,9,40],"./autocomplete/plugin":[148,7,70],"./autocomplete/plugin.js":[148,7,70],"./autocomplete/templates/modal/add-label.html":[252,7,168],"./backup-and-restore/app":[149,9,41],"./backup-and-restore/app.js":[149,9,41],"./backup-and-restore/controllers":[82,7,71],"./backup-and-restore/controllers.js":[82,7,71],"./backup-and-restore/plugin":[150,7,72],"./backup-and-restore/plugin.js":[150,7,72],"./chatgpt/app":[151,9,42],"./chatgpt/app.js":[151,9,42],"./chatgpt/controllers":[83,7,73],"./chatgpt/controllers.js":[83,7,73],"./chatgpt/plugin":[152,7,74],"./chatgpt/plugin.js":[152,7,74],"./chatgpt/templates/chat.html":[253,7,169],"./chatgpt/templates/chatInfo.html":[254,7,170],"./chatgpt/templates/modal/settings.html":[255,7,171],"./clustermanagement/app":[153,9,2,9,5,10,43],"./clustermanagement/app.js":[153,9,2,9,5,10,43],"./clustermanagement/controllers/add-location.controller":[88,7,75],"./clustermanagement/controllers/add-location.controller.js":[88,7,75],"./clustermanagement/controllers/add-nodes.controller":[89,9,44],"./clustermanagement/controllers/add-nodes.controller.js":[89,9,44],"./clustermanagement/controllers/cluster-management.controller":[77,9,5],"./clustermanagement/controllers/cluster-management.controller.js":[77,9,5],"./clustermanagement/controllers/create-cluster.controller":[85,9,45],"./clustermanagement/controllers/create-cluster.controller.js":[85,9,45],"./clustermanagement/controllers/delete-cluster.controller":[87,7,76],"./clustermanagement/controllers/delete-cluster.controller.js":[87,7,76],"./clustermanagement/controllers/edit-cluster.controller":[86,9,46],"./clustermanagement/controllers/edit-cluster.controller.js":[86,9,46],"./clustermanagement/controllers/remove-nodes.controller":[84,7,77],"./clustermanagement/controllers/remove-nodes.controller.js":[84,7,77],"./clustermanagement/controllers/replace-nodes.controller":[90,9,34],"./clustermanagement/controllers/replace-nodes.controller.js":[90,9,34],"./clustermanagement/directives":[140,9,5,10],"./clustermanagement/directives.js":[140,9,5,10],"./clustermanagement/plugin":[154,7,78],"./clustermanagement/plugin.js":[154,7,78],"./clustermanagement/services/cluster-drawing.service":[91,9,5,79],"./clustermanagement/services/cluster-drawing.service.js":[91,9,5,79],"./clustermanagement/services/remote-locations.service":[64,9,80],"./clustermanagement/services/remote-locations.service.js":[64,9,80],"./clustermanagement/templates/modal/add-nodes-dialog.html":[256,7,172],"./clustermanagement/templates/modal/cluster-create-dialog.html":[257,7,173],"./clustermanagement/templates/modal/cluster-delete-dialog.html":[258,7,174],"./clustermanagement/templates/modal/cluster-edit-dialog.html":[259,7,175],"./clustermanagement/templates/modal/remove-nodes-dialog.html":[260,7,176],"./clustermanagement/templates/modal/replace-nodes-dialog.html":[261,7,177],"./controllers":[40,9],"./controllers.js":[40,9],"./core/angularCancelOnNavigateModule":[46,7],"./core/angularCancelOnNavigateModule.js":[46,7],"./core/controllers":[29,7],"./core/controllers.js":[29,7],"./core/directives":[23,9],"./core/directives.js":[23,9],"./core/directives/angulartooltips/angular-tooltips":[49,7],"./core/directives/angulartooltips/angular-tooltips.js":[49,7],"./core/directives/autocomplete/autocomplete.directive":[52,9],"./core/directives/autocomplete/autocomplete.directive.js":[52,9],"./core/directives/autocomplete/templates/autocomplete.html":[262,7,178],"./core/directives/fit-text.directive":[92,7,81],"./core/directives/fit-text.directive.js":[92,7,81],"./core/directives/languageselector/language-selector.directive":[48,9],"./core/directives/languageselector/language-selector.directive.js":[48,9],"./core/directives/languageselector/templates/languageSelector.html":[263,7,179],"./core/directives/operations-statuses-monitor/operations-statuses-monitor.directive":[51,9],"./core/directives/operations-statuses-monitor/operations-statuses-monitor.directive.js":[51,9],"./core/directives/operations-statuses-monitor/templates/operations-statuses-monitor.html":[264,7,180],"./core/directives/paginations":[65,7,82],"./core/directives/paginations.js":[65,7,82],"./core/directives/queryeditor/query-editor.controller":[61,9,83],"./core/directives/queryeditor/query-editor.controller.js":[61,9,83],"./core/directives/queryeditor/query-editor.directive":[71,9,1,3,38],"./core/directives/queryeditor/query-editor.directive.js":[71,9,1,3,38],"./core/directives/queryeditor/sparql-tab.directive":[66,9,84],"./core/directives/queryeditor/sparql-tab.directive.js":[66,9,84],"./core/directives/queryeditor/templates/query-editor.html":[265,7,181],"./core/directives/queryeditor/templates/query-sample.html":[266,7,182],"./core/directives/rdfresourcesearch/rdf-resource-search.directive":[47,9],"./core/directives/rdfresourcesearch/rdf-resource-search.directive.js":[47,9],"./core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html":[267,7,183],"./core/directives/uppercased.directive":[50,7],"./core/directives/uppercased.directive.js":[50,7],"./core/interceptors/authentication.interceptor":[35,9],"./core/interceptors/authentication.interceptor.js":[35,9],"./core/interceptors/unauthorized.interceptor":[34,9],"./core/interceptors/unauthorized.interceptor.js":[34,9],"./core/loading-hint":[36,7,85],"./core/loading-hint.js":[36,7,85],"./core/services":[7,9],"./core/services.js":[7,9],"./core/services/autocomplete-status.service":[44,7],"./core/services/autocomplete-status.service.js":[44,7],"./core/services/jwt-auth.service":[24,9],"./core/services/jwt-auth.service.js":[24,9],"./core/services/license.service":[42,7],"./core/services/license.service.js":[42,7],"./core/services/openid-auth.service":[37,9],"./core/services/openid-auth.service.js":[37,9],"./core/services/repositories.service":[22,9],"./core/services/repositories.service.js":[22,9],"./core/services/theme-service":[41,7],"./core/services/theme-service.js":[41,7],"./core/templates/core-errors.html":[268,7,184],"./core/templates/inactive-plugin-warning-page.html":[269,7,185],"./core/templates/modal/copy-to-clipboard-modal.html":[270,7,186],"./core/templates/modal/modal-simple.html":[271,7,187],"./core/templates/modal/modal-warning.html":[272,7,188],"./core/templates/search-resource-input.html":[273,7,189],"./explore/app":[155,9,7,1,8,23],"./explore/app.js":[155,9,7,1,8,23],"./explore/controllers":[141,9,1,8],"./explore/controllers.js":[141,9,1,8],"./explore/directives":[94,9,86],"./explore/directives.js":[94,9,86],"./explore/plugin":[156,7,87],"./explore/plugin.js":[156,7,87],"./explore/statements.service":[93,7,88],"./explore/statements.service.js":[93,7,88],"./explore/templates/viewTrig.html":[274,7,190],"./export/app":[157,9,18],"./export/app.js":[157,9,18],"./export/controllers":[95,9,48],"./export/controllers.js":[95,9,48],"./export/plugin":[158,7,89],"./export/plugin.js":[158,7,89],"./externalsync/app":[159,9,29],"./externalsync/app.js":[159,9,29],"./externalsync/controllers":[68,9,49],"./externalsync/controllers.js":[68,9,49],"./externalsync/directives":[96,9,90],"./externalsync/directives.js":[96,9,90],"./externalsync/plugin":[160,7,91],"./externalsync/plugin.js":[160,7,91],"./externalsync/templates/deleteConnector.html":[275,7,191],"./graphexplore/app":[161,9,2,9,19,1,14],"./graphexplore/app.js":[161,9,2,9,19,1,14],"./graphexplore/controllers/dependencies-chord.controller":[103,7,92],"./graphexplore/controllers/dependencies-chord.controller.js":[103,7,92],"./graphexplore/controllers/domain-range-graph.controller":[102,9,93],"./graphexplore/controllers/domain-range-graph.controller.js":[102,9,93],"./graphexplore/controllers/graphs-config.controller":[105,9,50],"./graphexplore/controllers/graphs-config.controller.js":[105,9,50],"./graphexplore/controllers/graphs-visualizations.controller":[104,9,2,24],"./graphexplore/controllers/graphs-visualizations.controller.js":[104,9,2,24],"./graphexplore/controllers/rdf-class-hierarchy.controller":[101,9,94],"./graphexplore/controllers/rdf-class-hierarchy.controller.js":[101,9,94],"./graphexplore/directives/dependencies-chord.directive":[110,9,2,30],"./graphexplore/directives/dependencies-chord.directive.js":[110,9,2,30],"./graphexplore/directives/domain-range-graph.directive":[107,9,2,31],"./graphexplore/directives/domain-range-graph.directive.js":[107,9,2,31],"./graphexplore/directives/list-items-search-filter.directive":[111,7,95],"./graphexplore/directives/list-items-search-filter.directive.js":[111,7,95],"./graphexplore/directives/rdf-class-hierarchy.directive":[106,9,2,21],"./graphexplore/directives/rdf-class-hierarchy.directive.js":[106,9,2,21],"./graphexplore/directives/rdfs-comment-label.directive":[109,7,96],"./graphexplore/directives/rdfs-comment-label.directive.js":[109,7,96],"./graphexplore/directives/search-icon-input.directive":[112,7,97],"./graphexplore/directives/search-icon-input.directive.js":[112,7,97],"./graphexplore/directives/system-repo-warning.directive":[108,7,98],"./graphexplore/directives/system-repo-warning.directive.js":[108,7,98],"./graphexplore/plugin":[162,7,99],"./graphexplore/plugin.js":[162,7,99],"./graphexplore/services/rdfs-label-comment.service":[98,7,100],"./graphexplore/services/rdfs-label-comment.service.js":[98,7,100],"./graphexplore/services/ui-scroll.service":[97,7,101],"./graphexplore/services/ui-scroll.service.js":[97,7,101],"./graphexplore/templates/listItemsSearchFilterTemplate.html":[276,7,192],"./graphexplore/templates/modal/save-graph.html":[277,7,193],"./graphexplore/templates/rdfClassHierarchyClassCountSliderHelpTemplate.html":[278,7,194],"./graphexplore/templates/rdfsCommentLabelTemplate.html":[279,7,195],"./graphexplore/templates/searchIconInputTemplate.html":[280,7,196],"./graphexplore/templates/systemRepoWarningTemplate.html":[281,7,197],"./guides/app":[163,9,35],"./guides/app.js":[163,9,35],"./guides/controllers":[113,9,47],"./guides/controllers.js":[113,9,47],"./guides/directives":[45,7],"./guides/directives.js":[45,7],"./guides/guide-utils":[2,9],"./guides/guide-utils.js":[2,9],"./guides/guides.service":[33,9],"./guides/guides.service.js":[33,9],"./guides/plugin":[164,7,102],"./guides/plugin.js":[164,7,102],"./guides/steps/complex/class-hierarchy/plugin":[165,7,103],"./guides/steps/complex/class-hierarchy/plugin.js":[165,7,103],"./guides/steps/complex/create-repository/plugin":[166,7,104],"./guides/steps/complex/create-repository/plugin.js":[166,7,104],"./guides/steps/complex/download-guide-resource/plugin":[167,7,105],"./guides/steps/complex/download-guide-resource/plugin.js":[167,7,105],"./guides/steps/complex/enable-autocomplete/plugin":[168,7,106],"./guides/steps/complex/enable-autocomplete/plugin.js":[168,7,106],"./guides/steps/complex/execute-sparql-query/plugin":[169,7,107],"./guides/steps/complex/execute-sparql-query/plugin.js":[169,7,107],"./guides/steps/complex/import-rdf-file/plugin":[170,7,108],"./guides/steps/complex/import-rdf-file/plugin.js":[170,7,108],"./guides/steps/complex/main-menu/plugin":[171,7,109],"./guides/steps/complex/main-menu/plugin.js":[171,7,109],"./guides/steps/complex/select-repository/plugin":[172,7,110],"./guides/steps/complex/select-repository/plugin.js":[172,7,110],"./guides/steps/complex/table-graph/plugin":[173,7,111],"./guides/steps/complex/table-graph/plugin.js":[173,7,111],"./guides/steps/complex/visual-graph/plugin":[174,7,112],"./guides/steps/complex/visual-graph/plugin.js":[174,7,112],"./guides/steps/complex/welcome/plugin":[175,7,113],"./guides/steps/complex/welcome/plugin.js":[175,7,113],"./guides/steps/core/plugin":[176,7,114],"./guides/steps/core/plugin.js":[176,7,114],"./guides/tour-lib-services/shepherd.service":[12,9],"./guides/tour-lib-services/shepherd.service.js":[12,9],"./import/app":[177,9,12,51],"./import/app.js":[177,9,12,51],"./import/controllers":[142,9,12],"./import/controllers.js":[142,9,12],"./import/directives":[114,9,115],"./import/directives.js":[114,9,115],"./import/plugin":[178,7,116],"./import/plugin.js":[178,7,116],"./import/templates/commonInfo.html":[282,7,198],"./import/templates/filesTable.html":[283,7,199],"./import/templates/importInfo.html":[284,7,200],"./import/templates/settingsModal.html":[285,7,201],"./import/templates/textSnippet.html":[286,7,202],"./import/templates/uploadInfo.html":[287,7,203],"./import/templates/urlImport.html":[288,7,204],"./jdbc/app":[179,9,0,1,3,4,15],"./jdbc/app.js":[179,9,0,1,3,4,15],"./jdbc/controllers":[124,9,52],"./jdbc/controllers.js":[124,9,52],"./jdbc/plugin":[180,7,117],"./jdbc/plugin.js":[180,7,117],"./models/clustermanagement/recovery-status-state":[181,9,118],"./models/clustermanagement/recovery-status-state.js":[181,9,118],"./models/monitoring/backup-and-restore-info":[16,9],"./models/monitoring/backup-and-restore-info.js":[16,9],"./models/monitoring/backup-and-restore-operation-type":[182,9,119],"./models/monitoring/backup-and-restore-operation-type.js":[182,9,119],"./models/monitoring/cluster-status":[183,9,120],"./models/monitoring/cluster-status.js":[183,9,120],"./models/monitoring/operations/active-operation-input":[184,9,121],"./models/monitoring/operations/active-operation-input.js":[184,9,121],"./models/monitoring/operations/active-operation-model":[8,9],"./models/monitoring/operations/active-operation-model.js":[8,9],"./models/monitoring/operations/active-operations-input":[185,9,122],"./models/monitoring/operations/active-operations-input.js":[185,9,122],"./models/monitoring/operations/active-operations-model":[19,9],"./models/monitoring/operations/active-operations-model.js":[19,9],"./models/monitoring/operations/operation-group":[1,9],"./models/monitoring/operations/operation-group.js":[1,9],"./models/monitoring/operations/operation-monitoring-constants":[9,9],"./models/monitoring/operations/operation-monitoring-constants.js":[9,9],"./models/monitoring/operations/operation-status":[4,9],"./models/monitoring/operations/operation-status.js":[4,9],"./models/monitoring/operations/operation-type":[3,9],"./models/monitoring/operations/operation-type.js":[3,9],"./models/monitoring/snapshot-option-info":[17,9],"./models/monitoring/snapshot-option-info.js":[17,9],"./models/settings/workbench-settings":[186,9,123],"./models/settings/workbench-settings.js":[186,9,123],"./models/themes/theme":[187,9,124],"./models/themes/theme.js":[187,9,124],"./namespaces/app":[188,9,7,28],"./namespaces/app.js":[188,9,7,28],"./namespaces/controllers":[126,9,125],"./namespaces/controllers.js":[126,9,125],"./namespaces/directives":[127,7,126],"./namespaces/directives.js":[127,7,126],"./namespaces/plugin":[189,7,127],"./namespaces/plugin.js":[189,7,127],"./plugin":[191,7,129],"./plugin-registry":[190,7,128],"./plugin-registry.js":[190,7,128],"./plugin.js":[191,7,129],"./plugins/app":[192,9,53],"./plugins/app.js":[192,9,53],"./plugins/controllers":[128,9,130],"./plugins/controllers.js":[128,9,130],"./plugins/plugin":[193,7,131],"./plugins/plugin.js":[193,7,131],"./queries/app":[194,9,54],"./queries/app.js":[194,9,54],"./queries/controllers":[129,9,132],"./queries/controllers.js":[129,9,132],"./queries/plugin":[195,7,133],"./queries/plugin.js":[195,7,133],"./rdfrank/app":[196,9,26],"./rdfrank/app.js":[196,9,26],"./rdfrank/plugin":[197,7,134],"./rdfrank/plugin.js":[197,7,134],"./rdfrank/templates/filter-list.html":[289,7,205],"./repositories/app":[198,9,6,25],"./repositories/app.js":[198,9,6,25],"./repositories/controllers":[75,9,6],"./repositories/controllers.js":[75,9,6],"./repositories/fedx-repo.directive":[131,7,135],"./repositories/fedx-repo.directive.js":[131,7,135],"./repositories/ontop-repo.directive":[139,9,6,136],"./repositories/ontop-repo.directive.js":[139,9,6,136],"./repositories/plugin":[199,7,137],"./repositories/plugin.js":[199,7,137],"./repositories/repository.constants":[67,9,138],"./repositories/repository.constants.js":[67,9,138],"./repositories/templates/fedx-repo.html":[290,7,206],"./repositories/templates/ontop-repo.html":[291,7,207],"./resources/app":[200,9,0,4,55],"./resources/app.js":[200,9,0,4,55],"./resources/chart-models/chart-data":[56,9,0,139],"./resources/chart-models/chart-data.js":[56,9,0,139],"./resources/chart-models/cluster-health/cluster-health-chart":[122,9,0,56],"./resources/chart-models/cluster-health/cluster-health-chart.js":[122,9,0,56],"./resources/chart-models/performance/connections-chart":[121,9,0,57],"./resources/chart-models/performance/connections-chart.js":[121,9,0,57],"./resources/chart-models/performance/epool-chart":[123,9,0,58],"./resources/chart-models/performance/epool-chart.js":[123,9,0,58],"./resources/chart-models/performance/queries-chart":[119,9,0,59],"./resources/chart-models/performance/queries-chart.js":[119,9,0,59],"./resources/chart-models/resource/cpu-load-chart":[117,9,0,60],"./resources/chart-models/resource/cpu-load-chart.js":[117,9,0,60],"./resources/chart-models/resource/disk-storage-chart":[118,9,0,61],"./resources/chart-models/resource/disk-storage-chart.js":[118,9,0,61],"./resources/chart-models/resource/file-descriptors-chart":[115,9,0,62],"./resources/chart-models/resource/file-descriptors-chart.js":[115,9,0,62],"./resources/chart-models/resource/global-cache-chart":[120,9,0,63],"./resources/chart-models/resource/global-cache-chart.js":[120,9,0,63],"./resources/chart-models/resource/heap-memory-chart":[73,9,0,64],"./resources/chart-models/resource/heap-memory-chart.js":[73,9,0,64],"./resources/chart-models/resource/non-heap-memory-chart":[116,9,0,36],"./resources/chart-models/resource/non-heap-memory-chart.js":[116,9,0,36],"./resources/controllers":[79,9,0,4],"./resources/controllers.js":[79,9,0,4],"./resources/directives":[133,9,0,140],"./resources/directives.js":[133,9,0,140],"./resources/plugin":[201,7,141],"./resources/plugin.js":[201,7,141],"./rest/aclmanagement.rest.service":[76,9,32],"./rest/aclmanagement.rest.service.js":[76,9,32],"./rest/autocomplete.rest.service":[32,7],"./rest/autocomplete.rest.service.js":[32,7],"./rest/cluster.rest.service":[58,7,142],"./rest/cluster.rest.service.js":[58,7,142],"./rest/connectors.rest.service":[60,7,143],"./rest/connectors.rest.service.js":[60,7,143],"./rest/graph-config.rest.service":[100,7,144],"./rest/graph-config.rest.service.js":[100,7,144],"./rest/graph-data.rest.service":[72,7,145],"./rest/graph-data.rest.service.js":[72,7,145],"./rest/jdbc.rest.service":[125,7,146],"./rest/jdbc.rest.service.js":[125,7,146],"./rest/license.rest.service":[13,7],"./rest/license.rest.service.js":[13,7],"./rest/locations.rest.service":[31,7],"./rest/locations.rest.service.js":[31,7],"./rest/mappers/aclmanagement-mapper":[62,9,39],"./rest/mappers/aclmanagement-mapper.js":[62,9,39],"./rest/mappers/active-operations-mapper":[18,9],"./rest/mappers/active-operations-mapper.js":[18,9],"./rest/mappers/autocomplete-mapper":[21,9],"./rest/mappers/autocomplete-mapper.js":[21,9],"./rest/mappers/monitor-backup-and-restore-mapper":[15,9],"./rest/mappers/monitor-backup-and-restore-mapper.js":[15,9],"./rest/mappers/namespaces-mapper":[59,9,147],"./rest/mappers/namespaces-mapper.js":[59,9,147],"./rest/monitoring.rest.service":[26,9],"./rest/monitoring.rest.service.js":[26,9],"./rest/plugins.rest.service":[30,7],"./rest/plugins.rest.service.js":[30,7],"./rest/rdf4j.repositories.rest.service":[28,7],"./rest/rdf4j.repositories.rest.service.js":[28,7],"./rest/rdfrank.rest.service":[130,7,148],"./rest/rdfrank.rest.service.js":[130,7,148],"./rest/repositories.rest.service":[14,7],"./rest/repositories.rest.service.js":[14,7],"./rest/saved-graphs.rest.service":[99,7,149],"./rest/saved-graphs.rest.service.js":[99,7,149],"./rest/security.rest.service":[38,7],"./rest/security.rest.service.js":[38,7],"./rest/similarity.rest.service":[134,7,150],"./rest/similarity.rest.service.js":[134,7,150],"./rest/sparql-templates.rest.service":[135,7,151],"./rest/sparql-templates.rest.service.js":[135,7,151],"./rest/sparql.rest.service":[27,7],"./rest/sparql.rest.service.js":[27,7],"./security/app":[202,9,13,37],"./security/app.js":[202,9,13,37],"./security/controllers":[143,9,13],"./security/controllers.js":[143,9,13],"./security/plugin":[203,7,152],"./security/plugin.js":[203,7,152],"./security/templates/modal/default-authorities.html":[292,7,208],"./security/templates/roles.html":[293,7,209],"./security/templates/user.html":[294,7,210],"./security/templates/users.html":[295,7,211],"./settings/app":[132,9,65],"./settings/app.js":[132,9,65],"./settings/controllers":[78,9,153],"./settings/controllers.js":[78,9,153],"./settings/modal/location-settings.html":[296,7,212],"./settings/modal/validate-license.html":[297,7,213],"./settings/plugin":[204,7,154],"./settings/plugin.js":[204,7,154],"./similarity/app":[205,9,1,3,11,17],"./similarity/app.js":[205,9,1,3,11,17],"./similarity/controllers/create-index.controller":[137,9,66],"./similarity/controllers/create-index.controller.js":[137,9,66],"./similarity/controllers/similarity-list.controller":[136,9,1,155],"./similarity/controllers/similarity-list.controller.js":[136,9,1,155],"./similarity/plugin":[206,7,156],"./similarity/plugin.js":[206,7,156],"./sparql-template/app":[209,9,0,1,3,4,16],"./sparql-template/app.js":[209,9,0,1,3,4,16],"./sparql-template/controllers":[138,9,67],"./sparql-template/controllers.js":[138,9,67],"./sparql-template/plugin":[210,7,157],"./sparql-template/plugin.js":[210,7,157],"./sparql/app":[207,9,7,1,3,11,27],"./sparql/app.js":[207,9,7,1,3,11,27],"./sparql/plugin":[208,7,158],"./sparql/plugin.js":[208,7,158],"./stats/app":[211,9,159],"./stats/app.js":[211,9,159],"./stats/plugin":[212,7,160],"./stats/plugin.js":[212,7,160],"./templates/graphdb-small.svg":[298,7,221],"./templates/loader/ot-loader.svg":[299,7,222],"./templates/modal/add-fedx-remote-repo.html":[300,7,214],"./templates/modal/add-location.html":[301,7,215],"./templates/modal/edit-location.html":[302,7,216],"./templates/modal/editRepoFile.html":[303,7,217],"./templates/modal/upload-repository-config.html":[304,7,218],"./templates/repositorySize.html":[305,7,219],"./templates/titlePopoverTemplate.html":[306,7,220],"./treeview/ng-tree":[213,7,161],"./treeview/ng-tree.js":[213,7,161],"./utils/error-utils":[39,7],"./utils/error-utils.js":[39,7],"./utils/file-types":[70,7,162],"./utils/file-types.js":[70,7,162],"./utils/local-storage-adapter":[10,7],"./utils/local-storage-adapter.js":[10,7],"./utils/notifications":[57,7,163],"./utils/notifications.js":[57,7,163],"./utils/sequence-generator-util":[20,9],"./utils/sequence-generator-util.js":[20,9],"./utils/uri-utils":[25,7],"./utils/uri-utils.js":[25,7],"./utils/user-utils":[5,9],"./utils/user-utils.js":[5,9],"./utils/workbench-settings-storage-service":[43,7],"./utils/workbench-settings-storage-service.js":[43,7],"./utils/yasr-utils":[69,9,164],"./utils/yasr-utils.js":[69,9,164]};function i(e){if(!n.o(r,e))return Promise.resolve().then((function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=r[e],i=t[0];return Promise.all(t.slice(2).map(n.e)).then((function(){return n.t(i,t[1])}))}i.keys=function(){return Object.keys(r)},i.id=251,e.exports=i}]);
91
+ */void 0===(r=function(){return function(){function e(e,t){"use strict";return function(n){if(!n||!(angular.isArray(n.files)||angular.isString(n.prefix)&&angular.isString(n.suffix)))throw new Error("Couldn't load static files, no files and prefix or suffix specified!");n.files||(n.files=[{prefix:n.prefix,suffix:n.suffix}]);for(var r=function(r){if(!r||!angular.isString(r.prefix)||!angular.isString(r.suffix))throw new Error("Couldn't load static file, no prefix or suffix specified!");var i=[r.prefix,n.key,r.suffix].join("");return angular.isObject(n.fileMap)&&n.fileMap[i]&&(i=n.fileMap[i]),t(angular.extend({url:i,method:"GET"},n.$http)).then((function(e){return e.data}),(function(){return e.reject(n.key)}))},i=[],o=n.files.length,a=0;a<o;a++)i.push(r({prefix:n.files[a].prefix,key:n.key,suffix:n.files[a].suffix}));return e.all(i).then((function(e){for(var t=e.length,n={},r=0;r<t;r++)for(var i in e[r])n[i]=e[r][i];return n}))}}return e.$inject=["$q","$http"],angular.module("pascalprecht.translate").factory("$translateStaticFilesLoader",e),e.displayName="$translateStaticFilesLoader","pascalprecht.translate"}()}.apply(t,[]))||(e.exports=r)},function(e,t,n){var r={"./aclmanagement/app":[146,9,6,20],"./aclmanagement/app.js":[146,9,6,20],"./aclmanagement/controllers":[80,9,22],"./aclmanagement/controllers.js":[80,9,22],"./aclmanagement/model":[63,9,68],"./aclmanagement/model.js":[63,9,68],"./aclmanagement/plugin":[147,7,69],"./aclmanagement/plugin.js":[147,7,69],"./autocomplete/app":[148,9,33],"./autocomplete/app.js":[148,9,33],"./autocomplete/controllers":[81,9,40],"./autocomplete/controllers.js":[81,9,40],"./autocomplete/plugin":[149,7,70],"./autocomplete/plugin.js":[149,7,70],"./autocomplete/templates/modal/add-label.html":[252,7,168],"./backup-and-restore/app":[150,9,41],"./backup-and-restore/app.js":[150,9,41],"./backup-and-restore/controllers":[82,7,71],"./backup-and-restore/controllers.js":[82,7,71],"./backup-and-restore/plugin":[151,7,72],"./backup-and-restore/plugin.js":[151,7,72],"./chatgpt/app":[152,9,42],"./chatgpt/app.js":[152,9,42],"./chatgpt/controllers":[83,7,73],"./chatgpt/controllers.js":[83,7,73],"./chatgpt/plugin":[153,7,74],"./chatgpt/plugin.js":[153,7,74],"./chatgpt/templates/chat.html":[253,7,169],"./chatgpt/templates/chatInfo.html":[254,7,170],"./chatgpt/templates/modal/settings.html":[255,7,171],"./clustermanagement/app":[154,9,2,10,5,9,43],"./clustermanagement/app.js":[154,9,2,10,5,9,43],"./clustermanagement/controllers/add-location.controller":[88,7,75],"./clustermanagement/controllers/add-location.controller.js":[88,7,75],"./clustermanagement/controllers/add-nodes.controller":[89,9,44],"./clustermanagement/controllers/add-nodes.controller.js":[89,9,44],"./clustermanagement/controllers/cluster-management.controller":[77,9,5],"./clustermanagement/controllers/cluster-management.controller.js":[77,9,5],"./clustermanagement/controllers/create-cluster.controller":[85,9,45],"./clustermanagement/controllers/create-cluster.controller.js":[85,9,45],"./clustermanagement/controllers/delete-cluster.controller":[87,7,76],"./clustermanagement/controllers/delete-cluster.controller.js":[87,7,76],"./clustermanagement/controllers/edit-cluster.controller":[86,9,46],"./clustermanagement/controllers/edit-cluster.controller.js":[86,9,46],"./clustermanagement/controllers/remove-nodes.controller":[84,7,77],"./clustermanagement/controllers/remove-nodes.controller.js":[84,7,77],"./clustermanagement/controllers/replace-nodes.controller":[90,9,34],"./clustermanagement/controllers/replace-nodes.controller.js":[90,9,34],"./clustermanagement/directives":[141,9,5,9],"./clustermanagement/directives.js":[141,9,5,9],"./clustermanagement/plugin":[155,7,78],"./clustermanagement/plugin.js":[155,7,78],"./clustermanagement/services/cluster-drawing.service":[91,9,5,79],"./clustermanagement/services/cluster-drawing.service.js":[91,9,5,79],"./clustermanagement/services/remote-locations.service":[64,9,80],"./clustermanagement/services/remote-locations.service.js":[64,9,80],"./clustermanagement/templates/modal/add-nodes-dialog.html":[256,7,172],"./clustermanagement/templates/modal/cluster-create-dialog.html":[257,7,173],"./clustermanagement/templates/modal/cluster-delete-dialog.html":[258,7,174],"./clustermanagement/templates/modal/cluster-edit-dialog.html":[259,7,175],"./clustermanagement/templates/modal/remove-nodes-dialog.html":[260,7,176],"./clustermanagement/templates/modal/replace-nodes-dialog.html":[261,7,177],"./controllers":[40,9],"./controllers.js":[40,9],"./core/angularCancelOnNavigateModule":[46,7],"./core/angularCancelOnNavigateModule.js":[46,7],"./core/controllers":[29,7],"./core/controllers.js":[29,7],"./core/directives":[23,9],"./core/directives.js":[23,9],"./core/directives/angulartooltips/angular-tooltips":[49,7],"./core/directives/angulartooltips/angular-tooltips.js":[49,7],"./core/directives/autocomplete/autocomplete.directive":[52,9],"./core/directives/autocomplete/autocomplete.directive.js":[52,9],"./core/directives/autocomplete/templates/autocomplete.html":[262,7,178],"./core/directives/fit-text.directive":[93,7,81],"./core/directives/fit-text.directive.js":[93,7,81],"./core/directives/languageselector/language-selector.directive":[48,9],"./core/directives/languageselector/language-selector.directive.js":[48,9],"./core/directives/languageselector/templates/languageSelector.html":[263,7,179],"./core/directives/operations-statuses-monitor/operations-statuses-monitor.directive":[51,9],"./core/directives/operations-statuses-monitor/operations-statuses-monitor.directive.js":[51,9],"./core/directives/operations-statuses-monitor/templates/operations-statuses-monitor.html":[264,7,180],"./core/directives/paginations":[65,7,82],"./core/directives/paginations.js":[65,7,82],"./core/directives/queryeditor/query-editor.controller":[61,9,83],"./core/directives/queryeditor/query-editor.controller.js":[61,9,83],"./core/directives/queryeditor/query-editor.directive":[71,9,1,3,38],"./core/directives/queryeditor/query-editor.directive.js":[71,9,1,3,38],"./core/directives/queryeditor/sparql-tab.directive":[66,9,84],"./core/directives/queryeditor/sparql-tab.directive.js":[66,9,84],"./core/directives/queryeditor/templates/query-editor.html":[265,7,181],"./core/directives/queryeditor/templates/query-sample.html":[266,7,182],"./core/directives/rdfresourcesearch/rdf-resource-search.directive":[47,9],"./core/directives/rdfresourcesearch/rdf-resource-search.directive.js":[47,9],"./core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html":[267,7,183],"./core/directives/uppercased.directive":[50,7],"./core/directives/uppercased.directive.js":[50,7],"./core/interceptors/authentication.interceptor":[35,9],"./core/interceptors/authentication.interceptor.js":[35,9],"./core/interceptors/unauthorized.interceptor":[34,9],"./core/interceptors/unauthorized.interceptor.js":[34,9],"./core/loading-hint":[36,7,85],"./core/loading-hint.js":[36,7,85],"./core/services":[7,9],"./core/services.js":[7,9],"./core/services/autocomplete-status.service":[44,7],"./core/services/autocomplete-status.service.js":[44,7],"./core/services/jwt-auth.service":[24,9],"./core/services/jwt-auth.service.js":[24,9],"./core/services/license.service":[42,7],"./core/services/license.service.js":[42,7],"./core/services/openid-auth.service":[37,9],"./core/services/openid-auth.service.js":[37,9],"./core/services/repositories.service":[22,9],"./core/services/repositories.service.js":[22,9],"./core/services/theme-service":[41,7],"./core/services/theme-service.js":[41,7],"./core/templates/core-errors.html":[268,7,184],"./core/templates/inactive-plugin-warning-page.html":[269,7,185],"./core/templates/modal/copy-to-clipboard-modal.html":[270,7,186],"./core/templates/modal/modal-simple.html":[271,7,187],"./core/templates/modal/modal-warning.html":[272,7,188],"./core/templates/search-resource-input.html":[273,7,189],"./explore/app":[156,9,7,1,8,23],"./explore/app.js":[156,9,7,1,8,23],"./explore/controllers":[142,9,1,8],"./explore/controllers.js":[142,9,1,8],"./explore/directives":[95,9,86],"./explore/directives.js":[95,9,86],"./explore/plugin":[157,7,87],"./explore/plugin.js":[157,7,87],"./explore/statements.service":[94,7,88],"./explore/statements.service.js":[94,7,88],"./explore/templates/viewTrig.html":[274,7,190],"./export/app":[158,9,18],"./export/app.js":[158,9,18],"./export/controllers":[96,9,48],"./export/controllers.js":[96,9,48],"./export/plugin":[159,7,89],"./export/plugin.js":[159,7,89],"./externalsync/app":[160,9,29],"./externalsync/app.js":[160,9,29],"./externalsync/controllers":[68,9,49],"./externalsync/controllers.js":[68,9,49],"./externalsync/directives":[97,9,90],"./externalsync/directives.js":[97,9,90],"./externalsync/plugin":[161,7,91],"./externalsync/plugin.js":[161,7,91],"./externalsync/templates/deleteConnector.html":[275,7,191],"./graphexplore/app":[162,9,2,10,19,1,14],"./graphexplore/app.js":[162,9,2,10,19,1,14],"./graphexplore/controllers/dependencies-chord.controller":[104,7,92],"./graphexplore/controllers/dependencies-chord.controller.js":[104,7,92],"./graphexplore/controllers/domain-range-graph.controller":[103,9,93],"./graphexplore/controllers/domain-range-graph.controller.js":[103,9,93],"./graphexplore/controllers/graphs-config.controller":[106,9,50],"./graphexplore/controllers/graphs-config.controller.js":[106,9,50],"./graphexplore/controllers/graphs-visualizations.controller":[105,9,2,24],"./graphexplore/controllers/graphs-visualizations.controller.js":[105,9,2,24],"./graphexplore/controllers/rdf-class-hierarchy.controller":[102,9,94],"./graphexplore/controllers/rdf-class-hierarchy.controller.js":[102,9,94],"./graphexplore/directives/dependencies-chord.directive":[111,9,2,30],"./graphexplore/directives/dependencies-chord.directive.js":[111,9,2,30],"./graphexplore/directives/domain-range-graph.directive":[108,9,2,31],"./graphexplore/directives/domain-range-graph.directive.js":[108,9,2,31],"./graphexplore/directives/list-items-search-filter.directive":[112,7,95],"./graphexplore/directives/list-items-search-filter.directive.js":[112,7,95],"./graphexplore/directives/rdf-class-hierarchy.directive":[107,9,2,21],"./graphexplore/directives/rdf-class-hierarchy.directive.js":[107,9,2,21],"./graphexplore/directives/rdfs-comment-label.directive":[110,7,96],"./graphexplore/directives/rdfs-comment-label.directive.js":[110,7,96],"./graphexplore/directives/search-icon-input.directive":[113,7,97],"./graphexplore/directives/search-icon-input.directive.js":[113,7,97],"./graphexplore/directives/system-repo-warning.directive":[109,7,98],"./graphexplore/directives/system-repo-warning.directive.js":[109,7,98],"./graphexplore/plugin":[163,7,99],"./graphexplore/plugin.js":[163,7,99],"./graphexplore/services/rdfs-label-comment.service":[99,7,100],"./graphexplore/services/rdfs-label-comment.service.js":[99,7,100],"./graphexplore/services/ui-scroll.service":[98,7,101],"./graphexplore/services/ui-scroll.service.js":[98,7,101],"./graphexplore/templates/listItemsSearchFilterTemplate.html":[276,7,192],"./graphexplore/templates/modal/save-graph.html":[277,7,193],"./graphexplore/templates/rdfClassHierarchyClassCountSliderHelpTemplate.html":[278,7,194],"./graphexplore/templates/rdfsCommentLabelTemplate.html":[279,7,195],"./graphexplore/templates/searchIconInputTemplate.html":[280,7,196],"./graphexplore/templates/systemRepoWarningTemplate.html":[281,7,197],"./guides/app":[164,9,35],"./guides/app.js":[164,9,35],"./guides/controllers":[114,9,47],"./guides/controllers.js":[114,9,47],"./guides/directives":[45,7],"./guides/directives.js":[45,7],"./guides/guide-utils":[2,9],"./guides/guide-utils.js":[2,9],"./guides/guides.service":[33,9],"./guides/guides.service.js":[33,9],"./guides/plugin":[165,7,102],"./guides/plugin.js":[165,7,102],"./guides/steps/complex/class-hierarchy/plugin":[166,7,103],"./guides/steps/complex/class-hierarchy/plugin.js":[166,7,103],"./guides/steps/complex/create-repository/plugin":[167,7,104],"./guides/steps/complex/create-repository/plugin.js":[167,7,104],"./guides/steps/complex/download-guide-resource/plugin":[168,7,105],"./guides/steps/complex/download-guide-resource/plugin.js":[168,7,105],"./guides/steps/complex/enable-autocomplete/plugin":[169,7,106],"./guides/steps/complex/enable-autocomplete/plugin.js":[169,7,106],"./guides/steps/complex/execute-sparql-query/plugin":[170,7,107],"./guides/steps/complex/execute-sparql-query/plugin.js":[170,7,107],"./guides/steps/complex/import-rdf-file/plugin":[171,7,108],"./guides/steps/complex/import-rdf-file/plugin.js":[171,7,108],"./guides/steps/complex/main-menu/plugin":[172,7,109],"./guides/steps/complex/main-menu/plugin.js":[172,7,109],"./guides/steps/complex/select-repository/plugin":[173,7,110],"./guides/steps/complex/select-repository/plugin.js":[173,7,110],"./guides/steps/complex/table-graph/plugin":[174,7,111],"./guides/steps/complex/table-graph/plugin.js":[174,7,111],"./guides/steps/complex/visual-graph/plugin":[175,7,112],"./guides/steps/complex/visual-graph/plugin.js":[175,7,112],"./guides/steps/complex/welcome/plugin":[176,7,113],"./guides/steps/complex/welcome/plugin.js":[176,7,113],"./guides/steps/core/plugin":[177,7,114],"./guides/steps/core/plugin.js":[177,7,114],"./guides/tour-lib-services/shepherd.service":[12,9],"./guides/tour-lib-services/shepherd.service.js":[12,9],"./import/app":[178,9,12,51],"./import/app.js":[178,9,12,51],"./import/controllers":[143,9,12],"./import/controllers.js":[143,9,12],"./import/directives":[115,9,115],"./import/directives.js":[115,9,115],"./import/plugin":[179,7,116],"./import/plugin.js":[179,7,116],"./import/templates/commonInfo.html":[282,7,198],"./import/templates/filesTable.html":[283,7,199],"./import/templates/importInfo.html":[284,7,200],"./import/templates/settingsModal.html":[285,7,201],"./import/templates/textSnippet.html":[286,7,202],"./import/templates/uploadInfo.html":[287,7,203],"./import/templates/urlImport.html":[288,7,204],"./jdbc/app":[180,9,0,1,3,4,15],"./jdbc/app.js":[180,9,0,1,3,4,15],"./jdbc/controllers":[125,9,52],"./jdbc/controllers.js":[125,9,52],"./jdbc/plugin":[181,7,117],"./jdbc/plugin.js":[181,7,117],"./models/clustermanagement/recovery-status-state":[92,9,118],"./models/clustermanagement/recovery-status-state.js":[92,9,118],"./models/monitoring/backup-and-restore-info":[16,9],"./models/monitoring/backup-and-restore-info.js":[16,9],"./models/monitoring/backup-and-restore-operation-type":[182,9,119],"./models/monitoring/backup-and-restore-operation-type.js":[182,9,119],"./models/monitoring/cluster-status":[183,9,120],"./models/monitoring/cluster-status.js":[183,9,120],"./models/monitoring/operations/active-operation-input":[184,9,121],"./models/monitoring/operations/active-operation-input.js":[184,9,121],"./models/monitoring/operations/active-operation-model":[8,9],"./models/monitoring/operations/active-operation-model.js":[8,9],"./models/monitoring/operations/active-operations-input":[185,9,122],"./models/monitoring/operations/active-operations-input.js":[185,9,122],"./models/monitoring/operations/active-operations-model":[19,9],"./models/monitoring/operations/active-operations-model.js":[19,9],"./models/monitoring/operations/operation-group":[1,9],"./models/monitoring/operations/operation-group.js":[1,9],"./models/monitoring/operations/operation-monitoring-constants":[9,9],"./models/monitoring/operations/operation-monitoring-constants.js":[9,9],"./models/monitoring/operations/operation-status":[4,9],"./models/monitoring/operations/operation-status.js":[4,9],"./models/monitoring/operations/operation-type":[3,9],"./models/monitoring/operations/operation-type.js":[3,9],"./models/monitoring/snapshot-option-info":[17,9],"./models/monitoring/snapshot-option-info.js":[17,9],"./models/settings/workbench-settings":[186,9,123],"./models/settings/workbench-settings.js":[186,9,123],"./models/themes/theme":[187,9,124],"./models/themes/theme.js":[187,9,124],"./namespaces/app":[188,9,7,28],"./namespaces/app.js":[188,9,7,28],"./namespaces/controllers":[127,9,125],"./namespaces/controllers.js":[127,9,125],"./namespaces/directives":[128,7,126],"./namespaces/directives.js":[128,7,126],"./namespaces/plugin":[189,7,127],"./namespaces/plugin.js":[189,7,127],"./plugin":[191,7,129],"./plugin-registry":[190,7,128],"./plugin-registry.js":[190,7,128],"./plugin.js":[191,7,129],"./plugins/app":[192,9,53],"./plugins/app.js":[192,9,53],"./plugins/controllers":[129,9,130],"./plugins/controllers.js":[129,9,130],"./plugins/plugin":[193,7,131],"./plugins/plugin.js":[193,7,131],"./queries/app":[194,9,54],"./queries/app.js":[194,9,54],"./queries/controllers":[130,9,132],"./queries/controllers.js":[130,9,132],"./queries/plugin":[195,7,133],"./queries/plugin.js":[195,7,133],"./rdfrank/app":[196,9,26],"./rdfrank/app.js":[196,9,26],"./rdfrank/plugin":[197,7,134],"./rdfrank/plugin.js":[197,7,134],"./rdfrank/templates/filter-list.html":[289,7,205],"./repositories/app":[198,9,6,25],"./repositories/app.js":[198,9,6,25],"./repositories/controllers":[75,9,6],"./repositories/controllers.js":[75,9,6],"./repositories/fedx-repo.directive":[132,7,135],"./repositories/fedx-repo.directive.js":[132,7,135],"./repositories/ontop-repo.directive":[140,9,6,136],"./repositories/ontop-repo.directive.js":[140,9,6,136],"./repositories/plugin":[199,7,137],"./repositories/plugin.js":[199,7,137],"./repositories/repository.constants":[67,9,138],"./repositories/repository.constants.js":[67,9,138],"./repositories/templates/fedx-repo.html":[290,7,206],"./repositories/templates/ontop-repo.html":[291,7,207],"./resources/app":[200,9,0,4,55],"./resources/app.js":[200,9,0,4,55],"./resources/chart-models/chart-data":[56,9,0,139],"./resources/chart-models/chart-data.js":[56,9,0,139],"./resources/chart-models/cluster-health/cluster-health-chart":[123,9,0,56],"./resources/chart-models/cluster-health/cluster-health-chart.js":[123,9,0,56],"./resources/chart-models/performance/connections-chart":[122,9,0,57],"./resources/chart-models/performance/connections-chart.js":[122,9,0,57],"./resources/chart-models/performance/epool-chart":[124,9,0,58],"./resources/chart-models/performance/epool-chart.js":[124,9,0,58],"./resources/chart-models/performance/queries-chart":[120,9,0,59],"./resources/chart-models/performance/queries-chart.js":[120,9,0,59],"./resources/chart-models/resource/cpu-load-chart":[118,9,0,60],"./resources/chart-models/resource/cpu-load-chart.js":[118,9,0,60],"./resources/chart-models/resource/disk-storage-chart":[119,9,0,61],"./resources/chart-models/resource/disk-storage-chart.js":[119,9,0,61],"./resources/chart-models/resource/file-descriptors-chart":[116,9,0,62],"./resources/chart-models/resource/file-descriptors-chart.js":[116,9,0,62],"./resources/chart-models/resource/global-cache-chart":[121,9,0,63],"./resources/chart-models/resource/global-cache-chart.js":[121,9,0,63],"./resources/chart-models/resource/heap-memory-chart":[73,9,0,64],"./resources/chart-models/resource/heap-memory-chart.js":[73,9,0,64],"./resources/chart-models/resource/non-heap-memory-chart":[117,9,0,36],"./resources/chart-models/resource/non-heap-memory-chart.js":[117,9,0,36],"./resources/controllers":[79,9,0,4],"./resources/controllers.js":[79,9,0,4],"./resources/directives":[134,9,0,140],"./resources/directives.js":[134,9,0,140],"./resources/plugin":[201,7,141],"./resources/plugin.js":[201,7,141],"./rest/aclmanagement.rest.service":[76,9,32],"./rest/aclmanagement.rest.service.js":[76,9,32],"./rest/autocomplete.rest.service":[32,7],"./rest/autocomplete.rest.service.js":[32,7],"./rest/cluster.rest.service":[58,7,142],"./rest/cluster.rest.service.js":[58,7,142],"./rest/connectors.rest.service":[60,7,143],"./rest/connectors.rest.service.js":[60,7,143],"./rest/graph-config.rest.service":[101,7,144],"./rest/graph-config.rest.service.js":[101,7,144],"./rest/graph-data.rest.service":[72,7,145],"./rest/graph-data.rest.service.js":[72,7,145],"./rest/jdbc.rest.service":[126,7,146],"./rest/jdbc.rest.service.js":[126,7,146],"./rest/license.rest.service":[13,7],"./rest/license.rest.service.js":[13,7],"./rest/locations.rest.service":[31,7],"./rest/locations.rest.service.js":[31,7],"./rest/mappers/aclmanagement-mapper":[62,9,39],"./rest/mappers/aclmanagement-mapper.js":[62,9,39],"./rest/mappers/active-operations-mapper":[18,9],"./rest/mappers/active-operations-mapper.js":[18,9],"./rest/mappers/autocomplete-mapper":[21,9],"./rest/mappers/autocomplete-mapper.js":[21,9],"./rest/mappers/monitor-backup-and-restore-mapper":[15,9],"./rest/mappers/monitor-backup-and-restore-mapper.js":[15,9],"./rest/mappers/namespaces-mapper":[59,9,147],"./rest/mappers/namespaces-mapper.js":[59,9,147],"./rest/monitoring.rest.service":[26,9],"./rest/monitoring.rest.service.js":[26,9],"./rest/plugins.rest.service":[30,7],"./rest/plugins.rest.service.js":[30,7],"./rest/rdf4j.repositories.rest.service":[28,7],"./rest/rdf4j.repositories.rest.service.js":[28,7],"./rest/rdfrank.rest.service":[131,7,148],"./rest/rdfrank.rest.service.js":[131,7,148],"./rest/repositories.rest.service":[14,7],"./rest/repositories.rest.service.js":[14,7],"./rest/saved-graphs.rest.service":[100,7,149],"./rest/saved-graphs.rest.service.js":[100,7,149],"./rest/security.rest.service":[38,7],"./rest/security.rest.service.js":[38,7],"./rest/similarity.rest.service":[135,7,150],"./rest/similarity.rest.service.js":[135,7,150],"./rest/sparql-templates.rest.service":[136,7,151],"./rest/sparql-templates.rest.service.js":[136,7,151],"./rest/sparql.rest.service":[27,7],"./rest/sparql.rest.service.js":[27,7],"./security/app":[202,9,13,37],"./security/app.js":[202,9,13,37],"./security/controllers":[144,9,13],"./security/controllers.js":[144,9,13],"./security/plugin":[203,7,152],"./security/plugin.js":[203,7,152],"./security/templates/modal/default-authorities.html":[292,7,208],"./security/templates/roles.html":[293,7,209],"./security/templates/user.html":[294,7,210],"./security/templates/users.html":[295,7,211],"./settings/app":[133,9,65],"./settings/app.js":[133,9,65],"./settings/controllers":[78,9,153],"./settings/controllers.js":[78,9,153],"./settings/modal/location-settings.html":[296,7,212],"./settings/modal/validate-license.html":[297,7,213],"./settings/plugin":[204,7,154],"./settings/plugin.js":[204,7,154],"./similarity/app":[205,9,1,3,11,17],"./similarity/app.js":[205,9,1,3,11,17],"./similarity/controllers/create-index.controller":[138,9,66],"./similarity/controllers/create-index.controller.js":[138,9,66],"./similarity/controllers/similarity-list.controller":[137,9,1,155],"./similarity/controllers/similarity-list.controller.js":[137,9,1,155],"./similarity/plugin":[206,7,156],"./similarity/plugin.js":[206,7,156],"./sparql-template/app":[209,9,0,1,3,4,16],"./sparql-template/app.js":[209,9,0,1,3,4,16],"./sparql-template/controllers":[139,9,67],"./sparql-template/controllers.js":[139,9,67],"./sparql-template/plugin":[210,7,157],"./sparql-template/plugin.js":[210,7,157],"./sparql/app":[207,9,7,1,3,11,27],"./sparql/app.js":[207,9,7,1,3,11,27],"./sparql/plugin":[208,7,158],"./sparql/plugin.js":[208,7,158],"./stats/app":[211,9,159],"./stats/app.js":[211,9,159],"./stats/plugin":[212,7,160],"./stats/plugin.js":[212,7,160],"./templates/graphdb-small.svg":[298,7,221],"./templates/loader/ot-loader.svg":[299,7,222],"./templates/modal/add-fedx-remote-repo.html":[300,7,214],"./templates/modal/add-location.html":[301,7,215],"./templates/modal/edit-location.html":[302,7,216],"./templates/modal/editRepoFile.html":[303,7,217],"./templates/modal/upload-repository-config.html":[304,7,218],"./templates/repositorySize.html":[305,7,219],"./templates/titlePopoverTemplate.html":[306,7,220],"./treeview/ng-tree":[213,7,161],"./treeview/ng-tree.js":[213,7,161],"./utils/error-utils":[39,7],"./utils/error-utils.js":[39,7],"./utils/file-types":[70,7,162],"./utils/file-types.js":[70,7,162],"./utils/local-storage-adapter":[10,7],"./utils/local-storage-adapter.js":[10,7],"./utils/notifications":[57,7,163],"./utils/notifications.js":[57,7,163],"./utils/sequence-generator-util":[20,9],"./utils/sequence-generator-util.js":[20,9],"./utils/uri-utils":[25,7],"./utils/uri-utils.js":[25,7],"./utils/user-utils":[5,9],"./utils/user-utils.js":[5,9],"./utils/workbench-settings-storage-service":[43,7],"./utils/workbench-settings-storage-service.js":[43,7],"./utils/yasr-utils":[69,9,164],"./utils/yasr-utils.js":[69,9,164]};function i(e){if(!n.o(r,e))return Promise.resolve().then((function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=r[e],i=t[0];return Promise.all(t.slice(2).map(n.e)).then((function(){return n.t(i,t[1])}))}i.keys=function(){return Object.keys(r)},i.id=251,e.exports=i}]);