{"version":3,"file":"faq.63a9fbf3.js","sources":["../../src/components/faq.ts"],"sourcesContent":["import { defineComponent } from \"vue\";\r\nimport common from \"../core/core\";\r\nimport { $ref } from \"vue/macros\";\r\n\r\nexport default defineComponent({\r\n  data() {\r\n    return {\r\n      supportItemIndex: [],\r\n      supportSubItemIndex: {} as any,\r\n    };\r\n  },\r\n  mounted() {\r\n    this.AppService.faqSubject.subscribe((data) => {\r\n      const markers = document.querySelectorAll(\".faq-block-marker\");\r\n      if (markers[data.tabIndex] === this.$refs.faqBlockMarker) {\r\n        if (data.type === \"category\") {\r\n          if (!this.supportItemIndex.includes(data.index)) {\r\n            this.toggleSuppItem(data.index);\r\n          }\r\n          data.el?.scrollIntoView({ block: \"center\", behavior: \"smooth\" });\r\n        }\r\n        if (data.type === \"question\" || data.type === \"answer\") {\r\n          if (!this.supportItemIndex.includes(data.categoryIndex)) {\r\n            this.toggleSuppItem(data.categoryIndex);\r\n          }\r\n          if (!this.supportSubItemIndex[data.categoryIndex].includes(data.questionIndex)) {\r\n            this.toggleSuppSub(data.categoryIndex, data.questionIndex);\r\n          }\r\n          data.el?.scrollIntoView({ block: \"center\", behavior: \"smooth\" });\r\n        }\r\n      }\r\n    });\r\n  },\r\n  computed: {},\r\n  methods: {\r\n    toggleSuppItem(index: number) {\r\n      if (this.supportItemIndex.includes(index)) {\r\n        const i = this.supportItemIndex.findIndex((i) => i === index);\r\n        if (i > -1) {\r\n          this.supportItemIndex.splice(i, 1);\r\n        }\r\n      } else {\r\n        this.supportItemIndex.push(index);\r\n      }\r\n      this.supportSubItemIndex[index] = [];\r\n    },\r\n    toggleSuppSub(parentIndex: number, index: number) {\r\n      if (!this.supportSubItemIndex[parentIndex]?.length) {\r\n        this.supportSubItemIndex[parentIndex] = [];\r\n      }\r\n      if (this.supportSubItemIndex[parentIndex].includes(index)) {\r\n        const i = this.supportSubItemIndex[parentIndex].findIndex((i: any) => i === index);\r\n        if (i > -1) {\r\n          this.supportSubItemIndex[parentIndex].splice(i, 1);\r\n        }\r\n      } else {\r\n        this.supportSubItemIndex[parentIndex].push(index);\r\n      }\r\n    },\r\n    isActiveItem(id: number) {\r\n      return this.supportItemIndex.includes(id);\r\n    },\r\n    isActiveSubItem(id: number, subId: number) {\r\n      return this.supportSubItemIndex[id]?.includes(subId);\r\n    },\r\n  },\r\n  mixins: [common],\r\n});\r\n"],"names":["faq","defineComponent","data","_a","_b","index","i","parentIndex","id","subId","common"],"mappings":"qYAIA,MAAAA,EAAeC,EAAgB,CAC7B,MAAO,CACE,MAAA,CACL,iBAAkB,CAAC,EACnB,oBAAqB,CAAC,CAAA,CAE1B,EACA,SAAU,CACR,KAAK,WAAW,WAAW,UAAWC,GAAS,SAC7B,SAAS,iBAAiB,mBAAmB,EACjDA,EAAK,YAAc,KAAK,MAAM,iBACpCA,EAAK,OAAS,aACX,KAAK,iBAAiB,SAASA,EAAK,KAAK,GACvC,KAAA,eAAeA,EAAK,KAAK,GAEhCC,EAAAD,EAAK,KAAL,MAAAC,EAAS,eAAe,CAAE,MAAO,SAAU,SAAU,aAEnDD,EAAK,OAAS,YAAcA,EAAK,OAAS,YACvC,KAAK,iBAAiB,SAASA,EAAK,aAAa,GAC/C,KAAA,eAAeA,EAAK,aAAa,EAEnC,KAAK,oBAAoBA,EAAK,eAAe,SAASA,EAAK,aAAa,GAC3E,KAAK,cAAcA,EAAK,cAAeA,EAAK,aAAa,GAE3DE,EAAAF,EAAK,KAAL,MAAAE,EAAS,eAAe,CAAE,MAAO,SAAU,SAAU,YAEzD,CACD,CACH,EACA,SAAU,CAAC,EACX,QAAS,CACP,eAAeC,EAAe,CAC5B,GAAI,KAAK,iBAAiB,SAASA,CAAK,EAAG,CACzC,MAAMC,EAAI,KAAK,iBAAiB,UAAWA,GAAMA,IAAMD,CAAK,EACxDC,EAAI,IACD,KAAA,iBAAiB,OAAOA,EAAG,CAAC,CACnC,MAEK,KAAA,iBAAiB,KAAKD,CAAK,EAE7B,KAAA,oBAAoBA,GAAS,EACpC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