@learncard/react 2.0.1 → 2.1.0
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/cjs/Button-80d7b0e3.js +2 -0
- package/dist/cjs/Button-80d7b0e3.js.map +1 -0
- package/dist/cjs/CircleSpinner-6a1fdeca.js +2 -0
- package/dist/cjs/CircleSpinner-6a1fdeca.js.map +1 -0
- package/dist/cjs/FlippyCard-170be269.js +2 -0
- package/dist/cjs/FlippyCard-170be269.js.map +1 -0
- package/dist/cjs/MiniVCThumbnail-34cdca1a.js +2 -0
- package/dist/cjs/MiniVCThumbnail-34cdca1a.js.map +1 -0
- package/dist/cjs/VCCard-17cc4658.js +2 -0
- package/dist/cjs/VCCard-17cc4658.js.map +1 -0
- package/dist/cjs/VCDisplayBackFace-ce7a3a45.js +2 -0
- package/dist/cjs/VCDisplayBackFace-ce7a3a45.js.map +1 -0
- package/dist/cjs/VCDisplayCard-bda4ce7a.js +2 -0
- package/dist/cjs/VCDisplayCard-bda4ce7a.js.map +1 -0
- package/dist/cjs/VCThumbnail-f96c7ff5.js +2 -0
- package/dist/cjs/VCThumbnail-f96c7ff5.js.map +1 -0
- package/dist/cjs/VCVerificationCheck-60e83f47.js +2 -0
- package/dist/cjs/VCVerificationCheck-60e83f47.js.map +1 -0
- package/dist/cjs/VCVerificationPill-8dbd32a5.js +2 -0
- package/dist/cjs/VCVerificationPill-8dbd32a5.js.map +1 -0
- package/dist/cjs/icon.green.fat-arrow-a5f4951d.js +2 -0
- package/dist/cjs/icon.green.fat-arrow-a5f4951d.js.map +1 -0
- package/dist/cjs/index.js +1 -80
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index10.js +2 -0
- package/dist/cjs/index10.js.map +1 -0
- package/dist/cjs/index11.js +2 -0
- package/dist/cjs/index11.js.map +1 -0
- package/dist/cjs/index12.js +2 -0
- package/dist/cjs/index12.js.map +1 -0
- package/dist/cjs/index13.js +2 -0
- package/dist/cjs/index13.js.map +1 -0
- package/dist/cjs/index2.js +2 -0
- package/dist/cjs/index2.js.map +1 -0
- package/dist/cjs/index3.js +2 -0
- package/dist/cjs/index3.js.map +1 -0
- package/dist/cjs/index4.js +2 -0
- package/dist/cjs/index4.js.map +1 -0
- package/dist/cjs/index5.js +2 -0
- package/dist/cjs/index5.js.map +1 -0
- package/dist/cjs/index6.js +2 -0
- package/dist/cjs/index6.js.map +1 -0
- package/dist/cjs/index7.js +2 -0
- package/dist/cjs/index7.js.map +1 -0
- package/dist/cjs/index8.js +2 -0
- package/dist/cjs/index8.js.map +1 -0
- package/dist/cjs/index9.js +2 -0
- package/dist/cjs/index9.js.map +1 -0
- package/dist/cjs/style-inject.es-f895d70b.js +2 -0
- package/dist/cjs/style-inject.es-f895d70b.js.map +1 -0
- package/dist/cjs/verified-check-f8df7905.js +2 -0
- package/dist/cjs/verified-check-f8df7905.js.map +1 -0
- package/dist/esm/Button-5d9744b7.js +2 -0
- package/dist/esm/Button-5d9744b7.js.map +1 -0
- package/dist/esm/CircleSpinner-1cb2498f.js +2 -0
- package/dist/esm/CircleSpinner-1cb2498f.js.map +1 -0
- package/dist/esm/FlippyCard-3f23b3da.js +2 -0
- package/dist/esm/FlippyCard-3f23b3da.js.map +1 -0
- package/dist/esm/MiniVCThumbnail-fd8dd5c0.js +2 -0
- package/dist/esm/MiniVCThumbnail-fd8dd5c0.js.map +1 -0
- package/dist/esm/VCCard-c8fff69f.js +81 -0
- package/dist/esm/VCCard-c8fff69f.js.map +1 -0
- package/dist/esm/VCDisplayBackFace-a5c11878.js +2 -0
- package/dist/esm/VCDisplayBackFace-a5c11878.js.map +1 -0
- package/dist/esm/VCDisplayCard-247a631b.js +2 -0
- package/dist/esm/VCDisplayCard-247a631b.js.map +1 -0
- package/dist/esm/VCThumbnail-e0aebea6.js +2 -0
- package/dist/esm/VCThumbnail-e0aebea6.js.map +1 -0
- package/dist/esm/VCVerificationCheck-53ab1ea9.js +2 -0
- package/dist/esm/VCVerificationCheck-53ab1ea9.js.map +1 -0
- package/dist/esm/VCVerificationPill-b54ce259.js +2 -0
- package/dist/esm/VCVerificationPill-b54ce259.js.map +1 -0
- package/dist/esm/icon.green.fat-arrow-0e380302.js +2 -0
- package/dist/esm/icon.green.fat-arrow-0e380302.js.map +1 -0
- package/dist/esm/index.js +1 -80
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index10.js +2 -0
- package/dist/esm/index10.js.map +1 -0
- package/dist/esm/index11.js +2 -0
- package/dist/esm/index11.js.map +1 -0
- package/dist/esm/index12.js +2 -0
- package/dist/esm/index12.js.map +1 -0
- package/dist/esm/index13.js +2 -0
- package/dist/esm/index13.js.map +1 -0
- package/dist/esm/index2.js +2 -0
- package/dist/esm/index2.js.map +1 -0
- package/dist/esm/index3.js +2 -0
- package/dist/esm/index3.js.map +1 -0
- package/dist/esm/index4.js +2 -0
- package/dist/esm/index4.js.map +1 -0
- package/dist/esm/index5.js +2 -0
- package/dist/esm/index5.js.map +1 -0
- package/dist/esm/index6.js +2 -0
- package/dist/esm/index6.js.map +1 -0
- package/dist/esm/index7.js +2 -0
- package/dist/esm/index7.js.map +1 -0
- package/dist/esm/index8.js +2 -0
- package/dist/esm/index8.js.map +1 -0
- package/dist/esm/index9.js +2 -0
- package/dist/esm/index9.js.map +1 -0
- package/dist/esm/style-inject.es-06d636d3.js +2 -0
- package/dist/esm/style-inject.es-06d636d3.js.map +1 -0
- package/dist/esm/verified-check-32de410b.js +2 -0
- package/dist/esm/verified-check-32de410b.js.map +1 -0
- package/package.json +6 -4
- package/dist/cjs/dist/styles.css +0 -1
- package/dist/cjs/index.css +0 -3
- package/dist/cjs/types/components/Button/Button.d.ts +0 -8
- package/dist/cjs/types/components/Button/index.d.ts +0 -4
- package/dist/cjs/types/components/FlippyCard/FlippyCard.d.ts +0 -7
- package/dist/cjs/types/components/FlippyCard/index.d.ts +0 -4
- package/dist/cjs/types/components/Loading/CircleSpinner.d.ts +0 -15
- package/dist/cjs/types/components/Loading/index.d.ts +0 -4
- package/dist/cjs/types/components/MiniVCThumbnail/MiniVCThumbnail.d.ts +0 -5
- package/dist/cjs/types/components/MiniVCThumbnail/index.d.ts +0 -5
- package/dist/cjs/types/components/MiniVCThumbnail/types.d.ts +0 -32
- package/dist/cjs/types/components/VCCard/VCCard.d.ts +0 -10
- package/dist/cjs/types/components/VCCard/index.d.ts +0 -4
- package/dist/cjs/types/components/VCDisplayBackFace/VCDisplayBackFace.d.ts +0 -4
- package/dist/cjs/types/components/VCDisplayBackFace/index.d.ts +0 -4
- package/dist/cjs/types/components/VCDisplayCard/VCDisplayCard.d.ts +0 -11
- package/dist/cjs/types/components/VCDisplayCard/index.d.ts +0 -4
- package/dist/cjs/types/components/VCDisplayFrontFace/VCDisplayFrontFace.d.ts +0 -4
- package/dist/cjs/types/components/VCDisplayFrontFace/index.d.ts +0 -4
- package/dist/cjs/types/components/VCThumbnail/VCThumbnail.d.ts +0 -5
- package/dist/cjs/types/components/VCThumbnail/index.d.ts +0 -5
- package/dist/cjs/types/components/VCThumbnail/types.d.ts +0 -43
- package/dist/cjs/types/components/VCVerificationCheck/VCVerificationCheck.d.ts +0 -8
- package/dist/cjs/types/components/VCVerificationCheck/index.d.ts +0 -4
- package/dist/cjs/types/components/VCVerificationPill/VCVerificationPill.d.ts +0 -13
- package/dist/cjs/types/components/VCVerificationPill/index.d.ts +0 -4
- package/dist/cjs/types/components/index.d.ts +0 -14
- package/dist/cjs/types/index.d.ts +0 -3
- package/dist/cjs/types/types/index.d.ts +0 -20
- package/dist/esm/dist/styles.css +0 -1
- package/dist/esm/index.css +0 -3
- package/dist/esm/types/components/Button/Button.d.ts +0 -8
- package/dist/esm/types/components/Button/index.d.ts +0 -4
- package/dist/esm/types/components/FlippyCard/FlippyCard.d.ts +0 -7
- package/dist/esm/types/components/FlippyCard/index.d.ts +0 -4
- package/dist/esm/types/components/Loading/CircleSpinner.d.ts +0 -15
- package/dist/esm/types/components/Loading/index.d.ts +0 -4
- package/dist/esm/types/components/MiniVCThumbnail/MiniVCThumbnail.d.ts +0 -5
- package/dist/esm/types/components/MiniVCThumbnail/index.d.ts +0 -5
- package/dist/esm/types/components/MiniVCThumbnail/types.d.ts +0 -32
- package/dist/esm/types/components/VCCard/VCCard.d.ts +0 -10
- package/dist/esm/types/components/VCCard/index.d.ts +0 -4
- package/dist/esm/types/components/VCDisplayBackFace/VCDisplayBackFace.d.ts +0 -4
- package/dist/esm/types/components/VCDisplayBackFace/index.d.ts +0 -4
- package/dist/esm/types/components/VCDisplayCard/VCDisplayCard.d.ts +0 -11
- package/dist/esm/types/components/VCDisplayCard/index.d.ts +0 -4
- package/dist/esm/types/components/VCDisplayFrontFace/VCDisplayFrontFace.d.ts +0 -4
- package/dist/esm/types/components/VCDisplayFrontFace/index.d.ts +0 -4
- package/dist/esm/types/components/VCThumbnail/VCThumbnail.d.ts +0 -5
- package/dist/esm/types/components/VCThumbnail/index.d.ts +0 -5
- package/dist/esm/types/components/VCThumbnail/types.d.ts +0 -43
- package/dist/esm/types/components/VCVerificationCheck/VCVerificationCheck.d.ts +0 -8
- package/dist/esm/types/components/VCVerificationCheck/index.d.ts +0 -4
- package/dist/esm/types/components/VCVerificationPill/VCVerificationPill.d.ts +0 -13
- package/dist/esm/types/components/VCVerificationPill/index.d.ts +0 -4
- package/dist/esm/types/components/index.d.ts +0 -14
- package/dist/esm/types/index.d.ts +0 -3
- package/dist/esm/types/types/index.d.ts +0 -20
package/dist/cjs/index.js
CHANGED
|
@@ -1,81 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("crypto"),r=require("process");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function i(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var o=n(e),s=n(t),a=i(t),c=i(r);function u(e,t){void 0===t&&(t={});var r=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.type="text/css","top"===r&&n.firstChild?n.insertBefore(i,n.firstChild):n.appendChild(i),i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e))}}u('/*! tailwindcss v3.0.24 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}html{-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-size:100%;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]{display:none}*,:after,:before{--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.static{position:static}.absolute{position:absolute}.relative{position:relative}.bottom-1{bottom:.25rem}.right-1{right:.25rem}.top-0{top:0}.left-1{left:.25rem}.top-1{top:.25rem}.left-0{left:0}.right-2{right:.5rem}.bottom-5{bottom:1.25rem}.z-10{z-index:10}.my-0{margin-bottom:0;margin-top:0}.mx-1{margin-left:.25rem;margin-right:.25rem}.my-2{margin-bottom:.5rem;margin-top:.5rem}.my-3{margin-bottom:.75rem;margin-top:.75rem}.mx-4{margin-left:1rem;margin-right:1rem}.my-3\\.5{margin-bottom:.875rem;margin-top:.875rem}.mb-3{margin-bottom:.75rem}.ml-2{margin-left:.5rem}.mt-3{margin-top:.75rem}.-mt-3{margin-top:-.75rem}.mt-2{margin-top:.5rem}.mt-7{margin-top:1.75rem}.mt-8{margin-top:2rem}.mt-\\[20px\\]{margin-top:20px}.ml-1{margin-left:.25rem}.mt-4{margin-top:1rem}.ml-3{margin-left:.75rem}.mr-3{margin-right:.75rem}.inline-block{display:inline-block}.flex{display:flex}.h-full{height:100%}.h-10{height:2.5rem}.h-5\\/6{height:83.333333%}.h-\\[100\\%\\]{height:100%}.h-\\[55\\%\\]{height:55%}.h-8{height:2rem}.h-\\[77\\%\\]{height:77%}.h-16{height:4rem}.h-4\\/6{height:66.666667%}.h-0{height:0}.h-\\[30px\\]{height:30px}.max-h-\\[48px\\]{max-height:48px}.max-h-\\[80px\\]{max-height:80px}.max-h-\\[1100px\\]{max-height:1100px}.max-h-\\[150px\\]{max-height:150px}.max-h-\\[600px\\]{max-height:600px}.max-h-\\[100px\\]{max-height:100px}.min-h-\\[120px\\]{min-height:120px}.min-h-\\[40px\\]{min-height:40px}.min-h-\\[600px\\]{min-height:600px}.min-h-\\[400px\\]{min-height:400px}.w-full{width:100%}.w-3\\/4{width:75%}.w-1\\/4{width:25%}.w-10{width:2.5rem}.w-10\\/12{width:83.333333%}.w-\\[110\\%\\]{width:110%}.w-8{width:2rem}.w-\\[100\\%\\]{width:100%}.w-16{width:4rem}.w-4\\/6{width:66.666667%}.w-\\[30px\\]{width:30px}.min-w-\\[40px\\]{min-width:40px}.max-w-sm{max-width:24rem}.max-w-\\[48px\\]{max-width:48px}.max-w-\\[80px\\]{max-width:80px}.max-w-\\[400px\\]{max-width:400px}.max-w-\\[100px\\]{max-width:100px}.flex-1{flex:1 1 0%}.translate-x-\\[10px\\]{--tw-translate-x:10px}.scale-x-\\[-1\\],.translate-x-\\[10px\\]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-x-\\[-1\\]{--tw-scale-x:-1}.cursor-alias{cursor:alias}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.overflow-hidden{overflow:hidden}.rounded{border-radius:.25rem}.rounded-3xl{border-radius:1.5rem}.rounded-full{border-radius:9999px}.rounded-\\[50\\%\\]{border-radius:50%}.rounded-\\[22px\\]{border-radius:22px}.rounded-bl-\\[50\\%\\]{border-bottom-left-radius:50%}.rounded-br-\\[50\\%\\]{border-bottom-right-radius:50%}.border{border-width:1px}.border-4{border-width:4px}.border-2{border-width:2px}.border-solid{border-style:solid}.border-black{--tw-border-opacity:1;border-color:rgb(0 0 0/var(--tw-border-opacity))}.border-emerald-700{--tw-border-opacity:1;border-color:rgb(0 186 136/var(--tw-border-opacity))}.border-indigo-300{--tw-border-opacity:1;border-color:rgb(165 180 252/var(--tw-border-opacity))}.border-white{--tw-border-opacity:1;border-color:rgb(255 255 255/var(--tw-border-opacity))}.bg-emerald-700{--tw-bg-opacity:1;background-color:rgb(0 186 136/var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.bg-emerald-500{--tw-bg-opacity:1;background-color:rgb(64 203 166/var(--tw-bg-opacity))}.bg-yellow-400{--tw-bg-opacity:1;background-color:rgb(250 204 21/var(--tw-bg-opacity))}.bg-rose-600{--tw-bg-opacity:1;background-color:rgb(225 29 72/var(--tw-bg-opacity))}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-4{padding:1rem}.p-1{padding:.25rem}.p-7{padding:1.75rem}.p-2{padding:.5rem}.py-3{padding-bottom:.75rem;padding-top:.75rem}.px-3{padding-left:.75rem;padding-right:.75rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.px-4{padding-left:1rem;padding-right:1rem}.py-4{padding-bottom:1rem;padding-top:1rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-0{padding-left:0;padding-right:0}.px-5{padding-left:1.25rem;padding-right:1.25rem}.pb-25pct{padding-bottom:25%}.pt-25pct{padding-top:25%}.pb-0{padding-bottom:0}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.text-sm{font-size:.875rem;line-height:1.25rem}.text-2xl{font-size:1.5rem;line-height:2rem}.text-xs{font-size:.75rem;line-height:1rem}.text-base{font-size:1rem;line-height:1.5rem}.text-\\[10px\\]{font-size:10px}.text-\\[12px\\]{font-size:12px}.font-light{font-weight:300}.font-bold{font-weight:700}.font-semibold{font-weight:600}.font-normal{font-weight:400}.uppercase{text-transform:uppercase}.leading-snug{line-height:1.375}.leading-tight{line-height:1.25}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity))}.text-emerald-700{--tw-text-opacity:1;color:rgb(0 186 136/var(--tw-text-opacity))}.text-grayscale-900{--tw-text-opacity:1;color:rgb(24 34 78/var(--tw-text-opacity))}.text-grayscale-600{--tw-text-opacity:1;color:rgb(111 117 144/var(--tw-text-opacity))}.text-indigo-500{--tw-text-opacity:1;color:rgb(99 102 241/var(--tw-text-opacity))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.text-yellow-400{--tw-text-opacity:1;color:rgb(250 204 21/var(--tw-text-opacity))}.text-rose-600{--tw-text-opacity:1;color:rgb(225 29 72/var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity))}.subpixel-antialiased{-webkit-font-smoothing:auto;-moz-osx-font-smoothing:auto}.shadow-3xl{--tw-shadow:0px 0px 8px rgba(0,0,0,.25);--tw-shadow-colored:0px 0px 8px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.line-clamp-2{-webkit-line-clamp:2}.line-clamp-1,.line-clamp-2{-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.line-clamp-1{-webkit-line-clamp:1}.line-clamp-4{-webkit-box-orient:vertical;-webkit-line-clamp:4;display:-webkit-box;overflow:hidden}@media (min-width:640px){.sm\\:ml-0{margin-left:0}}@media (min-width:768px){.md\\:ml-0{margin-left:0}}@media (min-width:1024px){.lg\\:ml-0{margin-left:0}}@media (max-width:240px){.xxsm\\:bottom-3{bottom:.75rem}.xxsm\\:mt-1{margin-top:.25rem}.xxsm\\:h-\\[60px\\]{height:60px}.xxsm\\:w-\\[60px\\]{width:60px}.xxsm\\:py-1{padding-bottom:.25rem;padding-top:.25rem}}@media (max-width:200px){.xxxsm\\:bottom-3{bottom:.75rem}.xxxsm\\:mt-0{margin-top:0}}',{insertAt:"top"});u(".flippy-wrapper-container{perspective:2600px}.flippy-card{height:100%;max-height:1000px;max-width:400px;position:relative;transform-style:preserve-3d;-webkit-transform-style:preserve-3d;transition:transform 1s;width:100%}.flippy-card.is-flipped{transform:rotateY(180deg)}.card-face{backface-visibility:hidden;-webkit-backface-visibility:hidden;height:100%;transform-style:preserve-3d;-webkit-transform-style:preserve-3d;width:100%}.card-face,.card-face--front{position:absolute}.card-face--back{position:relative;transform:rotateY(180deg)}",{insertAt:"top"});const l=({children:t})=>{const[r,n]=e.useState("front");if((null==t?void 0:t.length)>3&&console.warn("More than two children passed into Flippy Card! 😳😳😳 Picking first two..."),!t)return o.default.createElement(o.default.Fragment,null);const i=null==t?void 0:t[0],s=(null==t?void 0:t[1])||(null==t?void 0:t[0]),a="front"===r?"flippy-card":"flippy-card is-flipped";return o.default.createElement("div",{className:"flippy-wrapper-container"},o.default.createElement("div",{className:a,onClick:()=>{"front"===r&&n("back"),"back"===r&&n("front")}},o.default.createElement("section",{className:"card-face card-face--front"},i),o.default.createElement("section",{className:"card-face card-face--back"},s)))};var d;u(".lds-ring{display:inline-block;height:100%;position:relative;width:100%}.lds-ring div{-webkit-animation:lds-ring 1.2s cubic-bezier(.5,0,.5,1) infinite;animation:lds-ring 1.2s cubic-bezier(.5,0,.5,1) infinite;border:4px solid transparent;border-radius:50%;border-top-color:#40cba6;box-sizing:border-box;display:block;height:54px;margin:3px;position:absolute;width:54px}.lds-ring.static div{-webkit-animation:none;animation:none;border-color:#40cba6}.lds-ring div:first-child{-webkit-animation-delay:-.45s;animation-delay:-.45s}.lds-ring div:nth-child(2){-webkit-animation-delay:-.3s;animation-delay:-.3s}.lds-ring div:nth-child(3){-webkit-animation-delay:-.15s;animation-delay:-.15s}@-webkit-keyframes lds-ring{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes lds-ring{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}",{insertAt:"top"}),exports.CircleLoadingState=void 0,(d=exports.CircleLoadingState||(exports.CircleLoadingState={}))[d.spin=0]="spin",d[d.stop=1]="stop";const f=({size:e=60,thickness:t=4,color:r="#40CBA6",marginOffset:n=3,loadingState:i=exports.CircleLoadingState.stop})=>{const s=i===exports.CircleLoadingState.spin?"lds-ring":"lds-ring static",a={width:`${e}px`,height:`${e}px`},c={height:`${Math.floor(e/1.1111111)}px`,width:`${Math.floor(e/1.11111111)}px`,border:`${t}px solid #fff`,margin:`${n}px`,borderColor:`${r}${i===exports.CircleLoadingState.spin?" transparent transparent transparent":""}`};return o.default.createElement("div",{className:s,style:a},o.default.createElement("div",{style:c}),o.default.createElement("div",{style:c}),o.default.createElement("div",{style:c}),o.default.createElement("div",{style:c}))};var h="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABUAAAAVCAYAAACpF6WWAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAK9SURBVHgBlVRPTxNBFH9vdhURDO3Jo0ti4tE2xsRjuYCeXO8mLJ+gWxMVTh1iCEVIWvwCQPwAlIMxYoKN8aqsiTHGy9ZP4EKotNKd8c0ubXf7j/q7zM6beb/5vTe/HYARIX/NZUV17sOZez9z0V4dRoSQUFIjgjyioTIyaebwt8GEVgSGzkH62nLfDIQpuAAsNiFCiWBKKTkdkIBR8L6Qh/2X2b6kSiURpjoLejaeLb0ewndrJkjg1JwSHKw/bOcqspkvxy5KzaW50aYgtRSXmc9HdjiHBQlQFlLkOqzCbH82m8nWpw6CWdQnAwYAEeZpKOnT+2Uay2HJa0U6xYyKiKLn9iVIBwG9c3UeCLEZ2/BmJUULNgxBjJR6Wqqkp3KwyxPwiPf28O2qATqbV6dFoPY54Hdsxs6DIZr+XpA4ecWF/YIbkLegStbQjamUUIVafRpmF2f4j0WPr54aAWnlzlRJor9AKq3K3WSFjrFosyIzYGLMjNRh9SiXYq9VETYbh3gJ3fx63dZl0U7Ap2VlJQ97spA8uEoDu00KE10ll6lfwV/Gi+RpPxCiLtZA+cq2SN1WyAFpvHndpJU8DIYHvkzDg6VqNMg3auRZloImbOugUZMFhBvOlALmqGYNgdMiXN6oZ8nPoT9VCjKHL41VsW+a+lOUsRHn2zEpHUBtG2p/dlQflTIEbbc7VWpjyZiljjOPTZRsC1e+bU9+fG2RA25QOBMsorYAs8+cTjajQ7sZocpz6MXNL5hJjU6QQvv0nrU5Luh2GcsE1pkLCV9QyQLQIoZUlIwclIPa1YqaDnxP/ct+9qTwc2fy+a1pqDcC26hbFr56V7t6rqHNn0zstaZsEKlSSz48PCl8z7e8yHNJjy5mJ14xOrIhvkZjI7z8mIrO+NNxiwZrWEaM1GeMoxAeQ9l+3f+itgn/iX9nBCa6b/pUWQAAAABJRU5ErkJggg==";u('.mini-vc-thumbnail-container{max-width:250px}.mini-vc-thumbnail-container:after{background-color:#fff;border-bottom-left-radius:120px;border-bottom-right-radius:120px;border-top-left-radius:24px;border-top-right-radius:24px;content:"";height:65%;left:0;position:absolute;top:0;width:100%;z-index:1}',{insertAt:"top"});function p(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))}var m,g=Object.create,b=Object.defineProperty,y=Object.defineProperties,v=Object.getOwnPropertyDescriptor,w=Object.getOwnPropertyDescriptors,A=Object.getOwnPropertyNames,E=Object.getOwnPropertySymbols,S=Object.getPrototypeOf,x=Object.prototype.hasOwnProperty,M=Object.prototype.propertyIsEnumerable,_=Reflect.get,k=Math.pow,T=(e,t,r)=>t in e?b(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,C=(e,t)=>{for(var r in t||(t={}))x.call(t,r)&&T(e,r,t[r]);if(E)for(var r of E(t))M.call(t,r)&&T(e,r,t[r]);return e},N=(e,t)=>y(e,w(t)),I=(e,t)=>b(e,"name",{value:t,configurable:!0}),B=(e=>"undefined"!=typeof require?require:"undefined"!=typeof Proxy?new Proxy(e,{get:(e,t)=>("undefined"!=typeof require?require:e)[t]}):e)((function(e){if("undefined"!=typeof require)return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')})),O=(e,t)=>{var r={};for(var n in e)x.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&E)for(var n of E(e))t.indexOf(n)<0&&M.call(e,n)&&(r[n]=e[n]);return r},D=(e,t)=>function(){return e&&(t=(0,e[A(e)[0]])(e=0)),t},j=(e,t)=>function(){return t||(0,e[A(e)[0]])((t={exports:{}}).exports,t),t.exports},L=(e,t)=>{for(var r in t)b(e,r,{get:t[r],enumerable:!0})},P=(e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of A(t))x.call(e,i)||i===r||b(e,i,{get:()=>t[i],enumerable:!(n=v(t,i))||n.enumerable});return e},R=(e,t,r)=>(r=null!=e?g(S(e)):{},P(!t&&e&&e.__esModule?r:b(r,"default",{value:e,enumerable:!0}),e)),U=(e,t,r)=>_(S(e),r,t),z=(e,t,r)=>new Promise(((n,i)=>{var o=e=>{try{a(r.next(e))}catch(e){i(e)}},s=e=>{try{a(r.throw(e))}catch(e){i(e)}},a=e=>e.done?n(e.value):Promise.resolve(e.value).then(o,s);a((r=r.apply(e,t)).next())})),K=j({"../../node_modules/.pnpm/pvtsutils@1.3.2/node_modules/pvtsutils/build/index.js"(e){Object.defineProperty(e,"__esModule",{value:!0});var t=class{static isArrayBuffer(e){return"[object ArrayBuffer]"===Object.prototype.toString.call(e)}static toArrayBuffer(e){return this.isArrayBuffer(e)?e:e.byteLength===e.buffer.byteLength?e.buffer:this.toUint8Array(e).slice().buffer}static toUint8Array(e){return this.toView(e,Uint8Array)}static toView(e,t){if(e.constructor===t)return e;if(this.isArrayBuffer(e))return new t(e);if(this.isArrayBufferView(e))return new t(e.buffer,e.byteOffset,e.byteLength);throw new TypeError("The provided value is not of type '(ArrayBuffer or ArrayBufferView)'")}static isBufferSource(e){return this.isArrayBufferView(e)||this.isArrayBuffer(e)}static isArrayBufferView(e){return ArrayBuffer.isView(e)||e&&this.isArrayBuffer(e.buffer)}static isEqual(e,r){const n=t.toUint8Array(e),i=t.toUint8Array(r);if(n.length!==i.byteLength)return!1;for(let e=0;e<n.length;e++)if(n[e]!==i[e])return!1;return!0}static concat(...e){if(Array.isArray(e[0])){const t=e[0];let r=0;for(const e of t)r+=e.byteLength;const n=new Uint8Array(r);let i=0;for(const e of t){const t=this.toUint8Array(e);n.set(t,i),i+=t.length}return e[1]?this.toView(n,e[1]):n.buffer}return this.concat(e)}};I(t,"BufferSourceConverter");var r=class{static fromString(e){const t=unescape(encodeURIComponent(e)),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r.buffer}static toString(e){const r=t.toUint8Array(e);let n="";for(let e=0;e<r.length;e++)n+=String.fromCharCode(r[e]);return decodeURIComponent(escape(n))}};I(r,"Utf8Converter");var n=class{static toString(e,r=!1){const n=t.toArrayBuffer(e),i=new DataView(n);let o="";for(let e=0;e<n.byteLength;e+=2){const t=i.getUint16(e,r);o+=String.fromCharCode(t)}return o}static fromString(e,t=!1){const r=new ArrayBuffer(2*e.length),n=new DataView(r);for(let r=0;r<e.length;r++)n.setUint16(2*r,e.charCodeAt(r),t);return r}};I(n,"Utf16Converter");var i=class{static isHex(e){return"string"==typeof e&&/^[a-z0-9]+$/i.test(e)}static isBase64(e){return"string"==typeof e&&/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}static isBase64Url(e){return"string"==typeof e&&/^[a-zA-Z0-9-_]+$/i.test(e)}static ToString(e,r="utf8"){const i=t.toUint8Array(e);switch(r.toLowerCase()){case"utf8":return this.ToUtf8String(i);case"binary":return this.ToBinary(i);case"hex":return this.ToHex(i);case"base64":return this.ToBase64(i);case"base64url":return this.ToBase64Url(i);case"utf16le":return n.toString(i,!0);case"utf16":case"utf16be":return n.toString(i);default:throw new Error(`Unknown type of encoding '${r}'`)}}static FromString(e,t="utf8"){if(!e)return new ArrayBuffer(0);switch(t.toLowerCase()){case"utf8":return this.FromUtf8String(e);case"binary":return this.FromBinary(e);case"hex":return this.FromHex(e);case"base64":return this.FromBase64(e);case"base64url":return this.FromBase64Url(e);case"utf16le":return n.fromString(e,!0);case"utf16":case"utf16be":return n.fromString(e);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToBase64(e){const r=t.toUint8Array(e);if("undefined"!=typeof btoa){const e=this.ToString(r,"binary");return btoa(e)}return Buffer.from(r).toString("base64")}static FromBase64(e){const t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!i.isBase64(t))throw new TypeError("Argument 'base64Text' is not Base64 encoded");return"undefined"!=typeof atob?this.FromBinary(atob(t)):new Uint8Array(Buffer.from(t,"base64")).buffer}static FromBase64Url(e){const t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!i.isBase64Url(t))throw new TypeError("Argument 'base64url' is not Base64Url encoded");return this.FromBase64(this.Base64Padding(t.replace(/\-/g,"+").replace(/\_/g,"/")))}static ToBase64Url(e){return this.ToBase64(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}static FromUtf8String(e,t=i.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.FromBinary(e);case"utf8":return r.fromString(e);case"utf16":case"utf16be":return n.fromString(e);case"utf16le":case"usc2":return n.fromString(e,!0);default:throw new Error(`Unknown type of encoding '${t}'`)}}static ToUtf8String(e,t=i.DEFAULT_UTF8_ENCODING){switch(t){case"ascii":return this.ToBinary(e);case"utf8":return r.toString(e);case"utf16":case"utf16be":return n.toString(e);case"utf16le":case"usc2":return n.toString(e,!0);default:throw new Error(`Unknown type of encoding '${t}'`)}}static FromBinary(e){const t=e.length,r=new Uint8Array(t);for(let n=0;n<t;n++)r[n]=e.charCodeAt(n);return r.buffer}static ToBinary(e){const r=t.toUint8Array(e);let n="";for(let e=0;e<r.length;e++)n+=String.fromCharCode(r[e]);return n}static ToHex(e){const r=t.toUint8Array(e),n=[],i=r.length;for(let e=0;e<i;e++){const t=r[e].toString(16).padStart(2,"0");n.push(t)}return n.join("")}static FromHex(e){let t=this.formatString(e);if(!t)return new ArrayBuffer(0);if(!i.isHex(t))throw new TypeError("Argument 'hexString' is not HEX encoded");t.length%2&&(t=`0${t}`);const r=new Uint8Array(t.length/2);for(let e=0;e<t.length;e+=2){const n=t.slice(e,e+2);r[e/2]=parseInt(n,16)}return r.buffer}static ToUtf16String(e,t=!1){return n.toString(e,t)}static FromUtf16String(e,t=!1){return n.fromString(e,t)}static Base64Padding(e){const t=4-e.length%4;if(t<4)for(let r=0;r<t;r++)e+="=";return e}static formatString(e){return(null==e?void 0:e.replace(/[\n\r\t ]/g,""))||""}};function o(e,...t){const r=arguments[0];for(let e=1;e<arguments.length;e++){const t=arguments[e];for(const e in t)r[e]=t[e]}return r}function s(...e){const t=e.map((e=>e.byteLength)).reduce(((e,t)=>e+t)),r=new Uint8Array(t);let n=0;return e.map((e=>new Uint8Array(e))).forEach((e=>{for(const t of e)r[n++]=t})),r.buffer}function a(e,t){if(!e||!t)return!1;if(e.byteLength!==t.byteLength)return!1;const r=new Uint8Array(e),n=new Uint8Array(t);for(let t=0;t<e.byteLength;t++)if(r[t]!==n[t])return!1;return!0}I(i,"Convert"),i.DEFAULT_UTF8_ENCODING="utf8",I(o,"assign"),I(s,"combine"),I(a,"isEqual"),e.BufferSourceConverter=t,e.Convert=i,e.assign=o,e.combine=s,e.isEqual=a}}),F=j({"../../node_modules/.pnpm/tslib@2.4.0/node_modules/tslib/tslib.js"(e,t){var r,n,i,o,s,a,c,u,l,d,f,h,p,m,g,b,y,v,w,A,E,S,x,M,_;!function(e){var r="object"==typeof global?global:"object"==typeof self?self:"object"==typeof this?this:{};function n(e,t){return e!==r&&("function"==typeof Object.create?Object.defineProperty(e,"__esModule",{value:!0}):e.__esModule=!0),function(r,n){return e[r]=t?t(r,n):n}}"function"==typeof define&&define.amd?define("tslib",["exports"],(function(t){e(n(r,n(t)))})):"object"==typeof t&&"object"==typeof t.exports?e(n(r,n(t.exports))):e(n(r)),I(n,"createExporter")}((function(e){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])};r=I((function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),I(n,"__"),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}),"__extends"),n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},i=I((function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}),"__rest"),o=I((function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s}),"__decorate"),s=I((function(e,t){return function(r,n){t(r,n,e)}}),"__param"),a=I((function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}),"__metadata"),c=I((function(e,t,r,n){function i(e){return e instanceof r?e:new r((function(t){t(e)}))}return I(i,"adopt"),new(r||(r=Promise))((function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?r(e.value):i(e.value).then(s,a)}I(s,"fulfilled"),I(a,"rejected"),I(c,"step"),c((n=n.apply(e,t||[])).next())}))}),"__awaiter"),u=I((function(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}),"__generator"),l=I((function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||_(t,e,r)}),"__exportStar"),_=Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]},d=I((function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}),"__values"),f=I((function(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}),"__read"),h=I((function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(f(arguments[t]));return e}),"__spread"),p=I((function(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;var n=Array(e),i=0;for(t=0;t<r;t++)for(var o=arguments[t],s=0,a=o.length;s<a;s++,i++)n[i]=o[s];return n}),"__spreadArrays"),m=I((function(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}),"__spreadArray"),g=I((function(e){return this instanceof g?(this.v=e,this):new g(e)}),"__await"),b=I((function(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,i=r.apply(e,t||[]),o=[];return n={},s("next"),s("throw"),s("return"),n[Symbol.asyncIterator]=function(){return this},n;function s(e){i[e]&&(n[e]=function(t){return new Promise((function(r,n){o.push([e,t,r,n])>1||a(e,t)}))})}function a(e,t){try{(r=i[e](t)).value instanceof g?Promise.resolve(r.value.v).then(c,u):l(o[0][2],r)}catch(e){l(o[0][3],e)}var r}function c(e){a("next",e)}function u(e){a("throw",e)}function l(e,t){e(t),o.shift(),o.length&&a(o[0][0],o[0][1])}}),"__asyncGenerator"),y=I((function(e){var t,r;return t={},n("next"),n("throw",(function(e){throw e})),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,i){t[n]=e[n]?function(t){return(r=!r)?{value:g(e[n](t)),done:"return"===n}:i?i(t):t}:i}}),"__asyncDelegator"),v=I((function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e="function"==typeof d?d(e):e[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,i){(function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)})(n,i,(t=e[r](t)).done,t.value)}))}}}),"__asyncValues"),w=I((function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}),"__makeTemplateObject");var k=Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t};A=I((function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&_(t,e,r);return k(t,e),t}),"__importStar"),E=I((function(e){return e&&e.__esModule?e:{default:e}}),"__importDefault"),S=I((function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)}),"__classPrivateFieldGet"),x=I((function(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r}),"__classPrivateFieldSet"),M=I((function(e,t){if(null===t||"object"!=typeof t&&"function"!=typeof t)throw new TypeError("Cannot use 'in' operator on non-object");return"function"==typeof e?t===e:e.has(t)}),"__classPrivateFieldIn"),e("__extends",r),e("__assign",n),e("__rest",i),e("__decorate",o),e("__param",s),e("__metadata",a),e("__awaiter",c),e("__generator",u),e("__exportStar",l),e("__createBinding",_),e("__values",d),e("__read",f),e("__spread",h),e("__spreadArrays",p),e("__spreadArray",m),e("__await",g),e("__asyncGenerator",b),e("__asyncDelegator",y),e("__asyncValues",v),e("__makeTemplateObject",w),e("__importStar",A),e("__importDefault",E),e("__classPrivateFieldGet",S),e("__classPrivateFieldSet",x),e("__classPrivateFieldIn",M)}))}});function H(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<e.length;i++){var o=e.charAt(i),s=o.charCodeAt(0);if(255!==r[s])throw new TypeError(o+" is ambiguous");r[s]=i}var a=e.length,c=e.charAt(0),u=Math.log(a)/Math.log(256),l=Math.log(256)/Math.log(a);function d(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,n=0,i=0,o=t.length;i!==o&&0===t[i];)i++,r++;for(var s=(o-i)*l+1>>>0,u=new Uint8Array(s);i!==o;){for(var d=t[i],f=0,h=s-1;(0!==d||f<n)&&-1!==h;h--,f++)d+=256*u[h]>>>0,u[h]=d%a>>>0,d=d/a>>>0;if(0!==d)throw new Error("Non-zero carry");n=f,i++}for(var p=s-n;p!==s&&0===u[p];)p++;for(var m=c.repeat(r);p<s;++p)m+=e.charAt(u[p]);return m}function f(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return new Uint8Array;var t=0;if(" "!==e[t]){for(var n=0,i=0;e[t]===c;)n++,t++;for(var o=(e.length-t)*u+1>>>0,s=new Uint8Array(o);e[t];){var l=r[e.charCodeAt(t)];if(255===l)return;for(var d=0,f=o-1;(0!==l||d<i)&&-1!==f;f--,d++)l+=a*s[f]>>>0,s[f]=l%256>>>0,l=l/256>>>0;if(0!==l)throw new Error("Non-zero carry");i=d,t++}if(" "!==e[t]){for(var h=o-i;h!==o&&0===s[h];)h++;for(var p=new Uint8Array(n+(o-h)),m=n;h!==o;)p[m++]=s[h++];return p}}}function h(e){var r=f(e);if(r)return r;throw new Error(`Non-${t} character`)}return I(d,"encode"),I(f,"decodeUnsafe"),I(h,"decode"),{encode:d,decodeUnsafe:f,decode:h}}var $,V,q,G,Y,J,Q,W,X=D({"../../node_modules/.pnpm/multiformats@9.6.4/node_modules/multiformats/esm/vendor/base-x.js"(){I(H,"base"),m=H}}),Z={};L(Z,{coerce:()=>Y,empty:()=>$,equals:()=>G,fromHex:()=>q,fromString:()=>Q,isBinary:()=>J,toHex:()=>V,toString:()=>W});var ee,te,re,ne,ie,oe,se,ae,ce,ue,le,de=D({"../../node_modules/.pnpm/multiformats@9.6.4/node_modules/multiformats/esm/src/bytes.js"(){$=new Uint8Array(0),V=I((e=>e.reduce(((e,t)=>e+t.toString(16).padStart(2,"0")),"")),"toHex"),q=I((e=>{const t=e.match(/../g);return t?new Uint8Array(t.map((e=>parseInt(e,16)))):$}),"fromHex"),G=I(((e,t)=>{if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0}),"equals"),Y=I((e=>{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")}),"coerce"),J=I((e=>e instanceof ArrayBuffer||ArrayBuffer.isView(e)),"isBinary"),Q=I((e=>(new TextEncoder).encode(e)),"fromString"),W=I((e=>(new TextDecoder).decode(e)),"toString")}}),fe=D({"../../node_modules/.pnpm/multiformats@9.6.4/node_modules/multiformats/esm/src/bases/base.js"(){X(),de(),I(ee=class{constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}},"Encoder"),I(te=class{constructor(e,t,r){this.name=e,this.prefix=t,this.baseDecode=r}decode(e){if("string"==typeof e){if(e[0]===this.prefix)return this.baseDecode(e.slice(1));throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`)}throw Error("Can only multibase decode strings")}or(e){return ne(this,e)}},"Decoder"),I(re=class{constructor(e){this.decoders=e}or(e){return ne(this,e)}decode(e){const t=e[0],r=this.decoders[t];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}},"ComposedDecoder"),ne=I(((e,t)=>new re(C(C({},e.decoders||{[e.prefix]:e}),t.decoders||{[t.prefix]:t}))),"or"),I(ie=class{constructor(e,t,r,n){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=n,this.encoder=new ee(e,t,r),this.decoder=new te(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}},"Codec"),oe=I((({name:e,prefix:t,encode:r,decode:n})=>new ie(e,t,r,n)),"from"),se=I((({prefix:e,name:t,alphabet:r})=>{const{encode:n,decode:i}=m(r,t);return oe({prefix:e,name:t,encode:n,decode:e=>Y(i(e))})}),"baseX"),ae=I(((e,t,r,n)=>{const i={};for(let e=0;e<t.length;++e)i[t[e]]=e;let o=e.length;for(;"="===e[o-1];)--o;const s=new Uint8Array(o*r/8|0);let a=0,c=0,u=0;for(let t=0;t<o;++t){const o=i[e[t]];if(void 0===o)throw new SyntaxError(`Non-${n} character`);c=c<<r|o,a+=r,a>=8&&(a-=8,s[u++]=255&c>>a)}if(a>=r||255&c<<8-a)throw new SyntaxError("Unexpected end of data");return s}),"decode"),ce=I(((e,t,r)=>{const n="="===t[t.length-1],i=(1<<r)-1;let o="",s=0,a=0;for(let n=0;n<e.length;++n)for(a=a<<8|e[n],s+=8;s>r;)s-=r,o+=t[i&a>>s];if(s&&(o+=t[i&a<<r-s]),n)for(;o.length*r&7;)o+="=";return o}),"encode"),ue=I((({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>oe({prefix:t,name:e,encode:e=>ce(e,n,r),decode:t=>ae(t,n,r,e)})),"rfc4648")}}),he={};L(he,{identity:()=>le});var pe,me=D({"../../node_modules/.pnpm/multiformats@9.6.4/node_modules/multiformats/esm/src/bases/identity.js"(){fe(),de(),le=oe({prefix:"\0",name:"identity",encode:e=>W(e),decode:e=>Q(e)})}}),ge={};L(ge,{base2:()=>pe});var be,ye=D({"../../node_modules/.pnpm/multiformats@9.6.4/node_modules/multiformats/esm/src/bases/base2.js"(){fe(),pe=ue({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1})}}),ve={};L(ve,{base8:()=>be});var we,Ae=D({"../../node_modules/.pnpm/multiformats@9.6.4/node_modules/multiformats/esm/src/bases/base8.js"(){fe(),be=ue({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3})}}),Ee={};L(Ee,{base10:()=>we});var Se,xe,Me=D({"../../node_modules/.pnpm/multiformats@9.6.4/node_modules/multiformats/esm/src/bases/base10.js"(){fe(),we=se({prefix:"9",name:"base10",alphabet:"0123456789"})}}),_e={};L(_e,{base16:()=>Se,base16upper:()=>xe});var ke,Te,Ce,Ne,Ie,Be,Oe,De,je,Le=D({"../../node_modules/.pnpm/multiformats@9.6.4/node_modules/multiformats/esm/src/bases/base16.js"(){fe(),Se=ue({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),xe=ue({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4})}}),Pe={};L(Pe,{base32:()=>ke,base32hex:()=>Ie,base32hexpad:()=>Oe,base32hexpadupper:()=>De,base32hexupper:()=>Be,base32pad:()=>Ce,base32padupper:()=>Ne,base32upper:()=>Te,base32z:()=>je});var Re,Ue,ze=D({"../../node_modules/.pnpm/multiformats@9.6.4/node_modules/multiformats/esm/src/bases/base32.js"(){fe(),ke=ue({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),Te=ue({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),Ce=ue({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),Ne=ue({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),Ie=ue({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Be=ue({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),Oe=ue({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),De=ue({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),je=ue({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5})}}),Ke={};L(Ke,{base36:()=>Re,base36upper:()=>Ue});var Fe,He,$e=D({"../../node_modules/.pnpm/multiformats@9.6.4/node_modules/multiformats/esm/src/bases/base36.js"(){fe(),Re=se({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),Ue=se({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"})}}),Ve={};L(Ve,{base58btc:()=>Fe,base58flickr:()=>He});var qe,Ge,Ye,Je,Qe=D({"../../node_modules/.pnpm/multiformats@9.6.4/node_modules/multiformats/esm/src/bases/base58.js"(){fe(),Fe=se({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),He=se({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"})}}),We={};L(We,{base64:()=>qe,base64pad:()=>Ge,base64url:()=>Ye,base64urlpad:()=>Je});var Xe,Ze,et,tt,rt,nt,it,ot,st,at,ct,ut,lt,dt,ft,ht,pt,mt=D({"../../node_modules/.pnpm/multiformats@9.6.4/node_modules/multiformats/esm/src/bases/base64.js"(){fe(),qe=ue({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Ge=ue({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Ye=ue({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Je=ue({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6})}});function gt(e,t,r){t=t||[];for(var n=r=r||0;e>=tt;)t[r++]=255&e|Ze,e/=128;for(;e&et;)t[r++]=255&e|Ze,e>>>=7;return t[r]=0|e,gt.bytes=r-n+1,t}function bt(e,t){var r,n=0,i=0,o=t=t||0,s=e.length;do{if(o>=s)throw bt.bytes=0,new RangeError("Could not decode varint");r=e[o++],n+=i<28?(r&it)<<i:(r&it)*Math.pow(2,i),i+=7}while(r>=nt);return bt.bytes=o-t,n}var yt,vt,wt,At=D({"../../node_modules/.pnpm/multiformats@9.6.4/node_modules/multiformats/esm/vendor/varint.js"(){Xe=gt,Ze=128,127,et=-128,tt=Math.pow(2,31),I(gt,"encode"),rt=bt,nt=128,it=127,I(bt,"read"),ot=Math.pow(2,7),st=Math.pow(2,14),at=Math.pow(2,21),ct=Math.pow(2,28),ut=Math.pow(2,35),lt=Math.pow(2,42),dt=Math.pow(2,49),ft=Math.pow(2,56),ht=Math.pow(2,63),pt={encode:Xe,decode:rt,encodingLength:I((function(e){return e<ot?1:e<st?2:e<at?3:e<ct?4:e<ut?5:e<lt?6:e<dt?7:e<ft?8:e<ht?9:10}),"length")}}}),Et={};L(Et,{decode:()=>yt,encodeTo:()=>vt,encodingLength:()=>wt});var St,xt,Mt,_t,kt=D({"../../node_modules/.pnpm/multiformats@9.6.4/node_modules/multiformats/esm/src/varint.js"(){At(),yt=I((e=>[pt.decode(e),pt.decode.bytes]),"decode"),vt=I(((e,t,r=0)=>(pt.encode(e,t,r),t)),"encodeTo"),wt=I((e=>pt.encodingLength(e)),"encodingLength")}}),Tt={};L(Tt,{Digest:()=>_t,create:()=>St,decode:()=>xt,equals:()=>Mt});var Ct,Nt,It=D({"../../node_modules/.pnpm/multiformats@9.6.4/node_modules/multiformats/esm/src/hashes/digest.js"(){de(),kt(),St=I(((e,t)=>{const r=t.byteLength,n=wt(e),i=n+wt(r),o=new Uint8Array(i+r);return vt(e,o,0),vt(r,o,n),o.set(t,i),new _t(e,r,t,o)}),"create"),xt=I((e=>{const t=Y(e),[r,n]=yt(t),[i,o]=yt(t.subarray(n)),s=t.subarray(n+o);if(s.byteLength!==i)throw new Error("Incorrect length");return new _t(r,i,s,t)}),"decode"),Mt=I(((e,t)=>e===t||e.code===t.code&&e.size===t.size&&G(e.bytes,t.bytes)),"equals"),I(_t=class{constructor(e,t,r,n){this.code=e,this.size=t,this.digest=r,this.bytes=n}},"Digest")}}),Bt={};L(Bt,{Hasher:()=>Nt,from:()=>Ct});var Ot,Dt,jt,Lt=D({"../../node_modules/.pnpm/multiformats@9.6.4/node_modules/multiformats/esm/src/hashes/hasher.js"(){It(),Ct=I((({name:e,code:t,encode:r})=>new Nt(e,t,r)),"from"),I(Nt=class{constructor(e,t,r){this.name=e,this.code=t,this.encode=r}digest(e){if(e instanceof Uint8Array){const t=this.encode(e);return t instanceof Uint8Array?St(this.code,t):t.then((e=>St(this.code,e)))}throw Error("Unknown type, must be binary type")}},"Hasher")}}),Pt={};L(Pt,{sha256:()=>Dt,sha512:()=>jt});var Rt,Ut,zt,Kt=D({"../../node_modules/.pnpm/multiformats@9.6.4/node_modules/multiformats/esm/src/hashes/sha2-browser.js"(){Lt(),Dt=Ct({name:"sha2-256",code:18,encode:(Ot=I((e=>t=>z(void 0,null,(function*(){return new Uint8Array(yield crypto.subtle.digest(e,t))}))),"sha"))("SHA-256")}),jt=Ct({name:"sha2-512",code:19,encode:Ot("SHA-512")})}}),Ft={};L(Ft,{identity:()=>zt});var Ht,$t,Vt,qt,Gt=D({"../../node_modules/.pnpm/multiformats@9.6.4/node_modules/multiformats/esm/src/hashes/identity.js"(){de(),It(),0,"identity",Rt=Y,Ut=I((e=>St(0,Rt(e))),"digest"),zt={code:0,name:"identity",encode:Rt,digest:Ut}}}),Yt={};L(Yt,{code:()=>$t,decode:()=>qt,encode:()=>Vt,name:()=>Ht});var Jt,Qt,Wt,Xt,Zt,er,tr=D({"../../node_modules/.pnpm/multiformats@9.6.4/node_modules/multiformats/esm/src/codecs/raw.js"(){de(),Ht="raw",$t=85,Vt=I((e=>Y(e)),"encode"),qt=I((e=>Y(e)),"decode")}}),rr={};L(rr,{code:()=>Xt,decode:()=>er,encode:()=>Zt,name:()=>Wt});var nr,ir,or,sr,ar,cr,ur,lr,dr,fr,hr,pr,mr,gr,br,yr=D({"../../node_modules/.pnpm/multiformats@9.6.4/node_modules/multiformats/esm/src/codecs/json.js"(){Jt=new TextEncoder,Qt=new TextDecoder,Wt="json",Xt=512,Zt=I((e=>Jt.encode(JSON.stringify(e))),"encode"),er=I((e=>JSON.parse(Qt.decode(e))),"decode")}}),vr=D({"../../node_modules/.pnpm/multiformats@9.6.4/node_modules/multiformats/esm/src/cid.js"(){kt(),It(),Qe(),ze(),de(),nr=class{constructor(e,t,r,n){this.code=t,this.version=e,this.multihash=r,this.bytes=n,this.byteOffset=n.byteOffset,this.byteLength=n.byteLength,this.asCID=this,this._baseCache=new Map,Object.defineProperties(this,{byteOffset:fr,byteLength:fr,code:dr,version:dr,multihash:dr,bytes:dr,_baseCache:fr,asCID:fr})}toV0(){if(0===this.version)return this;{const{code:e,multihash:t}=this;if(e!==ar)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==cr)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return nr.createV0(t)}}toV1(){switch(this.version){case 0:{const{code:e,digest:t}=this.multihash,r=St(e,t);return nr.createV1(this.code,r)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}equals(e){return e&&this.code===e.code&&this.version===e.version&&Mt(this.multihash,e.multihash)}toString(e){const{bytes:t,version:r,_baseCache:n}=this;return 0===r?or(t,n,e||Fe.encoder):sr(t,n,e||ke.encoder)}toJSON(){return{code:this.code,version:this.version,hash:this.multihash.bytes}}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return"CID("+this.toString()+")"}static isCID(e){return hr(/^0\.0/,pr),!(!e||!e[lr]&&e.asCID!==e)}get toBaseEncodedString(){throw new Error("Deprecated, use .toString()")}get codec(){throw new Error('"codec" property is deprecated, use integer "code" property instead')}get buffer(){throw new Error("Deprecated .buffer property, use .bytes to get Uint8Array instead")}get multibaseName(){throw new Error('"multibaseName" property is deprecated')}get prefix(){throw new Error('"prefix" property is deprecated')}static asCID(e){if(e instanceof nr)return e;if(null!=e&&e.asCID===e){const{version:t,code:r,multihash:n,bytes:i}=e;return new nr(t,r,n,i||ur(t,r,n.bytes))}if(null!=e&&!0===e[lr]){const{version:t,multihash:r,code:n}=e,i=xt(r);return nr.create(t,n,i)}return null}static create(e,t,r){if("number"!=typeof t)throw new Error("String codecs are no longer supported");switch(e){case 0:if(t!==ar)throw new Error(`Version 0 CID must use dag-pb (code: ${ar}) block encoding`);return new nr(e,t,r,r.bytes);case 1:{const n=ur(e,t,r.bytes);return new nr(e,t,r,n)}default:throw new Error("Invalid version")}}static createV0(e){return nr.create(0,ar,e)}static createV1(e,t){return nr.create(1,e,t)}static decode(e){const[t,r]=nr.decodeFirst(e);if(r.length)throw new Error("Incorrect length");return t}static decodeFirst(e){const t=nr.inspectBytes(e),r=t.size-t.multihashSize,n=Y(e.subarray(r,r+t.multihashSize));if(n.byteLength!==t.multihashSize)throw new Error("Incorrect length");const i=n.subarray(t.multihashSize-t.digestSize),o=new _t(t.multihashCode,t.digestSize,i,n);return[0===t.version?nr.createV0(o):nr.createV1(t.codec,o),e.subarray(t.size)]}static inspectBytes(e){let t=0;const r=I((()=>{const[r,n]=yt(e.subarray(t));return t+=n,r}),"next");let n=r(),i=ar;if(18===n?(n=0,t=0):1===n&&(i=r()),0!==n&&1!==n)throw new RangeError(`Invalid CID version ${n}`);const o=t,s=r(),a=r(),c=t+a;return{version:n,codec:i,multihashCode:s,digestSize:a,multihashSize:c-o,size:c}}static parse(e,t){const[r,n]=ir(e,t),i=nr.decode(n);return i._baseCache.set(r,e),i}},I(nr,"CID"),ir=I(((e,t)=>{switch(e[0]){case"Q":{const r=t||Fe;return[Fe.prefix,r.decode(`${Fe.prefix}${e}`)]}case Fe.prefix:{const r=t||Fe;return[Fe.prefix,r.decode(e)]}case ke.prefix:{const r=t||ke;return[ke.prefix,r.decode(e)]}default:if(null==t)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[e[0],t.decode(e)]}}),"parseCIDtoBytes"),or=I(((e,t,r)=>{const{prefix:n}=r;if(n!==Fe.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);const i=t.get(n);if(null==i){const i=r.encode(e).slice(1);return t.set(n,i),i}return i}),"toStringV0"),sr=I(((e,t,r)=>{const{prefix:n}=r,i=t.get(n);if(null==i){const i=r.encode(e);return t.set(n,i),i}return i}),"toStringV1"),ar=112,cr=18,ur=I(((e,t,r)=>{const n=wt(e),i=n+wt(t),o=new Uint8Array(i+r.byteLength);return vt(e,o,0),vt(t,o,n),o.set(r,i),o}),"encodeCID"),lr=Symbol.for("@ipld/js-cid/CID"),dr={writable:!1,configurable:!1,enumerable:!0},fr={writable:!1,enumerable:!1,configurable:!1},"0.0.0-dev",hr=I(((e,t)=>{if(!e.test("0.0.0-dev"))throw new Error(t);console.warn(t)}),"deprecate"),pr="CID.isCID(v) is deprecated and will be removed in the next major release.\nFollowing code pattern:\n\nif (CID.isCID(value)) {\n doSomethingWithCID(value)\n}\n\nIs replaced with:\n\nconst cid = CID.asCID(value)\nif (cid) {\n // Make sure to use cid instead of value\n doSomethingWithCID(cid)\n}\n"}}),wr=D({"../../node_modules/.pnpm/multiformats@9.6.4/node_modules/multiformats/esm/src/index.js"(){vr(),kt(),de(),Lt(),It()}}),Ar={};L(Ar,{CID:()=>nr,bases:()=>mr,bytes:()=>Z,codecs:()=>br,digest:()=>Tt,hasher:()=>Bt,hashes:()=>gr,varint:()=>Et});var Er,Sr=D({"../../node_modules/.pnpm/multiformats@9.6.4/node_modules/multiformats/esm/src/basics.js"(){me(),ye(),Ae(),Me(),Le(),ze(),$e(),Qe(),mt(),Kt(),Gt(),tr(),yr(),wr(),mr=C(C(C(C(C(C(C(C(C({},he),ge),ve),Ee),_e),Pe),Ke),Ve),We),gr=C(C({},Pt),Ft),br={raw:Yt,json:rr}}}),xr=j({"../../node_modules/.pnpm/@stablelib+int@1.0.1/node_modules/@stablelib/int/lib/int.js"(e){function t(e,t){var r=65535&e,n=65535&t;return r*n+((e>>>16&65535)*n+r*(t>>>16&65535)<<16>>>0)|0}function r(e,t){return e+t|0}function n(e,t){return e-t|0}function i(e,t){return e<<t|e>>>32-t}function o(e,t){return e<<32-t|e>>>t}function s(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e}Object.defineProperty(e,"__esModule",{value:!0}),I(t,"imulShim"),e.mul=Math.imul||t,I(r,"add"),e.add=r,I(n,"sub"),e.sub=n,I(i,"rotl"),e.rotl=i,I(o,"rotr"),e.rotr=o,I(s,"isIntegerShim"),e.isInteger=Number.isInteger||s,e.MAX_SAFE_INTEGER=9007199254740991,e.isSafeInteger=function(t){return e.isInteger(t)&&t>=-e.MAX_SAFE_INTEGER&&t<=e.MAX_SAFE_INTEGER}}}),Mr=j({"../../node_modules/.pnpm/@stablelib+binary@1.0.1/node_modules/@stablelib/binary/lib/binary.js"(e){Object.defineProperty(e,"__esModule",{value:!0});var t=xr();function r(e,t){return void 0===t&&(t=0),(e[t+0]<<8|e[t+1])<<16>>16}function n(e,t){return void 0===t&&(t=0),(e[t+0]<<8|e[t+1])>>>0}function i(e,t){return void 0===t&&(t=0),(e[t+1]<<8|e[t])<<16>>16}function o(e,t){return void 0===t&&(t=0),(e[t+1]<<8|e[t])>>>0}function s(e,t,r){return void 0===t&&(t=new Uint8Array(2)),void 0===r&&(r=0),t[r+0]=e>>>8,t[r+1]=e>>>0,t}function a(e,t,r){return void 0===t&&(t=new Uint8Array(2)),void 0===r&&(r=0),t[r+0]=e>>>0,t[r+1]=e>>>8,t}function c(e,t){return void 0===t&&(t=0),e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]}function u(e,t){return void 0===t&&(t=0),(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function l(e,t){return void 0===t&&(t=0),e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]}function d(e,t){return void 0===t&&(t=0),(e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t])>>>0}function f(e,t,r){return void 0===t&&(t=new Uint8Array(4)),void 0===r&&(r=0),t[r+0]=e>>>24,t[r+1]=e>>>16,t[r+2]=e>>>8,t[r+3]=e>>>0,t}function h(e,t,r){return void 0===t&&(t=new Uint8Array(4)),void 0===r&&(r=0),t[r+0]=e>>>0,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24,t}function p(e,t){void 0===t&&(t=0);var r=c(e,t),n=c(e,t+4);return 4294967296*r+n-4294967296*(n>>31)}function m(e,t){return void 0===t&&(t=0),4294967296*u(e,t)+u(e,t+4)}function g(e,t){void 0===t&&(t=0);var r=l(e,t);return 4294967296*l(e,t+4)+r-4294967296*(r>>31)}function b(e,t){void 0===t&&(t=0);var r=d(e,t);return 4294967296*d(e,t+4)+r}function y(e,t,r){return void 0===t&&(t=new Uint8Array(8)),void 0===r&&(r=0),f(e/4294967296>>>0,t,r),f(e>>>0,t,r+4),t}function v(e,t,r){return void 0===t&&(t=new Uint8Array(8)),void 0===r&&(r=0),h(e>>>0,t,r),h(e/4294967296>>>0,t,r+4),t}function w(e,t,r){if(void 0===r&&(r=0),e%8!=0)throw new Error("readUintBE supports only bitLengths divisible by 8");if(e/8>t.length-r)throw new Error("readUintBE: array is too short for the given bitLength");for(var n=0,i=1,o=e/8+r-1;o>=r;o--)n+=t[o]*i,i*=256;return n}function A(e,t,r){if(void 0===r&&(r=0),e%8!=0)throw new Error("readUintLE supports only bitLengths divisible by 8");if(e/8>t.length-r)throw new Error("readUintLE: array is too short for the given bitLength");for(var n=0,i=1,o=r;o<r+e/8;o++)n+=t[o]*i,i*=256;return n}function E(e,r,n,i){if(void 0===n&&(n=new Uint8Array(e/8)),void 0===i&&(i=0),e%8!=0)throw new Error("writeUintBE supports only bitLengths divisible by 8");if(!t.isSafeInteger(r))throw new Error("writeUintBE value must be an integer");for(var o=1,s=e/8+i-1;s>=i;s--)n[s]=r/o&255,o*=256;return n}function S(e,r,n,i){if(void 0===n&&(n=new Uint8Array(e/8)),void 0===i&&(i=0),e%8!=0)throw new Error("writeUintLE supports only bitLengths divisible by 8");if(!t.isSafeInteger(r))throw new Error("writeUintLE value must be an integer");for(var o=1,s=i;s<i+e/8;s++)n[s]=r/o&255,o*=256;return n}function x(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat32(t)}function M(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat32(t,!0)}function _(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat64(t)}function k(e,t){return void 0===t&&(t=0),new DataView(e.buffer,e.byteOffset,e.byteLength).getFloat64(t,!0)}function T(e,t,r){return void 0===t&&(t=new Uint8Array(4)),void 0===r&&(r=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat32(r,e),t}function C(e,t,r){return void 0===t&&(t=new Uint8Array(4)),void 0===r&&(r=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat32(r,e,!0),t}function N(e,t,r){return void 0===t&&(t=new Uint8Array(8)),void 0===r&&(r=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat64(r,e),t}function B(e,t,r){return void 0===t&&(t=new Uint8Array(8)),void 0===r&&(r=0),new DataView(t.buffer,t.byteOffset,t.byteLength).setFloat64(r,e,!0),t}I(r,"readInt16BE"),e.readInt16BE=r,I(n,"readUint16BE"),e.readUint16BE=n,I(i,"readInt16LE"),e.readInt16LE=i,I(o,"readUint16LE"),e.readUint16LE=o,I(s,"writeUint16BE"),e.writeUint16BE=s,e.writeInt16BE=s,I(a,"writeUint16LE"),e.writeUint16LE=a,e.writeInt16LE=a,I(c,"readInt32BE"),e.readInt32BE=c,I(u,"readUint32BE"),e.readUint32BE=u,I(l,"readInt32LE"),e.readInt32LE=l,I(d,"readUint32LE"),e.readUint32LE=d,I(f,"writeUint32BE"),e.writeUint32BE=f,e.writeInt32BE=f,I(h,"writeUint32LE"),e.writeUint32LE=h,e.writeInt32LE=h,I(p,"readInt64BE"),e.readInt64BE=p,I(m,"readUint64BE"),e.readUint64BE=m,I(g,"readInt64LE"),e.readInt64LE=g,I(b,"readUint64LE"),e.readUint64LE=b,I(y,"writeUint64BE"),e.writeUint64BE=y,e.writeInt64BE=y,I(v,"writeUint64LE"),e.writeUint64LE=v,e.writeInt64LE=v,I(w,"readUintBE"),e.readUintBE=w,I(A,"readUintLE"),e.readUintLE=A,I(E,"writeUintBE"),e.writeUintBE=E,I(S,"writeUintLE"),e.writeUintLE=S,I(x,"readFloat32BE"),e.readFloat32BE=x,I(M,"readFloat32LE"),e.readFloat32LE=M,I(_,"readFloat64BE"),e.readFloat64BE=_,I(k,"readFloat64LE"),e.readFloat64LE=k,I(T,"writeFloat32BE"),e.writeFloat32BE=T,I(C,"writeFloat32LE"),e.writeFloat32LE=C,I(N,"writeFloat64BE"),e.writeFloat64BE=N,I(B,"writeFloat64LE"),e.writeFloat64LE=B}}),_r=j({"../../node_modules/.pnpm/@stablelib+wipe@1.0.1/node_modules/@stablelib/wipe/lib/wipe.js"(e){function t(e){for(var t=0;t<e.length;t++)e[t]=0;return e}Object.defineProperty(e,"__esModule",{value:!0}),I(t,"wipe"),e.wipe=t}}),kr=j({"../../node_modules/.pnpm/@stablelib+sha256@1.0.1/node_modules/@stablelib/sha256/lib/sha256.js"(e){Object.defineProperty(e,"__esModule",{value:!0});var t=Mr(),r=_r();e.DIGEST_LENGTH=32,e.BLOCK_SIZE=64;var n=function(){function n(){this.digestLength=e.DIGEST_LENGTH,this.blockSize=e.BLOCK_SIZE,this._state=new Int32Array(8),this._temp=new Int32Array(64),this._buffer=new Uint8Array(128),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return I(n,"SHA256"),n.prototype._initState=function(){this._state[0]=1779033703,this._state[1]=3144134277,this._state[2]=1013904242,this._state[3]=2773480762,this._state[4]=1359893119,this._state[5]=2600822924,this._state[6]=528734635,this._state[7]=1541459225},n.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},n.prototype.clean=function(){r.wipe(this._buffer),r.wipe(this._temp),this.reset()},n.prototype.update=function(e,t){if(void 0===t&&(t=e.length),this._finished)throw new Error("SHA256: can't update because hash was finished.");var r=0;if(this._bytesHashed+=t,this._bufferLength>0){for(;this._bufferLength<this.blockSize&&t>0;)this._buffer[this._bufferLength++]=e[r++],t--;this._bufferLength===this.blockSize&&(o(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(t>=this.blockSize&&(r=o(this._temp,this._state,e,r,t),t%=this.blockSize);t>0;)this._buffer[this._bufferLength++]=e[r++],t--;return this},n.prototype.finish=function(e){if(!this._finished){var r=this._bytesHashed,n=this._bufferLength,i=r/536870912|0,s=r<<3,a=r%64<56?64:128;this._buffer[n]=128;for(var c=n+1;c<a-8;c++)this._buffer[c]=0;t.writeUint32BE(i,this._buffer,a-8),t.writeUint32BE(s,this._buffer,a-4),o(this._temp,this._state,this._buffer,0,a),this._finished=!0}for(c=0;c<this.digestLength/4;c++)t.writeUint32BE(this._state[c],e,4*c);return this},n.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},n.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{state:new Int32Array(this._state),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},n.prototype.restoreState=function(e){return this._state.set(e.state),this._bufferLength=e.bufferLength,e.buffer&&this._buffer.set(e.buffer),this._bytesHashed=e.bytesHashed,this._finished=!1,this},n.prototype.cleanSavedState=function(e){r.wipe(e.state),e.buffer&&r.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},n}();e.SHA256=n;var i=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function o(e,r,n,o,s){for(;s>=64;){for(var a=r[0],c=r[1],u=r[2],l=r[3],d=r[4],f=r[5],h=r[6],p=r[7],m=0;m<16;m++){var g=o+4*m;e[m]=t.readUint32BE(n,g)}for(m=16;m<64;m++){var b=e[m-2],y=(b>>>17|b<<15)^(b>>>19|b<<13)^b>>>10,v=((b=e[m-15])>>>7|b<<25)^(b>>>18|b<<14)^b>>>3;e[m]=(y+e[m-7]|0)+(v+e[m-16]|0)}for(m=0;m<64;m++){y=(((d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7))+(d&f^~d&h)|0)+(p+(i[m]+e[m]|0)|0)|0,v=((a>>>2|a<<30)^(a>>>13|a<<19)^(a>>>22|a<<10))+(a&c^a&u^c&u)|0;p=h,h=f,f=d,d=l+y|0,l=u,u=c,c=a,a=y+v|0}r[0]+=a,r[1]+=c,r[2]+=u,r[3]+=l,r[4]+=d,r[5]+=f,r[6]+=h,r[7]+=p,o+=64,s-=64}return o}function s(e){var t=new n;t.update(e);var r=t.digest();return t.clean(),r}I(o,"hashBlocks"),I(s,"hash"),e.hash=s}}),Tr=j({"../../node_modules/.pnpm/js-sha3@0.8.0/node_modules/js-sha3/src/sha3.js"(e,t){!function(){var e="input is invalid type",r="object"==typeof window,n=r?window:{};n.JS_SHA3_NO_WINDOW&&(r=!1);var i=!r&&"object"==typeof self;!n.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?n=global:i&&(n=self);var o=!n.JS_SHA3_NO_COMMON_JS&&"object"==typeof t&&t.exports,s="function"==typeof define&&define.amd,a=!n.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,c="0123456789abcdef".split(""),u=[4,1024,262144,67108864],l=[0,8,16,24],d=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],f=[224,256,384,512],h=[128,256],p=["hex","buffer","arrayBuffer","array","digest"],m={128:168,256:136};!n.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!a||!n.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var g=I((function(e,t,r){return function(n){return new B(e,t,e).update(n)[r]()}}),"createOutputMethod"),b=I((function(e,t,r){return function(n,i){return new B(e,t,i).update(n)[r]()}}),"createShakeOutputMethod"),y=I((function(e,t,r){return function(t,n,i,o){return S["cshake"+e].update(t,n,i,o)[r]()}}),"createCshakeOutputMethod"),v=I((function(e,t,r){return function(t,n,i,o){return S["kmac"+e].update(t,n,i,o)[r]()}}),"createKmacOutputMethod"),w=I((function(e,t,r,n){for(var i=0;i<p.length;++i){var o=p[i];e[o]=t(r,n,o)}return e}),"createOutputMethods"),A=I((function(e,t){var r=g(e,t,"hex");return r.create=function(){return new B(e,t,e)},r.update=function(e){return r.create().update(e)},w(r,g,e,t)}),"createMethod"),E=[{name:"keccak",padding:[1,256,65536,16777216],bits:f,createMethod:A},{name:"sha3",padding:[6,1536,393216,100663296],bits:f,createMethod:A},{name:"shake",padding:[31,7936,2031616,520093696],bits:h,createMethod:I((function(e,t){var r=b(e,t,"hex");return r.create=function(r){return new B(e,t,r)},r.update=function(e,t){return r.create(t).update(e)},w(r,b,e,t)}),"createShakeMethod")},{name:"cshake",padding:u,bits:h,createMethod:I((function(e,t){var r=m[e],n=y(e,t,"hex");return n.create=function(n,i,o){return i||o?new B(e,t,n).bytepad([i,o],r):S["shake"+e].create(n)},n.update=function(e,t,r,i){return n.create(t,r,i).update(e)},w(n,y,e,t)}),"createCshakeMethod")},{name:"kmac",padding:u,bits:h,createMethod:I((function(e,t){var r=m[e],n=v(e,t,"hex");return n.create=function(n,i,o){return new O(e,t,i).bytepad(["KMAC",o],r).bytepad([n],r)},n.update=function(e,t,r,i){return n.create(e,r,i).update(t)},w(n,v,e,t)}),"createKmacMethod")}],S={},x=[],M=0;M<E.length;++M)for(var _=E[M],k=_.bits,T=0;T<k.length;++T){var C=_.name+"_"+k[T];if(x.push(C),S[C]=_.createMethod(k[T],_.padding),"sha3"!==_.name){var N=_.name+k[T];x.push(N),S[N]=S[C]}}function B(e,t,r){this.blocks=[],this.s=[],this.padding=t,this.outputBits=r,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(e<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function O(e,t,r){B.call(this,e,t,r)}I(B,"Keccak"),B.prototype.update=function(t){if(this.finalized)throw new Error("finalize already called");var r,n=typeof t;if("string"!==n){if("object"!==n)throw new Error(e);if(null===t)throw new Error(e);if(a&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||a&&ArrayBuffer.isView(t)))throw new Error(e);r=!0}for(var i,o,s=this.blocks,c=this.byteCount,u=t.length,d=this.blockCount,f=0,h=this.s;f<u;){if(this.reset)for(this.reset=!1,s[0]=this.block,i=1;i<d+1;++i)s[i]=0;if(r)for(i=this.start;f<u&&i<c;++f)s[i>>2]|=t[f]<<l[3&i++];else for(i=this.start;f<u&&i<c;++f)(o=t.charCodeAt(f))<128?s[i>>2]|=o<<l[3&i++]:o<2048?(s[i>>2]|=(192|o>>6)<<l[3&i++],s[i>>2]|=(128|63&o)<<l[3&i++]):o<55296||o>=57344?(s[i>>2]|=(224|o>>12)<<l[3&i++],s[i>>2]|=(128|o>>6&63)<<l[3&i++],s[i>>2]|=(128|63&o)<<l[3&i++]):(o=65536+((1023&o)<<10|1023&t.charCodeAt(++f)),s[i>>2]|=(240|o>>18)<<l[3&i++],s[i>>2]|=(128|o>>12&63)<<l[3&i++],s[i>>2]|=(128|o>>6&63)<<l[3&i++],s[i>>2]|=(128|63&o)<<l[3&i++]);if(this.lastByteIndex=i,i>=c){for(this.start=i-c,this.block=s[d],i=0;i<d;++i)h[i]^=s[i];D(h),this.reset=!0}else this.start=i}return this},B.prototype.encode=function(e,t){var r=255&e,n=1,i=[r];for(r=255&(e>>=8);r>0;)i.unshift(r),r=255&(e>>=8),++n;return t?i.push(n):i.unshift(n),this.update(i),i.length},B.prototype.encodeString=function(t){var r,n=typeof t;if("string"!==n){if("object"!==n)throw new Error(e);if(null===t)throw new Error(e);if(a&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||a&&ArrayBuffer.isView(t)))throw new Error(e);r=!0}var i=0,o=t.length;if(r)i=o;else for(var s=0;s<t.length;++s){var c=t.charCodeAt(s);c<128?i+=1:c<2048?i+=2:c<55296||c>=57344?i+=3:(c=65536+((1023&c)<<10|1023&t.charCodeAt(++s)),i+=4)}return i+=this.encode(8*i),this.update(t),i},B.prototype.bytepad=function(e,t){for(var r=this.encode(t),n=0;n<e.length;++n)r+=this.encodeString(e[n]);var i=t-r%t,o=[];return o.length=i,this.update(o),this},B.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex,r=this.blockCount,n=this.s;if(e[t>>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t<r+1;++t)e[t]=0;for(e[r-1]|=2147483648,t=0;t<r;++t)n[t]^=e[t];D(n)}},B.prototype.toString=B.prototype.hex=function(){this.finalize();for(var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,a="";s<n;){for(o=0;o<t&&s<n;++o,++s)e=r[o],a+=c[e>>4&15]+c[15&e]+c[e>>12&15]+c[e>>8&15]+c[e>>20&15]+c[e>>16&15]+c[e>>28&15]+c[e>>24&15];s%t==0&&(D(r),o=0)}return i&&(e=r[o],a+=c[e>>4&15]+c[15&e],i>1&&(a+=c[e>>12&15]+c[e>>8&15]),i>2&&(a+=c[e>>20&15]+c[e>>16&15])),a},B.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,a=this.outputBits>>3;e=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(a);for(var c=new Uint32Array(e);s<n;){for(o=0;o<t&&s<n;++o,++s)c[s]=r[o];s%t==0&&D(r)}return i&&(c[o]=r[o],e=e.slice(0,a)),e},B.prototype.buffer=B.prototype.arrayBuffer,B.prototype.digest=B.prototype.array=function(){this.finalize();for(var e,t,r=this.blockCount,n=this.s,i=this.outputBlocks,o=this.extraBytes,s=0,a=0,c=[];a<i;){for(s=0;s<r&&a<i;++s,++a)e=a<<2,t=n[s],c[e]=255&t,c[e+1]=t>>8&255,c[e+2]=t>>16&255,c[e+3]=t>>24&255;a%r==0&&D(n)}return o&&(e=a<<2,t=n[s],c[e]=255&t,o>1&&(c[e+1]=t>>8&255),o>2&&(c[e+2]=t>>16&255)),c},I(O,"Kmac"),O.prototype=new B,O.prototype.finalize=function(){return this.encode(this.outputBits,!0),B.prototype.finalize.call(this)};var D=I((function(e){var t,r,n,i,o,s,a,c,u,l,f,h,p,m,g,b,y,v,w,A,E,S,x,M,_,k,T,C,N,I,B,O,D,j,L,P,R,U,z,K,F,H,$,V,q,G,Y,J,Q,W,X,Z,ee,te,re,ne,ie,oe,se,ae,ce,ue,le;for(n=0;n<48;n+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],s=e[2]^e[12]^e[22]^e[32]^e[42],a=e[3]^e[13]^e[23]^e[33]^e[43],c=e[4]^e[14]^e[24]^e[34]^e[44],u=e[5]^e[15]^e[25]^e[35]^e[45],l=e[6]^e[16]^e[26]^e[36]^e[46],f=e[7]^e[17]^e[27]^e[37]^e[47],t=(h=e[8]^e[18]^e[28]^e[38]^e[48])^(s<<1|a>>>31),r=(p=e[9]^e[19]^e[29]^e[39]^e[49])^(a<<1|s>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=i^(c<<1|u>>>31),r=o^(u<<1|c>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=s^(l<<1|f>>>31),r=a^(f<<1|l>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=c^(h<<1|p>>>31),r=u^(p<<1|h>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=l^(i<<1|o>>>31),r=f^(o<<1|i>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,m=e[0],g=e[1],G=e[11]<<4|e[10]>>>28,Y=e[10]<<4|e[11]>>>28,C=e[20]<<3|e[21]>>>29,N=e[21]<<3|e[20]>>>29,ae=e[31]<<9|e[30]>>>23,ce=e[30]<<9|e[31]>>>23,H=e[40]<<18|e[41]>>>14,$=e[41]<<18|e[40]>>>14,j=e[2]<<1|e[3]>>>31,L=e[3]<<1|e[2]>>>31,b=e[13]<<12|e[12]>>>20,y=e[12]<<12|e[13]>>>20,J=e[22]<<10|e[23]>>>22,Q=e[23]<<10|e[22]>>>22,I=e[33]<<13|e[32]>>>19,B=e[32]<<13|e[33]>>>19,ue=e[42]<<2|e[43]>>>30,le=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,P=e[14]<<6|e[15]>>>26,R=e[15]<<6|e[14]>>>26,v=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,W=e[34]<<15|e[35]>>>17,X=e[35]<<15|e[34]>>>17,O=e[45]<<29|e[44]>>>3,D=e[44]<<29|e[45]>>>3,M=e[6]<<28|e[7]>>>4,_=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,U=e[26]<<25|e[27]>>>7,z=e[27]<<25|e[26]>>>7,A=e[36]<<21|e[37]>>>11,E=e[37]<<21|e[36]>>>11,Z=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,V=e[8]<<27|e[9]>>>5,q=e[9]<<27|e[8]>>>5,k=e[18]<<20|e[19]>>>12,T=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,se=e[28]<<7|e[29]>>>25,K=e[38]<<8|e[39]>>>24,F=e[39]<<8|e[38]>>>24,S=e[48]<<14|e[49]>>>18,x=e[49]<<14|e[48]>>>18,e[0]=m^~b&v,e[1]=g^~y&w,e[10]=M^~k&C,e[11]=_^~T&N,e[20]=j^~P&U,e[21]=L^~R&z,e[30]=V^~G&J,e[31]=q^~Y&Q,e[40]=te^~ne&oe,e[41]=re^~ie&se,e[2]=b^~v&A,e[3]=y^~w&E,e[12]=k^~C&I,e[13]=T^~N&B,e[22]=P^~U&K,e[23]=R^~z&F,e[32]=G^~J&W,e[33]=Y^~Q&X,e[42]=ne^~oe&ae,e[43]=ie^~se&ce,e[4]=v^~A&S,e[5]=w^~E&x,e[14]=C^~I&O,e[15]=N^~B&D,e[24]=U^~K&H,e[25]=z^~F&$,e[34]=J^~W&Z,e[35]=Q^~X&ee,e[44]=oe^~ae&ue,e[45]=se^~ce&le,e[6]=A^~S&m,e[7]=E^~x&g,e[16]=I^~O&M,e[17]=B^~D&_,e[26]=K^~H&j,e[27]=F^~$&L,e[36]=W^~Z&V,e[37]=X^~ee&q,e[46]=ae^~ue&te,e[47]=ce^~le&re,e[8]=S^~m&b,e[9]=x^~g&y,e[18]=O^~M&k,e[19]=D^~_&T,e[28]=H^~j&P,e[29]=$^~L&R,e[38]=Z^~V&G,e[39]=ee^~q&Y,e[48]=ue^~te&ne,e[49]=le^~re&ie,e[0]^=d[n],e[1]^=d[n+1]}),"f");if(o)t.exports=S;else{for(M=0;M<x.length;++M)n[x[M]]=S[x[M]];s&&define((function(){return S}))}}()}}),Cr=j({"../../node_modules/.pnpm/elliptic@6.5.4/node_modules/elliptic/package.json"(e,t){t.exports={name:"elliptic",version:"6.5.4",description:"EC cryptography",main:"lib/elliptic.js",files:["lib"],scripts:{lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository:{type:"git",url:"git@github.com:indutny/elliptic"},keywords:["EC","Elliptic","curve","Cryptography"],author:"Fedor Indutny <fedor@indutny.com>",license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},dependencies:{"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"}}}}),Nr=j({"(disabled):../../node_modules/.pnpm/buffer@5.7.1/node_modules/buffer/index.js"(){}}),Ir=j({"../../node_modules/.pnpm/bn.js@4.12.0/node_modules/bn.js/lib/bn.js"(e,t){!function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=I((function(){}),"TempCtor");r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var o;I(r,"assert"),I(n,"inherits"),I(i,"BN"),"object"==typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:Nr().Buffer}catch(e){}function s(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function a(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function c(e,t,r,n){for(var i=0,o=Math.min(e.length,r),s=t;s<o;s++){var a=e.charCodeAt(s)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}i.isBN=I((function(e){return e instanceof i||null!==e&&"object"==typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)}),"isBN"),i.max=I((function(e,t){return e.cmp(t)>0?e:t}),"max"),i.min=I((function(e,t){return e.cmp(t)<0?e:t}),"min"),i.prototype._init=I((function(e,t,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,n):(this._parseBase(e,t,i),"le"===n&&this._initArray(this.toArray(),t,n)))}),"init"),i.prototype._initNumber=I((function(e,t,n){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),t,n)}),"_initNumber"),i.prototype._initArray=I((function(e,t,n){if(r("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===n)for(i=e.length-1,o=0;i>=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===n)for(i=0,o=0;i<e.length;i+=3)s=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()}),"_initArray"),I(s,"parseHex4Bits"),I(a,"parseHexByte"),i.prototype._parseHex=I((function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=a(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=a(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()}),"_parseHex"),I(c,"parseBase"),i.prototype._parseBase=I((function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,l=r;l<a;l+=n)u=c(e,l,l+n,t),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==s){var d=1;for(u=c(e,l,e.length,t),l=0;l<s;l++)d*=t;this.imuln(d),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this.strip()}),"_parseBase"),i.prototype.copy=I((function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red}),"copy"),i.prototype.clone=I((function(){var e=new i(null);return this.copy(e),e}),"clone"),i.prototype._expand=I((function(e){for(;this.length<e;)this.words[this.length++]=0;return this}),"_expand"),i.prototype.strip=I((function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()}),"strip"),i.prototype._normSign=I((function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this}),"_normSign"),i.prototype.inspect=I((function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}),"inspect");var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=(e.words[n]&1<<i)>>>i}return t}function h(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,c=s/67108864|0;r.words[0]=a;for(var u=1;u<n;u++){for(var l=c>>>26,d=67108863&c,f=Math.min(u,t.length-1),h=Math.max(0,u-e.length+1);h<=f;h++){var p=u-h|0;l+=(s=(i=0|e.words[p])*(o=0|t.words[h])+d)/67108864|0,d=67108863&s}r.words[u]=0|d,c=0|l}return 0!==c?r.words[u]=0|c:r.length--,r.strip()}i.prototype.toString=I((function(e,t){var n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],c=(16777215&(a<<i|o)).toString(16);n=0!==(o=a>>>24-i&16777215)||s!==this.length-1?u[6-c.length]+c+n:c+n,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(n=o.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var f=l[e],h=d[e];n="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(h).toString(e);n=(p=p.idivn(h)).isZero()?m+n:u[f-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!1,"Base should be between 2 and 36")}),"toString"),i.prototype.toNumber=I((function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e}),"toNumber"),i.prototype.toJSON=I((function(){return this.toString(16)}),"toJSON"),i.prototype.toBuffer=I((function(e,t){return r(void 0!==o),this.toArrayLike(o,e,t)}),"toBuffer"),i.prototype.toArray=I((function(e,t){return this.toArrayLike(Array,e,t)}),"toArray"),i.prototype.toArrayLike=I((function(e,t,n){var i=this.byteLength(),o=n||Math.max(1,i);r(i<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0"),this.strip();var s,a,c="le"===t,u=new e(o),l=this.clone();if(c){for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),u[a]=s;for(;a<o;a++)u[a]=0}else{for(a=0;a<o-i;a++)u[a]=0;for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),u[o-a-1]=s}return u}),"toArrayLike"),Math.clz32?i.prototype._countBits=I((function(e){return 32-Math.clz32(e)}),"_countBits"):i.prototype._countBits=I((function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t}),"_countBits"),i.prototype._zeroBits=I((function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r}),"_zeroBits"),i.prototype.bitLength=I((function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t}),"bitLength"),I(f,"toBitArray"),i.prototype.zeroBits=I((function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e}),"zeroBits"),i.prototype.byteLength=I((function(){return Math.ceil(this.bitLength()/8)}),"byteLength"),i.prototype.toTwos=I((function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()}),"toTwos"),i.prototype.fromTwos=I((function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()}),"fromTwos"),i.prototype.isNeg=I((function(){return 0!==this.negative}),"isNeg"),i.prototype.neg=I((function(){return this.clone().ineg()}),"neg"),i.prototype.ineg=I((function(){return this.isZero()||(this.negative^=1),this}),"ineg"),i.prototype.iuor=I((function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()}),"iuor"),i.prototype.ior=I((function(e){return r(0==(this.negative|e.negative)),this.iuor(e)}),"ior"),i.prototype.or=I((function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)}),"or"),i.prototype.uor=I((function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)}),"uor"),i.prototype.iuand=I((function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()}),"iuand"),i.prototype.iand=I((function(e){return r(0==(this.negative|e.negative)),this.iuand(e)}),"iand"),i.prototype.and=I((function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)}),"and"),i.prototype.uand=I((function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)}),"uand"),i.prototype.iuxor=I((function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()}),"iuxor"),i.prototype.ixor=I((function(e){return r(0==(this.negative|e.negative)),this.iuxor(e)}),"ixor"),i.prototype.xor=I((function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)}),"xor"),i.prototype.uxor=I((function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)}),"uxor"),i.prototype.inotn=I((function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return n>0&&(this.words[i]=~this.words[i]&67108863>>26-n),this.strip()}),"inotn"),i.prototype.notn=I((function(e){return this.clone().inotn(e)}),"notn"),i.prototype.setn=I((function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<<i:this.words[n]&~(1<<i),this.strip()}),"setn"),i.prototype.iadd=I((function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o<n.length;o++)t=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<r.length;o++)t=(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this}),"iadd"),i.prototype.add=I((function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)}),"add"),i.prototype.isub=I((function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,s=0;s<n.length;s++)o=(t=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&t;for(;0!==o&&s<r.length;s++)o=(t=(0|r.words[s])+o)>>26,this.words[s]=67108863&t;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()}),"isub"),i.prototype.sub=I((function(e){return this.clone().isub(e)}),"sub"),I(h,"smallMulTo");var p=I((function(e,t,r){var n,i,o,s=e.words,a=t.words,c=r.words,u=0,l=0|s[0],d=8191&l,f=l>>>13,h=0|s[1],p=8191&h,m=h>>>13,g=0|s[2],b=8191&g,y=g>>>13,v=0|s[3],w=8191&v,A=v>>>13,E=0|s[4],S=8191&E,x=E>>>13,M=0|s[5],_=8191&M,k=M>>>13,T=0|s[6],C=8191&T,N=T>>>13,I=0|s[7],B=8191&I,O=I>>>13,D=0|s[8],j=8191&D,L=D>>>13,P=0|s[9],R=8191&P,U=P>>>13,z=0|a[0],K=8191&z,F=z>>>13,H=0|a[1],$=8191&H,V=H>>>13,q=0|a[2],G=8191&q,Y=q>>>13,J=0|a[3],Q=8191&J,W=J>>>13,X=0|a[4],Z=8191&X,ee=X>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],oe=8191&ie,se=ie>>>13,ae=0|a[7],ce=8191&ae,ue=ae>>>13,le=0|a[8],de=8191&le,fe=le>>>13,he=0|a[9],pe=8191&he,me=he>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(u+(n=Math.imul(d,K))|0)+((8191&(i=(i=Math.imul(d,F))+Math.imul(f,K)|0))<<13)|0;u=((o=Math.imul(f,F))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(p,K),i=(i=Math.imul(p,F))+Math.imul(m,K)|0,o=Math.imul(m,F);var be=(u+(n=n+Math.imul(d,$)|0)|0)+((8191&(i=(i=i+Math.imul(d,V)|0)+Math.imul(f,$)|0))<<13)|0;u=((o=o+Math.imul(f,V)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(b,K),i=(i=Math.imul(b,F))+Math.imul(y,K)|0,o=Math.imul(y,F),n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,V)|0;var ye=(u+(n=n+Math.imul(d,G)|0)|0)+((8191&(i=(i=i+Math.imul(d,Y)|0)+Math.imul(f,G)|0))<<13)|0;u=((o=o+Math.imul(f,Y)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(w,K),i=(i=Math.imul(w,F))+Math.imul(A,K)|0,o=Math.imul(A,F),n=n+Math.imul(b,$)|0,i=(i=i+Math.imul(b,V)|0)+Math.imul(y,$)|0,o=o+Math.imul(y,V)|0,n=n+Math.imul(p,G)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,Y)|0;var ve=(u+(n=n+Math.imul(d,Q)|0)|0)+((8191&(i=(i=i+Math.imul(d,W)|0)+Math.imul(f,Q)|0))<<13)|0;u=((o=o+Math.imul(f,W)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(S,K),i=(i=Math.imul(S,F))+Math.imul(x,K)|0,o=Math.imul(x,F),n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(A,$)|0,o=o+Math.imul(A,V)|0,n=n+Math.imul(b,G)|0,i=(i=i+Math.imul(b,Y)|0)+Math.imul(y,G)|0,o=o+Math.imul(y,Y)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,W)|0;var we=(u+(n=n+Math.imul(d,Z)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(f,Z)|0))<<13)|0;u=((o=o+Math.imul(f,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(_,K),i=(i=Math.imul(_,F))+Math.imul(k,K)|0,o=Math.imul(k,F),n=n+Math.imul(S,$)|0,i=(i=i+Math.imul(S,V)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,V)|0,n=n+Math.imul(w,G)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(A,G)|0,o=o+Math.imul(A,Y)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,W)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,W)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,ee)|0;var Ae=(u+(n=n+Math.imul(d,re)|0)|0)+((8191&(i=(i=i+Math.imul(d,ne)|0)+Math.imul(f,re)|0))<<13)|0;u=((o=o+Math.imul(f,ne)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(C,K),i=(i=Math.imul(C,F))+Math.imul(N,K)|0,o=Math.imul(N,F),n=n+Math.imul(_,$)|0,i=(i=i+Math.imul(_,V)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,V)|0,n=n+Math.imul(S,G)|0,i=(i=i+Math.imul(S,Y)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,Y)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,W)|0,n=n+Math.imul(b,Z)|0,i=(i=i+Math.imul(b,ee)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0;var Ee=(u+(n=n+Math.imul(d,oe)|0)|0)+((8191&(i=(i=i+Math.imul(d,se)|0)+Math.imul(f,oe)|0))<<13)|0;u=((o=o+Math.imul(f,se)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(B,K),i=(i=Math.imul(B,F))+Math.imul(O,K)|0,o=Math.imul(O,F),n=n+Math.imul(C,$)|0,i=(i=i+Math.imul(C,V)|0)+Math.imul(N,$)|0,o=o+Math.imul(N,V)|0,n=n+Math.imul(_,G)|0,i=(i=i+Math.imul(_,Y)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,Y)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,W)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,W)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,ee)|0,n=n+Math.imul(b,re)|0,i=(i=i+Math.imul(b,ne)|0)+Math.imul(y,re)|0,o=o+Math.imul(y,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,se)|0;var Se=(u+(n=n+Math.imul(d,ce)|0)|0)+((8191&(i=(i=i+Math.imul(d,ue)|0)+Math.imul(f,ce)|0))<<13)|0;u=((o=o+Math.imul(f,ue)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(j,K),i=(i=Math.imul(j,F))+Math.imul(L,K)|0,o=Math.imul(L,F),n=n+Math.imul(B,$)|0,i=(i=i+Math.imul(B,V)|0)+Math.imul(O,$)|0,o=o+Math.imul(O,V)|0,n=n+Math.imul(C,G)|0,i=(i=i+Math.imul(C,Y)|0)+Math.imul(N,G)|0,o=o+Math.imul(N,Y)|0,n=n+Math.imul(_,Q)|0,i=(i=i+Math.imul(_,W)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,W)|0,n=n+Math.imul(S,Z)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(A,re)|0,o=o+Math.imul(A,ne)|0,n=n+Math.imul(b,oe)|0,i=(i=i+Math.imul(b,se)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,se)|0,n=n+Math.imul(p,ce)|0,i=(i=i+Math.imul(p,ue)|0)+Math.imul(m,ce)|0,o=o+Math.imul(m,ue)|0;var xe=(u+(n=n+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,fe)|0)+Math.imul(f,de)|0))<<13)|0;u=((o=o+Math.imul(f,fe)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(R,K),i=(i=Math.imul(R,F))+Math.imul(U,K)|0,o=Math.imul(U,F),n=n+Math.imul(j,$)|0,i=(i=i+Math.imul(j,V)|0)+Math.imul(L,$)|0,o=o+Math.imul(L,V)|0,n=n+Math.imul(B,G)|0,i=(i=i+Math.imul(B,Y)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,Y)|0,n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,W)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,W)|0,n=n+Math.imul(_,Z)|0,i=(i=i+Math.imul(_,ee)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(S,re)|0,i=(i=i+Math.imul(S,ne)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(A,oe)|0,o=o+Math.imul(A,se)|0,n=n+Math.imul(b,ce)|0,i=(i=i+Math.imul(b,ue)|0)+Math.imul(y,ce)|0,o=o+Math.imul(y,ue)|0,n=n+Math.imul(p,de)|0,i=(i=i+Math.imul(p,fe)|0)+Math.imul(m,de)|0,o=o+Math.imul(m,fe)|0;var Me=(u+(n=n+Math.imul(d,pe)|0)|0)+((8191&(i=(i=i+Math.imul(d,me)|0)+Math.imul(f,pe)|0))<<13)|0;u=((o=o+Math.imul(f,me)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(R,$),i=(i=Math.imul(R,V))+Math.imul(U,$)|0,o=Math.imul(U,V),n=n+Math.imul(j,G)|0,i=(i=i+Math.imul(j,Y)|0)+Math.imul(L,G)|0,o=o+Math.imul(L,Y)|0,n=n+Math.imul(B,Q)|0,i=(i=i+Math.imul(B,W)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,W)|0,n=n+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(N,Z)|0,o=o+Math.imul(N,ee)|0,n=n+Math.imul(_,re)|0,i=(i=i+Math.imul(_,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(S,oe)|0,i=(i=i+Math.imul(S,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,n=n+Math.imul(w,ce)|0,i=(i=i+Math.imul(w,ue)|0)+Math.imul(A,ce)|0,o=o+Math.imul(A,ue)|0,n=n+Math.imul(b,de)|0,i=(i=i+Math.imul(b,fe)|0)+Math.imul(y,de)|0,o=o+Math.imul(y,fe)|0;var _e=(u+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;u=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(R,G),i=(i=Math.imul(R,Y))+Math.imul(U,G)|0,o=Math.imul(U,Y),n=n+Math.imul(j,Q)|0,i=(i=i+Math.imul(j,W)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,W)|0,n=n+Math.imul(B,Z)|0,i=(i=i+Math.imul(B,ee)|0)+Math.imul(O,Z)|0,o=o+Math.imul(O,ee)|0,n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(N,re)|0,o=o+Math.imul(N,ne)|0,n=n+Math.imul(_,oe)|0,i=(i=i+Math.imul(_,se)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,se)|0,n=n+Math.imul(S,ce)|0,i=(i=i+Math.imul(S,ue)|0)+Math.imul(x,ce)|0,o=o+Math.imul(x,ue)|0,n=n+Math.imul(w,de)|0,i=(i=i+Math.imul(w,fe)|0)+Math.imul(A,de)|0,o=o+Math.imul(A,fe)|0;var ke=(u+(n=n+Math.imul(b,pe)|0)|0)+((8191&(i=(i=i+Math.imul(b,me)|0)+Math.imul(y,pe)|0))<<13)|0;u=((o=o+Math.imul(y,me)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(R,Q),i=(i=Math.imul(R,W))+Math.imul(U,Q)|0,o=Math.imul(U,W),n=n+Math.imul(j,Z)|0,i=(i=i+Math.imul(j,ee)|0)+Math.imul(L,Z)|0,o=o+Math.imul(L,ee)|0,n=n+Math.imul(B,re)|0,i=(i=i+Math.imul(B,ne)|0)+Math.imul(O,re)|0,o=o+Math.imul(O,ne)|0,n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,se)|0)+Math.imul(N,oe)|0,o=o+Math.imul(N,se)|0,n=n+Math.imul(_,ce)|0,i=(i=i+Math.imul(_,ue)|0)+Math.imul(k,ce)|0,o=o+Math.imul(k,ue)|0,n=n+Math.imul(S,de)|0,i=(i=i+Math.imul(S,fe)|0)+Math.imul(x,de)|0,o=o+Math.imul(x,fe)|0;var Te=(u+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(A,pe)|0))<<13)|0;u=((o=o+Math.imul(A,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(R,Z),i=(i=Math.imul(R,ee))+Math.imul(U,Z)|0,o=Math.imul(U,ee),n=n+Math.imul(j,re)|0,i=(i=i+Math.imul(j,ne)|0)+Math.imul(L,re)|0,o=o+Math.imul(L,ne)|0,n=n+Math.imul(B,oe)|0,i=(i=i+Math.imul(B,se)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,se)|0,n=n+Math.imul(C,ce)|0,i=(i=i+Math.imul(C,ue)|0)+Math.imul(N,ce)|0,o=o+Math.imul(N,ue)|0,n=n+Math.imul(_,de)|0,i=(i=i+Math.imul(_,fe)|0)+Math.imul(k,de)|0,o=o+Math.imul(k,fe)|0;var Ce=(u+(n=n+Math.imul(S,pe)|0)|0)+((8191&(i=(i=i+Math.imul(S,me)|0)+Math.imul(x,pe)|0))<<13)|0;u=((o=o+Math.imul(x,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(R,re),i=(i=Math.imul(R,ne))+Math.imul(U,re)|0,o=Math.imul(U,ne),n=n+Math.imul(j,oe)|0,i=(i=i+Math.imul(j,se)|0)+Math.imul(L,oe)|0,o=o+Math.imul(L,se)|0,n=n+Math.imul(B,ce)|0,i=(i=i+Math.imul(B,ue)|0)+Math.imul(O,ce)|0,o=o+Math.imul(O,ue)|0,n=n+Math.imul(C,de)|0,i=(i=i+Math.imul(C,fe)|0)+Math.imul(N,de)|0,o=o+Math.imul(N,fe)|0;var Ne=(u+(n=n+Math.imul(_,pe)|0)|0)+((8191&(i=(i=i+Math.imul(_,me)|0)+Math.imul(k,pe)|0))<<13)|0;u=((o=o+Math.imul(k,me)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(R,oe),i=(i=Math.imul(R,se))+Math.imul(U,oe)|0,o=Math.imul(U,se),n=n+Math.imul(j,ce)|0,i=(i=i+Math.imul(j,ue)|0)+Math.imul(L,ce)|0,o=o+Math.imul(L,ue)|0,n=n+Math.imul(B,de)|0,i=(i=i+Math.imul(B,fe)|0)+Math.imul(O,de)|0,o=o+Math.imul(O,fe)|0;var Ie=(u+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,me)|0)+Math.imul(N,pe)|0))<<13)|0;u=((o=o+Math.imul(N,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(R,ce),i=(i=Math.imul(R,ue))+Math.imul(U,ce)|0,o=Math.imul(U,ue),n=n+Math.imul(j,de)|0,i=(i=i+Math.imul(j,fe)|0)+Math.imul(L,de)|0,o=o+Math.imul(L,fe)|0;var Be=(u+(n=n+Math.imul(B,pe)|0)|0)+((8191&(i=(i=i+Math.imul(B,me)|0)+Math.imul(O,pe)|0))<<13)|0;u=((o=o+Math.imul(O,me)|0)+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,n=Math.imul(R,de),i=(i=Math.imul(R,fe))+Math.imul(U,de)|0,o=Math.imul(U,fe);var Oe=(u+(n=n+Math.imul(j,pe)|0)|0)+((8191&(i=(i=i+Math.imul(j,me)|0)+Math.imul(L,pe)|0))<<13)|0;u=((o=o+Math.imul(L,me)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863;var De=(u+(n=Math.imul(R,pe))|0)+((8191&(i=(i=Math.imul(R,me))+Math.imul(U,pe)|0))<<13)|0;return u=((o=Math.imul(U,me))+(i>>>13)|0)+(De>>>26)|0,De&=67108863,c[0]=ge,c[1]=be,c[2]=ye,c[3]=ve,c[4]=we,c[5]=Ae,c[6]=Ee,c[7]=Se,c[8]=xe,c[9]=Me,c[10]=_e,c[11]=ke,c[12]=Te,c[13]=Ce,c[14]=Ne,c[15]=Ie,c[16]=Be,c[17]=Oe,c[18]=De,0!==u&&(c[19]=u,r.length++),r}),"comb10MulTo");function m(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,c=Math.min(o,t.length-1),u=Math.max(0,o-e.length+1);u<=c;u++){var l=o-u,d=(0|e.words[l])*(0|t.words[u]),f=67108863&d;a=67108863&(f=f+a|0),i+=(s=(s=s+(d/67108864|0)|0)+(f>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}function g(e,t,r){return(new b).mulp(e,t,r)}function b(e,t){this.x=e,this.y=t}Math.imul||(p=h),I(m,"bigMulTo"),I(g,"jumboMulTo"),i.prototype.mulTo=I((function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?p(this,e,t):r<63?h(this,e,t):r<1024?m(this,e,t):g(this,e,t)}),"mulTo"),I(b,"FFTM"),b.prototype.makeRBT=I((function(e){for(var t=new Array(e),r=i.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t}),"makeRBT"),b.prototype.revBin=I((function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n}),"revBin"),b.prototype.permute=I((function(e,t,r,n,i,o){for(var s=0;s<o;s++)n[s]=t[e[s]],i[s]=r[e[s]]}),"permute"),b.prototype.transform=I((function(e,t,r,n,i,o){this.permute(o,e,t,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,c=Math.cos(2*Math.PI/a),u=Math.sin(2*Math.PI/a),l=0;l<i;l+=a)for(var d=c,f=u,h=0;h<s;h++){var p=r[l+h],m=n[l+h],g=r[l+h+s],b=n[l+h+s],y=d*g-f*b;b=d*b+f*g,g=y,r[l+h]=p+g,n[l+h]=m+b,r[l+h+s]=p-g,n[l+h+s]=m-b,h!==a&&(y=c*d-u*f,f=c*f+u*d,d=y)}}),"transform"),b.prototype.guessLen13b=I((function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n}),"guessLen13b"),b.prototype.conjugate=I((function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}}),"conjugate"),b.prototype.normalize13b=I((function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e}),"normalize13b"),b.prototype.convert13b=I((function(e,t,n,i){for(var o=0,s=0;s<t;s++)o+=0|e[s],n[2*s]=8191&o,o>>>=13,n[2*s+1]=8191&o,o>>>=13;for(s=2*t;s<i;++s)n[s]=0;r(0===o),r(0==(-8192&o))}),"convert13b"),b.prototype.stub=I((function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t}),"stub"),b.prototype.mulp=I((function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),c=new Array(n),u=new Array(n),l=new Array(n),d=new Array(n),f=r.words;f.length=n,this.convert13b(e.words,e.length,s,n),this.convert13b(t.words,t.length,u,n),this.transform(s,o,a,c,n,i),this.transform(u,o,l,d,n,i);for(var h=0;h<n;h++){var p=a[h]*l[h]-c[h]*d[h];c[h]=a[h]*d[h]+c[h]*l[h],a[h]=p}return this.conjugate(a,c,n),this.transform(a,c,f,o,n,i),this.conjugate(f,o,n),this.normalize13b(f,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()}),"mulp"),i.prototype.mul=I((function(e){var t=new i(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)}),"mul"),i.prototype.mulf=I((function(e){var t=new i(null);return t.words=new Array(this.length+e.length),g(this,e,t)}),"mulf"),i.prototype.imul=I((function(e){return this.clone().mulTo(e,this)}),"imul"),i.prototype.imuln=I((function(e){r("number"==typeof e),r(e<67108864);for(var t=0,n=0;n<this.length;n++){var i=(0|this.words[n])*e,o=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=o>>>26,this.words[n]=67108863&o}return 0!==t&&(this.words[n]=t,this.length++),this}),"imuln"),i.prototype.muln=I((function(e){return this.clone().imuln(e)}),"muln"),i.prototype.sqr=I((function(){return this.mul(this)}),"sqr"),i.prototype.isqr=I((function(){return this.imul(this.clone())}),"isqr"),i.prototype.pow=I((function(e){var t=f(e);if(0===t.length)return new i(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var o=r.sqr();n<t.length;n++,o=o.sqr())0!==t[n]&&(r=r.mul(o));return r}),"pow"),i.prototype.iushln=I((function(e){r("number"==typeof e&&e>=0);var t,n=e%26,i=(e-n)/26,o=67108863>>>26-n<<26-n;if(0!==n){var s=0;for(t=0;t<this.length;t++){var a=this.words[t]&o,c=(0|this.words[t])-a<<n;this.words[t]=c|s,s=a>>>26-n}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this.strip()}),"iushln"),i.prototype.ishln=I((function(e){return r(0===this.negative),this.iushln(e)}),"ishln"),i.prototype.iushrn=I((function(e,t,n){var i;r("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<<o,c=n;if(i-=s,i=Math.max(0,i),c){for(var u=0;u<s;u++)c.words[u]=this.words[u];c.length=s}if(0===s);else if(this.length>s)for(this.length-=s,u=0;u<this.length;u++)this.words[u]=this.words[u+s];else this.words[0]=0,this.length=1;var l=0;for(u=this.length-1;u>=0&&(0!==l||u>=i);u--){var d=0|this.words[u];this.words[u]=l<<26-o|d>>>o,l=d&a}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()}),"iushrn"),i.prototype.ishrn=I((function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)}),"ishrn"),i.prototype.shln=I((function(e){return this.clone().ishln(e)}),"shln"),i.prototype.ushln=I((function(e){return this.clone().iushln(e)}),"ushln"),i.prototype.shrn=I((function(e){return this.clone().ishrn(e)}),"shrn"),i.prototype.ushrn=I((function(e){return this.clone().iushrn(e)}),"ushrn"),i.prototype.testn=I((function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<<t;return!(this.length<=n)&&!!(this.words[n]&i)}),"testn"),i.prototype.imaskn=I((function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this.strip()}),"imaskn"),i.prototype.maskn=I((function(e){return this.clone().imaskn(e)}),"maskn"),i.prototype.iaddn=I((function(e){return r("number"==typeof e),r(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)}),"iaddn"),i.prototype._iaddn=I((function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this}),"_iaddn"),i.prototype.isubn=I((function(e){if(r("number"==typeof e),r(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()}),"isubn"),i.prototype.addn=I((function(e){return this.clone().iaddn(e)}),"addn"),i.prototype.subn=I((function(e){return this.clone().isubn(e)}),"subn"),i.prototype.iabs=I((function(){return this.negative=0,this}),"iabs"),i.prototype.abs=I((function(){return this.clone().iabs()}),"abs"),i.prototype._ishlnsubmul=I((function(e,t,n){var i,o,s=e.length+n;this._expand(s);var a=0;for(i=0;i<e.length;i++){o=(0|this.words[i+n])+a;var c=(0|e.words[i])*t;a=((o-=67108863&c)>>26)-(c/67108864|0),this.words[i+n]=67108863&o}for(;i<this.length-n;i++)a=(o=(0|this.words[i+n])+a)>>26,this.words[i+n]=67108863&o;if(0===a)return this.strip();for(r(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()}),"_ishlnsubmul"),i.prototype._wordDiv=I((function(e,t){var r=(this.length,e.length),n=this.clone(),o=e,s=0|o.words[o.length-1];0!==(r=26-this._countBits(s))&&(o=o.ushln(r),n.iushln(r),s=0|o.words[o.length-1]);var a,c=n.length-o.length;if("mod"!==t){(a=new i(null)).length=c+1,a.words=new Array(a.length);for(var u=0;u<a.length;u++)a.words[u]=0}var l=n.clone()._ishlnsubmul(o,1,c);0===l.negative&&(n=l,a&&(a.words[c]=1));for(var d=c-1;d>=0;d--){var f=67108864*(0|n.words[o.length+d])+(0|n.words[o.length+d-1]);for(f=Math.min(f/s|0,67108863),n._ishlnsubmul(o,f,d);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(o,1,d),n.isZero()||(n.negative^=1);a&&(a.words[d]=f)}return a&&a.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}}),"_wordDiv"),i.prototype.divmod=I((function(e,t,n){return r(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(o=a.div.neg()),"div"!==t&&(s=a.mod.neg(),n&&0!==s.negative&&s.iadd(e)),{div:o,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(o=a.div.neg()),{div:o,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),n&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modn(e.words[0]))}:this._wordDiv(e,t);var o,s,a}),"divmod"),i.prototype.div=I((function(e){return this.divmod(e,"div",!1).div}),"div"),i.prototype.mod=I((function(e){return this.divmod(e,"mod",!1).mod}),"mod"),i.prototype.umod=I((function(e){return this.divmod(e,"mod",!0).mod}),"umod"),i.prototype.divRound=I((function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)}),"divRound"),i.prototype.modn=I((function(e){r(e<=67108863);for(var t=(1<<26)%e,n=0,i=this.length-1;i>=0;i--)n=(t*n+(0|this.words[i]))%e;return n}),"modn"),i.prototype.idivn=I((function(e){r(e<=67108863);for(var t=0,n=this.length-1;n>=0;n--){var i=(0|this.words[n])+67108864*t;this.words[n]=i/e|0,t=i%e}return this.strip()}),"idivn"),i.prototype.divn=I((function(e){return this.clone().idivn(e)}),"divn"),i.prototype.egcd=I((function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o=new i(1),s=new i(0),a=new i(0),c=new i(1),u=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++u;for(var l=n.clone(),d=t.clone();!t.isZero();){for(var f=0,h=1;0==(t.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(o.isOdd()||s.isOdd())&&(o.iadd(l),s.isub(d)),o.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(n.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(n.iushrn(p);p-- >0;)(a.isOdd()||c.isOdd())&&(a.iadd(l),c.isub(d)),a.iushrn(1),c.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(a),s.isub(c)):(n.isub(t),a.isub(o),c.isub(s))}return{a:a,b:c,gcd:n.iushln(u)}}),"egcd"),i.prototype._invmp=I((function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var o,s=new i(1),a=new i(0),c=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var u=0,l=1;0==(t.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(t.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);for(var d=0,f=1;0==(n.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(n.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);t.cmp(n)>=0?(t.isub(n),s.isub(a)):(n.isub(t),a.isub(s))}return(o=0===t.cmpn(1)?s:a).cmpn(0)<0&&o.iadd(e),o}),"_invmp"),i.prototype.gcd=I((function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)}),"gcd"),i.prototype.invm=I((function(e){return this.egcd(e).a.umod(e)}),"invm"),i.prototype.isEven=I((function(){return 0==(1&this.words[0])}),"isEven"),i.prototype.isOdd=I((function(){return 1==(1&this.words[0])}),"isOdd"),i.prototype.andln=I((function(e){return this.words[0]&e}),"andln"),i.prototype.bincn=I((function(e){r("number"==typeof e);var t=e%26,n=(e-t)/26,i=1<<t;if(this.length<=n)return this._expand(n+1),this.words[n]|=i,this;for(var o=i,s=n;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this}),"bincn"),i.prototype.isZero=I((function(){return 1===this.length&&0===this.words[0]}),"isZero"),i.prototype.cmpn=I((function(e){var t,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this.strip(),this.length>1)t=1;else{n&&(e=-e),r(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t}),"cmpn"),i.prototype.cmp=I((function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t}),"cmp"),i.prototype.ucmp=I((function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t}),"ucmp"),i.prototype.gtn=I((function(e){return 1===this.cmpn(e)}),"gtn"),i.prototype.gt=I((function(e){return 1===this.cmp(e)}),"gt"),i.prototype.gten=I((function(e){return this.cmpn(e)>=0}),"gten"),i.prototype.gte=I((function(e){return this.cmp(e)>=0}),"gte"),i.prototype.ltn=I((function(e){return-1===this.cmpn(e)}),"ltn"),i.prototype.lt=I((function(e){return-1===this.cmp(e)}),"lt"),i.prototype.lten=I((function(e){return this.cmpn(e)<=0}),"lten"),i.prototype.lte=I((function(e){return this.cmp(e)<=0}),"lte"),i.prototype.eqn=I((function(e){return 0===this.cmpn(e)}),"eqn"),i.prototype.eq=I((function(e){return 0===this.cmp(e)}),"eq"),i.red=I((function(e){return new x(e)}),"red"),i.prototype.toRed=I((function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)}),"toRed"),i.prototype.fromRed=I((function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)}),"fromRed"),i.prototype._forceRed=I((function(e){return this.red=e,this}),"_forceRed"),i.prototype.forceRed=I((function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)}),"forceRed"),i.prototype.redAdd=I((function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)}),"redAdd"),i.prototype.redIAdd=I((function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)}),"redIAdd"),i.prototype.redSub=I((function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)}),"redSub"),i.prototype.redISub=I((function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)}),"redISub"),i.prototype.redShl=I((function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)}),"redShl"),i.prototype.redMul=I((function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)}),"redMul"),i.prototype.redIMul=I((function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)}),"redIMul"),i.prototype.redSqr=I((function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)}),"redSqr"),i.prototype.redISqr=I((function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)}),"redISqr"),i.prototype.redSqrt=I((function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)}),"redSqrt"),i.prototype.redInvm=I((function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)}),"redInvm"),i.prototype.redNeg=I((function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)}),"redNeg"),i.prototype.redPow=I((function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)}),"redPow");var y={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function x(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function M(e){x.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}I(v,"MPrime"),v.prototype._tmp=I((function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e}),"_tmp"),v.prototype.ireduce=I((function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r}),"ireduce"),v.prototype.split=I((function(e,t){e.iushrn(this.n,0,t)}),"split"),v.prototype.imulK=I((function(e){return e.imul(this.k)}),"imulK"),I(w,"K256"),n(w,v),w.prototype.split=I((function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,i=10;i<e.length;i++){var s=0|e.words[i];e.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9}),"split"),w.prototype.imulK=I((function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e}),"imulK"),I(A,"P224"),n(A,v),I(E,"P192"),n(E,v),I(S,"P25519"),n(S,v),S.prototype.imulK=I((function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e}),"imulK"),i._prime=I((function(e){if(y[e])return y[e];var t;if("k256"===e)t=new w;else if("p224"===e)t=new A;else if("p192"===e)t=new E;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new S}return y[e]=t,t}),"prime"),I(x,"Red"),x.prototype._verify1=I((function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")}),"_verify1"),x.prototype._verify2=I((function(e,t){r(0==(e.negative|t.negative),"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")}),"_verify2"),x.prototype.imod=I((function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)}),"imod"),x.prototype.neg=I((function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)}),"neg"),x.prototype.add=I((function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)}),"add"),x.prototype.iadd=I((function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r}),"iadd"),x.prototype.sub=I((function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)}),"sub"),x.prototype.isub=I((function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r}),"isub"),x.prototype.shl=I((function(e,t){return this._verify1(e),this.imod(e.ushln(t))}),"shl"),x.prototype.imul=I((function(e,t){return this._verify2(e,t),this.imod(e.imul(t))}),"imul"),x.prototype.mul=I((function(e,t){return this._verify2(e,t),this.imod(e.mul(t))}),"mul"),x.prototype.isqr=I((function(e){return this.imul(e,e.clone())}),"isqr"),x.prototype.sqr=I((function(e){return this.mul(e,e)}),"sqr"),x.prototype.sqrt=I((function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var n=this.m.add(new i(1)).iushrn(2);return this.pow(e,n)}for(var o=this.m.subn(1),s=0;!o.isZero()&&0===o.andln(1);)s++,o.iushrn(1);r(!o.isZero());var a=new i(1).toRed(this),c=a.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new i(2*l*l).toRed(this);0!==this.pow(l,u).cmp(c);)l.redIAdd(c);for(var d=this.pow(l,o),f=this.pow(e,o.addn(1).iushrn(1)),h=this.pow(e,o),p=s;0!==h.cmp(a);){for(var m=h,g=0;0!==m.cmp(a);g++)m=m.redSqr();r(g<p);var b=this.pow(d,new i(1).iushln(p-g-1));f=f.redMul(b),d=b.redSqr(),h=h.redMul(d),p=g}return f}),"sqrt"),x.prototype.invm=I((function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)}),"invm"),x.prototype.pow=I((function(e,t){if(t.isZero())return new i(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new i(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var o=r[0],s=0,a=0,c=t.bitLength()%26;for(0===c&&(c=26),n=t.length-1;n>=0;n--){for(var u=t.words[n],l=c-1;l>=0;l--){var d=u>>l&1;o!==r[0]&&(o=this.sqr(o)),0!==d||0!==s?(s<<=1,s|=d,(4===++a||0===n&&0===l)&&(o=this.mul(o,r[s]),a=0,s=0)):a=0}c=26}return o}),"pow"),x.prototype.convertTo=I((function(e){var t=e.umod(this.m);return t===e?t.clone():t}),"convertTo"),x.prototype.convertFrom=I((function(e){var t=e.clone();return t.red=null,t}),"convertFrom"),i.mont=I((function(e){return new M(e)}),"mont"),I(M,"Mont"),n(M,x),M.prototype.convertTo=I((function(e){return this.imod(e.ushln(this.shift))}),"convertTo"),M.prototype.convertFrom=I((function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t}),"convertFrom"),M.prototype.imul=I((function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)}),"imul"),M.prototype.mul=I((function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(n).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):o.cmpn(0)<0&&(s=o.iadd(this.m)),s._forceRed(this)}),"mul"),M.prototype.invm=I((function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}),"invm")}(void 0===t||t,e)}}),Br=j({"../../node_modules/.pnpm/minimalistic-assert@1.0.1/node_modules/minimalistic-assert/index.js"(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}t.exports=r,I(r,"assert"),r.equal=I((function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}),"assertEqual")}}),Or=j({"../../node_modules/.pnpm/minimalistic-crypto-utils@1.0.1/node_modules/minimalistic-crypto-utils/lib/utils.js"(e){var t=e;function r(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n<e.length;n++)r[n]=0|e[n];return r}if("hex"===t){(e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e);for(n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16))}else for(n=0;n<e.length;n++){var i=e.charCodeAt(n),o=i>>8,s=255&i;o?r.push(o,s):r.push(s)}return r}function n(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",r=0;r<e.length;r++)t+=n(e[r].toString(16));return t}I(r,"toArray"),t.toArray=r,I(n,"zero2"),t.zero2=n,I(i,"toHex"),t.toHex=i,t.encode=I((function(e,t){return"hex"===t?i(e):e}),"encode")}}),Dr=j({"../../node_modules/.pnpm/elliptic@6.5.4/node_modules/elliptic/lib/elliptic/utils.js"(e){var t=e,r=Ir(),n=Br(),i=Or();function o(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var i=1<<t+1,o=e.clone(),s=0;s<n.length;s++){var a,c=o.andln(i-1);o.isOdd()?(a=c>(i>>1)-1?(i>>1)-c:c,o.isubn(a)):a=0,n[s]=a,o.iushrn(1)}return n}function s(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var s,a,c=e.andln(3)+i&3,u=t.andln(3)+o&3;3===c&&(c=-1),3===u&&(u=-1),s=0==(1&c)?0:3!==(n=e.andln(7)+i&7)&&5!==n||2!==u?c:-c,r[0].push(s),a=0==(1&u)?0:3!==(n=t.andln(7)+o&7)&&5!==n||2!==c?u:-u,r[1].push(a),2*i===s+1&&(i=1-i),2*o===a+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r}function a(e,t,r){var n="_"+t;e.prototype[t]=I((function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}),"cachedProperty")}function c(e){return"string"==typeof e?t.toArray(e,"hex"):e}function u(e){return new r(e,"hex","le")}t.assert=n,t.toArray=i.toArray,t.zero2=i.zero2,t.toHex=i.toHex,t.encode=i.encode,I(o,"getNAF"),t.getNAF=o,I(s,"getJSF"),t.getJSF=s,I(a,"cachedProperty"),t.cachedProperty=a,I(c,"parseBytes"),t.parseBytes=c,I(u,"intFromLE"),t.intFromLE=u}}),jr=j({"../../node_modules/.pnpm/brorand@1.1.0/node_modules/brorand/index.js"(e,t){var r,n;function i(e){this.rand=e}if(t.exports=I((function(e){return r||(r=new i(null)),r.generate(e)}),"rand"),I(i,"Rand"),t.exports.Rand=i,i.prototype.generate=I((function(e){return this._rand(e)}),"generate"),i.prototype._rand=I((function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r<t.length;r++)t[r]=this.rand.getByte();return t}),"_rand"),"object"==typeof self)self.crypto&&self.crypto.getRandomValues?i.prototype._rand=I((function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}),"_rand"):self.msCrypto&&self.msCrypto.getRandomValues?i.prototype._rand=I((function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}),"_rand"):"object"==typeof window&&(i.prototype._rand=function(){throw new Error("Not implemented yet")});else try{if("function"!=typeof(n=B("crypto")).randomBytes)throw new Error("Not supported");i.prototype._rand=I((function(e){return n.randomBytes(e)}),"_rand")}catch(e){}}}),Lr=j({"../../node_modules/.pnpm/elliptic@6.5.4/node_modules/elliptic/lib/elliptic/curve/base.js"(e,t){var r=Ir(),n=Dr(),i=n.getNAF,o=n.getJSF,s=n.assert;function a(e,t){this.type=e,this.p=new r(t.p,16),this.red=t.prime?r.red(t.prime):r.mont(this.p),this.zero=new r(0).toRed(this.red),this.one=new r(1).toRed(this.red),this.two=new r(2).toRed(this.red),this.n=t.n&&new r(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var n=this.n&&this.p.div(this.n);!n||n.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function c(e,t){this.curve=e,this.type=t,this.precomputed=null}I(a,"BaseCurve"),t.exports=a,a.prototype.point=I((function(){throw new Error("Not implemented")}),"point"),a.prototype.validate=I((function(){throw new Error("Not implemented")}),"validate"),a.prototype._fixedNafMul=I((function(e,t){s(e.precomputed);var r=e._getDoubles(),n=i(t,1,this._bitLength),o=(1<<r.step+1)-(r.step%2==0?2:1);o/=3;var a,c,u=[];for(a=0;a<n.length;a+=r.step){c=0;for(var l=a+r.step-1;l>=a;l--)c=(c<<1)+n[l];u.push(c)}for(var d=this.jpoint(null,null,null),f=this.jpoint(null,null,null),h=o;h>0;h--){for(a=0;a<u.length;a++)(c=u[a])===h?f=f.mixedAdd(r.points[a]):c===-h&&(f=f.mixedAdd(r.points[a].neg()));d=d.add(f)}return d.toP()}),"_fixedNafMul"),a.prototype._wnafMul=I((function(e,t){var r=4,n=e._getNAFPoints(r);r=n.wnd;for(var o=n.points,a=i(t,r,this._bitLength),c=this.jpoint(null,null,null),u=a.length-1;u>=0;u--){for(var l=0;u>=0&&0===a[u];u--)l++;if(u>=0&&l++,c=c.dblp(l),u<0)break;var d=a[u];s(0!==d),c="affine"===e.type?d>0?c.mixedAdd(o[d-1>>1]):c.mixedAdd(o[-d-1>>1].neg()):d>0?c.add(o[d-1>>1]):c.add(o[-d-1>>1].neg())}return"affine"===e.type?c.toP():c}),"_wnafMul"),a.prototype._wnafMulAdd=I((function(e,t,r,n,s){var a,c,u,l=this._wnafT1,d=this._wnafT2,f=this._wnafT3,h=0;for(a=0;a<n;a++){var p=(u=t[a])._getNAFPoints(e);l[a]=p.wnd,d[a]=p.points}for(a=n-1;a>=1;a-=2){var m=a-1,g=a;if(1===l[m]&&1===l[g]){var b=[t[m],null,null,t[g]];0===t[m].y.cmp(t[g].y)?(b[1]=t[m].add(t[g]),b[2]=t[m].toJ().mixedAdd(t[g].neg())):0===t[m].y.cmp(t[g].y.redNeg())?(b[1]=t[m].toJ().mixedAdd(t[g]),b[2]=t[m].add(t[g].neg())):(b[1]=t[m].toJ().mixedAdd(t[g]),b[2]=t[m].toJ().mixedAdd(t[g].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],v=o(r[m],r[g]);for(h=Math.max(v[0].length,h),f[m]=new Array(h),f[g]=new Array(h),c=0;c<h;c++){var w=0|v[0][c],A=0|v[1][c];f[m][c]=y[3*(w+1)+(A+1)],f[g][c]=0,d[m]=b}}else f[m]=i(r[m],l[m],this._bitLength),f[g]=i(r[g],l[g],this._bitLength),h=Math.max(f[m].length,h),h=Math.max(f[g].length,h)}var E=this.jpoint(null,null,null),S=this._wnafT4;for(a=h;a>=0;a--){for(var x=0;a>=0;){var M=!0;for(c=0;c<n;c++)S[c]=0|f[c][a],0!==S[c]&&(M=!1);if(!M)break;x++,a--}if(a>=0&&x++,E=E.dblp(x),a<0)break;for(c=0;c<n;c++){var _=S[c];0!==_&&(_>0?u=d[c][_-1>>1]:_<0&&(u=d[c][-_-1>>1].neg()),E="affine"===u.type?E.mixedAdd(u):E.add(u))}}for(a=0;a<n;a++)d[a]=null;return s?E:E.toP()}),"_wnafMulAdd"),I(c,"BasePoint"),a.BasePoint=c,c.prototype.eq=I((function(){throw new Error("Not implemented")}),"eq"),c.prototype.validate=I((function(){return this.curve.validate(this)}),"validate"),a.prototype.decodePoint=I((function(e,t){e=n.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?s(e[e.length-1]%2==0):7===e[0]&&s(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")}),"decodePoint"),c.prototype.encodeCompressed=I((function(e){return this.encode(e,!0)}),"encodeCompressed"),c.prototype._encode=I((function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))}),"_encode"),c.prototype.encode=I((function(e,t){return n.encode(this._encode(t),e)}),"encode"),c.prototype.precompute=I((function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this}),"precompute"),c.prototype._hasDoubles=I((function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)}),"_hasDoubles"),c.prototype._getDoubles=I((function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<t;i+=e){for(var o=0;o<e;o++)n=n.dbl();r.push(n)}return{step:e,points:r}}),"_getDoubles"),c.prototype._getNAFPoints=I((function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)t[i]=t[i-1].add(n);return{wnd:e,points:t}}),"_getNAFPoints"),c.prototype._getBeta=I((function(){return null}),"_getBeta"),c.prototype.dblp=I((function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t}),"dblp")}}),Pr=j({"../../node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits_browser.js"(e,t){"function"==typeof Object.create?t.exports=I((function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}),"inherits"):t.exports=I((function(e,t){if(t){e.super_=t;var r=I((function(){}),"TempCtor");r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}),"inherits")}}),Rr=j({"../../node_modules/.pnpm/elliptic@6.5.4/node_modules/elliptic/lib/elliptic/curve/short.js"(e,t){var r=Dr(),n=Ir(),i=Pr(),o=Lr(),s=r.assert;function a(e){o.call(this,"short",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function c(e,t,r,i){o.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new n(t,16),this.y=new n(r,16),i&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function u(e,t,r,i){o.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===i?(this.x=this.curve.one,this.y=this.curve.one,this.z=new n(0)):(this.x=new n(t,16),this.y=new n(r,16),this.z=new n(i,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}I(a,"ShortCurve"),i(a,o),t.exports=a,a.prototype._getEndomorphism=I((function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new n(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);t=(t=i[0].cmp(i[1])<0?i[0]:i[1]).toRed(this.red)}if(e.lambda)r=new n(e.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(t))?r=o[0]:(r=o[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new n(e.a,16),b:new n(e.b,16)}})):this._getEndoBasis(r)}}}),"_getEndomorphism"),a.prototype._getEndoRoots=I((function(e){var t=e===this.p?this.red:n.mont(e),r=new n(2).toRed(t).redInvm(),i=r.redNeg(),o=new n(3).toRed(t).redNeg().redSqrt().redMul(r);return[i.redAdd(o).fromRed(),i.redSub(o).fromRed()]}),"_getEndoRoots"),a.prototype._getEndoBasis=I((function(e){for(var t,r,i,o,s,a,c,u,l,d=this.n.ushrn(Math.floor(this.n.bitLength()/2)),f=e,h=this.n.clone(),p=new n(1),m=new n(0),g=new n(0),b=new n(1),y=0;0!==f.cmpn(0);){var v=h.div(f);u=h.sub(v.mul(f)),l=g.sub(v.mul(p));var w=b.sub(v.mul(m));if(!i&&u.cmp(d)<0)t=c.neg(),r=p,i=u.neg(),o=l;else if(i&&2==++y)break;c=u,h=f,f=u,g=p,p=l,b=m,m=w}s=u.neg(),a=l;var A=i.sqr().add(o.sqr());return s.sqr().add(a.sqr()).cmp(A)>=0&&(s=t,a=r),i.negative&&(i=i.neg(),o=o.neg()),s.negative&&(s=s.neg(),a=a.neg()),[{a:i,b:o},{a:s,b:a}]}),"_getEndoBasis"),a.prototype._endoSplit=I((function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),s=i.mul(r.a),a=o.mul(n.a),c=i.mul(r.b),u=o.mul(n.b);return{k1:e.sub(s).sub(a),k2:c.add(u).neg()}}),"_endoSplit"),a.prototype.pointFromX=I((function(e,t){(e=new n(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(0!==i.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=i.fromRed().isOdd();return(t&&!o||!t&&o)&&(i=i.redNeg()),this.point(e,i)}),"pointFromX"),a.prototype.validate=I((function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)}),"validate"),a.prototype._endoWnafMulAdd=I((function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<e.length;o++){var s=this._endoSplit(t[o]),a=e[o],c=a._getBeta();s.k1.negative&&(s.k1.ineg(),a=a.neg(!0)),s.k2.negative&&(s.k2.ineg(),c=c.neg(!0)),n[2*o]=a,n[2*o+1]=c,i[2*o]=s.k1,i[2*o+1]=s.k2}for(var u=this._wnafMulAdd(1,n,i,2*o,r),l=0;l<2*o;l++)n[l]=null,i[l]=null;return u}),"_endoWnafMulAdd"),I(c,"Point"),i(c,o.BasePoint),a.prototype.point=I((function(e,t,r){return new c(this,e,t,r)}),"point"),a.prototype.pointFromJSON=I((function(e,t){return c.fromJSON(this,e,t)}),"pointFromJSON"),c.prototype._getBeta=I((function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,n=I((function(e){return r.point(e.x.redMul(r.endo.beta),e.y)}),"endoMul");e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}}),"_getBeta"),c.prototype.toJSON=I((function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]}),"toJSON"),c.fromJSON=I((function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function i(t){return e.point(t[0],t[1],r)}I(i,"obj2point");var o=t[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n}),"fromJSON"),c.prototype.inspect=I((function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"}),"inspect"),c.prototype.isInfinity=I((function(){return this.inf}),"isInfinity"),c.prototype.add=I((function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)}),"add"),c.prototype.dbl=I((function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),s=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)}),"dbl"),c.prototype.getX=I((function(){return this.x.fromRed()}),"getX"),c.prototype.getY=I((function(){return this.y.fromRed()}),"getY"),c.prototype.mul=I((function(e){return e=new n(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)}),"mul"),c.prototype.mulAdd=I((function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)}),"mulAdd"),c.prototype.jmulAdd=I((function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)}),"jmulAdd"),c.prototype.eq=I((function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))}),"eq"),c.prototype.neg=I((function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=I((function(e){return e.neg()}),"negate");t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t}),"neg"),c.prototype.toJ=I((function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)}),"toJ"),I(u,"JPoint"),i(u,o.BasePoint),a.prototype.jpoint=I((function(e,t,r){return new u(this,e,t,r)}),"jpoint"),u.prototype.toP=I((function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)}),"toP"),u.prototype.neg=I((function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)}),"neg"),u.prototype.add=I((function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),s=e.y.redMul(r.redMul(this.z)),a=n.redSub(i),c=o.redSub(s);if(0===a.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),l=u.redMul(a),d=n.redMul(u),f=c.redSqr().redIAdd(l).redISub(d).redISub(d),h=c.redMul(d.redISub(f)).redISub(o.redMul(l)),p=this.z.redMul(e.z).redMul(a);return this.curve.jpoint(f,h,p)}),"add"),u.prototype.mixedAdd=I((function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),s=r.redSub(n),a=i.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),u=c.redMul(s),l=r.redMul(c),d=a.redSqr().redIAdd(u).redISub(l).redISub(l),f=a.redMul(l.redISub(d)).redISub(i.redMul(u)),h=this.z.redMul(s);return this.curve.jpoint(d,f,h)}),"mixedAdd"),u.prototype.dblp=I((function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,o=this.x,s=this.y,a=this.z,c=a.redSqr().redSqr(),u=s.redAdd(s);for(t=0;t<e;t++){var l=o.redSqr(),d=u.redSqr(),f=d.redSqr(),h=l.redAdd(l).redIAdd(l).redIAdd(n.redMul(c)),p=o.redMul(d),m=h.redSqr().redISub(p.redAdd(p)),g=p.redISub(m),b=h.redMul(g);b=b.redIAdd(b).redISub(f);var y=u.redMul(a);t+1<e&&(c=c.redMul(f)),o=m,a=y,u=b}return this.curve.jpoint(o,u.redMul(i),a)}),"dblp"),u.prototype.dbl=I((function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()}),"dbl"),u.prototype._zeroDbl=I((function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n),c=a.redSqr().redISub(s).redISub(s),u=o.redIAdd(o);u=(u=u.redIAdd(u)).redIAdd(u),e=c,t=a.redMul(s.redISub(c)).redISub(u),r=this.y.redAdd(this.y)}else{var l=this.x.redSqr(),d=this.y.redSqr(),f=d.redSqr(),h=this.x.redAdd(d).redSqr().redISub(l).redISub(f);h=h.redIAdd(h);var p=l.redAdd(l).redIAdd(l),m=p.redSqr(),g=f.redIAdd(f);g=(g=g.redIAdd(g)).redIAdd(g),e=m.redISub(h).redISub(h),t=p.redMul(h.redISub(e)).redISub(g),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)}),"_zeroDbl"),u.prototype._threeDbl=I((function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),c=a.redSqr().redISub(s).redISub(s);e=c;var u=o.redIAdd(o);u=(u=u.redIAdd(u)).redIAdd(u),t=a.redMul(s.redISub(c)).redISub(u),r=this.y.redAdd(this.y)}else{var l=this.z.redSqr(),d=this.y.redSqr(),f=this.x.redMul(d),h=this.x.redSub(l).redMul(this.x.redAdd(l));h=h.redAdd(h).redIAdd(h);var p=f.redIAdd(f),m=(p=p.redIAdd(p)).redAdd(p);e=h.redSqr().redISub(m),r=this.y.redAdd(this.z).redSqr().redISub(d).redISub(l);var g=d.redSqr();g=(g=(g=g.redIAdd(g)).redIAdd(g)).redIAdd(g),t=h.redMul(p.redISub(e)).redISub(g)}return this.curve.jpoint(e,t,r)}),"_threeDbl"),u.prototype._dbl=I((function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=t.redSqr(),s=r.redSqr(),a=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(i)),c=t.redAdd(t),u=(c=c.redIAdd(c)).redMul(s),l=a.redSqr().redISub(u.redAdd(u)),d=u.redISub(l),f=s.redSqr();f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var h=a.redMul(d).redISub(f),p=r.redAdd(r).redMul(n);return this.curve.jpoint(l,h,p)}),"_dbl"),u.prototype.trpl=I((function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),i=e.redAdd(e).redIAdd(e),o=i.redSqr(),s=this.x.redAdd(t).redSqr().redISub(e).redISub(n),a=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(o)).redSqr(),c=n.redIAdd(n);c=(c=(c=c.redIAdd(c)).redIAdd(c)).redIAdd(c);var u=i.redIAdd(s).redSqr().redISub(o).redISub(a).redISub(c),l=t.redMul(u);l=(l=l.redIAdd(l)).redIAdd(l);var d=this.x.redMul(a).redISub(l);d=(d=d.redIAdd(d)).redIAdd(d);var f=this.y.redMul(u.redMul(c.redISub(u)).redISub(s.redMul(a)));f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var h=this.z.redAdd(s).redSqr().redISub(r).redISub(a);return this.curve.jpoint(d,f,h)}),"trpl"),u.prototype.mul=I((function(e,t){return e=new n(e,t),this.curve._wnafMul(this,e)}),"mul"),u.prototype.eq=I((function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),i=r.redMul(e.z);return 0===this.y.redMul(i).redISub(e.y.redMul(n)).cmpn(0)}),"eq"),u.prototype.eqXToP=I((function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),i=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}}),"eqXToP"),u.prototype.inspect=I((function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"}),"inspect"),u.prototype.isInfinity=I((function(){return 0===this.z.cmpn(0)}),"isInfinity")}}),Ur=j({"../../node_modules/.pnpm/elliptic@6.5.4/node_modules/elliptic/lib/elliptic/curve/mont.js"(e,t){var r=Ir(),n=Pr(),i=Lr(),o=Dr();function s(e){i.call(this,"mont",e),this.a=new r(e.a,16).toRed(this.red),this.b=new r(e.b,16).toRed(this.red),this.i4=new r(4).toRed(this.red).redInvm(),this.two=new r(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function a(e,t,n){i.BasePoint.call(this,e,"projective"),null===t&&null===n?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new r(t,16),this.z=new r(n,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}I(s,"MontCurve"),n(s,i),t.exports=s,s.prototype.validate=I((function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)}),"validate"),I(a,"Point"),n(a,i.BasePoint),s.prototype.decodePoint=I((function(e,t){return this.point(o.toArray(e,t),1)}),"decodePoint"),s.prototype.point=I((function(e,t){return new a(this,e,t)}),"point"),s.prototype.pointFromJSON=I((function(e){return a.fromJSON(this,e)}),"pointFromJSON"),a.prototype.precompute=I((function(){}),"precompute"),a.prototype._encode=I((function(){return this.getX().toArray("be",this.curve.p.byteLength())}),"_encode"),a.fromJSON=I((function(e,t){return new a(e,t[0],t[1]||e.one)}),"fromJSON"),a.prototype.inspect=I((function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"}),"inspect"),a.prototype.isInfinity=I((function(){return 0===this.z.cmpn(0)}),"isInfinity"),a.prototype.dbl=I((function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)}),"dbl"),a.prototype.add=I((function(){throw new Error("Not supported on Montgomery curve")}),"add"),a.prototype.diffAdd=I((function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),s=i.redMul(n),a=t.z.redMul(o.redAdd(s).redSqr()),c=t.x.redMul(o.redISub(s).redSqr());return this.curve.point(a,c)}),"diffAdd"),a.prototype.mul=I((function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n}),"mul"),a.prototype.mulAdd=I((function(){throw new Error("Not supported on Montgomery curve")}),"mulAdd"),a.prototype.jumlAdd=I((function(){throw new Error("Not supported on Montgomery curve")}),"jumlAdd"),a.prototype.eq=I((function(e){return 0===this.getX().cmp(e.getX())}),"eq"),a.prototype.normalize=I((function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this}),"normalize"),a.prototype.getX=I((function(){return this.normalize(),this.x.fromRed()}),"getX")}}),zr=j({"../../node_modules/.pnpm/elliptic@6.5.4/node_modules/elliptic/lib/elliptic/curve/edwards.js"(e,t){var r=Dr(),n=Ir(),i=Pr(),o=Lr(),s=r.assert;function a(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,o.call(this,"edwards",e),this.a=new n(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new n(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new n(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),s(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function c(e,t,r,i,s){o.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===i?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new n(t,16),this.y=new n(r,16),this.z=i?new n(i,16):this.curve.one,this.t=s&&new n(s,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}I(a,"EdwardsCurve"),i(a,o),t.exports=a,a.prototype._mulA=I((function(e){return this.mOneA?e.redNeg():this.a.redMul(e)}),"_mulA"),a.prototype._mulC=I((function(e){return this.oneC?e:this.c.redMul(e)}),"_mulC"),a.prototype.jpoint=I((function(e,t,r,n){return this.point(e,t,r,n)}),"jpoint"),a.prototype.pointFromX=I((function(e,t){(e=new n(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),i=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),s=i.redMul(o.redInvm()),a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");var c=a.fromRed().isOdd();return(t&&!c||!t&&c)&&(a=a.redNeg()),this.point(e,a)}),"pointFromX"),a.prototype.pointFromY=I((function(e,t){(e=new n(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),i=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),s=i.redMul(o.redInvm());if(0===s.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==t&&(a=a.redNeg()),this.point(a,e)}),"pointFromY"),a.prototype.validate=I((function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)}),"validate"),I(c,"Point"),i(c,o.BasePoint),a.prototype.pointFromJSON=I((function(e){return c.fromJSON(this,e)}),"pointFromJSON"),a.prototype.point=I((function(e,t,r,n){return new c(this,e,t,r,n)}),"point"),c.fromJSON=I((function(e,t){return new c(e,t[0],t[1],t[2])}),"fromJSON"),c.prototype.inspect=I((function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"}),"inspect"),c.prototype.isInfinity=I((function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))}),"isInfinity"),c.prototype._extDbl=I((function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=n.redAdd(t),s=o.redSub(r),a=n.redSub(t),c=i.redMul(s),u=o.redMul(a),l=i.redMul(a),d=s.redMul(o);return this.curve.point(c,u,d,l)}),"_extDbl"),c.prototype._projDbl=I((function(){var e,t,r,n,i,o,s=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),c=this.y.redSqr();if(this.curve.twisted){var u=(n=this.curve._mulA(a)).redAdd(c);this.zOne?(e=s.redSub(a).redSub(c).redMul(u.redSub(this.curve.two)),t=u.redMul(n.redSub(c)),r=u.redSqr().redSub(u).redSub(u)):(i=this.z.redSqr(),o=u.redSub(i).redISub(i),e=s.redSub(a).redISub(c).redMul(o),t=u.redMul(n.redSub(c)),r=u.redMul(o))}else n=a.redAdd(c),i=this.curve._mulC(this.z).redSqr(),o=n.redSub(i).redSub(i),e=this.curve._mulC(s.redISub(n)).redMul(o),t=this.curve._mulC(n).redMul(a.redISub(c)),r=n.redMul(o);return this.curve.point(e,t,r)}),"_projDbl"),c.prototype.dbl=I((function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()}),"dbl"),c.prototype._extAdd=I((function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),s=i.redSub(n),a=i.redAdd(n),c=r.redAdd(t),u=o.redMul(s),l=a.redMul(c),d=o.redMul(c),f=s.redMul(a);return this.curve.point(u,l,f,d)}),"_extAdd"),c.prototype._projAdd=I((function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),o=this.x.redMul(e.x),s=this.y.redMul(e.y),a=this.curve.d.redMul(o).redMul(s),c=i.redSub(a),u=i.redAdd(a),l=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(s),d=n.redMul(c).redMul(l);return this.curve.twisted?(t=n.redMul(u).redMul(s.redSub(this.curve._mulA(o))),r=c.redMul(u)):(t=n.redMul(u).redMul(s.redSub(o)),r=this.curve._mulC(c).redMul(u)),this.curve.point(d,t,r)}),"_projAdd"),c.prototype.add=I((function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)}),"add"),c.prototype.mul=I((function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)}),"mul"),c.prototype.mulAdd=I((function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)}),"mulAdd"),c.prototype.jmulAdd=I((function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)}),"jmulAdd"),c.prototype.normalize=I((function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this}),"normalize"),c.prototype.neg=I((function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())}),"neg"),c.prototype.getX=I((function(){return this.normalize(),this.x.fromRed()}),"getX"),c.prototype.getY=I((function(){return this.normalize(),this.y.fromRed()}),"getY"),c.prototype.eq=I((function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())}),"eq"),c.prototype.eqXToP=I((function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}}),"eqXToP"),c.prototype.toP=c.prototype.normalize,c.prototype.mixedAdd=c.prototype.add}}),Kr=j({"../../node_modules/.pnpm/elliptic@6.5.4/node_modules/elliptic/lib/elliptic/curve/index.js"(e){var t=e;t.base=Lr(),t.short=Rr(),t.mont=Ur(),t.edwards=zr()}}),Fr=j({"../../node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash/utils.js"(e){var t=Br(),r=Pr();function n(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function i(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),o=0;o<e.length;o+=2)r.push(parseInt(e[o]+e[o+1],16))}else for(var i=0,o=0;o<e.length;o++){var s=e.charCodeAt(o);s<128?r[i++]=s:s<2048?(r[i++]=s>>6|192,r[i++]=63&s|128):n(e,o)?(s=65536+((1023&s)<<10)+(1023&e.charCodeAt(++o)),r[i++]=s>>18|240,r[i++]=s>>12&63|128,r[i++]=s>>6&63|128,r[i++]=63&s|128):(r[i++]=s>>12|224,r[i++]=s>>6&63|128,r[i++]=63&s|128)}else for(o=0;o<e.length;o++)r[o]=0|e[o];return r}function o(e){for(var t="",r=0;r<e.length;r++)t+=c(e[r].toString(16));return t}function s(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function a(e,t){for(var r="",n=0;n<e.length;n++){var i=e[n];"little"===t&&(i=s(i)),r+=u(i.toString(16))}return r}function c(e){return 1===e.length?"0"+e:e}function u(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}function l(e,r,n,i){var o=n-r;t(o%4==0);for(var s=new Array(o/4),a=0,c=r;a<s.length;a++,c+=4){var u;u="big"===i?e[c]<<24|e[c+1]<<16|e[c+2]<<8|e[c+3]:e[c+3]<<24|e[c+2]<<16|e[c+1]<<8|e[c],s[a]=u>>>0}return s}function d(e,t){for(var r=new Array(4*e.length),n=0,i=0;n<e.length;n++,i+=4){var o=e[n];"big"===t?(r[i]=o>>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r}function f(e,t){return e>>>t|e<<32-t}function h(e,t){return e<<t|e>>>32-t}function p(e,t){return e+t>>>0}function m(e,t,r){return e+t+r>>>0}function g(e,t,r,n){return e+t+r+n>>>0}function b(e,t,r,n,i){return e+t+r+n+i>>>0}function y(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0,s=(o<n?1:0)+r+i;e[t]=s>>>0,e[t+1]=o}function v(e,t,r,n){return(t+n>>>0<t?1:0)+e+r>>>0}function w(e,t,r,n){return t+n>>>0}function A(e,t,r,n,i,o,s,a){var c=0,u=t;return c+=(u=u+n>>>0)<t?1:0,c+=(u=u+o>>>0)<o?1:0,e+r+i+s+(c+=(u=u+a>>>0)<a?1:0)>>>0}function E(e,t,r,n,i,o,s,a){return t+n+o+a>>>0}function S(e,t,r,n,i,o,s,a,c,u){var l=0,d=t;return l+=(d=d+n>>>0)<t?1:0,l+=(d=d+o>>>0)<o?1:0,l+=(d=d+a>>>0)<a?1:0,e+r+i+s+c+(l+=(d=d+u>>>0)<u?1:0)>>>0}function x(e,t,r,n,i,o,s,a,c,u){return t+n+o+a+u>>>0}function M(e,t,r){return(t<<32-r|e>>>r)>>>0}function _(e,t,r){return(e<<32-r|t>>>r)>>>0}function k(e,t,r){return e>>>r}function T(e,t,r){return(e<<32-r|t>>>r)>>>0}e.inherits=r,I(n,"isSurrogatePair"),I(i,"toArray"),e.toArray=i,I(o,"toHex"),e.toHex=o,I(s,"htonl"),e.htonl=s,I(a,"toHex32"),e.toHex32=a,I(c,"zero2"),e.zero2=c,I(u,"zero8"),e.zero8=u,I(l,"join32"),e.join32=l,I(d,"split32"),e.split32=d,I(f,"rotr32"),e.rotr32=f,I(h,"rotl32"),e.rotl32=h,I(p,"sum32"),e.sum32=p,I(m,"sum32_3"),e.sum32_3=m,I(g,"sum32_4"),e.sum32_4=g,I(b,"sum32_5"),e.sum32_5=b,I(y,"sum64"),e.sum64=y,I(v,"sum64_hi"),e.sum64_hi=v,I(w,"sum64_lo"),e.sum64_lo=w,I(A,"sum64_4_hi"),e.sum64_4_hi=A,I(E,"sum64_4_lo"),e.sum64_4_lo=E,I(S,"sum64_5_hi"),e.sum64_5_hi=S,I(x,"sum64_5_lo"),e.sum64_5_lo=x,I(M,"rotr64_hi"),e.rotr64_hi=M,I(_,"rotr64_lo"),e.rotr64_lo=_,I(k,"shr64_hi"),e.shr64_hi=k,I(T,"shr64_lo"),e.shr64_lo=T}}),Hr=j({"../../node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash/common.js"(e){var t=Fr(),r=Br();function n(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}I(n,"BlockHash"),e.BlockHash=n,n.prototype.update=I((function(e,r){if(e=t.toArray(e,r),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var n=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-n,e.length),0===this.pending.length&&(this.pending=null),e=t.join32(e,0,e.length-n,this.endian);for(var i=0;i<e.length;i+=this._delta32)this._update(e,i,i+this._delta32)}return this}),"update"),n.prototype.digest=I((function(e){return this.update(this._pad()),r(null===this.pending),this._digest(e)}),"digest"),n.prototype._pad=I((function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(e<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=e>>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o<this.padLength;o++)n[i++]=0;return n}),"pad")}}),$r=j({"../../node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash/sha/common.js"(e){var t=Fr().rotr32;function r(e,t,r,s){return 0===e?n(t,r,s):1===e||3===e?o(t,r,s):2===e?i(t,r,s):void 0}function n(e,t,r){return e&t^~e&r}function i(e,t,r){return e&t^e&r^t&r}function o(e,t,r){return e^t^r}function s(e){return t(e,2)^t(e,13)^t(e,22)}function a(e){return t(e,6)^t(e,11)^t(e,25)}function c(e){return t(e,7)^t(e,18)^e>>>3}function u(e){return t(e,17)^t(e,19)^e>>>10}I(r,"ft_1"),e.ft_1=r,I(n,"ch32"),e.ch32=n,I(i,"maj32"),e.maj32=i,I(o,"p32"),e.p32=o,I(s,"s0_256"),e.s0_256=s,I(a,"s1_256"),e.s1_256=a,I(c,"g0_256"),e.g0_256=c,I(u,"g1_256"),e.g1_256=u}}),Vr=j({"../../node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash/sha/1.js"(e,t){var r=Fr(),n=Hr(),i=$r(),o=r.rotl32,s=r.sum32,a=r.sum32_5,c=i.ft_1,u=n.BlockHash,l=[1518500249,1859775393,2400959708,3395469782];function d(){if(!(this instanceof d))return new d;u.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}I(d,"SHA1"),r.inherits(d,u),t.exports=d,d.blockSize=512,d.outSize=160,d.hmacStrength=80,d.padLength=64,d.prototype._update=I((function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=o(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],u=this.h[1],d=this.h[2],f=this.h[3],h=this.h[4];for(n=0;n<r.length;n++){var p=~~(n/20),m=a(o(i,5),c(p,u,d,f),h,r[n],l[p]);h=f,f=d,d=o(u,30),u=i,i=m}this.h[0]=s(this.h[0],i),this.h[1]=s(this.h[1],u),this.h[2]=s(this.h[2],d),this.h[3]=s(this.h[3],f),this.h[4]=s(this.h[4],h)}),"_update"),d.prototype._digest=I((function(e){return"hex"===e?r.toHex32(this.h,"big"):r.split32(this.h,"big")}),"digest")}}),qr=j({"../../node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash/sha/256.js"(e,t){var r=Fr(),n=Hr(),i=$r(),o=Br(),s=r.sum32,a=r.sum32_4,c=r.sum32_5,u=i.ch32,l=i.maj32,d=i.s0_256,f=i.s1_256,h=i.g0_256,p=i.g1_256,m=n.BlockHash,g=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function b(){if(!(this instanceof b))return new b;m.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=g,this.W=new Array(64)}I(b,"SHA256"),r.inherits(b,m),t.exports=b,b.blockSize=512,b.outSize=256,b.hmacStrength=192,b.padLength=64,b.prototype._update=I((function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=a(p(r[n-2]),r[n-7],h(r[n-15]),r[n-16]);var i=this.h[0],m=this.h[1],g=this.h[2],b=this.h[3],y=this.h[4],v=this.h[5],w=this.h[6],A=this.h[7];for(o(this.k.length===r.length),n=0;n<r.length;n++){var E=c(A,f(y),u(y,v,w),this.k[n],r[n]),S=s(d(i),l(i,m,g));A=w,w=v,v=y,y=s(b,E),b=g,g=m,m=i,i=s(E,S)}this.h[0]=s(this.h[0],i),this.h[1]=s(this.h[1],m),this.h[2]=s(this.h[2],g),this.h[3]=s(this.h[3],b),this.h[4]=s(this.h[4],y),this.h[5]=s(this.h[5],v),this.h[6]=s(this.h[6],w),this.h[7]=s(this.h[7],A)}),"_update"),b.prototype._digest=I((function(e){return"hex"===e?r.toHex32(this.h,"big"):r.split32(this.h,"big")}),"digest")}}),Gr=j({"../../node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash/sha/224.js"(e,t){var r=Fr(),n=qr();function i(){if(!(this instanceof i))return new i;n.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}I(i,"SHA224"),r.inherits(i,n),t.exports=i,i.blockSize=512,i.outSize=224,i.hmacStrength=192,i.padLength=64,i.prototype._digest=I((function(e){return"hex"===e?r.toHex32(this.h.slice(0,7),"big"):r.split32(this.h.slice(0,7),"big")}),"digest")}}),Yr=j({"../../node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash/sha/512.js"(e,t){var r=Fr(),n=Hr(),i=Br(),o=r.rotr64_hi,s=r.rotr64_lo,a=r.shr64_hi,c=r.shr64_lo,u=r.sum64,l=r.sum64_hi,d=r.sum64_lo,f=r.sum64_4_hi,h=r.sum64_4_lo,p=r.sum64_5_hi,m=r.sum64_5_lo,g=n.BlockHash,b=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function y(){if(!(this instanceof y))return new y;g.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=b,this.W=new Array(160)}function v(e,t,r,n,i){var o=e&r^~e&i;return o<0&&(o+=4294967296),o}function w(e,t,r,n,i,o){var s=t&n^~t&o;return s<0&&(s+=4294967296),s}function A(e,t,r,n,i){var o=e&r^e&i^r&i;return o<0&&(o+=4294967296),o}function E(e,t,r,n,i,o){var s=t&n^t&o^n&o;return s<0&&(s+=4294967296),s}function S(e,t){var r=o(e,t,28)^o(t,e,2)^o(t,e,7);return r<0&&(r+=4294967296),r}function x(e,t){var r=s(e,t,28)^s(t,e,2)^s(t,e,7);return r<0&&(r+=4294967296),r}function M(e,t){var r=o(e,t,14)^o(e,t,18)^o(t,e,9);return r<0&&(r+=4294967296),r}function _(e,t){var r=s(e,t,14)^s(e,t,18)^s(t,e,9);return r<0&&(r+=4294967296),r}function k(e,t){var r=o(e,t,1)^o(e,t,8)^a(e,t,7);return r<0&&(r+=4294967296),r}function T(e,t){var r=s(e,t,1)^s(e,t,8)^c(e,t,7);return r<0&&(r+=4294967296),r}function C(e,t){var r=o(e,t,19)^o(t,e,29)^a(e,t,6);return r<0&&(r+=4294967296),r}function N(e,t){var r=s(e,t,19)^s(t,e,29)^c(e,t,6);return r<0&&(r+=4294967296),r}I(y,"SHA512"),r.inherits(y,g),t.exports=y,y.blockSize=1024,y.outSize=512,y.hmacStrength=192,y.padLength=128,y.prototype._prepareBlock=I((function(e,t){for(var r=this.W,n=0;n<32;n++)r[n]=e[t+n];for(;n<r.length;n+=2){var i=C(r[n-4],r[n-3]),o=N(r[n-4],r[n-3]),s=r[n-14],a=r[n-13],c=k(r[n-30],r[n-29]),u=T(r[n-30],r[n-29]),l=r[n-32],d=r[n-31];r[n]=f(i,o,s,a,c,u,l,d),r[n+1]=h(i,o,s,a,c,u,l,d)}}),"_prepareBlock"),y.prototype._update=I((function(e,t){this._prepareBlock(e,t);var r=this.W,n=this.h[0],o=this.h[1],s=this.h[2],a=this.h[3],c=this.h[4],f=this.h[5],h=this.h[6],g=this.h[7],b=this.h[8],y=this.h[9],k=this.h[10],T=this.h[11],C=this.h[12],N=this.h[13],I=this.h[14],B=this.h[15];i(this.k.length===r.length);for(var O=0;O<r.length;O+=2){var D=I,j=B,L=M(b,y),P=_(b,y),R=v(b,y,k,T,C),U=w(b,y,k,T,C,N),z=this.k[O],K=this.k[O+1],F=r[O],H=r[O+1],$=p(D,j,L,P,R,U,z,K,F,H),V=m(D,j,L,P,R,U,z,K,F,H);D=S(n,o),j=x(n,o),L=A(n,o,s,a,c),P=E(n,o,s,a,c,f);var q=l(D,j,L,P),G=d(D,j,L,P);I=C,B=N,C=k,N=T,k=b,T=y,b=l(h,g,$,V),y=d(g,g,$,V),h=c,g=f,c=s,f=a,s=n,a=o,n=l($,V,q,G),o=d($,V,q,G)}u(this.h,0,n,o),u(this.h,2,s,a),u(this.h,4,c,f),u(this.h,6,h,g),u(this.h,8,b,y),u(this.h,10,k,T),u(this.h,12,C,N),u(this.h,14,I,B)}),"_update"),y.prototype._digest=I((function(e){return"hex"===e?r.toHex32(this.h,"big"):r.split32(this.h,"big")}),"digest"),I(v,"ch64_hi"),I(w,"ch64_lo"),I(A,"maj64_hi"),I(E,"maj64_lo"),I(S,"s0_512_hi"),I(x,"s0_512_lo"),I(M,"s1_512_hi"),I(_,"s1_512_lo"),I(k,"g0_512_hi"),I(T,"g0_512_lo"),I(C,"g1_512_hi"),I(N,"g1_512_lo")}}),Jr=j({"../../node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash/sha/384.js"(e,t){var r=Fr(),n=Yr();function i(){if(!(this instanceof i))return new i;n.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}I(i,"SHA384"),r.inherits(i,n),t.exports=i,i.blockSize=1024,i.outSize=384,i.hmacStrength=192,i.padLength=128,i.prototype._digest=I((function(e){return"hex"===e?r.toHex32(this.h.slice(0,12),"big"):r.split32(this.h.slice(0,12),"big")}),"digest")}}),Qr=j({"../../node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash/sha.js"(e){e.sha1=Vr(),e.sha224=Gr(),e.sha256=qr(),e.sha384=Jr(),e.sha512=Yr()}}),Wr=j({"../../node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash/ripemd.js"(e){var t=Fr(),r=Hr(),n=t.rotl32,i=t.sum32,o=t.sum32_3,s=t.sum32_4,a=r.BlockHash;function c(){if(!(this instanceof c))return new c;a.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function u(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function l(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function d(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}I(c,"RIPEMD160"),t.inherits(c,a),e.ripemd160=c,c.blockSize=512,c.outSize=160,c.hmacStrength=192,c.padLength=64,c.prototype._update=I((function(e,t){for(var r=this.h[0],a=this.h[1],c=this.h[2],g=this.h[3],b=this.h[4],y=r,v=a,w=c,A=g,E=b,S=0;S<80;S++){var x=i(n(s(r,u(S,a,c,g),e[f[S]+t],l(S)),p[S]),b);r=b,b=g,g=n(c,10),c=a,a=x,x=i(n(s(y,u(79-S,v,w,A),e[h[S]+t],d(S)),m[S]),E),y=E,E=A,A=n(w,10),w=v,v=x}x=o(this.h[1],c,A),this.h[1]=o(this.h[2],g,E),this.h[2]=o(this.h[3],b,y),this.h[3]=o(this.h[4],r,v),this.h[4]=o(this.h[0],a,w),this.h[0]=x}),"update"),c.prototype._digest=I((function(e){return"hex"===e?t.toHex32(this.h,"little"):t.split32(this.h,"little")}),"digest"),I(u,"f"),I(l,"K"),I(d,"Kh");var f=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],h=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],p=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],m=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]}}),Xr=j({"../../node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash/hmac.js"(e,t){var r=Fr(),n=Br();function i(e,t,n){if(!(this instanceof i))return new i(e,t,n);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(r.toArray(t,n))}I(i,"Hmac"),t.exports=i,i.prototype._init=I((function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),n(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)}),"init"),i.prototype.update=I((function(e,t){return this.inner.update(e,t),this}),"update"),i.prototype.digest=I((function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)}),"digest")}}),Zr=j({"../../node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash.js"(e){var t=e;t.utils=Fr(),t.common=Hr(),t.sha=Qr(),t.ripemd=Wr(),t.hmac=Xr(),t.sha1=t.sha.sha1,t.sha256=t.sha.sha256,t.sha224=t.sha.sha224,t.sha384=t.sha.sha384,t.sha512=t.sha.sha512,t.ripemd160=t.ripemd.ripemd160}}),en=j({"../../node_modules/.pnpm/elliptic@6.5.4/node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js"(e,t){t.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}}}),tn=j({"../../node_modules/.pnpm/elliptic@6.5.4/node_modules/elliptic/lib/elliptic/curves.js"(e){var t,r=e,n=Zr(),i=Kr(),o=Dr().assert;function s(e){"short"===e.type?this.curve=new i.short(e):"edwards"===e.type?this.curve=new i.edwards(e):this.curve=new i.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,o(this.g.validate(),"Invalid curve"),o(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function a(e,t){Object.defineProperty(r,e,{configurable:!0,enumerable:!0,get:function(){var n=new s(t);return Object.defineProperty(r,e,{configurable:!0,enumerable:!0,value:n}),n}})}I(s,"PresetCurve"),r.PresetCurve=s,I(a,"defineCurve"),a("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:n.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:n.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:n.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:n.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),a("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:n.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:n.sha256,gRed:!1,g:["9"]}),a("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:n.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{t=en()}catch(e){t=void 0}a("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:n.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",t]})}}),rn=j({"../../node_modules/.pnpm/hmac-drbg@1.0.1/node_modules/hmac-drbg/lib/hmac-drbg.js"(e,t){var r=Zr(),n=Or(),i=Br();function o(e){if(!(this instanceof o))return new o(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=n.toArray(e.entropy,e.entropyEnc||"hex"),r=n.toArray(e.nonce,e.nonceEnc||"hex"),s=n.toArray(e.pers,e.persEnc||"hex");i(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,s)}I(o,"HmacDRBG"),t.exports=o,o.prototype._init=I((function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656}),"init"),o.prototype._hmac=I((function(){return new r.hmac(this.hash,this.K)}),"hmac"),o.prototype._update=I((function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())}),"update"),o.prototype.reseed=I((function(e,t,r,o){"string"!=typeof t&&(o=r,r=t,t=null),e=n.toArray(e,t),r=n.toArray(r,o),i(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1}),"reseed"),o.prototype.generate=I((function(e,t,r,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(i=r,r=t,t=null),r&&(r=n.toArray(r,i||"hex"),this._update(r));for(var o=[];o.length<e;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var s=o.slice(0,e);return this._update(r),this._reseed++,n.encode(s,t)}),"generate")}}),nn=j({"../../node_modules/.pnpm/elliptic@6.5.4/node_modules/elliptic/lib/elliptic/ec/key.js"(e,t){var r=Ir(),n=Dr().assert;function i(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}I(i,"KeyPair"),t.exports=i,i.fromPublic=I((function(e,t,r){return t instanceof i?t:new i(e,{pub:t,pubEnc:r})}),"fromPublic"),i.fromPrivate=I((function(e,t,r){return t instanceof i?t:new i(e,{priv:t,privEnc:r})}),"fromPrivate"),i.prototype.validate=I((function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}}),"validate"),i.prototype.getPublic=I((function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub}),"getPublic"),i.prototype.getPrivate=I((function(e){return"hex"===e?this.priv.toString(16,2):this.priv}),"getPrivate"),i.prototype._importPrivate=I((function(e,t){this.priv=new r(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)}),"_importPrivate"),i.prototype._importPublic=I((function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?n(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||n(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)}),"_importPublic"),i.prototype.derive=I((function(e){return e.validate()||n(e.validate(),"public point not validated"),e.mul(this.priv).getX()}),"derive"),i.prototype.sign=I((function(e,t,r){return this.ec.sign(e,this,t,r)}),"sign"),i.prototype.verify=I((function(e,t){return this.ec.verify(e,t,this)}),"verify"),i.prototype.inspect=I((function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}),"inspect")}}),on=j({"../../node_modules/.pnpm/elliptic@6.5.4/node_modules/elliptic/lib/elliptic/ec/signature.js"(e,t){var r=Ir(),n=Dr(),i=n.assert;function o(e,t){if(e instanceof o)return e;this._importDER(e,t)||(i(e.r&&e.s,"Signature without r or s"),this.r=new r(e.r,16),this.s=new r(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function s(){this.place=0}function a(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,s=t.place;o<n;o++,s++)i<<=8,i|=e[s],i>>>=0;return!(i<=127)&&(t.place=s,i)}function c(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function u(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}I(o,"Signature"),t.exports=o,I(s,"Position"),I(a,"getLength"),I(c,"rmPadding"),o.prototype._importDER=I((function(e,t){e=n.toArray(e,t);var i=new s;if(48!==e[i.place++])return!1;var o=a(e,i);if(!1===o)return!1;if(o+i.place!==e.length)return!1;if(2!==e[i.place++])return!1;var c=a(e,i);if(!1===c)return!1;var u=e.slice(i.place,c+i.place);if(i.place+=c,2!==e[i.place++])return!1;var l=a(e,i);if(!1===l)return!1;if(e.length!==l+i.place)return!1;var d=e.slice(i.place,l+i.place);if(0===u[0]){if(!(128&u[1]))return!1;u=u.slice(1)}if(0===d[0]){if(!(128&d[1]))return!1;d=d.slice(1)}return this.r=new r(u),this.s=new r(d),this.recoveryParam=null,!0}),"_importDER"),I(u,"constructLength"),o.prototype.toDER=I((function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=c(t),r=c(r);!(r[0]||128&r[1]);)r=r.slice(1);var i=[2];u(i,t.length),(i=i.concat(t)).push(2),u(i,r.length);var o=i.concat(r),s=[48];return u(s,o.length),s=s.concat(o),n.encode(s,e)}),"toDER")}}),sn=j({"../../node_modules/.pnpm/elliptic@6.5.4/node_modules/elliptic/lib/elliptic/ec/index.js"(e,t){var r=Ir(),n=rn(),i=Dr(),o=tn(),s=jr(),a=i.assert,c=nn(),u=on();function l(e){if(!(this instanceof l))return new l(e);"string"==typeof e&&(a(Object.prototype.hasOwnProperty.call(o,e),"Unknown curve "+e),e=o[e]),e instanceof o.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}I(l,"EC"),t.exports=l,l.prototype.keyPair=I((function(e){return new c(this,e)}),"keyPair"),l.prototype.keyFromPrivate=I((function(e,t){return c.fromPrivate(this,e,t)}),"keyFromPrivate"),l.prototype.keyFromPublic=I((function(e,t){return c.fromPublic(this,e,t)}),"keyFromPublic"),l.prototype.genKeyPair=I((function(e){e||(e={});for(var t=new n({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||s(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),i=this.n.byteLength(),o=this.n.sub(new r(2));;){var a=new r(t.generate(i));if(!(a.cmp(o)>0))return a.iaddn(1),this.keyFromPrivate(a)}}),"genKeyPair"),l.prototype._truncateToN=I((function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e}),"_truncateToN"),l.prototype.sign=I((function(e,t,i,o){"object"==typeof i&&(o=i,i=null),o||(o={}),t=this.keyFromPrivate(t,i),e=this._truncateToN(new r(e,16));for(var s=this.n.byteLength(),a=t.getPrivate().toArray("be",s),c=e.toArray("be",s),l=new n({hash:this.hash,entropy:a,nonce:c,pers:o.pers,persEnc:o.persEnc||"utf8"}),d=this.n.sub(new r(1)),f=0;;f++){var h=o.k?o.k(f):new r(l.generate(this.n.byteLength()));if(!((h=this._truncateToN(h,!0)).cmpn(1)<=0||h.cmp(d)>=0)){var p=this.g.mul(h);if(!p.isInfinity()){var m=p.getX(),g=m.umod(this.n);if(0!==g.cmpn(0)){var b=h.invm(this.n).mul(g.mul(t.getPrivate()).iadd(e));if(0!==(b=b.umod(this.n)).cmpn(0)){var y=(p.getY().isOdd()?1:0)|(0!==m.cmp(g)?2:0);return o.canonical&&b.cmp(this.nh)>0&&(b=this.n.sub(b),y^=1),new u({r:g,s:b,recoveryParam:y})}}}}}}),"sign"),l.prototype.verify=I((function(e,t,n,i){e=this._truncateToN(new r(e,16)),n=this.keyFromPublic(n,i);var o=(t=new u(t,"hex")).r,s=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var a,c=s.invm(this.n),l=c.mul(e).umod(this.n),d=c.mul(o).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(l,n.getPublic(),d)).isInfinity()&&a.eqXToP(o):!(a=this.g.mulAdd(l,n.getPublic(),d)).isInfinity()&&0===a.getX().umod(this.n).cmp(o)}),"verify"),l.prototype.recoverPubKey=function(e,t,n,i){a((3&n)===n,"The recovery param is more than two bits"),t=new u(t,i);var o=this.n,s=new r(e),c=t.r,l=t.s,d=1&n,f=n>>1;if(c.cmp(this.curve.p.umod(this.curve.n))>=0&&f)throw new Error("Unable to find sencond key candinate");c=f?this.curve.pointFromX(c.add(this.curve.n),d):this.curve.pointFromX(c,d);var h=t.r.invm(o),p=o.sub(s).mul(h).umod(o),m=l.mul(h).umod(o);return this.g.mulAdd(p,c,m)},l.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new u(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}}}),an=j({"../../node_modules/.pnpm/elliptic@6.5.4/node_modules/elliptic/lib/elliptic/eddsa/key.js"(e,t){var r=Dr(),n=r.assert,i=r.parseBytes,o=r.cachedProperty;function s(e,t){this.eddsa=e,this._secret=i(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=i(t.pub)}I(s,"KeyPair"),s.fromPublic=I((function(e,t){return t instanceof s?t:new s(e,{pub:t})}),"fromPublic"),s.fromSecret=I((function(e,t){return t instanceof s?t:new s(e,{secret:t})}),"fromSecret"),s.prototype.secret=I((function(){return this._secret}),"secret"),o(s,"pubBytes",I((function(){return this.eddsa.encodePoint(this.pub())}),"pubBytes")),o(s,"pub",I((function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),"pub")),o(s,"privBytes",I((function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n}),"privBytes")),o(s,"priv",I((function(){return this.eddsa.decodeInt(this.privBytes())}),"priv")),o(s,"hash",I((function(){return this.eddsa.hash().update(this.secret()).digest()}),"hash")),o(s,"messagePrefix",I((function(){return this.hash().slice(this.eddsa.encodingLength)}),"messagePrefix")),s.prototype.sign=I((function(e){return n(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)}),"sign"),s.prototype.verify=I((function(e,t){return this.eddsa.verify(e,t,this)}),"verify"),s.prototype.getSecret=I((function(e){return n(this._secret,"KeyPair is public only"),r.encode(this.secret(),e)}),"getSecret"),s.prototype.getPublic=I((function(e){return r.encode(this.pubBytes(),e)}),"getPublic"),t.exports=s}}),cn=j({"../../node_modules/.pnpm/elliptic@6.5.4/node_modules/elliptic/lib/elliptic/eddsa/signature.js"(e,t){var r=Ir(),n=Dr(),i=n.assert,o=n.cachedProperty,s=n.parseBytes;function a(e,t){this.eddsa=e,"object"!=typeof t&&(t=s(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),i(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof r&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}I(a,"Signature"),o(a,"S",I((function(){return this.eddsa.decodeInt(this.Sencoded())}),"S")),o(a,"R",I((function(){return this.eddsa.decodePoint(this.Rencoded())}),"R")),o(a,"Rencoded",I((function(){return this.eddsa.encodePoint(this.R())}),"Rencoded")),o(a,"Sencoded",I((function(){return this.eddsa.encodeInt(this.S())}),"Sencoded")),a.prototype.toBytes=I((function(){return this.Rencoded().concat(this.Sencoded())}),"toBytes"),a.prototype.toHex=I((function(){return n.encode(this.toBytes(),"hex").toUpperCase()}),"toHex"),t.exports=a}}),un=j({"../../node_modules/.pnpm/elliptic@6.5.4/node_modules/elliptic/lib/elliptic/eddsa/index.js"(e,t){var r=Zr(),n=tn(),i=Dr(),o=i.assert,s=i.parseBytes,a=an(),c=cn();function u(e){if(o("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof u))return new u(e);e=n[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=r.sha512}I(u,"EDDSA"),t.exports=u,u.prototype.sign=I((function(e,t){e=s(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),o=this.encodePoint(i),a=this.hashInt(o,r.pubBytes(),e).mul(r.priv()),c=n.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:c,Rencoded:o})}),"sign"),u.prototype.verify=I((function(e,t,r){e=s(e),t=this.makeSignature(t);var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(o)}),"verify"),u.prototype.hashInt=I((function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return i.intFromLE(e.digest()).umod(this.curve.n)}),"hashInt"),u.prototype.keyFromPublic=I((function(e){return a.fromPublic(this,e)}),"keyFromPublic"),u.prototype.keyFromSecret=I((function(e){return a.fromSecret(this,e)}),"keyFromSecret"),u.prototype.makeSignature=I((function(e){return e instanceof c?e:new c(this,e)}),"makeSignature"),u.prototype.encodePoint=I((function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t}),"encodePoint"),u.prototype.decodePoint=I((function(e){var t=(e=i.parseBytes(e)).length-1,r=e.slice(0,t).concat(-129&e[t]),n=0!=(128&e[t]),o=i.intFromLE(r);return this.curve.pointFromY(o,n)}),"decodePoint"),u.prototype.encodeInt=I((function(e){return e.toArray("le",this.encodingLength)}),"encodeInt"),u.prototype.decodeInt=I((function(e){return i.intFromLE(e)}),"decodeInt"),u.prototype.isPoint=I((function(e){return e instanceof this.pointClass}),"isPoint")}}),ln=j({"../../node_modules/.pnpm/elliptic@6.5.4/node_modules/elliptic/lib/elliptic.js"(e){var t=e;t.version=Cr().version,t.utils=Dr(),t.rand=jr(),t.curve=Kr(),t.curves=tn(),t.ec=sn(),t.eddsa=un()}}),dn=j({"../../node_modules/.pnpm/@stablelib+random@1.0.1/node_modules/@stablelib/random/lib/source/browser.js"(e){Object.defineProperty(e,"__esModule",{value:!0});var t=function(){function e(){this.isAvailable=!1,this.isInstantiated=!1;var e="undefined"!=typeof self?self.crypto||self.msCrypto:null;e&&e.getRandomValues&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}return I(e,"BrowserRandomSource"),e.prototype.randomBytes=function(e){if(!this.isAvailable||!this._crypto)throw new Error("Browser random byte generator is not available.");for(var t=new Uint8Array(e),r=0;r<t.length;r+=65536)this._crypto.getRandomValues(t.subarray(r,r+Math.min(t.length-r,65536)));return t},e}();e.BrowserRandomSource=t}}),fn=j({"../../node_modules/.pnpm/@stablelib+random@1.0.1/node_modules/@stablelib/random/lib/source/node.js"(e){Object.defineProperty(e,"__esModule",{value:!0});var t=_r(),r=function(){function e(){if(this.isAvailable=!1,this.isInstantiated=!1,void 0!==B){var e=B("crypto");e&&e.randomBytes&&(this._crypto=e,this.isAvailable=!0,this.isInstantiated=!0)}}return I(e,"NodeRandomSource"),e.prototype.randomBytes=function(e){if(!this.isAvailable||!this._crypto)throw new Error("Node.js random byte generator is not available.");var r=this._crypto.randomBytes(e);if(r.length!==e)throw new Error("NodeRandomSource: got fewer bytes than requested");for(var n=new Uint8Array(e),i=0;i<n.length;i++)n[i]=r[i];return t.wipe(r),n},e}();e.NodeRandomSource=r}}),hn=j({"../../node_modules/.pnpm/@stablelib+random@1.0.1/node_modules/@stablelib/random/lib/source/system.js"(e){Object.defineProperty(e,"__esModule",{value:!0});var t=dn(),r=fn(),n=function(){function e(){return this.isAvailable=!1,this.name="",this._source=new t.BrowserRandomSource,this._source.isAvailable?(this.isAvailable=!0,void(this.name="Browser")):(this._source=new r.NodeRandomSource,this._source.isAvailable?(this.isAvailable=!0,void(this.name="Node")):void 0)}return I(e,"SystemRandomSource"),e.prototype.randomBytes=function(e){if(!this.isAvailable)throw new Error("System random byte generator is not available.");return this._source.randomBytes(e)},e}();e.SystemRandomSource=n}}),pn=j({"../../node_modules/.pnpm/@stablelib+random@1.0.1/node_modules/@stablelib/random/lib/random.js"(e){Object.defineProperty(e,"__esModule",{value:!0});var t=hn(),r=Mr(),n=_r();function i(t,r){return void 0===r&&(r=e.defaultRandomSource),r.randomBytes(t)}function o(t){void 0===t&&(t=e.defaultRandomSource);var o=i(4,t),s=r.readUint32LE(o);return n.wipe(o),s}e.defaultRandomSource=new t.SystemRandomSource,I(i,"randomBytes"),e.randomBytes=i,I(o,"randomUint32"),e.randomUint32=o;var s="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function a(t,r,o){if(void 0===r&&(r=s),void 0===o&&(o=e.defaultRandomSource),r.length<2)throw new Error("randomString charset is too short");if(r.length>256)throw new Error("randomString charset is too long");for(var a="",c=r.length,u=256-256%c;t>0;){for(var l=i(Math.ceil(256*t/u),o),d=0;d<l.length&&t>0;d++){var f=l[d];f<u&&(a+=r.charAt(f%c),t--)}n.wipe(l)}return a}function c(t,r,n){return void 0===r&&(r=s),void 0===n&&(n=e.defaultRandomSource),a(Math.ceil(t/(Math.log(r.length)/Math.LN2)),r,n)}I(a,"randomString"),e.randomString=a,I(c,"randomStringForEntropy"),e.randomStringForEntropy=c}}),mn=j({"../../node_modules/.pnpm/@stablelib+sha512@1.0.1/node_modules/@stablelib/sha512/lib/sha512.js"(e){Object.defineProperty(e,"__esModule",{value:!0});var t=Mr(),r=_r();e.DIGEST_LENGTH=64,e.BLOCK_SIZE=128;var n=function(){function n(){this.digestLength=e.DIGEST_LENGTH,this.blockSize=e.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return I(n,"SHA512"),n.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},n.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},n.prototype.clean=function(){r.wipe(this._buffer),r.wipe(this._tempHi),r.wipe(this._tempLo),this.reset()},n.prototype.update=function(t,r){if(void 0===r&&(r=t.length),this._finished)throw new Error("SHA512: can't update because hash was finished.");var n=0;if(this._bytesHashed+=r,this._bufferLength>0){for(;this._bufferLength<e.BLOCK_SIZE&&r>0;)this._buffer[this._bufferLength++]=t[n++],r--;this._bufferLength===this.blockSize&&(o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(r>=this.blockSize&&(n=o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,t,n,r),r%=this.blockSize);r>0;)this._buffer[this._bufferLength++]=t[n++],r--;return this},n.prototype.finish=function(e){if(!this._finished){var r=this._bytesHashed,n=this._bufferLength,i=r/536870912|0,s=r<<3,a=r%128<112?128:256;this._buffer[n]=128;for(var c=n+1;c<a-8;c++)this._buffer[c]=0;t.writeUint32BE(i,this._buffer,a-8),t.writeUint32BE(s,this._buffer,a-4),o(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,a),this._finished=!0}for(c=0;c<this.digestLength/8;c++)t.writeUint32BE(this._stateHi[c],e,8*c),t.writeUint32BE(this._stateLo[c],e,8*c+4);return this},n.prototype.digest=function(){var e=new Uint8Array(this.digestLength);return this.finish(e),e},n.prototype.saveState=function(){if(this._finished)throw new Error("SHA256: cannot save finished state");return{stateHi:new Int32Array(this._stateHi),stateLo:new Int32Array(this._stateLo),buffer:this._bufferLength>0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},n.prototype.restoreState=function(e){return this._stateHi.set(e.stateHi),this._stateLo.set(e.stateLo),this._bufferLength=e.bufferLength,e.buffer&&this._buffer.set(e.buffer),this._bytesHashed=e.bytesHashed,this._finished=!1,this},n.prototype.cleanSavedState=function(e){r.wipe(e.stateHi),r.wipe(e.stateLo),e.buffer&&r.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},n}();e.SHA512=n;var i=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function o(e,r,n,o,s,a,c){for(var u,l,d,f,h,p,m,g,b=n[0],y=n[1],v=n[2],w=n[3],A=n[4],E=n[5],S=n[6],x=n[7],M=o[0],_=o[1],k=o[2],T=o[3],C=o[4],N=o[5],I=o[6],B=o[7];c>=128;){for(var O=0;O<16;O++){var D=8*O+a;e[O]=t.readUint32BE(s,D),r[O]=t.readUint32BE(s,D+4)}for(O=0;O<80;O++){var j,L,P=b,R=y,U=v,z=w,K=A,F=E,H=S,$=M,V=_,q=k,G=T,Y=C,J=N,Q=I;if(h=65535&(l=B),p=l>>>16,m=65535&(u=x),g=u>>>16,h+=65535&(l=(C>>>14|A<<18)^(C>>>18|A<<14)^(A>>>9|C<<23)),p+=l>>>16,m+=65535&(u=(A>>>14|C<<18)^(A>>>18|C<<14)^(C>>>9|A<<23)),g+=u>>>16,h+=65535&(l=C&N^~C&I),p+=l>>>16,m+=65535&(u=A&E^~A&S),g+=u>>>16,u=i[2*O],h+=65535&(l=i[2*O+1]),p+=l>>>16,m+=65535&u,g+=u>>>16,u=e[O%16],p+=(l=r[O%16])>>>16,m+=65535&u,g+=u>>>16,m+=(p+=(h+=65535&l)>>>16)>>>16,h=65535&(l=f=65535&h|p<<16),p=l>>>16,m=65535&(u=d=65535&m|(g+=m>>>16)<<16),g=u>>>16,h+=65535&(l=(M>>>28|b<<4)^(b>>>2|M<<30)^(b>>>7|M<<25)),p+=l>>>16,m+=65535&(u=(b>>>28|M<<4)^(M>>>2|b<<30)^(M>>>7|b<<25)),g+=u>>>16,p+=(l=M&_^M&k^_&k)>>>16,m+=65535&(u=b&y^b&v^y&v),g+=u>>>16,j=65535&(m+=(p+=(h+=65535&l)>>>16)>>>16)|(g+=m>>>16)<<16,L=65535&h|p<<16,h=65535&(l=G),p=l>>>16,m=65535&(u=z),g=u>>>16,p+=(l=f)>>>16,m+=65535&(u=d),g+=u>>>16,y=P,v=R,w=U,A=z=65535&(m+=(p+=(h+=65535&l)>>>16)>>>16)|(g+=m>>>16)<<16,E=K,S=F,x=H,b=j,_=$,k=V,T=q,C=G=65535&h|p<<16,N=Y,I=J,B=Q,M=L,O%16==15)for(D=0;D<16;D++)u=e[D],h=65535&(l=r[D]),p=l>>>16,m=65535&u,g=u>>>16,u=e[(D+9)%16],h+=65535&(l=r[(D+9)%16]),p+=l>>>16,m+=65535&u,g+=u>>>16,d=e[(D+1)%16],h+=65535&(l=((f=r[(D+1)%16])>>>1|d<<31)^(f>>>8|d<<24)^(f>>>7|d<<25)),p+=l>>>16,m+=65535&(u=(d>>>1|f<<31)^(d>>>8|f<<24)^d>>>7),g+=u>>>16,d=e[(D+14)%16],p+=(l=((f=r[(D+14)%16])>>>19|d<<13)^(d>>>29|f<<3)^(f>>>6|d<<26))>>>16,m+=65535&(u=(d>>>19|f<<13)^(f>>>29|d<<3)^d>>>6),g+=u>>>16,g+=(m+=(p+=(h+=65535&l)>>>16)>>>16)>>>16,e[D]=65535&m|g<<16,r[D]=65535&h|p<<16}h=65535&(l=M),p=l>>>16,m=65535&(u=b),g=u>>>16,u=n[0],p+=(l=o[0])>>>16,m+=65535&u,g+=u>>>16,g+=(m+=(p+=(h+=65535&l)>>>16)>>>16)>>>16,n[0]=b=65535&m|g<<16,o[0]=M=65535&h|p<<16,h=65535&(l=_),p=l>>>16,m=65535&(u=y),g=u>>>16,u=n[1],p+=(l=o[1])>>>16,m+=65535&u,g+=u>>>16,g+=(m+=(p+=(h+=65535&l)>>>16)>>>16)>>>16,n[1]=y=65535&m|g<<16,o[1]=_=65535&h|p<<16,h=65535&(l=k),p=l>>>16,m=65535&(u=v),g=u>>>16,u=n[2],p+=(l=o[2])>>>16,m+=65535&u,g+=u>>>16,g+=(m+=(p+=(h+=65535&l)>>>16)>>>16)>>>16,n[2]=v=65535&m|g<<16,o[2]=k=65535&h|p<<16,h=65535&(l=T),p=l>>>16,m=65535&(u=w),g=u>>>16,u=n[3],p+=(l=o[3])>>>16,m+=65535&u,g+=u>>>16,g+=(m+=(p+=(h+=65535&l)>>>16)>>>16)>>>16,n[3]=w=65535&m|g<<16,o[3]=T=65535&h|p<<16,h=65535&(l=C),p=l>>>16,m=65535&(u=A),g=u>>>16,u=n[4],p+=(l=o[4])>>>16,m+=65535&u,g+=u>>>16,g+=(m+=(p+=(h+=65535&l)>>>16)>>>16)>>>16,n[4]=A=65535&m|g<<16,o[4]=C=65535&h|p<<16,h=65535&(l=N),p=l>>>16,m=65535&(u=E),g=u>>>16,u=n[5],p+=(l=o[5])>>>16,m+=65535&u,g+=u>>>16,g+=(m+=(p+=(h+=65535&l)>>>16)>>>16)>>>16,n[5]=E=65535&m|g<<16,o[5]=N=65535&h|p<<16,h=65535&(l=I),p=l>>>16,m=65535&(u=S),g=u>>>16,u=n[6],p+=(l=o[6])>>>16,m+=65535&u,g+=u>>>16,g+=(m+=(p+=(h+=65535&l)>>>16)>>>16)>>>16,n[6]=S=65535&m|g<<16,o[6]=I=65535&h|p<<16,h=65535&(l=B),p=l>>>16,m=65535&(u=x),g=u>>>16,u=n[7],p+=(l=o[7])>>>16,m+=65535&u,g+=u>>>16,g+=(m+=(p+=(h+=65535&l)>>>16)>>>16)>>>16,n[7]=x=65535&m|g<<16,o[7]=B=65535&h|p<<16,a+=128,c-=128}return a}function s(e){var t=new n;t.update(e);var r=t.digest();return t.clean(),r}I(o,"hashBlocks"),I(s,"hash"),e.hash=s}}),gn=j({"../../node_modules/.pnpm/@stablelib+ed25519@1.0.2/node_modules/@stablelib/ed25519/lib/ed25519.js"(e){Object.defineProperty(e,"__esModule",{value:!0});var t=pn(),r=mn(),n=_r();function i(e){var t=new Float64Array(16);if(e)for(var r=0;r<e.length;r++)t[r]=e[r];return t}e.SIGNATURE_LENGTH=64,e.PUBLIC_KEY_LENGTH=32,e.SECRET_KEY_LENGTH=64,e.SEED_LENGTH=32,I(i,"gf"),new Uint8Array(32)[0]=9;var o=i(),s=i([1]),a=i([30883,4953,19914,30187,55467,16705,2637,112,59544,30585,16505,36039,65139,11119,27886,20995]),c=i([61785,9906,39828,60374,45398,33411,5274,224,53552,61171,33010,6542,64743,22239,55772,9222]),u=i([54554,36645,11616,51542,42930,38181,51040,26924,56412,64982,57905,49316,21502,52590,14035,8553]),l=i([26200,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214,26214]),d=i([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function f(e,t){for(var r=0;r<16;r++)e[r]=0|t[r]}function h(e){for(var t=1,r=0;r<16;r++){var n=e[r]+t+65535;t=Math.floor(n/65536),e[r]=n-65536*t}e[0]+=t-1+37*(t-1)}function p(e,t,r){for(var n=~(r-1),i=0;i<16;i++){var o=n&(e[i]^t[i]);e[i]^=o,t[i]^=o}}function m(e,t){for(var r=i(),n=i(),o=0;o<16;o++)n[o]=t[o];h(n),h(n),h(n);for(var s=0;s<2;s++){r[0]=n[0]-65517;for(o=1;o<15;o++)r[o]=n[o]-65535-(r[o-1]>>16&1),r[o-1]&=65535;r[15]=n[15]-32767-(r[14]>>16&1);var a=r[15]>>16&1;r[14]&=65535,p(n,r,1-a)}for(o=0;o<16;o++)e[2*o]=255&n[o],e[2*o+1]=n[o]>>8}function g(e,t){for(var r=0,n=0;n<32;n++)r|=e[n]^t[n];return(1&r-1>>>8)-1}function b(e,t){var r=new Uint8Array(32),n=new Uint8Array(32);return m(r,e),m(n,t),g(r,n)}function y(e){var t=new Uint8Array(32);return m(t,e),1&t[0]}function v(e,t){for(var r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}function w(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]+r[n]}function A(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]-r[n]}function E(e,t,r){var n,i,o=0,s=0,a=0,c=0,u=0,l=0,d=0,f=0,h=0,p=0,m=0,g=0,b=0,y=0,v=0,w=0,A=0,E=0,S=0,x=0,M=0,_=0,k=0,T=0,C=0,N=0,I=0,B=0,O=0,D=0,j=0,L=r[0],P=r[1],R=r[2],U=r[3],z=r[4],K=r[5],F=r[6],H=r[7],$=r[8],V=r[9],q=r[10],G=r[11],Y=r[12],J=r[13],Q=r[14],W=r[15];o+=(n=t[0])*L,s+=n*P,a+=n*R,c+=n*U,u+=n*z,l+=n*K,d+=n*F,f+=n*H,h+=n*$,p+=n*V,m+=n*q,g+=n*G,b+=n*Y,y+=n*J,v+=n*Q,w+=n*W,s+=(n=t[1])*L,a+=n*P,c+=n*R,u+=n*U,l+=n*z,d+=n*K,f+=n*F,h+=n*H,p+=n*$,m+=n*V,g+=n*q,b+=n*G,y+=n*Y,v+=n*J,w+=n*Q,A+=n*W,a+=(n=t[2])*L,c+=n*P,u+=n*R,l+=n*U,d+=n*z,f+=n*K,h+=n*F,p+=n*H,m+=n*$,g+=n*V,b+=n*q,y+=n*G,v+=n*Y,w+=n*J,A+=n*Q,E+=n*W,c+=(n=t[3])*L,u+=n*P,l+=n*R,d+=n*U,f+=n*z,h+=n*K,p+=n*F,m+=n*H,g+=n*$,b+=n*V,y+=n*q,v+=n*G,w+=n*Y,A+=n*J,E+=n*Q,S+=n*W,u+=(n=t[4])*L,l+=n*P,d+=n*R,f+=n*U,h+=n*z,p+=n*K,m+=n*F,g+=n*H,b+=n*$,y+=n*V,v+=n*q,w+=n*G,A+=n*Y,E+=n*J,S+=n*Q,x+=n*W,l+=(n=t[5])*L,d+=n*P,f+=n*R,h+=n*U,p+=n*z,m+=n*K,g+=n*F,b+=n*H,y+=n*$,v+=n*V,w+=n*q,A+=n*G,E+=n*Y,S+=n*J,x+=n*Q,M+=n*W,d+=(n=t[6])*L,f+=n*P,h+=n*R,p+=n*U,m+=n*z,g+=n*K,b+=n*F,y+=n*H,v+=n*$,w+=n*V,A+=n*q,E+=n*G,S+=n*Y,x+=n*J,M+=n*Q,_+=n*W,f+=(n=t[7])*L,h+=n*P,p+=n*R,m+=n*U,g+=n*z,b+=n*K,y+=n*F,v+=n*H,w+=n*$,A+=n*V,E+=n*q,S+=n*G,x+=n*Y,M+=n*J,_+=n*Q,k+=n*W,h+=(n=t[8])*L,p+=n*P,m+=n*R,g+=n*U,b+=n*z,y+=n*K,v+=n*F,w+=n*H,A+=n*$,E+=n*V,S+=n*q,x+=n*G,M+=n*Y,_+=n*J,k+=n*Q,T+=n*W,p+=(n=t[9])*L,m+=n*P,g+=n*R,b+=n*U,y+=n*z,v+=n*K,w+=n*F,A+=n*H,E+=n*$,S+=n*V,x+=n*q,M+=n*G,_+=n*Y,k+=n*J,T+=n*Q,C+=n*W,m+=(n=t[10])*L,g+=n*P,b+=n*R,y+=n*U,v+=n*z,w+=n*K,A+=n*F,E+=n*H,S+=n*$,x+=n*V,M+=n*q,_+=n*G,k+=n*Y,T+=n*J,C+=n*Q,N+=n*W,g+=(n=t[11])*L,b+=n*P,y+=n*R,v+=n*U,w+=n*z,A+=n*K,E+=n*F,S+=n*H,x+=n*$,M+=n*V,_+=n*q,k+=n*G,T+=n*Y,C+=n*J,N+=n*Q,I+=n*W,b+=(n=t[12])*L,y+=n*P,v+=n*R,w+=n*U,A+=n*z,E+=n*K,S+=n*F,x+=n*H,M+=n*$,_+=n*V,k+=n*q,T+=n*G,C+=n*Y,N+=n*J,I+=n*Q,B+=n*W,y+=(n=t[13])*L,v+=n*P,w+=n*R,A+=n*U,E+=n*z,S+=n*K,x+=n*F,M+=n*H,_+=n*$,k+=n*V,T+=n*q,C+=n*G,N+=n*Y,I+=n*J,B+=n*Q,O+=n*W,v+=(n=t[14])*L,w+=n*P,A+=n*R,E+=n*U,S+=n*z,x+=n*K,M+=n*F,_+=n*H,k+=n*$,T+=n*V,C+=n*q,N+=n*G,I+=n*Y,B+=n*J,O+=n*Q,D+=n*W,w+=(n=t[15])*L,s+=38*(E+=n*R),a+=38*(S+=n*U),c+=38*(x+=n*z),u+=38*(M+=n*K),l+=38*(_+=n*F),d+=38*(k+=n*H),f+=38*(T+=n*$),h+=38*(C+=n*V),p+=38*(N+=n*q),m+=38*(I+=n*G),g+=38*(B+=n*Y),b+=38*(O+=n*J),y+=38*(D+=n*Q),v+=38*(j+=n*W),o=(n=(o+=38*(A+=n*P))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),a=(n=a+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),w=(n=w+i+65535)-65536*(i=Math.floor(n/65536)),o=(n=(o+=i-1+37*(i-1))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),a=(n=a+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),w=(n=w+i+65535)-65536*(i=Math.floor(n/65536)),o+=i-1+37*(i-1),e[0]=o,e[1]=s,e[2]=a,e[3]=c,e[4]=u,e[5]=l,e[6]=d,e[7]=f,e[8]=h,e[9]=p,e[10]=m,e[11]=g,e[12]=b,e[13]=y,e[14]=v,e[15]=w}function S(e,t){E(e,t,t)}function x(e,t){var r,n=i();for(r=0;r<16;r++)n[r]=t[r];for(r=253;r>=0;r--)S(n,n),2!==r&&4!==r&&E(n,n,t);for(r=0;r<16;r++)e[r]=n[r]}function M(e,t){var r,n=i();for(r=0;r<16;r++)n[r]=t[r];for(r=250;r>=0;r--)S(n,n),1!==r&&E(n,n,t);for(r=0;r<16;r++)e[r]=n[r]}function _(e,t){var r=i(),n=i(),o=i(),s=i(),a=i(),u=i(),l=i(),d=i(),f=i();A(r,e[1],e[0]),A(f,t[1],t[0]),E(r,r,f),w(n,e[0],e[1]),w(f,t[0],t[1]),E(n,n,f),E(o,e[3],t[3]),E(o,o,c),E(s,e[2],t[2]),w(s,s,s),A(a,n,r),A(u,s,o),w(l,s,o),w(d,n,r),E(e[0],a,u),E(e[1],d,l),E(e[2],l,u),E(e[3],a,d)}function k(e,t,r){for(var n=0;n<4;n++)p(e[n],t[n],r)}function T(e,t){var r=i(),n=i(),o=i();x(o,t[2]),E(r,t[0],o),E(n,t[1],o),m(e,n),e[31]^=y(r)<<7}function C(e,t,r){f(e[0],o),f(e[1],s),f(e[2],s),f(e[3],o);for(var n=255;n>=0;--n){var i=r[n/8|0]>>(7&n)&1;k(e,t,i),_(t,e),_(e,e),k(e,t,i)}}function N(e,t){var r=[i(),i(),i(),i()];f(r[0],u),f(r[1],l),f(r[2],s),E(r[3],u,l),C(e,r,t)}function B(t){if(t.length!==e.SEED_LENGTH)throw new Error("ed25519: seed must be "+e.SEED_LENGTH+" bytes");var n=r.hash(t);n[0]&=248,n[31]&=127,n[31]|=64;var o=new Uint8Array(32),s=[i(),i(),i(),i()];N(s,n),T(o,s);var a=new Uint8Array(64);return a.set(t),a.set(o,32),{publicKey:o,secretKey:a}}function O(e){var r=t.randomBytes(32,e),i=B(r);return n.wipe(r),i}function D(t){if(t.length!==e.SECRET_KEY_LENGTH)throw new Error("ed25519: secret key must be "+e.SECRET_KEY_LENGTH+" bytes");return new Uint8Array(t.subarray(32))}I(f,"set25519"),I(h,"car25519"),I(p,"sel25519"),I(m,"pack25519"),I(g,"verify32"),I(b,"neq25519"),I(y,"par25519"),I(v,"unpack25519"),I(w,"add"),I(A,"sub"),I(E,"mul"),I(S,"square"),I(x,"inv25519"),I(M,"pow2523"),I(_,"edadd"),I(k,"cswap"),I(T,"pack"),I(C,"scalarmult"),I(N,"scalarbase"),I(B,"generateKeyPairFromSeed"),e.generateKeyPairFromSeed=B,I(O,"generateKeyPair"),e.generateKeyPair=O,I(D,"extractPublicKeyFromSecretKey"),e.extractPublicKeyFromSecretKey=D;var j=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function L(e,t){var r,n,i,o;for(n=63;n>=32;--n){for(r=0,i=n-32,o=n-12;i<o;++i)t[i]+=r-16*t[n]*j[i-(n-32)],r=Math.floor((t[i]+128)/256),t[i]-=256*r;t[i]+=r,t[n]=0}for(r=0,i=0;i<32;i++)t[i]+=r-(t[31]>>4)*j[i],r=t[i]>>8,t[i]&=255;for(i=0;i<32;i++)t[i]-=r*j[i];for(n=0;n<32;n++)t[n+1]+=t[n]>>8,e[n]=255&t[n]}function P(e){for(var t=new Float64Array(64),r=0;r<64;r++)t[r]=e[r];for(r=0;r<64;r++)e[r]=0;L(e,t)}function R(e,t){var n=new Float64Array(64),o=[i(),i(),i(),i()],s=r.hash(e.subarray(0,32));s[0]&=248,s[31]&=127,s[31]|=64;var a=new Uint8Array(64);a.set(s.subarray(32),32);var c=new r.SHA512;c.update(a.subarray(32)),c.update(t);var u=c.digest();c.clean(),P(u),N(o,u),T(a,o),c.reset(),c.update(a.subarray(0,32)),c.update(e.subarray(32)),c.update(t);var l=c.digest();P(l);for(var d=0;d<32;d++)n[d]=u[d];for(d=0;d<32;d++)for(var f=0;f<32;f++)n[d+f]+=l[d]*s[f];return L(a.subarray(32),n),a}function U(e,t){var r=i(),n=i(),c=i(),u=i(),l=i(),h=i(),p=i();return f(e[2],s),v(e[1],t),S(c,e[1]),E(u,c,a),A(c,c,e[2]),w(u,e[2],u),S(l,u),S(h,l),E(p,h,l),E(r,p,c),E(r,r,u),M(r,r),E(r,r,c),E(r,r,u),E(r,r,u),E(e[0],r,u),S(n,e[0]),E(n,n,u),b(n,c)&&E(e[0],e[0],d),S(n,e[0]),E(n,n,u),b(n,c)?-1:(y(e[0])===t[31]>>7&&A(e[0],o,e[0]),E(e[3],e[0],e[1]),0)}function z(t,n,o){var s=new Uint8Array(32),a=[i(),i(),i(),i()],c=[i(),i(),i(),i()];if(o.length!==e.SIGNATURE_LENGTH)throw new Error("ed25519: signature must be "+e.SIGNATURE_LENGTH+" bytes");if(U(c,t))return!1;var u=new r.SHA512;u.update(o.subarray(0,32)),u.update(t),u.update(n);var l=u.digest();return P(l),C(a,c,l),N(c,o.subarray(32)),_(a,c),T(s,a),!g(o,s)}function K(e){var t=[i(),i(),i(),i()];if(U(t,e))throw new Error("Ed25519: invalid public key");var r=i(),n=i(),o=t[1];w(r,s,o),A(n,s,o),x(n,n),E(r,r,n);var a=new Uint8Array(32);return m(a,r),a}function F(e){var t=r.hash(e.subarray(0,32));t[0]&=248,t[31]&=127,t[31]|=64;var i=new Uint8Array(t.subarray(0,32));return n.wipe(t),i}I(L,"modL"),I(P,"reduce"),I(R,"sign"),e.sign=R,I(U,"unpackneg"),I(z,"verify"),e.verify=z,I(K,"convertPublicKeyToX25519"),e.convertPublicKeyToX25519=K,I(F,"convertSecretKeyToX25519"),e.convertSecretKeyToX25519=F}}),bn=j({"../../node_modules/.pnpm/canonicalize@1.0.8/node_modules/canonicalize/lib/canonicalize.js"(e,t){t.exports=I((function e(t){return null===t||"object"!=typeof t||null!=t.toJSON?JSON.stringify(t):Array.isArray(t)?"["+t.reduce(((t,r,n)=>t+(0===n?"":",")+e(void 0===r||"symbol"==typeof r?null:r)),"")+"]":"{"+Object.keys(t).sort().reduce(((r,n,i)=>{if(void 0===t[n]||"symbol"==typeof t[n])return r;return r+(0===r.length?"":",")+e(n)+":"+e(t[n])}),"")+"}"}),"serialize")}}),yn=j({"../../node_modules/.pnpm/@stablelib+x25519@1.0.2/node_modules/@stablelib/x25519/lib/x25519.js"(e){Object.defineProperty(e,"__esModule",{value:!0});var t=pn(),r=_r();function n(e){var t=new Float64Array(16);if(e)for(var r=0;r<e.length;r++)t[r]=e[r];return t}e.PUBLIC_KEY_LENGTH=32,e.SECRET_KEY_LENGTH=32,e.SHARED_KEY_LENGTH=32,I(n,"gf");var i=new Uint8Array(32);i[0]=9;var o=n([56129,1]);function s(e){for(var t=1,r=0;r<16;r++){var n=e[r]+t+65535;t=Math.floor(n/65536),e[r]=n-65536*t}e[0]+=t-1+37*(t-1)}function a(e,t,r){for(var n=~(r-1),i=0;i<16;i++){var o=n&(e[i]^t[i]);e[i]^=o,t[i]^=o}}function c(e,t){for(var r=n(),i=n(),o=0;o<16;o++)i[o]=t[o];s(i),s(i),s(i);for(var c=0;c<2;c++){r[0]=i[0]-65517;for(o=1;o<15;o++)r[o]=i[o]-65535-(r[o-1]>>16&1),r[o-1]&=65535;r[15]=i[15]-32767-(r[14]>>16&1);var u=r[15]>>16&1;r[14]&=65535,a(i,r,1-u)}for(o=0;o<16;o++)e[2*o]=255&i[o],e[2*o+1]=i[o]>>8}function u(e,t){for(var r=0;r<16;r++)e[r]=t[2*r]+(t[2*r+1]<<8);e[15]&=32767}function l(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]+r[n]}function d(e,t,r){for(var n=0;n<16;n++)e[n]=t[n]-r[n]}function f(e,t,r){var n,i,o=0,s=0,a=0,c=0,u=0,l=0,d=0,f=0,h=0,p=0,m=0,g=0,b=0,y=0,v=0,w=0,A=0,E=0,S=0,x=0,M=0,_=0,k=0,T=0,C=0,N=0,I=0,B=0,O=0,D=0,j=0,L=r[0],P=r[1],R=r[2],U=r[3],z=r[4],K=r[5],F=r[6],H=r[7],$=r[8],V=r[9],q=r[10],G=r[11],Y=r[12],J=r[13],Q=r[14],W=r[15];o+=(n=t[0])*L,s+=n*P,a+=n*R,c+=n*U,u+=n*z,l+=n*K,d+=n*F,f+=n*H,h+=n*$,p+=n*V,m+=n*q,g+=n*G,b+=n*Y,y+=n*J,v+=n*Q,w+=n*W,s+=(n=t[1])*L,a+=n*P,c+=n*R,u+=n*U,l+=n*z,d+=n*K,f+=n*F,h+=n*H,p+=n*$,m+=n*V,g+=n*q,b+=n*G,y+=n*Y,v+=n*J,w+=n*Q,A+=n*W,a+=(n=t[2])*L,c+=n*P,u+=n*R,l+=n*U,d+=n*z,f+=n*K,h+=n*F,p+=n*H,m+=n*$,g+=n*V,b+=n*q,y+=n*G,v+=n*Y,w+=n*J,A+=n*Q,E+=n*W,c+=(n=t[3])*L,u+=n*P,l+=n*R,d+=n*U,f+=n*z,h+=n*K,p+=n*F,m+=n*H,g+=n*$,b+=n*V,y+=n*q,v+=n*G,w+=n*Y,A+=n*J,E+=n*Q,S+=n*W,u+=(n=t[4])*L,l+=n*P,d+=n*R,f+=n*U,h+=n*z,p+=n*K,m+=n*F,g+=n*H,b+=n*$,y+=n*V,v+=n*q,w+=n*G,A+=n*Y,E+=n*J,S+=n*Q,x+=n*W,l+=(n=t[5])*L,d+=n*P,f+=n*R,h+=n*U,p+=n*z,m+=n*K,g+=n*F,b+=n*H,y+=n*$,v+=n*V,w+=n*q,A+=n*G,E+=n*Y,S+=n*J,x+=n*Q,M+=n*W,d+=(n=t[6])*L,f+=n*P,h+=n*R,p+=n*U,m+=n*z,g+=n*K,b+=n*F,y+=n*H,v+=n*$,w+=n*V,A+=n*q,E+=n*G,S+=n*Y,x+=n*J,M+=n*Q,_+=n*W,f+=(n=t[7])*L,h+=n*P,p+=n*R,m+=n*U,g+=n*z,b+=n*K,y+=n*F,v+=n*H,w+=n*$,A+=n*V,E+=n*q,S+=n*G,x+=n*Y,M+=n*J,_+=n*Q,k+=n*W,h+=(n=t[8])*L,p+=n*P,m+=n*R,g+=n*U,b+=n*z,y+=n*K,v+=n*F,w+=n*H,A+=n*$,E+=n*V,S+=n*q,x+=n*G,M+=n*Y,_+=n*J,k+=n*Q,T+=n*W,p+=(n=t[9])*L,m+=n*P,g+=n*R,b+=n*U,y+=n*z,v+=n*K,w+=n*F,A+=n*H,E+=n*$,S+=n*V,x+=n*q,M+=n*G,_+=n*Y,k+=n*J,T+=n*Q,C+=n*W,m+=(n=t[10])*L,g+=n*P,b+=n*R,y+=n*U,v+=n*z,w+=n*K,A+=n*F,E+=n*H,S+=n*$,x+=n*V,M+=n*q,_+=n*G,k+=n*Y,T+=n*J,C+=n*Q,N+=n*W,g+=(n=t[11])*L,b+=n*P,y+=n*R,v+=n*U,w+=n*z,A+=n*K,E+=n*F,S+=n*H,x+=n*$,M+=n*V,_+=n*q,k+=n*G,T+=n*Y,C+=n*J,N+=n*Q,I+=n*W,b+=(n=t[12])*L,y+=n*P,v+=n*R,w+=n*U,A+=n*z,E+=n*K,S+=n*F,x+=n*H,M+=n*$,_+=n*V,k+=n*q,T+=n*G,C+=n*Y,N+=n*J,I+=n*Q,B+=n*W,y+=(n=t[13])*L,v+=n*P,w+=n*R,A+=n*U,E+=n*z,S+=n*K,x+=n*F,M+=n*H,_+=n*$,k+=n*V,T+=n*q,C+=n*G,N+=n*Y,I+=n*J,B+=n*Q,O+=n*W,v+=(n=t[14])*L,w+=n*P,A+=n*R,E+=n*U,S+=n*z,x+=n*K,M+=n*F,_+=n*H,k+=n*$,T+=n*V,C+=n*q,N+=n*G,I+=n*Y,B+=n*J,O+=n*Q,D+=n*W,w+=(n=t[15])*L,s+=38*(E+=n*R),a+=38*(S+=n*U),c+=38*(x+=n*z),u+=38*(M+=n*K),l+=38*(_+=n*F),d+=38*(k+=n*H),f+=38*(T+=n*$),h+=38*(C+=n*V),p+=38*(N+=n*q),m+=38*(I+=n*G),g+=38*(B+=n*Y),b+=38*(O+=n*J),y+=38*(D+=n*Q),v+=38*(j+=n*W),o=(n=(o+=38*(A+=n*P))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),a=(n=a+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),w=(n=w+i+65535)-65536*(i=Math.floor(n/65536)),o=(n=(o+=i-1+37*(i-1))+(i=1)+65535)-65536*(i=Math.floor(n/65536)),s=(n=s+i+65535)-65536*(i=Math.floor(n/65536)),a=(n=a+i+65535)-65536*(i=Math.floor(n/65536)),c=(n=c+i+65535)-65536*(i=Math.floor(n/65536)),u=(n=u+i+65535)-65536*(i=Math.floor(n/65536)),l=(n=l+i+65535)-65536*(i=Math.floor(n/65536)),d=(n=d+i+65535)-65536*(i=Math.floor(n/65536)),f=(n=f+i+65535)-65536*(i=Math.floor(n/65536)),h=(n=h+i+65535)-65536*(i=Math.floor(n/65536)),p=(n=p+i+65535)-65536*(i=Math.floor(n/65536)),m=(n=m+i+65535)-65536*(i=Math.floor(n/65536)),g=(n=g+i+65535)-65536*(i=Math.floor(n/65536)),b=(n=b+i+65535)-65536*(i=Math.floor(n/65536)),y=(n=y+i+65535)-65536*(i=Math.floor(n/65536)),v=(n=v+i+65535)-65536*(i=Math.floor(n/65536)),w=(n=w+i+65535)-65536*(i=Math.floor(n/65536)),o+=i-1+37*(i-1),e[0]=o,e[1]=s,e[2]=a,e[3]=c,e[4]=u,e[5]=l,e[6]=d,e[7]=f,e[8]=h,e[9]=p,e[10]=m,e[11]=g,e[12]=b,e[13]=y,e[14]=v,e[15]=w}function h(e,t){f(e,t,t)}function p(e,t){for(var r=n(),i=0;i<16;i++)r[i]=t[i];for(i=253;i>=0;i--)h(r,r),2!==i&&4!==i&&f(r,r,t);for(i=0;i<16;i++)e[i]=r[i]}function m(e,t){for(var r=new Uint8Array(32),i=new Float64Array(80),s=n(),m=n(),g=n(),b=n(),y=n(),v=n(),w=0;w<31;w++)r[w]=e[w];r[31]=127&e[31]|64,r[0]&=248,u(i,t);for(w=0;w<16;w++)m[w]=i[w];s[0]=b[0]=1;for(w=254;w>=0;--w){var A=r[w>>>3]>>>(7&w)&1;a(s,m,A),a(g,b,A),l(y,s,g),d(s,s,g),l(g,m,b),d(m,m,b),h(b,y),h(v,s),f(s,g,s),f(g,m,y),l(y,s,g),d(s,s,g),h(m,s),d(g,b,v),f(s,g,o),l(s,s,b),f(g,g,s),f(s,b,v),f(b,m,i),h(m,y),a(s,m,A),a(g,b,A)}for(w=0;w<16;w++)i[w+16]=s[w],i[w+32]=g[w],i[w+48]=m[w],i[w+64]=b[w];var E=i.subarray(32),S=i.subarray(16);p(E,E),f(S,S,E);var x=new Uint8Array(32);return c(x,S),x}function g(e){return m(e,i)}function b(t){if(t.length!==e.SECRET_KEY_LENGTH)throw new Error("x25519: seed must be "+e.SECRET_KEY_LENGTH+" bytes");var r=new Uint8Array(t);return{publicKey:g(r),secretKey:r}}function y(e){var n=t.randomBytes(32,e),i=b(n);return r.wipe(n),i}function v(t,r,n){if(void 0===n&&(n=!1),t.length!==e.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect secret key length");if(r.length!==e.PUBLIC_KEY_LENGTH)throw new Error("X25519: incorrect public key length");var i=m(t,r);if(n){for(var o=0,s=0;s<i.length;s++)o|=i[s];if(0===o)throw new Error("X25519: invalid shared key")}return i}I(s,"car25519"),I(a,"sel25519"),I(c,"pack25519"),I(u,"unpack25519"),I(l,"add"),I(d,"sub"),I(f,"mul"),I(h,"square"),I(p,"inv25519"),I(m,"scalarMult"),e.scalarMult=m,I(g,"scalarMultBase"),e.scalarMultBase=g,I(b,"generateKeyPairFromSeed"),e.generateKeyPairFromSeed=b,I(y,"generateKeyPair"),e.generateKeyPair=y,I(v,"sharedKey"),e.sharedKey=v}}),vn=j({"../../node_modules/.pnpm/@stablelib+chacha@1.0.1/node_modules/@stablelib/chacha/lib/chacha.js"(e){Object.defineProperty(e,"__esModule",{value:!0});var t=Mr(),r=_r();function n(e,r,n){for(var i=1634760805,o=857760878,s=2036477234,a=1797285236,c=n[3]<<24|n[2]<<16|n[1]<<8|n[0],u=n[7]<<24|n[6]<<16|n[5]<<8|n[4],l=n[11]<<24|n[10]<<16|n[9]<<8|n[8],d=n[15]<<24|n[14]<<16|n[13]<<8|n[12],f=n[19]<<24|n[18]<<16|n[17]<<8|n[16],h=n[23]<<24|n[22]<<16|n[21]<<8|n[20],p=n[27]<<24|n[26]<<16|n[25]<<8|n[24],m=n[31]<<24|n[30]<<16|n[29]<<8|n[28],g=r[3]<<24|r[2]<<16|r[1]<<8|r[0],b=r[7]<<24|r[6]<<16|r[5]<<8|r[4],y=r[11]<<24|r[10]<<16|r[9]<<8|r[8],v=r[15]<<24|r[14]<<16|r[13]<<8|r[12],w=i,A=o,E=s,S=a,x=c,M=u,_=l,k=d,T=f,C=h,N=p,I=m,B=g,O=b,D=y,j=v,L=0;L<20;L+=2)x=(x^=T=T+(B=(B^=w=w+x|0)>>>16|B<<16)|0)>>>20|x<<12,M=(M^=C=C+(O=(O^=A=A+M|0)>>>16|O<<16)|0)>>>20|M<<12,_=(_^=N=N+(D=(D^=E=E+_|0)>>>16|D<<16)|0)>>>20|_<<12,k=(k^=I=I+(j=(j^=S=S+k|0)>>>16|j<<16)|0)>>>20|k<<12,_=(_^=N=N+(D=(D^=E=E+_|0)>>>24|D<<8)|0)>>>25|_<<7,k=(k^=I=I+(j=(j^=S=S+k|0)>>>24|j<<8)|0)>>>25|k<<7,M=(M^=C=C+(O=(O^=A=A+M|0)>>>24|O<<8)|0)>>>25|M<<7,x=(x^=T=T+(B=(B^=w=w+x|0)>>>24|B<<8)|0)>>>25|x<<7,M=(M^=N=N+(j=(j^=w=w+M|0)>>>16|j<<16)|0)>>>20|M<<12,_=(_^=I=I+(B=(B^=A=A+_|0)>>>16|B<<16)|0)>>>20|_<<12,k=(k^=T=T+(O=(O^=E=E+k|0)>>>16|O<<16)|0)>>>20|k<<12,x=(x^=C=C+(D=(D^=S=S+x|0)>>>16|D<<16)|0)>>>20|x<<12,k=(k^=T=T+(O=(O^=E=E+k|0)>>>24|O<<8)|0)>>>25|k<<7,x=(x^=C=C+(D=(D^=S=S+x|0)>>>24|D<<8)|0)>>>25|x<<7,_=(_^=I=I+(B=(B^=A=A+_|0)>>>24|B<<8)|0)>>>25|_<<7,M=(M^=N=N+(j=(j^=w=w+M|0)>>>24|j<<8)|0)>>>25|M<<7;t.writeUint32LE(w+i|0,e,0),t.writeUint32LE(A+o|0,e,4),t.writeUint32LE(E+s|0,e,8),t.writeUint32LE(S+a|0,e,12),t.writeUint32LE(x+c|0,e,16),t.writeUint32LE(M+u|0,e,20),t.writeUint32LE(_+l|0,e,24),t.writeUint32LE(k+d|0,e,28),t.writeUint32LE(T+f|0,e,32),t.writeUint32LE(C+h|0,e,36),t.writeUint32LE(N+p|0,e,40),t.writeUint32LE(I+m|0,e,44),t.writeUint32LE(B+g|0,e,48),t.writeUint32LE(O+b|0,e,52),t.writeUint32LE(D+y|0,e,56),t.writeUint32LE(j+v|0,e,60)}function i(e,t,i,o,a){if(void 0===a&&(a=0),32!==e.length)throw new Error("ChaCha: key size must be 32 bytes");if(o.length<i.length)throw new Error("ChaCha: destination is shorter than source");var c,u;if(0===a){if(8!==t.length&&12!==t.length)throw new Error("ChaCha nonce must be 8 or 12 bytes");u=(c=new Uint8Array(16)).length-t.length,c.set(t,u)}else{if(16!==t.length)throw new Error("ChaCha nonce with counter must be 16 bytes");c=t,u=a}for(var l=new Uint8Array(64),d=0;d<i.length;d+=64){n(l,c,e);for(var f=d;f<d+64&&f<i.length;f++)o[f]=i[f]^l[f-d];s(c,0,u)}return r.wipe(l),0===a&&r.wipe(c),o}function o(e,t,n,o){return void 0===o&&(o=0),r.wipe(n),i(e,t,n,n,o)}function s(e,t,r){for(var n=1;r--;)n=n+(255&e[t])|0,e[t]=255&n,n>>>=8,t++;if(n>0)throw new Error("ChaCha: counter overflow")}I(n,"core"),I(i,"streamXOR"),e.streamXOR=i,I(o,"stream"),e.stream=o,I(s,"incrementCounter")}}),wn=j({"../../node_modules/.pnpm/@stablelib+xchacha20@1.0.1/node_modules/@stablelib/xchacha20/lib/xchacha20.js"(e){Object.defineProperty(e,"__esModule",{value:!0});var t=Mr(),r=_r(),n=vn();function i(e,t,i,o){if(24!==t.length)throw new Error("XChaCha20 nonce must be 24 bytes");var a=s(e,t.subarray(0,16),new Uint8Array(32)),c=new Uint8Array(12);c.set(t.subarray(16),4);var u=n.streamXOR(a,c,i,o);return r.wipe(a),u}function o(e,t,n){return r.wipe(n),i(e,t,n,n)}function s(e,r,n){for(var i=1634760805,o=857760878,s=2036477234,a=1797285236,c=e[3]<<24|e[2]<<16|e[1]<<8|e[0],u=e[7]<<24|e[6]<<16|e[5]<<8|e[4],l=e[11]<<24|e[10]<<16|e[9]<<8|e[8],d=e[15]<<24|e[14]<<16|e[13]<<8|e[12],f=e[19]<<24|e[18]<<16|e[17]<<8|e[16],h=e[23]<<24|e[22]<<16|e[21]<<8|e[20],p=e[27]<<24|e[26]<<16|e[25]<<8|e[24],m=e[31]<<24|e[30]<<16|e[29]<<8|e[28],g=r[3]<<24|r[2]<<16|r[1]<<8|r[0],b=r[7]<<24|r[6]<<16|r[5]<<8|r[4],y=r[11]<<24|r[10]<<16|r[9]<<8|r[8],v=r[15]<<24|r[14]<<16|r[13]<<8|r[12],w=0;w<20;w+=2)c=(c^=f=f+(g=(g^=i=i+c|0)>>>16|g<<16)|0)>>>20|c<<12,u=(u^=h=h+(b=(b^=o=o+u|0)>>>16|b<<16)|0)>>>20|u<<12,l=(l^=p=p+(y=(y^=s=s+l|0)>>>16|y<<16)|0)>>>20|l<<12,d=(d^=m=m+(v=(v^=a=a+d|0)>>>16|v<<16)|0)>>>20|d<<12,l=(l^=p=p+(y=(y^=s=s+l|0)>>>24|y<<8)|0)>>>25|l<<7,d=(d^=m=m+(v=(v^=a=a+d|0)>>>24|v<<8)|0)>>>25|d<<7,u=(u^=h=h+(b=(b^=o=o+u|0)>>>24|b<<8)|0)>>>25|u<<7,c=(c^=f=f+(g=(g^=i=i+c|0)>>>24|g<<8)|0)>>>25|c<<7,u=(u^=p=p+(v=(v^=i=i+u|0)>>>16|v<<16)|0)>>>20|u<<12,l=(l^=m=m+(g=(g^=o=o+l|0)>>>16|g<<16)|0)>>>20|l<<12,d=(d^=f=f+(b=(b^=s=s+d|0)>>>16|b<<16)|0)>>>20|d<<12,c=(c^=h=h+(y=(y^=a=a+c|0)>>>16|y<<16)|0)>>>20|c<<12,d=(d^=f=f+(b=(b^=s=s+d|0)>>>24|b<<8)|0)>>>25|d<<7,c=(c^=h=h+(y=(y^=a=a+c|0)>>>24|y<<8)|0)>>>25|c<<7,l=(l^=m=m+(g=(g^=o=o+l|0)>>>24|g<<8)|0)>>>25|l<<7,u=(u^=p=p+(v=(v^=i=i+u|0)>>>24|v<<8)|0)>>>25|u<<7;return t.writeUint32LE(i,n,0),t.writeUint32LE(o,n,4),t.writeUint32LE(s,n,8),t.writeUint32LE(a,n,12),t.writeUint32LE(g,n,16),t.writeUint32LE(b,n,20),t.writeUint32LE(y,n,24),t.writeUint32LE(v,n,28),n}I(i,"streamXOR"),e.streamXOR=i,I(o,"stream"),e.stream=o,I(s,"hchacha"),e.hchacha=s}}),An=j({"../../node_modules/.pnpm/@stablelib+constant-time@1.0.1/node_modules/@stablelib/constant-time/lib/constant-time.js"(e){function t(e,t,r){return~(e-1)&t|e-1&r}function r(e,t){return(0|e)-(0|t)-1>>>31&1}function n(e,t){if(e.length!==t.length)return 0;for(var r=0,n=0;n<e.length;n++)r|=e[n]^t[n];return 1&r-1>>>8}function i(e,t){return 0!==e.length&&0!==t.length&&0!==n(e,t)}Object.defineProperty(e,"__esModule",{value:!0}),I(t,"select"),e.select=t,I(r,"lessOrEqual"),e.lessOrEqual=r,I(n,"compare"),e.compare=n,I(i,"equal"),e.equal=i}}),En=j({"../../node_modules/.pnpm/@stablelib+poly1305@1.0.1/node_modules/@stablelib/poly1305/lib/poly1305.js"(e){Object.defineProperty(e,"__esModule",{value:!0});var t=An(),r=_r();e.DIGEST_LENGTH=16;var n=function(){function t(t){this.digestLength=e.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var r=t[0]|t[1]<<8;this._r[0]=8191&r;var n=t[2]|t[3]<<8;this._r[1]=8191&(r>>>13|n<<3);var i=t[4]|t[5]<<8;this._r[2]=7939&(n>>>10|i<<6);var o=t[6]|t[7]<<8;this._r[3]=8191&(i>>>7|o<<9);var s=t[8]|t[9]<<8;this._r[4]=255&(o>>>4|s<<12),this._r[5]=s>>>1&8190;var a=t[10]|t[11]<<8;this._r[6]=8191&(s>>>14|a<<2);var c=t[12]|t[13]<<8;this._r[7]=8065&(a>>>11|c<<5);var u=t[14]|t[15]<<8;this._r[8]=8191&(c>>>8|u<<8),this._r[9]=u>>>5&127,this._pad[0]=t[16]|t[17]<<8,this._pad[1]=t[18]|t[19]<<8,this._pad[2]=t[20]|t[21]<<8,this._pad[3]=t[22]|t[23]<<8,this._pad[4]=t[24]|t[25]<<8,this._pad[5]=t[26]|t[27]<<8,this._pad[6]=t[28]|t[29]<<8,this._pad[7]=t[30]|t[31]<<8}return I(t,"Poly1305"),t.prototype._blocks=function(e,t,r){for(var n=this._fin?0:2048,i=this._h[0],o=this._h[1],s=this._h[2],a=this._h[3],c=this._h[4],u=this._h[5],l=this._h[6],d=this._h[7],f=this._h[8],h=this._h[9],p=this._r[0],m=this._r[1],g=this._r[2],b=this._r[3],y=this._r[4],v=this._r[5],w=this._r[6],A=this._r[7],E=this._r[8],S=this._r[9];r>=16;){var x=e[t+0]|e[t+1]<<8;i+=8191&x;var M=e[t+2]|e[t+3]<<8;o+=8191&(x>>>13|M<<3);var _=e[t+4]|e[t+5]<<8;s+=8191&(M>>>10|_<<6);var k=e[t+6]|e[t+7]<<8;a+=8191&(_>>>7|k<<9);var T=e[t+8]|e[t+9]<<8;c+=8191&(k>>>4|T<<12),u+=T>>>1&8191;var C=e[t+10]|e[t+11]<<8;l+=8191&(T>>>14|C<<2);var N=e[t+12]|e[t+13]<<8;d+=8191&(C>>>11|N<<5);var I=e[t+14]|e[t+15]<<8,B=0,O=B;O+=i*p,O+=o*(5*S),O+=s*(5*E),O+=a*(5*A),B=(O+=c*(5*w))>>>13,O&=8191,O+=u*(5*v),O+=l*(5*y),O+=d*(5*b),O+=(f+=8191&(N>>>8|I<<8))*(5*g);var D=B+=(O+=(h+=I>>>5|n)*(5*m))>>>13;D+=i*m,D+=o*p,D+=s*(5*S),D+=a*(5*E),B=(D+=c*(5*A))>>>13,D&=8191,D+=u*(5*w),D+=l*(5*v),D+=d*(5*y),D+=f*(5*b),B+=(D+=h*(5*g))>>>13,D&=8191;var j=B;j+=i*g,j+=o*m,j+=s*p,j+=a*(5*S),B=(j+=c*(5*E))>>>13,j&=8191,j+=u*(5*A),j+=l*(5*w),j+=d*(5*v),j+=f*(5*y);var L=B+=(j+=h*(5*b))>>>13;L+=i*b,L+=o*g,L+=s*m,L+=a*p,B=(L+=c*(5*S))>>>13,L&=8191,L+=u*(5*E),L+=l*(5*A),L+=d*(5*w),L+=f*(5*v);var P=B+=(L+=h*(5*y))>>>13;P+=i*y,P+=o*b,P+=s*g,P+=a*m,B=(P+=c*p)>>>13,P&=8191,P+=u*(5*S),P+=l*(5*E),P+=d*(5*A),P+=f*(5*w);var R=B+=(P+=h*(5*v))>>>13;R+=i*v,R+=o*y,R+=s*b,R+=a*g,B=(R+=c*m)>>>13,R&=8191,R+=u*p,R+=l*(5*S),R+=d*(5*E),R+=f*(5*A);var U=B+=(R+=h*(5*w))>>>13;U+=i*w,U+=o*v,U+=s*y,U+=a*b,B=(U+=c*g)>>>13,U&=8191,U+=u*m,U+=l*p,U+=d*(5*S),U+=f*(5*E);var z=B+=(U+=h*(5*A))>>>13;z+=i*A,z+=o*w,z+=s*v,z+=a*y,B=(z+=c*b)>>>13,z&=8191,z+=u*g,z+=l*m,z+=d*p,z+=f*(5*S);var K=B+=(z+=h*(5*E))>>>13;K+=i*E,K+=o*A,K+=s*w,K+=a*v,B=(K+=c*y)>>>13,K&=8191,K+=u*b,K+=l*g,K+=d*m,K+=f*p;var F=B+=(K+=h*(5*S))>>>13;F+=i*S,F+=o*E,F+=s*A,F+=a*w,B=(F+=c*v)>>>13,F&=8191,F+=u*y,F+=l*b,F+=d*g,F+=f*m,i=O=8191&(B=(B=((B+=(F+=h*p)>>>13)<<2)+B|0)+(O&=8191)|0),o=D+=B>>>=13,s=j&=8191,a=L&=8191,c=P&=8191,u=R&=8191,l=U&=8191,d=z&=8191,f=K&=8191,h=F&=8191,t+=16,r-=16}this._h[0]=i,this._h[1]=o,this._h[2]=s,this._h[3]=a,this._h[4]=c,this._h[5]=u,this._h[6]=l,this._h[7]=d,this._h[8]=f,this._h[9]=h},t.prototype.finish=function(e,t){void 0===t&&(t=0);var r,n,i,o,s=new Uint16Array(10);if(this._leftover){for(o=this._leftover,this._buffer[o++]=1;o<16;o++)this._buffer[o]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(r=this._h[1]>>>13,this._h[1]&=8191,o=2;o<10;o++)this._h[o]+=r,r=this._h[o]>>>13,this._h[o]&=8191;for(this._h[0]+=5*r,r=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=r,r=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=r,s[0]=this._h[0]+5,r=s[0]>>>13,s[0]&=8191,o=1;o<10;o++)s[o]=this._h[o]+r,r=s[o]>>>13,s[o]&=8191;for(s[9]-=8192,n=(1^r)-1,o=0;o<10;o++)s[o]&=n;for(n=~n,o=0;o<10;o++)this._h[o]=this._h[o]&n|s[o];for(this._h[0]=65535&(this._h[0]|this._h[1]<<13),this._h[1]=65535&(this._h[1]>>>3|this._h[2]<<10),this._h[2]=65535&(this._h[2]>>>6|this._h[3]<<7),this._h[3]=65535&(this._h[3]>>>9|this._h[4]<<4),this._h[4]=65535&(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14),this._h[5]=65535&(this._h[6]>>>2|this._h[7]<<11),this._h[6]=65535&(this._h[7]>>>5|this._h[8]<<8),this._h[7]=65535&(this._h[8]>>>8|this._h[9]<<5),i=this._h[0]+this._pad[0],this._h[0]=65535&i,o=1;o<8;o++)i=(this._h[o]+this._pad[o]|0)+(i>>>16)|0,this._h[o]=65535&i;return e[t+0]=this._h[0]>>>0,e[t+1]=this._h[0]>>>8,e[t+2]=this._h[1]>>>0,e[t+3]=this._h[1]>>>8,e[t+4]=this._h[2]>>>0,e[t+5]=this._h[2]>>>8,e[t+6]=this._h[3]>>>0,e[t+7]=this._h[3]>>>8,e[t+8]=this._h[4]>>>0,e[t+9]=this._h[4]>>>8,e[t+10]=this._h[5]>>>0,e[t+11]=this._h[5]>>>8,e[t+12]=this._h[6]>>>0,e[t+13]=this._h[6]>>>8,e[t+14]=this._h[7]>>>0,e[t+15]=this._h[7]>>>8,this._finished=!0,this},t.prototype.update=function(e){var t,r=0,n=e.length;if(this._leftover){(t=16-this._leftover)>n&&(t=n);for(var i=0;i<t;i++)this._buffer[this._leftover+i]=e[r+i];if(n-=t,r+=t,this._leftover+=t,this._leftover<16)return this;this._blocks(this._buffer,0,16),this._leftover=0}if(n>=16&&(t=n-n%16,this._blocks(e,r,t),r+=t,n-=t),n){for(i=0;i<n;i++)this._buffer[this._leftover+i]=e[r+i];this._leftover+=n}return this},t.prototype.digest=function(){if(this._finished)throw new Error("Poly1305 was finished");var e=new Uint8Array(16);return this.finish(e),e},t.prototype.clean=function(){return r.wipe(this._buffer),r.wipe(this._r),r.wipe(this._h),r.wipe(this._pad),this._leftover=0,this._fin=0,this._finished=!0,this},t}();function i(e,t){var r=new n(e);r.update(t);var i=r.digest();return r.clean(),i}function o(r,n){return r.length===e.DIGEST_LENGTH&&n.length===e.DIGEST_LENGTH&&t.equal(r,n)}e.Poly1305=n,I(i,"oneTimeAuth"),e.oneTimeAuth=i,I(o,"equal"),e.equal=o}}),Sn=j({"../../node_modules/.pnpm/@stablelib+chacha20poly1305@1.0.1/node_modules/@stablelib/chacha20poly1305/lib/chacha20poly1305.js"(e){Object.defineProperty(e,"__esModule",{value:!0});var t=vn(),r=En(),n=_r(),i=Mr(),o=An();e.KEY_LENGTH=32,e.NONCE_LENGTH=12,e.TAG_LENGTH=16;var s=new Uint8Array(16),a=function(){function a(t){if(this.nonceLength=e.NONCE_LENGTH,this.tagLength=e.TAG_LENGTH,t.length!==e.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(t)}return I(a,"ChaCha20Poly1305"),a.prototype.seal=function(e,r,i,o){if(e.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");var s=new Uint8Array(16);s.set(e,s.length-e.length);var a=new Uint8Array(32);t.stream(this._key,s,a,4);var c,u=r.length+this.tagLength;if(o){if(o.length!==u)throw new Error("ChaCha20Poly1305: incorrect destination length");c=o}else c=new Uint8Array(u);return t.streamXOR(this._key,s,r,c,4),this._authenticate(c.subarray(c.length-this.tagLength,c.length),a,c.subarray(0,c.length-this.tagLength),i),n.wipe(s),c},a.prototype.open=function(e,r,i,s){if(e.length>16)throw new Error("ChaCha20Poly1305: incorrect nonce length");if(r.length<this.tagLength)return null;var a=new Uint8Array(16);a.set(e,a.length-e.length);var c=new Uint8Array(32);t.stream(this._key,a,c,4);var u=new Uint8Array(this.tagLength);if(this._authenticate(u,c,r.subarray(0,r.length-this.tagLength),i),!o.equal(u,r.subarray(r.length-this.tagLength,r.length)))return null;var l,d=r.length-this.tagLength;if(s){if(s.length!==d)throw new Error("ChaCha20Poly1305: incorrect destination length");l=s}else l=new Uint8Array(d);return t.streamXOR(this._key,a,r.subarray(0,r.length-this.tagLength),l,4),n.wipe(a),l},a.prototype.clean=function(){return n.wipe(this._key),this},a.prototype._authenticate=function(e,t,o,a){var c=new r.Poly1305(t);a&&(c.update(a),a.length%16>0&&c.update(s.subarray(a.length%16))),c.update(o),o.length%16>0&&c.update(s.subarray(o.length%16));var u=new Uint8Array(8);a&&i.writeUint64LE(a.length,u),c.update(u),i.writeUint64LE(o.length,u),c.update(u);for(var l=c.digest(),d=0;d<l.length;d++)e[d]=l[d];c.clean(),n.wipe(l),n.wipe(u)},a}();e.ChaCha20Poly1305=a}}),xn=j({"../../node_modules/.pnpm/@stablelib+xchacha20poly1305@1.0.1/node_modules/@stablelib/xchacha20poly1305/lib/xchacha20poly1305.js"(e){Object.defineProperty(e,"__esModule",{value:!0});var t=wn(),r=Sn(),n=_r();e.KEY_LENGTH=32,e.NONCE_LENGTH=24,e.TAG_LENGTH=16;var i=function(){function i(t){if(this.nonceLength=e.NONCE_LENGTH,this.tagLength=e.TAG_LENGTH,t.length!==e.KEY_LENGTH)throw new Error("ChaCha20Poly1305 needs 32-byte key");this._key=new Uint8Array(t)}return I(i,"XChaCha20Poly1305"),i.prototype.seal=function(e,i,o,s){if(24!==e.length)throw new Error("XChaCha20Poly1305: incorrect nonce length");var a=t.hchacha(this._key,e.subarray(0,16),new Uint8Array(32)),c=new Uint8Array(12);c.set(e.subarray(16),4);var u=new r.ChaCha20Poly1305(a),l=u.seal(c,i,o,s);return n.wipe(a),n.wipe(c),u.clean(),l},i.prototype.open=function(e,i,o,s){if(24!==e.length)throw new Error("XChaCha20Poly1305: incorrect nonce length");if(i.length<this.tagLength)return null;var a=t.hchacha(this._key,e.subarray(0,16),new Uint8Array(32)),c=new Uint8Array(12);c.set(e.subarray(16),4);var u=new r.ChaCha20Poly1305(a),l=u.open(c,i,o,s);return n.wipe(a),n.wipe(c),u.clean(),l},i.prototype.clean=function(){return n.wipe(this._key),this},i}();e.XChaCha20Poly1305=i}}),Mn=j({"../../node_modules/.pnpm/apg-js@4.1.1/node_modules/apg-js/src/apg-lib/identifiers.js"(e,t){t.exports={ALT:1,CAT:2,REP:3,RNM:4,TRG:5,TBS:6,TLS:7,UDT:11,AND:12,NOT:13,BKR:14,BKA:15,BKN:16,ABG:17,AEN:18,ACTIVE:100,MATCH:101,EMPTY:102,NOMATCH:103,SEM_PRE:200,SEM_POST:201,SEM_OK:300,SEM_SKIP:301,ATTR_N:400,ATTR_R:401,ATTR_MR:402,LOOKAROUND_NONE:500,LOOKAROUND_AHEAD:501,LOOKAROUND_BEHIND:502,BKR_MODE_UM:601,BKR_MODE_PM:602,BKR_MODE_CS:603,BKR_MODE_CI:604}}}),_n=j({"../../node_modules/.pnpm/apg-js@4.1.1/node_modules/apg-js/src/apg-lib/style.js"(e,t){t.exports={CLASS_MONOSPACE:"apg-mono",CLASS_ACTIVE:"apg-active",CLASS_EMPTY:"apg-empty",CLASS_MATCH:"apg-match",CLASS_NOMATCH:"apg-nomatch",CLASS_LOOKAHEAD:"apg-lh-match",CLASS_LOOKBEHIND:"apg-lb-match",CLASS_REMAINDER:"apg-remainder",CLASS_CTRLCHAR:"apg-ctrl-char",CLASS_LINEEND:"apg-line-end",CLASS_ERROR:"apg-error",CLASS_PHRASE:"apg-phrase",CLASS_EMPTYPHRASE:"apg-empty-phrase",CLASS_STATE:"apg-state",CLASS_STATS:"apg-stats",CLASS_TRACE:"apg-trace",CLASS_GRAMMAR:"apg-grammar",CLASS_RULES:"apg-rules",CLASS_RULESLINK:"apg-rules-link",CLASS_ATTRIBUTES:"apg-attrs"}}}),kn=j({"../../node_modules/.pnpm/apg-js@4.1.1/node_modules/apg-js/src/apg-conv-api/transformers.js"(e){var t=e,r=4294967292,n=4294967293,i=4294967294,o=4294967295,s=[0,1,3,7,15,31,63,127,255,511,1023],a=["00","01","02","03","04","05","06","07","08","09","0A","0B","0C","0D","0E","0F","10","11","12","13","14","15","16","17","18","19","1A","1B","1C","1D","1E","1F","20","21","22","23","24","25","26","27","28","29","2A","2B","2C","2D","2E","2F","30","31","32","33","34","35","36","37","38","39","3A","3B","3C","3D","3E","3F","40","41","42","43","44","45","46","47","48","49","4A","4B","4C","4D","4E","4F","50","51","52","53","54","55","56","57","58","59","5A","5B","5C","5D","5E","5F","60","61","62","63","64","65","66","67","68","69","6A","6B","6C","6D","6E","6F","70","71","72","73","74","75","76","77","78","79","7A","7B","7C","7D","7E","7F","80","81","82","83","84","85","86","87","88","89","8A","8B","8C","8D","8E","8F","90","91","92","93","94","95","96","97","98","99","9A","9B","9C","9D","9E","9F","A0","A1","A2","A3","A4","A5","A6","A7","A8","A9","AA","AB","AC","AD","AE","AF","B0","B1","B2","B3","B4","B5","B6","B7","B8","B9","BA","BB","BC","BD","BE","BF","C0","C1","C2","C3","C4","C5","C6","C7","C8","C9","CA","CB","CC","CD","CE","CF","D0","D1","D2","D3","D4","D5","D6","D7","D8","D9","DA","DB","DC","DD","DE","DF","E0","E1","E2","E3","E4","E5","E6","E7","E8","E9","EA","EB","EC","ED","EE","EF","F0","F1","F2","F3","F4","F5","F6","F7","F8","F9","FA","FB","FC","FD","FE","FF"],c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".split(""),u=[];c.forEach((e=>{u.push(e.charCodeAt(0))})),e.utf8={encode(e){const t=[];return e.forEach((e=>{if(e>=0&&e<=127)t.push(e);else if(e<=2047)t.push(192+(e>>6&s[5])),t.push(128+(e&s[6]));else if(e<55296||e>57343&&e<=65535)t.push(224+(e>>12&s[4])),t.push(128+(e>>6&s[6])),t.push(128+(e&s[6]));else{if(!(e>=65536&&e<=1114111))throw new RangeError(`utf8.encode: character out of range: char: ${e}`);{const r=e>>16&s[5];t.push(240+(r>>2)),t.push(128+((r&s[2])<<4)+(e>>12&s[4])),t.push(128+(e>>6&s[6])),t.push(128+(e&s[6]))}}})),Buffer.from(t)},decode(e,t){function a(e,t){if(128!=(192&t))return n;const i=((e&s[5])<<6)+(t&s[6]);return i<128?r:i}function c(e,t,o){if(128!=(192&o)||128!=(192&t))return n;const a=((e&s[4])<<12)+((t&s[6])<<6)+(o&s[6]);return a<2048?r:a>=55296&&a<=57343?i:a}function u(e,t,o,a){if(128!=(192&a)||128!=(192&o)||128!=(192&t))return n;const c=(((e&s[3])<<2)+(t>>4&s[2])<<16)+((t&s[4])<<12)+((o&s[6])<<6)+(a&s[6]);return c<65536?r:c>1114111?i:c}let l,d,f,h,p,m;I(a,"bytes2"),I(c,"bytes3"),I(u,"bytes4");const g=e.length;let b=t?3:0;const y=[];for(;b<g;){d=e[b],l=o;const t=!0;for(;t;){if(d>=0&&d<=127){l=d,m=1;break}if(f=b+1,f<g&&d>=194&&d<=223){l=a(d,e[f]),m=2;break}if(h=b+2,h<g&&d>=224&&d<=239){l=c(d,e[f],e[h]),m=3;break}if(p=b+3,p<g&&d>=240&&d<=244){l=u(d,e[f],e[h],e[p]),m=4;break}break}if(l>1114111){const e=`byte[${b}]`;if(l===o)throw new RangeError(`utf8.decode: ill-formed UTF8 byte sequence found at: ${e}`);if(l===n)throw new RangeError(`utf8.decode: illegal trailing byte found at: ${e}`);if(l===i)throw new RangeError(`utf8.decode: code point out of range found at: ${e}`);if(l===r)throw new RangeError(`utf8.decode: non-shortest form found at: ${e}`);throw new RangeError(`utf8.decode: unrecognized error found at: ${e}`)}y.push(l),b+=m}return y}},e.utf16be={encode(e){const t=[];let r,n,i;for(let o=0;o<e.length;o+=1)if(r=e[o],r>=0&&r<=55295||r>=57344&&r<=65535)t.push(r>>8&s[8]),t.push(r&s[8]);else{if(!(r>=65536&&r<=1114111))throw new RangeError(`utf16be.encode: UTF16BE value out of range: char[${o}]: ${r}`);i=r-65536,n=55296+(i>>10),i=56320+(i&s[10]),t.push(n>>8&s[8]),t.push(n&s[8]),t.push(i>>8&s[8]),t.push(i&s[8])}return Buffer.from(t)},decode(e,t){if(e.length%2>0)throw new RangeError(`utf16be.decode: data length must be even multiple of 2: length: ${e.length}`);const r=[],n=e.length;let i,o,s,a,c,u,l=t?2:0,d=0;for(;l<n;){const t=!0;for(;t;){if(s=l+1,s<n){if(c=(e[l]<<8)+e[s],c<55296||c>57343){i=c,o=2;break}if(a=l+3,a<n&&(u=(e[l+2]<<8)+e[a],c<=56319&&u>=56320&&u<=57343)){i=65536+(c-55296<<10)+(u-56320),o=4;break}}throw new RangeError(`utf16be.decode: ill-formed UTF16BE byte sequence found: byte[${l}]`)}r[d++]=i,l+=o}return r}},e.utf16le={encode(e){const t=[];let r,n,i;for(let o=0;o<e.length;o+=1)if(r=e[o],r>=0&&r<=55295||r>=57344&&r<=65535)t.push(r&s[8]),t.push(r>>8&s[8]);else{if(!(r>=65536&&r<=1114111))throw new RangeError(`utf16le.encode: UTF16LE value out of range: char[${o}]: ${r}`);i=r-65536,n=55296+(i>>10),i=56320+(i&s[10]),t.push(n&s[8]),t.push(n>>8&s[8]),t.push(i&s[8]),t.push(i>>8&s[8])}return Buffer.from(t)},decode(e,t){if(e.length%2>0)throw new RangeError(`utf16le.decode: data length must be even multiple of 2: length: ${e.length}`);const r=[],n=e.length;let i,o,s,a,c,u,l=t?2:0,d=0;for(;l<n;){const t=!0;for(;t;){if(s=l+1,s<n){if(c=(e[s]<<8)+e[l],c<55296||c>57343){i=c,o=2;break}if(a=l+3,a<n&&(u=(e[a]<<8)+e[l+2],c<=56319&&u>=56320&&u<=57343)){i=65536+(c-55296<<10)+(u-56320),o=4;break}}throw new RangeError(`utf16le.decode: ill-formed UTF16LE byte sequence found: byte[${l}]`)}r[d++]=i,l+=o}return r}},e.utf32be={encode(e){const t=Buffer.alloc(4*e.length);let r=0;return e.forEach((e=>{if(e>=55296&&e<=57343||e>1114111)throw new RangeError(`utf32be.encode: UTF32BE character code out of range: char[${r/4}]: ${e}`);t[r++]=e>>24&s[8],t[r++]=e>>16&s[8],t[r++]=e>>8&s[8],t[r++]=e&s[8]})),t},decode(e,t){if(e.length%4>0)throw new RangeError(`utf32be.decode: UTF32BE byte length must be even multiple of 4: length: ${e.length}`);const r=[];let n=t?4:0;for(;n<e.length;n+=4){const t=(e[n]<<24)+(e[n+1]<<16)+(e[n+2]<<8)+e[n+3];if(t>=55296&&t<=57343||t>1114111)throw new RangeError(`utf32be.decode: UTF32BE character code out of range: char[${n/4}]: ${t}`);r.push(t)}return r}},e.utf32le={encode(e){const t=Buffer.alloc(4*e.length);let r=0;return e.forEach((e=>{if(e>=55296&&e<=57343||e>1114111)throw new RangeError(`utf32le.encode: UTF32LE character code out of range: char[${r/4}]: ${e}`);t[r++]=e&s[8],t[r++]=e>>8&s[8],t[r++]=e>>16&s[8],t[r++]=e>>24&s[8]})),t},decode(e,t){if(e.length%4>0)throw new RangeError(`utf32be.decode: UTF32LE byte length must be even multiple of 4: length: ${e.length}`);const r=[];let n=t?4:0;for(;n<e.length;n+=4){const t=(e[n+3]<<24)+(e[n+2]<<16)+(e[n+1]<<8)+e[n];if(t>=55296&&t<=57343||t>1114111)throw new RangeError(`utf32le.encode: UTF32LE character code out of range: char[${n/4}]: ${t}`);r.push(t)}return r}},e.uint7={encode(e){const t=Buffer.alloc(e.length);for(let r=0;r<e.length;r+=1){if(e[r]>127)throw new RangeError(`uint7.encode: UINT7 character code out of range: char[${r}]: ${e[r]}`);t[r]=e[r]}return t},decode(e){const t=[];for(let r=0;r<e.length;r+=1){if(e[r]>127)throw new RangeError(`uint7.decode: UINT7 character code out of range: byte[${r}]: ${e[r]}`);t[r]=e[r]}return t}},e.uint8={encode(e){const t=Buffer.alloc(e.length);for(let r=0;r<e.length;r+=1){if(e[r]>255)throw new RangeError(`uint8.encode: UINT8 character code out of range: char[${r}]: ${e[r]}`);t[r]=e[r]}return t},decode(e){const t=[];for(let r=0;r<e.length;r+=1)t[r]=e[r];return t}},e.uint16be={encode(e){const t=Buffer.alloc(2*e.length);let r=0;return e.forEach((e=>{if(e>65535)throw new RangeError(`uint16be.encode: UINT16BE character code out of range: char[${r/2}]: ${e}`);t[r++]=e>>8&s[8],t[r++]=e&s[8]})),t},decode(e){if(e.length%2>0)throw new RangeError(`uint16be.decode: UINT16BE byte length must be even multiple of 2: length: ${e.length}`);const t=[];for(let r=0;r<e.length;r+=2)t.push((e[r]<<8)+e[r+1]);return t}},e.uint16le={encode(e){const t=Buffer.alloc(2*e.length);let r=0;return e.forEach((e=>{if(e>65535)throw new RangeError(`uint16le.encode: UINT16LE character code out of range: char[${r/2}]: ${e}`);t[r++]=e&s[8],t[r++]=e>>8&s[8]})),t},decode(e){if(e.length%2>0)throw new RangeError(`uint16le.decode: UINT16LE byte length must be even multiple of 2: length: ${e.length}`);const t=[];for(let r=0;r<e.length;r+=2)t.push((e[r+1]<<8)+e[r]);return t}},e.uint32be={encode(e){const t=Buffer.alloc(4*e.length);let r=0;return e.forEach((e=>{t[r++]=e>>24&s[8],t[r++]=e>>16&s[8],t[r++]=e>>8&s[8],t[r++]=e&s[8]})),t},decode(e){if(e.length%4>0)throw new RangeError(`uint32be.decode: UINT32BE byte length must be even multiple of 4: length: ${e.length}`);const t=[];for(let r=0;r<e.length;r+=4)t.push((e[r]<<24)+(e[r+1]<<16)+(e[r+2]<<8)+e[r+3]);return t}},e.uint32le={encode(e){const t=Buffer.alloc(4*e.length);let r=0;return e.forEach((e=>{t[r++]=e&s[8],t[r++]=e>>8&s[8],t[r++]=e>>16&s[8],t[r++]=e>>24&s[8]})),t},decode(e){if(e.length%4>0)throw new RangeError(`uint32le.decode: UINT32LE byte length must be even multiple of 4: length: ${e.length}`);const t=[];for(let r=0;r<e.length;r+=4)t.push((e[r+3]<<24)+(e[r+2]<<16)+(e[r+1]<<8)+e[r]);return t}},e.string={encode:e=>t.utf16le.encode(e).toString("utf16le"),decode:e=>t.utf16le.decode(Buffer.from(e,"utf16le"),0)},e.escaped={encode(e){const t=[];for(let r=0;r<e.length;r+=1){const n=e[r];if(96===n)t.push(n),t.push(n);else if(10===n)t.push(n);else if(n>=32&&n<=126)t.push(n);else{let e="";if(n>=0&&n<=31)e+=`\`x${a[n]}`;else if(n>=127&&n<=255)e+=`\`x${a[n]}`;else if(n>=256&&n<=65535)e+=`\`u${a[n>>8&s[8]]}${a[n&s[8]]}`;else{if(!(n>=65536&&n<=4294967295))throw new Error("escape.encode(char): char > 0xffffffff not allowed");{e+="`u{";const t=n>>24&s[8];t>0&&(e+=a[t]),e+=`${a[n>>16&s[8]]+a[n>>8&s[8]]+a[n&s[8]]}}`}}Buffer.from(e).forEach((e=>{t.push(e)}))}}return Buffer.from(t)},decode(e){function t(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function r(e,r,n){const i={char:null,nexti:e+2,error:!0};if(e+1<r&&t(n[e])&&t(n[e+1])){const t=String.fromCodePoint(n[e],n[e+1]);i.char=parseInt(t,16),Number.isNaN(i.char)||(i.error=!1)}return i}function n(e,r,n){const i={char:null,nexti:e+4,error:!0};if(e+3<r&&t(n[e])&&t(n[e+1])&&t(n[e+2])&&t(n[e+3])){const t=String.fromCodePoint(n[e],n[e+1],n[e+2],n[e+3]);i.char=parseInt(t,16),Number.isNaN(i.char)||(i.error=!1)}return i}function i(e,r,n){const i={char:null,nexti:e+4,error:!0};let o="";for(;e<r&&t(n[e]);)o+=String.fromCodePoint(n[e]),e+=1;return i.char=parseInt(o,16),125!==n[e]||Number.isNaN(i.char)||(i.error=!1),i.nexti=e+1,i}I(t,"isHex"),I(r,"getx"),I(n,"getu"),I(i,"getU");const o=[],s=e.length;let a,c,u,l=0;for(;l<s;){const t=!0;for(;t;){if(u=!0,96!==e[l]){o.push(e[l]),l+=1,u=!1;break}if(a=l+1,a>=s)break;if(96===e[a]){o.push(96),l+=2,u=!1;break}if(120===e[a]){if(c=r(a+1,s,e),c.error)break;o.push(c.char),l=c.nexti,u=!1;break}if(117===e[a]){if(123===e[a+1]){if(c=i(a+2,s,e),c.error)break;o.push(c.char),l=c.nexti,u=!1;break}if(c=n(a+1,s,e),c.error)break;o.push(c.char),l=c.nexti,u=!1;break}break}if(u)throw new Error(`escaped.decode: ill-formed escape sequence at buf[${l}]`)}return o}};var l=10;e.lineEnds={crlf(e){const t=[];let r=0;for(;r<e.length;)switch(e[r]){case 13:r+1<e.length&&e[r+1]===l?r+=2:r+=1,t.push(13),t.push(l);break;case l:t.push(13),t.push(l),r+=1;break;default:t.push(e[r]),r+=1}return t.length>0&&t[t.length-1]!==l&&(t.push(13),t.push(l)),t},lf(e){const t=[];let r=0;for(;r<e.length;)switch(e[r]){case 13:r+1<e.length&&e[r+1]===l?r+=2:r+=1,t.push(l);break;case l:t.push(l),r+=1;break;default:t.push(e[r]),r+=1}return t.length>0&&t[t.length-1]!==l&&t.push(l),t}},e.base64={encode(e){if(0===e.length)return Buffer.alloc(0);let t,r,n,i=e.length%3;i=i>0?3-i:0;let o=(e.length+i)/3;const a=Buffer.alloc(4*o);i>0&&(o-=1),t=0,r=0;for(let i=0;i<o;i+=1)n=e[t++]<<16,n+=e[t++]<<8,n+=e[t++],a[r++]=u[n>>18&s[6]],a[r++]=u[n>>12&s[6]],a[r++]=u[n>>6&s[6]],a[r++]=u[n&s[6]];return 0===i?a:1===i?(n=e[t++]<<16,n+=e[t]<<8,a[r++]=u[n>>18&s[6]],a[r++]=u[n>>12&s[6]],a[r++]=u[n>>6&s[6]],a[r]=u[64],a):2===i?(n=e[t]<<16,a[r++]=u[n>>18&s[6]],a[r++]=u[n>>12&s[6]],a[r++]=u[64],a[r]=u[64],a):void 0},decode(e){function t(e){const t=[];let r=0;for(let n=0;n<e.length;n+=1){const i=e[n],o=!0;for(;o&&32!==i&&9!==i&&10!==i&&13!==i;){if(i>=65&&i<=90){t.push(i-65);break}if(i>=97&&i<=122){t.push(i-71);break}if(i>=48&&i<=57){t.push(i+4);break}if(43===i){t.push(62);break}if(47===i){t.push(63);break}if(61===i){t.push(64),r+=1;break}throw new RangeError(`base64.decode: invalid character buf[${n}]: ${i}`)}}if(t.length%4>0)throw new RangeError(`base64.decode: string length not integral multiple of 4: ${t.length}`);switch(r){case 0:break;case 1:if(64!==t[t.length-1])throw new RangeError("base64.decode: one tail character found: not last character");break;case 2:if(64!==t[t.length-1]||64!==t[t.length-2])throw new RangeError("base64.decode: two tail characters found: not last characters");break;default:throw new RangeError(`base64.decode: more than two tail characters found: ${r}`)}return{tail:r,buf:Buffer.from(t)}}if(I(t,"validate"),0===e.length)return Buffer.alloc(0);const r=t(e),{tail:n}=r,i=r.buf;let o,a,c,u=i.length/4;const l=Buffer.alloc(3*u-n);n>0&&(u-=1),a=0,o=0;for(let e=0;e<u;e+=1)c=i[o++]<<18,c+=i[o++]<<12,c+=i[o++]<<6,c+=i[o++],l[a++]=c>>16&s[8],l[a++]=c>>8&s[8],l[a++]=c&s[8];return 1===n&&(c=i[o++]<<18,c+=i[o++]<<12,c+=i[o]<<6,l[a++]=c>>16&s[8],l[a]=c>>8&s[8]),2===n&&(c=i[o++]<<18,c+=i[o++]<<12,l[a]=c>>16&s[8]),l},toString(e){if(e.length%4>0)throw new RangeError(`base64.toString: input buffer length not multiple of 4: ${e.length}`);let t="",r=0;function n(e,n,i,o){switch(r){case 76:t+=`\r\n${e}${n}${i}${o}`,r=4;break;case 75:t+=`${e}\r\n${n}${i}${o}`,r=3;break;case 74:t+=`${e+n}\r\n${i}${o}`,r=2;break;case 73:t+=`${e+n+i}\r\n${o}`,r=1;break;default:t+=e+n+i+o,r+=4}}function i(e){return e>=65&&e<=90||(e>=97&&e<=122||(e>=48&&e<=57||(43===e||(47===e||61===e))))}I(n,"buildLine"),I(i,"validate");for(let t=0;t<e.length;t+=4){for(let r=t;r<t+4;r+=1)if(!i(e[r]))throw new RangeError(`base64.toString: buf[${r}]: ${e[r]} : not valid base64 character code`);n(String.fromCharCode(e[t]),String.fromCharCode(e[t+1]),String.fromCharCode(e[t+2]),String.fromCharCode(e[t+3]))}return t}}}}),Tn=j({"../../node_modules/.pnpm/apg-js@4.1.1/node_modules/apg-js/src/apg-conv-api/converter.js"(e){var t=e,r=kn(),n="UTF8",i="UTF16",o="UTF16BE",s="UTF16LE",a="UTF32",c="UTF32BE",u="UTF32LE",l="UINT7",d="ASCII",f="BINARY",h="UINT8",p="UINT16",m="UINT16LE",g="UINT16BE",b="UINT32",y="UINT32LE",v="UINT32BE",w="ESCAPED",A="STRING",E=I((function(e){e.type=n;const t=e.data;e.bom=0,t.length>=3&&239===t[0]&&187===t[1]&&191===t[2]&&(e.bom=3)}),"bom8"),S=I((function(e){const t=e.data;switch(e.bom=0,e.type){case i:e.type=o,t.length>=2&&(254===t[0]&&255===t[1]?e.bom=2:255===t[0]&&254===t[1]&&(e.type=s,e.bom=2));break;case o:if(e.type=o,t.length>=2)if(254===t[0]&&255===t[1])e.bom=2;else if(255===t[0]&&254===t[1])throw new TypeError('src type: "UTF16BE" specified but BOM is for "UTF16LE"');break;case s:if(e.type=s,t.length>=0){if(254===t[0]&&255===t[1])throw new TypeError('src type: "UTF16LE" specified but BOM is for "UTF16BE"');255===t[0]&&254===t[1]&&(e.bom=2)}break;default:throw new TypeError(`UTF16 BOM: src type "${e.type}" unrecognized`)}}),"bom16"),x=I((function(e){const t=e.data;switch(e.bom=0,e.type){case a:e.type=c,t.length>=4&&(0===t[0]&&0===t[1]&&254===t[2]&&255===t[3]&&(e.bom=4),255===t[0]&&254===t[1]&&0===t[2]&&0===t[3]&&(e.type=u,e.bom=4));break;case c:if(e.type=c,t.length>=4&&(0===t[0]&&0===t[1]&&254===t[2]&&255===t[3]&&(e.bom=4),255===t[0]&&254===t[1]&&0===t[2]&&0===t[3]))throw new TypeError('src type: UTF32BE specified but BOM is for UTF32LE"');break;case u:if(e.type=u,t.length>=4){if(0===t[0]&&0===t[1]&&254===t[2]&&255===t[3])throw new TypeError('src type: "UTF32LE" specified but BOM is for "UTF32BE"');255===t[0]&&254===t[1]&&0===t[2]&&0===t[3]&&(e.bom=4)}break;default:throw new TypeError(`UTF32 BOM: src type "${e.type}" unrecognized`)}}),"bom32"),M=I((function(e,t){function M(e){const t={type:"",base64:!1},r=/^(base64:)?([a-zA-Z0-9]+)$/i.exec(e);return r&&(r[2]&&(t.type=r[2].toUpperCase()),r[1]&&(t.base64=!0)),t}if(I(M,"getType"),"string"!=typeof e||""===e)throw new TypeError(`type: "${e}" not recognized`);const _=M(e.toUpperCase());if(_.base64){if(_.type===A)throw new TypeError(`type: "${e} "BASE64:" prefix not allowed with type STRING`);if(Buffer.isBuffer(t))_.data=r.base64.decode(t);else{if("string"!=typeof t)throw new TypeError(`type: "${e} unrecognized data type: typeof(data): ${typeof t}`);{const e=Buffer.from(t,"ascii");_.data=r.base64.decode(e)}}}else _.data=t;switch(_.type){case n:E(_);break;case i:case o:case s:S(_);break;case a:case c:case u:x(_);break;case p:_.type=g;break;case b:_.type=v;break;case d:_.type=l;break;case f:_.type=h;break;case l:case h:case m:case g:case y:case v:case A:case w:break;default:throw new TypeError(`type: "${e}" not recognized`)}if(_.type===A){if("string"!=typeof _.data)throw new TypeError(`type: "${e}" but data is not a string`)}else if(!Buffer.isBuffer(_.data))throw new TypeError(`type: "${e}" but data is not a Buffer`);return _}),"validateSrc"),_=I((function(e,t){function r(e){let t,r;const n={crlf:!1,lf:!1,base64:!1,type:""};for(;;){if(r=e,t=e.slice(0,5),"CRLF:"===t){n.crlf=!0,r=e.slice(5);break}if(t=e.slice(0,3),"LF:"===t){n.lf=!0,r=e.slice(3);break}break}return t=r.split(":"),1===t.length?n.type=t[0]:2===t.length&&"BASE64"===t[1]&&(n.base64=!0,n.type=t[0]),n}if(I(r,"getType"),!Array.isArray(t))throw new TypeError('dst chars: not array: "'+typeof t);if("string"!=typeof e)throw new TypeError('dst type: not string: "'+typeof e);const E=r(e.toUpperCase());switch(E.type){case n:case o:case s:case c:case u:case l:case h:case m:case g:case y:case v:case w:break;case A:if(E.base64)throw new TypeError('":BASE64" suffix not allowed with type STRING');break;case d:E.type=l;break;case f:E.type=h;break;case i:E.type=o;break;case a:E.type=c;break;case p:E.type=g;break;case b:E.type=v;break;default:throw new TypeError(`dst type unrecognized: "${e}" : must have form [crlf:|lf:]type[:base64]`)}return E}),"validateDst"),k=I((function(e,t){switch(e){case n:return r.utf8.encode(t);case o:return r.utf16be.encode(t);case s:return r.utf16le.encode(t);case c:return r.utf32be.encode(t);case u:return r.utf32le.encode(t);case l:return r.uint7.encode(t);case h:return r.uint8.encode(t);case g:return r.uint16be.encode(t);case m:return r.uint16le.encode(t);case v:return r.uint32be.encode(t);case y:return r.uint32le.encode(t);case A:return r.string.encode(t);case w:return r.escaped.encode(t);default:throw new TypeError(`encode type "${e}" not recognized`)}}),"encode"),T=I((function(e){switch(e.type){case n:return r.utf8.decode(e.data,e.bom);case s:return r.utf16le.decode(e.data,e.bom);case o:return r.utf16be.decode(e.data,e.bom);case c:return r.utf32be.decode(e.data,e.bom);case u:return r.utf32le.decode(e.data,e.bom);case l:return r.uint7.decode(e.data);case h:return r.uint8.decode(e.data);case g:return r.uint16be.decode(e.data);case m:return r.uint16le.decode(e.data);case v:return r.uint32be.decode(e.data);case y:return r.uint32le.decode(e.data);case A:return r.string.decode(e.data);case w:return r.escaped.decode(e.data);default:throw new TypeError(`decode type "${e.type}" not recognized`)}}),"decode");e.decode=I((function(e,t){const r=M(e,t);return T(r)}),"exportsDecode"),e.encode=I((function(e,t){let n,i;const o=_(e,t);return o.crlf?(n=r.lineEnds.crlf(t),i=k(o.type,n)):o.lf?(n=r.lineEnds.lf(t),i=k(o.type,n)):i=k(o.type,t),o.base64&&(i=r.base64.encode(i)),i}),"exportsEncode"),e.convert=I((function(e,r,n){return t.encode(n,t.decode(e,r))}),"convert")}}),Cn=j({"../../node_modules/.pnpm/apg-js@4.1.1/node_modules/apg-js/src/apg-lib/emitcss.js"(e,t){t.exports=I((function(){return"/* This file automatically generated by jsonToless() and LESS. */\n.apg-mono {\n font-family: monospace;\n}\n.apg-active {\n font-weight: bold;\n color: #000000;\n}\n.apg-match {\n font-weight: bold;\n color: #264BFF;\n}\n.apg-empty {\n font-weight: bold;\n color: #0fbd0f;\n}\n.apg-nomatch {\n font-weight: bold;\n color: #FF4000;\n}\n.apg-lh-match {\n font-weight: bold;\n color: #1A97BA;\n}\n.apg-lb-match {\n font-weight: bold;\n color: #5F1687;\n}\n.apg-remainder {\n font-weight: bold;\n color: #999999;\n}\n.apg-ctrl-char {\n font-weight: bolder;\n font-style: italic;\n font-size: 0.6em;\n}\n.apg-line-end {\n font-weight: bold;\n color: #000000;\n}\n.apg-error {\n font-weight: bold;\n color: #FF4000;\n}\n.apg-phrase {\n color: #000000;\n background-color: #8caae6;\n}\n.apg-empty-phrase {\n color: #0fbd0f;\n}\ntable.apg-state {\n font-family: monospace;\n margin-top: 5px;\n font-size: 11px;\n line-height: 130%;\n text-align: left;\n border: 1px solid black;\n border-collapse: collapse;\n}\ntable.apg-state th,\ntable.apg-state td {\n text-align: left;\n border: 1px solid black;\n border-collapse: collapse;\n}\ntable.apg-state th:nth-last-child(2),\ntable.apg-state td:nth-last-child(2) {\n text-align: right;\n}\ntable.apg-state caption {\n font-size: 125%;\n line-height: 130%;\n font-weight: bold;\n text-align: left;\n}\ntable.apg-stats {\n font-family: monospace;\n margin-top: 5px;\n font-size: 11px;\n line-height: 130%;\n text-align: right;\n border: 1px solid black;\n border-collapse: collapse;\n}\ntable.apg-stats th,\ntable.apg-stats td {\n text-align: right;\n border: 1px solid black;\n border-collapse: collapse;\n}\ntable.apg-stats caption {\n font-size: 125%;\n line-height: 130%;\n font-weight: bold;\n text-align: left;\n}\ntable.apg-trace {\n font-family: monospace;\n margin-top: 5px;\n font-size: 11px;\n line-height: 130%;\n text-align: right;\n border: 1px solid black;\n border-collapse: collapse;\n}\ntable.apg-trace caption {\n font-size: 125%;\n line-height: 130%;\n font-weight: bold;\n text-align: left;\n}\ntable.apg-trace th,\ntable.apg-trace td {\n text-align: right;\n border: 1px solid black;\n border-collapse: collapse;\n}\ntable.apg-trace th:last-child,\ntable.apg-trace th:nth-last-child(2),\ntable.apg-trace td:last-child,\ntable.apg-trace td:nth-last-child(2) {\n text-align: left;\n}\ntable.apg-grammar {\n font-family: monospace;\n margin-top: 5px;\n font-size: 11px;\n line-height: 130%;\n text-align: right;\n border: 1px solid black;\n border-collapse: collapse;\n}\ntable.apg-grammar caption {\n font-size: 125%;\n line-height: 130%;\n font-weight: bold;\n text-align: left;\n}\ntable.apg-grammar th,\ntable.apg-grammar td {\n text-align: right;\n border: 1px solid black;\n border-collapse: collapse;\n}\ntable.apg-grammar th:last-child,\ntable.apg-grammar td:last-child {\n text-align: left;\n}\ntable.apg-rules {\n font-family: monospace;\n margin-top: 5px;\n font-size: 11px;\n line-height: 130%;\n text-align: right;\n border: 1px solid black;\n border-collapse: collapse;\n}\ntable.apg-rules caption {\n font-size: 125%;\n line-height: 130%;\n font-weight: bold;\n text-align: left;\n}\ntable.apg-rules th,\ntable.apg-rules td {\n text-align: right;\n border: 1px solid black;\n border-collapse: collapse;\n}\ntable.apg-rules a {\n color: #003399 !important;\n}\ntable.apg-rules a:hover {\n color: #8caae6 !important;\n}\ntable.apg-attrs {\n font-family: monospace;\n margin-top: 5px;\n font-size: 11px;\n line-height: 130%;\n text-align: center;\n border: 1px solid black;\n border-collapse: collapse;\n}\ntable.apg-attrs caption {\n font-size: 125%;\n line-height: 130%;\n font-weight: bold;\n text-align: left;\n}\ntable.apg-attrs th,\ntable.apg-attrs td {\n text-align: center;\n border: 1px solid black;\n border-collapse: collapse;\n}\ntable.apg-attrs th:nth-child(1),\ntable.apg-attrs th:nth-child(2),\ntable.apg-attrs th:nth-child(3) {\n text-align: right;\n}\ntable.apg-attrs td:nth-child(1),\ntable.apg-attrs td:nth-child(2),\ntable.apg-attrs td:nth-child(3) {\n text-align: right;\n}\ntable.apg-attrs a {\n color: #003399 !important;\n}\ntable.apg-attrs a:hover {\n color: #8caae6 !important;\n}\n"}),"emittcss")}}),Nn=j({"../../node_modules/.pnpm/apg-js@4.1.1/node_modules/apg-js/src/apg-lib/utilities.js"(e){var t=_n(),r=Tn(),n=Cn(),i=Mn(),o=e,s=I((function(e,t,r){let n,i=t;for(;;){if(e<=0){i=0,n=0;break}if("number"!=typeof i){i=0,n=e;break}if(i>=e){i=e,n=e;break}if("number"!=typeof r){n=e;break}if(n=i+r,n>e){n=e;break}break}return{beg:i,end:n}}),"getBounds");function a(e){return!(e>=55296&&e<=57343)&&!(e>1114111)}e.htmlToPage=function(e,t){let r;if("string"!=typeof e)throw new Error("utilities.js: htmlToPage: input HTML is not a string");r="string"!=typeof t?"htmlToPage":t;let i="";return i+="<!DOCTYPE html>\n",i+='<html lang="en">\n',i+="<head>\n",i+='<meta charset="utf-8">\n',i+=`<title>${r}</title>\n`,i+="<style>\n",i+=n(),i+="</style>\n",i+="</head>\n<body>\n",i+=`<p>${new Date}</p>\n`,i+=e,i+="</body>\n</html>\n",i},e.parserResultToHtml=function(e,r){let n,o,s=null;"string"==typeof r&&""!==r&&(s=r),n=!0===e.success?`<span class="${t.CLASS_MATCH}">true</span>`:`<span class="${t.CLASS_NOMATCH}">false</span>`,o=e.state===i.EMPTY?`<span class="${t.CLASS_EMPTY}">EMPTY</span>`:e.state===i.MATCH?`<span class="${t.CLASS_MATCH}">MATCH</span>`:e.state===i.NOMATCH?`<span class="${t.CLASS_NOMATCH}">NOMATCH</span>`:`<span class="${t.CLASS_NOMATCH}">unrecognized</span>`;let a="";return a+=`<table class="${t.CLASS_STATE}">\n`,s&&(a+=`<caption>${s}</caption>\n`),a+="<tr><th>state item</th><th>value</th><th>description</th></tr>\n",a+=`<tr><td>parser success</td><td>${n}</td>\n`,a+=`<td><span class="${t.CLASS_MATCH}">true</span> if the parse succeeded,\n`,a+=` <span class="${t.CLASS_NOMATCH}">false</span> otherwise`,a+="<br><i>NOTE: for success, entire string must be matched</i></td></tr>\n",a+=`<tr><td>parser state</td><td>${o}</td>\n`,a+=`<td><span class="${t.CLASS_EMPTY}">EMPTY</span>, `,a+=`<span class="${t.CLASS_MATCH}">MATCH</span> or \n`,a+=`<span class="${t.CLASS_NOMATCH}">NOMATCH</span></td></tr>\n`,a+=`<tr><td>string length</td><td>${e.length}</td><td>length of the input (sub)string</td></tr>\n`,a+=`<tr><td>matched length</td><td>${e.matched}</td><td>number of input string characters matched</td></tr>\n`,a+=`<tr><td>max matched</td><td>${e.maxMatched}</td><td>maximum number of input string characters matched</td></tr>\n`,a+=`<tr><td>max tree depth</td><td>${e.maxTreeDepth}</td><td>maximum depth of the parse tree reached</td></tr>\n`,a+=`<tr><td>node hits</td><td>${e.nodeHits}</td><td>number of parse tree node hits (opcode function calls)</td></tr>\n`,a+=`<tr><td>input length</td><td>${e.inputLength}</td><td>length of full input string</td></tr>\n`,a+=`<tr><td>sub-string begin</td><td>${e.subBegin}</td><td>sub-string first character index</td></tr>\n`,a+=`<tr><td>sub-string end</td><td>${e.subEnd}</td><td>sub-string end-of-string index</td></tr>\n`,a+=`<tr><td>sub-string length</td><td>${e.subLength}</td><td>sub-string length</td></tr>\n`,a+="</table>\n",a},e.charsToString=function(e,t,n){let i,o;if("number"==typeof t){if(t>=e.length)return"";i=t<0?0:t}else i=0;if("number"==typeof n){if(n<=0)return"";o=n>e.length-i?e.length:i+n}else o=e.length;return i<o?r.encode("UTF16LE",e.slice(i,o)).toString("utf16le"):""},e.stringToChars=function(e){return r.decode("STRING",e)},e.opcodeToString=function(e){let t="unknown";switch(e){case i.ALT:t="ALT";break;case i.CAT:t="CAT";break;case i.RNM:t="RNM";break;case i.UDT:t="UDT";break;case i.AND:t="AND";break;case i.NOT:t="NOT";break;case i.REP:t="REP";break;case i.TRG:t="TRG";break;case i.TBS:t="TBS";break;case i.TLS:t="TLS";break;case i.BKR:t="BKR";break;case i.BKA:t="BKA";break;case i.BKN:t="BKN";break;case i.ABG:t="ABG";break;case i.AEN:t="AEN";break;default:throw new Error("unrecognized opcode")}return t},e.stateToString=function(e){let t="unknown";switch(e){case i.ACTIVE:t="ACTIVE";break;case i.MATCH:t="MATCH";break;case i.EMPTY:t="EMPTY";break;case i.NOMATCH:t="NOMATCH";break;default:throw new Error("unrecognized state")}return t},e.asciiChars=["NUL","SOH","STX","ETX","EOT","ENQ","ACK","BEL","BS","TAB","LF","VT","FF","CR","SO","SI","DLE","DC1","DC2","DC3","DC4","NAK","SYN","ETB","CAN","EM","SUB","ESC","FS","GS","RS","US"," ","!",""","#","$","%","&","'","(",")","*","+",",","-",".","/","0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?","@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","[","\","]","^","_","`","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","{","|","}","~","DEL"],e.charToHex=function(e){let t=e.toString(16).toUpperCase();switch(t.length){case 1:case 3:case 7:t=`0${t}`;break;case 2:case 6:t=`00${t}`;break;case 4:break;case 5:t=`000${t}`;break;default:throw new Error("unrecognized option")}return t},e.charsToDec=function(e,t,r){let n="";if(!Array.isArray(e))throw new Error("utilities.js: charsToDec: input must be an array of integers");const i=s(e.length,t,r);if(i.end>i.beg){n+=e[i.beg];for(let t=i.beg+1;t<i.end;t+=1)n+=`,${e[t]}`}return n},e.charsToHex=function(e,t,r){let n="";if(!Array.isArray(e))throw new Error("utilities.js: charsToHex: input must be an array of integers");const i=s(e.length,t,r);if(i.end>i.beg){n+=`\\x${o.charToHex(e[i.beg])}`;for(let t=i.beg+1;t<i.end;t+=1)n+=`,\\x${o.charToHex(e[t])}`}return n},e.charsToHtmlEntities=function(e,t,r){let n="";if(!Array.isArray(e))throw new Error("utilities.js: charsToHex: input must be an array of integers");const i=s(e.length,t,r);if(i.end>i.beg)for(let t=i.beg;t<i.end;t+=1)n+=`&#x${e[t].toString(16)};`;return n},I(a,"isUnicode"),e.charsToUnicode=function(e,t,r){let n="";if(!Array.isArray(e))throw new Error("utilities.js: charsToUnicode: input must be an array of integers");const i=s(e.length,t,r);if(i.end>i.beg)for(let t=i.beg;t<i.end;t+=1)a(e[t])?n+=`&#${e[t]};`:n+=` U+${o.charToHex(e[t])}`;return n},e.charsToJsUnicode=function(e,t,r){let n="";if(!Array.isArray(e))throw new Error("utilities.js: charsToJsUnicode: input must be an array of integers");const i=s(e.length,t,r);if(i.end>i.beg){n+=`\\u${o.charToHex(e[i.beg])}`;for(let t=i.beg+1;t<i.end;t+=1)n+=`,\\u${o.charToHex(e[t])}`}return n},e.charsToAscii=function(e,t,r){let n="";if(!Array.isArray(e))throw new Error("utilities.js: charsToAscii: input must be an array of integers");const i=s(e.length,t,r);for(let t=i.beg;t<i.end;t+=1){const r=e[t];n+=r>=32&&r<=126?String.fromCharCode(r):`\\x${o.charToHex(r)}`}return n},e.charsToAsciiHtml=function(e,r,n){if(!Array.isArray(e))throw new Error("utilities.js: charsToAsciiHtml: input must be an array of integers");let i,a="";const c=s(e.length,r,n);for(let r=c.beg;r<c.end;r+=1)i=e[r],a+=i<32||127===i?`<span class="${t.CLASS_CTRLCHAR}">${o.asciiChars[i]}</span>`:i>127?`<span class="${t.CLASS_CTRLCHAR}">U+${o.charToHex(i)}</span>`:o.asciiChars[i];return a},e.stringToAsciiHtml=function(e){const t=r.decode("STRING",e);return this.charsToAsciiHtml(t)}}}),In=j({"../../node_modules/.pnpm/apg-js@4.1.1/node_modules/apg-js/src/apg-lib/ast.js"(e,t){t.exports=I((function(){const e=Mn(),t=Nn(),r=this;let n=null,i=null,o=null,s=0;const a=[],c=[],u=[],l=[];function d(e){let t="";for(let r=0;r<e;r+=1)t+=" ";return t}this.callbacks=[],this.astObject="astObject",this.init=I((function(e,t,d){let f;u.length=0,l.length=0,a.length=0,s=0,n=e,i=t,o=d;const h=[];for(f=0;f<n.length;f+=1)h.push(n[f].lower);for(f=0;f<i.length;f+=1)h.push(i[f].lower);for(s=n.length+i.length,f=0;f<s;f+=1)a[f]=!1,c[f]=null;for(const e in r.callbacks){const t=e.toLowerCase();if(f=h.indexOf(t),f<0)throw new Error(`ast.js: init: node '${e}' not a rule or udt name`);"function"==typeof r.callbacks[e]&&(a[f]=!0,c[f]=r.callbacks[e]),!0===r.callbacks[e]&&(a[f]=!0)}}),"init"),this.ruleDefined=I((function(e){return!1!==a[e]}),"ruleDefined"),this.udtDefined=I((function(e){return!1!==a[n.length+e]}),"udtDefined"),this.down=I((function(t,r){const n=l.length;return u.push(n),l.push({name:r,thisIndex:n,thatIndex:null,state:e.SEM_PRE,callbackIndex:t,phraseIndex:null,phraseLength:null,stack:u.length}),n}),"down"),this.up=I((function(t,r,n,i){const o=l.length,s=u.pop();return l.push({name:r,thisIndex:o,thatIndex:s,state:e.SEM_POST,callbackIndex:t,phraseIndex:n,phraseLength:i,stack:u.length}),l[s].thatIndex=o,l[s].phraseIndex=n,l[s].phraseLength=i,o}),"up"),this.translate=I((function(t){let r,n,i;for(let s=0;s<l.length;s+=1)i=l[s],n=c[i.callbackIndex],i.state===e.SEM_PRE?null!==n&&(r=n(e.SEM_PRE,o,i.phraseIndex,i.phraseLength,t),r===e.SEM_SKIP&&(s=i.thatIndex)):null!==n&&n(e.SEM_POST,o,i.phraseIndex,i.phraseLength,t)}),"translate"),this.setLength=I((function(e){l.length=e,u.length=e>0?l[e-1].stack:0}),"setLength"),this.getLength=I((function(){return l.length}),"getLength"),I(d,"indent"),this.toXml=I((function(r){let n=t.charsToDec,i="decimal integer character codes";if("string"==typeof mode&&r.length>=3){const e=r.slice(0,3).toLowerCase();"asc"===e?(n=t.charsToAscii,i="ASCII for printing characters, hex for non-printing"):"hex"===e?(n=t.charsToHex,i="hexidecimal integer character codes"):"uni"===e&&(n=t.charsToUnicode,i="Unicode UTF-32 integer character codes")}let s="",a=0;return s+='<?xml version="1.0" encoding="utf-8"?>\n',s+=`<root nodes="${l.length/2}" characters="${o.length}">\n`,s+=`\x3c!-- input string, ${i} --\x3e\n`,s+=d(a+2),s+=n(o),s+="\n",l.forEach((t=>{t.state===e.SEM_PRE?(a+=1,s+=d(a),s+=`<node name="${t.name}" index="${t.phraseIndex}" length="${t.phraseLength}">\n`,s+=d(a+2),s+=n(o,t.phraseIndex,t.phraseLength),s+="\n"):(s+=d(a),s+=`</node>\x3c!-- name="${t.name}" --\x3e\n`,a-=1)})),s+="</root>\n",s}),"toSml"),this.phrases=I((function(){const t={};let r,n;for(r=0;r<l.length;r+=1)n=l[r],n.state===e.SEM_PRE&&(Array.isArray(t[n.name])||(t[n.name]=[]),t[n.name].push({index:n.phraseIndex,length:n.phraseLength}));return t}),"phrases")}),"exportsAst")}}),Bn=j({"../../node_modules/.pnpm/apg-js@4.1.1/node_modules/apg-js/src/apg-lib/circular-buffer.js"(e,t){t.exports=I((function(){let e=-1,t=0;this.init=I((function(r){if("number"!=typeof r||r<=0)throw new Error("circular-buffer.js: init: circular buffer size must an integer > 0");t=Math.ceil(r),e=-1}),"init"),this.increment=I((function(){return e+=1,(e+t)%t}),"increment"),this.maxSize=I((function(){return t}),"maxSize"),this.items=I((function(){return e+1}),"items"),this.getListIndex=I((function(r){return-1===e||r<0||r>e||e-r>=t?-1:(r+t)%t}),"getListIndex"),this.forEach=I((function(r){if(-1!==e)if(e<t)for(let t=0;t<=e;t+=1)r(t,t);else for(let n=e-t+1;n<=e;n+=1){r((n+t)%t,n)}}),"forEach")}),"exportsCircularBuffer")}}),On=j({"../../node_modules/.pnpm/apg-js@4.1.1/node_modules/apg-js/src/apg-lib/parser.js"(e,t){t.exports=I((function(){const e=Mn(),t=Nn(),r=this;let n;this.ast=null,this.stats=null,this.trace=null,this.callbacks=[];let i,o,s,a,c=null,u=null,l=0,d=0,f=0,h=null,p=null,m=null,g=null,b=null,y=0,v=1/0,w=1/0;const A=I((function(t,r,i){const o="parser.js: evaluateRule(): ";if(t>=m.length)throw new Error(`${o}rule index: ${t} out of range`);if(r>=s)throw new Error(`${o}phrase index: ${r} out of range`);const{length:a}=c;c.push({type:e.RNM,index:t}),n(a,r,i),c.pop()}),"evaluateRule"),E=I((function(t,r,i){const o="parser.js: evaluateUdt(): ";if(t>=g.length)throw new Error(`${o}udt index: ${t} out of range`);if(r>=s)throw new Error(`${o}phrase index: ${r} out of range`);const{length:a}=c;c.push({type:e.UDT,empty:g[t].empty,index:t}),n(a,r,i),c.pop()}),"evaluateUdt"),S=I((function(){l=0,d=0,f=0,y=0,a=[{lookAround:e.LOOKAROUND_NONE,anchor:0,charsEnd:0,charsLength:0}],m=null,g=null,u=null,i=0,o=0,s=0,h=null,p=null,b=null,c=null}),"clear"),x=I((function(){const e=[],t=I((function(){const t={};m.forEach((e=>{e.isBkr&&(t[e.lower]=null)})),g.length>0&&g.forEach((e=>{e.isBkr&&(t[e.lower]=null)})),e.push(t)}),"init"),r=I((function(){const t=e[e.length-1],r={};for(const e in t)r[e]=t[e];return r}),"copy");this.push=I((function(){e.push(r())}),"push"),this.pop=I((function(t){let r=t;if(r||(r=e.length-1),r<1||r>e.length)throw new Error(`parser.js: backRef.pop(): bad length: ${r}`);return e.length=r,e[e.length-1]}),"pop"),this.length=I((function(){return e.length}),"length"),this.savePhrase=I((function(t,r,n){e[e.length-1][t]={phraseIndex:r,phraseLength:n}}),"savePhrase"),this.getPhrase=function(t){return e[e.length-1][t]},t()}),"backRef"),M=I((function(){const t=this;this.state=e.ACTIVE,this.phraseLength=0,this.ruleIndex=0,this.udtIndex=0,this.lookAround=a[a.length-1],this.uFrame=new x,this.pFrame=new x,this.evaluateRule=A,this.evaluateUdt=E,this.refresh=I((function(){t.state=e.ACTIVE,t.phraseLength=0,t.lookAround=a[a.length-1]}),"refresh")}),"systemData"),_=I((function(){return a[a.length-1]}),"lookAroundValue"),k=I((function(){return a.length>1}),"inLookAround"),T=I((function(){return a[a.length-1].lookAround===e.LOOKAROUND_BEHIND}),"inLookBehind"),C=I((function(){for(;;){if(void 0===r.ast){r.ast=null;break}if(null===r.ast)break;if("astObject"!==r.ast.astObject)throw new Error("parser.js: initializeAst(): ast object not recognized");break}null!==r.ast&&r.ast.init(m,g,u)}),"initializeAst"),N=I((function(){for(;;){if(void 0===r.trace){r.trace=null;break}if(null===r.trace)break;if("traceObject"!==r.trace.traceObject)throw new Error("parser.js: initializeTrace(): trace object not recognized");break}null!==r.trace&&r.trace.init(m,g,u)}),"initializeTrace"),B=I((function(){for(;;){if(void 0===r.stats){r.stats=null;break}if(null===r.stats)break;if("statsObject"!==r.stats.statsObject)throw new Error("parser.js: initializeStats(): stats object not recognized");break}null!==r.stats&&r.stats.init(m,g)}),"initializeStats"),O=I((function(e){const t="parser.js: initializeGrammar(): ";if(!e)throw new Error(`${t}grammar object undefined`);if("grammarObject"!==e.grammarObject)throw new Error(`${t}bad grammar object`);m=e.rules,g=e.udts}),"initializeGrammar"),D=I((function(e){const t="parser.js: initializeStartRule(): ";let r=null;if("number"==typeof e){if(e>=m.length)throw new Error(`${t}start rule index too large: max: ${m.length}: index: ${e}`);r=e}else{if("string"!=typeof e)throw new Error(`${t}type of start rule '${typeof e}' not recognized`);{const n=e.toLowerCase();for(let e=0;e<m.length;e+=1)if(n===m[e].lower){r=m[e].index;break}if(null===r)throw new Error(`${t}start rule name '${e}' not recognized`)}}return r}),"initializeStartRule"),j=I((function(e,r,n){const a="parser.js: initializeInputChars(): ";let c=e,l=r,d=n;if(void 0===c)throw new Error(`${a}input string is undefined`);if(null===c)throw new Error(`${a}input string is null`);if("string"==typeof c)c=t.stringToChars(c);else if(!Array.isArray(c))throw new Error(`${a}input string is not a string or array`);if(c.length>0&&"number"!=typeof c[0])throw new Error(`${a}input string not an array of integers`);if("number"!=typeof l)l=0;else if(l=Math.floor(l),l<0||l>c.length)throw new Error(`${a}input beginning index out of range: ${l}`);if("number"!=typeof d)d=c.length-l;else if(d=Math.floor(d),d<0||d>c.length-l)throw new Error(`${a}input length out of range: ${d}`);u=c,i=l,o=d,s=i+o}),"initializeInputChars"),L=I((function(){const e="parser.js: initializeCallbacks(): ";let t,n;for(h=[],p=[],t=0;t<m.length;t+=1)h[t]=null;for(t=0;t<g.length;t+=1)p[t]=null;const i=[];for(t=0;t<m.length;t+=1)i.push(m[t].lower);for(t=0;t<g.length;t+=1)i.push(g[t].lower);for(const o in r.callbacks){if(t=i.indexOf(o.toLowerCase()),t<0)throw new Error(`${e}syntax callback '${o}' not a rule or udt name`);if(n=r.callbacks[o],n||(n=null),"function"!=typeof n&&null!==n)throw new Error(`${e}syntax callback[${o}] must be function reference or 'false' (false/null/undefined/etc.)`);t<m.length?h[t]=n:p[t-m.length]=n}for(t=0;t<g.length;t+=1)if(null===p[t])throw new Error(`${e}all UDT callbacks must be defined. UDT callback[${g[t].lower}] not a function reference`)}),"initializeCallbacks");this.setMaxTreeDepth=function(e){if("number"!=typeof e)throw new Error(`parser: max tree depth must be integer > 0: ${e}`);if(v=Math.floor(e),v<=0)throw new Error(`parser: max tree depth must be integer > 0: ${e}`)},this.setMaxNodeHits=function(e){if("number"!=typeof e)throw new Error(`parser: max node hits must be integer > 0: ${e}`);if(w=Math.floor(e),w<=0)throw new Error(`parser: max node hits must be integer > 0: ${e}`)};const P=I((function(t,r,a){let l;O(t);const h=D(r);L(),N(),B(),C();const p=new M;switch(null!=a&&(b=a),c=[{type:e.RNM,index:h}],n(0,i,p),c=null,p.state){case e.ACTIVE:throw new Error("parser.js: parse(): final state should never be 'ACTIVE'");case e.NOMATCH:l=!1;break;case e.EMPTY:case e.MATCH:l=p.phraseLength===o;break;default:throw new Error("unrecognized state")}return{success:l,state:p.state,length:o,matched:p.phraseLength,maxMatched:y,maxTreeDepth:d,nodeHits:f,inputLength:u.length,subBegin:i,subEnd:s,subLength:o}}),"privateParse");this.parseSubstring=I((function(e,t,r,n,i,o){return S(),j(r,n,i),P(e,t,o)}),"parseSubstring"),this.parse=I((function(e,t,r,n){return S(),j(r,0,r.length),P(e,t,n)}),"parse");const R=I((function(t,r,i){const o=c[t];for(let t=0;t<o.children.length&&(n(o.children[t],r,i),i.state===e.NOMATCH);t+=1);}),"opALT"),U=I((function(t,i,o){let s,a,u,l;const d=c[t],f=o.uFrame.length(),h=o.pFrame.length();r.ast&&(a=r.ast.getLength()),s=!0,u=i,l=0;for(let t=0;t<d.children.length;t+=1){if(n(d.children[t],u,o),o.state===e.NOMATCH){s=!1;break}u+=o.phraseLength,l+=o.phraseLength}s?(o.state=0===l?e.EMPTY:e.MATCH,o.phraseLength=l):(o.state=e.NOMATCH,o.phraseLength=0,o.uFrame.pop(f),o.pFrame.pop(h),r.ast&&r.ast.setLength(a))}),"opCAT"),z=I((function(t,i,o){let a,u,l,d;const f=c[t];u=i,l=0,d=0;const h=o.uFrame.length(),p=o.pFrame.length();r.ast&&(a=r.ast.getLength());for(;!(u>=s)&&(n(t+1,u,o),o.state!==e.NOMATCH)&&o.state!==e.EMPTY&&(d+=1,l+=o.phraseLength,u+=o.phraseLength,d!==f.max););o.state===e.EMPTY||d>=f.min?(o.state=0===l?e.EMPTY:e.MATCH,o.phraseLength=l):(o.state=e.NOMATCH,o.phraseLength=0,o.uFrame.pop(h),o.pFrame.pop(p),r.ast&&r.ast.setLength(a))}),"opREP"),K=I((function(t,r,n,i){if(r.phraseLength>n){let e=`parser.js: opRNM(${t.name}): callback function error: `;throw e+=`sysData.phraseLength: ${r.phraseLength}`,e+=` must be <= remaining chars: ${n}`,new Error(e)}switch(r.state){case e.ACTIVE:if(!0!==i)throw new Error(`parser.js: opRNM(${t.name}): callback function return error. ACTIVE state not allowed.`);break;case e.EMPTY:r.phraseLength=0;break;case e.MATCH:0===r.phraseLength&&(r.state=e.EMPTY);break;case e.NOMATCH:r.phraseLength=0;break;default:throw new Error(`parser.js: opRNM(${t.name}): callback function return error. Unrecognized return state: ${r.state}`)}}),"validateRnmCallbackResult"),F=I((function(t,i,o){let a,l,d,f,p,g;const y=c[t],v=m[y.index],w=h[v.index],A=!k();if(A&&(l=r.ast&&r.ast.ruleDefined(y.index),l&&(a=r.ast.getLength(),r.ast.down(y.index,m[y.index].name)),f=o.uFrame.length(),p=o.pFrame.length(),o.uFrame.push(),o.pFrame.push(),g=o.pFrame,o.pFrame=new x),null===w)d=c,c=v.opcodes,n(0,i,o),c=d;else{const t=s-i;o.ruleIndex=v.index,w(o,u,i,b),K(v,o,t,!0),o.state===e.ACTIVE&&(d=c,c=v.opcodes,n(0,i,o),c=d,o.ruleIndex=v.index,w(o,u,i,b),K(v,o,t,!1))}A&&(l&&(o.state===e.NOMATCH?r.ast.setLength(a):r.ast.up(y.index,v.name,i,o.phraseLength)),o.pFrame=g,o.state===e.NOMATCH?(o.uFrame.pop(f),o.pFrame.pop(p)):v.isBkr&&(o.pFrame.savePhrase(v.lower,i,o.phraseLength),o.uFrame.savePhrase(v.lower,i,o.phraseLength)))}),"opRNM"),H=I((function(t,r,n){if(r.phraseLength>n){let e=`parser.js: opUDT(${t.name}): callback function error: `;throw e+=`sysData.phraseLength: ${r.phraseLength}`,e+=` must be <= remaining chars: ${n}`,new Error(e)}switch(r.state){case e.ACTIVE:throw new Error(`parser.js: opUDT(${t.name}): callback function return error. ACTIVE state not allowed.`);case e.EMPTY:if(!1===t.empty)throw new Error(`parser.js: opUDT(${t.name}): callback function return error. May not return EMPTY.`);r.phraseLength=0;break;case e.MATCH:if(0===r.phraseLength){if(!1===t.empty)throw new Error(`parser.js: opUDT(${t.name}): callback function return error. May not return EMPTY.`);r.state=e.EMPTY}break;case e.NOMATCH:r.phraseLength=0;break;default:throw new Error(`parser.js: opUDT(${t.name}): callback function return error. Unrecognized return state: ${r.state}`)}}),"validateUdtCallbackResult"),$=I((function(t,n,i){let o,a,l,d,f,h;const y=c[t],v=g[y.index];i.UdtIndex=v.index;const w=!k();w&&(l=r.ast&&r.ast.udtDefined(y.index),l&&(a=m.length+y.index,o=r.ast.getLength(),r.ast.down(a,v.name)),d=i.uFrame.length(),f=i.pFrame.length(),i.uFrame.push(),i.pFrame.push(),h=i.pFrame,i.pFrame=new x);const A=s-n;p[y.index](i,u,n,b),H(v,i,A),w&&(l&&(i.state===e.NOMATCH?r.ast.setLength(o):r.ast.up(a,v.name,n,i.phraseLength)),i.pFrame=h,i.state===e.NOMATCH?(i.uFrame.pop(d),i.pFrame.pop(f)):v.isBkr&&(i.pFrame.savePhrase(v.lower,n,i.phraseLength),i.uFrame.savePhrase(v.lower,n,i.phraseLength)))}),"opUDT"),V=I((function(t,r,c){a.push({lookAround:e.LOOKAROUND_AHEAD,anchor:r,charsEnd:s,charsLength:o}),s=u.length,o=u.length-i,n(t+1,r,c);const l=a.pop();switch(s=l.charsEnd,o=l.charsLength,c.phraseLength=0,c.state){case e.EMPTY:case e.MATCH:c.state=e.EMPTY;break;case e.NOMATCH:c.state=e.NOMATCH;break;default:throw new Error(`opAND: invalid state ${c.state}`)}}),"opAND"),q=I((function(t,r,c){a.push({lookAround:e.LOOKAROUND_AHEAD,anchor:r,charsEnd:s,charsLength:o}),s=u.length,o=u.length-i,n(t+1,r,c);const l=a.pop();switch(s=l.charsEnd,o=l.charsLength,c.phraseLength=0,c.state){case e.EMPTY:case e.MATCH:c.state=e.NOMATCH;break;case e.NOMATCH:c.state=e.EMPTY;break;default:throw new Error(`opNOT: invalid state ${c.state}`)}}),"opNOT"),G=I((function(t,r,n){const i=c[t];n.state=e.NOMATCH,r<s&&i.min<=u[r]&&u[r]<=i.max&&(n.state=e.MATCH,n.phraseLength=1)}),"opTRG"),Y=I((function(t,r,n){let i;const o=c[t],a=o.string.length;if(n.state=e.NOMATCH,r+a<=s){for(i=0;i<a;i+=1)if(u[r+i]!==o.string[i])return;n.state=e.MATCH,n.phraseLength=a}}),"opTBS"),J=I((function(t,r,n){let i,o;const a=c[t];n.state=e.NOMATCH;const l=a.string.length;if(0!==l){if(r+l<=s){for(i=0;i<l;i+=1)if(o=u[r+i],o>=65&&o<=90&&(o+=32),o!==a.string[i])return;n.state=e.MATCH,n.phraseLength=l}}else n.state=e.EMPTY}),"opTLS"),Q=I((function(t,r,n){n.state=e.NOMATCH,n.phraseLength=0,n.state=0===r?e.EMPTY:e.NOMATCH}),"opABG"),W=I((function(t,r,n){n.state=e.NOMATCH,n.phraseLength=0,n.state=r===u.length?e.EMPTY:e.NOMATCH}),"opAEN"),X=I((function(t,r,n){let i,o,a,l;const d=c[t];n.state=e.NOMATCH,l=d.index<m.length?m[d.index].lower:g[d.index-m.length].lower;const f=d.bkrMode===e.BKR_MODE_PM?n.pFrame.getPhrase(l):n.uFrame.getPhrase(l),h=d.bkrCase===e.BKR_MODE_CI;if(null===f)return;const p=f.phraseIndex,b=f.phraseLength;if(0!==b){if(r+b<=s){if(h){for(i=0;i<b;i+=1)if(o=u[r+i],a=u[p+i],o>=65&&o<=90&&(o+=32),a>=65&&a<=90&&(a+=32),o!==a)return;n.state=e.MATCH,n.phraseLength=b}else for(i=0;i<b;i+=1)if(o=u[r+i],a=u[p+i],o!==a)return;n.state=e.MATCH,n.phraseLength=b}}else n.state=e.EMPTY}),"opBKR"),Z=I((function(t,r,i){switch(a.push({lookAround:e.LOOKAROUND_BEHIND,anchor:r}),n(t+1,r,i),a.pop(),i.phraseLength=0,i.state){case e.EMPTY:case e.MATCH:i.state=e.EMPTY;break;case e.NOMATCH:i.state=e.NOMATCH;break;default:throw new Error(`opBKA: invalid state ${i.state}`)}}),"opBKA"),ee=I((function(t,r,i){switch(a.push({lookAround:e.LOOKAROUND_BEHIND,anchor:r}),n(t+1,r,i),a.pop(),i.phraseLength=0,i.state){case e.EMPTY:case e.MATCH:i.state=e.NOMATCH;break;case e.NOMATCH:i.state=e.EMPTY;break;default:throw new Error(`opBKN: invalid state ${i.state}`)}}),"opBKN"),te=I((function(t,i,o){let s,a,u,l;const d=c[t],f=o.uFrame.length(),h=o.pFrame.length();r.ast&&(a=r.ast.getLength()),s=!0,u=i,l=0;for(let t=d.children.length-1;t>=0;t-=1)if(n(d.children[t],u,o),u-=o.phraseLength,l+=o.phraseLength,o.state===e.NOMATCH){s=!1;break}s?(o.state=0===l?e.EMPTY:e.MATCH,o.phraseLength=l):(o.state=e.NOMATCH,o.phraseLength=0,o.uFrame.pop(f),o.pFrame.pop(h),r.ast&&r.ast.setLength(a))}),"opCATBehind"),re=I((function(t,i,o){let s,a,u,l;const d=c[t];a=i,u=0,l=0;const f=o.uFrame.length(),h=o.pFrame.length();r.ast&&(s=r.ast.getLength());for(;!(a<=0)&&(n(t+1,a,o),o.state!==e.NOMATCH)&&o.state!==e.EMPTY&&(l+=1,u+=o.phraseLength,a-=o.phraseLength,l!==d.max););o.state===e.EMPTY||l>=d.min?(o.state=0===u?e.EMPTY:e.MATCH,o.phraseLength=u):(o.state=e.NOMATCH,o.phraseLength=0,o.uFrame.pop(f),o.pFrame.pop(h),r.ast&&r.ast.setLength(s))}),"opREPBehind"),ne=I((function(t,r,n){const i=c[t];if(n.state=e.NOMATCH,n.phraseLength=0,r>0){const t=u[r-1];i.min<=t&&t<=i.max&&(n.state=e.MATCH,n.phraseLength=1)}}),"opTRGBehind"),ie=I((function(t,r,n){let i;const o=c[t];n.state=e.NOMATCH;const s=o.string.length,a=r-s;if(a>=0){for(i=0;i<s;i+=1)if(u[a+i]!==o.string[i])return;n.state=e.MATCH,n.phraseLength=s}}),"opTBSBehind"),oe=I((function(t,r,n){let i;const o=c[t];n.state=e.NOMATCH;const s=o.string.length;if(0===s)return void(n.state=e.EMPTY);const a=r-s;if(a>=0){for(let e=0;e<s;e+=1)if(i=u[a+e],i>=65&&i<=90&&(i+=32),i!==o.string[e])return;n.state=e.MATCH,n.phraseLength=s}}),"opTLSBehind"),se=I((function(t,r,n){let i,o,s,a;const l=c[t];n.state=e.NOMATCH,n.phraseLength=0,a=l.index<m.length?m[l.index].lower:g[l.index-m.length].lower;const d=l.bkrMode===e.BKR_MODE_PM?n.pFrame.getPhrase(a):n.uFrame.getPhrase(a),f=l.bkrCase===e.BKR_MODE_CI;if(null===d)return;const h=d.phraseIndex,p=d.phraseLength;if(0===p)return n.state=e.EMPTY,void(n.phraseLength=0);const b=r-p;if(b>=0){if(f){for(i=0;i<p;i+=1)if(o=u[b+i],s=u[h+i],o>=65&&o<=90&&(o+=32),s>=65&&s<=90&&(s+=32),o!==s)return;n.state=e.MATCH,n.phraseLength=p}else for(i=0;i<p;i+=1)if(o=u[b+i],s=u[h+i],o!==s)return;n.state=e.MATCH,n.phraseLength=p}}),"opBKRBehind");n=I((function(t,n,i){let o=!0;const s=c[t];if(f+=1,f>w)throw new Error(`parser: maximum number of node hits exceeded: ${w}`);if(l+=1,l>d&&(d=l,d>v))throw new Error(`parser: maximum parse tree depth exceeded: ${v}`);if(i.refresh(),null!==r.trace){const e=_();r.trace.down(s,i.state,n,i.phraseLength,e.anchor,e.lookAround)}if(T())switch(s.type){case e.ALT:R(t,n,i);break;case e.CAT:te(t,n,i);break;case e.REP:re(t,n,i);break;case e.RNM:F(t,n,i);break;case e.UDT:$(t,n,i);break;case e.AND:V(t,n,i);break;case e.NOT:q(t,n,i);break;case e.TRG:ne(t,n,i);break;case e.TBS:ie(t,n,i);break;case e.TLS:oe(t,n,i);break;case e.BKR:se(t,n,i);break;case e.BKA:Z(t,n,i);break;case e.BKN:ee(t,n,i);break;case e.ABG:Q(t,n,i);break;case e.AEN:W(t,n,i);break;default:o=!1}else switch(s.type){case e.ALT:R(t,n,i);break;case e.CAT:U(t,n,i);break;case e.REP:z(t,n,i);break;case e.RNM:F(t,n,i);break;case e.UDT:$(t,n,i);break;case e.AND:V(t,n,i);break;case e.NOT:q(t,n,i);break;case e.TRG:G(t,n,i);break;case e.TBS:Y(t,n,i);break;case e.TLS:J(t,n,i);break;case e.BKR:X(t,n,i);break;case e.BKA:Z(t,n,i);break;case e.BKN:ee(t,n,i);break;case e.ABG:Q(t,n,i);break;case e.AEN:W(t,n,i);break;default:o=!1}if(!k()&&n+i.phraseLength>y&&(y=n+i.phraseLength),null!==r.stats&&r.stats.collect(s,i),null!==r.trace){const e=_();r.trace.up(s,i.state,n,i.phraseLength,e.anchor,e.lookAround)}return l-=1,o}),"opExecuteFunc")}),"parser")}}),Dn=j({"../../node_modules/.pnpm/apg-js@4.1.1/node_modules/apg-js/src/apg-lib/stats.js"(e,t){t.exports=I((function(){const e=Mn(),t=Nn(),r=_n();let n=[],i=[];const o=[];let s;const a=[],c=[];this.statsObject="statsObject";const u=I((function(e,t){return e.lower<t.lower?-1:e.lower>t.lower?1:0}),"sortAlpha"),l=I((function(e,t){return e.total<t.total?1:e.total>t.total?-1:u(e,t)}),"sortHits"),d=I((function(e,t){return e.index<t.index?-1:e.index>t.index?1:0}),"sortIndex"),f=I((function(){this.empty=0,this.match=0,this.nomatch=0,this.total=0}),"EmptyStat"),h=I((function(){o.length=0,s=new f,o[e.ALT]=new f,o[e.CAT]=new f,o[e.REP]=new f,o[e.RNM]=new f,o[e.TRG]=new f,o[e.TBS]=new f,o[e.TLS]=new f,o[e.UDT]=new f,o[e.AND]=new f,o[e.NOT]=new f,o[e.BKR]=new f,o[e.BKA]=new f,o[e.BKN]=new f,o[e.ABG]=new f,o[e.AEN]=new f,a.length=0;for(let e=0;e<n.length;e+=1)a.push({empty:0,match:0,nomatch:0,total:0,name:n[e].name,lower:n[e].lower,index:n[e].index});if(i.length>0){c.length=0;for(let e=0;e<i.length;e+=1)c.push({empty:0,match:0,nomatch:0,total:0,name:i[e].name,lower:i[e].lower,index:i[e].index})}}),"clear"),p=I((function(t,r){switch(t.total+=1,r){case e.EMPTY:t.empty+=1;break;case e.MATCH:t.match+=1;break;case e.NOMATCH:t.nomatch+=1;break;default:throw new Error(`stats.js: collect(): incStat(): unrecognized state: ${r}`)}}),"incStat"),m=I((function(e,t){let n="";return n+="<tr>",n+=`<td class="${r.CLASS_ACTIVE}">${e}</td>`,n+=`<td class="${r.CLASS_EMPTY}">${t.empty}</td>`,n+=`<td class="${r.CLASS_MATCH}">${t.match}</td>`,n+=`<td class="${r.CLASS_NOMATCH}">${t.nomatch}</td>`,n+=`<td class="${r.CLASS_ACTIVE}">${t.total}</td>`,n+="</tr>\n",n}),"displayRow"),g=I((function(){let t="";return t+=m("ALT",o[e.ALT]),t+=m("CAT",o[e.CAT]),t+=m("REP",o[e.REP]),t+=m("RNM",o[e.RNM]),t+=m("TRG",o[e.TRG]),t+=m("TBS",o[e.TBS]),t+=m("TLS",o[e.TLS]),t+=m("UDT",o[e.UDT]),t+=m("AND",o[e.AND]),t+=m("NOT",o[e.NOT]),t+=m("BKR",o[e.BKR]),t+=m("BKA",o[e.BKA]),t+=m("BKN",o[e.BKN]),t+=m("ABG",o[e.ABG]),t+=m("AEN",o[e.AEN]),t+=m("totals",s),t}),"displayOpsOnly"),b=I((function(){let e="";e+="<tr><th></th><th></th><th></th><th></th><th></th></tr>\n",e+="<tr><th>rules</th><th></th><th></th><th></th><th></th></tr>\n";for(let t=0;t<n.length;t+=1)a[t].total>0&&(e+="<tr>",e+=`<td class="${r.CLASS_ACTIVE}">${a[t].name}</td>`,e+=`<td class="${r.CLASS_EMPTY}">${a[t].empty}</td>`,e+=`<td class="${r.CLASS_MATCH}">${a[t].match}</td>`,e+=`<td class="${r.CLASS_NOMATCH}">${a[t].nomatch}</td>`,e+=`<td class="${r.CLASS_ACTIVE}">${a[t].total}</td>`,e+="</tr>\n");if(i.length>0){e+="<tr><th></th><th></th><th></th><th></th><th></th></tr>\n",e+="<tr><th>udts</th><th></th><th></th><th></th><th></th></tr>\n";for(let t=0;t<i.length;t+=1)c[t].total>0&&(e+="<tr>",e+=`<td class="${r.CLASS_ACTIVE}">${c[t].name}</td>`,e+=`<td class="${r.CLASS_EMPTY}">${c[t].empty}</td>`,e+=`<td class="${r.CLASS_MATCH}">${c[t].match}</td>`,e+=`<td class="${r.CLASS_NOMATCH}">${c[t].nomatch}</td>`,e+=`<td class="${r.CLASS_ACTIVE}">${c[t].total}</td>`,e+="</tr>\n")}return e}),"displayRules");this.validate=I((function(e){let t=!1;return"string"==typeof e&&"stats"===e&&(t=!0),t}),"validate"),this.init=I((function(e,t){n=e,i=t,h()}),"init"),this.collect=I((function(t,r){p(s,r.state,r.phraseLength),p(o[t.type],r.state,r.phraseLength),t.type===e.RNM&&p(a[t.index],r.state,r.phraseLength),t.type===e.UDT&&p(c[t.index],r.state,r.phraseLength)}),"collect"),this.toHtml=I((function(e,t){let n="";n+=`<table class="${r.CLASS_STATS}">\n`,"string"==typeof t&&(n+=`<caption>${t}</caption>\n`),n+=`<tr><th class="${r.CLASS_ACTIVE}">ops</th>\n`,n+=`<th class="${r.CLASS_EMPTY}">EMPTY</th>\n`,n+=`<th class="${r.CLASS_MATCH}">MATCH</th>\n`,n+=`<th class="${r.CLASS_NOMATCH}">NOMATCH</th>\n`,n+=`<th class="${r.CLASS_ACTIVE}">totals</th></tr>\n`;for(;;){if(void 0===e){n+=g();break}if(null===e){n+=g();break}if("ops"===e){n+=g();break}if("index"===e){a.sort(d),c.length>0&&c.sort(d),n+=g(),n+=b();break}if("hits"===e){a.sort(l),c.length>0&&c.sort(d),n+=g(),n+=b();break}if("alpha"===e){a.sort(u),c.length>0&&c.sort(u),n+=g(),n+=b();break}break}return n+="</table>\n",n}),"toHtml"),this.toHtmlPage=I((function(e,r,n){return t.htmlToPage(this.toHtml(e,r),n)}),"toHtmlPage")}),"statsFunc")}}),jn=j({"../../node_modules/.pnpm/apg-js@4.1.1/node_modules/apg-js/src/apg-lib/trace.js"(e,t){t.exports=I((function(){const e=Nn(),t=_n(),r=new(Bn()),n=Mn(),i=this,o=16,s=80,a=[];let c=5e3,u=-1,l=0,d=0;const f=[];let h=null,p=null,m=null;const g=[],b=[],y=`<span class="${t.CLASS_LINEEND}">•</span>`,v=`<span class="${t.CLASS_LINEEND}">…</span>`,w=`<span class="${t.CLASS_EMPTY}">𝜺</span>`,A=I((function(){const e=I((function(e){g[n.ALT]=e,g[n.CAT]=e,g[n.REP]=e,g[n.TLS]=e,g[n.TBS]=e,g[n.TRG]=e,g[n.AND]=e,g[n.NOT]=e,g[n.BKR]=e,g[n.BKA]=e,g[n.BKN]=e,g[n.ABG]=e,g[n.AEN]=e}),"setOperators");let t=0;for(const e in i.filter.operators)t+=1;if(0!==t){for(const t in i.filter.operators){const r=t.toUpperCase();if("<ALL>"===r)return void e(!0);if("<NONE>"===r)return void e(!1)}e(!1);for(const e in i.filter.operators){const t=e.toUpperCase();if("ALT"===t)g[n.ALT]=!0===i.filter.operators[e];else if("CAT"===t)g[n.CAT]=!0===i.filter.operators[e];else if("REP"===t)g[n.REP]=!0===i.filter.operators[e];else if("AND"===t)g[n.AND]=!0===i.filter.operators[e];else if("NOT"===t)g[n.NOT]=!0===i.filter.operators[e];else if("TLS"===t)g[n.TLS]=!0===i.filter.operators[e];else if("TBS"===t)g[n.TBS]=!0===i.filter.operators[e];else if("TRG"===t)g[n.TRG]=!0===i.filter.operators[e];else if("BKR"===t)g[n.BKR]=!0===i.filter.operators[e];else if("BKA"===t)g[n.BKA]=!0===i.filter.operators[e];else if("BKN"===t)g[n.BKN]=!0===i.filter.operators[e];else if("ABG"===t)g[n.ABG]=!0===i.filter.operators[e];else{if("AEN"!==t)throw new Error(`trace.js: initOpratorFilter: '${e}' not a valid operator name. Must be <all>, <none>, alt, cat, rep, tls, tbs, trg, and, not, bkr, bka or bkn`);g[n.AEN]=!0===i.filter.operators[e]}}}else e(!1)}),"initOperatorFilter"),E=I((function(){const e=I((function(e){g[n.RNM]=e,g[n.UDT]=e;const t=p.length+m.length;b.length=0;for(let r=0;r<t;r+=1)b.push(e)}),"setRules");let t,r;const o=[];for(r=0;r<p.length;r+=1)o.push(p[r].lower);for(r=0;r<m.length;r+=1)o.push(m[r].lower);b.length=0,t=0;for(const e in i.filter.rules)t+=1;if(0!==t){for(const t in i.filter.rules){const r=t.toLowerCase();if("<all>"===r)return void e(!0);if("<none>"===r)return void e(!1)}e(!1),g[n.RNM]=!0,g[n.UDT]=!0;for(const e in i.filter.rules){const t=e.toLowerCase();if(r=o.indexOf(t),r<0)throw new Error(`trace.js: initRuleFilter: '${e}' not a valid rule or udt name`);b[r]=!0===i.filter.rules[e]}}else e(!0)}),"initRuleFilter");this.traceObject="traceObject",this.filter={operators:[],rules:[]},this.setMaxRecords=function(e,t){u=-1,"number"==typeof e&&e>0?(c=Math.ceil(e),"number"==typeof t&&(u=Math.floor(t),u<0&&(u=-1))):c=0},this.getMaxRecords=function(){return c},this.getLastRecord=function(){return u},this.init=function(e,t,n){a.length=0,f.length=0,l=0,d=0,h=n,p=e,m=t,A(),E(),r.init(c)};const S=I((function(e){let t=!1;return t=e.type===n.RNM?!(!g[e.type]||!b[e.index]):e.type===n.UDT?!(!g[e.type]||!b[p.length+e.index]):g[e.type],t}),"filterOps"),x=I((function(e){return-1===u||e<=u}),"filterRecords");this.down=function(e,t,n,i,o,s){x(l)&&S(e)&&(f.push(l),a[r.increment()]={dirUp:!1,depth:d,thisLine:l,thatLine:void 0,opcode:e,state:t,phraseIndex:n,phraseLength:i,lookAnchor:o,lookAround:s},l+=1,d+=1)},this.up=function(e,t,n,i,o,s){if(x(l)&&S(e)){const c=l,u=f.pop(),h=r.getListIndex(u);-1!==h&&(a[h].thatLine=c),d-=1,a[r.increment()]={dirUp:!0,depth:d,thisLine:c,thatLine:u,opcode:e,state:t,phraseIndex:n,phraseLength:i,lookAnchor:o,lookAround:s},l+=1}};const M=I((function(){function t(t,r){let i,o,s;if(r)switch(t.op={id:r.type,name:e.opcodeToString(r.type)},t.opData=void 0,r.type){case n.RNM:t.opData=p[r.index].name;break;case n.UDT:t.opData=m[r.index].name;break;case n.BKR:i=r.index<p.length?p[r.index].name:m[r.index-p.length].name,o=r.bkrCase===n.BKR_MODE_CI?"%i":"%s",s=r.bkrMode===n.BKR_MODE_UM?"%u":"%p",t.opData=`\\\\${o}${s}${i}`;break;case n.TLS:t.opData=[];for(let e=0;e<r.string.length;e+=1)t.opData.push(r.string[e]);break;case n.TBS:t.opData=[];for(let e=0;e<r.string.length;e+=1)t.opData.push(r.string[e]);break;case n.TRG:case n.REP:t.opData=[r.min,r.max];break;default:throw new Error("unrecognized opcode")}else t.op={id:void 0,name:void 0},t.opData=void 0}function i(e,t,r){return e===n.MATCH?{index:t,length:r}:e===n.NOMATCH||e===n.EMPTY?{index:t,length:0}:null}I(t,"nodeOpcode"),I(i,"nodePhrase");let o=-1;function s(r,n,s){const a={id:o++,branch:-1,parent:r,up:!1,down:!1,depth:s,children:[]};return n?(a.down=!0,a.state={id:n.state,name:e.stateToString(n.state)},a.phrase=null,t(a,n.opcode)):(a.state={id:void 0,name:void 0},a.phrase=i(),t(a,void 0)),a}function c(r,n){n&&(r.up=!0,r.state={id:n.state,name:e.stateToString(n.state)},r.phrase=i(n.state,n.phraseIndex,n.phraseLength),r.down||t(r,n.opcode))}I(s,"nodeDown"),I(c,"nodeUp");let u=0,l=-1,f=1;function g(e){if(l+=1,e.branch=f,l>d&&(d=l),0===e.children.length)u+=1;else for(let t=0;t<e.children.length;t+=1)t>0&&(f+=1),e.children[t].leftMost=!1,e.children[t].rightMost=!1,e.leftMost&&(e.children[t].leftMost=0===t),e.rightMost&&(e.children[t].rightMost=t===e.children.length-1),g(e.children[t]);l-=1}function b(e,t){let r;const n={};if(n.id=e.id,n.branch=e.branch,n.leftMost=e.leftMost,n.rightMost=e.rightMost,r=e.state.name?e.state.name:"ACTIVE",n.state={id:e.state.id,name:r},r=e.op.name?e.op.name:"?",n.op={id:e.op.id,name:r},"string"==typeof e.opData)n.opData=e.opData;else if(Array.isArray(e.opData)){n.opData=[];for(let t=0;t<e.opData.length;t+=1)n.opData[t]=e.opData[t]}else n.opData=void 0;e.phrase?n.phrase={index:e.phrase.index,length:e.phrase.length}:n.phrase=null,n.depth=e.depth,n.children=[];for(let r=0;r<e.children.length;r+=1)e.children.length,n.children[r]=b(e.children[r],t);return n}I(g,"walk"),I(b,"display");const y=[];let v,w,A,E,S=!0;const x=s(null,null,-1);for(y.push(x),w=x,r.forEach((e=>{if(E=a[e],S&&(S=!1,E.depth>0)){const e=E.dirUp?E.depth+1:E.depth;for(let t=0;t<e;t+=1)A=w,w=s(w,null,t),y.push(w),A.children.push(w)}E.dirUp?(w=y.pop(),c(w,E),w=y[y.length-1]):(A=w,w=s(w,E,E.depth),y.push(w),A.children.push(w))}));y.length>1;)w=y.pop(),c(w,null);if(0===x.children.length)throw new Error("trace.toTree(): parse tree has no nodes");if(0===y.length)throw new Error("trace.toTree(): integrity check: dummy root node disappeared?");v=x.children[0];let M=v;for(;v&&!v.down&&!v.up;)M=v,v=v.children[0];v=M,v.leftMost=!0,v.rightMost=!0,g(v),v.branch=0;const _={string:[]};for(let e=0;e<h.length;e+=1)_.string[e]=h[e];_.rules=[];for(let e=0;e<p.length;e+=1)_.rules[e]=p[e].name;_.udts=[];for(let e=0;e<m.length;e+=1)_.udts[e]=m[e].name;let k;return _.id={},_.id.ALT={id:n.ALT,name:"ALT"},_.id.CAT={id:n.CAT,name:"CAT"},_.id.REP={id:n.REP,name:"REP"},_.id.RNM={id:n.RNM,name:"RNM"},_.id.TLS={id:n.TLS,name:"TLS"},_.id.TBS={id:n.TBS,name:"TBS"},_.id.TRG={id:n.TRG,name:"TRG"},_.id.UDT={id:n.UDT,name:"UDT"},_.id.AND={id:n.AND,name:"AND"},_.id.NOT={id:n.NOT,name:"NOT"},_.id.BKR={id:n.BKR,name:"BKR"},_.id.BKA={id:n.BKA,name:"BKA"},_.id.BKN={id:n.BKN,name:"BKN"},_.id.ABG={id:n.ABG,name:"ABG"},_.id.AEN={id:n.AEN,name:"AEN"},_.id.ACTIVE={id:n.ACTIVE,name:"ACTIVE"},_.id.MATCH={id:n.MATCH,name:"MATCH"},_.id.EMPTY={id:n.EMPTY,name:"EMPTY"},_.id.NOMATCH={id:n.NOMATCH,name:"NOMATCH"},_.treeDepth=d,_.leafNodes=u,k=v.down?v.up?"none":"right":v.up?"left":"both",_.branchesIncomplete=k,_.tree=b(v,v.depth),_}),"toTreeObj");this.toTree=function(e){const t=M();return e?JSON.stringify(t):t},this.toHtmlPage=function(t,r,n){return e.htmlToPage(this.toHtml(t,r),n)};const _=I((function(e,r){let n;switch(e){case o:n="hexidecimal";break;case 10:n="decimal";break;case 8:n="ASCII";break;case 32:n="UNICODE";break;default:throw new Error(`trace.js: htmlHeader: unrecognized mode: ${e}`)}let i="";return i+=`<p>display mode: ${n}</p>\n`,i+=`<table class="${t.CLASS_TRACE}">\n`,"string"==typeof r&&(i+=`<caption>${r}</caption>`),i}),"htmlHeader"),k=I((function(){let e="";return e+="</table>\n",e+=`<p class="${t.CLASS_MONOSPACE}">legend:<br>\n`,e+="(a) - line number<br>\n",e+="(b) - matching line number<br>\n",e+="(c) - phrase offset<br>\n",e+="(d) - phrase length<br>\n",e+="(e) - tree depth<br>\n",e+="(f) - operator state<br>\n",e+=` - <span class="${t.CLASS_ACTIVE}">↓</span> phrase opened<br>\n`,e+=` - <span class="${t.CLASS_MATCH}">↑M</span> phrase matched<br>\n`,e+=` - <span class="${t.CLASS_EMPTY}">↑E</span> empty phrase matched<br>\n`,e+=` - <span class="${t.CLASS_NOMATCH}">↑N</span> phrase not matched<br>\n`,e+="operator - ALT, CAT, REP, RNM, TRG, TLS, TBS<sup>†</sup>, UDT, AND, NOT, BKA, BKN, BKR, ABG, AEN<sup>‡</sup><br>\n",e+="phrase - up to 80 characters of the phrase being matched<br>\n",e+=` - <span class="${t.CLASS_MATCH}">matched characters</span><br>\n`,e+=` - <span class="${t.CLASS_LOOKAHEAD}">matched characters in look ahead mode</span><br>\n`,e+=` - <span class="${t.CLASS_LOOKBEHIND}">matched characters in look behind mode</span><br>\n`,e+=` - <span class="${t.CLASS_REMAINDER}">remainder characters(not yet examined by parser)</span><br>\n`,e+=` - <span class="${t.CLASS_CTRLCHAR}">control characters, TAB, LF, CR, etc. (ASCII mode only)</span><br>\n`,e+=` - ${w} empty string<br>\n`,e+=` - ${y} end of input string<br>\n`,e+=` - ${v} input string display truncated<br>\n`,e+="</p>\n",e+=`<p class="${t.CLASS_MONOSPACE}">\n`,e+="<sup>†</sup>original ABNF operators:<br>\n",e+="ALT - alternation<br>\n",e+="CAT - concatenation<br>\n",e+="REP - repetition<br>\n",e+="RNM - rule name<br>\n",e+="TRG - terminal range<br>\n",e+="TLS - terminal literal string (case insensitive)<br>\n",e+="TBS - terminal binary string (case sensitive)<br>\n",e+="<br>\n",e+="<sup>‡</sup>super set SABNF operators:<br>\n",e+="UDT - user-defined terminal<br>\n",e+="AND - positive look ahead<br>\n",e+="NOT - negative look ahead<br>\n",e+="BKA - positive look behind<br>\n",e+="BKN - negative look behind<br>\n",e+="BKR - back reference<br>\n",e+="ABG - anchor - begin of input string<br>\n",e+="AEN - anchor - end of input string<br>\n",e+="</p>\n",e}),"htmlFooter");this.indent=function(e){let t="";for(let r=0;r<e;r+=1)t+=".";return t};const T=I((function(e,t){let r="";if(t.type===n.TRG)if(e===o||32===e){let n=t.min.toString(16).toUpperCase();n.length%2!=0&&(n=`0${n}`),r+=e===o?"%x":"U+",r+=n,n=t.max.toString(16).toUpperCase(),n.length%2!=0&&(n=`0${n}`),r+=`–${n}`}else r=`%d${t.min.toString(10)}–${t.max.toString(10)}`;return r}),"displayTrg"),C=I((function(e,t){let r="";if(t.type===n.REP)if(e===o){let e=t.min.toString(16).toUpperCase();e.length%2!=0&&(e=`0${e}`),r=`x${e}`,t.max<1/0?(e=t.max.toString(16).toUpperCase(),e.length%2!=0&&(e=`0${e}`)):e="inf",r+=`–${e}`}else r=t.max<1/0?`${t.min.toString(10)}–${t.max.toString(10)}`:`${t.min.toString(10)}–inf`;return r}),"displayRep"),N=I((function(e,t){let r="";if(t.type===n.TBS){const n=Math.min(t.string.length,10);if(e===o||32===e){r+=e===o?"%x":"U+";for(let e=0;e<n;e+=1){let n;e>0&&(r+="."),n=t.string[e].toString(16).toUpperCase(),n.length%2!=0&&(n=`0${n}`),r+=n}}else{r="%d";for(let e=0;e<n;e+=1)e>0&&(r+="."),r+=t.string[e].toString(10)}n<t.string.length&&(r+=v)}return r}),"displayTbs"),B=I((function(t,r){let i="";if(r.type===n.TLS){const n=Math.min(r.string.length,5);if(t===o||10===t){let e,s,a;t===o?(i="%x",a=16):(i="%d",a=10);for(let t=0;t<n;t+=1)t>0&&(i+="."),s=r.string[t],s>=97&&s<=122?(e=s-32,i+=`${e.toString(a)}/${s.toString(a)}`.toUpperCase()):s>=65&&s<=90?(e=s,s+=32,i+=`${e.toString(a)}/${s.toString(a)}`.toUpperCase()):i+=s.toString(a).toUpperCase();n<r.string.length&&(i+=v)}else{i='"';for(let t=0;t<n;t+=1)i+=e.asciiChars[r.string[t]];n<r.string.length&&(i+=v),i+='"'}}return i}),"displayTls"),O=I((function(t,r,n,i,s){if(0===i)return"";let a="";const c=s?",":"";switch(t){case o:a=c+e.charsToHex(r,n,i);break;case 10:if(s)return`,${e.charsToDec(r,n,i)}`;a=c+e.charsToDec(r,n,i);break;case 32:a=e.charsToUnicode(r,n,i);break;default:a=e.charsToAsciiHtml(r,n,i)}return a}),"subPhrase"),D=I((function(e,r,i,o,a,c){let u,l,d,f,h="",p=y;const m=`<span class="${t.CLASS_LOOKBEHIND}">`,g=`<span class="${t.CLASS_REMAINDER}">`,b="</span>";let A=!1;switch(i){case n.EMPTY:h+=w;case n.NOMATCH:case n.MATCH:case n.ACTIVE:u=o-a,l=c-u,d=c,f=r.length-d;break;default:throw new Error("unrecognized state")}return p=y,l>s?(l=s,p=v,f=0):l+f>s&&(p=v,f=s-l),l>0&&(h+=m,h+=O(e,r,u,l,A),h+=b,A=!0),f>0&&(h+=g,h+=O(e,r,d,f,A),h+=b),h+p}),"displayBehind"),j=I((function(e,r,i,o,a,c){let u,l,d,f,h="",p=y;const m=`<span class="${t.CLASS_REMAINDER}">`,g="</span>";let b=!1;switch(i){case n.EMPTY:h+=w;case n.NOMATCH:case n.ACTIVE:u=o,l=0,d=o,f=r.length-d;break;case n.MATCH:u=o,l=a,d=o+l,f=r.length-d;break;default:throw new Error("unrecognized state")}return p=y,l>s?(l=s,p=v,f=0):l+f>s&&(p=v,f=s-l),l>0&&(h+=c,h+=O(e,r,u,l,b),h+=g,b=!0),f>0&&(h+=m,h+=O(e,r,d,f,b),h+=g),h+p}),"displayForward"),L=I((function(e,r,n,i,o){const s=`<span class="${t.CLASS_LOOKAHEAD}">`;return j(e,r,n,i,o,s)}),"displayAhead"),P=I((function(e,r,n,i,o){const s=`<span class="${t.CLASS_MATCH}">`;return j(e,r,n,i,o,s)}),"displayNone"),R=I((function(o){if(null===p)return"";let s,c,u,l,d,f,g="";return g+="<tr><th>(a)</th><th>(b)</th><th>(c)</th><th>(d)</th><th>(e)</th><th>(f)</th>",g+="<th>operator</th><th>phrase</th></tr>\n",r.forEach((r=>{const b=a[r];switch(s=b.thisLine,c=void 0!==b.thatLine?b.thatLine:"--",u=!1,l=!1,d=!1,b.lookAround===n.LOOKAROUND_AHEAD&&(u=!0,d=!0,f=b.lookAnchor),b.opcode.type!==n.AND&&b.opcode.type!==n.NOT||(u=!0,d=!0,f=b.phraseIndex),b.lookAround===n.LOOKAROUND_BEHIND&&(l=!0,d=!0,f=b.lookAnchor),b.opcode.type!==n.BKA&&b.opcode.type!==n.BKN||(l=!0,d=!0,f=b.phraseIndex),g+="<tr>",g+=`<td>${s}</td><td>${c}</td>`,g+=`<td>${b.phraseIndex}</td>`,g+=`<td>${b.phraseLength}</td>`,g+=`<td>${b.depth}</td>`,g+="<td>",b.state){case n.ACTIVE:g+=`<span class="${t.CLASS_ACTIVE}">↓ </span>`;break;case n.MATCH:g+=`<span class="${t.CLASS_MATCH}">↑M</span>`;break;case n.NOMATCH:g+=`<span class="${t.CLASS_NOMATCH}">↑N</span>`;break;case n.EMPTY:g+=`<span class="${t.CLASS_EMPTY}">↑E</span>`;break;default:g+=`<span class="${t.CLASS_ACTIVE}">--</span>`}if(g+="</td>",g+="<td>",g+=i.indent(b.depth),u?g+=`<span class="${t.CLASS_LOOKAHEAD}">`:l&&(g+=`<span class="${t.CLASS_LOOKBEHIND}">`),g+=e.opcodeToString(b.opcode.type),b.opcode.type===n.RNM&&(g+=`(${p[b.opcode.index].name}) `),b.opcode.type===n.BKR){const e=b.opcode.bkrCase===n.BKR_MODE_CI?"%i":"%s",t=b.opcode.bkrMode===n.BKR_MODE_UM?"%u":"%p";g+=`(\\${e}${t}${p[b.opcode.index].name}) `}b.opcode.type===n.UDT&&(g+=`(${m[b.opcode.index].name}) `),b.opcode.type===n.TRG&&(g+=`(${T(o,b.opcode)}) `),b.opcode.type===n.TBS&&(g+=`(${N(o,b.opcode)}) `),b.opcode.type===n.TLS&&(g+=`(${B(o,b.opcode)}) `),b.opcode.type===n.REP&&(g+=`(${C(o,b.opcode)}) `),d&&(g+="</span>"),g+="</td>",g+="<td>",g+=l?D(o,h,b.state,b.phraseIndex,b.phraseLength,f):u?L(o,h,b.state,b.phraseIndex,b.phraseLength):P(o,h,b.state,b.phraseIndex,b.phraseLength),g+="</td></tr>\n"})),g+="<tr><th>(a)</th><th>(b)</th><th>(c)</th><th>(d)</th><th>(e)</th><th>(f)</th>",g+="<th>operator</th><th>phrase</th></tr>\n",g+="</table>\n",g}),"htmlTable");this.toHtml=function(e,t){let r=8;if("string"==typeof e&&e.length>=3){const t=e.toLowerCase().slice(0,3);"hex"===t?r=o:"dec"===t?r=10:"uni"===t&&(r=32)}let n="";return n+=_(r,t),n+=R(r),n+=k(),n}}),"exportTrace")}}),Ln=j({"../../node_modules/.pnpm/apg-js@4.1.1/node_modules/apg-js/src/apg-lib/node-exports.js"(e,t){t.exports={ast:In(),circular:Bn(),ids:Mn(),parser:On(),stats:Dn(),trace:jn(),utils:Nn(),emitcss:Cn(),style:_n()}}}),Pn=j({"../../node_modules/.pnpm/apg-js@4.1.1/node_modules/apg-js/src/apg-api/scanner-grammar.js"(e,t){t.exports=I((function(){this.grammarObject="grammarObject",this.rules=[],this.rules[0]={name:"file",lower:"file",index:0,isBkr:!1},this.rules[1]={name:"line",lower:"line",index:1,isBkr:!1},this.rules[2]={name:"line-text",lower:"line-text",index:2,isBkr:!1},this.rules[3]={name:"last-line",lower:"last-line",index:3,isBkr:!1},this.rules[4]={name:"valid",lower:"valid",index:4,isBkr:!1},this.rules[5]={name:"invalid",lower:"invalid",index:5,isBkr:!1},this.rules[6]={name:"end",lower:"end",index:6,isBkr:!1},this.rules[7]={name:"CRLF",lower:"crlf",index:7,isBkr:!1},this.rules[8]={name:"LF",lower:"lf",index:8,isBkr:!1},this.rules[9]={name:"CR",lower:"cr",index:9,isBkr:!1},this.udts=[],this.rules[0].opcodes=[],this.rules[0].opcodes[0]={type:2,children:[1,3]},this.rules[0].opcodes[1]={type:3,min:0,max:1/0},this.rules[0].opcodes[2]={type:4,index:1},this.rules[0].opcodes[3]={type:3,min:0,max:1},this.rules[0].opcodes[4]={type:4,index:3},this.rules[1].opcodes=[],this.rules[1].opcodes[0]={type:2,children:[1,2]},this.rules[1].opcodes[1]={type:4,index:2},this.rules[1].opcodes[2]={type:4,index:6},this.rules[2].opcodes=[],this.rules[2].opcodes[0]={type:3,min:0,max:1/0},this.rules[2].opcodes[1]={type:1,children:[2,3]},this.rules[2].opcodes[2]={type:4,index:4},this.rules[2].opcodes[3]={type:4,index:5},this.rules[3].opcodes=[],this.rules[3].opcodes[0]={type:3,min:1,max:1/0},this.rules[3].opcodes[1]={type:1,children:[2,3]},this.rules[3].opcodes[2]={type:4,index:4},this.rules[3].opcodes[3]={type:4,index:5},this.rules[4].opcodes=[],this.rules[4].opcodes[0]={type:1,children:[1,2]},this.rules[4].opcodes[1]={type:5,min:32,max:126},this.rules[4].opcodes[2]={type:6,string:[9]},this.rules[5].opcodes=[],this.rules[5].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[5].opcodes[1]={type:5,min:0,max:8},this.rules[5].opcodes[2]={type:5,min:11,max:12},this.rules[5].opcodes[3]={type:5,min:14,max:31},this.rules[5].opcodes[4]={type:5,min:127,max:4294967295},this.rules[6].opcodes=[],this.rules[6].opcodes[0]={type:1,children:[1,2,3]},this.rules[6].opcodes[1]={type:4,index:7},this.rules[6].opcodes[2]={type:4,index:8},this.rules[6].opcodes[3]={type:4,index:9},this.rules[7].opcodes=[],this.rules[7].opcodes[0]={type:6,string:[13,10]},this.rules[8].opcodes=[],this.rules[8].opcodes[0]={type:6,string:[10]},this.rules[9].opcodes=[],this.rules[9].opcodes[0]={type:6,string:[13]},this.toString=I((function(){let e="";return e+="file = *line [last-line]\n",e+="line = line-text end\n",e+="line-text = *(valid/invalid)\n",e+="last-line = 1*(valid/invalid)\n",e+="valid = %d32-126 / %d9\n",e+="invalid = %d0-8 / %d11-12 /%d14-31 / %x7f-ffffffff\n",e+="end = CRLF / LF / CR\n",e+="CRLF = %d13.10\n",e+="LF = %d10\n",e+="CR = %d13\n","file = *line [last-line]\nline = line-text end\nline-text = *(valid/invalid)\nlast-line = 1*(valid/invalid)\nvalid = %d32-126 / %d9\ninvalid = %d0-8 / %d11-12 /%d14-31 / %x7f-ffffffff\nend = CRLF / LF / CR\nCRLF = %d13.10\nLF = %d10\nCR = %d13\n"}),"toString")}),"grammar")}}),Rn=j({"../../node_modules/.pnpm/apg-js@4.1.1/node_modules/apg-js/src/apg-api/scanner-callbacks.js"(e){var t=Mn(),r=Nn();function n(e,r,n,i,o){return e===t.SEM_PRE?(o.endLength=0,o.textLength=0,o.invalidCount=0):o.lines.push({lineNo:o.lines.length,beginChar:n,length:i,textLength:o.textLength,endType:o.endType,invalidChars:o.invalidCount}),t.SEM_OK}function i(e,r,n,i,o){return e===t.SEM_PRE&&(o.textLength=i),t.SEM_OK}function o(e,r,n,i,o){return e===t.SEM_PRE?(o.endLength=0,o.textLength=0,o.invalidCount=0):o.strict?(o.lines.push({lineNo:o.lines.length,beginChar:n,length:i,textLength:i,endType:"none",invalidChars:o.invalidCount}),o.errors.push({line:o.lineNo,char:n+i,msg:"no line end on last line - strict ABNF specifies CRLF(\\r\\n, \\x0D\\x0A)"})):(r.push(10),o.lines.push({lineNo:o.lines.length,beginChar:n,length:i+1,textLength:i,endType:"LF",invalidChars:o.invalidCount})),t.SEM_OK}function s(e,n,i,o,s){return e===t.SEM_PRE&&s.errors.push({line:s.lineNo,char:i,msg:`invalid character found '\\x${r.charToHex(n[i])}'`}),t.SEM_OK}function a(e,r,n,i,o){return e===t.SEM_POST&&(o.lineNo+=1),t.SEM_OK}function c(e,r,n,i,o){return e===t.SEM_PRE&&(o.endType="LF",o.strict&&o.errors.push({line:o.lineNo,char:n,msg:"line end character LF(\\n, \\x0A) - strict ABNF specifies CRLF(\\r\\n, \\x0D\\x0A)"})),t.SEM_OK}function u(e,r,n,i,o){return e===t.SEM_PRE&&(o.endType="CR",o.strict&&o.errors.push({line:o.lineNo,char:n,msg:"line end character CR(\\r, \\x0D) - strict ABNF specifies CRLF(\\r\\n, \\x0D\\x0A)"})),t.SEM_OK}function l(e,r,n,i,o){return e===t.SEM_PRE&&(o.endType="CRLF"),t.SEM_OK}I(n,"semLine"),I(i,"semLineText"),I(o,"semLastLine"),I(s,"semInvalid"),I(a,"semEnd"),I(c,"semLF"),I(u,"semCR"),I(l,"semCRLF");var d=[];d.line=n,d["line-text"]=i,d["last-line"]=o,d.invalid=s,d.end=a,d.lf=c,d.cr=u,d.crlf=l,e.callbacks=d}}),Un=j({"../../node_modules/.pnpm/apg-js@4.1.1/node_modules/apg-js/src/apg-api/scanner.js"(e,t){t.exports=I((function(e,t,r,n){const i=Ln(),o=new(Pn()),{callbacks:s}=Rn(),a=[],c=new i.parser;if(c.ast=new i.ast,c.ast.callbacks=s,n){if("traceObject"!==n.traceObject)throw new TypeError("scanner.js: trace argument is not a trace object");c.trace=n}if(!0!==c.parse(o,"file",e).success)return void t.push({line:0,char:0,msg:"syntax analysis error analyzing input SABNF grammar"});const u={lines:a,lineNo:0,errors:t,strict:!!r};return c.ast.translate(u),a}),"exports")}}),zn=j({"../../node_modules/.pnpm/apg-js@4.1.1/node_modules/apg-js/src/apg-api/syntax-callbacks.js"(e,t){t.exports=I((function(){const e="syntax-callbacks.js: ",t=Ln(),r=t.ids;let n;const i=I((function(t,n,i,o){switch(t.state){case r.ACTIVE:o.altStack=[],o.repCount=0;break;case r.EMPTY:o.errors.push({line:0,char:0,msg:"grammar file is empty"});break;case r.MATCH:0===o.ruleCount&&o.errors.push({line:0,char:0,msg:"no rules defined"});break;case r.NOMATCH:throw new Error(`${e}synFile: grammar file NOMATCH: design error: should never happen.`);default:throw new Error(`${e}synFile: unrecognized case.`)}}),"synFile"),o=I((function(t,i,o,s){switch(t.state){case r.ACTIVE:s.altStack.length=0,n={groupOpen:null,groupError:!1,optionOpen:null,optionError:!1,tlsOpen:null,clsOpen:null,prosValOpen:null,basicError:!1},s.altStack.push(n);break;case r.EMPTY:throw new Error(`${e}synRule: EMPTY: rule cannot be empty`);case r.NOMATCH:break;case r.MATCH:s.ruleCount+=1;break;default:throw new Error(`${e}synFile: unrecognized case.`)}}),"synRule"),s=I((function(t,n,i,o){switch(t.state){case r.ACTIVE:case r.EMPTY:case r.NOMATCH:break;case r.MATCH:o.errors.push({line:o.findLine(o.lines,i,o.charsLength),char:i,msg:"Unrecognized SABNF line. Invalid rule, comment or blank line."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}}),"synRuleError"),a=I((function(t,n,i,o){switch(t.state){case r.ACTIVE:case r.EMPTY:case r.NOMATCH:break;case r.MATCH:o.errors.push({line:o.findLine(o.lines,i,o.charsLength),char:i,msg:"Rule names must be alphanum and begin with alphabetic character."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}}),"synRuleNameError"),c=I((function(t,n,i,o){switch(t.state){case r.ACTIVE:case r.EMPTY:case r.NOMATCH:break;case r.MATCH:o.errors.push({line:o.findLine(o.lines,i,o.charsLength),char:i,msg:"Expected '=' or '=/'. Not found."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}}),"synDefinedAsError"),u=I((function(t,n,i,o){switch(t.state){case r.ACTIVE:case r.EMPTY:case r.NOMATCH:break;case r.MATCH:o.strict&&o.errors.push({line:o.findLine(o.lines,i,o.charsLength),char:i,msg:"AND operator(&) found - strict ABNF specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}}),"synAndOp"),l=I((function(t,n,i,o){switch(t.state){case r.ACTIVE:case r.EMPTY:case r.NOMATCH:break;case r.MATCH:o.strict&&o.errors.push({line:o.findLine(o.lines,i,o.charsLength),char:i,msg:"NOT operator(!) found - strict ABNF specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}}),"synNotOp"),d=I((function(t,n,i,o){switch(t.state){case r.ACTIVE:case r.EMPTY:case r.NOMATCH:break;case r.MATCH:o.strict&&o.errors.push({line:o.findLine(o.lines,i,o.charsLength),char:i,msg:"Positive look-behind operator(&&) found - strict ABNF specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}}),"synBkaOp"),f=I((function(t,n,i,o){switch(t.state){case r.ACTIVE:case r.EMPTY:case r.NOMATCH:break;case r.MATCH:o.strict&&o.errors.push({line:o.findLine(o.lines,i,o.charsLength),char:i,msg:"Negative look-behind operator(!!) found - strict ABNF specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}}),"synBknOp"),h=I((function(t,n,i,o){switch(t.state){case r.ACTIVE:case r.EMPTY:case r.NOMATCH:break;case r.MATCH:o.strict&&o.errors.push({line:o.findLine(o.lines,i,o.charsLength),char:i,msg:"Beginning of string anchor(%^) found - strict ABNF specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}}),"synAbgOp"),p=I((function(t,n,i,o){switch(t.state){case r.ACTIVE:case r.EMPTY:case r.NOMATCH:break;case r.MATCH:o.strict&&o.errors.push({line:o.findLine(o.lines,i,o.charsLength),char:i,msg:"End of string anchor(%$) found - strict ABNF specified."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}}),"synAenOp"),m=I((function(n,i,o,s){switch(n.state){case r.ACTIVE:case r.EMPTY:case r.NOMATCH:break;case r.MATCH:if(s.strict){const e=t.utils.charsToString(i,o,n.phraseLength);s.errors.push({line:s.findLine(s.lines,o,s.charsLength),char:o,msg:`Back reference operator(${e}) found - strict ABNF specified.`})}break;default:throw new Error(`${e}synFile: unrecognized case.`)}}),"synBkrOp"),g=I((function(n,i,o,s){switch(n.state){case r.ACTIVE:case r.EMPTY:case r.NOMATCH:break;case r.MATCH:if(s.strict){const e=t.utils.charsToString(i,o,n.phraseLength);s.errors.push({line:s.findLine(s.lines,o,s.charsLength),char:o,msg:`UDT operator found(${e}) - strict ABNF specified.`})}break;default:throw new Error(`${e}synFile: unrecognized case.`)}}),"synUdtOp"),b=I((function(t,i,o){switch(t.state){case r.ACTIVE:case r.EMPTY:case r.NOMATCH:break;case r.MATCH:n.tlsOpen=o;break;default:throw new Error(`${e}synFile: unrecognized case.`)}}),"synTlsOpen"),y=I((function(t,n,i,o){switch(t.state){case r.ACTIVE:o.stringTabChar=!1;break;case r.EMPTY:case r.NOMATCH:break;case r.MATCH:!1!==o.stringTabChar&&o.errors.push({line:o.findLine(o.lines,o.stringTabChar),char:o.stringTabChar,msg:"Tab character (\\t, x09) not allowed in literal string (see 'quoted-string' definition, RFC 7405.)"});break;default:throw new Error(`${e}synFile: unrecognized case.`)}}),"synTlsString"),v=I((function(t,n,i,o){switch(t.state){case r.ACTIVE:case r.EMPTY:case r.NOMATCH:break;case r.MATCH:o.stringTabChar=i;break;default:throw new Error(`${e}synFile: unrecognized case.`)}}),"synStringTab"),w=I((function(t,i,o,s){switch(t.state){case r.ACTIVE:case r.EMPTY:break;case r.NOMATCH:s.errors.push({line:s.findLine(s.lines,n.tlsOpen),char:n.tlsOpen,msg:'Case-insensitive literal string("...") opened but not closed.'}),n.basicError=!0,n.tlsOpen=null;break;case r.MATCH:n.tlsOpen=null;break;default:throw new Error(`${e}synFile: unrecognized case.`)}}),"synTlsClose"),A=I((function(t,i,o){switch(t.state){case r.ACTIVE:case r.EMPTY:case r.NOMATCH:break;case r.MATCH:n.clsOpen=o;break;default:throw new Error(`${e}synFile: unrecognized case.`)}}),"synClsOpen"),E=I((function(t,n,i,o){switch(t.state){case r.ACTIVE:o.stringTabChar=!1;break;case r.EMPTY:case r.NOMATCH:break;case r.MATCH:!1!==o.stringTabChar&&o.errors.push({line:o.findLine(o.lines,o.stringTabChar),char:o.stringTabChar,msg:"Tab character (\\t, x09) not allowed in literal string."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}}),"synClsString"),S=I((function(t,i,o,s){switch(t.state){case r.ACTIVE:case r.EMPTY:break;case r.NOMATCH:s.errors.push({line:s.findLine(s.lines,n.clsOpen),char:n.clsOpen,msg:"Case-sensitive literal string('...') opened but not closed."}),n.clsOpen=null,n.basicError=!0;break;case r.MATCH:s.strict&&s.errors.push({line:s.findLine(s.lines,n.clsOpen),char:n.clsOpen,msg:"Case-sensitive string operator('...') found - strict ABNF specified."}),n.clsOpen=null;break;default:throw new Error(`${e}synFile: unrecognized case.`)}}),"synClsClose"),x=I((function(t,i,o){switch(t.state){case r.ACTIVE:case r.EMPTY:case r.NOMATCH:break;case r.MATCH:n.prosValOpen=o;break;default:throw new Error(`${e}synFile: unrecognized case.`)}}),"synProsValOpen"),M=I((function(t,n,i,o){switch(t.state){case r.ACTIVE:o.stringTabChar=!1;break;case r.EMPTY:case r.NOMATCH:break;case r.MATCH:!1!==o.stringTabChar&&o.errors.push({line:o.findLine(o.lines,o.stringTabChar),char:o.stringTabChar,msg:"Tab character (\\t, x09) not allowed in prose value string."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}}),"synProsValString"),_=I((function(t,i,o,s){switch(t.state){case r.ACTIVE:case r.EMPTY:break;case r.NOMATCH:s.errors.push({line:s.findLine(s.lines,n.prosValOpen),char:n.prosValOpen,msg:"Prose value operator(<...>) opened but not closed."}),n.basicError=!0,n.prosValOpen=null;break;case r.MATCH:s.errors.push({line:s.findLine(s.lines,n.prosValOpen),char:n.prosValOpen,msg:"Prose value operator(<...>) found. The ABNF syntax is valid, but a parser cannot be generated from this grammar."}),n.prosValOpen=null;break;default:throw new Error(`${e}synFile: unrecognized case.`)}}),"synProsValClose"),k=I((function(t,i,o,s){switch(t.state){case r.ACTIVE:case r.EMPTY:case r.NOMATCH:break;case r.MATCH:n={groupOpen:o,groupError:!1,optionOpen:null,optionError:!1,tlsOpen:null,clsOpen:null,prosValOpen:null,basicError:!1},s.altStack.push(n);break;default:throw new Error(`${e}synFile: unrecognized case.`)}}),"synGroupOpen"),T=I((function(t,i,o,s){switch(t.state){case r.ACTIVE:case r.EMPTY:break;case r.NOMATCH:s.errors.push({line:s.findLine(s.lines,n.groupOpen),char:n.groupOpen,msg:'Group "(...)" opened but not closed.'}),n=s.altStack.pop(),n.groupError=!0;break;case r.MATCH:n=s.altStack.pop();break;default:throw new Error(`${e}synFile: unrecognized case.`)}}),"synGroupClose"),C=I((function(t,i,o,s){switch(t.state){case r.ACTIVE:case r.EMPTY:case r.NOMATCH:break;case r.MATCH:n={groupOpen:null,groupError:!1,optionOpen:o,optionError:!1,tlsOpen:null,clsOpen:null,prosValOpen:null,basicError:!1},s.altStack.push(n);break;default:throw new Error(`${e}synFile: unrecognized case.`)}}),"synOptionOpen"),N=I((function(t,i,o,s){switch(t.state){case r.ACTIVE:case r.EMPTY:break;case r.NOMATCH:s.errors.push({line:s.findLine(s.lines,n.optionOpen),char:n.optionOpen,msg:'Option "[...]" opened but not closed.'}),n=s.altStack.pop(),n.optionError=!0;break;case r.MATCH:n=s.altStack.pop();break;default:throw new Error(`${e}synFile: unrecognized case.`)}}),"synOptionClose"),B=I((function(t,i,o,s){switch(t.state){case r.ACTIVE:case r.EMPTY:case r.NOMATCH:break;case r.MATCH:!1===n.basicError&&s.errors.push({line:s.findLine(s.lines,o,s.charsLength),char:o,msg:"Unrecognized SABNF element."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}}),"synBasicElementError"),O=I((function(t,n,i,o){switch(t.state){case r.ACTIVE:case r.EMPTY:case r.NOMATCH:break;case r.MATCH:if(1===t.phraseLength&&o.strict){const e=13===n[i]?"CR":"LF";o.errors.push({line:o.findLine(o.lines,i,o.charsLength),char:i,msg:`Line end '${e}' found - strict ABNF specified, only CRLF allowed.`})}break;default:throw new Error(`${e}synFile: unrecognized case.`)}}),"synLineEnd"),D=I((function(t,n,i,o){switch(t.state){case r.ACTIVE:case r.EMPTY:case r.NOMATCH:break;case r.MATCH:o.errors.push({line:o.findLine(o.lines,i,o.charsLength),char:i,msg:"Unrecognized grammar element or characters."});break;default:throw new Error(`${e}synFile: unrecognized case.`)}}),"synLineEndError"),j=I((function(t,n,i,o){switch(t.state){case r.ACTIVE:case r.EMPTY:break;case r.NOMATCH:case r.MATCH:o.repCount+=1;break;default:throw new Error(`${e}synFile: unrecognized case.`)}}),"synRepetition");this.callbacks=[],this.callbacks.andop=u,this.callbacks.basicelementerr=B,this.callbacks.clsclose=S,this.callbacks.clsopen=A,this.callbacks.clsstring=E,this.callbacks.definedaserror=c,this.callbacks.file=i,this.callbacks.groupclose=T,this.callbacks.groupopen=k,this.callbacks.lineenderror=D,this.callbacks.lineend=O,this.callbacks.notop=l,this.callbacks.optionclose=N,this.callbacks.optionopen=C,this.callbacks.prosvalclose=_,this.callbacks.prosvalopen=x,this.callbacks.prosvalstring=M,this.callbacks.repetition=j,this.callbacks.rule=o,this.callbacks.ruleerror=s,this.callbacks.rulenameerror=a,this.callbacks.stringtab=v,this.callbacks.tlsclose=w,this.callbacks.tlsopen=b,this.callbacks.tlsstring=y,this.callbacks.udtop=g,this.callbacks.bkaop=d,this.callbacks.bknop=f,this.callbacks.bkrop=m,this.callbacks.abgop=h,this.callbacks.aenop=p}),"exports")}}),Kn=j({"../../node_modules/.pnpm/apg-js@4.1.1/node_modules/apg-js/src/apg-api/semantic-callbacks.js"(e,t){t.exports=I((function(){const e=Ln(),t=e.ids,r=I((function(){this.names=[],this.add=I((function(e){let t=-1;return-1===this.get(e)&&(t={name:e,lower:e.toLowerCase(),index:this.names.length},this.names.push(t)),t}),"add"),this.get=I((function(e){let t=-1;const r=e.toLowerCase();for(let e=0;e<this.names.length;e+=1)if(this.names[e].lower===r){t=this.names[e];break}return t}),"get")}),"NameList"),n=I((function(e,t,r){let n=0;for(let i=t;i<t+r;i+=1)n=10*n+e[i]-48;return n}),"decnum"),i=I((function(e,t,r){let n=0;for(let i=t;i<t+r;i+=1)n=2*n+e[i]-48;return n}),"binnum"),o=I((function(e,t,r){let n=0;for(let i=t;i<t+r;i+=1){let t=e[i];if(t>=48&&t<=57)t-=48;else if(t>=65&&t<=70)t-=55;else{if(!(t>=97&&t<=102))throw new Error("hexnum out of range");t-=87}n=16*n+t}return n}),"hexnum");function s(e,n,i,o,s){const a=t.SEM_OK;if(e===t.SEM_PRE)s.ruleNames=new r,s.udtNames=new r,s.rules=[],s.udts=[],s.rulesLineMap=[],s.opcodes=[],s.altStack=[],s.topStack=null,s.topRule=null;else if(e===t.SEM_POST){let e;s.rules.forEach((r=>{r.isBkr=!1,r.opcodes.forEach((r=>{r.type===t.RNM&&(e=s.ruleNames.get(r.index.name),-1===e?(s.errors.push({line:s.findLine(s.lines,r.index.phraseIndex,s.charsLength),char:r.index.phraseIndex,msg:`Rule name '${r.index.name}' used but not defined.`}),r.index=-1):r.index=e.index)}))})),s.udts.forEach((e=>{e.isBkr=!1})),s.rules.forEach((r=>{r.opcodes.forEach((n=>{n.type===t.BKR&&(r.hasBkr=!0,e=s.ruleNames.get(n.index.name),-1!==e?(s.rules[e.index].isBkr=!0,n.index=e.index):(e=s.udtNames.get(n.index.name),-1!==e?(s.udts[e.index].isBkr=!0,n.index=s.rules.length+e.index):(s.errors.push({line:s.findLine(s.lines,n.index.phraseIndex,s.charsLength),char:n.index.phraseIndex,msg:`Back reference name '${n.index.name}' refers to undefined rule or unamed UDT.`}),n.index=-1)))}))}))}return a}function a(e,r,n,i,o){const s=t.SEM_OK;return e===t.SEM_PRE&&(o.altStack.length=0,o.topStack=null,o.rulesLineMap.push({line:o.findLine(o.lines,n,o.charsLength),char:n})),s}function c(e,r,n,i,o){const s=t.SEM_OK;if(e===t.SEM_PRE)o.ruleName="",o.definedas="";else if(e===t.SEM_POST){let e;"="===o.definedas?(e=o.ruleNames.add(o.ruleName),-1===e?(o.definedas=null,o.errors.push({line:o.findLine(o.lines,n,o.charsLength),char:n,msg:`Rule name '${o.ruleName}' previously defined.`})):(o.topRule={name:e.name,lower:e.lower,opcodes:[],index:e.index},o.rules.push(o.topRule),o.opcodes=o.topRule.opcodes)):(e=o.ruleNames.get(o.ruleName),-1===e?(o.definedas=null,o.errors.push({line:o.findLine(o.lines,n,o.charsLength),char:n,msg:`Rule name '${o.ruleName}' for incremental alternate not previously defined.`})):(o.topRule=o.rules[e.index],o.opcodes=o.topRule.opcodes))}return s}function u(e,r,n,i,o){let s=t.SEM_OK;if(e===t.SEM_PRE){const e=!0;for(;e;){if(null===o.definedas){s=t.SEM_SKIP;break}if(null===o.topStack){if("="===o.definedas){o.topStack={alt:{type:t.ALT,children:[]},cat:null},o.altStack.push(o.topStack),o.opcodes.push(o.topStack.alt);break}o.topStack={alt:o.opcodes[0],cat:null},o.altStack.push(o.topStack);break}o.topStack={alt:{type:t.ALT,children:[]},cat:null},o.altStack.push(o.topStack),o.opcodes.push(o.topStack.alt);break}}else e===t.SEM_POST&&(o.altStack.pop(),o.altStack.length>0?o.topStack=o.altStack[o.altStack.length-1]:o.topStack=null);return s}function l(e,r,n,i,o){const s=t.SEM_OK;return e===t.SEM_PRE?(o.topStack.alt.children.push(o.opcodes.length),o.topStack.cat={type:t.CAT,children:[]},o.opcodes.push(o.topStack.cat)):e===t.SEM_POST&&(o.topStack.cat=null),s}function d(e,r,n,i,o){const s=t.SEM_OK;return e===t.SEM_PRE&&o.topStack.cat.children.push(o.opcodes.length),s}function f(e,r,n,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&o.opcodes.push({type:t.REP,min:0,max:1,char:n}),s}function h(r,n,i,o,s){const a=t.SEM_OK;return r===t.SEM_PRE&&(s.ruleName=e.utils.charsToString(n,i,o)),a}function p(e,r,n,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&(o.definedas="="),s}function m(e,r,n,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&(o.definedas="=/"),s}function g(e,r,n,i,o){const s=t.SEM_OK;return e===t.SEM_PRE?(o.min=0,o.max=1/0,o.topRep={type:t.REP,min:0,max:1/0},o.opcodes.push(o.topRep)):e===t.SEM_POST&&(o.min>o.max&&o.errors.push({line:o.findLine(o.lines,n,o.charsLength),char:n,msg:`repetition min cannot be greater than max: min: ${o.min}: max: ${o.max}`}),o.topRep.min=o.min,o.topRep.max=o.max),s}function b(e,r,i,o,s){const a=t.SEM_OK;return e===t.SEM_POST&&(s.min=n(r,i,o)),a}function y(e,r,i,o,s){const a=t.SEM_OK;return e===t.SEM_POST&&(s.max=n(r,i,o)),a}function v(e,r,i,o,s){const a=t.SEM_OK;return e===t.SEM_POST&&(s.max=n(r,i,o),s.min=s.max),a}function w(e,r,n,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&o.opcodes.push({type:t.AND}),s}function A(e,r,n,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&o.opcodes.push({type:t.NOT}),s}function E(r,n,i,o,s){const a=t.SEM_OK;return r===t.SEM_POST&&s.opcodes.push({type:t.RNM,index:{phraseIndex:i,name:e.utils.charsToString(n,i,o)}}),a}function S(e,r,n,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&o.opcodes.push({type:t.ABG}),s}function x(e,r,n,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&o.opcodes.push({type:t.AEN}),s}function M(e,r,n,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&o.opcodes.push({type:t.BKA}),s}function _(e,r,n,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&o.opcodes.push({type:t.BKN}),s}function k(r,n,i,o,s){const a=t.SEM_OK;return r===t.SEM_PRE?(s.ci=!0,s.cs=!1,s.um=!0,s.pm=!1):r===t.SEM_POST&&s.opcodes.push({type:t.BKR,bkrCase:!0===s.cs?t.BKR_MODE_CS:t.BKR_MODE_CI,bkrMode:!0===s.pm?t.BKR_MODE_PM:t.BKR_MODE_UM,index:{phraseIndex:s.bkrname.phraseIndex,name:e.utils.charsToString(n,s.bkrname.phraseIndex,s.bkrname.phraseLength)}}),a}function T(e,r,n,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&(o.ci=!0),s}function C(e,r,n,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&(o.cs=!0),s}function N(e,r,n,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&(o.um=!0),s}function B(e,r,n,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&(o.pm=!0),s}function O(e,r,n,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&(o.bkrname={phraseIndex:n,phraseLength:i}),s}function D(r,n,i,o,s){const a=t.SEM_OK;if(r===t.SEM_POST){const r=e.utils.charsToString(n,i,o);let a=s.udtNames.add(r);if(-1===a){if(a=s.udtNames.get(r),-1===a)throw new Error("semUdtEmpty: name look up error")}else s.udts.push({name:a.name,lower:a.lower,index:a.index,empty:!0});s.opcodes.push({type:t.UDT,empty:!0,index:a.index})}return a}function j(r,n,i,o,s){const a=t.SEM_OK;if(r===t.SEM_POST){const r=e.utils.charsToString(n,i,o);let a=s.udtNames.add(r);if(-1===a){if(a=s.udtNames.get(r),-1===a)throw new Error("semUdtNonEmpty: name look up error")}else s.udts.push({name:a.name,lower:a.lower,index:a.index,empty:!1});s.opcodes.push({type:t.UDT,empty:!1,index:a.index,syntax:null,semantic:null})}return a}function L(e,r,n,i,o){const s=t.SEM_OK;return e===t.SEM_PRE&&(o.tlscase=!0),s}function P(e,r,n,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&i>0&&(83===r[n+1]||115===r[n+1])&&(o.tlscase=!1),s}function R(e,r,n,i,o){const s=t.SEM_OK;if(e===t.SEM_POST)if(o.tlscase){const e=r.slice(n,n+i);for(let t=0;t<e.length;t+=1)e[t]>=65&&e[t]<=90&&(e[t]+=32);o.opcodes.push({type:t.TLS,string:e})}else o.opcodes.push({type:t.TBS,string:r.slice(n,n+i)});return s}function U(e,r,n,i,o){const s=t.SEM_OK;return e===t.SEM_POST&&(i<=2?o.opcodes.push({type:t.TLS,string:[]}):o.opcodes.push({type:t.TBS,string:r.slice(n+1,n+i-1)})),s}function z(e,r,n,i,o){const s=t.SEM_OK;return e===t.SEM_PRE?o.tbsstr=[]:e===t.SEM_POST&&o.opcodes.push({type:t.TBS,string:o.tbsstr}),s}function K(e,r,n,i,o){const s=t.SEM_OK;return e===t.SEM_PRE?(o.min=0,o.max=0):e===t.SEM_POST&&(o.min>o.max&&o.errors.push({line:o.findLine(o.lines,n,o.charsLength),char:n,msg:`TRG, (%dmin-max), min cannot be greater than max: min: ${o.min}: max: ${o.max}`}),o.opcodes.push({type:t.TRG,min:o.min,max:o.max})),s}function F(e,r,i,o,s){const a=t.SEM_OK;return e===t.SEM_POST&&(s.min=n(r,i,o)),a}function H(e,r,i,o,s){const a=t.SEM_OK;return e===t.SEM_POST&&(s.max=n(r,i,o)),a}function $(e,r,n,o,s){const a=t.SEM_OK;return e===t.SEM_POST&&(s.min=i(r,n,o)),a}function V(e,r,n,o,s){const a=t.SEM_OK;return e===t.SEM_POST&&(s.max=i(r,n,o)),a}function q(e,r,n,i,s){const a=t.SEM_OK;return e===t.SEM_POST&&(s.min=o(r,n,i)),a}function G(e,r,n,i,s){const a=t.SEM_OK;return e===t.SEM_POST&&(s.max=o(r,n,i)),a}function Y(e,r,i,o,s){const a=t.SEM_OK;return e===t.SEM_POST&&s.tbsstr.push(n(r,i,o)),a}function J(e,r,n,o,s){const a=t.SEM_OK;return e===t.SEM_POST&&s.tbsstr.push(i(r,n,o)),a}function Q(e,r,n,i,s){const a=t.SEM_OK;return e===t.SEM_POST&&s.tbsstr.push(o(r,n,i)),a}I(s,"semFile"),I(a,"semRule"),I(c,"semRuleLookup"),I(u,"semAlternation"),I(l,"semConcatenation"),I(d,"semRepetition"),I(f,"semOptionOpen"),I(h,"semRuleName"),I(p,"semDefined"),I(m,"semIncAlt"),I(g,"semRepOp"),I(b,"semRepMin"),I(y,"semRepMax"),I(v,"semRepMinMax"),I(w,"semAndOp"),I(A,"semNotOp"),I(E,"semRnmOp"),I(S,"semAbgOp"),I(x,"semAenOp"),I(M,"semBkaOp"),I(_,"semBknOp"),I(k,"semBkrOp"),I(T,"semBkrCi"),I(C,"semBkrCs"),I(N,"semBkrUm"),I(B,"semBkrPm"),I(O,"semBkrName"),I(D,"semUdtEmpty"),I(j,"semUdtNonEmpty"),I(L,"semTlsOp"),I(P,"semTlsCase"),I(R,"semTlsString"),I(U,"semClsOp"),I(z,"semTbsOp"),I(K,"semTrgOp"),I(F,"semDmin"),I(H,"semDmax"),I($,"semBmin"),I(V,"semBmax"),I(q,"semXmin"),I(G,"semXmax"),I(Y,"semDstring"),I(J,"semBstring"),I(Q,"semXstring"),this.callbacks=[],this.callbacks.abgop=S,this.callbacks.aenop=x,this.callbacks.alternation=u,this.callbacks.andop=w,this.callbacks.bmax=V,this.callbacks.bmin=$,this.callbacks.bkaop=M,this.callbacks.bknop=_,this.callbacks.bkrop=k,this.callbacks["bkr-name"]=O,this.callbacks.bstring=J,this.callbacks.clsop=U,this.callbacks.ci=T,this.callbacks.cs=C,this.callbacks.um=N,this.callbacks.pm=B,this.callbacks.concatenation=l,this.callbacks.defined=p,this.callbacks.dmax=H,this.callbacks.dmin=F,this.callbacks.dstring=Y,this.callbacks.file=s,this.callbacks.incalt=m,this.callbacks.notop=A,this.callbacks.optionopen=f,this.callbacks["rep-max"]=y,this.callbacks["rep-min"]=b,this.callbacks["rep-min-max"]=v,this.callbacks.repetition=d,this.callbacks.repop=g,this.callbacks.rnmop=E,this.callbacks.rule=a,this.callbacks.rulelookup=c,this.callbacks.rulename=h,this.callbacks.tbsop=z,this.callbacks.tlscase=P,this.callbacks.tlsstring=R,this.callbacks.tlsop=L,this.callbacks.trgop=K,this.callbacks["udt-empty"]=D,this.callbacks["udt-non-empty"]=j,this.callbacks.xmax=G,this.callbacks.xmin=q,this.callbacks.xstring=Q}),"exports")}}),Fn=j({"../../node_modules/.pnpm/apg-js@4.1.1/node_modules/apg-js/src/apg-api/sabnf-grammar.js"(e,t){t.exports=I((function(){this.grammarObject="grammarObject",this.rules=[],this.rules[0]={name:"File",lower:"file",index:0,isBkr:!1},this.rules[1]={name:"BlankLine",lower:"blankline",index:1,isBkr:!1},this.rules[2]={name:"Rule",lower:"rule",index:2,isBkr:!1},this.rules[3]={name:"RuleLookup",lower:"rulelookup",index:3,isBkr:!1},this.rules[4]={name:"RuleNameTest",lower:"rulenametest",index:4,isBkr:!1},this.rules[5]={name:"RuleName",lower:"rulename",index:5,isBkr:!1},this.rules[6]={name:"RuleNameError",lower:"rulenameerror",index:6,isBkr:!1},this.rules[7]={name:"DefinedAsTest",lower:"definedastest",index:7,isBkr:!1},this.rules[8]={name:"DefinedAsError",lower:"definedaserror",index:8,isBkr:!1},this.rules[9]={name:"DefinedAs",lower:"definedas",index:9,isBkr:!1},this.rules[10]={name:"Defined",lower:"defined",index:10,isBkr:!1},this.rules[11]={name:"IncAlt",lower:"incalt",index:11,isBkr:!1},this.rules[12]={name:"RuleError",lower:"ruleerror",index:12,isBkr:!1},this.rules[13]={name:"LineEndError",lower:"lineenderror",index:13,isBkr:!1},this.rules[14]={name:"Alternation",lower:"alternation",index:14,isBkr:!1},this.rules[15]={name:"Concatenation",lower:"concatenation",index:15,isBkr:!1},this.rules[16]={name:"Repetition",lower:"repetition",index:16,isBkr:!1},this.rules[17]={name:"Modifier",lower:"modifier",index:17,isBkr:!1},this.rules[18]={name:"Predicate",lower:"predicate",index:18,isBkr:!1},this.rules[19]={name:"BasicElement",lower:"basicelement",index:19,isBkr:!1},this.rules[20]={name:"BasicElementErr",lower:"basicelementerr",index:20,isBkr:!1},this.rules[21]={name:"Group",lower:"group",index:21,isBkr:!1},this.rules[22]={name:"GroupError",lower:"grouperror",index:22,isBkr:!1},this.rules[23]={name:"GroupOpen",lower:"groupopen",index:23,isBkr:!1},this.rules[24]={name:"GroupClose",lower:"groupclose",index:24,isBkr:!1},this.rules[25]={name:"Option",lower:"option",index:25,isBkr:!1},this.rules[26]={name:"OptionError",lower:"optionerror",index:26,isBkr:!1},this.rules[27]={name:"OptionOpen",lower:"optionopen",index:27,isBkr:!1},this.rules[28]={name:"OptionClose",lower:"optionclose",index:28,isBkr:!1},this.rules[29]={name:"RnmOp",lower:"rnmop",index:29,isBkr:!1},this.rules[30]={name:"BkrOp",lower:"bkrop",index:30,isBkr:!1},this.rules[31]={name:"bkrModifier",lower:"bkrmodifier",index:31,isBkr:!1},this.rules[32]={name:"cs",lower:"cs",index:32,isBkr:!1},this.rules[33]={name:"ci",lower:"ci",index:33,isBkr:!1},this.rules[34]={name:"um",lower:"um",index:34,isBkr:!1},this.rules[35]={name:"pm",lower:"pm",index:35,isBkr:!1},this.rules[36]={name:"bkr-name",lower:"bkr-name",index:36,isBkr:!1},this.rules[37]={name:"rname",lower:"rname",index:37,isBkr:!1},this.rules[38]={name:"uname",lower:"uname",index:38,isBkr:!1},this.rules[39]={name:"ename",lower:"ename",index:39,isBkr:!1},this.rules[40]={name:"UdtOp",lower:"udtop",index:40,isBkr:!1},this.rules[41]={name:"udt-non-empty",lower:"udt-non-empty",index:41,isBkr:!1},this.rules[42]={name:"udt-empty",lower:"udt-empty",index:42,isBkr:!1},this.rules[43]={name:"RepOp",lower:"repop",index:43,isBkr:!1},this.rules[44]={name:"AltOp",lower:"altop",index:44,isBkr:!1},this.rules[45]={name:"CatOp",lower:"catop",index:45,isBkr:!1},this.rules[46]={name:"StarOp",lower:"starop",index:46,isBkr:!1},this.rules[47]={name:"AndOp",lower:"andop",index:47,isBkr:!1},this.rules[48]={name:"NotOp",lower:"notop",index:48,isBkr:!1},this.rules[49]={name:"BkaOp",lower:"bkaop",index:49,isBkr:!1},this.rules[50]={name:"BknOp",lower:"bknop",index:50,isBkr:!1},this.rules[51]={name:"AbgOp",lower:"abgop",index:51,isBkr:!1},this.rules[52]={name:"AenOp",lower:"aenop",index:52,isBkr:!1},this.rules[53]={name:"TrgOp",lower:"trgop",index:53,isBkr:!1},this.rules[54]={name:"TbsOp",lower:"tbsop",index:54,isBkr:!1},this.rules[55]={name:"TlsOp",lower:"tlsop",index:55,isBkr:!1},this.rules[56]={name:"TlsCase",lower:"tlscase",index:56,isBkr:!1},this.rules[57]={name:"TlsOpen",lower:"tlsopen",index:57,isBkr:!1},this.rules[58]={name:"TlsClose",lower:"tlsclose",index:58,isBkr:!1},this.rules[59]={name:"TlsString",lower:"tlsstring",index:59,isBkr:!1},this.rules[60]={name:"StringTab",lower:"stringtab",index:60,isBkr:!1},this.rules[61]={name:"ClsOp",lower:"clsop",index:61,isBkr:!1},this.rules[62]={name:"ClsOpen",lower:"clsopen",index:62,isBkr:!1},this.rules[63]={name:"ClsClose",lower:"clsclose",index:63,isBkr:!1},this.rules[64]={name:"ClsString",lower:"clsstring",index:64,isBkr:!1},this.rules[65]={name:"ProsVal",lower:"prosval",index:65,isBkr:!1},this.rules[66]={name:"ProsValOpen",lower:"prosvalopen",index:66,isBkr:!1},this.rules[67]={name:"ProsValString",lower:"prosvalstring",index:67,isBkr:!1},this.rules[68]={name:"ProsValClose",lower:"prosvalclose",index:68,isBkr:!1},this.rules[69]={name:"rep-min",lower:"rep-min",index:69,isBkr:!1},this.rules[70]={name:"rep-min-max",lower:"rep-min-max",index:70,isBkr:!1},this.rules[71]={name:"rep-max",lower:"rep-max",index:71,isBkr:!1},this.rules[72]={name:"rep-num",lower:"rep-num",index:72,isBkr:!1},this.rules[73]={name:"dString",lower:"dstring",index:73,isBkr:!1},this.rules[74]={name:"xString",lower:"xstring",index:74,isBkr:!1},this.rules[75]={name:"bString",lower:"bstring",index:75,isBkr:!1},this.rules[76]={name:"Dec",lower:"dec",index:76,isBkr:!1},this.rules[77]={name:"Hex",lower:"hex",index:77,isBkr:!1},this.rules[78]={name:"Bin",lower:"bin",index:78,isBkr:!1},this.rules[79]={name:"dmin",lower:"dmin",index:79,isBkr:!1},this.rules[80]={name:"dmax",lower:"dmax",index:80,isBkr:!1},this.rules[81]={name:"bmin",lower:"bmin",index:81,isBkr:!1},this.rules[82]={name:"bmax",lower:"bmax",index:82,isBkr:!1},this.rules[83]={name:"xmin",lower:"xmin",index:83,isBkr:!1},this.rules[84]={name:"xmax",lower:"xmax",index:84,isBkr:!1},this.rules[85]={name:"dnum",lower:"dnum",index:85,isBkr:!1},this.rules[86]={name:"bnum",lower:"bnum",index:86,isBkr:!1},this.rules[87]={name:"xnum",lower:"xnum",index:87,isBkr:!1},this.rules[88]={name:"alphanum",lower:"alphanum",index:88,isBkr:!1},this.rules[89]={name:"owsp",lower:"owsp",index:89,isBkr:!1},this.rules[90]={name:"wsp",lower:"wsp",index:90,isBkr:!1},this.rules[91]={name:"space",lower:"space",index:91,isBkr:!1},this.rules[92]={name:"comment",lower:"comment",index:92,isBkr:!1},this.rules[93]={name:"LineEnd",lower:"lineend",index:93,isBkr:!1},this.rules[94]={name:"LineContinue",lower:"linecontinue",index:94,isBkr:!1},this.udts=[],this.rules[0].opcodes=[],this.rules[0].opcodes[0]={type:3,min:0,max:1/0},this.rules[0].opcodes[1]={type:1,children:[2,3,4]},this.rules[0].opcodes[2]={type:4,index:1},this.rules[0].opcodes[3]={type:4,index:2},this.rules[0].opcodes[4]={type:4,index:12},this.rules[1].opcodes=[],this.rules[1].opcodes[0]={type:2,children:[1,5,7]},this.rules[1].opcodes[1]={type:3,min:0,max:1/0},this.rules[1].opcodes[2]={type:1,children:[3,4]},this.rules[1].opcodes[3]={type:6,string:[32]},this.rules[1].opcodes[4]={type:6,string:[9]},this.rules[1].opcodes[5]={type:3,min:0,max:1},this.rules[1].opcodes[6]={type:4,index:92},this.rules[1].opcodes[7]={type:4,index:93},this.rules[2].opcodes=[],this.rules[2].opcodes[0]={type:2,children:[1,2,3,4]},this.rules[2].opcodes[1]={type:4,index:3},this.rules[2].opcodes[2]={type:4,index:89},this.rules[2].opcodes[3]={type:4,index:14},this.rules[2].opcodes[4]={type:1,children:[5,8]},this.rules[2].opcodes[5]={type:2,children:[6,7]},this.rules[2].opcodes[6]={type:4,index:89},this.rules[2].opcodes[7]={type:4,index:93},this.rules[2].opcodes[8]={type:2,children:[9,10]},this.rules[2].opcodes[9]={type:4,index:13},this.rules[2].opcodes[10]={type:4,index:93},this.rules[3].opcodes=[],this.rules[3].opcodes[0]={type:2,children:[1,2,3]},this.rules[3].opcodes[1]={type:4,index:4},this.rules[3].opcodes[2]={type:4,index:89},this.rules[3].opcodes[3]={type:4,index:7},this.rules[4].opcodes=[],this.rules[4].opcodes[0]={type:1,children:[1,2]},this.rules[4].opcodes[1]={type:4,index:5},this.rules[4].opcodes[2]={type:4,index:6},this.rules[5].opcodes=[],this.rules[5].opcodes[0]={type:4,index:88},this.rules[6].opcodes=[],this.rules[6].opcodes[0]={type:3,min:1,max:1/0},this.rules[6].opcodes[1]={type:1,children:[2,3]},this.rules[6].opcodes[2]={type:5,min:33,max:60},this.rules[6].opcodes[3]={type:5,min:62,max:126},this.rules[7].opcodes=[],this.rules[7].opcodes[0]={type:1,children:[1,2]},this.rules[7].opcodes[1]={type:4,index:9},this.rules[7].opcodes[2]={type:4,index:8},this.rules[8].opcodes=[],this.rules[8].opcodes[0]={type:3,min:1,max:2},this.rules[8].opcodes[1]={type:5,min:33,max:126},this.rules[9].opcodes=[],this.rules[9].opcodes[0]={type:1,children:[1,2]},this.rules[9].opcodes[1]={type:4,index:11},this.rules[9].opcodes[2]={type:4,index:10},this.rules[10].opcodes=[],this.rules[10].opcodes[0]={type:6,string:[61]},this.rules[11].opcodes=[],this.rules[11].opcodes[0]={type:6,string:[61,47]},this.rules[12].opcodes=[],this.rules[12].opcodes[0]={type:2,children:[1,6]},this.rules[12].opcodes[1]={type:3,min:1,max:1/0},this.rules[12].opcodes[2]={type:1,children:[3,4,5]},this.rules[12].opcodes[3]={type:5,min:32,max:126},this.rules[12].opcodes[4]={type:6,string:[9]},this.rules[12].opcodes[5]={type:4,index:94},this.rules[12].opcodes[6]={type:4,index:93},this.rules[13].opcodes=[],this.rules[13].opcodes[0]={type:3,min:1,max:1/0},this.rules[13].opcodes[1]={type:1,children:[2,3,4]},this.rules[13].opcodes[2]={type:5,min:32,max:126},this.rules[13].opcodes[3]={type:6,string:[9]},this.rules[13].opcodes[4]={type:4,index:94},this.rules[14].opcodes=[],this.rules[14].opcodes[0]={type:2,children:[1,2]},this.rules[14].opcodes[1]={type:4,index:15},this.rules[14].opcodes[2]={type:3,min:0,max:1/0},this.rules[14].opcodes[3]={type:2,children:[4,5,6]},this.rules[14].opcodes[4]={type:4,index:89},this.rules[14].opcodes[5]={type:4,index:44},this.rules[14].opcodes[6]={type:4,index:15},this.rules[15].opcodes=[],this.rules[15].opcodes[0]={type:2,children:[1,2]},this.rules[15].opcodes[1]={type:4,index:16},this.rules[15].opcodes[2]={type:3,min:0,max:1/0},this.rules[15].opcodes[3]={type:2,children:[4,5]},this.rules[15].opcodes[4]={type:4,index:45},this.rules[15].opcodes[5]={type:4,index:16},this.rules[16].opcodes=[],this.rules[16].opcodes[0]={type:2,children:[1,3]},this.rules[16].opcodes[1]={type:3,min:0,max:1},this.rules[16].opcodes[2]={type:4,index:17},this.rules[16].opcodes[3]={type:1,children:[4,5,6,7]},this.rules[16].opcodes[4]={type:4,index:21},this.rules[16].opcodes[5]={type:4,index:25},this.rules[16].opcodes[6]={type:4,index:19},this.rules[16].opcodes[7]={type:4,index:20},this.rules[17].opcodes=[],this.rules[17].opcodes[0]={type:1,children:[1,5]},this.rules[17].opcodes[1]={type:2,children:[2,3]},this.rules[17].opcodes[2]={type:4,index:18},this.rules[17].opcodes[3]={type:3,min:0,max:1},this.rules[17].opcodes[4]={type:4,index:43},this.rules[17].opcodes[5]={type:4,index:43},this.rules[18].opcodes=[],this.rules[18].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[18].opcodes[1]={type:4,index:49},this.rules[18].opcodes[2]={type:4,index:50},this.rules[18].opcodes[3]={type:4,index:47},this.rules[18].opcodes[4]={type:4,index:48},this.rules[19].opcodes=[],this.rules[19].opcodes[0]={type:1,children:[1,2,3,4,5,6,7,8,9,10]},this.rules[19].opcodes[1]={type:4,index:40},this.rules[19].opcodes[2]={type:4,index:29},this.rules[19].opcodes[3]={type:4,index:53},this.rules[19].opcodes[4]={type:4,index:54},this.rules[19].opcodes[5]={type:4,index:55},this.rules[19].opcodes[6]={type:4,index:61},this.rules[19].opcodes[7]={type:4,index:30},this.rules[19].opcodes[8]={type:4,index:51},this.rules[19].opcodes[9]={type:4,index:52},this.rules[19].opcodes[10]={type:4,index:65},this.rules[20].opcodes=[],this.rules[20].opcodes[0]={type:3,min:1,max:1/0},this.rules[20].opcodes[1]={type:1,children:[2,3,4,5]},this.rules[20].opcodes[2]={type:5,min:33,max:40},this.rules[20].opcodes[3]={type:5,min:42,max:46},this.rules[20].opcodes[4]={type:5,min:48,max:92},this.rules[20].opcodes[5]={type:5,min:94,max:126},this.rules[21].opcodes=[],this.rules[21].opcodes[0]={type:2,children:[1,2,3]},this.rules[21].opcodes[1]={type:4,index:23},this.rules[21].opcodes[2]={type:4,index:14},this.rules[21].opcodes[3]={type:1,children:[4,5]},this.rules[21].opcodes[4]={type:4,index:24},this.rules[21].opcodes[5]={type:4,index:22},this.rules[22].opcodes=[],this.rules[22].opcodes[0]={type:3,min:1,max:1/0},this.rules[22].opcodes[1]={type:1,children:[2,3,4,5]},this.rules[22].opcodes[2]={type:5,min:33,max:40},this.rules[22].opcodes[3]={type:5,min:42,max:46},this.rules[22].opcodes[4]={type:5,min:48,max:92},this.rules[22].opcodes[5]={type:5,min:94,max:126},this.rules[23].opcodes=[],this.rules[23].opcodes[0]={type:2,children:[1,2]},this.rules[23].opcodes[1]={type:6,string:[40]},this.rules[23].opcodes[2]={type:4,index:89},this.rules[24].opcodes=[],this.rules[24].opcodes[0]={type:2,children:[1,2]},this.rules[24].opcodes[1]={type:4,index:89},this.rules[24].opcodes[2]={type:6,string:[41]},this.rules[25].opcodes=[],this.rules[25].opcodes[0]={type:2,children:[1,2,3]},this.rules[25].opcodes[1]={type:4,index:27},this.rules[25].opcodes[2]={type:4,index:14},this.rules[25].opcodes[3]={type:1,children:[4,5]},this.rules[25].opcodes[4]={type:4,index:28},this.rules[25].opcodes[5]={type:4,index:26},this.rules[26].opcodes=[],this.rules[26].opcodes[0]={type:3,min:1,max:1/0},this.rules[26].opcodes[1]={type:1,children:[2,3,4,5]},this.rules[26].opcodes[2]={type:5,min:33,max:40},this.rules[26].opcodes[3]={type:5,min:42,max:46},this.rules[26].opcodes[4]={type:5,min:48,max:92},this.rules[26].opcodes[5]={type:5,min:94,max:126},this.rules[27].opcodes=[],this.rules[27].opcodes[0]={type:2,children:[1,2]},this.rules[27].opcodes[1]={type:6,string:[91]},this.rules[27].opcodes[2]={type:4,index:89},this.rules[28].opcodes=[],this.rules[28].opcodes[0]={type:2,children:[1,2]},this.rules[28].opcodes[1]={type:4,index:89},this.rules[28].opcodes[2]={type:6,string:[93]},this.rules[29].opcodes=[],this.rules[29].opcodes[0]={type:4,index:88},this.rules[30].opcodes=[],this.rules[30].opcodes[0]={type:2,children:[1,2,4]},this.rules[30].opcodes[1]={type:6,string:[92]},this.rules[30].opcodes[2]={type:3,min:0,max:1},this.rules[30].opcodes[3]={type:4,index:31},this.rules[30].opcodes[4]={type:4,index:36},this.rules[31].opcodes=[],this.rules[31].opcodes[0]={type:1,children:[1,7,13,19]},this.rules[31].opcodes[1]={type:2,children:[2,3]},this.rules[31].opcodes[2]={type:4,index:32},this.rules[31].opcodes[3]={type:3,min:0,max:1},this.rules[31].opcodes[4]={type:1,children:[5,6]},this.rules[31].opcodes[5]={type:4,index:34},this.rules[31].opcodes[6]={type:4,index:35},this.rules[31].opcodes[7]={type:2,children:[8,9]},this.rules[31].opcodes[8]={type:4,index:33},this.rules[31].opcodes[9]={type:3,min:0,max:1},this.rules[31].opcodes[10]={type:1,children:[11,12]},this.rules[31].opcodes[11]={type:4,index:34},this.rules[31].opcodes[12]={type:4,index:35},this.rules[31].opcodes[13]={type:2,children:[14,15]},this.rules[31].opcodes[14]={type:4,index:34},this.rules[31].opcodes[15]={type:3,min:0,max:1},this.rules[31].opcodes[16]={type:1,children:[17,18]},this.rules[31].opcodes[17]={type:4,index:32},this.rules[31].opcodes[18]={type:4,index:33},this.rules[31].opcodes[19]={type:2,children:[20,21]},this.rules[31].opcodes[20]={type:4,index:35},this.rules[31].opcodes[21]={type:3,min:0,max:1},this.rules[31].opcodes[22]={type:1,children:[23,24]},this.rules[31].opcodes[23]={type:4,index:32},this.rules[31].opcodes[24]={type:4,index:33},this.rules[32].opcodes=[],this.rules[32].opcodes[0]={type:6,string:[37,115]},this.rules[33].opcodes=[],this.rules[33].opcodes[0]={type:6,string:[37,105]},this.rules[34].opcodes=[],this.rules[34].opcodes[0]={type:6,string:[37,117]},this.rules[35].opcodes=[],this.rules[35].opcodes[0]={type:6,string:[37,112]},this.rules[36].opcodes=[],this.rules[36].opcodes[0]={type:1,children:[1,2,3]},this.rules[36].opcodes[1]={type:4,index:38},this.rules[36].opcodes[2]={type:4,index:39},this.rules[36].opcodes[3]={type:4,index:37},this.rules[37].opcodes=[],this.rules[37].opcodes[0]={type:4,index:88},this.rules[38].opcodes=[],this.rules[38].opcodes[0]={type:2,children:[1,2]},this.rules[38].opcodes[1]={type:6,string:[117,95]},this.rules[38].opcodes[2]={type:4,index:88},this.rules[39].opcodes=[],this.rules[39].opcodes[0]={type:2,children:[1,2]},this.rules[39].opcodes[1]={type:6,string:[101,95]},this.rules[39].opcodes[2]={type:4,index:88},this.rules[40].opcodes=[],this.rules[40].opcodes[0]={type:1,children:[1,2]},this.rules[40].opcodes[1]={type:4,index:42},this.rules[40].opcodes[2]={type:4,index:41},this.rules[41].opcodes=[],this.rules[41].opcodes[0]={type:2,children:[1,2]},this.rules[41].opcodes[1]={type:6,string:[117,95]},this.rules[41].opcodes[2]={type:4,index:88},this.rules[42].opcodes=[],this.rules[42].opcodes[0]={type:2,children:[1,2]},this.rules[42].opcodes[1]={type:6,string:[101,95]},this.rules[42].opcodes[2]={type:4,index:88},this.rules[43].opcodes=[],this.rules[43].opcodes[0]={type:1,children:[1,5,8,11,12]},this.rules[43].opcodes[1]={type:2,children:[2,3,4]},this.rules[43].opcodes[2]={type:4,index:69},this.rules[43].opcodes[3]={type:4,index:46},this.rules[43].opcodes[4]={type:4,index:71},this.rules[43].opcodes[5]={type:2,children:[6,7]},this.rules[43].opcodes[6]={type:4,index:69},this.rules[43].opcodes[7]={type:4,index:46},this.rules[43].opcodes[8]={type:2,children:[9,10]},this.rules[43].opcodes[9]={type:4,index:46},this.rules[43].opcodes[10]={type:4,index:71},this.rules[43].opcodes[11]={type:4,index:46},this.rules[43].opcodes[12]={type:4,index:70},this.rules[44].opcodes=[],this.rules[44].opcodes[0]={type:2,children:[1,2]},this.rules[44].opcodes[1]={type:6,string:[47]},this.rules[44].opcodes[2]={type:4,index:89},this.rules[45].opcodes=[],this.rules[45].opcodes[0]={type:4,index:90},this.rules[46].opcodes=[],this.rules[46].opcodes[0]={type:6,string:[42]},this.rules[47].opcodes=[],this.rules[47].opcodes[0]={type:6,string:[38]},this.rules[48].opcodes=[],this.rules[48].opcodes[0]={type:6,string:[33]},this.rules[49].opcodes=[],this.rules[49].opcodes[0]={type:6,string:[38,38]},this.rules[50].opcodes=[],this.rules[50].opcodes[0]={type:6,string:[33,33]},this.rules[51].opcodes=[],this.rules[51].opcodes[0]={type:6,string:[37,94]},this.rules[52].opcodes=[],this.rules[52].opcodes[0]={type:6,string:[37,36]},this.rules[53].opcodes=[],this.rules[53].opcodes[0]={type:2,children:[1,2]},this.rules[53].opcodes[1]={type:6,string:[37]},this.rules[53].opcodes[2]={type:1,children:[3,8,13]},this.rules[53].opcodes[3]={type:2,children:[4,5,6,7]},this.rules[53].opcodes[4]={type:4,index:76},this.rules[53].opcodes[5]={type:4,index:79},this.rules[53].opcodes[6]={type:6,string:[45]},this.rules[53].opcodes[7]={type:4,index:80},this.rules[53].opcodes[8]={type:2,children:[9,10,11,12]},this.rules[53].opcodes[9]={type:4,index:77},this.rules[53].opcodes[10]={type:4,index:83},this.rules[53].opcodes[11]={type:6,string:[45]},this.rules[53].opcodes[12]={type:4,index:84},this.rules[53].opcodes[13]={type:2,children:[14,15,16,17]},this.rules[53].opcodes[14]={type:4,index:78},this.rules[53].opcodes[15]={type:4,index:81},this.rules[53].opcodes[16]={type:6,string:[45]},this.rules[53].opcodes[17]={type:4,index:82},this.rules[54].opcodes=[],this.rules[54].opcodes[0]={type:2,children:[1,2]},this.rules[54].opcodes[1]={type:6,string:[37]},this.rules[54].opcodes[2]={type:1,children:[3,10,17]},this.rules[54].opcodes[3]={type:2,children:[4,5,6]},this.rules[54].opcodes[4]={type:4,index:76},this.rules[54].opcodes[5]={type:4,index:73},this.rules[54].opcodes[6]={type:3,min:0,max:1/0},this.rules[54].opcodes[7]={type:2,children:[8,9]},this.rules[54].opcodes[8]={type:6,string:[46]},this.rules[54].opcodes[9]={type:4,index:73},this.rules[54].opcodes[10]={type:2,children:[11,12,13]},this.rules[54].opcodes[11]={type:4,index:77},this.rules[54].opcodes[12]={type:4,index:74},this.rules[54].opcodes[13]={type:3,min:0,max:1/0},this.rules[54].opcodes[14]={type:2,children:[15,16]},this.rules[54].opcodes[15]={type:6,string:[46]},this.rules[54].opcodes[16]={type:4,index:74},this.rules[54].opcodes[17]={type:2,children:[18,19,20]},this.rules[54].opcodes[18]={type:4,index:78},this.rules[54].opcodes[19]={type:4,index:75},this.rules[54].opcodes[20]={type:3,min:0,max:1/0},this.rules[54].opcodes[21]={type:2,children:[22,23]},this.rules[54].opcodes[22]={type:6,string:[46]},this.rules[54].opcodes[23]={type:4,index:75},this.rules[55].opcodes=[],this.rules[55].opcodes[0]={type:2,children:[1,2,3,4]},this.rules[55].opcodes[1]={type:4,index:56},this.rules[55].opcodes[2]={type:4,index:57},this.rules[55].opcodes[3]={type:4,index:59},this.rules[55].opcodes[4]={type:4,index:58},this.rules[56].opcodes=[],this.rules[56].opcodes[0]={type:3,min:0,max:1},this.rules[56].opcodes[1]={type:1,children:[2,3]},this.rules[56].opcodes[2]={type:7,string:[37,105]},this.rules[56].opcodes[3]={type:7,string:[37,115]},this.rules[57].opcodes=[],this.rules[57].opcodes[0]={type:6,string:[34]},this.rules[58].opcodes=[],this.rules[58].opcodes[0]={type:6,string:[34]},this.rules[59].opcodes=[],this.rules[59].opcodes[0]={type:3,min:0,max:1/0},this.rules[59].opcodes[1]={type:1,children:[2,3,4]},this.rules[59].opcodes[2]={type:5,min:32,max:33},this.rules[59].opcodes[3]={type:5,min:35,max:126},this.rules[59].opcodes[4]={type:4,index:60},this.rules[60].opcodes=[],this.rules[60].opcodes[0]={type:6,string:[9]},this.rules[61].opcodes=[],this.rules[61].opcodes[0]={type:2,children:[1,2,3]},this.rules[61].opcodes[1]={type:4,index:62},this.rules[61].opcodes[2]={type:4,index:64},this.rules[61].opcodes[3]={type:4,index:63},this.rules[62].opcodes=[],this.rules[62].opcodes[0]={type:6,string:[39]},this.rules[63].opcodes=[],this.rules[63].opcodes[0]={type:6,string:[39]},this.rules[64].opcodes=[],this.rules[64].opcodes[0]={type:3,min:0,max:1/0},this.rules[64].opcodes[1]={type:1,children:[2,3,4]},this.rules[64].opcodes[2]={type:5,min:32,max:38},this.rules[64].opcodes[3]={type:5,min:40,max:126},this.rules[64].opcodes[4]={type:4,index:60},this.rules[65].opcodes=[],this.rules[65].opcodes[0]={type:2,children:[1,2,3]},this.rules[65].opcodes[1]={type:4,index:66},this.rules[65].opcodes[2]={type:4,index:67},this.rules[65].opcodes[3]={type:4,index:68},this.rules[66].opcodes=[],this.rules[66].opcodes[0]={type:6,string:[60]},this.rules[67].opcodes=[],this.rules[67].opcodes[0]={type:3,min:0,max:1/0},this.rules[67].opcodes[1]={type:1,children:[2,3,4]},this.rules[67].opcodes[2]={type:5,min:32,max:61},this.rules[67].opcodes[3]={type:5,min:63,max:126},this.rules[67].opcodes[4]={type:4,index:60},this.rules[68].opcodes=[],this.rules[68].opcodes[0]={type:6,string:[62]},this.rules[69].opcodes=[],this.rules[69].opcodes[0]={type:4,index:72},this.rules[70].opcodes=[],this.rules[70].opcodes[0]={type:4,index:72},this.rules[71].opcodes=[],this.rules[71].opcodes[0]={type:4,index:72},this.rules[72].opcodes=[],this.rules[72].opcodes[0]={type:3,min:1,max:1/0},this.rules[72].opcodes[1]={type:5,min:48,max:57},this.rules[73].opcodes=[],this.rules[73].opcodes[0]={type:4,index:85},this.rules[74].opcodes=[],this.rules[74].opcodes[0]={type:4,index:87},this.rules[75].opcodes=[],this.rules[75].opcodes[0]={type:4,index:86},this.rules[76].opcodes=[],this.rules[76].opcodes[0]={type:1,children:[1,2]},this.rules[76].opcodes[1]={type:6,string:[68]},this.rules[76].opcodes[2]={type:6,string:[100]},this.rules[77].opcodes=[],this.rules[77].opcodes[0]={type:1,children:[1,2]},this.rules[77].opcodes[1]={type:6,string:[88]},this.rules[77].opcodes[2]={type:6,string:[120]},this.rules[78].opcodes=[],this.rules[78].opcodes[0]={type:1,children:[1,2]},this.rules[78].opcodes[1]={type:6,string:[66]},this.rules[78].opcodes[2]={type:6,string:[98]},this.rules[79].opcodes=[],this.rules[79].opcodes[0]={type:4,index:85},this.rules[80].opcodes=[],this.rules[80].opcodes[0]={type:4,index:85},this.rules[81].opcodes=[],this.rules[81].opcodes[0]={type:4,index:86},this.rules[82].opcodes=[],this.rules[82].opcodes[0]={type:4,index:86},this.rules[83].opcodes=[],this.rules[83].opcodes[0]={type:4,index:87},this.rules[84].opcodes=[],this.rules[84].opcodes[0]={type:4,index:87},this.rules[85].opcodes=[],this.rules[85].opcodes[0]={type:3,min:1,max:1/0},this.rules[85].opcodes[1]={type:5,min:48,max:57},this.rules[86].opcodes=[],this.rules[86].opcodes[0]={type:3,min:1,max:1/0},this.rules[86].opcodes[1]={type:5,min:48,max:49},this.rules[87].opcodes=[],this.rules[87].opcodes[0]={type:3,min:1,max:1/0},this.rules[87].opcodes[1]={type:1,children:[2,3,4]},this.rules[87].opcodes[2]={type:5,min:48,max:57},this.rules[87].opcodes[3]={type:5,min:65,max:70},this.rules[87].opcodes[4]={type:5,min:97,max:102},this.rules[88].opcodes=[],this.rules[88].opcodes[0]={type:2,children:[1,4]},this.rules[88].opcodes[1]={type:1,children:[2,3]},this.rules[88].opcodes[2]={type:5,min:97,max:122},this.rules[88].opcodes[3]={type:5,min:65,max:90},this.rules[88].opcodes[4]={type:3,min:0,max:1/0},this.rules[88].opcodes[5]={type:1,children:[6,7,8,9]},this.rules[88].opcodes[6]={type:5,min:97,max:122},this.rules[88].opcodes[7]={type:5,min:65,max:90},this.rules[88].opcodes[8]={type:5,min:48,max:57},this.rules[88].opcodes[9]={type:6,string:[45]},this.rules[89].opcodes=[],this.rules[89].opcodes[0]={type:3,min:0,max:1/0},this.rules[89].opcodes[1]={type:4,index:91},this.rules[90].opcodes=[],this.rules[90].opcodes[0]={type:3,min:1,max:1/0},this.rules[90].opcodes[1]={type:4,index:91},this.rules[91].opcodes=[],this.rules[91].opcodes[0]={type:1,children:[1,2,3,4]},this.rules[91].opcodes[1]={type:6,string:[32]},this.rules[91].opcodes[2]={type:6,string:[9]},this.rules[91].opcodes[3]={type:4,index:92},this.rules[91].opcodes[4]={type:4,index:94},this.rules[92].opcodes=[],this.rules[92].opcodes[0]={type:2,children:[1,2]},this.rules[92].opcodes[1]={type:6,string:[59]},this.rules[92].opcodes[2]={type:3,min:0,max:1/0},this.rules[92].opcodes[3]={type:1,children:[4,5]},this.rules[92].opcodes[4]={type:5,min:32,max:126},this.rules[92].opcodes[5]={type:6,string:[9]},this.rules[93].opcodes=[],this.rules[93].opcodes[0]={type:1,children:[1,2,3]},this.rules[93].opcodes[1]={type:6,string:[13,10]},this.rules[93].opcodes[2]={type:6,string:[10]},this.rules[93].opcodes[3]={type:6,string:[13]},this.rules[94].opcodes=[],this.rules[94].opcodes[0]={type:2,children:[1,5]},this.rules[94].opcodes[1]={type:1,children:[2,3,4]},this.rules[94].opcodes[2]={type:6,string:[13,10]},this.rules[94].opcodes[3]={type:6,string:[10]},this.rules[94].opcodes[4]={type:6,string:[13]},this.rules[94].opcodes[5]={type:1,children:[6,7]},this.rules[94].opcodes[6]={type:6,string:[32]},this.rules[94].opcodes[7]={type:6,string:[9]},this.toString=I((function(){let e="";return e+=";\n",e+="; ABNF for JavaScript APG 2.0 SABNF\n",e+="; RFC 5234 with some restrictions and additions.\n",e+="; Updated 11/24/2015 for RFC 7405 case-sensitive literal string notation\n",e+='; - accepts %s"string" as a case-sensitive string\n',e+='; - accepts %i"string" as a case-insensitive string\n',e+='; - accepts "string" as a case-insensitive string\n',e+=";\n",e+="; Some restrictions:\n",e+="; 1. Rules must begin at first character of each line.\n",e+="; Indentations on first rule and rules thereafter are not allowed.\n",e+="; 2. Relaxed line endings. CRLF, LF or CR are accepted as valid line ending.\n",e+="; 3. Prose values, i.e. <prose value>, are accepted as valid grammar syntax.\n",e+="; However, a working parser cannot be generated from them.\n",e+=";\n",e+="; Super set (SABNF) additions:\n",e+="; 1. Look-ahead (syntactic predicate) operators are accepted as element prefixes.\n",e+="; & is the positive look-ahead operator, succeeds and backtracks if the look-ahead phrase is found\n",e+="; ! is the negative look-ahead operator, succeeds and backtracks if the look-ahead phrase is NOT found\n",e+="; e.g. &%d13 or &rule or !(A / B)\n",e+="; 2. User-Defined Terminals (UDT) of the form, u_name and e_name are accepted.\n",e+="; 'name' is alpha followed by alpha/num/hyphen just like a rule name.\n",e+="; u_name may be used as an element but no rule definition is given.\n",e+="; e.g. rule = A / u_myUdt\n",e+='; A = "a"\n',e+="; would be a valid grammar.\n",e+="; 3. Case-sensitive, single-quoted strings are accepted.\n",e+="; e.g. 'abc' would be equivalent to %d97.98.99\n",e+='; (kept for backward compatibility, but superseded by %s"abc") \n',e+="; New 12/26/2015\n",e+="; 4. Look-behind operators are accepted as element prefixes.\n",e+="; && is the positive look-behind operator, succeeds and backtracks if the look-behind phrase is found\n",e+="; !! is the negative look-behind operator, succeeds and backtracks if the look-behind phrase is NOT found\n",e+="; e.g. &&%d13 or &&rule or !!(A / B)\n",e+="; 5. Back reference operators, i.e. \\rulename, are accepted.\n",e+="; A back reference operator acts like a TLS or TBS terminal except that the phrase it attempts\n",e+="; to match is a phrase previously matched by the rule 'rulename'.\n",e+="; There are two modes of previous phrase matching - the parent-frame mode and the universal mode.\n",e+="; In universal mode, \\rulename matches the last match to 'rulename' regardless of where it was found.\n",e+="; In parent-frame mode, \\rulename matches only the last match found on the parent's frame or parse tree level.\n",e+="; Back reference modifiers can be used to specify case and mode.\n",e+="; \\A defaults to case-insensitive and universal mode, e.g. \\A === \\%i%uA\n",e+="; Modifiers %i and %s determine case-insensitive and case-sensitive mode, respectively.\n",e+="; Modifiers %u and %p determine universal mode and parent frame mode, respectively.\n",e+="; Case and mode modifiers can appear in any order, e.g. \\%s%pA === \\%p%sA. \n",e+="; 7. String begin anchor, ABG(%^) matches the beginning of the input string location.\n",e+="; Returns EMPTY or NOMATCH. Never consumes any characters.\n",e+="; 8. String end anchor, AEN(%$) matches the end of the input string location.\n",e+="; Returns EMPTY or NOMATCH. Never consumes any characters.\n",e+=";\n",e+="File = *(BlankLine / Rule / RuleError)\n",e+="BlankLine = *(%d32/%d9) [comment] LineEnd\n",e+="Rule = RuleLookup owsp Alternation ((owsp LineEnd)\n",e+=" / (LineEndError LineEnd))\n",e+="RuleLookup = RuleNameTest owsp DefinedAsTest\n",e+="RuleNameTest = RuleName/RuleNameError\n",e+="RuleName = alphanum\n",e+="RuleNameError = 1*(%d33-60/%d62-126)\n",e+="DefinedAsTest = DefinedAs / DefinedAsError\n",e+="DefinedAsError = 1*2%d33-126\n",e+="DefinedAs = IncAlt / Defined\n",e+="Defined = %d61\n",e+="IncAlt = %d61.47\n",e+="RuleError = 1*(%d32-126 / %d9 / LineContinue) LineEnd\n",e+="LineEndError = 1*(%d32-126 / %d9 / LineContinue)\n",e+="Alternation = Concatenation *(owsp AltOp Concatenation)\n",e+="Concatenation = Repetition *(CatOp Repetition)\n",e+="Repetition = [Modifier] (Group / Option / BasicElement / BasicElementErr)\n",e+="Modifier = (Predicate [RepOp])\n",e+=" / RepOp\n",e+="Predicate = BkaOp\n",e+=" / BknOp\n",e+=" / AndOp\n",e+=" / NotOp\n",e+="BasicElement = UdtOp\n",e+=" / RnmOp\n",e+=" / TrgOp\n",e+=" / TbsOp\n",e+=" / TlsOp\n",e+=" / ClsOp\n",e+=" / BkrOp\n",e+=" / AbgOp\n",e+=" / AenOp\n",e+=" / ProsVal\n",e+="BasicElementErr = 1*(%d33-40/%d42-46/%d48-92/%d94-126)\n",e+="Group = GroupOpen Alternation (GroupClose / GroupError)\n",e+="GroupError = 1*(%d33-40/%d42-46/%d48-92/%d94-126) ; same as BasicElementErr\n",e+="GroupOpen = %d40 owsp\n",e+="GroupClose = owsp %d41\n",e+="Option = OptionOpen Alternation (OptionClose / OptionError)\n",e+="OptionError = 1*(%d33-40/%d42-46/%d48-92/%d94-126) ; same as BasicElementErr\n",e+="OptionOpen = %d91 owsp\n",e+="OptionClose = owsp %d93\n",e+="RnmOp = alphanum\n",e+="BkrOp = %d92 [bkrModifier] bkr-name\n",e+="bkrModifier = (cs [um / pm]) / (ci [um / pm]) / (um [cs /ci]) / (pm [cs / ci])\n",e+="cs = '%s'\n",e+="ci = '%i'\n",e+="um = '%u'\n",e+="pm = '%p'\n",e+="bkr-name = uname / ename / rname\n",e+="rname = alphanum\n",e+="uname = %d117.95 alphanum\n",e+="ename = %d101.95 alphanum\n",e+="UdtOp = udt-empty\n",e+=" / udt-non-empty\n",e+="udt-non-empty = %d117.95 alphanum\n",e+="udt-empty = %d101.95 alphanum\n",e+="RepOp = (rep-min StarOp rep-max)\n",e+=" / (rep-min StarOp)\n",e+=" / (StarOp rep-max)\n",e+=" / StarOp\n",e+=" / rep-min-max\n",e+="AltOp = %d47 owsp\n",e+="CatOp = wsp\n",e+="StarOp = %d42\n",e+="AndOp = %d38\n",e+="NotOp = %d33\n",e+="BkaOp = %d38.38\n",e+="BknOp = %d33.33\n",e+="AbgOp = %d37.94\n",e+="AenOp = %d37.36\n",e+="TrgOp = %d37 ((Dec dmin %d45 dmax) / (Hex xmin %d45 xmax) / (Bin bmin %d45 bmax))\n",e+="TbsOp = %d37 ((Dec dString *(%d46 dString)) / (Hex xString *(%d46 xString)) / (Bin bString *(%d46 bString)))\n",e+="TlsOp = TlsCase TlsOpen TlsString TlsClose\n",e+='TlsCase = ["%i" / "%s"]\n',e+="TlsOpen = %d34\n",e+="TlsClose = %d34\n",e+="TlsString = *(%d32-33/%d35-126/StringTab)\n",e+="StringTab = %d9\n",e+="ClsOp = ClsOpen ClsString ClsClose\n",e+="ClsOpen = %d39\n",e+="ClsClose = %d39\n",e+="ClsString = *(%d32-38/%d40-126/StringTab)\n",e+="ProsVal = ProsValOpen ProsValString ProsValClose\n",e+="ProsValOpen = %d60\n",e+="ProsValString = *(%d32-61/%d63-126/StringTab)\n",e+="ProsValClose = %d62\n",e+="rep-min = rep-num\n",e+="rep-min-max = rep-num\n",e+="rep-max = rep-num\n",e+="rep-num = 1*(%d48-57)\n",e+="dString = dnum\n",e+="xString = xnum\n",e+="bString = bnum\n",e+="Dec = (%d68/%d100)\n",e+="Hex = (%d88/%d120)\n",e+="Bin = (%d66/%d98)\n",e+="dmin = dnum\n",e+="dmax = dnum\n",e+="bmin = bnum\n",e+="bmax = bnum\n",e+="xmin = xnum\n",e+="xmax = xnum\n",e+="dnum = 1*(%d48-57)\n",e+="bnum = 1*%d48-49\n",e+="xnum = 1*(%d48-57 / %d65-70 / %d97-102)\n",e+=";\n",e+="; Basics\n",e+="alphanum = (%d97-122/%d65-90) *(%d97-122/%d65-90/%d48-57/%d45)\n",e+="owsp = *space\n",e+="wsp = 1*space\n",e+="space = %d32\n",e+=" / %d9\n",e+=" / comment\n",e+=" / LineContinue\n",e+="comment = %d59 *(%d32-126 / %d9)\n",e+="LineEnd = %d13.10\n",e+=" / %d10\n",e+=" / %d13\n",e+="LineContinue = (%d13.10 / %d10 / %d13) (%d32 / %d9)\n",";\n; ABNF for JavaScript APG 2.0 SABNF\n; RFC 5234 with some restrictions and additions.\n; Updated 11/24/2015 for RFC 7405 case-sensitive literal string notation\n; - accepts %s\"string\" as a case-sensitive string\n; - accepts %i\"string\" as a case-insensitive string\n; - accepts \"string\" as a case-insensitive string\n;\n; Some restrictions:\n; 1. Rules must begin at first character of each line.\n; Indentations on first rule and rules thereafter are not allowed.\n; 2. Relaxed line endings. CRLF, LF or CR are accepted as valid line ending.\n; 3. Prose values, i.e. <prose value>, are accepted as valid grammar syntax.\n; However, a working parser cannot be generated from them.\n;\n; Super set (SABNF) additions:\n; 1. Look-ahead (syntactic predicate) operators are accepted as element prefixes.\n; & is the positive look-ahead operator, succeeds and backtracks if the look-ahead phrase is found\n; ! is the negative look-ahead operator, succeeds and backtracks if the look-ahead phrase is NOT found\n; e.g. &%d13 or &rule or !(A / B)\n; 2. User-Defined Terminals (UDT) of the form, u_name and e_name are accepted.\n; 'name' is alpha followed by alpha/num/hyphen just like a rule name.\n; u_name may be used as an element but no rule definition is given.\n; e.g. rule = A / u_myUdt\n; A = \"a\"\n; would be a valid grammar.\n; 3. Case-sensitive, single-quoted strings are accepted.\n; e.g. 'abc' would be equivalent to %d97.98.99\n; (kept for backward compatibility, but superseded by %s\"abc\") \n; New 12/26/2015\n; 4. Look-behind operators are accepted as element prefixes.\n; && is the positive look-behind operator, succeeds and backtracks if the look-behind phrase is found\n; !! is the negative look-behind operator, succeeds and backtracks if the look-behind phrase is NOT found\n; e.g. &&%d13 or &&rule or !!(A / B)\n; 5. Back reference operators, i.e. \\rulename, are accepted.\n; A back reference operator acts like a TLS or TBS terminal except that the phrase it attempts\n; to match is a phrase previously matched by the rule 'rulename'.\n; There are two modes of previous phrase matching - the parent-frame mode and the universal mode.\n; In universal mode, \\rulename matches the last match to 'rulename' regardless of where it was found.\n; In parent-frame mode, \\rulename matches only the last match found on the parent's frame or parse tree level.\n; Back reference modifiers can be used to specify case and mode.\n; \\A defaults to case-insensitive and universal mode, e.g. \\A === \\%i%uA\n; Modifiers %i and %s determine case-insensitive and case-sensitive mode, respectively.\n; Modifiers %u and %p determine universal mode and parent frame mode, respectively.\n; Case and mode modifiers can appear in any order, e.g. \\%s%pA === \\%p%sA. \n; 7. String begin anchor, ABG(%^) matches the beginning of the input string location.\n; Returns EMPTY or NOMATCH. Never consumes any characters.\n; 8. String end anchor, AEN(%$) matches the end of the input string location.\n; Returns EMPTY or NOMATCH. Never consumes any characters.\n;\nFile = *(BlankLine / Rule / RuleError)\nBlankLine = *(%d32/%d9) [comment] LineEnd\nRule = RuleLookup owsp Alternation ((owsp LineEnd)\n / (LineEndError LineEnd))\nRuleLookup = RuleNameTest owsp DefinedAsTest\nRuleNameTest = RuleName/RuleNameError\nRuleName = alphanum\nRuleNameError = 1*(%d33-60/%d62-126)\nDefinedAsTest = DefinedAs / DefinedAsError\nDefinedAsError = 1*2%d33-126\nDefinedAs = IncAlt / Defined\nDefined = %d61\nIncAlt = %d61.47\nRuleError = 1*(%d32-126 / %d9 / LineContinue) LineEnd\nLineEndError = 1*(%d32-126 / %d9 / LineContinue)\nAlternation = Concatenation *(owsp AltOp Concatenation)\nConcatenation = Repetition *(CatOp Repetition)\nRepetition = [Modifier] (Group / Option / BasicElement / BasicElementErr)\nModifier = (Predicate [RepOp])\n / RepOp\nPredicate = BkaOp\n / BknOp\n / AndOp\n / NotOp\nBasicElement = UdtOp\n / RnmOp\n / TrgOp\n / TbsOp\n / TlsOp\n / ClsOp\n / BkrOp\n / AbgOp\n / AenOp\n / ProsVal\nBasicElementErr = 1*(%d33-40/%d42-46/%d48-92/%d94-126)\nGroup = GroupOpen Alternation (GroupClose / GroupError)\nGroupError = 1*(%d33-40/%d42-46/%d48-92/%d94-126) ; same as BasicElementErr\nGroupOpen = %d40 owsp\nGroupClose = owsp %d41\nOption = OptionOpen Alternation (OptionClose / OptionError)\nOptionError = 1*(%d33-40/%d42-46/%d48-92/%d94-126) ; same as BasicElementErr\nOptionOpen = %d91 owsp\nOptionClose = owsp %d93\nRnmOp = alphanum\nBkrOp = %d92 [bkrModifier] bkr-name\nbkrModifier = (cs [um / pm]) / (ci [um / pm]) / (um [cs /ci]) / (pm [cs / ci])\ncs = '%s'\nci = '%i'\num = '%u'\npm = '%p'\nbkr-name = uname / ename / rname\nrname = alphanum\nuname = %d117.95 alphanum\nename = %d101.95 alphanum\nUdtOp = udt-empty\n / udt-non-empty\nudt-non-empty = %d117.95 alphanum\nudt-empty = %d101.95 alphanum\nRepOp = (rep-min StarOp rep-max)\n / (rep-min StarOp)\n / (StarOp rep-max)\n / StarOp\n / rep-min-max\nAltOp = %d47 owsp\nCatOp = wsp\nStarOp = %d42\nAndOp = %d38\nNotOp = %d33\nBkaOp = %d38.38\nBknOp = %d33.33\nAbgOp = %d37.94\nAenOp = %d37.36\nTrgOp = %d37 ((Dec dmin %d45 dmax) / (Hex xmin %d45 xmax) / (Bin bmin %d45 bmax))\nTbsOp = %d37 ((Dec dString *(%d46 dString)) / (Hex xString *(%d46 xString)) / (Bin bString *(%d46 bString)))\nTlsOp = TlsCase TlsOpen TlsString TlsClose\nTlsCase = [\"%i\" / \"%s\"]\nTlsOpen = %d34\nTlsClose = %d34\nTlsString = *(%d32-33/%d35-126/StringTab)\nStringTab = %d9\nClsOp = ClsOpen ClsString ClsClose\nClsOpen = %d39\nClsClose = %d39\nClsString = *(%d32-38/%d40-126/StringTab)\nProsVal = ProsValOpen ProsValString ProsValClose\nProsValOpen = %d60\nProsValString = *(%d32-61/%d63-126/StringTab)\nProsValClose = %d62\nrep-min = rep-num\nrep-min-max = rep-num\nrep-max = rep-num\nrep-num = 1*(%d48-57)\ndString = dnum\nxString = xnum\nbString = bnum\nDec = (%d68/%d100)\nHex = (%d88/%d120)\nBin = (%d66/%d98)\ndmin = dnum\ndmax = dnum\nbmin = bnum\nbmax = bnum\nxmin = xnum\nxmax = xnum\ndnum = 1*(%d48-57)\nbnum = 1*%d48-49\nxnum = 1*(%d48-57 / %d65-70 / %d97-102)\n;\n; Basics\nalphanum = (%d97-122/%d65-90) *(%d97-122/%d65-90/%d48-57/%d45)\nowsp = *space\nwsp = 1*space\nspace = %d32\n / %d9\n / comment\n / LineContinue\ncomment = %d59 *(%d32-126 / %d9)\nLineEnd = %d13.10\n / %d10\n / %d13\nLineContinue = (%d13.10 / %d10 / %d13) (%d32 / %d9)\n"}),"toString")}),"grammar")}}),Hn=j({"../../node_modules/.pnpm/apg-js@4.1.1/node_modules/apg-js/src/apg-api/parser.js"(e,t){t.exports=I((function(){const e=Ln(),t=e.ids,r=new(zn()),n=new(Kn()),i=new(Fn()),o=new e.parser;o.ast=new e.ast,o.callbacks=r.callbacks,o.ast.callbacks=n.callbacks;const s=I((function(e,t,r){if(t<0||t>=r)return-1;for(let r=0;r<e.length;r+=1)if(t>=e[r].beginChar&&t<e[r].beginChar+e[r].length)return r;return-1}),"findLine"),a=I((function(e,t){let r=-1;if(t<e.length)for(let n=t;n<e.length;n+=1)if(null!==e[n]){r=e[n];break}return r}),"translateIndex"),c=I((function(e){e.forEach((e=>{const r=[],n=[];let i=0;e.opcodes.forEach((e=>{e.type===t.ALT&&1===e.children.length||e.type===t.CAT&&1===e.children.length||e.type===t.REP&&1===e.min&&1===e.max?n.push(null):(n.push(i),r.push(e),i+=1)})),n.push(i),r.forEach((e=>{if(e.type===t.ALT||e.type===t.CAT)for(let t=0;t<e.children.length;t+=1)e.children[t]=a(n,e.children[t])})),e.opcodes=r}))}),"reduceOpcodes");this.syntax=I((function(e,t,r,n,a){if(a){if("traceObject"!==a.traceObject)throw new TypeError("parser: trace argument is not a trace object");o.trace=a}const c={};c.errors=r,c.strict=!!n,c.lines=t,c.findLine=s,c.charsLength=e.length,c.ruleCount=0;o.parse(i,"file",e,c).success||r.push({line:0,char:0,msg:"syntax analysis of input grammar failed"})}),"syntax"),this.semantic=I((function(e,t,r){const n={};return n.errors=r,n.lines=t,n.findLine=s,n.charsLength=e.length,o.ast.translate(n),r.length?null:(c(n.rules),{rules:n.rules,udts:n.udts,lineMap:n.rulesLineMap})}),"semantic"),this.generateSource=I((function(e,r,n,i,o){let s,a,c,u="",l=0,d=1/0,f=0;const h=[],p=[];let m=0,g=0,b=0,y=0,v=0,w=0,A=0,E=0,S=0,x=0,M=0,_=0,k=0,T=0,C=0;n.forEach((e=>{h.push(e.lower),l+=e.opcodes.length,e.opcodes.forEach((e=>{switch(e.type){case t.ALT:m+=1;break;case t.CAT:g+=1;break;case t.RNM:b+=1;break;case t.UDT:y+=1;break;case t.REP:v+=1;break;case t.AND:w+=1;break;case t.NOT:A+=1;break;case t.BKA:_+=1;break;case t.BKN:k+=1;break;case t.BKR:M+=1;break;case t.ABG:T+=1;break;case t.AEN:C+=1;break;case t.TLS:for(E+=1,s=0;s<e.string.length;s+=1)e.string[s]<d&&(d=e.string[s]),e.string[s]>f&&(f=e.string[s]);break;case t.TBS:for(S+=1,s=0;s<e.string.length;s+=1)e.string[s]<d&&(d=e.string[s]),e.string[s]>f&&(f=e.string[s]);break;case t.TRG:x+=1,e.min<d&&(d=e.min),e.max>f&&(f=e.max);break;default:throw new Error("generateSource: unrecognized opcode")}}))})),h.sort(),i.length>0&&(i.forEach((e=>{p.push(e.lower)})),p.sort());let N,I="module.exports";return o&&"string"==typeof o&&(I=`let ${o}`),u+="// copyright: Copyright (c) 2021 Lowell D. Thomas, all rights reserved<br>\n",u+="// license: BSD-2-Clause (https://opensource.org/licenses/BSD-2-Clause)<br>\n",u+="//\n",u+="// Generated by apg-js, Version 4.0.0 [apg-js](https://github.com/ldthomas/apg-js)\n",u+=`${I} = function grammar(){\n`,u+=" // ```\n",u+=" // SUMMARY\n",u+=` // rules = ${n.length}\n`,u+=` // udts = ${i.length}\n`,u+=` // opcodes = ${l}\n`,u+=" // --- ABNF original opcodes\n",u+=` // ALT = ${m}\n`,u+=` // CAT = ${g}\n`,u+=` // REP = ${v}\n`,u+=` // RNM = ${b}\n`,u+=` // TLS = ${E}\n`,u+=` // TBS = ${S}\n`,u+=` // TRG = ${x}\n`,u+=" // --- SABNF superset opcodes\n",u+=` // UDT = ${y}\n`,u+=` // AND = ${w}\n`,u+=` // NOT = ${A}\n`,u+=` // BKA = ${_}\n`,u+=` // BKN = ${k}\n`,u+=` // BKR = ${M}\n`,u+=` // ABG = ${T}\n`,u+=` // AEN = ${C}\n`,u+=" // characters = [",u+=E+S+x===0?" none defined ]":`${d} - ${f}]`,y>0&&(u+=" + user defined"),u+="\n",u+=" // ```\n",u+=" /* OBJECT IDENTIFIER (for internal parser use) */\n",u+=" this.grammarObject = 'grammarObject';\n",u+="\n",u+=" /* RULES */\n",u+=" this.rules = [];\n",n.forEach(((e,t)=>{let r=" this.rules[";r+=t,r+="] = {name: '",r+=e.name,r+="', lower: '",r+=e.lower,r+="', index: ",r+=e.index,r+=", isBkr: ",r+=e.isBkr,r+="};\n",u+=r})),u+="\n",u+=" /* UDTS */\n",u+=" this.udts = [];\n",i.length>0&&i.forEach(((e,t)=>{let r=" this.udts[";r+=t,r+="] = {name: '",r+=e.name,r+="', lower: '",r+=e.lower,r+="', index: ",r+=e.index,r+=", empty: ",r+=e.empty,r+=", isBkr: ",r+=e.isBkr,r+="};\n",u+=r})),u+="\n",u+=" /* OPCODES */\n",n.forEach(((e,r)=>{r>0&&(u+="\n"),u+=` /* ${e.name} */\n`,u+=` this.rules[${r}].opcodes = [];\n`,e.opcodes.forEach(((e,o)=>{let s;switch(e.type){case t.ALT:u+=` this.rules[${r}].opcodes[${o}] = {type: ${e.type}, children: [${e.children.toString()}]};// ALT\n`;break;case t.CAT:u+=` this.rules[${r}].opcodes[${o}] = {type: ${e.type}, children: [${e.children.toString()}]};// CAT\n`;break;case t.RNM:u+=` this.rules[${r}].opcodes[${o}] = {type: ${e.type}, index: ${e.index}};// RNM(${n[e.index].name})\n`;break;case t.BKR:e.index>=n.length?(a=i[e.index-n.length].name,c=i[e.index-n.length].lower):(a=n[e.index].name,c=n[e.index].lower),s="%i",e.bkrCase===t.BKR_MODE_CS&&(s="%s"),e.bkrMode===t.BKR_MODE_UM?s+="%u":s+="%p",a=s+a,u+=` this.rules[${r}].opcodes[${o}] = {type: ${e.type}, index: ${e.index}, lower: '${c}', bkrCase: ${e.bkrCase}, bkrMode: ${e.bkrMode}};// BKR(\\${a})\n`;break;case t.UDT:u+=` this.rules[${r}].opcodes[${o}] = {type: ${e.type}, empty: ${e.empty}, index: ${e.index}};// UDT(${i[e.index].name})\n`;break;case t.REP:u+=` this.rules[${r}].opcodes[${o}] = {type: ${e.type}, min: ${e.min}, max: ${e.max}};// REP\n`;break;case t.AND:u+=` this.rules[${r}].opcodes[${o}] = {type: ${e.type}};// AND\n`;break;case t.NOT:u+=` this.rules[${r}].opcodes[${o}] = {type: ${e.type}};// NOT\n`;break;case t.ABG:u+=` this.rules[${r}].opcodes[${o}] = {type: ${e.type}};// ABG(%^)\n`;break;case t.AEN:u+=` this.rules[${r}].opcodes[${o}] = {type: ${e.type}};// AEN(%$)\n`;break;case t.BKA:u+=` this.rules[${r}].opcodes[${o}] = {type: ${e.type}};// BKA\n`;break;case t.BKN:u+=` this.rules[${r}].opcodes[${o}] = {type: ${e.type}};// BKN\n`;break;case t.TLS:u+=` this.rules[${r}].opcodes[${o}] = {type: ${e.type}, string: [${e.string.toString()}]};// TLS\n`;break;case t.TBS:u+=` this.rules[${r}].opcodes[${o}] = {type: ${e.type}, string: [${e.string.toString()}]};// TBS\n`;break;case t.TRG:u+=` this.rules[${r}].opcodes[${o}] = {type: ${e.type}, min: ${e.min}, max: ${e.max}};// TRG\n`;break;default:throw new Error("parser.js: ~143: unrecognized opcode")}}))})),u+="\n",u+=" // The `toString()` function will display the original grammar file(s) that produced these opcodes.\n",u+=" this.toString = function toString(){\n",u+=' let str = "";\n',r.forEach((t=>{const r=t.beginChar+t.length;N="",u+=' str += "';for(let n=t.beginChar;n<r;n+=1){switch(e[n]){case 9:N=" ";break;case 10:N="\\n";break;case 13:N="\\r";break;case 34:N='\\"';break;case 92:N="\\\\";break;default:N=String.fromCharCode(e[n])}u+=N}u+='";\n'})),u+=" return str;\n",u+=" }\n",u+="}\n",u}),"generateSource"),this.generateObject=I((function(e,t,r){const n={},i=[],o=[],s=e.slice(0);return n.grammarObject="grammarObject",t.forEach((e=>{i.push(e.lower)})),i.sort(),r.length>0&&(r.forEach((e=>{o.push(e.lower)})),o.sort()),n.callbacks=[],i.forEach((e=>{n.callbacks[e]=!1})),r.length>0&&o.forEach((e=>{n.callbacks[e]=!1})),n.rules=t,n.udts=r,n.toString=I((function(){return s}),"toStringFunc"),n}),"generateObject")}),"exportParser")}}),$n=j({"../../node_modules/.pnpm/apg-js@4.1.1/node_modules/apg-js/src/apg-api/rule-attributes.js"(e,t){t.exports=I((function(){const e=Mn();let t=null;function r(e){return!(e.left||e.nested||e.right||e.cyclic)&&e.empty}function n(e){return!!(e.left||e.nested||e.right||e.cyclic)}function i(e,t){let i=0,o=0,s=0;for(i=0;i<t;i+=1)if(e[i].nested)return!0;for(i=0;i<t;i+=1)if(e[i].right&&!e[i].leaf)for(o=i+1;o<t;o+=1)if(!r(e[o]))return!0;for(i=t-1;i>=0;i-=1)if(e[i].left&&!e[i].leaf)for(o=i-1;o>=0;o-=1)if(!r(e[o]))return!0;for(i=0;i<t;i+=1)if(!e[i].empty&&!n(e[i]))for(o=i+1;o<t;o+=1)if(n(e[o]))for(s=o+1;s<t;s+=1)if(!e[s].empty&&!n(e[s]))return!0;return!1}function o(e,t){for(let r=0;r<t;r+=1)if(!e[r].cyclic)return!1;return!0}function s(e,t){for(let r=0;r<t;r+=1){if(e[r].left)return!0;if(!e[r].empty)return!1}return!1}function a(e,t){for(let r=t-1;r>=0;r-=1){if(e[r].right)return!0;if(!e[r].empty)return!1}return!1}function c(e,t){for(let r=0;r<t;r+=1)if(!e[r].empty)return!1;return!0}function u(e,t){for(let r=0;r<t;r+=1)if(!e[r].finite)return!1;return!0}function l(e,t,r,n){let l=0;const d=t[r],f=d.children.length,p=[];for(l=0;l<f;l+=1)p.push(e.attrGen());for(l=0;l<f;l+=1)h(e,t,d.children[l],p[l]);n.left=s(p,f),n.right=a(p,f),n.nested=i(p,f),n.empty=c(p,f),n.finite=u(p,f),n.cyclic=o(p,f)}function d(e,t,r,n){let i=0;const o=t[r],s=o.children.length,a=[];for(i=0;i<s;i+=1)a.push(e.attrGen());for(i=0;i<s;i+=1)h(e,t,o.children[i],a[i]);for(n.left=!1,n.right=!1,n.nested=!1,n.empty=!1,n.finite=!1,n.cyclic=!1,i=0;i<s;i+=1)a[i].left&&(n.left=!0),a[i].nested&&(n.nested=!0),a[i].right&&(n.right=!0),a[i].empty&&(n.empty=!0),a[i].finite&&(n.finite=!0),a[i].cyclic&&(n.cyclic=!0)}function f(e,t,r,n){const i=t[r];i.index>=e.ruleCount?(n.empty=e.udts[i.index-e.ruleCount].empty,n.finite=!0):(p(e,i.index,n),n.left=!1,n.nested=!1,n.right=!1,n.cyclic=!1)}function h(t,r,n,i){t.attrInit(i);const o=r[n];switch(o.type){case e.ALT:d(t,r,n,i);break;case e.CAT:l(t,r,n,i);break;case e.REP:h(t,r,n+1,i),0===o.min&&(i.empty=!0,i.finite=!0);break;case e.RNM:p(t,r[n].index,i);break;case e.BKR:f(t,r,n,i);break;case e.AND:case e.NOT:case e.BKA:case e.BKN:h(t,r,n+1,i),i.empty=!0;break;case e.TLS:i.empty=!r[n].string.length,i.finite=!0,i.cyclic=!1;break;case e.TBS:case e.TRG:i.empty=!1,i.finite=!0,i.cyclic=!1;break;case e.UDT:i.empty=o.empty,i.finite=!0,i.cyclic=!1;break;case e.ABG:case e.AEN:i.empty=!0,i.finite=!0,i.cyclic=!1;break;default:throw new Error(`unknown opcode type: ${o}`)}}function p(e,t,r){const n=e.attrsWorking[t];n.isComplete?e.attrCopy(r,n):n.isOpen?t===e.startRule?t===e.startRule&&(r.left=!0,r.right=!0,r.cyclic=!0,r.leaf=!0):r.finite=!0:(n.isOpen=!0,h(e,n.rule.opcodes,0,r),n.left=r.left,n.right=r.right,n.nested=r.nested,n.empty=r.empty,n.finite=r.finite,n.cyclic=r.cyclic,n.leaf=!1,n.isOpen=!1,n.isComplete=!0)}I(r,"isEmptyOnly"),I(n,"isRecursive"),I(i,"isCatNested"),I(o,"isCatCyclic"),I(s,"isCatLeft"),I(a,"isCatRight"),I(c,"isCatEmpty"),I(u,"isCatFinite"),I(l,"cat"),I(d,"alt"),I(f,"bkr"),I(h,"opEval"),I(p,"ruleAttrsEval");const m=I((e=>{t=e;let r=0,n=0;const i=t.attrGen();for(r=0;r<t.ruleCount;r+=1){for(n=0;n<t.ruleCount;n+=1)t.attrInit(t.attrsWorking[n]);t.startRule=r,p(t,r,i),t.attrCopy(t.attrs[r],t.attrsWorking[r])}t.attributesComplete=!0;let o=null;for(r=0;r<t.ruleCount;r+=1)if(o=t.attrs[r],o.left||!o.finite||o.cyclic){const e=t.attrGen(o.rule);t.attrCopy(e,o),t.attrsErrors.push(e),t.attrsErrorCount+=1}}),"ruleAttributes"),g=I((e=>e?"t":"f"),"truth"),b=I((e=>e?"e":"f"),"tError"),y=I((e=>e?"t":"e"),"fError"),v=I(((r,n,i,o)=>{let s=`${r}:${n}:`;return s+=`${b(i.left)} `,s+=`${g(i.nested)} `,s+=`${g(i.right)} `,s+=`${b(i.cyclic)} `,s+=`${y(i.finite)} `,s+=`${g(i.empty)}:`,s+=`${t.typeToString(o.recursiveType)}:`,s+=o.recursiveType===e.ATTR_MR?o.groupNumber:"-",s+=`:${i.rule.name}\n`,s}),"showAttr"),w=I((()=>{let e="LEGEND - t=true, f=false, e=error\n";return e+="sequence:rule index:left nested right cyclic finite empty:type:group number:rule name\n","LEGEND - t=true, f=false, e=error\nsequence:rule index:left nested right cyclic finite empty:type:group number:rule name\n"}),"showLegend"),A=I((()=>{let e=null,r=null,n="";if(n+="RULE ATTRIBUTES WITH ERRORS\n",n+=w(),t.attrsErrorCount)for(let i=0;i<t.attrsErrorCount;i+=1)e=t.attrsErrors[i],r=t.ruleDeps[e.rule.index],n+=v(i,e.rule.index,e,r);else n+="<none>\n";return n}),"showAttributeErrors"),E=I((e=>{let r=0,n=0,i=null,o=null,s="",{ruleIndexes:a}=t;for(97===e?a=t.ruleAlphaIndexes:116===e&&(a=t.ruleTypeIndexes),r=0;r<t.ruleCount;r+=1)n=a[r],i=t.attrs[n],o=t.ruleDeps[n],s+=v(r,n,i,o);return s}),"show");return{ruleAttributes:m,showAttributes:I(((e="index")=>{if(!t.attributesComplete)throw new Error("rule-attributes.js:showAttributes: attributes not available");let r="";const n="RULE ATTRIBUTES\n";return 97===e.charCodeAt(0)?(r+="alphabetical by rule name\n",r+=n,r+=w(),r+=E(97)):116===e.charCodeAt(0)?(r+="ordered by rule type\n",r+=n,r+=w(),r+=E(116)):(r+="ordered by rule index\n",r+=n,r+=w(),r+=E()),r}),"showAttributes"),showAttributeErrors:A}}),"exportRuleAttributes")()}}),Vn=j({"../../node_modules/.pnpm/apg-js@4.1.1/node_modules/apg-js/src/apg-api/rule-dependencies.js"(e,t){t.exports=(()=>{const e=Mn();let t=null;const r=I(((t,n,i,o)=>{let s=0,a=0;const c=n[i];o[i]=!0;const u=c.rule.opcodes;for(s=0;s<u.length;s+=1){const i=u[s];if(i.type===e.RNM)for(c.refersTo[i.index]=!0,o[i.index]||r(t,n,i.index,o),a=0;a<t;a+=1)n[i.index].refersTo[a]&&(c.refersTo[a]=!0);else i.type===e.UDT?c.refersToUdt[i.index]=!0:i.type===e.BKR&&(i.index<t?(c.refersTo[i.index]=!0,o[i.index]||r(t,n,i.index,o)):c.refersToUdt[t-i.index]=!0)}}),"scan"),n=I((n=>{t=n;let i=0,o=0,s=0,a=null,c=null,u=!1;t.dependenciesComplete=!1;const l=t.falseArray(t.ruleCount);for(i=0;i<t.ruleCount;i+=1)t.falsifyArray(l),r(t.ruleCount,t.ruleDeps,i,l);for(i=0;i<t.ruleCount;i+=1)for(o=0;o<t.ruleCount;o+=1)i!==o&&t.ruleDeps[o].refersTo[i]&&(t.ruleDeps[i].referencedBy[o]=!0);for(i=0;i<t.ruleCount;i+=1)t.ruleDeps[i].recursiveType=e.ATTR_N,t.ruleDeps[i].refersTo[i]&&(t.ruleDeps[i].recursiveType=e.ATTR_R);for(s=-1,i=0;i<t.ruleCount;i+=1)if(a=t.ruleDeps[i],a.recursiveType===e.ATTR_R)for(u=!0,o=0;o<t.ruleCount;o+=1)i!==o&&(c=t.ruleDeps[o],c.recursiveType===e.ATTR_R&&a.refersTo[o]&&c.refersTo[i]&&(u&&(s+=1,a.recursiveType=e.ATTR_MR,a.groupNumber=s,u=!1),c.recursiveType=e.ATTR_MR,c.groupNumber=s));t.isMutuallyRecursive=s>-1,t.ruleAlphaIndexes.sort(t.compRulesAlpha),t.ruleTypeIndexes.sort(t.compRulesAlpha),t.ruleTypeIndexes.sort(t.compRulesType),t.isMutuallyRecursive&&t.ruleTypeIndexes.sort(t.compRulesGroup),t.udtCount&&t.udtAlphaIndexes.sort(t.compUdtsAlpha),t.dependenciesComplete=!0}),"ruleDependencies"),i=I(((e=null)=>{let r=0,n=0,i=0,o=0;const s=t.ruleCount-1,a=t.udtCount-1;let c="",u="";const l="=> ";let d=!1,f=null,{ruleIndexes:h}=t,{udtIndexes:p}=t;for(97===e?(h=t.ruleAlphaIndexes,p=t.udtAlphaIndexes):116===e&&(h=t.ruleTypeIndexes,p=t.udtAlphaIndexes),r=0;r<t.ruleCount;r+=1){for(f=t.ruleDeps[h[r]],u=`${h[r]}:${t.typeToString(f.recursiveType)}:`,t.isMutuallyRecursive&&(u+=f.groupNumber>-1?f.groupNumber:"-",u+=":"),u+=" ",c+=`${u+t.rules[h[r]].name}\n`,d=!0,i=0,o=c.length,c+=u,n=0;n<t.ruleCount;n+=1)f.refersTo[h[n]]&&(d?(c+=l,d=!1,c+=t.ruleDeps[h[n]].rule.name):c+=`, ${t.ruleDeps[h[n]].rule.name}`,i+=1),c.length-o>100&&n!==s&&(c+=`\n${u}=> `,o=c.length);if(t.udtCount)for(n=0;n<t.udtCount;n+=1)f.refersToUdt[p[n]]&&(d?(c+=l,d=!1,c+=t.udts[p[n]].name):c+=`, ${t.udts[p[n]].name}`,i+=1),c.length-o>100&&n!==a&&(c+=`\n${u}=> `,o=c.length);for(0===i&&(c+="=> <none>\n"),!1===d&&(c+="\n"),d=!0,i=0,o=c.length,c+=u,n=0;n<t.ruleCount;n+=1)f.referencedBy[h[n]]&&(d?(c+="<= ",d=!1,c+=t.ruleDeps[h[n]].rule.name):c+=`, ${t.ruleDeps[h[n]].rule.name}`,i+=1),c.length-o>100&&n!==s&&(c+=`\n${u}=> `,o=c.length);0===i&&(c+="<= <none>\n"),!1===d&&(c+="\n"),c+="\n"}return c}),"show");return{ruleDependencies:n,showRuleDependencies:I(((e="index")=>{let r="RULE DEPENDENCIES(index:type:[group number:])\n";return r+="=> refers to rule names\n",r+="<= referenced by rule names\n",t.dependenciesComplete?(97===e.charCodeAt(0)?(r+="alphabetical by rule name\n",r+=i(97)):116===e.charCodeAt(0)?(r+="ordered by rule type\n",r+=i(116)):(r+="ordered by rule index\n",r+=i(null)),r):r}),"showRuleDependencies")}})()}}),qn=j({"../../node_modules/.pnpm/apg-js@4.1.1/node_modules/apg-js/src/apg-api/attributes.js"(e,t){t.exports=I((function(){const e=Mn(),{ruleAttributes:t,showAttributes:r,showAttributeErrors:n}=$n(),{ruleDependencies:i,showRuleDependencies:o}=Vn();class s{constructor(e,t){this.rules=e,this.udts=t,this.ruleCount=e.length,this.udtCount=t.length,this.startRule=0,this.dependenciesComplete=!1,this.attributesComplete=!1,this.isMutuallyRecursive=!1,this.ruleIndexes=this.indexArray(this.ruleCount),this.ruleAlphaIndexes=this.indexArray(this.ruleCount),this.ruleTypeIndexes=this.indexArray(this.ruleCount),this.udtIndexes=this.indexArray(this.udtCount),this.udtAlphaIndexes=this.indexArray(this.udtCount),this.attrsErrorCount=0,this.attrs=[],this.attrsErrors=[],this.attrsWorking=[],this.ruleDeps=[];for(let t=0;t<this.ruleCount;t+=1)this.attrs.push(this.attrGen(this.rules[t])),this.attrsWorking.push(this.attrGen(this.rules[t])),this.ruleDeps.push(this.rdGen(e[t],this.ruleCount,this.udtCount));this.compRulesAlpha=this.compRulesAlpha.bind(this),this.compUdtsAlpha=this.compUdtsAlpha.bind(this),this.compRulesType=this.compRulesType.bind(this),this.compRulesGroup=this.compRulesGroup.bind(this)}attrGen(e){return{left:!1,nested:!1,right:!1,empty:!1,finite:!1,cyclic:!1,leaf:!1,isOpen:!1,isComplete:!1,rule:e}}attrInit(e){e.left=!1,e.nested=!1,e.right=!1,e.empty=!1,e.finite=!1,e.cyclic=!1,e.leaf=!1,e.isOpen=!1,e.isComplete=!1}attrCopy(e,t){e.left=t.left,e.nested=t.nested,e.right=t.right,e.empty=t.empty,e.finite=t.finite,e.cyclic=t.cyclic,e.leaf=t.leaf,e.isOpen=t.isOpen,e.isComplete=t.isComplete,e.rule=t.rule}rdGen(t,r,n){return{rule:t,recursiveType:e.ATTR_N,groupNumber:-1,refersTo:this.falseArray(r),refersToUdt:this.falseArray(n),referencedBy:this.falseArray(r)}}typeToString(t){switch(t){case e.ATTR_N:return" N";case e.ATTR_R:return" R";case e.ATTR_MR:return"MR";default:return"UNKNOWN"}}falseArray(e){const t=[];if(e>0)for(let r=0;r<e;r+=1)t.push(!1);return t}falsifyArray(e){for(let t=0;t<e.length;t+=1)e[t]=!1}indexArray(e){const t=[];if(e>0)for(let r=0;r<e;r+=1)t.push(r);return t}compRulesAlpha(e,t){return this.rules[e].lower<this.rules[t].lower?-1:this.rules[e].lower>this.rules[t].lower?1:0}compUdtsAlpha(e,t){return this.udts[e].lower<this.udts[t].lower?-1:this.udts[e].lower>this.udts[t].lower?1:0}compRulesType(e,t){return this.ruleDeps[e].recursiveType<this.ruleDeps[t].recursiveType?-1:this.ruleDeps[e].recursiveType>this.ruleDeps[t].recursiveType?1:0}compRulesGroup(t,r){if(this.ruleDeps[t].recursiveType===e.ATTR_MR&&this.ruleDeps[r].recursiveType===e.ATTR_MR){if(this.ruleDeps[t].groupNumber<this.ruleDeps[r].groupNumber)return-1;if(this.ruleDeps[t].groupNumber>this.ruleDeps[r].groupNumber)return 1}return 0}}I(s,"State");return{attributes:I((function(e=[],r=[],n=[],o=[]){const a=new s(e,r);return i(a),t(a),a.attrsErrorCount&&o.push({line:0,char:0,msg:`${a.attrsErrorCount} attribute errors`}),a.attrsErrorCount}),"attributes"),showAttributes:r,showAttributeErrors:n,showRuleDependencies:o}}),"exportAttributes")()}}),Gn=j({"../../node_modules/.pnpm/apg-js@4.1.1/node_modules/apg-js/src/apg-api/show-rules.js"(e,t){t.exports=I((function(){return I((function(e=[],t=[],r="index"){let n=[],i=[];const o=[],s=[],a=e,c=t,u=e.length,l=t.length;let d,f="RULE/UDT NAMES";function h(e,t){return a[e].lower<a[t].lower?-1:a[e].lower>a[t].lower?1:0}function p(e,t){return c[e].lower<c[t].lower?-1:c[e].lower>c[t].lower?1:0}if(I(h,"compRulesAlpha"),I(p,"compUdtsAlpha"),!Array.isArray(e)||!e.length)throw new Error("show-rules.js:showRules: rules arg must be array with length > 0");if(!Array.isArray(t))throw new Error("show-rules.js:showRules: udts arg must be array");for(d=0;d<u;d+=1)o.push(d);if(n=o.slice(0),n.sort(h),l){for(d=0;d<l;d+=1)s.push(d);i=s.slice(0),i.sort(p)}if(97===r.charCodeAt(0)){for(f+=" - alphabetical by rule/UDT name\n",d=0;d<u;d+=1)f+=`${d}: ${n[d]}: ${a[n[d]].name}\n`;if(l)for(d=0;d<l;d+=1)f+=`${d}: ${i[d]}: ${c[i[d]].name}\n`}else{for(f+=" - ordered by rule/UDT index\n",d=0;d<u;d+=1)f+=`${d}: ${a[d].name}\n`;if(l)for(d=0;d<l;d+=1)f+=`${d}: ${c[d].name}\n`}return f}),"showRules")}),"exports")()}}),Yn=j({"../../node_modules/.pnpm/apg-js@4.1.1/node_modules/apg-js/src/apg-api/api.js"(e,t){t.exports=I((function(e){const t=this,r=Ln(),n=Tn(),i=Un(),o=new(Hn()),{attributes:s,showAttributes:a,showAttributeErrors:c,showRuleDependencies:u}=qn(),l=Gn(),d=I((function(e,t,n){const i=`<span class="${r.style.CLASS_CTRLCHAR}">`,o="</span>",s=`<span class="${r.style.CLASS_NOMATCH}">`,a="</span>";let c,u="";for(;Array.isArray(e)&&0!==e.length;){if("number"!=typeof t)throw new Error("abnfToHtml: beg must be type number");if(t>=e.length)break;c="number"!=typeof n||t+n>=e.length?e.length:t+n;let l=0;for(let n=t;n<c;n+=1){const t=e[n];if(t>=32&&t<=126)switch(1===l?(u+=o,l=0):2===l&&(u+=a,l=0),t){case 32:u+=" ";break;case 60:u+="<";break;case 62:u+=">";break;case 38:u+="&";break;case 34:u+=""";break;case 39:u+="'";break;case 92:u+="\";break;default:u+=String.fromCharCode(t)}else 9===t||10===t||13===t?(0===l?(u+=i,l=1):2===l&&(u+=a+i,l=1),9===t&&(u+="TAB"),10===t&&(u+="LF"),13===t&&(u+="CR")):(0===l?(u+=s,l=2):1===l&&(u+=o+s,l=2),u+=`\\x${r.utils.charToHex(t)}`)}2===l&&(u+=a),1===l&&(u+=o);break}return u}),"abnfToHtml"),f=I((function(e,t,r){let n="";for(let i=t;i<t+r;i+=1){const t=e[i];if(t>=32&&t<=126)n+=String.fromCharCode(t);else switch(t){case 9:n+="\\t";break;case 10:n+="\\n";break;case 13:n+="\\r";break;default:n+="\\unknown"}}return n}),"abnfToAscii"),h=I((function(e){let r="Annotated Input Grammar";return e.forEach((e=>{r+="\n",r+=`line no: ${e.lineNo}`,r+=` : char index: ${e.beginChar}`,r+=` : length: ${e.length}`,r+=` : abnf: ${f(t.chars,e.beginChar,e.length)}`})),r+="\n",r}),"linesToAscii"),p=I((function(e){let n="";n+=`<table class="${r.style.CLASS_GRAMMAR}">\n`;return n+="<caption>Annotated Input Grammar</caption>\n",n+="<tr>",n+="<th>line<br>no.</th><th>first<br>char</th><th><br>length</th><th><br>text</th>",n+="</tr>\n",e.forEach((e=>{n+="<tr>",n+=`<td>${e.lineNo}`,n+=`</td><td>${e.beginChar}`,n+=`</td><td>${e.length}`,n+=`</td><td>${d(t.chars,e.beginChar,e.length)}`,n+="</td>",n+="</tr>\n"})),n+="</table>\n",n}),"linesToHtml"),m=I((function(e,t,n,i){const[o]=r;let s="";const a=`<span class="${o.CLASS_NOMATCH}">»</span>`;return s+=`<p><table class="${o.CLASS_GRAMMAR}">\n`,i&&"string"==typeof i&&(s+=`<caption>${i}</caption>\n`),s+="<tr><th>line<br>no.</th><th>line<br>offset</th><th>error<br>offset</th><th><br>text</th></tr>\n",e.forEach((e=>{let i,o,c,u,l,f="",h="";0===t.length?(l=a,o=0):(i=t[e.line],c=i.beginChar,e.char>c&&(f=d(n,c,e.char-c)),c=e.char,u=i.beginChar+i.length,c<u&&(h=d(n,c,u-c)),l=f+a+h,o=e.char-i.beginChar,s+="<tr>",s+=`<td>${e.line}</td><td>${i.beginChar}</td><td>${o}</td><td>${l}</td>`,s+="</tr>\n",s+="<tr>",s+=`<td colspan="3"></td><td>↑: ${r.utils.stringToAsciiHtml(e.msg)}</td>`,s+="</tr>\n")})),s+="</table></p>\n",s}),"errorsToHtml"),g=I((function(e,t,r){let n,i,o,s;return n="",e.forEach((e=>{i=t[e.line],n+=`${i.lineNo}: `,n+=`${i.beginChar}: `,n+=e.char-i.beginChar+": ",o=i.beginChar,s=e.char-i.beginChar,n+=f(r,o,s),n+=" >> ",o=e.char,s=i.beginChar+i.length-e.char,n+=f(r,o,s),n+="\n",n+=`${i.lineNo}: `,n+=`${i.beginChar}: `,n+=e.char-i.beginChar+": ",n+="error: ",n+=e.msg,n+="\n"})),n}),"errorsToAscii");let b,y=!1,v=!1,w=!1,A=!1,E=0;if(this.errors=[],Buffer.isBuffer(e))this.chars=n.decode("BINARY",e);else if(Array.isArray(e))this.chars=e.slice();else{if("string"!=typeof e)throw new Error("api.js: input source is not a string, byte Buffer or character array");this.chars=n.decode("STRING",e)}this.sabnf=n.encode("STRING",this.chars),this.scan=I((function(e,t){this.lines=i(this.chars,this.errors,e,t),y=!0}),"scan"),this.parse=I((function(e,t){if(!y)throw new Error("api.js: grammar not scanned");o.syntax(this.chars,this.lines,this.errors,e,t),v=!0}),"parse"),this.translate=I((function(){if(!v)throw new Error("api.js: grammar not scanned and parsed");const e=o.semantic(this.chars,this.lines,this.errors);0===this.errors.length&&(this.rules=e.rules,this.udts=e.udts,b=e.lineMap,w=!0)}),"translate"),this.attributes=I((function(){if(!w)throw new Error("api.js: grammar not scanned, parsed and translated");return E=s(this.rules,this.udts,b,this.errors),A=!0,E}),"attrs"),this.generate=I((function(e){if(this.lines=i(this.chars,this.errors,e),this.errors.length)return;if(o.syntax(this.chars,this.lines,this.errors,e),this.errors.length)return;const t=o.semantic(this.chars,this.lines,this.errors);this.errors.length||(this.rules=t.rules,this.udts=t.udts,b=t.lineMap,E=s(this.rules,this.udts,b,this.errors),A=!0)}),"generate"),this.displayRules=I((function(e="index"){if(!w)throw new Error("api.js: grammar not scanned, parsed and translated");return l(this.rules,this.udts,e)}),"displayRules"),this.displayRuleDependencies=I((function(e="index"){if(!A)throw new Error("api.js: no attributes - must be preceeded by call to attributes()");return u(e)}),"displayRuleDependencies"),this.displayAttributes=I((function(e="index"){if(!A)throw new Error("api.js: no attributes - must be preceeded by call to attributes()");return E&&c(e),a(e)}),"displayAttributes"),this.displayAttributeErrors=I((function(){if(!A)throw new Error("api.js: no attributes - must be preceeded by call to attributes()");return c()}),"displayAttributeErrors"),this.toSource=I((function(e){if(!A)throw new Error("api.js: can't generate parser source - must be preceeded by call to attributes()");if(E)throw new Error(`api.js: can't generate parser source - attributes have ${E} errors`);return o.generateSource(this.chars,this.lines,this.rules,this.udts,e)}),"toSource"),this.toObject=I((function(){if(!A)throw new Error("api.js: can't generate parser source - must be preceeded by call to attributes()");if(E)throw new Error(`api.js: can't generate parser source - attributes have ${E} errors`);return o.generateObject(this.sabnf,this.rules,this.udts)}),"toObject"),this.errorsToAscii=I((function(){return g(this.errors,this.lines,this.chars)}),"errorsToAsciiFunc"),this.errorsToHtml=I((function(e){return m(this.errors,this.lines,this.chars,e)}),"errorsToHtmlFunc"),this.linesToAscii=I((function(){return h(this.lines)}),"linesToAsciiFunc"),this.linesToHtml=I((function(){return p(this.lines)}),"linesToHtmlFunc")}),"api")}}),Jn=j({"../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/encode.js"(e,t){t.exports=n;var r=Math.pow(2,31);function n(e,t,i){if(Number.MAX_SAFE_INTEGER&&e>Number.MAX_SAFE_INTEGER)throw n.bytes=0,new RangeError("Could not encode varint");t=t||[];for(var o=i=i||0;e>=r;)t[i++]=255&e|128,e/=128;for(;-128&e;)t[i++]=255&e|128,e>>>=7;return t[i]=0|e,n.bytes=i-o+1,t}I(n,"encode")}}),Qn=j({"../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/decode.js"(e,t){t.exports=r;function r(e,t){var n,i=0,o=0,s=t=t||0,a=e.length;do{if(s>=a||o>49)throw r.bytes=0,new RangeError("Could not decode varint");n=e[s++],i+=o<28?(127&n)<<o:(127&n)*Math.pow(2,o),o+=7}while(n>=128);return r.bytes=s-t,i}I(r,"read")}}),Wn=j({"../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/length.js"(e,t){var r=Math.pow(2,7),n=Math.pow(2,14),i=Math.pow(2,21),o=Math.pow(2,28),s=Math.pow(2,35),a=Math.pow(2,42),c=Math.pow(2,49),u=Math.pow(2,56),l=Math.pow(2,63);t.exports=function(e){return e<r?1:e<n?2:e<i?3:e<o?4:e<s?5:e<a?6:e<c?7:e<u?8:e<l?9:10}}}),Xn=j({"../../node_modules/.pnpm/varint@6.0.0/node_modules/varint/index.js"(e,t){t.exports={encode:Jn(),decode:Qn(),encodingLength:Wn()}}}),Zn=j({"../../node_modules/.pnpm/@multiformats+base-x@4.0.1/node_modules/@multiformats/base-x/src/index.js"(e,t){function r(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var n=0;n<e.length;n++){var i=e.charAt(n),o=i.charCodeAt(0);if(255!==t[o])throw new TypeError(i+" is ambiguous");t[o]=n}var s=e.length,a=e.charAt(0),c=Math.log(s)/Math.log(256),u=Math.log(256)/Math.log(s);function l(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,n=0,i=0,o=t.length;i!==o&&0===t[i];)i++,r++;for(var c=(o-i)*u+1>>>0,l=new Uint8Array(c);i!==o;){for(var d=t[i],f=0,h=c-1;(0!==d||f<n)&&-1!==h;h--,f++)d+=256*l[h]>>>0,l[h]=d%s>>>0,d=d/s>>>0;if(0!==d)throw new Error("Non-zero carry");n=f,i++}for(var p=c-n;p!==c&&0===l[p];)p++;for(var m=a.repeat(r);p<c;++p)m+=e.charAt(l[p]);return m}function d(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return new Uint8Array;var r=0;if(" "!==e[r]){for(var n=0,i=0;e[r]===a;)n++,r++;for(var o=(e.length-r)*c+1>>>0,u=new Uint8Array(o);e[r];){var l=t[e.charCodeAt(r)];if(255===l)return;for(var d=0,f=o-1;(0!==l||d<i)&&-1!==f;f--,d++)l+=s*u[f]>>>0,u[f]=l%256>>>0,l=l/256>>>0;if(0!==l)throw new Error("Non-zero carry");i=d,r++}if(" "!==e[r]){for(var h=o-i;h!==o&&0===u[h];)h++;for(var p=new Uint8Array(n+(o-h)),m=n;h!==o;)p[m++]=u[h++];return p}}}function f(e){var t=d(e);if(t)return t;throw new Error("Non-base"+s+" character")}return I(l,"encode"),I(d,"decodeUnsafe"),I(f,"decode"),{encode:l,decodeUnsafe:d,decode:f}}I(r,"base"),t.exports=r}}),ei=j({"../../node_modules/.pnpm/multibase@4.0.6/node_modules/multibase/src/util.js"(e,t){var r=new TextDecoder,n=I((e=>r.decode(e)),"decodeText"),i=new TextEncoder,o=I((e=>i.encode(e)),"encodeText");function s(e,t){const r=new Uint8Array(t);let n=0;for(const t of e)r.set(t,n),n+=t.length;return r}I(s,"concat"),t.exports={decodeText:n,encodeText:o,concat:s}}}),ti=j({"../../node_modules/.pnpm/multibase@4.0.6/node_modules/multibase/src/base.js"(e,t){var{encodeText:r}=ei(),n=class{constructor(e,t,n,i){this.name=e,this.code=t,this.codeBuf=r(this.code),this.alphabet=i,this.codec=n(i)}encode(e){return this.codec.encode(e)}decode(e){for(const t of e)if(this.alphabet&&this.alphabet.indexOf(t)<0)throw new Error(`invalid character '${t}' in '${e}'`);return this.codec.decode(e)}};I(n,"Base"),t.exports=n}}),ri=j({"../../node_modules/.pnpm/multibase@4.0.6/node_modules/multibase/src/rfc4648.js"(e,t){var r=I(((e,t,r)=>{const n={};for(let e=0;e<t.length;++e)n[t[e]]=e;let i=e.length;for(;"="===e[i-1];)--i;const o=new Uint8Array(i*r/8|0);let s=0,a=0,c=0;for(let t=0;t<i;++t){const i=n[e[t]];if(void 0===i)throw new SyntaxError("Invalid character "+e[t]);a=a<<r|i,s+=r,s>=8&&(s-=8,o[c++]=255&a>>s)}if(s>=r||255&a<<8-s)throw new SyntaxError("Unexpected end of data");return o}),"decode"),n=I(((e,t,r)=>{const n="="===t[t.length-1],i=(1<<r)-1;let o="",s=0,a=0;for(let n=0;n<e.length;++n)for(a=a<<8|e[n],s+=8;s>r;)s-=r,o+=t[i&a>>s];if(s&&(o+=t[i&a<<r-s]),n)for(;o.length*r&7;)o+="=";return o}),"encode"),i=I((e=>t=>({encode:r=>n(r,t,e),decode:n=>r(n,t,e)})),"rfc4648");t.exports={rfc4648:i}}}),ni=j({"../../node_modules/.pnpm/multibase@4.0.6/node_modules/multibase/src/constants.js"(e,t){var r=Zn(),n=ti(),{rfc4648:i}=ri(),{decodeText:o,encodeText:s}=ei(),a=[["identity","\0",I((()=>({encode:o,decode:s})),"identity"),""],["base2","0",i(1),"01"],["base8","7",i(3),"01234567"],["base10","9",r,"0123456789"],["base16","f",i(4),"0123456789abcdef"],["base16upper","F",i(4),"0123456789ABCDEF"],["base32hex","v",i(5),"0123456789abcdefghijklmnopqrstuv"],["base32hexupper","V",i(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV"],["base32hexpad","t",i(5),"0123456789abcdefghijklmnopqrstuv="],["base32hexpadupper","T",i(5),"0123456789ABCDEFGHIJKLMNOPQRSTUV="],["base32","b",i(5),"abcdefghijklmnopqrstuvwxyz234567"],["base32upper","B",i(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"],["base32pad","c",i(5),"abcdefghijklmnopqrstuvwxyz234567="],["base32padupper","C",i(5),"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567="],["base32z","h",i(5),"ybndrfg8ejkmcpqxot1uwisza345h769"],["base36","k",r,"0123456789abcdefghijklmnopqrstuvwxyz"],["base36upper","K",r,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"],["base58btc","z",r,"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"],["base58flickr","Z",r,"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"],["base64","m",i(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"],["base64pad","M",i(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="],["base64url","u",i(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"],["base64urlpad","U",i(6),"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_="]],c=a.reduce(((e,t)=>(e[t[0]]=new n(t[0],t[1],t[2],t[3]),e)),{}),u=a.reduce(((e,t)=>(e[t[1]]=c[t[0]],e)),{});t.exports={names:c,codes:u}}}),ii=j({"../../node_modules/.pnpm/multibase@4.0.6/node_modules/multibase/src/index.js"(e,t){var r=ni(),{encodeText:n,decodeText:i,concat:o}=ei();function s(e,t){if(!t)throw new Error("requires an encoded Uint8Array");const{name:r,codeBuf:n}=d(e);return l(r,t),o([n,t],n.length+t.length)}function a(e,t){const r=d(e),i=n(r.encode(t));return o([r.codeBuf,i],r.codeBuf.length+i.length)}function c(e){e instanceof Uint8Array&&(e=i(e));const t=e[0];["f","F","v","V","t","T","b","B","c","C","h","k","K"].includes(t)&&(e=e.toLowerCase());return d(e[0]).decode(e.substring(1))}function u(e){if(e instanceof Uint8Array&&(e=i(e)),"[object String]"!==Object.prototype.toString.call(e))return!1;try{return d(e[0]).name}catch(e){return!1}}function l(e,t){d(e).decode(i(t))}function d(e){if(Object.prototype.hasOwnProperty.call(r.names,e))return r.names[e];if(Object.prototype.hasOwnProperty.call(r.codes,e))return r.codes[e];throw new Error(`Unsupported encoding: ${e}`)}function f(e){return e instanceof Uint8Array&&(e=i(e)),d(e[0])}I(s,"multibase"),I(a,"encode"),I(c,"decode"),I(u,"isEncoded"),I(l,"validEncode"),I(d,"encoding"),I(f,"encodingFromData"),(e=t.exports=s).encode=a,e.decode=c,e.isEncoded=u,e.encoding=d,e.encodingFromData=f;var h=Object.freeze(r.names),p=Object.freeze(r.codes);e.names=h,e.codes=p}}),oi=j({"../../node_modules/.pnpm/uint8arrays@2.1.10/node_modules/uint8arrays/compare.js"(e,t){function r(e,t){for(let r=0;r<e.byteLength;r++){if(e[r]<t[r])return-1;if(e[r]>t[r])return 1}return e.byteLength>t.byteLength?1:e.byteLength<t.byteLength?-1:0}I(r,"compare"),t.exports=r}}),si=j({"../../node_modules/.pnpm/uint8arrays@2.1.10/node_modules/uint8arrays/concat.js"(e,t){function r(e,t){t||(t=e.reduce(((e,t)=>e+t.length),0));const r=new Uint8Array(t);let n=0;for(const t of e)r.set(t,n),n+=t.length;return r}I(r,"concat"),t.exports=r}}),ai=j({"../../node_modules/.pnpm/uint8arrays@2.1.10/node_modules/uint8arrays/equals.js"(e,t){function r(e,t){if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0}I(r,"equals"),t.exports=r}}),ci=j({"../../node_modules/.pnpm/uint8arrays@2.1.10/node_modules/uint8arrays/util/bases.js"(e,t){var r,{bases:n}=(Sr(),r=Ar,P(b({},"__esModule",{value:!0}),r));function i(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}I(i,"createCodec");var o=i("utf8","u",(e=>"u"+new TextDecoder("utf8").decode(e)),(e=>(new TextEncoder).encode(e.substring(1)))),s=i("ascii","a",(e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t}),(e=>{e=e.substring(1);const t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t})),a=C({utf8:o,"utf-8":o,hex:n.base16,latin1:s,ascii:s,binary:s},n);t.exports=a}}),ui=j({"../../node_modules/.pnpm/uint8arrays@2.1.10/node_modules/uint8arrays/from-string.js"(e,t){var r=ci();function n(e,t="utf8"){const n=r[t];if(!n)throw new Error(`Unsupported encoding "${t}"`);return n.decoder.decode(`${n.prefix}${e}`)}I(n,"fromString"),t.exports=n}}),li=j({"../../node_modules/.pnpm/uint8arrays@2.1.10/node_modules/uint8arrays/to-string.js"(e,t){var r=ci();function n(e,t="utf8"){const n=r[t];if(!n)throw new Error(`Unsupported encoding "${t}"`);return n.encoder.encode(e).substring(1)}I(n,"toString"),t.exports=n}}),di=j({"../../node_modules/.pnpm/uint8arrays@2.1.10/node_modules/uint8arrays/xor.js"(e,t){function r(e,t){if(e.length!==t.length)throw new Error("Inputs should have the same length");const r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=e[n]^t[n];return r}I(r,"xor"),t.exports=r}}),fi=j({"../../node_modules/.pnpm/uint8arrays@2.1.10/node_modules/uint8arrays/index.js"(e,t){var r=oi(),n=si(),i=ai(),o=ui(),s=li(),a=di();t.exports={compare:r,concat:n,equals:i,fromString:o,toString:s,xor:a}}}),hi=j({"../../node_modules/.pnpm/key-did-resolver@1.2.1/node_modules/key-did-resolver/lib/secp256k1.js"(e){var t=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),r=e&&e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&t(n,e,i);return r(n,e),n};Object.defineProperty(e,"__esModule",{value:!0}),e.keyToDidDoc=void 0;var i=n(fi());function o(e,t){const r=`did:key:${t}`,n=`${r}#${t}`;return{id:r,verificationMethod:[{id:n,type:"Secp256k1VerificationKey2018",controller:r,publicKeyBase58:i.toString(e,"base58btc")}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n]}}I(o,"keyToDidDoc"),e.keyToDidDoc=o}}),pi=j({"../../node_modules/.pnpm/key-did-resolver@1.2.1/node_modules/key-did-resolver/lib/ed25519.js"(e){var t=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),r=e&&e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&t(n,e,i);return r(n,e),n};Object.defineProperty(e,"__esModule",{value:!0}),e.keyToDidDoc=void 0;var i=n(fi()),o=gn();function s(e){const t=new Uint8Array(e.length+2);return t[0]=236,t[1]=1,t.set(e,2),`z${i.toString(t,"base58btc")}`}function a(e,t){const r=`did:key:${t}`,n=`${r}#${t}`,a=o.convertPublicKeyToX25519(e),c=`${r}#${s(a)}`;return{id:r,verificationMethod:[{id:n,type:"Ed25519VerificationKey2018",controller:r,publicKeyBase58:i.toString(e,"base58btc")}],authentication:[n],assertionMethod:[n],capabilityDelegation:[n],capabilityInvocation:[n],keyAgreement:[{id:c,type:"X25519KeyAgreementKey2019",controller:r,publicKeyBase58:i.toString(a,"base58btc")}]}}I(s,"encodeKey"),I(a,"keyToDidDoc"),e.keyToDidDoc=a}}),mi=j({"../../node_modules/.pnpm/key-did-resolver@1.2.1/node_modules/key-did-resolver/lib/index.js"(e){var t=e&&e.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),r=e&&e.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=e&&e.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&t(n,e,i);return r(n,e),n},i=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0});var o=i(Xn()),s=i(ii()),a=n(hi()),c=n(pi()),u="application/did+json",l={231:a,237:c};e.default={getResolver:()=>({key:(t,r,n,i)=>z(e,null,(function*(){const e=i.accept||u,t={didResolutionMetadata:{contentType:e},didDocument:null,didDocumentMetadata:{}};try{const n=s.default.decode(r.id),i=o.default.decode(n),a=n.slice(o.default.decode.bytes),c=yield l[i].keyToDidDoc(a,r.id);"application/did+ld+json"===e?(c["@context"]="https://w3id.org/did/v1",t.didDocument=c):e===u?t.didDocument=c:(delete t.didResolutionMetadata.contentType,t.didResolutionMetadata.error="representationNotSupported")}catch(e){t.didResolutionMetadata.error="invalidDid",t.didResolutionMetadata.message=e.toString()}return t}))})}}}),gi=j({"../../node_modules/.pnpm/fast-json-stable-stringify@2.1.0/node_modules/fast-json-stable-stringify/index.js"(e,t){t.exports=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var r,n="boolean"==typeof t.cycles&&t.cycles,i=t.cmp&&(r=t.cmp,function(e){return function(t,n){var i={key:t,value:e[t]},o={key:n,value:e[n]};return r(i,o)}}),o=[];return I((function e(t){if(t&&t.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0!==t){if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);var r,s;if(Array.isArray(t)){for(s="[",r=0;r<t.length;r++)r&&(s+=","),s+=e(t[r])||"null";return s+"]"}if(null===t)return"null";if(-1!==o.indexOf(t)){if(n)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var a=o.push(t)-1,c=Object.keys(t).sort(i&&i(t));for(s="",r=0;r<c.length;r++){var u=c[r],l=e(t[u]);l&&(s&&(s+=","),s+=JSON.stringify(u)+":"+l)}return o.splice(a,1),"{"+s+"}"}}),"stringify")(e)}}}),bi=j({"../../node_modules/.pnpm/lodash.clonedeep@4.5.0/node_modules/lodash.clonedeep/index.js"(e,t){var r="__lodash_hash_undefined__",n=9007199254740991,i="[object Arguments]",o="[object Boolean]",s="[object Date]",a="[object Function]",c="[object GeneratorFunction]",u="[object Map]",l="[object Number]",d="[object Object]",f="[object Promise]",h="[object RegExp]",p="[object Set]",m="[object String]",g="[object Symbol]",b="[object WeakMap]",y="[object ArrayBuffer]",v="[object DataView]",w="[object Float32Array]",A="[object Float64Array]",E="[object Int8Array]",S="[object Int16Array]",x="[object Int32Array]",M="[object Uint8Array]",_="[object Uint8ClampedArray]",k="[object Uint16Array]",T="[object Uint32Array]",C=/\w*$/,N=/^\[object .+?Constructor\]$/,B=/^(?:0|[1-9]\d*)$/,O={};O[i]=O["[object Array]"]=O[y]=O[v]=O[o]=O[s]=O[w]=O[A]=O[E]=O[S]=O[x]=O[u]=O[l]=O[d]=O[h]=O[p]=O[m]=O[g]=O[M]=O[_]=O[k]=O[T]=!0,O["[object Error]"]=O[a]=O[b]=!1;var D="object"==typeof global&&global&&global.Object===Object&&global,j="object"==typeof self&&self&&self.Object===Object&&self,L=D||j||Function("return this")(),P="object"==typeof e&&e&&!e.nodeType&&e,R=P&&"object"==typeof t&&t&&!t.nodeType&&t,U=R&&R.exports===P;function z(e,t){return e.set(t[0],t[1]),e}function K(e,t){return e.add(t),e}function F(e,t){for(var r=-1,n=e?e.length:0;++r<n&&!1!==t(e[r],r,e););return e}function H(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}function $(e,t,r,n){var i=-1,o=e?e.length:0;for(n&&o&&(r=e[++i]);++i<o;)r=t(r,e[i],i,e);return r}function V(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function q(e,t){return null==e?void 0:e[t]}function G(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function Y(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function J(e,t){return function(r){return e(t(r))}}function Q(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}I(z,"addMapEntry"),I(K,"addSetEntry"),I(F,"arrayEach"),I(H,"arrayPush"),I($,"arrayReduce"),I(V,"baseTimes"),I(q,"getValue"),I(G,"isHostObject"),I(Y,"mapToArray"),I(J,"overArg"),I(Q,"setToArray");var W,X=Array.prototype,Z=Function.prototype,ee=Object.prototype,te=L["__core-js_shared__"],re=(W=/[^.]+$/.exec(te&&te.keys&&te.keys.IE_PROTO||""))?"Symbol(src)_1."+W:"",ne=Z.toString,ie=ee.hasOwnProperty,oe=ee.toString,se=RegExp("^"+ne.call(ie).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ae=U?L.Buffer:void 0,ce=L.Symbol,ue=L.Uint8Array,le=J(Object.getPrototypeOf,Object),de=Object.create,fe=ee.propertyIsEnumerable,he=X.splice,pe=Object.getOwnPropertySymbols,me=ae?ae.isBuffer:void 0,ge=J(Object.keys,Object),be=St(L,"DataView"),ye=St(L,"Map"),ve=St(L,"Promise"),we=St(L,"Set"),Ae=St(L,"WeakMap"),Ee=St(Object,"create"),Se=Ot(be),xe=Ot(ye),Me=Ot(ve),_e=Ot(we),ke=Ot(Ae),Te=ce?ce.prototype:void 0,Ce=Te?Te.valueOf:void 0;function Ne(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Ie(){this.__data__=Ee?Ee(null):{}}function Be(e){return this.has(e)&&delete this.__data__[e]}function Oe(e){var t=this.__data__;if(Ee){var n=t[e];return n===r?void 0:n}return ie.call(t,e)?t[e]:void 0}function De(e){var t=this.__data__;return Ee?void 0!==t[e]:ie.call(t,e)}function je(e,t){return this.__data__[e]=Ee&&void 0===t?r:t,this}function Le(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Pe(){this.__data__=[]}function Re(e){var t=this.__data__,r=rt(t,e);return!(r<0)&&(r==t.length-1?t.pop():he.call(t,r,1),!0)}function Ue(e){var t=this.__data__,r=rt(t,e);return r<0?void 0:t[r][1]}function ze(e){return rt(this.__data__,e)>-1}function Ke(e,t){var r=this.__data__,n=rt(r,e);return n<0?r.push([e,t]):r[n][1]=t,this}function Fe(e){var t=-1,r=e?e.length:0;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function He(){this.__data__={hash:new Ne,map:new(ye||Le),string:new Ne}}function $e(e){return Et(this,e).delete(e)}function Ve(e){return Et(this,e).get(e)}function qe(e){return Et(this,e).has(e)}function Ge(e,t){return Et(this,e).set(e,t),this}function Ye(e){this.__data__=new Le(e)}function Je(){this.__data__=new Le}function Qe(e){return this.__data__.delete(e)}function We(e){return this.__data__.get(e)}function Xe(e){return this.__data__.has(e)}function Ze(e,t){var r=this.__data__;if(r instanceof Le){var n=r.__data__;if(!ye||n.length<199)return n.push([e,t]),this;r=this.__data__=new Fe(n)}return r.set(e,t),this}function et(e,t){var r=Pt(e)||Lt(e)?V(e.length,String):[],n=r.length,i=!!n;for(var o in e)!t&&!ie.call(e,o)||i&&("length"==o||Ct(o,n))||r.push(o);return r}function tt(e,t,r){var n=e[t];ie.call(e,t)&&jt(n,r)&&(void 0!==r||t in e)||(e[t]=r)}function rt(e,t){for(var r=e.length;r--;)if(jt(e[r][0],t))return r;return-1}function nt(e,t){return e&&vt(t,Vt(t),e)}function it(e,t,r,n,o,s,u){var l;if(n&&(l=s?n(e,o,s,u):n(e)),void 0!==l)return l;if(!Ht(e))return e;var f=Pt(e);if(f){if(l=_t(e),!t)return yt(e,l)}else{var h=Mt(e),p=h==a||h==c;if(zt(e))return lt(e,t);if(h==d||h==i||p&&!s){if(G(e))return s?e:{};if(l=kt(p?{}:e),!t)return wt(e,nt(l,e))}else{if(!O[h])return s?e:{};l=Tt(e,h,it,t)}}u||(u=new Ye);var m=u.get(e);if(m)return m;if(u.set(e,l),!f)var g=r?At(e):Vt(e);return F(g||e,(function(i,o){g&&(i=e[o=i]),tt(l,o,it(i,t,r,n,o,e,u))})),l}function ot(e){return Ht(e)?de(e):{}}function st(e,t,r){var n=t(e);return Pt(e)?n:H(n,r(e))}function at(e){return oe.call(e)}function ct(e){return!(!Ht(e)||It(e))&&(Kt(e)||G(e)?se:N).test(Ot(e))}function ut(e){if(!Bt(e))return ge(e);var t=[];for(var r in Object(e))ie.call(e,r)&&"constructor"!=r&&t.push(r);return t}function lt(e,t){if(t)return e.slice();var r=new e.constructor(e.length);return e.copy(r),r}function dt(e){var t=new e.constructor(e.byteLength);return new ue(t).set(new ue(e)),t}function ft(e,t){var r=t?dt(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}function ht(e,t,r){return $(t?r(Y(e),!0):Y(e),z,new e.constructor)}function pt(e){var t=new e.constructor(e.source,C.exec(e));return t.lastIndex=e.lastIndex,t}function mt(e,t,r){return $(t?r(Q(e),!0):Q(e),K,new e.constructor)}function gt(e){return Ce?Object(Ce.call(e)):{}}function bt(e,t){var r=t?dt(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function yt(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}function vt(e,t,r,n){r||(r={});for(var i=-1,o=t.length;++i<o;){var s=t[i],a=n?n(r[s],e[s],s,r,e):void 0;tt(r,s,void 0===a?e[s]:a)}return r}function wt(e,t){return vt(e,xt(e),t)}function At(e){return st(e,Vt,xt)}function Et(e,t){var r=e.__data__;return Nt(t)?r["string"==typeof t?"string":"hash"]:r.map}function St(e,t){var r=q(e,t);return ct(r)?r:void 0}I(Ne,"Hash"),I(Ie,"hashClear"),I(Be,"hashDelete"),I(Oe,"hashGet"),I(De,"hashHas"),I(je,"hashSet"),Ne.prototype.clear=Ie,Ne.prototype.delete=Be,Ne.prototype.get=Oe,Ne.prototype.has=De,Ne.prototype.set=je,I(Le,"ListCache"),I(Pe,"listCacheClear"),I(Re,"listCacheDelete"),I(Ue,"listCacheGet"),I(ze,"listCacheHas"),I(Ke,"listCacheSet"),Le.prototype.clear=Pe,Le.prototype.delete=Re,Le.prototype.get=Ue,Le.prototype.has=ze,Le.prototype.set=Ke,I(Fe,"MapCache"),I(He,"mapCacheClear"),I($e,"mapCacheDelete"),I(Ve,"mapCacheGet"),I(qe,"mapCacheHas"),I(Ge,"mapCacheSet"),Fe.prototype.clear=He,Fe.prototype.delete=$e,Fe.prototype.get=Ve,Fe.prototype.has=qe,Fe.prototype.set=Ge,I(Ye,"Stack"),I(Je,"stackClear"),I(Qe,"stackDelete"),I(We,"stackGet"),I(Xe,"stackHas"),I(Ze,"stackSet"),Ye.prototype.clear=Je,Ye.prototype.delete=Qe,Ye.prototype.get=We,Ye.prototype.has=Xe,Ye.prototype.set=Ze,I(et,"arrayLikeKeys"),I(tt,"assignValue"),I(rt,"assocIndexOf"),I(nt,"baseAssign"),I(it,"baseClone"),I(ot,"baseCreate"),I(st,"baseGetAllKeys"),I(at,"baseGetTag"),I(ct,"baseIsNative"),I(ut,"baseKeys"),I(lt,"cloneBuffer"),I(dt,"cloneArrayBuffer"),I(ft,"cloneDataView"),I(ht,"cloneMap"),I(pt,"cloneRegExp"),I(mt,"cloneSet"),I(gt,"cloneSymbol"),I(bt,"cloneTypedArray"),I(yt,"copyArray"),I(vt,"copyObject"),I(wt,"copySymbols"),I(At,"getAllKeys"),I(Et,"getMapData"),I(St,"getNative");var xt=pe?J(pe,Object):qt,Mt=at;function _t(e){var t=e.length,r=e.constructor(t);return t&&"string"==typeof e[0]&&ie.call(e,"index")&&(r.index=e.index,r.input=e.input),r}function kt(e){return"function"!=typeof e.constructor||Bt(e)?{}:ot(le(e))}function Tt(e,t,r,n){var i=e.constructor;switch(t){case y:return dt(e);case o:case s:return new i(+e);case v:return ft(e,n);case w:case A:case E:case S:case x:case M:case _:case k:case T:return bt(e,n);case u:return ht(e,n,r);case l:case m:return new i(e);case h:return pt(e);case p:return mt(e,n,r);case g:return gt(e)}}function Ct(e,t){return!!(t=null==t?n:t)&&("number"==typeof e||B.test(e))&&e>-1&&e%1==0&&e<t}function Nt(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}function It(e){return!!re&&re in e}function Bt(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||ee)}function Ot(e){if(null!=e){try{return ne.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Dt(e){return it(e,!0,!0)}function jt(e,t){return e===t||e!=e&&t!=t}function Lt(e){return Ut(e)&&ie.call(e,"callee")&&(!fe.call(e,"callee")||oe.call(e)==i)}(be&&Mt(new be(new ArrayBuffer(1)))!=v||ye&&Mt(new ye)!=u||ve&&Mt(ve.resolve())!=f||we&&Mt(new we)!=p||Ae&&Mt(new Ae)!=b)&&(Mt=I((function(e){var t=oe.call(e),r=t==d?e.constructor:void 0,n=r?Ot(r):void 0;if(n)switch(n){case Se:return v;case xe:return u;case Me:return f;case _e:return p;case ke:return b}return t}),"getTag")),I(_t,"initCloneArray"),I(kt,"initCloneObject"),I(Tt,"initCloneByTag"),I(Ct,"isIndex"),I(Nt,"isKeyable"),I(It,"isMasked"),I(Bt,"isPrototype"),I(Ot,"toSource"),I(Dt,"cloneDeep"),I(jt,"eq"),I(Lt,"isArguments");var Pt=Array.isArray;function Rt(e){return null!=e&&Ft(e.length)&&!Kt(e)}function Ut(e){return $t(e)&&Rt(e)}I(Rt,"isArrayLike"),I(Ut,"isArrayLikeObject");var zt=me||Gt;function Kt(e){var t=Ht(e)?oe.call(e):"";return t==a||t==c}function Ft(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=n}function Ht(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function $t(e){return!!e&&"object"==typeof e}function Vt(e){return Rt(e)?et(e):ut(e)}function qt(){return[]}function Gt(){return!1}I(Kt,"isFunction"),I(Ft,"isLength"),I(Ht,"isObject"),I($t,"isObjectLike"),I(Vt,"keys"),I(qt,"stubArray"),I(Gt,"stubFalse"),t.exports=Dt}}),yi=j({"../../node_modules/.pnpm/cross-fetch@3.1.5/node_modules/cross-fetch/dist/browser-ponyfill.js"(e,t){var r,n="undefined"!=typeof self?self:e,i=function(){function e(){this.fetch=!1,this.DOMException=n.DOMException}return I(e,"F"),e.prototype=n,new e}();r=i,function(e){var t="URLSearchParams"in r,n="Symbol"in r&&"iterator"in Symbol,i="FileReader"in r&&"Blob"in r&&function(){try{return new Blob,!0}catch(e){return!1}}(),o="FormData"in r,s="ArrayBuffer"in r;function a(e){return e&&DataView.prototype.isPrototypeOf(e)}if(I(a,"isDataView"),s)var c=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],u=ArrayBuffer.isView||function(e){return e&&c.indexOf(Object.prototype.toString.call(e))>-1};function l(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function d(e){return"string"!=typeof e&&(e=String(e)),e}function f(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return n&&(t[Symbol.iterator]=function(){return t}),t}function h(e){this.map={},e instanceof h?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function p(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function m(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function g(e){var t=new FileReader,r=m(t);return t.readAsArrayBuffer(e),r}function b(e){var t=new FileReader,r=m(t);return t.readAsText(e),r}function y(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}function v(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function w(){return this.bodyUsed=!1,this._initBody=function(e){this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:i&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:o&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:t&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():s&&i&&a(e)?(this._bodyArrayBuffer=v(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):s&&(ArrayBuffer.prototype.isPrototypeOf(e)||u(e))?this._bodyArrayBuffer=v(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):t&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var e=p(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?p(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(g)}),this.text=function(){var e=p(this);if(e)return e;if(this._bodyBlob)return b(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(y(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},o&&(this.formData=function(){return this.text().then(x)}),this.json=function(){return this.text().then(JSON.parse)},this}I(l,"normalizeName"),I(d,"normalizeValue"),I(f,"iteratorFor"),I(h,"Headers"),h.prototype.append=function(e,t){e=l(e),t=d(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},h.prototype.delete=function(e){delete this.map[l(e)]},h.prototype.get=function(e){return e=l(e),this.has(e)?this.map[e]:null},h.prototype.has=function(e){return this.map.hasOwnProperty(l(e))},h.prototype.set=function(e,t){this.map[l(e)]=d(t)},h.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},h.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),f(e)},h.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),f(e)},h.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),f(e)},n&&(h.prototype[Symbol.iterator]=h.prototype.entries),I(p,"consumed"),I(m,"fileReaderReady"),I(g,"readBlobAsArrayBuffer"),I(b,"readBlobAsText"),I(y,"readArrayBufferAsText"),I(v,"bufferClone"),I(w,"Body");var A=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function E(e){var t=e.toUpperCase();return A.indexOf(t)>-1?t:e}function S(e,t){var r=(t=t||{}).body;if(e instanceof S){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new h(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,r||null==e._bodyInit||(r=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new h(t.headers)),this.method=E(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&r)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(r)}function x(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}})),t}function M(e){var t=new h;return e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();t.append(n,i)}})),t}function _(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new h(t.headers),this.url=t.url||"",this._initBody(e)}I(E,"normalizeMethod"),I(S,"Request"),S.prototype.clone=function(){return new S(this,{body:this._bodyInit})},I(x,"decode"),I(M,"parseHeaders"),w.call(S.prototype),I(_,"Response"),w.call(_.prototype),_.prototype.clone=function(){return new _(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new h(this.headers),url:this.url})},_.error=function(){var e=new _(null,{status:0,statusText:""});return e.type="error",e};var k=[301,302,303,307,308];_.redirect=function(e,t){if(-1===k.indexOf(t))throw new RangeError("Invalid status code");return new _(null,{status:t,headers:{location:e}})},e.DOMException=r.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function T(t,r){return new Promise((function(n,o){var s=new S(t,r);if(s.signal&&s.signal.aborted)return o(new e.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function c(){a.abort()}I(c,"abortXhr"),a.onload=function(){var e={status:a.status,statusText:a.statusText,headers:M(a.getAllResponseHeaders()||"")};e.url="responseURL"in a?a.responseURL:e.headers.get("X-Request-URL");var t="response"in a?a.response:a.responseText;n(new _(t,e))},a.onerror=function(){o(new TypeError("Network request failed"))},a.ontimeout=function(){o(new TypeError("Network request failed"))},a.onabort=function(){o(new e.DOMException("Aborted","AbortError"))},a.open(s.method,s.url,!0),"include"===s.credentials?a.withCredentials=!0:"omit"===s.credentials&&(a.withCredentials=!1),"responseType"in a&&i&&(a.responseType="blob"),s.headers.forEach((function(e,t){a.setRequestHeader(t,e)})),s.signal&&(s.signal.addEventListener("abort",c),a.onreadystatechange=function(){4===a.readyState&&s.signal.removeEventListener("abort",c)}),a.send(void 0===s._bodyInit?null:s._bodyInit)}))}I(T,"fetch"),T.polyfill=!0,r.fetch||(r.fetch=T,r.Headers=h,r.Request=S,r.Response=_),e.Headers=h,e.Request=S,e.Response=_,e.fetch=T,Object.defineProperty(e,"__esModule",{value:!0})}({}),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var o=i;(e=o.fetch).default=o.fetch,e.fetch=o.fetch,e.Headers=o.Headers,e.Request=o.Request,e.Response=o.Response,t.exports=e}}),vi=j({"../../node_modules/.pnpm/abort-controller@3.0.0/node_modules/abort-controller/browser.js"(e,t){var{AbortController:r,AbortSignal:n}="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0;t.exports=r,t.exports.AbortSignal=n,t.exports.default=r}}),wi=j({"../../node_modules/.pnpm/dataloader@2.1.0/node_modules/dataloader/index.js"(e,t){var r,n=function(){function e(e,t){if("function"!=typeof e)throw new TypeError("DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but got: "+e+".");this._batchLoadFn=e,this._maxBatchSize=u(t),this._batchScheduleFn=l(t),this._cacheKeyFn=d(t),this._cacheMap=f(t),this._batch=null}I(e,"DataLoader");var t=e.prototype;return t.load=I((function(e){if(null==e)throw new TypeError("The loader.load() function must be called with a value, but got: "+String(e)+".");var t=o(this),r=this._cacheMap,n=this._cacheKeyFn(e);if(r){var i=r.get(n);if(i){var s=t.cacheHits||(t.cacheHits=[]);return new Promise((function(e){s.push((function(){e(i)}))}))}}t.keys.push(e);var a=new Promise((function(e,r){t.callbacks.push({resolve:e,reject:r})}));return r&&r.set(n,a),a}),"load"),t.loadMany=I((function(e){if(!h(e))throw new TypeError("The loader.loadMany() function must be called with Array<key> but got: "+e+".");for(var t=[],r=0;r<e.length;r++)t.push(this.load(e[r]).catch((function(e){return e})));return Promise.all(t)}),"loadMany"),t.clear=I((function(e){var t=this._cacheMap;if(t){var r=this._cacheKeyFn(e);t.delete(r)}return this}),"clear"),t.clearAll=I((function(){var e=this._cacheMap;return e&&e.clear(),this}),"clearAll"),t.prime=I((function(e,t){var r=this._cacheMap;if(r){var n,i=this._cacheKeyFn(e);if(void 0===r.get(i))t instanceof Error?(n=Promise.reject(t)).catch((function(){})):n=Promise.resolve(t),r.set(i,n)}return this}),"prime"),e}(),i="object"==typeof process&&"function"==typeof process.nextTick?function(e){r||(r=Promise.resolve()),r.then((function(){process.nextTick(e)}))}:"function"==typeof setImmediate?function(e){setImmediate(e)}:function(e){setTimeout(e)};function o(e){var t=e._batch;if(null!==t&&!t.hasDispatched&&t.keys.length<e._maxBatchSize&&(!t.cacheHits||t.cacheHits.length<e._maxBatchSize))return t;var r={hasDispatched:!1,keys:[],callbacks:[]};return e._batch=r,e._batchScheduleFn((function(){s(e,r)})),r}function s(e,t){if(t.hasDispatched=!0,0!==t.keys.length){var r=e._batchLoadFn(t.keys);if(!r||"function"!=typeof r.then)return a(e,t,new TypeError("DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function did not return a Promise: "+String(r)+"."));r.then((function(e){if(!h(e))throw new TypeError("DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function did not return a Promise of an Array: "+String(e)+".");if(e.length!==t.keys.length)throw new TypeError("DataLoader must be constructed with a function which accepts Array<key> and returns Promise<Array<value>>, but the function did not return a Promise of an Array of the same length as the Array of keys.\n\nKeys:\n"+String(t.keys)+"\n\nValues:\n"+String(e));c(t);for(var r=0;r<t.callbacks.length;r++){var n=e[r];n instanceof Error?t.callbacks[r].reject(n):t.callbacks[r].resolve(n)}})).catch((function(r){a(e,t,r)}))}else c(t)}function a(e,t,r){c(t);for(var n=0;n<t.keys.length;n++)e.clear(t.keys[n]),t.callbacks[n].reject(r)}function c(e){if(e.cacheHits)for(var t=0;t<e.cacheHits.length;t++)e.cacheHits[t]()}function u(e){if(!(!e||!1!==e.batch))return 1;var t=e&&e.maxBatchSize;if(void 0===t)return 1/0;if("number"!=typeof t||t<1)throw new TypeError("maxBatchSize must be a positive number: "+t);return t}function l(e){var t=e&&e.batchScheduleFn;if(void 0===t)return i;if("function"!=typeof t)throw new TypeError("batchScheduleFn must be a function: "+t);return t}function d(e){var t=e&&e.cacheKeyFn;if(void 0===t)return function(e){return e};if("function"!=typeof t)throw new TypeError("cacheKeyFn must be a function: "+t);return t}function f(e){if(!(!e||!1!==e.cache))return null;var t=e&&e.cacheMap;if(void 0===t)return new Map;if(null!==t){var r=["get","set","delete","clear"].filter((function(e){return t&&"function"!=typeof t[e]}));if(0!==r.length)throw new TypeError("Custom cacheMap missing methods: "+r.join(", "))}return t}function h(e){return"object"==typeof e&&null!==e&&"number"==typeof e.length&&(0===e.length||e.length>0&&Object.prototype.hasOwnProperty.call(e,e.length-1))}I(o,"getCurrentBatch"),I(s,"dispatchBatch"),I(a,"failedDispatch"),I(c,"resolveCacheHits"),I(u,"getValidMaxBatchSize"),I(l,"getValidBatchScheduleFn"),I(d,"getValidCacheKeyFn"),I(f,"getValidCacheMap"),I(h,"isArrayLike"),t.exports=n}}),Ai=j({"../../node_modules/.pnpm/strict-uri-encode@2.0.0/node_modules/strict-uri-encode/index.js"(e,t){t.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`))}}),Ei=j({"../../node_modules/.pnpm/decode-uri-component@0.2.0/node_modules/decode-uri-component/index.js"(e,t){var r="%[a-f0-9]{2}",n=new RegExp(r,"gi"),i=new RegExp("("+r+")+","gi");function o(e,t){try{return decodeURIComponent(e.join(""))}catch(e){}if(1===e.length)return e;t=t||1;var r=e.slice(0,t),n=e.slice(t);return Array.prototype.concat.call([],o(r),o(n))}function s(e){try{return decodeURIComponent(e)}catch(i){for(var t=e.match(n),r=1;r<t.length;r++)t=(e=o(t,r).join("")).match(n);return e}}function a(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},r=i.exec(e);r;){try{t[r[0]]=decodeURIComponent(r[0])}catch(e){var n=s(r[0]);n!==r[0]&&(t[r[0]]=n)}r=i.exec(e)}t["%C2"]="�";for(var o=Object.keys(t),a=0;a<o.length;a++){var c=o[a];e=e.replace(new RegExp(c,"g"),t[c])}return e}I(o,"decodeComponents"),I(s,"decode"),I(a,"customDecodeURIComponent"),t.exports=function(e){if("string"!=typeof e)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch(t){return a(e)}}}}),Si=j({"../../node_modules/.pnpm/split-on-first@1.1.0/node_modules/split-on-first/index.js"(e,t){t.exports=(e,t)=>{if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];const r=e.indexOf(t);return-1===r?[e]:[e.slice(0,r),e.slice(r+t.length)]}}}),xi=j({"../../node_modules/.pnpm/filter-obj@1.1.0/node_modules/filter-obj/index.js"(e,t){t.exports=function(e,t){for(var r={},n=Object.keys(e),i=Array.isArray(t),o=0;o<n.length;o++){var s=n[o],a=e[s];(i?-1!==t.indexOf(s):t(s,a,e))&&(r[s]=a)}return r}}}),Mi=j({"../../node_modules/.pnpm/query-string@7.1.1/node_modules/query-string/index.js"(e){var t=Ai(),r=Ei(),n=Si(),i=xi(),o=I((e=>null==e),"isNullOrUndefined"),s=Symbol("encodeFragmentIdentifier");function a(e){switch(e.arrayFormat){case"index":return t=>(r,n)=>{const i=r.length;return void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[l(t,e),"[",i,"]"].join("")]:[...r,[l(t,e),"[",l(i,e),"]=",l(n,e)].join("")]};case"bracket":return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[l(t,e),"[]"].join("")]:[...r,[l(t,e),"[]=",l(n,e)].join("")];case"colon-list-separator":return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[l(t,e),":list="].join("")]:[...r,[l(t,e),":list=",l(n,e)].join("")];case"comma":case"separator":case"bracket-separator":{const t="bracket-separator"===e.arrayFormat?"[]=":"=";return r=>(n,i)=>void 0===i||e.skipNull&&null===i||e.skipEmptyString&&""===i?n:(i=null===i?"":i,0===n.length?[[l(r,e),t,l(i,e)].join("")]:[[n,l(i,e)].join(e.arrayFormatSeparator)])}default:return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,l(t,e)]:[...r,[l(t,e),"=",l(n,e)].join("")]}}function c(e){let t;switch(e.arrayFormat){case"index":return(e,r,n)=>{t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===n[e]&&(n[e]={}),n[e][t[1]]=r):n[e]=r};case"bracket":return(e,r,n)=>{t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==n[e]?n[e]=[].concat(n[e],r):n[e]=[r]:n[e]=r};case"colon-list-separator":return(e,r,n)=>{t=/(:list)$/.exec(e),e=e.replace(/:list$/,""),t?void 0!==n[e]?n[e]=[].concat(n[e],r):n[e]=[r]:n[e]=r};case"comma":case"separator":return(t,r,n)=>{const i="string"==typeof r&&r.includes(e.arrayFormatSeparator),o="string"==typeof r&&!i&&d(r,e).includes(e.arrayFormatSeparator);r=o?d(r,e):r;const s=i||o?r.split(e.arrayFormatSeparator).map((t=>d(t,e))):null===r?r:d(r,e);n[t]=s};case"bracket-separator":return(t,r,n)=>{const i=/(\[\])$/.test(t);if(t=t.replace(/\[\]$/,""),!i)return void(n[t]=r?d(r,e):r);const o=null===r?[]:r.split(e.arrayFormatSeparator).map((t=>d(t,e)));void 0!==n[t]?n[t]=[].concat(n[t],o):n[t]=o};default:return(e,t,r)=>{void 0!==r[e]?r[e]=[].concat(r[e],t):r[e]=t}}}function u(e){if("string"!=typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function l(e,r){return r.encode?r.strict?t(e):encodeURIComponent(e):e}function d(e,t){return t.decode?r(e):e}function f(e){return Array.isArray(e)?e.sort():"object"==typeof e?f(Object.keys(e)).sort(((e,t)=>Number(e)-Number(t))).map((t=>e[t])):e}function h(e){const t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function p(e){let t="";const r=e.indexOf("#");return-1!==r&&(t=e.slice(r)),t}function m(e){const t=(e=h(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function g(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):!t.parseBooleans||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()||(e="true"===e.toLowerCase()),e}function b(e,t){u((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);const r=c(t),i=Object.create(null);if("string"!=typeof e)return i;if(!(e=e.trim().replace(/^[?#&]/,"")))return i;for(const o of e.split("&")){if(""===o)continue;let[e,s]=n(t.decode?o.replace(/\+/g," "):o,"=");s=void 0===s?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?s:d(s,t),r(d(e,t),s,i)}for(const e of Object.keys(i)){const r=i[e];if("object"==typeof r&&null!==r)for(const e of Object.keys(r))r[e]=g(r[e],t);else i[e]=g(r,t)}return!1===t.sort?i:(!0===t.sort?Object.keys(i).sort():Object.keys(i).sort(t.sort)).reduce(((e,t)=>{const r=i[t];return Boolean(r)&&"object"==typeof r&&!Array.isArray(r)?e[t]=f(r):e[t]=r,e}),Object.create(null))}I(a,"encoderForArrayFormat"),I(c,"parserForArrayFormat"),I(u,"validateArrayFormatSeparator"),I(l,"encode"),I(d,"decode"),I(f,"keysSorter"),I(h,"removeHash"),I(p,"getHash"),I(m,"extract"),I(g,"parseValue"),I(b,"parse"),e.extract=m,e.parse=b,e.stringify=(e,t)=>{if(!e)return"";u((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);const r=I((r=>t.skipNull&&o(e[r])||t.skipEmptyString&&""===e[r]),"shouldFilter"),n=a(t),i={};for(const t of Object.keys(e))r(t)||(i[t]=e[t]);const s=Object.keys(i);return!1!==t.sort&&s.sort(t.sort),s.map((r=>{const i=e[r];return void 0===i?"":null===i?l(r,t):Array.isArray(i)?0===i.length&&"bracket-separator"===t.arrayFormat?l(r,t)+"[]":i.reduce(n(r),[]).join("&"):l(r,t)+"="+l(i,t)})).filter((e=>e.length>0)).join("&")},e.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);const[r,i]=n(e,"#");return Object.assign({url:r.split("?")[0]||"",query:b(m(e),t)},t&&t.parseFragmentIdentifier&&i?{fragmentIdentifier:d(i,t)}:{})},e.stringifyUrl=(t,r)=>{r=Object.assign({encode:!0,strict:!0,[s]:!0},r);const n=h(t.url).split("?")[0]||"",i=e.extract(t.url),o=e.parse(i,{sort:!1}),a=Object.assign(o,t.query);let c=e.stringify(a,r);c&&(c=`?${c}`);let u=p(t.url);return t.fragmentIdentifier&&(u=`#${r[s]?l(t.fragmentIdentifier,r):t.fragmentIdentifier}`),`${n}${c}${u}`},e.pick=(t,r,n)=>{n=Object.assign({parseFragmentIdentifier:!0,[s]:!1},n);const{url:o,query:a,fragmentIdentifier:c}=e.parseUrl(t,n);return e.stringifyUrl({url:o,query:i(a,r),fragmentIdentifier:c},n)},e.exclude=(t,r,n)=>{const i=Array.isArray(r)?e=>!r.includes(e):(e,t)=>!r(e,t);return e.pick(t,i,n)}}});function _i(e){var t=0,r=e.length,n=[];if(r%2)throw new Error("invalid hex:"+e);for(;t<r;t+=2)n.push(parseInt(e.substr(t,2),16));return new Uint8Array(n)}I(_i,"toUint8Array");var ki=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});ki.decode();var Ti=null;function Ci(){return null!==Ti&&Ti.buffer===Er.memory.buffer||(Ti=new Uint8Array(Er.memory.buffer)),Ti}function Ni(e,t){return ki.decode(Ci().subarray(e,e+t))}I(Ci,"getUint8Memory0"),I(Ni,"getStringFromWasm0");var Ii=new Array(32).fill(void 0);Ii.push(void 0,null,!0,!1);var Bi=Ii.length;function Oi(e){Bi===Ii.length&&Ii.push(Ii.length+1);const t=Bi;return Bi=Ii[t],Ii[t]=e,t}function Di(e){return Ii[e]}function ji(e){e<36||(Ii[e]=Bi,Bi=e)}function Li(e){const t=Di(e);return ji(e),t}I(Oi,"addHeapObject"),I(Di,"getObject"),I(ji,"dropObject"),I(Li,"takeObject");var Pi=0,Ri=new TextEncoder("utf-8"),Ui="function"==typeof Ri.encodeInto?function(e,t){return Ri.encodeInto(e,t)}:function(e,t){const r=Ri.encode(e);return t.set(r),{read:e.length,written:r.length}};function zi(e,t,r){if(void 0===r){const r=Ri.encode(e),n=t(r.length);return Ci().subarray(n,n+r.length).set(r),Pi=r.length,n}let n=e.length,i=t(n);const o=Ci();let s=0;for(;s<n;s++){const t=e.charCodeAt(s);if(t>127)break;o[i+s]=t}if(s!==n){0!==s&&(e=e.slice(s)),i=r(i,n,n=s+3*e.length);const t=Ci().subarray(i+s,i+n);s+=Ui(e,t).written}return Pi=s,i}function Ki(e){return null==e}I(zi,"passStringToWasm0"),I(Ki,"isLikeNone");var Fi=null;function Hi(){return null!==Fi&&Fi.buffer===Er.memory.buffer||(Fi=new Int32Array(Er.memory.buffer)),Fi}function $i(e){const t=typeof e;if("number"==t||"boolean"==t||null==e)return`${e}`;if("string"==t)return`"${e}"`;if("symbol"==t){const t=e.description;return null==t?"Symbol":`Symbol(${t})`}if("function"==t){const t=e.name;return"string"==typeof t&&t.length>0?`Function(${t})`:"Function"}if(Array.isArray(e)){const t=e.length;let r="[";t>0&&(r+=$i(e[0]));for(let n=1;n<t;n++)r+=", "+$i(e[n]);return r+="]",r}const r=/\[object ([^\]]+)\]/.exec(toString.call(e));let n;if(!(r.length>1))return toString.call(e);if(n=r[1],"Object"==n)try{return"Object("+JSON.stringify(e)+")"}catch(e){return"Object"}return e instanceof Error?`${e.name}: ${e.message}\n${e.stack}`:n}function Vi(e,t,r,n){const i={a:e,b:t,cnt:1,dtor:r},o=I(((...e)=>{i.cnt++;const t=i.a;i.a=0;try{return n(t,i.b,...e)}finally{0==--i.cnt?Er.__wbindgen_export_2.get(i.dtor)(t,i.b):i.a=t}}),"real");return o.original=i,o}function qi(e,t,r){Er._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h91a8814f66f14b17(e,t,Oi(r))}function Gi(e,t){const r=t(1*e.length);return Ci().set(e,r/1),Pi=e.length,r}function Yi(e){try{const a=Er.__wbindgen_add_to_stack_pointer(-16),c=Gi(e,Er.__wbindgen_malloc),u=Pi;Er.generateEd25519KeyFromBytes(a,c,u);var t=Hi()[a/4+0],r=Hi()[a/4+1],n=Hi()[a/4+2],i=Hi()[a/4+3],o=t,s=r;if(i)throw o=0,s=0,Li(n);return Ni(o,s)}finally{Er.__wbindgen_add_to_stack_pointer(16),Er.__wbindgen_free(o,s)}}function Ji(e,t){try{const c=Er.__wbindgen_add_to_stack_pointer(-16),u=zi(e,Er.__wbindgen_malloc,Er.__wbindgen_realloc),l=Pi,d=zi(t,Er.__wbindgen_malloc,Er.__wbindgen_realloc),f=Pi;Er.keyToDID(c,u,l,d,f);var r=Hi()[c/4+0],n=Hi()[c/4+1],i=Hi()[c/4+2],o=Hi()[c/4+3],s=r,a=n;if(o)throw s=0,a=0,Li(i);return Ni(s,a)}finally{Er.__wbindgen_add_to_stack_pointer(16),Er.__wbindgen_free(s,a)}}function Qi(e,t){const r=zi(e,Er.__wbindgen_malloc,Er.__wbindgen_realloc),n=Pi,i=zi(t,Er.__wbindgen_malloc,Er.__wbindgen_realloc),o=Pi;return Li(Er.keyToVerificationMethod(r,n,i,o))}function Wi(e,t,r){const n=zi(e,Er.__wbindgen_malloc,Er.__wbindgen_realloc),i=Pi,o=zi(t,Er.__wbindgen_malloc,Er.__wbindgen_realloc),s=Pi,a=zi(r,Er.__wbindgen_malloc,Er.__wbindgen_realloc),c=Pi;return Li(Er.issueCredential(n,i,o,s,a,c))}function Xi(e,t){const r=zi(e,Er.__wbindgen_malloc,Er.__wbindgen_realloc),n=Pi,i=zi(t,Er.__wbindgen_malloc,Er.__wbindgen_realloc),o=Pi;return Li(Er.verifyCredential(r,n,i,o))}function Zi(e,t,r){const n=zi(e,Er.__wbindgen_malloc,Er.__wbindgen_realloc),i=Pi,o=zi(t,Er.__wbindgen_malloc,Er.__wbindgen_realloc),s=Pi,a=zi(r,Er.__wbindgen_malloc,Er.__wbindgen_realloc),c=Pi;return Li(Er.issuePresentation(n,i,o,s,a,c))}function eo(e,t){const r=zi(e,Er.__wbindgen_malloc,Er.__wbindgen_realloc),n=Pi,i=zi(t,Er.__wbindgen_malloc,Er.__wbindgen_realloc),o=Pi;return Li(Er.verifyPresentation(r,n,i,o))}function to(e,t){try{return e.apply(this,t)}catch(e){Er.__wbindgen_exn_store(Oi(e))}}function ro(e,t){return Ci().subarray(e/1,e/1+t)}function no(e,t,r,n){Er.wasm_bindgen__convert__closures__invoke2_mut__h3ecfeb7a01c1be81(e,t,Oi(r),Oi(n))}function io(e,t){return z(this,null,(function*(){if("function"==typeof Response&&e instanceof Response){if("function"==typeof WebAssembly.instantiateStreaming)try{return yield WebAssembly.instantiateStreaming(e,t)}catch(t){if("application/wasm"==e.headers.get("Content-Type"))throw t;console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",t)}const r=yield e.arrayBuffer();return yield WebAssembly.instantiate(r,t)}{const r=yield WebAssembly.instantiate(e,t);return r instanceof WebAssembly.Instance?{instance:r,module:e}:r}}))}function oo(e){return z(this,null,(function*(){const t={wbg:{}};t.wbg.__wbindgen_string_new=function(e,t){return Oi(Ni(e,t))},t.wbg.__wbindgen_object_drop_ref=function(e){Li(e)},t.wbg.__wbindgen_cb_drop=function(e){const t=Li(e).original;if(1==t.cnt--)return t.a=0,!0;return!1},t.wbg.__wbindgen_object_clone_ref=function(e){return Oi(Di(e))},t.wbg.__wbg_fetch_811d43d6bdcad5b1=function(e){return Oi(fetch(Di(e)))},t.wbg.__wbg_fetch_bf56e2a9f0644e3f=function(e,t){return Oi(Di(e).fetch(Di(t)))},t.wbg.__wbg_new_89d7f088c1c45353=function(){return to((function(){return Oi(new Headers)}),arguments)},t.wbg.__wbg_append_f4f93bc73c45ee3e=function(){return to((function(e,t,r,n,i){Di(e).append(Ni(t,r),Ni(n,i))}),arguments)},t.wbg.__wbindgen_string_get=function(e,t){const r=Di(t),n="string"==typeof r?r:void 0;var i=Ki(n)?0:zi(n,Er.__wbindgen_malloc,Er.__wbindgen_realloc),o=Pi;Hi()[e/4+1]=o,Hi()[e/4+0]=i},t.wbg.__wbg_instanceof_Response_ccfeb62399355bcd=function(e){return Di(e)instanceof Response},t.wbg.__wbg_url_06c0f822d68d195c=function(e,t){const r=zi(Di(t).url,Er.__wbindgen_malloc,Er.__wbindgen_realloc),n=Pi;Hi()[e/4+1]=n,Hi()[e/4+0]=r},t.wbg.__wbg_status_600fd8b881393898=function(e){return Di(e).status},t.wbg.__wbg_headers_9e7f2c05a9b962ea=function(e){return Oi(Di(e).headers)},t.wbg.__wbg_arrayBuffer_5a99283a3954c850=function(){return to((function(e){return Oi(Di(e).arrayBuffer())}),arguments)},t.wbg.__wbg_newwithstrandinit_fd99688f189f053e=function(){return to((function(e,t,r){return Oi(new Request(Ni(e,t),Di(r)))}),arguments)},t.wbg.__wbindgen_is_object=function(e){const t=Di(e);return"object"==typeof t&&null!==t},t.wbg.__wbg_self_86b4b13392c7af56=function(){return to((function(){return Oi(self.self)}),arguments)},t.wbg.__wbg_crypto_b8c92eaac23d0d80=function(e){return Oi(Di(e).crypto)},t.wbg.__wbg_msCrypto_9ad6677321a08dd8=function(e){return Oi(Di(e).msCrypto)},t.wbg.__wbindgen_is_undefined=function(e){return void 0===Di(e)},t.wbg.__wbg_static_accessor_MODULE_452b4680e8614c81=function(){return Oi(n)},t.wbg.__wbg_require_f5521a5b85ad2542=function(e,t,r){return Oi(Di(e).require(Ni(t,r)))},t.wbg.__wbg_getRandomValues_dd27e6b0652b3236=function(e){return Oi(Di(e).getRandomValues)},t.wbg.__wbg_getRandomValues_e57c9b75ddead065=function(e,t){Di(e).getRandomValues(Di(t))},t.wbg.__wbg_randomFillSync_d2ba53160aec6aba=function(e,t,r){Di(e).randomFillSync(ro(t,r))},t.wbg.__wbindgen_is_function=function(e){return"function"==typeof Di(e)},t.wbg.__wbg_newnoargs_e23b458e372830de=function(e,t){return Oi(new Function(Ni(e,t)))},t.wbg.__wbg_next_cabb70b365520721=function(e){return Oi(Di(e).next)},t.wbg.__wbg_next_bf3d83fc18df496e=function(){return to((function(e){return Oi(Di(e).next())}),arguments)},t.wbg.__wbg_done_040f966faa9a72b3=function(e){return Di(e).done},t.wbg.__wbg_value_419afbd9b9574c4c=function(e){return Oi(Di(e).value)},t.wbg.__wbg_iterator_4832ef1f15b0382b=function(){return Oi(Symbol.iterator)},t.wbg.__wbg_get_a9cab131e3152c49=function(){return to((function(e,t){return Oi(Reflect.get(Di(e),Di(t)))}),arguments)},t.wbg.__wbg_call_ae78342adc33730a=function(){return to((function(e,t){return Oi(Di(e).call(Di(t)))}),arguments)},t.wbg.__wbg_new_36359baae5a47e27=function(){return Oi(new Object)},t.wbg.__wbg_call_3ed288a247f13ea5=function(){return to((function(e,t,r){return Oi(Di(e).call(Di(t),Di(r)))}),arguments)},t.wbg.__wbg_getTime_bffb1c09df09618b=function(e){return Di(e).getTime()},t.wbg.__wbg_new0_0ff7eb5c1486f3ec=function(){return Oi(new Date)},t.wbg.__wbg_new_37705eed627d5ed9=function(e,t){try{var r={a:e,b:t};return Oi(new Promise(I(((e,t)=>{const n=r.a;r.a=0;try{return no(n,r.b,e,t)}finally{r.a=n}}),"cb0")))}finally{r.a=r.b=0}},t.wbg.__wbg_resolve_a9a87bdd64e9e62c=function(e){return Oi(Promise.resolve(Di(e)))},t.wbg.__wbg_then_ce526c837d07b68f=function(e,t){return Oi(Di(e).then(Di(t)))},t.wbg.__wbg_then_842e65b843962f56=function(e,t,r){return Oi(Di(e).then(Di(t),Di(r)))},t.wbg.__wbg_self_99737b4dcdf6f0d8=function(){return to((function(){return Oi(self.self)}),arguments)},t.wbg.__wbg_window_9b61fbbf3564c4fb=function(){return to((function(){return Oi(window.window)}),arguments)},t.wbg.__wbg_globalThis_8e275ef40caea3a3=function(){return to((function(){return Oi(globalThis.globalThis)}),arguments)},t.wbg.__wbg_global_5de1e0f82bddcd27=function(){return to((function(){return Oi(global.global)}),arguments)},t.wbg.__wbg_buffer_7af23f65f6c64548=function(e){return Oi(Di(e).buffer)},t.wbg.__wbg_newwithbyteoffsetandlength_ce1e75f0ce5f7974=function(e,t,r){return Oi(new Uint8Array(Di(e),t>>>0,r>>>0))},t.wbg.__wbg_new_cc9018bd6f283b6f=function(e){return Oi(new Uint8Array(Di(e)))},t.wbg.__wbg_set_f25e869e4565d2a2=function(e,t,r){Di(e).set(Di(t),r>>>0)},t.wbg.__wbg_length_0acb1cf9bbaf8519=function(e){return Di(e).length},t.wbg.__wbg_newwithlength_8f0657faca9f1422=function(e){return Oi(new Uint8Array(e>>>0))},t.wbg.__wbg_subarray_da527dbd24eafb6b=function(e,t,r){return Oi(Di(e).subarray(t>>>0,r>>>0))},t.wbg.__wbg_has_ce995ec88636803d=function(){return to((function(e,t){return Reflect.has(Di(e),Di(t))}),arguments)},t.wbg.__wbg_set_93b1c87ee2af852e=function(){return to((function(e,t,r){return Reflect.set(Di(e),Di(t),Di(r))}),arguments)},t.wbg.__wbg_stringify_c760003feffcc1f2=function(){return to((function(e){return Oi(JSON.stringify(Di(e)))}),arguments)},t.wbg.__wbindgen_debug_string=function(e,t){const r=zi($i(Di(t)),Er.__wbindgen_malloc,Er.__wbindgen_realloc),n=Pi;Hi()[e/4+1]=n,Hi()[e/4+0]=r},t.wbg.__wbindgen_throw=function(e,t){throw new Error(Ni(e,t))},t.wbg.__wbindgen_memory=function(){return Oi(Er.memory)},t.wbg.__wbindgen_closure_wrapper10902=function(e,t,r){return Oi(Vi(e,t,3717,qi))},("string"==typeof e||"function"==typeof Request&&e instanceof Request||"function"==typeof URL&&e instanceof URL)&&(e=fetch(e));const{instance:r,module:n}=yield io(yield e,t);return Er=r.exports,oo.__wbindgen_wasm_module=n,Er}))}I(Hi,"getInt32Memory0"),I($i,"debugString"),I(Vi,"makeMutClosure"),I(qi,"__wbg_adapter_24"),I(Gi,"passArray8ToWasm0"),I(Yi,"generateEd25519KeyFromBytes"),I(Ji,"keyToDID"),I(Qi,"keyToVerificationMethod"),I(Wi,"issueCredential"),I(Xi,"verifyCredential"),I(Zi,"issuePresentation"),I(eo,"verifyPresentation"),I(to,"handleError"),I(ro,"getArrayU8FromWasm0"),I(no,"__wbg_adapter_108"),I(io,"load"),I(oo,"init");var so=oo,ao=!1,co=I(((e="https://cdn.filestackcontent.com/jXExSjNXSerFVDMIYOgy")=>z(void 0,null,(function*(){if(!ao)return ao=!0,so(e)}))),"init"),uo=R(K()),lo=R(K()),fo={};L(fo,{Any:()=>va,BaseBlock:()=>jo,BaseStringBlock:()=>Po,BitString:()=>cs,BmpString:()=>Ps,Boolean:()=>ts,CharacterString:()=>oa,Choice:()=>wa,Constructed:()=>Go,DATE:()=>da,DateTime:()=>ma,Duration:()=>ba,EndOfContent:()=>Wo,Enumerated:()=>gs,GeneralString:()=>na,GeneralizedTime:()=>ua,GraphicString:()=>Zs,HexBlock:()=>Co,IA5String:()=>Ws,Integer:()=>ms,Null:()=>Xo,NumericString:()=>Hs,ObjectIdentifier:()=>ws,OctetString:()=>is,Primitive:()=>zo,PrintableString:()=>Vs,RawData:()=>_a,RelativeObjectIdentifier:()=>Ms,Repeated:()=>Aa,Sequence:()=>ks,Set:()=>Ts,TIME:()=>ya,TeletexString:()=>Gs,TimeOfDay:()=>ha,UTCTime:()=>aa,UniversalString:()=>Ks,Utf8String:()=>Ds,ValueBlock:()=>Io,VideotexString:()=>Js,ViewWriter:()=>xo,VisibleString:()=>ta,compareSchema:()=>ka,fromBER:()=>Ho,verifySchema:()=>Ta});var ho=R(K());function po(e,t){let r=0;if(1===e.length)return e[0];for(let n=e.length-1;n>=0;n--)r+=e[e.length-1-n]*Math.pow(2,t*n);return r}function mo(e,t,r=-1){const n=r;let i=e,o=0,s=Math.pow(2,t);for(let r=1;r<8;r++){if(e<s){let e;if(n<0)e=new ArrayBuffer(r),o=r;else{if(n<r)return new ArrayBuffer(0);e=new ArrayBuffer(n),o=n}const s=new Uint8Array(e);for(let e=r-1;e>=0;e--){const r=Math.pow(2,e*t);s[o-e-1]=Math.floor(i/r),i-=s[o-e-1]*r}return e}s*=Math.pow(2,t)}return new ArrayBuffer(0)}function go(...e){let t=0,r=0;for(const r of e)t+=r.length;const n=new ArrayBuffer(t),i=new Uint8Array(n);for(const t of e)i.set(t,r),r+=t.length;return i}function bo(){const e=new Uint8Array(this.valueHex);if(this.valueHex.byteLength>=2){const t=255===e[0]&&128&e[1],r=0===e[0]&&0==(128&e[1]);(t||r)&&this.warnings.push("Needlessly long format")}const t=new ArrayBuffer(this.valueHex.byteLength),r=new Uint8Array(t);for(let e=0;e<this.valueHex.byteLength;e++)r[e]=0;r[0]=128&e[0];const n=po(r,8),i=new ArrayBuffer(this.valueHex.byteLength),o=new Uint8Array(i);for(let t=0;t<this.valueHex.byteLength;t++)o[t]=e[t];o[0]&=127;return po(o,8)-n}function yo(e){const t=e<0?-1*e:e;let r=128;for(let n=1;n<8;n++){if(t<=r){if(e<0){const e=mo(r-t,8,n);return new Uint8Array(e)[0]|=128,e}let i=mo(t,8,n),o=new Uint8Array(i);if(128&o[0]){const e=i.slice(0),t=new Uint8Array(e);i=new ArrayBuffer(i.byteLength+1),o=new Uint8Array(i);for(let r=0;r<e.byteLength;r++)o[r+1]=t[r];o[0]=0}return i}r*=Math.pow(2,8)}return new ArrayBuffer(0)}function vo(e,t){if(e.byteLength!==t.byteLength)return!1;const r=new Uint8Array(e),n=new Uint8Array(t);for(let e=0;e<r.length;e++)if(r[e]!==n[e])return!1;return!0}function wo(e,t){const r=e.toString(10);if(t<r.length)return"";const n=t-r.length,i=new Array(n);for(let e=0;e<n;e++)i[e]="0";return i.join("").concat(r)}function Ao(){if("undefined"==typeof BigInt)throw new Error("BigInt is not defined. Your environment doesn't implement BigInt.")}function Eo(e){let t=0,r=0;for(let r=0;r<e.length;r++){t+=e[r].byteLength}const n=new Uint8Array(t);for(let t=0;t<e.length;t++){const i=e[t];n.set(new Uint8Array(i),r),r+=i.byteLength}return n.buffer}function So(e,t,r,n){return t instanceof Uint8Array?t.byteLength?r<0?(e.error="Wrong parameter: inputOffset less than zero",!1):n<0?(e.error="Wrong parameter: inputLength less than zero",!1):!(t.byteLength-r-n<0)||(e.error="End of input reached before message was fully decoded (inconsistent offset and length values)",!1):(e.error="Wrong parameter: inputBuffer has zero length",!1):(e.error="Wrong parameter: inputBuffer must be 'Uint8Array'",!1)}I(po,"utilFromBase"),I(mo,"utilToBase"),I(go,"utilConcatView"),I(bo,"utilDecodeTC"),I(yo,"utilEncodeTC"),I(vo,"isEqualBuffer"),I(wo,"padNumber"),I(Ao,"assertBigInt"),I(Eo,"concat"),I(So,"checkBufferParams");var xo=class{constructor(){this.items=[]}write(e){this.items.push(e)}final(){return Eo(this.items)}};I(xo,"ViewWriter");var Mo=[new Uint8Array([1])],_o="",ko=new ArrayBuffer(0),To=new Uint8Array(0);function Co(e){var t;return(t=I(class extends e{constructor(...e){var t;super(...e);const r=e[0]||{};this.isHexOnly=null!==(t=r.isHexOnly)&&void 0!==t&&t,this.valueHexView=r.valueHex?ho.BufferSourceConverter.toUint8Array(r.valueHex):To}get valueHex(){return this.valueHexView.slice().buffer}set valueHex(e){this.valueHexView=new Uint8Array(e)}fromBER(e,t,r){const n=e instanceof ArrayBuffer?new Uint8Array(e):e;if(!So(this,n,t,r))return-1;const i=t+r;return this.valueHexView=n.subarray(t,i),this.valueHexView.length?(this.blockLength=r,i):(this.warnings.push("Zero buffer length"),t)}toBER(e=!1){return this.isHexOnly?e?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.byteLength===this.valueHexView.buffer.byteLength?this.valueHexView.buffer:this.valueHexView.slice().buffer:(this.error="Flag 'isHexOnly' is not set, abort",ko)}toJSON(){return N(C({},super.toJSON()),{isHexOnly:this.isHexOnly,valueHex:ho.Convert.ToHex(this.valueHexView)})}},"Some")).NAME="hexBlock",t}I(Co,"HexBlock");var No=class{constructor({blockLength:e=0,error:t=_o,warnings:r=[],valueBeforeDecode:n=To}={}){this.blockLength=e,this.error=t,this.warnings=r,this.valueBeforeDecodeView=ho.BufferSourceConverter.toUint8Array(n)}static blockName(){return this.NAME}get valueBeforeDecode(){return this.valueBeforeDecodeView.slice().buffer}set valueBeforeDecode(e){this.valueBeforeDecodeView=new Uint8Array(e)}toJSON(){return{blockName:this.constructor.NAME,blockLength:this.blockLength,error:this.error,warnings:this.warnings,valueBeforeDecode:ho.Convert.ToHex(this.valueBeforeDecodeView)}}};I(No,"LocalBaseBlock"),No.NAME="baseBlock";var Io=class extends No{fromBER(e,t,r){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}toBER(e,t){throw TypeError("User need to make a specific function in a class which extends 'ValueBlock'")}};I(Io,"ValueBlock"),Io.NAME="valueBlock";var Bo=class extends(Co(No)){constructor({idBlock:e={}}={}){var t,r,n,i;super(),e?(this.isHexOnly=null!==(t=e.isHexOnly)&&void 0!==t&&t,this.valueHexView=e.valueHex?ho.BufferSourceConverter.toUint8Array(e.valueHex):To,this.tagClass=null!==(r=e.tagClass)&&void 0!==r?r:-1,this.tagNumber=null!==(n=e.tagNumber)&&void 0!==n?n:-1,this.isConstructed=null!==(i=e.isConstructed)&&void 0!==i&&i):(this.tagClass=-1,this.tagNumber=-1,this.isConstructed=!1)}toBER(e=!1){let t=0;switch(this.tagClass){case 1:t|=0;break;case 2:t|=64;break;case 3:t|=128;break;case 4:t|=192;break;default:return this.error="Unknown tag class",ko}if(this.isConstructed&&(t|=32),this.tagNumber<31&&!this.isHexOnly){const r=new Uint8Array(1);if(!e){let e=this.tagNumber;e&=31,t|=e,r[0]=t}return r.buffer}if(!this.isHexOnly){const r=mo(this.tagNumber,7),n=new Uint8Array(r),i=r.byteLength,o=new Uint8Array(i+1);if(o[0]=31|t,!e){for(let e=0;e<i-1;e++)o[e+1]=128|n[e];o[i]=n[i-1]}return o.buffer}const r=new Uint8Array(this.valueHexView.byteLength+1);if(r[0]=31|t,!e){const e=this.valueHexView;for(let t=0;t<e.length-1;t++)r[t+1]=128|e[t];r[this.valueHexView.byteLength]=e[e.length-1]}return r.buffer}fromBER(e,t,r){const n=ho.BufferSourceConverter.toUint8Array(e);if(!So(this,n,t,r))return-1;const i=n.subarray(t,t+r);if(0===i.length)return this.error="Zero buffer length",-1;switch(192&i[0]){case 0:this.tagClass=1;break;case 64:this.tagClass=2;break;case 128:this.tagClass=3;break;case 192:this.tagClass=4;break;default:return this.error="Unknown tag class",-1}this.isConstructed=32==(32&i[0]),this.isHexOnly=!1;const o=31&i[0];if(31!==o)this.tagNumber=o,this.blockLength=1;else{let e=1,t=this.valueHexView=new Uint8Array(255),r=255;for(;128&i[e];){if(t[e-1]=127&i[e],e++,e>=i.length)return this.error="End of input reached before message was fully decoded",-1;if(e===r){r+=255;const e=new Uint8Array(r);for(let r=0;r<t.length;r++)e[r]=t[r];t=this.valueHexView=new Uint8Array(r)}}this.blockLength=e+1,t[e-1]=127&i[e];const n=new Uint8Array(e);for(let r=0;r<e;r++)n[r]=t[r];t=this.valueHexView=new Uint8Array(e),t.set(n),this.blockLength<=9?this.tagNumber=po(t,7):(this.isHexOnly=!0,this.warnings.push("Tag too long, represented as hex-coded"))}if(1===this.tagClass&&this.isConstructed)switch(this.tagNumber){case 1:case 2:case 5:case 6:case 9:case 13:case 14:case 23:case 24:case 31:case 32:case 33:case 34:return this.error="Constructed encoding used for primitive type",-1}return t+this.blockLength}toJSON(){return N(C({},super.toJSON()),{tagClass:this.tagClass,tagNumber:this.tagNumber,isConstructed:this.isConstructed})}};I(Bo,"LocalIdentificationBlock"),Bo.NAME="identificationBlock";var Oo=class extends No{constructor({lenBlock:e={}}={}){var t,r,n;super(),this.isIndefiniteForm=null!==(t=e.isIndefiniteForm)&&void 0!==t&&t,this.longFormUsed=null!==(r=e.longFormUsed)&&void 0!==r&&r,this.length=null!==(n=e.length)&&void 0!==n?n:0}fromBER(e,t,r){const n=ho.BufferSourceConverter.toUint8Array(e);if(!So(this,n,t,r))return-1;const i=n.subarray(t,t+r);if(0===i.length)return this.error="Zero buffer length",-1;if(255===i[0])return this.error="Length block 0xFF is reserved by standard",-1;if(this.isIndefiniteForm=128===i[0],this.isIndefiniteForm)return this.blockLength=1,t+this.blockLength;if(this.longFormUsed=!!(128&i[0]),!1===this.longFormUsed)return this.length=i[0],this.blockLength=1,t+this.blockLength;const o=127&i[0];if(o>8)return this.error="Too big integer",-1;if(o+1>i.length)return this.error="End of input reached before message was fully decoded",-1;const s=t+1,a=n.subarray(s,s+o);return 0===a[o-1]&&this.warnings.push("Needlessly long encoded length"),this.length=po(a,8),this.longFormUsed&&this.length<=127&&this.warnings.push("Unnecessary usage of long length form"),this.blockLength=o+1,t+this.blockLength}toBER(e=!1){let t,r;if(this.length>127&&(this.longFormUsed=!0),this.isIndefiniteForm)return t=new ArrayBuffer(1),!1===e&&(r=new Uint8Array(t),r[0]=128),t;if(this.longFormUsed){const n=mo(this.length,8);if(n.byteLength>127)return this.error="Too big length",ko;if(t=new ArrayBuffer(n.byteLength+1),e)return t;const i=new Uint8Array(n);r=new Uint8Array(t),r[0]=128|n.byteLength;for(let e=0;e<n.byteLength;e++)r[e+1]=i[e];return t}return t=new ArrayBuffer(1),!1===e&&(r=new Uint8Array(t),r[0]=this.length),t}toJSON(){return N(C({},super.toJSON()),{isIndefiniteForm:this.isIndefiniteForm,longFormUsed:this.longFormUsed,length:this.length})}};I(Oo,"LocalLengthBlock"),Oo.NAME="lengthBlock";var Do={},jo=class extends No{constructor(e={},t){var r=e,{name:n=_o,optional:i=!1,primitiveSchema:o}=r,s=O(r,["name","optional","primitiveSchema"]);super(s),this.name=n,this.optional=i,o&&(this.primitiveSchema=o),this.idBlock=new Bo(s),this.lenBlock=new Oo(s),this.valueBlock=t?new t(s):new Io(s)}fromBER(e,t,r){const n=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?r:this.lenBlock.length);return-1===n?(this.error=this.valueBlock.error,n):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),n)}toBER(e,t){const r=t||new xo;t||Lo(this);const n=this.idBlock.toBER(e);if(r.write(n),this.lenBlock.isIndefiniteForm)r.write(new Uint8Array([128]).buffer),this.valueBlock.toBER(e,r),r.write(new ArrayBuffer(2));else{const t=this.valueBlock.toBER(e);this.lenBlock.length=t.byteLength;const n=this.lenBlock.toBER(e);r.write(n),r.write(t)}return t?ko:r.final()}toJSON(){const e=N(C({},super.toJSON()),{idBlock:this.idBlock.toJSON(),lenBlock:this.lenBlock.toJSON(),valueBlock:this.valueBlock.toJSON(),name:this.name,optional:this.optional});return this.primitiveSchema&&(e.primitiveSchema=this.primitiveSchema.toJSON()),e}toString(e="ascii"){return"ascii"===e?this.onAsciiEncoding():ho.Convert.ToHex(this.toBER())}onAsciiEncoding(){return`${this.constructor.NAME} : ${ho.Convert.ToHex(this.valueBlock.valueBeforeDecodeView)}`}isEqual(e){if(this===e)return!0;if(!(e instanceof this.constructor))return!1;return vo(this.toBER(),e.toBER())}};function Lo(e){if(e instanceof Do.Constructed)for(const t of e.valueBlock.value)Lo(t)&&(e.lenBlock.isIndefiniteForm=!0);return!!e.lenBlock.isIndefiniteForm}I(jo,"BaseBlock"),jo.NAME="BaseBlock",I(Lo,"prepareIndefiniteForm");var Po=class extends jo{constructor(e={},t){var r=e,{value:n=_o}=r;super(O(r,["value"]),t),n&&this.fromString(n)}getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}fromBER(e,t,r){const n=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?r:this.lenBlock.length);return-1===n?(this.error=this.valueBlock.error,n):(this.fromBuffer(this.valueBlock.valueHexView),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),n)}onAsciiEncoding(){return`${this.constructor.NAME} : '${this.valueBlock.value}'`}};I(Po,"BaseStringBlock"),Po.NAME="BaseStringBlock";var Ro,Uo=class extends(Co(Io)){constructor(e={}){var t=e,{isHexOnly:r=!0}=t;super(O(t,["isHexOnly"])),this.isHexOnly=r}};I(Uo,"LocalPrimitiveValueBlock"),Uo.NAME="PrimitiveValueBlock";var zo=class extends jo{constructor(e={}){super(e,Uo),this.idBlock.isConstructed=!1}};function Ko(e,t){if(e instanceof t)return e;const r=new t;return r.idBlock=e.idBlock,r.lenBlock=e.lenBlock,r.warnings=e.warnings,r.valueBeforeDecodeView=e.valueBeforeDecodeView,r}function Fo(e,t=0,r=e.length){const n=t;let i=new jo({},Io);const o=new No;if(!So(o,e,t,r))return i.error=o.error,{offset:-1,result:i};if(!e.subarray(t,t+r).length)return i.error="Zero buffer length",{offset:-1,result:i};let s=i.idBlock.fromBER(e,t,r);if(i.idBlock.warnings.length&&i.warnings.concat(i.idBlock.warnings),-1===s)return i.error=i.idBlock.error,{offset:-1,result:i};if(t=s,r-=i.idBlock.blockLength,s=i.lenBlock.fromBER(e,t,r),i.lenBlock.warnings.length&&i.warnings.concat(i.lenBlock.warnings),-1===s)return i.error=i.lenBlock.error,{offset:-1,result:i};if(t=s,r-=i.lenBlock.blockLength,!i.idBlock.isConstructed&&i.lenBlock.isIndefiniteForm)return i.error="Indefinite length form used for primitive encoding form",{offset:-1,result:i};let a=jo;if(1===i.idBlock.tagClass){if(i.idBlock.tagNumber>=37&&!1===i.idBlock.isHexOnly)return i.error="UNIVERSAL 37 and upper tags are reserved by ASN.1 standard",{offset:-1,result:i};switch(i.idBlock.tagNumber){case 0:if(i.idBlock.isConstructed&&i.lenBlock.length>0)return i.error="Type [UNIVERSAL 0] is reserved",{offset:-1,result:i};a=Do.EndOfContent;break;case 1:a=Do.Boolean;break;case 2:a=Do.Integer;break;case 3:a=Do.BitString;break;case 4:a=Do.OctetString;break;case 5:a=Do.Null;break;case 6:a=Do.ObjectIdentifier;break;case 10:a=Do.Enumerated;break;case 12:a=Do.Utf8String;break;case 13:a=Do.RelativeObjectIdentifier;break;case 14:a=Do.TIME;break;case 15:return i.error="[UNIVERSAL 15] is reserved by ASN.1 standard",{offset:-1,result:i};case 16:a=Do.Sequence;break;case 17:a=Do.Set;break;case 18:a=Do.NumericString;break;case 19:a=Do.PrintableString;break;case 20:a=Do.TeletexString;break;case 21:a=Do.VideotexString;break;case 22:a=Do.IA5String;break;case 23:a=Do.UTCTime;break;case 24:a=Do.GeneralizedTime;break;case 25:a=Do.GraphicString;break;case 26:a=Do.VisibleString;break;case 27:a=Do.GeneralString;break;case 28:a=Do.UniversalString;break;case 29:a=Do.CharacterString;break;case 30:a=Do.BmpString;break;case 31:a=Do.DATE;break;case 32:a=Do.TimeOfDay;break;case 33:a=Do.DateTime;break;case 34:a=Do.Duration;break;default:{const e=i.idBlock.isConstructed?new Do.Constructed:new Do.Primitive;e.idBlock=i.idBlock,e.lenBlock=i.lenBlock,e.warnings=i.warnings,i=e}}}else a=i.idBlock.isConstructed?Do.Constructed:Do.Primitive;return i=Ko(i,a),s=i.fromBER(e,t,i.lenBlock.isIndefiniteForm?r:i.lenBlock.length),i.valueBeforeDecodeView=e.subarray(n,n+i.blockLength),{offset:s,result:i}}function Ho(e){if(!e.byteLength){const e=new jo({},Io);return e.error="Input buffer has zero length",{offset:-1,result:e}}return Fo(ho.BufferSourceConverter.toUint8Array(e).slice(),0,e.byteLength)}function $o(e,t){return e?1:t}I(zo,"Primitive"),Ro=zo,Do.Primitive=Ro,zo.NAME="PRIMITIVE",I(Ko,"localChangeType"),I(Fo,"localFromBER"),I(Ho,"fromBER"),I($o,"checkLen");var Vo,qo=class extends Io{constructor(e={}){var t=e,{value:r=[],isIndefiniteForm:n=!1}=t;super(O(t,["value","isIndefiniteForm"])),this.value=r,this.isIndefiniteForm=n}fromBER(e,t,r){const n=ho.BufferSourceConverter.toUint8Array(e);if(!So(this,n,t,r))return-1;if(this.valueBeforeDecodeView=n.subarray(t,t+r),0===this.valueBeforeDecodeView.length)return this.warnings.push("Zero buffer length"),t;let i=t;for(;$o(this.isIndefiniteForm,r)>0;){const e=Fo(n,i,r);if(-1===e.offset)return this.error=e.result.error,this.warnings.concat(e.result.warnings),-1;if(i=e.offset,this.blockLength+=e.result.blockLength,r-=e.result.blockLength,this.value.push(e.result),this.isIndefiniteForm&&"EndOfContent"===e.result.constructor.NAME)break}return this.isIndefiniteForm&&("EndOfContent"===this.value[this.value.length-1].constructor.NAME?this.value.pop():this.warnings.push("No EndOfContent block encoded")),i}toBER(e,t){const r=t||new xo;for(let t=0;t<this.value.length;t++)this.value[t].toBER(e,r);return t?ko:r.final()}toJSON(){const e=N(C({},super.toJSON()),{isIndefiniteForm:this.isIndefiniteForm,value:[]});for(const t of this.value)e.value.push(t.toJSON());return e}};I(qo,"LocalConstructedValueBlock"),qo.NAME="ConstructedValueBlock";var Go=class extends jo{constructor(e={}){super(e,qo),this.idBlock.isConstructed=!0}fromBER(e,t,r){this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm;const n=this.valueBlock.fromBER(e,t,this.lenBlock.isIndefiniteForm?r:this.lenBlock.length);return-1===n?(this.error=this.valueBlock.error,n):(this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.valueBlock.error.length||(this.blockLength+=this.valueBlock.blockLength),n)}onAsciiEncoding(){const e=[];for(const t of this.valueBlock.value)e.push(t.toString("ascii").split("\n").map((e=>` ${e}`)).join("\n"));const t=3===this.idBlock.tagClass?`[${this.idBlock.tagNumber}]`:this.constructor.NAME;return e.length?`${t} :\n${e.join("\n")}`:`${t} :`}};I(Go,"Constructed"),Vo=Go,Do.Constructed=Vo,Go.NAME="CONSTRUCTED";var Yo,Jo=class extends Io{fromBER(e,t,r){return t}toBER(e){return ko}};I(Jo,"LocalEndOfContentValueBlock"),Jo.override="EndOfContentValueBlock";var Qo,Wo=class extends jo{constructor(e={}){super(e,Jo),this.idBlock.tagClass=1,this.idBlock.tagNumber=0}};I(Wo,"EndOfContent"),Yo=Wo,Do.EndOfContent=Yo,Wo.NAME="EndOfContent";var Xo=class extends jo{constructor(e={}){super(e,Io),this.idBlock.tagClass=1,this.idBlock.tagNumber=5}fromBER(e,t,r){return this.lenBlock.length>0&&this.warnings.push("Non-zero length of value block for Null type"),this.idBlock.error.length||(this.blockLength+=this.idBlock.blockLength),this.lenBlock.error.length||(this.blockLength+=this.lenBlock.blockLength),this.blockLength+=r,t+r>e.byteLength?(this.error="End of input reached before message was fully decoded (inconsistent offset and length values)",-1):t+r}toBER(e,t){const r=new ArrayBuffer(2);if(!e){const e=new Uint8Array(r);e[0]=5,e[1]=0}return t&&t.write(r),r}onAsciiEncoding(){return`${this.constructor.NAME}`}};I(Xo,"Null"),Qo=Xo,Do.Null=Qo,Xo.NAME="NULL";var Zo,es=class extends(Co(Io)){constructor(e={}){var t=e,{value:r}=t,n=O(t,["value"]);super(n),n.valueHex?this.valueHexView=ho.BufferSourceConverter.toUint8Array(n.valueHex):this.valueHexView=new Uint8Array(1),r&&(this.value=r)}get value(){for(const e of this.valueHexView)if(e>0)return!0;return!1}set value(e){this.valueHexView[0]=e?255:0}fromBER(e,t,r){const n=ho.BufferSourceConverter.toUint8Array(e);return So(this,n,t,r)?(this.valueHexView=n.subarray(t,t+r),r>1&&this.warnings.push("Boolean value encoded in more then 1 octet"),this.isHexOnly=!0,bo.call(this),this.blockLength=r,t+r):-1}toBER(){return this.valueHexView.slice()}toJSON(){return N(C({},super.toJSON()),{value:this.value})}};I(es,"LocalBooleanValueBlock"),es.NAME="BooleanValueBlock";var ts=class extends jo{constructor(e={}){super(e,es),this.idBlock.tagClass=1,this.idBlock.tagNumber=1}getValue(){return this.valueBlock.value}setValue(e){this.valueBlock.value=e}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.getValue}`}};I(ts,"Boolean"),Zo=ts,Do.Boolean=Zo,ts.NAME="BOOLEAN";var rs,ns=class extends(Co(qo)){constructor(e={}){var t=e,{isConstructed:r=!1}=t;super(O(t,["isConstructed"])),this.isConstructed=r}fromBER(e,t,r){let n=0;if(this.isConstructed){if(this.isHexOnly=!1,n=qo.prototype.fromBER.call(this,e,t,r),-1===n)return n;for(let e=0;e<this.value.length;e++){const t=this.value[e].constructor.NAME;if("EndOfContent"===t){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, OCTET STRING may consists of OCTET STRINGs only",-1}if("OCTET STRING"!==t)return this.error="OCTET STRING may consists of OCTET STRINGs only",-1}}else this.isHexOnly=!0,n=super.fromBER(e,t,r),this.blockLength=r;return n}toBER(e,t){return this.isConstructed?qo.prototype.toBER.call(this,e,t):e?new ArrayBuffer(this.valueHexView.byteLength):this.valueHexView.slice().buffer}toJSON(){return N(C({},super.toJSON()),{isConstructed:this.isConstructed})}};I(ns,"LocalOctetStringValueBlock"),ns.NAME="OctetStringValueBlock";var is=class extends jo{constructor(e={}){var t,r,n=e,{idBlock:i={},lenBlock:o={}}=n,s=O(n,["idBlock","lenBlock"]);null!==(t=s.isConstructed)&&void 0!==t||(s.isConstructed=!!(null===(r=s.value)||void 0===r?void 0:r.length)),super(C({idBlock:C({isConstructed:s.isConstructed},i),lenBlock:N(C({},o),{isIndefiniteForm:!!s.isIndefiniteForm})},s),ns),this.idBlock.tagClass=1,this.idBlock.tagNumber=4}fromBER(e,t,r){if(this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,0===r)return 0===this.idBlock.error.length&&(this.blockLength+=this.idBlock.blockLength),0===this.lenBlock.error.length&&(this.blockLength+=this.lenBlock.blockLength),t;if(!this.valueBlock.isConstructed){const n=(e instanceof ArrayBuffer?new Uint8Array(e):e).subarray(t,t+r);try{if(n.byteLength){const e=Fo(n,0,n.byteLength);-1!==e.offset&&e.offset===r&&(this.valueBlock.value=[e.result])}}catch(e){}}return super.fromBER(e,t,r)}onAsciiEncoding(){return this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length?Go.prototype.onAsciiEncoding.call(this):`${this.constructor.NAME} : ${ho.Convert.ToHex(this.valueBlock.valueHexView)}`}getValue(){if(!this.idBlock.isConstructed)return this.valueBlock.valueHexView.slice().buffer;const e=[];for(const t of this.valueBlock.value)t instanceof is&&e.push(t.valueBlock.valueHexView);return ho.BufferSourceConverter.concat(e)}};I(is,"OctetString"),rs=is,Do.OctetString=rs,is.NAME="OCTET STRING";var os,ss=class extends(Co(qo)){constructor(e={}){var t=e,{unusedBits:r=0,isConstructed:n=!1}=t;super(O(t,["unusedBits","isConstructed"])),this.unusedBits=r,this.isConstructed=n,this.blockLength=this.valueHexView.byteLength}fromBER(e,t,r){if(!r)return t;let n=-1;if(this.isConstructed){if(n=qo.prototype.fromBER.call(this,e,t,r),-1===n)return n;for(const e of this.value){const t=e.constructor.NAME;if("EndOfContent"===t){if(this.isIndefiniteForm)break;return this.error="EndOfContent is unexpected, BIT STRING may consists of BIT STRINGs only",-1}if("BIT STRING"!==t)return this.error="BIT STRING may consists of BIT STRINGs only",-1;const r=e.valueBlock;if(this.unusedBits>0&&r.unusedBits>0)return this.error='Using of "unused bits" inside constructive BIT STRING allowed for least one only',-1;this.unusedBits=r.unusedBits}return n}const i=ho.BufferSourceConverter.toUint8Array(e);if(!So(this,i,t,r))return-1;const o=i.subarray(t,t+r);if(this.unusedBits=o[0],this.unusedBits>7)return this.error="Unused bits for BitString must be in range 0-7",-1;if(!this.unusedBits){const e=o.subarray(1);try{if(e.byteLength){const t=Fo(e,0,e.byteLength);-1!==t.offset&&t.offset===r-1&&(this.value=[t.result])}}catch(e){}}return this.valueHexView=o.subarray(1),this.blockLength=o.length,t+r}toBER(e,t){if(this.isConstructed)return qo.prototype.toBER.call(this,e,t);if(e)return new ArrayBuffer(this.valueHexView.byteLength+1);if(!this.valueHexView.byteLength)return ko;const r=new Uint8Array(this.valueHexView.length+1);return r[0]=this.unusedBits,r.set(this.valueHexView,1),r.buffer}toJSON(){return N(C({},super.toJSON()),{unusedBits:this.unusedBits,isConstructed:this.isConstructed})}};I(ss,"LocalBitStringValueBlock"),ss.NAME="BitStringValueBlock";var as,cs=class extends jo{constructor(e={}){var t,r,n=e,{idBlock:i={},lenBlock:o={}}=n,s=O(n,["idBlock","lenBlock"]);null!==(t=s.isConstructed)&&void 0!==t||(s.isConstructed=!!(null===(r=s.value)||void 0===r?void 0:r.length)),super(C({idBlock:C({isConstructed:s.isConstructed},i),lenBlock:N(C({},o),{isIndefiniteForm:!!s.isIndefiniteForm})},s),ss),this.idBlock.tagClass=1,this.idBlock.tagNumber=3}fromBER(e,t,r){return this.valueBlock.isConstructed=this.idBlock.isConstructed,this.valueBlock.isIndefiniteForm=this.lenBlock.isIndefiniteForm,super.fromBER(e,t,r)}onAsciiEncoding(){if(this.valueBlock.isConstructed||this.valueBlock.value&&this.valueBlock.value.length)return Go.prototype.onAsciiEncoding.call(this);{const e=[],t=this.valueBlock.valueHexView;for(const r of t)e.push(r.toString(2).padStart(8,"0"));const r=e.join("");return`${this.constructor.NAME} : ${r.substring(0,r.length-this.valueBlock.unusedBits)}`}}};function us(e,t){const r=new Uint8Array([0]),n=new Uint8Array(e),i=new Uint8Array(t);let o=n.slice(0);const s=o.length-1,a=i.slice(0),c=a.length-1;let u=0;let l=0;for(let e=c<s?s:c;e>=0;e--,l++){if(!0==l<a.length)u=o[s-l]+a[c-l]+r[0];else u=o[s-l]+r[0];if(r[0]=u/10,!0==l>=o.length)o=go(new Uint8Array([u%10]),o);else o[s-l]=u%10}return r[0]>0&&(o=go(r,o)),o}function ls(e){if(e>=Mo.length)for(let t=Mo.length;t<=e;t++){const e=new Uint8Array([0]);let r=Mo[t-1].slice(0);for(let t=r.length-1;t>=0;t--){const n=new Uint8Array([(r[t]<<1)+e[0]]);e[0]=n[0]/10,r[t]=n[0]%10}e[0]>0&&(r=go(e,r)),Mo.push(r)}return Mo[e]}function ds(e,t){let r=0;const n=new Uint8Array(e),i=new Uint8Array(t),o=n.slice(0),s=o.length-1,a=i.slice(0),c=a.length-1;let u,l=0;for(let e=c;e>=0;e--,l++)if(u=o[s-l]-a[c-l]-r,!0==u<0)r=1,o[s-l]=u+10;else r=0,o[s-l]=u;if(r>0)for(let e=s-c+1;e>=0;e--,l++){if(u=o[s-l]-r,!(u<0)){r=0,o[s-l]=u;break}r=1,o[s-l]=u+10}return o.slice()}I(cs,"BitString"),os=cs,Do.BitString=os,cs.NAME="BIT STRING",I(us,"viewAdd"),I(ls,"power2"),I(ds,"viewSub");var fs,hs=class extends(Co(Io)){constructor(e={}){var t=e,{value:r}=t,n=O(t,["value"]);super(n),this._valueDec=0,n.valueHex&&this.setValueHex(),void 0!==r&&(this.valueDec=r)}setValueHex(){this.valueHexView.length>=4?(this.warnings.push("Too big Integer for decoding, hex only"),this.isHexOnly=!0,this._valueDec=0):(this.isHexOnly=!1,this.valueHexView.length>0&&(this._valueDec=bo.call(this)))}set valueDec(e){this._valueDec=e,this.isHexOnly=!1,this.valueHexView=new Uint8Array(yo(e))}get valueDec(){return this._valueDec}fromDER(e,t,r,n=0){const i=this.fromBER(e,t,r);if(-1===i)return i;const o=this.valueHexView;return 0===o[0]&&0!=(128&o[1])?this.valueHexView=o.subarray(1):0!==n&&o.length<n&&(n-o.length>1&&(n=o.length+1),this.valueHexView=o.subarray(n-o.length)),i}toDER(e=!1){const t=this.valueHexView;switch(!0){case 0!=(128&t[0]):{const e=new Uint8Array(this.valueHexView.length+1);e[0]=0,e.set(t,1),this.valueHexView=e}break;case 0===t[0]&&0==(128&t[1]):this.valueHexView=this.valueHexView.subarray(1)}return this.toBER(e)}fromBER(e,t,r){const n=super.fromBER(e,t,r);return-1===n||this.setValueHex(),n}toBER(e){return e?new ArrayBuffer(this.valueHexView.length):this.valueHexView.slice().buffer}toJSON(){return N(C({},super.toJSON()),{valueDec:this.valueDec})}toString(){const e=8*this.valueHexView.length-1;let t,r=new Uint8Array(8*this.valueHexView.length/3),n=0;const i=this.valueHexView;let o="",s=!1;for(let s=i.byteLength-1;s>=0;s--){t=i[s];for(let i=0;i<8;i++){if(1==(1&t))if(n===e)r=ds(ls(n),r),o="-";else r=us(r,ls(n));n++,t>>=1}}for(let e=0;e<r.length;e++)r[e]&&(s=!0),s&&(o+="0123456789".charAt(r[e]));return!1===s&&(o+="0123456789".charAt(0)),o}};I(hs,"LocalIntegerValueBlock"),as=hs,hs.NAME="IntegerValueBlock",Object.defineProperty(as.prototype,"valueHex",{set:function(e){this.valueHexView=new Uint8Array(e),this.setValueHex()},get:function(){return this.valueHexView.slice().buffer}});var ps,ms=class extends jo{constructor(e={}){super(e,hs),this.idBlock.tagClass=1,this.idBlock.tagNumber=2}toBigInt(){return Ao(),BigInt(this.valueBlock.toString())}static fromBigInt(e){Ao();const t=BigInt(e),r=new xo,n=t.toString(16).replace(/^-/,""),i=new Uint8Array(ho.Convert.FromHex(n));if(t<0){const e=new Uint8Array(i.length+(128&i[0]?1:0));e[0]|=128;const n=BigInt(`0x${ho.Convert.ToHex(e)}`)+t,o=ho.BufferSourceConverter.toUint8Array(ho.Convert.FromHex(n.toString(16)));o[0]|=128,r.write(o)}else 128&i[0]&&r.write(new Uint8Array([0])),r.write(i);return new ms({valueHex:r.final()})}convertToDER(){const e=new ms({valueHex:this.valueBlock.valueHexView});return e.valueBlock.toDER(),e}convertFromDER(){return new ms({valueHex:0===this.valueBlock.valueHexView[0]?this.valueBlock.valueHexView.subarray(1):this.valueBlock.valueHexView})}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()}`}};I(ms,"Integer"),fs=ms,Do.Integer=fs,ms.NAME="INTEGER";var gs=class extends ms{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=10}};I(gs,"Enumerated"),ps=gs,Do.Enumerated=ps,gs.NAME="ENUMERATED";var bs=class extends(Co(Io)){constructor(e={}){var t=e,{valueDec:r=-1,isFirstSid:n=!1}=t;super(O(t,["valueDec","isFirstSid"])),this.valueDec=r,this.isFirstSid=n}fromBER(e,t,r){if(!r)return t;const n=ho.BufferSourceConverter.toUint8Array(e);if(!So(this,n,t,r))return-1;const i=n.subarray(t,t+r);this.valueHexView=new Uint8Array(r);for(let e=0;e<r&&(this.valueHexView[e]=127&i[e],this.blockLength++,0!=(128&i[e]));e++);const o=new Uint8Array(this.blockLength);for(let e=0;e<this.blockLength;e++)o[e]=this.valueHexView[e];return this.valueHexView=o,0!=(128&i[this.blockLength-1])?(this.error="End of input reached before message was fully decoded",-1):(0===this.valueHexView[0]&&this.warnings.push("Needlessly long format of SID encoding"),this.blockLength<=8?this.valueDec=po(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),t+this.blockLength)}set valueBigInt(e){Ao();let t=BigInt(e).toString(2);for(;t.length%7;)t="0"+t;const r=new Uint8Array(t.length/7);for(let e=0;e<r.length;e++)r[e]=parseInt(t.slice(7*e,7*e+7),2)+(e+1<r.length?128:0);this.fromBER(r.buffer,0,r.length)}toBER(e){if(this.isHexOnly){if(e)return new ArrayBuffer(this.valueHexView.byteLength);const t=this.valueHexView,r=new Uint8Array(this.blockLength);for(let e=0;e<this.blockLength-1;e++)r[e]=128|t[e];return r[this.blockLength-1]=t[this.blockLength-1],r.buffer}const t=mo(this.valueDec,7);if(0===t.byteLength)return this.error="Error during encoding SID value",ko;const r=new Uint8Array(t.byteLength);if(!e){const e=new Uint8Array(t),n=t.byteLength-1;for(let t=0;t<n;t++)r[t]=128|e[t];r[n]=e[n]}return r}toString(){let e="";if(this.isHexOnly)e=ho.Convert.ToHex(this.valueHexView);else if(this.isFirstSid){let t=this.valueDec;this.valueDec<=39?e="0.":this.valueDec<=79?(e="1.",t-=40):(e="2.",t-=80),e+=t.toString()}else e=this.valueDec.toString();return e}toJSON(){return N(C({},super.toJSON()),{valueDec:this.valueDec,isFirstSid:this.isFirstSid})}};I(bs,"LocalSidValueBlock"),bs.NAME="sidBlock";var ys,vs=class extends Io{constructor(e={}){var t=e,{value:r=_o}=t;super(O(t,["value"])),this.value=[],r&&this.fromString(r)}fromBER(e,t,r){let n=t;for(;r>0;){const t=new bs;if(n=t.fromBER(e,n,r),-1===n)return this.blockLength=0,this.error=t.error,n;0===this.value.length&&(t.isFirstSid=!0),this.blockLength+=t.blockLength,r-=t.blockLength,this.value.push(t)}return n}toBER(e){const t=[];for(let r=0;r<this.value.length;r++){const n=this.value[r].toBER(e);if(0===n.byteLength)return this.error=this.value[r].error,ko;t.push(n)}return Eo(t)}fromString(e){this.value=[];let t=0,r=0,n="",i=!1;do{if(r=e.indexOf(".",t),n=-1===r?e.substring(t):e.substring(t,r),t=r+1,i){const e=this.value[0];let t=0;switch(e.valueDec){case 0:break;case 1:t=40;break;case 2:t=80;break;default:return void(this.value=[])}const r=parseInt(n,10);if(isNaN(r))return;e.valueDec=r+t,i=!1}else{const e=new bs;if(n>Number.MAX_SAFE_INTEGER){Ao();const t=BigInt(n);e.valueBigInt=t}else if(e.valueDec=parseInt(n,10),isNaN(e.valueDec))return;this.value.length||(e.isFirstSid=!0,i=!0),this.value.push(e)}}while(-1!==r)}toString(){let e="",t=!1;for(let r=0;r<this.value.length;r++){t=this.value[r].isHexOnly;let n=this.value[r].toString();0!==r&&(e=`${e}.`),t?(n=`{${n}}`,this.value[r].isFirstSid?e=`2.{${n} - 80}`:e+=n):e+=n}return e}toJSON(){const e=N(C({},super.toJSON()),{value:this.toString(),sidArray:[]});for(let t=0;t<this.value.length;t++)e.sidArray.push(this.value[t].toJSON());return e}};I(vs,"LocalObjectIdentifierValueBlock"),vs.NAME="ObjectIdentifierValueBlock";var ws=class extends jo{constructor(e={}){super(e,vs),this.idBlock.tagClass=1,this.idBlock.tagNumber=6}getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return N(C({},super.toJSON()),{value:this.getValue()})}};I(ws,"ObjectIdentifier"),ys=ws,Do.ObjectIdentifier=ys,ws.NAME="OBJECT IDENTIFIER";var As=class extends(Co(No)){constructor(e={}){var t=e,{valueDec:r=0}=t;super(O(t,["valueDec"])),this.valueDec=r}fromBER(e,t,r){if(0===r)return t;const n=ho.BufferSourceConverter.toUint8Array(e);if(!So(this,n,t,r))return-1;const i=n.subarray(t,t+r);this.valueHexView=new Uint8Array(r);for(let e=0;e<r&&(this.valueHexView[e]=127&i[e],this.blockLength++,0!=(128&i[e]));e++);const o=new Uint8Array(this.blockLength);for(let e=0;e<this.blockLength;e++)o[e]=this.valueHexView[e];return this.valueHexView=o,0!=(128&i[this.blockLength-1])?(this.error="End of input reached before message was fully decoded",-1):(0===this.valueHexView[0]&&this.warnings.push("Needlessly long format of SID encoding"),this.blockLength<=8?this.valueDec=po(this.valueHexView,7):(this.isHexOnly=!0,this.warnings.push("Too big SID for decoding, hex only")),t+this.blockLength)}toBER(e){if(this.isHexOnly){if(e)return new ArrayBuffer(this.valueHexView.byteLength);const t=this.valueHexView,r=new Uint8Array(this.blockLength);for(let e=0;e<this.blockLength-1;e++)r[e]=128|t[e];return r[this.blockLength-1]=t[this.blockLength-1],r.buffer}const t=mo(this.valueDec,7);if(0===t.byteLength)return this.error="Error during encoding SID value",ko;const r=new Uint8Array(t.byteLength);if(!e){const e=new Uint8Array(t),n=t.byteLength-1;for(let t=0;t<n;t++)r[t]=128|e[t];r[n]=e[n]}return r.buffer}toString(){let e="";return e=this.isHexOnly?ho.Convert.ToHex(this.valueHexView):this.valueDec.toString(),e}toJSON(){return N(C({},super.toJSON()),{valueDec:this.valueDec})}};I(As,"LocalRelativeSidValueBlock"),As.NAME="relativeSidBlock";var Es,Ss=class extends Io{constructor(e={}){var t=e,{value:r=_o}=t;super(O(t,["value"])),this.value=[],r&&this.fromString(r)}fromBER(e,t,r){let n=t;for(;r>0;){const t=new As;if(n=t.fromBER(e,n,r),-1===n)return this.blockLength=0,this.error=t.error,n;this.blockLength+=t.blockLength,r-=t.blockLength,this.value.push(t)}return n}toBER(e,t){const r=[];for(let t=0;t<this.value.length;t++){const n=this.value[t].toBER(e);if(0===n.byteLength)return this.error=this.value[t].error,ko;r.push(n)}return Eo(r)}fromString(e){this.value=[];let t=0,r=0,n="";do{r=e.indexOf(".",t),n=-1===r?e.substring(t):e.substring(t,r),t=r+1;const i=new As;if(i.valueDec=parseInt(n,10),isNaN(i.valueDec))return!0;this.value.push(i)}while(-1!==r);return!0}toString(){let e="",t=!1;for(let r=0;r<this.value.length;r++){t=this.value[r].isHexOnly;let n=this.value[r].toString();0!==r&&(e=`${e}.`),t?(n=`{${n}}`,e+=n):e+=n}return e}toJSON(){const e=N(C({},super.toJSON()),{value:this.toString(),sidArray:[]});for(let t=0;t<this.value.length;t++)e.sidArray.push(this.value[t].toJSON());return e}};I(Ss,"LocalRelativeObjectIdentifierValueBlock"),Ss.NAME="RelativeObjectIdentifierValueBlock";var xs,Ms=class extends jo{constructor(e={}){super(e,Ss),this.idBlock.tagClass=1,this.idBlock.tagNumber=13}getValue(){return this.valueBlock.toString()}setValue(e){this.valueBlock.fromString(e)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.valueBlock.toString()||"empty"}`}toJSON(){return N(C({},super.toJSON()),{value:this.getValue()})}};I(Ms,"RelativeObjectIdentifier"),Es=Ms,Do.RelativeObjectIdentifier=Es,Ms.NAME="RelativeObjectIdentifier";var _s,ks=class extends Go{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=16}};I(ks,"Sequence"),xs=ks,Do.Sequence=xs,ks.NAME="SEQUENCE";var Ts=class extends Go{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=17}};I(Ts,"Set"),_s=Ts,Do.Set=_s,Ts.NAME="SET";var Cs=class extends(Co(Io)){constructor(e={}){super(O(e,[])),this.isHexOnly=!0,this.value=_o}toJSON(){return N(C({},super.toJSON()),{value:this.value})}};I(Cs,"LocalStringValueBlock"),Cs.NAME="StringValueBlock";var Ns=class extends Cs{};I(Ns,"LocalSimpleStringValueBlock"),Ns.NAME="SimpleStringValueBlock";var Is=class extends Po{constructor(e={}){super(O(e,[]),Ns)}fromBuffer(e){this.valueBlock.value=String.fromCharCode.apply(null,ho.BufferSourceConverter.toUint8Array(e))}fromString(e){const t=e.length,r=this.valueBlock.valueHexView=new Uint8Array(t);for(let n=0;n<t;n++)r[n]=e.charCodeAt(n);this.valueBlock.value=e}};I(Is,"LocalSimpleStringBlock"),Is.NAME="SIMPLE STRING";var Bs,Os=class extends Is{fromBuffer(e){this.valueBlock.valueHexView=ho.BufferSourceConverter.toUint8Array(e);try{this.valueBlock.value=ho.Convert.ToUtf8String(e)}catch(t){this.warnings.push(`Error during "decodeURIComponent": ${t}, using raw string`),this.valueBlock.value=ho.Convert.ToBinary(e)}}fromString(e){this.valueBlock.valueHexView=new Uint8Array(ho.Convert.FromUtf8String(e)),this.valueBlock.value=e}};I(Os,"LocalUtf8StringValueBlock"),Os.NAME="Utf8StringValueBlock";var Ds=class extends Os{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=12}};I(Ds,"Utf8String"),Bs=Ds,Do.Utf8String=Bs,Ds.NAME="UTF8String";var js,Ls=class extends Is{fromBuffer(e){this.valueBlock.value=ho.Convert.ToUtf16String(e),this.valueBlock.valueHexView=ho.BufferSourceConverter.toUint8Array(e)}fromString(e){this.valueBlock.value=e,this.valueBlock.valueHexView=new Uint8Array(ho.Convert.FromUtf16String(e))}};I(Ls,"LocalBmpStringValueBlock"),Ls.NAME="BmpStringValueBlock";var Ps=class extends Ls{constructor(e={}){super(O(e,[])),this.idBlock.tagClass=1,this.idBlock.tagNumber=30}};I(Ps,"BmpString"),js=Ps,Do.BmpString=js,Ps.NAME="BMPString";var Rs,Us=class extends Is{fromBuffer(e){const t=ArrayBuffer.isView(e)?e.slice().buffer:e.slice(0),r=new Uint8Array(t);for(let e=0;e<r.length;e+=4)r[e]=r[e+3],r[e+1]=r[e+2],r[e+2]=0,r[e+3]=0;this.valueBlock.value=String.fromCharCode.apply(null,new Uint32Array(t))}fromString(e){const t=e.length,r=this.valueBlock.valueHexView=new Uint8Array(4*t);for(let n=0;n<t;n++){const t=mo(e.charCodeAt(n),8),i=new Uint8Array(t);if(i.length>4)continue;const o=4-i.length;for(let e=i.length-1;e>=0;e--)r[4*n+e+o]=i[e]}this.valueBlock.value=e}};I(Us,"LocalUniversalStringValueBlock"),Us.NAME="UniversalStringValueBlock";var zs,Ks=class extends Us{constructor(e={}){super(O(e,[])),this.idBlock.tagClass=1,this.idBlock.tagNumber=28}};I(Ks,"UniversalString"),Rs=Ks,Do.UniversalString=Rs,Ks.NAME="UniversalString";var Fs,Hs=class extends Is{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=18}};I(Hs,"NumericString"),zs=Hs,Do.NumericString=zs,Hs.NAME="NumericString";var $s,Vs=class extends Is{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=19}};I(Vs,"PrintableString"),Fs=Vs,Do.PrintableString=Fs,Vs.NAME="PrintableString";var qs,Gs=class extends Is{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=20}};I(Gs,"TeletexString"),$s=Gs,Do.TeletexString=$s,Gs.NAME="TeletexString";var Ys,Js=class extends Is{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=21}};I(Js,"VideotexString"),qs=Js,Do.VideotexString=qs,Js.NAME="VideotexString";var Qs,Ws=class extends Is{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=22}};I(Ws,"IA5String"),Ys=Ws,Do.IA5String=Ys,Ws.NAME="IA5String";var Xs,Zs=class extends Is{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=25}};I(Zs,"GraphicString"),Qs=Zs,Do.GraphicString=Qs,Zs.NAME="GraphicString";var ea,ta=class extends Is{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=26}};I(ta,"VisibleString"),Xs=ta,Do.VisibleString=Xs,ta.NAME="VisibleString";var ra,na=class extends Is{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=27}};I(na,"GeneralString"),ea=na,Do.GeneralString=ea,na.NAME="GeneralString";var ia,oa=class extends Is{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=29}};I(oa,"CharacterString"),ra=oa,Do.CharacterString=ra,oa.NAME="CharacterString";var sa,aa=class extends ta{constructor(e={}){var t=e,{value:r,valueDate:n}=t;if(super(O(t,["value","valueDate"])),this.year=0,this.month=0,this.day=0,this.hour=0,this.minute=0,this.second=0,r){this.fromString(r),this.valueBlock.valueHexView=new Uint8Array(r.length);for(let e=0;e<r.length;e++)this.valueBlock.valueHexView[e]=r.charCodeAt(e)}n&&(this.fromDate(n),this.valueBlock.valueHexView=new Uint8Array(this.toBuffer())),this.idBlock.tagClass=1,this.idBlock.tagNumber=23}fromBuffer(e){this.fromString(String.fromCharCode.apply(null,ho.BufferSourceConverter.toUint8Array(e)))}toBuffer(){const e=this.toString(),t=new ArrayBuffer(e.length),r=new Uint8Array(t);for(let t=0;t<e.length;t++)r[t]=e.charCodeAt(t);return t}fromDate(e){this.year=e.getUTCFullYear(),this.month=e.getUTCMonth()+1,this.day=e.getUTCDate(),this.hour=e.getUTCHours(),this.minute=e.getUTCMinutes(),this.second=e.getUTCSeconds()}toDate(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second))}fromString(e){const t=/(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})Z/gi.exec(e);if(null===t)return void(this.error="Wrong input string for conversion");const r=parseInt(t[1],10);this.year=r>=50?1900+r:2e3+r,this.month=parseInt(t[2],10),this.day=parseInt(t[3],10),this.hour=parseInt(t[4],10),this.minute=parseInt(t[5],10),this.second=parseInt(t[6],10)}toString(e="iso"){if("iso"===e){const e=new Array(7);return e[0]=wo(this.year<2e3?this.year-1900:this.year-2e3,2),e[1]=wo(this.month,2),e[2]=wo(this.day,2),e[3]=wo(this.hour,2),e[4]=wo(this.minute,2),e[5]=wo(this.second,2),e[6]="Z",e.join("")}return super.toString(e)}onAsciiEncoding(){return`${this.constructor.NAME} : ${this.toDate().toISOString()}`}toJSON(){return N(C({},super.toJSON()),{year:this.year,month:this.month,day:this.day,hour:this.hour,minute:this.minute,second:this.second})}};I(aa,"UTCTime"),ia=aa,Do.UTCTime=ia,aa.NAME="UTCTime";var ca,ua=class extends aa{constructor(e={}){var t;super(e),null!==(t=this.millisecond)&&void 0!==t||(this.millisecond=0),this.idBlock.tagClass=1,this.idBlock.tagNumber=24}fromDate(e){super.fromDate(e),this.millisecond=e.getUTCMilliseconds()}toDate(){return new Date(Date.UTC(this.year,this.month-1,this.day,this.hour,this.minute,this.second,this.millisecond))}fromString(e){let t,r=!1,n="",i="",o=0,s=0,a=0;if("Z"===e[e.length-1])n=e.substring(0,e.length-1),r=!0;else{const t=new Number(e[e.length-1]);if(isNaN(t.valueOf()))throw new Error("Wrong input string for conversion");n=e}if(r){if(-1!==n.indexOf("+"))throw new Error("Wrong input string for conversion");if(-1!==n.indexOf("-"))throw new Error("Wrong input string for conversion")}else{let e=1,t=n.indexOf("+"),r="";if(-1===t&&(t=n.indexOf("-"),e=-1),-1!==t){if(r=n.substring(t+1),n=n.substring(0,t),2!==r.length&&4!==r.length)throw new Error("Wrong input string for conversion");let i=parseInt(r.substring(0,2),10);if(isNaN(i.valueOf()))throw new Error("Wrong input string for conversion");if(s=e*i,4===r.length){if(i=parseInt(r.substring(2,4),10),isNaN(i.valueOf()))throw new Error("Wrong input string for conversion");a=e*i}}}let c=n.indexOf(".");if(-1===c&&(c=n.indexOf(",")),-1!==c){const e=new Number(`0${n.substring(c)}`);if(isNaN(e.valueOf()))throw new Error("Wrong input string for conversion");o=e.valueOf(),i=n.substring(0,c)}else i=n;switch(!0){case 8===i.length:if(t=/(\d{4})(\d{2})(\d{2})/gi,-1!==c)throw new Error("Wrong input string for conversion");break;case 10===i.length:if(t=/(\d{4})(\d{2})(\d{2})(\d{2})/gi,-1!==c){let e=60*o;this.minute=Math.floor(e),e=60*(e-this.minute),this.second=Math.floor(e),e=1e3*(e-this.second),this.millisecond=Math.floor(e)}break;case 12===i.length:if(t=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})/gi,-1!==c){let e=60*o;this.second=Math.floor(e),e=1e3*(e-this.second),this.millisecond=Math.floor(e)}break;case 14===i.length:if(t=/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/gi,-1!==c){const e=1e3*o;this.millisecond=Math.floor(e)}break;default:throw new Error("Wrong input string for conversion")}const u=t.exec(i);if(null===u)throw new Error("Wrong input string for conversion");for(let e=1;e<u.length;e++)switch(e){case 1:this.year=parseInt(u[e],10);break;case 2:this.month=parseInt(u[e],10);break;case 3:this.day=parseInt(u[e],10);break;case 4:this.hour=parseInt(u[e],10)+s;break;case 5:this.minute=parseInt(u[e],10)+a;break;case 6:this.second=parseInt(u[e],10);break;default:throw new Error("Wrong input string for conversion")}if(!1===r){const e=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second,this.millisecond);this.year=e.getUTCFullYear(),this.month=e.getUTCMonth(),this.day=e.getUTCDay(),this.hour=e.getUTCHours(),this.minute=e.getUTCMinutes(),this.second=e.getUTCSeconds(),this.millisecond=e.getUTCMilliseconds()}}toString(e="iso"){if("iso"===e){const e=[];return e.push(wo(this.year,4)),e.push(wo(this.month,2)),e.push(wo(this.day,2)),e.push(wo(this.hour,2)),e.push(wo(this.minute,2)),e.push(wo(this.second,2)),0!==this.millisecond&&(e.push("."),e.push(wo(this.millisecond,3))),e.push("Z"),e.join("")}return super.toString(e)}toJSON(){return N(C({},super.toJSON()),{millisecond:this.millisecond})}};I(ua,"GeneralizedTime"),sa=ua,Do.GeneralizedTime=sa,ua.NAME="GeneralizedTime";var la,da=class extends Ds{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=31}};I(da,"DATE"),ca=da,Do.DATE=ca,da.NAME="DATE";var fa,ha=class extends Ds{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=32}};I(ha,"TimeOfDay"),la=ha,Do.TimeOfDay=la,ha.NAME="TimeOfDay";var pa,ma=class extends Ds{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=33}};I(ma,"DateTime"),fa=ma,Do.DateTime=fa,ma.NAME="DateTime";var ga,ba=class extends Ds{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=34}};I(ba,"Duration"),pa=ba,Do.Duration=pa,ba.NAME="Duration";var ya=class extends Ds{constructor(e={}){super(e),this.idBlock.tagClass=1,this.idBlock.tagNumber=14}};I(ya,"TIME"),ga=ya,Do.TIME=ga,ya.NAME="TIME";var va=class{constructor({name:e=_o,optional:t=!1}={}){this.name=e,this.optional=t}};I(va,"Any");var wa=class extends va{constructor(e={}){var t=e,{value:r=[]}=t;super(O(t,["value"])),this.value=r}};I(wa,"Choice");var Aa=class extends va{constructor(e={}){var t=e,{value:r=new va,local:n=!1}=t;super(O(t,["value","local"])),this.value=r,this.local=n}};I(Aa,"Repeated");var Ea,Sa,xa,Ma,_a=class{constructor({data:e=To}={}){this.dataView=ho.BufferSourceConverter.toUint8Array(e)}get data(){return this.dataView.slice().buffer}set data(e){this.dataView=ho.BufferSourceConverter.toUint8Array(e)}fromBER(e,t,r){const n=t+r;return this.dataView=ho.BufferSourceConverter.toUint8Array(e).subarray(t,n),n}toBER(e){return this.dataView.slice().buffer}};function ka(e,t,r){if(r instanceof wa){for(let n=0;n<r.value.length;n++){if(ka(e,t,r.value[n]).verified)return{verified:!0,result:e}}{const e={verified:!1,result:{error:"Wrong values for Choice type"}};return r.hasOwnProperty("name")&&(e.name=r.name),e}}if(r instanceof va)return r.hasOwnProperty("name")&&(e[r.name]=t),{verified:!0,result:e};if(e instanceof Object==!1)return{verified:!1,result:{error:"Wrong root object"}};if(t instanceof Object==!1)return{verified:!1,result:{error:"Wrong ASN.1 data"}};if(r instanceof Object==!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if("idBlock"in r==!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if("fromBER"in r.idBlock==!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if("toBER"in r.idBlock==!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};const n=r.idBlock.toBER(!1);if(0===n.byteLength)return{verified:!1,result:{error:"Error encoding idBlock for ASN.1 schema"}};if(-1===r.idBlock.fromBER(n,0,n.byteLength))return{verified:!1,result:{error:"Error decoding idBlock for ASN.1 schema"}};if(!1===r.idBlock.hasOwnProperty("tagClass"))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.tagClass!==t.idBlock.tagClass)return{verified:!1,result:e};if(!1===r.idBlock.hasOwnProperty("tagNumber"))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.tagNumber!==t.idBlock.tagNumber)return{verified:!1,result:e};if(!1===r.idBlock.hasOwnProperty("isConstructed"))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.isConstructed!==t.idBlock.isConstructed)return{verified:!1,result:e};if(!("isHexOnly"in r.idBlock))return{verified:!1,result:{error:"Wrong ASN.1 schema"}};if(r.idBlock.isHexOnly!==t.idBlock.isHexOnly)return{verified:!1,result:e};if(r.idBlock.isHexOnly){if("valueHexView"in r.idBlock==!1)return{verified:!1,result:{error:"Wrong ASN.1 schema"}};const n=r.idBlock.valueHexView,i=t.idBlock.valueHexView;if(n.length!==i.length)return{verified:!1,result:e};for(let t=0;t<n.length;t++)if(n[t]!==i[1])return{verified:!1,result:e}}if(r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,_o),r.name&&(e[r.name]=t)),r instanceof Do.Constructed){let n=0,i={verified:!1,result:{error:"Unknown error"}},o=r.valueBlock.value.length;if(o>0&&r.valueBlock.value[0]instanceof Aa&&(o=t.valueBlock.value.length),0===o)return{verified:!0,result:e};if(0===t.valueBlock.value.length&&0!==r.valueBlock.value.length){let t=!0;for(let e=0;e<r.valueBlock.value.length;e++)t=t&&(r.valueBlock.value[e].optional||!1);return t?{verified:!0,result:e}:(r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,_o),r.name&&delete e[r.name]),e.error="Inconsistent object length",{verified:!1,result:e})}for(let s=0;s<o;s++)if(s-n>=t.valueBlock.value.length){if(!1===r.valueBlock.value[s].optional){const t={verified:!1,result:e};return e.error="Inconsistent length between ASN.1 data and schema",r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,_o),r.name&&(delete e[r.name],t.name=r.name)),t}}else if(r.valueBlock.value[0]instanceof Aa){if(i=ka(e,t.valueBlock.value[s],r.valueBlock.value[0].value),!1===i.verified){if(!r.valueBlock.value[0].optional)return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,_o),r.name&&delete e[r.name]),i;n++}if("name"in r.valueBlock.value[0]&&r.valueBlock.value[0].name.length>0){let n={};n="local"in r.valueBlock.value[0]&&r.valueBlock.value[0].local?t:e,void 0===n[r.valueBlock.value[0].name]&&(n[r.valueBlock.value[0].name]=[]),n[r.valueBlock.value[0].name].push(t.valueBlock.value[s])}}else if(i=ka(e,t.valueBlock.value[s-n],r.valueBlock.value[s]),!1===i.verified){if(!r.valueBlock.value[s].optional)return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,_o),r.name&&delete e[r.name]),i;n++}if(!1===i.verified){const t={verified:!1,result:e};return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,_o),r.name&&(delete e[r.name],t.name=r.name)),t}return{verified:!0,result:e}}if(r.primitiveSchema&&"valueHexView"in t.valueBlock){const n=Fo(t.valueBlock.valueHexView);if(-1===n.offset){const t={verified:!1,result:n.result};return r.name&&(r.name=r.name.replace(/^\s+|\s+$/g,_o),r.name&&(delete e[r.name],t.name=r.name)),t}return ka(e,n.result,r.primitiveSchema)}return{verified:!0,result:e}}function Ta(e,t){if(t instanceof Object==!1)return{verified:!1,result:{error:"Wrong ASN.1 schema type"}};const r=Fo(ho.BufferSourceConverter.toUint8Array(e));return-1===r.offset?{verified:!1,result:r.result}:ka(r.result,r.result,t)}I(_a,"RawData"),I(ka,"compareSchema"),I(Ta,"verifySchema"),(Sa=Ea||(Ea={}))[Sa.Sequence=0]="Sequence",Sa[Sa.Set=1]="Set",Sa[Sa.Choice=2]="Choice",(Ma=xa||(xa={}))[Ma.Any=1]="Any",Ma[Ma.Boolean=2]="Boolean",Ma[Ma.OctetString=3]="OctetString",Ma[Ma.BitString=4]="BitString",Ma[Ma.Integer=5]="Integer",Ma[Ma.Enumerated=6]="Enumerated",Ma[Ma.ObjectIdentifier=7]="ObjectIdentifier",Ma[Ma.Utf8String=8]="Utf8String",Ma[Ma.BmpString=9]="BmpString",Ma[Ma.UniversalString=10]="UniversalString",Ma[Ma.NumericString=11]="NumericString",Ma[Ma.PrintableString=12]="PrintableString",Ma[Ma.TeletexString=13]="TeletexString",Ma[Ma.VideotexString=14]="VideotexString",Ma[Ma.IA5String=15]="IA5String",Ma[Ma.GraphicString=16]="GraphicString",Ma[Ma.VisibleString=17]="VisibleString",Ma[Ma.GeneralString=18]="GeneralString",Ma[Ma.CharacterString=19]="CharacterString",Ma[Ma.UTCTime=20]="UTCTime",Ma[Ma.GeneralizedTime=21]="GeneralizedTime",Ma[Ma.DATE=22]="DATE",Ma[Ma.TimeOfDay=23]="TimeOfDay",Ma[Ma.DateTime=24]="DateTime",Ma[Ma.Duration=25]="Duration",Ma[Ma.TIME=26]="TIME",Ma[Ma.Null=27]="Null";var Ca={fromASN:e=>e instanceof Xo?null:e.valueBeforeDecode,toASN:e=>{if(null===e)return new Xo;const t=Ho(e);if(t.result.error)throw new Error(t.result.error);return t.result}},Na={fromASN:e=>e.valueBlock.valueHex.byteLength>4?e.valueBlock.toString():e.valueBlock.valueDec,toASN:e=>new ms({value:e})},Ia={fromASN:e=>e.valueBlock.valueDec,toASN:e=>new gs({value:e})},Ba={fromASN:e=>e.valueBlock.valueHex,toASN:e=>new cs({valueHex:e})},Oa={fromASN:e=>e.valueBlock.toString(),toASN:e=>new ws({value:e})},Da={fromASN:e=>e.valueBlock.value,toASN:e=>new ts({value:e})},ja={fromASN:e=>e.valueBlock.valueHex,toASN:e=>new is({valueHex:e})};function La(e){return{fromASN:e=>e.valueBlock.value,toASN:t=>new e({value:t})}}I(La,"createStringConverter");var Pa=La(Ds),Ra=La(Ps),Ua=La(Ks),za=La(Hs),Ka=La(Vs),Fa=La(Gs),Ha=La(Js),$a=La(Ws),Va=La(Zs),qa=La(ta),Ga=La(na),Ya=La(oa),Ja={fromASN:e=>e.toDate(),toASN:e=>new aa({valueDate:e})},Qa={fromASN:e=>e.toDate(),toASN:e=>new ua({valueDate:e})},Wa={fromASN:e=>null,toASN:e=>new Xo};function Xa(e){switch(e){case xa.Any:return Ca;case xa.BitString:return Ba;case xa.BmpString:return Ra;case xa.Boolean:return Da;case xa.CharacterString:return Ya;case xa.Enumerated:return Ia;case xa.GeneralString:return Ga;case xa.GeneralizedTime:return Qa;case xa.GraphicString:return Va;case xa.IA5String:return $a;case xa.Integer:return Na;case xa.Null:return Wa;case xa.NumericString:return za;case xa.ObjectIdentifier:return Oa;case xa.OctetString:return ja;case xa.PrintableString:return Ka;case xa.TeletexString:return Fa;case xa.UTCTime:return Ja;case xa.UniversalString:return Ua;case xa.Utf8String:return Pa;case xa.VideotexString:return Ha;case xa.VisibleString:return qa;default:return null}}function Za(e){return e&&e.prototype?!(!e.prototype.toASN||!e.prototype.fromASN)||Za(e.prototype):!!(e&&e.toASN&&e.fromASN)}function ec(e){var t;if(e){const r=Object.getPrototypeOf(e);return(null===(t=null==r?void 0:r.prototype)||void 0===t?void 0:t.constructor)===Array||ec(r)}return!1}function tc(e,t){if(!e||!t)return!1;if(e.byteLength!==t.byteLength)return!1;const r=new Uint8Array(e),n=new Uint8Array(t);for(let t=0;t<e.byteLength;t++)if(r[t]!==n[t])return!1;return!0}I(Xa,"defaultConverter"),R(K()),R(K()),I(Za,"isConvertible"),I(ec,"isTypeOfArray"),I(tc,"isArrayEqual");var rc=class{constructor(){this.items=new WeakMap}has(e){return this.items.has(e)}get(e){var t,r,n;const i=this.items.get(e);if(!i)throw new Error(`Cannot get schema for '${null!==(n=null===(r=null===(t=null==e?void 0:e.prototype)||void 0===t?void 0:t.constructor)||void 0===r?void 0:r.name)&&void 0!==n?n:e}' target`);return i}cache(e){const t=this.get(e);t.schema||(t.schema=this.create(e,!0))}createDefault(e){const t={type:Ea.Sequence,items:{}},r=this.findParentSchema(e);return r&&(Object.assign(t,r),t.items=Object.assign({},t.items,r.items)),t}create(e,t){const r=this.items.get(e)||this.createDefault(e),n=[];for(const e in r.items){const i=r.items[e],o=t?e:"";let s;if("number"==typeof i.type){const e=xa[i.type],t=fo[e];if(!t)throw new Error(`Cannot get ASN1 class by name '${e}'`);s=new t({name:o})}else if(Za(i.type)){s=(new i.type).toSchema(o)}else if(i.optional){this.get(i.type).type===Ea.Choice?s=new va({name:o}):(s=this.create(i.type,!1),s.name=o)}else s=new va({name:o});const a=!!i.optional||void 0!==i.defaultValue;if(i.repeated){s.name="";s=new("set"===i.repeated?Ts:ks)({name:"",value:[new Aa({name:o,value:s})]})}if(null!==i.context&&void 0!==i.context)if(i.implicit)if("number"==typeof i.type||Za(i.type)){const e=i.repeated?Go:zo;n.push(new e({name:o,optional:a,idBlock:{tagClass:3,tagNumber:i.context}}))}else{this.cache(i.type);const e=!!i.repeated;let t=e?s:this.get(i.type).schema;t=t.valueBlock?t.valueBlock.value:t.value,n.push(new Go({name:e?"":o,optional:a,idBlock:{tagClass:3,tagNumber:i.context},value:t}))}else n.push(new Go({optional:a,idBlock:{tagClass:3,tagNumber:i.context},value:[s]}));else s.optional=a,n.push(s)}switch(r.type){case Ea.Sequence:return new ks({value:n,name:""});case Ea.Set:return new Ts({value:n,name:""});case Ea.Choice:return new wa({value:n,name:""});default:throw new Error("Unsupported ASN1 type in use")}}set(e,t){return this.items.set(e,t),this}findParentSchema(e){const t=e.__proto__;if(t){return this.items.get(t)||this.findParentSchema(t)}return null}};I(rc,"AsnSchemaStorage");var nc=new rc,ic=I((e=>t=>{let r;nc.has(t)?r=nc.get(t):(r=nc.createDefault(t),nc.set(t,r)),Object.assign(r,e)}),"AsnType"),oc=I((e=>(t,r)=>{let n;nc.has(t.constructor)?n=nc.get(t.constructor):(n=nc.createDefault(t.constructor),nc.set(t.constructor,n));const i=Object.assign({},e);if("number"==typeof i.type&&!i.converter){const n=Xa(e.type);if(!n)throw new Error(`Cannot get default converter for property '${r}' of ${t.constructor.name}`);i.converter=n}n.items[r]=i}),"AsnProp"),sc=class extends Error{constructor(){super(...arguments),this.schemas=[]}};I(sc,"AsnSchemaValidationError");var ac=class{static parse(e,t){let r;if(e instanceof ArrayBuffer)r=e;else if("undefined"!=typeof Buffer&&Buffer.isBuffer(e))r=new Uint8Array(e).buffer;else{if(!(ArrayBuffer.isView(e)||e.buffer instanceof ArrayBuffer))throw new TypeError("Wrong type of 'data' argument");r=e.buffer}const n=Ho(r);if(n.result.error)throw new Error(n.result.error);return this.fromASN(n.result,t)}static fromASN(e,t){var r;try{if(Za(t)){return(new t).fromASN(e)}const n=nc.get(t);nc.cache(t);let i=n.schema;if(e.constructor===Go&&n.type!==Ea.Choice){i=new Go({idBlock:{tagClass:3,tagNumber:e.idBlock.tagNumber},value:n.schema.valueBlock.value});for(const t in n.items)delete e[t]}const o=ka(e,e,i);if(!o.verified)throw new sc(`Data does not match to ${t.name} ASN1 schema. ${o.result.error}`);const s=new t;if(ec(t)){if("number"==typeof n.itemType){const r=Xa(n.itemType);if(!r)throw new Error(`Cannot get default converter for array item of ${t.name} ASN1 schema`);return t.from(e.valueBlock.value,(e=>r.fromASN(e)))}return t.from(e.valueBlock.value,(e=>this.fromASN(e,n.itemType)))}for(const t in n.items){if(!e[t])continue;const i=n.items[t];if("number"==typeof i.type||Za(i.type)){const n=null!==(r=i.converter)&&void 0!==r?r:Za(i.type)?new i.type:null;if(!n)throw new Error("Converter is empty");if(i.repeated)if(i.implicit){const r=new("sequence"===i.repeated?ks:Ts);r.valueBlock=e[t].valueBlock;const o=Ho(r.toBER(!1)).result.valueBlock.value;s[t]=Array.from(o,(e=>n.fromASN(e)))}else s[t]=Array.from(e[t],(e=>n.fromASN(e)));else{let r=e[t];if(i.implicit){let e;if(Za(i.type))e=(new i.type).toSchema("");else{const t=xa[i.type],r=fo[t];if(!r)throw new Error(`Cannot get '${t}' class from asn1js module`);e=new r}e.valueBlock=r.valueBlock,r=Ho(e.toBER(!1)).result}s[t]=n.fromASN(r)}}else i.repeated?s[t]=Array.from(e[t],(e=>this.fromASN(e,i.type))):s[t]=this.fromASN(e[t],i.type)}return s}catch(e){throw e instanceof sc&&e.schemas.push(t.name),e}}};I(ac,"AsnParser");var cc=class{static serialize(e){return e instanceof jo?e.toBER(!1):this.toASN(e).toBER(!1)}static toASN(e){if(e&&Za(e.constructor))return e.toASN();const t=e.constructor,r=nc.get(t);nc.cache(t);let n,i=[];if(r.itemType)if("number"==typeof r.itemType){const n=Xa(r.itemType);if(!n)throw new Error(`Cannot get default converter for array item of ${t.name} ASN1 schema`);i=e.map((e=>n.toASN(e)))}else i=e.map((e=>this.toAsnItem({type:r.itemType},"[]",t,e)));else for(const n in r.items){const o=r.items[n],s=e[n];if(void 0===s||o.defaultValue===s||"object"==typeof o.defaultValue&&"object"==typeof s&&tc(this.serialize(o.defaultValue),this.serialize(s)))continue;let a=cc.toAsnItem(o,n,t,s);if("number"==typeof o.context)if(o.implicit)if(o.repeated||"number"!=typeof o.type&&!Za(o.type))i.push(new Go({optional:o.optional,idBlock:{tagClass:3,tagNumber:o.context},value:a.valueBlock.value}));else{const e={};e.valueHex=a instanceof Xo?a.valueBeforeDecode:a.valueBlock.toBER(),i.push(new zo(C({optional:o.optional,idBlock:{tagClass:3,tagNumber:o.context}},e)))}else i.push(new Go({optional:o.optional,idBlock:{tagClass:3,tagNumber:o.context},value:[a]}));else o.repeated?i=i.concat(a):i.push(a)}switch(r.type){case Ea.Sequence:n=new ks({value:i});break;case Ea.Set:n=new Ts({value:i});break;case Ea.Choice:if(!i[0])throw new Error(`Schema '${t.name}' has wrong data. Choice cannot be empty.`);n=i[0]}return n}static toAsnItem(e,t,r,n){let i;if("number"==typeof e.type){const o=e.converter;if(!o)throw new Error(`Property '${t}' doesn't have converter for type ${xa[e.type]} in schema '${r.name}'`);if(e.repeated){const t=Array.from(n,(e=>o.toASN(e)));i=new("sequence"===e.repeated?ks:Ts)({value:t})}else i=o.toASN(n)}else if(e.repeated){const t=Array.from(n,(e=>this.toASN(e)));i=new("sequence"===e.repeated?ks:Ts)({value:t})}else i=this.toASN(n);return i}};I(cc,"AsnSerializer");var uc=R(K()),lc=class{static serialize(e){return cc.serialize(e)}static parse(e,t){return ac.parse(e,t)}static toString(e){const t=Ho(uc.BufferSourceConverter.isBufferSource(e)?uc.BufferSourceConverter.toArrayBuffer(e):lc.serialize(e));if(-1===t.offset)throw new Error(`Cannot decode ASN.1 data. ${t.result.error}`);return t.result.toString()}};I(lc,"AsnConvert");var dc=R(F(),1),{__extends:fc,__assign:hc,__rest:pc,__decorate:mc,__param:gc,__metadata:bc,__awaiter:yc,__generator:vc,__exportStar:wc,__createBinding:Ac,__values:Ec,__read:Sc,__spread:xc,__spreadArrays:Mc,__spreadArray:_c,__await:kc,__asyncGenerator:Tc,__asyncDelegator:Cc,__asyncValues:Nc,__makeTemplateObject:Ic,__importStar:Bc,__importDefault:Oc,__classPrivateFieldGet:Dc,__classPrivateFieldSet:jc,__classPrivateFieldIn:Lc}=dc.default,Pc=class extends Error{constructor(e,t){super(t?`${e}. See the inner exception for more details.`:e),this.message=e,this.innerError=t}};I(Pc,"JsonError");var Rc=class extends Pc{constructor(e,t,r){super(t,r),this.schema=e}};I(Rc,"TransformError");var Uc=class extends Rc{constructor(e,t,r){super(e,`JSON doesn't match to '${e.target.name}' schema. ${t}`,r)}};I(Uc,"ParserError");var zc=class extends Pc{};I(zc,"ValidationError");var Kc=class extends Pc{constructor(e,t,r){super(`Cannot serialize by '${e}' schema. ${t}`,r),this.schemaName=e}};I(Kc,"SerializerError");var Fc,Hc,$c=class extends Uc{constructor(e,t,r={}){super(e,"Some keys doesn't match to schema"),this.keys=t,this.errors=r}};function Vc(e,t){switch(t){case Fc.Boolean:return"boolean"==typeof e;case Fc.Number:return"number"==typeof e;case Fc.String:return"string"==typeof e}return!0}function qc(e,t){if(!Vc(e,t))throw new TypeError(`Value must be ${Fc[t]}`)}function Gc(e){return e&&e.prototype?!(!e.prototype.toJSON||!e.prototype.fromJSON)||Gc(e.prototype):!!(e&&e.toJSON&&e.fromJSON)}I($c,"KeyError"),(Hc=Fc||(Fc={}))[Hc.Any=0]="Any",Hc[Hc.Boolean=1]="Boolean",Hc[Hc.Number=2]="Number",Hc[Hc.String=3]="String",I(Vc,"checkType"),I(qc,"throwIfTypeIsWrong"),I(Gc,"isConvertible");var Yc=class{constructor(){this.items=new Map}has(e){return this.items.has(e)||!!this.findParentSchema(e)}get(e){const t=this.items.get(e)||this.findParentSchema(e);if(!t)throw new Error("Cannot get schema for current target");return t}create(e){const t={names:{}},r=this.findParentSchema(e);if(r){Object.assign(t,r),t.names={};for(const e in r.names)t.names[e]=Object.assign({},r.names[e])}return t.target=e,t}set(e,t){return this.items.set(e,t),this}findParentSchema(e){const t=e.__proto__;if(t){return this.items.get(t)||this.findParentSchema(t)}return null}};I(Yc,"JsonSchemaStorage");var Jc=new Yc,Qc=class{constructor(e){this.pattern=new RegExp(e)}validate(e){const t=new RegExp(this.pattern.source,this.pattern.flags);if("string"!=typeof e)throw new zc("Incoming value must be string");if(!t.exec(e))throw new zc(`Value doesn't match to pattern '${t.toString()}'`)}};I(Qc,"PatternValidation");var Wc=class{constructor(e=Number.MIN_VALUE,t=Number.MAX_VALUE){this.min=e,this.max=t}validate(e){if(qc(e,Fc.Number),!(this.min<=e&&e<=this.max)){const e=this.min===Number.MIN_VALUE?"MIN":this.min,t=this.max===Number.MAX_VALUE?"MAX":this.max;throw new zc(`Value doesn't match to diapason [${e},${t}]`)}}};I(Wc,"InclusiveValidation");var Xc=class{constructor(e=Number.MIN_VALUE,t=Number.MAX_VALUE){this.min=e,this.max=t}validate(e){if(qc(e,Fc.Number),!(this.min<e&&e<this.max)){const e=this.min===Number.MIN_VALUE?"MIN":this.min,t=this.max===Number.MAX_VALUE?"MAX":this.max;throw new zc(`Value doesn't match to diapason (${e},${t})`)}}};I(Xc,"ExclusiveValidation");var Zc=class{constructor(e,t,r){this.length=e,this.minLength=t,this.maxLength=r}validate(e){if(void 0===this.length){if(void 0!==this.minLength&&e.length<this.minLength)throw new zc(`Value length must be more than ${this.minLength}.`);if(void 0!==this.maxLength&&e.length>this.maxLength)throw new zc(`Value length must be less than ${this.maxLength}.`)}else if(e.length!==this.length)throw new zc(`Value length must be exactly ${this.length}.`)}};I(Zc,"LengthValidation");var eu=class{constructor(e){this.enumeration=e}validate(e){if(qc(e,Fc.String),!this.enumeration.includes(e))throw new zc(`Value must be one of ${this.enumeration.map((e=>`'${e}'`)).join(", ")}`)}};I(eu,"EnumerationValidation");var tu=class{static checkValues(e,t){const r=Array.isArray(e)?e:[e];for(const n of r)for(const r of t.validations)r instanceof Zc&&t.repeated?r.validate(e):r.validate(n)}static checkTypes(e,t){if(t.repeated&&!Array.isArray(e))throw new TypeError("Value must be Array");if("number"==typeof t.type){const r=Array.isArray(e)?e:[e];for(const e of r)qc(e,t.type)}}static getSchemaByName(e,t="default"){return C(C({},e.names.default),e.names[t])}};I(tu,"JsonTransform");var ru=class extends tu{static serialize(e,t,r,n){const i=this.toJSON(e,t);return JSON.stringify(i,r,n)}static toJSON(e,t={}){let r,n=t.targetSchema;const i=t.schemaName||"default";if(Gc(e))return e.toJSON();if(Array.isArray(e)){r=[];for(const n of e)r.push(this.toJSON(n,t))}else if("object"==typeof e){if(n&&!Jc.has(n))throw new Pc("Cannot get schema for `targetSchema` param");if(n=n||e.constructor,Jc.has(n)){const t=Jc.get(n);r={};const o=this.getSchemaByName(t,i);for(const s in o)try{const t=o[s],a=e[s];let c;if(t.optional&&void 0===a||void 0!==t.defaultValue&&a===t.defaultValue)continue;if(!t.optional&&void 0===a)throw new Kc(n.name,`Property '${s}' is required.`);c="number"==typeof t.type?t.converter?t.repeated?a.map((r=>t.converter.toJSON(r,e))):t.converter.toJSON(a,e):a:t.repeated?a.map((e=>this.toJSON(e,{schemaName:i}))):this.toJSON(a,{schemaName:i}),this.checkTypes(c,t),this.checkValues(c,t),r[t.name||s]=c}catch(e){throw e instanceof Kc?e:new Kc(t.target.name,`Property '${s}' is wrong. ${e.message}`,e)}}else{r={};for(const t in e)r[t]=this.toJSON(e[t],{schemaName:i})}}else r=e;return r}};I(ru,"JsonSerializer");var nu=class extends tu{static parse(e,t){const r=JSON.parse(e);return this.fromJSON(r,t)}static fromJSON(e,t){const r=t.targetSchema,n=t.schemaName||"default",i=new r;if(Gc(i))return i.fromJSON(e);const o=Jc.get(r),s=this.getSchemaByName(o,n),a={};t.strictProperty&&!Array.isArray(e)&&nu.checkStrictProperty(e,s,o);for(const r in s)try{const a=s[r],c=a.name||r,u=e[c];if(void 0===u&&(a.optional||void 0!==a.defaultValue))continue;if(!a.optional&&void 0===u)throw new Uc(o,`Property '${c}' is required.`);if(this.checkTypes(u,a),this.checkValues(u,a),"number"==typeof a.type)a.converter?a.repeated?i[r]=u.map((e=>a.converter.fromJSON(e,i))):i[r]=a.converter.fromJSON(u,i):i[r]=u;else{const e=N(C({},t),{targetSchema:a.type,schemaName:n});a.repeated?i[r]=u.map((t=>this.fromJSON(t,e))):i[r]=this.fromJSON(u,e)}}catch(e){if(e instanceof Uc||(e=new Uc(o,`Property '${r}' is wrong. ${e.message}`,e)),!t.strictAllKeys)throw e;a[r]=e}const c=Object.keys(a);if(c.length)throw new $c(o,c,a);return i}static checkStrictProperty(e,t,r){const n=Object.keys(e),i=Object.keys(t),o=[];for(const e of n)-1===i.indexOf(e)&&o.push(e);if(o.length)throw new $c(r,o)}};function iu(e){const t=[];return e.pattern&&t.push(new Qc(e.pattern)),e.type!==Fc.Number&&e.type!==Fc.Any||(void 0===e.minInclusive&&void 0===e.maxInclusive||t.push(new Wc(e.minInclusive,e.maxInclusive)),void 0===e.minExclusive&&void 0===e.maxExclusive||t.push(new Xc(e.minExclusive,e.maxExclusive)),void 0!==e.enumeration&&t.push(new eu(e.enumeration))),(e.type===Fc.String||e.repeated||e.type===Fc.Any)&&(void 0===e.length&&void 0===e.minLength&&void 0===e.maxLength||t.push(new Zc(e.length,e.minLength,e.maxLength))),t}I(nu,"JsonParser"),I(iu,"getValidations");var ou=I(((e={})=>(t,r)=>{const n=`Cannot set type for ${r} property of ${t.constructor.name} schema`;let i;Jc.has(t.constructor)?(i=Jc.get(t.constructor),i.target!==t.constructor&&(i=Jc.create(t.constructor),Jc.set(t.constructor,i))):(i=Jc.create(t.constructor),Jc.set(t.constructor,i));const o={type:Fc.Any,validations:[]},s=Object.assign(o,e);if(s.validations=iu(s),"number"!=typeof s.type&&!Jc.has(s.type)&&!Gc(s.type))throw new Error(`${n}. Assigning type doesn't have schema.`);let a;a=Array.isArray(e.schema)?e.schema:[e.schema||"default"];for(const e of a){i.names[e]||(i.names[e]={});i.names[e][r]=s}}),"JsonProp"),su=class extends Error{};I(su,"CryptoError");var au=class extends su{};I(au,"AlgorithmError");var cu=class extends su{constructor(e){super("Unsupported operation: "+(e?`${e}`:""))}};I(cu,"UnsupportedOperationError");var uu=class extends su{};I(uu,"OperationError");var lu=class extends su{constructor(e){super(`${e}: Missing required property`)}};function du(e){return"object"==typeof e&&"kty"in e}I(lu,"RequiredPropertyError"),I(du,"isJWK");var fu=class{digest(...e){return z(this,null,(function*(){return this.checkDigest.apply(this,e),this.onDigest.apply(this,e)}))}checkDigest(e,t){this.checkAlgorithmName(e)}onDigest(e,t){return z(this,null,(function*(){throw new cu("digest")}))}generateKey(...e){return z(this,null,(function*(){return this.checkGenerateKey.apply(this,e),this.onGenerateKey.apply(this,e)}))}checkGenerateKey(e,t,r,...n){if(this.checkAlgorithmName(e),this.checkGenerateKeyParams(e),!r||!r.length)throw new TypeError("Usages cannot be empty when creating a key.");let i;i=Array.isArray(this.usages)?this.usages:this.usages.privateKey.concat(this.usages.publicKey),this.checkKeyUsages(r,i)}checkGenerateKeyParams(e){}onGenerateKey(e,t,r,...n){return z(this,null,(function*(){throw new cu("generateKey")}))}sign(...e){return z(this,null,(function*(){return this.checkSign.apply(this,e),this.onSign.apply(this,e)}))}checkSign(e,t,r,...n){this.checkAlgorithmName(e),this.checkAlgorithmParams(e),this.checkCryptoKey(t,"sign")}onSign(e,t,r,...n){return z(this,null,(function*(){throw new cu("sign")}))}verify(...e){return z(this,null,(function*(){return this.checkVerify.apply(this,e),this.onVerify.apply(this,e)}))}checkVerify(e,t,r,n,...i){this.checkAlgorithmName(e),this.checkAlgorithmParams(e),this.checkCryptoKey(t,"verify")}onVerify(e,t,r,n,...i){return z(this,null,(function*(){throw new cu("verify")}))}encrypt(...e){return z(this,null,(function*(){return this.checkEncrypt.apply(this,e),this.onEncrypt.apply(this,e)}))}checkEncrypt(e,t,r,n={},...i){this.checkAlgorithmName(e),this.checkAlgorithmParams(e),this.checkCryptoKey(t,n.keyUsage?"encrypt":void 0)}onEncrypt(e,t,r,...n){return z(this,null,(function*(){throw new cu("encrypt")}))}decrypt(...e){return z(this,null,(function*(){return this.checkDecrypt.apply(this,e),this.onDecrypt.apply(this,e)}))}checkDecrypt(e,t,r,n={},...i){this.checkAlgorithmName(e),this.checkAlgorithmParams(e),this.checkCryptoKey(t,n.keyUsage?"decrypt":void 0)}onDecrypt(e,t,r,...n){return z(this,null,(function*(){throw new cu("decrypt")}))}deriveBits(...e){return z(this,null,(function*(){return this.checkDeriveBits.apply(this,e),this.onDeriveBits.apply(this,e)}))}checkDeriveBits(e,t,r,n={},...i){if(this.checkAlgorithmName(e),this.checkAlgorithmParams(e),this.checkCryptoKey(t,n.keyUsage?"deriveBits":void 0),r%8!=0)throw new uu("length: Is not multiple of 8")}onDeriveBits(e,t,r,...n){return z(this,null,(function*(){throw new cu("deriveBits")}))}exportKey(...e){return z(this,null,(function*(){return this.checkExportKey.apply(this,e),this.onExportKey.apply(this,e)}))}checkExportKey(e,t,...r){if(this.checkKeyFormat(e),this.checkCryptoKey(t),!t.extractable)throw new su("key: Is not extractable")}onExportKey(e,t,...r){return z(this,null,(function*(){throw new cu("exportKey")}))}importKey(...e){return z(this,null,(function*(){return this.checkImportKey.apply(this,e),this.onImportKey.apply(this,e)}))}checkImportKey(e,t,r,n,i,...o){this.checkKeyFormat(e),this.checkKeyData(e,t),this.checkAlgorithmName(r),this.checkImportParams(r),Array.isArray(this.usages)&&this.checkKeyUsages(i,this.usages)}onImportKey(e,t,r,n,i,...o){return z(this,null,(function*(){throw new cu("importKey")}))}checkAlgorithmName(e){if(e.name.toLowerCase()!==this.name.toLowerCase())throw new au("Unrecognized name")}checkAlgorithmParams(e){}checkDerivedKeyParams(e){}checkKeyUsages(e,t){for(const r of e)if(-1===t.indexOf(r))throw new TypeError("Cannot create a key using the specified key usages")}checkCryptoKey(e,t){if(this.checkAlgorithmName(e.algorithm),t&&-1===e.usages.indexOf(t))throw new su("key does not match that of operation")}checkRequiredProperty(e,t){if(!(t in e))throw new lu(t)}checkHashAlgorithm(e,t){for(const r of t)if(r.toLowerCase()===e.name.toLowerCase())return;throw new uu(`hash: Must be one of ${t.join(", ")}`)}checkImportParams(e){}checkKeyFormat(e){switch(e){case"raw":case"pkcs8":case"spki":case"jwk":break;default:throw new TypeError("format: Is invalid value. Must be 'jwk', 'raw', 'spki', or 'pkcs8'")}}checkKeyData(e,t){if(!t)throw new TypeError("keyData: Cannot be empty on empty on key importing");if("jwk"===e){if(!du(t))throw new TypeError("keyData: Is not JsonWebToken")}else if(!uo.BufferSourceConverter.isBufferSource(t))throw new TypeError("keyData: Is not ArrayBufferView or ArrayBuffer")}prepareData(e){return uo.BufferSourceConverter.toArrayBuffer(e)}};I(fu,"ProviderCrypto");var hu=class extends fu{checkGenerateKeyParams(e){if(this.checkRequiredProperty(e,"length"),"number"!=typeof e.length)throw new TypeError("length: Is not of type Number");switch(e.length){case 128:case 192:case 256:break;default:throw new TypeError("length: Must be 128, 192, or 256")}}checkDerivedKeyParams(e){this.checkGenerateKeyParams(e)}};I(hu,"AesProvider");var pu=class extends hu{constructor(){super(...arguments),this.name="AES-CBC",this.usages=["encrypt","decrypt","wrapKey","unwrapKey"]}checkAlgorithmParams(e){if(this.checkRequiredProperty(e,"iv"),!(e.iv instanceof ArrayBuffer||ArrayBuffer.isView(e.iv)))throw new TypeError("iv: Is not of type '(ArrayBuffer or ArrayBufferView)'");if(16!==e.iv.byteLength)throw new TypeError("iv: Must have length 16 bytes")}};I(pu,"AesCbcProvider");var mu=class extends hu{constructor(){super(...arguments),this.name="AES-CMAC",this.usages=["sign","verify"]}checkAlgorithmParams(e){if(this.checkRequiredProperty(e,"length"),"number"!=typeof e.length)throw new TypeError("length: Is not a Number");if(e.length<1)throw new uu("length: Must be more than 0")}};I(mu,"AesCmacProvider");var gu=class extends hu{constructor(){super(...arguments),this.name="AES-CTR",this.usages=["encrypt","decrypt","wrapKey","unwrapKey"]}checkAlgorithmParams(e){if(this.checkRequiredProperty(e,"counter"),!(e.counter instanceof ArrayBuffer||ArrayBuffer.isView(e.counter)))throw new TypeError("counter: Is not of type '(ArrayBuffer or ArrayBufferView)'");if(16!==e.counter.byteLength)throw new TypeError("iv: Must have length 16 bytes");if(this.checkRequiredProperty(e,"length"),"number"!=typeof e.length)throw new TypeError("length: Is not a Number");if(e.length<1)throw new uu("length: Must be more than 0")}};I(gu,"AesCtrProvider");var bu=class extends hu{constructor(){super(...arguments),this.name="AES-ECB",this.usages=["encrypt","decrypt","wrapKey","unwrapKey"]}};I(bu,"AesEcbProvider");var yu=class extends hu{constructor(){super(...arguments),this.name="AES-GCM",this.usages=["encrypt","decrypt","wrapKey","unwrapKey"]}checkAlgorithmParams(e){if(this.checkRequiredProperty(e,"iv"),!(e.iv instanceof ArrayBuffer||ArrayBuffer.isView(e.iv)))throw new TypeError("iv: Is not of type '(ArrayBuffer or ArrayBufferView)'");if(e.iv.byteLength<1)throw new uu("iv: Must have length more than 0 and less than 2^64 - 1");switch("tagLength"in e||(e.tagLength=128),e.tagLength){case 32:case 64:case 96:case 104:case 112:case 120:case 128:break;default:throw new uu("tagLength: Must be one of 32, 64, 96, 104, 112, 120 or 128")}}};I(yu,"AesGcmProvider");var vu=class extends hu{constructor(){super(...arguments),this.name="AES-KW",this.usages=["wrapKey","unwrapKey"]}};I(vu,"AesKwProvider");var wu=class extends fu{constructor(){super(...arguments),this.usages=["encrypt","decrypt","wrapKey","unwrapKey"]}checkAlgorithmParams(e){if(this.ivSize){if(this.checkRequiredProperty(e,"iv"),!(e.iv instanceof ArrayBuffer||ArrayBuffer.isView(e.iv)))throw new TypeError("iv: Is not of type '(ArrayBuffer or ArrayBufferView)'");if(e.iv.byteLength!==this.ivSize)throw new TypeError(`iv: Must have length ${this.ivSize} bytes`)}}checkGenerateKeyParams(e){if(this.checkRequiredProperty(e,"length"),"number"!=typeof e.length)throw new TypeError("length: Is not of type Number");if(e.length!==this.keySizeBits)throw new uu(`algorithm.length: Must be ${this.keySizeBits}`)}checkDerivedKeyParams(e){this.checkGenerateKeyParams(e)}};I(wu,"DesProvider");var Au=class extends fu{constructor(){super(...arguments),this.hashAlgorithms=["SHA-1","SHA-256","SHA-384","SHA-512"]}checkGenerateKeyParams(e){if(this.checkRequiredProperty(e,"hash"),this.checkHashAlgorithm(e.hash,this.hashAlgorithms),this.checkRequiredProperty(e,"publicExponent"),!(e.publicExponent&&e.publicExponent instanceof Uint8Array))throw new TypeError("publicExponent: Missing or not a Uint8Array");const t=uo.Convert.ToBase64(e.publicExponent);if("Aw=="!==t&&"AQAB"!==t)throw new TypeError("publicExponent: Must be [3] or [1,0,1]");if(this.checkRequiredProperty(e,"modulusLength"),e.modulusLength%8||e.modulusLength<256||e.modulusLength>16384)throw new TypeError("The modulus length must be a multiple of 8 bits and >= 256 and <= 16384")}checkImportParams(e){this.checkRequiredProperty(e,"hash"),this.checkHashAlgorithm(e.hash,this.hashAlgorithms)}};I(Au,"RsaProvider");var Eu=class extends Au{constructor(){super(...arguments),this.name="RSASSA-PKCS1-v1_5",this.usages={privateKey:["sign"],publicKey:["verify"]}}};I(Eu,"RsaSsaProvider");var Su=class extends Au{constructor(){super(...arguments),this.name="RSA-PSS",this.usages={privateKey:["sign"],publicKey:["verify"]}}checkAlgorithmParams(e){if(this.checkRequiredProperty(e,"saltLength"),"number"!=typeof e.saltLength)throw new TypeError("saltLength: Is not a Number");if(e.saltLength<0)throw new RangeError("saltLength: Must be positive number")}};I(Su,"RsaPssProvider");var xu=class extends Au{constructor(){super(...arguments),this.name="RSA-OAEP",this.usages={privateKey:["decrypt","unwrapKey"],publicKey:["encrypt","wrapKey"]}}checkAlgorithmParams(e){if(e.label&&!(e.label instanceof ArrayBuffer||ArrayBuffer.isView(e.label)))throw new TypeError("label: Is not of type '(ArrayBuffer or ArrayBufferView)'")}};I(xu,"RsaOaepProvider");var Mu=class extends fu{checkGenerateKeyParams(e){this.checkRequiredProperty(e,"namedCurve"),this.checkNamedCurve(e.namedCurve)}checkNamedCurve(e){for(const t of this.namedCurves)if(t.toLowerCase()===e.toLowerCase())return;throw new uu(`namedCurve: Must be one of ${this.namedCurves.join(", ")}`)}};I(Mu,"EllipticProvider");var _u=class extends Mu{constructor(){super(...arguments),this.name="ECDSA",this.hashAlgorithms=["SHA-1","SHA-256","SHA-384","SHA-512"],this.usages={privateKey:["sign"],publicKey:["verify"]},this.namedCurves=["P-256","P-384","P-521","K-256"]}checkAlgorithmParams(e){this.checkRequiredProperty(e,"hash"),this.checkHashAlgorithm(e.hash,this.hashAlgorithms)}};I(_u,"EcdsaProvider");var ku=["secret","private","public"],Tu=class{static create(e,t,r,n){const i=new this;return i.algorithm=e,i.type=t,i.extractable=r,i.usages=n,i}static isKeyType(e){return-1!==ku.indexOf(e)}get[Symbol.toStringTag](){return"CryptoKey"}};I(Tu,"CryptoKey");var Cu=class extends Mu{constructor(){super(...arguments),this.name="ECDH",this.usages={privateKey:["deriveBits","deriveKey"],publicKey:[]},this.namedCurves=["P-256","P-384","P-521","K-256"]}checkAlgorithmParams(e){if(this.checkRequiredProperty(e,"public"),!(e.public instanceof Tu))throw new TypeError("public: Is not a CryptoKey");if("public"!==e.public.type)throw new uu("public: Is not a public key");if(e.public.algorithm.name!==this.name)throw new uu(`public: Is not ${this.name} key`)}};I(Cu,"EcdhProvider");var Nu=class extends Cu{constructor(){super(...arguments),this.name="ECDH-ES",this.namedCurves=["X25519","X448"]}};I(Nu,"EcdhEsProvider");var Iu=class extends Mu{constructor(){super(...arguments),this.name="EdDSA",this.usages={privateKey:["sign"],publicKey:["verify"]},this.namedCurves=["Ed25519","Ed448"]}};I(Iu,"EdDsaProvider");var Bu=I(class{constructor(e){e&&(this.value=e)}},"ObjectIdentifier");mc([oc({type:xa.ObjectIdentifier})],Bu.prototype,"value",void 0),Bu=mc([ic({type:Ea.Choice})],Bu);var Ou=class{constructor(e){Object.assign(this,e)}};I(Ou,"AlgorithmIdentifier"),mc([oc({type:xa.ObjectIdentifier})],Ou.prototype,"algorithm",void 0),mc([oc({type:xa.Any,optional:!0})],Ou.prototype,"parameters",void 0);var Du=class{constructor(){this.version=0,this.privateKeyAlgorithm=new Ou,this.privateKey=new ArrayBuffer(0)}};I(Du,"PrivateKeyInfo"),mc([oc({type:xa.Integer})],Du.prototype,"version",void 0),mc([oc({type:Ou})],Du.prototype,"privateKeyAlgorithm",void 0),mc([oc({type:xa.OctetString})],Du.prototype,"privateKey",void 0),mc([oc({type:xa.Any,optional:!0})],Du.prototype,"attributes",void 0);var ju=class{constructor(){this.publicKeyAlgorithm=new Ou,this.publicKey=new ArrayBuffer(0)}};I(ju,"PublicKeyInfo"),mc([oc({type:Ou})],ju.prototype,"publicKeyAlgorithm",void 0),mc([oc({type:xa.BitString})],ju.prototype,"publicKey",void 0);var Lu={fromJSON:e=>uo.Convert.FromBase64Url(e),toJSON:e=>uo.Convert.ToBase64Url(new Uint8Array(e))},Pu={fromASN:e=>{const t=e.valueBlock.valueHex;return new Uint8Array(t)[0]?e.valueBlock.valueHex:e.valueBlock.valueHex.slice(1)},toASN:e=>{const t=new Uint8Array(e)[0]>127?(0,uo.combine)(new Uint8Array([0]).buffer,e):e;return new ms({valueHex:t})}},Ru=class{constructor(){this.version=0,this.modulus=new ArrayBuffer(0),this.publicExponent=new ArrayBuffer(0),this.privateExponent=new ArrayBuffer(0),this.prime1=new ArrayBuffer(0),this.prime2=new ArrayBuffer(0),this.exponent1=new ArrayBuffer(0),this.exponent2=new ArrayBuffer(0),this.coefficient=new ArrayBuffer(0)}};I(Ru,"RsaPrivateKey"),mc([oc({type:xa.Integer,converter:Na})],Ru.prototype,"version",void 0),mc([oc({type:xa.Integer,converter:Pu}),ou({name:"n",converter:Lu})],Ru.prototype,"modulus",void 0),mc([oc({type:xa.Integer,converter:Pu}),ou({name:"e",converter:Lu})],Ru.prototype,"publicExponent",void 0),mc([oc({type:xa.Integer,converter:Pu}),ou({name:"d",converter:Lu})],Ru.prototype,"privateExponent",void 0),mc([oc({type:xa.Integer,converter:Pu}),ou({name:"p",converter:Lu})],Ru.prototype,"prime1",void 0),mc([oc({type:xa.Integer,converter:Pu}),ou({name:"q",converter:Lu})],Ru.prototype,"prime2",void 0),mc([oc({type:xa.Integer,converter:Pu}),ou({name:"dp",converter:Lu})],Ru.prototype,"exponent1",void 0),mc([oc({type:xa.Integer,converter:Pu}),ou({name:"dq",converter:Lu})],Ru.prototype,"exponent2",void 0),mc([oc({type:xa.Integer,converter:Pu}),ou({name:"qi",converter:Lu})],Ru.prototype,"coefficient",void 0),mc([oc({type:xa.Any,optional:!0})],Ru.prototype,"otherPrimeInfos",void 0);var Uu=class{constructor(){this.modulus=new ArrayBuffer(0),this.publicExponent=new ArrayBuffer(0)}};I(Uu,"RsaPublicKey"),mc([oc({type:xa.Integer,converter:Pu}),ou({name:"n",converter:Lu})],Uu.prototype,"modulus",void 0),mc([oc({type:xa.Integer,converter:Pu}),ou({name:"e",converter:Lu})],Uu.prototype,"publicExponent",void 0);var zu=I(class{constructor(e){this.value=new ArrayBuffer(0),e&&(this.value=e)}toJSON(){let e=new Uint8Array(this.value);if(4!==e[0])throw new su("Wrong ECPoint. Current version supports only Uncompressed (0x04) point");e=new Uint8Array(this.value.slice(1));const t=e.length/2;return{x:uo.Convert.ToBase64Url(e.buffer.slice(0,0+t)),y:uo.Convert.ToBase64Url(e.buffer.slice(0+t,0+t+t))}}fromJSON(e){if(!("x"in e))throw new Error("x: Missing required property");if(!("y"in e))throw new Error("y: Missing required property");const t=uo.Convert.FromBase64Url(e.x),r=uo.Convert.FromBase64Url(e.y),n=(0,uo.combine)(new Uint8Array([4]).buffer,t,r);return this.value=new Uint8Array(n).buffer,this}},"EcPublicKey");mc([oc({type:xa.OctetString})],zu.prototype,"value",void 0),zu=mc([ic({type:Ea.Choice})],zu);var Ku=class{constructor(){this.version=1,this.privateKey=new ArrayBuffer(0)}fromJSON(e){if(!("d"in e))throw new Error("d: Missing required property");if(this.privateKey=uo.Convert.FromBase64Url(e.d),"x"in e){const t=new zu;t.fromJSON(e),this.publicKey=cc.toASN(t).valueBlock.valueHex}return this}toJSON(){const e={};return e.d=uo.Convert.ToBase64Url(this.privateKey),this.publicKey&&Object.assign(e,new zu(this.publicKey).toJSON()),e}};I(Ku,"EcPrivateKey"),mc([oc({type:xa.Integer,converter:Na})],Ku.prototype,"version",void 0),mc([oc({type:xa.OctetString})],Ku.prototype,"privateKey",void 0),mc([oc({context:0,type:xa.Any,optional:!0})],Ku.prototype,"parameters",void 0),mc([oc({context:1,type:xa.BitString,optional:!0})],Ku.prototype,"publicKey",void 0);var Fu={fromASN:e=>{const t=new Uint8Array(e.valueBlock.valueHex);return 0===t[0]?t.buffer.slice(1):t.buffer},toASN:e=>{const t=new Uint8Array(e);if(t[0]>127){const e=new Uint8Array(t.length+1);return e.set(t,1),new ms({valueHex:e.buffer})}return new ms({valueHex:e})}},Hu=Object.freeze({__proto__:null,AsnIntegerWithoutPaddingConverter:Fu}),$u=class{static decodePoint(e,t){const r=uo.BufferSourceConverter.toUint8Array(e);if(0===r.length||4!==r[0])throw new Error("Only uncompressed point format supported");const n=(r.length-1)/2;if(n!==Math.ceil(t/8))throw new Error("Point does not match field size");return{x:r.slice(1,n+1),y:r.slice(n+1,n+1+n)}}static encodePoint(e,t){const r=Math.ceil(t/8);if(e.x.byteLength!==r||e.y.byteLength!==r)throw new Error("X,Y coordinates don't match point size criteria");const n=uo.BufferSourceConverter.toUint8Array(e.x),i=uo.BufferSourceConverter.toUint8Array(e.y),o=new Uint8Array(2*r+1);return o[0]=4,o.set(n,1),o.set(i,r+1),o}static getSize(e){return Math.ceil(e/8)}static encodeSignature(e,t){const r=this.getSize(t),n=uo.BufferSourceConverter.toUint8Array(e.r),i=uo.BufferSourceConverter.toUint8Array(e.s),o=new Uint8Array(2*r);return o.set(this.padStart(n,r)),o.set(this.padStart(i,r),r),o}static decodeSignature(e,t){const r=this.getSize(t),n=uo.BufferSourceConverter.toUint8Array(e);if(n.length!==2*r)throw new Error("Incorrect size of the signature");const i=n.slice(0,r),o=n.slice(r);return{r:this.trimStart(i),s:this.trimStart(o)}}static trimStart(e){let t=0;for(;t<e.length-1&&0===e[t];)t++;return 0===t?e:e.slice(t,e.length)}static padStart(e,t){if(t===e.length)return e;const r=new Uint8Array(t);return r.set(e,t-e.length),r}};I($u,"EcUtils");var Vu=class{constructor(){this.r=new ArrayBuffer(0),this.s=new ArrayBuffer(0)}static fromWebCryptoSignature(e){const t=e.byteLength/2,r=$u.decodeSignature(e,8*t),n=new Vu;return n.r=uo.BufferSourceConverter.toArrayBuffer(r.r),n.s=uo.BufferSourceConverter.toArrayBuffer(r.s),n}toWebCryptoSignature(e){null!=e||(e=8*Math.max(this.r.byteLength,this.s.byteLength));return $u.encodeSignature(this,e).buffer}};I(Vu,"EcDsaSignature"),mc([oc({type:xa.Integer,converter:Fu})],Vu.prototype,"r",void 0),mc([oc({type:xa.Integer,converter:Fu})],Vu.prototype,"s",void 0);var qu=class extends Du{};I(qu,"OneAsymmetricKey"),mc([oc({context:1,implicit:!0,type:xa.BitString,optional:!0})],qu.prototype,"publicKey",void 0);var Gu=I(class{constructor(){this.value=new ArrayBuffer(0)}fromJSON(e){if(!e.d)throw new Error("d: Missing required property");return this.value=uo.Convert.FromBase64Url(e.d),this}toJSON(){return{d:uo.Convert.ToBase64Url(this.value)}}},"EdPrivateKey");mc([oc({type:xa.OctetString})],Gu.prototype,"value",void 0),Gu=mc([ic({type:Ea.Choice})],Gu);var Yu=I(class{constructor(e){this.value=new ArrayBuffer(0),e&&(this.value=e)}toJSON(){return{x:uo.Convert.ToBase64Url(this.value)}}fromJSON(e){if(!("x"in e))throw new Error("x: Missing required property");return this.value=uo.Convert.FromBase64Url(e.x),this}},"EdPublicKey");mc([oc({type:xa.BitString})],Yu.prototype,"value",void 0),Yu=mc([ic({type:Ea.Choice})],Yu);var Ju=I(class{},"CurvePrivateKey");mc([oc({type:xa.OctetString}),ou({type:Fc.String,converter:Lu})],Ju.prototype,"d",void 0),Ju=mc([ic({type:Ea.Choice})],Ju);var Qu="1.3.36.3.3.2.8.1.1",Wu=`${Qu}.1`,Xu=`${Qu}.2`,Zu=`${Qu}.3`,el=`${Qu}.4`,tl=`${Qu}.5`,rl=`${Qu}.6`,nl=`${Qu}.7`,il=`${Qu}.8`,ol=`${Qu}.9`,sl=`${Qu}.10`,al=`${Qu}.11`,cl=`${Qu}.12`,ul=`${Qu}.13`,ll=`${Qu}.14`,dl=Object.freeze({__proto__:null,converters:Hu,get ObjectIdentifier(){return Bu},AlgorithmIdentifier:Ou,PrivateKeyInfo:Du,PublicKeyInfo:ju,RsaPrivateKey:Ru,RsaPublicKey:Uu,EcPrivateKey:Ku,get EcPublicKey(){return zu},EcDsaSignature:Vu,OneAsymmetricKey:qu,get EdPrivateKey(){return Gu},get EdPublicKey(){return Yu},get CurvePrivateKey(){return Ju},idSecp256r1:"1.2.840.10045.3.1.7",idEllipticCurve:"1.3.132.0",idSecp384r1:"1.3.132.0.34",idSecp521r1:"1.3.132.0.35",idSecp256k1:"1.3.132.0.10",idVersionOne:Qu,idBrainpoolP160r1:Wu,idBrainpoolP160t1:Xu,idBrainpoolP192r1:Zu,idBrainpoolP192t1:el,idBrainpoolP224r1:tl,idBrainpoolP224t1:rl,idBrainpoolP256r1:nl,idBrainpoolP256t1:il,idBrainpoolP320r1:ol,idBrainpoolP320t1:sl,idBrainpoolP384r1:al,idBrainpoolP384t1:cl,idBrainpoolP512r1:ul,idBrainpoolP512t1:ll,idX25519:"1.3.101.110",idX448:"1.3.101.111",idEd25519:"1.3.101.112",idEd448:"1.3.101.113"}),fl=class{constructor(){}static register(e){const t=new Bu;t.value=e.id;const r=lc.serialize(t);this.items.push(N(C({},e),{raw:r})),this.names.push(e.name)}static find(e){e=e.toUpperCase();for(const t of this.items)if(t.name.toUpperCase()===e||t.id.toUpperCase()===e)return t;return null}static get(e){const t=this.find(e);if(!t)throw new Error(`Unsupported EC named curve '${e}'`);return t}};I(fl,"EcCurves"),fl.items=[],fl.names=[],fl.register({name:"P-256",id:"1.2.840.10045.3.1.7",size:256}),fl.register({name:"P-384",id:"1.3.132.0.34",size:384}),fl.register({name:"P-521",id:"1.3.132.0.35",size:521}),fl.register({name:"K-256",id:"1.3.132.0.10",size:256}),fl.register({name:"brainpoolP160r1",id:Wu,size:160}),fl.register({name:"brainpoolP160t1",id:Xu,size:160}),fl.register({name:"brainpoolP192r1",id:Zu,size:192}),fl.register({name:"brainpoolP192t1",id:el,size:192}),fl.register({name:"brainpoolP224r1",id:tl,size:224}),fl.register({name:"brainpoolP224t1",id:rl,size:224}),fl.register({name:"brainpoolP256r1",id:nl,size:256}),fl.register({name:"brainpoolP256t1",id:il,size:256}),fl.register({name:"brainpoolP320r1",id:ol,size:320}),fl.register({name:"brainpoolP320t1",id:sl,size:320}),fl.register({name:"brainpoolP384r1",id:al,size:384}),fl.register({name:"brainpoolP384t1",id:cl,size:384}),fl.register({name:"brainpoolP512r1",id:ul,size:512}),fl.register({name:"brainpoolP512t1",id:ll,size:512});var hl=class extends fu{constructor(){super(...arguments),this.name="HMAC",this.hashAlgorithms=["SHA-1","SHA-256","SHA-384","SHA-512"],this.usages=["sign","verify"]}getDefaultLength(e){switch(e.toUpperCase()){case"SHA-1":case"SHA-256":case"SHA-384":case"SHA-512":return 512;default:throw new Error(`Unknown algorithm name '${e}'`)}}checkGenerateKeyParams(e){if(this.checkRequiredProperty(e,"hash"),this.checkHashAlgorithm(e.hash,this.hashAlgorithms),"length"in e){if("number"!=typeof e.length)throw new TypeError("length: Is not a Number");if(e.length<1)throw new RangeError("length: Number is out of range")}}checkImportParams(e){this.checkRequiredProperty(e,"hash"),this.checkHashAlgorithm(e.hash,this.hashAlgorithms)}};I(hl,"HmacProvider");var pl=class extends fu{constructor(){super(...arguments),this.name="PBKDF2",this.hashAlgorithms=["SHA-1","SHA-256","SHA-384","SHA-512"],this.usages=["deriveBits","deriveKey"]}checkAlgorithmParams(e){if(this.checkRequiredProperty(e,"hash"),this.checkHashAlgorithm(e.hash,this.hashAlgorithms),this.checkRequiredProperty(e,"salt"),!(e.salt instanceof ArrayBuffer||ArrayBuffer.isView(e.salt)))throw new TypeError("salt: Is not of type '(ArrayBuffer or ArrayBufferView)'");if(this.checkRequiredProperty(e,"iterations"),"number"!=typeof e.iterations)throw new TypeError("iterations: Is not a Number");if(e.iterations<1)throw new TypeError("iterations: Is less than 1")}checkImportKey(e,t,r,n,i,...o){if(super.checkImportKey(e,t,r,n,i),n)throw new SyntaxError("extractable: Must be 'false'")}};I(pl,"Pbkdf2Provider");var ml=class extends fu{constructor(){super(...arguments),this.name="HKDF",this.hashAlgorithms=["SHA-1","SHA-256","SHA-384","SHA-512"],this.usages=["deriveKey","deriveBits"]}checkAlgorithmParams(e){if(this.checkRequiredProperty(e,"hash"),this.checkHashAlgorithm(e.hash,this.hashAlgorithms),this.checkRequiredProperty(e,"salt"),!uo.BufferSourceConverter.isBufferSource(e.salt))throw new TypeError("salt: Is not of type '(ArrayBuffer or ArrayBufferView)'");if(this.checkRequiredProperty(e,"info"),!uo.BufferSourceConverter.isBufferSource(e.info))throw new TypeError("salt: Is not of type '(ArrayBuffer or ArrayBufferView)'")}checkImportKey(e,t,r,n,i,...o){if(super.checkImportKey(e,t,r,n,i),n)throw new SyntaxError("extractable: Must be 'false'")}};I(ml,"HkdfProvider");var gl=class extends fu{constructor(){super(...arguments),this.usages=[],this.defaultLength=0}digest(...e){return e[0]=C({length:this.defaultLength},e[0]),super.digest.apply(this,e)}checkDigest(e,t){super.checkDigest(e,t);const r=e.length||0;if("number"!=typeof r)throw new TypeError("length: Is not a Number");if(r<0)throw new TypeError("length: Is negative")}};I(gl,"ShakeProvider");var bl=class extends gl{constructor(){super(...arguments),this.name="shake128",this.defaultLength=16}};I(bl,"Shake128Provider");var yl=class extends gl{constructor(){super(...arguments),this.name="shake256",this.defaultLength=32}};I(yl,"Shake256Provider");var vl=class{get[Symbol.toStringTag](){return"Crypto"}randomUUID(){const e=this.getRandomValues(new Uint8Array(16));e[6]=15&e[6]|64,e[8]=63&e[8]|128;const t=uo.Convert.ToHex(e).toLowerCase();return`${t.substring(0,8)}-${t.substring(8,12)}-${t.substring(12,16)}-${t.substring(16)}`}};I(vl,"Crypto");var wl=class{constructor(){this.items={}}get(e){return this.items[e.toLowerCase()]||null}set(e){this.items[e.name.toLowerCase()]=e}removeAt(e){const t=this.get(e.toLowerCase());return t&&delete this.items[e],t}has(e){return!!this.get(e)}get length(){return Object.keys(this.items).length}get algorithms(){const e=[];for(const t in this.items){const r=this.items[t];e.push(r.name)}return e.sort()}};I(wl,"ProviderStorage");var Al=class{constructor(){this.providers=new wl}static isHashedAlgorithm(e){return!!(e&&"object"==typeof e&&"name"in e&&"hash"in e)}get[Symbol.toStringTag](){return"SubtleCrypto"}digest(...e){return z(this,null,(function*(){this.checkRequiredArguments(e,2,"digest");const[t,r,...n]=e,i=this.prepareAlgorithm(t),o=uo.BufferSourceConverter.toArrayBuffer(r),s=this.getProvider(i.name);return yield s.digest(i,o,...n)}))}generateKey(...e){return z(this,null,(function*(){this.checkRequiredArguments(e,3,"generateKey");const[t,r,n,...i]=e,o=this.prepareAlgorithm(t),s=this.getProvider(o.name);return yield s.generateKey(N(C({},o),{name:s.name}),r,n,...i)}))}sign(...e){return z(this,null,(function*(){this.checkRequiredArguments(e,3,"sign");const[t,r,n,...i]=e;this.checkCryptoKey(r);const o=this.prepareAlgorithm(t),s=uo.BufferSourceConverter.toArrayBuffer(n),a=this.getProvider(o.name);return yield a.sign(N(C({},o),{name:a.name}),r,s,...i)}))}verify(...e){return z(this,null,(function*(){this.checkRequiredArguments(e,4,"verify");const[t,r,n,i,...o]=e;this.checkCryptoKey(r);const s=this.prepareAlgorithm(t),a=uo.BufferSourceConverter.toArrayBuffer(i),c=uo.BufferSourceConverter.toArrayBuffer(n),u=this.getProvider(s.name);return yield u.verify(N(C({},s),{name:u.name}),r,c,a,...o)}))}encrypt(...e){return z(this,null,(function*(){this.checkRequiredArguments(e,3,"encrypt");const[t,r,n,...i]=e;this.checkCryptoKey(r);const o=this.prepareAlgorithm(t),s=uo.BufferSourceConverter.toArrayBuffer(n),a=this.getProvider(o.name);return yield a.encrypt(N(C({},o),{name:a.name}),r,s,{keyUsage:!0},...i)}))}decrypt(...e){return z(this,null,(function*(){this.checkRequiredArguments(e,3,"decrypt");const[t,r,n,...i]=e;this.checkCryptoKey(r);const o=this.prepareAlgorithm(t),s=uo.BufferSourceConverter.toArrayBuffer(n),a=this.getProvider(o.name);return yield a.decrypt(N(C({},o),{name:a.name}),r,s,{keyUsage:!0},...i)}))}deriveBits(...e){return z(this,null,(function*(){this.checkRequiredArguments(e,3,"deriveBits");const[t,r,n,...i]=e;this.checkCryptoKey(r);const o=this.prepareAlgorithm(t),s=this.getProvider(o.name);return yield s.deriveBits(N(C({},o),{name:s.name}),r,n,{keyUsage:!0},...i)}))}deriveKey(...e){return z(this,null,(function*(){this.checkRequiredArguments(e,5,"deriveKey");const[t,r,n,i,o,...s]=e,a=this.prepareAlgorithm(n);this.getProvider(a.name).checkDerivedKeyParams(a);const c=this.prepareAlgorithm(t),u=this.getProvider(c.name);u.checkCryptoKey(r,"deriveKey");const l=yield u.deriveBits(N(C({},c),{name:u.name}),r,n.length||512,{keyUsage:!1},...s);return this.importKey("raw",l,n,i,o,...s)}))}exportKey(...e){return z(this,null,(function*(){this.checkRequiredArguments(e,2,"exportKey");const[t,r,...n]=e;this.checkCryptoKey(r);const i=this.getProvider(r.algorithm.name);return yield i.exportKey(t,r,...n)}))}importKey(...e){return z(this,null,(function*(){this.checkRequiredArguments(e,5,"importKey");const[t,r,n,i,o,...s]=e,a=this.prepareAlgorithm(n),c=this.getProvider(a.name);if(-1!==["pkcs8","spki","raw"].indexOf(t)){const e=uo.BufferSourceConverter.toArrayBuffer(r);return c.importKey(t,e,N(C({},a),{name:c.name}),i,o,...s)}if(!r.kty)throw new TypeError("keyData: Is not JSON");return c.importKey(t,r,N(C({},a),{name:c.name}),i,o,...s)}))}wrapKey(e,t,r,n,...i){return z(this,null,(function*(){let o=yield this.exportKey(e,t,...i);if("jwk"===e){const e=JSON.stringify(o);o=uo.Convert.FromUtf8String(e)}const s=this.prepareAlgorithm(n),a=uo.BufferSourceConverter.toArrayBuffer(o),c=this.getProvider(s.name);return c.encrypt(N(C({},s),{name:c.name}),r,a,{keyUsage:!1},...i)}))}unwrapKey(e,t,r,n,i,o,s,...a){return z(this,null,(function*(){const c=this.prepareAlgorithm(n),u=uo.BufferSourceConverter.toArrayBuffer(t),l=this.getProvider(c.name);let d=yield l.decrypt(N(C({},c),{name:l.name}),r,u,{keyUsage:!1},...a);if("jwk"===e)try{d=JSON.parse(uo.Convert.ToUtf8String(d))}catch(e){const t=new TypeError("wrappedKey: Is not a JSON");throw t.internal=e,t}return this.importKey(e,d,i,o,s,...a)}))}checkRequiredArguments(e,t,r){if(e.length<t)throw new TypeError(`Failed to execute '${r}' on 'SubtleCrypto': ${t} arguments required, but only ${e.length} present`)}prepareAlgorithm(e){if("string"==typeof e)return{name:e};if(Al.isHashedAlgorithm(e)){const t=C({},e);return t.hash=this.prepareAlgorithm(e.hash),t}return C({},e)}getProvider(e){const t=this.providers.get(e);if(!t)throw new au("Unrecognized name");return t}checkCryptoKey(e){if(!(e instanceof Tu))throw new TypeError("Key is not of type 'CryptoKey'")}};I(Al,"SubtleCrypto");var El=R(K()),Sl={fromJSON:e=>Buffer.from(El.Convert.FromBase64Url(e)),toJSON:e=>El.Convert.ToBase64Url(e)},xl=class extends Tu{constructor(){super(...arguments),this.data=Buffer.alloc(0),this.algorithm={name:""},this.extractable=!1,this.type="secret",this.usages=[],this.kty="oct",this.alg=""}};I(xl,"CryptoKey"),mc([ou({name:"ext",type:Fc.Boolean,optional:!0})],xl.prototype,"extractable",void 0),mc([ou({name:"key_ops",type:Fc.String,repeated:!0,optional:!0})],xl.prototype,"usages",void 0),mc([ou({type:Fc.String})],xl.prototype,"kty",void 0),mc([ou({type:Fc.String,optional:!0})],xl.prototype,"alg",void 0);var Ml=class extends xl{constructor(){super(...arguments),this.kty="oct",this.type="secret"}};I(Ml,"SymmetricKey");var _l=class extends xl{};I(_l,"AsymmetricKey");var kl=class extends Ml{get alg(){switch(this.algorithm.name.toUpperCase()){case"AES-CBC":return`A${this.algorithm.length}CBC`;case"AES-CTR":return`A${this.algorithm.length}CTR`;case"AES-GCM":return`A${this.algorithm.length}GCM`;case"AES-KW":return`A${this.algorithm.length}KW`;case"AES-CMAC":return`A${this.algorithm.length}CMAC`;case"AES-ECB":return`A${this.algorithm.length}ECB`;default:throw new au("Unsupported algorithm name")}}set alg(e){}};I(kl,"AesCryptoKey"),mc([ou({name:"k",converter:Sl})],kl.prototype,"data",void 0);var Tl=new WeakMap;function Cl(e){const t=Tl.get(e);if(!t)throw new uu("Cannot get CryptoKey from secure storage");return t}function Nl(e){const t=Tu.create(e.algorithm,e.type,e.extractable,e.usages);return Object.freeze(t),Tl.set(t,e),t}I(Cl,"getCryptoKey"),I(Nl,"setCryptoKey");var Il=class{static generateKey(e,t,r){return z(this,null,(function*(){const n=new kl;return n.algorithm=e,n.extractable=t,n.usages=r,n.data=s.default.randomBytes(e.length>>3),n}))}static exportKey(e,t){return z(this,null,(function*(){if(!(t instanceof kl))throw new Error("key: Is not AesCryptoKey");switch(e.toLowerCase()){case"jwk":return ru.toJSON(t);case"raw":return new Uint8Array(t.data).buffer;default:throw new uu("format: Must be 'jwk' or 'raw'")}}))}static importKey(e,t,r,n,i){return z(this,null,(function*(){let o;switch(e.toLowerCase()){case"jwk":o=nu.fromJSON(t,{targetSchema:kl});break;case"raw":o=new kl,o.data=Buffer.from(t);break;default:throw new uu("format: Must be 'jwk' or 'raw'")}switch(o.algorithm=r,o.algorithm.length=o.data.length<<3,o.extractable=n,o.usages=i,o.algorithm.length){case 128:case 192:case 256:break;default:throw new uu("keyData: Is wrong key length")}return o}))}static encrypt(e,t,r){return z(this,null,(function*(){switch(e.name.toUpperCase()){case"AES-CBC":return this.encryptAesCBC(e,t,Buffer.from(r));case"AES-CTR":return this.encryptAesCTR(e,t,Buffer.from(r));case"AES-GCM":return this.encryptAesGCM(e,t,Buffer.from(r));case"AES-KW":return this.encryptAesKW(e,t,Buffer.from(r));case"AES-ECB":return this.encryptAesECB(e,t,Buffer.from(r));default:throw new uu("algorithm: Is not recognized")}}))}static decrypt(e,t,r){return z(this,null,(function*(){if(!(t instanceof kl))throw new Error("key: Is not AesCryptoKey");switch(e.name.toUpperCase()){case"AES-CBC":return this.decryptAesCBC(e,t,Buffer.from(r));case"AES-CTR":return this.decryptAesCTR(e,t,Buffer.from(r));case"AES-GCM":return this.decryptAesGCM(e,t,Buffer.from(r));case"AES-KW":return this.decryptAesKW(e,t,Buffer.from(r));case"AES-ECB":return this.decryptAesECB(e,t,Buffer.from(r));default:throw new uu("algorithm: Is not recognized")}}))}static encryptAesCBC(e,t,r){return z(this,null,(function*(){const n=s.default.createCipheriv(`aes-${t.algorithm.length}-cbc`,t.data,new Uint8Array(e.iv));let i=n.update(r);i=Buffer.concat([i,n.final()]);return new Uint8Array(i).buffer}))}static decryptAesCBC(e,t,r){return z(this,null,(function*(){const n=s.default.createDecipheriv(`aes-${t.algorithm.length}-cbc`,t.data,new Uint8Array(e.iv));let i=n.update(r);return i=Buffer.concat([i,n.final()]),new Uint8Array(i).buffer}))}static encryptAesCTR(e,t,r){return z(this,null,(function*(){const n=s.default.createCipheriv(`aes-${t.algorithm.length}-ctr`,t.data,Buffer.from(e.counter));let i=n.update(r);i=Buffer.concat([i,n.final()]);return new Uint8Array(i).buffer}))}static decryptAesCTR(e,t,r){return z(this,null,(function*(){const n=s.default.createDecipheriv(`aes-${t.algorithm.length}-ctr`,t.data,new Uint8Array(e.counter));let i=n.update(r);return i=Buffer.concat([i,n.final()]),new Uint8Array(i).buffer}))}static encryptAesGCM(e,t,r){return z(this,null,(function*(){const n=s.default.createCipheriv(`aes-${t.algorithm.length}-gcm`,t.data,Buffer.from(e.iv),{authTagLength:(e.tagLength||128)>>3});e.additionalData&&n.setAAD(Buffer.from(e.additionalData));let i=n.update(r);i=Buffer.concat([i,n.final(),n.getAuthTag()]);return new Uint8Array(i).buffer}))}static decryptAesGCM(e,t,r){return z(this,null,(function*(){const n=s.default.createDecipheriv(`aes-${t.algorithm.length}-gcm`,t.data,new Uint8Array(e.iv)),i=(e.tagLength||128)>>3,o=r.slice(0,r.length-i),a=r.slice(r.length-i);e.additionalData&&n.setAAD(Buffer.from(e.additionalData)),n.setAuthTag(a);let c=n.update(o);return c=Buffer.concat([c,n.final()]),new Uint8Array(c).buffer}))}static encryptAesKW(e,t,r){return z(this,null,(function*(){const e=s.default.createCipheriv(`id-aes${t.algorithm.length}-wrap`,t.data,this.AES_KW_IV);let n=e.update(r);return n=Buffer.concat([n,e.final()]),new Uint8Array(n).buffer}))}static decryptAesKW(e,t,r){return z(this,null,(function*(){const e=s.default.createDecipheriv(`id-aes${t.algorithm.length}-wrap`,t.data,this.AES_KW_IV);let n=e.update(r);return n=Buffer.concat([n,e.final()]),new Uint8Array(n).buffer}))}static encryptAesECB(e,t,r){return z(this,null,(function*(){const e=s.default.createCipheriv(`aes-${t.algorithm.length}-ecb`,t.data,new Uint8Array(0));let n=e.update(r);n=Buffer.concat([n,e.final()]);return new Uint8Array(n).buffer}))}static decryptAesECB(e,t,r){return z(this,null,(function*(){const e=s.default.createDecipheriv(`aes-${t.algorithm.length}-ecb`,t.data,new Uint8Array(0));let n=e.update(r);return n=Buffer.concat([n,e.final()]),new Uint8Array(n).buffer}))}};I(Il,"AesCrypto"),Il.AES_KW_IV=Buffer.from("A6A6A6A6A6A6A6A6","hex");var Bl=class extends pu{onGenerateKey(e,t,r){return z(this,null,(function*(){return Nl(yield Il.generateKey({name:this.name,length:e.length},t,r))}))}onEncrypt(e,t,r){return z(this,null,(function*(){return Il.encrypt(e,Cl(t),new Uint8Array(r))}))}onDecrypt(e,t,r){return z(this,null,(function*(){return Il.decrypt(e,Cl(t),new Uint8Array(r))}))}onExportKey(e,t){return z(this,null,(function*(){return Il.exportKey(e,Cl(t))}))}onImportKey(e,t,r,n,i){return z(this,null,(function*(){return Nl(yield Il.importKey(e,t,{name:r.name},n,i))}))}checkCryptoKey(e,t){if(super.checkCryptoKey(e,t),!(Cl(e)instanceof kl))throw new TypeError("key: Is not a AesCryptoKey")}};I(Bl,"AesCbcProvider");var Ol=Buffer.from([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Dl=Buffer.from([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,135]);function jl(e){const t=Buffer.alloc(e.length),r=e.length-1;for(let n=0;n<r;n++)t[n]=e[n]<<1,128&e[n+1]&&(t[n]+=1);return t[r]=e[r]<<1,t}function Ll(e,t){const r=Math.min(e.length,t.length),n=Buffer.alloc(r);for(let i=0;i<r;i++)n[i]=e[i]^t[i];return n}function Pl(e,t){const r=a.createCipheriv("aes"+(e.length<<3),e,Ol),n=r.update(t);return r.final(),n}function Rl(e,t){const r=Buffer.alloc(16),n=16*t,i=n+16;return e.copy(r,0,n,i),r}function Ul(e,t){const r=Buffer.alloc(16),n=16*t,i=e.length;return r.fill(0),e.copy(r,0,n,i),r[i-n]=128,r}function zl(e){const t=Pl(e,Ol);let r=jl(t);128&t[0]&&(r=Ll(r,Dl));let n=jl(r);return 128&r[0]&&(n=Ll(n,Dl)),{subkey1:r,subkey2:n}}function Kl(e,t){const r=zl(e);let n,i,o=Math.ceil(t.length/16);0===o?(o=1,n=!1):n=t.length%16==0;const s=o-1;i=n?Ll(Rl(t,s),r.subkey1):Ll(Ul(t,s),r.subkey2);let a,c=Ol;for(let r=0;r<s;r++)a=Ll(c,Rl(t,r)),c=Pl(e,a);return a=Ll(i,c),Pl(e,a)}I(jl,"bitShiftLeft"),I(Ll,"xor"),I(Pl,"aes"),I(Rl,"getMessageBlock"),I(Ul,"getPaddedMessageBlock"),I(zl,"generateSubkeys"),I(Kl,"aesCmac");var Fl=class extends mu{onGenerateKey(e,t,r){return z(this,null,(function*(){return Nl(yield Il.generateKey({name:this.name,length:e.length},t,r))}))}onSign(e,t,r){return z(this,null,(function*(){const e=Kl(Cl(t).data,Buffer.from(r));return new Uint8Array(e).buffer}))}onVerify(e,t,r,n){return z(this,null,(function*(){const i=yield this.sign(e,t,n);return 0===Buffer.from(r).compare(Buffer.from(i))}))}onExportKey(e,t){return z(this,null,(function*(){return Il.exportKey(e,Cl(t))}))}onImportKey(e,t,r,n,i){return z(this,null,(function*(){return Nl(yield Il.importKey(e,t,{name:r.name},n,i))}))}checkCryptoKey(e,t){if(super.checkCryptoKey(e,t),!(Cl(e)instanceof kl))throw new TypeError("key: Is not a AesCryptoKey")}};I(Fl,"AesCmacProvider");var Hl=class extends gu{onGenerateKey(e,t,r){return z(this,null,(function*(){return Nl(yield Il.generateKey({name:this.name,length:e.length},t,r))}))}onEncrypt(e,t,r){return z(this,null,(function*(){return Il.encrypt(e,Cl(t),new Uint8Array(r))}))}onDecrypt(e,t,r){return z(this,null,(function*(){return Il.decrypt(e,Cl(t),new Uint8Array(r))}))}onExportKey(e,t){return z(this,null,(function*(){return Il.exportKey(e,Cl(t))}))}onImportKey(e,t,r,n,i){return z(this,null,(function*(){return Nl(yield Il.importKey(e,t,{name:r.name},n,i))}))}checkCryptoKey(e,t){if(super.checkCryptoKey(e,t),!(Cl(e)instanceof kl))throw new TypeError("key: Is not a AesCryptoKey")}};I(Hl,"AesCtrProvider");var $l=class extends yu{onGenerateKey(e,t,r){return z(this,null,(function*(){return Nl(yield Il.generateKey({name:this.name,length:e.length},t,r))}))}onEncrypt(e,t,r){return z(this,null,(function*(){return Il.encrypt(e,Cl(t),new Uint8Array(r))}))}onDecrypt(e,t,r){return z(this,null,(function*(){return Il.decrypt(e,Cl(t),new Uint8Array(r))}))}onExportKey(e,t){return z(this,null,(function*(){return Il.exportKey(e,Cl(t))}))}onImportKey(e,t,r,n,i){return z(this,null,(function*(){return Nl(yield Il.importKey(e,t,{name:r.name},n,i))}))}checkCryptoKey(e,t){if(super.checkCryptoKey(e,t),!(Cl(e)instanceof kl))throw new TypeError("key: Is not a AesCryptoKey")}};I($l,"AesGcmProvider");var Vl=class extends vu{onGenerateKey(e,t,r){return z(this,null,(function*(){return Nl(yield Il.generateKey({name:this.name,length:e.length},t,r))}))}onExportKey(e,t){return z(this,null,(function*(){return Il.exportKey(e,Cl(t))}))}onImportKey(e,t,r,n,i){return z(this,null,(function*(){return Nl(yield Il.importKey(e,t,{name:r.name},n,i))}))}onEncrypt(e,t,r){return z(this,null,(function*(){return Il.encrypt(e,Cl(t),new Uint8Array(r))}))}onDecrypt(e,t,r){return z(this,null,(function*(){return Il.decrypt(e,Cl(t),new Uint8Array(r))}))}checkCryptoKey(e,t){if(super.checkCryptoKey(e,t),!(Cl(e)instanceof kl))throw new TypeError("key: Is not a AesCryptoKey")}};I(Vl,"AesKwProvider");var ql=class extends bu{onGenerateKey(e,t,r){return z(this,null,(function*(){return Nl(yield Il.generateKey({name:this.name,length:e.length},t,r))}))}onEncrypt(e,t,r){return z(this,null,(function*(){return Il.encrypt(e,Cl(t),new Uint8Array(r))}))}onDecrypt(e,t,r){return z(this,null,(function*(){return Il.decrypt(e,Cl(t),new Uint8Array(r))}))}onExportKey(e,t){return z(this,null,(function*(){return Il.exportKey(e,Cl(t))}))}onImportKey(e,t,r,n,i){return z(this,null,(function*(){return Nl(yield Il.importKey(e,t,{name:r.name},n,i))}))}checkCryptoKey(e,t){if(super.checkCryptoKey(e,t),!(Cl(e)instanceof kl))throw new TypeError("key: Is not a AesCryptoKey")}};I(ql,"AesEcbProvider");var Gl=class extends Ml{get alg(){switch(this.algorithm.name.toUpperCase()){case"DES-CBC":return"DES-CBC";case"DES-EDE3-CBC":return"3DES-CBC";default:throw new au("Unsupported algorithm name")}}set alg(e){}};I(Gl,"DesCryptoKey"),mc([ou({name:"k",converter:Sl})],Gl.prototype,"data",void 0);var Yl=class{static generateKey(e,t,r){return z(this,null,(function*(){const n=new Gl;return n.algorithm=e,n.extractable=t,n.usages=r,n.data=s.default.randomBytes(e.length>>3),n}))}static exportKey(e,t){return z(this,null,(function*(){switch(e.toLowerCase()){case"jwk":return ru.toJSON(t);case"raw":return new Uint8Array(t.data).buffer;default:throw new uu("format: Must be 'jwk' or 'raw'")}}))}static importKey(e,t,r,n,i){return z(this,null,(function*(){let o;switch(e.toLowerCase()){case"jwk":o=nu.fromJSON(t,{targetSchema:Gl});break;case"raw":o=new Gl,o.data=Buffer.from(t);break;default:throw new uu("format: Must be 'jwk' or 'raw'")}return o.algorithm=r,o.extractable=n,o.usages=i,o}))}static encrypt(e,t,r){return z(this,null,(function*(){switch(e.name.toUpperCase()){case"DES-CBC":return this.encryptDesCBC(e,t,Buffer.from(r));case"DES-EDE3-CBC":return this.encryptDesEDE3CBC(e,t,Buffer.from(r));default:throw new uu("algorithm: Is not recognized")}}))}static decrypt(e,t,r){return z(this,null,(function*(){if(!(t instanceof Gl))throw new Error("key: Is not DesCryptoKey");switch(e.name.toUpperCase()){case"DES-CBC":return this.decryptDesCBC(e,t,Buffer.from(r));case"DES-EDE3-CBC":return this.decryptDesEDE3CBC(e,t,Buffer.from(r));default:throw new uu("algorithm: Is not recognized")}}))}static encryptDesCBC(e,t,r){return z(this,null,(function*(){const n=s.default.createCipheriv("des-cbc",t.data,new Uint8Array(e.iv));let i=n.update(r);i=Buffer.concat([i,n.final()]);return new Uint8Array(i).buffer}))}static decryptDesCBC(e,t,r){return z(this,null,(function*(){const n=s.default.createDecipheriv("des-cbc",t.data,new Uint8Array(e.iv));let i=n.update(r);return i=Buffer.concat([i,n.final()]),new Uint8Array(i).buffer}))}static encryptDesEDE3CBC(e,t,r){return z(this,null,(function*(){const n=s.default.createCipheriv("des-ede3-cbc",t.data,Buffer.from(e.iv));let i=n.update(r);i=Buffer.concat([i,n.final()]);return new Uint8Array(i).buffer}))}static decryptDesEDE3CBC(e,t,r){return z(this,null,(function*(){const n=s.default.createDecipheriv("des-ede3-cbc",t.data,new Uint8Array(e.iv));let i=n.update(r);return i=Buffer.concat([i,n.final()]),new Uint8Array(i).buffer}))}};I(Yl,"DesCrypto");var Jl=class extends wu{constructor(){super(...arguments),this.keySizeBits=64,this.ivSize=8,this.name="DES-CBC"}onGenerateKey(e,t,r){return z(this,null,(function*(){return Nl(yield Yl.generateKey({name:this.name,length:this.keySizeBits},t,r))}))}onEncrypt(e,t,r){return z(this,null,(function*(){return Yl.encrypt(e,Cl(t),new Uint8Array(r))}))}onDecrypt(e,t,r){return z(this,null,(function*(){return Yl.decrypt(e,Cl(t),new Uint8Array(r))}))}onExportKey(e,t){return z(this,null,(function*(){return Yl.exportKey(e,Cl(t))}))}onImportKey(e,t,r,n,i){return z(this,null,(function*(){const r=yield Yl.importKey(e,t,{name:this.name,length:this.keySizeBits},n,i);if(r.data.length!==this.keySizeBits>>3)throw new uu("keyData: Wrong key size");return Nl(r)}))}checkCryptoKey(e,t){if(super.checkCryptoKey(e,t),!(Cl(e)instanceof Gl))throw new TypeError("key: Is not a DesCryptoKey")}};I(Jl,"DesCbcProvider");var Ql=class extends wu{constructor(){super(...arguments),this.keySizeBits=192,this.ivSize=8,this.name="DES-EDE3-CBC"}onGenerateKey(e,t,r){return z(this,null,(function*(){return Nl(yield Yl.generateKey({name:this.name,length:this.keySizeBits},t,r))}))}onEncrypt(e,t,r){return z(this,null,(function*(){return Yl.encrypt(e,Cl(t),new Uint8Array(r))}))}onDecrypt(e,t,r){return z(this,null,(function*(){return Yl.decrypt(e,Cl(t),new Uint8Array(r))}))}onExportKey(e,t){return z(this,null,(function*(){return Yl.exportKey(e,Cl(t))}))}onImportKey(e,t,r,n,i){return z(this,null,(function*(){const r=yield Yl.importKey(e,t,{name:this.name,length:this.keySizeBits},n,i);if(r.data.length!==this.keySizeBits>>3)throw new uu("keyData: Wrong key size");return Nl(r)}))}checkCryptoKey(e,t){if(super.checkCryptoKey(e,t),!(Cl(e)instanceof Gl))throw new TypeError("key: Is not a DesCryptoKey")}};function Wl(e){switch(e.name.toUpperCase()){case"RSA-OAEP":{const t=/(\d+)$/.exec(e.hash.name)[1];return"RSA-OAEP"+("1"!==t?`-${t}`:"")}case"RSASSA-PKCS1-V1_5":return`RS${/(\d+)$/.exec(e.hash.name)[1]}`;case"RSA-PSS":return`PS${/(\d+)$/.exec(e.hash.name)[1]}`;case"RSA-PKCS1":return"RS1";default:throw new uu("algorithm: Is not recognized")}}I(Ql,"DesEde3CbcProvider"),I(Wl,"getJwkAlgorithm");var Xl=class extends _l{constructor(){super(...arguments),this.type="private"}getKey(){const e=ac.parse(this.data,dl.PrivateKeyInfo);return ac.parse(e.privateKey,dl.RsaPrivateKey)}toJSON(){const e=this.getKey(),t={kty:"RSA",alg:Wl(this.algorithm),key_ops:this.usages,ext:this.extractable};return Object.assign(t,ru.toJSON(e))}fromJSON(e){const t=nu.fromJSON(e,{targetSchema:dl.RsaPrivateKey}),r=new dl.PrivateKeyInfo;r.privateKeyAlgorithm.algorithm="1.2.840.113549.1.1.1",r.privateKeyAlgorithm.parameters=null,r.privateKey=cc.serialize(t),this.data=Buffer.from(cc.serialize(r))}};I(Xl,"RsaPrivateKey");var Zl=class extends _l{constructor(){super(...arguments),this.type="public"}getKey(){const e=ac.parse(this.data,dl.PublicKeyInfo);return ac.parse(e.publicKey,dl.RsaPublicKey)}toJSON(){const e=this.getKey(),t={kty:"RSA",alg:Wl(this.algorithm),key_ops:this.usages,ext:this.extractable};return Object.assign(t,ru.toJSON(e))}fromJSON(e){const t=nu.fromJSON(e,{targetSchema:dl.RsaPublicKey}),r=new dl.PublicKeyInfo;r.publicKeyAlgorithm.algorithm="1.2.840.113549.1.1.1",r.publicKeyAlgorithm.parameters=null,r.publicKey=cc.serialize(t),this.data=Buffer.from(cc.serialize(r))}};I(Zl,"RsaPublicKey");var ed=class{static generateKey(e,t,r){return z(this,null,(function*(){const n=new Xl;n.algorithm=e,n.extractable=t,n.usages=r.filter((e=>-1!==this.privateKeyUsages.indexOf(e)));const i=new Zl;i.algorithm=e,i.extractable=!0,i.usages=r.filter((e=>-1!==this.publicKeyUsages.indexOf(e)));const o=Buffer.concat([Buffer.alloc(4-e.publicExponent.byteLength,0),Buffer.from(e.publicExponent)]).readInt32BE(0),a=s.default.generateKeyPairSync("rsa",{modulusLength:e.modulusLength,publicExponent:o,publicKeyEncoding:{format:"der",type:"spki"},privateKeyEncoding:{format:"der",type:"pkcs8"}});n.data=a.privateKey,i.data=a.publicKey;return{privateKey:n,publicKey:i}}))}static exportKey(e,t){return z(this,null,(function*(){switch(e.toLowerCase()){case"jwk":return ru.toJSON(t);case"pkcs8":case"spki":return new Uint8Array(t.data).buffer;default:throw new uu("format: Must be 'jwk', 'pkcs8' or 'spki'")}}))}static importKey(e,t,r,n,i){return z(this,null,(function*(){switch(e.toLowerCase()){case"jwk":if(t.d){const e=nu.fromJSON(t,{targetSchema:dl.RsaPrivateKey});return this.importPrivateKey(e,r,n,i)}{const e=nu.fromJSON(t,{targetSchema:dl.RsaPublicKey});return this.importPublicKey(e,r,n,i)}case"spki":{const e=ac.parse(new Uint8Array(t),dl.PublicKeyInfo),o=ac.parse(e.publicKey,dl.RsaPublicKey);return this.importPublicKey(o,r,n,i)}case"pkcs8":{const e=ac.parse(new Uint8Array(t),dl.PrivateKeyInfo),o=ac.parse(e.privateKey,dl.RsaPrivateKey);return this.importPrivateKey(o,r,n,i)}default:throw new uu("format: Must be 'jwk', 'pkcs8' or 'spki'")}}))}static sign(e,t,r){return z(this,null,(function*(){switch(e.name.toUpperCase()){case"RSA-PSS":case"RSASSA-PKCS1-V1_5":return this.signRsa(e,t,r);default:throw new uu("algorithm: Is not recognized")}}))}static verify(e,t,r,n){return z(this,null,(function*(){switch(e.name.toUpperCase()){case"RSA-PSS":case"RSASSA-PKCS1-V1_5":return this.verifySSA(e,t,n,r);default:throw new uu("algorithm: Is not recognized")}}))}static encrypt(e,t,r){return z(this,null,(function*(){if("RSA-OAEP"===e.name.toUpperCase())return this.encryptOAEP(e,t,r);throw new uu("algorithm: Is not recognized")}))}static decrypt(e,t,r){return z(this,null,(function*(){if("RSA-OAEP"===e.name.toUpperCase())return this.decryptOAEP(e,t,r);throw new uu("algorithm: Is not recognized")}))}static importPrivateKey(e,t,r,n){const i=new dl.PrivateKeyInfo;i.privateKeyAlgorithm.algorithm="1.2.840.113549.1.1.1",i.privateKeyAlgorithm.parameters=null,i.privateKey=cc.serialize(e);const o=new Xl;return o.data=Buffer.from(cc.serialize(i)),o.algorithm=Object.assign({},t),o.algorithm.publicExponent=new Uint8Array(e.publicExponent),o.algorithm.modulusLength=e.modulus.byteLength<<3,o.extractable=r,o.usages=n,o}static importPublicKey(e,t,r,n){const i=new dl.PublicKeyInfo;i.publicKeyAlgorithm.algorithm="1.2.840.113549.1.1.1",i.publicKeyAlgorithm.parameters=null,i.publicKey=cc.serialize(e);const o=new Zl;return o.data=Buffer.from(cc.serialize(i)),o.algorithm=Object.assign({},t),o.algorithm.publicExponent=new Uint8Array(e.publicExponent),o.algorithm.modulusLength=e.modulus.byteLength<<3,o.extractable=r,o.usages=n,o}static getCryptoAlgorithm(e){switch(e.hash.name.toUpperCase()){case"SHA-1":return"RSA-SHA1";case"SHA-256":return"RSA-SHA256";case"SHA-384":return"RSA-SHA384";case"SHA-512":return"RSA-SHA512";case"SHA3-256":return"RSA-SHA3-256";case"SHA3-384":return"RSA-SHA3-384";case"SHA3-512":return"RSA-SHA3-512";default:throw new uu("algorithm.hash: Is not recognized")}}static signRsa(e,t,r){const n=this.getCryptoAlgorithm(t.algorithm),i=s.default.createSign(n);i.update(Buffer.from(r)),t.pem||(t.pem=`-----BEGIN PRIVATE KEY-----\n${t.data.toString("base64")}\n-----END PRIVATE KEY-----`);const o={key:t.pem};"RSA-PSS"===e.name.toUpperCase()&&(o.padding=s.default.constants.RSA_PKCS1_PSS_PADDING,o.saltLength=e.saltLength);const a=i.sign(o);return new Uint8Array(a).buffer}static verifySSA(e,t,r,n){const i=this.getCryptoAlgorithm(t.algorithm),o=s.default.createVerify(i);o.update(Buffer.from(r)),t.pem||(t.pem=`-----BEGIN PUBLIC KEY-----\n${t.data.toString("base64")}\n-----END PUBLIC KEY-----`);const a={key:t.pem};"RSA-PSS"===e.name.toUpperCase()&&(a.padding=s.default.constants.RSA_PKCS1_PSS_PADDING,a.saltLength=e.saltLength);return o.verify(a,n)}static encryptOAEP(e,t,r){const n={key:`-----BEGIN PUBLIC KEY-----\n${t.data.toString("base64")}\n-----END PUBLIC KEY-----`,padding:s.default.constants.RSA_PKCS1_OAEP_PADDING};return e.label,new Uint8Array(s.default.publicEncrypt(n,r)).buffer}static decryptOAEP(e,t,r){const n={key:`-----BEGIN PRIVATE KEY-----\n${t.data.toString("base64")}\n-----END PRIVATE KEY-----`,padding:s.default.constants.RSA_PKCS1_OAEP_PADDING};return e.label,new Uint8Array(s.default.privateDecrypt(n,r)).buffer}};I(ed,"RsaCrypto"),ed.publicKeyUsages=["verify","encrypt","wrapKey"],ed.privateKeyUsages=["sign","decrypt","unwrapKey"];var td=class extends Eu{constructor(){super(...arguments),this.hashAlgorithms=["SHA-1","SHA-256","SHA-384","SHA-512","shake128","shake256","SHA3-256","SHA3-384","SHA3-512"]}onGenerateKey(e,t,r){return z(this,null,(function*(){const n=yield ed.generateKey(N(C({},e),{name:this.name}),t,r);return{privateKey:Nl(n.privateKey),publicKey:Nl(n.publicKey)}}))}onSign(e,t,r){return z(this,null,(function*(){return ed.sign(e,Cl(t),new Uint8Array(r))}))}onVerify(e,t,r,n){return z(this,null,(function*(){return ed.verify(e,Cl(t),new Uint8Array(r),new Uint8Array(n))}))}onExportKey(e,t){return z(this,null,(function*(){return ed.exportKey(e,Cl(t))}))}onImportKey(e,t,r,n,i){return z(this,null,(function*(){return Nl(yield ed.importKey(e,t,N(C({},r),{name:this.name}),n,i))}))}checkCryptoKey(e,t){super.checkCryptoKey(e,t);const r=Cl(e);if(!(r instanceof Xl||r instanceof Zl))throw new TypeError("key: Is not RSA CryptoKey")}};I(td,"RsaSsaProvider");var rd=class extends Su{constructor(){super(...arguments),this.hashAlgorithms=["SHA-1","SHA-256","SHA-384","SHA-512","shake128","shake256","SHA3-256","SHA3-384","SHA3-512"]}onGenerateKey(e,t,r){return z(this,null,(function*(){const n=yield ed.generateKey(N(C({},e),{name:this.name}),t,r);return{privateKey:Nl(n.privateKey),publicKey:Nl(n.publicKey)}}))}onSign(e,t,r){return z(this,null,(function*(){return ed.sign(e,Cl(t),new Uint8Array(r))}))}onVerify(e,t,r,n){return z(this,null,(function*(){return ed.verify(e,Cl(t),new Uint8Array(r),new Uint8Array(n))}))}onExportKey(e,t){return z(this,null,(function*(){return ed.exportKey(e,Cl(t))}))}onImportKey(e,t,r,n,i){return z(this,null,(function*(){return Nl(yield ed.importKey(e,t,N(C({},r),{name:this.name}),n,i))}))}checkCryptoKey(e,t){super.checkCryptoKey(e,t);const r=Cl(e);if(!(r instanceof Xl||r instanceof Zl))throw new TypeError("key: Is not RSA CryptoKey")}};I(rd,"RsaPssProvider");var nd=class{static size(e){switch(e.name.toUpperCase()){case"SHA-1":return 160;case"SHA-256":case"SHA3-256":return 256;case"SHA-384":case"SHA3-384":return 384;case"SHA-512":case"SHA3-512":return 512;default:throw new Error("Unrecognized name")}}static getAlgorithmName(e){switch(e.name.toUpperCase()){case"SHA-1":return"sha1";case"SHA-256":return"sha256";case"SHA-384":return"sha384";case"SHA-512":return"sha512";case"SHA3-256":return"sha3-256";case"SHA3-384":return"sha3-384";case"SHA3-512":return"sha3-512";default:throw new Error("Unrecognized name")}}static digest(e,t){const r=this.getAlgorithmName(e),n=s.default.createHash(r).update(Buffer.from(t)).digest();return new Uint8Array(n).buffer}};I(nd,"ShaCrypto");var id=class extends xu{onGenerateKey(e,t,r){return z(this,null,(function*(){const n=yield ed.generateKey(N(C({},e),{name:this.name}),t,r);return{privateKey:Nl(n.privateKey),publicKey:Nl(n.publicKey)}}))}onEncrypt(e,t,r){return z(this,null,(function*(){const n=Cl(t),i=new Uint8Array(r),o=Math.ceil(n.algorithm.modulusLength>>3),a=nd.size(n.algorithm.hash)>>3,c=i.byteLength,u=o-c-2*a-2;if(c>o-2*a-2)throw new Error("Data too large");const l=new Uint8Array(o),d=l.subarray(1,a+1),f=l.subarray(a+1);f.set(i,a+u+1);const h=s.default.createHash(n.algorithm.hash.name.replace("-","")).update(lo.BufferSourceConverter.toUint8Array(e.label||new Uint8Array(0))).digest();f.set(h,0),f[a+u]=1,s.default.randomFillSync(d);const p=this.mgf1(n.algorithm.hash,d,f.length);for(let e=0;e<f.length;e++)f[e]^=p[e];const m=this.mgf1(n.algorithm.hash,f,d.length);for(let e=0;e<d.length;e++)d[e]^=m[e];n.pem||(n.pem=`-----BEGIN PUBLIC KEY-----\n${n.data.toString("base64")}\n-----END PUBLIC KEY-----`);const g=s.default.publicEncrypt({key:n.pem,padding:s.default.constants.RSA_NO_PADDING},Buffer.from(l));return new Uint8Array(g).buffer}))}onDecrypt(e,t,r){return z(this,null,(function*(){const n=Cl(t),i=Math.ceil(n.algorithm.modulusLength>>3),o=nd.size(n.algorithm.hash)>>3;if(r.byteLength!==i)throw new Error("Bad data");n.pem||(n.pem=`-----BEGIN PRIVATE KEY-----\n${n.data.toString("base64")}\n-----END PRIVATE KEY-----`);let a=s.default.privateDecrypt({key:n.pem,padding:s.default.constants.RSA_NO_PADDING},Buffer.from(r));const c=a[0],u=a.subarray(1,o+1),l=a.subarray(o+1);if(0!==c)throw new Error("Decryption failed");const d=this.mgf1(n.algorithm.hash,l,u.length);for(let e=0;e<u.length;e++)u[e]^=d[e];const f=this.mgf1(n.algorithm.hash,u,l.length);for(let e=0;e<l.length;e++)l[e]^=f[e];const h=s.default.createHash(n.algorithm.hash.name.replace("-","")).update(lo.BufferSourceConverter.toUint8Array(e.label||new Uint8Array(0))).digest();for(let e=0;e<o;e++)if(h[e]!==l[e])throw new Error("Decryption failed");let p=o;for(;p<l.length;p++){const e=l[p];if(1===e)break;if(0!==e)throw new Error("Decryption failed")}if(p===l.length)throw new Error("Decryption failed");return a=l.subarray(p+1),new Uint8Array(a).buffer}))}onExportKey(e,t){return z(this,null,(function*(){return ed.exportKey(e,Cl(t))}))}onImportKey(e,t,r,n,i){return z(this,null,(function*(){return Nl(yield ed.importKey(e,t,N(C({},r),{name:this.name}),n,i))}))}checkCryptoKey(e,t){super.checkCryptoKey(e,t);const r=Cl(e);if(!(r instanceof Xl||r instanceof Zl))throw new TypeError("key: Is not RSA CryptoKey")}mgf1(e,t,r=0){const n=nd.size(e)>>3,i=new Uint8Array(r),o=new Uint8Array(4),a=Math.ceil(r/n);for(let r=0;r<a;r++){o[0]=r>>>24,o[1]=r>>>16&255,o[2]=r>>>8&255,o[3]=255&r;const a=i.subarray(r*n);let c=s.default.createHash(e.name.replace("-","")).update(t).update(o).digest();c.length>a.length&&(c=c.subarray(0,a.length)),a.set(c)}return i}};I(id,"RsaOaepProvider");var od=class extends fu{constructor(){super(...arguments),this.name="RSAES-PKCS1-v1_5",this.usages={publicKey:["encrypt","wrapKey"],privateKey:["decrypt","unwrapKey"]}}onGenerateKey(e,t,r){return z(this,null,(function*(){const n=yield ed.generateKey(N(C({},e),{name:this.name}),t,r);return{privateKey:Nl(n.privateKey),publicKey:Nl(n.publicKey)}}))}checkGenerateKeyParams(e){if(this.checkRequiredProperty(e,"publicExponent"),!(e.publicExponent&&e.publicExponent instanceof Uint8Array))throw new TypeError("publicExponent: Missing or not a Uint8Array");const t=El.Convert.ToBase64(e.publicExponent);if("Aw=="!==t&&"AQAB"!==t)throw new TypeError("publicExponent: Must be [3] or [1,0,1]");switch(this.checkRequiredProperty(e,"modulusLength"),e.modulusLength){case 1024:case 2048:case 4096:break;default:throw new TypeError("modulusLength: Must be 1024, 2048, or 4096")}}onEncrypt(e,t,r){return z(this,null,(function*(){const e=this.toCryptoOptions(t),n=a.publicEncrypt(e,new Uint8Array(r));return new Uint8Array(n).buffer}))}onDecrypt(e,t,r){return z(this,null,(function*(){const e=this.toCryptoOptions(t),n=a.privateDecrypt(e,new Uint8Array(r));return new Uint8Array(n).buffer}))}onExportKey(e,t){return z(this,null,(function*(){return ed.exportKey(e,Cl(t))}))}onImportKey(e,t,r,n,i){return z(this,null,(function*(){return Nl(yield ed.importKey(e,t,N(C({},r),{name:this.name}),n,i))}))}checkCryptoKey(e,t){super.checkCryptoKey(e,t);const r=Cl(e);if(!(r instanceof Xl||r instanceof Zl))throw new TypeError("key: Is not RSA CryptoKey")}toCryptoOptions(e){const t=e.type.toUpperCase();return{key:`-----BEGIN ${t} KEY-----\n${Cl(e).data.toString("base64")}\n-----END ${t} KEY-----`,padding:a.constants.RSA_PKCS1_PADDING}}};I(od,"RsaEsProvider");var sd={"1.2.840.10045.3.1.7":"P-256","P-256":"1.2.840.10045.3.1.7","1.3.132.0.34":"P-384","P-384":"1.3.132.0.34","1.3.132.0.35":"P-521","P-521":"1.3.132.0.35","1.3.132.0.10":"K-256","K-256":"1.3.132.0.10",brainpoolP160r1:"1.3.36.3.3.2.8.1.1.1","1.3.36.3.3.2.8.1.1.1":"brainpoolP160r1",brainpoolP160t1:"1.3.36.3.3.2.8.1.1.2","1.3.36.3.3.2.8.1.1.2":"brainpoolP160t1",brainpoolP192r1:"1.3.36.3.3.2.8.1.1.3","1.3.36.3.3.2.8.1.1.3":"brainpoolP192r1",brainpoolP192t1:"1.3.36.3.3.2.8.1.1.4","1.3.36.3.3.2.8.1.1.4":"brainpoolP192t1",brainpoolP224r1:"1.3.36.3.3.2.8.1.1.5","1.3.36.3.3.2.8.1.1.5":"brainpoolP224r1",brainpoolP224t1:"1.3.36.3.3.2.8.1.1.6","1.3.36.3.3.2.8.1.1.6":"brainpoolP224t1",brainpoolP256r1:"1.3.36.3.3.2.8.1.1.7","1.3.36.3.3.2.8.1.1.7":"brainpoolP256r1",brainpoolP256t1:"1.3.36.3.3.2.8.1.1.8","1.3.36.3.3.2.8.1.1.8":"brainpoolP256t1",brainpoolP320r1:"1.3.36.3.3.2.8.1.1.9","1.3.36.3.3.2.8.1.1.9":"brainpoolP320r1",brainpoolP320t1:"1.3.36.3.3.2.8.1.1.10","1.3.36.3.3.2.8.1.1.10":"brainpoolP320t1",brainpoolP384r1:"1.3.36.3.3.2.8.1.1.11","1.3.36.3.3.2.8.1.1.11":"brainpoolP384r1",brainpoolP384t1:"1.3.36.3.3.2.8.1.1.12","1.3.36.3.3.2.8.1.1.12":"brainpoolP384t1",brainpoolP512r1:"1.3.36.3.3.2.8.1.1.13","1.3.36.3.3.2.8.1.1.13":"brainpoolP512r1",brainpoolP512t1:"1.3.36.3.3.2.8.1.1.14","1.3.36.3.3.2.8.1.1.14":"brainpoolP512t1"};function ad(e){const t=sd[e];if(!t)throw new uu(`Cannot convert WebCrypto named curve '${e}' to OID`);return t}I(ad,"getOidByNamedCurve$1");var cd=class extends _l{constructor(){super(...arguments),this.type="private"}getKey(){const e=ac.parse(this.data,dl.PrivateKeyInfo);return ac.parse(e.privateKey,dl.EcPrivateKey)}toJSON(){const e=this.getKey(),t={kty:"EC",crv:this.algorithm.namedCurve,key_ops:this.usages,ext:this.extractable};return Object.assign(t,ru.toJSON(e))}fromJSON(e){if(!e.crv)throw new uu("Cannot get named curve from JWK. Property 'crv' is required");const t=new dl.PrivateKeyInfo;t.privateKeyAlgorithm.algorithm="1.2.840.10045.2.1",t.privateKeyAlgorithm.parameters=cc.serialize(new dl.ObjectIdentifier(ad(e.crv)));const r=nu.fromJSON(e,{targetSchema:dl.EcPrivateKey});return t.privateKey=cc.serialize(r),this.data=Buffer.from(cc.serialize(t)),this}};I(cd,"EcPrivateKey");var ud=class extends _l{constructor(){super(...arguments),this.type="public"}getKey(){const e=ac.parse(this.data,dl.PublicKeyInfo);return new dl.EcPublicKey(e.publicKey)}toJSON(){const e=this.getKey(),t={kty:"EC",crv:this.algorithm.namedCurve,key_ops:this.usages,ext:this.extractable};return Object.assign(t,ru.toJSON(e))}fromJSON(e){if(!e.crv)throw new uu("Cannot get named curve from JWK. Property 'crv' is required");const t=nu.fromJSON(e,{targetSchema:dl.EcPublicKey}),r=new dl.PublicKeyInfo;return r.publicKeyAlgorithm.algorithm="1.2.840.10045.2.1",r.publicKeyAlgorithm.parameters=cc.serialize(new dl.ObjectIdentifier(ad(e.crv))),r.publicKey=cc.toASN(t).valueHex,this.data=Buffer.from(cc.serialize(r)),this}};I(ud,"EcPublicKey");var ld=class extends fu{constructor(){super(...arguments),this.name="SHA-1",this.usages=[]}onDigest(e,t){return z(this,null,(function*(){return nd.digest(e,t)}))}};I(ld,"Sha1Provider");var dd=class extends fu{constructor(){super(...arguments),this.name="SHA-256",this.usages=[]}onDigest(e,t){return z(this,null,(function*(){return nd.digest(e,t)}))}};I(dd,"Sha256Provider");var fd=class extends fu{constructor(){super(...arguments),this.name="SHA-384",this.usages=[]}onDigest(e,t){return z(this,null,(function*(){return nd.digest(e,t)}))}};I(fd,"Sha384Provider");var hd=class extends fu{constructor(){super(...arguments),this.name="SHA-512",this.usages=[]}onDigest(e,t){return z(this,null,(function*(){return nd.digest(e,t)}))}};I(hd,"Sha512Provider");var pd=class extends fu{constructor(){super(...arguments),this.name="SHA3-256",this.usages=[]}onDigest(e,t){return z(this,null,(function*(){return nd.digest(e,t)}))}};I(pd,"Sha3256Provider");var md=class extends fu{constructor(){super(...arguments),this.name="SHA3-384",this.usages=[]}onDigest(e,t){return z(this,null,(function*(){return nd.digest(e,t)}))}};I(md,"Sha3384Provider");var gd=class extends fu{constructor(){super(...arguments),this.name="SHA3-512",this.usages=[]}onDigest(e,t){return z(this,null,(function*(){return nd.digest(e,t)}))}};I(gd,"Sha3512Provider");var bd=class{static generateKey(e,t,r){return z(this,null,(function*(){const n=new cd;n.algorithm=e,n.extractable=t,n.usages=r.filter((e=>-1!==this.privateKeyUsages.indexOf(e)));const i=new ud;i.algorithm=e,i.extractable=!0,i.usages=r.filter((e=>-1!==this.publicKeyUsages.indexOf(e)));const o=s.default.generateKeyPairSync("ec",{namedCurve:this.getOpenSSLNamedCurve(e.namedCurve),publicKeyEncoding:{format:"der",type:"spki"},privateKeyEncoding:{format:"der",type:"pkcs8"}});n.data=o.privateKey,i.data=o.publicKey;return{privateKey:n,publicKey:i}}))}static sign(e,t,r){return z(this,null,(function*(){const n=nd.getAlgorithmName(e.hash),i=s.default.createSign(n);i.update(Buffer.from(r)),t.pem||(t.pem=`-----BEGIN PRIVATE KEY-----\n${t.data.toString("base64")}\n-----END PRIVATE KEY-----`);const o={key:t.pem},a=i.sign(o),c=ac.parse(a,dl.EcDsaSignature);return $u.encodeSignature(c,fl.get(t.algorithm.namedCurve).size).buffer}))}static verify(e,t,r,n){return z(this,null,(function*(){const i=nd.getAlgorithmName(e.hash),o=s.default.createVerify(i);o.update(Buffer.from(n)),t.pem||(t.pem=`-----BEGIN PUBLIC KEY-----\n${t.data.toString("base64")}\n-----END PUBLIC KEY-----`);const a={key:t.pem},c=new dl.EcDsaSignature,u=fl.get(t.algorithm.namedCurve),l=$u.decodeSignature(r,u.size);c.r=El.BufferSourceConverter.toArrayBuffer(l.r),c.s=El.BufferSourceConverter.toArrayBuffer(l.s);const d=Buffer.from(cc.serialize(c));return o.verify(a,d)}))}static deriveBits(e,t,r){return z(this,null,(function*(){const n=this.getOpenSSLNamedCurve(t.algorithm.namedCurve),i=s.default.createECDH(n),o=ac.parse(t.data,dl.PrivateKeyInfo),a=ac.parse(o.privateKey,dl.EcPrivateKey);i.setPrivateKey(Buffer.from(a.privateKey));const c=ac.parse(e.public.data,dl.PublicKeyInfo),u=i.computeSecret(Buffer.from(c.publicKey));return new Uint8Array(u).buffer.slice(0,r>>3)}))}static exportKey(e,t){return z(this,null,(function*(){switch(e.toLowerCase()){case"jwk":return ru.toJSON(t);case"pkcs8":case"spki":return new Uint8Array(t.data).buffer;case"raw":return ac.parse(t.data,dl.PublicKeyInfo).publicKey;default:throw new uu("format: Must be 'jwk', 'raw', pkcs8' or 'spki'")}}))}static importKey(e,t,r,n,i){return z(this,null,(function*(){switch(e.toLowerCase()){case"jwk":if(t.d){const e=nu.fromJSON(t,{targetSchema:dl.EcPrivateKey});return this.importPrivateKey(e,r,n,i)}{const e=nu.fromJSON(t,{targetSchema:dl.EcPublicKey});return this.importPublicKey(e,r,n,i)}case"raw":{const e=new dl.EcPublicKey(t);return this.importPublicKey(e,r,n,i)}case"spki":{const e=ac.parse(new Uint8Array(t),dl.PublicKeyInfo),o=new dl.EcPublicKey(e.publicKey);return this.assertKeyParameters(e.publicKeyAlgorithm.parameters,r.namedCurve),this.importPublicKey(o,r,n,i)}case"pkcs8":{const e=ac.parse(new Uint8Array(t),dl.PrivateKeyInfo),o=ac.parse(e.privateKey,dl.EcPrivateKey);return this.assertKeyParameters(e.privateKeyAlgorithm.parameters,r.namedCurve),this.importPrivateKey(o,r,n,i)}default:throw new uu("format: Must be 'jwk', 'raw', 'pkcs8' or 'spki'")}}))}static assertKeyParameters(e,t){if(!e)throw new su("Key info doesn't have required parameters");let r="";try{r=ac.parse(e,dl.ObjectIdentifier).value}catch(e){throw new su("Cannot read key info parameters")}if(ad(t)!==r)throw new su("Key info parameter doesn't match to named curve")}static importPrivateKey(e,t,r,n){return z(this,null,(function*(){const i=new dl.PrivateKeyInfo;i.privateKeyAlgorithm.algorithm="1.2.840.10045.2.1",i.privateKeyAlgorithm.parameters=cc.serialize(new dl.ObjectIdentifier(ad(t.namedCurve))),i.privateKey=cc.serialize(e);const o=new cd;return o.data=Buffer.from(cc.serialize(i)),o.algorithm=Object.assign({},t),o.extractable=r,o.usages=n,o}))}static importPublicKey(e,t,r,n){return z(this,null,(function*(){const i=new dl.PublicKeyInfo;i.publicKeyAlgorithm.algorithm="1.2.840.10045.2.1";const o=ad(t.namedCurve);i.publicKeyAlgorithm.parameters=cc.serialize(new dl.ObjectIdentifier(o)),i.publicKey=e.value;const s=new ud;return s.data=Buffer.from(cc.serialize(i)),s.algorithm=Object.assign({},t),s.extractable=r,s.usages=n,s}))}static getOpenSSLNamedCurve(e){switch(e.toUpperCase()){case"P-256":return"prime256v1";case"K-256":return"secp256k1";case"P-384":return"secp384r1";case"P-521":return"secp521r1";default:return e}}};I(bd,"EcCrypto"),bd.publicKeyUsages=["verify"],bd.privateKeyUsages=["sign","deriveKey","deriveBits"];var yd=class extends _u{constructor(){super(...arguments),this.namedCurves=fl.names,this.hashAlgorithms=["SHA-1","SHA-256","SHA-384","SHA-512","shake128","shake256","SHA3-256","SHA3-384","SHA3-512"]}onGenerateKey(e,t,r){return z(this,null,(function*(){const n=yield bd.generateKey(N(C({},e),{name:this.name}),t,r);return{privateKey:Nl(n.privateKey),publicKey:Nl(n.publicKey)}}))}onSign(e,t,r){return z(this,null,(function*(){return bd.sign(e,Cl(t),new Uint8Array(r))}))}onVerify(e,t,r,n){return z(this,null,(function*(){return bd.verify(e,Cl(t),new Uint8Array(r),new Uint8Array(n))}))}onExportKey(e,t){return z(this,null,(function*(){return bd.exportKey(e,Cl(t))}))}onImportKey(e,t,r,n,i){return z(this,null,(function*(){return Nl(yield bd.importKey(e,t,N(C({},r),{name:this.name}),n,i))}))}checkCryptoKey(e,t){super.checkCryptoKey(e,t);const r=Cl(e);if(!(r instanceof cd||r instanceof ud))throw new TypeError("key: Is not EC CryptoKey")}};I(yd,"EcdsaProvider");var vd=class extends Cu{constructor(){super(...arguments),this.namedCurves=fl.names}onGenerateKey(e,t,r){return z(this,null,(function*(){const n=yield bd.generateKey(N(C({},e),{name:this.name}),t,r);return{privateKey:Nl(n.privateKey),publicKey:Nl(n.publicKey)}}))}onExportKey(e,t){return z(this,null,(function*(){return bd.exportKey(e,Cl(t))}))}onImportKey(e,t,r,n,i){return z(this,null,(function*(){return Nl(yield bd.importKey(e,t,N(C({},r),{name:this.name}),n,i))}))}checkCryptoKey(e,t){super.checkCryptoKey(e,t);const r=Cl(e);if(!(r instanceof cd||r instanceof ud))throw new TypeError("key: Is not EC CryptoKey")}onDeriveBits(e,t,r){return z(this,null,(function*(){return yield bd.deriveBits(N(C({},e),{public:Cl(e.public)}),Cl(t),r)}))}};I(vd,"EcdhProvider");var wd={[dl.idEd448]:"Ed448",ed448:dl.idEd448,[dl.idX448]:"X448",x448:dl.idX448,[dl.idEd25519]:"Ed25519",ed25519:dl.idEd25519,[dl.idX25519]:"X25519",x25519:dl.idX25519};function Ad(e){const t=wd[e.toLowerCase()];if(!t)throw new uu(`Cannot convert WebCrypto named curve '${e}' to OID`);return t}I(Ad,"getOidByNamedCurve");var Ed=class extends _l{constructor(){super(...arguments),this.type="private"}getKey(){const e=ac.parse(this.data,dl.PrivateKeyInfo);return ac.parse(e.privateKey,dl.CurvePrivateKey)}toJSON(){const e=this.getKey(),t={kty:"OKP",crv:this.algorithm.namedCurve,key_ops:this.usages,ext:this.extractable};return Object.assign(t,ru.toJSON(e))}fromJSON(e){if(!e.crv)throw new uu("Cannot get named curve from JWK. Property 'crv' is required");const t=new dl.PrivateKeyInfo;t.privateKeyAlgorithm.algorithm=Ad(e.crv);const r=nu.fromJSON(e,{targetSchema:dl.CurvePrivateKey});return t.privateKey=cc.serialize(r),this.data=Buffer.from(cc.serialize(t)),this}};I(Ed,"EdPrivateKey");var Sd=class extends _l{constructor(){super(...arguments),this.type="public"}getKey(){return ac.parse(this.data,dl.PublicKeyInfo).publicKey}toJSON(){const e=this.getKey(),t={kty:"OKP",crv:this.algorithm.namedCurve,key_ops:this.usages,ext:this.extractable};return Object.assign(t,{x:El.Convert.ToBase64Url(e)})}fromJSON(e){if(!e.crv)throw new uu("Cannot get named curve from JWK. Property 'crv' is required");if(!e.x)throw new uu("Cannot get property from JWK. Property 'x' is required");const t=new dl.PublicKeyInfo;return t.publicKeyAlgorithm.algorithm=Ad(e.crv),t.publicKey=El.Convert.FromBase64Url(e.x),this.data=Buffer.from(cc.serialize(t)),this}};I(Sd,"EdPublicKey");var xd=class{static generateKey(e,t,r){return z(this,null,(function*(){const n=new Ed;n.algorithm=e,n.extractable=t,n.usages=r.filter((e=>-1!==this.privateKeyUsages.indexOf(e)));const i=new Sd;i.algorithm=e,i.extractable=!0,i.usages=r.filter((e=>-1!==this.publicKeyUsages.indexOf(e)));const o=e.namedCurve.toLowerCase(),a=s.default.generateKeyPairSync(o,{publicKeyEncoding:{format:"der",type:"spki"},privateKeyEncoding:{format:"der",type:"pkcs8"}});n.data=a.privateKey,i.data=a.publicKey;return{privateKey:n,publicKey:i}}))}static sign(e,t,r){return z(this,null,(function*(){t.pem||(t.pem=`-----BEGIN PRIVATE KEY-----\n${t.data.toString("base64")}\n-----END PRIVATE KEY-----`);const e={key:t.pem},n=s.default.sign(null,Buffer.from(r),e);return lo.BufferSourceConverter.toArrayBuffer(n)}))}static verify(e,t,r,n){return z(this,null,(function*(){t.pem||(t.pem=`-----BEGIN PUBLIC KEY-----\n${t.data.toString("base64")}\n-----END PUBLIC KEY-----`);const e={key:t.pem};return s.default.verify(null,Buffer.from(n),e,Buffer.from(r))}))}static deriveBits(e,t,r){return z(this,null,(function*(){const n=s.default.createPublicKey({key:e.public.data,format:"der",type:"spki"}),i=s.default.createPrivateKey({key:t.data,format:"der",type:"pkcs8"}),o=s.default.diffieHellman({publicKey:n,privateKey:i});return new Uint8Array(o).buffer.slice(0,r>>3)}))}static exportKey(e,t){return z(this,null,(function*(){switch(e.toLowerCase()){case"jwk":return ru.toJSON(t);case"pkcs8":case"spki":return new Uint8Array(t.data).buffer;case"raw":return ac.parse(t.data,dl.PublicKeyInfo).publicKey;default:throw new uu("format: Must be 'jwk', 'raw', pkcs8' or 'spki'")}}))}static importKey(e,t,r,n,i){return z(this,null,(function*(){switch(e.toLowerCase()){case"jwk":{const e=t;if(e.d){const e=nu.fromJSON(t,{targetSchema:dl.CurvePrivateKey});return this.importPrivateKey(e,r,n,i)}if(!e.x)throw new TypeError("keyData: Cannot get required 'x' filed");return this.importPublicKey(El.Convert.FromBase64Url(e.x),r,n,i)}case"raw":return this.importPublicKey(t,r,n,i);case"spki":{const e=ac.parse(new Uint8Array(t),dl.PublicKeyInfo);return this.importPublicKey(e.publicKey,r,n,i)}case"pkcs8":{const e=ac.parse(new Uint8Array(t),dl.PrivateKeyInfo),o=ac.parse(e.privateKey,dl.CurvePrivateKey);return this.importPrivateKey(o,r,n,i)}default:throw new uu("format: Must be 'jwk', 'raw', 'pkcs8' or 'spki'")}}))}static importPrivateKey(e,t,r,n){const i=new Ed;return i.fromJSON({crv:t.namedCurve,d:El.Convert.ToBase64Url(e.d)}),i.algorithm=Object.assign({},t),i.extractable=r,i.usages=n,i}static importPublicKey(e,t,r,n){return z(this,null,(function*(){const i=new Sd;return i.fromJSON({crv:t.namedCurve,x:El.Convert.ToBase64Url(e)}),i.algorithm=Object.assign({},t),i.extractable=r,i.usages=n,i}))}};I(xd,"EdCrypto"),xd.publicKeyUsages=["verify"],xd.privateKeyUsages=["sign","deriveKey","deriveBits"];var Md=class extends Iu{onGenerateKey(e,t,r){return z(this,null,(function*(){const n=yield xd.generateKey({name:this.name,namedCurve:e.namedCurve.replace(/^ed/i,"Ed")},t,r);return{privateKey:Nl(n.privateKey),publicKey:Nl(n.publicKey)}}))}onSign(e,t,r){return z(this,null,(function*(){return xd.sign(e,Cl(t),new Uint8Array(r))}))}onVerify(e,t,r,n){return z(this,null,(function*(){return xd.verify(e,Cl(t),new Uint8Array(r),new Uint8Array(n))}))}onExportKey(e,t){return z(this,null,(function*(){return xd.exportKey(e,Cl(t))}))}onImportKey(e,t,r,n,i){return z(this,null,(function*(){return Nl(yield xd.importKey(e,t,N(C({},r),{name:this.name}),n,i))}))}};I(Md,"EdDsaProvider");var _d=class extends Nu{onGenerateKey(e,t,r){return z(this,null,(function*(){const n=yield xd.generateKey({name:this.name,namedCurve:e.namedCurve.toUpperCase()},t,r);return{privateKey:Nl(n.privateKey),publicKey:Nl(n.publicKey)}}))}onDeriveBits(e,t,r){return z(this,null,(function*(){return yield xd.deriveBits(N(C({},e),{public:Cl(e.public)}),Cl(t),r)}))}onExportKey(e,t){return z(this,null,(function*(){return xd.exportKey(e,Cl(t))}))}onImportKey(e,t,r,n,i){return z(this,null,(function*(){return Nl(yield xd.importKey(e,t,N(C({},r),{name:this.name}),n,i))}))}};I(_d,"EcdhEsProvider");var kd=class extends xl{};I(kd,"PbkdfCryptoKey");var Td=class extends pl{onDeriveBits(e,t,r){return z(this,null,(function*(){return new Promise(((n,i)=>{const o=lo.BufferSourceConverter.toArrayBuffer(e.salt),a=e.hash.name.replace("-","");s.default.pbkdf2(Cl(t).data,Buffer.from(o),e.iterations,r>>3,a,((e,t)=>{e?i(e):n(new Uint8Array(t).buffer)}))}))}))}onImportKey(e,t,r,n,i){return z(this,null,(function*(){if("raw"===e){const e=new kd;return e.data=Buffer.from(t),e.algorithm={name:this.name},e.extractable=!1,e.usages=i,Nl(e)}throw new uu("format: Must be 'raw'")}))}checkCryptoKey(e,t){if(super.checkCryptoKey(e,t),!(Cl(e)instanceof kd))throw new TypeError("key: Is not PBKDF CryptoKey")}};I(Td,"Pbkdf2Provider");var Cd=class extends xl{get alg(){return`HS${this.algorithm.hash.name.toUpperCase().replace("SHA-","")}`}set alg(e){}};I(Cd,"HmacCryptoKey"),mc([ou({name:"k",converter:Sl})],Cd.prototype,"data",void 0);var Nd=class extends hl{onGenerateKey(e,t,r){return z(this,null,(function*(){const n=(e.length||this.getDefaultLength(e.hash.name))>>3<<3,i=new Cd;return i.algorithm=N(C({},e),{length:n,name:this.name}),i.extractable=t,i.usages=r,i.data=s.default.randomBytes(n>>3),Nl(i)}))}onSign(e,t,r){return z(this,null,(function*(){const e=nd.getAlgorithmName(t.algorithm.hash),n=s.default.createHmac(e,Cl(t).data).update(Buffer.from(r)).digest();return new Uint8Array(n).buffer}))}onVerify(e,t,r,n){return z(this,null,(function*(){const e=nd.getAlgorithmName(t.algorithm.hash);return 0===s.default.createHmac(e,Cl(t).data).update(Buffer.from(n)).digest().compare(Buffer.from(r))}))}onImportKey(e,t,r,n,i){return z(this,null,(function*(){let o;switch(e.toLowerCase()){case"jwk":o=nu.fromJSON(t,{targetSchema:Cd});break;case"raw":o=new Cd,o.data=Buffer.from(t);break;default:throw new uu("format: Must be 'jwk' or 'raw'")}return o.algorithm={hash:{name:r.hash.name},name:this.name,length:o.data.length<<3},o.extractable=n,o.usages=i,Nl(o)}))}onExportKey(e,t){return z(this,null,(function*(){switch(e.toLowerCase()){case"jwk":return ru.toJSON(Cl(t));case"raw":return new Uint8Array(Cl(t).data).buffer;default:throw new uu("format: Must be 'jwk' or 'raw'")}}))}checkCryptoKey(e,t){if(super.checkCryptoKey(e,t),!(Cl(e)instanceof Cd))throw new TypeError("key: Is not HMAC CryptoKey")}};I(Nd,"HmacProvider");var Id=class extends xl{};I(Id,"HkdfCryptoKey");var Bd=class extends ml{onImportKey(e,t,r,n,i){return z(this,null,(function*(){if("raw"!==e.toLowerCase())throw new uu("Operation not supported");const r=new Id;return r.data=Buffer.from(t),r.algorithm={name:this.name},r.extractable=n,r.usages=i,Nl(r)}))}onDeriveBits(e,t,r){return z(this,null,(function*(){const n=e.hash.name.replace("-",""),i=s.default.createHash(n).digest().length,o=r/8,a=lo.BufferSourceConverter.toUint8Array(e.info),c=s.default.createHmac(n,lo.BufferSourceConverter.toUint8Array(e.salt)).update(lo.BufferSourceConverter.toUint8Array(Cl(t).data)).digest(),u=[Buffer.alloc(0)],l=Math.ceil(o/i)+1;for(let e=1;e<l;++e)u.push(s.default.createHmac(n,c).update(Buffer.concat([u[e-1],a,Buffer.from([e])])).digest());return Buffer.concat(u).slice(0,o)}))}checkCryptoKey(e,t){if(super.checkCryptoKey(e,t),!(Cl(e)instanceof Id))throw new TypeError("key: Is not HKDF CryptoKey")}};I(Bd,"HkdfProvider");var Od=class{static digest(e,t){const r=s.default.createHash(e.name.toLowerCase(),{outputLength:e.length}).update(Buffer.from(t)).digest();return new Uint8Array(r).buffer}};I(Od,"ShakeCrypto");var Dd=class extends bl{onDigest(e,t){return z(this,null,(function*(){return Od.digest(e,t)}))}};I(Dd,"Shake128Provider");var jd=class extends yl{onDigest(e,t){return z(this,null,(function*(){return Od.digest(e,t)}))}};I(jd,"Shake256Provider");var Ld=class extends Al{constructor(){var e;super(),this.providers.set(new Bl),this.providers.set(new Hl),this.providers.set(new $l),this.providers.set(new Fl),this.providers.set(new Vl),this.providers.set(new ql),this.providers.set(new Jl),this.providers.set(new Ql),this.providers.set(new td),this.providers.set(new rd),this.providers.set(new id),this.providers.set(new od),this.providers.set(new yd),this.providers.set(new vd),this.providers.set(new ld),this.providers.set(new dd),this.providers.set(new fd),this.providers.set(new hd),this.providers.set(new Td),this.providers.set(new Nd),this.providers.set(new Bd);const t=null===(e=/^v(\d+)/.exec(c.version))||void 0===e?void 0:e[1];t&&parseInt(t,10)>=12&&(this.providers.set(new Dd),this.providers.set(new jd));const r=a.getHashes();r.includes("sha3-256")&&this.providers.set(new pd),r.includes("sha3-384")&&this.providers.set(new md),r.includes("sha3-512")&&this.providers.set(new gd),t&&parseInt(t,10)>=14&&(this.providers.set(new Md),this.providers.set(new _d))}};I(Ld,"SubtleCrypto");var Pd=class extends vl{constructor(){super(...arguments),this.subtle=new Ld}getRandomValues(e){if(!ArrayBuffer.isView(e))throw new TypeError("Failed to execute 'getRandomValues' on 'Crypto': parameter 1 is not of type 'ArrayBufferView'");const t=Buffer.from(e.buffer,e.byteOffset,e.byteLength);return s.default.randomFillSync(t),e}};function Rd(){return"object"==typeof process&&"object"==typeof process.versions&&void 0!==process.versions.node}I(Pd,"Crypto"),I(Rd,"isNodejs");var Ud=Rd()?new Pd:window.crypto,zd=I(((e,t)=>z(void 0,null,(function*(){return $d(e.contents,{plugins:[...e.plugins,t]})}))),"addPluginToWallet"),Kd=I(((e,t)=>z(void 0,null,(function*(){return $d([...e.contents,t],e)}))),"addToWallet"),Fd=I(((e,t)=>z(void 0,null,(function*(){const r=JSON.parse(JSON.stringify(e.contents)),n=r.find((e=>e.id===t));return $d(r.filter((e=>e.id!==n.id)),e)}))),"removeFromWallet"),Hd=I(((e,t)=>Object.fromEntries(Object.entries(t).map((([t,r])=>[t,r.bind(e,e)])))),"bindMethods"),$d=I(((...e)=>z(void 0,[...e],(function*(e=[],t={}){const{plugins:r=[]}=t,{pluginMethods:n,pluginConstants:i}=r.reduce((({pluginMethods:e,pluginConstants:t},r)=>({pluginMethods:C(C({},e),r.pluginMethods),pluginConstants:C(C({},t),r.pluginConstants)})),{pluginMethods:{},pluginConstants:{}}),o={contents:[...e],add:function(e){return Kd(this,e)},remove:function(e){return Fd(this,e)},status:"UNLOCKED",plugins:r,pluginMethods:n,pluginConstants:i,addPlugin:function(e){return zd(this,e)}};return n&&(o.pluginMethods=Hd(o,n)),o}))),"generateWallet");function Vd(e,t){try{var r=e()}catch(e){return t(e)}return r&&r.then?r.then(void 0,t):r}function qd(){const e=new Map;return function(t,r){try{let n,i=function(i){if(n)return i;const o=e.get(t.didUrl);return void 0!==o?o:Promise.resolve(r()).then((function(r){var n;return"notFound"!==(null==(n=r.didResolutionMetadata)?void 0:n.error)&&e.set(t.didUrl,r),r}))};I(i,"_temp2");const o=function(){if(t.params&&"true"===t.params["no-cache"])return n=1,Promise.resolve(r())}();return Promise.resolve(o&&o.then?o.then(i):i(o))}catch(e){return Promise.reject(e)}}}function Gd(e,t){return t()}I(Vd,"_catch"),I(qd,"inMemoryCache"),I(Gd,"noCache");var Yd="(?:[a-zA-Z0-9._-]|(?:%[0-9a-fA-F]{2}))",Jd=new RegExp(`^did:([a-z0-9]+):${`((?:${Yd}*:)*(${Yd}+))`}((;[a-zA-Z0-9_.:%-]+=[a-zA-Z0-9_.:%-]*)*)(/[^#?]*)?([?][^#]*)?(#.*)?$`);function Qd(e){if(""===e||!e)return null;const t=e.match(Jd);if(t){const r={did:`did:${t[1]}:${t[2]}`,method:t[1],id:t[2],didUrl:e};if(t[4]){const e=t[4].slice(1).split(";");r.params={};for(const t of e){const e=t.split("=");r.params[e[0]]=e[1]}}return t[6]&&(r.path=t[6]),t[7]&&(r.query=t[7].slice(1)),t[8]&&(r.fragment=t[8].slice(1)),r}return null}I(Qd,"parse");var Wd={didResolutionMetadata:{},didDocument:null,didDocumentMetadata:{}};function Xd(e){return function(t,r,n){try{return Promise.resolve(Vd((function(){return Promise.resolve(e(t,r,n)).then((function(e){return N(C({},Wd),{didResolutionMetadata:{contentType:"application/did+ld+json"},didDocument:e})}))}),(function(e){return N(C({},Wd),{didResolutionMetadata:{error:"notFound",message:e.toString()}})})))}catch(e){return Promise.reject(e)}}}I(Xd,"wrapLegacyResolver");var Zd=class{constructor(e={},t={}){this.registry=void 0,this.cache=void 0,this.registry=e,this.cache=!0===t.cache?qd():t.cache||Gd,t.legacyResolvers&&Object.keys(t.legacyResolvers).map((e=>{this.registry[e]||(this.registry[e]=Xd(t.legacyResolvers[e]))}))}resolve(e,t={}){try{const r=this,n=Qd(e);if(null===n)return Promise.resolve(N(C({},Wd),{didResolutionMetadata:{error:"invalidDid"}}));const i=r.registry[n.method];return i?Promise.resolve(r.cache(n,(()=>i(n.did,n,r,t)))):Promise.resolve(N(C({},Wd),{didResolutionMetadata:{error:"unsupportedDidMethod"}}))}catch(e){return Promise.reject(e)}}};function ef(e,t){t||(t=e.reduce(((e,t)=>e+t.length),0));const r=new Uint8Array(t);let n=0;for(const t of e)r.set(t,n),n+=t.length;return r}function tf(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}I(Zd,"Resolver"),I(ef,"concat"),Sr(),I(tf,"createCodec");var rf=tf("utf8","u",(e=>"u"+new TextDecoder("utf8").decode(e)),(e=>(new TextEncoder).encode(e.substring(1)))),nf=tf("ascii","a",(e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t}),(e=>{e=e.substring(1);const t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t})),of=C({utf8:rf,"utf-8":rf,hex:mr.base16,latin1:nf,ascii:nf,binary:nf},mr);function sf(e,t="utf8"){const r=of[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return r.decoder.decode(`${r.prefix}${e}`)}function af(e,t="utf8"){const r=of[t];if(!r)throw new Error(`Unsupported encoding "${t}"`);return r.encoder.encode(e).substring(1)}I(sf,"fromString"),I(af,"toString"),Sr();var cf=R(kr()),uf=R(Tr()),lf=R(ln()),df=R(gn()),ff=R(bn()),hf=R(yn()),pf=R(xn()),mf=R(pn());function gf(e){return af(e,"base64url")}function bf(e){return sf(e.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,""),"base64url")}function yf(e){return sf(e,"base58btc")}function vf(e){return sf((e.startsWith("0x")?e.substring(2):e).toLowerCase(),"base16")}function wf(e){return gf(sf(e))}function Af(e){return af(bf(e))}function Ef(e){return af(e,"base16")}function Sf(e){return sf(e)}function xf({r:e,s:t,recoveryParam:r},n){const i=new Uint8Array(n?65:64);if(i.set(sf(e,"base16"),0),i.set(sf(t,"base16"),32),n){if(void 0===r)throw new Error("Signer did not return a recoveryParam");i[64]=r}return gf(i)}function Mf(e){const t=bf(e);if(t.length<64||t.length>65)throw new TypeError(`Wrong size for signature. Expected 64 or 65 bytes, but got ${t.length}`);return{r:Ef(t.slice(0,32)),s:Ef(t.slice(32,64)),recoveryParam:65===t.length?t[64]:void 0}}function _f(e,t){return ef([bf(e),bf(t)])}I(gf,"bytesToBase64url"),I(bf,"base64ToBytes"),I(yf,"base58ToBytes"),I(vf,"hexToBytes"),I(wf,"encodeBase64url"),I(Af,"decodeBase64url"),I(Ef,"bytesToHex"),I(Sf,"stringToBytes"),I(xf,"toJose"),I(Mf,"fromJose"),I(_f,"toSealed");var kf=/^(0x)?([a-fA-F0-9]{64}|[a-fA-F0-9]{128})$/,Tf=/^([1-9A-HJ-NP-Za-km-z]{44}|[1-9A-HJ-NP-Za-km-z]{88})$/,Cf=/^([0-9a-zA-Z=\-_+/]{43}|[0-9a-zA-Z=\-_+/]{86})(={0,2})$/;function Nf(e){if("string"==typeof e){if(kf.test(e))return vf(e);if(Tf.test(e))return yf(e);if(Cf.test(e))return bf(e);throw TypeError("bad_key: Invalid private key format")}if(e instanceof Uint8Array)return e;throw TypeError("bad_key: Invalid private key format")}function If(e){const t="string"==typeof e?sf(e):e;return(0,cf.hash)(t)}function Bf(e){return new Uint8Array(uf.keccak_256.arrayBuffer(e))}function Of(e){return`0x${af(Bf(sf(e.slice(2),"base16")).slice(-20),"base16")}`}function Df(e,t=new Uint8Array(4)){const r=sf(e.toString(),"base10");return t.set(r,4-r.length),t}I(Nf,"parseKey"),I(If,"sha256"),I(Bf,"keccak"),I(Of,"toEthereumAddress"),I(Df,"writeUint32BE");var jf=I((e=>ef([Df(e.length),e])),"lengthAndInput");function Lf(e,t,r,n,i){if(256!==t)throw new Error(`Unsupported key length: ${t}`);const o=ef([jf(sf(r)),jf(void 0===n?new Uint8Array(0):n),jf(void 0===i?new Uint8Array(0):i),Df(t)]);return(0,cf.hash)(ef([Df(1),e,o]))}function Pf(e){const t=Nf(e);if(64!==t.length)throw new Error(`bad_key: Invalid private key format. Expecting 64 bytes, but got ${t.length}`);return function(e){try{const r="string"==typeof e?Sf(e):e,n=(0,df.sign)(t,r);return Promise.resolve(gf(n))}catch(e){return Promise.reject(e)}}}function Rf(e){return"object"==typeof e&&"r"in e&&"s"in e}function Uf(e){return I((function(t,r){try{return Promise.resolve(r(t)).then((function(t){if(Rf(t))return xf(t,e);if(e&&void 0===Mf(t).recoveryParam)throw new Error("not_supported: ES256K-R not supported when signer doesn't provide a recovery param");return t}))}catch(e){return Promise.reject(e)}}),"sign")}function zf(){return I((function(e,t){try{return Promise.resolve(t(e)).then((function(e){if(Rf(e))throw new Error("invalid_config: expected a signer function that returns a string instead of signature object");return e}))}catch(e){return Promise.reject(e)}}),"sign")}I(Lf,"concatKDF"),new lf.ec("secp256k1"),I(Pf,"EdDSASigner"),I(Rf,"instanceOfEcdsaSignature"),I(Uf,"ES256KSignerAlg"),I(zf,"Ed25519SignerAlg");var Kf={ES256K:Uf(),"ES256K-R":Uf(!0),Ed25519:zf(),EdDSA:zf()};function Ff(e){const t=Kf[e];if(!t)throw new Error(`not_supported: Unsupported algorithm ${e}`);return t}I(Ff,"SignerAlg");var Hf=new lf.ec("secp256k1");function $f(e,t=!1){const r=bf(e);if(r.length!==(t?65:64))throw new Error("wrong signature length");const n={r:Ef(r.slice(0,32)),s:Ef(r.slice(32,64))};return t&&(n.recoveryParam=r[64]),n}function Vf(e){if(e.publicKeyBase58)return yf(e.publicKeyBase58);if(e.publicKeyBase64)return bf(e.publicKeyBase64);if(e.publicKeyHex)return vf(e.publicKeyHex);if(e.publicKeyJwk&&"secp256k1"===e.publicKeyJwk.crv&&e.publicKeyJwk.x&&e.publicKeyJwk.y)return vf(Hf.keyFromPublic({x:Ef(bf(e.publicKeyJwk.x)),y:Ef(bf(e.publicKeyJwk.y))}).getPublic("hex"));if(e.publicKeyMultibase){const{base16:t,base58btc:r,base64:n,base64url:i}=mr;return t.decoder.or(r.decoder.or(n.decoder.or(i.decoder))).decode(e.publicKeyMultibase)}return new Uint8Array}function qf(e,t,r){const n=If(e),i=$f(t),o=r.filter((({ethereumAddress:e,blockchainAccountId:t})=>void 0===e&&void 0===t)),s=r.filter((({ethereumAddress:e,blockchainAccountId:t})=>void 0!==e||void 0!==typeof t));let a=o.find((e=>{try{const t=Vf(e);return Hf.keyFromPublic(t).verify(n,i)}catch(e){return!1}}));if(!a&&s.length>0&&(a=Gf(e,t,s)),!a)throw new Error("invalid_signature: Signature invalid for JWT");return a}function Gf(e,t,r){let n;if(t.length>86)n=[$f(t,!0)];else{const e=$f(t,!1);n=[N(C({},e),{recoveryParam:0}),N(C({},e),{recoveryParam:1})]}const i=I((t=>{const n=If(e),i=Hf.recoverPubKey(n,t,t.recoveryParam),o=i.encode("hex"),s=i.encode("hex",!0),a=Of(o);return r.find((e=>{var t,r,n;const i=Ef(Vf(e));return i===o||i===s||(null==(t=e.ethereumAddress)?void 0:t.toLowerCase())===a||(null==(r=e.blockchainAccountId)||null==(n=r.split("@eip155"))?void 0:n[0].toLowerCase())===a}))}),"checkSignatureAgainstSigner"),o=n.map(i).filter((e=>void 0!==e));if(0===o.length)throw new Error("invalid_signature: Signature invalid for JWT");return o[0]}function Yf(e,t,r){const n=Sf(e),i=bf(t),o=r.find((e=>(0,df.verify)(Vf(e),n,i)));if(!o)throw new Error("invalid_signature: Signature invalid for JWT");return o}I($f,"toSignatureObject"),I(Vf,"extractPublicKeyBytes"),I(qf,"verifyES256K"),I(Gf,"verifyRecoverableES256K"),I(Yf,"verifyEd25519");var Jf={ES256K:qf,"ES256K-R":Gf,Ed25519:Yf,EdDSA:Yf};function Qf(e){const t=Jf[e];if(!t)throw new Error(`not_supported: Unsupported algorithm ${e}`);return t}I(Qf,"VerifierAlgorithm"),Qf.toSignatureObject=$f;var Wf=I((function(e,t,r={},n={}){try{r.alg||(r.alg=Xf);const i="string"==typeof e?e:Zf(e,n.canonicalize),o=[Zf(r,n.canonicalize),i].join("."),s=Ff(r.alg);return Promise.resolve(s(o,t)).then((function(e){return[o,e].join(".")}))}catch(e){return Promise.reject(e)}}),"createJWS"),Xf="ES256K";function Zf(e,t=!1){return wf(t?(0,ff.default)(e):JSON.stringify(e))}function eh(e){const t=e.match(/^([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)\.([a-zA-Z0-9_-]+)$/);if(t)return{header:JSON.parse(Af(t[1])),payload:t[2],signature:t[3],data:`${t[1]}.${t[2]}`};throw new Error("invalid_argument: Incorrect format JWS")}function th({header:e,data:t,signature:r},n){Array.isArray(n)||(n=[n]);return Qf(e.alg)(t,r,n)}function rh(e,t){return th(eh(e),t)}function nh(e,t,r){for(var n;;){var i=e();if(ch(i)&&(i=i.v),!i)return o;if(i.then){n=0;break}var o=r();if(o&&o.then){if(!ch(o)){n=1;break}o=o.s}if(t){var s=t();if(s&&s.then&&!ch(s)){n=2;break}}}var a=new ah,c=sh.bind(null,a,2);return(0===n?i.then(l):1===n?o.then(u):s.then(d)).then(void 0,c),a;function u(n){o=n;do{if(t&&(s=t())&&s.then&&!ch(s))return void s.then(d).then(void 0,c);if(!(i=e())||ch(i)&&!i.v)return void sh(a,1,o);if(i.then)return void i.then(l).then(void 0,c);ch(o=r())&&(o=o.v)}while(!o||!o.then);o.then(u).then(void 0,c)}function l(e){e?(o=r())&&o.then?o.then(u).then(void 0,c):u(o):sh(a,1,o)}function d(){(i=e())?i.then?i.then(l).then(void 0,c):l(i):sh(a,1,o)}}I(Zf,"encodeSection"),I(eh,"decodeJWS"),I(th,"verifyJWSDecoded"),I(rh,"verifyJWS"),I(nh,"_for");var ih=I((function(e,t){try{let r=function(e){if(null===s)throw new Error("failure: Failed to decrypt");return s};I(r,"_temp5"),dh(e);const n=JSON.parse(Af(e.protected));if(n.enc!==t.enc)throw new Error(`not_supported: Decrypter does not supported: '${n.enc}'`);const i=_f(e.ciphertext,e.tag),o=new Uint8Array(Buffer.from(e.aad?`${e.protected}.${e.aad}`:e.protected));let s=null;const a="dir"===n.alg&&"dir"===t.alg?Promise.resolve(t.decrypt(i,bf(e.iv),o)).then((function(e){s=e})):function(){if(e.recipients&&0!==e.recipients.length){let r=0;return nh((function(){return!s&&r<e.recipients.length}),(function(){return r++}),(function(){const a=e.recipients[r];Object.assign(a.header,n);const c=function(){if(a.header.alg===t.alg)return Promise.resolve(t.decrypt(i,bf(e.iv),o,a)).then((function(e){s=e}))}();if(c&&c.then)return c.then((function(){}))}))}throw new Error("bad_jwe: missing recipients")}();return Promise.resolve(a&&a.then?a.then(r):r(a))}catch(e){return Promise.reject(e)}}),"decryptJWE"),oh="undefined"!=typeof Symbol?Symbol.iterator||(Symbol.iterator=Symbol("Symbol.iterator")):"@@iterator";function sh(e,t,r){if(!e.s){if(r instanceof ah){if(!r.s)return void(r.o=sh.bind(null,e,t));1&t&&(t=r.s),r=r.v}if(r&&r.then)return void r.then(sh.bind(null,e,t),sh.bind(null,e,2));e.s=t,e.v=r;const n=e.o;n&&n(e)}}I(sh,"_settle");var ah=function(){function e(){}return I(e,"_Pact"),e.prototype.then=function(t,r){const n=new e,i=this.s;if(i){const e=1&i?t:r;if(e){try{sh(n,1,e(this.v))}catch(e){sh(n,2,e)}return n}return this}return this.o=function(e){try{const i=e.v;1&e.s?sh(n,1,t?t(i):i):r?sh(n,1,r(i)):sh(n,2,i)}catch(e){sh(n,2,e)}},n},e}();function ch(e){return e instanceof ah&&1&e.s}function uh(e,t,r){var n,i,o=-1;function s(a){try{for(;++o<e.length&&(!r||!r());)if((a=t(o))&&a.then){if(!ch(a))return void a.then(s,i||(i=sh.bind(null,n=new ah,2)));a=a.v}n?sh(n,1,a):n=a}catch(e){sh(n||(n=new ah),2,e)}}return I(s,"_cycle"),s(),n}function lh(e,t,r){if("function"==typeof e[oh]){let c=function(e){try{for(;!((n=s.next()).done||r&&r());)if((e=t(n.value))&&e.then){if(!ch(e))return void e.then(c,o||(o=sh.bind(null,i=new ah,2)));e=e.v}i?sh(i,1,e):i=e}catch(e){sh(i||(i=new ah),2,e)}};I(c,"_cycle");var n,i,o,s=e[oh]();if(c(),s.return){var a=I((function(e){try{n.done||s.return()}catch(e){}return e}),"_fixup");if(i&&i.then)return i.then(a,(function(e){throw a(e)}));a()}return i}if(!("length"in e))throw new TypeError("Object is not iterable");for(var c=[],u=0;u<e.length;u++)c.push(e[u]);return uh(c,(function(e){return t(c[e])}),r)}function dh(e){if(!(e.protected&&e.iv&&e.ciphertext&&e.tag))throw new Error("bad_jwe: missing properties");e.recipients&&e.recipients.map((e=>{if(!e.header||!e.encrypted_key)throw new Error("bad_jwe: malformed recipients")}))}function fh({ciphertext:e,tag:t,iv:r,protectedHeader:n,recipient:i},o){const s={protected:n,iv:gf(r),ciphertext:gf(e),tag:gf(t)};return o&&(s.aad=gf(o)),i&&(s.recipients=[i]),s}I(ch,"_isSettledPact"),I(uh,"_forTo"),I(lh,"_forOf"),I(dh,"validateJWE"),I(fh,"encodeJWE");var hh=I((function(e,t,r={},n){try{if("dir"===t[0].alg){if(t.length>1)throw new Error('not_supported: Can only do "dir" encryption to one key.');return Promise.resolve(t[0].encrypt(e,r,n)).then((function(e){return fh(e,n)}))}{const i=t[0].enc;if(!t.reduce(((e,t)=>e&&t.enc===i),!0))throw new Error("invalid_argument: Incompatible encrypters passed");let o,s;const a=lh(t,(function(t){const i=o?Promise.resolve(null==t.encryptCek?void 0:t.encryptCek(o)).then((function(e){var t,r;e&&(null==(t=s)||null==(r=t.recipients)||r.push(e))})):Promise.resolve(t.encrypt(e,r,n)).then((function(e){o=e.cek,s=fh(e,n)}));if(i&&i.then)return i.then((function(){}))}));return Promise.resolve(a&&a.then?a.then((function(){return s})):s)}}catch(e){return Promise.reject(e)}}),"createJWE"),ph=I((function(e,t){try{const r=I((function(e){try{return Promise.resolve(t.resolve(e)).then((function({didResolutionMetadata:t,didDocument:r}){var n;if(null!=t&&t.error||null==r)throw new Error(`resolver_error: Could not resolve ${e}: ${t.error}, ${t.message}`);if(!r.keyAgreement)throw new Error(`no_suitable_keys: Could not find x25519 key for ${e}`);const i=(null==(n=r.keyAgreement)?void 0:n.map((e=>"string"==typeof e?[...r.publicKey||[],...r.verificationMethod||[]].find((t=>t.id===e)):e)).filter((e=>void 0!==e))).filter((e=>"X25519KeyAgreementKey2019"===e.type&&Boolean(e.publicKeyBase58)));if(!i.length)throw new Error(`no_suitable_keys: Could not find x25519 key for ${e}`);return i.map((e=>yh(yf(e.publicKeyBase58),e.id)))}))}catch(e){return Promise.reject(e)}}),"encryptersForDID"),n=e.map((e=>r(e)));return Promise.resolve(Promise.all(n)).then((function(e){return[].concat(...e)}))}catch(e){return Promise.reject(e)}}),"resolveX25519Encrypters");function mh(e){const t=new pf.XChaCha20Poly1305(e);return(e,r)=>{const n=(0,mf.randomBytes)(t.nonceLength),i=t.seal(n,e,r);return{ciphertext:i.subarray(0,i.length-t.tagLength),tag:i.subarray(i.length-t.tagLength),iv:n}}}function gh(e){const t=I((function(e,t={},o){try{const s=wf(JSON.stringify(Object.assign({alg:i},t,{enc:n}))),a=new Uint8Array(Buffer.from(o?`${s}.${gf(o)}`:s));return Promise.resolve(N(C({},r(e,a)),{protectedHeader:s}))}catch(e){return Promise.reject(e)}}),"encrypt"),r=mh(e),n="XC20P",i="dir";return{alg:i,enc:n,encrypt:t}}function bh(e){const t=I((function(e,t,n){try{return Promise.resolve(r.open(t,e,n))}catch(e){return Promise.reject(e)}}),"decrypt"),r=new pf.XChaCha20Poly1305(e);return{alg:"dir",enc:"XC20P",decrypt:t}}function yh(e,t){const r=I((function(e,t={},r){try{Object.assign(t,{alg:void 0});const i=(0,mf.randomBytes)(32);return Promise.resolve(gh(i).encrypt(e,t,r)).then((function(e){return Promise.resolve(n(i)).then((function(t){return N(C({},e),{recipient:t,cek:i})}))}))}catch(e){return Promise.reject(e)}}),"encrypt"),n=I((function(r){try{const n=(0,hf.generateKeyPair)(),a=(0,hf.sharedKey)(n.secretKey,e),c=mh(Lf(a,o,i))(r),u={encrypted_key:gf(c.ciphertext),header:{alg:i,iv:gf(c.iv),tag:gf(c.tag),epk:{kty:"OKP",crv:s,x:gf(n.publicKey)}}};return t&&(u.header.kid=t),Promise.resolve(u)}catch(e){return Promise.reject(e)}}),"encryptCek"),i="ECDH-ES+XC20PKW",o=256,s="X25519";return{alg:i,enc:"XC20P",encrypt:r,encryptCek:n}}function vh(e){if(!(e&&e.epk&&e.iv&&e.tag))throw new Error("bad_jwe: malformed header")}function wh(e){const t=I((function(t,o,s,a){try{let l=function(){const e=Lf(f,n,r),i=_f(a.encrypted_key,a.header.tag);return Promise.resolve(bh(e).decrypt(i,bf(a.header.iv))).then((function(e){return null===e?null:bh(e).decrypt(t,o,s)}))};var c,u;if(I(l,"_temp4"),vh(null==(c=a)?void 0:c.header),(null==(u=a.header.epk)?void 0:u.crv)!==i||void 0===a.header.epk.x)return Promise.resolve(null);const d=bf(a.header.epk.x);let f;const h=function(){if(!(e instanceof Uint8Array))return Promise.resolve(e(d)).then((function(e){f=e}));f=(0,hf.sharedKey)(e,d)}();return Promise.resolve(h&&h.then?h.then(l):l(h))}catch(e){return Promise.reject(e)}}),"decrypt"),r="ECDH-ES+XC20PKW",n=256,i="X25519";return{alg:r,enc:"XC20P",decrypt:t}}I(mh,"xc20pEncrypter"),I(gh,"xc20pDirEncrypter"),I(bh,"xc20pDirDecrypter"),I(yh,"x25519Encrypter"),I(vh,"validateHeader"),I(wh,"x25519Decrypter"),wr();var Ah=I((({enumerable:e=!0,configurable:t=!1}={})=>({enumerable:e,configurable:t,writable:!1})),"readonly"),Eh=I((function*(e,t){if(null!=e&&!(e instanceof Uint8Array))for(const[r,n]of Object.entries(e)){const e=[...t,r];if(null!=n&&"object"==typeof n)if(Array.isArray(n))for(const[t,r]of n.entries()){const n=[...e,t],i=nr.asCID(r);i?yield[n.join("/"),i]:"object"==typeof r&&(yield*Eh(r,n))}else{const t=nr.asCID(n);t?yield[e.join("/"),t]:yield*Eh(n,e)}}}),"links"),Sh=I((function*(e,t){if(null!=e)for(const[r,n]of Object.entries(e)){const e=[...t,r];if(yield e.join("/"),!(null==n||n instanceof Uint8Array||"object"!=typeof n||nr.asCID(n)))if(Array.isArray(n))for(const[t,r]of n.entries()){const n=[...e,t];yield n.join("/"),"object"!=typeof r||nr.asCID(r)||(yield*Sh(r,n))}else yield*Sh(n,e)}}),"tree"),xh=I(((e,t)=>{let r=e;for(const[e,n]of t.entries()){if(r=r[n],null==r)throw new Error(`Object has no property at ${t.slice(0,e+1).map((e=>`[${JSON.stringify(e)}]`)).join("")}`);const i=nr.asCID(r);if(i)return{value:i,remaining:t.slice(e+1).join("/")}}return{value:r}}),"get"),Mh=class{constructor({cid:e,bytes:t,value:r}){if(!e||!t||void 0===r)throw new Error("Missing required argument");this.cid=e,this.bytes=t,this.value=r,this.asBlock=this,Object.defineProperties(this,{cid:Ah(),bytes:Ah(),value:Ah(),asBlock:Ah()})}links(){return Eh(this.value,[])}tree(){return Sh(this.value,[])}get(e="/"){return xh(this.value,e.split("/").filter(Boolean))}};I(Mh,"Block");var _h=I((e=>z(void 0,[e],(function*({value:e,codec:t,hasher:r}){if(void 0===e)throw new Error('Missing required argument "value"');if(!t||!r)throw new Error("Missing required argument: codec or hasher");const n=t.encode(e),i=yield r.digest(n),o=nr.create(1,t.code,i);return new Mh({value:e,bytes:n,cid:o})}))),"encode");vr(),Kt(),Gt(),mt();var kh={};L(kh,{code:()=>Jm,decode:()=>Wm,encode:()=>Qm,name:()=>Ym});var Th=["string","number","bigint","symbol"],Ch=["Function","Generator","AsyncGenerator","GeneratorFunction","AsyncGeneratorFunction","AsyncFunction","Observable","Array","Buffer","Object","RegExp","Date","Error","Map","Set","WeakMap","WeakSet","ArrayBuffer","SharedArrayBuffer","DataView","Promise","URL","HTMLElement","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","BigInt64Array","BigUint64Array"];function Nh(e){if(null===e)return"null";if(void 0===e)return"undefined";if(!0===e||!1===e)return"boolean";const t=typeof e;if(Th.includes(t))return t;if("function"===t)return"Function";if(Array.isArray(e))return"Array";if(Ih(e))return"Buffer";const r=Bh(e);return r||"Object"}function Ih(e){return e&&e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer.call(null,e)}function Bh(e){const t=Object.prototype.toString.call(e).slice(8,-1);if(Ch.includes(t))return t}I(Nh,"is"),I(Ih,"isBuffer"),I(Bh,"getObjectType");var Oh=class{constructor(e,t,r){this.major=e,this.majorEncoded=e<<5,this.name=t,this.terminal=r}toString(){return`Type[${this.major}].${this.name}`}compare(e){return this.major<e.major?-1:this.major>e.major?1:0}};I(Oh,"Type"),Oh.uint=new Oh(0,"uint",!0),Oh.negint=new Oh(1,"negint",!0),Oh.bytes=new Oh(2,"bytes",!0),Oh.string=new Oh(3,"string",!0),Oh.array=new Oh(4,"array",!1),Oh.map=new Oh(5,"map",!1),Oh.tag=new Oh(6,"tag",!1),Oh.float=new Oh(7,"float",!0),Oh.false=new Oh(7,"false",!0),Oh.true=new Oh(7,"true",!0),Oh.null=new Oh(7,"null",!0),Oh.undefined=new Oh(7,"undefined",!0),Oh.break=new Oh(7,"break",!0);var Dh=class{constructor(e,t,r){this.type=e,this.value=t,this.encodedLength=r,this.encodedBytes=void 0,this.byteValue=void 0}toString(){return`Token[${this.type}].${this.value}`}};I(Dh,"Token");var jh=globalThis.process&&!globalThis.process.browser&&globalThis.Buffer&&"function"==typeof globalThis.Buffer.isBuffer,Lh=new TextDecoder,Ph=new TextEncoder;function Rh(e){return jh&&globalThis.Buffer.isBuffer(e)}function Uh(e){return e instanceof Uint8Array?Rh(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e:Uint8Array.from(e)}I(Rh,"isBuffer"),I(Uh,"asU8A");var zh=jh?(e,t,r)=>r-t>64?globalThis.Buffer.from(e.subarray(t,r)).toString("utf8"):Yh(e,t,r):(e,t,r)=>r-t>64?Lh.decode(e.subarray(t,r)):Yh(e,t,r),Kh=jh?e=>e.length>64?globalThis.Buffer.from(e):Gh(e):e=>e.length>64?Ph.encode(e):Gh(e),Fh=I((e=>Uint8Array.from(e)),"fromArray"),Hh=jh?(e,t,r)=>Rh(e)?new Uint8Array(e.subarray(t,r)):e.slice(t,r):(e,t,r)=>e.slice(t,r),$h=jh?(e,t)=>(e=e.map((e=>e instanceof Uint8Array?e:globalThis.Buffer.from(e))),Uh(globalThis.Buffer.concat(e,t))):(e,t)=>{const r=new Uint8Array(t);let n=0;for(let t of e)n+t.length>r.length&&(t=t.subarray(0,r.length-n)),r.set(t,n),n+=t.length;return r},Vh=jh?e=>globalThis.Buffer.allocUnsafe(e):e=>new Uint8Array(e);function qh(e,t){if(Rh(e)&&Rh(t))return e.compare(t);for(let r=0;r<e.length;r++)if(e[r]!==t[r])return e[r]<t[r]?-1:1;return 0}function Gh(e,t=1/0){let r;const n=e.length;let i=null;const o=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function Yh(e,t,r){const n=[];for(;t<r;){const i=e[t];let o=null,s=i>239?4:i>223?3:i>191?2:1;if(t+s<=r){let r,n,a,c;switch(s){case 1:i<128&&(o=i);break;case 2:r=e[t+1],128==(192&r)&&(c=(31&i)<<6|63&r,c>127&&(o=c));break;case 3:r=e[t+1],n=e[t+2],128==(192&r)&&128==(192&n)&&(c=(15&i)<<12|(63&r)<<6|63&n,c>2047&&(c<55296||c>57343)&&(o=c));break;case 4:r=e[t+1],n=e[t+2],a=e[t+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(c=(15&i)<<18|(63&r)<<12|(63&n)<<6|63&a,c>65535&&c<1114112&&(o=c))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),t+=s}return Jh(n)}I(qh,"compare"),I(Gh,"utf8ToBytes"),I(Yh,"utf8Slice");function Jh(e){const t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=4096));return r}I(Jh,"decodeCodePointsArray");var Qh=class{constructor(e=256){this.chunkSize=e,this.cursor=0,this.maxCursor=-1,this.chunks=[],this._initReuseChunk=null}reset(){this.cursor=0,this.maxCursor=-1,this.chunks.length&&(this.chunks=[]),null!==this._initReuseChunk&&(this.chunks.push(this._initReuseChunk),this.maxCursor=this._initReuseChunk.length-1)}push(e){let t=this.chunks[this.chunks.length-1];if(this.cursor+e.length<=this.maxCursor+1){const r=t.length-(this.maxCursor-this.cursor)-1;t.set(e,r)}else{if(t){const e=t.length-(this.maxCursor-this.cursor)-1;e<t.length&&(this.chunks[this.chunks.length-1]=t.subarray(0,e),this.maxCursor=this.cursor-1)}e.length<64&&e.length<this.chunkSize?(t=Vh(this.chunkSize),this.chunks.push(t),this.maxCursor+=t.length,null===this._initReuseChunk&&(this._initReuseChunk=t),t.set(e,0)):(this.chunks.push(e),this.maxCursor+=e.length)}this.cursor+=e.length}toBytes(e=!1){let t;if(1===this.chunks.length){const r=this.chunks[0];e&&this.cursor>r.length/2?(t=this.cursor===r.length?r:r.subarray(0,this.cursor),this._initReuseChunk=null,this.chunks=[]):t=Hh(r,0,this.cursor)}else t=$h(this.chunks,this.cursor);return e&&this.reset(),t}};I(Qh,"Bl");function Wh(e,t,r){if(e.length-t<r)throw new Error("CBOR decode error: not enough data for type")}I(Wh,"assertEnoughData");var Xh=[24,256,65536,4294967296,BigInt("18446744073709551616")];function Zh(e,t,r){Wh(e,t,1);const n=e[t];if(!0===r.strict&&n<Xh[0])throw new Error("CBOR decode error: integer encoded in more bytes than necessary (strict decode)");return n}function ep(e,t,r){Wh(e,t,2);const n=e[t]<<8|e[t+1];if(!0===r.strict&&n<Xh[1])throw new Error("CBOR decode error: integer encoded in more bytes than necessary (strict decode)");return n}function tp(e,t,r){Wh(e,t,4);const n=16777216*e[t]+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3];if(!0===r.strict&&n<Xh[2])throw new Error("CBOR decode error: integer encoded in more bytes than necessary (strict decode)");return n}function rp(e,t,r){Wh(e,t,8);const n=16777216*e[t]+(e[t+1]<<16)+(e[t+2]<<8)+e[t+3],i=16777216*e[t+4]+(e[t+5]<<16)+(e[t+6]<<8)+e[t+7],o=(BigInt(n)<<BigInt(32))+BigInt(i);if(!0===r.strict&&o<Xh[3])throw new Error("CBOR decode error: integer encoded in more bytes than necessary (strict decode)");if(o<=Number.MAX_SAFE_INTEGER)return Number(o);if(!0===r.allowBigInt)return o;throw new Error("CBOR decode error: integers outside of the safe integer range are not supported")}function np(e,t,r,n){return new Dh(Oh.uint,Zh(e,t+1,n),2)}function ip(e,t,r,n){return new Dh(Oh.uint,ep(e,t+1,n),3)}function op(e,t,r,n){return new Dh(Oh.uint,tp(e,t+1,n),5)}function sp(e,t,r,n){return new Dh(Oh.uint,rp(e,t+1,n),9)}function ap(e,t){return cp(e,0,t.value)}function cp(e,t,r){if(r<Xh[0]){const n=Number(r);e.push([t|n])}else if(r<Xh[1]){const n=Number(r);e.push([24|t,n])}else if(r<Xh[2]){const n=Number(r);e.push([25|t,n>>>8,255&n])}else if(r<Xh[3]){const n=Number(r);e.push([26|t,n>>>24&255,n>>>16&255,n>>>8&255,255&n])}else{const n=BigInt(r);if(!(n<Xh[4]))throw new Error("CBOR decode error: encountered BigInt larger than allowable range");{const r=[27|t,0,0,0,0,0,0,0];let i=Number(n&BigInt(4294967295)),o=Number(n>>BigInt(32)&BigInt(4294967295));r[8]=255&i,i>>=8,r[7]=255&i,i>>=8,r[6]=255&i,i>>=8,r[5]=255&i,r[4]=255&o,o>>=8,r[3]=255&o,o>>=8,r[2]=255&o,o>>=8,r[1]=255&o,e.push(r)}}}function up(e,t,r,n){return new Dh(Oh.negint,-1-Zh(e,t+1,n),2)}function lp(e,t,r,n){return new Dh(Oh.negint,-1-ep(e,t+1,n),3)}function dp(e,t,r,n){return new Dh(Oh.negint,-1-tp(e,t+1,n),5)}I(Zh,"readUint8"),I(ep,"readUint16"),I(tp,"readUint32"),I(rp,"readUint64"),I(np,"decodeUint8"),I(ip,"decodeUint16"),I(op,"decodeUint32"),I(sp,"decodeUint64"),I(ap,"encodeUint"),I(cp,"encodeUintValue"),ap.encodedSize=I((function(e){return cp.encodedSize(e.value)}),"encodedSize"),cp.encodedSize=I((function(e){return e<Xh[0]?1:e<Xh[1]?2:e<Xh[2]?3:e<Xh[3]?5:9}),"encodedSize"),ap.compareTokens=I((function(e,t){return e.value<t.value?-1:e.value>t.value?1:0}),"compareTokens"),I(up,"decodeNegint8"),I(lp,"decodeNegint16"),I(dp,"decodeNegint32");var fp=BigInt(-1),hp=BigInt(1);function pp(e,t,r,n){const i=rp(e,t+1,n);if("bigint"!=typeof i){const e=-1-i;if(e>=Number.MIN_SAFE_INTEGER)return new Dh(Oh.negint,e,9)}if(!0!==n.allowBigInt)throw new Error("CBOR decode error: integers outside of the safe integer range are not supported");return new Dh(Oh.negint,fp-BigInt(i),9)}function mp(e,t){const r=t.value,n="bigint"==typeof r?r*fp-hp:-1*r-1;cp(e,t.type.majorEncoded,n)}function gp(e,t,r,n){Wh(e,t,r+n);const i=Hh(e,t+r,t+r+n);return new Dh(Oh.bytes,i,r+n)}function bp(e,t,r,n){return gp(e,t,1,r)}function yp(e,t,r,n){return gp(e,t,2,Zh(e,t+1,n))}function vp(e,t,r,n){return gp(e,t,3,ep(e,t+1,n))}function wp(e,t,r,n){return gp(e,t,5,tp(e,t+1,n))}function Ap(e,t,r,n){const i=rp(e,t+1,n);if("bigint"==typeof i)throw new Error("CBOR decode error: 64-bit integer bytes lengths not supported");return gp(e,t,9,i)}function Ep(e){return void 0===e.encodedBytes&&(e.encodedBytes=e.type===Oh.string?Kh(e.value):e.value),e.encodedBytes}function Sp(e,t){const r=Ep(t);cp(e,t.type.majorEncoded,r.length),e.push(r)}function xp(e,t){return e.length<t.length?-1:e.length>t.length?1:qh(e,t)}function Mp(e,t,r,n,i){const o=r+n;Wh(e,t,o);const s=new Dh(Oh.string,zh(e,t+r,t+o),o);return!0===i.retainStringBytes&&(s.byteValue=Hh(e,t+r,t+o)),s}function _p(e,t,r,n){return Mp(e,t,1,r,n)}function kp(e,t,r,n){return Mp(e,t,2,Zh(e,t+1,n),n)}function Tp(e,t,r,n){return Mp(e,t,3,ep(e,t+1,n),n)}function Cp(e,t,r,n){return Mp(e,t,5,tp(e,t+1,n),n)}function Np(e,t,r,n){const i=rp(e,t+1,n);if("bigint"==typeof i)throw new Error("CBOR decode error: 64-bit integer string lengths not supported");return Mp(e,t,9,i,n)}I(pp,"decodeNegint64"),I(mp,"encodeNegint"),mp.encodedSize=I((function(e){const t=e.value,r="bigint"==typeof t?t*fp-hp:-1*t-1;return r<Xh[0]?1:r<Xh[1]?2:r<Xh[2]?3:r<Xh[3]?5:9}),"encodedSize"),mp.compareTokens=I((function(e,t){return e.value<t.value?1:e.value>t.value?-1:0}),"compareTokens"),I(gp,"toToken"),I(bp,"decodeBytesCompact"),I(yp,"decodeBytes8"),I(vp,"decodeBytes16"),I(wp,"decodeBytes32"),I(Ap,"decodeBytes64"),I(Ep,"tokenBytes"),I(Sp,"encodeBytes"),Sp.encodedSize=I((function(e){const t=Ep(e);return cp.encodedSize(t.length)+t.length}),"encodedSize"),Sp.compareTokens=I((function(e,t){return xp(Ep(e),Ep(t))}),"compareTokens"),I(xp,"compareBytes"),I(Mp,"toToken"),I(_p,"decodeStringCompact"),I(kp,"decodeString8"),I(Tp,"decodeString16"),I(Cp,"decodeString32"),I(Np,"decodeString64");var Ip=Sp;function Bp(e,t,r,n){return new Dh(Oh.array,n,r)}function Op(e,t,r,n){return Bp(0,0,1,r)}function Dp(e,t,r,n){return Bp(0,0,2,Zh(e,t+1,n))}function jp(e,t,r,n){return Bp(0,0,3,ep(e,t+1,n))}function Lp(e,t,r,n){return Bp(0,0,5,tp(e,t+1,n))}function Pp(e,t,r,n){const i=rp(e,t+1,n);if("bigint"==typeof i)throw new Error("CBOR decode error: 64-bit integer array lengths not supported");return Bp(0,0,9,i)}function Rp(e,t,r,n){if(!1===n.allowIndefinite)throw new Error("CBOR decode error: indefinite length items not allowed");return Bp(0,0,1,1/0)}function Up(e,t){cp(e,Oh.array.majorEncoded,t.value)}function zp(e,t,r,n){return new Dh(Oh.map,n,r)}function Kp(e,t,r,n){return zp(0,0,1,r)}function Fp(e,t,r,n){return zp(0,0,2,Zh(e,t+1,n))}function Hp(e,t,r,n){return zp(0,0,3,ep(e,t+1,n))}function $p(e,t,r,n){return zp(0,0,5,tp(e,t+1,n))}function Vp(e,t,r,n){const i=rp(e,t+1,n);if("bigint"==typeof i)throw new Error("CBOR decode error: 64-bit integer map lengths not supported");return zp(0,0,9,i)}function qp(e,t,r,n){if(!1===n.allowIndefinite)throw new Error("CBOR decode error: indefinite length items not allowed");return zp(0,0,1,1/0)}function Gp(e,t){cp(e,Oh.map.majorEncoded,t.value)}function Yp(e,t,r,n){return new Dh(Oh.tag,r,1)}function Jp(e,t,r,n){return new Dh(Oh.tag,Zh(e,t+1,n),2)}function Qp(e,t,r,n){return new Dh(Oh.tag,ep(e,t+1,n),3)}function Wp(e,t,r,n){return new Dh(Oh.tag,tp(e,t+1,n),5)}function Xp(e,t,r,n){return new Dh(Oh.tag,rp(e,t+1,n),9)}function Zp(e,t){cp(e,Oh.tag.majorEncoded,t.value)}I(Bp,"toToken"),I(Op,"decodeArrayCompact"),I(Dp,"decodeArray8"),I(jp,"decodeArray16"),I(Lp,"decodeArray32"),I(Pp,"decodeArray64"),I(Rp,"decodeArrayIndefinite"),I(Up,"encodeArray"),Up.compareTokens=ap.compareTokens,Up.encodedSize=I((function(e){return cp.encodedSize(e.value)}),"encodedSize"),I(zp,"toToken"),I(Kp,"decodeMapCompact"),I(Fp,"decodeMap8"),I(Hp,"decodeMap16"),I($p,"decodeMap32"),I(Vp,"decodeMap64"),I(qp,"decodeMapIndefinite"),I(Gp,"encodeMap"),Gp.compareTokens=ap.compareTokens,Gp.encodedSize=I((function(e){return cp.encodedSize(e.value)}),"encodedSize"),I(Yp,"decodeTagCompact"),I(Jp,"decodeTag8"),I(Qp,"decodeTag16"),I(Wp,"decodeTag32"),I(Xp,"decodeTag64"),I(Zp,"encodeTag"),Zp.compareTokens=ap.compareTokens,Zp.encodedSize=I((function(e){return cp.encodedSize(e.value)}),"encodedSize");function em(e,t,r,n){if(!1===n.allowUndefined)throw new Error("CBOR decode error: undefined values are not supported");return!0===n.coerceUndefinedToNull?new Dh(Oh.null,null,1):new Dh(Oh.undefined,void 0,1)}function tm(e,t,r,n){if(!1===n.allowIndefinite)throw new Error("CBOR decode error: indefinite length items not allowed");return new Dh(Oh.break,void 0,1)}function rm(e,t,r){if(r){if(!1===r.allowNaN&&Number.isNaN(e))throw new Error("CBOR decode error: NaN values are not supported");if(!1===r.allowInfinity&&(e===1/0||e===-1/0))throw new Error("CBOR decode error: Infinity values are not supported")}return new Dh(Oh.float,e,t)}function nm(e,t,r,n){return rm(dm(e,t+1),3,n)}function im(e,t,r,n){return rm(hm(e,t+1),5,n)}function om(e,t,r,n){return rm(mm(e,t+1),9,n)}function sm(e,t,r){const n=t.value;if(!1===n)e.push([20|Oh.float.majorEncoded]);else if(!0===n)e.push([21|Oh.float.majorEncoded]);else if(null===n)e.push([22|Oh.float.majorEncoded]);else if(void 0===n)e.push([23|Oh.float.majorEncoded]);else{let t,i=!1;r&&!0===r.float64||(lm(n),t=dm(um,1),n===t||Number.isNaN(n)?(um[0]=249,e.push(um.slice(0,3)),i=!0):(fm(n),t=hm(um,1),n===t&&(um[0]=250,e.push(um.slice(0,5)),i=!0))),i||(pm(n),t=mm(um,1),um[0]=251,e.push(um.slice(0,9)))}}I(em,"decodeUndefined"),I(tm,"decodeBreak"),I(rm,"createToken"),I(nm,"decodeFloat16"),I(im,"decodeFloat32"),I(om,"decodeFloat64"),I(sm,"encodeFloat"),sm.encodedSize=I((function(e,t){const r=e.value;if(!1===r||!0===r||null==r)return 1;if(!t||!0!==t.float64){lm(r);let e=dm(um,1);if(r===e||Number.isNaN(r))return 3;if(fm(r),e=hm(um,1),r===e)return 5}return 9}),"encodedSize");var am=new ArrayBuffer(9),cm=new DataView(am,1),um=new Uint8Array(am,0);function lm(e){if(e===1/0)cm.setUint16(0,31744,!1);else if(e===-1/0)cm.setUint16(0,64512,!1);else if(Number.isNaN(e))cm.setUint16(0,32256,!1);else{cm.setFloat32(0,e);const t=cm.getUint32(0),r=(2139095040&t)>>23,n=8388607&t;if(255===r)cm.setUint16(0,31744,!1);else if(0===r)cm.setUint16(0,(2147483648&e)>>16|n>>13,!1);else{const e=r-127;e<-24?cm.setUint16(0,0):e<-14?cm.setUint16(0,(2147483648&t)>>16|1<<24+e,!1):cm.setUint16(0,(2147483648&t)>>16|e+15<<10|n>>13,!1)}}}function dm(e,t){if(e.length-t<2)throw new Error("CBOR decode error: not enough data for float16");const r=(e[t]<<8)+e[t+1];if(31744===r)return 1/0;if(64512===r)return-1/0;if(32256===r)return NaN;const n=r>>10&31,i=1023&r;let o;return o=0===n?i*k(2,-24):31!==n?(i+1024)*k(2,n-25):0===i?1/0:NaN,32768&r?-o:o}function fm(e){cm.setFloat32(0,e,!1)}function hm(e,t){if(e.length-t<4)throw new Error("CBOR decode error: not enough data for float32");const r=(e.byteOffset||0)+t;return new DataView(e.buffer,r,4).getFloat32(0,!1)}function pm(e){cm.setFloat64(0,e,!1)}function mm(e,t){if(e.length-t<8)throw new Error("CBOR decode error: not enough data for float64");const r=(e.byteOffset||0)+t;return new DataView(e.buffer,r,8).getFloat64(0,!1)}function gm(e,t,r){throw new Error(`CBOR decode error: encountered invalid minor (${r}) for major ${e[t]>>>5}`)}function bm(e){return()=>{throw new Error(`CBOR decode error: ${e}`)}}I(lm,"encodeFloat16"),I(dm,"readFloat16"),I(fm,"encodeFloat32"),I(hm,"readFloat32"),I(pm,"encodeFloat64"),I(mm,"readFloat64"),sm.compareTokens=ap.compareTokens,I(gm,"invalidMinor"),I(bm,"errorer");var ym=[];for(let e=0;e<=23;e++)ym[e]=gm;ym[24]=np,ym[25]=ip,ym[26]=op,ym[27]=sp,ym[28]=gm,ym[29]=gm,ym[30]=gm,ym[31]=gm;for(let e=32;e<=55;e++)ym[e]=gm;ym[56]=up,ym[57]=lp,ym[58]=dp,ym[59]=pp,ym[60]=gm,ym[61]=gm,ym[62]=gm,ym[63]=gm;for(let e=64;e<=87;e++)ym[e]=bp;ym[88]=yp,ym[89]=vp,ym[90]=wp,ym[91]=Ap,ym[92]=gm,ym[93]=gm,ym[94]=gm,ym[95]=bm("indefinite length bytes/strings are not supported");for(let e=96;e<=119;e++)ym[e]=_p;ym[120]=kp,ym[121]=Tp,ym[122]=Cp,ym[123]=Np,ym[124]=gm,ym[125]=gm,ym[126]=gm,ym[127]=bm("indefinite length bytes/strings are not supported");for(let e=128;e<=151;e++)ym[e]=Op;ym[152]=Dp,ym[153]=jp,ym[154]=Lp,ym[155]=Pp,ym[156]=gm,ym[157]=gm,ym[158]=gm,ym[159]=Rp;for(let e=160;e<=183;e++)ym[e]=Kp;ym[184]=Fp,ym[185]=Hp,ym[186]=$p,ym[187]=Vp,ym[188]=gm,ym[189]=gm,ym[190]=gm,ym[191]=qp;for(let e=192;e<=215;e++)ym[e]=Yp;ym[216]=Jp,ym[217]=Qp,ym[218]=Wp,ym[219]=Xp,ym[220]=gm,ym[221]=gm,ym[222]=gm,ym[223]=gm;for(let e=224;e<=243;e++)ym[e]=bm("simple values are not supported");ym[244]=gm,ym[245]=gm,ym[246]=gm,ym[247]=em,ym[248]=bm("simple values are not supported"),ym[249]=nm,ym[250]=im,ym[251]=om,ym[252]=gm,ym[253]=gm,ym[254]=gm,ym[255]=tm;var vm=[];for(let e=0;e<24;e++)vm[e]=new Dh(Oh.uint,e,1);for(let e=-1;e>=-24;e--)vm[31-e]=new Dh(Oh.negint,e,1);function wm(e){switch(e.type){case Oh.false:return Fh([244]);case Oh.true:return Fh([245]);case Oh.null:return Fh([246]);case Oh.bytes:return e.value.length?void 0:Fh([64]);case Oh.string:return""===e.value?Fh([96]):void 0;case Oh.array:return 0===e.value?Fh([128]):void 0;case Oh.map:return 0===e.value?Fh([160]):void 0;case Oh.uint:return e.value<24?Fh([Number(e.value)]):void 0;case Oh.negint:if(e.value>=-24)return Fh([31-Number(e.value)])}}vm[64]=new Dh(Oh.bytes,new Uint8Array(0),1),vm[96]=new Dh(Oh.string,"",1),vm[128]=new Dh(Oh.array,0,1),vm[160]=new Dh(Oh.map,0,1),vm[244]=new Dh(Oh.false,!1,1),vm[245]=new Dh(Oh.true,!0,1),vm[246]=new Dh(Oh.null,null,1),I(wm,"quickEncodeToken");var Am={float64:!1,mapSorter:Nm,quickEncodeToken:wm};function Em(){const e=[];return e[Oh.uint.major]=ap,e[Oh.negint.major]=mp,e[Oh.bytes.major]=Sp,e[Oh.string.major]=Ip,e[Oh.array.major]=Up,e[Oh.map.major]=Gp,e[Oh.tag.major]=Zp,e[Oh.float.major]=sm,e}I(Em,"makeCborEncoders");var Sm=Em(),xm=new Qh,Mm=class{constructor(e,t){this.obj=e,this.parent=t}includes(e){let t=this;do{if(t.obj===e)return!0}while(t=t.parent);return!1}static createCheck(e,t){if(e&&e.includes(t))throw new Error("CBOR encode error: object contains circular references");return new Mm(t,e)}};I(Mm,"Ref");var _m={null:new Dh(Oh.null,null),undefined:new Dh(Oh.undefined,void 0),true:new Dh(Oh.true,!0),false:new Dh(Oh.false,!1),emptyArray:new Dh(Oh.array,0),emptyMap:new Dh(Oh.map,0)},km={number:(e,t,r,n)=>Number.isInteger(e)&&Number.isSafeInteger(e)?new Dh(e>=0?Oh.uint:Oh.negint,e):new Dh(Oh.float,e),bigint:(e,t,r,n)=>e>=BigInt(0)?new Dh(Oh.uint,e):new Dh(Oh.negint,e),Uint8Array:(e,t,r,n)=>new Dh(Oh.bytes,e),string:(e,t,r,n)=>new Dh(Oh.string,e),boolean:(e,t,r,n)=>e?_m.true:_m.false,null:(e,t,r,n)=>_m.null,undefined:(e,t,r,n)=>_m.undefined,ArrayBuffer:(e,t,r,n)=>new Dh(Oh.bytes,new Uint8Array(e)),DataView:(e,t,r,n)=>new Dh(Oh.bytes,new Uint8Array(e.buffer,e.byteOffset,e.byteLength)),Array(e,t,r,n){if(!e.length)return!0===r.addBreakTokens?[_m.emptyArray,new Dh(Oh.break)]:_m.emptyArray;n=Mm.createCheck(n,e);const i=[];let o=0;for(const t of e)i[o++]=Tm(t,r,n);return r.addBreakTokens?[new Dh(Oh.array,e.length),i,new Dh(Oh.break)]:[new Dh(Oh.array,e.length),i]},Object(e,t,r,n){const i="Object"!==t,o=i?e.keys():Object.keys(e),s=i?e.size:o.length;if(!s)return!0===r.addBreakTokens?[_m.emptyMap,new Dh(Oh.break)]:_m.emptyMap;n=Mm.createCheck(n,e);const a=[];let c=0;for(const t of o)a[c++]=[Tm(t,r,n),Tm(i?e.get(t):e[t],r,n)];return Cm(a,r),r.addBreakTokens?[new Dh(Oh.map,s),a,new Dh(Oh.break)]:[new Dh(Oh.map,s),a]}};km.Map=km.Object,km.Buffer=km.Uint8Array;for(const e of"Uint8Clamped Uint16 Uint32 Int8 Int16 Int32 BigUint64 BigInt64 Float32 Float64".split(" "))km[`${e}Array`]=km.DataView;function Tm(e,t={},r){const n=Nh(e),i=t&&t.typeEncoders&&t.typeEncoders[n]||km[n];if("function"==typeof i){const o=i(e,n,t,r);if(null!=o)return o}const o=km[n];if(!o)throw new Error(`CBOR encode error: unsupported type: ${n}`);return o(e,n,t,r)}function Cm(e,t){t.mapSorter&&e.sort(t.mapSorter)}function Nm(e,t){const r=Array.isArray(e[0])?e[0][0]:e[0],n=Array.isArray(t[0])?t[0][0]:t[0];if(r.type!==n.type)return r.type.compare(n.type);const i=r.type.major,o=Sm[i].compareTokens(r,n);return 0===o&&console.warn("WARNING: complex key types used, CBOR key sorting guarantees are gone"),o}function Im(e,t,r,n){if(Array.isArray(t))for(const i of t)Im(e,i,r,n);else r[t.type.major](e,t,n)}function Bm(e,t,r){const n=Tm(e,r);if(!Array.isArray(n)&&r.quickEncodeToken){const e=r.quickEncodeToken(n);if(e)return e;const i=t[n.type.major];if(i.encodedSize){const e=i.encodedSize(n,r),t=new Qh(e);if(i(t,n,r),1!==t.chunks.length)throw new Error(`Unexpected error: pre-calculated length for ${n} was wrong`);return Uh(t.chunks[0])}}return xm.reset(),Im(xm,n,t,r),xm.toBytes(!0)}function Om(e,t){return t=Object.assign({},Am,t),Bm(e,Sm,t)}I(Tm,"objectToTokens"),I(Cm,"sortMapEntries"),I(Nm,"mapSorter"),I(Im,"tokensToEncoded"),I(Bm,"encodeCustom"),I(Om,"encode");var Dm={strict:!1,allowIndefinite:!0,allowUndefined:!0,allowBigInt:!0},jm=class{constructor(e,t={}){this.pos=0,this.data=e,this.options=t}done(){return this.pos>=this.data.length}next(){const e=this.data[this.pos];let t=vm[e];if(void 0===t){const r=ym[e];if(!r)throw new Error(`CBOR decode error: no decoder for major type ${e>>>5} (byte 0x${e.toString(16).padStart(2,"0")})`);const n=31&e;t=r(this.data,this.pos,n,this.options)}return this.pos+=t.encodedLength,t}};I(jm,"Tokeniser");var Lm=Symbol.for("DONE"),Pm=Symbol.for("BREAK");function Rm(e,t,r){const n=[];for(let i=0;i<e.value;i++){const o=zm(t,r);if(o===Pm){if(e.value===1/0)break;throw new Error("CBOR decode error: got unexpected break to lengthed array")}if(o===Lm)throw new Error(`CBOR decode error: found array but not enough entries (got ${i}, expected ${e.value})`);n[i]=o}return n}function Um(e,t,r){const n=!0===r.useMaps,i=n?void 0:{},o=n?new Map:void 0;for(let s=0;s<e.value;s++){const a=zm(t,r);if(a===Pm){if(e.value===1/0)break;throw new Error("CBOR decode error: got unexpected break to lengthed map")}if(a===Lm)throw new Error(`CBOR decode error: found map but not enough entries (got ${s} [no key], expected ${e.value})`);if(!0!==n&&"string"!=typeof a)throw new Error(`CBOR decode error: non-string keys not supported (got ${typeof a})`);const c=zm(t,r);if(c===Lm)throw new Error(`CBOR decode error: found map but not enough entries (got ${s} [no value], expected ${e.value})`);n?o.set(a,c):i[a]=c}return n?o:i}function zm(e,t){if(e.done())return Lm;const r=e.next();if(r.type===Oh.break)return Pm;if(r.type.terminal)return r.value;if(r.type===Oh.array)return Rm(r,e,t);if(r.type===Oh.map)return Um(r,e,t);if(r.type===Oh.tag){if(t.tags&&"function"==typeof t.tags[r.value]){const n=zm(e,t);return t.tags[r.value](n)}throw new Error(`CBOR decode error: tag not supported (${r.value})`)}throw new Error("unsupported")}function Km(e,t){if(!(e instanceof Uint8Array))throw new Error("CBOR decode error: data to decode must be a Uint8Array");const r=(t=Object.assign({},Dm,t)).tokenizer||new jm(e,t),n=zm(r,t);if(n===Lm)throw new Error("CBOR decode error: did not find any content to decode");if(n===Pm)throw new Error("CBOR decode error: got unexpected break");if(!r.done())throw new Error("CBOR decode error: too many terminals, data makes no sense");return n}I(Rm,"tokenToArray"),I(Um,"tokenToMap"),I(zm,"tokensToObject"),I(Km,"decode"),vr();function Fm(e){if(e.asCID!==e)return null;const t=nr.asCID(e);if(!t)return null;const r=new Uint8Array(t.bytes.byteLength+1);return r.set(t.bytes,1),[new Dh(Oh.tag,42),new Dh(Oh.bytes,r)]}function Hm(){throw new Error("`undefined` is not supported by the IPLD Data Model and cannot be encoded")}function $m(e){if(Number.isNaN(e))throw new Error("`NaN` is not supported by the IPLD Data Model and cannot be encoded");if(e===1/0||e===-1/0)throw new Error("`Infinity` and `-Infinity` is not supported by the IPLD Data Model and cannot be encoded");return null}I(Fm,"cidEncoder"),I(Hm,"undefinedEncoder"),I($m,"numberEncoder");var Vm={float64:!0,typeEncoders:{Object:Fm,undefined:Hm,number:$m}};function qm(e){if(0!==e[0])throw new Error("Invalid CID for CBOR tag 42; expected leading 0x00");return nr.decode(e.subarray(1))}I(qm,"cidDecoder");var Gm={allowIndefinite:!1,coerceUndefinedToNull:!0,allowNaN:!1,allowInfinity:!1,allowBigInt:!0,strict:!0,useMaps:!1,tags:[]};Gm.tags[42]=qm;var Ym="dag-cbor",Jm=113,Qm=I((e=>Om(e,Vm)),"encode"),Wm=I((e=>Km(e,Gm)),"decode");function Xm(e){return z(this,null,(function*(){const t=yield _h({value:e,codec:kh,hasher:Dt});return{cid:t.cid,linkedBlock:t.bytes}}))}function Zm(e,t=24){const r=(t-e.length%t)%t,n=new Uint8Array(e.length+r);return n.set(e,0),n}function eg(e){return z(this,null,(function*(){return(yield _h({value:e,codec:kh,hasher:zt})).cid}))}function tg(e){if((e=nr.asCID(e)).code!==Jm)throw new Error("CID codec must be dag-cbor");if(e.multihash.code!==zt.code)throw new Error("CID must use identity multihash");return Wm(e.multihash.digest)}function rg(e,t){return z(this,null,(function*(){return Zm((yield eg(e)).bytes,t)}))}function ng(e){return tg(nr.decodeFirst(e)[0])}I(Xm,"encodePayload"),I(Zm,"pad"),I(eg,"encodeIdentityCID"),I(tg,"decodeIdentityCID"),I(rg,"prepareCleartext"),I(ng,"decodeCleartext");var ig=Symbol("abortable"),og=Symbol("aborted");function sg(e,t){if(t.aborted)return Promise.reject(og);let r;const n=new Promise(((e,t)=>{r=t}));return t.addEventListener("abort",(()=>{r(og)})),Promise.race([e,n])}I(sg,"abortable");var ag,cg,ug=I(((e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce(((e,t)=>e+=(t&=63)<36?t.toString(36):t<62?(t-26).toString(36).toUpperCase():t>62?"-":"_"),"")),"nanoid");(cg=ag||(ag={}))[cg.PARSE_ERROR=-32700]="PARSE_ERROR",cg[cg.INVALID_REQUEST=-32600]="INVALID_REQUEST",cg[cg.METHOD_NOT_FOUND=-32601]="METHOD_NOT_FOUND",cg[cg.INVALID_PARAMS=-32602]="INVALID_PARAMS",cg[cg.INTERNAL_ERROR=-32603]="INTERNAL_ERROR";var lg={[ag.PARSE_ERROR]:"Parse error",[ag.INVALID_REQUEST]:"Invalid request",[ag.METHOD_NOT_FOUND]:"Method not found",[ag.INVALID_PARAMS]:"Invalid params",[ag.INTERNAL_ERROR]:"Internal error"};function dg(e){return-32e3>=e&&e>=-32099}function fg(e){var t;return null!=(t=lg[e.toString()])?t:dg(e)?"Server error":"Application error"}I(dg,"isServerError"),I(fg,"getErrorMessage");var hg=class extends Error{static fromObject(e){return new hg(e.code,e.message,e.data)}toObject(){return{code:this.code,data:this.data,message:this.message}}constructor(e,t,r){super(),Object.setPrototypeOf(this,hg.prototype),this.code=e,this.data=r,this.message=null!=t?t:fg(e)}};function pg(e){const t=lg[e];return I((function(r){return new hg(e,t,r)}),"createError")}function mg(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function gg(e,t){return t.get?t.get.call(e):t.value}function bg(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}function yg(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}function vg(e,t){return gg(e,yg(e,t,"get"))}function wg(e,t,r){mg(e,t),t.set(e,r)}function Ag(e,t,r){return bg(e,yg(e,t,"set"),r),r}I(hg,"RPCError"),I(pg,"createErrorFactory"),pg(ag.PARSE_ERROR),pg(ag.INVALID_REQUEST),pg(ag.METHOD_NOT_FOUND),pg(ag.INVALID_PARAMS),pg(ag.INTERNAL_ERROR),I(mg,"_checkPrivateRedeclaration"),I(gg,"_classApplyDescriptorGet"),I(bg,"_classApplyDescriptorSet"),I(yg,"_classExtractFieldDescriptor"),I(vg,"_classPrivateFieldGet"),I(wg,"_classPrivateFieldInit"),I(Ag,"_classPrivateFieldSet");var Eg=new WeakMap,Sg=class{get connection(){return vg(this,Eg)}createID(){return ug()}request(e,t,r={}){const{signal:n}=r;if(null==n?void 0:n.aborted)return Promise.reject(og);const i=this.createID(),o=vg(this,Eg).send({jsonrpc:"2.0",id:i,method:e,params:t}).then((e=>{if(null==e)throw new Error("Missing response");if(null!=e.error)throw hg.fromObject(e.error);return e.result}));return null==n?o:(n.addEventListener("abort",(()=>{this.notify("utils_abort_request",{id:i})})),sg(o,n))}notify(e,t){return z(this,null,(function*(){yield vg(this,Eg).send({jsonrpc:"2.0",method:e,params:t})}))}constructor(e){wg(this,Eg,{writable:!0,value:void 0}),Ag(this,Eg,e)}};function xg(e,t){return{jsonrpc:"2.0",id:e,error:{code:t,message:fg(t)}}}function Mg(e,t,r){console.warn("Unhandled handler error",t,r)}function _g(e,t){console.warn("Unhandled invalid message",t)}function kg(e,t){console.warn("Unhandled notification",t)}function Tg(e,t={}){var r,n,i;const o=null!=(r=t.onHandlerError)?r:Mg,s=null!=(n=t.onInvalidMessage)?n:_g,a=null!=(i=t.onNotification)?i:kg,c={};function u(e,t){var r,n;if("utils_abort_request"===t.method){const e=null==(r=t.params)?void 0:r.id;null!=e&&(null==(n=c[e])||n.abort())}else a(e,t)}return I(u,"handleNotification"),I((function(t,r){return z(this,null,(function*(){var n,i,a;const l=r.id;if("2.0"!==r.jsonrpc||null==r.method)return null==l?(s(t,r),null):xg(l,ag.INVALID_REQUEST);const d=e[r.method];if(null==d)return null==l?(u(t,r),null):xg(l,ag.METHOD_NOT_FOUND);try{let e;if(null!=l&&d[ig]){const n=new AbortController;c[l]=n,e=d(t,r.params,{signal:n.signal})}else e=d(t,r.params,{});const i=null==e?e:"function"==typeof e.then?yield e:e;return null==l||(null==(n=c[l])?void 0:n.signal.aborted)?null:{jsonrpc:"2.0",id:l,result:i}}catch(e){if(null==l||(null==(i=c[l])?void 0:i.signal.aborted))return o(t,r,e),null;let n;if(e instanceof hg)n=e.toObject();else{o(t,r,e);const i=null!=(a=e.code)?a:-32e3;n={code:i,message:e.message||fg(i)}}return{jsonrpc:"2.0",id:l,error:n}}finally{null!=l&&delete c[l]}}))}),"handleRequest")}I(Sg,"RPCClient"),I(xg,"createErrorResponse"),I(Mg,"fallbackOnHandlerError"),I(_g,"fallbackOnInvalidMessage"),I(kg,"fallbackOnNotification"),I(Tg,"createHandler"),vr();var Cg=R(Yn(),1),Ng=R(Ln(),1);function Ig(){return Ig=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Ig.apply(this,arguments)}I(Ig,"_extends");var Bg={name:"chainId",regex:"[-:a-zA-Z0-9]{5,41}",parameters:{delimiter:":",values:{0:{name:"namespace",regex:"[-a-z0-9]{3,8}"},1:{name:"reference",regex:"[-a-zA-Z0-9]{1,32}"}}}},Og=Bg,Dg={name:"accountId",regex:"[-:a-zA-Z0-9]{7,106}",parameters:{delimiter:":",values:{0:{name:"namespace",regex:"[-a-z0-9]{3,8}"},1:{name:"reference",regex:"[-a-zA-Z0-9]{1,32}"},2:{name:"address",regex:"[a-zA-Z0-9]{1,64}"}}}};function jg(e,t){return e.split(t.parameters.delimiter)}function Lg(e,t){var r=jg(e,t),n={};return r.forEach((function(e,r){n[t.parameters.values[r].name]=e})),n}function Pg(e,t){return Object.values(t.parameters.values).map((function(t){var r=e[t.name];return"string"==typeof r?r:Pg(r,t)})).join(t.parameters.delimiter)}function Rg(e,t){if(!new RegExp(t.regex).test(e))return!1;var r=jg(e,t);return r.length===Object.keys(t.parameters.values).length&&r.map((function(e,r){return new RegExp(t.parameters.values[r].regex).test(e)})).filter((function(e){return!!e})).length===r.length}I(jg,"splitParams"),I(Lg,"getParams"),I(Pg,"joinParams"),I(Rg,"isValidId");var Ug=function(){function e(t){"string"==typeof t&&(t=e.parse(t)),this.namespace=t.namespace,this.reference=t.reference}I(e,"ChainId"),e.parse=I((function(t){if(!Rg(t,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+t);return new e(Lg(t,this.spec)).toJSON()}),"parse"),e.format=I((function(e){return Pg(e,this.spec)}),"format");var t=e.prototype;return t.toString=I((function(){return e.format(this.toJSON())}),"toString"),t.toJSON=I((function(){return{namespace:this.namespace,reference:this.reference}}),"toJSON"),e}();Ug.spec=Og;var zg=function(){function e(t){"string"==typeof t&&(t=e.parse(t)),this.chainId=new Ug(t.chainId),this.address=t.address}I(e,"AccountId"),e.parse=I((function(t){if(!Rg(t,this.spec))throw new Error("Invalid "+this.spec.name+" provided: "+t);var r=Lg(t,this.spec),n=r.namespace,i=r.reference,o=r.address;return new e({chainId:new Ug({namespace:n,reference:i}),address:o}).toJSON()}),"parse"),e.format=I((function(e){return Pg(Ig({},new Ug(e.chainId).toJSON(),{address:e.address}),this.spec)}),"format");var t=e.prototype;return t.toString=I((function(){return e.format(this.toJSON())}),"toString"),t.toJSON=I((function(){return{chainId:this.chainId.toJSON(),address:this.address}}),"toJSON"),e}();zg.spec=Dg;var Kg=!1,Fg=!1,Hg={debug:1,default:2,info:2,warning:3,error:4,off:5},$g=Hg.default,Vg=null;function qg(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach((t=>{try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(r){e.push(t)}})),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){return e.message}return null}I(qg,"_checkNormalize");var Gg,Yg,Jg,Qg,Wg=qg();(Yg=Gg||(Gg={})).DEBUG="DEBUG",Yg.INFO="INFO",Yg.WARNING="WARNING",Yg.ERROR="ERROR",Yg.OFF="OFF",(Qg=Jg||(Jg={})).UNKNOWN_ERROR="UNKNOWN_ERROR",Qg.NOT_IMPLEMENTED="NOT_IMPLEMENTED",Qg.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",Qg.NETWORK_ERROR="NETWORK_ERROR",Qg.SERVER_ERROR="SERVER_ERROR",Qg.TIMEOUT="TIMEOUT",Qg.BUFFER_OVERRUN="BUFFER_OVERRUN",Qg.NUMERIC_FAULT="NUMERIC_FAULT",Qg.MISSING_NEW="MISSING_NEW",Qg.INVALID_ARGUMENT="INVALID_ARGUMENT",Qg.MISSING_ARGUMENT="MISSING_ARGUMENT",Qg.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",Qg.CALL_EXCEPTION="CALL_EXCEPTION",Qg.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",Qg.NONCE_EXPIRED="NONCE_EXPIRED",Qg.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",Qg.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",Qg.TRANSACTION_REPLACED="TRANSACTION_REPLACED";var Xg="0123456789abcdef",Zg=class{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const r=e.toLowerCase();null==Hg[r]&&this.throwArgumentError("invalid log level name","logLevel",e),$g>Hg[r]||console.log.apply(console,t)}debug(...e){this._log(Zg.levels.DEBUG,e)}info(...e){this._log(Zg.levels.INFO,e)}warn(...e){this._log(Zg.levels.WARNING,e)}makeError(e,t,r){if(Fg)return this.makeError("censored error",t,{});t||(t=Zg.errors.UNKNOWN_ERROR),r||(r={});const n=[];Object.keys(r).forEach((e=>{const t=r[e];try{if(t instanceof Uint8Array){let r="";for(let e=0;e<t.length;e++)r+=Xg[t[e]>>4],r+=Xg[15&t[e]];n.push(e+"=Uint8Array(0x"+r+")")}else n.push(e+"="+JSON.stringify(t))}catch(t){n.push(e+"="+JSON.stringify(r[e].toString()))}})),n.push(`code=${t}`),n.push(`version=${this.version}`);const i=e;let o="";switch(t){case Jg.NUMERIC_FAULT:{o="NUMERIC_FAULT";const t=e;switch(t){case"overflow":case"underflow":case"division-by-zero":o+="-"+t;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result"}break}case Jg.CALL_EXCEPTION:case Jg.INSUFFICIENT_FUNDS:case Jg.MISSING_NEW:case Jg.NONCE_EXPIRED:case Jg.REPLACEMENT_UNDERPRICED:case Jg.TRANSACTION_REPLACED:case Jg.UNPREDICTABLE_GAS_LIMIT:o=t}o&&(e+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),n.length&&(e+=" ("+n.join(", ")+")");const s=new Error(e);return s.reason=i,s.code=t,Object.keys(r).forEach((function(e){s[e]=r[e]})),s}throwError(e,t,r){throw this.makeError(e,t,r)}throwArgumentError(e,t,r){return this.throwError(e,Zg.errors.INVALID_ARGUMENT,{argument:t,value:r})}assert(e,t,r,n){e||this.throwError(t,r,n)}assertArgument(e,t,r,n){e||this.throwArgumentError(t,r,n)}checkNormalize(e){null==e&&(e="platform missing String.prototype.normalize"),Wg&&this.throwError("platform missing String.prototype.normalize",Zg.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:Wg})}checkSafeUint53(e,t){"number"==typeof e&&(null==t&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,Zg.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,Zg.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,r){r=r?": "+r:"",e<t&&this.throwError("missing argument"+r,Zg.errors.MISSING_ARGUMENT,{count:e,expectedCount:t}),e>t&&this.throwError("too many arguments"+r,Zg.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){e!==Object&&null!=e||this.throwError("missing new",Zg.errors.MISSING_NEW,{name:t.name})}checkAbstract(e,t){e===t?this.throwError("cannot instantiate abstract class "+JSON.stringify(t.name)+" directly; use a sub-class",Zg.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",Zg.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return Vg||(Vg=new Zg("logger/5.6.0")),Vg}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",Zg.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),Kg){if(!e)return;this.globalLogger().throwError("error censorship permanent",Zg.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}Fg=!!e,Kg=!!t}static setLogLevel(e){const t=Hg[e.toLowerCase()];null!=t?$g=t:Zg.globalLogger().warn("invalid log level - "+e)}static from(e){return new Zg(e)}};I(Zg,"Logger"),Zg.errors=Jg,Zg.levels=Gg;var eb=new Zg("bytes/5.6.1");function tb(e){return!!e.toHexString}function rb(e){return e.slice||(e.slice=function(){const t=Array.prototype.slice.call(arguments);return rb(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function nb(e){return ub(e)&&!(e.length%2)||ob(e)}function ib(e){return"number"==typeof e&&e==e&&e%1==0}function ob(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"==typeof e)return!1;if(!ib(e.length)||e.length<0)return!1;for(let t=0;t<e.length;t++){const r=e[t];if(!ib(r)||r<0||r>=256)return!1}return!0}function sb(e,t){if(t||(t={}),"number"==typeof e){eb.checkSafeUint53(e,"invalid arrayify value");const t=[];for(;e;)t.unshift(255&e),e=parseInt(String(e/256));return 0===t.length&&t.push(0),rb(new Uint8Array(t))}if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),tb(e)&&(e=e.toHexString()),ub(e)){let r=e.substring(2);r.length%2&&("left"===t.hexPad?r="0"+r:"right"===t.hexPad?r+="0":eb.throwArgumentError("hex data is odd-length","value",e));const n=[];for(let e=0;e<r.length;e+=2)n.push(parseInt(r.substring(e,e+2),16));return rb(new Uint8Array(n))}return ob(e)?rb(new Uint8Array(e)):eb.throwArgumentError("invalid arrayify value","value",e)}function ab(e){const t=e.map((e=>sb(e))),r=t.reduce(((e,t)=>e+t.length),0),n=new Uint8Array(r);return t.reduce(((e,t)=>(n.set(t,e),e+t.length)),0),rb(n)}function cb(e,t){(e=sb(e)).length>t&&eb.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(t);return r.set(e,t-e.length),rb(r)}function ub(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}I(tb,"isHexable"),I(rb,"addSlice"),I(nb,"isBytesLike"),I(ib,"isInteger"),I(ob,"isBytes"),I(sb,"arrayify"),I(ab,"concat"),I(cb,"zeroPad"),I(ub,"isHexString");function lb(e,t){if(t||(t={}),"number"==typeof e){eb.checkSafeUint53(e,"invalid hexlify value");let t="";for(;e;)t="0123456789abcdef"[15&e]+t,e=Math.floor(e/16);return t.length?(t.length%2&&(t="0"+t),"0x"+t):"0x00"}if("bigint"==typeof e)return(e=e.toString(16)).length%2?"0x0"+e:"0x"+e;if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),tb(e))return e.toHexString();if(ub(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":eb.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(ob(e)){let t="0x";for(let r=0;r<e.length;r++){let n=e[r];t+="0123456789abcdef"[(240&n)>>4]+"0123456789abcdef"[15&n]}return t}return eb.throwArgumentError("invalid hexlify value","value",e)}function db(e){if("string"!=typeof e)e=lb(e);else if(!ub(e)||e.length%2)return null;return(e.length-2)/2}function fb(e,t,r){return"string"!=typeof e?e=lb(e):(!ub(e)||e.length%2)&&eb.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=r?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)}function hb(e,t){for("string"!=typeof e?e=lb(e):ub(e)||eb.throwArgumentError("invalid hex string","value",e),e.length>2*t+2&&eb.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function pb(e){const t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(nb(e)){let r=sb(e);64===r.length?(t.v=27+(r[32]>>7),r[32]&=127,t.r=lb(r.slice(0,32)),t.s=lb(r.slice(32,64))):65===r.length?(t.r=lb(r.slice(0,32)),t.s=lb(r.slice(32,64)),t.v=r[64]):eb.throwArgumentError("invalid signature string","signature",e),t.v<27&&(0===t.v||1===t.v?t.v+=27:eb.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(r[32]|=128),t._vs=lb(r.slice(32,64))}else{if(t.r=e.r,t.s=e.s,t.v=e.v,t.recoveryParam=e.recoveryParam,t._vs=e._vs,null!=t._vs){const r=cb(sb(t._vs),32);t._vs=lb(r);const n=r[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=n:t.recoveryParam!==n&&eb.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),r[0]&=127;const i=lb(r);null==t.s?t.s=i:t.s!==i&&eb.throwArgumentError("signature v mismatch _vs","signature",e)}if(null==t.recoveryParam)null==t.v?eb.throwArgumentError("signature missing v and recoveryParam","signature",e):0===t.v||1===t.v?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(null==t.v)t.v=27+t.recoveryParam;else{const r=0===t.v||1===t.v?t.v:1-t.v%2;t.recoveryParam!==r&&eb.throwArgumentError("signature recoveryParam mismatch v","signature",e)}null!=t.r&&ub(t.r)?t.r=hb(t.r,32):eb.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&ub(t.s)?t.s=hb(t.s,32):eb.throwArgumentError("signature missing or invalid s","signature",e);const r=sb(t.s);r[0]>=128&&eb.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(r[0]|=128);const n=lb(r);t._vs&&(ub(t._vs)||eb.throwArgumentError("signature invalid _vs","signature",e),t._vs=hb(t._vs,32)),null==t._vs?t._vs=n:t._vs!==n&&eb.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}I(lb,"hexlify"),I(db,"hexDataLength"),I(fb,"hexDataSlice"),I(hb,"hexZeroPad"),I(pb,"splitSignature");var mb=R(Ir()).default.BN;function gb(e){return new mb(e,36).toString(16)}new Zg("bignumber/5.6.0"),I(gb,"_base36To16");var bb=R(Tr());function yb(e){return"0x"+bb.default.keccak_256(sb(e))}I(yb,"keccak256");var vb=new Zg("address/5.6.0");function wb(e){ub(e,20)||vb.throwArgumentError("invalid address","address",e);const t=(e=e.toLowerCase()).substring(2).split(""),r=new Uint8Array(40);for(let e=0;e<40;e++)r[e]=t[e].charCodeAt(0);const n=sb(yb(r));for(let e=0;e<40;e+=2)n[e>>1]>>4>=8&&(t[e]=t[e].toUpperCase()),(15&n[e>>1])>=8&&(t[e+1]=t[e+1].toUpperCase());return"0x"+t.join("")}I(wb,"getChecksumAddress");function Ab(e){return Math.log10?Math.log10(e):Math.log(e)/Math.LN10}I(Ab,"log10");var Eb={};for(let e=0;e<10;e++)Eb[String(e)]=String(e);for(let e=0;e<26;e++)Eb[String.fromCharCode(65+e)]=String(10+e);var Sb=Math.floor(Ab(9007199254740991));function xb(e){let t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((e=>Eb[e])).join("");for(;t.length>=Sb;){let e=t.substring(0,Sb);t=parseInt(e,10)%97+t.substring(e.length)}let r=String(98-parseInt(t,10)%97);for(;r.length<2;)r="0"+r;return r}function Mb(e){let t=null;if("string"!=typeof e&&vb.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=wb(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&vb.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==xb(e)&&vb.throwArgumentError("bad icap checksum","address",e),t=gb(e.substring(4));t.length<40;)t="0"+t;t=wb("0x"+t)}else vb.throwArgumentError("invalid address","address",e);return t}I(xb,"ibanChecksum"),I(Mb,"getAddress");function _b(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}new Zg("properties/5.6.0"),I(_b,"defineReadOnly");var kb,Tb,Cb,Nb,Ib=new Zg("strings/5.6.0");function Bb(e,t,r,n,i){return Ib.throwArgumentError(`invalid codepoint at offset ${t}; ${e}`,"bytes",r)}function Ob(e,t,r,n,i){if(e===Cb.BAD_PREFIX||e===Cb.UNEXPECTED_CONTINUE){let e=0;for(let n=t+1;n<r.length&&r[n]>>6==2;n++)e++;return e}return e===Cb.OVERRUN?r.length-t-1:0}function Db(e,t,r,n,i){return e===Cb.OVERLONG?(n.push(i),0):(n.push(65533),Ob(e,t,r))}function jb(e,t=kb.current){t!=kb.current&&(Ib.checkNormalize(),e=e.normalize(t));let r=[];for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(n<128)r.push(n);else if(n<2048)r.push(n>>6|192),r.push(63&n|128);else if(55296==(64512&n)){t++;const i=e.charCodeAt(t);if(t>=e.length||56320!=(64512&i))throw new Error("invalid utf-8 string");const o=65536+((1023&n)<<10)+(1023&i);r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(63&o|128)}else r.push(n>>12|224),r.push(n>>6&63|128),r.push(63&n|128)}return sb(r)}(Tb=kb||(kb={})).current="",Tb.NFC="NFC",Tb.NFD="NFD",Tb.NFKC="NFKC",Tb.NFKD="NFKD",(Nb=Cb||(Cb={})).UNEXPECTED_CONTINUE="unexpected continuation byte",Nb.BAD_PREFIX="bad codepoint prefix",Nb.OVERRUN="string overrun",Nb.MISSING_CONTINUE="missing continuation byte",Nb.OUT_OF_RANGE="out of UTF-8 range",Nb.UTF16_SURROGATE="UTF-16 surrogate",Nb.OVERLONG="overlong representation",I(Bb,"errorFunc"),I(Ob,"ignoreFunc"),I(Db,"replaceFunc"),Object.freeze({error:Bb,ignore:Ob,replace:Db}),I(jb,"toUtf8Bytes");function Lb(e){return"string"==typeof e&&(e=jb(e)),yb(ab([jb("Ethereum Signed Message:\n"),jb(String(e.length)),e]))}I(Lb,"hashMessage");var Pb=R(Ir()),Rb=R(Zr());function Ub(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return zb(null==t&&r.path)}},r.exports),r.exports}function zb(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}I(Ub,"createCommonjsModule"),I(zb,"commonjsRequire");var Kb=Fb;function Fb(e,t){if(!e)throw new Error(t||"Assertion failed")}I(Fb,"assert"),Fb.equal=I((function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}),"assertEqual");var Hb=Ub((function(e,t){var r=t;function n(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n<e.length;n++)r[n]=0|e[n];return r}if("hex"===t){(e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e);for(n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16))}else for(n=0;n<e.length;n++){var i=e.charCodeAt(n),o=i>>8,s=255&i;o?r.push(o,s):r.push(s)}return r}function i(e){return 1===e.length?"0"+e:e}function o(e){for(var t="",r=0;r<e.length;r++)t+=i(e[r].toString(16));return t}I(n,"toArray"),r.toArray=n,I(i,"zero2"),r.zero2=i,I(o,"toHex"),r.toHex=o,r.encode=I((function(e,t){return"hex"===t?o(e):e}),"encode")})),$b=Ub((function(e,t){var r=t;function n(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var i=1<<t+1,o=e.clone(),s=0;s<n.length;s++){var a,c=o.andln(i-1);o.isOdd()?(a=c>(i>>1)-1?(i>>1)-c:c,o.isubn(a)):a=0,n[s]=a,o.iushrn(1)}return n}function i(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var s,a,c=e.andln(3)+i&3,u=t.andln(3)+o&3;3===c&&(c=-1),3===u&&(u=-1),s=0==(1&c)?0:3!==(n=e.andln(7)+i&7)&&5!==n||2!==u?c:-c,r[0].push(s),a=0==(1&u)?0:3!==(n=t.andln(7)+o&7)&&5!==n||2!==c?u:-u,r[1].push(a),2*i===s+1&&(i=1-i),2*o===a+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r}function o(e,t,r){var n="_"+t;e.prototype[t]=I((function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}),"cachedProperty")}function s(e){return"string"==typeof e?r.toArray(e,"hex"):e}function a(e){return new Pb.default(e,"hex","le")}r.assert=Kb,r.toArray=Hb.toArray,r.zero2=Hb.zero2,r.toHex=Hb.toHex,r.encode=Hb.encode,I(n,"getNAF"),r.getNAF=n,I(i,"getJSF"),r.getJSF=i,I(o,"cachedProperty"),r.cachedProperty=o,I(s,"parseBytes"),r.parseBytes=s,I(a,"intFromLE"),r.intFromLE=a})),Vb=$b.getNAF,qb=$b.getJSF,Gb=$b.assert;function Yb(e,t){this.type=e,this.p=new Pb.default(t.p,16),this.red=t.prime?Pb.default.red(t.prime):Pb.default.mont(this.p),this.zero=new Pb.default(0).toRed(this.red),this.one=new Pb.default(1).toRed(this.red),this.two=new Pb.default(2).toRed(this.red),this.n=t.n&&new Pb.default(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}I(Yb,"BaseCurve");var Jb=Yb;function Qb(e,t){this.curve=e,this.type=t,this.precomputed=null}Yb.prototype.point=I((function(){throw new Error("Not implemented")}),"point"),Yb.prototype.validate=I((function(){throw new Error("Not implemented")}),"validate"),Yb.prototype._fixedNafMul=I((function(e,t){Gb(e.precomputed);var r=e._getDoubles(),n=Vb(t,1,this._bitLength),i=(1<<r.step+1)-(r.step%2==0?2:1);i/=3;var o,s,a=[];for(o=0;o<n.length;o+=r.step){s=0;for(var c=o+r.step-1;c>=o;c--)s=(s<<1)+n[c];a.push(s)}for(var u=this.jpoint(null,null,null),l=this.jpoint(null,null,null),d=i;d>0;d--){for(o=0;o<a.length;o++)(s=a[o])===d?l=l.mixedAdd(r.points[o]):s===-d&&(l=l.mixedAdd(r.points[o].neg()));u=u.add(l)}return u.toP()}),"_fixedNafMul"),Yb.prototype._wnafMul=I((function(e,t){var r=4,n=e._getNAFPoints(r);r=n.wnd;for(var i=n.points,o=Vb(t,r,this._bitLength),s=this.jpoint(null,null,null),a=o.length-1;a>=0;a--){for(var c=0;a>=0&&0===o[a];a--)c++;if(a>=0&&c++,s=s.dblp(c),a<0)break;var u=o[a];Gb(0!==u),s="affine"===e.type?u>0?s.mixedAdd(i[u-1>>1]):s.mixedAdd(i[-u-1>>1].neg()):u>0?s.add(i[u-1>>1]):s.add(i[-u-1>>1].neg())}return"affine"===e.type?s.toP():s}),"_wnafMul"),Yb.prototype._wnafMulAdd=I((function(e,t,r,n,i){var o,s,a,c=this._wnafT1,u=this._wnafT2,l=this._wnafT3,d=0;for(o=0;o<n;o++){var f=(a=t[o])._getNAFPoints(e);c[o]=f.wnd,u[o]=f.points}for(o=n-1;o>=1;o-=2){var h=o-1,p=o;if(1===c[h]&&1===c[p]){var m=[t[h],null,null,t[p]];0===t[h].y.cmp(t[p].y)?(m[1]=t[h].add(t[p]),m[2]=t[h].toJ().mixedAdd(t[p].neg())):0===t[h].y.cmp(t[p].y.redNeg())?(m[1]=t[h].toJ().mixedAdd(t[p]),m[2]=t[h].add(t[p].neg())):(m[1]=t[h].toJ().mixedAdd(t[p]),m[2]=t[h].toJ().mixedAdd(t[p].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],b=qb(r[h],r[p]);for(d=Math.max(b[0].length,d),l[h]=new Array(d),l[p]=new Array(d),s=0;s<d;s++){var y=0|b[0][s],v=0|b[1][s];l[h][s]=g[3*(y+1)+(v+1)],l[p][s]=0,u[h]=m}}else l[h]=Vb(r[h],c[h],this._bitLength),l[p]=Vb(r[p],c[p],this._bitLength),d=Math.max(l[h].length,d),d=Math.max(l[p].length,d)}var w=this.jpoint(null,null,null),A=this._wnafT4;for(o=d;o>=0;o--){for(var E=0;o>=0;){var S=!0;for(s=0;s<n;s++)A[s]=0|l[s][o],0!==A[s]&&(S=!1);if(!S)break;E++,o--}if(o>=0&&E++,w=w.dblp(E),o<0)break;for(s=0;s<n;s++){var x=A[s];0!==x&&(x>0?a=u[s][x-1>>1]:x<0&&(a=u[s][-x-1>>1].neg()),w="affine"===a.type?w.mixedAdd(a):w.add(a))}}for(o=0;o<n;o++)u[o]=null;return i?w:w.toP()}),"_wnafMulAdd"),I(Qb,"BasePoint"),Yb.BasePoint=Qb,Qb.prototype.eq=I((function(){throw new Error("Not implemented")}),"eq"),Qb.prototype.validate=I((function(){return this.curve.validate(this)}),"validate"),Yb.prototype.decodePoint=I((function(e,t){e=$b.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?Gb(e[e.length-1]%2==0):7===e[0]&&Gb(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")}),"decodePoint"),Qb.prototype.encodeCompressed=I((function(e){return this.encode(e,!0)}),"encodeCompressed"),Qb.prototype._encode=I((function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))}),"_encode"),Qb.prototype.encode=I((function(e,t){return $b.encode(this._encode(t),e)}),"encode"),Qb.prototype.precompute=I((function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this}),"precompute"),Qb.prototype._hasDoubles=I((function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)}),"_hasDoubles"),Qb.prototype._getDoubles=I((function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<t;i+=e){for(var o=0;o<e;o++)n=n.dbl();r.push(n)}return{step:e,points:r}}),"_getDoubles"),Qb.prototype._getNAFPoints=I((function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)t[i]=t[i-1].add(n);return{wnd:e,points:t}}),"_getNAFPoints"),Qb.prototype._getBeta=I((function(){return null}),"_getBeta"),Qb.prototype.dblp=I((function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t}),"dblp");var Wb=Ub((function(e){"function"==typeof Object.create?e.exports=I((function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}),"inherits"):e.exports=I((function(e,t){if(t){e.super_=t;var r=I((function(){}),"TempCtor");r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}),"inherits")})),Xb=$b.assert;function Zb(e){Jb.call(this,"short",e),this.a=new Pb.default(e.a,16).toRed(this.red),this.b=new Pb.default(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}I(Zb,"ShortCurve"),Wb(Zb,Jb);var ey=Zb;function ty(e,t,r,n){Jb.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new Pb.default(t,16),this.y=new Pb.default(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function ry(e,t,r,n){Jb.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new Pb.default(0)):(this.x=new Pb.default(t,16),this.y=new Pb.default(r,16),this.z=new Pb.default(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}Zb.prototype._getEndomorphism=I((function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new Pb.default(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new Pb.default(e.lambda,16);else{var i=this._getEndoRoots(this.n);0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(t))?r=i[0]:(r=i[1],Xb(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new Pb.default(e.a,16),b:new Pb.default(e.b,16)}})):this._getEndoBasis(r)}}}),"_getEndomorphism"),Zb.prototype._getEndoRoots=I((function(e){var t=e===this.p?this.red:Pb.default.mont(e),r=new Pb.default(2).toRed(t).redInvm(),n=r.redNeg(),i=new Pb.default(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(i).fromRed(),n.redSub(i).fromRed()]}),"_getEndoRoots"),Zb.prototype._getEndoBasis=I((function(e){for(var t,r,n,i,o,s,a,c,u,l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=e,f=this.n.clone(),h=new Pb.default(1),p=new Pb.default(0),m=new Pb.default(0),g=new Pb.default(1),b=0;0!==d.cmpn(0);){var y=f.div(d);c=f.sub(y.mul(d)),u=m.sub(y.mul(h));var v=g.sub(y.mul(p));if(!n&&c.cmp(l)<0)t=a.neg(),r=h,n=c.neg(),i=u;else if(n&&2==++b)break;a=c,f=d,d=c,m=h,h=u,g=p,p=v}o=c.neg(),s=u;var w=n.sqr().add(i.sqr());return o.sqr().add(s.sqr()).cmp(w)>=0&&(o=t,s=r),n.negative&&(n=n.neg(),i=i.neg()),o.negative&&(o=o.neg(),s=s.neg()),[{a:n,b:i},{a:o,b:s}]}),"_getEndoBasis"),Zb.prototype._endoSplit=I((function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),s=i.mul(r.a),a=o.mul(n.a),c=i.mul(r.b),u=o.mul(n.b);return{k1:e.sub(s).sub(a),k2:c.add(u).neg()}}),"_endoSplit"),Zb.prototype.pointFromX=I((function(e,t){(e=new Pb.default(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(t&&!i||!t&&i)&&(n=n.redNeg()),this.point(e,n)}),"pointFromX"),Zb.prototype.validate=I((function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)}),"validate"),Zb.prototype._endoWnafMulAdd=I((function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<e.length;o++){var s=this._endoSplit(t[o]),a=e[o],c=a._getBeta();s.k1.negative&&(s.k1.ineg(),a=a.neg(!0)),s.k2.negative&&(s.k2.ineg(),c=c.neg(!0)),n[2*o]=a,n[2*o+1]=c,i[2*o]=s.k1,i[2*o+1]=s.k2}for(var u=this._wnafMulAdd(1,n,i,2*o,r),l=0;l<2*o;l++)n[l]=null,i[l]=null;return u}),"_endoWnafMulAdd"),I(ty,"Point"),Wb(ty,Jb.BasePoint),Zb.prototype.point=I((function(e,t,r){return new ty(this,e,t,r)}),"point"),Zb.prototype.pointFromJSON=I((function(e,t){return ty.fromJSON(this,e,t)}),"pointFromJSON"),ty.prototype._getBeta=I((function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,n=I((function(e){return r.point(e.x.redMul(r.endo.beta),e.y)}),"endoMul");e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}}),"_getBeta"),ty.prototype.toJSON=I((function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]}),"toJSON"),ty.fromJSON=I((function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function i(t){return e.point(t[0],t[1],r)}I(i,"obj2point");var o=t[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n}),"fromJSON"),ty.prototype.inspect=I((function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"}),"inspect"),ty.prototype.isInfinity=I((function(){return this.inf}),"isInfinity"),ty.prototype.add=I((function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)}),"add"),ty.prototype.dbl=I((function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),s=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)}),"dbl"),ty.prototype.getX=I((function(){return this.x.fromRed()}),"getX"),ty.prototype.getY=I((function(){return this.y.fromRed()}),"getY"),ty.prototype.mul=I((function(e){return e=new Pb.default(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)}),"mul"),ty.prototype.mulAdd=I((function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)}),"mulAdd"),ty.prototype.jmulAdd=I((function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)}),"jmulAdd"),ty.prototype.eq=I((function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))}),"eq"),ty.prototype.neg=I((function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=I((function(e){return e.neg()}),"negate");t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t}),"neg"),ty.prototype.toJ=I((function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)}),"toJ"),I(ry,"JPoint"),Wb(ry,Jb.BasePoint),Zb.prototype.jpoint=I((function(e,t,r){return new ry(this,e,t,r)}),"jpoint"),ry.prototype.toP=I((function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)}),"toP"),ry.prototype.neg=I((function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)}),"neg"),ry.prototype.add=I((function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),s=e.y.redMul(r.redMul(this.z)),a=n.redSub(i),c=o.redSub(s);if(0===a.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),l=u.redMul(a),d=n.redMul(u),f=c.redSqr().redIAdd(l).redISub(d).redISub(d),h=c.redMul(d.redISub(f)).redISub(o.redMul(l)),p=this.z.redMul(e.z).redMul(a);return this.curve.jpoint(f,h,p)}),"add"),ry.prototype.mixedAdd=I((function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),s=r.redSub(n),a=i.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),u=c.redMul(s),l=r.redMul(c),d=a.redSqr().redIAdd(u).redISub(l).redISub(l),f=a.redMul(l.redISub(d)).redISub(i.redMul(u)),h=this.z.redMul(s);return this.curve.jpoint(d,f,h)}),"mixedAdd"),ry.prototype.dblp=I((function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,o=this.x,s=this.y,a=this.z,c=a.redSqr().redSqr(),u=s.redAdd(s);for(t=0;t<e;t++){var l=o.redSqr(),d=u.redSqr(),f=d.redSqr(),h=l.redAdd(l).redIAdd(l).redIAdd(n.redMul(c)),p=o.redMul(d),m=h.redSqr().redISub(p.redAdd(p)),g=p.redISub(m),b=h.redMul(g);b=b.redIAdd(b).redISub(f);var y=u.redMul(a);t+1<e&&(c=c.redMul(f)),o=m,a=y,u=b}return this.curve.jpoint(o,u.redMul(i),a)}),"dblp"),ry.prototype.dbl=I((function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()}),"dbl"),ry.prototype._zeroDbl=I((function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n),c=a.redSqr().redISub(s).redISub(s),u=o.redIAdd(o);u=(u=u.redIAdd(u)).redIAdd(u),e=c,t=a.redMul(s.redISub(c)).redISub(u),r=this.y.redAdd(this.y)}else{var l=this.x.redSqr(),d=this.y.redSqr(),f=d.redSqr(),h=this.x.redAdd(d).redSqr().redISub(l).redISub(f);h=h.redIAdd(h);var p=l.redAdd(l).redIAdd(l),m=p.redSqr(),g=f.redIAdd(f);g=(g=g.redIAdd(g)).redIAdd(g),e=m.redISub(h).redISub(h),t=p.redMul(h.redISub(e)).redISub(g),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)}),"_zeroDbl"),ry.prototype._threeDbl=I((function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),c=a.redSqr().redISub(s).redISub(s);e=c;var u=o.redIAdd(o);u=(u=u.redIAdd(u)).redIAdd(u),t=a.redMul(s.redISub(c)).redISub(u),r=this.y.redAdd(this.y)}else{var l=this.z.redSqr(),d=this.y.redSqr(),f=this.x.redMul(d),h=this.x.redSub(l).redMul(this.x.redAdd(l));h=h.redAdd(h).redIAdd(h);var p=f.redIAdd(f),m=(p=p.redIAdd(p)).redAdd(p);e=h.redSqr().redISub(m),r=this.y.redAdd(this.z).redSqr().redISub(d).redISub(l);var g=d.redSqr();g=(g=(g=g.redIAdd(g)).redIAdd(g)).redIAdd(g),t=h.redMul(p.redISub(e)).redISub(g)}return this.curve.jpoint(e,t,r)}),"_threeDbl"),ry.prototype._dbl=I((function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=t.redSqr(),s=r.redSqr(),a=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(i)),c=t.redAdd(t),u=(c=c.redIAdd(c)).redMul(s),l=a.redSqr().redISub(u.redAdd(u)),d=u.redISub(l),f=s.redSqr();f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var h=a.redMul(d).redISub(f),p=r.redAdd(r).redMul(n);return this.curve.jpoint(l,h,p)}),"_dbl"),ry.prototype.trpl=I((function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),i=e.redAdd(e).redIAdd(e),o=i.redSqr(),s=this.x.redAdd(t).redSqr().redISub(e).redISub(n),a=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(o)).redSqr(),c=n.redIAdd(n);c=(c=(c=c.redIAdd(c)).redIAdd(c)).redIAdd(c);var u=i.redIAdd(s).redSqr().redISub(o).redISub(a).redISub(c),l=t.redMul(u);l=(l=l.redIAdd(l)).redIAdd(l);var d=this.x.redMul(a).redISub(l);d=(d=d.redIAdd(d)).redIAdd(d);var f=this.y.redMul(u.redMul(c.redISub(u)).redISub(s.redMul(a)));f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var h=this.z.redAdd(s).redSqr().redISub(r).redISub(a);return this.curve.jpoint(d,f,h)}),"trpl"),ry.prototype.mul=I((function(e,t){return e=new Pb.default(e,t),this.curve._wnafMul(this,e)}),"mul"),ry.prototype.eq=I((function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),i=r.redMul(e.z);return 0===this.y.redMul(i).redISub(e.y.redMul(n)).cmpn(0)}),"eq"),ry.prototype.eqXToP=I((function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),i=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}}),"eqXToP"),ry.prototype.inspect=I((function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"}),"inspect"),ry.prototype.isInfinity=I((function(){return 0===this.z.cmpn(0)}),"isInfinity");var ny=Ub((function(e,t){var r=t;r.base=Jb,r.short=ey,r.mont=null,r.edwards=null})),iy=Ub((function(e,t){var r,n=t,i=$b.assert;function o(e){"short"===e.type?this.curve=new ny.short(e):"edwards"===e.type?this.curve=new ny.edwards(e):this.curve=new ny.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function s(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var r=new o(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:r}),r}})}I(o,"PresetCurve"),n.PresetCurve=o,I(s,"defineCurve"),s("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:Rb.default.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:Rb.default.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:Rb.default.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:Rb.default.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),s("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:Rb.default.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Rb.default.sha256,gRed:!1,g:["9"]}),s("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Rb.default.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch(e){r=void 0}s("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:Rb.default.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})}));function oy(e){if(!(this instanceof oy))return new oy(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=Hb.toArray(e.entropy,e.entropyEnc||"hex"),r=Hb.toArray(e.nonce,e.nonceEnc||"hex"),n=Hb.toArray(e.pers,e.persEnc||"hex");Kb(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}I(oy,"HmacDRBG");var sy=oy;oy.prototype._init=I((function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656}),"init"),oy.prototype._hmac=I((function(){return new Rb.default.hmac(this.hash,this.K)}),"hmac"),oy.prototype._update=I((function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())}),"update"),oy.prototype.reseed=I((function(e,t,r,n){"string"!=typeof t&&(n=r,r=t,t=null),e=Hb.toArray(e,t),r=Hb.toArray(r,n),Kb(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1}),"reseed"),oy.prototype.generate=I((function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=Hb.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length<e;)this.V=this._hmac().update(this.V).digest(),i=i.concat(this.V);var o=i.slice(0,e);return this._update(r),this._reseed++,Hb.encode(o,t)}),"generate");var ay=$b.assert;function cy(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}I(cy,"KeyPair");var uy=cy;cy.fromPublic=I((function(e,t,r){return t instanceof cy?t:new cy(e,{pub:t,pubEnc:r})}),"fromPublic"),cy.fromPrivate=I((function(e,t,r){return t instanceof cy?t:new cy(e,{priv:t,privEnc:r})}),"fromPrivate"),cy.prototype.validate=I((function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}}),"validate"),cy.prototype.getPublic=I((function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub}),"getPublic"),cy.prototype.getPrivate=I((function(e){return"hex"===e?this.priv.toString(16,2):this.priv}),"getPrivate"),cy.prototype._importPrivate=I((function(e,t){this.priv=new Pb.default(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)}),"_importPrivate"),cy.prototype._importPublic=I((function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?ay(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||ay(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)}),"_importPublic"),cy.prototype.derive=I((function(e){return e.validate()||ay(e.validate(),"public point not validated"),e.mul(this.priv).getX()}),"derive"),cy.prototype.sign=I((function(e,t,r){return this.ec.sign(e,this,t,r)}),"sign"),cy.prototype.verify=I((function(e,t){return this.ec.verify(e,t,this)}),"verify"),cy.prototype.inspect=I((function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}),"inspect");var ly=$b.assert;function dy(e,t){if(e instanceof dy)return e;this._importDER(e,t)||(ly(e.r&&e.s,"Signature without r or s"),this.r=new Pb.default(e.r,16),this.s=new Pb.default(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}I(dy,"Signature");var fy=dy;function hy(){this.place=0}function py(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,s=t.place;o<n;o++,s++)i<<=8,i|=e[s],i>>>=0;return!(i<=127)&&(t.place=s,i)}function my(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function gy(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}I(hy,"Position"),I(py,"getLength"),I(my,"rmPadding"),dy.prototype._importDER=I((function(e,t){e=$b.toArray(e,t);var r=new hy;if(48!==e[r.place++])return!1;var n=py(e,r);if(!1===n)return!1;if(n+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=py(e,r);if(!1===i)return!1;var o=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var s=py(e,r);if(!1===s)return!1;if(e.length!==s+r.place)return!1;var a=e.slice(r.place,s+r.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===a[0]){if(!(128&a[1]))return!1;a=a.slice(1)}return this.r=new Pb.default(o),this.s=new Pb.default(a),this.recoveryParam=null,!0}),"_importDER"),I(gy,"constructLength"),dy.prototype.toDER=I((function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=my(t),r=my(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];gy(n,t.length),(n=n.concat(t)).push(2),gy(n,r.length);var i=n.concat(r),o=[48];return gy(o,i.length),o=o.concat(i),$b.encode(o,e)}),"toDER");var by=I((function(){throw new Error("unsupported")}),"rand"),yy=$b.assert;function vy(e){if(!(this instanceof vy))return new vy(e);"string"==typeof e&&(yy(Object.prototype.hasOwnProperty.call(iy,e),"Unknown curve "+e),e=iy[e]),e instanceof iy.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}I(vy,"EC");var wy=vy;vy.prototype.keyPair=I((function(e){return new uy(this,e)}),"keyPair"),vy.prototype.keyFromPrivate=I((function(e,t){return uy.fromPrivate(this,e,t)}),"keyFromPrivate"),vy.prototype.keyFromPublic=I((function(e,t){return uy.fromPublic(this,e,t)}),"keyFromPublic"),vy.prototype.genKeyPair=I((function(e){e||(e={});for(var t=new sy({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||by(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new Pb.default(2));;){var i=new Pb.default(t.generate(r));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}}),"genKeyPair"),vy.prototype._truncateToN=I((function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e}),"_truncateToN"),vy.prototype.sign=I((function(e,t,r,n){"object"==typeof r&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new Pb.default(e,16));for(var i=this.n.byteLength(),o=t.getPrivate().toArray("be",i),s=e.toArray("be",i),a=new sy({hash:this.hash,entropy:o,nonce:s,pers:n.pers,persEnc:n.persEnc||"utf8"}),c=this.n.sub(new Pb.default(1)),u=0;;u++){var l=n.k?n.k(u):new Pb.default(a.generate(this.n.byteLength()));if(!((l=this._truncateToN(l,!0)).cmpn(1)<=0||l.cmp(c)>=0)){var d=this.g.mul(l);if(!d.isInfinity()){var f=d.getX(),h=f.umod(this.n);if(0!==h.cmpn(0)){var p=l.invm(this.n).mul(h.mul(t.getPrivate()).iadd(e));if(0!==(p=p.umod(this.n)).cmpn(0)){var m=(d.getY().isOdd()?1:0)|(0!==f.cmp(h)?2:0);return n.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),m^=1),new fy({r:h,s:p,recoveryParam:m})}}}}}}),"sign"),vy.prototype.verify=I((function(e,t,r,n){e=this._truncateToN(new Pb.default(e,16)),r=this.keyFromPublic(r,n);var i=(t=new fy(t,"hex")).r,o=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var s,a=o.invm(this.n),c=a.mul(e).umod(this.n),u=a.mul(i).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(c,r.getPublic(),u)).isInfinity()&&s.eqXToP(i):!(s=this.g.mulAdd(c,r.getPublic(),u)).isInfinity()&&0===s.getX().umod(this.n).cmp(i)}),"verify"),vy.prototype.recoverPubKey=function(e,t,r,n){yy((3&r)===r,"The recovery param is more than two bits"),t=new fy(t,n);var i=this.n,o=new Pb.default(e),s=t.r,a=t.s,c=1&r,u=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw new Error("Unable to find sencond key candinate");s=u?this.curve.pointFromX(s.add(this.curve.n),c):this.curve.pointFromX(s,c);var l=t.r.invm(i),d=i.sub(o).mul(l).umod(i),f=a.mul(l).umod(i);return this.g.mulAdd(d,s,f)},vy.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new fy(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var Ay=Ub((function(e,t){var r=t;r.version="6.5.4",r.utils=$b,r.rand=function(){throw new Error("unsupported")},r.curve=ny,r.curves=iy,r.ec=wy,r.eddsa=null})).ec,Ey=new Zg("signing-key/5.6.1"),Sy=null;function xy(){return Sy||(Sy=new Ay("secp256k1")),Sy}I(xy,"getCurve");var My=class{constructor(e){_b(this,"curve","secp256k1"),_b(this,"privateKey",lb(e)),32!==db(this.privateKey)&&Ey.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const t=xy().keyFromPrivate(sb(this.privateKey));_b(this,"publicKey","0x"+t.getPublic(!1,"hex")),_b(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),_b(this,"_isSigningKey",!0)}_addPoint(e){const t=xy().keyFromPublic(sb(this.publicKey)),r=xy().keyFromPublic(sb(e));return"0x"+t.pub.add(r.pub).encodeCompressed("hex")}signDigest(e){const t=xy().keyFromPrivate(sb(this.privateKey)),r=sb(e);32!==r.length&&Ey.throwArgumentError("bad digest length","digest",e);const n=t.sign(r,{canonical:!0});return pb({recoveryParam:n.recoveryParam,r:hb("0x"+n.r.toString(16),32),s:hb("0x"+n.s.toString(16),32)})}computeSharedSecret(e){const t=xy().keyFromPrivate(sb(this.privateKey)),r=xy().keyFromPublic(sb(ky(e)));return hb("0x"+t.derive(r.getPublic()).toString(16),32)}static isSigningKey(e){return!(!e||!e._isSigningKey)}};function _y(e,t){const r=pb(t),n={r:sb(r.r),s:sb(r.s)};return"0x"+xy().recoverPubKey(sb(e),n,r.recoveryParam).encode("hex",!1)}function ky(e,t){const r=sb(e);if(32===r.length){const e=new My(r);return t?"0x"+xy().keyFromPrivate(r).getPublic(!0,"hex"):e.publicKey}return 33===r.length?t?lb(r):"0x"+xy().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?t?"0x"+xy().keyFromPublic(r).getPublic(!0,"hex"):lb(r):Ey.throwArgumentError("invalid public or private key","key","[REDACTED]")}I(My,"SigningKey"),I(_y,"recoverPublicKey"),I(ky,"computePublicKey");var Ty,Cy;function Ny(e){return Mb(fb(yb(fb(ky(e),1)),12))}function Iy(e,t){return Ny(_y(sb(e),t))}new Zg("transactions/5.6.0"),(Cy=Ty||(Ty={}))[Cy.legacy=0]="legacy",Cy[Cy.eip2930=1]="eip2930",Cy[Cy.eip1559=2]="eip1559",I(Ny,"computeAddress"),I(Iy,"recoverAddress");function By(e,t){return Iy(Lb(e),t)}new Zg("wallet/5.6.0"),I(By,"verifyMessage"),Kt();var Oy,Dy,jy,Ly=class{constructor(e){this.domain=void 0,this.address=void 0,this.statement=void 0,this.uri=void 0,this.version=void 0,this.nonce=void 0,this.issuedAt=void 0,this.expirationTime=void 0,this.notBefore=void 0,this.requestId=void 0,this.chainId=void 0,this.resources=void 0;const t=new Cg.default('\nsign-in-with-ethereum =\n domain %s" wants you to sign in with your Ethereum account:" LF\n address LF\n LF\n [ statement LF ]\n LF\n %s"URI: " URI LF\n %s"Version: " version LF\n %s"Nonce: " nonce LF\n %s"Issued At: " issued-at\n [ LF %s"Expiration Time: " expiration-time ]\n [ LF %s"Not Before: " not-before ]\n [ LF %s"Request ID: " request-id ]\n [ LF %s"Chain ID: " chain-id ]\n [ LF %s"Resources:"\n resources ]\n\ndomain = dnsauthority\n\naddress = "0x" 40*40HEXDIG\n ; Must also conform to captilization\n ; checksum encoding specified in EIP-55\n ; where applicable (EOAs).\n\nstatement = *( reserved / unreserved / " " )\n ; The purpose is to exclude LF (line breaks).\n\nversion = "1"\n\nnonce = 8*( ALPHA / DIGIT )\n\nissued-at = date-time\nexpiration-time = date-time\nnot-before = date-time\n\nrequest-id = *pchar\n\nchain-id = 1*DIGIT\n ; See EIP-155 for valid CHAIN_IDs.\n\nresources = *( LF resource )\n\nresource = "- " URI\n\n; ------------------------------------------------------------------------------\n; RFC 3986\n\nURI = scheme ":" hier-part [ "?" query ] [ "#" fragment ]\n\nhier-part = "//" authority path-abempty\n / path-absolute\n / path-rootless\n / path-empty\n\nscheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )\n\nauthority = [ userinfo "@" ] host [ ":" port ]\nuserinfo = *( unreserved / pct-encoded / sub-delims / ":" )\nhost = IP-literal / IPv4address / reg-name\nport = *DIGIT\n\nIP-literal = "[" ( IPv6address / IPvFuture ) "]"\n\nIPvFuture = "v" 1*HEXDIG "." 1*( unreserved / sub-delims / ":" )\n\nIPv6address = 6( h16 ":" ) ls32\n / "::" 5( h16 ":" ) ls32\n / [ h16 ] "::" 4( h16 ":" ) ls32\n / [ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32\n / [ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32\n / [ *3( h16 ":" ) h16 ] "::" h16 ":" ls32\n / [ *4( h16 ":" ) h16 ] "::" ls32\n / [ *5( h16 ":" ) h16 ] "::" h16\n / [ *6( h16 ":" ) h16 ] "::"\n\nh16 = 1*4HEXDIG\nls32 = ( h16 ":" h16 ) / IPv4address\nIPv4address = dec-octet "." dec-octet "." dec-octet "." dec-octet\ndec-octet = DIGIT ; 0-9\n / %x31-39 DIGIT ; 10-99\n / "1" 2DIGIT ; 100-199\n / "2" %x30-34 DIGIT ; 200-249\n / "25" %x30-35 ; 250-255\n\nreg-name = *( unreserved / pct-encoded / sub-delims )\n\npath-abempty = *( "/" segment )\npath-absolute = "/" [ segment-nz *( "/" segment ) ]\npath-rootless = segment-nz *( "/" segment )\npath-empty = 0pchar\n\nsegment = *pchar\nsegment-nz = 1*pchar\n\npchar = unreserved / pct-encoded / sub-delims / ":" / "@"\n\nquery = *( pchar / "/" / "?" )\n\nfragment = *( pchar / "/" / "?" )\n\npct-encoded = "%" HEXDIG HEXDIG\n\nunreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"\nreserved = gen-delims / sub-delims\ngen-delims = ":" / "/" / "?" / "#" / "[" / "]" / "@"\nsub-delims = "!" / "$" / "&" / "\'" / "(" / ")"\n / "*" / "+" / "," / ";" / "="\n\n; ------------------------------------------------------------------------------\n; RFC 4501\n\ndnsauthority = host [ ":" port ]\n ; See RFC 3986 for the\n ; definition of "host" and "port".\n\n; ------------------------------------------------------------------------------\n; RFC 3339\n\ndate-fullyear = 4DIGIT\ndate-month = 2DIGIT ; 01-12\ndate-mday = 2DIGIT ; 01-28, 01-29, 01-30, 01-31 based on\n ; month/year\ntime-hour = 2DIGIT ; 00-23\ntime-minute = 2DIGIT ; 00-59\ntime-second = 2DIGIT ; 00-58, 00-59, 00-60 based on leap second\n ; rules\ntime-secfrac = "." 1*DIGIT\ntime-numoffset = ("+" / "-") time-hour ":" time-minute\ntime-offset = "Z" / time-numoffset\n\npartial-time = time-hour ":" time-minute ":" time-second\n [time-secfrac]\nfull-date = date-fullyear "-" date-month "-" date-mday\nfull-time = partial-time time-offset\n\ndate-time = full-date "T" full-time\n\n; ------------------------------------------------------------------------------\n; RFC 5234\n\nALPHA = %x41-5A / %x61-7A ; A-Z / a-z\nLF = %x0A\n ; linefeed\nDIGIT = %x30-39\n ; 0-9\nHEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F"\n');if(t.generate(),t.errors.length)throw console.error(t.errorsToAscii()),console.error(t.linesToAscii()),console.log(t.displayAttributeErrors()),new Error("ABNF grammar has errors");const r=t.toObject(),n=new Ng.default.parser;n.ast=new Ng.default.ast;const i=Ng.default.ids,o=I((function(e,t,r,n,o){const s=i.SEM_OK;return e===i.SEM_PRE&&(o.domain=Ng.default.utils.charsToString(t,r,n)),s}),"domain");n.ast.callbacks.domain=o;const s=I((function(e,t,r,n,o){const s=i.SEM_OK;return e===i.SEM_PRE&&(o.address=Ng.default.utils.charsToString(t,r,n)),s}),"address");n.ast.callbacks.address=s;const a=I((function(e,t,r,n,o){const s=i.SEM_OK;return e===i.SEM_PRE&&(o.statement=Ng.default.utils.charsToString(t,r,n)),s}),"statement");n.ast.callbacks.statement=a;const c=I((function(e,t,r,n,o){const s=i.SEM_OK;return e===i.SEM_PRE&&(o.uri||(o.uri=Ng.default.utils.charsToString(t,r,n))),s}),"uri");n.ast.callbacks.uri=c;const u=I((function(e,t,r,n,o){const s=i.SEM_OK;return e===i.SEM_PRE&&(o.version=Ng.default.utils.charsToString(t,r,n)),s}),"version");n.ast.callbacks.version=u;const l=I((function(e,t,r,n,o){const s=i.SEM_OK;return e===i.SEM_PRE&&(o.chainId=Ng.default.utils.charsToString(t,r,n)),s}),"chainId");n.ast.callbacks["chain-id"]=l;const d=I((function(e,t,r,n,o){const s=i.SEM_OK;return e===i.SEM_PRE&&(o.nonce=Ng.default.utils.charsToString(t,r,n)),s}),"nonce");n.ast.callbacks.nonce=d;const f=I((function(e,t,r,n,o){const s=i.SEM_OK;return e===i.SEM_PRE&&(o.issuedAt=Ng.default.utils.charsToString(t,r,n)),s}),"issuedAt");n.ast.callbacks["issued-at"]=f;const h=I((function(e,t,r,n,o){const s=i.SEM_OK;return e===i.SEM_PRE&&(o.expirationTime=Ng.default.utils.charsToString(t,r,n)),s}),"expirationTime");n.ast.callbacks["expiration-time"]=h;const p=I((function(e,t,r,n,o){const s=i.SEM_OK;return e===i.SEM_PRE&&(o.notBefore=Ng.default.utils.charsToString(t,r,n)),s}),"notBefore");n.ast.callbacks["not-before"]=p;const m=I((function(e,t,r,n,o){const s=i.SEM_OK;return e===i.SEM_PRE&&(o.requestId=Ng.default.utils.charsToString(t,r,n)),s}),"requestId");n.ast.callbacks["request-id"]=m;const g=I((function(e,t,r,n,o){const s=i.SEM_OK;return e===i.SEM_PRE&&(o.resources=Ng.default.utils.charsToString(t,r,n).slice(3).split("\n- ")),s}),"resources");n.ast.callbacks.resources=g;const b=n.parse(r,"sign-in-with-ethereum",e);if(!b.success)throw new Error(`Invalid message: ${JSON.stringify(b)}`);const y={};n.ast.translate(y);for(const[e,t]of Object.entries(y))this[e]=t}};I(Ly,"ParsedMessage"),(Dy=Oy||(Oy={})).INVALID_SIGNATURE="Invalid signature.",Dy.EXPIRED_MESSAGE="Expired message.",Dy.MALFORMED_SESSION="Malformed session.",(jy||(jy={})).PERSONAL_SIGNATURE="Personal signature";var Py,Ry,Uy=class{constructor(e){if(this.domain=void 0,this.address=void 0,this.statement=void 0,this.uri=void 0,this.version=void 0,this.nonce=void 0,this.issuedAt=void 0,this.expirationTime=void 0,this.notBefore=void 0,this.requestId=void 0,this.chainId=void 0,this.resources=void 0,this.signature=void 0,this.type=void 0,"string"==typeof e){const t=new Ly(e);this.domain=t.domain,this.address=t.address,this.statement=t.statement,this.uri=t.uri,this.version=t.version,this.nonce=t.nonce,this.issuedAt=t.issuedAt,this.expirationTime=t.expirationTime,this.notBefore=t.notBefore,this.requestId=t.requestId,this.chainId=t.chainId,this.resources=t.resources}else Object.assign(this,e)}static fromCacao(e){const t=zg.parse(e.p.iss.replace("did:pkh:","")),r=new Uy({domain:e.p.domain,address:t.address,uri:e.p.aud,version:e.p.version,chainId:new Ug(t.chainId).reference});return e.p.statement&&(r.statement=e.p.statement),e.p.nonce&&(r.nonce=e.p.nonce),e.p.iat&&(r.issuedAt=e.p.iat),e.p.exp&&(r.expirationTime=e.p.exp),e.p.nbf&&(r.notBefore=e.p.nbf),e.p.requestId&&(r.requestId=e.p.requestId),e.p.resources&&(r.resources=e.p.resources),e.s&&(e.s.s&&(r.signature=e.s.s),"eip191"===e.s.t&&(r.type=jy.PERSONAL_SIGNATURE)),r}toMessage(){const e=`${this.domain} wants you to sign in with your Ethereum account:`,t=`URI: ${this.uri}`;let r=[e,this.address].join("\n");const n=`Version: ${this.version}`;this.nonce||(this.nonce=(Math.random()+1).toString(36).substring(4));const i=[t,n,`Nonce: ${this.nonce}`];if(this.issuedAt=this.issuedAt?this.issuedAt:(new Date).toISOString(),i.push(`Issued At: ${this.issuedAt}`),this.expirationTime){const e=`Expiration Time: ${this.expirationTime}`;i.push(e)}this.notBefore&&i.push(`Not Before: ${this.notBefore}`),this.requestId&&i.push(`Request ID: ${this.requestId}`),this.chainId&&i.push(`Chain ID: ${this.chainId}`),this.resources&&i.push(["Resources:",...this.resources.map((e=>`- ${e}`))].join("\n"));const o=i.join("\n");return this.statement&&(r=[r,this.statement].join("\n\n")),[r,o].join("\n\n")}signMessage(){let e;return this.type,jy.PERSONAL_SIGNATURE,e=this.toMessage(),e}};I(Uy,"SiweMessage"),function(e){function t(e){const t={h:{t:"eip4361"},p:{domain:e.domain,iat:e.issuedAt,iss:`did:pkh:eip155:${e.chainId}:${e.address}`,aud:e.uri,version:e.version,nonce:e.nonce}};return e.signature&&(t.s={t:"eip191",s:e.signature}),e.notBefore&&(t.p.nbf=e.notBefore),e.expirationTime&&(t.p.exp=e.expirationTime),e.statement&&(t.p.statement=e.statement),e.requestId&&(t.p.requestId=e.requestId),e.resources&&(t.p.resources=e.resources),t}function r(e,t={}){var r;if("eip4361"===e.h.t&&"eip191"===(null==(r=e.s)?void 0:r.t))return n(e,t);throw new Error("Unsupported CACAO signature type")}function n(e,t){if(!e.s)throw new Error("CACAO does not have a signature");const r=t.atTime?t.atTime.getTime():Date.now();if(Date.parse(e.p.iat)>r||Date.parse(e.p.nbf)>r)throw new Error("CACAO is not valid yet");if(Date.parse(e.p.exp)<r)throw new Error("CACAO has expired");const n=Uy.fromCacao(e),i=e.s.s,o=By(n.toMessage(),i),s=zg.parse(e.p.iss.replace("did:pkh:","")).address;if(o.toLowerCase()!==s.toLowerCase())throw new Error("Signature does not belong to issuer")}I(t,"fromSiweMessage"),e.fromSiweMessage=t,I(r,"verify"),e.verify=r,I(n,"verifyEIP191Signature"),e.verifyEIP191Signature=n}(Py||(Py={})),function(e){const t=I((function(e){try{return Promise.resolve(_h({value:e,codec:kh,hasher:Dt}))}catch(e){return Promise.reject(e)}}),"fromCacao");e.fromCacao=t}(Ry||(Ry={}));var zy=R(pn(),1);function Ky(){return af((0,zy.randomBytes)(16),"base64")}I(Ky,"randomString");function Fy(e){return af(e,"base64pad")}function Hy(e){return af(e,"base64url")}function $y(e){return sf(e,"base64pad")}function Vy(e){return JSON.parse(af(sf(e,"base64url")))}function qy(e){if(e.signatures.length>1)throw new Error("Cant convert to compact jws");return`${e.signatures[0].protected}.${e.payload}.${e.signatures[0].signature}`}function Gy(e,t){if(t){return`${e}?versionTime=${t.toISOString().split(".")[0]+"Z"}`}return e}function Yy(e){return e?Array.isArray(e)?e:[e]:[]}function Jy(e){return"registry"in e&&"cache"in e}I(Fy,"encodeBase64"),I(Hy,"encodeBase64Url"),I($y,"decodeBase64"),I(Vy,"base64urlToJSON"),I(qy,"fromDagJWS"),I(Gy,"didWithTime"),I(Yy,"extractControllers"),I(Jy,"isResolver");var Qy=class{constructor({provider:e,resolver:t={},resolverOptions:r,capability:n,parent:i}={}){if(null!=e&&(this._client=new Sg(e)),n){if(this._capability=n,this._parentId=this._capability.p.iss,i&&this._parentId!==i)throw new Error("Capability issuer and parent not equal")}else i&&(this._parentId=i);this.setResolver(t,r)}get capability(){if(!this._capability)throw new Error("DID has no capability attached");return this._capability}get hasCapability(){return null!=this._capability}get parent(){if(!this._parentId)throw new Error("DID has no parent DID");return this._parentId}get hasParent(){return null!=this._parentId}get id(){if(null==this._id)throw new Error("DID is not authenticated");return this._id}get authenticated(){return null!=this._id}withCapability(e){var t;return new Qy({provider:null==(t=this._client)?void 0:t.connection,resolver:this._resolver,capability:e,parent:this._parentId})}setProvider(e){if(null==this._client)this._client=new Sg(e);else if(this._client.connection!==e)throw new Error("A different provider is already set, create a new DID instance to use another provider")}setResolver(e,t){this._resolver=Jy(e)?e:new Zd(e,t)}authenticate(){return z(this,arguments,(function*({provider:e,paths:t=[],aud:r}={}){if(null!=e&&this.setProvider(e),null==this._client)throw new Error("No provider available");const n=Ky(),i=yield this._client.request("did_authenticate",{nonce:n,aud:r,paths:t}),{kid:o}=yield this.verifyJWS(i),s=Vy(i.payload);if(!o.includes(s.did))throw new Error("Invalid authencation response, kid mismatch");if(s.nonce!==n)throw new Error("Invalid authencation response, wrong nonce");if(s.aud!==r)throw new Error("Invalid authencation response, wrong aud");if(s.exp<Date.now()/1e3)throw new Error("Invalid authencation response, expired");return this._id=s.did,this._id}))}createJWS(e){return z(this,arguments,(function*(e,t={}){if(null==this._client)throw new Error("No provider available");if(null==this._id)throw new Error("DID is not authenticated");if(this._capability){const e=yield Ry.fromCacao(this._capability),r=nr.asCID(e.cid);if(!r)throw new Error("Capability CID of the JWS cannot be set to the capability payload cid as they are incompatible");t.protected=t.protected||{},t.protected.cap=`ipfs://${null==r?void 0:r.toString()}`}const{jws:r}=yield this._client.request("did_createJWS",N(C({did:this._id},t),{payload:e}));return r}))}createDagJWS(e){return z(this,arguments,(function*(e,t={}){const{cid:r,linkedBlock:n}=yield Xm(e),i=Hy(r.bytes);Object.assign(t,{linkedBlock:Fy(n)});const o=yield this.createJWS(i,t),s=nr.asCID(r);if(!s)throw new Error("CID of the JWS cannot be set to the encoded payload cid as they are incompatible");if(o.link=s,this._capability){return{jws:o,linkedBlock:n,cacaoBlock:(yield Ry.fromCacao(this._capability)).bytes}}return{jws:o,linkedBlock:n}}))}verifyJWS(e){return z(this,arguments,(function*(e,t={}){var r,n,i,o,s,a,c;"string"!=typeof e&&(e=qy(e));const u=Vy(e.split(".")[0]).kid;if(!u)throw new Error('No "kid" found in jws');const l=yield this.resolve(u);if(!t.disableTimecheck){const e=null==(r=l.didDocumentMetadata)?void 0:r.nextUpdate;if(e){const r=t.revocationPhaseOutSecs?1e3*t.revocationPhaseOutSecs:0,n=new Date(e).valueOf()+r;if(!(t.atTime&&t.atTime.getTime()<n))throw new Error(`invalid_jws: signature authored with a revoked DID version: ${u}`)}const i=null==(n=l.didDocumentMetadata)?void 0:n.updated;if(i&&t.atTime&&t.atTime.getTime()<new Date(i).valueOf())throw new Error(`invalid_jws: signature authored before creation of DID version: ${u}`)}const d=null==(i=l.didDocument)?void 0:i.id;if(t.issuer&&t.issuer===(null==(o=t.capability)?void 0:o.p.iss)&&d===t.capability.p.aud)Py.verify(t.capability,{atTime:t.atTime?t.atTime:void 0});else if(t.issuer&&t.issuer!==d){const e=Gy(t.issuer,t.atTime),r=Yy(null==(s=(yield this.resolve(e)).didDocument)?void 0:s.controller);if((null==(a=t.capability)?void 0:a.s)&&t.capability.p.aud===d&&r.includes(t.capability.p.iss))Py.verify(t.capability,{atTime:t.atTime?t.atTime:void 0});else{if(!(!!d&&r.includes(d)))throw new Error(`invalid_jws: not a valid verificationMethod for issuer: ${u}`)}}let f;rh(e,(null==(c=l.didDocument)?void 0:c.verificationMethod)||[]);try{f=Vy(e.split(".")[1])}catch(e){}return{kid:u,payload:f,didResolutionResult:l}}))}createJWE(e,t){return z(this,arguments,(function*(e,t,r={}){const n=yield ph(t,this._resolver);return hh(e,n,r.protectedHeader,r.aad)}))}createDagJWE(e,t){return z(this,arguments,(function*(e,t,r={}){const n=yield rg(e);return this.createJWE(n,t,r)}))}decryptJWE(e){return z(this,arguments,(function*(e,t={}){if(null==this._client)throw new Error("No provider available");if(null==this._id)throw new Error("DID is not authenticated");const{cleartext:r}=yield this._client.request("did_decryptJWE",N(C({did:this._id},t),{jwe:e}));return $y(r)}))}decryptDagJWE(e){return z(this,null,(function*(){return ng(yield this.decryptJWE(e))}))}resolve(e){return z(this,null,(function*(){const t=yield this._resolver.resolve(e);if(t.didResolutionMetadata.error){const{error:r,message:n}=t.didResolutionMetadata;throw new Error(`Failed to resolve ${e}: ${r}${n?`, ${n}`:""}`)}return t}))}};I(Qy,"DID");var Wy=R(mi()),Xy=R(gn(),1),Zy=R(gi(),1);function ev(e){return JSON.parse((0,Zy.default)(e))}function tv(e){const t=new Uint8Array(e.length+2);return t[0]=237,t[1]=1,t.set(e,2),`did:key:z${af(t,"base58btc")}`}function rv(e){const[t,r,n]=e.split(".");return{payload:r,signatures:[{protected:t,signature:n}]}}I(ev,"toStableObject"),I(tv,"encodeDID"),I(rv,"toGeneralJWS");var nv=I(((e,t,r,...n)=>z(void 0,[e,t,r,...n],(function*(e,t,r,n={}){const i=`${t}#${t.split(":")[2]}`,o=Pf(r),s=ev(Object.assign(n,{kid:i,alg:"EdDSA"}));return Wf("string"==typeof e?e:ev(e),o,s)}))),"sign"),iv={did_authenticate:(e,t)=>z(void 0,[e,t],(function*({did:e,secretKey:t},r){return rv(yield nv({did:e,aud:r.aud,nonce:r.nonce,paths:r.paths,exp:Math.floor(Date.now()/1e3)+600},e,t))})),did_createJWS:(e,t)=>z(void 0,[e,t],(function*({did:e,secretKey:t},r){if(r.did.split("#")[0]!==e)throw new hg(4100,`Unknown DID: ${e}`);return{jws:rv(yield nv(r.payload,e,t,r.protected))}})),did_decryptJWE:(e,t)=>z(void 0,[e,t],(function*({secretKey:e},t){const r=wh((0,Xy.convertSecretKeyToX25519)(e));try{return{cleartext:af(yield ih(t.jwe,r),"base64pad")}}catch(e){throw new hg(-32e3,e.message)}}))},ov=class{constructor(e){const{secretKey:t,publicKey:r}=(0,Xy.generateKeyPairFromSeed)(e),n=tv(r),i=Tg(iv);this._handle=e=>z(this,null,(function*(){return yield i({did:n,secretKey:t},e)}))}get isDidProvider(){return!0}send(e){return z(this,null,(function*(){return yield this._handle(e)}))}};I(ov,"Ed25519Provider"),vr(),$e();var sv={tile:0,"caip10-link":1,model:2,MID:3};function av(e){const t=sv[e];if(void 0!==t)return t;throw new Error(`No stream type registered for name ${e}`)}function cv(e){const t=Object.entries(sv).find((([,t])=>t===e));if(t)return t[0];throw new Error(`No stream type registered for index ${e}`)}I(av,"codeByName"),I(cv,"nameByCode");var uv=class{};I(uv,"StreamType"),uv.nameByCode=cv,uv.codeByName=av;var lv=R(Xn(),1);function dv(e){let t,r,n;return"object"==typeof e?(t=e.hashFunction,r=e.expiring,n=e.tags):t=e,(e,i,o)=>{if(null!=o.value)o.value=hv(o.value,t,r,n);else{if(null==o.get)throw"Only put a Memoize() decorator on a method or get accessor.";o.get=hv(o.get,t,r,n)}}}I(dv,"Memoize");var fv=new Map;function hv(e,t,r=0,n){const i=Symbol("__memoized_map__");return function(...o){let s;this.hasOwnProperty(i)||Object.defineProperty(this,i,{configurable:!1,enumerable:!1,writable:!1,value:new Map});let a=this[i];if(Array.isArray(n))for(const e of n)fv.has(e)?fv.get(e).push(a):fv.set(e,[a]);if(t||o.length>0||r>0){let n;n=!0===t?o.map((e=>e.toString())).join("!"):t?t.apply(this,o):o[0];const i=`${n}__timestamp`;let c=!1;if(r>0)if(a.has(i)){let e=a.get(i);c=Date.now()-e>r}else c=!0;a.has(n)&&!c?s=a.get(n):(s=e.apply(this,o),a.set(n,s),r>0&&a.set(i,Date.now()))}else{const t=this;a.has(t)?s=a.get(t):(s=e.apply(this,o),a.set(t,s))}return s}}I(hv,"getNewFunction");vr();var pv=R(Xn(),1);function mv(e){const t=pv.default.decode(e),r=pv.default.decode.bytes;return[t,e.slice(r),r]}function gv(e){return 0===e||1===e}function bv(e){const t=yv(e);if(t instanceof Error)throw t;return t}function yv(e){const[t,r]=mv(e);if(!gv(t))return new Error(`Unknown CID version ${t}`);const[n,i]=mv(r),[,o,s]=mv(i),[a,,c]=mv(o),u=i.slice(0,s+c+a),l=i.slice(s+c+a);return[nr.create(t,n,xt(u)),l]}It(),I(mv,"readVarint"),I(gv,"isCidVersion"),I(bv,"readCid"),I(yv,"readCidNoThrow"),vr(),$e(),Kt();var vv,wv,Av=R(Xn(),1),Ev=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},Sv=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},xv=function(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r},Mv=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};function _v(e){const t=kv(e);if(t instanceof Error)throw t;return t}function kv(e){const[t,r]=mv(e);if(206!==t)return new Error("fromBytes: invalid streamid, does not include streamid codec");const[n,i]=mv(r),o=yv(i);if(o instanceof Error)return o;const[s,a]=o;return a.length>0?new Error("Invalid StreamID: contains commit"):new Iv(n,s)}function Tv(e){const t=Cv(e);if(t instanceof Error)throw t;return t}function Cv(e){const t=e.replace("ceramic://","").replace("/ceramic/",""),r=t.includes("commit")?t.split("?")[0]:t;return kv(Re.decode(r))}I(_v,"fromBytes"),I(kv,"fromBytesNoThrow"),I(Tv,"fromString"),I(Cv,"fromStringNoThrow");var Nv=Symbol.for("@ceramicnetwork/streamid/StreamID"),Iv=class{constructor(e,t){if(this._tag=Nv,vv.set(this,void 0),wv.set(this,void 0),!e&&0!==e)throw new Error("constructor: type required");if(!t)throw new Error("constructor: cid required");xv(this,vv,"string"==typeof e?uv.codeByName(e):e,"f"),xv(this,wv,"string"==typeof t?nr.parse(t):t,"f")}static isInstance(e){return"object"==typeof e&&"_tag"in e&&e._tag===Nv}static fromGenesis(e,t){return z(this,null,(function*(){const r=yield _h({value:t,codec:kh,hasher:Dt});return new Iv(e,r.cid)}))}get type(){return Mv(this,vv,"f")}get typeName(){return uv.nameByCode(Mv(this,vv,"f"))}get cid(){return Mv(this,wv,"f")}get bytes(){return ef([Av.default.encode(206),Av.default.encode(this.type),this.cid.bytes])}get baseID(){return new Iv(Mv(this,vv,"f"),Mv(this,wv,"f"))}equals(e){return!!Iv.isInstance(e)&&(this.type===e.type&&this.cid.equals(e.cid))}toString(){return Re.encode(this.bytes)}toUrl(){return`ceramic://${this.toString()}`}[(vv=new WeakMap,wv=new WeakMap,Symbol.for("nodejs.util.inspect.custom"))](){return`StreamID(${this.toString()})`}[Symbol.toPrimitive](){return this.toString()}};I(Iv,"StreamID"),Iv.fromBytes=_v,Iv.fromBytesNoThrow=kv,Iv.fromString=Tv,Iv.fromStringNoThrow=Cv,Ev([dv(),Sv("design:type",String),Sv("design:paramtypes",[])],Iv.prototype,"typeName",null),Ev([dv(),Sv("design:type",Uint8Array),Sv("design:paramtypes",[])],Iv.prototype,"bytes",null),Ev([dv(),Sv("design:type",Iv),Sv("design:paramtypes",[])],Iv.prototype,"baseID",null),Ev([dv(),Sv("design:type",Function),Sv("design:paramtypes",[]),Sv("design:returntype",String)],Iv.prototype,"toString",null),Ev([dv(),Sv("design:type",Function),Sv("design:paramtypes",[]),Sv("design:returntype",String)],Iv.prototype,"toUrl",null);var Bv,Ov,Dv,jv=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s},Lv=function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},Pv=function(e,t,r,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(e,r):i?i.value=r:t.set(e,r),r},Rv=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)};function Uv(e){const t=zv(e);if(t instanceof Error)throw t;return t}function zv(e){const[t,r]=mv(e);if(206!==t)return new Error("fromBytes: invalid streamid, does not include streamid codec");const[n,i]=mv(r),o=bv(i);if(o instanceof Error)return o;const[s,a]=o;if(0===a.length)return new Error("No commit information provided");if(1===a.length)return new Yv(n,s,a[0]);{const[e]=bv(a);return new Yv(n,s,e)}}function Kv(e){try{return"string"==typeof e?nr.parse(e):nr.asCID(e)}catch(e){return}}function Fv(e,t=null){if(!t)return null;const r=Kv(t);if(r)return e.equals(r)?null:r;if("0"===String(t))return null;throw new Error("Cannot specify commit as a number except to request commit 0 (the genesis commit)")}function Hv(e){const t=$v(e);if(t instanceof Error)throw t;return t}function $v(e){const t=e.replace("ceramic://","").replace("/ceramic/","");if(t.includes("commit")){const e=t.split("?")[1].split("=")[1],r=t.split("?")[0];return qv(Iv.fromString(r),e)}return zv(Re.decode(t))}I(Uv,"fromBytes"),I(zv,"fromBytesNoThrow"),I(Kv,"parseCID"),I(Fv,"parseCommit"),I(Hv,"fromString"),I($v,"fromStringNoThrow");var Vv=Symbol.for("@ceramicnetwork/streamid/CommitID");function qv(e,t){return new Yv(e.type,e.cid,t)}I(qv,"make");var Gv,Yv=class{constructor(e,t,r=null){if(this._tag=Vv,Bv.set(this,void 0),Ov.set(this,void 0),Dv.set(this,void 0),!e&&0!==e)throw new Error("constructor: type required");if(!t)throw new Error("constructor: cid required");Pv(this,Bv,"string"==typeof e?uv.codeByName(e):e,"f"),Pv(this,Ov,"string"==typeof t?nr.parse(t):t,"f"),Pv(this,Dv,Fv(Rv(this,Ov,"f"),r),"f")}static isInstance(e){return"object"==typeof e&&"_tag"in e&&e._tag===Vv}get baseID(){return new Iv(Rv(this,Bv,"f"),Rv(this,Ov,"f"))}get type(){return Rv(this,Bv,"f")}get typeName(){return uv.nameByCode(Rv(this,Bv,"f"))}get cid(){return Rv(this,Ov,"f")}get commit(){return Rv(this,Dv,"f")||Rv(this,Ov,"f")}get bytes(){var e;const t=lv.default.encode(206),r=lv.default.encode(this.type),n=(null==(e=Rv(this,Dv,"f"))?void 0:e.bytes)||new Uint8Array([0]);return ef([t,r,this.cid.bytes,n])}equals(e){return this.type===e.type&&this.cid.equals(e.cid)&&this.commit.equals(e.commit)}toString(){return Re.encode(this.bytes)}toUrl(){return`ceramic://${this.toString()}`}[(Bv=new WeakMap,Ov=new WeakMap,Dv=new WeakMap,Symbol.for("nodejs.util.inspect.custom"))](){return`CommitID(${this.toString()})`}[Symbol.toPrimitive](){return this.toString()}};I(Yv,"CommitID"),Yv.fromBytes=Uv,Yv.fromBytesNoThrow=zv,Yv.fromString=Hv,Yv.fromStringNoThrow=$v,Yv.make=qv,jv([dv(),Lv("design:type",Iv),Lv("design:paramtypes",[])],Yv.prototype,"baseID",null),jv([dv(),Lv("design:type",String),Lv("design:paramtypes",[])],Yv.prototype,"typeName",null),jv([dv(),Lv("design:type",nr),Lv("design:paramtypes",[])],Yv.prototype,"commit",null),jv([dv(),Lv("design:type",Uint8Array),Lv("design:paramtypes",[])],Yv.prototype,"bytes",null),jv([dv(),Lv("design:type",Function),Lv("design:paramtypes",[]),Lv("design:returntype",String)],Yv.prototype,"toString",null),jv([dv(),Lv("design:type",Function),Lv("design:paramtypes",[]),Lv("design:returntype",String)],Yv.prototype,"toUrl",null),function(e){function t(e){if(Iv.isInstance(e))return e;if(Yv.isInstance(e))return e;if(e instanceof Uint8Array){const t=Yv.fromBytesNoThrow(e);return t instanceof Error?Iv.fromBytes(e):t}if("string"==typeof e){const t=Yv.fromStringNoThrow(e);return t instanceof Error?Iv.fromString(e):t}throw new Error("Can not build CommitID or StreamID")}I(t,"from"),e.from=t}(Gv||(Gv={}));var Jv="ceramic://k3y52l7qbv1fryjn62sggjh1lpn11c56qfofzmty190d62hwk1cal1c7qc5he54ow",Qv={};L(Qv,{JsonPatchError:()=>uw,_areEquals:()=>vw,applyOperation:()=>pw,applyPatch:()=>mw,applyReducer:()=>gw,deepClone:()=>lw,getValueByPointer:()=>hw,validate:()=>yw,validator:()=>bw});var Wv,Xv=(Wv=I((function(e,t){return(Wv=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)}),"extendStatics"),function(e,t){function r(){this.constructor=e}Wv(e,t),I(r,"__"),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),Zv=Object.prototype.hasOwnProperty;function ew(e,t){return Zv.call(e,t)}function tw(e){if(Array.isArray(e)){for(var t=new Array(e.length),r=0;r<t.length;r++)t[r]=""+r;return t}if(Object.keys)return Object.keys(e);var n=[];for(var i in e)ew(e,i)&&n.push(i);return n}function rw(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function nw(e){for(var t,r=0,n=e.length;r<n;){if(!((t=e.charCodeAt(r))>=48&&t<=57))return!1;r++}return!0}function iw(e){return-1===e.indexOf("/")&&-1===e.indexOf("~")?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function ow(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function sw(e){if(void 0===e)return!0;if(e)if(Array.isArray(e)){for(var t=0,r=e.length;t<r;t++)if(sw(e[t]))return!0}else if("object"==typeof e)for(var n=tw(e),i=n.length,o=0;o<i;o++)if(sw(e[n[o]]))return!0;return!1}function aw(e,t){var r=[e];for(var n in t){var i="object"==typeof t[n]?JSON.stringify(t[n],null,2):t[n];void 0!==i&&r.push(n+": "+i)}return r.join("\n")}I(ew,"hasOwnProperty"),I(tw,"_objectKeys"),I(rw,"_deepClone"),I(nw,"isInteger"),I(iw,"escapePathComponent"),I(ow,"unescapePathComponent"),I(sw,"hasUndefined"),I(aw,"patchErrorMessageFormatter");var cw=function(e){function t(t,r,n,i,o){var s=this.constructor,a=e.call(this,aw(t,{name:r,index:n,operation:i,tree:o}))||this;return a.name=r,a.index=n,a.operation=i,a.tree=o,Object.setPrototypeOf(a,s.prototype),a.message=aw(t,{name:r,index:n,operation:i,tree:o}),a}return Xv(t,e),I(t,"PatchError"),t}(Error),uw=cw,lw=rw,dw={add:function(e,t,r){return e[t]=this.value,{newDocument:r}},remove:function(e,t,r){var n=e[t];return delete e[t],{newDocument:r,removed:n}},replace:function(e,t,r){var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:function(e,t,r){var n=hw(r,this.path);n&&(n=rw(n));var i=pw(r,{op:"remove",path:this.from}).removed;return pw(r,{op:"add",path:this.path,value:i}),{newDocument:r,removed:n}},copy:function(e,t,r){var n=hw(r,this.from);return pw(r,{op:"add",path:this.path,value:rw(n)}),{newDocument:r}},test:function(e,t,r){return{newDocument:r,test:vw(e[t],this.value)}},_get:function(e,t,r){return this.value=e[t],{newDocument:r}}},fw={add:function(e,t,r){return nw(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:r,index:t}},remove:function(e,t,r){return{newDocument:r,removed:e.splice(t,1)[0]}},replace:function(e,t,r){var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:dw.move,copy:dw.copy,test:dw.test,_get:dw._get};function hw(e,t){if(""==t)return e;var r={op:"_get",path:t};return pw(e,r),r.value}function pw(e,t,r,n,i,o){if(void 0===r&&(r=!1),void 0===n&&(n=!0),void 0===i&&(i=!0),void 0===o&&(o=0),r&&("function"==typeof r?r(t,0,e,t.path):bw(t,0)),""===t.path){var s={newDocument:e};if("add"===t.op)return s.newDocument=t.value,s;if("replace"===t.op)return s.newDocument=t.value,s.removed=e,s;if("move"===t.op||"copy"===t.op)return s.newDocument=hw(e,t.from),"move"===t.op&&(s.removed=e),s;if("test"===t.op){if(s.test=vw(e,t.value),!1===s.test)throw new uw("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return s.newDocument=e,s}if("remove"===t.op)return s.removed=e,s.newDocument=null,s;if("_get"===t.op)return t.value=e,s;if(r)throw new uw("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",o,t,e);return s}n||(e=rw(e));var a=(t.path||"").split("/"),c=e,u=1,l=a.length,d=void 0,f=void 0,h=void 0;for(h="function"==typeof r?r:bw;;){if((f=a[u])&&-1!=f.indexOf("~")&&(f=ow(f)),i&&("__proto__"==f||"prototype"==f&&u>0&&"constructor"==a[u-1]))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(r&&void 0===d&&(void 0===c[f]?d=a.slice(0,u).join("/"):u==l-1&&(d=t.path),void 0!==d&&h(t,0,e,d)),u++,Array.isArray(c)){if("-"===f)f=c.length;else{if(r&&!nw(f))throw new uw("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",o,t,e);nw(f)&&(f=~~f)}if(u>=l){if(r&&"add"===t.op&&f>c.length)throw new uw("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",o,t,e);if(!1===(s=fw[t.op].call(t,c,f,e)).test)throw new uw("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return s}}else if(u>=l){if(!1===(s=dw[t.op].call(t,c,f,e)).test)throw new uw("Test operation failed","TEST_OPERATION_FAILED",o,t,e);return s}if(c=c[f],r&&u<l&&(!c||"object"!=typeof c))throw new uw("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",o,t,e)}}function mw(e,t,r,n,i){if(void 0===n&&(n=!0),void 0===i&&(i=!0),r&&!Array.isArray(t))throw new uw("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");n||(e=rw(e));for(var o=new Array(t.length),s=0,a=t.length;s<a;s++)o[s]=pw(e,t[s],r,!0,i,s),e=o[s].newDocument;return o.newDocument=e,o}function gw(e,t,r){var n=pw(e,t);if(!1===n.test)throw new uw("Test operation failed","TEST_OPERATION_FAILED",r,t,e);return n.newDocument}function bw(e,t,r,n){if("object"!=typeof e||null===e||Array.isArray(e))throw new uw("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,r);if(!dw[e.op])throw new uw("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,r);if("string"!=typeof e.path)throw new uw("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,r);if(0!==e.path.indexOf("/")&&e.path.length>0)throw new uw('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,r);if(("move"===e.op||"copy"===e.op)&&"string"!=typeof e.from)throw new uw("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,r);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&void 0===e.value)throw new uw("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,r);if(("add"===e.op||"replace"===e.op||"test"===e.op)&&sw(e.value))throw new uw("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,r);if(r)if("add"==e.op){var i=e.path.split("/").length,o=n.split("/").length;if(i!==o+1&&i!==o)throw new uw("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,r)}else if("replace"===e.op||"remove"===e.op||"_get"===e.op){if(e.path!==n)throw new uw("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,r)}else if("move"===e.op||"copy"===e.op){var s=yw([{op:"_get",path:e.from,value:void 0}],r);if(s&&"OPERATION_PATH_UNRESOLVABLE"===s.name)throw new uw("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,r)}}function yw(e,t,r){try{if(!Array.isArray(e))throw new uw("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)mw(rw(t),rw(e),r||!0);else{r=r||bw;for(var n=0;n<e.length;n++)r(e[n],n,t,void 0)}}catch(e){if(e instanceof uw)return e;throw e}}function vw(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){var r,n,i,o=Array.isArray(e),s=Array.isArray(t);if(o&&s){if((n=e.length)!=t.length)return!1;for(r=n;0!=r--;)if(!vw(e[r],t[r]))return!1;return!0}if(o!=s)return!1;var a=Object.keys(e);if((n=a.length)!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!t.hasOwnProperty(a[r]))return!1;for(r=n;0!=r--;)if(!vw(e[i=a[r]],t[i]))return!1;return!0}return e!=e&&t!=t}I(hw,"getValueByPointer"),I(pw,"applyOperation"),I(mw,"applyPatch"),I(gw,"applyReducer"),I(bw,"validator"),I(yw,"validate"),I(vw,"_areEquals");var ww={};L(ww,{compare:()=>Iw,generate:()=>Cw,observe:()=>Tw,unobserve:()=>kw});var Aw=new WeakMap,Ew=function(){function e(e){this.observers=new Map,this.obj=e}return I(e,"Mirror"),e}(),Sw=function(){function e(e,t){this.callback=e,this.observer=t}return I(e,"ObserverInfo"),e}();function xw(e){return Aw.get(e)}function Mw(e,t){return e.observers.get(t)}function _w(e,t){e.observers.delete(t.callback)}function kw(e,t){t.unobserve()}function Tw(e,t){var r,n=xw(e);if(n){var i=Mw(n,t);r=i&&i.observer}else n=new Ew(e),Aw.set(e,n);if(r)return r;if(r={},n.value=rw(e),t){r.callback=t,r.next=null;var o=I((function(){Cw(r)}),"dirtyCheck"),s=I((function(){clearTimeout(r.next),r.next=setTimeout(o)}),"fastCheck");"undefined"!=typeof window&&(window.addEventListener("mouseup",s),window.addEventListener("keyup",s),window.addEventListener("mousedown",s),window.addEventListener("keydown",s),window.addEventListener("change",s))}return r.patches=[],r.object=e,r.unobserve=function(){Cw(r),clearTimeout(r.next),_w(n,r),"undefined"!=typeof window&&(window.removeEventListener("mouseup",s),window.removeEventListener("keyup",s),window.removeEventListener("mousedown",s),window.removeEventListener("keydown",s),window.removeEventListener("change",s))},n.observers.set(t,new Sw(t,r)),r}function Cw(e,t){void 0===t&&(t=!1);var r=Aw.get(e.object);Nw(r.value,e.object,e.patches,"",t),e.patches.length&&mw(r.value,e.patches);var n=e.patches;return n.length>0&&(e.patches=[],e.callback&&e.callback(n)),n}function Nw(e,t,r,n,i){if(t!==e){"function"==typeof t.toJSON&&(t=t.toJSON());for(var o=tw(t),s=tw(e),a=!1,c=s.length-1;c>=0;c--){var u=e[d=s[c]];if(!ew(t,d)||void 0===t[d]&&void 0!==u&&!1===Array.isArray(t))Array.isArray(e)===Array.isArray(t)?(i&&r.push({op:"test",path:n+"/"+iw(d),value:rw(u)}),r.push({op:"remove",path:n+"/"+iw(d)}),a=!0):(i&&r.push({op:"test",path:n,value:e}),r.push({op:"replace",path:n,value:t}));else{var l=t[d];"object"==typeof u&&null!=u&&"object"==typeof l&&null!=l&&Array.isArray(u)===Array.isArray(l)?Nw(u,l,r,n+"/"+iw(d),i):u!==l&&(i&&r.push({op:"test",path:n+"/"+iw(d),value:rw(u)}),r.push({op:"replace",path:n+"/"+iw(d),value:rw(l)}))}}if(a||o.length!=s.length)for(c=0;c<o.length;c++){var d;ew(e,d=o[c])||void 0===t[d]||r.push({op:"add",path:n+"/"+iw(d),value:rw(t[d])})}}}function Iw(e,t,r){void 0===r&&(r=!1);var n=[];return Nw(e,t,n,"",r),n}I(xw,"getMirror"),I(Mw,"getObserverFromMirror"),I(_w,"removeObserverFromMirror"),I(kw,"unobserve"),I(Tw,"observe"),I(Cw,"generate"),I(Nw,"_generate"),I(Iw,"compare");var Bw,Ow,Dw=Object.assign({},Qv,ww,{JsonPatchError:cw,deepClone:rw,escapePathComponent:iw,unescapePathComponent:ow}),jw=R(pn(),1);(Ow=Bw||(Bw={}))[Ow.PREFER_CACHE=0]="PREFER_CACHE",Ow[Ow.SYNC_ALWAYS=1]="SYNC_ALWAYS",Ow[Ow.NEVER_SYNC=2]="NEVER_SYNC";var Lw=R(bi(),1);function Pw(e){return"function"==typeof e}function Rw(e){var t=e(I((function(e){Error.call(e),e.stack=(new Error).stack}),"_super"));return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}I(Pw,"isFunction"),I(Rw,"createErrorClass");var Uw=Rw((function(e){return I((function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}),"UnsubscriptionErrorImpl")}));function zw(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}I(zw,"arrRemove");var Kw=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}var t;return I(e,"Subscription"),e.prototype.unsubscribe=function(){var e,t,r,n,i;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var s=Ec(o),a=s.next();!a.done;a=s.next()){a.value.remove(this)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}else o.remove(this);var c=this.initialTeardown;if(Pw(c))try{c()}catch(e){i=e instanceof Uw?e.errors:[e]}var u=this._finalizers;if(u){this._finalizers=null;try{for(var l=Ec(u),d=l.next();!d.done;d=l.next()){var f=d.value;try{$w(f)}catch(e){i=null!=i?i:[],e instanceof Uw?i=_c(_c([],Sc(i)),Sc(e.errors)):i.push(e)}}}catch(e){r={error:e}}finally{try{d&&!d.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}}if(i)throw new Uw(i)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)$w(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(r=this._finalizers)&&void 0!==r?r:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&zw(t,e)},e.prototype.remove=function(t){var r=this._finalizers;r&&zw(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=((t=new e).closed=!0,t),e}(),Fw=Kw.EMPTY;function Hw(e){return e instanceof Kw||e&&"closed"in e&&Pw(e.remove)&&Pw(e.add)&&Pw(e.unsubscribe)}function $w(e){Pw(e)?e():e.unsubscribe()}I(Hw,"isSubscription"),I($w,"execFinalizer");var Vw=void 0,qw=!1,Gw=function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return setTimeout.apply(void 0,_c([e,t],Sc(r)))};function Yw(e){Gw((function(){throw e}))}function Jw(){}function Qw(e,t,r){return{kind:e,value:t,error:r}}function Ww(e){e()}I(Yw,"reportUnhandledError"),I(Jw,"noop"),I((function(e){return Qw("E",void 0,e)}),"errorNotification"),I((function(e){return Qw("N",e,void 0)}),"nextNotification"),I(Qw,"createNotification"),I(Ww,"errorContext"),I((function(e){}),"captureError");var Xw=function(e){function t(t){var r=e.call(this)||this;return r.isStopped=!1,t?(r.destination=t,Hw(t)&&t.add(r)):r.destination=oA,r}return fc(t,e),I(t,"Subscriber"),t.create=function(e,t,r){return new rA(e,t,r)},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(Kw),Zw=Function.prototype.bind;function eA(e,t){return Zw.call(e,t)}I(eA,"bind");var tA=function(){function e(e){this.partialObserver=e}return I(e,"ConsumerObserver"),e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){nA(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){nA(e)}else nA(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){nA(e)}},e}(),rA=function(e){function t(t,r,n){var i,o,s=e.call(this)||this;Pw(t)||!t?i={next:null!=t?t:void 0,error:null!=r?r:void 0,complete:null!=n?n:void 0}:s&&qw?((o=Object.create(t)).unsubscribe=function(){return s.unsubscribe()},i={next:t.next&&eA(t.next,o),error:t.error&&eA(t.error,o),complete:t.complete&&eA(t.complete,o)}):i=t;return s.destination=new tA(i),s}return fc(t,e),I(t,"SafeSubscriber"),t}(Xw);function nA(e){Yw(e)}function iA(e){throw e}I(nA,"handleUnhandledError"),I(iA,"defaultErrorHandler"),I((function(e,t){}),"handleStoppedNotification");var oA={closed:!0,next:Jw,error:iA,complete:Jw},sA="function"==typeof Symbol&&Symbol.observable||"@@observable";function aA(e){return e}function cA(e){return 0===e.length?aA:1===e.length?e[0]:I((function(t){return e.reduce((function(e,t){return t(e)}),t)}),"piped")}I(aA,"identity"),I(cA,"pipeFromArray");var uA=function(){function e(e){e&&(this._subscribe=e)}return I(e,"Observable"),e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(e,t,r){var n=this,i=fA(e)?e:new rA(e,t,r);return Ww((function(){var e=n,t=e.operator,r=e.source;i.add(t?t.call(i,r):r?n._subscribe(i):n._trySubscribe(i))})),i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var r=this;return new(t=lA(t))((function(t,n){var i=new rA({next:function(t){try{e(t)}catch(e){n(e),i.unsubscribe()}},error:n,complete:t});r.subscribe(i)}))},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[sA]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return cA(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=lA(e))((function(e,r){var n;t.subscribe((function(e){return n=e}),(function(e){return r(e)}),(function(){return e(n)}))}))},e.create=function(t){return new e(t)},e}();function lA(e){var t;return null!==(t=null!=e?e:Vw)&&void 0!==t?t:Promise}function dA(e){return e&&Pw(e.next)&&Pw(e.error)&&Pw(e.complete)}function fA(e){return e&&e instanceof Xw||dA(e)&&Hw(e)}function hA(e){return Pw(null==e?void 0:e.lift)}function pA(e){return function(t){if(hA(t))return t.lift((function(t){try{return e(t,this)}catch(e){this.error(e)}}));throw new TypeError("Unable to lift unknown Observable type")}}function mA(e,t,r,n,i){return new gA(e,t,r,n,i)}I(lA,"getPromiseCtor"),I(dA,"isObserver"),I(fA,"isSubscriber"),I(hA,"hasLift"),I(pA,"operate"),I(mA,"createOperatorSubscriber");var gA=function(e){function t(t,r,n,i,o,s){var a=e.call(this,t)||this;return a.onFinalize=o,a.shouldUnsubscribe=s,a._next=r?function(e){try{r(e)}catch(e){t.error(e)}}:e.prototype._next,a._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,a._complete=n?function(){try{n()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,a}return fc(t,e),I(t,"OperatorSubscriber"),t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;e.prototype.unsubscribe.call(this),!r&&(null===(t=this.onFinalize)||void 0===t||t.call(this))}},t}(Xw),bA=Rw((function(e){return I((function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}),"ObjectUnsubscribedErrorImpl")})),yA=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return fc(t,e),I(t,"Subject"),t.prototype.lift=function(e){var t=new vA(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new bA},t.prototype.next=function(e){var t=this;Ww((function(){var r,n;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var i=Ec(t.currentObservers),o=i.next();!o.done;o=i.next()){o.value.next(e)}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}}}))},t.prototype.error=function(e){var t=this;Ww((function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var r=t.observers;r.length;)r.shift().error(e)}}))},t.prototype.complete=function(){var e=this;Ww((function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}}))},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null===(e=this.observers)||void 0===e?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,r=this,n=r.hasError,i=r.isStopped,o=r.observers;return n||i?Fw:(this.currentObservers=null,o.push(e),new Kw((function(){t.currentObservers=null,zw(o,e)})))},t.prototype._checkFinalizedStatuses=function(e){var t=this,r=t.hasError,n=t.thrownError,i=t.isStopped;r?e.error(n):i&&e.complete()},t.prototype.asObservable=function(){var e=new uA;return e.source=this,e},t.create=function(e,t){return new vA(e,t)},t}(uA),vA=function(e){function t(t,r){var n=e.call(this)||this;return n.destination=t,n.source=r,n}return fc(t,e),I(t,"AnonymousSubject"),t.prototype.next=function(e){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===r||r.call(t,e)},t.prototype.error=function(e){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===r||r.call(t,e)},t.prototype.complete=function(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)},t.prototype._subscribe=function(e){var t,r;return null!==(r=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==r?r:Fw},t}(yA),wA=function(e){function t(t){var r=e.call(this)||this;return r._value=t,r}return fc(t,e),I(t,"BehaviorSubject"),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(t){var r=e.prototype._subscribe.call(this,t);return!r.closed&&t.next(this._value),r},t.prototype.getValue=function(){var e=this,t=e.hasError,r=e.thrownError,n=e._value;if(t)throw r;return this._throwIfClosed(),n},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(yA),AA=function(){return Date.now()},EA=function(e){function t(t,r){return e.call(this)||this}return fc(t,e),I(t,"Action"),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(Kw),SA=function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return setInterval.apply(void 0,_c([e,t],Sc(r)))},xA=function(e){return clearInterval(e)},MA=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n.pending=!1,n}return fc(t,e),I(t,"AsyncAction"),t.prototype.schedule=function(e,t){if(void 0===t&&(t=0),this.closed)return this;this.state=e;var r=this.id,n=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(n,r,t)),this.pending=!0,this.delay=t,this.id=this.id||this.requestAsyncId(n,this.id,t),this},t.prototype.requestAsyncId=function(e,t,r){return void 0===r&&(r=0),SA(e.flush.bind(e,this),r)},t.prototype.recycleAsyncId=function(e,t,r){if(void 0===r&&(r=0),null!=r&&this.delay===r&&!1===this.pending)return t;xA(t)},t.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var r=this._execute(e,t);if(r)return r;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var r,n=!1;try{this.work(e)}catch(e){n=!0,r=e||new Error("Scheduled action threw falsy error")}if(n)return this.unsubscribe(),r},t.prototype.unsubscribe=function(){if(!this.closed){var t=this.id,r=this.scheduler,n=r.actions;this.work=this.state=this.scheduler=null,this.pending=!1,zw(n,this),null!=t&&(this.id=this.recycleAsyncId(r,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(EA),_A=function(){function e(t,r){void 0===r&&(r=e.now),this.schedulerActionCtor=t,this.now=r}return I(e,"Scheduler"),e.prototype.schedule=function(e,t,r){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(r,t)},e.now=AA,e}(),kA=new(function(e){function t(t,r){void 0===r&&(r=_A.now);var n=e.call(this,t,r)||this;return n.actions=[],n._active=!1,n._scheduled=void 0,n}return fc(t,e),I(t,"AsyncScheduler"),t.prototype.flush=function(e){var t=this.actions;if(this._active)t.push(e);else{var r;this._active=!0;do{if(r=e.execute(e.state,e.delay))break}while(e=t.shift());if(this._active=!1,r){for(;e=t.shift();)e.unsubscribe();throw r}}},t}(_A))(MA),TA=new uA((function(e){return e.complete()}));function CA(e){return e&&Pw(e.schedule)}function NA(e){return e[e.length-1]}function IA(e){return CA(NA(e))?e.pop():void 0}function BA(e,t){return"number"==typeof NA(e)?e.pop():t}I(CA,"isScheduler"),I(NA,"last"),I(IA,"popScheduler"),I(BA,"popNumber");var OA=I((function(e){return e&&"number"==typeof e.length&&"function"!=typeof e}),"isArrayLike");function DA(e){return Pw(null==e?void 0:e.then)}function jA(e){return Pw(e[sA])}function LA(e){return Symbol.asyncIterator&&Pw(null==e?void 0:e[Symbol.asyncIterator])}function PA(e){return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function RA(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}I(DA,"isPromise"),I(jA,"isInteropObservable"),I(LA,"isAsyncIterable"),I(PA,"createInvalidObservableTypeError"),I(RA,"getSymbolIterator");var UA=RA();function zA(e){return Pw(null==e?void 0:e[UA])}function KA(e){return Tc(this,arguments,I((function(){var t,r,n;return vc(this,(function(i){switch(i.label){case 0:t=e.getReader(),i.label=1;case 1:i.trys.push([1,,9,10]),i.label=2;case 2:return[4,kc(t.read())];case 3:return r=i.sent(),n=r.value,r.done?[4,kc(void 0)]:[3,5];case 4:return[2,i.sent()];case 5:return[4,kc(n)];case 6:return[4,i.sent()];case 7:return i.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}),"readableStreamLikeToAsyncGenerator_1"))}function FA(e){return Pw(null==e?void 0:e.getReader)}function HA(e){if(e instanceof uA)return e;if(null!=e){if(jA(e))return $A(e);if(OA(e))return VA(e);if(DA(e))return qA(e);if(LA(e))return YA(e);if(zA(e))return GA(e);if(FA(e))return JA(e)}throw PA(e)}function $A(e){return new uA((function(t){var r=e[sA]();if(Pw(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")}))}function VA(e){return new uA((function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()}))}function qA(e){return new uA((function(t){e.then((function(e){t.closed||(t.next(e),t.complete())}),(function(e){return t.error(e)})).then(null,Yw)}))}function GA(e){return new uA((function(t){var r,n;try{for(var i=Ec(e),o=i.next();!o.done;o=i.next()){var s=o.value;if(t.next(s),t.closed)return}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}t.complete()}))}function YA(e){return new uA((function(t){QA(e,t).catch((function(e){return t.error(e)}))}))}function JA(e){return YA(KA(e))}function QA(e,t){var r,n,i,o;return yc(this,void 0,void 0,(function(){var s,a;return vc(this,(function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),r=Nc(e),c.label=1;case 1:return[4,r.next()];case 2:if((n=c.sent()).done)return[3,4];if(s=n.value,t.next(s),t.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=c.sent(),i={error:a},[3,11];case 6:return c.trys.push([6,,9,10]),n&&!n.done&&(o=r.return)?[4,o.call(r)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}}))}))}function WA(e,t,r,n,i){void 0===n&&(n=0),void 0===i&&(i=!1);var o=t.schedule((function(){r(),i?e.add(this.schedule(null,n)):this.unsubscribe()}),n);if(e.add(o),!i)return o}function XA(e,t){return void 0===t&&(t=0),pA((function(r,n){r.subscribe(mA(n,(function(r){return WA(n,e,(function(){return n.next(r)}),t)}),(function(){return WA(n,e,(function(){return n.complete()}),t)}),(function(r){return WA(n,e,(function(){return n.error(r)}),t)})))}))}function ZA(e,t){return void 0===t&&(t=0),pA((function(r,n){n.add(e.schedule((function(){return r.subscribe(n)}),t))}))}function eE(e,t){return HA(e).pipe(ZA(t),XA(t))}function tE(e,t){return HA(e).pipe(ZA(t),XA(t))}function rE(e,t){return new uA((function(r){var n=0;return t.schedule((function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())}))}))}function nE(e,t){return new uA((function(r){var n;return WA(r,t,(function(){n=e[UA](),WA(r,t,(function(){var e,t,i;try{t=(e=n.next()).value,i=e.done}catch(e){return void r.error(e)}i?r.complete():r.next(t)}),0,!0)})),function(){return Pw(null==n?void 0:n.return)&&n.return()}}))}function iE(e,t){if(!e)throw new Error("Iterable cannot be null");return new uA((function(r){WA(r,t,(function(){var n=e[Symbol.asyncIterator]();WA(r,t,(function(){n.next().then((function(e){e.done?r.complete():r.next(e.value)}))}),0,!0)}))}))}function oE(e,t){return iE(KA(e),t)}function sE(e,t){if(null!=e){if(jA(e))return eE(e,t);if(OA(e))return rE(e,t);if(DA(e))return tE(e,t);if(LA(e))return iE(e,t);if(zA(e))return nE(e,t);if(FA(e))return oE(e,t)}throw PA(e)}function aE(e,t){return t?sE(e,t):HA(e)}I(zA,"isIterable"),I(KA,"readableStreamLikeToAsyncGenerator"),I(FA,"isReadableStreamLike"),I(HA,"innerFrom"),I($A,"fromInteropObservable"),I(VA,"fromArrayLike"),I(qA,"fromPromise"),I(GA,"fromIterable"),I(YA,"fromAsyncIterable"),I(JA,"fromReadableStreamLike"),I(QA,"process"),I(WA,"executeSchedule"),I(XA,"observeOn"),I(ZA,"subscribeOn"),I(eE,"scheduleObservable"),I(tE,"schedulePromise"),I(rE,"scheduleArray"),I(nE,"scheduleIterable"),I(iE,"scheduleAsyncIterable"),I(oE,"scheduleReadableStreamLike"),I(sE,"scheduled"),I(aE,"from");var cE=Rw((function(e){return I((function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}),"EmptyErrorImpl")}));function uE(e){return e instanceof Date&&!isNaN(e)}function lE(e,t){return pA((function(r,n){var i=0;r.subscribe(mA(n,(function(r){n.next(e.call(t,r,i++))})))}))}I(uE,"isValidDate"),I(lE,"map");var dE=Array.isArray;function fE(e,t){return dE(t)?e.apply(void 0,_c([],Sc(t))):e(t)}function hE(e){return lE((function(t){return fE(e,t)}))}function pE(e,t,r,n,i,o,s,a){var c=[],u=0,l=0,d=!1,f=I((function(){!d||c.length||u||t.complete()}),"checkComplete"),h=I((function(e){return u<n?p(e):c.push(e)}),"outerNext"),p=I((function(e){o&&t.next(e),u++;var a=!1;HA(r(e,l++)).subscribe(mA(t,(function(e){null==i||i(e),o?h(e):t.next(e)}),(function(){a=!0}),void 0,(function(){if(a)try{u--;for(var e=I((function(){var e=c.shift();s?WA(t,s,(function(){return p(e)})):p(e)}),"_loop_1");c.length&&u<n;)e();f()}catch(e){t.error(e)}})))}),"doInnerSub");return e.subscribe(mA(t,h,(function(){d=!0,f()}))),function(){null==a||a()}}function mE(e,t,r){return void 0===r&&(r=1/0),Pw(t)?mE((function(r,n){return lE((function(e,i){return t(r,e,n,i)}))(HA(e(r,n)))}),r):("number"==typeof t&&(r=t),pA((function(t,n){return pE(t,n,e,r)})))}function gE(e){return void 0===e&&(e=1/0),mE(aA,e)}I(fE,"callOrApply"),I(hE,"mapOneOrManyArgs"),I(pE,"mergeInternals"),I(mE,"mergeMap"),I(gE,"mergeAll");var bE=["addListener","removeListener"],yE=["addEventListener","removeEventListener"],vE=["on","off"];function wE(e,t,r,n){if(Pw(r)&&(n=r,r=void 0),n)return wE(e,t,r).pipe(hE(n));var i=Sc(xE(e)?yE.map((function(n){return function(i){return e[n](t,i,r)}})):EE(e)?bE.map(AE(e,t)):SE(e)?vE.map(AE(e,t)):[],2),o=i[0],s=i[1];if(!o&&OA(e))return mE((function(e){return wE(e,t,r)}))(HA(e));if(!o)throw new TypeError("Invalid event target");return new uA((function(e){var t=I((function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return e.next(1<t.length?t:t[0])}),"handler");return o(t),function(){return s(t)}}))}function AE(e,t){return function(r){return function(n){return e[r](t,n)}}}function EE(e){return Pw(e.addListener)&&Pw(e.removeListener)}function SE(e){return Pw(e.on)&&Pw(e.off)}function xE(e){return Pw(e.addEventListener)&&Pw(e.removeEventListener)}function ME(e,t,r){void 0===e&&(e=0),void 0===r&&(r=kA);var n=-1;return null!=t&&(CA(t)?r=t:n=t),new uA((function(t){var i=uE(e)?+e-r.now():e;i<0&&(i=0);var o=0;return r.schedule((function(){t.closed||(t.next(o++),0<=n?this.schedule(void 0,n):t.complete())}),i)}))}function _E(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=IA(e),n=BA(e,1/0),i=e;return i.length?1===i.length?HA(i[0]):gE(n)(aE(i,r)):TA}function kE(e,t){return pA((function(r,n){var i=0;r.subscribe(mA(n,(function(r){return e.call(t,r,i++)&&n.next(r)})))}))}function TE(e){return pA((function(t,r){var n=!1;t.subscribe(mA(r,(function(e){n=!0,r.next(e)}),(function(){n||r.next(e),r.complete()})))}))}function CE(e){return e<=0?function(){return TA}:pA((function(t,r){var n=0;t.subscribe(mA(r,(function(t){++n<=e&&(r.next(t),e<=n&&r.complete())})))}))}function NE(e){return void 0===e&&(e=IE),pA((function(t,r){var n=!1;t.subscribe(mA(r,(function(e){n=!0,r.next(e)}),(function(){return n?r.complete():r.error(e())})))}))}function IE(){return new cE}function BE(e,t){var r=arguments.length>=2;return function(n){return n.pipe(e?kE((function(t,r){return e(t,r,n)})):aA,CE(1),r?TE(t):NE((function(){return new cE})))}}I(wE,"fromEvent"),I(AE,"toCommonHandlerRegistry"),I(EE,"isNodeStyleEventEmitter"),I(SE,"isJQueryStyleEventEmitter"),I(xE,"isEventTarget"),I(ME,"timer"),I(_E,"merge"),I(kE,"filter"),I(TE,"defaultIfEmpty"),I(CE,"take"),I(NE,"throwIfEmpty"),I(IE,"defaultErrorFactory"),I(BE,"first");var OE,DE,jE,LE,PE,RE,UE={leading:!0,trailing:!1};function zE(e,t){return void 0===t&&(t=UE),pA((function(r,n){var i=t.leading,o=t.trailing,s=!1,a=null,c=null,u=!1,l=I((function(){null==c||c.unsubscribe(),c=null,o&&(h(),u&&n.complete())}),"endThrottling"),d=I((function(){c=null,u&&n.complete()}),"cleanupThrottling"),f=I((function(t){return c=HA(e(t)).subscribe(mA(n,l,d))}),"startThrottle"),h=I((function(){if(s){s=!1;var e=a;a=null,n.next(e),!u&&f(e)}}),"send");r.subscribe(mA(n,(function(e){s=!0,a=e,(!c||c.closed)&&(i?h():f(e))}),(function(){u=!0,(!(o&&s&&c)||c.closed)&&n.complete()})))}))}I(zE,"throttle"),(DE=OE||(OE={}))[DE.GENESIS=0]="GENESIS",DE[DE.PARTIAL=1]="PARTIAL",DE[DE.SIGNED=2]="SIGNED",(LE=jE||(jE={}))[LE.NOT_REQUESTED=0]="NOT_REQUESTED",LE[LE.PENDING=1]="PENDING",LE[LE.PROCESSING=2]="PROCESSING",LE[LE.ANCHORED=3]="ANCHORED",LE[LE.FAILED=4]="FAILED",(RE=PE||(PE={}))[RE.GENESIS=0]="GENESIS",RE[RE.SIGNED=1]="SIGNED",RE[RE.ANCHOR=2]="ANCHOR";var KE=class extends uA{constructor(e,t){super((t=>{e.subscribe(t)})),this.state$=e,this._context=t}get id(){return new Iv(this.state$.value.type,this.state$.value.log[0].cid)}get api(){return this._context.api}get metadata(){var e;const{next:t,metadata:r}=this.state$.value;return(0,Lw.default)(null!=(e=null==t?void 0:t.metadata)?e:r)}get content(){var e;const{next:t,content:r}=this.state$.value;return(0,Lw.default)(null!=(e=null==t?void 0:t.content)?e:r)}get controllers(){return this.metadata.controllers}get tip(){return this.state$.value.log[this.state$.value.log.length-1].cid}get commitId(){return Yv.make(this.id,this.tip)}get allCommitIds(){return this.state$.value.log.map((({cid:e})=>Yv.make(this.id,e)))}get anchorCommitIds(){return this.state$.value.log.filter((({type:e})=>e===PE.ANCHOR)).map((({cid:e})=>Yv.make(this.id,e)))}get state(){return(0,Lw.default)(this.state$.value)}sync(){return z(this,arguments,(function*(e={}){e=C({sync:Bw.PREFER_CACHE},e);const t=yield this.api.loadStream(this.id,e);this.state$.next(t.state)}))}requestAnchor(){return z(this,null,(function*(){return this.api.requestAnchor(this.id)}))}};function FE(){return e=>{}}I(KE,"Stream"),I(FE,"StreamStatic");var HE=R(yi(),1),$E=R(vi(),1);function VE(){globalThis.AbortController||(globalThis.AbortController=$E.AbortController),globalThis.AbortSignal||(globalThis.AbortSignal=$E.AbortSignal)}function qE(e){const t=new AbortController;if(0===e.length)throw Error("Need abort signals to create a merged abort signal");return e.some((e=>e.aborted))?(t.abort(),t.signal):(_E(...e.map((e=>wE(e,"abort")))).pipe(BE()).subscribe((()=>{t.abort()})),t.signal)}I(VE,"polyfillAbortController"),VE(),I(qE,"mergeAbortSignals");var GE=class{constructor(e){const t=new AbortController;this.signal=t.signal,e<=0?t.abort():this._subscription=ME(e).subscribe((()=>{t.abort()}))}clear(){var e;null==(e=this._subscription)||e.unsubscribe()}};I(GE,"TimedAbortSignal");function YE(e){return z(this,arguments,(function*(e,t={}){t.body&&Object.assign(t,{body:JSON.stringify(t.body),headers:{"Content-Type":"application/json"}});const r=t.timeout||18e4,n=new GE(r);t.signal=t.signal?qE([t.signal,n.signal]):n.signal;const i=yield(0,HE.default)(e,t).finally((()=>n.clear()));if(!i.ok){const t=yield i.text();throw new Error(`HTTP request to '${e}' failed with status '${i.statusText}': ${t}`)}return i.json()}))}I(YE,"fetchJson");var JE=R(bi(),1);function QE(e){const t=nr.asCID(e);if(t)return t;if("string"==typeof e)return nr.parse(e);if(e instanceof Uint8Array)return nr.decode(e);throw new Error(`${e} cannot be converted to a CID`)}vr(),I(QE,"toCID");var WE=class{static streamIdFromState(e){return new Iv(e.type,e.log[0].cid)}static serializeCommit(e){const t=(0,JE.default)(e);return WE.isSignedCommitContainer(t)?(t.jws.link=t.jws.link.toString(),t.linkedBlock=af(t.linkedBlock,"base64"),t.cacaoBlock&&(t.cacaoBlock=af(t.cacaoBlock,"base64")),t):(WE.isSignedCommit(e)&&(t.link=t.link.toString()),WE.isAnchorCommit(e)&&(t.proof=t.proof.toString()),t.id&&(t.id=t.id.toString()),t.prev&&(t.prev=t.prev.toString()),t)}static deserializeCommit(e){const t=(0,JE.default)(e);return WE.isSignedCommitContainer(t)?(t.jws.link=QE(t.jws.link),t.linkedBlock=sf(t.linkedBlock,"base64"),t.cacaoBlock&&(t.cacaoBlock=sf(t.cacaoBlock,"base64")),t):(WE.isSignedCommit(t)&&(t.link=QE(t.link)),WE.isAnchorCommit(t)&&(t.proof=QE(t.proof)),t.id&&(t.id=QE(t.id)),t.prev&&(t.prev=QE(t.prev)),t)}static serializeState(e){const t=(0,JE.default)(e);return t.log=t.log.map((e=>N(C({},e),{cid:e.cid.toString()}))),null!=t.anchorStatus&&(t.anchorStatus=jE[t.anchorStatus]),null!=t.anchorScheduledFor&&(t.anchorScheduledFor=new Date(t.anchorScheduledFor).toISOString()),null!=t.anchorProof&&(t.anchorProof.txHash=t.anchorProof.txHash.toString(),t.anchorProof.root=t.anchorProof.root.toString()),null!=t.lastAnchored&&(t.lastAnchored=t.lastAnchored.toString()),t.doctype=uv.nameByCode(t.type),t}static deserializeState(e){const t=(0,JE.default)(e);t.doctype&&(t.type=uv.codeByName(t.doctype),delete t.doctype),t.log=t.log.map((e=>N(C({},e),{cid:QE(e.cid)}))),t.anchorProof&&(t.anchorProof.txHash=QE(t.anchorProof.txHash),t.anchorProof.root=QE(t.anchorProof.root));let r=!0;return t.anchorStatus&&(t.anchorStatus=jE[t.anchorStatus],r=t.anchorStatus!==jE.FAILED&&t.anchorStatus!==jE.ANCHORED),t.anchorScheduledFor&&(r?t.anchorScheduledFor=Date.parse(t.anchorScheduledFor):delete t.anchorScheduledFor),t.lastAnchored&&(t.lastAnchored=QE(t.lastAnchored)),t}static statesEqual(e,t){return JSON.stringify(WE.serializeState(e))===JSON.stringify(WE.serializeState(t))}static isStateSupersetOf(e,t){if(e.log.length<t.log.length)return!1;for(const r in t.log)if(!e.log[r].cid.equals(t.log[r].cid))return!1;return e.anchorStatus==t.anchorStatus}static convertCommitToSignedCommitContainer(e,t){return z(this,null,(function*(){if(WE.isSignedCommit(e)){const r=yield t.block.get(e.link);return{jws:e,linkedBlock:r}}return e}))}static isSignedCommitContainer(e){return e&&void 0!==e.jws}static isSignedCommit(e){return e&&void 0!==e.link}static isAnchorCommit(e){return e&&void 0!==e.proof}static isSignedCommitData(e){return e&&void 0!==e.envelope}static isAnchorCommitData(e){return e&&void 0!==e.proof}};function XE(e){if("string"==typeof e&&e.includes("@")){const[t,r]=e.split("@");if(!t||!r)throw new Error("Invalid accountId provided");return new zg({address:t,chainId:r})}return new zg(e)}I(WE,"StreamUtils"),I(XE,"normalizeAccountId");var ZE=class extends wA{next(e){const t=this.value;WE.statesEqual(t,e)||super.next(e)}};I(ZE,"StreamStateSubject");var eS,tS={anchor:!0,publish:!0,pin:!0,sync:Bw.PREFER_CACHE},rS={sync:Bw.PREFER_CACHE},nS={anchor:!0,publish:!0,throwOnInvalidCommit:!0};function iS(e,t){var r;if("string"==typeof(null==e?void 0:e.schema))try{Yv.fromString(e.schema)}catch(e){throw new Error("Schema must be a CommitID")}const n={controllers:null==e?void 0:e.controllers,family:null==e?void 0:e.family,schema:null==(r=null==e?void 0:e.schema)?void 0:r.toString(),tags:null==e?void 0:e.tags};if(t)(null==e?void 0:e.deterministic)||(n.unique=af((0,jw.randomBytes)(12),"base64")),(null==e?void 0:e.forbidControllerChange)&&(n.forbidControllerChange=!0);else{if(void 0!==(null==e?void 0:e.deterministic)||void 0!==(null==e?void 0:e.unique))throw new Error("Cannot change 'deterministic' or 'unique' properties on existing Streams");if(void 0!==(null==e?void 0:e.forbidControllerChange))throw new Error("Cannot change 'forbidControllerChange' property on existing Streams")}return Object.keys(n).forEach((e=>void 0===n[e]&&delete n[e])),n}function oS(e){return z(this,null,(function*(){if(null==e.did)throw new Error("No DID provided");e.did.authenticated||(yield e.did.authenticate(),e.loggerProvider&&e.loggerProvider.getDiagnosticsLogger().imp(`Now authenticated as DID ${e.did.id}`))}))}function sS(e,t){return z(this,null,(function*(){return yield oS(e),e.did.createDagJWS(t)}))}function aS(){return z(this,null,(function*(){throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")}))}I(iS,"headerFromMetadata"),I(oS,"_ensureAuthenticated"),I(sS,"_signDagJWS"),I(aS,"throwReadOnlyError");var cS=eS=I(class extends KE{constructor(){super(...arguments),this._isReadOnly=!1}get content(){return super.content}static create(e,t,r){return z(this,arguments,(function*(e,t,r,n={}){n=C(C({},tS),n),(null==r?void 0:r.deterministic)||null!=n.syncTimeoutSeconds||(n.syncTimeoutSeconds=0);const i=n.asDID?{did:n.asDID}:e,o=yield eS.makeGenesis(i,t,r);return e.createStreamFromGenesis(eS.STREAM_TYPE_ID,o,n)}))}static createFromGenesis(e,t){return z(this,arguments,(function*(e,t,r={}){var n;r=C(C({},tS),r),(null==(n=t.header)?void 0:n.unique)&&null==r.syncTimeoutSeconds&&(r.syncTimeoutSeconds=0);const i=t.data?yield sS(e,t):t;return e.createStreamFromGenesis(eS.STREAM_TYPE_ID,i,r)}))}static deterministic(e,t){return z(this,arguments,(function*(e,t,r={}){if(r=C(C({},tS),r),null==(t=N(C({},t),{deterministic:!0})).family&&null==t.tags)throw new Error("Family and/or tags are required when creating a deterministic tile document");const n=yield eS.makeGenesis(e,null,t);return e.createStreamFromGenesis(eS.STREAM_TYPE_ID,n,r)}))}static load(e,t){return z(this,arguments,(function*(e,t,r={}){r=C(C({},rS),r);const n=Gv.from(t);if(n.type!=eS.STREAM_TYPE_ID)throw new Error(`StreamID ${n.toString()} does not refer to a '${eS.STREAM_TYPE_NAME}' stream, but to a ${n.typeName}`);return e.loadStream(n,r)}))}update(e,t){return z(this,arguments,(function*(e,t,r={}){const n=(r=C(C({},nS),r)).asDID?{did:r.asDID}:this.api,i=yield this.makeCommit(n,e,t),o=yield this.api.applyCommit(this.id,i,r);this.state$.next(o.state)}))}patch(e){return z(this,arguments,(function*(e,t={}){t=C(C({},nS),t);const r={header:iS(this.metadata,!1),data:e,prev:this.tip,id:this.state$.id.cid},n=yield sS(this.api,r),i=yield this.api.applyCommit(this.id,n,t);this.state$.next(i.state)}))}makeReadOnly(){this.update=aS,this.patch=aS,this.sync=aS,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}makeCommit(e,t,r){return z(this,null,(function*(){var n;const i=iS(r,!1);if(null==t&&(t=this.content),i.controllers&&1!==(null==(n=i.controllers)?void 0:n.length))throw new Error("Exactly one controller must be specified");const o={header:i,data:Dw.compare(this.content,t),prev:this.tip,id:this.state.log[0].cid};return sS(e,o)}))}static makeGenesis(e,t,r){return z(this,null,(function*(){var n;if(r||(r={}),!r.controllers||0===r.controllers.length){if(!e.did)throw new Error("No controllers specified");yield oS(e),r.controllers=[e.did.hasParent?e.did.parent:e.did.id]}if(1!==(null==(n=r.controllers)?void 0:n.length))throw new Error("Exactly one controller must be specified");const i=iS(r,!0);if((null==r?void 0:r.deterministic)&&t)throw new Error("Initial content must be null when creating a deterministic Tile document");if(null==t){const e={header:i};return Qm(e),e}return sS(e,{data:t,header:i})}))}},"TileDocument");cS.STREAM_TYPE_NAME="tile",cS.STREAM_TYPE_ID=0,cS=eS=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s}([e=>{}],cS);var uS=R(wi(),1);function lS(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function dS(e,t){return t.get?t.get.call(e):t.value}function fS(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}function hS(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}function pS(e,t){return dS(e,hS(e,t,"get"))}function mS(e,t,r){lS(e,t),t.set(e,r)}function gS(e,t,r){return fS(e,hS(e,t,"set"),r),r}function bS(e){return"string"==typeof e||Yv.isInstance(e)||Iv.isInstance(e)?{streamId:e}:{streamId:e.streamId,genesis:e.genesis}}function yS(e){return"string"==typeof e?Gv.from(e).toString():Yv.isInstance(e)||Iv.isInstance(e)?e.toString():e.streamId.toString()}function vS(e){return z(this,null,(function*(){const t=yield cS.makeGenesis({},null,N(C({},e),{deterministic:!0}));return{genesis:t,streamId:yield Iv.fromGenesis("tile",t)}}))}I(lS,"_checkPrivateRedeclaration"),I(dS,"_classApplyDescriptorGet"),I(fS,"_classApplyDescriptorSet"),I(hS,"_classExtractFieldDescriptor"),I(pS,"_classPrivateFieldGet"),I(mS,"_classPrivateFieldInit"),I(gS,"_classPrivateFieldSet"),I(bS,"keyToQuery"),I(yS,"keyToString"),I(vS,"getDeterministicQuery");var wS=I((()=>Promise.resolve([])),"tempBatchLoadFn"),AS=new WeakMap,ES=new WeakMap,SS=class extends uS.default{cache(e){if(!pS(this,ES))return!1;const t=e.id.toString();return this.clear(t).prime(t,e),!0}create(e,t,r){return z(this,null,(function*(){const n=yield cS.create(pS(this,AS),e,t,r);return this.cache(n),n}))}deterministic(e,t){return z(this,null,(function*(){const r=yield vS(e);try{return yield U(SS.prototype,this,"load").call(this,r)}catch(e){const n=yield cS.createFromGenesis(pS(this,AS),r.genesis,t);return this.cache(n),n}}))}load(e){return z(this,null,(function*(){return yield U(SS.prototype,this,"load").call(this,e)}))}update(e,t,r,n){return z(this,null,(function*(){const i=yS(e);this.clear(i);const o=yield this.load({streamId:i});return yield o.update(t,r,n),o}))}constructor(e){super(wS,{cache:!0,cacheKeyFn:yS,cacheMap:null!=e.cache&&"boolean"!=typeof e.cache?e.cache:void 0}),mS(this,AS,{writable:!0,value:void 0}),mS(this,ES,{writable:!0,value:void 0}),this._batchLoadFn=t=>z(this,null,(function*(){e.cache||this.clearAll();const r=yield e.ceramic.multiQuery(t.map(bS),e.multiqueryTimeout);return t.map((e=>{const t=yS(e),n=r[t];return n||new Error(`Failed to load stream: ${t}`)}))})),gS(this,AS,e.ceramic),gS(this,ES,!!e.cache)}};function xS(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function MS(e,t){return t.get?t.get.call(e):t.value}function _S(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}function kS(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}function TS(e,t){return MS(e,kS(e,t,"get"))}function CS(e,t,r){xS(e,t),t.set(e,r)}function NS(e,t,r){return _S(e,kS(e,t,"set"),r),r}I(SS,"TileLoader"),I(xS,"_checkPrivateRedeclaration"),I(MS,"_classApplyDescriptorGet"),I(_S,"_classApplyDescriptorSet"),I(kS,"_classExtractFieldDescriptor"),I(TS,"_classPrivateFieldGet"),I(CS,"_classPrivateFieldInit"),I(NS,"_classPrivateFieldSet");var IS=new WeakMap,BS=new WeakMap,OS=class{get aliases(){return TS(this,IS)}get loader(){return TS(this,BS)}getDefinitionID(e){var t;return null!=(t=TS(this,IS).definitions[e])?t:null}getSchemaURL(e){var t;return null!=(t=TS(this,IS).schemas[e])?t:null}getTileID(e){var t;return null!=(t=TS(this,IS).tiles[e])?t:null}loadTile(e){return z(this,null,(function*(){const t=this.getTileID(e);if(null==t)throw new Error(`Tile alias "${e}" is not defined`);return yield TS(this,BS).load(t)}))}createTile(e,t){return z(this,arguments,(function*(e,t,r={}){const n=this.getSchemaURL(e);if(null==n)throw new Error(`Schema alias "${e}" is not defined`);const i=r,{controller:o}=i,s=O(i,["controller"]),a={schema:n};return null!=o&&(a.controllers=[o]),yield TS(this,BS).create(t,a,s)}))}constructor(e){if(CS(this,IS,{writable:!0,value:void 0}),CS(this,BS,{writable:!0,value:void 0}),NS(this,IS,e.aliases),null!=e.loader)NS(this,BS,e.loader);else{if(null==e.ceramic)throw new Error("Invalid DataModel parameters: missing ceramic or loader");NS(this,BS,new SS({ceramic:e.ceramic,cache:e.cache}))}}};function DS(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function jS(e,t){return t.get?t.get.call(e):t.value}function LS(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}function PS(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}function RS(e,t){return jS(e,PS(e,t,"get"))}function US(e,t,r){DS(e,t),t.set(e,r)}function zS(e,t,r){return LS(e,PS(e,t,"set"),r),r}I(OS,"DataModel"),I(DS,"_checkPrivateRedeclaration"),I(jS,"_classApplyDescriptorGet"),I(LS,"_classApplyDescriptorSet"),I(PS,"_classExtractFieldDescriptor"),I(RS,"_classPrivateFieldGet"),I(US,"_classPrivateFieldInit"),I(zS,"_classPrivateFieldSet");var KS=new WeakMap,FS=new WeakMap,HS=new WeakMap,$S=new WeakMap,VS=class{_createValuePromise(){zS(this,HS,new Promise(((e,t)=>{zS(this,$S,{resolve:e,reject:t})})))}change(e){return new Promise(((t,r)=>{const n=I((n=>z(this,null,(function*(){try{const r=yield e(n);t(),this._next(r)}catch(e){r(e),this._next(n)}}))),"run");RS(this,FS).push({reject:r,run:n}),1===RS(this,FS).length&&this._start()}))}changeContent(e){return z(this,null,(function*(){const t=I((t=>z(this,null,(function*(){return yield t.update(e(t.content),t.metadata),t}))),"mutation");return yield this.change(t)}))}get(){return z(this,null,(function*(){return 0===RS(this,FS).length?yield RS(this,KS).call(this):yield RS(this,HS)}))}_start(){return z(this,null,(function*(){try{const e=yield RS(this,KS).call(this);this._next(e)}catch(e){RS(this,FS).forEach((t=>{t.reject(e)})),zS(this,FS,[]),RS(this,$S).reject(e),this._createValuePromise()}}))}_next(e){const t=RS(this,FS).shift();null==t?this._end(e):t.run(e)}_end(e){RS(this,$S).resolve(e),this._createValuePromise()}constructor(e){US(this,KS,{writable:!0,value:void 0}),US(this,FS,{writable:!0,value:[]}),US(this,HS,{writable:!0,value:void 0}),US(this,$S,{writable:!0,value:void 0}),zS(this,KS,e),this._createValuePromise()}};I(VS,"TileProxy");var qS=/^did:([A-Za-z0-9]+):([A-Za-z0-9.\-:_]+)$/;function GS(e){return qS.test(e)}function YS(e){if(!GS(e))throw new Error(`Invalid DID: ${e}`)}function JS(e){return YS(e),{controllers:[e],family:"IDX"}}function QS(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function WS(e,t){return t.get?t.get.call(e):t.value}function XS(e,t,r){if(t.set)t.set.call(e,r);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=r}}function ZS(e,t,r){if(!t.has(e))throw new TypeError("attempted to "+r+" private field on non-instance");return t.get(e)}function ex(e,t){return WS(e,ZS(e,t,"get"))}function tx(e,t,r){QS(e,t),t.set(e,r)}function rx(e,t,r){return XS(e,ZS(e,t,"set"),r),r}I(GS,"isDIDstring"),I(YS,"assertDIDstring"),I(JS,"getIDXMetadata"),I(QS,"_checkPrivateRedeclaration"),I(WS,"_classApplyDescriptorGet"),I(XS,"_classApplyDescriptorSet"),I(ZS,"_classExtractFieldDescriptor"),I(ex,"_classPrivateFieldGet"),I(tx,"_classPrivateFieldInit"),I(rx,"_classPrivateFieldSet");var nx=new WeakMap,ix=new WeakMap,ox=new WeakMap,sx=new WeakMap,ax=new WeakMap,cx=class{get authenticated(){return null!=ex(this,nx).did}get ceramic(){return ex(this,nx)}get id(){if(null!=ex(this,ix))return ex(this,ix);if(null==ex(this,nx).did)throw new Error("Ceramic instance is not authenticated");return ex(this,nx).did.hasParent?ex(this,nx).did.parent:ex(this,nx).did.id}get loader(){return ex(this,sx)}get model(){return ex(this,ax)}has(e,t){return z(this,null,(function*(){const r=this.getDefinitionID(e);return null!=(yield this.getRecordID(r,t))}))}get(e,t){return z(this,null,(function*(){const r=this.getDefinitionID(e);return yield this.getRecord(r,t)}))}getMultiple(e,t){return z(this,null,(function*(){var r,n,i;const o=this.getDefinitionID(e),s=yield Promise.all(t.map((e=>z(this,null,(function*(){const{genesis:t,streamId:r}=yield vS(JS(e));return{genesis:t,streamId:r.toString(),paths:[o]}}))))),a=yield ex(this,nx).multiQuery(s),c=[];for(const e of s){const t=null==(n=null==(r=a[e.streamId])?void 0:r.content)?void 0:n[o],s=t?a[Iv.fromString(t).toString()]:null;c.push(null!=(i=null==s?void 0:s.content)?i:null)}return c}))}set(e,t){return z(this,arguments,(function*(e,t,r={}){var n;const i=this.getDefinitionID(e),[o,s]=yield this._setRecordOnly(i,t,r);return o&&(yield this._setReference(null!=(n=r.controller)?n:this.id,i,s)),s}))}merge(e,t){return z(this,arguments,(function*(e,t,r={}){const n=this.getDefinitionID(e),i=yield this.getRecord(n),o=i?C(C({},i),t):t;return yield this.setRecord(n,o,r)}))}setAll(e){return z(this,arguments,(function*(e,t={}){var r;const n=Object.entries(e).map((e=>z(this,[e],(function*([e,r]){const n=this.getDefinitionID(e),[i,o]=yield this._setRecordOnly(n,r,t);return[i,n,o]})))),i=(yield Promise.all(n)).reduce(((e,[t,r,n])=>(t&&(e[r]=n.toUrl()),e)),{});return yield this._setReferences(null!=(r=t.controller)?r:this.id,i),i}))}setDefaults(e){return z(this,arguments,(function*(e,t={}){var r,n;const i=null!=(r=yield this.getIndex())?r:{},o=Object.entries(e).map((([e,t])=>[this.getDefinitionID(e),t])).filter((e=>null==i[e[0]])).map((e=>z(this,[e],(function*([e,r]){const n=yield this.getDefinition(e);return{[e]:(yield this._createRecord(n,r,t)).toUrl()}})))),s=(yield Promise.all(o)).reduce(((e,t)=>Object.assign(e,t)),{});return yield this._setReferences(null!=(n=t.controller)?n:this.id,s),s}))}remove(e){return z(this,arguments,(function*(e,t=this.id){yield this._getIndexProxy(t).changeContent((t=>(null!=t&&delete t[this.getDefinitionID(e)],t)))}))}getIndex(){return z(this,arguments,(function*(e=this.id){const t=this.authenticated&&e===this.id?yield this._getIndexProxy(e).get():yield this._getIDXDoc(e);return t?t.content:null}))}iterator(e){let t,r=0;return{[Symbol.asyncIterator](){return this},next:()=>z(this,null,(function*(){if(null==t){const r=yield this.getIndex(e);t=Object.entries(null!=r?r:{})}if(r===t.length)return{done:!0,value:null};const[n,i]=t[r++];return{done:!1,value:{key:n,id:i,record:(yield ex(this,sx).load(i)).content}}}))}}_createIDXDoc(e){return z(this,null,(function*(){return yield ex(this,sx).deterministic(JS(e))}))}_getIDXDoc(e){return z(this,null,(function*(){const t=yield this._createIDXDoc(e);if(null==t.content||null==t.metadata.schema)return null;if(t.metadata.schema!==Jv)throw new Error("Invalid document: schema is not IdentityIndex");return t}))}_getOwnIDXDoc(e){return z(this,null,(function*(){const t=yield this._createIDXDoc(e);if(null==t.content||null==t.metadata.schema)yield t.update({},{schema:Jv});else if(t.metadata.schema!==Jv)throw new Error("Invalid document: schema is not IdentityIndex");return t}))}_getIndexProxy(e){let t=ex(this,ox)[e];return null==t&&(t=new VS((()=>z(this,null,(function*(){return yield this._getOwnIDXDoc(e)})))),ex(this,ox)[e]=t),t}getDefinitionID(e){var t;return null!=(t=ex(this,ax).getDefinitionID(e))?t:e}getDefinition(e){return z(this,null,(function*(){const t=yield ex(this,sx).load(e);if("ceramic://k3y52l7qbv1fry1fp4s0nwdarh0vahusarpposgevy0pemiykymd2ord6swtharcw"!==t.metadata.schema)throw new Error("Invalid document: schema is not Definition");return N(C({},t.content),{id:t.id})}))}getRecordID(e,t){return z(this,null,(function*(){var r;const n=yield this.getIndex(null!=t?t:this.id);return null!=(r=null==n?void 0:n[e])?r:null}))}getRecordDocument(e,t){return z(this,null,(function*(){const r=yield this.getRecordID(e,t);return r?yield ex(this,sx).load(r):null}))}getRecord(e,t){return z(this,null,(function*(){const r=yield this.getRecordDocument(e,t);return r?r.content:null}))}setRecord(e,t){return z(this,arguments,(function*(e,t,r={}){var n;const[i,o]=yield this._setRecordOnly(e,t,r);return i&&(yield this._setReference(null!=(n=r.controller)?n:this.id,e,o)),o}))}_setRecordOnly(e,t,r){return z(this,null,(function*(){var n;const i=yield this.getRecordID(e,null!=(n=r.controller)?n:this.id);if(null==i){const n=yield this.getDefinition(e);return[!0,yield this._createRecord(n,t,r)]}return[!1,(yield ex(this,sx).update(i,t)).id]}))}_createRecord(e,t,r){return z(this,arguments,(function*(e,t,{controller:r,pin:n}){const i=yield ex(this,sx).deterministic({controllers:[null!=r?r:this.id],family:e.id.toString()},{pin:n});return yield i.update(t,{schema:e.schema}),i.id}))}_setReference(e,t,r){return z(this,null,(function*(){yield this._getIndexProxy(e).changeContent((e=>N(C({},e),{[t]:r.toUrl()})))}))}_setReferences(e,t){return z(this,null,(function*(){0!==Object.keys(t).length&&(yield this._getIndexProxy(e).changeContent((e=>C(C({},e),t))))}))}constructor(e){tx(this,nx,{writable:!0,value:void 0}),tx(this,ix,{writable:!0,value:void 0}),tx(this,ox,{writable:!0,value:{}}),tx(this,sx,{writable:!0,value:void 0}),tx(this,ax,{writable:!0,value:void 0});const{cache:t,ceramic:r,id:n,loader:i,model:o}=e;rx(this,nx,r),rx(this,ix,n),rx(this,sx,null!=i?i:new SS({ceramic:r,cache:t})),rx(this,ax,o instanceof OS?o:new OS({loader:ex(this,sx),aliases:o}))}};function ux(e){return"string"==typeof e?Iv.fromString(e):e}function lx(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}I(cx,"DIDDataStore"),I(ux,"typeStreamID"),I(lx,"combineURLs");var dx=R(Mi(),1),fx=class extends uA{constructor(e,t,r){super((e=>{0===this.state$.observers.length&&(this.periodicSubscription=ME(0,r).pipe(zE((()=>this._syncState(this.id,{sync:Bw.PREFER_CACHE})))).subscribe()),this.state$.subscribe(e).add((()=>{var e;0===this.state$.observers.length&&(null==(e=this.periodicSubscription)||e.unsubscribe())}))})),this._apiUrl=t,this.state$=new ZE(e)}get value(){return this.state$.value}get state(){return this.state$.value}next(e){this.state$.next(e)}_syncState(e,t){return z(this,null,(function*(){const r=yield fx._load(e,this._apiUrl,t);this.state$.next(WE.deserializeState(r))}))}get id(){return new Iv(this.state$.value.type,this.state$.value.log[0].cid)}static createFromGenesis(e,t,r,n,i){return z(this,null,(function*(){const{state:o}=yield YE(e+"/streams",{method:"post",body:{type:t,genesis:WE.serializeCommit(r),opts:n}});return new fx(WE.deserializeState(o),e,i)}))}static applyCommit(e,t,r,n,i){return z(this,null,(function*(){const{state:o}=yield YE(e+"/commits",{method:"post",body:{streamId:t.toString(),commit:WE.serializeCommit(r),opts:n}});return new fx(WE.deserializeState(o),e,i)}))}static _load(e,t,r){return z(this,null,(function*(){const n=t+"/streams/"+e.toString()+"?"+dx.default.stringify(r),{state:i}=yield YE(n);return i}))}static load(e,t,r,n){return z(this,null,(function*(){const i=yield fx._load(e,t,n);return new fx(WE.deserializeState(i),t,r)}))}static loadStreamCommits(e,t){return z(this,null,(function*(){const{commits:r}=yield YE(`${t}/commits/${e}`);return r.map((e=>({cid:e.cid,value:WE.deserializeCommit(e.value)})))}))}complete(){this.state$.complete()}};I(fx,"Document");var hx,px=I((()=>{throw new Error("Historical stream commits cannot be modified. Load the stream without specifying a commit to make updates.")}),"throwReadOnlyError"),mx={anchor:!1,publish:!0,pin:!0,sync:Bw.PREFER_CACHE},gx={anchor:!0,publish:!0,throwOnInvalidCommit:!0},bx={sync:Bw.PREFER_CACHE},yx=hx=I(class extends KE{constructor(){super(...arguments),this._isReadOnly=!1}get did(){return this.content}static fromAccount(e,t){return z(this,arguments,(function*(e,t,r={}){r=C(C({},mx),r);const n=XE(t),i=hx.makeGenesis(n);return hx.fromGenesis(e,i,r)}))}static fromGenesis(e,t){return z(this,arguments,(function*(e,t,r={}){return r=C(C({},mx),r),e.createStreamFromGenesis(hx.STREAM_TYPE_ID,t,r)}))}setDid(e,t){return z(this,arguments,(function*(e,t,r={}){r=C(C({},gx),r);const n="string"==typeof e?e.trim():e.id,i=Qd(n);if((null==i?void 0:i.did)!==n)throw new Error(`DID is not valid: '${n}'`);const o=yield t.createLink(n);return this.setDidProof(o,r)}))}setDidProof(e){return z(this,arguments,(function*(e,t={}){t=C(C({},gx),t);const r=this.makeCommit(e),n=yield this.api.applyCommit(this.id,r,t);this.state$.next(n.state)}))}clearDid(e){return z(this,arguments,(function*(e,t={}){t=C(C({},gx),t);const r=yield e.createLink("");return this.setDidProof(r,t)}))}static load(e,t){return z(this,arguments,(function*(e,t,r={}){r=C(C({},bx),r);const n=Gv.from(t);if(n.type!=hx.STREAM_TYPE_ID)throw new Error(`StreamID ${n.toString()} does not refer to a '${hx.STREAM_TYPE_NAME}' stream, but to a ${n.typeName}`);return e.loadStream(n,r)}))}static makeGenesis(e){"eip155"===e.chainId.namespace&&(e.address=e.address.toLowerCase());return{header:{controllers:[`${e.address}@${e.chainId.toString()}`],family:`caip10-${e.chainId.toString()}`}}}makeCommit(e){return{data:e,prev:this.tip,id:this.state$.id.cid}}makeReadOnly(){this.setDidProof=px,this.setDid=px,this.sync=px,this._isReadOnly=!0}get isReadOnly(){return this._isReadOnly}},"Caip10Link");yx.STREAM_TYPE_NAME="caip10-link",yx.STREAM_TYPE_ID=1,yx=hx=function(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s}([e=>{}],yx);var vx=class{constructor(e){this._apiUrl=e}add(e,t){return z(this,null,(function*(){const r={};t&&(r.force=!0),yield YE(this._apiUrl+`/pins/${e.toString()}`,{method:"post",body:r})}))}rm(e,t){return z(this,null,(function*(){yield YE(this._apiUrl+`/pins/${e.toString()}`,{method:"delete",body:{opts:t}})}))}ls(e){return z(this,null,(function*(){let t=this._apiUrl+"/pins";e&&(t+=`/${e.toString()}`);const r=yield YE(t),{pinnedStreamIds:n}=r;return{[Symbol.asyncIterator](){let e=0;return{next:()=>e===n.length?Promise.resolve({value:null,done:!0}):Promise.resolve({value:n[e++],done:!1})}}}}))}};I(vx,"RemotePinApi");var wx={syncInterval:5e3},Ax={anchor:!0,publish:!0,sync:Bw.PREFER_CACHE},Ex={anchor:!0,publish:!0,sync:Bw.PREFER_CACHE},Sx={sync:Bw.PREFER_CACHE},xx=class{constructor(e="http://localhost:7007",t={}){this._config=C(C({},wx),t),this._apiUrl=lx(e,"/api/v0"),this._streamCache=new Map,this.context={api:this},this.pin=new vx(this._apiUrl),this._streamConstructors={[cS.STREAM_TYPE_ID]:cS,[yx.STREAM_TYPE_ID]:yx}}get did(){return this.context.did}set did(e){this.context.did=e}createStreamFromGenesis(e,t){return z(this,arguments,(function*(e,t,r={}){r=C(C({},Ex),r);const n=yield fx.createFromGenesis(this._apiUrl,e,t,r,this._config.syncInterval),i=this._streamCache.get(n.id.toString());return i?(WE.statesEqual(n.state,i.state)||i.next(n.state),this.buildStream(i)):(this._streamCache.set(n.id.toString(),n),this.buildStream(n))}))}loadStream(e){return z(this,arguments,(function*(e,t={}){t=C(C({},Sx),t);const r=Gv.from(e);let n=this._streamCache.get(r.baseID.toString());return n?yield n._syncState(r,t):(n=yield fx.load(r,this._apiUrl,this._config.syncInterval,t),this._streamCache.set(n.id.toString(),n)),this.buildStream(n)}))}multiQuery(e,t){return z(this,null,(function*(){const r=e.map((e=>N(C({},e),{streamId:"string"==typeof e.streamId?e.streamId:e.streamId.toString()}))),n=yield YE(this._apiUrl+"/multiqueries",{method:"post",body:C({queries:r},{timeout:t})});return Object.entries(n).reduce(((e,t)=>{const[r,n]=t,i=WE.deserializeState(n),o=new fx(i,this._apiUrl,this._config.syncInterval);return e[r]=this.buildStream(o),e}),{})}))}loadStreamCommits(e){const t=ux(e);return fx.loadStreamCommits(t,this._apiUrl)}applyCommit(e,t){return z(this,arguments,(function*(e,t,r={}){r=C(C({},Ax),r);const n=ux(e),i=yield fx.applyCommit(this._apiUrl,n,t,r,this._config.syncInterval),o=this._streamCache.get(n.toString());return o?(o.next(i.state),this.buildStream(i)):(this._streamCache.set(n.toString(),i),this.buildStream(i))}))}requestAnchor(e){return z(this,arguments,(function*(e,t={}){t=C(C({},Sx),t);const{anchorStatus:r}=yield YE(`${this._apiUrl}/streams/${e.toString()}/anchor`,{method:"post",body:{opts:t}});return r}))}addStreamHandler(e){this._streamConstructors[e.name]=e.stream_constructor}findStreamConstructor(e){const t=this._streamConstructors[e];if(t)return t;throw new Error(`Failed to find constructor for stream ${e}`)}buildStream(e){return new(this.findStreamConstructor(e.state.type))(e,this.context)}setDID(e){return z(this,null,(function*(){this.context.did=e}))}getSupportedChains(){return z(this,null,(function*(){if(this._supportedChains)return this._supportedChains;const{supportedChains:e}=yield YE(this._apiUrl+"/node/chains");return this._supportedChains=e,e}))}close(){return z(this,null,(function*(){Array.from(this._streamCache).map((([,e])=>{e.complete()})),this._streamCache.clear()}))}};I(xx,"CeramicClient");var Mx=I(((e,t)=>z(void 0,null,(function*(){var r,n;const i=new xx(t),o=C({},Wy.default.getResolver()),s=new Qy({resolver:o});i.did=s;const a=JSON.parse(JSON.stringify(e.contents)),c=null!=(n=null==(r=null==a?void 0:a.find((e=>"DID Key Secret"===(null==e?void 0:e.name))))?void 0:r.value)?n:"",u=new ov(_i(c));return i.did.setProvider(u),yield i.did.authenticate(),i}))),"getCeramicClientFromWalletSuite"),_x=I(((e,t)=>z(void 0,[e,t],(function*(e,{modelData:t,credentialAlias:r,ceramicEndpoint:n,defaultContentFamily:i}){const o=yield Mx(e,n),s=new SS({ceramic:o}),a=new cx({ceramic:o,model:t}),c=I(((...e)=>z(void 0,[...e],(function*(e=r){return(yield a.get(e))||{credentials:[]}}))),"getCredentialsListFromIndex"),u=I(((e,t)=>z(void 0,null,(function*(){if(!e)throw new Error("record is required");if(!e.id)throw Error("No streamId provided");-1===e.id.indexOf("ceramic://")&&(e.id="ceramic://"+e.id),t||(t=r);const n=yield c(t);return n.credentials.push(C({storageType:"ceramic"},e)),a.set(t,n)}))),"addCredentialStreamIdToIndex"),l=I(((e,...t)=>z(void 0,[e,...t],(function*(e,t={},r={}){if(!e)throw new Error("content is required");t.controllers||(t.controllers=[o.did.id]),t.family||(t.family=i),"pin"in r||(r.pin=!0);return(yield cS.create(o,e,t,r)).id.toString()}))),"publishContentToCeramic"),d=I((e=>z(void 0,null,(function*(){var t;return null==(t=yield s.load(e))?void 0:t.content}))),"readContentFromCeramic");return{pluginMethods:{getCredentialsListFromIndex:(e,...t)=>z(void 0,[e,...t],(function*(e,t=r){return c(t)})),publishContentToCeramic:(e,t)=>z(void 0,null,(function*(){return l(t)})),readContentFromCeramic:(e,t)=>z(void 0,null,(function*(){return d(t)})),getVerifiableCredentialFromIndex:(e,t)=>z(void 0,null,(function*(){var e;const r=yield c(),n=null==(e=null==r?void 0:r.credentials)?void 0:e.find((e=>(null==e?void 0:e.title)===t));return n&&(yield d(n.id))})),getVerifiableCredentialsFromIndex:()=>z(void 0,null,(function*(){var e,t;const r=yield c(),n=null!=(t=null==(e=null==r?void 0:r.credentials)?void 0:e.map((e=>null==e?void 0:e.id)))?t:[];return Promise.all(n.map((e=>z(void 0,null,(function*(){return d(e)})))))})),addVerifiableCredentialInIdx:(e,t)=>z(void 0,[e,t],(function*(e,{title:t,id:r}){return u({title:t,id:r})}))},pluginConstants:{}}}))),"getIDXPlugin"),kx=I((e=>z(void 0,null,(function*(){const t=yield Ud.subtle.digest("SHA-256",e);return`urn:digest:${Buffer.from(new Uint8Array(t)).toString("hex")}`}))),"seedToId"),Tx={pluginMethods:{getSubjectDid:e=>{var t,r;return null!=(r=null==(t=e.contents.find((e=>"Signing Key"===e.name)))?void 0:t.controller)?r:""},getSubjectKeypair:e=>{var t;return null==(t=e.contents.find((e=>"Signing Key"===e.name)))?void 0:t.privateKeyJwk}},pluginConstants:{generateContentFromSeed:I((e=>z(void 0,null,(function*(){const t=JSON.parse(Yi(e)),r=Ji("key",JSON.stringify(t)),n=O(t,["d"]),i={controller:r,id:`${r}#${r.split(":").at(-1)}`,privateKeyJwk:t,publicKeyJwk:n,type:"JsonWebKey2020"},o={"@context":["http://w3id.org/wallet/v1"],id:yield kx(e),name:"DID Key Secret",image:"https://via.placeholder.com/150",description:"Used to generate a DID with a signing and encryption key.",tags:["inception"],type:"Entropy",value:Buffer.from(e).toString("hex")};return[o,N(C({},i),{"@context":["http://w3id.org/wallet/v1"],name:"Signing Key",image:"https://via.placeholder.com/150",description:"Used to produce digital signatures.",tags:["inception"],generatedFrom:[o.id]})]}))),"generateContentFromSeed")}},Cx=I((e=>({pluginMethods:{verifyCredential:(t,r)=>z(void 0,null,(function*(){const t=yield e.pluginMethods.verifyCredential(r);return r.expirationDate&&(t.checks.push("expiration"),new Date>new Date(r.expirationDate)&&t.errors.push("expiration error: Credential is expired")),t}))},pluginConstants:{}})),"ExpirationPlugin"),Nx=I(((e,t)=>z(void 0,null,(function*(){const r=e.pluginMethods.getSubjectKeypair();if(!r)throw new Error("Cannot issue credential: Could not get subject keypair");const n=JSON.stringify(r),i=JSON.stringify({verificationMethod:yield Qi("key",n),proofPurpose:"assertionMethod"});return JSON.parse(yield Wi(JSON.stringify(t),i,n))}))),"issueCredential"),Ix=I((e=>z(void 0,null,(function*(){return JSON.parse(yield Xi(JSON.stringify(e),"{}"))}))),"verifyCredential"),Bx=I(((e,t)=>z(void 0,null,(function*(){const r=e.pluginMethods.getSubjectDid();if(!r)throw new Error("Cannot create presentation: No holder key found");const n=r,i=e.pluginMethods.getSubjectKeypair();if(!i)throw new Error("Cannot issue credential: Could not get subject keypair");const o=JSON.stringify(i),s=JSON.stringify({verificationMethod:yield Qi("key",o),proofPurpose:"assertionMethod"}),a=JSON.stringify({"@context":["https://www.w3.org/2018/credentials/v1"],type:["VerifiablePresentation"],holder:n,verifiableCredential:t});return JSON.parse(yield Zi(a,s,o))}))),"issuePresentation"),Ox=I((e=>z(void 0,null,(function*(){return JSON.parse(yield eo(JSON.stringify(e),"{}"))}))),"verifyPresentation"),Dx=I((e=>z(void 0,null,(function*(){return{pluginMethods:N(C({},e.pluginMethods),{issueCredential:Nx,verifyCredential:(e,t)=>z(void 0,null,(function*(){return Ix(t)})),issuePresentation:Bx,verifyPresentation:(e,t)=>z(void 0,null,(function*(){return Ox(t)})),getTestVc:(e,t="did:example:d23dd687a7dc6787646f2eb98d0")=>({"@context":"https://www.w3.org/2018/credentials/v1",id:"http://example.org/credentials/3731",type:["VerifiableCredential"],issuer:e.pluginMethods.getSubjectDid(),issuanceDate:"2020-08-19T21:41:50Z",credentialSubject:{id:t}})}),pluginConstants:{}}}))),"getVCPlugin"),jx=(e=>(e.Success="Success",e.Failed="Failed",e.Error="Error",e))(jx||{}),Lx=I((e=>t=>z(void 0,null,(function*(){const r=yield e.pluginMethods.verifyCredential(t),n=[];return r.errors.forEach((e=>{n.push({status:jx.Failed,check:"hmm",details:e})})),r.warnings.forEach((e=>{n.push({status:jx.Error,check:"hmm",message:e})})),r.checks.forEach((e=>{n.push({status:jx.Success,check:e,message:"proof"===e?"Valid":e})})),n}))),"verifyCredential"),Px={modelData:{definitions:{MyVerifiableCredentials:"kjzl6cwe1jw14am5tu5hh412s19o4zm8aq3g2lpd6s4paxj2nly2lj4drp3pun2"},schemas:{AchievementVerifiableCredential:"ceramic://k3y52l7qbv1frylibw2725v8gem3hxs1onoh6pvux0szdduugczh0hddxo6qsd6o0",VerifiableCredentialsList:"ceramic://k3y52l7qbv1frxkcwfpyauky3fyl4n44izridy3blvjjzgftis40sk9w8g3remghs"},tiles:{}},credentialAlias:"MyVerifiableCredentials",ceramicEndpoint:"https://ceramic-node.welibrary.io:7007",defaultContentFamily:"SuperSkills"},Rx=I(((e,...t)=>z(void 0,[e,...t],(function*(e,{ceramicIdx:t=Px,didkit:r}={}){yield co(r);const n=yield(yield $d(e)).addPlugin(Tx),i=yield n.addPlugin(yield Dx(n)),o=yield i.addPlugin(yield _x(i,t)),s=yield o.addPlugin(Cx(o));return{_wallet:s,get did(){return s.pluginMethods.getSubjectDid()},get keypair(){return s.pluginMethods.getSubjectKeypair()},issueCredential:s.pluginMethods.issueCredential,verifyCredential:Lx(s),issuePresentation:s.pluginMethods.issuePresentation,verifyPresentation:s.pluginMethods.verifyPresentation,getCredential:s.pluginMethods.getVerifiableCredentialFromIndex,getCredentials:s.pluginMethods.getVerifiableCredentialsFromIndex,publishCredential:s.pluginMethods.publishContentToCeramic,addCredential:e=>z(void 0,null,(function*(){yield s.pluginMethods.addVerifiableCredentialInIdx(e)})),readFromCeramic:s.pluginMethods.readContentFromCeramic,getTestVc:s.pluginMethods.getTestVc}}))),"createWallet"),Ux=I(((e,...t)=>z(void 0,[e,...t],(function*(e,{ceramicIdx:t=Px,didkit:r}={}){yield co(r);const n=yield Tx.pluginConstants.generateContentFromSeed(_i(e.padStart(64,"0")));return Rx(n,{ceramicIdx:t,didkit:r})}))),"walletFromKey");
|
|
2
|
-
/*!
|
|
3
|
-
* Copyright (c) 2014, GMO GlobalSign
|
|
4
|
-
* Copyright (c) 2015-2022, Peculiar Ventures
|
|
5
|
-
* All rights reserved.
|
|
6
|
-
*
|
|
7
|
-
* Author 2014-2019, Yury Strozhevsky
|
|
8
|
-
*
|
|
9
|
-
* Redistribution and use in source and binary forms, with or without modification,
|
|
10
|
-
* are permitted provided that the following conditions are met:
|
|
11
|
-
*
|
|
12
|
-
* * Redistributions of source code must retain the above copyright notice, this
|
|
13
|
-
* list of conditions and the following disclaimer.
|
|
14
|
-
*
|
|
15
|
-
* * Redistributions in binary form must reproduce the above copyright notice, this
|
|
16
|
-
* list of conditions and the following disclaimer in the documentation and/or
|
|
17
|
-
* other materials provided with the distribution.
|
|
18
|
-
*
|
|
19
|
-
* * Neither the name of the copyright holder nor the names of its
|
|
20
|
-
* contributors may be used to endorse or promote products derived from
|
|
21
|
-
* this software without specific prior written permission.
|
|
22
|
-
*
|
|
23
|
-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
24
|
-
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
25
|
-
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
26
|
-
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
|
27
|
-
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
28
|
-
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
29
|
-
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
|
30
|
-
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
31
|
-
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
32
|
-
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
33
|
-
*
|
|
34
|
-
*/
|
|
35
|
-
/*!
|
|
36
|
-
* MIT License
|
|
37
|
-
*
|
|
38
|
-
* Copyright (c) 2017-2022 Peculiar Ventures, LLC
|
|
39
|
-
*
|
|
40
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
41
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
42
|
-
* in the Software without restriction, including without limitation the rights
|
|
43
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
44
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
45
|
-
* furnished to do so, subject to the following conditions:
|
|
46
|
-
*
|
|
47
|
-
* The above copyright notice and this permission notice shall be included in all
|
|
48
|
-
* copies or substantial portions of the Software.
|
|
49
|
-
*
|
|
50
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
51
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
52
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
53
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
54
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
55
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
56
|
-
* SOFTWARE.
|
|
57
|
-
*
|
|
58
|
-
*/
|
|
59
|
-
/*!
|
|
60
|
-
* https://github.com/Starcounter-Jack/JSON-Patch
|
|
61
|
-
* (c) 2017-2021 Joachim Wester
|
|
62
|
-
* MIT license
|
|
63
|
-
*/
|
|
64
|
-
/*!
|
|
65
|
-
* https://github.com/Starcounter-Jack/JSON-Patch
|
|
66
|
-
* (c) 2017-2022 Joachim Wester
|
|
67
|
-
* MIT licensed
|
|
68
|
-
*/
|
|
69
|
-
/*!
|
|
70
|
-
Copyright (c) Peculiar Ventures, LLC
|
|
71
|
-
*/
|
|
72
|
-
/**
|
|
73
|
-
* [js-sha3]{@link https://github.com/emn178/js-sha3}
|
|
74
|
-
*
|
|
75
|
-
* @version 0.8.0
|
|
76
|
-
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
|
77
|
-
* @copyright Chen, Yi-Cyuan 2015-2018
|
|
78
|
-
* @license MIT
|
|
79
|
-
*/
|
|
80
|
-
function zx(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function Kx(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function Fx(e){Kx(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn((new Error).stack)),new Date(NaN))}function Hx(e,t){Kx(2,arguments);var r=Fx(e).getTime(),n=zx(t);return new Date(r+n)}function $x(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}function Vx(e){return Kx(1,arguments),e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)}function qx(e){if(Kx(1,arguments),!Vx(e)&&"number"!=typeof e)return!1;var t=Fx(e);return!isNaN(Number(t))}var Gx={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function Yx(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.width?String(t.width):e.defaultWidth,n=e.formats[r]||e.formats[e.defaultWidth];return n}}var Jx={date:Yx({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:Yx({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:Yx({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},Qx={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function Wx(e){return function(t,r){var n,i=r||{};if("formatting"===(i.context?String(i.context):"standalone")&&e.formattingValues){var o=e.defaultFormattingWidth||e.defaultWidth,s=i.width?String(i.width):o;n=e.formattingValues[s]||e.formattingValues[o]}else{var a=e.defaultWidth,c=i.width?String(i.width):e.defaultWidth;n=e.values[c]||e.values[a]}return n[e.argumentCallback?e.argumentCallback(t):t]}}var Xx={ordinalNumber:function(e,t){var r=Number(e),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},era:Wx({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:Wx({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:Wx({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:Wx({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:Wx({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})};function Zx(e){return function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=r.width,i=n&&e.matchPatterns[n]||e.matchPatterns[e.defaultMatchWidth],o=t.match(i);if(!o)return null;var s,a=o[0],c=n&&e.parsePatterns[n]||e.parsePatterns[e.defaultParseWidth],u=Array.isArray(c)?tM(c,(function(e){return e.test(a)})):eM(c,(function(e){return e.test(a)}));s=e.valueCallback?e.valueCallback(u):u,s=r.valueCallback?r.valueCallback(s):s;var l=t.slice(a.length);return{value:s,rest:l}}}function eM(e,t){for(var r in e)if(e.hasOwnProperty(r)&&t(e[r]))return r}function tM(e,t){for(var r=0;r<e.length;r++)if(t(e[r]))return r}var rM,nM={ordinalNumber:(rM={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}},function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.match(rM.matchPattern);if(!r)return null;var n=r[0],i=e.match(rM.parsePattern);if(!i)return null;var o=rM.valueCallback?rM.valueCallback(i[0]):i[0];o=t.valueCallback?t.valueCallback(o):o;var s=e.slice(n.length);return{value:o,rest:s}}),era:Zx({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:Zx({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:Zx({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:Zx({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:Zx({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},iM={code:"en-US",formatDistance:function(e,t,r){var n,i=Gx[e];return n="string"==typeof i?i:1===t?i.one:i.other.replace("{{count}}",t.toString()),null!=r&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n},formatLong:Jx,formatRelative:function(e,t,r,n){return Qx[e]},localize:Xx,match:nM,options:{weekStartsOn:0,firstWeekContainsDate:1}};function oM(e,t){Kx(2,arguments);var r=zx(t);return Hx(e,-r)}function sM(e){Kx(1,arguments);var t=1,r=Fx(e),n=r.getUTCDay(),i=(n<t?7:0)+n-t;return r.setUTCDate(r.getUTCDate()-i),r.setUTCHours(0,0,0,0),r}function aM(e){Kx(1,arguments);var t=Fx(e),r=t.getUTCFullYear(),n=new Date(0);n.setUTCFullYear(r+1,0,4),n.setUTCHours(0,0,0,0);var i=sM(n),o=new Date(0);o.setUTCFullYear(r,0,4),o.setUTCHours(0,0,0,0);var s=sM(o);return t.getTime()>=i.getTime()?r+1:t.getTime()>=s.getTime()?r:r-1}function cM(e){Kx(1,arguments);var t=aM(e),r=new Date(0);r.setUTCFullYear(t,0,4),r.setUTCHours(0,0,0,0);var n=sM(r);return n}function uM(e,t){Kx(1,arguments);var r=t||{},n=r.locale,i=n&&n.options&&n.options.weekStartsOn,o=null==i?0:zx(i),s=null==r.weekStartsOn?o:zx(r.weekStartsOn);if(!(s>=0&&s<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var a=Fx(e),c=a.getUTCDay(),u=(c<s?7:0)+c-s;return a.setUTCDate(a.getUTCDate()-u),a.setUTCHours(0,0,0,0),a}function lM(e,t){Kx(1,arguments);var r=Fx(e),n=r.getUTCFullYear(),i=t||{},o=i.locale,s=o&&o.options&&o.options.firstWeekContainsDate,a=null==s?1:zx(s),c=null==i.firstWeekContainsDate?a:zx(i.firstWeekContainsDate);if(!(c>=1&&c<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var u=new Date(0);u.setUTCFullYear(n+1,0,c),u.setUTCHours(0,0,0,0);var l=uM(u,t),d=new Date(0);d.setUTCFullYear(n,0,c),d.setUTCHours(0,0,0,0);var f=uM(d,t);return r.getTime()>=l.getTime()?n+1:r.getTime()>=f.getTime()?n:n-1}function dM(e,t){Kx(1,arguments);var r=t||{},n=r.locale,i=n&&n.options&&n.options.firstWeekContainsDate,o=null==i?1:zx(i),s=null==r.firstWeekContainsDate?o:zx(r.firstWeekContainsDate),a=lM(e,t),c=new Date(0);c.setUTCFullYear(a,0,s),c.setUTCHours(0,0,0,0);var u=uM(c,t);return u}function fM(e,t){for(var r=e<0?"-":"",n=Math.abs(e).toString();n.length<t;)n="0"+n;return r+n}var hM=function(e,t){var r=e.getUTCFullYear(),n=r>0?r:1-r;return fM("yy"===t?n%100:n,t.length)},pM=function(e,t){var r=e.getUTCMonth();return"M"===t?String(r+1):fM(r+1,2)},mM=function(e,t){return fM(e.getUTCDate(),t.length)},gM=function(e,t){return fM(e.getUTCHours()%12||12,t.length)},bM=function(e,t){return fM(e.getUTCHours(),t.length)},yM=function(e,t){return fM(e.getUTCMinutes(),t.length)},vM=function(e,t){return fM(e.getUTCSeconds(),t.length)},wM=function(e,t){var r=t.length,n=e.getUTCMilliseconds();return fM(Math.floor(n*Math.pow(10,r-3)),t.length)},AM="midnight",EM="noon",SM="morning",xM="afternoon",MM="evening",_M="night",kM={G:function(e,t,r){var n=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if("yo"===t){var n=e.getUTCFullYear(),i=n>0?n:1-n;return r.ordinalNumber(i,{unit:"year"})}return hM(e,t)},Y:function(e,t,r,n){var i=lM(e,n),o=i>0?i:1-i;return"YY"===t?fM(o%100,2):"Yo"===t?r.ordinalNumber(o,{unit:"year"}):fM(o,t.length)},R:function(e,t){return fM(aM(e),t.length)},u:function(e,t){return fM(e.getUTCFullYear(),t.length)},Q:function(e,t,r){var n=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return fM(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){var n=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return fM(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){var n=e.getUTCMonth();switch(t){case"M":case"MM":return pM(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){var n=e.getUTCMonth();switch(t){case"L":return String(n+1);case"LL":return fM(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){var i=function(e,t){Kx(1,arguments);var r=Fx(e),n=uM(r,t).getTime()-dM(r,t).getTime();return Math.round(n/6048e5)+1}(e,n);return"wo"===t?r.ordinalNumber(i,{unit:"week"}):fM(i,t.length)},I:function(e,t,r){var n=function(e){Kx(1,arguments);var t=Fx(e),r=sM(t).getTime()-cM(t).getTime();return Math.round(r/6048e5)+1}(e);return"Io"===t?r.ordinalNumber(n,{unit:"week"}):fM(n,t.length)},d:function(e,t,r){return"do"===t?r.ordinalNumber(e.getUTCDate(),{unit:"date"}):mM(e,t)},D:function(e,t,r){var n=function(e){Kx(1,arguments);var t=Fx(e),r=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var n=t.getTime(),i=r-n;return Math.floor(i/864e5)+1}(e);return"Do"===t?r.ordinalNumber(n,{unit:"dayOfYear"}):fM(n,t.length)},E:function(e,t,r){var n=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){var i=e.getUTCDay(),o=(i-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return fM(o,2);case"eo":return r.ordinalNumber(o,{unit:"day"});case"eee":return r.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(i,{width:"short",context:"formatting"});default:return r.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){var i=e.getUTCDay(),o=(i-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return fM(o,t.length);case"co":return r.ordinalNumber(o,{unit:"day"});case"ccc":return r.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(i,{width:"narrow",context:"standalone"});case"cccccc":return r.day(i,{width:"short",context:"standalone"});default:return r.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,r){var n=e.getUTCDay(),i=0===n?7:n;switch(t){case"i":return String(i);case"ii":return fM(i,t.length);case"io":return r.ordinalNumber(i,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){var n=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(n,{width:"narrow",context:"formatting"});default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(e,t,r){var n,i=e.getUTCHours();switch(n=12===i?EM:0===i?AM:i/12>=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(n,{width:"narrow",context:"formatting"});default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(e,t,r){var n,i=e.getUTCHours();switch(n=i>=17?MM:i>=12?xM:i>=4?SM:_M,t){case"B":case"BB":case"BBB":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(n,{width:"narrow",context:"formatting"});default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(e,t,r){if("ho"===t){var n=e.getUTCHours()%12;return 0===n&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return gM(e,t)},H:function(e,t,r){return"Ho"===t?r.ordinalNumber(e.getUTCHours(),{unit:"hour"}):bM(e,t)},K:function(e,t,r){var n=e.getUTCHours()%12;return"Ko"===t?r.ordinalNumber(n,{unit:"hour"}):fM(n,t.length)},k:function(e,t,r){var n=e.getUTCHours();return 0===n&&(n=24),"ko"===t?r.ordinalNumber(n,{unit:"hour"}):fM(n,t.length)},m:function(e,t,r){return"mo"===t?r.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):yM(e,t)},s:function(e,t,r){return"so"===t?r.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):vM(e,t)},S:function(e,t){return wM(e,t)},X:function(e,t,r,n){var i=(n._originalDate||e).getTimezoneOffset();if(0===i)return"Z";switch(t){case"X":return CM(i);case"XXXX":case"XX":return NM(i);default:return NM(i,":")}},x:function(e,t,r,n){var i=(n._originalDate||e).getTimezoneOffset();switch(t){case"x":return CM(i);case"xxxx":case"xx":return NM(i);default:return NM(i,":")}},O:function(e,t,r,n){var i=(n._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+TM(i,":");default:return"GMT"+NM(i,":")}},z:function(e,t,r,n){var i=(n._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+TM(i,":");default:return"GMT"+NM(i,":")}},t:function(e,t,r,n){var i=n._originalDate||e;return fM(Math.floor(i.getTime()/1e3),t.length)},T:function(e,t,r,n){return fM((n._originalDate||e).getTime(),t.length)}};function TM(e,t){var r=e>0?"-":"+",n=Math.abs(e),i=Math.floor(n/60),o=n%60;if(0===o)return r+String(i);var s=t||"";return r+String(i)+s+fM(o,2)}function CM(e,t){return e%60==0?(e>0?"-":"+")+fM(Math.abs(e)/60,2):NM(e,t)}function NM(e,t){var r=t||"",n=e>0?"-":"+",i=Math.abs(e);return n+fM(Math.floor(i/60),2)+r+fM(i%60,2)}function IM(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}}function BM(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}}var OM={p:BM,P:function(e,t){var r,n=e.match(/(P+)(p+)?/)||[],i=n[1],o=n[2];if(!o)return IM(e,t);switch(i){case"P":r=t.dateTime({width:"short"});break;case"PP":r=t.dateTime({width:"medium"});break;case"PPP":r=t.dateTime({width:"long"});break;default:r=t.dateTime({width:"full"})}return r.replace("{{date}}",IM(i,t)).replace("{{time}}",BM(o,t))}},DM=["D","DD"],jM=["YY","YYYY"];function LM(e){return-1!==DM.indexOf(e)}function PM(e){return-1!==jM.indexOf(e)}function RM(e,t,r){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(r,"`; see: https://git.io/fxCyr"));if("YY"===e)throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(r,"`; see: https://git.io/fxCyr"));if("D"===e)throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(r,"`; see: https://git.io/fxCyr"));if("DD"===e)throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(r,"`; see: https://git.io/fxCyr"))}var UM=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,zM=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,KM=/^'([^]*?)'?$/,FM=/''/g,HM=/[a-zA-Z]/;function $M(e){return e.match(KM)[1].replace(FM,"'")}var VM="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAADlSURBVHgB7dfBCcIwFAbgP9UBHKGreHQKZ/DozZt6cxtBBEexIziA5pkESoWmtkleXi79ofQU/o+QF1pgTuEopOZ2err3h9bY7BsEpkJ6avcs1APXY43AcAA6SASCExCF4AYEI3IAghD9KbiftyC6gLBCepqx6ejvgKYDU7nN6E5U3kW8+YvIdQYmI6QAgwhJgBchDegQBQEwU4ZyADJ3gzZ3QxFAW/5zMckBPOVygIFyP0DhBaFyP+BNO7dIoNyG45uQEFluk+cMTCzPAwgo5wcElvMCIsptlkhNOzE67sdkTvF8AXKndzt95ZFyAAAAAElFTkSuQmCC",qM="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzMiIHZpZXdCb3g9IjAgMCAzMiAzMyIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTIwLjQ4NTQgMTkuMTk4SDI4LjQ4NTRWMTEuMTk4IiBzdHJva2U9IiM2MzY2RjEiIHN0cm9rZS13aWR0aD0iMyIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+CjxwYXRoIGQ9Ik00IDIzLjY4MzJDNCAyMS4zMDk4IDQuNzAzNzkgMTguOTg5OCA2LjAyMjM2IDE3LjAxNjRDNy4zNDA5NCAxNS4wNDMgOS4yMTUwOCAxMy41MDQ5IDExLjQwNzggMTIuNTk2N0MxMy42MDA1IDExLjY4ODQgMTYuMDEzMyAxMS40NTA4IDE4LjM0MTEgMTEuOTEzOEMyMC42Njg5IDEyLjM3NjggMjIuODA3MSAxMy41MTk3IDI0LjQ4NTMgMTUuMTk3OUwyOC40ODUzIDE5LjE5NzkiIHN0cm9rZT0iIzYzNjZGMSIgc3Ryb2tlLXdpZHRoPSIzIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPC9zdmc+Cg==";const GM=({size:e="44px"})=>{const t={width:e,height:e};return o.default.createElement("div",{className:"vc-verification-wrapper",style:{position:"relative"}},o.default.createElement("div",{className:"flex items-center justify-center rounded-[50%] bg-white rounded-full overflow-hidden"},o.default.createElement("img",{className:"h-full w-full object-contain p-1",src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjgiIGhlaWdodD0iMjkiIHZpZXdCb3g9IjAgMCAyOCAyOSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTI0LjE0MzYgMTUuNzM5QzI0LjE0MzYgMTYuMjMxNSAyNC4zMzkyIDE2LjcwMzggMjQuNjg3NCAxNy4wNTJDMjUuMDM1NyAxNy40MDAzIDI1LjUwOCAxNy41OTU5IDI2LjAwMDUgMTcuNTk1OUMyNi40OTI5IDE3LjU5NTkgMjYuOTY1MyAxNy40MDAzIDI3LjMxMzUgMTcuMDUyQzI3LjY2MTcgMTYuNzAzOCAyNy44NTc0IDE2LjIzMTUgMjcuODU3NCAxNS43MzlDMjcuODU3NCAxNS4yNDY1IDI3LjY2MTcgMTQuNzc0MiAyNy4zMTM1IDE0LjQyNkMyNi45NjUzIDE0LjA3NzcgMjYuNDkyOSAxMy44ODIxIDI2LjAwMDUgMTMuODgyMVYxMy44ODIxQzI1LjUwOCAxMy44ODIxIDI1LjAzNTcgMTQuMDc3NyAyNC42ODc0IDE0LjQyNkMyNC4zMzkyIDE0Ljc3NDIgMjQuMTQzNiAxNS4yNDY1IDI0LjE0MzYgMTUuNzM5VjE1LjczOVoiIGZpbGw9IiM4MThDRjgiLz4KPHBhdGggZD0iTTIyLjkwOTEgNS4yNjk1OUMyMi40MTY2IDUuMjY5NTkgMjEuOTQ0MyA1LjQ2NTIzIDIxLjU5NjEgNS44MTM0N0MyMS4yNDc5IDYuMTYxNyAyMS4wNTIyIDYuNjM0MDIgMjEuMDUyMiA3LjEyNjVDMjEuMDUyMiA3LjYxODk4IDIwLjg1NjYgOC4wOTEyOSAyMC41MDgzIDguNDM5NTNDMjAuMTYwMSA4Ljc4Nzc3IDE5LjY4NzggOC45ODM0IDE5LjE5NTMgOC45ODM0VjguOTgzNEMxOC43MDI4IDguOTgzNCAxOC4yMzA1IDkuMTc5MDQgMTcuODgyMyA5LjUyNzI4QzE3LjUzNCA5Ljg3NTUyIDE3LjMzODQgMTAuMzQ3OCAxNy4zMzg0IDEwLjg0MDNDMTcuMzM4NCAxMS4zMzI4IDE3LjE0MjggMTEuODA1MSAxNi43OTQ1IDEyLjE1MzNDMTYuNDQ2MyAxMi41MDE2IDE1Ljk3NCAxMi42OTcyIDE1LjQ4MTUgMTIuNjk3MlYxMi42OTcyQzE1LjIzNzIgMTIuNjk2NiAxNC45OTUyIDEyLjc0NDEgMTQuNzY5NCAxMi44MzcxQzE0LjU0MzUgMTIuOTMwMiAxNC4zMzgyIDEzLjA2NjggMTQuMTY1MiAxMy4yMzkzQzEzLjk5MjMgMTMuNDExOCAxMy44NTUxIDEzLjYxNjcgMTMuNzYxNCAxMy44NDI0QzEzLjY2NzggMTQuMDY4IDEzLjYxOTYgMTQuMzA5OSAxMy42MTk2IDE0LjU1NDFDMTMuNjE5NiAxNC43OTg0IDEzLjU3MTQgMTUuMDQwMyAxMy40Nzc4IDE1LjI2NTlDMTMuMzg0MiAxNS40OTE1IDEzLjI0NjkgMTUuNjk2NCAxMy4wNzQgMTUuODY4OUMxMi45MDEgMTYuMDQxNCAxMi42OTU3IDE2LjE3ODEgMTIuNDY5OSAxNi4yNzExQzEyLjI0NCAxNi4zNjQxIDEyLjAwMiAxNi40MTE3IDExLjc1NzcgMTYuNDExVjE2LjQxMUMxMS4yNjUyIDE2LjQxMSAxMC43OTI5IDE2LjIxNTQgMTAuNDQ0NyAxNS44NjcyQzEwLjA5NjUgMTUuNTE4OSA5LjkwMDgyIDE1LjA0NjYgOS45MDA4MiAxNC41NTQxQzkuOTAwODIgMTQuMDYxNiA5LjcwNTE5IDEzLjU4OTMgOS4zNTY5NSAxMy4yNDExQzkuMDA4NzEgMTIuODkyOSA4LjUzNjQgMTIuNjk3MiA4LjA0MzkyIDEyLjY5NzJDNy41NTE0NCAxMi42OTcyIDcuMDc5MTIgMTIuODkyOSA2LjczMDg5IDEzLjI0MTFDNi4zODI2NSAxMy41ODkzIDYuMTg3MDEgMTQuMDYxNiA2LjE4NzAxIDE0LjU1NDFWMTguMjY3OUM2LjE4NzAxIDE4Ljc2MDQgNi4zODI2NSAxOS4yMzI3IDYuNzMwODkgMTkuNTgxQzcuMDc5MTIgMTkuOTI5MiA3LjU1MTQ0IDIwLjEyNDggOC4wNDM5MiAyMC4xMjQ4QzguNTM2NCAyMC4xMjQ4IDkuMDA4NzEgMjAuMzIwNSA5LjM1Njk1IDIwLjY2ODdDOS43MDUxOSAyMS4wMTcgOS45MDA4MiAyMS40ODkzIDkuOTAwODIgMjEuOTgxN0M5LjkwMDgyIDIyLjQ3NDIgMTAuMDk2NSAyMi45NDY1IDEwLjQ0NDcgMjMuMjk0OEMxMC43OTI5IDIzLjY0MyAxMS4yNjUyIDIzLjgzODcgMTEuNzU3NyAyMy44Mzg3QzEyLjI1MDIgMjMuODM4NyAxMi43MjI1IDIzLjY0MyAxMy4wNzA4IDIzLjI5NDhDMTMuNDE5IDIyLjk0NjUgMTMuNjE0NiAyMi40NzQyIDEzLjYxNDYgMjEuOTgxN0MxMy42MTQ2IDIxLjczNzUgMTMuNjYyOCAyMS40OTU2IDEzLjc1NjUgMjEuMjdDMTMuODUwMSAyMS4wNDQ0IDEzLjk4NzMgMjAuODM5NCAxNC4xNjAzIDIwLjY2N0MxNC4zMzMyIDIwLjQ5NDUgMTQuNTM4NSAyMC4zNTc4IDE0Ljc2NDQgMjAuMjY0OEMxNC45OTAyIDIwLjE3MTcgMTUuMjMyMiAyMC4xMjQyIDE1LjQ3NjUgMjAuMTI0OEMxNS45NjkgMjAuMTI0OCAxNi40NDEzIDE5LjkyOTIgMTYuNzg5NiAxOS41ODFDMTcuMTM3OCAxOS4yMzI3IDE3LjMzMzQgMTguNzYwNCAxNy4zMzM0IDE4LjI2NzlDMTcuMzMzNCAxOC4wMjQxIDE3LjM4MTUgMTcuNzgyNiAxNy40NzQ4IDE3LjU1NzNDMTcuNTY4MSAxNy4zMzIgMTcuNzA0OSAxNy4xMjczIDE3Ljg3NzMgMTYuOTU0OUMxOC4wNDk3IDE2Ljc4MjUgMTguMjU0NCAxNi42NDU3IDE4LjQ3OTcgMTYuNTUyNEMxOC43MDUgMTYuNDU5MSAxOC45NDY1IDE2LjQxMSAxOS4xOTAzIDE2LjQxMVYxNi40MTFDMTkuNjgyOCAxNi40MTEgMjAuMTU1MSAxNi4yMTU0IDIwLjUwMzQgMTUuODY3MkMyMC44NTE2IDE1LjUxODkgMjEuMDQ3MiAxNS4wNDY2IDIxLjA0NzIgMTQuNTU0MUMyMS4wNDcyIDE0LjA2MTYgMjEuMjQyOSAxMy41ODkzIDIxLjU5MTEgMTMuMjQxMUMyMS45Mzk0IDEyLjg5MjkgMjIuNDExNyAxMi42OTcyIDIyLjkwNDEgMTIuNjk3MkMyMy4xNDg2IDEyLjY5ODUgMjMuMzkwOSAxMi42NTE0IDIzLjYxNzEgMTIuNTU4NkMyMy44NDMyIDEyLjQ2NTkgMjQuMDQ4OCAxMi4zMjkyIDI0LjIyMTkgMTIuMTU2NkMyNC4zOTUgMTEuOTg0IDI0LjUzMjIgMTEuNzc4OCAyNC42MjU1IDExLjU1MjlDMjQuNzE4OSAxMS4zMjY5IDI0Ljc2NjcgMTEuMDg0OCAyNC43NjYgMTAuODQwM1Y4Ljk4MzRWNy4xMjY1QzI0Ljc2NiA2LjYzNDAyIDI0LjU3MDQgNi4xNjE3IDI0LjIyMjIgNS44MTM0N0MyMy44NzM5IDUuNDY1MjMgMjMuNDAxNiA1LjI2OTU5IDIyLjkwOTEgNS4yNjk1OVY1LjI2OTU5WiIgZmlsbD0iIzAwQkE4OCIvPgo8cGF0aCBkPSJNMi42NDI1NSAxNS45MTMyQzIuMjc1MjkgMTUuOTEzMiAxLjkxNjI4IDE2LjAyMjEgMS42MTA5MSAxNi4yMjYyQzEuMzA1NTQgMTYuNDMwMiAxLjA2NzU0IDE2LjcyMDIgMC45MjY5OTQgMTcuMDU5NUMwLjc4NjQ0OSAxNy4zOTg4IDAuNzQ5Njc2IDE3Ljc3MjIgMC44MjEzMjUgMTguMTMyNEMwLjg5Mjk3NCAxOC40OTI2IDEuMDY5ODMgMTguODIzNSAxLjMyOTUyIDE5LjA4MzFDMS41ODkyMSAxOS4zNDI4IDEuOTIwMDggMTkuNTE5NyAyLjI4MDI5IDE5LjU5MTNDMi42NDA0OSAxOS42NjMgMy4wMTM4NSAxOS42MjYyIDMuMzUzMTYgMTkuNDg1N0MzLjY5MjQ2IDE5LjM0NTEgMy45ODI0NyAxOS4xMDcxIDQuMTg2NTEgMTguODAxOEM0LjM5MDU1IDE4LjQ5NjQgNC40OTk0NiAxOC4xMzc0IDQuNDk5NDYgMTcuNzcwMUM0LjQ5OTQ2IDE3LjI3NzYgNC4zMDM4MiAxNi44MDUzIDMuOTU1NTggMTYuNDU3MUMzLjYwNzM1IDE2LjEwODggMy4xMzUwMyAxNS45MTMyIDIuNjQyNTUgMTUuOTEzMlYxNS45MTMyWiIgZmlsbD0iI0ZGOTQ3MCIvPgo8cGF0aCBkPSJNMTAuMDcwMiA3LjQ1MDA4QzkuNTc3NjkgNy40NTAwOCA5LjEwNTM4IDcuMjU0NDQgOC43NTcxNCA2LjkwNjJDOC40MDg5MSA2LjU1Nzk3IDguMjEzMjcgNi4wODU2NiA4LjIxMzI3IDUuNTkzMTdDOC4yMTMyNyA1LjEwMDY5IDguMDE3NjMgNC42MjgzOCA3LjY2OTM5IDQuMjgwMTRDNy4zMjExNiAzLjkzMTkxIDYuODQ4ODQgMy43MzYyNyA2LjM1NjM2IDMuNzM2MjdDNS44NjM4OCAzLjczNjI3IDUuMzkxNTcgMy45MzE5MSA1LjA0MzMzIDQuMjgwMTRDNC42OTUwOSA0LjYyODM4IDQuNDk5NDYgNS4xMDA2OSA0LjQ5OTQ2IDUuNTkzMTdDNC40OTk0NiA2LjA4NTY2IDQuMzAzODIgNi41NTc5NyAzLjk1NTU4IDYuOTA2MkMzLjYwNzM0IDcuMjU0NDQgMy4xMzUwMyA3LjQ1MDA4IDIuNjQyNTUgNy40NTAwOEMyLjE1MDA3IDcuNDUwMDggMS42Nzc3NiA3LjY0NTcyIDEuMzI5NTIgNy45OTM5NUMwLjk4MTI4MiA4LjM0MjE5IDAuNzg1NjQ1IDguODE0NSAwLjc4NTY0NSA5LjMwNjk4VjEzLjAyMDhDMC43ODU2NDUgMTMuNTEzMyAwLjk4MTI4MiAxMy45ODU2IDEuMzI5NTIgMTQuMzMzOEMxLjY3Nzc2IDE0LjY4MjEgMi4xNTAwNyAxNC44Nzc3IDIuNjQyNTUgMTQuODc3N0MzLjEzNTAzIDE0Ljg3NzcgMy42MDczNCAxNC42ODIxIDMuOTU1NTggMTQuMzMzOEM0LjMwMzgyIDEzLjk4NTYgNC40OTk0NiAxMy41MTMzIDQuNDk5NDYgMTMuMDIwOFYxMi45NzFDNC41MDk0NyAxMi40OTc0IDQuNzAxMDQgMTIuMDQ1OCA1LjAzNDYgMTEuNzA5NUM1LjM2ODE1IDExLjM3MzEgNS44MTgxNyAxMS4xNzc4IDYuMjkxNjQgMTEuMTYzOUgxMC4wNzAyQzEwLjU2MjcgMTEuMTYzOSAxMS4wMzUgMTAuOTY4MyAxMS4zODMyIDEwLjYyQzExLjczMTQgMTAuMjcxOCAxMS45MjcxIDkuNzk5NDcgMTEuOTI3MSA5LjMwNjk4QzExLjkyNzEgOC44MTQ1IDExLjczMTQgOC4zNDIxOSAxMS4zODMyIDcuOTkzOTVDMTEuMDM1IDcuNjQ1NzIgMTAuNTYyNyA3LjQ1MDA4IDEwLjA3MDIgNy40NTAwOFY3LjQ1MDA4WiIgZmlsbD0iIzQxQ0VGMiIvPgo8cGF0aCBkPSJNMTcuMjQzNiA0LjY5NzA5VjIuODQwMThDMTcuMjQzNiAyLjM0NzcgMTcuMDQ4IDEuODc1MzkgMTYuNjk5NyAxLjUyNzE1QzE2LjM1MTUgMS4xNzg5MSAxNS44NzkyIDAuOTgzMjc2IDE1LjM4NjcgMC45ODMyNzZDMTQuODk0MiAwLjk4MzI3NiAxNC40MjE5IDEuMTc4OTEgMTQuMDczNyAxLjUyNzE1QzEzLjcyNTQgMS44NzUzOSAxMy41Mjk4IDIuMzQ3NyAxMy41Mjk4IDIuODQwMThWNC42OTcwOUgxNy4yNDM2WiIgZmlsbD0iI0ZERTA0NyIvPgo8cGF0aCBkPSJNMTMuNTI5OCA0LjY5NzA4VjYuNTUzOTlDMTMuNTI5OCA3LjA0NjQ3IDEzLjcyNTQgNy41MTg3OCAxNC4wNzM3IDcuODY3MDJDMTQuNDIxOSA4LjIxNTI2IDE0Ljg5NDIgOC40MTA4OSAxNS4zODY3IDguNDEwODlDMTUuODc5MiA4LjQxMDg5IDE2LjM1MTUgOC4yMTUyNiAxNi42OTk3IDcuODY3MDJDMTcuMDQ4IDcuNTE4NzggMTcuMjQzNiA3LjA0NjQ3IDE3LjI0MzYgNi41NTM5OVY0LjY5NzA4SDEzLjUyOThaIiBmaWxsPSIjRkRFMDQ3Ii8+CjxwYXRoIGQ9Ik0yNS4yNDg5IDE4LjgwMDZIMjEuNTM1MUMyMS4wNDI2IDE4LjgwMDYgMjAuNTcwMyAxOC45OTYyIDIwLjIyMjEgMTkuMzQ0NUMxOS44NzM4IDE5LjY5MjcgMTkuNjc4MiAyMC4xNjUgMTkuNjc4MiAyMC42NTc1VjIwLjczNzJDMTkuNjYyNSAyMS4xOTkzIDE5LjQ3MzYgMjEuNjM4NiAxOS4xNDg5IDIxLjk2NzhDMTguODI0MyAyMi4yOTcxIDE4LjM4NzcgMjIuNDkyMiAxNy45MjU4IDIyLjUxNDRIMTcuODIxM0MxNy4zNDQ4IDIyLjUzOTEgMTYuODk2IDIyLjc0NTcgMTYuNTY3NCAyMy4wOTE3QzE2LjIzODggMjMuNDM3NyAxNi4wNTU3IDIzLjg5NjcgMTYuMDU1NyAyNC4zNzM4QzE2LjA1NTcgMjQuODUwOSAxNi4yMzg4IDI1LjMwOTkgMTYuNTY3NCAyNS42NTU5QzE2Ljg5NiAyNi4wMDE5IDE3LjM0NDggMjYuMjA4NSAxNy44MjEzIDI2LjIzMzJIMjEuNTM1MUMyMi4wMjQxIDI2LjIyOCAyMi40OTEzIDI2LjAzIDIyLjgzNTMgMjUuNjgyM0MyMy4xNzkyIDI1LjMzNDcgMjMuMzcyMSAyNC44NjUzIDIzLjM3MjEgMjQuMzc2M0MyMy4zNzE1IDI0LjEzMiAyMy40MTkgMjMuODkgMjMuNTEyIDIzLjY2NDJDMjMuNjA1MSAyMy40MzgzIDIzLjc0MTcgMjMuMjMzIDIzLjkxNDIgMjMuMDZDMjQuMDg2NyAyMi44ODcxIDI0LjI5MTYgMjIuNzQ5OSAyNC41MTczIDIyLjY1NjJDMjQuNzQyOSAyMi41NjI2IDI0Ljk4NDcgMjIuNTE0NCAyNS4yMjkgMjIuNTE0NEMyNS43MjE1IDIyLjUxNDQgMjYuMTkzOCAyMi4zMTg4IDI2LjU0MiAyMS45NzA1QzI2Ljg5MDMgMjEuNjIyMyAyNy4wODU5IDIxLjE1IDI3LjA4NTkgMjAuNjU3NUMyNy4wODU5IDIwLjE2NSAyNi44OTAzIDE5LjY5MjcgMjYuNTQyIDE5LjM0NDVDMjYuMTkzOCAxOC45OTYyIDI1LjcyMTUgMTguODAwNiAyNS4yMjkgMTguODAwNkgyNS4yNDg5WiIgZmlsbD0iIzgxOENGOCIvPgo8cGF0aCBkPSJNMTAuMTA5OCAyNC42NzVIMTAuMDM1MUM5LjU3MjA0IDI0LjY1ODEgOS4xMzIxMiAyNC40NjgzIDguODAyMTggMjQuMTQzQzguNDcyMjMgMjMuODE3NiA4LjI3NjIzIDIzLjM4MDQgOC4yNTI4NyAyMi45MTc3VjIyLjgxODFDOC4yNTI4NyAyMi4zMjU2IDguMDU3MjQgMjEuODUzMyA3LjcwOSAyMS41MDUxQzcuMzYwNzYgMjEuMTU2OCA2Ljg4ODQ1IDIwLjk2MTIgNi4zOTU5NyAyMC45NjEyQzUuOTAzNDkgMjAuOTYxMiA1LjQzMTE3IDIxLjE1NjggNS4wODI5NCAyMS41MDUxQzQuNzM0NyAyMS44NTMzIDQuNTM5MDYgMjIuMzI1NiA0LjUzOTA2IDIyLjgxODFWMjYuNTMxOUM0LjUzOTA2IDI3LjAyNDQgNC43MzQ3IDI3LjQ5NjcgNS4wODI5NCAyNy44NDQ5QzUuNDMxMTcgMjguMTkzMiA1LjkwMzQ5IDI4LjM4ODggNi4zOTU5NyAyOC4zODg4SDEwLjEwOThDMTAuMzUzNiAyOC4zODg4IDEwLjU5NTEgMjguMzQwOCAxMC44MjA0IDI4LjI0NzVDMTEuMDQ1NyAyOC4xNTQxIDExLjI1MDQgMjguMDE3NCAxMS40MjI4IDI3Ljg0NDlDMTEuNTk1MiAyNy42NzI1IDExLjczMiAyNy40Njc4IDExLjgyNTMgMjcuMjQyNUMxMS45MTg3IDI3LjAxNzIgMTEuOTY2NyAyNi43NzU4IDExLjk2NjcgMjYuNTMxOUMxMS45NjY3IDI2LjI4OCAxMS45MTg3IDI2LjA0NjYgMTEuODI1MyAyNS44MjEzQzExLjczMiAyNS41OTYgMTEuNTk1MiAyNS4zOTEzIDExLjQyMjggMjUuMjE4OUMxMS4yNTA0IDI1LjA0NjQgMTEuMDQ1NyAyNC45MDk3IDEwLjgyMDQgMjQuODE2M0MxMC41OTUxIDI0LjcyMyAxMC4zNTM2IDI0LjY3NSAxMC4xMDk4IDI0LjY3NVYyNC42NzVaIiBmaWxsPSIjRjQzRjVFIi8+Cjwvc3ZnPgo=",style:t,alt:"Verification Icon"})))},YM=({size:t="60px",loading:r=!0})=>{const[n,i]=e.useState(!0);e.useEffect((()=>{let e=setTimeout((()=>i(!1)),3e3);return()=>{clearTimeout(e)}}));const s=r||n?exports.CircleLoadingState.spin:exports.CircleLoadingState.stop;return o.default.createElement("div",{className:"flex vc-verification-full-wrapper justify-center items-center translate-x-[10px]"},o.default.createElement("span",{className:"text-white font-bold tracking-wider"},"Verified"),o.default.createElement("div",{style:{width:t,height:t,position:"relative"},className:"flex items-center justify-center bg-white rounded-full ml-3 mr-3 overflow-hidden"},o.default.createElement(GM,{size:"44px",loading:r}),o.default.createElement("div",{className:"vc-verification-spinner-overlay",style:{position:"absolute",top:0,left:0,height:"60px",width:"60px"}},o.default.createElement(f,{loadingState:s}))),o.default.createElement("span",{className:"text-white font-bold tracking-wider"},"Credential"))},JM=({title:e,createdAt:t,issuer:r,issuee:n,credentialSubject:i,className:s="",loading:a})=>{var c;const u=null===(c=null==i?void 0:i.achievement)||void 0===c?void 0:c.image,l="object"==typeof r?r.name:r,d="object"==typeof n?n.name:n,f="object"==typeof r?r.image:"",h="object"==typeof n?n.image:"";return o.default.createElement("div",{className:`flex overflow-hidden flex-col items-center justify-between relative max-w-[400px] h-[100%] max-h-[600px] min-h-[600px] p-7 rounded-3xl shadow-3xl bg-emerald-700 vc-display-card-full-container ${s}`},o.default.createElement("section",{className:"bg-white rounded-bl-[50%] rounded-br-[50%] absolute top-0 w-[110%] h-[77%]"}),o.default.createElement("section",{className:"flex flex-col items-center justify-center z-10 text-center"},o.default.createElement("section",{className:"max-w-[100px] max-h-[100px]"},o.default.createElement("img",{className:"h-full w-full object-cover",src:null!=u?u:"",alt:"Credential Achievement Image"})),o.default.createElement("section",{className:"flex flex-row items-start justify-between w-full line-clamp-2"},o.default.createElement("div",{className:"flex flex-row items-start justify-start line-clamp-2 py-4 "},o.default.createElement("h3",{className:"text-2xl line-clamp-2 tracking-wide leading-snug text-center","data-testid":"vc-thumbnail-title"},null!=e?e:""))),o.default.createElement("section",{className:"flex flex-row items-center justify-center mt-2 w-full my-2"},o.default.createElement("div",{className:"flex items-center justify-center h-16 w-16 shadow-3xl rounded-full overflow-hidden bg-white"},o.default.createElement("div",{className:"flex flex-row items-center justify-center rounded-full overflow-hidden bg-white w-10/12 h-5/6"},o.default.createElement("img",{className:"w-4/6 h-4/6 object-cover",src:f,alt:"Issuer image"}))),o.default.createElement("img",{className:"h-8 w-8 my-0 mx-4",src:VM,alt:"fat arrow icon"}),o.default.createElement("div",{className:"flex items-center justify-center h-16 w-16 shadow-3xl rounded-full overflow-hidden bg-white"},o.default.createElement("div",{className:"flex flex-row items-center justify-center h-full w-full rounded-full border-solid border-4 border-white overflow-hidden bg-white"},o.default.createElement("img",{className:"h-full w-full object-cover",src:h||"data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD//gAgQ29tcHJlc3NlZCBieSBqcGVnLXJlY29tcHJlc3MA/9sAhAANDQ0NDg0OEBAOFBYTFhQeGxkZGx4tICIgIiAtRCoyKioyKkQ8STs3O0k8bFVLS1VsfWljaX2Xh4eXvrW++fn/AQ0NDQ0ODQ4QEA4UFhMWFB4bGRkbHi0gIiAiIC1EKjIqKjIqRDxJOzc7STxsVUtLVWx9aWNpfZeHh5e+tb75+f//wgARCAKKAfQDASIAAhEBAxEB/8QAHAABAQADAAMBAAAAAAAAAAAAAAQFBgcCAwgB/9oACAEBAAAAANLiAAAAAAAAAAIgAAAAAAAAAFsQAAAAAAAAAC2IAAAAAAAAABbEAAAAAAAAAAtiAAAAAAAAAAWxAAAAAAAAAALYgAAAAAAAAAFsQAAAAAAAAAC2IAAAAAAAAABbEAAAAAAAAAAtiAAAAAAAAAAWxAAAAAAAAAALYgAAAAAAAAAFsQAAAAAAAAAC2IAAAAAAAAABbEAAAAAAAAAAtiAAAAAAAAAAWxAAAAAAAAAALYgAAAAAAAAAFsQAAAAAAAAAC2IAAAAAAAAABbEAAAAAAAAAAtiAA89w3TZsbwbxAAADYu3QatoeDAALYgAbf1fLPzC8C9YAAAbb2eg03lGMAAtiAHl1joTWtB1KMAAAB+5ndd/u9HF9SABbEAMr9Dych0wAAAABR1ToGtcIABbEAGyY3GgAAAABs2KxwALYgAAAAAAAAAFsQAAAAAAAAAC2IAAAAAAAAABbEAAHnt0usAAAKNuw+BAAAtiAAHn2/anOeUgAAs7zl/zkGhgAAtiAAHQetjg2uAAB13fz1fOsQAAWxAADvufGhcgAAHs+kKBybngAAWxAAHu+lPIYf57AAGw97DS+LgABbEAAZb6GD0/NIAA3LtQa7wUAALYgADLfQweHzMAANz7SGvcEAAC2IAA9/wBKhivngAAbJ3gNM4sAAFsQAA+gc2NF46AAPb9Je0cp5yAAFsQAA6N1YcM1YAAOybwev54xwAAWxAAD2d22JonHgAAZDv1zk/OwAAWxAAB7t3l07xAAAu3PDauAABbEAAAAAAAAAAtiAAAAAAAAAAWxAAAAAAAAAALYgAAAAAAAAAFsQAAAAAAAAAC2IAAAAAAAAABbEAAAAAAAAAAtiAAAAAAAAAAWxAAAAAA2vp+gaIAAAFsQAAAAAV9/yXj8z+IAAAtiAAAAAFfbdkYDgQAAAWxAAAA8ul5XmWKH7uXVsm9fCNeAAAC2IAAAG69nerTMH45fbckeHHNJAAABbEAAADL91yABi+Oa0AAABbEAAABZ0jfawwWgaJ6gAAAFsQAAAB5ZvKeceDjAAAAC2IAAAAAAAAABbEAAAAAAAAAAtiAAAAAAAAAAWxAAAAAAAAAALYgAAAAAAAAAFsQAAAAAAAAAC2IAAAAAAAAABbEAAAAAAAAAAtiAAAAAAAAAAWxAAAAAAAAAALYgAAAAAAAAAFsQAAAAAAAAAC2IAAAAAAAAABbEAAAAAAAAAAtiAAAAAAAAAAWxAAAAAAAAAALYgAAAAAAAAAFsQAAAAAAAAAC2IAAAAAAAAABbEAAAAAAAAAAtiAAAAAAAAAAWxAAAAAAAAAALYgAAAAAAAAAH/8QAFAEBAAAAAAAAAAAAAAAAAAAAAP/aAAgBAhAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAP/EABQBAQAAAAAAAAAAAAAAAAAAAAD/2gAIAQMQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD/xABEEAAABQEEBwQGBwYGAwAAAAABAgMEBQAGNXSyERUxQFBUkxIhMnEQEyBBUmEHIiMwM0JRJENicpGSFBZTgqLBRIHR/9oACAEBAAE/AJGRflfvSg9XAAcKAAAob4q1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pq1lI8856pqkrxfYlXNx+SvF9iVc3H5K8X2JVzcfkrxfYlXNx+SvF9iVc3H5K8X2JVzcfkrxfYlXNx+SvF9iVc3H5K8X2JVzcfkrxfYlXNx+SvF9iVc3H5K8X2JVzcfkrxfYlXNx+SvF9iVc3H5K8X2JVzcfkrxfYlXNx+SvF9iVc3H5K8X2JVzcfkrxfYlXNx+SvF9iVc3H5K8X2JVzcfkrxfYlXNx+SvF9iVc33xEzqGKQhBMYR0AABpEajrDzDsAOuBWpP4/HTOwcMhoFcVnA/MewFIQkU2/AYNyfPsBU3ZljKM1RBAibkCiKSpQAtGAxTCUwaBAdAhvFmYYJmTKioIgiQonVpGMYIJAikzQKmAbOwFO7MQLkBBSNRKb9SaSVIfR422sXpyfJWpOzkvF6RcNR9X/qk+uTcJK8X2JVzfewdj38mBF19KDYdhh8R/IKi4ONiyAVq3ADe9Qe841o9AmAA0iIAFSVoYuPRUOo7SMcA7kiGAxhGllDLKqKm2nOJh8xHTvFj5hvFSJxcm7KKyfYE9NpBm4LpbukVPmQ5RrT6BKAgICHcNTNjI1+BlGoA2X+XgGpOIfxS/qXaIl+E20p/IfvpK8X2JVzfdlKJhAoAIiI6AAKs5Y1NsBHUiQDrbSo+4laA9EpauJjBMQyorLBtSSp/b2XXEQalTak/vPTqQfPBEXLtZUR+MwjvYCICAgOgaZ2hmWIh6h+ro+Ew9stR30hn7k5Fr/vRpjJsZJL1jRwRUvv0bQ8w9EgyZvUDN10SqpjtAatJZdeGN69IRVaGHuP7yfI/3sleL7Eq5vu4JdBtMR6y/4RFyiagEBABAafP2jBsdw5WAiYVO2xeyInRaiKDb/mfgLZ04aKlWbrHTUDYYo1Z+2qLsSNpIQSV2At+Q9BVr3KCMC+BUQEVQAhA/U33sleL7Eq5vvI61k1HIggkuB0w2FVKB9FSUu/lFQUdrifR4S7Cl4IwtdNsECoJrgdMvhBUvb0VIyr6UWBV2uJxDYGwC+QfeyV4vsSrm4/JXi+xKubj8leL7Eq5uPyV4vsSrm3IiaihykIQTGMOgCgGkRGmthp1cgHORJD5KHp/ZCbYpiqKAKphtFIe1Wgd0bNHLtYqLdE6qhthShpGkbBTaifbOLdP5CepOzUvFl7bhtpS/1CD2ybpJXi+xKubcSEMocpCFExjGAAANoiNWas2hEIAooAHeHABOf4P4S0AVoq2FmSKJqyTJIAUJ3rELm3NgxXkHaLVAulRQ2gP/AKNQ0M0iGgIoAAnHxqfmOPoMQpimKYAEBDQIDsGrX2aJHm/xzMgg1OP1ye5I25yV4vsSrm3GwUUC7xWQVD6jfuT+ag+wJQGrUxOqpZVMgaEFftUvIdysFFAgzVkDl+0X+qn8iB7Dtqi4bKt1yAYipBKYPkNSLJWPfOWiviSUEu5SV4vsSrm3GzDEGMGxTENBzk9afzP7Nv2IKxiDwA70FdA+Sm4opHWVTSIGkxzgUvmI6KaNyNGyDcnhSTKQP/Xs/SCyBN6zeFD8ZISH8yblJXi+xKubcG6frl0UvjUKX+o0QgEIUhQ7igAB5B7NoW4OYKUTENiAnDzJuNlUAXn44ohpAFO3/Z7VvkAUhAV96Tgm5SV4vsSrm3CBIB5uKKOwXaWb2npQM0clENOlFTKO42EABnyfJBX2rYEAbOyPyKTOG5SV4vsSrm3CBMBJuKMPOJZvafG7LVwOwCony7jYQQCeLh1fatiYAs7I+RM4blJXi+xKubcGqvqXKCvwKFN/QaIYDlAwDpAQ0h5D7NoFf8PBySw8uYA8zbjZJcELQxxhHQAqCSg9m3q4JwfY96q5A3KSvF9iVc242beg+g2CwjpOCYJn8yezb54CMSi19663/BPcUFjN10VieJM5Th5lHTTZdNygiumOkiiZTh/uDT7P0hvQM6ZMwHwJiofzPuUleL7Eq5txsDKgkutGqbFvrpfzhWn06atdKhJy6opH0oIfZJblYKWBdgdkcftW2QfYcLpIIqrKmAqaZRMYf0AKln55KRdOzfvTiIB+hfcG5SV4vsSrm3FFZRBVNVI4lOQwGKYNoCFWetA3mGwbCuSBoVT/AOw9GmrX2lIyRUYNFNLo4aFBD90Xc4uScRb1F2h4iD3h7jFHaA1FS7WSZkXanDQPjD8xB/QfQI1bK0hHOmOZqaUgH7Y4ZdzkrxfYlXNuTdwu2WIsgqdNQg6SmKOgQppb+VRSAiyCK/z8A0/txMOyCml2GwDtFPxUJjGERERERERER3RhJPY5cF2jg6R6R+kKQIQAVZIHGpS10xJEOiKgIojtIlukleL7Eq5uPyV4vsSrm4/JXi+xKubj8leL7Eq5uPyV4vsSrm4/JXi+xKubj8leL7Eq5uPyV4vsSrm4/JXi+xKubgtmLOa6WOdYwkapeIQ2mH9Ar/KdnfVAnq4n9R01aayGrEzPGQnO2DxlHaTeJK8X2JVzcEZM3D1yk2bpiZRQdABURGpRTBBol+TvMb4jjtH0LppLIqpKBpKcglEPkIUcOycxf0EQ3eSvF9iVc3A2TJ0+cEQbJCoobYAVZ2ziEMh7lHZw+0V/6L6bSSpYqKXVA2hY4CmiH8Q7xJXi+xKubeSEMcxSEKImMIAABtERqJsCBkyqSS5ymH9ynTywEUol+yrLpKfMQOFSsM/iFxSdJCAfkUDvIf2SlEwgBQERHYAVEWKknwlUc/sqH8XjGouIYxSHqmqWjT4zj3mN5jQB6Flk0U1FVDAUhCiYxh2AAVaScPMvxUDuQT+qiXeJK8X2JVzbzYRqkvNCdQPwUDHJWj0LoIOEzJLJEUTMHeU4aQp7YSIXETIHVbj/AHkpT6OXQeCSRHzIIUn9HTsfHIoh5EEaa/R9HJ97h2sr5ABAphCxccH7KzTIPx7T/wBR9hVQiRDqKKFIQoaTGEdAAAVam1AyZhatREGhR6u8yV4vsSrm3mElVYiQSdkDSAdxyfEQajZNlJtyrtVgOX3hsMQf0MH3UrNR0Ul23SwAP5Uw7zmqetM8mT9j8JsGxIBzb1JXi+xKubemT92wXBdquZJQPeWoq36JwAkkgJDe9VOmUkwel7bV0ksH8Jq0+nTQnKUBERAA/UafWqhI4g9t4Q6vwJfXGpS3r1cBTYJAgX4x7z0ssquoZRVQxzmHSJjCIiO9yV4vsSrm3wpzkMBimEpg2CA6BptaaeagAJSa/kYe3mpO3doSbVkT+aQUNvZ4eW6dLWytGt/54k/kIUlOZF+7ERcO1lf5ziO/SV4vsSrm4/JXi+xKubj8leL7Eq5uPyV4vsSrm4/JXi+xKubj8leL7Eq5uPyV4vsSrm4/JXi+xKubj8leL7Eq5uPyV4vsSrm4/JXi+xKubj8leL7Eq5uPyV4vsSrm4/JXi+xKubj8leL7Eq5uPyV4vsSrm4/JXi+xKubj8leL7Eq5uPyV4vsSrm4/JXi+xKubj8leL7Eq5uPyV4vsSrm4/JXi+xKubj//xAAUEQEAAAAAAAAAAAAAAAAAAACg/9oACAECAQE/ACQf/8QAFBEBAAAAAAAAAAAAAAAAAAAAoP/aAAgBAwEBPwAkH//Z",alt:"Issuee image"})))),o.default.createElement("div",{className:"w-full mt-2"},o.default.createElement("p",{className:"text-sm font-light text-center line-clamp-2","data-testid":"vc-thumbnail-createdAt"},"Issued to ",o.default.createElement("span",{className:"font-bold"},d)," on"," ",null!=t?t:""," by ",o.default.createElement("span",{className:"font-bold"}," ",l))),o.default.createElement("button",{className:"cursor-alias bg-white my-3 border-2 text-indigo-500 font-semibold py-2 px-4 border border-indigo-300 rounded-full"},o.default.createElement("span",{className:"flex justify-center"},o.default.createElement("p",{className:"flex items-center"},"Details"),o.default.createElement("img",{className:"h-8 w-8 my-0 mx-1",src:qM,alt:"Flip Card"})))),o.default.createElement("div",{className:"flex items-center justify-center w-full"},o.default.createElement(YM,{loading:a})))};var QM=(e=>(e.Success="Success",e.Failed="Failed",e.Error="Error",e))(QM||{});const WM={[QM.Success]:"bg-emerald-500",[QM.Failed]:"bg-yellow-400",[QM.Error]:"bg-rose-600"},XM={[QM.Success]:"text-emerald-700",[QM.Failed]:"text-yellow-400",[QM.Error]:"text-rose-600"},ZM={[QM.Success]:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIHZpZXdCb3g9IjAgMCAzMCAzMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjMwIiBoZWlnaHQ9IjMwIiByeD0iMTUiIGZpbGw9IiM0MENCQTYiLz4KPHBhdGggZD0iTTIxLjg3NSAxMC42MjU0TDEzLjEyNSAxOS4zNzVMOC43NSAxNS4wMDA0IiBzdHJva2U9IndoaXRlIiBzdHJva2Utd2lkdGg9IjMiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8L3N2Zz4K",[QM.Failed]:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIHZpZXdCb3g9IjAgMCAzMCAzMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjMwIiBoZWlnaHQ9IjMwIiByeD0iMTUiIGZpbGw9IiNGQUNDMTUiLz4KPHBhdGggZD0iTTEzLjI4NTcgMTYuOTA4TDEyLjQzMDcgOC43SDE3LjU2MDdMMTYuNzA1NyAxNi45MDhIMTMuMjg1N1pNMTQuOTk1NyAyMi4xOUMxNC4yNjEgMjIuMTkgMTMuNjU5NCAyMS45NjgzIDEzLjE5MDcgMjEuNTI1QzEyLjcyMiAyMS4wNjkgMTIuNDg3NyAyMC41MzA3IDEyLjQ4NzcgMTkuOTFDMTIuNDg3NyAxOS4yNzY3IDEyLjcyMiAxOC43NDQ3IDEzLjE5MDcgMTguMzE0QzEzLjY1OTQgMTcuODgzMyAxNC4yNjEgMTcuNjY4IDE0Ljk5NTcgMTcuNjY4QzE1Ljc0MyAxNy42NjggMTYuMzQ0NyAxNy44ODMzIDE2LjgwMDcgMTguMzE0QzE3LjI2OTQgMTguNzQ0NyAxNy41MDM3IDE5LjI3NjcgMTcuNTAzNyAxOS45MUMxNy41MDM3IDIwLjUzMDcgMTcuMjY5NCAyMS4wNjkgMTYuODAwNyAyMS41MjVDMTYuMzQ0NyAyMS45NjgzIDE1Ljc0MyAyMi4xOSAxNC45OTU3IDIyLjE5WiIgZmlsbD0id2hpdGUiLz4KPC9zdmc+Cg==",[QM.Error]:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzAiIGhlaWdodD0iMzAiIHZpZXdCb3g9IjAgMCAzMCAzMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHJlY3Qgd2lkdGg9IjMwIiBoZWlnaHQ9IjMwIiByeD0iMTUiIGZpbGw9IiNFMTFENDgiLz4KPHBhdGggZD0iTTIwLjYyNSA5LjM3NUw5LjM3NSAyMC42MjUiIHN0cm9rZT0id2hpdGUiIHN0cm9rZS13aWR0aD0iMyIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIi8+CjxwYXRoIGQ9Ik0yMC42MjUgMjAuNjI1TDkuMzc1IDkuMzc1IiBzdHJva2U9IndoaXRlIiBzdHJva2Utd2lkdGg9IjMiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIvPgo8L3N2Zz4K"},e_={[QM.Success]:"Verification Success",[QM.Error]:"Verification Error ",[QM.Failed]:"Verification Failed"},t_=({status:e})=>{const t=WM[e],r=ZM[e];return o.default.createElement("div",{className:`relative rounded-full w-[30px] h-[30px] ${t}`},o.default.createElement("div",{className:"relative w-[100%] h-[100%] flex items-center justify-center rounded-[50%] bg-white rounded-full overflow-hidden"},o.default.createElement("img",{className:"h-full w-full object-contain p-1",src:null!=r?r:"",alt:"Verification Status Icon"})))},r_=({message:e="",details:t,status:r=QM.Success})=>{const n=XM[r],i=e_[r];return o.default.createElement("section",{className:"flex width-full bg-white p-2 px-5 my-3.5 justify-between items-center relative vc-verification-checklist-pill rounded-[22px]"},o.default.createElement("div",{className:"vc-pill-left"},o.default.createElement("p",{className:`text-[10px] font-bold status-text uppercase ${n}`},i),o.default.createElement("p",{className:"text-[12px] text-grayscale-900 vc-pill-text"},e),t&&o.default.createElement("p",{className:"text-[12px] text-gray-600"}," ",t)),o.default.createElement("div",{className:"vc-pill-right"},o.default.createElement(t_,{status:r})))},n_=({issuer:e,credentialSubject:t,className:r="",loading:n,verification:i=[]})=>{var s,a,c;const u=null===(s=null==t?void 0:t.achievement)||void 0===s?void 0:s.description,l=null===(c=null===(a=null==t?void 0:t.achievement)||void 0===a?void 0:a.criteria)||void 0===c?void 0:c.narrative,d="object"==typeof e?e.url:"";return o.default.createElement("div",{className:`flex overflow-hidden flex-col items-center justify-between relative max-w-[400px] h-[100%] max-h-[1100px] min-h-[600px] p-7 rounded-3xl shadow-3xl bg-emerald-700 vc-display-card-full-container ${r}`},o.default.createElement("section",{className:"flex max-h-[150px] items-end bg-white rounded-bl-[50%] rounded-br-[50%] absolute top-0 w-[110%] h-[55%] min-h-[400px]"}),o.default.createElement("section",{className:"flex flex-col items-center justify-center z-10 text-left"},o.default.createElement("section",{className:"flex flex-row items-start justify-start w-full line-clamp-2"},o.default.createElement("h3",{className:"text-2xl line-clamp-2 tracking-wide leading-snug text-left text-emerald-700","data-testid":"vc-credential-details-title tracking-wide subpixel-antialiased"},"Credential Details")),o.default.createElement("section",{className:"flex flex-col mt-2 w-full my-2"},o.default.createElement("div",{className:"width-full"},o.default.createElement("h6",{className:"line-clamp-4 text-grayscale-900 font-bold uppercase text-xs tracking-wider subpixel-antialiased"},"Description"),o.default.createElement("p",{className:"line-clamp-4 subpixel-antialiased text-grayscale-600 "},u)),o.default.createElement("div",{className:"width-full mt-7"},o.default.createElement("h6",{className:"line-clamp-4 text-grayscale-900 font-bold uppercase text-xs tracking-wider subpixel-antialiased"},"Criteria"),o.default.createElement("p",{className:"line-clamp-4 subpixel-antialiased text-grayscale-600 "},l)),d&&o.default.createElement("p",{className:"text-indigo-500 font-bold text-xs width-full text-center mt-8"},d)),o.default.createElement("div",{className:"w-full mt-2"}),o.default.createElement("button",{className:"bg-white my-3 border-2 text-indigo-500 font-semibold py-2 px-4 border border-indigo-300 rounded-full"},o.default.createElement("span",{className:"flex justify-center"},o.default.createElement("img",{className:"h-8 w-8 my-0 mx-4 scale-x-[-1]",src:qM,alt:"Flip Card"}))),o.default.createElement("section",{className:"flex-col items-center justify-center checklist-container justify-center w-[100%] width-full mt-[20px]"},o.default.createElement(YM,{loading:n}),o.default.createElement("section",null,i.map((e=>o.default.createElement(r_,{key:e.check,status:e.status,message:e.message,details:e.details})))))))},i_=e=>{var t;const{issuer:r,credentialSubject:n,issuanceDate:i}=e;return{title:null===(t=e.credentialSubject.achievement)||void 0===t?void 0:t.name,createdAt:function(e,t,r){Kx(2,arguments);var n=String(t),i=r||{},o=i.locale||iM,s=o.options&&o.options.firstWeekContainsDate,a=null==s?1:zx(s),c=null==i.firstWeekContainsDate?a:zx(i.firstWeekContainsDate);if(!(c>=1&&c<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var u=o.options&&o.options.weekStartsOn,l=null==u?0:zx(u),d=null==i.weekStartsOn?l:zx(i.weekStartsOn);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!o.localize)throw new RangeError("locale must contain localize property");if(!o.formatLong)throw new RangeError("locale must contain formatLong property");var f=Fx(e);if(!qx(f))throw new RangeError("Invalid time value");var h=$x(f),p=oM(f,h),m={firstWeekContainsDate:c,weekStartsOn:d,locale:o,_originalDate:f};return n.match(zM).map((function(e){var t=e[0];return"p"===t||"P"===t?(0,OM[t])(e,o.formatLong,m):e})).join("").match(UM).map((function(r){if("''"===r)return"'";var n=r[0];if("'"===n)return $M(r);var s=kM[n];if(s)return!i.useAdditionalWeekYearTokens&&PM(r)&&RM(r,t,e),!i.useAdditionalDayOfYearTokens&&LM(r)&&RM(r,t,e),s(p,r,o.localize,m);if(n.match(HM))throw new RangeError("Format string contains an unescaped latin alphabet character `"+n+"`");return r})).join("")}(new Date(i),"dd MMM yyyy").toUpperCase(),issuer:r,issuee:e.credentialSubject.id,credentialSubject:n}},o_=({credential:e,issueeOverride:t,className:r="",loading:n=!1,verification:i=[]})=>{const{title:s,createdAt:a,issuer:c,issuee:u,credentialSubject:d}=i_(e),f=t||u;return o.default.createElement(l,null,o.default.createElement(JM,{title:s,credentialSubject:d,issuer:c,issuee:f,createdAt:a,className:r,loading:n}),o.default.createElement(n_,{title:s,credentialSubject:d,issuer:c,issuee:f,createdAt:a,className:r,loading:n,verification:i}))};u('.vc-thumbnail-container{max-width:250px}.vc-thumbnail-container:after{content:"";display:block;left:0;padding-bottom:100%;top:0}.vc-thumbnail-container:before{background-color:#fff;border-bottom-left-radius:120px;border-bottom-right-radius:120px;border-top-left-radius:24px;border-top-right-radius:24px;content:"";height:60%;left:0;position:absolute;top:0;width:100%;z-index:0}.vc-thumbnail-alt-container:after{padding-bottom:80%}.vc-thumbnail-alt-container:before{height:80%}.vc-thumbnail-listview-container:after{background-color:#fff;border-bottom-left-radius:120px;border-bottom-right-radius:120px;border-top-left-radius:24px;border-top-right-radius:24px;content:"";height:55%;left:0;position:absolute;top:0;width:100%;z-index:1}@media (max-width:200px){.vc-thumbnail-alt-container:before,.vc-thumbnail-container:before{height:68%}}',{insertAt:"top"});exports.Button=({text:e,onClick:t,className:r=""})=>o.default.createElement("button",{type:"button",onClick:t,className:`p-4 border rounded text-gray-700 ${r}`},e),exports.FlippyCard=l,exports.MiniVCThumbnail=({title:e,createdAt:t,issuerImage:r,badgeImage:n,className:i="",onClick:s=(()=>{})})=>{const a=r?"w-3/4 text-left":"w-full text-center",c=r?"text-left":"w-full text-center";return o.default.createElement("div",{onClick:s,className:`flex flex-col items-center justify-between relative py-3 px-3 rounded-3xl shadow-3xl bg-emerald-700 min-h-[120px] max-w-sm mini-vc-thumbnail-container ${i}`,"data-testid":"mini-vc-thumbnail"},o.default.createElement("div",{className:"flex flex-row items-center justify-between mb-3 z-10"},r&&o.default.createElement("div",{className:"flex flex-row justify-center items-center w-1/4 text-center","data-testid":"mini-vc-thumbnail-issuer"},o.default.createElement("div",{className:"min-w-[40px] min-h-[40px] max-h-[48px] max-w-[48px] shadow-3xl p-1 rounded-full bg-white"},o.default.createElement("img",{className:"h-full w-full object-cover rounded-full",src:r,alt:"issuer image"}))),o.default.createElement("div",{className:`flex flex-col items-start justify-center ${a}`},o.default.createElement("h2",{className:"ml-2 text-sm tracking-wide leading-snug line-clamp-2","data-testid":"mini-vc-thumbnail-title"},null!=e?e:""),o.default.createElement("p",{className:`ml-2 text-sm font-light line-clamp-1 ${c}`,"data-testid":"mini-vc-thumbnail-createdAt"},null!=t?t:""))),o.default.createElement("div",{className:"flex items-center justify-center w-full mt-3"},n&&o.default.createElement("div",{className:"flex item-center justify-center w-full -mt-3","data-testid":"mini-vc-thumbnail-badge"},o.default.createElement("div",{className:"max-h-[80px] max-w-[80px] xxsm:h-[60px] xxsm:w-[60px] border-solid border-1 border-black bg-white z-10"},o.default.createElement("img",{className:"h-full w-full object-cover",src:n,alt:"badge image"}))),o.default.createElement("div",{className:"flex absolute bottom-1 right-1 items-center justify-center my-0 mx-1 h-10 w-10 rounded-full bg-white overflow-hidden"},o.default.createElement("div",{className:"flex items-center justify-center h-5/6 w-10/12 bg-white rounded-full border-solid border-4 border-emerald-700 overflow-hidden"},o.default.createElement("img",{className:"h-full w-full object-cover",src:h,alt:"credential icon"})))))},exports.VCCard=({credential:t,issueeOverride:r,className:n=""})=>{const[i,s]=e.useState(!0),[a,c]=e.useState([]);return e.useEffect((()=>{p(void 0,void 0,void 0,(function*(){const e=yield Ux(""),r=yield e.verifyCredential(t);c(r),s(!1)}))}),[]),o.default.createElement(o_,{credential:t,issueeOverride:r,className:n,loading:i,verification:a})},exports.VCDisplayBackFace=n_,exports.VCDisplayCard=o_,exports.VCThumbnail=({title:e,createdAt:t,issuerImage:r,userImage:n,badgeImage:i,className:s="",listView:a=!1,onClick:c=(()=>{})})=>{let u=null;r?u=o.default.createElement("img",{className:"h-full w-full object-cover",src:r,alt:"issuer image"}):i&&(u=o.default.createElement("img",{className:"h-full w-full object-cover",src:i,alt:"badge image"}));const l=r||i?"items-start justify-center w-3/4 text-left":"item-center justify-center w-full text-center";if(a)return o.default.createElement("div",{onClick:c,className:`flex flex-col items-center justify-between relative py-3 px-3 rounded-3xl shadow-3xl bg-emerald-700 max-w-sm vc-thumbnail-listview-container ${s}`,"data-testid":"vc-thumbnail-list-view"},o.default.createElement("div",{className:"flex flex-row items-center justify-between mb-3 z-10"},u&&o.default.createElement("div",{className:"flex flex-row justify-center items-center w-1/4 text-center","data-testid":"vc-thumbnail-image"},o.default.createElement("div",{className:"h-16 w-16 border-solid border-2 border-black bg-white"},u)),o.default.createElement("div",{className:`flex flex-col ${l}`},o.default.createElement("h2",{className:"ml-1 sm:ml-0 md:ml-0 lg:ml-0 text-base tracking-wide leading-snug text-left line-clamp-2","data-testid":"vc-thumbnail-title"},null!=e?e:""),o.default.createElement("p",{className:"ml-1 sm:ml-0 md:ml-0 lg:ml-0 text-sm font-light text-center line-clamp-1","data-testid":"vc-thumbnail-createdAt"},null!=t?t:""))),o.default.createElement("div",{className:"flex items-center justify-center w-full mt-3 vc-thumbnail-footer"},o.default.createElement("h3",{className:"text-white text-sm text-right font-normal tracking-wide leading-tight flex-1"},"Verified"),o.default.createElement("div",{className:"flex items-center justify-center my-0 mx-1 h-10 w-10 rounded-full bg-white overflow-hidden"},o.default.createElement("div",{className:"flex items-center justify-center h-5/6 w-10/12 bg-white rounded-full border-solid border-4 border-emerald-700 overflow-hidden"},o.default.createElement("img",{className:"h-full w-full object-cover",src:h,alt:"credential icon"}))),o.default.createElement("h3",{className:"text-white text-sm text-left font-normal tracking-wide leading-tight flex-1"},"Credential")));const d=i?"":"vc-thumbnail-alt-container";return o.default.createElement("div",{onClick:c,className:`relative py-3 xxsm:py-1 rounded-3xl shadow-3xl bg-emerald-700 vc-thumbnail-container ${d} ${s}`,"data-testid":"vc-thumbnail"},o.default.createElement("div",{className:"h-full w-full absolute"},o.default.createElement("div",{className:"flex flex-col items-center justify-center z-10 text-center w-full"},o.default.createElement("div",{className:"flex flex-row items-center justify-center w-full px-2"},o.default.createElement("div",{className:"flex flex-row items-center justify-center w-full"},o.default.createElement("h2",{className:"text-base tracking-wide leading-snug text-center line-clamp-2","data-testid":"vc-thumbnail-title"},null!=e?e:""))),o.default.createElement("div",{className:"w-full mt-2"},o.default.createElement("p",{className:"text-sm font-light text-center line-clamp-1","data-testid":"vc-thumbnail-createdAt"},null!=t?t:"")),o.default.createElement("div",{className:"flex flex-row items-center justify-center mt-3 xxsm:mt-1 w-full"},o.default.createElement("div",{className:"inline-block relative overflow-hidden rounded-full shadow-3xl h-0 bg-white w-1/4 pb-25pct"},o.default.createElement("img",{className:"h-5/6 w-10/12 left-1 top-1 absolute rounded-full object-cover",src:r,alt:"issuer image"})),o.default.createElement("img",{className:"h-8 w-8 my-0 mx-4",src:VM,alt:"fat arrow icon"}),o.default.createElement("div",{className:"inline-block relative overflow-hidden rounded-full shadow-3xl h-0 bg-white w-1/4 pb-25pct"},o.default.createElement("img",{className:"w-full h-full absolute rounded-full object-cover border-solid border-4 border-white",src:n,alt:"user image"})))),i&&o.default.createElement("div",{className:"flex items-center justify-center w-full mt-4 xxxsm:mt-0"},o.default.createElement("div",{className:"border-solid border-2 border-black bg-white relative w-1/4 h-0 overflow-hidden pt-25pct pb-0 px-0","data-testid":"vc-thumbnail-badge"},o.default.createElement("img",{className:"h-full w-full object-cover absolute top-0 left-0",src:i,alt:"badge image"}))),o.default.createElement("div",{className:"flex items-center justify-center absolute right-2 bottom-5 xxsm:bottom-3 xxxsm:bottom-3 h-8 w-8 rounded-full bg-white overflow-hidden"},o.default.createElement("div",{className:"flex items-center justify-center h-5/6 w-10/12 bg-white rounded-full border-solid border-2 border-emerald-700 overflow-hidden"},o.default.createElement("img",{className:"h-full w-full object-cover",src:h,alt:"credential icon"})))))},exports.VCVerificationCheck=GM,exports.VCVerificationCheckWithText=YM,exports.ValidationStateIndicator=t_;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("./style-inject.es-f895d70b.js"),e=require("./Button-80d7b0e3.js"),r=require("./FlippyCard-170be269.js"),i=require("./CircleSpinner-6a1fdeca.js"),o=require("./MiniVCThumbnail-34cdca1a.js"),a=require("./VCCard-17cc4658.js"),n=require("./VCDisplayBackFace-ce7a3a45.js"),p=require("./VCDisplayCard-bda4ce7a.js");require("react");var d=require("./VCVerificationCheck-60e83f47.js"),l=require("./VCThumbnail-f96c7ff5.js"),m=require("./VCVerificationPill-8dbd32a5.js");require("./verified-check-f8df7905.js"),require("crypto"),require("process"),require("./icon.green.fat-arrow-a5f4951d.js");t.styleInject('/*! tailwindcss v3.0.24 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}html{-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-size:100%;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]{display:none}*,:after,:before{--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.static{position:static}.absolute{position:absolute}.relative{position:relative}.bottom-1{bottom:.25rem}.right-1{right:.25rem}.top-0{top:0}.left-1{left:.25rem}.top-1{top:.25rem}.left-0{left:0}.right-2{right:.5rem}.bottom-5{bottom:1.25rem}.z-10{z-index:10}.my-0{margin-bottom:0;margin-top:0}.mx-1{margin-left:.25rem;margin-right:.25rem}.my-2{margin-bottom:.5rem;margin-top:.5rem}.my-3{margin-bottom:.75rem;margin-top:.75rem}.mx-4{margin-left:1rem;margin-right:1rem}.my-3\\.5{margin-bottom:.875rem;margin-top:.875rem}.mb-3{margin-bottom:.75rem}.ml-2{margin-left:.5rem}.mt-3{margin-top:.75rem}.-mt-3{margin-top:-.75rem}.mt-2{margin-top:.5rem}.mt-7{margin-top:1.75rem}.mt-8{margin-top:2rem}.mt-\\[20px\\]{margin-top:20px}.ml-1{margin-left:.25rem}.mt-4{margin-top:1rem}.ml-3{margin-left:.75rem}.mr-3{margin-right:.75rem}.inline-block{display:inline-block}.flex{display:flex}.h-full{height:100%}.h-10{height:2.5rem}.h-5\\/6{height:83.333333%}.h-\\[100\\%\\]{height:100%}.h-\\[55\\%\\]{height:55%}.h-8{height:2rem}.h-\\[77\\%\\]{height:77%}.h-16{height:4rem}.h-4\\/6{height:66.666667%}.h-0{height:0}.h-\\[30px\\]{height:30px}.max-h-\\[48px\\]{max-height:48px}.max-h-\\[80px\\]{max-height:80px}.max-h-\\[1100px\\]{max-height:1100px}.max-h-\\[150px\\]{max-height:150px}.max-h-\\[600px\\]{max-height:600px}.max-h-\\[100px\\]{max-height:100px}.min-h-\\[120px\\]{min-height:120px}.min-h-\\[40px\\]{min-height:40px}.min-h-\\[600px\\]{min-height:600px}.min-h-\\[400px\\]{min-height:400px}.w-full{width:100%}.w-3\\/4{width:75%}.w-1\\/4{width:25%}.w-10{width:2.5rem}.w-10\\/12{width:83.333333%}.w-\\[110\\%\\]{width:110%}.w-8{width:2rem}.w-\\[100\\%\\]{width:100%}.w-16{width:4rem}.w-4\\/6{width:66.666667%}.w-\\[30px\\]{width:30px}.min-w-\\[40px\\]{min-width:40px}.max-w-sm{max-width:24rem}.max-w-\\[48px\\]{max-width:48px}.max-w-\\[80px\\]{max-width:80px}.max-w-\\[400px\\]{max-width:400px}.max-w-\\[100px\\]{max-width:100px}.flex-1{flex:1 1 0%}.translate-x-\\[10px\\]{--tw-translate-x:10px}.scale-x-\\[-1\\],.translate-x-\\[10px\\]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.scale-x-\\[-1\\]{--tw-scale-x:-1}.cursor-alias{cursor:alias}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.overflow-hidden{overflow:hidden}.rounded{border-radius:.25rem}.rounded-3xl{border-radius:1.5rem}.rounded-full{border-radius:9999px}.rounded-\\[50\\%\\]{border-radius:50%}.rounded-\\[22px\\]{border-radius:22px}.rounded-bl-\\[50\\%\\]{border-bottom-left-radius:50%}.rounded-br-\\[50\\%\\]{border-bottom-right-radius:50%}.border{border-width:1px}.border-4{border-width:4px}.border-2{border-width:2px}.border-solid{border-style:solid}.border-black{--tw-border-opacity:1;border-color:rgb(0 0 0/var(--tw-border-opacity))}.border-emerald-700{--tw-border-opacity:1;border-color:rgb(0 186 136/var(--tw-border-opacity))}.border-indigo-300{--tw-border-opacity:1;border-color:rgb(165 180 252/var(--tw-border-opacity))}.border-white{--tw-border-opacity:1;border-color:rgb(255 255 255/var(--tw-border-opacity))}.bg-emerald-700{--tw-bg-opacity:1;background-color:rgb(0 186 136/var(--tw-bg-opacity))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.bg-emerald-500{--tw-bg-opacity:1;background-color:rgb(64 203 166/var(--tw-bg-opacity))}.bg-yellow-400{--tw-bg-opacity:1;background-color:rgb(250 204 21/var(--tw-bg-opacity))}.bg-rose-600{--tw-bg-opacity:1;background-color:rgb(225 29 72/var(--tw-bg-opacity))}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-4{padding:1rem}.p-1{padding:.25rem}.p-7{padding:1.75rem}.p-2{padding:.5rem}.py-3{padding-bottom:.75rem;padding-top:.75rem}.px-3{padding-left:.75rem;padding-right:.75rem}.py-2{padding-bottom:.5rem;padding-top:.5rem}.px-4{padding-left:1rem;padding-right:1rem}.py-4{padding-bottom:1rem;padding-top:1rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-0{padding-left:0;padding-right:0}.px-5{padding-left:1.25rem;padding-right:1.25rem}.pb-25pct{padding-bottom:25%}.pt-25pct{padding-top:25%}.pb-0{padding-bottom:0}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.text-sm{font-size:.875rem;line-height:1.25rem}.text-2xl{font-size:1.5rem;line-height:2rem}.text-xs{font-size:.75rem;line-height:1rem}.text-base{font-size:1rem;line-height:1.5rem}.text-\\[10px\\]{font-size:10px}.text-\\[12px\\]{font-size:12px}.font-light{font-weight:300}.font-bold{font-weight:700}.font-semibold{font-weight:600}.font-normal{font-weight:400}.uppercase{text-transform:uppercase}.leading-snug{line-height:1.375}.leading-tight{line-height:1.25}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity))}.text-emerald-700{--tw-text-opacity:1;color:rgb(0 186 136/var(--tw-text-opacity))}.text-grayscale-900{--tw-text-opacity:1;color:rgb(24 34 78/var(--tw-text-opacity))}.text-grayscale-600{--tw-text-opacity:1;color:rgb(111 117 144/var(--tw-text-opacity))}.text-indigo-500{--tw-text-opacity:1;color:rgb(99 102 241/var(--tw-text-opacity))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.text-yellow-400{--tw-text-opacity:1;color:rgb(250 204 21/var(--tw-text-opacity))}.text-rose-600{--tw-text-opacity:1;color:rgb(225 29 72/var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity))}.subpixel-antialiased{-webkit-font-smoothing:auto;-moz-osx-font-smoothing:auto}.shadow-3xl{--tw-shadow:0px 0px 8px rgba(0,0,0,.25);--tw-shadow-colored:0px 0px 8px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.line-clamp-2{-webkit-line-clamp:2}.line-clamp-1,.line-clamp-2{-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.line-clamp-1{-webkit-line-clamp:1}.line-clamp-4{-webkit-box-orient:vertical;-webkit-line-clamp:4;display:-webkit-box;overflow:hidden}@media (min-width:640px){.sm\\:ml-0{margin-left:0}}@media (min-width:768px){.md\\:ml-0{margin-left:0}}@media (min-width:1024px){.lg\\:ml-0{margin-left:0}}@media (max-width:240px){.xxsm\\:bottom-3{bottom:.75rem}.xxsm\\:mt-1{margin-top:.25rem}.xxsm\\:h-\\[60px\\]{height:60px}.xxsm\\:w-\\[60px\\]{width:60px}.xxsm\\:py-1{padding-bottom:.25rem;padding-top:.25rem}}@media (max-width:200px){.xxxsm\\:bottom-3{bottom:.75rem}.xxxsm\\:mt-0{margin-top:0}}',{insertAt:"top"}),exports.Button=e.Button,exports.FlippyCard=r.FlippyCard,Object.defineProperty(exports,"CircleLoadingState",{enumerable:!0,get:function(){return i.CircleLoadingState}}),exports.MiniVCThumbnail=o.MiniVCThumbnail,exports.VCCard=a.VCCard,exports.VCDisplayBackFace=n.VCDisplayBackFace,exports.VCDisplayCard=p.VCDisplayCard,exports.VCVerificationCheck=d.VCVerificationCheck,exports.VCVerificationCheckWithText=d.VCVerificationCheckWithText,exports.VCThumbnail=l.VCThumbnail,exports.ValidationStateIndicator=m.ValidationStateIndicator;
|
|
81
2
|
//# sourceMappingURL=index.js.map
|