Publish the prerendered static export (index.html, 404.html, cinema/,
c/, about/, for-cinemas/, for-film-lovers/, assets/, images/, og/,
sitemap.xml, robots.txt) as the site root and remove the React Router
+ Nitro source tree from this branch. Source remains available in
history at 0548772.
Note: public/sw.js here reports VERSION v2.0.5 while the removed source
tree (v2.1.0) was newer, and .gitignore was not carried over.
1 line
13 KiB
JavaScript
1 line
13 KiB
JavaScript
import{i as e,t}from"./react-B8IZ02wI.js";import{B as n,C as r,E as i,F as a,G as o,K as s,P as c,R as l,S as u,T as d,U as f,V as p,W as m,_ as h,d as g,f as _,h as v,n as y,p as b,s as x,u as S,w as C}from"./components-LggAOTeO.js";import{g as w,i as T,o as E,s as D,t as O}from"./components-BPFOGuol.js";import{t as k}from"./jsx-runtime-fBfwind-.js";import{i as A,r as j}from"./messages-nFlHChGW.js";import{t as M}from"./createReactComponent-C-DRqPhY.js";var N=`application/x-www-form-urlencoded`;function P(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function F(e){return P(e)&&e.tagName.toLowerCase()===`button`}function ee(e){return P(e)&&e.tagName.toLowerCase()===`form`}function I(e){return P(e)&&e.tagName.toLowerCase()===`input`}function L(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function R(e,t){return e.button===0&&(!t||t===`_self`)&&!L(e)}function z(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function te(e,t){let n=z(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var B=null;function ne(){if(B===null)try{new FormData(document.createElement(`form`),0),B=!1}catch{B=!0}return B}var re=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function V(e){return e!=null&&!re.has(e)?(o(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${N}"`),null):e}function ie(e,t){let n,r,i,a,o;if(ee(e)){let o=e.getAttribute(`action`);r=o?p(o,t):null,n=e.getAttribute(`method`)||`get`,i=V(e.getAttribute(`enctype`))||N,a=new FormData(e)}else if(F(e)||I(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?p(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||`get`,i=V(e.getAttribute(`formenctype`))||V(o.getAttribute(`enctype`))||N,a=new FormData(o,e),!ne()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(P(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=`get`,r=null,i=N,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}var H=e(t(),1),ae=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{ae&&(window.__reactRouterVersion=`8.1.0`)}catch{}function oe({basename:e,children:t,history:n,useTransitions:r}){let[i,a]=H.useState({action:n.action,location:n.location}),o=H.useCallback(e=>{r===!1?a(e):H.startTransition(()=>a(e))},[r]);return H.useLayoutEffect(()=>n.listen(o),[n,o]),H.createElement(y,{basename:e,children:t,location:i.location,navigationType:i.action,navigator:n,useTransitions:r})}oe.displayName=`unstable_HistoryRouter`;var U=H.forwardRef(function({onClick:e,discover:t=`render`,prefetch:r=`none`,relative:i,reloadDocument:a,replace:o,mask:u,state:d,target:f,to:p,preventScrollReset:m,viewTransition:h,defaultShouldRevalidate:g,..._},v){let{basename:y,navigator:b,useTransitions:w}=H.useContext(C),O=typeof p==`string`&&s.test(p),k=l(p,y);p=k.to;let A=x(p,{relative:i}),j=S(),M=null;if(u){let e=n(u,[],j.mask?j.mask.pathname:`/`,!0);y!==`/`&&(e.pathname=e.pathname===`/`?y:c([y,e.pathname])),M=b.createHref(e)}let[N,P,F]=D(r,_),ee=ue(p,{replace:o,mask:u,state:d,target:f,preventScrollReset:m,relative:i,viewTransition:h,defaultShouldRevalidate:g,useTransitions:w});function I(t){e&&e(t),t.defaultPrevented||ee(t)}let L=!(k.isExternal||a),R=H.createElement(`a`,{..._,...F,href:(L?M:void 0)||k.absoluteURL||A,onClick:L?I:e,ref:E(v,P),target:f,"data-discover":!O&&t===`render`?`true`:void 0});return N&&!O?H.createElement(H.Fragment,null,R,H.createElement(T,{page:A})):R});U.displayName=`Link`;var se=H.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:i=!1,style:a,to:o,viewTransition:s,children:c,...l},u){let d=v(o,{relative:l.relative}),f=S(),m=H.useContext(r),{navigator:h,basename:g}=H.useContext(C),_=m!=null&&ve(d)&&s===!0,y=h.encodeLocation?h.encodeLocation(d).pathname:d.pathname,b=f.pathname,x=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;t||(b=b.toLowerCase(),x=x?x.toLowerCase():null,y=y.toLowerCase()),x&&g&&(x=p(x,g)||x);let w=y!==`/`&&y.endsWith(`/`)?y.length-1:y.length,T=b===y||!i&&b.startsWith(y)&&b.charAt(w)===`/`,E=x!=null&&(x===y||!i&&x.startsWith(y)&&x.charAt(y.length)===`/`),D={isActive:T,isPending:E,isTransitioning:_},O=T?e:void 0,k;k=typeof n==`function`?n(D):[n,T?`active`:null,E?`pending`:null,_?`transitioning`:null].filter(Boolean).join(` `);let A=typeof a==`function`?a(D):a;return H.createElement(U,{...l,"aria-current":O,className:k,ref:u,style:A,to:o,viewTransition:s},typeof c==`function`?c(D):c)});se.displayName=`NavLink`;var ce=H.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=`get`,action:c,onSubmit:l,relative:u,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:p,...m},h)=>{let{useTransitions:g}=H.useContext(C),_=me(),v=he(c,{relative:u}),y=o.toLowerCase()===`get`?`get`:`post`,b=typeof c==`string`&&s.test(c);return H.createElement(`form`,{ref:h,method:y,action:v,onSubmit:r?l:e=>{if(l&&l(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,c=()=>_(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:u,preventScrollReset:d,viewTransition:f,defaultShouldRevalidate:p});g&&n!==!1?H.startTransition(()=>c()):c()},...m,"data-discover":!b&&e===`render`?`true`:void 0})});ce.displayName=`Form`;function W({getKey:e,storageKey:t,...n}){let r=H.useContext(O),{basename:i}=H.useContext(C),a=S(),o=g();ge({getKey:e,storageKey:t});let s=H.useMemo(()=>{if(!r||!e)return null;let t=Y(a,o,i,e);return t===a.key?null:t},[]);if(!r||r.isSpaMode)return null;let c=((e,t)=>{if(!window.history.state||!window.history.state.key){let e=Math.random().toString(32).slice(2);window.history.replaceState({key:e},``)}try{let n=JSON.parse(sessionStorage.getItem(e)||`{}`)[t||window.history.state.key];typeof n==`number`&&window.scrollTo(0,n)}catch(t){console.error(t),sessionStorage.removeItem(e)}}).toString();return n.nonce==null&&r?.nonce&&(n.nonce=r.nonce),H.createElement(`script`,{...n,suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${c})(${w(JSON.stringify(t||q))}, ${w(JSON.stringify(s))})`}})}W.displayName=`ScrollRestoration`;function G(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function K(e){let t=H.useContext(u);return m(t,G(e)),t}function le(e){let t=H.useContext(r);return m(t,G(e)),t}function ue(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=_(),d=S(),p=v(e,{relative:o});return H.useCallback(m=>{if(R(m,t)){m.preventDefault();let t=n===void 0?f(d)===f(p):n,h=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?H.startTransition(()=>h()):h()}},[d,u,p,n,r,i,t,e,a,o,s,c,l])}function de(e){o(typeof URLSearchParams<`u`,"You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=H.useRef(z(e)),n=H.useRef(!1),r=S(),i=H.useMemo(()=>te(r.search,n.current?null:t.current),[r.search]),a=_();return[i,H.useCallback((e,t)=>{let r=z(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var fe=0,pe=()=>`__${String(++fe)}__`;function me(){let{router:e}=K(`useSubmit`),{basename:t}=H.useContext(C),n=h(),r=e.fetch,i=e.navigate;return H.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=ie(e,t);a.navigate===!1?await r(a.fetcherKey||pe(),n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync}):await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function he(e,{relative:t}={}){let{basename:n}=H.useContext(C),r=H.useContext(d);m(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...v(e||`.`,{relative:t})},o=S();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:c([n,a.pathname])),f(a)}var q=`react-router-scroll-positions`,J={};function Y(e,t,n,r){let i=null;return r&&(i=r(n===`/`?e:{...e,pathname:p(e.pathname,n)||e.pathname},t)),i??=e.key,i}function ge({getKey:e,storageKey:t}={}){let{router:n}=K(`useScrollRestoration`),{restoreScrollPosition:r,preventScrollReset:i}=le(`useScrollRestoration`),{basename:a}=H.useContext(C),s=S(),c=g(),l=b();H.useEffect(()=>(window.history.scrollRestoration=`manual`,()=>{window.history.scrollRestoration=`auto`}),[]),_e(H.useCallback(()=>{if(l.state===`idle`){let t=Y(s,c,a,e);J[t]=window.scrollY}try{sessionStorage.setItem(t||q,JSON.stringify(J))}catch(e){o(!1,`Failed to save scroll positions in sessionStorage, <ScrollRestoration /> will not work properly (${e}).`)}window.history.scrollRestoration=`auto`},[l.state,e,a,s,c,t])),typeof document<`u`&&(H.useLayoutEffect(()=>{try{let e=sessionStorage.getItem(t||q);e&&(J=JSON.parse(e))}catch{}},[t]),H.useLayoutEffect(()=>{let t=n?.enableScrollRestoration(J,()=>window.scrollY,e?(t,n)=>Y(t,n,a,e):void 0);return()=>t&&t()},[n,a,e]),H.useLayoutEffect(()=>{if(r!==!1){if(typeof r==`number`){window.scrollTo(0,r);return}try{if(s.hash){let e=document.getElementById(decodeURIComponent(s.hash.slice(1)));if(e){e.scrollIntoView();return}}}catch{o(!1,`"${s.hash.slice(1)}" is not a decodable element ID. The view will not scroll to it.`)}i!==!0&&window.scrollTo(0,0)}},[s,r,i]))}function _e(e,t){let{capture:n}=t||{};H.useEffect(()=>{let t=n==null?void 0:{capture:n};return window.addEventListener(`pagehide`,e,t),()=>{window.removeEventListener(`pagehide`,e,t)}},[e,n])}function ve(e,{relative:t}={}){let n=H.useContext(i);m(n!=null,"`useViewTransitionState` must be used within `react-router/dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=K(`useViewTransitionState`),o=v(e,{relative:t});if(!n.isTransitioning)return!1;let s=p(n.currentLocation.pathname,r)||n.currentLocation.pathname,c=p(n.nextLocation.pathname,r)||n.nextLocation.pathname;return a(o.pathname,c)!=null||a(o.pathname,s)!=null}var X=k(),Z=(0,H.createContext)(null);function ye({content:e,children:t}){return(0,X.jsx)(Z.Provider,{value:e,children:t})}function be(){let e=(0,H.useContext)(Z);if(!e)throw Error(`useContent ต้องถูกใช้ภายใน <ContentProvider>`);return e}function Q(e){if(Array.isArray(e))return e.map(e=>Q(e));if(e&&typeof e==`object`){let t={};for(let[n,r]of Object.entries(e))t[n]=Q(r);return t}return e}function xe(e,t,n){let r=t.split(`.`),i=e;for(let e of r.slice(0,-1)){let t=i[e];if(!t||typeof t!=`object`)return;i=t}let a=r[r.length-1];typeof i[a]==`string`&&(i[a]=n)}function Se(e,t,n){let r=Q(e);for(let e of t){let t=e.values[n];typeof t!=`string`||t===``||xe(r,e.key,t)}return r}var Ce=`locale`,$=`alterflixhub.locale`,we=3600*24*365,Te=(0,H.createContext)(null);function Ee({urlLocale:e,stored:t,cookie:n}){return A(e??null)?e:A(t??null)?t:A(n??null)?n:`th`}function De(){return document.cookie.match(RegExp(`(?:^|;\\s*)locale=([^;]+)`))?.[1]??null}function Oe(){try{return window.localStorage.getItem($)}catch{return null}}function ke({initialLocale:e=`th`,localeFromUrl:t=null,terms:n=[],children:r}){let[i,a]=(0,H.useState)(e);(0,H.useEffect)(()=>{let e=Ee({urlLocale:t,stored:Oe(),cookie:De()});a(t=>t===e?t:e)},[]);let o=(0,H.useCallback)(e=>{a(e),document.cookie=`${Ce}=${e}; path=/; max-age=${we}; samesite=lax`;try{window.localStorage.setItem($,e)}catch{}},[]);(0,H.useEffect)(()=>{function e(e){e.key!==`alterflixhub.locale`||!A(e.newValue)||a(e.newValue)}return window.addEventListener(`storage`,e),()=>window.removeEventListener(`storage`,e)},[]),(0,H.useEffect)(()=>{document.documentElement.lang=i},[i]);let s=(0,H.useMemo)(()=>({locale:i,messages:Se(j[i],n,i),setLocale:o}),[i,o,n]);return(0,X.jsx)(Te.Provider,{value:s,children:r})}function Ae(){let e=(0,H.useContext)(Te);if(!e)throw Error(`useI18n ต้องถูกใช้ภายใน <LocaleProvider>`);return e}var je=M(`outline`,`check`,`Check`,[[`path`,{d:`M5 12l5 5l10 -10`,key:`svg-0`}]]);export{be as a,de as c,ye as i,ke as n,U as o,Ae as r,W as s,je as t}; |