{"version":3,"file":"main.js","sources":["theme-29/virtual:init-settings","theme-29/virtual:theme","theme-29/discourse/templates/connectors/before-topic-list-body/category-sidebar.hbs","theme-29/discourse/initializers/script-tag-hbs-deprecations.js","theme-29/discourse/initializers/theme-field-36-desktop-html-script-1.js","theme-29/virtual:entrypoint:main"],"sourcesContent":["import { registerSettings } from \"discourse/lib/theme-settings-store\";\n\nregisterSettings(29, {\n  \"category_name\": \"Забота о здоровье коз\",\n  \"sidebar_alignment\": \"right\",\n  \"headline\": \"Быстрые ссылки\",\n  \"intro\": \"\",\n  \"list_items\": \"link, Скорая консультация ветеринара, http://forum.kozovod.com/c/goat-health/veterinary-first-aid|link, Правила скорой ветеринарной помощи, http://forum.kozovod.com/t/pravila-razdela-skoraya-veterinarnaya-pomoshh/8567|link, Помощь форумчан 2018, http://forum.kozovod.com/t/skoraya-pomoshh-ot-forumchan-2018/17254|link, Помощь форумчан 2019, http://forum.kozovod.com/t/skoraya-pomoshh-onlajn-ot-opytnyh-kozovodov-forumchan-2019/27115|link, Помощь форумчан 2020, http://forum.kozovod.com/t/skoraya-pomoshh-onlajn-ot-forumchan-kozovodov-2020/32959\"\n});\n","import { getObjectForTheme } from \"discourse/lib/theme-settings-store\";\n\nexport const settings = getObjectForTheme(29);\n\nexport function themePrefix(key) {\n  return `theme_translations.29.${key}`;\n}\n","\n       <div class=\"category-sidebar\"> {{mount-widget widget=\"category-sidebar\"}} </div>\n    ","import deprecated from \"discourse/lib/deprecated\";\n\nexport default {\n  initialize(){\n    const names = [\"/connectors/before-topic-list-body/category-sidebar\"];\n    names.forEach((name) => {\n      deprecated(\n        `[${name}] adding templates to a theme using <script type='text/x-handlebars'> is deprecated. Move to dedicated .hbs or .gjs files.`,\n        {\n          id: \"discourse.script-tag-hbs\",\n          url: \"https://meta.discourse.org/t/366482\",\n        }\n      )\n    });\n    const errors = [];\n    errors.forEach((error) => console.error(error));\n  }\n}\n","import { withPluginApi } from \"discourse/lib/plugin-api\";\nimport deprecated from \"discourse/lib/deprecated\";\n\nexport default {\n  name: \"theme-field-36-desktop-html-script-1\",\n  after: \"inject-objects\",\n\n  initialize() {\n    deprecated(\n      \"Adding JS code using <script type='text/discourse-plugin'> is deprecated. Move this code to a dedicated JavaScript file.\",\n      {\n        id: \"discourse.script-tag-discourse-plugin\",\n        url: \"https://meta.discourse.org/t/366482\",\n      }\n    )\n    withPluginApi(\"0.8\", (api) => {\n       \n    const container = Discourse.__container__;     \n    const { h } = require('virtual-dom');\n    \n    api.createWidget('category-sidebar', { \n        tagName: 'span',\n        \n        html(attrs, state) {\n            \n            const path = window.location.pathname;\n            let category;\n            const controller = container.lookup('controller:navigation/category');\n            category = controller.get(\"category\");\n            \n            if((/^\\/c\\//.test(path)) && (category.name == settings.category_name)) {\n                $(\".topic-list\").addClass(\"with-sidebar\"); \n                \n                var listItems = settings.list_items;\n                \n                return h('div#category-title-header' + '.' + category.slug, {\n                }, h('div.category-title-contents', [\n                h('h2#sidebar-headline', settings.headline),   \n                h('p.sidebar-intro', settings.intro),  \n                h('ul', [\n                listItems.split(\"|\").map(i => {\n                    var seg = $.map(i.split(\",\"), $.trim),\n                    type = seg[0],\n                    content = seg[1],\n                    href = seg[2];\n                    \n                    if (type == \"link\") {\n                        return h('li', [\n                        h(\n                        \"a\",\n                        {\n                            href: href,\n                            title: content},\n                            content\n                            )\n                            ])\n                        } else if (type == \"text\") {\n                            return h('li', content)\n                        \n                        } else if (type == \"subhead\") {\n                            return h('p', content)\n                        } \n                    }),  \n                    ]),  \n                    ]),\n                    );  \n                    \n                } else {\n                    $(\".topic-list\").removeClass(\"with-sidebar\");\n                }\n                \n            }      \n        }),\n        api.decorateWidget('category-sidebar:after', helper => {\n            helper.widget.appEvents.on('page:changed', () => {\n                helper.widget.scheduleRerender(); \n            });            \n        });\n    \n    });\n  }\n};\n","const compatModules = {};import \"virtual:init-settings\";\nimport * as Mod1 from \"./discourse/templates/connectors/before-topic-list-body/category-sidebar.hbs\";\ncompatModules[\"discourse/templates/connectors/before-topic-list-body/category-sidebar\"] = Mod1;\n\nexport * as discourse$templates$connectors$before__topic__list__body$category__sidebar$$__module from \"./discourse/templates/connectors/before-topic-list-body/category-sidebar.hbs\";\nexport {\ndefault as discourse$templates$connectors$before__topic__list__body$category__sidebar$$default\n} from \"./discourse/templates/connectors/before-topic-list-body/category-sidebar.hbs\";\nimport * as Mod2 from \"./discourse/initializers/script-tag-hbs-deprecations\";\ncompatModules[\"discourse/initializers/script-tag-hbs-deprecations\"] = Mod2;\n\nexport * as discourse$initializers$script__tag__hbs__deprecations$$__module from \"./discourse/initializers/script-tag-hbs-deprecations\";\nexport {\ndefault as discourse$initializers$script__tag__hbs__deprecations$$default\n} from \"./discourse/initializers/script-tag-hbs-deprecations\";\nimport * as Mod3 from \"./discourse/initializers/theme-field-36-desktop-html-script-1\";\ncompatModules[\"discourse/initializers/theme-field-36-desktop-html-script-1\"] = Mod3;\n\nexport * as discourse$initializers$theme__field__36__desktop__html__script__1$$__module from \"./discourse/initializers/theme-field-36-desktop-html-script-1\";\nexport {\ndefault as discourse$initializers$theme__field__36__desktop__html__script__1$$default\n} from \"./discourse/initializers/theme-field-36-desktop-html-script-1\";\nexport default compatModules;\n"],"names":["registerSettings","category_name","sidebar_alignment","headline","intro","list_items","settings","getObjectForTheme","categorySidebar","createTemplateFactory","id","block","moduleName","isStrictMode","deprecated","url","scriptTagHbsDeprecations","initialize","forEach","name","error","console","themeField36DesktopHtmlScript1","after","withPluginApi","api","container","Discourse","__container__","h","require","createWidget","tagName","html","attrs","state","path","window","location","pathname","category","lookup","get","test","$","addClass","listItems","slug","split","map","i","seg","trim","type","content","href","title","removeClass","decorateWidget","helper","widget","appEvents","on","scheduleRerender","compatModules","Mod1","Mod2","Mod3"],"mappings":";AAEAA,EAAiB,GAAI,CACnBC,cAAiB,wBACjBC,kBAAqB,QACrBC,SAAY,iBACZC,MAAS,GACTC,WAAc;ACLT,MAAMC,EAAWC,EAAkB;ACA5B,IAAAC,EAAAC,EAAA,C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