graphdb-workbench 2.8.9-TR1 → 2.8.9
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.
- package/dist/186.d2a7c6668b2f2198549a.bundle.js +1 -1
- package/dist/23.b57e6b08f36eaa6cfa1c.bundle.js +1 -1
- package/dist/348.b09b5350639beca8034e.bundle.js +1 -1
- package/dist/354.474aa50f195477e48af9.bundle.js +1 -1
- package/dist/357.603fceaaeb0992019407.bundle.js +1 -1
- package/dist/358.5398b6635b1fc42b581a.bundle.js +1 -1
- package/dist/359.a2f8d884c46015ae98ed.bundle.js +1 -1
- package/dist/360.40b2c9f3610b0f8dea80.bundle.js +1 -1
- package/dist/361.91ac80c8c5586b0546a5.bundle.js +1 -1
- package/dist/391.45bf699afe7aba531cd9.bundle.js +1 -1
- package/dist/403.61a61ce1c12385533859.bundle.js +1 -1
- package/dist/404.b53dc0ad0aaedcf3f809.bundle.js +1 -1
- package/dist/405.eb8906e00f241da08275.bundle.js +1 -1
- package/dist/406.48298a2b9c49b99170f8.bundle.js +1 -1
- package/dist/407.56a20539c08f5d616640.bundle.js +1 -1
- package/dist/409.72d548b44e2f1c414a24.bundle.js +1 -1
- package/dist/410.df9406357dc52e98d0c4.bundle.js +1 -1
- package/dist/411.3a8907f7c02b1e9581e2.bundle.js +1 -1
- package/dist/412.5feece7f4c5164d2eadb.bundle.js +1 -1
- package/dist/42.51a2b146401e3d3c44fd.bundle.js +1 -1
- package/dist/43.c3b8fc48a5d69126ff55.bundle.js +1 -1
- package/dist/62.092aacacd064526783c0.bundle.js +1 -1
- package/dist/74.05569d4f46a43d6d56e4.bundle.js +1 -1
- package/dist/{bundle.950a9b41883d874b0bb6.bundle.js → bundle.f1f997c1b702d546a4e1.bundle.js} +3 -3
- package/dist/index.html +3 -3
- package/dist/js/angular/core/directives/autocomplete/templates/autocomplete.html +1 -1
- package/dist/js/angular/core/directives/operations-statuses-monitor/templates/operations-statuses-monitor.html +1 -1
- package/dist/js/angular/core/directives/rdfresourcesearch/templates/rdfResourceSearchTemplate.html +1 -1
- package/dist/js/angular/core/directives/yasgui-component/templates/yasgui-component.html +1 -1
- package/dist/js/angular/core/templates/cookie-policy/cookie-consent.html +1 -1
- package/dist/js/angular/core/templates/cookie-policy/cookie-policy.html +1 -1
- package/dist/js/angular/security/templates/user.html +1 -1
- package/dist/js/angular/ttyg/templates/agent-list.html +1 -1
- package/dist/js/angular/ttyg/templates/agent-select-menu.html +1 -1
- package/dist/js/angular/ttyg/templates/chat-item-detail.html +1 -1
- package/dist/js/angular/ttyg/templates/chat-list.html +1 -1
- package/dist/js/angular/ttyg/templates/chat-panel.html +1 -1
- package/dist/js/angular/ttyg/templates/modal/agent-instructions-explain-modal.html +1 -1
- package/dist/js/angular/ttyg/templates/modal/agent-settings-modal.html +1 -1
- package/dist/js/angular/ttyg/templates/no-agents-view.html +1 -1
- package/dist/js/angular/ttyg/templates/ttyg.html +1 -1
- package/dist/license-checker.json +2 -2
- package/dist/pages/aclmanagement.html +2 -2
- package/dist/pages/autocomplete.html +1 -1
- package/dist/pages/choose-repository-type.html +1 -1
- package/dist/pages/cluster-management/clusterInfo.html +3 -3
- package/dist/pages/create-index.html +1 -1
- package/dist/pages/dependencies.html +1 -1
- package/dist/pages/domainRangeInfo.html +2 -2
- package/dist/pages/edit.html +1 -1
- package/dist/pages/explore.html +1 -1
- package/dist/pages/export.html +1 -1
- package/dist/pages/find.html +1 -1
- package/dist/pages/graph-config/saveGraphConfig.html +8 -8
- package/dist/pages/graphs-visualizations.html +7 -7
- package/dist/pages/guides.html +1 -1
- package/dist/pages/import.html +2 -2
- package/dist/pages/jdbc-create.html +1 -1
- package/dist/pages/monitor/backup-and-restore.html +1 -1
- package/dist/pages/monitor/queries.html +1 -1
- package/dist/pages/monitor/resources.html +1 -1
- package/dist/pages/namespaces.html +2 -2
- package/dist/pages/plugins.html +1 -1
- package/dist/pages/rdfClassHierarchyInfo.html +7 -7
- package/dist/pages/rdfrank.html +2 -2
- package/dist/pages/repositories.html +1 -1
- package/dist/pages/repository.html +1 -1
- package/dist/pages/similarity-indexes.html +1 -1
- package/dist/pages/sparql-editor.html +1 -1
- package/dist/pages/sparql-template-create.html +1 -1
- package/dist/pages/ux-test1.html +2 -2
- package/dist/pages/webapi.html +2 -2
- package/dist/res/swagger5/index.html +12 -12
- package/package.json +1 -1
package/dist/{bundle.950a9b41883d874b0bb6.bundle.js → bundle.f1f997c1b702d546a4e1.bundle.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(e){function t(t){for(var n,i,o=t[0],s=t[1],a=0,u=[];a<o.length;a++)i=o[a],Object.prototype.hasOwnProperty.call(r,i)&&r[i]&&u.push(r[i][0]),r[i]=0;for(n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n]);for(l&&l(t);u.length;)u.shift()()}var n={},r={332: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 s,a=document.createElement("script");a.charset="utf-8",a.timeout=120,i.nc&&a.setAttribute("nonce",i.nc),a.src=function(e){return i.p+""+({334:"polyfills-dom",336:"vendors~polyfills-core-js"}[e]||e)+"."+{0:"e4f092fe2c6dd778826e",1:"e7e081fc336681c8215f",2:"3837bd63288e2a826720",3:"f26cefadb24ee2836b8a",4:"8e31e4907beb1d7fdba4",5:"e58201eecd39fe89e5e9",6:"73f6adae3ab11729ebf2",7:"c7a405d7dc99c9ebee48",8:"18ec3a5b3f95a7965e71",9:"d57134d0b4eb2e6f4ee6",10:"d8d48ce0ca42085e7864",11:"21d536c0dd250f396264",12:"ed4bc07d06db664a8a2c",13:"49bf149227b1a2f915a6",14:"345e027a365e41418f3b",15:"2eabfe524e0689eb26e9",16:"0ead6802df331f763762",17:"bcc91ddb954e2e1ee5a2",18:"a4b27592c1b39f2b754b",19:"33b6dc6ba1cea3b94465",20:"204efddc3b65e3417f98",21:"bf90c5dbc6751926b09f",22:"b7955e1f4766f2c32ff6",23:"b57e6b08f36eaa6cfa1c",24:"77404fb1a29f7448cfa9",25:"fd2151cfa79bb46e568e",26:"b4cf5132c870052d06f3",27:"af756f3e9a79334cb6f9",28:"f64cabb9e00e2f08ed6a",29:"073b9b1176718648e438",30:"3530af7acf6dd4af07b4",31:"19f116ce71f83ce6c3df",32:"3649b0fc7e7136790d43",33:"d4864cfbed6bb7c30c95",34:"4a17e8b0f3f203963d5e",35:"2920265e8348ab78e718",36:"99a2c4a2393ff13ec514",37:"d519cb3af9d6205f0015",38:"23f902df4ed8fbfc7fcf",39:"171886987f5ef7d17208",40:"0937e585f9f5a7eaab82",41:"3b2afebd8ef778234327",42:"51a2b146401e3d3c44fd",43:"c3b8fc48a5d69126ff55",44:"0b6f6369f9c157f2243c",45:"5ce107618d1464a08a0b",46:"5baa02d0ce0f4e4bec79",47:"c7898dbc38a6a6e9321b",48:"4a5b02907ad2d1a2792f",49:"143329d875c1714aec89",50:"385486fe0efbefd5dfa9",51:"9f3c96f8a93b54423852",52:"ff20925f8f7656382d7b",53:"e286cd8cfb636fcec996",54:"326b8c0143c463fc8e2d",55:"4009a0d60dea722c108d",56:"a581f6f1ded6a4d3d08b",57:"aa39c7d23ece602d952f",58:"fad69b0e6153a06c83b7",59:"84e7285984168a313d36",60:"ad49b739e4b8f2cdbce7",61:"ee14d8cda3708fe9c287",62:"092aacacd064526783c0",63:"9537a1fd0366d5518114",64:"1dd28ef2f60fe1ba23a5",65:"4c0218d3ba1faae1f6ad",66:"2a2d9bf0e595ca627c78",67:"a4e87ab3032de83a0d71",68:"66efe1b03756e3052e35",69:"fd10e482a3491294f900",70:"38ae428de620fbf7602d",71:"e18795e8eaed8f747ce5",72:"a53c1a358c3335c3eaa1",73:"d442bfb6f448e72c5bce",74:"05569d4f46a43d6d56e4",75:"e226c0d22ed7ff1b57ee",76:"afa96077de497c981882",77:"9fa02265d836024fdf79",78:"9f81b2060ae650976ae7",79:"3fc17aa270c5a6477e9c",80:"7de02802c242d6cf125c",81:"66b9a961188d712b1d48",82:"8c402a2cedd2441c3f3c",83:"15cd8f06607b23e5e901",84:"825f8eaa43e71f73f25d",85:"00ce4d8f4433d87bf54e",86:"ffeb1acd50a34948e089",87:"9ac37a1a4a11ef7dfbac",88:"5b052707f2cd26eb7890",89:"76461444a1cb2b2e1114",90:"7934551daab93be805ba",91:"de9fe730d2b00227b9d4",92:"f4a3984a912edbb06838",93:"e22a88d63bd4fc5f616c",94:"f731de3062bce3990e2f",95:"5fdf43bda2882304ace9",96:"21c753d787869238e5ed",97:"13cd4feb8916c17b8b20",98:"6379c1708e09a721cc36",99:"bfe2ea3e30bb6b0e9045",100:"bf4a4f519b81c43fafc1",101:"444ee8c4ad450a80c227",102:"ec42287cf6022b9eb02f",103:"82c4dfa967a6f2407f11",104:"cb138bb3b878e001e32f",105:"8c2014a729e3e29b78ae",106:"4aa823fde540a06e4083",107:"09c059b73119d06600c0",108:"3c5b6b3268b21218a7a5",109:"57128c0d6212e0a46ad3",110:"af42819ef3cf70e39b25",111:"f548b124aab10b4b1c9e",112:"f754348fe5d0086f677e",113:"d7c1a18d18713eece29a",114:"f719039be05fc7b214c5",115:"8dab67853260483ced85",116:"ed2bb3fba38737cd21a2",117:"8dc1a253f70f4727c027",118:"d197d3c97039ee68643d",119:"ee1dd79fb171af44577c",120:"e25b821b13d853a321b5",121:"45b40da06cc7a71ae79f",122:"4e50eaaadaf3dd57b2b2",123:"2cc29edc9b32fcc35a5c",124:"5bf5f52df172c58b05d0",125:"53a564a1540cfbe90d0a",126:"dc613e6d7c178aa1f71d",127:"aef2e7fa7136b5fb20dc",128:"c47682ae8c6f4827775e",129:"79a97fa0c54c52a26f86",130:"b2fbf4becf6abfef7f86",131:"b91d9c1e4e18cae45b48",132:"f0f88aa3d524eb65ed01",133:"0ade4a762acb81e53b90",134:"c9ab770ded23a2c5394f",135:"a9fc7400422a5a15a95f",136:"3b7b30e23a57edaccaad",137:"c208d1c1ff8b57ca0e07",138:"fbb7ba3aefaa937cc1cf",139:"06c1f3e7dac66dac111e",140:"0824cff78d35896e19a1",141:"b7bb9f43c5524306aece",142:"1c995d2d6a5b035dee20",143:"c11427b27ba48bb4eb8c",144:"fd03637814946fba8e77",145:"4d5cb0b2e88e2a2e8c11",146:"a0a2b0a47fa6363c2be0",147:"c36da2d34dcc3b24d279",148:"81254fa8e58524a4f382",149:"e0a2f7c249981cc8cbdf",150:"310ed39bfee5ae48639d",151:"2341ca71acf310459c66",152:"37839e214172baad9eb1",153:"e288bacab5979453fcaa",154:"eb1c8c88087e946c02cf",155:"5669db0185599c1d8a37",156:"672940a4c43b7f710222",157:"45cd4adf0ccbdf3d47a8",158:"8273c2a84a31a6bee142",159:"7603d8bc47da595509a1",160:"9df03bd5ab91e27a7e3c",161:"58bcd557ce48085da808",162:"15a4b6172e89f7b7ae1a",163:"0a5338548560675f8ade",164:"444390bcc9c803e5ed40",165:"2d117281b8d75e757857",166:"a1475cbce66e0f0d9d77",167:"f49aab7e2a752fe09552",168:"38dbbebd88da57b3ae35",169:"b70f377d971b22436caf",170:"3b351d80184f48188735",171:"dcc8a70fc588401dbcae",172:"8d07797d81d91082ba8c",173:"69c540206c7d83104573",174:"27c77b5acc6891f63cee",175:"5dc77ecf6fab73e58bef",176:"1e97c2917a2230b48034",177:"578be747179dded9efbe",178:"39194cac07f730f69ef5",179:"043ab520b38554c7c4b6",180:"99c0cbb3df5d8f02659b",181:"8ce5807790f369361dbe",182:"e2dc2fc0469127bc30e3",183:"53e87e91190814612b6e",184:"1e29f185ce7f4f0afa5b",185:"5cd3ba499f59bf192716",186:"d2a7c6668b2f2198549a",187:"157fca1e6a2de45af9df",188:"7b78edb347746c46c1c8",189:"67fa66494b765760f7d2",190:"a56d19c53932ffa08f62",191:"39fc9dd01a00a890af07",192:"a238bb9bb9a833ef304b",193:"4c02ced7a1c44850598f",194:"155e5407310bb237964c",195:"447cc0c6ffaa7e09b7bd",196:"dcbed94c0db3a8e343aa",197:"2a0f5d280127e30e6a21",198:"568088e342b26f534c8f",199:"c9eab91c2468753f4aaa",200:"6eee537413665b02c23f",201:"ecd6f5a0b1e07259609b",202:"61f0f819d7cf434a37fa",203:"adf24a2f61f47acf0e2c",204:"e738c49199032f3437e4",205:"0b3022045ba8ccfcbaa5",206:"7f16c0fcd5d65d82f869",207:"665c2a55832b8bb43e13",208:"c653cb276b43b29cce49",209:"9d98bd83dfd06376c27b",210:"a2ea30efd2122d5a8f2f",211:"de53552e0b8e59e26d71",212:"f80d06d279d2dc0aae74",213:"10670e66798d5048d9ff",214:"dec32fead44db230069a",215:"67f2b0c7907ac843f67b",216:"66ff59c70033249c5158",217:"57a8407776a632ad45ff",218:"c9ebeca0a0601cbfdd49",219:"49b7f67206dc1b550fcd",220:"60aae5815d2081a0e83a",221:"9ddd6a25f2977a63833b",222:"ca41fa6721e4e66ed399",223:"54c4cac06e4519e3efb0",224:"f7199477314a1768db47",225:"6a3fe206268377dad69d",226:"914d0a244a06d6eff230",227:"ae93e62e09fd4d381d07",228:"7199af50db1889e64674",229:"7a0284ae7edfa27eb8a1",230:"0bb6a234f58aa0292b27",231:"44184334c449093e8bd5",232:"5a8fdf0f56be1ae7cc82",233:"d6ef0f5bb2b6375bd52f",234:"d92bb857de797a88568d",235:"1182f064fb17ad3f55d1",236:"e02945b2d1d0df0767c1",237:"377279922b3917eb2125",238:"dbeb2c0bf3dccf39339b",239:"0a1f73752b264dac81bc",240:"1b54faa50b31417d2f88",241:"f310da64207459ef9783",242:"45b778b3f009c4452c9c",243:"346e95777db9de77b961",244:"6206f3d38435ed2628b0",245:"9f1ee72fb5685a09b5ce",246:"c8b41d4b12b1250e01ed",247:"4fa66016aa5ff6e16c62",248:"52d55fe0eb40f61b84ae",249:"0dc4ef683ef448f47071",250:"ad498a8076662df1ed87",251:"4389580a9b6ad391f7ea",252:"989968f359ff28661112",253:"930cda0de4ec25344bff",254:"3cd9168033a2738f3f44",255:"8c3cb609bff3071086f1",256:"5eca204d8e9d6d87718f",257:"3e58003f93448a66656c",258:"694cdb5288787f1ab556",259:"8bf0cefba97d8db8e89d",260:"db455f2124cbe43df61c",261:"01d68aa8402ef6ac3a38",262:"070d2da14cc399e0fbe2",263:"9313cb2696d2d844849a",264:"bc7ad7396bfced9e76ef",265:"ffbab37e1a761ec07b60",266:"6b132ba2f789d8526651",267:"e5a991bca7af2dae32f2",268:"4f0027e04b2306b5b145",269:"fd77d482f3b691e657b5",270:"4ccea89d95972bf06d46",271:"57cac2aa90c6b4409f51",272:"b82b50ecf4690e81c2c2",273:"532af8c0707be80576a4",274:"9e29d76ce7a1be779fe2",275:"ce60e0192ef397d1ace5",276:"45fefc7b280813ae36bb",277:"f9f3f939d42dafa0132e",278:"cb607e682e4be8e27391",279:"db27b4c91dcfae19b04a",280:"5b5b749582fc0050c610",281:"2aabd12417ae1776c20e",282:"ef9e59ca04b06b0eaef1",283:"befda4d5125de75641bf",284:"88f9a16e760e9b86b865",285:"ab7ac149558c8843254d",286:"d931585880dca08bb27e",287:"c2eb031b548dd4deb215",288:"942d138e6c489a3ff6df",289:"1e79a9c9edb6c56476f8",290:"517ab37a8c0de7b3af9f",291:"d1e236ef28b2c5c64c9e",292:"5a049771b8c51d82bdc7",293:"35cf89ffdbbcab6c39de",294:"2a1411eecc17666cbca6",295:"495163add3be67d633b4",296:"c643d2f766a5e19ef316",297:"cfc9fd71cb90da7d9ad8",298:"9abe230dbd547540baa9",299:"13d9fcb2746299b2cccd",300:"7fa1cf702fb012e88292",301:"5b6724dff0b9fa6ffe93",302:"9e008d753a24f66797ac",303:"04c8ea940f7ea50f4787",304:"25529744adc171f1ee77",305:"a8d9976af0733f471e1f",306:"32fe0bf8c37035e9b2bd",307:"99dec37cee341acf70d6",308:"50a694a6ac092fea0656",309:"cc64e7fe51dd9faef5d7",310:"3647e80760d668675ec1",311:"e4dd0761d643b0533805",312:"7c863feab62cf935d19e",313:"0e73a4c07b6dcf0351ed",314:"8b11058345b52a72fe52",315:"ccada1349bfe2c59f63b",316:"147f00883d84bf5e551d",317:"6595255061ec1694d10d",318:"ca60d8eb371b56560d60",319:"6ee5e4d0efbb256ad040",320:"5cb0f10abd3ca266298e",321:"b2225ed87bce75044077",322:"7964057b3dbdd79e7d31",323:"789854aa44560f08d158",324:"ef9f4010ab90a58728e9",325:"c1fb26582d92bc4a4686",326:"35ee73809e64046f837f",327:"c823e5c04a186ee2fd37",328:"b769a2c7965fcc07d289",329:"ccffb4cead5fe116e078",330:"f66ff693ab2f86440650",331:"c8aaceadf7bf82736637",334:"f7aca98ec592b128480d",336:"2cbb090142d0f660c954",337:"014fd388adffc114eb88",338:"cbca1409cc7dcfabd821",339:"976424dc4e61c71baf0a",340:"3d91ada70ed743803074",341:"4f2fa70e7d84c61b61f4",342:"cead059cad2a860fb1db",343:"e15cff6790cdbab9d204",344:"0a873d26b2a01a5f1866",345:"c53b7c7154d30ef9feff",346:"756a50cb054b84784186",347:"a9eaba86b47ca774322d",348:"b09b5350639beca8034e",349:"e4388a9c2fb225261610",350:"743e15164a802eef5295",351:"33cf5fbc2c8f9cb70cd1",352:"ea0f727020e21034690a",353:"e34015e1551c88a662f8",354:"474aa50f195477e48af9",355:"6e04ea8b6982891baefc",356:"3c747aa35b11885f2937",357:"603fceaaeb0992019407",358:"5398b6635b1fc42b581a",359:"a2f8d884c46015ae98ed",360:"40b2c9f3610b0f8dea80",361:"91ac80c8c5586b0546a5",362:"3ae9485bedf4b48c0201",363:"35ee68fdacf2d36fe569",364:"ee3f75fb476c400dd893",365:"6df695ba1c5570d24dfd",366:"03ef7f104bbf1dcf1a39",367:"8d4d854d9a42398bc4df",368:"bb46f4e3531908f5c536",369:"4fb104365f3e7d0fe512",370:"6b222462bf25ea8a1d66",371:"a84b2e610902547a24e1",372:"aa0c80dcf8584c7fb4e1",373:"a6204f2ef47d96bdb70a",374:"565d48a9d6ad06f8d638",375:"5da32048c6666acb6d24",376:"3aa9d0e50220f7cab5b5",377:"6b9d4dc526b516345d2c",378:"317e1836d8a371279305",379:"22f051de50e3377031d0",380:"afb9b0790c9d5a1a6e37",381:"5c28be3ac1d70c931edd",382:"9d17db8a74617c021673",383:"6547e4c73da20a99eb96",384:"8ea0f1530d6276dc2fb0",385:"30613ef6e2d6ea3852e7",386:"ae6642f1a910209553cd",387:"82f79bdfeb1152559c31",388:"3a288c51aa6357dad1b8",389:"1cde3ac2c4ac86795a4b",390:"99908f8cc7aaaca470b0",391:"45bf699afe7aba531cd9",392:"93cb8d0e136f13f0c6cc",393:"57307cbf3eefdaa6233b",394:"15bdf1c52dfb625b9ce2",395:"cbb92d22eb72134dc64a",396:"d9a6641fe95c6de56557",397:"afa84a2d73f7152b15bc",398:"332d23517bbb0760b87e",399:"e63483e40127148a955b",400:"190ffcbe126f17bb59ad",401:"a74c90fffdd47194cd9b",402:"16881388825d83269379",403:"61a61ce1c12385533859",404:"b53dc0ad0aaedcf3f809",405:"eb8906e00f241da08275",406:"48298a2b9c49b99170f8",407:"56a20539c08f5d616640",408:"d732c16fc17081351f19",409:"72d548b44e2f1c414a24",410:"df9406357dc52e98d0c4",411:"3a8907f7c02b1e9581e2",412:"5feece7f4c5164d2eadb",413:"69a029fbf3ac69f922c8",414:"28d014cade9786b6020b",415:"f0379e831fa183d12aea",416:"fa9dd5bcaa27a56007a2",417:"13389f7b162ed8a66af9",418:"6c11339b6aacf2351050"}[e]+".bundle.js"}(e);var l=new Error;s=function(t){a.onerror=a.onload=null,clearTimeout(u);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;l.message="Loading chunk "+e+" failed.\n("+i+": "+o+")",l.name="ChunkLoadError",l.type=i,l.request=o,n[1](l)}r[e]=void 0}};var u=setTimeout((function(){s({type:"timeout",target:a})}),12e4);a.onerror=a.onload=s,document.head.appendChild(a)}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||[],s=o.push.bind(o);o.push=t,o=o.slice();for(var a=0;a<o.length;a++)t(o[a]);var l=s;i(i.s=0)}({0:function(e,t,n){"use strict";n.r(t),n.d(t,"decodeHTML",(function(){return a}));n(9),n(58),n(71),n(449),n(85),n(450),n(52),n(53),n(72),n(73),n(74),n(75),n(76),n(77),n(78),n(80),n(81),n(82);var r=n(45);const i=(e,t)=>"undefined"==typeof window?Promise.resolve():Object(r.f)().then(()=>Object(r.b)([["ontotext-download-as",[[0,"ontotext-download-as",{translationService:[16],nameLabelKey:[1,"name-label-key"],tooltipLabelKey:[1,"tooltip-label-key"],items:[16],pluginName:[1,"plugin-name"],query:[1],infer:[4],sameAs:[4,"same-as"]}]]],["keyboard-shortcuts-dialog",[[0,"keyboard-shortcuts-dialog",{items:[16],translationService:[16],open:[32]},[[8,"keydown","keydownListener"]]]]],["alert-box",[[0,"alert-box",{type:[1],message:[1],noIcon:[4,"no-icon"],noButton:[4,"no-button"],isVisible:[32]}]]],["copy-resource-link-button",[[0,"copy-resource-link-button",{uri:[1],classes:[1]}]]],["loader-component",[[1,"loader-component",{timeFormattingService:[16],showQueryProgress:[4,"show-query-progress"],message:[1],additionalMessage:[1,"additional-message"],size:[1],hidden:[4],queryProgress:[32]}]]],["ontotext-editable-text-field",[[0,"ontotext-editable-text-field",{value:[1025],edit:[1028],translationService:[16]},[[8,"click","handleClickOutside"],[4,"keydown","keydownListener"]]]]],["ontotext-pagination",[[0,"ontotext-pagination",{pageNumber:[2,"page-number"],pageSize:[2,"page-size"],totalElements:[2,"total-elements"],pageElements:[2,"page-elements"],hasMorePages:[4,"has-more-pages"]}]]],["confirmation-dialog_9",[[0,"ontotext-yasgui",{config:[16],language:[1],savedQueryConfig:[16],saveQueryData:[32],savedQueryData:[32],deleteQueryData:[32],isVerticalOrientation:[32],renderingMode:[32],showSaveQueryDialog:[32],showSavedQueriesPopup:[32],showSavedQueriesPopupTarget:[32],showConfirmationDialog:[32],showShareQueryDialog:[32],showCopyResourceLinkDialog:[32],copiedResourceLink:[32],loaderMessage:[32],additionalLoaderMessage:[32],yasqeBtnLabel:[32],yasguiBtnLabel:[32],yasrBtnLabel:[32],changeRenderMode:[64],setQuery:[64],query:[64],getQuery:[64],isQueryValid:[64],openTab:[64],getQueryMode:[64],getQueryType:[64],getEmbeddedResultAsJson:[64],getEmbeddedResultAsCSV:[64],hideYasqeActionButton:[64],showYasqeActionButton:[64],getOngoingRequestsInfo:[64],abortQuery:[64],abortAllRequests:[64],reInitYasgui:[64],isQueryDirty:[64]},[[9,"resize","onResize"],[8,"beforeunload","onBeforeunloadHandler"],[0,"internalCreateSavedQueryEvent","saveQueryHandler"],[0,"internalSaveQueryEvent","createSavedQueryHandler"],[0,"internalUpdateQueryEvent","updateSavedQueryHandler"],[0,"internalSaveQueryDialogClosedEvent","closeSaveDialogHandler"],[0,"internalShowSavedQueriesEvent","showSavedQueriesHandler"],[0,"internalSaveQuerySelectedEvent","savedQuerySelectedHandler"],[0,"internalEditSavedQueryEvent","editSavedQueryHandler"],[0,"internalSavedQuerySelectedForDeleteEvent","savedQuerySelectedForEditHandler"],[0,"internalConfirmationApprovedEvent","deleteSavedQueryHandler"],[0,"internalConfirmationRejectedEvent","closeSavedQueryDeleteConfirmationHandler"],[0,"internalCloseSavedQueriesPopupEvent","closeSavedQueriesPopupHandler"],[0,"internalSavedQuerySelectedForShareEvent","savedQuerySelectedForShareHandler"],[0,"internalShareQueryEvent","shareQueryHandler"],[0,"internalQueryShareLinkCopiedEvent","savedQueryShareLinkCopiedHandler"],[0,"internalShareQueryDialogClosedEvent","closeShareQueryDialogHandler"],[0,"internalResourceLinkDialogClosedEvent","resourceLinkDialogClosedHandler"],[0,"internalResourceLinkCopiedEvent","resourceLinkCopiedHandler"],[0,"internalShowResourceCopyLinkDialogEvent","showResourceCopyLinkDialogHandler"],[0,"internalDownloadAsEvent","onDownloadAsEventHandler"],[0,"internalNotificationMessageEvent","notificationMessageHandler"],[0,"internalQueryEvent","onQuery"],[0,"internalQueryExecuted","onInternalQueryExecuted"],[0,"internalCountQueryEvent","onCountQuery"],[0,"internalCountQueryResponseEvent","onCountQueryResponse"],[0,"internalRequestAbortedEvent","onQueryAborted"]]],[0,"copy-resource-link-dialog",{serviceFactory:[16],resourceLink:[1,"resource-link"]}],[0,"share-query-dialog",{config:[16],serviceFactory:[16]}],[0,"save-query-dialog",{serviceFactory:[16],data:[16],queryName:[32],originalQueryName:[32],query:[32],isPublic:[32],isNew:[32],isSaveAllowed:[32]},[[8,"keydown","keydownListener"]]],[0,"confirmation-dialog",{translationService:[16],config:[16]},[[8,"keydown","keydownListener"]]],[0,"saved-queries-popup",{config:[16],serviceFactory:[16]},[[8,"click","onWindowResize"],[8,"keydown","keydownListener"]]],[0,"copy-link-dialog",{config:[16],serviceFactory:[16],copyLinkEventsObserver:[16],classes:[1]}],[4,"yasgui-tooltip",{dataTooltip:[1,"data-tooltip"],placement:[1],showOnClick:[4,"show-on-click"]}],[4,"ontotext-dialog-web-component",{config:[16]},[[4,"keydown","keydownListener"]]]]],["ontotext-dropdown",[[0,"ontotext-dropdown",{translationService:[16],nameLabelKey:[1,"name-label-key"],tooltipLabelKey:[1,"tooltip-label-key"],items:[16],iconClass:[1,"icon-class"],open:[32],showTooltip:[32]},[[8,"keydown","keydownListener"],[8,"click","mouseClickListener"]]]]]],t));!function(){if("undefined"!=typeof window&&void 0!==window.Reflect&&void 0!==window.customElements){var e=HTMLElement;window.HTMLElement=function(){return Reflect.construct(e,[],this.constructor)},HTMLElement.prototype=e.prototype,HTMLElement.prototype.constructor=HTMLElement,Object.setPrototypeOf(HTMLElement,e)}}();var o=n(31),s=n(14);const a=function(e){let t=document.createElement("textarea");return t.innerHTML=e,t.value},l=["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.copytoclipboard.copytoclipboard","graphdb.framework.core.directives.angular-tooltips","graphdb.framework.core.directives.uppercased","graphdb.framework.core.directives.prop-indeterminate","graphdb.framework.core.directives.page-info-tooltip","graphdb.framework.guides.services","graphdb.framework.core.directives.operationsstatusesmonitor","graphdb.framework.core.directives.autocomplete","ngCustomElement","graphdb.framework.core.services.language-service","graphdb.framework.core.filters.bytes"],u=["$routeProvider","$locationProvider","$menuItemsProvider","toastrConfig","localStorageServiceProvider","$uibTooltipProvider","$httpProvider","$templateRequestProvider","$translateProvider","$languageServiceProvider"];function c(e){return $.getJSON(`i18n/locale-${e}.json?v=2.8.9-TR1`).then((function(t){return{language:e,data:t}})).fail((function(){return console.error("Failed to load translation file for: "+e),null}))}function h(e){$.get("rest/info/version?local=1",(function(t){const r=t.productVersion.match(/^(\d+\.\d+)/);r.length?t.productShortVersion=r[1]:t.productShortVersion=t.productVersion;const c=t.productVersion.match(/(-.*?)(-|$)/);c&&c.length&&(t.productShortVersion=t.productShortVersion+c[1]),function(e,t){i();const r=angular.module("graphdb.workbench",l);r.config([...u,function(r,i,o,s,a,l,u,c,h,p){t&&Object.keys(t).length>0?Object.keys(t).forEach(e=>{h.translations(e,t[e])}):(h.useStaticFilesLoader({prefix:"i18n/locale-",suffix:".json?v=2.8.9-TR1"}),h.preferredLanguage(p.getDefaultLanguage())),h.useSanitizeValueStrategy("escape"),angular.extend(s,{timeOut:5e3,positionClass:"toast-bottom-right",tapToDismiss:!1,extendedTimeOut:5e3}),a.setStorageType("localStorage").setNotify(!0,!0);const d=r.$get[r.$get.length-1]({$on:function(){}});r.when("_openid_implicit_",{controller:function(){},template:"<div></div>"}),d.routes._openid_implicit_.regexp=/[&/](?:id_token=.*&access_token=|access_token=.*&id_token=)/;let f=PluginRegistry.get("route");angular.forEach(f,(function(e){r.when(e.url,{controller:e.controller,templateUrl:e.templateUrl,title:e.title,helpInfo:e.helpInfo,documentationUrl:e.documentationUrl,reloadOnSearch:void 0===e.reloadOnSearch||e.reloadOnSearch,resolve:{preload:["$ocLazyLoad","$q",function(t,r){return e.path?n(452)("./"+e.path).then(n=>{t.inject(e.module)}):r.defer().resolve()}]}})})),r.otherwise({templateUrl:"pages/not_found.html"}),i.html5Mode(!0),l.setTriggers({show:"hide"}),l.options({appendToBody:!0}),o.setProductInfo(e),PluginRegistry.get("main.menu").forEach((function(e){e.items.forEach((function(e){o.addItem(e)}))})),u.interceptors.push("$unauthorizedInterceptor"),u.interceptors.push("$authenticationInterceptor");const g=c.$get[3];"function"==typeof g&&(c.$get[3]=function(e,t,n){const r=g(e,t,n);return function(t,n){return e.get(t)||(t+="?v=2.8.9-TR1"),r(t,n)}})}]),r.constant("productInfo",e),r.run(["$rootScope","$route","toastr","$sce","$translate","ThemeService","WorkbenchSettingsStorageService","LSKeys","GuidesService",function(t,n,r,i,o,l,u,c,h){function p(){n.current.title?document.title=a(o.instant(n.current.title))+" | GraphDB Workbench":document.title="GraphDB Workbench",t.helpInfo=n.current.helpInfo&&i.trustAsHtml(a(o.instant(n.current.helpInfo))),t.title=a(o.instant(n.current.title)),t.documentationUrl=s.DocumentationUrlResolver.getDocumentationUrl(e.productShortVersion,n.current.documentationUrl)}t.$on("$routeChangeSuccess",(function(){p(),r.clear()})),t.$on("$translateChangeSuccess",(function(){p()}));const d=u.getThemeName();l.applyTheme(d),l.applyDarkThemeMode(),h.init()}]),r.filter("titlecase",(function(){return function(e){const t=""+e;return t.charAt(0).toUpperCase()+t.slice(1)}})),r.filter("prettyJSON",()=>e=>angular.toJson(e,!0)),r.filter("humanReadableSize",()=>e=>Object(o.convertToHumanReadable)(e)),r.filter("trustAsHtml",["$translate","$sce",(e,t)=>e=>t.trustAsHtml(a(e))]),angular.bootstrap(document,["graphdb.workbench"])}(t,e)}))}!function(){const e=[{key:"en",name:"English"},{key:"fr",name:"Français"}].map(e=>e.key).map(c),t={};Promise.all(e).then(e=>{e.forEach(e=>{e&&(t[e.language]=e.data)}),h(t)}).catch(()=>{console.error("Failed to load one or more translation files."),h(t)})}()},1: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"}},10:function(e,t,n){"use strict";n.r(t),n.d(t,"RepositoryInfoModel",(function(){return r})),n.d(t,"RepositoryConfigModel",(function(){return i})),n.d(t,"RepositoryParams",(function(){return o})),n.d(t,"RepositoryParam",(function(){return s})),n.d(t,"REPOSITORY_PARAMS",(function(){return a}));class r{constructor(e={}){this._id=e.id,this._title=e.title,this._type=e.type,this._sesameType=e.sesameType,this._uri=e.uri,this._externalUrl=e.externalUrl,this._location=e.location,this._state=e.state,this._local=e.local,this._readable=e.readable,this._writable=e.writable,this._unsupported=e.unsupported}get id(){return this._id}set id(e){this._id=e}get title(){return this._title}set title(e){this._title=e}get type(){return this._type}set type(e){this._type=e}get sesameType(){return this._sesameType}set sesameType(e){this._sesameType=e}get uri(){return this._uri}set uri(e){this._uri=e}get externalUrl(){return this._externalUrl}set externalUrl(e){this._externalUrl=e}get location(){return this._location}set location(e){this._location=e}get state(){return this._state}set state(e){this._state=e}get local(){return this._local}set local(e){this._local=e}get readable(){return this._readable}set readable(e){this._readable=e}get writable(){return this._writable}set writable(e){this._writable=e}get unsupported(){return this._unsupported}set unsupported(e){this._unsupported=e}}class i{constructor(e={}){this._id=e.id,this._title=e.title,this._type=e.type,this._sesameType=e.sesameType,this._location=e.location,this._params=e.params}getParam(e){return this._params.getParam(e)}getParamValue(e){return this._params.getParamValue(e)}get id(){return this._id}set id(e){this._id=e}get title(){return this._title}set title(e){this._title=e}get type(){return this._type}set type(e){this._type=e}get sesameType(){return this._sesameType}set sesameType(e){this._sesameType=e}get location(){return this._location}set location(e){this._location=e}get params(){return this._params}set params(e){this._params=e}}class o{constructor(e={}){this._params=e}get params(){return this._params}set params(e){this._params=e}addParam(e){this._params[e.name]=e}getParam(e){return this._params[e]}getParamValue(e){if(this._params[e])return this._params[e].getValue()}}class s{constructor(e={}){this._name=e.name,this._label=e.label,this._value=e.value}getValue(){return"true"===this._value||"false"!==this._value&&(isNaN(this._value)?this._value:Number(this._value))}get name(){return this._name}set name(e){this._name=e}get label(){return this._label}set label(e){this._label=e}get value(){return this._value}set value(e){this._value=e}}const a={queryTimeout:"queryTimeout",cacheSelectNodes:"cacheSelectNodes",rdfsSubClassReasoning:"rdfsSubClassReasoning",validationEnabled:"validationEnabled",ftsStringLiteralsIndex:"ftsStringLiteralsIndex",shapesGraph:"shapesGraph",parallelValidation:"parallelValidation",checkForInconsistencies:"checkForInconsistencies",performanceLogging:"performanceLogging",disableSameAs:"disableSameAs",ftsIrisIndex:"ftsIrisIndex",entityIndexSize:"entityIndexSize",dashDataShapes:"dashDataShapes",queryLimitResults:"queryLimitResults",throwQueryEvaluationExceptionOnTimeout:"throwQueryEvaluationExceptionOnTimeout",member:"member",storageFolder:"storageFolder",validationResultsLimitPerConstraint:"validationResultsLimitPerConstraint",enablePredicateList:"enablePredicateList",transactionalValidationLimit:"transactionalValidationLimit",ftsIndexes:"ftsIndexes",logValidationPlans:"logValidationPlans",imports:"imports",isShacl:"isShacl",inMemoryLiteralProperties:"inMemoryLiteralProperties",ruleset:"ruleset",readOnly:"readOnly",enableLiteralIndex:"enableLiteralIndex",enableFtsIndex:"enableFtsIndex",defaultNS:"defaultNS",enableContextIndex:"enableContextIndex",baseURL:"baseURL",logValidationViolations:"logValidationViolations",globalLogValidationExecution:"globalLogValidationExecution",entityIdSize:"entityIdSize",repositoryType:"repositoryType",eclipseRdf4jShaclExtensions:"eclipseRdf4jShaclExtensions",validationResultsLimitTotal:"validationResultsLimitTotal"}},11: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=""}}},12: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"}},13: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",JSONLD_EXPORT_SETTINGS:"jsonld-export-settings",IMPORT_VIEW:"import-view",SPARQL_LAST_REPO:"sparql-last-repo",TTYG:"ttyg"}),n.$inject=["localStorageService","LSKeys"]},14:function(e,t,n){"use strict";n.r(t),n.d(t,"DocumentationUrlResolver",(function(){return r}));class r{static getDocumentationUrl(e,t){if(!t)return;const n=e.includes("-");return`https://graphdb.ontotext.com/documentation/${window.wbDevMode||n?"master":e}/${t}`}}},15: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},16:function(e,t,n){"use strict";n.r(t),n.d(t,"QueryMode",(function(){return r}));const r={UPDATE:"update",QUERY:"query"}},17:function(e,t,n){"use strict";n.r(t),n.d(t,"GUIDE_ID",(function(){return un})),n.d(t,"GUIDE_CURRENT_STEP_ID",(function(){return cn})),n.d(t,"GUIDE_STEP_HISTORY",(function(){return hn})),n.d(t,"GUIDE_PAUSE",(function(){return pn}));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)};
|
|
1
|
+
!function(e){function t(t){for(var n,i,o=t[0],s=t[1],a=0,u=[];a<o.length;a++)i=o[a],Object.prototype.hasOwnProperty.call(r,i)&&r[i]&&u.push(r[i][0]),r[i]=0;for(n in s)Object.prototype.hasOwnProperty.call(s,n)&&(e[n]=s[n]);for(l&&l(t);u.length;)u.shift()()}var n={},r={332: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 s,a=document.createElement("script");a.charset="utf-8",a.timeout=120,i.nc&&a.setAttribute("nonce",i.nc),a.src=function(e){return i.p+""+({334:"polyfills-dom",336:"vendors~polyfills-core-js"}[e]||e)+"."+{0:"e4f092fe2c6dd778826e",1:"e7e081fc336681c8215f",2:"3837bd63288e2a826720",3:"f26cefadb24ee2836b8a",4:"8e31e4907beb1d7fdba4",5:"e58201eecd39fe89e5e9",6:"73f6adae3ab11729ebf2",7:"c7a405d7dc99c9ebee48",8:"18ec3a5b3f95a7965e71",9:"d57134d0b4eb2e6f4ee6",10:"d8d48ce0ca42085e7864",11:"21d536c0dd250f396264",12:"ed4bc07d06db664a8a2c",13:"49bf149227b1a2f915a6",14:"345e027a365e41418f3b",15:"2eabfe524e0689eb26e9",16:"0ead6802df331f763762",17:"bcc91ddb954e2e1ee5a2",18:"a4b27592c1b39f2b754b",19:"33b6dc6ba1cea3b94465",20:"204efddc3b65e3417f98",21:"bf90c5dbc6751926b09f",22:"b7955e1f4766f2c32ff6",23:"b57e6b08f36eaa6cfa1c",24:"77404fb1a29f7448cfa9",25:"fd2151cfa79bb46e568e",26:"b4cf5132c870052d06f3",27:"af756f3e9a79334cb6f9",28:"f64cabb9e00e2f08ed6a",29:"073b9b1176718648e438",30:"3530af7acf6dd4af07b4",31:"19f116ce71f83ce6c3df",32:"3649b0fc7e7136790d43",33:"d4864cfbed6bb7c30c95",34:"4a17e8b0f3f203963d5e",35:"2920265e8348ab78e718",36:"99a2c4a2393ff13ec514",37:"d519cb3af9d6205f0015",38:"23f902df4ed8fbfc7fcf",39:"171886987f5ef7d17208",40:"0937e585f9f5a7eaab82",41:"3b2afebd8ef778234327",42:"51a2b146401e3d3c44fd",43:"c3b8fc48a5d69126ff55",44:"0b6f6369f9c157f2243c",45:"5ce107618d1464a08a0b",46:"5baa02d0ce0f4e4bec79",47:"c7898dbc38a6a6e9321b",48:"4a5b02907ad2d1a2792f",49:"143329d875c1714aec89",50:"385486fe0efbefd5dfa9",51:"9f3c96f8a93b54423852",52:"ff20925f8f7656382d7b",53:"e286cd8cfb636fcec996",54:"326b8c0143c463fc8e2d",55:"4009a0d60dea722c108d",56:"a581f6f1ded6a4d3d08b",57:"aa39c7d23ece602d952f",58:"fad69b0e6153a06c83b7",59:"84e7285984168a313d36",60:"ad49b739e4b8f2cdbce7",61:"ee14d8cda3708fe9c287",62:"092aacacd064526783c0",63:"9537a1fd0366d5518114",64:"1dd28ef2f60fe1ba23a5",65:"4c0218d3ba1faae1f6ad",66:"2a2d9bf0e595ca627c78",67:"a4e87ab3032de83a0d71",68:"66efe1b03756e3052e35",69:"fd10e482a3491294f900",70:"38ae428de620fbf7602d",71:"e18795e8eaed8f747ce5",72:"a53c1a358c3335c3eaa1",73:"d442bfb6f448e72c5bce",74:"05569d4f46a43d6d56e4",75:"e226c0d22ed7ff1b57ee",76:"afa96077de497c981882",77:"9fa02265d836024fdf79",78:"9f81b2060ae650976ae7",79:"3fc17aa270c5a6477e9c",80:"7de02802c242d6cf125c",81:"66b9a961188d712b1d48",82:"8c402a2cedd2441c3f3c",83:"15cd8f06607b23e5e901",84:"825f8eaa43e71f73f25d",85:"00ce4d8f4433d87bf54e",86:"ffeb1acd50a34948e089",87:"9ac37a1a4a11ef7dfbac",88:"5b052707f2cd26eb7890",89:"76461444a1cb2b2e1114",90:"7934551daab93be805ba",91:"de9fe730d2b00227b9d4",92:"f4a3984a912edbb06838",93:"e22a88d63bd4fc5f616c",94:"f731de3062bce3990e2f",95:"5fdf43bda2882304ace9",96:"21c753d787869238e5ed",97:"13cd4feb8916c17b8b20",98:"6379c1708e09a721cc36",99:"bfe2ea3e30bb6b0e9045",100:"bf4a4f519b81c43fafc1",101:"444ee8c4ad450a80c227",102:"ec42287cf6022b9eb02f",103:"82c4dfa967a6f2407f11",104:"cb138bb3b878e001e32f",105:"8c2014a729e3e29b78ae",106:"4aa823fde540a06e4083",107:"09c059b73119d06600c0",108:"3c5b6b3268b21218a7a5",109:"57128c0d6212e0a46ad3",110:"af42819ef3cf70e39b25",111:"f548b124aab10b4b1c9e",112:"f754348fe5d0086f677e",113:"d7c1a18d18713eece29a",114:"f719039be05fc7b214c5",115:"8dab67853260483ced85",116:"ed2bb3fba38737cd21a2",117:"8dc1a253f70f4727c027",118:"d197d3c97039ee68643d",119:"ee1dd79fb171af44577c",120:"e25b821b13d853a321b5",121:"45b40da06cc7a71ae79f",122:"4e50eaaadaf3dd57b2b2",123:"2cc29edc9b32fcc35a5c",124:"5bf5f52df172c58b05d0",125:"53a564a1540cfbe90d0a",126:"dc613e6d7c178aa1f71d",127:"aef2e7fa7136b5fb20dc",128:"c47682ae8c6f4827775e",129:"79a97fa0c54c52a26f86",130:"b2fbf4becf6abfef7f86",131:"b91d9c1e4e18cae45b48",132:"f0f88aa3d524eb65ed01",133:"0ade4a762acb81e53b90",134:"c9ab770ded23a2c5394f",135:"a9fc7400422a5a15a95f",136:"3b7b30e23a57edaccaad",137:"c208d1c1ff8b57ca0e07",138:"fbb7ba3aefaa937cc1cf",139:"06c1f3e7dac66dac111e",140:"0824cff78d35896e19a1",141:"b7bb9f43c5524306aece",142:"1c995d2d6a5b035dee20",143:"c11427b27ba48bb4eb8c",144:"fd03637814946fba8e77",145:"4d5cb0b2e88e2a2e8c11",146:"a0a2b0a47fa6363c2be0",147:"c36da2d34dcc3b24d279",148:"81254fa8e58524a4f382",149:"e0a2f7c249981cc8cbdf",150:"310ed39bfee5ae48639d",151:"2341ca71acf310459c66",152:"37839e214172baad9eb1",153:"e288bacab5979453fcaa",154:"eb1c8c88087e946c02cf",155:"5669db0185599c1d8a37",156:"672940a4c43b7f710222",157:"45cd4adf0ccbdf3d47a8",158:"8273c2a84a31a6bee142",159:"7603d8bc47da595509a1",160:"9df03bd5ab91e27a7e3c",161:"58bcd557ce48085da808",162:"15a4b6172e89f7b7ae1a",163:"0a5338548560675f8ade",164:"444390bcc9c803e5ed40",165:"2d117281b8d75e757857",166:"a1475cbce66e0f0d9d77",167:"f49aab7e2a752fe09552",168:"38dbbebd88da57b3ae35",169:"b70f377d971b22436caf",170:"3b351d80184f48188735",171:"dcc8a70fc588401dbcae",172:"8d07797d81d91082ba8c",173:"69c540206c7d83104573",174:"27c77b5acc6891f63cee",175:"5dc77ecf6fab73e58bef",176:"1e97c2917a2230b48034",177:"578be747179dded9efbe",178:"39194cac07f730f69ef5",179:"043ab520b38554c7c4b6",180:"99c0cbb3df5d8f02659b",181:"8ce5807790f369361dbe",182:"e2dc2fc0469127bc30e3",183:"53e87e91190814612b6e",184:"1e29f185ce7f4f0afa5b",185:"5cd3ba499f59bf192716",186:"d2a7c6668b2f2198549a",187:"157fca1e6a2de45af9df",188:"7b78edb347746c46c1c8",189:"67fa66494b765760f7d2",190:"a56d19c53932ffa08f62",191:"39fc9dd01a00a890af07",192:"a238bb9bb9a833ef304b",193:"4c02ced7a1c44850598f",194:"155e5407310bb237964c",195:"447cc0c6ffaa7e09b7bd",196:"dcbed94c0db3a8e343aa",197:"2a0f5d280127e30e6a21",198:"568088e342b26f534c8f",199:"c9eab91c2468753f4aaa",200:"6eee537413665b02c23f",201:"ecd6f5a0b1e07259609b",202:"61f0f819d7cf434a37fa",203:"adf24a2f61f47acf0e2c",204:"e738c49199032f3437e4",205:"0b3022045ba8ccfcbaa5",206:"7f16c0fcd5d65d82f869",207:"665c2a55832b8bb43e13",208:"c653cb276b43b29cce49",209:"9d98bd83dfd06376c27b",210:"a2ea30efd2122d5a8f2f",211:"de53552e0b8e59e26d71",212:"f80d06d279d2dc0aae74",213:"10670e66798d5048d9ff",214:"dec32fead44db230069a",215:"67f2b0c7907ac843f67b",216:"66ff59c70033249c5158",217:"57a8407776a632ad45ff",218:"c9ebeca0a0601cbfdd49",219:"49b7f67206dc1b550fcd",220:"60aae5815d2081a0e83a",221:"9ddd6a25f2977a63833b",222:"ca41fa6721e4e66ed399",223:"54c4cac06e4519e3efb0",224:"f7199477314a1768db47",225:"6a3fe206268377dad69d",226:"914d0a244a06d6eff230",227:"ae93e62e09fd4d381d07",228:"7199af50db1889e64674",229:"7a0284ae7edfa27eb8a1",230:"0bb6a234f58aa0292b27",231:"44184334c449093e8bd5",232:"5a8fdf0f56be1ae7cc82",233:"d6ef0f5bb2b6375bd52f",234:"d92bb857de797a88568d",235:"1182f064fb17ad3f55d1",236:"e02945b2d1d0df0767c1",237:"377279922b3917eb2125",238:"dbeb2c0bf3dccf39339b",239:"0a1f73752b264dac81bc",240:"1b54faa50b31417d2f88",241:"f310da64207459ef9783",242:"45b778b3f009c4452c9c",243:"346e95777db9de77b961",244:"6206f3d38435ed2628b0",245:"9f1ee72fb5685a09b5ce",246:"c8b41d4b12b1250e01ed",247:"4fa66016aa5ff6e16c62",248:"52d55fe0eb40f61b84ae",249:"0dc4ef683ef448f47071",250:"ad498a8076662df1ed87",251:"4389580a9b6ad391f7ea",252:"989968f359ff28661112",253:"930cda0de4ec25344bff",254:"3cd9168033a2738f3f44",255:"8c3cb609bff3071086f1",256:"5eca204d8e9d6d87718f",257:"3e58003f93448a66656c",258:"694cdb5288787f1ab556",259:"8bf0cefba97d8db8e89d",260:"db455f2124cbe43df61c",261:"01d68aa8402ef6ac3a38",262:"070d2da14cc399e0fbe2",263:"9313cb2696d2d844849a",264:"bc7ad7396bfced9e76ef",265:"ffbab37e1a761ec07b60",266:"6b132ba2f789d8526651",267:"e5a991bca7af2dae32f2",268:"4f0027e04b2306b5b145",269:"fd77d482f3b691e657b5",270:"4ccea89d95972bf06d46",271:"57cac2aa90c6b4409f51",272:"b82b50ecf4690e81c2c2",273:"532af8c0707be80576a4",274:"9e29d76ce7a1be779fe2",275:"ce60e0192ef397d1ace5",276:"45fefc7b280813ae36bb",277:"f9f3f939d42dafa0132e",278:"cb607e682e4be8e27391",279:"db27b4c91dcfae19b04a",280:"5b5b749582fc0050c610",281:"2aabd12417ae1776c20e",282:"ef9e59ca04b06b0eaef1",283:"befda4d5125de75641bf",284:"88f9a16e760e9b86b865",285:"ab7ac149558c8843254d",286:"d931585880dca08bb27e",287:"c2eb031b548dd4deb215",288:"942d138e6c489a3ff6df",289:"1e79a9c9edb6c56476f8",290:"517ab37a8c0de7b3af9f",291:"d1e236ef28b2c5c64c9e",292:"5a049771b8c51d82bdc7",293:"35cf89ffdbbcab6c39de",294:"2a1411eecc17666cbca6",295:"495163add3be67d633b4",296:"c643d2f766a5e19ef316",297:"cfc9fd71cb90da7d9ad8",298:"9abe230dbd547540baa9",299:"13d9fcb2746299b2cccd",300:"7fa1cf702fb012e88292",301:"5b6724dff0b9fa6ffe93",302:"9e008d753a24f66797ac",303:"04c8ea940f7ea50f4787",304:"25529744adc171f1ee77",305:"a8d9976af0733f471e1f",306:"32fe0bf8c37035e9b2bd",307:"99dec37cee341acf70d6",308:"50a694a6ac092fea0656",309:"cc64e7fe51dd9faef5d7",310:"3647e80760d668675ec1",311:"e4dd0761d643b0533805",312:"7c863feab62cf935d19e",313:"0e73a4c07b6dcf0351ed",314:"8b11058345b52a72fe52",315:"ccada1349bfe2c59f63b",316:"147f00883d84bf5e551d",317:"6595255061ec1694d10d",318:"ca60d8eb371b56560d60",319:"6ee5e4d0efbb256ad040",320:"5cb0f10abd3ca266298e",321:"b2225ed87bce75044077",322:"7964057b3dbdd79e7d31",323:"789854aa44560f08d158",324:"ef9f4010ab90a58728e9",325:"c1fb26582d92bc4a4686",326:"35ee73809e64046f837f",327:"c823e5c04a186ee2fd37",328:"b769a2c7965fcc07d289",329:"ccffb4cead5fe116e078",330:"f66ff693ab2f86440650",331:"c8aaceadf7bf82736637",334:"f7aca98ec592b128480d",336:"2cbb090142d0f660c954",337:"014fd388adffc114eb88",338:"cbca1409cc7dcfabd821",339:"976424dc4e61c71baf0a",340:"3d91ada70ed743803074",341:"4f2fa70e7d84c61b61f4",342:"cead059cad2a860fb1db",343:"e15cff6790cdbab9d204",344:"0a873d26b2a01a5f1866",345:"c53b7c7154d30ef9feff",346:"756a50cb054b84784186",347:"a9eaba86b47ca774322d",348:"b09b5350639beca8034e",349:"e4388a9c2fb225261610",350:"743e15164a802eef5295",351:"33cf5fbc2c8f9cb70cd1",352:"ea0f727020e21034690a",353:"e34015e1551c88a662f8",354:"474aa50f195477e48af9",355:"6e04ea8b6982891baefc",356:"3c747aa35b11885f2937",357:"603fceaaeb0992019407",358:"5398b6635b1fc42b581a",359:"a2f8d884c46015ae98ed",360:"40b2c9f3610b0f8dea80",361:"91ac80c8c5586b0546a5",362:"3ae9485bedf4b48c0201",363:"35ee68fdacf2d36fe569",364:"ee3f75fb476c400dd893",365:"6df695ba1c5570d24dfd",366:"03ef7f104bbf1dcf1a39",367:"8d4d854d9a42398bc4df",368:"bb46f4e3531908f5c536",369:"4fb104365f3e7d0fe512",370:"6b222462bf25ea8a1d66",371:"a84b2e610902547a24e1",372:"aa0c80dcf8584c7fb4e1",373:"a6204f2ef47d96bdb70a",374:"565d48a9d6ad06f8d638",375:"5da32048c6666acb6d24",376:"3aa9d0e50220f7cab5b5",377:"6b9d4dc526b516345d2c",378:"317e1836d8a371279305",379:"22f051de50e3377031d0",380:"afb9b0790c9d5a1a6e37",381:"5c28be3ac1d70c931edd",382:"9d17db8a74617c021673",383:"6547e4c73da20a99eb96",384:"8ea0f1530d6276dc2fb0",385:"30613ef6e2d6ea3852e7",386:"ae6642f1a910209553cd",387:"82f79bdfeb1152559c31",388:"3a288c51aa6357dad1b8",389:"1cde3ac2c4ac86795a4b",390:"99908f8cc7aaaca470b0",391:"45bf699afe7aba531cd9",392:"93cb8d0e136f13f0c6cc",393:"57307cbf3eefdaa6233b",394:"15bdf1c52dfb625b9ce2",395:"cbb92d22eb72134dc64a",396:"d9a6641fe95c6de56557",397:"afa84a2d73f7152b15bc",398:"332d23517bbb0760b87e",399:"e63483e40127148a955b",400:"190ffcbe126f17bb59ad",401:"a74c90fffdd47194cd9b",402:"16881388825d83269379",403:"61a61ce1c12385533859",404:"b53dc0ad0aaedcf3f809",405:"eb8906e00f241da08275",406:"48298a2b9c49b99170f8",407:"56a20539c08f5d616640",408:"d732c16fc17081351f19",409:"72d548b44e2f1c414a24",410:"df9406357dc52e98d0c4",411:"3a8907f7c02b1e9581e2",412:"5feece7f4c5164d2eadb",413:"69a029fbf3ac69f922c8",414:"28d014cade9786b6020b",415:"f0379e831fa183d12aea",416:"fa9dd5bcaa27a56007a2",417:"13389f7b162ed8a66af9",418:"6c11339b6aacf2351050"}[e]+".bundle.js"}(e);var l=new Error;s=function(t){a.onerror=a.onload=null,clearTimeout(u);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;l.message="Loading chunk "+e+" failed.\n("+i+": "+o+")",l.name="ChunkLoadError",l.type=i,l.request=o,n[1](l)}r[e]=void 0}};var u=setTimeout((function(){s({type:"timeout",target:a})}),12e4);a.onerror=a.onload=s,document.head.appendChild(a)}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||[],s=o.push.bind(o);o.push=t,o=o.slice();for(var a=0;a<o.length;a++)t(o[a]);var l=s;i(i.s=0)}({0:function(e,t,n){"use strict";n.r(t),n.d(t,"decodeHTML",(function(){return a}));n(9),n(58),n(71),n(449),n(85),n(450),n(52),n(53),n(72),n(73),n(74),n(75),n(76),n(77),n(78),n(80),n(81),n(82);var r=n(45);const i=(e,t)=>"undefined"==typeof window?Promise.resolve():Object(r.f)().then(()=>Object(r.b)([["ontotext-download-as",[[0,"ontotext-download-as",{translationService:[16],nameLabelKey:[1,"name-label-key"],tooltipLabelKey:[1,"tooltip-label-key"],items:[16],pluginName:[1,"plugin-name"],query:[1],infer:[4],sameAs:[4,"same-as"]}]]],["keyboard-shortcuts-dialog",[[0,"keyboard-shortcuts-dialog",{items:[16],translationService:[16],open:[32]},[[8,"keydown","keydownListener"]]]]],["alert-box",[[0,"alert-box",{type:[1],message:[1],noIcon:[4,"no-icon"],noButton:[4,"no-button"],isVisible:[32]}]]],["copy-resource-link-button",[[0,"copy-resource-link-button",{uri:[1],classes:[1]}]]],["loader-component",[[1,"loader-component",{timeFormattingService:[16],showQueryProgress:[4,"show-query-progress"],message:[1],additionalMessage:[1,"additional-message"],size:[1],hidden:[4],queryProgress:[32]}]]],["ontotext-editable-text-field",[[0,"ontotext-editable-text-field",{value:[1025],edit:[1028],translationService:[16]},[[8,"click","handleClickOutside"],[4,"keydown","keydownListener"]]]]],["ontotext-pagination",[[0,"ontotext-pagination",{pageNumber:[2,"page-number"],pageSize:[2,"page-size"],totalElements:[2,"total-elements"],pageElements:[2,"page-elements"],hasMorePages:[4,"has-more-pages"]}]]],["confirmation-dialog_9",[[0,"ontotext-yasgui",{config:[16],language:[1],savedQueryConfig:[16],saveQueryData:[32],savedQueryData:[32],deleteQueryData:[32],isVerticalOrientation:[32],renderingMode:[32],showSaveQueryDialog:[32],showSavedQueriesPopup:[32],showSavedQueriesPopupTarget:[32],showConfirmationDialog:[32],showShareQueryDialog:[32],showCopyResourceLinkDialog:[32],copiedResourceLink:[32],loaderMessage:[32],additionalLoaderMessage:[32],yasqeBtnLabel:[32],yasguiBtnLabel:[32],yasrBtnLabel:[32],changeRenderMode:[64],setQuery:[64],query:[64],getQuery:[64],isQueryValid:[64],openTab:[64],getQueryMode:[64],getQueryType:[64],getEmbeddedResultAsJson:[64],getEmbeddedResultAsCSV:[64],hideYasqeActionButton:[64],showYasqeActionButton:[64],getOngoingRequestsInfo:[64],abortQuery:[64],abortAllRequests:[64],reInitYasgui:[64],isQueryDirty:[64]},[[9,"resize","onResize"],[8,"beforeunload","onBeforeunloadHandler"],[0,"internalCreateSavedQueryEvent","saveQueryHandler"],[0,"internalSaveQueryEvent","createSavedQueryHandler"],[0,"internalUpdateQueryEvent","updateSavedQueryHandler"],[0,"internalSaveQueryDialogClosedEvent","closeSaveDialogHandler"],[0,"internalShowSavedQueriesEvent","showSavedQueriesHandler"],[0,"internalSaveQuerySelectedEvent","savedQuerySelectedHandler"],[0,"internalEditSavedQueryEvent","editSavedQueryHandler"],[0,"internalSavedQuerySelectedForDeleteEvent","savedQuerySelectedForEditHandler"],[0,"internalConfirmationApprovedEvent","deleteSavedQueryHandler"],[0,"internalConfirmationRejectedEvent","closeSavedQueryDeleteConfirmationHandler"],[0,"internalCloseSavedQueriesPopupEvent","closeSavedQueriesPopupHandler"],[0,"internalSavedQuerySelectedForShareEvent","savedQuerySelectedForShareHandler"],[0,"internalShareQueryEvent","shareQueryHandler"],[0,"internalQueryShareLinkCopiedEvent","savedQueryShareLinkCopiedHandler"],[0,"internalShareQueryDialogClosedEvent","closeShareQueryDialogHandler"],[0,"internalResourceLinkDialogClosedEvent","resourceLinkDialogClosedHandler"],[0,"internalResourceLinkCopiedEvent","resourceLinkCopiedHandler"],[0,"internalShowResourceCopyLinkDialogEvent","showResourceCopyLinkDialogHandler"],[0,"internalDownloadAsEvent","onDownloadAsEventHandler"],[0,"internalNotificationMessageEvent","notificationMessageHandler"],[0,"internalQueryEvent","onQuery"],[0,"internalQueryExecuted","onInternalQueryExecuted"],[0,"internalCountQueryEvent","onCountQuery"],[0,"internalCountQueryResponseEvent","onCountQueryResponse"],[0,"internalRequestAbortedEvent","onQueryAborted"]]],[0,"copy-resource-link-dialog",{serviceFactory:[16],resourceLink:[1,"resource-link"]}],[0,"share-query-dialog",{config:[16],serviceFactory:[16]}],[0,"save-query-dialog",{serviceFactory:[16],data:[16],queryName:[32],originalQueryName:[32],query:[32],isPublic:[32],isNew:[32],isSaveAllowed:[32]},[[8,"keydown","keydownListener"]]],[0,"confirmation-dialog",{translationService:[16],config:[16]},[[8,"keydown","keydownListener"]]],[0,"saved-queries-popup",{config:[16],serviceFactory:[16]},[[8,"click","onWindowResize"],[8,"keydown","keydownListener"]]],[0,"copy-link-dialog",{config:[16],serviceFactory:[16],copyLinkEventsObserver:[16],classes:[1]}],[4,"yasgui-tooltip",{dataTooltip:[1,"data-tooltip"],placement:[1],showOnClick:[4,"show-on-click"]}],[4,"ontotext-dialog-web-component",{config:[16]},[[4,"keydown","keydownListener"]]]]],["ontotext-dropdown",[[0,"ontotext-dropdown",{translationService:[16],nameLabelKey:[1,"name-label-key"],tooltipLabelKey:[1,"tooltip-label-key"],items:[16],iconClass:[1,"icon-class"],open:[32],showTooltip:[32]},[[8,"keydown","keydownListener"],[8,"click","mouseClickListener"]]]]]],t));!function(){if("undefined"!=typeof window&&void 0!==window.Reflect&&void 0!==window.customElements){var e=HTMLElement;window.HTMLElement=function(){return Reflect.construct(e,[],this.constructor)},HTMLElement.prototype=e.prototype,HTMLElement.prototype.constructor=HTMLElement,Object.setPrototypeOf(HTMLElement,e)}}();var o=n(31),s=n(14);const a=function(e){let t=document.createElement("textarea");return t.innerHTML=e,t.value},l=["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.copytoclipboard.copytoclipboard","graphdb.framework.core.directives.angular-tooltips","graphdb.framework.core.directives.uppercased","graphdb.framework.core.directives.prop-indeterminate","graphdb.framework.core.directives.page-info-tooltip","graphdb.framework.guides.services","graphdb.framework.core.directives.operationsstatusesmonitor","graphdb.framework.core.directives.autocomplete","ngCustomElement","graphdb.framework.core.services.language-service","graphdb.framework.core.filters.bytes"],u=["$routeProvider","$locationProvider","$menuItemsProvider","toastrConfig","localStorageServiceProvider","$uibTooltipProvider","$httpProvider","$templateRequestProvider","$translateProvider","$languageServiceProvider"];function c(e){return $.getJSON(`i18n/locale-${e}.json?v=2.8.9`).then((function(t){return{language:e,data:t}})).fail((function(){return console.error("Failed to load translation file for: "+e),null}))}function h(e){$.get("rest/info/version?local=1",(function(t){const r=t.productVersion.match(/^(\d+\.\d+)/);r.length?t.productShortVersion=r[1]:t.productShortVersion=t.productVersion;const c=t.productVersion.match(/(-.*?)(-|$)/);c&&c.length&&(t.productShortVersion=t.productShortVersion+c[1]),function(e,t){i();const r=angular.module("graphdb.workbench",l);r.config([...u,function(r,i,o,s,a,l,u,c,h,p){t&&Object.keys(t).length>0?Object.keys(t).forEach(e=>{h.translations(e,t[e])}):(h.useStaticFilesLoader({prefix:"i18n/locale-",suffix:".json?v=2.8.9"}),h.preferredLanguage(p.getDefaultLanguage())),h.useSanitizeValueStrategy("escape"),angular.extend(s,{timeOut:5e3,positionClass:"toast-bottom-right",tapToDismiss:!1,extendedTimeOut:5e3}),a.setStorageType("localStorage").setNotify(!0,!0);const d=r.$get[r.$get.length-1]({$on:function(){}});r.when("_openid_implicit_",{controller:function(){},template:"<div></div>"}),d.routes._openid_implicit_.regexp=/[&/](?:id_token=.*&access_token=|access_token=.*&id_token=)/;let f=PluginRegistry.get("route");angular.forEach(f,(function(e){r.when(e.url,{controller:e.controller,templateUrl:e.templateUrl,title:e.title,helpInfo:e.helpInfo,documentationUrl:e.documentationUrl,reloadOnSearch:void 0===e.reloadOnSearch||e.reloadOnSearch,resolve:{preload:["$ocLazyLoad","$q",function(t,r){return e.path?n(452)("./"+e.path).then(n=>{t.inject(e.module)}):r.defer().resolve()}]}})})),r.otherwise({templateUrl:"pages/not_found.html"}),i.html5Mode(!0),l.setTriggers({show:"hide"}),l.options({appendToBody:!0}),o.setProductInfo(e),PluginRegistry.get("main.menu").forEach((function(e){e.items.forEach((function(e){o.addItem(e)}))})),u.interceptors.push("$unauthorizedInterceptor"),u.interceptors.push("$authenticationInterceptor");const g=c.$get[3];"function"==typeof g&&(c.$get[3]=function(e,t,n){const r=g(e,t,n);return function(t,n){return e.get(t)||(t+="?v=2.8.9"),r(t,n)}})}]),r.constant("productInfo",e),r.run(["$rootScope","$route","toastr","$sce","$translate","ThemeService","WorkbenchSettingsStorageService","LSKeys","GuidesService",function(t,n,r,i,o,l,u,c,h){function p(){n.current.title?document.title=a(o.instant(n.current.title))+" | GraphDB Workbench":document.title="GraphDB Workbench",t.helpInfo=n.current.helpInfo&&i.trustAsHtml(a(o.instant(n.current.helpInfo))),t.title=a(o.instant(n.current.title)),t.documentationUrl=s.DocumentationUrlResolver.getDocumentationUrl(e.productShortVersion,n.current.documentationUrl)}t.$on("$routeChangeSuccess",(function(){p(),r.clear()})),t.$on("$translateChangeSuccess",(function(){p()}));const d=u.getThemeName();l.applyTheme(d),l.applyDarkThemeMode(),h.init()}]),r.filter("titlecase",(function(){return function(e){const t=""+e;return t.charAt(0).toUpperCase()+t.slice(1)}})),r.filter("prettyJSON",()=>e=>angular.toJson(e,!0)),r.filter("humanReadableSize",()=>e=>Object(o.convertToHumanReadable)(e)),r.filter("trustAsHtml",["$translate","$sce",(e,t)=>e=>t.trustAsHtml(a(e))]),angular.bootstrap(document,["graphdb.workbench"])}(t,e)}))}!function(){const e=[{key:"en",name:"English"},{key:"fr",name:"Français"}].map(e=>e.key).map(c),t={};Promise.all(e).then(e=>{e.forEach(e=>{e&&(t[e.language]=e.data)}),h(t)}).catch(()=>{console.error("Failed to load one or more translation files."),h(t)})}()},1: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"}},10:function(e,t,n){"use strict";n.r(t),n.d(t,"RepositoryInfoModel",(function(){return r})),n.d(t,"RepositoryConfigModel",(function(){return i})),n.d(t,"RepositoryParams",(function(){return o})),n.d(t,"RepositoryParam",(function(){return s})),n.d(t,"REPOSITORY_PARAMS",(function(){return a}));class r{constructor(e={}){this._id=e.id,this._title=e.title,this._type=e.type,this._sesameType=e.sesameType,this._uri=e.uri,this._externalUrl=e.externalUrl,this._location=e.location,this._state=e.state,this._local=e.local,this._readable=e.readable,this._writable=e.writable,this._unsupported=e.unsupported}get id(){return this._id}set id(e){this._id=e}get title(){return this._title}set title(e){this._title=e}get type(){return this._type}set type(e){this._type=e}get sesameType(){return this._sesameType}set sesameType(e){this._sesameType=e}get uri(){return this._uri}set uri(e){this._uri=e}get externalUrl(){return this._externalUrl}set externalUrl(e){this._externalUrl=e}get location(){return this._location}set location(e){this._location=e}get state(){return this._state}set state(e){this._state=e}get local(){return this._local}set local(e){this._local=e}get readable(){return this._readable}set readable(e){this._readable=e}get writable(){return this._writable}set writable(e){this._writable=e}get unsupported(){return this._unsupported}set unsupported(e){this._unsupported=e}}class i{constructor(e={}){this._id=e.id,this._title=e.title,this._type=e.type,this._sesameType=e.sesameType,this._location=e.location,this._params=e.params}getParam(e){return this._params.getParam(e)}getParamValue(e){return this._params.getParamValue(e)}get id(){return this._id}set id(e){this._id=e}get title(){return this._title}set title(e){this._title=e}get type(){return this._type}set type(e){this._type=e}get sesameType(){return this._sesameType}set sesameType(e){this._sesameType=e}get location(){return this._location}set location(e){this._location=e}get params(){return this._params}set params(e){this._params=e}}class o{constructor(e={}){this._params=e}get params(){return this._params}set params(e){this._params=e}addParam(e){this._params[e.name]=e}getParam(e){return this._params[e]}getParamValue(e){if(this._params[e])return this._params[e].getValue()}}class s{constructor(e={}){this._name=e.name,this._label=e.label,this._value=e.value}getValue(){return"true"===this._value||"false"!==this._value&&(isNaN(this._value)?this._value:Number(this._value))}get name(){return this._name}set name(e){this._name=e}get label(){return this._label}set label(e){this._label=e}get value(){return this._value}set value(e){this._value=e}}const a={queryTimeout:"queryTimeout",cacheSelectNodes:"cacheSelectNodes",rdfsSubClassReasoning:"rdfsSubClassReasoning",validationEnabled:"validationEnabled",ftsStringLiteralsIndex:"ftsStringLiteralsIndex",shapesGraph:"shapesGraph",parallelValidation:"parallelValidation",checkForInconsistencies:"checkForInconsistencies",performanceLogging:"performanceLogging",disableSameAs:"disableSameAs",ftsIrisIndex:"ftsIrisIndex",entityIndexSize:"entityIndexSize",dashDataShapes:"dashDataShapes",queryLimitResults:"queryLimitResults",throwQueryEvaluationExceptionOnTimeout:"throwQueryEvaluationExceptionOnTimeout",member:"member",storageFolder:"storageFolder",validationResultsLimitPerConstraint:"validationResultsLimitPerConstraint",enablePredicateList:"enablePredicateList",transactionalValidationLimit:"transactionalValidationLimit",ftsIndexes:"ftsIndexes",logValidationPlans:"logValidationPlans",imports:"imports",isShacl:"isShacl",inMemoryLiteralProperties:"inMemoryLiteralProperties",ruleset:"ruleset",readOnly:"readOnly",enableLiteralIndex:"enableLiteralIndex",enableFtsIndex:"enableFtsIndex",defaultNS:"defaultNS",enableContextIndex:"enableContextIndex",baseURL:"baseURL",logValidationViolations:"logValidationViolations",globalLogValidationExecution:"globalLogValidationExecution",entityIdSize:"entityIdSize",repositoryType:"repositoryType",eclipseRdf4jShaclExtensions:"eclipseRdf4jShaclExtensions",validationResultsLimitTotal:"validationResultsLimitTotal"}},11: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=""}}},12: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"}},13: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",JSONLD_EXPORT_SETTINGS:"jsonld-export-settings",IMPORT_VIEW:"import-view",SPARQL_LAST_REPO:"sparql-last-repo",TTYG:"ttyg"}),n.$inject=["localStorageService","LSKeys"]},14:function(e,t,n){"use strict";n.r(t),n.d(t,"DocumentationUrlResolver",(function(){return r}));class r{static getDocumentationUrl(e,t){if(!t)return;const n=e.includes("-");return`https://graphdb.ontotext.com/documentation/${window.wbDevMode||n?"master":e}/${t}`}}},15: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},16:function(e,t,n){"use strict";n.r(t),n.d(t,"QueryMode",(function(){return r}));const r={UPDATE:"update",QUERY:"query"}},17:function(e,t,n){"use strict";n.r(t),n.d(t,"GUIDE_ID",(function(){return un})),n.d(t,"GUIDE_CURRENT_STEP_ID",(function(){return cn})),n.d(t,"GUIDE_STEP_HISTORY",(function(){return hn})),n.d(t,"GUIDE_PAUSE",(function(){return pn}));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)};
|
|
2
2
|
/*! shepherd.js 11.2.0 */var o="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function s(e,t){return!1!==t.clone&&t.isMergeableObject(e)?h((n=e,Array.isArray(n)?[]:{}),e,t):e;var n}function a(e,t,n){return e.concat(t).map((function(e){return s(e,n)}))}function l(e){return Object.keys(e).concat(function(e){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e).filter((function(t){return Object.propertyIsEnumerable.call(e,t)})):[]}(e))}function u(e,t){try{return t in e}catch(e){return!1}}function c(e,t,n){var r={};return n.isMergeableObject(e)&&l(e).forEach((function(t){r[t]=s(e[t],n)})),l(t).forEach((function(i){(function(e,t){return u(e,t)&&!(Object.hasOwnProperty.call(e,t)&&Object.propertyIsEnumerable.call(e,t))})(e,i)||(u(e,i)&&n.isMergeableObject(t[i])?r[i]=function(e,t){if(!t.customMerge)return h;var n=t.customMerge(e);return"function"==typeof n?n:h}(i,n)(e[i],t[i],n):r[i]=s(t[i],n))})),r}function h(e,t,n){(n=n||{}).arrayMerge=n.arrayMerge||a,n.isMergeableObject=n.isMergeableObject||i,n.cloneUnlessOtherwiseSpecified=s;var r=Array.isArray(t);return r===Array.isArray(e)?r?n.arrayMerge(e,t,n):c(e,t,n):s(t,n)}h.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce((function(e,n){return h(e,n,t)}),{})};var p=h;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=!1){return 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,...t){return!m(this.bindings)&&this.bindings[e]&&this.bindings[e].forEach((n,r)=>{const{ctx:i,handler:o,once:s}=n,a=i||this;o.apply(a,t),s&&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)))}}function $(e){return g(e)&&""!==e?"-"!==e.charAt(e.length-1)?e+"-":e:""}function w(e){return null==e||(!e.element||!e.on)}function x(){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 S(){return(S=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 E(e,t){if(null==e)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}const A=Math.min,C=Math.max,T=Math.round,F=Math.floor,k=e=>({x:e,y:e}),D={left:"right",right:"left",bottom:"top",top:"bottom"},R={start:"end",end:"start"};function I(e,t,n){return C(e,A(t,n))}function P(e,t){return"function"==typeof e?e(t):e}function O(e){return e.split("-")[0]}function _(e){return e.split("-")[1]}function j(e){return"x"===e?"y":"x"}function L(e){return"y"===e?"height":"width"}function N(e){return["top","bottom"].includes(O(e))?"y":"x"}function M(e){return j(N(e))}function B(e){return e.replace(/start|end/g,e=>R[e])}function H(e){return e.replace(/left|right|bottom|top/g,e=>D[e])}function U(e){return"number"!=typeof e?function(e){return S({top:0,right:0,bottom:0,left:0},e)}(e):{top:e,right:e,bottom:e,left:e}}function V(e){return S({},e,{top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height})}const q=["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"],z=["mainAxis","crossAxis","limiter"];function K(e,t,n){let{reference:r,floating:i}=e;const o=N(t),s=M(t),a=L(s),l=O(t),u="y"===o,c=r.x+r.width/2-i.width/2,h=r.y+r.height/2-i.height/2,p=r[a]/2-i[a]/2;let d;switch(l){case"top":d={x:c,y:r.y-i.height};break;case"bottom":d={x:c,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:h};break;case"left":d={x:r.x-i.width,y:h};break;default:d={x:r.x,y:r.y}}switch(_(t)){case"start":d[s]-=p*(n&&u?-1:1);break;case"end":d[s]+=p*(n&&u?-1:1)}return d}async function G(e,t){var n;void 0===t&&(t={});const{x:r,y:i,platform:o,rects:s,elements:a,strategy:l}=e,{boundary:u="clippingAncestors",rootBoundary:c="viewport",elementContext:h="floating",altBoundary:p=!1,padding:d=0}=P(t,e),f=U(d),g=a[p?"floating"===h?"reference":"floating":h],m=V(await o.getClippingRect({element:null==(n=await(null==o.isElement?void 0:o.isElement(g)))||n?g:g.contextElement||await(null==o.getDocumentElement?void 0:o.getDocumentElement(a.floating)),boundary:u,rootBoundary:c,strategy:l})),v="floating"===h?S({},s.floating,{x:r,y:i}):s.reference,y=await(null==o.getOffsetParent?void 0:o.getOffsetParent(a.floating)),b=await(null==o.isElement?void 0:o.isElement(y))&&await(null==o.getScale?void 0:o.getScale(y))||{x:1,y:1},$=V(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({rect:v,offsetParent:y,strategy:l}):v);return{top:(m.top-$.top+f.top)/b.y,bottom:($.bottom-m.bottom+f.bottom)/b.y,left:(m.left-$.left+f.left)/b.x,right:($.right-m.right+f.right)/b.x}}const W=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:r,middlewareData:i,rects:o,initialPlacement:s,platform:a,elements:l}=t,u=P(e,t),{mainAxis:c=!0,crossAxis:h=!0,fallbackPlacements:p,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:g=!0}=u,m=E(u,q),v=O(r),y=O(s)===s,b=await(null==a.isRTL?void 0:a.isRTL(l.floating)),$=p||(y||!g?[H(s)]:function(e){const t=H(e);return[B(e),t,B(t)]}(s));p||"none"===f||$.push(...function(e,t,n,r){const i=_(e);let o=function(e,t,n){const r=["left","right"],i=["right","left"],o=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?o:s;default:return[]}}(O(e),"start"===n,r);return i&&(o=o.map(e=>e+"-"+i),t&&(o=o.concat(o.map(B)))),o}(s,g,f,b));const w=[s,...$],x=await G(t,m),S=[];let A=(null==(n=i.flip)?void 0:n.overflows)||[];if(c&&S.push(x[v]),h){const e=function(e,t,n){void 0===n&&(n=!1);const r=_(e),i=M(e),o=L(i);let s="x"===i?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[o]>t.floating[o]&&(s=H(s)),[s,H(s)]}(r,o,b);S.push(x[e[0]],x[e[1]])}if(A=[...A,{placement:r,overflows:S}],!S.every(e=>e<=0)){var C,T;const e=((null==(C=i.flip)?void 0:C.index)||0)+1,t=w[e];if(t)return{data:{index:e,overflows:A},reset:{placement:t}};let n=null==(T=A.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:T.placement;if(!n)switch(d){case"bestFit":{var F;const e=null==(F=A.map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:F[0];e&&(n=e);break}case"initialPlacement":n=s}if(r!==n)return{reset:{placement:n}}}return{}}}},Y=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:o,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=P(e,t),c={x:n,y:r},h=N(i),p=j(h);let d=c[p],f=c[h];const g=P(a,t),m="number"==typeof g?{mainAxis:g,crossAxis:0}:S({mainAxis:0,crossAxis:0},g);if(l){const e="y"===p?"height":"width",t=o.reference[p]-o.floating[e]+m.mainAxis,n=o.reference[p]+o.reference[e]-m.mainAxis;d<t?d=t:d>n&&(d=n)}if(u){var v,y;const e="y"===p?"width":"height",t=["top","left"].includes(O(i)),n=o.reference[h]-o.floating[e]+(t&&(null==(v=s.offset)?void 0:v[h])||0)+(t?0:m.crossAxis),r=o.reference[h]+o.reference[e]+(t?0:(null==(y=s.offset)?void 0:y[h])||0)-(t?m.crossAxis:0);f<n?f=n:f>r&&(f=r)}return{[p]:d,[h]:f}}}};function J(e){return Z(e)?(e.nodeName||"").toLowerCase():"#document"}function X(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Q(e){var t;return null==(t=(Z(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Z(e){return e instanceof Node||e instanceof X(e).Node}function ee(e){return e instanceof Element||e instanceof X(e).Element}function te(e){return e instanceof HTMLElement||e instanceof X(e).HTMLElement}function ne(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof X(e).ShadowRoot)}function re(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=le(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function ie(e){return["table","td","th"].includes(J(e))}function oe(e){const t=se(),n=le(e);return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some(e=>(n.willChange||"").includes(e))||["paint","layout","strict","content"].some(e=>(n.contain||"").includes(e))}function se(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function ae(e){return["html","body","#document"].includes(J(e))}function le(e){return X(e).getComputedStyle(e)}function ue(e){return ee(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ce(e){if("html"===J(e))return e;const t=e.assignedSlot||e.parentNode||ne(e)&&e.host||Q(e);return ne(t)?t.host:t}function he(e,t){var n;void 0===t&&(t=[]);const r=function e(t){const n=ce(t);return ae(n)?t.ownerDocument?t.ownerDocument.body:t.body:te(n)&&re(n)?n:e(n)}(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),o=X(r);return i?t.concat(o,o.visualViewport||[],re(r)?r:[]):t.concat(r,he(r))}function pe(e){const t=le(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=te(e),o=i?e.offsetWidth:n,s=i?e.offsetHeight:r,a=T(n)!==o||T(r)!==s;return a&&(n=o,r=s),{width:n,height:r,$:a}}function de(e){return ee(e)?e:e.contextElement}function fe(e){const t=de(e);if(!te(t))return k(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=pe(t);let s=(o?T(n.width):n.width)/r,a=(o?T(n.height):n.height)/i;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}const ge=k(0);function me(e){const t=X(e);return se()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:ge}function ve(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const i=e.getBoundingClientRect(),o=de(e);let s=k(1);t&&(r?ee(r)&&(s=fe(r)):s=fe(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==X(e))&&t}(o,n,r)?me(o):k(0);let l=(i.left+a.x)/s.x,u=(i.top+a.y)/s.y,c=i.width/s.x,h=i.height/s.y;if(o){const e=X(o),t=r&&ee(r)?X(r):r;let n=e.frameElement;for(;n&&r&&t!==e;){const e=fe(n),t=n.getBoundingClientRect(),r=le(n),i=t.left+(n.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(n.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,u*=e.y,c*=e.x,h*=e.y,l+=i,u+=o,n=X(n).frameElement}}return V({width:c,height:h,x:l,y:u})}function ye(e){return ve(Q(e)).left+ue(e).scrollLeft}function be(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=X(e),r=Q(e),i=n.visualViewport;let o=r.clientWidth,s=r.clientHeight,a=0,l=0;if(i){o=i.width,s=i.height;const e=se();(!e||e&&"fixed"===t)&&(a=i.offsetLeft,l=i.offsetTop)}return{width:o,height:s,x:a,y:l}}(e,n);else if("document"===t)r=function(e){const t=Q(e),n=ue(e),r=e.ownerDocument.body,i=C(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=C(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+ye(e);const a=-n.scrollTop;return"rtl"===le(r).direction&&(s+=C(t.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:a}}(Q(e));else if(ee(t))r=function(e,t){const n=ve(e,!0,"fixed"===t),r=n.top+e.clientTop,i=n.left+e.clientLeft,o=te(e)?fe(e):k(1);return{width:e.clientWidth*o.x,height:e.clientHeight*o.y,x:i*o.x,y:r*o.y}}(t,n);else{const n=me(e);r=S({},t,{x:t.x-n.x,y:t.y-n.y})}return V(r)}function $e(e,t){const n=ce(e);return!(n===t||!ee(n)||ae(n))&&("fixed"===le(n).position||$e(n,t))}function we(e,t,n){const r=te(t),i=Q(t),o="fixed"===n,s=ve(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const l=k(0);if(r||!r&&!o)if(("body"!==J(t)||re(i))&&(a=ue(t)),r){const e=ve(t,!0,o,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else i&&(l.x=ye(i));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function xe(e,t){return te(e)&&"fixed"!==le(e).position?t?t(e):e.offsetParent:null}function Se(e,t){const n=X(e);if(!te(e))return n;let r=xe(e,t);for(;r&&ie(r)&&"static"===le(r).position;)r=xe(r,t);return r&&("html"===J(r)||"body"===J(r)&&"static"===le(r).position&&!oe(r))?n:r||function(e){let t=ce(e);for(;te(t)&&!ae(t);){if(oe(t))return t;t=ce(t)}return null}(e)||n}const Ee={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e;const i=te(n),o=Q(n);if(n===o)return t;let s={scrollLeft:0,scrollTop:0},a=k(1);const l=k(0);if((i||!i&&"fixed"!==r)&&(("body"!==J(n)||re(o))&&(s=ue(n)),te(n))){const e=ve(n);a=fe(n),l.x=e.x+n.clientLeft,l.y=e.y+n.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-s.scrollLeft*a.x+l.x,y:t.y*a.y-s.scrollTop*a.y+l.y}},getDocumentElement:Q,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const o=[..."clippingAncestors"===n?function(e,t){const n=t.get(e);if(n)return n;let r=he(e).filter(e=>ee(e)&&"body"!==J(e)),i=null;const o="fixed"===le(e).position;let s=o?ce(e):e;for(;ee(s)&&!ae(s);){const t=le(s),n=oe(s);n||"fixed"!==t.position||(i=null);(o?!n&&!i:!n&&"static"===t.position&&!!i&&["absolute","fixed"].includes(i.position)||re(s)&&!n&&$e(e,s))?r=r.filter(e=>e!==s):i=t,s=ce(s)}return t.set(e,r),r}(t,this._c):[].concat(n),r],s=o[0],a=o.reduce((e,n)=>{const r=be(t,n,i);return e.top=C(r.top,e.top),e.right=A(r.right,e.right),e.bottom=A(r.bottom,e.bottom),e.left=C(r.left,e.left),e},be(t,s,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:Se,getElementRects:async function(e){let{reference:t,floating:n,strategy:r}=e;const i=this.getOffsetParent||Se,o=this.getDimensions;return{reference:we(t,await i(n),r),floating:S({x:0,y:0},await o(n))}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){return pe(e)},getScale:fe,isElement:ee,isRTL:function(e){return"rtl"===le(e).direction}};function Ae(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,u=de(e),c=i||o?[...u?he(u):[],...he(t)]:[];c.forEach(e=>{i&&e.addEventListener("scroll",n,{passive:!0}),o&&e.addEventListener("resize",n)});const h=u&&a?function(e,t){let n,r=null;const i=Q(e);function o(){clearTimeout(n),r&&r.disconnect(),r=null}return function s(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),o();const{left:u,top:c,width:h,height:p}=e.getBoundingClientRect();if(a||t(),!h||!p)return;const d={rootMargin:-F(c)+"px "+-F(i.clientWidth-(u+h))+"px "+-F(i.clientHeight-(c+p))+"px "+-F(u)+"px",threshold:C(0,A(1,l))||1};let f=!0;function g(e){const t=e[0].intersectionRatio;if(t!==l){if(!f)return s();t?s(!1,t):n=setTimeout(()=>{s(!1,1e-7)},100)}f=!1}try{r=new IntersectionObserver(g,S({},d,{root:i.ownerDocument}))}catch(e){r=new IntersectionObserver(g,d)}r.observe(e)}(!0),o}(u,n):null;let p,d=-1,f=null;s&&(f=new ResizeObserver(e=>{let[r]=e;r&&r.target===u&&f&&(f.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{f&&f.observe(t)})),n()}),u&&!l&&f.observe(u),f.observe(t));let g=l?ve(e):null;return l&&function t(){const r=ve(e);!g||r.x===g.x&&r.y===g.y&&r.width===g.width&&r.height===g.height||n();g=r,p=requestAnimationFrame(t)}(),n(),()=>{c.forEach(e=>{i&&e.removeEventListener("scroll",n),o&&e.removeEventListener("resize",n)}),h&&h(),f&&f.disconnect(),f=null,l&&cancelAnimationFrame(p)}}const Ce=(e,t,n)=>{const r=new Map,i=S({platform:Ee},n),o=S({},i.platform,{_c:r});return(async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=n,a=o.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:h}=K(u,r,l),p=r,d={},f=0;for(let n=0;n<a.length;n++){const{name:o,fn:g}=a[n],{x:m,y:v,data:y,reset:b}=await g({x:c,y:h,initialPlacement:r,placement:p,strategy:i,middlewareData:d,rects:u,platform:s,elements:{reference:e,floating:t}});c=null!=m?m:c,h=null!=v?v:h,d=S({},d,{[o]:S({},d[o],y)}),b&&f<=50&&(f++,"object"==typeof b&&(b.placement&&(p=b.placement),b.rects&&(u=!0===b.rects?await s.getElementRects({reference:e,floating:t,strategy:i}):b.rects),({x:c,y:h}=K(u,p,l))),n=-1)}return{x:c,y:h,placement:p,strategy:i,middlewareData:d}})(e,t,S({},i,{platform:o}))};function Te(e){e.cleanup&&e.cleanup();const t=e._getResolvedAttachToOptions();let n=t.element;const r=function(e,t){const n={strategy:"absolute",middleware:[]},r=function(e){if(e.options.arrow&&e.el)return e.el.querySelector(".shepherd-arrow");return!1}(t);w(e)||(n.middleware.push(W(),function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,o=P(e,t),{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}}}=o,u=E(o,z),c={x:n,y:r},h=await G(t,u),p=N(O(i)),d=j(p);let f=c[d],g=c[p];if(s){const e="y"===d?"bottom":"right";f=I(f+h["y"===d?"top":"left"],f,f-h[e])}if(a){const e="y"===p?"bottom":"right";g=I(g+h["y"===p?"top":"left"],g,g-h[e])}const m=l.fn(S({},t,{[d]:f,[p]:g}));return S({},m,{data:{x:m.x-n,y:m.y-r}})}}}({limiter:Y(),crossAxis:!0})),r&&n.middleware.push((e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:o,platform:s,elements:a}=t,{element:l,padding:u=0}=P(e,t)||{};if(null==l)return{};const c=U(u),h={x:n,y:r},p=M(i),d=L(p),f=await s.getDimensions(l),g="y"===p,m=g?"top":"left",v=g?"bottom":"right",y=g?"clientHeight":"clientWidth",b=o.reference[d]+o.reference[p]-h[p]-o.floating[d],$=h[p]-o.reference[p],w=await(null==s.getOffsetParent?void 0:s.getOffsetParent(l));let x=w?w[y]:0;x&&await(null==s.isElement?void 0:s.isElement(w))||(x=a.floating[y]||o.floating[d]);const S=b/2-$/2,E=x/2-f[d]/2-1,C=A(c[m],E),T=A(c[v],E),F=C,k=x-f[d]-T,D=x/2-f[d]/2+S,R=I(F,D,k),O=null!=_(i)&&D!=R&&o.reference[d]/2-(D<F?C:T)-f[d]/2<0?D<F?F-D:k-D:0;return{[p]:h[p]-O,data:{[p]:R,centerOffset:D-R+O}}}}))({element:r})),n.placement=e.on);return p(t.options.floatingUIOptions||{},n)}(t,e),i=w(t);if(i){n=document.body;e.shepherdElementComponent.getElement().classList.add("shepherd-centered")}return e.cleanup=Ae(n,e.el,()=>{e.el?function(e,t,n,r){Ce(e,t.el,n).then(function(e,t){return({x:n,y:r,placement:i,middlewareData:o})=>e.el?(t?Object.assign(e.el.style,{position:"fixed",left:"50%",top:"50%",transform:"translate(-50%, -50%)"}):Object.assign(e.el.style,{position:"absolute",left:n+"px",top:r+"px"}),e.el.dataset.popperPlacement=i,function(e,t){const n=e.querySelector(".shepherd-arrow");if(n&&t.arrow){const{x:e,y:r}=t.arrow;Object.assign(n.style,{left:null!=e?e+"px":"",top:null!=r?r+"px":""})}}(e.el,o),e):e}(t,r)).then(e=>new Promise(t=>{setTimeout(()=>t(e),300)})).then(e=>{e&&e.el&&e.el.focus({preventScroll:!0})})}(n,e,r,i):e.cleanup()}),e.target=t.element,r}function Fe(){}function ke(e,t){for(const n in t)e[n]=t[n];return e}function De(e){return e()}function Re(){return Object.create(null)}function Ie(e){e.forEach(De)}function Pe(e){return"function"==typeof e}function Oe(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}function _e(e,t){e.appendChild(t)}function je(e,t,n){e.insertBefore(t,n||null)}function Le(e){e.parentNode&&e.parentNode.removeChild(e)}function Ne(e){return document.createElement(e)}function Me(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function Be(e){return document.createTextNode(e)}function He(){return Be(" ")}function Ue(e,t,n,r){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}function Ve(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}const qe=["width","height"];function ze(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&&-1===qe.indexOf(r)?e[r]=t[r]:Ve(e,r,t[r])}function Ke(e,t,n){e.classList[n?"add":"remove"](t)}let Ge;function We(e){Ge=e}function Ye(){if(!Ge)throw new Error("Function called outside component initialization");return Ge}function Je(e){Ye().$$.after_update.push(e)}const Xe=[],Qe=[];let Ze=[];const et=[],tt=Promise.resolve();let nt=!1;function rt(e){Ze.push(e)}const it=new Set;let ot=0;function st(){if(0!==ot)return;const e=Ge;do{try{for(;ot<Xe.length;){const e=Xe[ot];ot++,We(e),at(e.$$)}}catch(e){throw Xe.length=0,ot=0,e}for(We(null),Xe.length=0,ot=0;Qe.length;)Qe.pop()();for(let e=0;e<Ze.length;e+=1){const t=Ze[e];it.has(t)||(it.add(t),t())}Ze.length=0}while(Xe.length);for(;et.length;)et.pop()();nt=!1,it.clear(),We(e)}function at(e){if(null!==e.fragment){e.update(),Ie(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(rt)}}const lt=new Set;let ut;function ct(){ut={r:0,c:[],p:ut}}function ht(){ut.r||Ie(ut.c),ut=ut.p}function pt(e,t){e&&e.i&&(lt.delete(e),e.i(t))}function dt(e,t,n,r){if(e&&e.o){if(lt.has(e))return;lt.add(e),ut.c.push(()=>{lt.delete(e),r&&(n&&e.d(1),r())}),e.o(t)}else r&&r()}function ft(e){e&&e.c()}function gt(e,t,n,r){const{fragment:i,after_update:o}=e.$$;i&&i.m(t,n),r||rt(()=>{const t=e.$$.on_mount.map(De).filter(Pe);e.$$.on_destroy?e.$$.on_destroy.push(...t):Ie(t),e.$$.on_mount=[]}),o.forEach(rt)}function mt(e,t){const n=e.$$;null!==n.fragment&&(!function(e){const t=[],n=[];Ze.forEach(r=>-1===e.indexOf(r)?t.push(r):n.push(r)),n.forEach(e=>e()),Ze=t}(n.after_update),Ie(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function vt(e,t){-1===e.$$.dirty[0]&&(Xe.push(e),nt||(nt=!0,tt.then(st)),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function yt(e,t,n,r,i,o,s,a=[-1]){const l=Ge;We(e);const u=e.$$={fragment:null,ctx:[],props:o,update:Fe,not_equal:i,bound:Re(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(l?l.$$.context:[])),callbacks:Re(),dirty:a,skip_bound:!1,root:t.target||l.$$.root};s&&s(u.root);let c=!1;if(u.ctx=n?n(e,t.props||{},(t,n,...r)=>{const o=r.length?r[0]:n;return u.ctx&&i(u.ctx[t],u.ctx[t]=o)&&(!u.skip_bound&&u.bound[t]&&u.bound[t](o),c&&vt(e,t)),n}):[],u.update(),c=!0,Ie(u.before_update),u.fragment=!!r&&r(u.ctx),t.target){if(t.hydrate){const e=(h=t.target,Array.from(h.childNodes));u.fragment&&u.fragment.l(e),e.forEach(Le)}else u.fragment&&u.fragment.c();t.intro&&pt(e.$$.fragment),gt(e,t.target,t.anchor,t.customElement),st()}var h;We(l)}class bt{$destroy(){mt(this,1),this.$destroy=Fe}$on(e,t){if(!Pe(t))return Fe;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 $t(e){let t,n,r,i,o;return{c(){t=Ne("button"),Ve(t,"aria-label",n=e[3]?e[3]:null),Ve(t,"class",r=`${e[1]||""} shepherd-button ${e[4]?"shepherd-button-secondary":""}`),t.disabled=e[2],Ve(t,"tabindex","0")},m(n,r){je(n,t,r),t.innerHTML=e[5],i||(o=Ue(t,"click",(function(){Pe(e[0])&&e[0].apply(this,arguments)})),i=!0)},p(i,[o]){e=i,32&o&&(t.innerHTML=e[5]),8&o&&n!==(n=e[3]?e[3]:null)&&Ve(t,"aria-label",n),18&o&&r!==(r=`${e[1]||""} shepherd-button ${e[4]?"shepherd-button-secondary":""}`)&&Ve(t,"class",r),4&o&&(t.disabled=e[2])},i:Fe,o:Fe,d(e){e&&Le(t),i=!1,o()}}}function wt(e,t,n){let r,i,o,s,a,l,{config:u,step:c}=t;function h(e){return f(e)?e.call(c):e}return e.$$set=e=>{"config"in e&&n(6,u=e.config),"step"in e&&n(7,c=e.step)},e.$$.update=()=>{192&e.$$.dirty&&(n(0,r=u.action?u.action.bind(c.tour):null),n(1,i=u.classes),n(2,o=!!u.disabled&&h(u.disabled)),n(3,s=u.label?h(u.label):null),n(4,a=u.secondary),n(5,l=u.text?h(u.text):null))},[r,i,o,s,a,l,u,c]}class xt extends bt{constructor(e){super(),yt(this,e,wt,$t,Oe,{config:6,step:7})}}function St(e,t,n){const r=e.slice();return r[2]=t[n],r}function Et(e){let t,n,r=e[1],i=[];for(let t=0;t<r.length;t+=1)i[t]=At(St(e,r,t));const o=e=>dt(i[e],1,1,()=>{i[e]=null});return{c(){for(let e=0;e<i.length;e+=1)i[e].c();t=Be("")},m(e,r){for(let t=0;t<i.length;t+=1)i[t]&&i[t].m(e,r);je(e,t,r),n=!0},p(e,n){if(3&n){let s;for(r=e[1],s=0;s<r.length;s+=1){const o=St(e,r,s);i[s]?(i[s].p(o,n),pt(i[s],1)):(i[s]=At(o),i[s].c(),pt(i[s],1),i[s].m(t.parentNode,t))}for(ct(),s=r.length;s<i.length;s+=1)o(s);ht()}},i(e){if(!n){for(let e=0;e<r.length;e+=1)pt(i[e]);n=!0}},o(e){i=i.filter(Boolean);for(let e=0;e<i.length;e+=1)dt(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&&Le(t)}}}function At(e){let t,n;return t=new xt({props:{config:e[2],step:e[0]}}),{c(){ft(t.$$.fragment)},m(e,r){gt(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||(pt(t.$$.fragment,e),n=!0)},o(e){dt(t.$$.fragment,e),n=!1},d(e){mt(t,e)}}}function Ct(e){let t,n,r=e[1]&&Et(e);return{c(){t=Ne("footer"),r&&r.c(),Ve(t,"class","shepherd-footer")},m(e,i){je(e,t,i),r&&r.m(t,null),n=!0},p(e,[n]){e[1]?r?(r.p(e,n),2&n&&pt(r,1)):(r=Et(e),r.c(),pt(r,1),r.m(t,null)):r&&(ct(),dt(r,1,1,()=>{r=null}),ht())},i(e){n||(pt(r),n=!0)},o(e){dt(r),n=!1},d(e){e&&Le(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 Ft extends bt{constructor(e){super(),yt(this,e,Tt,Ct,Oe,{step:0})}}function kt(e){let t,n,r,i,o;return{c(){t=Ne("button"),n=Ne("span"),n.textContent="×",Ve(n,"aria-hidden","true"),Ve(t,"aria-label",r=e[0].label?e[0].label:"Close Tour"),Ve(t,"class","shepherd-cancel-icon"),Ve(t,"type","button")},m(r,s){je(r,t,s),_e(t,n),i||(o=Ue(t,"click",e[1]),i=!0)},p(e,[n]){1&n&&r!==(r=e[0].label?e[0].label:"Close Tour")&&Ve(t,"aria-label",r)},i:Fe,o:Fe,d(e){e&&Le(t),i=!1,o()}}}function Dt(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 Rt extends bt{constructor(e){super(),yt(this,e,Dt,kt,Oe,{cancelIcon:0,step:2})}}function It(e){let t;return{c(){t=Ne("h3"),Ve(t,"id",e[1]),Ve(t,"class","shepherd-title")},m(n,r){je(n,t,r),e[3](t)},p(e,[n]){2&n&&Ve(t,"id",e[1])},i:Fe,o:Fe,d(n){n&&Le(t),e[3](null)}}}function Pt(e,t,n){let{labelId:r,element:i,title:o}=t;return Je(()=>{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){Qe[e?"unshift":"push"](()=>{i=e,n(0,i)})}]}class Ot extends bt{constructor(e){super(),yt(this,e,Pt,It,Oe,{labelId:1,element:0,title:2})}}function _t(e){let t,n;return t=new Ot({props:{labelId:e[0],title:e[2]}}),{c(){ft(t.$$.fragment)},m(e,r){gt(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||(pt(t.$$.fragment,e),n=!0)},o(e){dt(t.$$.fragment,e),n=!1},d(e){mt(t,e)}}}function jt(e){let t,n;return t=new Rt({props:{cancelIcon:e[3],step:e[1]}}),{c(){ft(t.$$.fragment)},m(e,r){gt(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||(pt(t.$$.fragment,e),n=!0)},o(e){dt(t.$$.fragment,e),n=!1},d(e){mt(t,e)}}}function Lt(e){let t,n,r,i=e[2]&&_t(e),o=e[3]&&e[3].enabled&&jt(e);return{c(){t=Ne("header"),i&&i.c(),n=He(),o&&o.c(),Ve(t,"class","shepherd-header")},m(e,s){je(e,t,s),i&&i.m(t,null),_e(t,n),o&&o.m(t,null),r=!0},p(e,[r]){e[2]?i?(i.p(e,r),4&r&&pt(i,1)):(i=_t(e),i.c(),pt(i,1),i.m(t,n)):i&&(ct(),dt(i,1,1,()=>{i=null}),ht()),e[3]&&e[3].enabled?o?(o.p(e,r),8&r&&pt(o,1)):(o=jt(e),o.c(),pt(o,1),o.m(t,null)):o&&(ct(),dt(o,1,1,()=>{o=null}),ht())},i(e){r||(pt(i),pt(o),r=!0)},o(e){dt(i),dt(o),r=!1},d(e){e&&Le(t),i&&i.d(),o&&o.d()}}}function Nt(e,t,n){let r,i,{labelId:o,step:s}=t;return e.$$set=e=>{"labelId"in e&&n(0,o=e.labelId),"step"in e&&n(1,s=e.step)},e.$$.update=()=>{2&e.$$.dirty&&(n(2,r=s.options.title),n(3,i=s.options.cancelIcon))},[o,s,r,i]}class Mt extends bt{constructor(e){super(),yt(this,e,Nt,Lt,Oe,{labelId:0,step:1})}}function Bt(e){let t;return{c(){t=Ne("div"),Ve(t,"class","shepherd-text"),Ve(t,"id",e[1])},m(n,r){je(n,t,r),e[3](t)},p(e,[n]){2&n&&Ve(t,"id",e[1])},i:Fe,o:Fe,d(n){n&&Le(t),e[3](null)}}}function Ht(e,t,n){let{descriptionId:r,element:i,step:o}=t;return Je(()=>{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){Qe[e?"unshift":"push"](()=>{i=e,n(0,i)})}]}class Ut extends bt{constructor(e){super(),yt(this,e,Ht,Bt,Oe,{descriptionId:1,element:0,step:2})}}function Vt(e){let t,n;return t=new Mt({props:{labelId:e[1],step:e[2]}}),{c(){ft(t.$$.fragment)},m(e,r){gt(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||(pt(t.$$.fragment,e),n=!0)},o(e){dt(t.$$.fragment,e),n=!1},d(e){mt(t,e)}}}function qt(e){let t,n;return t=new Ut({props:{descriptionId:e[0],step:e[2]}}),{c(){ft(t.$$.fragment)},m(e,r){gt(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||(pt(t.$$.fragment,e),n=!0)},o(e){dt(t.$$.fragment,e),n=!1},d(e){mt(t,e)}}}function zt(e){let t,n;return t=new Ft({props:{step:e[2]}}),{c(){ft(t.$$.fragment)},m(e,r){gt(t,e,r),n=!0},p(e,n){const r={};4&n&&(r.step=e[2]),t.$set(r)},i(e){n||(pt(t.$$.fragment,e),n=!0)},o(e){dt(t.$$.fragment,e),n=!1},d(e){mt(t,e)}}}function Kt(e){let t,n,r,i,o=!m(e[2].options.title)||e[2].options.cancelIcon&&e[2].options.cancelIcon.enabled,s=!m(e[2].options.text),a=Array.isArray(e[2].options.buttons)&&e[2].options.buttons.length,l=o&&Vt(e),u=s&&qt(e),c=a&&zt(e);return{c(){t=Ne("div"),l&&l.c(),n=He(),u&&u.c(),r=He(),c&&c.c(),Ve(t,"class","shepherd-content")},m(e,o){je(e,t,o),l&&l.m(t,null),_e(t,n),u&&u.m(t,null),_e(t,r),c&&c.m(t,null),i=!0},p(e,[i]){4&i&&(o=!m(e[2].options.title)||e[2].options.cancelIcon&&e[2].options.cancelIcon.enabled),o?l?(l.p(e,i),4&i&&pt(l,1)):(l=Vt(e),l.c(),pt(l,1),l.m(t,n)):l&&(ct(),dt(l,1,1,()=>{l=null}),ht()),4&i&&(s=!m(e[2].options.text)),s?u?(u.p(e,i),4&i&&pt(u,1)):(u=qt(e),u.c(),pt(u,1),u.m(t,r)):u&&(ct(),dt(u,1,1,()=>{u=null}),ht()),4&i&&(a=Array.isArray(e[2].options.buttons)&&e[2].options.buttons.length),a?c?(c.p(e,i),4&i&&pt(c,1)):(c=zt(e),c.c(),pt(c,1),c.m(t,null)):c&&(ct(),dt(c,1,1,()=>{c=null}),ht())},i(e){i||(pt(l),pt(u),pt(c),i=!0)},o(e){dt(l),dt(u),dt(c),i=!1},d(e){e&&Le(t),l&&l.d(),u&&u.d(),c&&c.d()}}}function Gt(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 Wt extends bt{constructor(e){super(),yt(this,e,Gt,Kt,Oe,{descriptionId:0,labelId:1,step:2})}}function Yt(e){let t;return{c(){t=Ne("div"),Ve(t,"class","shepherd-arrow"),Ve(t,"data-popper-arrow","")},m(e,n){je(e,t,n)},d(e){e&&Le(t)}}}function Jt(e){let t,n,r,i,o,s,a,l,u=e[4].options.arrow&&e[4].options.attachTo&&e[4].options.attachTo.element&&e[4].options.attachTo.on&&Yt();r=new Wt({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"}],h={};for(let e=0;e<c.length;e+=1)h=ke(h,c[e]);return{c(){t=Ne("div"),u&&u.c(),n=He(),ft(r.$$.fragment),ze(t,h),Ke(t,"shepherd-has-cancel-icon",e[5]),Ke(t,"shepherd-has-title",e[6]),Ke(t,"shepherd-element",!0)},m(i,o){je(i,t,o),u&&u.m(t,null),_e(t,n),gt(r,t,null),e[13](t),s=!0,a||(l=Ue(t,"keydown",e[7]),a=!0)},p(e,[a]){e[4].options.arrow&&e[4].options.attachTo&&e[4].options.attachTo.element&&e[4].options.attachTo.on?u||(u=Yt(),u.c(),u.m(t,n)):u&&(u.d(1),u=null);const l={};4&a&&(l.descriptionId=e[2]),8&a&&(l.labelId=e[3]),16&a&&(l.step=e[4]),r.$set(l),ze(t,h=function(e,t){const n={},r={},i={$$scope:1};let o=e.length;for(;o--;){const s=e[o],a=t[o];if(a){for(const e in s)e in a||(r[e]=1);for(const e in a)i[e]||(n[e]=a[e],i[e]=1);e[o]=a}else for(const e in s)i[e]=1}for(const e in r)e in n||(n[e]=void 0);return n}(c,[(!s||20&a&&i!==(i=m(e[4].options.text)?null:e[2]))&&{"aria-describedby":i},(!s||24&a&&o!==(o=e[4].options.title?e[3]:null))&&{"aria-labelledby":o},2&a&&e[1],{role:"dialog"},{tabindex:"0"}])),Ke(t,"shepherd-has-cancel-icon",e[5]),Ke(t,"shepherd-has-title",e[6]),Ke(t,"shepherd-element",!0)},i(e){s||(pt(r.$$.fragment,e),s=!0)},o(e){dt(r.$$.fragment,e),s=!1},d(n){n&&Le(t),u&&u.d(),mt(r),e[13](null),a=!1,l()}}}function Xt(e){return e.split(" ").filter(e=>!!e.length)}function Qt(e,t,n){let r,i,o,{classPrefix:s,element:a,descriptionId:l,firstFocusableElement:u,focusableElements:c,labelId:h,lastFocusableElement:p,step:d,dataStepId:f}=t;var m;m=()=>{n(1,f={[`data-${s}shepherd-step-id`]:d.id}),n(9,c=a.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex="0"]')),n(8,u=c[0]),n(10,p=c[c.length-1])},Ye().$$.on_mount.push(m),Je(()=>{o!==d.options.classes&&(function(e){if(g(e)){const t=Xt(e);t.length&&a.classList.remove(...t)}}(o),o=d.options.classes,function(e){if(g(e)){const t=Xt(e);t.length&&a.classList.add(...t)}}(o))});return e.$$set=e=>{"classPrefix"in e&&n(11,s=e.classPrefix),"element"in e&&n(0,a=e.element),"descriptionId"in e&&n(2,l=e.descriptionId),"firstFocusableElement"in e&&n(8,u=e.firstFocusableElement),"focusableElements"in e&&n(9,c=e.focusableElements),"labelId"in e&&n(3,h=e.labelId),"lastFocusableElement"in e&&n(10,p=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))},[a,f,l,h,d,r,i,e=>{const{tour:t}=d;switch(e.keyCode){case 9:if(0===c.length){e.preventDefault();break}e.shiftKey?(document.activeElement===u||document.activeElement.classList.contains("shepherd-element"))&&(e.preventDefault(),p.focus()):document.activeElement===p&&(e.preventDefault(),u.focus());break;case 27:t.options.exitOnEsc&&(e.stopPropagation(),d.cancel());break;case 37:t.options.keyboardNavigation&&(e.stopPropagation(),t.back());break;case 39:t.options.keyboardNavigation&&(e.stopPropagation(),t.next())}},u,c,p,s,()=>a,function(e){Qe[e?"unshift":"push"](()=>{a=e,n(0,a)})}]}class Zt extends bt{constructor(e){super(),yt(this,e,Qt,Jt,Oe,{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]}}class en extends v{constructor(e,t={}){return super(e,t),this.tour=e,this.classPrefix=this.tour.options?$(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(){var e;(e=this).cleanup&&e.cleanup(),e.cleanup=null,d(this.el)&&(this.el.remove(),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(){return f(this.options.beforeShowPromise)?Promise.resolve(this.options.beforeShowPromise()).then(()=>this._show()):Promise.resolve(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 Zt({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={}){let t=this.tour&&this.tour.options&&this.tour.options.defaultStepOptions;t=p({},t||{}),this.options=Object.assign({arrow:!0},t,e,function(e,t){return{floatingUIOptions:p(e.floatingUIOptions||{},t.floatingUIOptions||{})}}(t,e));const{when:n}=this.options;this.options.classes=this._getClassOptions(e),this.destroy(),this.id=this.options.id||"step-"+x(),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),Te(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 tn(e){let t,n,r,i,o;return{c(){t=Me("svg"),n=Me("path"),Ve(n,"d",e[2]),Ve(t,"class",r=(e[1]?"shepherd-modal-is-visible":"")+" shepherd-modal-overlay-container")},m(r,s){je(r,t,s),_e(t,n),e[11](t),i||(o=Ue(t,"touchmove",e[3]),i=!0)},p(e,[i]){4&i&&Ve(n,"d",e[2]),2&i&&r!==(r=(e[1]?"shepherd-modal-is-visible":"")+" shepherd-modal-overlay-container")&&Ve(t,"class",r)},i:Fe,o:Fe,d(n){n&&Le(t),e[11](null),i=!1,o()}}}function nn(e,t,n){let{element:r,openingProperties:i}=t;x();let o,s=!1,a=void 0;l();function l(){n(4,i={width:0,height:0,x:0,y:0,r:0})}function u(){n(1,s=!1),d()}function c(e=0,t=0,r,o){if(o){const{y:s,height:a}=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:l,width:u,left:c}=o.getBoundingClientRect();n(4,i={width:u+2*e,height:a+2*e,x:(l||c)-e,y:s-e,r:t})}else l()}function h(){n(1,s=!0)}const p=e=>{e.preventDefault()};function d(){a&&(cancelAnimationFrame(a),a=void 0),window.removeEventListener("touchmove",p,{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({width:e,height:t,x:n=0,y:r=0,r:i=0}){const{innerWidth:o,innerHeight:s}=window,{topLeft:a=0,topRight:l=0,bottomRight:u=0,bottomLeft:c=0}="number"==typeof i?{topLeft:i,topRight:i,bottomRight:i,bottomLeft:i}:i;return`M${o},${s}H0V0H${o}V${s}ZM${n+a},${r}a${a},${a},0,0,0-${a},${a}V${t+r-c}a${c},${c},0,0,0,${c},${c}H${e+n-u}a${u},${u},0,0,0,${u}-${u}V${r+l}a${l},${l},0,0,0-${l}-${l}Z`}(i))},[r,s,o,e=>{e.stopPropagation()},i,()=>r,l,u,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=()=>{a=void 0,c(t,n,r,e.target),a=requestAnimationFrame(i)};i(),window.addEventListener("touchmove",p,{passive:!1})}(e),h()):u()},h,function(e){Qe[e?"unshift":"push"](()=>{r=e,n(0,r)})}]}class rn extends bt{constructor(e){super(),yt(this,e,nn,tn,Oe,{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 on=new v;class sn extends v{constructor(e={}){super(e),y(this);this.options=Object.assign({},{exitOnEsc:!0,keyboardNavigation:!0},e),this.classPrefix=$(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,on.trigger(e,t)})})(e)}),this._setTourID(),this}addStep(e,t){let n=e;return n instanceof en?n.tour=this:n=new en(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)}async cancel(){if(this.options.confirmCancel){const e="function"==typeof this.options.confirmCancel,t=this.options.confirmCancelMessage||"Are you sure you want to stop the tour?";(e?await this.options.confirmCancel():window.confirm(t))&&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 on.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=0,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}),on.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}),on.activeTour=this}_setupModal(){this.modal=new rn({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}--${x()}`}}const an="undefined"==typeof window;class ln{constructor(){}}an?Object.assign(on,{Tour:ln,Step:ln}):Object.assign(on,{Tour:sn,Step:en});const un="shepherd.guide_id",cn="shepherd.guide.current.step.id",hn="shepherd.guide.step.history",pn="shepherd.guide.pause";function dn(e,t,n,i,o,s,a){this.guideCancelSubscription=void 0,this.onPause=()=>{},this.onCancel=()=>{},this.startGuide=(e,t,r,i=!0)=>{if(i&&n.remove(hn),!t)return;const o=this._createGuide(e);this._addGuideSteps(o,t),this._startGuide(o,r)},this.resumeGuide=(e,t,r)=>{n.set(pn,!1),this.startGuide(e,t,r,!1)},this.isActive=()=>on.activeTour&&!this.isPaused(),this.isPaused=()=>"true"===n.get(pn),this.getGuideId=()=>n.get(un),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 on.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,a)=>{n.remove(pn);let l=o.steps.findIndex(e=>e.options.id===a);l<0&&(l=0);const u=o.steps[l],c=u.options.url;c&&(e.url(c),i.reload()),u.options.attachTo?r.GuideUtils.waitFor(u.options.attachTo.element,u.options.maxWaitTime).then(()=>o.show(l)).catch(e=>{console.log(e),s.error(t.instant("guide.start.unexpected.error.message"))}):o.show(l)},this._subscribeToGuideCanceled=()=>{this.guideCancelSubscription||(this.guideCancelSubscription=on.on("cancel",()=>{this._clearLocaleStorage();const e=on.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()),s=[];return r.skipPoint&&s.push(this._getSkipButton(e)),n&&s.push(this._getPreviousButton(e)),i&&s.push(this._getNextButton(e,r,i)),o.buttons=s,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(pn,!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 a=n.getCurrentStep();a.hide(),a.options.initPreviousStep({GuideUtils:r.GuideUtils,ShepherdService:this},a.options.id).then(()=>{angular.isFunction(a.options.onPreviousClick)?a.options.onPreviousClick(n).then(e=>{!angular.isUndefined(e)&&null!==e&&e||(a.hide(),n.show(o.id))}).catch(e=>{console.log(e),s.error(t.instant("guide.unexpected.error.message")),this._cancelGuide(n,!1)}):((o.options.forceReload||o.options.url&&o.options.url!==a.options.url)&&e.path(o.options.url),a.hide(),n.show(o.id))}).catch(e=>{console.log(e),s.error(t.instant("guide.unexpected.error.message")),this._cancelGuide(n,!1)})},this._getNextButton=(e,n,r)=>{const i=t.instant("next.btn"),o=l(e,n,r);return this._getButton(i,o)};const l=(n,r,i)=>()=>{r.onNextValidate(r).then(o=>{if(o)if(angular.isFunction(r.onNextClick)){const e=r.onNextClick(n,r);e instanceof Promise&&e.catch(e=>{s.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=on.activeTour;if(!e)return;const t=e.getCurrentStep();if(t.options.skipFromHistory)return void console.log("Current step: ",t.options.skipFromHistory);const 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(un,e.tour.options.name),n.set(cn,e.options.id))},this._addStepToHistory=e=>{const t=this._getHistory();t.push(e.options.id),n.set(hn,t)},this._getHistory=()=>{const e=n.get(hn);return e||[]},this._removeLastStepFromHistory=()=>{const e=this._getHistory();e.splice(e.length-1,1),n.set(hn,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 on.activeTour.steps.find(e=>e.id===t)},this._clearLocaleStorage=()=>{n.remove(un),n.remove(pn),n.remove(cn),n.remove(hn)},this._toBaseGuideStep=(e,t,n,i)=>{let s;n.elementSelector&&(s={element:n.elementSelector,on:n.placement});const a=r.GuideUtils.unescapeHtml(r.GuideUtils.translateLocalMessage(t,o,n.title,n));let l="";if(n.stepsTotalN>1){const e=document.createElement("span");e.setAttribute("gdb-tooltip",t.instant("guide.block.progress.tooltip",{action:a})),e.setAttribute("tooltip-placement","bottom"),e.innerText=t.instant("guide.block.progress",{n:n.stepN+1,nn:n.stepsTotalN}),l=" — "+e.outerHTML}const u="readonly"!==n.type,c=n.extraPadding?n.extraPadding:0,h={id:n.id,title:a+l,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:s,modalOverlayOpeningPadding:c,modalOverlayOpeningRadius:0,canBePaused:n.canBePaused,advanceOn:n.advanceOn,showOn:n.showOn,scrollToHandler:n.scrollToHandler,classes:"guide-dialog "+n.class,beforeShowPromise:n.beforeShowPromise,canClickTarget:u,keyboardNavigation:!1,skipPoint:n.skipPoint,skipFromHistory:n.skipFromHistory,onPreviousClick:n.onPreviousClick,initPreviousStep:n.initPreviousStep,when:{show:this._getShowFunction(e,n,i)}};return angular.isFunction(n.hide)&&(h.when.hide=n.hide(e)),h},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=on.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(()=>a(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=on.activeTour.steps,i=n.querySelector(".shepherd-content"),o=document.createElement("div");o.className="shepherd-progress";const s=document.createElement("span");s.className="text-muted",s.innerText=t.instant("guide.total.progress",{n:r.indexOf(e)+1,nn:r.length}),s.setAttribute("gdb-tooltip",t.instant("guide.total.progress.tooltip")),s.setAttribute("tooltip-placement","left"),o.appendChild(s),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"]},18:function(e,t,n){(function(e,r){var i;
|
|
3
3
|
/**
|
|
4
4
|
* @license
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* @author Feross Aboukhadijeh <http://feross.org>
|
|
15
15
|
* @license MIT
|
|
16
16
|
*/
|
|
17
|
-
var r=n(445),i=n(446),o=n(447);function s(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(e,t){if(s()<t)throw new RangeError("Invalid typed array length");return l.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=l.prototype:(null===e&&(e=new l(t)),e.length=t),e}function l(e,t,n){if(!(l.TYPED_ARRAY_SUPPORT||this instanceof l))return new l(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 h(this,e)}return u(this,e,t,n)}function u(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);l.TYPED_ARRAY_SUPPORT?(e=t).__proto__=l.prototype:e=p(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!l.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|f(t,n),i=(e=a(e,r)).write(t,n);i!==r&&(e=e.slice(0,i));return e}(e,t,n):function(e,t){if(l.isBuffer(t)){var n=0|d(t.length);return 0===(e=a(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?a(e,0):p(e,t);if("Buffer"===t.type&&o(t.data))return p(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 h(e,t){if(c(t),e=a(e,t<0?0:0|d(t)),!l.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function p(e,t){var n=t.length<0?0:0|d(t.length);e=a(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function d(e){if(e>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|e}function f(e,t){if(l.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 B(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return H(e).length;default:if(r)return B(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 k(this,t,n);case"utf8":case"utf-8":return C(this,t,n);case"ascii":return T(this,t,n);case"latin1":case"binary":return F(this,t,n);case"base64":return A(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(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=l.from(t,r)),l.isBuffer(t))return 0===t.length?-1:y(e,t,n,r,i);if("number"==typeof t)return t&=255,l.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,s=1,a=e.length,l=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;s=2,a/=2,l/=2,n/=2}function u(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var c=-1;for(o=n;o<a;o++)if(u(e,o)===u(t,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===l)return c*s}else-1!==c&&(o-=o-c),c=-1}else for(n+l>a&&(n=a-l),o=n;o>=0;o--){for(var h=!0,p=0;p<l;p++)if(u(e,o+p)!==u(t,p)){h=!1;break}if(h)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 s=0;s<r;++s){var a=parseInt(t.substr(2*s,2),16);if(isNaN(a))return s;e[n+s]=a}return s}function $(e,t,n,r){return U(B(t,e.length-n),e,n,r)}function w(e,t,n,r){return U(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function x(e,t,n,r){return w(e,t,n,r)}function S(e,t,n,r){return U(H(t),e,n,r)}function E(e,t,n,r){return U(function(e,t){for(var n,r,i,o=[],s=0;s<e.length&&!((t-=2)<0);++s)n=e.charCodeAt(s),r=n>>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function A(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,s,a,l,u=e[i],c=null,h=u>239?4:u>223?3:u>191?2:1;if(i+h<=n)switch(h){case 1:u<128&&(c=u);break;case 2:128==(192&(o=e[i+1]))&&(l=(31&u)<<6|63&o)>127&&(c=l);break;case 3:o=e[i+1],s=e[i+2],128==(192&o)&&128==(192&s)&&(l=(15&u)<<12|(63&o)<<6|63&s)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:o=e[i+1],s=e[i+2],a=e[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(l=(15&u)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&l<1114112&&(c=l)}null===c?(c=65533,h=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),i+=h}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=l,t.SlowBuffer=function(e){+e!=e&&(e=0);return l.alloc(+e)},t.INSPECT_MAX_BYTES=50,l.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=s(),l.poolSize=8192,l._augment=function(e){return e.__proto__=l.prototype,e},l.from=function(e,t,n){return u(null,e,t,n)},l.TYPED_ARRAY_SUPPORT&&(l.prototype.__proto__=Uint8Array.prototype,l.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&l[Symbol.species]===l&&Object.defineProperty(l,Symbol.species,{value:null,configurable:!0})),l.alloc=function(e,t,n){return function(e,t,n,r){return c(t),t<=0?a(e,t):void 0!==n?"string"==typeof r?a(e,t).fill(n,r):a(e,t).fill(n):a(e,t)}(null,e,t,n)},l.allocUnsafe=function(e){return h(null,e)},l.allocUnsafeSlow=function(e){return h(null,e)},l.isBuffer=function(e){return!(null==e||!e._isBuffer)},l.compare=function(e,t){if(!l.isBuffer(e)||!l.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},l.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}},l.concat=function(e,t){if(!o(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=l.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var s=e[n];if(!l.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(r,i),i+=s.length}return r},l.byteLength=f,l.prototype._isBuffer=!0,l.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},l.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},l.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},l.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?C(this,0,e):g.apply(this,arguments)},l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.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+">"},l.prototype.compare=function(e,t,n,r,i){if(!l.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),s=(n>>>=0)-(t>>>=0),a=Math.min(o,s),u=this.slice(r,i),c=e.slice(t,n),h=0;h<a;++h)if(u[h]!==c[h]){o=u[h],s=c[h];break}return o<s?-1:s<o?1:0},l.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},l.prototype.indexOf=function(e,t,n){return v(this,e,t,n,!0)},l.prototype.lastIndexOf=function(e,t,n){return v(this,e,t,n,!1)},l.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 $(this,e,t,n);case"ascii":return w(this,e,t,n);case"latin1":case"binary":return x(this,e,t,n);case"base64":return S(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function T(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 F(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 k(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+=M(e[o]);return i}function D(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 I(e,t,n,r,i,o){if(!l.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 P(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 O(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 L(e,t,n,r,o){return o||_(e,0,n,8),i.write(e,t,n,r,52,8),n+8}l.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),l.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=l.prototype;else{var i=t-e;n=new l(i,void 0);for(var o=0;o<i;++o)n[o]=this[o+e]}return n},l.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},l.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},l.prototype.readUInt8=function(e,t){return t||R(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return t||R(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return t||R(e,2,this.length),this[e]<<8|this[e+1]},l.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]},l.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])},l.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},l.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},l.prototype.readInt8=function(e,t){return t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.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},l.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},l.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},l.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]},l.prototype.readFloatLE=function(e,t){return t||R(e,4,this.length),i.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return t||R(e,4,this.length),i.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return t||R(e,8,this.length),i.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return t||R(e,8,this.length),i.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||I(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},l.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||I(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},l.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,1,255,0),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},l.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):P(this,e,t,!0),t+2},l.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):P(this,e,t,!1),t+2},l.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):O(this,e,t,!0),t+4},l.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):O(this,e,t,!1),t+4},l.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);I(this,e,t,n,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o<n&&(s*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+n},l.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);I(this,e,t,n,i-1,-i)}var o=n-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+n},l.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,1,127,-128),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):P(this,e,t,!0),t+2},l.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):P(this,e,t,!1),t+2},l.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):O(this,e,t,!0),t+4},l.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):O(this,e,t,!1),t+4},l.prototype.writeFloatLE=function(e,t,n){return j(this,e,t,!0,n)},l.prototype.writeFloatBE=function(e,t,n){return j(this,e,t,!1,n)},l.prototype.writeDoubleLE=function(e,t,n){return L(this,e,t,!0,n)},l.prototype.writeDoubleBE=function(e,t,n){return L(this,e,t,!1,n)},l.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||!l.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},l.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&&!l.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 s=l.isBuffer(e)?e:B(new l(e,r).toString()),a=s.length;for(o=0;o<n-t;++o)this[o+t]=s[o%a]}return this};var N=/[^+\/0-9A-Za-z-_]/g;function M(e){return e<16?"0"+e.toString(16):e.toString(16)}function B(e,t){var n;t=t||1/0;for(var r=e.length,i=null,o=[],s=0;s<r;++s){if((n=e.charCodeAt(s))>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+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 H(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(N,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function U(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(15))},324:function(e,t,n){var r,i,o;/*! angularjs-slider - v7.1.0 - (c) Rafal Zajac <rzajac@gmail.com>, Valentin Hervieu <valentin@hervi.eu>, Jussi Saarivirta <jusasi@gmail.com>, Angelin Sirbu <angelin.sirbu@gmail.com> - https://github.com/angular-slider/angularjs-slider - 2022-05-26 */!function(s,a){"use strict";i=[n(86)],void 0===(o="function"==typeof(r=function(e){var t=e.module("rzSlider",[]).factory("RzSliderOptions",(function(){var t={floor:0,ceil:null,step:1,precision:0,minRange:null,maxRange:null,restrictedRange:null,skipRestrictedRangesWithArrowKeys:null,pushRange:!1,minLimit:null,maxLimit:null,id:null,translate:null,getLegend:null,stepsArray:null,bindIndexForStepsArray:!1,draggableRange:!1,draggableRangeOnly:!1,showSelectionBar:!1,showSelectionBarEnd:!1,showSelectionBarFromValue:null,showOuterSelectionBars:!1,hidePointerLabels:!1,hideLimitLabels:!1,autoHideLimitLabels:!0,readOnly:!1,disabled:!1,interval:350,showTicks:!1,showTicksValues:!1,ticksArray:null,ticksTooltip:null,ticksValuesTooltip:null,vertical:!1,getSelectionBarColor:null,getTickColor:null,getPointerColor:null,keyboardSupport:!0,scale:1,enforceStep:!0,enforceRange:!1,noSwitching:!1,onlyBindHandles:!1,disableAnimation:!1,onStart:null,onChange:null,onEnd:null,rightToLeft:!1,reversedControls:!1,boundPointerLabels:!0,mergeRangeLabelsIfSame:!1,labelOverlapSeparator:" - ",customTemplateScope:null,logScale:!1,customValueToPosition:null,customPositionToValue:null,selectionBarGradient:null,ariaLabel:null,ariaLabelledBy:null,ariaLabelHigh:null,ariaLabelledByHigh:null},n={},r={options:function(t){e.extend(n,t)},getOptions:function(r){return e.extend({},t,n,r)}};return r})).factory("rzThrottle",["$timeout",function(e){return function(t,n,r){var i,o,s,a=Date.now||function(){return(new Date).getTime()},l=null,u=0;r=r||{};var c=function(){u=a(),l=null,s=t.apply(i,o),i=o=null};return function(){var h=a(),p=n-(h-u);return i=this,o=arguments,0>=p?(e.cancel(l),l=null,u=h,s=t.apply(i,o),i=o=null):l||!1===r.trailing||(l=e(c,p)),s}}}]).factory("RzSlider",["$timeout","$document","$window","$compile","RzSliderOptions","rzThrottle",function(t,n,r,i,o,s){var a=function(e,t){this.scope=e,this.lowValue=0,this.highValue=0,this.sliderElem=t,this.range=void 0!==this.scope.rzSliderModel&&void 0!==this.scope.rzSliderHigh,this.dragging={active:!1,value:0,difference:0,position:0,lowLimit:0,highLimit:0},this.positionProperty="left",this.dimensionProperty="width",this.handleHalfDim=0,this.maxPos=0,this.precision=0,this.step=1,this.tracking="",this.minValue=0,this.maxValue=0,this.valueRange=0,this.intermediateTicks=!1,this.initHasRun=!1,this.firstKeyDown=!1,this.internalChange=!1,this.cmbLabelShown=!1,this.currentFocusElement=null,this.moving=!1,this.fullBar=null,this.selBar=null,this.minH=null,this.maxH=null,this.flrLab=null,this.ceilLab=null,this.minLab=null,this.maxLab=null,this.cmbLab=null,this.ticks=null,this.init()};return a.prototype={init:function(){var t,n,i=this,o=function(){i.calcViewDimensions()};this.applyOptions(),this.syncLowValue(),this.range&&this.syncHighValue(),this.initElemHandles(),this.manageElementsStyle(),this.setDisabledState(),this.calcViewDimensions(),this.setMinAndMax(),this.updateRestrictionBar(),this.addAccessibility(),this.updateCeilLab(),this.updateFloorLab(),this.initHandles(),this.manageEventsBindings(),this.scope.$on("reCalcViewDimensions",o),e.element(r).on("resize",o),this.initHasRun=!0,this.options.disableAnimation&&this.sliderElem.addClass("noanimate"),t=s((function(){i.onLowHandleChange()}),i.options.interval),n=s((function(){i.onHighHandleChange()}),i.options.interval),this.scope.$on("rzSliderForceRender",(function(){i.resetLabelsValue(),t(),i.range&&n(),i.resetSlider()})),this.scope.$watchCollection("rzSliderOptions()",(function(e,t){e!==t&&(i.applyOptions(),i.syncLowValue(),i.range&&i.syncHighValue(),i.resetSlider())})),this.scope.$watch("rzSliderModel",(function(e,n){i.internalChange||e!==n&&t()})),this.scope.$watch("rzSliderHigh",(function(e,t){i.internalChange||e!==t&&(null!=e&&n(),(i.range&&null==e||!i.range&&null!=e)&&(i.applyOptions(),i.resetSlider()))})),this.scope.$on("$destroy",(function(){i.unbindEvents(),e.element(r).off("resize",o),i.currentFocusElement=null}))},findStepIndex:function(t){for(var n=0,r=0;r<this.options.stepsArray.length;r++){var i=this.options.stepsArray[r];if(i===t){n=r;break}if(e.isDate(i)){if(i.getTime()===t.getTime()){n=r;break}}else if(e.isObject(i)&&(e.isDate(i.value)&&i.value.getTime()===t.getTime()||i.value===t)){n=r;break}}return n},syncLowValue:function(){this.options.stepsArray?this.options.bindIndexForStepsArray?this.lowValue=this.scope.rzSliderModel:this.lowValue=this.findStepIndex(this.scope.rzSliderModel):this.lowValue=this.scope.rzSliderModel},syncHighValue:function(){this.options.stepsArray?this.options.bindIndexForStepsArray?this.highValue=this.scope.rzSliderHigh:this.highValue=this.findStepIndex(this.scope.rzSliderHigh):this.highValue=this.scope.rzSliderHigh},getStepValue:function(t){var n=this.options.stepsArray[t];return e.isDate(n)?n:e.isObject(n)?n.value:n},applyLowValue:function(){this.options.stepsArray?this.options.bindIndexForStepsArray?this.scope.rzSliderModel=this.lowValue:this.scope.rzSliderModel=this.getStepValue(this.lowValue):this.scope.rzSliderModel=this.lowValue},applyHighValue:function(){this.options.stepsArray?this.options.bindIndexForStepsArray?this.scope.rzSliderHigh=this.highValue:this.scope.rzSliderHigh=this.getStepValue(this.highValue):this.scope.rzSliderHigh=this.highValue},onLowHandleChange:function(){this.syncLowValue(),this.range&&this.syncHighValue(),this.setMinAndMax(),this.updateLowHandle(this.valueToPosition(this.lowValue)),this.updateSelectionBar(),this.updateTicksScale(),this.updateAriaAttributes(),this.range&&this.updateCmbLabel()},onHighHandleChange:function(){this.syncLowValue(),this.syncHighValue(),this.setMinAndMax(),this.updateHighHandle(this.valueToPosition(this.highValue)),this.updateSelectionBar(),this.updateTicksScale(),this.updateCmbLabel(),this.updateAriaAttributes()},applyOptions:function(){var t;t=this.scope.rzSliderOptions?this.scope.rzSliderOptions():{},this.options=o.getOptions(t),this.options.step<=0&&(this.options.step=1),this.range=void 0!==this.scope.rzSliderModel&&void 0!==this.scope.rzSliderHigh,this.options.draggableRange=this.range&&this.options.draggableRange,this.options.draggableRangeOnly=this.range&&this.options.draggableRangeOnly,this.options.draggableRangeOnly&&(this.options.draggableRange=!0),this.options.showTicks=this.options.showTicks||this.options.showTicksValues||!!this.options.ticksArray,this.scope.showTicks=this.options.showTicks,(e.isNumber(this.options.showTicks)||this.options.ticksArray)&&(this.intermediateTicks=!0),this.options.showSelectionBar=this.options.showSelectionBar||this.options.showSelectionBarEnd||null!==this.options.showSelectionBarFromValue,this.options.stepsArray?this.parseStepsArray():(this.options.translate?this.customTrFn=this.options.translate:this.customTrFn=function(e){return String(e)},this.getLegend=this.options.getLegend),this.options.vertical?(this.positionProperty="bottom",this.dimensionProperty="height"):(this.positionProperty="left",this.dimensionProperty="width"),this.options.customTemplateScope&&(this.scope.custom=this.options.customTemplateScope)},parseStepsArray:function(){this.options.floor=0,this.options.ceil=this.options.stepsArray.length-1,this.options.step=1,this.options.translate?this.customTrFn=this.options.translate:this.customTrFn=function(e){return this.options.bindIndexForStepsArray?this.getStepValue(e):e},this.getLegend=function(t){var n=this.options.stepsArray[t];return e.isObject(n)?n.legend:null}},resetSlider:function(){this.resetLabelsValue(),this.manageElementsStyle(),this.addAccessibility(),this.setMinAndMax(),this.updateCeilLab(),this.updateFloorLab(),this.unbindEvents(),this.manageEventsBindings(),this.setDisabledState(),this.calcViewDimensions(),this.updateRestrictionBar(),this.refocusPointerIfNeeded()},refocusPointerIfNeeded:function(){this.currentFocusElement&&(this.onPointerFocus(this.currentFocusElement.pointer,this.currentFocusElement.ref),this.focusElement(this.currentFocusElement.pointer))},ensureRestrictedBarIsArray:function(t){var n=e.element(t);if(this.restrictedBar=[],this.options.restrictedRange){this.options.restrictedRange=Array.isArray(this.options.restrictedRange)?this.options.restrictedRange:[this.options.restrictedRange],this.restrictedBar[0]=n;for(var r=t.parentElement,i=1;i<this.options.restrictedRange.length;i++){var o=document.createElement("span");o.setAttribute("class","rz-bar-wrapper"),o.innerHTML='<span class="rz-bar rz-restricted" ng-style="restrictionStyle"></span>',r.appendChild(o),this.restrictedBar[i]=e.element(o)}}else t.style.visibility="hidden",this.restrictedBar=null},initElemHandles:function(){e.forEach(this.sliderElem.children(),(function(t,n){var r=e.element(t);switch(n){case 0:this.leftOutSelBar=r;break;case 1:this.rightOutSelBar=r;break;case 2:this.fullBar=r;break;case 3:this.selBar=r;break;case 4:this.ensureRestrictedBarIsArray(t);break;case 5:this.minH=r;break;case 6:this.maxH=r;break;case 7:this.flrLab=r;break;case 8:this.ceilLab=r;break;case 9:this.minLab=r;break;case 10:this.maxLab=r;break;case 11:this.cmbLab=r;break;case 12:this.ticks=r}}),this),this.selBar.rzsp=0,this.minH.rzsp=0,this.maxH.rzsp=0,this.flrLab.rzsp=0,this.ceilLab.rzsp=0,this.minLab.rzsp=0,this.maxLab.rzsp=0,this.cmbLab.rzsp=0},manageElementsStyle:function(){this.range?this.maxH.css("display",""):this.maxH.css("display","none"),this.alwaysHide(this.flrLab,this.options.showTicksValues||this.options.hideLimitLabels),this.alwaysHide(this.ceilLab,this.options.showTicksValues||this.options.hideLimitLabels);var e=this.options.showTicksValues&&!this.intermediateTicks;for(var t in this.alwaysHide(this.minLab,e||this.options.hidePointerLabels),this.alwaysHide(this.maxLab,e||!this.range||this.options.hidePointerLabels),this.alwaysHide(this.cmbLab,e||!this.range||this.options.hidePointerLabels),this.alwaysHide(this.selBar,!this.range&&!this.options.showSelectionBar),this.alwaysHide(this.leftOutSelBar,!this.range||!this.options.showOuterSelectionBars),this.restrictedBar)this.restrictedBar[t]&&this.alwaysHide(this.restrictedBar[t],!this.options.restrictedRange[t]);this.alwaysHide(this.rightOutSelBar,!this.range||!this.options.showOuterSelectionBars),this.range&&this.options.showOuterSelectionBars&&this.fullBar.addClass("rz-transparent"),this.options.vertical?this.sliderElem.addClass("rz-vertical"):this.sliderElem.removeClass("rz-vertical"),this.options.draggableRange?this.selBar.addClass("rz-draggable"):this.selBar.removeClass("rz-draggable"),this.intermediateTicks&&this.options.showTicksValues&&this.ticks.addClass("rz-ticks-values-under")},alwaysHide:function(e,t){e.rzAlwaysHide=t,t?this.hideEl(e):this.showEl(e)},manageEventsBindings:function(){this.options.disabled||this.options.readOnly?this.unbindEvents():this.bindEvents()},setDisabledState:function(){this.options.disabled?this.sliderElem.attr("disabled","disabled"):this.sliderElem.attr("disabled",null)},resetLabelsValue:function(){this.minLab.rzsv=void 0,this.maxLab.rzsv=void 0,this.flrLab.rzsv=void 0,this.ceilLab.rzsv=void 0,this.cmbLab.rzsv=void 0,this.resetPosition(this.flrLab),this.resetPosition(this.ceilLab),this.resetPosition(this.cmbLab),this.resetPosition(this.minLab),this.resetPosition(this.maxLab)},initHandles:function(){this.updateLowHandle(this.valueToPosition(this.lowValue)),this.range&&this.updateHighHandle(this.valueToPosition(this.highValue)),this.updateSelectionBar(),this.range&&this.updateCmbLabel(),this.updateTicksScale()},translateFn:function(e,t,n,r){r=void 0===r||r;var i="",o=!1,s=t.hasClass("no-label-injection");r?(this.options.stepsArray&&!this.options.bindIndexForStepsArray&&(e=this.getStepValue(e)),i=String(this.customTrFn(e,this.options.id,n))):i=String(e),(void 0===t.rzsv||t.rzsv.length!==i.length||t.rzsv.length>0&&0===t.rzsd)&&(o=!0,t.rzsv=i),s||t.html(i),this.scope[n+"Label"]=i,o&&this.getDimension(t)},setMinAndMax:function(){if(this.step=+this.options.step,this.precision=+this.options.precision,this.minValue=this.options.floor,this.options.logScale&&0===this.minValue)throw Error("Can't use floor=0 with logarithmic scale");this.options.enforceStep&&(this.lowValue=this.roundStep(this.lowValue),this.range&&(this.highValue=this.roundStep(this.highValue))),null!=this.options.ceil?this.maxValue=this.options.ceil:this.maxValue=this.options.ceil=this.range?this.highValue:this.lowValue,this.options.enforceRange&&(this.lowValue=this.sanitizeValue(this.lowValue),this.range&&(this.highValue=this.sanitizeValue(this.highValue))),this.applyLowValue(),this.range&&this.applyHighValue(),this.valueRange=this.maxValue-this.minValue},addAccessibility:function(){this.minH.attr("role","slider"),this.updateAriaAttributes(),!this.options.keyboardSupport||this.options.readOnly||this.options.disabled?this.minH.attr("tabindex",""):this.minH.attr("tabindex","0"),this.options.vertical?this.minH.attr("aria-orientation","vertical"):this.minH.attr("aria-orientation","horizontal"),this.options.ariaLabel?this.minH.attr("aria-label",this.options.ariaLabel):this.options.ariaLabelledBy&&this.minH.attr("aria-labelledby",this.options.ariaLabelledBy),this.range&&(this.maxH.attr("role","slider"),!this.options.keyboardSupport||this.options.readOnly||this.options.disabled?this.maxH.attr("tabindex",""):this.maxH.attr("tabindex","0"),this.options.vertical?this.maxH.attr("aria-orientation","vertical"):this.maxH.attr("aria-orientation","horizontal"),this.options.ariaLabelHigh?this.maxH.attr("aria-label",this.options.ariaLabelHigh):this.options.ariaLabelledByHigh&&this.maxH.attr("aria-labelledby",this.options.ariaLabelledByHigh))},updateAriaAttributes:function(){this.minH.attr({"aria-valuenow":this.scope.rzSliderModel,"aria-valuetext":this.customTrFn(this.scope.rzSliderModel,this.options.id,"model"),"aria-valuemin":this.minValue,"aria-valuemax":this.maxValue}),this.range&&this.maxH.attr({"aria-valuenow":this.scope.rzSliderHigh,"aria-valuetext":this.customTrFn(this.scope.rzSliderHigh,this.options.id,"high"),"aria-valuemin":this.minValue,"aria-valuemax":this.maxValue})},calcViewDimensions:function(){var e=this.getDimension(this.minH);if(this.handleHalfDim=e/2,this.barDimension=this.getDimension(this.fullBar),this.maxPos=this.barDimension-e,this.getDimension(this.sliderElem),this.sliderElem.rzsp=this.sliderElem[0].getBoundingClientRect()[this.positionProperty],this.initHasRun){this.updateFloorLab(),this.updateCeilLab(),this.initHandles();var n=this;t((function(){n.updateTicksScale()}))}},updateTicksScale:function(){if(this.options.showTicks){var t=this.options.ticksArray||this.getTicksArray(),n=this.options.vertical?"translateY":"translateX",r=this;this.options.rightToLeft&&t.reverse(),this.scope.ticks=t.map((function(t){var i=null;e.isObject(t)&&(i=t.legend,t=t.value);var o=r.valueToPosition(t);r.options.vertical&&(o=r.maxPos-o);var s=n+"("+Math.round(o)+"px)",a={legend:i,selected:r.isTickSelected(t),style:{"-webkit-transform":s,"-moz-transform":s,"-o-transform":s,"-ms-transform":s,transform:s}};return a.selected&&r.options.getSelectionBarColor&&(a.style["background-color"]=r.getSelectionBarColor()),!a.selected&&r.options.getTickColor&&(a.style["background-color"]=r.getTickColor(t)),r.options.ticksTooltip&&(a.tooltip=r.options.ticksTooltip(t),a.tooltipPlacement=r.options.vertical?"right":"top"),(!0===r.options.showTicksValues||t%r.options.showTicksValues==0)&&(a.value=r.getDisplayValue(t,"tick-value"),r.options.ticksValuesTooltip&&(a.valueTooltip=r.options.ticksValuesTooltip(t),a.valueTooltipPlacement=r.options.vertical?"right":"top")),r.getLegend&&((i=r.getLegend(t,r.options.id))&&(a.legend=i)),a}))}},getTicksArray:function(){var e=this.step,t=[];this.intermediateTicks&&(e=this.options.showTicks);for(var n=this.minValue;n<=this.maxValue;n+=e)t.push(n);return t},isTickSelected:function(e){if(!this.range)if(null!==this.options.showSelectionBarFromValue){var t=this.options.showSelectionBarFromValue;if(this.lowValue>t&&e>=t&&e<=this.lowValue)return!0;if(this.lowValue<t&&t>=e&&e>=this.lowValue)return!0}else if(this.options.showSelectionBarEnd){if(e>=this.lowValue)return!0}else if(this.options.showSelectionBar&&e<=this.lowValue)return!0;return!!(this.range&&e>=this.lowValue&&e<=this.highValue)},updateFloorLab:function(){this.translateFn(this.minValue,this.flrLab,"floor"),this.getDimension(this.flrLab);var e=this.options.rightToLeft?this.barDimension-this.flrLab.rzsd:0;this.setPosition(this.flrLab,e)},updateCeilLab:function(){this.translateFn(this.maxValue,this.ceilLab,"ceil"),this.getDimension(this.ceilLab);var e=this.options.rightToLeft?0:this.barDimension-this.ceilLab.rzsd;this.setPosition(this.ceilLab,e)},updateHandles:function(e,t){"lowValue"===e?this.updateLowHandle(t):this.updateHighHandle(t),this.updateSelectionBar(),this.updateTicksScale(),this.range&&this.updateCmbLabel()},getHandleLabelPos:function(e,t){var n=this[e].rzsd,r=t-n/2+this.handleHalfDim,i=this.barDimension-n;return this.options.boundPointerLabels?this.options.rightToLeft&&"minLab"===e||!this.options.rightToLeft&&"maxLab"===e?Math.min(r,i):Math.min(Math.max(r,0),i):r},updateLowHandle:function(e){if(this.setPosition(this.minH,e),this.translateFn(this.lowValue,this.minLab,"model"),this.setPosition(this.minLab,this.getHandleLabelPos("minLab",e)),this.options.getPointerColor){var t=this.getPointerColor("min");this.scope.minPointerStyle={backgroundColor:t}}this.options.autoHideLimitLabels&&this.shFloorCeil()},updateHighHandle:function(e){if(this.setPosition(this.maxH,e),this.translateFn(this.highValue,this.maxLab,"high"),this.setPosition(this.maxLab,this.getHandleLabelPos("maxLab",e)),this.options.getPointerColor){var t=this.getPointerColor("max");this.scope.maxPointerStyle={backgroundColor:t}}this.options.autoHideLimitLabels&&this.shFloorCeil()},shFloorCeil:function(){if(!this.options.hidePointerLabels){var e=!1,t=!1,n=this.isLabelBelowFloorLab(this.minLab),r=this.isLabelAboveCeilLab(this.minLab),i=this.isLabelAboveCeilLab(this.maxLab),o=this.isLabelBelowFloorLab(this.cmbLab),s=this.isLabelAboveCeilLab(this.cmbLab);if(n?(e=!0,this.hideEl(this.flrLab)):(e=!1,this.showEl(this.flrLab)),r?(t=!0,this.hideEl(this.ceilLab)):(t=!1,this.showEl(this.ceilLab)),this.range){var a=this.cmbLabelShown?s:i,l=this.cmbLabelShown?o:n;a?this.hideEl(this.ceilLab):t||this.showEl(this.ceilLab),l?this.hideEl(this.flrLab):e||this.showEl(this.flrLab)}}},isLabelBelowFloorLab:function(e){var t=this.options.rightToLeft,n=e.rzsp,r=e.rzsd,i=this.flrLab.rzsp,o=this.flrLab.rzsd;return t?n+r>=i-2:i+o+2>=n},isLabelAboveCeilLab:function(e){var t=this.options.rightToLeft,n=e.rzsp,r=e.rzsd,i=this.ceilLab.rzsp,o=this.ceilLab.rzsd;return t?i+o+2>=n:n+r>=i-2},updateRestrictionBar:function(){var e=0,t=0;if(this.options.restrictedRange)for(var n in this.options.restrictedRange=Array.isArray(this.options.restrictedRange)?this.options.restrictedRange:[this.options.restrictedRange],this.options.restrictedRange){var r=this.valueToPosition(this.options.restrictedRange[n].from),i=this.valueToPosition(this.options.restrictedRange[n].to);t=Math.abs(i-r),e=this.options.rightToLeft?i+this.handleHalfDim:r+this.handleHalfDim,this.setDimension(this.restrictedBar[n],t),this.setPosition(this.restrictedBar[n],e)}},updateSelectionBar:function(){var e=0,t=0,n=this.options.rightToLeft?!this.options.showSelectionBarEnd:this.options.showSelectionBarEnd,r=this.options.rightToLeft?this.maxH.rzsp+this.handleHalfDim:this.minH.rzsp+this.handleHalfDim;if(this.range)t=Math.abs(this.maxH.rzsp-this.minH.rzsp),e=r;else if(null!==this.options.showSelectionBarFromValue){var i=this.options.showSelectionBarFromValue,o=this.valueToPosition(i);(this.options.rightToLeft?this.lowValue<=i:this.lowValue>i)?(t=this.minH.rzsp-o,e=o+this.handleHalfDim):(t=o-this.minH.rzsp,e=this.minH.rzsp+this.handleHalfDim)}else n?(t=Math.abs(this.maxPos-this.minH.rzsp)+this.handleHalfDim,e=this.minH.rzsp+this.handleHalfDim):(t=this.minH.rzsp+this.handleHalfDim,e=0);if(this.setDimension(this.selBar,t),this.setPosition(this.selBar,e),this.range&&this.options.showOuterSelectionBars&&(this.options.rightToLeft?(this.setDimension(this.rightOutSelBar,e),this.setPosition(this.rightOutSelBar,0),this.setDimension(this.leftOutSelBar,this.getDimension(this.fullBar)-(e+t)),this.setPosition(this.leftOutSelBar,e+t)):(this.setDimension(this.leftOutSelBar,e),this.setPosition(this.leftOutSelBar,0),this.setDimension(this.rightOutSelBar,this.getDimension(this.fullBar)-(e+t)),this.setPosition(this.rightOutSelBar,e+t))),this.options.getSelectionBarColor){var s=this.getSelectionBarColor();this.scope.barStyle={backgroundColor:s}}else if(this.options.selectionBarGradient){var a=null!==this.options.showSelectionBarFromValue?this.valueToPosition(this.options.showSelectionBarFromValue):0,l=a-e>0^n,u=this.options.vertical?l?"bottom":"top":l?"left":"right";this.scope.barStyle={backgroundImage:"linear-gradient(to "+u+", "+this.options.selectionBarGradient.from+" 0%,"+this.options.selectionBarGradient.to+" 100%)"},this.options.vertical?(this.scope.barStyle.backgroundPosition="center "+(a+t+e+(l?-this.handleHalfDim:0))+"px",this.scope.barStyle.backgroundSize="100% "+(this.barDimension-this.handleHalfDim)+"px"):(this.scope.barStyle.backgroundPosition=a-e+(l?this.handleHalfDim:0)+"px center",this.scope.barStyle.backgroundSize=this.barDimension-this.handleHalfDim+"px 100%")}},getSelectionBarColor:function(){return this.range?this.options.getSelectionBarColor(this.scope.rzSliderModel,this.scope.rzSliderHigh):this.options.getSelectionBarColor(this.scope.rzSliderModel)},getPointerColor:function(e){return"max"===e?this.options.getPointerColor(this.scope.rzSliderHigh,e):this.options.getPointerColor(this.scope.rzSliderModel,e)},getTickColor:function(e){return this.options.getTickColor(e)},updateCmbLabel:function(){if(this.options.rightToLeft?this.minLab.rzsp-this.minLab.rzsd-10<=this.maxLab.rzsp:this.minLab.rzsp+this.minLab.rzsd+10>=this.maxLab.rzsp){var e,t=this.getDisplayValue(this.lowValue,"model"),n=this.getDisplayValue(this.highValue,"high");e=this.options.mergeRangeLabelsIfSame&&t===n?t:this.options.rightToLeft?n+this.options.labelOverlapSeparator+t:t+this.options.labelOverlapSeparator+n,this.translateFn(e,this.cmbLab,"cmb",!1);var r=this.options.boundPointerLabels?Math.min(Math.max(this.selBar.rzsp+this.selBar.rzsd/2-this.cmbLab.rzsd/2,0),this.barDimension-this.cmbLab.rzsd):this.selBar.rzsp+this.selBar.rzsd/2-this.cmbLab.rzsd/2;this.setPosition(this.cmbLab,r),this.cmbLabelShown=!0,this.hideEl(this.minLab),this.hideEl(this.maxLab),this.showEl(this.cmbLab)}else this.cmbLabelShown=!1,this.updateHighHandle(this.valueToPosition(this.highValue)),this.updateLowHandle(this.valueToPosition(this.lowValue)),this.showEl(this.maxLab),this.showEl(this.minLab),this.hideEl(this.cmbLab);this.options.autoHideLimitLabels&&this.shFloorCeil()},getDisplayValue:function(e,t){return this.options.stepsArray&&!this.options.bindIndexForStepsArray&&(e=this.getStepValue(e)),this.customTrFn(e,this.options.id,t)},roundStep:function(e,t){var n=t||this.step,r=parseFloat((e-this.minValue)/n).toPrecision(12);return r=Math.round(+r)*n,+(this.minValue+r).toFixed(this.precision)},hideEl:function(e){return e.css({visibility:"hidden"})},showEl:function(e){return e.rzAlwaysHide?e:e.css({visibility:"visible"})},setPosition:function(e,t){e.rzsp=t;var n={};return n[this.positionProperty]=Math.round(t)+"px",e.css(n),t},resetPosition:function(e){e.css({left:null,bottom:null})},getDimension:function(e){var t=e[0].getBoundingClientRect();return this.options.vertical?e.rzsd=(t.bottom-t.top)*this.options.scale:e.rzsd=(t.right-t.left)*this.options.scale,e.rzsd},setDimension:function(e,t){e.rzsd=t;var n={};return n[this.dimensionProperty]=Math.round(t)+"px",e.css(n),t},sanitizeValue:function(e){return Math.min(Math.max(e,this.minValue),this.maxValue)},valueToPosition:function(e){var t=this.linearValueToPosition;this.options.customValueToPosition?t=this.options.customValueToPosition:this.options.logScale&&(t=this.logValueToPosition);var n=t(e=this.sanitizeValue(e),this.minValue,this.maxValue)||0;return this.options.rightToLeft&&(n=1-n),n*this.maxPos},linearValueToPosition:function(e,t,n){return(e-t)/(n-t)},logValueToPosition:function(e,t,n){return((e=Math.log(e))-(t=Math.log(t)))/((n=Math.log(n))-t)},positionToValue:function(e){var t=e/this.maxPos;this.options.rightToLeft&&(t=1-t);var n=this.linearPositionToValue;return this.options.customPositionToValue?n=this.options.customPositionToValue:this.options.logScale&&(n=this.logPositionToValue),n(t,this.minValue,this.maxValue)||0},linearPositionToValue:function(e,t,n){return e*(n-t)+t},logPositionToValue:function(e,t,n){t=Math.log(t);var r=e*((n=Math.log(n))-t)+t;return Math.exp(r)},getEventAttr:function(e,t){return void 0===e.originalEvent?e[t]:e.originalEvent[t]},getEventXY:function(e,t){var n=this.options.vertical?"clientY":"clientX";if(void 0!==e[n])return e[n];var r=this.getEventAttr(e,"touches");if(void 0!==t)for(var i=0;i<r.length;i++)if(r[i].identifier===t)return r[i][n];return r[0][n]},getEventPosition:function(e,t){var n=this.sliderElem.rzsp;return(this.options.vertical?-this.getEventXY(e,t)+n:this.getEventXY(e,t)-n)*this.options.scale-this.handleHalfDim},getEventNames:function(e){var t={moveEvent:"",endEvent:""};return this.getEventAttr(e,"touches")?(t.moveEvent="touchmove",t.endEvent="touchend"):(t.moveEvent="mousemove",t.endEvent="mouseup"),t},getNearestHandle:function(e){if(!this.range)return this.minH;var t=this.getEventPosition(e),n=Math.abs(t-this.minH.rzsp),r=Math.abs(t-this.maxH.rzsp);return r>n?this.minH:n>r?this.maxH:this.options.rightToLeft?t>this.minH.rzsp?this.minH:this.maxH:t<this.minH.rzsp?this.minH:this.maxH},focusElement:function(e){e[0].focus()},bindEvents:function(){var t,n,r;this.options.draggableRange?(t="rzSliderDrag",n=this.onDragStart,r=this.onDragMove):(t="lowValue",n=this.onStart,r=this.onMove),this.options.onlyBindHandles||(this.selBar.on("mousedown",e.bind(this,n,null,t)),this.selBar.on("mousedown",e.bind(this,r,this.selBar))),this.options.draggableRangeOnly?(this.minH.on("mousedown",e.bind(this,n,null,t)),this.maxH.on("mousedown",e.bind(this,n,null,t))):(this.minH.on("mousedown",e.bind(this,this.onStart,this.minH,"lowValue")),this.range&&this.maxH.on("mousedown",e.bind(this,this.onStart,this.maxH,"highValue")),this.options.onlyBindHandles||(this.fullBar.on("mousedown",e.bind(this,this.onStart,null,null)),this.fullBar.on("mousedown",e.bind(this,this.onMove,this.fullBar)),this.ticks.on("mousedown",e.bind(this,this.onStart,null,null)),this.ticks.on("mousedown",e.bind(this,this.onTickClick,this.ticks)))),this.options.onlyBindHandles||(this.selBar.on("touchstart",e.bind(this,n,null,t)),this.selBar.on("touchstart",e.bind(this,r,this.selBar))),this.options.draggableRangeOnly?(this.minH.on("touchstart",e.bind(this,n,null,t)),this.maxH.on("touchstart",e.bind(this,n,null,t))):(this.minH.on("touchstart",e.bind(this,this.onStart,this.minH,"lowValue")),this.range&&this.maxH.on("touchstart",e.bind(this,this.onStart,this.maxH,"highValue")),this.options.onlyBindHandles||(this.fullBar.on("touchstart",e.bind(this,this.onStart,null,null)),this.fullBar.on("touchstart",e.bind(this,this.onMove,this.fullBar)),this.ticks.on("touchstart",e.bind(this,this.onStart,null,null)),this.ticks.on("touchstart",e.bind(this,this.onTickClick,this.ticks)))),this.options.keyboardSupport&&(this.minH.on("focus",e.bind(this,this.onPointerFocus,this.minH,"lowValue")),this.range&&this.maxH.on("focus",e.bind(this,this.onPointerFocus,this.maxH,"highValue")))},unbindEvents:function(){this.minH.off(),this.maxH.off(),this.fullBar.off(),this.selBar.off(),this.ticks.off()},onStart:function(t,r,i){var o,s,a=this.getEventNames(i);i.stopPropagation(),i.preventDefault(),this.calcViewDimensions(),t?this.tracking=r:(t=this.getNearestHandle(i),this.tracking=t===this.minH?"lowValue":"highValue"),t.addClass("rz-active"),this.options.keyboardSupport&&this.focusElement(t),o=e.bind(this,this.dragging.active?this.onDragMove:this.onMove,t),s=e.bind(this,this.onEnd,o),n.on(a.moveEvent,o),n.on(a.endEvent,s),this.endHandlerToBeRemovedOnEnd=s,this.callOnStart();var l=this.getEventAttr(i,"changedTouches");l&&(this.touchId||(this.isDragging=!0,this.touchId=l[0].identifier))},onMove:function(t,n,r){this.options.disableAnimation||this.moving&&this.sliderElem.addClass("noanimate"),this.moving=!0;var i,o=this.getEventAttr(n,"changedTouches");if(o)for(var s=0;s<o.length;s++)if(o[s].identifier===this.touchId){i=o[s];break}if(!o||i){var a,l=this.getEventPosition(n,i?i.identifier:void 0),u=this.options.rightToLeft?this.minValue:this.maxValue,c=this.options.rightToLeft?this.maxValue:this.minValue;0>=l?a=c:l>=this.maxPos?a=u:(a=this.positionToValue(l),a=r&&e.isNumber(this.options.showTicks)?this.roundStep(a,this.options.showTicks):this.roundStep(a)),this.positionTrackingHandle(a)}},onEnd:function(e,t){this.moving=!1,this.options.disableAnimation||this.sliderElem.removeClass("noanimate");var r=this.getEventAttr(t,"changedTouches");if(!r||r[0].identifier===this.touchId){this.isDragging=!1,this.touchId=null,this.options.keyboardSupport||(this.minH.removeClass("rz-active"),this.maxH.removeClass("rz-active"),this.tracking=""),this.dragging.active=!1;var i=this.getEventNames(t);n.off(i.moveEvent,e),n.off(i.endEvent,this.endHandlerToBeRemovedOnEnd),this.endHandlerToBeRemovedOnEnd=null,this.callOnEnd()}},onTickClick:function(e,t){this.onMove(e,t,!0)},onPointerFocus:function(t,n){this.tracking=n,t.one("blur",e.bind(this,this.onPointerBlur,t)),t.on("keydown",e.bind(this,this.onKeyboardEvent)),t.on("keyup",e.bind(this,this.onKeyUp)),this.firstKeyDown=!0,t.addClass("rz-active"),this.currentFocusElement={pointer:t,ref:n}},onKeyUp:function(){this.firstKeyDown=!0,this.callOnEnd()},onPointerBlur:function(e){e.off("keydown"),e.off("keyup"),e.removeClass("rz-active"),this.isDragging||(this.tracking="",this.currentFocusElement=null)},skipRestrictedRanges:function(e,t){if(this.options.restrictedRange&&Array.isArray(this.options.restrictedRange))for(var n in this.options.restrictedRange){var r=this.options.restrictedRange[n];if(0===r.from&&0===t&&[37,40].includes(e)||r.to>=this.options.restrictedRange[this.options.restrictedRange.length-1].to&&t>=this.options.restrictedRange[this.options.restrictedRange.length-1].to&&[38,39].includes(e))return t;r.to>t&&t>r.from&&(t=Math.abs(r.to-t)>Math.abs(r.from-t)?r.to:r.from)}return t},getKeyActions:function(e){var t=e+this.step,n=e-this.step,r=e+this.valueRange/10,i=e-this.valueRange/10;this.options.reversedControls&&(t=e-this.step,n=e+this.step,r=e-this.valueRange/10,i=e+this.valueRange/10);var o={UP:t,DOWN:n,LEFT:n,RIGHT:t,PAGEUP:r,PAGEDOWN:i,HOME:this.options.reversedControls?this.maxValue:this.minValue,END:this.options.reversedControls?this.minValue:this.maxValue};return this.options.rightToLeft&&(o.LEFT=t,o.RIGHT=n,this.options.vertical&&(o.UP=n,o.DOWN=t)),o},onKeyboardEvent:function(e){var n=e.keyCode||e.which,r=this[this.tracking],i=this.getKeyActions(r)[{38:"UP",40:"DOWN",37:"LEFT",39:"RIGHT",33:"PAGEUP",34:"PAGEDOWN",36:"HOME",35:"END"}[n]];if(null!=i&&""!==this.tracking){e.preventDefault(),this.firstKeyDown&&(this.firstKeyDown=!1,this.callOnStart());var o=this;t((function(){var e=o.roundStep(o.sanitizeValue(i));if(e=o.options.skipRestrictedRangesWithArrowKeys?o.skipRestrictedRanges(n,e):e,o.options.draggableRangeOnly){var t,r,s=o.highValue-o.lowValue;"lowValue"===o.tracking?(t=e,(r=e+s)>o.maxValue&&(t=(r=o.maxValue)-s)):(r=e,(t=e-s)<o.minValue&&(r=(t=o.minValue)+s)),o.positionTrackingBar(t,r)}else o.positionTrackingHandle(e)}))}},onDragStart:function(e,t,n){var r=this.getEventPosition(n);this.dragging={active:!0,value:this.positionToValue(r),difference:this.highValue-this.lowValue,lowLimit:this.options.rightToLeft?this.minH.rzsp-r:r-this.minH.rzsp,highLimit:this.options.rightToLeft?r-this.maxH.rzsp:this.maxH.rzsp-r},this.onStart(e,t,n)},getValue:function(e,t,n,r){var i,o=this.options.rightToLeft;return i="min"===e?n?r?o?this.minValue:this.maxValue-this.dragging.difference:o?this.maxValue-this.dragging.difference:this.minValue:o?this.positionToValue(t+this.dragging.lowLimit):this.positionToValue(t-this.dragging.lowLimit):n?r?o?this.minValue+this.dragging.difference:this.maxValue:o?this.maxValue:this.minValue+this.dragging.difference:o?this.positionToValue(t+this.dragging.lowLimit)+this.dragging.difference:this.positionToValue(t-this.dragging.lowLimit)+this.dragging.difference,this.roundStep(i)},onDragMove:function(e,t){this.options.disableAnimation||this.moving&&this.sliderElem.addClass("noanimate"),this.moving=!0;var n,r,i,o,s,a,l,u,c=this.getEventPosition(t);if(this.options.rightToLeft?(i=this.dragging.lowLimit,o=this.dragging.highLimit,l=this.maxH,u=this.minH):(i=this.dragging.highLimit,o=this.dragging.lowLimit,l=this.minH,u=this.maxH),s=o>=c,a=c>=this.maxPos-i,s){if(0===l.rzsp)return;n=this.getValue("min",c,!0,!1),r=this.getValue("max",c,!0,!1)}else if(a){if(u.rzsp===this.maxPos)return;r=this.getValue("max",c,!0,!0),n=this.getValue("min",c,!0,!0)}else n=this.getValue("min",c,!1),r=this.getValue("max",c,!1);this.positionTrackingBar(n,r)},positionTrackingBar:function(e,t){null!=this.options.minLimit&&e<this.options.minLimit&&(t=(e=this.options.minLimit)+this.dragging.difference),null!=this.options.maxLimit&&t>this.options.maxLimit&&(e=(t=this.options.maxLimit)-this.dragging.difference),this.lowValue=e,this.highValue=t,this.applyLowValue(),this.range&&this.applyHighValue(),this.applyModel(!0),this.updateHandles("lowValue",this.valueToPosition(e)),this.updateHandles("highValue",this.valueToPosition(t))},positionTrackingHandle:function(e){var t=!1;e=this.applyMinMaxLimit(e),e=this.applyRestrictedRange(e),this.range&&(this.options.pushRange?(e=this.applyPushRange(e),t=!0):(this.options.noSwitching&&("lowValue"===this.tracking&&e>this.highValue?e=this.applyMinMaxRange(this.highValue):"highValue"===this.tracking&&e<this.lowValue&&(e=this.applyMinMaxRange(this.lowValue))),e=this.applyMinMaxRange(e),"lowValue"===this.tracking&&e>this.highValue?(this.lowValue=this.highValue,this.applyLowValue(),this.applyModel(),this.updateHandles(this.tracking,this.maxH.rzsp),this.updateAriaAttributes(),this.tracking="highValue",this.minH.removeClass("rz-active"),this.maxH.addClass("rz-active"),this.options.keyboardSupport&&this.focusElement(this.maxH),t=!0):"highValue"===this.tracking&&e<this.lowValue&&(this.highValue=this.lowValue,this.applyHighValue(),this.applyModel(),this.updateHandles(this.tracking,this.minH.rzsp),this.updateAriaAttributes(),this.tracking="lowValue",this.maxH.removeClass("rz-active"),this.minH.addClass("rz-active"),this.options.keyboardSupport&&this.focusElement(this.minH),t=!0))),this[this.tracking]!==e&&(this[this.tracking]=e,"lowValue"===this.tracking?this.applyLowValue():this.applyHighValue(),this.applyModel(),this.updateHandles(this.tracking,this.valueToPosition(e)),this.updateAriaAttributes(),t=!0),t&&this.applyModel(!0)},applyMinMaxLimit:function(e){return null!=this.options.minLimit&&e<this.options.minLimit?this.options.minLimit:null!=this.options.maxLimit&&e>this.options.maxLimit?this.options.maxLimit:e},applyMinMaxRange:function(e){var t="lowValue"===this.tracking?this.highValue:this.lowValue,n=Math.abs(e-t);return null!=this.options.minRange&&n<this.options.minRange?"lowValue"===this.tracking?this.highValue-this.options.minRange:this.lowValue+this.options.minRange:null!=this.options.maxRange&&n>this.options.maxRange?"lowValue"===this.tracking?this.highValue-this.options.maxRange:this.lowValue+this.options.maxRange:e},applyRestrictedRange:function(e){for(var t in this.options.restrictedRange)if(null!=this.options.restrictedRange[t]&&e>this.options.restrictedRange[t].from&&e<this.options.restrictedRange[t].to){var n=(this.options.restrictedRange[t].to-this.options.restrictedRange[t].from)/2;if("lowValue"===this.tracking)return e>this.options.restrictedRange[t].from+n?this.options.restrictedRange[t].to:this.options.restrictedRange[t].from;if("highValue"===this.tracking)return e<this.options.restrictedRange[t].to-n?this.options.restrictedRange[t].from:this.options.restrictedRange[t].to}return e},applyPushRange:function(e){var t="lowValue"===this.tracking?this.highValue-e:e-this.lowValue,n=null!==this.options.minRange?this.options.minRange:this.options.step,r=this.options.maxRange;return n>t?("lowValue"===this.tracking?(this.highValue=Math.min(e+n,this.maxValue),e=this.highValue-n,this.applyHighValue(),this.updateHandles("highValue",this.valueToPosition(this.highValue))):(this.lowValue=Math.max(e-n,this.minValue),e=this.lowValue+n,this.applyLowValue(),this.updateHandles("lowValue",this.valueToPosition(this.lowValue))),this.updateAriaAttributes()):null!==r&&t>r&&("lowValue"===this.tracking?(this.highValue=e+r,this.applyHighValue(),this.updateHandles("highValue",this.valueToPosition(this.highValue))):(this.lowValue=e-r,this.applyLowValue(),this.updateHandles("lowValue",this.valueToPosition(this.lowValue))),this.updateAriaAttributes()),e},applyModel:function(e){this.internalChange=!0,this.scope.$apply(),e&&this.callOnChange(),this.internalChange=!1},callOnStart:function(){if(this.options.onStart){var e=this,t="lowValue"===this.tracking?"min":"max";this.scope.$evalAsync((function(){e.options.onStart(e.options.id,e.scope.rzSliderModel,e.scope.rzSliderHigh,t)}))}},callOnChange:function(){if(this.options.onChange){var e=this,t="lowValue"===this.tracking?"min":"max";this.scope.$evalAsync((function(){e.options.onChange(e.options.id,e.scope.rzSliderModel,e.scope.rzSliderHigh,t)}))}},callOnEnd:function(){if(this.options.onEnd){var e=this,t="lowValue"===this.tracking?"min":"max";this.scope.$evalAsync((function(){e.options.onEnd(e.options.id,e.scope.rzSliderModel,e.scope.rzSliderHigh,t)}))}this.scope.$emit("slideEnded")}},a}]).directive("rzslider",["RzSlider",function(e){return{restrict:"AE",replace:!0,scope:{rzSliderModel:"=?",rzSliderHigh:"=?",rzSliderOptions:"&?",rzSliderTplUrl:"@"},templateUrl:function(e,t){return t.rzSliderTplUrl||"rzSliderTpl.html"},link:function(t,n){t.slider=new e(t,n)}}}]);return t.run(["$templateCache",function(e){e.put("rzSliderTpl.html",'<div class=rzslider><span class="rz-bar-wrapper rz-left-out-selection"><span class=rz-bar></span></span> <span class="rz-bar-wrapper rz-right-out-selection"><span class=rz-bar></span></span> <span class=rz-bar-wrapper><span class=rz-bar></span></span> <span class=rz-bar-wrapper><span class="rz-bar rz-selection" ng-style=barStyle></span></span> <span class=rz-bar-wrapper><span class="rz-bar rz-restricted" ng-style=restrictionStyle></span></span> <span class="rz-pointer rz-pointer-min" ng-style=minPointerStyle></span> <span class="rz-pointer rz-pointer-max" ng-style=maxPointerStyle></span> <span class="rz-bubble rz-limit rz-floor"></span> <span class="rz-bubble rz-limit rz-ceil"></span> <span class="rz-bubble rz-model-value"></span> <span class="rz-bubble rz-model-high"></span> <span class=rz-bubble></span><ul ng-show=showTicks class=rz-ticks><li ng-repeat="t in ticks track by $index" class=rz-tick ng-class="{\'rz-selected\': t.selected}" ng-style=t.style ng-attr-uib-tooltip="{{ t.tooltip }}" ng-attr-tooltip-placement={{t.tooltipPlacement}} ng-attr-tooltip-append-to-body="{{ t.tooltip ? true : undefined}}"><span ng-if="t.value != null" class=rz-tick-value ng-attr-uib-tooltip="{{ t.valueTooltip }}" ng-attr-tooltip-placement={{t.valueTooltipPlacement}}>{{ t.value }}</span> <span ng-if="t.legend != null" class=rz-tick-legend>{{ t.legend }}</span></li></ul></div>')}]),t.name})?r.apply(t,i):r)||(e.exports=o)}()},33: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=""}}},34: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}}},35:function(e,t,n){"use strict";n.r(t),n.d(t,"mapActiveOperationResponseToModel",(function(){return l})),n.d(t,"mapActiveOperationToActiveOperationInfoModel",(function(){return c})),n.d(t,"mapImportActiveOperationToActiveOperationInfoModel",(function(){return h})),n.d(t,"mapQueriesActiveOperationToActiveOperationInfoModel",(function(){return p})),n.d(t,"mapBackupAndRestoreActiveOperationToActiveOperationInfoModel",(function(){return d})),n.d(t,"mapClusterActiveOperationToActiveOperationInfoModel",(function(){return f}));var r=n(3),i=n(11),o=n(1),s=n(36),a=n(12);const l=e=>{const t=new s.ActiveOperationsModel;return t.status=e.status,t.operations=u(e.allRunningOperations),t},u=(e=[])=>{const t=[];return e.forEach(e=>t.push(c(e))),t},c=e=>{switch(e.type){case r.OPERATION_TYPE.IMPORTS:return h(e);case r.OPERATION_TYPE.QUERIES:case r.OPERATION_TYPE.UPDATES:return p(e);case r.OPERATION_TYPE.BACKUP_RESTORE:return d(e);case r.OPERATION_TYPE.CLUSTER_STATUS:return f(e)}},h=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=a.OPERATION_MONITORING_CONSTANTS.IMPORT_MONITORING_URL,t},p=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=a.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=a.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=a.OPERATION_MONITORING_CONSTANTS.CLUSTER_MONITORING_URL,t}},36: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)}}},37:function(e,t,n){"use strict";n.r(t),n.d(t,"NamespaceModel",(function(){return r}));class r{constructor(e,t){this._prefix=e,this._uri=t}get prefix(){return this._prefix}set prefix(e){this._prefix=e}get uri(){return this._uri}set uri(e){this._uri=e}}},38: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}}}}},39: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})):[]},4: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}}}},40:function(e,t,n){"use strict";n.r(t);n(13);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.8.9-TR1">{{\'common.loading\' | translate}}</object>'}}}function o(){return{template:function(e,t){let n="";return n=t.hideMessage?"":t.message?`<div>${t.message}</div>`:"<div>{{'common.loading' | translate}}<div>",`\n <object width="${t.size}" height="${t.size}" data="js/angular/templates/loader/ot-loader.svg?v=2.8.9-TR1"></object>\n ${n}\n `}}}function s(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.8.9-TR1"/><div style="font-size: {{size/4}}px">{{currentMessage}}<div></div>'}}function a(e){return{restrict:"EA",transclude:!0,templateUrl:"js/angular/core/templates/core-errors.html",link:function(t,n,r){let i;t.$watch("getActiveRepository()",(function(e){e&&!t.isRestricted?n.hide():n.show()})),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 l(){return function(e,t){$(t).click((function(e){e.preventDefault(),e.stopPropagation()}))}}function u(){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)},s=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),s(),e})),r.$formatters.unshift((function(e){return o(e),s(),e})),$("[multi-required]").on("blur keyup change focusout",(function(){s()}))}}}angular.module("graphdb.framework.core.directives",["graphdb.framework.core.services.repositories","graphdb.framework.utils.localstorageadapter"]).directive("ontoLoader",i).directive("ontoLoaderFancy",o).directive("ontoLoaderNew",s).directive("coreErrors",a).directive("eatClick",l).directive("multiRequired",u).directive("searchResourceInput",h).directive("keyboardShortcuts",p).directive("inactivePluginDirective",d).directive("autoGrow",(function(){return{restrict:"A",require:"ngModel",link:function(e,t,n,r){const i=function(){const e=r.$viewValue;e&&""!==e.trim()?(t[0].style.height="0px",t[0].style.height=t[0].scrollHeight+"px"):t[0].style.height="26px",t[0].style.overflow="hidden"};e.$watch((function(){return r.$viewValue}),(function(){i()})),t.bind("input change",(function(){i()}))}}})).directive("captureHeight",(function(){return{restrict:"A",scope:{rowIndex:"=captureHeight"},link:function(e,t,n){e.$watch((function(){return t[0].offsetHeight}),(function(t){e.$parent.rowHeights[e.rowIndex]=t+"px!important"}))}}})),i.$inject=[],o.$inject=[],s.$inject=["$timeout"],a.$inject=["$timeout"],l.$inject=[],u.$inject=[];const c={table:"table",visual:"visual"};function h(e,t,n,i,o,s,a,l,u,h,p,d){return{restrict:"EA",scope:{repositoryNamespaces:"=",isAutocompleteEnabled:"=",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(h,f,g){f.autoCompleteStatus=void 0,f.autoCompleteWarning=!1,h.empty=!1,h.clear=!1,h.searchDisplayType=c;const m="true"===h.preserveSearch,v=f.find(".view-res-input");let y,b;h.textButtonLabel=h.textButton||"query.editor.table.btn",h.visualButtonLabel=h.visualButton||"query.editor.visual.btn",h.showClearInputIcon=!1,h.searchType=l.get(u.RDF_SEARCH_TYPE)||c.table,h.searchInput="",h.changeSearchType=function(e){h.searchType=e,l.set(u.RDF_SEARCH_TYPE,h.searchType)},h.$on("addStartFixedNodeAutomatically",(function(e,t){h.searchInput||!t.startIRI?h.checkIfValidAndSearchText():h.visualCallback({uri:t.startIRI,label:""})})),h.clearInput=function(){h.searchInput="",h.selectedElementIndex=-1,h.autoCompleteUriResults=[],h.showClearInputIcon=!1,l.remove(u.RDF_SEARCH_INPUT),l.remove(u.RDF_SEARCH_EXPANDED_URI),l.remove(u.RDF_RESOURCE_DESCRIPTION)},h.$watch("repositoryNamespaces",(function(){f.namespaces=h.repositoryNamespaces?h.repositoryNamespaces.namespaces:[]})),h.$watch("isAutocompleteEnabled",(function(){f.autoCompleteStatus=!!h.isAutocompleteEnabled,""!==h.searchInput&&h.onChange()})),h.$watch("empty",(function(){m||(h.searchInput="",h.empty=!1)})),h.$watch("clear",(function(){h.clear&&(h.clearInput(),h.clear=!1)})),o.$on("$translateChangeSuccess",(function(){g.$attr.placeholder?h.placeholder=g.$attr.placeholder:h.placeholder=p.instant("search.resources.msg")+"..."}));const w=function(t){const n=t.type||"uri";"true"===h.openInNewTab?S(!1,t):e.path("resource").search(n,t.uri)},x=function(t){const n=t.type||"uri";"true"===h.openInNewTab?S(!0,t):e.path("graphs-visualizations").search(n,t.uri)},S=function(e,t){const n=e?"graphs-visualizations":"resource";window.open(`${n}?uri=${encodeURIComponent(t.uri)}`)};angular.isUndefined(g.$attr.textCallback)&&(h.textCallback=w),angular.isUndefined(g.$attr.visualCallback)&&(h.visualCallback=x),g.$attr.textButton&&!h.textButton?h.textCallback=h.visualCallback:g.$attr.visualButton&&!h.visualButton&&(h.visualCallback=h.textCallback),g.$attr.placeholder?h.placeholder=g.$attr.placeholder:h.placeholder=p.instant("search.resources.msg")+"...",angular.isDefined(g.$attr.uriValidation)?h.uriValidation=g.$attr.uriValidation:h.uriValidation="true",angular.isDefined(g.$attr.preserveInput)&&(h.preserveInput=g.$attr.preserveInput),h.getResultItemHtml=function(e){return a.trustAsHtml(e.description)},h.searchRdfResource=function(e,t){if("prefix"===e.type)h.searchInput=T(e.value+":"),v.focus(),h.onChange();else{let n;n=angular.isUndefined(e)?h.searchInput:"object"==typeof e?e.value:e;let r="";if(e.description){const t=e.description.indexOf("<"+n+">");t>0&&(r=e.description.substring(0,t).replace(/<\/?b>/g,""))}t({uri:n,description:e.description,label:r,type:e.type}),m?(h.selectedElementIndex=h.activeSearchElm,l.set(u.RDF_SEARCH_EXPANDED_URI,y),l.set(u.RDF_SEARCH_INPUT,h.searchInput),l.set(u.RDF_RESOURCE_DESCRIPTION,e.description)):"true"===h.preserveInput?(h.searchInput=n,h.autoCompleteUriResults=[]):(h.searchInput="",h.autoCompleteUriResults=[])}},h.searchRdfResourceByEvent=function(e,t){h.searchType===c.visual||t.ctrlKey||t.metaKey?h.searchRdfResource(e,h.visualCallback):h.searchRdfResource(e,h.textCallback)};const E=function(e){const n=h.searchInput;""!==n?"false"!==h.uriValidation?f.autoCompleteStatus&&h.autoCompleteUriResults&&h.autoCompleteUriResults.length>0?"prefix"===h.autoCompleteUriResults[h.activeSearchElm].type?(h.searchInput=T(h.autoCompleteUriResults[h.activeSearchElm].value+":"),h.autoCompleteUriResults=[]):h.searchRdfResource(h.autoCompleteUriResults[h.activeSearchElm],e):C(n)?h.searchRdfResource(n,e):t.error(p.instant("invalid.uri.msg")):h.searchRdfResource(n,e):t.error(p.instant("fill.input.field.msg"))};function A(){let e=-1;const n=l.get(u.RDF_RESOURCE_DESCRIPTION);n&&h.autoCompleteUriResults&&(e=h.autoCompleteUriResults.findIndex(e=>e.description===n),h.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_"+h.selectedElementIndex);e.animate({scrollTop:t.offset().top-e.offset().top+e.scrollTop()})}()})).catch((function(e){t.error(getError(e),p.instant("no.prev.search.element"))}))),h.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 T(e){if(!/^<?(http|urn).*>?/.test(e)){const t=e.split(":"),r=t[0],i=t[1];if(!angular.isUndefined(i)){const e=n.getNamespaceUriForPrefix(f.namespaces,r);if(y=e!==y?e:y,y)return v.val(y),y+i}}return e}h.checkIfValidAndSearchText=function(){E(h.textCallback)},h.checkIfValidAndSearchVisual=function(){E(h.visualCallback)},h.checkIfValidAndSearchEvent=function(e){h.searchType===c.visual||e.ctrlKey||e.metaKey?E(h.visualCallback):E(h.textCallback)},h.onChange=function(){return h.showClearInputIcon=h.clearInputIcon,m&&l.set(u.RDF_SEARCH_INPUT,h.searchInput),"false"!==h.uriValidation&&(h.searchInput=T(h.searchInput),f.autoCompleteStatus)?function(e){let t=e.replace(y,y+";");if(f.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),b&&b.resolve(),b=s.defer(),i.getAutocompleteSuggestions(t,b.promise).then((function(e){b=null,h.autoCompleteUriResults=e.data.suggestions,h.activeSearchElm=0}));return Promise.resolve()}(h.searchInput):Promise.resolve()},h.onKeyDown=function(e){if(13===e.keyCode){if(e.preventDefault(),d.isActive())return;"false"!==h.uriValidation?f.autoCompleteStatus?h.checkIfValidAndSearchEvent(e):C(e.target.value)?h.searchRdfResourceByEvent(e.target.value,e):t.error(p.instant("invalid.uri.msg")):h.searchRdfResourceByEvent(e.target.value,e)}else if(h.searchInput.length>0&&!f.autoCompleteWarning&&!f.autoCompleteStatus){f.autoCompleteWarning=!0;const e=Object(r.decodeHTML)(p.instant("explore.autocomplete.warning.msg"));t.warning("",`<div class="autocomplete-toast"><a href="autocomplete">${e}</a></div>`,{allowHtml:!0})}if(f.autoCompleteStatus&&!angular.isUndefined(h.autoCompleteUriResults)){if(40===e.keyCode&&h.activeSearchElm<h.autoCompleteUriResults.length-1&&(h.activeSearchElm++,h.searchInput=h.autoCompleteUriResults[h.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&&h.activeSearchElm>0&&(e.preventDefault(),h.activeSearchElm--,h.searchInput=h.autoCompleteUriResults[h.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(m)return;h.searchInput="",h.autoCompleteUriResults=[]}h.searchInput||h.clearInput()}},h.$on("rdfResourceSearchExpanded",(function(){(m?(h.preserveInput="true",h.searchInput=l.get(u.RDF_SEARCH_INPUT)||"",y=l.get(u.RDF_SEARCH_EXPANDED_URI),h.onChange()):Promise.resolve()).then((function(){A()}))})),h.setActiveClassOnMouseMove=function(e){f.autoCompleteStatus&&(h.activeSearchElm=e)}}}}function p(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,s){return{restrict:"E",transclude:!0,scope:{loadSaved:"&",setPluginActive:"&",pluginName:"@",humanReadablePluginName:"@"},templateUrl:"js/angular/core/templates/inactive-plugin-warning-page.html",link:function(a){function l(){if(o.isLicenseValid()&&i.getActiveRepository()&&!i.isActiveRepoOntopType()&&!i.isActiveRepoFedXType())return t.checkPluginIsActive(a.pluginName,i.getActiveRepository()).then((function({data:e}){a.pluginIsActive=e.indexOf("true")>0,a.setPluginActive({isPluginActive:a.pluginIsActive})})).catch((function(t){e.error(getError(t),s.instant("check.active.plugin.failure"))}))}a.pluginIsActive=!0,a.activatePlugin=function(){const o=Object(r.decodeHTML)(s.instant("activate.plugin.warning.msg",{humanReadablePluginName:a.humanReadablePluginName}));n.openSimpleModal({title:s.instant("activate.plugin.confirmation"),message:`<p>${o}</p>`,warning:!0}).result.then((function(){t.activatePlugin(a.pluginName,i.getActiveRepository()).then((function(){a.pluginIsActive=!0,a.setPluginActive({isPluginActive:a.pluginIsActive}),a.loadSaved()})).catch((function(t){e.error(getError(t),s.instant("activate.plugin.failure"))}))}))};const u=a.$on("repositoryIsSet",(function(){l()}));window.addEventListener("beforeunload",(function e(){u(),window.removeEventListener("beforeunload",e)})),a.$on("checkIsActive",l),l()}}}h.$inject=["$location","toastr","ClassInstanceDetailsService","AutocompleteRestService","$rootScope","$q","$sce","LocalStorageAdapter","LSKeys","$repositories","$translate","GuidesService"],p.$inject=["$document"],d.$inject=["toastr","RDF4JRepositoriesRestService","ModalService","$repositories","$licenseService","$translate"]},41:function(e,t,n){"use strict";n.r(t);n(9),n(21),n(50),n(27),n(83),n(84),n(22);var r=n(16),i=n(20),o=n(28);angular.module("graphdb.framework.core.services.repositories",["ngCookies","graphdb.framework.rest.repositories.service","graphdb.framework.rest.locations.service","graphdb.framework.rest.license.service","toastr","graphdb.framework.utils.event-emitter-service"]).service("$repositories",["toastr","$rootScope","$timeout","$location","productInfo","$jwtAuth","RepositoriesRestService","LocationsRestService","LicenseRestService","$translate","$q","LocalStorageAdapter","LSKeys","EventEmitterService","RDF4JRepositoriesRestService",function(e,t,n,s,a,l,u,c,h,p,d,f,g,m,v){this.location={uri:"",label:"Local",local:!0},this.locationError="",this.loading=!0,this.locations=[this.location],this.repositories=new Map,this.locationsShouldReload=!0;const y=this,b=function(t,n){y.loading=!1,t&&(y.location={},y.locationError=n,y.repositories=new Map,y.setRepository(""),t.statusText?e.error(t.statusText,p.instant("repositories.service.error.loading.location")):e.error(p.instant("repositories.service.error.loading.location")))};let w;this.resetActiveRepository=function(){const e=this.getActiveRepositoryObjectFromStorage(),n=y.repositories.get(e.location);let r=!1;n&&(r=n.find(t=>t.id===e.id)),r?l.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&&y.repositories.delete(t.uri)&&y.resetActiveRepository(),h.getVersion(t.uri).success((function(e){"object"==typeof e?e.productVersion!==a.productVersion&&(t.degradedReason=p.instant("repositories.service.different.gdb.version",{location:t.name})):t.degradedReason=p.instant("repositories.service.different.gdb.version",{location:t.name})})).error((function(n){t.errorMsg=n,e||(y.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.assignHashesToRepositories=function(e){return e.map(e=>{const t=Object(i.md5HashGenerator)();return e.hash=t(JSON.stringify(e)),e})},this.init=function(e,n,r){return this.loading=!0,r||(this.locationsShouldReload=!0),c.getActiveLocation().then((function(i){if(i.data){const o=i.data;if(o.active)return u.getRepositories().then((function(n){y.location=o,Object.entries(n.data).forEach(([e,t])=>{const n=y.assignHashesToRepositories(t);y.clearLocationErrorMsg(e),y.repositories.set(e,n)}),y.resetActiveRepository(),b(),y.checkLocationsDegraded(r),t.globalLocation=y.location,t.globalRepositories=y.getRepositories(),e&&e()})).catch((function(e){b(e),n&&n()}))}else b(),r&&(y.locationsShouldReload=!0),y.location="",y.repositories=new Map,y.setRepository("");t.globalLocation=y.location,t.globalRepositories=y.getRepositories()})).catch((function(e){b(e),n&&n()}))},this.getLocations=function(e){if(this.locationsShouldReload||w)return w||(this.locationsShouldReload=!1,this.locations=[this.location],w=c.getLocations(e).then(e=>(y.locations=e.data.map(e=>new o.RemoteLocationModel(e)),this.locations)).catch((function(){n((function(){y.locationsShouldReload=!0}),2e3)})).finally(()=>{w=null})),w;const t=d.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:p.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.getRepository=function(e){return this.getRepositories().find(t=>t.id===e)},this.getReadableRepositories=function(){return _.filter(this.getRepositories(),(function(e){return l.canReadRepo(e)}))},this.getReadableGraphdbRepositories=function(){return this.getReadableRepositories().filter(e=>"graphdb"===e.type)},this.getLocalReadableGraphdbRepositories=function(){return this.getReadableGraphdbRepositories().filter(e=>!0===e.local)},this.getLocalReadablGraphdbRepositoryIds=function(){return this.getLocalReadableGraphdbRepositories().map(e=>e.id)},this.getWritableRepositories=function(){const e=this;return _.filter(this.getRepositories(),(function(t){return l.canWriteRepo(t)&&!e.isActiveRepoOntopType(t)}))},this.getActiveRepositoryObjectFromStorage=function(){return{id:f.get(g.REPOSITORY_ID)||"",location:f.get(g.REPOSITORY_LOCATION)||""}},this.getActiveRepository=function(){return f.get(g.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){const n={oldRepository:this.repository,newRepository:e,cancel:!1};m.emit("repositoryWillChangeEvent",n,n=>{n.cancel||(e?(f.set(g.REPOSITORY_ID,e.id),f.set(g.REPOSITORY_LOCATION,e.location)):(f.remove(g.REPOSITORY_ID),f.remove(g.REPOSITORY_LOCATION)),this.setRepositoryHeaders(e),t.$broadcast("repositoryIsSet",{newRepo:!0}),e&&!l.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(p.instant("repositories.service.no.active.location"),p.instant("common.error"));const n=this;c.setDefaultRepository(t).success((function(){n.location.defaultRepository=t})).error((function(t){const n=getError(t);e.error(n,p.instant("common.error"))}))},this.deleteLocation=function(t){return c.deleteLocation(encodeURIComponent(t)).success((function(){const e=y.getActiveRepositoryObject();e&&e.location===t&&(y.location="",y.setRepository("")),y.init()})).error((function(t){const n=getError(t);e.error(n,p.instant("common.error"))}))},this.deleteRepository=function(t){return u.deleteRepository(t).success((function(){y.init()})).error((function(t){const n=getError(t);e.error(n,p.instant("common.error"))})).finally(()=>{const e=y.getActiveRepositoryObject();e&&e.id===t.id&&e.location===t.location&&y.setRepository("")})},this.restartRepository=function(t){return u.restartRepository(t).success((function(){e.success(p.instant("repositories.service.restarting.repo",{repositoryId:t.id})),y.initQuick()})).error((function(t){const n=getError(t);e.error(n,p.instant("common.error"))}))},this.getRepositoryTurtleConfig=function(e){return u.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)},this.getPrefixes=e=>v.getRepositoryNamespaces(e).then(e=>{const t={};return e.data.results.bindings.forEach((function(e){t[e.prefix.value]=e.namespace.value})),t}),this.resolveSparqlEndpoint=e=>e===r.QueryMode.UPDATE?`repositories/${this.getActiveRepository()}/statements`:e===r.QueryMode.QUERY?"repositories/"+this.getActiveRepository():void 0,t.$on("securityInit",(function(e,t,r,i){w=null,(!t||r||i)&&n((function(){y.init()}))})),t.$on("reloadLocations",(function(){y.locationsShouldReload=!0,y.getLocations().then(()=>y.initQuick())}))}])},42:function(e,t,n){"use strict";n.r(t);n(9),n(55),n(56);var r=n(6);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,s,a,l,u,c,h){const p=this;i.deniedPermissions={},i.setPermissionDenied=function(e){return!("/login"===e||!p.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 p.authTokenIsType("Bearer")&&(e=!0),p.clearAuthenticationInternal(),p.updateReturnUrl(),n.path("/login"),t?n.search("noaccess"):e&&n.search("expired"),new Promise(e=>{setTimeout(()=>{e(!0)},100)})},i.hasExternalAuthUser=function(){return p.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=u.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),""),s.initOpenId(d.openIDConfig,d.gdbUrl,(function(e){u.setAuthToken(s.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{u.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=u.getAuthToken();return t&&t.startsWith(e)},this.loginOpenID=function(){s.login(this.openIDConfig,this.gdbUrl)},this.toggleSecurity=function(e){return e!==this.securityEnabled?o.toggleSecurity(e).then((function(){t.success(a.instant("jwt.auth.security.status",{status:a.instant(e?"enabled.status":"disabled.status")})),u.clearAuthToken(),d.initSecurity(),d.securityEnabled=e})).catch((function(e){t.error(e.data,a.instant("common.error"))})):Promise.resolve()},this.toggleFreeAccess=function(e,n,r,s){(e!==this.freeAccess||s)&&(this.freeAccessPrincipal=e?{authorities:n,appSettings:r}:void 0,o.setFreeAccess({enabled:e?"true":"false",authorities:n,appSettings:r}).then((function(){this.freeAccess=e,s?t.success(a.instant("jwt.auth.free.access.updated.msg")):t.success(a.instant("jwt.auth.free.access.status",{status:a.instant(e?"enabled.status":"disabled.status")}))})).catch(e=>{t.error(e.data,a.instant("common.error"))}),i.$broadcast("securityInit",this.securityEnabled,this.hasExplicitAuthentication(),this.freeAccess))},this.authenticate=function(e,t){return new Promise(n=>{t?(u.setAuthToken(t),this.externalAuthUser=!1):u.clearAuthToken(),this.principal=e,i.deniedPermissions={},this.securityInitialized=!0;const r={id:h.get(c.REPOSITORY_ID)||"",location:h.get(c.REPOSITORY_LOCATION)||""};p.canReadRepo(r)||(h.remove(c.REPOSITORY_ID),h.remove(c.REPOSITORY_LOCATION),i.deniedPermissions={}),i.$broadcast("securityInit",this.securityEnabled,d.hasExplicitAuthentication(),this.freeAccess),setTimeout(()=>{n(!0)})})},this.authenticateOpenID=function(e){u.clearAuthToken(),e&&(u.setAuthToken(e),this.externalAuthUser=!1)},this.hasExternalAuthUser=function(){return this.externalAuthUser},this.hasExplicitAuthentication=function(){return null!=u.getAuthToken()||this.externalAuthUser},this.getPrincipal=function(){if(this.principal)return Promise.resolve(this.principal);const e=l.defer();return i.$on("securityInit",()=>{e.resolve(this.principal)}),e.promise},this.clearAuthenticationInternal=function(){s.softLogout(),this.principal=this.freeAccessPrincipal,u.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),s=e.location?`${e.id}@${e.location}`:e.id;if(i[0]===t&&(s===o||"SYSTEM"!==e.id&&"*"===o))return!0}return!1},this.updateUserData=e=>o.updateUserData(e)}])},43:function(e,t,n){"use strict";n.r(t);var r=n(32),i=n(35);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)}}}},435: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 s(e,t){return o(e)==o(t)}var a,l=t.noop,u=t.forEach,c=i.$$selectors,h=t.isArray,p=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){function x(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 S(e){var t,r=n.defer();return r.promise.$$cancelFn=function(){t&&t()},y.$$postDigest((function(){t=e((function(){r.resolve()}))})),r.promise}function E(e){if(d(e))return e.tempClasses&&p(e.tempClasses)&&(e.tempClasses=e.tempClasses.split(/\s+/)),e}function A(e,n,i,o){function s(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),E.push({event:t,fn:n}),w.push({event:t,fn:r}),!0}function a(t,n,r){var s=[];u(t,(function(e){e.fn&&s.push(e)}));var a=0;u(s,(function(t,u){var c=function(){e:{if(n){if((n[u]||l)(),++a<s.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 p=e[0];if(p){var d,f;o&&(o.to=o.to||{},o.from=o.from||{}),h(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(I(y)){var b=l,$=[],w=[],x=l,S=[],E=[];y=(" "+y).replace(/\s+/g,".");return u(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],s=c[o];s&&!n[o]&&(t.push(r.get(s)),n[o]=!0)}return t}}(y),(function(e){!s(e,n)&&m&&(s(e,"addClass"),s(e,"removeClass"))})),{node:p,event:n,className:i,isClassBased:v,isSetClassOperation:m,applyStyles:function(){o&&e.css(t.extend(o.from||{},o.to||{}))},before:function(e){b=e,a(w,$,(function(){b=l,e()}))},after:function(e){x=e,a(E,S,(function(){x=l,e()}))},cancel:function(){$&&(u($,(function(e){(e||l)(!0)})),b(!0)),S&&(u(S,(function(e){(e||l)(!0)})),x(!0))}}}}}function C(e,n,r,i,o,c,h,p){function d(t){var i="$animate:"+t;x&&x[i]&&0<x[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 $(){if(!$.hasBeenRun){w&&w.applyStyles(),$.hasBeenRun=!0,h&&h.tempClasses&&u(h.tempClasses,(function(e){a.removeClass(r,e)}));var e=r.data("$$ngAnimateState");e&&(w&&w.isClassBased?F(r,n):(v((function(){var e=r.data("$$ngAnimateState")||{};k==e.index&&F(r,n)})),r.data("$$ngAnimateState",e))),d("close"),p()}}var w=A(r,e,n,h);if(!w)return b(),g(),y(),$(),l;e=w.event,n=w.className;var x=(x=t.element._data(w.node))&&x.events;if(i||(i=o?o.parent():r.parent()),function(e,n){if(f.disabled)return!0;if(s(e,m))return f.running;var r,i,o;do{if(0===n.length)break;var a=s(n,m),l=a?f:n.data("$$ngAnimateState")||{};if(l.disabled)return!0;a&&(o=!0),!1!==r&&(a=n.data("$$ngAnimateChildren"),t.isDefined(a)&&(r=a)),i=i||l.running||l.last&&!l.last.isClassBased}while(n=n.parent());return!o||!r&&i}(r,i))return b(),g(),y(),$(),l;var S=(i=r.data("$$ngAnimateState")||{}).active||{},E=i.totalActive||0,C=i.last;if(o=!1,0<E){if(E=[],w.isClassBased)"setClass"==C.event?(E.push(C),F(r,n)):S[n]&&((T=S[n]).event==e?o=!0:(E.push(T),F(r,n)));else if("leave"==e&&S["ng-leave"])o=!0;else{for(var T in S)E.push(S[T]);i={},F(r,!0)}0<E.length&&u(E,(function(e){e.cancel()}))}if(!w.isClassBased||w.isSetClassOperation||"animate"==e||o||(o="addClass"==e==r.hasClass(n)),o)return b(),g(),y(),d("close"),p(),l;S=i.active||{},E=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(),F(e,"ng-leave"))})),a.addClass(r,"ng-animate"),h&&h.tempClasses&&u(h.tempClasses,(function(e){a.addClass(r,e)}));var k=D++;return E++,S[n]=w,r.data("$$ngAnimateState",{last:w,active:S,index:k,totalActive:E}),g(),w.before((function(t){var i=r.data("$$ngAnimateState");t=t||!i||!i.active[n]||w.isClassBased&&i.active[n].event!=e,b(),!0===t?$():(y(),w.after($))})),w.cancel}function T(e){(e=o(e))&&(e=t.isFunction(e.getElementsByClassName)?e.getElementsByClassName("ng-animate"):e.querySelectorAll(".ng-animate"),u(e,(function(e){(e=(e=t.element(e)).data("$$ngAnimateState"))&&e.active&&u(e.active,(function(e){e.cancel()}))})))}function F(e,t){if(s(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||(a.removeClass(e,"ng-animate"),e.removeData("$$ngAnimateState"))}}a=w,m.data("$$ngAnimateState",f);var k=y.$watch((function(){return $.totalPendingRequests}),(function(e,t){0===e&&(k(),y.$$postDigest((function(){y.$$postDigest((function(){f.running=!1}))})))})),D=0,R=i.classNameFilter(),I=R?function(e){return R.test(e)}:function(){return!0};return{animate:function(e,n,r,i,s){return i=i||"ng-inline-animate",(s=E(s)||{}).from=r?n:null,s.to=r||n,S((function(n){return C("animate",i,t.element(o(e)),null,null,l,s,n)}))},enter:function(n,r,i,s){return s=E(s),n=t.element(n),r=r&&t.element(r),i=i&&t.element(i),x(n,!0),e.enter(n,r,i),S((function(e){return C("enter","ng-enter",t.element(o(n)),r,i,l,s,e)}))},leave:function(n,r){return r=E(r),T(n=t.element(n)),x(n,!0),S((function(i){return C("leave","ng-leave",t.element(o(n)),null,null,(function(){e.leave(n)}),r,i)}))},move:function(n,r,i,s){return s=E(s),n=t.element(n),r=r&&t.element(r),i=i&&t.element(i),T(n),x(n,!0),e.move(n,r,i),S((function(e){return C("move","ng-move",t.element(o(n)),r,i,l,s,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,s){if(s=E(s),n=t.element(n),x(n=t.element(o(n))))return e.$$setClassImmediately(n,r,i,s);var a,l=n.data("$$animateClasses"),c=!!l;return l||(l={classes:{}}),a=l.classes,r=h(r)?r:r.split(" "),u(r,(function(e){e&&e.length&&(a[e]=!0)})),i=h(i)?i:i.split(" "),u(i,(function(e){e&&e.length&&(a[e]=!1)})),c?(s&&l.options&&(l.options=t.extend(l.options||{},s)),l.promise):(n.data("$$animateClasses",l={classes:a,options:s}),l.promise=S((function(t){var r=n.parent(),i=o(n);if((s=i.parentNode)&&!s.$$NG_REMOVED&&!i.$$NG_REMOVED){i=n.data("$$animateClasses"),n.removeData("$$animateClasses");var s=n.data("$$ngAnimateState")||{},a=function(e,t,n){var r={};u(n=n||{},(function(e,t){u(t.split(" "),(function(t){r[t]=e}))}));var i=Object.create(null);u((e.attr("class")||"").split(/\s+/),(function(e){i[e]=!0}));var o=[],s=[];return u(t&&t.classes||[],(function(e,t){var n=i[t],a=r[t]||{};!1===e?(n||"addClass"==a.event)&&s.push(t):!0===e&&(n&&"removeClass"!=a.event||o.push(t))})),0<o.length+s.length&&[o.join(" "),s.join(" ")]}(n,i,s.active);return a?C("setClass",a,n,r,null,(function(){a[0]&&e.$$addClassImmediately(n,a[0]),a[1]&&e.$$removeClassImmediately(n,a[1])}),i.options,t):t()}t()})))},cancel:function(e){e.$$cancelFn()},enabled:function(e,t){switch(arguments.length){case 2:if(e)F(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,s,c){function d(){D||(D=c((function(){P=[],D=null,R={}})))}function f(e,t){D&&D(),P.push(t),D=c((function(){u(P,(function(e){e()})),P=[],D=null,R={}}))}function g(e,n){var r=o(e);e=t.element(r),j.push(e),(r=Date.now()+n)<=_||(s.cancel(O),_=r,O=s((function(){!function(e){u(e,(function(e){(e=e.data("$$ngAnimateCSS3Data"))&&u(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,s=0,a=0;u(e,(function(e){if(1==e.nodeType){e=r.getComputedStyle(e)||{},i=Math.max(v(e[A+"Duration"]),i),o=Math.max(v(e[A+"Delay"]),o),a=Math.max(v(e[T+"Delay"]),a);var t=v(e[T+"Duration"]);0<t&&(t*=parseInt(e[T+"IterationCount"],10)||1),s=Math.max(t,s)}})),n={total:0,transitionDelay:o,transitionDuration:i,animationDelay:a,animationDuration:s},t&&(R[t]=n)}return n}function v(e){var t=0;return e=p(e)?e.split(/\s*,\s*/):[],u(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),(l=(s=t.parent()).data("$$ngAnimateKey"))||(s.data("$$ngAnimateKey",++I),l=I),i=l+"-"+o(t).getAttribute("class");var s,l,u={};0<(l=R[s=i+" "+n]?++R[s].total:0)&&((i=!R[u=i+" "+(c=n+"-stagger")])&&a.addClass(t,c),u=m(t,u),i&&a.removeClass(t,c));a.addClass(t,n);var c=t.data("$$ngAnimateCSS3Data")||{},h=m(t,s);return i=h.transitionDuration,h=h.animationDuration,e&&0===i&&0===h?(a.removeClass(t,n),!1):(n=r||e&&0<i,e=0<h&&0<u.animationDelay&&0===u.animationDuration,t.data("$$ngAnimateCSS3Data",{stagger:u,cacheKey:s,running:c.running||0,itemIndex:l,blockTransition:n,closeAnimationFns:c.closeAnimationFns||[]}),s=o(t),n&&(b(s,!0),r&&t.css(r)),e&&(s.style[T+"PlayState"]="paused"),!0)}function b(e,t){e.style[A+"Property"]=t?"none":""}function $(e,t,n,r){if(y(e,t,n,r))return function(e){e&&S(t,n)}}function w(e,t,n,r,i){if(t.data("$$ngAnimateCSS3Data"))return function(e,t,n,r,i){function l(){t.off(I,c),a.removeClass(t,p),a.removeClass(t,d),D&&s.cancel(D),S(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)>=A&&t>=E&&r()}var h=o(t);if(e=t.data("$$ngAnimateCSS3Data"),-1!=h.getAttribute("class").indexOf(n)&&e){var p="",d="";u(n.split(" "),(function(e,t){var n=(0<t?" ":"")+e;p+=n+"-active",d+=n+"-pending"}));var f=[],v=e.itemIndex,y=e.stagger,$=0;if(0<v){$=0,0<y.transitionDelay&&0===y.transitionDuration&&($=y.transitionDelay*v);var w=0;0<y.animationDelay&&0===y.animationDuration&&(w=y.animationDelay*v,f.push(k+"animation-play-state")),$=Math.round(100*Math.max($,w))/100}$||(a.addClass(t,p),e.blockTransition&&b(h,!1));var x=m(t,e.cacheKey+" "+p),E=Math.max(x.transitionDuration,x.animationDuration);if(0!==E){!$&&i&&(x.transitionDuration||(t.css("transition",x.animationDuration+"s linear all"),f.push("transition")),t.css(i));var A=1e3*(v=Math.max(x.transitionDelay,x.animationDelay));0<f.length&&(";"!==(y=h.getAttribute("style")||"").charAt(y.length-1)&&(y+=";"),h.setAttribute("style",y+" "));var D,R=Date.now(),I=F+" "+C;v=1e3*($+1.5*(v+E));return 0<$&&(a.addClass(t,d),D=s((function(){D=null,0<x.transitionDuration&&b(h,!1),0<x.animationDuration&&(h.style[T+"PlayState"]=""),a.addClass(t,p),a.removeClass(t,d),i&&(0===x.transitionDuration&&t.css("transition",x.animationDuration+"s linear all"),t.css(i),f.push("transition"))}),1e3*$,!1)),t.on(I,c),e.closeAnimationFns.push((function(){l(),r()})),e.running++,g(t,v),l}a.removeClass(t,p),S(t,n),r()}else r()}(e,t,n,r,i);S(t,n),r()}function x(e,t,n,r,i){var o=$(e,t,n,i.from);if(o){var s=o;return f(0,(function(){s=w(e,t,n,r,i.to)})),function(e){(s||l)(e)}}d(),r()}function S(e,t){a.removeClass(e,t);var n=e.data("$$ngAnimateCSS3Data");n&&(n.running&&n.running--,n.running&&0!==n.running||e.removeData("$$ngAnimateCSS3Data"))}function E(e,t){var n="";return e=h(e)?e:e.split(/\s+/),u(e,(function(e,r){e&&0<e.length&&(n+=(0<r?" ":"")+e+t)})),n}var A,C,T,F,k="";e.ontransitionend===n&&e.onwebkittransitionend!==n?(k="-webkit-",A="WebkitTransition",C="webkitTransitionEnd transitionend"):(A="transition",C="transitionend"),e.onanimationend===n&&e.onwebkitanimationend!==n?(k="-webkit-",T="WebkitAnimation",F="webkitAnimationEnd animationend"):(T="animation",F="animationend");var D,R={},I=0,P=[],O=null,_=0,j=[];return{animate:function(e,t,n,r,i,o){return(o=o||{}).from=n,o.to=r,x("animate",e,t,i,o)},enter:function(e,t,n){return x("enter",e,"ng-enter",t,n=n||{})},leave:function(e,t,n){return x("leave",e,"ng-leave",t,n=n||{})},move:function(e,t,n){return x("move",e,"ng-move",t,n=n||{})},beforeSetClass:function(e,t,n,r,i){if(i=i||{},i=$("setClass",e,t=E(n,"-remove")+" "+E(t,"-add"),i.from))return f(0,r),i;d(),r()},beforeAddClass:function(e,t,n,r){if(r=r||{},t=$("addClass",e,E(t,"-add"),r.from))return f(0,n),t;d(),n()},beforeRemoveClass:function(e,t,n,r){if(r=r||{},t=$("removeClass",e,E(t,"-remove"),r.from))return f(0,n),t;d(),n()},setClass:function(e,t,n,r,i){return i=i||{},w("setClass",e,(n=E(n,"-remove"))+" "+(t=E(t,"-add")),r,i.to)},addClass:function(e,t,n,r){return r=r||{},w("addClass",e,E(t,"-add"),n,r.to)},removeClass:function(e,t,n,r){return r=r||{},w("removeClass",e,E(t,"-remove"),n,r.to)}}}])}])}(window,window.angular)},436:function(e,t){!function(e,t,n){"use strict";t.module("ngCookies",["ng"]).factory("$cookies",["$rootScope","$browser",function(e,n){var r,i={},o={},s=!1,a=t.copy,l=t.isUndefined;return n.addPollFn((function(){var t=n.cookies();r!=t&&(r=t,a(t,o),a(t,i),s&&e.$apply())}))(),s=!0,e.$watch((function(){var e,r,s;for(e in o)l(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),s=!0);if(s)for(e in r=n.cookies(),i)i[e]!==r[e]&&(l(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)},437: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,s,a,l){function u(){d&&(r.cancel(d),d=null),h&&(h.$destroy(),h=null),p&&((d=r.leave(p)).then((function(){d=null})),p=null)}function c(){var s=e.current&&e.current.locals;if(t.isDefined(s&&s.$template)){s=i.$new();var a=e.current;p=l(s,(function(e){r.enter(e,null,p||o).then((function(){!t.isDefined(f)||f&&!i.$eval(f)||n()})),u()})),(h=a.scope=s).$emit("$viewContentLoaded"),h.$eval(g)}else u()}var h,p,d,f=s.autoscroll,g=s.onload||"";i.$on("$routeChangeSuccess",c),c()}}}function i(e,t,n){return{restrict:"ECA",priority:-400,link:function(r,i){var o=n.current,s=o.locals;i.html(s.$template);var a=e(i.contents());o.controller&&(s.$scope=r,s=t(o.controller,s),o.controllerAs&&(r[o.controllerAs]=s),i.data("$ngControllerController",s),i.children().data("$ngControllerController",s)),a(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 s="/"==e[e.length-1]?e.substr(0,e.length-1):e+"/";r[s]=t.extend({redirectTo:e},n(s,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,s,a,l,u,c){function h(o){var s=v.current;(g=(f=function(){var n,o;return t.forEach(r,(function(r,s){var a;if(a=!o){var l=i.path();a=r.keys;var u={};if(r.regexp)if(l=r.regexp.exec(l)){for(var c=1,h=l.length;c<h;++c){var p=a[c-1],d=l[c];p&&d&&(u[p.name]=d)}a=u}else a=null;else a=null;a=n=a}a&&((o=e(r,{params:t.extend({},i.search(),n),pathParams:n})).$$route=r)})),o||r.null&&e(r.null,{params:{},pathParams:{}})}())&&s&&f.$$route===s.$$route&&t.equals(f.pathParams,s.pathParams)&&!f.reloadOnSearch&&!m)||!s&&!f||n.$broadcast("$routeChangeStart",f,s).defaultPrevented&&o&&o.preventDefault()}function p(){var e=v.current,r=f;g?(e.params=r.params,t.copy(e.params,s),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()),a.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)?l.get(e):l.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=u(n))),t.isDefined(e)&&(i.$template=e),a.all(i)}})).then((function(i){r==v.current&&(r&&(r.locals=i,t.copy(r.params,s)),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(){h(),p()}))},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",h),n.$on("$locationChangeSuccess",p),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)},438:function(e,t){
|
|
17
|
+
var r=n(445),i=n(446),o=n(447);function s(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(e,t){if(s()<t)throw new RangeError("Invalid typed array length");return l.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=l.prototype:(null===e&&(e=new l(t)),e.length=t),e}function l(e,t,n){if(!(l.TYPED_ARRAY_SUPPORT||this instanceof l))return new l(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 h(this,e)}return u(this,e,t,n)}function u(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);l.TYPED_ARRAY_SUPPORT?(e=t).__proto__=l.prototype:e=p(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!l.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|f(t,n),i=(e=a(e,r)).write(t,n);i!==r&&(e=e.slice(0,i));return e}(e,t,n):function(e,t){if(l.isBuffer(t)){var n=0|d(t.length);return 0===(e=a(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?a(e,0):p(e,t);if("Buffer"===t.type&&o(t.data))return p(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 h(e,t){if(c(t),e=a(e,t<0?0:0|d(t)),!l.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function p(e,t){var n=t.length<0?0:0|d(t.length);e=a(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function d(e){if(e>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|e}function f(e,t){if(l.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 B(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return H(e).length;default:if(r)return B(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 k(this,t,n);case"utf8":case"utf-8":return C(this,t,n);case"ascii":return T(this,t,n);case"latin1":case"binary":return F(this,t,n);case"base64":return A(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(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=l.from(t,r)),l.isBuffer(t))return 0===t.length?-1:y(e,t,n,r,i);if("number"==typeof t)return t&=255,l.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,s=1,a=e.length,l=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;s=2,a/=2,l/=2,n/=2}function u(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var c=-1;for(o=n;o<a;o++)if(u(e,o)===u(t,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===l)return c*s}else-1!==c&&(o-=o-c),c=-1}else for(n+l>a&&(n=a-l),o=n;o>=0;o--){for(var h=!0,p=0;p<l;p++)if(u(e,o+p)!==u(t,p)){h=!1;break}if(h)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 s=0;s<r;++s){var a=parseInt(t.substr(2*s,2),16);if(isNaN(a))return s;e[n+s]=a}return s}function $(e,t,n,r){return U(B(t,e.length-n),e,n,r)}function w(e,t,n,r){return U(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function x(e,t,n,r){return w(e,t,n,r)}function S(e,t,n,r){return U(H(t),e,n,r)}function E(e,t,n,r){return U(function(e,t){for(var n,r,i,o=[],s=0;s<e.length&&!((t-=2)<0);++s)n=e.charCodeAt(s),r=n>>8,i=n%256,o.push(i),o.push(r);return o}(t,e.length-n),e,n,r)}function A(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,s,a,l,u=e[i],c=null,h=u>239?4:u>223?3:u>191?2:1;if(i+h<=n)switch(h){case 1:u<128&&(c=u);break;case 2:128==(192&(o=e[i+1]))&&(l=(31&u)<<6|63&o)>127&&(c=l);break;case 3:o=e[i+1],s=e[i+2],128==(192&o)&&128==(192&s)&&(l=(15&u)<<12|(63&o)<<6|63&s)>2047&&(l<55296||l>57343)&&(c=l);break;case 4:o=e[i+1],s=e[i+2],a=e[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(l=(15&u)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&l<1114112&&(c=l)}null===c?(c=65533,h=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),i+=h}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=l,t.SlowBuffer=function(e){+e!=e&&(e=0);return l.alloc(+e)},t.INSPECT_MAX_BYTES=50,l.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=s(),l.poolSize=8192,l._augment=function(e){return e.__proto__=l.prototype,e},l.from=function(e,t,n){return u(null,e,t,n)},l.TYPED_ARRAY_SUPPORT&&(l.prototype.__proto__=Uint8Array.prototype,l.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&l[Symbol.species]===l&&Object.defineProperty(l,Symbol.species,{value:null,configurable:!0})),l.alloc=function(e,t,n){return function(e,t,n,r){return c(t),t<=0?a(e,t):void 0!==n?"string"==typeof r?a(e,t).fill(n,r):a(e,t).fill(n):a(e,t)}(null,e,t,n)},l.allocUnsafe=function(e){return h(null,e)},l.allocUnsafeSlow=function(e){return h(null,e)},l.isBuffer=function(e){return!(null==e||!e._isBuffer)},l.compare=function(e,t){if(!l.isBuffer(e)||!l.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},l.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}},l.concat=function(e,t){if(!o(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=l.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var s=e[n];if(!l.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(r,i),i+=s.length}return r},l.byteLength=f,l.prototype._isBuffer=!0,l.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},l.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},l.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},l.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?C(this,0,e):g.apply(this,arguments)},l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.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+">"},l.prototype.compare=function(e,t,n,r,i){if(!l.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),s=(n>>>=0)-(t>>>=0),a=Math.min(o,s),u=this.slice(r,i),c=e.slice(t,n),h=0;h<a;++h)if(u[h]!==c[h]){o=u[h],s=c[h];break}return o<s?-1:s<o?1:0},l.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},l.prototype.indexOf=function(e,t,n){return v(this,e,t,n,!0)},l.prototype.lastIndexOf=function(e,t,n){return v(this,e,t,n,!1)},l.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 $(this,e,t,n);case"ascii":return w(this,e,t,n);case"latin1":case"binary":return x(this,e,t,n);case"base64":return S(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function T(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 F(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 k(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+=M(e[o]);return i}function D(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 I(e,t,n,r,i,o){if(!l.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 P(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 O(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 L(e,t,n,r,o){return o||_(e,0,n,8),i.write(e,t,n,r,52,8),n+8}l.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),l.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=l.prototype;else{var i=t-e;n=new l(i,void 0);for(var o=0;o<i;++o)n[o]=this[o+e]}return n},l.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},l.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},l.prototype.readUInt8=function(e,t){return t||R(e,1,this.length),this[e]},l.prototype.readUInt16LE=function(e,t){return t||R(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUInt16BE=function(e,t){return t||R(e,2,this.length),this[e]<<8|this[e+1]},l.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]},l.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])},l.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},l.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},l.prototype.readInt8=function(e,t){return t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.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},l.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},l.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},l.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]},l.prototype.readFloatLE=function(e,t){return t||R(e,4,this.length),i.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return t||R(e,4,this.length),i.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return t||R(e,8,this.length),i.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return t||R(e,8,this.length),i.read(this,e,!1,52,8)},l.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||I(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},l.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||I(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},l.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,1,255,0),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},l.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):P(this,e,t,!0),t+2},l.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):P(this,e,t,!1),t+2},l.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):O(this,e,t,!0),t+4},l.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):O(this,e,t,!1),t+4},l.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);I(this,e,t,n,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o<n&&(s*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+n},l.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);I(this,e,t,n,i-1,-i)}var o=n-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+n},l.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,1,127,-128),l.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):P(this,e,t,!0),t+2},l.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):P(this,e,t,!1),t+2},l.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):O(this,e,t,!0),t+4},l.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||I(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),l.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):O(this,e,t,!1),t+4},l.prototype.writeFloatLE=function(e,t,n){return j(this,e,t,!0,n)},l.prototype.writeFloatBE=function(e,t,n){return j(this,e,t,!1,n)},l.prototype.writeDoubleLE=function(e,t,n){return L(this,e,t,!0,n)},l.prototype.writeDoubleBE=function(e,t,n){return L(this,e,t,!1,n)},l.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||!l.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},l.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&&!l.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 s=l.isBuffer(e)?e:B(new l(e,r).toString()),a=s.length;for(o=0;o<n-t;++o)this[o+t]=s[o%a]}return this};var N=/[^+\/0-9A-Za-z-_]/g;function M(e){return e<16?"0"+e.toString(16):e.toString(16)}function B(e,t){var n;t=t||1/0;for(var r=e.length,i=null,o=[],s=0;s<r;++s){if((n=e.charCodeAt(s))>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+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 H(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(N,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function U(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(15))},324:function(e,t,n){var r,i,o;/*! angularjs-slider - v7.1.0 - (c) Rafal Zajac <rzajac@gmail.com>, Valentin Hervieu <valentin@hervi.eu>, Jussi Saarivirta <jusasi@gmail.com>, Angelin Sirbu <angelin.sirbu@gmail.com> - https://github.com/angular-slider/angularjs-slider - 2022-05-26 */!function(s,a){"use strict";i=[n(86)],void 0===(o="function"==typeof(r=function(e){var t=e.module("rzSlider",[]).factory("RzSliderOptions",(function(){var t={floor:0,ceil:null,step:1,precision:0,minRange:null,maxRange:null,restrictedRange:null,skipRestrictedRangesWithArrowKeys:null,pushRange:!1,minLimit:null,maxLimit:null,id:null,translate:null,getLegend:null,stepsArray:null,bindIndexForStepsArray:!1,draggableRange:!1,draggableRangeOnly:!1,showSelectionBar:!1,showSelectionBarEnd:!1,showSelectionBarFromValue:null,showOuterSelectionBars:!1,hidePointerLabels:!1,hideLimitLabels:!1,autoHideLimitLabels:!0,readOnly:!1,disabled:!1,interval:350,showTicks:!1,showTicksValues:!1,ticksArray:null,ticksTooltip:null,ticksValuesTooltip:null,vertical:!1,getSelectionBarColor:null,getTickColor:null,getPointerColor:null,keyboardSupport:!0,scale:1,enforceStep:!0,enforceRange:!1,noSwitching:!1,onlyBindHandles:!1,disableAnimation:!1,onStart:null,onChange:null,onEnd:null,rightToLeft:!1,reversedControls:!1,boundPointerLabels:!0,mergeRangeLabelsIfSame:!1,labelOverlapSeparator:" - ",customTemplateScope:null,logScale:!1,customValueToPosition:null,customPositionToValue:null,selectionBarGradient:null,ariaLabel:null,ariaLabelledBy:null,ariaLabelHigh:null,ariaLabelledByHigh:null},n={},r={options:function(t){e.extend(n,t)},getOptions:function(r){return e.extend({},t,n,r)}};return r})).factory("rzThrottle",["$timeout",function(e){return function(t,n,r){var i,o,s,a=Date.now||function(){return(new Date).getTime()},l=null,u=0;r=r||{};var c=function(){u=a(),l=null,s=t.apply(i,o),i=o=null};return function(){var h=a(),p=n-(h-u);return i=this,o=arguments,0>=p?(e.cancel(l),l=null,u=h,s=t.apply(i,o),i=o=null):l||!1===r.trailing||(l=e(c,p)),s}}}]).factory("RzSlider",["$timeout","$document","$window","$compile","RzSliderOptions","rzThrottle",function(t,n,r,i,o,s){var a=function(e,t){this.scope=e,this.lowValue=0,this.highValue=0,this.sliderElem=t,this.range=void 0!==this.scope.rzSliderModel&&void 0!==this.scope.rzSliderHigh,this.dragging={active:!1,value:0,difference:0,position:0,lowLimit:0,highLimit:0},this.positionProperty="left",this.dimensionProperty="width",this.handleHalfDim=0,this.maxPos=0,this.precision=0,this.step=1,this.tracking="",this.minValue=0,this.maxValue=0,this.valueRange=0,this.intermediateTicks=!1,this.initHasRun=!1,this.firstKeyDown=!1,this.internalChange=!1,this.cmbLabelShown=!1,this.currentFocusElement=null,this.moving=!1,this.fullBar=null,this.selBar=null,this.minH=null,this.maxH=null,this.flrLab=null,this.ceilLab=null,this.minLab=null,this.maxLab=null,this.cmbLab=null,this.ticks=null,this.init()};return a.prototype={init:function(){var t,n,i=this,o=function(){i.calcViewDimensions()};this.applyOptions(),this.syncLowValue(),this.range&&this.syncHighValue(),this.initElemHandles(),this.manageElementsStyle(),this.setDisabledState(),this.calcViewDimensions(),this.setMinAndMax(),this.updateRestrictionBar(),this.addAccessibility(),this.updateCeilLab(),this.updateFloorLab(),this.initHandles(),this.manageEventsBindings(),this.scope.$on("reCalcViewDimensions",o),e.element(r).on("resize",o),this.initHasRun=!0,this.options.disableAnimation&&this.sliderElem.addClass("noanimate"),t=s((function(){i.onLowHandleChange()}),i.options.interval),n=s((function(){i.onHighHandleChange()}),i.options.interval),this.scope.$on("rzSliderForceRender",(function(){i.resetLabelsValue(),t(),i.range&&n(),i.resetSlider()})),this.scope.$watchCollection("rzSliderOptions()",(function(e,t){e!==t&&(i.applyOptions(),i.syncLowValue(),i.range&&i.syncHighValue(),i.resetSlider())})),this.scope.$watch("rzSliderModel",(function(e,n){i.internalChange||e!==n&&t()})),this.scope.$watch("rzSliderHigh",(function(e,t){i.internalChange||e!==t&&(null!=e&&n(),(i.range&&null==e||!i.range&&null!=e)&&(i.applyOptions(),i.resetSlider()))})),this.scope.$on("$destroy",(function(){i.unbindEvents(),e.element(r).off("resize",o),i.currentFocusElement=null}))},findStepIndex:function(t){for(var n=0,r=0;r<this.options.stepsArray.length;r++){var i=this.options.stepsArray[r];if(i===t){n=r;break}if(e.isDate(i)){if(i.getTime()===t.getTime()){n=r;break}}else if(e.isObject(i)&&(e.isDate(i.value)&&i.value.getTime()===t.getTime()||i.value===t)){n=r;break}}return n},syncLowValue:function(){this.options.stepsArray?this.options.bindIndexForStepsArray?this.lowValue=this.scope.rzSliderModel:this.lowValue=this.findStepIndex(this.scope.rzSliderModel):this.lowValue=this.scope.rzSliderModel},syncHighValue:function(){this.options.stepsArray?this.options.bindIndexForStepsArray?this.highValue=this.scope.rzSliderHigh:this.highValue=this.findStepIndex(this.scope.rzSliderHigh):this.highValue=this.scope.rzSliderHigh},getStepValue:function(t){var n=this.options.stepsArray[t];return e.isDate(n)?n:e.isObject(n)?n.value:n},applyLowValue:function(){this.options.stepsArray?this.options.bindIndexForStepsArray?this.scope.rzSliderModel=this.lowValue:this.scope.rzSliderModel=this.getStepValue(this.lowValue):this.scope.rzSliderModel=this.lowValue},applyHighValue:function(){this.options.stepsArray?this.options.bindIndexForStepsArray?this.scope.rzSliderHigh=this.highValue:this.scope.rzSliderHigh=this.getStepValue(this.highValue):this.scope.rzSliderHigh=this.highValue},onLowHandleChange:function(){this.syncLowValue(),this.range&&this.syncHighValue(),this.setMinAndMax(),this.updateLowHandle(this.valueToPosition(this.lowValue)),this.updateSelectionBar(),this.updateTicksScale(),this.updateAriaAttributes(),this.range&&this.updateCmbLabel()},onHighHandleChange:function(){this.syncLowValue(),this.syncHighValue(),this.setMinAndMax(),this.updateHighHandle(this.valueToPosition(this.highValue)),this.updateSelectionBar(),this.updateTicksScale(),this.updateCmbLabel(),this.updateAriaAttributes()},applyOptions:function(){var t;t=this.scope.rzSliderOptions?this.scope.rzSliderOptions():{},this.options=o.getOptions(t),this.options.step<=0&&(this.options.step=1),this.range=void 0!==this.scope.rzSliderModel&&void 0!==this.scope.rzSliderHigh,this.options.draggableRange=this.range&&this.options.draggableRange,this.options.draggableRangeOnly=this.range&&this.options.draggableRangeOnly,this.options.draggableRangeOnly&&(this.options.draggableRange=!0),this.options.showTicks=this.options.showTicks||this.options.showTicksValues||!!this.options.ticksArray,this.scope.showTicks=this.options.showTicks,(e.isNumber(this.options.showTicks)||this.options.ticksArray)&&(this.intermediateTicks=!0),this.options.showSelectionBar=this.options.showSelectionBar||this.options.showSelectionBarEnd||null!==this.options.showSelectionBarFromValue,this.options.stepsArray?this.parseStepsArray():(this.options.translate?this.customTrFn=this.options.translate:this.customTrFn=function(e){return String(e)},this.getLegend=this.options.getLegend),this.options.vertical?(this.positionProperty="bottom",this.dimensionProperty="height"):(this.positionProperty="left",this.dimensionProperty="width"),this.options.customTemplateScope&&(this.scope.custom=this.options.customTemplateScope)},parseStepsArray:function(){this.options.floor=0,this.options.ceil=this.options.stepsArray.length-1,this.options.step=1,this.options.translate?this.customTrFn=this.options.translate:this.customTrFn=function(e){return this.options.bindIndexForStepsArray?this.getStepValue(e):e},this.getLegend=function(t){var n=this.options.stepsArray[t];return e.isObject(n)?n.legend:null}},resetSlider:function(){this.resetLabelsValue(),this.manageElementsStyle(),this.addAccessibility(),this.setMinAndMax(),this.updateCeilLab(),this.updateFloorLab(),this.unbindEvents(),this.manageEventsBindings(),this.setDisabledState(),this.calcViewDimensions(),this.updateRestrictionBar(),this.refocusPointerIfNeeded()},refocusPointerIfNeeded:function(){this.currentFocusElement&&(this.onPointerFocus(this.currentFocusElement.pointer,this.currentFocusElement.ref),this.focusElement(this.currentFocusElement.pointer))},ensureRestrictedBarIsArray:function(t){var n=e.element(t);if(this.restrictedBar=[],this.options.restrictedRange){this.options.restrictedRange=Array.isArray(this.options.restrictedRange)?this.options.restrictedRange:[this.options.restrictedRange],this.restrictedBar[0]=n;for(var r=t.parentElement,i=1;i<this.options.restrictedRange.length;i++){var o=document.createElement("span");o.setAttribute("class","rz-bar-wrapper"),o.innerHTML='<span class="rz-bar rz-restricted" ng-style="restrictionStyle"></span>',r.appendChild(o),this.restrictedBar[i]=e.element(o)}}else t.style.visibility="hidden",this.restrictedBar=null},initElemHandles:function(){e.forEach(this.sliderElem.children(),(function(t,n){var r=e.element(t);switch(n){case 0:this.leftOutSelBar=r;break;case 1:this.rightOutSelBar=r;break;case 2:this.fullBar=r;break;case 3:this.selBar=r;break;case 4:this.ensureRestrictedBarIsArray(t);break;case 5:this.minH=r;break;case 6:this.maxH=r;break;case 7:this.flrLab=r;break;case 8:this.ceilLab=r;break;case 9:this.minLab=r;break;case 10:this.maxLab=r;break;case 11:this.cmbLab=r;break;case 12:this.ticks=r}}),this),this.selBar.rzsp=0,this.minH.rzsp=0,this.maxH.rzsp=0,this.flrLab.rzsp=0,this.ceilLab.rzsp=0,this.minLab.rzsp=0,this.maxLab.rzsp=0,this.cmbLab.rzsp=0},manageElementsStyle:function(){this.range?this.maxH.css("display",""):this.maxH.css("display","none"),this.alwaysHide(this.flrLab,this.options.showTicksValues||this.options.hideLimitLabels),this.alwaysHide(this.ceilLab,this.options.showTicksValues||this.options.hideLimitLabels);var e=this.options.showTicksValues&&!this.intermediateTicks;for(var t in this.alwaysHide(this.minLab,e||this.options.hidePointerLabels),this.alwaysHide(this.maxLab,e||!this.range||this.options.hidePointerLabels),this.alwaysHide(this.cmbLab,e||!this.range||this.options.hidePointerLabels),this.alwaysHide(this.selBar,!this.range&&!this.options.showSelectionBar),this.alwaysHide(this.leftOutSelBar,!this.range||!this.options.showOuterSelectionBars),this.restrictedBar)this.restrictedBar[t]&&this.alwaysHide(this.restrictedBar[t],!this.options.restrictedRange[t]);this.alwaysHide(this.rightOutSelBar,!this.range||!this.options.showOuterSelectionBars),this.range&&this.options.showOuterSelectionBars&&this.fullBar.addClass("rz-transparent"),this.options.vertical?this.sliderElem.addClass("rz-vertical"):this.sliderElem.removeClass("rz-vertical"),this.options.draggableRange?this.selBar.addClass("rz-draggable"):this.selBar.removeClass("rz-draggable"),this.intermediateTicks&&this.options.showTicksValues&&this.ticks.addClass("rz-ticks-values-under")},alwaysHide:function(e,t){e.rzAlwaysHide=t,t?this.hideEl(e):this.showEl(e)},manageEventsBindings:function(){this.options.disabled||this.options.readOnly?this.unbindEvents():this.bindEvents()},setDisabledState:function(){this.options.disabled?this.sliderElem.attr("disabled","disabled"):this.sliderElem.attr("disabled",null)},resetLabelsValue:function(){this.minLab.rzsv=void 0,this.maxLab.rzsv=void 0,this.flrLab.rzsv=void 0,this.ceilLab.rzsv=void 0,this.cmbLab.rzsv=void 0,this.resetPosition(this.flrLab),this.resetPosition(this.ceilLab),this.resetPosition(this.cmbLab),this.resetPosition(this.minLab),this.resetPosition(this.maxLab)},initHandles:function(){this.updateLowHandle(this.valueToPosition(this.lowValue)),this.range&&this.updateHighHandle(this.valueToPosition(this.highValue)),this.updateSelectionBar(),this.range&&this.updateCmbLabel(),this.updateTicksScale()},translateFn:function(e,t,n,r){r=void 0===r||r;var i="",o=!1,s=t.hasClass("no-label-injection");r?(this.options.stepsArray&&!this.options.bindIndexForStepsArray&&(e=this.getStepValue(e)),i=String(this.customTrFn(e,this.options.id,n))):i=String(e),(void 0===t.rzsv||t.rzsv.length!==i.length||t.rzsv.length>0&&0===t.rzsd)&&(o=!0,t.rzsv=i),s||t.html(i),this.scope[n+"Label"]=i,o&&this.getDimension(t)},setMinAndMax:function(){if(this.step=+this.options.step,this.precision=+this.options.precision,this.minValue=this.options.floor,this.options.logScale&&0===this.minValue)throw Error("Can't use floor=0 with logarithmic scale");this.options.enforceStep&&(this.lowValue=this.roundStep(this.lowValue),this.range&&(this.highValue=this.roundStep(this.highValue))),null!=this.options.ceil?this.maxValue=this.options.ceil:this.maxValue=this.options.ceil=this.range?this.highValue:this.lowValue,this.options.enforceRange&&(this.lowValue=this.sanitizeValue(this.lowValue),this.range&&(this.highValue=this.sanitizeValue(this.highValue))),this.applyLowValue(),this.range&&this.applyHighValue(),this.valueRange=this.maxValue-this.minValue},addAccessibility:function(){this.minH.attr("role","slider"),this.updateAriaAttributes(),!this.options.keyboardSupport||this.options.readOnly||this.options.disabled?this.minH.attr("tabindex",""):this.minH.attr("tabindex","0"),this.options.vertical?this.minH.attr("aria-orientation","vertical"):this.minH.attr("aria-orientation","horizontal"),this.options.ariaLabel?this.minH.attr("aria-label",this.options.ariaLabel):this.options.ariaLabelledBy&&this.minH.attr("aria-labelledby",this.options.ariaLabelledBy),this.range&&(this.maxH.attr("role","slider"),!this.options.keyboardSupport||this.options.readOnly||this.options.disabled?this.maxH.attr("tabindex",""):this.maxH.attr("tabindex","0"),this.options.vertical?this.maxH.attr("aria-orientation","vertical"):this.maxH.attr("aria-orientation","horizontal"),this.options.ariaLabelHigh?this.maxH.attr("aria-label",this.options.ariaLabelHigh):this.options.ariaLabelledByHigh&&this.maxH.attr("aria-labelledby",this.options.ariaLabelledByHigh))},updateAriaAttributes:function(){this.minH.attr({"aria-valuenow":this.scope.rzSliderModel,"aria-valuetext":this.customTrFn(this.scope.rzSliderModel,this.options.id,"model"),"aria-valuemin":this.minValue,"aria-valuemax":this.maxValue}),this.range&&this.maxH.attr({"aria-valuenow":this.scope.rzSliderHigh,"aria-valuetext":this.customTrFn(this.scope.rzSliderHigh,this.options.id,"high"),"aria-valuemin":this.minValue,"aria-valuemax":this.maxValue})},calcViewDimensions:function(){var e=this.getDimension(this.minH);if(this.handleHalfDim=e/2,this.barDimension=this.getDimension(this.fullBar),this.maxPos=this.barDimension-e,this.getDimension(this.sliderElem),this.sliderElem.rzsp=this.sliderElem[0].getBoundingClientRect()[this.positionProperty],this.initHasRun){this.updateFloorLab(),this.updateCeilLab(),this.initHandles();var n=this;t((function(){n.updateTicksScale()}))}},updateTicksScale:function(){if(this.options.showTicks){var t=this.options.ticksArray||this.getTicksArray(),n=this.options.vertical?"translateY":"translateX",r=this;this.options.rightToLeft&&t.reverse(),this.scope.ticks=t.map((function(t){var i=null;e.isObject(t)&&(i=t.legend,t=t.value);var o=r.valueToPosition(t);r.options.vertical&&(o=r.maxPos-o);var s=n+"("+Math.round(o)+"px)",a={legend:i,selected:r.isTickSelected(t),style:{"-webkit-transform":s,"-moz-transform":s,"-o-transform":s,"-ms-transform":s,transform:s}};return a.selected&&r.options.getSelectionBarColor&&(a.style["background-color"]=r.getSelectionBarColor()),!a.selected&&r.options.getTickColor&&(a.style["background-color"]=r.getTickColor(t)),r.options.ticksTooltip&&(a.tooltip=r.options.ticksTooltip(t),a.tooltipPlacement=r.options.vertical?"right":"top"),(!0===r.options.showTicksValues||t%r.options.showTicksValues==0)&&(a.value=r.getDisplayValue(t,"tick-value"),r.options.ticksValuesTooltip&&(a.valueTooltip=r.options.ticksValuesTooltip(t),a.valueTooltipPlacement=r.options.vertical?"right":"top")),r.getLegend&&((i=r.getLegend(t,r.options.id))&&(a.legend=i)),a}))}},getTicksArray:function(){var e=this.step,t=[];this.intermediateTicks&&(e=this.options.showTicks);for(var n=this.minValue;n<=this.maxValue;n+=e)t.push(n);return t},isTickSelected:function(e){if(!this.range)if(null!==this.options.showSelectionBarFromValue){var t=this.options.showSelectionBarFromValue;if(this.lowValue>t&&e>=t&&e<=this.lowValue)return!0;if(this.lowValue<t&&t>=e&&e>=this.lowValue)return!0}else if(this.options.showSelectionBarEnd){if(e>=this.lowValue)return!0}else if(this.options.showSelectionBar&&e<=this.lowValue)return!0;return!!(this.range&&e>=this.lowValue&&e<=this.highValue)},updateFloorLab:function(){this.translateFn(this.minValue,this.flrLab,"floor"),this.getDimension(this.flrLab);var e=this.options.rightToLeft?this.barDimension-this.flrLab.rzsd:0;this.setPosition(this.flrLab,e)},updateCeilLab:function(){this.translateFn(this.maxValue,this.ceilLab,"ceil"),this.getDimension(this.ceilLab);var e=this.options.rightToLeft?0:this.barDimension-this.ceilLab.rzsd;this.setPosition(this.ceilLab,e)},updateHandles:function(e,t){"lowValue"===e?this.updateLowHandle(t):this.updateHighHandle(t),this.updateSelectionBar(),this.updateTicksScale(),this.range&&this.updateCmbLabel()},getHandleLabelPos:function(e,t){var n=this[e].rzsd,r=t-n/2+this.handleHalfDim,i=this.barDimension-n;return this.options.boundPointerLabels?this.options.rightToLeft&&"minLab"===e||!this.options.rightToLeft&&"maxLab"===e?Math.min(r,i):Math.min(Math.max(r,0),i):r},updateLowHandle:function(e){if(this.setPosition(this.minH,e),this.translateFn(this.lowValue,this.minLab,"model"),this.setPosition(this.minLab,this.getHandleLabelPos("minLab",e)),this.options.getPointerColor){var t=this.getPointerColor("min");this.scope.minPointerStyle={backgroundColor:t}}this.options.autoHideLimitLabels&&this.shFloorCeil()},updateHighHandle:function(e){if(this.setPosition(this.maxH,e),this.translateFn(this.highValue,this.maxLab,"high"),this.setPosition(this.maxLab,this.getHandleLabelPos("maxLab",e)),this.options.getPointerColor){var t=this.getPointerColor("max");this.scope.maxPointerStyle={backgroundColor:t}}this.options.autoHideLimitLabels&&this.shFloorCeil()},shFloorCeil:function(){if(!this.options.hidePointerLabels){var e=!1,t=!1,n=this.isLabelBelowFloorLab(this.minLab),r=this.isLabelAboveCeilLab(this.minLab),i=this.isLabelAboveCeilLab(this.maxLab),o=this.isLabelBelowFloorLab(this.cmbLab),s=this.isLabelAboveCeilLab(this.cmbLab);if(n?(e=!0,this.hideEl(this.flrLab)):(e=!1,this.showEl(this.flrLab)),r?(t=!0,this.hideEl(this.ceilLab)):(t=!1,this.showEl(this.ceilLab)),this.range){var a=this.cmbLabelShown?s:i,l=this.cmbLabelShown?o:n;a?this.hideEl(this.ceilLab):t||this.showEl(this.ceilLab),l?this.hideEl(this.flrLab):e||this.showEl(this.flrLab)}}},isLabelBelowFloorLab:function(e){var t=this.options.rightToLeft,n=e.rzsp,r=e.rzsd,i=this.flrLab.rzsp,o=this.flrLab.rzsd;return t?n+r>=i-2:i+o+2>=n},isLabelAboveCeilLab:function(e){var t=this.options.rightToLeft,n=e.rzsp,r=e.rzsd,i=this.ceilLab.rzsp,o=this.ceilLab.rzsd;return t?i+o+2>=n:n+r>=i-2},updateRestrictionBar:function(){var e=0,t=0;if(this.options.restrictedRange)for(var n in this.options.restrictedRange=Array.isArray(this.options.restrictedRange)?this.options.restrictedRange:[this.options.restrictedRange],this.options.restrictedRange){var r=this.valueToPosition(this.options.restrictedRange[n].from),i=this.valueToPosition(this.options.restrictedRange[n].to);t=Math.abs(i-r),e=this.options.rightToLeft?i+this.handleHalfDim:r+this.handleHalfDim,this.setDimension(this.restrictedBar[n],t),this.setPosition(this.restrictedBar[n],e)}},updateSelectionBar:function(){var e=0,t=0,n=this.options.rightToLeft?!this.options.showSelectionBarEnd:this.options.showSelectionBarEnd,r=this.options.rightToLeft?this.maxH.rzsp+this.handleHalfDim:this.minH.rzsp+this.handleHalfDim;if(this.range)t=Math.abs(this.maxH.rzsp-this.minH.rzsp),e=r;else if(null!==this.options.showSelectionBarFromValue){var i=this.options.showSelectionBarFromValue,o=this.valueToPosition(i);(this.options.rightToLeft?this.lowValue<=i:this.lowValue>i)?(t=this.minH.rzsp-o,e=o+this.handleHalfDim):(t=o-this.minH.rzsp,e=this.minH.rzsp+this.handleHalfDim)}else n?(t=Math.abs(this.maxPos-this.minH.rzsp)+this.handleHalfDim,e=this.minH.rzsp+this.handleHalfDim):(t=this.minH.rzsp+this.handleHalfDim,e=0);if(this.setDimension(this.selBar,t),this.setPosition(this.selBar,e),this.range&&this.options.showOuterSelectionBars&&(this.options.rightToLeft?(this.setDimension(this.rightOutSelBar,e),this.setPosition(this.rightOutSelBar,0),this.setDimension(this.leftOutSelBar,this.getDimension(this.fullBar)-(e+t)),this.setPosition(this.leftOutSelBar,e+t)):(this.setDimension(this.leftOutSelBar,e),this.setPosition(this.leftOutSelBar,0),this.setDimension(this.rightOutSelBar,this.getDimension(this.fullBar)-(e+t)),this.setPosition(this.rightOutSelBar,e+t))),this.options.getSelectionBarColor){var s=this.getSelectionBarColor();this.scope.barStyle={backgroundColor:s}}else if(this.options.selectionBarGradient){var a=null!==this.options.showSelectionBarFromValue?this.valueToPosition(this.options.showSelectionBarFromValue):0,l=a-e>0^n,u=this.options.vertical?l?"bottom":"top":l?"left":"right";this.scope.barStyle={backgroundImage:"linear-gradient(to "+u+", "+this.options.selectionBarGradient.from+" 0%,"+this.options.selectionBarGradient.to+" 100%)"},this.options.vertical?(this.scope.barStyle.backgroundPosition="center "+(a+t+e+(l?-this.handleHalfDim:0))+"px",this.scope.barStyle.backgroundSize="100% "+(this.barDimension-this.handleHalfDim)+"px"):(this.scope.barStyle.backgroundPosition=a-e+(l?this.handleHalfDim:0)+"px center",this.scope.barStyle.backgroundSize=this.barDimension-this.handleHalfDim+"px 100%")}},getSelectionBarColor:function(){return this.range?this.options.getSelectionBarColor(this.scope.rzSliderModel,this.scope.rzSliderHigh):this.options.getSelectionBarColor(this.scope.rzSliderModel)},getPointerColor:function(e){return"max"===e?this.options.getPointerColor(this.scope.rzSliderHigh,e):this.options.getPointerColor(this.scope.rzSliderModel,e)},getTickColor:function(e){return this.options.getTickColor(e)},updateCmbLabel:function(){if(this.options.rightToLeft?this.minLab.rzsp-this.minLab.rzsd-10<=this.maxLab.rzsp:this.minLab.rzsp+this.minLab.rzsd+10>=this.maxLab.rzsp){var e,t=this.getDisplayValue(this.lowValue,"model"),n=this.getDisplayValue(this.highValue,"high");e=this.options.mergeRangeLabelsIfSame&&t===n?t:this.options.rightToLeft?n+this.options.labelOverlapSeparator+t:t+this.options.labelOverlapSeparator+n,this.translateFn(e,this.cmbLab,"cmb",!1);var r=this.options.boundPointerLabels?Math.min(Math.max(this.selBar.rzsp+this.selBar.rzsd/2-this.cmbLab.rzsd/2,0),this.barDimension-this.cmbLab.rzsd):this.selBar.rzsp+this.selBar.rzsd/2-this.cmbLab.rzsd/2;this.setPosition(this.cmbLab,r),this.cmbLabelShown=!0,this.hideEl(this.minLab),this.hideEl(this.maxLab),this.showEl(this.cmbLab)}else this.cmbLabelShown=!1,this.updateHighHandle(this.valueToPosition(this.highValue)),this.updateLowHandle(this.valueToPosition(this.lowValue)),this.showEl(this.maxLab),this.showEl(this.minLab),this.hideEl(this.cmbLab);this.options.autoHideLimitLabels&&this.shFloorCeil()},getDisplayValue:function(e,t){return this.options.stepsArray&&!this.options.bindIndexForStepsArray&&(e=this.getStepValue(e)),this.customTrFn(e,this.options.id,t)},roundStep:function(e,t){var n=t||this.step,r=parseFloat((e-this.minValue)/n).toPrecision(12);return r=Math.round(+r)*n,+(this.minValue+r).toFixed(this.precision)},hideEl:function(e){return e.css({visibility:"hidden"})},showEl:function(e){return e.rzAlwaysHide?e:e.css({visibility:"visible"})},setPosition:function(e,t){e.rzsp=t;var n={};return n[this.positionProperty]=Math.round(t)+"px",e.css(n),t},resetPosition:function(e){e.css({left:null,bottom:null})},getDimension:function(e){var t=e[0].getBoundingClientRect();return this.options.vertical?e.rzsd=(t.bottom-t.top)*this.options.scale:e.rzsd=(t.right-t.left)*this.options.scale,e.rzsd},setDimension:function(e,t){e.rzsd=t;var n={};return n[this.dimensionProperty]=Math.round(t)+"px",e.css(n),t},sanitizeValue:function(e){return Math.min(Math.max(e,this.minValue),this.maxValue)},valueToPosition:function(e){var t=this.linearValueToPosition;this.options.customValueToPosition?t=this.options.customValueToPosition:this.options.logScale&&(t=this.logValueToPosition);var n=t(e=this.sanitizeValue(e),this.minValue,this.maxValue)||0;return this.options.rightToLeft&&(n=1-n),n*this.maxPos},linearValueToPosition:function(e,t,n){return(e-t)/(n-t)},logValueToPosition:function(e,t,n){return((e=Math.log(e))-(t=Math.log(t)))/((n=Math.log(n))-t)},positionToValue:function(e){var t=e/this.maxPos;this.options.rightToLeft&&(t=1-t);var n=this.linearPositionToValue;return this.options.customPositionToValue?n=this.options.customPositionToValue:this.options.logScale&&(n=this.logPositionToValue),n(t,this.minValue,this.maxValue)||0},linearPositionToValue:function(e,t,n){return e*(n-t)+t},logPositionToValue:function(e,t,n){t=Math.log(t);var r=e*((n=Math.log(n))-t)+t;return Math.exp(r)},getEventAttr:function(e,t){return void 0===e.originalEvent?e[t]:e.originalEvent[t]},getEventXY:function(e,t){var n=this.options.vertical?"clientY":"clientX";if(void 0!==e[n])return e[n];var r=this.getEventAttr(e,"touches");if(void 0!==t)for(var i=0;i<r.length;i++)if(r[i].identifier===t)return r[i][n];return r[0][n]},getEventPosition:function(e,t){var n=this.sliderElem.rzsp;return(this.options.vertical?-this.getEventXY(e,t)+n:this.getEventXY(e,t)-n)*this.options.scale-this.handleHalfDim},getEventNames:function(e){var t={moveEvent:"",endEvent:""};return this.getEventAttr(e,"touches")?(t.moveEvent="touchmove",t.endEvent="touchend"):(t.moveEvent="mousemove",t.endEvent="mouseup"),t},getNearestHandle:function(e){if(!this.range)return this.minH;var t=this.getEventPosition(e),n=Math.abs(t-this.minH.rzsp),r=Math.abs(t-this.maxH.rzsp);return r>n?this.minH:n>r?this.maxH:this.options.rightToLeft?t>this.minH.rzsp?this.minH:this.maxH:t<this.minH.rzsp?this.minH:this.maxH},focusElement:function(e){e[0].focus()},bindEvents:function(){var t,n,r;this.options.draggableRange?(t="rzSliderDrag",n=this.onDragStart,r=this.onDragMove):(t="lowValue",n=this.onStart,r=this.onMove),this.options.onlyBindHandles||(this.selBar.on("mousedown",e.bind(this,n,null,t)),this.selBar.on("mousedown",e.bind(this,r,this.selBar))),this.options.draggableRangeOnly?(this.minH.on("mousedown",e.bind(this,n,null,t)),this.maxH.on("mousedown",e.bind(this,n,null,t))):(this.minH.on("mousedown",e.bind(this,this.onStart,this.minH,"lowValue")),this.range&&this.maxH.on("mousedown",e.bind(this,this.onStart,this.maxH,"highValue")),this.options.onlyBindHandles||(this.fullBar.on("mousedown",e.bind(this,this.onStart,null,null)),this.fullBar.on("mousedown",e.bind(this,this.onMove,this.fullBar)),this.ticks.on("mousedown",e.bind(this,this.onStart,null,null)),this.ticks.on("mousedown",e.bind(this,this.onTickClick,this.ticks)))),this.options.onlyBindHandles||(this.selBar.on("touchstart",e.bind(this,n,null,t)),this.selBar.on("touchstart",e.bind(this,r,this.selBar))),this.options.draggableRangeOnly?(this.minH.on("touchstart",e.bind(this,n,null,t)),this.maxH.on("touchstart",e.bind(this,n,null,t))):(this.minH.on("touchstart",e.bind(this,this.onStart,this.minH,"lowValue")),this.range&&this.maxH.on("touchstart",e.bind(this,this.onStart,this.maxH,"highValue")),this.options.onlyBindHandles||(this.fullBar.on("touchstart",e.bind(this,this.onStart,null,null)),this.fullBar.on("touchstart",e.bind(this,this.onMove,this.fullBar)),this.ticks.on("touchstart",e.bind(this,this.onStart,null,null)),this.ticks.on("touchstart",e.bind(this,this.onTickClick,this.ticks)))),this.options.keyboardSupport&&(this.minH.on("focus",e.bind(this,this.onPointerFocus,this.minH,"lowValue")),this.range&&this.maxH.on("focus",e.bind(this,this.onPointerFocus,this.maxH,"highValue")))},unbindEvents:function(){this.minH.off(),this.maxH.off(),this.fullBar.off(),this.selBar.off(),this.ticks.off()},onStart:function(t,r,i){var o,s,a=this.getEventNames(i);i.stopPropagation(),i.preventDefault(),this.calcViewDimensions(),t?this.tracking=r:(t=this.getNearestHandle(i),this.tracking=t===this.minH?"lowValue":"highValue"),t.addClass("rz-active"),this.options.keyboardSupport&&this.focusElement(t),o=e.bind(this,this.dragging.active?this.onDragMove:this.onMove,t),s=e.bind(this,this.onEnd,o),n.on(a.moveEvent,o),n.on(a.endEvent,s),this.endHandlerToBeRemovedOnEnd=s,this.callOnStart();var l=this.getEventAttr(i,"changedTouches");l&&(this.touchId||(this.isDragging=!0,this.touchId=l[0].identifier))},onMove:function(t,n,r){this.options.disableAnimation||this.moving&&this.sliderElem.addClass("noanimate"),this.moving=!0;var i,o=this.getEventAttr(n,"changedTouches");if(o)for(var s=0;s<o.length;s++)if(o[s].identifier===this.touchId){i=o[s];break}if(!o||i){var a,l=this.getEventPosition(n,i?i.identifier:void 0),u=this.options.rightToLeft?this.minValue:this.maxValue,c=this.options.rightToLeft?this.maxValue:this.minValue;0>=l?a=c:l>=this.maxPos?a=u:(a=this.positionToValue(l),a=r&&e.isNumber(this.options.showTicks)?this.roundStep(a,this.options.showTicks):this.roundStep(a)),this.positionTrackingHandle(a)}},onEnd:function(e,t){this.moving=!1,this.options.disableAnimation||this.sliderElem.removeClass("noanimate");var r=this.getEventAttr(t,"changedTouches");if(!r||r[0].identifier===this.touchId){this.isDragging=!1,this.touchId=null,this.options.keyboardSupport||(this.minH.removeClass("rz-active"),this.maxH.removeClass("rz-active"),this.tracking=""),this.dragging.active=!1;var i=this.getEventNames(t);n.off(i.moveEvent,e),n.off(i.endEvent,this.endHandlerToBeRemovedOnEnd),this.endHandlerToBeRemovedOnEnd=null,this.callOnEnd()}},onTickClick:function(e,t){this.onMove(e,t,!0)},onPointerFocus:function(t,n){this.tracking=n,t.one("blur",e.bind(this,this.onPointerBlur,t)),t.on("keydown",e.bind(this,this.onKeyboardEvent)),t.on("keyup",e.bind(this,this.onKeyUp)),this.firstKeyDown=!0,t.addClass("rz-active"),this.currentFocusElement={pointer:t,ref:n}},onKeyUp:function(){this.firstKeyDown=!0,this.callOnEnd()},onPointerBlur:function(e){e.off("keydown"),e.off("keyup"),e.removeClass("rz-active"),this.isDragging||(this.tracking="",this.currentFocusElement=null)},skipRestrictedRanges:function(e,t){if(this.options.restrictedRange&&Array.isArray(this.options.restrictedRange))for(var n in this.options.restrictedRange){var r=this.options.restrictedRange[n];if(0===r.from&&0===t&&[37,40].includes(e)||r.to>=this.options.restrictedRange[this.options.restrictedRange.length-1].to&&t>=this.options.restrictedRange[this.options.restrictedRange.length-1].to&&[38,39].includes(e))return t;r.to>t&&t>r.from&&(t=Math.abs(r.to-t)>Math.abs(r.from-t)?r.to:r.from)}return t},getKeyActions:function(e){var t=e+this.step,n=e-this.step,r=e+this.valueRange/10,i=e-this.valueRange/10;this.options.reversedControls&&(t=e-this.step,n=e+this.step,r=e-this.valueRange/10,i=e+this.valueRange/10);var o={UP:t,DOWN:n,LEFT:n,RIGHT:t,PAGEUP:r,PAGEDOWN:i,HOME:this.options.reversedControls?this.maxValue:this.minValue,END:this.options.reversedControls?this.minValue:this.maxValue};return this.options.rightToLeft&&(o.LEFT=t,o.RIGHT=n,this.options.vertical&&(o.UP=n,o.DOWN=t)),o},onKeyboardEvent:function(e){var n=e.keyCode||e.which,r=this[this.tracking],i=this.getKeyActions(r)[{38:"UP",40:"DOWN",37:"LEFT",39:"RIGHT",33:"PAGEUP",34:"PAGEDOWN",36:"HOME",35:"END"}[n]];if(null!=i&&""!==this.tracking){e.preventDefault(),this.firstKeyDown&&(this.firstKeyDown=!1,this.callOnStart());var o=this;t((function(){var e=o.roundStep(o.sanitizeValue(i));if(e=o.options.skipRestrictedRangesWithArrowKeys?o.skipRestrictedRanges(n,e):e,o.options.draggableRangeOnly){var t,r,s=o.highValue-o.lowValue;"lowValue"===o.tracking?(t=e,(r=e+s)>o.maxValue&&(t=(r=o.maxValue)-s)):(r=e,(t=e-s)<o.minValue&&(r=(t=o.minValue)+s)),o.positionTrackingBar(t,r)}else o.positionTrackingHandle(e)}))}},onDragStart:function(e,t,n){var r=this.getEventPosition(n);this.dragging={active:!0,value:this.positionToValue(r),difference:this.highValue-this.lowValue,lowLimit:this.options.rightToLeft?this.minH.rzsp-r:r-this.minH.rzsp,highLimit:this.options.rightToLeft?r-this.maxH.rzsp:this.maxH.rzsp-r},this.onStart(e,t,n)},getValue:function(e,t,n,r){var i,o=this.options.rightToLeft;return i="min"===e?n?r?o?this.minValue:this.maxValue-this.dragging.difference:o?this.maxValue-this.dragging.difference:this.minValue:o?this.positionToValue(t+this.dragging.lowLimit):this.positionToValue(t-this.dragging.lowLimit):n?r?o?this.minValue+this.dragging.difference:this.maxValue:o?this.maxValue:this.minValue+this.dragging.difference:o?this.positionToValue(t+this.dragging.lowLimit)+this.dragging.difference:this.positionToValue(t-this.dragging.lowLimit)+this.dragging.difference,this.roundStep(i)},onDragMove:function(e,t){this.options.disableAnimation||this.moving&&this.sliderElem.addClass("noanimate"),this.moving=!0;var n,r,i,o,s,a,l,u,c=this.getEventPosition(t);if(this.options.rightToLeft?(i=this.dragging.lowLimit,o=this.dragging.highLimit,l=this.maxH,u=this.minH):(i=this.dragging.highLimit,o=this.dragging.lowLimit,l=this.minH,u=this.maxH),s=o>=c,a=c>=this.maxPos-i,s){if(0===l.rzsp)return;n=this.getValue("min",c,!0,!1),r=this.getValue("max",c,!0,!1)}else if(a){if(u.rzsp===this.maxPos)return;r=this.getValue("max",c,!0,!0),n=this.getValue("min",c,!0,!0)}else n=this.getValue("min",c,!1),r=this.getValue("max",c,!1);this.positionTrackingBar(n,r)},positionTrackingBar:function(e,t){null!=this.options.minLimit&&e<this.options.minLimit&&(t=(e=this.options.minLimit)+this.dragging.difference),null!=this.options.maxLimit&&t>this.options.maxLimit&&(e=(t=this.options.maxLimit)-this.dragging.difference),this.lowValue=e,this.highValue=t,this.applyLowValue(),this.range&&this.applyHighValue(),this.applyModel(!0),this.updateHandles("lowValue",this.valueToPosition(e)),this.updateHandles("highValue",this.valueToPosition(t))},positionTrackingHandle:function(e){var t=!1;e=this.applyMinMaxLimit(e),e=this.applyRestrictedRange(e),this.range&&(this.options.pushRange?(e=this.applyPushRange(e),t=!0):(this.options.noSwitching&&("lowValue"===this.tracking&&e>this.highValue?e=this.applyMinMaxRange(this.highValue):"highValue"===this.tracking&&e<this.lowValue&&(e=this.applyMinMaxRange(this.lowValue))),e=this.applyMinMaxRange(e),"lowValue"===this.tracking&&e>this.highValue?(this.lowValue=this.highValue,this.applyLowValue(),this.applyModel(),this.updateHandles(this.tracking,this.maxH.rzsp),this.updateAriaAttributes(),this.tracking="highValue",this.minH.removeClass("rz-active"),this.maxH.addClass("rz-active"),this.options.keyboardSupport&&this.focusElement(this.maxH),t=!0):"highValue"===this.tracking&&e<this.lowValue&&(this.highValue=this.lowValue,this.applyHighValue(),this.applyModel(),this.updateHandles(this.tracking,this.minH.rzsp),this.updateAriaAttributes(),this.tracking="lowValue",this.maxH.removeClass("rz-active"),this.minH.addClass("rz-active"),this.options.keyboardSupport&&this.focusElement(this.minH),t=!0))),this[this.tracking]!==e&&(this[this.tracking]=e,"lowValue"===this.tracking?this.applyLowValue():this.applyHighValue(),this.applyModel(),this.updateHandles(this.tracking,this.valueToPosition(e)),this.updateAriaAttributes(),t=!0),t&&this.applyModel(!0)},applyMinMaxLimit:function(e){return null!=this.options.minLimit&&e<this.options.minLimit?this.options.minLimit:null!=this.options.maxLimit&&e>this.options.maxLimit?this.options.maxLimit:e},applyMinMaxRange:function(e){var t="lowValue"===this.tracking?this.highValue:this.lowValue,n=Math.abs(e-t);return null!=this.options.minRange&&n<this.options.minRange?"lowValue"===this.tracking?this.highValue-this.options.minRange:this.lowValue+this.options.minRange:null!=this.options.maxRange&&n>this.options.maxRange?"lowValue"===this.tracking?this.highValue-this.options.maxRange:this.lowValue+this.options.maxRange:e},applyRestrictedRange:function(e){for(var t in this.options.restrictedRange)if(null!=this.options.restrictedRange[t]&&e>this.options.restrictedRange[t].from&&e<this.options.restrictedRange[t].to){var n=(this.options.restrictedRange[t].to-this.options.restrictedRange[t].from)/2;if("lowValue"===this.tracking)return e>this.options.restrictedRange[t].from+n?this.options.restrictedRange[t].to:this.options.restrictedRange[t].from;if("highValue"===this.tracking)return e<this.options.restrictedRange[t].to-n?this.options.restrictedRange[t].from:this.options.restrictedRange[t].to}return e},applyPushRange:function(e){var t="lowValue"===this.tracking?this.highValue-e:e-this.lowValue,n=null!==this.options.minRange?this.options.minRange:this.options.step,r=this.options.maxRange;return n>t?("lowValue"===this.tracking?(this.highValue=Math.min(e+n,this.maxValue),e=this.highValue-n,this.applyHighValue(),this.updateHandles("highValue",this.valueToPosition(this.highValue))):(this.lowValue=Math.max(e-n,this.minValue),e=this.lowValue+n,this.applyLowValue(),this.updateHandles("lowValue",this.valueToPosition(this.lowValue))),this.updateAriaAttributes()):null!==r&&t>r&&("lowValue"===this.tracking?(this.highValue=e+r,this.applyHighValue(),this.updateHandles("highValue",this.valueToPosition(this.highValue))):(this.lowValue=e-r,this.applyLowValue(),this.updateHandles("lowValue",this.valueToPosition(this.lowValue))),this.updateAriaAttributes()),e},applyModel:function(e){this.internalChange=!0,this.scope.$apply(),e&&this.callOnChange(),this.internalChange=!1},callOnStart:function(){if(this.options.onStart){var e=this,t="lowValue"===this.tracking?"min":"max";this.scope.$evalAsync((function(){e.options.onStart(e.options.id,e.scope.rzSliderModel,e.scope.rzSliderHigh,t)}))}},callOnChange:function(){if(this.options.onChange){var e=this,t="lowValue"===this.tracking?"min":"max";this.scope.$evalAsync((function(){e.options.onChange(e.options.id,e.scope.rzSliderModel,e.scope.rzSliderHigh,t)}))}},callOnEnd:function(){if(this.options.onEnd){var e=this,t="lowValue"===this.tracking?"min":"max";this.scope.$evalAsync((function(){e.options.onEnd(e.options.id,e.scope.rzSliderModel,e.scope.rzSliderHigh,t)}))}this.scope.$emit("slideEnded")}},a}]).directive("rzslider",["RzSlider",function(e){return{restrict:"AE",replace:!0,scope:{rzSliderModel:"=?",rzSliderHigh:"=?",rzSliderOptions:"&?",rzSliderTplUrl:"@"},templateUrl:function(e,t){return t.rzSliderTplUrl||"rzSliderTpl.html"},link:function(t,n){t.slider=new e(t,n)}}}]);return t.run(["$templateCache",function(e){e.put("rzSliderTpl.html",'<div class=rzslider><span class="rz-bar-wrapper rz-left-out-selection"><span class=rz-bar></span></span> <span class="rz-bar-wrapper rz-right-out-selection"><span class=rz-bar></span></span> <span class=rz-bar-wrapper><span class=rz-bar></span></span> <span class=rz-bar-wrapper><span class="rz-bar rz-selection" ng-style=barStyle></span></span> <span class=rz-bar-wrapper><span class="rz-bar rz-restricted" ng-style=restrictionStyle></span></span> <span class="rz-pointer rz-pointer-min" ng-style=minPointerStyle></span> <span class="rz-pointer rz-pointer-max" ng-style=maxPointerStyle></span> <span class="rz-bubble rz-limit rz-floor"></span> <span class="rz-bubble rz-limit rz-ceil"></span> <span class="rz-bubble rz-model-value"></span> <span class="rz-bubble rz-model-high"></span> <span class=rz-bubble></span><ul ng-show=showTicks class=rz-ticks><li ng-repeat="t in ticks track by $index" class=rz-tick ng-class="{\'rz-selected\': t.selected}" ng-style=t.style ng-attr-uib-tooltip="{{ t.tooltip }}" ng-attr-tooltip-placement={{t.tooltipPlacement}} ng-attr-tooltip-append-to-body="{{ t.tooltip ? true : undefined}}"><span ng-if="t.value != null" class=rz-tick-value ng-attr-uib-tooltip="{{ t.valueTooltip }}" ng-attr-tooltip-placement={{t.valueTooltipPlacement}}>{{ t.value }}</span> <span ng-if="t.legend != null" class=rz-tick-legend>{{ t.legend }}</span></li></ul></div>')}]),t.name})?r.apply(t,i):r)||(e.exports=o)}()},33: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=""}}},34: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}}},35:function(e,t,n){"use strict";n.r(t),n.d(t,"mapActiveOperationResponseToModel",(function(){return l})),n.d(t,"mapActiveOperationToActiveOperationInfoModel",(function(){return c})),n.d(t,"mapImportActiveOperationToActiveOperationInfoModel",(function(){return h})),n.d(t,"mapQueriesActiveOperationToActiveOperationInfoModel",(function(){return p})),n.d(t,"mapBackupAndRestoreActiveOperationToActiveOperationInfoModel",(function(){return d})),n.d(t,"mapClusterActiveOperationToActiveOperationInfoModel",(function(){return f}));var r=n(3),i=n(11),o=n(1),s=n(36),a=n(12);const l=e=>{const t=new s.ActiveOperationsModel;return t.status=e.status,t.operations=u(e.allRunningOperations),t},u=(e=[])=>{const t=[];return e.forEach(e=>t.push(c(e))),t},c=e=>{switch(e.type){case r.OPERATION_TYPE.IMPORTS:return h(e);case r.OPERATION_TYPE.QUERIES:case r.OPERATION_TYPE.UPDATES:return p(e);case r.OPERATION_TYPE.BACKUP_RESTORE:return d(e);case r.OPERATION_TYPE.CLUSTER_STATUS:return f(e)}},h=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=a.OPERATION_MONITORING_CONSTANTS.IMPORT_MONITORING_URL,t},p=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=a.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=a.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=a.OPERATION_MONITORING_CONSTANTS.CLUSTER_MONITORING_URL,t}},36: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)}}},37:function(e,t,n){"use strict";n.r(t),n.d(t,"NamespaceModel",(function(){return r}));class r{constructor(e,t){this._prefix=e,this._uri=t}get prefix(){return this._prefix}set prefix(e){this._prefix=e}get uri(){return this._uri}set uri(e){this._uri=e}}},38: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}}}}},39: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})):[]},4: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}}}},40:function(e,t,n){"use strict";n.r(t);n(13);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.8.9">{{\'common.loading\' | translate}}</object>'}}}function o(){return{template:function(e,t){let n="";return n=t.hideMessage?"":t.message?`<div>${t.message}</div>`:"<div>{{'common.loading' | translate}}<div>",`\n <object width="${t.size}" height="${t.size}" data="js/angular/templates/loader/ot-loader.svg?v=2.8.9"></object>\n ${n}\n `}}}function s(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.8.9"/><div style="font-size: {{size/4}}px">{{currentMessage}}<div></div>'}}function a(e){return{restrict:"EA",transclude:!0,templateUrl:"js/angular/core/templates/core-errors.html",link:function(t,n,r){let i;t.$watch("getActiveRepository()",(function(e){e&&!t.isRestricted?n.hide():n.show()})),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 l(){return function(e,t){$(t).click((function(e){e.preventDefault(),e.stopPropagation()}))}}function u(){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)},s=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),s(),e})),r.$formatters.unshift((function(e){return o(e),s(),e})),$("[multi-required]").on("blur keyup change focusout",(function(){s()}))}}}angular.module("graphdb.framework.core.directives",["graphdb.framework.core.services.repositories","graphdb.framework.utils.localstorageadapter"]).directive("ontoLoader",i).directive("ontoLoaderFancy",o).directive("ontoLoaderNew",s).directive("coreErrors",a).directive("eatClick",l).directive("multiRequired",u).directive("searchResourceInput",h).directive("keyboardShortcuts",p).directive("inactivePluginDirective",d).directive("autoGrow",(function(){return{restrict:"A",require:"ngModel",link:function(e,t,n,r){const i=function(){const e=r.$viewValue;e&&""!==e.trim()?(t[0].style.height="0px",t[0].style.height=t[0].scrollHeight+"px"):t[0].style.height="26px",t[0].style.overflow="hidden"};e.$watch((function(){return r.$viewValue}),(function(){i()})),t.bind("input change",(function(){i()}))}}})).directive("captureHeight",(function(){return{restrict:"A",scope:{rowIndex:"=captureHeight"},link:function(e,t,n){e.$watch((function(){return t[0].offsetHeight}),(function(t){e.$parent.rowHeights[e.rowIndex]=t+"px!important"}))}}})),i.$inject=[],o.$inject=[],s.$inject=["$timeout"],a.$inject=["$timeout"],l.$inject=[],u.$inject=[];const c={table:"table",visual:"visual"};function h(e,t,n,i,o,s,a,l,u,h,p,d){return{restrict:"EA",scope:{repositoryNamespaces:"=",isAutocompleteEnabled:"=",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(h,f,g){f.autoCompleteStatus=void 0,f.autoCompleteWarning=!1,h.empty=!1,h.clear=!1,h.searchDisplayType=c;const m="true"===h.preserveSearch,v=f.find(".view-res-input");let y,b;h.textButtonLabel=h.textButton||"query.editor.table.btn",h.visualButtonLabel=h.visualButton||"query.editor.visual.btn",h.showClearInputIcon=!1,h.searchType=l.get(u.RDF_SEARCH_TYPE)||c.table,h.searchInput="",h.changeSearchType=function(e){h.searchType=e,l.set(u.RDF_SEARCH_TYPE,h.searchType)},h.$on("addStartFixedNodeAutomatically",(function(e,t){h.searchInput||!t.startIRI?h.checkIfValidAndSearchText():h.visualCallback({uri:t.startIRI,label:""})})),h.clearInput=function(){h.searchInput="",h.selectedElementIndex=-1,h.autoCompleteUriResults=[],h.showClearInputIcon=!1,l.remove(u.RDF_SEARCH_INPUT),l.remove(u.RDF_SEARCH_EXPANDED_URI),l.remove(u.RDF_RESOURCE_DESCRIPTION)},h.$watch("repositoryNamespaces",(function(){f.namespaces=h.repositoryNamespaces?h.repositoryNamespaces.namespaces:[]})),h.$watch("isAutocompleteEnabled",(function(){f.autoCompleteStatus=!!h.isAutocompleteEnabled,""!==h.searchInput&&h.onChange()})),h.$watch("empty",(function(){m||(h.searchInput="",h.empty=!1)})),h.$watch("clear",(function(){h.clear&&(h.clearInput(),h.clear=!1)})),o.$on("$translateChangeSuccess",(function(){g.$attr.placeholder?h.placeholder=g.$attr.placeholder:h.placeholder=p.instant("search.resources.msg")+"..."}));const w=function(t){const n=t.type||"uri";"true"===h.openInNewTab?S(!1,t):e.path("resource").search(n,t.uri)},x=function(t){const n=t.type||"uri";"true"===h.openInNewTab?S(!0,t):e.path("graphs-visualizations").search(n,t.uri)},S=function(e,t){const n=e?"graphs-visualizations":"resource";window.open(`${n}?uri=${encodeURIComponent(t.uri)}`)};angular.isUndefined(g.$attr.textCallback)&&(h.textCallback=w),angular.isUndefined(g.$attr.visualCallback)&&(h.visualCallback=x),g.$attr.textButton&&!h.textButton?h.textCallback=h.visualCallback:g.$attr.visualButton&&!h.visualButton&&(h.visualCallback=h.textCallback),g.$attr.placeholder?h.placeholder=g.$attr.placeholder:h.placeholder=p.instant("search.resources.msg")+"...",angular.isDefined(g.$attr.uriValidation)?h.uriValidation=g.$attr.uriValidation:h.uriValidation="true",angular.isDefined(g.$attr.preserveInput)&&(h.preserveInput=g.$attr.preserveInput),h.getResultItemHtml=function(e){return a.trustAsHtml(e.description)},h.searchRdfResource=function(e,t){if("prefix"===e.type)h.searchInput=T(e.value+":"),v.focus(),h.onChange();else{let n;n=angular.isUndefined(e)?h.searchInput:"object"==typeof e?e.value:e;let r="";if(e.description){const t=e.description.indexOf("<"+n+">");t>0&&(r=e.description.substring(0,t).replace(/<\/?b>/g,""))}t({uri:n,description:e.description,label:r,type:e.type}),m?(h.selectedElementIndex=h.activeSearchElm,l.set(u.RDF_SEARCH_EXPANDED_URI,y),l.set(u.RDF_SEARCH_INPUT,h.searchInput),l.set(u.RDF_RESOURCE_DESCRIPTION,e.description)):"true"===h.preserveInput?(h.searchInput=n,h.autoCompleteUriResults=[]):(h.searchInput="",h.autoCompleteUriResults=[])}},h.searchRdfResourceByEvent=function(e,t){h.searchType===c.visual||t.ctrlKey||t.metaKey?h.searchRdfResource(e,h.visualCallback):h.searchRdfResource(e,h.textCallback)};const E=function(e){const n=h.searchInput;""!==n?"false"!==h.uriValidation?f.autoCompleteStatus&&h.autoCompleteUriResults&&h.autoCompleteUriResults.length>0?"prefix"===h.autoCompleteUriResults[h.activeSearchElm].type?(h.searchInput=T(h.autoCompleteUriResults[h.activeSearchElm].value+":"),h.autoCompleteUriResults=[]):h.searchRdfResource(h.autoCompleteUriResults[h.activeSearchElm],e):C(n)?h.searchRdfResource(n,e):t.error(p.instant("invalid.uri.msg")):h.searchRdfResource(n,e):t.error(p.instant("fill.input.field.msg"))};function A(){let e=-1;const n=l.get(u.RDF_RESOURCE_DESCRIPTION);n&&h.autoCompleteUriResults&&(e=h.autoCompleteUriResults.findIndex(e=>e.description===n),h.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_"+h.selectedElementIndex);e.animate({scrollTop:t.offset().top-e.offset().top+e.scrollTop()})}()})).catch((function(e){t.error(getError(e),p.instant("no.prev.search.element"))}))),h.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 T(e){if(!/^<?(http|urn).*>?/.test(e)){const t=e.split(":"),r=t[0],i=t[1];if(!angular.isUndefined(i)){const e=n.getNamespaceUriForPrefix(f.namespaces,r);if(y=e!==y?e:y,y)return v.val(y),y+i}}return e}h.checkIfValidAndSearchText=function(){E(h.textCallback)},h.checkIfValidAndSearchVisual=function(){E(h.visualCallback)},h.checkIfValidAndSearchEvent=function(e){h.searchType===c.visual||e.ctrlKey||e.metaKey?E(h.visualCallback):E(h.textCallback)},h.onChange=function(){return h.showClearInputIcon=h.clearInputIcon,m&&l.set(u.RDF_SEARCH_INPUT,h.searchInput),"false"!==h.uriValidation&&(h.searchInput=T(h.searchInput),f.autoCompleteStatus)?function(e){let t=e.replace(y,y+";");if(f.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),b&&b.resolve(),b=s.defer(),i.getAutocompleteSuggestions(t,b.promise).then((function(e){b=null,h.autoCompleteUriResults=e.data.suggestions,h.activeSearchElm=0}));return Promise.resolve()}(h.searchInput):Promise.resolve()},h.onKeyDown=function(e){if(13===e.keyCode){if(e.preventDefault(),d.isActive())return;"false"!==h.uriValidation?f.autoCompleteStatus?h.checkIfValidAndSearchEvent(e):C(e.target.value)?h.searchRdfResourceByEvent(e.target.value,e):t.error(p.instant("invalid.uri.msg")):h.searchRdfResourceByEvent(e.target.value,e)}else if(h.searchInput.length>0&&!f.autoCompleteWarning&&!f.autoCompleteStatus){f.autoCompleteWarning=!0;const e=Object(r.decodeHTML)(p.instant("explore.autocomplete.warning.msg"));t.warning("",`<div class="autocomplete-toast"><a href="autocomplete">${e}</a></div>`,{allowHtml:!0})}if(f.autoCompleteStatus&&!angular.isUndefined(h.autoCompleteUriResults)){if(40===e.keyCode&&h.activeSearchElm<h.autoCompleteUriResults.length-1&&(h.activeSearchElm++,h.searchInput=h.autoCompleteUriResults[h.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&&h.activeSearchElm>0&&(e.preventDefault(),h.activeSearchElm--,h.searchInput=h.autoCompleteUriResults[h.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(m)return;h.searchInput="",h.autoCompleteUriResults=[]}h.searchInput||h.clearInput()}},h.$on("rdfResourceSearchExpanded",(function(){(m?(h.preserveInput="true",h.searchInput=l.get(u.RDF_SEARCH_INPUT)||"",y=l.get(u.RDF_SEARCH_EXPANDED_URI),h.onChange()):Promise.resolve()).then((function(){A()}))})),h.setActiveClassOnMouseMove=function(e){f.autoCompleteStatus&&(h.activeSearchElm=e)}}}}function p(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,s){return{restrict:"E",transclude:!0,scope:{loadSaved:"&",setPluginActive:"&",pluginName:"@",humanReadablePluginName:"@"},templateUrl:"js/angular/core/templates/inactive-plugin-warning-page.html",link:function(a){function l(){if(o.isLicenseValid()&&i.getActiveRepository()&&!i.isActiveRepoOntopType()&&!i.isActiveRepoFedXType())return t.checkPluginIsActive(a.pluginName,i.getActiveRepository()).then((function({data:e}){a.pluginIsActive=e.indexOf("true")>0,a.setPluginActive({isPluginActive:a.pluginIsActive})})).catch((function(t){e.error(getError(t),s.instant("check.active.plugin.failure"))}))}a.pluginIsActive=!0,a.activatePlugin=function(){const o=Object(r.decodeHTML)(s.instant("activate.plugin.warning.msg",{humanReadablePluginName:a.humanReadablePluginName}));n.openSimpleModal({title:s.instant("activate.plugin.confirmation"),message:`<p>${o}</p>`,warning:!0}).result.then((function(){t.activatePlugin(a.pluginName,i.getActiveRepository()).then((function(){a.pluginIsActive=!0,a.setPluginActive({isPluginActive:a.pluginIsActive}),a.loadSaved()})).catch((function(t){e.error(getError(t),s.instant("activate.plugin.failure"))}))}))};const u=a.$on("repositoryIsSet",(function(){l()}));window.addEventListener("beforeunload",(function e(){u(),window.removeEventListener("beforeunload",e)})),a.$on("checkIsActive",l),l()}}}h.$inject=["$location","toastr","ClassInstanceDetailsService","AutocompleteRestService","$rootScope","$q","$sce","LocalStorageAdapter","LSKeys","$repositories","$translate","GuidesService"],p.$inject=["$document"],d.$inject=["toastr","RDF4JRepositoriesRestService","ModalService","$repositories","$licenseService","$translate"]},41:function(e,t,n){"use strict";n.r(t);n(9),n(21),n(50),n(27),n(83),n(84),n(22);var r=n(16),i=n(20),o=n(28);angular.module("graphdb.framework.core.services.repositories",["ngCookies","graphdb.framework.rest.repositories.service","graphdb.framework.rest.locations.service","graphdb.framework.rest.license.service","toastr","graphdb.framework.utils.event-emitter-service"]).service("$repositories",["toastr","$rootScope","$timeout","$location","productInfo","$jwtAuth","RepositoriesRestService","LocationsRestService","LicenseRestService","$translate","$q","LocalStorageAdapter","LSKeys","EventEmitterService","RDF4JRepositoriesRestService",function(e,t,n,s,a,l,u,c,h,p,d,f,g,m,v){this.location={uri:"",label:"Local",local:!0},this.locationError="",this.loading=!0,this.locations=[this.location],this.repositories=new Map,this.locationsShouldReload=!0;const y=this,b=function(t,n){y.loading=!1,t&&(y.location={},y.locationError=n,y.repositories=new Map,y.setRepository(""),t.statusText?e.error(t.statusText,p.instant("repositories.service.error.loading.location")):e.error(p.instant("repositories.service.error.loading.location")))};let w;this.resetActiveRepository=function(){const e=this.getActiveRepositoryObjectFromStorage(),n=y.repositories.get(e.location);let r=!1;n&&(r=n.find(t=>t.id===e.id)),r?l.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&&y.repositories.delete(t.uri)&&y.resetActiveRepository(),h.getVersion(t.uri).success((function(e){"object"==typeof e?e.productVersion!==a.productVersion&&(t.degradedReason=p.instant("repositories.service.different.gdb.version",{location:t.name})):t.degradedReason=p.instant("repositories.service.different.gdb.version",{location:t.name})})).error((function(n){t.errorMsg=n,e||(y.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.assignHashesToRepositories=function(e){return e.map(e=>{const t=Object(i.md5HashGenerator)();return e.hash=t(JSON.stringify(e)),e})},this.init=function(e,n,r){return this.loading=!0,r||(this.locationsShouldReload=!0),c.getActiveLocation().then((function(i){if(i.data){const o=i.data;if(o.active)return u.getRepositories().then((function(n){y.location=o,Object.entries(n.data).forEach(([e,t])=>{const n=y.assignHashesToRepositories(t);y.clearLocationErrorMsg(e),y.repositories.set(e,n)}),y.resetActiveRepository(),b(),y.checkLocationsDegraded(r),t.globalLocation=y.location,t.globalRepositories=y.getRepositories(),e&&e()})).catch((function(e){b(e),n&&n()}))}else b(),r&&(y.locationsShouldReload=!0),y.location="",y.repositories=new Map,y.setRepository("");t.globalLocation=y.location,t.globalRepositories=y.getRepositories()})).catch((function(e){b(e),n&&n()}))},this.getLocations=function(e){if(this.locationsShouldReload||w)return w||(this.locationsShouldReload=!1,this.locations=[this.location],w=c.getLocations(e).then(e=>(y.locations=e.data.map(e=>new o.RemoteLocationModel(e)),this.locations)).catch((function(){n((function(){y.locationsShouldReload=!0}),2e3)})).finally(()=>{w=null})),w;const t=d.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:p.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.getRepository=function(e){return this.getRepositories().find(t=>t.id===e)},this.getReadableRepositories=function(){return _.filter(this.getRepositories(),(function(e){return l.canReadRepo(e)}))},this.getReadableGraphdbRepositories=function(){return this.getReadableRepositories().filter(e=>"graphdb"===e.type)},this.getLocalReadableGraphdbRepositories=function(){return this.getReadableGraphdbRepositories().filter(e=>!0===e.local)},this.getLocalReadablGraphdbRepositoryIds=function(){return this.getLocalReadableGraphdbRepositories().map(e=>e.id)},this.getWritableRepositories=function(){const e=this;return _.filter(this.getRepositories(),(function(t){return l.canWriteRepo(t)&&!e.isActiveRepoOntopType(t)}))},this.getActiveRepositoryObjectFromStorage=function(){return{id:f.get(g.REPOSITORY_ID)||"",location:f.get(g.REPOSITORY_LOCATION)||""}},this.getActiveRepository=function(){return f.get(g.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){const n={oldRepository:this.repository,newRepository:e,cancel:!1};m.emit("repositoryWillChangeEvent",n,n=>{n.cancel||(e?(f.set(g.REPOSITORY_ID,e.id),f.set(g.REPOSITORY_LOCATION,e.location)):(f.remove(g.REPOSITORY_ID),f.remove(g.REPOSITORY_LOCATION)),this.setRepositoryHeaders(e),t.$broadcast("repositoryIsSet",{newRepo:!0}),e&&!l.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(p.instant("repositories.service.no.active.location"),p.instant("common.error"));const n=this;c.setDefaultRepository(t).success((function(){n.location.defaultRepository=t})).error((function(t){const n=getError(t);e.error(n,p.instant("common.error"))}))},this.deleteLocation=function(t){return c.deleteLocation(encodeURIComponent(t)).success((function(){const e=y.getActiveRepositoryObject();e&&e.location===t&&(y.location="",y.setRepository("")),y.init()})).error((function(t){const n=getError(t);e.error(n,p.instant("common.error"))}))},this.deleteRepository=function(t){return u.deleteRepository(t).success((function(){y.init()})).error((function(t){const n=getError(t);e.error(n,p.instant("common.error"))})).finally(()=>{const e=y.getActiveRepositoryObject();e&&e.id===t.id&&e.location===t.location&&y.setRepository("")})},this.restartRepository=function(t){return u.restartRepository(t).success((function(){e.success(p.instant("repositories.service.restarting.repo",{repositoryId:t.id})),y.initQuick()})).error((function(t){const n=getError(t);e.error(n,p.instant("common.error"))}))},this.getRepositoryTurtleConfig=function(e){return u.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)},this.getPrefixes=e=>v.getRepositoryNamespaces(e).then(e=>{const t={};return e.data.results.bindings.forEach((function(e){t[e.prefix.value]=e.namespace.value})),t}),this.resolveSparqlEndpoint=e=>e===r.QueryMode.UPDATE?`repositories/${this.getActiveRepository()}/statements`:e===r.QueryMode.QUERY?"repositories/"+this.getActiveRepository():void 0,t.$on("securityInit",(function(e,t,r,i){w=null,(!t||r||i)&&n((function(){y.init()}))})),t.$on("reloadLocations",(function(){y.locationsShouldReload=!0,y.getLocations().then(()=>y.initQuick())}))}])},42:function(e,t,n){"use strict";n.r(t);n(9),n(55),n(56);var r=n(6);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,s,a,l,u,c,h){const p=this;i.deniedPermissions={},i.setPermissionDenied=function(e){return!("/login"===e||!p.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 p.authTokenIsType("Bearer")&&(e=!0),p.clearAuthenticationInternal(),p.updateReturnUrl(),n.path("/login"),t?n.search("noaccess"):e&&n.search("expired"),new Promise(e=>{setTimeout(()=>{e(!0)},100)})},i.hasExternalAuthUser=function(){return p.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=u.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),""),s.initOpenId(d.openIDConfig,d.gdbUrl,(function(e){u.setAuthToken(s.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{u.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=u.getAuthToken();return t&&t.startsWith(e)},this.loginOpenID=function(){s.login(this.openIDConfig,this.gdbUrl)},this.toggleSecurity=function(e){return e!==this.securityEnabled?o.toggleSecurity(e).then((function(){t.success(a.instant("jwt.auth.security.status",{status:a.instant(e?"enabled.status":"disabled.status")})),u.clearAuthToken(),d.initSecurity(),d.securityEnabled=e})).catch((function(e){t.error(e.data,a.instant("common.error"))})):Promise.resolve()},this.toggleFreeAccess=function(e,n,r,s){(e!==this.freeAccess||s)&&(this.freeAccessPrincipal=e?{authorities:n,appSettings:r}:void 0,o.setFreeAccess({enabled:e?"true":"false",authorities:n,appSettings:r}).then(()=>{this.freeAccess=e,s?t.success(a.instant("jwt.auth.free.access.updated.msg")):t.success(a.instant("jwt.auth.free.access.status",{status:a.instant(e?"enabled.status":"disabled.status")}))}).catch(e=>{t.error(e.data,a.instant("common.error"))}),i.$broadcast("securityInit",this.securityEnabled,this.hasExplicitAuthentication(),this.freeAccess))},this.authenticate=function(e,t){return new Promise(n=>{t?(u.setAuthToken(t),this.externalAuthUser=!1):u.clearAuthToken(),this.principal=e,i.deniedPermissions={},this.securityInitialized=!0;const r={id:h.get(c.REPOSITORY_ID)||"",location:h.get(c.REPOSITORY_LOCATION)||""};p.canReadRepo(r)||(h.remove(c.REPOSITORY_ID),h.remove(c.REPOSITORY_LOCATION),i.deniedPermissions={}),i.$broadcast("securityInit",this.securityEnabled,d.hasExplicitAuthentication(),this.freeAccess),setTimeout(()=>{n(!0)})})},this.authenticateOpenID=function(e){u.clearAuthToken(),e&&(u.setAuthToken(e),this.externalAuthUser=!1)},this.hasExternalAuthUser=function(){return this.externalAuthUser},this.hasExplicitAuthentication=function(){return null!=u.getAuthToken()||this.externalAuthUser},this.getPrincipal=function(){if(this.principal)return Promise.resolve(this.principal);const e=l.defer();return i.$on("securityInit",()=>{e.resolve(this.principal)}),e.promise},this.clearAuthenticationInternal=function(){s.softLogout(),this.principal=this.freeAccessPrincipal,u.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),s=e.location?`${e.id}@${e.location}`:e.id;if(i[0]===t&&(s===o||"SYSTEM"!==e.id&&"*"===o))return!0}return!1},this.updateUserData=e=>o.updateUserData(e)}])},43:function(e,t,n){"use strict";n.r(t);var r=n(32),i=n(35);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)}}}},435: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 s(e,t){return o(e)==o(t)}var a,l=t.noop,u=t.forEach,c=i.$$selectors,h=t.isArray,p=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){function x(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 S(e){var t,r=n.defer();return r.promise.$$cancelFn=function(){t&&t()},y.$$postDigest((function(){t=e((function(){r.resolve()}))})),r.promise}function E(e){if(d(e))return e.tempClasses&&p(e.tempClasses)&&(e.tempClasses=e.tempClasses.split(/\s+/)),e}function A(e,n,i,o){function s(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),E.push({event:t,fn:n}),w.push({event:t,fn:r}),!0}function a(t,n,r){var s=[];u(t,(function(e){e.fn&&s.push(e)}));var a=0;u(s,(function(t,u){var c=function(){e:{if(n){if((n[u]||l)(),++a<s.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 p=e[0];if(p){var d,f;o&&(o.to=o.to||{},o.from=o.from||{}),h(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(I(y)){var b=l,$=[],w=[],x=l,S=[],E=[];y=(" "+y).replace(/\s+/g,".");return u(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],s=c[o];s&&!n[o]&&(t.push(r.get(s)),n[o]=!0)}return t}}(y),(function(e){!s(e,n)&&m&&(s(e,"addClass"),s(e,"removeClass"))})),{node:p,event:n,className:i,isClassBased:v,isSetClassOperation:m,applyStyles:function(){o&&e.css(t.extend(o.from||{},o.to||{}))},before:function(e){b=e,a(w,$,(function(){b=l,e()}))},after:function(e){x=e,a(E,S,(function(){x=l,e()}))},cancel:function(){$&&(u($,(function(e){(e||l)(!0)})),b(!0)),S&&(u(S,(function(e){(e||l)(!0)})),x(!0))}}}}}function C(e,n,r,i,o,c,h,p){function d(t){var i="$animate:"+t;x&&x[i]&&0<x[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 $(){if(!$.hasBeenRun){w&&w.applyStyles(),$.hasBeenRun=!0,h&&h.tempClasses&&u(h.tempClasses,(function(e){a.removeClass(r,e)}));var e=r.data("$$ngAnimateState");e&&(w&&w.isClassBased?F(r,n):(v((function(){var e=r.data("$$ngAnimateState")||{};k==e.index&&F(r,n)})),r.data("$$ngAnimateState",e))),d("close"),p()}}var w=A(r,e,n,h);if(!w)return b(),g(),y(),$(),l;e=w.event,n=w.className;var x=(x=t.element._data(w.node))&&x.events;if(i||(i=o?o.parent():r.parent()),function(e,n){if(f.disabled)return!0;if(s(e,m))return f.running;var r,i,o;do{if(0===n.length)break;var a=s(n,m),l=a?f:n.data("$$ngAnimateState")||{};if(l.disabled)return!0;a&&(o=!0),!1!==r&&(a=n.data("$$ngAnimateChildren"),t.isDefined(a)&&(r=a)),i=i||l.running||l.last&&!l.last.isClassBased}while(n=n.parent());return!o||!r&&i}(r,i))return b(),g(),y(),$(),l;var S=(i=r.data("$$ngAnimateState")||{}).active||{},E=i.totalActive||0,C=i.last;if(o=!1,0<E){if(E=[],w.isClassBased)"setClass"==C.event?(E.push(C),F(r,n)):S[n]&&((T=S[n]).event==e?o=!0:(E.push(T),F(r,n)));else if("leave"==e&&S["ng-leave"])o=!0;else{for(var T in S)E.push(S[T]);i={},F(r,!0)}0<E.length&&u(E,(function(e){e.cancel()}))}if(!w.isClassBased||w.isSetClassOperation||"animate"==e||o||(o="addClass"==e==r.hasClass(n)),o)return b(),g(),y(),d("close"),p(),l;S=i.active||{},E=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(),F(e,"ng-leave"))})),a.addClass(r,"ng-animate"),h&&h.tempClasses&&u(h.tempClasses,(function(e){a.addClass(r,e)}));var k=D++;return E++,S[n]=w,r.data("$$ngAnimateState",{last:w,active:S,index:k,totalActive:E}),g(),w.before((function(t){var i=r.data("$$ngAnimateState");t=t||!i||!i.active[n]||w.isClassBased&&i.active[n].event!=e,b(),!0===t?$():(y(),w.after($))})),w.cancel}function T(e){(e=o(e))&&(e=t.isFunction(e.getElementsByClassName)?e.getElementsByClassName("ng-animate"):e.querySelectorAll(".ng-animate"),u(e,(function(e){(e=(e=t.element(e)).data("$$ngAnimateState"))&&e.active&&u(e.active,(function(e){e.cancel()}))})))}function F(e,t){if(s(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||(a.removeClass(e,"ng-animate"),e.removeData("$$ngAnimateState"))}}a=w,m.data("$$ngAnimateState",f);var k=y.$watch((function(){return $.totalPendingRequests}),(function(e,t){0===e&&(k(),y.$$postDigest((function(){y.$$postDigest((function(){f.running=!1}))})))})),D=0,R=i.classNameFilter(),I=R?function(e){return R.test(e)}:function(){return!0};return{animate:function(e,n,r,i,s){return i=i||"ng-inline-animate",(s=E(s)||{}).from=r?n:null,s.to=r||n,S((function(n){return C("animate",i,t.element(o(e)),null,null,l,s,n)}))},enter:function(n,r,i,s){return s=E(s),n=t.element(n),r=r&&t.element(r),i=i&&t.element(i),x(n,!0),e.enter(n,r,i),S((function(e){return C("enter","ng-enter",t.element(o(n)),r,i,l,s,e)}))},leave:function(n,r){return r=E(r),T(n=t.element(n)),x(n,!0),S((function(i){return C("leave","ng-leave",t.element(o(n)),null,null,(function(){e.leave(n)}),r,i)}))},move:function(n,r,i,s){return s=E(s),n=t.element(n),r=r&&t.element(r),i=i&&t.element(i),T(n),x(n,!0),e.move(n,r,i),S((function(e){return C("move","ng-move",t.element(o(n)),r,i,l,s,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,s){if(s=E(s),n=t.element(n),x(n=t.element(o(n))))return e.$$setClassImmediately(n,r,i,s);var a,l=n.data("$$animateClasses"),c=!!l;return l||(l={classes:{}}),a=l.classes,r=h(r)?r:r.split(" "),u(r,(function(e){e&&e.length&&(a[e]=!0)})),i=h(i)?i:i.split(" "),u(i,(function(e){e&&e.length&&(a[e]=!1)})),c?(s&&l.options&&(l.options=t.extend(l.options||{},s)),l.promise):(n.data("$$animateClasses",l={classes:a,options:s}),l.promise=S((function(t){var r=n.parent(),i=o(n);if((s=i.parentNode)&&!s.$$NG_REMOVED&&!i.$$NG_REMOVED){i=n.data("$$animateClasses"),n.removeData("$$animateClasses");var s=n.data("$$ngAnimateState")||{},a=function(e,t,n){var r={};u(n=n||{},(function(e,t){u(t.split(" "),(function(t){r[t]=e}))}));var i=Object.create(null);u((e.attr("class")||"").split(/\s+/),(function(e){i[e]=!0}));var o=[],s=[];return u(t&&t.classes||[],(function(e,t){var n=i[t],a=r[t]||{};!1===e?(n||"addClass"==a.event)&&s.push(t):!0===e&&(n&&"removeClass"!=a.event||o.push(t))})),0<o.length+s.length&&[o.join(" "),s.join(" ")]}(n,i,s.active);return a?C("setClass",a,n,r,null,(function(){a[0]&&e.$$addClassImmediately(n,a[0]),a[1]&&e.$$removeClassImmediately(n,a[1])}),i.options,t):t()}t()})))},cancel:function(e){e.$$cancelFn()},enabled:function(e,t){switch(arguments.length){case 2:if(e)F(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,s,c){function d(){D||(D=c((function(){P=[],D=null,R={}})))}function f(e,t){D&&D(),P.push(t),D=c((function(){u(P,(function(e){e()})),P=[],D=null,R={}}))}function g(e,n){var r=o(e);e=t.element(r),j.push(e),(r=Date.now()+n)<=_||(s.cancel(O),_=r,O=s((function(){!function(e){u(e,(function(e){(e=e.data("$$ngAnimateCSS3Data"))&&u(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,s=0,a=0;u(e,(function(e){if(1==e.nodeType){e=r.getComputedStyle(e)||{},i=Math.max(v(e[A+"Duration"]),i),o=Math.max(v(e[A+"Delay"]),o),a=Math.max(v(e[T+"Delay"]),a);var t=v(e[T+"Duration"]);0<t&&(t*=parseInt(e[T+"IterationCount"],10)||1),s=Math.max(t,s)}})),n={total:0,transitionDelay:o,transitionDuration:i,animationDelay:a,animationDuration:s},t&&(R[t]=n)}return n}function v(e){var t=0;return e=p(e)?e.split(/\s*,\s*/):[],u(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),(l=(s=t.parent()).data("$$ngAnimateKey"))||(s.data("$$ngAnimateKey",++I),l=I),i=l+"-"+o(t).getAttribute("class");var s,l,u={};0<(l=R[s=i+" "+n]?++R[s].total:0)&&((i=!R[u=i+" "+(c=n+"-stagger")])&&a.addClass(t,c),u=m(t,u),i&&a.removeClass(t,c));a.addClass(t,n);var c=t.data("$$ngAnimateCSS3Data")||{},h=m(t,s);return i=h.transitionDuration,h=h.animationDuration,e&&0===i&&0===h?(a.removeClass(t,n),!1):(n=r||e&&0<i,e=0<h&&0<u.animationDelay&&0===u.animationDuration,t.data("$$ngAnimateCSS3Data",{stagger:u,cacheKey:s,running:c.running||0,itemIndex:l,blockTransition:n,closeAnimationFns:c.closeAnimationFns||[]}),s=o(t),n&&(b(s,!0),r&&t.css(r)),e&&(s.style[T+"PlayState"]="paused"),!0)}function b(e,t){e.style[A+"Property"]=t?"none":""}function $(e,t,n,r){if(y(e,t,n,r))return function(e){e&&S(t,n)}}function w(e,t,n,r,i){if(t.data("$$ngAnimateCSS3Data"))return function(e,t,n,r,i){function l(){t.off(I,c),a.removeClass(t,p),a.removeClass(t,d),D&&s.cancel(D),S(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)>=A&&t>=E&&r()}var h=o(t);if(e=t.data("$$ngAnimateCSS3Data"),-1!=h.getAttribute("class").indexOf(n)&&e){var p="",d="";u(n.split(" "),(function(e,t){var n=(0<t?" ":"")+e;p+=n+"-active",d+=n+"-pending"}));var f=[],v=e.itemIndex,y=e.stagger,$=0;if(0<v){$=0,0<y.transitionDelay&&0===y.transitionDuration&&($=y.transitionDelay*v);var w=0;0<y.animationDelay&&0===y.animationDuration&&(w=y.animationDelay*v,f.push(k+"animation-play-state")),$=Math.round(100*Math.max($,w))/100}$||(a.addClass(t,p),e.blockTransition&&b(h,!1));var x=m(t,e.cacheKey+" "+p),E=Math.max(x.transitionDuration,x.animationDuration);if(0!==E){!$&&i&&(x.transitionDuration||(t.css("transition",x.animationDuration+"s linear all"),f.push("transition")),t.css(i));var A=1e3*(v=Math.max(x.transitionDelay,x.animationDelay));0<f.length&&(";"!==(y=h.getAttribute("style")||"").charAt(y.length-1)&&(y+=";"),h.setAttribute("style",y+" "));var D,R=Date.now(),I=F+" "+C;v=1e3*($+1.5*(v+E));return 0<$&&(a.addClass(t,d),D=s((function(){D=null,0<x.transitionDuration&&b(h,!1),0<x.animationDuration&&(h.style[T+"PlayState"]=""),a.addClass(t,p),a.removeClass(t,d),i&&(0===x.transitionDuration&&t.css("transition",x.animationDuration+"s linear all"),t.css(i),f.push("transition"))}),1e3*$,!1)),t.on(I,c),e.closeAnimationFns.push((function(){l(),r()})),e.running++,g(t,v),l}a.removeClass(t,p),S(t,n),r()}else r()}(e,t,n,r,i);S(t,n),r()}function x(e,t,n,r,i){var o=$(e,t,n,i.from);if(o){var s=o;return f(0,(function(){s=w(e,t,n,r,i.to)})),function(e){(s||l)(e)}}d(),r()}function S(e,t){a.removeClass(e,t);var n=e.data("$$ngAnimateCSS3Data");n&&(n.running&&n.running--,n.running&&0!==n.running||e.removeData("$$ngAnimateCSS3Data"))}function E(e,t){var n="";return e=h(e)?e:e.split(/\s+/),u(e,(function(e,r){e&&0<e.length&&(n+=(0<r?" ":"")+e+t)})),n}var A,C,T,F,k="";e.ontransitionend===n&&e.onwebkittransitionend!==n?(k="-webkit-",A="WebkitTransition",C="webkitTransitionEnd transitionend"):(A="transition",C="transitionend"),e.onanimationend===n&&e.onwebkitanimationend!==n?(k="-webkit-",T="WebkitAnimation",F="webkitAnimationEnd animationend"):(T="animation",F="animationend");var D,R={},I=0,P=[],O=null,_=0,j=[];return{animate:function(e,t,n,r,i,o){return(o=o||{}).from=n,o.to=r,x("animate",e,t,i,o)},enter:function(e,t,n){return x("enter",e,"ng-enter",t,n=n||{})},leave:function(e,t,n){return x("leave",e,"ng-leave",t,n=n||{})},move:function(e,t,n){return x("move",e,"ng-move",t,n=n||{})},beforeSetClass:function(e,t,n,r,i){if(i=i||{},i=$("setClass",e,t=E(n,"-remove")+" "+E(t,"-add"),i.from))return f(0,r),i;d(),r()},beforeAddClass:function(e,t,n,r){if(r=r||{},t=$("addClass",e,E(t,"-add"),r.from))return f(0,n),t;d(),n()},beforeRemoveClass:function(e,t,n,r){if(r=r||{},t=$("removeClass",e,E(t,"-remove"),r.from))return f(0,n),t;d(),n()},setClass:function(e,t,n,r,i){return i=i||{},w("setClass",e,(n=E(n,"-remove"))+" "+(t=E(t,"-add")),r,i.to)},addClass:function(e,t,n,r){return r=r||{},w("addClass",e,E(t,"-add"),n,r.to)},removeClass:function(e,t,n,r){return r=r||{},w("removeClass",e,E(t,"-remove"),n,r.to)}}}])}])}(window,window.angular)},436:function(e,t){!function(e,t,n){"use strict";t.module("ngCookies",["ng"]).factory("$cookies",["$rootScope","$browser",function(e,n){var r,i={},o={},s=!1,a=t.copy,l=t.isUndefined;return n.addPollFn((function(){var t=n.cookies();r!=t&&(r=t,a(t,o),a(t,i),s&&e.$apply())}))(),s=!0,e.$watch((function(){var e,r,s;for(e in o)l(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),s=!0);if(s)for(e in r=n.cookies(),i)i[e]!==r[e]&&(l(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)},437: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,s,a,l){function u(){d&&(r.cancel(d),d=null),h&&(h.$destroy(),h=null),p&&((d=r.leave(p)).then((function(){d=null})),p=null)}function c(){var s=e.current&&e.current.locals;if(t.isDefined(s&&s.$template)){s=i.$new();var a=e.current;p=l(s,(function(e){r.enter(e,null,p||o).then((function(){!t.isDefined(f)||f&&!i.$eval(f)||n()})),u()})),(h=a.scope=s).$emit("$viewContentLoaded"),h.$eval(g)}else u()}var h,p,d,f=s.autoscroll,g=s.onload||"";i.$on("$routeChangeSuccess",c),c()}}}function i(e,t,n){return{restrict:"ECA",priority:-400,link:function(r,i){var o=n.current,s=o.locals;i.html(s.$template);var a=e(i.contents());o.controller&&(s.$scope=r,s=t(o.controller,s),o.controllerAs&&(r[o.controllerAs]=s),i.data("$ngControllerController",s),i.children().data("$ngControllerController",s)),a(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 s="/"==e[e.length-1]?e.substr(0,e.length-1):e+"/";r[s]=t.extend({redirectTo:e},n(s,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,s,a,l,u,c){function h(o){var s=v.current;(g=(f=function(){var n,o;return t.forEach(r,(function(r,s){var a;if(a=!o){var l=i.path();a=r.keys;var u={};if(r.regexp)if(l=r.regexp.exec(l)){for(var c=1,h=l.length;c<h;++c){var p=a[c-1],d=l[c];p&&d&&(u[p.name]=d)}a=u}else a=null;else a=null;a=n=a}a&&((o=e(r,{params:t.extend({},i.search(),n),pathParams:n})).$$route=r)})),o||r.null&&e(r.null,{params:{},pathParams:{}})}())&&s&&f.$$route===s.$$route&&t.equals(f.pathParams,s.pathParams)&&!f.reloadOnSearch&&!m)||!s&&!f||n.$broadcast("$routeChangeStart",f,s).defaultPrevented&&o&&o.preventDefault()}function p(){var e=v.current,r=f;g?(e.params=r.params,t.copy(e.params,s),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()),a.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)?l.get(e):l.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=u(n))),t.isDefined(e)&&(i.$template=e),a.all(i)}})).then((function(i){r==v.current&&(r&&(r.locals=i,t.copy(r.params,s)),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(){h(),p()}))},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",h),n.$on("$locationChangeSuccess",p),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)},438:function(e,t){
|
|
18
18
|
/**
|
|
19
19
|
* An Angular module that gives you access to the browsers local storage
|
|
20
20
|
* @version v0.1.5 - 2014-11-04
|
|
@@ -73,7 +73,7 @@ function ne(e,t){this.x=t,this.q=e}function re(e,t,n,r){this.curve=e,this.x=t,th
|
|
|
73
73
|
ne.prototype.getByteLength=function(){return Math.floor((this.toBigInteger().bitLength()+7)/8)},re.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},re.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 w(r),s=new w(i);return new re(e,e.fromBigInteger(o),e.fromBigInteger(s))},re.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 w(r,16),s=new w(i,16);return new re(e,e.fromBigInteger(o),e.fromBigInteger(s))},re.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 re(this.curve,r,i)},re.prototype.twice2D=function(){if(this.isInfinity())return this;if(0==this.y.toBigInteger().signum())return this.curve.getInfinity();var e=this.curve.fromBigInteger(w.valueOf(2)),t=this.curve.fromBigInteger(w.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 re(this.curve,r,i)},re.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 w("3")),i=this.negate(),o=this;for(t=r.bitLength()-2;t>0;--t){o=o.twice();var s=r.testBit(t);s!=n.testBit(t)&&(o=o.add2D(s?this:i))}return o},re.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),s=e.multiply(e).multiply(e).add(n.multiply(e)).add(r).mod(i);return o.equals(s)},re.prototype.toString=function(){return"("+this.getX().toBigInteger().toString()+","+this.getY().toBigInteger().toString()+")"},re.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(w.ONE)<0||t.compareTo(e.subtract(w.ONE))>0)throw new Error("x coordinate out of bounds");if(n.compareTo(w.ONE)<0||n.compareTo(e.subtract(w.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};
|
|
74
74
|
/*! Mike Samuel (c) 2009 | code.google.com/p/json-sans-eval
|
|
75
75
|
*/
|
|
76
|
-
var oe=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,s){var a,l,u=n.match(e),c=u[0],h=!1;"{"===c?a={}:"["===c?a=[]:(a=[],h=!0);for(var p=[a],d=1-h,f=u.length;d<f;++d){var g;switch((c=u[d]).charCodeAt(0)){default:(g=p[0])[l||g.length]=+c,l=void 0;break;case 34:if(-1!==(c=c.substring(1,c.length-1)).indexOf("\\")&&(c=c.replace(t,r)),g=p[0],!l){if(!(g instanceof Array)){l=c||i;break}l=g.length}g[l]=c,l=void 0;break;case 91:g=p[0],p.unshift(g[l||g.length]=[]),l=void 0;break;case 93:p.shift();break;case 102:(g=p[0])[l||g.length]=!1,l=void 0;break;case 110:(g=p[0])[l||g.length]=null,l=void 0;break;case 116:(g=p[0])[l||g.length]=!0,l=void 0;break;case 123:g=p[0],p.unshift(g[l||g.length]={}),l=void 0;break;case 125:p.shift()}}if(h){if(1!==p.length)throw new Error;a=a[0]}else if(p.length)throw new Error;if(s){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 a=m(n,i);void 0!==a?n[i]=a:(r||(r=[]),r.push(i))}if(r)for(var l=r.length;--l>=0;)delete n[r[l]]}return s.call(e,t,n)};a=m({"":a},"")}return a}}();void 0!==se&&se||(se={}),void 0!==se.asn1&&se.asn1||(se.asn1={}),se.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){return Ge(e)},this.getPEMStringFromHex=function(e,t){return Ce(e,t)},this.newObject=function(e){var t=se.asn1,n=t.ASN1Object,r=t.DERBoolean,i=t.DERInteger,o=t.DERBitString,s=t.DEROctetString,a=t.DERNull,l=t.DERObjectIdentifier,u=t.DEREnumerated,c=t.DERUTF8String,h=t.DERNumericString,p=t.DERPrintableString,d=t.DERTeletexString,f=t.DERIA5String,g=t.DERUTCTime,m=t.DERGeneralizedTime,v=t.DERVisibleString,y=t.DERBMPString,b=t.DERSequence,$=t.DERSet,w=t.DERTaggedObject,x=t.ASN1Util.newObject;if(e instanceof t.ASN1Object)return e;var S=Object.keys(e);if(1!=S.length)throw new Error("key of param shall be only one.");var E=S[0];if(-1==":asn1:bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:visstr:bmpstr:seq:set:tag:".indexOf(":"+E+":"))throw new Error("undefined key: "+E);if("bool"==E)return new r(e[E]);if("int"==E)return new i(e[E]);if("bitstr"==E)return new o(e[E]);if("octstr"==E)return new s(e[E]);if("null"==E)return new a(e[E]);if("oid"==E)return new l(e[E]);if("enum"==E)return new u(e[E]);if("utf8str"==E)return new c(e[E]);if("numstr"==E)return new h(e[E]);if("prnstr"==E)return new p(e[E]);if("telstr"==E)return new d(e[E]);if("ia5str"==E)return new f(e[E]);if("utctime"==E)return new g(e[E]);if("gentime"==E)return new m(e[E]);if("visstr"==E)return new v(e[E]);if("bmpstr"==E)return new y(e[E]);if("asn1"==E)return new n(e[E]);if("seq"==E){for(var A=e[E],C=[],T=0;T<A.length;T++){var F=x(A[T]);C.push(F)}return new b({array:C})}if("set"==E){for(A=e[E],C=[],T=0;T<A.length;T++){F=x(A[T]);C.push(F)}return new $({array:C})}if("tag"==E){var k=e[E];if("[object Array]"===Object.prototype.toString.call(k)&&3==k.length){var D=x(k[2]);return new w({tag:k[0],explicit:k[1],obj:D})}return new w(k)}},this.jsonToASN1HEX=function(e){return this.newObject(e).tohex()}},se.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 w(r,2).toString(10),r=""}return t},se.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 w(e,10).toString(2),i=7-r.length%7;7==i&&(i=0);for(var o="",s=0;s<i;s++)o+="0";r=o+r;for(s=0;s<r.length-1;s+=7){var a=r.substr(s,7);s!=r.length-7&&(a="1"+a),n+=t(parseInt(a,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 s=0;s<i.length;s++)r+=n(i[s]);return r},se.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)},se.asn1.DERAbstractString=function(e){se.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=ye(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(se.asn1.DERAbstractString,se.asn1.ASN1Object),se.asn1.DERAbstractTime=function(e){se.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 s=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 a=i.getMilliseconds();if(0!=a){var l=r(String(a),3);s=s+"."+(l=l.replace(/[0]+$/,""))}}return s+"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 s=new Date(Date.UTC(e,t-1,n,r,i,o,0));this.setByDate(s)},this.getFreshValueHex=function(){return this.hV}},et(se.asn1.DERAbstractTime,se.asn1.ASN1Object),se.asn1.DERAbstractStructured=function(e){se.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(se.asn1.DERAbstractStructured,se.asn1.ASN1Object),se.asn1.DERBoolean=function(e){se.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV=0==e?"010100":"0101ff"},et(se.asn1.DERBoolean,se.asn1.ASN1Object),se.asn1.DERInteger=function(e){se.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.params=null;var t=Ge;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 w(String(e),10);else if(null!=e.int)n=new w(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(se.asn1.DERInteger,se.asn1.ASN1Object),se.asn1.DERBitString=function(e){if(void 0!==e&&void 0!==e.obj){var t=se.asn1.ASN1Util.newObject(e.obj);e.hex="00"+t.tohex()}se.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(se.asn1.DERBitString,se.asn1.ASN1Object),se.asn1.DEROctetString=function(e){if(void 0!==e&&void 0!==e.obj){var t=se.asn1.ASN1Util.newObject(e.obj);e.hex=t.tohex()}se.asn1.DEROctetString.superclass.constructor.call(this,e),this.hT="04"},et(se.asn1.DEROctetString,se.asn1.DERAbstractString),se.asn1.DERNull=function(){se.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},et(se.asn1.DERNull,se.asn1.ASN1Object),se.asn1.DERObjectIdentifier=function(e){se.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=qe(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=se.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(se.asn1.DERObjectIdentifier,se.asn1.ASN1Object),se.asn1.DEREnumerated=function(e){se.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=Ge(e)},this.setByInteger=function(e){var t=new w(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(se.asn1.DEREnumerated,se.asn1.ASN1Object),se.asn1.DERUTF8String=function(e){se.asn1.DERUTF8String.superclass.constructor.call(this,e),this.hT="0c"},et(se.asn1.DERUTF8String,se.asn1.DERAbstractString),se.asn1.DERNumericString=function(e){se.asn1.DERNumericString.superclass.constructor.call(this,e),this.hT="12"},et(se.asn1.DERNumericString,se.asn1.DERAbstractString),se.asn1.DERPrintableString=function(e){se.asn1.DERPrintableString.superclass.constructor.call(this,e),this.hT="13"},et(se.asn1.DERPrintableString,se.asn1.DERAbstractString),se.asn1.DERTeletexString=function(e){se.asn1.DERTeletexString.superclass.constructor.call(this,e),this.hT="14"},et(se.asn1.DERTeletexString,se.asn1.DERAbstractString),se.asn1.DERIA5String=function(e){se.asn1.DERIA5String.superclass.constructor.call(this,e),this.hT="16"},et(se.asn1.DERIA5String,se.asn1.DERAbstractString),se.asn1.DERVisibleString=function(e){se.asn1.DERIA5String.superclass.constructor.call(this,e),this.hT="1a"},et(se.asn1.DERVisibleString,se.asn1.DERAbstractString),se.asn1.DERBMPString=function(e){se.asn1.DERBMPString.superclass.constructor.call(this,e),this.hT="1e"},et(se.asn1.DERBMPString,se.asn1.DERAbstractString),se.asn1.DERUTCTime=function(e){se.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=de(e)}else if(null!=e.str)this.hV=de(e.str);else if(null==e.date&&1==e.millis){var t=new Date;this.hV=de(this.formatDate(t,"utc",!0))}else if(null!=e.date&&e.date instanceof Date){var n=!0===e.millis;this.hV=de(this.formatDate(e.date,"utc",n))}else e instanceof Date&&(this.hV=de(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(se.asn1.DERUTCTime,se.asn1.DERAbstractTime),se.asn1.DERGeneralizedTime=function(e){se.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=de(e)}else if(null!=e.str)this.hV=de(e.str);else if(null==e.date&&1==e.millis){var t=new Date;this.hV=de(this.formatDate(t,"gen",!0))}else if(null!=e.date&&e.date instanceof Date){var n=!0===e.millis;this.hV=de(this.formatDate(e.date,"gen",n))}else e instanceof Date&&(this.hV=de(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(se.asn1.DERGeneralizedTime,se.asn1.DERAbstractTime),se.asn1.DERSequence=function(e){se.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(se.asn1.DERSequence,se.asn1.DERAbstractStructured),se.asn1.DERSet=function(e){se.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(se.asn1.DERSet,se.asn1.DERAbstractStructured),se.asn1.DERTaggedObject=function(e){se.asn1.DERTaggedObject.superclass.constructor.call(this);var t=se.asn1,n=ue,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=ye(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(se.asn1.DERTaggedObject,se.asn1.ASN1Object);var se,ae,le,ue=new function(){};function ce(e){for(var t=new Array,n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}function he(e){for(var t="",n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t}function pe(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 de(e){return pe(ce(e))}function fe(e){return e=(e=(e=e.replace(/\=/g,"")).replace(/\+/g,"-")).replace(/\//g,"_")}function ge(e){return e.length%4==2?e+="==":e.length%4==3&&(e+="="),e=(e=e.replace(/-/g,"+")).replace(/_/g,"/")}function me(e){return e.length%2==1&&(e="0"+e),fe(y(e))}function ve(e){return b(ge(e))}function ye(e){return Re(Be(e)).toLowerCase()}function be(e){try{return decodeURIComponent(Ie(e))}catch(e){return null}}function $e(e){return be(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 we(e){for(var t="",n=0;n<e.length-1;n+=2)t+=String.fromCharCode(parseInt(e.substr(n,2),16));return t}function xe(e){for(var t="",n=0;n<e.length;n++)t+=("0"+e.charCodeAt(n).toString(16)).slice(-2);return t}function Se(e){return y(e)}function Ee(e,t){return e=(e=e.replace(new RegExp("(.{"+t+"})","g"),"$1\r\n")).replace(/\s+$/,"")}function Ae(e){return b(e.replace(/[^0-9A-Za-z\/+=]*/g,""))}function Ce(e,t){return"-----BEGIN "+t+"-----\r\n"+Ee(Se(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 Ae(e=void 0!==t?(e=e.replace(new RegExp("^[^]*-----BEGIN "+t+"-----"),"")).replace(new RegExp("-----END "+t+"-----[^]*$"),""):(e=e.replace(/^[^]*-----BEGIN [^-]+-----/,"")).replace(/-----END [^-]+-----[^]*$/,""))}function Fe(e){var t,n,r,i,o,s,a,l,u,c;if(c=(e=De(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]),s=parseInt(c[6]),a=0,""!==(l=c[7])&&(u=(l.substr(1)+"00").substr(0,3),a=parseInt(u)),Date.UTC(t,n,r,i,o,s,a);throw new Error("unsupported zulu format: "+e)}function ke(e){return Math.round(Fe(e)/1e3)}function De(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 Re(e){return e.replace(/%/g,"")}function Ie(e){return e.replace(/(..)/g,"%$1")}function Pe(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 Oe(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 _e(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 Oe(e);if(64==e.length){try{return Oe(e.substr(0,32))+"/"+je(e.substr(32))}catch(e){throw t}return}return e}try{return _e(e.substr(0,8))+"/"+je(e.substr(8))}catch(e){throw t}}}function je(e){var t,n=new Error("malformed mask");try{t=new w(e,16).toString(2)}catch(e){throw n}if(!t.match(/^1*0*$/))throw n;return t.replace(/0+$/,"").length}function Le(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 Le((n=e.split("/"))[0])+Ne(parseInt(n[1]),32);if(e.match(/^[0-9a-f:]+$/)&&-1!==e.indexOf(":"))return Pe(e);if(e.match(/^[0-9a-f:]+\/[0-9]+$/)&&-1!==e.indexOf(":"))return Pe((n=e.split("/"))[0])+Ne(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 Ne(e,t){return 32==t&&0==e?"00000000":128==t&&0==e?"00000000000000000000000000000000":new w(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 be((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 be((224|(240&t)>>4).toString(16)+r.toString(16)+i.toString(16))})).join("")}function Be(e){for(var t=encodeURIComponent(e),n="",r=0;r<t.length;r++)"%"==t[r]?(n+=t.substr(r,3),r+=2):n=n+"%"+de(t[r]);return n}function He(e){return!(e.length%2!=0||!e.match(/^[0-9a-f]+$/)&&!e.match(/^[0-9A-F]+$/))}function Ue(e){return!!e.match(/^[0-9A-Za-z-_.]+$/)}function Ve(e){return e.length%2==1?"0"+e:e.substr(0,1)>"7"?"00"+e:e}ue.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},ue.getL=function(e,t){var n=ue.getLblen(e,t);return n<1?"":e.substr(t+2,2*n)},ue.getVblen=function(e,t){var n;return""==(n=ue.getL(e,t))?-1:("8"===n.substr(0,1)?new w(n.substr(2),16):new w(n,16)).intValue()},ue.getVidx=function(e,t){var n=ue.getLblen(e,t);return n<0?n:t+2*(n+1)},ue.getV=function(e,t){var n=ue.getVidx(e,t),r=ue.getVblen(e,t);return e.substr(n,2*r)},ue.getTLV=function(e,t){return e.substr(t,2)+ue.getL(e,t)+ue.getV(e,t)},ue.getTLVblen=function(e,t){return 2+2*ue.getLblen(e,t)+2*ue.getVblen(e,t)},ue.getNextSiblingIdx=function(e,t){return ue.getVidx(e,t)+2*ue.getVblen(e,t)},ue.getChildIdx=function(e,t){var n,r,i,o=ue,s=[];n=o.getVidx(e,t),r=2*o.getVblen(e,t),"03"==e.substr(t,2)&&(n+=2,r-=2),i=0;for(var a=n;i<=r;){var l=o.getTLVblen(e,a);if((i+=l)<=r&&s.push(a),a+=l,i>=r)break}return s},ue.getNthChildIdx=function(e,t,n){return ue.getChildIdx(e,t)[n]},ue.getIdxbyList=function(e,t,n,r){var i,o,s=ue;return 0==n.length?void 0!==r&&e.substr(t,2)!==r?-1:t:(i=n.shift())>=(o=s.getChildIdx(e,t)).length?-1:s.getIdxbyList(e,o[i],n,r)},ue.getIdxbyListEx=function(e,t,n,r){var i,o,s=ue;if(0==n.length)return void 0!==r&&e.substr(t,2)!==r?-1:t;i=n.shift(),o=s.getChildIdx(e,t);for(var a=0,l=0;l<o.length;l++){var u=e.substr(o[l],2);if("number"==typeof i&&!s.isContextTag(u)&&a==i||"string"==typeof i&&s.isContextTag(u,i))return s.getIdxbyListEx(e,o[l],n,r);s.isContextTag(u)||a++}return-1},ue.getTLVbyList=function(e,t,n,r){var i=ue,o=i.getIdxbyList(e,t,n,r);return-1==o||o>=e.length?null:i.getTLV(e,o)},ue.getTLVbyListEx=function(e,t,n,r){var i=ue,o=i.getIdxbyListEx(e,t,n,r);return-1==o?null:i.getTLV(e,o)},ue.getVbyList=function(e,t,n,r,i){var o,s,a=ue;return-1==(o=a.getIdxbyList(e,t,n,r))||o>=e.length?null:(s=a.getV(e,o),!0===i&&(s=s.substr(2)),s)},ue.getVbyListEx=function(e,t,n,r,i){var o,s,a=ue;return-1==(o=a.getIdxbyListEx(e,t,n,r))?null:(s=a.getV(e,o),"03"==e.substr(o,2)&&!1!==i&&(s=s.substr(2)),s)},ue.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=ue.getV(e,t);return"02"==r?parseInt(i,16):Ye(i)}catch(e){return n}},ue.getOID=function(e,t,n){null==n&&(n=null);try{return"06"!=e.substr(t,2)?n:ze(ue.getV(e,t))}catch(e){return n}},ue.getOIDName=function(e,t,n){null==n&&(n=null);try{var r=ue.getOID(e,t,n);if(r==n)return n;var i=se.asn1.x509.OID.oid2name(r);return""==i?r:i}catch(e){return n}},ue.getString=function(e,t,n){null==n&&(n=null);try{return we(ue.getV(e,t))}catch(e){return n}},ue.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),s=[],a=0;a<o.length/2;a++)s.push(parseInt(o.substr(2*a,2),16));var l=[],u="";for(a=0;a<s.length;a++)128&s[a]?u+=t((127&s[a]).toString(2),7):(u+=t((127&s[a]).toString(2),7),l.push(new String(parseInt(u,2))),u="");var c=n.join(".");return l.length>0&&(c=c+"."+l.join(".")),c},ue.dump=function(e,t,n,r){var i=ue,o=i.getV,s=i.dump,a=i.getChildIdx,l=e;e instanceof se.asn1.ASN1Object&&(l=e.tohex());var u=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,h=t.ommit_long_octet;if("01"==(c=l.substr(n,2)))return"00"==(p=o(l,n))?r+"BOOLEAN FALSE\n":r+"BOOLEAN TRUE\n";if("02"==c)return r+"INTEGER "+u(p=o(l,n),h)+"\n";if("03"==c){var p=o(l,n);if(i.isASN1HEX(p.substr(2))){var d=r+"BITSTRING, encapsulates\n";return d+=s(p.substr(2),t,0,r+" ")}return r+"BITSTRING "+u(p,h)+"\n"}if("04"==c){p=o(l,n);if(i.isASN1HEX(p)){d=r+"OCTETSTRING, encapsulates\n";return d+=s(p,t,0,r+" ")}return r+"OCTETSTRING "+u(p,h)+"\n"}if("05"==c)return r+"NULL\n";if("06"==c){var f=o(l,n),g=se.asn1.ASN1Util.oidHexToInt(f),m=se.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(l,n))+"\n";if("0c"==c)return r+"UTF8String '"+be(o(l,n))+"'\n";if("13"==c)return r+"PrintableString '"+be(o(l,n))+"'\n";if("14"==c)return r+"TeletexString '"+be(o(l,n))+"'\n";if("16"==c)return r+"IA5String '"+be(o(l,n))+"'\n";if("17"==c)return r+"UTCTime "+be(o(l,n))+"\n";if("18"==c)return r+"GeneralizedTime "+be(o(l,n))+"\n";if("1a"==c)return r+"VisualString '"+be(o(l,n))+"'\n";if("1e"==c)return r+"BMPString '"+Me(o(l,n))+"'\n";if("30"==c){if("3000"==l.substr(n,4))return r+"SEQUENCE {}\n";d=r+"SEQUENCE\n";var y=t;if((2==(w=a(l,n)).length||3==w.length)&&"06"==l.substr(w[0],2)&&"04"==l.substr(w[w.length-1],2)){m=i.oidname(o(l,w[0]));var b=JSON.parse(JSON.stringify(t));b.x509ExtName=m,y=b}for(var $=0;$<w.length;$++)d+=s(l,y,w[$],r+" ");return d}if("31"==c){d=r+"SET\n";var w=a(l,n);for($=0;$<w.length;$++)d+=s(l,t,w[$],r+" ");return d}if(0!=(128&(c=parseInt(c,16)))){var x=31&c;if(0!=(32&c)){for(d=r+"["+x+"]\n",w=a(l,n),$=0;$<w.length;$++)d+=s(l,t,w[$],r+" ");return d}p=o(l,n);if(ue.isASN1HEX(p)){var d=r+"["+x+"]\n";return d+=s(p,t,0,r+" ")}return("68747470"==p.substr(0,8)||"subjectAltName"===t.x509ExtName&&2==x)&&(p=be(p)),d=r+"["+x+"] "+p+"\n"}return r+"UNKNOWN("+c+") "+o(l,n)+"\n"},ue.parse=function(e){var t=ue,n=t.parse,r=t.isASN1HEX,i=t.getV,o=t.getTLV,s=t.getChildIdx,a=se.asn1,l=a.ASN1Util.oidHexToInt,u=a.x509.OID.oid2name,c=be,h=Me,p=$e,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=Xe(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=l(m),$=u(b);return""==$?{oid:b}:{oid:$}}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=s(e,0),i=0;i<r.length;i++){var a=r[i],l=o(e,a),u=n(l);t.push(u)}return t}(e),g;if("14"==f){var w=p(m);return g[d[f]]={str:w},g}if("1e"==f){w=h(m);return g[d[f]]={str:w},g}if(-1!=":0c:12:13:16:17:18:1a:".indexOf(f)){w=c(m);return g[d[f]]={str:w},g}if(f.match(/^8[0-9]$/))return null==(w=c(m))|""==w||null!=w.match(/[\x00-\x1F\x7F-\x9F]/)||null!=w.match(/[\u0000-\u001F\u0080–\u009F]/)?{tag:{tag:f,explicit:!1,hex:m}}:{tag:{tag:f,explicit:!1,str:w}};if(!f.match(/^a[0-9]$/)){var x=new se.asn1.ASN1Object;return x.hV=m,{asn1:{tlv:f+x.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}}}}},ue.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}},ue.isASN1HEX=function(e){var t=ue;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},ue.checkStrictDER=function(e,t,n,r,i){var o=ue;if(void 0===n){if("string"!=typeof e)throw new Error("not hex string");if(e=e.toLowerCase(),!se.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 s=o.getVblen(e,t);if(s>r)throw new Error("value of L too long than hex: idx="+t);var a=o.getTLV(e,t),l=a.length-2-o.getL(e,t).length;if(l!==2*s)throw new Error("V string length and L's value not the same:"+l+"/"+2*s);if(0===t&&e.length!=a.length)throw new Error("total length and TLV length unmatch:"+e.length+"!="+a.length);var u=e.substr(t,2);if("02"===u){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(u,16)){for(var h=o.getVblen(e,t),p=0,d=o.getChildIdx(e,t),f=0;f<d.length;f++){p+=o.getTLV(e,d[f]).length,o.checkStrictDER(e,d[f],n,r,i)}if(2*h!=p)throw new Error("sum of children's TLV length and L unmatch: "+2*h+"!="+p)}},ue.oidname=function(e){var t=se.asn1;se.lang.String.isHex(e)&&(e=t.ASN1Util.oidHexToInt(e));var n=t.x509.OID.oid2name(e);return""===n&&(n=e),n},void 0!==se&&se||(se={}),void 0!==se.asn1&&se.asn1||(se.asn1={}),void 0!==se.asn1.x509&&se.asn1.x509||(se.asn1.x509={}),se.asn1.x509.Certificate=function(e){se.asn1.x509.Certificate.superclass.constructor.call(this);var t=se.asn1,n=t.DERBitString,r=t.DERSequence,i=t.x509,o=i.TBSCertificate,s=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 se.crypto.Signature({alg:t});r.init(e.cakey),r.updateHex(n),e.sighex=r.sign()},this.getPEM=function(){return Ce(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 s({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(se.asn1.x509.Certificate,se.asn1.ASN1Object),se.asn1.x509.TBSCertificate=function(e){se.asn1.x509.TBSCertificate.superclass.constructor.call(this);var t=se.asn1,n=t.x509,r=t.DERTaggedObject,i=t.DERInteger,o=t.DERSequence,s=n.AlgorithmIdentifier,a=n.Time,l=n.X500Name,u=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 h=new r({obj:new i({int:n})});e.push(h)}return e.push(new i(t.serial)),e.push(new s({name:t.sigalg})),e.push(new l(t.issuer)),e.push(new o({array:[new a(t.notbefore),new a(t.notafter)]})),e.push(new l(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 u(t.ext)})),new se.asn1.DERSequence({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},et(se.asn1.x509.TBSCertificate,se.asn1.ASN1Object),se.asn1.x509.Extensions=function(e){se.asn1.x509.Extensions.superclass.constructor.call(this);var t=se.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,s=null;if(null!=i.extn)s=new r.PrivateExtension(i);else if("subjectKeyIdentifier"==o)s=new r.SubjectKeyIdentifier(i);else if("keyUsage"==o)s=new r.KeyUsage(i);else if("subjectAltName"==o)s=new r.SubjectAltName(i);else if("issuerAltName"==o)s=new r.IssuerAltName(i);else if("basicConstraints"==o)s=new r.BasicConstraints(i);else if("nameConstraints"==o)s=new r.NameConstraints(i);else if("cRLDistributionPoints"==o)s=new r.CRLDistributionPoints(i);else if("certificatePolicies"==o)s=new r.CertificatePolicies(i);else if("policyMappings"==o)s=new r.PolicyMappings(i);else if("policyConstraints"==o)s=new r.PolicyConstraints(i);else if("inhibitAnyPolicy"==o)s=new r.InhibitAnyPolicy(i);else if("authorityKeyIdentifier"==o)s=new r.AuthorityKeyIdentifier(i);else if("extKeyUsage"==o)s=new r.ExtKeyUsage(i);else if("authorityInfoAccess"==o)s=new r.AuthorityInfoAccess(i);else if("cRLNumber"==o)s=new r.CRLNumber(i);else if("cRLReason"==o)s=new r.CRLReason(i);else if("ocspNonce"==o)s=new r.OCSPNonce(i);else if("ocspNoCheck"==o)s=new r.OCSPNoCheck(i);else if("adobeTimeStamp"==o)s=new r.AdobeTimeStamp(i);else{if("subjectDirectoryAttributes"!=o)throw new Error("extension not supported:"+JSON.stringify(i));s=new r.SubjectDirectoryAttributes(i)}null!=s&&e.push(s)}return new n({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(se.asn1.x509.Extensions,se.asn1.ASN1Object),se.asn1.x509.Extension=function(e){se.asn1.x509.Extension.superclass.constructor.call(this);var t=se.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()}),s=new Array;return s.push(e),this.critical&&s.push(new i),s.push(t),new o({array:s}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.critical=!1,void 0!==e&&void 0!==e.critical&&(this.critical=e.critical)},et(se.asn1.x509.Extension,se.asn1.ASN1Object),se.asn1.x509.KeyUsage=function(e){se.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 se.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 Qe(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(se.asn1.x509.KeyUsage,se.asn1.x509.Extension),se.asn1.x509.BasicConstraints=function(e){se.asn1.x509.BasicConstraints.superclass.constructor.call(this,e);var t=se.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(se.asn1.x509.BasicConstraints,se.asn1.x509.Extension),se.asn1.x509.CRLDistributionPoints=function(e){se.asn1.x509.CRLDistributionPoints.superclass.constructor.call(this,e);var t=se.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 se.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(se.asn1.x509.CRLDistributionPoints,se.asn1.x509.Extension),se.asn1.x509.DistributionPoint=function(e){se.asn1.x509.DistributionPoint.superclass.constructor.call(this);var t=se.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(se.asn1.x509.DistributionPoint,se.asn1.ASN1Object),se.asn1.x509.DistributionPointName=function(e){se.asn1.x509.DistributionPointName.superclass.constructor.call(this);var t=se.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(se.asn1.x509.DistributionPointName,se.asn1.ASN1Object),se.asn1.x509.CertificatePolicies=function(e){se.asn1.x509.CertificatePolicies.superclass.constructor.call(this,e);var t=se.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(se.asn1.x509.CertificatePolicies,se.asn1.x509.Extension),se.asn1.x509.PolicyInformation=function(e){se.asn1.x509.PolicyInformation.superclass.constructor.call(this,e);var t=se.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(se.asn1.x509.PolicyInformation,se.asn1.ASN1Object),se.asn1.x509.PolicyQualifierInfo=function(e){se.asn1.x509.PolicyQualifierInfo.superclass.constructor.call(this,e);var t=se.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(se.asn1.x509.PolicyQualifierInfo,se.asn1.ASN1Object),se.asn1.x509.UserNotice=function(e){se.asn1.x509.UserNotice.superclass.constructor.call(this,e);var t=se.asn1.DERSequence,n=(se.asn1.DERInteger,se.asn1.x509.DisplayText),r=se.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(se.asn1.x509.UserNotice,se.asn1.ASN1Object),se.asn1.x509.NoticeReference=function(e){se.asn1.x509.NoticeReference.superclass.constructor.call(this,e);var t=se.asn1.DERSequence,n=se.asn1.DERInteger,r=se.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,s=0;s<o.length;s++)i.push(new n(o[s]));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(se.asn1.x509.NoticeReference,se.asn1.ASN1Object),se.asn1.x509.DisplayText=function(e){se.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(se.asn1.x509.DisplayText,se.asn1.DERAbstractString),se.asn1.x509.PolicyMappings=function(e){se.asn1.x509.PolicyMappings.superclass.constructor.call(this,e);var t=se.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(se.asn1.x509.PolicyMappings,se.asn1.x509.Extension),se.asn1.x509.PolicyConstraints=function(e){se.asn1.x509.PolicyConstraints.superclass.constructor.call(this,e);var t=se.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(se.asn1.x509.PolicyConstraints,se.asn1.x509.Extension),se.asn1.x509.InhibitAnyPolicy=function(e){se.asn1.x509.InhibitAnyPolicy.superclass.constructor.call(this,e);var t=se.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(se.asn1.x509.InhibitAnyPolicy,se.asn1.x509.Extension),se.asn1.x509.NameConstraints=function(e){se.asn1.x509.NameConstraints.superclass.constructor.call(this,e);var t=se.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 s=[];for(o=0;o<e.exclude.length;o++)s.push(new i(e.exclude[o]));t.push({tag:{tagi:"a1",obj:{seq:s}}})}return this.asn1ExtnValue=r({seq:t}),this.asn1ExtnValue.tohex()},this.oid="2.5.29.30",void 0!==e&&(this.params=e)},et(se.asn1.x509.NameConstraints,se.asn1.x509.Extension),se.asn1.x509.GeneralSubtree=function(e){se.asn1.x509.GeneralSubtree.superclass.constructor.call(this);var t=se.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(se.asn1.x509.GeneralSubtree,se.asn1.ASN1Object),se.asn1.x509.ExtKeyUsage=function(e){se.asn1.x509.ExtKeyUsage.superclass.constructor.call(this,e);var t=se.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(se.asn1.x509.ExtKeyUsage,se.asn1.x509.Extension),se.asn1.x509.AuthorityKeyIdentifier=function(e){se.asn1.x509.AuthorityKeyIdentifier.superclass.constructor.call(this,e);var t=se,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 se.asn1.DEROctetString(e);else if("object"==typeof e&&se.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 se.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 se.asn1.x509.X500Name(e):"string"==typeof e&&-1!=e.indexOf("BEGIN ")&&-1!=e.indexOf("CERTIFICATE")&&(this.asn1CertIssuer=new se.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 se.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 se.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(se.asn1.x509.AuthorityKeyIdentifier,se.asn1.x509.Extension),se.asn1.x509.SubjectKeyIdentifier=function(e){se.asn1.x509.SubjectKeyIdentifier.superclass.constructor.call(this,e);var t=se.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&&se.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 se.asn1.DEROctetString({hex:r})}},this.oid="2.5.29.14",void 0!==e&&void 0!==e.kid&&this.setKIDByParam(e.kid)},et(se.asn1.x509.SubjectKeyIdentifier,se.asn1.x509.Extension),se.asn1.x509.AuthorityInfoAccess=function(e){se.asn1.x509.AuthorityInfoAccess.superclass.constructor.call(this,e),this.setAccessDescriptionArray=function(e){for(var t=new Array,n=se.asn1,r=n.DERSequence,i=n.DERObjectIdentifier,o=n.x509.GeneralName,s=0;s<e.length;s++){var a,l=e[s];if(void 0!==l.ocsp)a=new r({array:[new i({oid:"1.3.6.1.5.5.7.48.1"}),new o({uri:l.ocsp})]});else{if(void 0===l.caissuer)throw new Error("unknown AccessMethod parameter: "+JSON.stringify(l));a=new r({array:[new i({oid:"1.3.6.1.5.5.7.48.2"}),new o({uri:l.caissuer})]})}t.push(a)}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(se.asn1.x509.AuthorityInfoAccess,se.asn1.x509.Extension),se.asn1.x509.SubjectAltName=function(e){se.asn1.x509.SubjectAltName.superclass.constructor.call(this,e),this.setNameArray=function(e){this.asn1ExtnValue=new se.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(se.asn1.x509.SubjectAltName,se.asn1.x509.Extension),se.asn1.x509.IssuerAltName=function(e){se.asn1.x509.IssuerAltName.superclass.constructor.call(this,e),this.setNameArray=function(e){this.asn1ExtnValue=new se.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(se.asn1.x509.IssuerAltName,se.asn1.x509.Extension),se.asn1.x509.SubjectDirectoryAttributes=function(e){se.asn1.x509.SubjectDirectoryAttributes.superclass.constructor.call(this,e);var t=se.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 s={seq:[{oid:"1.2.3.4"},{set:[{utf8str:"DE"}]}]};if("dateOfBirth"==o.attr)s.seq[0].oid=i(o.attr),s.seq[1].set[0]={gentime:o.str};else if("placeOfBirth"==o.attr)s.seq[0].oid=i(o.attr),s.seq[1].set[0]={utf8str:o.str};else if("gender"==o.attr)s.seq[0].oid=i(o.attr),s.seq[1].set[0]={prnstr:o.str};else if("countryOfCitizenship"==o.attr)s.seq[0].oid=i(o.attr),s.seq[1].set[0]={prnstr:o.str};else{if("countryOfResidence"!=o.attr)throw new Error("unsupported attribute: "+o.attr);s.seq[0].oid=i(o.attr),s.seq[1].set[0]={prnstr:o.str}}e.push(new r(s))}else{var a={seq:[{oid:o.attr},{set:o.array}]};e.push(r(a))}}var l=new n({array:e});return this.asn1ExtnValue=l,this.asn1ExtnValue.tohex()},this.oid="2.5.29.9",void 0!==e&&(this.params=e)},et(se.asn1.x509.SubjectDirectoryAttributes,se.asn1.x509.Extension),se.asn1.x509.PrivateExtension=function(e){se.asn1.x509.PrivateExtension.superclass.constructor.call(this,e);var t=se,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(se.asn1.x509.PrivateExtension,se.asn1.x509.Extension),se.asn1.x509.CRL=function(e){se.asn1.x509.CRL.superclass.constructor.call(this);var t=se.asn1,n=t.DERSequence,r=t.DERBitString,i=t.x509,o=i.AlgorithmIdentifier,s=i.TBSCertList;this.params=void 0,this.setByParam=function(e){this.params=e},this.sign=function(){var e=new s(this.params).tohex(),t=new se.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 Ce(this.tohex(),"X509 CRL")},this.tohex=function(){var e=this.params;if(null==e.tbsobj&&(e.tbsobj=new s(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(se.asn1.x509.CRL,se.asn1.ASN1Object),se.asn1.x509.TBSCertList=function(e){se.asn1.x509.TBSCertList.superclass.constructor.call(this);var t=se.asn1,n=t.DERInteger,r=t.DERSequence,i=t.DERTaggedObject,o=(t.DERObjectIdentifier,t.x509),s=o.AlgorithmIdentifier,a=o.Time,l=o.Extensions,u=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 a(t[i].date)];null!=t[i].ext&&o.push(new l(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 s({name:t.sigalg})),e.push(new u(t.issuer)),e.push(new a(t.thisupdate)),null!=t.nextupdate&&e.push(new a(t.nextupdate)),null!=t.revcert&&e.push(this.getRevCertSequence()),null!=t.ext){var h=new l(t.ext);e.push(new i({tag:"a0",explicit:!0,obj:h}))}return new r({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},et(se.asn1.x509.TBSCertList,se.asn1.ASN1Object),se.asn1.x509.CRLEntry=function(e){se.asn1.x509.CRLEntry.superclass.constructor.call(this);var t=se.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(se.asn1.x509.CRLEntry,se.asn1.ASN1Object),se.asn1.x509.CRLNumber=function(e){se.asn1.x509.CRLNumber.superclass.constructor.call(this,e),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new se.asn1.DERInteger(this.params.num),this.asn1ExtnValue.tohex()},this.oid="2.5.29.20",null!=e&&(this.params=e)},et(se.asn1.x509.CRLNumber,se.asn1.x509.Extension),se.asn1.x509.CRLReason=function(e){se.asn1.x509.CRLReason.superclass.constructor.call(this,e),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new se.asn1.DEREnumerated(this.params.code),this.asn1ExtnValue.tohex()},this.oid="2.5.29.21",null!=e&&(this.params=e)},et(se.asn1.x509.CRLReason,se.asn1.x509.Extension),se.asn1.x509.OCSPNonce=function(e){se.asn1.x509.OCSPNonce.superclass.constructor.call(this,e),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new se.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(se.asn1.x509.OCSPNonce,se.asn1.x509.Extension),se.asn1.x509.OCSPNoCheck=function(e){se.asn1.x509.OCSPNoCheck.superclass.constructor.call(this,e),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new se.asn1.DERNull,this.asn1ExtnValue.tohex()},this.oid="1.3.6.1.5.5.7.48.1.5",null!=e&&(this.params=e)},et(se.asn1.x509.OCSPNoCheck,se.asn1.x509.Extension),se.asn1.x509.AdobeTimeStamp=function(e){se.asn1.x509.AdobeTimeStamp.superclass.constructor.call(this,e);var t=se.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(se.asn1.x509.AdobeTimeStamp,se.asn1.x509.Extension),se.asn1.x509.X500Name=function(e){se.asn1.x509.X500Name.superclass.constructor.call(this),this.asn1Array=[],this.paramArray=[],this.sRule="utf8";var t=se.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 s=i.length-1;i[s]=i[s]+"/"+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(se.asn1.x509.X500Name,se.asn1.ASN1Object),se.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(",")},se.asn1.x509.X500Name.onelineToLDAP=function(e){return se.asn1.x509.X500Name.compatToLDAP(e)},se.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 s=(r.pop()+","+o).replace(/\\,/g,",");r.push(s),n=!1}else r.push(o);"\\"===o.substr(-1,1)&&(n=!0)}return(r=r.map((function(e){return e.replace("/","\\/")}))).reverse(),"/"+r.join("/")},se.asn1.x509.X500Name.ldapToOneline=function(e){return se.asn1.x509.X500Name.ldapToCompat(e)},se.asn1.x509.RDN=function(e){se.asn1.x509.RDN.superclass.constructor.call(this),this.asn1Array=[],this.paramArray=[],this.sRule="utf8";var t=se.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 se.asn1.x509.AttributeTypeAndValue({str:e,rule:this.sRule}))},this.addByMultiValuedString=function(e){for(var t=se.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 se.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(se.asn1.x509.RDN,se.asn1.ASN1Object),se.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 s=(r.pop()+"+"+o).replace(/\\\+/g,"+");r.push(s),n=!1}else r.push(o);"\\"===o.substr(-1,1)&&(n=!0)}var a=!1,l=[];for(i=0;r.length>0;i++){o=r.shift();if(!0===a){var u=l.pop();if(o.match(/"$/)){s=(u+"+"+o).replace(/^([^=]+)="(.*)"$/,"$1=$2");l.push(s),a=!1}else l.push(u+"+"+o)}else l.push(o);o.match(/^[^=]+="/)&&(a=!0)}return l},se.asn1.x509.AttributeTypeAndValue=function(e){se.asn1.x509.AttributeTypeAndValue.superclass.constructor.call(this),this.sRule="utf8",this.sType=null,this.sValue=null,this.dsType=null;var t=se,n=t.asn1,r=n.DERSequence,i=n.DERUTF8String,o=n.DERPrintableString,s=n.DERTeletexString,a=n.DERIA5String,l=n.DERVisibleString,u=n.DERBMPString,c=t.lang.String.isMail,h=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":h(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 s({str:t});if("ia5"==e)return new a({str:t});if("vis"==e)return new l({str:t});if("bmp"==e)return new u({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=se.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(se.asn1.x509.AttributeTypeAndValue,se.asn1.ASN1Object),se.asn1.x509.SubjectPublicKeyInfo=function(e){se.asn1.x509.SubjectPublicKeyInfo.superclass.constructor.call(this);var t=se,n=t.asn1,r=n.DERInteger,i=n.DERBitString,o=n.DERObjectIdentifier,s=n.DERSequence,a=n.ASN1Util.newObject,l=n.x509.AlgorithmIdentifier,u=t.crypto;u.ECDSA,u.DSA;this.getASN1Object=function(){if(null==this.asn1AlgId||null==this.asn1SubjPKey)throw"algId and/or subjPubKey not set";return new s({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 te){var t=a({seq:[{int:{bigint:e.n}},{int:{int:e.e}}]}).tohex();this.asn1AlgId=new l({name:"rsaEncryption"}),this.asn1SubjPKey=new i({hex:"00"+t})}}catch(e){}try{if(e instanceof se.crypto.ECDSA){var n=new o({name:e.curveName});this.asn1AlgId=new l({name:"ecPublicKey",asn1params:n}),this.asn1SubjPKey=new i({hex:"00"+e.pubKeyHex})}}catch(e){}try{if(e instanceof se.crypto.DSA){n=new a({seq:[{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.g}}]});this.asn1AlgId=new l({name:"dsa",asn1params:n});var s=new r({bigint:e.y});this.asn1SubjPKey=new i({hex:"00"+s.tohex()})}}catch(e){}},void 0!==e&&this.setPubKey(e)},et(se.asn1.x509.SubjectPublicKeyInfo,se.asn1.ASN1Object),se.asn1.x509.Time=function(e){se.asn1.x509.Time.superclass.constructor.call(this);var t=se.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)},se.asn1.x509.Time_bak=function(e){se.asn1.x509.Time_bak.superclass.constructor.call(this);var t=se.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(se.asn1.x509.Time,se.asn1.ASN1Object),se.asn1.x509.AlgorithmIdentifier=function(e){se.asn1.x509.AlgorithmIdentifier.superclass.constructor.call(this),this.nameAlg=null,this.asn1Alg=null,this.asn1Params=null,this.paramEmpty=!1;var t=se.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(se.asn1.x509.AlgorithmIdentifier,se.asn1.ASN1Object),se.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV={SHAwithRSAandMGF1:"300d06092a864886f70d01010a3000",SHA256withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040201a11a301806092a864886f70d010108300b0609608648016503040201a203020120",SHA384withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040202a11a301806092a864886f70d010108300b0609608648016503040202a203020130",SHA512withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040203a11a301806092a864886f70d010108300b0609608648016503040203a203020140"},se.asn1.x509.GeneralName=function(e){se.asn1.x509.GeneralName.superclass.constructor.call(this);var t=se.asn1,n=t.x509,r=n.X500Name,i=n.OtherName,o=t.DERIA5String,s=(t.DERPrintableString,t.DEROctetString),a=t.DERTaggedObject,l=t.ASN1Object,u=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 se.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 h,p;e="a4",c=!0;var d=null;if(void 0!==n.certsubj?(h=!1,p=n.certsubj):(h=!0,p=n.certissuer),p.match(/^[0-9A-Fa-f]+$/),-1!=p.indexOf("-----BEGIN ")&&(d=Te(p)),null==d)throw new Error("certsubj/certissuer not cert");var f,g=new ot;g.hex=d,f=h?g.getIssuerHex():g.getSubjectHex(),(t=new l).hTLV=f}else if(void 0!==n.uri)e="86",t=new o({str:n.uri});else{if(void 0===n.ip)throw new u("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=Le(v)}catch(e){throw new u("malformed IP address: "+n.ip+":"+e.message)}t=new s({hex:m})}return new a({tag:e,explicit:c,obj:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},et(se.asn1.x509.GeneralName,se.asn1.ASN1Object),se.asn1.x509.GeneralNames=function(e){se.asn1.x509.GeneralNames.superclass.constructor.call(this);var t=se.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(se.asn1.x509.GeneralNames,se.asn1.ASN1Object),se.asn1.x509.OtherName=function(e){se.asn1.x509.OtherName.superclass.constructor.call(this);var t=se.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(se.asn1.x509.OtherName,se.asn1.ASN1Object),se.asn1.x509.OID=new function(){var e=se.asn1.DERObjectIdentifier;this.name2oidList={"aes128-CBC":"2.16.840.1.101.3.4.1.2","aes256-CBC":"2.16.840.1.101.3.4.1.42",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",hmacWithSHA1:"1.2.840.113549.2.7",hmacWithSHA224:"1.2.840.113549.2.8",hmacWithSHA256:"1.2.840.113549.2.9",hmacWithSHA384:"1.2.840.113549.2.10",hmacWithSHA512:"1.2.840.113549.2.11",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}}},se.asn1.x509.OID.oid2name=function(e){var t=se.asn1.x509.OID.name2oidList;for(var n in t)if(t[n]==e)return n;return""},se.asn1.x509.OID.oid2atype=function(e){var t=se.asn1.x509.OID.atype2oidList;for(var n in t)if(t[n]==e)return n;return e},se.asn1.x509.OID.name2oid=function(e){if(e.match(/^[0-9.]+$/))return e;var t=se.asn1.x509.OID.name2oidList;return void 0===t[e]?"":t[e]},se.asn1.x509.X509Util={},se.asn1.x509.X509Util.newCertPEM=function(e){var t=se.asn1.x509;t.TBSCertificate;return new(0,t.Certificate)(e).getPEM()},void 0!==se&&se||(se={}),void 0!==se.asn1&&se.asn1||(se.asn1={}),void 0!==se.asn1.cms&&se.asn1.cms||(se.asn1.cms={}),se.asn1.cms.Attribute=function(e){var t=Error,n=se.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(se.asn1.cms.Attribute,se.asn1.ASN1Object),se.asn1.cms.ContentType=function(e){var t=se.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(se.asn1.cms.ContentType,se.asn1.cms.Attribute),se.asn1.cms.MessageDigest=function(e){var t=se.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(se.asn1.cms.MessageDigest,se.asn1.cms.Attribute),se.asn1.cms.SigningTime=function(e){var t=se.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(se.asn1.cms.SigningTime,se.asn1.cms.Attribute),se.asn1.cms.SigningCertificate=function(e){var t=Error,n=se,r=n.asn1,i=r.DERSequence,o=r.cms,s=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 a=n[o];0!=e.hasis||"string"!=typeof a||-1==a.indexOf("-----BEGIN")&&!ue.isASN1HEX(a)||(a={cert:a}),0!=a.hasis&&0==e.hasis&&(a.hasis=!1),r.push(new s(a))}var l=new i({array:r});return[new i({array:[l]})]},null!=e&&this.setByParam(e)},et(se.asn1.cms.SigningCertificate,se.asn1.cms.Attribute),se.asn1.cms.ESSCertID=function(e){se.asn1.cms.ESSCertID.superclass.constructor.call(this);var t=Error,n=se,r=n.asn1,i=r.DEROctetString,o=r.DERSequence,s=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")&&!ue.isASN1HEX(e))return e;var i,o,s;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):ue.isASN1HEX(e)&&(o=e)),null!=e.alg)s=e.alg;else{if(null==r)throw new t("hash alg unspecified");s=r}return n.crypto.Util.hashHex(o,s)},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 s(e)),new o({array:n}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(se.asn1.cms.ESSCertID,se.asn1.ASN1Object),se.asn1.cms.SigningCertificateV2=function(e){var t=Error,n=se,r=n.asn1,i=r.DERSequence,o=(r.x509,r.cms),s=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 a=n[o];null==e.alg&&0!=e.hasis||"string"!=typeof a||-1==a.indexOf("-----BEGIN")&&!ue.isASN1HEX(a)||(a={cert:a}),null==a.alg&&null!=e.alg&&(a.alg=e.alg),0!=a.hasis&&0==e.hasis&&(a.hasis=!1),r.push(new s(a))}var l=new i({array:r});return[new i({array:[l]})]},null!=e&&this.setByParam(e)},et(se.asn1.cms.SigningCertificateV2,se.asn1.cms.Attribute),se.asn1.cms.ESSCertIDv2=function(e){se.asn1.cms.ESSCertIDv2.superclass.constructor.call(this);Error;var t=se.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"),s=[];return null!=e.alg&&"sha256"!=e.alg&&s.push(new o({name:e.alg})),s.push(new n({hex:t})),("string"==typeof e&&-1!=e.indexOf("-----BEGIN")||null!=e.cert&&0!=e.hasis||null!=e.issuer&&null!=e.serial)&&s.push(new i(e)),new r({array:s}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(se.asn1.cms.ESSCertIDv2,se.asn1.cms.ESSCertID),se.asn1.cms.IssuerSerial=function(e){var t=Error,n=se.asn1,r=n.DERInteger,i=n.DERSequence,o=n.cms,s=n.x509.GeneralNames,a=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 l;l=null!=o.cert?o.cert:o;var u=new a;u.readCertPEM(l),e=u.getIssuer(),n={hex:u.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 s([{dn:e}]),h=new r(n);return new i({array:[c,h]}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(se.asn1.cms.IssuerSerial,se.asn1.ASN1Object),se.asn1.cms.SignerIdentifier=function(e){var t=se.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(se.asn1.cms.SignerIdentifier,se.asn1.ASN1Object),se.asn1.cms.IssuerAndSerialNumber=function(e){var t=se.asn1,n=t.DERInteger,r=t.DERSequence,i=t.cms,o=t.x509.X500Name,s=ot,a=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 l;l=null!=i.cert?i.cert:i;var u=new s;u.readCertPEM(l),e=u.getIssuer(),t={hex:u.getSerialNumberHex()}}else{if(null==i.issuer||!i.serial)throw new a("cert or issuer and serial parameter not specified");e=i.issuer,t=i.serial}var c=new o(e),h=new n(t);return new r({array:[c,h]}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(e){this.params=e},null!=e&&this.setByParam(e)},et(se.asn1.cms.IssuerAndSerialNumber,se.asn1.ASN1Object),se.asn1.cms.SubjectKeyIdentifier=function(e){var t=se.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(se.asn1.cms.SubjectKeyIdentifier,se.asn1.ASN1Object),se.asn1.cms.AttributeList=function(e){var t=Error,n=se.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,s=[],a=0;a<o.length;a++){var l=o[a],u=l.attr;if("contentType"==u)s.push(new i.ContentType(l));else if("messageDigest"==u)s.push(new i.MessageDigest(l));else if("signingTime"==u)s.push(new i.SigningTime(l));else if("signingCertificate"==u)s.push(new i.SigningCertificate(l));else if("signingCertificateV2"==u)s.push(new i.SigningCertificateV2(l));else if("signaturePolicyIdentifier"==u)s.push(new se.asn1.cades.SignaturePolicyIdentifier(l));else{if("signatureTimeStamp"!=u&&"timeStampToken"!=u)throw new t("unknown attr: "+u);s.push(new se.asn1.cades.SignatureTimeStamp(l))}}var c=new r({array:s,sortflag:n});return this.hTLV=c.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(se.asn1.cms.AttributeList,se.asn1.ASN1Object),se.asn1.cms.SignerInfo=function(e){var t=Error,n=se,r=n.asn1,i=r.DERInteger,o=r.DEROctetString,s=r.DERSequence,a=r.DERTaggedObject,l=r.cms,u=l.SignerIdentifier,c=l.AttributeList,h=(l.ContentType,l.EncapsulatedContentInfo,l.MessageDigest,l.SignedData,r.x509.AlgorithmIdentifier),p=n.crypto,d=tt;l.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 p.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 u(e.id)),n.push(new h({name:e.hashalg})),null!=e.sattrs){var r=new c(e.sattrs);try{n.push(new a({tag:"a0",explicit:!1,obj:r}))}catch(e){throw new t("si sattr error: "+e)}}if(null!=e.sigalgfield?n.push(new h({name:e.sigalgfield})):n.push(new h({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 a({tag:"a1",explicit:!1,obj:r}))}catch(e){throw new t("si uattr error: "+e)}}return new s({array:n}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(se.asn1.cms.SignerInfo,se.asn1.ASN1Object),se.asn1.cms.EncapsulatedContentInfo=function(e){var t=se.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 s=new o(e.content),a=new n({tag:"a0",explicit:!0,obj:s});t.push(a)}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(se.asn1.cms.EncapsulatedContentInfo,se.asn1.ASN1Object),se.asn1.cms.ContentInfo=function(e){var t=se.asn1,n=t.DERTaggedObject,r=t.DERSequence,i=t.DERObjectIdentifier;t.x509.OID.name2obj;se.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(se.asn1.cms.ContentInfo,se.asn1.ASN1Object),se.asn1.cms.SignedData=function(e){Error;var t=se.asn1,n=(t.ASN1Object,t.DERInteger),r=t.DERSet,i=t.DERSequence,o=(t.DERTaggedObject,t.cms),s=o.EncapsulatedContentInfo,a=o.SignerInfo,l=o.ContentInfo,u=o.CertificateSet,c=o.RevocationInfoChoices,h=t.x509.AlgorithmIdentifier;se.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=xe(t.content.str));for(var r=e.sinfos,i=0;i<r.length;i++){var o=r[i],s=o.hashalg,a=this._getAttrParamByName(o,"messageDigest"),l=se.crypto.Util.hashHex(n,s);a.hex=l}},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=[],l=0;l<e.hashalgs.length;l++){var p=e.hashalgs[l];o.push(new h({name:p}))}t.push(new r({array:o})),t.push(new s(e.econtent)),null!=e.certs&&t.push(new u(e.certs)),null!=e.revinfos&&t.push(new c(e.revinfos));var d=[];for(l=0;l<e.sinfos.length;l++){var f=e.sinfos[l];d.push(new a(f))}return t.push(new r({array:d})),new i({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.getContentInfo=function(){return new l({type:"signed-data",obj:this})},this.getContentInfoEncodedHex=function(){return this.getContentInfo().tohex()},null!=e&&this.setByParam(e)},et(se.asn1.cms.SignedData,se.asn1.ASN1Object),se.asn1.cms.CertificateSet=function(e){se.asn1.cms.CertificateSet.superclass.constructor.call(this);var t=Error,n=se.asn1,r=n.DERTaggedObject,i=n.DERSet,o=n.ASN1Object;this.params=null,this.tohex=function(){var e,n=this.params,s=[];if(n instanceof Array)e=n;else{if(null==n.array)throw new t("cert array not specified");e=n.array}for(var a=0;a<e.length;a++){var l=Te(e[a]),u=new o;u.hTLV=l,s.push(u)}var c={array:s};0==n.sortflag&&(c.sortflag=!1);var h=new i(c);return new r({tag:"a0",explicit:!1,obj:h}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(se.asn1.cms.CertificateSet,se.asn1.ASN1Object),se.asn1.cms.RevocationInfoChoices=function(e){se.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 se.asn1.cms.RevocationInfoChoice(e[n]));return se.asn1.ASN1Util.newObject({tag:{tagi:"a1",obj:{set:t}}}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(se.asn1.cms.RevocationInfoChoices,se.asn1.ASN1Object),se.asn1.cms.RevocationInfoChoice=function(e){se.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 se.asn1.ASN1Util.newObject({tag:{tagi:"a1",obj:new se.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(se.asn1.cms.RevocationInfoChoice,se.asn1.ASN1Object),se.asn1.cms.OtherRevocationFormat=function(e){se.asn1.cms.OtherRevocationFormat.superclass.constructor.call(this);var t=Error,n=se,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)||!ue.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(se.asn1.cms.OtherRevocationFormat,se.asn1.ASN1Object),se.asn1.cms.CMSUtil=new function(){},se.asn1.cms.CMSUtil.newSignedData=function(e){return new se.asn1.cms.SignedData(e)},se.asn1.cms.CMSUtil.verifySignedData=function(e){var t=se,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=ue,s=o.getVbyList,a=o.getTLVbyList,l=o.getIdxbyList,u=o.getChildIdx,c=o.getTLV,h=o.oidname,p=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=a(e,n,[1,0],"30"),t.signerid_serial1=s(e,n,[1,1],"02"),t.hashalg=h(s(e,n,[2,0],"06"));var r=l(e,n,[3],"a0");t.idxSignedAttrs=r,g(e,t,r);var i=u(e,n).length;if(i<6)throw"malformed SignerInfo";t.sigalg=h(s(e,n,[i-2,0],"06")),t.sigval=s(e,n,[i-1],"04")},g=function(e,t,n){var r=u(e,n);t.signedAttrIdxList=r;for(var i=0;i<r.length;i++){var o,a=r[i],l=s(e,a,[0],"06");"2a864886f70d010905"===l?(o=be(s(e,a,[1,0])),t.saSigningTime=o):"2a864886f70d010904"===l&&(o=s(e,a,[1,0],"04"),t.saMessageDigest=o)}},m=function(e,t,n,r){n.verifyDetail={};var i=n.verifyDetail,o=t.parse.econtent,s=n.hashalg,a=n.saMessageDigest;i.validMessageDigest=!1,p(o,s)===a&&(i.validMessageDigest=!0),function(e,t,n,r){var i,o=t.parse.certsIdx;if(void 0===t.certs){i=[],t.certkeys=[];for(var s=u(e,o),a=0;a<s.length;a++){var l=c(e,s[a]),h=new ot;h.readCertHex(l),i[a]=h,t.certkeys[a]=h.getPublicKey()}t.certs=i}else i=t.certs;t.cccc=i.length,t.cccci=s.length;for(a=0;a<i.length;a++){var p=h.getIssuerHex(),d=h.getSerialNumberHex();n.signerid_issuer1===p&&n.signerid_serial1===d&&(n.certkey_idx=a)}}(e,t,n),i.validSignatureValue=!1;var l=n.sigalg,h="31"+c(e,n.idxSignedAttrs).substr(2);n.signedattrshex=h;var d=t.certs[n.certkey_idx].getPublicKey(),f=new se.crypto.Signature({alg:l});f.init(d),f.updateHex(h);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"!==s(e,0,[0],"06"))return t;t.cmsType="signedData",t.econtent=s(e,0,[1,0,2,1,0]),function(e,t){for(var n,r=3;r<6;r++)if(void 0!==(n=l(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=u(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 s=n[o];m(e,t,s,o),s.isValid||(i=!1)}t.isValid=i}(d,v),v},se.asn1.cms.CMSParser=function(){var e=Error,t=ot,n=new t,r=ue,i=r.getV,o=r.getTLV,s=(r.getIdxbyList,r.getTLVbyList),a=r.getTLVbyListEx,l=r.getVbyList,u=r.getVbyListEx,c=r.getChildIdx;this.getCMSSignedData=function(e){var t=s(e,0,[1,0]);return this.getSignedData(t)},this.getSignedData=function(e){var t=c(e,0),n={},r=i(e,t[0]),s=parseInt(r,16);n.version=s;var l=o(e,t[1]);n.hashalgs=this.getHashAlgArray(l);var u=o(e,t[2]);n.econtent=this.getEContent(u);var h=a(e,0,["[0]"]);null!=h&&(n.certs=this.getCertificateSet(h));a(e,0,["[1]"]);var p=a(e,0,[3]);return n.sinfos=this.getSignerInfos(p),n},this.getHashAlgArray=function(e){for(var n=c(e,0),r=new t,i=[],s=0;s<n.length;s++){var a=o(e,n[s]),l=r.getAlgorithmIdentifierName(a);i.push(l)}return i},this.getEContent=function(e){var t={},n=l(e,0,[0]),r=l(e,0,[1,0]);return t.type=se.asn1.x509.OID.oid2name(ue.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]),s=this.getSignerInfo(i);t.push(s)}return t},this.getSignerInfo=function(e){var t={},i=c(e,0),s=r.getInt(e,i[0],-1);-1!=s&&(t.version=s);var l=o(e,i[1]),h=this.getIssuerAndSerialNumber(l);t.id=h;var p=o(e,i[2]),d=n.getAlgorithmIdentifierName(p);t.hashalg=d;var f=a(e,0,["[0]"]);if(null!=f){var g=this.getAttributeList(f);t.sattrs=g}var m=a(e,0,[3]),v=n.getAlgorithmIdentifierName(m);t.sigalg=v;var y=u(e,0,[4]);t.sighex=y;var b=a(e,0,["[1]"]);if(null!=b){var $=this.getAttributeList(b);t.uattrs=$}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),s=o(e,r[0]);t.issuer=n.getX500Name(s);var a=i(e,r[1]);return t.serial={hex:a},t},this.getAttributeList=function(e){for(var t=[],n=c(e,0),r=0;r<n.length;r++){var i=o(e,n[r]),s=this.getAttribute(i);t.push(s)}return{array:t}},this.getAttribute=function(e){var t={},n=c(e,0),i=r.getOID(e,n[0]),s=se.asn1.x509.OID.oid2name(i);t.attr=s;var a=o(e,n[1]),l=c(a,0);if(1==l.length)t.valhex=o(a,l[0]);else{for(var u=[],h=0;h<l.length;h++)u.push(o(a,l[h]));t.valhex=u}return"contentType"==s?this.setContentType(t):"messageDigest"==s?this.setMessageDigest(t):"signingTime"==s?this.setSigningTime(t):"signingCertificate"==s?this.setSigningCertificate(t):"signingCertificateV2"==s?this.setSigningCertificateV2(t):"signaturePolicyIdentifier"==s&&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=be(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=[],s=0;s<r.length;s++){var a=o(n,r[s]),l=this.getESSCertID(a);i.push(l)}e.array=i}if(t.length>1){var u=o(e.valhex,t[1]);e.polhex=u}delete e.valhex},this.setSignaturePolicyIdentifier=function(e){var n=c(e.valhex,0);if(n.length>0){var s=r.getOID(e.valhex,n[0]);e.oid=s}if(n.length>1){var a=new t,l=c(e.valhex,n[1]),u=o(e.valhex,l[0]),h=a.getAlgorithmIdentifierName(u);e.alg=h;var p=i(e.valhex,l[1]);e.hash=p}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=[],s=0;s<r.length;s++){var a=o(n,r[s]),l=this.getESSCertIDv2(a);i.push(l)}e.array=i}if(t.length>1){var u=o(e.valhex,t[1]);e.polhex=u}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 s=o(e,n[1]),a=this.getIssuerSerial(s);null!=a.serial&&(t.serial=a.serial),null!=a.issuer&&(t.issuer=a.issuer)}return t},this.getESSCertIDv2=function(t){var r={},s=c(t,0);if(s.length<1||3<s.length)throw new e("wrong number of elements");var a=0;if("30"==t.substr(s[0],2)){var l=o(t,s[0]);r.alg=n.getAlgorithmIdentifierName(l),a++}else r.alg="sha256";var u=i(t,s[a]);if(r.hash=u,s.length>a+1){var h=o(t,s[a+1]),p=this.getIssuerSerial(h);r.issuer=p.issuer,r.serial=p.serial}return r},this.getIssuerSerial=function(e){var t={},r=c(e,0),s=o(e,r[0]),a=n.getGeneralNames(s)[0].dn;t.issuer=a;var l=i(e,r[1]);return t.serial={hex:l},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 s=Ce(i,"CERTIFICATE");n.push(s)}}return{array:n,sortflag:!1}}},void 0!==se&&se||(se={}),void 0!==se.asn1&&se.asn1||(se.asn1={}),void 0!==se.asn1.tsp&&se.asn1.tsp||(se.asn1.tsp={}),se.asn1.tsp.TimeStampToken=function(e){var t=se.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(se.asn1.tsp.TimeStampToken,se.asn1.cms.SignedData),se.asn1.tsp.TSTInfo=function(e){Error;var t=se.asn1,n=t.DERSequence,r=t.DERInteger,i=t.DERBoolean,o=t.DERGeneralizedTime,s=t.DERObjectIdentifier,a=t.DERTaggedObject,l=t.tsp,u=l.MessageImprint,c=l.Accuracy,h=(t.x509.X500Name,t.x509.GeneralName);if(l.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 s({oid:e.policy})}void 0!==e.messageImprint&&(this.dMessageImprint=new u(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 a({tag:"a0",explicit:!0,obj:new h({dn:e.tsa})}))}},et(se.asn1.tsp.TSTInfo,se.asn1.ASN1Object),se.asn1.tsp.Accuracy=function(e){var t=se.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(se.asn1.tsp.Accuracy,se.asn1.ASN1Object),se.asn1.tsp.MessageImprint=function(e){var t=se.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(se.asn1.tsp.MessageImprint,se.asn1.ASN1Object),se.asn1.tsp.TimeStampReq=function(e){var t=se.asn1,n=t.DERSequence,r=t.DERInteger,i=t.DERBoolean,o=(t.ASN1Object,t.DERObjectIdentifier),s=t.tsp,a=s.MessageImprint;s.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 se.asn1.ASN1Object?t.push(e.messageImprint):t.push(new a(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(se.asn1.tsp.TimeStampReq,se.asn1.ASN1Object),se.asn1.tsp.TimeStampResp=function(e){var t=se.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(se.asn1.tsp.TimeStampResp,se.asn1.ASN1Object),se.asn1.tsp.PKIStatusInfo=function(e){var t=Error,n=se.asn1,r=n.DERSequence,i=n.tsp,o=i.PKIStatus,s=i.PKIFreeText,a=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 s(e.statusstr)),null!=e.failinfo&&n.push(new a(e.failinfo))}return new r({array:n}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(se.asn1.tsp.PKIStatusInfo,se.asn1.ASN1Object),se.asn1.tsp.PKIStatus=function(e){var t=Error,n=se.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(se.asn1.tsp.PKIStatus,se.asn1.ASN1Object),se.asn1.tsp.PKIFreeText=function(e){var t=Error,n=se.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(se.asn1.tsp.PKIFreeText,se.asn1.ASN1Object),se.asn1.tsp.PKIFailureInfo=function(e){var t=Error,n=se.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="",s=r.length-1;s>=0;s--)i+=r[s];return i}if("string"==typeof e&&null!=o[e])return Qe([e],o);if("object"==typeof e&&null!=e.length)return Qe(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(se.asn1.tsp.PKIFailureInfo,se.asn1.ASN1Object),se.asn1.tsp.AbstractTSAAdapter=function(e){this.getTSTHex=function(e,t){throw"not implemented yet"}},se.asn1.tsp.SimpleTSAAdapter=function(e){var t=se,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(se.asn1.tsp.SimpleTSAAdapter,se.asn1.tsp.AbstractTSAAdapter),se.asn1.tsp.FixedTSAAdapter=function(e){var t=se,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(se.asn1.tsp.FixedTSAAdapter,se.asn1.tsp.AbstractTSAAdapter),se.asn1.tsp.TSPUtil=new function(){},se.asn1.tsp.TSPUtil.newTimeStampToken=function(e){return new se.asn1.tsp.TimeStampToken(e)},se.asn1.tsp.TSPUtil.parseTimeStampReq=function(e){return(new se.asn1.tsp.TSPParser).getTimeStampReq(e)},se.asn1.tsp.TSPUtil.parseMessageImprint=function(e){return(new se.asn1.tsp.TSPParser).getMessageImprint(e)},se.asn1.tsp.TSPParser=function(){Error;var e=new ot,t=ue,n=t.getV,r=t.getTLV,i=t.getIdxbyList,o=(t.getTLVbyListEx,t.getChildIdx),s=["granted","grantedWithMods","rejection","waiting","revocationWarning","revocationNotification"],a={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]),s=this.getToken(i);return s.statusinfo=n,s}},this.getToken=function(e){var t=(new se.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={},s=o(t,0),a=n(t,s[1]);i.policy=ze(a);var l=r(t,s[2]);i.messageImprint=this.getMessageImprint(l);var u=n(t,s[3]);i.serial={hex:u};var c=n(t,s[4]);i.genTime={str:be(c)};var h=0;if(s.length>5&&"30"==t.substr(s[5],2)){var p=r(t,s[5]);i.accuracy=this.getAccuracy(p),h++}s.length>5+h&&"01"==t.substr(s[5+h],2)&&("ff"==n(t,s[5+h])&&(i.ordering=!0),h++);if(s.length>5+h&&"02"==t.substr(s[5+h],2)){var d=n(t,s[5+h]);i.nonce={hex:d},h++}if(s.length>5+h&&"a0"==t.substr(s[5+h],2)){var f=r(t,s[5+h]);f="30"+f.substr(2),pGeneralNames=e.getGeneralNames(f);var g=pGeneralNames[0].dn;i.tsa=g,h++}if(s.length>5+h&&"a1"==t.substr(s[5+h],2)){var m=r(t,s[5+h]);m="30"+m.substr(2);var v=e.getExtParamArray(m);i.ext=v,h++}return i},this.getAccuracy=function(e){for(var t={},r=o(e,0),i=0;i<r.length;i++){var s=e.substr(r[i],2),a=n(e,r[i]),l=parseInt(a,16);"02"==s?t.seconds=l:"80"==s?t.millis=l:"81"==s&&(t.micros=l)}return t},this.getMessageImprint=function(e){if("30"!=e.substr(0,2))throw new Error("head of messageImprint hex shall be x30");var r={},s=(o(e,0),i(e,0,[0,0])),a=n(e,s),l=t.hextooidstr(a),u=se.asn1.x509.OID.oid2name(l);if(""==u)throw new Error("hashAlg name undefined: "+l);var c=u,h=i(e,0,[1]);return r.alg=c,r.hash=n(e,h),r},this.getPKIStatusInfo=function(e){var t={},i=o(e,0),a=0;try{var l=n(e,i[0]),u=parseInt(l,16);t.status=s[u]}catch(e){}if(i.length>1&&"30"==e.substr(i[1],2)){var c=r(e,i[1]);t.statusstr=this.getPKIFreeText(c),a++}if(i.length>a&&"03"==e.substr(i[1+a],2)){var h=r(e,i[1+a]);t.failinfo=this.getPKIFailureInfo(h)}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!=a[n]?a[n]:n},this.getTimeStampReq=function(e){var i={certreq:!1},s=o(e,0);if(s.length<2)throw new Error("TimeStampReq must have at least 2 items");var a=r(e,s[1]);i.messageImprint=se.asn1.tsp.TSPUtil.parseMessageImprint(a);for(var l=2;l<s.length;l++){var u=s[l],c=e.substr(u,2);if("06"==c){var h=n(e,u);i.policy=t.hextooidstr(h)}"02"==c&&(i.nonce=n(e,u)),"01"==c&&(i.certreq=!0)}return i}},void 0!==se&&se||(se={}),void 0!==se.asn1&&se.asn1||(se.asn1={}),void 0!==se.asn1.cades&&se.asn1.cades||(se.asn1.cades={}),se.asn1.cades.SignaturePolicyIdentifier=function(e){var t=se.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(se.asn1.cades.SignaturePolicyIdentifier,se.asn1.cms.Attribute),se.asn1.cades.SignaturePolicyId=function(e){var t=se.asn1,n=t.DERSequence,r=t.DERObjectIdentifier,i=(t.x509.AlgorithmIdentifier,t.cades),o=i.SignaturePolicyId,s=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 s(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(se.asn1.cades.SignaturePolicyId,se.asn1.ASN1Object),se.asn1.cades.OtherHashAlgAndValue=function(e){var t=Error,n=se.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 s=e.cert;-1!=e.cert.indexOf("-----BEGIN")&&(s=Te(e.cert)),n=se.crypto.Util.hashHex(s,e.alg)}var a=[];return a.push(new o({name:e.alg})),a.push(new i({hex:n})),new r({array:a}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(se.asn1.cades.OtherHashAlgAndValue,se.asn1.ASN1Object),se.asn1.cades.OtherHashValue=function(e){se.asn1.cades.OtherHashValue.superclass.constructor.call(this);var t=Error,n=se,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=se.crypto.Util.hashHex(i,"sha1")}return new r({hex:n}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(se.asn1.cades.OtherHashValue,se.asn1.ASN1Object),se.asn1.cades.SignatureTimeStamp=function(e){var t=Error,n=se,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;ue.getTLVbyList(n,0,[1]);return(i=new o).hTLV=e.tst,[i]}},null!=e&&this.setByParam(e)},et(se.asn1.cades.SignatureTimeStamp,se.asn1.cms.Attribute),se.asn1.cades.CompleteCertificateRefs=function(e){var t=Error,n=se,r=n.asn1,i=r.DERSequence,o=r.cades,s=o.OtherCertID,a=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(!a(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 l=new s(o);n.push(l)}return[new i({array:n})]},null!=e&&this.setByParam(e)},et(se.asn1.cades.CompleteCertificateRefs,se.asn1.cms.Attribute),se.asn1.cades.OtherCertID=function(e){var t=se.asn1,n=t.DERSequence,r=t.cms.IssuerSerial,i=t.cades,o=i.OtherHashValue,s=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 s(e):new o(e),t.push(i),null!=e.cert&&1==e.hasis||null!=e.issuer&&null!=e.serial){var a=new r(e);t.push(a)}return new n({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(se.asn1.cades.OtherCertID,se.asn1.ASN1Object),se.asn1.cades.OtherHash=function(e){Error;var t=se,n=t.asn1,r=(n.cms,n.cades),i=r.OtherHashAlgAndValue,o=r.OtherHashValue,s=(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}:s(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(se.asn1.cades.OtherHash,se.asn1.ASN1Object),se.asn1.cades.CAdESUtil=new function(){},se.asn1.cades.CAdESUtil.parseSignedDataForAddingUnsigned=function(e){return(new se.asn1.cms.CMSParser).getCMSSignedData(e)},se.asn1.cades.CAdESUtil.parseSignerInfoForAddingUnsigned=function(e,t,n){var r=ue,i=r.getChildIdx,o=r.getTLV,s=r.getV,a=se.asn1,l=a.ASN1Object,u=a.cms,c=u.AttributeList,h=u.SignerInfo,p={},d=i(e,t);if(6!=d.length)throw"not supported items for SignerInfo (!=6)";var f=d.shift();p.version=o(e,f);var g=d.shift();p.si=o(e,g);var m=d.shift();p.digalg=o(e,m);var v=d.shift();p.sattrs=o(e,v);var y=d.shift();p.sigalg=o(e,y);var b=d.shift();p.sig=o(e,b),p.sigval=s(e,b);var $=null;return p.obj=new h,($=new l).hTLV=p.version,p.obj.dCMSVersion=$,($=new l).hTLV=p.si,p.obj.dSignerIdentifier=$,($=new l).hTLV=p.digalg,p.obj.dDigestAlgorithm=$,($=new l).hTLV=p.sattrs,p.obj.dSignedAttrs=$,($=new l).hTLV=p.sigalg,p.obj.dSigAlg=$,($=new l).hTLV=p.sig,p.obj.dSig=$,p.obj.dUnsignedAttrs=new c,p},void 0!==se.asn1.csr&&se.asn1.csr||(se.asn1.csr={}),se.asn1.csr.CertificationRequest=function(e){var t=se.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 se.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 Ce(this.tohex(),"CERTIFICATE REQUEST")},this.tohex=function(){var e=this.params,t=new se.asn1.csr.CertificationRequestInfo(this.params),i=new se.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(se.asn1.csr.CertificationRequest,se.asn1.ASN1Object),se.asn1.csr.CertificationRequestInfo=function(e){var t=se.asn1,n=(t.DERBitString,t.DERSequence),r=t.DERInteger,i=t.DERUTF8String,o=t.DERTaggedObject,s=t.ASN1Util.newObject,a=t.csr,l=t.x509,u=l.X500Name,c=l.Extensions,h=l.SubjectPublicKeyInfo;a.AttributeList;a.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 u(e.subject)),t.push(new h(tt.getKey(e.sbjpubkey))),null!=e.attrs){var a=function(e){for(var t=Error,n=se.asn1.x509.Extensions,r=[],i=0;i<e.length;i++){var o=e[i],s=o.attr;if("extensionRequest"==s){var a={seq:[{oid:"1.2.840.113549.1.9.14"},{set:[new n(o.ext)]}]};r.push(a)}else if("unstructuredName"==s){a={seq:[{oid:"1.2.840.113549.1.9.2"},{set:o.names}]};r.push(a)}else{if("challengePassword"!=s)throw new t("unknown CSR attribute");a={seq:[{oid:"1.2.840.113549.1.9.7"},{set:[{utf8str:o.password}]}]};r.push(a)}}return{set:r}}(e.attrs),l=s({tag:{tage:"a0",obj:a}});t.push(l)}else if(null!=e.extreq){var p=new c(e.extreq);l=s({tag:{tage:"a0",obj:{seq:[{oid:"1.2.840.113549.1.9.14"},{set:[p]}]}}});t.push(l)}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(se.asn1.csr.CertificationRequestInfo,se.asn1.ASN1Object),se.asn1.csr.AttributeList=function(e){},et(se.asn1.csr.AttributeList,se.asn1.ASN1Object),se.asn1.csr.CSRUtil=new function(){},se.asn1.csr.CSRUtil.newCSRPEM=function(e){return new se.asn1.csr.CertificationRequest(e).getPEM()},se.asn1.csr.CSRUtil.getParam=function(e,t){var n=ue,r=n.getV,i=n.getIdxbyList,o=n.getTLVbyList,s=n.getTLVbyListEx,a=n.getVbyListEx,l={};if(-1==e.indexOf("-----BEGIN CERTIFICATE REQUEST"))throw new Error("argument is not PEM file");var u=Te(e,"CERTIFICATE REQUEST");t&&(l.tbs=o(u,0,[0]));try{var c=s(u,0,[0,1]);if("3000"==c)l.subject={};else{var h=new ot;l.subject=h.getX500Name(c)}}catch(e){}var p=s(u,0,[0,2]),d=tt.getKey(p,null,"pkcs8pub");l.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")}(u);h=new ot;null!=f&&(l.extreq=h.getExtParamArray(f));try{var g=s(u,0,[1],"30");h=new ot;l.sigalg=h.getAlgorithmIdentifierName(g)}catch(e){}try{var m=a(u,0,[2]);l.sighex=m}catch(e){}return l},se.asn1.csr.CSRUtil.verifySignature=function(e){try{var t=null;if("string"==typeof e&&-1!=e.indexOf("-----BEGIN CERTIFICATE REQUEST")?t=se.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 se.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!==se&&se||(se={}),void 0!==se.asn1&&se.asn1||(se.asn1={}),void 0!==se.asn1.ocsp&&se.asn1.ocsp||(se.asn1.ocsp={}),se.asn1.ocsp.DEFAULT_HASH="sha1",se.asn1.ocsp.OCSPResponse=function(e){se.asn1.ocsp.OCSPResponse.superclass.constructor.call(this);se.asn1.DEREnumerated;var t=se.asn1.ASN1Util.newObject,n=se.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(se.asn1.ocsp.OCSPResponse,se.asn1.ASN1Object),se.asn1.ocsp.ResponseBytes=function(e){se.asn1.ocsp.ResponseBytes.superclass.constructor.call(this);var t=se.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),s=[];return s.push(new r({name:"ocspBasic"})),s.push(new i({hex:t.tohex()})),new n({array:s}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},et(se.asn1.ocsp.ResponseBytes,se.asn1.ASN1Object),se.asn1.ocsp.BasicOCSPResponse=function(e){se.asn1.ocsp.BasicOCSPResponse.superclass.constructor.call(this);var t=Error,n=se.asn1,r=n.ASN1Object,i=n.DERSequence,o=(n.DERGeneralizedTime,n.DERTaggedObject),s=n.DERBitString,a=(n.x509.Extensions,n.x509.AlgorithmIdentifier),l=n.ocsp;l.ResponderID;_SingleResponseList=l.SingleResponseList,_ResponseData=l.ResponseData,this.params=null,this.setByParam=function(e){this.params=e},this.sign=function(){var e=this.params,t=e.tbsresp.tohex(),n=new se.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 a({name:e.sigalg})),n.push(new s({hex:"00"+e.sighex})),null!=e.certs&&null!=e.certs.length){for(var l=[],u=0;u<e.certs.length;u++){var c=e.certs[u],h=null;if(ue.isASN1HEX(c))h=c;else{if(!c.match(/-----BEGIN/))throw new t("certs["+u+"] not hex or PEM");h=Te(c)}l.push(new r({tlv:h}))}var p=new i({array:l});n.push(new o({tag:"a0",explicit:!0,obj:p}))}return new i({array:n}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},et(se.asn1.ocsp.BasicOCSPResponse,se.asn1.ASN1Object),se.asn1.ocsp.ResponseData=function(e){se.asn1.ocsp.ResponseData.superclass.constructor.call(this);var t=Error,n=se.asn1,r=n.DERSequence,i=n.DERGeneralizedTime,o=n.DERTaggedObject,s=n.x509.Extensions,a=n.ocsp,l=a.ResponderID;_SingleResponseList=a.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 l(e.respid)),n.push(new i(e.prodat)),n.push(new _SingleResponseList(e.array)),null!=e.ext){var a=new s(e.ext);n.push(new o({tag:"a1",explicit:!0,obj:a}))}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(se.asn1.ocsp.ResponseData,se.asn1.ASN1Object),se.asn1.ocsp.ResponderID=function(e){se.asn1.ocsp.ResponderID.superclass.constructor.call(this);var t=se,n=t.asn1,r=n.ASN1Util.newObject,i=n.x509.X500Name,o=t.lang.String.isHex,s=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 s("wrong key member value");return r({tag:{tag:"a2",explicit:!0,obj:{octstr:{hex:n}}}}).tohex()}if(null!=e.name){var a=null;if("string"==typeof e.name&&e.name.match(/-----BEGIN CERTIFICATE/))a=new ot(e.name).getSubject();else e.name instanceof ot?a=e.name.getSubject():"object"!=typeof e.name||null==e.name.array&&null==e.name.str||(a=e.name);if(null==a)throw new s("wrong name member value");return r({tag:{tag:"a1",explicit:!0,obj:new i(a)}}).tohex()}throw new s("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(se.asn1.ocsp.ResponderID,se.asn1.ASN1Object),se.asn1.ocsp.SingleResponseList=function(e){se.asn1.ocsp.SingleResponseList.superclass.constructor.call(this);var t=se.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(se.asn1.ocsp.SingleResponseList,se.asn1.ASN1Object),se.asn1.ocsp.SingleResponse=function(e){var t=Error,n=se.asn1,r=n.DERSequence,i=n.DERGeneralizedTime,o=n.DERTaggedObject,s=n.ocsp,a=s.CertID,l=s.CertStatus,u=n.x509.Extensions;s.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 a(e.certid)),n.push(new l(e.status)),n.push(new i(e.thisupdate)),null!=e.nextupdate){var s=new i(e.nextupdate);n.push(new o({tag:"a0",explicit:!0,obj:s}))}if(null!=e.ext){var c=new u(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(se.asn1.ocsp.SingleResponse,se.asn1.ASN1Object),se.asn1.ocsp.CertID=function(e){var t=se,n=t.asn1,r=n.DEROctetString,i=n.DERInteger,o=n.DERSequence,s=n.x509.AlgorithmIdentifier,a=n.ocsp,l=(a.DEFAULT_HASH,t.crypto.Util.hashHex),u=ot,c=ue.getVbyList;a.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 u(e),i=new u(t),o=l(r.getSubjectHex(),n),s=r.getPublicKeyHex();return{alg:n,issname:o,isskey:l(c(s,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,a,l=this.params;if(a=null==l.alg?this.DEFAULT_HASH:l.alg,null!=l.issuerCert&&null!=l.subjectCert){var u=this.getParamByCerts(l.issuerCert,l.subjectCert,a);e=u.issname,t=u.isskey,n=u.sbjsn}else{if(null==l.issname||null==l.isskey||null==l.sbjsn)throw new Error("required param members not defined");e=l.issname,t=l.isskey,n=l.sbjsn}var c=new s({name:a}),h=new r({hex:e}),p=new r({hex:t}),d=new i({hex:n}),f=new o({array:[c,h,p,d]});return this.hTLV=f.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},et(se.asn1.ocsp.CertID,se.asn1.ASN1Object),se.asn1.ocsp.CertStatus=function(e){se.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 se.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(se.asn1.ocsp.CertStatus,se.asn1.ASN1Object),se.asn1.ocsp.Request=function(e){var t=se.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(se.asn1.ocsp.Request,se.asn1.ASN1Object),se.asn1.ocsp.TBSRequest=function(e){var t=se.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(se.asn1.ocsp.TBSRequest,se.asn1.ASN1Object),se.asn1.ocsp.OCSPRequest=function(e){var t=se.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(se.asn1.ocsp.OCSPRequest,se.asn1.ASN1Object),se.asn1.ocsp.OCSPUtil={},se.asn1.ocsp.OCSPUtil.getRequestHex=function(e,t,n){var r=se.asn1.ocsp;void 0===n&&(n=r.DEFAULT_HASH);var i={alg:n,issuerCert:e,subjectCert:t};return new r.OCSPRequest({reqList:[i]}).tohex()},se.asn1.ocsp.OCSPUtil.getOCSPResponseInfo=function(e){var t=ue,n=t.getVbyList,r=t.getVbyListEx,i=t.getIdxbyList,o=(t.getIdxbyListEx,t.getV),s={};try{var a=r(e,0,[0],"0a");s.responseStatus=parseInt(a,16)}catch(e){}if(0!==s.responseStatus)return s;try{var l=i(e,0,[1,0,1,0,0,2,0,1]);"80"===e.substr(l,2)?s.certStatus="good":"a1"===e.substr(l,2)?(s.certStatus="revoked",s.revocationTime=be(n(e,l,[0]))):"82"===e.substr(l,2)&&(s.certStatus="unknown")}catch(e){}try{var u=i(e,0,[1,0,1,0,0,2,0,2]);s.thisUpdate=be(o(e,u))}catch(e){}try{var c=i(e,0,[1,0,1,0,0,2,0,3]);"a0"===e.substr(c,2)&&(s.nextUpdate=be(n(e,c,[0])))}catch(e){}return s},se.asn1.ocsp.OCSPParser=function(){var e=Error,t=ot,n=new t,r=ue,i=r.getV,o=r.getTLV,s=r.getIdxbyList,a=r.getVbyList,l=r.getTLVbyList,u=r.getVbyListEx,c=r.getTLVbyListEx,h=r.getChildIdx;this.getOCSPRequest=function(t){var n=h(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=h(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=h(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 a=s(t,0,[1,0]);i.ext=n.getExtParamArray(o(t,a))}return i},this.getCertID=function(n){var r=h(n,0);if(4!=r.length)throw new e("wrong number elements: "+r.length);var s=new t,a={};return a.alg=s.getAlgorithmIdentifierName(o(n,r[0])),a.issname=i(n,r[1]),a.isskey=i(n,r[2]),a.sbjsn=i(n,r[3]),a},this.getOCSPResponse=function(e){var t,n=h(e,0),r=i(e,n[0]),o=parseInt(r);if(1==n.length)return{resstatus:o};var s=l(e,0,[1,0]);return(t=this.getResponseBytes(s)).resstatus=o,t},this.getResponseBytes=function(e){var t,n=h(e,0),r=l(e,0,[1,0]);t=this.getBasicOCSPResponse(r);var o=i(e,n[0]);return t.restype=se.asn1.x509.OID.oid2name(ze(o)),t},this.getBasicOCSPResponse=function(e){var t,n=h(e,0);t=this.getResponseData(o(e,n[0]));var r=new ot;t.alg=r.getAlgorithmIdentifierName(o(e,n[1]));var s=i(e,n[2]);t.sighex=s.substr(2);var a=u(e,0,["[0]"]);if(null!=a){for(var l=h(a,0),c=[],p=0;p<l.length;p++){var d=o(a,l[p]);c.push(d)}t.certs=c}return t},this.getResponseData=function(e){var t=h(e,0),n=t.length,r={},s=0;"a0"==e.substr(t[0],2)&&s++,r.respid=this.getResponderID(o(e,t[s++]));var a=i(e,t[s++]);if(r.prodat=be(a),r.array=this.getSingleResponseList(o(e,t[s++])),"a1"==e.substr(t[n-1],2)){var u=l(e,t[n-1],[0]),c=new ot;r.ext=c.getExtParamArray(u)}return r},this.getResponderID=function(e){var t={};if("a2"==e.substr(0,2)){var n=a(e,0,[0]);t.key=n}if("a1"==e.substr(0,2)){var r=l(e,0,[0]),i=new ot;t.name=i.getX500Name(r)}return t},this.getSingleResponseList=function(e){for(var t=h(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=h(e,0),n={},r=this.getCertID(o(e,t[0]));n.certid=r;var s=this.getCertStatus(o(e,t[1]));if(n.status=s,"18"==e.substr(t[2],2)){var u=i(e,t[2]);n.thisupdate=be(u)}for(var c=3;c<t.length;c++){if("a0"==e.substr(t[c],2)){var p=a(e,t[c],[0],"18");n.nextupdate=be(p)}if("a1"==e.substr(t[c],2)){var d=new ot,f=l(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=be(a(e,0,[0]));t.time=n}return t}},void 0!==se&&se||(se={}),void 0!==se.lang&&se.lang||(se.lang={}),se.lang.String=function(){},"function"==typeof e?(ae=function(t){return fe(e.from(t,"utf8").toString("base64"))},le=function(t){return e.from(ge(t),"base64").toString("utf8")}):(ae=function(e){return me(Re(Be(e)))},le=function(e){return decodeURIComponent(Ie(ve(e)))}),se.lang.String.isInteger=function(e){return!!e.match(/^[0-9]+$/)||!!e.match(/^-[0-9]+$/)},se.lang.String.isHex=function(e){return He(e)},se.lang.String.isBase64=function(e){return!(!(e=e.replace(/\s+/g,"")).match(/^[0-9A-Za-z+\/]+={0,3}$/)||e.length%4!=0)},se.lang.String.isBase64URL=function(e){return!e.match(/[+/=]/)&&(e=ge(e),se.lang.String.isBase64(e))},se.lang.String.isIntegerArray=function(e){return!!(e=e.replace(/\s+/g,"")).match(/^\[[0-9,]+\]$/)},se.lang.String.isPrintable=function(e){return null!==e.match(/^[0-9A-Za-z '()+,-./:=?]*$/)},se.lang.String.isIA5=function(e){return null!==e.match(/^[\x20-\x21\x23-\x7f]*$/)},se.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 qe(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="",s=0;s<i;s++)o+="0";r=o+r;for(s=0;s<r.length-1;s+=7){var a=r.substr(s,7);s!=r.length-7&&(a="1"+a),n+=t(parseInt(a,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 s=0;s<i.length;s++)r+=n(i[s]);return r}catch(e){return null}}function ze(e){if(!He(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=[],s=0;s<i.length/2;s++)o.push(parseInt(i.substr(2*s,2),16));var a=[],l="";for(s=0;s<o.length;s++)128&o[s]?l+=We((127&o[s]).toString(2),7):(l+=We((127&o[s]).toString(2),7),a.push(new String(parseInt(l,2))),l="");var u=t.join(".");return a.length>0&&(u=u+"."+a.join(".")),u}catch(e){return null}}function Ke(e){return Ge(new w(String(e),10))}function Ge(e){var t=e.toString(16);if("-"!=t.substr(0,1))return t.length%2==1?t="0"+t:t.match(/^[0-7]/)||(t="00"+t),t;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";return t=new w(r,16).xor(e).add(w.ONE).toString(16).replace(/^-/,"")}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 Je(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 Xe(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),s=parseInt(o,16).toString(2);r+=s=("0000000"+s).slice(-8)}return r.substr(0,r.length-t)}catch(e){return null}}function Qe(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 Ze(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!==se&&se||(se={}),void 0!==se.crypto&&se.crypto||(se.crypto={}),se.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",s="00"+r,a="",l=i-o.length-s.length,u=0;u<l;u+=2)a+="ff";return o+a+s},this.hashString=function(e,t){return new se.crypto.MessageDigest({alg:t}).digestString(e)},this.hashHex=function(e,t){return new se.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 te||e instanceof se.crypto.DSA||e instanceof se.crypto.ECDSA}},se.crypto.Util.md5=function(e){return new se.crypto.MessageDigest({alg:"md5",prov:"cryptojs"}).digestString(e)},se.crypto.Util.ripemd160=function(e){return new se.crypto.MessageDigest({alg:"ripemd160",prov:"cryptojs"}).digestString(e)},se.crypto.Util.SECURERANDOMGEN=new Z,se.crypto.Util.getRandomHexOfNbytes=function(e){var t=new Array(e);return se.crypto.Util.SECURERANDOMGEN.nextBytes(t),pe(t)},se.crypto.Util.getRandomBigIntegerOfNbytes=function(e){return new w(se.crypto.Util.getRandomHexOfNbytes(e),16)},se.crypto.Util.getRandomHexOfNbits=function(e){var t=e%8,n=new Array((e-t)/8+1);return se.crypto.Util.SECURERANDOMGEN.nextBytes(n),n[0]=(255<<t&255^255)&n[0],pe(n)},se.crypto.Util.getRandomBigIntegerOfNbits=function(e){return new w(se.crypto.Util.getRandomHexOfNbits(e),16)},se.crypto.Util.getRandomBigIntegerZeroToMax=function(e){for(var t=e.bitLength();;){var n=se.crypto.Util.getRandomBigIntegerOfNbits(t);if(-1!=e.compareTo(n))return n}},se.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 se.crypto.Util.getRandomBigIntegerZeroToMax(r).add(e)},se.crypto.MessageDigest=function(e){this.setAlgAndProvider=function(e,t){if(null!==(e=se.crypto.MessageDigest.getCanonicalAlgName(e))&&void 0===t&&(t=se.crypto.Util.DEFAULTPROVIDER[e]),-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(e)&&"cryptojs"==t){try{this.md=se.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=se.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName))},se.crypto.MessageDigest.getCanonicalAlgName=function(e){return"string"==typeof e&&(e=(e=e.toLowerCase()).replace(/-/,"")),e},se.crypto.MessageDigest.getHashLength=function(e){var t=se.crypto.MessageDigest,n=t.getCanonicalAlgName(e);if(void 0===t.HASHLENGTH[n])throw"not supported algorithm: "+e;return t.HASHLENGTH[n]},se.crypto.MessageDigest.HASHLENGTH={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,ripemd160:20},se.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=se.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=se.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=xe(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=ye(e.utf8)),void 0!==e.rstr&&(t=xe(e.rstr)),void 0!==e.b64&&(t=b(e.b64)),void 0!==e.b64u&&(t=ve(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=se.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName)))},se.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 se.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!==se.crypto.ECDSA&&(this.prvKey=new se.crypto.ECDSA({curve:this.eccurvename,prv:this.ecprvhex})),this.prvKey instanceof te&&"rsaandmgf1"===this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHashPSS(this.sHashHex,this.mdAlgName,this.pssSaltLen);else if(this.prvKey instanceof te&&"rsa"===this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex,this.mdAlgName);else if(this.prvKey instanceof se.crypto.ECDSA)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex);else{if(!(this.prvKey instanceof se.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!==se.crypto.ECDSA&&(this.pubKey=new se.crypto.ECDSA({curve:this.eccurvename,pub:this.ecpubhex})),this.pubKey instanceof te&&"rsaandmgf1"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHashPSS(this.sHashHex,e,this.mdAlgName,this.pssSaltLen);if(this.pubKey instanceof te&&"rsa"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHash(this.sHashHex,e);if(void 0!==se.crypto.ECDSA&&this.pubKey instanceof se.crypto.ECDSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,e);if(void 0!==se.crypto.DSA&&this.pubKey instanceof se.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=se.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}}},se.crypto.Cipher=function(e){},se.crypto.Cipher.encrypt=function(e,t,n,r){if(null!=Ze(r,"enclag")&&(n=r.encalg),"string"==typeof n&&"-CBC"==n.substr(-4)){var i=t,o=e;null!=Ze(r,"key")&&(i=r.key),null!=Ze(r,"enc")&&(hEnc=r.enc);var s,a=g.enc.Hex.parse(i),l=g.enc.Hex.parse(o),u=g.enc.Hex.parse(r.iv);if("des-EDE3-CBC"==n)s=g.TripleDES.encrypt(l,a,{iv:u});else{if("aes128-CBC"!=n&&"aes256-CBC"!=n)throw new Error("unsupported algorithm: "+n);s=g.AES.encrypt(l,a,{iv:u})}return s+""}throw new Error("Cipher.encrypt: unsupported key or algorithm")},se.crypto.Cipher.decrypt=function(e,t,n,r){if(null!=Ze(r,"enclag")&&(n=r.encalg),"string"==typeof n&&"-CBC"==n.substr(-4)){var i=t,o=e;null!=Ze(r,"key")&&(i=r.key),null!=Ze(r,"enc")&&(o=r.enc);var s,a=g.enc.Hex.parse(i),l=g.enc.Hex.parse(o),u=g.enc.Hex.parse(r.iv);if("des-EDE3-CBC"==n)s=g.TripleDES.decrypt({ciphertext:l},a,{iv:u});else{if("aes128-CBC"!=n&&"aes256-CBC"!=n)throw new Error("unsupported algorithm: "+n);s=g.AES.decrypt({ciphertext:l},a,{iv:u})}return g.enc.Hex.stringify(s)}throw new Error("Cipher.decrypt: unsupported key or algorithm")},se.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!==se&&se||(se={}),void 0!==se.crypto&&se.crypto||(se.crypto={}),se.crypto.ECDSA=function(e){var t=Error,n=w,r=re,i=se.crypto.ECDSA,o=se.crypto.ECParameterDB,s=i.getName,a=ue,l=a.getVbyListEx,u=a.isASN1HEX,c=new Z;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,s="04"+("0000000000"+r.toString(16)).slice(-o)+("0000000000"+i.toString(16)).slice(-o);return this.setPublicKeyHex(s),s},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,s=new n(e.substring(0,this.ecparams.keycharlen),16);do{var a=this.getBigRandom(o),l=this.ecparams.G.multiply(a).getX().toBigInteger().mod(o)}while(l.compareTo(n.ZERO)<=0);var u=a.modInverse(o).multiply(s.add(r.multiply(l))).mod(o);return i.biRSSigToASN1Sig(l,u)},this.sign=function(e,t){var r=t,i=this.ecparams.n,o=n.fromByteArrayUnsigned(e);do{var s=this.getBigRandom(i),a=this.ecparams.G.multiply(s).getX().toBigInteger().mod(i)}while(a.compareTo(w.ZERO)<=0);var l=s.modInverse(i).multiply(o.add(r.multiply(a))).mod(i);return this.serializeSig(a,l)},this.verifyWithMessageHash=function(e,t){return this.verifyHex(e,t,this.pubKeyHex)},this.verifyHex=function(e,t,o){try{var s,a,l=i.parseSigHex(t);s=l.r,a=l.s;var u=r.decodeFromHex(this.ecparams.curve,o),c=new n(e.substring(0,this.ecparams.keycharlen),16);return this.verifyRaw(c,s,a,u)}catch(e){return!1}},this.verify=function(e,t,i){var o,s,a;if(Bitcoin.Util.isArray(t)){var l=this.parseSig(t);o=l.r,s=l.s}else{if("object"!=typeof t||!t.r||!t.s)throw"Invalid value for signature";o=t.r,s=t.s}if(i instanceof re)a=i;else{if(!Bitcoin.Util.isArray(i))throw"Invalid format for pubkey value, must be byte array or ECPointFp";a=r.decodeFrom(this.ecparams.curve,i)}var u=n.fromByteArrayUnsigned(e);return this.verifyRaw(u,o,s,a)},this.verifyRaw=function(e,t,r,i){var o=this.ecparams.n,s=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 a=r.modInverse(o),l=e.multiply(a).mod(o),u=t.multiply(a).mod(o);return s.multiply(l).add(i.multiply(u)).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===u(e))throw new Error("not ASN.1 hex string");var t,n,r;try{t=l(e,0,["[0]",0],"06"),n=l(e,0,[1],"04");try{r=l(e,0,["[1]",0],"03")}catch(e){}}catch(e){throw new Error("malformed PKCS#1/5 plain ECC private key")}if(this.curveName=s(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===u(e))throw new t("not ASN.1 hex string");var n,r,i;try{l(e,0,[1,0],"06"),n=l(e,0,[1,1],"06"),r=l(e,0,[2,0,1],"04");try{i=l(e,0,[2,0,"[1]",0],"03")}catch(e){}}catch(e){throw new t("malformed PKCS#8 plain ECC private key")}if(this.curveName=s(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===u(e))throw new t("not ASN.1 hex string");var n,r;try{l(e,0,[0,0],"06"),n=l(e,0,[0,1],"06"),r=l(e,0,[1],"03")}catch(e){throw new t("malformed PKCS#8 ECC public key")}if(this.curveName=s(n),null===this.curveName)throw new t("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(r)},this.readCertPubKeyHex=function(e,n){if(!1===u(e))throw new t("not ASN.1 hex string");var r,i;try{r=l(e,0,[0,5,0,1],"06"),i=l(e,0,[0,5,1],"03")}catch(e){throw new t("malformed X.509 certificate ECC public key")}if(this.curveName=s(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))},se.crypto.ECDSA.parseSigHex=function(e){var t=se.crypto.ECDSA.parseSigHexInHexRS(e);return{r:new w(t.r,16),s:new w(t.s,16)}},se.crypto.ECDSA.parseSigHexInHexRS=function(e){var t=ue,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],s=i[1];if("02"!=e.substr(o,2))throw new Error("1st item not ASN.1 integer");if("02"!=e.substr(s,2))throw new Error("2nd item not ASN.1 integer");return{r:r(e,o),s:r(e,s)}},se.crypto.ECDSA.asn1SigToConcatSig=function(e){var t=se.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},se.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 se.crypto.ECDSA.hexRSSigToASN1Sig(t,n)},se.crypto.ECDSA.hexRSSigToASN1Sig=function(e,t){var n=new w(e,16),r=new w(t,16);return se.crypto.ECDSA.biRSSigToASN1Sig(n,r)},se.crypto.ECDSA.biRSSigToASN1Sig=function(e,t){var n=se.asn1,r=new n.DERInteger({bigint:e}),i=new n.DERInteger({bigint:t});return new n.DERSequence({array:[r,i]}).tohex()},se.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!==se&&se||(se={}),void 0!==se.crypto&&se.crypto||(se.crypto={}),se.crypto.ECParameterDB=new function(){var e={},t={};function n(e){return new w(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,s,a,l,u,c,h,p,d,f){e[r]={};var g=n(o),m=n(s),v=n(a),y=n(l),b=n(u),$=new ie(g,m,v),w=$.decodePointHex("04"+c+h);e[r].name=r,e[r].keylen=i,e[r].keycharlen=2*Math.ceil(i/8),e[r].curve=$,e[r].G=w,e[r].n=y,e[r].h=b,e[r].oid=d,e[r].info=f;for(var x=0;x<p.length;x++)t[p[x]]=r}},se.crypto.ECParameterDB.regist("secp128r1",128,"FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF","FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC","E87579C11079F43DD824993C2CEE5ED3","FFFFFFFE0000000075A30D1B9038A115","1","161FF7528B899B2D0C28607CA52C5B86","CF5AC8395BAFEB13C02DA292DDED7A83",[],"","secp128r1 : SECG curve over a 128 bit prime field"),se.crypto.ECParameterDB.regist("secp160k1",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73","0","7","0100000000000000000001B8FA16DFAB9ACA16B6B3","1","3B4C382CE37AA192A4019E763036F4F5DD4D7EBB","938CF935318FDCED6BC28286531733C3F03C4FEE",[],"","secp160k1 : SECG curve over a 160 bit prime field"),se.crypto.ECParameterDB.regist("secp160r1",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC","1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45","0100000000000000000001F4C8F927AED3CA752257","1","4A96B5688EF573284664698968C38BB913CBFC82","23A628553168947D59DCC912042351377AC5FB32",[],"","secp160r1 : SECG curve over a 160 bit prime field"),se.crypto.ECParameterDB.regist("secp192k1",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37","0","3","FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D","1","DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D","9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D",[]),se.crypto.ECParameterDB.regist("secp192r1",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC","64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1","FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831","1","188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012","07192B95FFC8DA78631011ED6B24CDD573F977A11E794811",[]),se.crypto.ECParameterDB.regist("secp224r1",224,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE","B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4","FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D","1","B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21","BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34",[]),se.crypto.ECParameterDB.regist("secp256k1",256,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F","0","7","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141","1","79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798","483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8",[]),se.crypto.ECParameterDB.regist("secp256r1",256,"FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF","FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC","5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B","FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551","1","6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296","4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5",["NIST P-256","P-256","prime256v1"]),se.crypto.ECParameterDB.regist("secp384r1",384,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFC","B3312FA7E23EE7E4988E056BE3F82D19181D9C6EFE8141120314088F5013875AC656398D8A2ED19D2A85C8EDD3EC2AEF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973","1","AA87CA22BE8B05378EB1C71EF320AD746E1D3B628BA79B9859F741E082542A385502F25DBF55296C3A545E3872760AB7","3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f",["NIST P-384","P-384"]),se.crypto.ECParameterDB.regist("secp521r1",521,"1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF","1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC","051953EB9618E1C9A1F929A21A0B68540EEA2DA725B99B315F3B8B489918EF109E156193951EC7E937B1652C0BD3BB1BF073573DF883D2C34F1EF451FD46B503F00","1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409","1","00C6858E06B70404E9CD9E3ECB662395B4429C648139053FB521F828AF606B4D3DBAA14B5E77EFE75928FE1DC127A2FFA8DE3348B3C1856A429BF97E7E31C2E5BD66","011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650",["NIST P-521","P-521"]),void 0!==se&&se||(se={}),void 0!==se.crypto&&se.crypto||(se.crypto={}),se.crypto.DSA=function(){var e=ue,t=(e.getVbyList,e.getVbyListEx),n=e.isASN1HEX,r=w;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,s,a,l,u;o=new w(e,16),s=new w(t,16),a=new w(n,16),l="string"==typeof r&&r.length>1?new w(r,16):null,u=new w(i,16),this.setPrivate(o,s,a,l,u)},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,s,a;i=new w(e,16),o=new w(t,16),s=new w(n,16),a=new w(r,16),this.setPublic(i,o,s,a)},this.signWithMessageHash=function(e){var t=this.p,n=this.q,r=this.g,i=(this.y,this.x),o=se.crypto.Util.getRandomBigIntegerMinToMax(w.ONE.add(w.ONE),n.subtract(w.ONE)),s=new w(e.substr(0,n.bitLength()/4),16),a=r.modPow(o,t).mod(n),l=o.modInverse(n).multiply(s.add(i.multiply(a))).mod(n);return se.asn1.ASN1Util.jsonToASN1HEX({seq:[{int:{bigint:a}},{int:{bigint:l}}]})},this.verifyWithMessageHash=function(e,t){var n=this.p,r=this.q,i=this.g,o=this.y,s=this.parseASN1Signature(t),a=s[0],l=s[1],u=new w(e.substr(0,r.bitLength()/4),16);if(w.ZERO.compareTo(a)>0||a.compareTo(r)>0)throw"invalid DSA signature";if(w.ZERO.compareTo(l)>=0||l.compareTo(r)>0)throw"invalid DSA signature";var c=l.modInverse(r),h=u.multiply(c).mod(r),p=a.multiply(c).mod(r);return 0==i.modPow(h,n).multiply(o.modPow(p,n)).mod(n).mod(r).compareTo(a)},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,s,a;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"),s=t(e,0,[4],"02"),a=t(e,0,[5],"02")}catch(e){throw new Error("malformed PKCS#1/5 plain DSA private key")}this.setPrivateHex(r,i,o,s,a)},this.readPKCS8PrvKeyHex=function(e){var r,i,o,s;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"),s=t(e,0,[2,0],"02")}catch(e){throw new Error("malformed PKCS#8 plain DSA private key")}this.setPrivateHex(r,i,o,null,s)},this.readPKCS8PubKeyHex=function(e){var r,i,o,s;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"),s=t(e,0,[1,0],"02")}catch(e){throw new Error("malformed PKCS#8 DSA public key")}this.setPublicHex(r,i,o,s)},this.readCertPubKeyHex=function(e,r){var i,o,s,a;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"),s=t(e,0,[0,5,0,1,2],"02"),a=t(e,0,[0,5,1,0],"02")}catch(e){throw new Error("malformed X.509 certificate DSA public key")}this.setPublicHex(i,o,s,a)}};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),s=g.enc.Hex.parse(r),a={};a.key=o,a.iv=s,a.ciphertext=i;var l=e.decrypt(a,o,{iv:s});return g.enc.Hex.stringify(l)},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),s=g.enc.Hex.parse(r),a=e.encrypt(i,o,{iv:s}),l=g.enc.Hex.parse(a.toString());return g.enc.Base64.stringify(l)},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 s=e.indexOf("-----END");if(-1!=i&&-1!=s){var a=e.substring(i+2*o,s-o);a=a.replace(/\s+/g,""),t.data=a}return t},s=function(e,t,n){for(var r=n.substring(0,16),o=g.enc.Hex.parse(r),s=g.enc.Utf8.parse(t),a=i[e].keylen+i[e].ivlen,l="",u=null;;){var c=g.algo.MD5.create();if(null!=u&&c.update(u),c.update(s),c.update(o),u=c.finalize(),(l+=g.enc.Hex.stringify(u)).length>=2*a)break}var h={};return h.keyhex=l.substr(0,2*i[e].keylen),h.ivhex=l.substr(2*i[e].keylen,2*i[e].ivlen),h},a=function(e,t,n,r){var o=g.enc.Base64.parse(e),s=g.enc.Hex.stringify(o);return(0,i[t].proc)(s,n,r)};return{version:"1.0.0",parsePKCS5PEM:function(e){return o(e)},getKeyAndUnusedIvByPasscodeAndIvsalt:function(e,t,n){return s(e,t,n)},decryptKeyB64:function(e,t,n,r){return a(e,t,n,r)},getDecryptedKeyHex:function(e,t){var n=o(e),r=(n.type,n.cipher),i=n.ivsalt,l=n.data,u=s(r,t,i).keyhex;return a(l,r,u,i)},getEncryptedPKCS5PEMFromPrvKeyHex:function(e,t,n,r,o){var a="";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 l=function(e,t,n,r){return(0,i[t].eproc)(e,n,r)}(t,r,s(r,n,o).keyhex,o);a="-----BEGIN "+e+" PRIVATE KEY-----\r\n";return a+="Proc-Type: 4,ENCRYPTED\r\n",a+="DEK-Info: "+r+","+o+"\r\n",a+="\r\n",a+=l.replace(/(.{64})/g,"$1\r\n"),a+="\r\n-----END "+e+" PRIVATE KEY-----\r\n"},getEncryptedPKCS8PEM:function(e,t,n){return Ce(this.getEncryptedPKCS8Hex(e,t,n),"ENCRYPTED PRIVATE KEY")},getEncryptedPKCS8Hex:function(e,t,n){var r;(r=null==n||null==n?{}:JSON.parse(JSON.stringify(n))).plain=e,this.initPBES2Param(r),this.encryptPBES2Param(r,t);var i=this.generatePBES2ASN1Param(r);return se.asn1.ASN1Util.newObject(i).tohex()},initPBES2Param:function(e){var t;(null==Ze(e,"encalg")&&(e.encalg="aes256-CBC"),null==Ze(e,"iter")&&(e.iter=2048),null==Ze(e,"prf")&&(e.prf="hmacWithSHA256"),null==Ze(e,"salt")&&(e.salt=g.enc.Hex.stringify(g.lib.WordArray.random(8))),null==Ze(e,"enciv"))&&("des-EDE3-CBC"==e.encalg&&(t=8),"aes128-CBC"==e.encalg&&(t=16),"aes256-CBC"==e.encalg&&(t=16),e.enciv=g.enc.Hex.stringify(g.lib.WordArray.random(t)))},encryptPBES2Param:function(e,t){var n=tt.getDKFromPBES2Param(e,t);try{var r=se.crypto.Cipher.encrypt(e.plain,n,e.encalg,{iv:e.enciv})}catch(t){throw new Error("encrypt error: "+e.plain+" "+n+" "+e.encalg+" "+e.enciv)}e.enc=r},generatePBES2ASN1Param:function(e){var t={seq:[{seq:[{oid:"pkcs5PBES2"},{seq:[{seq:[{oid:"pkcs5PBKDF2"},{seq:[{octstr:{hex:e.salt}},{int:{hex:Ke(e.iter)}}]}]},{seq:[{oid:e.encalg},{octstr:{hex:e.enciv}}]}]}]},{octstr:{hex:e.enc}}]};return"hmacWithSHA1"!=e.prf&&t.seq[0].seq[1].seq[0].seq[1].seq.push({seq:[{oid:e.prf},{null:""}]}),t},parseHexOfEncryptedPKCS8:function(e){var t=ue,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 s=n(e,o[0]);if(2!=s.length)throw new Error("malformed format: SEQUENCE(0.0).items != 2: "+s.length);if("2a864886f70d01050d"!=r(e,s[0]))throw new Error("this only supports pkcs5PBES2");var a=n(e,s[1]);if(2!=s.length)throw new Error("malformed format: SEQUENCE(0.0.1).items != 2: "+a.length);var l=n(e,a[1]);if(2!=l.length)throw new Error("malformed format: SEQUENCE(0.0.1.1).items != 2: "+l.length);if("2a864886f70d0307"!=r(e,l[0]))throw"this only supports TripleDES";i.encryptionSchemeAlg="TripleDES",i.encryptionSchemeIV=r(e,l[1]);var u=n(e,a[0]);if(2!=u.length)throw new Error("malformed format: SEQUENCE(0.0.1.0).items != 2: "+u.length);if("2a864886f70d01050c"!=r(e,u[0]))throw new Error("this only supports pkcs5PBKDF2");var c=n(e,u[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 h=r(e,c[1]);try{i.pbkdf2Iter=parseInt(h,16)}catch(e){throw new Error("malformed format pbkdf2Iter: "+h)}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 s=g.enc.Hex.parse(i),a=g.enc.Hex.parse(r.encryptionSchemeIV),l=g.TripleDES.decrypt(o,s,{iv:a});return g.enc.Hex.stringify(l)},parsePBES2:function(e){var t=ue.parse(e);if("pkcs5PBES2"!=Ze(t,"seq.0.seq.0.oid")||"pkcs5PBKDF2"!=Ze(t,"seq.0.seq.1.seq.0.seq.0.oid"))throw new Error("not pkcs5PBES2 and pkcs5PBKDF2 used");var n=Ze(t,"seq.0.seq.1.seq.0.seq.1.seq");if(null==n)throw new Error("PBKDF2 parameter not found");var r=Ze(n,"0.octstr.hex"),i=Ze(n,"1.int.hex"),o=Ze(n,"2.seq.0.oid","hmacWithSHA1"),s=-1;try{s=parseInt(i,16)}catch(e){throw new Error("iter not proper value")}var a=Ze(t,"seq.0.seq.1.seq.1.seq.0.oid"),l=Ze(t,"seq.0.seq.1.seq.1.seq.1.octstr.hex"),u=Ze(t,"seq.1.octstr.hex");if(null==a||null==l||null==u)throw new Error("encalg, enciv or enc is undefined");return{salt:r,iter:s,prf:o,encalg:a,enciv:l,enc:u}},getDKFromPBES2Param:function(e,t){var n={hmacWithSHA1:g.algo.SHA1,hmacWithSHA224:g.algo.SHA224,hmacWithSHA256:g.algo.SHA256,hmacWithSHA384:g.algo.SHA384,hmacWithSHA512:g.algo.SHA512}[e.prf];if(null==n)throw new Error("unsupported prf");var r={"des-EDE3-CBC":6,"aes128-CBC":4,"aes256-CBC":8}[e.encalg];if(null==r)throw new Error("unsupported encalg");var i=g.enc.Hex.parse(e.salt),o=e.iter;try{var s=g.PBKDF2(t,i,{keySize:r,iterations:o,hasher:n});return g.enc.Hex.stringify(s)}catch(n){throw new Error("PBKDF2 error: "+n+" "+JSON.stringify(e)+" "+t)}},getPlainHexFromEncryptedPKCS8PEM:function(e,t){if(-1==e.indexOf("BEGIN ENCRYPTED PRIVATE KEY"))throw new Error("not Encrypted PKCS#8 PEM string");var n,r=Te(e);try{n=tt.parsePBES2(r)}catch(e){throw new Error("malformed PBES2 format: "+e.message)}var i=tt.getDKFromPBES2Param(n,t);return se.crypto.Cipher.decrypt(n.enc,i,n.encalg,{iv:n.enciv})},getKeyFromEncryptedPKCS8PEM:function(e,t){var n=this.getPlainHexFromEncryptedPKCS8PEM(e,t);return this.getKeyFromPlainPrivatePKCS8Hex(n)},parsePlainPrivatePKCS8Hex:function(e){var t=ue,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 s=n(e,o[1]);if(2!=s.length)throw new Error("malformed PKCS8 private key(code:004)");if("06"!=e.substr(s[0],2))throw new Error("malformed PKCS8 private key(code:005)");if(i.algoid=r(e,s[0]),"06"==e.substr(s[1],2)&&(i.algparam=r(e,s[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 te;else if("2a8648ce380401"==n.algoid)t=new se.crypto.DSA;else{if("2a8648ce3d0201"!=n.algoid)throw new Error("unsupported private key algorithm");t=new se.crypto.ECDSA}return t.readPKCS8PrvKeyHex(e),t},_getKeyFromPublicPKCS8Hex:function(e){var t,n=ue.getVbyList(e,0,[0,0],"06");if("2a864886f70d010101"===n)t=new te;else if("2a8648ce380401"===n)t=new se.crypto.DSA;else{if("2a8648ce3d0201"!==n)throw new Error("unsupported PKCS#8 public key hex");t=new se.crypto.ECDSA}return t.readPKCS8PubKeyHex(e),t},parsePublicRawRSAKeyHex:function(e){var t=ue,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=ue,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 s=o[0];if("30"!=e.substr(s,2))throw new Error("malformed PKCS8 public key(code:001)");var a=n(e,s);if(2!=a.length)throw new Error("malformed PKCS8 public key(code:002)");if("06"!=e.substr(a[0],2))throw new Error("malformed PKCS8 public key(code:003)");if(i.algoid=r(e,a[0]),"06"==e.substr(a[1],2)?i.algparam=r(e,a[1]):"30"==e.substr(a[1],2)&&(i.algparam={},i.algparam.p=t.getVbyList(e,a[1],[0],"02"),i.algparam.q=t.getVbyList(e,a[1],[1],"02"),i.algparam.g=t.getVbyList(e,a[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=ue).getChildIdx,i=(m.getV,m.getVbyList),o=se.crypto,s=o.ECDSA,a=o.DSA,l=te,u=Te,c=tt;if(void 0!==l&&e instanceof l)return e;if(void 0!==s&&e instanceof s)return e;if(void 0!==a&&e instanceof a)return e;if(void 0!==e.curve&&void 0!==e.xy&&void 0===e.d)return new s({pub:e.xy,curve:e.curve});if(void 0!==e.curve&&void 0!==e.d)return new s({prv:e.d,curve:e.curve});if(void 0===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0===e.d)return(F=new l).setPublic(e.n,e.e),F;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(F=new l).setPrivateEx(e.n,e.e,e.d,e.p,e.q,e.dp,e.dq,e.co),F;if(void 0===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0!==e.d&&void 0===e.p)return(F=new l).setPrivate(e.n,e.e,e.d),F;if(void 0!==e.p&&void 0!==e.q&&void 0!==e.g&&void 0!==e.y&&void 0===e.x)return(F=new a).setPublic(e.p,e.q,e.g,e.y),F;if(void 0!==e.p&&void 0!==e.q&&void 0!==e.g&&void 0!==e.y&&void 0!==e.x)return(F=new a).setPrivate(e.p,e.q,e.g,e.y,e.x),F;if("RSA"===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0===e.d)return(F=new l).setPublic(ve(e.n),ve(e.e)),F;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(F=new l).setPrivateEx(ve(e.n),ve(e.e),ve(e.d),ve(e.p),ve(e.q),ve(e.dp),ve(e.dq),ve(e.qi)),F;if("RSA"===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0!==e.d)return(F=new l).setPrivate(ve(e.n),ve(e.e),ve(e.d)),F;if("EC"===e.kty&&void 0!==e.crv&&void 0!==e.x&&void 0!==e.y&&void 0===e.d){var h=(T=new s({curve:e.crv})).ecparams.keycharlen,p="04"+("0000000000"+ve(e.x)).slice(-h)+("0000000000"+ve(e.y)).slice(-h);return T.setPublicKeyHex(p),T}if("EC"===e.kty&&void 0!==e.crv&&void 0!==e.x&&void 0!==e.y&&void 0!==e.d){h=(T=new s({curve:e.crv})).ecparams.keycharlen,p="04"+("0000000000"+ve(e.x)).slice(-h)+("0000000000"+ve(e.y)).slice(-h);var d=("0000000000"+ve(e.d)).slice(-h);return T.setPublicKeyHex(p),T.setPrivateKeyHex(d),T}if("pkcs5prv"===n){var f,g=e,m=ue;if(9===(f=r(g,0)).length)(F=new l).readPKCS5PrvKeyHex(g);else if(6===f.length)(F=new a).readPKCS5PrvKeyHex(g);else{if(!(f.length>2&&"04"===g.substr(f[1],2)))throw new Error("unsupported PKCS#1/5 hexadecimal key");(F=new s).readPKCS5PrvKeyHex(g)}return F}if("pkcs8prv"===n)return F=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=u(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=u(e,"DSA PRIVATE KEY"),0,[1],"02"),$=i(R,0,[2],"02"),x=i(R,0,[3],"02"),S=i(R,0,[4],"02"),E=i(R,0,[5],"02");return(F=new a).setPrivate(new w(b,16),new w($,16),new w(x,16),new w(S,16),new w(E,16)),F}if(-1!=e.indexOf("-END EC PRIVATE KEY-")&&-1==e.indexOf("4,ENCRYPTED")){y=u(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 A=c.getDecryptedKeyHex(e,t),C=new te;return C.readPKCS5PrvKeyHex(A),C}if(-1!=e.indexOf("-END EC PRIVATE KEY-")&&-1!=e.indexOf("4,ENCRYPTED")){var T,F=i(R=c.getDecryptedKeyHex(e,t),0,[1],"04"),k=i(R,0,[2,0],"06"),D=i(R,0,[3,0],"03").substr(2);if(void 0===se.crypto.OID.oidhex2name[k])throw new Error("undefined OID(hex) in KJUR.crypto.OID: "+k);return(T=new s({curve:se.crypto.OID.oidhex2name[k]})).setPublicKeyHex(D),T.setPrivateKeyHex(F),T.isPublic=!1,T}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"),$=i(R,0,[2],"02"),x=i(R,0,[3],"02"),S=i(R,0,[4],"02"),E=i(R,0,[5],"02");return(F=new a).setPrivate(new w(b,16),new w($,16),new w(x,16),new w(S,16),new w(E,16)),F}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;(s=new te).generate(n,"10001"),s.isPrivate=!0,s.isPublic=!0;var r=new te,i=s.n.toString(16),o=s.e.toString(16);return r.setPublic(i,o),r.isPrivate=!1,r.isPublic=!0,(a={}).prvKeyObj=s,a.pubKeyObj=r,a}if("EC"==e){var s,a,l=t,u=new se.crypto.ECDSA({curve:l}).generateKeyPairHex();return(s=new se.crypto.ECDSA({curve:l})).setPublicKeyHex(u.ecpubhex),s.setPrivateKeyHex(u.ecprvhex),s.isPrivate=!0,s.isPublic=!1,(r=new se.crypto.ECDSA({curve:l})).setPublicKeyHex(u.ecpubhex),r.isPrivate=!1,r.isPublic=!0,(a={}).prvKeyObj=s,a.pubKeyObj=r,a}throw new Error("unknown algorithm: "+e)},tt.getPEM=function(e,t,n,r,i,o){var s=se,a=s.asn1,l=a.DERObjectIdentifier,u=a.DERInteger,c=a.ASN1Util.newObject,h=a.x509.SubjectPublicKeyInfo,p=s.crypto,d=p.DSA,f=p.ECDSA,g=te;function m(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 v(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 y(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!==g&&e instanceof g||void 0!==d&&e instanceof d||void 0!==f&&e instanceof f)&&1==e.isPublic&&(void 0===t||"PKCS8PUB"==t))return Ce(x=new h(e).tohex(),"PUBLIC KEY");if("PKCS1PRV"==t&&void 0!==g&&e instanceof g&&(void 0===n||null==n)&&1==e.isPrivate)return Ce(x=m(e).tohex(),"RSA PRIVATE KEY");if("PKCS1PRV"==t&&void 0!==f&&e instanceof f&&(void 0===n||null==n)&&1==e.isPrivate){var b=new l({name:e.curveName}).tohex(),$=v(e).tohex(),w="";return w+=Ce(b,"EC PARAMETERS"),w+=Ce($,"EC PRIVATE KEY")}if("PKCS1PRV"==t&&void 0!==d&&e instanceof d&&(void 0===n||null==n)&&1==e.isPrivate)return Ce(x=y(e).tohex(),"DSA PRIVATE KEY");if("PKCS5PRV"==t&&void 0!==g&&e instanceof g&&void 0!==n&&null!=n&&1==e.isPrivate){var x=m(e).tohex();return void 0===r&&(r="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("RSA",x,n,r,o)}if("PKCS5PRV"==t&&void 0!==f&&e instanceof f&&void 0!==n&&null!=n&&1==e.isPrivate){x=v(e).tohex();return void 0===r&&(r="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("EC",x,n,r,o)}if("PKCS5PRV"==t&&void 0!==d&&e instanceof d&&void 0!==n&&null!=n&&1==e.isPrivate){x=y(e).tohex();return void 0===r&&(r="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("DSA",x,n,r,o)}var S=function(e,t){if("string"==typeof t)return tt.getEncryptedPKCS8PEM(e,t);if("object"==typeof t&&null!=Ze(t,"passcode")){var n=JSON.parse(JSON.stringify(t)),r=n.passcode;return delete n.passcode,tt.getEncryptedPKCS8PEM(e,r,n)}};if("PKCS8PRV"==t&&null!=g&&e instanceof g&&1==e.isPrivate){var E=m(e).tohex();x=c({seq:[{int:0},{seq:[{oid:{name:"rsaEncryption"}},{null:!0}]},{octstr:{hex:E}}]}).tohex();return void 0===n||null==n?Ce(x,"PRIVATE KEY"):S(x,n)}if("PKCS8PRV"==t&&void 0!==f&&e instanceof f&&1==e.isPrivate){var A={seq:[{int:1},{octstr:{hex:e.prvKeyHex}}]};"string"==typeof e.pubKeyHex&&A.seq.push({tag:["a1",!0,{bitstr:{hex:"00"+e.pubKeyHex}}]});E=new c(A).tohex(),x=c({seq:[{int:0},{seq:[{oid:{name:"ecPublicKey"}},{oid:{name:e.curveName}}]},{octstr:{hex:E}}]}).tohex();return void 0===n||null==n?Ce(x,"PRIVATE KEY"):S(x,n)}if("PKCS8PRV"==t&&void 0!==d&&e instanceof d&&1==e.isPrivate){E=new u({bigint:e.x}).tohex(),x=c({seq:[{int:0},{seq:[{oid:{name:"dsa"}},{seq:[{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.g}}]}]},{octstr:{hex:E}}]}).tohex();return void 0===n||null==n?Ce(x,"PRIVATE KEY"):S(x,n)}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=ue,n=t.getChildIdx,r=t.getTLV,i={},o=e;if("30"!=o.substr(0,2))throw new Error("malformed CSR(code:001)");var s=n(o,0);if(s.length<1)throw new Error("malformed CSR(code:002)");if("30"!=o.substr(s[0],2))throw new Error("malformed CSR(code:003)");var a=n(o,s[0]);if(a.length<3)throw new Error("malformed CSR(code:004)");return i.p8pubkeyhex=r(o,a[2]),i},tt.getKeyID=function(e){var t=tt,n=ue;"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 se.crypto.Util.hashHex(o,"sha1")},tt.getJWK=function(e,t,n,r,i){var o,s,a={},l=se.crypto.Util.hashHex;if("string"==typeof e)o=tt.getKey(e),-1!=e.indexOf("CERTIFICATE")&&(s=Te(e));else{if("object"!=typeof e)throw new Error("unsupported keyinfo type");e instanceof ot?(o=e.getPublicKey(),s=e.hex):o=e}if(o instanceof te&&o.isPrivate)a.kty="RSA",a.n=me(o.n.toString(16)),a.e=me(o.e.toString(16)),a.d=me(o.d.toString(16)),a.p=me(o.p.toString(16)),a.q=me(o.q.toString(16)),a.dp=me(o.dmp1.toString(16)),a.dq=me(o.dmq1.toString(16)),a.qi=me(o.coeff.toString(16));else if(o instanceof te&&o.isPublic)a.kty="RSA",a.n=me(o.n.toString(16)),a.e=me(o.e.toString(16));else if(o instanceof se.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 u=o.getPublicKeyXYHex();a.kty="EC",a.crv=c,a.x=me(u.x),a.y=me(u.y),a.d=me(o.prvKeyHex)}else if(o instanceof se.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);u=o.getPublicKeyXYHex();a.kty="EC",a.crv=c,a.x=me(u.x),a.y=me(u.y)}if(null==a.kty)throw new Error("unsupported keyinfo");return o.isPrivate||1==t||(a.kid=se.jws.JWS.getJWKthumbprint(a)),null!=s&&1!=n&&(a.x5c=[y(s)]),null!=s&&1!=r&&(a.x5t=fe(y(l(s,"sha1")))),null!=s&&1!=i&&(a["x5t#S256"]=fe(y(l(s,"sha256")))),a},tt.getJWKFromKey=function(e){return tt.getJWK(e,!0,!0,!0,!0)},te.getPosArrayOfChildrenFromHex=function(e){return ue.getChildIdx(e,0)},te.getHexValueArrayOfChildrenFromHex=function(e){var t,n=ue.getV,r=n(e,(t=te.getPosArrayOfChildrenFromHex(e))[0]),i=n(e,t[1]),o=n(e,t[2]),s=n(e,t[3]),a=n(e,t[4]),l=n(e,t[5]),u=n(e,t[6]),c=n(e,t[7]),h=n(e,t[8]);return(t=new Array).push(r,i,o,s,a,l,u,c,h),t},te.prototype.readPrivateKeyFromPEMString=function(e){var t=Te(e),n=te.getHexValueArrayOfChildrenFromHex(t);this.setPrivateEx(n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8])},te.prototype.readPKCS5PrvKeyHex=function(e){var t=te.getHexValueArrayOfChildrenFromHex(e);this.setPrivateEx(t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},te.prototype.readPKCS8PrvKeyHex=function(e){var t,n,r,i,o,s,a,l,u=ue,c=u.getVbyListEx;if(!1===u.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"),s=c(e,0,[2,0,6],"02"),a=c(e,0,[2,0,7],"02"),l=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,s,a,l)},te.prototype.readPKCS5PubKeyHex=function(e){var t=ue,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)},te.prototype.readPKCS8PubKeyHex=function(e){var t=ue;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)},te.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+=we(n(xe(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 se.crypto.Util.DIGESTINFOHEAD){var n=se.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=ue,r=n.getChildIdx,i=n.getV,o=(n.dump,n.parse),s=n.getTLV,a=n.getVbyList,l=n.getVbyListEx,u=n.getTLVbyList,c=n.getTLVbyListEx,h=n.getIdxbyList,p=n.getIdxbyListEx,d=n.getVidx,f=n.getInt,g=n.oidname,m=n.hextooidstr,v=Te,y=Error;try{t=se.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=u(this.hex,0,[0,0]);if("a0"==e.substr(0,2)){var t=u(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 l(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(l(e,0,[0],"06"))},this.getIssuer=function(e,t){return this.getX500Name(this.getIssuerHex(),e,t)},this.getIssuerHex=function(){return u(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 u(this.hex,0,[0,5+this.foffset],"30")},this.getSubjectString=function(){return this.getSubject().str},this.getNotBefore=function(){var e=a(this.hex,0,[0,4+this.foffset,0]);return e=e.replace(/(..)/g,"%$1"),e=decodeURIComponent(e)},this.getNotAfter=function(){var e=a(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 u(this.hex,0,[0,6+this.foffset],"30")},this.getSPKIValue=function(){var e=this.getSPKI();return null==e?null:a(e,0,[1],"03",!0)},this.getPublicKeyIdx=function(){return h(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyContentIdx=function(){var e=this.getPublicKeyIdx();return h(this.hex,e,[1,0],"30")},this.getPublicKey=function(){return tt.getKey(this.getPublicKeyHex(),null,"pkcs8pub")},this.getSignatureAlgorithmName=function(){var e=u(this.hex,0,[1],"30");return this.getAlgorithmIdentifierName(e)},this.getSignatureValueHex=function(){return a(this.hex,0,[2],"03",!0)},this.verifySignature=function(e){var t=this.getSignatureAlgorithmField(),n=this.getSignatureValueHex(),r=u(this.hex,0,[0],"30"),i=new se.crypto.Signature({alg:t});return i.init(e),i.updateHex(r),i.verify(n)},this.parseExt=function(e){var t,o,s;if(void 0===e){if(s=this.hex,3!==this.version)return-1;t=h(s,0,[0,7,0],"30"),o=r(s,t)}else{s=Te(e);var l=h(s,0,[0,3,0,0],"06");if("2a864886f70d01090e"!=i(s,l))return void(this.aExtInfo=new Array);t=h(s,0,[0,3,0,1,0],"30"),o=r(s,t),this.hex=s}this.aExtInfo=new Array;for(var u=0;u<o.length;u++){var c={critical:!1},p=0;3===r(s,o[u]).length&&(c.critical=!0,p=1),c.oid=n.hextooidstr(a(s,o[u],[0],"06"));var f=h(s,o[u],[1+p]);c.vidx=d(s,f),this.aExtInfo.push(c)}},this.getExtInfo=function(e){var t=this.aExtInfo,n=e;if(e.match(/^[0-9.]+$/)||(n=se.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]:[s(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=s(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),a=parseInt(o,16);return r.cA=!0,r.pathLen=a,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),a=0;a<o.length;a++){for(var l=[],u=r(e,o[a]),c=0;c<u.length;c++){var h=s(e,u[c]),p=this.getGeneralSubtree(h);l.push(p)}var d=e.substr(o[a],2);"a0"==d?i.permit=l:"a1"==d&&(i.exclude=l)}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(s(e,t[0])),a=1;a<n;a++){var l=e.substr(t[a],2),u=i(e,t[a]),c=parseInt(u,16);"80"==l&&(o.min=c),"81"==l&&(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=s(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=s(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=s(this.hex,n.vidx),t=n.critical}var o={extname:"authorityKeyIdentifier"};t&&(o.critical=!0);for(var a=r(e,0),l=0;l<a.length;l++){var u=e.substr(a[l],2);if("80"===u&&(o.kid={hex:i(e,a[l])}),"a1"===u){var c=s(e,a[l]),h=this.getGeneralNames(c);o.issuer=h[0].dn}"82"===u&&(o.sn={hex:i(e,a[l])})}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=s(this.hex,n.vidx),t=n.critical}var o={extname:"extKeyUsage",array:[]};t&&(o.critical=!0);for(var a=r(e,0),l=0;l<a.length;l++)o.array.push(g(i(e,a[l])));return o},this.getExtExtKeyUsageName=function(){var e=this.getExtInfo("extKeyUsage");if(void 0===e)return e;var t=new Array,n=s(this.hex,e.vidx);if(""===n)return t;for(var o=r(n,0),a=0;a<o.length;a++)t.push(g(i(n,o[a])));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=s(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=s(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(s(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=we(n);return"81"==t?{rfc822:r}:"82"==t?{dns:r}:"86"==t?{uri:r}:"87"==t?{ip:_e(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 a=new Array,l=s(this.hex,o.vidx),u=r(l,0),c=0;c<u.length;c++)n=l.substr(u[c],2),e=i(l,u[c]),"81"===n&&(t=be(e),a.push(["MAIL",t])),"82"===n&&(t=be(e),a.push(["DNS",t])),"84"===n&&(t=ot.hex2dn(e,0),a.push(["DN",t])),"86"===n&&(t=be(e),a.push(["URI",t])),"87"===n&&(t=_e(e),a.push(["IP",t]));return a},this.getExtCRLDistributionPoints=function(e,t){if(void 0===e&&void 0===t){var n=this.getExtInfo("cRLDistributionPoints");if(void 0===n)return;e=s(this.hex,n.vidx),t=n.critical}var i={extname:"cRLDistributionPoints",array:[]};t&&(i.critical=!0);for(var o=r(e,0),a=0;a<o.length;a++){var l=s(e,o[a]);i.array.push(this.getDistributionPoint(l))}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),a=s(e,n[i]);"a0"==o&&(t.dpname=this.getDistributionPointName(a))}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),a=s(e,n[i]);"a0"==o&&(t.full=this.getGeneralNames(a))}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=a(this.hex,n[i],[0],"06"),s=a(this.hex,n[i],[1],"86");"2b06010505073001"===o&&t.ocsp.push(be(s)),"2b06010505073002"===o&&t.caissuer.push(be(s))}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=s(this.hex,n.vidx),t=n.critical}var i={extname:"authorityInfoAccess",array:[]};t&&(i.critical=!0);for(var o=r(e,0),u=0;u<o.length;u++){var c=l(e,o[u],[0],"06"),h=be(a(e,o[u],[1],"86"));if("2b06010505073001"==c)i.array.push({ocsp:h});else{if("2b06010505073002"!=c)throw new Error("unknown method: "+c);i.array.push({caissuer:h})}}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=s(this.hex,n.vidx),t=n.critical}var i={extname:"certificatePolicies",array:[]};t&&(i.critical=!0);for(var o=r(e,0),a=0;a<o.length;a++){var l=s(e,o[a]),u=this.getPolicyInformation(l);i.array.push(u)}return i},this.getPolicyInformation=function(e){var t={},n=a(e,0,[0],"06");t.policyoid=g(n);var i=p(e,0,[1],"30");if(-1!=i){t.array=[];for(var o=r(e,i),l=0;l<o.length;l++){var u=s(e,o[l]),c=this.getPolicyQualifierInfo(u);t.array.push(c)}}return t},this.getOtherName=function(e){var t={},n=r(e,0),i=a(e,n[0],[],"06"),s=a(e,n[1],[]);return t.oid=g(i),t.value=o(s),t},this.getPolicyQualifierInfo=function(e){var t={},n=a(e,0,[0],"06");if("2b06010505070201"===n){var r=l(e,0,[1],"16");t.cps=we(r)}else if("2b06010505070202"===n){var i=u(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=Ze(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=Ze(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=Ze(e,"seq"),n=[],r=0;r<t.length;r++){var i=t[r];n.push(parseInt(Ze(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=we(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,s=[],a=0;a<i.length;a++){var l=i[a].seq;s.push([l[0].oid,l[1].oid])}r.array=s}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 s=i.seq,a=0;a<s.length;a++){var l=s[a].tag;0==l.explicit&&("80"==l.tag&&(r.reqexp=parseInt(l.hex,16)),"81"==l.tag&&(r.inhibit=parseInt(l.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=s(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 a=s(e,o[1]),l=this.getGeneralName(a);null!=l.uri&&(i.uri=l.uri)}if(o.length>2){var u=s(e,o[2]);"0101ff"==u&&(i.reqauth=!0),"010100"==u&&(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=s(this.hex,n.vidx),t=n.critical}var r={extname:"subjectDirectoryAttributes"};t&&(r.critical=!0);try{for(var i=o(e),a=[],l=0;l<i.seq.length;l++){var u=i.seq[l],c=Ze(u,"seq.0.oid"),h=Ze(u,"seq.1.set");if(null==c||null==h)throw"error";a.push({attr:c,array:h})}return r.array=a,r}catch(e){throw new Error("malformed subjectDirectoryAttributes extension value")}};var b=function(e){var t={};try{var n=e.seq[0].oid,r=se.asn1.x509.OID.name2oid(n);t.type=se.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")}},$=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 s=n[r],a=s.ds,l=s.value,u=s.type;if(":"+a,"prn"!=a&&"utf8"!=a&&"ia5"!=a)return"mixed";if("ia5"==a){if("CN"!=u)return"mixed";if(se.lang.String.isMail(l))continue;return"mixed"}if("C"==u){if("prn"==a)continue;return"mixed"}if(":"+a,null==t)t=a;else if(t!==a)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 $(t)},this.getX500NameArray=function(e){return function(e){try{return e.seq.map((function(e){return $(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{h(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=Ce(this.getPublicKeyHex(),"PUBLIC KEY"),null!=this.aExtInfo&&this.aExtInfo.length>0&&(t.ext=this.getExtParamArray()),t.sighex=this.getSignatureValueHex(),1==e.tbshex&&(t.tbshex=u(this.hex,0,[0])),1==e.nodnarray&&(delete t.issuer.array,delete t.subject.array),t},this.getExtParamArray=function(e){null==e&&(-1!=p(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=s(e,n[i]),a=this.getExtParam(o);null!=a&&t.push(a)}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(a(e,0,[0],"06")),i=!1;3==t&&"0101ff"==u(e,0,[1])&&(i=!0);var s=u(e,0,[t-1,0]),l=void 0;if("2.5.29.14"==n?l=this.getExtSubjectKeyIdentifier(s,i):"2.5.29.15"==n?l=this.getExtKeyUsage(s,i):"2.5.29.17"==n?l=this.getExtSubjectAltName(s,i):"2.5.29.18"==n?l=this.getExtIssuerAltName(s,i):"2.5.29.19"==n?l=this.getExtBasicConstraints(s,i):"2.5.29.30"==n?l=this.getExtNameConstraints(s,i):"2.5.29.31"==n?l=this.getExtCRLDistributionPoints(s,i):"2.5.29.32"==n?l=this.getExtCertificatePolicies(s,i):"2.5.29.33"==n?l=this.getExtPolicyMappings(s,i):"2.5.29.35"==n?l=this.getExtAuthorityKeyIdentifier(s,i):"2.5.29.36"==n?l=this.getExtPolicyConstraints(s,i):"2.5.29.37"==n?l=this.getExtExtKeyUsage(s,i):"2.5.29.54"==n?l=this.getExtInhibitAnyPolicy(s,i):"1.3.6.1.5.5.7.1.1"==n?l=this.getExtAuthorityInfoAccess(s,i):"2.5.29.20"==n?l=this.getExtCRLNumber(s,i):"2.5.29.21"==n?l=this.getExtCRLReason(s,i):"2.5.29.9"==n?l=this.getExtSubjectDirectoryAttributes(s,i):"1.3.6.1.5.5.7.48.1.2"==n?l=this.getExtOcspNonce(s,i):"1.3.6.1.5.5.7.48.1.5"==n?l=this.getExtOcspNoCheck(s,i):"1.2.840.113583.1.1.9.1"==n?l=this.getExtAdobeTimeStamp(s,i):null!=ot.EXT_PARSER[n]&&(l=ot.EXT_PARSER[n](n,i,s)),null!=l)return l;var c={extname:n,extn:s};try{c.extn=o(s)}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,s=0;s<o.length;s++){var a=o[i];null!=a.uri&&(a.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 se.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 s=r[o],a=s.value;a=(a=(a=(a=a.replace(/^\s*/,"")).replace(/\s*$/,"")).replace(/\s+/g," ")).toLowerCase(),i.push(s.type.toLowerCase()+"="+a)}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 s=i[o];if(null!=s.dn&&(t+=n+"dn: "+s.dn.str+r),null!=s.ip&&(t+=n+"ip: "+s.ip+r),null!=s.rfc822&&(t+=n+"rfc822: "+s.rfc822+r),null!=s.dns&&(t+=n+"dns: "+s.dns+r),null!=s.uri&&(t+=n+"uri: "+s.uri+r),null!=s.other)t+=n+"other: "+s.other.oid+"="+JSON.stringify(s.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 s=i.array[o];void 0!==s.cps&&(t+=" cps: "+s.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},s=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="+Ve(t.n.toString(16)).substr(0,16)+"...\n",e+=" e="+Ve(t.e.toString(16))+"\n"),null!=(n=this.aExtInfo)){e+="X509v3 Extensions:\n";for(var a=0;a<n.length;a++){var l=n[a],u=se.asn1.x509.OID.oid2name(l.oid);""===u&&(u=l.oid);var c="";if(!0===l.critical&&(c="CRITICAL"),e+=" "+u+" "+c+":\n","basicConstraints"===u){var h=this.getExtBasicConstraints();void 0===h.cA?e+=" {}\n":(e+=" cA=true",void 0!==h.pathLen&&(e+=", pathLen="+h.pathLen),e+="\n")}else{var p;if("policyMappings"==u)e+=" "+this.getExtPolicyMappings().array.map((function(e){var t=e;return t[0]+":"+t[1]})).join(", ")+"\n";else if("policyConstraints"==u)e+=" ",null!=(p=this.getExtPolicyConstraints()).reqexp&&(e+=" reqexp="+p.reqexp),null!=p.inhibit&&(e+=" inhibit="+p.inhibit),e+="\n";else if("inhibitAnyPolicy"==u)e+=" skip="+(p=this.getExtInhibitAnyPolicy()).skip+"\n";else if("keyUsage"==u)e+=" "+this.getExtKeyUsageString()+"\n";else if("subjectKeyIdentifier"==u)e+=" "+this.getExtSubjectKeyIdentifier().kid.hex+"\n";else if("authorityKeyIdentifier"==u){var d=this.getExtAuthorityKeyIdentifier();void 0!==d.kid&&(e+=" kid="+d.kid.hex+"\n")}else{if("extKeyUsage"==u)e+=" "+this.getExtExtKeyUsage().array.join(", ")+"\n";else if("subjectAltName"==u)e+=r(this.getExtSubjectAltName())+"\n";else if("cRLDistributionPoints"==u)e+=o(this.getExtCRLDistributionPoints());else if("authorityInfoAccess"==u)e+=s(this.getExtAuthorityInfoAccess());else"certificatePolicies"==u&&(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):se.lang.String.isHex(e)&&this.readCertHex(e))}te.prototype.sign=function(e,t){var n=function(e){return se.crypto.Util.hashString(e,t)}(e);return this.signWithMessageHash(n,t)},te.prototype.signWithMessageHash=function(e,t){var n=ee(se.crypto.Util.getPaddedDigestInfoHex(e,t,this.n.bitLength()),16);return nt(this.doPrivate(n).toString(16),this.n.bitLength())},te.prototype.signPSS=function(e,t,n){var r,i=(r=xe(e),se.crypto.Util.hashHex(r,t));return void 0===n&&(n=-1),this.signWithMessageHashPSS(i,t,n)},te.prototype.signWithMessageHashPSS=function(e,t,n){var r,i=we(e),o=i.length,s=this.n.bitLength()-1,a=Math.ceil(s/8),l=function(e){return se.crypto.Util.hashHex(e,t)};if(-1===n||void 0===n)n=o;else if(-2===n)n=a-o-2;else if(n<-2)throw new Error("invalid salt length");if(a<o+n+2)throw new Error("data too long");var u="";n>0&&(u=new Array(n),(new Z).nextBytes(u),u=String.fromCharCode.apply(String,u));var c=we(l(xe("\0\0\0\0\0\0\0\0"+i+u))),h=[];for(r=0;r<a-n-o-2;r+=1)h[r]=0;var p=String.fromCharCode.apply(String,h)+""+u,d=rt(c,p.length,l),f=[];for(r=0;r<p.length;r+=1)f[r]=p.charCodeAt(r)^d.charCodeAt(r);var g=65280>>8*a-s&255;for(f[0]&=~g,r=0;r<o;r++)f.push(c.charCodeAt(r));return f.push(188),nt(this.doPrivate(new w(f)).toString(16),this.n.bitLength())},te.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 s=o[0];return o[1]==function(e){return se.crypto.Util.hashString(e,s)}(e)},te.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},te.prototype.verifyPSS=function(e,t,n,r){var i,o=(i=xe(e),se.crypto.Util.hashHex(i,n));return void 0===r&&(r=-1),this.verifyWithMessageHashPSS(o,t,n,r)},te.prototype.verifyWithMessageHashPSS=function(e,t,n,r){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var i,o=new w(t,16),s=function(e){return se.crypto.Util.hashHex(e,n)},a=we(e),l=a.length,u=this.n.bitLength()-1,c=Math.ceil(u/8);if(-1===r||void 0===r)r=l;else if(-2===r)r=c-l-2;else if(r<-2)throw new Error("invalid salt length");if(c<l+r+2)throw new Error("data too long");var h=this.doPublic(o).toByteArray();for(i=0;i<h.length;i+=1)h[i]&=255;for(;h.length<c;)h.unshift(0);if(188!==h[c-1])throw new Error("encoded message does not end in 0xbc");var p=(h=String.fromCharCode.apply(String,h)).substr(0,c-l-1),d=h.substr(p.length,l),f=65280>>8*c-u&255;if(0!=(p.charCodeAt(0)&f))throw new Error("bits beyond keysize not zero");var g=rt(d,p.length,s),m=[];for(i=0;i<p.length;i+=1)m[i]=p.charCodeAt(i)^g.charCodeAt(i);m[0]&=~f;var v=c-l-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===we(s(xe("\0\0\0\0\0\0\0\0"+a+String.fromCharCode.apply(String,m.slice(-r)))))},te.SALT_LEN_HLEN=-1,te.SALT_LEN_MAX=-2,te.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;ue.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=ue.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=ue,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]),s=se.asn1.ASN1Util.oidHexToInt(o);return se.asn1.x509.OID.oid2atype(s)+"="+we(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=ue.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!==se&&se||(se={}),void 0!==se.jws&&se.jws||(se.jws={}),se.jws.JWS=function(){var e=se.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],s=r[3],a=i+"."+o;if(this.parsedJWS={},this.parsedJWS.headB64U=i,this.parsedJWS.payloadB64U=o,this.parsedJWS.sigvalB64U=s,this.parsedJWS.si=a,!n){var l=ve(s),u=ee(l,16);this.parsedJWS.sigvalH=l,this.parsedJWS.sigvalBI=u}var c=le(i),h=le(o);if(this.parsedJWS.headS=c,this.parsedJWS.payloadS=h,!e(c,this.parsedJWS,"headP"))throw"malformed JSON string for JWS Head: "+c}}},se.jws.JWS.sign=function(e,t,n,r,i){var o,s,a,l=se,u=l.jws.JWS,c=u.readSafeJSONString,h=u.isSafeJSONString,p=l.crypto,d=(p.ECDSA,p.Mac),f=p.Signature,g=JSON;if("string"!=typeof t&&"object"!=typeof t)throw"spHeader must be JSON string or object: "+t;if("object"==typeof t&&(s=t,o=g.stringify(s)),"string"==typeof t){if(!h(o=t))throw"JWS Head is not safe JSON string: "+o;s=c(o)}if(a=n,"object"==typeof n&&(a=g.stringify(n)),""!=e&&null!=e||void 0===s.alg||(e=s.alg),""!=e&&null!=e&&void 0===s.alg&&(s.alg=e,o=g.stringify(s)),e!==s.alg)throw"alg and sHeader.alg doesn't match: "+e+"!="+s.alg;var m=null;if(void 0===u.jwsalg2sigalg[e])throw"unsupported alg name: "+e;m=u.jwsalg2sigalg[e];var v=ae(o)+"."+ae(a),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")){(w=new f({alg:m})).init(r,i),w.updateString(v);var $=w.sign();y=se.crypto.ECDSA.asn1SigToConcatSig($)}else{var w;if("none"!=m)(w=new f({alg:m})).init(r,i),w.updateString(v),y=w.sign()}return v+"."+me(y)},se.jws.JWS.verify=function(e,t,n){var r,i=se,o=i.jws.JWS,s=o.readSafeJSONString,a=i.crypto,l=a.ECDSA,u=a.Mac,c=a.Signature;if(r=te,!Ue(e))return!1;var h=e.split(".");if(3!==h.length)return!1;var p=h[0]+"."+h[1],d=ve(h[2]),f=s(le(h[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 l))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 u({alg:v,pass:t});return y.updateString(p),d==y.doFinal()}if(-1!=v.indexOf("withECDSA")){var b,$=null;try{$=l.concatSigToASN1Sig(d)}catch(e){return!1}return(b=new c({alg:v})).init(t),b.updateString(p),b.verify($)}return(b=new c({alg:v})).init(t),b.updateString(p),b.verify(d)},se.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=se.jws.JWS.readSafeJSONString(le(t)),o.payloadObj=se.jws.JWS.readSafeJSONString(le(n)),o.headerPP=JSON.stringify(o.headerObj,null," "),null==o.payloadObj?o.payloadPP=le(n):o.payloadPP=JSON.stringify(o.payloadObj,null," "),void 0!==r&&(o.sigHex=ve(r)),o},se.jws.JWS.verifyJWT=function(e,t,n){var r=se.jws,i=r.JWS,o=i.readSafeJSONString,s=i.inArray,a=i.includedArray;if(!Ue(e))return!1;var l=e.split(".");if(3!=l.length)return!1;var u=l[0],c=l[1],h=(ve(l[2]),o(le(u))),p=o(le(c));if(void 0===h.alg)return!1;if(void 0===n.alg)throw"acceptField.alg shall be specified";if(!s(h.alg,n.alg))return!1;if(void 0!==p.iss&&"object"==typeof n.iss&&!s(p.iss,n.iss))return!1;if(void 0!==p.sub&&"object"==typeof n.sub&&!s(p.sub,n.sub))return!1;if(void 0!==p.aud&&"object"==typeof n.aud)if("string"==typeof p.aud){if(!s(p.aud,n.aud))return!1}else if("object"==typeof p.aud&&!a(p.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!==p.exp&&"number"==typeof p.exp&&p.exp+n.gracePeriod<d)&&(!(void 0!==p.nbf&&"number"==typeof p.nbf&&d<p.nbf-n.gracePeriod)&&(!(void 0!==p.iat&&"number"==typeof p.iat&&d<p.iat-n.gracePeriod)&&((void 0===p.jti||void 0===n.jti||p.jti===n.jti)&&!!i.verify(e,t,n.alg))))},se.jws.JWS.includedArray=function(e,t){var n=se.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},se.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},se.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"},se.jws.JWS.isSafeJSONString=function(e,t,n){var r=null;try{return"object"!=typeof(r=oe(e))||r.constructor===Array?0:(t&&(t[n]=r),1)}catch(e){return 0}},se.jws.JWS.readSafeJSONString=function(e){var t=null;try{return"object"!=typeof(t=oe(e))||t.constructor===Array?null:t}catch(e){return null}},se.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]},se.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=xe(t);return me(se.crypto.Util.hashHex(n,"sha256"))},se.jws.IntDate={},se.jws.IntDate.get=function(e){var t=se.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},se.jws.IntDate.getZulu=function(e){return ke(e)},se.jws.IntDate.getNow=function(){return~~(new Date/1e3)},se.jws.IntDate.intDate2UTCString=function(e){return new Date(1e3*e).toUTCString()},se.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!==se&&se||(se={}),void 0!==se.jws&&se.jws||(se.jws={}),se.jws.JWSJS=function(){var e=se.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=se.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],s=i+"."+this.sPayload+"."+o,a=!1;try{a=e.verify(s,n,r)}catch(e){return!1}return a},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=Z,t.rng_seed_time=G,t.BigInteger=w,t.RSAKey=te,t.ECDSA=se.crypto.ECDSA,t.DSA=se.crypto.DSA,t.Signature=se.crypto.Signature,t.MessageDigest=se.crypto.MessageDigest,t.Mac=se.crypto.Mac,t.KEYUTIL=tt,t.ASN1HEX=ue,t.X509=ot,t.X509CRL=function(e){var t=se.lang.String.isHex,n=ue,r=n.getV,i=n.getTLV,o=n.getVbyList,s=n.getTLVbyList,a=n.getTLVbyListEx,l=n.getIdxbyList,u=n.getIdxbyListEx,c=n.getChildIdx,h=new ot;this.hex=null,this.posSigAlg=null,this.posRevCert=null,this.parsed=null,this._setPos=function(){var e=l(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=l(this.hex,0,[0,this.posSigAlg+3]),i=this.hex.substr(r,2);if("17"==i||"18"==i)n=l(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=s(this.hex,0,[0,this.posSigAlg],"30");return h.getAlgorithmIdentifierName(e)},this.getIssuer=function(){return h.getX500Name(this.getIssuerHex())},this.getIssuerHex=function(){return s(this.hex,0,[0,this.posSigAlg+1],"30")},this.getThisUpdate=function(){var e=o(this.hex,0,[0,this.posSigAlg+2]);return result=we(e)},this.getNextUpdate=function(){var e=l(this.hex,0,[0,this.posSigAlg+3]),t=this.hex.substr(e,2);return"17"!=t&&"18"!=t?null:we(r(this.hex,e))},this.getRevCertArray=function(){if(null==this.posRevCert)return null;for(var e=[],t=l(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=we(o(e,0,[1])),3==n.length&&(t.ext=h.getExtParamArray(s(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=s(this.hex,0,[0],"30"),i=new se.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!=u(this.hex,0,[0,"[0]"])){var o=a(this.hex,0,[0,"[0]",0]);t.ext=h.getExtParamArray(o)}return t.sighex=this.getSignatureValueHex(),this.parsed=t,"object"==typeof e&&(1==e.tbshex&&(t.tbshex=s(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=$,t.ECFieldElementFp=ne,t.ECPointFp=re,t.ECCurveFp=ie,t.stoBA=ce,t.BAtos=he,t.BAtohex=pe,t.stohex=de,t.stob64=function(e){return y(de(e))},t.stob64u=function(e){return fe(y(de(e)))},t.b64utos=function(e){return he($(ge(e)))},t.b64tob64u=fe,t.b64utob64=ge,t.hex2b64=y,t.hextob64u=me,t.b64utohex=ve,t.utf8tob64u=ae,t.b64utoutf8=le,t.utf8tob64=function(e){return y(Re(Be(e)))},t.b64toutf8=function(e){return decodeURIComponent(Ie(b(e)))},t.utf8tohex=ye,t.hextoutf8=be,t.hextorstr=we,t.rstrtohex=xe,t.hextob64=Se,t.hextob64nl=function(e){return Ee(Se(e),64)},t.b64nltohex=Ae,t.hextopem=Ce,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=Fe,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),s=("00"+t.getUTCMinutes()).slice(-2),a=("00"+t.getUTCSeconds()).slice(-2),l=("000"+t.getUTCMilliseconds()).slice(-3);return n+r+i+o+s+a+(l=""!=(l=l.replace(/0+$/,""))?"."+l:l)+"Z"},t.zulutosec=ke,t.zulutodate=function(e){return new Date(Fe(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=Re,t.hextouricmp=Ie,t.ipv6tohex=Pe,t.hextoipv6=Oe,t.hextoip=_e,t.iptohex=Le,t.ucs2hextoutf8=Me,t.encodeURIComponentAll=Be,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=Ve,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=qe,t.hextooid=ze,t.strpad=We,t.bitstrtoint=Ye,t.inttobitstr=Je,t.bitstrtobinstr=Xe,t.binstrtobitstr=function(e){if("string"!=typeof e)return null;if(null==e.match(/^[01]+$/))return null;try{return Je(parseInt(e,2))}catch(e){return null}},t.isBase64URLDot=Ue,t.namearraytobinstr=Qe,t.extendClass=et,t.foldnl=Ee,t.b64topem=function(e,t){return"-----BEGIN "+t+"-----\r\n"+Ee(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=De,t.aryval=Ze,t.inttohex=Ke,t.twoscompl=Ge,t.KJUR=se,t.crypto=se.crypto,t.asn1=se.asn1,t.jws=se.jws,t.lang=se.lang,t.VERSION="11.1.0",t.VERSION_FULL="jsrsasign(all) 11.1.0 (2024-02-01) (c) 2010-2023 Kenji Urushima | kjur.github.io/jsrsasign/license"}).call(this,n(323).Buffer)},50:function(e,t){angular.module("graphdb.framework.rest.locations.service",[]).factory("LocationsRestService",n),n.$inject=["$http"];function n(e){return{getLocations:function(t){return e.get("rest/locations",{},{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}})}}}},51:function(e,t,n){"use strict";n.r(t);n(13),n(17),n(69);var r=n(2),i=n(19),o=n(25);function s(e,t,n,s,a,l,u,c,h,p,d,f){this.guideResumeSubscription=void 0,this.languageChangeSubscription=void 0,this.guideCancelSubscription=void 0,this.init=()=>{this._subscribeToGuideResumed(),this._subscribeToGuideCancel(),this._subscribeToGuidePause()},this.downloadGuidesFile=(e,t)=>f.downloadGuideResource(`${e}/${t}`).then(e=>{o.FileUtils.downloadAsFile(t,"application/text",e.data)}),this.startGuide=(e,i)=>{if(e&&e.options&&e.options.repositoryIdBase){const t=l.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,s,e.guideName,{}),e.options.translatedGuideDescription=r.GuideUtils.translateLocalMessage(n,s,e.guideDescription,{})}const o=this._toStepsDescriptions(e);for(let e=0;e<o.length;e++)o[e].id=e;angular.isDefined(i)?a.resumeGuide(e.guideId,o,i):a.startGuide(e.guideId,o,i),t.$broadcast("guideStarted")},this.getGuides=()=>f.getGuides().then(e=>{const t=e.data||[];return t.forEach((e,t)=>{void 0===e.guideId&&(e.guideId=Date.now()+t)}),t}),this.isActive=()=>a.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,o)=>{const f={$translate:n,$interpolate:s,GuideUtils:r.GuideUtils,$rootScope:t,toastr:u,$location:c,$route:h,$timeout:p,ShepherdService:a,$repositories:l,YasguiComponentDirectiveUtil:i.YasguiComponentDirectiveUtil,EventEmitterService:d};let g=[];if(angular.isArray(e))e.forEach(t=>{g=g.concat(this._getSteps(t,angular.extend({},e.options,o)))});else{const t=PluginRegistry.get("guide.step").find(t=>t.guideBlockName===e.guideBlockName);if(t){const n=angular.extend({},t.options,e.options,o);t.getSteps?g=g.concat(this._getSteps(_.cloneDeep(t.getSteps(n,f)),o)):t.getStep?g.push(_.cloneDeep(t.getStep(n,f))):g=g.concat(this._getSteps(_.cloneDeep(t,t.options),o))}}return g.forEach((e,t)=>{e.stepN=t,e.stepsTotalN=g.length,!e.title&&e.mainAction&&(e.title="guide.step-action."+e.mainAction)}),g},this._subscribeToGuideResumed=()=>{this.guideResumeSubscription||(this.guideResumeSubscription=t.$on("guideResume",()=>{const e=a.getGuideId();this.getGuides().then(t=>{const n=t.find(t=>t.guideId===e),r=a.getCurrentStepId();this.startGuide(n,r)})}))},this._subscribeToGuideCancel=()=>{a.subscribeToGuideCancel(()=>t.$broadcast("guideReset"))},this._subscribeToGuidePause=()=>{a.subscribeToGuidePause(()=>t.$broadcast("guidePaused"))}}angular.module("graphdb.framework.guides.services",["graphdb.framework.guides.shepherd.services","graphdb.framework.rest.guides.service"]).service("GuidesService",s),s.$inject=["$http","$rootScope","$translate","$interpolate","ShepherdService","$repositories","toastr","$location","$route","$timeout","EventEmitterService","GuidesRestService"]},52:function(e,t,n){"use strict";n.r(t);n(9);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)}}}])},53:function(e,t,n){"use strict";n.r(t);n(9);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";if(e.getAuthToken()&&(i.Authorization=e.getAuthToken()),!i["X-GraphDB-Repository"]){const e=t.get(n.REPOSITORY_ID),r=t.get(n.REPOSITORY_LOCATION);i["X-GraphDB-Repository"]=e||void 0,i["X-GraphDB-Repository-Location"]=r||void 0}return r.headers=i,r}}}])},55:function(e,t,n){"use strict";n.r(t);var r=n(5);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,s,a){const l="com.ontotext.graphdb.openid.",u=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=u.generateRandomString(),i=e.authFlow;if("code"===i){u.setStorageItem("pkce_state",r);const i=u.generateRandomString();u.setStorageItem("pkce_code_verifier",i);const o=u.pkceChallengeFromVerifier(i);n.location.href=u.getLoginUrl(r,o,t,e)}else"code_no_pkce"===i?(u.removeStorageItem("pkce_code_verifier"),n.location.href=u.getLoginUrl(r,"",t,e)):"implicit"===i?(u.setStorageItem("nonce",r),n.location.href=u.getLoginUrl(r,"",t,e)):(console.log("oidc: unknown auth flow: "+i),o.error(s.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(s.instant("openid.auth.unknown.flow",{authFlow:r.authFlow}))}return i.unshift("response_type="+encodeURIComponent(o),"scope="+encodeURIComponent(u.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){a.OPENID_CONFIG.openIdKeys={},e.keys.forEach((function(e){a.OPENID_CONFIG.openIdKeys[e.kid]=e})),n()}))},this.initOpenId=function(e,t,r,l){u.clientId=e.clientId,u.tokenType=e.tokenType,u.idTokenAudience=e.clientId,u.idTokenIssuer=e.issuer,u.accessTokenAudience=e.tokenAudience,u.accessTokenIssuer=e.tokenIssuer,a.OPENID_CONFIG.openIdTokenUrl=e.oidcTokenEndpoint,a.OPENID_CONFIG.openIdKeysUri=e.oidcJwksUri,e.proxyOidc&&(a.OPENID_CONFIG.openIdKeysUri="rest/openid/jwks",a.OPENID_CONFIG.openIdTokenUrl="rest/openid/token"),a.OPENID_CONFIG.openIdEndSessionUrl=e.oidcEndSessionEndpoint,a.OPENID_CONFIG.supportsOfflineAccess=e.oidcScopesSupported.includes("offline_access"),e.oracleDomain&&(i.headers["X-OAuth-Identity-Domain-Name"]=e.oracleDomain),u.withOpenIdKeys(a.OPENID_CONFIG.openIdKeysUri,(function(){if(u.isLoggedIn=u.hasValidIdToken(),u.isLoggedIn)u.setupTokensRefresh(!1,r,l);else if(u.hasValidRefreshToken())u.refreshTokens(r,l);else{const i=r;r=function(){u.isLoggedIn=!0,i(!0)},u.softLogout();const a=u.parseQueryString(n.location.search.substring(1));if(a.code)"code"===e.authFlow?u.getStorageItem("pkce_state")!==a.state?(o.error(s.instant("openid.auth.invalid.pkce.state")),console.log("oidc: PKCE state mismatch "+u.getStorageItem("pkce_state")+" != "+a.state),l()):u.retrieveTokensByCode(a.code,t,r,l):"code_no_pkce"===e.authFlow&&u.retrieveTokensByCode(a.code,t,r,l);else{const e=u.parseQueryString(n.location.pathname.substring(1));e.id_token?u.saveTokens(e,!0,!1,r):l()}}}))},this.authHeaderGraphDB=function(){return"id"===u.getStorageItem("token_type")?"Bearer "+u.getToken("id"):"Bearer "+u.getToken("access")},this.softLogout=function(){u.isLoggedIn=!1,u.setToken("id",null),u.setToken("access",null),u.setToken("refresh",null)},this.hardLogout=function(e){u.softLogout(),a.OPENID_CONFIG.openIdEndSessionUrl&&(n.location.href=`${a.OPENID_CONFIG.openIdEndSessionUrl}?client_id=${encodeURIComponent(u.clientId)}&post_logout_redirect_uri=${encodeURIComponent(e)}`)},this.getToken=function(e){return u.getStorageItem(e+"_token")},this.setToken=function(e,t){t?u.setStorageItem(e+"_token",t):u.removeStorageItem(e+"_token")},this.tokenHeader=function(e){const t=u.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:s.instant("openid.auth.not.jwt.token",{token:t})}}return{}},this.verifyToken=function(e){const t=u.getToken(e),n=u.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=a.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),s={alg:[n.alg],iss:[u.idTokenIssuer]};return"id"===e?(s.aud=[u.idTokenAudience,u.idTokenIssuer],s.nonce=[u.getStorageItem("nonce")]):"access"===e&&(s.aud=[u.accessTokenAudience],s.iss=[u.accessTokenIssuer]),r.KJUR.jws.JWS.verifyJWT(t,o,s)},this.hasValidIdToken=function(){return u.getToken("id")?u.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=u.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:s.instant("openid.auth.not.jwt.token",{token:t})}}return{}},this.saveTokens=function(e,n,r,i){(n||e.refresh_token)&&u.setToken("refresh",e.refresh_token),u.setToken("access",e.access_token),u.setToken("id",e.id_token),u.setStorageItem("token_type",u.tokenType),console.log("oidc: saved tokens"),u.setupTokensRefresh(n||r,i),u.removeStorageItem("pkce_state"),u.removeStorageItem("pkce_code_verifier"),n&&t.url("/")},this.retrieveTokensByCode=function(t,n,r,l){const h={grant_type:"authorization_code",client_id:u.clientId,redirect_uri:n,code:t},p=u.getStorageItem("pkce_code_verifier");p&&(h.code_verifier=p);const d={...i.headers,"Content-type":"application/x-www-form-urlencoded; charset=utf-8"};e({method:"POST",url:a.OPENID_CONFIG.openIdTokenUrl,headers:d,transformRequest:c,data:h}).success((function(e){u.saveTokens(e,!0,!1,r)})).error((function(e){o.error(s.instant("openid.auth.cannot.retrieve.token.msg",{error:getError(e)})),l()}))},this.refreshTokens=function(t,n){if(u.hasValidRefreshToken()){const r={grant_type:"refresh_token",client_id:u.clientId,refresh_token:u.getToken("refresh")},l={...i.headers,"Content-type":"application/x-www-form-urlencoded; charset=utf-8"};e({method:"POST",url:a.OPENID_CONFIG.openIdTokenUrl,headers:l,transformRequest:c,data:r}).success((function(e){console.log("oidc: refreshed tokens"),u.saveTokens(e,!1,!0,t),u.isLoggedIn=!0})).error((function(e){console.log("oidc: could not refresh tokens"),o.error(s.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=u.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(u.hasValidRefreshToken()){clearTimeout(u.previousTimer);const r=u.tokenPayload("id");if(r.exp>0){const i=1e3*r.exp-Date.now()-6e4;if(!(e||i>1e3))return u.previousTimer=null,console.log("oidc: tokens will refresh now, "+i+"; "+e),void u.refreshTokens(t,n);u.previousTimer=setTimeout((function(){u.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"+(a.OPENID_CONFIG.supportsOfflineAccess?" offline_access":"");return e&&(t+=" "+e),console.log(`oidc: requesting scopes '${t}'`),t},this.setStorageItem=function(e,t){localStorage.setItem(l+e,t)},this.getStorageItem=function(e){return localStorage.getItem(l+e)},this.removeStorageItem=function(e){localStorage.removeItem(l+e)}}])},56: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.password,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)}))}}},57: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),"errorMessage"in e&&(r=e.errorMessage)}return n>0&&r.length>n&&(r=r.substr(0,n)+"..."),r}return"There is an error"}}(window)},58:function(e,t,n){"use strict";n.r(t);n(9),n(59),n(60),n(26),n(48),n(43),n(27),n(21),n(83),n(84),n(42),n(41),n(61),n(62),n(23),n(47);var r=n(6),i=(n(13),n(67),n(44),n(68),n(0)),o=(n(51),n(70),n(17)),s=(n(315),n(324),n(18)),a=n(14),l=n(8);function u(e,t,n,r,i,o,s,a,u,c,h,p,d){e.doClear=!1,e.getActiveRepositorySize=()=>{const t=r.getActiveRepositoryObject();t&&(e.activeRepositorySizeError=void 0,c.getSize(t).then((function(t){e.activeRepositorySize=t.data})).catch((function(t){e.activeRepositorySizeError=t.data.message})))},e.onKeyDown=function(t){27===t.keyCode&&(e.doClear=!0)};const f=[];f.push(h.onSelectedRepositoryIdUpdated(t=>{t?(e.getActiveRepositorySize(),p.getNamespaces(t).then(t=>{e.repositoryNamespaces=t}).catch(e=>{const t=getError(e);d.error(t,s.instant("error.getting.namespaces.for.repo"))})):e.repositoryNamespaces=new l.NamespacesListModel})),f.push(h.onAutocompleteEnabledUpdated(t=>{e.isAutocompleteEnabled=t})),e.$on("$destroy",()=>f.forEach(e=>e())),e.$on("$routeChangeSuccess",(function(n,r,o){o&&(i.isAuthenticated()||i.isFreeAccessEnabled()?e.getActiveRepositorySize():t.redirectToLogin())}))}function c(e,t,n,l,u,c,h,p,d,f,g,m,v,y,b,w,x,S,E,A,C,T,F,k,D,R,I,P,O,j,L){e.descr=T.instant("main.gdb.description"),e.documentation="",e.menu=t,e.menuCollapsed=!1,e.tutorialState=1!==A.get(C.TUTORIAL_STATE),e.userLoggedIn=!1,e.embedded=c.search().embedded,e.productInfo=f,e.guidePaused="true"===A.get(o.GUIDE_PAUSE),e.hideRdfResourceSearch=!1,e.showRdfResourceSearch=()=>!e.hideRdfResourceSearch&&!!e.getActiveRepository()&&e.hasActiveLocation()&&(!e.isLoadingLocation()||e.isLoadingLocation()&&"/repository"===c.url()),e.onRdfResourceSearch=()=>{N()&&(e.hideRdfResourceSearch=!0,$("#search-resource-input-home input").focus(),u.info(Object(i.decodeHTML)(T.instant("search.resource.current.page.msg")),T.instant("search.resources.msg"),{allowHtml:!0}))};const N=()=>"/"===c.url();e.isMenuCollapsedOnLoad=function(){return $(".main-menu").hasClass("collapsed")},e.checkMenu=Object(s.debounce)((function(){const t=e.isMenuCollapsedOnLoad();e.menuCollapsed!==t&&(e.menuCollapsed=t)}),0,{trailing:!0});const M=e.$watch((function(){return e.isMenuCollapsedOnLoad()}),(function(t,n){t===n&&void 0!==t||e.checkMenu()}));e.showLabel=function(t){return!!t.children||!e.menuCollapsed};!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,e.hideRdfResourceSearch=!1,$(".menu-element-root").removeClass("active"),g((function(){$(".menu-element.open a.menu-element-root").addClass("active"),$(".main-menu.collapsed .menu-element.open .menu-element-root").addClass("active")}),400),r&&p.checkLicenseStatus().then(()=>O.init())})),e.resumeGuide=function(){d.$broadcast("guideResume")},d.$on("guideReset",(function(){e.guidePaused=!1,d.guidePaused=!1})),d.$on("guideStarted",(function(){e.guidePaused=!1,d.guidePaused=!1})),d.$on("guidePaused",(function(){e.guidePaused=!0,d.guidePaused=!0})),d.$on("$translateChangeSuccess",(function(){e.menu.forEach((function(e){e.label=T.instant(e.labelKey),e.children&&e.children.forEach((function(e){e.label=T.instant(e.labelKey)}))})),d.helpInfo=E.trustAsHtml(Object(i.decodeHTML)(T.instant(d.helpInfo))),d.title=Object(i.decodeHTML)(T.instant(d.title)),e.initTutorial()})),e.copyToClipboard=function(e){m.openCopyToClipboardModal(e)},e.goToAddRepo=function(){c.path("/repository/create").search({previous:"home"})},e.goToEditRepo=function(e){c.path("repository/edit/"+e.id).search({previous:"home",location:e.location})},e.getLocationFromUri=function(e){return h.getLocationFromUri(e)},e.$on("$locationChangeSuccess",(function(){e.showFooter=!0})),e.$on("repositoryIsSet",(function(){e.setRestricted(),A.clearClassHieararchyState()})),e.graphdbVersion=e.engineVersion=f.productVersion,e.workbenchVersion=f.Workbench,e.connectorsVersion=f.connectors,e.sesameVersion=f.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):(g((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.resolveUrl=(e,t)=>a.DocumentationUrlResolver.getDocumentationUrl(e,t),e.isCurrentPath=function(e){return c.path()==="/"+e},e.isCurrentSubmenuChildPath=function(t){return 0!==t.children.length&&t.children.some((function(t){return e.isCurrentPath(t.href)}))},"/"===c.path()?e.selected=-1:(g((function(){const t=c.path().replace("/",""),n=$('a[href^="'+t+'"]');e.selected=n.closest(".menu-element").index()-1}),200),e.isCurrentPath(c.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 h.hasActiveLocation()},e.getActiveLocation=function(){return h.getActiveLocation()},e.isLoadingLocation=function(){return h.isLoadingLocation()},e.getRepositories=function(){return h.getRepositories()},e.getReadableRepositories=function(){return h.getReadableRepositories()},e.getWritableRepositories=function(){return h.getWritableRepositories()},e.getActiveRepository=function(){return h.getActiveRepository()},e.canWriteRepoInLocation=function(e){return n.canWriteRepo(e)},e.canWriteActiveRepo=function(e){const t=h.getActiveRepositoryObject();return!!t&&(n.canWriteRepo(t)&&("SYSTEM"!==t.id||!e))},e.getActiveRepositoryObject=function(){return h.getActiveRepositoryObject()},e.getActiveRepositoryShortLocation=function(){const e=h.getActiveRepositoryObject();if(e){const t=e.location;if(t)return"@"+F.shortenIri(t)}return""},e.isActiveRepoOntopType=function(){return h.isActiveRepoOntopType()},e.isActiveRepoFedXType=function(){return h.isActiveRepoFedXType()},e.isLicenseValid=function(){return p.isLicenseValid()},e.setAttrs=function(t){e.attrs=t},e.setRestricted=function(){e.attrs&&(e.isRestricted=e.attrs.hasOwnProperty("license")&&!p.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){h.setRepository(e)},e.logout=function(){n.clearAuthentication(),u.success("Signed out"),n.freeAccess?(h.resetActiveRepository(),n.updateReturnUrl()):n.isSecurityEnabled()&&d.redirectToLogin()},e.showMainManuAndStatusBar=()=>n.isAuthenticated()||e.isSecurityEnabled()&&e.isFreeAccessEnabled();const B=()=>{setTimeout(()=>{I.location.reload()},0)};let H=void 0;const U=e=>{if(P.AUTH_STORAGE_NAME===e.key){const e=n.isAuthenticated();n.updateReturnUrl(),H!==e&&(H=e,H?(c.url(d.returnToUrl||"/"),R.reload(),B()):(d.redirectToLogin(),B()))}};window.addEventListener("storage",U),e.$on("$destroy",()=>{document.removeEventListener("click",V),window.removeEventListener("storage",U),M(),e.checkMenu&&g.cancel(e.checkMenu)}),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 d.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.handlePopovers=function(t){e.setPopoverRepo(t),e.closeActiveRepoPopover()},e.isRepoActive=function(e){return h.isRepoActive(e)},e.getRepositorySize=function(){e.repositorySize={},e.popoverRepo&&(e.repositorySize.loading=!0,w.getSize(e.popoverRepo).then((function(t){e.repositorySize=t.data})))},e.isActiveRepoPopoverOpen=!1,e.openActiveRepoPopover=function(){e.getActiveRepository()&&(e.isActiveRepoPopoverOpen=!0)},e.closeActiveRepoPopover=function(){e.isActiveRepoPopoverOpen=!1};const V=function(t){const n=document.querySelector(".popover");e.isActiveRepoPopoverOpen&&n&&!n.contains(t.target)&&g((function(){e.isActiveRepoPopoverOpen=!1}),0)};function q(e){e?$(":root").addClass("menu-collapsed"):$(":root").removeClass("menu-collapsed")}function z(){$(window).width()<=720?($(".container-fluid.main-container").addClass("expanded"),q(!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"===A.get(C.MENU_STATE)?($(".container-fluid.main-container").addClass("expanded"),q(!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"),q(!1),$(".main-menu").removeClass("collapsed"),$(".toggle-menu").show(),$(".main-menu .icon-caret-right").toggleClass("icon-caret-right").toggleClass("icon-caret-left"))}document.addEventListener("click",V),e.getDegradedReason=function(){return h.getDegradedReason()},e.canManageRepositories=function(){return n.hasRole(r.UserRole.ROLE_REPO_MANAGER)&&!h.getDegradedReason()},e.getSavedQueries=function(){S.getSavedQueries().success((function(t){e.sampleQueries=t})).error((function(e){const t=getError(e);u.error(t,T.instant("query.editor.get.saved.queries.error"))}))},e.goToSparqlEditor=function(e){c.path("/sparql").search({savedQueryName:e.name,owner:e.owner,execute:!0})},e.declineTutorial=function(){A.set(C.TUTORIAL_STATE,1),e.tutorialState=!1},e.showTutorial=function(){e.tutorialState=!0,A.remove(C.TUTORIAL_STATE)},e.initTutorial=function(){if(!e.tutorialState&&"/"!==c.path())return;e.tutorialInfo=[{title:T.instant("main.info.title.welcome.page"),info:"<p>"+Object(i.decodeHTML)(T.instant("main.info.welcome.page"))+"</p><p>"+Object(i.decodeHTML)(T.instant("main.info.welcome.page.guides"))+"</p><p>"+Object(i.decodeHTML)(T.instant("main.info.welcome.page.footer"))+"</p>"},{title:T.instant("main.info.title.create.repo.page"),info:Object(i.decodeHTML)(T.instant("main.info.create.repo.page",{link:'<a href="https://graphdb.ontotext.com/documentation/'+f.productShortVersion+'/configuring-a-repository.html" target="_blank">'}))},{title:T.instant("main.info.title.load.sample.dataset"),info:T.instant("main.info.load.sample.dataset")},{title:T.instant("main.info.title.run.sparql.query"),info:Object(i.decodeHTML)(T.instant("main.info.run.sparql.query"))},{title:T.instant("menu.rest.api.label"),info:Object(i.decodeHTML)(T.instant("main.info.rest.api"))}],e.activePage=0,$(".pages-wrapper .page-slide").css("opacity",100);const t=$(".main-container")[0].offsetWidth+200;g((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 E.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")},z(),$(window).resize((function(){angular.isDefined(e.menuState)?$(window).width()<=720?($(".container-fluid.main-container").addClass("expanded"),q(!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"),q(!1),$(".main-menu").removeClass("collapsed"),$(".toggle-menu").show(),$(".main-menu .icon-caret-right").toggleClass("icon-caret-right").toggleClass("icon-caret-left")):z(),e.tutorialState&&"/"===c.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"),q(!1),t.removeClass("collapsed"),$(".main-menu .icon-caret-right").toggleClass("icon-caret-right").toggleClass("icon-caret-left"),d.$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"),q(!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"),d.$broadcast("onToggleNavWidth",!0)}},e.$on("onToggleNavWidth",(function(t,n){if(e.menuState=n,n?A.set(C.MENU_STATE,"collapsedMenu"):A.set(C.MENU_STATE,"expandedMenu"),e.tutorialState&&"/"===c.path()){const t=$(".pages-wrapper")[0].offsetWidth+200;g((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?(k.when(n.getPrincipal()).then(t=>{e.principal=t,e.isIgnoreSharedQueries=t&&t.appSettings.IGNORE_SHARED_QUERIES}).then(()=>{setTimeout(()=>e.getSavedQueries(),500)}),p.checkLicenseStatus().then(()=>O.init())):"/login"!==c.path()&&d.redirectToLogin()})),e.isTrackingAllowed=function(){return O.isTrackingAllowed()},e.getProductType=function(){return p.productType()},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 p.showLicense()},e.getLicense=function(){return p.license()},e.isLicenseHardcoded=function(){return p.isLicenseHardcoded()},e.getProductTypeHuman=function(){return p.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 s="";return n&&(s+=n+"d "),(n||r)&&(s+=r+"h "),(n||r||i)&&(s+=i+"m "),s+=o+"s",s.replace(/( 0[a-z])+$/,"")},e.getHumanReadableTimestamp=function(e){const t=Date.now(),n=(t-e)/1e3;if(n<60)return T.instant("timestamp.moments.ago");if(n<600)return T.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 y("date")(e,"'"+T.instant("timestamp.today.at")+"' HH:mm");if(n<86400)return y("date")(e,"'"+T.instant("timestamp.yesterday.at")+"' HH:mm")}return y("date")(e,"'"+T.instant("timestamp.on")+"' yyyy-MM-dd '"+T.instant("timestamp.at")+"' HH:mm")};const K=()=>{const e=h.getActiveRepository();e!==j.getSelectedRepositoryId()&&(j.setSelectedRepositoryId(e),(()=>{if(h.isActiveRepoFedXType()||!p.isLicenseValid())return j.setAutocompleteEnabled(!1),void A.set(C.AUTOCOMPLETE_ENABLED,!1);L.checkAutocompleteStatus().then(e=>{j.setAutocompleteEnabled(e),A.set(C.AUTOCOMPLETE_ENABLED,e)}).catch(()=>{u.error(T.instant("explore.error.autocomplete"))})})())};d.$on("repositoryIsSet",K),window.addEventListener("storage",e=>{"ls."+C.AUTOCOMPLETE_ENABLED===e.key?j.setAutocompleteEnabled("true"===e.newValue):"ls."+C.REPOSITORY_ID===e.key&&K()}),e.downloadGuidesFile=(e,t)=>{D.downloadGuidesFile(e,t).catch(e=>{u.error(T.instant("guide.step_plugin.download-guide-resource.download.message.failure",{resourceFile:t}))})}}function h(e,t,n){e.getRepositorySize=function(t){n.getSize(t).then((function(t){e.size=t.data}))}}function p(e,t,n,r){e.colors=[{name:"black",shade:"dark"},{name:"white",shade:"light"},{name:"red",shade:"dark"},{name:"blue",shade:"dark"},{name:"yellow",shade:"light"}],e.myColor=e.colors[2],e.specialValue={id:"12345",value:"green"},e.checkedItem={name:"black",shade:"dark"},e.toggleOn=!0,e.toggleSwitch=function(){e.toggleOn=!e.toggleOn},e.repositories=["Repo1","Repo2","Repo3"],e.formats=["JSON","JSON-LD","Turtle"],e.onopen=e.onclose=()=>angular.noop(),e.openInfoPanel=!1,e.showInfoPanel=function(){e.openInfoPanel=!0},e.closeInfoPanel=function(){e.openInfoPanel=!1},e.slideOpen=!1,e.toggleSlide=function(){e.slideOpen=!e.slideOpen},e.slider={value:10,minValue:10,maxValue:90,options:{floor:0,ceil:100,step:1}},e.openModal=function(){const e=r.openSimpleModal({title:"Confirm",message:"Lorem ipsum dolor sit amet.",warning:!0});e.result.then((function(){e.dismiss("cancel")}))},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.trackingService","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.utils.localstorageadapter","graphdb.framework.utils.workbenchsettingsstorageservice","graphdb.framework.core.services.autocomplete","graphdb.framework.utils.uriutils","graphdb.framework.guides.directives","graphdb.framework.guides.services","pageslide-directive","graphdb.core.services.workbench-context","graphdb.framework.core.services.rdf4j.repositories","rzSlider"]).controller("mainCtrl",c).controller("homeCtrl",u).controller("repositorySizeCtrl",h).controller("uxTestCtrl",p),u.$inject=["$scope","$rootScope","$http","$repositories","$jwtAuth","$licenseService","$translate","AutocompleteRestService","LicenseRestService","RepositoriesRestService","WorkbenchContextService","RDF4JRepositoriesService","toastr"],c.$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","TrackingService","WorkbenchContextService","AutocompleteService"],h.$inject=["$scope","$http","RepositoriesRestService"],p.$inject=["$scope","$repositories","toastr","ModalService"]},59: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=s();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?s():void 0)},s=()=>o("default-theme"),a=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)},l=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=s()),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(a).map(e=>({name:e.name,label:t.instant(e.label)||e.label})),applyTheme:e=>{const t=(e=>{const t=l(e),n=new CSSStyleSheet;return n.title=e.name,n.replaceSync(t),n})(o(e));document.adoptedStyleSheets=[t]}}}},6: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"}}}},60: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,n){return e.put("rest/sparql/saved-queries?oldQueryName="+encodeURIComponent(t),n)},deleteSavedQuery:function(t){return e.delete("rest/sparql/saved-queries?name="+encodeURIComponent(t))},addNewSavedQuery:function(t){return e.post("rest/sparql/saved-queries",t)},getQueryResult:function(t,n,r){return e.get("repositories/"+t,{params:n,headers:{Accept:r}})}}}},61:function(e,t){angular.module("graphdb.framework.core.services.licenseService",[]).service("$licenseService",["$window","$document","LicenseRestService","$translate",function(e,t,n,r){let i=void 0,o=!1,s=!1,a=!1,l=void 0,u=void 0;const c=e=>{l=e.productType,"standard"===l?u="Standard":"enterprise"===l?u="Enterprise":"free"===l?u="Free":"graphdb"===l&&(u="GraphDB")};return{checkLicenseStatus:()=>(o=!0,n.getHardcodedLicense().then(e=>(s="true"===e.data,n.getLicenseInfo())).then(e=>{i=e.data}).catch(()=>{s=!0,i={message:r.instant("no.license.set.msg"),valid:!1}}).finally(()=>{c(i),a=!0,o=!1})),isLicenseValid:()=>i&&i.valid,license:()=>i,loadingLicense:()=>o,isLicenseHardcoded:()=>s,showLicense:()=>a,productType:()=>l,productTypeHuman:()=>u,isFreeLicense:()=>{const e=i&&i.typeOfUse.toLowerCase();return"free"===l||"this is an evaluation license"===e||"evaluation"===e}}}])},62:function(e,t,n){"use strict";n.r(t);n(63),n(64),n(65),n(66);var r=n(7);angular.module("graphdb.framework.core.services.trackingService",["graphdb.framework.core.services.cookieService","graphdb.framework.core.services.installationCookieService","graphdb.framework.core.services.googleAnalyticsCookieService","graphdb.framework.core.directives.cookie-consent"]).service("TrackingService",["$window","$jwtAuth","$translate","$licenseService","toastr","InstallationCookieService","GoogleAnalyticsCookieService",function(e,t,n,i,o,s,a){const l=()=>{const t=i.isFreeLicense(),n=!e.wbDevMode;return t&&n},u=()=>{l()?t.getPrincipal().then(e=>{const t=r.CookieConsent.fromJSON(e.appSettings.COOKIE_CONSENT);if(t.getPolicyAccepted()){if(t.getStatisticConsent()){const e=i.license().installationId||"";s.setIfAbsent(e)}else s.remove();t.getThirdPartyConsent()?a.setIfAbsent():a.remove()}else c()}).catch(e=>{const t=getError(e.data,e.status);o.error(t,n.instant("common.error"))}):c()},c=()=>{s.remove(),a.remove()};return{init:u,getCookieConsent:()=>t.getPrincipal().then(e=>e&&e.appSettings&&e.appSettings.COOKIE_CONSENT?r.CookieConsent.fromJSON(e.appSettings.COOKIE_CONSENT):new r.CookieConsent(void 0,!0,!0)),updateCookieConsent:e=>t.getPrincipal().then(n=>{const r=n.appSettings,i=n.username;return r.COOKIE_CONSENT=e.toJSON(),t.updateUserData({appSettings:r,username:i})}).finally(()=>u()),isTrackingAllowed:l}}])},63:function(e,t){angular.module("graphdb.framework.core.services.cookieService",[]).service("CookieService",["$document","$cookies",function(e,t){return{get:e=>t[e],set:(t,r,i={})=>{e[0].cookie=new n(t,r,i).build()},remove:t=>{e[0].cookie=new n(t,"",{expiration:-1}).build()},getAll:()=>{const e={};for(const[n,r]of Object.entries(t))e[n]=r;return e}}}]);class n{constructor(e,t,n={}){this.key=encodeURIComponent(e),this.value=encodeURIComponent(t),this.setOptions(n)}setOptions(e){const{expiration:t,path:n,domain:r,secure:i,httpOnly:o,sameSite:s}=e;return t&&this.setExpiration(t),this.setPath(n),r&&this.setDomain(r),i&&this.setSecure(),o&&this.setHttpOnly(),s&&this.setSameSite(s),this}setExpiration(e){const t=new Date;return t.setTime(t.getTime()+24*e*60*60*1e3),this.expires=t.toUTCString(),this}setPath(e){return this.path=e||"/",this}setDomain(e){return this.domain=e,this}setSecure(){return this.secure=!0,this}setHttpOnly(){return this.httpOnly=!0,this}setSameSite(e){return this.sameSite=e,this}build(){let e=`${this.key}=${this.value}`;return this.expires&&(e+="; expires="+this.expires),e+="; path="+this.path,this.domain&&(e+="; domain="+this.domain),this.secure&&(e+="; secure"),this.httpOnly&&(e+="; HttpOnly"),this.sameSite&&(e+="; SameSite="+this.sameSite),e}}},64:function(e,t){angular.module("graphdb.framework.core.services.installationCookieService",[]).service("InstallationCookieService",["CookieService",function(e){const t=()=>e.get("_wb"),n=t=>{const n=`WB1.${t}.${Date.now()}`;e.set("_wb",n,{expiration:400})};return{get:t,set:n,setIfAbsent:e=>{t()||n(e)},remove:()=>{e.remove("_wb")}}}])},65:function(e,t){angular.module("graphdb.framework.core.services.googleAnalyticsCookieService",[]).service("GoogleAnalyticsCookieService",["$window","$document","CookieService",function(e,t,n){const r=()=>{const e=t[0].getElementsByTagName("script");return Array.from(e).some(e=>e.src&&e.src.includes("googletagmanager"))},i=()=>{e.dataLayer&&(e.dataLayer.push=function(){return null});const n=t[0].getElementsByTagName("script"),r=/googletagmanager/i;for(let e=n.length-1;e>=0;e--)(n[e].src&&r.test(n[e].src)||r.test(n[e].text))&&n[e].parentNode.removeChild(n[e]);e.google_tag_manager&&delete e.google_tag_manager,window.google_tag_data&&delete e.google_tag_data},o=()=>{const e=n.getAll();for(const[t,r]of Object.entries(e))t.startsWith("_ga")&&n.remove(t)};return{setIfAbsent:()=>{if(!r()){const e=t[0].createElement("script");e.text="(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'}); var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:''; j.async=true; j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl; f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-WBP6C6Z4');",t[0].getElementsByTagName("head")[0].appendChild(e)}},remove:()=>{r()&&i(),o()}}}])},66:function(e,t,n){"use strict";n.r(t);var r=n(30);function i(e,t,n,i,o,s){return{restrict:"E",templateUrl:"js/angular/core/templates/cookie-policy/cookie-consent.html",link:e=>{let n=void 0;e.showCookieConsent=!1,e.acceptConsent=()=>{s.updateCookieConsent(n.setPolicyAccepted(!0)).then(()=>e.showCookieConsent=!1)},e.showCookiePolicy=()=>{t.open({templateUrl:"js/angular/core/templates/cookie-policy/cookie-policy.html",controller:r.CookiePolicyModalController,backdrop:"static",keyboard:!1,windowClass:"cookie-policy-modal"})};const a=()=>{s.getCookieConsent().then(t=>{n=t,e.showCookieConsent=!t.getPolicyAccepted()}).catch(e=>{const t=getError(e.data,e.status);o.error(t,i.instant("common.error"))})},l=e.$on("securityInit",(t,n,r)=>{r?a():e.showCookieConsent=!1});e.$on("$destroy",()=>{l()}),a()}}}angular.module("graphdb.framework.core.directives.cookie-consent",[]).directive("cookieConsent",i),i.$inject=["$jwtAuth","$uibModal","$licenseService","$translate","toastr","TrackingService"]},67: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=_.clone(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"]},68:function(e,t,n){"use strict";n.r(t);n(26);function r(e,t,n){return{checkAutocompleteStatus:()=>e.checkAutocompleteStatus().then(e=>(n.set(t.AUTOCOMPLETE_ENABLED,e.data),e.data)),addLabelConfig:t=>e.addLabelConfig(t),editLabelConfig:(t,n)=>{const r={};return n&&(r.oldLabel=n),t&&(r.newLabel=t),e.editLabelConfig(r)},removeLabelConfig:t=>e.removeLabelConfig(t),interruptIndexing:()=>e.interruptIndexing(),buildIndex:()=>e.buildIndex(),toggleIndexIRIs:t=>e.toggleIndexIRIs(t),checkForPlugin:()=>e.checkForPlugin(),refreshLabelConfig:()=>e.refreshLabelConfig(),refreshIndexStatus:()=>e.refreshIndexStatus(),refreshIndexIRIs:()=>e.refreshIndexIRIs(),toggleAutocomplete:t=>e.toggleAutocomplete(t)}}angular.module("graphdb.framework.core.services.autocomplete",["graphdb.framework.rest.autocomplete.service"]).factory("AutocompleteService",r),r.$inject=["AutocompleteRestService","LSKeys","LocalStorageAdapter"]},69:function(e,t){function n(e){return{getGuides:()=>e.get("rest/guides"),downloadGuideResource:t=>e.get("rest/guides/download/"+t)}}angular.module("graphdb.framework.rest.guides.service",[]).factory("GuidesRestService",n),n.$inject=["$http"]},7:function(e,t,n){"use strict";n.r(t),n.d(t,"CookieConsent",(function(){return r})),n.d(t,"ConsentTypes",(function(){return i}));class r{constructor(e,t,n,r){this.policyAccepted=e,this.statistic=t,this.thirdParty=n,this.updatedAt=r}setPolicyAccepted(e){return this.policyAccepted=e,this.updateTimestamp(),this}setStatisticConsent(e){return this.statistic=e,this.updateTimestamp(),this}setThirdPartyConsent(e){return this.thirdParty=e,this.updateTimestamp(),this}updateTimestamp(){this.updatedAt=Date.now()}getPolicyAccepted(){return this.policyAccepted}getStatisticConsent(){return this.statistic}getThirdPartyConsent(){return this.thirdParty}toJSON(){return{policyAccepted:this.policyAccepted,statistic:this.statistic,thirdParty:this.thirdParty,updatedAt:this.updatedAt}}static fromJSON(e){return new r(e&&e.policyAccepted,e&&e.statistic,e&&e.thirdParty,e&&e.updatedAt)}}const i={STATISTIC:"statistic",THIRD_PARTY:"thirdParty"}},70:function(e,t){angular.module("graphdb.framework.guides.directives",[]).directive("guideSelector",(function(){return{}}))},71:function(e,t){
|
|
76
|
+
var oe=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,s){var a,l,u=n.match(e),c=u[0],h=!1;"{"===c?a={}:"["===c?a=[]:(a=[],h=!0);for(var p=[a],d=1-h,f=u.length;d<f;++d){var g;switch((c=u[d]).charCodeAt(0)){default:(g=p[0])[l||g.length]=+c,l=void 0;break;case 34:if(-1!==(c=c.substring(1,c.length-1)).indexOf("\\")&&(c=c.replace(t,r)),g=p[0],!l){if(!(g instanceof Array)){l=c||i;break}l=g.length}g[l]=c,l=void 0;break;case 91:g=p[0],p.unshift(g[l||g.length]=[]),l=void 0;break;case 93:p.shift();break;case 102:(g=p[0])[l||g.length]=!1,l=void 0;break;case 110:(g=p[0])[l||g.length]=null,l=void 0;break;case 116:(g=p[0])[l||g.length]=!0,l=void 0;break;case 123:g=p[0],p.unshift(g[l||g.length]={}),l=void 0;break;case 125:p.shift()}}if(h){if(1!==p.length)throw new Error;a=a[0]}else if(p.length)throw new Error;if(s){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 a=m(n,i);void 0!==a?n[i]=a:(r||(r=[]),r.push(i))}if(r)for(var l=r.length;--l>=0;)delete n[r[l]]}return s.call(e,t,n)};a=m({"":a},"")}return a}}();void 0!==se&&se||(se={}),void 0!==se.asn1&&se.asn1||(se.asn1={}),se.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){return Ge(e)},this.getPEMStringFromHex=function(e,t){return Ce(e,t)},this.newObject=function(e){var t=se.asn1,n=t.ASN1Object,r=t.DERBoolean,i=t.DERInteger,o=t.DERBitString,s=t.DEROctetString,a=t.DERNull,l=t.DERObjectIdentifier,u=t.DEREnumerated,c=t.DERUTF8String,h=t.DERNumericString,p=t.DERPrintableString,d=t.DERTeletexString,f=t.DERIA5String,g=t.DERUTCTime,m=t.DERGeneralizedTime,v=t.DERVisibleString,y=t.DERBMPString,b=t.DERSequence,$=t.DERSet,w=t.DERTaggedObject,x=t.ASN1Util.newObject;if(e instanceof t.ASN1Object)return e;var S=Object.keys(e);if(1!=S.length)throw new Error("key of param shall be only one.");var E=S[0];if(-1==":asn1:bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:visstr:bmpstr:seq:set:tag:".indexOf(":"+E+":"))throw new Error("undefined key: "+E);if("bool"==E)return new r(e[E]);if("int"==E)return new i(e[E]);if("bitstr"==E)return new o(e[E]);if("octstr"==E)return new s(e[E]);if("null"==E)return new a(e[E]);if("oid"==E)return new l(e[E]);if("enum"==E)return new u(e[E]);if("utf8str"==E)return new c(e[E]);if("numstr"==E)return new h(e[E]);if("prnstr"==E)return new p(e[E]);if("telstr"==E)return new d(e[E]);if("ia5str"==E)return new f(e[E]);if("utctime"==E)return new g(e[E]);if("gentime"==E)return new m(e[E]);if("visstr"==E)return new v(e[E]);if("bmpstr"==E)return new y(e[E]);if("asn1"==E)return new n(e[E]);if("seq"==E){for(var A=e[E],C=[],T=0;T<A.length;T++){var F=x(A[T]);C.push(F)}return new b({array:C})}if("set"==E){for(A=e[E],C=[],T=0;T<A.length;T++){F=x(A[T]);C.push(F)}return new $({array:C})}if("tag"==E){var k=e[E];if("[object Array]"===Object.prototype.toString.call(k)&&3==k.length){var D=x(k[2]);return new w({tag:k[0],explicit:k[1],obj:D})}return new w(k)}},this.jsonToASN1HEX=function(e){return this.newObject(e).tohex()}},se.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 w(r,2).toString(10),r=""}return t},se.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 w(e,10).toString(2),i=7-r.length%7;7==i&&(i=0);for(var o="",s=0;s<i;s++)o+="0";r=o+r;for(s=0;s<r.length-1;s+=7){var a=r.substr(s,7);s!=r.length-7&&(a="1"+a),n+=t(parseInt(a,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 s=0;s<i.length;s++)r+=n(i[s]);return r},se.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)},se.asn1.DERAbstractString=function(e){se.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=ye(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(se.asn1.DERAbstractString,se.asn1.ASN1Object),se.asn1.DERAbstractTime=function(e){se.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 s=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 a=i.getMilliseconds();if(0!=a){var l=r(String(a),3);s=s+"."+(l=l.replace(/[0]+$/,""))}}return s+"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 s=new Date(Date.UTC(e,t-1,n,r,i,o,0));this.setByDate(s)},this.getFreshValueHex=function(){return this.hV}},et(se.asn1.DERAbstractTime,se.asn1.ASN1Object),se.asn1.DERAbstractStructured=function(e){se.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(se.asn1.DERAbstractStructured,se.asn1.ASN1Object),se.asn1.DERBoolean=function(e){se.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV=0==e?"010100":"0101ff"},et(se.asn1.DERBoolean,se.asn1.ASN1Object),se.asn1.DERInteger=function(e){se.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.params=null;var t=Ge;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 w(String(e),10);else if(null!=e.int)n=new w(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(se.asn1.DERInteger,se.asn1.ASN1Object),se.asn1.DERBitString=function(e){if(void 0!==e&&void 0!==e.obj){var t=se.asn1.ASN1Util.newObject(e.obj);e.hex="00"+t.tohex()}se.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(se.asn1.DERBitString,se.asn1.ASN1Object),se.asn1.DEROctetString=function(e){if(void 0!==e&&void 0!==e.obj){var t=se.asn1.ASN1Util.newObject(e.obj);e.hex=t.tohex()}se.asn1.DEROctetString.superclass.constructor.call(this,e),this.hT="04"},et(se.asn1.DEROctetString,se.asn1.DERAbstractString),se.asn1.DERNull=function(){se.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},et(se.asn1.DERNull,se.asn1.ASN1Object),se.asn1.DERObjectIdentifier=function(e){se.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=qe(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=se.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(se.asn1.DERObjectIdentifier,se.asn1.ASN1Object),se.asn1.DEREnumerated=function(e){se.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=Ge(e)},this.setByInteger=function(e){var t=new w(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(se.asn1.DEREnumerated,se.asn1.ASN1Object),se.asn1.DERUTF8String=function(e){se.asn1.DERUTF8String.superclass.constructor.call(this,e),this.hT="0c"},et(se.asn1.DERUTF8String,se.asn1.DERAbstractString),se.asn1.DERNumericString=function(e){se.asn1.DERNumericString.superclass.constructor.call(this,e),this.hT="12"},et(se.asn1.DERNumericString,se.asn1.DERAbstractString),se.asn1.DERPrintableString=function(e){se.asn1.DERPrintableString.superclass.constructor.call(this,e),this.hT="13"},et(se.asn1.DERPrintableString,se.asn1.DERAbstractString),se.asn1.DERTeletexString=function(e){se.asn1.DERTeletexString.superclass.constructor.call(this,e),this.hT="14"},et(se.asn1.DERTeletexString,se.asn1.DERAbstractString),se.asn1.DERIA5String=function(e){se.asn1.DERIA5String.superclass.constructor.call(this,e),this.hT="16"},et(se.asn1.DERIA5String,se.asn1.DERAbstractString),se.asn1.DERVisibleString=function(e){se.asn1.DERIA5String.superclass.constructor.call(this,e),this.hT="1a"},et(se.asn1.DERVisibleString,se.asn1.DERAbstractString),se.asn1.DERBMPString=function(e){se.asn1.DERBMPString.superclass.constructor.call(this,e),this.hT="1e"},et(se.asn1.DERBMPString,se.asn1.DERAbstractString),se.asn1.DERUTCTime=function(e){se.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=de(e)}else if(null!=e.str)this.hV=de(e.str);else if(null==e.date&&1==e.millis){var t=new Date;this.hV=de(this.formatDate(t,"utc",!0))}else if(null!=e.date&&e.date instanceof Date){var n=!0===e.millis;this.hV=de(this.formatDate(e.date,"utc",n))}else e instanceof Date&&(this.hV=de(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(se.asn1.DERUTCTime,se.asn1.DERAbstractTime),se.asn1.DERGeneralizedTime=function(e){se.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=de(e)}else if(null!=e.str)this.hV=de(e.str);else if(null==e.date&&1==e.millis){var t=new Date;this.hV=de(this.formatDate(t,"gen",!0))}else if(null!=e.date&&e.date instanceof Date){var n=!0===e.millis;this.hV=de(this.formatDate(e.date,"gen",n))}else e instanceof Date&&(this.hV=de(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(se.asn1.DERGeneralizedTime,se.asn1.DERAbstractTime),se.asn1.DERSequence=function(e){se.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(se.asn1.DERSequence,se.asn1.DERAbstractStructured),se.asn1.DERSet=function(e){se.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(se.asn1.DERSet,se.asn1.DERAbstractStructured),se.asn1.DERTaggedObject=function(e){se.asn1.DERTaggedObject.superclass.constructor.call(this);var t=se.asn1,n=ue,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=ye(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(se.asn1.DERTaggedObject,se.asn1.ASN1Object);var se,ae,le,ue=new function(){};function ce(e){for(var t=new Array,n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t}function he(e){for(var t="",n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t}function pe(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 de(e){return pe(ce(e))}function fe(e){return e=(e=(e=e.replace(/\=/g,"")).replace(/\+/g,"-")).replace(/\//g,"_")}function ge(e){return e.length%4==2?e+="==":e.length%4==3&&(e+="="),e=(e=e.replace(/-/g,"+")).replace(/_/g,"/")}function me(e){return e.length%2==1&&(e="0"+e),fe(y(e))}function ve(e){return b(ge(e))}function ye(e){return Re(Be(e)).toLowerCase()}function be(e){try{return decodeURIComponent(Ie(e))}catch(e){return null}}function $e(e){return be(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 we(e){for(var t="",n=0;n<e.length-1;n+=2)t+=String.fromCharCode(parseInt(e.substr(n,2),16));return t}function xe(e){for(var t="",n=0;n<e.length;n++)t+=("0"+e.charCodeAt(n).toString(16)).slice(-2);return t}function Se(e){return y(e)}function Ee(e,t){return e=(e=e.replace(new RegExp("(.{"+t+"})","g"),"$1\r\n")).replace(/\s+$/,"")}function Ae(e){return b(e.replace(/[^0-9A-Za-z\/+=]*/g,""))}function Ce(e,t){return"-----BEGIN "+t+"-----\r\n"+Ee(Se(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 Ae(e=void 0!==t?(e=e.replace(new RegExp("^[^]*-----BEGIN "+t+"-----"),"")).replace(new RegExp("-----END "+t+"-----[^]*$"),""):(e=e.replace(/^[^]*-----BEGIN [^-]+-----/,"")).replace(/-----END [^-]+-----[^]*$/,""))}function Fe(e){var t,n,r,i,o,s,a,l,u,c;if(c=(e=De(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]),s=parseInt(c[6]),a=0,""!==(l=c[7])&&(u=(l.substr(1)+"00").substr(0,3),a=parseInt(u)),Date.UTC(t,n,r,i,o,s,a);throw new Error("unsupported zulu format: "+e)}function ke(e){return Math.round(Fe(e)/1e3)}function De(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 Re(e){return e.replace(/%/g,"")}function Ie(e){return e.replace(/(..)/g,"%$1")}function Pe(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 Oe(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 _e(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 Oe(e);if(64==e.length){try{return Oe(e.substr(0,32))+"/"+je(e.substr(32))}catch(e){throw t}return}return e}try{return _e(e.substr(0,8))+"/"+je(e.substr(8))}catch(e){throw t}}}function je(e){var t,n=new Error("malformed mask");try{t=new w(e,16).toString(2)}catch(e){throw n}if(!t.match(/^1*0*$/))throw n;return t.replace(/0+$/,"").length}function Le(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 Le((n=e.split("/"))[0])+Ne(parseInt(n[1]),32);if(e.match(/^[0-9a-f:]+$/)&&-1!==e.indexOf(":"))return Pe(e);if(e.match(/^[0-9a-f:]+\/[0-9]+$/)&&-1!==e.indexOf(":"))return Pe((n=e.split("/"))[0])+Ne(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 Ne(e,t){return 32==t&&0==e?"00000000":128==t&&0==e?"00000000000000000000000000000000":new w(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 be((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 be((224|(240&t)>>4).toString(16)+r.toString(16)+i.toString(16))})).join("")}function Be(e){for(var t=encodeURIComponent(e),n="",r=0;r<t.length;r++)"%"==t[r]?(n+=t.substr(r,3),r+=2):n=n+"%"+de(t[r]);return n}function He(e){return!(e.length%2!=0||!e.match(/^[0-9a-f]+$/)&&!e.match(/^[0-9A-F]+$/))}function Ue(e){return!!e.match(/^[0-9A-Za-z-_.]+$/)}function Ve(e){return e.length%2==1?"0"+e:e.substr(0,1)>"7"?"00"+e:e}ue.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},ue.getL=function(e,t){var n=ue.getLblen(e,t);return n<1?"":e.substr(t+2,2*n)},ue.getVblen=function(e,t){var n;return""==(n=ue.getL(e,t))?-1:("8"===n.substr(0,1)?new w(n.substr(2),16):new w(n,16)).intValue()},ue.getVidx=function(e,t){var n=ue.getLblen(e,t);return n<0?n:t+2*(n+1)},ue.getV=function(e,t){var n=ue.getVidx(e,t),r=ue.getVblen(e,t);return e.substr(n,2*r)},ue.getTLV=function(e,t){return e.substr(t,2)+ue.getL(e,t)+ue.getV(e,t)},ue.getTLVblen=function(e,t){return 2+2*ue.getLblen(e,t)+2*ue.getVblen(e,t)},ue.getNextSiblingIdx=function(e,t){return ue.getVidx(e,t)+2*ue.getVblen(e,t)},ue.getChildIdx=function(e,t){var n,r,i,o=ue,s=[];n=o.getVidx(e,t),r=2*o.getVblen(e,t),"03"==e.substr(t,2)&&(n+=2,r-=2),i=0;for(var a=n;i<=r;){var l=o.getTLVblen(e,a);if((i+=l)<=r&&s.push(a),a+=l,i>=r)break}return s},ue.getNthChildIdx=function(e,t,n){return ue.getChildIdx(e,t)[n]},ue.getIdxbyList=function(e,t,n,r){var i,o,s=ue;return 0==n.length?void 0!==r&&e.substr(t,2)!==r?-1:t:(i=n.shift())>=(o=s.getChildIdx(e,t)).length?-1:s.getIdxbyList(e,o[i],n,r)},ue.getIdxbyListEx=function(e,t,n,r){var i,o,s=ue;if(0==n.length)return void 0!==r&&e.substr(t,2)!==r?-1:t;i=n.shift(),o=s.getChildIdx(e,t);for(var a=0,l=0;l<o.length;l++){var u=e.substr(o[l],2);if("number"==typeof i&&!s.isContextTag(u)&&a==i||"string"==typeof i&&s.isContextTag(u,i))return s.getIdxbyListEx(e,o[l],n,r);s.isContextTag(u)||a++}return-1},ue.getTLVbyList=function(e,t,n,r){var i=ue,o=i.getIdxbyList(e,t,n,r);return-1==o||o>=e.length?null:i.getTLV(e,o)},ue.getTLVbyListEx=function(e,t,n,r){var i=ue,o=i.getIdxbyListEx(e,t,n,r);return-1==o?null:i.getTLV(e,o)},ue.getVbyList=function(e,t,n,r,i){var o,s,a=ue;return-1==(o=a.getIdxbyList(e,t,n,r))||o>=e.length?null:(s=a.getV(e,o),!0===i&&(s=s.substr(2)),s)},ue.getVbyListEx=function(e,t,n,r,i){var o,s,a=ue;return-1==(o=a.getIdxbyListEx(e,t,n,r))?null:(s=a.getV(e,o),"03"==e.substr(o,2)&&!1!==i&&(s=s.substr(2)),s)},ue.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=ue.getV(e,t);return"02"==r?parseInt(i,16):Ye(i)}catch(e){return n}},ue.getOID=function(e,t,n){null==n&&(n=null);try{return"06"!=e.substr(t,2)?n:ze(ue.getV(e,t))}catch(e){return n}},ue.getOIDName=function(e,t,n){null==n&&(n=null);try{var r=ue.getOID(e,t,n);if(r==n)return n;var i=se.asn1.x509.OID.oid2name(r);return""==i?r:i}catch(e){return n}},ue.getString=function(e,t,n){null==n&&(n=null);try{return we(ue.getV(e,t))}catch(e){return n}},ue.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),s=[],a=0;a<o.length/2;a++)s.push(parseInt(o.substr(2*a,2),16));var l=[],u="";for(a=0;a<s.length;a++)128&s[a]?u+=t((127&s[a]).toString(2),7):(u+=t((127&s[a]).toString(2),7),l.push(new String(parseInt(u,2))),u="");var c=n.join(".");return l.length>0&&(c=c+"."+l.join(".")),c},ue.dump=function(e,t,n,r){var i=ue,o=i.getV,s=i.dump,a=i.getChildIdx,l=e;e instanceof se.asn1.ASN1Object&&(l=e.tohex());var u=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,h=t.ommit_long_octet;if("01"==(c=l.substr(n,2)))return"00"==(p=o(l,n))?r+"BOOLEAN FALSE\n":r+"BOOLEAN TRUE\n";if("02"==c)return r+"INTEGER "+u(p=o(l,n),h)+"\n";if("03"==c){var p=o(l,n);if(i.isASN1HEX(p.substr(2))){var d=r+"BITSTRING, encapsulates\n";return d+=s(p.substr(2),t,0,r+" ")}return r+"BITSTRING "+u(p,h)+"\n"}if("04"==c){p=o(l,n);if(i.isASN1HEX(p)){d=r+"OCTETSTRING, encapsulates\n";return d+=s(p,t,0,r+" ")}return r+"OCTETSTRING "+u(p,h)+"\n"}if("05"==c)return r+"NULL\n";if("06"==c){var f=o(l,n),g=se.asn1.ASN1Util.oidHexToInt(f),m=se.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(l,n))+"\n";if("0c"==c)return r+"UTF8String '"+be(o(l,n))+"'\n";if("13"==c)return r+"PrintableString '"+be(o(l,n))+"'\n";if("14"==c)return r+"TeletexString '"+be(o(l,n))+"'\n";if("16"==c)return r+"IA5String '"+be(o(l,n))+"'\n";if("17"==c)return r+"UTCTime "+be(o(l,n))+"\n";if("18"==c)return r+"GeneralizedTime "+be(o(l,n))+"\n";if("1a"==c)return r+"VisualString '"+be(o(l,n))+"'\n";if("1e"==c)return r+"BMPString '"+Me(o(l,n))+"'\n";if("30"==c){if("3000"==l.substr(n,4))return r+"SEQUENCE {}\n";d=r+"SEQUENCE\n";var y=t;if((2==(w=a(l,n)).length||3==w.length)&&"06"==l.substr(w[0],2)&&"04"==l.substr(w[w.length-1],2)){m=i.oidname(o(l,w[0]));var b=JSON.parse(JSON.stringify(t));b.x509ExtName=m,y=b}for(var $=0;$<w.length;$++)d+=s(l,y,w[$],r+" ");return d}if("31"==c){d=r+"SET\n";var w=a(l,n);for($=0;$<w.length;$++)d+=s(l,t,w[$],r+" ");return d}if(0!=(128&(c=parseInt(c,16)))){var x=31&c;if(0!=(32&c)){for(d=r+"["+x+"]\n",w=a(l,n),$=0;$<w.length;$++)d+=s(l,t,w[$],r+" ");return d}p=o(l,n);if(ue.isASN1HEX(p)){var d=r+"["+x+"]\n";return d+=s(p,t,0,r+" ")}return("68747470"==p.substr(0,8)||"subjectAltName"===t.x509ExtName&&2==x)&&(p=be(p)),d=r+"["+x+"] "+p+"\n"}return r+"UNKNOWN("+c+") "+o(l,n)+"\n"},ue.parse=function(e){var t=ue,n=t.parse,r=t.isASN1HEX,i=t.getV,o=t.getTLV,s=t.getChildIdx,a=se.asn1,l=a.ASN1Util.oidHexToInt,u=a.x509.OID.oid2name,c=be,h=Me,p=$e,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=Xe(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=l(m),$=u(b);return""==$?{oid:b}:{oid:$}}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=s(e,0),i=0;i<r.length;i++){var a=r[i],l=o(e,a),u=n(l);t.push(u)}return t}(e),g;if("14"==f){var w=p(m);return g[d[f]]={str:w},g}if("1e"==f){w=h(m);return g[d[f]]={str:w},g}if(-1!=":0c:12:13:16:17:18:1a:".indexOf(f)){w=c(m);return g[d[f]]={str:w},g}if(f.match(/^8[0-9]$/))return null==(w=c(m))|""==w||null!=w.match(/[\x00-\x1F\x7F-\x9F]/)||null!=w.match(/[\u0000-\u001F\u0080–\u009F]/)?{tag:{tag:f,explicit:!1,hex:m}}:{tag:{tag:f,explicit:!1,str:w}};if(!f.match(/^a[0-9]$/)){var x=new se.asn1.ASN1Object;return x.hV=m,{asn1:{tlv:f+x.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}}}}},ue.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}},ue.isASN1HEX=function(e){var t=ue;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},ue.checkStrictDER=function(e,t,n,r,i){var o=ue;if(void 0===n){if("string"!=typeof e)throw new Error("not hex string");if(e=e.toLowerCase(),!se.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 s=o.getVblen(e,t);if(s>r)throw new Error("value of L too long than hex: idx="+t);var a=o.getTLV(e,t),l=a.length-2-o.getL(e,t).length;if(l!==2*s)throw new Error("V string length and L's value not the same:"+l+"/"+2*s);if(0===t&&e.length!=a.length)throw new Error("total length and TLV length unmatch:"+e.length+"!="+a.length);var u=e.substr(t,2);if("02"===u){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(u,16)){for(var h=o.getVblen(e,t),p=0,d=o.getChildIdx(e,t),f=0;f<d.length;f++){p+=o.getTLV(e,d[f]).length,o.checkStrictDER(e,d[f],n,r,i)}if(2*h!=p)throw new Error("sum of children's TLV length and L unmatch: "+2*h+"!="+p)}},ue.oidname=function(e){var t=se.asn1;se.lang.String.isHex(e)&&(e=t.ASN1Util.oidHexToInt(e));var n=t.x509.OID.oid2name(e);return""===n&&(n=e),n},void 0!==se&&se||(se={}),void 0!==se.asn1&&se.asn1||(se.asn1={}),void 0!==se.asn1.x509&&se.asn1.x509||(se.asn1.x509={}),se.asn1.x509.Certificate=function(e){se.asn1.x509.Certificate.superclass.constructor.call(this);var t=se.asn1,n=t.DERBitString,r=t.DERSequence,i=t.x509,o=i.TBSCertificate,s=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 se.crypto.Signature({alg:t});r.init(e.cakey),r.updateHex(n),e.sighex=r.sign()},this.getPEM=function(){return Ce(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 s({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(se.asn1.x509.Certificate,se.asn1.ASN1Object),se.asn1.x509.TBSCertificate=function(e){se.asn1.x509.TBSCertificate.superclass.constructor.call(this);var t=se.asn1,n=t.x509,r=t.DERTaggedObject,i=t.DERInteger,o=t.DERSequence,s=n.AlgorithmIdentifier,a=n.Time,l=n.X500Name,u=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 h=new r({obj:new i({int:n})});e.push(h)}return e.push(new i(t.serial)),e.push(new s({name:t.sigalg})),e.push(new l(t.issuer)),e.push(new o({array:[new a(t.notbefore),new a(t.notafter)]})),e.push(new l(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 u(t.ext)})),new se.asn1.DERSequence({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},et(se.asn1.x509.TBSCertificate,se.asn1.ASN1Object),se.asn1.x509.Extensions=function(e){se.asn1.x509.Extensions.superclass.constructor.call(this);var t=se.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,s=null;if(null!=i.extn)s=new r.PrivateExtension(i);else if("subjectKeyIdentifier"==o)s=new r.SubjectKeyIdentifier(i);else if("keyUsage"==o)s=new r.KeyUsage(i);else if("subjectAltName"==o)s=new r.SubjectAltName(i);else if("issuerAltName"==o)s=new r.IssuerAltName(i);else if("basicConstraints"==o)s=new r.BasicConstraints(i);else if("nameConstraints"==o)s=new r.NameConstraints(i);else if("cRLDistributionPoints"==o)s=new r.CRLDistributionPoints(i);else if("certificatePolicies"==o)s=new r.CertificatePolicies(i);else if("policyMappings"==o)s=new r.PolicyMappings(i);else if("policyConstraints"==o)s=new r.PolicyConstraints(i);else if("inhibitAnyPolicy"==o)s=new r.InhibitAnyPolicy(i);else if("authorityKeyIdentifier"==o)s=new r.AuthorityKeyIdentifier(i);else if("extKeyUsage"==o)s=new r.ExtKeyUsage(i);else if("authorityInfoAccess"==o)s=new r.AuthorityInfoAccess(i);else if("cRLNumber"==o)s=new r.CRLNumber(i);else if("cRLReason"==o)s=new r.CRLReason(i);else if("ocspNonce"==o)s=new r.OCSPNonce(i);else if("ocspNoCheck"==o)s=new r.OCSPNoCheck(i);else if("adobeTimeStamp"==o)s=new r.AdobeTimeStamp(i);else{if("subjectDirectoryAttributes"!=o)throw new Error("extension not supported:"+JSON.stringify(i));s=new r.SubjectDirectoryAttributes(i)}null!=s&&e.push(s)}return new n({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(se.asn1.x509.Extensions,se.asn1.ASN1Object),se.asn1.x509.Extension=function(e){se.asn1.x509.Extension.superclass.constructor.call(this);var t=se.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()}),s=new Array;return s.push(e),this.critical&&s.push(new i),s.push(t),new o({array:s}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.critical=!1,void 0!==e&&void 0!==e.critical&&(this.critical=e.critical)},et(se.asn1.x509.Extension,se.asn1.ASN1Object),se.asn1.x509.KeyUsage=function(e){se.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 se.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 Qe(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(se.asn1.x509.KeyUsage,se.asn1.x509.Extension),se.asn1.x509.BasicConstraints=function(e){se.asn1.x509.BasicConstraints.superclass.constructor.call(this,e);var t=se.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(se.asn1.x509.BasicConstraints,se.asn1.x509.Extension),se.asn1.x509.CRLDistributionPoints=function(e){se.asn1.x509.CRLDistributionPoints.superclass.constructor.call(this,e);var t=se.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 se.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(se.asn1.x509.CRLDistributionPoints,se.asn1.x509.Extension),se.asn1.x509.DistributionPoint=function(e){se.asn1.x509.DistributionPoint.superclass.constructor.call(this);var t=se.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(se.asn1.x509.DistributionPoint,se.asn1.ASN1Object),se.asn1.x509.DistributionPointName=function(e){se.asn1.x509.DistributionPointName.superclass.constructor.call(this);var t=se.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(se.asn1.x509.DistributionPointName,se.asn1.ASN1Object),se.asn1.x509.CertificatePolicies=function(e){se.asn1.x509.CertificatePolicies.superclass.constructor.call(this,e);var t=se.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(se.asn1.x509.CertificatePolicies,se.asn1.x509.Extension),se.asn1.x509.PolicyInformation=function(e){se.asn1.x509.PolicyInformation.superclass.constructor.call(this,e);var t=se.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(se.asn1.x509.PolicyInformation,se.asn1.ASN1Object),se.asn1.x509.PolicyQualifierInfo=function(e){se.asn1.x509.PolicyQualifierInfo.superclass.constructor.call(this,e);var t=se.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(se.asn1.x509.PolicyQualifierInfo,se.asn1.ASN1Object),se.asn1.x509.UserNotice=function(e){se.asn1.x509.UserNotice.superclass.constructor.call(this,e);var t=se.asn1.DERSequence,n=(se.asn1.DERInteger,se.asn1.x509.DisplayText),r=se.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(se.asn1.x509.UserNotice,se.asn1.ASN1Object),se.asn1.x509.NoticeReference=function(e){se.asn1.x509.NoticeReference.superclass.constructor.call(this,e);var t=se.asn1.DERSequence,n=se.asn1.DERInteger,r=se.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,s=0;s<o.length;s++)i.push(new n(o[s]));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(se.asn1.x509.NoticeReference,se.asn1.ASN1Object),se.asn1.x509.DisplayText=function(e){se.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(se.asn1.x509.DisplayText,se.asn1.DERAbstractString),se.asn1.x509.PolicyMappings=function(e){se.asn1.x509.PolicyMappings.superclass.constructor.call(this,e);var t=se.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(se.asn1.x509.PolicyMappings,se.asn1.x509.Extension),se.asn1.x509.PolicyConstraints=function(e){se.asn1.x509.PolicyConstraints.superclass.constructor.call(this,e);var t=se.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(se.asn1.x509.PolicyConstraints,se.asn1.x509.Extension),se.asn1.x509.InhibitAnyPolicy=function(e){se.asn1.x509.InhibitAnyPolicy.superclass.constructor.call(this,e);var t=se.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(se.asn1.x509.InhibitAnyPolicy,se.asn1.x509.Extension),se.asn1.x509.NameConstraints=function(e){se.asn1.x509.NameConstraints.superclass.constructor.call(this,e);var t=se.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 s=[];for(o=0;o<e.exclude.length;o++)s.push(new i(e.exclude[o]));t.push({tag:{tagi:"a1",obj:{seq:s}}})}return this.asn1ExtnValue=r({seq:t}),this.asn1ExtnValue.tohex()},this.oid="2.5.29.30",void 0!==e&&(this.params=e)},et(se.asn1.x509.NameConstraints,se.asn1.x509.Extension),se.asn1.x509.GeneralSubtree=function(e){se.asn1.x509.GeneralSubtree.superclass.constructor.call(this);var t=se.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(se.asn1.x509.GeneralSubtree,se.asn1.ASN1Object),se.asn1.x509.ExtKeyUsage=function(e){se.asn1.x509.ExtKeyUsage.superclass.constructor.call(this,e);var t=se.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(se.asn1.x509.ExtKeyUsage,se.asn1.x509.Extension),se.asn1.x509.AuthorityKeyIdentifier=function(e){se.asn1.x509.AuthorityKeyIdentifier.superclass.constructor.call(this,e);var t=se,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 se.asn1.DEROctetString(e);else if("object"==typeof e&&se.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 se.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 se.asn1.x509.X500Name(e):"string"==typeof e&&-1!=e.indexOf("BEGIN ")&&-1!=e.indexOf("CERTIFICATE")&&(this.asn1CertIssuer=new se.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 se.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 se.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(se.asn1.x509.AuthorityKeyIdentifier,se.asn1.x509.Extension),se.asn1.x509.SubjectKeyIdentifier=function(e){se.asn1.x509.SubjectKeyIdentifier.superclass.constructor.call(this,e);var t=se.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&&se.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 se.asn1.DEROctetString({hex:r})}},this.oid="2.5.29.14",void 0!==e&&void 0!==e.kid&&this.setKIDByParam(e.kid)},et(se.asn1.x509.SubjectKeyIdentifier,se.asn1.x509.Extension),se.asn1.x509.AuthorityInfoAccess=function(e){se.asn1.x509.AuthorityInfoAccess.superclass.constructor.call(this,e),this.setAccessDescriptionArray=function(e){for(var t=new Array,n=se.asn1,r=n.DERSequence,i=n.DERObjectIdentifier,o=n.x509.GeneralName,s=0;s<e.length;s++){var a,l=e[s];if(void 0!==l.ocsp)a=new r({array:[new i({oid:"1.3.6.1.5.5.7.48.1"}),new o({uri:l.ocsp})]});else{if(void 0===l.caissuer)throw new Error("unknown AccessMethod parameter: "+JSON.stringify(l));a=new r({array:[new i({oid:"1.3.6.1.5.5.7.48.2"}),new o({uri:l.caissuer})]})}t.push(a)}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(se.asn1.x509.AuthorityInfoAccess,se.asn1.x509.Extension),se.asn1.x509.SubjectAltName=function(e){se.asn1.x509.SubjectAltName.superclass.constructor.call(this,e),this.setNameArray=function(e){this.asn1ExtnValue=new se.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(se.asn1.x509.SubjectAltName,se.asn1.x509.Extension),se.asn1.x509.IssuerAltName=function(e){se.asn1.x509.IssuerAltName.superclass.constructor.call(this,e),this.setNameArray=function(e){this.asn1ExtnValue=new se.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(se.asn1.x509.IssuerAltName,se.asn1.x509.Extension),se.asn1.x509.SubjectDirectoryAttributes=function(e){se.asn1.x509.SubjectDirectoryAttributes.superclass.constructor.call(this,e);var t=se.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 s={seq:[{oid:"1.2.3.4"},{set:[{utf8str:"DE"}]}]};if("dateOfBirth"==o.attr)s.seq[0].oid=i(o.attr),s.seq[1].set[0]={gentime:o.str};else if("placeOfBirth"==o.attr)s.seq[0].oid=i(o.attr),s.seq[1].set[0]={utf8str:o.str};else if("gender"==o.attr)s.seq[0].oid=i(o.attr),s.seq[1].set[0]={prnstr:o.str};else if("countryOfCitizenship"==o.attr)s.seq[0].oid=i(o.attr),s.seq[1].set[0]={prnstr:o.str};else{if("countryOfResidence"!=o.attr)throw new Error("unsupported attribute: "+o.attr);s.seq[0].oid=i(o.attr),s.seq[1].set[0]={prnstr:o.str}}e.push(new r(s))}else{var a={seq:[{oid:o.attr},{set:o.array}]};e.push(r(a))}}var l=new n({array:e});return this.asn1ExtnValue=l,this.asn1ExtnValue.tohex()},this.oid="2.5.29.9",void 0!==e&&(this.params=e)},et(se.asn1.x509.SubjectDirectoryAttributes,se.asn1.x509.Extension),se.asn1.x509.PrivateExtension=function(e){se.asn1.x509.PrivateExtension.superclass.constructor.call(this,e);var t=se,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(se.asn1.x509.PrivateExtension,se.asn1.x509.Extension),se.asn1.x509.CRL=function(e){se.asn1.x509.CRL.superclass.constructor.call(this);var t=se.asn1,n=t.DERSequence,r=t.DERBitString,i=t.x509,o=i.AlgorithmIdentifier,s=i.TBSCertList;this.params=void 0,this.setByParam=function(e){this.params=e},this.sign=function(){var e=new s(this.params).tohex(),t=new se.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 Ce(this.tohex(),"X509 CRL")},this.tohex=function(){var e=this.params;if(null==e.tbsobj&&(e.tbsobj=new s(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(se.asn1.x509.CRL,se.asn1.ASN1Object),se.asn1.x509.TBSCertList=function(e){se.asn1.x509.TBSCertList.superclass.constructor.call(this);var t=se.asn1,n=t.DERInteger,r=t.DERSequence,i=t.DERTaggedObject,o=(t.DERObjectIdentifier,t.x509),s=o.AlgorithmIdentifier,a=o.Time,l=o.Extensions,u=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 a(t[i].date)];null!=t[i].ext&&o.push(new l(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 s({name:t.sigalg})),e.push(new u(t.issuer)),e.push(new a(t.thisupdate)),null!=t.nextupdate&&e.push(new a(t.nextupdate)),null!=t.revcert&&e.push(this.getRevCertSequence()),null!=t.ext){var h=new l(t.ext);e.push(new i({tag:"a0",explicit:!0,obj:h}))}return new r({array:e}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},et(se.asn1.x509.TBSCertList,se.asn1.ASN1Object),se.asn1.x509.CRLEntry=function(e){se.asn1.x509.CRLEntry.superclass.constructor.call(this);var t=se.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(se.asn1.x509.CRLEntry,se.asn1.ASN1Object),se.asn1.x509.CRLNumber=function(e){se.asn1.x509.CRLNumber.superclass.constructor.call(this,e),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new se.asn1.DERInteger(this.params.num),this.asn1ExtnValue.tohex()},this.oid="2.5.29.20",null!=e&&(this.params=e)},et(se.asn1.x509.CRLNumber,se.asn1.x509.Extension),se.asn1.x509.CRLReason=function(e){se.asn1.x509.CRLReason.superclass.constructor.call(this,e),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new se.asn1.DEREnumerated(this.params.code),this.asn1ExtnValue.tohex()},this.oid="2.5.29.21",null!=e&&(this.params=e)},et(se.asn1.x509.CRLReason,se.asn1.x509.Extension),se.asn1.x509.OCSPNonce=function(e){se.asn1.x509.OCSPNonce.superclass.constructor.call(this,e),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new se.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(se.asn1.x509.OCSPNonce,se.asn1.x509.Extension),se.asn1.x509.OCSPNoCheck=function(e){se.asn1.x509.OCSPNoCheck.superclass.constructor.call(this,e),this.params=void 0,this.getExtnValueHex=function(){return this.asn1ExtnValue=new se.asn1.DERNull,this.asn1ExtnValue.tohex()},this.oid="1.3.6.1.5.5.7.48.1.5",null!=e&&(this.params=e)},et(se.asn1.x509.OCSPNoCheck,se.asn1.x509.Extension),se.asn1.x509.AdobeTimeStamp=function(e){se.asn1.x509.AdobeTimeStamp.superclass.constructor.call(this,e);var t=se.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(se.asn1.x509.AdobeTimeStamp,se.asn1.x509.Extension),se.asn1.x509.X500Name=function(e){se.asn1.x509.X500Name.superclass.constructor.call(this),this.asn1Array=[],this.paramArray=[],this.sRule="utf8";var t=se.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 s=i.length-1;i[s]=i[s]+"/"+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(se.asn1.x509.X500Name,se.asn1.ASN1Object),se.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(",")},se.asn1.x509.X500Name.onelineToLDAP=function(e){return se.asn1.x509.X500Name.compatToLDAP(e)},se.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 s=(r.pop()+","+o).replace(/\\,/g,",");r.push(s),n=!1}else r.push(o);"\\"===o.substr(-1,1)&&(n=!0)}return(r=r.map((function(e){return e.replace("/","\\/")}))).reverse(),"/"+r.join("/")},se.asn1.x509.X500Name.ldapToOneline=function(e){return se.asn1.x509.X500Name.ldapToCompat(e)},se.asn1.x509.RDN=function(e){se.asn1.x509.RDN.superclass.constructor.call(this),this.asn1Array=[],this.paramArray=[],this.sRule="utf8";var t=se.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 se.asn1.x509.AttributeTypeAndValue({str:e,rule:this.sRule}))},this.addByMultiValuedString=function(e){for(var t=se.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 se.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(se.asn1.x509.RDN,se.asn1.ASN1Object),se.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 s=(r.pop()+"+"+o).replace(/\\\+/g,"+");r.push(s),n=!1}else r.push(o);"\\"===o.substr(-1,1)&&(n=!0)}var a=!1,l=[];for(i=0;r.length>0;i++){o=r.shift();if(!0===a){var u=l.pop();if(o.match(/"$/)){s=(u+"+"+o).replace(/^([^=]+)="(.*)"$/,"$1=$2");l.push(s),a=!1}else l.push(u+"+"+o)}else l.push(o);o.match(/^[^=]+="/)&&(a=!0)}return l},se.asn1.x509.AttributeTypeAndValue=function(e){se.asn1.x509.AttributeTypeAndValue.superclass.constructor.call(this),this.sRule="utf8",this.sType=null,this.sValue=null,this.dsType=null;var t=se,n=t.asn1,r=n.DERSequence,i=n.DERUTF8String,o=n.DERPrintableString,s=n.DERTeletexString,a=n.DERIA5String,l=n.DERVisibleString,u=n.DERBMPString,c=t.lang.String.isMail,h=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":h(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 s({str:t});if("ia5"==e)return new a({str:t});if("vis"==e)return new l({str:t});if("bmp"==e)return new u({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=se.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(se.asn1.x509.AttributeTypeAndValue,se.asn1.ASN1Object),se.asn1.x509.SubjectPublicKeyInfo=function(e){se.asn1.x509.SubjectPublicKeyInfo.superclass.constructor.call(this);var t=se,n=t.asn1,r=n.DERInteger,i=n.DERBitString,o=n.DERObjectIdentifier,s=n.DERSequence,a=n.ASN1Util.newObject,l=n.x509.AlgorithmIdentifier,u=t.crypto;u.ECDSA,u.DSA;this.getASN1Object=function(){if(null==this.asn1AlgId||null==this.asn1SubjPKey)throw"algId and/or subjPubKey not set";return new s({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 te){var t=a({seq:[{int:{bigint:e.n}},{int:{int:e.e}}]}).tohex();this.asn1AlgId=new l({name:"rsaEncryption"}),this.asn1SubjPKey=new i({hex:"00"+t})}}catch(e){}try{if(e instanceof se.crypto.ECDSA){var n=new o({name:e.curveName});this.asn1AlgId=new l({name:"ecPublicKey",asn1params:n}),this.asn1SubjPKey=new i({hex:"00"+e.pubKeyHex})}}catch(e){}try{if(e instanceof se.crypto.DSA){n=new a({seq:[{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.g}}]});this.asn1AlgId=new l({name:"dsa",asn1params:n});var s=new r({bigint:e.y});this.asn1SubjPKey=new i({hex:"00"+s.tohex()})}}catch(e){}},void 0!==e&&this.setPubKey(e)},et(se.asn1.x509.SubjectPublicKeyInfo,se.asn1.ASN1Object),se.asn1.x509.Time=function(e){se.asn1.x509.Time.superclass.constructor.call(this);var t=se.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)},se.asn1.x509.Time_bak=function(e){se.asn1.x509.Time_bak.superclass.constructor.call(this);var t=se.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(se.asn1.x509.Time,se.asn1.ASN1Object),se.asn1.x509.AlgorithmIdentifier=function(e){se.asn1.x509.AlgorithmIdentifier.superclass.constructor.call(this),this.nameAlg=null,this.asn1Alg=null,this.asn1Params=null,this.paramEmpty=!1;var t=se.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(se.asn1.x509.AlgorithmIdentifier,se.asn1.ASN1Object),se.asn1.x509.AlgorithmIdentifier.PSSNAME2ASN1TLV={SHAwithRSAandMGF1:"300d06092a864886f70d01010a3000",SHA256withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040201a11a301806092a864886f70d010108300b0609608648016503040201a203020120",SHA384withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040202a11a301806092a864886f70d010108300b0609608648016503040202a203020130",SHA512withRSAandMGF1:"303d06092a864886f70d01010a3030a00d300b0609608648016503040203a11a301806092a864886f70d010108300b0609608648016503040203a203020140"},se.asn1.x509.GeneralName=function(e){se.asn1.x509.GeneralName.superclass.constructor.call(this);var t=se.asn1,n=t.x509,r=n.X500Name,i=n.OtherName,o=t.DERIA5String,s=(t.DERPrintableString,t.DEROctetString),a=t.DERTaggedObject,l=t.ASN1Object,u=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 se.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 h,p;e="a4",c=!0;var d=null;if(void 0!==n.certsubj?(h=!1,p=n.certsubj):(h=!0,p=n.certissuer),p.match(/^[0-9A-Fa-f]+$/),-1!=p.indexOf("-----BEGIN ")&&(d=Te(p)),null==d)throw new Error("certsubj/certissuer not cert");var f,g=new ot;g.hex=d,f=h?g.getIssuerHex():g.getSubjectHex(),(t=new l).hTLV=f}else if(void 0!==n.uri)e="86",t=new o({str:n.uri});else{if(void 0===n.ip)throw new u("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=Le(v)}catch(e){throw new u("malformed IP address: "+n.ip+":"+e.message)}t=new s({hex:m})}return new a({tag:e,explicit:c,obj:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},et(se.asn1.x509.GeneralName,se.asn1.ASN1Object),se.asn1.x509.GeneralNames=function(e){se.asn1.x509.GeneralNames.superclass.constructor.call(this);var t=se.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(se.asn1.x509.GeneralNames,se.asn1.ASN1Object),se.asn1.x509.OtherName=function(e){se.asn1.x509.OtherName.superclass.constructor.call(this);var t=se.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(se.asn1.x509.OtherName,se.asn1.ASN1Object),se.asn1.x509.OID=new function(){var e=se.asn1.DERObjectIdentifier;this.name2oidList={"aes128-CBC":"2.16.840.1.101.3.4.1.2","aes256-CBC":"2.16.840.1.101.3.4.1.42",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",hmacWithSHA1:"1.2.840.113549.2.7",hmacWithSHA224:"1.2.840.113549.2.8",hmacWithSHA256:"1.2.840.113549.2.9",hmacWithSHA384:"1.2.840.113549.2.10",hmacWithSHA512:"1.2.840.113549.2.11",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}}},se.asn1.x509.OID.oid2name=function(e){var t=se.asn1.x509.OID.name2oidList;for(var n in t)if(t[n]==e)return n;return""},se.asn1.x509.OID.oid2atype=function(e){var t=se.asn1.x509.OID.atype2oidList;for(var n in t)if(t[n]==e)return n;return e},se.asn1.x509.OID.name2oid=function(e){if(e.match(/^[0-9.]+$/))return e;var t=se.asn1.x509.OID.name2oidList;return void 0===t[e]?"":t[e]},se.asn1.x509.X509Util={},se.asn1.x509.X509Util.newCertPEM=function(e){var t=se.asn1.x509;t.TBSCertificate;return new(0,t.Certificate)(e).getPEM()},void 0!==se&&se||(se={}),void 0!==se.asn1&&se.asn1||(se.asn1={}),void 0!==se.asn1.cms&&se.asn1.cms||(se.asn1.cms={}),se.asn1.cms.Attribute=function(e){var t=Error,n=se.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(se.asn1.cms.Attribute,se.asn1.ASN1Object),se.asn1.cms.ContentType=function(e){var t=se.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(se.asn1.cms.ContentType,se.asn1.cms.Attribute),se.asn1.cms.MessageDigest=function(e){var t=se.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(se.asn1.cms.MessageDigest,se.asn1.cms.Attribute),se.asn1.cms.SigningTime=function(e){var t=se.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(se.asn1.cms.SigningTime,se.asn1.cms.Attribute),se.asn1.cms.SigningCertificate=function(e){var t=Error,n=se,r=n.asn1,i=r.DERSequence,o=r.cms,s=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 a=n[o];0!=e.hasis||"string"!=typeof a||-1==a.indexOf("-----BEGIN")&&!ue.isASN1HEX(a)||(a={cert:a}),0!=a.hasis&&0==e.hasis&&(a.hasis=!1),r.push(new s(a))}var l=new i({array:r});return[new i({array:[l]})]},null!=e&&this.setByParam(e)},et(se.asn1.cms.SigningCertificate,se.asn1.cms.Attribute),se.asn1.cms.ESSCertID=function(e){se.asn1.cms.ESSCertID.superclass.constructor.call(this);var t=Error,n=se,r=n.asn1,i=r.DEROctetString,o=r.DERSequence,s=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")&&!ue.isASN1HEX(e))return e;var i,o,s;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):ue.isASN1HEX(e)&&(o=e)),null!=e.alg)s=e.alg;else{if(null==r)throw new t("hash alg unspecified");s=r}return n.crypto.Util.hashHex(o,s)},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 s(e)),new o({array:n}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(se.asn1.cms.ESSCertID,se.asn1.ASN1Object),se.asn1.cms.SigningCertificateV2=function(e){var t=Error,n=se,r=n.asn1,i=r.DERSequence,o=(r.x509,r.cms),s=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 a=n[o];null==e.alg&&0!=e.hasis||"string"!=typeof a||-1==a.indexOf("-----BEGIN")&&!ue.isASN1HEX(a)||(a={cert:a}),null==a.alg&&null!=e.alg&&(a.alg=e.alg),0!=a.hasis&&0==e.hasis&&(a.hasis=!1),r.push(new s(a))}var l=new i({array:r});return[new i({array:[l]})]},null!=e&&this.setByParam(e)},et(se.asn1.cms.SigningCertificateV2,se.asn1.cms.Attribute),se.asn1.cms.ESSCertIDv2=function(e){se.asn1.cms.ESSCertIDv2.superclass.constructor.call(this);Error;var t=se.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"),s=[];return null!=e.alg&&"sha256"!=e.alg&&s.push(new o({name:e.alg})),s.push(new n({hex:t})),("string"==typeof e&&-1!=e.indexOf("-----BEGIN")||null!=e.cert&&0!=e.hasis||null!=e.issuer&&null!=e.serial)&&s.push(new i(e)),new r({array:s}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(se.asn1.cms.ESSCertIDv2,se.asn1.cms.ESSCertID),se.asn1.cms.IssuerSerial=function(e){var t=Error,n=se.asn1,r=n.DERInteger,i=n.DERSequence,o=n.cms,s=n.x509.GeneralNames,a=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 l;l=null!=o.cert?o.cert:o;var u=new a;u.readCertPEM(l),e=u.getIssuer(),n={hex:u.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 s([{dn:e}]),h=new r(n);return new i({array:[c,h]}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(se.asn1.cms.IssuerSerial,se.asn1.ASN1Object),se.asn1.cms.SignerIdentifier=function(e){var t=se.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(se.asn1.cms.SignerIdentifier,se.asn1.ASN1Object),se.asn1.cms.IssuerAndSerialNumber=function(e){var t=se.asn1,n=t.DERInteger,r=t.DERSequence,i=t.cms,o=t.x509.X500Name,s=ot,a=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 l;l=null!=i.cert?i.cert:i;var u=new s;u.readCertPEM(l),e=u.getIssuer(),t={hex:u.getSerialNumberHex()}}else{if(null==i.issuer||!i.serial)throw new a("cert or issuer and serial parameter not specified");e=i.issuer,t=i.serial}var c=new o(e),h=new n(t);return new r({array:[c,h]}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.setByParam=function(e){this.params=e},null!=e&&this.setByParam(e)},et(se.asn1.cms.IssuerAndSerialNumber,se.asn1.ASN1Object),se.asn1.cms.SubjectKeyIdentifier=function(e){var t=se.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(se.asn1.cms.SubjectKeyIdentifier,se.asn1.ASN1Object),se.asn1.cms.AttributeList=function(e){var t=Error,n=se.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,s=[],a=0;a<o.length;a++){var l=o[a],u=l.attr;if("contentType"==u)s.push(new i.ContentType(l));else if("messageDigest"==u)s.push(new i.MessageDigest(l));else if("signingTime"==u)s.push(new i.SigningTime(l));else if("signingCertificate"==u)s.push(new i.SigningCertificate(l));else if("signingCertificateV2"==u)s.push(new i.SigningCertificateV2(l));else if("signaturePolicyIdentifier"==u)s.push(new se.asn1.cades.SignaturePolicyIdentifier(l));else{if("signatureTimeStamp"!=u&&"timeStampToken"!=u)throw new t("unknown attr: "+u);s.push(new se.asn1.cades.SignatureTimeStamp(l))}}var c=new r({array:s,sortflag:n});return this.hTLV=c.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(se.asn1.cms.AttributeList,se.asn1.ASN1Object),se.asn1.cms.SignerInfo=function(e){var t=Error,n=se,r=n.asn1,i=r.DERInteger,o=r.DEROctetString,s=r.DERSequence,a=r.DERTaggedObject,l=r.cms,u=l.SignerIdentifier,c=l.AttributeList,h=(l.ContentType,l.EncapsulatedContentInfo,l.MessageDigest,l.SignedData,r.x509.AlgorithmIdentifier),p=n.crypto,d=tt;l.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 p.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 u(e.id)),n.push(new h({name:e.hashalg})),null!=e.sattrs){var r=new c(e.sattrs);try{n.push(new a({tag:"a0",explicit:!1,obj:r}))}catch(e){throw new t("si sattr error: "+e)}}if(null!=e.sigalgfield?n.push(new h({name:e.sigalgfield})):n.push(new h({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 a({tag:"a1",explicit:!1,obj:r}))}catch(e){throw new t("si uattr error: "+e)}}return new s({array:n}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(se.asn1.cms.SignerInfo,se.asn1.ASN1Object),se.asn1.cms.EncapsulatedContentInfo=function(e){var t=se.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 s=new o(e.content),a=new n({tag:"a0",explicit:!0,obj:s});t.push(a)}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(se.asn1.cms.EncapsulatedContentInfo,se.asn1.ASN1Object),se.asn1.cms.ContentInfo=function(e){var t=se.asn1,n=t.DERTaggedObject,r=t.DERSequence,i=t.DERObjectIdentifier;t.x509.OID.name2obj;se.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(se.asn1.cms.ContentInfo,se.asn1.ASN1Object),se.asn1.cms.SignedData=function(e){Error;var t=se.asn1,n=(t.ASN1Object,t.DERInteger),r=t.DERSet,i=t.DERSequence,o=(t.DERTaggedObject,t.cms),s=o.EncapsulatedContentInfo,a=o.SignerInfo,l=o.ContentInfo,u=o.CertificateSet,c=o.RevocationInfoChoices,h=t.x509.AlgorithmIdentifier;se.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=xe(t.content.str));for(var r=e.sinfos,i=0;i<r.length;i++){var o=r[i],s=o.hashalg,a=this._getAttrParamByName(o,"messageDigest"),l=se.crypto.Util.hashHex(n,s);a.hex=l}},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=[],l=0;l<e.hashalgs.length;l++){var p=e.hashalgs[l];o.push(new h({name:p}))}t.push(new r({array:o})),t.push(new s(e.econtent)),null!=e.certs&&t.push(new u(e.certs)),null!=e.revinfos&&t.push(new c(e.revinfos));var d=[];for(l=0;l<e.sinfos.length;l++){var f=e.sinfos[l];d.push(new a(f))}return t.push(new r({array:d})),new i({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},this.getContentInfo=function(){return new l({type:"signed-data",obj:this})},this.getContentInfoEncodedHex=function(){return this.getContentInfo().tohex()},null!=e&&this.setByParam(e)},et(se.asn1.cms.SignedData,se.asn1.ASN1Object),se.asn1.cms.CertificateSet=function(e){se.asn1.cms.CertificateSet.superclass.constructor.call(this);var t=Error,n=se.asn1,r=n.DERTaggedObject,i=n.DERSet,o=n.ASN1Object;this.params=null,this.tohex=function(){var e,n=this.params,s=[];if(n instanceof Array)e=n;else{if(null==n.array)throw new t("cert array not specified");e=n.array}for(var a=0;a<e.length;a++){var l=Te(e[a]),u=new o;u.hTLV=l,s.push(u)}var c={array:s};0==n.sortflag&&(c.sortflag=!1);var h=new i(c);return new r({tag:"a0",explicit:!1,obj:h}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(se.asn1.cms.CertificateSet,se.asn1.ASN1Object),se.asn1.cms.RevocationInfoChoices=function(e){se.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 se.asn1.cms.RevocationInfoChoice(e[n]));return se.asn1.ASN1Util.newObject({tag:{tagi:"a1",obj:{set:t}}}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(se.asn1.cms.RevocationInfoChoices,se.asn1.ASN1Object),se.asn1.cms.RevocationInfoChoice=function(e){se.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 se.asn1.ASN1Util.newObject({tag:{tagi:"a1",obj:new se.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(se.asn1.cms.RevocationInfoChoice,se.asn1.ASN1Object),se.asn1.cms.OtherRevocationFormat=function(e){se.asn1.cms.OtherRevocationFormat.superclass.constructor.call(this);var t=Error,n=se,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)||!ue.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(se.asn1.cms.OtherRevocationFormat,se.asn1.ASN1Object),se.asn1.cms.CMSUtil=new function(){},se.asn1.cms.CMSUtil.newSignedData=function(e){return new se.asn1.cms.SignedData(e)},se.asn1.cms.CMSUtil.verifySignedData=function(e){var t=se,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=ue,s=o.getVbyList,a=o.getTLVbyList,l=o.getIdxbyList,u=o.getChildIdx,c=o.getTLV,h=o.oidname,p=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=a(e,n,[1,0],"30"),t.signerid_serial1=s(e,n,[1,1],"02"),t.hashalg=h(s(e,n,[2,0],"06"));var r=l(e,n,[3],"a0");t.idxSignedAttrs=r,g(e,t,r);var i=u(e,n).length;if(i<6)throw"malformed SignerInfo";t.sigalg=h(s(e,n,[i-2,0],"06")),t.sigval=s(e,n,[i-1],"04")},g=function(e,t,n){var r=u(e,n);t.signedAttrIdxList=r;for(var i=0;i<r.length;i++){var o,a=r[i],l=s(e,a,[0],"06");"2a864886f70d010905"===l?(o=be(s(e,a,[1,0])),t.saSigningTime=o):"2a864886f70d010904"===l&&(o=s(e,a,[1,0],"04"),t.saMessageDigest=o)}},m=function(e,t,n,r){n.verifyDetail={};var i=n.verifyDetail,o=t.parse.econtent,s=n.hashalg,a=n.saMessageDigest;i.validMessageDigest=!1,p(o,s)===a&&(i.validMessageDigest=!0),function(e,t,n,r){var i,o=t.parse.certsIdx;if(void 0===t.certs){i=[],t.certkeys=[];for(var s=u(e,o),a=0;a<s.length;a++){var l=c(e,s[a]),h=new ot;h.readCertHex(l),i[a]=h,t.certkeys[a]=h.getPublicKey()}t.certs=i}else i=t.certs;t.cccc=i.length,t.cccci=s.length;for(a=0;a<i.length;a++){var p=h.getIssuerHex(),d=h.getSerialNumberHex();n.signerid_issuer1===p&&n.signerid_serial1===d&&(n.certkey_idx=a)}}(e,t,n),i.validSignatureValue=!1;var l=n.sigalg,h="31"+c(e,n.idxSignedAttrs).substr(2);n.signedattrshex=h;var d=t.certs[n.certkey_idx].getPublicKey(),f=new se.crypto.Signature({alg:l});f.init(d),f.updateHex(h);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"!==s(e,0,[0],"06"))return t;t.cmsType="signedData",t.econtent=s(e,0,[1,0,2,1,0]),function(e,t){for(var n,r=3;r<6;r++)if(void 0!==(n=l(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=u(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 s=n[o];m(e,t,s,o),s.isValid||(i=!1)}t.isValid=i}(d,v),v},se.asn1.cms.CMSParser=function(){var e=Error,t=ot,n=new t,r=ue,i=r.getV,o=r.getTLV,s=(r.getIdxbyList,r.getTLVbyList),a=r.getTLVbyListEx,l=r.getVbyList,u=r.getVbyListEx,c=r.getChildIdx;this.getCMSSignedData=function(e){var t=s(e,0,[1,0]);return this.getSignedData(t)},this.getSignedData=function(e){var t=c(e,0),n={},r=i(e,t[0]),s=parseInt(r,16);n.version=s;var l=o(e,t[1]);n.hashalgs=this.getHashAlgArray(l);var u=o(e,t[2]);n.econtent=this.getEContent(u);var h=a(e,0,["[0]"]);null!=h&&(n.certs=this.getCertificateSet(h));a(e,0,["[1]"]);var p=a(e,0,[3]);return n.sinfos=this.getSignerInfos(p),n},this.getHashAlgArray=function(e){for(var n=c(e,0),r=new t,i=[],s=0;s<n.length;s++){var a=o(e,n[s]),l=r.getAlgorithmIdentifierName(a);i.push(l)}return i},this.getEContent=function(e){var t={},n=l(e,0,[0]),r=l(e,0,[1,0]);return t.type=se.asn1.x509.OID.oid2name(ue.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]),s=this.getSignerInfo(i);t.push(s)}return t},this.getSignerInfo=function(e){var t={},i=c(e,0),s=r.getInt(e,i[0],-1);-1!=s&&(t.version=s);var l=o(e,i[1]),h=this.getIssuerAndSerialNumber(l);t.id=h;var p=o(e,i[2]),d=n.getAlgorithmIdentifierName(p);t.hashalg=d;var f=a(e,0,["[0]"]);if(null!=f){var g=this.getAttributeList(f);t.sattrs=g}var m=a(e,0,[3]),v=n.getAlgorithmIdentifierName(m);t.sigalg=v;var y=u(e,0,[4]);t.sighex=y;var b=a(e,0,["[1]"]);if(null!=b){var $=this.getAttributeList(b);t.uattrs=$}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),s=o(e,r[0]);t.issuer=n.getX500Name(s);var a=i(e,r[1]);return t.serial={hex:a},t},this.getAttributeList=function(e){for(var t=[],n=c(e,0),r=0;r<n.length;r++){var i=o(e,n[r]),s=this.getAttribute(i);t.push(s)}return{array:t}},this.getAttribute=function(e){var t={},n=c(e,0),i=r.getOID(e,n[0]),s=se.asn1.x509.OID.oid2name(i);t.attr=s;var a=o(e,n[1]),l=c(a,0);if(1==l.length)t.valhex=o(a,l[0]);else{for(var u=[],h=0;h<l.length;h++)u.push(o(a,l[h]));t.valhex=u}return"contentType"==s?this.setContentType(t):"messageDigest"==s?this.setMessageDigest(t):"signingTime"==s?this.setSigningTime(t):"signingCertificate"==s?this.setSigningCertificate(t):"signingCertificateV2"==s?this.setSigningCertificateV2(t):"signaturePolicyIdentifier"==s&&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=be(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=[],s=0;s<r.length;s++){var a=o(n,r[s]),l=this.getESSCertID(a);i.push(l)}e.array=i}if(t.length>1){var u=o(e.valhex,t[1]);e.polhex=u}delete e.valhex},this.setSignaturePolicyIdentifier=function(e){var n=c(e.valhex,0);if(n.length>0){var s=r.getOID(e.valhex,n[0]);e.oid=s}if(n.length>1){var a=new t,l=c(e.valhex,n[1]),u=o(e.valhex,l[0]),h=a.getAlgorithmIdentifierName(u);e.alg=h;var p=i(e.valhex,l[1]);e.hash=p}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=[],s=0;s<r.length;s++){var a=o(n,r[s]),l=this.getESSCertIDv2(a);i.push(l)}e.array=i}if(t.length>1){var u=o(e.valhex,t[1]);e.polhex=u}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 s=o(e,n[1]),a=this.getIssuerSerial(s);null!=a.serial&&(t.serial=a.serial),null!=a.issuer&&(t.issuer=a.issuer)}return t},this.getESSCertIDv2=function(t){var r={},s=c(t,0);if(s.length<1||3<s.length)throw new e("wrong number of elements");var a=0;if("30"==t.substr(s[0],2)){var l=o(t,s[0]);r.alg=n.getAlgorithmIdentifierName(l),a++}else r.alg="sha256";var u=i(t,s[a]);if(r.hash=u,s.length>a+1){var h=o(t,s[a+1]),p=this.getIssuerSerial(h);r.issuer=p.issuer,r.serial=p.serial}return r},this.getIssuerSerial=function(e){var t={},r=c(e,0),s=o(e,r[0]),a=n.getGeneralNames(s)[0].dn;t.issuer=a;var l=i(e,r[1]);return t.serial={hex:l},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 s=Ce(i,"CERTIFICATE");n.push(s)}}return{array:n,sortflag:!1}}},void 0!==se&&se||(se={}),void 0!==se.asn1&&se.asn1||(se.asn1={}),void 0!==se.asn1.tsp&&se.asn1.tsp||(se.asn1.tsp={}),se.asn1.tsp.TimeStampToken=function(e){var t=se.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(se.asn1.tsp.TimeStampToken,se.asn1.cms.SignedData),se.asn1.tsp.TSTInfo=function(e){Error;var t=se.asn1,n=t.DERSequence,r=t.DERInteger,i=t.DERBoolean,o=t.DERGeneralizedTime,s=t.DERObjectIdentifier,a=t.DERTaggedObject,l=t.tsp,u=l.MessageImprint,c=l.Accuracy,h=(t.x509.X500Name,t.x509.GeneralName);if(l.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 s({oid:e.policy})}void 0!==e.messageImprint&&(this.dMessageImprint=new u(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 a({tag:"a0",explicit:!0,obj:new h({dn:e.tsa})}))}},et(se.asn1.tsp.TSTInfo,se.asn1.ASN1Object),se.asn1.tsp.Accuracy=function(e){var t=se.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(se.asn1.tsp.Accuracy,se.asn1.ASN1Object),se.asn1.tsp.MessageImprint=function(e){var t=se.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(se.asn1.tsp.MessageImprint,se.asn1.ASN1Object),se.asn1.tsp.TimeStampReq=function(e){var t=se.asn1,n=t.DERSequence,r=t.DERInteger,i=t.DERBoolean,o=(t.ASN1Object,t.DERObjectIdentifier),s=t.tsp,a=s.MessageImprint;s.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 se.asn1.ASN1Object?t.push(e.messageImprint):t.push(new a(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(se.asn1.tsp.TimeStampReq,se.asn1.ASN1Object),se.asn1.tsp.TimeStampResp=function(e){var t=se.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(se.asn1.tsp.TimeStampResp,se.asn1.ASN1Object),se.asn1.tsp.PKIStatusInfo=function(e){var t=Error,n=se.asn1,r=n.DERSequence,i=n.tsp,o=i.PKIStatus,s=i.PKIFreeText,a=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 s(e.statusstr)),null!=e.failinfo&&n.push(new a(e.failinfo))}return new r({array:n}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(se.asn1.tsp.PKIStatusInfo,se.asn1.ASN1Object),se.asn1.tsp.PKIStatus=function(e){var t=Error,n=se.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(se.asn1.tsp.PKIStatus,se.asn1.ASN1Object),se.asn1.tsp.PKIFreeText=function(e){var t=Error,n=se.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(se.asn1.tsp.PKIFreeText,se.asn1.ASN1Object),se.asn1.tsp.PKIFailureInfo=function(e){var t=Error,n=se.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="",s=r.length-1;s>=0;s--)i+=r[s];return i}if("string"==typeof e&&null!=o[e])return Qe([e],o);if("object"==typeof e&&null!=e.length)return Qe(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(se.asn1.tsp.PKIFailureInfo,se.asn1.ASN1Object),se.asn1.tsp.AbstractTSAAdapter=function(e){this.getTSTHex=function(e,t){throw"not implemented yet"}},se.asn1.tsp.SimpleTSAAdapter=function(e){var t=se,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(se.asn1.tsp.SimpleTSAAdapter,se.asn1.tsp.AbstractTSAAdapter),se.asn1.tsp.FixedTSAAdapter=function(e){var t=se,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(se.asn1.tsp.FixedTSAAdapter,se.asn1.tsp.AbstractTSAAdapter),se.asn1.tsp.TSPUtil=new function(){},se.asn1.tsp.TSPUtil.newTimeStampToken=function(e){return new se.asn1.tsp.TimeStampToken(e)},se.asn1.tsp.TSPUtil.parseTimeStampReq=function(e){return(new se.asn1.tsp.TSPParser).getTimeStampReq(e)},se.asn1.tsp.TSPUtil.parseMessageImprint=function(e){return(new se.asn1.tsp.TSPParser).getMessageImprint(e)},se.asn1.tsp.TSPParser=function(){Error;var e=new ot,t=ue,n=t.getV,r=t.getTLV,i=t.getIdxbyList,o=(t.getTLVbyListEx,t.getChildIdx),s=["granted","grantedWithMods","rejection","waiting","revocationWarning","revocationNotification"],a={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]),s=this.getToken(i);return s.statusinfo=n,s}},this.getToken=function(e){var t=(new se.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={},s=o(t,0),a=n(t,s[1]);i.policy=ze(a);var l=r(t,s[2]);i.messageImprint=this.getMessageImprint(l);var u=n(t,s[3]);i.serial={hex:u};var c=n(t,s[4]);i.genTime={str:be(c)};var h=0;if(s.length>5&&"30"==t.substr(s[5],2)){var p=r(t,s[5]);i.accuracy=this.getAccuracy(p),h++}s.length>5+h&&"01"==t.substr(s[5+h],2)&&("ff"==n(t,s[5+h])&&(i.ordering=!0),h++);if(s.length>5+h&&"02"==t.substr(s[5+h],2)){var d=n(t,s[5+h]);i.nonce={hex:d},h++}if(s.length>5+h&&"a0"==t.substr(s[5+h],2)){var f=r(t,s[5+h]);f="30"+f.substr(2),pGeneralNames=e.getGeneralNames(f);var g=pGeneralNames[0].dn;i.tsa=g,h++}if(s.length>5+h&&"a1"==t.substr(s[5+h],2)){var m=r(t,s[5+h]);m="30"+m.substr(2);var v=e.getExtParamArray(m);i.ext=v,h++}return i},this.getAccuracy=function(e){for(var t={},r=o(e,0),i=0;i<r.length;i++){var s=e.substr(r[i],2),a=n(e,r[i]),l=parseInt(a,16);"02"==s?t.seconds=l:"80"==s?t.millis=l:"81"==s&&(t.micros=l)}return t},this.getMessageImprint=function(e){if("30"!=e.substr(0,2))throw new Error("head of messageImprint hex shall be x30");var r={},s=(o(e,0),i(e,0,[0,0])),a=n(e,s),l=t.hextooidstr(a),u=se.asn1.x509.OID.oid2name(l);if(""==u)throw new Error("hashAlg name undefined: "+l);var c=u,h=i(e,0,[1]);return r.alg=c,r.hash=n(e,h),r},this.getPKIStatusInfo=function(e){var t={},i=o(e,0),a=0;try{var l=n(e,i[0]),u=parseInt(l,16);t.status=s[u]}catch(e){}if(i.length>1&&"30"==e.substr(i[1],2)){var c=r(e,i[1]);t.statusstr=this.getPKIFreeText(c),a++}if(i.length>a&&"03"==e.substr(i[1+a],2)){var h=r(e,i[1+a]);t.failinfo=this.getPKIFailureInfo(h)}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!=a[n]?a[n]:n},this.getTimeStampReq=function(e){var i={certreq:!1},s=o(e,0);if(s.length<2)throw new Error("TimeStampReq must have at least 2 items");var a=r(e,s[1]);i.messageImprint=se.asn1.tsp.TSPUtil.parseMessageImprint(a);for(var l=2;l<s.length;l++){var u=s[l],c=e.substr(u,2);if("06"==c){var h=n(e,u);i.policy=t.hextooidstr(h)}"02"==c&&(i.nonce=n(e,u)),"01"==c&&(i.certreq=!0)}return i}},void 0!==se&&se||(se={}),void 0!==se.asn1&&se.asn1||(se.asn1={}),void 0!==se.asn1.cades&&se.asn1.cades||(se.asn1.cades={}),se.asn1.cades.SignaturePolicyIdentifier=function(e){var t=se.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(se.asn1.cades.SignaturePolicyIdentifier,se.asn1.cms.Attribute),se.asn1.cades.SignaturePolicyId=function(e){var t=se.asn1,n=t.DERSequence,r=t.DERObjectIdentifier,i=(t.x509.AlgorithmIdentifier,t.cades),o=i.SignaturePolicyId,s=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 s(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(se.asn1.cades.SignaturePolicyId,se.asn1.ASN1Object),se.asn1.cades.OtherHashAlgAndValue=function(e){var t=Error,n=se.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 s=e.cert;-1!=e.cert.indexOf("-----BEGIN")&&(s=Te(e.cert)),n=se.crypto.Util.hashHex(s,e.alg)}var a=[];return a.push(new o({name:e.alg})),a.push(new i({hex:n})),new r({array:a}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(se.asn1.cades.OtherHashAlgAndValue,se.asn1.ASN1Object),se.asn1.cades.OtherHashValue=function(e){se.asn1.cades.OtherHashValue.superclass.constructor.call(this);var t=Error,n=se,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=se.crypto.Util.hashHex(i,"sha1")}return new r({hex:n}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(se.asn1.cades.OtherHashValue,se.asn1.ASN1Object),se.asn1.cades.SignatureTimeStamp=function(e){var t=Error,n=se,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;ue.getTLVbyList(n,0,[1]);return(i=new o).hTLV=e.tst,[i]}},null!=e&&this.setByParam(e)},et(se.asn1.cades.SignatureTimeStamp,se.asn1.cms.Attribute),se.asn1.cades.CompleteCertificateRefs=function(e){var t=Error,n=se,r=n.asn1,i=r.DERSequence,o=r.cades,s=o.OtherCertID,a=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(!a(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 l=new s(o);n.push(l)}return[new i({array:n})]},null!=e&&this.setByParam(e)},et(se.asn1.cades.CompleteCertificateRefs,se.asn1.cms.Attribute),se.asn1.cades.OtherCertID=function(e){var t=se.asn1,n=t.DERSequence,r=t.cms.IssuerSerial,i=t.cades,o=i.OtherHashValue,s=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 s(e):new o(e),t.push(i),null!=e.cert&&1==e.hasis||null!=e.issuer&&null!=e.serial){var a=new r(e);t.push(a)}return new n({array:t}).tohex()},this.getEncodedHex=function(){return this.tohex()},null!=e&&this.setByParam(e)},et(se.asn1.cades.OtherCertID,se.asn1.ASN1Object),se.asn1.cades.OtherHash=function(e){Error;var t=se,n=t.asn1,r=(n.cms,n.cades),i=r.OtherHashAlgAndValue,o=r.OtherHashValue,s=(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}:s(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(se.asn1.cades.OtherHash,se.asn1.ASN1Object),se.asn1.cades.CAdESUtil=new function(){},se.asn1.cades.CAdESUtil.parseSignedDataForAddingUnsigned=function(e){return(new se.asn1.cms.CMSParser).getCMSSignedData(e)},se.asn1.cades.CAdESUtil.parseSignerInfoForAddingUnsigned=function(e,t,n){var r=ue,i=r.getChildIdx,o=r.getTLV,s=r.getV,a=se.asn1,l=a.ASN1Object,u=a.cms,c=u.AttributeList,h=u.SignerInfo,p={},d=i(e,t);if(6!=d.length)throw"not supported items for SignerInfo (!=6)";var f=d.shift();p.version=o(e,f);var g=d.shift();p.si=o(e,g);var m=d.shift();p.digalg=o(e,m);var v=d.shift();p.sattrs=o(e,v);var y=d.shift();p.sigalg=o(e,y);var b=d.shift();p.sig=o(e,b),p.sigval=s(e,b);var $=null;return p.obj=new h,($=new l).hTLV=p.version,p.obj.dCMSVersion=$,($=new l).hTLV=p.si,p.obj.dSignerIdentifier=$,($=new l).hTLV=p.digalg,p.obj.dDigestAlgorithm=$,($=new l).hTLV=p.sattrs,p.obj.dSignedAttrs=$,($=new l).hTLV=p.sigalg,p.obj.dSigAlg=$,($=new l).hTLV=p.sig,p.obj.dSig=$,p.obj.dUnsignedAttrs=new c,p},void 0!==se.asn1.csr&&se.asn1.csr||(se.asn1.csr={}),se.asn1.csr.CertificationRequest=function(e){var t=se.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 se.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 Ce(this.tohex(),"CERTIFICATE REQUEST")},this.tohex=function(){var e=this.params,t=new se.asn1.csr.CertificationRequestInfo(this.params),i=new se.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(se.asn1.csr.CertificationRequest,se.asn1.ASN1Object),se.asn1.csr.CertificationRequestInfo=function(e){var t=se.asn1,n=(t.DERBitString,t.DERSequence),r=t.DERInteger,i=t.DERUTF8String,o=t.DERTaggedObject,s=t.ASN1Util.newObject,a=t.csr,l=t.x509,u=l.X500Name,c=l.Extensions,h=l.SubjectPublicKeyInfo;a.AttributeList;a.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 u(e.subject)),t.push(new h(tt.getKey(e.sbjpubkey))),null!=e.attrs){var a=function(e){for(var t=Error,n=se.asn1.x509.Extensions,r=[],i=0;i<e.length;i++){var o=e[i],s=o.attr;if("extensionRequest"==s){var a={seq:[{oid:"1.2.840.113549.1.9.14"},{set:[new n(o.ext)]}]};r.push(a)}else if("unstructuredName"==s){a={seq:[{oid:"1.2.840.113549.1.9.2"},{set:o.names}]};r.push(a)}else{if("challengePassword"!=s)throw new t("unknown CSR attribute");a={seq:[{oid:"1.2.840.113549.1.9.7"},{set:[{utf8str:o.password}]}]};r.push(a)}}return{set:r}}(e.attrs),l=s({tag:{tage:"a0",obj:a}});t.push(l)}else if(null!=e.extreq){var p=new c(e.extreq);l=s({tag:{tage:"a0",obj:{seq:[{oid:"1.2.840.113549.1.9.14"},{set:[p]}]}}});t.push(l)}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(se.asn1.csr.CertificationRequestInfo,se.asn1.ASN1Object),se.asn1.csr.AttributeList=function(e){},et(se.asn1.csr.AttributeList,se.asn1.ASN1Object),se.asn1.csr.CSRUtil=new function(){},se.asn1.csr.CSRUtil.newCSRPEM=function(e){return new se.asn1.csr.CertificationRequest(e).getPEM()},se.asn1.csr.CSRUtil.getParam=function(e,t){var n=ue,r=n.getV,i=n.getIdxbyList,o=n.getTLVbyList,s=n.getTLVbyListEx,a=n.getVbyListEx,l={};if(-1==e.indexOf("-----BEGIN CERTIFICATE REQUEST"))throw new Error("argument is not PEM file");var u=Te(e,"CERTIFICATE REQUEST");t&&(l.tbs=o(u,0,[0]));try{var c=s(u,0,[0,1]);if("3000"==c)l.subject={};else{var h=new ot;l.subject=h.getX500Name(c)}}catch(e){}var p=s(u,0,[0,2]),d=tt.getKey(p,null,"pkcs8pub");l.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")}(u);h=new ot;null!=f&&(l.extreq=h.getExtParamArray(f));try{var g=s(u,0,[1],"30");h=new ot;l.sigalg=h.getAlgorithmIdentifierName(g)}catch(e){}try{var m=a(u,0,[2]);l.sighex=m}catch(e){}return l},se.asn1.csr.CSRUtil.verifySignature=function(e){try{var t=null;if("string"==typeof e&&-1!=e.indexOf("-----BEGIN CERTIFICATE REQUEST")?t=se.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 se.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!==se&&se||(se={}),void 0!==se.asn1&&se.asn1||(se.asn1={}),void 0!==se.asn1.ocsp&&se.asn1.ocsp||(se.asn1.ocsp={}),se.asn1.ocsp.DEFAULT_HASH="sha1",se.asn1.ocsp.OCSPResponse=function(e){se.asn1.ocsp.OCSPResponse.superclass.constructor.call(this);se.asn1.DEREnumerated;var t=se.asn1.ASN1Util.newObject,n=se.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(se.asn1.ocsp.OCSPResponse,se.asn1.ASN1Object),se.asn1.ocsp.ResponseBytes=function(e){se.asn1.ocsp.ResponseBytes.superclass.constructor.call(this);var t=se.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),s=[];return s.push(new r({name:"ocspBasic"})),s.push(new i({hex:t.tohex()})),new n({array:s}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},et(se.asn1.ocsp.ResponseBytes,se.asn1.ASN1Object),se.asn1.ocsp.BasicOCSPResponse=function(e){se.asn1.ocsp.BasicOCSPResponse.superclass.constructor.call(this);var t=Error,n=se.asn1,r=n.ASN1Object,i=n.DERSequence,o=(n.DERGeneralizedTime,n.DERTaggedObject),s=n.DERBitString,a=(n.x509.Extensions,n.x509.AlgorithmIdentifier),l=n.ocsp;l.ResponderID;_SingleResponseList=l.SingleResponseList,_ResponseData=l.ResponseData,this.params=null,this.setByParam=function(e){this.params=e},this.sign=function(){var e=this.params,t=e.tbsresp.tohex(),n=new se.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 a({name:e.sigalg})),n.push(new s({hex:"00"+e.sighex})),null!=e.certs&&null!=e.certs.length){for(var l=[],u=0;u<e.certs.length;u++){var c=e.certs[u],h=null;if(ue.isASN1HEX(c))h=c;else{if(!c.match(/-----BEGIN/))throw new t("certs["+u+"] not hex or PEM");h=Te(c)}l.push(new r({tlv:h}))}var p=new i({array:l});n.push(new o({tag:"a0",explicit:!0,obj:p}))}return new i({array:n}).tohex()},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},et(se.asn1.ocsp.BasicOCSPResponse,se.asn1.ASN1Object),se.asn1.ocsp.ResponseData=function(e){se.asn1.ocsp.ResponseData.superclass.constructor.call(this);var t=Error,n=se.asn1,r=n.DERSequence,i=n.DERGeneralizedTime,o=n.DERTaggedObject,s=n.x509.Extensions,a=n.ocsp,l=a.ResponderID;_SingleResponseList=a.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 l(e.respid)),n.push(new i(e.prodat)),n.push(new _SingleResponseList(e.array)),null!=e.ext){var a=new s(e.ext);n.push(new o({tag:"a1",explicit:!0,obj:a}))}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(se.asn1.ocsp.ResponseData,se.asn1.ASN1Object),se.asn1.ocsp.ResponderID=function(e){se.asn1.ocsp.ResponderID.superclass.constructor.call(this);var t=se,n=t.asn1,r=n.ASN1Util.newObject,i=n.x509.X500Name,o=t.lang.String.isHex,s=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 s("wrong key member value");return r({tag:{tag:"a2",explicit:!0,obj:{octstr:{hex:n}}}}).tohex()}if(null!=e.name){var a=null;if("string"==typeof e.name&&e.name.match(/-----BEGIN CERTIFICATE/))a=new ot(e.name).getSubject();else e.name instanceof ot?a=e.name.getSubject():"object"!=typeof e.name||null==e.name.array&&null==e.name.str||(a=e.name);if(null==a)throw new s("wrong name member value");return r({tag:{tag:"a1",explicit:!0,obj:new i(a)}}).tohex()}throw new s("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(se.asn1.ocsp.ResponderID,se.asn1.ASN1Object),se.asn1.ocsp.SingleResponseList=function(e){se.asn1.ocsp.SingleResponseList.superclass.constructor.call(this);var t=se.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(se.asn1.ocsp.SingleResponseList,se.asn1.ASN1Object),se.asn1.ocsp.SingleResponse=function(e){var t=Error,n=se.asn1,r=n.DERSequence,i=n.DERGeneralizedTime,o=n.DERTaggedObject,s=n.ocsp,a=s.CertID,l=s.CertStatus,u=n.x509.Extensions;s.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 a(e.certid)),n.push(new l(e.status)),n.push(new i(e.thisupdate)),null!=e.nextupdate){var s=new i(e.nextupdate);n.push(new o({tag:"a0",explicit:!0,obj:s}))}if(null!=e.ext){var c=new u(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(se.asn1.ocsp.SingleResponse,se.asn1.ASN1Object),se.asn1.ocsp.CertID=function(e){var t=se,n=t.asn1,r=n.DEROctetString,i=n.DERInteger,o=n.DERSequence,s=n.x509.AlgorithmIdentifier,a=n.ocsp,l=(a.DEFAULT_HASH,t.crypto.Util.hashHex),u=ot,c=ue.getVbyList;a.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 u(e),i=new u(t),o=l(r.getSubjectHex(),n),s=r.getPublicKeyHex();return{alg:n,issname:o,isskey:l(c(s,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,a,l=this.params;if(a=null==l.alg?this.DEFAULT_HASH:l.alg,null!=l.issuerCert&&null!=l.subjectCert){var u=this.getParamByCerts(l.issuerCert,l.subjectCert,a);e=u.issname,t=u.isskey,n=u.sbjsn}else{if(null==l.issname||null==l.isskey||null==l.sbjsn)throw new Error("required param members not defined");e=l.issname,t=l.isskey,n=l.sbjsn}var c=new s({name:a}),h=new r({hex:e}),p=new r({hex:t}),d=new i({hex:n}),f=new o({array:[c,h,p,d]});return this.hTLV=f.tohex(),this.hTLV},this.getEncodedHex=function(){return this.tohex()},void 0!==e&&this.setByParam(e)},et(se.asn1.ocsp.CertID,se.asn1.ASN1Object),se.asn1.ocsp.CertStatus=function(e){se.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 se.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(se.asn1.ocsp.CertStatus,se.asn1.ASN1Object),se.asn1.ocsp.Request=function(e){var t=se.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(se.asn1.ocsp.Request,se.asn1.ASN1Object),se.asn1.ocsp.TBSRequest=function(e){var t=se.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(se.asn1.ocsp.TBSRequest,se.asn1.ASN1Object),se.asn1.ocsp.OCSPRequest=function(e){var t=se.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(se.asn1.ocsp.OCSPRequest,se.asn1.ASN1Object),se.asn1.ocsp.OCSPUtil={},se.asn1.ocsp.OCSPUtil.getRequestHex=function(e,t,n){var r=se.asn1.ocsp;void 0===n&&(n=r.DEFAULT_HASH);var i={alg:n,issuerCert:e,subjectCert:t};return new r.OCSPRequest({reqList:[i]}).tohex()},se.asn1.ocsp.OCSPUtil.getOCSPResponseInfo=function(e){var t=ue,n=t.getVbyList,r=t.getVbyListEx,i=t.getIdxbyList,o=(t.getIdxbyListEx,t.getV),s={};try{var a=r(e,0,[0],"0a");s.responseStatus=parseInt(a,16)}catch(e){}if(0!==s.responseStatus)return s;try{var l=i(e,0,[1,0,1,0,0,2,0,1]);"80"===e.substr(l,2)?s.certStatus="good":"a1"===e.substr(l,2)?(s.certStatus="revoked",s.revocationTime=be(n(e,l,[0]))):"82"===e.substr(l,2)&&(s.certStatus="unknown")}catch(e){}try{var u=i(e,0,[1,0,1,0,0,2,0,2]);s.thisUpdate=be(o(e,u))}catch(e){}try{var c=i(e,0,[1,0,1,0,0,2,0,3]);"a0"===e.substr(c,2)&&(s.nextUpdate=be(n(e,c,[0])))}catch(e){}return s},se.asn1.ocsp.OCSPParser=function(){var e=Error,t=ot,n=new t,r=ue,i=r.getV,o=r.getTLV,s=r.getIdxbyList,a=r.getVbyList,l=r.getTLVbyList,u=r.getVbyListEx,c=r.getTLVbyListEx,h=r.getChildIdx;this.getOCSPRequest=function(t){var n=h(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=h(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=h(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 a=s(t,0,[1,0]);i.ext=n.getExtParamArray(o(t,a))}return i},this.getCertID=function(n){var r=h(n,0);if(4!=r.length)throw new e("wrong number elements: "+r.length);var s=new t,a={};return a.alg=s.getAlgorithmIdentifierName(o(n,r[0])),a.issname=i(n,r[1]),a.isskey=i(n,r[2]),a.sbjsn=i(n,r[3]),a},this.getOCSPResponse=function(e){var t,n=h(e,0),r=i(e,n[0]),o=parseInt(r);if(1==n.length)return{resstatus:o};var s=l(e,0,[1,0]);return(t=this.getResponseBytes(s)).resstatus=o,t},this.getResponseBytes=function(e){var t,n=h(e,0),r=l(e,0,[1,0]);t=this.getBasicOCSPResponse(r);var o=i(e,n[0]);return t.restype=se.asn1.x509.OID.oid2name(ze(o)),t},this.getBasicOCSPResponse=function(e){var t,n=h(e,0);t=this.getResponseData(o(e,n[0]));var r=new ot;t.alg=r.getAlgorithmIdentifierName(o(e,n[1]));var s=i(e,n[2]);t.sighex=s.substr(2);var a=u(e,0,["[0]"]);if(null!=a){for(var l=h(a,0),c=[],p=0;p<l.length;p++){var d=o(a,l[p]);c.push(d)}t.certs=c}return t},this.getResponseData=function(e){var t=h(e,0),n=t.length,r={},s=0;"a0"==e.substr(t[0],2)&&s++,r.respid=this.getResponderID(o(e,t[s++]));var a=i(e,t[s++]);if(r.prodat=be(a),r.array=this.getSingleResponseList(o(e,t[s++])),"a1"==e.substr(t[n-1],2)){var u=l(e,t[n-1],[0]),c=new ot;r.ext=c.getExtParamArray(u)}return r},this.getResponderID=function(e){var t={};if("a2"==e.substr(0,2)){var n=a(e,0,[0]);t.key=n}if("a1"==e.substr(0,2)){var r=l(e,0,[0]),i=new ot;t.name=i.getX500Name(r)}return t},this.getSingleResponseList=function(e){for(var t=h(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=h(e,0),n={},r=this.getCertID(o(e,t[0]));n.certid=r;var s=this.getCertStatus(o(e,t[1]));if(n.status=s,"18"==e.substr(t[2],2)){var u=i(e,t[2]);n.thisupdate=be(u)}for(var c=3;c<t.length;c++){if("a0"==e.substr(t[c],2)){var p=a(e,t[c],[0],"18");n.nextupdate=be(p)}if("a1"==e.substr(t[c],2)){var d=new ot,f=l(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=be(a(e,0,[0]));t.time=n}return t}},void 0!==se&&se||(se={}),void 0!==se.lang&&se.lang||(se.lang={}),se.lang.String=function(){},"function"==typeof e?(ae=function(t){return fe(e.from(t,"utf8").toString("base64"))},le=function(t){return e.from(ge(t),"base64").toString("utf8")}):(ae=function(e){return me(Re(Be(e)))},le=function(e){return decodeURIComponent(Ie(ve(e)))}),se.lang.String.isInteger=function(e){return!!e.match(/^[0-9]+$/)||!!e.match(/^-[0-9]+$/)},se.lang.String.isHex=function(e){return He(e)},se.lang.String.isBase64=function(e){return!(!(e=e.replace(/\s+/g,"")).match(/^[0-9A-Za-z+\/]+={0,3}$/)||e.length%4!=0)},se.lang.String.isBase64URL=function(e){return!e.match(/[+/=]/)&&(e=ge(e),se.lang.String.isBase64(e))},se.lang.String.isIntegerArray=function(e){return!!(e=e.replace(/\s+/g,"")).match(/^\[[0-9,]+\]$/)},se.lang.String.isPrintable=function(e){return null!==e.match(/^[0-9A-Za-z '()+,-./:=?]*$/)},se.lang.String.isIA5=function(e){return null!==e.match(/^[\x20-\x21\x23-\x7f]*$/)},se.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 qe(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="",s=0;s<i;s++)o+="0";r=o+r;for(s=0;s<r.length-1;s+=7){var a=r.substr(s,7);s!=r.length-7&&(a="1"+a),n+=t(parseInt(a,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 s=0;s<i.length;s++)r+=n(i[s]);return r}catch(e){return null}}function ze(e){if(!He(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=[],s=0;s<i.length/2;s++)o.push(parseInt(i.substr(2*s,2),16));var a=[],l="";for(s=0;s<o.length;s++)128&o[s]?l+=We((127&o[s]).toString(2),7):(l+=We((127&o[s]).toString(2),7),a.push(new String(parseInt(l,2))),l="");var u=t.join(".");return a.length>0&&(u=u+"."+a.join(".")),u}catch(e){return null}}function Ke(e){return Ge(new w(String(e),10))}function Ge(e){var t=e.toString(16);if("-"!=t.substr(0,1))return t.length%2==1?t="0"+t:t.match(/^[0-7]/)||(t="00"+t),t;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";return t=new w(r,16).xor(e).add(w.ONE).toString(16).replace(/^-/,"")}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 Je(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 Xe(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),s=parseInt(o,16).toString(2);r+=s=("0000000"+s).slice(-8)}return r.substr(0,r.length-t)}catch(e){return null}}function Qe(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 Ze(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!==se&&se||(se={}),void 0!==se.crypto&&se.crypto||(se.crypto={}),se.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",s="00"+r,a="",l=i-o.length-s.length,u=0;u<l;u+=2)a+="ff";return o+a+s},this.hashString=function(e,t){return new se.crypto.MessageDigest({alg:t}).digestString(e)},this.hashHex=function(e,t){return new se.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 te||e instanceof se.crypto.DSA||e instanceof se.crypto.ECDSA}},se.crypto.Util.md5=function(e){return new se.crypto.MessageDigest({alg:"md5",prov:"cryptojs"}).digestString(e)},se.crypto.Util.ripemd160=function(e){return new se.crypto.MessageDigest({alg:"ripemd160",prov:"cryptojs"}).digestString(e)},se.crypto.Util.SECURERANDOMGEN=new Z,se.crypto.Util.getRandomHexOfNbytes=function(e){var t=new Array(e);return se.crypto.Util.SECURERANDOMGEN.nextBytes(t),pe(t)},se.crypto.Util.getRandomBigIntegerOfNbytes=function(e){return new w(se.crypto.Util.getRandomHexOfNbytes(e),16)},se.crypto.Util.getRandomHexOfNbits=function(e){var t=e%8,n=new Array((e-t)/8+1);return se.crypto.Util.SECURERANDOMGEN.nextBytes(n),n[0]=(255<<t&255^255)&n[0],pe(n)},se.crypto.Util.getRandomBigIntegerOfNbits=function(e){return new w(se.crypto.Util.getRandomHexOfNbits(e),16)},se.crypto.Util.getRandomBigIntegerZeroToMax=function(e){for(var t=e.bitLength();;){var n=se.crypto.Util.getRandomBigIntegerOfNbits(t);if(-1!=e.compareTo(n))return n}},se.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 se.crypto.Util.getRandomBigIntegerZeroToMax(r).add(e)},se.crypto.MessageDigest=function(e){this.setAlgAndProvider=function(e,t){if(null!==(e=se.crypto.MessageDigest.getCanonicalAlgName(e))&&void 0===t&&(t=se.crypto.Util.DEFAULTPROVIDER[e]),-1!=":md5:sha1:sha224:sha256:sha384:sha512:ripemd160:".indexOf(e)&&"cryptojs"==t){try{this.md=se.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=se.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName))},se.crypto.MessageDigest.getCanonicalAlgName=function(e){return"string"==typeof e&&(e=(e=e.toLowerCase()).replace(/-/,"")),e},se.crypto.MessageDigest.getHashLength=function(e){var t=se.crypto.MessageDigest,n=t.getCanonicalAlgName(e);if(void 0===t.HASHLENGTH[n])throw"not supported algorithm: "+e;return t.HASHLENGTH[n]},se.crypto.MessageDigest.HASHLENGTH={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,ripemd160:20},se.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=se.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=se.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=xe(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=ye(e.utf8)),void 0!==e.rstr&&(t=xe(e.rstr)),void 0!==e.b64&&(t=b(e.b64)),void 0!==e.b64u&&(t=ve(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=se.crypto.Util.DEFAULTPROVIDER[this.algName]),this.setAlgAndProvider(this.algName,this.provName)))},se.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 se.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!==se.crypto.ECDSA&&(this.prvKey=new se.crypto.ECDSA({curve:this.eccurvename,prv:this.ecprvhex})),this.prvKey instanceof te&&"rsaandmgf1"===this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHashPSS(this.sHashHex,this.mdAlgName,this.pssSaltLen);else if(this.prvKey instanceof te&&"rsa"===this.pubkeyAlgName)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex,this.mdAlgName);else if(this.prvKey instanceof se.crypto.ECDSA)this.hSign=this.prvKey.signWithMessageHash(this.sHashHex);else{if(!(this.prvKey instanceof se.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!==se.crypto.ECDSA&&(this.pubKey=new se.crypto.ECDSA({curve:this.eccurvename,pub:this.ecpubhex})),this.pubKey instanceof te&&"rsaandmgf1"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHashPSS(this.sHashHex,e,this.mdAlgName,this.pssSaltLen);if(this.pubKey instanceof te&&"rsa"===this.pubkeyAlgName)return this.pubKey.verifyWithMessageHash(this.sHashHex,e);if(void 0!==se.crypto.ECDSA&&this.pubKey instanceof se.crypto.ECDSA)return this.pubKey.verifyWithMessageHash(this.sHashHex,e);if(void 0!==se.crypto.DSA&&this.pubKey instanceof se.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=se.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}}},se.crypto.Cipher=function(e){},se.crypto.Cipher.encrypt=function(e,t,n,r){if(null!=Ze(r,"enclag")&&(n=r.encalg),"string"==typeof n&&"-CBC"==n.substr(-4)){var i=t,o=e;null!=Ze(r,"key")&&(i=r.key),null!=Ze(r,"enc")&&(hEnc=r.enc);var s,a=g.enc.Hex.parse(i),l=g.enc.Hex.parse(o),u=g.enc.Hex.parse(r.iv);if("des-EDE3-CBC"==n)s=g.TripleDES.encrypt(l,a,{iv:u});else{if("aes128-CBC"!=n&&"aes256-CBC"!=n)throw new Error("unsupported algorithm: "+n);s=g.AES.encrypt(l,a,{iv:u})}return s+""}throw new Error("Cipher.encrypt: unsupported key or algorithm")},se.crypto.Cipher.decrypt=function(e,t,n,r){if(null!=Ze(r,"enclag")&&(n=r.encalg),"string"==typeof n&&"-CBC"==n.substr(-4)){var i=t,o=e;null!=Ze(r,"key")&&(i=r.key),null!=Ze(r,"enc")&&(o=r.enc);var s,a=g.enc.Hex.parse(i),l=g.enc.Hex.parse(o),u=g.enc.Hex.parse(r.iv);if("des-EDE3-CBC"==n)s=g.TripleDES.decrypt({ciphertext:l},a,{iv:u});else{if("aes128-CBC"!=n&&"aes256-CBC"!=n)throw new Error("unsupported algorithm: "+n);s=g.AES.decrypt({ciphertext:l},a,{iv:u})}return g.enc.Hex.stringify(s)}throw new Error("Cipher.decrypt: unsupported key or algorithm")},se.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!==se&&se||(se={}),void 0!==se.crypto&&se.crypto||(se.crypto={}),se.crypto.ECDSA=function(e){var t=Error,n=w,r=re,i=se.crypto.ECDSA,o=se.crypto.ECParameterDB,s=i.getName,a=ue,l=a.getVbyListEx,u=a.isASN1HEX,c=new Z;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,s="04"+("0000000000"+r.toString(16)).slice(-o)+("0000000000"+i.toString(16)).slice(-o);return this.setPublicKeyHex(s),s},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,s=new n(e.substring(0,this.ecparams.keycharlen),16);do{var a=this.getBigRandom(o),l=this.ecparams.G.multiply(a).getX().toBigInteger().mod(o)}while(l.compareTo(n.ZERO)<=0);var u=a.modInverse(o).multiply(s.add(r.multiply(l))).mod(o);return i.biRSSigToASN1Sig(l,u)},this.sign=function(e,t){var r=t,i=this.ecparams.n,o=n.fromByteArrayUnsigned(e);do{var s=this.getBigRandom(i),a=this.ecparams.G.multiply(s).getX().toBigInteger().mod(i)}while(a.compareTo(w.ZERO)<=0);var l=s.modInverse(i).multiply(o.add(r.multiply(a))).mod(i);return this.serializeSig(a,l)},this.verifyWithMessageHash=function(e,t){return this.verifyHex(e,t,this.pubKeyHex)},this.verifyHex=function(e,t,o){try{var s,a,l=i.parseSigHex(t);s=l.r,a=l.s;var u=r.decodeFromHex(this.ecparams.curve,o),c=new n(e.substring(0,this.ecparams.keycharlen),16);return this.verifyRaw(c,s,a,u)}catch(e){return!1}},this.verify=function(e,t,i){var o,s,a;if(Bitcoin.Util.isArray(t)){var l=this.parseSig(t);o=l.r,s=l.s}else{if("object"!=typeof t||!t.r||!t.s)throw"Invalid value for signature";o=t.r,s=t.s}if(i instanceof re)a=i;else{if(!Bitcoin.Util.isArray(i))throw"Invalid format for pubkey value, must be byte array or ECPointFp";a=r.decodeFrom(this.ecparams.curve,i)}var u=n.fromByteArrayUnsigned(e);return this.verifyRaw(u,o,s,a)},this.verifyRaw=function(e,t,r,i){var o=this.ecparams.n,s=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 a=r.modInverse(o),l=e.multiply(a).mod(o),u=t.multiply(a).mod(o);return s.multiply(l).add(i.multiply(u)).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===u(e))throw new Error("not ASN.1 hex string");var t,n,r;try{t=l(e,0,["[0]",0],"06"),n=l(e,0,[1],"04");try{r=l(e,0,["[1]",0],"03")}catch(e){}}catch(e){throw new Error("malformed PKCS#1/5 plain ECC private key")}if(this.curveName=s(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===u(e))throw new t("not ASN.1 hex string");var n,r,i;try{l(e,0,[1,0],"06"),n=l(e,0,[1,1],"06"),r=l(e,0,[2,0,1],"04");try{i=l(e,0,[2,0,"[1]",0],"03")}catch(e){}}catch(e){throw new t("malformed PKCS#8 plain ECC private key")}if(this.curveName=s(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===u(e))throw new t("not ASN.1 hex string");var n,r;try{l(e,0,[0,0],"06"),n=l(e,0,[0,1],"06"),r=l(e,0,[1],"03")}catch(e){throw new t("malformed PKCS#8 ECC public key")}if(this.curveName=s(n),null===this.curveName)throw new t("unsupported curve name");this.setNamedCurve(this.curveName),this.setPublicKeyHex(r)},this.readCertPubKeyHex=function(e,n){if(!1===u(e))throw new t("not ASN.1 hex string");var r,i;try{r=l(e,0,[0,5,0,1],"06"),i=l(e,0,[0,5,1],"03")}catch(e){throw new t("malformed X.509 certificate ECC public key")}if(this.curveName=s(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))},se.crypto.ECDSA.parseSigHex=function(e){var t=se.crypto.ECDSA.parseSigHexInHexRS(e);return{r:new w(t.r,16),s:new w(t.s,16)}},se.crypto.ECDSA.parseSigHexInHexRS=function(e){var t=ue,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],s=i[1];if("02"!=e.substr(o,2))throw new Error("1st item not ASN.1 integer");if("02"!=e.substr(s,2))throw new Error("2nd item not ASN.1 integer");return{r:r(e,o),s:r(e,s)}},se.crypto.ECDSA.asn1SigToConcatSig=function(e){var t=se.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},se.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 se.crypto.ECDSA.hexRSSigToASN1Sig(t,n)},se.crypto.ECDSA.hexRSSigToASN1Sig=function(e,t){var n=new w(e,16),r=new w(t,16);return se.crypto.ECDSA.biRSSigToASN1Sig(n,r)},se.crypto.ECDSA.biRSSigToASN1Sig=function(e,t){var n=se.asn1,r=new n.DERInteger({bigint:e}),i=new n.DERInteger({bigint:t});return new n.DERSequence({array:[r,i]}).tohex()},se.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!==se&&se||(se={}),void 0!==se.crypto&&se.crypto||(se.crypto={}),se.crypto.ECParameterDB=new function(){var e={},t={};function n(e){return new w(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,s,a,l,u,c,h,p,d,f){e[r]={};var g=n(o),m=n(s),v=n(a),y=n(l),b=n(u),$=new ie(g,m,v),w=$.decodePointHex("04"+c+h);e[r].name=r,e[r].keylen=i,e[r].keycharlen=2*Math.ceil(i/8),e[r].curve=$,e[r].G=w,e[r].n=y,e[r].h=b,e[r].oid=d,e[r].info=f;for(var x=0;x<p.length;x++)t[p[x]]=r}},se.crypto.ECParameterDB.regist("secp128r1",128,"FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFF","FFFFFFFDFFFFFFFFFFFFFFFFFFFFFFFC","E87579C11079F43DD824993C2CEE5ED3","FFFFFFFE0000000075A30D1B9038A115","1","161FF7528B899B2D0C28607CA52C5B86","CF5AC8395BAFEB13C02DA292DDED7A83",[],"","secp128r1 : SECG curve over a 128 bit prime field"),se.crypto.ECParameterDB.regist("secp160k1",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFAC73","0","7","0100000000000000000001B8FA16DFAB9ACA16B6B3","1","3B4C382CE37AA192A4019E763036F4F5DD4D7EBB","938CF935318FDCED6BC28286531733C3F03C4FEE",[],"","secp160k1 : SECG curve over a 160 bit prime field"),se.crypto.ECParameterDB.regist("secp160r1",160,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF7FFFFFFC","1C97BEFC54BD7A8B65ACF89F81D4D4ADC565FA45","0100000000000000000001F4C8F927AED3CA752257","1","4A96B5688EF573284664698968C38BB913CBFC82","23A628553168947D59DCC912042351377AC5FB32",[],"","secp160r1 : SECG curve over a 160 bit prime field"),se.crypto.ECParameterDB.regist("secp192k1",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFEE37","0","3","FFFFFFFFFFFFFFFFFFFFFFFE26F2FC170F69466A74DEFD8D","1","DB4FF10EC057E9AE26B07D0280B7F4341DA5D1B1EAE06C7D","9B2F2F6D9C5628A7844163D015BE86344082AA88D95E2F9D",[]),se.crypto.ECParameterDB.regist("secp192r1",192,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFC","64210519E59C80E70FA7E9AB72243049FEB8DEECC146B9B1","FFFFFFFFFFFFFFFFFFFFFFFF99DEF836146BC9B1B4D22831","1","188DA80EB03090F67CBF20EB43A18800F4FF0AFD82FF1012","07192B95FFC8DA78631011ED6B24CDD573F977A11E794811",[]),se.crypto.ECParameterDB.regist("secp224r1",224,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000000000000000000001","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFFFFFFFFFFFFFFFFFE","B4050A850C04B3ABF54132565044B0B7D7BFD8BA270B39432355FFB4","FFFFFFFFFFFFFFFFFFFFFFFFFFFF16A2E0B8F03E13DD29455C5C2A3D","1","B70E0CBD6BB4BF7F321390B94A03C1D356C21122343280D6115C1D21","BD376388B5F723FB4C22DFE6CD4375A05A07476444D5819985007E34",[]),se.crypto.ECParameterDB.regist("secp256k1",256,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F","0","7","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141","1","79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798","483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8",[]),se.crypto.ECParameterDB.regist("secp256r1",256,"FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFF","FFFFFFFF00000001000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFC","5AC635D8AA3A93E7B3EBBD55769886BC651D06B0CC53B0F63BCE3C3E27D2604B","FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC632551","1","6B17D1F2E12C4247F8BCE6E563A440F277037D812DEB33A0F4A13945D898C296","4FE342E2FE1A7F9B8EE7EB4A7C0F9E162BCE33576B315ECECBB6406837BF51F5",["NIST P-256","P-256","prime256v1"]),se.crypto.ECParameterDB.regist("secp384r1",384,"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFFFF0000000000000000FFFFFFFC","B3312FA7E23EE7E4988E056BE3F82D19181D9C6EFE8141120314088F5013875AC656398D8A2ED19D2A85C8EDD3EC2AEF","FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC7634D81F4372DDF581A0DB248B0A77AECEC196ACCC52973","1","AA87CA22BE8B05378EB1C71EF320AD746E1D3B628BA79B9859F741E082542A385502F25DBF55296C3A545E3872760AB7","3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f",["NIST P-384","P-384"]),se.crypto.ECParameterDB.regist("secp521r1",521,"1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF","1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC","051953EB9618E1C9A1F929A21A0B68540EEA2DA725B99B315F3B8B489918EF109E156193951EC7E937B1652C0BD3BB1BF073573DF883D2C34F1EF451FD46B503F00","1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA51868783BF2F966B7FCC0148F709A5D03BB5C9B8899C47AEBB6FB71E91386409","1","00C6858E06B70404E9CD9E3ECB662395B4429C648139053FB521F828AF606B4D3DBAA14B5E77EFE75928FE1DC127A2FFA8DE3348B3C1856A429BF97E7E31C2E5BD66","011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650",["NIST P-521","P-521"]),void 0!==se&&se||(se={}),void 0!==se.crypto&&se.crypto||(se.crypto={}),se.crypto.DSA=function(){var e=ue,t=(e.getVbyList,e.getVbyListEx),n=e.isASN1HEX,r=w;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,s,a,l,u;o=new w(e,16),s=new w(t,16),a=new w(n,16),l="string"==typeof r&&r.length>1?new w(r,16):null,u=new w(i,16),this.setPrivate(o,s,a,l,u)},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,s,a;i=new w(e,16),o=new w(t,16),s=new w(n,16),a=new w(r,16),this.setPublic(i,o,s,a)},this.signWithMessageHash=function(e){var t=this.p,n=this.q,r=this.g,i=(this.y,this.x),o=se.crypto.Util.getRandomBigIntegerMinToMax(w.ONE.add(w.ONE),n.subtract(w.ONE)),s=new w(e.substr(0,n.bitLength()/4),16),a=r.modPow(o,t).mod(n),l=o.modInverse(n).multiply(s.add(i.multiply(a))).mod(n);return se.asn1.ASN1Util.jsonToASN1HEX({seq:[{int:{bigint:a}},{int:{bigint:l}}]})},this.verifyWithMessageHash=function(e,t){var n=this.p,r=this.q,i=this.g,o=this.y,s=this.parseASN1Signature(t),a=s[0],l=s[1],u=new w(e.substr(0,r.bitLength()/4),16);if(w.ZERO.compareTo(a)>0||a.compareTo(r)>0)throw"invalid DSA signature";if(w.ZERO.compareTo(l)>=0||l.compareTo(r)>0)throw"invalid DSA signature";var c=l.modInverse(r),h=u.multiply(c).mod(r),p=a.multiply(c).mod(r);return 0==i.modPow(h,n).multiply(o.modPow(p,n)).mod(n).mod(r).compareTo(a)},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,s,a;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"),s=t(e,0,[4],"02"),a=t(e,0,[5],"02")}catch(e){throw new Error("malformed PKCS#1/5 plain DSA private key")}this.setPrivateHex(r,i,o,s,a)},this.readPKCS8PrvKeyHex=function(e){var r,i,o,s;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"),s=t(e,0,[2,0],"02")}catch(e){throw new Error("malformed PKCS#8 plain DSA private key")}this.setPrivateHex(r,i,o,null,s)},this.readPKCS8PubKeyHex=function(e){var r,i,o,s;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"),s=t(e,0,[1,0],"02")}catch(e){throw new Error("malformed PKCS#8 DSA public key")}this.setPublicHex(r,i,o,s)},this.readCertPubKeyHex=function(e,r){var i,o,s,a;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"),s=t(e,0,[0,5,0,1,2],"02"),a=t(e,0,[0,5,1,0],"02")}catch(e){throw new Error("malformed X.509 certificate DSA public key")}this.setPublicHex(i,o,s,a)}};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),s=g.enc.Hex.parse(r),a={};a.key=o,a.iv=s,a.ciphertext=i;var l=e.decrypt(a,o,{iv:s});return g.enc.Hex.stringify(l)},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),s=g.enc.Hex.parse(r),a=e.encrypt(i,o,{iv:s}),l=g.enc.Hex.parse(a.toString());return g.enc.Base64.stringify(l)},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 s=e.indexOf("-----END");if(-1!=i&&-1!=s){var a=e.substring(i+2*o,s-o);a=a.replace(/\s+/g,""),t.data=a}return t},s=function(e,t,n){for(var r=n.substring(0,16),o=g.enc.Hex.parse(r),s=g.enc.Utf8.parse(t),a=i[e].keylen+i[e].ivlen,l="",u=null;;){var c=g.algo.MD5.create();if(null!=u&&c.update(u),c.update(s),c.update(o),u=c.finalize(),(l+=g.enc.Hex.stringify(u)).length>=2*a)break}var h={};return h.keyhex=l.substr(0,2*i[e].keylen),h.ivhex=l.substr(2*i[e].keylen,2*i[e].ivlen),h},a=function(e,t,n,r){var o=g.enc.Base64.parse(e),s=g.enc.Hex.stringify(o);return(0,i[t].proc)(s,n,r)};return{version:"1.0.0",parsePKCS5PEM:function(e){return o(e)},getKeyAndUnusedIvByPasscodeAndIvsalt:function(e,t,n){return s(e,t,n)},decryptKeyB64:function(e,t,n,r){return a(e,t,n,r)},getDecryptedKeyHex:function(e,t){var n=o(e),r=(n.type,n.cipher),i=n.ivsalt,l=n.data,u=s(r,t,i).keyhex;return a(l,r,u,i)},getEncryptedPKCS5PEMFromPrvKeyHex:function(e,t,n,r,o){var a="";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 l=function(e,t,n,r){return(0,i[t].eproc)(e,n,r)}(t,r,s(r,n,o).keyhex,o);a="-----BEGIN "+e+" PRIVATE KEY-----\r\n";return a+="Proc-Type: 4,ENCRYPTED\r\n",a+="DEK-Info: "+r+","+o+"\r\n",a+="\r\n",a+=l.replace(/(.{64})/g,"$1\r\n"),a+="\r\n-----END "+e+" PRIVATE KEY-----\r\n"},getEncryptedPKCS8PEM:function(e,t,n){return Ce(this.getEncryptedPKCS8Hex(e,t,n),"ENCRYPTED PRIVATE KEY")},getEncryptedPKCS8Hex:function(e,t,n){var r;(r=null==n||null==n?{}:JSON.parse(JSON.stringify(n))).plain=e,this.initPBES2Param(r),this.encryptPBES2Param(r,t);var i=this.generatePBES2ASN1Param(r);return se.asn1.ASN1Util.newObject(i).tohex()},initPBES2Param:function(e){var t;(null==Ze(e,"encalg")&&(e.encalg="aes256-CBC"),null==Ze(e,"iter")&&(e.iter=2048),null==Ze(e,"prf")&&(e.prf="hmacWithSHA256"),null==Ze(e,"salt")&&(e.salt=g.enc.Hex.stringify(g.lib.WordArray.random(8))),null==Ze(e,"enciv"))&&("des-EDE3-CBC"==e.encalg&&(t=8),"aes128-CBC"==e.encalg&&(t=16),"aes256-CBC"==e.encalg&&(t=16),e.enciv=g.enc.Hex.stringify(g.lib.WordArray.random(t)))},encryptPBES2Param:function(e,t){var n=tt.getDKFromPBES2Param(e,t);try{var r=se.crypto.Cipher.encrypt(e.plain,n,e.encalg,{iv:e.enciv})}catch(t){throw new Error("encrypt error: "+e.plain+" "+n+" "+e.encalg+" "+e.enciv)}e.enc=r},generatePBES2ASN1Param:function(e){var t={seq:[{seq:[{oid:"pkcs5PBES2"},{seq:[{seq:[{oid:"pkcs5PBKDF2"},{seq:[{octstr:{hex:e.salt}},{int:{hex:Ke(e.iter)}}]}]},{seq:[{oid:e.encalg},{octstr:{hex:e.enciv}}]}]}]},{octstr:{hex:e.enc}}]};return"hmacWithSHA1"!=e.prf&&t.seq[0].seq[1].seq[0].seq[1].seq.push({seq:[{oid:e.prf},{null:""}]}),t},parseHexOfEncryptedPKCS8:function(e){var t=ue,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 s=n(e,o[0]);if(2!=s.length)throw new Error("malformed format: SEQUENCE(0.0).items != 2: "+s.length);if("2a864886f70d01050d"!=r(e,s[0]))throw new Error("this only supports pkcs5PBES2");var a=n(e,s[1]);if(2!=s.length)throw new Error("malformed format: SEQUENCE(0.0.1).items != 2: "+a.length);var l=n(e,a[1]);if(2!=l.length)throw new Error("malformed format: SEQUENCE(0.0.1.1).items != 2: "+l.length);if("2a864886f70d0307"!=r(e,l[0]))throw"this only supports TripleDES";i.encryptionSchemeAlg="TripleDES",i.encryptionSchemeIV=r(e,l[1]);var u=n(e,a[0]);if(2!=u.length)throw new Error("malformed format: SEQUENCE(0.0.1.0).items != 2: "+u.length);if("2a864886f70d01050c"!=r(e,u[0]))throw new Error("this only supports pkcs5PBKDF2");var c=n(e,u[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 h=r(e,c[1]);try{i.pbkdf2Iter=parseInt(h,16)}catch(e){throw new Error("malformed format pbkdf2Iter: "+h)}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 s=g.enc.Hex.parse(i),a=g.enc.Hex.parse(r.encryptionSchemeIV),l=g.TripleDES.decrypt(o,s,{iv:a});return g.enc.Hex.stringify(l)},parsePBES2:function(e){var t=ue.parse(e);if("pkcs5PBES2"!=Ze(t,"seq.0.seq.0.oid")||"pkcs5PBKDF2"!=Ze(t,"seq.0.seq.1.seq.0.seq.0.oid"))throw new Error("not pkcs5PBES2 and pkcs5PBKDF2 used");var n=Ze(t,"seq.0.seq.1.seq.0.seq.1.seq");if(null==n)throw new Error("PBKDF2 parameter not found");var r=Ze(n,"0.octstr.hex"),i=Ze(n,"1.int.hex"),o=Ze(n,"2.seq.0.oid","hmacWithSHA1"),s=-1;try{s=parseInt(i,16)}catch(e){throw new Error("iter not proper value")}var a=Ze(t,"seq.0.seq.1.seq.1.seq.0.oid"),l=Ze(t,"seq.0.seq.1.seq.1.seq.1.octstr.hex"),u=Ze(t,"seq.1.octstr.hex");if(null==a||null==l||null==u)throw new Error("encalg, enciv or enc is undefined");return{salt:r,iter:s,prf:o,encalg:a,enciv:l,enc:u}},getDKFromPBES2Param:function(e,t){var n={hmacWithSHA1:g.algo.SHA1,hmacWithSHA224:g.algo.SHA224,hmacWithSHA256:g.algo.SHA256,hmacWithSHA384:g.algo.SHA384,hmacWithSHA512:g.algo.SHA512}[e.prf];if(null==n)throw new Error("unsupported prf");var r={"des-EDE3-CBC":6,"aes128-CBC":4,"aes256-CBC":8}[e.encalg];if(null==r)throw new Error("unsupported encalg");var i=g.enc.Hex.parse(e.salt),o=e.iter;try{var s=g.PBKDF2(t,i,{keySize:r,iterations:o,hasher:n});return g.enc.Hex.stringify(s)}catch(n){throw new Error("PBKDF2 error: "+n+" "+JSON.stringify(e)+" "+t)}},getPlainHexFromEncryptedPKCS8PEM:function(e,t){if(-1==e.indexOf("BEGIN ENCRYPTED PRIVATE KEY"))throw new Error("not Encrypted PKCS#8 PEM string");var n,r=Te(e);try{n=tt.parsePBES2(r)}catch(e){throw new Error("malformed PBES2 format: "+e.message)}var i=tt.getDKFromPBES2Param(n,t);return se.crypto.Cipher.decrypt(n.enc,i,n.encalg,{iv:n.enciv})},getKeyFromEncryptedPKCS8PEM:function(e,t){var n=this.getPlainHexFromEncryptedPKCS8PEM(e,t);return this.getKeyFromPlainPrivatePKCS8Hex(n)},parsePlainPrivatePKCS8Hex:function(e){var t=ue,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 s=n(e,o[1]);if(2!=s.length)throw new Error("malformed PKCS8 private key(code:004)");if("06"!=e.substr(s[0],2))throw new Error("malformed PKCS8 private key(code:005)");if(i.algoid=r(e,s[0]),"06"==e.substr(s[1],2)&&(i.algparam=r(e,s[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 te;else if("2a8648ce380401"==n.algoid)t=new se.crypto.DSA;else{if("2a8648ce3d0201"!=n.algoid)throw new Error("unsupported private key algorithm");t=new se.crypto.ECDSA}return t.readPKCS8PrvKeyHex(e),t},_getKeyFromPublicPKCS8Hex:function(e){var t,n=ue.getVbyList(e,0,[0,0],"06");if("2a864886f70d010101"===n)t=new te;else if("2a8648ce380401"===n)t=new se.crypto.DSA;else{if("2a8648ce3d0201"!==n)throw new Error("unsupported PKCS#8 public key hex");t=new se.crypto.ECDSA}return t.readPKCS8PubKeyHex(e),t},parsePublicRawRSAKeyHex:function(e){var t=ue,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=ue,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 s=o[0];if("30"!=e.substr(s,2))throw new Error("malformed PKCS8 public key(code:001)");var a=n(e,s);if(2!=a.length)throw new Error("malformed PKCS8 public key(code:002)");if("06"!=e.substr(a[0],2))throw new Error("malformed PKCS8 public key(code:003)");if(i.algoid=r(e,a[0]),"06"==e.substr(a[1],2)?i.algparam=r(e,a[1]):"30"==e.substr(a[1],2)&&(i.algparam={},i.algparam.p=t.getVbyList(e,a[1],[0],"02"),i.algparam.q=t.getVbyList(e,a[1],[1],"02"),i.algparam.g=t.getVbyList(e,a[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=ue).getChildIdx,i=(m.getV,m.getVbyList),o=se.crypto,s=o.ECDSA,a=o.DSA,l=te,u=Te,c=tt;if(void 0!==l&&e instanceof l)return e;if(void 0!==s&&e instanceof s)return e;if(void 0!==a&&e instanceof a)return e;if(void 0!==e.curve&&void 0!==e.xy&&void 0===e.d)return new s({pub:e.xy,curve:e.curve});if(void 0!==e.curve&&void 0!==e.d)return new s({prv:e.d,curve:e.curve});if(void 0===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0===e.d)return(F=new l).setPublic(e.n,e.e),F;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(F=new l).setPrivateEx(e.n,e.e,e.d,e.p,e.q,e.dp,e.dq,e.co),F;if(void 0===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0!==e.d&&void 0===e.p)return(F=new l).setPrivate(e.n,e.e,e.d),F;if(void 0!==e.p&&void 0!==e.q&&void 0!==e.g&&void 0!==e.y&&void 0===e.x)return(F=new a).setPublic(e.p,e.q,e.g,e.y),F;if(void 0!==e.p&&void 0!==e.q&&void 0!==e.g&&void 0!==e.y&&void 0!==e.x)return(F=new a).setPrivate(e.p,e.q,e.g,e.y,e.x),F;if("RSA"===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0===e.d)return(F=new l).setPublic(ve(e.n),ve(e.e)),F;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(F=new l).setPrivateEx(ve(e.n),ve(e.e),ve(e.d),ve(e.p),ve(e.q),ve(e.dp),ve(e.dq),ve(e.qi)),F;if("RSA"===e.kty&&void 0!==e.n&&void 0!==e.e&&void 0!==e.d)return(F=new l).setPrivate(ve(e.n),ve(e.e),ve(e.d)),F;if("EC"===e.kty&&void 0!==e.crv&&void 0!==e.x&&void 0!==e.y&&void 0===e.d){var h=(T=new s({curve:e.crv})).ecparams.keycharlen,p="04"+("0000000000"+ve(e.x)).slice(-h)+("0000000000"+ve(e.y)).slice(-h);return T.setPublicKeyHex(p),T}if("EC"===e.kty&&void 0!==e.crv&&void 0!==e.x&&void 0!==e.y&&void 0!==e.d){h=(T=new s({curve:e.crv})).ecparams.keycharlen,p="04"+("0000000000"+ve(e.x)).slice(-h)+("0000000000"+ve(e.y)).slice(-h);var d=("0000000000"+ve(e.d)).slice(-h);return T.setPublicKeyHex(p),T.setPrivateKeyHex(d),T}if("pkcs5prv"===n){var f,g=e,m=ue;if(9===(f=r(g,0)).length)(F=new l).readPKCS5PrvKeyHex(g);else if(6===f.length)(F=new a).readPKCS5PrvKeyHex(g);else{if(!(f.length>2&&"04"===g.substr(f[1],2)))throw new Error("unsupported PKCS#1/5 hexadecimal key");(F=new s).readPKCS5PrvKeyHex(g)}return F}if("pkcs8prv"===n)return F=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=u(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=u(e,"DSA PRIVATE KEY"),0,[1],"02"),$=i(R,0,[2],"02"),x=i(R,0,[3],"02"),S=i(R,0,[4],"02"),E=i(R,0,[5],"02");return(F=new a).setPrivate(new w(b,16),new w($,16),new w(x,16),new w(S,16),new w(E,16)),F}if(-1!=e.indexOf("-END EC PRIVATE KEY-")&&-1==e.indexOf("4,ENCRYPTED")){y=u(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 A=c.getDecryptedKeyHex(e,t),C=new te;return C.readPKCS5PrvKeyHex(A),C}if(-1!=e.indexOf("-END EC PRIVATE KEY-")&&-1!=e.indexOf("4,ENCRYPTED")){var T,F=i(R=c.getDecryptedKeyHex(e,t),0,[1],"04"),k=i(R,0,[2,0],"06"),D=i(R,0,[3,0],"03").substr(2);if(void 0===se.crypto.OID.oidhex2name[k])throw new Error("undefined OID(hex) in KJUR.crypto.OID: "+k);return(T=new s({curve:se.crypto.OID.oidhex2name[k]})).setPublicKeyHex(D),T.setPrivateKeyHex(F),T.isPublic=!1,T}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"),$=i(R,0,[2],"02"),x=i(R,0,[3],"02"),S=i(R,0,[4],"02"),E=i(R,0,[5],"02");return(F=new a).setPrivate(new w(b,16),new w($,16),new w(x,16),new w(S,16),new w(E,16)),F}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;(s=new te).generate(n,"10001"),s.isPrivate=!0,s.isPublic=!0;var r=new te,i=s.n.toString(16),o=s.e.toString(16);return r.setPublic(i,o),r.isPrivate=!1,r.isPublic=!0,(a={}).prvKeyObj=s,a.pubKeyObj=r,a}if("EC"==e){var s,a,l=t,u=new se.crypto.ECDSA({curve:l}).generateKeyPairHex();return(s=new se.crypto.ECDSA({curve:l})).setPublicKeyHex(u.ecpubhex),s.setPrivateKeyHex(u.ecprvhex),s.isPrivate=!0,s.isPublic=!1,(r=new se.crypto.ECDSA({curve:l})).setPublicKeyHex(u.ecpubhex),r.isPrivate=!1,r.isPublic=!0,(a={}).prvKeyObj=s,a.pubKeyObj=r,a}throw new Error("unknown algorithm: "+e)},tt.getPEM=function(e,t,n,r,i,o){var s=se,a=s.asn1,l=a.DERObjectIdentifier,u=a.DERInteger,c=a.ASN1Util.newObject,h=a.x509.SubjectPublicKeyInfo,p=s.crypto,d=p.DSA,f=p.ECDSA,g=te;function m(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 v(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 y(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!==g&&e instanceof g||void 0!==d&&e instanceof d||void 0!==f&&e instanceof f)&&1==e.isPublic&&(void 0===t||"PKCS8PUB"==t))return Ce(x=new h(e).tohex(),"PUBLIC KEY");if("PKCS1PRV"==t&&void 0!==g&&e instanceof g&&(void 0===n||null==n)&&1==e.isPrivate)return Ce(x=m(e).tohex(),"RSA PRIVATE KEY");if("PKCS1PRV"==t&&void 0!==f&&e instanceof f&&(void 0===n||null==n)&&1==e.isPrivate){var b=new l({name:e.curveName}).tohex(),$=v(e).tohex(),w="";return w+=Ce(b,"EC PARAMETERS"),w+=Ce($,"EC PRIVATE KEY")}if("PKCS1PRV"==t&&void 0!==d&&e instanceof d&&(void 0===n||null==n)&&1==e.isPrivate)return Ce(x=y(e).tohex(),"DSA PRIVATE KEY");if("PKCS5PRV"==t&&void 0!==g&&e instanceof g&&void 0!==n&&null!=n&&1==e.isPrivate){var x=m(e).tohex();return void 0===r&&(r="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("RSA",x,n,r,o)}if("PKCS5PRV"==t&&void 0!==f&&e instanceof f&&void 0!==n&&null!=n&&1==e.isPrivate){x=v(e).tohex();return void 0===r&&(r="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("EC",x,n,r,o)}if("PKCS5PRV"==t&&void 0!==d&&e instanceof d&&void 0!==n&&null!=n&&1==e.isPrivate){x=y(e).tohex();return void 0===r&&(r="DES-EDE3-CBC"),this.getEncryptedPKCS5PEMFromPrvKeyHex("DSA",x,n,r,o)}var S=function(e,t){if("string"==typeof t)return tt.getEncryptedPKCS8PEM(e,t);if("object"==typeof t&&null!=Ze(t,"passcode")){var n=JSON.parse(JSON.stringify(t)),r=n.passcode;return delete n.passcode,tt.getEncryptedPKCS8PEM(e,r,n)}};if("PKCS8PRV"==t&&null!=g&&e instanceof g&&1==e.isPrivate){var E=m(e).tohex();x=c({seq:[{int:0},{seq:[{oid:{name:"rsaEncryption"}},{null:!0}]},{octstr:{hex:E}}]}).tohex();return void 0===n||null==n?Ce(x,"PRIVATE KEY"):S(x,n)}if("PKCS8PRV"==t&&void 0!==f&&e instanceof f&&1==e.isPrivate){var A={seq:[{int:1},{octstr:{hex:e.prvKeyHex}}]};"string"==typeof e.pubKeyHex&&A.seq.push({tag:["a1",!0,{bitstr:{hex:"00"+e.pubKeyHex}}]});E=new c(A).tohex(),x=c({seq:[{int:0},{seq:[{oid:{name:"ecPublicKey"}},{oid:{name:e.curveName}}]},{octstr:{hex:E}}]}).tohex();return void 0===n||null==n?Ce(x,"PRIVATE KEY"):S(x,n)}if("PKCS8PRV"==t&&void 0!==d&&e instanceof d&&1==e.isPrivate){E=new u({bigint:e.x}).tohex(),x=c({seq:[{int:0},{seq:[{oid:{name:"dsa"}},{seq:[{int:{bigint:e.p}},{int:{bigint:e.q}},{int:{bigint:e.g}}]}]},{octstr:{hex:E}}]}).tohex();return void 0===n||null==n?Ce(x,"PRIVATE KEY"):S(x,n)}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=ue,n=t.getChildIdx,r=t.getTLV,i={},o=e;if("30"!=o.substr(0,2))throw new Error("malformed CSR(code:001)");var s=n(o,0);if(s.length<1)throw new Error("malformed CSR(code:002)");if("30"!=o.substr(s[0],2))throw new Error("malformed CSR(code:003)");var a=n(o,s[0]);if(a.length<3)throw new Error("malformed CSR(code:004)");return i.p8pubkeyhex=r(o,a[2]),i},tt.getKeyID=function(e){var t=tt,n=ue;"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 se.crypto.Util.hashHex(o,"sha1")},tt.getJWK=function(e,t,n,r,i){var o,s,a={},l=se.crypto.Util.hashHex;if("string"==typeof e)o=tt.getKey(e),-1!=e.indexOf("CERTIFICATE")&&(s=Te(e));else{if("object"!=typeof e)throw new Error("unsupported keyinfo type");e instanceof ot?(o=e.getPublicKey(),s=e.hex):o=e}if(o instanceof te&&o.isPrivate)a.kty="RSA",a.n=me(o.n.toString(16)),a.e=me(o.e.toString(16)),a.d=me(o.d.toString(16)),a.p=me(o.p.toString(16)),a.q=me(o.q.toString(16)),a.dp=me(o.dmp1.toString(16)),a.dq=me(o.dmq1.toString(16)),a.qi=me(o.coeff.toString(16));else if(o instanceof te&&o.isPublic)a.kty="RSA",a.n=me(o.n.toString(16)),a.e=me(o.e.toString(16));else if(o instanceof se.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 u=o.getPublicKeyXYHex();a.kty="EC",a.crv=c,a.x=me(u.x),a.y=me(u.y),a.d=me(o.prvKeyHex)}else if(o instanceof se.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);u=o.getPublicKeyXYHex();a.kty="EC",a.crv=c,a.x=me(u.x),a.y=me(u.y)}if(null==a.kty)throw new Error("unsupported keyinfo");return o.isPrivate||1==t||(a.kid=se.jws.JWS.getJWKthumbprint(a)),null!=s&&1!=n&&(a.x5c=[y(s)]),null!=s&&1!=r&&(a.x5t=fe(y(l(s,"sha1")))),null!=s&&1!=i&&(a["x5t#S256"]=fe(y(l(s,"sha256")))),a},tt.getJWKFromKey=function(e){return tt.getJWK(e,!0,!0,!0,!0)},te.getPosArrayOfChildrenFromHex=function(e){return ue.getChildIdx(e,0)},te.getHexValueArrayOfChildrenFromHex=function(e){var t,n=ue.getV,r=n(e,(t=te.getPosArrayOfChildrenFromHex(e))[0]),i=n(e,t[1]),o=n(e,t[2]),s=n(e,t[3]),a=n(e,t[4]),l=n(e,t[5]),u=n(e,t[6]),c=n(e,t[7]),h=n(e,t[8]);return(t=new Array).push(r,i,o,s,a,l,u,c,h),t},te.prototype.readPrivateKeyFromPEMString=function(e){var t=Te(e),n=te.getHexValueArrayOfChildrenFromHex(t);this.setPrivateEx(n[1],n[2],n[3],n[4],n[5],n[6],n[7],n[8])},te.prototype.readPKCS5PrvKeyHex=function(e){var t=te.getHexValueArrayOfChildrenFromHex(e);this.setPrivateEx(t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])},te.prototype.readPKCS8PrvKeyHex=function(e){var t,n,r,i,o,s,a,l,u=ue,c=u.getVbyListEx;if(!1===u.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"),s=c(e,0,[2,0,6],"02"),a=c(e,0,[2,0,7],"02"),l=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,s,a,l)},te.prototype.readPKCS5PubKeyHex=function(e){var t=ue,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)},te.prototype.readPKCS8PubKeyHex=function(e){var t=ue;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)},te.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+=we(n(xe(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 se.crypto.Util.DIGESTINFOHEAD){var n=se.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=ue,r=n.getChildIdx,i=n.getV,o=(n.dump,n.parse),s=n.getTLV,a=n.getVbyList,l=n.getVbyListEx,u=n.getTLVbyList,c=n.getTLVbyListEx,h=n.getIdxbyList,p=n.getIdxbyListEx,d=n.getVidx,f=n.getInt,g=n.oidname,m=n.hextooidstr,v=Te,y=Error;try{t=se.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=u(this.hex,0,[0,0]);if("a0"==e.substr(0,2)){var t=u(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 l(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(l(e,0,[0],"06"))},this.getIssuer=function(e,t){return this.getX500Name(this.getIssuerHex(),e,t)},this.getIssuerHex=function(){return u(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 u(this.hex,0,[0,5+this.foffset],"30")},this.getSubjectString=function(){return this.getSubject().str},this.getNotBefore=function(){var e=a(this.hex,0,[0,4+this.foffset,0]);return e=e.replace(/(..)/g,"%$1"),e=decodeURIComponent(e)},this.getNotAfter=function(){var e=a(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 u(this.hex,0,[0,6+this.foffset],"30")},this.getSPKIValue=function(){var e=this.getSPKI();return null==e?null:a(e,0,[1],"03",!0)},this.getPublicKeyIdx=function(){return h(this.hex,0,[0,6+this.foffset],"30")},this.getPublicKeyContentIdx=function(){var e=this.getPublicKeyIdx();return h(this.hex,e,[1,0],"30")},this.getPublicKey=function(){return tt.getKey(this.getPublicKeyHex(),null,"pkcs8pub")},this.getSignatureAlgorithmName=function(){var e=u(this.hex,0,[1],"30");return this.getAlgorithmIdentifierName(e)},this.getSignatureValueHex=function(){return a(this.hex,0,[2],"03",!0)},this.verifySignature=function(e){var t=this.getSignatureAlgorithmField(),n=this.getSignatureValueHex(),r=u(this.hex,0,[0],"30"),i=new se.crypto.Signature({alg:t});return i.init(e),i.updateHex(r),i.verify(n)},this.parseExt=function(e){var t,o,s;if(void 0===e){if(s=this.hex,3!==this.version)return-1;t=h(s,0,[0,7,0],"30"),o=r(s,t)}else{s=Te(e);var l=h(s,0,[0,3,0,0],"06");if("2a864886f70d01090e"!=i(s,l))return void(this.aExtInfo=new Array);t=h(s,0,[0,3,0,1,0],"30"),o=r(s,t),this.hex=s}this.aExtInfo=new Array;for(var u=0;u<o.length;u++){var c={critical:!1},p=0;3===r(s,o[u]).length&&(c.critical=!0,p=1),c.oid=n.hextooidstr(a(s,o[u],[0],"06"));var f=h(s,o[u],[1+p]);c.vidx=d(s,f),this.aExtInfo.push(c)}},this.getExtInfo=function(e){var t=this.aExtInfo,n=e;if(e.match(/^[0-9.]+$/)||(n=se.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]:[s(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=s(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),a=parseInt(o,16);return r.cA=!0,r.pathLen=a,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),a=0;a<o.length;a++){for(var l=[],u=r(e,o[a]),c=0;c<u.length;c++){var h=s(e,u[c]),p=this.getGeneralSubtree(h);l.push(p)}var d=e.substr(o[a],2);"a0"==d?i.permit=l:"a1"==d&&(i.exclude=l)}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(s(e,t[0])),a=1;a<n;a++){var l=e.substr(t[a],2),u=i(e,t[a]),c=parseInt(u,16);"80"==l&&(o.min=c),"81"==l&&(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=s(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=s(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=s(this.hex,n.vidx),t=n.critical}var o={extname:"authorityKeyIdentifier"};t&&(o.critical=!0);for(var a=r(e,0),l=0;l<a.length;l++){var u=e.substr(a[l],2);if("80"===u&&(o.kid={hex:i(e,a[l])}),"a1"===u){var c=s(e,a[l]),h=this.getGeneralNames(c);o.issuer=h[0].dn}"82"===u&&(o.sn={hex:i(e,a[l])})}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=s(this.hex,n.vidx),t=n.critical}var o={extname:"extKeyUsage",array:[]};t&&(o.critical=!0);for(var a=r(e,0),l=0;l<a.length;l++)o.array.push(g(i(e,a[l])));return o},this.getExtExtKeyUsageName=function(){var e=this.getExtInfo("extKeyUsage");if(void 0===e)return e;var t=new Array,n=s(this.hex,e.vidx);if(""===n)return t;for(var o=r(n,0),a=0;a<o.length;a++)t.push(g(i(n,o[a])));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=s(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=s(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(s(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=we(n);return"81"==t?{rfc822:r}:"82"==t?{dns:r}:"86"==t?{uri:r}:"87"==t?{ip:_e(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 a=new Array,l=s(this.hex,o.vidx),u=r(l,0),c=0;c<u.length;c++)n=l.substr(u[c],2),e=i(l,u[c]),"81"===n&&(t=be(e),a.push(["MAIL",t])),"82"===n&&(t=be(e),a.push(["DNS",t])),"84"===n&&(t=ot.hex2dn(e,0),a.push(["DN",t])),"86"===n&&(t=be(e),a.push(["URI",t])),"87"===n&&(t=_e(e),a.push(["IP",t]));return a},this.getExtCRLDistributionPoints=function(e,t){if(void 0===e&&void 0===t){var n=this.getExtInfo("cRLDistributionPoints");if(void 0===n)return;e=s(this.hex,n.vidx),t=n.critical}var i={extname:"cRLDistributionPoints",array:[]};t&&(i.critical=!0);for(var o=r(e,0),a=0;a<o.length;a++){var l=s(e,o[a]);i.array.push(this.getDistributionPoint(l))}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),a=s(e,n[i]);"a0"==o&&(t.dpname=this.getDistributionPointName(a))}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),a=s(e,n[i]);"a0"==o&&(t.full=this.getGeneralNames(a))}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=a(this.hex,n[i],[0],"06"),s=a(this.hex,n[i],[1],"86");"2b06010505073001"===o&&t.ocsp.push(be(s)),"2b06010505073002"===o&&t.caissuer.push(be(s))}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=s(this.hex,n.vidx),t=n.critical}var i={extname:"authorityInfoAccess",array:[]};t&&(i.critical=!0);for(var o=r(e,0),u=0;u<o.length;u++){var c=l(e,o[u],[0],"06"),h=be(a(e,o[u],[1],"86"));if("2b06010505073001"==c)i.array.push({ocsp:h});else{if("2b06010505073002"!=c)throw new Error("unknown method: "+c);i.array.push({caissuer:h})}}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=s(this.hex,n.vidx),t=n.critical}var i={extname:"certificatePolicies",array:[]};t&&(i.critical=!0);for(var o=r(e,0),a=0;a<o.length;a++){var l=s(e,o[a]),u=this.getPolicyInformation(l);i.array.push(u)}return i},this.getPolicyInformation=function(e){var t={},n=a(e,0,[0],"06");t.policyoid=g(n);var i=p(e,0,[1],"30");if(-1!=i){t.array=[];for(var o=r(e,i),l=0;l<o.length;l++){var u=s(e,o[l]),c=this.getPolicyQualifierInfo(u);t.array.push(c)}}return t},this.getOtherName=function(e){var t={},n=r(e,0),i=a(e,n[0],[],"06"),s=a(e,n[1],[]);return t.oid=g(i),t.value=o(s),t},this.getPolicyQualifierInfo=function(e){var t={},n=a(e,0,[0],"06");if("2b06010505070201"===n){var r=l(e,0,[1],"16");t.cps=we(r)}else if("2b06010505070202"===n){var i=u(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=Ze(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=Ze(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=Ze(e,"seq"),n=[],r=0;r<t.length;r++){var i=t[r];n.push(parseInt(Ze(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=we(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,s=[],a=0;a<i.length;a++){var l=i[a].seq;s.push([l[0].oid,l[1].oid])}r.array=s}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 s=i.seq,a=0;a<s.length;a++){var l=s[a].tag;0==l.explicit&&("80"==l.tag&&(r.reqexp=parseInt(l.hex,16)),"81"==l.tag&&(r.inhibit=parseInt(l.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=s(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 a=s(e,o[1]),l=this.getGeneralName(a);null!=l.uri&&(i.uri=l.uri)}if(o.length>2){var u=s(e,o[2]);"0101ff"==u&&(i.reqauth=!0),"010100"==u&&(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=s(this.hex,n.vidx),t=n.critical}var r={extname:"subjectDirectoryAttributes"};t&&(r.critical=!0);try{for(var i=o(e),a=[],l=0;l<i.seq.length;l++){var u=i.seq[l],c=Ze(u,"seq.0.oid"),h=Ze(u,"seq.1.set");if(null==c||null==h)throw"error";a.push({attr:c,array:h})}return r.array=a,r}catch(e){throw new Error("malformed subjectDirectoryAttributes extension value")}};var b=function(e){var t={};try{var n=e.seq[0].oid,r=se.asn1.x509.OID.name2oid(n);t.type=se.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")}},$=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 s=n[r],a=s.ds,l=s.value,u=s.type;if(":"+a,"prn"!=a&&"utf8"!=a&&"ia5"!=a)return"mixed";if("ia5"==a){if("CN"!=u)return"mixed";if(se.lang.String.isMail(l))continue;return"mixed"}if("C"==u){if("prn"==a)continue;return"mixed"}if(":"+a,null==t)t=a;else if(t!==a)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 $(t)},this.getX500NameArray=function(e){return function(e){try{return e.seq.map((function(e){return $(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{h(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=Ce(this.getPublicKeyHex(),"PUBLIC KEY"),null!=this.aExtInfo&&this.aExtInfo.length>0&&(t.ext=this.getExtParamArray()),t.sighex=this.getSignatureValueHex(),1==e.tbshex&&(t.tbshex=u(this.hex,0,[0])),1==e.nodnarray&&(delete t.issuer.array,delete t.subject.array),t},this.getExtParamArray=function(e){null==e&&(-1!=p(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=s(e,n[i]),a=this.getExtParam(o);null!=a&&t.push(a)}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(a(e,0,[0],"06")),i=!1;3==t&&"0101ff"==u(e,0,[1])&&(i=!0);var s=u(e,0,[t-1,0]),l=void 0;if("2.5.29.14"==n?l=this.getExtSubjectKeyIdentifier(s,i):"2.5.29.15"==n?l=this.getExtKeyUsage(s,i):"2.5.29.17"==n?l=this.getExtSubjectAltName(s,i):"2.5.29.18"==n?l=this.getExtIssuerAltName(s,i):"2.5.29.19"==n?l=this.getExtBasicConstraints(s,i):"2.5.29.30"==n?l=this.getExtNameConstraints(s,i):"2.5.29.31"==n?l=this.getExtCRLDistributionPoints(s,i):"2.5.29.32"==n?l=this.getExtCertificatePolicies(s,i):"2.5.29.33"==n?l=this.getExtPolicyMappings(s,i):"2.5.29.35"==n?l=this.getExtAuthorityKeyIdentifier(s,i):"2.5.29.36"==n?l=this.getExtPolicyConstraints(s,i):"2.5.29.37"==n?l=this.getExtExtKeyUsage(s,i):"2.5.29.54"==n?l=this.getExtInhibitAnyPolicy(s,i):"1.3.6.1.5.5.7.1.1"==n?l=this.getExtAuthorityInfoAccess(s,i):"2.5.29.20"==n?l=this.getExtCRLNumber(s,i):"2.5.29.21"==n?l=this.getExtCRLReason(s,i):"2.5.29.9"==n?l=this.getExtSubjectDirectoryAttributes(s,i):"1.3.6.1.5.5.7.48.1.2"==n?l=this.getExtOcspNonce(s,i):"1.3.6.1.5.5.7.48.1.5"==n?l=this.getExtOcspNoCheck(s,i):"1.2.840.113583.1.1.9.1"==n?l=this.getExtAdobeTimeStamp(s,i):null!=ot.EXT_PARSER[n]&&(l=ot.EXT_PARSER[n](n,i,s)),null!=l)return l;var c={extname:n,extn:s};try{c.extn=o(s)}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,s=0;s<o.length;s++){var a=o[i];null!=a.uri&&(a.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 se.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 s=r[o],a=s.value;a=(a=(a=(a=a.replace(/^\s*/,"")).replace(/\s*$/,"")).replace(/\s+/g," ")).toLowerCase(),i.push(s.type.toLowerCase()+"="+a)}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 s=i[o];if(null!=s.dn&&(t+=n+"dn: "+s.dn.str+r),null!=s.ip&&(t+=n+"ip: "+s.ip+r),null!=s.rfc822&&(t+=n+"rfc822: "+s.rfc822+r),null!=s.dns&&(t+=n+"dns: "+s.dns+r),null!=s.uri&&(t+=n+"uri: "+s.uri+r),null!=s.other)t+=n+"other: "+s.other.oid+"="+JSON.stringify(s.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 s=i.array[o];void 0!==s.cps&&(t+=" cps: "+s.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},s=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="+Ve(t.n.toString(16)).substr(0,16)+"...\n",e+=" e="+Ve(t.e.toString(16))+"\n"),null!=(n=this.aExtInfo)){e+="X509v3 Extensions:\n";for(var a=0;a<n.length;a++){var l=n[a],u=se.asn1.x509.OID.oid2name(l.oid);""===u&&(u=l.oid);var c="";if(!0===l.critical&&(c="CRITICAL"),e+=" "+u+" "+c+":\n","basicConstraints"===u){var h=this.getExtBasicConstraints();void 0===h.cA?e+=" {}\n":(e+=" cA=true",void 0!==h.pathLen&&(e+=", pathLen="+h.pathLen),e+="\n")}else{var p;if("policyMappings"==u)e+=" "+this.getExtPolicyMappings().array.map((function(e){var t=e;return t[0]+":"+t[1]})).join(", ")+"\n";else if("policyConstraints"==u)e+=" ",null!=(p=this.getExtPolicyConstraints()).reqexp&&(e+=" reqexp="+p.reqexp),null!=p.inhibit&&(e+=" inhibit="+p.inhibit),e+="\n";else if("inhibitAnyPolicy"==u)e+=" skip="+(p=this.getExtInhibitAnyPolicy()).skip+"\n";else if("keyUsage"==u)e+=" "+this.getExtKeyUsageString()+"\n";else if("subjectKeyIdentifier"==u)e+=" "+this.getExtSubjectKeyIdentifier().kid.hex+"\n";else if("authorityKeyIdentifier"==u){var d=this.getExtAuthorityKeyIdentifier();void 0!==d.kid&&(e+=" kid="+d.kid.hex+"\n")}else{if("extKeyUsage"==u)e+=" "+this.getExtExtKeyUsage().array.join(", ")+"\n";else if("subjectAltName"==u)e+=r(this.getExtSubjectAltName())+"\n";else if("cRLDistributionPoints"==u)e+=o(this.getExtCRLDistributionPoints());else if("authorityInfoAccess"==u)e+=s(this.getExtAuthorityInfoAccess());else"certificatePolicies"==u&&(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):se.lang.String.isHex(e)&&this.readCertHex(e))}te.prototype.sign=function(e,t){var n=function(e){return se.crypto.Util.hashString(e,t)}(e);return this.signWithMessageHash(n,t)},te.prototype.signWithMessageHash=function(e,t){var n=ee(se.crypto.Util.getPaddedDigestInfoHex(e,t,this.n.bitLength()),16);return nt(this.doPrivate(n).toString(16),this.n.bitLength())},te.prototype.signPSS=function(e,t,n){var r,i=(r=xe(e),se.crypto.Util.hashHex(r,t));return void 0===n&&(n=-1),this.signWithMessageHashPSS(i,t,n)},te.prototype.signWithMessageHashPSS=function(e,t,n){var r,i=we(e),o=i.length,s=this.n.bitLength()-1,a=Math.ceil(s/8),l=function(e){return se.crypto.Util.hashHex(e,t)};if(-1===n||void 0===n)n=o;else if(-2===n)n=a-o-2;else if(n<-2)throw new Error("invalid salt length");if(a<o+n+2)throw new Error("data too long");var u="";n>0&&(u=new Array(n),(new Z).nextBytes(u),u=String.fromCharCode.apply(String,u));var c=we(l(xe("\0\0\0\0\0\0\0\0"+i+u))),h=[];for(r=0;r<a-n-o-2;r+=1)h[r]=0;var p=String.fromCharCode.apply(String,h)+""+u,d=rt(c,p.length,l),f=[];for(r=0;r<p.length;r+=1)f[r]=p.charCodeAt(r)^d.charCodeAt(r);var g=65280>>8*a-s&255;for(f[0]&=~g,r=0;r<o;r++)f.push(c.charCodeAt(r));return f.push(188),nt(this.doPrivate(new w(f)).toString(16),this.n.bitLength())},te.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 s=o[0];return o[1]==function(e){return se.crypto.Util.hashString(e,s)}(e)},te.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},te.prototype.verifyPSS=function(e,t,n,r){var i,o=(i=xe(e),se.crypto.Util.hashHex(i,n));return void 0===r&&(r=-1),this.verifyWithMessageHashPSS(o,t,n,r)},te.prototype.verifyWithMessageHashPSS=function(e,t,n,r){if(t.length!=Math.ceil(this.n.bitLength()/4))return!1;var i,o=new w(t,16),s=function(e){return se.crypto.Util.hashHex(e,n)},a=we(e),l=a.length,u=this.n.bitLength()-1,c=Math.ceil(u/8);if(-1===r||void 0===r)r=l;else if(-2===r)r=c-l-2;else if(r<-2)throw new Error("invalid salt length");if(c<l+r+2)throw new Error("data too long");var h=this.doPublic(o).toByteArray();for(i=0;i<h.length;i+=1)h[i]&=255;for(;h.length<c;)h.unshift(0);if(188!==h[c-1])throw new Error("encoded message does not end in 0xbc");var p=(h=String.fromCharCode.apply(String,h)).substr(0,c-l-1),d=h.substr(p.length,l),f=65280>>8*c-u&255;if(0!=(p.charCodeAt(0)&f))throw new Error("bits beyond keysize not zero");var g=rt(d,p.length,s),m=[];for(i=0;i<p.length;i+=1)m[i]=p.charCodeAt(i)^g.charCodeAt(i);m[0]&=~f;var v=c-l-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===we(s(xe("\0\0\0\0\0\0\0\0"+a+String.fromCharCode.apply(String,m.slice(-r)))))},te.SALT_LEN_HLEN=-1,te.SALT_LEN_MAX=-2,te.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;ue.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=ue.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=ue,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]),s=se.asn1.ASN1Util.oidHexToInt(o);return se.asn1.x509.OID.oid2atype(s)+"="+we(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=ue.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!==se&&se||(se={}),void 0!==se.jws&&se.jws||(se.jws={}),se.jws.JWS=function(){var e=se.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],s=r[3],a=i+"."+o;if(this.parsedJWS={},this.parsedJWS.headB64U=i,this.parsedJWS.payloadB64U=o,this.parsedJWS.sigvalB64U=s,this.parsedJWS.si=a,!n){var l=ve(s),u=ee(l,16);this.parsedJWS.sigvalH=l,this.parsedJWS.sigvalBI=u}var c=le(i),h=le(o);if(this.parsedJWS.headS=c,this.parsedJWS.payloadS=h,!e(c,this.parsedJWS,"headP"))throw"malformed JSON string for JWS Head: "+c}}},se.jws.JWS.sign=function(e,t,n,r,i){var o,s,a,l=se,u=l.jws.JWS,c=u.readSafeJSONString,h=u.isSafeJSONString,p=l.crypto,d=(p.ECDSA,p.Mac),f=p.Signature,g=JSON;if("string"!=typeof t&&"object"!=typeof t)throw"spHeader must be JSON string or object: "+t;if("object"==typeof t&&(s=t,o=g.stringify(s)),"string"==typeof t){if(!h(o=t))throw"JWS Head is not safe JSON string: "+o;s=c(o)}if(a=n,"object"==typeof n&&(a=g.stringify(n)),""!=e&&null!=e||void 0===s.alg||(e=s.alg),""!=e&&null!=e&&void 0===s.alg&&(s.alg=e,o=g.stringify(s)),e!==s.alg)throw"alg and sHeader.alg doesn't match: "+e+"!="+s.alg;var m=null;if(void 0===u.jwsalg2sigalg[e])throw"unsupported alg name: "+e;m=u.jwsalg2sigalg[e];var v=ae(o)+"."+ae(a),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")){(w=new f({alg:m})).init(r,i),w.updateString(v);var $=w.sign();y=se.crypto.ECDSA.asn1SigToConcatSig($)}else{var w;if("none"!=m)(w=new f({alg:m})).init(r,i),w.updateString(v),y=w.sign()}return v+"."+me(y)},se.jws.JWS.verify=function(e,t,n){var r,i=se,o=i.jws.JWS,s=o.readSafeJSONString,a=i.crypto,l=a.ECDSA,u=a.Mac,c=a.Signature;if(r=te,!Ue(e))return!1;var h=e.split(".");if(3!==h.length)return!1;var p=h[0]+"."+h[1],d=ve(h[2]),f=s(le(h[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 l))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 u({alg:v,pass:t});return y.updateString(p),d==y.doFinal()}if(-1!=v.indexOf("withECDSA")){var b,$=null;try{$=l.concatSigToASN1Sig(d)}catch(e){return!1}return(b=new c({alg:v})).init(t),b.updateString(p),b.verify($)}return(b=new c({alg:v})).init(t),b.updateString(p),b.verify(d)},se.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=se.jws.JWS.readSafeJSONString(le(t)),o.payloadObj=se.jws.JWS.readSafeJSONString(le(n)),o.headerPP=JSON.stringify(o.headerObj,null," "),null==o.payloadObj?o.payloadPP=le(n):o.payloadPP=JSON.stringify(o.payloadObj,null," "),void 0!==r&&(o.sigHex=ve(r)),o},se.jws.JWS.verifyJWT=function(e,t,n){var r=se.jws,i=r.JWS,o=i.readSafeJSONString,s=i.inArray,a=i.includedArray;if(!Ue(e))return!1;var l=e.split(".");if(3!=l.length)return!1;var u=l[0],c=l[1],h=(ve(l[2]),o(le(u))),p=o(le(c));if(void 0===h.alg)return!1;if(void 0===n.alg)throw"acceptField.alg shall be specified";if(!s(h.alg,n.alg))return!1;if(void 0!==p.iss&&"object"==typeof n.iss&&!s(p.iss,n.iss))return!1;if(void 0!==p.sub&&"object"==typeof n.sub&&!s(p.sub,n.sub))return!1;if(void 0!==p.aud&&"object"==typeof n.aud)if("string"==typeof p.aud){if(!s(p.aud,n.aud))return!1}else if("object"==typeof p.aud&&!a(p.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!==p.exp&&"number"==typeof p.exp&&p.exp+n.gracePeriod<d)&&(!(void 0!==p.nbf&&"number"==typeof p.nbf&&d<p.nbf-n.gracePeriod)&&(!(void 0!==p.iat&&"number"==typeof p.iat&&d<p.iat-n.gracePeriod)&&((void 0===p.jti||void 0===n.jti||p.jti===n.jti)&&!!i.verify(e,t,n.alg))))},se.jws.JWS.includedArray=function(e,t){var n=se.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},se.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},se.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"},se.jws.JWS.isSafeJSONString=function(e,t,n){var r=null;try{return"object"!=typeof(r=oe(e))||r.constructor===Array?0:(t&&(t[n]=r),1)}catch(e){return 0}},se.jws.JWS.readSafeJSONString=function(e){var t=null;try{return"object"!=typeof(t=oe(e))||t.constructor===Array?null:t}catch(e){return null}},se.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]},se.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=xe(t);return me(se.crypto.Util.hashHex(n,"sha256"))},se.jws.IntDate={},se.jws.IntDate.get=function(e){var t=se.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},se.jws.IntDate.getZulu=function(e){return ke(e)},se.jws.IntDate.getNow=function(){return~~(new Date/1e3)},se.jws.IntDate.intDate2UTCString=function(e){return new Date(1e3*e).toUTCString()},se.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!==se&&se||(se={}),void 0!==se.jws&&se.jws||(se.jws={}),se.jws.JWSJS=function(){var e=se.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=se.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],s=i+"."+this.sPayload+"."+o,a=!1;try{a=e.verify(s,n,r)}catch(e){return!1}return a},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=Z,t.rng_seed_time=G,t.BigInteger=w,t.RSAKey=te,t.ECDSA=se.crypto.ECDSA,t.DSA=se.crypto.DSA,t.Signature=se.crypto.Signature,t.MessageDigest=se.crypto.MessageDigest,t.Mac=se.crypto.Mac,t.KEYUTIL=tt,t.ASN1HEX=ue,t.X509=ot,t.X509CRL=function(e){var t=se.lang.String.isHex,n=ue,r=n.getV,i=n.getTLV,o=n.getVbyList,s=n.getTLVbyList,a=n.getTLVbyListEx,l=n.getIdxbyList,u=n.getIdxbyListEx,c=n.getChildIdx,h=new ot;this.hex=null,this.posSigAlg=null,this.posRevCert=null,this.parsed=null,this._setPos=function(){var e=l(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=l(this.hex,0,[0,this.posSigAlg+3]),i=this.hex.substr(r,2);if("17"==i||"18"==i)n=l(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=s(this.hex,0,[0,this.posSigAlg],"30");return h.getAlgorithmIdentifierName(e)},this.getIssuer=function(){return h.getX500Name(this.getIssuerHex())},this.getIssuerHex=function(){return s(this.hex,0,[0,this.posSigAlg+1],"30")},this.getThisUpdate=function(){var e=o(this.hex,0,[0,this.posSigAlg+2]);return result=we(e)},this.getNextUpdate=function(){var e=l(this.hex,0,[0,this.posSigAlg+3]),t=this.hex.substr(e,2);return"17"!=t&&"18"!=t?null:we(r(this.hex,e))},this.getRevCertArray=function(){if(null==this.posRevCert)return null;for(var e=[],t=l(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=we(o(e,0,[1])),3==n.length&&(t.ext=h.getExtParamArray(s(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=s(this.hex,0,[0],"30"),i=new se.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!=u(this.hex,0,[0,"[0]"])){var o=a(this.hex,0,[0,"[0]",0]);t.ext=h.getExtParamArray(o)}return t.sighex=this.getSignatureValueHex(),this.parsed=t,"object"==typeof e&&(1==e.tbshex&&(t.tbshex=s(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=$,t.ECFieldElementFp=ne,t.ECPointFp=re,t.ECCurveFp=ie,t.stoBA=ce,t.BAtos=he,t.BAtohex=pe,t.stohex=de,t.stob64=function(e){return y(de(e))},t.stob64u=function(e){return fe(y(de(e)))},t.b64utos=function(e){return he($(ge(e)))},t.b64tob64u=fe,t.b64utob64=ge,t.hex2b64=y,t.hextob64u=me,t.b64utohex=ve,t.utf8tob64u=ae,t.b64utoutf8=le,t.utf8tob64=function(e){return y(Re(Be(e)))},t.b64toutf8=function(e){return decodeURIComponent(Ie(b(e)))},t.utf8tohex=ye,t.hextoutf8=be,t.hextorstr=we,t.rstrtohex=xe,t.hextob64=Se,t.hextob64nl=function(e){return Ee(Se(e),64)},t.b64nltohex=Ae,t.hextopem=Ce,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=Fe,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),s=("00"+t.getUTCMinutes()).slice(-2),a=("00"+t.getUTCSeconds()).slice(-2),l=("000"+t.getUTCMilliseconds()).slice(-3);return n+r+i+o+s+a+(l=""!=(l=l.replace(/0+$/,""))?"."+l:l)+"Z"},t.zulutosec=ke,t.zulutodate=function(e){return new Date(Fe(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=Re,t.hextouricmp=Ie,t.ipv6tohex=Pe,t.hextoipv6=Oe,t.hextoip=_e,t.iptohex=Le,t.ucs2hextoutf8=Me,t.encodeURIComponentAll=Be,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=Ve,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=qe,t.hextooid=ze,t.strpad=We,t.bitstrtoint=Ye,t.inttobitstr=Je,t.bitstrtobinstr=Xe,t.binstrtobitstr=function(e){if("string"!=typeof e)return null;if(null==e.match(/^[01]+$/))return null;try{return Je(parseInt(e,2))}catch(e){return null}},t.isBase64URLDot=Ue,t.namearraytobinstr=Qe,t.extendClass=et,t.foldnl=Ee,t.b64topem=function(e,t){return"-----BEGIN "+t+"-----\r\n"+Ee(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=De,t.aryval=Ze,t.inttohex=Ke,t.twoscompl=Ge,t.KJUR=se,t.crypto=se.crypto,t.asn1=se.asn1,t.jws=se.jws,t.lang=se.lang,t.VERSION="11.1.0",t.VERSION_FULL="jsrsasign(all) 11.1.0 (2024-02-01) (c) 2010-2023 Kenji Urushima | kjur.github.io/jsrsasign/license"}).call(this,n(323).Buffer)},50:function(e,t){angular.module("graphdb.framework.rest.locations.service",[]).factory("LocationsRestService",n),n.$inject=["$http"];function n(e){return{getLocations:function(t){return e.get("rest/locations",{},{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}})}}}},51:function(e,t,n){"use strict";n.r(t);n(13),n(17),n(69);var r=n(2),i=n(19),o=n(25);function s(e,t,n,s,a,l,u,c,h,p,d,f){this.guideResumeSubscription=void 0,this.languageChangeSubscription=void 0,this.guideCancelSubscription=void 0,this.init=()=>{this._subscribeToGuideResumed(),this._subscribeToGuideCancel(),this._subscribeToGuidePause()},this.downloadGuidesFile=(e,t)=>f.downloadGuideResource(`${e}/${t}`).then(e=>{o.FileUtils.downloadAsFile(t,"application/text",e.data)}),this.startGuide=(e,i)=>{if(e&&e.options&&e.options.repositoryIdBase){const t=l.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,s,e.guideName,{}),e.options.translatedGuideDescription=r.GuideUtils.translateLocalMessage(n,s,e.guideDescription,{})}const o=this._toStepsDescriptions(e);for(let e=0;e<o.length;e++)o[e].id=e;angular.isDefined(i)?a.resumeGuide(e.guideId,o,i):a.startGuide(e.guideId,o,i),t.$broadcast("guideStarted")},this.getGuides=()=>f.getGuides().then(e=>{const t=e.data||[];return t.forEach((e,t)=>{void 0===e.guideId&&(e.guideId=Date.now()+t)}),t}),this.isActive=()=>a.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,o)=>{const f={$translate:n,$interpolate:s,GuideUtils:r.GuideUtils,$rootScope:t,toastr:u,$location:c,$route:h,$timeout:p,ShepherdService:a,$repositories:l,YasguiComponentDirectiveUtil:i.YasguiComponentDirectiveUtil,EventEmitterService:d};let g=[];if(angular.isArray(e))e.forEach(t=>{g=g.concat(this._getSteps(t,angular.extend({},e.options,o)))});else{const t=PluginRegistry.get("guide.step").find(t=>t.guideBlockName===e.guideBlockName);if(t){const n=angular.extend({},t.options,e.options,o);t.getSteps?g=g.concat(this._getSteps(_.cloneDeep(t.getSteps(n,f)),o)):t.getStep?g.push(_.cloneDeep(t.getStep(n,f))):g=g.concat(this._getSteps(_.cloneDeep(t,t.options),o))}}return g.forEach((e,t)=>{e.stepN=t,e.stepsTotalN=g.length,!e.title&&e.mainAction&&(e.title="guide.step-action."+e.mainAction)}),g},this._subscribeToGuideResumed=()=>{this.guideResumeSubscription||(this.guideResumeSubscription=t.$on("guideResume",()=>{const e=a.getGuideId();this.getGuides().then(t=>{const n=t.find(t=>t.guideId===e),r=a.getCurrentStepId();this.startGuide(n,r)})}))},this._subscribeToGuideCancel=()=>{a.subscribeToGuideCancel(()=>t.$broadcast("guideReset"))},this._subscribeToGuidePause=()=>{a.subscribeToGuidePause(()=>t.$broadcast("guidePaused"))}}angular.module("graphdb.framework.guides.services",["graphdb.framework.guides.shepherd.services","graphdb.framework.rest.guides.service"]).service("GuidesService",s),s.$inject=["$http","$rootScope","$translate","$interpolate","ShepherdService","$repositories","toastr","$location","$route","$timeout","EventEmitterService","GuidesRestService"]},52:function(e,t,n){"use strict";n.r(t);n(9);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)}}}])},53:function(e,t,n){"use strict";n.r(t);n(9);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";if(e.getAuthToken()&&(i.Authorization=e.getAuthToken()),!i["X-GraphDB-Repository"]){const e=t.get(n.REPOSITORY_ID),r=t.get(n.REPOSITORY_LOCATION);i["X-GraphDB-Repository"]=e||void 0,i["X-GraphDB-Repository-Location"]=r||void 0}return r.headers=i,r}}}])},55:function(e,t,n){"use strict";n.r(t);var r=n(5);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,s,a){const l="com.ontotext.graphdb.openid.",u=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=u.generateRandomString(),i=e.authFlow;if("code"===i){u.setStorageItem("pkce_state",r);const i=u.generateRandomString();u.setStorageItem("pkce_code_verifier",i);const o=u.pkceChallengeFromVerifier(i);n.location.href=u.getLoginUrl(r,o,t,e)}else"code_no_pkce"===i?(u.removeStorageItem("pkce_code_verifier"),n.location.href=u.getLoginUrl(r,"",t,e)):"implicit"===i?(u.setStorageItem("nonce",r),n.location.href=u.getLoginUrl(r,"",t,e)):(console.log("oidc: unknown auth flow: "+i),o.error(s.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(s.instant("openid.auth.unknown.flow",{authFlow:r.authFlow}))}return i.unshift("response_type="+encodeURIComponent(o),"scope="+encodeURIComponent(u.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){a.OPENID_CONFIG.openIdKeys={},e.keys.forEach((function(e){a.OPENID_CONFIG.openIdKeys[e.kid]=e})),n()}))},this.initOpenId=function(e,t,r,l){u.clientId=e.clientId,u.tokenType=e.tokenType,u.idTokenAudience=e.clientId,u.idTokenIssuer=e.issuer,u.accessTokenAudience=e.tokenAudience,u.accessTokenIssuer=e.tokenIssuer,a.OPENID_CONFIG.openIdTokenUrl=e.oidcTokenEndpoint,a.OPENID_CONFIG.openIdKeysUri=e.oidcJwksUri,e.proxyOidc&&(a.OPENID_CONFIG.openIdKeysUri="rest/openid/jwks",a.OPENID_CONFIG.openIdTokenUrl="rest/openid/token"),a.OPENID_CONFIG.openIdEndSessionUrl=e.oidcEndSessionEndpoint,a.OPENID_CONFIG.supportsOfflineAccess=e.oidcScopesSupported.includes("offline_access"),e.oracleDomain&&(i.headers["X-OAuth-Identity-Domain-Name"]=e.oracleDomain),u.withOpenIdKeys(a.OPENID_CONFIG.openIdKeysUri,(function(){if(u.isLoggedIn=u.hasValidIdToken(),u.isLoggedIn)u.setupTokensRefresh(!1,r,l);else if(u.hasValidRefreshToken())u.refreshTokens(r,l);else{const i=r;r=function(){u.isLoggedIn=!0,i(!0)},u.softLogout();const a=u.parseQueryString(n.location.search.substring(1));if(a.code)"code"===e.authFlow?u.getStorageItem("pkce_state")!==a.state?(o.error(s.instant("openid.auth.invalid.pkce.state")),console.log("oidc: PKCE state mismatch "+u.getStorageItem("pkce_state")+" != "+a.state),l()):u.retrieveTokensByCode(a.code,t,r,l):"code_no_pkce"===e.authFlow&&u.retrieveTokensByCode(a.code,t,r,l);else{const e=u.parseQueryString(n.location.pathname.substring(1));e.id_token?u.saveTokens(e,!0,!1,r):l()}}}))},this.authHeaderGraphDB=function(){return"id"===u.getStorageItem("token_type")?"Bearer "+u.getToken("id"):"Bearer "+u.getToken("access")},this.softLogout=function(){u.isLoggedIn=!1,u.setToken("id",null),u.setToken("access",null),u.setToken("refresh",null)},this.hardLogout=function(e){u.softLogout(),a.OPENID_CONFIG.openIdEndSessionUrl&&(n.location.href=`${a.OPENID_CONFIG.openIdEndSessionUrl}?client_id=${encodeURIComponent(u.clientId)}&post_logout_redirect_uri=${encodeURIComponent(e)}`)},this.getToken=function(e){return u.getStorageItem(e+"_token")},this.setToken=function(e,t){t?u.setStorageItem(e+"_token",t):u.removeStorageItem(e+"_token")},this.tokenHeader=function(e){const t=u.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:s.instant("openid.auth.not.jwt.token",{token:t})}}return{}},this.verifyToken=function(e){const t=u.getToken(e),n=u.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=a.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),s={alg:[n.alg],iss:[u.idTokenIssuer]};return"id"===e?(s.aud=[u.idTokenAudience,u.idTokenIssuer],s.nonce=[u.getStorageItem("nonce")]):"access"===e&&(s.aud=[u.accessTokenAudience],s.iss=[u.accessTokenIssuer]),r.KJUR.jws.JWS.verifyJWT(t,o,s)},this.hasValidIdToken=function(){return u.getToken("id")?u.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=u.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:s.instant("openid.auth.not.jwt.token",{token:t})}}return{}},this.saveTokens=function(e,n,r,i){(n||e.refresh_token)&&u.setToken("refresh",e.refresh_token),u.setToken("access",e.access_token),u.setToken("id",e.id_token),u.setStorageItem("token_type",u.tokenType),console.log("oidc: saved tokens"),u.setupTokensRefresh(n||r,i),u.removeStorageItem("pkce_state"),u.removeStorageItem("pkce_code_verifier"),n&&t.url("/")},this.retrieveTokensByCode=function(t,n,r,l){const h={grant_type:"authorization_code",client_id:u.clientId,redirect_uri:n,code:t},p=u.getStorageItem("pkce_code_verifier");p&&(h.code_verifier=p);const d={...i.headers,"Content-type":"application/x-www-form-urlencoded; charset=utf-8"};e({method:"POST",url:a.OPENID_CONFIG.openIdTokenUrl,headers:d,transformRequest:c,data:h}).success((function(e){u.saveTokens(e,!0,!1,r)})).error((function(e){o.error(s.instant("openid.auth.cannot.retrieve.token.msg",{error:getError(e)})),l()}))},this.refreshTokens=function(t,n){if(u.hasValidRefreshToken()){const r={grant_type:"refresh_token",client_id:u.clientId,refresh_token:u.getToken("refresh")},l={...i.headers,"Content-type":"application/x-www-form-urlencoded; charset=utf-8"};e({method:"POST",url:a.OPENID_CONFIG.openIdTokenUrl,headers:l,transformRequest:c,data:r}).success((function(e){console.log("oidc: refreshed tokens"),u.saveTokens(e,!1,!0,t),u.isLoggedIn=!0})).error((function(e){console.log("oidc: could not refresh tokens"),o.error(s.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=u.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(u.hasValidRefreshToken()){clearTimeout(u.previousTimer);const r=u.tokenPayload("id");if(r.exp>0){const i=1e3*r.exp-Date.now()-6e4;if(!(e||i>1e3))return u.previousTimer=null,console.log("oidc: tokens will refresh now, "+i+"; "+e),void u.refreshTokens(t,n);u.previousTimer=setTimeout((function(){u.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"+(a.OPENID_CONFIG.supportsOfflineAccess?" offline_access":"");return e&&(t+=" "+e),console.log(`oidc: requesting scopes '${t}'`),t},this.setStorageItem=function(e,t){localStorage.setItem(l+e,t)},this.getStorageItem=function(e){return localStorage.getItem(l+e)},this.removeStorageItem=function(e){localStorage.removeItem(l+e)}}])},56: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.password,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)}))}}},57: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),"errorMessage"in e&&(r=e.errorMessage)}return n>0&&r.length>n&&(r=r.substr(0,n)+"..."),r}return"There is an error"}}(window)},58:function(e,t,n){"use strict";n.r(t);n(9),n(59),n(60),n(26),n(48),n(43),n(27),n(21),n(83),n(84),n(42),n(41),n(61),n(62),n(23),n(47);var r=n(6),i=(n(13),n(67),n(44),n(68),n(0)),o=(n(51),n(70),n(17)),s=(n(315),n(324),n(18)),a=n(14),l=n(8);function u(e,t,n,r,i,o,s,a,u,c,h,p,d){e.doClear=!1,e.getActiveRepositorySize=()=>{const t=r.getActiveRepositoryObject();t&&(e.activeRepositorySizeError=void 0,c.getSize(t).then((function(t){e.activeRepositorySize=t.data})).catch((function(t){e.activeRepositorySizeError=t.data.message})))},e.onKeyDown=function(t){27===t.keyCode&&(e.doClear=!0)};const f=[];f.push(h.onSelectedRepositoryIdUpdated(t=>{t?(e.getActiveRepositorySize(),p.getNamespaces(t).then(t=>{e.repositoryNamespaces=t}).catch(e=>{const t=getError(e);d.error(t,s.instant("error.getting.namespaces.for.repo"))})):e.repositoryNamespaces=new l.NamespacesListModel})),f.push(h.onAutocompleteEnabledUpdated(t=>{e.isAutocompleteEnabled=t})),e.$on("$destroy",()=>f.forEach(e=>e())),e.$on("$routeChangeSuccess",(function(n,r,o){o&&(i.isAuthenticated()||i.isFreeAccessEnabled()?e.getActiveRepositorySize():t.redirectToLogin())}))}function c(e,t,n,l,u,c,h,p,d,f,g,m,v,y,b,w,x,S,E,A,C,T,F,k,D,R,I,P,O,j,L){e.descr=T.instant("main.gdb.description"),e.documentation="",e.menu=t,e.menuCollapsed=!1,e.tutorialState=1!==A.get(C.TUTORIAL_STATE),e.userLoggedIn=!1,e.embedded=c.search().embedded,e.productInfo=f,e.guidePaused="true"===A.get(o.GUIDE_PAUSE),e.licenseIsSet=!1,e.hideRdfResourceSearch=!1,e.showRdfResourceSearch=()=>!e.hideRdfResourceSearch&&!!e.getActiveRepository()&&e.hasActiveLocation()&&(!e.isLoadingLocation()||e.isLoadingLocation()&&"/repository"===c.url()),e.onRdfResourceSearch=()=>{N()&&(e.hideRdfResourceSearch=!0,$("#search-resource-input-home input").focus(),u.info(Object(i.decodeHTML)(T.instant("search.resource.current.page.msg")),T.instant("search.resources.msg"),{allowHtml:!0}))};const N=()=>"/"===c.url();e.isMenuCollapsedOnLoad=function(){return $(".main-menu").hasClass("collapsed")},e.checkMenu=Object(s.debounce)((function(){const t=e.isMenuCollapsedOnLoad();e.menuCollapsed!==t&&(e.menuCollapsed=t)}),0,{trailing:!0});const M=e.$watch((function(){return e.isMenuCollapsedOnLoad()}),(function(t,n){t===n&&void 0!==t||e.checkMenu()}));e.showLabel=function(t){return!!t.children||!e.menuCollapsed};!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,e.hideRdfResourceSearch=!1,$(".menu-element-root").removeClass("active"),g((function(){$(".menu-element.open a.menu-element-root").addClass("active"),$(".main-menu.collapsed .menu-element.open .menu-element-root").addClass("active")}),400),r&&p.checkLicenseStatus().then(()=>O.init())})),e.resumeGuide=function(){d.$broadcast("guideResume")},d.$on("guideReset",(function(){e.guidePaused=!1,d.guidePaused=!1})),d.$on("guideStarted",(function(){e.guidePaused=!1,d.guidePaused=!1})),d.$on("guidePaused",(function(){e.guidePaused=!0,d.guidePaused=!0})),d.$on("$translateChangeSuccess",(function(){e.menu.forEach((function(e){e.label=T.instant(e.labelKey),e.children&&e.children.forEach((function(e){e.label=T.instant(e.labelKey)}))})),d.helpInfo=E.trustAsHtml(Object(i.decodeHTML)(T.instant(d.helpInfo))),d.title=Object(i.decodeHTML)(T.instant(d.title)),e.initTutorial()})),e.copyToClipboard=function(e){m.openCopyToClipboardModal(e)},e.goToAddRepo=function(){c.path("/repository/create").search({previous:"home"})},e.goToEditRepo=function(e){c.path("repository/edit/"+e.id).search({previous:"home",location:e.location})},e.getLocationFromUri=function(e){return h.getLocationFromUri(e)},e.$on("$locationChangeSuccess",(function(){e.showFooter=!0})),e.$on("repositoryIsSet",(function(){e.setRestricted(),A.clearClassHieararchyState()})),e.graphdbVersion=e.engineVersion=f.productVersion,e.workbenchVersion=f.Workbench,e.connectorsVersion=f.connectors,e.sesameVersion=f.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):(g((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.resolveUrl=(e,t)=>a.DocumentationUrlResolver.getDocumentationUrl(e,t),e.isCurrentPath=function(e){return c.path()==="/"+e},e.isCurrentSubmenuChildPath=function(t){return 0!==t.children.length&&t.children.some((function(t){return e.isCurrentPath(t.href)}))},"/"===c.path()?e.selected=-1:(g((function(){const t=c.path().replace("/",""),n=$('a[href^="'+t+'"]');e.selected=n.closest(".menu-element").index()-1}),200),e.isCurrentPath(c.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 h.hasActiveLocation()},e.getActiveLocation=function(){return h.getActiveLocation()},e.isLoadingLocation=function(){return h.isLoadingLocation()},e.getRepositories=function(){return h.getRepositories()},e.getReadableRepositories=function(){return h.getReadableRepositories()},e.getWritableRepositories=function(){return h.getWritableRepositories()},e.getActiveRepository=function(){return h.getActiveRepository()},e.canWriteRepoInLocation=function(e){return n.canWriteRepo(e)},e.canWriteActiveRepo=function(e){const t=h.getActiveRepositoryObject();return!!t&&(n.canWriteRepo(t)&&("SYSTEM"!==t.id||!e))},e.getActiveRepositoryObject=function(){return h.getActiveRepositoryObject()},e.getActiveRepositoryShortLocation=function(){const e=h.getActiveRepositoryObject();if(e){const t=e.location;if(t)return"@"+F.shortenIri(t)}return""},e.isActiveRepoOntopType=function(){return h.isActiveRepoOntopType()},e.isActiveRepoFedXType=function(){return h.isActiveRepoFedXType()},e.isLicenseValid=function(){return p.isLicenseValid()},e.setAttrs=function(t){e.attrs=t},e.setRestricted=function(){e.attrs&&(e.isRestricted=e.attrs.hasOwnProperty("license")&&!p.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){h.setRepository(e)},e.logout=function(){n.clearAuthentication(),u.success("Signed out"),n.freeAccess?(h.resetActiveRepository(),n.updateReturnUrl()):n.isSecurityEnabled()&&d.redirectToLogin()},e.showMainManuAndStatusBar=()=>n.isAuthenticated()||e.isSecurityEnabled()&&e.isFreeAccessEnabled();const B=()=>{setTimeout(()=>{I.location.reload()},0)};let H=void 0;const U=e=>{if(P.AUTH_STORAGE_NAME===e.key){const e=n.isAuthenticated();n.updateReturnUrl(),H!==e&&(H=e,H?(c.url(d.returnToUrl||"/"),R.reload(),B()):(d.redirectToLogin(),B()))}};window.addEventListener("storage",U),e.$on("$destroy",()=>{document.removeEventListener("click",V),window.removeEventListener("storage",U),M(),e.checkMenu&&g.cancel(e.checkMenu)}),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 d.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.handlePopovers=function(t){e.setPopoverRepo(t),e.closeActiveRepoPopover()},e.isRepoActive=function(e){return h.isRepoActive(e)},e.getRepositorySize=function(){e.repositorySize={},e.popoverRepo&&(e.repositorySize.loading=!0,w.getSize(e.popoverRepo).then((function(t){e.repositorySize=t.data})))},e.isActiveRepoPopoverOpen=!1,e.openActiveRepoPopover=function(){e.getActiveRepository()&&(e.isActiveRepoPopoverOpen=!0)},e.closeActiveRepoPopover=function(){e.isActiveRepoPopoverOpen=!1};const V=function(t){const n=document.querySelector(".popover");e.isActiveRepoPopoverOpen&&n&&!n.contains(t.target)&&g((function(){e.isActiveRepoPopoverOpen=!1}),0)};function q(e){e?$(":root").addClass("menu-collapsed"):$(":root").removeClass("menu-collapsed")}function z(){$(window).width()<=720?($(".container-fluid.main-container").addClass("expanded"),q(!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"===A.get(C.MENU_STATE)?($(".container-fluid.main-container").addClass("expanded"),q(!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"),q(!1),$(".main-menu").removeClass("collapsed"),$(".toggle-menu").show(),$(".main-menu .icon-caret-right").toggleClass("icon-caret-right").toggleClass("icon-caret-left"))}document.addEventListener("click",V),e.getDegradedReason=function(){return h.getDegradedReason()},e.canManageRepositories=function(){return n.hasRole(r.UserRole.ROLE_REPO_MANAGER)&&!h.getDegradedReason()},e.getSavedQueries=function(){S.getSavedQueries().success((function(t){e.sampleQueries=t})).error((function(e){const t=getError(e);u.error(t,T.instant("query.editor.get.saved.queries.error"))}))},e.goToSparqlEditor=function(e){c.path("/sparql").search({savedQueryName:e.name,owner:e.owner,execute:!0})},e.declineTutorial=function(){A.set(C.TUTORIAL_STATE,1),e.tutorialState=!1},e.showTutorial=function(){e.tutorialState=!0,A.remove(C.TUTORIAL_STATE)},e.initTutorial=function(){if(!e.tutorialState&&"/"!==c.path())return;e.tutorialInfo=[{title:T.instant("main.info.title.welcome.page"),info:"<p>"+Object(i.decodeHTML)(T.instant("main.info.welcome.page"))+"</p><p>"+Object(i.decodeHTML)(T.instant("main.info.welcome.page.guides"))+"</p><p>"+Object(i.decodeHTML)(T.instant("main.info.welcome.page.footer"))+"</p>"},{title:T.instant("main.info.title.create.repo.page"),info:Object(i.decodeHTML)(T.instant("main.info.create.repo.page",{link:'<a href="https://graphdb.ontotext.com/documentation/'+f.productShortVersion+'/configuring-a-repository.html" target="_blank">'}))},{title:T.instant("main.info.title.load.sample.dataset"),info:T.instant("main.info.load.sample.dataset")},{title:T.instant("main.info.title.run.sparql.query"),info:Object(i.decodeHTML)(T.instant("main.info.run.sparql.query"))},{title:T.instant("menu.rest.api.label"),info:Object(i.decodeHTML)(T.instant("main.info.rest.api"))}],e.activePage=0,$(".pages-wrapper .page-slide").css("opacity",100);const t=$(".main-container")[0].offsetWidth+200;g((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 E.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")},z(),$(window).resize((function(){angular.isDefined(e.menuState)?$(window).width()<=720?($(".container-fluid.main-container").addClass("expanded"),q(!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"),q(!1),$(".main-menu").removeClass("collapsed"),$(".toggle-menu").show(),$(".main-menu .icon-caret-right").toggleClass("icon-caret-right").toggleClass("icon-caret-left")):z(),e.tutorialState&&"/"===c.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"),q(!1),t.removeClass("collapsed"),$(".main-menu .icon-caret-right").toggleClass("icon-caret-right").toggleClass("icon-caret-left"),d.$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"),q(!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"),d.$broadcast("onToggleNavWidth",!0)}},e.$on("onToggleNavWidth",(function(t,n){if(e.menuState=n,n?A.set(C.MENU_STATE,"collapsedMenu"):A.set(C.MENU_STATE,"expandedMenu"),e.tutorialState&&"/"===c.path()){const t=$(".pages-wrapper")[0].offsetWidth+200;g((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?(k.when(n.getPrincipal()).then(t=>{e.principal=t,e.isIgnoreSharedQueries=t&&t.appSettings.IGNORE_SHARED_QUERIES}).then(()=>{setTimeout(()=>e.getSavedQueries(),500)}),p.checkLicenseStatus().then(()=>{e.licenseIsSet=!0,O.init()}).catch(()=>{e.licenseIsSet=!1})):"/login"!==c.path()&&d.redirectToLogin()})),e.isTrackingAllowed=function(){if(e.licenseIsSet)return O.isTrackingAllowed()},e.getProductType=function(){return p.productType()},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 p.showLicense()},e.getLicense=function(){return p.license()},e.isLicenseHardcoded=function(){return p.isLicenseHardcoded()},e.getProductTypeHuman=function(){return p.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 s="";return n&&(s+=n+"d "),(n||r)&&(s+=r+"h "),(n||r||i)&&(s+=i+"m "),s+=o+"s",s.replace(/( 0[a-z])+$/,"")},e.getHumanReadableTimestamp=function(e){const t=Date.now(),n=(t-e)/1e3;if(n<60)return T.instant("timestamp.moments.ago");if(n<600)return T.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 y("date")(e,"'"+T.instant("timestamp.today.at")+"' HH:mm");if(n<86400)return y("date")(e,"'"+T.instant("timestamp.yesterday.at")+"' HH:mm")}return y("date")(e,"'"+T.instant("timestamp.on")+"' yyyy-MM-dd '"+T.instant("timestamp.at")+"' HH:mm")};const K=()=>{const e=h.getActiveRepository();e!==j.getSelectedRepositoryId()&&(j.setSelectedRepositoryId(e),(()=>{if(h.isActiveRepoFedXType()||!p.isLicenseValid())return j.setAutocompleteEnabled(!1),void A.set(C.AUTOCOMPLETE_ENABLED,!1);L.checkAutocompleteStatus().then(e=>{j.setAutocompleteEnabled(e),A.set(C.AUTOCOMPLETE_ENABLED,e)}).catch(()=>{u.error(T.instant("explore.error.autocomplete"))})})())};d.$on("repositoryIsSet",K),window.addEventListener("storage",e=>{"ls."+C.AUTOCOMPLETE_ENABLED===e.key?j.setAutocompleteEnabled("true"===e.newValue):"ls."+C.REPOSITORY_ID===e.key&&K()}),e.downloadGuidesFile=(e,t)=>{D.downloadGuidesFile(e,t).catch(e=>{u.error(T.instant("guide.step_plugin.download-guide-resource.download.message.failure",{resourceFile:t}))})}}function h(e,t,n){e.getRepositorySize=function(t){n.getSize(t).then((function(t){e.size=t.data}))}}function p(e,t,n,r){e.colors=[{name:"black",shade:"dark"},{name:"white",shade:"light"},{name:"red",shade:"dark"},{name:"blue",shade:"dark"},{name:"yellow",shade:"light"}],e.myColor=e.colors[2],e.specialValue={id:"12345",value:"green"},e.checkedItem={name:"black",shade:"dark"},e.toggleOn=!0,e.toggleSwitch=function(){e.toggleOn=!e.toggleOn},e.repositories=["Repo1","Repo2","Repo3"],e.formats=["JSON","JSON-LD","Turtle"],e.onopen=e.onclose=()=>angular.noop(),e.openInfoPanel=!1,e.showInfoPanel=function(){e.openInfoPanel=!0},e.closeInfoPanel=function(){e.openInfoPanel=!1},e.slideOpen=!1,e.toggleSlide=function(){e.slideOpen=!e.slideOpen},e.slider={value:10,minValue:10,maxValue:90,options:{floor:0,ceil:100,step:1}},e.openModal=function(){const e=r.openSimpleModal({title:"Confirm",message:"Lorem ipsum dolor sit amet.",warning:!0});e.result.then((function(){e.dismiss("cancel")}))},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.trackingService","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.utils.localstorageadapter","graphdb.framework.utils.workbenchsettingsstorageservice","graphdb.framework.core.services.autocomplete","graphdb.framework.utils.uriutils","graphdb.framework.guides.directives","graphdb.framework.guides.services","pageslide-directive","graphdb.core.services.workbench-context","graphdb.framework.core.services.rdf4j.repositories","rzSlider"]).controller("mainCtrl",c).controller("homeCtrl",u).controller("repositorySizeCtrl",h).controller("uxTestCtrl",p),u.$inject=["$scope","$rootScope","$http","$repositories","$jwtAuth","$licenseService","$translate","AutocompleteRestService","LicenseRestService","RepositoriesRestService","WorkbenchContextService","RDF4JRepositoriesService","toastr"],c.$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","TrackingService","WorkbenchContextService","AutocompleteService"],h.$inject=["$scope","$http","RepositoriesRestService"],p.$inject=["$scope","$repositories","toastr","ModalService"]},59: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=s();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?s():void 0)},s=()=>o("default-theme"),a=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)},l=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=s()),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(a).map(e=>({name:e.name,label:t.instant(e.label)||e.label})),applyTheme:e=>{const t=(e=>{const t=l(e),n=new CSSStyleSheet;return n.title=e.name,n.replaceSync(t),n})(o(e));document.adoptedStyleSheets=[t]}}}},6: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"}}}},60: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,n){return e.put("rest/sparql/saved-queries?oldQueryName="+encodeURIComponent(t),n)},deleteSavedQuery:function(t){return e.delete("rest/sparql/saved-queries?name="+encodeURIComponent(t))},addNewSavedQuery:function(t){return e.post("rest/sparql/saved-queries",t)},getQueryResult:function(t,n,r){return e.get("repositories/"+t,{params:n,headers:{Accept:r}})}}}},61:function(e,t){angular.module("graphdb.framework.core.services.licenseService",[]).service("$licenseService",["$window","$document","LicenseRestService","$translate",function(e,t,n,r){let i=void 0,o=!1,s=!1,a=!1,l=void 0,u=void 0;const c=e=>{l=e.productType,"standard"===l?u="Standard":"enterprise"===l?u="Enterprise":"free"===l?u="Free":"graphdb"===l&&(u="GraphDB")};return{checkLicenseStatus:()=>(o=!0,n.getHardcodedLicense().then(e=>(s="true"===e.data,n.getLicenseInfo())).then(e=>{i=e.data}).catch(()=>{s=!0,i={message:r.instant("no.license.set.msg"),valid:!1}}).finally(()=>{c(i),a=!0,o=!1})),isLicenseValid:()=>i&&i.valid,license:()=>i,loadingLicense:()=>o,isLicenseHardcoded:()=>s,showLicense:()=>a,productType:()=>l,productTypeHuman:()=>u,isFreeLicense:()=>{const e=i&&i.typeOfUse.toLowerCase();return"free"===l||"this is an evaluation license"===e||"evaluation"===e}}}])},62:function(e,t,n){"use strict";n.r(t);n(63),n(64),n(65),n(66);var r=n(7);angular.module("graphdb.framework.core.services.trackingService",["graphdb.framework.core.services.cookieService","graphdb.framework.core.services.installationCookieService","graphdb.framework.core.services.googleAnalyticsCookieService","graphdb.framework.core.directives.cookie-consent"]).service("TrackingService",["$window","$jwtAuth","$translate","$licenseService","toastr","InstallationCookieService","GoogleAnalyticsCookieService",function(e,t,n,i,o,s,a){const l=()=>{const t=i.isFreeLicense(),n=!e.wbDevMode;return t&&n},u=()=>{l()?t.getPrincipal().then(e=>{const t=r.CookieConsent.fromJSON(e.appSettings.COOKIE_CONSENT);if(t.getPolicyAccepted()){if(t.getStatisticConsent()){const e=i.license().installationId||"";s.setIfAbsent(e)}else s.remove();t.getThirdPartyConsent()?a.setIfAbsent():a.remove()}else c()}).catch(e=>{const t=getError(e.data,e.status);o.error(t,n.instant("common.error"))}):c()},c=()=>{s.remove(),a.remove()};return{init:u,getCookieConsent:()=>t.getPrincipal().then(e=>e&&e.appSettings&&e.appSettings.COOKIE_CONSENT?r.CookieConsent.fromJSON(e.appSettings.COOKIE_CONSENT):new r.CookieConsent(void 0,!0,!0)),updateCookieConsent:e=>t.getPrincipal().then(n=>{const r=n.appSettings,i=n.username;return r.COOKIE_CONSENT=e.toJSON(),t.updateUserData({appSettings:r,username:i})}).finally(()=>u()),isTrackingAllowed:l}}])},63:function(e,t){angular.module("graphdb.framework.core.services.cookieService",[]).service("CookieService",["$document","$cookies",function(e,t){return{get:e=>t[e],set:(t,r,i={})=>{e[0].cookie=new n(t,r,i).build()},remove:t=>{e[0].cookie=new n(t,"",{expiration:-1}).build()},getAll:()=>{const e={};for(const[n,r]of Object.entries(t))e[n]=r;return e}}}]);class n{constructor(e,t,n={}){this.key=encodeURIComponent(e),this.value=encodeURIComponent(t),this.setOptions(n)}setOptions(e){const{expiration:t,path:n,domain:r,secure:i,httpOnly:o,sameSite:s}=e;return t&&this.setExpiration(t),this.setPath(n),r&&this.setDomain(r),i&&this.setSecure(),o&&this.setHttpOnly(),s&&this.setSameSite(s),this}setExpiration(e){const t=new Date;return t.setTime(t.getTime()+24*e*60*60*1e3),this.expires=t.toUTCString(),this}setPath(e){return this.path=e||"/",this}setDomain(e){return this.domain=e,this}setSecure(){return this.secure=!0,this}setHttpOnly(){return this.httpOnly=!0,this}setSameSite(e){return this.sameSite=e,this}build(){let e=`${this.key}=${this.value}`;return this.expires&&(e+="; expires="+this.expires),e+="; path="+this.path,this.domain&&(e+="; domain="+this.domain),this.secure&&(e+="; secure"),this.httpOnly&&(e+="; HttpOnly"),this.sameSite&&(e+="; SameSite="+this.sameSite),e}}},64:function(e,t){angular.module("graphdb.framework.core.services.installationCookieService",[]).service("InstallationCookieService",["CookieService",function(e){const t=()=>e.get("_wb"),n=t=>{const n=`WB1.${t}.${Date.now()}`;e.set("_wb",n,{expiration:400})};return{get:t,set:n,setIfAbsent:e=>{t()||n(e)},remove:()=>{e.remove("_wb")}}}])},65:function(e,t){angular.module("graphdb.framework.core.services.googleAnalyticsCookieService",[]).service("GoogleAnalyticsCookieService",["$window","$document","CookieService",function(e,t,n){const r=()=>{const e=t[0].getElementsByTagName("script");return Array.from(e).some(e=>e.src&&e.src.includes("googletagmanager"))},i=()=>{e.dataLayer&&(e.dataLayer.push=function(){return null});const n=t[0].getElementsByTagName("script"),r=/googletagmanager/i;for(let e=n.length-1;e>=0;e--)(n[e].src&&r.test(n[e].src)||r.test(n[e].text))&&n[e].parentNode.removeChild(n[e]);e.google_tag_manager&&delete e.google_tag_manager,window.google_tag_data&&delete e.google_tag_data},o=()=>{const e=n.getAll();for(const[t,r]of Object.entries(e))t.startsWith("_ga")&&n.remove(t)};return{setIfAbsent:()=>{if(!r()){const e=t[0].createElement("script");e.text="(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js'}); var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:''; j.async=true; j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl; f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-WBP6C6Z4');",t[0].getElementsByTagName("head")[0].appendChild(e)}},remove:()=>{r()&&i(),o()}}}])},66:function(e,t,n){"use strict";n.r(t);var r=n(30);function i(e,t,n,i,o,s){return{restrict:"E",templateUrl:"js/angular/core/templates/cookie-policy/cookie-consent.html",link:e=>{let n=void 0;e.showCookieConsent=!1,e.acceptConsent=()=>{s.updateCookieConsent(n.setPolicyAccepted(!0)).then(()=>e.showCookieConsent=!1)},e.showCookiePolicy=()=>{t.open({templateUrl:"js/angular/core/templates/cookie-policy/cookie-policy.html",controller:r.CookiePolicyModalController,backdrop:"static",keyboard:!1,windowClass:"cookie-policy-modal"})};const a=()=>{s.getCookieConsent().then(t=>{n=t,e.showCookieConsent=!t.getPolicyAccepted()}).catch(e=>{const t=getError(e.data,e.status);o.error(t,i.instant("common.error"))})},l=e.$on("securityInit",(t,n,r)=>{r?a():e.showCookieConsent=!1});e.$on("$destroy",()=>{l()}),a()}}}angular.module("graphdb.framework.core.directives.cookie-consent",[]).directive("cookieConsent",i),i.$inject=["$jwtAuth","$uibModal","$licenseService","$translate","toastr","TrackingService"]},67: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=_.clone(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"]},68:function(e,t,n){"use strict";n.r(t);n(26);function r(e,t,n){return{checkAutocompleteStatus:()=>e.checkAutocompleteStatus().then(e=>(n.set(t.AUTOCOMPLETE_ENABLED,e.data),e.data)),addLabelConfig:t=>e.addLabelConfig(t),editLabelConfig:(t,n)=>{const r={};return n&&(r.oldLabel=n),t&&(r.newLabel=t),e.editLabelConfig(r)},removeLabelConfig:t=>e.removeLabelConfig(t),interruptIndexing:()=>e.interruptIndexing(),buildIndex:()=>e.buildIndex(),toggleIndexIRIs:t=>e.toggleIndexIRIs(t),checkForPlugin:()=>e.checkForPlugin(),refreshLabelConfig:()=>e.refreshLabelConfig(),refreshIndexStatus:()=>e.refreshIndexStatus(),refreshIndexIRIs:()=>e.refreshIndexIRIs(),toggleAutocomplete:t=>e.toggleAutocomplete(t)}}angular.module("graphdb.framework.core.services.autocomplete",["graphdb.framework.rest.autocomplete.service"]).factory("AutocompleteService",r),r.$inject=["AutocompleteRestService","LSKeys","LocalStorageAdapter"]},69:function(e,t){function n(e){return{getGuides:()=>e.get("rest/guides"),downloadGuideResource:t=>e.get("rest/guides/download/"+t)}}angular.module("graphdb.framework.rest.guides.service",[]).factory("GuidesRestService",n),n.$inject=["$http"]},7:function(e,t,n){"use strict";n.r(t),n.d(t,"CookieConsent",(function(){return r})),n.d(t,"ConsentTypes",(function(){return i}));class r{constructor(e,t,n,r){this.policyAccepted=e,this.statistic=t,this.thirdParty=n,this.updatedAt=r}setPolicyAccepted(e){return this.policyAccepted=e,this.updateTimestamp(),this}setStatisticConsent(e){return this.statistic=e,this.updateTimestamp(),this}setThirdPartyConsent(e){return this.thirdParty=e,this.updateTimestamp(),this}updateTimestamp(){this.updatedAt=Date.now()}getPolicyAccepted(){return this.policyAccepted}getStatisticConsent(){return this.statistic}getThirdPartyConsent(){return this.thirdParty}toJSON(){return{policyAccepted:this.policyAccepted,statistic:this.statistic,thirdParty:this.thirdParty,updatedAt:this.updatedAt}}static fromJSON(e){return new r(e&&e.policyAccepted,e&&e.statistic,e&&e.thirdParty,e&&e.updatedAt)}}const i={STATISTIC:"statistic",THIRD_PARTY:"thirdParty"}},70:function(e,t){angular.module("graphdb.framework.guides.directives",[]).directive("guideSelector",(function(){return{}}))},71:function(e,t){
|
|
77
77
|
/**
|
|
78
78
|
* angular-cancel-on-navigate - AngularJS module that cancels HTTP requests on location change (navigation)
|
|
79
79
|
* @version v0.1.0
|