nextcloud/dist/profile-main.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

2 lines
89 KiB
JavaScript
Raw Permalink Normal View History

(()=>{var e,t,n,r={7838:(e,t,n)=>{"use strict";n.d(t,{N:()=>Qt}),n(33807);var r=n(43819),i=n(86435),o=n(76643),s=n(87798),a=n(19998),l=n(3288),c=n(8019),u=n(85471),d=n(40173),p=n(76514),f=n(21777),h=n(19051),m=n(63814),A=n(32505),g=n(86432),v=n(3168),C=n(44111),b=n(51431),k=n(88751),y=n(33239),x=n(47970),_=n(64546);const w={name:"NcReferenceList",components:{NcReferenceWidget:g.f},props:{text:{type:String,default:""},referenceData:{type:Array,default:null},limit:{type:Number,default:1},displayFallback:{type:Boolean,default:!1},interactive:{type:Boolean,default:!0},interactiveOptIn:{type:Boolean,default:!1}},data:()=>({references:null,loading:!0}),computed:{isVisible(){return this.loading||0!==this.displayedReferences.length},values(){return this.referenceData?this.referenceData:!this.displayFallback||this.loading||this.references?this.references?Object.values(this.references):[]:[this.fallbackReference]},firstReference(){return this.values[0]??null},displayedReferences(){return this.values.filter(Boolean).slice(0,this.limit)},fallbackReference(){return{accessible:!0,openGraphObject:{id:this.text,link:this.text,name:this.text},richObjectType:"open-graph"}}},watch:{text:"fetch"},mounted(){this.fetch()},methods:{fetch(){return this.loading=!0,this.referenceData?(this.references=null,void(this.loading=!1)):new RegExp(C.U).exec(this.text)?void this.resolve().then(e=>{this.references=e.data.ocs.data.references,this.loading=!1,this.$emit("loaded")}).catch(e=>{v.l.error("Failed to extract references",e),this.loading=!1,this.$emit("loaded")}):(this.references=null,void(this.loading=!1))},resolve(){const e=new RegExp(C.U).exec(this.text.trim()),t=null===(0,f.HW)();return 1===this.limit&&e?t?h.Ay.get((0,m.KT)("references/resolvePublic")+`?reference=${encodeURIComponent(e[0])}&sharingToken=${(0,A.G)()}`):h.Ay.get((0,m.KT)("references/resolve")+`?reference=${encodeURIComponent(e[0])}`):t?h.Ay.post((0,m.KT)("references/extractPublic"),{text:this.text,resolve:!0,limit:this.limit,sharingToken:(0,A.G)()}):h.Ay.post((0,m.KT)("references/extract"),{text:this.text,resolve:!0,limit:this.limit})}}};var S=function(){var e=this,t=e._self._c;return e.isVisible?t("div",{staticClass:"widgets--list",class:{"icon-loading":e.loading}},e._l(e.displayedReferences,function(n){return t("NcReferenceWidget",{key:n.openGraphObject?.id,attrs:{reference:n,interactive:e.interactive,"interactive-opt-in":e.interactiveOptIn}})}),1):e._e()},P=[];const I=(0,b.n)(w,S,P,!1,null,"a33ecc28").exports;function L(e,t){const n=String(e);if("string"!=typeof t)throw new TypeError("Expected character");let r=0,i=n.indexOf(t);for(;-1!==i;)r++,i=n.indexOf(t,i+t.length);return r}const E=M(/[A-Za-z]/),O=M(/[\dA-Za-z]/);function B(e){return null!==e&&e<-2}function R(e){return null!==e&&(e<0||32===e)}function T(e){return-2===e||-1===e||32===e}const D=M(new RegExp("\\p{P}|\\p{S}","u")),N=M(/\s/);function M(e){return function(t){return null!==t&&t>-1&&e.test(String.fromCharCode(t))}}const j=function(e){if(null==e)return F;if("function"==typeof e)return $(e);if("object"==typeof e)return Array.isArray(e)?function(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=j(e[n]);return $(function(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1})}(e):function(e){const t=e;return $(function(n){const r=n;let i;for(i in e)if(r[i]!==t[i])return!1;return!0})}(e);if("string"==typeof e)return t=e,$(function(e){return e&&e.type===t});var t;throw new Error("Expected function, string, or object as test")};function $(e){return function(t,n,r){return Boolean(function(e){return null!==e&&"object"==typeof e&&"type"in e}(t)&&e.call(this,t,"number"==typeof n?n:void 0,r||void 0))}}function F(){return!0}const z=[],W=!1;function q(e,t,n,r){let i;i=t;const o=j(i);!function e(t,r,i){const s=t&&"object"==typeof t?t:{};if("string"==typeof s.type){const e="string"==typeof s.tagName?s.tagName:"string"==typeof s.name?s.name:void 0;Object.defineProperty(a,"name",{value:"node ("+t.type+(e?"<"+e+">":"")+")"})}return a;function a(){let s,a,l,c=z;if(o(t,r,i[i.length-1]||void 0)&&(c=function(e){return A
//# sourceMappingURL=profile-main.js.map?v=f5c46c63fc7ad1c6d0ec