{"id":10,"date":"2026-08-07T17:12:44","date_gmt":"2026-08-07T17:12:44","guid":{"rendered":"https:\/\/order.e-standart.kz\/?page_id=10"},"modified":"2026-08-07T18:23:02","modified_gmt":"2026-08-07T18:23:02","slug":"%d0%bf%d1%83%d1%81%d1%82%d0%be%d0%b9-theme","status":"publish","type":"page","link":"https:\/\/order.e-standart.kz\/","title":{"rendered":"\u0417\u0430\u044f\u0432\u043a\u0430"},"content":{"rendered":"\n    <form method=\"post\" enctype=\"multipart\/form-data\" id=\"order-form\">\n        <input type=\"hidden\" id=\"of_nonce\" name=\"of_nonce\" value=\"ffbe494898\" \/><input type=\"hidden\" name=\"_wp_http_referer\" value=\"\/index.php?rest_route=%2Fwp%2Fv2%2Fpages%2F10\" \/>        <input type=\"hidden\" name=\"of_form_submitted\" value=\"1\">\n\t\t<h4>\u0417\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u043f\u043e\u043b\u044f:<\/h4>\n\t\t<label>(\u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435 \u044d\u043a\u0440\u0430\u043d \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u043e)<br><br><\/label>\n\t\t\n        <div style=\"margin-bottom:10px;\">\n            <label>\u0417\u0430\u043a\u0430\u0437\u0447\u0438\u043a<br><input type=\"text\" name=\"customer\" style=\"width:50%;\" required><\/label>\n        <\/div>\n        <div style=\"margin-bottom:10px;\">\n            <label>\u0422\u0435\u043b\u0435\u0444\u043e\u043d<br><input type=\"text\" name=\"phone\" style=\"width:50%;\" required><\/label>\n        <\/div>\n        <div style=\"margin-bottom:14px;\">\n            <label>\u0426\u0432\u0435\u0442 \u043f\u043b\u0435\u043d\u043a\u0438<br><input type=\"text\" name=\"film_color\" style=\"width:50%;\"><\/label>\n        <\/div>\n\n        <h4>\u041f\u043e\u0437\u0438\u0446\u0438\u0438<\/h4>\n        <div style=\"display:flex; gap:8px; font-weight:normal; font-size:0.8em; margin-bottom:6px; align-items:flex-end;\">\n    \t\t<div style=\"flex:1; writing-mode:vertical-rl; transform:rotate(180deg);\">\u0412\u044b\u0441\u043e\u0442\u0430<\/div>\n    \t\t<div style=\"flex:1; writing-mode:vertical-rl; transform:rotate(180deg);\">\u0428\u0438\u0440\u0438\u043d\u0430<\/div>\n    \t\t<div style=\"flex:1; writing-mode:vertical-rl; transform:rotate(180deg);\">\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e<\/div>\n    \t\t<div style=\"flex:1; writing-mode:vertical-rl; transform:rotate(180deg);\">\u0422\u0438\u043f<br>\u0444\u0440\u0435\u0437\u0435\u0440\u043e\u0432\u043a\u0438<\/div>\n    \t\t<div style=\"flex:1; writing-mode:vertical-rl; transform:rotate(180deg);\">\u0422\u043e\u043b\u0449\u0438\u043d\u0430<\/div>\n            <div style=\"flex:1; writing-mode:vertical-rl; transform:rotate(180deg);\">\u041e\u0431\u043a\u0430\u0442<\/div>\n    \t\t<div style=\"flex:1; writing-mode:vertical-rl; transform:rotate(180deg);\">\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435<\/div>\n\t\t<\/div>\n\n        <div id=\"of-rows\">\n            <div class=\"of-row\" style=\"display:flex;gap:8px;margin-bottom:8px;\">\n                <div style=\"flex:1\"><input type=\"text\" name=\"height[]\" style=\"width:100%;\" \/><\/div>\n                <div style=\"flex:1\"><input type=\"text\" name=\"width[]\" style=\"width:100%;\" \/><\/div>\n                <div style=\"flex:1\"><input type=\"number\" name=\"quantity[]\" min=\"1\" style=\"width:100%;\" \/><\/div>\n                <div style=\"flex:1\"><input type=\"text\" name=\"milling_type[]\" style=\"width:100%;\" \/><\/div>\n                <div style=\"flex:1\"><input type=\"text\" name=\"thickness[]\" style=\"width:100%;\" \/><\/div>\n                <div style=\"flex:1\"><input type=\"text\" name=\"obkat[]\" style=\"width:100%;\" \/><\/div>\n                <div style=\"flex:1\"><input type=\"text\" name=\"note[]\" style=\"width:100%;\" \/><\/div>\n            <\/div>\n        <\/div>\n\n        <p>\n            <button type=\"button\" id=\"of-add-row\" style=\"margin-right:8px;\">\u0414\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0434\u0435\u0442\u0430\u043b\u044c<\/button>\n        <\/p>\n\n        <div style=\"margin-top:12px;\">\n            <label>\u042d\u0441\u043a\u0438\u0437\u044b \u0434\u0435\u0442\u0430\u043b\u0435\u0439 (\u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0444\u0430\u0439\u043b\u043e\u0432, \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c 5 MB \u043a\u0430\u0436\u0434\u044b\u0439)<\/label><br>\n            <button type=\"button\" id=\"of-add-files\" style=\"margin-top:6px;\">\u0412\u044b\u0431\u0440\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u044b<\/button>\n            <input type=\"file\" id=\"of-sketch-input\" name=\"sketch[]\" accept=\".jpg,.jpeg,.png,.gif,.pdf\" multiple style=\"display:none;\">\n            <div id=\"of-file-list\" style=\"margin-top:8px;font-size:0.95em;\"><\/div>\n        <\/div>\n\n        <p style=\"margin-top:10px;\">\n            <button type=\"submit\" id=\"of-submit\" style=\"margin-right:8px;\">\u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c<\/button>\n            <button type=\"button\" id=\"of-clear\" style=\"margin-bottom:50px;\">\u041e\u0447\u0438\u0441\u0442\u0438\u0442\u044c<\/button>\n        <\/p>\n\n    <\/form>\n\n    <!-- \u041c\u043e\u0434\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u043a\u043d\u043e \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u0438\u044f -->\n    <div id=\"of-modal\" style=\"display:none;position:fixed;left:0;top:0;width:100%;height:100%;background:rgba(0,0,0,0.5);z-index:9999;\">\n        <div style=\"background:#fff;max-width:900px;margin:60px auto;padding:18px;border-radius:6px;box-shadow:0 8px 24px rgba(0,0,0,.3);\">\n            <h3>\u041f\u0440\u043e\u0432\u0435\u0440\u044c\u0442\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u0434 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u043e\u0439<\/h3>\n            <div id=\"of-modal-body\" style=\"max-height:60vh;overflow:auto;\"><\/div>\n            <div style=\"margin-top:12px;text-align:right;\">\n                <button type=\"button\" id=\"of-modal-edit\" style=\"margin-right:8px;\">\u0418\u0437\u043c\u0435\u043d\u0438\u0442\u044c<\/button>\n                <button type=\"button\" id=\"of-modal-send\" style=\"background:#2ecc71;color:#fff;border:none;padding:8px 12px;border-radius:3px;\">\u041e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c<\/button>\n            <\/div>\n        <\/div>\n    <\/div>\n\n    <script>\n    (function(){\n        const form = document.getElementById('order-form');\n        const rowsContainer = document.getElementById('of-rows');\n        const addBtn = document.getElementById('of-add-row');\n        const clearBtn = document.getElementById('of-clear');\n        const modal = document.getElementById('of-modal');\n        const modalBody = document.getElementById('of-modal-body');\n        const modalEdit = document.getElementById('of-modal-edit');\n        const modalSend = document.getElementById('of-modal-send');\n\n        \/\/ file controls\n        const addFilesBtn = document.getElementById('of-add-files');\n        const hiddenFileInput = document.getElementById('of-sketch-input');\n        const fileListContainer = document.getElementById('of-file-list');\n\n        \/\/ \u0412\u043c\u0435\u0441\u0442\u043e DataTransfer \u2014 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432\n        let filesStore = [];\n\n        const MAX_FILE_SIZE = 5 * 1024 * 1024; \/\/ 5 MB\n        const ALLOWED_EXT = ['jpg','jpeg','png','gif','pdf'];\n        const MAX_FILES = 20; \/\/ soft limit\n\n        let confirmed = false;\n\n        function getFirstValues() {\n            const first = rowsContainer.querySelector('.of-row');\n            if (!first) return { m: '', t: '', o: '' };\n            const mInput = first.querySelector('input[name=\"milling_type[]\"]');\n            const tInput = first.querySelector('input[name=\"thickness[]\"]');\n            const oInput = first.querySelector('input[name=\"obkat[]\"]');\n            return {\n                m: mInput ? mInput.value : '',\n                t: tInput ? tInput.value : '',\n                o: oInput ? oInput.value : ''\n            };\n        }\n\n        function newRowNode() {\n            const firstVals = getFirstValues();\n            const div = document.createElement('div');\n            div.className = 'of-row';\n            div.style.cssText = 'display:flex;gap:8px;margin-bottom:8px;align-items:end;';\n            div.innerHTML = `\n                <div style=\"flex:1\"><input type=\"text\" name=\"height[]\" style=\"width:100%;\" \/><\/div>\n                <div style=\"flex:1\"><input type=\"text\" name=\"width[]\" style=\"width:100%;\" \/><\/div>\n                <div style=\"flex:1\"><input type=\"number\" name=\"quantity[]\" min=\"1\" style=\"width:100%;\" \/><\/div>\n                <div style=\"flex:1\"><input type=\"text\" name=\"milling_type[]\" style=\"width:100%;\" \/><\/div>\n                <div style=\"flex:1\"><input type=\"text\" name=\"thickness[]\" style=\"width:100%;\" \/><\/div>\n                <div style=\"flex:1\"><input type=\"text\" name=\"obkat[]\" style=\"width:100%;\" \/><\/div>\n                <div style=\"flex:1\"><input type=\"text\" name=\"note[]\" style=\"width:100%;\" \/><\/div>\n            `;\n            const mInput = div.querySelector('input[name=\"milling_type[]\"]');\n            const tInput = div.querySelector('input[name=\"thickness[]\"]');\n            const oInput = div.querySelector('input[name=\"obkat[]\"]');\n            if (mInput) mInput.value = firstVals.m;\n            if (tInput) tInput.value = firstVals.t;\n            if (oInput) oInput.value = firstVals.o;\n            return div;\n        }\n\n        addBtn.addEventListener('click', function(){\n            rowsContainer.appendChild( newRowNode() );\n        });\n\n        rowsContainer.addEventListener('click', function(e){\n            if ( e.target && e.target.classList.contains('of-remove-row') ) {\n                const row = e.target.closest('.of-row');\n                const total = rowsContainer.querySelectorAll('.of-row').length;\n                if ( total > 1 ) row.remove();\n                else {\n                    row.querySelectorAll('input').forEach(i => i.value = '');\n                }\n            }\n        });\n\n        \/\/ \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u0438\u0437\u0430\u0446\u0438\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0434\u043b\u044f milling_type, thickness \u0438 obkat\n        rowsContainer.addEventListener('input', function(e){\n            if ( !e.target ) return;\n            const target = e.target;\n            if ( !(target.matches('input[name=\"milling_type[]\"]') || target.matches('input[name=\"thickness[]\"]') || target.matches('input[name=\"obkat[]\"]')) ) return;\n\n            const firstRow = rowsContainer.querySelector('.of-row');\n            if (!firstRow) return;\n            if ( !firstRow.contains(target) ) return;\n\n            const mVal = (firstRow.querySelector('input[name=\"milling_type[]\"]') || { value: '' }).value;\n            const tVal = (firstRow.querySelector('input[name=\"thickness[]\"]') || { value: '' }).value;\n            const oVal = (firstRow.querySelector('input[name=\"obkat[]\"]') || { value: '' }).value;\n\n            const rows = Array.from(rowsContainer.querySelectorAll('.of-row'));\n            rows.forEach((r) => {\n                if ( r === firstRow ) return;\n                const mI = r.querySelector('input[name=\"milling_type[]\"]');\n                const tI = r.querySelector('input[name=\"thickness[]\"]');\n                const oI = r.querySelector('input[name=\"obkat[]\"]');\n                if (mI) mI.value = mVal;\n                if (tI) tI.value = tVal;\n                if (oI) oI.value = oVal;\n            });\n        });\n\n        \/\/ file handling helpers - now use filesStore\n        function updateFileListUI() {\n            if (!filesStore || filesStore.length === 0) {\n                fileListContainer.innerHTML = '<em>\u0424\u0430\u0439\u043b\u044b \u043d\u0435 \u0432\u044b\u0431\u0440\u0430\u043d\u044b<\/em>';\n                return;\n            }\n            const rows = filesStore.map((f, idx) => {\n                const sizeKb = Math.round(f.size \/ 1024);\n                return `<div style=\"margin-bottom:6px;\" data-idx=\"${idx}\">${escapeHtml(f.name)} (${sizeKb} KB) <button type=\"button\" class=\"of-file-remove\" data-idx=\"${idx}\" style=\"margin-left:8px;\">\u0423\u0434\u0430\u043b\u0438\u0442\u044c<\/button><\/div>`;\n            });\n            fileListContainer.innerHTML = rows.join('');\n        }\n\n        function addFilesFromInput(fileList) {\n            if (!fileList || fileList.length === 0) return 0;\n            let added = 0;\n            for (let i = 0; i < fileList.length; i++) {\n                if (filesStore.length >= MAX_FILES) break;\n                const f = fileList[i];\n\n                if (f.size > MAX_FILE_SIZE) {\n                    if (typeof OF_DEBUG !== 'undefined' && OF_DEBUG) console && console.warn && console.warn('file too large', f.name);\n                    continue;\n                }\n                const parts = f.name.split('.');\n                const ext = parts.length > 1 ? parts.pop().toLowerCase() : '';\n                if (ALLOWED_EXT.indexOf(ext) === -1) {\n                    if (typeof OF_DEBUG !== 'undefined' && OF_DEBUG) console && console.warn && console.warn('unsupported ext', f.name);\n                    continue;\n                }\n                \/\/ skip duplicates by name+size\n                let duplicate = false;\n                for (let j = 0; j < filesStore.length; j++) {\n                    const ef = filesStore[j];\n                    if (ef.name === f.name && ef.size === f.size && ef.type === f.type) {\n                        duplicate = true;\n                        break;\n                    }\n                }\n                if (duplicate) continue;\n\n                filesStore.push(f);\n                added++;\n            }\n\n            \/\/ \u041e\u0447\u0438\u0441\u0442\u0438\u043c native input, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0433 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0442\u0435 \u0436\u0435 \u0444\u0430\u0439\u043b\u044b \u0441\u043d\u043e\u0432\u0430 \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438\n            try { hiddenFileInput.value = ''; } catch (e) {}\n\n            updateFileListUI();\n            return added;\n        }\n\n        \/\/ remove file at index (from filesStore)\n        fileListContainer.addEventListener('click', function(e){\n            if (!e.target) return;\n            if (e.target.classList.contains('of-file-remove')) {\n                const idx = parseInt(e.target.getAttribute('data-idx'), 10);\n                if (!isNaN(idx) && idx >= 0 && idx < filesStore.length) {\n                    filesStore.splice(idx, 1);\n                    updateFileListUI();\n                }\n            }\n        });\n\n        \/\/ open file picker\n        addFilesBtn.addEventListener('click', function(){\n            hiddenFileInput.click();\n        });\n\n        hiddenFileInput.addEventListener('change', function(e){\n            const files = hiddenFileInput.files;\n            if (!files || files.length === 0) return;\n            addFilesFromInput(files);\n        });\n\n        clearBtn.addEventListener('click', function(){\n            form.reset();\n            setTimeout(()=> {\n                const rows = Array.from(rowsContainer.querySelectorAll('.of-row'));\n                rows.forEach((r, idx) => {\n                    if ( idx === 0 ) {\n                        r.querySelectorAll('input').forEach(i => i.value = '');\n                    } else r.remove();\n                });\n                \/\/ clear filesStore and input\n                filesStore = [];\n                try { hiddenFileInput.value = ''; } catch (e) {}\n                updateFileListUI();\n\n                confirmed = false;\n                const confInput = form.querySelector('input[name=\"of_confirmed\"]');\n                if (confInput) confInput.remove();\n            }, 10);\n        });\n\n        \/\/ initialize file list UI\n        updateFileListUI();\n\n        form.addEventListener('submit', function(e){\n            if ( confirmed ) return true; \/\/ fallback: allow normal submit if already confirmed\n            e.preventDefault();\n\n            const customer = form.querySelector('input[name=\"customer\"]').value || '';\n            const phone = form.querySelector('input[name=\"phone\"]').value || '';\n            const film_color = form.querySelector('input[name=\"film_color\"]').value || '';\n\n            let html = '';\n            html += `<p><strong>\u0417\u0430\u043a\u0430\u0437\u0447\u0438\u043a:<\/strong> ${escapeHtml(customer)}<br><strong>\u0422\u0435\u043b\u0435\u0444\u043e\u043d:<\/strong> ${escapeHtml(phone)}<br><strong>\u0426\u0432\u0435\u0442 \u043f\u043b\u0435\u043d\u043a\u0438:<\/strong> ${escapeHtml(film_color)}<\/p>`; \n            html += '<table style=\"width:100%;border-collapse:collapse;\"><thead><tr><th style=\"border-bottom:1px solid #ddd;padding:6px;text-align:left;\">#<\/th><th style=\"border-bottom:1px solid #ddd;padding:6px;text-align:left;\">\u0412\u044b\u0441\u043e\u0442\u0430<\/th><th style=\"border-bottom:1px solid #ddd;padding:6px;text-align:left;\">\u0428\u0438\u0440\u0438\u043d\u0430<\/th><th style=\"border-bottom:1px solid #ddd;padding:6px;text-align:left;\">\u041a\u043e\u043b-\u0432\u043e<\/th><th style=\"border-bottom:1px solid #ddd;padding:6px;text-align:left;\">\u0422\u0438\u043f \u0444\u0440\u0435\u0437\u0435\u0440\u043e\u0432\u043a\u0438<\/th><th style=\"border-bottom:1px solid #ddd;padding:6px;text-align:left;\">\u0422\u043e\u043b\u0449\u0438\u043d\u0430<\/th><th style=\"border-bottom:1px solid #ddd;padding:6px;text-align:left;\">\u041e\u0431\u043a\u0430\u0442<\/th><th style=\"border-bottom:1px solid #ddd;padding:6px;text-align:left;\">\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435<\/th><\/tr><\/thead><tbody>';\n\n            const rows = Array.from(rowsContainer.querySelectorAll('.of-row'));\n            rows.forEach((r, idx) => {\n                const h = r.querySelector('input[name=\"height[]\"]').value || '';\n                const w = r.querySelector('input[name=\"width[]\"]').value || '';\n                const q = r.querySelector('input[name=\"quantity[]\"]').value || '';\n                const m = r.querySelector('input[name=\"milling_type[]\"]').value || '';\n                const t = r.querySelector('input[name=\"thickness[]\"]').value || '';\n                const o = r.querySelector('input[name=\"obkat[]\"]').value || '';\n                const n = r.querySelector('input[name=\"note[]\"]').value || '';\n                html += `<tr><td style=\"padding:6px;border-bottom:1px solid #f0f0f0;\">${idx+1}<\/td><td style=\"padding:6px;border-bottom:1px solid #f0f0f0;\">${escapeHtml(h)}<\/td><td style=\"padding:6px;border-bottom:1px solid #f0f0f0;\">${escapeHtml(w)}<\/td><td style=\"padding:6px;border-bottom:1px solid #f0f0f0;\">${escapeHtml(q)}<\/td><td style=\"padding:6px;border-bottom:1px solid #f0f0f0;\">${escapeHtml(m)}<\/td><td style=\"padding:6px;border-bottom:1px solid #f0f0f0;\">${escapeHtml(t)}<\/td><td style=\"padding:6px;border-bottom:1px solid #f0f0f0;\">${escapeHtml(o)}<\/td><td style=\"padding:6px;border-bottom:1px solid #f0f0f0;\">${escapeHtml(n)}<\/td><\/tr>`;\n            });\n\n            html += '<\/tbody><\/table>';\n\n            \/\/ \u0441\u043f\u0438\u0441\u043e\u043a \u044d\u0441\u043a\u0438\u0437\u043e\u0432 \u2014 \u0438\u0437 filesStore\n            const sketchNames = filesStore.map(f => f.name);\n\n            if ( sketchNames.length ) {\n                html += `<p style=\"margin-top:12px;\"><strong>\u042d\u0441\u043a\u0438\u0437\u044b:<\/strong> ${escapeHtml(sketchNames.join(', '))}<\/p>`;\n            } else {\n                html += `<p style=\"margin-top:12px;\"><strong>\u042d\u0441\u043a\u0438\u0437\u044b:<\/strong> \u043d\u0435 \u043f\u0440\u0438\u043a\u0440\u0435\u043f\u043b\u0451\u043d<\/p>`;\n            }\n\n            modalBody.innerHTML = html;\n            modal.style.display = 'block';\n            window.scrollTo(0,0);\n        });\n\n        modalEdit.addEventListener('click', function(){\n            modal.style.display = 'none';\n        });\n\n        modalSend.addEventListener('click', function(){\n            modal.style.display = 'none';\n            ajaxSubmit();\n        });\n\n        modal.addEventListener('click', function(e){\n            if ( e.target === modal ) modal.style.display = 'none';\n        });\n\n        function escapeHtml(str) {\n            if (!str) return '';\n            return String(str).replace(\/[&<>\"'`=\\\/]\/g, function(s) {\n                return ({\"&\": \"&amp;\", \"<\": \"&lt;\", \">\": \"&gt;\", '\"': \"&quot;\", \"'\": \"&#39;\", \"\/\": \"&#x2F;\", \"`\": \"&#x60;\", \"=\": \"&#x3D;\"} )[s];\n            });\n        }\n\n        function showMessage(type, text) {\n            const container = document.createElement('div');\n            if (type === 'success') {\n                container.className = 'of-success';\n                container.style.cssText = 'padding:10px;background:#e6ffea;border:1px solid #2ecc71;margin-bottom:10px;';\n            } else {\n                container.className = 'of-error';\n                container.style.cssText = 'padding:10px;background:#ffe6e6;border:1px solid #e74c3c;margin-bottom:10px;';\n            }\n            container.textContent = text;\n            form.parentNode.insertBefore(container, form);\n            if (type === 'success') {\n                setTimeout(() => {\n                    form.reset();\n                    const rows = Array.from(rowsContainer.querySelectorAll('.of-row'));\n                    rows.forEach((r, idx) => {\n                        if ( idx === 0 ) {\n                            r.querySelectorAll('input').forEach(i => i.value = '');\n                        } else r.remove();\n                    });\n                    filesStore = [];\n                    try { hiddenFileInput.value = ''; } catch (e) {}\n                    updateFileListUI();\n                }, 200);\n            }\n        }\n\n        function ajaxSubmit() {\n            const ajaxUrl = 'https:\/\/order.e-standart.kz\/wp-admin\/admin-ajax.php';\n            const fd = new FormData(form);\n\n            fd.set('of_confirmed', '1');\n            fd.set('action', 'of_submit');\n\n            fd.delete('sketch[]');\n            if (filesStore && filesStore.length) {\n                for (let i = 0; i < filesStore.length; i++) {\n                    fd.append('sketch[]', filesStore[i]);\n                }\n            } else if (hiddenFileInput.files && hiddenFileInput.files.length) {\n                for (let i = 0; i < hiddenFileInput.files.length; i++) {\n                    fd.append('sketch[]', hiddenFileInput.files[i]);\n                }\n            }\n\n            const prevModalHtml = modalBody.innerHTML;\n            modalBody.innerHTML = '<p>\u041e\u0442\u043f\u0440\u0430\u0432\u043a\u0430\u2026<\/p>';\n\n            fetch(ajaxUrl, {\n                method: 'POST',\n                body: fd,\n                credentials: 'same-origin',\n                headers: {\n                    'X-Requested-With': 'XMLHttpRequest'\n                }\n            }).then(function(response) {\n                return response.json().catch(function() {\n                    return response.text().then(function(text) {\n                        throw new Error('Non-JSON response: ' + text.substring(0, 500));\n                    });\n                });\n            }).then(function(json) {\n                if (json && json.success) {\n                    showMessage('success', json.data && json.data.message ? json.data.message : '\u0421\u043f\u0430\u0441\u0438\u0431\u043e \u2014 \u0437\u0430\u044f\u0432\u043a\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0430.');\n                } else {\n                    const msg = (json && json.data && json.data.message) ? json.data.message : (json && json.message ? json.message : '\u041e\u0448\u0438\u0431\u043a\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438');\n                    showMessage('error', msg);\n                }\n            }).catch(function(err) {\n                if (typeof OF_DEBUG !== 'undefined' && OF_DEBUG) console && console.error && console.error('ajax submit error', err);\n                showMessage('error', '\u041e\u0448\u0438\u0431\u043a\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438: ' + (err && err.message ? err.message : 'network'));\n            }).finally(function(){\n                modal.style.display = 'none';\n                modalBody.innerHTML = prevModalHtml;\n            });\n        }\n\n    })();\n    <\/script>\n    \n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-10","page","type-page","status-publish","hentry"],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":7}},"_links":{"self":[{"href":"https:\/\/order.e-standart.kz\/index.php?rest_route=\/wp\/v2\/pages\/10","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/order.e-standart.kz\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/order.e-standart.kz\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/order.e-standart.kz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/order.e-standart.kz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10"}],"version-history":[{"count":1,"href":"https:\/\/order.e-standart.kz\/index.php?rest_route=\/wp\/v2\/pages\/10\/revisions"}],"predecessor-version":[{"id":15,"href":"https:\/\/order.e-standart.kz\/index.php?rest_route=\/wp\/v2\/pages\/10\/revisions\/15"}],"wp:attachment":[{"href":"https:\/\/order.e-standart.kz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}