diff --git a/js/dist/admin.js b/js/dist/admin.js index 6e98c49..554ffca 100644 --- a/js/dist/admin.js +++ b/js/dist/admin.js @@ -1,2 +1,2 @@ -(()=>{var t={n:e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return t.d(a,{a}),a},d:(e,a)=>{for(var n in a)t.o(a,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:a[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};(()=>{"use strict";t.r(e);const a=flarum.core.compat["admin/app"];var n=t.n(a);n().initializers.add("datlechin/flarum-chatgpt",(function(){n().extensionData.for("datlechin-chatgpt").registerSetting({setting:"datlechin-chatgpt.api_key",type:"text",label:n().translator.trans("datlechin-chatgpt.admin.settings.api_key_label"),help:n().translator.trans("datlechin-chatgpt.admin.settings.api_key_help",{a:m("a",{href:"https://platform.openai.com/account/api-keys",target:"_blank",rel:"noopener"})}),placeholder:"sk-..."}).registerSetting({setting:"datlechin-chatgpt.model",type:"dropdown",options:{"text-davinci-003":"text-davinci-003"},label:n().translator.trans("datlechin-chatgpt.admin.settings.model_label"),help:n().translator.trans("datlechin-chatgpt.admin.settings.model_help",{a:m("a",{href:"https://platform.openai.com/docs/models/overview",target:"_blank",rel:"noopener"})})}).registerSetting({setting:"datlechin-chatgpt.max_tokens",type:"number",label:n().translator.trans("datlechin-chatgpt.admin.settings.max_tokens_label"),help:n().translator.trans("datlechin-chatgpt.admin.settings.max_tokens_help",{a:m("a",{href:"https://help.openai.com/en/articles/4936856",target:"_blank",rel:"noopener"})}),default:100}).registerSetting({setting:"datlechin-chatgpt.user_prompt",type:"text",label:n().translator.trans("datlechin-chatgpt.admin.settings.user_prompt_label"),help:n().translator.trans("datlechin-chatgpt.admin.settings.user_prompt_help")}).registerSetting({setting:"datlechin-chatgpt.user_prompt_badge_text",type:"text",label:n().translator.trans("datlechin-chatgpt.admin.settings.user_prompt_badge_label"),help:n().translator.trans("datlechin-chatgpt.admin.settings.user_prompt_badge_help")}).registerSetting({setting:"datlechin-chatgpt.enable_on_discussion_started",type:"boolean",label:n().translator.trans("datlechin-chatgpt.admin.settings.enable_on_discussion_started_label"),help:n().translator.trans("datlechin-chatgpt.admin.settings.enable_on_discussion_started_help")}).registerPermission({label:n().translator.trans("datlechin-chatgpt.admin.permissions.use_chatgpt_assistant_label"),icon:"fas fa-comment",permission:"discussion.useChatGPTAssistant",allowGuest:!1},"start")}))})(),module.exports=e})(); +(()=>{var t={n:e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return t.d(a,{a}),a},d:(e,a)=>{for(var n in a)t.o(a,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:a[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};(()=>{"use strict";t.r(e);const a=flarum.core.compat["admin/app"];var n=t.n(a);n().initializers.add("datlechin/flarum-chatgpt",(function(){n().extensionData.for("datlechin-chatgpt").registerSetting({setting:"datlechin-chatgpt.api_key",type:"text",label:n().translator.trans("datlechin-chatgpt.admin.settings.api_key_label"),help:n().translator.trans("datlechin-chatgpt.admin.settings.api_key_help",{a:m("a",{href:"https://platform.openai.com/account/api-keys",target:"_blank",rel:"noopener"})}),placeholder:"sk-..."}).registerSetting({setting:"datlechin-chatgpt.model",type:"dropdown",options:{"text-davinci-003":"text-davinci-003","gpt-3.5-turbo":"gpt-3.5-turbo","gpt-3.5-turbo-16k":"gpt-3.5-turbo-16k","text-davinci-002":"text-davinci-002","code-davinci-002":"code-davinci-002","gpt-4":"gpt-4","gpt-4-0613":"gpt-4-0613","gpt-4-32k":"gpt-4-32k","gpt-4-32k-0613":"gpt-4-32k-0613","gpt-4-0314":"gpt-4-0314","gpt-4-32k-0314":"gpt-4-32k-0314"},label:n().translator.trans("datlechin-chatgpt.admin.settings.model_label"),help:n().translator.trans("datlechin-chatgpt.admin.settings.model_help",{a:m("a",{href:"https://platform.openai.com/docs/models/overview",target:"_blank",rel:"noopener"})})}).registerSetting({setting:"datlechin-chatgpt.max_tokens",type:"number",label:n().translator.trans("datlechin-chatgpt.admin.settings.max_tokens_label"),help:n().translator.trans("datlechin-chatgpt.admin.settings.max_tokens_help",{a:m("a",{href:"https://help.openai.com/en/articles/4936856",target:"_blank",rel:"noopener"})}),default:100}).registerSetting({setting:"datlechin-chatgpt.user_prompt",type:"text",label:n().translator.trans("datlechin-chatgpt.admin.settings.user_prompt_label"),help:n().translator.trans("datlechin-chatgpt.admin.settings.user_prompt_help")}).registerSetting({setting:"datlechin-chatgpt.user_prompt_badge_text",type:"text",label:n().translator.trans("datlechin-chatgpt.admin.settings.user_prompt_badge_label"),help:n().translator.trans("datlechin-chatgpt.admin.settings.user_prompt_badge_help")}).registerSetting({setting:"datlechin-chatgpt.enable_on_discussion_started",type:"boolean",label:n().translator.trans("datlechin-chatgpt.admin.settings.enable_on_discussion_started_label"),help:n().translator.trans("datlechin-chatgpt.admin.settings.enable_on_discussion_started_help")}).registerPermission({label:n().translator.trans("datlechin-chatgpt.admin.permissions.use_chatgpt_assistant_label"),icon:"fas fa-comment",permission:"discussion.useChatGPTAssistant",allowGuest:!1},"start")}))})(),module.exports=e})(); //# sourceMappingURL=admin.js.map \ No newline at end of file diff --git a/js/dist/admin.js.map b/js/dist/admin.js.map index 35328ae..252eb88 100644 --- a/js/dist/admin.js.map +++ b/js/dist/admin.js.map @@ -1 +1 @@ -{"version":3,"file":"admin.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,IACz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qB,sDAC5BK,KAAML,IAAAA,WAAAA,MAAqB,uDAE5BC,gBAAgB,CACfC,QAAS,2CACTC,KAAM,OACNC,MAAOJ,IAAAA,WAAAA,MAAqB,4DAC5BK,KAAML,IAAAA,WAAAA,MAAqB,6DAE5BC,gBAAgB,CACfC,QAAS,iDACTC,KAAM,UACNC,MAAOJ,IAAAA,WAAAA,MAAqB,uEAC5BK,KAAML,IAAAA,WAAAA,MAAqB,wEAE5Ba,mBACC,CACET,MAAOJ,IAAAA,WAAAA,MAAqB,mEAC5Bc,KAAM,iBACNC,WAAY,iCACZC,YAAY,GAEd,QAEN,G","sources":["webpack://@datlechin/flarum-chatgpt/webpack/bootstrap","webpack://@datlechin/flarum-chatgpt/webpack/runtime/compat get default export","webpack://@datlechin/flarum-chatgpt/webpack/runtime/define property getters","webpack://@datlechin/flarum-chatgpt/webpack/runtime/hasOwnProperty shorthand","webpack://@datlechin/flarum-chatgpt/webpack/runtime/make namespace object","webpack://@datlechin/flarum-chatgpt/external root \"flarum.core.compat['admin/app']\"","webpack://@datlechin/flarum-chatgpt/./src/admin/index.tsx"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/app'];","import app from 'flarum/admin/app';\n\napp.initializers.add('datlechin/flarum-chatgpt', () => {\n app.extensionData\n .for('datlechin-chatgpt')\n .registerSetting({\n setting: 'datlechin-chatgpt.api_key',\n type: 'text',\n label: app.translator.trans('datlechin-chatgpt.admin.settings.api_key_label'),\n help: app.translator.trans('datlechin-chatgpt.admin.settings.api_key_help', {\n a: ,\n }),\n placeholder: 'sk-...',\n })\n .registerSetting({\n setting: 'datlechin-chatgpt.model',\n type: 'dropdown',\n options: {\n 'text-davinci-003': 'text-davinci-003',\n },\n label: app.translator.trans('datlechin-chatgpt.admin.settings.model_label'),\n help: app.translator.trans('datlechin-chatgpt.admin.settings.model_help', {\n a: ,\n }),\n })\n .registerSetting({\n setting: 'datlechin-chatgpt.max_tokens',\n type: 'number',\n label: app.translator.trans('datlechin-chatgpt.admin.settings.max_tokens_label'),\n help: app.translator.trans('datlechin-chatgpt.admin.settings.max_tokens_help', {\n a: ,\n }),\n default: 100,\n })\n .registerSetting({\n setting: 'datlechin-chatgpt.user_prompt',\n type: 'text',\n label: app.translator.trans('datlechin-chatgpt.admin.settings.user_prompt_label'),\n help: app.translator.trans('datlechin-chatgpt.admin.settings.user_prompt_help'),\n })\n .registerSetting({\n setting: 'datlechin-chatgpt.user_prompt_badge_text',\n type: 'text',\n label: app.translator.trans('datlechin-chatgpt.admin.settings.user_prompt_badge_label'),\n help: app.translator.trans('datlechin-chatgpt.admin.settings.user_prompt_badge_help'),\n })\n .registerSetting({\n setting: 'datlechin-chatgpt.enable_on_discussion_started',\n type: 'boolean',\n label: app.translator.trans('datlechin-chatgpt.admin.settings.enable_on_discussion_started_label'),\n help: app.translator.trans('datlechin-chatgpt.admin.settings.enable_on_discussion_started_help'),\n })\n .registerPermission(\n {\n label: app.translator.trans('datlechin-chatgpt.admin.permissions.use_chatgpt_assistant_label'),\n icon: 'fas fa-comment',\n permission: 'discussion.useChatGPTAssistant',\n allowGuest: false,\n },\n 'start'\n );\n});\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","app","registerSetting","setting","type","label","help","m","href","target","rel","placeholder","options","default","registerPermission","icon","permission","allowGuest"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"admin.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,IACzBH,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,+BCL9D,MAAM,EAA+BC,OAAOC,KAAKC,OAAO,a,aCExDC,IAAAA,aAAAA,IAAqB,4BAA4B,WAC/CA,IAAAA,cAAAA,IACO,qBACJC,gBAAgB,CACfC,QAAS,4BACTC,KAAM,OACNC,MAAOJ,IAAAA,WAAAA,MAAqB,kDAC5BK,KAAML,IAAAA,WAAAA,MAAqB,gDAAiD,CAC1EpB,EAAG0B,EAAA,KAAGC,KAAK,+CAA+CC,OAAO,SAASC,IAAI,eAEhFC,YAAa,WAEdT,gBAAgB,CACfC,QAAS,0BACTC,KAAM,WACNQ,QAAS,CACP,mBAAoB,mBACpB,gBAAiB,gBACjB,oBAAqB,oBACrB,mBAAoB,mBACpB,mBAAoB,mBACpB,QAAS,QACT,aAAc,aACd,YAAa,YACb,iBAAkB,iBAClB,aAAc,aACd,iBAAkB,kBAEpBP,MAAOJ,IAAAA,WAAAA,MAAqB,gDAC5BK,KAAML,IAAAA,WAAAA,MAAqB,8CAA+C,CACxEpB,EAAG0B,EAAA,KAAGC,KAAK,mDAAmDC,OAAO,SAASC,IAAI,iBAGrFR,gBAAgB,CACfC,QAAS,+BACTC,KAAM,SACNC,MAAOJ,IAAAA,WAAAA,MAAqB,qDAC5BK,KAAML,IAAAA,WAAAA,MAAqB,mDAAoD,CAC7EpB,EAAG0B,EAAA,KAAGC,KAAK,8CAA8CC,OAAO,SAASC,IAAI,eAE/EG,QAAS,MAEVX,gBAAgB,CACfC,QAAS,gCACTC,KAAM,OACNC,MAAOJ,IAAAA,WAAAA,MAAqB,sDAC5BK,KAAML,IAAAA,WAAAA,MAAqB,uDAE5BC,gBAAgB,CACfC,QAAS,2CACTC,KAAM,OACNC,MAAOJ,IAAAA,WAAAA,MAAqB,4DAC5BK,KAAML,IAAAA,WAAAA,MAAqB,6DAE5BC,gBAAgB,CACfC,QAAS,iDACTC,KAAM,UACNC,MAAOJ,IAAAA,WAAAA,MAAqB,uEAC5BK,KAAML,IAAAA,WAAAA,MAAqB,wEAE5Ba,mBACC,CACET,MAAOJ,IAAAA,WAAAA,MAAqB,mEAC5Bc,KAAM,iBACNC,WAAY,iCACZC,YAAY,GAEd,QAEN,G","sources":["webpack://@datlechin/flarum-chatgpt/webpack/bootstrap","webpack://@datlechin/flarum-chatgpt/webpack/runtime/compat get default export","webpack://@datlechin/flarum-chatgpt/webpack/runtime/define property getters","webpack://@datlechin/flarum-chatgpt/webpack/runtime/hasOwnProperty shorthand","webpack://@datlechin/flarum-chatgpt/webpack/runtime/make namespace object","webpack://@datlechin/flarum-chatgpt/external root \"flarum.core.compat['admin/app']\"","webpack://@datlechin/flarum-chatgpt/./src/admin/index.tsx"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/app'];","import app from 'flarum/admin/app';\n\napp.initializers.add('datlechin/flarum-chatgpt', () => {\n app.extensionData\n .for('datlechin-chatgpt')\n .registerSetting({\n setting: 'datlechin-chatgpt.api_key',\n type: 'text',\n label: app.translator.trans('datlechin-chatgpt.admin.settings.api_key_label'),\n help: app.translator.trans('datlechin-chatgpt.admin.settings.api_key_help', {\n a: ,\n }),\n placeholder: 'sk-...',\n })\n .registerSetting({\n setting: 'datlechin-chatgpt.model',\n type: 'dropdown',\n options: {\n 'text-davinci-003': 'text-davinci-003',\n 'gpt-3.5-turbo': 'gpt-3.5-turbo',\n 'gpt-3.5-turbo-16k': 'gpt-3.5-turbo-16k',\n 'text-davinci-002': 'text-davinci-002',\n 'code-davinci-002': 'code-davinci-002',\n 'gpt-4': 'gpt-4',\n 'gpt-4-0613': 'gpt-4-0613',\n 'gpt-4-32k': 'gpt-4-32k',\n 'gpt-4-32k-0613': 'gpt-4-32k-0613',\n 'gpt-4-0314': 'gpt-4-0314',\n 'gpt-4-32k-0314': 'gpt-4-32k-0314',\n },\n label: app.translator.trans('datlechin-chatgpt.admin.settings.model_label'),\n help: app.translator.trans('datlechin-chatgpt.admin.settings.model_help', {\n a: ,\n }),\n })\n .registerSetting({\n setting: 'datlechin-chatgpt.max_tokens',\n type: 'number',\n label: app.translator.trans('datlechin-chatgpt.admin.settings.max_tokens_label'),\n help: app.translator.trans('datlechin-chatgpt.admin.settings.max_tokens_help', {\n a: ,\n }),\n default: 100,\n })\n .registerSetting({\n setting: 'datlechin-chatgpt.user_prompt',\n type: 'text',\n label: app.translator.trans('datlechin-chatgpt.admin.settings.user_prompt_label'),\n help: app.translator.trans('datlechin-chatgpt.admin.settings.user_prompt_help'),\n })\n .registerSetting({\n setting: 'datlechin-chatgpt.user_prompt_badge_text',\n type: 'text',\n label: app.translator.trans('datlechin-chatgpt.admin.settings.user_prompt_badge_label'),\n help: app.translator.trans('datlechin-chatgpt.admin.settings.user_prompt_badge_help'),\n })\n .registerSetting({\n setting: 'datlechin-chatgpt.enable_on_discussion_started',\n type: 'boolean',\n label: app.translator.trans('datlechin-chatgpt.admin.settings.enable_on_discussion_started_label'),\n help: app.translator.trans('datlechin-chatgpt.admin.settings.enable_on_discussion_started_help'),\n })\n .registerPermission(\n {\n label: app.translator.trans('datlechin-chatgpt.admin.permissions.use_chatgpt_assistant_label'),\n icon: 'fas fa-comment',\n permission: 'discussion.useChatGPTAssistant',\n allowGuest: false,\n },\n 'start'\n );\n});\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","app","registerSetting","setting","type","label","help","m","href","target","rel","placeholder","options","default","registerPermission","icon","permission","allowGuest"],"sourceRoot":""} \ No newline at end of file