Files
bestpc/public/assets/index.js

7 lines
366 KiB
JavaScript
Raw Normal View History

2025-05-28 15:30:26 +07:00
var ht,A,Un,Le,Gi,Zn,Kn,Jn,Li,bi,xi,Qn,dt={},es=[],rr=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ut=Array.isArray;function ue(n,e){for(var t in e)n[t]=e[t];return n}function Ai(n){n&&n.parentNode&&n.parentNode.removeChild(n)}function K(n,e,t){var i,r,a,l={};for(a in e)a=="key"?i=e[a]:a=="ref"?r=e[a]:l[a]=e[a];if(arguments.length>2&&(l.children=arguments.length>3?ht.call(arguments,2):t),typeof n=="function"&&n.defaultProps!=null)for(a in n.defaultProps)l[a]==null&&(l[a]=n.defaultProps[a]);return lt(n,l,i,r,null)}function lt(n,e,t,i,r){var a={type:n,props:e,key:t,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:r??++Un,__i:-1,__u:0};return r==null&&A.vnode!=null&&A.vnode(a),a}function ar(){return{current:null}}function Z(n){return n.children}function fe(n,e){this.props=n,this.context=e}function Ze(n,e){if(e==null)return n.__?Ze(n.__,n.__i+1):null;for(var t;e<n.__k.length;e++)if((t=n.__k[e])!=null&&t.__e!=null)return t.__e;return typeof n.type=="function"?Ze(n):null}function ts(n){var e,t;if((n=n.__)!=null&&n.__c!=null){for(n.__e=n.__c.base=null,e=0;e<n.__k.length;e++)if((t=n.__k[e])!=null&&t.__e!=null){n.__e=n.__c.base=t.__e;break}return ts(n)}}function yi(n){(!n.__d&&(n.__d=!0)&&Le.push(n)&&!zt.__r++||Gi!=A.debounceRendering)&&((Gi=A.debounceRendering)||Zn)(zt)}function zt(){for(var n,e,t,i,r,a,l,o=1;Le.length;)Le.length>o&&Le.sort(Kn),n=Le.shift(),o=Le.length,n.__d&&(t=void 0,r=(i=(e=n).__v).__e,a=[],l=[],e.__P&&((t=ue({},i)).__v=i.__v+1,A.vnode&&A.vnode(t),Oi(e.__P,t,i,e.__n,e.__P.namespaceURI,32&i.__u?[r]:null,a,r??Ze(i),!!(32&i.__u),l),t.__v=i.__v,t.__.__k[t.__i]=t,ss(a,t,l),t.__e!=r&&ts(t)));zt.__r=0}function is(n,e,t,i,r,a,l,o,c,d,h){var u,m,p,f,v,b,g=i&&i.__k||es,x=e.length;for(c=lr(t,e,g,c,x),u=0;u<x;u++)(p=t.__k[u])!=null&&(m=p.__i==-1?dt:g[p.__i]||dt,p.__i=u,b=Oi(n,p,m,r,a,l,o,c,d,h),f=p.__e,p.ref&&m.ref!=p.ref&&(m.ref&&Ii(m.ref,null,p),h.push(p.ref,p.__c||f,p)),v==null&&f!=null&&(v=f),4&p.__u||m.__k===p.__k?c=ns(p,c,n):typeof p.type=="function"&&b!==void 0?c=b:f&&(c=f.nextSibling),p.__u&=-7);return t.__e=v,c}function lr(n,e,t,i,r){var a,l,o,c,d,h=t.length,u=h,m=0;for(n.__k=new Array(r),a=0;a<r;a++)(l=e[a])!=null&&typeof l!="boolean"&&typeof l!="function"?(c=a+m,(l=n.__k[a]=typeof l=="string"||typeof l=="number"||typeof l=="bigint"||l.constructor==String?lt(null,l,null,null,null):ut(l)?lt(Z,{children:l},null,null,null):l.constructor==null&&l.__b>0?lt(l.type,l.props,l.key,l.ref?l.ref:null,l.__v):l).__=n,l.__b=n.__b+1,o=null,(d=l.__i=or(l,t,c,u))!=-1&&(u--,(o=t[d])&&(o.__u|=2)),o==null||o.__v==null?(d==-1&&(r>h?m--:r<h&&m++),typeof l.type!="function"&&(l.__u|=4)):d!=c&&(d==c-1?m--:d==c+1?m++:(d>c?m--:m++,l.__u|=4))):n.__k[a]=null;if(u)for(a=0;a<h;a++)(o=t[a])!=null&&(2&o.__u)==0&&(o.__e==i&&(i=Ze(o)),as(o,o));return i}function ns(n,e,t){var i,r;if(typeof n.type=="function"){for(i=n.__k,r=0;i&&r<i.length;r++)i[r]&&(i[r].__=n,e=ns(i[r],e,t));return e}n.__e!=e&&(e&&n.type&&!t.contains(e)&&(e=Ze(n)),t.insertBefore(n.__e,e||null),e=n.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function ge(n,e){return e=e||[],n==null||typeof n=="boolean"||(ut(n)?n.some(function(t){ge(t,e)}):e.push(n)),e}function or(n,e,t,i){var r,a,l=n.key,o=n.type,c=e[t];if(c===null&&n.key==null||c&&l==c.key&&o==c.type&&(2&c.__u)==0)return t;if(i>(c!=null&&(2&c.__u)==0?1:0))for(r=t-1,a=t+1;r>=0||a<e.length;){if(r>=0){if((c=e[r])&&(2&c.__u)==0&&l==c.key&&o==c.type)return r;r--}if(a<e.length){if((c=e[a])&&(2&c.__u)==0&&l==c.key&&o==c.type)return a;a++}}return-1}function Vi(n,e,t){e[0]=="-"?n.setProperty(e,t??""):n[e]=t==null?"":typeof t!="number"||rr.test(e)?t:t+"px"}function gt(n,e,t,i,r){var a;e:if(e=="style")if(typeof t=="string")n.style.cssText=t;else{if(typeof i=="string"&&(n.style.cssText=i=""),i)for(e in i)t&&e in t||Vi(n.style,e,"");if(t)for(e in t)i&&t[e]==i[e]||Vi(n.style,e,t[e])}else if(e[0]=="o"&&e[1]=="n")a=e!=(e=e.replace(Jn,"$1")),e=e.toLowerCase()in n||e=="onFocusOut"||e=="onFocusIn"?e.toLowerCase().slice(2):e.slice(2),n.l||(n.l={}),n.l[e+a]=t,t?i?t.u=i.u:(t.u=Li,n.addEv
<div class="fancybox__backdrop"></div>
<div class="fancybox__carousel"></div>
<div class="fancybox__footer"></div>
</div>`},trapFocus:!0,wheel:"zoom"};var Y,U;(function(n){n[n.Init=0]="Init",n[n.Ready=1]="Ready",n[n.Closing=2]="Closing",n[n.CustomClosing=3]="CustomClosing",n[n.Destroy=4]="Destroy"})(Y||(Y={})),function(n){n[n.Loading=0]="Loading",n[n.Opening=1]="Opening",n[n.Ready=2]="Ready",n[n.Closing=3]="Closing"}(U||(U={}));let kn="",at=!1,Ct=!1,Ae=null;const Ws=()=>{let n="",e="";const t=z.getInstance();if(t){const i=t.carousel,r=t.getSlide();if(i&&r){let a=r.slug||void 0,l=r.triggerEl||void 0;e=a||t.option("slug")||"",!e&&l&&l.dataset&&(e=l.dataset.fancybox||""),e&&e!=="true"&&(n="#"+e+(!a&&i.slides.length>1?"-"+(r.index+1):""))}}return{hash:n,slug:e,index:1}},$t=()=>{const n=new URL(document.URL).hash,e=n.slice(1).split("-"),t=e[e.length-1],i=t&&/^\+?\d+$/.test(t)&&parseInt(e.pop()||"1",10)||1;return{hash:n,slug:e.join("-"),index:i}},Xs=()=>{const{slug:n,index:e}=$t();if(!n)return;let t=document.querySelector(`[data-slug="${n}"]`);if(t&&t.dispatchEvent(new CustomEvent("click",{bubbles:!0,cancelable:!0})),z.getInstance())return;const i=document.querySelectorAll(`[data-fancybox="${n}"]`);i.length&&(t=i[e-1],t&&t.dispatchEvent(new CustomEvent("click",{bubbles:!0,cancelable:!0})))},qs=()=>{if(z.defaults.Hash===!1)return;const n=z.getInstance();if((n==null?void 0:n.options.Hash)===!1)return;const{slug:e,index:t}=$t(),{slug:i}=Ws();n&&(e===i?n.jumpTo(t-1):(at=!0,n.close())),Xs()},Ys=()=>{Ae&&clearTimeout(Ae),queueMicrotask(()=>{qs()})},Ln=()=>{window.addEventListener("hashchange",Ys,!1),setTimeout(()=>{qs()},500)};ct&&(/complete|interactive|loaded/.test(document.readyState)?Ln():document.addEventListener("DOMContentLoaded",Ln));const Pt="is-zooming-in";class Us extends de{onCreateSlide(e,t,i){const r=this.instance.optionFor(i,"src")||"";i.el&&i.type==="image"&&typeof r=="string"&&this.setImage(i,r)}onRemoveSlide(e,t,i){i.panzoom&&i.panzoom.destroy(),i.panzoom=void 0,i.imageEl=void 0}onChange(e,t,i,r){R(this.instance.container,Pt);for(const a of t.slides){const l=a.panzoom;l&&a.index!==i&&l.reset(.35)}}onClose(){var e;const t=this.instance,i=t.container,r=t.getSlide();if(!i||!i.parentElement||!r)return;const{el:a,contentEl:l,panzoom:o,thumbElSrc:c}=r;if(!a||!c||!l||!o||o.isContentLoading||o.state===j.Init||o.state===j.Destroy)return;o.updateMetrics();let d=this.getZoomInfo(r);if(!d)return;this.instance.state=Y.CustomClosing,i.classList.remove(Pt),i.classList.add("is-zooming-out"),l.style.backgroundImage=`url('${c}')`;const h=i.getBoundingClientRect();(((e=window.visualViewport)===null||e===void 0?void 0:e.scale)||1)===1&&Object.assign(i.style,{position:"absolute",top:`${i.offsetTop+window.scrollY}px`,left:`${i.offsetLeft+window.scrollX}px`,bottom:"auto",right:"auto",width:`${h.width}px`,height:`${h.height}px`,overflow:"hidden"});const{x:u,y:m,scale:p,opacity:f}=d;if(f){const v=((b,g,x,y)=>{const w=g-b,_=y-x;return M=>x+((M-b)/w*_||0)})(o.scale,p,1,0);o.on("afterTransform",()=>{l.style.opacity=v(o.scale)+""})}o.on("endAnimation",()=>{t.destroy()}),o.target.a=p,o.target.b=0,o.target.c=0,o.target.d=p,o.panTo({x:u,y:m,scale:p,friction:f?.2:.33,ignoreBounds:!0}),o.isResting&&t.destroy()}setImage(e,t){const i=this.instance;e.src=t,this.process(e,t).then(r=>{const{contentEl:a,imageEl:l,thumbElSrc:o,el:c}=e;if(i.isClosing()||!a||!l)return;a.offsetHeight;const d=!!i.isOpeningSlide(e)&&this.getZoomInfo(e);if(this.option("protected")&&c){c.addEventListener("contextmenu",m=>{m.preventDefault()});const u=document.createElement("div");k(u,"fancybox-protected"),a.appendChild(u)}if(o&&d){const u=r.contentRect,m=Math.max(u.fullWidth,u.fullHeight);let p=null;!d.opacity&&m>1200&&(p=document.createElement("img"),k(p,"fancybox-ghost"),p.src=o,a.appendChild(p));const f=()=>{p&&(k(p,"f-fadeFastOut"),setTimeout(()=>{p&&(p.remove(),p=null)},200))};(h=o,new Promise((v,b)=>{const g=new Image;g.onload=v,g.onerror=b,g.src=h})).then(()=>{i.hideLoading(e),e.state=U.Opening,this.instance.emit("reveal",e),this.zoomIn(e).then(()=>{f(),this.instance.done(e)},()=>{}),p&&setTimeout(()=>{f()},m>2500?800:200)},()=>{i.hideLoading(e),i.revealContent(e)})}else{const u=thi
<source src="{{src}}" type="{{format}}" />Sorry, your browser doesn't support embedded videos.</video>`,videoFormat:"",vimeo:{byline:1,color:"00adef",controls:1,dnt:1,muted:0},youtube:{controls:1,enablejsapi:1,nocookie:1,rel:0,fs:1}},Al=["image","html","ajax","inline","clone","iframe","map","pdf","html5video","youtube","vimeo"];class Zs extends de{onBeforeInitSlide(e,t,i){this.processType(i)}onCreateSlide(e,t,i){this.setContent(i)}onClearContent(e,t){t.xhr&&(t.xhr.abort(),t.xhr=null);const i=t.iframeEl;i&&(i.onload=i.onerror=null,i.src="//about:blank",t.iframeEl=null);const r=t.contentEl,a=t.placeholderEl;if(t.type==="inline"&&r&&a)r.classList.remove("fancybox__content"),getComputedStyle(r).getPropertyValue("display")!=="none"&&(r.style.display="none"),setTimeout(()=>{a&&(r&&a.parentNode&&a.parentNode.insertBefore(r,a),a.remove())},0),t.contentEl=void 0,t.placeholderEl=void 0;else for(;t.el&&t.el.firstChild;)t.el.removeChild(t.el.firstChild)}onSelectSlide(e,t,i){i.state===U.Ready&&this.playVideo()}onUnselectSlide(e,t,i){var r,a;if(i.type===tt){try{(a=(r=i.el)===null||r===void 0?void 0:r.querySelector("video"))===null||a===void 0||a.pause()}catch{}return}let l;i.type===Ce?l={method:"pause",value:"true"}:i.type===xe&&(l={event:"command",func:"pauseVideo"}),l&&i.iframeEl&&i.iframeEl.contentWindow&&i.iframeEl.contentWindow.postMessage(JSON.stringify(l),"*"),i.poller&&clearTimeout(i.poller)}onDone(e,t){e.isCurrentSlide(t)&&!e.isClosing()&&this.playVideo()}onRefresh(e,t){t.slides.forEach(i=>{i.el&&(this.resizeIframe(i),this.setAspectRatio(i))})}onMessage(e){try{let t=JSON.parse(e.data);if(e.origin==="https://player.vimeo.com"){if(t.event==="ready")for(let i of Array.from(document.getElementsByClassName("fancybox__iframe")))i instanceof HTMLIFrameElement&&i.contentWindow===e.source&&(i.dataset.ready="true")}else if(e.origin.match(/^https:\/\/(www.)?youtube(-nocookie)?.com$/)&&t.event==="onReady"){const i=document.getElementById(t.id);i&&(i.dataset.ready="true")}}catch{}}loadAjaxContent(e){const t=this.instance.optionFor(e,"src")||"";this.instance.showLoading(e);const i=this.instance,r=new XMLHttpRequest;i.showLoading(e),r.onreadystatechange=function(){r.readyState===XMLHttpRequest.DONE&&i.state===Y.Ready&&(i.hideLoading(e),r.status===200?i.setContent(e,r.responseText):i.setError(e,r.status===404?"{{AJAX_NOT_FOUND}}":"{{AJAX_FORBIDDEN}}"))};const a=e.ajax||null;r.open(a?"POST":"GET",t+""),r.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),r.setRequestHeader("X-Requested-With","XMLHttpRequest"),r.send(a),e.xhr=r}setInlineContent(e){let t=null;if(Q(e.src))t=e.src;else if(typeof e.src=="string"){const i=e.src.split("#",2).pop();t=i?document.getElementById(i):null}if(t){if(e.type==="clone"||t.closest(".fancybox__slide")){t=t.cloneNode(!0);const i=t.dataset.animationName;i&&(t.classList.remove(i),delete t.dataset.animationName);let r=t.getAttribute("id");r=r?`${r}--clone`:`clone-${this.instance.id}-${e.index}`,t.setAttribute("id",r)}else if(t.parentNode){const i=document.createElement("div");i.classList.add("fancybox-placeholder"),t.parentNode.insertBefore(i,t),e.placeholderEl=i}this.instance.setContent(e,t)}else this.instance.setError(e,"{{ELEMENT_NOT_FOUND}}")}setIframeContent(e){const{src:t,el:i}=e;if(!t||typeof t!="string"||!i)return;i.classList.add("is-loading");const r=this.instance,a=document.createElement("iframe");a.className="fancybox__iframe",a.setAttribute("id",`fancybox__iframe_${r.id}_${e.index}`);for(const[o,c]of Object.entries(this.optionFor(e,"iframeAttr")||{}))a.setAttribute(o,c);a.onerror=()=>{r.setError(e,"{{IFRAME_ERROR}}")},e.iframeEl=a;const l=this.optionFor(e,"preload");if(e.type!=="iframe"||l===!1)return a.setAttribute("src",e.src+""),r.setContent(e,a,!1),this.resizeIframe(e),void r.revealContent(e);r.showLoading(e),a.onload=()=>{if(!a.src.length)return;const o=a.dataset.ready!=="true";a.dataset.ready="true",this.resizeIframe(e),o?r.revealContent(e):r.hideLoading(e)},a.setAttribute("src",t),r.setContent(e,a,!1)}resizeIframe(e){const{type:t,iframeEl:i}=e;if(t===xe||t===Ce)return;const r=