{"version":3,"file":"cta-form-trigger-DtzQ-RYG.js","sources":["../../../Scripts/components/cta-form-trigger.html?vue-htmltemplate","../../../Scripts/components/cta-form-trigger.ts"],"sourcesContent":["\n\t{{ value }}\n\n","import { Vue, Component, Prop, Watch } from \"@wagich/vue-facing-decorator-metadata\";\nimport { CustomForm } from \"../custom-form/custom-form\";\n\nimport { render } from \"./cta-form-trigger.html\";\nimport { BModalComponent } from \"buefy/types/components\";\n\n@Component({\n\trender,\n\tcomponents: {\n\t\tCustomForm,\n\t}\n})\nexport class CtaFormTrigger extends Vue {\n\tprivate modal: BModalComponent;\n\n\t@Prop({ required: true })\n\tformId: string;\n\n\t@Prop()\n\ttype: string;\n\n\t@Prop()\n\tvalue: string;\n\n\t@Prop({ type: [String, Object] })\n\tmetadata: string | object;\n\n\topen() {\n\t\tlet decodedMetadata = {};\n\t\tif (typeof (this.metadata) === \"string\") {\n\t\t\tdecodedMetadata = JSON.parse(this.metadata);\n\t\t} else {\n\t\t\tdecodedMetadata = this.metadata;\n\t\t}\n\n\t\tthis.modal = this.$buefy.modal.open({\n\t\t\tcomponent: CustomForm,\n\t\t\tprops: {\n\t\t\t\tformId: this.formId,\n\t\t\t\tmetadata: decodedMetadata\n\t\t\t},\n\t\t\tevents: {\n\t\t\t\tclose: this.close\n\t\t\t}\n\t\t});\n\t\tdocument.documentElement.dispatchEvent(new CustomEvent(\"modal-opened\"));\n\t\tdocument.documentElement.addEventListener(\"modal-opened\", e => {\n\t\t\tthis.modal.close();\n\t\t}, { once: true });\n\t}\n\n\tclose() {\n\t\tthis.modal.close();\n\t}\n}\n"],"names":["_createBlock","type","open","_withCtx","_createElementVNode","value","CtaFormTrigger","Vue","decodedMetadata","metadata","JSON","parse","modal","$buefy","component","CustomForm","props","formId","events","close","document","documentElement","dispatchEvent","CustomEvent","addEventListener","e","once","required","String","Object","render","components"],"mappings":";;;;;;;;uBAAAA,WAEW,CAAA,mBAAA,EAAA;AAFA,IAAA,IAAI,EAAEC,IAAI,C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