0
0
Fork 0
mirror of https://github.com/nextcloud/server.git synced 2025-01-30 22:37:01 +00:00
nextcloud_server/dist/core-recommendedapps.js
Ferdinand Thiessen 1bed442cec
chore: Compile assets
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-01-16 22:20:31 +01:00

2 lines
No EOL
10 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

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 e,t={38382:(e,t,n)=>{var i=n(21777),o=n(53334),r=n(85471),s=n(35947);const a=null===(c=(0,i.HW)())?(0,s.YK)().setApp("core").build():(0,s.YK)().setApp("core").setUid(c.uid).build();var c;(0,s.YK)().setApp("unified-search").detectUser().build();var d=n(32981),l=n(63814),p=n(65043);function u(e,t,n){(function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")})(e,t),t.set(e,n)}function h(e,t,n){return e.set(m(e,t),n),n}function A(e,t){return e.get(m(e,t))}function m(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object")}function v(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class f{constructor(e){v(this,"value",void 0),v(this,"next",void 0),this.value=e}}var g=new WeakMap,C=new WeakMap,b=new WeakMap;class y{constructor(){u(this,g,void 0),u(this,C,void 0),u(this,b,void 0),this.clear()}enqueue(e){var t;const n=new f(e);A(g,this)?(A(C,this).next=n,h(C,this,n)):(h(g,this,n),h(C,this,n)),h(b,this,(t=A(b,this),++t))}dequeue(){var e;const t=A(g,this);if(t)return h(g,this,A(g,this).next),h(b,this,(e=A(b,this),--e)),t.value}peek(){if(A(g,this))return A(g,this).value}clear(){h(g,this,void 0),h(C,this,void 0),h(b,this,0)}get size(){return A(b,this)}*[Symbol.iterator](){let e=A(g,this);for(;e;)yield e.value,e=e.next}}function w(e){_(e);const t=new y;let n=0;const i=()=>{n<e&&t.size>0&&(t.dequeue()(),n++)},o=async(e,t,o)=>{const r=(async()=>e(...o))();t(r);try{await r}catch{}n--,i()},r=function(r){for(var s=arguments.length,a=new Array(s>1?s-1:0),c=1;c<s;c++)a[c-1]=arguments[c];return new Promise((s=>{((r,s,a)=>{new Promise((e=>{t.enqueue(e)})).then(o.bind(void 0,r,s,a)),(async()=>{await Promise.resolve(),n<e&&i()})()})(r,s,a)}))};return Object.defineProperties(r,{activeCount:{get:()=>n},pendingCount:{get:()=>t.size},clearQueue:{value(){t.clear()}},concurrency:{get:()=>e,set(o){_(o),e=o,queueMicrotask((()=>{for(;n<e&&t.size>0;)i()}))}}}),r}function _(e){if(!Number.isInteger(e)&&e!==Number.POSITIVE_INFINITY||!(e>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up")}var x=n(70995),k=n(32073);const S={calendar:{description:(0,o.t)("core","Schedule work & meetings, synced with all your devices."),icon:(0,l.d0)("core","places/calendar.svg")},contacts:{description:(0,o.t)("core","Keep your colleagues and friends in one place without leaking their private info."),icon:(0,l.d0)("core","places/contacts.svg")},mail:{description:(0,o.t)("core","Simple email app nicely integrated with Files, Contacts and Calendar."),icon:(0,l.d0)("core","actions/mail.svg")},spreed:{description:(0,o.t)("core","Chatting, video calls, screen sharing, online meetings and web conferencing in your browser and with mobile apps."),icon:(0,l.d0)("core","apps/spreed.svg")},richdocuments:{name:"Nextcloud Office",description:(0,o.t)("core","Collaborative documents, spreadsheets and presentations, built on Collabora Online."),icon:(0,l.d0)("core","apps/richdocuments.svg")},notes:{description:(0,o.t)("core","Distraction free note taking app."),icon:(0,l.d0)("core","apps/notes.svg")},richdocumentscode:{hidden:!0}},I=Object.keys(S),P={name:"RecommendedApps",components:{NcCheckboxRadioSwitch:k.A,NcButton:x.A},data:()=>({showInstallButton:!1,installingApps:!1,loadingApps:!0,loadingAppsError:!1,apps:[],defaultPageUrl:(0,d.C)("core","defaultPageUrl")}),computed:{recommendedApps(){return this.apps.filter((e=>I.includes(e.id)))},isAnyAppSelected(){return this.recommendedApps.some((e=>e.isSelected))}},async mounted(){try{const{data:e}=await p.Ay.get((0,l.Jv)("settings/apps/list"));a.info(`${e.apps.length} apps fetched`),this.apps=e.apps.map((e=>Object.assign(e,{loading:!1,installationError:!1,isSelected:e.isCompatible}))),a.debug(`${this.recommendedApps.length} recommended apps found`,{apps:this.recommendedApps}),this.showInstallButton=!0}catch(e){a.error("could not fetch app list",{error:e}),this.loadingAppsError=!0}finally{this.loadingApps=!1}},methods:{installApps(){this.installingApps=!0;const e=w(1),t=this.recommendedApps.filter((e=>!e.active&&e.isCompatible&&e.canInstall&&e.isSelected)).map((t=>e((async()=>(a.info(`installing ${t.id}`),t.loading=!0,p.Ay.post((0,l.Jv)("settings/apps/enable"),{appIds:[t.id],groups:[]}).catch((e=>{a.error(`could not install ${t.id}`,{error:e}),t.isSelected=!1,t.installationError=!0})).then((()=>{a.info(`installed ${t.id}`),t.loading=!1,t.active=!0})))))));a.debug(`installing ${t.length} recommended apps`),Promise.all(t).then((()=>{a.info("all recommended apps installed, redirecting …"),window.location=this.defaultPageUrl})).catch((e=>a.error("could not install recommended apps",{error:e})))},customIcon:e=>e in S&&S[e].icon?S[e].icon:(a.warn(`no app icon for recommended app ${e}`),(0,l.d0)("core","places/default-app-icon.svg")),customName:e=>e.id in S&&S[e.id].name||e.name,customDescription:e=>e in S?S[e].description:(a.warn(`no app description for recommended app ${e}`),""),isHidden:e=>e in S&&!!S[e].hidden,toggleSelect(e){if(!(e in S)||!this.showInstallButton)return;const t=this.apps.findIndex((t=>t.id===e));this.$set(this.apps[t],"isSelected",!this.apps[t].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(40414),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;const F=(0,n(14486).A)(P,(function(){var e=this,t=e._self._c;return t("div",{staticClass:"guest-box"},[t("h2",[e._v(e._s(e.t("core","Recommended apps")))]),e._v(" "),e.loadingApps?t("p",{staticClass:"loading text-center"},[e._v("\n\t\t"+e._s(e.t("core","Loading apps …"))+"\n\t")]):e.loadingAppsError?t("p",{staticClass:"loading-error text-center"},[e._v("\n\t\t"+e._s(e.t("core","Could not fetch list of apps from the App Store."))+"\n\t")]):e._e(),e._v(" "),e._l(e.recommendedApps,(function(n){return t("div",{key:n.id,staticClass:"app"},[e.isHidden(n.id)?e._e():[t("img",{attrs:{src:e.customIcon(n.id),alt:""}}),e._v(" "),t("div",{staticClass:"info"},[t("h3",[e._v(e._s(e.customName(n)))]),e._v(" "),t("p",{domProps:{textContent:e._s(e.customDescription(n.id))}}),e._v(" "),n.installationError?t("p",[t("strong",[e._v(e._s(e.t("core","App download or installation failed")))])]):n.isCompatible?n.canInstall?e._e():t("p",[t("strong",[e._v(e._s(e.t("core","Cannot install this app")))])]):t("p",[t("strong",[e._v(e._s(e.t("core","Cannot install this app because it is not compatible")))])])]),e._v(" "),t("NcCheckboxRadioSwitch",{attrs:{checked:n.isSelected||n.active,disabled:!n.isCompatible||n.active,loading:n.loading},on:{"update:checked":function(t){return e.toggleSelect(n.id)}}})]],2)})),e._v(" "),t("div",{staticClass:"dialog-row"},[e.showInstallButton&&!e.installingApps?t("NcButton",{attrs:{type:"tertiary",role:"link",href:e.defaultPageUrl}},[e._v("\n\t\t\t"+e._s(e.t("core","Skip"))+"\n\t\t")]):e._e(),e._v(" "),e.showInstallButton?t("NcButton",{attrs:{type:"primary",disabled:e.installingApps||!e.isAnyAppSelected},on:{click:function(t){return t.stopPropagation(),t.preventDefault(),e.installApps.apply(null,arguments)}}},[e._v("\n\t\t\t"+e._s(e.installingApps?e.t("core","Installing apps …"):e.t("core","Install recommended apps"))+"\n\t\t")]):e._e()],1)],2)}),[],!1,null,"02d18598",null).exports;n.nc=(0,i.aV)(),r.Ay.mixin({methods:{t:o.Tl}}),(new(r.Ay.extend(F))).$mount("#recommended-apps"),a.debug("recommended apps view rendered")},40414:(e,t,n)=>{n.d(t,{A:()=>a});var i=n(71354),o=n.n(i),r=n(76314),s=n.n(r)()(o());s.push([e.id,".dialog-row[data-v-02d18598]{display:flex;justify-content:end;margin-top:8px}p.loading[data-v-02d18598],p.loading-error[data-v-02d18598]{height:100px}p[data-v-02d18598]:last-child{margin-top:10px}.text-center[data-v-02d18598]{text-align:center}.app[data-v-02d18598]{display:flex;flex-direction:row}.app img[data-v-02d18598]{height:50px;width:50px;filter:var(--background-invert-if-dark)}.app img[data-v-02d18598],.app .info[data-v-02d18598]{padding:12px}.app .info h3[data-v-02d18598],.app .info p[data-v-02d18598]{text-align:start}.app .info h3[data-v-02d18598]{margin-top:0}.app .checkbox-radio-switch[data-v-02d18598]{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",sourceRoot:""}]);const a=s}},n={};function i(e){var o=n[e];if(void 0!==o)return o.exports;var r=n[e]={id:e,loaded:!1,exports:{}};return t[e].call(r.exports,r,r.exports,i),r.loaded=!0,r.exports}i.m=t,e=[],i.O=(t,n,o,r)=>{if(!n){var s=1/0;for(l=0;l<e.length;l++){n=e[l][0],o=e[l][1],r=e[l][2];for(var a=!0,c=0;c<n.length;c++)(!1&r||s>=r)&&Object.keys(i.O).every((e=>i.O[e](n[c])))?n.splice(c--,1):(a=!1,r<s&&(s=r));if(a){e.splice(l--,1);var d=o();void 0!==d&&(t=d)}}return t}r=r||0;for(var l=e.length;l>0&&e[l-1][2]>r;l--)e[l]=e[l-1];e[l]=[n,o,r]},i.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return i.d(t,{a:t}),t},i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.e=()=>Promise.resolve(),i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),i.j=2696,(()=>{i.b=document.baseURI||self.location.href;var e={2696:0};i.O.j=t=>0===e[t];var t=(t,n)=>{var o,r,s=n[0],a=n[1],c=n[2],d=0;if(s.some((t=>0!==e[t]))){for(o in a)i.o(a,o)&&(i.m[o]=a[o]);if(c)var l=c(i)}for(t&&t(n);d<s.length;d++)r=s[d],i.o(e,r)&&e[r]&&e[r][0](),e[r]=0;return i.O(l)},n=self.webpackChunknextcloud=self.webpackChunknextcloud||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})(),i.nc=void 0;var o=i.O(void 0,[4208],(()=>i(38382)));o=i.O(o)})();
//# sourceMappingURL=core-recommendedapps.js.map?v=a2d64ef58323a1be6de3