rubick/public/feature/js/chunk-a2b32e48.f483e0e9.js
2023-10-12 14:04:10 +08:00

8 lines
14 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-a2b32e48"],{4001:function(e,t,n){},"4ebf":function(e,t,n){"use strict";n.r(t);var a=n("c7eb"),r=n("1da1"),i=(n("d81d"),n("d3b7"),n("159b"),n("b0c0"),n("9911"),n("7a23"));n("4001");
/**
* Vue 3 Carousel 0.3.1
* (c) 2023
* @license MIT
*/
const o={itemsToShow:1,itemsToScroll:1,modelValue:0,transition:300,autoplay:0,snapAlign:"center",wrapAround:!1,throttle:16,pauseAutoplayOnHover:!1,mouseDrag:!0,touchDrag:!0,dir:"ltr",breakpoints:void 0,i18n:{ariaNextSlide:"Navigate to next slide",ariaPreviousSlide:"Navigate to previous slide",ariaNavigateToSlide:"Navigate to slide {slideNumber}",ariaGallery:"Gallery",itemXofY:"Item {currentSlide} of {slidesCount}",iconArrowUp:"Arrow pointing upwards",iconArrowDown:"Arrow pointing downwards",iconArrowRight:"Arrow pointing to the right",iconArrowLeft:"Arrow pointing to the left"}},l={itemsToShow:{default:o.itemsToShow,type:Number},itemsToScroll:{default:o.itemsToScroll,type:Number},wrapAround:{default:o.wrapAround,type:Boolean},throttle:{default:o.throttle,type:Number},snapAlign:{default:o.snapAlign,validator(e){return["start","end","center","center-even","center-odd"].includes(e)}},transition:{default:o.transition,type:Number},breakpoints:{default:o.breakpoints,type:Object},autoplay:{default:o.autoplay,type:Number},pauseAutoplayOnHover:{default:o.pauseAutoplayOnHover,type:Boolean},modelValue:{default:void 0,type:Number},mouseDrag:{default:o.mouseDrag,type:Boolean},touchDrag:{default:o.touchDrag,type:Boolean},dir:{default:o.dir,validator(e){return["rtl","ltr"].includes(e)}},i18n:{default:o.i18n,type:Object},settings:{default(){return{}},type:Object}};function c({config:e,slidesCount:t}){const{snapAlign:n,wrapAround:a,itemsToShow:r=1}=e;if(a)return Math.max(t-1,0);let i;switch(n){case"start":i=t-r;break;case"end":i=t-1;break;case"center":case"center-odd":i=t-Math.ceil((r-.5)/2);break;case"center-even":i=t-Math.ceil(r/2);break;default:i=0;break}return Math.max(i,0)}function u({config:e,slidesCount:t}){const{wrapAround:n,snapAlign:a,itemsToShow:r=1}=e;let i=0;if(n||r>t)return i;switch(a){case"start":i=0;break;case"end":i=r-1;break;case"center":case"center-odd":i=Math.floor((r-1)/2);break;case"center-even":i=Math.floor((r-2)/2);break;default:i=0;break}return i}function s({val:e,max:t,min:n}){return t<n?e:Math.min(Math.max(e,n),t)}function d({config:e,currentSlide:t,slidesCount:n}){const{snapAlign:a,wrapAround:r,itemsToShow:i=1}=e;let o=t;switch(a){case"center":case"center-odd":o-=(i-1)/2;break;case"center-even":o-=(i-2)/2;break;case"end":o-=i-1;break}return r?o:s({val:o,max:n-i,min:0})}function b(e){return e?e.reduce((e,t)=>{var n;return t.type===i["b"]?[...e,...b(t.children)]:"CarouselSlide"===(null===(n=t.type)||void 0===n?void 0:n.name)?[...e,t]:e},[]):[]}function v({val:e,max:t,min:n=0}){return e>t?v({val:e-(t+1),max:t,min:n}):e<n?v({val:e+(t+1),max:t,min:n}):e}function f(e,t){let n;return t?function(...a){const r=this;n||(e.apply(r,a),n=!0,setTimeout(()=>n=!1,t))}:e}function p(e,t){let n;return function(...a){n&&clearTimeout(n),n=setTimeout(()=>{e(...a),n=null},t)}}function j(e="",t={}){return Object.entries(t).reduce((e,[t,n])=>e.replace(`{${t}}`,String(n)),e)}var O,m=Object(i["r"])({name:"ARIA",setup(){const e=Object(i["w"])("config",Object(i["P"])(Object.assign({},o))),t=Object(i["w"])("currentSlide",Object(i["Q"])(0)),n=Object(i["w"])("slidesCount",Object(i["Q"])(0));return()=>Object(i["v"])("div",{class:["carousel__liveregion","carousel__sr-only"],"aria-live":"polite","aria-atomic":"true"},j(e.i18n["itemXofY"],{currentSlide:t.value+1,slidesCount:n.value}))}}),g=Object(i["r"])({name:"Carousel",props:l,setup(e,{slots:t,emit:n,expose:a}){var r;const j=Object(i["Q"])(null),O=Object(i["Q"])([]),g=Object(i["Q"])(0),w=Object(i["Q"])(0),h=Object(i["P"])(Object.assign({},o));let x,S=Object.assign({},o);const y=Object(i["Q"])(null!==(r=e.modelValue)&&void 0!==r?r:0),k=Object(i["Q"])(0),A=Object(i["Q"])(0),T=Object(i["Q"])(0),C=Object(i["Q"])(0);let _,L;function N(){x=Object.assign({},e.breakpoints),S=Object.assign(Object.assign(Object.assign({},S),e),{i18n:Object.assign(Object.assign({},S.i18n),e.i18n),breakpoints:void 0}),D(S)}function M(){if(!x||!Object.keys(x).length)return;const e=Object.keys(x).map(e=>Number(e)).sort((e,t)=>+t-+e);let t=Object.assign({},S);e.some(e=>{const n=window.matchMedia(`(min-width: ${e}px)`).matches;return n&&(t=Object.assign(Object.assign({},t),x[e])),n}),D(t)}function D(e){Object.entries(e).forEach(([e,t])=>h[e]=t)}Object(i["N"])("config",h),Object(i["N"])("slidesCount",w),Object(i["N"])("currentSlide",y),Object(i["N"])("maxSlide",T),Object(i["N"])("minSlide",C),Object(i["N"])("slideWidth",g);const E=p(()=>{M(),Q()},16);function Q(){if(!j.value)return;const e=j.value.getBoundingClientRect();g.value=e.width/h.itemsToShow}function I(){w.value<=0||(A.value=Math.ceil((w.value-1)/2),T.value=c({config:h,slidesCount:w.value}),C.value=u({config:h,slidesCount:w.value}),h.wrapAround||(y.value=s({val:y.value,max:T.value,min:C.value})))}Object(i["H"])(()=>{Object(i["A"])(()=>Q()),setTimeout(()=>Q(),1e3),M(),G(),window.addEventListener("resize",E,{passive:!0}),n("init")}),Object(i["J"])(()=>{L&&clearTimeout(L),_&&clearInterval(_),window.removeEventListener("resize",E,{passive:!0})});let P=!1;const B={x:0,y:0},U={x:0,y:0},X=Object(i["P"])({x:0,y:0}),R=Object(i["Q"])(!1),$=Object(i["Q"])(!1),z=()=>{R.value=!0},V=()=>{R.value=!1};function Y(e){["INPUT","TEXTAREA","SELECT"].includes(e.target.tagName)||(P="touchstart"===e.type,P||e.preventDefault(),!P&&0!==e.button||W.value||(B.x=P?e.touches[0].clientX:e.clientX,B.y=P?e.touches[0].clientY:e.clientY,document.addEventListener(P?"touchmove":"mousemove",H,!0),document.addEventListener(P?"touchend":"mouseup",q,!0)))}const H=f(e=>{$.value=!0,U.x=P?e.touches[0].clientX:e.clientX,U.y=P?e.touches[0].clientY:e.clientY;const t=U.x-B.x,n=U.y-B.y;X.y=n,X.x=t},h.throttle);function q(){const e="rtl"===h.dir?-1:1,t=.4*Math.sign(X.x),n=Math.round(X.x/g.value+t)*e;if(n&&!P){const e=t=>{t.stopPropagation(),window.removeEventListener("click",e,!0)};window.addEventListener("click",e,!0)}F(y.value-n),X.x=0,X.y=0,$.value=!1,document.removeEventListener(P?"touchmove":"mousemove",H,!0),document.removeEventListener(P?"touchend":"mouseup",q,!0)}function G(){!h.autoplay||h.autoplay<=0||(_=setInterval(()=>{h.pauseAutoplayOnHover&&R.value||K()},h.autoplay))}function J(){_&&(clearInterval(_),_=null),G()}const W=Object(i["Q"])(!1);function F(e){const t=h.wrapAround?e:s({val:e,max:T.value,min:C.value});y.value===t||W.value||(n("slide-start",{slidingToIndex:e,currentSlideIndex:y.value,prevSlideIndex:k.value,slidesCount:w.value}),W.value=!0,k.value=y.value,y.value=t,L=setTimeout(()=>{if(h.wrapAround){const a=v({val:t,max:T.value,min:0});a!==y.value&&(y.value=a,n("loop",{currentSlideIndex:y.value,slidingToIndex:e}))}n("update:modelValue",y.value),n("slide-end",{currentSlideIndex:y.value,prevSlideIndex:k.value,slidesCount:w.value}),W.value=!1,J()},h.transition))}function K(){F(y.value+h.itemsToScroll)}function Z(){F(y.value-h.itemsToScroll)}const ee={slideTo:F,next:K,prev:Z};Object(i["N"])("nav",ee),Object(i["N"])("isSliding",W);const te=Object(i["j"])(()=>d({config:h,currentSlide:y.value,slidesCount:w.value}));Object(i["N"])("slidesToScroll",te);const ne=Object(i["j"])(()=>{const e="rtl"===h.dir?-1:1,t=te.value*g.value*e;return{transform:`translateX(${X.x-t}px)`,transition:(W.value?h.transition:0)+"ms",margin:h.wrapAround?`0 -${w.value*g.value}px`:"",width:"100%"}});function ae(){N(),M(),I(),Q(),J()}Object.keys(l).forEach(t=>{["modelValue"].includes(t)||Object(i["eb"])(()=>e[t],ae)}),Object(i["eb"])(()=>e["modelValue"],e=>{e!==y.value&&F(Number(e))}),Object(i["eb"])(w,I),n("before-init"),N();const re={config:h,slidesCount:w,slideWidth:g,next:K,prev:Z,slideTo:F,currentSlide:y,maxSlide:T,minSlide:C,middleSlide:A};a({updateBreakpointsConfigs:M,updateSlidesData:I,updateSlideWidth:Q,initDefaultConfigs:N,restartCarousel:ae,slideTo:F,next:K,prev:Z,nav:ee,data:re});const ie=t.default||t.slides,oe=t.addons,le=Object(i["P"])(re);return()=>{const e=b(null===ie||void 0===ie?void 0:ie(le)),t=(null===oe||void 0===oe?void 0:oe(le))||[];e.forEach((e,t)=>e.props.index=t);let n=e;if(h.wrapAround){const t=e.map((t,n)=>Object(i["i"])(t,{index:-e.length+n,isClone:!0,key:"clone-before-"+n})),a=e.map((t,n)=>Object(i["i"])(t,{index:e.length+n,isClone:!0,key:"clone-after-"+n}));n=[...t,...e,...a]}O.value=e,w.value=Math.max(e.length,1);const a=Object(i["v"])("ol",{class:"carousel__track",style:ne.value,onMousedownCapture:h.mouseDrag?Y:null,onTouchstartPassiveCapture:h.touchDrag?Y:null},n),r=Object(i["v"])("div",{class:"carousel__viewport"},a);return Object(i["v"])("section",{ref:j,class:{carousel:!0,"is-sliding":W.value,"is-dragging":$.value,"is-hover":R.value,"carousel--rtl":"rtl"===h.dir},dir:h.dir,"aria-label":h.i18n["ariaGallery"],tabindex:"0",onMouseenter:z,onMouseleave:V},[r,t,Object(i["v"])(m)])}}});(function(e){e["arrowUp"]="arrowUp",e["arrowDown"]="arrowDown",e["arrowRight"]="arrowRight",e["arrowLeft"]="arrowLeft"})(O||(O={}));const w={arrowUp:"M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z",arrowDown:"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z",arrowRight:"M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z",arrowLeft:"M15.41 16.59L10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"};function h(e){return e in O}const x=e=>{const t=Object(i["w"])("config",Object(i["P"])(Object.assign({},o))),n=String(e.name),a="icon"+(n.charAt(0).toUpperCase()+n.slice(1));if(!n||"string"!==typeof n||!h(n))return;const r=w[n],l=Object(i["v"])("path",{d:r}),c=t.i18n[a]||e.title||n,u=Object(i["v"])("title",c);return Object(i["v"])("svg",{class:"carousel__icon",viewBox:"0 0 24 24",role:"img","aria-label":c},[u,l])};x.props={name:String,title:String};var S=Object(i["r"])({name:"CarouselSlide",props:{index:{type:Number,default:1},isClone:{type:Boolean,default:!1}},setup(e,{slots:t}){const n=Object(i["w"])("config",Object(i["P"])(Object.assign({},o))),a=Object(i["w"])("currentSlide",Object(i["Q"])(0)),r=Object(i["w"])("slidesToScroll",Object(i["Q"])(0)),l=Object(i["w"])("isSliding",Object(i["Q"])(!1)),c=()=>e.index===a.value,u=()=>e.index===a.value-1,s=()=>e.index===a.value+1,d=()=>{const t=Math.floor(r.value),a=Math.ceil(r.value+n.itemsToShow-1);return e.index>=t&&e.index<=a};return()=>{var a;return Object(i["v"])("li",{style:{width:100/n.itemsToShow+"%"},class:{carousel__slide:!0,"carousel__slide--clone":e.isClone,"carousel__slide--visible":d(),"carousel__slide--active":c(),"carousel__slide--prev":u(),"carousel__slide--next":s(),"carousel__slide--sliding":l.value},"aria-hidden":!d()},null===(a=t.default)||void 0===a?void 0:a.call(t))}}}),y=n("0eaf"),k=n("be89"),A=n("5502"),T={class:"finder"},C=["onClick","src"],_={__name:"finder",setup:function(e){var t=Object(A["b"])(),n=Object(i["j"])((function(){return t.state.totalPlugins})),o=Object(i["Q"])([]);Object(i["D"])(Object(r["a"])(Object(a["a"])().mark((function e(){return Object(a["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,y["a"].getFinderDetail();case 2:o.value=e.sent;case 3:case"end":return e.stop()}}),e)}))));var l=Object(i["j"])((function(){var e=o.value.must||[];return e.length?e.map((function(e){var t=null;return n.value.forEach((function(n){n.name===e&&(t=n)})),t})):[]})),c=function(e){window.rubick.shellOpenExternal(e)},u=Object(i["j"])((function(){var e=o.value.recommend||[];return e.length?e.map((function(e){var t=null;return n.value.forEach((function(n){n.name===e&&(t=n)})),t})):[]})),s=Object(i["j"])((function(){var e=o.value.new||[];return e.length?e.map((function(e){var t=null;return n.value.forEach((function(n){n.name===e&&(t=n)})),t})):[]}));return function(e,t){var n=Object(i["U"])("a-divider");return Object(i["L"])(),Object(i["n"])("div",T,[Object(i["q"])(Object(i["bb"])(g),{itemsToShow:2,transition:500},{default:Object(i["gb"])((function(){return[(Object(i["L"])(!0),Object(i["n"])(i["b"],null,Object(i["S"])(o.value.banners||[],(function(e,t){return Object(i["L"])(),Object(i["l"])(Object(i["bb"])(S),{key:t},{default:Object(i["gb"])((function(){return[Object(i["o"])("img",{class:"carousel__item",onClick:function(t){return c(e.link)},src:e.src},null,8,C)]})),_:2},1024)})),128))]})),_:1}),Object(i["q"])(n),Object(i["bb"])(l)&&Object(i["bb"])(l).length?(Object(i["L"])(),Object(i["l"])(k["a"],{key:0,onDownloadSuccess:e.downloadSuccess,title:e.$t("feature.market.finder.must"),list:Object(i["bb"])(l)},null,8,["onDownloadSuccess","title","list"])):Object(i["m"])("",!0),Object(i["bb"])(u)&&Object(i["bb"])(u).length?(Object(i["L"])(),Object(i["l"])(k["a"],{key:1,onDownloadSuccess:e.downloadSuccess,title:e.$t("feature.market.finder.recommended"),list:Object(i["bb"])(u)},null,8,["onDownloadSuccess","title","list"])):Object(i["m"])("",!0),Object(i["bb"])(s)&&Object(i["bb"])(s).length?(Object(i["L"])(),Object(i["l"])(k["a"],{key:2,title:e.$t("feature.market.finder.lastUpdated"),list:Object(i["bb"])(s)},null,8,["title","list"])):Object(i["m"])("",!0)])}}};n("b1f0");const L=_;t["default"]=L},"857a":function(e,t,n){var a=n("e330"),r=n("1d80"),i=n("577e"),o=/"/g,l=a("".replace);e.exports=function(e,t,n,a){var c=i(r(e)),u="<"+t;return""!==n&&(u+=" "+n+'="'+l(i(a),o,"&quot;")+'"'),u+">"+c+"</"+t+">"}},"8cbc":function(e,t,n){},9911:function(e,t,n){"use strict";var a=n("23e7"),r=n("857a"),i=n("af03");a({target:"String",proto:!0,forced:i("link")},{link:function(e){return r(this,"a","href",e)}})},af03:function(e,t,n){var a=n("d039");e.exports=function(e){return a((function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}))}},b1f0:function(e,t,n){"use strict";n("8cbc")},d81d:function(e,t,n){"use strict";var a=n("23e7"),r=n("b727").map,i=n("1dde"),o=i("map");a({target:"Array",proto:!0,forced:!o},{map:function(e){return r(this,e,arguments.length>1?arguments[1]:void 0)}})}}]);
//# sourceMappingURL=chunk-a2b32e48.f483e0e9.js.map