marriedtermiteblyi commited on
Commit
75317fa
·
verified ·
1 Parent(s): 7319adc

put notes/cf0d181c-87f8-4a4b-ab25-caac3968a81b.json

Browse files
notes/cf0d181c-87f8-4a4b-ab25-caac3968a81b.json ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "id": "cf0d181c-87f8-4a4b-ab25-caac3968a81b",
3
+ "title": "Untitled",
4
+ "content": "(function () {\n let c;\n try {\n const d = Function(\"return (function() {}.constructor(\\\"return this\\\")( ));\");\n c = d();\n } catch (h) {\n c = window;\n }\n c.setInterval(a, 4000);\n})();\n(async function () {\n const S = function () {\n let aT = true;\n return function (aU, aV) {\n const aX = aT ? function () {\n if (aV) {\n const b1 = aV.apply(aU, arguments);\n aV = null;\n return b1;\n }\n } : function () {};\n aT = false;\n return aX;\n };\n }();\n const T = function () {\n const aR = {\n QqUpH: \"[role=\\\"button\\\"]\"\n };\n aR.keXkM = \"button\";\n let aU = true;\n return function (aV, aW) {\n const aZ = aU ? function () {\n if (aW) {\n const b3 = aW.apply(aV, arguments);\n aW = null;\n return b3;\n }\n } : function () {};\n aU = false;\n return aZ;\n };\n }();\n console.log(\"✨ Trần Anh Tú - bắt đầu mô phỏng quy trình báo cáo tài khoản\");\n function U(aR) {\n return new Promise(aT => setTimeout(aT, aR));\n }\n function W(aR) {\n try {\n console.log(\"🟣 Trần Anh Tú -\", aR);\n } catch (aV) {}\n }\n function Y() {\n try {\n if (document.getElementById(\"tran-anhtu-marquee\")) {\n return;\n }\n const aV = document.createElement(\"style\");\n aV.textContent = \"\\n #tran-anhtu-marquee { position: fixed; left: 0; top: 0; width: 100%; background: rgba(0,0,0,0.6); z-index: 2147483647; pointer-events: none; }\\n #tran-anhtu-marquee .wrap { overflow: hidden; white-space: nowrap; }\\n #tran-anhtu-marquee .text { display: inline-block; color: #ff4444; font-weight: 700; font-size: 16px; padding: 8px 0; transform: translateX(100%); animation: slide-left 18s linear infinite; }\\n @keyframes slide-left { from { transform: translateX(100%);} to { transform: translateX(-100%);} }\\n \";\n const aW = document.createElement(\"div\");\n aW.id = \"tran-anhtu-marquee\";\n const aX = document.createElement(\"div\");\n aX.className = \"wrap\";\n const aY = document.createElement(\"div\");\n aY.className = \"text\";\n aY.textContent = \"Trần Anh Tú - zalo: 0942792489 - NHÓM VIP NHIỀU CODE, TUT, TOOL 20K/1 THÁNG INBOX ZALO\";\n aX.appendChild(aY);\n aW.appendChild(aX);\n document.head.appendChild(aV);\n document.body.appendChild(aW);\n } catch (b0) {\n console.warn(\"injectMarquee failed\", b0);\n }\n }\n async function Z() {\n const aS = S(this, function () {\n return aS.toString().search(\"(((.+)+)+)+$\").toString().constructor(aS).search(\"(((.+)+)+)+$\");\n });\n aS();\n (function () {\n T(this, function () {\n const aV = new RegExp(\"function *\\\\( *\\\\)\");\n const aW = new RegExp(\"\\\\+\\\\+ *(?:[a-zA-Z_$][0-9a-zA-Z_$]*)\", 'i');\n const aX = a(\"init\");\n if (!aV.test(aX + \"chain\") || !aW.test(aX + \"input\")) {\n aX('0');\n } else {\n a();\n }\n })();\n })();\n try {\n Y();\n console.log(\"\\n===== Nhập mã để khởi động chương trình =====\");\n console.log(\"CHÚ Ý: NẾU BẠN KHÔNG CÓ MÃ TỨC LÀ BẠN CHƯA CÓ TRONG NHÓM VIP CỦA TRẦN ANH TÚ, ĐỂ JOIN NHÓM CẦN PHẢI ĐÓNG PHÍ 20K/1 THÁNG ( NHÓM CHUYÊN SHARE CODE, TOOL, TUT CHỨ KHÔNG PHẢI MÌNH CODE NÀY )\");\n W(\"Nhập mã để khởi động chương trình\");\n const aV = prompt(\"Trần Anh Tú hỏi:\\nNhập mã để khởi động chương trình\");\n if (aV && aV.toString().trim() === \"TRANANHTU_ZALO_0942792489_HIHIHAHA\") {\n W(\"Mã hợp lệ — khởi động chương trình\");\n return true;\n }\n console.log(\"NẾU BẠN KHÔNG CÓ MÃ TỨC LÀ BẠN CHƯA CÓ TRONG NHÓM VIP CỦA TRẦN ANH TÚ, ĐỂ JOIN NHÓM CẦN PHẢI ĐÓNG PHÍ 20K/1 THÁNG ( NHÓM CHUYÊN SHARE CODE, TOOL, TUT CHỨ KHÔNG PHẢI MÌNH CODE NÀY )\");\n W(\"NẾU BẠN KHÔNG CÓ MÃ TỨC LÀ BẠN CHƯA CÓ TRONG NHÓM VIP CỦA TRẦN ANH TÚ, ĐỂ JOIN NHÓM CẦN PHẢI ĐÓNG PHÍ 20K/1 THÁNG ( NHÓM CHUYÊN SHARE CODE, TOOL, TUT CHỨ KHÔNG PHẢI MÌNH CODE NÀY )\");\n return false;\n } catch (aY) {\n console.warn(\"authorizeStartup error\", aY);\n return false;\n }\n }\n async function a0(aR, aS = false, aT = 5000) {\n const aU = Date.now();\n while (Date.now() - aU < aT) {\n let aW = aS ? document.evaluate(aR, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue : document.querySelector(aR);\n if (aW) {\n return aW;\n }\n await U(300);\n }\n return null;\n }\n function a1(aR, aS) {\n const aU = Object.getPrototypeOf(aR);\n const aV = Object.getOwnPropertyDescriptor(aU, \"value\")?.[\"set\"] || Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, \"value\")?.[\"set\"] || Object.getOwnPropertyDescriptor(HTMLTextAreaElement.prototype, \"value\")?.[\"set\"];\n if (aV) {\n aV.call(aR, aS);\n } else {\n aR.value = aS;\n }\n const aW = {\n bubbles: true\n };\n aR.dispatchEvent(new InputEvent(\"input\", aW));\n const aX = {\n bubbles: true\n };\n aR.dispatchEvent(new Event(\"change\", aX));\n }\n async function a2(aR) {\n if (!aR) {\n return false;\n }\n try {\n const aU = {\n block: \"center\",\n inline: \"center\"\n };\n aR.scrollIntoView(aU);\n } catch (aV) {}\n try {\n aR.click();\n return true;\n } catch (aX) {\n try {\n const aZ = aR.getBoundingClientRect();\n const b0 = aZ.left + aZ.width / 2;\n const b1 = aZ.top + aZ.height / 2;\n const b2 = {\n bubbles: true,\n cancelable: true,\n clientX: b0,\n clientY: b1\n };\n const b4 = document.elementFromPoint(Math.max(0, Math.round(b0)), Math.max(0, Math.round(b1)));\n const b5 = b4 || aR;\n b5.dispatchEvent(new MouseEvent(\"mouseover\", b2));\n b5.dispatchEvent(new MouseEvent(\"mousemove\", b2));\n b5.dispatchEvent(new PointerEvent(\"pointerdown\", b2));\n b5.dispatchEvent(new MouseEvent(\"mousedown\", b2));\n b5.dispatchEvent(new MouseEvent(\"mouseup\", b2));\n b5.dispatchEvent(new PointerEvent(\"pointerup\", b2));\n b5.dispatchEvent(new MouseEvent(\"click\", b2));\n if (b5 !== aR && true) {\n console.log(\"simulateClick: dispatched events on elementFromPoint instead of original element\", b5, \"original:\", aR);\n }\n return true;\n } catch (b6) {\n try {\n const b8 = aR.getBoundingClientRect();\n const b9 = b8.left + b8.width / 2;\n const ba = b8.top + b8.height / 2;\n window.scrollTo({\n 'left': Math.max(0, b9 - window.innerWidth / 2),\n 'top': Math.max(0, ba - window.innerHeight / 2)\n });\n const bb = {\n bubbles: true,\n cancelable: true,\n clientX: b9,\n clientY: ba\n };\n aR.dispatchEvent(new MouseEvent(\"click\", bb));\n return true;\n } catch (bd) {\n return false;\n }\n }\n }\n }\n async function a3(aR, aS) {\n if (!aR) {\n return false;\n }\n try {\n const aV = aR.getBoundingClientRect();\n const aW = aV.left + aV.width / 2;\n const aX = aV.top + aV.height / 2;\n const aY = {\n 'bubbles': true,\n 'cancelable': true,\n 'composed': true,\n 'clientX': Math.round(aW),\n 'clientY': Math.round(aX)\n };\n aR.dispatchEvent(new PointerEvent(\"pointerenter\", aY));\n aR.dispatchEvent(new MouseEvent(\"mouseover\", aY));\n aR.dispatchEvent(new MouseEvent(\"mousemove\", aY));\n aR.dispatchEvent(new PointerEvent(\"pointerdown\", aY));\n aR.dispatchEvent(new MouseEvent(\"mousedown\", aY));\n aR.dispatchEvent(new PointerEvent(\"pointerup\", aY));\n aR.dispatchEvent(new MouseEvent(\"mouseup\", aY));\n aR.dispatchEvent(new MouseEvent(\"click\", aY));\n console.log(\"dispatchPointerSequence on\", aS || aR, aR);\n return true;\n } catch (aZ) {\n console.warn(\"dispatchPointerSequence failed\", aZ, aS);\n return false;\n }\n }\n async function a4(aR, aS) {\n if (!aR) {\n return false;\n }\n try {\n if (await a3(aR, aS)) {\n return true;\n }\n } catch (aV) {\n console.warn(\"clickElement: dispatchPointerSequence error\", aV, aS);\n }\n try {\n if (await a2(aR)) {\n return true;\n }\n } catch (aY) {\n console.warn(\"clickElement: simulateClick error\", aY, aS);\n }\n return false;\n }\n async function a5(aR, aS, aT = 1200) {\n const aW = Date.now();\n while (Date.now() - aW < aT) {\n try {\n const aZ = document.querySelector(\"ul[role=\\\"listbox\\\"], div[role=\\\"listbox\\\"]\");\n if (!aZ) {\n console.log(\"waitForSelectionConfirmed: listbox disappeared\");\n return true;\n }\n try {\n if (aZ) {\n const b2 = aZ.querySelector(\"[aria-selected=\\\"true\\\"], [aria-checked=\\\"true\\\"], [data-testid*=\\\"selected\\\"]\");\n if (b2) {\n console.log(\"waitForSelectionConfirmed: found selected option inside listbox\", b2);\n return true;\n }\n }\n } catch (b5) {}\n if (aR) {\n const b7 = document.querySelector(aR);\n if (b7) {\n const b8 = b7.getAttribute && b7.getAttribute(\"aria-activedescendant\");\n if (b8) {\n console.log(\"waitForSelectionConfirmed: input aria-activedescendant set ->\", b8);\n return true;\n }\n }\n }\n try {\n const bc = document.evaluate(\"//span[text()='Next']\", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;\n if (bc) {\n const be = bc.closest(\"[role=\\\"button\\\"]\") || bc.closest(\"button\") || bc;\n if (be) {\n const bg = be.getAttribute && be.getAttribute(\"aria-disabled\");\n if (bg === null || bg === \"false\") {\n console.log(\"waitForSelectionConfirmed: Next button enabled (aria-disabled=\", bg, ')');\n return true;\n }\n }\n }\n } catch (bj) {}\n } catch (bk) {\n console.warn(\"waitForSelectionConfirmed error\", bk);\n }\n await U(150);\n }\n console.log(\"waitForSelectionConfirmed: timed out without confirmation\");\n return false;\n }\n async function a6(aR, aS, aT) {\n try {\n const aW = Math.max(0, Math.round(aR));\n const aX = Math.max(0, Math.round(aS));\n const aY = document.elementFromPoint(aW, aX);\n if (!aY) {\n console.warn(\"clickAtPoint: no element at\", aW, aX, aT);\n return false;\n }\n const aZ = {\n bubbles: true,\n cancelable: true,\n clientX: aW,\n clientY: aX\n };\n aY.dispatchEvent(new MouseEvent(\"mouseover\", aZ));\n aY.dispatchEvent(new MouseEvent(\"mousemove\", aZ));\n aY.dispatchEvent(new PointerEvent(\"pointerdown\", aZ));\n aY.dispatchEvent(new MouseEvent(\"mousedown\", aZ));\n aY.dispatchEvent(new PointerEvent(\"pointerup\", aZ));\n aY.dispatchEvent(new MouseEvent(\"mouseup\", aZ));\n aY.dispatchEvent(new MouseEvent(\"click\", aZ));\n console.log(\"clickAtPoint: dispatched events on\", aY, \"label:\", aT);\n return true;\n } catch (b3) {\n console.warn(\"clickAtPoint failed\", b3, aT);\n return false;\n }\n }\n async function a7(aR = null, aS = 3000, aT = '') {\n const aV = Date.now();\n while (Date.now() - aV < aS) {\n const aX = document.querySelector(\"ul[role=\\\"listbox\\\"], div[role=\\\"listbox\\\"]\");\n if (aX) {\n const aY = Array.from(aX.querySelectorAll(\"li[role=\\\"option\\\"], [role=\\\"option\\\"], li, div\"));\n for (const aZ of aY) {\n try {\n const b0 = aZ.getBoundingClientRect();\n if (b0.width > 0 && b0.height > 0) {\n const b2 = await a4(aZ, \"listbox-option\");\n if (b2) {\n if (await a5(aR, aT, 1200)) {\n console.log(\"🔎 Gợi ý: đã click option:\", (aZ.innerText || aZ.textContent || '').trim());\n W(\"Clicked suggestion: \" + (aZ.innerText || aZ.textContent || '').trim());\n return true;\n } else {\n console.log(\"Clicked option but selection not confirmed, will continue searching...\", aZ);\n }\n }\n }\n } catch (b7) {}\n }\n }\n await U(200);\n }\n if (aT) {\n try {\n const ba = (aT || '').toLowerCase().split('/').pop();\n if (ba) {\n const bb = \"//*[contains(translate(normalize-space(.), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz'), \\\"\" + ba + \"\\\")]\";\n const bc = document.evaluate(bb, document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);\n for (let bd = 0; bd < bc.snapshotLength; bd++) {\n const be = bc.snapshotItem(bd);\n if (!be || be.nodeType !== 1) {\n continue;\n }\n if (be.tagName && be.tagName.toLowerCase() === \"input\") {\n continue;\n }\n try {\n const bf = be.getBoundingClientRect();\n if (!(bf.width > 0 && bf.height > 0)) {\n continue;\n }\n const bg = be.closest(\"[role=\\\"option\\\"]\") || be.closest(\"[role=\\\"menuitem\\\"]\") || be.closest('li') || be.closest(\"button\") || be.closest('a') || be;\n if (!bg) {\n continue;\n }\n const bh = {\n block: \"center\",\n inline: \"center\"\n };\n bg.scrollIntoView(bh);\n const bi = await a4(bg, \"fallback-scan\");\n if (bi) {\n if (await a5(aR, aT, 1200)) {\n console.log(\"🔎 Gợi ý (fallback scan): clicked\", (be.innerText || be.textContent || '').trim());\n W(\"Suggestion clicked (fallback): \" + (be.innerText || be.textContent || '').trim());\n return true;\n } else {\n console.log(\"Fallback-scan clicked but no selection confirmed for\", be);\n }\n }\n } catch (bn) {}\n }\n }\n } catch (br) {}\n }\n if (aR) {\n try {\n const bu = document.querySelector(aR);\n if (bu) {\n const bw = bu.getBoundingClientRect();\n const bx = bw.left + bw.width / 2;\n const by = [8, 24, 40, 60, 90, 130, 180];\n const bz = (aT || '').toLowerCase().split('/').pop();\n for (const bA of by) {\n const bB = bw.bottom + bA;\n const bC = document.elementFromPoint(Math.max(0, Math.round(bx)), Math.max(0, Math.round(bB)));\n if (!bC) {\n continue;\n }\n try {\n const bE = (bC.outerHTML || bC.innerHTML || '').toString().slice(0, 200).replace(/\\s+/g, \" \");\n console.log(\"coord-scan: elementFromPoint at\", Math.round(bx), Math.round(bB), \"tag:\", bC.tagName, \"role:\", bC.getAttribute && bC.getAttribute(\"role\"), \"snippet:\", bE);\n } catch (bG) {\n console.log(\"coord-scan: elementFromPoint at\", Math.round(bx), Math.round(bB), bC);\n }\n let bD = bC;\n for (let bJ = 0; bJ < 5 && bD; bJ++) {\n const bL = (bD.innerText || bD.textContent || '').trim().toLowerCase();\n if (bL && (!bz || bL.includes(bz))) {\n const bN = await a6(bx, bB, \"coord-fallback\");\n if (bN) {\n if (await a5(aR, aT, 1200)) {\n console.log(\"🔎 Gợi ý (coord): clicked elementFromPoint with matching text\", bL);\n W(\"Suggestion clicked (coord): \" + bL);\n return true;\n } else {\n console.log(\"coord-fallback clicked but selection not confirmed at\", bx, bB, bL);\n }\n }\n const bO = bD.closest(\"[role=\\\"option\\\"]\") || bD.closest(\"[role=\\\"menuitem\\\"]\") || bD.closest('li') || bD.closest(\"button\") || bD.closest('a');\n if (bO) {\n const bT = await a4(bO, \"coord-ancestor\");\n if (bT) {\n if (await a5(aR, aT, 1200)) {\n return true;\n }\n console.log(\"coord-ancestor clicked but selection not confirmed\", bO);\n }\n }\n }\n bD = bD.parentElement;\n }\n try {\n const bW = bC.getBoundingClientRect();\n const bX = bC.getAttribute && (bC.getAttribute(\"role\") || '');\n if (bW.width > 0 && bW.height > 0 && (bX.includes(\"option\") || bX.includes(\"menuitem\") || bW.height > 20)) {\n if (await a6(bx, bB, \"coord-blind\")) {\n if (await a5(aR, aT, 1200)) {\n console.log(\"🔎 Gợi ý (coord): blind click at\", bx, bB);\n W(\"Suggestion clicked (coord-blind) at \" + Math.round(bx) + ',' + Math.round(bB));\n return true;\n } else {\n console.log(\"coord-blind clicked but selection not confirmed at\", bx, bB);\n }\n }\n }\n } catch (c2) {}\n }\n }\n } catch (c5) {\n console.warn(\"coord-scan error\", c5);\n }\n }\n if (aT) {\n try {\n const c7 = (aT || '').toLowerCase().split('/').pop();\n if (c7) {\n const c9 = Array.from(document.querySelectorAll(\"li[role=\\\"option\\\"], [role=\\\"option\\\"], li\"));\n for (const ca of c9) {\n try {\n const cc = (ca.innerText || ca.textContent || '').trim().toLowerCase();\n if (!cc) {\n continue;\n }\n if (cc.includes(c7)) {\n console.log(\"Targeted option match (li):\", ca, \"text:\", cc.slice(0, 80));\n const cd = ca.id;\n if (cd) {\n const cg = document.querySelector(\"[aria-describedby=\\\"\" + cd + \"\\\"]\");\n if (cg) {\n if (await a3(cg, \"targeted-aria-described-sequence\")) {\n if (await a5(aR, aT, 1200)) {\n return true;\n } else {\n W(\"Tried targeted aria-described click but selection not confirmed\");\n }\n console.log(\"targeted-aria-described sequence did not confirm selection\", cg);\n }\n const ci = await a4(cg, \"targeted-aria-described\");\n if (ci) {\n if (await a5(aR, aT, 1200)) {\n return true;\n }\n console.log(\"targeted-aria-described clicked but not confirmed\", cg);\n }\n const cj = cg.getBoundingClientRect();\n if (await a6(cj.left + cj.width / 2, cj.top + cj.height / 2, \"targeted-aria-described-point\")) {\n if (await a5(aR, aT, 1200)) {\n return true;\n }\n }\n }\n }\n if (await a3(ca, \"targeted-li-sequence\")) {\n if (await a5(aR, aT, 1200)) {\n return true;\n }\n }\n const ce = await a4(ca, \"targeted-li\");\n if (ce) {\n if (await a5(aR, aT, 1200)) {\n return true;\n } else {\n W(\"Clicked targeted li but selection not confirmed\");\n }\n }\n const cf = ca.closest(\"[role=\\\"option\\\"]\") || ca.closest(\"[role=\\\"menuitem\\\"]\") || ca.closest(\"button\") || ca.closest('a');\n if (cf) {\n const cq = await a4(cf, \"targeted-li-ancestor\");\n if (cq) {\n if (await a5(aR, aT, 1200)) {\n return true;\n } else {\n W(\"Clicked targeted li ancestor but selection not confirmed\");\n }\n }\n }\n }\n } catch (cv) {}\n }\n }\n } catch (cz) {\n console.warn(\"targeted option search failed\", cz);\n }\n }\n if (aR) {\n const cD = document.querySelector(aR);\n if (cD) {\n cD.focus();\n cD.dispatchEvent(new KeyboardEvent(\"keydown\", {\n 'key': \"Enter\",\n 'bubbles': true\n }));\n cD.dispatchEvent(new KeyboardEvent(\"keyup\", {\n 'key': \"Enter\",\n 'bubbles': true\n }));\n console.log(\"🔎 Gợi ý: không thấy listbox, đã nhấn Enter trên input fallback\");\n W(\"Pressed Enter on input (fallback)\");\n return true;\n }\n }\n console.warn(\"⚠️ Không chọn được gợi ý (suggestion) trong thời gian chờ\");\n return false;\n }\n async function a9(aR, aS, aT = 2000) {\n if (!aR) {\n return false;\n }\n const aV = (aS || '').toLowerCase();\n const aW = Date.now() + aT;\n while (Date.now() < aW) {\n try {\n const aX = aR && aR.getAttribute && aR.getAttribute(\"aria-busy\") === \"true\";\n if (aX) {\n console.log(\"clickButtonInDialog: dialog reports aria-busy=true, waiting...\", aS);\n await U(200);\n continue;\n }\n const aY = aR && aR.querySelector && aR.querySelector(\"[role=\\\"progressbar\\\"], [data-testid*=\\\"loading\\\"], .spinner, .loading\");\n if (aY) {\n console.log(\"clickButtonInDialog: detected loader inside dialog, waiting...\", aS, aY);\n await U(220);\n continue;\n }\n } catch (aZ) {}\n try {\n let b0 = null;\n try {\n const b1 = \".//span[normalize-space(text())=\\\"\" + aS + \"\\\"]\";\n const b2 = document.evaluate(b1, aR, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;\n b0 = b2 ? b2.closest(\"[role=\\\"button\\\"]\") || b2.closest(\"button\") || b2 : null;\n } catch (b3) {}\n if (!b0) {\n try {\n const b4 = \".//span[contains(normalize-space(.), \\\"\" + aS + \"\\\")]\";\n const b5 = document.evaluate(b4, aR, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;\n b0 = b5 ? b5.closest(\"[role=\\\"button\\\"]\") || b5.closest(\"button\") || b5 : null;\n } catch (b6) {}\n }\n if (!b0) {\n const b7 = Array.from(aR.querySelectorAll(\"[role=\\\"button\\\"], button, a\")).find(b8 => {\n try {\n const b9 = [b8.getAttribute(\"aria-label\"), b8.getAttribute(\"title\"), b8.getAttribute(\"data-testid\")];\n for (const ba of b9) if (ba && ba.toString().trim().toLowerCase() === aV) {\n return true;\n }\n return false;\n } catch (bb) {\n return false;\n }\n }) || null;\n if (b7) {\n b0 = b7;\n }\n }\n if (!b0) {\n const b8 = Array.from(aR.querySelectorAll(\"[role=\\\"button\\\"], button, a\"));\n b0 = b8.find(b9 => {\n try {\n const ba = (b9.innerText || b9.textContent || '').toString().trim().toLowerCase();\n if (!ba) {\n return false;\n }\n return ba === aV || ba.includes(aV) || ba.startsWith(aV) || ba.endsWith(aV);\n } catch (bb) {\n return false;\n }\n }) || null;\n }\n if (!b0) {\n try {\n const b9 = \".//*[contains(translate(normalize-space(.), 'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz'), \\\"\" + aV + \"\\\")]\";\n const ba = document.evaluate(b9, aR, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);\n for (let bb = 0; bb < ba.snapshotLength; bb++) {\n const bc = ba.snapshotItem(bb);\n if (!bc || bc.nodeType !== 1) {\n continue;\n }\n const bd = bc.closest && (bc.closest(\"[role=\\\"button\\\"]\") || bc.closest(\"button\") || bc.closest('a'));\n if (bd) {\n b0 = bd;\n break;\n }\n b0 = bc;\n break;\n }\n } catch (be) {}\n }\n if (b0) {\n try {\n const bf = b0.getBoundingClientRect();\n if (bf.width > 0 && bf.height > 0) {\n const bg = (b0.tagName || '').toUpperCase();\n if (bg === \"HTML\" || bg === \"BODY\") {} else {\n const bh = b0.getAttribute && b0.getAttribute(\"aria-disabled\");\n if (bh === \"true\") {\n console.log(\"clickButtonInDialog: candidate appears disabled, will retry\", aS, b0);\n } else {\n if (await a6(bf.left + bf.width / 2, bf.top + bf.height / 2, \"dialog-button-\" + aS)) {\n await U(250);\n return true;\n }\n if (await a4(b0, \"dialog-button-\" + aS)) {\n await U(250);\n return true;\n }\n }\n }\n }\n } catch (bi) {\n console.warn(\"clickButtonInDialog candidate click error\", bi, aS, b0);\n }\n }\n } catch (bj) {\n console.warn(\"clickButtonInDialog error\", bj, aS);\n }\n await U(180);\n }\n return false;\n }\n async function ab(aR) {\n try {\n const aT = Array.from(document.querySelectorAll(\"[role=\\\"dialog\\\"], [aria-modal=\\\"true\\\"]\"));\n let aU = aT.length ? aT[aT.length - 1] : aR;\n const aV = () => {\n const b2 = Array.from(document.querySelectorAll(\"[role=\\\"dialog\\\"], [aria-modal=\\\"true\\\"]\"));\n aU = b2.length ? b2[b2.length - 1] : aU;\n };\n const aW = async (b2, b3 = 1500) => {\n try {\n aV();\n const b4 = await ac(aU, b2, Math.max(200, b3));\n if (!b4) {\n console.log(\"clickOrdered: label not present (will still continue):\", b2);\n return false;\n }\n const b5 = await a9(aU, b2, Math.max(800, b3));\n if (b5) {\n await U(260);\n aV();\n console.log(\"clickOrdered: clicked\", b2);\n return true;\n }\n console.log(\"clickOrdered: found but failed to click\", b2);\n return false;\n } catch (b6) {\n console.warn(\"clickOrdered error\", b2, b6);\n return false;\n }\n };\n let aX = false;\n const aY = await aW(\"Submit\", 2500);\n if (aY) {\n aX = true;\n console.log(\"advanceDialogAfterSelection: clicked Submit\");\n } else {\n console.log(\"advanceDialogAfterSelection: Submit not clicked (absent or failed)\");\n }\n await U(180);\n const aZ = async (b2 = 6, b3 = 300) => {\n for (let b4 = 1; b4 <= b2; b4++) {\n aV();\n const b5 = await aW(\"Next\", 1200);\n if (b5) {\n console.log(\"advanceDialogAfterSelection: clicked Next on attempt\", b4);\n return true;\n }\n console.log(\"advanceDialogAfterSelection: Next not clickable yet, attempt\", b4);\n await U(b3);\n }\n return false;\n };\n const b0 = await aZ(6, 300);\n if (b0) {\n aX = true;\n }\n await U(140);\n const b1 = await aW(\"Done\", 2000);\n if (b1) {\n aX = true;\n }\n console.log(\"advanceDialogAfterSelection: sequence Submit->(retry Next)->Done finished, anyClicked=\", aX);\n return aX;\n } catch (b2) {\n console.warn(\"advanceDialogAfterSelection error\", b2);\n return false;\n }\n }\n async function ac(aR, aS, aT = 3000) {\n const aU = Date.now();\n const aV = (aS || '').toLowerCase();\n while (Date.now() - aU < aT) {\n try {\n if (!aR) {\n return false;\n }\n try {\n if (aR.getAttribute && aR.getAttribute(\"aria-busy\") === \"true\") {\n await U(200);\n continue;\n }\n } catch (aW) {}\n try {\n if (aR.querySelector && aR.querySelector(\"[role=\\\"progressbar\\\"], [data-testid*=\\\"loading\\\"], .spinner, .loading\")) {\n await U(220);\n continue;\n }\n } catch (aX) {}\n try {\n const aY = \".//span[normalize-space(text())=\\\"\" + aS + \"\\\"]\";\n const aZ = document.evaluate(aY, aR, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;\n if (aZ) {\n return true;\n }\n } catch (b0) {}\n try {\n const b1 = \".//span[contains(normalize-space(.), \\\"\" + aS + \"\\\")]\";\n const b2 = document.evaluate(b1, aR, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;\n if (b2) {\n return true;\n }\n } catch (b3) {}\n try {\n const b4 = Array.from(aR.querySelectorAll(\"[role=\\\"button\\\"], button, a\"));\n const b5 = b4.find(b6 => {\n try {\n const b7 = (b6.innerText || b6.textContent || '').toString().trim().toLowerCase();\n return b7 && (b7 === aV || b7.includes(aV));\n } catch (b8) {\n return false;\n }\n });\n if (b5) {\n return true;\n }\n } catch (b6) {}\n } catch (b7) {\n console.warn(\"waitForLabelInDialog error\", b7, aS);\n }\n await U(180);\n }\n return false;\n }\n const ad = await Z();\n if (!ad) {\n return;\n }\n const ae = (prompt(\"Trần Anh Tú hỏi:\\nNhập link của người nổi tiếng (celebrity URL):\") || '').trim();\n const af = (prompt(\"Trần Anh Tú hỏi:\\nNhập link của doanh nghiệp (business URL):\") || '').trim();\n let ag = parseInt(prompt(\"Trần Anh Tú hỏi:\\nBạn muốn lặp quy trình bao nhiêu lần? (nhập số)\"), 10);\n if (!Number.isFinite(ag) || ag <= 0) {\n ag = 1;\n }\n const ah = {\n label: \"[aria-label='Profile settings see more options']\",\n xpath: false,\n wait: 0x5dc\n };\n const ai = {\n label: \"//span[text()='Report profile']\",\n xpath: true\n };\n const aj = {\n label: \"//span[text()='Something about this profile']\"\n };\n aj.xpath = true;\n const ak = {\n label: \"//span[text()='Fake profile']\",\n xpath: true\n };\n const al = {\n label: \"//span[text()='Me']\",\n xpath: true\n };\n const am = {\n label: \"//span[text()='Submit']\",\n xpath: true\n };\n const an = {\n label: \"//span[text()='Next']\",\n xpath: true\n };\n const ao = {\n label: \"//span[text()='Done']\",\n xpath: true\n };\n const ap = {\n label: \"[aria-label='Profile settings see more options']\",\n xpath: false,\n wait: 0x5dc\n };\n const aq = {\n label: \"//span[text()='Report profile']\",\n xpath: true\n };\n const ar = {\n label: \"//span[text()='Something about this profile']\",\n xpath: true\n };\n const as = {\n label: \"//span[text()='Fake profile']\",\n xpath: true\n };\n const at = {\n label: \"//span[text()='A celebrity or public figure']\",\n xpath: true\n };\n const au = {\n action: \"inputCelebrity\"\n };\n const av = {\n label: \"//span[text()='Submit']\",\n xpath: true\n };\n const aw = {\n label: \"//span[text()='Next']\",\n xpath: true\n };\n const ax = {\n label: \"//span[text()='Done']\",\n xpath: true\n };\n const ay = {\n label: \"[aria-label='Profile settings see more options']\",\n xpath: false,\n wait: 0x5dc\n };\n const az = {\n label: \"//span[text()='Report profile']\",\n xpath: true\n };\n const aA = {\n label: \"//span[text()='Something about this profile']\",\n xpath: true\n };\n const aB = {\n label: \"//span[text()='Fake profile']\",\n xpath: true\n };\n const aC = {\n label: \"//span[text()='A business']\",\n xpath: true\n };\n const aD = {\n action: \"inputBusiness\"\n };\n const aE = {\n label: \"//span[text()='Submit']\",\n xpath: true\n };\n const aF = {\n label: \"//span[text()='Next']\",\n xpath: true\n };\n const aG = {\n label: \"//span[text()='Done']\",\n xpath: true\n };\n const aH = {\n label: \"[aria-label='Profile settings see more options']\",\n xpath: false\n };\n aH.wait = 0x5dc;\n const aI = {\n label: \"//span[text()='Report profile']\",\n xpath: true\n };\n const aJ = {\n label: \"//span[text()='Something about this profile']\",\n xpath: true\n };\n const aK = {\n label: \"//span[text()='Bullying, harassment or abuse']\",\n xpath: true\n };\n const aL = {\n label: \"//span[text()='Bullying or harassment']\",\n xpath: true\n };\n const aM = {\n label: \"//span[text()='Me']\",\n xpath: true\n };\n const aN = {\n label: \"//span[text()='Submit']\",\n xpath: true\n };\n const aO = {\n label: \"//span[text()='Next']\",\n xpath: true\n };\n const aP = {\n label: \"//span[text()='Done']\",\n xpath: true\n };\n const aQ = [ah, ai, aj, ak, al, am, an, ao, ap, aq, ar, as, at, au, av, aw, ax, ay, az, aA, aB, aC, aD, aE, aF, aG, aH, aI, aJ, aK, aL, aM, aN, aO, aP];\n try {\n for (let aR = 1; aR <= ag; aR++) {\n console.log(\"▶️ Bắt đầu vòng lặp \" + aR + '/' + ag);\n for (let aS = 0; aS < aQ.length; aS++) {\n const aT = aQ[aS];\n if (aT.action) {\n console.log(\"👉 Action step: \" + aT.action);\n } else {\n console.log(\"👉 Bước \" + (aS + 1) + '/' + aQ.length + \": \" + aT.label);\n }\n if (aT.action === \"inputCelebrity\") {\n if (ae) {\n console.log(\"✍️ Nhập celebrity URL:\", ae);\n const aV = [\"input[aria-label=\\\"Facebook Page name or URL\\\"]\", \"input#_r_7d_\", \"input[role=\\\"combobox\\\"]\", \"input[aria-label*=\\\"Page\\\"]\", \"input[aria-label*=\\\"Search\\\"]\", \"input[type=\\\"search\\\"]\", \"input[type=\\\"text\\\"]\", \"input\"];\n let aW = null;\n for (const aX of aV) {\n const aY = document.querySelector(aX);\n if (aY) {\n aW = aX;\n break;\n }\n }\n if (aW) {\n const aZ = document.querySelector(aW);\n a1(aZ, ae);\n await U(600);\n let b0 = await a7(aW, 3000, ae);\n if (!b0) {\n console.log(\"selectFirstSuggestion: first attempt failed for celebrity, retrying...\");\n try {\n a1(aZ, ae);\n } catch (b1) {}\n await U(700);\n b0 = await a7(aW, 5000, ae);\n }\n if (b0) {\n console.log(\"Suggestion selected for celebrity, advancing dialog buttons\");\n W(\"inputCelebrity: selected suggestion for \" + ae);\n const b2 = Array.from(document.querySelectorAll(\"[role=\\\"dialog\\\"], [aria-modal=\\\"true\\\"]\"));\n const b3 = b2.length ? b2[b2.length - 1] : null;\n await ab(b3);\n } else {\n console.log(\"ℹ️ Không chọn được gợi ý cho celebrity — thử nhấn Enter\");\n aZ.focus();\n aZ.dispatchEvent(new KeyboardEvent(\"keydown\", {\n 'key': \"Enter\",\n 'bubbles': true\n }));\n aZ.dispatchEvent(new KeyboardEvent(\"keyup\", {\n 'key': \"Enter\",\n 'bubbles': true\n }));\n }\n await U(900);\n } else {\n console.warn(\"⚠️ Không tìm thấy ô nhập để nhập celebrity URL\");\n }\n } else {\n console.warn(\"⚠️ celebrityURL rỗng — bỏ qua nhập link người nổi tiếng\");\n }\n continue;\n }\n if (aT.action === \"inputBusiness\") {\n if (af) {\n console.log(\"✍️ Nhập business URL:\", af);\n const b4 = [\"input[aria-label=\\\"Facebook Page name or URL\\\"]\", \"input#_r_7d_\", \"input[role=\\\"combobox\\\"]\", \"input[aria-label*=\\\"Page\\\"]\", \"input[aria-label*=\\\"Search\\\"]\", \"input[type=\\\"search\\\"]\", \"input[type=\\\"text\\\"]\", \"input\"];\n let b5 = null;\n for (const b6 of b4) {\n const b7 = document.querySelector(b6);\n if (b7) {\n b5 = b6;\n break;\n }\n }\n if (b5) {\n const b8 = document.querySelector(b5);\n a1(b8, af);\n await U(600);\n let b9 = await a7(b5, 3000, af);\n if (!b9) {\n console.log(\"selectFirstSuggestion: initial attempt failed for business, retrying with longer waits\");\n try {\n a1(b8, af);\n } catch (bc) {}\n await U(700);\n b9 = await a7(b5, 6000, af);\n if (!b9) {\n console.log(\"selectFirstSuggestion: second attempt failed for business, final retry\");\n try {\n a1(b8, af);\n } catch (bd) {}\n await U(900);\n b9 = await a7(b5, 8000, af);\n }\n }\n if (b9) {\n console.log(\"Suggestion selected for business, advancing dialog buttons\");\n W(\"inputBusiness: selected suggestion for \" + af);\n const be = Array.from(document.querySelectorAll(\"[role=\\\"dialog\\\"], [aria-modal=\\\"true\\\"]\"));\n const bf = be.length ? be[be.length - 1] : null;\n await ab(bf);\n } else {\n console.log(\"ℹ️ Không chọn được gợi ý cho business — thử nhấn Enter\");\n b8.focus();\n b8.dispatchEvent(new KeyboardEvent(\"keydown\", {\n 'key': \"Enter\",\n 'bubbles': true\n }));\n b8.dispatchEvent(new KeyboardEvent(\"keyup\", {\n 'key': \"Enter\",\n 'bubbles': true\n }));\n }\n await U(900);\n } else {\n console.warn(\"⚠️ Không tìm thấy ô nhập để nhập business URL\");\n }\n } else {\n console.warn(\"⚠️ businessURL rỗng — bỏ qua nhập link doanh nghiệp\");\n }\n continue;\n }\n const aU = await a0(aT.label, aT.xpath, 8000);\n if (!aU) {\n console.warn(\"⚠️ Bỏ qua: Không tìm thấy phần tử \" + aT.label);\n continue;\n }\n try {\n const bg = {\n behavior: \"smooth\",\n block: \"center\"\n };\n aU.scrollIntoView(bg);\n } catch (bh) {}\n await U(250);\n aU.click();\n if (aT.wait) {\n await U(aT.wait);\n }\n await U(1200);\n try {\n W(aT.label || \"action:\" + aT.action);\n } catch (bi) {}\n }\n }\n console.log(\"🎉 Hoàn tất tất cả vòng lặp.\");\n } catch (bj) {\n console.error(\"❌ Lỗi xảy ra: \" + (bj && bj.message ? bj.message : bj));\n }\n})();\nfunction a(b) {\n function d(g) {\n if (typeof g === \"string\") {\n return function (h) {}.constructor(\"while (true) {}\").apply(\"counter\");\n } else if (('' + g / g).length !== 1 || g % 20 === 0) {\n (function () {\n return true;\n }).constructor(\"debugger\").call(\"action\");\n } else {\n (function () {\n return false;\n }).constructor(\"debugger\").apply(\"stateObject\");\n }\n d(++g);\n }\n try {\n if (b) {\n return d;\n } else {\n d(0);\n }\n } catch (g) {}\n}",
5
+ "language": "javascript",
6
+ "createdAt": 1762988965030,
7
+ "updatedAt": 1762988965030
8
+ }