
管理员
站长
- UID
- 1
- 积分
- 224394
- 余额
- 13 R
- Moe币
- 84875
- 在线时间
- 279 小时
- 注册时间
- 2025-12-28
- 最后登录
- 2026-11-3
|
|
lse{var o=0,i="";try{o=performance.measure(n,e,r).duration,this.measures.push(n),this.marks.push([e,r]),this.onEvent(this.name,{measure:t,duration:o,err:i})}catch(t){i=t.message,console.error(i)}}return this}},{key:"clean",value:function(){return this.measures.forEach(function(t){return performance.clearMeasures(t)}),this.marks.forEach(function(t){var e=m(t,2),r=e[0],n=e[1];performance.clearMarks(r),performance.clearMarks(n)}),this.measures=[],this.marks=[],this}}])}(Y),Q="__UIKIT_SDK_LOADER_INSTANCE_MAP__",tt="__UIKIT_SDK_LOADER_PROMISE_MAP__",et="__UIKIT_SDK_LOADER_MANIFEST__",rt=function(t,e){window[Q]||(window[Q]={}),window[Q][t]=e},nt=function(t){var e;return null===(e=window[Q])||void 0===e?void 0:e[t]},ot=function(t,e){window[tt]||(window[tt]={}),window[tt][t]=e},it=function(t){var e;return null===(e=window[tt])||void 0===e?void 0:e[t]},st=function(t,e){window[et]||(window[et]={}),window[et][t]=e},at=function(t){return(window[et]||{})[t]},ct=function(){return p(function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};l(this,t),h(this,"plugins",[]),h(this,"config",void 0),h(this,"sdk","file-share"),h(this,"url",""),this.sdk=e,this.config=r},[{key:"moduleFormat",get:function(){return this.config.format?this.config.format:R()?"es":"umd"}},{key:"pluginHooks",get:function(){var t=this,e=function(e){return t.plugins.map(function(r){return r[e]&&r[e](t)})};return{beforeLoad:function(){return e("beforeLoad")},afterLoad:function(){return e("afterLoad")},loadError:function(){return e("loadError")}}}},{key:"getManifest",value:(t=u(y().mark(function t(){var e,r,n,o,i,s,a,c,f=this;return y().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e="".concat(this.moduleFormat),!at(e)){t.next=3;break}return t.abrupt("return",at(e));case 3:return r=Date.now(),n=K(),o=n.resolve,i=n.reject,s=n.promise,a=C.create({id:e,namespace:"KUC_SDK_LOADER_manifest",mode:"disk",asyncDisk:!0}),t.next=8,a.get("data",u(y().mark(function t(){var n;return y().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return performance.mark("KUC_SDK_LOADER_MAINFEST_API_START_".concat(r)),t.next=3,U("".concat(J(),"/uikit/sdk/manifest/all?format=").concat(f.moduleFormat)).then(function(t){var e=new Z({name:"mainfest_api"});if(performance.mark("KUC_SDK_LOADER_MAINFEST_API_END_".concat(r)),e.measure(f.sdk,"KUC_SDK_LOADER_MAINFEST_API_START_".concat(r),"KUC_SDK_LOADER_MAINFEST_API_END_".concat(r)),"success"!==t.status){var n=new Error(JSON.stringify(t));throw i(n),n}return o(t.data),t.data});case 3:return n=t.sent,st(e,n),t.abrupt("return",n);case 6:case"end":return t.stop()}},t)})));case 8:if(c=t.sent,st(e,c),c[this.sdk]){t.next=14;break}return t.next=13,s;case 13:c=t.sent;case 14:return t.abrupt("return",c);case 15:case"end":return t.stop()}},t,this)})),function(){return t.apply(this,arguments)})},{key:"load",value:function(){var t=u(y().mark(function t(){var e,r,n,o,i,s,a,c,u,f=this,l=arguments;return y().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e=l.length>0&&void 0!==l[0]?l[0]:{},r=K(),n=r.resolve,o=r.reject,i=r.promise,s="".concat(this.sdk,"_").concat(Date.now()),performance.mark("KUC_SDK_LOADER_START_".concat(s)),t.prev=4,a=e.preload||[],this.pluginHooks.beforeLoad(),this.config.noCache){t.next=15;break}if(!it(this.sdk)){t.next=11;break}return t.next=11,it(this.sdk).catch(function(){});case 11:if(!nt(this.sdk)){t.next=15;break}return this.loadAdditionalSdk(a),this.pluginHooks.afterLoad(),t.abrupt("return",nt(this.sdk));case 15:return ot(this.sdk,i),t.next=18,this.getManifest();case 18:if(c=t.sent,performance.mark("KUC_SDK_LOADER_MAINFEST_END_".concat(s)),c[this.sdk]){t.next=22;break}throw new Error("SDK ".concat(this.sdk," 不存在"));case 22:if(this.url=c[this.sdk].url,e.skipIdle){t.next=27;break}return t.next=26,V();case 26:performance.mark("KUC_SDK_LOADER_IDLE_END_".concat(s));case 27:return a.length&&this.loadAdditionalSdk(a),t.next=30,B(c[this.sdk],this.sdk,this.moduleFormat).then(function(t){return rt(f.sdk,t),ot(f.sdk,null),t});case 30:u=t.sent,this.pluginHooks.afterLoad(),n(u),t.next=40;break;case 35:t.prev=35,t.t0=t.catch(4),ot(this.sdk,null),this.pluginHooks.loadError(),o(t.t0);case 40:return i.catch(function(){performance.mark("KUC_SDK_LOADER_FAIL_".concat(s))}).finally(function(){performance.mark("KUC_SDK_LOADER_END_".concat(s));var t=new Z({name:"kuc_sdk_loader"});performance.getEntriesByName("KUC_SDK_LOADER_MAINFEST_END_".concat(s)).length&&t.measure("mainfest","KUC_SDK_LOADER_START_".concat(s),"KUC_SDK_LOADER_MAINFEST_END_".concat(s)),performance.getEntriesByName("KUC_SDK_LOADER_IDLE_END_".concat(s)).length&&t.measure("idle","KUC_SDK_LOADER_MAINFEST_END_".concat(s),"KUC_SDK_LOADER_IDLE_END_".concat(s)),performance.getEntriesByName("KUC_SDK_LOADER_FAIL").length?t.measure("".concat(f.sdk,"_fail"),"KUC_SDK_LOADER_START_".concat(s),"KUC_SDK_LOADER_FAIL_".concat(s)):t.measure(f.sdk,"KUC_SDK_LOADER_START_".concat(s),"KUC_SDK_LOADER_END_".concat(s)),t.clean()}),t.abrupt("return",i);case 42:case"end":return t.stop()}},t,this,[[4,35]])}));return function(){return t.apply(this,arguments)}}()},{key:"loadAdditionalSdk",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=at(this.moduleFormat)||{};e.forEach(function(e){if(r[e]){var n=r[e],o=B({url:n.url,integrity:n.integrity},e,t.moduleFormat);ot(e,o),o.then(function(t){rt(e,t),ot(e,null)}).catch(function(){ot(e,null)})}})}},{key:"usePlugin",value:function(t){return this.plugins.push(t),this}}]);var t}();function ut(t){return new ct(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{env:"public"})}},8984(t,e,r){var n=r(5527),o=r(3650),i=Object.prototype.hasOwnProperty;t.exports=function(t){if(!n(t))return o(t);var e=[];for(var r in Object(t))i.call(t,r)&&"constructor"!=r&&e.push(r);return e}},9302(t,e,r){var n=r(3488),o=r(6757),i=r(2865);t.exports=function(t,e){return i(o(t,e,n),t+"")}},9325(t,e,r){var n=r(4840),o="object"==typeof self&&self&&self.Object===Object&&self,i=n||o||Function("return this")();t.exports=i},9344(t,e,r){var n=r(3805),o=Object.create,i=function(){function t(){}return function(e){if(!n(e))return{};if(o)return o(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();t.exports=i},9350(t){ |
|