@lightworkai.official/debug-capture 0.19.8 → 0.19.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- (()=>{var j3=((J)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(J,{get:($,j)=>(typeof require<"u"?require:$)[j]}):J)(function(J){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+J+'" is not supported')});function E1(J){if(!J)return null;let $=J===!0?{}:J,j=(Q,z)=>typeof Q==="number"&&Number.isFinite(Q)&&Q>=0&&Q<2000?Q:z;return{side:$.position==="left"?"left":"right",x:j($.offset?.x,16),y:j($.offset?.y,16)}}var Q3={maxRequests:60,maxConsoleEntries:120,maxActions:80,maxBodyChars:20000},Q0=null;function _4(J){let $=[];if(!J.host?.trim())$.push("host");if(!J.realmKey?.trim())$.push("realmKey");if(!J.app?.name?.trim())$.push("app.name");if(typeof J.module!=="function")$.push("module");if($.length)throw Error(`[debug-capture] configureDebugCapture is missing: ${$.join(", ")}. `+"See the README — `module` maps a pathname to the part of your app it belongs to.");Q0=J}function _(){if(!Q0)throw Error("[debug-capture] configureDebugCapture() has not been called");return Q0}function k1(){return Q0!==null}function B0(){let J=_().app;return{name:J.name,version:J.version??"0.0.0",environment:J.environment??z3()}}function z3(){if(typeof window>"u")return"unknown";let J=window.location.hostname;if(J==="localhost"||J==="127.0.0.1"||J.endsWith(".local"))return"development";return"production"}function L0(J){let $=Q0?.capture?.[J];return typeof $==="number"?$:Q3[J]}function x1(J){let $=Q0?.module;if(!$)return null;try{return $(J)??null}catch{return null}}function f1(){let J=Q0?.redact;return{headers:J?.headers??[],queryKeys:(J?.queryKeys??[]).map(($)=>$.toLowerCase()),bodyKeys:(J?.bodyKeys??[]).map(($)=>$.toLowerCase())}}function I4(){return Q0?.capture?.overlaySelectors??[]}var X3='[contenteditable]:not([contenteditable="false"]), [data-lw-mask]',Z3="[data-lw-mask]",N4={fps:1,quality:0.5};function z1(){let J=Q0?.replay;if(!J)return null;let $=J===!0?{}:J,j=(X,Z)=>typeof X==="number"&&X>0?X:Z,Q=$.maskInputs!==!1,z=$.recordCanvas?{fps:j(typeof $.recordCanvas==="object"?$.recordCanvas.fps:void 0,N4.fps),quality:j(typeof $.recordCanvas==="object"?$.recordCanvas.quality:void 0,N4.quality)}:null;return{seconds:j($.seconds,60),maskInputs:Q,maskTextSelector:$.maskTextSelector?.trim()||(Q?X3:Z3),maskText:$.maskText===!0,blockSelector:$.blockSelector?.trim()||"[data-lw-private]",maxBytes:j($.maxBytes,4000000),canvas:z}}function C4(J){if(typeof window>"u")return!1;let $;try{$=new URL(J,window.location.href)}catch{return!1}if(V3($))return!1;if($.origin===window.location.origin)return!0;return(Q0?.capture?.bodyOrigins??[]).some((j)=>{try{return new URL(j).origin===$.origin}catch{return!1}})}function V3(J){if(!Q0?.host)return!1;try{if(new URL(Q0.host).origin!==J.origin)return!1}catch{return!1}return J.pathname.startsWith("/ingest/")}function O4(J){let $=Object.entries(J).map(([j,Q])=>[j.replace(/\/+$/,"")||"/",Q]).sort((j,Q)=>Q[0].length-j[0].length);return(j)=>{let Q=(j||"/").replace(/\/+$/,"")||"/";for(let[z,X]of $)if(Q===z||Q.startsWith(`${z}/`))return{key:z,label:X};return null}}var X1="‹redacted›",W3=/^(authorization|proxy-authorization|cookie|set-cookie|x-[a-z-]*token|x-csrf[a-z-]*|x-xsrf[a-z-]*)$/i,K3=new Set(["access_token","token","id_token","refresh_token","code","secret","client_secret","password","apikey","api_key","signature","x-amz-signature","x-amz-credential"]),Y3=/(password|passwd|token|secret|authorization|refresh|client_secret|otp|pin)/i,G3=/[\w.+-]+@[\w-]+\.[\w.-]+/g,U3=/\d(?:[\d\s-]{7,})\d/g;function Z1(J){return J.replace(G3,X1).replace(U3,X1)}function q3(J){if(W3.test(J))return!0;return f1().headers.some((j)=>j.toLowerCase()===J.toLowerCase())}function V1(J){let $={};for(let[j,Q]of Object.entries(J))$[j]=q3(j)?X1:Q;return $}function R0(J){try{let $=/^https?:\/\//i.test(J),j=new URL(J,$?void 0:"http://local.invalid"),Q=!1;if(j.searchParams.forEach((z,X)=>{if(K3.has(X.toLowerCase())||f1().queryKeys.includes(X.toLowerCase()))j.searchParams.set(X,X1),Q=!0}),!Q)return J;return $?j.toString():`${j.pathname}${j.search}`}catch{return J}}function N2(J,$){if($>6||J===null||typeof J!=="object")return J;if(Array.isArray(J))return J.map((Q)=>N2(Q,$+1));let j={};for(let[Q,z]of Object.entries(J)){let X=Y3.test(Q)||f1().bodyKeys.some((Z)=>Q.toLowerCase().includes(Z));j[Q]=X?X1:N2(z,$+1)}return j}function W1(J,$){if(J==null)return null;let j=J,Q=J.trim();if(Q.startsWith("{")||Q.startsWith("["))try{let z=JSON.parse(Q);j=JSON.stringify(N2(z,0))}catch{}if(j.length>$)return`${j.slice(0,$)}… [truncated ${j.length-$} chars]`;return j}var _2=120,I2=40,d0=(J,$)=>J.length>$?`${J.slice(0,$)}…`:J,C2=(J)=>{try{return decodeURIComponent(J)}catch{return J}},p0=[],L4=0,R4=!1;function K1(J,$,j,Q){let z=d0($,_2),X=p0[p0.length-1];if(J==="navigate"&&X?.kind==="click"){let W=z.replace(/^ไปที่\s*/,"");if(X.detail.includes(`→ ${W}`))return X.at=new Date().toISOString(),X;let Y=W.split(/[?#]/)[0]??W,U=X.source?C2(X.source.replace(/^→\s*/,"")).split(/[?#]/)[0]:null;if(U&&(Y===U||Y.startsWith(U)))return X.detail=d0(`${X.detail} → ${W}`,_2),X.source=void 0,X.at=new Date().toISOString(),X}if(X&&X.kind===J&&X.detail===z){if(X.at=new Date().toISOString(),J!=="navigate")X.count=(X.count??1)+1;return X}L4+=1;let Z={id:`act_${L4}`,at:new Date().toISOString(),kind:J,detail:z,count:1,source:j,html:y1(Q)};p0.push(Z);while(p0.length>L0("maxActions"))H3(p0.shift());return Z}var D3=200000,Y1=0;function y1(J){if(!J)return;if(Y1+J.length>D3)return;return Y1+=J.length,J}function H3(J){if(!J)return;if(Y1-=(J.html?.length??0)+(J.afterHtml?.length??0),Y1<0)Y1=0}function w1(J){return J instanceof Element&&Boolean(J.closest("[data-debug-reporter]"))}var M3='button, a[href], [role="button"], [role="tab"], [role="menuitem"], [role="option"], [role="switch"], [role="checkbox"], [role="radio"], [role="link"], summary, input, select, textarea',B3={button:"ปุ่ม",a:"ลิงก์",input:"ช่อง",textarea:"ช่อง",select:"ตัวเลือก",summary:"ส่วนขยาย"},S4={button:"ปุ่ม",tab:"แท็บ",menuitem:"เมนู",option:"ตัวเลือก",switch:"สวิตช์",checkbox:"ช่องเลือก",radio:"ตัวเลือก",link:"ลิงก์"};function P3(J){let $=J.getAttribute("role");if($&&S4[$])return S4[$];return B3[J.tagName.toLowerCase()]??"ปุ่ม"}function F3(J,$){try{let j=J,Q=0;while(j&&Q<=$){let z=f4(j);if(z&&typeof z.memoizedProps?.onClick==="function")return j;j=j.parentElement,Q+=1}}catch{}return null}function N3(J){let $=J.getAttribute("aria-label")?.trim();if($)return $;let j=J.getAttribute("title")?.trim();if(j)return j;if(J instanceof HTMLInputElement||J instanceof HTMLTextAreaElement||J instanceof HTMLSelectElement)return(J.getAttribute("placeholder")||J.getAttribute("name")||"").trim();if(J instanceof HTMLImageElement)return(J.getAttribute("alt")||"").trim();let Q=(J.textContent??"").replace(/\s+/g," ").trim();if(Q)return Q;if(J instanceof HTMLAnchorElement){let z=J.getAttribute("href");if(z?.startsWith("/"))return C2(z)}return""}function _3(J){if(!(J instanceof Element))return null;let $=J.closest(M3)??F3(J,4);if(!$)return null;let j=$.tagName.toLowerCase();if(j==="html"||j==="body")return null;return $}function I3(J){let $=Z1(N3(J));if(!$)return null;return`${P3(J)} “${d0($,I2)}”`}var x4=6000,C3=4000,O3=/(?:^|\s)!?(?:fixed|absolute|sticky|inset-\S+|z-\S+|top-\S+|bottom-\S+|left-\S+|right-\S+|w-screen|h-screen|min-h-screen|max-h-screen|translate-\S+|scale-\S+)(?=\s|$)/g;function L3(J){J.querySelectorAll("script, style, link, iframe, object, embed, noscript, canvas, video, audio").forEach((z)=>z.remove());let $=[J,...Array.from(J.querySelectorAll("*"))];for(let z of $){for(let Z of Array.from(z.attributes)){let W=Z.name.toLowerCase();if(W.startsWith("on")||W==="srcdoc"||W==="value"||W.startsWith("data-"))z.removeAttribute(Z.name)}if(z instanceof HTMLAnchorElement)z.setAttribute("href","#");if(z instanceof HTMLImageElement)z.removeAttribute("src");let X=z.getAttribute("class");if(X){let Z=X.replace(O3," ").replace(/\s+/g," ").trim();if(Z)z.setAttribute("class",Z);else z.removeAttribute("class")}}let j=document.createTreeWalker(J,NodeFilter.SHOW_TEXT),Q=j.nextNode();while(Q){if(Q.nodeValue)Q.nodeValue=Z1(Q.nodeValue);Q=j.nextNode()}}function O2(J,$,j){try{let Q=J.outerHTML;if(!Q||Q.length>$)return;let z=J.cloneNode(!0);L3(z);let X=z.outerHTML;return X&&X.length<=j?X:void 0}catch{return}}var R3=(J)=>O2(J,x4,C3),S3=150000,T3=40000,T4=(J)=>O2(J,S3,T3);function A3(J){if(!(J instanceof HTMLInputElement)&&!(J instanceof HTMLTextAreaElement)&&!(J instanceof HTMLSelectElement))return null;let $=J.name||J.id||J.getAttribute("aria-label")||J.getAttribute("placeholder")||J.tagName.toLowerCase();return`ช่อง “${Z1($)}”`}var A4=80;function f4(J){let $=Object.keys(J).find((j)=>j.startsWith("__reactFiber$")||j.startsWith("__reactInternalInstance$"));return $?J[$]:null}function E3(J){if(typeof J!=="function")return null;try{let $=Function.prototype.toString.call(J);return($.match(/\.(?:push|replace)\(\s*['"`]([^'"`]+)['"`]/)??$.match(/redirect\(\s*['"`]([^'"`]+)['"`]/))?.[1]??null}catch{return null}}function E4(J){if(!J)return;return`→ ${J.length>A4?`${J.slice(0,A4)}…`:J}`}function k3(J){try{let $=J.closest("a[href]")?.getAttribute("href");if($&&$.startsWith("/"))return E4($);let j=f4(J),Q=0;while(j&&Q<30){if(typeof j.memoizedProps?.onClick==="function")return E4(E3(j.memoizedProps.onClick));j=j.return,Q+=1}return}catch{return}}var x3='[role="dialog"], [role="alertdialog"], [role="menu"], [role="listbox"], [role="status"], [role="alert"]';function f3(){let J=I4();return J.length?J.join(", "):x3}function w3(J){let $=J.getAttribute("role");if($==="status"||$==="alert")return"ข้อความแจ้งเตือน";if($==="menu")return"เมนู";if($==="listbox")return"รายการตัวเลือก";if($==="alertdialog")return"กล่องยืนยัน";return"กล่องโต้ตอบ"}function y3(J){let $=J.getAttribute("aria-label")?.trim();if($)return $;let j=J.getAttribute("aria-labelledby");if(j){let X=j.split(/\s+/).map((Z)=>document.getElementById(Z)?.textContent?.trim()??"").filter(Boolean).join(" ");if(X)return X}let z=J.querySelector('[data-slot="dialog-title"], h1, h2, h3, [role="heading"]')?.textContent?.replace(/\s+/g," ").trim();if(z)return z;return(J.textContent??"").replace(/\s+/g," ").trim()}function w4(J){let $=Z1(y3(J)),j=w3(J);return $?`เปิด ${j} “${d0($,I2)}”`:`เปิด ${j}`}var g3='[aria-busy="true"], [role="progressbar"], [data-loading="true"], .animate-pulse, .animate-spin',v3=/กำลังโหลด|กำลังค้นหา|กำลังดำเนินการ|\bloading\b/i;function h3(J){if(J.querySelector(g3))return!0;return v3.test(J.textContent??"")}var m3=400,b3=250,u3=8000;function p3(J,$){if(typeof MutationObserver>"u"){$.html=y1(T4(J));return}let j=Date.now(),Q=!1,z=()=>{Q=!0,Z.disconnect(),window.clearInterval(W),window.clearTimeout(Y)},X=()=>{if(Q)return;if(z(),!J.isConnected)return;$.detail=d0(w4(J),_2),$.html=y1(T4(J))},Z=new MutationObserver(()=>{j=Date.now()});Z.observe(J,{childList:!0,subtree:!0,attributes:!0,characterData:!0});let W=window.setInterval(()=>{if(Q)return;if(!J.isConnected){z();return}if(Date.now()-j>=m3&&!h3(J))X()},b3),Y=window.setTimeout(X,u3)}function d3(J){if(w1(J))return;let $=K1("ui",w4(J));if($)p3(J,$)}function i3(){if(typeof MutationObserver>"u")return;let J=new WeakSet;new MutationObserver((j)=>{for(let Q of j)for(let z of Array.from(Q.addedNodes)){if(!(z instanceof Element))continue;let X=f3(),Z=z.matches(X)?[z]:Array.from(z.querySelectorAll(X));for(let W of Z){if(J.has(W))continue;J.add(W),d3(W)}}}).observe(document.body,{childList:!0,subtree:!0})}var c3=1600,l3=2500;function k4(J){return{disabled:J.hasAttribute("disabled")||J.getAttribute("aria-disabled")==="true",busy:J.getAttribute("aria-busy")==="true",text:d0((J.textContent??"").replace(/\s+/g," ").trim(),I2)}}function r3(J,$){if(!J.disabled&&$.disabled)return"ปุ่มถูกปิดใช้งานหลังคลิก";if(!J.busy&&$.busy)return"ปุ่มเข้าสู่สถานะกำลังโหลด";if(J.text!==$.text&&$.text)return`ข้อความเปลี่ยนเป็น “${$.text}”`;return null}function n3(J,$){if(typeof MutationObserver>"u")return;let j=k4(J),Q=!1,z=(W,Y)=>{if(Q)return;if(Q=!0,X.disconnect(),window.clearTimeout(Z),$.afterNote=W,Y)$.afterHtml=y1(O2(J,x4,l3))},X=new MutationObserver(()=>{if(!J.isConnected){z("องค์ประกอบหายไปจากหน้าจอ",!1);return}let W=r3(j,k4(J));if(W)z(W,!0)});X.observe(J,{attributes:!0,attributeFilter:["disabled","aria-disabled","aria-busy","class"],childList:!0,subtree:!0,characterData:!0});let Z=window.setTimeout(()=>{if(!Q&&!J.isConnected){z("องค์ประกอบหายไปจากหน้าจอ",!1);return}Q=!0,X.disconnect()},c3)}function y4(){if(R4||typeof window>"u")return;R4=!0,document.addEventListener("click",(Q)=>{if(w1(Q.target))return;let z=_3(Q.target);if(!z)return;let X=I3(z);if(!X)return;let Z=K1("click",`คลิก ${X}`,k3(z),R3(z));if(Z)n3(z,Z)},{capture:!0,passive:!0}),document.addEventListener("change",(Q)=>{if(w1(Q.target))return;let z=A3(Q.target);if(z)K1("input",`แก้ไข ${z}`)},{capture:!0,passive:!0}),document.addEventListener("submit",(Q)=>{if(w1(Q.target))return;K1("submit","ส่งฟอร์ม")},{capture:!0,passive:!0});let J=()=>K1("navigate",`ไปที่ ${C2(R0(location.pathname+location.search))}`),$=history.pushState.bind(history),j=history.replaceState.bind(history);history.pushState=(...Q)=>{let z=$(...Q);return J(),z},history.replaceState=(...Q)=>{let z=j(...Q);return J(),z},window.addEventListener("popstate",J),i3()}function g4(){return p0.map((J)=>({...J}))}var v4=2000,g1=[],h4=0,m4=!1;function L2(J,$){h4+=1,g1.push({id:`log_${h4}`,at:new Date().toISOString(),level:J,message:$.length>v4?`${$.slice(0,v4)}…`:$});while(g1.length>L0("maxConsoleEntries"))g1.shift()}function o3(){let J=new WeakSet;return($,j)=>{if(typeof j==="object"&&j!==null){if(J.has(j))return"[Circular]";J.add(j)}if(typeof j==="bigint")return j.toString();return j}}function b4(J){if(typeof J==="string")return J;if(J instanceof Error)return`${J.name}: ${J.message}`;try{let $=JSON.stringify(J,o3());if($!==void 0)return $}catch{}try{return String(J)}catch{}try{return Object.prototype.toString.call(J)}catch{return`[${typeof J}]`}}function u4(){if(m4||typeof window>"u")return;m4=!0;let J=["log","info","warn","error","debug"];for(let $ of J){let j=console[$].bind(console);console[$]=(...Q)=>{L2($,Q.map(b4).join(" ")),j(...Q)}}window.addEventListener("error",($)=>{let j=$.filename?` (${$.filename}:${$.lineno}:${$.colno})`:"";L2("exception",`${$.message}${j}`)}),window.addEventListener("unhandledrejection",($)=>{let j=$.reason instanceof Error?`${$.reason.name}: ${$.reason.message}`:b4($.reason);L2("unhandledrejection",j)})}function p4(){return g1.map((J)=>({...J}))}var d4=new Set,i4=new Set;function c4(J,$){return J.add($),()=>J.delete($)}function l4(J,$){for(let j of[...J])j($)}function r4(J){return c4(d4,J)}function i0(J={type:"manual"}){l4(d4,J)}function n4(J){return c4(i4,J)}function o4(J){l4(i4,J)}var s3=15000,a3=["ResizeObserver loop","Script error.","Non-Error promise rejection captured"],s4=!1,a4=0;function t3(J){return a3.some(($)=>J.includes($))}function t4(J){let $=J.message??"";if(!$||t3($))return;let j=Date.now();if(j-a4<s3)return;a4=j,o4({...J,message:$})}function e4(){if(s4||typeof window>"u")return;s4=!0,window.addEventListener("error",(J)=>{if(!J.message&&!J.error)return;let $=J.error instanceof Error?J.error:null;t4({type:"runtime-error",message:J.message||($?$.message:"Unknown error"),stack:$?.stack})}),window.addEventListener("unhandledrejection",(J)=>{let $=J.reason;t4({type:"unhandledrejection",message:$ instanceof Error?$.message:String($),stack:$ instanceof Error?$.stack:void 0})})}var Q6=4000,e3=1e6,J5=1e7,v1=[],J6=0,$6=!1;function z6(J){v1.push(J);while(v1.length>L0("maxRequests"))v1.shift()}function X6(){return J6+=1,`req_${J6}`}function j6(J){let $={};if(!J)return $;if(J instanceof Headers)J.forEach((j,Q)=>{$[Q]=j});else if(Array.isArray(J))for(let[j,Q]of J)$[j]=Q;else Object.assign($,J);return $}function $5(J){let $={};return J.forEach((j,Q)=>{$[Q]=j}),$}function j5(J){if(J==null)return null;if(typeof J==="string")return J;if(J instanceof URLSearchParams)return J.toString();if(typeof FormData<"u"&&J instanceof FormData)return`[FormData: ${Array.from(J.keys()).join(", ")}]`;if(typeof Blob<"u"&&J instanceof Blob)return`[Blob ${J.size} bytes]`;if(J instanceof ArrayBuffer)return`[ArrayBuffer ${J.byteLength} bytes]`;return"[binary]"}function Q5(J,$){let j="",Q="GET",z={},X=null;if(typeof J==="string")j=J;else if(J instanceof URL)j=J.toString();else j=J.url,Q=J.method||Q,z=j6(J.headers);if($){if($.method)Q=$.method;if($.headers)z={...z,...j6($.headers)};if($.body!==void 0)X=j5($.body)}return{method:Q.toUpperCase(),url:j,headers:z,body:X}}function Z6(J){return!C4(J)}function z5(J,$){if(Z6($.url)){$.responseSnippet="[body not captured for this origin]";return}let j=J.headers.get("content-type")??"",Q=Number(J.headers.get("content-length")??"0"),z=Q?`, ~${Q} bytes`:"";if(!/json|text|xml|html|javascript|urlencoded/i.test(j)){$.responseSnippet=`[binary ${j||"unknown"}${z}]`;return}if(Q>e3){$.responseSnippet=`[response ${j||"text"}${z} — omitted]`;return}try{J.clone().text().then((X)=>{$.responseSnippet=W1(X,L0("maxBodyChars"))}).catch(()=>{})}catch{}}function V6(J,$){if(/[?&]_rsc=/.test(J))return!0;for(let j of Object.keys($)){let Q=j.toLowerCase();if(Q==="rsc"||Q==="next-router-prefetch"||Q==="next-router-state-tree")return!0}return!1}function X5(){if(typeof window>"u"||typeof window.fetch!=="function")return;let J=window.fetch.bind(window);window.fetch=Object.assign(async($,j)=>{let Q=Q5($,j);if(V6(Q.url,Q.headers))return J($,j);let z={id:X6(),startedAt:new Date().toISOString(),method:Q.method,url:R0(Q.url),requestHeaders:V1(Q.headers),requestBody:W1(Q.body,Q6),status:null,statusText:null,durationMs:null,via:"fetch"};z6(z);let X=performance.now();try{let Z=await J($,j);return z.status=Z.status,z.statusText=Z.statusText,z.durationMs=Math.round(performance.now()-X),z.responseHeaders=V1($5(Z.headers)),z5(Z,z),Z}catch(Z){throw z.durationMs=Math.round(performance.now()-X),z.error=Z instanceof Error?`${Z.name}: ${Z.message}`:String(Z),Z}},J)}function Z5(){if(typeof window>"u"||typeof window.XMLHttpRequest!=="function")return;let J=XMLHttpRequest.prototype,$=J.open,j=J.send,Q=function(X,Z){let W=typeof Z==="string"?Z:Z.toString();return this.__lwEntry=V6(W,{})?void 0:{id:X6(),startedAt:"",method:(X||"GET").toUpperCase(),url:R0(W),requestHeaders:{},requestBody:null,status:null,statusText:null,durationMs:null,via:"xhr"},$.apply(this,arguments)},z=function(X){let Z=this.__lwEntry;if(Z){Z.startedAt=new Date().toISOString(),Z.requestBody=typeof X==="string"?W1(X,Q6):X==null?null:"[non-string body]";let W=performance.now();z6(Z),this.addEventListener("loadend",()=>{if(Z.status=this.status||null,Z.statusText=this.statusText||null,Z.durationMs=Math.round(performance.now()-W),Z6(Z.url))Z.responseSnippet="[body not captured for this origin]";else if(this.responseType===""||this.responseType==="text")try{Z.responseSnippet=W1(this.responseText||"",L0("maxBodyChars"))}catch{}else{let Y=this.getResponseHeader("content-type")??this.responseType;Z.responseSnippet=`[binary ${Y}]`}})}return j.apply(this,arguments)};J.open=Q,J.send=z}function W6(){if($6)return;$6=!0,X5(),Z5()}function K6(){let J=v1.map((j)=>({...j})),$=0;for(let j=J.length-1;j>=0;j-=1){let Q=J[j],z=Q?.responseSnippet;if(!Q||typeof z!=="string"||z.length===0)continue;if($+z.length>J5)Q.responseSnippet=`[response omitted — report size budget reached (${z.length.toLocaleString()} chars)]`;else $+=z.length}return J}var V5=4,Y6=3,W5=4000,K5="[data-debug-reporter]",G6=()=>import("@rrweb/record");function U6(J){G6=J}var Z0=[],R2=null,h1=!1;function q6(){if(typeof window>"u"||R2||h1)return;let J=z1();if(!J)return;h1=!0;let $=()=>void Y5(J);if("requestIdleCallback"in window)window.requestIdleCallback($,{timeout:3000});else setTimeout($,1000)}async function Y5(J){let $;try{$=(await G6()).record}catch(j){h1=!1,console.warn("[debug-capture] session replay could not start:",j);return}if(R2)return;try{R2=$({emit:(j)=>G5(j),checkoutEveryNms:Math.max(1000,J.seconds*1000/2),checkoutEveryNth:W5,maskAllInputs:J.maskInputs,maskTextSelector:J.maskText?"*":J.maskTextSelector,blockSelector:`${J.blockSelector}, ${K5}`,slimDOMOptions:"all",inlineStylesheet:!0,sampling:{mousemove:50,scroll:150,media:800,input:"last",...J.canvas?{canvas:J.canvas.fps}:{}},recordCanvas:J.canvas!==null,...J.canvas?{dataURLOptions:{type:"image/webp",quality:J.canvas.quality}}:{},errorHandler:()=>!0})??null}catch(j){console.warn("[debug-capture] session replay could not start:",j)}finally{h1=!1}}function G5(J){if(J.type===V5||Z0.length===0){if(Z0.push([]),Z0.length>Y6)Z0=Z0.slice(-Y6)}Z0[Z0.length-1].push(J)}function D6(J=Date.now()){let $=z1();if(!$||!Z0.length)return null;let j=J-$.seconds*1000,Q=Z0.length-1;while(Q>0&&(Z0[Q][0]?.timestamp??J)>j)Q-=1;let z=Z0.slice(Q).flat(),X=z[0]?.timestamp,Z=z[z.length-1]?.timestamp;if(X===void 0||Z===void 0)return null;return{events:z,startedAt:new Date(X).toISOString(),endedAt:new Date(Z).toISOString(),durationMs:Math.max(0,Z-X)}}var U5={title:"รายงานปัญหา",summaryLabel:"หัวข้อปัญหา",summaryRequired:"(ต้องกรอกก่อนแจ้งปัญหา)",summaryPlaceholder:"สรุปปัญหาสั้น ๆ เช่น กดบันทึกร่างแล้ว error",detailLabel:"อธิบายปัญหา (ไม่บังคับ)",detailPlaceholder:"เกิดอะไรขึ้น? กำลังทำอะไรอยู่ตอนที่พบปัญหา?",annotateTitle:"วาดบนรูป",annotateHint:"ทำเครื่องหมายจุดที่มีปัญหาก่อนแนบ — วงกรอบ ชี้ลูกศร ไฮไลต์ หรือพิมพ์ข้อความ",annotateApply:"ใช้รูปนี้",cancel:"ยกเลิก",toolRect:"กรอบ",toolArrow:"ลูกศร",toolHighlight:"ไฮไลต์",toolText:"ข้อความ",deleteSelected:"ลบที่เลือก",clearAll:"ล้างทั้งหมด",annotateHelp:"เลือกเครื่องมือแล้วลากบนรูป · ไม่ได้เลือกเครื่องมือ = ย้าย/ปรับขนาดสิ่งที่วาดไว้ · กดกากบาทมุมขวาบนของรูปทรงเพื่อลบ",capturing:"กำลังเก็บภาพหน้าจอ…",noScreenshot:"ไม่มีภาพหน้าจอ — ยังส่งรายงานได้",cancelled:"ยกเลิกการเก็บภาพหน้าจอแล้ว",close:"ปิด",submit:"แจ้งปัญหา",submitting:"กำลังส่ง…",submitted:"แจ้งปัญหาสำเร็จ",crashed:"เกิดข้อผิดพลาดในระบบ",crashAction:"แจ้งปัญหา",failed:"ส่งรายงานไม่สำเร็จ",failedOffline:"ส่งไม่สำเร็จ — เชื่อมต่อเซิร์ฟเวอร์ไม่ได้ ข้อความที่พิมพ์ไว้ยังอยู่ ตรวจสอบอินเทอร์เน็ตแล้วลองใหม่",failedUnavailable:"ส่งไม่สำเร็จ — ระบบกำลังปรับปรุงชั่วคราว ข้อความที่พิมพ์ไว้ยังอยู่ ลองใหม่ในอีกสักครู่",failedTooMany:"แจ้งปัญหาถี่เกินไป — ลองใหม่ในอีก {seconds} วินาที",captured:"เก็บข้อมูลแล้ว",reporter:"ผู้แจ้ง",page:"หน้า",replay:"บันทึกการใช้งาน",handoffTitle:"กำลังพาไปที่ระบบแจ้งปัญหา",handoffBody:"ระบบจะลงชื่อเข้าใช้ให้อัตโนมัติ เพื่อดูเรื่องที่คุณแจ้งไว้",handoffGo:"ไปเลย",handoffPreparing:"กำลังเตรียม…",handoffFailed:"เปิดรายการที่แจ้งไว้ไม่สำเร็จ",handoffBlocked:"เบราว์เซอร์บล็อกการเปิดแท็บใหม่",handoffOpen:"เปิดในแท็บใหม่",chooseTitle:"ต้องการให้ทีมช่วยเรื่องอะไร",kindProblem:"แจ้งปัญหา",kindRequest:"คำขอ",askInstead:"เป็นคำขอ?",askInsteadAction:"เลือกเรื่องที่ขอ",problemInstead:"เป็นปัญหาที่ต้องแก้?",problemInsteadAction:"แจ้งปัญหาแทน",problemInsteadShare:"แจ้งปัญหาแทน (แนบภาพหน้าจอ)",chooseProblemHint:"มีอะไรเสีย หรือใช้งานไม่ได้ — แนบภาพหน้าจอ",chooseRequestHint:"ขอให้ทีมทำ เช่น ขอสิทธิ์ ขอแก้ข้อมูล — ไม่ต้องแชร์หน้าจอ",requestTitle:"ขอให้ทีมดำเนินการ",requestTypeLabel:"เรื่องที่ขอ",requestTypeSearch:"ค้นหาเรื่องที่ขอ",requestTypeNone:"ไม่พบเรื่องที่ขอ — ลองคำอื่น",requestTypeCount:"{n} เรื่อง — เลื่อนดูหรือพิมพ์ค้นหา",requestTarget:"ทีมตั้งใจให้เสร็จภายใน {time}",requestSummaryLabel:"หัวข้อ",requestSummaryPlaceholder:"ขออะไร — สั้น ๆ",requestDetailLabel:"รายละเอียด (ไม่บังคับ)",requestDetailPlaceholder:"สิ่งที่ทีมต้องรู้เพื่อดำเนินการ",requestSubmit:"ส่งคำขอ",requestSubmitted:"ส่งคำขอแล้ว",requestWithShot:"แนบภาพหน้าจอนี้ไปกับคำขอ",requestAnnotateHint:"ทำเครื่องหมายสิ่งที่ขอบนภาพ — วงกรอบ ชี้ลูกศร ไฮไลต์ หรือพิมพ์ข้อความ",draftRestored:"ข้อความที่พิมพ์ไว้ครั้งก่อน ยังไม่ได้ส่ง",draftClear:"ล้าง",requestLeaves:"ไม่ส่งไปกับคำขอ",requestLeavesWhat:"บันทึกการใช้งานของหน้านี้ — ใช้กับการแจ้งปัญหาเท่านั้น",days:"{n} วัน",hours:"{n} ชั่วโมง",ringTitle:"ทีมงานกำลังโทรหาคุณ",ringAbout:"เรื่อง {key} · {title}",ringChat:"จากแชทกับทีมงาน",ringHow:"รับสายในหน้าคำร้องของคุณ — เปิดในแท็บใหม่ ไม่ต้องเข้าสู่ระบบอีก",ringOpen:"เปิดเพื่อรับสาย",ringDecline:"ไม่รับ",ringOpened:"เปิดหน้ารับสายแล้ว — กด รับสาย ในแท็บที่เปิดขึ้น",ringBlocked:"เบราว์เซอร์บล็อกแท็บใหม่ — กดที่นี่เพื่อเปิดหน้ารับสาย",ringClose:"ปิด",ringTab:"\uD83D\uDCDE สายเข้า",ringHint:"เมื่อรับสาย เบราว์เซอร์จะขอใช้ไมโครโฟน · ระหว่างคุย ทีมงานอาจขอดูหน้าจอ — คุณเลือกได้เสมอว่าจะให้ดูหรือไม่",ringTest:"ทดสอบไมค์และลำโพงก่อนรับสาย",ringAnswer:"รับสาย",ringAnswering:"กำลังรับสาย…",ringFallback:"เปิดสายในหน้านี้ไม่ได้ — รับสายในแท็บใหม่แทน ไม่ต้องเข้าสู่ระบบอีก",chatOpen:"แชทกับทีมงาน",chatTitle:"แชทกับทีมงาน",chatUnread:"{n} ข้อความใหม่จากทีมงาน",chatMove:"แชทกับทีมงาน — ลากเพื่อย้ายไปที่อื่นได้ถ้าบังอะไรอยู่",chatLabel:"แชทกับทีมงาน",chatLabelNew:"มีข้อความใหม่จากทีมงาน"},q5={title:"Report a problem",summaryLabel:"Summary",summaryRequired:"(required)",summaryPlaceholder:"One line, e.g. saving a draft returns an error",detailLabel:"Details (optional)",detailPlaceholder:"What happened? What were you doing at the time?",annotateTitle:"Draw on the image",annotateHint:"Mark what went wrong before attaching — box it, point at it, highlight it, or type on it",annotateApply:"Use this image",cancel:"Cancel",toolRect:"Box",toolArrow:"Arrow",toolHighlight:"Highlight",toolText:"Text",deleteSelected:"Delete selected",clearAll:"Clear all",annotateHelp:"Pick a tool and drag on the image · no tool selected = move/resize what you drew · press the ✕ on a shape to delete it",capturing:"Capturing the screen…",noScreenshot:"No screenshot — you can still send the report",cancelled:"Screen capture cancelled",close:"Close",submit:"Send report",submitting:"Sending…",submitted:"Report sent",crashed:"Something went wrong",crashAction:"Report it",failed:"Could not send the report",failedOffline:"Could not send — the server could not be reached. What you wrote is still here; check your connection and try again.",failedUnavailable:"Could not send — the system is being updated. What you wrote is still here; try again in a moment.",failedTooMany:"Too many reports — try again in {seconds} seconds.",captured:"Captured",reporter:"Reporter",page:"Page",replay:"activity log",handoffTitle:"Opening the support portal",handoffBody:"You will be signed in automatically to see what you reported",handoffGo:"Go now",handoffPreparing:"Preparing…",handoffFailed:"Could not open your reports",handoffBlocked:"Your browser blocked the new tab",handoffOpen:"Open in a new tab",chooseTitle:"How can the team help?",kindProblem:"Report a problem",kindRequest:"Request",askInstead:"Asking for something?",askInsteadAction:"Choose what you need",problemInstead:"Something broken?",problemInsteadAction:"Report a problem instead",problemInsteadShare:"Report a problem instead (with a screenshot)",chooseProblemHint:"Something is broken or not working — with a screenshot",chooseRequestHint:"Ask the team to do something, like access or a data change — no screen sharing",requestTitle:"Ask the team",requestTypeLabel:"What you need",requestTypeSearch:"Search what you need",requestTypeNone:"Nothing matches — try another word",requestTypeCount:"{n} to choose from — scroll or search",requestTarget:"The team aims to finish within {time}",requestSummaryLabel:"Subject",requestSummaryPlaceholder:"What do you need — briefly",requestDetailLabel:"Details (optional)",requestDetailPlaceholder:"What the team needs to know to do it",requestSubmit:"Send request",requestSubmitted:"Request sent",requestWithShot:"Attach this screenshot to the request",requestAnnotateHint:"Mark what you are asking about — box it, point at it, highlight it, or type on it",draftRestored:"What you typed last time, not sent yet",draftClear:"Clear",requestLeaves:"Not sent with a request",requestLeavesWhat:"this page's activity log — it is for problem reports only",days:"{n} days",hours:"{n} hours",ringTitle:"The support team is calling you",ringAbout:"About {key} · {title}",ringChat:"From your chat with support",ringHow:"Answer on your request's page — it opens in a new tab, already signed in",ringOpen:"Open to answer",ringDecline:"Decline",ringOpened:"Opened — press Answer in the new tab",ringBlocked:"Your browser blocked the new tab — open the call here",ringClose:"Close",ringTab:"\uD83D\uDCDE Incoming call",ringHint:"When you answer, your browser asks for the microphone · during the call the team may ask to see your screen — you always choose",ringTest:"Test the microphone and speaker first",ringAnswer:"Answer",ringAnswering:"Answering…",ringFallback:"The call can't open on this page — answer in a new tab instead, already signed in",chatOpen:"Chat with support",chatTitle:"Chat with support",chatUnread:"{n} new from support",chatMove:"Chat with support — drag to move it if it covers something",chatLabel:"Chat with us",chatLabelNew:"New message from support"};function e(J){return J==="en"?q5:U5}var D5="lw-debug-toasts",H5=6000,M5=`
1
+ (()=>{var C3=(($)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy($,{get:(J,Q)=>(typeof require<"u"?require:J)[Q]}):$)(function($){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+$+'" is not supported')});function x1($){if(!$)return null;let J=$===!0?{}:$,Q=(j,Z)=>typeof j==="number"&&Number.isFinite(j)&&j>=0&&j<2000?j:Z;return{side:J.position==="left"?"left":"right",x:Q(J.offset?.x,16),y:Q(J.offset?.y,16)}}var I3={maxRequests:60,maxConsoleEntries:120,maxActions:80,maxBodyChars:20000},Z0=null;function E4($){let J=[];if(!$.host?.trim())J.push("host");if(!$.realmKey?.trim())J.push("realmKey");if(!$.app?.name?.trim())J.push("app.name");if(typeof $.module!=="function")J.push("module");if(J.length)throw Error(`[debug-capture] configureDebugCapture is missing: ${J.join(", ")}. `+"See the README — `module` maps a pathname to the part of your app it belongs to.");Z0=$}function L(){if(!Z0)throw Error("[debug-capture] configureDebugCapture() has not been called");return Z0}function f1(){return Z0!==null}function N0(){let $=L().app;return{name:$.name,version:$.version??"0.0.0",environment:$.environment??O3()}}function O3(){if(typeof window>"u")return"unknown";let $=window.location.hostname;if($==="localhost"||$==="127.0.0.1"||$.endsWith(".local"))return"development";return"production"}function R0($){let J=Z0?.capture?.[$];return typeof J==="number"?J:I3[$]}function w1($){let J=Z0?.module;if(!J)return null;try{return J($)??null}catch{return null}}function y1(){let $=Z0?.redact;return{headers:$?.headers??[],queryKeys:($?.queryKeys??[]).map((J)=>J.toLowerCase()),bodyKeys:($?.bodyKeys??[]).map((J)=>J.toLowerCase())}}function k4(){return Z0?.capture?.overlaySelectors??[]}var L3='[contenteditable]:not([contenteditable="false"]), [data-lw-mask]',R3="[data-lw-mask]",A4={fps:1,quality:0.5};function V1(){let $=Z0?.replay;if(!$)return null;let J=$===!0?{}:$,Q=(X,V)=>typeof X==="number"&&X>0?X:V,j=J.maskInputs!==!1,Z=J.recordCanvas?{fps:Q(typeof J.recordCanvas==="object"?J.recordCanvas.fps:void 0,A4.fps),quality:Q(typeof J.recordCanvas==="object"?J.recordCanvas.quality:void 0,A4.quality)}:null;return{seconds:Q(J.seconds,60),maskInputs:j,maskTextSelector:J.maskTextSelector?.trim()||(j?L3:R3),maskText:J.maskText===!0,blockSelector:J.blockSelector?.trim()||"[data-lw-private]",maxBytes:Q(J.maxBytes,4000000),canvas:Z}}function x4($){if(typeof window>"u")return!1;let J;try{J=new URL($,window.location.href)}catch{return!1}if(S3(J))return!1;if(J.origin===window.location.origin)return!0;return(Z0?.capture?.bodyOrigins??[]).some((Q)=>{try{return new URL(Q).origin===J.origin}catch{return!1}})}function S3($){if(!Z0?.host)return!1;try{if(new URL(Z0.host).origin!==$.origin)return!1}catch{return!1}return $.pathname.startsWith("/ingest/")}function f4($){let J=Object.entries($).map(([Q,j])=>[Q.replace(/\/+$/,"")||"/",j]).sort((Q,j)=>j[0].length-Q[0].length);return(Q)=>{let j=(Q||"/").replace(/\/+$/,"")||"/";for(let[Z,X]of J)if(j===Z||j.startsWith(`${Z}/`))return{key:Z,label:X};return null}}var z1="‹redacted›",T3=/^(authorization|proxy-authorization|cookie|set-cookie|x-[a-z-]*token|x-csrf[a-z-]*|x-xsrf[a-z-]*)$/i,A3=new Set(["access_token","token","id_token","refresh_token","code","secret","client_secret","password","apikey","api_key","signature","x-amz-signature","x-amz-credential"]),E3=/(password|passwd|token|secret|authorization|refresh|client_secret|otp|pin)/i,k3=/[\w.+-]+@[\w-]+\.[\w.-]+/g,x3=/\d(?:[\d\s-]{7,})\d/g;function W1($){return $.replace(k3,z1).replace(x3,z1)}function f3($){if(T3.test($))return!0;return y1().headers.some((Q)=>Q.toLowerCase()===$.toLowerCase())}function K1($){let J={};for(let[Q,j]of Object.entries($))J[Q]=f3(Q)?z1:j;return J}function S0($){try{let J=/^https?:\/\//i.test($),Q=new URL($,J?void 0:"http://local.invalid"),j=!1;if(Q.searchParams.forEach((Z,X)=>{if(A3.has(X.toLowerCase())||y1().queryKeys.includes(X.toLowerCase()))Q.searchParams.set(X,z1),j=!0}),!j)return $;return J?Q.toString():`${Q.pathname}${Q.search}`}catch{return $}}function I2($,J){if(J>6||$===null||typeof $!=="object")return $;if(Array.isArray($))return $.map((j)=>I2(j,J+1));let Q={};for(let[j,Z]of Object.entries($)){let X=E3.test(j)||y1().bodyKeys.some((V)=>j.toLowerCase().includes(V));Q[j]=X?z1:I2(Z,J+1)}return Q}function Y1($,J){if($==null)return null;let Q=$,j=$.trim();if(j.startsWith("{")||j.startsWith("["))try{let Z=JSON.parse(j);Q=JSON.stringify(I2(Z,0))}catch{}if(Q.length>J)return`${Q.slice(0,J)}… [truncated ${Q.length-J} chars]`;return Q}var O2=120,L2=40,c0=($,J)=>$.length>J?`${$.slice(0,J)}…`:$,R2=($)=>{try{return decodeURIComponent($)}catch{return $}},i0=[],w4=0,y4=!1;function G1($,J,Q,j){let Z=c0(J,O2),X=i0[i0.length-1];if($==="navigate"&&X?.kind==="click"){let W=Z.replace(/^ไปที่\s*/,"");if(X.detail.includes(`→ ${W}`))return X.at=new Date().toISOString(),X;let K=W.split(/[?#]/)[0]??W,Y=X.source?R2(X.source.replace(/^→\s*/,"")).split(/[?#]/)[0]:null;if(Y&&(K===Y||K.startsWith(Y)))return X.detail=c0(`${X.detail} → ${W}`,O2),X.source=void 0,X.at=new Date().toISOString(),X}if(X&&X.kind===$&&X.detail===Z){if(X.at=new Date().toISOString(),$!=="navigate")X.count=(X.count??1)+1;return X}w4+=1;let V={id:`act_${w4}`,at:new Date().toISOString(),kind:$,detail:Z,count:1,source:Q,html:v1(j)};i0.push(V);while(i0.length>R0("maxActions"))y3(i0.shift());return V}var w3=200000,q1=0;function v1($){if(!$)return;if(q1+$.length>w3)return;return q1+=$.length,$}function y3($){if(!$)return;if(q1-=($.html?.length??0)+($.afterHtml?.length??0),q1<0)q1=0}function g1($){return $ instanceof Element&&Boolean($.closest("[data-debug-reporter]"))}var g3='button, a[href], [role="button"], [role="tab"], [role="menuitem"], [role="option"], [role="switch"], [role="checkbox"], [role="radio"], [role="link"], summary, input, select, textarea',v3={button:"ปุ่ม",a:"ลิงก์",input:"ช่อง",textarea:"ช่อง",select:"ตัวเลือก",summary:"ส่วนขยาย"},g4={button:"ปุ่ม",tab:"แท็บ",menuitem:"เมนู",option:"ตัวเลือก",switch:"สวิตช์",checkbox:"ช่องเลือก",radio:"ตัวเลือก",link:"ลิงก์"};function b3($){let J=$.getAttribute("role");if(J&&g4[J])return g4[J];return v3[$.tagName.toLowerCase()]??"ปุ่ม"}function m3($,J){try{let Q=$,j=0;while(Q&&j<=J){let Z=p4(Q);if(Z&&typeof Z.memoizedProps?.onClick==="function")return Q;Q=Q.parentElement,j+=1}}catch{}return null}function h3($){let J=$.getAttribute("aria-label")?.trim();if(J)return J;let Q=$.getAttribute("title")?.trim();if(Q)return Q;if($ instanceof HTMLInputElement||$ instanceof HTMLTextAreaElement||$ instanceof HTMLSelectElement)return($.getAttribute("placeholder")||$.getAttribute("name")||"").trim();if($ instanceof HTMLImageElement)return($.getAttribute("alt")||"").trim();let j=($.textContent??"").replace(/\s+/g," ").trim();if(j)return j;if($ instanceof HTMLAnchorElement){let Z=$.getAttribute("href");if(Z?.startsWith("/"))return R2(Z)}return""}function u3($){if(!($ instanceof Element))return null;let J=$.closest(g3)??m3($,4);if(!J)return null;let Q=J.tagName.toLowerCase();if(Q==="html"||Q==="body")return null;return J}function p3($){let J=W1(h3($));if(!J)return null;return`${b3($)} “${c0(J,L2)}”`}var u4=6000,d3=4000,i3=/(?:^|\s)!?(?:fixed|absolute|sticky|inset-\S+|z-\S+|top-\S+|bottom-\S+|left-\S+|right-\S+|w-screen|h-screen|min-h-screen|max-h-screen|translate-\S+|scale-\S+)(?=\s|$)/g;function c3($){$.querySelectorAll("script, style, link, iframe, object, embed, noscript, canvas, video, audio").forEach((Z)=>Z.remove());let J=[$,...Array.from($.querySelectorAll("*"))];for(let Z of J){for(let V of Array.from(Z.attributes)){let W=V.name.toLowerCase();if(W.startsWith("on")||W==="srcdoc"||W==="value"||W.startsWith("data-"))Z.removeAttribute(V.name)}if(Z instanceof HTMLAnchorElement)Z.setAttribute("href","#");if(Z instanceof HTMLImageElement)Z.removeAttribute("src");let X=Z.getAttribute("class");if(X){let V=X.replace(i3," ").replace(/\s+/g," ").trim();if(V)Z.setAttribute("class",V);else Z.removeAttribute("class")}}let Q=document.createTreeWalker($,NodeFilter.SHOW_TEXT),j=Q.nextNode();while(j){if(j.nodeValue)j.nodeValue=W1(j.nodeValue);j=Q.nextNode()}}function S2($,J,Q){try{let j=$.outerHTML;if(!j||j.length>J)return;let Z=$.cloneNode(!0);c3(Z);let X=Z.outerHTML;return X&&X.length<=Q?X:void 0}catch{return}}var l3=($)=>S2($,u4,d3),r3=150000,o3=40000,v4=($)=>S2($,r3,o3);function n3($){if(!($ instanceof HTMLInputElement)&&!($ instanceof HTMLTextAreaElement)&&!($ instanceof HTMLSelectElement))return null;let J=$.name||$.id||$.getAttribute("aria-label")||$.getAttribute("placeholder")||$.tagName.toLowerCase();return`ช่อง “${W1(J)}”`}var b4=80;function p4($){let J=Object.keys($).find((Q)=>Q.startsWith("__reactFiber$")||Q.startsWith("__reactInternalInstance$"));return J?$[J]:null}function s3($){if(typeof $!=="function")return null;try{let J=Function.prototype.toString.call($);return(J.match(/\.(?:push|replace)\(\s*['"`]([^'"`]+)['"`]/)??J.match(/redirect\(\s*['"`]([^'"`]+)['"`]/))?.[1]??null}catch{return null}}function m4($){if(!$)return;return`→ ${$.length>b4?`${$.slice(0,b4)}…`:$}`}function a3($){try{let J=$.closest("a[href]")?.getAttribute("href");if(J&&J.startsWith("/"))return m4(J);let Q=p4($),j=0;while(Q&&j<30){if(typeof Q.memoizedProps?.onClick==="function")return m4(s3(Q.memoizedProps.onClick));Q=Q.return,j+=1}return}catch{return}}var t3='[role="dialog"], [role="alertdialog"], [role="menu"], [role="listbox"], [role="status"], [role="alert"]';function e3(){let $=k4();return $.length?$.join(", "):t3}function $5($){let J=$.getAttribute("role");if(J==="status"||J==="alert")return"ข้อความแจ้งเตือน";if(J==="menu")return"เมนู";if(J==="listbox")return"รายการตัวเลือก";if(J==="alertdialog")return"กล่องยืนยัน";return"กล่องโต้ตอบ"}function J5($){let J=$.getAttribute("aria-label")?.trim();if(J)return J;let Q=$.getAttribute("aria-labelledby");if(Q){let X=Q.split(/\s+/).map((V)=>document.getElementById(V)?.textContent?.trim()??"").filter(Boolean).join(" ");if(X)return X}let Z=$.querySelector('[data-slot="dialog-title"], h1, h2, h3, [role="heading"]')?.textContent?.replace(/\s+/g," ").trim();if(Z)return Z;return($.textContent??"").replace(/\s+/g," ").trim()}function d4($){let J=W1(J5($)),Q=$5($);return J?`เปิด ${Q} “${c0(J,L2)}”`:`เปิด ${Q}`}var Q5='[aria-busy="true"], [role="progressbar"], [data-loading="true"], .animate-pulse, .animate-spin',j5=/กำลังโหลด|กำลังค้นหา|กำลังดำเนินการ|\bloading\b/i;function Z5($){if($.querySelector(Q5))return!0;return j5.test($.textContent??"")}var X5=400,V5=250,z5=8000;function W5($,J){if(typeof MutationObserver>"u"){J.html=v1(v4($));return}let Q=Date.now(),j=!1,Z=()=>{j=!0,V.disconnect(),window.clearInterval(W),window.clearTimeout(K)},X=()=>{if(j)return;if(Z(),!$.isConnected)return;J.detail=c0(d4($),O2),J.html=v1(v4($))},V=new MutationObserver(()=>{Q=Date.now()});V.observe($,{childList:!0,subtree:!0,attributes:!0,characterData:!0});let W=window.setInterval(()=>{if(j)return;if(!$.isConnected){Z();return}if(Date.now()-Q>=X5&&!Z5($))X()},V5),K=window.setTimeout(X,z5)}function K5($){if(g1($))return;let J=G1("ui",d4($));if(J)W5($,J)}function Y5(){if(typeof MutationObserver>"u")return;let $=new WeakSet;new MutationObserver((Q)=>{for(let j of Q)for(let Z of Array.from(j.addedNodes)){if(!(Z instanceof Element))continue;let X=e3(),V=Z.matches(X)?[Z]:Array.from(Z.querySelectorAll(X));for(let W of V){if($.has(W))continue;$.add(W),K5(W)}}}).observe(document.body,{childList:!0,subtree:!0})}var G5=1600,q5=2500;function h4($){return{disabled:$.hasAttribute("disabled")||$.getAttribute("aria-disabled")==="true",busy:$.getAttribute("aria-busy")==="true",text:c0(($.textContent??"").replace(/\s+/g," ").trim(),L2)}}function U5($,J){if(!$.disabled&&J.disabled)return"ปุ่มถูกปิดใช้งานหลังคลิก";if(!$.busy&&J.busy)return"ปุ่มเข้าสู่สถานะกำลังโหลด";if($.text!==J.text&&J.text)return`ข้อความเปลี่ยนเป็น “${J.text}”`;return null}function D5($,J){if(typeof MutationObserver>"u")return;let Q=h4($),j=!1,Z=(W,K)=>{if(j)return;if(j=!0,X.disconnect(),window.clearTimeout(V),J.afterNote=W,K)J.afterHtml=v1(S2($,u4,q5))},X=new MutationObserver(()=>{if(!$.isConnected){Z("องค์ประกอบหายไปจากหน้าจอ",!1);return}let W=U5(Q,h4($));if(W)Z(W,!0)});X.observe($,{attributes:!0,attributeFilter:["disabled","aria-disabled","aria-busy","class"],childList:!0,subtree:!0,characterData:!0});let V=window.setTimeout(()=>{if(!j&&!$.isConnected){Z("องค์ประกอบหายไปจากหน้าจอ",!1);return}j=!0,X.disconnect()},G5)}function i4(){if(y4||typeof window>"u")return;y4=!0,document.addEventListener("click",(j)=>{if(g1(j.target))return;let Z=u3(j.target);if(!Z)return;let X=p3(Z);if(!X)return;let V=G1("click",`คลิก ${X}`,a3(Z),l3(Z));if(V)D5(Z,V)},{capture:!0,passive:!0}),document.addEventListener("change",(j)=>{if(g1(j.target))return;let Z=n3(j.target);if(Z)G1("input",`แก้ไข ${Z}`)},{capture:!0,passive:!0}),document.addEventListener("submit",(j)=>{if(g1(j.target))return;G1("submit","ส่งฟอร์ม")},{capture:!0,passive:!0});let $=()=>G1("navigate",`ไปที่ ${R2(S0(location.pathname+location.search))}`),J=history.pushState.bind(history),Q=history.replaceState.bind(history);history.pushState=(...j)=>{let Z=J(...j);return $(),Z},history.replaceState=(...j)=>{let Z=Q(...j);return $(),Z},window.addEventListener("popstate",$),Y5()}function c4(){return i0.map(($)=>({...$}))}var l4=2000,b1=[],r4=0,o4=!1;function T2($,J){r4+=1,b1.push({id:`log_${r4}`,at:new Date().toISOString(),level:$,message:J.length>l4?`${J.slice(0,l4)}…`:J});while(b1.length>R0("maxConsoleEntries"))b1.shift()}function H5(){let $=new WeakSet;return(J,Q)=>{if(typeof Q==="object"&&Q!==null){if($.has(Q))return"[Circular]";$.add(Q)}if(typeof Q==="bigint")return Q.toString();return Q}}function n4($){if(typeof $==="string")return $;if($ instanceof Error)return`${$.name}: ${$.message}`;try{let J=JSON.stringify($,H5());if(J!==void 0)return J}catch{}try{return String($)}catch{}try{return Object.prototype.toString.call($)}catch{return`[${typeof $}]`}}function s4(){if(o4||typeof window>"u")return;o4=!0;let $=["log","info","warn","error","debug"];for(let J of $){let Q=console[J].bind(console);console[J]=(...j)=>{T2(J,j.map(n4).join(" ")),Q(...j)}}window.addEventListener("error",(J)=>{let Q=J.filename?` (${J.filename}:${J.lineno}:${J.colno})`:"";T2("exception",`${J.message}${Q}`)}),window.addEventListener("unhandledrejection",(J)=>{let Q=J.reason instanceof Error?`${J.reason.name}: ${J.reason.message}`:n4(J.reason);T2("unhandledrejection",Q)})}function a4(){return b1.map(($)=>({...$}))}var t4=new Set,e4=new Set;function $6($,J){return $.add(J),()=>$.delete(J)}function J6($,J){for(let Q of[...$])Q(J)}function Q6($){return $6(t4,$)}function l0($={type:"manual"}){J6(t4,$)}function j6($){return $6(e4,$)}function Z6($){J6(e4,$)}var F5=15000,M5=["ResizeObserver loop","Script error.","Non-Error promise rejection captured"],X6=!1,V6=0;function P5($){return M5.some((J)=>$.includes(J))}function z6($){let J=$.message??"";if(!J||P5(J))return;let Q=Date.now();if(Q-V6<F5)return;V6=Q,Z6({...$,message:J})}function W6(){if(X6||typeof window>"u")return;X6=!0,window.addEventListener("error",($)=>{if(!$.message&&!$.error)return;let J=$.error instanceof Error?$.error:null;z6({type:"runtime-error",message:$.message||(J?J.message:"Unknown error"),stack:J?.stack})}),window.addEventListener("unhandledrejection",($)=>{let J=$.reason;z6({type:"unhandledrejection",message:J instanceof Error?J.message:String(J),stack:J instanceof Error?J.stack:void 0})})}var q6=4000,B5=1e6,N5=1e7,m1=[],K6=0,Y6=!1;function U6($){m1.push($);while(m1.length>R0("maxRequests"))m1.shift()}function D6(){return K6+=1,`req_${K6}`}function G6($){let J={};if(!$)return J;if($ instanceof Headers)$.forEach((Q,j)=>{J[j]=Q});else if(Array.isArray($))for(let[Q,j]of $)J[Q]=j;else Object.assign(J,$);return J}function _5($){let J={};return $.forEach((Q,j)=>{J[j]=Q}),J}function C5($){if($==null)return null;if(typeof $==="string")return $;if($ instanceof URLSearchParams)return $.toString();if(typeof FormData<"u"&&$ instanceof FormData)return`[FormData: ${Array.from($.keys()).join(", ")}]`;if(typeof Blob<"u"&&$ instanceof Blob)return`[Blob ${$.size} bytes]`;if($ instanceof ArrayBuffer)return`[ArrayBuffer ${$.byteLength} bytes]`;return"[binary]"}function I5($,J){let Q="",j="GET",Z={},X=null;if(typeof $==="string")Q=$;else if($ instanceof URL)Q=$.toString();else Q=$.url,j=$.method||j,Z=G6($.headers);if(J){if(J.method)j=J.method;if(J.headers)Z={...Z,...G6(J.headers)};if(J.body!==void 0)X=C5(J.body)}return{method:j.toUpperCase(),url:Q,headers:Z,body:X}}function H6($){return!x4($)}function O5($,J){if(H6(J.url)){J.responseSnippet="[body not captured for this origin]";return}let Q=$.headers.get("content-type")??"",j=Number($.headers.get("content-length")??"0"),Z=j?`, ~${j} bytes`:"";if(!/json|text|xml|html|javascript|urlencoded/i.test(Q)){J.responseSnippet=`[binary ${Q||"unknown"}${Z}]`;return}if(j>B5){J.responseSnippet=`[response ${Q||"text"}${Z} — omitted]`;return}try{$.clone().text().then((X)=>{J.responseSnippet=Y1(X,R0("maxBodyChars"))}).catch(()=>{})}catch{}}function F6($,J){if(/[?&]_rsc=/.test($))return!0;for(let Q of Object.keys(J)){let j=Q.toLowerCase();if(j==="rsc"||j==="next-router-prefetch"||j==="next-router-state-tree")return!0}return!1}function L5(){if(typeof window>"u"||typeof window.fetch!=="function")return;let $=window.fetch.bind(window);window.fetch=Object.assign(async(J,Q)=>{let j=I5(J,Q);if(F6(j.url,j.headers))return $(J,Q);let Z={id:D6(),startedAt:new Date().toISOString(),method:j.method,url:S0(j.url),requestHeaders:K1(j.headers),requestBody:Y1(j.body,q6),status:null,statusText:null,durationMs:null,via:"fetch"};U6(Z);let X=performance.now();try{let V=await $(J,Q);return Z.status=V.status,Z.statusText=V.statusText,Z.durationMs=Math.round(performance.now()-X),Z.responseHeaders=K1(_5(V.headers)),O5(V,Z),V}catch(V){throw Z.durationMs=Math.round(performance.now()-X),Z.error=V instanceof Error?`${V.name}: ${V.message}`:String(V),V}},$)}function R5(){if(typeof window>"u"||typeof window.XMLHttpRequest!=="function")return;let $=XMLHttpRequest.prototype,J=$.open,Q=$.send,j=function(X,V){let W=typeof V==="string"?V:V.toString();return this.__lwEntry=F6(W,{})?void 0:{id:D6(),startedAt:"",method:(X||"GET").toUpperCase(),url:S0(W),requestHeaders:{},requestBody:null,status:null,statusText:null,durationMs:null,via:"xhr"},J.apply(this,arguments)},Z=function(X){let V=this.__lwEntry;if(V){V.startedAt=new Date().toISOString(),V.requestBody=typeof X==="string"?Y1(X,q6):X==null?null:"[non-string body]";let W=performance.now();U6(V),this.addEventListener("loadend",()=>{if(V.status=this.status||null,V.statusText=this.statusText||null,V.durationMs=Math.round(performance.now()-W),H6(V.url))V.responseSnippet="[body not captured for this origin]";else if(this.responseType===""||this.responseType==="text")try{V.responseSnippet=Y1(this.responseText||"",R0("maxBodyChars"))}catch{}else{let K=this.getResponseHeader("content-type")??this.responseType;V.responseSnippet=`[binary ${K}]`}})}return Q.apply(this,arguments)};$.open=j,$.send=Z}function M6(){if(Y6)return;Y6=!0,L5(),R5()}function P6(){let $=m1.map((Q)=>({...Q})),J=0;for(let Q=$.length-1;Q>=0;Q-=1){let j=$[Q],Z=j?.responseSnippet;if(!j||typeof Z!=="string"||Z.length===0)continue;if(J+Z.length>N5)j.responseSnippet=`[response omitted — report size budget reached (${Z.length.toLocaleString()} chars)]`;else J+=Z.length}return $}var S5=4,B6=3,T5=4000,A5="[data-debug-reporter]",N6=()=>import("@rrweb/record");function _6($){N6=$}var z0=[],A2=null,h1=!1;function C6(){if(typeof window>"u"||A2||h1)return;let $=V1();if(!$)return;h1=!0;let J=()=>void E5($);if("requestIdleCallback"in window)window.requestIdleCallback(J,{timeout:3000});else setTimeout(J,1000)}async function E5($){let J;try{J=(await N6()).record}catch(Q){h1=!1,console.warn("[debug-capture] session replay could not start:",Q);return}if(A2)return;try{A2=J({emit:(Q)=>k5(Q),checkoutEveryNms:Math.max(1000,$.seconds*1000/2),checkoutEveryNth:T5,maskAllInputs:$.maskInputs,maskTextSelector:$.maskText?"*":$.maskTextSelector,blockSelector:`${$.blockSelector}, ${A5}`,slimDOMOptions:"all",inlineStylesheet:!0,sampling:{mousemove:50,scroll:150,media:800,input:"last",...$.canvas?{canvas:$.canvas.fps}:{}},recordCanvas:$.canvas!==null,...$.canvas?{dataURLOptions:{type:"image/webp",quality:$.canvas.quality}}:{},errorHandler:()=>!0})??null}catch(Q){console.warn("[debug-capture] session replay could not start:",Q)}finally{h1=!1}}function k5($){if($.type===S5||z0.length===0){if(z0.push([]),z0.length>B6)z0=z0.slice(-B6)}z0[z0.length-1].push($)}function I6($=Date.now()){let J=V1();if(!J||!z0.length)return null;let Q=$-J.seconds*1000,j=z0.length-1;while(j>0&&(z0[j][0]?.timestamp??$)>Q)j-=1;let Z=z0.slice(j).flat(),X=Z[0]?.timestamp,V=Z[Z.length-1]?.timestamp;if(X===void 0||V===void 0)return null;return{events:Z,startedAt:new Date(X).toISOString(),endedAt:new Date(V).toISOString(),durationMs:Math.max(0,V-X)}}var x5={title:"รายงานปัญหา",summaryLabel:"หัวข้อปัญหา",summaryRequired:"(ต้องกรอกก่อนแจ้งปัญหา)",summaryPlaceholder:"สรุปปัญหาสั้น ๆ เช่น กดบันทึกร่างแล้ว error",detailLabel:"อธิบายปัญหา (ไม่บังคับ)",detailPlaceholder:"เกิดอะไรขึ้น? กำลังทำอะไรอยู่ตอนที่พบปัญหา?",annotateTitle:"วาดบนรูป",annotateHint:"ทำเครื่องหมายจุดที่มีปัญหาก่อนแนบ — วงกรอบ ชี้ลูกศร ไฮไลต์ หรือพิมพ์ข้อความ",annotateApply:"ใช้รูปนี้",cancel:"ยกเลิก",toolRect:"กรอบ",toolArrow:"ลูกศร",toolHighlight:"ไฮไลต์",toolText:"ข้อความ",deleteSelected:"ลบที่เลือก",clearAll:"ล้างทั้งหมด",annotateHelp:"เลือกเครื่องมือแล้วลากบนรูป · ไม่ได้เลือกเครื่องมือ = ย้าย/ปรับขนาดสิ่งที่วาดไว้ · กดกากบาทมุมขวาบนของรูปทรงเพื่อลบ",capturing:"กำลังเก็บภาพหน้าจอ…",noScreenshot:"ไม่มีภาพหน้าจอ — ยังส่งรายงานได้",cancelled:"ยกเลิกการเก็บภาพหน้าจอแล้ว",close:"ปิด",submit:"แจ้งปัญหา",submitting:"กำลังส่ง…",submitted:"แจ้งปัญหาสำเร็จ",crashed:"เกิดข้อผิดพลาดในระบบ",crashAction:"แจ้งปัญหา",failed:"ส่งรายงานไม่สำเร็จ",failedOffline:"ส่งไม่สำเร็จ — เชื่อมต่อเซิร์ฟเวอร์ไม่ได้ ข้อความที่พิมพ์ไว้ยังอยู่ ตรวจสอบอินเทอร์เน็ตแล้วลองใหม่",failedUnavailable:"ส่งไม่สำเร็จ — ระบบกำลังปรับปรุงชั่วคราว ข้อความที่พิมพ์ไว้ยังอยู่ ลองใหม่ในอีกสักครู่",failedTooMany:"แจ้งปัญหาถี่เกินไป — ลองใหม่ในอีก {seconds} วินาที",captured:"เก็บข้อมูลแล้ว",reporter:"ผู้แจ้ง",page:"หน้า",replay:"บันทึกการใช้งาน",handoffTitle:"กำลังพาไปที่ระบบแจ้งปัญหา",handoffBody:"ระบบจะลงชื่อเข้าใช้ให้อัตโนมัติ เพื่อดูเรื่องที่คุณแจ้งไว้",handoffGo:"ไปเลย",handoffPreparing:"กำลังเตรียม…",handoffFailed:"เปิดรายการที่แจ้งไว้ไม่สำเร็จ",handoffBlocked:"เบราว์เซอร์บล็อกการเปิดแท็บใหม่",handoffOpen:"เปิดในแท็บใหม่",chooseTitle:"ต้องการให้ทีมช่วยเรื่องอะไร",kindProblem:"แจ้งปัญหา",kindRequest:"คำขอ",askInstead:"เป็นคำขอ?",askInsteadAction:"เลือกเรื่องที่ขอ",problemInstead:"เป็นปัญหาที่ต้องแก้?",problemInsteadAction:"แจ้งปัญหาแทน",problemInsteadShare:"แจ้งปัญหาแทน (แนบภาพหน้าจอ)",chooseProblemHint:"มีอะไรเสีย หรือใช้งานไม่ได้ — แนบภาพหน้าจอ",chooseRequestHint:"ขอให้ทีมทำ เช่น ขอสิทธิ์ ขอแก้ข้อมูล — ไม่ต้องแชร์หน้าจอ",requestTitle:"ขอให้ทีมดำเนินการ",requestTypeLabel:"เรื่องที่ขอ",requestTypeSearch:"ค้นหาเรื่องที่ขอ",requestTypeNone:"ไม่พบเรื่องที่ขอ — ลองคำอื่น",requestTypeCount:"{n} เรื่อง — เลื่อนดูหรือพิมพ์ค้นหา",requestTarget:"ทีมตั้งใจให้เสร็จภายใน {time}",requestSummaryLabel:"หัวข้อ",requestSummaryPlaceholder:"ขออะไร — สั้น ๆ",requestDetailLabel:"รายละเอียด (ไม่บังคับ)",requestDetailPlaceholder:"สิ่งที่ทีมต้องรู้เพื่อดำเนินการ",requestSubmit:"ส่งคำขอ",requestSubmitted:"ส่งคำขอแล้ว",requestWithShot:"แนบภาพหน้าจอนี้ไปกับคำขอ",requestAnnotateHint:"ทำเครื่องหมายสิ่งที่ขอบนภาพ — วงกรอบ ชี้ลูกศร ไฮไลต์ หรือพิมพ์ข้อความ",draftRestored:"ข้อความที่พิมพ์ไว้ครั้งก่อน ยังไม่ได้ส่ง",draftClear:"ล้าง",requestLeaves:"ไม่ส่งไปกับคำขอ",requestLeavesWhat:"บันทึกการใช้งานของหน้านี้ — ใช้กับการแจ้งปัญหาเท่านั้น",days:"{n} วัน",hours:"{n} ชั่วโมง",ringTitle:"ทีมงานกำลังโทรหาคุณ",ringAbout:"เรื่อง {key} · {title}",ringChat:"จากแชทกับทีมงาน",ringHow:"รับสายในหน้าคำร้องของคุณ — เปิดในแท็บใหม่ ไม่ต้องเข้าสู่ระบบอีก",ringOpen:"เปิดเพื่อรับสาย",ringDecline:"ไม่รับ",ringOpened:"เปิดหน้ารับสายแล้ว — กด รับสาย ในแท็บที่เปิดขึ้น",ringBlocked:"เบราว์เซอร์บล็อกแท็บใหม่ — กดที่นี่เพื่อเปิดหน้ารับสาย",ringClose:"ปิด",ringTab:"\uD83D\uDCDE สายเข้า",ringHint:"เมื่อรับสาย เบราว์เซอร์จะขอใช้ไมโครโฟน · ระหว่างคุย ทีมงานอาจขอดูหน้าจอ — คุณเลือกได้เสมอว่าจะให้ดูหรือไม่",ringTest:"ทดสอบไมค์และลำโพงก่อนรับสาย",ringAnswer:"รับสาย",ringAnswering:"กำลังรับสาย…",ringFallback:"เปิดสายในหน้านี้ไม่ได้ — รับสายในแท็บใหม่แทน ไม่ต้องเข้าสู่ระบบอีก",chatOpen:"แชทกับทีมงาน",chatTitle:"แชทกับทีมงาน",chatUnread:"{n} ข้อความใหม่จากทีมงาน",chatMove:"แชทกับทีมงาน — ลากเพื่อย้ายไปที่อื่นได้ถ้าบังอะไรอยู่",chatLabel:"แชทกับทีมงาน",chatLabelNew:"มีข้อความใหม่จากทีมงาน"},f5={title:"Report a problem",summaryLabel:"Summary",summaryRequired:"(required)",summaryPlaceholder:"One line, e.g. saving a draft returns an error",detailLabel:"Details (optional)",detailPlaceholder:"What happened? What were you doing at the time?",annotateTitle:"Draw on the image",annotateHint:"Mark what went wrong before attaching — box it, point at it, highlight it, or type on it",annotateApply:"Use this image",cancel:"Cancel",toolRect:"Box",toolArrow:"Arrow",toolHighlight:"Highlight",toolText:"Text",deleteSelected:"Delete selected",clearAll:"Clear all",annotateHelp:"Pick a tool and drag on the image · no tool selected = move/resize what you drew · press the ✕ on a shape to delete it",capturing:"Capturing the screen…",noScreenshot:"No screenshot — you can still send the report",cancelled:"Screen capture cancelled",close:"Close",submit:"Send report",submitting:"Sending…",submitted:"Report sent",crashed:"Something went wrong",crashAction:"Report it",failed:"Could not send the report",failedOffline:"Could not send — the server could not be reached. What you wrote is still here; check your connection and try again.",failedUnavailable:"Could not send — the system is being updated. What you wrote is still here; try again in a moment.",failedTooMany:"Too many reports — try again in {seconds} seconds.",captured:"Captured",reporter:"Reporter",page:"Page",replay:"activity log",handoffTitle:"Opening the support portal",handoffBody:"You will be signed in automatically to see what you reported",handoffGo:"Go now",handoffPreparing:"Preparing…",handoffFailed:"Could not open your reports",handoffBlocked:"Your browser blocked the new tab",handoffOpen:"Open in a new tab",chooseTitle:"How can the team help?",kindProblem:"Report a problem",kindRequest:"Request",askInstead:"Asking for something?",askInsteadAction:"Choose what you need",problemInstead:"Something broken?",problemInsteadAction:"Report a problem instead",problemInsteadShare:"Report a problem instead (with a screenshot)",chooseProblemHint:"Something is broken or not working — with a screenshot",chooseRequestHint:"Ask the team to do something, like access or a data change — no screen sharing",requestTitle:"Ask the team",requestTypeLabel:"What you need",requestTypeSearch:"Search what you need",requestTypeNone:"Nothing matches — try another word",requestTypeCount:"{n} to choose from — scroll or search",requestTarget:"The team aims to finish within {time}",requestSummaryLabel:"Subject",requestSummaryPlaceholder:"What do you need — briefly",requestDetailLabel:"Details (optional)",requestDetailPlaceholder:"What the team needs to know to do it",requestSubmit:"Send request",requestSubmitted:"Request sent",requestWithShot:"Attach this screenshot to the request",requestAnnotateHint:"Mark what you are asking about — box it, point at it, highlight it, or type on it",draftRestored:"What you typed last time, not sent yet",draftClear:"Clear",requestLeaves:"Not sent with a request",requestLeavesWhat:"this page's activity log — it is for problem reports only",days:"{n} days",hours:"{n} hours",ringTitle:"The support team is calling you",ringAbout:"About {key} · {title}",ringChat:"From your chat with support",ringHow:"Answer on your request's page — it opens in a new tab, already signed in",ringOpen:"Open to answer",ringDecline:"Decline",ringOpened:"Opened — press Answer in the new tab",ringBlocked:"Your browser blocked the new tab — open the call here",ringClose:"Close",ringTab:"\uD83D\uDCDE Incoming call",ringHint:"When you answer, your browser asks for the microphone · during the call the team may ask to see your screen — you always choose",ringTest:"Test the microphone and speaker first",ringAnswer:"Answer",ringAnswering:"Answering…",ringFallback:"The call can't open on this page — answer in a new tab instead, already signed in",chatOpen:"Chat with support",chatTitle:"Chat with support",chatUnread:"{n} new from support",chatMove:"Chat with support — drag to move it if it covers something",chatLabel:"Chat with us",chatLabelNew:"New message from support"};function $0($){return $==="en"?f5:x5}var w5="lw-debug-toasts",y5=6000,g5=`
2
2
  :host { all: initial; }
3
3
  .stack {
4
4
  position: fixed; top: 16px; right: 16px; z-index: 2147483001;
@@ -30,7 +30,7 @@
30
30
  }
31
31
  @keyframes in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
32
32
  @media (prefers-reduced-motion: reduce) { .toast { animation: none; } }
33
- `,S2=null;function B5(){if(typeof document>"u")return null;if(S2?.isConnected)return S2;let J=document.createElement(D5);J.dataset.debugReporter="true";let $=J.attachShadow({mode:"open"}),j=document.createElement("style");j.textContent=M5;let Q=document.createElement("div");return Q.className="stack",Q.setAttribute("role","status"),Q.setAttribute("aria-live","polite"),$.append(j,Q),document.body.append(J),S2=Q,Q}function c0(J,$="success",j){let Q=k1()?_().toast:void 0;if(Q){Q({message:J,tone:$,...j?{action:j}:{}});return}let z=B5();if(!z)return;let X=document.createElement("div");X.className="toast",X.dataset.tone=$;let Z=document.createElement("span");Z.className="dot";let W=document.createElement("span");W.textContent=J;let Y=document.createElement("button");Y.type="button",Y.className="close",Y.textContent="✕",Y.setAttribute("aria-label","ปิด");let U=()=>{window.clearTimeout(C),X.remove()};Y.addEventListener("click",U);let C=$==="error"||j?0:window.setTimeout(U,H5);if(X.append(Z,W),j){let F=document.createElement("button");F.type="button",F.className="action",F.textContent=j.label,F.addEventListener("click",()=>{U(),j.onClick()}),X.append(F)}X.append(Y),z.append(X)}function H6(J,$,j){let Q=J.filter((X)=>Boolean(X.error)||X.status!=null&&X.status>=400).slice(-20).map((X)=>({method:X.method,url:X.url,status:X.status,error:X.error,at:X.startedAt})),z=$.filter((X)=>X.level==="error"||X.level==="exception"||X.level==="unhandledrejection").slice(-20).map((X)=>X.message);return{failedRequests:Q,errors:z,erroredQueries:j.slice(0,20)}}function P5(){let J={memoryUsedMb:null,memoryLimitMb:null,domContentLoadedMs:null,loadEventMs:null};if(typeof performance>"u")return J;let $=performance.memory;if($)J.memoryUsedMb=Math.round($.usedJSHeapSize/1024/1024),J.memoryLimitMb=Math.round($.jsHeapSizeLimit/1024/1024);let[j]=performance.getEntriesByType("navigation");if(j)J.domContentLoadedMs=Math.round(j.domContentLoadedEventEnd),J.loadEventMs=Math.round(j.loadEventEnd);return J}function T2(J,$){if(!J)return $;try{return J()}catch{return $}}function M6(){let J=_(),{pathname:$,search:j,href:Q}=window.location;return{capturedAt:new Date().toISOString(),route:{href:Q,pathname:$,search:j},module:x1($),user:T2(J.user,{}),apiHeaders:V1(T2(J.headers,{})),app:{name:B0().name,version:B0().version,environment:B0().environment},client:{userAgent:navigator.userAgent,language:navigator.language,platform:navigator.platform,online:navigator.onLine,viewport:{width:window.innerWidth,height:window.innerHeight,dpr:window.devicePixelRatio},screen:{width:window.screen.width,height:window.screen.height}},performance:P5(),extra:T2(J.extra,{})}}var F5=2;function m1(J){let $=K6(),j=p4();return{context:M6(),reason:J.reason,note:J.note,cause:H6($,j,J.erroredQueries),actionTrail:g4(),network:$,console:j,screenshotDataUrl:J.screenshotDataUrl,screenshotMethod:J.screenshotMethod,replay:D6()??void 0,meta:{generatedBy:"lightwork-debug-capture",schemaVersion:F5}}}async function A2(){if(typeof navigator<"u"&&Boolean(navigator.mediaDevices?.getDisplayMedia)){let j=await N5();if(j.status==="ok")return{dataUrl:j.dataUrl,method:"display-media"};if(j.status==="cancelled")return{dataUrl:null,method:"cancelled"}}let $=await C5();if($)return{dataUrl:$,method:"html-to-image"};return{dataUrl:null,method:"none"}}async function N5(){let J=null;try{let $={video:{frameRate:30},audio:!1,preferCurrentTab:!0,selfBrowserSurface:"include",surfaceSwitching:"exclude"};J=await navigator.mediaDevices.getDisplayMedia($);let j=await _5(J);return j?{status:"ok",dataUrl:j}:{status:"error"}}catch($){if($ instanceof DOMException&&($.name==="NotAllowedError"||$.name==="AbortError"))return{status:"cancelled"};return{status:"error"}}finally{J?.getTracks().forEach(($)=>$.stop())}}async function _5(J){let $=document.createElement("video");$.srcObject=J,$.muted=!0,$.playsInline=!0,await new Promise((Z)=>{let W=!1,Y=()=>{if(W)return;W=!0,Z()};$.onloadedmetadata=()=>{$.play().then(Y).catch(Y)},window.setTimeout(Y,1500)}),await I5($);let{videoWidth:j,videoHeight:Q}=$;if(!j||!Q)return null;let z=document.createElement("canvas");z.width=j,z.height=Q;let X=z.getContext("2d");if(!X)return null;X.drawImage($,0,0,j,Q),$.pause(),$.srcObject=null;try{return z.toDataURL("image/png")}catch{return null}}function I5(J){return new Promise(($)=>{let j=!1,Q=()=>{if(j)return;j=!0,$()},z=J;if(typeof z.requestVideoFrameCallback==="function")z.requestVideoFrameCallback(()=>Q()),window.setTimeout(Q,1000);else window.setTimeout(Q,250)})}async function C5(){let J=_().screenshotFallback;if(!J)return null;let $=await J().catch(()=>null);if(!$)return null;try{return await $(document.body,{cacheBust:!0,pixelRatio:Math.min(window.devicePixelRatio||1,2),filter:(j)=>!(j instanceof HTMLElement&&j.dataset?.debugReporter==="true")})}catch{return null}}var O5=2000,L5=0.82,R5=3000000;function S5(J){return new Promise(($,j)=>{let Q=new Image;Q.onload=()=>$(Q),Q.onerror=()=>j(Error("could not read the screenshot")),Q.src=J})}async function b1(J){try{let $=await S5(J),j=Math.max($.naturalWidth,$.naturalHeight),Q=Math.min(1,O5/j),z=document.createElement("canvas");z.width=Math.max(1,Math.round($.naturalWidth*Q)),z.height=Math.max(1,Math.round($.naturalHeight*Q));let X=z.getContext("2d");if(!X)return J;X.fillStyle="#fff",X.fillRect(0,0,z.width,z.height),X.drawImage($,0,0,z.width,z.height);let Z=L5,W=z.toDataURL("image/jpeg",Z);while(W.length>R5&&Z>0.4)Z-=0.15,W=z.toDataURL("image/jpeg",Z);return W}catch{return J}}var T5=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,A5=/^\d+$/,E5=/^[0-9a-f]{16,}$/i;function B6(J){if(J.reason.type==="manual")return null;let $=J.cause?.failedRequests?.[0];if(!$?.url)return null;let j;try{j=new URL($.url,"http://x").pathname}catch{j=$.url}let Q=j.split("/").map((X)=>T5.test(X)||A5.test(X)||E5.test(X)?":id":X).join("/"),z=$.status??($.error?"ERR":"?");return`${$.method??"REQ"} ${Q} ${z}`}var P6=2000000;function u1(J){let{screenshotDataUrl:$,replay:j,...Q}=J;return JSON.stringify(Q).length}function F6(J,$=2000000){if(u1(J)<=$)return J;let j=J.network.map((z)=>({...z})),Q={...J,network:j};for(let z of j){if(u1(Q)<=$)return Q;if(typeof z.responseSnippet==="string"&&z.responseSnippet.length>35)z.responseSnippet="[body dropped — report size budget]";if(typeof z.requestBody==="string"&&z.requestBody.length>35)z.requestBody="[body dropped — report size budget]"}while(Q.network.length>1&&u1(Q)>$)Q.network=Q.network.slice(1);while(Q.console.length>1&&u1(Q)>$)Q.console=Q.console.slice(1);return Q}function G1(J){let $="";for(let j=0;j<J.length;j+=32768)$+=String.fromCharCode(...J.subarray(j,j+32768));return btoa($)}var k5=4,x5=2,f5=3,w5=0,y5=new Set(["href","src","action","formaction","xlink:href","data","poster","srcset"]),g5=/^\s*javascript:/i;function v5(J,$){let j=J.toLowerCase();if(j.startsWith("on")||j==="srcdoc")return!0;return typeof $==="string"&&g5.test($)}function N6(J,$=!1){if(!J)return;for(let j of Object.keys(J)){let Q=J[j];if(v5(j,Q)){if($)J[j]=null;else delete J[j];continue}if(typeof Q!=="string"||!y5.has(j)||!Q.includes("?"))continue;J[j]=R0(Q)}}function E2(J){if(!J)return;N6(J.attributes);for(let $ of J.childNodes??[])E2($)}function _6(J){let $=JSON.parse(JSON.stringify(J));for(let j of $){let Q=j.data;if(!Q||typeof Q!=="object")continue;if(j.type===k5&&typeof Q.href==="string")Q.href=R0(Q.href);else if(j.type===x5)E2(Q.node);else if(j.type===f5&&Q.source===w5){for(let z of Q.adds??[])E2(z.node);for(let z of Q.attributes??[])N6(z.attributes,!0)}}return $}var h5="session-replay.json.gz",m5="session-replay.json";function b5(J){return Boolean(J&&J.events.length>0)}async function u5(J){if(typeof CompressionStream>"u")return null;try{let $=new Blob([J]).stream().pipeThrough(new CompressionStream("gzip"));return new Uint8Array(await new Response($).arrayBuffer())}catch{return null}}async function C6(J,$){if(!b5(J))return{summary:{omitted:"empty"}};let Q={seconds:Math.round(J.durationMs/1000),events:J.events.length,startedAt:J.startedAt,endedAt:J.endedAt},z=_6(J.events),X=await I6(z),Z=!1;if(X.bytes.byteLength>$&&i5(z))z=c5(z),X=await I6(z),Z=!0;let{bytes:W,compressed:Y}=X;if(W.byteLength>$)return{summary:{...Q,bytes:W.byteLength,omitted:"too-large"}};return{dataUri:`data:${Y?"application/gzip":"application/json"};base64,${G1(W)}`,filename:Y?h5:m5,summary:{...Q,events:z.length,bytes:W.byteLength,compressed:Y,...Z?{canvasDropped:Z}:{}}}}async function I6(J){let $=new TextEncoder().encode(JSON.stringify({events:J})),j=await u5($);return j?{bytes:j,compressed:!0}:{bytes:$,compressed:!1}}var p5=3,O6=2,d5=9;function L6(J){return J.type===p5&&J.data?.source===d5}function i5(J){return J.some(L6)||J.some(($)=>$.type===O6&&R6($.data.node))}function R6(J){if(!J)return!1;if(J.attributes&&"rr_dataURL"in J.attributes)return!0;return(J.childNodes??[]).some(R6)}function S6(J){if(!J)return;if(J.attributes&&"rr_dataURL"in J.attributes)delete J.attributes.rr_dataURL;for(let $ of J.childNodes??[])S6($)}function c5(J){let $=[];for(let j of J){if(L6(j))continue;if(j.type===O6)S6(j.data.node);$.push(j)}return $}var l5=new Set([502,503,504]);class P0 extends Error{kind;retryAfter;status;constructor(J,$,j,Q){super(J);this.kind=$;this.retryAfter=j;this.status=Q;this.name="ReportError"}}function r5(J){let{screenshotDataUrl:$,replay:j,...Q}=J;return{dataUri:`data:application/json;base64,${G1(new TextEncoder().encode(JSON.stringify(Q)))}`,filename:"debug-bundle.json"}}async function k2(){let J=_().identity;if(!J)return{};try{let $=await J();return $?{authorization:`Bearer ${$}`}:{}}catch{return{}}}async function T6(J,$){let j=_(),Q=F6($,P6),{context:z,note:X}=Q,Z=[];if(Q.screenshotDataUrl){let O=await b1(Q.screenshotDataUrl);Z.push({dataUri:O,filename:"screenshot.jpg"})}Z.push(r5(Q));let W,Y=z1();if(Y){let O=await C6(Q.replay,Y.maxBytes);if(W=O.summary,"dataUri"in O)Z.push({dataUri:O.dataUri,filename:O.filename})}let U=B6(Q),C={title:J,description:X.trim()||void 0,appName:B0().name,category:z.module?.label,routeUrl:z.route.href,priority:"MEDIUM",requesterEmail:z.user.email??void 0,requesterName:z.user.fullName??void 0,customFields:{unit:z.user.unit??"",appVersion:z.app.version,environment:z.app.environment,reasonType:Q.reason.type,appName:B0().name,module:z.module?.label??""},context:{...U?{signature:U}:{},capturedAt:z.capturedAt,reason:Q.reason,cause:Q.cause,actionTrail:Q.actionTrail,client:z.client,performance:z.performance,apiHeaders:z.apiHeaders,extra:z.extra,counts:{network:Q.network.length,console:Q.console.length,actions:Q.actionTrail.length},screenshotMethod:Q.screenshotMethod,...W?{replay:W}:{}},attachments:Z,...Q.reason.fromChat?{fromChat:!0}:{}},F=await fetch(`${j.host.replace(/\/$/,"")}/ingest/tickets`,{method:"POST",headers:{"content-type":"application/json","x-realm-key":j.realmKey,...await k2()},body:JSON.stringify(C)}).catch(()=>{throw new P0("report never left the browser","offline")});if(!F.ok)throw await x2(F);return await F.json()}async function x2(J){let $=J.headers.get("retry-after"),j=await J.json().then((Q)=>Q.error).catch(()=>null);if(J.status===429)return new P0("rate limited","rateLimited",$??void 0);if(l5.has(J.status))return new P0("desk unavailable","unavailable");return new P0(j??`Report failed (${J.status})`,"rejected",void 0,J.status)}var p1=null,U1=null,A6=()=>_().host.replace(/\/$/,"");function f2(){return p1}function l0(){if(U1)return U1;return U1=(async()=>{try{let J=await fetch(`${A6()}/ingest/request-types`,{headers:{"x-realm-key":_().realmKey}}),$=J.ok?await J.json():null;p1=Array.isArray($?.types)?$.types.filter(n5):[]}catch{p1=[],U1=null}return p1??[]})(),U1}function n5(J){let $=J;return!!$&&typeof $.id==="string"&&typeof $.name==="string"}async function E6(J){let $=_(),j={};try{j=$.user?.()??{}}catch{j={}}let Q=typeof window>"u"?null:window.location,z={title:J.title,description:J.description.trim()||void 0,ticketTypeId:J.ticketTypeId,appName:B0().name,category:Q?x1(Q.pathname)?.label:void 0,routeUrl:Q?.href,priority:"MEDIUM",requesterEmail:j.email??void 0,requesterName:j.fullName??void 0,attachments:J.screenshotDataUrl?[{dataUri:await b1(J.screenshotDataUrl),filename:"screenshot.jpg"}]:void 0},X=await fetch(`${A6()}/ingest/tickets`,{method:"POST",headers:{"content-type":"application/json","x-realm-key":$.realmKey,...await k2()},body:JSON.stringify(z)}).catch(()=>{throw new P0("request never left the browser","offline")});if(!X.ok)throw await x2(X);return await X.json()}var q1=Math.PI/6;function k6(J,$,j){let Q=$.x-J.x,z=$.y-J.y,X=Math.hypot(Q,z),Z=Math.atan2(z,Q),W=[{x:$.x,y:$.y},{x:$.x-j*Math.cos(Z-q1),y:$.y-j*Math.sin(Z-q1)},{x:$.x-j*Math.cos(Z+q1),y:$.y-j*Math.sin(Z+q1)}],Y=j*Math.cos(q1)*0.92;if(X<=Y)return{shaft:null,head:W};return{shaft:{from:J,to:{x:$.x-Y*Math.cos(Z),y:$.y-Y*Math.sin(Z)}},head:W}}var w2="#f44336",o5="rgba(250, 204, 21, 0.4)",y2=22,x6="#2563eb",f6=9,w6=11,y6=18,g6=4,d1=8,s5=[{id:"nw",fx:0,fy:0,cursor:"nwse-resize"},{id:"n",fx:0.5,fy:0,cursor:"ns-resize"},{id:"ne",fx:1,fy:0,cursor:"nesw-resize"},{id:"e",fx:1,fy:0.5,cursor:"ew-resize"},{id:"se",fx:1,fy:1,cursor:"nwse-resize"},{id:"s",fx:0.5,fy:1,cursor:"ns-resize"},{id:"sw",fx:0,fy:1,cursor:"nesw-resize"},{id:"w",fx:0,fy:0.5,cursor:"ew-resize"}];function v6(J,$,j){let Q=[],z=null,X=-1,Z=null,W=null,Y=J.getContext("2d");function U(){let V=J.getBoundingClientRect().width;return V>0?J.width/V:1}function C(V){let K=J.getBoundingClientRect();return{x:(V.clientX-K.left)/K.width*J.width,y:(V.clientY-K.top)/K.height*J.height}}function F(V){let K=V.size??y2;if(!Y)return(V.text?.length??0)*K*0.6;Y.save(),Y.font=`600 ${K}px system-ui, sans-serif`;let q=Y.measureText(V.text??"").width;return Y.restore(),q}function O(V){if(V.tool==="text"){let K=V.size??y2;return{left:V.x1,top:V.y1,right:V.x1+F(V),bottom:V.y1+K*1.25}}return{left:Math.min(V.x1,V.x2),top:Math.min(V.y1,V.y2),right:Math.max(V.x1,V.x2),bottom:Math.max(V.y1,V.y2)}}function A(V){if(V.tool==="arrow")return[{id:"tail",x:V.x1,y:V.y1,cursor:"move"},{id:"head",x:V.x2,y:V.y2,cursor:"move"}];let K=O(V);if(V.tool==="text")return[{id:"size",x:K.right,y:K.bottom,cursor:"nwse-resize"}];return s5.map((q)=>({id:q.id,x:K.left+(K.right-K.left)*q.fx,y:K.top+(K.bottom-K.top)*q.fy,cursor:q.cursor}))}function R(V){let K=O(V);return{x:K.right+y6*U(),y:K.top-y6*U()}}function m(V,K,q){let{shaft:G,head:H}=k6({x:K.x1,y:K.y1},{x:K.x2,y:K.y2},Math.max(10,16*q));if(G)V.lineCap="butt",V.beginPath(),V.moveTo(G.from.x,G.from.y),V.lineTo(G.to.x,G.to.y),V.stroke();V.beginPath(),V.moveTo(H[0].x,H[0].y),V.lineTo(H[1].x,H[1].y),V.lineTo(H[2].x,H[2].y),V.closePath(),V.fill()}function I(V,K,q){V.save(),V.lineWidth=Math.max(2,3*q),V.strokeStyle=w2,V.fillStyle=w2;let G=O(K);if(K.tool==="rect")V.strokeRect(G.left,G.top,G.right-G.left,G.bottom-G.top);else if(K.tool==="arrow")m(V,K,q);else if(K.tool==="highlight")V.fillStyle=o5,V.fillRect(G.left,G.top,G.right-G.left,G.bottom-G.top);else if(K.tool==="text"&&K.text){let H=K.size??y2;V.font=`600 ${H}px system-ui, sans-serif`,V.textBaseline="top";let N=H*0.22;V.fillStyle="rgba(255,255,255,0.92)",V.fillRect(G.left-N,G.top-N,G.right-G.left+N*2,G.bottom-G.top+N*2),V.fillStyle=w2,V.fillText(K.text,G.left,G.top)}V.restore()}function D(V,K,q){let G=O(K);V.save(),V.strokeStyle=x6,V.lineWidth=Math.max(1,1.5*q),V.setLineDash([6*q,4*q]),V.strokeRect(G.left,G.top,G.right-G.left,G.bottom-G.top),V.setLineDash([]);let H=f6*q;for(let s of A(K))V.fillStyle="#fff",V.strokeStyle=x6,V.lineWidth=Math.max(1,1.5*q),V.beginPath(),V.rect(s.x-H/2,s.y-H/2,H,H),V.fill(),V.stroke();let N=R(K),g=w6*q;V.beginPath(),V.arc(N.x,N.y,g,0,Math.PI*2),V.fillStyle="#dc2626",V.fill(),V.strokeStyle="#fff",V.lineWidth=Math.max(1.5,2*q),V.beginPath(),V.moveTo(N.x-g*0.4,N.y-g*0.4),V.lineTo(N.x+g*0.4,N.y+g*0.4),V.moveTo(N.x+g*0.4,N.y-g*0.4),V.lineTo(N.x-g*0.4,N.y+g*0.4),V.stroke(),V.restore()}function M(){if(!Y)return;let V=U();if(Y.clearRect(0,0,J.width,J.height),Y.drawImage($,0,0,J.width,J.height),Q.forEach((q,G)=>{if(G!==k)I(Y,q,V)}),Z)I(Y,Z,V);let K=Q[X];if(K&&!Z)D(Y,K,V)}function w(V,K,q,G,H){return Math.abs(V-q)<=H&&Math.abs(K-G)<=H}function b(V,K){let q=Q[X];if(!q)return null;let G=f6*U()/2+3*U();for(let H of A(q))if(w(V,K,H.x,H.y,G))return H.id;return null}function L(V,K){let q=Q[X];if(!q)return!1;let G=R(q);return w(V,K,G.x,G.y,w6*U())}function y(V,K){let q=6*U();for(let G=Q.length-1;G>=0;G-=1){let H=Q[G];if(H.tool==="arrow"){let g=H.x2-H.x1,s=H.y2-H.y1,q0=Math.hypot(g,s)||1,B=Math.max(0,Math.min(1,((V-H.x1)*g+(K-H.y1)*s)/(q0*q0)));if(Math.hypot(V-(H.x1+B*g),K-(H.y1+B*s))<=q+4*U())return G;continue}let N=O(H);if(V>=N.left-q&&V<=N.right+q&&K>=N.top-q&&K<=N.bottom+q)return G}return-1}function S(V,K,q,G,H){if(K==="tail"){V.x1=q.x1+G,V.y1=q.y1+H;return}if(K==="head"){V.x2=q.x2+G,V.y2=q.y2+H;return}if(K==="size"){let v=(q.size??24)+H;V.size=Math.max(10,v);return}let N=O(q),{left:g,top:s,right:q0,bottom:B}=N;if(K.includes("w"))g=Math.min(q0-d1,g+G);if(K.includes("e"))q0=Math.max(g+d1,q0+G);if(K.includes("n"))s=Math.min(B-d1,s+H);if(K.includes("s"))B=Math.max(s+d1,B+H);V.x1=g,V.y1=s,V.x2=q0,V.y2=B}function u(V,K,q,G){V.x1=K.x1+q,V.y1=K.y1+G,V.x2=K.x2+q,V.y2=K.y2+G}let P=null,k=-1,T={x:0,y:0,size:24};function p(){let V=J.getBoundingClientRect().width;return V>0?V/J.width:1}function m0(V,K){if(!Y)return V.length*K*0.6;Y.save(),Y.font=`600 ${K}px system-ui, sans-serif`;let q=Y.measureText(V||" ").width;return Y.restore(),q}function Y0(){if(!P)return;let V=J.parentElement;if(!V)return;let K=J.getBoundingClientRect(),q=V.getBoundingClientRect(),G=p(),H=T.size*G;P.style.left=`${K.left-q.left+T.x*G}px`,P.style.top=`${K.top-q.top+T.y*G}px`,P.style.fontSize=`${H}px`,P.style.width=`${Math.max(40,m0(P.value,H)+H)}px`}function t(V){let K=P;if(!K)return;P=null;let q=K.value.trim(),G=k;if(k=-1,K.remove(),V&&q){if(G>=0&&Q[G])Q[G].text=q,X=G;else Q.push({tool:"text",x1:T.x,y1:T.y,x2:T.x,y2:T.y,text:q,size:T.size}),X=Q.length-1;j()}else if(G>=0)X=G;J.focus(),M()}function n(V,K,q=-1){t(!0);let G=J.parentElement;if(!G)return;if(getComputedStyle(G).position==="static")G.style.position="relative";let H=q>=0?Q[q]:void 0;k=q,T={x:H?.x1??V,y:H?.y1??K,size:H?.size??Math.round(24*U())};let N=document.createElement("input");N.type="text",N.className="text-edit",N.value=H?.text??"",N.setAttribute("aria-label","ข้อความบนภาพ"),N.placeholder="ข้อความ",P=N,G.append(N),Y0(),N.addEventListener("input",Y0),N.addEventListener("keydown",(g)=>{if(g.stopPropagation(),g.key==="Enter")t(!0);else if(g.key==="Escape")t(!1)}),requestAnimationFrame(()=>{if(P!==N)return;N.focus(),N.select(),N.addEventListener("blur",()=>t(!0))}),M()}function G0(V){let{x:K,y:q}=C(V);if(J.setPointerCapture(V.pointerId),L(K,q)){U0();return}let G=b(K,q);if(G&&Q[X]){W={grip:G,x:K,y:q,start:{...Q[X]}};return}if(z==="text"){if(V.preventDefault(),J.hasPointerCapture(V.pointerId))J.releasePointerCapture(V.pointerId);z=null,j(),n(K,q);return}if(z){Z={tool:z,x1:K,y1:q,x2:K,y2:q},X=-1;return}let H=y(K,q);X=H,W=H>=0?{grip:"body",x:K,y:q,start:{...Q[H]}}:null,M()}function b0(V){let{x:K,y:q}=C(V);if(Z){Z.x2=K,Z.y2=q,M();return}if(W){let H=Q[X];if(!H)return;let N=K-W.x,g=q-W.y;if(W.grip==="body")u(H,W.start,N,g);else S(H,W.grip,W.start,N,g);M();return}if(z){J.style.cursor="crosshair";return}if(L(K,q)){J.style.cursor="pointer";return}let G=b(K,q);if(G){let H=Q[X]?A(Q[X]).find((N)=>N.id===G):null;J.style.cursor=H?.cursor??"pointer";return}J.style.cursor=y(K,q)>=0?"move":"default"}function f0(){if(Z){if(!(Math.abs(Z.x2-Z.x1)<g6&&Math.abs(Z.y2-Z.y1)<g6))Q.push(Z),X=Q.length-1,z=null,j();Z=null}if(W)W=null,j();M()}function C0(V){let K=J.getBoundingClientRect(),q=(V.clientX-K.left)/K.width*J.width,G=(V.clientY-K.top)/K.height*J.height,H=y(q,G),N=Q[H];if(!N||N.tool!=="text")return;V.preventDefault(),n(N.x1,N.y1,H)}function O0(V){if(X<0)return;if(V.key==="Delete"||V.key==="Backspace")V.preventDefault(),U0();else if(V.key==="Escape")V.preventDefault(),X=-1,M()}function U0(){if(X<0)return;Q.splice(X,1),X=-1,j(),M()}return J.addEventListener("pointerdown",G0),J.addEventListener("pointermove",b0),J.addEventListener("pointerup",f0),J.addEventListener("pointercancel",f0),J.addEventListener("dblclick",C0),J.tabIndex=0,J.addEventListener("keydown",O0),M(),{setTool(V){z=V,X=-1,J.style.cursor=V?"crosshair":"default",M()},deleteSelected:U0,clear(){Q.length=0,X=-1,j(),M()},hasShapes:()=>Q.length>0,hasSelection:()=>X>=0,toDataUrl(){let V=document.createElement("canvas");V.width=$.naturalWidth,V.height=$.naturalHeight;let K=V.getContext("2d");if(!K)return J.toDataURL("image/png");K.drawImage($,0,0);let q=U();for(let G of Q)I(K,G,q);return V.toDataURL("image/png")},destroy(){t(!1),J.removeEventListener("pointerdown",G0),J.removeEventListener("pointermove",b0),J.removeEventListener("pointerup",f0),J.removeEventListener("pointercancel",f0),J.removeEventListener("dblclick",C0),J.removeEventListener("keydown",O0)}}}var a5=["keydown","keyup","keypress"];function r0(J){for(let $ of a5)J.addEventListener($,(j)=>j.stopPropagation())}var h6=`
33
+ `,E2=null;function v5(){if(typeof document>"u")return null;if(E2?.isConnected)return E2;let $=document.createElement(w5);$.dataset.debugReporter="true";let J=$.attachShadow({mode:"open"}),Q=document.createElement("style");Q.textContent=g5;let j=document.createElement("div");return j.className="stack",j.setAttribute("role","status"),j.setAttribute("aria-live","polite"),J.append(Q,j),document.body.append($),E2=j,j}function r0($,J="success",Q){let j=f1()?L().toast:void 0;if(j){j({message:$,tone:J,...Q?{action:Q}:{}});return}let Z=v5();if(!Z)return;let X=document.createElement("div");X.className="toast",X.dataset.tone=J;let V=document.createElement("span");V.className="dot";let W=document.createElement("span");W.textContent=$;let K=document.createElement("button");K.type="button",K.className="close",K.textContent="✕",K.setAttribute("aria-label","ปิด");let Y=()=>{window.clearTimeout(N),X.remove()};K.addEventListener("click",Y);let N=J==="error"||Q?0:window.setTimeout(Y,y5);if(X.append(V,W),Q){let M=document.createElement("button");M.type="button",M.className="action",M.textContent=Q.label,M.addEventListener("click",()=>{Y(),Q.onClick()}),X.append(M)}X.append(K),Z.append(X)}function O6($,J,Q){let j=$.filter((X)=>Boolean(X.error)||X.status!=null&&X.status>=400).slice(-20).map((X)=>({method:X.method,url:X.url,status:X.status,error:X.error,at:X.startedAt})),Z=J.filter((X)=>X.level==="error"||X.level==="exception"||X.level==="unhandledrejection").slice(-20).map((X)=>X.message);return{failedRequests:j,errors:Z,erroredQueries:Q.slice(0,20)}}function b5(){let $={memoryUsedMb:null,memoryLimitMb:null,domContentLoadedMs:null,loadEventMs:null};if(typeof performance>"u")return $;let J=performance.memory;if(J)$.memoryUsedMb=Math.round(J.usedJSHeapSize/1024/1024),$.memoryLimitMb=Math.round(J.jsHeapSizeLimit/1024/1024);let[Q]=performance.getEntriesByType("navigation");if(Q)$.domContentLoadedMs=Math.round(Q.domContentLoadedEventEnd),$.loadEventMs=Math.round(Q.loadEventEnd);return $}function k2($,J){if(!$)return J;try{return $()}catch{return J}}function L6(){let $=L(),{pathname:J,search:Q,href:j}=window.location;return{capturedAt:new Date().toISOString(),route:{href:j,pathname:J,search:Q},module:w1(J),user:k2($.user,{}),apiHeaders:K1(k2($.headers,{})),app:{name:N0().name,version:N0().version,environment:N0().environment},client:{userAgent:navigator.userAgent,language:navigator.language,platform:navigator.platform,online:navigator.onLine,viewport:{width:window.innerWidth,height:window.innerHeight,dpr:window.devicePixelRatio},screen:{width:window.screen.width,height:window.screen.height}},performance:b5(),extra:k2($.extra,{})}}var m5=2;function u1($){let J=P6(),Q=a4();return{context:L6(),reason:$.reason,note:$.note,cause:O6(J,Q,$.erroredQueries),actionTrail:c4(),network:J,console:Q,screenshotDataUrl:$.screenshotDataUrl,screenshotMethod:$.screenshotMethod,replay:I6()??void 0,meta:{generatedBy:"lightwork-debug-capture",schemaVersion:m5}}}async function x2(){if(typeof navigator<"u"&&Boolean(navigator.mediaDevices?.getDisplayMedia)){let Q=await h5();if(Q.status==="ok")return{dataUrl:Q.dataUrl,method:"display-media"};if(Q.status==="cancelled")return{dataUrl:null,method:"cancelled"}}let J=await d5();if(J)return{dataUrl:J,method:"html-to-image"};return{dataUrl:null,method:"none"}}async function h5(){let $=null;try{let J={video:{frameRate:30},audio:!1,preferCurrentTab:!0,selfBrowserSurface:"include",surfaceSwitching:"exclude"};$=await navigator.mediaDevices.getDisplayMedia(J);let Q=await u5($);return Q?{status:"ok",dataUrl:Q}:{status:"error"}}catch(J){if(J instanceof DOMException&&(J.name==="NotAllowedError"||J.name==="AbortError"))return{status:"cancelled"};return{status:"error"}}finally{$?.getTracks().forEach((J)=>J.stop())}}async function u5($){let J=document.createElement("video");J.srcObject=$,J.muted=!0,J.playsInline=!0,await new Promise((V)=>{let W=!1,K=()=>{if(W)return;W=!0,V()};J.onloadedmetadata=()=>{J.play().then(K).catch(K)},window.setTimeout(K,1500)}),await p5(J);let{videoWidth:Q,videoHeight:j}=J;if(!Q||!j)return null;let Z=document.createElement("canvas");Z.width=Q,Z.height=j;let X=Z.getContext("2d");if(!X)return null;X.drawImage(J,0,0,Q,j),J.pause(),J.srcObject=null;try{return Z.toDataURL("image/png")}catch{return null}}function p5($){return new Promise((J)=>{let Q=!1,j=()=>{if(Q)return;Q=!0,J()},Z=$;if(typeof Z.requestVideoFrameCallback==="function")Z.requestVideoFrameCallback(()=>j()),window.setTimeout(j,1000);else window.setTimeout(j,250)})}async function d5(){let $=L().screenshotFallback;if(!$)return null;let J=await $().catch(()=>null);if(!J)return null;try{return await J(document.body,{cacheBust:!0,pixelRatio:Math.min(window.devicePixelRatio||1,2),filter:(Q)=>!(Q instanceof HTMLElement&&Q.dataset?.debugReporter==="true")})}catch{return null}}var i5=2000,c5=0.82,l5=3000000;function r5($){return new Promise((J,Q)=>{let j=new Image;j.onload=()=>J(j),j.onerror=()=>Q(Error("could not read the screenshot")),j.src=$})}async function p1($){try{let J=await r5($),Q=Math.max(J.naturalWidth,J.naturalHeight),j=Math.min(1,i5/Q),Z=document.createElement("canvas");Z.width=Math.max(1,Math.round(J.naturalWidth*j)),Z.height=Math.max(1,Math.round(J.naturalHeight*j));let X=Z.getContext("2d");if(!X)return $;X.fillStyle="#fff",X.fillRect(0,0,Z.width,Z.height),X.drawImage(J,0,0,Z.width,Z.height);let V=c5,W=Z.toDataURL("image/jpeg",V);while(W.length>l5&&V>0.4)V-=0.15,W=Z.toDataURL("image/jpeg",V);return W}catch{return $}}var o5=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,n5=/^\d+$/,s5=/^[0-9a-f]{16,}$/i;function R6($){if($.reason.type==="manual")return null;let J=$.cause?.failedRequests?.[0];if(!J?.url)return null;let Q;try{Q=new URL(J.url,"http://x").pathname}catch{Q=J.url}let j=Q.split("/").map((X)=>o5.test(X)||n5.test(X)||s5.test(X)?":id":X).join("/"),Z=J.status??(J.error?"ERR":"?");return`${J.method??"REQ"} ${j} ${Z}`}var S6=2000000;function d1($){let{screenshotDataUrl:J,replay:Q,...j}=$;return JSON.stringify(j).length}function T6($,J=2000000){if(d1($)<=J)return $;let Q=$.network.map((Z)=>({...Z})),j={...$,network:Q};for(let Z of Q){if(d1(j)<=J)return j;if(typeof Z.responseSnippet==="string"&&Z.responseSnippet.length>35)Z.responseSnippet="[body dropped — report size budget]";if(typeof Z.requestBody==="string"&&Z.requestBody.length>35)Z.requestBody="[body dropped — report size budget]"}while(j.network.length>1&&d1(j)>J)j.network=j.network.slice(1);while(j.console.length>1&&d1(j)>J)j.console=j.console.slice(1);return j}function g0($){let J="";for(let Q=0;Q<$.length;Q+=32768)J+=String.fromCharCode(...$.subarray(Q,Q+32768));return btoa(J)}var a5=4,t5=2,e5=3,$9=0,J9=new Set(["href","src","action","formaction","xlink:href","data","poster","srcset"]),Q9=/^\s*javascript:/i;function j9($,J){let Q=$.toLowerCase();if(Q.startsWith("on")||Q==="srcdoc")return!0;return typeof J==="string"&&Q9.test(J)}function A6($,J=!1){if(!$)return;for(let Q of Object.keys($)){let j=$[Q];if(j9(Q,j)){if(J)$[Q]=null;else delete $[Q];continue}if(typeof j!=="string"||!J9.has(Q)||!j.includes("?"))continue;$[Q]=S0(j)}}function f2($){if(!$)return;A6($.attributes);for(let J of $.childNodes??[])f2(J)}function E6($){let J=JSON.parse(JSON.stringify($));for(let Q of J){let j=Q.data;if(!j||typeof j!=="object")continue;if(Q.type===a5&&typeof j.href==="string")j.href=S0(j.href);else if(Q.type===t5)f2(j.node);else if(Q.type===e5&&j.source===$9){for(let Z of j.adds??[])f2(Z.node);for(let Z of j.attributes??[])A6(Z.attributes,!0)}}return J}var Z9=30000,X9=2,k6=3,V9=0,z9=9,W9=/^data:([^;,]+);base64,/;function w2($,J){if(!$)return;let Q=$.attributes,j=Q?.rr_dataURL;if(Q&&typeof j==="string"){let Z=W9.exec(j);if(Z)J.push({picture:{type:Z[1],base64:j.slice(Z[0].length)},put:(X)=>Q.rr_dataURL=`data:${X.type};base64,${X.base64}`})}for(let Z of $.childNodes??[])w2(Z,J)}function K9($,J){if(!Array.isArray($))return;for(let Q of $)for(let j of Q.args??[]){let Z=j;if(Z?.rr_type!=="ImageBitmap")continue;let X=Z.args?.[0],V=X?.rr_type==="Blob"?X.data?.[0]:void 0;if(!X||V?.rr_type!=="ArrayBuffer"||typeof V.base64!=="string"||typeof X.type!=="string")continue;J.push({picture:{type:X.type,base64:V.base64},put:(W)=>{X.type=W.type,V.base64=W.base64}})}}function y2($){let J=[];for(let Q of $){let j=Q.data;if(!j||typeof j!=="object")continue;if(Q.type===X9)w2(j.node,J);else if(Q.type===k6&&j.source===V9)for(let Z of j.adds??[])w2(Z.node,J);else if(Q.type===k6&&j.source===z9)K9(j.commands,J)}return J}function x6($){return y2($).map((J)=>J.picture.base64)}var f6=($)=>$.picture.type==="image/png"&&$.picture.base64.length>=Z9;function w6($){return y2($).some(f6)}async function y6($,J){let Q=new Map,j=0;for(let Z of y2($).filter(f6)){let X=Z.picture.base64;if(!Q.has(X)){let W=null;try{W=await J(Z.picture)}catch{W=null}Q.set(X,W&&W.base64.length<X.length?W:null)}let V=Q.get(X);if(V)Z.put(V),j+=1}return j}function Y9($){let J=atob($),Q=new Uint8Array(J.length);for(let j=0;j<J.length;j++)Q[j]=J.charCodeAt(j);return Q}function G9($,J){if(typeof OffscreenCanvas<"u")return new OffscreenCanvas($,J);if(typeof document>"u")return null;let Q=document.createElement("canvas");return Q.width=$,Q.height=J,Q}function q9($,J){if("convertToBlob"in $)return $.convertToBlob({type:"image/jpeg",quality:J});return new Promise((Q)=>$.toBlob(Q,"image/jpeg",J))}function g6($){if(typeof createImageBitmap!=="function"||typeof OffscreenCanvas>"u"&&typeof document>"u")return null;return async({base64:J,type:Q})=>{let j=await createImageBitmap(new Blob([Y9(J)],{type:Q}));try{let{width:Z,height:X}=j,V=G9(Z,X),W=V?.getContext("2d",{willReadFrequently:!0});if(!V||!W)return null;W.drawImage(j,0,0);let K=W.getImageData(0,0,Z,X).data;for(let N=3;N<K.length;N+=4)if(K[N]!==255)return null;let Y=await q9(V,$);if(!Y||Y.type!=="image/jpeg")return null;return{base64:g0(new Uint8Array(await Y.arrayBuffer())),type:"image/jpeg"}}finally{j.close()}}}var U9="session-replay.json.gz",D9="session-replay.json";function H9($){return Boolean($&&$.events.length>0)}async function u6($){if(typeof CompressionStream>"u")return null;try{let J=new Blob([$]).stream().pipeThrough(new CompressionStream("gzip"));return new Uint8Array(await new Response(J).arrayBuffer())}catch{return null}}async function U1($){let J=new TextEncoder().encode(JSON.stringify({events:$})),Q=await u6(J);return Q?{bytes:Q,compressed:!0}:{bytes:J,compressed:!1}}var v6=65536,b6=16;async function F9($){let J=x6($),Q=J.reduce((K,Y)=>K+Y.length,0);if(Q===0)return 0;let j=Math.max(1,Math.floor(J.length/b6)),Z="";for(let K=0;K<J.length&&Z.length<v6*b6;K+=j)Z+=J[K].slice(0,v6);let X=new TextEncoder().encode(Z),V=await u6(X),W=V?V.byteLength/X.byteLength:1;return Q*W*0.9}async function p6($,J,Q={}){if(!H9($))return{summary:{omitted:"empty"}};let j=Math.round($.durationMs/1000),Z=E6($.events),X=await M9(Z,J,Q);if(!("events"in X))return{summary:{seconds:j,events:$.events.length,startedAt:$.startedAt,endedAt:$.endedAt,bytes:X.bytes,omitted:"too-large"}};let{bytes:V,compressed:W}=X.encoded,K=X.events,Y=K[0].timestamp,N=K[K.length-1].timestamp,{trimmed:M,...R}=X.cuts,_=Date.parse($.endedAt);return{dataUri:`data:${W?"application/gzip":"application/json"};base64,${g0(V)}`,filename:W?U9:D9,summary:{seconds:Math.round((N-Y)/1000),events:K.length,startedAt:new Date(Y).toISOString(),endedAt:new Date(N).toISOString(),bytes:V.byteLength,compressed:W,...R,...M?{recordedSeconds:j}:{},...M==="end"&&!Number.isNaN(_)?{endsEarlySeconds:Math.round((_-N)/1000)}:{}}}}async function M9($,J,Q){let j={},Z=0,X=async(_)=>{let I=await F9(_);if(I>J)return Z||=Math.round(I),null;let A=await U1(_);return Z||=A.bytes.byteLength,A.bytes.byteLength<=J?A:null},V=await X($);if(V)return{events:$,encoded:V,cuts:j};let W=Q.lighten===void 0?g6(Q.quality??0.5):Q.lighten;if(W&&w6($)&&await y6($,W)>0){if(V=await X($),V)return{events:$,encoded:V,cuts:j}}let K=[...new Set($.filter(l6).map((_)=>_.timestamp))].sort((_,I)=>_-I);if(K.length>1){let _=1,I=K.length,A=null;while(_<I){let B=Math.floor((_+I)/2),D=_9($,K[B]),F=await X(D);if(F)A={events:D,encoded:F},I=B;else _=B+1}if(A)return{...A,cuts:{...j,canvasDropped:!0}}}if(C9($)){if(j.canvasDropped=!0,$=$.filter((_)=>!i1(_)),V=await X($),V)return{events:$,encoded:V,cuts:j}}if(L9($)){if(j.picturesDropped=!0,V=await X($),V)return{events:$,encoded:V,cuts:j}}let Y=S9($);if(Y.length>1){let _=[];for(let B of Y)_.push((await U1(B)).bytes.byteLength);let I=Y.length,A=0;while(I>0&&A+_[I-1]<=J)A+=_[--I];for(let B=Math.max(I,1);B<Y.length;B++){let D=Y.slice(B).flat();if(V=await U1(D),V.bytes.byteLength<=J)return{events:D,encoded:V,cuts:{...j,trimmed:"start"}}}}let N=Y[Y.length-1],M=await m6(N,J);if(!M&&R9(N))j.simplified=!0,M=await m6(N,J);if(!M)return{bytes:Z};let R=M.events.length<N.length?"end":Y.length>1?"start":void 0;return{...M,cuts:{...j,...R?{trimmed:R}:{}}}}async function m6($,J){let Q=$.findIndex((X)=>X.type===v2)+1||1,j=$.length,Z={events:$.slice(0,Q),encoded:await U1($.slice(0,Q))};if(Z.encoded.bytes.byteLength>J)return null;while(Q<j){let X=Math.ceil((Q+j)/2),V=$.slice(0,X),W=await U1(V);if(W.bytes.byteLength<=J)Q=X,Z={events:V,encoded:W};else j=X-1}return Z}var P9=4,v2=2,d6=3,B9=0,N9=9;function i1($){return $.type===d6&&$.data?.source===N9}function i6($,J){let Q=$.data;if(!Q||typeof Q!=="object")return;if($.type===v2)J(Q.node);else if($.type===d6&&Q.source===B9)for(let j of Q.adds??[])J(j.node)}function c6($){if(!$)return!1;let J=!1;if($.attributes&&"rr_dataURL"in $.attributes)delete $.attributes.rr_dataURL,J=!0;for(let Q of $.childNodes??[])J=c6(Q)||J;return J}function b2($){return!!$&&($.attributes!==void 0&&("rr_dataURL"in $.attributes)||($.childNodes??[]).some(b2))}function l6($){if(i1($))return!0;let J=!1;return i6($,(Q)=>J||=b2(Q)),J}function g2($){if(!$||!b2($))return $;let{rr_dataURL:J,...Q}=$.attributes??{};return{...$,...$.attributes?{attributes:Q}:{},...$.childNodes?{childNodes:$.childNodes.map((j)=>g2(j))}:{}}}function _9($,J){let Q=[];for(let j of $)if(j.timestamp>=J||!l6(j))Q.push(j);else if(i1(j))continue;else if(j.type===v2){let Z=j.data;Q.push({...j,data:{...Z,node:g2(Z.node)}})}else{let Z=j.data;Q.push({...j,data:{...Z,adds:(Z.adds??[]).map((X)=>({...X,node:g2(X.node)}))}})}return Q}function C9($){let J=!1;for(let Q of $)if(i1(Q))J=!0;else i6(Q,(j)=>J=c6(j)||J);return J}var r6=16384,I9="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",O9=new RegExp(`url\\(\\s*(['"]?)data:[^'")]{${r6},}\\1\\s*\\)`,"g");function m2($,J){if(!$||typeof $!=="object")return!1;let Q=!1,j=Array.isArray($)?$.map((Z,X)=>[X,Z]):Object.entries($);for(let[Z,X]of j)if(typeof X==="string"){let V=J(X);if(V!==X)$[Z]=V,Q=!0}else if(X&&typeof X==="object")Q=m2(X,J)||Q;return Q}function L9($){let J=!1;for(let Q of $)J=m2(Q.data,(j)=>{if(j.length<r6)return j;if(j.startsWith("data:"))return j.startsWith("data:image/")?I9:"";return j.includes("data:")?j.replace(O9,"url()"):j})||J;return J}var h6=2000;function R9($){let J=!1;for(let Q of $)J=m2(Q.data,(j)=>j.length>h6?j.slice(0,h6):j)||J;return J}function S9($){let J=[[]],Q=!1;for(let j of $){if(j.type===P9){if(Q)J.push([]);Q=!0}J[J.length-1].push(j)}return J}var T9=new Set([502,503,504]);class _0 extends Error{kind;retryAfter;status;constructor($,J,Q,j){super($);this.kind=J;this.retryAfter=Q;this.status=j;this.name="ReportError"}}function A9($){let{screenshotDataUrl:J,replay:Q,...j}=$;return{dataUri:`data:application/json;base64,${g0(new TextEncoder().encode(JSON.stringify(j)))}`,filename:"debug-bundle.json"}}async function h2(){let $=L().identity;if(!$)return{};try{let J=await $();return J?{authorization:`Bearer ${J}`}:{}}catch{return{}}}async function o6($,J){let Q=L(),j=T6(J,S6),{context:Z,note:X}=j,V=[];if(j.screenshotDataUrl){let R=await p1(j.screenshotDataUrl);V.push({dataUri:R,filename:"screenshot.jpg"})}V.push(A9(j));let W,K=V1();if(K){let R=await p6(j.replay,K.maxBytes,{quality:K.canvas?.quality});if(W=R.summary,"dataUri"in R)V.push({dataUri:R.dataUri,filename:R.filename})}let Y=R6(j),N={title:$,description:X.trim()||void 0,appName:N0().name,category:Z.module?.label,routeUrl:Z.route.href,priority:"MEDIUM",requesterEmail:Z.user.email??void 0,requesterName:Z.user.fullName??void 0,customFields:{unit:Z.user.unit??"",appVersion:Z.app.version,environment:Z.app.environment,reasonType:j.reason.type,appName:N0().name,module:Z.module?.label??""},context:{...Y?{signature:Y}:{},capturedAt:Z.capturedAt,reason:j.reason,cause:j.cause,actionTrail:j.actionTrail,client:Z.client,performance:Z.performance,apiHeaders:Z.apiHeaders,extra:Z.extra,counts:{network:j.network.length,console:j.console.length,actions:j.actionTrail.length},screenshotMethod:j.screenshotMethod,...W?{replay:W}:{}},attachments:V,...j.reason.fromChat?{fromChat:!0}:{}},M=await fetch(`${Q.host.replace(/\/$/,"")}/ingest/tickets`,{method:"POST",headers:{"content-type":"application/json","x-realm-key":Q.realmKey,...await h2()},body:JSON.stringify(N)}).catch(()=>{throw new _0("report never left the browser","offline")});if(!M.ok)throw await u2(M);return await M.json()}async function u2($){let J=$.headers.get("retry-after"),Q=await $.json().then((j)=>j.error).catch(()=>null);if($.status===429)return new _0("rate limited","rateLimited",J??void 0);if(T9.has($.status))return new _0("desk unavailable","unavailable");return new _0(Q??`Report failed (${$.status})`,"rejected",void 0,$.status)}var c1=null,D1=null,n6=()=>L().host.replace(/\/$/,"");function p2(){return c1}function o0(){if(D1)return D1;return D1=(async()=>{try{let $=await fetch(`${n6()}/ingest/request-types`,{headers:{"x-realm-key":L().realmKey}}),J=$.ok?await $.json():null;c1=Array.isArray(J?.types)?J.types.filter(E9):[]}catch{c1=[],D1=null}return c1??[]})(),D1}function E9($){let J=$;return!!J&&typeof J.id==="string"&&typeof J.name==="string"}async function s6($){let J=L(),Q={};try{Q=J.user?.()??{}}catch{Q={}}let j=typeof window>"u"?null:window.location,Z={title:$.title,description:$.description.trim()||void 0,ticketTypeId:$.ticketTypeId,appName:N0().name,category:j?w1(j.pathname)?.label:void 0,routeUrl:j?.href,priority:"MEDIUM",requesterEmail:Q.email??void 0,requesterName:Q.fullName??void 0,attachments:$.screenshotDataUrl?[{dataUri:await p1($.screenshotDataUrl),filename:"screenshot.jpg"}]:void 0},X=await fetch(`${n6()}/ingest/tickets`,{method:"POST",headers:{"content-type":"application/json","x-realm-key":J.realmKey,...await h2()},body:JSON.stringify(Z)}).catch(()=>{throw new _0("request never left the browser","offline")});if(!X.ok)throw await u2(X);return await X.json()}var H1=Math.PI/6;function a6($,J,Q){let j=J.x-$.x,Z=J.y-$.y,X=Math.hypot(j,Z),V=Math.atan2(Z,j),W=[{x:J.x,y:J.y},{x:J.x-Q*Math.cos(V-H1),y:J.y-Q*Math.sin(V-H1)},{x:J.x-Q*Math.cos(V+H1),y:J.y-Q*Math.sin(V+H1)}],K=Q*Math.cos(H1)*0.92;if(X<=K)return{shaft:null,head:W};return{shaft:{from:$,to:{x:J.x-K*Math.cos(V),y:J.y-K*Math.sin(V)}},head:W}}var d2="#f44336",k9="rgba(250, 204, 21, 0.4)",i2=22,t6="#2563eb",e6=9,$8=11,J8=18,Q8=4,l1=8,x9=[{id:"nw",fx:0,fy:0,cursor:"nwse-resize"},{id:"n",fx:0.5,fy:0,cursor:"ns-resize"},{id:"ne",fx:1,fy:0,cursor:"nesw-resize"},{id:"e",fx:1,fy:0.5,cursor:"ew-resize"},{id:"se",fx:1,fy:1,cursor:"nwse-resize"},{id:"s",fx:0.5,fy:1,cursor:"ns-resize"},{id:"sw",fx:0,fy:1,cursor:"nesw-resize"},{id:"w",fx:0,fy:0.5,cursor:"ew-resize"}];function j8($,J,Q){let j=[],Z=null,X=-1,V=null,W=null,K=$.getContext("2d");function Y(){let z=$.getBoundingClientRect().width;return z>0?$.width/z:1}function N(z){let G=$.getBoundingClientRect();return{x:(z.clientX-G.left)/G.width*$.width,y:(z.clientY-G.top)/G.height*$.height}}function M(z){let G=z.size??i2;if(!K)return(z.text?.length??0)*G*0.6;K.save(),K.font=`600 ${G}px system-ui, sans-serif`;let U=K.measureText(z.text??"").width;return K.restore(),U}function R(z){if(z.tool==="text"){let G=z.size??i2;return{left:z.x1,top:z.y1,right:z.x1+M(z),bottom:z.y1+G*1.25}}return{left:Math.min(z.x1,z.x2),top:Math.min(z.y1,z.y2),right:Math.max(z.x1,z.x2),bottom:Math.max(z.y1,z.y2)}}function _(z){if(z.tool==="arrow")return[{id:"tail",x:z.x1,y:z.y1,cursor:"move"},{id:"head",x:z.x2,y:z.y2,cursor:"move"}];let G=R(z);if(z.tool==="text")return[{id:"size",x:G.right,y:G.bottom,cursor:"nwse-resize"}];return x9.map((U)=>({id:U.id,x:G.left+(G.right-G.left)*U.fx,y:G.top+(G.bottom-G.top)*U.fy,cursor:U.cursor}))}function I(z){let G=R(z);return{x:G.right+J8*Y(),y:G.top-J8*Y()}}function A(z,G,U){let{shaft:q,head:H}=a6({x:G.x1,y:G.y1},{x:G.x2,y:G.y2},Math.max(10,16*U));if(q)z.lineCap="butt",z.beginPath(),z.moveTo(q.from.x,q.from.y),z.lineTo(q.to.x,q.to.y),z.stroke();z.beginPath(),z.moveTo(H[0].x,H[0].y),z.lineTo(H[1].x,H[1].y),z.lineTo(H[2].x,H[2].y),z.closePath(),z.fill()}function B(z,G,U){z.save(),z.lineWidth=Math.max(2,3*U),z.strokeStyle=d2,z.fillStyle=d2;let q=R(G);if(G.tool==="rect")z.strokeRect(q.left,q.top,q.right-q.left,q.bottom-q.top);else if(G.tool==="arrow")A(z,G,U);else if(G.tool==="highlight")z.fillStyle=k9,z.fillRect(q.left,q.top,q.right-q.left,q.bottom-q.top);else if(G.tool==="text"&&G.text){let H=G.size??i2;z.font=`600 ${H}px system-ui, sans-serif`,z.textBaseline="top";let O=H*0.22;z.fillStyle="rgba(255,255,255,0.92)",z.fillRect(q.left-O,q.top-O,q.right-q.left+O*2,q.bottom-q.top+O*2),z.fillStyle=d2,z.fillText(G.text,q.left,q.top)}z.restore()}function D(z,G,U){let q=R(G);z.save(),z.strokeStyle=t6,z.lineWidth=Math.max(1,1.5*U),z.setLineDash([6*U,4*U]),z.strokeRect(q.left,q.top,q.right-q.left,q.bottom-q.top),z.setLineDash([]);let H=e6*U;for(let s of _(G))z.fillStyle="#fff",z.strokeStyle=t6,z.lineWidth=Math.max(1,1.5*U),z.beginPath(),z.rect(s.x-H/2,s.y-H/2,H,H),z.fill(),z.stroke();let O=I(G),v=$8*U;z.beginPath(),z.arc(O.x,O.y,v,0,Math.PI*2),z.fillStyle="#dc2626",z.fill(),z.strokeStyle="#fff",z.lineWidth=Math.max(1.5,2*U),z.beginPath(),z.moveTo(O.x-v*0.4,O.y-v*0.4),z.lineTo(O.x+v*0.4,O.y+v*0.4),z.moveTo(O.x+v*0.4,O.y-v*0.4),z.lineTo(O.x-v*0.4,O.y+v*0.4),z.stroke(),z.restore()}function F(){if(!K)return;let z=Y();if(K.clearRect(0,0,$.width,$.height),K.drawImage(J,0,0,$.width,$.height),j.forEach((U,q)=>{if(q!==x)B(K,U,z)}),V)B(K,V,z);let G=j[X];if(G&&!V)D(K,G,z)}function y(z,G,U,q,H){return Math.abs(z-U)<=H&&Math.abs(G-q)<=H}function h(z,G){let U=j[X];if(!U)return null;let q=e6*Y()/2+3*Y();for(let H of _(U))if(y(z,G,H.x,H.y,q))return H.id;return null}function S(z,G){let U=j[X];if(!U)return!1;let q=I(U);return y(z,G,q.x,q.y,$8*Y())}function g(z,G){let U=6*Y();for(let q=j.length-1;q>=0;q-=1){let H=j[q];if(H.tool==="arrow"){let v=H.x2-H.x1,s=H.y2-H.y1,D0=Math.hypot(v,s)||1,P=Math.max(0,Math.min(1,((z-H.x1)*v+(G-H.y1)*s)/(D0*D0)));if(Math.hypot(z-(H.x1+P*v),G-(H.y1+P*s))<=U+4*Y())return q;continue}let O=R(H);if(z>=O.left-U&&z<=O.right+U&&G>=O.top-U&&G<=O.bottom+U)return q}return-1}function T(z,G,U,q,H){if(G==="tail"){z.x1=U.x1+q,z.y1=U.y1+H;return}if(G==="head"){z.x2=U.x2+q,z.y2=U.y2+H;return}if(G==="size"){let b=(U.size??24)+H;z.size=Math.max(10,b);return}let O=R(U),{left:v,top:s,right:D0,bottom:P}=O;if(G.includes("w"))v=Math.min(D0-l1,v+q);if(G.includes("e"))D0=Math.max(v+l1,D0+q);if(G.includes("n"))s=Math.min(P-l1,s+H);if(G.includes("s"))P=Math.max(s+l1,P+H);z.x1=v,z.y1=s,z.x2=D0,z.y2=P}function u(z,G,U,q){z.x1=G.x1+U,z.y1=G.y1+q,z.x2=G.x2+U,z.y2=G.y2+q}let C=null,x=-1,E={x:0,y:0,size:24};function p(){let z=$.getBoundingClientRect().width;return z>0?z/$.width:1}function u0(z,G){if(!K)return z.length*G*0.6;K.save(),K.font=`600 ${G}px system-ui, sans-serif`;let U=K.measureText(z||" ").width;return K.restore(),U}function G0(){if(!C)return;let z=$.parentElement;if(!z)return;let G=$.getBoundingClientRect(),U=z.getBoundingClientRect(),q=p(),H=E.size*q;C.style.left=`${G.left-U.left+E.x*q}px`,C.style.top=`${G.top-U.top+E.y*q}px`,C.style.fontSize=`${H}px`,C.style.width=`${Math.max(40,u0(C.value,H)+H)}px`}function e(z){let G=C;if(!G)return;C=null;let U=G.value.trim(),q=x;if(x=-1,G.remove(),z&&U){if(q>=0&&j[q])j[q].text=U,X=q;else j.push({tool:"text",x1:E.x,y1:E.y,x2:E.x,y2:E.y,text:U,size:E.size}),X=j.length-1;Q()}else if(q>=0)X=q;$.focus(),F()}function r(z,G,U=-1){e(!0);let q=$.parentElement;if(!q)return;if(getComputedStyle(q).position==="static")q.style.position="relative";let H=U>=0?j[U]:void 0;x=U,E={x:H?.x1??z,y:H?.y1??G,size:H?.size??Math.round(24*Y())};let O=document.createElement("input");O.type="text",O.className="text-edit",O.value=H?.text??"",O.setAttribute("aria-label","ข้อความบนภาพ"),O.placeholder="ข้อความ",C=O,q.append(O),G0(),O.addEventListener("input",G0),O.addEventListener("keydown",(v)=>{if(v.stopPropagation(),v.key==="Enter")e(!0);else if(v.key==="Escape")e(!1)}),requestAnimationFrame(()=>{if(C!==O)return;O.focus(),O.select(),O.addEventListener("blur",()=>e(!0))}),F()}function q0(z){let{x:G,y:U}=N(z);if($.setPointerCapture(z.pointerId),S(G,U)){U0();return}let q=h(G,U);if(q&&j[X]){W={grip:q,x:G,y:U,start:{...j[X]}};return}if(Z==="text"){if(z.preventDefault(),$.hasPointerCapture(z.pointerId))$.releasePointerCapture(z.pointerId);Z=null,Q(),r(G,U);return}if(Z){V={tool:Z,x1:G,y1:U,x2:G,y2:U},X=-1;return}let H=g(G,U);X=H,W=H>=0?{grip:"body",x:G,y:U,start:{...j[H]}}:null,F()}function p0(z){let{x:G,y:U}=N(z);if(V){V.x2=G,V.y2=U,F();return}if(W){let H=j[X];if(!H)return;let O=G-W.x,v=U-W.y;if(W.grip==="body")u(H,W.start,O,v);else T(H,W.grip,W.start,O,v);F();return}if(Z){$.style.cursor="crosshair";return}if(S(G,U)){$.style.cursor="pointer";return}let q=h(G,U);if(q){let H=j[X]?_(j[X]).find((O)=>O.id===q):null;$.style.cursor=H?.cursor??"pointer";return}$.style.cursor=g(G,U)>=0?"move":"default"}function w0(){if(V){if(!(Math.abs(V.x2-V.x1)<Q8&&Math.abs(V.y2-V.y1)<Q8))j.push(V),X=j.length-1,Z=null,Q();V=null}if(W)W=null,Q();F()}function O0(z){let G=$.getBoundingClientRect(),U=(z.clientX-G.left)/G.width*$.width,q=(z.clientY-G.top)/G.height*$.height,H=g(U,q),O=j[H];if(!O||O.tool!=="text")return;z.preventDefault(),r(O.x1,O.y1,H)}function L0(z){if(X<0)return;if(z.key==="Delete"||z.key==="Backspace")z.preventDefault(),U0();else if(z.key==="Escape")z.preventDefault(),X=-1,F()}function U0(){if(X<0)return;j.splice(X,1),X=-1,Q(),F()}return $.addEventListener("pointerdown",q0),$.addEventListener("pointermove",p0),$.addEventListener("pointerup",w0),$.addEventListener("pointercancel",w0),$.addEventListener("dblclick",O0),$.tabIndex=0,$.addEventListener("keydown",L0),F(),{setTool(z){Z=z,X=-1,$.style.cursor=z?"crosshair":"default",F()},deleteSelected:U0,clear(){j.length=0,X=-1,Q(),F()},hasShapes:()=>j.length>0,hasSelection:()=>X>=0,toDataUrl(){let z=document.createElement("canvas");z.width=J.naturalWidth,z.height=J.naturalHeight;let G=z.getContext("2d");if(!G)return $.toDataURL("image/png");G.drawImage(J,0,0);let U=Y();for(let q of j)B(G,q,U);return z.toDataURL("image/png")},destroy(){e(!1),$.removeEventListener("pointerdown",q0),$.removeEventListener("pointermove",p0),$.removeEventListener("pointerup",w0),$.removeEventListener("pointercancel",w0),$.removeEventListener("dblclick",O0),$.removeEventListener("keydown",L0)}}}var f9=["keydown","keyup","keypress"];function n0($){for(let J of f9)$.addEventListener(J,(Q)=>Q.stopPropagation())}var Z8=`
34
34
  :host { all: initial; }
35
35
  * { box-sizing: border-box; }
36
36
 
@@ -181,7 +181,7 @@ button.link:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
181
181
  .shot-choice input { width: 16px; height: 16px; margin: 0; accent-color: #2563eb; }
182
182
  .dropped { opacity: 0.35; pointer-events: none; }
183
183
  .draft { margin: -8px 0 0; padding: 8px 12px; border-radius: 10px; background: #eff6ff; font-size: 13px; color: #1e3a8a; }
184
- `;var D1="lw-debug-reporter",S0=null;function t5(J,$){if(J instanceof P0){if(J.kind==="offline")return $.failedOffline;if(J.kind==="unavailable")return $.failedUnavailable;if(J.kind==="rateLimited")return $.failedTooMany.replace("{seconds}",J.retryAfter??"60");return J.message||$.failed}return $.failed}var e5=()=>[];var J9=[{tool:"rect",key:"toolRect"},{tool:"arrow",key:"toolArrow"},{tool:"highlight",key:"toolHighlight"},{tool:"text",key:"toolText"}];function $9(){return class extends HTMLElement{root;stop=null;annotator=null;bundle=null;busy=!1;keep=null;returnFocus=null;constructor(){super();this.root=this.attachShadow({mode:"open"}),r0(this.root),this.root.addEventListener("keydown",($)=>{let j=$;if(j.key!=="Escape"||j.defaultPrevented||!this.root.querySelector("[role=dialog]"))return;j.preventDefault(),this.close()})}connectedCallback(){this.dataset.debugReporter="true",this.stop=r4(($)=>void this.open($))}disconnectedCallback(){this.stop?.(),this.stop=null,this.close()}async open($){if(this.busy)return;this.busy=!0;let j=document.activeElement;this.returnFocus=j instanceof HTMLElement&&j!==document.body?j:null;let Q=e(_().locale),z=f2();if(z===null)l0();if($.type==="manual"&&z?.length){this.renderChooser(Q,$);return}await this.report($,Q)}renderChooser($,j){let Q=this.shell($);Q.classList.add("narrow"),Q.setAttribute("aria-label",$.chooseTitle);let z=x("div","head"),X=V0("✕","icon");X.setAttribute("aria-label",$.close),X.addEventListener("click",()=>this.close()),z.append(x("h2","",$.chooseTitle),X);let Z=p6("problem",Q9,$.kindProblem,$.chooseProblemHint);Z.dataset.choose="problem",Z.addEventListener("click",()=>{this.root.replaceChildren(),this.report(j,$)});let W=p6("request",b6,$.kindRequest,$.chooseRequestHint);W.dataset.choose="request",W.addEventListener("click",()=>{this.bundle=m1({reason:j,note:"",screenshotDataUrl:null,screenshotMethod:"none",erroredQueries:g2()}),this.renderForm($,j,"request")});let Y=x("div","kinds choose");Y.append(Z,W),Y.addEventListener("keydown",(U)=>{if(!m6.includes(U.key))return;U.preventDefault(),(this.root.activeElement===Z?W:Z).focus()}),Q.append(z,Y),Z.focus()}async switchToReport($,j,Q){this.root.replaceChildren();let z=await A2();if(z.method==="cancelled"){this.renderForm($,j,"request",{...Q,asking:!0});return}this.bundle=m1({reason:j,note:"",screenshotDataUrl:z.dataUrl,screenshotMethod:z.method,erroredQueries:g2()}),this.renderForm($,j,"problem",Q)}async report($,j){let Q=await A2();if(Q.method==="cancelled"){this.close();return}this.bundle=m1({reason:$,note:"",screenshotDataUrl:Q.dataUrl,screenshotMethod:Q.method,erroredQueries:g2()}),this.renderForm(j,$,"problem")}close($=!1){if($)S0=null;else if(this.keep)S0=this.keep()??S0;this.keep=null,this.annotator?.destroy(),this.annotator=null,this.bundle=null,this.busy=!1,this.root.replaceChildren();let j=this.returnFocus;if(this.returnFocus=null,j?.isConnected)j.focus()}shell($){let j=document.createElement("style");j.textContent=h6;let Q=document.createElement("div");Q.className="backdrop";let z=document.createElement("div");return z.className="panel",z.setAttribute("role","dialog"),z.setAttribute("aria-modal","true"),z.setAttribute("aria-label",$.title),Q.append(z),this.root.replaceChildren(j,Q),z}renderShell($,j){let Q=this.shell($),z=x("div","head");z.append(x("h2","",$.title)),Q.append(z,x("p","status",j))}renderForm($,j,Q,z){let X=this.bundle;if(!X)return;let Z=this.shell($),W=Q,Y=Q==="problem"||!!X.screenshotDataUrl,U=null,C=x("div","head"),F=x("h2","",$.title),O=V0("✕","icon");O.setAttribute("aria-label",$.close),O.addEventListener("click",()=>this.close()),C.append(F,O);let A=x("p","door");A.hidden=!0;let R=x("span"),m=V0("","link");m.dataset.switchKind="",m.addEventListener("click",()=>K(W==="problem"?"request":"problem")),A.append(R,m);let I=x("div","ask");I.hidden=!0;let D=document.createElement("input");D.type="search",D.className="type-search",D.placeholder=$.requestTypeSearch,D.setAttribute("aria-label",$.requestTypeSearch),D.dataset.requestTypeSearch="",D.hidden=!0;let M=x("div","types");M.setAttribute("role","radiogroup"),M.setAttribute("aria-label",$.requestTypeLabel);let w=x("p","status",$.requestTypeNone);w.hidden=!0;let b=x("p","status type-count","");b.hidden=!0,I.append(i1($.requestTypeLabel,"",!0),D,M,w,b);let L=[],y=()=>{for(let v of L){let E=v.dataset.requestType===U?.id;v.setAttribute("aria-checked",String(E)),v.tabIndex=E?0:-1}let B=L.find((v)=>v.dataset.requestType===U?.id);if(B&&M.scrollHeight>M.clientHeight){let v=B.offsetTop-M.offsetTop;if(v<M.scrollTop)M.scrollTop=v;else if(v+B.offsetHeight>M.scrollTop+M.clientHeight)M.scrollTop=v+B.offsetHeight-M.clientHeight}},S=document.createElement("input");S.type="text";let u=i1(""),P=document.createElement("textarea"),k=i1(""),T=x("div","meta"),{context:p}=X,m0=`${X.network.length} network · ${X.console.length} console · ${X.actionTrail.length} actions${X.replay?` · ${$.replay} ${Math.round(X.replay.durationMs/1000)}s`:""}`,Y0=(B,v)=>{let E=document.createElement("div"),h=document.createElement("b");h.textContent=`${B}: `;let c=document.createTextNode(v);return E.append(h,c),T.append(E),{b:h,v:c}};Y0($.reporter,`${p.user.fullName??"—"} (${p.user.email??"—"})`),Y0($.page,p.route.href);let t=Y0($.captured,m0),n=document.createElement("label");n.className="shot-choice",n.hidden=!0;let G0=document.createElement("input");G0.type="checkbox",G0.checked=!0,G0.dataset.requestShot="",n.append(G0,document.createTextNode(` ${$.requestWithShot}`));let b0=X.screenshotDataUrl?this.screenshotSection($,X.screenshotDataUrl):[x("p","status",$.noScreenshot)],f0=X.screenshotDataUrl?b0[0]:null;if(!X.screenshotDataUrl)n.replaceChildren();let C0=x("p","status",""),O0=V0($.submit,"primary"),U0=()=>{O0.disabled=S.value.trim().length===0||W==="request"&&!U};S.addEventListener("input",U0);let V=()=>{let B=W==="request";if(F.textContent=B?$.requestTitle:$.title,Z.setAttribute("aria-label",B?$.requestTitle:$.title),R.textContent=`${B?$.problemInstead:$.askInstead} `,m.textContent=B?Y?$.problemInsteadAction:$.problemInsteadShare:$.askInsteadAction,I.hidden=!B,c1(u,B?$.requestSummaryLabel:$.summaryLabel,B?"":$.summaryRequired,!0),S.placeholder=B?$.requestSummaryPlaceholder:$.summaryPlaceholder,c1(k,B?$.requestDetailLabel:$.detailLabel),P.placeholder=B?$.requestDetailPlaceholder:$.detailPlaceholder,t.b.textContent=`${B?$.requestLeaves:$.captured}: `,t.v.textContent=B?$.requestLeavesWhat:m0,n.hidden=!B||!X.screenshotDataUrl,f0)c1(f0,B?$.requestAnnotateHint:$.annotateHint);for(let v of b0)v.classList.toggle("dropped",B&&!G0.checked),v.hidden=B&&!X.screenshotDataUrl;O0.textContent=B?$.requestSubmit:$.submit,U0()};G0.addEventListener("change",V);let K=(B)=>{if(B===W)return;if(B==="problem"&&!Y){this.switchToReport($,j,{title:S.value,detail:P.value,asking:!1,typeId:U?.id??null});return}W=B,V()},q=(B)=>{if(this.bundle!==X||j.type!=="manual"||!B.length)return;U=B[0],L.length=0;for(let E of B){let h=V0("","type");h.setAttribute("role","radio"),h.dataset.requestType=E.id;let c=x("span","type-body");if(c.append(x("b","",E.name)),E.description)c.append(x("span","type-hint",E.description));if(E.targetHours){let u0=x("span","type-due");u0.append(l1(z9),document.createTextNode($.requestTarget.replace("{time}",j9($,E.targetHours)))),c.append(u0)}h.append(l1(b6),c),h.addEventListener("click",()=>{U=E,y(),U0()}),L.push(h)}M.replaceChildren(...L),M.onkeydown=(E)=>{if(!m6.includes(E.key)||!U)return;E.preventDefault();let h=B.filter((w0,$3)=>!L[$3].hidden);if(!h.length)return;let c=h.findIndex((w0)=>w0.id===U.id),u0=E.key==="ArrowUp"||E.key==="ArrowLeft"?-1:1;U=h[c<0?0:(c+u0+h.length)%h.length],y(),L.find((w0)=>w0.dataset.requestType===U.id)?.focus()},M.classList.toggle("long",B.length>=v2),D.hidden=B.length<v2;let v=(E)=>{b.hidden=B.length<v2||E===0,b.textContent=$.requestTypeCount.replace("{n}",String(E))};v(B.length),D.oninput=()=>{let E=D.value.trim().toLowerCase(),h=null;if(B.forEach((c,u0)=>{let w0=!E||`${c.name} ${c.description}`.toLowerCase().includes(E);if(L[u0].hidden=!w0,w0&&!h)h=c}),w.hidden=!!h,v(L.filter((c)=>!c.hidden).length),h&&U&&L[B.indexOf(U)].hidden)U=h;y(),U0()},D.onkeydown=(E)=>{if(E.key==="ArrowDown"||E.key==="Enter")E.preventDefault(),L.find((h)=>h.dataset.requestType===U?.id&&!h.hidden)?.focus()},y(),A.hidden=!1,V()},G=z??(S0&&(S0.title||S0.detail)?S0:null),H=x("p","draft");if(H.hidden=!G||!!z,G){S.value=G.title,P.value=G.detail;let B=V0($.draftClear,"link");B.dataset.draftClear="",B.addEventListener("click",()=>{S.value="",P.value="",S0=null,H.hidden=!0,U0(),S.focus()}),H.append(document.createTextNode(`${$.draftRestored} · `),B)}let N=f2(),g=(B)=>{if(q(B),W!=="request"||A.hidden||!G?.typeId)return;let v=B.find((E)=>E.id===G.typeId);if(v)U=v,y()};if(N)g(N);else if(j.type==="manual")l0().then(g);this.keep=()=>({title:S.value,detail:P.value,asking:W==="request",typeId:U?.id??null}),Z.append(C,A,H,I,u,S,k,P,T,n,...b0);let s=x("div","foot"),q0=V0($.close);q0.addEventListener("click",()=>this.close()),s.append(q0,C0,x("span","grow"),O0),Z.append(s),V(),O0.addEventListener("click",async()=>{O0.disabled=!0,C0.dataset.tone="",C0.textContent=$.submitting;let B=()=>this.annotator?.hasShapes()?this.annotator.toDataUrl():X.screenshotDataUrl;try{if(W==="request"&&U){let h=await E6({ticketTypeId:U.id,title:S.value.trim(),description:P.value,screenshotDataUrl:G0.checked?B():null}),c=this.dispatchEvent(new CustomEvent("lw-request-submitted",{detail:h,bubbles:!0,composed:!0,cancelable:!0}));if(this.close(!0),c)c0(`${$.requestSubmitted} — #${h.number}`,"success");return}let v=await T6(S.value.trim(),{...X,note:P.value,screenshotDataUrl:B()}),E=this.dispatchEvent(new CustomEvent("lw-report-submitted",{detail:v,bubbles:!0,composed:!0,cancelable:!0}));if(this.close(!0),E)c0(`${$.submitted} — #${v.number}`,"success")}catch(v){let E=t5(v,$);C0.dataset.tone="error",C0.textContent=E,c0(E,"error"),U0()}}),S.focus()}screenshotSection($,j){let Q=i1($.annotateHint),z=x("div","tools"),X=document.createElement("canvas"),Z=x("div","shot");Z.append(X);let W=[],Y=(O)=>{for(let A of W)A.setAttribute("aria-pressed",String(A===O))};for(let{tool:O,key:A}of J9){let R=V0($[A]);R.setAttribute("aria-pressed","false"),R.addEventListener("click",()=>{let m=R.getAttribute("aria-pressed")==="true";Y(m?null:R),this.annotator?.setTool(m?null:O)}),W.push(R),z.append(R)}z.append(x("span","sep"));let U=V0($.deleteSelected);U.addEventListener("click",()=>this.annotator?.deleteSelected());let C=V0($.clearAll);C.addEventListener("click",()=>{this.annotator?.clear(),Y(null)}),z.append(U,C);let F=new Image;return F.onload=()=>{X.width=F.naturalWidth,X.height=F.naturalHeight,this.annotator=v6(X,F,()=>{Y(null),U.disabled=!this.annotator?.hasSelection()})},F.src=j,[Q,z,x("p","status",$.annotateHelp),Z]}}}function g2(){try{return e5()}catch{return[]}}function x(J,$="",j=""){let Q=document.createElement(J);if($)Q.className=$;if(j)Q.textContent=j;return Q}function j9(J,$){return $>=24&&$%24===0?J.days.replace("{n}",String($/24)):J.hours.replace("{n}",String($))}var m6=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"],v2=7,Q9=[["path",{d:"M12 20v-9"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z"}],["path",{d:"M14.12 3.88 16 2"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97"}],["path",{d:"M22 13h-4"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97"}],["path",{d:"M6 13H2"}],["path",{d:"m8 2 1.88 1.88"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13"}]],b6=[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2"}]],z9=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M12 6v6l4 2"}]],X9=[["path",{d:"M20 6 9 17l-5-5"}]],u6="http://www.w3.org/2000/svg";function p6(J,$,j,Q){let z=V0("","kind");z.dataset.kind=J;let X=x("span","kind-top");return X.append(l1($),x("b","",j)),z.append(X,x("span","kind-hint",Q),l1(X9,"tick")),z}function l1(J,$="icon"){let j=document.createElementNS(u6,"svg");for(let[Q,z]of Object.entries({viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",class:$}))j.setAttribute(Q,z);for(let[Q,z]of J){let X=document.createElementNS(u6,Q);for(let[Z,W]of Object.entries(z))X.setAttribute(Z,W);j.append(X)}return j}function V0(J,$=""){let j=document.createElement("button");if(j.type="button",j.textContent=J,$)j.className=$;return j}function i1(J,$="",j=!1){return c1(document.createElement("label"),J,$,j)}function c1(J,$,j="",Q=!1){if(J.replaceChildren(document.createTextNode($)),Q){let z=document.createElement("span");z.className="req",z.textContent=" *",J.append(z)}if(j){let z=document.createElement("span");z.className="hint",z.textContent=` ${j}`,J.append(z)}return J}function d6(){if(typeof window>"u"||customElements.get(D1))return;customElements.define(D1,$9())}var Z9="lw-portal-handoff",i6=138.23,V9=`
184
+ `;var F1="lw-debug-reporter",T0=null;function w9($,J){if($ instanceof _0){if($.kind==="offline")return J.failedOffline;if($.kind==="unavailable")return J.failedUnavailable;if($.kind==="rateLimited")return J.failedTooMany.replace("{seconds}",$.retryAfter??"60");return $.message||J.failed}return J.failed}var y9=()=>[];var g9=[{tool:"rect",key:"toolRect"},{tool:"arrow",key:"toolArrow"},{tool:"highlight",key:"toolHighlight"},{tool:"text",key:"toolText"}];function v9(){return class extends HTMLElement{root;stop=null;annotator=null;bundle=null;busy=!1;keep=null;returnFocus=null;constructor(){super();this.root=this.attachShadow({mode:"open"}),n0(this.root),this.root.addEventListener("keydown",(J)=>{let Q=J;if(Q.key!=="Escape"||Q.defaultPrevented||!this.root.querySelector("[role=dialog]"))return;Q.preventDefault(),this.close()})}connectedCallback(){this.dataset.debugReporter="true",this.stop=Q6((J)=>void this.open(J))}disconnectedCallback(){this.stop?.(),this.stop=null,this.close()}async open(J){if(this.busy)return;this.busy=!0;let Q=document.activeElement;this.returnFocus=Q instanceof HTMLElement&&Q!==document.body?Q:null;let j=$0(L().locale),Z=p2();if(Z===null)o0();if(J.type==="manual"&&Z?.length){this.renderChooser(j,J);return}await this.report(J,j)}renderChooser(J,Q){let j=this.shell(J);j.classList.add("narrow"),j.setAttribute("aria-label",J.chooseTitle);let Z=f("div","head"),X=W0("✕","icon");X.setAttribute("aria-label",J.close),X.addEventListener("click",()=>this.close()),Z.append(f("h2","",J.chooseTitle),X);let V=W8("problem",m9,J.kindProblem,J.chooseProblemHint);V.dataset.choose="problem",V.addEventListener("click",()=>{this.root.replaceChildren(),this.report(Q,J)});let W=W8("request",V8,J.kindRequest,J.chooseRequestHint);W.dataset.choose="request",W.addEventListener("click",()=>{this.bundle=u1({reason:Q,note:"",screenshotDataUrl:null,screenshotMethod:"none",erroredQueries:c2()}),this.renderForm(J,Q,"request")});let K=f("div","kinds choose");K.append(V,W),K.addEventListener("keydown",(Y)=>{if(!X8.includes(Y.key))return;Y.preventDefault(),(this.root.activeElement===V?W:V).focus()}),j.append(Z,K),V.focus()}async switchToReport(J,Q,j){this.root.replaceChildren();let Z=await x2();if(Z.method==="cancelled"){this.renderForm(J,Q,"request",{...j,asking:!0});return}this.bundle=u1({reason:Q,note:"",screenshotDataUrl:Z.dataUrl,screenshotMethod:Z.method,erroredQueries:c2()}),this.renderForm(J,Q,"problem",j)}async report(J,Q){let j=await x2();if(j.method==="cancelled"){this.close();return}this.bundle=u1({reason:J,note:"",screenshotDataUrl:j.dataUrl,screenshotMethod:j.method,erroredQueries:c2()}),this.renderForm(Q,J,"problem")}close(J=!1){if(J)T0=null;else if(this.keep)T0=this.keep()??T0;this.keep=null,this.annotator?.destroy(),this.annotator=null,this.bundle=null,this.busy=!1,this.root.replaceChildren();let Q=this.returnFocus;if(this.returnFocus=null,Q?.isConnected)Q.focus()}shell(J){let Q=document.createElement("style");Q.textContent=Z8;let j=document.createElement("div");j.className="backdrop";let Z=document.createElement("div");return Z.className="panel",Z.setAttribute("role","dialog"),Z.setAttribute("aria-modal","true"),Z.setAttribute("aria-label",J.title),j.append(Z),this.root.replaceChildren(Q,j),Z}renderShell(J,Q){let j=this.shell(J),Z=f("div","head");Z.append(f("h2","",J.title)),j.append(Z,f("p","status",Q))}renderForm(J,Q,j,Z){let X=this.bundle;if(!X)return;let V=this.shell(J),W=j,K=j==="problem"||!!X.screenshotDataUrl,Y=null,N=f("div","head"),M=f("h2","",J.title),R=W0("✕","icon");R.setAttribute("aria-label",J.close),R.addEventListener("click",()=>this.close()),N.append(M,R);let _=f("p","door");_.hidden=!0;let I=f("span"),A=W0("","link");A.dataset.switchKind="",A.addEventListener("click",()=>G(W==="problem"?"request":"problem")),_.append(I,A);let B=f("div","ask");B.hidden=!0;let D=document.createElement("input");D.type="search",D.className="type-search",D.placeholder=J.requestTypeSearch,D.setAttribute("aria-label",J.requestTypeSearch),D.dataset.requestTypeSearch="",D.hidden=!0;let F=f("div","types");F.setAttribute("role","radiogroup"),F.setAttribute("aria-label",J.requestTypeLabel);let y=f("p","status",J.requestTypeNone);y.hidden=!0;let h=f("p","status type-count","");h.hidden=!0,B.append(r1(J.requestTypeLabel,"",!0),D,F,y,h);let S=[],g=()=>{for(let b of S){let k=b.dataset.requestType===Y?.id;b.setAttribute("aria-checked",String(k)),b.tabIndex=k?0:-1}let P=S.find((b)=>b.dataset.requestType===Y?.id);if(P&&F.scrollHeight>F.clientHeight){let b=P.offsetTop-F.offsetTop;if(b<F.scrollTop)F.scrollTop=b;else if(b+P.offsetHeight>F.scrollTop+F.clientHeight)F.scrollTop=b+P.offsetHeight-F.clientHeight}},T=document.createElement("input");T.type="text";let u=r1(""),C=document.createElement("textarea"),x=r1(""),E=f("div","meta"),{context:p}=X,u0=`${X.network.length} network · ${X.console.length} console · ${X.actionTrail.length} actions${X.replay?` · ${J.replay} ${Math.round(X.replay.durationMs/1000)}s`:""}`,G0=(P,b)=>{let k=document.createElement("div"),m=document.createElement("b");m.textContent=`${P}: `;let c=document.createTextNode(b);return k.append(m,c),E.append(k),{b:m,v:c}};G0(J.reporter,`${p.user.fullName??"—"} (${p.user.email??"—"})`),G0(J.page,p.route.href);let e=G0(J.captured,u0),r=document.createElement("label");r.className="shot-choice",r.hidden=!0;let q0=document.createElement("input");q0.type="checkbox",q0.checked=!0,q0.dataset.requestShot="",r.append(q0,document.createTextNode(` ${J.requestWithShot}`));let p0=X.screenshotDataUrl?this.screenshotSection(J,X.screenshotDataUrl):[f("p","status",J.noScreenshot)],w0=X.screenshotDataUrl?p0[0]:null;if(!X.screenshotDataUrl)r.replaceChildren();let O0=f("p","status",""),L0=W0(J.submit,"primary"),U0=()=>{L0.disabled=T.value.trim().length===0||W==="request"&&!Y};T.addEventListener("input",U0);let z=()=>{let P=W==="request";if(M.textContent=P?J.requestTitle:J.title,V.setAttribute("aria-label",P?J.requestTitle:J.title),I.textContent=`${P?J.problemInstead:J.askInstead} `,A.textContent=P?K?J.problemInsteadAction:J.problemInsteadShare:J.askInsteadAction,B.hidden=!P,o1(u,P?J.requestSummaryLabel:J.summaryLabel,P?"":J.summaryRequired,!0),T.placeholder=P?J.requestSummaryPlaceholder:J.summaryPlaceholder,o1(x,P?J.requestDetailLabel:J.detailLabel),C.placeholder=P?J.requestDetailPlaceholder:J.detailPlaceholder,e.b.textContent=`${P?J.requestLeaves:J.captured}: `,e.v.textContent=P?J.requestLeavesWhat:u0,r.hidden=!P||!X.screenshotDataUrl,w0)o1(w0,P?J.requestAnnotateHint:J.annotateHint);for(let b of p0)b.classList.toggle("dropped",P&&!q0.checked),b.hidden=P&&!X.screenshotDataUrl;L0.textContent=P?J.requestSubmit:J.submit,U0()};q0.addEventListener("change",z);let G=(P)=>{if(P===W)return;if(P==="problem"&&!K){this.switchToReport(J,Q,{title:T.value,detail:C.value,asking:!1,typeId:Y?.id??null});return}W=P,z()},U=(P)=>{if(this.bundle!==X||Q.type!=="manual"||!P.length)return;Y=P[0],S.length=0;for(let k of P){let m=W0("","type");m.setAttribute("role","radio"),m.dataset.requestType=k.id;let c=f("span","type-body");if(c.append(f("b","",k.name)),k.description)c.append(f("span","type-hint",k.description));if(k.targetHours){let d0=f("span","type-due");d0.append(n1(h9),document.createTextNode(J.requestTarget.replace("{time}",b9(J,k.targetHours)))),c.append(d0)}m.append(n1(V8),c),m.addEventListener("click",()=>{Y=k,g(),U0()}),S.push(m)}F.replaceChildren(...S),F.onkeydown=(k)=>{if(!X8.includes(k.key)||!Y)return;k.preventDefault();let m=P.filter((y0,_3)=>!S[_3].hidden);if(!m.length)return;let c=m.findIndex((y0)=>y0.id===Y.id),d0=k.key==="ArrowUp"||k.key==="ArrowLeft"?-1:1;Y=m[c<0?0:(c+d0+m.length)%m.length],g(),S.find((y0)=>y0.dataset.requestType===Y.id)?.focus()},F.classList.toggle("long",P.length>=l2),D.hidden=P.length<l2;let b=(k)=>{h.hidden=P.length<l2||k===0,h.textContent=J.requestTypeCount.replace("{n}",String(k))};b(P.length),D.oninput=()=>{let k=D.value.trim().toLowerCase(),m=null;if(P.forEach((c,d0)=>{let y0=!k||`${c.name} ${c.description}`.toLowerCase().includes(k);if(S[d0].hidden=!y0,y0&&!m)m=c}),y.hidden=!!m,b(S.filter((c)=>!c.hidden).length),m&&Y&&S[P.indexOf(Y)].hidden)Y=m;g(),U0()},D.onkeydown=(k)=>{if(k.key==="ArrowDown"||k.key==="Enter")k.preventDefault(),S.find((m)=>m.dataset.requestType===Y?.id&&!m.hidden)?.focus()},g(),_.hidden=!1,z()},q=Z??(T0&&(T0.title||T0.detail)?T0:null),H=f("p","draft");if(H.hidden=!q||!!Z,q){T.value=q.title,C.value=q.detail;let P=W0(J.draftClear,"link");P.dataset.draftClear="",P.addEventListener("click",()=>{T.value="",C.value="",T0=null,H.hidden=!0,U0(),T.focus()}),H.append(document.createTextNode(`${J.draftRestored} · `),P)}let O=p2(),v=(P)=>{if(U(P),W!=="request"||_.hidden||!q?.typeId)return;let b=P.find((k)=>k.id===q.typeId);if(b)Y=b,g()};if(O)v(O);else if(Q.type==="manual")o0().then(v);this.keep=()=>({title:T.value,detail:C.value,asking:W==="request",typeId:Y?.id??null}),V.append(N,_,H,B,u,T,x,C,E,r,...p0);let s=f("div","foot"),D0=W0(J.close);D0.addEventListener("click",()=>this.close()),s.append(D0,O0,f("span","grow"),L0),V.append(s),z(),L0.addEventListener("click",async()=>{L0.disabled=!0,O0.dataset.tone="",O0.textContent=J.submitting;let P=()=>this.annotator?.hasShapes()?this.annotator.toDataUrl():X.screenshotDataUrl;try{if(W==="request"&&Y){let m=await s6({ticketTypeId:Y.id,title:T.value.trim(),description:C.value,screenshotDataUrl:q0.checked?P():null}),c=this.dispatchEvent(new CustomEvent("lw-request-submitted",{detail:m,bubbles:!0,composed:!0,cancelable:!0}));if(this.close(!0),c)r0(`${J.requestSubmitted} — #${m.number}`,"success");return}let b=await o6(T.value.trim(),{...X,note:C.value,screenshotDataUrl:P()}),k=this.dispatchEvent(new CustomEvent("lw-report-submitted",{detail:b,bubbles:!0,composed:!0,cancelable:!0}));if(this.close(!0),k)r0(`${J.submitted} — #${b.number}`,"success")}catch(b){let k=w9(b,J);O0.dataset.tone="error",O0.textContent=k,r0(k,"error"),U0()}}),T.focus()}screenshotSection(J,Q){let j=r1(J.annotateHint),Z=f("div","tools"),X=document.createElement("canvas"),V=f("div","shot");V.append(X);let W=[],K=(R)=>{for(let _ of W)_.setAttribute("aria-pressed",String(_===R))};for(let{tool:R,key:_}of g9){let I=W0(J[_]);I.setAttribute("aria-pressed","false"),I.addEventListener("click",()=>{let A=I.getAttribute("aria-pressed")==="true";K(A?null:I),this.annotator?.setTool(A?null:R)}),W.push(I),Z.append(I)}Z.append(f("span","sep"));let Y=W0(J.deleteSelected);Y.addEventListener("click",()=>this.annotator?.deleteSelected());let N=W0(J.clearAll);N.addEventListener("click",()=>{this.annotator?.clear(),K(null)}),Z.append(Y,N);let M=new Image;return M.onload=()=>{X.width=M.naturalWidth,X.height=M.naturalHeight,this.annotator=j8(X,M,()=>{K(null),Y.disabled=!this.annotator?.hasSelection()})},M.src=Q,[j,Z,f("p","status",J.annotateHelp),V]}}}function c2(){try{return y9()}catch{return[]}}function f($,J="",Q=""){let j=document.createElement($);if(J)j.className=J;if(Q)j.textContent=Q;return j}function b9($,J){return J>=24&&J%24===0?$.days.replace("{n}",String(J/24)):$.hours.replace("{n}",String(J))}var X8=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"],l2=7,m9=[["path",{d:"M12 20v-9"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z"}],["path",{d:"M14.12 3.88 16 2"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97"}],["path",{d:"M22 13h-4"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97"}],["path",{d:"M6 13H2"}],["path",{d:"m8 2 1.88 1.88"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13"}]],V8=[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2"}]],h9=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M12 6v6l4 2"}]],u9=[["path",{d:"M20 6 9 17l-5-5"}]],z8="http://www.w3.org/2000/svg";function W8($,J,Q,j){let Z=W0("","kind");Z.dataset.kind=$;let X=f("span","kind-top");return X.append(n1(J),f("b","",Q)),Z.append(X,f("span","kind-hint",j),n1(u9,"tick")),Z}function n1($,J="icon"){let Q=document.createElementNS(z8,"svg");for(let[j,Z]of Object.entries({viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",class:J}))Q.setAttribute(j,Z);for(let[j,Z]of $){let X=document.createElementNS(z8,j);for(let[V,W]of Object.entries(Z))X.setAttribute(V,W);Q.append(X)}return Q}function W0($,J=""){let Q=document.createElement("button");if(Q.type="button",Q.textContent=$,J)Q.className=J;return Q}function r1($,J="",Q=!1){return o1(document.createElement("label"),$,J,Q)}function o1($,J,Q="",j=!1){if($.replaceChildren(document.createTextNode(J)),j){let Z=document.createElement("span");Z.className="req",Z.textContent=" *",$.append(Z)}if(Q){let Z=document.createElement("span");Z.className="hint",Z.textContent=` ${Q}`,$.append(Z)}return $}function K8(){if(typeof window>"u"||customElements.get(F1))return;customElements.define(F1,v9())}var p9="lw-portal-handoff",Y8=138.23,d9=`
185
185
  :host { all: initial; }
186
186
  .backdrop {
187
187
  position: fixed; inset: 0; z-index: 2147483002;
@@ -211,10 +211,10 @@ button.link:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
211
211
  .ring .track { stroke: #e2e8f0; }
212
212
  .ring .bar {
213
213
  stroke: #0ea5e9; transform: rotate(-90deg); transform-origin: 50% 50%;
214
- stroke-dasharray: ${i6}; stroke-dashoffset: 0;
214
+ stroke-dasharray: ${Y8}; stroke-dashoffset: 0;
215
215
  animation: deplete var(--secs, 3s) linear forwards;
216
216
  }
217
- @keyframes deplete { to { stroke-dashoffset: ${i6}; } }
217
+ @keyframes deplete { to { stroke-dashoffset: ${Y8}; } }
218
218
  .count {
219
219
  position: absolute; inset: 0; display: grid; place-items: center;
220
220
  font-size: 18px; font-weight: 600; color: #0f172a;
@@ -258,7 +258,7 @@ p { margin: 0; font-size: 13px; line-height: 1.6; color: #475569; }
258
258
  .ring .bar { animation: none; stroke-dashoffset: 0; }
259
259
  .spinner { animation-duration: 2s; }
260
260
  }
261
- `;function c6(J){if(typeof document>"u")return J.prepare().then((D)=>void J.go(D),()=>{return});let $=e(_().locale),j=Math.max(1,Math.floor(J.seconds??3)),Q=document.createElement(Z9),z=Q.attachShadow({mode:"open"});r0(z);let X=document.createElement("style");X.textContent=V9,z.append(X);let Z=document.createElement("div");Z.className="backdrop",Z.innerHTML=`
261
+ `;function G8($){if(typeof document>"u")return $.prepare().then((D)=>void $.go(D),()=>{return});let J=$0(L().locale),Q=Math.max(1,Math.floor($.seconds??3)),j=document.createElement(p9),Z=j.attachShadow({mode:"open"});n0(Z);let X=document.createElement("style");X.textContent=d9,Z.append(X);let V=document.createElement("div");V.className="backdrop",V.innerHTML=`
262
262
  <div class="card" role="dialog" aria-modal="true" aria-labelledby="lw-ho-title">
263
263
  <div class="dial">
264
264
  <svg class="ring" viewBox="0 0 52 52" aria-hidden="true">
@@ -274,14 +274,14 @@ p { margin: 0; font-size: 13px; line-height: 1.6; color: #475569; }
274
274
  <button type="button" class="cancel"></button>
275
275
  <button type="button" class="go"></button>
276
276
  </div>
277
- </div>`,z.append(Z);let W=(D)=>Z.querySelector(D),Y=W(".card"),U=W(".bar"),C=W(".count"),F=W("h2"),O=W(".body"),A=W(".host"),R=W(".go"),m=W(".cancel");F.textContent=$.handoffTitle,O.textContent=$.handoffBody;try{A.textContent=new URL(_().host).host}catch{A.textContent=""}R.textContent=$.handoffGo,m.textContent=$.cancel,Y.style.setProperty("--secs",`${j}s`),C.textContent=String(j),document.body.append(Q),requestAnimationFrame(()=>Z.setAttribute("data-open","1"));let I=document.activeElement;return R.focus({preventScroll:!0}),new Promise((D)=>{let M=!1,w=null,b=!1,L=Date.now()+j*1000,y=window.setInterval(()=>{let T=Math.ceil((L-Date.now())/1000);if(C.textContent=String(Math.max(0,T)),Date.now()>=L)P()},100);function S(T){if(M)return;if(M=!0,window.clearInterval(y),document.removeEventListener("keydown",k,!0),Z.removeAttribute("data-open"),window.setTimeout(()=>Q.remove(),200),!T)I?.focus?.({preventScroll:!0});D()}function u(T){window.clearInterval(y),U.classList.remove("spinner"),U.style.animation="none",C.textContent="",F.textContent=$.handoffBlocked,O.textContent=$.handoffBody;let p=document.createElement("a");p.className="go",p.href=T,p.target="_blank",p.rel="noopener noreferrer",p.textContent=$.handoffOpen,p.addEventListener("click",()=>S(!0)),R.replaceWith(p),p.focus({preventScroll:!0})}function P(){if(M||b)return;if(w)return J.go(w)?S(!0):u(w);window.clearInterval(y),C.textContent="",U.classList.add("spinner"),F.textContent=$.handoffPreparing}function k(T){if(T.key==="Escape")T.stopPropagation(),S(!1)}document.addEventListener("keydown",k,!0),R.addEventListener("click",P),m.addEventListener("click",()=>S(!1)),Z.addEventListener("click",(T)=>{if(T.target===Z)S(!1)}),J.prepare().then((T)=>{if(w=T,!M&&Date.now()>=L)P()},()=>{b=!0,window.clearInterval(y),Y.classList.add("error"),U.classList.remove("spinner"),U.style.animation="none",C.textContent="",F.textContent=$.handoffFailed,O.textContent=$.handoffBody,R.remove(),m.textContent=$.close})})}var W9="/sso";function K9(J,$,j,Q){let z=new URL(W9,J.endsWith("/")?J:`${J}/`);if(z.searchParams.set("realm",$),z.searchParams.set("token",j),Q)z.searchParams.set("return",Q);return z.toString()}class h2 extends Error{constructor(J="No identity provider is configured, or nobody is signed in"){super(J);this.name="NoIdentityError"}}async function m2(J){let $=_();if(!$.identity)throw new h2;let j=await $.identity();if(!j)throw new h2;return K9($.host,$.realmKey,j,J)}var r6=m2;function l6(J,$){if($==="_self")return window.location.assign(J),!0;let j=window.open(J,"_blank");if(!j)return!1;try{j.opener=null}catch{}return!0}async function n6(J={}){if(J.announce===!1){l6(await m2(J.returnTo),J.target);return}await c6({seconds:J.seconds,prepare:()=>m2(J.returnTo),go:($)=>l6($,J.target)})}var r1='"Inter Variable", "Noto Sans Thai Variable", "IBM Plex Sans Thai", -apple-system, "Segoe UI", Roboto, "Noto Sans Thai", sans-serif';function Y9(J){let $=(J??"").trim();return!$||/^(?:"?Times New Roman"?|"?Times"?|serif)$/i.test($)?"":$}function n1(J){if(!J||typeof document>"u"||!document.body)return;let $="";try{$=Y9(getComputedStyle(document.body).fontFamily)}catch{}if($)J.style.setProperty("--lw-host-font",$);else J.style.removeProperty("--lw-host-font")}var G9="lw-call-ring",U9=`
277
+ </div>`,Z.append(V);let W=(D)=>V.querySelector(D),K=W(".card"),Y=W(".bar"),N=W(".count"),M=W("h2"),R=W(".body"),_=W(".host"),I=W(".go"),A=W(".cancel");M.textContent=J.handoffTitle,R.textContent=J.handoffBody;try{_.textContent=new URL(L().host).host}catch{_.textContent=""}I.textContent=J.handoffGo,A.textContent=J.cancel,K.style.setProperty("--secs",`${Q}s`),N.textContent=String(Q),document.body.append(j),requestAnimationFrame(()=>V.setAttribute("data-open","1"));let B=document.activeElement;return I.focus({preventScroll:!0}),new Promise((D)=>{let F=!1,y=null,h=!1,S=Date.now()+Q*1000,g=window.setInterval(()=>{let E=Math.ceil((S-Date.now())/1000);if(N.textContent=String(Math.max(0,E)),Date.now()>=S)C()},100);function T(E){if(F)return;if(F=!0,window.clearInterval(g),document.removeEventListener("keydown",x,!0),V.removeAttribute("data-open"),window.setTimeout(()=>j.remove(),200),!E)B?.focus?.({preventScroll:!0});D()}function u(E){window.clearInterval(g),Y.classList.remove("spinner"),Y.style.animation="none",N.textContent="",M.textContent=J.handoffBlocked,R.textContent=J.handoffBody;let p=document.createElement("a");p.className="go",p.href=E,p.target="_blank",p.rel="noopener noreferrer",p.textContent=J.handoffOpen,p.addEventListener("click",()=>T(!0)),I.replaceWith(p),p.focus({preventScroll:!0})}function C(){if(F||h)return;if(y)return $.go(y)?T(!0):u(y);window.clearInterval(g),N.textContent="",Y.classList.add("spinner"),M.textContent=J.handoffPreparing}function x(E){if(E.key==="Escape")E.stopPropagation(),T(!1)}document.addEventListener("keydown",x,!0),I.addEventListener("click",C),A.addEventListener("click",()=>T(!1)),V.addEventListener("click",(E)=>{if(E.target===V)T(!1)}),$.prepare().then((E)=>{if(y=E,!F&&Date.now()>=S)C()},()=>{h=!0,window.clearInterval(g),K.classList.add("error"),Y.classList.remove("spinner"),Y.style.animation="none",N.textContent="",M.textContent=J.handoffFailed,R.textContent=J.handoffBody,I.remove(),A.textContent=J.close})})}var i9="/sso";function c9($,J,Q,j){let Z=new URL(i9,$.endsWith("/")?$:`${$}/`);if(Z.searchParams.set("realm",J),Z.searchParams.set("token",Q),j)Z.searchParams.set("return",j);return Z.toString()}class r2 extends Error{constructor($="No identity provider is configured, or nobody is signed in"){super($);this.name="NoIdentityError"}}async function o2($){let J=L();if(!J.identity)throw new r2;let Q=await J.identity();if(!Q)throw new r2;return c9(J.host,J.realmKey,Q,$)}var U8=o2;function q8($,J){if(J==="_self")return window.location.assign($),!0;let Q=window.open($,"_blank");if(!Q)return!1;try{Q.opener=null}catch{}return!0}async function D8($={}){if($.announce===!1){q8(await o2($.returnTo),$.target);return}await G8({seconds:$.seconds,prepare:()=>o2($.returnTo),go:(J)=>q8(J,$.target)})}var s1='"Inter Variable", "Noto Sans Thai Variable", "IBM Plex Sans Thai", -apple-system, "Segoe UI", Roboto, "Noto Sans Thai", sans-serif';function l9($){let J=($??"").trim();return!J||/^(?:"?Times New Roman"?|"?Times"?|serif)$/i.test(J)?"":J}function a1($){if(!$||typeof document>"u"||!document.body)return;let J="";try{J=l9(getComputedStyle(document.body).fontFamily)}catch{}if(J)$.style.setProperty("--lw-host-font",J);else $.style.removeProperty("--lw-host-font")}var r9="lw-call-ring",o9=`
278
278
  :host { all: initial; }
279
279
  .card {
280
280
  position: fixed; right: 16px; bottom: calc(16px + var(--lw-chat-lift, 0px)); z-index: 2147483002;
281
281
  width: min(352px, calc(100vw - 32px)); box-sizing: border-box;
282
282
  padding: 16px; border-radius: 16px; background: #fff; color: #1a1a1e;
283
283
  border: 1px solid #e8e8ec; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
284
- font-family: var(--lw-host-font, ${r1});
284
+ font-family: var(--lw-host-font, ${s1});
285
285
  animation: in 200ms cubic-bezier(0.16, 1, 0.3, 1);
286
286
  }
287
287
  @media (max-width: 639px) { .card { right: 8px; left: 8px; bottom: calc(8px + var(--lw-chat-lift, 0px)); width: auto; } }
@@ -325,22 +325,23 @@ h2 { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.5; color: #1a1
325
325
  @keyframes ping { 75%, 100% { transform: scale(2); opacity: 0; } }
326
326
  @keyframes spin { to { transform: rotate(360deg); } }
327
327
  @media (prefers-reduced-motion: reduce) { .card { animation: none; } .icon::after { animation: none; opacity: 0; } .spin { animation: none; } }
328
- `,s1=(J)=>`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${J}</svg>`,o6=s1('<path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72c.13.96.36 1.9.7 2.81a2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45c.91.34 1.85.57 2.81.7A2 2 0 0 1 22 16.92z"/>'),q9=s1('<path d="M10.68 13.31a16 16 0 0 0 3.41 2.6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7 2 2 0 0 1 1.72 2v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.42 19.42 0 0 1-3.33-2.67m-2.67-3.34a19.79 19.79 0 0 1-3.07-8.63A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91"/><line x1="22" x2="2" y1="2" y2="22"/>'),D9=s1('<path d="M20 7h-9"/><path d="M14 17H5"/><circle cx="17" cy="17" r="3"/><circle cx="7" cy="7" r="3"/>'),H9=s1('<path d="M21 12a9 9 0 1 1-6.219-8.56"/>').replace("<svg ",'<svg class="spin" '),l=null,F0=null,n0=null;function M9(J,$,j){if($.chatId)return j??$.ticketTitle;return J.replace("{key}",$.ticketKey).replace("{title}",$.ticketTitle)}var o0=()=>e(_().locale);function B9(){if(typeof document>"u")return null;if(l?.isConnected)return l.shadowRoot;l=document.createElement(G9),l.dataset.debugReporter="true",n1(l);let J=l.attachShadow({mode:"open"});return r0(J),document.body.append(l),J}function o1(J,$,j,Q){let z=document.createElement("button");return z.type="button",z.className=J,z.innerHTML=$,z.dataset.lwRing=j,z.onclick=Q,z}var H1=(J)=>{let $=document.createElement("span");return $.textContent=J,$.outerHTML};function a6(J,$,j,Q,z){let X=o0();J.innerHTML="";let Z=document.createElement("style");Z.textContent=U9;let W=document.createElement("div");W.className="card",W.setAttribute("role","alertdialog"),W.setAttribute("aria-label",X.ringTitle),W.dataset.lwCallRing=$.id,W.dataset.lwRingMode=Q;let Y=document.createElement("div");Y.className="head";let U=document.createElement("span");U.className="icon",U.innerHTML=o6;let C=document.createElement("div");C.className="words";let F=document.createElement("h2");F.textContent=X.ringTitle;let O=document.createElement("p");O.className="about",O.textContent=M9(X.ringAbout,$,X.ringChat),O.title=O.textContent,C.append(F,O),Y.append(U,C);let A=document.createElement("p");A.className="how",A.textContent=z??(Q==="frame"?X.ringHint:X.ringHow);let R=document.createElement("div");R.className="actions";let m=o1("decline",q9+H1(X.ringDecline),"decline",()=>j.decline());if(W.append(Y,A),Q==="frame"&&j.answer){if(j.voice)W.append(o1("test",D9+H1(X.ringTest),"test",()=>j.voice?.()));let I=o1("answer",o6+H1(X.ringAnswer),"answer",()=>j.answer?.());R.append(m,I)}else R.append(m,o1("open",H1(X.ringOpen),"open",()=>j.open()));W.append(R),J.append(Z,W)}function a1(J,$,j="portal"){if(F0===J.id&&l?.isConnected)return;let Q=B9();if(!Q)return;if(F0=J.id,a6(Q,J,$,j),P9(),n0===null)n0=document.title,document.title=`${o0().ringTab} — ${n0}`}function t6(J){let $=l?.shadowRoot;if(!$||F0!==J)return;let j=$.querySelector(".answer");if(j)j.innerHTML=H9+H1(o0().ringAnswering),j.disabled=!0;let Q=$.querySelector(".decline");if(Q)Q.disabled=!0}function e6(J,$){let j=l?.isConnected?l.shadowRoot:null;if(!j||F0!==J.id)return a1(J,$,"portal");l.style.display="",a6(j,J,$,"portal",o0().ringFallback)}function t1(J){let $=l?.shadowRoot;if(!$)return;u2(),j8();let j=o0(),Q=$.querySelector(".how"),z=$.querySelector(".actions");if(Q)if(Q.textContent="",J){let X=document.createElement("a");X.href=J,X.target="_blank",X.rel="noopener",X.textContent=j.ringBlocked,X.dataset.lwRing="link",X.onclick=()=>window.setTimeout(()=>t1(),0),Q.append(X)}else Q.textContent=j.ringOpened;if(z){z.innerHTML="";let X=document.createElement("button");X.type="button",X.className="close",X.textContent=j.ringClose,X.dataset.lwRing="close",X.onclick=()=>s0(),z.append(X)}}function J8(J,$=!0){if(!l?.isConnected||F0!==J)return;let j=l;if(clearTimeout(s6),!$){j.style.display="",j.style.opacity="";return}j.style.transition="opacity 150ms ease-out",j.style.opacity="0",s6=setTimeout(()=>{if(j.style.opacity==="0")j.style.display="none"},160)}var s6;function s0(J){if(J&&F0&&J!==F0)return;u2(),j8(),l?.remove(),l=null,F0=null}function $8(){return l?.isConnected?F0:null}function j8(){if(n0===null||typeof document>"u")return;if(document.title.startsWith(o0().ringTab))document.title=n0;n0=null}var T0=null,b2;function P9(){u2();let J=window,$=J.AudioContext??J.webkitAudioContext;if(!$)return;try{let Q=T0??new $;T0=Q,Q.resume?.().catch(()=>{return})}catch{return}let j=()=>{if(!T0||T0.state!=="running")return;let Q=T0.currentTime;for(let[z,X]of[660,880].entries()){let Z=T0.createOscillator(),W=T0.createGain();Z.frequency.value=X,W.gain.setValueAtTime(0.0001,Q+z*0.22),W.gain.exponentialRampToValueAtTime(0.08,Q+z*0.22+0.02),W.gain.exponentialRampToValueAtTime(0.0001,Q+z*0.22+0.2),Z.connect(W).connect(T0.destination),Z.start(Q+z*0.22),Z.stop(Q+z*0.22+0.21)}};j(),b2=setInterval(j,2200)}function u2(){clearInterval(b2),b2=void 0}var F9=/^[A-Za-z0-9_-]{1,32}$/,N9=/^#[0-9a-fA-F]{6}$/,_9=["pen","rect","laser"],Q8=(J)=>J<0?0:J>1?1:J;function z8(J,$){if(!Array.isArray(J)||J.length<$||J.length>64)return null;let j=[];for(let Q of J){if(!Array.isArray(Q)||Q.length!==2)return null;let[z,X]=Q;if(typeof z!=="number"||typeof X!=="number"||!Number.isFinite(z)||!Number.isFinite(X))return null;j.push([Q8(z),Q8(X)])}return j}function e1(J){if(!J||typeof J!=="object")return null;let $=J;if($.op==="clear")return{op:"clear"};if(typeof $.id!=="string"||!F9.test($.id))return null;if($.op==="end")return{op:"end",id:$.id};if($.op==="add"){let j=z8($.pts,1);return j?{op:"add",id:$.id,pts:j}:null}if($.op==="begin"){if(!_9.includes($.kind)||typeof $.color!=="string"||!N9.test($.color))return null;let j=z8($.pts,1);return j?{op:"begin",id:$.id,kind:$.kind,color:$.color,pts:j}:null}return null}function p2(J,$){if(J.endedAt!==null)return J.endedAt;return $-J.lastAt>20000?J.lastAt:null}function X8(J,$,j){if($===null)return 1;let Q=j-$;if(J==="laser")return Q>=900?0:1-Q/900;if(Q<=3500)return 1;return Math.max(0,1-(Q-3500)/700)}class d2{marks=new Map;apply(J,$=Date.now()){if(J.op==="clear"){this.marks.clear();return}if(J.op==="begin"){while(this.marks.size>=120)this.marks.delete(this.marks.keys().next().value);this.marks.delete(J.id),this.marks.set(J.id,{kind:J.kind,color:J.color,pts:J.pts.map(([Q,z])=>({x:Q,y:z,t:$})),endedAt:null,lastAt:$});return}let j=this.marks.get(J.id);if(!j||p2(j,$)!==null)return;if(J.op==="end"){j.endedAt=$;return}if(j.lastAt=$,j.kind==="rect"){let[Q,z]=J.pts[J.pts.length-1];j.pts=[j.pts[0],{x:Q,y:z,t:$}];return}for(let[Q,z]of J.pts)j.pts.push({x:Q,y:z,t:$});if(j.pts.length>4000)j.pts.splice(0,j.pts.length-4000)}alive(J=Date.now()){for(let[$,j]of this.marks)if(X8(j.kind,p2(j,J),J)<=0)this.marks.delete($);return this.marks.size>0}get size(){return this.marks.size}draw(J,$,j,Q=Date.now()){J.clearRect(0,0,$,j);let z=Math.max(1,Math.min($,j));for(let X of this.marks.values()){let Z=X8(X.kind,p2(X,Q),Q);if(Z<=0||!X.pts.length)continue;if(J.save(),J.lineCap="round",J.lineJoin="round",X.kind==="pen")C9(J,X,$,j,Math.max(3,z*0.0045),Z);else if(X.kind==="rect")O9(J,X,$,j,Math.max(2.5,z*0.003),Z);else L9(J,X,$,j,Math.max(6,z*0.008),Z,Q);J.restore()}}}function I9(J,$,j,Q){if(J.beginPath(),J.moveTo($[0].x*j,$[0].y*Q),$.length===1){J.lineTo($[0].x*j+0.01,$[0].y*Q);return}for(let X=1;X<$.length-1;X++){let Z=$[X],W=$[X+1];J.quadraticCurveTo(Z.x*j,Z.y*Q,(Z.x+W.x)/2*j,(Z.y+W.y)/2*Q)}let z=$[$.length-1];J.lineTo(z.x*j,z.y*Q)}function C9(J,$,j,Q,z,X){J.globalAlpha=X,I9(J,$.pts,j,Q),J.strokeStyle="rgba(255,255,255,0.92)",J.lineWidth=z+3,J.stroke(),J.strokeStyle=$.color,J.lineWidth=z,J.stroke()}function O9(J,$,j,Q,z,X){let Z=$.pts[0],W=$.pts[$.pts.length-1],Y=Math.min(Z.x,W.x)*j,U=Math.min(Z.y,W.y)*Q,C=Math.abs(W.x-Z.x)*j,F=Math.abs(W.y-Z.y)*Q;J.globalAlpha=X,J.fillStyle=$.color,J.globalAlpha=X*0.14,J.fillRect(Y,U,C,F),J.globalAlpha=X,J.strokeStyle="rgba(255,255,255,0.92)",J.lineWidth=z+3,J.strokeRect(Y,U,C,F),J.strokeStyle=$.color,J.lineWidth=z,J.strokeRect(Y,U,C,F)}function L9(J,$,j,Q,z,X,Z){let W=$.pts.filter((U)=>Z-U.t<=450);for(let U=1;U<W.length;U++){let C=W[U-1],F=W[U];J.globalAlpha=X*Math.max(0,1-(Z-F.t)/450)*0.7,J.strokeStyle=$.color,J.lineWidth=z*0.9,J.beginPath(),J.moveTo(C.x*j,C.y*Q),J.lineTo(F.x*j,F.y*Q),J.stroke()}let Y=$.pts[$.pts.length-1];J.globalAlpha=X,J.shadowColor=$.color,J.shadowBlur=z*2,J.fillStyle=$.color,J.beginPath(),J.arc(Y.x*j,Y.y*Q,z,0,Math.PI*2),J.fill(),J.shadowBlur=0,J.strokeStyle="rgba(255,255,255,0.95)",J.lineWidth=2,J.stroke()}function R9(J,$,j,Q=typeof window>"u"?1:window.devicePixelRatio||1){let z=Math.max(1,Math.round($*Q)),X=Math.max(1,Math.round(j*Q));if(J.width!==z)J.width=z;if(J.height!==X)J.height=X;let Z=J.getContext("2d");return Z?.setTransform(Q,0,0,Q,0,0),Z}class i2{canvas;scene;box;frame=0;constructor(J,$,j){this.canvas=J;this.scene=$;this.box=j}kick(){if(this.frame||typeof requestAnimationFrame>"u")return;let J=()=>{this.frame=0;let{w:$,h:j}=this.box(),Q=R9(this.canvas,$,j),z=Date.now(),X=this.scene.alive(z);if(Q)this.scene.draw(Q,$,j,z);if(X)this.frame=requestAnimationFrame(J)};this.frame=requestAnimationFrame(J)}stop(){if(this.frame&&typeof cancelAnimationFrame<"u")cancelAnimationFrame(this.frame);this.frame=0}}var S9="lw-call-ink",A0=null,J2=null,M1=null;function T9(){if(A0?.isConnected&&M1)return;A0=document.createElement(S9),A0.dataset.debugReporter="true";let J=A0.attachShadow({mode:"open"}),$=document.createElement("style");$.textContent=`:host { all: initial; }
329
- canvas { position: fixed; left: 0; top: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 2147483002; }`;let j=document.createElement("canvas");j.setAttribute("aria-hidden","true"),j.dataset.lwCallInk="",J.append($,j),document.body.append(A0),J2=new d2,M1=new i2(j,J2,()=>({w:window.innerWidth,h:window.innerHeight}))}function $2(J){if(typeof document>"u")return;if(J.op==="clear"&&!A0)return;T9(),J2.apply(J),M1.kick()}function j2(){M1?.stop(),A0?.remove(),A0=null,J2=null,M1=null}var A9="lw-call-frame",E9="lw-call",z0=16,o2=368,D0=null,i=null,y0=null,X2="",P1=null,F1="card",s2={width:o2,height:0},a2,N1=!1,t2=null,t0={answer:!1,voice:!1},E0=null,J0=null,c2="lw-call-frame-place";function Z8(J,$,j,Q){let z=new URL("embed/call",J.endsWith("/")?J:`${J}/`);if(z.searchParams.set("realm",$),j)z.searchParams.set("token",j);else z.searchParams.set("hand","1");return z.searchParams.set("call",Q),z.toString()}function a0(J){i?.contentWindow?.postMessage({source:"lw-call-host",...J},X2)}function V8(J){if(y0!==J)return;if(t0.answer=!0,N1)a0({type:"answer"})}function W8(J){if(y0!==J)return;if(t0.voice=!0,N1)a0({type:"voice"})}function K8(J,$,j){return{x:Math.min(Math.max(J.x,z0/2),Math.max(z0/2,j.w-$.w-z0/2)),y:Math.min(Math.max(J.y,z0/2),Math.max(z0/2,j.h-$.h-z0/2))}}function k9(J,$){if(J.origin!==$.origin||J.source!==$.window)return null;let j=J.data;return j&&typeof j==="object"&&j.source===E9&&typeof j.type==="string"?j:null}function J1(){return D0?.isConnected?y0:null}function Y8(J,$,j,Q=15000,z=null){if(typeof document>"u")return;if(y0===$&&D0?.isConnected)return;_1(),y0=$,P1=j,N1=!1,t2=z,t0={answer:!1,voice:!1},F1="card",s2={width:o2,height:0},X2=new URL(J).origin;try{E0=JSON.parse(sessionStorage.getItem(c2)??"null")}catch{E0=null}D0=document.createElement(A9),D0.dataset.debugReporter="true";let X=D0.attachShadow({mode:"open"}),Z=document.createElement("style");Z.textContent=`:host { all: initial; }
328
+ `,e1=($)=>`<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${$}</svg>`,H8=e1('<path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72c.13.96.36 1.9.7 2.81a2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45c.91.34 1.85.57 2.81.7A2 2 0 0 1 22 16.92z"/>'),n9=e1('<path d="M10.68 13.31a16 16 0 0 0 3.41 2.6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7 2 2 0 0 1 1.72 2v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.42 19.42 0 0 1-3.33-2.67m-2.67-3.34a19.79 19.79 0 0 1-3.07-8.63A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91"/><line x1="22" x2="2" y1="2" y2="22"/>'),s9=e1('<path d="M20 7h-9"/><path d="M14 17H5"/><circle cx="17" cy="17" r="3"/><circle cx="7" cy="7" r="3"/>'),a9=e1('<path d="M21 12a9 9 0 1 1-6.219-8.56"/>').replace("<svg ",'<svg class="spin" '),l=null,C0=null,s0=null;function t9($,J,Q){if(J.chatId)return Q??J.ticketTitle;return $.replace("{key}",J.ticketKey).replace("{title}",J.ticketTitle)}var a0=()=>$0(L().locale);function e9(){if(typeof document>"u")return null;if(l?.isConnected)return l.shadowRoot;l=document.createElement(r9),l.dataset.debugReporter="true",a1(l);let $=l.attachShadow({mode:"open"});return n0($),document.body.append(l),$}function t1($,J,Q,j){let Z=document.createElement("button");return Z.type="button",Z.className=$,Z.innerHTML=J,Z.dataset.lwRing=Q,Z.onclick=j,Z}var M1=($)=>{let J=document.createElement("span");return J.textContent=$,J.outerHTML};function M8($,J,Q,j,Z){let X=a0();$.innerHTML="";let V=document.createElement("style");V.textContent=o9;let W=document.createElement("div");W.className="card",W.setAttribute("role","alertdialog"),W.setAttribute("aria-label",X.ringTitle),W.dataset.lwCallRing=J.id,W.dataset.lwRingMode=j;let K=document.createElement("div");K.className="head";let Y=document.createElement("span");Y.className="icon",Y.innerHTML=H8;let N=document.createElement("div");N.className="words";let M=document.createElement("h2");M.textContent=X.ringTitle;let R=document.createElement("p");R.className="about",R.textContent=t9(X.ringAbout,J,X.ringChat),R.title=R.textContent,N.append(M,R),K.append(Y,N);let _=document.createElement("p");_.className="how",_.textContent=Z??(j==="frame"?X.ringHint:X.ringHow);let I=document.createElement("div");I.className="actions";let A=t1("decline",n9+M1(X.ringDecline),"decline",()=>Q.decline());if(W.append(K,_),j==="frame"&&Q.answer){if(Q.voice)W.append(t1("test",s9+M1(X.ringTest),"test",()=>Q.voice?.()));let B=t1("answer",H8+M1(X.ringAnswer),"answer",()=>Q.answer?.());I.append(A,B)}else I.append(A,t1("open",M1(X.ringOpen),"open",()=>Q.open()));W.append(I),$.append(V,W)}function $2($,J,Q="portal"){if(C0===$.id&&l?.isConnected)return;let j=e9();if(!j)return;if(C0=$.id,M8(j,$,J,Q),$7(),s0===null)s0=document.title,document.title=`${a0().ringTab} — ${s0}`}function P8($){let J=l?.shadowRoot;if(!J||C0!==$)return;let Q=J.querySelector(".answer");if(Q)Q.innerHTML=a9+M1(a0().ringAnswering),Q.disabled=!0;let j=J.querySelector(".decline");if(j)j.disabled=!0}function B8($,J){let Q=l?.isConnected?l.shadowRoot:null;if(!Q||C0!==$.id)return $2($,J,"portal");l.style.display="",M8(Q,$,J,"portal",a0().ringFallback)}function J2($){let J=l?.shadowRoot;if(!J)return;s2(),C8();let Q=a0(),j=J.querySelector(".how"),Z=J.querySelector(".actions");if(j)if(j.textContent="",$){let X=document.createElement("a");X.href=$,X.target="_blank",X.rel="noopener",X.textContent=Q.ringBlocked,X.dataset.lwRing="link",X.onclick=()=>window.setTimeout(()=>J2(),0),j.append(X)}else j.textContent=Q.ringOpened;if(Z){Z.innerHTML="";let X=document.createElement("button");X.type="button",X.className="close",X.textContent=Q.ringClose,X.dataset.lwRing="close",X.onclick=()=>t0(),Z.append(X)}}function N8($,J=!0){if(!l?.isConnected||C0!==$)return;let Q=l;if(clearTimeout(F8),!J){Q.style.display="",Q.style.opacity="";return}Q.style.transition="opacity 150ms ease-out",Q.style.opacity="0",F8=setTimeout(()=>{if(Q.style.opacity==="0")Q.style.display="none"},160)}var F8;function t0($){if($&&C0&&$!==C0)return;s2(),C8(),l?.remove(),l=null,C0=null}function _8(){return l?.isConnected?C0:null}function C8(){if(s0===null||typeof document>"u")return;if(document.title.startsWith(a0().ringTab))document.title=s0;s0=null}var A0=null,n2;function $7(){s2();let $=window,J=$.AudioContext??$.webkitAudioContext;if(!J)return;try{let j=A0??new J;A0=j,j.resume?.().catch(()=>{return})}catch{return}let Q=()=>{if(!A0||A0.state!=="running")return;let j=A0.currentTime;for(let[Z,X]of[660,880].entries()){let V=A0.createOscillator(),W=A0.createGain();V.frequency.value=X,W.gain.setValueAtTime(0.0001,j+Z*0.22),W.gain.exponentialRampToValueAtTime(0.08,j+Z*0.22+0.02),W.gain.exponentialRampToValueAtTime(0.0001,j+Z*0.22+0.2),V.connect(W).connect(A0.destination),V.start(j+Z*0.22),V.stop(j+Z*0.22+0.21)}};Q(),n2=setInterval(Q,2200)}function s2(){clearInterval(n2),n2=void 0}var J7=/^[A-Za-z0-9_-]{1,32}$/,Q7=/^#[0-9a-fA-F]{6}$/,j7=["pen","rect","laser"],I8=($)=>$<0?0:$>1?1:$;function O8($,J){if(!Array.isArray($)||$.length<J||$.length>64)return null;let Q=[];for(let j of $){if(!Array.isArray(j)||j.length!==2)return null;let[Z,X]=j;if(typeof Z!=="number"||typeof X!=="number"||!Number.isFinite(Z)||!Number.isFinite(X))return null;Q.push([I8(Z),I8(X)])}return Q}function Q2($){if(!$||typeof $!=="object")return null;let J=$;if(J.op==="clear")return{op:"clear"};if(typeof J.id!=="string"||!J7.test(J.id))return null;if(J.op==="end")return{op:"end",id:J.id};if(J.op==="add"){let Q=O8(J.pts,1);return Q?{op:"add",id:J.id,pts:Q}:null}if(J.op==="begin"){if(!j7.includes(J.kind)||typeof J.color!=="string"||!Q7.test(J.color))return null;let Q=O8(J.pts,1);return Q?{op:"begin",id:J.id,kind:J.kind,color:J.color,pts:Q}:null}return null}function a2($,J){if($.endedAt!==null)return $.endedAt;return J-$.lastAt>20000?$.lastAt:null}function L8($,J,Q){if(J===null)return 1;let j=Q-J;if($==="laser")return j>=900?0:1-j/900;if(j<=3500)return 1;return Math.max(0,1-(j-3500)/700)}class t2{marks=new Map;apply($,J=Date.now()){if($.op==="clear"){this.marks.clear();return}if($.op==="begin"){while(this.marks.size>=120)this.marks.delete(this.marks.keys().next().value);this.marks.delete($.id),this.marks.set($.id,{kind:$.kind,color:$.color,pts:$.pts.map(([j,Z])=>({x:j,y:Z,t:J})),endedAt:null,lastAt:J});return}let Q=this.marks.get($.id);if(!Q||a2(Q,J)!==null)return;if($.op==="end"){Q.endedAt=J;return}if(Q.lastAt=J,Q.kind==="rect"){let[j,Z]=$.pts[$.pts.length-1];Q.pts=[Q.pts[0],{x:j,y:Z,t:J}];return}for(let[j,Z]of $.pts)Q.pts.push({x:j,y:Z,t:J});if(Q.pts.length>4000)Q.pts.splice(0,Q.pts.length-4000)}alive($=Date.now()){for(let[J,Q]of this.marks)if(L8(Q.kind,a2(Q,$),$)<=0)this.marks.delete(J);return this.marks.size>0}get size(){return this.marks.size}draw($,J,Q,j=Date.now()){$.clearRect(0,0,J,Q);let Z=Math.max(1,Math.min(J,Q));for(let X of this.marks.values()){let V=L8(X.kind,a2(X,j),j);if(V<=0||!X.pts.length)continue;if($.save(),$.lineCap="round",$.lineJoin="round",X.kind==="pen")X7($,X,J,Q,Math.max(3,Z*0.0045),V);else if(X.kind==="rect")V7($,X,J,Q,Math.max(2.5,Z*0.003),V);else z7($,X,J,Q,Math.max(6,Z*0.008),V,j);$.restore()}}}function Z7($,J,Q,j){if($.beginPath(),$.moveTo(J[0].x*Q,J[0].y*j),J.length===1){$.lineTo(J[0].x*Q+0.01,J[0].y*j);return}for(let X=1;X<J.length-1;X++){let V=J[X],W=J[X+1];$.quadraticCurveTo(V.x*Q,V.y*j,(V.x+W.x)/2*Q,(V.y+W.y)/2*j)}let Z=J[J.length-1];$.lineTo(Z.x*Q,Z.y*j)}function X7($,J,Q,j,Z,X){$.globalAlpha=X,Z7($,J.pts,Q,j),$.strokeStyle="rgba(255,255,255,0.92)",$.lineWidth=Z+3,$.stroke(),$.strokeStyle=J.color,$.lineWidth=Z,$.stroke()}function V7($,J,Q,j,Z,X){let V=J.pts[0],W=J.pts[J.pts.length-1],K=Math.min(V.x,W.x)*Q,Y=Math.min(V.y,W.y)*j,N=Math.abs(W.x-V.x)*Q,M=Math.abs(W.y-V.y)*j;$.globalAlpha=X,$.fillStyle=J.color,$.globalAlpha=X*0.14,$.fillRect(K,Y,N,M),$.globalAlpha=X,$.strokeStyle="rgba(255,255,255,0.92)",$.lineWidth=Z+3,$.strokeRect(K,Y,N,M),$.strokeStyle=J.color,$.lineWidth=Z,$.strokeRect(K,Y,N,M)}function z7($,J,Q,j,Z,X,V){let W=J.pts.filter((Y)=>V-Y.t<=450);for(let Y=1;Y<W.length;Y++){let N=W[Y-1],M=W[Y];$.globalAlpha=X*Math.max(0,1-(V-M.t)/450)*0.7,$.strokeStyle=J.color,$.lineWidth=Z*0.9,$.beginPath(),$.moveTo(N.x*Q,N.y*j),$.lineTo(M.x*Q,M.y*j),$.stroke()}let K=J.pts[J.pts.length-1];$.globalAlpha=X,$.shadowColor=J.color,$.shadowBlur=Z*2,$.fillStyle=J.color,$.beginPath(),$.arc(K.x*Q,K.y*j,Z,0,Math.PI*2),$.fill(),$.shadowBlur=0,$.strokeStyle="rgba(255,255,255,0.95)",$.lineWidth=2,$.stroke()}function W7($,J,Q,j=typeof window>"u"?1:window.devicePixelRatio||1){let Z=Math.max(1,Math.round(J*j)),X=Math.max(1,Math.round(Q*j));if($.width!==Z)$.width=Z;if($.height!==X)$.height=X;let V=$.getContext("2d");return V?.setTransform(j,0,0,j,0,0),V}class e2{canvas;scene;box;frame=0;constructor($,J,Q){this.canvas=$;this.scene=J;this.box=Q}kick(){if(this.frame||typeof requestAnimationFrame>"u")return;let $=()=>{this.frame=0;let{w:J,h:Q}=this.box(),j=W7(this.canvas,J,Q),Z=Date.now(),X=this.scene.alive(Z);if(j)this.scene.draw(j,J,Q,Z);if(X)this.frame=requestAnimationFrame($)};this.frame=requestAnimationFrame($)}stop(){if(this.frame&&typeof cancelAnimationFrame<"u")cancelAnimationFrame(this.frame);this.frame=0}}var K7="lw-call-ink",E0=null,j2=null,P1=null;function Y7(){if(E0?.isConnected&&P1)return;E0=document.createElement(K7),E0.dataset.debugReporter="true";let $=E0.attachShadow({mode:"open"}),J=document.createElement("style");J.textContent=`:host { all: initial; }
329
+ canvas { position: fixed; left: 0; top: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 2147483002; }`;let Q=document.createElement("canvas");Q.setAttribute("aria-hidden","true"),Q.dataset.lwCallInk="",$.append(J,Q),document.body.append(E0),j2=new t2,P1=new e2(Q,j2,()=>({w:window.innerWidth,h:window.innerHeight}))}function Z2($){if(typeof document>"u")return;if($.op==="clear"&&!E0)return;Y7(),j2.apply($),P1.kick()}function X2(){P1?.stop(),E0?.remove(),E0=null,j2=null,P1=null}var G7="lw-call-frame",q7="lw-call",X0=16,Z4=368,H0=null,i=null,v0=null,W2="",N1=null,_1="card",X4={width:Z4,height:0},V4,C1=!1,z4=null,$1={answer:!1,voice:!1},k0=null,J0=null,$4="lw-call-frame-place";function R8($,J,Q,j){let Z=new URL("embed/call",$.endsWith("/")?$:`${$}/`);if(Z.searchParams.set("realm",J),Q)Z.searchParams.set("token",Q);else Z.searchParams.set("hand","1");return Z.searchParams.set("call",j),Z.toString()}function e0($){i?.contentWindow?.postMessage({source:"lw-call-host",...$},W2)}function S8($){if(v0!==$)return;if($1.answer=!0,C1)e0({type:"answer"})}function T8($){if(v0!==$)return;if($1.voice=!0,C1)e0({type:"voice"})}function A8($,J,Q){return{x:Math.min(Math.max($.x,X0/2),Math.max(X0/2,Q.w-J.w-X0/2)),y:Math.min(Math.max($.y,X0/2),Math.max(X0/2,Q.h-J.h-X0/2))}}function U7($,J){if($.origin!==J.origin||$.source!==J.window)return null;let Q=$.data;return Q&&typeof Q==="object"&&Q.source===q7&&typeof Q.type==="string"?Q:null}function Q1(){return H0?.isConnected?v0:null}function E8($,J,Q,j=15000,Z=null){if(typeof document>"u")return;if(v0===J&&H0?.isConnected)return;I1(),v0=J,N1=Q,C1=!1,z4=Z,$1={answer:!1,voice:!1},_1="card",X4={width:Z4,height:0},W2=new URL($).origin;try{k0=JSON.parse(sessionStorage.getItem($4)??"null")}catch{k0=null}H0=document.createElement(G7),H0.dataset.debugReporter="true";let X=H0.attachShadow({mode:"open"}),V=document.createElement("style");V.textContent=`:host { all: initial; }
330
330
  iframe { position: fixed; z-index: 2147483003; border: 0; background: transparent; color-scheme: normal; visibility: hidden; }
331
- iframe.on { visibility: visible; }`,i=document.createElement("iframe"),i.allow="microphone; camera; display-capture; autoplay; clipboard-write; fullscreen",i.title="สายจากทีมงาน",i.dataset.lwCallFrame=$,i.setAttribute("allowtransparency","true"),i.src=J,X.append(Z,i),document.body.append(D0),e0(),window.addEventListener("message",G8),window.addEventListener("resize",e0),e2(`lw-call:${$}`),a2=setTimeout(()=>{if(!N1)l2("timeout")},Q)}function _1(){if(D0)e2(r2?.handle??null,r2?.readableBy);j2(),clearTimeout(a2),window.removeEventListener("message",G8),window.removeEventListener("resize",e0),Q2(!1),D0?.remove(),D0=null,i=null,y0=null,P1=null,J0=null,t2=null,t0={answer:!1,voice:!1}}function l2(J){let $=P1;_1(),$?.failed(J)}function G8(J){if(!i)return;let $=k9(J,{origin:X2,window:i.contentWindow});if(!$)return;switch($.type){case"hello":t2?.then((j)=>{if(!i||y0===null)return;if(j)a0({type:"token",token:j});else l2("no_token")});return;case"ready":if(N1=!0,clearTimeout(a2),i.classList.add("on"),P1?.ready(),t0.answer)a0({type:"answer"});if(t0.voice)a0({type:"voice"});return;case"size":if(typeof $.width==="number"&&typeof $.height==="number")s2={width:$.width,height:$.height};if($.layout==="card"||$.layout==="full"){if($.layout==="full"&&F1==="card")x9();F1=$.layout}return e0();case"drag":return n2($);case"home":return E0=null,q8(),e0();case"done":{let j=P1;_1(),j?.done();return}case"failed":return l2($.reason??"failed");case"ink":{let j=e1($.op);if(j)$2(j);return}}}function e2(J,$=X2){let j=typeof navigator>"u"?void 0:navigator.mediaDevices;try{j?.setCaptureHandleConfig?.(J&&$?{handle:J,exposeOrigin:!1,permittedOrigins:[$]}:{})}catch{}}var r2=null;function U8(J,$){if(r2={handle:J,readableBy:$},!D0?.isConnected)e2(J,$)}function n2(J){if(!i||F1!=="card"||typeof J.x!=="number"||typeof J.y!=="number")return;if(J.phase==="start"){let $=i.getBoundingClientRect();J0={sx:J.x,sy:J.y,x:$.left,y:$.top,lx:J.x,ly:J.y},Q2(!0);return}if(!J0)return;if(J0.lx=J.x,J0.ly=J.y,E0=K8({x:J0.x+(J.x-J0.sx),y:J0.y+(J.y-J0.sy)},D8(),z2()),e0(),J.phase==="end")J0=null,Q2(!1),q8()}var B1=null;function Q2(J){if(B1){for(let $ of["pointermove","pointerup","pointercancel"])window.removeEventListener($,B1,!0);B1=null}if(!J)return;B1=($)=>{if(!J0)return Q2(!1);if($.type==="pointermove"&&$.buttons!==0)return n2({type:"drag",phase:"move",x:$.screenX,y:$.screenY});let j=$.type==="pointerup";n2({type:"drag",phase:"end",x:j?$.screenX:J0.lx,y:j?$.screenY:J0.ly})};for(let $ of["pointermove","pointerup","pointercancel"])window.addEventListener($,B1,!0)}function x9(){if(!i?.contentWindow)return;let J=i.getBoundingClientRect();a0({type:"corner",x:Math.round(J.left),y:Math.round(J.top),width:Math.round(J.width)})}function q8(){try{if(E0)sessionStorage.setItem(c2,JSON.stringify(E0));else sessionStorage.removeItem(c2)}catch{}}var z2=()=>({w:window.innerWidth,h:window.innerHeight});function D8(){let J=z2();return{w:Math.min(o2,J.w-z0),h:Math.min(s2.height||0,J.h-z0)}}function e0(){if(!i)return;let J=i.style;if(F1==="full"){Object.assign(J,{left:"0px",top:"0px",right:"",bottom:"",width:"100vw",height:"100vh"});return}let $=D8(),j=z2().w<480;if(J.width=j?`calc(100vw - ${z0}px)`:`${$.w}px`,J.height=`${$.h}px`,E0&&!j){let Q=K8(E0,$,z2());Object.assign(J,{left:`${Q.x}px`,top:`${Q.y}px`,right:"",bottom:""})}else Object.assign(J,{left:j?`${z0/2}px`:"",top:"",right:j?"":`${z0/2}px`,bottom:`calc(${z0/2}px + var(--lw-chat-lift, 0px))`})}var Z2=[2000,5000,15000,30000,60000],H8=new Set(["ringing","active"]),f9=20000,M8=!1,$1=!1,B8=0,w9=5,J4=null,L8=0,$4,P8,F8,R8=(J)=>J.endsWith("/")?J:`${J}/`;function y9(J,$){let j=new URL("api/presence/ws",R8(J));return j.protocol=j.protocol==="https:"?"wss:":"ws:",j.searchParams.set("t",$),j.toString()}function g9(J){if(J.chatId||!J.ticketId)return`/me/chat?call=${J.id}`;return`/me/tickets/${J.ticketId}?call=${J.id}`}function v9(J){return J.status==="ringing"&&(J.side==="reporter"||J.side===void 0||J.side===null)}var j4=new Set;function S8(J){return j4.add(J),()=>j4.delete(J)}var N8=()=>_().ring!==!1;async function g0(){let J=_().identity;if(!J)return null;try{return await J()??null}catch{return null}}async function Z4(J,$){let j=_();return fetch(new URL(J,R8(j.host)).toString(),{method:"POST",headers:{"content-type":"application/json","x-realm-key":j.realmKey,authorization:`Bearer ${$}`},body:"{}"})}function V4(){if(M8||typeof window>"u"||typeof WebSocket>"u")return;let J=_();if(!J.identity||J.ring===!1&&!J.chat)return;M8=!0,$1=!1,m9(J.host);try{U8(`lw-tab:${A8()}`,new URL(J.host).origin)}catch{}T8()}function I1(J=!1){if($1)return;let $=J?Z2[Z2.length-1]:Z2[Math.min(L8++,Z2.length-1)];clearTimeout(P8),P8=setTimeout(()=>void T8(),$)}async function T8(){if($1)return;let J=await g0();if(!J){if(++B8>=w9){$1=!0;return}return I1(!0)}B8=0;let $;try{$=await Z4(_().chat?"ingest/live-ticket?chat=1":"ingest/live-ticket",J)}catch{return I1()}if($.status===401||$.status===404||$.status===403){$1=!0;return}if(!$.ok)return I1($.status===429);let j;try{j=await $.json()}catch{return I1()}if(!j.ticket){$1=!0;return}if(j.calls&&j.call&&N8())O8(j.call);let Q=new WebSocket(y9(_().host,j.ticket));J4=Q,Q.onopen=()=>{L8=0,Q.send(JSON.stringify({type:"tab",id:A8()})),clearInterval($4),$4=setInterval(()=>{if(Q.readyState===WebSocket.OPEN)Q.send(JSON.stringify({type:"ping"}))},f9)},Q.onmessage=(z)=>{try{let X=JSON.parse(String(z.data));if(X.type==="chat-changed"||X.type==="ticket-changed"||X.type==="chat-seen"){for(let Z of j4)Z(X);return}if(X.type==="call-state"&&X.call&&typeof X.call==="object"){if(N8())O8(X.call)}else if(X.type==="call-ink"&&typeof X.call==="string"){let Z=e1(X.op);if(Z)X4=X.call,$2(Z)}}catch{}},Q.onclose=()=>{if(clearInterval($4),J4===Q)J4=null;I1()}}var Q4="lw-call-framed";function h9(){try{return sessionStorage.getItem(Q4)}catch{return null}}function V2(J){try{if(J)sessionStorage.setItem(Q4,J);else sessionStorage.removeItem(Q4)}catch{}}var _8=!1;function m9(J){if(_8||typeof document>"u")return;_8=!0;try{let $=new URL(J).origin;for(let j of["dns-prefetch","preconnect"]){let Q=document.createElement("link");if(Q.rel=j,Q.href=$,j==="preconnect")Q.crossOrigin="anonymous";Q.dataset.debugReporter="true",document.head.append(Q)}}catch{}}function I8(J){let $=_();if($.callFrame===!1||J1()===J.id)return;V2(J.id),Y8(Z8($.host,$.realmKey,null,J.id),J.id,{ready:()=>J8(J.id),done:()=>{V2(null),s0(J.id)},failed:()=>{V2(null),e6(J,z4(J))}},15000,g0())}var z4=(J)=>({open:()=>b9(J),decline:()=>void u9(J)}),k0=null;function A8(){if(k0)return k0;try{k0=sessionStorage.getItem(C8)}catch{}if(!k0||!/^[A-Za-z0-9_-]{8,40}$/.test(k0)){let J=new Uint8Array(12);crypto.getRandomValues(J),k0=Array.from(J,($)=>$.toString(16).padStart(2,"0")).join("");try{sessionStorage.setItem(C8,k0)}catch{}}return k0}var C8="lw-tab-id",X4=null;function O8(J){if(!H8.has(J.status)&&X4===J.id&&J1()!==J.id)X4=null,j2();if(!v9(J)){if(s0(J.id),J.status==="active"&&h9()===J.id&&!J1())I8(J);if(!H8.has(J.status)&&J1()===J.id)setTimeout(()=>{if(J1()===J.id)_1(),V2(null)},12000);return}if(_().callFrame===!1)a1(J,z4(J),"portal");else a1(J,{...z4(J),answer:()=>{t6(J.id),V8(J.id)},voice:()=>W8(J.id)},"frame"),I8(J);clearTimeout(F8);let $=new Date(J.ringUntil).getTime()-Date.now();F8=setTimeout(()=>{if($8()===J.id)s0(J.id)},Math.max(5000,$+5000))}function b9(J){let $=window.open("about:blank","_blank");(async()=>{let j=await g0();if(j)Z4(`ingest/calls/${J.id}/coming`,j).catch(()=>{return});let Q;try{Q=await r6(g9(J))}catch{$?.close();return}if($&&!$.closed){$.location.href=Q;try{$.opener=null}catch{}t1()}else t1(Q)})()}async function u9(J){s0(J.id);let $=await g0();if($)await Z4(`ingest/calls/${J.id}/decline`,$).catch(()=>{return})}function W4(J,$,j,Q){let z=[];for(let X of J){if(X.right<=$.left||X.left>=$.right||X.bottom<=X.top)continue;z.push([j-X.bottom-8-Q,j-X.top+8])}return z.sort((X,Z)=>X[0]-Z[0])}function E8(J,$,j,Q){if(Q<j)return null;let z=(Y)=>$.some(([U,C])=>Y>U&&Y<C),X=(Y)=>Math.min(Math.max(Y,j),Q),Z=X(J);if(!z(Z))return Z;let W=[j,Q,...$.flatMap(([Y,U])=>[Y,U])].map(X).filter((Y)=>!z(Y));if(!W.length)return null;return W.reduce((Y,U)=>{let C=Math.abs(U-Z),F=Math.abs(Y-Z);return C<F||C===F&&U>Y?U:Y})}var p9=3;function f8(J,$,j,Q,z,X,Z=null){let W=new Map,Y=(I,D)=>{let M=`${I}:${D}`;if(!W.has(M))W.set(M,$(I,D));return W.get(M)},U=(I,D)=>I==="right"?{left:j.w-D-Q,right:j.w-D}:{left:D,right:D+Q},C=(I,D)=>W4(Y(I,D),U(I,D),j.h,Q),F=(I)=>Math.abs(I.y-J.y)+Math.abs(I.x-J.x)+(I.side===J.side?0:160),O=(I)=>E8(I.y,C(I.side,I.x),z,X)===I.y,A=(I)=>Z&&(Z.side!==I.side||Z.x!==I.x||Z.y!==I.y)&&F(Z)<=F(I)+48&&O(Z)?Z:I;if(O(J))return A(J);let R=null,m=J.side==="right"?"left":"right";for(let I of[J.side,m]){let D=I===J.side?0:160;if(R&&D>=F(R))break;let M=J.x;for(let w=0;w<=p9;w++){let b=E8(J.y,C(I,M),z,X);if(b!==null&&(!R||F({side:I,x:M,y:b})<F(R)))R={side:I,x:M,y:b};let L=U(I,M),y={top:j.h-J.y-Q-8,bottom:j.h-J.y+8},S=Y(I,M).filter((P)=>P.top<y.bottom&&P.bottom>y.top&&P.left<L.right&&P.right>L.left);if(!S.length)break;let u=Math.round(I==="right"?Math.max(...S.map((P)=>j.w-P.left+8)):Math.max(...S.map((P)=>P.right+8)));if(u<=M||u+Q>j.w/2||R&&D+u-J.x>=F(R))break;M=u}}return R?A(R):J}function d9(J){if(typeof J!=="string"||!J.startsWith("/")||J.length>200)return null;let j=(J.length>1?J.replace(/\/+$/,""):"").split(/(\*\*|\*)/).map((Q)=>Q==="**"?".*":Q==="*"?"[^/]*":Q.replace(/[.+?^${}()|[\]\\]/g,"\\$&")).join("");try{return new RegExp(`^${j}(?:/.*)?$`)}catch{return null}}function w8(J,$){let j=null;for(let Q of $??[]){let z=d9(Q.path);if(!z||!z.test(J))continue;if(!j||Q.path.replace(/\*/g,"").length>j.path.replace(/\*/g,"").length)j=Q}return j}var k8=/^LW-/,i9='a[href],button,input,select,textarea,summary,label,[role="button"],[role="link"],[role="tab"],[role="menuitem"],[role="checkbox"],[role="switch"],[role="radio"],[role="option"],[role="slider"],[role="combobox"],[role="textbox"],[contenteditable=""],[contenteditable="true"],[tabindex]:not([tabindex="-1"])',x8=/(auto|scroll|overlay)/,c9='button:disabled,input:disabled,select:disabled,textarea:disabled,[aria-disabled="true"]';function y8(J,$,j={}){if(typeof document>"u"||typeof document.elementsFromPoint!=="function")return J.map(()=>[]);let Q=j.step??16,z=document.documentElement,X=document.body,Z=new Map,W=(D)=>Z.get(D)??(Z.set(D,getComputedStyle(D)),Z.get(D)),Y=$.w*$.h,U=(D)=>D.width*D.height>0.34*Y||D.width>=$.w*0.9&&D.height>=$.h*0.9,C=(D)=>{let M=W(D);return x8.test(M.overflowY)&&D.scrollHeight>D.clientHeight+1||x8.test(M.overflowX)&&D.scrollWidth>D.clientWidth+1},F=document.scrollingElement??z,O=F.scrollHeight>F.clientHeight+1&&W(z).overflowY!=="hidden"&&(!X||W(X).overflowY!=="hidden"),A=(D,M)=>{let w={top:0,bottom:$.h};for(let S=D.parentElement;S&&S!==z&&S!==X;S=S.parentElement){let u=W(S);if(u.overflowY!=="visible"&&u.overflowY!=="clip"){let P=S.getBoundingClientRect();w={top:P.top,bottom:P.bottom};break}}let b=D.getBoundingClientRect(),L=parseFloat(M.top),y=parseFloat(M.bottom);return!Number.isNaN(y)&&b.bottom>=w.bottom-y-1||!Number.isNaN(L)&&b.top<=w.top+L+1},R=(D)=>{let M=null,w=!1,b=1;for(let L=D;L&&L!==z&&L!==X;L=L.parentElement){let y=W(L),S=parseFloat(y.opacity);if(!Number.isNaN(S))b*=S;if(y.position==="fixed"||y.position==="sticky"&&A(L,y)){M=L;break}if(L!==D&&C(L))w=!0}if(!M&&O)w=!0;return{float:M,scrolled:w,opacity:b}},m=new Map,I=(D,M)=>{let w=document.elementFromPoint(D,M);if(!w||!k8.test(w.tagName))return w;return document.elementsFromPoint(D,M).find((b)=>!k8.test(b.tagName))??null};return J.map((D)=>{let M=new Set,w=new Set,b=[],L=(u)=>{if(w.has(u))return;w.add(u);let P=u.getBoundingClientRect();if(P.width>0&&P.height>0)b.push({top:P.top,bottom:P.bottom,left:P.left,right:P.right})},y=new Set,S=[D.left+6,(D.left+D.right)/2,D.right-6];for(let u=Q/2;u<$.h;u+=Q)for(let P of S){let k=I(P,u);if(!k||k===z||k===X||M.has(k))continue;if(M.add(k),j.extra){let n=null;try{n=k.closest(j.extra)}catch{n=null}if(n){L(n);continue}}let{float:T,scrolled:p,opacity:m0}=m.get(k)??(m.set(k,R(k)),m.get(k));if(m0<0.05)continue;let Y0=k.closest(i9),t=Y0&&(!T||T.contains(Y0))?Y0:null;if(T&&!U(T.getBoundingClientRect())){let n=t??k;if(!U(n.getBoundingClientRect()))L(n);continue}if(!p&&(T||!O))y.add(T);if(p||!t||U(t.getBoundingClientRect()))continue;L(t)}for(let u of y)for(let P of(u??X)?.querySelectorAll(c9)??[]){let k=P.getBoundingClientRect();if(!k.width||!k.height||k.right<=D.left||k.left>=D.right||U(k)||W(P).visibility==="hidden")continue;let T=m.get(P)??(m.set(P,R(P)),m.get(P));if(T.float!==u||T.scrolled||T.opacity<0.05)continue;let p=I(Math.min(Math.max((k.left+k.right)/2,D.left+6),D.right-6),(k.top+k.bottom)/2);if(p&&p!==P&&!P.contains(p)&&!p.contains(P))continue;L(P)}return b})}var l9="lw-support-chat",r9="lw-support-frame",n9="lw-support-host",d=56,Q1=12,o9='<svg viewBox="0 0 24 24" width="26" height="26" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M7.9 20A9 9 0 1 0 4 16.1L2 22Z"/></svg>',s9=`
331
+ iframe.on { visibility: visible; }`,i=document.createElement("iframe"),i.allow="microphone; camera; display-capture; autoplay; clipboard-write; fullscreen",i.title="สายจากทีมงาน",i.dataset.lwCallFrame=J,i.setAttribute("allowtransparency","true"),i.src=$,X.append(V,i),document.body.append(H0),J1(),window.addEventListener("message",k8),window.addEventListener("resize",J1),W4(`lw-call:${J}`),V4=setTimeout(()=>{if(!C1)J4("timeout")},j)}function I1(){if(H0)W4(Q4?.handle??null,Q4?.readableBy);X2(),clearTimeout(V4),window.removeEventListener("message",k8),window.removeEventListener("resize",J1),V2(!1),H0?.remove(),H0=null,i=null,v0=null,N1=null,J0=null,z4=null,$1={answer:!1,voice:!1}}function J4($){let J=N1;I1(),J?.failed($)}function k8($){if(!i)return;let J=U7($,{origin:W2,window:i.contentWindow});if(!J)return;switch(J.type){case"hello":z4?.then((Q)=>{if(!i||v0===null)return;if(Q)e0({type:"token",token:Q});else J4("no_token")});return;case"ready":if(C1=!0,clearTimeout(V4),i.classList.add("on"),N1?.ready(),$1.answer)e0({type:"answer"});if($1.voice)e0({type:"voice"});return;case"size":if(typeof J.width==="number"&&typeof J.height==="number")X4={width:J.width,height:J.height};if(J.layout==="card"||J.layout==="full"){if(J.layout==="full"&&_1==="card")D7();_1=J.layout}return J1();case"drag":return j4(J);case"home":return k0=null,f8(),J1();case"done":{let Q=N1;I1(),Q?.done();return}case"failed":return J4(J.reason??"failed");case"ink":{let Q=Q2(J.op);if(Q)Z2(Q);return}}}function W4($,J=W2){let Q=typeof navigator>"u"?void 0:navigator.mediaDevices;try{Q?.setCaptureHandleConfig?.($&&J?{handle:$,exposeOrigin:!1,permittedOrigins:[J]}:{})}catch{}}var Q4=null;function x8($,J){if(Q4={handle:$,readableBy:J},!H0?.isConnected)W4($,J)}function j4($){if(!i||_1!=="card"||typeof $.x!=="number"||typeof $.y!=="number")return;if($.phase==="start"){let J=i.getBoundingClientRect();J0={sx:$.x,sy:$.y,x:J.left,y:J.top,lx:$.x,ly:$.y},V2(!0);return}if(!J0)return;if(J0.lx=$.x,J0.ly=$.y,k0=A8({x:J0.x+($.x-J0.sx),y:J0.y+($.y-J0.sy)},w8(),z2()),J1(),$.phase==="end")J0=null,V2(!1),f8()}var B1=null;function V2($){if(B1){for(let J of["pointermove","pointerup","pointercancel"])window.removeEventListener(J,B1,!0);B1=null}if(!$)return;B1=(J)=>{if(!J0)return V2(!1);if(J.type==="pointermove"&&J.buttons!==0)return j4({type:"drag",phase:"move",x:J.screenX,y:J.screenY});let Q=J.type==="pointerup";j4({type:"drag",phase:"end",x:Q?J.screenX:J0.lx,y:Q?J.screenY:J0.ly})};for(let J of["pointermove","pointerup","pointercancel"])window.addEventListener(J,B1,!0)}function D7(){if(!i?.contentWindow)return;let $=i.getBoundingClientRect();e0({type:"corner",x:Math.round($.left),y:Math.round($.top),width:Math.round($.width)})}function f8(){try{if(k0)sessionStorage.setItem($4,JSON.stringify(k0));else sessionStorage.removeItem($4)}catch{}}var z2=()=>({w:window.innerWidth,h:window.innerHeight});function w8(){let $=z2();return{w:Math.min(Z4,$.w-X0),h:Math.min(X4.height||0,$.h-X0)}}function J1(){if(!i)return;let $=i.style;if(_1==="full"){Object.assign($,{left:"0px",top:"0px",right:"",bottom:"",width:"100vw",height:"100vh"});return}let J=w8(),Q=z2().w<480;if($.width=Q?`calc(100vw - ${X0}px)`:`${J.w}px`,$.height=`${J.h}px`,k0&&!Q){let j=A8(k0,J,z2());Object.assign($,{left:`${j.x}px`,top:`${j.y}px`,right:"",bottom:""})}else Object.assign($,{left:Q?`${X0/2}px`:"",top:"",right:Q?"":`${X0/2}px`,bottom:`calc(${X0/2}px + var(--lw-chat-lift, 0px))`})}var K2=[2000,5000,15000,30000,60000],y8=new Set(["ringing","active"]),H7=20000,g8=!1,j1=!1,v8=0,F7=5,K4=null,c8=0,Y4,b8,m8,l8=($)=>$.endsWith("/")?$:`${$}/`;function M7($,J){let Q=new URL("api/presence/ws",l8($));return Q.protocol=Q.protocol==="https:"?"wss:":"ws:",Q.searchParams.set("t",J),Q.toString()}function P7($){if($.chatId||!$.ticketId)return`/me/chat?call=${$.id}`;return`/me/tickets/${$.ticketId}?call=${$.id}`}function B7($){return $.status==="ringing"&&($.side==="reporter"||$.side===void 0||$.side===null)}var G4=new Set;function r8($){return G4.add($),()=>G4.delete($)}var h8=()=>L().ring!==!1;async function b0(){let $=L().identity;if(!$)return null;try{return await $()??null}catch{return null}}async function H4($,J){let Q=L();return fetch(new URL($,l8(Q.host)).toString(),{method:"POST",headers:{"content-type":"application/json","x-realm-key":Q.realmKey,authorization:`Bearer ${J}`},body:"{}"})}function F4(){if(g8||typeof window>"u"||typeof WebSocket>"u")return;let $=L();if(!$.identity||$.ring===!1&&!$.chat)return;g8=!0,j1=!1,_7($.host);try{x8(`lw-tab:${n8()}`,new URL($.host).origin)}catch{}o8()}function O1($=!1){if(j1)return;let J=$?K2[K2.length-1]:K2[Math.min(c8++,K2.length-1)];clearTimeout(b8),b8=setTimeout(()=>void o8(),J)}async function o8(){if(j1)return;let $=await b0();if(!$){if(++v8>=F7){j1=!0;return}return O1(!0)}v8=0;let J;try{J=await H4(L().chat?"ingest/live-ticket?chat=1":"ingest/live-ticket",$)}catch{return O1()}if(J.status===401||J.status===404||J.status===403){j1=!0;return}if(!J.ok)return O1(J.status===429);let Q;try{Q=await J.json()}catch{return O1()}if(!Q.ticket){j1=!0;return}if(Q.calls&&Q.call&&h8())i8(Q.call);let j=new WebSocket(M7(L().host,Q.ticket));K4=j,j.onopen=()=>{c8=0,j.send(JSON.stringify({type:"tab",id:n8()})),clearInterval(Y4),Y4=setInterval(()=>{if(j.readyState===WebSocket.OPEN)j.send(JSON.stringify({type:"ping"}))},H7)},j.onmessage=(Z)=>{try{let X=JSON.parse(String(Z.data));if(X.type==="chat-changed"||X.type==="ticket-changed"||X.type==="chat-seen"){for(let V of G4)V(X);return}if(X.type==="call-state"&&X.call&&typeof X.call==="object"){if(h8())i8(X.call)}else if(X.type==="call-ink"&&typeof X.call==="string"){let V=Q2(X.op);if(V)D4=X.call,Z2(V)}}catch{}},j.onclose=()=>{if(clearInterval(Y4),K4===j)K4=null;O1()}}var q4="lw-call-framed";function N7(){try{return sessionStorage.getItem(q4)}catch{return null}}function Y2($){try{if($)sessionStorage.setItem(q4,$);else sessionStorage.removeItem(q4)}catch{}}var u8=!1;function _7($){if(u8||typeof document>"u")return;u8=!0;try{let J=new URL($).origin;for(let Q of["dns-prefetch","preconnect"]){let j=document.createElement("link");if(j.rel=Q,j.href=J,Q==="preconnect")j.crossOrigin="anonymous";j.dataset.debugReporter="true",document.head.append(j)}}catch{}}function p8($){let J=L();if(J.callFrame===!1||Q1()===$.id)return;Y2($.id),E8(R8(J.host,J.realmKey,null,$.id),$.id,{ready:()=>N8($.id),done:()=>{Y2(null),t0($.id)},failed:()=>{Y2(null),B8($,U4($))}},15000,b0())}var U4=($)=>({open:()=>C7($),decline:()=>void I7($)}),x0=null;function n8(){if(x0)return x0;try{x0=sessionStorage.getItem(d8)}catch{}if(!x0||!/^[A-Za-z0-9_-]{8,40}$/.test(x0)){let $=new Uint8Array(12);crypto.getRandomValues($),x0=Array.from($,(J)=>J.toString(16).padStart(2,"0")).join("");try{sessionStorage.setItem(d8,x0)}catch{}}return x0}var d8="lw-tab-id",D4=null;function i8($){if(!y8.has($.status)&&D4===$.id&&Q1()!==$.id)D4=null,X2();if(!B7($)){if(t0($.id),$.status==="active"&&N7()===$.id&&!Q1())p8($);if(!y8.has($.status)&&Q1()===$.id)setTimeout(()=>{if(Q1()===$.id)I1(),Y2(null)},12000);return}if(L().callFrame===!1)$2($,U4($),"portal");else $2($,{...U4($),answer:()=>{P8($.id),S8($.id)},voice:()=>T8($.id)},"frame"),p8($);clearTimeout(m8);let J=new Date($.ringUntil).getTime()-Date.now();m8=setTimeout(()=>{if(_8()===$.id)t0($.id)},Math.max(5000,J+5000))}function C7($){let J=window.open("about:blank","_blank");(async()=>{let Q=await b0();if(Q)H4(`ingest/calls/${$.id}/coming`,Q).catch(()=>{return});let j;try{j=await U8(P7($))}catch{J?.close();return}if(J&&!J.closed){J.location.href=j;try{J.opener=null}catch{}J2()}else J2(j)})()}async function I7($){t0($.id);let J=await b0();if(J)await H4(`ingest/calls/${$.id}/decline`,J).catch(()=>{return})}function M4($,J,Q,j){let Z=[];for(let X of $){if(X.right<=J.left||X.left>=J.right||X.bottom<=X.top)continue;Z.push([Q-X.bottom-8-j,Q-X.top+8])}return Z.sort((X,V)=>X[0]-V[0])}function s8($,J,Q,j){if(j<Q)return null;let Z=(K)=>J.some(([Y,N])=>K>Y&&K<N),X=(K)=>Math.min(Math.max(K,Q),j),V=X($);if(!Z(V))return V;let W=[Q,j,...J.flatMap(([K,Y])=>[K,Y])].map(X).filter((K)=>!Z(K));if(!W.length)return null;return W.reduce((K,Y)=>{let N=Math.abs(Y-V),M=Math.abs(K-V);return N<M||N===M&&Y>K?Y:K})}var O7=3;function e8($,J,Q,j,Z,X,V=null){let W=new Map,K=(B,D)=>{let F=`${B}:${D}`;if(!W.has(F))W.set(F,J(B,D));return W.get(F)},Y=(B,D)=>B==="right"?{left:Q.w-D-j,right:Q.w-D}:{left:D,right:D+j},N=(B,D)=>M4(K(B,D),Y(B,D),Q.h,j),M=(B)=>Math.abs(B.y-$.y)+Math.abs(B.x-$.x)+(B.side===$.side?0:160),R=(B)=>s8(B.y,N(B.side,B.x),Z,X)===B.y,_=(B)=>V&&(V.side!==B.side||V.x!==B.x||V.y!==B.y)&&M(V)<=M(B)+48&&R(V)?V:B;if(R($))return _($);let I=null,A=$.side==="right"?"left":"right";for(let B of[$.side,A]){let D=B===$.side?0:160;if(I&&D>=M(I))break;let F=$.x;for(let y=0;y<=O7;y++){let h=s8($.y,N(B,F),Z,X);if(h!==null&&(!I||M({side:B,x:F,y:h})<M(I)))I={side:B,x:F,y:h};let S=Y(B,F),g={top:Q.h-$.y-j-8,bottom:Q.h-$.y+8},T=K(B,F).filter((C)=>C.top<g.bottom&&C.bottom>g.top&&C.left<S.right&&C.right>S.left);if(!T.length)break;let u=Math.round(B==="right"?Math.max(...T.map((C)=>Q.w-C.left+8)):Math.max(...T.map((C)=>C.right+8)));if(u<=F||u+j>Q.w/2||I&&D+u-$.x>=M(I))break;F=u}}return I?_(I):$}function L7($){if(typeof $!=="string"||!$.startsWith("/")||$.length>200)return null;let Q=($.length>1?$.replace(/\/+$/,""):"").split(/(\*\*|\*)/).map((j)=>j==="**"?".*":j==="*"?"[^/]*":j.replace(/[.+?^${}()|[\]\\]/g,"\\$&")).join("");try{return new RegExp(`^${Q}(?:/.*)?$`)}catch{return null}}function $3($,J){let Q=null;for(let j of J??[]){let Z=L7(j.path);if(!Z||!Z.test($))continue;if(!Q||j.path.replace(/\*/g,"").length>Q.path.replace(/\*/g,"").length)Q=j}return Q}var a8=/^LW-/,R7='a[href],button,input,select,textarea,summary,label,[role="button"],[role="link"],[role="tab"],[role="menuitem"],[role="checkbox"],[role="switch"],[role="radio"],[role="option"],[role="slider"],[role="combobox"],[role="textbox"],[contenteditable=""],[contenteditable="true"],[tabindex]:not([tabindex="-1"])',t8=/(auto|scroll|overlay)/,S7='button:disabled,input:disabled,select:disabled,textarea:disabled,[aria-disabled="true"]';function J3($,J,Q={}){if(typeof document>"u"||typeof document.elementsFromPoint!=="function")return $.map(()=>[]);let j=Q.step??16,Z=document.documentElement,X=document.body,V=new Map,W=(D)=>V.get(D)??(V.set(D,getComputedStyle(D)),V.get(D)),K=J.w*J.h,Y=(D)=>D.width*D.height>0.34*K||D.width>=J.w*0.9&&D.height>=J.h*0.9,N=(D)=>{let F=W(D);return t8.test(F.overflowY)&&D.scrollHeight>D.clientHeight+1||t8.test(F.overflowX)&&D.scrollWidth>D.clientWidth+1},M=document.scrollingElement??Z,R=M.scrollHeight>M.clientHeight+1&&W(Z).overflowY!=="hidden"&&(!X||W(X).overflowY!=="hidden"),_=(D,F)=>{let y={top:0,bottom:J.h};for(let T=D.parentElement;T&&T!==Z&&T!==X;T=T.parentElement){let u=W(T);if(u.overflowY!=="visible"&&u.overflowY!=="clip"){let C=T.getBoundingClientRect();y={top:C.top,bottom:C.bottom};break}}let h=D.getBoundingClientRect(),S=parseFloat(F.top),g=parseFloat(F.bottom);return!Number.isNaN(g)&&h.bottom>=y.bottom-g-1||!Number.isNaN(S)&&h.top<=y.top+S+1},I=(D)=>{let F=null,y=!1,h=1;for(let S=D;S&&S!==Z&&S!==X;S=S.parentElement){let g=W(S),T=parseFloat(g.opacity);if(!Number.isNaN(T))h*=T;if(g.position==="fixed"||g.position==="sticky"&&_(S,g)){F=S;break}if(S!==D&&N(S))y=!0}if(!F&&R)y=!0;return{float:F,scrolled:y,opacity:h}},A=new Map,B=(D,F)=>{let y=document.elementFromPoint(D,F);if(!y||!a8.test(y.tagName))return y;return document.elementsFromPoint(D,F).find((h)=>!a8.test(h.tagName))??null};return $.map((D)=>{let F=new Set,y=new Set,h=[],S=(u)=>{if(y.has(u))return;y.add(u);let C=u.getBoundingClientRect();if(C.width>0&&C.height>0)h.push({top:C.top,bottom:C.bottom,left:C.left,right:C.right})},g=new Set,T=[D.left+6,(D.left+D.right)/2,D.right-6];for(let u=j/2;u<J.h;u+=j)for(let C of T){let x=B(C,u);if(!x||x===Z||x===X||F.has(x))continue;if(F.add(x),Q.extra){let r=null;try{r=x.closest(Q.extra)}catch{r=null}if(r){S(r);continue}}let{float:E,scrolled:p,opacity:u0}=A.get(x)??(A.set(x,I(x)),A.get(x));if(u0<0.05)continue;let G0=x.closest(R7),e=G0&&(!E||E.contains(G0))?G0:null;if(E&&!Y(E.getBoundingClientRect())){let r=e??x;if(!Y(r.getBoundingClientRect()))S(r);continue}if(!p&&(E||!R))g.add(E);if(p||!e||Y(e.getBoundingClientRect()))continue;S(e)}for(let u of g)for(let C of(u??X)?.querySelectorAll(S7)??[]){let x=C.getBoundingClientRect();if(!x.width||!x.height||x.right<=D.left||x.left>=D.right||Y(x)||W(C).visibility==="hidden")continue;let E=A.get(C)??(A.set(C,I(C)),A.get(C));if(E.float!==u||E.scrolled||E.opacity<0.05)continue;let p=B(Math.min(Math.max((x.left+x.right)/2,D.left+6),D.right-6),(x.top+x.bottom)/2);if(p&&p!==C&&!C.contains(p)&&!p.contains(C))continue;S(C)}return h})}var T7="lw-support-chat",A7="lw-support-frame",E7="lw-support-host",t=56,X1=12;function k7($){return typeof $==="number"&&Number.isFinite($)?Math.round(Math.min(Math.max($,32),96)):t}var o=t,x7='<svg viewBox="0 0 24 24" width="26" height="26" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M7.9 20A9 9 0 1 0 4 16.1L2 22Z"/></svg>',f7=`
332
332
  :host { all: initial; }
333
333
  .bubble {
334
- position: fixed; z-index: 2147483000; width: ${d}px; height: ${d}px; border-radius: 50%;
334
+ position: fixed; z-index: 2147483000; width: var(--lw-chat-size, ${t}px); height: var(--lw-chat-size, ${t}px); border-radius: 50%;
335
335
  display: grid; place-items: center; border: 0; cursor: pointer; padding: 0;
336
336
  background: var(--lw-chat-color, #00468f); color: #fff; box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 4px 10px -4px rgba(0, 0, 0, 0.2);
337
337
  transition: transform 150ms ease, background 150ms ease;
338
- font-family: var(--lw-host-font, ${r1});
338
+ font-family: var(--lw-host-font, ${s1});
339
339
  }
340
340
  .bubble:hover { filter: brightness(0.92); transform: translateY(-1px); }
341
341
  .bubble { touch-action: none; }
342
342
  .bubble.dragging { cursor: grabbing; transform: scale(1.06); transition: none; box-shadow: 0 18px 35px -8px rgba(0, 0, 0, 0.4); }
343
343
  .bubble:focus-visible { outline: 3px solid rgba(0, 70, 143, 0.35); outline-offset: 3px; }
344
+ .bubble > svg { width: calc(var(--lw-chat-size, ${t}px) * 0.46); height: calc(var(--lw-chat-size, ${t}px) * 0.46); }
344
345
  .face { display: none; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; pointer-events: none; user-select: none; -webkit-user-drag: none; }
345
346
  .bubble.has-face, .bubble.has-face:hover { background: #fff; }
346
347
  .has-face .face { display: block; }
@@ -362,7 +363,7 @@ iframe.on { visibility: visible; }`,i=document.createElement("iframe"),i.allow="
362
363
  content: ""; position: absolute; top: 50%; right: -4px; width: 10px; height: 10px; background: #fff; border-radius: 2px;
363
364
  transform: translateY(-50%) rotate(45deg); box-shadow: 1px -1px 0 rgba(0, 0, 0, 0.04);
364
365
  }
365
- .label .text { display: block; max-width: min(240px, calc(100vw - ${d+64}px)); overflow: hidden; text-overflow: ellipsis; }
366
+ .label .text { display: block; max-width: min(240px, calc(100vw - var(--lw-chat-size, ${t}px) - 64px)); overflow: hidden; text-overflow: ellipsis; }
366
367
  .at-left .label { right: auto; left: calc(100% + 12px); transform: translate(-4px, -50%); }
367
368
  .at-left .label::after { right: auto; left: -4px; }
368
369
  .new .label { color: var(--lw-chat-color, #00468f); }
@@ -370,7 +371,7 @@ iframe.on { visibility: visible; }`,i=document.createElement("iframe"),i.allow="
370
371
  @media (hover: hover) { .bubble:hover .label { opacity: 1; visibility: visible; pointer-events: auto; transform: translate(0, -50%); } }
371
372
  .unlabelled .label, .bubble.dragging .label, .open .label { display: none; }
372
373
  .panel {
373
- position: fixed; z-index: 2147483001; width: min(380px, calc(100vw - 32px)); height: min(640px, calc(100vh - ${d+Q1+32}px));
374
+ position: fixed; z-index: 2147483001; width: min(380px, calc(100vw - 32px)); height: min(640px, calc(100vh - var(--lw-chat-size, ${t}px) - ${X1+32}px));
374
375
  border-radius: 20px; overflow: hidden; background: #fff; border: 1px solid rgba(15, 23, 42, 0.08);
375
376
  box-shadow: 0 28px 64px -16px rgba(15, 23, 42, 0.3), 0 10px 24px -10px rgba(15, 23, 42, 0.14);
376
377
  animation: in 180ms cubic-bezier(0.16, 1, 0.3, 1);
@@ -383,4 +384,4 @@ iframe.on { visibility: visible; }`,i=document.createElement("iframe"),i.allow="
383
384
  .open .bubble { display: none; }
384
385
  }
385
386
  @media (prefers-reduced-motion: reduce) { .panel { animation: none; } .bubble, .label { transition: none; } }
386
- `,r=null,W0=null,j0=null,H0=null,f=null,U2=null,Y4=null,K0=!1,j1=0,B2=(J)=>J.endsWith("/")?J:`${J}/`,a9=()=>{try{return new URL(_().host).origin}catch{return"*"}};function t9(J,$){let j=new URL("embed/support",B2(J));return j.searchParams.set("realm",$),j.searchParams.set("hand","1"),j.toString()}function e9(J){return/^\/me\/(?:chat|tickets(?:\/[\w-]{1,64})?)$/.test(J)?J:"/me/chat"}function G4(J){return new URL("support-face.webp",B2(J)).toString()}function J7(J){return J+d+Q1-16}var $0=8,$7=200;function j7(J,$,j,Q){return{side:J<j.w/2?"left":"right",x:Q,y:l8(j.h-$-d/2,j.h)}}function l8(J,$){return Math.round(Math.min(Math.max(J,$0),Math.max($0,$-d-$0)))}function Q7(J){return J.side==="right"&&J.y<$7?J7(J.y):0}function z7(J,$){let j=$-(J.y+d+Q1)-16,Q=J.y-Q1-16;if(j>=420||j>=Q)return{bottom:J.y+d+Q1,height:Math.max(240,Math.min(640,j))};return{top:$-J.y+Q1,height:Math.max(240,Math.min(640,Q))}}function r8(J,$,j){return{x:Math.round(Math.min(Math.max(J.x,$0),Math.max($0,j.w-$.w-$0))),y:Math.round(Math.min(Math.max(J.y,$0),Math.max($0,j.h-$.h-$0)))}}function X7(J){return J<=0?"":J>99?"99+":String(J)}function n8(J){if(j1=Math.max(0,Math.floor(J)||0),!U2||!f)return;let $=e(_().locale);U2.textContent=X7(j1),U2.hidden=j1===0,f.setAttribute("aria-label",j1?`${$.chatOpen} · ${$.chatUnread.replace("{n}",String(j1))}`:$.chatOpen),T1()}function Z7(J,$){if(J.own===!1)return null;let j=J.unread>0,Q=typeof J.own==="string"?J.own.trim().slice(0,60):"";return{text:j?$.chatLabelNew:Q||$.chatLabel,shown:!J.open&&(j||!J.opened),isNew:j}}var R1=!1;function T1(){if(!Y4||!f)return;let J=_(),$=J.chat&&J.chat!==!0?J.chat.label:void 0,j=$!==void 0?$:A1?.label,Q=Z7({own:j,unread:j1,opened:R1,open:K0},e(J.locale));f.classList.toggle("unlabelled",!Q),f.classList.toggle("labelled",!!Q?.shown),f.classList.toggle("new",!!Q?.isNew),f.classList.toggle("at-left",(x0??M0).side==="left"),Y4.querySelector(".text").textContent=Q?.text??""}var A1=null;function o8(J,$){if(!$||$.faceUrl===void 0)return G4(J);if($.faceUrl===null)return null;try{return new URL($.faceUrl.replace(/^\//,""),B2(J)).toString()}catch{return G4(J)}}function V7(J){if(A1=J,!r||!f)return;let $=J?.color&&/^#[0-9a-f]{6}$/i.test(J.color)?J.color:null;if($)r.style.setProperty("--lw-chat-color",$);else r.style.removeProperty("--lw-chat-color");let j=W0?.querySelector(".face"),Q=o8(_().host,J);if(_0("now"),j){if(!Q)f.classList.remove("has-face"),j.removeAttribute("src");else if(j.getAttribute("src")!==Q)f.classList.remove("has-face"),j.src=Q}T1()}var C1=null;async function q2(){if(C1)return C1;let J=W7();C1=J;try{await J}finally{if(C1===J)C1=null}}async function W7(){try{let J=_(),$=J.chat&&J.chat!==!0?J.chat:null;if($?.show&&!$.show())return void W2(!1);let j=await g0();if(!j)return void W2(!1);let Q=await fetch(new URL("ingest/support-unread",B2(J.host)).toString(),{headers:{"x-realm-key":J.realmKey,authorization:`Bearer ${j}`}});if(Q.status===404||Q.status===401||Q.status===403)return void W2(!1);if(!Q.ok)return;let z=await Q.json();if(z.look&&typeof z.look==="object")V7(z.look);if(W2(!0),!K0)n8(typeof z.total==="number"?z.total:0)}catch{}}function W2(J){if(!r)return;if(r.style.display=J?"":"none",J)n1(r);if(I0(),J)_0("now")}var M0={side:"right",x:16,y:16},v0=null,K7=380,s8=()=>`lw-support-chat-place:${_().realmKey}`,h0=()=>({w:window.innerWidth,h:window.innerHeight}),S1=!1;function Y7(){let J=E1(_().chat);if(J)M0={side:J.side,x:J.x,y:J.y};try{let $=JSON.parse(localStorage.getItem(s8())??"null"),j=$?.bubble;if(S1=!!j&&(j.side==="left"||j.side==="right")&&typeof j.y==="number"&&Number.isFinite(j.y),S1)M0={...M0,side:j.side,y:j.y};let Q=$?.panel;v0=Q&&typeof Q.x==="number"&&typeof Q.y==="number"&&Number.isFinite(Q.x)&&Number.isFinite(Q.y)?{x:Q.x,y:Q.y,h:typeof Q.h==="number"&&Q.h>=240?Q.h:640}:null,R1=$?.opened===!0}catch{}}function M4(){try{localStorage.setItem(s8(),JSON.stringify({...S1?{bubble:{side:M0.side,y:M0.y}}:{},panel:v0,...R1?{opened:!0}:{}}))}catch{}}var L1=()=>window.location?.pathname??"/",x0=null,g8="",N0=null,U4="";function v8(J,$){let j=h0();if(!N0||N0.w!==j.w||N0.h!==j.h)N0={w:j.w,h:j.h,boxes:new Map};let Q=`${J}:${$}`,z=N0.boxes.get(Q);if(!z){let X=J==="right"?{left:j.w-$-d,right:j.w-$}:{left:$,right:$+d};z=y8([X],j,{extra:P2().extra})[0]??[],N0.boxes.set(Q,z)}return z}var a8=!1;function P2(){let J=_().chat,$=J&&J!==!0?J.avoid:void 0;if($===!1||A1?.avoid===!1)return{on:!1,extra:null};return{on:!0,extra:typeof $==="string"&&$.trim()?$.trim():null}}function G7(){let J=w8(L1(),A1?.places);if(a8=J?.show==="hide",S1||!J||J.show==="hide")return M0;return{side:J.show,x:M0.x,y:J.y}}function t8(){if(!f)return;if(!P2().on)return N0=null,I0();let J=U4,$=h0();N0={w:$.w,h:$.h,boxes:new Map},I0(),D2=U4===J?Math.min(D2+1,q7):0}var U7=400,q7=3,D7=60,K2,h8=0,m8=0,D2=0;function _0(J="later"){if(!r)return;let $=Date.now();if(J!=="later")D2=0;let j=J==="now"?D7:Math.max(0,U7*2**D2-($-m8));if(K2&&h8<=$+j)return;clearTimeout(K2),h8=$+j,K2=setTimeout(()=>{if(K2=void 0,!r||K0||X0?.moved||typeof document<"u"&&document.hidden)return;m8=Date.now(),t8()},j)}var Y2=null,K4="",b8,B4=(J)=>J instanceof Element&&(J===r||/^LW-/.test(J.tagName)),u8=(J)=>{if(!B4(J.target))_0()},p8=(J)=>{if(B4(J.target))return;let $=J.target instanceof Element?J.target.getBoundingClientRect():null,j=h0(),Q=M0.x,z=!!$&&$.width>0&&($.left<Q+d||$.right>j.w-Q-d);_0(z?"soon":"later")},G2=(J)=>{if(!B4(J.target))_0("now")},d8=["popstate","hashchange","pointerup","keyup"];function H7(J){Y2?.disconnect(),Y2=null,clearInterval(b8);for(let $ of d8)window.removeEventListener($,G2,!0);window.removeEventListener("scroll",u8,!0);for(let $ of["transitionend","animationend"])window.removeEventListener($,p8,!0);if(document.removeEventListener("visibilitychange",G2),!J)return;if(typeof MutationObserver<"u")Y2=new MutationObserver(($)=>{if($.some((Q)=>{let z=Q.target;if(z===document.documentElement&&Q.type==="attributes")return!1;return!(z.nodeType===1&&/^LW-/.test(z.tagName))&&z!==r}))_0()}),Y2.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class","style","hidden","open","aria-expanded","disabled","aria-disabled"]});for(let $ of d8)window.addEventListener($,G2,{capture:!0,passive:!0});window.addEventListener("scroll",u8,{capture:!0,passive:!0});for(let $ of["transitionend","animationend"])window.addEventListener($,p8,{capture:!0,passive:!0});document.addEventListener("visibilitychange",G2),K4=L1(),b8=setInterval(()=>{if(L1()===K4)return;K4=L1(),I0(),_0("now")},1000)}function I0(){if(!f||!j0)return;let J=h0(),$=G7(),j=l8($.y,J.h),Q=`${L1()}|${$.side}|${$.x}|${j}`,z=x0&&g8===Q?x0:null,X={side:$.side,x:$.x,y:j},Z=!!N0&&P2().on,W=!K0||!x0?Z?f8(X,v8,J,d,$0,Math.max($0,J.h-d-$0),z):X:x0;if(x0={side:W.side,x:W.x,y:W.y},g8=Q,Z)U4=JSON.stringify([W4(v8(X.side,X.x),X.side==="right"?{left:J.w-X.x-d,right:J.w-X.x}:{left:X.x,right:X.x+d},J.h,d),x0]);let Y=x0,U=Y.y,C=Y.side==="right"?"left":"right";if(f.style.display=a8&&!K0?"none":"",Object.assign(f.style,{[Y.side]:`${Y.x}px`,[C]:"",bottom:`${U}px`,top:""}),v0){let A={w:Math.min(K7,J.w-32),h:Math.min(v0.h,J.h-2*$0)},R=r8(v0,A,J);Object.assign(j0.style,{left:`${R.x}px`,top:`${R.y}px`,right:"",bottom:"",height:`${A.h}px`})}else{let A=z7(Y,J.h);Object.assign(j0.style,{[Y.side]:`${Y.x}px`,[C]:"",bottom:A.bottom!==void 0?`${A.bottom}px`:"",top:A.top!==void 0?`${A.top}px`:"",height:`${A.height}px`})}let F=r&&r.style.display!=="none"&&f.style.display!=="none"?Q7(Y):0,O=F?`${F}px`:"";if(document.documentElement.style.getPropertyValue("--lw-chat-lift")!==O)if(O)document.documentElement.style.setProperty("--lw-chat-lift",O);else document.documentElement.style.removeProperty("--lw-chat-lift");T1()}var X0=null,q4=!1;function M7(J){if(J.button!==0)return;X0={id:J.pointerId,sx:J.clientX,sy:J.clientY,moved:!1};try{f?.setPointerCapture(J.pointerId)}catch{}}function B7(J){if(!X0||J.pointerId!==X0.id||!f)return;if(!X0.moved&&Math.hypot(J.clientX-X0.sx,J.clientY-X0.sy)<6)return;X0.moved=!0,f.classList.add("dragging"),Object.assign(f.style,{left:`${J.clientX-d/2}px`,top:`${J.clientY-d/2}px`,right:"",bottom:""})}function i8(J){if(!X0||J.pointerId!==X0.id)return;let $=X0;if(X0=null,f?.classList.remove("dragging"),!$.moved)return;if(q4=!0,setTimeout(()=>q4=!1,0),J.type==="pointerup")M0=j7(J.clientX,J.clientY,h0(),E1(_().chat)?.x??16),S1=!0,v0=null,M4();if(P2().on)t8();else I0()}var a=null;function D4(J){if(!j0||typeof J.x!=="number"||typeof J.y!=="number"||h0().w<640)return;if(J.phase==="start"){let $=j0.getBoundingClientRect();a={sx:J.x,sy:J.y,x:$.left,y:$.top,lx:J.x,ly:J.y,h:Math.round($.height)||640},H4(!0);return}if(!a)return;if(a.lx=J.x,a.ly=J.y,v0={...r8({x:a.x+(J.x-a.sx),y:a.y+(J.y-a.sy)},{w:j0.offsetWidth,h:a.h},h0()),h:a.h},I0(),J.phase==="end")a=null,H4(!1),M4()}var O1=null;function H4(J){if(O1){for(let $ of["pointermove","pointerup","pointercancel"])window.removeEventListener($,O1,!0);O1=null}if(!J)return;O1=($)=>{if(!a)return H4(!1);if($.type==="pointermove"&&$.buttons!==0)return D4({phase:"move",x:$.screenX,y:$.screenY});let j=$.type==="pointerup";D4({phase:"end",x:j?$.screenX:a.lx,y:j?$.screenY:a.ly})};for(let $ of["pointermove","pointerup","pointercancel"])window.addEventListener($,O1,!0)}var P7=()=>{I0(),_0("now")};function H2(J){H0?.contentWindow?.postMessage({source:n9,...J},a9())}async function F7(J){if(!H0||J.source!==H0.contentWindow)return;let $=J.data;if(!$||$.source!==r9)return;if($.type==="hello"){let j=await g0();if(j)H2({type:"token",token:j,can:["portal"]});return}if($.type==="portal"){n6({returnTo:e9(typeof $.path==="string"?$.path:"")});return}if($.type==="ready")return H2({type:K0?"shown":"hidden"});if($.type==="close")return M2();if($.type==="drag")return D4($);if($.type==="unread"&&typeof $.total==="number")return n8($.total);if($.type==="report")M2(!1),i0({type:"manual",fromChat:!0})}var N7=(J)=>void F7(J);function _7(J){if(K0&&J.key==="Escape")M2()}function P4(){if(!r||!j0||!W0)F2();if(!j0)return;let J=_();if(!H0)H0=document.createElement("iframe"),H0.src=t9(J.host,J.realmKey),H0.title=e(J.locale).chatTitle,H0.setAttribute("allow","clipboard-write"),j0.append(H0);if(K0=!0,!R1)R1=!0,M4();j0.hidden=!1,W0?.querySelector(".wrap")?.classList.add("open"),f?.setAttribute("aria-expanded","true"),T1(),H2({type:"shown"}),H0.focus()}function M2(J=!0){if(!j0)return;if(K0=!1,j0.hidden=!0,W0?.querySelector(".wrap")?.classList.remove("open"),f?.setAttribute("aria-expanded","false"),T1(),H2({type:"hidden"}),J)f?.focus();q2(),I0(),_0("now")}var I7=null,c8=0;function C7(){if(Date.now()-c8<30000)return;c8=Date.now(),q2()}function F2(){if(r||typeof document>"u")return;let J=_();if(!E1(J.chat)||!J.identity)return;let j=e(J.locale);r=document.createElement(l9),r.style.display="none",W0=r.attachShadow({mode:"open"}),W0.innerHTML=`<style>${s9}</style><div class="wrap"><div class="panel" role="dialog" aria-label="${j.chatTitle}" hidden></div><button type="button" class="bubble" aria-expanded="false" aria-haspopup="dialog" aria-label="${j.chatOpen}" title="${j.chatMove}">${o9}<img class="face" alt="" draggable="false" decoding="async"><span class="badge" hidden></span><span class="label" aria-hidden="true"><span class="text"></span></span></button></div>`,j0=W0.querySelector(".panel"),f=W0.querySelector(".bubble"),U2=W0.querySelector(".badge"),Y4=W0.querySelector(".label");let Q=W0.querySelector(".face");Q.addEventListener("load",()=>{if(Q.getAttribute("src"))f?.classList.add("has-face")}),Q.addEventListener("error",()=>f?.classList.remove("has-face")),Q.src=o8(J.host,A1)??G4(J.host),Y7(),I0(),f.addEventListener("click",()=>{if(q4)return;if(K0)M2();else P4()}),f.addEventListener("pointerdown",M7),f.addEventListener("pointermove",B7),f.addEventListener("pointerup",i8),f.addEventListener("pointercancel",i8),document.body.append(r),window.addEventListener("message",N7),document.addEventListener("keydown",_7),window.addEventListener("focus",C7),window.addEventListener("resize",P7),H7(!0);let z;I7=S8(()=>{if(K0)return;clearTimeout(z),z=setTimeout(()=>void q2(),500)}),q2()}var e8=!1;function F4(J={}){if(e8||typeof window>"u")return;if(!k1()){console.error("[debug-capture] configureDebugCapture() must be called before install");return}if(e8=!0,W6(),u4(),y4(),e4(),q6(),J.ui===!1)return;let $=e(_().locale);if(n4((Q)=>{c0(Q.message??$.crashed,"error",{label:$.crashAction,onClick:()=>i0(Q)})}),d6(),!document.querySelector(D1))document.body.append(document.createElement(D1));let j=window.requestIdleCallback;if(j)j(()=>void l0(),{timeout:5000});else setTimeout(()=>void l0(),2000);if(j)j(()=>V4(),{timeout:8000});else setTimeout(()=>V4(),3000);if(_().chat)if(!_().identity)console.warn("[debug-capture] `chat` needs `identity` — a chat is a signed-in person's; the bubble is not shown");else if(j)j(()=>F2(),{timeout:4000});else setTimeout(()=>F2(),1500)}var J3=document.currentScript,o=J3?.dataset??{},O7="rrweb-record.mjs";U6(()=>import(new URL(O7,J3?.src??location.href).href));function L7(J){if(!J)return{};try{let $=JSON.parse(J);if(!$||typeof $!=="object"||Array.isArray($))return{};return Object.fromEntries(Object.entries($).filter(([,j])=>typeof j==="string"&&j.trim()))}catch{return{}}}if(o.host&&o.realmKey)if(_4({host:o.host,realmKey:o.realmKey,app:{name:o.appName??document.title??"app",version:o.appVersion??"0.0.0",environment:o.environment??"production"},module:O4(L7(o.modules)),locale:o.locale==="en"?"en":"th",...o.replay!==void 0?{replay:{seconds:Number(o.replay)||void 0}}:{},...o.identityUrl?{identity:()=>fetch(o.identityUrl,{credentials:"include"}).then((J)=>J.ok?J.text():null).catch(()=>null)}:{},...o.chat!==void 0&&o.chat!=="false"?{chat:o.chat==="left"?{position:"left"}:!0}:{}}),document.body)F4();else document.addEventListener("DOMContentLoaded",()=>F4(),{once:!0});window.lwReportProblem=i0;window.lwOpenSupportChat=P4;})();
387
+ `,d=null,K0=null,j0=null,F0=null,w=null,H2=null,B4=null,Y0=!1,Z1=0,N2=($)=>$.endsWith("/")?$:`${$}/`,w7=()=>{try{return new URL(L().host).origin}catch{return"*"}};function y7($,J){let Q=new URL("embed/support",N2($));return Q.searchParams.set("realm",J),Q.searchParams.set("hand","1"),Q.toString()}function g7($){return/^\/me\/(?:chat|tickets(?:\/[\w-]{1,64})?)$/.test($)?$:"/me/chat"}function N4($){return new URL("support-face.webp",N2($)).toString()}function v7($,J=t){return $+J+X1-16}var Q0=8,b7=200;function m7($,J,Q,j,Z=t){return{side:$<Q.w/2?"left":"right",x:j,y:q3(Q.h-J-Z/2,Q.h,Z)}}function q3($,J,Q=t){return Math.round(Math.min(Math.max($,Q0),Math.max(Q0,J-Q-Q0)))}function h7($,J=t){return $.side==="right"&&$.y<b7?v7($.y,J):0}function u7($,J,Q=t){let j=J-($.y+Q+X1)-16,Z=$.y-X1-16;if(j>=420||j>=Z)return{bottom:$.y+Q+X1,height:Math.max(240,Math.min(640,j))};return{top:J-$.y+X1,height:Math.max(240,Math.min(640,Z))}}function U3($,J,Q){return{x:Math.round(Math.min(Math.max($.x,Q0),Math.max(Q0,Q.w-J.w-Q0))),y:Math.round(Math.min(Math.max($.y,Q0),Math.max(Q0,Q.h-J.h-Q0)))}}function p7($){return $<=0?"":$>99?"99+":String($)}function D3($){if(Z1=Math.max(0,Math.floor($)||0),!H2||!w)return;let J=$0(L().locale);H2.textContent=p7(Z1),H2.hidden=Z1===0,w.setAttribute("aria-label",Z1?`${J.chatOpen} · ${J.chatUnread.replace("{n}",String(Z1))}`:J.chatOpen),E1()}function d7($,J){if($.own===!1)return null;let Q=$.unread>0,j=typeof $.own==="string"?$.own.trim().slice(0,60):"";return{text:Q?J.chatLabelNew:j||J.chatLabel,shown:!$.open&&(Q||!$.opened),isNew:Q}}var T1=!1;function E1(){if(!B4||!w)return;let $=L(),J=$.chat&&$.chat!==!0?$.chat.label:void 0,Q=J!==void 0?J:k1?.label,j=d7({own:Q,unread:Z1,opened:T1,open:Y0},$0($.locale));w.classList.toggle("unlabelled",!j),w.classList.toggle("labelled",!!j?.shown),w.classList.toggle("new",!!j?.isNew),w.classList.toggle("at-left",(f0??P0).side==="left"),B4.querySelector(".text").textContent=j?.text??""}var k1=null;function H3($,J){if(!J||J.faceUrl===void 0)return N4($);if(J.faceUrl===null)return null;try{return new URL(J.faceUrl.replace(/^\//,""),N2($)).toString()}catch{return N4($)}}function i7($){if(k1=$,!d||!w)return;let J=$?.color&&/^#[0-9a-f]{6}$/i.test($.color)?$.color:null;if(J)d.style.setProperty("--lw-chat-color",J);else d.style.removeProperty("--lw-chat-color");let Q=k7($?.size);if(Q!==o){if(o=Q,Q===t)d.style.removeProperty("--lw-chat-size");else d.style.setProperty("--lw-chat-size",`${Q}px`);M0=null,B0()}let j=K0?.querySelector(".face"),Z=H3(L().host,$);if(I0("now"),j){if(!Z)w.classList.remove("has-face"),j.removeAttribute("src");else if(j.getAttribute("src")!==Z)w.classList.remove("has-face"),j.src=Z}E1()}var L1=null;async function F2(){if(L1)return L1;let $=c7();L1=$;try{await $}finally{if(L1===$)L1=null}}async function c7(){try{let $=L(),J=$.chat&&$.chat!==!0?$.chat:null;if(J?.show&&!J.show())return void G2(!1);let Q=await b0();if(!Q)return void G2(!1);let j=await fetch(new URL("ingest/support-unread",N2($.host)).toString(),{headers:{"x-realm-key":$.realmKey,authorization:`Bearer ${Q}`}});if(j.status===404||j.status===401||j.status===403)return void G2(!1);if(!j.ok)return;let Z=await j.json();if(Z.look&&typeof Z.look==="object")i7(Z.look);if(G2(!0),!Y0)D3(typeof Z.total==="number"?Z.total:0)}catch{}}function G2($){if(!d)return;if(d.style.display=$?"":"none",$)a1(d);if(B0(),$)I0("now")}var P0={side:"right",x:16,y:16},m0=null,l7=380,F3=()=>`lw-support-chat-place:${L().realmKey}`,h0=()=>({w:window.innerWidth,h:window.innerHeight}),A1=!1;function r7(){let $=x1(L().chat);if($)P0={side:$.side,x:$.x,y:$.y};try{let J=JSON.parse(localStorage.getItem(F3())??"null"),Q=J?.bubble;if(A1=!!Q&&(Q.side==="left"||Q.side==="right")&&typeof Q.y==="number"&&Number.isFinite(Q.y),A1)P0={...P0,side:Q.side,y:Q.y};let j=J?.panel;m0=j&&typeof j.x==="number"&&typeof j.y==="number"&&Number.isFinite(j.x)&&Number.isFinite(j.y)?{x:j.x,y:j.y,h:typeof j.h==="number"&&j.h>=240?j.h:640}:null,T1=J?.opened===!0}catch{}}function L4(){try{localStorage.setItem(F3(),JSON.stringify({...A1?{bubble:{side:P0.side,y:P0.y}}:{},panel:m0,...T1?{opened:!0}:{}}))}catch{}}var S1=()=>window.location?.pathname??"/",f0=null,Q3="",M0=null,_4="";function j3($,J){let Q=h0();if(!M0||M0.w!==Q.w||M0.h!==Q.h)M0={w:Q.w,h:Q.h,boxes:new Map};let j=`${$}:${J}`,Z=M0.boxes.get(j);if(!Z){let X=$==="right"?{left:Q.w-J-o,right:Q.w-J}:{left:J,right:J+o};Z=J3([X],Q,{extra:_2().extra})[0]??[],M0.boxes.set(j,Z)}return Z}var M3=!1;function _2(){let $=L().chat,J=$&&$!==!0?$.avoid:void 0;if(J===!1||k1?.avoid===!1)return{on:!1,extra:null};return{on:!0,extra:typeof J==="string"&&J.trim()?J.trim():null}}function o7(){let $=$3(S1(),k1?.places);if(M3=$?.show==="hide",A1||!$||$.show==="hide")return P0;return{side:$.show,x:P0.x,y:$.y}}function P3(){if(!w)return;if(!_2().on)return M0=null,B0();let $=_4,J=h0();M0={w:J.w,h:J.h,boxes:new Map},B0(),M2=_4===$?Math.min(M2+1,s7):0}var n7=400,s7=3,a7=60,q2,Z3=0,X3=0,M2=0;function I0($="later"){if(!d)return;let J=Date.now();if($!=="later")M2=0;let Q=$==="now"?a7:Math.max(0,n7*2**M2-(J-X3));if(q2&&Z3<=J+Q)return;clearTimeout(q2),Z3=J+Q,q2=setTimeout(()=>{if(q2=void 0,!d||Y0||V0?.moved||typeof document<"u"&&document.hidden)return;X3=Date.now(),P3()},Q)}var U2=null,P4="",V3,R4=($)=>$ instanceof Element&&($===d||/^LW-/.test($.tagName)),z3=($)=>{if(!R4($.target))I0()},W3=($)=>{if(R4($.target))return;let J=$.target instanceof Element?$.target.getBoundingClientRect():null,Q=h0(),j=P0.x,Z=!!J&&J.width>0&&(J.left<j+o||J.right>Q.w-j-o);I0(Z?"soon":"later")},D2=($)=>{if(!R4($.target))I0("now")},K3=["popstate","hashchange","pointerup","keyup"];function t7($){U2?.disconnect(),U2=null,clearInterval(V3);for(let J of K3)window.removeEventListener(J,D2,!0);window.removeEventListener("scroll",z3,!0);for(let J of["transitionend","animationend"])window.removeEventListener(J,W3,!0);if(document.removeEventListener("visibilitychange",D2),!$)return;if(typeof MutationObserver<"u")U2=new MutationObserver((J)=>{if(J.some((j)=>{let Z=j.target;if(Z===document.documentElement&&j.type==="attributes")return!1;return!(Z.nodeType===1&&/^LW-/.test(Z.tagName))&&Z!==d}))I0()}),U2.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class","style","hidden","open","aria-expanded","disabled","aria-disabled"]});for(let J of K3)window.addEventListener(J,D2,{capture:!0,passive:!0});window.addEventListener("scroll",z3,{capture:!0,passive:!0});for(let J of["transitionend","animationend"])window.addEventListener(J,W3,{capture:!0,passive:!0});document.addEventListener("visibilitychange",D2),P4=S1(),V3=setInterval(()=>{if(S1()===P4)return;P4=S1(),B0(),I0("now")},1000)}function B0(){if(!w||!j0)return;let $=h0(),J=o7(),Q=q3(J.y,$.h,o),j=`${S1()}|${J.side}|${J.x}|${Q}`,Z=f0&&Q3===j?f0:null,X={side:J.side,x:J.x,y:Q},V=!!M0&&_2().on,W=!Y0||!f0?V?e8(X,j3,$,o,Q0,Math.max(Q0,$.h-o-Q0),Z):X:f0;if(f0={side:W.side,x:W.x,y:W.y},Q3=j,V)_4=JSON.stringify([M4(j3(X.side,X.x),X.side==="right"?{left:$.w-X.x-o,right:$.w-X.x}:{left:X.x,right:X.x+o},$.h,o),f0]);let K=f0,Y=K.y,N=K.side==="right"?"left":"right";if(w.style.display=M3&&!Y0?"none":"",Object.assign(w.style,{[K.side]:`${K.x}px`,[N]:"",bottom:`${Y}px`,top:""}),m0){let _={w:Math.min(l7,$.w-32),h:Math.min(m0.h,$.h-2*Q0)},I=U3(m0,_,$);Object.assign(j0.style,{left:`${I.x}px`,top:`${I.y}px`,right:"",bottom:"",height:`${_.h}px`})}else{let _=u7(K,$.h,o);Object.assign(j0.style,{[K.side]:`${K.x}px`,[N]:"",bottom:_.bottom!==void 0?`${_.bottom}px`:"",top:_.top!==void 0?`${_.top}px`:"",height:`${_.height}px`})}let M=d&&d.style.display!=="none"&&w.style.display!=="none"?h7(K,o):0,R=M?`${M}px`:"";if(document.documentElement.style.getPropertyValue("--lw-chat-lift")!==R)if(R)document.documentElement.style.setProperty("--lw-chat-lift",R);else document.documentElement.style.removeProperty("--lw-chat-lift");E1()}var V0=null,C4=!1;function e7($){if($.button!==0)return;$.preventDefault(),V0={id:$.pointerId,sx:$.clientX,sy:$.clientY,moved:!1};try{w?.setPointerCapture($.pointerId)}catch{}}function $$($){if(!V0||$.pointerId!==V0.id||!w)return;if(!V0.moved&&Math.hypot($.clientX-V0.sx,$.clientY-V0.sy)<6)return;V0.moved=!0,w.classList.add("dragging"),Object.assign(w.style,{left:`${$.clientX-o/2}px`,top:`${$.clientY-o/2}px`,right:"",bottom:""})}function Y3($){if(!V0||$.pointerId!==V0.id)return;let J=V0;if(V0=null,w?.classList.remove("dragging"),!J.moved)return;if(C4=!0,setTimeout(()=>C4=!1,0),$.type==="pointerup")P0=m7($.clientX,$.clientY,h0(),x1(L().chat)?.x??16,o),A1=!0,m0=null,L4();if(_2().on)P3();else B0()}var a=null;function I4($){if(!j0||typeof $.x!=="number"||typeof $.y!=="number"||h0().w<640)return;if($.phase==="start"){let J=j0.getBoundingClientRect();a={sx:$.x,sy:$.y,x:J.left,y:J.top,lx:$.x,ly:$.y,h:Math.round(J.height)||640},O4(!0);return}if(!a)return;if(a.lx=$.x,a.ly=$.y,m0={...U3({x:a.x+($.x-a.sx),y:a.y+($.y-a.sy)},{w:j0.offsetWidth,h:a.h},h0()),h:a.h},B0(),$.phase==="end")a=null,O4(!1),L4()}var R1=null;function O4($){if(R1){for(let J of["pointermove","pointerup","pointercancel"])window.removeEventListener(J,R1,!0);R1=null}if(!$)return;R1=(J)=>{if(!a)return O4(!1);if(J.type==="pointermove"&&J.buttons!==0)return I4({phase:"move",x:J.screenX,y:J.screenY});let Q=J.type==="pointerup";I4({phase:"end",x:Q?J.screenX:a.lx,y:Q?J.screenY:a.ly})};for(let J of["pointermove","pointerup","pointercancel"])window.addEventListener(J,R1,!0)}var J$=()=>{B0(),I0("now")};function P2($){F0?.contentWindow?.postMessage({source:E7,...$},w7())}async function Q$($){if(!F0||$.source!==F0.contentWindow)return;let J=$.data;if(!J||J.source!==A7)return;if(J.type==="hello"){let Q=await b0();if(Q)P2({type:"token",token:Q,can:["portal"]});return}if(J.type==="portal"){D8({returnTo:g7(typeof J.path==="string"?J.path:"")});return}if(J.type==="ready")return P2({type:Y0?"shown":"hidden"});if(J.type==="close")return B2();if(J.type==="drag")return I4(J);if(J.type==="unread"&&typeof J.total==="number")return D3(J.total);if(J.type==="report")B2(!1),l0({type:"manual",fromChat:!0})}var j$=($)=>void Q$($);function Z$($){if(Y0&&$.key==="Escape")B2()}function S4(){if(!d||!j0||!K0)C2();if(!j0)return;let $=L();if(!F0)F0=document.createElement("iframe"),F0.src=y7($.host,$.realmKey),F0.title=$0($.locale).chatTitle,F0.setAttribute("allow","clipboard-write"),j0.append(F0);if(Y0=!0,!T1)T1=!0,L4();j0.hidden=!1,K0?.querySelector(".wrap")?.classList.add("open"),w?.setAttribute("aria-expanded","true"),E1(),P2({type:"shown"}),F0.focus()}function B2($=!0){if(!j0)return;if(Y0=!1,j0.hidden=!0,K0?.querySelector(".wrap")?.classList.remove("open"),w?.setAttribute("aria-expanded","false"),E1(),P2({type:"hidden"}),$)w?.focus();F2(),B0(),I0("now")}var X$=null,G3=0;function V$(){if(Date.now()-G3<30000)return;G3=Date.now(),F2()}function C2(){if(d||typeof document>"u")return;let $=L();if(!x1($.chat)||!$.identity)return;let Q=$0($.locale);d=document.createElement(T7),d.style.display="none",K0=d.attachShadow({mode:"open"}),K0.innerHTML=`<style>${f7}</style><div class="wrap"><div class="panel" role="dialog" aria-label="${Q.chatTitle}" hidden></div><button type="button" class="bubble" aria-expanded="false" aria-haspopup="dialog" aria-label="${Q.chatOpen}" title="${Q.chatMove}">${x7}<img class="face" alt="" draggable="false" decoding="async"><span class="badge" hidden></span><span class="label" aria-hidden="true"><span class="text"></span></span></button></div>`,j0=K0.querySelector(".panel"),w=K0.querySelector(".bubble"),H2=K0.querySelector(".badge"),B4=K0.querySelector(".label");let j=K0.querySelector(".face");j.addEventListener("load",()=>{if(j.getAttribute("src"))w?.classList.add("has-face")}),j.addEventListener("error",()=>w?.classList.remove("has-face")),j.src=H3($.host,k1)??N4($.host),r7(),B0(),w.addEventListener("click",()=>{if(C4)return;if(Y0)B2();else S4()}),w.addEventListener("pointerdown",e7),w.addEventListener("pointermove",$$),w.addEventListener("pointerup",Y3),w.addEventListener("pointercancel",Y3),document.body.append(d),window.addEventListener("message",j$),document.addEventListener("keydown",Z$),window.addEventListener("focus",V$),window.addEventListener("resize",J$),t7(!0);let Z;X$=r8(()=>{if(Y0)return;clearTimeout(Z),Z=setTimeout(()=>void F2(),500)}),F2()}var B3=!1;function T4($={}){if(B3||typeof window>"u")return;if(!f1()){console.error("[debug-capture] configureDebugCapture() must be called before install");return}if(B3=!0,M6(),s4(),i4(),W6(),C6(),$.ui===!1)return;let J=$0(L().locale);if(j6((j)=>{r0(j.message??J.crashed,"error",{label:J.crashAction,onClick:()=>l0(j)})}),K8(),!document.querySelector(F1))document.body.append(document.createElement(F1));let Q=window.requestIdleCallback;if(Q)Q(()=>void o0(),{timeout:5000});else setTimeout(()=>void o0(),2000);if(Q)Q(()=>F4(),{timeout:8000});else setTimeout(()=>F4(),3000);if(L().chat)if(!L().identity)console.warn("[debug-capture] `chat` needs `identity` — a chat is a signed-in person's; the bubble is not shown");else if(Q)Q(()=>C2(),{timeout:4000});else setTimeout(()=>C2(),1500)}var N3=document.currentScript,n=N3?.dataset??{},z$="rrweb-record.mjs";_6(()=>import(new URL(z$,N3?.src??location.href).href));function W$($){if(!$)return{};try{let J=JSON.parse($);if(!J||typeof J!=="object"||Array.isArray(J))return{};return Object.fromEntries(Object.entries(J).filter(([,Q])=>typeof Q==="string"&&Q.trim()))}catch{return{}}}if(n.host&&n.realmKey)if(E4({host:n.host,realmKey:n.realmKey,app:{name:n.appName??document.title??"app",version:n.appVersion??"0.0.0",environment:n.environment??"production"},module:f4(W$(n.modules)),locale:n.locale==="en"?"en":"th",...n.replay!==void 0?{replay:{seconds:Number(n.replay)||void 0}}:{},...n.identityUrl?{identity:()=>fetch(n.identityUrl,{credentials:"include"}).then(($)=>$.ok?$.text():null).catch(()=>null)}:{},...n.chat!==void 0&&n.chat!=="false"?{chat:n.chat==="left"?{position:"left"}:!0}:{}}),document.body)T4();else document.addEventListener("DOMContentLoaded",()=>T4(),{once:!0});window.lwReportProblem=l0;window.lwOpenSupportChat=S4;})();