1import{n as e}from"./rolldown-runtime-Bh1tDfsg.js";import{n as t,t as n}from"./navbar-Nl1l42aa.js";import{C as r,E as i,O as a,S as o,T as s,b as c,c as l,d as u,h as d,i as f,l as p,n as m,u as h,v as g,x as _}from"./queries-BjFf_iEz.js";import"./seo-DBq6jz2m.js";import{t as v}from"./ServicePageLayout-BkSCiQ2y.js";import{t as y}from"./style-CNeX89z9.js";var b=class extends h{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),S(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return C(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return C(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof _(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!o(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&w(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||_(this.options.enabled,this.#t)!==_(t.enabled,this.#t)||_(this.options.staleTime,this.#t)!==_(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||_(this.options.enabled,this.#t)!==_(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return o(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch().then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(g)),t}#h(e){return!u()&&_(this.options.enabled,this.#t)!==!1&&d(e)}#g(){this.#b();let e=_(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=s(this.#r.dataUpdatedAt,e)+1;this.#u=i.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#f=e,!(this.#f===0||!this.#h(this.#f))&&(this.#d=i.setInterval(()=>{(this.options.refetchIntervalInBackground||p.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(i.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(i.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:l}=e,u={...l},d=!1,p;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&S(e,t),o=i&&w(e,n,t,r);(a||o)&&(u={...u,...f(l.data,e.options)}),t._optimisticResults===`isRestoring`&&(u.fetchStatus=`idle`)}let{error:m,errorUpdatedAt:h,status:g}=u;p=u.data;let v=!1;if(t.placeholderData!==void 0&&p===void 0&&g===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,v=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(g=`success`,p=c(i?.data,e,t),d=!0)}if(t.select&&p!==void 0&&!v)if(i&&p===a?.data&&t.select===this.#s)p=this.#c;else try{this.#s=t.select,p=t.select(p),p=c(i?.data,p,t),this.#c=p,this.#o=null}catch(e){this.#o=e}else p===void 0&&(this.#o=null);this.#o&&(m=this.#o,p=this.#c,h=Date.now(),g=`error`,d=!1);let y=u.fetchStatus===`fetching`,b=g===`pending`,x=g===`error`,C=b&&y,E=p!==void 0;return{status:g,fetchStatus:u.fetchStatus,isPending:b,isSuccess:g===`success`,isError:x,isInitialLoading:C,isLoading:C,data:p,dataUpdatedAt:u.dataUpdatedAt,error:m,errorUpdatedAt:h,failureCount:u.fetchFailureCount,failureReason:u.fetchFailureReason,errorUpdate
1Count:u.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:u.dataUpdateCount>s.dataUpdateCount||u.errorUpdateCount>s.errorUpdateCount,isFetching:y,isRefetching:y&&!b,isLoadingError:x&&!E,isPaused:u.fetchStatus===`paused`,isPlaceholderData:d,isRefetchError:x&&E,isStale:T(e,t),refetch:this.refetch,isEnabled:_(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),o(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();l.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function x(e,t){return _(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&_(t.retryOnMount,e)===!1)}function S(e,t){return x(e,t)||e.state.data!==void 0&&C(e,t,t.refetchOnMount)}function C(e,t,n){if(_(t.enabled,e)!==!1&&_(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&T(e,t)}return!1}function w(e,t,n,r){return(e!==t||_(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&T(e,n)}function T(e,t){return _(t.enabled,e)!==!1&&e.isStaleByTime(_(t.staleTime,e))}var E=e(t(),1),D=E.createContext(!1),O=()=>E.useContext(D);D.Provider;var k=n();function A(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var j=E.createContext(A()),M=()=>E.useContext(j),N=(e,t,n)=>{let i=n?.state.error&&typeof e.throwOnError==`function`?r(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||i)&&(t.isReset()||(e.retryOnMount=!1))},P=e=>{E.useEffect(()=>{e.clearReset()},[e])},F=({result:e,errorResetBoundary:t,throwOnError:n,query:i,suspense:a})=>e.isError&&!t.isReset()&&!e.isFetching&&i&&(a&&e.data===void 0||r(n,[e.error,i])),I=(e,t)=>t.state.data===void 0,L=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},R=(e,t)=>e?.suspense&&t.isPending,z=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function B(e,t,n){let r=O(),i=M(),o=a(n),s=o.defaultQueryOptions(e),c=o.getQueryCache().get(s.queryHash),u=e.subscribed!==!1;s._optimisticResults=r?`isRestoring`:u?`optimistic`:void 0,L(s),N(s,i,c),P(i);let[d]=E.useState(()=>new t(o,s)),f=d.getOptimisticResult(s),p=!r&&u;if(E.useSyncExternalStore(E.useCallback(e=>{let t=p?d.subscribe(l.batchCalls(e)):g;return d.updateResult(),t},[d,p]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),E.useEffect(()=>{d.setOptions(s)},[s,d]),R(s,f))throw z(s,d,i);if(F({result:f,errorResetBoundary:i,throwOnError:s.throwOnError,query:c,suspense:s.suspense}))throw f.error;return s.notifyOnChangeProps?f:d.trackResult(f)}function V(e,t){return B({...e,enabled:!0,suspense:!0,throwOnError:I,placeholderData:void 0},b,t)}var H=new Intl.DateTimeFormat(`en-US`,{year:`numeric`,month:`short`,day:`numeric`});function U(e){let t=new Date(e);return Number.isNaN(t.getTime())?``:H.format(t)}function W(e){return`${Math.max(1,Math.round(e))} min read`}function G({post:e,variant:t=`grid`,eager:n=!1}){let r=`/blog/${e.slug}`,i=U(e.publishedAt);return(0,k.jsxs)(`a`,{className:`blog-card bento-card blog-card--${t}`,href:r,"aria-label":e.title,children:[(0,k.jsxs)(`div`,{className:`blog-card__media`,children:[(0,k.jsx)(`span`,{className:`blog-card__pill`,children:e.category}),(0,k.jsx)(`img`,{className:`blog-card__img`,src:e.coverImage.url,alt:e.coverImage.alt,width:e.coverImage.width,height:e.coverImage.height,loading:n?`eager`:`lazy`,decoding:`async`})]}),(0,k.jsxs)(`div`,{className:`blog-card__body`,children:[(0,k.jsx)(`h3`,{className:`blog-card__title`,children:e.title}),t!==`compact`&&(0,k.jsx)(`p`,{className:`blog-card__excerpt`,children:e.excerpt}),(0,k.jsxs)(`div`,{className:`blog-card__meta`,children:[(0,k.jsx)(`span`,{className:`blog-card__author`,children:e.author.name}),(0,k.jsx)(`span`,{className:`blog-card__dot`,"aria-hidden":`true`}),(0,k.jsx)(`span`,{children:i}),(0,k.jsx)(`span`,{className:`blog-card__dot`,"aria-hidden":`true`}),(0,k.jsx)(`span`,{children:W(e.readingMinutes)})]})]})]})}function K({page:e}){return(0,k.jsxs)(`header`,{className:`blog-hero blog-rise`,children:[(0,k.jsxs)(`span`,{className:`blog-hero__eyebrow lined-label bg-sage-subtle`,children:[(0,k.jsx)(`span`,{className:`blog-hero__eyebrow-dot`,"aria-hidden":`true`}),`Insights`]}),(0,k.jsxs)(`h1`,{className:`blog-hero__title`,children:[`The Settlr Global `,(0,k.jsx)(`em`,{children:`Journal`})]}),(0,k.jsxs)(`p`,{className:`blog-hero__subtitle`,children:[`Clear, practical guidance on doing business in Thailand - incorporation, tax, visas, payroll, and the strategy in between.`,e>1?` Page ${e}.`:``]})]})}function q({posts:e}){let[t,...n]=e,r=n.slice(0,2);return t?(0,k.jsx)(`section`,{className:`blog-featured blog-rise`,style:y(`animation-delay: 0.08s`),"aria-label":`Featured articles`,children:(0,k.jsxs)(`div`,{className:`blog-featured__panel`,children:[(0,k.jsxs)(`a`,{className:`blog-featured__hero`,href:`/blog/${t.slug}`,"aria-label":t.title,children:[(0,k.jsx)(`div`,{className:`blog-featured__hero-media`,children:(0,k.jsx)(`img`,{className:`blog-featured__hero-img`,src:t.coverImage.url,alt:t.coverImage.alt,width:t.coverImage.width,height:t.coverImage.height,loading:`eager`,fetchPriority:`high`,decoding:`async`})}),(0,k.jsxs)(`div`,{className:`blog-featured__hero-body`,children:[(0,k.jsxs)(`div`,{className:`blog-featured__hero-kicker`,children:[(0,k.jsx)(`span`,{className:`blog-featured__badge lined-label`,children:`Featured`}),(0,k.jsx)(`span`,{className:`blog-featured__category`,children:t.category})]}),(0,k.jsx)(`h2`,{className:`blog-featured__hero-title`,children:t.title}),t.excerpt&&(0,k.jsx)(`p`,{className:`blog-featured__hero-excerpt`,children:t.excerpt}),(0,k.jsxs)(`div`,{className:`blog-featured__hero-foot`,children:[(0,k.jsxs)(`span`,{className:`blog-featured__hero-meta`,children:[t.author.name,` · `,U(t.publishedAt),` ·`,` `,W(t.readingMinutes)]}),(0,k.jsxs)(`span`,{className:`blog-featured__hero-link`,children:[`Read story `,(0,k.jsx)(`span`,{"aria-hidden":`true`,children:`â`})]})]})]})]}),r.length>0&&(0,k.jsxs)(`div`,{className:`blog-featured__aside`,children:[(0,k.jsx)(`p`,{className:`blog-featured__aside-label`,children:`Also featured`}),(0,k.jsx)(`ul`,{className:`blog-featured__aside-list`,children:r.map((e,t)=>(0,k.jsx)(`li`,{className:`blog-featured__aside-item blog-rise`,style:y(`animation-delay: ${.14+t*.07}s`),children:(0,k.jsxs)(`a`,{className:`blog-featured__aside-link`,href:`/blog/${e.slug}`,"aria-label":e.title,children:[(0,k.jsx)(`div`,{className:`blog-featured__aside-thumb`,children:(0,k.jsx)(`img`,{src:e.coverImage.url,alt:e.coverImage.alt,width:e.coverImage.width,height:e.coverImage.height,loading:`lazy`,decoding:`async`})}),(0,k.jsxs)(`div`,{className:`blog-featured__aside-copy`,children:[(0,k.jsx)(`span`,{className:`blog-featured__aside-category`,children:e.category}),(0,k.jsx)(`h3`,{className:`blog-featured__aside-title`,children:e.title}),(0,k.jsxs)(`span`,{className:`blog-featured__aside-meta`,children:[U(e.publishedAt),` ·`,` `,W(e.readingMinutes)]})]})]})},t))})]})]})}):null}var J=[{id:`incorporation`,label:`Incorporation`,title:`Company registration in Thailand`,description:`Entity types, BOI promotion, foreign ownership rules, and the DBD filing process â for founders structuring a Thai company from scratch.`,href:`/incorporation`,icon:`architecture`},{id:`visas`,label:`Visas`,title:`Visas and work permits`,description:`LTR, Smart Visa, DTV, and Non-Immigrant B compared, plus work permit ratios and 90 day reporting for founders and employees moving to Thailand.`,href:`/visa-and-work-permit`,icon:`badge`},{id:`tax-and-accounting`,label:`Tax and Accounting`,title:`Tax and accounting`,description:`VAT, withholding tax, corporate income tax deadlines, and bookkeeping practices that keep Thai and foreign owned companies audit-ready.`,href:`/accounting-and-tax`,icon:`account_balance`},{id:`payroll`,label:`Payroll`,title:`Payroll`,description:`Salary runs, PND.1 withholding, social security contributions, and the monthly filing cycle every Thailand employer has to manage.`,href:`/payroll`,icon:`payments`},{id:`cfo-and-strategy`,label:`CFO and Strategy`,title:`CFO and strategy`,description:`Cash forecasting, board reporting, fundraising, and the financial judgment calls that come after the books are clean.`,href:`/fractional-cfo`,icon:`insights`}];function Y(){return(0,k.jsx)(`nav`,{className:`blog-hubs blog-rise`,"aria-label":`Browse by topic`,children:(0,k.jsxs)(`p`,{className:`blog-hubs__lead`,children:[(0,k.jsx)(`span`,{className:`blog-hubs__lead-label`,children:`Topics`}),J.map((e,t)=>(0,k.jsxs)(E.Fragment,{children:[t>0&&(0,k.jsx)(`span`,{className:`blog-hubs__sep`,"aria-hidden":`true`,children:`/`}),(0,k.jsx)(`a`,{className:`blog-hubs__link`,href:e.href,title:e.title,children:e.label})]},t))]})})}function X(){return(0,k.jsxs)(`div`,{className:`blog-empty`,children:[(0,k.jsx)(`h3`,{className:`blog-empty__title`,children:`No articles yet`}),(0,k.jsx)(`p`,{className:`blog-empty__text`,children:`New insights are on the way. Check back soon for guides on doing business in Thailand.`})]})}function Z({posts:e,title:t,titleEm:n,total:r}){return(0,k.jsxs)(`section`,{className:`blog-section`,"aria-label":n?`${t} ${n}`:t,children:[(0,k.jsxs)(`div`,{className:`blog-section__head`,children:[(0,k.jsx)(`h2`,{className:`blog-section__title`,children:n?(0,k.jsxs)(k.Fragment,{children:[t,` `,(0,k.jsx)(`em`,{children:n})]}):t}),r>0&&(0,k.jsxs)(`span`,{className:`blog-section__count`,children:[r,` article`,r===1?``:`s`]})]}),e.length>0?(0,k.jsx)(`div`,{className:`blog-grid`,children:e.map((e,t)=>(0,k.jsx)(`div`,{className:`blog-rise`,style:y(`animation-delay: ${.05*(t+1)}s`),children:(0,k.jsx)(G,{post:e})},t))}):(0,k.jsx)(X,{})]})}var Q=`/blog`;function $(e){return e<=1?Q:`${Q}/${e}`}function ee({page:e,totalPages:t}){function n(e,t){if(t<=7)return Array.from({length:t},(e,t)=>t+1);
1let n=[1],r=Math.max(2,e-1),i=Math.min(t-1,e+1);r>2&&n.push(`ellipsis`);for(let e=r;e<=i;e+=1)n.push(e);return i<t-1&&n.push(`ellipsis`),n.push(t),n}let r=n(e,t),i=e>1,a=e<t;return t<=1?null:(0,k.jsxs)(`nav`,{className:`blog-pagination`,"aria-label":`Blog pagination`,children:[(0,k.jsxs)(`a`,{className:`blog-pagination__btn`,href:i?$(e-1):void 0,"aria-disabled":i?`false`:`true`,rel:`prev`,children:[(0,k.jsx)(`span`,{"aria-hidden":`true`,children:`â`}),(0,k.jsx)(`span`,{className:`blog-pagination__label`,children:`Prev`})]}),r.map((t,n)=>t===`ellipsis`?(0,k.jsx)(`span`,{className:`blog-pagination__ellipsis`,"aria-hidden":`true`,children:`â¦`},`gap-${n}`):t===e?(0,k.jsx)(`span`,{className:`blog-pagination__btn blog-pagination__btn--active`,"aria-current":`page`,children:t},t):(0,k.jsx)(`a`,{className:`blog-pagination__btn`,href:$(t),children:t},t)),(0,k.jsxs)(`a`,{className:`blog-pagination__btn`,href:a?$(e+1):void 0,"aria-disabled":a?`false`:`true`,rel:`next`,children:[(0,k.jsx)(`span`,{className:`blog-pagination__label`,children:`Next`}),(0,k.jsx)(`span`,{"aria-hidden":`true`,children:`â`})]})]})}function te({posts:e,featured:t,page:n,totalPages:r,total:i}){let a=n===1&&t.length>0;return(0,k.jsxs)(`main`,{className:`blog`,children:[(0,k.jsxs)(`div`,{className:`blog__ambient`,"aria-hidden":`true`,children:[(0,k.jsx)(`div`,{className:`blog__glow blog__glow--a`}),(0,k.jsx)(`div`,{className:`blog__glow blog__glow--b`})]}),(0,k.jsxs)(`div`,{className:`blog__container`,children:[(0,k.jsx)(K,{page:n}),n===1&&(0,k.jsx)(Y,{}),a&&(0,k.jsx)(q,{posts:t}),(0,k.jsx)(Z,{posts:e,title:n===1?`Latest`:`All`,titleEm:`articles`,total:i}),(0,k.jsx)(ee,{page:n,totalPages:r})]})]})}function ne({page:e}){let{data:t}=V(m(e));return(0,k.jsx)(v,{children:(0,k.jsx)(te,{posts:t.result.posts,featured:t.featured,page:t.result.page,totalPages:t.result.totalPages,total:t.result.total})})}export{V as a,W as i,G as n,U as r,ne as t};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.