/*! For license information please see settings-vue-settings-admin-ai.js.LICENSE.txt */ !function(){var e,n={43393:function(e,n,r){"use strict";var o=r(20144),i=r(48033),a=r(20571),s=r.n(a),l=r(13299),c=r.n(l),u=r(36456),f=r.n(u),d=r(10861),p=r.n(d),h=r(9980),g=r.n(h),v={name:"DragVerticalIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},m=r(51900),b=(0,m.Z)(v,(function(){var t=this,e=t._self._c;return e("span",t._b({staticClass:"material-design-icon drag-vertical-icon",attrs:{"aria-hidden":!t.title,"aria-label":t.title,role:"img"},on:{click:function(e){return t.$emit("click",e)}}},"span",t.$attrs,!1),[e("svg",{staticClass:"material-design-icon__svg",attrs:{fill:t.fillColor,width:t.size,height:t.size,viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M9,3H11V5H9V3M13,3H15V5H13V3M9,7H11V9H9V7M13,7H15V9H13V7M9,11H11V13H9V11M13,11H15V13H13V11M9,15H11V17H9V15M13,15H15V17H13V15M9,19H11V21H9V19M13,19H15V21H13V19Z"}},[t.title?e("title",[t._v(t._s(t.title))]):t._e()])])])}),[],!1,null,null,null).exports,y={name:"ArrowDownIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},w=(0,m.Z)(y,(function(){var t=this,e=t._self._c;return e("span",t._b({staticClass:"material-design-icon arrow-down-icon",attrs:{"aria-hidden":!t.title,"aria-label":t.title,role:"img"},on:{click:function(e){return t.$emit("click",e)}}},"span",t.$attrs,!1),[e("svg",{staticClass:"material-design-icon__svg",attrs:{fill:t.fillColor,width:t.size,height:t.size,viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M11,4H13V16L18.5,10.5L19.92,11.92L12,19.84L4.08,11.92L5.5,10.5L11,16V4Z"}},[t.title?e("title",[t._v(t._s(t.title))]):t._e()])])])}),[],!1,null,null,null).exports,x={name:"ArrowUpIcon",emits:["click"],props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}},_=(0,m.Z)(x,(function(){var t=this,e=t._self._c;return e("span",t._b({staticClass:"material-design-icon arrow-up-icon",attrs:{"aria-hidden":!t.title,"aria-label":t.title,role:"img"},on:{click:function(e){return t.$emit("click",e)}}},"span",t.$attrs,!1),[e("svg",{staticClass:"material-design-icon__svg",attrs:{fill:t.fillColor,width:t.size,height:t.size,viewBox:"0 0 24 24"}},[e("path",{attrs:{d:"M13,20H11V8L5.5,13.5L4.08,12.08L12,4.16L19.92,12.08L18.5,13.5L13,8V20Z"}},[t.title?e("title",[t._v(t._s(t.title))]):t._e()])])])}),[],!1,null,null,null).exports,S=r(43554),E=r(79753),C=r(25108);function A(t){return A="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},A(t)}function T(){T=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function l(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,n){return t[e]=n}}function c(t,e,n,o){var i=e&&e.prototype instanceof d?e:d,a=Object.create(i.prototype),s=new C(o||[]);return r(a,"_invoke",{value:x(t,n,s)}),a}function u(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var f={};function d(){}function p(){}function h(){}var g={};l(g,i,(function(){return this}));var v=Object.getPrototypeOf,m=v&&v(v(O([])));m&&m!==e&&n.call(m,i)&&(g=m);var b=h.prototype=d.prototype=Object.create(g);function y(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){function o(r,i,a,s){var l=u(t[r],t,i);if("throw"!==l.type){var c=l.arg,f=c.value;return f&&"object"==A(f)&&n.call(f,"__await")?e.resolve(f.__await).then((function(t){o("next",t,a,s)}),(function(t){o("throw",t,a,s)})):e.resolve(f).then((function(t){c.value=t,a(c)}),(function(t){return o("throw",t,a,s)}))}s(l.arg)}var i;r(this,"_invoke",{value:function(t,n){function r(){return new e((function(e,r){o(t,n,e,r)}))}return i=i?i.then(r,r):r()}})}function x(t,e,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var s=_(a,n);if(s){if(s===f)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var l=u(t,e,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}function _(t,e){var n=e.method,r=t.iterator[n];if(void 0===r)return e.delegate=null,"throw"===n&&t.iterator.return&&(e.method="return",e.arg=void 0,_(t,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),f;var o=u(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function C(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function O(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=n.call(i,"catchLoc"),l=n.call(i,"finallyLoc");if(s&&l){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),E(n),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;E(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:O(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),f}},t}function O(t,e,n,r,o,i,a){try{var s=t[i](a),l=s.value}catch(t){return void n(t)}s.done?e(l):Promise.resolve(l).then(r,o)}function D(t){return function(t){if(Array.isArray(t))return k(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return k(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?k(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0},hasTextProcessing:function(){return Object.keys(this.settings["ai.textprocessing_provider_preferences"]).length>0&&Array.isArray(this.textProcessingTaskTypes)}},methods:{moveUp:function(t){var e;(e=this.settings["ai.translation_provider_preferences"]).splice.apply(e,[Math.min(t-1,0),0].concat(D(this.settings["ai.translation_provider_preferences"].splice(t,1)))),this.saveChanges()},moveDown:function(t){var e;(e=this.settings["ai.translation_provider_preferences"]).splice.apply(e,[t+1,0].concat(D(this.settings["ai.translation_provider_preferences"].splice(t,1)))),this.saveChanges()},saveChanges:function(){var t,e=this;return(t=T().mark((function t(){var n;return T().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e.loading=!0,n={settings:e.settings},t.prev=2,t.next=5,i.Z.put((0,E.generateUrl)("/settings/api/admin/ai"),n);case 5:t.next=10;break;case 7:t.prev=7,t.t0=t.catch(2),C.error("could not save changes",t.t0);case 10:e.loading=!1;case 11:case"end":return t.stop()}}),t,null,[[2,7]])})),function(){var e=this,n=arguments;return new Promise((function(r,o){var i=t.apply(e,n);function a(t){O(i,r,o,a,s,"next",t)}function s(t){O(i,r,o,a,s,"throw",t)}a(void 0)}))})()},getTaskType:function(t){return Array.isArray(this.textProcessingTaskTypes)?this.textProcessingTaskTypes.find((function(e){return e.class===t})):null}}},P=M,I=r(93379),N=r.n(I),j=r(7795),L=r.n(j),R=r(90569),F=r.n(R),H=r(3565),V=r.n(H),B=r(19216),$=r.n(B),U=r(44589),Y=r.n(U),X=r(32118),G={};G.styleTagTransform=Y(),G.setAttributes=V(),G.insert=F().bind(null,"head"),G.domAPI=L(),G.insertStyleElement=$(),N()(X.Z,G),X.Z&&X.Z.locals&&X.Z.locals;var z=(0,m.Z)(P,(function(){var t=this,e=t._self._c;return e("div",[e("NcSettingsSection",{attrs:{name:t.t("settings","Machine translation"),description:t.t("settings","Machine translation can be implemented by different apps. Here you can define the precedence of the machine translation apps you have installed at the moment.")}},[e("draggable",{on:{change:t.saveChanges},model:{value:t.settings["ai.translation_provider_preferences"],callback:function(e){t.$set(t.settings,"ai.translation_provider_preferences",e)},expression:"settings['ai.translation_provider_preferences']"}},t._l(t.settings["ai.translation_provider_preferences"],(function(n,r){var o;return e("div",{key:n,staticClass:"draggable__item"},[e("DragVerticalIcon"),t._v(" "),e("span",{staticClass:"draggable__number"},[t._v(t._s(r+1))]),t._v(" "+t._s(null===(o=t.translationProviders.find((function(t){return t.class===n})))||void 0===o?void 0:o.name)+"\n\t\t\t\t"),e("NcButton",{attrs:{"aria-label":"Move up",type:"tertiary"},on:{click:function(e){return t.moveUp(r)}},scopedSlots:t._u([{key:"icon",fn:function(){return[e("ArrowUpIcon")]},proxy:!0}],null,!0)}),t._v(" "),e("NcButton",{attrs:{"aria-label":"Move down",type:"tertiary"},on:{click:function(e){return t.moveDown(r)}},scopedSlots:t._u([{key:"icon",fn:function(){return[e("ArrowDownIcon")]},proxy:!0}],null,!0)})],1)})),0)],1),t._v(" "),e("NcSettingsSection",{attrs:{name:t.t("settings","Speech-To-Text"),description:t.t("settings","Speech-To-Text can be implemented by different apps. Here you can set which app should be used.")}},[t._l(t.sttProviders,(function(n){return[e("NcCheckboxRadioSwitch",{key:n.class,attrs:{checked:t.settings["ai.stt_provider"],value:n.class,name:"stt_provider",type:"radio"},on:{"update:checked":[function(e){return t.$set(t.settings,"ai.stt_provider",e)},t.saveChanges]}},[t._v("\n\t\t\t\t"+t._s(n.name)+"\n\t\t\t")])]})),t._v(" "),t.hasStt?t._e():[e("NcCheckboxRadioSwitch",{attrs:{disabled:"",type:"radio"}},[t._v("\n\t\t\t\t"+t._s(t.t("settings","None of your currently installed apps provide Speech-To-Text functionality"))+"\n\t\t\t")])]],2),t._v(" "),e("NcSettingsSection",{attrs:{name:t.t("settings","Text processing"),description:t.t("settings","Text processing tasks can be implemented by different apps. Here you can set which app should be used for which task.")}},[t._l(Object.keys(t.settings["ai.textprocessing_provider_preferences"]),(function(n){return[e("div",{key:n},[e("h3",[t._v(t._s(t.t("settings","Task:"))+" "+t._s(t.getTaskType(n).name))]),t._v(" "),e("p",[t._v(t._s(t.getTaskType(n).description))]),t._v(" "),e("p",[t._v(" ")]),t._v(" "),e("NcSelect",{attrs:{clearable:!1,options:t.textProcessingProviders.filter((function(t){return t.taskType===n})).map((function(t){return t.class}))},on:{input:t.saveChanges},scopedSlots:t._u([{key:"option",fn:function(e){var n,r=e.label;return[t._v("\n\t\t\t\t\t\t"+t._s(null===(n=t.textProcessingProviders.find((function(t){return t.class===r})))||void 0===n?void 0:n.name)+"\n\t\t\t\t\t")]}},{key:"selected-option",fn:function(e){var n,r=e.label;return[t._v("\n\t\t\t\t\t\t"+t._s(null===(n=t.textProcessingProviders.find((function(t){return t.class===r})))||void 0===n?void 0:n.name)+"\n\t\t\t\t\t")]}}],null,!0),model:{value:t.settings["ai.textprocessing_provider_preferences"][n],callback:function(e){t.$set(t.settings["ai.textprocessing_provider_preferences"],n,e)},expression:"settings['ai.textprocessing_provider_preferences'][type]"}}),t._v(" "),e("p",[t._v(" ")])],1)]})),t._v(" "),t.hasTextProcessing?t._e():[e("p",[t._v(t._s(t.t("settings","None of your currently installed apps provide Text processing functionality")))])]],2)],1)}),[],!1,null,"98efc7fc",null).exports;r.nc=btoa(OC.requestToken),o.default.prototype.t=t,window.OC=window.OC||{},window.OC.Settings=window.OC.Settings||{},(new(o.default.extend(z))).$mount("#ai-settings")},32118:function(t,e,n){"use strict";var r=n(87537),o=n.n(r),i=n(23645),a=n.n(i)()(o());a.push([t.id,"\n.draggable__item[data-v-98efc7fc] {\n\tmargin-bottom: 5px;\n display: flex;\n align-items: center;\n}\n.draggable__item[data-v-98efc7fc],\n.draggable__item *[data-v-98efc7fc] {\n cursor: grab;\n}\n.draggable__number[data-v-98efc7fc] {\n\tborder-radius: 20px;\n\tborder: 2px solid var(--color-primary-default);\n\tcolor: var(--color-primary-default);\n padding: 0px 7px;\n\tmargin-right: 3px;\n}\n.drag-vertical-icon[data-v-98efc7fc] {\n float: left;\n}\n","",{version:3,sources:["webpack://./apps/settings/src/components/AdminAI.vue"],names:[],mappings:";AAsJA;CACA,kBAAA;EACA,aAAA;EACA,mBAAA;AACA;AAEA;;EAEA,YAAA;AACA;AAEA;CACA,mBAAA;CACA,8CAAA;CACA,mCAAA;EACA,gBAAA;CACA,iBAAA;AACA;AAEA;EACA,WAAA;AACA",sourcesContent:["\n\n