2088f9095e724efdf960e285ce2ee52eceaf06dbbfc1d53cd949bd2f5ebe5914.json raw
1 {"ast":null,"code":"import { NostrHelper } from '@common';\nimport { IconButtonComponent } from \"../icon-button/icon-button.component\";\nimport * as i0 from \"@angular/core\";\nexport let PubkeyComponent = /*#__PURE__*/(() => {\n class PubkeyComponent {\n value;\n first = 9;\n last = 5;\n color = '#dee2e6bf';\n npub;\n npubString;\n ngOnInit() {\n const pubkeyObject = NostrHelper.getNostrPubkeyObject(this.value);\n this.npub = pubkeyObject.npub;\n this.npubString = NostrHelper.splitKey(pubkeyObject.npub, this.first, this.last);\n }\n copyToClipboard() {\n if (!this.npub) {\n return;\n }\n navigator.clipboard.writeText(this.npub);\n }\n static ɵfac = function PubkeyComponent_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || PubkeyComponent)();\n };\n static ɵcmp = /*@__PURE__*/i0.ɵɵdefineComponent({\n type: PubkeyComponent,\n selectors: [[\"lib-pubkey\"]],\n inputs: {\n value: \"value\",\n first: \"first\",\n last: \"last\",\n color: \"color\"\n },\n decls: 3,\n vars: 3,\n consts: [[\"icon\", \"copy\", 3, \"click\"]],\n template: function PubkeyComponent_Template(rf, ctx) {\n if (rf & 1) {\n i0.ɵɵelementStart(0, \"span\");\n i0.ɵɵtext(1);\n i0.ɵɵelementEnd();\n i0.ɵɵelementStart(2, \"lib-icon-button\", 0);\n i0.ɵɵlistener(\"click\", function PubkeyComponent_Template_lib_icon_button_click_2_listener() {\n return ctx.copyToClipboard();\n });\n i0.ɵɵelementEnd();\n }\n if (rf & 2) {\n i0.ɵɵstyleProp(\"color\", ctx.color);\n i0.ɵɵadvance();\n i0.ɵɵtextInterpolate(ctx.npubString);\n }\n },\n dependencies: [IconButtonComponent],\n styles: [\"[_nghost-%COMP%] {\\n display: flex;\\n flex-direction: row;\\n align-items: center;\\n column-gap: calc(var(--size) / 2);\\n}\"]\n });\n }\n return PubkeyComponent;\n})();","map":null,"metadata":{},"sourceType":"module","externalDependencies":[]}