@lightworkai.official/debug-capture 0.14.1 → 0.14.3
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.
- package/README.md +23 -14
- package/dist/debug-capture.js +23 -7
- package/dist/index.mjs +33 -17
- package/dist/ui/strings.d.ts +14 -2
- package/dist/ui/styles.d.ts +1 -1
- package/package.json +1 -1
- package/src/ui/element.ts +180 -61
- package/src/ui/strings.ts +37 -9
- package/src/ui/styles.ts +20 -4
package/README.md
CHANGED
|
@@ -77,24 +77,33 @@ the problem.
|
|
|
77
77
|
| Screenshot | `getDisplayMedia` (captures cross-origin iframes), annotated by the user |
|
|
78
78
|
| Replay | opt-in: the last minute of the page as [rrweb](https://github.com/rrweb-io/rrweb) events, played back on the desk |
|
|
79
79
|
|
|
80
|
-
## Asking the team,
|
|
80
|
+
## Asking the team, not only reporting
|
|
81
81
|
|
|
82
82
|
Where the support desk opens request types to its reporters (ใครขอได้ =
|
|
83
|
-
ผู้แจ้งด้วย, set on the desk), the
|
|
84
|
-
with two cards
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
83
|
+
ผู้แจ้งด้วย, set on the desk), the press asks first —
|
|
84
|
+
**ต้องการให้ทีมช่วยเรื่องอะไร** — with two cards:
|
|
85
|
+
|
|
86
|
+
- **แจ้งปัญหา**: the screen share starts inside that press, then the report
|
|
87
|
+
form, as it has always been.
|
|
88
|
+
- **คำขอ**: the request form straight away, with **no screen share asked
|
|
89
|
+
for**. The person picks what they need from the desk's types — the one chosen
|
|
90
|
+
shows its description and how long the team aims to take, the rest stay one
|
|
91
|
+
line, and from 7 types there is a search — a title and details; the page's
|
|
92
|
+
address travels with it, the page's logs do not.
|
|
93
|
+
|
|
94
|
+
The form then names the choice in its heading (รายงานปัญหา or
|
|
95
|
+
ขอให้ทีมดำเนินการ) and keeps one quiet line to switch — **เป็นคำขอ?
|
|
96
|
+
เลือกเรื่องที่ขอ** or **เป็นปัญหาที่ต้องแก้? แจ้งปัญหาแทน** — with nothing typed
|
|
97
|
+
lost: from a report to คำขอ the screenshot comes along (and can be unticked);
|
|
98
|
+
from a request to แจ้งปัญหา the share is asked for at that press — refused, the
|
|
99
|
+
request stays as it was. A request is filed typed, its steps begun on the
|
|
100
|
+
desk, and never folded into someone else's report as a duplicate.
|
|
92
101
|
|
|
93
102
|
Nothing to configure: the widget reads the desk's offer once the page is idle
|
|
94
|
-
(`GET /ingest/request-types`).
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
`lw-report-submitted`) with `{ id, number, status }`.
|
|
103
|
+
(`GET /ingest/request-types`). A desk that opens nothing, an older desk, an
|
|
104
|
+
offer not read yet, and a crash's "report it" all open the report form as
|
|
105
|
+
they always did. A request sent fires `lw-request-submitted` (cancelable,
|
|
106
|
+
like `lw-report-submitted`) with `{ id, number, status }`.
|
|
98
107
|
|
|
99
108
|
## Session replay
|
|
100
109
|
|
package/dist/debug-capture.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(()=>{var _2=(($)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy($,{get:(z,J)=>(typeof require<"u"?require:z)[J]}):$)(function($){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+$+'" is not supported')});var R2={maxRequests:60,maxConsoleEntries:120,maxActions:80,maxBodyChars:20000},_=null;function z1($){let z=[];if(!$.host?.trim())z.push("host");if(!$.realmKey?.trim())z.push("realmKey");if(!$.app?.name?.trim())z.push("app.name");if(typeof $.module!=="function")z.push("module");if(z.length)throw Error(`[debug-capture] configureDebugCapture is missing: ${z.join(", ")}. `+"See the README — `module` maps a pathname to the part of your app it belongs to.");_=$}function C(){if(!_)throw Error("[debug-capture] configureDebugCapture() has not been called");return _}function q0(){return _!==null}function p(){let $=C().app;return{name:$.name,version:$.version??"0.0.0",environment:$.environment??T2()}}function T2(){if(typeof window>"u")return"unknown";let $=window.location.hostname;if($==="localhost"||$==="127.0.0.1"||$.endsWith(".local"))return"development";return"production"}function o($){let z=_?.capture?.[$];return typeof z==="number"?z:R2[$]}function N0($){let z=_?.module;if(!z)return null;try{return z($)??null}catch{return null}}function x0(){let $=_?.redact;return{headers:$?.headers??[],queryKeys:($?.queryKeys??[]).map((z)=>z.toLowerCase()),bodyKeys:($?.bodyKeys??[]).map((z)=>z.toLowerCase())}}function J1(){return _?.capture?.overlaySelectors??[]}var A2='[contenteditable]:not([contenteditable="false"]), [data-lw-mask]',L2="[data-lw-mask]",$1={fps:1,quality:0.5};function W0(){let $=_?.replay;if(!$)return null;let z=$===!0?{}:$,J=(K,Y)=>typeof K==="number"&&K>0?K:Y,Q=z.maskInputs!==!1,j=z.recordCanvas?{fps:J(typeof z.recordCanvas==="object"?z.recordCanvas.fps:void 0,$1.fps),quality:J(typeof z.recordCanvas==="object"?z.recordCanvas.quality:void 0,$1.quality)}:null;return{seconds:J(z.seconds,60),maskInputs:Q,maskTextSelector:z.maskTextSelector?.trim()||(Q?A2:L2),maskText:z.maskText===!0,blockSelector:z.blockSelector?.trim()||"[data-lw-private]",maxBytes:J(z.maxBytes,4000000),canvas:j}}function Q1($){if(typeof window>"u")return!1;let z;try{z=new URL($,window.location.href)}catch{return!1}if(h2(z))return!1;if(z.origin===window.location.origin)return!0;return(_?.capture?.bodyOrigins??[]).some((J)=>{try{return new URL(J).origin===z.origin}catch{return!1}})}function h2($){if(!_?.host)return!1;try{if(new URL(_.host).origin!==$.origin)return!1}catch{return!1}return $.pathname.startsWith("/ingest/")}function j1($){let z=Object.entries($).map(([J,Q])=>[J.replace(/\/+$/,"")||"/",Q]).sort((J,Q)=>Q[0].length-J[0].length);return(J)=>{let Q=(J||"/").replace(/\/+$/,"")||"/";for(let[j,K]of z)if(Q===j||Q.startsWith(`${j}/`))return{key:j,label:K};return null}}var G0="‹redacted›",E2=/^(authorization|proxy-authorization|cookie|set-cookie|x-[a-z-]*token|x-csrf[a-z-]*|x-xsrf[a-z-]*)$/i,m2=new Set(["access_token","token","id_token","refresh_token","code","secret","client_secret","password","apikey","api_key","signature","x-amz-signature","x-amz-credential"]),g2=/(password|passwd|token|secret|authorization|refresh|client_secret|otp|pin)/i,b2=/[\w.+-]+@[\w-]+\.[\w.-]+/g,p2=/\d(?:[\d\s-]{7,})\d/g;function V0($){return $.replace(b2,G0).replace(p2,G0)}function y2($){if(E2.test($))return!0;return x0().headers.some((J)=>J.toLowerCase()===$.toLowerCase())}function X0($){let z={};for(let[J,Q]of Object.entries($))z[J]=y2(J)?G0:Q;return z}function l($){try{let z=/^https?:\/\//i.test($),J=new URL($,z?void 0:"http://local.invalid"),Q=!1;if(J.searchParams.forEach((j,K)=>{if(m2.has(K.toLowerCase())||x0().queryKeys.includes(K.toLowerCase()))J.searchParams.set(K,G0),Q=!0}),!Q)return $;return z?J.toString():`${J.pathname}${J.search}`}catch{return $}}function b0($,z){if(z>6||$===null||typeof $!=="object")return $;if(Array.isArray($))return $.map((Q)=>b0(Q,z+1));let J={};for(let[Q,j]of Object.entries($)){let K=g2.test(Q)||x0().bodyKeys.some((Y)=>Q.toLowerCase().includes(Y));J[Q]=K?G0:b0(j,z+1)}return J}function F0($,z){if($==null)return null;let J=$,Q=$.trim();if(Q.startsWith("{")||Q.startsWith("["))try{let j=JSON.parse(Q);J=JSON.stringify(b0(j,0))}catch{}if(J.length>z)return`${J.slice(0,z)}… [truncated ${J.length-z} chars]`;return J}var p0=120,y0=40,$0=($,z)=>$.length>z?`${$.slice(0,z)}…`:$,v0=($)=>{try{return decodeURIComponent($)}catch{return $}},e=[],Z1=0,K1=!1;function H0($,z,J,Q){let j=$0(z,p0),K=e[e.length-1];if($==="navigate"&&K?.kind==="click"){let H=j.replace(/^ไปที่\s*/,"");if(K.detail.includes(`→ ${H}`))return K.at=new Date().toISOString(),K;let P=H.split(/[?#]/)[0]??H,M=K.source?v0(K.source.replace(/^→\s*/,"")).split(/[?#]/)[0]:null;if(M&&(P===M||P.startsWith(M)))return K.detail=$0(`${K.detail} → ${H}`,p0),K.source=void 0,K.at=new Date().toISOString(),K}if(K&&K.kind===$&&K.detail===j){if(K.at=new Date().toISOString(),$!=="navigate")K.count=(K.count??1)+1;return K}Z1+=1;let Y={id:`act_${Z1}`,at:new Date().toISOString(),kind:$,detail:j,count:1,source:J,html:k0(Q)};e.push(Y);while(e.length>o("maxActions"))u2(e.shift());return Y}var v2=200000,P0=0;function k0($){if(!$)return;if(P0+$.length>v2)return;return P0+=$.length,$}function u2($){if(!$)return;if(P0-=($.html?.length??0)+($.afterHtml?.length??0),P0<0)P0=0}function C0($){return $ instanceof Element&&Boolean($.closest("[data-debug-reporter]"))}var i2='button, a[href], [role="button"], [role="tab"], [role="menuitem"], [role="option"], [role="switch"], [role="checkbox"], [role="radio"], [role="link"], summary, input, select, textarea',d2={button:"ปุ่ม",a:"ลิงก์",input:"ช่อง",textarea:"ช่อง",select:"ตัวเลือก",summary:"ส่วนขยาย"},Y1={button:"ปุ่ม",tab:"แท็บ",menuitem:"เมนู",option:"ตัวเลือก",switch:"สวิตช์",checkbox:"ช่องเลือก",radio:"ตัวเลือก",link:"ลิงก์"};function c2($){let z=$.getAttribute("role");if(z&&Y1[z])return Y1[z];return d2[$.tagName.toLowerCase()]??"ปุ่ม"}function o2($,z){try{let J=$,Q=0;while(J&&Q<=z){let j=H1(J);if(j&&typeof j.memoizedProps?.onClick==="function")return J;J=J.parentElement,Q+=1}}catch{}return null}function l2($){let z=$.getAttribute("aria-label")?.trim();if(z)return z;let J=$.getAttribute("title")?.trim();if(J)return J;if($ instanceof HTMLInputElement||$ instanceof HTMLTextAreaElement||$ instanceof HTMLSelectElement)return($.getAttribute("placeholder")||$.getAttribute("name")||"").trim();if($ instanceof HTMLImageElement)return($.getAttribute("alt")||"").trim();let Q=($.textContent??"").replace(/\s+/g," ").trim();if(Q)return Q;if($ instanceof HTMLAnchorElement){let j=$.getAttribute("href");if(j?.startsWith("/"))return v0(j)}return""}function n2($){if(!($ instanceof Element))return null;let z=$.closest(i2)??o2($,4);if(!z)return null;let J=z.tagName.toLowerCase();if(J==="html"||J==="body")return null;return z}function r2($){let z=V0(l2($));if(!z)return null;return`${c2($)} “${$0(z,y0)}”`}var F1=6000,s2=4000,a2=/(?:^|\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 t2($){$.querySelectorAll("script, style, link, iframe, object, embed, noscript, canvas, video, audio").forEach((j)=>j.remove());let z=[$,...Array.from($.querySelectorAll("*"))];for(let j of z){for(let Y of Array.from(j.attributes)){let H=Y.name.toLowerCase();if(H.startsWith("on")||H==="srcdoc"||H==="value"||H.startsWith("data-"))j.removeAttribute(Y.name)}if(j instanceof HTMLAnchorElement)j.setAttribute("href","#");if(j instanceof HTMLImageElement)j.removeAttribute("src");let K=j.getAttribute("class");if(K){let Y=K.replace(a2," ").replace(/\s+/g," ").trim();if(Y)j.setAttribute("class",Y);else j.removeAttribute("class")}}let J=document.createTreeWalker($,NodeFilter.SHOW_TEXT),Q=J.nextNode();while(Q){if(Q.nodeValue)Q.nodeValue=V0(Q.nodeValue);Q=J.nextNode()}}function u0($,z,J){try{let Q=$.outerHTML;if(!Q||Q.length>z)return;let j=$.cloneNode(!0);t2(j);let K=j.outerHTML;return K&&K.length<=J?K:void 0}catch{return}}var e2=($)=>u0($,F1,s2),$4=150000,z4=40000,W1=($)=>u0($,$4,z4);function J4($){if(!($ instanceof HTMLInputElement)&&!($ instanceof HTMLTextAreaElement)&&!($ instanceof HTMLSelectElement))return null;let z=$.name||$.id||$.getAttribute("aria-label")||$.getAttribute("placeholder")||$.tagName.toLowerCase();return`ช่อง “${V0(z)}”`}var G1=80;function H1($){let z=Object.keys($).find((J)=>J.startsWith("__reactFiber$")||J.startsWith("__reactInternalInstance$"));return z?$[z]:null}function Q4($){if(typeof $!=="function")return null;try{let z=Function.prototype.toString.call($);return(z.match(/\.(?:push|replace)\(\s*['"`]([^'"`]+)['"`]/)??z.match(/redirect\(\s*['"`]([^'"`]+)['"`]/))?.[1]??null}catch{return null}}function V1($){if(!$)return;return`→ ${$.length>G1?`${$.slice(0,G1)}…`:$}`}function j4($){try{let z=$.closest("a[href]")?.getAttribute("href");if(z&&z.startsWith("/"))return V1(z);let J=H1($),Q=0;while(J&&Q<30){if(typeof J.memoizedProps?.onClick==="function")return V1(Q4(J.memoizedProps.onClick));J=J.return,Q+=1}return}catch{return}}var Z4='[role="dialog"], [role="alertdialog"], [role="menu"], [role="listbox"], [role="status"], [role="alert"]';function K4(){let $=J1();return $.length?$.join(", "):Z4}function Y4($){let z=$.getAttribute("role");if(z==="status"||z==="alert")return"ข้อความแจ้งเตือน";if(z==="menu")return"เมนู";if(z==="listbox")return"รายการตัวเลือก";if(z==="alertdialog")return"กล่องยืนยัน";return"กล่องโต้ตอบ"}function W4($){let z=$.getAttribute("aria-label")?.trim();if(z)return z;let J=$.getAttribute("aria-labelledby");if(J){let K=J.split(/\s+/).map((Y)=>document.getElementById(Y)?.textContent?.trim()??"").filter(Boolean).join(" ");if(K)return K}let j=$.querySelector('[data-slot="dialog-title"], h1, h2, h3, [role="heading"]')?.textContent?.replace(/\s+/g," ").trim();if(j)return j;return($.textContent??"").replace(/\s+/g," ").trim()}function P1($){let z=V0(W4($)),J=Y4($);return z?`เปิด ${J} “${$0(z,y0)}”`:`เปิด ${J}`}var G4='[aria-busy="true"], [role="progressbar"], [data-loading="true"], .animate-pulse, .animate-spin',V4=/กำลังโหลด|กำลังค้นหา|กำลังดำเนินการ|\bloading\b/i;function X4($){if($.querySelector(G4))return!0;return V4.test($.textContent??"")}var F4=400,H4=250,P4=8000;function U4($,z){if(typeof MutationObserver>"u"){z.html=k0(W1($));return}let J=Date.now(),Q=!1,j=()=>{Q=!0,Y.disconnect(),window.clearInterval(H),window.clearTimeout(P)},K=()=>{if(Q)return;if(j(),!$.isConnected)return;z.detail=$0(P1($),p0),z.html=k0(W1($))},Y=new MutationObserver(()=>{J=Date.now()});Y.observe($,{childList:!0,subtree:!0,attributes:!0,characterData:!0});let H=window.setInterval(()=>{if(Q)return;if(!$.isConnected){j();return}if(Date.now()-J>=F4&&!X4($))K()},H4),P=window.setTimeout(K,P4)}function M4($){if(C0($))return;let z=H0("ui",P1($));if(z)U4($,z)}function w4(){if(typeof MutationObserver>"u")return;let $=new WeakSet;new MutationObserver((J)=>{for(let Q of J)for(let j of Array.from(Q.addedNodes)){if(!(j instanceof Element))continue;let K=K4(),Y=j.matches(K)?[j]:Array.from(j.querySelectorAll(K));for(let H of Y){if($.has(H))continue;$.add(H),M4(H)}}}).observe(document.body,{childList:!0,subtree:!0})}var I4=1600,B4=2500;function X1($){return{disabled:$.hasAttribute("disabled")||$.getAttribute("aria-disabled")==="true",busy:$.getAttribute("aria-busy")==="true",text:$0(($.textContent??"").replace(/\s+/g," ").trim(),y0)}}function D4($,z){if(!$.disabled&&z.disabled)return"ปุ่มถูกปิดใช้งานหลังคลิก";if(!$.busy&&z.busy)return"ปุ่มเข้าสู่สถานะกำลังโหลด";if($.text!==z.text&&z.text)return`ข้อความเปลี่ยนเป็น “${z.text}”`;return null}function q4($,z){if(typeof MutationObserver>"u")return;let J=X1($),Q=!1,j=(H,P)=>{if(Q)return;if(Q=!0,K.disconnect(),window.clearTimeout(Y),z.afterNote=H,P)z.afterHtml=k0(u0($,F1,B4))},K=new MutationObserver(()=>{if(!$.isConnected){j("องค์ประกอบหายไปจากหน้าจอ",!1);return}let H=D4(J,X1($));if(H)j(H,!0)});K.observe($,{attributes:!0,attributeFilter:["disabled","aria-disabled","aria-busy","class"],childList:!0,subtree:!0,characterData:!0});let Y=window.setTimeout(()=>{if(!Q&&!$.isConnected){j("องค์ประกอบหายไปจากหน้าจอ",!1);return}Q=!0,K.disconnect()},I4)}function U1(){if(K1||typeof window>"u")return;K1=!0,document.addEventListener("click",(Q)=>{if(C0(Q.target))return;let j=n2(Q.target);if(!j)return;let K=r2(j);if(!K)return;let Y=H0("click",`คลิก ${K}`,j4(j),e2(j));if(Y)q4(j,Y)},{capture:!0,passive:!0}),document.addEventListener("change",(Q)=>{if(C0(Q.target))return;let j=J4(Q.target);if(j)H0("input",`แก้ไข ${j}`)},{capture:!0,passive:!0}),document.addEventListener("submit",(Q)=>{if(C0(Q.target))return;H0("submit","ส่งฟอร์ม")},{capture:!0,passive:!0});let $=()=>H0("navigate",`ไปที่ ${v0(l(location.pathname+location.search))}`),z=history.pushState.bind(history),J=history.replaceState.bind(history);history.pushState=(...Q)=>{let j=z(...Q);return $(),j},history.replaceState=(...Q)=>{let j=J(...Q);return $(),j},window.addEventListener("popstate",$),w4()}function M1(){return e.map(($)=>({...$}))}var w1=2000,O0=[],I1=0,B1=!1;function i0($,z){I1+=1,O0.push({id:`log_${I1}`,at:new Date().toISOString(),level:$,message:z.length>w1?`${z.slice(0,w1)}…`:z});while(O0.length>o("maxConsoleEntries"))O0.shift()}function N4(){let $=new WeakSet;return(z,J)=>{if(typeof J==="object"&&J!==null){if($.has(J))return"[Circular]";$.add(J)}if(typeof J==="bigint")return J.toString();return J}}function D1($){if(typeof $==="string")return $;if($ instanceof Error)return`${$.name}: ${$.message}`;try{let z=JSON.stringify($,N4());if(z!==void 0)return z}catch{}try{return String($)}catch{}try{return Object.prototype.toString.call($)}catch{return`[${typeof $}]`}}function q1(){if(B1||typeof window>"u")return;B1=!0;let $=["log","info","warn","error","debug"];for(let z of $){let J=console[z].bind(console);console[z]=(...Q)=>{i0(z,Q.map(D1).join(" ")),J(...Q)}}window.addEventListener("error",(z)=>{let J=z.filename?` (${z.filename}:${z.lineno}:${z.colno})`:"";i0("exception",`${z.message}${J}`)}),window.addEventListener("unhandledrejection",(z)=>{let J=z.reason instanceof Error?`${z.reason.name}: ${z.reason.message}`:D1(z.reason);i0("unhandledrejection",J)})}function N1(){return O0.map(($)=>({...$}))}var x1=new Set,C1=new Set;function k1($,z){return $.add(z),()=>$.delete(z)}function O1($,z){for(let J of[...$])J(z)}function S1($){return k1(x1,$)}function S0($={type:"manual"}){O1(x1,$)}function f1($){return k1(C1,$)}function _1($){O1(C1,$)}var x4=15000,C4=["ResizeObserver loop","Script error.","Non-Error promise rejection captured"],R1=!1,T1=0;function k4($){return C4.some((z)=>$.includes(z))}function A1($){let z=$.message??"";if(!z||k4(z))return;let J=Date.now();if(J-T1<x4)return;T1=J,_1({...$,message:z})}function L1(){if(R1||typeof window>"u")return;R1=!0,window.addEventListener("error",($)=>{if(!$.message&&!$.error)return;let z=$.error instanceof Error?$.error:null;A1({type:"runtime-error",message:$.message||(z?z.message:"Unknown error"),stack:z?.stack})}),window.addEventListener("unhandledrejection",($)=>{let z=$.reason;A1({type:"unhandledrejection",message:z instanceof Error?z.message:String(z),stack:z instanceof Error?z.stack:void 0})})}var g1=4000,O4=1e6,S4=1e7,f0=[],h1=0,E1=!1;function b1($){f0.push($);while(f0.length>o("maxRequests"))f0.shift()}function p1(){return h1+=1,`req_${h1}`}function m1($){let z={};if(!$)return z;if($ instanceof Headers)$.forEach((J,Q)=>{z[Q]=J});else if(Array.isArray($))for(let[J,Q]of $)z[J]=Q;else Object.assign(z,$);return z}function f4($){let z={};return $.forEach((J,Q)=>{z[Q]=J}),z}function _4($){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 R4($,z){let J="",Q="GET",j={},K=null;if(typeof $==="string")J=$;else if($ instanceof URL)J=$.toString();else J=$.url,Q=$.method||Q,j=m1($.headers);if(z){if(z.method)Q=z.method;if(z.headers)j={...j,...m1(z.headers)};if(z.body!==void 0)K=_4(z.body)}return{method:Q.toUpperCase(),url:J,headers:j,body:K}}function y1($){return!Q1($)}function T4($,z){if(y1(z.url)){z.responseSnippet="[body not captured for this origin]";return}let J=$.headers.get("content-type")??"",Q=Number($.headers.get("content-length")??"0"),j=Q?`, ~${Q} bytes`:"";if(!/json|text|xml|html|javascript|urlencoded/i.test(J)){z.responseSnippet=`[binary ${J||"unknown"}${j}]`;return}if(Q>O4){z.responseSnippet=`[response ${J||"text"}${j} — omitted]`;return}try{$.clone().text().then((K)=>{z.responseSnippet=F0(K,o("maxBodyChars"))}).catch(()=>{})}catch{}}function v1($,z){if(/[?&]_rsc=/.test($))return!0;for(let J of Object.keys(z)){let Q=J.toLowerCase();if(Q==="rsc"||Q==="next-router-prefetch"||Q==="next-router-state-tree")return!0}return!1}function A4(){if(typeof window>"u"||typeof window.fetch!=="function")return;let $=window.fetch.bind(window);window.fetch=Object.assign(async(z,J)=>{let Q=R4(z,J);if(v1(Q.url,Q.headers))return $(z,J);let j={id:p1(),startedAt:new Date().toISOString(),method:Q.method,url:l(Q.url),requestHeaders:X0(Q.headers),requestBody:F0(Q.body,g1),status:null,statusText:null,durationMs:null,via:"fetch"};b1(j);let K=performance.now();try{let Y=await $(z,J);return j.status=Y.status,j.statusText=Y.statusText,j.durationMs=Math.round(performance.now()-K),j.responseHeaders=X0(f4(Y.headers)),T4(Y,j),Y}catch(Y){throw j.durationMs=Math.round(performance.now()-K),j.error=Y instanceof Error?`${Y.name}: ${Y.message}`:String(Y),Y}},$)}function L4(){if(typeof window>"u"||typeof window.XMLHttpRequest!=="function")return;let $=XMLHttpRequest.prototype,z=$.open,J=$.send,Q=function(K,Y){let H=typeof Y==="string"?Y:Y.toString();return this.__lwEntry=v1(H,{})?void 0:{id:p1(),startedAt:"",method:(K||"GET").toUpperCase(),url:l(H),requestHeaders:{},requestBody:null,status:null,statusText:null,durationMs:null,via:"xhr"},z.apply(this,arguments)},j=function(K){let Y=this.__lwEntry;if(Y){Y.startedAt=new Date().toISOString(),Y.requestBody=typeof K==="string"?F0(K,g1):K==null?null:"[non-string body]";let H=performance.now();b1(Y),this.addEventListener("loadend",()=>{if(Y.status=this.status||null,Y.statusText=this.statusText||null,Y.durationMs=Math.round(performance.now()-H),y1(Y.url))Y.responseSnippet="[body not captured for this origin]";else if(this.responseType===""||this.responseType==="text")try{Y.responseSnippet=F0(this.responseText||"",o("maxBodyChars"))}catch{}else{let P=this.getResponseHeader("content-type")??this.responseType;Y.responseSnippet=`[binary ${P}]`}})}return J.apply(this,arguments)};$.open=Q,$.send=j}function u1(){if(E1)return;E1=!0,A4(),L4()}function i1(){let $=f0.map((J)=>({...J})),z=0;for(let J=$.length-1;J>=0;J-=1){let Q=$[J],j=Q?.responseSnippet;if(!Q||typeof j!=="string"||j.length===0)continue;if(z+j.length>S4)Q.responseSnippet=`[response omitted — report size budget reached (${j.length.toLocaleString()} chars)]`;else z+=j.length}return $}var h4=4,d1=3,E4=4000,m4="[data-debug-reporter]",c1=()=>import("@rrweb/record");function o1($){c1=$}var T=[],d0=null,_0=!1;function l1(){if(typeof window>"u"||d0||_0)return;let $=W0();if(!$)return;_0=!0;let z=()=>void g4($);if("requestIdleCallback"in window)window.requestIdleCallback(z,{timeout:3000});else setTimeout(z,1000)}async function g4($){let z;try{z=(await c1()).record}catch(J){_0=!1,console.warn("[debug-capture] session replay could not start:",J);return}if(d0)return;try{d0=z({emit:(J)=>b4(J),checkoutEveryNms:Math.max(1000,$.seconds*1000/2),checkoutEveryNth:E4,maskAllInputs:$.maskInputs,maskTextSelector:$.maskText?"*":$.maskTextSelector,blockSelector:`${$.blockSelector}, ${m4}`,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(J){console.warn("[debug-capture] session replay could not start:",J)}finally{_0=!1}}function b4($){if($.type===h4||T.length===0){if(T.push([]),T.length>d1)T=T.slice(-d1)}T[T.length-1].push($)}function n1($=Date.now()){let z=W0();if(!z||!T.length)return null;let J=$-z.seconds*1000,Q=T.length-1;while(Q>0&&(T[Q][0]?.timestamp??$)>J)Q-=1;let j=T.slice(Q).flat(),K=j[0]?.timestamp,Y=j[j.length-1]?.timestamp;if(K===void 0||Y===void 0)return null;return{events:j,startedAt:new Date(K).toISOString(),endedAt:new Date(Y).toISOString(),durationMs:Math.max(0,Y-K)}}var p4={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:"แจ้งปัญหา",kindProblemHint:"มีอะไรเสีย หรือใช้งานไม่ได้",kindRequest:"คำขอ",kindRequestHint:"ขอให้ทีมทำ เช่น ขอสิทธิ์ ขอแก้ข้อมูล",requestTitle:"ขอให้ทีมดำเนินการ",requestTypeLabel:"เรื่องที่ขอ",requestTarget:"ทีมตั้งใจให้เสร็จภายใน {time}",requestSummaryLabel:"หัวข้อ",requestSummaryPlaceholder:"ขออะไร — สั้น ๆ",requestDetailLabel:"รายละเอียด (ไม่บังคับ)",requestDetailPlaceholder:"สิ่งที่ทีมต้องรู้เพื่อดำเนินการ",requestSubmit:"ส่งคำขอ",requestSubmitted:"ส่งคำขอแล้ว",requestWithShot:"แนบภาพหน้าจอนี้ไปกับคำขอ",requestAnnotateHint:"ทำเครื่องหมายสิ่งที่ขอบนภาพ — วงกรอบ ชี้ลูกศร ไฮไลต์ หรือพิมพ์ข้อความ",draftRestored:"ข้อความที่พิมพ์ไว้ครั้งก่อน ยังไม่ได้ส่ง",draftClear:"ล้าง",requestLeaves:"ไม่ส่งไปกับคำขอ",requestLeavesWhat:"บันทึกการใช้งานของหน้านี้ — ใช้กับการแจ้งปัญหาเท่านั้น",days:"{n} วัน",hours:"{n} ชั่วโมง"},y4={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",kindProblemHint:"Something is broken or not working",kindRequest:"Request",kindRequestHint:"Ask the team to do something, like access or a data change",requestTitle:"Ask the team",requestTypeLabel:"What you need",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"};function R0($){return $==="en"?y4:p4}var v4="lw-debug-toasts",u4=6000,i4=`
|
|
1
|
+
(()=>{var b2=(($)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy($,{get:(z,J)=>(typeof require<"u"?require:z)[J]}):$)(function($){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+$+'" is not supported')});var p2={maxRequests:60,maxConsoleEntries:120,maxActions:80,maxBodyChars:20000},m=null;function X1($){let z=[];if(!$.host?.trim())z.push("host");if(!$.realmKey?.trim())z.push("realmKey");if(!$.app?.name?.trim())z.push("app.name");if(typeof $.module!=="function")z.push("module");if(z.length)throw Error(`[debug-capture] configureDebugCapture is missing: ${z.join(", ")}. `+"See the README — `module` maps a pathname to the part of your app it belongs to.");m=$}function f(){if(!m)throw Error("[debug-capture] configureDebugCapture() has not been called");return m}function f0(){return m!==null}function o(){let $=f().app;return{name:$.name,version:$.version??"0.0.0",environment:$.environment??y2()}}function y2(){if(typeof window>"u")return"unknown";let $=window.location.hostname;if($==="localhost"||$==="127.0.0.1"||$.endsWith(".local"))return"development";return"production"}function t($){let z=m?.capture?.[$];return typeof z==="number"?z:p2[$]}function _0($){let z=m?.module;if(!z)return null;try{return z($)??null}catch{return null}}function S0(){let $=m?.redact;return{headers:$?.headers??[],queryKeys:($?.queryKeys??[]).map((z)=>z.toLowerCase()),bodyKeys:($?.bodyKeys??[]).map((z)=>z.toLowerCase())}}function F1(){return m?.capture?.overlaySelectors??[]}var v2='[contenteditable]:not([contenteditable="false"]), [data-lw-mask]',u2="[data-lw-mask]",V1={fps:1,quality:0.5};function w0(){let $=m?.replay;if(!$)return null;let z=$===!0?{}:$,J=(Z,Y)=>typeof Z==="number"&&Z>0?Z:Y,j=z.maskInputs!==!1,Q=z.recordCanvas?{fps:J(typeof z.recordCanvas==="object"?z.recordCanvas.fps:void 0,V1.fps),quality:J(typeof z.recordCanvas==="object"?z.recordCanvas.quality:void 0,V1.quality)}:null;return{seconds:J(z.seconds,60),maskInputs:j,maskTextSelector:z.maskTextSelector?.trim()||(j?v2:u2),maskText:z.maskText===!0,blockSelector:z.blockSelector?.trim()||"[data-lw-private]",maxBytes:J(z.maxBytes,4000000),canvas:Q}}function H1($){if(typeof window>"u")return!1;let z;try{z=new URL($,window.location.href)}catch{return!1}if(i2(z))return!1;if(z.origin===window.location.origin)return!0;return(m?.capture?.bodyOrigins??[]).some((J)=>{try{return new URL(J).origin===z.origin}catch{return!1}})}function i2($){if(!m?.host)return!1;try{if(new URL(m.host).origin!==$.origin)return!1}catch{return!1}return $.pathname.startsWith("/ingest/")}function w1($){let z=Object.entries($).map(([J,j])=>[J.replace(/\/+$/,"")||"/",j]).sort((J,j)=>j[0].length-J[0].length);return(J)=>{let j=(J||"/").replace(/\/+$/,"")||"/";for(let[Q,Z]of z)if(j===Q||j.startsWith(`${Q}/`))return{key:Q,label:Z};return null}}var P0="‹redacted›",d2=/^(authorization|proxy-authorization|cookie|set-cookie|x-[a-z-]*token|x-csrf[a-z-]*|x-xsrf[a-z-]*)$/i,c2=new Set(["access_token","token","id_token","refresh_token","code","secret","client_secret","password","apikey","api_key","signature","x-amz-signature","x-amz-credential"]),o2=/(password|passwd|token|secret|authorization|refresh|client_secret|otp|pin)/i,l2=/[\w.+-]+@[\w-]+\.[\w.-]+/g,n2=/\d(?:[\d\s-]{7,})\d/g;function U0($){return $.replace(l2,P0).replace(n2,P0)}function r2($){if(d2.test($))return!0;return S0().headers.some((J)=>J.toLowerCase()===$.toLowerCase())}function I0($){let z={};for(let[J,j]of Object.entries($))z[J]=r2(J)?P0:j;return z}function e($){try{let z=/^https?:\/\//i.test($),J=new URL($,z?void 0:"http://local.invalid"),j=!1;if(J.searchParams.forEach((Q,Z)=>{if(c2.has(Z.toLowerCase())||S0().queryKeys.includes(Z.toLowerCase()))J.searchParams.set(Z,P0),j=!0}),!j)return $;return z?J.toString():`${J.pathname}${J.search}`}catch{return $}}function c0($,z){if(z>6||$===null||typeof $!=="object")return $;if(Array.isArray($))return $.map((j)=>c0(j,z+1));let J={};for(let[j,Q]of Object.entries($)){let Z=o2.test(j)||S0().bodyKeys.some((Y)=>j.toLowerCase().includes(Y));J[j]=Z?P0:c0(Q,z+1)}return J}function M0($,z){if($==null)return null;let J=$,j=$.trim();if(j.startsWith("{")||j.startsWith("["))try{let Q=JSON.parse(j);J=JSON.stringify(c0(Q,0))}catch{}if(J.length>z)return`${J.slice(0,z)}… [truncated ${J.length-z} chars]`;return J}var o0=120,l0=40,V0=($,z)=>$.length>z?`${$.slice(0,z)}…`:$,n0=($)=>{try{return decodeURIComponent($)}catch{return $}},G0=[],P1=0,U1=!1;function q0($,z,J,j){let Q=V0(z,o0),Z=G0[G0.length-1];if($==="navigate"&&Z?.kind==="click"){let X=Q.replace(/^ไปที่\s*/,"");if(Z.detail.includes(`→ ${X}`))return Z.at=new Date().toISOString(),Z;let H=X.split(/[?#]/)[0]??X,U=Z.source?n0(Z.source.replace(/^→\s*/,"")).split(/[?#]/)[0]:null;if(U&&(H===U||H.startsWith(U)))return Z.detail=V0(`${Z.detail} → ${X}`,o0),Z.source=void 0,Z.at=new Date().toISOString(),Z}if(Z&&Z.kind===$&&Z.detail===Q){if(Z.at=new Date().toISOString(),$!=="navigate")Z.count=(Z.count??1)+1;return Z}P1+=1;let Y={id:`act_${P1}`,at:new Date().toISOString(),kind:$,detail:Q,count:1,source:J,html:T0(j)};G0.push(Y);while(G0.length>t("maxActions"))a2(G0.shift());return Y}var s2=200000,D0=0;function T0($){if(!$)return;if(D0+$.length>s2)return;return D0+=$.length,$}function a2($){if(!$)return;if(D0-=($.html?.length??0)+($.afterHtml?.length??0),D0<0)D0=0}function R0($){return $ instanceof Element&&Boolean($.closest("[data-debug-reporter]"))}var t2='button, a[href], [role="button"], [role="tab"], [role="menuitem"], [role="option"], [role="switch"], [role="checkbox"], [role="radio"], [role="link"], summary, input, select, textarea',e2={button:"ปุ่ม",a:"ลิงก์",input:"ช่อง",textarea:"ช่อง",select:"ตัวเลือก",summary:"ส่วนขยาย"},I1={button:"ปุ่ม",tab:"แท็บ",menuitem:"เมนู",option:"ตัวเลือก",switch:"สวิตช์",checkbox:"ช่องเลือก",radio:"ตัวเลือก",link:"ลิงก์"};function $4($){let z=$.getAttribute("role");if(z&&I1[z])return I1[z];return e2[$.tagName.toLowerCase()]??"ปุ่ม"}function z4($,z){try{let J=$,j=0;while(J&&j<=z){let Q=x1(J);if(Q&&typeof Q.memoizedProps?.onClick==="function")return J;J=J.parentElement,j+=1}}catch{}return null}function J4($){let z=$.getAttribute("aria-label")?.trim();if(z)return z;let J=$.getAttribute("title")?.trim();if(J)return J;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 Q=$.getAttribute("href");if(Q?.startsWith("/"))return n0(Q)}return""}function j4($){if(!($ instanceof Element))return null;let z=$.closest(t2)??z4($,4);if(!z)return null;let J=z.tagName.toLowerCase();if(J==="html"||J==="body")return null;return z}function Q4($){let z=U0(J4($));if(!z)return null;return`${$4($)} “${V0(z,l0)}”`}var N1=6000,Z4=4000,K4=/(?:^|\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 Y4($){$.querySelectorAll("script, style, link, iframe, object, embed, noscript, canvas, video, audio").forEach((Q)=>Q.remove());let z=[$,...Array.from($.querySelectorAll("*"))];for(let Q of z){for(let Y of Array.from(Q.attributes)){let X=Y.name.toLowerCase();if(X.startsWith("on")||X==="srcdoc"||X==="value"||X.startsWith("data-"))Q.removeAttribute(Y.name)}if(Q instanceof HTMLAnchorElement)Q.setAttribute("href","#");if(Q instanceof HTMLImageElement)Q.removeAttribute("src");let Z=Q.getAttribute("class");if(Z){let Y=Z.replace(K4," ").replace(/\s+/g," ").trim();if(Y)Q.setAttribute("class",Y);else Q.removeAttribute("class")}}let J=document.createTreeWalker($,NodeFilter.SHOW_TEXT),j=J.nextNode();while(j){if(j.nodeValue)j.nodeValue=U0(j.nodeValue);j=J.nextNode()}}function r0($,z,J){try{let j=$.outerHTML;if(!j||j.length>z)return;let Q=$.cloneNode(!0);Y4(Q);let Z=Q.outerHTML;return Z&&Z.length<=J?Z:void 0}catch{return}}var W4=($)=>r0($,N1,Z4),G4=150000,V4=40000,M1=($)=>r0($,G4,V4);function X4($){if(!($ instanceof HTMLInputElement)&&!($ instanceof HTMLTextAreaElement)&&!($ instanceof HTMLSelectElement))return null;let z=$.name||$.id||$.getAttribute("aria-label")||$.getAttribute("placeholder")||$.tagName.toLowerCase();return`ช่อง “${U0(z)}”`}var q1=80;function x1($){let z=Object.keys($).find((J)=>J.startsWith("__reactFiber$")||J.startsWith("__reactInternalInstance$"));return z?$[z]:null}function F4($){if(typeof $!=="function")return null;try{let z=Function.prototype.toString.call($);return(z.match(/\.(?:push|replace)\(\s*['"`]([^'"`]+)['"`]/)??z.match(/redirect\(\s*['"`]([^'"`]+)['"`]/))?.[1]??null}catch{return null}}function D1($){if(!$)return;return`→ ${$.length>q1?`${$.slice(0,q1)}…`:$}`}function H4($){try{let z=$.closest("a[href]")?.getAttribute("href");if(z&&z.startsWith("/"))return D1(z);let J=x1($),j=0;while(J&&j<30){if(typeof J.memoizedProps?.onClick==="function")return D1(F4(J.memoizedProps.onClick));J=J.return,j+=1}return}catch{return}}var w4='[role="dialog"], [role="alertdialog"], [role="menu"], [role="listbox"], [role="status"], [role="alert"]';function P4(){let $=F1();return $.length?$.join(", "):w4}function U4($){let z=$.getAttribute("role");if(z==="status"||z==="alert")return"ข้อความแจ้งเตือน";if(z==="menu")return"เมนู";if(z==="listbox")return"รายการตัวเลือก";if(z==="alertdialog")return"กล่องยืนยัน";return"กล่องโต้ตอบ"}function I4($){let z=$.getAttribute("aria-label")?.trim();if(z)return z;let J=$.getAttribute("aria-labelledby");if(J){let Z=J.split(/\s+/).map((Y)=>document.getElementById(Y)?.textContent?.trim()??"").filter(Boolean).join(" ");if(Z)return Z}let Q=$.querySelector('[data-slot="dialog-title"], h1, h2, h3, [role="heading"]')?.textContent?.replace(/\s+/g," ").trim();if(Q)return Q;return($.textContent??"").replace(/\s+/g," ").trim()}function k1($){let z=U0(I4($)),J=U4($);return z?`เปิด ${J} “${V0(z,l0)}”`:`เปิด ${J}`}var M4='[aria-busy="true"], [role="progressbar"], [data-loading="true"], .animate-pulse, .animate-spin',q4=/กำลังโหลด|กำลังค้นหา|กำลังดำเนินการ|\bloading\b/i;function D4($){if($.querySelector(M4))return!0;return q4.test($.textContent??"")}var B4=400,N4=250,x4=8000;function k4($,z){if(typeof MutationObserver>"u"){z.html=T0(M1($));return}let J=Date.now(),j=!1,Q=()=>{j=!0,Y.disconnect(),window.clearInterval(X),window.clearTimeout(H)},Z=()=>{if(j)return;if(Q(),!$.isConnected)return;z.detail=V0(k1($),o0),z.html=T0(M1($))},Y=new MutationObserver(()=>{J=Date.now()});Y.observe($,{childList:!0,subtree:!0,attributes:!0,characterData:!0});let X=window.setInterval(()=>{if(j)return;if(!$.isConnected){Q();return}if(Date.now()-J>=B4&&!D4($))Z()},N4),H=window.setTimeout(Z,x4)}function C4($){if(R0($))return;let z=q0("ui",k1($));if(z)k4($,z)}function O4(){if(typeof MutationObserver>"u")return;let $=new WeakSet;new MutationObserver((J)=>{for(let j of J)for(let Q of Array.from(j.addedNodes)){if(!(Q instanceof Element))continue;let Z=P4(),Y=Q.matches(Z)?[Q]:Array.from(Q.querySelectorAll(Z));for(let X of Y){if($.has(X))continue;$.add(X),C4(X)}}}).observe(document.body,{childList:!0,subtree:!0})}var f4=1600,_4=2500;function B1($){return{disabled:$.hasAttribute("disabled")||$.getAttribute("aria-disabled")==="true",busy:$.getAttribute("aria-busy")==="true",text:V0(($.textContent??"").replace(/\s+/g," ").trim(),l0)}}function S4($,z){if(!$.disabled&&z.disabled)return"ปุ่มถูกปิดใช้งานหลังคลิก";if(!$.busy&&z.busy)return"ปุ่มเข้าสู่สถานะกำลังโหลด";if($.text!==z.text&&z.text)return`ข้อความเปลี่ยนเป็น “${z.text}”`;return null}function R4($,z){if(typeof MutationObserver>"u")return;let J=B1($),j=!1,Q=(X,H)=>{if(j)return;if(j=!0,Z.disconnect(),window.clearTimeout(Y),z.afterNote=X,H)z.afterHtml=T0(r0($,N1,_4))},Z=new MutationObserver(()=>{if(!$.isConnected){Q("องค์ประกอบหายไปจากหน้าจอ",!1);return}let X=S4(J,B1($));if(X)Q(X,!0)});Z.observe($,{attributes:!0,attributeFilter:["disabled","aria-disabled","aria-busy","class"],childList:!0,subtree:!0,characterData:!0});let Y=window.setTimeout(()=>{if(!j&&!$.isConnected){Q("องค์ประกอบหายไปจากหน้าจอ",!1);return}j=!0,Z.disconnect()},f4)}function C1(){if(U1||typeof window>"u")return;U1=!0,document.addEventListener("click",(j)=>{if(R0(j.target))return;let Q=j4(j.target);if(!Q)return;let Z=Q4(Q);if(!Z)return;let Y=q0("click",`คลิก ${Z}`,H4(Q),W4(Q));if(Y)R4(Q,Y)},{capture:!0,passive:!0}),document.addEventListener("change",(j)=>{if(R0(j.target))return;let Q=X4(j.target);if(Q)q0("input",`แก้ไข ${Q}`)},{capture:!0,passive:!0}),document.addEventListener("submit",(j)=>{if(R0(j.target))return;q0("submit","ส่งฟอร์ม")},{capture:!0,passive:!0});let $=()=>q0("navigate",`ไปที่ ${n0(e(location.pathname+location.search))}`),z=history.pushState.bind(history),J=history.replaceState.bind(history);history.pushState=(...j)=>{let Q=z(...j);return $(),Q},history.replaceState=(...j)=>{let Q=J(...j);return $(),Q},window.addEventListener("popstate",$),O4()}function O1(){return G0.map(($)=>({...$}))}var f1=2000,h0=[],_1=0,S1=!1;function s0($,z){_1+=1,h0.push({id:`log_${_1}`,at:new Date().toISOString(),level:$,message:z.length>f1?`${z.slice(0,f1)}…`:z});while(h0.length>t("maxConsoleEntries"))h0.shift()}function T4(){let $=new WeakSet;return(z,J)=>{if(typeof J==="object"&&J!==null){if($.has(J))return"[Circular]";$.add(J)}if(typeof J==="bigint")return J.toString();return J}}function R1($){if(typeof $==="string")return $;if($ instanceof Error)return`${$.name}: ${$.message}`;try{let z=JSON.stringify($,T4());if(z!==void 0)return z}catch{}try{return String($)}catch{}try{return Object.prototype.toString.call($)}catch{return`[${typeof $}]`}}function T1(){if(S1||typeof window>"u")return;S1=!0;let $=["log","info","warn","error","debug"];for(let z of $){let J=console[z].bind(console);console[z]=(...j)=>{s0(z,j.map(R1).join(" ")),J(...j)}}window.addEventListener("error",(z)=>{let J=z.filename?` (${z.filename}:${z.lineno}:${z.colno})`:"";s0("exception",`${z.message}${J}`)}),window.addEventListener("unhandledrejection",(z)=>{let J=z.reason instanceof Error?`${z.reason.name}: ${z.reason.message}`:R1(z.reason);s0("unhandledrejection",J)})}function h1(){return h0.map(($)=>({...$}))}var A1=new Set,L1=new Set;function E1($,z){return $.add(z),()=>$.delete(z)}function m1($,z){for(let J of[...$])J(z)}function g1($){return E1(A1,$)}function A0($={type:"manual"}){m1(A1,$)}function b1($){return E1(L1,$)}function p1($){m1(L1,$)}var h4=15000,A4=["ResizeObserver loop","Script error.","Non-Error promise rejection captured"],y1=!1,v1=0;function L4($){return A4.some((z)=>$.includes(z))}function u1($){let z=$.message??"";if(!z||L4(z))return;let J=Date.now();if(J-v1<h4)return;v1=J,p1({...$,message:z})}function i1(){if(y1||typeof window>"u")return;y1=!0,window.addEventListener("error",($)=>{if(!$.message&&!$.error)return;let z=$.error instanceof Error?$.error:null;u1({type:"runtime-error",message:$.message||(z?z.message:"Unknown error"),stack:z?.stack})}),window.addEventListener("unhandledrejection",($)=>{let z=$.reason;u1({type:"unhandledrejection",message:z instanceof Error?z.message:String(z),stack:z instanceof Error?z.stack:void 0})})}var l1=4000,E4=1e6,m4=1e7,L0=[],d1=0,c1=!1;function n1($){L0.push($);while(L0.length>t("maxRequests"))L0.shift()}function r1(){return d1+=1,`req_${d1}`}function o1($){let z={};if(!$)return z;if($ instanceof Headers)$.forEach((J,j)=>{z[j]=J});else if(Array.isArray($))for(let[J,j]of $)z[J]=j;else Object.assign(z,$);return z}function g4($){let z={};return $.forEach((J,j)=>{z[j]=J}),z}function b4($){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 p4($,z){let J="",j="GET",Q={},Z=null;if(typeof $==="string")J=$;else if($ instanceof URL)J=$.toString();else J=$.url,j=$.method||j,Q=o1($.headers);if(z){if(z.method)j=z.method;if(z.headers)Q={...Q,...o1(z.headers)};if(z.body!==void 0)Z=b4(z.body)}return{method:j.toUpperCase(),url:J,headers:Q,body:Z}}function s1($){return!H1($)}function y4($,z){if(s1(z.url)){z.responseSnippet="[body not captured for this origin]";return}let J=$.headers.get("content-type")??"",j=Number($.headers.get("content-length")??"0"),Q=j?`, ~${j} bytes`:"";if(!/json|text|xml|html|javascript|urlencoded/i.test(J)){z.responseSnippet=`[binary ${J||"unknown"}${Q}]`;return}if(j>E4){z.responseSnippet=`[response ${J||"text"}${Q} — omitted]`;return}try{$.clone().text().then((Z)=>{z.responseSnippet=M0(Z,t("maxBodyChars"))}).catch(()=>{})}catch{}}function a1($,z){if(/[?&]_rsc=/.test($))return!0;for(let J of Object.keys(z)){let j=J.toLowerCase();if(j==="rsc"||j==="next-router-prefetch"||j==="next-router-state-tree")return!0}return!1}function v4(){if(typeof window>"u"||typeof window.fetch!=="function")return;let $=window.fetch.bind(window);window.fetch=Object.assign(async(z,J)=>{let j=p4(z,J);if(a1(j.url,j.headers))return $(z,J);let Q={id:r1(),startedAt:new Date().toISOString(),method:j.method,url:e(j.url),requestHeaders:I0(j.headers),requestBody:M0(j.body,l1),status:null,statusText:null,durationMs:null,via:"fetch"};n1(Q);let Z=performance.now();try{let Y=await $(z,J);return Q.status=Y.status,Q.statusText=Y.statusText,Q.durationMs=Math.round(performance.now()-Z),Q.responseHeaders=I0(g4(Y.headers)),y4(Y,Q),Y}catch(Y){throw Q.durationMs=Math.round(performance.now()-Z),Q.error=Y instanceof Error?`${Y.name}: ${Y.message}`:String(Y),Y}},$)}function u4(){if(typeof window>"u"||typeof window.XMLHttpRequest!=="function")return;let $=XMLHttpRequest.prototype,z=$.open,J=$.send,j=function(Z,Y){let X=typeof Y==="string"?Y:Y.toString();return this.__lwEntry=a1(X,{})?void 0:{id:r1(),startedAt:"",method:(Z||"GET").toUpperCase(),url:e(X),requestHeaders:{},requestBody:null,status:null,statusText:null,durationMs:null,via:"xhr"},z.apply(this,arguments)},Q=function(Z){let Y=this.__lwEntry;if(Y){Y.startedAt=new Date().toISOString(),Y.requestBody=typeof Z==="string"?M0(Z,l1):Z==null?null:"[non-string body]";let X=performance.now();n1(Y),this.addEventListener("loadend",()=>{if(Y.status=this.status||null,Y.statusText=this.statusText||null,Y.durationMs=Math.round(performance.now()-X),s1(Y.url))Y.responseSnippet="[body not captured for this origin]";else if(this.responseType===""||this.responseType==="text")try{Y.responseSnippet=M0(this.responseText||"",t("maxBodyChars"))}catch{}else{let H=this.getResponseHeader("content-type")??this.responseType;Y.responseSnippet=`[binary ${H}]`}})}return J.apply(this,arguments)};$.open=j,$.send=Q}function t1(){if(c1)return;c1=!0,v4(),u4()}function e1(){let $=L0.map((J)=>({...J})),z=0;for(let J=$.length-1;J>=0;J-=1){let j=$[J],Q=j?.responseSnippet;if(!j||typeof Q!=="string"||Q.length===0)continue;if(z+Q.length>m4)j.responseSnippet=`[response omitted — report size budget reached (${Q.length.toLocaleString()} chars)]`;else z+=Q.length}return $}var i4=4,$2=3,d4=4000,c4="[data-debug-reporter]",z2=()=>import("@rrweb/record");function J2($){z2=$}var g=[],a0=null,E0=!1;function j2(){if(typeof window>"u"||a0||E0)return;let $=w0();if(!$)return;E0=!0;let z=()=>void o4($);if("requestIdleCallback"in window)window.requestIdleCallback(z,{timeout:3000});else setTimeout(z,1000)}async function o4($){let z;try{z=(await z2()).record}catch(J){E0=!1,console.warn("[debug-capture] session replay could not start:",J);return}if(a0)return;try{a0=z({emit:(J)=>l4(J),checkoutEveryNms:Math.max(1000,$.seconds*1000/2),checkoutEveryNth:d4,maskAllInputs:$.maskInputs,maskTextSelector:$.maskText?"*":$.maskTextSelector,blockSelector:`${$.blockSelector}, ${c4}`,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(J){console.warn("[debug-capture] session replay could not start:",J)}finally{E0=!1}}function l4($){if($.type===i4||g.length===0){if(g.push([]),g.length>$2)g=g.slice(-$2)}g[g.length-1].push($)}function Q2($=Date.now()){let z=w0();if(!z||!g.length)return null;let J=$-z.seconds*1000,j=g.length-1;while(j>0&&(g[j][0]?.timestamp??$)>J)j-=1;let Q=g.slice(j).flat(),Z=Q[0]?.timestamp,Y=Q[Q.length-1]?.timestamp;if(Z===void 0||Y===void 0)return null;return{events:Q,startedAt:new Date(Z).toISOString(),endedAt:new Date(Y).toISOString(),durationMs:Math.max(0,Y-Z)}}var n4={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} ชั่วโมง"},r4={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"};function m0($){return $==="en"?r4:n4}var s4="lw-debug-toasts",a4=6000,t4=`
|
|
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
|
-
`,c0=null;function d4(){if(typeof document>"u")return null;if(c0?.isConnected)return c0;let $=document.createElement(v4);$.dataset.debugReporter="true";let z=$.attachShadow({mode:"open"}),J=document.createElement("style");J.textContent=i4;let Q=document.createElement("div");return Q.className="stack",Q.setAttribute("role","status"),Q.setAttribute("aria-live","polite"),z.append(J,Q),document.body.append($),c0=Q,Q}function z0($,z="success",J){let Q=q0()?C().toast:void 0;if(Q){Q({message:$,tone:z,...J?{action:J}:{}});return}let j=d4();if(!j)return;let K=document.createElement("div");K.className="toast",K.dataset.tone=z;let Y=document.createElement("span");Y.className="dot";let H=document.createElement("span");H.textContent=$;let P=document.createElement("button");P.type="button",P.className="close",P.textContent="✕",P.setAttribute("aria-label","ปิด");let M=()=>{window.clearTimeout(x),K.remove()};P.addEventListener("click",M);let x=z==="error"||J?0:window.setTimeout(M,u4);if(K.append(Y,H),J){let N=document.createElement("button");N.type="button",N.className="action",N.textContent=J.label,N.addEventListener("click",()=>{M(),J.onClick()}),K.append(N)}K.append(P),j.append(K)}function r1($,z,J){let Q=$.filter((K)=>Boolean(K.error)||K.status!=null&&K.status>=400).slice(-20).map((K)=>({method:K.method,url:K.url,status:K.status,error:K.error,at:K.startedAt})),j=z.filter((K)=>K.level==="error"||K.level==="exception"||K.level==="unhandledrejection").slice(-20).map((K)=>K.message);return{failedRequests:Q,errors:j,erroredQueries:J.slice(0,20)}}function c4(){let $={memoryUsedMb:null,memoryLimitMb:null,domContentLoadedMs:null,loadEventMs:null};if(typeof performance>"u")return $;let z=performance.memory;if(z)$.memoryUsedMb=Math.round(z.usedJSHeapSize/1024/1024),$.memoryLimitMb=Math.round(z.jsHeapSizeLimit/1024/1024);let[J]=performance.getEntriesByType("navigation");if(J)$.domContentLoadedMs=Math.round(J.domContentLoadedEventEnd),$.loadEventMs=Math.round(J.loadEventEnd);return $}function o0($,z){if(!$)return z;try{return $()}catch{return z}}function s1(){let $=C(),{pathname:z,search:J,href:Q}=window.location;return{capturedAt:new Date().toISOString(),route:{href:Q,pathname:z,search:J},module:N0(z),user:o0($.user,{}),apiHeaders:X0(o0($.headers,{})),app:{name:p().name,version:p().version,environment:p().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:c4(),extra:o0($.extra,{})}}var o4=2;function a1($){let z=i1(),J=N1();return{context:s1(),reason:$.reason,note:$.note,cause:r1(z,J,$.erroredQueries),actionTrail:M1(),network:z,console:J,screenshotDataUrl:$.screenshotDataUrl,screenshotMethod:$.screenshotMethod,replay:n1()??void 0,meta:{generatedBy:"lightwork-debug-capture",schemaVersion:o4}}}async function t1(){if(typeof navigator<"u"&&Boolean(navigator.mediaDevices?.getDisplayMedia)){let J=await l4();if(J.status==="ok")return{dataUrl:J.dataUrl,method:"display-media"};if(J.status==="cancelled")return{dataUrl:null,method:"cancelled"}}let z=await s4();if(z)return{dataUrl:z,method:"html-to-image"};return{dataUrl:null,method:"none"}}async function l4(){let $=null;try{let z={video:{frameRate:30},audio:!1,preferCurrentTab:!0,selfBrowserSurface:"include",surfaceSwitching:"exclude"};$=await navigator.mediaDevices.getDisplayMedia(z);let J=await n4($);return J?{status:"ok",dataUrl:J}:{status:"error"}}catch(z){if(z instanceof DOMException&&(z.name==="NotAllowedError"||z.name==="AbortError"))return{status:"cancelled"};return{status:"error"}}finally{$?.getTracks().forEach((z)=>z.stop())}}async function n4($){let z=document.createElement("video");z.srcObject=$,z.muted=!0,z.playsInline=!0,await new Promise((Y)=>{let H=!1,P=()=>{if(H)return;H=!0,Y()};z.onloadedmetadata=()=>{z.play().then(P).catch(P)},window.setTimeout(P,1500)}),await r4(z);let{videoWidth:J,videoHeight:Q}=z;if(!J||!Q)return null;let j=document.createElement("canvas");j.width=J,j.height=Q;let K=j.getContext("2d");if(!K)return null;K.drawImage(z,0,0,J,Q),z.pause(),z.srcObject=null;try{return j.toDataURL("image/png")}catch{return null}}function r4($){return new Promise((z)=>{let J=!1,Q=()=>{if(J)return;J=!0,z()},j=$;if(typeof j.requestVideoFrameCallback==="function")j.requestVideoFrameCallback(()=>Q()),window.setTimeout(Q,1000);else window.setTimeout(Q,250)})}async function s4(){let $=C().screenshotFallback;if(!$)return null;let z=await $().catch(()=>null);if(!z)return null;try{return await z(document.body,{cacheBust:!0,pixelRatio:Math.min(window.devicePixelRatio||1,2),filter:(J)=>!(J instanceof HTMLElement&&J.dataset?.debugReporter==="true")})}catch{return null}}var a4=2000,t4=0.82,e4=3000000;function $6($){return new Promise((z,J)=>{let Q=new Image;Q.onload=()=>z(Q),Q.onerror=()=>J(Error("could not read the screenshot")),Q.src=$})}async function T0($){try{let z=await $6($),J=Math.max(z.naturalWidth,z.naturalHeight),Q=Math.min(1,a4/J),j=document.createElement("canvas");j.width=Math.max(1,Math.round(z.naturalWidth*Q)),j.height=Math.max(1,Math.round(z.naturalHeight*Q));let K=j.getContext("2d");if(!K)return $;K.fillStyle="#fff",K.fillRect(0,0,j.width,j.height),K.drawImage(z,0,0,j.width,j.height);let Y=t4,H=j.toDataURL("image/jpeg",Y);while(H.length>e4&&Y>0.4)Y-=0.15,H=j.toDataURL("image/jpeg",Y);return H}catch{return $}}var z6=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,J6=/^\d+$/,Q6=/^[0-9a-f]{16,}$/i;function e1($){if($.reason.type==="manual")return null;let z=$.cause?.failedRequests?.[0];if(!z?.url)return null;let J;try{J=new URL(z.url,"http://x").pathname}catch{J=z.url}let Q=J.split("/").map((K)=>z6.test(K)||J6.test(K)||Q6.test(K)?":id":K).join("/"),j=z.status??(z.error?"ERR":"?");return`${z.method??"REQ"} ${Q} ${j}`}var $2=2000000;function A0($){let{screenshotDataUrl:z,replay:J,...Q}=$;return JSON.stringify(Q).length}function z2($,z=2000000){if(A0($)<=z)return $;let J=$.network.map((j)=>({...j})),Q={...$,network:J};for(let j of J){if(A0(Q)<=z)return Q;if(typeof j.responseSnippet==="string"&&j.responseSnippet.length>35)j.responseSnippet="[body dropped — report size budget]";if(typeof j.requestBody==="string"&&j.requestBody.length>35)j.requestBody="[body dropped — report size budget]"}while(Q.network.length>1&&A0(Q)>z)Q.network=Q.network.slice(1);while(Q.console.length>1&&A0(Q)>z)Q.console=Q.console.slice(1);return Q}function U0($){let z="";for(let J=0;J<$.length;J+=32768)z+=String.fromCharCode(...$.subarray(J,J+32768));return btoa(z)}var j6=4,Z6=2,K6=3,Y6=0,W6=new Set(["href","src","action","formaction","xlink:href","data","poster","srcset"]),G6=/^\s*javascript:/i;function V6($,z){let J=$.toLowerCase();if(J.startsWith("on")||J==="srcdoc")return!0;return typeof z==="string"&&G6.test(z)}function J2($,z=!1){if(!$)return;for(let J of Object.keys($)){let Q=$[J];if(V6(J,Q)){if(z)$[J]=null;else delete $[J];continue}if(typeof Q!=="string"||!W6.has(J)||!Q.includes("?"))continue;$[J]=l(Q)}}function l0($){if(!$)return;J2($.attributes);for(let z of $.childNodes??[])l0(z)}function Q2($){let z=JSON.parse(JSON.stringify($));for(let J of z){let Q=J.data;if(!Q||typeof Q!=="object")continue;if(J.type===j6&&typeof Q.href==="string")Q.href=l(Q.href);else if(J.type===Z6)l0(Q.node);else if(J.type===K6&&Q.source===Y6){for(let j of Q.adds??[])l0(j.node);for(let j of Q.attributes??[])J2(j.attributes,!0)}}return z}var X6="session-replay.json.gz",F6="session-replay.json";function H6($){return Boolean($&&$.events.length>0)}async function P6($){if(typeof CompressionStream>"u")return null;try{let z=new Blob([$]).stream().pipeThrough(new CompressionStream("gzip"));return new Uint8Array(await new Response(z).arrayBuffer())}catch{return null}}async function Z2($,z){if(!H6($))return{summary:{omitted:"empty"}};let Q={seconds:Math.round($.durationMs/1000),events:$.events.length,startedAt:$.startedAt,endedAt:$.endedAt},j=Q2($.events),K=await j2(j),Y=!1;if(K.bytes.byteLength>z&&w6(j))j=I6(j),K=await j2(j),Y=!0;let{bytes:H,compressed:P}=K;if(H.byteLength>z)return{summary:{...Q,bytes:H.byteLength,omitted:"too-large"}};return{dataUri:`data:${P?"application/gzip":"application/json"};base64,${U0(H)}`,filename:P?X6:F6,summary:{...Q,events:j.length,bytes:H.byteLength,compressed:P,...Y?{canvasDropped:Y}:{}}}}async function j2($){let z=new TextEncoder().encode(JSON.stringify({events:$})),J=await P6(z);return J?{bytes:J,compressed:!0}:{bytes:z,compressed:!1}}var U6=3,K2=2,M6=9;function Y2($){return $.type===U6&&$.data?.source===M6}function w6($){return $.some(Y2)||$.some((z)=>z.type===K2&&W2(z.data.node))}function W2($){if(!$)return!1;if($.attributes&&"rr_dataURL"in $.attributes)return!0;return($.childNodes??[]).some(W2)}function G2($){if(!$)return;if($.attributes&&"rr_dataURL"in $.attributes)delete $.attributes.rr_dataURL;for(let z of $.childNodes??[])G2(z)}function I6($){let z=[];for(let J of $){if(Y2(J))continue;if(J.type===K2)G2(J.data.node);z.push(J)}return z}var B6=new Set([502,503,504]);class y extends Error{kind;retryAfter;status;constructor($,z,J,Q){super($);this.kind=z;this.retryAfter=J;this.status=Q;this.name="ReportError"}}function D6($){let{screenshotDataUrl:z,replay:J,...Q}=$;return{dataUri:`data:application/json;base64,${U0(new TextEncoder().encode(JSON.stringify(Q)))}`,filename:"debug-bundle.json"}}async function n0(){let $=C().identity;if(!$)return{};try{let z=await $();return z?{authorization:`Bearer ${z}`}:{}}catch{return{}}}async function V2($,z){let J=C(),Q=z2(z,$2),{context:j,note:K}=Q,Y=[];if(Q.screenshotDataUrl){let q=await T0(Q.screenshotDataUrl);Y.push({dataUri:q,filename:"screenshot.jpg"})}Y.push(D6(Q));let H,P=W0();if(P){let q=await Z2(Q.replay,P.maxBytes);if(H=q.summary,"dataUri"in q)Y.push({dataUri:q.dataUri,filename:q.filename})}let M=e1(Q),x={title:$,description:K.trim()||void 0,appName:p().name,category:j.module?.label,routeUrl:j.route.href,priority:"MEDIUM",requesterEmail:j.user.email??void 0,requesterName:j.user.fullName??void 0,customFields:{unit:j.user.unit??"",appVersion:j.app.version,environment:j.app.environment,reasonType:Q.reason.type,appName:p().name,module:j.module?.label??""},context:{...M?{signature:M}:{},capturedAt:j.capturedAt,reason:Q.reason,cause:Q.cause,actionTrail:Q.actionTrail,client:j.client,performance:j.performance,apiHeaders:j.apiHeaders,extra:j.extra,counts:{network:Q.network.length,console:Q.console.length,actions:Q.actionTrail.length},screenshotMethod:Q.screenshotMethod,...H?{replay:H}:{}},attachments:Y},N=await fetch(`${J.host.replace(/\/$/,"")}/ingest/tickets`,{method:"POST",headers:{"content-type":"application/json","x-realm-key":J.realmKey,...await n0()},body:JSON.stringify(x)}).catch(()=>{throw new y("report never left the browser","offline")});if(!N.ok)throw await r0(N);return await N.json()}async function r0($){let z=$.headers.get("retry-after"),J=await $.json().then((Q)=>Q.error).catch(()=>null);if($.status===429)return new y("rate limited","rateLimited",z??void 0);if(B6.has($.status))return new y("desk unavailable","unavailable");return new y(J??`Report failed (${$.status})`,"rejected",void 0,$.status)}var L0=null,M0=null,X2=()=>C().host.replace(/\/$/,"");function s0(){return L0}function J0(){if(M0)return M0;return M0=(async()=>{try{let $=await fetch(`${X2()}/ingest/request-types`,{headers:{"x-realm-key":C().realmKey}}),z=$.ok?await $.json():null;L0=Array.isArray(z?.types)?z.types.filter(q6):[]}catch{L0=[],M0=null}return L0??[]})(),M0}function q6($){let z=$;return!!z&&typeof z.id==="string"&&typeof z.name==="string"}async function F2($){let z=C(),J={};try{J=z.user?.()??{}}catch{J={}}let Q=typeof window>"u"?null:window.location,j={title:$.title,description:$.description.trim()||void 0,ticketTypeId:$.ticketTypeId,appName:p().name,category:Q?N0(Q.pathname)?.label:void 0,routeUrl:Q?.href,priority:"MEDIUM",requesterEmail:J.email??void 0,requesterName:J.fullName??void 0,attachments:$.screenshotDataUrl?[{dataUri:await T0($.screenshotDataUrl),filename:"screenshot.jpg"}]:void 0},K=await fetch(`${X2()}/ingest/tickets`,{method:"POST",headers:{"content-type":"application/json","x-realm-key":z.realmKey,...await n0()},body:JSON.stringify(j)}).catch(()=>{throw new y("request never left the browser","offline")});if(!K.ok)throw await r0(K);return await K.json()}var w0=Math.PI/6;function H2($,z,J){let Q=z.x-$.x,j=z.y-$.y,K=Math.hypot(Q,j),Y=Math.atan2(j,Q),H=[{x:z.x,y:z.y},{x:z.x-J*Math.cos(Y-w0),y:z.y-J*Math.sin(Y-w0)},{x:z.x-J*Math.cos(Y+w0),y:z.y-J*Math.sin(Y+w0)}],P=J*Math.cos(w0)*0.92;if(K<=P)return{shaft:null,head:H};return{shaft:{from:$,to:{x:z.x-P*Math.cos(Y),y:z.y-P*Math.sin(Y)}},head:H}}var a0="#f44336",N6="rgba(250, 204, 21, 0.4)",t0=22,P2="#2563eb",U2=9,M2=11,w2=18,I2=4,h0=8,x6=[{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 B2($,z,J){let Q=[],j=null,K=-1,Y=null,H=null,P=$.getContext("2d");function M(){let Z=$.getBoundingClientRect().width;return Z>0?$.width/Z:1}function x(Z){let G=$.getBoundingClientRect();return{x:(Z.clientX-G.left)/G.width*$.width,y:(Z.clientY-G.top)/G.height*$.height}}function N(Z){let G=Z.size??t0;if(!P)return(Z.text?.length??0)*G*0.6;P.save(),P.font=`600 ${G}px system-ui, sans-serif`;let X=P.measureText(Z.text??"").width;return P.restore(),X}function q(Z){if(Z.tool==="text"){let G=Z.size??t0;return{left:Z.x1,top:Z.y1,right:Z.x1+N(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 f(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=q(Z);if(Z.tool==="text")return[{id:"size",x:G.right,y:G.bottom,cursor:"nwse-resize"}];return x6.map((X)=>({id:X.id,x:G.left+(G.right-G.left)*X.fx,y:G.top+(G.bottom-G.top)*X.fy,cursor:X.cursor}))}function O(Z){let G=q(Z);return{x:G.right+w2*M(),y:G.top-w2*M()}}function L(Z,G,X){let{shaft:V,head:W}=H2({x:G.x1,y:G.y1},{x:G.x2,y:G.y2},Math.max(10,16*X));if(V)Z.lineCap="butt",Z.beginPath(),Z.moveTo(V.from.x,V.from.y),Z.lineTo(V.to.x,V.to.y),Z.stroke();Z.beginPath(),Z.moveTo(W[0].x,W[0].y),Z.lineTo(W[1].x,W[1].y),Z.lineTo(W[2].x,W[2].y),Z.closePath(),Z.fill()}function m(Z,G,X){Z.save(),Z.lineWidth=Math.max(2,3*X),Z.strokeStyle=a0,Z.fillStyle=a0;let V=q(G);if(G.tool==="rect")Z.strokeRect(V.left,V.top,V.right-V.left,V.bottom-V.top);else if(G.tool==="arrow")L(Z,G,X);else if(G.tool==="highlight")Z.fillStyle=N6,Z.fillRect(V.left,V.top,V.right-V.left,V.bottom-V.top);else if(G.tool==="text"&&G.text){let W=G.size??t0;Z.font=`600 ${W}px system-ui, sans-serif`,Z.textBaseline="top";let F=W*0.22;Z.fillStyle="rgba(255,255,255,0.92)",Z.fillRect(V.left-F,V.top-F,V.right-V.left+F*2,V.bottom-V.top+F*2),Z.fillStyle=a0,Z.fillText(G.text,V.left,V.top)}Z.restore()}function a(Z,G,X){let V=q(G);Z.save(),Z.strokeStyle=P2,Z.lineWidth=Math.max(1,1.5*X),Z.setLineDash([6*X,4*X]),Z.strokeRect(V.left,V.top,V.right-V.left,V.bottom-V.top),Z.setLineDash([]);let W=U2*X;for(let w of f(G))Z.fillStyle="#fff",Z.strokeStyle=P2,Z.lineWidth=Math.max(1,1.5*X),Z.beginPath(),Z.rect(w.x-W/2,w.y-W/2,W,W),Z.fill(),Z.stroke();let F=O(G),U=M2*X;Z.beginPath(),Z.arc(F.x,F.y,U,0,Math.PI*2),Z.fillStyle="#dc2626",Z.fill(),Z.strokeStyle="#fff",Z.lineWidth=Math.max(1.5,2*X),Z.beginPath(),Z.moveTo(F.x-U*0.4,F.y-U*0.4),Z.lineTo(F.x+U*0.4,F.y+U*0.4),Z.moveTo(F.x+U*0.4,F.y-U*0.4),Z.lineTo(F.x-U*0.4,F.y+U*0.4),Z.stroke(),Z.restore()}function D(){if(!P)return;let Z=M();if(P.clearRect(0,0,$.width,$.height),P.drawImage(z,0,0,$.width,$.height),Q.forEach((X,V)=>{if(V!==r)m(P,X,Z)}),Y)m(P,Y,Z);let G=Q[K];if(G&&!Y)a(P,G,Z)}function Q0(Z,G,X,V,W){return Math.abs(Z-X)<=W&&Math.abs(G-V)<=W}function h(Z,G){let X=Q[K];if(!X)return null;let V=U2*M()/2+3*M();for(let W of f(X))if(Q0(Z,G,W.x,W.y,V))return W.id;return null}function j0(Z,G){let X=Q[K];if(!X)return!1;let V=O(X);return Q0(Z,G,V.x,V.y,M2*M())}function t(Z,G){let X=6*M();for(let V=Q.length-1;V>=0;V-=1){let W=Q[V];if(W.tool==="arrow"){let U=W.x2-W.x1,w=W.y2-W.y1,I=Math.hypot(U,w)||1,E=Math.max(0,Math.min(1,((Z-W.x1)*U+(G-W.y1)*w)/(I*I)));if(Math.hypot(Z-(W.x1+E*U),G-(W.y1+E*w))<=X+4*M())return V;continue}let F=q(W);if(Z>=F.left-X&&Z<=F.right+X&&G>=F.top-X&&G<=F.bottom+X)return V}return-1}function Z0(Z,G,X,V,W){if(G==="tail"){Z.x1=X.x1+V,Z.y1=X.y1+W;return}if(G==="head"){Z.x2=X.x2+V,Z.y2=X.y2+W;return}if(G==="size"){let f2=(X.size??24)+W;Z.size=Math.max(10,f2);return}let F=q(X),{left:U,top:w,right:I,bottom:E}=F;if(G.includes("w"))U=Math.min(I-h0,U+V);if(G.includes("e"))I=Math.max(U+h0,I+V);if(G.includes("n"))w=Math.min(E-h0,w+W);if(G.includes("s"))E=Math.max(w+h0,E+W);Z.x1=U,Z.y1=w,Z.x2=I,Z.y2=E}function B0(Z,G,X,V){Z.x1=G.x1+X,Z.y1=G.y1+V,Z.x2=G.x2+X,Z.y2=G.y2+V}let S=null,r=-1,k={x:0,y:0,size:24};function g(){let Z=$.getBoundingClientRect().width;return Z>0?Z/$.width:1}function K0(Z,G){if(!P)return Z.length*G*0.6;P.save(),P.font=`600 ${G}px system-ui, sans-serif`;let X=P.measureText(Z||" ").width;return P.restore(),X}function Y0(){if(!S)return;let Z=$.parentElement;if(!Z)return;let G=$.getBoundingClientRect(),X=Z.getBoundingClientRect(),V=g(),W=k.size*V;S.style.left=`${G.left-X.left+k.x*V}px`,S.style.top=`${G.top-X.top+k.y*V}px`,S.style.fontSize=`${W}px`,S.style.width=`${Math.max(40,K0(S.value,W)+W)}px`}function R(Z){let G=S;if(!G)return;S=null;let X=G.value.trim(),V=r;if(r=-1,G.remove(),Z&&X){if(V>=0&&Q[V])Q[V].text=X,K=V;else Q.push({tool:"text",x1:k.x,y1:k.y,x2:k.x,y2:k.y,text:X,size:k.size}),K=Q.length-1;J()}else if(V>=0)K=V;$.focus(),D()}function u(Z,G,X=-1){R(!0);let V=$.parentElement;if(!V)return;if(getComputedStyle(V).position==="static")V.style.position="relative";let W=X>=0?Q[X]:void 0;r=X,k={x:W?.x1??Z,y:W?.y1??G,size:W?.size??Math.round(24*M())};let F=document.createElement("input");F.type="text",F.className="text-edit",F.value=W?.text??"",F.setAttribute("aria-label","ข้อความบนภาพ"),F.placeholder="ข้อความ",S=F,V.append(F),Y0(),F.addEventListener("input",Y0),F.addEventListener("keydown",(U)=>{if(U.stopPropagation(),U.key==="Enter")R(!0);else if(U.key==="Escape")R(!1)}),requestAnimationFrame(()=>{if(S!==F)return;F.focus(),F.select(),F.addEventListener("blur",()=>R(!0))}),D()}function i(Z){let{x:G,y:X}=x(Z);if($.setPointerCapture(Z.pointerId),j0(G,X)){c();return}let V=h(G,X);if(V&&Q[K]){H={grip:V,x:G,y:X,start:{...Q[K]}};return}if(j==="text"){if(Z.preventDefault(),$.hasPointerCapture(Z.pointerId))$.releasePointerCapture(Z.pointerId);j=null,J(),u(G,X);return}if(j){Y={tool:j,x1:G,y1:X,x2:G,y2:X},K=-1;return}let W=t(G,X);K=W,H=W>=0?{grip:"body",x:G,y:X,start:{...Q[W]}}:null,D()}function d(Z){let{x:G,y:X}=x(Z);if(Y){Y.x2=G,Y.y2=X,D();return}if(H){let W=Q[K];if(!W)return;let F=G-H.x,U=X-H.y;if(H.grip==="body")B0(W,H.start,F,U);else Z0(W,H.grip,H.start,F,U);D();return}if(j){$.style.cursor="crosshair";return}if(j0(G,X)){$.style.cursor="pointer";return}let V=h(G,X);if(V){let W=Q[K]?f(Q[K]).find((F)=>F.id===V):null;$.style.cursor=W?.cursor??"pointer";return}$.style.cursor=t(G,X)>=0?"move":"default"}function s(){if(Y){if(!(Math.abs(Y.x2-Y.x1)<I2&&Math.abs(Y.y2-Y.y1)<I2))Q.push(Y),K=Q.length-1,j=null,J();Y=null}if(H)H=null,J();D()}function D0(Z){let G=$.getBoundingClientRect(),X=(Z.clientX-G.left)/G.width*$.width,V=(Z.clientY-G.top)/G.height*$.height,W=t(X,V),F=Q[W];if(!F||F.tool!=="text")return;Z.preventDefault(),u(F.x1,F.y1,W)}function b(Z){if(K<0)return;if(Z.key==="Delete"||Z.key==="Backspace")Z.preventDefault(),c();else if(Z.key==="Escape")Z.preventDefault(),K=-1,D()}function c(){if(K<0)return;Q.splice(K,1),K=-1,J(),D()}return $.addEventListener("pointerdown",i),$.addEventListener("pointermove",d),$.addEventListener("pointerup",s),$.addEventListener("pointercancel",s),$.addEventListener("dblclick",D0),$.tabIndex=0,$.addEventListener("keydown",b),D(),{setTool(Z){j=Z,K=-1,$.style.cursor=Z?"crosshair":"default",D()},deleteSelected:c,clear(){Q.length=0,K=-1,J(),D()},hasShapes:()=>Q.length>0,hasSelection:()=>K>=0,toDataUrl(){let Z=document.createElement("canvas");Z.width=z.naturalWidth,Z.height=z.naturalHeight;let G=Z.getContext("2d");if(!G)return $.toDataURL("image/png");G.drawImage(z,0,0);let X=M();for(let V of Q)m(G,V,X);return Z.toDataURL("image/png")},destroy(){R(!1),$.removeEventListener("pointerdown",i),$.removeEventListener("pointermove",d),$.removeEventListener("pointerup",s),$.removeEventListener("pointercancel",s),$.removeEventListener("dblclick",D0),$.removeEventListener("keydown",b)}}}var C6=["keydown","keyup","keypress"];function D2($){for(let z of C6)$.addEventListener(z,(J)=>J.stopPropagation())}var q2=`
|
|
33
|
+
`,t0=null;function e4(){if(typeof document>"u")return null;if(t0?.isConnected)return t0;let $=document.createElement(s4);$.dataset.debugReporter="true";let z=$.attachShadow({mode:"open"}),J=document.createElement("style");J.textContent=t4;let j=document.createElement("div");return j.className="stack",j.setAttribute("role","status"),j.setAttribute("aria-live","polite"),z.append(J,j),document.body.append($),t0=j,j}function X0($,z="success",J){let j=f0()?f().toast:void 0;if(j){j({message:$,tone:z,...J?{action:J}:{}});return}let Q=e4();if(!Q)return;let Z=document.createElement("div");Z.className="toast",Z.dataset.tone=z;let Y=document.createElement("span");Y.className="dot";let X=document.createElement("span");X.textContent=$;let H=document.createElement("button");H.type="button",H.className="close",H.textContent="✕",H.setAttribute("aria-label","ปิด");let U=()=>{window.clearTimeout(A),Z.remove()};H.addEventListener("click",U);let A=z==="error"||J?0:window.setTimeout(U,a4);if(Z.append(Y,X),J){let k=document.createElement("button");k.type="button",k.className="action",k.textContent=J.label,k.addEventListener("click",()=>{U(),J.onClick()}),Z.append(k)}Z.append(H),Q.append(Z)}function Z2($,z,J){let j=$.filter((Z)=>Boolean(Z.error)||Z.status!=null&&Z.status>=400).slice(-20).map((Z)=>({method:Z.method,url:Z.url,status:Z.status,error:Z.error,at:Z.startedAt})),Q=z.filter((Z)=>Z.level==="error"||Z.level==="exception"||Z.level==="unhandledrejection").slice(-20).map((Z)=>Z.message);return{failedRequests:j,errors:Q,erroredQueries:J.slice(0,20)}}function $6(){let $={memoryUsedMb:null,memoryLimitMb:null,domContentLoadedMs:null,loadEventMs:null};if(typeof performance>"u")return $;let z=performance.memory;if(z)$.memoryUsedMb=Math.round(z.usedJSHeapSize/1024/1024),$.memoryLimitMb=Math.round(z.jsHeapSizeLimit/1024/1024);let[J]=performance.getEntriesByType("navigation");if(J)$.domContentLoadedMs=Math.round(J.domContentLoadedEventEnd),$.loadEventMs=Math.round(J.loadEventEnd);return $}function e0($,z){if(!$)return z;try{return $()}catch{return z}}function K2(){let $=f(),{pathname:z,search:J,href:j}=window.location;return{capturedAt:new Date().toISOString(),route:{href:j,pathname:z,search:J},module:_0(z),user:e0($.user,{}),apiHeaders:I0(e0($.headers,{})),app:{name:o().name,version:o().version,environment:o().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:$6(),extra:e0($.extra,{})}}var z6=2;function g0($){let z=e1(),J=h1();return{context:K2(),reason:$.reason,note:$.note,cause:Z2(z,J,$.erroredQueries),actionTrail:O1(),network:z,console:J,screenshotDataUrl:$.screenshotDataUrl,screenshotMethod:$.screenshotMethod,replay:Q2()??void 0,meta:{generatedBy:"lightwork-debug-capture",schemaVersion:z6}}}async function $1(){if(typeof navigator<"u"&&Boolean(navigator.mediaDevices?.getDisplayMedia)){let J=await J6();if(J.status==="ok")return{dataUrl:J.dataUrl,method:"display-media"};if(J.status==="cancelled")return{dataUrl:null,method:"cancelled"}}let z=await Z6();if(z)return{dataUrl:z,method:"html-to-image"};return{dataUrl:null,method:"none"}}async function J6(){let $=null;try{let z={video:{frameRate:30},audio:!1,preferCurrentTab:!0,selfBrowserSurface:"include",surfaceSwitching:"exclude"};$=await navigator.mediaDevices.getDisplayMedia(z);let J=await j6($);return J?{status:"ok",dataUrl:J}:{status:"error"}}catch(z){if(z instanceof DOMException&&(z.name==="NotAllowedError"||z.name==="AbortError"))return{status:"cancelled"};return{status:"error"}}finally{$?.getTracks().forEach((z)=>z.stop())}}async function j6($){let z=document.createElement("video");z.srcObject=$,z.muted=!0,z.playsInline=!0,await new Promise((Y)=>{let X=!1,H=()=>{if(X)return;X=!0,Y()};z.onloadedmetadata=()=>{z.play().then(H).catch(H)},window.setTimeout(H,1500)}),await Q6(z);let{videoWidth:J,videoHeight:j}=z;if(!J||!j)return null;let Q=document.createElement("canvas");Q.width=J,Q.height=j;let Z=Q.getContext("2d");if(!Z)return null;Z.drawImage(z,0,0,J,j),z.pause(),z.srcObject=null;try{return Q.toDataURL("image/png")}catch{return null}}function Q6($){return new Promise((z)=>{let J=!1,j=()=>{if(J)return;J=!0,z()},Q=$;if(typeof Q.requestVideoFrameCallback==="function")Q.requestVideoFrameCallback(()=>j()),window.setTimeout(j,1000);else window.setTimeout(j,250)})}async function Z6(){let $=f().screenshotFallback;if(!$)return null;let z=await $().catch(()=>null);if(!z)return null;try{return await z(document.body,{cacheBust:!0,pixelRatio:Math.min(window.devicePixelRatio||1,2),filter:(J)=>!(J instanceof HTMLElement&&J.dataset?.debugReporter==="true")})}catch{return null}}var K6=2000,Y6=0.82,W6=3000000;function G6($){return new Promise((z,J)=>{let j=new Image;j.onload=()=>z(j),j.onerror=()=>J(Error("could not read the screenshot")),j.src=$})}async function b0($){try{let z=await G6($),J=Math.max(z.naturalWidth,z.naturalHeight),j=Math.min(1,K6/J),Q=document.createElement("canvas");Q.width=Math.max(1,Math.round(z.naturalWidth*j)),Q.height=Math.max(1,Math.round(z.naturalHeight*j));let Z=Q.getContext("2d");if(!Z)return $;Z.fillStyle="#fff",Z.fillRect(0,0,Q.width,Q.height),Z.drawImage(z,0,0,Q.width,Q.height);let Y=Y6,X=Q.toDataURL("image/jpeg",Y);while(X.length>W6&&Y>0.4)Y-=0.15,X=Q.toDataURL("image/jpeg",Y);return X}catch{return $}}var V6=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,X6=/^\d+$/,F6=/^[0-9a-f]{16,}$/i;function Y2($){if($.reason.type==="manual")return null;let z=$.cause?.failedRequests?.[0];if(!z?.url)return null;let J;try{J=new URL(z.url,"http://x").pathname}catch{J=z.url}let j=J.split("/").map((Z)=>V6.test(Z)||X6.test(Z)||F6.test(Z)?":id":Z).join("/"),Q=z.status??(z.error?"ERR":"?");return`${z.method??"REQ"} ${j} ${Q}`}var W2=2000000;function p0($){let{screenshotDataUrl:z,replay:J,...j}=$;return JSON.stringify(j).length}function G2($,z=2000000){if(p0($)<=z)return $;let J=$.network.map((Q)=>({...Q})),j={...$,network:J};for(let Q of J){if(p0(j)<=z)return j;if(typeof Q.responseSnippet==="string"&&Q.responseSnippet.length>35)Q.responseSnippet="[body dropped — report size budget]";if(typeof Q.requestBody==="string"&&Q.requestBody.length>35)Q.requestBody="[body dropped — report size budget]"}while(j.network.length>1&&p0(j)>z)j.network=j.network.slice(1);while(j.console.length>1&&p0(j)>z)j.console=j.console.slice(1);return j}function B0($){let z="";for(let J=0;J<$.length;J+=32768)z+=String.fromCharCode(...$.subarray(J,J+32768));return btoa(z)}var H6=4,w6=2,P6=3,U6=0,I6=new Set(["href","src","action","formaction","xlink:href","data","poster","srcset"]),M6=/^\s*javascript:/i;function q6($,z){let J=$.toLowerCase();if(J.startsWith("on")||J==="srcdoc")return!0;return typeof z==="string"&&M6.test(z)}function V2($,z=!1){if(!$)return;for(let J of Object.keys($)){let j=$[J];if(q6(J,j)){if(z)$[J]=null;else delete $[J];continue}if(typeof j!=="string"||!I6.has(J)||!j.includes("?"))continue;$[J]=e(j)}}function z1($){if(!$)return;V2($.attributes);for(let z of $.childNodes??[])z1(z)}function X2($){let z=JSON.parse(JSON.stringify($));for(let J of z){let j=J.data;if(!j||typeof j!=="object")continue;if(J.type===H6&&typeof j.href==="string")j.href=e(j.href);else if(J.type===w6)z1(j.node);else if(J.type===P6&&j.source===U6){for(let Q of j.adds??[])z1(Q.node);for(let Q of j.attributes??[])V2(Q.attributes,!0)}}return z}var D6="session-replay.json.gz",B6="session-replay.json";function N6($){return Boolean($&&$.events.length>0)}async function x6($){if(typeof CompressionStream>"u")return null;try{let z=new Blob([$]).stream().pipeThrough(new CompressionStream("gzip"));return new Uint8Array(await new Response(z).arrayBuffer())}catch{return null}}async function H2($,z){if(!N6($))return{summary:{omitted:"empty"}};let j={seconds:Math.round($.durationMs/1000),events:$.events.length,startedAt:$.startedAt,endedAt:$.endedAt},Q=X2($.events),Z=await F2(Q),Y=!1;if(Z.bytes.byteLength>z&&O6(Q))Q=f6(Q),Z=await F2(Q),Y=!0;let{bytes:X,compressed:H}=Z;if(X.byteLength>z)return{summary:{...j,bytes:X.byteLength,omitted:"too-large"}};return{dataUri:`data:${H?"application/gzip":"application/json"};base64,${B0(X)}`,filename:H?D6:B6,summary:{...j,events:Q.length,bytes:X.byteLength,compressed:H,...Y?{canvasDropped:Y}:{}}}}async function F2($){let z=new TextEncoder().encode(JSON.stringify({events:$})),J=await x6(z);return J?{bytes:J,compressed:!0}:{bytes:z,compressed:!1}}var k6=3,w2=2,C6=9;function P2($){return $.type===k6&&$.data?.source===C6}function O6($){return $.some(P2)||$.some((z)=>z.type===w2&&U2(z.data.node))}function U2($){if(!$)return!1;if($.attributes&&"rr_dataURL"in $.attributes)return!0;return($.childNodes??[]).some(U2)}function I2($){if(!$)return;if($.attributes&&"rr_dataURL"in $.attributes)delete $.attributes.rr_dataURL;for(let z of $.childNodes??[])I2(z)}function f6($){let z=[];for(let J of $){if(P2(J))continue;if(J.type===w2)I2(J.data.node);z.push(J)}return z}var _6=new Set([502,503,504]);class l extends Error{kind;retryAfter;status;constructor($,z,J,j){super($);this.kind=z;this.retryAfter=J;this.status=j;this.name="ReportError"}}function S6($){let{screenshotDataUrl:z,replay:J,...j}=$;return{dataUri:`data:application/json;base64,${B0(new TextEncoder().encode(JSON.stringify(j)))}`,filename:"debug-bundle.json"}}async function J1(){let $=f().identity;if(!$)return{};try{let z=await $();return z?{authorization:`Bearer ${z}`}:{}}catch{return{}}}async function M2($,z){let J=f(),j=G2(z,W2),{context:Q,note:Z}=j,Y=[];if(j.screenshotDataUrl){let x=await b0(j.screenshotDataUrl);Y.push({dataUri:x,filename:"screenshot.jpg"})}Y.push(S6(j));let X,H=w0();if(H){let x=await H2(j.replay,H.maxBytes);if(X=x.summary,"dataUri"in x)Y.push({dataUri:x.dataUri,filename:x.filename})}let U=Y2(j),A={title:$,description:Z.trim()||void 0,appName:o().name,category:Q.module?.label,routeUrl:Q.route.href,priority:"MEDIUM",requesterEmail:Q.user.email??void 0,requesterName:Q.user.fullName??void 0,customFields:{unit:Q.user.unit??"",appVersion:Q.app.version,environment:Q.app.environment,reasonType:j.reason.type,appName:o().name,module:Q.module?.label??""},context:{...U?{signature:U}:{},capturedAt:Q.capturedAt,reason:j.reason,cause:j.cause,actionTrail:j.actionTrail,client:Q.client,performance:Q.performance,apiHeaders:Q.apiHeaders,extra:Q.extra,counts:{network:j.network.length,console:j.console.length,actions:j.actionTrail.length},screenshotMethod:j.screenshotMethod,...X?{replay:X}:{}},attachments:Y},k=await fetch(`${J.host.replace(/\/$/,"")}/ingest/tickets`,{method:"POST",headers:{"content-type":"application/json","x-realm-key":J.realmKey,...await J1()},body:JSON.stringify(A)}).catch(()=>{throw new l("report never left the browser","offline")});if(!k.ok)throw await j1(k);return await k.json()}async function j1($){let z=$.headers.get("retry-after"),J=await $.json().then((j)=>j.error).catch(()=>null);if($.status===429)return new l("rate limited","rateLimited",z??void 0);if(_6.has($.status))return new l("desk unavailable","unavailable");return new l(J??`Report failed (${$.status})`,"rejected",void 0,$.status)}var y0=null,N0=null,q2=()=>f().host.replace(/\/$/,"");function Q1(){return y0}function F0(){if(N0)return N0;return N0=(async()=>{try{let $=await fetch(`${q2()}/ingest/request-types`,{headers:{"x-realm-key":f().realmKey}}),z=$.ok?await $.json():null;y0=Array.isArray(z?.types)?z.types.filter(R6):[]}catch{y0=[],N0=null}return y0??[]})(),N0}function R6($){let z=$;return!!z&&typeof z.id==="string"&&typeof z.name==="string"}async function D2($){let z=f(),J={};try{J=z.user?.()??{}}catch{J={}}let j=typeof window>"u"?null:window.location,Q={title:$.title,description:$.description.trim()||void 0,ticketTypeId:$.ticketTypeId,appName:o().name,category:j?_0(j.pathname)?.label:void 0,routeUrl:j?.href,priority:"MEDIUM",requesterEmail:J.email??void 0,requesterName:J.fullName??void 0,attachments:$.screenshotDataUrl?[{dataUri:await b0($.screenshotDataUrl),filename:"screenshot.jpg"}]:void 0},Z=await fetch(`${q2()}/ingest/tickets`,{method:"POST",headers:{"content-type":"application/json","x-realm-key":z.realmKey,...await J1()},body:JSON.stringify(Q)}).catch(()=>{throw new l("request never left the browser","offline")});if(!Z.ok)throw await j1(Z);return await Z.json()}var x0=Math.PI/6;function B2($,z,J){let j=z.x-$.x,Q=z.y-$.y,Z=Math.hypot(j,Q),Y=Math.atan2(Q,j),X=[{x:z.x,y:z.y},{x:z.x-J*Math.cos(Y-x0),y:z.y-J*Math.sin(Y-x0)},{x:z.x-J*Math.cos(Y+x0),y:z.y-J*Math.sin(Y+x0)}],H=J*Math.cos(x0)*0.92;if(Z<=H)return{shaft:null,head:X};return{shaft:{from:$,to:{x:z.x-H*Math.cos(Y),y:z.y-H*Math.sin(Y)}},head:X}}var Z1="#f44336",T6="rgba(250, 204, 21, 0.4)",K1=22,N2="#2563eb",x2=9,k2=11,C2=18,O2=4,v0=8,h6=[{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 f2($,z,J){let j=[],Q=null,Z=-1,Y=null,X=null,H=$.getContext("2d");function U(){let K=$.getBoundingClientRect().width;return K>0?$.width/K:1}function A(K){let W=$.getBoundingClientRect();return{x:(K.clientX-W.left)/W.width*$.width,y:(K.clientY-W.top)/W.height*$.height}}function k(K){let W=K.size??K1;if(!H)return(K.text?.length??0)*W*0.6;H.save(),H.font=`600 ${W}px system-ui, sans-serif`;let V=H.measureText(K.text??"").width;return H.restore(),V}function x(K){if(K.tool==="text"){let W=K.size??K1;return{left:K.x1,top:K.y1,right:K.x1+k(K),bottom:K.y1+W*1.25}}return{left:Math.min(K.x1,K.x2),top:Math.min(K.y1,K.y2),right:Math.max(K.x1,K.x2),bottom:Math.max(K.y1,K.y2)}}function S(K){if(K.tool==="arrow")return[{id:"tail",x:K.x1,y:K.y1,cursor:"move"},{id:"head",x:K.x2,y:K.y2,cursor:"move"}];let W=x(K);if(K.tool==="text")return[{id:"size",x:W.right,y:W.bottom,cursor:"nwse-resize"}];return h6.map((V)=>({id:V.id,x:W.left+(W.right-W.left)*V.fx,y:W.top+(W.bottom-W.top)*V.fy,cursor:V.cursor}))}function L(K){let W=x(K);return{x:W.right+C2*U(),y:W.top-C2*U()}}function i(K,W,V){let{shaft:G,head:F}=B2({x:W.x1,y:W.y1},{x:W.x2,y:W.y2},Math.max(10,16*V));if(G)K.lineCap="butt",K.beginPath(),K.moveTo(G.from.x,G.from.y),K.lineTo(G.to.x,G.to.y),K.stroke();K.beginPath(),K.moveTo(F[0].x,F[0].y),K.lineTo(F[1].x,F[1].y),K.lineTo(F[2].x,F[2].y),K.closePath(),K.fill()}function n(K,W,V){K.save(),K.lineWidth=Math.max(2,3*V),K.strokeStyle=Z1,K.fillStyle=Z1;let G=x(W);if(W.tool==="rect")K.strokeRect(G.left,G.top,G.right-G.left,G.bottom-G.top);else if(W.tool==="arrow")i(K,W,V);else if(W.tool==="highlight")K.fillStyle=T6,K.fillRect(G.left,G.top,G.right-G.left,G.bottom-G.top);else if(W.tool==="text"&&W.text){let F=W.size??K1;K.font=`600 ${F}px system-ui, sans-serif`,K.textBaseline="top";let P=F*0.22;K.fillStyle="rgba(255,255,255,0.92)",K.fillRect(G.left-P,G.top-P,G.right-G.left+P*2,G.bottom-G.top+P*2),K.fillStyle=Z1,K.fillText(W.text,G.left,G.top)}K.restore()}function h(K,W,V){let G=x(W);K.save(),K.strokeStyle=N2,K.lineWidth=Math.max(1,1.5*V),K.setLineDash([6*V,4*V]),K.strokeRect(G.left,G.top,G.right-G.left,G.bottom-G.top),K.setLineDash([]);let F=x2*V;for(let T of S(W))K.fillStyle="#fff",K.strokeStyle=N2,K.lineWidth=Math.max(1,1.5*V),K.beginPath(),K.rect(T.x-F/2,T.y-F/2,F,F),K.fill(),K.stroke();let P=L(W),q=k2*V;K.beginPath(),K.arc(P.x,P.y,q,0,Math.PI*2),K.fillStyle="#dc2626",K.fill(),K.strokeStyle="#fff",K.lineWidth=Math.max(1.5,2*V),K.beginPath(),K.moveTo(P.x-q*0.4,P.y-q*0.4),K.lineTo(P.x+q*0.4,P.y+q*0.4),K.moveTo(P.x+q*0.4,P.y-q*0.4),K.lineTo(P.x-q*0.4,P.y+q*0.4),K.stroke(),K.restore()}function B(){if(!H)return;let K=U();if(H.clearRect(0,0,$.width,$.height),H.drawImage(z,0,0,$.width,$.height),j.forEach((V,G)=>{if(G!==J0)n(H,V,K)}),Y)n(H,Y,K);let W=j[Z];if(W&&!Y)h(H,W,K)}function Z0(K,W,V,G,F){return Math.abs(K-V)<=F&&Math.abs(W-G)<=F}function z0(K,W){let V=j[Z];if(!V)return null;let G=x2*U()/2+3*U();for(let F of S(V))if(Z0(K,W,F.x,F.y,G))return F.id;return null}function R(K,W){let V=j[Z];if(!V)return!1;let G=L(V);return Z0(K,W,G.x,G.y,k2*U())}function d(K,W){let V=6*U();for(let G=j.length-1;G>=0;G-=1){let F=j[G];if(F.tool==="arrow"){let q=F.x2-F.x1,T=F.y2-F.y1,u=Math.hypot(q,T)||1,w=Math.max(0,Math.min(1,((K-F.x1)*q+(W-F.y1)*T)/(u*u)));if(Math.hypot(K-(F.x1+w*q),W-(F.y1+w*T))<=V+4*U())return G;continue}let P=x(F);if(K>=P.left-V&&K<=P.right+V&&W>=P.top-V&&W<=P.bottom+V)return G}return-1}function _(K,W,V,G,F){if(W==="tail"){K.x1=V.x1+G,K.y1=V.y1+F;return}if(W==="head"){K.x2=V.x2+G,K.y2=V.y2+F;return}if(W==="size"){let D=(V.size??24)+F;K.size=Math.max(10,D);return}let P=x(V),{left:q,top:T,right:u,bottom:w}=P;if(W.includes("w"))q=Math.min(u-v0,q+G);if(W.includes("e"))u=Math.max(q+v0,u+G);if(W.includes("n"))T=Math.min(w-v0,T+F);if(W.includes("s"))w=Math.max(T+v0,w+F);K.x1=q,K.y1=T,K.x2=u,K.y2=w}function C0(K,W,V,G){K.x1=W.x1+V,K.y1=W.y1+G,K.x2=W.x2+V,K.y2=W.y2+G}let C=null,J0=-1,E={x:0,y:0,size:24};function H0(){let K=$.getBoundingClientRect().width;return K>0?K/$.width:1}function O0(K,W){if(!H)return K.length*W*0.6;H.save(),H.font=`600 ${W}px system-ui, sans-serif`;let V=H.measureText(K||" ").width;return H.restore(),V}function K0(){if(!C)return;let K=$.parentElement;if(!K)return;let W=$.getBoundingClientRect(),V=K.getBoundingClientRect(),G=H0(),F=E.size*G;C.style.left=`${W.left-V.left+E.x*G}px`,C.style.top=`${W.top-V.top+E.y*G}px`,C.style.fontSize=`${F}px`,C.style.width=`${Math.max(40,O0(C.value,F)+F)}px`}function r(K){let W=C;if(!W)return;C=null;let V=W.value.trim(),G=J0;if(J0=-1,W.remove(),K&&V){if(G>=0&&j[G])j[G].text=V,Z=G;else j.push({tool:"text",x1:E.x,y1:E.y,x2:E.x,y2:E.y,text:V,size:E.size}),Z=j.length-1;J()}else if(G>=0)Z=G;$.focus(),B()}function c(K,W,V=-1){r(!0);let G=$.parentElement;if(!G)return;if(getComputedStyle(G).position==="static")G.style.position="relative";let F=V>=0?j[V]:void 0;J0=V,E={x:F?.x1??K,y:F?.y1??W,size:F?.size??Math.round(24*U())};let P=document.createElement("input");P.type="text",P.className="text-edit",P.value=F?.text??"",P.setAttribute("aria-label","ข้อความบนภาพ"),P.placeholder="ข้อความ",C=P,G.append(P),K0(),P.addEventListener("input",K0),P.addEventListener("keydown",(q)=>{if(q.stopPropagation(),q.key==="Enter")r(!0);else if(q.key==="Escape")r(!1)}),requestAnimationFrame(()=>{if(C!==P)return;P.focus(),P.select(),P.addEventListener("blur",()=>r(!0))}),B()}function y(K){let{x:W,y:V}=A(K);if($.setPointerCapture(K.pointerId),R(W,V)){v();return}let G=z0(W,V);if(G&&j[Z]){X={grip:G,x:W,y:V,start:{...j[Z]}};return}if(Q==="text"){if(K.preventDefault(),$.hasPointerCapture(K.pointerId))$.releasePointerCapture(K.pointerId);Q=null,J(),c(W,V);return}if(Q){Y={tool:Q,x1:W,y1:V,x2:W,y2:V},Z=-1;return}let F=d(W,V);Z=F,X=F>=0?{grip:"body",x:W,y:V,start:{...j[F]}}:null,B()}function Y0(K){let{x:W,y:V}=A(K);if(Y){Y.x2=W,Y.y2=V,B();return}if(X){let F=j[Z];if(!F)return;let P=W-X.x,q=V-X.y;if(X.grip==="body")C0(F,X.start,P,q);else _(F,X.grip,X.start,P,q);B();return}if(Q){$.style.cursor="crosshair";return}if(R(W,V)){$.style.cursor="pointer";return}let G=z0(W,V);if(G){let F=j[Z]?S(j[Z]).find((P)=>P.id===G):null;$.style.cursor=F?.cursor??"pointer";return}$.style.cursor=d(W,V)>=0?"move":"default"}function j0(){if(Y){if(!(Math.abs(Y.x2-Y.x1)<O2&&Math.abs(Y.y2-Y.y1)<O2))j.push(Y),Z=j.length-1,Q=null,J();Y=null}if(X)X=null,J();B()}function s(K){let W=$.getBoundingClientRect(),V=(K.clientX-W.left)/W.width*$.width,G=(K.clientY-W.top)/W.height*$.height,F=d(V,G),P=j[F];if(!P||P.tool!=="text")return;K.preventDefault(),c(P.x1,P.y1,F)}function a(K){if(Z<0)return;if(K.key==="Delete"||K.key==="Backspace")K.preventDefault(),v();else if(K.key==="Escape")K.preventDefault(),Z=-1,B()}function v(){if(Z<0)return;j.splice(Z,1),Z=-1,J(),B()}return $.addEventListener("pointerdown",y),$.addEventListener("pointermove",Y0),$.addEventListener("pointerup",j0),$.addEventListener("pointercancel",j0),$.addEventListener("dblclick",s),$.tabIndex=0,$.addEventListener("keydown",a),B(),{setTool(K){Q=K,Z=-1,$.style.cursor=K?"crosshair":"default",B()},deleteSelected:v,clear(){j.length=0,Z=-1,J(),B()},hasShapes:()=>j.length>0,hasSelection:()=>Z>=0,toDataUrl(){let K=document.createElement("canvas");K.width=z.naturalWidth,K.height=z.naturalHeight;let W=K.getContext("2d");if(!W)return $.toDataURL("image/png");W.drawImage(z,0,0);let V=U();for(let G of j)n(W,G,V);return K.toDataURL("image/png")},destroy(){r(!1),$.removeEventListener("pointerdown",y),$.removeEventListener("pointermove",Y0),$.removeEventListener("pointerup",j0),$.removeEventListener("pointercancel",j0),$.removeEventListener("dblclick",s),$.removeEventListener("keydown",a)}}}var A6=["keydown","keyup","keypress"];function _2($){for(let z of A6)$.addEventListener(z,(J)=>J.stopPropagation())}var S2=`
|
|
34
34
|
:host { all: initial; }
|
|
35
35
|
* { box-sizing: border-box; }
|
|
36
36
|
|
|
@@ -54,11 +54,11 @@ h2 { margin: 0; font-size: 20px; font-weight: 700; flex: 1; }
|
|
|
54
54
|
label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
|
|
55
55
|
.req { color: #dc2626; }
|
|
56
56
|
.hint { font-weight: 400; color: #64748b; }
|
|
57
|
-
input[type="text"], textarea, select {
|
|
57
|
+
input[type="text"], input[type="search"], textarea, select {
|
|
58
58
|
width: 100%; padding: 10px 12px; font: inherit; font-size: 14px;
|
|
59
59
|
border: 1px solid #cbd5e1; border-radius: 10px; background: #fff; color: inherit;
|
|
60
60
|
}
|
|
61
|
-
input[type="text"]:focus, textarea:focus, select:focus {
|
|
61
|
+
input[type="text"]:focus, input[type="search"]:focus, textarea:focus, select:focus {
|
|
62
62
|
outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
|
|
63
63
|
}
|
|
64
64
|
textarea { min-height: 88px; resize: vertical; }
|
|
@@ -118,7 +118,14 @@ canvas { width: 100%; height: auto; display: block; border: 1px solid #e2e8f0; b
|
|
|
118
118
|
แจ้งปัญหา · คำขอ as two cards under the heading, the way the desk's own
|
|
119
119
|
สร้างเวิร์กโฟลว์ asks it; what is asked for as cards, the way the portal lists it. */
|
|
120
120
|
[hidden] { display: none !important; }
|
|
121
|
-
|
|
121
|
+
/* The press's choice: two cards in a smaller dialog, before anything is asked of the browser. */
|
|
122
|
+
.kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
|
|
123
|
+
/* In the form, the choice is made: one quiet line under the heading to switch. */
|
|
124
|
+
.door { margin: -8px 0 0; font-size: 13px; color: #64748b; }
|
|
125
|
+
.panel.narrow { width: min(560px, 100%); }
|
|
126
|
+
.kinds.choose { margin: 0 0 24px; }
|
|
127
|
+
.kinds.choose button.kind { padding: 16px 18px; gap: 6px; }
|
|
128
|
+
.kinds.choose .kind-hint { font-size: 13px; }
|
|
122
129
|
button.kind {
|
|
123
130
|
position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
|
|
124
131
|
padding: 12px 34px 12px 14px; text-align: left; border-radius: 12px;
|
|
@@ -135,7 +142,16 @@ button.kind[aria-checked="true"], button.kind[aria-checked="true"]:hover:not(:di
|
|
|
135
142
|
button.kind[aria-checked="true"] .tick { opacity: 1; }
|
|
136
143
|
button.kind:focus-visible, button.type:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25); }
|
|
137
144
|
button.kind[aria-checked="true"]:focus-visible { box-shadow: inset 0 0 0 1px #2563eb, 0 0 0 3px rgba(37, 99, 235, 0.25); }
|
|
138
|
-
.types { display: grid; gap:
|
|
145
|
+
.types { display: grid; gap: 6px; }
|
|
146
|
+
/* A long list scrolls in its own height, so the title and ส่งคำขอ stay near. */
|
|
147
|
+
.types.long { max-height: 300px; overflow-y: auto; padding: 2px; margin: -2px; overscroll-behavior: contain; }
|
|
148
|
+
.type-search { margin-bottom: 8px; }
|
|
149
|
+
.ask .type-count { margin: 6px 0 0; font-size: 12px; }
|
|
150
|
+
/* The rest are one line: only the chosen one opens up with its words and the team's time. */
|
|
151
|
+
button.type:not([aria-checked="true"]) { padding: 8px 12px; align-items: center; }
|
|
152
|
+
button.type:not([aria-checked="true"]) .type-hint, button.type:not([aria-checked="true"]) .type-due { display: none; }
|
|
153
|
+
button.type:not([aria-checked="true"]) .type-body b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
154
|
+
button.type:not([aria-checked="true"]) .icon { margin-top: 0; }
|
|
139
155
|
button.type {
|
|
140
156
|
display: flex; align-items: flex-start; gap: 10px; width: 100%;
|
|
141
157
|
padding: 10px 12px; text-align: left; border-radius: 10px;
|
|
@@ -165,4 +181,4 @@ button.link:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
|
|
|
165
181
|
.shot-choice input { width: 16px; height: 16px; margin: 0; accent-color: #2563eb; }
|
|
166
182
|
.dropped { opacity: 0.35; pointer-events: none; }
|
|
167
183
|
.draft { margin: -8px 0 0; padding: 8px 12px; border-radius: 10px; background: #eff6ff; font-size: 13px; color: #1e3a8a; }
|
|
168
|
-
`;var I0="lw-debug-reporter",n=null;function k6($,z){if($ instanceof y){if($.kind==="offline")return z.failedOffline;if($.kind==="unavailable")return z.failedUnavailable;if($.kind==="rateLimited")return z.failedTooMany.replace("{seconds}",$.retryAfter??"60");return $.message||z.failed}return z.failed}var O6=()=>[];var S6=[{tool:"rect",key:"toolRect"},{tool:"arrow",key:"toolArrow"},{tool:"highlight",key:"toolHighlight"},{tool:"text",key:"toolText"}];function f6(){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"}),D2(this.root),this.root.addEventListener("keydown",(z)=>{let J=z;if(J.key!=="Escape"||J.defaultPrevented||!this.root.querySelector("[role=dialog]"))return;J.preventDefault(),this.close()})}connectedCallback(){this.dataset.debugReporter="true",this.stop=S1((z)=>void this.open(z))}disconnectedCallback(){this.stop?.(),this.stop=null,this.close()}async open(z){if(this.busy)return;this.busy=!0;let J=document.activeElement;this.returnFocus=J instanceof HTMLElement&&J!==document.body?J:null;let Q=R0(C().locale);if(s0()===null)J0();await this.report(z,Q)}async report(z,J){let Q=await t1();if(Q.method==="cancelled"){this.close();return}this.bundle=a1({reason:z,note:"",screenshotDataUrl:Q.dataUrl,screenshotMethod:Q.method,erroredQueries:_6()}),this.renderForm(J,z)}close(z=!1){if(z)n=null;else if(this.keep)n=this.keep()??n;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(z){let J=document.createElement("style");J.textContent=q2;let Q=document.createElement("div");Q.className="backdrop";let j=document.createElement("div");return j.className="panel",j.setAttribute("role","dialog"),j.setAttribute("aria-modal","true"),j.setAttribute("aria-label",z.title),Q.append(j),this.root.replaceChildren(J,Q),j}renderShell(z,J){let Q=this.shell(z),j=B("div","head");j.append(B("h2","",z.title)),Q.append(j,B("p","status",J))}renderForm(z,J){let Q=this.bundle;if(!Q)return;let j=this.shell(z),K="problem",Y=null,H=B("div","head"),P=B("h2","",z.title),M=v("✕","icon");M.setAttribute("aria-label",z.close),M.addEventListener("click",()=>this.close()),H.append(P,M);let x=B("div","kinds");x.hidden=!0,x.setAttribute("role","radiogroup"),x.setAttribute("aria-label",z.chooseTitle);let N=(W,F,U,w)=>{let I=v("","kind");I.setAttribute("role","radio"),I.dataset.kind=W;let E=B("span","kind-top");return E.append(E0(F),B("b","",U)),I.append(E,B("span","kind-hint",w),E0(L6,"tick")),I.addEventListener("click",()=>s(W)),I},q=N("problem",T6,z.kindProblem,z.kindProblemHint),f=N("request",x2,z.kindRequest,z.kindRequestHint);x.append(q,f),x.addEventListener("keydown",(W)=>{if(!N2.includes(W.key))return;W.preventDefault(),s(K==="problem"?"request":"problem"),(K==="problem"?q:f).focus()});let O=B("div","ask");O.hidden=!0;let L=B("div","types");L.setAttribute("role","radiogroup"),L.setAttribute("aria-label",z.requestTypeLabel),O.append(m0(z.requestTypeLabel,"",!0),L);let m=[],a=()=>{for(let W of m){let F=W.dataset.requestType===Y?.id;W.setAttribute("aria-checked",String(F)),W.tabIndex=F?0:-1}},D=document.createElement("input");D.type="text";let Q0=m0(""),h=document.createElement("textarea"),j0=m0(""),t=B("div","meta"),{context:Z0}=Q,B0=`${Q.network.length} network · ${Q.console.length} console · ${Q.actionTrail.length} actions${Q.replay?` · ${z.replay} ${Math.round(Q.replay.durationMs/1000)}s`:""}`,S=(W,F)=>{let U=document.createElement("div"),w=document.createElement("b");w.textContent=`${W}: `;let I=document.createTextNode(F);return U.append(w,I),t.append(U),{b:w,v:I}};S(z.reporter,`${Z0.user.fullName??"—"} (${Z0.user.email??"—"})`),S(z.page,Z0.route.href);let r=S(z.captured,B0),k=document.createElement("label");k.className="shot-choice",k.hidden=!0;let g=document.createElement("input");g.type="checkbox",g.checked=!0,g.dataset.requestShot="",k.append(g,document.createTextNode(` ${z.requestWithShot}`));let K0=Q.screenshotDataUrl?this.screenshotSection(z,Q.screenshotDataUrl):[B("p","status",z.noScreenshot)],Y0=Q.screenshotDataUrl?K0[0]:null;if(!Q.screenshotDataUrl)k.replaceChildren();let R=B("p","status",""),u=v(z.submit,"primary"),i=()=>{u.disabled=D.value.trim().length===0||K==="request"&&!Y};D.addEventListener("input",i);let d=()=>{let W=K==="request";P.textContent=x.hidden?z.title:z.chooseTitle,j.setAttribute("aria-label",W?z.requestTitle:z.title);for(let[F,U]of[[q,!W],[f,W]])F.setAttribute("aria-checked",String(U)),F.tabIndex=U?0:-1;if(O.hidden=!W,g0(Q0,W?z.requestSummaryLabel:z.summaryLabel,W?"":z.summaryRequired,!0),D.placeholder=W?z.requestSummaryPlaceholder:z.summaryPlaceholder,g0(j0,W?z.requestDetailLabel:z.detailLabel),h.placeholder=W?z.requestDetailPlaceholder:z.detailPlaceholder,r.b.textContent=`${W?z.requestLeaves:z.captured}: `,r.v.textContent=W?z.requestLeavesWhat:B0,k.hidden=!W||!Q.screenshotDataUrl,Y0)g0(Y0,W?z.requestAnnotateHint:z.annotateHint);for(let F of K0)F.classList.toggle("dropped",W&&!g.checked);u.textContent=W?z.requestSubmit:z.submit,i()};g.addEventListener("change",d);function s(W){if(W===K)return;K=W,d()}let D0=(W)=>{if(this.bundle!==Q||J.type!=="manual"||!W.length)return;Y=W[0],m.length=0;for(let F of W){let U=v("","type");U.setAttribute("role","radio"),U.dataset.requestType=F.id;let w=B("span","type-body");if(w.append(B("b","",F.name)),F.description)w.append(B("span","type-hint",F.description));if(F.targetHours){let I=B("span","type-due");I.append(E0(A6),document.createTextNode(z.requestTarget.replace("{time}",R6(z,F.targetHours)))),w.append(I)}U.append(E0(x2),w),U.addEventListener("click",()=>{Y=F,a(),i()}),m.push(U)}L.replaceChildren(...m),L.onkeydown=(F)=>{if(!N2.includes(F.key)||!Y)return;F.preventDefault();let U=W.findIndex((I)=>I.id===Y.id),w=F.key==="ArrowUp"||F.key==="ArrowLeft"?-1:1;Y=W[(U+w+W.length)%W.length],a(),m.find((I)=>I.dataset.requestType===Y.id)?.focus()},a(),x.hidden=!1,d()},b=n&&(n.title||n.detail)?n:null,c=B("p","draft");if(c.hidden=!b,b){D.value=b.title,h.value=b.detail;let W=v(z.draftClear,"link");W.dataset.draftClear="",W.addEventListener("click",()=>{D.value="",h.value="",n=null,c.hidden=!0,i(),D.focus()}),c.append(document.createTextNode(`${z.draftRestored} · `),W)}let Z=s0(),G=(W)=>{if(D0(W),!b?.asking||x.hidden)return;let F=W.find((U)=>U.id===b.typeId);if(F)Y=F,a();K="request",d()};if(Z)G(Z);else if(J.type==="manual")J0().then(G);this.keep=()=>({title:D.value,detail:h.value,asking:K==="request",typeId:Y?.id??null}),j.append(H,x,c,O,Q0,D,j0,h,t,k,...K0);let X=B("div","foot"),V=v(z.close);V.addEventListener("click",()=>this.close()),X.append(V,R,B("span","grow"),u),j.append(X),d(),u.addEventListener("click",async()=>{u.disabled=!0,R.dataset.tone="",R.textContent=z.submitting;let W=()=>this.annotator?.hasShapes()?this.annotator.toDataUrl():Q.screenshotDataUrl;try{if(K==="request"&&Y){let w=await F2({ticketTypeId:Y.id,title:D.value.trim(),description:h.value,screenshotDataUrl:g.checked?W():null}),I=this.dispatchEvent(new CustomEvent("lw-request-submitted",{detail:w,bubbles:!0,composed:!0,cancelable:!0}));if(this.close(!0),I)z0(`${z.requestSubmitted} — #${w.number}`,"success");return}let F=await V2(D.value.trim(),{...Q,note:h.value,screenshotDataUrl:W()}),U=this.dispatchEvent(new CustomEvent("lw-report-submitted",{detail:F,bubbles:!0,composed:!0,cancelable:!0}));if(this.close(!0),U)z0(`${z.submitted} — #${F.number}`,"success")}catch(F){let U=k6(F,z);R.dataset.tone="error",R.textContent=U,z0(U,"error"),i()}}),D.focus()}screenshotSection(z,J){let Q=m0(z.annotateHint),j=B("div","tools"),K=document.createElement("canvas"),Y=B("div","shot");Y.append(K);let H=[],P=(q)=>{for(let f of H)f.setAttribute("aria-pressed",String(f===q))};for(let{tool:q,key:f}of S6){let O=v(z[f]);O.setAttribute("aria-pressed","false"),O.addEventListener("click",()=>{let L=O.getAttribute("aria-pressed")==="true";P(L?null:O),this.annotator?.setTool(L?null:q)}),H.push(O),j.append(O)}j.append(B("span","sep"));let M=v(z.deleteSelected);M.addEventListener("click",()=>this.annotator?.deleteSelected());let x=v(z.clearAll);x.addEventListener("click",()=>{this.annotator?.clear(),P(null)}),j.append(M,x);let N=new Image;return N.onload=()=>{K.width=N.naturalWidth,K.height=N.naturalHeight,this.annotator=B2(K,N,()=>{P(null),M.disabled=!this.annotator?.hasSelection()})},N.src=J,[Q,j,B("p","status",z.annotateHelp),Y]}}}function _6(){try{return O6()}catch{return[]}}function B($,z="",J=""){let Q=document.createElement($);if(z)Q.className=z;if(J)Q.textContent=J;return Q}function R6($,z){return z>=24&&z%24===0?$.days.replace("{n}",String(z/24)):$.hours.replace("{n}",String(z))}var N2=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"],T6=[["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"}]],x2=[["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"}]],A6=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M12 6v6l4 2"}]],L6=[["path",{d:"M20 6 9 17l-5-5"}]],C2="http://www.w3.org/2000/svg";function E0($,z="icon"){let J=document.createElementNS(C2,"svg");for(let[Q,j]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:z}))J.setAttribute(Q,j);for(let[Q,j]of $){let K=document.createElementNS(C2,Q);for(let[Y,H]of Object.entries(j))K.setAttribute(Y,H);J.append(K)}return J}function v($,z=""){let J=document.createElement("button");if(J.type="button",J.textContent=$,z)J.className=z;return J}function m0($,z="",J=!1){return g0(document.createElement("label"),$,z,J)}function g0($,z,J="",Q=!1){if($.replaceChildren(document.createTextNode(z)),Q){let j=document.createElement("span");j.className="req",j.textContent=" *",$.append(j)}if(J){let j=document.createElement("span");j.className="hint",j.textContent=` ${J}`,$.append(j)}return $}function k2(){if(typeof window>"u"||customElements.get(I0))return;customElements.define(I0,f6())}var O2=!1;function e0($={}){if(O2||typeof window>"u")return;if(!q0()){console.error("[debug-capture] configureDebugCapture() must be called before install");return}if(O2=!0,u1(),q1(),U1(),L1(),l1(),$.ui===!1)return;let z=R0(C().locale);if(f1((Q)=>{z0(Q.message??z.crashed,"error",{label:z.crashAction,onClick:()=>S0(Q)})}),k2(),!document.querySelector(I0))document.body.append(document.createElement(I0));let J=window.requestIdleCallback;if(J)J(()=>void J0(),{timeout:5000});else setTimeout(()=>void J0(),2000)}var S2=document.currentScript,A=S2?.dataset??{},h6="rrweb-record.mjs";o1(()=>import(new URL(h6,S2?.src??location.href).href));function E6($){if(!$)return{};try{let z=JSON.parse($);if(!z||typeof z!=="object"||Array.isArray(z))return{};return Object.fromEntries(Object.entries(z).filter(([,J])=>typeof J==="string"&&J.trim()))}catch{return{}}}if(A.host&&A.realmKey)if(z1({host:A.host,realmKey:A.realmKey,app:{name:A.appName??document.title??"app",version:A.appVersion??"0.0.0",environment:A.environment??"production"},module:j1(E6(A.modules)),locale:A.locale==="en"?"en":"th",...A.replay!==void 0?{replay:{seconds:Number(A.replay)||void 0}}:{}}),document.body)e0();else document.addEventListener("DOMContentLoaded",()=>e0(),{once:!0});window.lwReportProblem=S0;})();
|
|
184
|
+
`;var k0="lw-debug-reporter",$0=null;function L6($,z){if($ instanceof l){if($.kind==="offline")return z.failedOffline;if($.kind==="unavailable")return z.failedUnavailable;if($.kind==="rateLimited")return z.failedTooMany.replace("{seconds}",$.retryAfter??"60");return $.message||z.failed}return z.failed}var E6=()=>[];var m6=[{tool:"rect",key:"toolRect"},{tool:"arrow",key:"toolArrow"},{tool:"highlight",key:"toolHighlight"},{tool:"text",key:"toolText"}];function g6(){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"}),_2(this.root),this.root.addEventListener("keydown",(z)=>{let J=z;if(J.key!=="Escape"||J.defaultPrevented||!this.root.querySelector("[role=dialog]"))return;J.preventDefault(),this.close()})}connectedCallback(){this.dataset.debugReporter="true",this.stop=g1((z)=>void this.open(z))}disconnectedCallback(){this.stop?.(),this.stop=null,this.close()}async open(z){if(this.busy)return;this.busy=!0;let J=document.activeElement;this.returnFocus=J instanceof HTMLElement&&J!==document.body?J:null;let j=m0(f().locale),Q=Q1();if(Q===null)F0();if(z.type==="manual"&&Q?.length){this.renderChooser(j,z);return}await this.report(z,j)}renderChooser(z,J){let j=this.shell(z);j.classList.add("narrow"),j.setAttribute("aria-label",z.chooseTitle);let Q=M("div","head"),Z=b("✕","icon");Z.setAttribute("aria-label",z.close),Z.addEventListener("click",()=>this.close()),Q.append(M("h2","",z.chooseTitle),Z);let Y=A2("problem",p6,z.kindProblem,z.chooseProblemHint);Y.dataset.choose="problem",Y.addEventListener("click",()=>{this.root.replaceChildren(),this.report(J,z)});let X=A2("request",T2,z.kindRequest,z.chooseRequestHint);X.dataset.choose="request",X.addEventListener("click",()=>{this.bundle=g0({reason:J,note:"",screenshotDataUrl:null,screenshotMethod:"none",erroredQueries:Y1()}),this.renderForm(z,J,"request")});let H=M("div","kinds choose");H.append(Y,X),H.addEventListener("keydown",(U)=>{if(!R2.includes(U.key))return;U.preventDefault(),(this.root.activeElement===Y?X:Y).focus()}),j.append(Q,H),Y.focus()}async switchToReport(z,J,j){this.root.replaceChildren();let Q=await $1();if(Q.method==="cancelled"){this.renderForm(z,J,"request",{...j,asking:!0});return}this.bundle=g0({reason:J,note:"",screenshotDataUrl:Q.dataUrl,screenshotMethod:Q.method,erroredQueries:Y1()}),this.renderForm(z,J,"problem",j)}async report(z,J){let j=await $1();if(j.method==="cancelled"){this.close();return}this.bundle=g0({reason:z,note:"",screenshotDataUrl:j.dataUrl,screenshotMethod:j.method,erroredQueries:Y1()}),this.renderForm(J,z,"problem")}close(z=!1){if(z)$0=null;else if(this.keep)$0=this.keep()??$0;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(z){let J=document.createElement("style");J.textContent=S2;let j=document.createElement("div");j.className="backdrop";let Q=document.createElement("div");return Q.className="panel",Q.setAttribute("role","dialog"),Q.setAttribute("aria-modal","true"),Q.setAttribute("aria-label",z.title),j.append(Q),this.root.replaceChildren(J,j),Q}renderShell(z,J){let j=this.shell(z),Q=M("div","head");Q.append(M("h2","",z.title)),j.append(Q,M("p","status",J))}renderForm(z,J,j,Q){let Z=this.bundle;if(!Z)return;let Y=this.shell(z),X=j,H=j==="problem"||!!Z.screenshotDataUrl,U=null,A=M("div","head"),k=M("h2","",z.title),x=b("✕","icon");x.setAttribute("aria-label",z.close),x.addEventListener("click",()=>this.close()),A.append(k,x);let S=M("p","door");S.hidden=!0;let L=M("span"),i=b("","link");i.dataset.switchKind="",i.addEventListener("click",()=>W(X==="problem"?"request":"problem")),S.append(L,i);let n=M("div","ask");n.hidden=!0;let h=document.createElement("input");h.type="search",h.className="type-search",h.placeholder=z.requestTypeSearch,h.setAttribute("aria-label",z.requestTypeSearch),h.dataset.requestTypeSearch="",h.hidden=!0;let B=M("div","types");B.setAttribute("role","radiogroup"),B.setAttribute("aria-label",z.requestTypeLabel);let Z0=M("p","status",z.requestTypeNone);Z0.hidden=!0;let z0=M("p","status type-count","");z0.hidden=!0,n.append(u0(z.requestTypeLabel,"",!0),h,B,Z0,z0);let R=[],d=()=>{for(let D of R){let I=D.dataset.requestType===U?.id;D.setAttribute("aria-checked",String(I)),D.tabIndex=I?0:-1}let w=R.find((D)=>D.dataset.requestType===U?.id);if(w&&B.scrollHeight>B.clientHeight){let D=w.offsetTop-B.offsetTop;if(D<B.scrollTop)B.scrollTop=D;else if(D+w.offsetHeight>B.scrollTop+B.clientHeight)B.scrollTop=D+w.offsetHeight-B.clientHeight}},_=document.createElement("input");_.type="text";let C0=u0(""),C=document.createElement("textarea"),J0=u0(""),E=M("div","meta"),{context:H0}=Z,O0=`${Z.network.length} network · ${Z.console.length} console · ${Z.actionTrail.length} actions${Z.replay?` · ${z.replay} ${Math.round(Z.replay.durationMs/1000)}s`:""}`,K0=(w,D)=>{let I=document.createElement("div"),N=document.createElement("b");N.textContent=`${w}: `;let O=document.createTextNode(D);return I.append(N,O),E.append(I),{b:N,v:O}};K0(z.reporter,`${H0.user.fullName??"—"} (${H0.user.email??"—"})`),K0(z.page,H0.route.href);let r=K0(z.captured,O0),c=document.createElement("label");c.className="shot-choice",c.hidden=!0;let y=document.createElement("input");y.type="checkbox",y.checked=!0,y.dataset.requestShot="",c.append(y,document.createTextNode(` ${z.requestWithShot}`));let Y0=Z.screenshotDataUrl?this.screenshotSection(z,Z.screenshotDataUrl):[M("p","status",z.noScreenshot)],j0=Z.screenshotDataUrl?Y0[0]:null;if(!Z.screenshotDataUrl)c.replaceChildren();let s=M("p","status",""),a=b(z.submit,"primary"),v=()=>{a.disabled=_.value.trim().length===0||X==="request"&&!U};_.addEventListener("input",v);let K=()=>{let w=X==="request";if(k.textContent=w?z.requestTitle:z.title,Y.setAttribute("aria-label",w?z.requestTitle:z.title),L.textContent=`${w?z.problemInstead:z.askInstead} `,i.textContent=w?H?z.problemInsteadAction:z.problemInsteadShare:z.askInsteadAction,n.hidden=!w,i0(C0,w?z.requestSummaryLabel:z.summaryLabel,w?"":z.summaryRequired,!0),_.placeholder=w?z.requestSummaryPlaceholder:z.summaryPlaceholder,i0(J0,w?z.requestDetailLabel:z.detailLabel),C.placeholder=w?z.requestDetailPlaceholder:z.detailPlaceholder,r.b.textContent=`${w?z.requestLeaves:z.captured}: `,r.v.textContent=w?z.requestLeavesWhat:O0,c.hidden=!w||!Z.screenshotDataUrl,j0)i0(j0,w?z.requestAnnotateHint:z.annotateHint);for(let D of Y0)D.classList.toggle("dropped",w&&!y.checked),D.hidden=w&&!Z.screenshotDataUrl;a.textContent=w?z.requestSubmit:z.submit,v()};y.addEventListener("change",K);let W=(w)=>{if(w===X)return;if(w==="problem"&&!H){this.switchToReport(z,J,{title:_.value,detail:C.value,asking:!1,typeId:U?.id??null});return}X=w,K()},V=(w)=>{if(this.bundle!==Z||J.type!=="manual"||!w.length)return;U=w[0],R.length=0;for(let I of w){let N=b("","type");N.setAttribute("role","radio"),N.dataset.requestType=I.id;let O=M("span","type-body");if(O.append(M("b","",I.name)),I.description)O.append(M("span","type-hint",I.description));if(I.targetHours){let W0=M("span","type-due");W0.append(d0(y6),document.createTextNode(z.requestTarget.replace("{time}",b6(z,I.targetHours)))),O.append(W0)}N.append(d0(T2),O),N.addEventListener("click",()=>{U=I,d(),v()}),R.push(N)}B.replaceChildren(...R),B.onkeydown=(I)=>{if(!R2.includes(I.key)||!U)return;I.preventDefault();let N=w.filter((Q0,g2)=>!R[g2].hidden);if(!N.length)return;let O=N.findIndex((Q0)=>Q0.id===U.id),W0=I.key==="ArrowUp"||I.key==="ArrowLeft"?-1:1;U=N[O<0?0:(O+W0+N.length)%N.length],d(),R.find((Q0)=>Q0.dataset.requestType===U.id)?.focus()},B.classList.toggle("long",w.length>=W1),h.hidden=w.length<W1;let D=(I)=>{z0.hidden=w.length<W1||I===0,z0.textContent=z.requestTypeCount.replace("{n}",String(I))};D(w.length),h.oninput=()=>{let I=h.value.trim().toLowerCase(),N=null;if(w.forEach((O,W0)=>{let Q0=!I||`${O.name} ${O.description}`.toLowerCase().includes(I);if(R[W0].hidden=!Q0,Q0&&!N)N=O}),Z0.hidden=!!N,D(R.filter((O)=>!O.hidden).length),N&&U&&R[w.indexOf(U)].hidden)U=N;d(),v()},h.onkeydown=(I)=>{if(I.key==="ArrowDown"||I.key==="Enter")I.preventDefault(),R.find((N)=>N.dataset.requestType===U?.id&&!N.hidden)?.focus()},d(),S.hidden=!1,K()},G=Q??($0&&($0.title||$0.detail)?$0:null),F=M("p","draft");if(F.hidden=!G||!!Q,G){_.value=G.title,C.value=G.detail;let w=b(z.draftClear,"link");w.dataset.draftClear="",w.addEventListener("click",()=>{_.value="",C.value="",$0=null,F.hidden=!0,v(),_.focus()}),F.append(document.createTextNode(`${z.draftRestored} · `),w)}let P=Q1(),q=(w)=>{if(V(w),X!=="request"||S.hidden||!G?.typeId)return;let D=w.find((I)=>I.id===G.typeId);if(D)U=D,d()};if(P)q(P);else if(J.type==="manual")F0().then(q);this.keep=()=>({title:_.value,detail:C.value,asking:X==="request",typeId:U?.id??null}),Y.append(A,S,F,n,C0,_,J0,C,E,c,...Y0);let T=M("div","foot"),u=b(z.close);u.addEventListener("click",()=>this.close()),T.append(u,s,M("span","grow"),a),Y.append(T),K(),a.addEventListener("click",async()=>{a.disabled=!0,s.dataset.tone="",s.textContent=z.submitting;let w=()=>this.annotator?.hasShapes()?this.annotator.toDataUrl():Z.screenshotDataUrl;try{if(X==="request"&&U){let N=await D2({ticketTypeId:U.id,title:_.value.trim(),description:C.value,screenshotDataUrl:y.checked?w():null}),O=this.dispatchEvent(new CustomEvent("lw-request-submitted",{detail:N,bubbles:!0,composed:!0,cancelable:!0}));if(this.close(!0),O)X0(`${z.requestSubmitted} — #${N.number}`,"success");return}let D=await M2(_.value.trim(),{...Z,note:C.value,screenshotDataUrl:w()}),I=this.dispatchEvent(new CustomEvent("lw-report-submitted",{detail:D,bubbles:!0,composed:!0,cancelable:!0}));if(this.close(!0),I)X0(`${z.submitted} — #${D.number}`,"success")}catch(D){let I=L6(D,z);s.dataset.tone="error",s.textContent=I,X0(I,"error"),v()}}),_.focus()}screenshotSection(z,J){let j=u0(z.annotateHint),Q=M("div","tools"),Z=document.createElement("canvas"),Y=M("div","shot");Y.append(Z);let X=[],H=(x)=>{for(let S of X)S.setAttribute("aria-pressed",String(S===x))};for(let{tool:x,key:S}of m6){let L=b(z[S]);L.setAttribute("aria-pressed","false"),L.addEventListener("click",()=>{let i=L.getAttribute("aria-pressed")==="true";H(i?null:L),this.annotator?.setTool(i?null:x)}),X.push(L),Q.append(L)}Q.append(M("span","sep"));let U=b(z.deleteSelected);U.addEventListener("click",()=>this.annotator?.deleteSelected());let A=b(z.clearAll);A.addEventListener("click",()=>{this.annotator?.clear(),H(null)}),Q.append(U,A);let k=new Image;return k.onload=()=>{Z.width=k.naturalWidth,Z.height=k.naturalHeight,this.annotator=f2(Z,k,()=>{H(null),U.disabled=!this.annotator?.hasSelection()})},k.src=J,[j,Q,M("p","status",z.annotateHelp),Y]}}}function Y1(){try{return E6()}catch{return[]}}function M($,z="",J=""){let j=document.createElement($);if(z)j.className=z;if(J)j.textContent=J;return j}function b6($,z){return z>=24&&z%24===0?$.days.replace("{n}",String(z/24)):$.hours.replace("{n}",String(z))}var R2=["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"],W1=7,p6=[["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"}]],T2=[["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"}]],y6=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M12 6v6l4 2"}]],v6=[["path",{d:"M20 6 9 17l-5-5"}]],h2="http://www.w3.org/2000/svg";function A2($,z,J,j){let Q=b("","kind");Q.dataset.kind=$;let Z=M("span","kind-top");return Z.append(d0(z),M("b","",J)),Q.append(Z,M("span","kind-hint",j),d0(v6,"tick")),Q}function d0($,z="icon"){let J=document.createElementNS(h2,"svg");for(let[j,Q]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:z}))J.setAttribute(j,Q);for(let[j,Q]of $){let Z=document.createElementNS(h2,j);for(let[Y,X]of Object.entries(Q))Z.setAttribute(Y,X);J.append(Z)}return J}function b($,z=""){let J=document.createElement("button");if(J.type="button",J.textContent=$,z)J.className=z;return J}function u0($,z="",J=!1){return i0(document.createElement("label"),$,z,J)}function i0($,z,J="",j=!1){if($.replaceChildren(document.createTextNode(z)),j){let Q=document.createElement("span");Q.className="req",Q.textContent=" *",$.append(Q)}if(J){let Q=document.createElement("span");Q.className="hint",Q.textContent=` ${J}`,$.append(Q)}return $}function L2(){if(typeof window>"u"||customElements.get(k0))return;customElements.define(k0,g6())}var E2=!1;function G1($={}){if(E2||typeof window>"u")return;if(!f0()){console.error("[debug-capture] configureDebugCapture() must be called before install");return}if(E2=!0,t1(),T1(),C1(),i1(),j2(),$.ui===!1)return;let z=m0(f().locale);if(b1((j)=>{X0(j.message??z.crashed,"error",{label:z.crashAction,onClick:()=>A0(j)})}),L2(),!document.querySelector(k0))document.body.append(document.createElement(k0));let J=window.requestIdleCallback;if(J)J(()=>void F0(),{timeout:5000});else setTimeout(()=>void F0(),2000)}var m2=document.currentScript,p=m2?.dataset??{},u6="rrweb-record.mjs";J2(()=>import(new URL(u6,m2?.src??location.href).href));function i6($){if(!$)return{};try{let z=JSON.parse($);if(!z||typeof z!=="object"||Array.isArray(z))return{};return Object.fromEntries(Object.entries(z).filter(([,J])=>typeof J==="string"&&J.trim()))}catch{return{}}}if(p.host&&p.realmKey)if(X1({host:p.host,realmKey:p.realmKey,app:{name:p.appName??document.title??"app",version:p.appVersion??"0.0.0",environment:p.environment??"production"},module:w1(i6(p.modules)),locale:p.locale==="en"?"en":"th",...p.replay!==void 0?{replay:{seconds:Number(p.replay)||void 0}}:{}}),document.body)G1();else document.addEventListener("DOMContentLoaded",()=>G1(),{once:!0});window.lwReportProblem=A0;})();
|