Your IP : 18.217.14.237


Current Path : /var/www/www-root/data/www/info.monolith-realty.ru/bitrix/js/ui/manual/dist/
Upload File :
Current File : /var/www/www-root/data/www/info.monolith-realty.ru/bitrix/js/ui/manual/dist/manual.bundle.js.map

{"version":3,"file":"manual.bundle.js","sources":["../src/manual.js"],"sourcesContent":["import { ajax, Type, Tag } from 'main.core';\n\ntype Params = {\n\tmanualCode: string,\n\turlParams?: Object,\n\tanalyticsLabel?: Object,\n\tanalytics?: Object,\n\twidth?: number\n}\n\ntype ResponseInitParams = {\n\tdata: {\n\t\turl: string\n\t}\n}\n\nexport class Manual\n{\n\tconstructor(params: Params): void\n\t{\n\t\tthis.manualCode = Type.isString(params.manualCode) ? params.manualCode : '';\n\t\tthis.width = Type.isNumber(params.width) ? params.width : 1000;\n\t\tthis.urlParams = Type.isPlainObject(params.urlParams) ? params.urlParams : {};\n\t\tthis.analyticsLabel = Type.isPlainObject(params.analyticsLabel) ? params.analyticsLabel : null;\n\t\tthis.analytics = Type.isPlainObject(params.analytics) ? params.analytics : null;\n\n\t\tthis.sidePanelId = `manual-side-panel-${this.manualCode}`;\n\t}\n\n\tstatic show(...args): void\n\t{\n\t\tlet manualCode;\n\t\tlet urlParams;\n\t\tlet analyticsLabel;\n\t\tlet analytics;\n\n\t\tif (Type.isPlainObject(args[0]) && args.length === 1)\n\t\t{\n\t\t\t({ manualCode, urlParams = {}, analyticsLabel = null, analytics = null } = args[0]);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t[manualCode, urlParams, analyticsLabel, analytics] = args;\n\t\t}\n\n\t\tconst manual = new Manual({\n\t\t\tmanualCode,\n\t\t\turlParams,\n\t\t\tanalyticsLabel,\n\t\t\tanalytics,\n\t\t});\n\n\t\tmanual.open();\n\t}\n\n\topen(): void\n\t{\n\t\tif (this.isOpen())\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tBX.SidePanel.Instance.open(\n\t\t\tthis.sidePanelId,\n\t\t\t{\n\t\t\t\tcontentCallback: () => this.createFrame(),\n\t\t\t\twidth: this.width,\n\t\t\t},\n\t\t);\n\t}\n\n\tcreateFrame(): Promise\n\t{\n\t\tconst config = {\n\t\t\tdata: {\n\t\t\t\tmanualCode: this.manualCode,\n\t\t\t\turlParams: this.urlParams,\n\t\t\t},\n\t\t};\n\n\t\tif (this.analyticsLabel)\n\t\t{\n\t\t\tconfig.analyticsLabel = this.analyticsLabel;\n\t\t}\n\t\telse if (this.analytics)\n\t\t{\n\t\t\tconfig.analytics = this.analytics;\n\t\t}\n\n\t\treturn new Promise((resolve, reject) => {\n\t\t\t// eslint-disable-next-line promise/catch-or-return\n\t\t\tajax.runAction('ui.manual.getInitParams', config)\n\t\t\t\t.then((response: ResponseInitParams) => {\n\t\t\t\t\tresolve(this.renderFrame(response.data.url));\n\t\t\t\t})\n\t\t\t;\n\t\t});\n\t}\n\n\trenderFrame(url: string): HTMLElement\n\t{\n\t\tconst frameStyles = 'position: absolute; left: 0; top: 0; padding: 0;'\n\t\t\t+ ' border: none; margin: 0; width: 100%; height: 100%;';\n\n\t\treturn Tag.render`<iframe style=\"${frameStyles}\" src=\"${url}\"></iframe>`;\n\t}\n\n\tgetSidePanel(): BX.SidePanel.Slider\n\t{\n\t\treturn BX.SidePanel.Instance.getSlider(this.sidePanelId);\n\t}\n\n\tisOpen(): boolean\n\t{\n\t\treturn this.getSidePanel() && this.getSidePanel().isOpen();\n\t}\n}\n"],"names":["Manual","constructor","params","manualCode","Type","isString","width","isNumber","urlParams","isPlainObject","analyticsLabel","analytics","sidePanelId","show","args","length","manual","open","isOpen","BX","SidePanel","Instance","contentCallback","createFrame","config","data","Promise","resolve","reject","ajax","runAction","then","response","renderFrame","url","frameStyles","Tag","render","getSidePanel","getSlider"],"mappings":";;;;;;;;AAAA,CAgBO,MAAMA,MAAM,CACnB;GACCC,WAAW,CAACC,MAAc,EAC1B;KACC,IAAI,CAACC,UAAU,GAAGC,cAAI,CAACC,QAAQ,CAACH,MAAM,CAACC,UAAU,CAAC,GAA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