<?php
// /AIWK_WEB/index.php
// AIWK EXT4 v078-stage2.5-chart-lab-apex-3d-d3
?><!doctype html>
<html lang="ko">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>AIWK WEB v078</title>

    <link rel="stylesheet" href="../AIWK_COMMON/styles/tailwind.css">
    <link rel="stylesheet" href="../AIWK_COMMON/styles/aiwk_ext4_base.css">
    <style>
        body{margin:0;background:#111827;color:#e5e7eb;font-family:Arial,"Noto Sans KR",sans-serif;font-size:14px;}
        .wrap{max-width:1180px;margin:0 auto;padding:18px;}
        .card{border:1px solid rgba(255,255,255,.14);border-radius:14px;background:rgba(31,41,55,.92);padding:14px;margin:10px 0;box-shadow:0 12px 30px rgba(0,0,0,.25);}
        .row{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:8px 0;}
        input,textarea{background:#030712;color:#f9fafb;border:1px solid rgba(255,255,255,.18);border-radius:9px;padding:8px;min-height:1.8em;}
        input{width:170px;} textarea{width:100%;min-height:170px;font-family:Consolas,monospace;font-size:12px;}
        button{border:1px solid rgba(255,255,255,.2);border-radius:999px;background:#2563eb;color:white;padding:8px 12px;cursor:pointer;white-space:nowrap;}
        button:hover{background:#1d4ed8;}
        .muted{color:#9ca3af;font-size:12px;}.ok{color:#86efac;}.warn{color:#fde68a;}.log{white-space:pre-wrap;background:#030712;border-radius:10px;padding:10px;min-height:80px;font-family:Consolas,monospace;font-size:12px;}
    </style>
</head>
<body>
<div class="wrap" id="aiwk-web-root">
    <h2>AIWK WEB v078 · WEB + EXT4 + COMMON 차트 크로스체크</h2>
    <div class="muted">EXT4는 브라우저 자동화 실행자이고, WEB은 같은 AIWK_COMMON 모듈을 직접 로딩해 크로스체크하는 검증자입니다. ChatGPT 탭에는 자동 입력까지만 하고 전송은 사용자가 직접 누릅니다.</div>
    <div class="card">
        <div class="row">
            <label>group <input id="aiwk-group" value="home" placeholder="기존 WSS group"></label>
            <label>room <input id="aiwk-room" value="IG_CRM" placeholder="방/프로젝트"></label>
            <label>client <input id="aiwk-client" value="WEB1" placeholder="WEB1"></label>
            <label>folder_route <input id="aiwk-folder-route" value="/diagnostic/web_ext/chatGPT" placeholder="/폴더/폴더"></label>
        </div>
        <div class="row">
            <button id="aiwk-btn-build-report" type="button">진단결과 생성</button>
            <button id="aiwk-btn-copy-report" type="button">ChatGPT 전달용 복사</button>
            <button id="aiwk-btn-send-chatgpt" type="button">ChatGPT 탭에 입력</button>
            <button id="aiwk-btn-web-cross-check" type="button">WEB1 수신로그 확인</button>
        </div>
        <textarea id="aiwk-user-text" placeholder="ChatGPT에 JSON 앞에 같이 넣을 말">AIWK EXT4 v047 진단 결과입니다. JSON을 분석해서 다음 최소 수정안을 제안해줘.</textarea>
    </div>

    <div class="card">
        <div class="row"><b>COMMON 차트 모듈 WEB 크로스체크</b><span class="muted">EXT 주입 없이 WEB에서 AIWK_COMMON/modules/chart/demo.js를 직접 실행합니다.</span></div>
        <div class="row">
            <a href="../chart/" style="color:#93c5fd;text-decoration:underline;">home.yjm.kr/aiwk/chart 열기</a>
            <button id="aiwk-btn-web-chart-dev" type="button">WEB 차트 개발용</button>
            <button id="aiwk-btn-web-chart-viewer" type="button">WEB 차트 운영용</button>
            <button id="aiwk-btn-web-chart-run" type="button">chart.demo run()</button>
            <button id="aiwk-btn-web-chart-clear" type="button">WEB 차트창 닫기</button>
        </div>
        <div id="aiwk-web-chart-status" class="log">COMMON 차트 모듈 대기 중</div>
    </div>
    <div class="card">
        <div class="row"><b>전달 JSON</b><span class="muted">AIWK_DIAG_JSON_START/END 형식</span></div>
        <textarea id="aiwk-report-text" placeholder="진단 결과 JSON"></textarea>
    </div>
    <div class="card">
        <b>EXT4 수신 진단</b>
        <div id="aiwk-ext-diag" class="log">EXT4 진단 수신 전</div>
    </div>
    <div class="card">
        <b>로그</b>
        <div id="aiwk-web-log" class="log"></div>
    </div>
</div>
<script src="../AIWK_COMMON/core/aiwk_core.js"></script>
<script src="../AIWK_COMMON/core/aiwk_event.js"></script>
<script src="../AIWK_COMMON/core/aiwk_state.js"></script>
<script src="../AIWK_COMMON/core/aiwk_store.js"></script>
<script src="../AIWK_COMMON/core/aiwk_auth.js"></script>
<script src="../AIWK_COMMON/core/aiwk_i18n.js"></script>
<script src="../AIWK_COMMON/core/aiwk_module.js"></script>
<script src="../AIWK_COMMON/core/yw-diagnostic.js"></script>
<script src="../AIWK_COMMON/win/aiwk_win_render.js"></script>
<script src="../AIWK_COMMON/win/aiwk_win_class.js"></script>
<script src="../AIWK_COMMON/win/aiwk_win_drag.js"></script>
<script src="../AIWK_COMMON/win/aiwk_win_resize.js"></script>
<script src="../AIWK_COMMON/win/aiwk_win_menu.js"></script>
<script src="../AIWK_COMMON/win/aiwk_win.js"></script>
<script src="../AIWK_COMMON/modules/chart/demo.js"></script>
<script src="web_boot.js"></script>
</body>
</html>
