nextcloud/dist/core-recommendedapps.js
Ferdinand Thiessen 98a4b959ec
chore: compile assets
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2026-01-05 02:23:41 +01:00

2 lines
No EOL
11 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(()=>{"use strict";var t,e={12803(t,e,n){n.d(e,{A:()=>s});var i=n(71354),a=n.n(i),o=n(76314),r=n.n(o)()(a());r.push([t.id,".dialog-row[data-v-73d013bf]{display:flex;justify-content:end;margin-top:8px}p.loading[data-v-73d013bf],p.loading-error[data-v-73d013bf]{height:100px}p[data-v-73d013bf]:last-child{margin-top:10px}.text-center[data-v-73d013bf]{text-align:center}.app[data-v-73d013bf]{display:flex;flex-direction:row}.app img[data-v-73d013bf]{height:50px;width:50px;filter:var(--background-invert-if-dark)}.app img[data-v-73d013bf],.app .info[data-v-73d013bf]{padding:12px}.app .info h3[data-v-73d013bf],.app .info p[data-v-73d013bf]{text-align:start}.app .info h3[data-v-73d013bf]{margin-top:0}.app .checkbox-radio-switch[data-v-73d013bf]{margin-inline-start:auto;padding:0 2px}","",{version:3,sources:["webpack://./core/src/components/setup/RecommendedApps.vue"],names:[],mappings:"AACA,6BACC,YAAA,CACA,mBAAA,CACA,cAAA,CAIA,4DAEC,YAAA,CAGD,8BACC,eAAA,CAIF,8BACC,iBAAA,CAGD,sBACC,YAAA,CACA,kBAAA,CAEA,0BACC,WAAA,CACA,UAAA,CACA,uCAAA,CAGD,sDACC,YAAA,CAIA,6DACC,gBAAA,CAGD,+BACC,YAAA,CAIF,6CACC,wBAAA,CACA,aAAA",sourcesContent:["\n.dialog-row {\n\tdisplay: flex;\n\tjustify-content: end;\n\tmargin-top: 8px;\n}\n\np {\n\t&.loading,\n\t&.loading-error {\n\t\theight: 100px;\n\t}\n\n\t&:last-child {\n\t\tmargin-top: 10px;\n\t}\n}\n\n.text-center {\n\ttext-align: center;\n}\n\n.app {\n\tdisplay: flex;\n\tflex-direction: row;\n\n\timg {\n\t\theight: 50px;\n\t\twidth: 50px;\n\t\tfilter: var(--background-invert-if-dark);\n\t}\n\n\timg, .info {\n\t\tpadding: 12px;\n\t}\n\n\t.info {\n\t\th3, p {\n\t\t\ttext-align: start;\n\t\t}\n\n\t\th3 {\n\t\t\tmargin-top: 0;\n\t\t}\n\t}\n\n\t.checkbox-radio-switch {\n\t\tmargin-inline-start: auto;\n\t\tpadding: 0 2px;\n\t}\n}\n"],sourceRoot:""}]);const s=r},24598(t,e,n){var i=n(21777),a=n(53334),o=n(85471),r=n(19051),s=n(81222),d=n(63814);function l(t,e,n){(function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")})(t,e),e.set(t,n)}function p(t,e,n){return t.set(u(t,e),n),n}function c(t,e){return t.get(u(t,e))}function u(t,e,n){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}function h(t,e,n){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class m{constructor(t){h(this,"value",void 0),h(this,"next",void 0),this.value=t}}var A=new WeakMap,f=new WeakMap,g=new WeakMap;class v{constructor(){l(this,A,void 0),l(this,f,void 0),l(this,g,void 0),this.clear()}enqueue(t){var e;const n=new m(t);c(A,this)?(c(f,this).next=n,p(f,this,n)):(p(A,this,n),p(f,this,n)),p(g,this,(e=c(g,this),++e))}dequeue(){var t;const e=c(A,this);if(e)return p(A,this,c(A,this).next),p(g,this,(t=c(g,this),--t)),e.value}peek(){if(c(A,this))return c(A,this).value}clear(){p(A,this,void 0),p(f,this,void 0),p(g,this,0)}get size(){return c(g,this)}*[Symbol.iterator](){let t=c(A,this);for(;t;)yield t.value,t=t.next}*drain(){for(;c(A,this);)yield this.dequeue()}}function b(t){C(t);const e=new v;let n=0;const i=()=>{n<t&&e.size>0&&(n++,e.dequeue()())},a=async(t,e,a)=>{const o=(async()=>t(...a))();e(o);try{await o}catch{}n--,i()},o=(o,...r)=>new Promise(s=>{((o,r,s)=>{new Promise(t=>{e.enqueue(t)}).then(a.bind(void 0,o,r,s)),n<t&&i()})(o,s,r)});return Object.defineProperties(o,{activeCount:{get:()=>n},pendingCount:{get:()=>e.size},clearQueue:{value(){e.clear()}},concurrency:{get:()=>t,set(a){C(a),t=a,queueMicrotask(()=>{for(;n<t&&e.size>0;)i()})}},map:{async value(t,e){const n=Array.from(t,(t,n)=>this(e,t,n));return Promise.all(n)}}}),o}function C(t){if(!Number.isInteger(t)&&t!==Number.POSITIVE_INFINITY||!(t>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up")}var y=n(74095),w=n(32073),x=n(35947);const _=null===(k=(0,i.HW)())?(0,x.YK)().setApp("core").build():(0,x.YK)().setApp("core").setUid(k.uid).build();var k;(0,x.YK)().setApp("unified-search").detectUser().build();const S={calendar:{description:(0,a.t)("core","Schedule work & meetings, synced with all your devices."),icon:(0,d.d0)("core","places/calendar.svg")},contacts:{description:(0,a.t)("core","Keep your colleagues and friends in one place without leaking their private info."),icon:(0,d.d0)("core","places/contacts.svg")},mail:{description:(0,a.t)("core","Simple email app nicely integrated with Files, Contacts and Calendar."),icon:(0,d.d0)("core","actions/mail.svg")},spreed:{description:(0,a.t)("core","Chatting, video calls, screen sharing, online meetings and web conferencing in your browser and with mobile apps."),icon:(0,d.d0)("core","apps/spreed.svg")},richdocuments:{name:"Nextcloud Office",description:(0,a.t)("core","Collaborative documents, spreadsheets and presentations, built on Collabora Online."),icon:(0,d.d0)("core","apps/richdocuments.svg")},notes:{description:(0,a.t)("core","Distraction free note taking app."),icon:(0,d.d0)("core","apps/notes.svg")},richdocumentscode:{hidden:!0}},I=Object.keys(S),P={name:"RecommendedApps",components:{NcCheckboxRadioSwitch:w.A,NcButton:y.A},data:()=>({showInstallButton:!1,installingApps:!1,loadingApps:!0,loadingAppsError:!1,apps:[],defaultPageUrl:(0,s.C)("core","defaultPageUrl")}),computed:{recommendedApps(){return this.apps.filter(t=>I.includes(t.id))},isAnyAppSelected(){return this.recommendedApps.some(t=>t.isSelected)}},async mounted(){try{const{data:t}=await r.Ay.get((0,d.Jv)("settings/apps/list"));_.info(`${t.apps.length} apps fetched`),this.apps=t.apps.map(t=>Object.assign(t,{loading:!1,installationError:!1,isSelected:t.isCompatible})),_.debug(`${this.recommendedApps.length} recommended apps found`,{apps:this.recommendedApps}),this.showInstallButton=!0}catch(t){_.error("could not fetch app list",{error:t}),this.loadingAppsError=!0}finally{this.loadingApps=!1}},methods:{installApps(){this.installingApps=!0;const t=b(1),e=this.recommendedApps.filter(t=>!t.active&&t.isCompatible&&t.canInstall&&t.isSelected).map(e=>t(async()=>(_.info(`installing ${e.id}`),e.loading=!0,r.Ay.post((0,d.Jv)("settings/apps/enable"),{appIds:[e.id],groups:[]}).catch(t=>{_.error(`could not install ${e.id}`,{error:t}),e.isSelected=!1,e.installationError=!0}).then(()=>{_.info(`installed ${e.id}`),e.loading=!1,e.active=!0}))));_.debug(`installing ${e.length} recommended apps`),Promise.all(e).then(()=>{_.info("all recommended apps installed, redirecting …"),window.location=this.defaultPageUrl}).catch(t=>_.error("could not install recommended apps",{error:t}))},customIcon:t=>t in S&&S[t].icon?S[t].icon:(_.warn(`no app icon for recommended app ${t}`),(0,d.d0)("core","places/default-app-icon.svg")),customName:t=>t.id in S&&S[t.id].name||t.name,customDescription:t=>t in S?S[t].description:(_.warn(`no app description for recommended app ${t}`),""),isHidden:t=>t in S&&!!S[t].hidden,toggleSelect(t){if(!(t in S)||!this.showInstallButton)return;const e=this.apps.findIndex(e=>e.id===t);this.$set(this.apps[e],"isSelected",!this.apps[e].isSelected)}}};var O=n(85072),B=n.n(O),j=n(97825),E=n.n(j),T=n(77659),N=n.n(T),D=n(55056),$=n.n(D),Y=n(10540),U=n.n(Y),M=n(41113),R=n.n(M),q=n(12803),z={};z.styleTagTransform=R(),z.setAttributes=$(),z.insert=N().bind(null,"head"),z.domAPI=E(),z.insertStyleElement=U(),B()(q.A,z),q.A&&q.A.locals&&q.A.locals;var W=(0,n(14486).A)(P,function(){var t=this,e=t._self._c;return e("div",{staticClass:"guest-box",attrs:{"data-cy-setup-recommended-apps":""}},[e("h2",[t._v(t._s(t.t("core","Recommended apps")))]),t._v(" "),t.loadingApps?e("p",{staticClass:"loading text-center"},[t._v("\n\t\t"+t._s(t.t("core","Loading apps …"))+"\n\t")]):t.loadingAppsError?e("p",{staticClass:"loading-error text-center"},[t._v("\n\t\t"+t._s(t.t("core","Could not fetch list of apps from the App Store."))+"\n\t")]):t._e(),t._v(" "),t._l(t.recommendedApps,function(n){return e("div",{key:n.id,staticClass:"app"},[t.isHidden(n.id)?t._e():[e("img",{attrs:{src:t.customIcon(n.id),alt:""}}),t._v(" "),e("div",{staticClass:"info"},[e("h3",[t._v(t._s(t.customName(n)))]),t._v(" "),e("p",{domProps:{textContent:t._s(t.customDescription(n.id))}}),t._v(" "),n.installationError?e("p",[e("strong",[t._v(t._s(t.t("core","App download or installation failed")))])]):n.isCompatible?n.canInstall?t._e():e("p",[e("strong",[t._v(t._s(t.t("core","Cannot install this app")))])]):e("p",[e("strong",[t._v(t._s(t.t("core","Cannot install this app because it is not compatible")))])])]),t._v(" "),e("NcCheckboxRadioSwitch",{attrs:{"model-value":n.isSelected||n.active,disabled:!n.isCompatible||n.active,loading:n.loading},on:{"update:modelValue":function(e){return t.toggleSelect(n.id)}}})]],2)}),t._v(" "),e("div",{staticClass:"dialog-row"},[t.showInstallButton&&!t.installingApps?e("NcButton",{attrs:{"data-cy-setup-recommended-apps-skip":"",href:t.defaultPageUrl,variant:"tertiary"}},[t._v("\n\t\t\t"+t._s(t.t("core","Skip"))+"\n\t\t")]):t._e(),t._v(" "),t.showInstallButton?e("NcButton",{attrs:{"data-cy-setup-recommended-apps-install":"",disabled:t.installingApps||!t.isAnyAppSelected,variant:"primary"},on:{click:function(e){return e.stopPropagation(),e.preventDefault(),t.installApps.apply(null,arguments)}}},[t._v("\n\t\t\t"+t._s(t.installingApps?t.t("core","Installing apps …"):t.t("core","Install recommended apps"))+"\n\t\t")]):t._e()],1)],2)},[],!1,null,"73d013bf",null);const F=W.exports;n.nc=(0,i.aV)(),o.Ay.mixin({methods:{t:a.Tl}}),(new(o.Ay.extend(F))).$mount("#recommended-apps"),_.debug("recommended apps view rendered")}},n={};function i(t){var a=n[t];if(void 0!==a)return a.exports;var o=n[t]={id:t,loaded:!1,exports:{}};return e[t].call(o.exports,o,o.exports,i),o.loaded=!0,o.exports}i.m=e,t=[],i.O=(e,n,a,o)=>{if(!n){var r=1/0;for(p=0;p<t.length;p++){for(var[n,a,o]=t[p],s=!0,d=0;d<n.length;d++)(!1&o||r>=o)&&Object.keys(i.O).every(t=>i.O[t](n[d]))?n.splice(d--,1):(s=!1,o<r&&(r=o));if(s){t.splice(p--,1);var l=a();void 0!==l&&(e=l)}}return e}o=o||0;for(var p=t.length;p>0&&t[p-1][2]>o;p--)t[p]=t[p-1];t[p]=[n,a,o]},i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.e=()=>Promise.resolve(),i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),i.j=2696,(()=>{i.b="undefined"!=typeof document&&document.baseURI||self.location.href;var t={2696:0};i.O.j=e=>0===t[e];var e=(e,n)=>{var a,o,[r,s,d]=n,l=0;if(r.some(e=>0!==t[e])){for(a in s)i.o(s,a)&&(i.m[a]=s[a]);if(d)var p=d(i)}for(e&&e(n);l<r.length;l++)o=r[l],i.o(t,o)&&t[o]&&t[o][0](),t[o]=0;return i.O(p)},n=globalThis.webpackChunknextcloud_ui_legacy=globalThis.webpackChunknextcloud_ui_legacy||[];n.forEach(e.bind(null,0)),n.push=e.bind(null,n.push.bind(n))})(),i.nc=void 0;var a=i.O(void 0,[4208],()=>i(24598));a=i.O(a)})();
//# sourceMappingURL=core-recommendedapps.js.map?v=aef707797ad2b9a03a43