<?php
use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;
/* Product/detail.twig */
class __TwigTemplate_522d4049f4ae861cebe3e9e156fd17afe8d625ccd0fcb5d23594920e6cac048b extends \Eccube\Twig\Template
{
private $source;
private $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->blocks = [
'stylesheet' => [$this, 'block_stylesheet'],
'javascript' => [$this, 'block_javascript'],
'main' => [$this, 'block_main'],
];
}
protected function doGetParent(array $context)
{
// line 11
return "default_frame.twig";
}
protected function doDisplay(array $context, array $blocks = [])
{
$macros = $this->macros;
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "Product/detail.twig"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "Product/detail.twig"));
// line 13
$context["body_class"] = "product_page";
// line 11
$this->parent = $this->loadTemplate("default_frame.twig", "Product/detail.twig", 11);
$this->parent->display($context, array_merge($this->blocks, $blocks));
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
}
// line 15
public function block_stylesheet($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "stylesheet"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "stylesheet"));
// line 16
echo " <style>
.slick-slider {
margin-bottom: 10px;
\t\t\tmargin-top: -20px;
}
.slick-dots {
position: absolute;
bottom: -45px;
display: block;
width: 100%;
padding: 0;
list-style: none;
text-align: center;
}
.slick-dots li {
position: relative;
display: inline-block;
width: 20px;
height: 20px;
margin: 0 5px;
padding: 0;
cursor: pointer;
}
.slick-dots li button {
font-size: 0;
line-height: 0;
display: block;
width: 20px;
height: 20px;
padding: 5px;
cursor: pointer;
color: transparent;
border: 0;
outline: none;
background: transparent;
}
.slick-dots li button:hover,
.slick-dots li button:focus {
outline: none;
}
.slick-dots li button:hover:before,
.slick-dots li button:focus:before {
opacity: 1;
}
.slick-dots li button:before {
content: \" \";
line-height: 20px;
position: absolute;
top: 0;
left: 0;
width: 12px;
height: 12px;
text-align: center;
opacity: .25;
background-color: black;
border-radius: 50%;
}
.slick-dots li.slick-active button:before {
opacity: .75;
background-color: black;
}
.slick-dots li button.thumbnail img {
width: 0;
height: 0;
}
</style>
<link rel=\"stylesheet\" href=\"/html/user_data/js/style.css\">
<link rel=\"stylesheet\" href=\"/html/plugins/icheck-bootstrap/icheck-bootstrap.min.css\">
<style>
/* Show zoom cursor on product images to hint click-to-expand */
.item_visual .slide-item a { display: block; cursor: zoom-in; }
</style>
<style>
/* ============================================
商品詳細グリッド: 画像50% / 内容50%(均等)
============================================ */
@media (min-width: 768px) {
body.product_page .ec-grid2 {
display: flex;
align-items: flex-start;
}
body.product_page .ec-grid2 .ec-grid2__cell {
width: 50%;
flex: 0 0 50%;
min-width: 0;
}
body.product_page .ec-grid2 .ec-grid2__cell2 {
width: 50%;
flex: 0 0 50%;
min-width: 0;
}
}
/* ============================================
商品説明欄内のHTMLが画面幅を突き抜けないように
============================================ */
body.product_page .ec-productRole__description {
min-width: 0;
overflow-wrap: break-word;
word-break: break-word;
}
body.product_page .ec-productRole__description img,
body.product_page .ec-productRole__description table,
body.product_page .ec-productRole__description iframe,
body.product_page .ec-productRole__description video {
max-width: 100% !important;
height: auto;
}
body.product_page .ec-productRole__description table {
display: block;
overflow-x: auto;
-webkit-overflow-scrolling: touch;
}
/* ============================================
構成セット内容 (機能門柱など、セット構成を持つ商品)
============================================ */
body.product_page .ec-productRole__setItems {
min-width: 0;
margin-bottom: 16px;
}
body.product_page .ec-productRole__setItems .set-items-table {
width: 100%;
border-collapse: collapse;
table-layout: fixed;
}
body.product_page .ec-productRole__setItems .set-items-table th,
body.product_page .ec-productRole__setItems .set-items-table td {
padding: 8px 4px;
border-bottom: 1px solid #e8e8e8;
font-size: 14px;
font-weight: normal;
overflow-wrap: break-word;
word-break: break-word;
vertical-align: top;
}
body.product_page .ec-productRole__setItems .set-items-table th {
text-align: left;
}
body.product_page .ec-productRole__setItems .set-items-table td {
text-align: right;
white-space: nowrap;
width: 30%;
}
body.product_page .ec-productRole__setItems .set-items-table tfoot th,
body.product_page .ec-productRole__setItems .set-items-table tfoot td {
border-top: 2px solid #333;
border-bottom: none;
font-weight: bold;
}
/* ============================================
スマホ用 見積金額 下部固定バー
============================================ */
#sp-mitsumori-bar {
display: none;
}
/* ============================================
スマホ用 お見積りの詳細 ボトムシート
============================================ */
.sp-detail-sheet { display: none; }
.sp-detail-sheet.is-open {
display: block;
position: fixed;
top: 0; left: 0; right: 0; bottom: 0;
z-index: 2000;
}
.sp-detail-sheet__overlay {
position: absolute;
top: 0; left: 0; right: 0; bottom: 0;
background: rgba(0,0,0,0.45);
}
.sp-detail-sheet__panel {
position: absolute;
left: 0; right: 0; bottom: 0;
background: #fff;
border-radius: 14px 14px 0 0;
max-height: 82vh;
display: flex;
flex-direction: column;
box-shadow: 0 -4px 20px rgba(0,0,0,0.25);
padding-bottom: env(safe-area-inset-bottom);
animation: spSheetUp 0.22s ease-out;
}
@keyframes spSheetUp {
from { transform: translateY(100%); }
to { transform: translateY(0); }
}
.sp-detail-sheet__header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 14px 16px;
border-bottom: 1px solid #eee;
flex: 0 0 auto;
}
.sp-detail-sheet__title { font-size: 16px; font-weight: bold; color: #333; }
.sp-detail-sheet__close {
background: none;
border: none;
font-size: 26px;
line-height: 1;
color: #888;
cursor: pointer;
padding: 0 4px;
}
.sp-detail-sheet__body {
overflow-y: auto;
-webkit-overflow-scrolling: touch;
padding: 4px 0;
flex: 1 1 auto;
}
.sp-detail-sheet__body ul { list-style: none; margin: 0; padding: 0; }
.sp-detail-sheet__body li { border-bottom: 1px solid #f2f2f2; }
.sp-detail-sheet__body .nav-link {
display: flex;
align-items: center;
justify-content: space-between;
padding: 12px 16px;
color: #333;
font-size: 14px;
}
.sp-detail-sheet__body .nav-link .float-right {
float: none !important;
font-weight: bold;
white-space: nowrap;
margin-left: auto;
}
.sp-detail-sheet__footer {
display: flex;
gap: 8px;
padding: 12px 16px 16px;
border-top: 1px solid #eee;
flex: 0 0 auto;
}
.sp-detail-sheet__footer button {
flex: 1 1 auto;
padding: 12px;
border-radius: 8px;
font-size: 14px;
font-weight: bold;
cursor: pointer;
}
.sp-detail-sheet__invoice {
background: #fff;
border: 1px solid #17a2b8;
color: #17a2b8;
}
.sp-detail-sheet__cart {
background: #c00;
border: 1px solid #c00;
color: #fff;
}
/* ============================================
商品タイプ選択 共通スタイル
============================================ */
/* セクションラベル */
.rp-section-label {
font-size: 14px;
font-weight: bold;
color: #333;
margin-bottom: 10px;
}
.rp-section-label span {
font-weight: normal;
color: #c00;
}
/* ---- 1. 画像付きカード ---- */
.rp-card-group {
display: flex;
flex-wrap: wrap;
gap: 8px;
margin-bottom: 4px;
}
.rp-card {
position: relative;
cursor: pointer;
touch-action: manipulation; /* drop iOS 300ms tap delay (#15) */
-webkit-tap-highlight-color: rgba(0,0,0,0);
/* iOS Safari: prevent the first tap from being consumed as a text
selection (\"字だけ青くなる\" = selection highlight) which forced a
2nd tap to actually switch the option (#15). */
-webkit-user-select: none; -moz-user-select: none; user-select: none;
-webkit-touch-callout: none;
width: 110px;
border: 2px solid #ddd;
border-radius: 10px;
overflow: hidden;
transition: border-color 0.2s, box-shadow 0.2s;
background: #fff;
text-decoration: none;
color: #333;
display: block;
}
/* Gate :hover behind real hover-capable pointers. On iOS Safari a
:hover rule that changes appearance makes the first tap apply the
hover state and suppresses the click, so the option chip needed a
second tap to fire its onclick (is-selected + price update). */
@media (hover: hover) and (pointer: fine) {
.rp-card:hover {
border-color: #999;
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
}
.rp-card.is-selected {
border-color: #1a6fcf;
box-shadow: 0 2px 10px rgba(26,111,207,0.25);
}
/* visually-hidden instead of display:none. A label wrapping a
display:none radio fires its tap unreliably on iOS Safari (first tap
often ignored -> \"2回タッチ\"). Keeping the input in the layout but
invisible makes the first tap register. */
.rp-card input[type=\"radio\"] {
position: absolute; opacity: 0; width: 1px; height: 1px;
margin: 0; pointer-events: none;
}
.rp-card__image {
width: 100%;
aspect-ratio: 1 / 1;
object-fit: cover;
display: block;
background: #f5f5f5;
}
.rp-card__placeholder {
width: 100%;
aspect-ratio: 1 / 1;
background: #f0f0f0;
display: flex;
align-items: center;
justify-content: center;
color: #bbb;
font-size: 24px;
}
.rp-card__name {
display: block;
padding: 5px 5px;
font-size: 11px;
color: #333;
text-align: center;
line-height: 1.4;
word-break: break-all;
}
.rp-card.is-selected .rp-card__name { color: #1a6fcf; font-weight: bold; }
.rp-card.is-selected::after {
content: \"✓\";
position: absolute;
top: 3px; right: 6px;
color: #1a6fcf;
font-size: 13px;
font-weight: bold;
}
/* ---- 2. ボタン式ラジオ(画像なし・8個以内)---- */
.rp-btn-group {
display: flex;
flex-wrap: wrap;
gap: 8px;
margin-bottom: 4px;
max-width: 100%;
min-width: 0;
}
.rp-btn {
cursor: pointer;
touch-action: manipulation; /* drop iOS 300ms tap delay (#15) */
-webkit-tap-highlight-color: rgba(0,0,0,0);
/* iOS Safari: block first-tap text selection so 1 tap switches (#15) */
-webkit-user-select: none; -moz-user-select: none; user-select: none;
-webkit-touch-callout: none;
padding: 8px 14px;
border: 2px solid #ddd;
border-radius: 10px;
font-size: 13px;
color: #333;
background: #fff;
transition: border-color 0.2s, background 0.2s;
white-space: normal;
max-width: 100%;
overflow-wrap: anywhere;
text-decoration: none;
}
@media (hover: hover) and (pointer: fine) {
.rp-btn:hover { border-color: #999; }
}
.rp-btn.is-selected {
border-color: #1a6fcf;
color: #1a6fcf;
font-weight: bold;
background: #f0f6ff;
}
.rp-btn input[type=\"radio\"] {
position: absolute; opacity: 0; width: 1px; height: 1px;
margin: 0; pointer-events: none;
}
/* iOS Safari \"2回タッチ\" fix for the type-selection link chips.
The global theme stylesheet ships an ungated `a:hover{color:#296292}`
(paired with `a{color:#337ab7;text-decoration:underline}`). Because
.rp-btn / .rp-card are real <a> links, iOS Safari applies that hover
colour on the FIRST tap — the chip text turns blue (#296292, the
reported \"字だけ青くなる\") — and treats the tap as a hover, swallowing
the navigation so a 2nd tap was needed. The local .rp-*:hover rules
are already gated behind (hover:hover), but this inherited global
rule was not. Pin the hover/active colour to the base/selected colour
so tapping produces no visual change and the first tap navigates
immediately. Higher specificity (0,2,0 / 0,3,0) overrides a:hover. */
.rp-btn:hover,
.rp-btn:active { color: #333; text-decoration: none; }
.rp-btn.is-selected:hover,
.rp-btn.is-selected:active { color: #1a6fcf; text-decoration: none; }
.rp-card:hover,
.rp-card:active { color: #333; text-decoration: none; }
.rp-card:hover .rp-card__name,
.rp-card:active .rp-card__name { color: #333; }
.rp-card.is-selected:hover .rp-card__name,
.rp-card.is-selected:active .rp-card__name { color: #1a6fcf; }
/* ---- 選択肢が多い場合: 縦3段に収めて横スクロール(顧客要望「3列くらいで横スクロール」)---- */
/* grid-auto-flow:column + 3行固定 → 選択肢が縦に最大3段、超過分は右へ伸び横スクロールで閲覧 */
.rp-btn-group.is-scroll,
.opt-btn-group.is-scroll {
display: grid;
grid-auto-flow: column;
grid-template-rows: repeat(3, auto);
grid-auto-columns: max-content;
justify-content: start;
align-items: start;
gap: 8px;
overflow-x: auto;
overflow-y: hidden;
-webkit-overflow-scrolling: touch;
scrollbar-width: thin;
/* 上下に余白を確保して、行の枠線が overflow クリップ/スクロールバーに
切り取られないようにする(「文字列が長いと下枠が消える」対策)。 */
padding: 2px 0 12px;
}
/* is-scroll(横スクロール)内では選択肢を折り返さず単一行に固定する。
折り返すと行高が不揃いになり overflow-y:hidden で下枠が切れるため、
長い選択肢は折り返さず横スクロールで見せる(本来の設計意図)。 */
.rp-btn-group.is-scroll .rp-btn,
.rp-btn-group.is-scroll .opt-btn,
.opt-btn-group.is-scroll .rp-btn,
.opt-btn-group.is-scroll .opt-btn {
white-space: nowrap;
word-break: normal;
overflow-wrap: normal;
}
/* ただし画像付き選択肢(カラースウォッチ等)は max-width で幅が固定されるため、
nowrap にすると名称がボックス外へはみ出して隣の選択肢と重なる。
画像付きは常に折り返し可(名称は画像の下に収める)。 */
.rp-btn-group.is-scroll .opt-btn--with-image,
.opt-btn-group.is-scroll .opt-btn--with-image,
.rp-btn-group.is-scroll .opt-btn--with-image .opt-btn__name,
.opt-btn-group.is-scroll .opt-btn--with-image .opt-btn__name {
white-space: normal;
word-break: break-word;
overflow-wrap: anywhere;
}
.rp-btn-group.is-scroll::-webkit-scrollbar,
.opt-btn-group.is-scroll::-webkit-scrollbar {
height: 6px;
}
.rp-btn-group.is-scroll::-webkit-scrollbar-thumb,
.opt-btn-group.is-scroll::-webkit-scrollbar-thumb {
background: #c0c0c0;
border-radius: 3px;
}
/* ---- 3. プルダウン(画像なし・9個以上)---- */
.rp-select-wrap {
margin-bottom: 4px;
}
.rp-select {
width: 100%;
max-width: 420px;
padding: 8px 12px;
border: 2px solid #ddd;
border-radius: 10px;
font-size: 13px;
color: #333;
background: #fff;
appearance: none;
background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E\");
background-repeat: no-repeat;
background-position: right 12px center;
cursor: pointer;
}
.rp-select:focus {
outline: none;
border-color: #1a6fcf;
}
/* ---- オプション選択ボタン(枠線ラジオ)---- */
.opt-btn-group {
display: flex;
flex-wrap: wrap;
gap: 8px;
padding: 6px 0;
max-width: 100%;
min-width: 0;
}
.opt-btn {
cursor: pointer;
touch-action: manipulation; /* drop iOS 300ms tap delay (#15) */
-webkit-tap-highlight-color: rgba(0,0,0,0);
/* iOS Safari: block first-tap text selection so 1 tap switches (#15) */
-webkit-user-select: none; -moz-user-select: none; user-select: none;
-webkit-touch-callout: none;
padding: 7px 14px;
border: 2px solid #ddd;
border-radius: 10px;
font-size: 13px;
color: #333;
background: #fff;
transition: border-color 0.2s, background 0.2s;
white-space: normal;
max-width: 100%;
overflow-wrap: anywhere;
text-decoration: none;
}
@media (hover: hover) and (pointer: fine) {
.opt-btn:hover { border-color: #999; }
}
.opt-btn.is-selected {
border-color: #1a6fcf;
color: #1a6fcf;
font-weight: bold;
background: #f0f6ff;
}
.opt-btn input[type=\"radio\"] {
position: absolute; opacity: 0; width: 1px; height: 1px;
margin: 0; pointer-events: none;
}
/* opt-btn with color swatch image. The label still works as a
radio target — clicking the image checks the input. The text
label stays under the image so users can still read the name. */
.opt-btn--with-image {
padding: 4px 6px 6px;
white-space: normal;
text-align: center;
display: inline-flex;
flex-direction: column;
align-items: center;
min-width: 96px;
max-width: 140px;
}
.opt-btn--with-image .opt-btn__img {
display: block;
width: 88px;
height: 66px;
object-fit: cover;
border-radius: 6px;
margin-bottom: 4px;
background: #f5f5f5;
}
.opt-btn--with-image .opt-btn__name {
display: block;
font-size: 11px;
line-height: 1.3;
color: inherit;
}
.opt-btn--with-image.is-selected .opt-btn__img {
outline: 2px solid #1a6fcf;
outline-offset: 1px;
}
/* sale_type=2 (内窓) 補助金対象ガラスの強調表示.
補助金が出る性能区分 (真空断熱 / Low-E複層 等) のガラス選択肢に
緑枠 + 「補助金対象」バッジを付け、選択前から判別できるようにする。 */
.opt-btn--subsidy {
border-color: #2e7d32;
}
.opt-btn--subsidy.is-selected {
border-color: #1a6fcf;
}
.opt-btn__subsidy-badge {
display: inline-block;
margin-left: 6px;
padding: 1px 6px;
border-radius: 6px;
background: #2e7d32;
color: #fff;
font-size: 11px;
font-weight: bold;
white-space: nowrap;
}
/* 補助金額・適用可否の強調 (顧客要望: もっと目立つ色とフォントに).
各窓の補助金額は緑・太字・拡大、適用条件ノートは緑の枠付きボックスにする。 */
.wt-subsidy-label {
color: #2e7d32;
font-weight: bold;
font-size: 12px;
}
.wt-subsidy-amount {
color: #2e7d32;
font-weight: bold;
font-size: 18px;
line-height: 1.2;
}
.subsidy-eligibility-note {
color: #1b5e20;
font-weight: bold;
font-size: 12.5px;
line-height: 1.5;
background: #eafaf0;
border: 1px solid #b7e4c7;
border-radius: 6px;
padding: 8px 10px;
margin-bottom: 10px;
}
.subsidy-eligibility-note strong {
color: #c0392b; /* 「合計が5万円以上」を赤で強調 */
}
/* ============================================
施工エリア案内
============================================ */
.ec-areaNotice {
margin: 16px 0;
padding: 16px 20px;
background: #f8f9fa;
border-left: 4px solid #1a6fcf;
border-radius: 0 8px 8px 0;
}
.ec-areaNotice__inner {
display: flex;
align-items: flex-start;
gap: 12px;
}
.ec-areaNotice__icon {
font-size: 22px;
line-height: 1;
flex-shrink: 0;
margin-top: 2px;
}
.ec-areaNotice__body {
flex: 1;
}
.ec-areaNotice__title {
font-size: 13px;
font-weight: bold;
color: #1a6fcf;
margin: 0 0 6px;
}
.ec-areaNotice__text {
font-size: 13px;
color: #444;
line-height: 1.7;
margin: 0;
}
.ec-areaNotice__text strong {
color: #222;
}
.ec-areaNotice__link {
display: inline-block;
margin-top: 8px;
font-size: 12px;
color: #1a6fcf;
text-decoration: underline;
}
.ec-areaNotice__link:hover {
color: #0d4fa0;
}
/* ============================================
SNSシェア + ブランド名 タイトル行
============================================ */
.ec-productRole__titleRow {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
margin-bottom: 4px;
}
.ec-productRole__titleRow .ec-headingTitle {
margin: 0;
flex: 1;
font-size: 18px;
}
.ec-share-inline {
display: flex;
align-items: center;
gap: 8px;
flex-shrink: 0;
}
@media (max-width: 767px) {
/* maker_area の float を解除して独立表示 */
#maker_area {
float: none !important;
width: auto !important;
height: auto !important;
display: block;
margin-bottom: 4px;
}
/* タイトル行: 商品名が全幅を占有しSNSは右寄せ下段 */
.ec-productRole__titleRow {
flex-wrap: wrap;
clear: both;
}
.ec-productRole__titleRow .ec-headingTitle {
flex: 1 1 100%;
font-size: 16px;
}
.ec-share-inline {
flex: 0 0 auto;
margin-left: auto;
}
}
.ec-share-inline a {
display: flex;
align-items: center;
justify-content: center;
width: 32px;
height: 32px;
border-radius: 50%;
font-size: 15px;
color: #fff;
text-decoration: none;
transition: opacity 0.2s;
}
.ec-share-inline a:hover { opacity: 0.8; }
.ec-share-inline .share-twitter { background: #000; }
.ec-share-inline .share-facebook { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.ec-share-inline .share-line { background: #06c755; }
/* description_detail下のシェアブロックはPC/スマホ共通で非表示(タイトル行に移動) */
.ec-productRole__share { display: none; }
/* ============================================
PC用: 現在のお見積り額カード強調
============================================ */
@media (min-width: 768px) {
.mitsumori-card-pc {
border: 2px solid #1a6fcf !important;
border-radius: 10px !important;
box-shadow: 0 4px 16px rgba(26,111,207,0.18) !important;
margin-top: 20px;
overflow: hidden;
background: linear-gradient(135deg, #1a6fcf, #0d4fa0) !important;
}
.mitsumori-card-pc .card-header {
background: linear-gradient(135deg, #1a6fcf, #0d4fa0) !important;
color: #fff !important;
padding: 14px 16px !important;
border-bottom: none !important;
}
.mitsumori-card-pc .card-title {
color: #fff !important;
font-size: 15px !important;
font-weight: bold !important;
margin: 0 !important;
}
.mitsumori-card-pc #mitsumori_message {
font-size: 22px !important;
font-weight: bold !important;
color: #fff !important;
}
.mitsumori-card-pc .btn-tool {
color: #fff !important;
}
/* 合計行を大きく強調 */
.mitsumori-card-pc .nav-item:first-child .nav-link {
font-size: 16px !important;
font-weight: bold !important;
color: #c00 !important;
background: #fff8f8 !important;
padding: 12px 16px !important;
}
.mitsumori-card-pc .nav-item:first-child #mitsumori_goukei {
font-size: 20px !important;
font-weight: bold !important;
color: #c00 !important;
}
/* card-body(明細リスト)を白背景に */
.mitsumori-card-pc .card-body {
background: #fff !important;
}
.mitsumori-card-pc .card-footer {
background: #f8faff !important;
border-top: 1px solid #dce8fb !important;
padding: 12px 16px !important;
}
}
@media (max-width: 767px) {
/* スマホでは現在のお見積り額カードの強調スタイルをすべてリセット */
.mitsumori-card-pc {
border: none !important;
border-radius: 0 !important;
box-shadow: none !important;
margin-top: 0 !important;
overflow: visible !important;
background: none !important;
/* sticky-top(position:sticky / z-index:1020) を解除。
そのままだと最下部で #sp-mitsumori-bar(z-index:1000) の上に
重なり、合計バーと文字が被るため通常フローへ戻す。 */
position: static !important;
z-index: auto !important;
}
.mitsumori-card-pc .card-header {
background: none !important;
color: inherit !important;
padding: inherit !important;
border-bottom: inherit !important;
}
.mitsumori-card-pc .card-title { color: inherit !important; }
.mitsumori-card-pc #mitsumori_message { font-size: inherit !important; color: inherit !important; }
.mitsumori-card-pc .btn-tool { color: inherit !important; }
/* 折りたたみトグルボタン */
.btn-mitsumori-toggle {
background: none !important;
border: 1px solid #aaa !important;
border-radius: 4px !important;
padding: 2px 8px !important;
font-size: 12px !important;
color: #333 !important;
line-height: 1.4 !important;
}
.btn-mitsumori-toggle .toggle-icon {
display: inline-block;
transition: transform 0.2s;
}
/* 展開状態: ▼→▲ */
.card:not(.collapsed-card) .btn-mitsumori-toggle .toggle-icon::before {
content: \"▲ 閉じる\";
}
.card:not(.collapsed-card) .btn-mitsumori-toggle .toggle-icon {
display: none;
}
.card:not(.collapsed-card) .btn-mitsumori-toggle::after {
content: \"▲ 閉じる\";
font-size: 12px;
}
.mitsumori-card-pc .nav-item:first-child .nav-link {
font-size: inherit !important;
color: inherit !important;
background: none !important;
padding: inherit !important;
}
.mitsumori-card-pc .nav-item:first-child #mitsumori_goukei {
font-size: inherit !important;
color: inherit !important;
}
.mitsumori-card-pc .card-footer {
background: none !important;
border-top: inherit !important;
padding: inherit !important;
}
/* 横スクロール禁止 */
body, html {
overflow-x: hidden;
max-width: 100vw;
}
/* ボタンの折り返しを許可(nowrapが原因で横スクロール発生するため) */
.opt-btn,
.rp-btn {
white-space: normal;
word-break: break-all;
}
/* エリア案内: スマホでコンパクト */
.ec-areaNotice {
margin: 8px 0;
padding: 8px 10px;
border-left-width: 3px;
cursor: pointer;
}
.ec-areaNotice__inner {
flex-direction: row;
gap: 8px;
align-items: flex-start;
}
.ec-areaNotice__icon { font-size: 15px; }
/* タイトル行: 展開トグル */
.ec-areaNotice__title {
font-size: 11px;
margin-bottom: 3px;
display: flex;
justify-content: space-between;
align-items: center;
}
.ec-areaNotice__title::after {
content: \"▼\";
font-size: 9px;
color: #888;
margin-left: 6px;
transition: transform 0.2s;
}
.ec-areaNotice.is-open .ec-areaNotice__title::after {
transform: rotate(180deg);
}
/* 折りたたみ対象: 閉じた状態では非表示 */
.ec-areaNotice__detail {
display: none;
}
.ec-areaNotice.is-open .ec-areaNotice__detail {
display: block;
}
.ec-areaNotice__text { font-size: 11px; line-height: 1.5; }
.ec-areaNotice__text br { display: none; }
.ec-areaNotice__link { font-size: 11px; margin-top: 3px; }
.rp-card { width: calc(33.333% - 6px); min-width: 80px; }
#sp-mitsumori-bar {
display: flex;
position: fixed;
bottom: 0;
left: 0;
right: 0;
z-index: 1000;
background: #fff;
border-top: 2px solid #e0e0e0;
box-shadow: 0 -2px 8px rgba(0,0,0,0.12);
align-items: center;
padding: 8px 10px calc(8px + env(safe-area-inset-bottom)) 10px;
gap: 8px;
}
#sp-mitsumori-bar .sp-bar__label {
font-size: 11px;
color: #666;
white-space: nowrap;
}
/* 価格ラッパ: 合計金額は最重要のため常に全桁表示する(縮小・省略しない)。
幅が足りない場合は下のボタン側を縮める(flex 配分でボタンが先に縮む)。 */
#sp-mitsumori-bar .sp-bar__pricewrap {
flex: 0 0 auto;
min-width: 0;
}
#sp-mitsumori-bar .sp-bar__price {
font-size: 18px;
font-weight: bold;
color: #c00;
white-space: nowrap;
}
#sp-mitsumori-bar .sp-bar__btn {
font-size: 12px;
padding: 8px 12px;
background: #333;
color: #fff;
border: none;
border-radius: 6px;
white-space: nowrap;
cursor: pointer;
position: relative;
display: inline-flex;
align-items: center;
gap: 6px;
flex: 1 1 auto;
min-width: 0;
justify-content: center;
}
#sp-mitsumori-bar .sp-bar__btn i {
font-size: 14px;
flex: 0 0 auto;
}
/* お見積りの詳細(内訳)を開くボタン。価格・カートボタンを圧迫しないよう
最小幅のアイコン+短ラベルにし、幅不足時も縮まない固定幅で維持する。 */
#sp-mitsumori-bar .sp-bar__detail-btn {
display: inline-flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 2px;
flex: 0 0 auto;
padding: 4px 8px;
background: #fff;
color: #c00;
border: 1px solid #c00;
border-radius: 6px;
font-size: 10px;
font-weight: bold;
line-height: 1.1;
white-space: nowrap;
cursor: pointer;
}
#sp-mitsumori-bar .sp-bar__detail-btn i { font-size: 15px; }
/* 幅が足りないときはボタンの文字を省略し、価格と数字を守る。 */
#sp-mitsumori-bar .sp-bar__btn-label {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
#sp-mitsumori-bar .sp-bar__cart-badge {
position: absolute;
top: -6px;
right: -6px;
background: #c00;
color: #fff;
border-radius: 50%;
min-width: 16px;
height: 16px;
font-size: 10px;
line-height: 16px;
padding: 0 4px;
font-weight: bold;
}
#sp-mitsumori-bar .sp-bar__home-btn {
display: inline-flex;
align-items: center;
justify-content: center;
width: 36px;
height: 36px;
flex: 0 0 auto;
border: 1px solid #ccc;
border-radius: 6px;
background: #fff;
color: #333;
text-decoration: none;
cursor: pointer;
}
#sp-mitsumori-bar .sp-bar__home-btn i {
font-size: 16px;
}
#sp-mitsumori-bar .sp-bar__home-btn:hover {
background: #f0f0f0;
}
/* 下部バーの高さ分ページ下部にpaddingを追加 (iOS safe-area 込み) */
body {
padding-bottom: calc(80px + env(safe-area-inset-bottom));
}
}
/* ============================================
カート追加モーダル: 縦並び中央配置
============================================ */
.add-cart-modal__wrap {
text-align: center;
}
.add-cart-modal__header {
font-size: 16px;
margin: 20px 0 24px;
text-align: center;
}
.add-cart-modal__actions {
display: flex;
flex-direction: column;
align-items: center;
gap: 16px;
padding: 0 20px 20px;
}
.add-cart-modal__primary {
display: inline-block;
width: 80%;
max-width: 320px;
padding: 14px 20px;
font-size: 15px;
font-weight: bold;
text-align: center;
background: #d9534f;
color: #fff !important;
border-radius: 6px;
text-decoration: none;
cursor: pointer;
}
.add-cart-modal__primary:hover {
background: #c9302c;
color: #fff !important;
text-decoration: none;
}
.add-cart-modal__secondary {
display: inline-block;
padding: 6px 14px;
font-size: 12px;
color: #666;
border: 1px solid #ccc;
border-radius: 4px;
background: #fff;
cursor: pointer;
}
.add-cart-modal__secondary:hover {
background: #f0f0f0;
color: #333;
}
@media (max-width: 767px) {
.add-cart-modal__actions {
gap: 20px;
}
}
</style>
";
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
}
// line 1113
public function block_javascript($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "javascript"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "javascript"));
// line 1114
echo "
<script>
eccube.classCategories = ";
// line 1116
echo $this->extensions['Eccube\Twig\Extension\EccubeExtension']->getClassCategoriesAsJson((isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 1116, $this->source); })()));
echo ";
// 規格2に選択肢を割り当てる。
function fnSetClassCategories(form, classcat_id2_selected) {
var \$form = \$(form);
var product_id = \$form.find('input[name=product_id]').val();
var \$sele1 = \$form.find('select[name=classcategory_id1]');
var \$sele2 = \$form.find('select[name=classcategory_id2]');
eccube.setClassCategories(\$form, product_id, \$sele1, \$sele2, classcat_id2_selected);
}
";
// line 1127
if (twig_get_attribute($this->env, $this->source, ($context["form"] ?? null), "classcategory_id2", [], "any", true, true, false, 1127)) {
// line 1128
echo " fnSetClassCategories(
\$('#form1'), ";
// line 1129
echo json_encode(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 1129, $this->source); })()), "classcategory_id2", [], "any", false, false, false, 1129), "vars", [], "any", false, false, false, 1129), "value", [], "any", false, false, false, 1129));
echo "
);
";
} elseif (twig_get_attribute($this->env, $this->source, // line 1131
($context["form"] ?? null), "classcategory_id1", [], "any", true, true, false, 1131)) {
// line 1132
echo " eccube.checkStock(\$('#form1'), ";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 1132, $this->source); })()), "id", [], "any", false, false, false, 1132), "html", null, true);
echo ", ";
echo json_encode(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 1132, $this->source); })()), "classcategory_id1", [], "any", false, false, false, 1132), "vars", [], "any", false, false, false, 1132), "value", [], "any", false, false, false, 1132));
echo ", null);
";
}
// line 1134
echo " </script>
<script>
\$(function() {
// bfcache無効化
\$(window).bind('pageshow', function(event) {
if (event.originalEvent.persisted) {
location.reload(true);
}
});
// Core Web Vital の Cumulative Layout Shift(CLS)対策のため
// img タグに width, height が付与されている.
// 630px 未満の画面サイズでは縦横比が壊れるための対策
// see https://github.com/EC-CUBE/ec-cube/pull/5023
\$('.ec-grid2__cell').hide();
var removeSize = function () {
\$('.slide-item').height('');
\$('.slide-item img')
.removeAttr('width')
.removeAttr('height')
.removeAttr('style');
};
var slickInitial = function(slick) {
\$('.ec-grid2__cell').fadeIn(1500);
var baseHeight = \$(slick.target).height();
var baseWidth = \$(slick.target).width();
var rate = baseWidth / baseHeight;
\t\t\t\tif(baseHeight * rate < 400){
\t \$('.slide-item').height(baseHeight * rate); // 余白を削除する
\t\t\t\t}else{
\t \$('.slide-item').height(400); // 余白を削除する
\t\t\t\t}
// transform を使用することでCLSの影響を受けないようにする
\$('.slide-item img')
.css(
{
'transform-origin': 'top left',
'transform': 'scaleY(' + rate + ')',
'transition': 'transform .1s'
}
);
// 正しいサイズに近くなったら属性を解除する
setTimeout(removeSize, 500);
};
\$('.item_visual').on('init', slickInitial);
// リサイズ時は CLS の影響を受けないため属性を解除する
\$(window).resize(removeSize);
\$('.item_visual').slick({
dots: false,
arrows: true,
responsive: [{
breakpoint: 768,
settings: {
dots: true,
\t\tarrows: false
}
}]
});
\$('.slideThumb').on('click', function() {
var index = \$(this).attr('data-index');
\$('.item_visual').slick('slickGoTo', index, false);
})
});
</script>
<script>
\$(function() {
\$('.add-cart').on('click', function(event) {
";
// line 1204
if (twig_get_attribute($this->env, $this->source, ($context["form"] ?? null), "classcategory_id1", [], "any", true, true, false, 1204)) {
// line 1205
echo " // 規格1フォームの必須チェック
if (\$('#classcategory_id1').val() == '__unselected' || \$('#classcategory_id1').val() == '') {
\$('#classcategory_id1')[0].setCustomValidity('";
// line 1207
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("項目が選択されていません"), "html", null, true);
echo "');
return true;
} else {
\$('#classcategory_id1')[0].setCustomValidity('');
}
";
}
// line 1213
echo "
";
// line 1214
if (twig_get_attribute($this->env, $this->source, ($context["form"] ?? null), "classcategory_id2", [], "any", true, true, false, 1214)) {
// line 1215
echo " // 規格2フォームの必須チェック
if (\$('#classcategory_id2').val() == '__unselected' || \$('#classcategory_id2').val() == '') {
\$('#classcategory_id2')[0].setCustomValidity('";
// line 1217
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("項目が選択されていません"), "html", null, true);
echo "');
return true;
} else {
\$('#classcategory_id2')[0].setCustomValidity('');
}
";
}
// line 1223
echo "
// タイプ2: カート送信直前に set_count を quantity に同期
if(\$('#set_count').length){
var _sc = parseInt(\$('#set_count').val()) || 1;
\$('#quantity').val(_sc);
\$('input[name=\"quantity\"]').val(_sc);
}
// 個数フォームのチェック
if (\$('#quantity').val() < 1) {
\$('#quantity')[0].setCustomValidity('";
// line 1233
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("1以上で入力してください。"), "html", null, true);
echo "');
return true;
} else {
\$('#quantity')[0].setCustomValidity('');
}
event.preventDefault();
\$form = \$('#form1');
\$.ajax({
url: \$form.attr('action'),
type: \$form.attr('method'),
data: \$form.serialize(),
dataType: 'json',
beforeSend: function(xhr, settings) {
// Buttonを無効にする
\$('.add-cart').prop('disabled', true);
}
}).done(function(data) {
// レスポンス内のメッセージをalertで表示
\$.each(data.messages, function() {
\$('#ec-modal-header').text(this);
});
\$('.ec-modal').show()
// カートブロックを更新する
\$.ajax({
url: \"";
// line 1260
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("block_cart");
echo "\",
type: 'GET',
dataType: 'html'
}).done(function(html) {
\$('.ec-headerRole__cart').html(html);
});
}).fail(function(data) {
alert('";
// line 1267
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("カートへの追加に失敗しました。"), "html", null, true);
echo "');
}).always(function(data) {
// Buttonを有効にする
\$('.add-cart').prop('disabled', false);
});
});
});
\$('.ec-modal-wrap').on('click', function(e) {
// モーダル内の処理は外側にバブリングさせない
e.stopPropagation();
});
\$('.ec-modal-overlay, .ec-modal, .ec-modal-close, .ec-inlineBtn--cancel').on('click', function() {
\$('.ec-modal').hide()
});
\t\tvar pw = \"";
// line 1284
if ((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1284, $this->source); })())) {
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1284, $this->source); })()), "pw", [], "any", false, false, false, 1284), "html", null, true);
}
echo "\";
\t\tvar pd = \"";
// line 1285
if ((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1285, $this->source); })())) {
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1285, $this->source); })()), "pd", [], "any", false, false, false, 1285), "html", null, true);
}
echo "\";
\t\tvar ph = \"";
// line 1286
if ((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1286, $this->source); })())) {
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1286, $this->source); })()), "ph", [], "any", false, false, false, 1286), "html", null, true);
}
echo "\";
\t\tvar pm = \"";
// line 1287
if ((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1287, $this->source); })())) {
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1287, $this->source); })()), "pm", [], "any", false, false, false, 1287), "html", null, true);
}
echo "\";
\t\tvar pc = \"";
// line 1288
if ((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1288, $this->source); })())) {
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1288, $this->source); })()), "pc", [], "any", false, false, false, 1288), "html", null, true);
}
echo "\";
\t\t// option1 / option2: カテゴリ別 option 軸 (um: タイプ=subtype, fe: ct_up 等)
\t\tvar option1 = \"";
// line 1290
if (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1290, $this->source); })()) && twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "option1", [], "any", true, true, false, 1290))) {
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1290, $this->source); })()), "option1", [], "any", false, false, false, 1290), "html", null, true);
}
echo "\";
\t\tvar option2 = \"";
// line 1291
if (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1291, $this->source); })()) && twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "option2", [], "any", true, true, false, 1291))) {
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1291, $this->source); })()), "option2", [], "any", false, false, false, 1291), "html", null, true);
}
echo "\";
\t\tvar op0 = \"";
// line 1292
if ((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1292, $this->source); })())) {
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1292, $this->source); })()), "op", [], "any", false, false, false, 1292), 0, [], "array", false, false, false, 1292), "html", null, true);
}
echo "\";
\t\tvar op1 = \"";
// line 1293
if ((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1293, $this->source); })())) {
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1293, $this->source); })()), "op", [], "any", false, false, false, 1293), 1, [], "array", false, false, false, 1293), "html", null, true);
}
echo "\";
\t\tvar op2 = \"";
// line 1294
if ((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1294, $this->source); })())) {
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1294, $this->source); })()), "op", [], "any", false, false, false, 1294), 2, [], "array", false, false, false, 1294), "html", null, true);
}
echo "\";
\t\tvar op3 = \"";
// line 1295
if ((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1295, $this->source); })())) {
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1295, $this->source); })()), "op", [], "any", false, false, false, 1295), 3, [], "array", false, false, false, 1295), "html", null, true);
}
echo "\";
\t\tvar op4 = \"";
// line 1296
if ((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1296, $this->source); })())) {
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1296, $this->source); })()), "op", [], "any", false, false, false, 1296), 4, [], "array", false, false, false, 1296), "html", null, true);
}
echo "\";
\t\tvar op5 = \"";
// line 1297
if ((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1297, $this->source); })())) {
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1297, $this->source); })()), "op", [], "any", false, false, false, 1297), 5, [], "array", false, false, false, 1297), "html", null, true);
}
echo "\";
\t\tvar op6 = \"";
// line 1298
if ((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1298, $this->source); })())) {
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1298, $this->source); })()), "op", [], "any", false, false, false, 1298), 6, [], "array", false, false, false, 1298), "html", null, true);
}
echo "\";
\t\tvar op7 = \"";
// line 1299
if ((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1299, $this->source); })())) {
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1299, $this->source); })()), "op", [], "any", false, false, false, 1299), 7, [], "array", false, false, false, 1299), "html", null, true);
}
echo "\";
\t\tvar op8 = \"";
// line 1300
if ((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1300, $this->source); })())) {
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1300, $this->source); })()), "op", [], "any", false, false, false, 1300), 8, [], "array", false, false, false, 1300), "html", null, true);
}
echo "\";
\t\tvar op9 = \"";
// line 1301
if ((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1301, $this->source); })())) {
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1301, $this->source); })()), "op", [], "any", false, false, false, 1301), 9, [], "array", false, false, false, 1301), "html", null, true);
}
echo "\";
\t\tvar op10 = \"";
// line 1302
if ((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1302, $this->source); })())) {
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1302, $this->source); })()), "op", [], "any", false, false, false, 1302), 10, [], "array", false, false, false, 1302), "html", null, true);
}
echo "\";
\t\tconst formatter = new Intl.NumberFormat('ja-JP');
\t\t// ============================================================
\t\t// free_area 1 エントリのスキーマ(11 キー固定)
\t\t// ============================================================
\t\t// w : 幅 (string, 例 \"239.9cm\" / tf は \"1m\")
\t\t// d : 奥行
\t\t// h : 高さ (tf はロール長 \"10m\")
\t\t// m : 素材
\t\t// c : カラー
\t\t// price : 販売価格 (税抜、amount=1 ベース)
\t\t// unit_price : 商品 per-unit 増分 (税抜、AMOUNT_CATEGORIES のみ)
\t\t// maker_price : メーカー価格 (税抜)
\t\t// ct : 基本工事費 (税抜、amount=1 ベース)
\t\t// option1 : fe → ct_up / その他カテゴリ → category-specific
\t\t// option2 : um → ct_up / その他カテゴリ → category-specific
\t\t//
\t\t// ct4 (設置場所) / ct5 (撤去) / ct6 (残土) は option_area 側で扱う.
\t\t// ============================================================
\t\t// 施工オプション定義(option_area)— 各エントリ {name, comment, on, off, price}
\t\tvar op_data = ";
// line 1325
echo ((array_key_exists("op_json", $context)) ? (_twig_default_filter((isset($context["op_json"]) || array_key_exists("op_json", $context) ? $context["op_json"] : (function () { throw new RuntimeError('Variable "op_json" does not exist.', 1325, $this->source); })()), "[]")) : ("[]"));
echo ";
\t\t// option_item_area:
\t\t// tg 用 — block 別オプション差額表
\t\t// { axis_labels: {F:'床材',front:'前面型',side1:'右側面型',side2:'左側面型'},
\t\t// blocks: { 'W_label|D_label': { F:[{idx,label,diff},...], front:[...], side1:[...], side2:[...] }, ... } }
\t\t// fe (sale_type=4) 用 — ブロックの種類×段数の差額表 (fe_block キー)
\t\t// { fe_block: { depends_on_name: '...', depends_on_value: '...',
\t\t// title: '...', default_key: '...',
\t\t// choices: [{key,label,price}, ...] } }
\t\t// 該当しないカテゴリでは fe_block は null. axis_labels/blocks は空.
\t\tvar oi_data = ";
// line 1336
echo ((array_key_exists("oi_json", $context)) ? (_twig_default_filter((isset($context["oi_json"]) || array_key_exists("oi_json", $context) ? $context["oi_json"] : (function () { throw new RuntimeError('Variable "oi_json" does not exist.', 1336, $this->source); })()), "{\"axis_labels\":{},\"blocks\":{},\"fe_block\":null}")) : ("{\"axis_labels\":{},\"blocks\":{},\"fe_block\":null}"));
echo ";
\t\t// 選択中の tg オプション差額 (axis -> selected choice_idx). ラジオ click で更新される.
\t\tvar oi_selected = { F: 1, front: 1, side1: 1, side2: 1 };
\t\t// 選択中の fe ブロック種類×段数 (key 文字列). 既定は oi_data.fe_block.default_key.
\t\tvar fe_block_selected = (oi_data && oi_data.fe_block && oi_data.fe_block.default_key) || '';
\t\t// sale_type ID(mtb_sale_type の id。本サイトでの意味は次の通り):
\t\t// 1 通常 / 2 補助金窓 / 3 物置 / 4 フェンス / 5 デッキ / 6 芝生 / 9 商品のみ
\t\tvar SALE_TYPE_ID = ";
// line 1346
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 1346, $this->source); })()), "SaleType", [], "any", false, false, false, 1346), "id", [], "any", false, false, false, 1346), "html", null, true);
echo ";
\t\t";
// line 1349
echo "\t\t";
$context["option1_label"] = "オプション1";
// line 1350
echo "\t\t";
$context["option2_label"] = "オプション2";
// line 1351
echo "\t\t";
if ( !twig_test_empty(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 1351, $this->source); })()), "ProductCategories", [], "any", false, false, false, 1351))) {
// line 1352
echo "\t\t\t";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 1352, $this->source); })()), "ProductCategories", [], "any", false, false, false, 1352));
foreach ($context['_seq'] as $context["_key"] => $context["pcat"]) {
// line 1353
echo "\t\t\t\t";
if ((twig_get_attribute($this->env, $this->source, $context["pcat"], "category_id", [], "any", false, false, false, 1353) == 31)) {
$context["option1_label"] = "サイズプリセット";
$context["option2_label"] = "駆動方式";
}
// line 1354
echo "\t\t\t\t";
if ((twig_get_attribute($this->env, $this->source, $context["pcat"], "category_id", [], "any", false, false, false, 1354) == 43)) {
$context["option1_label"] = "ランマ";
$context["option2_label"] = "タイプ";
}
// line 1355
echo "\t\t\t\t";
if ((twig_get_attribute($this->env, $this->source, $context["pcat"], "category_id", [], "any", false, false, false, 1355) == 15)) {
$context["option1_label"] = "棚タイプ";
}
// line 1356
echo "\t\t\t\t";
if ((twig_get_attribute($this->env, $this->source, $context["pcat"], "category_id", [], "any", false, false, false, 1356) == 17)) {
$context["option1_label"] = "窓タイプ";
}
// line 1357
echo "\t\t\t";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['pcat'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 1358
echo "\t\t";
}
// line 1359
echo "
\t\t// 消費税率(pp.price/pp.ct/op_data.price は scraper が税抜で保存しているため、
\t\t// calcGoukei 出口で 1+TAX_RATE を掛けて税込 mitsumori_goukei にする)
\t\tvar TAX_RATE = 0.10;
\t\tfunction toIncTax(v) { return Math.round(v * (1 + TAX_RATE)); }
\t\t/**
\t\t * tg 用 block 別オプション差額の集計.
\t\t * 現選択 (W, D) から block key を作り、oi_data.blocks[blockKey] を取得.
\t\t * 各 axis (F/front/side1/side2) で oi_selected[axis] の choice の diff を合計.
\t\t * 戻り値: { total: 差額合計(税抜), items: [{name, label, diff}, ...] }
\t\t * block が無い (tg 以外 / 該当 (W,D) が未取得) なら total=0.
\t\t */
\t\tfunction collectOptionItems(curW, curD) {
\t\t\tvar result = { total: 0, items: [] };
\t\t\tif (!oi_data || !oi_data.blocks) return result;
\t\t\tvar blockKey = (curW || '') + '|' + (curD || '');
\t\t\tvar block = oi_data.blocks[blockKey];
\t\t\tif (!block) return result;
\t\t\tvar axes = ['F', 'front', 'side1', 'side2'];
\t\t\tfor (var i = 0; i < axes.length; i++) {
\t\t\t\tvar axis = axes[i];
\t\t\t\tvar choices = block[axis];
\t\t\t\tif (!choices || !choices.length) continue;
\t\t\t\tvar idx = oi_selected[axis] || 1;
\t\t\t\tvar pick = null;
\t\t\t\tfor (var j = 0; j < choices.length; j++) {
\t\t\t\t\tif (parseInt(choices[j].idx) === parseInt(idx)) { pick = choices[j]; break; }
\t\t\t\t}
\t\t\t\tif (!pick) pick = choices[0];
\t\t\t\tvar diff = parseInt(pick.diff) || 0;
\t\t\t\tresult.total += diff;
\t\t\t\tresult.items.push({
\t\t\t\t\tname: oi_data.axis_labels[axis] || axis,
\t\t\t\t\tlabel: pick.label,
\t\t\t\t\tdiff: diff,
\t\t\t\t});
\t\t\t}
\t\t\treturn result;
\t\t}
\t\t/**
\t\t * tg ラジオ群を block 別に DOM へ描画する.
\t\t * W/D が確定したら現 block の 4 軸 (F/front/side1/side2) ラジオを #tg-options 要素に出す.
\t\t * block が空なら #tg-options を空にする.
\t\t */
\t\tfunction renderOptionItemRadios(curW, curD) {
\t\t\tvar \$box = \$('#tg-options');
\t\t\tif (!\$box.length) return;
\t\t\t\$box.empty();
\t\t\tif (!oi_data || !oi_data.blocks) return;
\t\t\tvar blockKey = (curW || '') + '|' + (curD || '');
\t\t\tvar block = oi_data.blocks[blockKey];
\t\t\tif (!block) return;
\t\t\tvar axes = ['F', 'front', 'side1', 'side2'];
\t\t\taxes.forEach(function(axis) {
\t\t\t\tvar choices = block[axis];
\t\t\t\tif (!choices || !choices.length) return;
\t\t\t\tvar axisLabel = (oi_data.axis_labels && oi_data.axis_labels[axis]) || axis;
\t\t\t\tvar \$section = \$('<div class=\"form-group tg-axis\"></div>');
\t\t\t\t\$section.append('<p class=\"rp-section-label\"><strong>' + axisLabel + '</strong>: <span class=\"tg-axis-selected\"></span></p>');
\t\t\t\t// 他オプション(opt-btn)と統一したボタン型 UI で描画(縦積み・長ラベル折返し).
\t\t\t\tvar \$list = \$('<div class=\"opt-btn-group no-hscroll\" style=\"flex-direction:column;align-items:stretch;\"></div>');
\t\t\t\tchoices.forEach(function(ch, i) {
\t\t\t\t\tvar inputId = 'tg_' + axis + '_' + ch.idx;
\t\t\t\t\tvar name = 'tg_' + axis;
\t\t\t\t\tvar isSel = (parseInt(ch.idx) === parseInt(oi_selected[axis] || 1));
\t\t\t\t\tvar diffTxt = ch.diff > 0 ? '+' + formatter.format(ch.diff) + '円' : (ch.diff < 0 ? formatter.format(ch.diff) + '円' : '±0');
\t\t\t\t\t\$list.append(
\t\t\t\t\t\t'<label class=\"opt-btn' + (isSel ? ' is-selected' : '') + '\" style=\"text-align:left;display:flex;align-items:center;flex-wrap:wrap;\">' +
\t\t\t\t\t\t'<input type=\"radio\" name=\"' + name + '\" id=\"' + inputId + '\" value=\"' + ch.idx + '\" data-axis=\"' + axis + '\"' + (isSel ? ' checked' : '') + '>' +
\t\t\t\t\t\tch.label + '<span class=\"tg-diff\">(' + diffTxt + ')</span></label>'
\t\t\t\t\t);
\t\t\t\t});
\t\t\t\t\$section.append(\$list);
\t\t\t\t\$box.append(\$section);
\t\t\t});
\t\t\t// ラジオ選択で oi_selected 更新 + is-selected 付替え → 再計算
\t\t\t\$box.off('change.tg').on('change.tg', 'input[type=\"radio\"][data-axis]', function() {
\t\t\t\tvar axis = \$(this).data('axis');
\t\t\t\toi_selected[axis] = parseInt(\$(this).val()) || 1;
\t\t\t\t\$(this).closest('.opt-btn-group').find('label.opt-btn').removeClass('is-selected');
\t\t\t\t\$(this).closest('label.opt-btn').addClass('is-selected');
\t\t\t\tmitsumori_simulation('refresh', '');
\t\t\t});
\t\t\tupdateOptionItemSelectedLabels();
\t\t}
\t\tfunction updateOptionItemSelectedLabels() {
\t\t\t\$('#tg-options .tg-axis').each(function() {
\t\t\t\tvar \$sel = \$(this).find('input[type=\"radio\"]:checked');
\t\t\t\tif (!\$sel.length) return;
\t\t\t\tvar label = \$sel.parent().contents().filter(function() { return this.nodeType === 3; }).text().trim();
\t\t\t\t\$(this).find('.tg-axis-selected').text(label);
\t\t\t});
\t\t}
\t\t// =========================================================
\t\t// fe (sale_type=4) ブロック種類×段数 サブ UI
\t\t// =========================================================
\t\t/**
\t\t * fe_block の親オプション (= op_data 内の「ご希望のフェンス設置方法」 entry)
\t\t * を name でルックアップし、その index を返す. 見つからなければ -1.
\t\t * fe_block.depends_on_name が設定されていればそれで照合.
\t\t * 未設定なら 'ご希望のフェンス設置方法' を含む name にフォールバック.
\t\t */
\t\tfunction findFeBlockParentOpIndex() {
\t\t\tif (!oi_data || !oi_data.fe_block) return -1;
\t\t\tvar needle = oi_data.fe_block.depends_on_name || 'ご希望のフェンス設置方法';
\t\t\tfor (var i = 0; i < op_data.length; i++) {
\t\t\t\tif (!op_data[i] || !op_data[i].name) continue;
\t\t\t\tif (op_data[i].name.indexOf(needle) >= 0) return i;
\t\t\t}
\t\t\treturn -1;
\t\t}
\t\t/**
\t\t * fe_block の現在の選択値の price (税抜) と choice 内容を集計.
\t\t * 親オプション (= 'ご希望のフェンス設置方法') が depends_on_value を選んでいる
\t\t * ときだけ加算する. それ以外 (既存ブロック側 / 親未選択) は price=0.
\t\t * 戻り値: { price: 0|N, choice: {key,label,price}|null, active: bool }
\t\t */
\t\tfunction collectFeBlock() {
\t\t\tvar result = { price: 0, choice: null, active: false };
\t\t\tif (SALE_TYPE_ID !== 4) return result;
\t\t\tif (!oi_data || !oi_data.fe_block) return result;
\t\t\tif (!oi_data.fe_block.choices || !oi_data.fe_block.choices.length) return result;
\t\t\tvar parentIdx = findFeBlockParentOpIndex();
\t\t\tif (parentIdx < 0) return result;
\t\t\tvar ops = [op0,op1,op2,op3,op4,op5,op6,op7,op8,op9,op10];
\t\t\tvar parentSel = ops[parentIdx];
\t\t\tvar triggerValue = oi_data.fe_block.depends_on_value || '新規にブロック積みを行う';
\t\t\tif (parentSel !== triggerValue) return result; // 親が新規ブロック積み以外なら無加算
\t\t\tresult.active = true;
\t\t\tvar choices = oi_data.fe_block.choices;
\t\t\tvar pick = null;
\t\t\tfor (var j = 0; j < choices.length; j++) {
\t\t\t\tif (choices[j].key === fe_block_selected) { pick = choices[j]; break; }
\t\t\t}
\t\t\tif (!pick) pick = choices[0];
\t\t\tresult.choice = pick;
\t\t\tresult.price = parseInt(pick.price) || 0;
\t\t\treturn result;
\t\t}
\t\t/**
\t\t * fe_block ラジオ群を #fe-block-options 要素に描画する.
\t\t * active=false (親が「新規にブロック積み」以外) のときは非表示.
\t\t */
\t\tfunction renderFeBlockRadios() {
\t\t\tvar \$box = \$('#fe-block-options');
\t\t\tif (!\$box.length) return;
\t\t\tif (!oi_data || !oi_data.fe_block || !oi_data.fe_block.choices) {
\t\t\t\t\$box.empty().hide();
\t\t\t\treturn;
\t\t\t}
\t\t\tvar parentIdx = findFeBlockParentOpIndex();
\t\t\tif (parentIdx < 0) {
\t\t\t\t\$box.empty().hide();
\t\t\t\treturn;
\t\t\t}
\t\t\tvar ops = [op0,op1,op2,op3,op4,op5,op6,op7,op8,op9,op10];
\t\t\tvar triggerValue = oi_data.fe_block.depends_on_value || '新規にブロック積みを行う';
\t\t\tvar visible = (ops[parentIdx] === triggerValue);
\t\t\tif (!visible) {
\t\t\t\t\$box.hide();
\t\t\t\treturn;
\t\t\t}
\t\t\tvar fb = oi_data.fe_block;
\t\t\t\$box.empty();
\t\t\tvar \$title = \$('<p class=\"rp-section-label\"><strong>' + (fb.title || 'ブロックの種類と段数') + '</strong></p>');
\t\t\t\$box.append(\$title);
\t\t\t// 他オプション群と同じ .opt-btn-group / .opt-btn 形式で描画.
\t\t\t// 生の <label><input type=radio> ... 形式だと CSS 定義が無く
\t\t\t// ラベル折り返し・縦ズレ・隣接 opt-btn との間隔不揃いが発生する.
\t\t\tvar \$list = \$('<div class=\"opt-btn-group no-hscroll\" style=\"flex-direction:column;align-items:stretch;\"></div>');
\t\t\tfb.choices.forEach(function(ch) {
\t\t\t\tvar inputId = 'fe_block_' + ch.key;
\t\t\t\tvar isSel = (ch.key === fe_block_selected);
\t\t\t\tvar checked = isSel ? ' checked' : '';
\t\t\t\tvar selCls = isSel ? ' is-selected' : '';
\t\t\t\t// 選択肢ラベルには価格を表示しない(差額は合計金額側でのみ反映)。
\t\t\t\t\$list.append(
\t\t\t\t\t'<label class=\"opt-btn' + selCls + '\" style=\"text-align:left;display:flex;align-items:center;flex-wrap:wrap;\">' +
\t\t\t\t\t'<input type=\"radio\" name=\"fe_block\" id=\"' + inputId + '\" value=\"' + ch.key + '\"' + checked + '>' +
\t\t\t\t\t'<span class=\"fe-block-label\">' + ch.label + '</span>' +
\t\t\t\t\t'</label>'
\t\t\t\t);
\t\t\t});
\t\t\t\$box.append(\$list);
\t\t\t\$box.show();
\t\t\t\$box.off('change.fe_block').on('change.fe_block', 'input[type=\"radio\"][name=\"fe_block\"]', function() {
\t\t\t\tfe_block_selected = \$(this).val();
\t\t\t\t// is-selected 切替 (opt-btn 形式共通)
\t\t\t\t\$box.find('label.opt-btn').removeClass('is-selected');
\t\t\t\t\$(this).closest('label.opt-btn').addClass('is-selected');
\t\t\t\tmitsumori_simulation('refresh', '');
\t\t\t});
\t\t}
\t\t/**
\t\t * fe (sale_type=4) で op_data エントリの連動表示制御.
\t\t * 親「ご希望のフェンス設置方法」の選択値に応じて、
\t\t * - 「既存ブロックに穴空け工事が必要ですか?」 entry を表示/非表示
\t\t * 切替の trigger は親選択値の文字列で判定 (entry index にハードコードしない).
\t\t */
\t\tfunction updateFeOpConditionalVisibility() {
\t\t\tif (SALE_TYPE_ID !== 4) return;
\t\t\tvar parentIdx = findFeBlockParentOpIndex();
\t\t\tif (parentIdx < 0) return;
\t\t\tvar ops = [op0,op1,op2,op3,op4,op5,op6,op7,op8,op9,op10];
\t\t\tvar parentSel = ops[parentIdx];
\t\t\t// 親が「既存ブロックに設置する」 (= off 側) のとき穴空け entry を表示
\t\t\tvar triggerOffValue = (op_data[parentIdx] && op_data[parentIdx].off) || '既存ブロックに設置する';
\t\t\t\$('div[data-op-name]').each(function() {
\t\t\t\tvar n = \$(this).attr('data-op-name') || '';
\t\t\t\tif (n.indexOf('穴空け') >= 0) {
\t\t\t\t\tif (parentSel === triggerOffValue) {
\t\t\t\t\t\t\$(this).show();
\t\t\t\t\t} else {
\t\t\t\t\t\t\$(this).hide();
\t\t\t\t\t}
\t\t\t\t}
\t\t\t});
\t\t}
\t\t/**
\t\t * 選択中の施工オプションを集計し、ON選択分の price を合計する.
\t\t * 戻り値: { total: 合計金額, items: [{name, value, price}, ...] }
\t\t */
\t\tfunction collectOptions() {
\t\t\tvar ops = [op0,op1,op2,op3,op4,op5,op6,op7,op8,op9,op10];
\t\t\tvar total = 0;
\t\t\tvar items = [];
\t\t\tfor (var i = 0; i < ops.length; i++) {
\t\t\t\tif (!op_data[i] || !op_data[i].name) continue;
\t\t\t\tvar sel = ops[i];
\t\t\t\tif (!sel) continue;
\t\t\t\tvar price = parseInt(op_data[i].price) || 0;
\t\t\t\t// 「ON」選択時のみ加算(OFF や「不要」「商品購入のみ」は加算しない)
\t\t\t\tvar isOn = (sel === op_data[i].on);
\t\t\t\titems.push({
\t\t\t\t\tname: op_data[i].name,
\t\t\t\t\tvalue: sel,
\t\t\t\t\tprice: isOn ? price : 0,
\t\t\t\t\ton: op_data[i].on,
\t\t\t\t\toff: op_data[i].off,
\t\t\t\t});
\t\t\t\tif (isOn) total += price;
\t\t\t}
\t\t\t// fe (sale_type=4) のブロック種類×段数 分を items / total に統合.
\t\t\t// 親オプション「ご希望のフェンス設置方法」 が 「新規にブロック積みを行う」 のとき
\t\t\t// だけ加算される (collectFeBlock 内で判定済み).
\t\t\tvar fb = collectFeBlock();
\t\t\tif (fb.active && fb.choice) {
\t\t\t\titems.push({
\t\t\t\t\tname: (oi_data.fe_block && oi_data.fe_block.title) || 'ブロックの種類と段数',
\t\t\t\t\tvalue: fb.choice.label,
\t\t\t\t\tprice: fb.price,
\t\t\t\t\ton: fb.choice.label,
\t\t\t\t\toff: '',
\t\t\t\t});
\t\t\t\ttotal += fb.price;
\t\t\t}
\t\t\treturn { total: total, items: items };
\t\t}
\t\t/**
\t\t * free_area 1 エントリ ({w,d,h,m,c,price,unit_price,maker_price,ct,option1,option2})
\t\t * から sale_type 別に最終金額を算出する.
\t\t *
\t\t * 計算式(amount=1 ベース、出口で × 1.10 税込化):
\t\t * 1 通常 : price + ct + option_sum
\t\t * 2 補助金窓 : price × set_count + (ct + (set_count-1) × option2) + option_sum
\t\t * 3 物置 : (price + ct) × daisu + option_sum
\t\t * 4 フェンス : price + (maisu-1) × unit_price
\t\t * + ct + max(0, maisu-3) × option1
\t\t * + option_sum (maisu >= 3)
\t\t * 5 デッキ : price + ct + option_sum (area は表示用、計算非関与)
\t\t * 6 芝生 : price × ceil(area / (w_m × h_m)) + ct + option_sum
\t\t * 9 商品のみ : price のみ(カート quantity 倍で総額)
\t\t *
\t\t * fe では option1 を ct_up、um では option2 を ct_up として転用.
\t\t * tf では w / h にロール幅・長さが格納されており parseLen で数値抽出.
\t\t *
\t\t * @param {Object} pp free_area の 1 行(matrix エントリ)
\t\t * @param {number} optionTotal collectOptions().total
\t\t * @param {Object} ctx UI 入力 {set_count, daisu, maisu, area, quantityOnly, ...}
\t\t * @returns {Object} {goukei, price, ct, opt, qty} すべて税込整数
\t\t */
\t\tfunction calcGoukei(pp, optionTotal, ctx) {
\t\t\tvar basePrice = parseInt(pp.price) || 0;
\t\t\tvar baseCt = parseInt(pp.ct) || 0;
\t\t\tvar unitPrice = parseInt(pp.unit_price) || 0;
\t\t\tvar optSum = optionTotal;
\t\t\tvar price = basePrice;
\t\t\tvar ct = baseCt;
\t\t\tvar steelRoof = 0; // cp 折半屋根(スチール折板 = option1, ex-shop同額)
\t\t\tvar qty = 1;
\t\t\tvar goukei = 0;
\t\t\t// 「商品購入のみ」選択時は工事費・オプションをゼロにする(任意 sale_type で適用)
\t\t\tvar ops = [op0,op1,op2,op3,op4,op5,op6,op7,op8,op9,op10];
\t\t\tvar purchaseOnly = ops.some(function(v){ return v === '商品購入のみ'; });
\t\t\tif (purchaseOnly) {
\t\t\t\tbaseCt = 0;
\t\t\t\tct = 0;
\t\t\t\toptSum = 0;
\t\t\t}
\t\t\tswitch (SALE_TYPE_ID) {
\t\t\t\tcase 2: { // 補助金・窓 (シンプル表引き方式 2026-05-)
\t\t\t\t\t// 2026-05 仕様簡素化: 枚数軸を廃止し、subtype に枚数を内包.
\t\t\t\t\t// pp.price / pp.ct は (W, H, ガラス, subtype) の単一価格.
\t\t\t\t\t// 複数枚をまとめて買う場合はカート quantity で表現.
\t\t\t\t\tqty = 1;
\t\t\t\t\tprice = basePrice;
\t\t\t\t\tct = baseCt;
\t\t\t\t\tgoukei = price + ct + optSum;
\t\t\t\t\tbreak;
\t\t\t\t}
\t\t\t\tcase 3: { // 物置・ゴミステーション
\t\t\t\t\tqty = Math.max(1, parseInt(ctx.daisu) || 1);
\t\t\t\t\tprice = basePrice * qty;
\t\t\t\t\tct = baseCt * qty;
\t\t\t\t\tgoukei = price + ct + optSum;
\t\t\t\t\tbreak;
\t\t\t\t}
\t\t\t\tcase 4: { // フェンス・組み立て式(maisu ≥ 3、base_amount = 3)
\t\t\t\t\t// scraper は amount=3 を base にしているので pp.price = price(3),
\t\t\t\t\t// pp.unit_price = price(4) - price(3).
\t\t\t\t\tqty = Math.max(3, parseInt(ctx.maisu) || 3);
\t\t\t\t\tprice = basePrice + (qty - 3) * unitPrice;
\t\t\t\t\t// option1 が ct_up (4枚目以降の増分). 未設定なら ct 固定動作
\t\t\t\t\tvar ctUp1 = parseInt(pp.option1) || 0;
\t\t\t\t\tct = baseCt + Math.max(0, qty - 3) * ctUp1;
\t\t\t\t\t// fe_block(ブロック積み段数): collectOptions が base(3枚分)を optSum に
\t\t\t\t\t// 算入済み. ブロック費も本体同様に枚数連動するため、4枚目以降は 1枚毎に
\t\t\t\t\t// choice.unit_price(= block(4)-block(3)) を加算する.
\t\t\t\t\t// (顧客指摘「何枚施工でも増える金額が同じ」の是正。unit_price 未設定の
\t\t\t\t\t// 旧データでは +0 で従来動作。)
\t\t\t\t\tif (!purchaseOnly) {
\t\t\t\t\t\tvar fbC = collectFeBlock();
\t\t\t\t\t\tif (fbC.active && fbC.choice) {
\t\t\t\t\t\t\toptSum += Math.max(0, qty - 3) * (parseInt(fbC.choice.unit_price) || 0);
\t\t\t\t\t\t}
\t\t\t\t\t}
\t\t\t\t\tgoukei = price + ct + optSum;
\t\t\t\t\tbreak;
\t\t\t\t}
\t\t\t\tcase 5: { // ウッドデッキ・タイルデッキ
\t\t\t\t\t// area は担当者向けの参考値として保持(計算には使わない)
\t\t\t\t\tqty = 1;
\t\t\t\t\tgoukei = basePrice + baseCt + optSum;
\t\t\t\t\tprice = basePrice;
\t\t\t\t\tct = baseCt;
\t\t\t\t\tbreak;
\t\t\t\t}
\t\t\t\tcase 6: { // 芝生・人工芝(ロール単位)
\t\t\t\t\t// pp.w \"1m\", pp.h \"10m\" から数値抽出
\t\t\t\t\tvar w_m = parseLen(pp.w);
\t\t\t\t\tvar h_m = parseLen(pp.h);
\t\t\t\t\tvar rollSize = w_m * h_m;
\t\t\t\t\tif (!rollSize || rollSize <= 0) rollSize = 1;
\t\t\t\t\t// 施工サイズ(面積)があれば必要枚数を自動算出。無ければ直接指定の枚数を使う。
\t\t\t\t\tvar area = parseFloat(ctx.area) || 0;
\t\t\t\t\tif (area > 0) {
\t\t\t\t\t\tqty = Math.max(1, Math.ceil(area / rollSize));
\t\t\t\t\t} else {
\t\t\t\t\t\tqty = Math.max(1, parseInt(ctx.tf_qty) || 1);
\t\t\t\t\t}
\t\t\t\t\tprice = basePrice * qty;
\t\t\t\t\tct = baseCt;
\t\t\t\t\tgoukei = price + ct + optSum;
\t\t\t\t\tbreak;
\t\t\t\t}
\t\t\t\tcase 7: { // 数量買い・基本工事費固定(gf ガーデンファニチャー / st 石材)
\t\t\t\t\tqty = Math.max(1, parseInt(ctx.suuryou) || 1);
\t\t\t\t\tprice = basePrice * qty;
\t\t\t\t\tct = baseCt; // ct は固定(数量に依らない)
\t\t\t\t\tgoukei = price + ct + optSum;
\t\t\t\t\tbreak;
\t\t\t\t}
\t\t\t\tcase 9: { // 商品のみ購入
\t\t\t\t\t// カート側で quantity × unit price するため goukei は単品価格
\t\t\t\t\tqty = parseInt(ctx.quantityOnly) || 1;
\t\t\t\t\tprice = basePrice;
\t\t\t\t\tct = 0;
\t\t\t\t\toptSum = 0;
\t\t\t\t\tgoukei = price;
\t\t\t\t\tbreak;
\t\t\t\t}
\t\t\t\tdefault: { // 1: 通常(カーポート等、matrix 選択のみ)
\t\t\t\t\tqty = 1;
\t\t\t\t\t// cp 折半屋根(スチール折板 = option1, ex-shop同額)を工事費として加算。
\t\t\t\t\t// 非折板/他カテゴリは option1='' or 非数値 → 0。
\t\t\t\t\tsteelRoof = purchaseOnly ? 0 : (parseInt(pp.option1) || 0);
\t\t\t\t\tgoukei = basePrice + baseCt + steelRoof + optSum;
\t\t\t\t\tbreak;
\t\t\t\t}
\t\t\t}
\t\t\t// 出口で税込化(pp.price/pp.ct/op_data.price はすべて税抜で保存されている前提)
\t\t\t// 税込は請求額(mitsumori_json)・見積書・PDF 用。税抜(*Exc)は詳細ページの表示専用。
\t\t\treturn {
\t\t\t\tgoukei: toIncTax(goukei),
\t\t\t\tprice: toIncTax(price),
\t\t\t\tct: toIncTax(ct),
\t\t\t\tsteelRoof: toIncTax(steelRoof),
\t\t\t\topt: toIncTax(optSum),
\t\t\t\tgoukeiExc: goukei,
\t\t\t\tpriceExc: price,
\t\t\t\tctExc: ct,
\t\t\t\tsteelRoofExc: steelRoof,
\t\t\t\toptExc: optSum,
\t\t\t\tqty: qty,
\t\t\t};
\t\t}
\t\t/**
\t\t * 寸法文字列から「メートル単位の数値」を抽出する.
\t\t *
\t\t * 単位は m / cm / mm を認識し、いずれも m 単位に正規化して返す.
\t\t * 単位が無い場合は m 単位とみなす(旧 tf データ \"1m\" \"10m\" との互換).
\t\t * 数値が見つからない場合は 0 を返す(呼び出し側で fallback).
\t\t *
\t\t * 例:
\t\t * \"1m\" → 1
\t\t * \"100cm\" → 1 (2026-06 以降の m → cm 正規化に対応)
\t\t * \"200cm\" → 2
\t\t * \"5.5m\" → 5.5
\t\t * \"1000mm\" → 1
\t\t * \"\" → 0
\t\t */
\t\tfunction parseLen(s) {
\t\t\tif (!s) return 0;
\t\t\tvar str = String(s);
\t\t\tvar m = str.match(/(\\d+(?:\\.\\d+)?)\\s*(mm|cm|m)?/i);
\t\t\tif (!m) return 0;
\t\t\tvar n = parseFloat(m[1]);
\t\t\tif (isNaN(n)) return 0;
\t\t\tvar unit = (m[2] || 'm').toLowerCase();
\t\t\tif (unit === 'cm') return n / 100;
\t\t\tif (unit === 'mm') return n / 1000;
\t\t\treturn n; // 'm' or no unit
\t\t}
\t\t// pp は autoSelectFirstColor 等からも参照するので global にする
\t\tvar pp = ";
// line 1818
echo (isset($context["pp"]) || array_key_exists("pp", $context) ? $context["pp"] : (function () { throw new RuntimeError('Variable "pp" does not exist.', 1818, $this->source); })());
echo ";
\t\t// sale_type=2 の幅 / 高さ ladder (Twig p_w / p_h を JS で参照するため).
\t\t// 入力 mm 値を pp の幅・高さバケット文字列にマッピングする際の元データ.
\t\t// p_w / p_h は連想配列で来ることがあるため Object.values で配列化する.
\t\tvar PP_W_LADDER = Object.values(";
// line 1823
echo json_encode(((array_key_exists("p_w", $context)) ? (_twig_default_filter((isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 1823, $this->source); })()), [])) : ([])));
echo " || {});
\t\tvar PP_H_LADDER = Object.values(";
// line 1824
echo json_encode(((array_key_exists("p_h", $context)) ? (_twig_default_filter((isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 1824, $this->source); })()), [])) : ([])));
echo " || {});
\t\t/* ============================================================
\t\t sale_type=2 (補助金窓) 専用: 複数タイプ集計 & 補助金計算
\t\t ============================================================
\t\t - 入力 UI: #window-types-container 配下の .window-type-block
\t\t - 補助金根拠: 先進的窓リノベ2026事業
\t\t https://window-renovation2026.env.go.jp/construction/inner-window.html
\t\t - 価格軸: (subtype, w, h, glass, color) で pp を lookup
\t\t - 1 商品 = 1 明細 にまとめ、内訳 JSON を別途保存予定 (cart 連携は後続タスク)
\t\t ============================================================ */
\t\t// 補助金マトリクス: [住宅区分][性能][サイズ区分] → 1 箇所あたり金額 (税抜・端数なし)
\t\tvar WINDOW_SUBSIDY_MATRIX = {
\t\t\tdetached: { // 戸建住宅・延床240㎡以下の非住宅
\t\t\t\tP: { G: 140000, L: 89000, M: 58000, S: 36000 },
\t\t\t\tS: { G: 76000, L: 52000, M: 34000, S: 22000 }
\t\t\t},
\t\t\tapartment: { // 低層・中高層集合住宅・240㎡超の非住宅
\t\t\t\tP: { G: 152000, L: 98000, M: 64000, S: 40000 },
\t\t\t\tS: { G: 83000, L: 57000, M: 37000, S: 24000 }
\t\t\t}
\t\t};
\t\t// 住宅区分: 画面 UI (input[name=\"window_housing_type\"]) から取得する.
\t\t// 既定値は PFC meta_key=\"住宅区分\" を fallback (未設定なら '戸建').
\t\tvar HOUSING_TYPE_DEFAULT = ";
// line 1850
echo json_encode(_twig_default_filter($this->extensions['Plugin\ProductField\Twig\Extension\EccubeExtension']->getProduct_field(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 1850, $this->source); })()), "id", [], "any", false, false, false, 1850), "住宅区分"), "戸建"));
echo ";
\t\tfunction getCurrentHousingKey() {
\t\t\tvar el = document.querySelector('input[name=\"window_housing_type\"]:checked');
\t\t\tvar v = el ? el.value : HOUSING_TYPE_DEFAULT;
\t\t\treturn (v === '集合住宅') ? 'apartment' : 'detached';
\t\t}
\t\t// 商品シリーズ自動判定 (Product.name から)
\t\t// 根拠カタログ: YKK AP「ウチリモ」XAAAA-H26-067-1 (2026.04), 同「LiteU」XAAAA-H16-088-2,
\t\t// 三協アルミ「プラメイクEII」0142_STJ1931L, LIXIL「インプラス」(既知)
\t\tvar PRODUCT_NAME_RAW = ";
// line 1860
echo json_encode(((twig_get_attribute($this->env, $this->source, ($context["Product"] ?? null), "name", [], "any", true, true, false, 1860)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["Product"] ?? null), "name", [], "any", false, false, false, 1860), "")) : ("")));
echo ";
\t\tfunction detectProductSeries(name) {
\t\t\tif (!name) return null;
\t\t\tif (/ウチリモ/.test(name)) return 'uchirimo';
\t\t\tif (/プラマード\\s*U/i.test(name)) return 'pramado_u';
\t\t\tif (/インプラス/.test(name)) return 'inplus';
\t\t\tif (/プラメイク\\s*EII|プラメイクEII/i.test(name)) return 'plamake_eii';
\t\t\tif (/LiteU/i.test(name)) return 'lite_u';
\t\t\treturn null;
\t\t}
\t\t// シリーズ上限グレード:
\t\t// 'P' = SS/P まで到達可能 (真空断熱ガラス採用シリーズ)
\t\t// 'S' = Low-E 複層止まり (真空断熱ガラスのラインなし)
\t\t// null = 単板のみ → 補助金対象外
\t\tvar SERIES_GRADE_CAP = {
\t\t\tuchirimo: 'P',
\t\t\tpramado_u: 'P',
\t\t\tinplus: 'S',
\t\t\tplamake_eii: 'S',
\t\t\tlite_u: null
\t\t};
\t\tvar DETECTED_SERIES = detectProductSeries(PRODUCT_NAME_RAW);
\t\tvar SERIES_GRADE_CAP_VAL = (DETECTED_SERIES !== null && Object.prototype.hasOwnProperty.call(SERIES_GRADE_CAP, DETECTED_SERIES))
\t\t\t? SERIES_GRADE_CAP[DETECTED_SERIES]
\t\t\t: undefined;
\t\t// 商品単位グレード上限 (PFC `meta_key=補助金グレード上限` で個別上書き)
\t\t// 値: 'P' / 'SS' / 'S' / '対象外' / '無' / 'NONE' / 空文字 (未指定)
\t\tvar PRODUCT_GRADE_CAP_RAW = ";
// line 1888
echo json_encode(_twig_default_filter($this->extensions['Plugin\ProductField\Twig\Extension\EccubeExtension']->getProduct_field(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 1888, $this->source); })()), "id", [], "any", false, false, false, 1888), "補助金グレード上限"), ""));
echo ";
\t\tfunction normalizeGradeCap(v) {
\t\t\tif (v === null || v === undefined || v === '') return undefined;
\t\t\tvar s = String(v).trim().toUpperCase();
\t\t\tif (s === 'NONE' || s === '対象外' || s === '無') return null;
\t\t\tif (s === 'P' || s === 'SS') return 'P';
\t\t\tif (s === 'S') return 'S';
\t\t\treturn undefined;
\t\t}
\t\tvar PRODUCT_GRADE_CAP = normalizeGradeCap(PRODUCT_GRADE_CAP_RAW);
\t\t// 窓種 (subtype = option1) ごとのグレード上限.
\t\t// 根拠: YKK AP「ウチリモ」業務用 (XAAAA-H26-067-1) の窓種別ラインナップで
\t\t// 真空ガラス (Glavenir) の設定有無を確認:
\t\t// 引違い窓 (2/3/4枚建) / 浴室仕様 引違い窓 / FIX窓 → P 到達可能
\t\t// 内開き窓 (居室/浴室) / 開き窓テラス / テラスドア類 → 真空ガラスなし → S 止まり
\t\tfunction detectSubtypeGradeCap(subtype) {
\t\t\tif (!subtype) return undefined;
\t\t\tvar s = String(subtype);
\t\t\tif (/内開|開き窓テラス|テラスドア|開き戸/.test(s)) return 'S';
\t\t\treturn undefined;
\t\t}
\t\t// クリップ: 強さは 'P' > 'S' > null (対象外). cap=null は強制対象外, cap=undefined は無効化なし.
\t\tfunction clipGradeBy(grade, cap) {
\t\t\tif (cap === undefined) return grade;
\t\t\tif (cap === null) return null;
\t\t\tif (grade === null) return null;
\t\t\tif (cap === 'S' && grade === 'P') return 'S';
\t\t\treturn grade;
\t\t}
\t\t// D-2/D-3: 一部の窓種は Low-E に「アルゴンガス入り」が必須で、ガス無は補助対象外.
\t\t// - 浴室仕様 (ウチリモ): Low-E は Ar入のみ S、Ar無は対象外
\t\t// - インプラス 開き窓 / テラスドア: Low-E複層 ガス有のみ S、ガス無は対象外
\t\t// ※ 引違い窓・FIX窓・(非浴室)内開き窓は従来どおり Ar 有無を問わない.
\t\t// server 側 WindowSubsidyCalculator の subtypeRequiresArgon / glassHasArgon /
\t\t// applyArgonRequirement と完全一致させること.
\t\tfunction subtypeRequiresArgon(series, subtype) {
\t\t\tvar s = String(subtype || '');
\t\t\tif (/浴室/.test(s)) return true;
\t\t\tif (series === 'inplus' && (/テラスドア/.test(s) || (/開き窓/.test(s) && !/内開き/.test(s)))) return true;
\t\t\treturn false;
\t\t}
\t\tfunction glassHasArgon(glassName) {
\t\t\treturn /アルゴンガス入り/.test(String(glassName || ''));
\t\t}
\t\tfunction applyArgonRequirement(grade, glassName, subtype) {
\t\t\tif (grade === null) return null;
\t\t\t// 真空(P)等 Low-E 以外はこの規則の対象外 (真空はガス不要).
\t\t\tif (!/Low-?E/i.test(String(glassName || ''))) return grade;
\t\t\tif (subtypeRequiresArgon(DETECTED_SERIES, subtype) && !glassHasArgon(glassName)) return null;
\t\t\treturn grade;
\t\t}
\t\tfunction finalizeGlassGrade(raw, subtype, glassName) {
\t\t\tvar g = clipGradeBy(raw, SERIES_GRADE_CAP_VAL);
\t\t\tg = clipGradeBy(g, detectSubtypeGradeCap(subtype));
\t\t\tg = clipGradeBy(g, PRODUCT_GRADE_CAP);
\t\t\tg = applyArgonRequirement(g, glassName, subtype);
\t\t\treturn g;
\t\t}
\t\t/**
\t\t * ガラスタイプ名から性能区分 'P' (SS, Uw≤1.1) / 'S' (Uw≤1.5) / null を判別.
\t\t * null = 補助対象外.
\t\t *
\t\t * 根拠: YKK AP「ウチリモ 内窓」業務用カタログ (XAAAA-H26-069-1) で
\t\t * P (SS) は真空断熱ガラスのみ、Low-E はアルゴン入りでも S 止まり、
\t\t * Low-E ガス無 + 型ガラス / フロストは 2026年4月で対象外、
\t\t * が確認できた。アルゴン入り Low-E を P 判定する旧ルールは誤りだった。
\t\t *
\t\t * シリーズによっては P がそもそも存在しない (LIXIL インプラスは S 一律)
\t\t * ため、最終的には PFC で商品単位の上限を上書きできる仕組みが必要。
\t\t */
\t\tfunction detectGlassPerformance(glassName) {
\t\t\tif (!glassName) return null;
\t\t\tvar n = String(glassName);
\t\t\t// 補助対象外: 単板 / 和紙調 / 防音 / 防犯 / 型ガラス・フロスト (Low-E ガス無の型は 2026/4 で対象外)
\t\t\tif (/単ガラス|単板|和紙調|防音|防犯|複層\\/型|型ガラス|フロスト/.test(n)) return null;
\t\t\t// P (SS): 真空断熱ガラスのみ
\t\t\tif (/真空断熱/.test(n)) return 'P';
\t\t\t// S: Low-E 系のみ (アルゴン入りでも S 止まり)
\t\t\tif (/Low-?E/i.test(n)) return 'S';
\t\t\t// 一般複層 / ブラインドイン複層 / 複層強化 など Low-E 無しの複層は補助対象外
\t\t\treturn null;
\t\t}
\t\t/**
\t\t * 幅 mm × 高さ mm からサイズ区分 'G' (≥4.0㎡) / 'L' (2.8-3.9) / 'M' (1.6-2.7) / 'S' (0.2-1.5) / null.
\t\t * null = 補助対象外 (0.2㎡ 未満).
\t\t */
\t\tfunction detectSizeClass(w_mm, h_mm) {
\t\t\tvar w = parseFloat(w_mm) || 0;
\t\t\tvar h = parseFloat(h_mm) || 0;
\t\t\tif (w <= 0 || h <= 0) return null;
\t\t\tvar area = (w * h) / 1000000.0;
\t\t\tif (area < 0.2) return null;
\t\t\tif (area < 1.6) return 'S';
\t\t\tif (area < 2.8) return 'M';
\t\t\tif (area < 4.0) return 'L';
\t\t\treturn 'G';
\t\t}
\t\tfunction lookupSubsidyAmount(performance, sizeClass) {
\t\t\tif (!performance || !sizeClass) return 0;
\t\t\tvar t = WINDOW_SUBSIDY_MATRIX[getCurrentHousingKey()];
\t\t\tif (!t || !t[performance]) return 0;
\t\t\treturn t[performance][sizeClass] || 0;
\t\t}
\t\t/**
\t\t * mm 入力値を ladder バケット文字列に変換する.
\t\t * bucketizeMm(1750, [\"100cm まで\",\"150cm まで\",\"200cm まで\",\"300cm まで\"]) → \"200cm まで\"
\t\t * - 入力が空 or 0 のときはそのまま返す (未入力扱い)
\t\t * - 入力がラダー最大を超えるときは最大バケットを返す (= 価格上限の保護)
\t\t * - 入力文字列が既にラダーラベルそのものなら無変換 (互換のため)
\t\t */
\t\tfunction bucketizeMm(input, ladder) {
\t\t\tif (!input && input !== 0) return '';
\t\t\tif (!ladder || ladder.length === 0) return input;
\t\t\tvar s = String(input).trim();
\t\t\tif (s === '') return '';
\t\t\tif (ladder.indexOf(s) >= 0) return s;
\t\t\tvar mm = parseMm(s);
\t\t\tif (mm <= 0) return s;
\t\t\tvar withMax = ladder.map(function(b) { return { label: b, max: parseMm(b) }; });
\t\t\twithMax.sort(function(a, b) { return a.max - b.max; });
\t\t\tfor (var i = 0; i < withMax.length; i++) {
\t\t\t\tif (mm <= withMax[i].max) return withMax[i].label;
\t\t\t}
\t\t\treturn withMax[withMax.length - 1].label;
\t\t}
\t\t/**
\t\t * pp 配列から該当 1 行を返す. 完全一致優先、見つからなければ最初の候補.
\t\t * 軸: subtype (option1) / w / h / m / c. axisMatch は既存ロジックと同じ.
\t\t * sale_type=2 では pw_val / ph_val に mm 数値が来るため、内部で bucketizeMm
\t\t * を通してから既存マッチングに渡す.
\t\t */
\t\tfunction lookupPpRow(subtype, pw_val, ph_val, pm_val, pc_val) {
\t\t\tif (!pp || pp.length === 0) return null;
\t\t\tvar pw_bucket = bucketizeMm(pw_val, PP_W_LADDER);
\t\t\tvar ph_bucket = bucketizeMm(ph_val, PP_H_LADDER);
\t\t\tvar axMatch = function(input, value) {
\t\t\t\treturn input == value || input === '指定なし' || value === '' || value == null;
\t\t\t};
\t\t\tvar colMatch = function(input, value) {
\t\t\t\tif (axMatch(input, value)) return true;
\t\t\t\tif (typeof value === 'string' && value.indexOf('/') !== -1 && input) {
\t\t\t\t\treturn value.split('/').some(function(s) { return s.trim() === input; });
\t\t\t\t}
\t\t\t\treturn false;
\t\t\t};
\t\t\tvar candidates = pp.filter(function(el) {
\t\t\t\treturn axMatch(pw_bucket, el.w)
\t\t\t\t\t&& axMatch(ph_bucket, el.h)
\t\t\t\t\t&& axMatch(pm_val, el.m)
\t\t\t\t\t&& axMatch(subtype, el.option1);
\t\t\t});
\t\t\tfor (var i = 0; i < candidates.length; i++) {
\t\t\t\tif (colMatch(pc_val, candidates[i].c)) return candidates[i];
\t\t\t}
\t\t\treturn candidates[0] || null;
\t\t}
\t\t/**
\t\t * \"1000mm\" / \"200cm\" / \"1.0m\" / 単位なし → mm に正規化して返す.
\t\t * UI 上の「200cm まで」等の文字列をそのまま渡せるようにする.
\t\t */
\t\tfunction parseMm(s) {
\t\t\tif (!s) return 0;
\t\t\tvar str = String(s);
\t\t\tvar m = str.match(/(\\d+(?:\\.\\d+)?)/);
\t\t\tif (!m) return 0;
\t\t\tvar num = parseFloat(m[1]);
\t\t\tif (/mm/i.test(str)) return num;
\t\t\tif (/cm/i.test(str)) return num * 10;
\t\t\tif (/(^|\\d)\\s*m(\$|\\W)/i.test(str)) return num * 1000;
\t\t\treturn num;
\t\t}
\t\t/**
\t\t * 1 タイプブロックから入力を読み、pp lookup → 単価・補助金額を計算して返す.
\t\t * incomplete=true: 軸のどれかが未選択 → 計算しない (UI で「未選択」を示すため).
\t\t */
\t\tfunction collectWindowTypeRow(block) {
\t\t\tvar get = function(axis) {
\t\t\t\t// radio / checkbox は :checked、それ以外 (number/text) は値そのまま.
\t\t\t\tvar radio = block.querySelector('input[data-axis=\"' + axis + '\"]:checked');
\t\t\t\tif (radio) return radio.value;
\t\t\t\tvar any = block.querySelector('input[data-axis=\"' + axis + '\"]');
\t\t\t\tif (!any) return '';
\t\t\t\tif (any.type === 'radio' || any.type === 'checkbox') return '';
\t\t\t\treturn (any.value || '').trim();
\t\t\t};
\t\t\tvar setqtyEl = block.querySelector('input[data-axis=\"setqty\"]');
\t\t\tvar subtype = get('subtype');
\t\t\tvar pw_val = get('pw');
\t\t\tvar ph_val = get('ph');
\t\t\tvar pm_val = get('pm');
\t\t\tvar pc_val = get('pc');
\t\t\tvar setqty = setqtyEl ? Math.max(1, parseInt(setqtyEl.value) || 1) : 1;
\t\t\tvar row = {
\t\t\t\tsubtype: subtype, pw: pw_val, ph: ph_val, pm: pm_val, pc: pc_val, setqty: setqty,
\t\t\t\tunit_price_exc: 0, unit_ct_exc: 0, subsidy: 0,
\t\t\t\tsize_class: null, glass_perf: null,
\t\t\t\tincomplete: false
\t\t\t};
\t\t\t// p_option1 / p_w / p_h / p_m / color のいずれかが商品データに無いときは未選択でも完了扱いにする.
\t\t\t// (例: 商品によっては subtype が無い場合がある)
\t\t\tvar hasSubtype = !!block.querySelector('input[data-axis=\"subtype\"]');
\t\t\tvar hasPw = !!block.querySelector('input[data-axis=\"pw\"]');
\t\t\tvar hasPh = !!block.querySelector('input[data-axis=\"ph\"]');
\t\t\tvar hasPm = !!block.querySelector('input[data-axis=\"pm\"]');
\t\t\tvar hasPc = !!block.querySelector('input[data-axis=\"pc\"]');
\t\t\tif ((hasSubtype && !subtype) || (hasPw && !pw_val) || (hasPh && !ph_val)
\t\t\t || (hasPm && !pm_val) || (hasPc && !pc_val)) {
\t\t\t\trow.incomplete = true;
\t\t\t\treturn row;
\t\t\t}
\t\t\tvar ppRow = lookupPpRow(subtype, pw_val, ph_val, pm_val, pc_val);
\t\t\tif (ppRow) {
\t\t\t\trow.unit_price_exc = parseInt(ppRow.price) || 0;
\t\t\t\trow.unit_ct_exc = parseInt(ppRow.ct) || 0;
\t\t\t}
\t\t\t// ガラス名検出 → シリーズ上限 → subtype 上限 → 商品上限 の順で min クリップ.
\t\t\t// 例: LiteU (SERIES_GRADE_CAP_VAL=null) は Low-E でも null に落ちて補助対象外.
\t\t\t// 例: ウチリモの「内開き窓」subtype は真空ガラスでも S に落ちる.
\t\t\trow.glass_perf = finalizeGlassGrade(detectGlassPerformance(pm_val), subtype, pm_val);
\t\t\trow.size_class = detectSizeClass(parseMm(pw_val), parseMm(ph_val));
\t\t\trow.subsidy = lookupSubsidyAmount(row.glass_perf, row.size_class);
\t\t\treturn row;
\t\t}
\t\t/**
\t\t * sale_type=2 用集計: 全タイプから合計を出し DOM 更新.
\t\t * 計算式 (税抜→税込で出口で 1.10 倍):
\t\t * 商品金額 = Σ(各タイプ単価 × set_qty)
\t\t * 基本工事費 = 1 回分 (各タイプ pp.ct のうち最初に得た非ゼロ値)
\t\t * 補助金合計 = Σ(各タイプ補助金 × set_qty)
\t\t * 実質支払額 = (商品+ct+option) 税込 - 補助金合計
\t\t */
\t\tfunction recalcAllForSaleType2() {
\t\t\tif (typeof SALE_TYPE_ID === 'undefined' || SALE_TYPE_ID != 2) return;
\t\t\tif (!pp || pp.length === 0) {
\t\t\t\t\$('#mitsumori_message').text('価格データ準備中');
\t\t\t\t\$('#mitsumori_btn').hide();
\t\t\t\t['#mitsumori_goukei','#mitsumori_off','#mitsumori_price','#maker_price',
\t\t\t\t '#mitsumori_ct','#mitsumori_option','#mitsumori_kei','#mitsumori_shoukei','#mitsumori_tax']
\t\t\t\t .forEach(function(s){ \$(s).text('---円'); });
\t\t\t\treturn;
\t\t\t}
\t\t\tvar blocks = document.querySelectorAll('#window-types-container .window-type-block');
\t\t\tif (blocks.length === 0) return;
\t\t\tvar rows = [];
\t\t\tvar hasIncomplete = false;
\t\t\tvar baseCt = 0;
\t\t\tvar hasAnyPriced = false;
\t\t\tblocks.forEach(function(b) {
\t\t\t\tvar r = collectWindowTypeRow(b);
\t\t\t\trows.push({ block: b, row: r });
\t\t\t\tif (r.incomplete) hasIncomplete = true;
\t\t\t\tif (r.unit_ct_exc > 0 && baseCt === 0) baseCt = r.unit_ct_exc;
\t\t\t\tif (r.unit_price_exc > 0) hasAnyPriced = true;
\t\t\t\tvar subSpan = b.querySelector('.wt-subsidy-amount');
\t\t\t\tif (subSpan) subSpan.textContent = r.incomplete ? '―' : Math.round(r.subsidy * r.setqty).toLocaleString();
\t\t\t});
\t\t\tif (hasIncomplete || !hasAnyPriced) {
\t\t\t\t\$('#mitsumori_message').text('窓タイプを選択してください');
\t\t\t\t\$('#mitsumori_btn').hide();
\t\t\t\treturn;
\t\t\t}
\t\t\tvar ops = [op0,op1,op2,op3,op4,op5,op6,op7,op8,op9,op10];
\t\t\tvar purchaseOnly = ops.some(function(v){ return v === '商品購入のみ'; });
\t\t\tvar sumPriceExc = 0, sumSubsidy = 0, totalPanes = 0;
\t\t\trows.forEach(function(item) {
\t\t\t\tvar r = item.row;
\t\t\t\tsumPriceExc += r.unit_price_exc * r.setqty;
\t\t\t\tsumSubsidy += r.subsidy * r.setqty;
\t\t\t\tif (r.unit_price_exc > 0) totalPanes += r.setqty;
\t\t\t});
\t\t\t// 内窓 工事費(顧客最終回答): 1枚目 22,000円 + 2枚目以降 1枚あたり +5,000円(税込表示額)。
\t\t\t// 既存パイプライン整合のため税抜(ctExc)も用意(税行 taxAmt 用)。商品購入のみは 0。
\t\t\tvar WINDOW_CT_BASE = 22000, WINDOW_CT_ADD = 5000;
\t\t\tvar ctIncTarget = purchaseOnly ? 0 : (WINDOW_CT_BASE + Math.max(0, totalPanes - 1) * WINDOW_CT_ADD);
\t\t\tvar ctExc = purchaseOnly ? 0 : Math.round(ctIncTarget / (1 + TAX_RATE));
\t\t\tvar optExc = purchaseOnly ? 0 : (collectOptions().total || 0);
\t\t\tvar sumPriceInc = Math.round(sumPriceExc * (1 + TAX_RATE));
\t\t\tvar ctInc = ctIncTarget;
\t\t\tvar optInc = Math.round(optExc * (1 + TAX_RATE));
\t\t\tvar goukeiInc = sumPriceInc + ctInc + optInc;
\t\t\t// 窓リノベ2026 申請条件:
\t\t\t// - 補助金合計 ≥ 50,000 円 (5 万円未満は申請不可 → 還元 0 円扱い)
\t\t\t// - 1 戸あたり上限 1,000,000 円 (住宅・非住宅240㎡以下)
\t\t\t// ※ 非住宅 240㎡超の 10,000,000 円上限は対象外 (商品設計時に別扱い想定)
\t\t\tvar SUBSIDY_MIN_AMOUNT = 50000;
\t\t\tvar SUBSIDY_MAX_PER_UNIT = 1000000;
\t\t\tvar subsidyRawSum = sumSubsidy;
\t\t\tvar subsidyEligible = subsidyRawSum >= SUBSIDY_MIN_AMOUNT;
\t\t\tvar subsidyAmt = 0;
\t\t\tvar subsidyNote = '';
\t\t\tif (subsidyEligible) {
\t\t\t\tif (subsidyRawSum > SUBSIDY_MAX_PER_UNIT) {
\t\t\t\t\tsubsidyAmt = SUBSIDY_MAX_PER_UNIT;
\t\t\t\t\tsubsidyNote = '※補助上限 ' + SUBSIDY_MAX_PER_UNIT.toLocaleString()
\t\t\t\t\t\t+ '円 超過分は控除対象外(補助金合計 ' + subsidyRawSum.toLocaleString() + '円)';
\t\t\t\t} else {
\t\t\t\t\tsubsidyAmt = subsidyRawSum;
\t\t\t\t\tsubsidyNote = '※補助金合計 ' + subsidyRawSum.toLocaleString()
\t\t\t\t\t\t+ '円(5万円以上)が適用されます';
\t\t\t\t}
\t\t\t} else if (subsidyRawSum > 0) {
\t\t\t\t// (b) per-window 補助金額は常時表示。合計5万円以上で適用される旨と
\t\t\t\t// あといくらで適用かを明示する(閾値 SUBSIDY_MIN_AMOUNT は据え置き)。
\t\t\t\tvar subsidyShort = SUBSIDY_MIN_AMOUNT - subsidyRawSum;
\t\t\t\tsubsidyNote = '※補助金は各窓の補助金額の合計が5万円以上で適用されます'
\t\t\t\t\t+ '(現在の合計 ' + subsidyRawSum.toLocaleString() + '円 / あと '
\t\t\t\t\t+ subsidyShort.toLocaleString() + '円で適用)';
\t\t\t} else if (SERIES_GRADE_CAP_VAL === null) {
\t\t\t\t// LiteU 等の単板構成シリーズ: グレード判定で必ず null になる
\t\t\t\tsubsidyNote = '※本商品は補助金(先進的窓リノベ2026事業)対象外です';
\t\t\t} else if (PRODUCT_GRADE_CAP === null) {
\t\t\t\tsubsidyNote = '※本商品は補助金対象外として登録されています';
\t\t\t}
\t\t\tvar implementedInc = Math.max(0, goukeiInc - subsidyAmt);
\t\t\tvar taxAmt = Math.round((sumPriceExc + ctExc + optExc) * TAX_RATE);
\t\t\t// 詳細ページの見積カード/ヘッダー/SPバーは税抜表示に統一.
\t\t\t// 見積書(#mitsumori_kei)・実質支払額(#mitsumori_shoukei)・税額・json は税込のまま (請求額不変).
\t\t\tvar goukeiExc = sumPriceExc + ctExc + optExc;
\t\t\t\$('#mitsumori_message').text(subsidyNote);
\t\t\t\$('#mitsumori_btn').show();
\t\t\t\$('#mitsumori_goukei').text(goukeiExc.toLocaleString() + '円');
\t\t\t\$('#mitsumori_price').text(sumPriceExc.toLocaleString() + '円');
\t\t\t\$('#mitsumori_ct').text(ctExc.toLocaleString() + '円');
\t\t\t\$('#mitsumori_option').text(optExc.toLocaleString() + '円');
\t\t\t\$('#mitsumori_off').text((subsidyAmt > 0 ? '-' : '') + subsidyAmt.toLocaleString() + '円');
\t\t\t\$('#maker_price').text('---円'); // 補助金窓では未使用
\t\t\t\$('#mitsumori_kei').text(goukeiInc.toLocaleString() + '円');
\t\t\t\$('#mitsumori_shoukei').text(implementedInc.toLocaleString() + '円');
\t\t\t\$('#mitsumori_tax').text(taxAmt.toLocaleString() + '円');
\t\t\t// 内訳を mitsumori_json に詰めて hidden input にセット (PDF / カート連携用)
\t\t\tvar window_types = rows.map(function(item) {
\t\t\t\tvar r = item.row;
\t\t\t\t// 幅 / 高さは数値入力 (mm) が来るので \"1750mm\" 形式で保存する.
\t\t\t\t// 古い radio 由来の \"200cm まで\" 形式が来た場合はそのまま保存して互換.
\t\t\t\tvar w_mm = parseMm(r.pw);
\t\t\t\tvar h_mm = parseMm(r.ph);
\t\t\t\tvar w_save = (w_mm > 0 && /^\\s*\\d+(?:\\.\\d+)?\\s*\$/.test(String(r.pw))) ? (w_mm + 'mm') : r.pw;
\t\t\t\tvar h_save = (h_mm > 0 && /^\\s*\\d+(?:\\.\\d+)?\\s*\$/.test(String(r.ph))) ? (h_mm + 'mm') : r.ph;
\t\t\t\treturn {
\t\t\t\t\tsubtype: r.subtype,
\t\t\t\t\tw: w_save,
\t\t\t\t\th: h_save,
\t\t\t\t\tglass: r.pm,
\t\t\t\t\tcolor: r.pc,
\t\t\t\t\tsetqty: r.setqty,
\t\t\t\t\tunit_price_inc: Math.round(r.unit_price_exc * (1 + TAX_RATE)),
\t\t\t\t\tline_total_inc: Math.round(r.unit_price_exc * r.setqty * (1 + TAX_RATE)),
\t\t\t\t\tsize_class: r.size_class,
\t\t\t\t\tglass_perf: r.glass_perf,
\t\t\t\t\tsubsidy_unit: r.subsidy,
\t\t\t\t\tsubsidy_total: r.subsidy * r.setqty
\t\t\t\t};
\t\t\t});
\t\t\tvar opCalc2 = collectOptions();
\t\t\tvar mitsumori_json = {
\t\t\t\t\"mitsumori_goukei\": goukeiInc.toLocaleString() + '円',
\t\t\t\t\"mitsumori_price\": sumPriceInc.toLocaleString() + '円',
\t\t\t\t\"mitsumori_ct\": ctInc.toLocaleString() + '円',
\t\t\t\t\"mitsumori_option\": optInc.toLocaleString() + '円',
\t\t\t\t\"mitsumori_off\": (subsidyAmt > 0 ? '-' : '') + subsidyAmt.toLocaleString() + '円',
\t\t\t\t\"maker_price\": '---円',
\t\t\t\t\"product_id\": ";
// line 2274
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 2274, $this->source); })()), "id", [], "any", false, false, false, 2274), "html", null, true);
echo ",
\t\t\t\t\"sale_type\": SALE_TYPE_ID,
\t\t\t\t\"housing_key\": getCurrentHousingKey(),
\t\t\t\t\"series_key\": DETECTED_SERIES,
\t\t\t\t\"series_grade_cap\": (SERIES_GRADE_CAP_VAL === undefined) ? null : SERIES_GRADE_CAP_VAL,
\t\t\t\t\"product_grade_cap\":(PRODUCT_GRADE_CAP === undefined) ? null : PRODUCT_GRADE_CAP,
\t\t\t\t\"window_types\": window_types,
\t\t\t\t\"subsidy_total\": subsidyAmt,
\t\t\t\t\"subsidy_raw\": subsidyRawSum,
\t\t\t\t\"subsidy_eligible\": subsidyEligible,
\t\t\t\t\"subsidy_note\": subsidyNote,
\t\t\t\t\"op_items\": opCalc2.items
\t\t\t};
\t\t\t\$('#mitsumori_json').val(JSON.stringify(mitsumori_json));
\t\t\trenderWindowTypesModalRows(window_types, subsidyAmt);
\t\t}
\t\t/**
\t\t * sale_type=2 用: 見積モーダル明細テーブルを window_types で動的展開.
\t\t * - 既存の商品名行 (1 行目) は hide() し、各タイプ行を上に挿入
\t\t * - 基本工事費行はそのまま (#mitsumori_ct_01 / _02 が更新されている)
\t\t * - 補助金 (割引額) 行を末尾に追加
\t\t * - 既存の renderOptionDetailRows と共存できるよう class で区別
\t\t */
\t\tfunction renderWindowTypesModalRows(window_types, subsidyAmt) {
\t\t\tvar \$tbody = \$('.modal-mitsumori table tbody');
\t\t\tif (!\$tbody.length) return;
\t\t\t// 既存の動的行を全削除 (opt-row は既存実装、wt-row / wt-subsidy-row は今回追加)
\t\t\t\$tbody.find('tr.wt-row, tr.wt-subsidy-row').remove();
\t\t\tvar \$itemRow = \$tbody.find('tr').first();
\t\t\tvar fmt = new Intl.NumberFormat('ja-JP');
\t\t\tif (!window_types || window_types.length === 0) {
\t\t\t\t// 集計対象なし → 商品名行を表示に戻す
\t\t\t\t\$itemRow.show();
\t\t\t\treturn;
\t\t\t}
\t\t\twindow_types.forEach(function(wt, i) {
\t\t\t\tvar label = '窓タイプ' + (i + 1) + ':'
\t\t\t\t\t+ (wt.subtype || '') + ' / '
\t\t\t\t\t+ (wt.w || '') + '×' + (wt.h || '') + ' / '
\t\t\t\t\t+ (wt.glass || '') + ' / '
\t\t\t\t\t+ (wt.color || '');
\t\t\t\tvar \$tr = \$('<tr class=\"wt-row\"></tr>')
\t\t\t\t\t.append('<td>' + label + '</td>')
\t\t\t\t\t.append('<td>' + wt.setqty + '</td>')
\t\t\t\t\t.append('<td>セット</td>')
\t\t\t\t\t.append('<td>' + fmt.format(wt.unit_price_inc) + '円</td>')
\t\t\t\t\t.append('<td>' + fmt.format(wt.line_total_inc) + '円</td>');
\t\t\t\t\$itemRow.before(\$tr);
\t\t\t});
\t\t\t// 元の商品名行は複数タイプに置換されたので非表示
\t\t\t\$itemRow.hide();
\t\t\t// 補助金(割引額)行を末尾に追加
\t\t\tif (subsidyAmt > 0) {
\t\t\t\tvar \$subRow = \$('<tr class=\"wt-subsidy-row\"></tr>')
\t\t\t\t\t.append('<td>補助金(割引額)</td>')
\t\t\t\t\t.append('<td>1</td>')
\t\t\t\t\t.append('<td>式</td>')
\t\t\t\t\t.append('<td>-' + fmt.format(subsidyAmt) + '円</td>')
\t\t\t\t\t.append('<td>-' + fmt.format(subsidyAmt) + '円</td>');
\t\t\t\t\$tbody.append(\$subRow);
\t\t\t}
\t\t}
\t\t// 公開: onWindowTypeAxisChange (UI 骨格 task 1) からも呼ばれる
\t\twindow.recalcAll = recalcAllForSaleType2;
\t\t// 公開: ガラス選択肢が補助金対象か (窓タイプブロック生成時のバッジ判定に使う).
\t\t// subtype は P→S に落とすことはあっても null にはしないため、性能区分の
\t\t// 対象/対象外は subtype に依存しない。ここでは series/product 上限のみ適用し、
\t\t// finalizeGlassGrade が null でなければ「補助金対象ガラス」と判定する。
\t\twindow.glassYieldsSubsidy = function(glassName) {
\t\t\tif (!glassName) return false;
\t\t\treturn finalizeGlassGrade(detectGlassPerformance(glassName), '', glassName) !== null;
\t\t};
\t\tfunction mitsumori_simulation(type , value_id){
\t\t\t// sale_type=2 (補助金窓) は複数タイプ集計 UI に統合済み. 既存 mitsumori_simulation は使わない.
\t\t\tif (typeof SALE_TYPE_ID !== 'undefined' && SALE_TYPE_ID == 2) {
\t\t\t\t// type/value_id が op\\d+ (施工オプション) の場合はグローバル変数を先に更新
\t\t\t\tif (type && /^op\\d+\$/.test(type) && value_id) {
\t\t\t\t\tvar v = \$('#'+value_id).val();
\t\t\t\t\tif (type === 'op0') op0 = v;
\t\t\t\t\tif (type === 'op1') op1 = v;
\t\t\t\t\tif (type === 'op2') op2 = v;
\t\t\t\t\tif (type === 'op3') op3 = v;
\t\t\t\t\tif (type === 'op4') op4 = v;
\t\t\t\t\tif (type === 'op5') op5 = v;
\t\t\t\t\tif (type === 'op6') op6 = v;
\t\t\t\t\tif (type === 'op7') op7 = v;
\t\t\t\t\tif (type === 'op8') op8 = v;
\t\t\t\t\tif (type === 'op9') op9 = v;
\t\t\t\t\tif (type === 'op10') op10 = v;
\t\t\t\t}
\t\t\t\trecalcAllForSaleType2();
\t\t\t\treturn;
\t\t\t}
\t\t\t// 価格データ未登録 (pp 行 0 件) の商品は axis 入力に依存せず
\t\t\t// 「価格データ準備中」を表示して終了する.
\t\t\t// (例: scrape 未対象の新規商品 — um のウチリモ 7487/7488 等)
\t\t\tif (!pp || pp.length === 0) {
\t\t\t\t\$('#mitsumori_message').text(\"価格データ準備中\");
\t\t\t\t\$('#mitsumori_btn').hide();
\t\t\t\t\$('#mitsumori_goukei').text(\"---円\");
\t\t\t\t\$('#mitsumori_off').text(\"---円\");
\t\t\t\t\$('#mitsumori_price').text(\"---円\");
\t\t\t\t\$('#maker_price').text(\"---円\");
\t\t\t\t\$('#mitsumori_ct').text(\"---円\");
\t\t\t\t\$('#mitsumori_steelroof_row').hide();
\t\t\t\t\$('#mitsumori_option').text(\"---円\");
\t\t\t\t\$('#mitsumori_kei').text(\"---円\");
\t\t\t\t\$('#mitsumori_shoukei').text(\"---円\");
\t\t\t\t\$('#mitsumori_tax').text(\"---円\");
\t\t\t\treturn;
\t\t\t}
\t\t\tif(type == \"pw\"){
\t\t\t\tpw = \$('#'+value_id).val();
\t\t\t}
\t\t\tif(type == \"pd\"){
\t\t\t\tpd = \$('#'+value_id).val();
\t\t\t}
\t\t\tif(type == \"ph\"){
\t\t\t\tph = \$('#'+value_id).val();
\t\t\t}
\t\t\tif(type == \"pm\"){
\t\t\t\tpm = \$('#'+value_id).val();
\t\t\t}
\t\t\tif(type == \"pc\"){
\t\t\t\tpc = \$('#'+value_id).val();
\t\t\t}
\t\t\tif(type == \"option1\"){
\t\t\t\toption1 = \$('#'+value_id).val();
\t\t\t}
\t\t\tif(type == \"option2\"){
\t\t\t\toption2 = \$('#'+value_id).val();
\t\t\t}
\t\t\tif(type == \"op0\"){ op0 = \$('#'+value_id).val(); }
\t\t\tif(type == \"op1\"){ op1 = \$('#'+value_id).val(); }
\t\t\tif(type == \"op2\"){ op2 = \$('#'+value_id).val(); }
\t\t\tif(type == \"op3\"){ op3 = \$('#'+value_id).val(); }
\t\t\tif(type == \"op4\"){ op4 = \$('#'+value_id).val(); }
\t\t\tif(type == \"op5\"){ op5 = \$('#'+value_id).val(); }
\t\t\tif(type == \"op6\"){ op6 = \$('#'+value_id).val(); }
\t\t\tif(type == \"op7\"){ op7 = \$('#'+value_id).val(); }
\t\t\tif(type == \"op8\"){ op8 = \$('#'+value_id).val(); }
\t\t\tif(type == \"op9\"){ op9 = \$('#'+value_id).val(); }
\t\t\tif(type == \"op10\"){ op10 = \$('#'+value_id).val(); }
\t\t\t// op0 が「商品購入のみ」のとき、他のオプション (op1..op10) を disable 化.
\t\t\t// 価格計算側 (calcGoukei の purchaseOnly 分岐) は既にゼロ化しているが、
\t\t\t// UI で選択可能に見えるとユーザーが混乱するため radio を完全に無効化する.
\t\t\t(function applyPurchaseOnlyUI() {
\t\t\t\tvar isPurchaseOnly = (op0 === '商品購入のみ');
\t\t\t\tfor (var k = 1; k <= 10; k++) {
\t\t\t\t\tvar \$inputs = \$('input[name=\"op' + k + '\"]');
\t\t\t\t\tif (\$inputs.length === 0) continue;
\t\t\t\t\t\$inputs.prop('disabled', isPurchaseOnly);
\t\t\t\t\tvar \$group = \$inputs.first().closest('.form-group');
\t\t\t\t\t\$group.css({
\t\t\t\t\t\t'opacity': isPurchaseOnly ? '0.4' : '1',
\t\t\t\t\t\t'pointer-events': isPurchaseOnly ? 'none' : 'auto'
\t\t\t\t\t});
\t\t\t\t}
\t\t\t})();
\t\t\t// 全 type 共通: 該当 radio を checked にし、ボタンの is-selected を付け替え + ラベル更新.
\t\t\t// value_id が指定されていて、対応する DOM 要素が opt-btn 配下にあれば適用する.
\t\t\t// (icheck-danger 形式から opt-btn 形式に統一した際、option1/option2/pw/pd/ph/pm/pc 等の
\t\t\t// クリックで is-selected が更新されない不具合があったため、op\\d+ 限定の処理を一般化)
\t\t\tif (value_id) {
\t\t\t\tvar \$clicked = \$('#' + value_id);
\t\t\t\tif (\$clicked.length && \$clicked.closest('.opt-btn').length) {
\t\t\t\t\t\$clicked.prop('checked', true);
\t\t\t\t\tvar groupName = \$clicked.attr('name');
\t\t\t\t\t\$('input[name=\"' + groupName + '\"]').closest('.opt-btn').removeClass('is-selected');
\t\t\t\t\t\$clicked.closest('.opt-btn').addClass('is-selected');
\t\t\t\t\tvar \$group = \$clicked.closest('.form-group');
\t\t\t\t\tvar \$label = \$group.find('.rp-section-label');
\t\t\t\t\tif (\$label.length) {
\t\t\t\t\t\tvar labelText = \$label.text().split(':')[0].trim();
\t\t\t\t\t\t\$label.html(labelText + ': <span>' + \$clicked.val() + '</span>');
\t\t\t\t\t}
\t\t\t\t\t// op_data の price=0 & 解体/撤去/設置場所 オプションの場合、ON 選択時に「現場調査後に正式お見積もり」文言を表示.
\t\t\t\t\t// (twig 側で is_removal_unknown ブロックを描画済み。display 切替のみ JS で行う)
\t\t\t\t\tif (/^op\\d+\$/.test(type)) {
\t\t\t\t\t\tvar opIdx = type.replace('op', '');
\t\t\t\t\t\tvar opEntry = op_data[parseInt(opIdx)];
\t\t\t\t\t\tif (opEntry) {
\t\t\t\t\t\t\tvar \$note = \$group.find('.opt-survey-note[data-op-idx=\"' + opIdx + '\"]');
\t\t\t\t\t\t\tif (\$note.length) {
\t\t\t\t\t\t\t\tvar isOn = (\$clicked.val() === opEntry.on);
\t\t\t\t\t\t\t\t\$note.toggle(isOn);
\t\t\t\t\t\t\t}
\t\t\t\t\t\t}
\t\t\t\t\t\t// wd (sale_type=5) のステップ / デッキフェンス用の注記もここで切替.
\t\t\t\t\t\t// ステップ → deck_step (op0 だが op_data 範囲外), 必要 選択時に表示.
\t\t\t\t\t\tvar radioName = \$clicked.attr('name');
\t\t\t\t\t\tif (radioName === 'deck_step') {
\t\t\t\t\t\t\t\$group.find('.opt-survey-note-wd-step').toggle(\$clicked.val() === '必要');
\t\t\t\t\t\t} else if (radioName === 'deck_fence') {
\t\t\t\t\t\t\t\$group.find('.opt-survey-note-wd-fence').toggle(\$clicked.val() === '必要');
\t\t\t\t\t\t}
\t\t\t\t\t}
\t\t\t\t}
\t\t\t}
\t\t\t// 必須項目チェックは sale_type 1 系(カーポート/物置/フェンスなど価格マトリクス必要)に限定
\t\t\tvar requireMatrix = (SALE_TYPE_ID == 1 || SALE_TYPE_ID == 2 || SALE_TYPE_ID == 3 || SALE_TYPE_ID == 4 || SALE_TYPE_ID == 5 || SALE_TYPE_ID == 6 || SALE_TYPE_ID == 7 || SALE_TYPE_ID == 9);
\t\t\t// sale_type=3 (物置・ゴミステーション・照明 等) では「素材」を選択肢として扱わない.
\t\t\t// - mo/gs/sy は m が \"指定なし\" など名目的にしか入っていない
\t\t\t// - sl は m が空のままで matrix に行が来る
\t\t\t// そのため pm の必須チェックを sale_type=3 でスキップする。
\t\t\tvar pmRequired = (SALE_TYPE_ID != 3);
\t\t\tif (requireMatrix) {
\t\t\t\tif(pmRequired && pm == \"\"){
\t\t\t\t\t\$('#mitsumori_message').text(\"素材を選択してください\");
\t\t\t\t}
\t\t\t\tif(ph == \"\"){
\t\t\t\t\t\$('#mitsumori_message').text(\"高さを選択してください\");
\t\t\t\t}
\t\t\t\tif(pd == \"\"){
\t\t\t\t\t\$('#mitsumori_message').text(\"奥行きを選択してください\");
\t\t\t\t}
\t\t\t\tif(pw == \"\"){
\t\t\t\t\t\$('#mitsumori_message').text(\"幅を選択してください\");
\t\t\t\t}
\t\t\t\tif(pc == \"\"){
\t\t\t\t\t\$('#mitsumori_message').text(\"カラーを選択してください\");
\t\t\t\t\t\$('#mitsumori_btn').hide();
\t\t\t\t\t\$('#mitsumori_goukei').text(\"---円\");
\t\t\t\t\t\$('#mitsumori_off').text(\"---円\");
\t\t\t\t\t\$('#mitsumori_price').text(\"---円\");
\t\t\t\t\t\$('#maker_price').text(\"---円\");
\t\t\t\t\t\$('#mitsumori_ct').text(\"---円\");
\t\t\t\t\$('#mitsumori_steelroof_row').hide();
\t\t\t\t\t\$('#mitsumori_option').text(\"---円\");
\t\t\t\t}
\t\t\t}
\t\t\tif(pw != \"\" && pd != \"\" && ph != \"\" && (!pmRequired || pm != \"\") && pc != \"\"){
\t\t\t\t\$('#mitsumori_btn').show();
\t\t\t\t// 入力コンテキスト(sale_type 別パラメータ)
\t\t\t\tvar ctx = {
\t\t\t\t\tset_count: parseInt(\$('#set_count').val()) || 1,
\t\t\t\t\tdaisu: parseInt(\$('#daisu').val()) || 1,
\t\t\t\t\tmaisu: parseInt(\$('#maisu').val()) || 3,
\t\t\t\t\tsuuryou: parseInt(\$('#suuryou').val()) || 1,
\t\t\t\t\tarea: (function(){
\t\t\t\t\t\t// tf(人工芝): 施工サイズ 縦(m)×横(m) から面積を算出し #area に反映.
\t\t\t\t\t\tvar L = parseFloat(\$('#tf_len').val()) || 0;
\t\t\t\t\t\tvar W = parseFloat(\$('#tf_wid').val()) || 0;
\t\t\t\t\t\tif (L > 0 && W > 0) { var a = L * W; \$('#area').val(a); return a; }
\t\t\t\t\t\treturn parseFloat(\$('#area').val()) || 0;
\t\t\t\t\t})(),
\t\t\t\t\ttf_len: parseFloat(\$('#tf_len').val()) || 0,
\t\t\t\t\ttf_wid: parseFloat(\$('#tf_wid').val()) || 0,
\t\t\t\t\ttf_qty: parseInt(\$('#tf_qty').val()) || 1,
\t\t\t\t\tquantityOnly: parseInt(\$('#quantity_only').val())|| 1,
\t\t\t\t\tmado_w: \$('#mado_w').val() || '',
\t\t\t\t\tmado_h: \$('#mado_h').val() || '',
\t\t\t\t\tmado_type: \$('input[name=mado_type]:checked').val() || '',
\t\t\t\t\tglass_type: \$('input[name=glass_type]:checked').val() || '',
\t\t\t\t\tdeck_step: \$('input[name=deck_step]:checked').val() || '',
\t\t\t\t\tdeck_fence: \$('input[name=deck_fence]:checked').val() || '',
\t\t\t\t};
\t\t\t\t// 施工オプション集計(残土処理を含む)
\t\t\t\tvar opCalc = collectOptions();
\t\t\t\tvar pp_matched = false;
\t\t\t\t// 各軸の汎用 axisMatch:
\t\t\t\t// user 選択 == matrix 値 / user \"指定なし\" / matrix 値が空
\t\t\t\tvar axisMatch = function(input, value){
\t\t\t\t return input == value || input == \"指定なし\" || value === \"\" || value == null;
\t\t\t\t};
\t\t\t\t// 色専用マッチャー: scraper のデータ形式に合わせて拡張する
\t\t\t\t// 1. 完全一致 / \"指定なし\" / 値が空 → 真 (axisMatch と同じ)
\t\t\t\t// 2. matrix 値が \"色1/色2/色3\" の形 (同価格グループ) → split して user 選択が含まれれば真
\t\t\t\t// scraper のロジック (scraper_price.py L765-779):
\t\t\t\t// 全色同価格 → c=\"\"、価格違いグループあり → 各 group を \"/\" 結合した色名で 1 行
\t\t\t\tvar colorMatch = function(input, value){
\t\t\t\t if (axisMatch(input, value)) return true;
\t\t\t\t if (typeof value === 'string' && value.indexOf('/') !== -1 && input) {
\t\t\t\t var parts = value.split('/');
\t\t\t\t for (var idx = 0; idx < parts.length; idx++) {
\t\t\t\t if (parts[idx].trim() === input) return true;
\t\t\t\t }
\t\t\t\t }
\t\t\t\t return false;
\t\t\t\t};
\t\t\t\t// 他軸 (w/d/h/m + option1/option2) でマッチする pp 行を抽出.
\t\t\t\t// option1/option2 は um の subtype 等で使われる. axisMatch は free_area 側が
\t\t\t\t// 空のとき真を返すので、um 以外のカテゴリ (option 軸を使わない) でも影響なし.
\t\t\t\tvar candidates = pp.filter(function(el){
\t\t\t\t return axisMatch(pw, el.w) && axisMatch(pd, el.d) && axisMatch(ph, el.h) && axisMatch(pm, el.m)
\t\t\t\t && axisMatch(option1, el.option1) && axisMatch(option2, el.option2);
\t\t\t\t});
\t\t\t\t// フォールバック: 全軸一致が 0 件のときに限り option1/option2 を無視して再マッチ。
\t\t\t\t// 玄関ドア等で option1(なし/ランマ付き)・option2(◯◯タイプ) が pm(開き方) から
\t\t\t\t// 導出可能な冗長軸で、未選択だと全軸 AND 一致を満たせず価格が出ない事象の救済。
\t\t\t\t// pm/幅/奥行/高さ は従来どおり一致を要求するため通常商品の価格選択に影響しない。
\t\t\t\tif (candidates.length === 0) {
\t\t\t\t candidates = pp.filter(function(el){
\t\t\t\t return axisMatch(pw, el.w) && axisMatch(pd, el.d) && axisMatch(ph, el.h) && axisMatch(pm, el.m);
\t\t\t\t });
\t\t\t\t}
\t\t\t\tvar picked = null;
\t\t\t\t// 優先 1: 色も含めて完全一致 (\"色1/色2\" 形式の split match を含む)
\t\t\t\tfor (var ii = 0; ii < candidates.length; ii++) {
\t\t\t\t if (colorMatch(pc, candidates[ii].c)) { picked = candidates[ii]; break; }
\t\t\t\t}
\t\t\t\t// 優先 2: 完全一致なし & user の pc が候補のどの c 値にも該当しない (= 命名違い等)
\t\t\t\t// かつ候補全行で price が一致する場合は、色軸を実質無視して先頭行を採用.
\t\t\t\t// 例 id=3353: pp.c は \"ステンカラー+...\" 6種だが price は全て同じなので
\t\t\t\t// SM(スミ) を選んでも安全に最初の行の価格を返せる.
\t\t\t\tif (!picked && candidates.length > 0) {
\t\t\t\t var ppCsInCand = candidates.map(function(r){ return r.c || ''; });
\t\t\t\t var pcAbsent = (pc !== '' && pc !== '指定なし' && ppCsInCand.indexOf(pc) === -1
\t\t\t\t && ppCsInCand.every(function(v){ return v.indexOf('/') === -1 || v.split('/').map(function(s){return s.trim();}).indexOf(pc) === -1; }));
\t\t\t\t if (pcAbsent) {
\t\t\t\t var uniqPrices = new Set();
\t\t\t\t candidates.forEach(function(r){ uniqPrices.add(String(r.price)); });
\t\t\t\t if (uniqPrices.size === 1) {
\t\t\t\t // 全候補同価格 → 色軸を wildcard 扱いで OK
\t\t\t\t picked = candidates[0];
\t\t\t\t }
\t\t\t\t // 価格が異なる場合は意図的に picked=null のまま「対応しておりません」.
\t\t\t\t }
\t\t\t\t}
\t\t\t\t// 請求額・見積書・PDF 用の税込値 (表示は税抜だが json は税込で不変).
\t\t\t\t// 未マッチ時は '---円' のまま送る.
\t\t\t\tvar jGoukei = '---円', jGoukei02 = '---円', jPrice = '---円',
\t\t\t\t jMaker = '---円', jOff = '---円', jCt = '---円', jOption = '---円';
\t\t\t\tpp.forEach((el) => {
\t\t\t\t if (el === picked) {
\t\t\t\t\tpp_matched = true;
\t\t\t\t\t// tg block-keyed オプション差額を集計 (tg 以外は total=0)
\t\t\t\t\tvar oiCalc = collectOptionItems(el.w || '', el.d || '');
\t\t\t\t\t// tg ブロックに合わせてラジオを再描画 (tg 以外は no-op)
\t\t\t\t\trenderOptionItemRadios(el.w || '', el.d || '');
\t\t\t\t\t// fe ブロックの種類×段数 サブ radio (fe 以外/未設定は no-op)
\t\t\t\t\trenderFeBlockRadios();
\t\t\t\t\t// fe ご希望のフェンス設置方法 — 「既存ブロックに穴空け」 entry の連動表示
\t\t\t\t\tupdateFeOpConditionalVisibility();
\t\t\t\t\tvar calc = calcGoukei(el, opCalc.total, ctx);
\t\t\t\t\tvar goukei = calc.goukei; // 税込 (請求額・見積書・PDF 用)
\t\t\t\t\tvar price = calc.price; // 税込
\t\t\t\t\tvar ct = calc.ct; // 税込
\t\t\t\t\tvar optionSum = calc.opt; // 税込
\t\t\t\t\tvar goukeiExc = calc.goukeiExc; // 税抜 (詳細ページ表示専用)
\t\t\t\t\tvar priceExc = calc.priceExc; // 税抜
\t\t\t\t\tvar ctExc = calc.ctExc; // 税抜
\t\t\t\t\tvar optionExc = calc.optExc; // 税抜
\t\t\t\t\t// tf(人工芝): 必要枚数入力へ算出結果を反映(施工サイズ入力時は上書き、
\t\t\t\t\t// 直接指定時は同値なので実質変化なし。要素が無い sale_type では no-op)
\t\t\t\t\tvar \$tfQty = \$('#tf_qty');
\t\t\t\t\tif (\$tfQty.length) \$tfQty.val(calc.qty || 1);
\t\t\t\t\t// オプション差額は税抜 → 税込に変換して合計に加算
\t\t\t\t\tvar oiIncTax = toIncTax(oiCalc.total);
\t\t\t\t\tgoukei += oiIncTax;
\t\t\t\t\tprice += oiIncTax; // 差額は本体価格扱いとして mitsumori_price にも加算
\t\t\t\t\tgoukeiExc += oiCalc.total; // 税抜側にも同じ差額を加算
\t\t\t\t\tpriceExc += oiCalc.total;
\t\t\t\t\t// maker_price も scraper が税抜で保存しているため税込に変換
\t\t\t\tvar makerPrice = toIncTax(parseInt(el.maker_price) || 0); // 税込
\t\t\t\t\tvar makerPriceExc = parseInt(el.maker_price) || 0; // 税抜
\t\t\t\t\t// 表示 (詳細ページの見積カード/ヘッダー/SPバー) は税抜に統一.
\t\t\t\t\t\$('#mitsumori_message').text(formatter.format(goukeiExc) + \"円\");
\t\t\t\t\t\$('#mitsumori_goukei').text(formatter.format(goukeiExc) + \"円\");
\t\t\t\t\t\$('#mitsumori_off').text(formatter.format(priceExc - makerPriceExc) + \"円\");
\t\t\t\t\t\$('#mitsumori_price').text(formatter.format(priceExc) + \"円\");
\t\t\t\t\t\$('#maker_price').text(formatter.format(makerPriceExc) + \"円\");
\t\t\t\t\t\$('#mitsumori_ct').text(formatter.format(ctExc) + \"円\");
\t\t\t\t\t\$('#mitsumori_option').text(formatter.format(optionExc) + \"円\");
\t\t\t\t\t// スチール折板(折半屋根 = option1): cp 折板のみ非ゼロ。工事費内に別行表示。
\t\t\t\t\tvar steelRoofExc = calc.steelRoofExc || 0;
\t\t\t\t\tif (steelRoofExc > 0) { \$('#mitsumori_steelroof_row').show(); \$('#mitsumori_steelroof').text(formatter.format(steelRoofExc) + \"円\"); }
\t\t\t\t\telse { \$('#mitsumori_steelroof_row').hide(); }
\t\t\t\t\t// 見積書モーダルは正式帳票のため税込のまま (請求額と一致).
\t\t\t\t\t\$('#mitsumori_kei').text(formatter.format(goukei) + \"円\");
\t\t\t\t\t\$('#mitsumori_price_01').text(formatter.format(price) + \"円\");
\t\t\t\t\t\$('#mitsumori_price_02').text(formatter.format(price) + \"円\");
\t\t\t\t\t\$('#mitsumori_ct_01').text(formatter.format(ct) + \"円\");
\t\t\t\t\t\$('#mitsumori_ct_02').text(formatter.format(ct) + \"円\");
\t\t\t\t\t\$('#mitsumori_goukei_02').text(formatter.format(goukei) + \"円\");
\t\t\t\t\tvar shoukei = goukei / 1.1;
\t\t\t\t\tvar tax = parseInt(goukei - shoukei);
\t\t\t\t\t\$('#mitsumori_shoukei').text(formatter.format(parseInt(shoukei)) + \"円\");
\t\t\t\t\t\$('#mitsumori_tax').text(formatter.format(tax) + \"円\");
\t\t\t\t\t// 請求額・PDF 用 json は税込を保持 (表示 DOM が税抜でも請求額は不変).
\t\t\t\t\tjGoukei = formatter.format(goukei) + \"円\";
\t\t\t\t\tjGoukei02 = formatter.format(goukei) + \"円\";
\t\t\t\t\tjPrice = formatter.format(price) + \"円\";
\t\t\t\t\tjMaker = formatter.format(makerPrice) + \"円\";
\t\t\t\t\tjOff = formatter.format(price - makerPrice) + \"円\";
\t\t\t\t\tjCt = formatter.format(ct) + \"円\";
\t\t\t\t\tjOption = formatter.format(optionSum) + \"円\";
\t\t\t\t\t// PDF 明細用:オプション内訳テーブルを差し込む (施工オプション + tg block オプション)
\t\t\t\t\trenderOptionDetailRows(opCalc.items.concat(oiCalc.items.map(function(it){
\t\t\t\t\t\treturn { name: it.name, value: it.label, price: it.diff };
\t\t\t\t\t})));
\t\t\t\t }
\t\t\t\t});
\t\t\t\tif (!pp_matched) {
\t\t\t\t\t\$('#mitsumori_message').text(\"この組み合わせは対応しておりません\");
\t\t\t\t\t\$('#mitsumori_btn').hide();
\t\t\t\t\t\$('#mitsumori_goukei').text(\"---円\");
\t\t\t\t\t\$('#mitsumori_off').text(\"---円\");
\t\t\t\t\t\$('#mitsumori_price').text(\"---円\");
\t\t\t\t\t\$('#maker_price').text(\"---円\");
\t\t\t\t\t\$('#mitsumori_ct').text(\"---円\");
\t\t\t\t\$('#mitsumori_steelroof_row').hide();
\t\t\t\t\t\$('#mitsumori_option').text(\"---円\");
\t\t\t\t\t\$('#mitsumori_kei').text(\"---円\");
\t\t\t\t\t\$('#mitsumori_shoukei').text(\"---円\");
\t\t\t\t\t\$('#mitsumori_tax').text(\"---円\");
\t\t\t\t}
\t\t\t\t// mitsumori_json: バック側に送信する見積データ
\t\t\t\tvar mitsumori_json = { \"mitsumori_goukei\": jGoukei,
\t\t\t\t\t\t\t\t\t\t\"mitsumori_goukei_02\": jGoukei02,
\t\t\t\t\t\t\t\t\t\t\"mitsumori_price\": jPrice,
\t\t\t\t\t\t\t\t\t\t\"maker_price\": jMaker,
\t\t\t\t\t\t\t\t\t\t\"mitsumori_off\": jOff,
\t\t\t\t\t\t\t\t\t\t\"mitsumori_ct\": jCt,
\t\t\t\t\t\t\t\t\t\t\"mitsumori_option\": jOption,
\t\t\t\t\t\t\t\t\t\t\"product_id\": ";
// line 2720
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 2720, $this->source); })()), "id", [], "any", false, false, false, 2720), "html", null, true);
echo ",
\t\t\t\t\t\t\t\t\t\t\"sale_type\": SALE_TYPE_ID,
\t\t\t\t\t\t\t\t\t\t\"pw\": pw,
\t\t\t\t\t\t\t\t\t\t\"pd\": pd,
\t\t\t\t\t\t\t\t\t\t\"ph\": ph,
\t\t\t\t\t\t\t\t\t\t\"pm\": pm,
\t\t\t\t\t\t\t\t\t\t\"pc\": pc,
\t\t\t\t\t\t\t\t\t\t\"op\": [op0,op1,op2,op3,op4,op5,op6,op7,op8,op9,op10],
\t\t\t\t\t\t\t\t\t\t\"op_items\": opCalc.items,
\t\t\t\t\t\t\t\t\t\t\"mado_w\": ctx.mado_w,
\t\t\t\t\t\t\t\t\t\t\"mado_h\": ctx.mado_h,
\t\t\t\t\t\t\t\t\t\t\"mado_type\": ctx.mado_type,
\t\t\t\t\t\t\t\t\t\t\"glass_type\": ctx.glass_type,
\t\t\t\t\t\t\t\t\t\t\"set_count\": ctx.set_count,
\t\t\t\t\t\t\t\t\t\t\"daisu\": ctx.daisu,
\t\t\t\t\t\t\t\t\t\t\"maisu\": ctx.maisu,
\t\t\t\t\t\t\t\t\t\t\"suuryou\": ctx.suuryou,
\t\t\t\t\t\t\t\t\t\t\"area\": ctx.area,
\t\t\t\t\t\t\t\t\t\t\"tf_len\": ctx.tf_len,
\t\t\t\t\t\t\t\t\t\t\"tf_wid\": ctx.tf_wid,
\t\t\t\t\t\t\t\t\t\t\"tf_qty\": \$('#tf_qty').val(),
\t\t\t\t\t\t\t\t\t\t\"deck_step\": ctx.deck_step,
\t\t\t\t\t\t\t\t\t\t\"deck_fence\": ctx.deck_fence };
\t\t\t\t\$('#mitsumori_json').val(JSON.stringify(mitsumori_json));
\t\t\t}
\t\t}
\t\t// PDF/モーダル明細の動的差し替え(基本工事費の次にオプション行を追加)
\t\tfunction renderOptionDetailRows(items) {
\t\t\tvar \$tbody = \$('.modal-mitsumori table tbody');
\t\t\tif (!\$tbody.length) return;
\t\t\t\$tbody.find('tr.opt-row').remove();
\t\t\tvar anchorRow = \$tbody.find('tr').filter(function(){
\t\t\t\treturn \$(this).find('td:first').text().indexOf('残土') !== -1
\t\t\t\t\t|| \$(this).find('td:first').text().indexOf('基本工事費') !== -1;
\t\t\t}).last();
\t\t\titems.forEach(function(it){
\t\t\t\tif (!it.name || !it.value) return;
\t\t\t\tvar priceTxt = it.price > 0
\t\t\t\t\t? formatter.format(it.price) + '円'
\t\t\t\t\t: '0円';
\t\t\t\tvar \$tr = \$('<tr class=\"opt-row\"></tr>')
\t\t\t\t\t.append('<td>' + it.name + ':' + it.value + '</td>')
\t\t\t\t\t.append('<td>1</td>')
\t\t\t\t\t.append('<td>式</td>')
\t\t\t\t\t.append('<td>' + priceTxt + '</td>')
\t\t\t\t\t.append('<td>' + (it.price > 0 ? formatter.format(it.price) + '円' : '') + '</td>');
\t\t\t\tif (anchorRow.length) {
\t\t\t\t\tanchorRow.after(\$tr);
\t\t\t\t\tanchorRow = \$tr;
\t\t\t\t} else {
\t\t\t\t\t\$tbody.append(\$tr);
\t\t\t\t}
\t\t\t});
\t\t}
\t\t// 見積書モーダルを開く直前に、右側「現在のお見積り額」パネルの表示値を
\t\t// モーダル内の対応 ID にコピーして金額の食い違いを防ぐ。
\t\t// pw/pd/ph/pm が未選択で mitsumori_simulation の full update に到達しない場合でも、
\t\t// パネル側の値(HTML 静的初期値 or 直近の simulation 結果)が modal にも反映される。
\t\tfunction syncMitsumoriModalFromPanel() {
\t\t\t// 見積カード表示は税抜だが、見積書モーダルは正式帳票として税込で出す.
\t\t\t// 請求と一致する税込値は hidden #mitsumori_json (税込のまま構築) から取得する.
\t\t\tvar mj = {};
\t\t\ttry { mj = JSON.parse(\$('#mitsumori_json').val() || '{}') || {}; } catch (e) { mj = {}; }
\t\t\tvar goukeiText = mj.mitsumori_goukei || '---円';
\t\t\tvar priceText = mj.mitsumori_price || '---円';
\t\t\tvar ctText = mj.mitsumori_ct || '---円';
\t\t\t\$('#mitsumori_kei').text(goukeiText);
\t\t\t\$('#mitsumori_price_01').text(priceText);
\t\t\t\$('#mitsumori_price_02').text(priceText);
\t\t\t\$('#mitsumori_ct_01').text(ctText);
\t\t\t\$('#mitsumori_ct_02').text(ctText);
\t\t\t\$('#mitsumori_goukei_02').text(goukeiText);
\t\t\t// 小計 / 消費税 は税込 goukei から逆算
\t\t\tvar num = parseInt(String(goukeiText).replace(/[^\\d-]/g, ''), 10);
\t\t\tif (!isNaN(num) && num > 0) {
\t\t\t\tvar shoukei = Math.round(num / 1.1);
\t\t\t\tvar tax = num - shoukei;
\t\t\t\t\$('#mitsumori_shoukei').text(formatter.format(shoukei) + '円');
\t\t\t\t\$('#mitsumori_tax').text(formatter.format(tax) + '円');
\t\t\t} else {
\t\t\t\t\$('#mitsumori_shoukei').text('---円');
\t\t\t\t\$('#mitsumori_tax').text('---円');
\t\t\t}
\t\t}
\t\t\$(document).on('show.bs.modal', '#modal-mitsumori', function () {
\t\t\t// 発行日を表示時点の当日日付に設定(固定ダミー日付の残置防止)
\t\t\tvar _now = new Date();
\t\t\tvar _issue = _now.getFullYear() + '/' +
\t\t\t\t('0' + (_now.getMonth() + 1)).slice(-2) + '/' +
\t\t\t\t('0' + _now.getDate()).slice(-2);
\t\t\t\$('#mitsumori_issue_date').text(_issue);
\t\t\tsyncMitsumoriModalFromPanel();
\t\t});
";
// line 2824
echo " ";
if (((isset($context["p_c"]) || array_key_exists("p_c", $context) ? $context["p_c"] : (function () { throw new RuntimeError('Variable "p_c" does not exist.', 2824, $this->source); })()) && ((twig_length_filter($this->env, (isset($context["p_c"]) || array_key_exists("p_c", $context) ? $context["p_c"] : (function () { throw new RuntimeError('Variable "p_c" does not exist.', 2824, $this->source); })())) == 1) || (twig_join_filter((isset($context["p_c"]) || array_key_exists("p_c", $context) ? $context["p_c"] : (function () { throw new RuntimeError('Variable "p_c" does not exist.', 2824, $this->source); })())) == "")))) {
// line 2825
echo " pc = \"指定なし\";
";
// line 2826
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["p_c"]) || array_key_exists("p_c", $context) ? $context["p_c"] : (function () { throw new RuntimeError('Variable "p_c" does not exist.', 2826, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["pc_val"]) {
if ($context["pc_val"]) {
echo " pc = \"";
echo twig_escape_filter($this->env, $context["pc_val"], "html", null, true);
echo "\"; ";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['pc_val'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 2827
echo " ";
if (((isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 2827, $this->source); })()) && (twig_length_filter($this->env, (isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 2827, $this->source); })())) == 1))) {
// line 2828
echo " ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 2828, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["cc"]) {
if (($context["cc"] && twig_get_attribute($this->env, $this->source, $context["cc"], "name", [], "array", false, false, false, 2828))) {
echo " pc = \"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["cc"], "name", [], "array", false, false, false, 2828), "html", null, true);
echo "\"; ";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['cc'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 2829
echo " ";
}
// line 2830
echo " ";
} elseif (((isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 2830, $this->source); })()) && (twig_length_filter($this->env, (isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 2830, $this->source); })())) == 1))) {
// line 2831
echo " pc = \"指定なし\";
\t\t\t";
// line 2832
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 2832, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["cc"]) {
if (($context["cc"] && twig_get_attribute($this->env, $this->source, $context["cc"], "name", [], "array", false, false, false, 2832))) {
echo " pc = \"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["cc"], "name", [], "array", false, false, false, 2832), "html", null, true);
echo "\"; ";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['cc'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 2833
echo "\t\t";
}
// line 2834
echo "
";
// line 2835
if (((isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 2835, $this->source); })()) && ((twig_length_filter($this->env, (isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 2835, $this->source); })())) == 1) || (twig_join_filter((isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 2835, $this->source); })())) == "")))) {
// line 2836
echo " pw = \"指定なし\";
\t\t\t";
// line 2837
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 2837, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["pw"]) {
if ($context["pw"]) {
echo " pw = \"";
echo twig_escape_filter($this->env, $context["pw"], "html", null, true);
echo "\"; ";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['pw'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 2838
echo "\t\t";
}
// line 2839
echo "
";
// line 2840
if (((isset($context["p_d"]) || array_key_exists("p_d", $context) ? $context["p_d"] : (function () { throw new RuntimeError('Variable "p_d" does not exist.', 2840, $this->source); })()) && ((twig_length_filter($this->env, (isset($context["p_d"]) || array_key_exists("p_d", $context) ? $context["p_d"] : (function () { throw new RuntimeError('Variable "p_d" does not exist.', 2840, $this->source); })())) == 1) || (twig_join_filter((isset($context["p_d"]) || array_key_exists("p_d", $context) ? $context["p_d"] : (function () { throw new RuntimeError('Variable "p_d" does not exist.', 2840, $this->source); })())) == "")))) {
// line 2841
echo " pd = \"指定なし\";
\t\t\t";
// line 2842
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["p_d"]) || array_key_exists("p_d", $context) ? $context["p_d"] : (function () { throw new RuntimeError('Variable "p_d" does not exist.', 2842, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["pd"]) {
if ($context["pd"]) {
echo " pd = \"";
echo twig_escape_filter($this->env, $context["pd"], "html", null, true);
echo "\"; ";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['pd'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 2843
echo "\t\t";
}
// line 2844
echo "
";
// line 2845
if (((isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 2845, $this->source); })()) && ((twig_length_filter($this->env, (isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 2845, $this->source); })())) == 1) || (twig_join_filter((isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 2845, $this->source); })())) == "")))) {
// line 2846
echo " ph = \"指定なし\";
\t\t\t";
// line 2847
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 2847, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["ph"]) {
if ($context["ph"]) {
echo " ph = \"";
echo twig_escape_filter($this->env, $context["ph"], "html", null, true);
echo "\"; ";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['ph'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 2848
echo "\t\t";
}
// line 2849
echo "
";
// line 2850
if (((isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 2850, $this->source); })()) && ((twig_length_filter($this->env, (isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 2850, $this->source); })())) == 1) || (twig_join_filter((isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 2850, $this->source); })())) == "")))) {
// line 2851
echo " pm = \"指定なし\";
\t\t\t";
// line 2852
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 2852, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["pm"]) {
if ($context["pm"]) {
echo " pm = \"";
echo twig_escape_filter($this->env, $context["pm"], "html", null, true);
echo "\"; ";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['pm'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 2853
echo "\t\t";
}
// line 2854
echo "
";
// line 2856
echo " ";
if (((isset($context["p_option1"]) || array_key_exists("p_option1", $context) ? $context["p_option1"] : (function () { throw new RuntimeError('Variable "p_option1" does not exist.', 2856, $this->source); })()) && ((twig_length_filter($this->env, (isset($context["p_option1"]) || array_key_exists("p_option1", $context) ? $context["p_option1"] : (function () { throw new RuntimeError('Variable "p_option1" does not exist.', 2856, $this->source); })())) == 1) || (twig_join_filter((isset($context["p_option1"]) || array_key_exists("p_option1", $context) ? $context["p_option1"] : (function () { throw new RuntimeError('Variable "p_option1" does not exist.', 2856, $this->source); })())) == "")))) {
// line 2857
echo " option1 = \"\";
\t\t\t";
// line 2858
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["p_option1"]) || array_key_exists("p_option1", $context) ? $context["p_option1"] : (function () { throw new RuntimeError('Variable "p_option1" does not exist.', 2858, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["opt1"]) {
if ($context["opt1"]) {
echo " option1 = \"";
echo twig_escape_filter($this->env, twig_escape_filter($this->env, $context["opt1"], "js"), "html", null, true);
echo "\"; ";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['opt1'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 2859
echo "\t\t";
}
// line 2860
echo "
";
// line 2861
if (((isset($context["p_option2"]) || array_key_exists("p_option2", $context) ? $context["p_option2"] : (function () { throw new RuntimeError('Variable "p_option2" does not exist.', 2861, $this->source); })()) && ((twig_length_filter($this->env, (isset($context["p_option2"]) || array_key_exists("p_option2", $context) ? $context["p_option2"] : (function () { throw new RuntimeError('Variable "p_option2" does not exist.', 2861, $this->source); })())) == 1) || (twig_join_filter((isset($context["p_option2"]) || array_key_exists("p_option2", $context) ? $context["p_option2"] : (function () { throw new RuntimeError('Variable "p_option2" does not exist.', 2861, $this->source); })())) == "")))) {
// line 2862
echo " option2 = \"\";
\t\t\t";
// line 2863
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["p_option2"]) || array_key_exists("p_option2", $context) ? $context["p_option2"] : (function () { throw new RuntimeError('Variable "p_option2" does not exist.', 2863, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["opt2"]) {
if ($context["opt2"]) {
echo " option2 = \"";
echo twig_escape_filter($this->env, twig_escape_filter($this->env, $context["opt2"], "js"), "html", null, true);
echo "\"; ";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['opt2'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 2864
echo "\t\t";
}
// line 2865
echo "
\t\t// カラー radio が複数あるとき初期チェックが無いと「カラーを選択してください」固定になるので、
\t\t// 何もチェックされていなければ「最初の radio」を選択する。
\t\t// sale_type≠3 は name=\"color\", sale_type=3 は name=\"color3\".
\t\t//
\t\t// 注意:
\t\t// ・search_word(= radio の値)と pp.c(= matrix の色軸)は別の命名体系のケースがある
\t\t// (例 id=3353: radio=\"SM(スミ)\" / pp.c=\"ステンカラー+セピアブラウン\")
\t\t// ・pp.c に合わせて radio を選ぼうとしても文字列一致しないので無意味。
\t\t// ・単純に「先頭の radio」を選ぶ実装に戻し、マッチング側で命名体系違いを吸収する
\t\t// (pc が pp.c のどの値にもマッチしないときは色軸を wildcard 扱いにする)。
\t\t// ・.rp-section-label のテキストも忘れずに同期する(古い session 値が残ると
\t\t// \"ステンカラー+セピアブラウン\" のような表示と実際の radio が食い違う)。
\t\t(function autoSelectFirstColor(){
\t\t\tvar groups = ['color', 'color3'];
\t\t\tfor (var gi = 0; gi < groups.length; gi++) {
\t\t\t\tvar name = groups[gi];
\t\t\t\tvar nodes = document.querySelectorAll('input[type=\"radio\"][name=\"' + name + '\"]');
\t\t\t\tif (nodes.length === 0) continue;
\t\t\t\tvar anyChecked = false;
\t\t\t\tfor (var i = 0; i < nodes.length; i++) {
\t\t\t\t\tif (nodes[i].checked) { anyChecked = true; break; }
\t\t\t\t}
\t\t\t\tif (anyChecked) continue;
\t\t\t\tvar target = nodes[0];
\t\t\t\ttarget.checked = true;
\t\t\t\tpc = target.value;
\t\t\t\t// opt-btn の is-selected を付け替え
\t\t\t\tvar lbl = target.closest('.opt-btn');
\t\t\t\tif (lbl) {
\t\t\t\t\tvar sib = lbl.parentNode ? lbl.parentNode.querySelectorAll('.opt-btn') : [];
\t\t\t\t\tfor (var k = 0; k < sib.length; k++) sib[k].classList.remove('is-selected');
\t\t\t\t\tlbl.classList.add('is-selected');
\t\t\t\t}
\t\t\t\t// 「カラー: <name>」表示の同期(古い mitsumori_json.pc が残らないように)
\t\t\t\tvar grp = (lbl && lbl.closest('.form-group')) || (target.closest('.form-group'));
\t\t\t\tif (grp) {
\t\t\t\t\tvar section = grp.querySelector('.rp-section-label');
\t\t\t\t\tif (section) {
\t\t\t\t\t\tvar labelHead = section.textContent.split(':')[0].trim();
\t\t\t\t\t\tsection.innerHTML = labelHead + ': <span>' + target.value + '</span>';
\t\t\t\t\t}
\t\t\t\t}
\t\t\t}
\t\t})();
\t\t// option1 / option2 / pw / pd / ph / pm (matrix 軸の radio 群) も同様に
\t\t// 「どれもチェックされていなければ先頭を選ぶ」を適用する.
\t\t// sale_type=2 の窓タイプ等で「初期表示時に一番初めの選択肢が選択されていない」事象を解消.
\t\t(function autoSelectFirstMatrixAxis(){
\t\t\tvar axes = [
\t\t\t\t{ name: 'pw', jsVar: 'pw' },
\t\t\t\t{ name: 'pd', jsVar: 'pd' },
\t\t\t\t{ name: 'ph', jsVar: 'ph' },
\t\t\t\t{ name: 'pm', jsVar: 'pm' },
\t\t\t\t{ name: 'glass_type', jsVar: 'pm' },
\t\t\t\t{ name: 'option1', jsVar: 'option1' },
\t\t\t\t{ name: 'option2', jsVar: 'option2' }
\t\t\t];
\t\t\tfor (var ai = 0; ai < axes.length; ai++) {
\t\t\t\tvar ax = axes[ai];
\t\t\t\tvar nodes = document.querySelectorAll('input[type=\"radio\"][name=\"' + ax.name + '\"]');
\t\t\t\tif (nodes.length === 0) continue;
\t\t\t\tvar anyChecked = false;
\t\t\t\tfor (var i = 0; i < nodes.length; i++) {
\t\t\t\t\tif (nodes[i].checked) { anyChecked = true; break; }
\t\t\t\t}
\t\t\t\tif (anyChecked) continue;
\t\t\t\tvar target = nodes[0];
\t\t\t\ttarget.checked = true;
\t\t\t\t// グローバル JS 変数も埋める
\t\t\t\tif (ax.jsVar === 'pw') pw = target.value;
\t\t\t\telse if (ax.jsVar === 'pd') pd = target.value;
\t\t\t\telse if (ax.jsVar === 'ph') ph = target.value;
\t\t\t\telse if (ax.jsVar === 'pm') pm = target.value;
\t\t\t\telse if (ax.jsVar === 'option1') option1 = target.value;
\t\t\t\telse if (ax.jsVar === 'option2') option2 = target.value;
\t\t\t\tvar lbl = target.closest('.opt-btn');
\t\t\t\tif (lbl) {
\t\t\t\t\tvar sib = lbl.parentNode ? lbl.parentNode.querySelectorAll('.opt-btn') : [];
\t\t\t\t\tfor (var k = 0; k < sib.length; k++) sib[k].classList.remove('is-selected');
\t\t\t\t\tlbl.classList.add('is-selected');
\t\t\t\t}
\t\t\t\tvar grp = (lbl && lbl.closest('.form-group')) || (target.closest('.form-group'));
\t\t\t\tif (grp) {
\t\t\t\t\tvar section = grp.querySelector('.rp-section-label');
\t\t\t\t\tif (section) {
\t\t\t\t\t\tvar labelHead = section.textContent.split(':')[0].trim();
\t\t\t\t\t\tsection.innerHTML = labelHead + ': <span>' + target.value + '</span>';
\t\t\t\t\t}
\t\t\t\t}
\t\t\t}
\t\t})();
\t\t// 取付/設置工事トグル(off 値が「商品購入のみ」のオプション)は、新規アクセス時に
\t\t// どちらの radio も未チェックのため初期価格が「商品購入のみ」= 基本工事費抜きになる。
\t\t// 顧客要望(#10)に合わせ、未選択時は「工事も希望する」(on 側) を初期選択し、
\t\t// 初期表示を基本工事費込みの最安値に統一する(色・寸法軸の先頭自動選択と同型)。
\t\t// ・判定キーは calcGoukei / applyPurchaseOnlyUI と同じ定数「商品購入のみ」。
\t\t// ・別用途で op{n} を流用する商品(ウッドデッキ deck_step 等)は radio 値に
\t\t// 「商品購入のみ」を含まないため対象外(既存挙動を壊さない)。
\t\t// ・mitsumori_json 復元やユーザー操作で既に選択済みなら尊重する。
\t\t(function autoSelectFirstInstall(){
\t\t\tfor (var i = 0; i <= 10; i++) {
\t\t\t\tvar nodes = document.querySelectorAll('input[type=\"radio\"][name=\"op' + i + '\"]');
\t\t\t\tif (nodes.length === 0) continue;
\t\t\t\t// このグループが「商品購入のみ」を off に持つ工事トグルか判定し、
\t\t\t\t// 「商品購入のみ」でない側 (= 工事希望 on) を取得する。
\t\t\t\tvar hasPurchaseOnly = false;
\t\t\t\tvar onNode = null;
\t\t\t\tfor (var j = 0; j < nodes.length; j++) {
\t\t\t\t\tif (nodes[j].value === '商品購入のみ') hasPurchaseOnly = true;
\t\t\t\t\telse if (!onNode) onNode = nodes[j];
\t\t\t\t}
\t\t\t\tif (!hasPurchaseOnly || !onNode) continue;
\t\t\t\tvar anyChecked = false;
\t\t\t\tfor (var k = 0; k < nodes.length; k++) {
\t\t\t\t\tif (nodes[k].checked) { anyChecked = true; break; }
\t\t\t\t}
\t\t\t\tif (anyChecked) continue;
\t\t\t\tonNode.checked = true;
\t\t\t\t// グローバル op 変数を on 値で埋める(calcGoukei の purchaseOnly 判定が参照)
\t\t\t\tswitch (i) {
\t\t\t\t\tcase 0: op0 = onNode.value; break;
\t\t\t\t\tcase 1: op1 = onNode.value; break;
\t\t\t\t\tcase 2: op2 = onNode.value; break;
\t\t\t\t\tcase 3: op3 = onNode.value; break;
\t\t\t\t\tcase 4: op4 = onNode.value; break;
\t\t\t\t\tcase 5: op5 = onNode.value; break;
\t\t\t\t\tcase 6: op6 = onNode.value; break;
\t\t\t\t\tcase 7: op7 = onNode.value; break;
\t\t\t\t\tcase 8: op8 = onNode.value; break;
\t\t\t\t\tcase 9: op9 = onNode.value; break;
\t\t\t\t\tcase 10: op10 = onNode.value; break;
\t\t\t\t}
\t\t\t\t// opt-btn の is-selected を付け替え
\t\t\t\tvar lbl = onNode.closest('.opt-btn');
\t\t\t\tif (lbl) {
\t\t\t\t\tvar sib = lbl.parentNode ? lbl.parentNode.querySelectorAll('.opt-btn') : [];
\t\t\t\t\tfor (var s = 0; s < sib.length; s++) sib[s].classList.remove('is-selected');
\t\t\t\t\tlbl.classList.add('is-selected');
\t\t\t\t}
\t\t\t\t// rp-section-label 表示同期 + 現地調査文言(is_removal_unknown / is_tf_kouji)を on 表示に
\t\t\t\tvar grp = (lbl && lbl.closest('.form-group')) || onNode.closest('.form-group');
\t\t\t\tif (grp) {
\t\t\t\t\tvar section = grp.querySelector('.rp-section-label');
\t\t\t\t\tif (section) {
\t\t\t\t\t\tvar labelHead = section.textContent.split(':')[0].trim();
\t\t\t\t\t\tsection.innerHTML = labelHead + ': <span>' + onNode.value + '</span>';
\t\t\t\t\t}
\t\t\t\t\tvar note = grp.querySelector('.opt-survey-note[data-op-idx=\"' + i + '\"]');
\t\t\t\t\tif (note) note.style.display = '';
\t\t\t\t}
\t\t\t}
\t\t})();
\t\t// ページ読み込み時: 見積金額が「合計」になっているため、カート数量は基本1
\t\t// sale_type=9(商品のみ購入)だけ通常 EC として数量を引き継ぐ
\t\t(function initQuantityByType(){
\t\t\tvar saleType = ";
// line 3031
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 3031, $this->source); })()), "SaleType", [], "any", false, false, false, 3031), "id", [], "any", false, false, false, 3031), "html", null, true);
echo ";
\t\t\tif (saleType == 9 && \$('#quantity_only').length) {
\t\t\t\t\$('#quantity').val(parseInt(\$('#quantity_only').val()) || 1);
\t\t\t} else {
\t\t\t\t\$('#quantity').val(1);
\t\t\t\t\$('input[name=\"quantity\"]').val(1);
\t\t\t}
\t\t})();
\t\t// type → ラベルのプレフィックス文字列
\t\t";
// line 3044
echo "\t\t";
$context["pm_is_roof"] = false;
// line 3045
echo "\t\t";
$context["pm_stems"] = [];
// line 3046
echo "\t\t";
if ((isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 3046, $this->source); })())) {
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 3046, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["v"]) {
if ($context["v"]) {
// line 3047
echo "\t\t\t";
if (preg_match("/ポリカ|折板|波板|熱線|ふきポリ|アルミ形材屋根|スチール折板/", $context["v"])) {
$context["pm_is_roof"] = true;
}
// line 3048
echo "\t\t\t";
$context["pm_stem"] = twig_trim_filter(twig_first($this->env, twig_split_filter($this->env, twig_first($this->env, twig_split_filter($this->env, $context["v"], "(")), "(")));
// line 3049
echo "\t\t\t";
if (!twig_in_filter((isset($context["pm_stem"]) || array_key_exists("pm_stem", $context) ? $context["pm_stem"] : (function () { throw new RuntimeError('Variable "pm_stem" does not exist.', 3049, $this->source); })()), (isset($context["pm_stems"]) || array_key_exists("pm_stems", $context) ? $context["pm_stems"] : (function () { throw new RuntimeError('Variable "pm_stems" does not exist.', 3049, $this->source); })()))) {
$context["pm_stems"] = twig_array_merge((isset($context["pm_stems"]) || array_key_exists("pm_stems", $context) ? $context["pm_stems"] : (function () { throw new RuntimeError('Variable "pm_stems" does not exist.', 3049, $this->source); })()), [0 => (isset($context["pm_stem"]) || array_key_exists("pm_stem", $context) ? $context["pm_stem"] : (function () { throw new RuntimeError('Variable "pm_stem" does not exist.', 3049, $this->source); })())]);
}
// line 3050
echo "\t\t";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['v'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
}
// line 3051
echo "\t\t";
$context["pm_label"] = (((isset($context["pm_is_roof"]) || array_key_exists("pm_is_roof", $context) ? $context["pm_is_roof"] : (function () { throw new RuntimeError('Variable "pm_is_roof" does not exist.', 3051, $this->source); })())) ? ((((twig_length_filter($this->env, (isset($context["pm_stems"]) || array_key_exists("pm_stems", $context) ? $context["pm_stems"] : (function () { throw new RuntimeError('Variable "pm_stems" does not exist.', 3051, $this->source); })())) >= 2)) ? ("屋根材") : ("屋根材の色"))) : ("素材"));
// line 3052
echo "\t\t// option1/option2 のラベルは category 依存 (rd: ランマ/タイプ, sh: サイズプリセット/駆動方式 等).
\t\t// PHP から渡された option1_label / option2_label を埋め込み、JS 側でラベル更新に使う.
\t\tvar optLabelMap = {pc:'カラー', pw:'幅', pd:'奥行き', ph:'高さ', pm:'";
// line 3054
echo twig_escape_filter($this->env, twig_escape_filter($this->env, (isset($context["pm_label"]) || array_key_exists("pm_label", $context) ? $context["pm_label"] : (function () { throw new RuntimeError('Variable "pm_label" does not exist.', 3054, $this->source); })()), "js"), "html", null, true);
echo "',
\t\t option1: '";
// line 3055
echo twig_escape_filter($this->env, twig_escape_filter($this->env, ((array_key_exists("option1_label", $context)) ? (_twig_default_filter((isset($context["option1_label"]) || array_key_exists("option1_label", $context) ? $context["option1_label"] : (function () { throw new RuntimeError('Variable "option1_label" does not exist.', 3055, $this->source); })()), "オプション1")) : ("オプション1")), "js"), "html", null, true);
echo "',
\t\t option2: '";
// line 3056
echo twig_escape_filter($this->env, twig_escape_filter($this->env, ((array_key_exists("option2_label", $context)) ? (_twig_default_filter((isset($context["option2_label"]) || array_key_exists("option2_label", $context) ? $context["option2_label"] : (function () { throw new RuntimeError('Variable "option2_label" does not exist.', 3056, $this->source); })()), "オプション2")) : ("オプション2")), "js"), "html", null, true);
echo "'};
\t\t// type → input[name]
\t\tvar optNameMap = {pc:'color', pw:'pw', pd:'pd', ph:'ph', pm:'pm',
\t\t option1: 'option1', option2: 'option2'};
\t\t// opt-btn用: 値を直接受け取るラッパー
\t\tfunction mitsumori_simulation_val(type, value) {
\t\t\tif (type === 'pc') pc = value;
\t\t\tif (type === 'pw') pw = value;
\t\t\tif (type === 'pd') pd = value;
\t\t\tif (type === 'ph') ph = value;
\t\t\tif (type === 'pm') pm = value;
\t\t\tif (type === 'option1') option1 = value;
\t\t\tif (type === 'option2') option2 = value;
\t\t\t// is-selected クラスを同グループ内で付け替え
\t\t\tvar inputName = optNameMap[type];
\t\t\tif (inputName) {
\t\t\t\tvar \$btns = \$('input[name=\"' + inputName + '\"]').closest('.opt-btn');
\t\t\t\t\$btns.removeClass('is-selected');
\t\t\t\t\$btns.filter(function(){
\t\t\t\t\treturn \$(this).find('input').val() === value;
\t\t\t\t}).addClass('is-selected');
\t\t\t}
\t\t\t// ラベル行の選択値テキストを更新(例: 「カラー: ブラック」)
\t\t\tvar labelPrefix = optLabelMap[type];
\t\t\tif (labelPrefix) {
\t\t\t\t// 対象のrp-section-labelを特定(input[name]を含む親を遡る)
\t\t\t\tvar \$group = \$('input[name=\"' + inputName + '\"]').first().closest('.form-group');
\t\t\t\tvar \$label = \$group.find('.rp-section-label');
\t\t\t\t\$label.html(labelPrefix + ': <span>' + value + '</span>');
\t\t\t}
\t\t\t// simulation本体を呼ぶ(value_idは空でOK、グローバル変数を使う)
\t\t\tmitsumori_simulation('', '');
\t\t}
\t\tmitsumori_simulation(\"\",\"\");
\t\t// ボタン群: 親幅を超える、または3行以上になる場合は is-scroll を付与し
\t\t// 縦3段グリッド+横スクロール表示にする(顧客要望「3列くらいで横スクロール」)
\t\tfunction applyBtnGroupScroll() {
\t\t\t\$('.rp-btn-group, .opt-btn-group').each(function() {
\t\t\t\tvar \$group = \$(this);
\t\t\t\t\$group.removeClass('is-scroll');
\t\t\t\t// 意図的な縦リスト(no-hscroll / flex-direction:column)は横スクロール化しない。
\t\t\t\t// フェンス fe_block の縦6行(A-2)や内窓(sale_type=2)の長いガラス名(A-3)が
\t\t\t\t// 3行以上/幅超過で is-scroll 化され、列崩れ・左見切れを起こすのを防ぐ。
\t\t\t\tif (\$group.hasClass('no-hscroll') || \$group.css('flex-direction') === 'column') return;
\t\t\t\tvar \$items = \$group.children();
\t\t\t\tif (\$items.length === 0) return;
\t\t\t\tvar parentWidth = \$group.parent().width() || \$group.width();
\t\t\t\tvar totalWidth = 0;
\t\t\t\tvar gap = parseInt(\$group.css('gap'), 10) || 8;
\t\t\t\t\$items.each(function() {
\t\t\t\t\ttotalWidth += this.offsetWidth + gap;
\t\t\t\t});
\t\t\t\t// 単一ボタンが親幅を超える、もしくは合計幅が親幅を超える → 横スクロール化
\t\t\t\tvar anyTooWide = false;
\t\t\t\t\$items.each(function() {
\t\t\t\t\tif (this.offsetWidth > parentWidth) { anyTooWide = true; return false; }
\t\t\t\t});
\t\t\t\t// 折り返し時の行数も計測
\t\t\t\tvar tops = {};
\t\t\t\t\$items.each(function() { tops[this.offsetTop] = true; });
\t\t\t\tvar rowCount = Object.keys(tops).length;
\t\t\t\tif (anyTooWide || totalWidth > parentWidth * 2 || rowCount >= 3) {
\t\t\t\t\t\$group.addClass('is-scroll');
\t\t\t\t}
\t\t\t});
\t\t}
\t\tapplyBtnGroupScroll();
\t\t\$(window).on('resize', function() {
\t\t\tclearTimeout(window._btnScrollTimer);
\t\t\twindow._btnScrollTimer = setTimeout(applyBtnGroupScroll, 150);
\t\t});
\t\t// iOS Safari 1-tap fix (#15 再発): is-scroll の横スクロールコンテナ内タップや
\t\t// 継承された a:hover により、初回タップが hover / スクロール判定に吸われ「2 回
\t\t// タッチ」が必要になる。touch 端末では touchend で 1 回目に選択 / 遷移を確定し、
\t\t// 後続のゴーストクリックを preventDefault で抑止する(二重発火なし)。指が動いた
\t\t// 場合はスクロール操作とみなし何もしない。デスクトップは従来の click のまま。
\t\t(function oneTapSelectFix(){
\t\t\tif (!('ontouchstart' in window)) return;
\t\t\tvar moved = false, sx = 0, sy = 0;
\t\t\tdocument.addEventListener('touchstart', function(e){
\t\t\t\tmoved = false;
\t\t\t\tvar t = e.touches && e.touches[0];
\t\t\t\tif (t) { sx = t.clientX; sy = t.clientY; }
\t\t\t}, { passive: true });
\t\t\tdocument.addEventListener('touchmove', function(e){
\t\t\t\tvar t = e.touches && e.touches[0];
\t\t\t\tif (t && (Math.abs(t.clientX - sx) > 8 || Math.abs(t.clientY - sy) > 8)) moved = true;
\t\t\t}, { passive: true });
\t\t\tdocument.addEventListener('touchend', function(e){
\t\t\t\tif (moved) return;
\t\t\t\tvar el = (e.target && e.target.closest) ? e.target.closest('.opt-btn, .rp-btn, .rp-card') : null;
\t\t\t\tif (!el) return;
\t\t\t\t// 窓タイプ / 住宅区分は専用の委譲 click ハンドラを持つため除外.
\t\t\t\tif (el.closest('#window-types-container') || el.closest('#window-housing-type-group')) return;
\t\t\t\te.preventDefault(); // 遅延ゴーストクリックを抑止し二重処理を防ぐ
\t\t\t\tif (el.tagName === 'A' && el.href) { window.location.href = el.href; return; }
\t\t\t\tel.click(); // label→radio チェック + inline onclick / change を 1 回だけ発火
\t\t\t}, { passive: false });
\t\t})();
\t\t// onload: 見積金額が確定している場合は「工事費込み価格」表示を一致させる
\t\t(function syncPrice02Display() {
\t\t\tvar goukeiEl = document.getElementById('mitsumori_goukei');
\t\t\tvar displayEl = document.getElementById('price02-display');
\t\t\tif (!goukeiEl || !displayEl) return;
\t\t\tvar goukeiText = goukeiEl.textContent.trim();
\t\t\t// ---円(未確定)の場合は書き換えない
\t\t\tif (goukeiText && goukeiText !== '---円') {
\t\t\t\tdisplayEl.textContent = goukeiText;
\t\t\t}
\t\t\t// 以降の変更にも追従: mitsumori_goukei を監視
\t\t\tnew MutationObserver(function() {
\t\t\t\tvar text = goukeiEl.textContent.trim();
\t\t\t\tif (text && text !== '---円') {
\t\t\t\t\tdisplayEl.textContent = text;
\t\t\t\t}
\t\t\t}).observe(goukeiEl, { childList: true, subtree: true, characterData: true });
\t\t})();
\t\tfunction contact_form(product_id){
\t\t\t\$('#form1').attr('action', '";
// line 3186
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("contact", ["product" => twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3186, $this->source); })()), "id", [], "any", false, false, false, 3186)]), "html", null, true);
echo "');
\t\t\t\$('#form1').submit();
\t\t}
\t\t// maisu / madoset は下部の新しい関数定義を使用
\t\tfunction heibei(bei){
\t\t\t\$('#heibei').val(parseInt(\$('#heibei').val()) + bei);
\t\t\tif(parseInt(\$('#heibei').val()) < 1){ \$('#heibei').val(1); }
\t\t\tif(parseInt(\$('#heibei').val()) > 100){ \$('#heibei').val(100); }
\t\t\t// goukei に既に枚数を含むため、カート数量は1で固定
\t\t\t\$('#quantity').val(1);
\t\t\tmitsumori_simulation('heibei','heibei');
\t\t}
\t\tfunction daisu(dai){
\t\t\t\$('#daisu').val(parseInt(\$('#daisu').val()) + dai);
\t\t\tif(parseInt(\$('#daisu').val()) < 1){ \$('#daisu').val(1); }
\t\t\tif(parseInt(\$('#daisu').val()) > 10){ \$('#daisu').val(10); }
\t\t\t\$('#quantity').val(1);
\t\t\tmitsumori_simulation('daisu','daisu');
\t\t}
\t\t// sale_type=7(数量買い・基本工事費固定)用:個数入力
\t\tfunction suuryou(n){
\t\t\t\$('#suuryou').val(parseInt(\$('#suuryou').val()) + n);
\t\t\tif(parseInt(\$('#suuryou').val()) < 1){ \$('#suuryou').val(1); }
\t\t\tif(parseInt(\$('#suuryou').val()) > 100){ \$('#suuryou').val(100); }
\t\t\t\$('#quantity').val(1);
\t\t\tmitsumori_simulation('suuryou','suuryou');
\t\t}
\t\tfunction maisu(mai){
\t\t\t\$('#maisu').val(parseInt(\$('#maisu').val()) + mai);
\t\t\t// sale_type=4 (フェンス) は3枚未満不可、6 (芝生) は1枚から
\t\t\tvar minMai = (SALE_TYPE_ID == 4) ? 3 : 1;
\t\t\tif(parseInt(\$('#maisu').val()) < minMai){ \$('#maisu').val(minMai); }
\t\t\tif(parseInt(\$('#maisu').val()) > 100){ \$('#maisu').val(100); }
\t\t\t\$('#quantity').val(1);
\t\t\tmitsumori_simulation('maisu','maisu');
\t\t}
\t\t// タイプ2: セット数プルダウン連動
\t\tfunction madosetSelect(val){
\t\t\tvar v = parseInt(val);
\t\t\tif(v < 1) v = 1;
\t\t\tif(v > 20) v = 20;
\t\t\t\$('#set_count').val(v);
\t\t\t\$('#quantity').val(1);
\t\t\t\$('input[name=\"quantity\"]').val(1);
\t\t\tmitsumori_simulation('set','set_count');
\t\t}
\t\t// タイプ2: ±ボタン版(後方互換)
\t\tfunction madoset(mai){
\t\t\tvar current = parseInt(\$('#set_count').val()) || 1;
\t\t\tvar next = current + mai;
\t\t\tif(next < 1) next = 1;
\t\t\tif(next > 20) next = 20;
\t\t\t\$('#set_count').val(next);
\t\t\tmadosetSelect(next);
\t\t}
\t\t// タイプ5: ステップ・フェンス選択値を mitsumori_json に保存するためのグローバル変数
\t\tvar deck_step = \"";
// line 3247
if (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3247, $this->source); })()) && twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "deck_step", [], "any", true, true, false, 3247))) {
echo twig_escape_filter($this->env, ((twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "deck_step", [], "any", true, true, false, 3247)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "deck_step", [], "any", false, false, false, 3247), "不要")) : ("不要")), "html", null, true);
} else {
echo "不要";
}
echo "\";
\t\tvar deck_fence = \"";
// line 3248
if (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3248, $this->source); })()) && twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "deck_fence", [], "any", true, true, false, 3248))) {
echo twig_escape_filter($this->env, ((twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "deck_fence", [], "any", true, true, false, 3248)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "deck_fence", [], "any", false, false, false, 3248), "不要")) : ("不要")), "html", null, true);
} else {
echo "不要";
}
echo "\";
\t\t// PDF出力: モーダルの mitsumori_json をフォームに同期してから送信
\t\tfunction syncPdfJson(){
\t\t\tvar jsonVal = \$('#mitsumori_json').val();
\t\t\t\$('#pdf_mitsumori_json').val(jsonVal);
\t\t}
\t\t// タイプ9: 商品のみ購入
\t\tfunction quantityOnly(val){
\t\t\tvar current = parseInt(\$('#quantity_only').val()) || 1;
\t\t\tvar next = current + val;
\t\t\tif(next < 1) next = 1;
\t\t\t\$('#quantity_only').val(next);
\t\t\t\$('#quantity').val(next);
\t\t}
// ===== スマホ用下部固定バーへの金額同期 =====
// mitsumori_message と mitsumori_goukei を監視して下部バーを更新
(function() {
var msgTarget = document.getElementById('mitsumori_message');
var goukeiTarget = document.getElementById('mitsumori_goukei');
var spPrice = document.getElementById('sp-mitsumori-price');
var spBtn = document.querySelector('#sp-mitsumori-bar .sp-bar__btn');
if (!spPrice || !spBtn) return;
function syncBar() {
var msg = msgTarget ? msgTarget.textContent : '';
var goukei = goukeiTarget ? goukeiTarget.textContent : '---円';
// メッセージが「〇〇を選択してください」の場合はメッセージを表示しボタンを非表示
if (msg.indexOf('選択してください') !== -1) {
spPrice.textContent = msg;
spPrice.style.fontSize = '13px';
spPrice.style.color = '#888';
spBtn.style.display = 'none';
} else {
// 価格確定時はボタンを表示
spPrice.textContent = goukei;
spPrice.style.fontSize = '18px';
spPrice.style.color = '#c00';
spBtn.style.display = 'block';
}
}
// 初期値を同期
syncBar();
// mitsumori_message の変化を監視
if (msgTarget) {
new MutationObserver(syncBar).observe(
msgTarget, { childList: true, subtree: true, characterData: true }
);
}
// mitsumori_goukei の変化も監視
if (goukeiTarget) {
new MutationObserver(syncBar).observe(
goukeiTarget, { childList: true, subtree: true, characterData: true }
);
}
})();
// ===== スマホ用 お見積りの詳細 ボトムシート 開閉 =====
// 現在の内訳カード(.mitsumori-card-pc .card-body)を複製して表示する。
// 価格計算ロジックには触れず、その時点で表示中の内訳をそのまま見せる。
// window に直接ぶら下げてスコープに依存せず onclick から呼べるようにする。
window.openSpMitsumoriDetail = function () {
var sheet = document.getElementById('sp-mitsumori-detail');
var body = document.getElementById('sp-detail-body');
var src = document.querySelector('.mitsumori-card-pc .card-body');
if (!sheet || !body) return;
body.innerHTML = '';
if (src) {
// 複製し、重複 id を避けるため clone 側の id を除去する
var clone = src.cloneNode(true);
var ided = clone.querySelectorAll('[id]');
for (var i = 0; i < ided.length; i++) { ided[i].removeAttribute('id'); }
body.appendChild(clone);
}
sheet.classList.add('is-open');
sheet.setAttribute('aria-hidden', 'false');
document.body.style.overflow = 'hidden';
};
window.closeSpMitsumoriDetail = function () {
var sheet = document.getElementById('sp-mitsumori-detail');
if (!sheet) return;
sheet.classList.remove('is-open');
sheet.setAttribute('aria-hidden', 'true');
document.body.style.overflow = '';
};
// ===== 現在のお見積り額: 折りたたみトグルボタンのテキスト切り替え =====
(function() {
var card = document.querySelector('.mitsumori-card-pc');
var btn = document.querySelector('.btn-mitsumori-toggle .toggle-icon');
if (!card || !btn) return;
// MutationObserverでcollapsed-cardクラスの変化を監視
new MutationObserver(function() {
if (card.classList.contains('collapsed-card')) {
btn.textContent = '▼ 詳細';
} else {
btn.textContent = '▲ 閉じる';
}
}).observe(card, { attributes: true, attributeFilter: ['class'] });
})();
// ===== エリア案内: スマホのみタップで展開 =====
(function() {
var notice = document.querySelector('.ec-areaNotice');
if (!notice) return;
notice.addEventListener('click', function(e) {
if (window.innerWidth > 767) return;
// リンククリック時は展開/折りたたみせずリンク遷移
if (e.target.tagName === 'A') return;
notice.classList.toggle('is-open');
});
})();
</script>
<script type=\"application/ld+json\">
{
\"@context\": \"https://schema.org/\",
\"@type\": \"Product\",
\"name\": \"";
// line 3371
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3371, $this->source); })()), "name", [], "any", false, false, false, 3371), "html", null, true);
echo "\",
\"image\": [
";
// line 3373
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3373, $this->source); })()), "ProductImage", [], "any", false, false, false, 3373));
$context['_iterated'] = false;
$context['loop'] = [
'parent' => $context['_parent'],
'index0' => 0,
'index' => 1,
'first' => true,
];
if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
$length = count($context['_seq']);
$context['loop']['revindex0'] = $length - 1;
$context['loop']['revindex'] = $length;
$context['loop']['length'] = $length;
$context['loop']['last'] = 1 === $length;
}
foreach ($context['_seq'] as $context["_key"] => $context["img"]) {
// line 3374
echo " \"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 3374, $this->source); })()), "request", [], "any", false, false, false, 3374), "schemeAndHttpHost", [], "any", false, false, false, 3374), "html", null, true);
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl($context["img"], "save_image"), "html", null, true);
echo "\"";
if ( !twig_get_attribute($this->env, $this->source, $context["loop"], "last", [], "any", false, false, false, 3374)) {
echo ",";
}
// line 3375
echo "
";
$context['_iterated'] = true;
++$context['loop']['index0'];
++$context['loop']['index'];
$context['loop']['first'] = false;
if (isset($context['loop']['length'])) {
--$context['loop']['revindex0'];
--$context['loop']['revindex'];
$context['loop']['last'] = 0 === $context['loop']['revindex0'];
}
}
if (!$context['_iterated']) {
// line 3377
echo " \"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 3377, $this->source); })()), "request", [], "any", false, false, false, 3377), "schemeAndHttpHost", [], "any", false, false, false, 3377), "html", null, true);
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl($this->extensions['Eccube\Twig\Extension\EccubeExtension']->getNoImageProduct(""), "save_image"), "html", null, true);
echo "\"
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['img'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 3379
echo " ],
\"description\": \"";
// line 3380
echo twig_escape_filter($this->env, twig_slice($this->env, twig_replace_filter(((twig_get_attribute($this->env, $this->source, ($context["Product"] ?? null), "description_list", [], "any", true, true, false, 3380)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["Product"] ?? null), "description_list", [], "any", false, false, false, 3380), twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3380, $this->source); })()), "description_detail", [], "any", false, false, false, 3380))) : (twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3380, $this->source); })()), "description_detail", [], "any", false, false, false, 3380))), ["
" => "", "
" => ""]), 0, 300), "html", null, true);
echo "\",
";
// line 3381
if (twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3381, $this->source); })()), "code_min", [], "any", false, false, false, 3381)) {
// line 3382
echo " \"sku\": \"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3382, $this->source); })()), "code_min", [], "any", false, false, false, 3382), "html", null, true);
echo "\",
";
}
// line 3384
echo " \"offers\": {
\"@type\": \"Offer\",
\"url\": \"";
// line 3386
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("product_detail", ["id" => twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3386, $this->source); })()), "id", [], "any", false, false, false, 3386)]), "html", null, true);
echo "\",
\"priceCurrency\": \"";
// line 3387
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["eccube_config"]) || array_key_exists("eccube_config", $context) ? $context["eccube_config"] : (function () { throw new RuntimeError('Variable "eccube_config" does not exist.', 3387, $this->source); })()), "currency", [], "any", false, false, false, 3387), "html", null, true);
echo "\",
\"price\": ";
// line 3388
((twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3388, $this->source); })()), "getPrice02IncTaxMin", [], "any", false, false, false, 3388)) ? (print (twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3388, $this->source); })()), "getPrice02IncTaxMin", [], "any", false, false, false, 3388), "html", null, true))) : (print (0)));
echo ",
\"availability\": \"";
// line 3389
echo ((twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3389, $this->source); })()), "stock_find", [], "any", false, false, false, 3389)) ? ("InStock") : ("OutOfStock"));
echo "\"
}
}
</script>
";
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
}
// line 3396
public function block_main($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "main"));
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "main"));
// line 3397
echo " ";
// line 3398
echo " ";
$context["option1_label"] = "オプション1";
// line 3399
echo " ";
$context["option2_label"] = "オプション2";
// line 3400
echo " ";
// line 3403
echo " ";
$context["is_cat43"] = false;
// line 3404
echo " ";
// line 3406
echo " ";
$context["is_cp"] = false;
// line 3407
echo " ";
if ( !twig_test_empty(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3407, $this->source); })()), "ProductCategories", [], "any", false, false, false, 3407))) {
// line 3408
echo " ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3408, $this->source); })()), "ProductCategories", [], "any", false, false, false, 3408));
foreach ($context['_seq'] as $context["_key"] => $context["pcat"]) {
// line 3409
echo " ";
if ((twig_get_attribute($this->env, $this->source, $context["pcat"], "category_id", [], "any", false, false, false, 3409) == 31)) {
$context["option1_label"] = "サイズプリセット";
$context["option2_label"] = "駆動方式";
}
// line 3410
echo " ";
if ((twig_get_attribute($this->env, $this->source, $context["pcat"], "category_id", [], "any", false, false, false, 3410) == 43)) {
$context["option1_label"] = "ランマ";
$context["option2_label"] = "タイプ";
$context["is_cat43"] = true;
}
// line 3411
echo " ";
if ((twig_get_attribute($this->env, $this->source, $context["pcat"], "category_id", [], "any", false, false, false, 3411) == 15)) {
$context["option1_label"] = "棚タイプ";
}
// line 3412
echo " ";
if ((twig_get_attribute($this->env, $this->source, $context["pcat"], "category_id", [], "any", false, false, false, 3412) == 17)) {
$context["option1_label"] = "窓タイプ";
}
// line 3413
echo " ";
if ((twig_get_attribute($this->env, $this->source, $context["pcat"], "category_id", [], "any", false, false, false, 3413) == 7)) {
$context["is_cp"] = true;
}
// line 3414
echo " ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['pcat'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 3415
echo " ";
}
// line 3416
echo " ";
// line 3418
echo " ";
$context["pm_is_roof"] = false;
// line 3419
echo " ";
$context["pm_stems"] = [];
// line 3420
echo " ";
if ((isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 3420, $this->source); })())) {
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 3420, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["v"]) {
if ($context["v"]) {
// line 3421
echo " ";
if (preg_match("/ポリカ|折板|波板|熱線|ふきポリ|アルミ形材屋根|スチール折板/", $context["v"])) {
$context["pm_is_roof"] = true;
}
// line 3422
echo " ";
$context["pm_stem"] = twig_trim_filter(twig_first($this->env, twig_split_filter($this->env, twig_first($this->env, twig_split_filter($this->env, $context["v"], "(")), "(")));
// line 3423
echo " ";
if (!twig_in_filter((isset($context["pm_stem"]) || array_key_exists("pm_stem", $context) ? $context["pm_stem"] : (function () { throw new RuntimeError('Variable "pm_stem" does not exist.', 3423, $this->source); })()), (isset($context["pm_stems"]) || array_key_exists("pm_stems", $context) ? $context["pm_stems"] : (function () { throw new RuntimeError('Variable "pm_stems" does not exist.', 3423, $this->source); })()))) {
$context["pm_stems"] = twig_array_merge((isset($context["pm_stems"]) || array_key_exists("pm_stems", $context) ? $context["pm_stems"] : (function () { throw new RuntimeError('Variable "pm_stems" does not exist.', 3423, $this->source); })()), [0 => (isset($context["pm_stem"]) || array_key_exists("pm_stem", $context) ? $context["pm_stem"] : (function () { throw new RuntimeError('Variable "pm_stem" does not exist.', 3423, $this->source); })())]);
}
// line 3424
echo " ";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['v'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
}
// line 3425
echo " ";
$context["pm_label"] = (((isset($context["pm_is_roof"]) || array_key_exists("pm_is_roof", $context) ? $context["pm_is_roof"] : (function () { throw new RuntimeError('Variable "pm_is_roof" does not exist.', 3425, $this->source); })())) ? ((((twig_length_filter($this->env, (isset($context["pm_stems"]) || array_key_exists("pm_stems", $context) ? $context["pm_stems"] : (function () { throw new RuntimeError('Variable "pm_stems" does not exist.', 3425, $this->source); })())) >= 2)) ? ("屋根材") : ("屋根材の色"))) : ("素材"));
// line 3426
echo " <div class=\"ec-productRole\" style=\"margin-top:20px;\">
<div class=\"ec-grid2\">
<div class=\"ec-grid2__cell\">
<div class=\"ec-sliderItemRole\">
\t ";
// line 3431
echo "\t <div class=\"ec-productRole__title\">
\t <div class=\"ec-productRole__titleRow\">
\t <h2 class=\"ec-headingTitle\">";
// line 3433
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3433, $this->source); })()), "name", [], "any", false, false, false, 3433), "html", null, true);
echo "</h2>
\t <div class=\"ec-share-inline\">
\t <a href=\"https://twitter.com/share?url=";
// line 3435
echo twig_escape_filter($this->env, twig_urlencode_filter(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 3435, $this->source); })()), "request", [], "any", false, false, false, 3435), "uri", [], "any", false, false, false, 3435)), "html", null, true);
echo "&text=";
echo twig_escape_filter($this->env, twig_urlencode_filter(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3435, $this->source); })()), "name", [], "any", false, false, false, 3435)), "html", null, true);
echo "\"
\t class=\"share-twitter\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"Xでシェア\">
\t <svg viewBox=\"0 0 24 24\" style=\"width:15px;height:15px;fill:#fff;\"><path d=\"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-4.714-6.231-5.401 6.231H2.74l7.73-8.835L1.254 2.25H8.08l4.254 5.622L18.244 2.25zm-1.161 17.52h1.833L7.084 4.126H5.117z\"/></svg>
\t </a>
\t <a href=\"https://www.instagram.com/\" class=\"share-facebook\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"Instagram\">
\t <svg viewBox=\"0 0 24 24\" style=\"width:15px;height:15px;fill:#fff;\"><path d=\"M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zM12 0C8.741 0 8.333.014 7.053.072 2.695.272.273 2.69.073 7.052.014 8.333 0 8.741 0 12c0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98C8.333 23.986 8.741 24 12 24c3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98C15.668.014 15.259 0 12 0zm0 5.838a6.162 6.162 0 100 12.324 6.162 6.162 0 000-12.324zM12 16a4 4 0 110-8 4 4 0 010 8zm6.406-11.845a1.44 1.44 0 100 2.881 1.44 1.44 0 000-2.881z\"/></svg>
\t </a>
\t <a href=\"https://social-plugins.line.me/lineit/share?url=";
// line 3442
echo twig_escape_filter($this->env, twig_urlencode_filter(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 3442, $this->source); })()), "request", [], "any", false, false, false, 3442), "uri", [], "any", false, false, false, 3442)), "html", null, true);
echo "\"
\t class=\"share-line\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"LINEでシェア\">
\t <i class=\"fab fa-line\"></i>
\t </a>
\t </div>
\t </div>
\t </div>
";
// line 3449
if (twig_get_attribute($this->env, $this->source, (isset($context["BaseInfo"]) || array_key_exists("BaseInfo", $context) ? $context["BaseInfo"] : (function () { throw new RuntimeError('Variable "BaseInfo" does not exist.', 3449, $this->source); })()), "option_favorite_product", [], "any", false, false, false, 3449)) {
// line 3450
echo " <div style=\"position:relative;top: 20px;left: 10px;z-index:100;\">
\t\t\t\t\t\t";
// line 3451
if (((isset($context["is_favorite"]) || array_key_exists("is_favorite", $context) ? $context["is_favorite"] : (function () { throw new RuntimeError('Variable "is_favorite" does not exist.', 3451, $this->source); })()) == false)) {
// line 3452
echo " <form action=\"";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("product_add_favorite", ["id" => twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3452, $this->source); })()), "id", [], "any", false, false, false, 3452)]), "html", null, true);
echo "\" method=\"post\">
<button type=\"submit\" id=\"favorite\" class=\"favorite\">♡</button>
</form>
";
} else {
// line 3456
echo " <form action=\"";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("product_add_favorite", ["id" => twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3456, $this->source); })()), "id", [], "any", false, false, false, 3456)]), "html", null, true);
echo "\" method=\"post\">
<button type=\"submit\" id=\"favorite\" class=\"favorite\" style=\"color:red;\">♥</button>
</form>
";
}
// line 3460
echo " </div>
";
}
// line 3462
echo " <div class=\"item_visual\">
";
// line 3463
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3463, $this->source); })()), "ProductImage", [], "any", false, false, false, 3463));
$context['_iterated'] = false;
$context['loop'] = [
'parent' => $context['_parent'],
'index0' => 0,
'index' => 1,
'first' => true,
];
if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
$length = count($context['_seq']);
$context['loop']['revindex0'] = $length - 1;
$context['loop']['revindex'] = $length;
$context['loop']['length'] = $length;
$context['loop']['last'] = 1 === $length;
}
foreach ($context['_seq'] as $context["_key"] => $context["ProductImage"]) {
// line 3464
echo " <div class=\"slide-item\">
<a class=\"js-zoom\" href=\"";
// line 3465
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl($context["ProductImage"], "save_image"), "html", null, true);
echo "\" aria-label=\"";
((twig_get_attribute($this->env, $this->source, $context["loop"], "first", [], "any", false, false, false, 3465)) ? (print (twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3465, $this->source); })()), "name", [], "any", false, false, false, 3465), "html", null, true))) : (print ("")));
echo "\">
<img src=\"";
// line 3466
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl($context["ProductImage"], "save_image"), "html", null, true);
echo "\" alt=\"";
((twig_get_attribute($this->env, $this->source, $context["loop"], "first", [], "any", false, false, false, 3466)) ? (print (twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3466, $this->source); })()), "name", [], "any", false, false, false, 3466), "html", null, true))) : (print ("")));
echo "\" width=\"550\" height=\"550\" style=\"max-height: 400px;\"";
if ((twig_get_attribute($this->env, $this->source, $context["loop"], "index", [], "any", false, false, false, 3466) > 1)) {
echo " loading=\"lazy\"";
}
echo ">
</a>
</div>
";
$context['_iterated'] = true;
++$context['loop']['index0'];
++$context['loop']['index'];
$context['loop']['first'] = false;
if (isset($context['loop']['length'])) {
--$context['loop']['revindex0'];
--$context['loop']['revindex'];
$context['loop']['last'] = 0 === $context['loop']['revindex0'];
}
}
if (!$context['_iterated']) {
// line 3470
echo " <div class=\"slide-item\"><img src=\"";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl($this->extensions['Eccube\Twig\Extension\EccubeExtension']->getNoImageProduct(""), "save_image"), "html", null, true);
echo "\" alt=\"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3470, $this->source); })()), "name", [], "any", false, false, false, 3470), "html", null, true);
echo "\" width=\"550\" height=\"550\" style=\"max-height: 400px;\"></div>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['ProductImage'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 3472
echo " </div>
<div class=\"item_nav\">
";
// line 3474
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3474, $this->source); })()), "ProductImage", [], "any", false, false, false, 3474));
$context['loop'] = [
'parent' => $context['_parent'],
'index0' => 0,
'index' => 1,
'first' => true,
];
if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
$length = count($context['_seq']);
$context['loop']['revindex0'] = $length - 1;
$context['loop']['revindex'] = $length;
$context['loop']['length'] = $length;
$context['loop']['last'] = 1 === $length;
}
foreach ($context['_seq'] as $context["_key"] => $context["ProductImage"]) {
// line 3475
echo " <div class=\"slideThumb\" data-index=\"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["loop"], "index0", [], "any", false, false, false, 3475), "html", null, true);
echo "\"><img src=\"";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl($context["ProductImage"], "save_image"), "html", null, true);
echo "\" alt=\"\" width=\"80\" height=\"80\" loading=\"lazy\"></div>
";
++$context['loop']['index0'];
++$context['loop']['index'];
$context['loop']['first'] = false;
if (isset($context['loop']['length'])) {
--$context['loop']['revindex0'];
--$context['loop']['revindex'];
$context['loop']['last'] = 0 === $context['loop']['revindex0'];
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['ProductImage'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 3477
echo " </div>
</div>
";
// line 3482
echo " <div class=\"ec-areaNotice\" style=\"margin-top:16px;margin-right:10px;\">
<div class=\"ec-areaNotice__inner\">
<div class=\"ec-areaNotice__icon\">📍</div>
<div class=\"ec-areaNotice__body\">
<p class=\"ec-areaNotice__title\">施工対応エリアについて</p>
<div class=\"ec-areaNotice__detail\">
<p class=\"ec-areaNotice__text\">
当店の施工サービスは、<strong>山梨県全域</strong>および<br>
<strong>諏訪エリア(諏訪市・岡谷市・茅野市・諏訪郡)</strong>を対象としております。<br>
上記エリア外のお客様には、商品のみのご購入が可能でございます。<br>
ご不明な点がございましたら、お気軽にお問い合わせください。
</p>
<a class=\"ec-areaNotice__link\" href=\"";
// line 3494
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("contact");
echo "\">エリア外のお客様・ご相談はこちら →</a>
</div>
</div>
</div>
</div>
</div>
<div class=\"ec-grid2__cell2\">
<div class=\"ec-productRole__profile\" >
";
// line 3505
echo " ";
$context["hidden_cat_ids"] = [0 => 21, 1 => 28, 2 => 44];
// line 3506
echo " ";
if ( !twig_test_empty(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3506, $this->source); })()), "ProductCategories", [], "any", false, false, false, 3506))) {
// line 3507
echo " <div class=\"ec-productRole__category\" style=\"padding:10px 0;\">
";
// line 3508
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3508, $this->source); })()), "ProductCategories", [], "any", false, false, false, 3508));
foreach ($context['_seq'] as $context["_key"] => $context["ProductCategory"]) {
// line 3509
echo " ";
if (!twig_in_filter(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["ProductCategory"], "Category", [], "any", false, false, false, 3509), "id", [], "any", false, false, false, 3509), (isset($context["hidden_cat_ids"]) || array_key_exists("hidden_cat_ids", $context) ? $context["hidden_cat_ids"] : (function () { throw new RuntimeError('Variable "hidden_cat_ids" does not exist.', 3509, $this->source); })()))) {
// line 3510
echo " <ul>
<li>
";
// line 3512
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, $context["ProductCategory"], "Category", [], "any", false, false, false, 3512), "path", [], "any", false, false, false, 3512));
$context['loop'] = [
'parent' => $context['_parent'],
'index0' => 0,
'index' => 1,
'first' => true,
];
if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
$length = count($context['_seq']);
$context['loop']['revindex0'] = $length - 1;
$context['loop']['revindex'] = $length;
$context['loop']['length'] = $length;
$context['loop']['last'] = 1 === $length;
}
foreach ($context['_seq'] as $context["_key"] => $context["Category"]) {
// line 3513
echo " <a href=\"";
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("product_list");
echo "?category_id=";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["Category"], "id", [], "any", false, false, false, 3513), "html", null, true);
echo "\">";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["Category"], "name", [], "any", false, false, false, 3513), "html", null, true);
echo "</a>";
if ((twig_get_attribute($this->env, $this->source, $context["loop"], "last", [], "any", false, false, false, 3513) == false)) {
// line 3514
echo " <span>></span>";
}
++$context['loop']['index0'];
++$context['loop']['index'];
$context['loop']['first'] = false;
if (isset($context['loop']['length'])) {
--$context['loop']['revindex0'];
--$context['loop']['revindex'];
$context['loop']['last'] = 0 === $context['loop']['revindex0'];
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['Category'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 3516
echo " </li>
</ul>
";
}
// line 3519
echo " ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['ProductCategory'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 3520
echo " </div>
";
}
// line 3522
echo " ";
// line 3523
echo " <div class=\"ec-productRole__price\">
\t\t\t\t\t\t<span style=\"color:black;font-size:15px;\">工事費込み価格</span>
";
// line 3526
echo " ";
if (twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3526, $this->source); })()), "hasProductClass", [], "any", false, false, false, 3526)) {
// line 3527
if ((twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3527, $this->source); })()), "getPrice02Min", [], "any", false, false, false, 3527) == twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3527, $this->source); })()), "getPrice02Max", [], "any", false, false, false, 3527))) {
// line 3528
echo " <div class=\"ec-price\">
<span id=\"price02-display\" class=\"ec-price__price price02-default\">";
// line 3529
echo twig_escape_filter($this->env, $this->extensions['Eccube\Twig\Extension\EccubeExtension']->getPriceFilter(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3529, $this->source); })()), "getPrice02Min", [], "any", false, false, false, 3529)), "html", null, true);
echo "</span>
<span class=\"ec-price__tax\">(税抜)~</span>
</div>
";
} else {
// line 3533
echo " <div class=\"ec-price\">
<span id=\"price02-display\" class=\"ec-price__price price02-default\">";
// line 3534
echo twig_escape_filter($this->env, $this->extensions['Eccube\Twig\Extension\EccubeExtension']->getPriceFilter(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3534, $this->source); })()), "getPrice02Min", [], "any", false, false, false, 3534)), "html", null, true);
echo " ~ ";
echo twig_escape_filter($this->env, $this->extensions['Eccube\Twig\Extension\EccubeExtension']->getPriceFilter(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3534, $this->source); })()), "getPrice02Max", [], "any", false, false, false, 3534)), "html", null, true);
echo "</span>
<span class=\"ec-price__tax\">(税抜)</span>
</div>
";
}
// line 3538
echo " ";
} else {
// line 3539
echo " <div class=\"ec-price\">
<span id=\"price02-display\" class=\"ec-price__price\">";
// line 3540
echo twig_escape_filter($this->env, $this->extensions['Eccube\Twig\Extension\EccubeExtension']->getPriceFilter(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3540, $this->source); })()), "getPrice02Min", [], "any", false, false, false, 3540)), "html", null, true);
echo "</span>
<span class=\"ec-price__tax\">(税抜)~</span>
</div>
";
}
// line 3544
echo " </div>
";
// line 3546
echo " <ul class=\"ec-productRole__tags\">
";
// line 3547
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3547, $this->source); })()), "Tags", [], "any", false, false, false, 3547));
foreach ($context['_seq'] as $context["_key"] => $context["Tag"]) {
// line 3548
echo " <li class=\"ec-productRole__tag tag_";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["Tag"], "id", [], "any", false, false, false, 3548), "html", null, true);
echo "\">";
echo twig_escape_filter($this->env, $context["Tag"], "html", null, true);
echo "</li>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['Tag'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 3550
echo " </ul>
";
// line 3552
echo " ";
if ( !twig_test_empty(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3552, $this->source); })()), "code_min", [], "any", false, false, false, 3552))) {
// line 3553
echo " <div class=\"ec-productRole__code\">
";
// line 3554
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("商品コード"), "html", null, true);
echo ": <span class=\"product-code-default\">";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3554, $this->source); })()), "code_min", [], "any", false, false, false, 3554), "html", null, true);
if ((twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3554, $this->source); })()), "code_min", [], "any", false, false, false, 3554) != twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3554, $this->source); })()), "code_max", [], "any", false, false, false, 3554))) {
echo " ~ ";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3554, $this->source); })()), "code_max", [], "any", false, false, false, 3554), "html", null, true);
}
echo "</span>
</div>
";
}
// line 3557
echo "
<div class=\"ec-productRole__description\">
\t\t\t\t <div class=\"ec-rectHeading\">
\t\t\t\t <h4>製品情報</h4>
\t\t\t\t </div>
\t\t\t\t\t\t";
// line 3562
echo twig_nl2br(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3562, $this->source); })()), "sales_infomation", [], "any", false, false, false, 3562));
echo "
</div>
";
// line 3568
echo " ";
$context["SetItems"] = $this->extensions['Customize\Util\JsonExtension']->jsonDecode(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3568, $this->source); })()), "list_spec", [], "any", false, false, false, 3568));
// line 3569
echo " ";
if ((((isset($context["SetItems"]) || array_key_exists("SetItems", $context) ? $context["SetItems"] : (function () { throw new RuntimeError('Variable "SetItems" does not exist.', 3569, $this->source); })()) && twig_get_attribute($this->env, $this->source, ($context["SetItems"] ?? null), "items", [], "any", true, true, false, 3569)) && !twig_test_empty(twig_get_attribute($this->env, $this->source, (isset($context["SetItems"]) || array_key_exists("SetItems", $context) ? $context["SetItems"] : (function () { throw new RuntimeError('Variable "SetItems" does not exist.', 3569, $this->source); })()), "items", [], "any", false, false, false, 3569)))) {
// line 3570
echo " <div class=\"ec-productRole__setItems\">
<div class=\"ec-rectHeading\">
<h4>";
// line 3572
echo twig_escape_filter($this->env, ((twig_get_attribute($this->env, $this->source, ($context["SetItems"] ?? null), "title", [], "any", true, true, false, 3572)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["SetItems"] ?? null), "title", [], "any", false, false, false, 3572), "この商品の構成セット内容(メーカーカタログ価格)")) : ("この商品の構成セット内容(メーカーカタログ価格)")), "html", null, true);
echo "</h4>
</div>
<table class=\"set-items-table\">
<tbody>
";
// line 3576
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, (isset($context["SetItems"]) || array_key_exists("SetItems", $context) ? $context["SetItems"] : (function () { throw new RuntimeError('Variable "SetItems" does not exist.', 3576, $this->source); })()), "items", [], "any", false, false, false, 3576));
foreach ($context['_seq'] as $context["_key"] => $context["SetItem"]) {
// line 3577
echo " <tr>
<th>";
// line 3578
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["SetItem"], "name", [], "any", false, false, false, 3578), "html", null, true);
echo "</th>
<td>";
// line 3579
if ( !twig_test_empty(twig_get_attribute($this->env, $this->source, $context["SetItem"], "price", [], "any", false, false, false, 3579))) {
echo twig_escape_filter($this->env, $this->extensions['Eccube\Twig\Extension\EccubeExtension']->getPriceFilter(twig_get_attribute($this->env, $this->source, $context["SetItem"], "price", [], "any", false, false, false, 3579)), "html", null, true);
}
echo "</td>
</tr>
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['SetItem'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 3582
echo " </tbody>
";
// line 3583
if ( !twig_test_empty(twig_get_attribute($this->env, $this->source, (isset($context["SetItems"]) || array_key_exists("SetItems", $context) ? $context["SetItems"] : (function () { throw new RuntimeError('Variable "SetItems" does not exist.', 3583, $this->source); })()), "total", [], "any", false, false, false, 3583))) {
// line 3584
echo " <tfoot>
<tr>
<th>構成セット価格(メーカーカタログ価格)</th>
<td>";
// line 3587
echo twig_escape_filter($this->env, $this->extensions['Eccube\Twig\Extension\EccubeExtension']->getPriceFilter(twig_get_attribute($this->env, $this->source, (isset($context["SetItems"]) || array_key_exists("SetItems", $context) ? $context["SetItems"] : (function () { throw new RuntimeError('Variable "SetItems" does not exist.', 3587, $this->source); })()), "total", [], "any", false, false, false, 3587)), "html", null, true);
echo "</td>
</tr>
</tfoot>
";
}
// line 3591
echo " </table>
</div>
";
}
// line 3594
echo "
";
// line 3596
echo " ";
if (( !twig_test_empty(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3596, $this->source); })()), "maker_url", [], "any", false, false, false, 3596)) && !twig_in_filter("ex-shop.net", twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3596, $this->source); })()), "maker_url", [], "any", false, false, false, 3596)))) {
// line 3597
echo " <div class=\"ec-productRole__catalog\" style=\"margin:8px 0;\">
<a href=\"";
// line 3598
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3598, $this->source); })()), "maker_url", [], "any", false, false, false, 3598), "html", null, true);
echo "\" target=\"_blank\" rel=\"noopener noreferrer\">
<i class=\"far fa-file-alt\"></i> この商品のメーカーカタログを見る
</a>
</div>
";
}
// line 3603
echo "
\t\t\t\t\t<div class=\"card card-danger\" style=\"clear:both;margin:1px;\">
\t\t\t\t\t <div class=\"card-header\">
\t\t\t\t\t <h3 class=\"card-title\">見積シミュレーション</h3>
\t\t\t\t\t </div>
\t\t\t\t\t <div class=\"card-body p-2\">
";
// line 3610
$context["related_image"] = $this->extensions['Plugin\ProductField\Twig\Extension\EccubeExtension']->getProduct_field(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3610, $this->source); })()), "id", [], "any", false, false, false, 3610), "related_image");
// line 3611
echo " ";
// line 3612
echo " ";
$context["img1"] = ((isset($context["related_image"]) || array_key_exists("related_image", $context) ? $context["related_image"] : (function () { throw new RuntimeError('Variable "related_image" does not exist.', 3612, $this->source); })()) && twig_in_filter("1段目画像あり", (isset($context["related_image"]) || array_key_exists("related_image", $context) ? $context["related_image"] : (function () { throw new RuntimeError('Variable "related_image" does not exist.', 3612, $this->source); })())));
// line 3613
echo " ";
$context["img2"] = ((isset($context["related_image"]) || array_key_exists("related_image", $context) ? $context["related_image"] : (function () { throw new RuntimeError('Variable "related_image" does not exist.', 3613, $this->source); })()) && twig_in_filter("2段目画像あり", (isset($context["related_image"]) || array_key_exists("related_image", $context) ? $context["related_image"] : (function () { throw new RuntimeError('Variable "related_image" does not exist.', 3613, $this->source); })())));
// line 3614
echo " ";
$context["img3"] = ((isset($context["related_image"]) || array_key_exists("related_image", $context) ? $context["related_image"] : (function () { throw new RuntimeError('Variable "related_image" does not exist.', 3614, $this->source); })()) && twig_in_filter("3段目画像あり", (isset($context["related_image"]) || array_key_exists("related_image", $context) ? $context["related_image"] : (function () { throw new RuntimeError('Variable "related_image" does not exist.', 3614, $this->source); })())));
// line 3615
echo " ";
$context["img4"] = ((isset($context["related_image"]) || array_key_exists("related_image", $context) ? $context["related_image"] : (function () { throw new RuntimeError('Variable "related_image" does not exist.', 3615, $this->source); })()) && twig_in_filter("4段目画像あり", (isset($context["related_image"]) || array_key_exists("related_image", $context) ? $context["related_image"] : (function () { throw new RuntimeError('Variable "related_image" does not exist.', 3615, $this->source); })())));
// line 3616
echo "\t\t\t\t\t ";
$context["type1"] = $this->extensions['Plugin\ProductField\Twig\Extension\EccubeExtension']->getProduct_field(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3616, $this->source); })()), "id", [], "any", false, false, false, 3616), "related_name1");
// line 3617
echo "\t\t\t\t\t\t";
$context["type2"] = $this->extensions['Plugin\ProductField\Twig\Extension\EccubeExtension']->getProduct_field(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3617, $this->source); })()), "id", [], "any", false, false, false, 3617), "related_name2");
// line 3618
echo "\t\t\t\t\t\t";
$context["type3"] = $this->extensions['Plugin\ProductField\Twig\Extension\EccubeExtension']->getProduct_field(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3618, $this->source); })()), "id", [], "any", false, false, false, 3618), "related_name3");
// line 3619
echo "\t\t\t\t\t\t";
$context["type4"] = $this->extensions['Plugin\ProductField\Twig\Extension\EccubeExtension']->getProduct_field(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3619, $this->source); })()), "id", [], "any", false, false, false, 3619), "related_name4");
// line 3620
echo "\t\t\t\t\t\t";
$context["hasRelated"] = ((((((isset($context["type1"]) || array_key_exists("type1", $context) ? $context["type1"] : (function () { throw new RuntimeError('Variable "type1" does not exist.', 3620, $this->source); })()) && (isset($context["related_product1"]) || array_key_exists("related_product1", $context) ? $context["related_product1"] : (function () { throw new RuntimeError('Variable "related_product1" does not exist.', 3620, $this->source); })())) && twig_length_filter($this->env, (isset($context["related_product1"]) || array_key_exists("related_product1", $context) ? $context["related_product1"] : (function () { throw new RuntimeError('Variable "related_product1" does not exist.', 3620, $this->source); })()))) || (( // line 3621
(isset($context["type2"]) || array_key_exists("type2", $context) ? $context["type2"] : (function () { throw new RuntimeError('Variable "type2" does not exist.', 3621, $this->source); })()) && (isset($context["related_product2"]) || array_key_exists("related_product2", $context) ? $context["related_product2"] : (function () { throw new RuntimeError('Variable "related_product2" does not exist.', 3621, $this->source); })())) && twig_length_filter($this->env, (isset($context["related_product2"]) || array_key_exists("related_product2", $context) ? $context["related_product2"] : (function () { throw new RuntimeError('Variable "related_product2" does not exist.', 3621, $this->source); })())))) || (( // line 3622
(isset($context["type3"]) || array_key_exists("type3", $context) ? $context["type3"] : (function () { throw new RuntimeError('Variable "type3" does not exist.', 3622, $this->source); })()) && (isset($context["related_product3"]) || array_key_exists("related_product3", $context) ? $context["related_product3"] : (function () { throw new RuntimeError('Variable "related_product3" does not exist.', 3622, $this->source); })())) && twig_length_filter($this->env, (isset($context["related_product3"]) || array_key_exists("related_product3", $context) ? $context["related_product3"] : (function () { throw new RuntimeError('Variable "related_product3" does not exist.', 3622, $this->source); })())))) || (( // line 3623
(isset($context["type4"]) || array_key_exists("type4", $context) ? $context["type4"] : (function () { throw new RuntimeError('Variable "type4" does not exist.', 3623, $this->source); })()) && (isset($context["related_product4"]) || array_key_exists("related_product4", $context) ? $context["related_product4"] : (function () { throw new RuntimeError('Variable "related_product4" does not exist.', 3623, $this->source); })())) && twig_length_filter($this->env, (isset($context["related_product4"]) || array_key_exists("related_product4", $context) ? $context["related_product4"] : (function () { throw new RuntimeError('Variable "related_product4" does not exist.', 3623, $this->source); })()))));
// line 3624
echo "\t\t\t\t\t\t";
if ((isset($context["hasRelated"]) || array_key_exists("hasRelated", $context) ? $context["hasRelated"] : (function () { throw new RuntimeError('Variable "hasRelated" does not exist.', 3624, $this->source); })())) {
// line 3625
echo "\t\t\t\t\t\t <div class=\"row\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\"><label class=\"col-12 col-form-label\">この商品のタイプを選択してください。</label></div>
\t\t\t\t\t\t";
}
// line 3627
echo "
\t\t\t\t\t\t";
// line 3629
echo "\t\t\t\t\t\t";
if ((((isset($context["type1"]) || array_key_exists("type1", $context) ? $context["type1"] : (function () { throw new RuntimeError('Variable "type1" does not exist.', 3629, $this->source); })()) && (isset($context["related_product1"]) || array_key_exists("related_product1", $context) ? $context["related_product1"] : (function () { throw new RuntimeError('Variable "related_product1" does not exist.', 3629, $this->source); })())) && twig_length_filter($this->env, (isset($context["related_product1"]) || array_key_exists("related_product1", $context) ? $context["related_product1"] : (function () { throw new RuntimeError('Variable "related_product1" does not exist.', 3629, $this->source); })())))) {
// line 3630
echo "\t\t\t\t\t\t<div class=\"form-group mt-3 pb-3\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t <div class=\"rp-section-label\">";
// line 3631
echo twig_escape_filter($this->env, (isset($context["type1"]) || array_key_exists("type1", $context) ? $context["type1"] : (function () { throw new RuntimeError('Variable "type1" does not exist.', 3631, $this->source); })()), "html", null, true);
if (((isset($context["img1"]) || array_key_exists("img1", $context) ? $context["img1"] : (function () { throw new RuntimeError('Variable "img1" does not exist.', 3631, $this->source); })()) && (isset($context["base_select1"]) || array_key_exists("base_select1", $context) ? $context["base_select1"] : (function () { throw new RuntimeError('Variable "base_select1" does not exist.', 3631, $this->source); })()))) {
echo ": <span>";
echo twig_escape_filter($this->env, (isset($context["base_select1"]) || array_key_exists("base_select1", $context) ? $context["base_select1"] : (function () { throw new RuntimeError('Variable "base_select1" does not exist.', 3631, $this->source); })()), "html", null, true);
echo "</span>";
}
echo "</div>
\t\t\t\t\t\t ";
// line 3632
if ((isset($context["img1"]) || array_key_exists("img1", $context) ? $context["img1"] : (function () { throw new RuntimeError('Variable "img1" does not exist.', 3632, $this->source); })())) {
// line 3633
echo "\t\t\t\t\t\t ";
// line 3634
echo "\t\t\t\t\t\t <div class=\"rp-card-group\">
\t\t\t\t\t\t ";
// line 3635
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["related_product1"]) || array_key_exists("related_product1", $context) ? $context["related_product1"] : (function () { throw new RuntimeError('Variable "related_product1" does not exist.', 3635, $this->source); })()));
foreach ($context['_seq'] as $context["rp_id"] => $context["rp_name"]) {
// line 3636
echo "\t\t\t\t\t\t <a class=\"rp-card";
if (((isset($context["base_select1"]) || array_key_exists("base_select1", $context) ? $context["base_select1"] : (function () { throw new RuntimeError('Variable "base_select1" does not exist.', 3636, $this->source); })()) == $context["rp_name"])) {
echo " is-selected";
}
echo "\" href=\"/products/detail/";
echo twig_escape_filter($this->env, $context["rp_id"], "html", null, true);
echo "\">
\t\t\t\t\t\t <img class=\"rp-card__image\"
\t\t\t\t\t\t src=\"";
// line 3638
echo twig_escape_filter($this->env, (((twig_get_attribute($this->env, $this->source, ($context["related_image_obj"] ?? null), $context["rp_id"], [], "array", true, true, false, 3638) && twig_get_attribute($this->env, $this->source, (isset($context["related_image_obj"]) || array_key_exists("related_image_obj", $context) ? $context["related_image_obj"] : (function () { throw new RuntimeError('Variable "related_image_obj" does not exist.', 3638, $this->source); })()), $context["rp_id"], [], "array", false, false, false, 3638))) ? ($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl(twig_get_attribute($this->env, $this->source, (isset($context["related_image_obj"]) || array_key_exists("related_image_obj", $context) ? $context["related_image_obj"] : (function () { throw new RuntimeError('Variable "related_image_obj" does not exist.', 3638, $this->source); })()), $context["rp_id"], [], "array", false, false, false, 3638), "save_image")) : ($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl($this->extensions['Eccube\Twig\Extension\EccubeExtension']->getNoImageProduct(""), "save_image"))), "html", null, true);
echo "\"
\t\t\t\t\t\t alt=\"";
// line 3639
echo twig_escape_filter($this->env, $context["rp_name"], "html", null, true);
echo "\"
\t\t\t\t\t\t width=\"120\" height=\"120\" loading=\"lazy\"
\t\t\t\t\t\t onerror=\"this.style.display='none';this.nextElementSibling.style.display='flex';\">
\t\t\t\t\t\t <div class=\"rp-card__placeholder\" style=\"display:none;\">📦</div>
\t\t\t\t\t\t <span class=\"rp-card__name\">";
// line 3643
echo twig_escape_filter($this->env, $context["rp_name"], "html", null, true);
echo "</span>
\t\t\t\t\t\t </a>
\t\t\t\t\t\t ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['rp_id'], $context['rp_name'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 3646
echo "\t\t\t\t\t\t </div>
\t\t\t\t\t\t ";
} else {
// line 3648
echo "\t\t\t\t\t\t ";
// line 3649
echo "\t\t\t\t\t\t <div class=\"rp-btn-group\">
\t\t\t\t\t\t ";
// line 3650
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["related_product1"]) || array_key_exists("related_product1", $context) ? $context["related_product1"] : (function () { throw new RuntimeError('Variable "related_product1" does not exist.', 3650, $this->source); })()));
foreach ($context['_seq'] as $context["rp_id"] => $context["rp_name"]) {
// line 3651
echo "\t\t\t\t\t\t <a class=\"rp-btn";
if (((isset($context["base_select1"]) || array_key_exists("base_select1", $context) ? $context["base_select1"] : (function () { throw new RuntimeError('Variable "base_select1" does not exist.', 3651, $this->source); })()) == $context["rp_name"])) {
echo " is-selected";
}
echo "\" href=\"/products/detail/";
echo twig_escape_filter($this->env, $context["rp_id"], "html", null, true);
echo "\">
\t\t\t\t\t\t ";
// line 3652
echo twig_escape_filter($this->env, $context["rp_name"], "html", null, true);
echo "
\t\t\t\t\t\t </a>
\t\t\t\t\t\t ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['rp_id'], $context['rp_name'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 3655
echo "\t\t\t\t\t\t </div>
\t\t\t\t\t\t ";
}
// line 3657
echo "\t\t\t\t\t\t</div>
\t\t\t\t\t\t";
}
// line 3659
echo "
\t\t\t\t\t\t";
// line 3661
echo "\t\t\t\t\t\t";
if ((((isset($context["type2"]) || array_key_exists("type2", $context) ? $context["type2"] : (function () { throw new RuntimeError('Variable "type2" does not exist.', 3661, $this->source); })()) && (isset($context["related_product2"]) || array_key_exists("related_product2", $context) ? $context["related_product2"] : (function () { throw new RuntimeError('Variable "related_product2" does not exist.', 3661, $this->source); })())) && twig_length_filter($this->env, (isset($context["related_product2"]) || array_key_exists("related_product2", $context) ? $context["related_product2"] : (function () { throw new RuntimeError('Variable "related_product2" does not exist.', 3661, $this->source); })())))) {
// line 3662
echo "\t\t\t\t\t\t<div class=\"form-group mt-3 pb-3\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t <div class=\"rp-section-label\">";
// line 3663
echo twig_escape_filter($this->env, (isset($context["type2"]) || array_key_exists("type2", $context) ? $context["type2"] : (function () { throw new RuntimeError('Variable "type2" does not exist.', 3663, $this->source); })()), "html", null, true);
if (((isset($context["img2"]) || array_key_exists("img2", $context) ? $context["img2"] : (function () { throw new RuntimeError('Variable "img2" does not exist.', 3663, $this->source); })()) && (isset($context["base_select2"]) || array_key_exists("base_select2", $context) ? $context["base_select2"] : (function () { throw new RuntimeError('Variable "base_select2" does not exist.', 3663, $this->source); })()))) {
echo ": <span>";
echo twig_escape_filter($this->env, (isset($context["base_select2"]) || array_key_exists("base_select2", $context) ? $context["base_select2"] : (function () { throw new RuntimeError('Variable "base_select2" does not exist.', 3663, $this->source); })()), "html", null, true);
echo "</span>";
}
echo "</div>
\t\t\t\t\t\t ";
// line 3664
if ((isset($context["img2"]) || array_key_exists("img2", $context) ? $context["img2"] : (function () { throw new RuntimeError('Variable "img2" does not exist.', 3664, $this->source); })())) {
// line 3665
echo "\t\t\t\t\t\t <div class=\"rp-card-group\">
\t\t\t\t\t\t ";
// line 3666
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["related_product2"]) || array_key_exists("related_product2", $context) ? $context["related_product2"] : (function () { throw new RuntimeError('Variable "related_product2" does not exist.', 3666, $this->source); })()));
foreach ($context['_seq'] as $context["rp_id"] => $context["rp_name"]) {
// line 3667
echo "\t\t\t\t\t\t <a class=\"rp-card";
if (((isset($context["base_select2"]) || array_key_exists("base_select2", $context) ? $context["base_select2"] : (function () { throw new RuntimeError('Variable "base_select2" does not exist.', 3667, $this->source); })()) == $context["rp_name"])) {
echo " is-selected";
}
echo "\" href=\"/products/detail/";
echo twig_escape_filter($this->env, $context["rp_id"], "html", null, true);
echo "\">
\t\t\t\t\t\t <img class=\"rp-card__image\"
\t\t\t\t\t\t src=\"";
// line 3669
echo twig_escape_filter($this->env, (((twig_get_attribute($this->env, $this->source, ($context["related_image_obj"] ?? null), $context["rp_id"], [], "array", true, true, false, 3669) && twig_get_attribute($this->env, $this->source, (isset($context["related_image_obj"]) || array_key_exists("related_image_obj", $context) ? $context["related_image_obj"] : (function () { throw new RuntimeError('Variable "related_image_obj" does not exist.', 3669, $this->source); })()), $context["rp_id"], [], "array", false, false, false, 3669))) ? ($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl(twig_get_attribute($this->env, $this->source, (isset($context["related_image_obj"]) || array_key_exists("related_image_obj", $context) ? $context["related_image_obj"] : (function () { throw new RuntimeError('Variable "related_image_obj" does not exist.', 3669, $this->source); })()), $context["rp_id"], [], "array", false, false, false, 3669), "save_image")) : ($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl($this->extensions['Eccube\Twig\Extension\EccubeExtension']->getNoImageProduct(""), "save_image"))), "html", null, true);
echo "\"
\t\t\t\t\t\t alt=\"";
// line 3670
echo twig_escape_filter($this->env, $context["rp_name"], "html", null, true);
echo "\"
\t\t\t\t\t\t width=\"120\" height=\"120\" loading=\"lazy\"
\t\t\t\t\t\t onerror=\"this.style.display='none';this.nextElementSibling.style.display='flex';\">
\t\t\t\t\t\t <div class=\"rp-card__placeholder\" style=\"display:none;\">📦</div>
\t\t\t\t\t\t <span class=\"rp-card__name\">";
// line 3674
echo twig_escape_filter($this->env, $context["rp_name"], "html", null, true);
echo "</span>
\t\t\t\t\t\t </a>
\t\t\t\t\t\t ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['rp_id'], $context['rp_name'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 3677
echo "\t\t\t\t\t\t </div>
\t\t\t\t\t\t ";
} else {
// line 3679
echo "\t\t\t\t\t\t <div class=\"rp-btn-group\">
\t\t\t\t\t\t ";
// line 3680
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["related_product2"]) || array_key_exists("related_product2", $context) ? $context["related_product2"] : (function () { throw new RuntimeError('Variable "related_product2" does not exist.', 3680, $this->source); })()));
foreach ($context['_seq'] as $context["rp_id"] => $context["rp_name"]) {
// line 3681
echo "\t\t\t\t\t\t <a class=\"rp-btn";
if (((isset($context["base_select2"]) || array_key_exists("base_select2", $context) ? $context["base_select2"] : (function () { throw new RuntimeError('Variable "base_select2" does not exist.', 3681, $this->source); })()) == $context["rp_name"])) {
echo " is-selected";
}
echo "\" href=\"/products/detail/";
echo twig_escape_filter($this->env, $context["rp_id"], "html", null, true);
echo "\">
\t\t\t\t\t\t ";
// line 3682
echo twig_escape_filter($this->env, $context["rp_name"], "html", null, true);
echo "
\t\t\t\t\t\t </a>
\t\t\t\t\t\t ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['rp_id'], $context['rp_name'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 3685
echo "\t\t\t\t\t\t </div>
\t\t\t\t\t\t ";
}
// line 3687
echo "\t\t\t\t\t\t</div>
\t\t\t\t\t\t";
}
// line 3689
echo "
\t\t\t\t\t\t";
// line 3691
echo "\t\t\t\t\t\t";
if ((((isset($context["type3"]) || array_key_exists("type3", $context) ? $context["type3"] : (function () { throw new RuntimeError('Variable "type3" does not exist.', 3691, $this->source); })()) && (isset($context["related_product3"]) || array_key_exists("related_product3", $context) ? $context["related_product3"] : (function () { throw new RuntimeError('Variable "related_product3" does not exist.', 3691, $this->source); })())) && twig_length_filter($this->env, (isset($context["related_product3"]) || array_key_exists("related_product3", $context) ? $context["related_product3"] : (function () { throw new RuntimeError('Variable "related_product3" does not exist.', 3691, $this->source); })())))) {
// line 3692
echo "\t\t\t\t\t\t<div class=\"form-group mt-3 pb-3\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t <div class=\"rp-section-label\">";
// line 3693
echo twig_escape_filter($this->env, (isset($context["type3"]) || array_key_exists("type3", $context) ? $context["type3"] : (function () { throw new RuntimeError('Variable "type3" does not exist.', 3693, $this->source); })()), "html", null, true);
if (((isset($context["img3"]) || array_key_exists("img3", $context) ? $context["img3"] : (function () { throw new RuntimeError('Variable "img3" does not exist.', 3693, $this->source); })()) && (isset($context["base_select3"]) || array_key_exists("base_select3", $context) ? $context["base_select3"] : (function () { throw new RuntimeError('Variable "base_select3" does not exist.', 3693, $this->source); })()))) {
echo ": <span>";
echo twig_escape_filter($this->env, (isset($context["base_select3"]) || array_key_exists("base_select3", $context) ? $context["base_select3"] : (function () { throw new RuntimeError('Variable "base_select3" does not exist.', 3693, $this->source); })()), "html", null, true);
echo "</span>";
}
echo "</div>
\t\t\t\t\t\t ";
// line 3694
if ((isset($context["img3"]) || array_key_exists("img3", $context) ? $context["img3"] : (function () { throw new RuntimeError('Variable "img3" does not exist.', 3694, $this->source); })())) {
// line 3695
echo "\t\t\t\t\t\t <div class=\"rp-card-group\">
\t\t\t\t\t\t ";
// line 3696
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["related_product3"]) || array_key_exists("related_product3", $context) ? $context["related_product3"] : (function () { throw new RuntimeError('Variable "related_product3" does not exist.', 3696, $this->source); })()));
foreach ($context['_seq'] as $context["rp_id"] => $context["rp_name"]) {
// line 3697
echo "\t\t\t\t\t\t <a class=\"rp-card";
if (((isset($context["base_select3"]) || array_key_exists("base_select3", $context) ? $context["base_select3"] : (function () { throw new RuntimeError('Variable "base_select3" does not exist.', 3697, $this->source); })()) == $context["rp_name"])) {
echo " is-selected";
}
echo "\" href=\"/products/detail/";
echo twig_escape_filter($this->env, $context["rp_id"], "html", null, true);
echo "\">
\t\t\t\t\t\t <img class=\"rp-card__image\"
\t\t\t\t\t\t src=\"";
// line 3699
echo twig_escape_filter($this->env, (((twig_get_attribute($this->env, $this->source, ($context["related_image_obj"] ?? null), $context["rp_id"], [], "array", true, true, false, 3699) && twig_get_attribute($this->env, $this->source, (isset($context["related_image_obj"]) || array_key_exists("related_image_obj", $context) ? $context["related_image_obj"] : (function () { throw new RuntimeError('Variable "related_image_obj" does not exist.', 3699, $this->source); })()), $context["rp_id"], [], "array", false, false, false, 3699))) ? ($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl(twig_get_attribute($this->env, $this->source, (isset($context["related_image_obj"]) || array_key_exists("related_image_obj", $context) ? $context["related_image_obj"] : (function () { throw new RuntimeError('Variable "related_image_obj" does not exist.', 3699, $this->source); })()), $context["rp_id"], [], "array", false, false, false, 3699), "save_image")) : ($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl($this->extensions['Eccube\Twig\Extension\EccubeExtension']->getNoImageProduct(""), "save_image"))), "html", null, true);
echo "\"
\t\t\t\t\t\t alt=\"";
// line 3700
echo twig_escape_filter($this->env, $context["rp_name"], "html", null, true);
echo "\"
\t\t\t\t\t\t width=\"120\" height=\"120\" loading=\"lazy\"
\t\t\t\t\t\t onerror=\"this.style.display='none';this.nextElementSibling.style.display='flex';\">
\t\t\t\t\t\t <div class=\"rp-card__placeholder\" style=\"display:none;\">📦</div>
\t\t\t\t\t\t <span class=\"rp-card__name\">";
// line 3704
echo twig_escape_filter($this->env, $context["rp_name"], "html", null, true);
echo "</span>
\t\t\t\t\t\t </a>
\t\t\t\t\t\t ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['rp_id'], $context['rp_name'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 3707
echo "\t\t\t\t\t\t </div>
\t\t\t\t\t\t ";
} else {
// line 3709
echo "\t\t\t\t\t\t <div class=\"rp-btn-group\">
\t\t\t\t\t\t ";
// line 3710
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["related_product3"]) || array_key_exists("related_product3", $context) ? $context["related_product3"] : (function () { throw new RuntimeError('Variable "related_product3" does not exist.', 3710, $this->source); })()));
foreach ($context['_seq'] as $context["rp_id"] => $context["rp_name"]) {
// line 3711
echo "\t\t\t\t\t\t <a class=\"rp-btn";
if (((isset($context["base_select3"]) || array_key_exists("base_select3", $context) ? $context["base_select3"] : (function () { throw new RuntimeError('Variable "base_select3" does not exist.', 3711, $this->source); })()) == $context["rp_name"])) {
echo " is-selected";
}
echo "\" href=\"/products/detail/";
echo twig_escape_filter($this->env, $context["rp_id"], "html", null, true);
echo "\">
\t\t\t\t\t\t ";
// line 3712
echo twig_escape_filter($this->env, $context["rp_name"], "html", null, true);
echo "
\t\t\t\t\t\t </a>
\t\t\t\t\t\t ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['rp_id'], $context['rp_name'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 3715
echo "\t\t\t\t\t\t </div>
\t\t\t\t\t\t ";
}
// line 3717
echo "\t\t\t\t\t\t</div>
\t\t\t\t\t\t";
}
// line 3719
echo "
\t\t\t\t\t\t";
// line 3721
echo "\t\t\t\t\t\t";
if ((((isset($context["type4"]) || array_key_exists("type4", $context) ? $context["type4"] : (function () { throw new RuntimeError('Variable "type4" does not exist.', 3721, $this->source); })()) && (isset($context["related_product4"]) || array_key_exists("related_product4", $context) ? $context["related_product4"] : (function () { throw new RuntimeError('Variable "related_product4" does not exist.', 3721, $this->source); })())) && twig_length_filter($this->env, (isset($context["related_product4"]) || array_key_exists("related_product4", $context) ? $context["related_product4"] : (function () { throw new RuntimeError('Variable "related_product4" does not exist.', 3721, $this->source); })())))) {
// line 3722
echo "\t\t\t\t\t\t<div class=\"form-group mt-3 pb-3\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t <div class=\"rp-section-label\">";
// line 3723
echo twig_escape_filter($this->env, (isset($context["type4"]) || array_key_exists("type4", $context) ? $context["type4"] : (function () { throw new RuntimeError('Variable "type4" does not exist.', 3723, $this->source); })()), "html", null, true);
if (((isset($context["img4"]) || array_key_exists("img4", $context) ? $context["img4"] : (function () { throw new RuntimeError('Variable "img4" does not exist.', 3723, $this->source); })()) && (isset($context["base_select4"]) || array_key_exists("base_select4", $context) ? $context["base_select4"] : (function () { throw new RuntimeError('Variable "base_select4" does not exist.', 3723, $this->source); })()))) {
echo ": <span>";
echo twig_escape_filter($this->env, (isset($context["base_select4"]) || array_key_exists("base_select4", $context) ? $context["base_select4"] : (function () { throw new RuntimeError('Variable "base_select4" does not exist.', 3723, $this->source); })()), "html", null, true);
echo "</span>";
}
echo "</div>
\t\t\t\t\t\t ";
// line 3724
if ((isset($context["img4"]) || array_key_exists("img4", $context) ? $context["img4"] : (function () { throw new RuntimeError('Variable "img4" does not exist.', 3724, $this->source); })())) {
// line 3725
echo "\t\t\t\t\t\t ";
// line 3726
echo "\t\t\t\t\t\t <div class=\"rp-card-group\">
\t\t\t\t\t\t ";
// line 3727
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["related_product4"]) || array_key_exists("related_product4", $context) ? $context["related_product4"] : (function () { throw new RuntimeError('Variable "related_product4" does not exist.', 3727, $this->source); })()));
foreach ($context['_seq'] as $context["rp_id"] => $context["rp_name"]) {
// line 3728
echo "\t\t\t\t\t\t <a class=\"rp-card";
if (((isset($context["base_select4"]) || array_key_exists("base_select4", $context) ? $context["base_select4"] : (function () { throw new RuntimeError('Variable "base_select4" does not exist.', 3728, $this->source); })()) == $context["rp_name"])) {
echo " is-selected";
}
echo "\" href=\"/products/detail/";
echo twig_escape_filter($this->env, $context["rp_id"], "html", null, true);
echo "\">
\t\t\t\t\t\t <img class=\"rp-card__image\"
\t\t\t\t\t\t src=\"";
// line 3730
echo twig_escape_filter($this->env, (((twig_get_attribute($this->env, $this->source, ($context["related_image_obj"] ?? null), $context["rp_id"], [], "array", true, true, false, 3730) && twig_get_attribute($this->env, $this->source, (isset($context["related_image_obj"]) || array_key_exists("related_image_obj", $context) ? $context["related_image_obj"] : (function () { throw new RuntimeError('Variable "related_image_obj" does not exist.', 3730, $this->source); })()), $context["rp_id"], [], "array", false, false, false, 3730))) ? ($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl(twig_get_attribute($this->env, $this->source, (isset($context["related_image_obj"]) || array_key_exists("related_image_obj", $context) ? $context["related_image_obj"] : (function () { throw new RuntimeError('Variable "related_image_obj" does not exist.', 3730, $this->source); })()), $context["rp_id"], [], "array", false, false, false, 3730), "save_image")) : ($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl($this->extensions['Eccube\Twig\Extension\EccubeExtension']->getNoImageProduct(""), "save_image"))), "html", null, true);
echo "\"
\t\t\t\t\t\t alt=\"";
// line 3731
echo twig_escape_filter($this->env, $context["rp_name"], "html", null, true);
echo "\" width=\"120\" height=\"120\" loading=\"lazy\">
\t\t\t\t\t\t <span class=\"rp-card__label\">";
// line 3732
echo twig_escape_filter($this->env, $context["rp_name"], "html", null, true);
echo "</span>
\t\t\t\t\t\t </a>
\t\t\t\t\t\t ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['rp_id'], $context['rp_name'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 3735
echo "\t\t\t\t\t\t </div>
\t\t\t\t\t\t ";
} else {
// line 3737
echo "\t\t\t\t\t\t ";
// line 3738
echo "\t\t\t\t\t\t <div class=\"rp-btn-group\">
\t\t\t\t\t\t ";
// line 3739
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["related_product4"]) || array_key_exists("related_product4", $context) ? $context["related_product4"] : (function () { throw new RuntimeError('Variable "related_product4" does not exist.', 3739, $this->source); })()));
foreach ($context['_seq'] as $context["rp_id"] => $context["rp_name"]) {
// line 3740
echo "\t\t\t\t\t\t <a class=\"rp-btn";
if (((isset($context["base_select4"]) || array_key_exists("base_select4", $context) ? $context["base_select4"] : (function () { throw new RuntimeError('Variable "base_select4" does not exist.', 3740, $this->source); })()) == $context["rp_name"])) {
echo " is-selected";
}
echo "\" href=\"/products/detail/";
echo twig_escape_filter($this->env, $context["rp_id"], "html", null, true);
echo "\">
\t\t\t\t\t\t ";
// line 3741
echo twig_escape_filter($this->env, $context["rp_name"], "html", null, true);
echo "
\t\t\t\t\t\t </a>
\t\t\t\t\t\t ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['rp_id'], $context['rp_name'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 3744
echo "\t\t\t\t\t\t </div>
\t\t\t\t\t\t ";
}
// line 3746
echo "\t\t\t\t\t\t</div>
\t\t\t\t\t\t";
}
// line 3748
echo "
\t\t\t\t\t ";
// line 3757
echo "\t\t\t\t\t ";
$context["is_gs_h"] = false;
// line 3758
echo "\t\t\t\t\t ";
$context["is_cg_h"] = false;
// line 3759
echo "\t\t\t\t\t ";
if ( !twig_test_empty(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3759, $this->source); })()), "ProductCategories", [], "any", false, false, false, 3759))) {
// line 3760
echo "\t\t\t\t\t ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3760, $this->source); })()), "ProductCategories", [], "any", false, false, false, 3760));
foreach ($context['_seq'] as $context["_key"] => $context["pc_h"]) {
// line 3761
echo "\t\t\t\t\t ";
if ((twig_get_attribute($this->env, $this->source, $context["pc_h"], "category_id", [], "any", false, false, false, 3761) == 27)) {
$context["is_gs_h"] = true;
}
// line 3762
echo "\t\t\t\t\t ";
if ((twig_get_attribute($this->env, $this->source, $context["pc_h"], "category_id", [], "any", false, false, false, 3762) == 9)) {
$context["is_cg_h"] = true;
}
// line 3763
echo "\t\t\t\t\t ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['pc_h'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 3764
echo "\t\t\t\t\t ";
}
// line 3765
echo "\t\t\t\t\t ";
$context["visible_op_count"] = 0;
// line 3766
echo "\t\t\t\t\t ";
if (((isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 3766, $this->source); })()) && twig_length_filter($this->env, (isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 3766, $this->source); })())))) {
// line 3767
echo "\t\t\t\t\t ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 3767, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["opi"]) {
// line 3768
echo "\t\t\t\t\t ";
if (twig_get_attribute($this->env, $this->source, $context["opi"], "name", [], "array", false, false, false, 3768)) {
// line 3769
echo "\t\t\t\t\t ";
$context["_hide_h"] = false;
// line 3770
echo "\t\t\t\t\t ";
if (((isset($context["is_gs_h"]) || array_key_exists("is_gs_h", $context) ? $context["is_gs_h"] : (function () { throw new RuntimeError('Variable "is_gs_h" does not exist.', 3770, $this->source); })()) && (preg_match("/撤去/", twig_get_attribute($this->env, $this->source, $context["opi"], "name", [], "array", false, false, false, 3770)) || preg_match("/残土/", twig_get_attribute($this->env, $this->source, $context["opi"], "name", [], "array", false, false, false, 3770))))) {
$context["_hide_h"] = true;
}
// line 3771
echo "\t\t\t\t\t ";
if (((isset($context["is_cg_h"]) || array_key_exists("is_cg_h", $context) ? $context["is_cg_h"] : (function () { throw new RuntimeError('Variable "is_cg_h" does not exist.', 3771, $this->source); })()) && preg_match("/残土/", twig_get_attribute($this->env, $this->source, $context["opi"], "name", [], "array", false, false, false, 3771)))) {
$context["_hide_h"] = true;
}
// line 3772
echo "\t\t\t\t\t ";
if ( !(isset($context["_hide_h"]) || array_key_exists("_hide_h", $context) ? $context["_hide_h"] : (function () { throw new RuntimeError('Variable "_hide_h" does not exist.', 3772, $this->source); })())) {
$context["visible_op_count"] = ((isset($context["visible_op_count"]) || array_key_exists("visible_op_count", $context) ? $context["visible_op_count"] : (function () { throw new RuntimeError('Variable "visible_op_count" does not exist.', 3772, $this->source); })()) + 1);
}
// line 3773
echo "\t\t\t\t\t ";
}
// line 3774
echo "\t\t\t\t\t ";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['opi'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 3775
echo "\t\t\t\t\t ";
}
// line 3776
echo "\t\t\t\t\t ";
$context["has_any_option"] = ((((((((( // line 3777
(isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 3777, $this->source); })()) && twig_length_filter($this->env, (isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 3777, $this->source); })()))) && (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 3777, $this->source); })()), "SaleType", [], "any", false, false, false, 3777), "id", [], "any", false, false, false, 3777) != 3)) || (( // line 3778
(isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 3778, $this->source); })()) && twig_length_filter($this->env, (isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 3778, $this->source); })()))) && (twig_join_filter((isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 3778, $this->source); })())) != ""))) || (( // line 3779
(isset($context["p_d"]) || array_key_exists("p_d", $context) ? $context["p_d"] : (function () { throw new RuntimeError('Variable "p_d" does not exist.', 3779, $this->source); })()) && twig_length_filter($this->env, (isset($context["p_d"]) || array_key_exists("p_d", $context) ? $context["p_d"] : (function () { throw new RuntimeError('Variable "p_d" does not exist.', 3779, $this->source); })()))) && (twig_join_filter((isset($context["p_d"]) || array_key_exists("p_d", $context) ? $context["p_d"] : (function () { throw new RuntimeError('Variable "p_d" does not exist.', 3779, $this->source); })())) != ""))) || (( // line 3780
(isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 3780, $this->source); })()) && twig_length_filter($this->env, (isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 3780, $this->source); })()))) && (twig_join_filter((isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 3780, $this->source); })())) != ""))) || (( // line 3781
(isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 3781, $this->source); })()) && twig_length_filter($this->env, (isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 3781, $this->source); })()))) && (twig_join_filter((isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 3781, $this->source); })())) != ""))) || (( // line 3782
(isset($context["p_option1"]) || array_key_exists("p_option1", $context) ? $context["p_option1"] : (function () { throw new RuntimeError('Variable "p_option1" does not exist.', 3782, $this->source); })()) && twig_length_filter($this->env, (isset($context["p_option1"]) || array_key_exists("p_option1", $context) ? $context["p_option1"] : (function () { throw new RuntimeError('Variable "p_option1" does not exist.', 3782, $this->source); })()))) && (twig_join_filter((isset($context["p_option1"]) || array_key_exists("p_option1", $context) ? $context["p_option1"] : (function () { throw new RuntimeError('Variable "p_option1" does not exist.', 3782, $this->source); })())) != ""))) || (( // line 3783
(isset($context["p_option2"]) || array_key_exists("p_option2", $context) ? $context["p_option2"] : (function () { throw new RuntimeError('Variable "p_option2" does not exist.', 3783, $this->source); })()) && twig_length_filter($this->env, (isset($context["p_option2"]) || array_key_exists("p_option2", $context) ? $context["p_option2"] : (function () { throw new RuntimeError('Variable "p_option2" does not exist.', 3783, $this->source); })()))) && (twig_join_filter((isset($context["p_option2"]) || array_key_exists("p_option2", $context) ? $context["p_option2"] : (function () { throw new RuntimeError('Variable "p_option2" does not exist.', 3783, $this->source); })())) != ""))) || twig_in_filter(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, // line 3784
(isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 3784, $this->source); })()), "SaleType", [], "any", false, false, false, 3784), "id", [], "any", false, false, false, 3784), [0 => 2, 1 => 5, 2 => 6, 3 => 7, 4 => 9]));
// line 3786
echo "\t\t\t\t\t ";
if ((isset($context["has_any_option"]) || array_key_exists("has_any_option", $context) ? $context["has_any_option"] : (function () { throw new RuntimeError('Variable "has_any_option" does not exist.', 3786, $this->source); })())) {
// line 3787
echo "\t\t\t\t\t <div class=\"row\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\"><label class=\"col-12 col-form-label\">この商品のオプションを選択してください。</label></div>
\t\t\t\t\t ";
}
// line 3789
echo "
";
// line 3791
echo " ";
if (((((isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 3791, $this->source); })()) && twig_length_filter($this->env, (isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 3791, $this->source); })()))) && (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 3791, $this->source); })()), "SaleType", [], "any", false, false, false, 3791), "id", [], "any", false, false, false, 3791) != 3)) && (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 3791, $this->source); })()), "SaleType", [], "any", false, false, false, 3791), "id", [], "any", false, false, false, 3791) != 2))) {
// line 3792
echo " <div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
<div class=\"rp-section-label\">カラー";
// line 3793
if (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3793, $this->source); })()) && twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3793, $this->source); })()), "pc", [], "any", false, false, false, 3793))) {
echo ": <span>";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3793, $this->source); })()), "pc", [], "any", false, false, false, 3793), "html", null, true);
echo "</span>";
}
echo "</div>
<div class=\"opt-btn-group\">
";
// line 3795
$context["idx"] = 0;
// line 3796
echo " ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 3796, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["cc"]) {
if (($context["cc"] && twig_get_attribute($this->env, $this->source, $context["cc"], "name", [], "array", false, false, false, 3796))) {
$context["idx"] = ((isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 3796, $this->source); })()) + 1);
// line 3797
echo " ";
$context["has_img"] = (twig_get_attribute($this->env, $this->source, $context["cc"], "img", [], "array", true, true, false, 3797) && !twig_test_empty(twig_get_attribute($this->env, $this->source, $context["cc"], "img", [], "array", false, false, false, 3797)));
// line 3798
echo " <label class=\"opt-btn";
if ((isset($context["has_img"]) || array_key_exists("has_img", $context) ? $context["has_img"] : (function () { throw new RuntimeError('Variable "has_img" does not exist.', 3798, $this->source); })())) {
echo " opt-btn--with-image";
}
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3798, $this->source); })()) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3798, $this->source); })()), "pc", [], "any", false, false, false, 3798) == twig_get_attribute($this->env, $this->source, $context["cc"], "name", [], "array", false, false, false, 3798))) || (twig_length_filter($this->env, (isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 3798, $this->source); })())) == 1))) {
echo " is-selected";
}
echo "\"
onclick=\"mitsumori_simulation_val('pc', '";
// line 3799
echo twig_escape_filter($this->env, twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["cc"], "name", [], "array", false, false, false, 3799), "js"), "html", null, true);
echo "');\">
<input type=\"radio\" name=\"color\" id=\"cc_";
// line 3800
echo twig_escape_filter($this->env, (isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 3800, $this->source); })()), "html", null, true);
echo "\" value=\"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["cc"], "name", [], "array", false, false, false, 3800), "html", null, true);
echo "\"
";
// line 3801
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3801, $this->source); })()) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3801, $this->source); })()), "pc", [], "any", false, false, false, 3801) == twig_get_attribute($this->env, $this->source, $context["cc"], "name", [], "array", false, false, false, 3801))) || (twig_length_filter($this->env, (isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 3801, $this->source); })())) == 1))) {
echo "checked";
}
echo ">
";
// line 3802
if ((isset($context["has_img"]) || array_key_exists("has_img", $context) ? $context["has_img"] : (function () { throw new RuntimeError('Variable "has_img" does not exist.', 3802, $this->source); })())) {
// line 3803
echo " <img src=\"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["cc"], "img", [], "array", false, false, false, 3803), "html", null, true);
echo "\" alt=\"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["cc"], "name", [], "array", false, false, false, 3803), "html", null, true);
echo "\" class=\"opt-btn__img\"
onerror=\"this.parentNode.classList.remove('opt-btn--with-image'); this.remove();\">
<span class=\"opt-btn__name\">";
// line 3805
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["cc"], "name", [], "array", false, false, false, 3805), "html", null, true);
echo "</span>
";
} else {
// line 3807
echo " ";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["cc"], "name", [], "array", false, false, false, 3807), "html", null, true);
echo "
";
}
// line 3809
echo " </label>
";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['cc'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 3811
echo " </div>
</div>
";
}
// line 3814
echo "
";
// line 3819
echo " ";
if (((((isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 3819, $this->source); })()) && twig_length_filter($this->env, (isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 3819, $this->source); })()))) && (twig_join_filter((isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 3819, $this->source); })())) != "")) && !twig_in_filter(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 3819, $this->source); })()), "SaleType", [], "any", false, false, false, 3819), "id", [], "any", false, false, false, 3819), [0 => 2, 1 => 3, 2 => 6]))) {
// line 3820
echo " <div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
<div class=\"rp-section-label\">幅";
// line 3821
if (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3821, $this->source); })()) && twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3821, $this->source); })()), "pw", [], "any", false, false, false, 3821))) {
echo ": <span>";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3821, $this->source); })()), "pw", [], "any", false, false, false, 3821), "html", null, true);
echo "</span>";
}
echo "</div>
<div class=\"opt-btn-group\">
";
// line 3823
$context["idx"] = 0;
// line 3824
echo " ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 3824, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["pw"]) {
if ($context["pw"]) {
$context["idx"] = ((isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 3824, $this->source); })()) + 1);
// line 3825
echo " <label class=\"opt-btn";
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3825, $this->source); })()) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3825, $this->source); })()), "pw", [], "any", false, false, false, 3825) == $context["pw"])) || (twig_length_filter($this->env, (isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 3825, $this->source); })())) == 1))) {
echo " is-selected";
}
echo "\"
onclick=\"mitsumori_simulation_val('pw', '";
// line 3826
echo twig_escape_filter($this->env, twig_escape_filter($this->env, $context["pw"], "js"), "html", null, true);
echo "');\">
<input type=\"radio\" name=\"pw\" id=\"pw_";
// line 3827
echo twig_escape_filter($this->env, (isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 3827, $this->source); })()), "html", null, true);
echo "\" value=\"";
echo twig_escape_filter($this->env, $context["pw"], "html", null, true);
echo "\"
";
// line 3828
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3828, $this->source); })()) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3828, $this->source); })()), "pw", [], "any", false, false, false, 3828) == $context["pw"])) || (twig_length_filter($this->env, (isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 3828, $this->source); })())) == 1))) {
echo "checked";
}
echo ">
";
// line 3829
echo twig_escape_filter($this->env, $context["pw"], "html", null, true);
echo "
</label>
";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['pw'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 3832
echo " </div>
</div>
";
}
// line 3835
echo "
";
// line 3836
if (((((isset($context["p_d"]) || array_key_exists("p_d", $context) ? $context["p_d"] : (function () { throw new RuntimeError('Variable "p_d" does not exist.', 3836, $this->source); })()) && twig_length_filter($this->env, (isset($context["p_d"]) || array_key_exists("p_d", $context) ? $context["p_d"] : (function () { throw new RuntimeError('Variable "p_d" does not exist.', 3836, $this->source); })()))) && (twig_join_filter((isset($context["p_d"]) || array_key_exists("p_d", $context) ? $context["p_d"] : (function () { throw new RuntimeError('Variable "p_d" does not exist.', 3836, $this->source); })())) != "")) && !twig_in_filter(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 3836, $this->source); })()), "SaleType", [], "any", false, false, false, 3836), "id", [], "any", false, false, false, 3836), [0 => 3, 1 => 6]))) {
// line 3837
echo " <div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
<div class=\"rp-section-label\">奥行き";
// line 3838
if (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3838, $this->source); })()) && twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3838, $this->source); })()), "pd", [], "any", false, false, false, 3838))) {
echo ": <span>";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3838, $this->source); })()), "pd", [], "any", false, false, false, 3838), "html", null, true);
echo "</span>";
}
echo "</div>
<div class=\"opt-btn-group\">
";
// line 3840
$context["idx"] = 0;
// line 3841
echo " ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["p_d"]) || array_key_exists("p_d", $context) ? $context["p_d"] : (function () { throw new RuntimeError('Variable "p_d" does not exist.', 3841, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["pd"]) {
if ($context["pd"]) {
$context["idx"] = ((isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 3841, $this->source); })()) + 1);
// line 3842
echo " <label class=\"opt-btn";
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3842, $this->source); })()) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3842, $this->source); })()), "pd", [], "any", false, false, false, 3842) == $context["pd"])) || (twig_length_filter($this->env, (isset($context["p_d"]) || array_key_exists("p_d", $context) ? $context["p_d"] : (function () { throw new RuntimeError('Variable "p_d" does not exist.', 3842, $this->source); })())) == 1))) {
echo " is-selected";
}
echo "\"
onclick=\"mitsumori_simulation_val('pd', '";
// line 3843
echo twig_escape_filter($this->env, twig_escape_filter($this->env, $context["pd"], "js"), "html", null, true);
echo "');\">
<input type=\"radio\" name=\"pd\" id=\"pd_";
// line 3844
echo twig_escape_filter($this->env, (isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 3844, $this->source); })()), "html", null, true);
echo "\" value=\"";
echo twig_escape_filter($this->env, $context["pd"], "html", null, true);
echo "\"
";
// line 3845
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3845, $this->source); })()) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3845, $this->source); })()), "pd", [], "any", false, false, false, 3845) == $context["pd"])) || (twig_length_filter($this->env, (isset($context["p_d"]) || array_key_exists("p_d", $context) ? $context["p_d"] : (function () { throw new RuntimeError('Variable "p_d" does not exist.', 3845, $this->source); })())) == 1))) {
echo "checked";
}
echo ">
";
// line 3846
echo twig_escape_filter($this->env, $context["pd"], "html", null, true);
echo "
</label>
";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['pd'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 3849
echo " </div>
</div>
";
}
// line 3852
echo "
";
// line 3855
echo " ";
if (((((isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 3855, $this->source); })()) && twig_length_filter($this->env, (isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 3855, $this->source); })()))) && (twig_join_filter((isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 3855, $this->source); })())) != "")) && !twig_in_filter(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 3855, $this->source); })()), "SaleType", [], "any", false, false, false, 3855), "id", [], "any", false, false, false, 3855), [0 => 2, 1 => 3, 2 => 6]))) {
// line 3856
echo " <div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
<div class=\"rp-section-label\">高さ";
// line 3857
if (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3857, $this->source); })()) && twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3857, $this->source); })()), "ph", [], "any", false, false, false, 3857))) {
echo ": <span>";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3857, $this->source); })()), "ph", [], "any", false, false, false, 3857), "html", null, true);
echo "</span>";
}
echo "</div>
<div class=\"opt-btn-group\">
";
// line 3859
$context["idx"] = 0;
// line 3860
echo " ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 3860, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["ph"]) {
if ($context["ph"]) {
$context["idx"] = ((isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 3860, $this->source); })()) + 1);
// line 3861
echo " <label class=\"opt-btn";
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3861, $this->source); })()) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3861, $this->source); })()), "ph", [], "any", false, false, false, 3861) == $context["ph"])) || (twig_length_filter($this->env, (isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 3861, $this->source); })())) == 1))) {
echo " is-selected";
}
echo "\"
onclick=\"mitsumori_simulation_val('ph', '";
// line 3862
echo twig_escape_filter($this->env, twig_escape_filter($this->env, $context["ph"], "js"), "html", null, true);
echo "');\">
<input type=\"radio\" name=\"ph\" id=\"ph_";
// line 3863
echo twig_escape_filter($this->env, (isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 3863, $this->source); })()), "html", null, true);
echo "\" value=\"";
echo twig_escape_filter($this->env, $context["ph"], "html", null, true);
echo "\"
";
// line 3864
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3864, $this->source); })()) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3864, $this->source); })()), "ph", [], "any", false, false, false, 3864) == $context["ph"])) || (twig_length_filter($this->env, (isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 3864, $this->source); })())) == 1))) {
echo "checked";
}
echo ">
";
// line 3865
echo twig_escape_filter($this->env, $context["ph"], "html", null, true);
echo "
</label>
";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['ph'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 3868
echo " </div>
</div>
";
}
// line 3871
echo "
";
// line 3873
echo " ";
if ((((((isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 3873, $this->source); })()) && twig_length_filter($this->env, (isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 3873, $this->source); })()))) && (twig_join_filter((isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 3873, $this->source); })())) != "")) && (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 3873, $this->source); })()), "SaleType", [], "any", false, false, false, 3873), "id", [], "any", false, false, false, 3873) != 3)) && (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 3873, $this->source); })()), "SaleType", [], "any", false, false, false, 3873), "id", [], "any", false, false, false, 3873) != 2))) {
// line 3874
echo " <div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
<div class=\"rp-section-label\">";
// line 3875
if ((isset($context["is_cat43"]) || array_key_exists("is_cat43", $context) ? $context["is_cat43"] : (function () { throw new RuntimeError('Variable "is_cat43" does not exist.', 3875, $this->source); })())) {
echo "開き方";
} else {
echo twig_escape_filter($this->env, (isset($context["pm_label"]) || array_key_exists("pm_label", $context) ? $context["pm_label"] : (function () { throw new RuntimeError('Variable "pm_label" does not exist.', 3875, $this->source); })()), "html", null, true);
}
if (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3875, $this->source); })()) && twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3875, $this->source); })()), "pm", [], "any", false, false, false, 3875))) {
echo ": <span>";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3875, $this->source); })()), "pm", [], "any", false, false, false, 3875), "html", null, true);
echo "</span>";
}
echo "</div>
<div class=\"opt-btn-group\">
";
// line 3877
$context["idx"] = 0;
// line 3878
echo " ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 3878, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["pm"]) {
if ($context["pm"]) {
$context["idx"] = ((isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 3878, $this->source); })()) + 1);
// line 3879
echo " <label class=\"opt-btn";
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3879, $this->source); })()) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3879, $this->source); })()), "pm", [], "any", false, false, false, 3879) == $context["pm"])) || (twig_length_filter($this->env, (isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 3879, $this->source); })())) == 1))) {
echo " is-selected";
}
echo "\"
onclick=\"mitsumori_simulation_val('pm', '";
// line 3880
echo twig_escape_filter($this->env, twig_escape_filter($this->env, $context["pm"], "js"), "html", null, true);
echo "');\">
<input type=\"radio\" name=\"pm\" id=\"pm_";
// line 3881
echo twig_escape_filter($this->env, (isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 3881, $this->source); })()), "html", null, true);
echo "\" value=\"";
echo twig_escape_filter($this->env, $context["pm"], "html", null, true);
echo "\"
";
// line 3882
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3882, $this->source); })()) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3882, $this->source); })()), "pm", [], "any", false, false, false, 3882) == $context["pm"])) || (twig_length_filter($this->env, (isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 3882, $this->source); })())) == 1))) {
echo "checked";
}
echo ">
";
// line 3883
echo twig_escape_filter($this->env, $context["pm"], "html", null, true);
echo "
</label>
";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['pm'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 3886
echo " </div>
</div>
";
}
// line 3889
echo "
";
// line 3894
echo " ";
if (((((((((isset($context["p_option1"]) || array_key_exists("p_option1", $context) ? $context["p_option1"] : (function () { throw new RuntimeError('Variable "p_option1" does not exist.', 3894, $this->source); })()) && twig_length_filter($this->env, (isset($context["p_option1"]) || array_key_exists("p_option1", $context) ? $context["p_option1"] : (function () { throw new RuntimeError('Variable "p_option1" does not exist.', 3894, $this->source); })()))) && (twig_join_filter((isset($context["p_option1"]) || array_key_exists("p_option1", $context) ? $context["p_option1"] : (function () { throw new RuntimeError('Variable "p_option1" does not exist.', 3894, $this->source); })())) != "")) && (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 3894, $this->source); })()), "SaleType", [], "any", false, false, false, 3894), "id", [], "any", false, false, false, 3894) != 2)) && (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 3894, $this->source); })()), "SaleType", [], "any", false, false, false, 3894), "id", [], "any", false, false, false, 3894) != 3)) && (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 3894, $this->source); })()), "SaleType", [], "any", false, false, false, 3894), "id", [], "any", false, false, false, 3894) != 4)) && !(isset($context["is_cat43"]) || array_key_exists("is_cat43", $context) ? $context["is_cat43"] : (function () { throw new RuntimeError('Variable "is_cat43" does not exist.', 3894, $this->source); })())) && !(isset($context["is_cp"]) || array_key_exists("is_cp", $context) ? $context["is_cp"] : (function () { throw new RuntimeError('Variable "is_cp" does not exist.', 3894, $this->source); })()))) {
// line 3895
echo " <div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
<div class=\"rp-section-label\">";
// line 3896
echo twig_escape_filter($this->env, (isset($context["option1_label"]) || array_key_exists("option1_label", $context) ? $context["option1_label"] : (function () { throw new RuntimeError('Variable "option1_label" does not exist.', 3896, $this->source); })()), "html", null, true);
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3896, $this->source); })()) && twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "option1", [], "any", true, true, false, 3896)) && twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3896, $this->source); })()), "option1", [], "any", false, false, false, 3896))) {
echo ": <span>";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3896, $this->source); })()), "option1", [], "any", false, false, false, 3896), "html", null, true);
echo "</span>";
}
echo "</div>
<div class=\"opt-btn-group\">
";
// line 3898
$context["idx"] = 0;
// line 3899
echo " ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["p_option1"]) || array_key_exists("p_option1", $context) ? $context["p_option1"] : (function () { throw new RuntimeError('Variable "p_option1" does not exist.', 3899, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["opt1"]) {
if ($context["opt1"]) {
$context["idx"] = ((isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 3899, $this->source); })()) + 1);
// line 3900
echo " <label class=\"opt-btn";
if (((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3900, $this->source); })()) && twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "option1", [], "any", true, true, false, 3900)) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3900, $this->source); })()), "option1", [], "any", false, false, false, 3900) == $context["opt1"])) || (twig_length_filter($this->env, (isset($context["p_option1"]) || array_key_exists("p_option1", $context) ? $context["p_option1"] : (function () { throw new RuntimeError('Variable "p_option1" does not exist.', 3900, $this->source); })())) == 1))) {
echo " is-selected";
}
echo "\"
onclick=\"mitsumori_simulation_val('option1', '";
// line 3901
echo twig_escape_filter($this->env, twig_escape_filter($this->env, $context["opt1"], "js"), "html", null, true);
echo "');\">
<input type=\"radio\" name=\"option1\" id=\"option1_";
// line 3902
echo twig_escape_filter($this->env, (isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 3902, $this->source); })()), "html", null, true);
echo "\" value=\"";
echo twig_escape_filter($this->env, $context["opt1"], "html", null, true);
echo "\"
";
// line 3903
if (((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3903, $this->source); })()) && twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "option1", [], "any", true, true, false, 3903)) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3903, $this->source); })()), "option1", [], "any", false, false, false, 3903) == $context["opt1"])) || (twig_length_filter($this->env, (isset($context["p_option1"]) || array_key_exists("p_option1", $context) ? $context["p_option1"] : (function () { throw new RuntimeError('Variable "p_option1" does not exist.', 3903, $this->source); })())) == 1))) {
echo "checked";
}
echo ">
";
// line 3904
echo twig_escape_filter($this->env, $context["opt1"], "html", null, true);
echo "
</label>
";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['opt1'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 3907
echo " </div>
</div>
";
}
// line 3910
echo "
";
// line 3912
echo " ";
if (((((((isset($context["p_option2"]) || array_key_exists("p_option2", $context) ? $context["p_option2"] : (function () { throw new RuntimeError('Variable "p_option2" does not exist.', 3912, $this->source); })()) && twig_length_filter($this->env, (isset($context["p_option2"]) || array_key_exists("p_option2", $context) ? $context["p_option2"] : (function () { throw new RuntimeError('Variable "p_option2" does not exist.', 3912, $this->source); })()))) && (twig_join_filter((isset($context["p_option2"]) || array_key_exists("p_option2", $context) ? $context["p_option2"] : (function () { throw new RuntimeError('Variable "p_option2" does not exist.', 3912, $this->source); })())) != "")) && (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 3912, $this->source); })()), "SaleType", [], "any", false, false, false, 3912), "id", [], "any", false, false, false, 3912) != 2)) && (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 3912, $this->source); })()), "SaleType", [], "any", false, false, false, 3912), "id", [], "any", false, false, false, 3912) != 3)) && !(isset($context["is_cat43"]) || array_key_exists("is_cat43", $context) ? $context["is_cat43"] : (function () { throw new RuntimeError('Variable "is_cat43" does not exist.', 3912, $this->source); })()))) {
// line 3913
echo " <div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
<div class=\"rp-section-label\">";
// line 3914
echo twig_escape_filter($this->env, (isset($context["option2_label"]) || array_key_exists("option2_label", $context) ? $context["option2_label"] : (function () { throw new RuntimeError('Variable "option2_label" does not exist.', 3914, $this->source); })()), "html", null, true);
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3914, $this->source); })()) && twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "option2", [], "any", true, true, false, 3914)) && twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3914, $this->source); })()), "option2", [], "any", false, false, false, 3914))) {
echo ": <span>";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3914, $this->source); })()), "option2", [], "any", false, false, false, 3914), "html", null, true);
echo "</span>";
}
echo "</div>
<div class=\"opt-btn-group\">
";
// line 3916
$context["idx"] = 0;
// line 3917
echo " ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["p_option2"]) || array_key_exists("p_option2", $context) ? $context["p_option2"] : (function () { throw new RuntimeError('Variable "p_option2" does not exist.', 3917, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["opt2"]) {
if ($context["opt2"]) {
$context["idx"] = ((isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 3917, $this->source); })()) + 1);
// line 3918
echo " <label class=\"opt-btn";
if (((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3918, $this->source); })()) && twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "option2", [], "any", true, true, false, 3918)) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3918, $this->source); })()), "option2", [], "any", false, false, false, 3918) == $context["opt2"])) || (twig_length_filter($this->env, (isset($context["p_option2"]) || array_key_exists("p_option2", $context) ? $context["p_option2"] : (function () { throw new RuntimeError('Variable "p_option2" does not exist.', 3918, $this->source); })())) == 1))) {
echo " is-selected";
}
echo "\"
onclick=\"mitsumori_simulation_val('option2', '";
// line 3919
echo twig_escape_filter($this->env, twig_escape_filter($this->env, $context["opt2"], "js"), "html", null, true);
echo "');\">
<input type=\"radio\" name=\"option2\" id=\"option2_";
// line 3920
echo twig_escape_filter($this->env, (isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 3920, $this->source); })()), "html", null, true);
echo "\" value=\"";
echo twig_escape_filter($this->env, $context["opt2"], "html", null, true);
echo "\"
";
// line 3921
if (((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3921, $this->source); })()) && twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "option2", [], "any", true, true, false, 3921)) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3921, $this->source); })()), "option2", [], "any", false, false, false, 3921) == $context["opt2"])) || (twig_length_filter($this->env, (isset($context["p_option2"]) || array_key_exists("p_option2", $context) ? $context["p_option2"] : (function () { throw new RuntimeError('Variable "p_option2" does not exist.', 3921, $this->source); })())) == 1))) {
echo "checked";
}
echo ">
";
// line 3922
echo twig_escape_filter($this->env, $context["opt2"], "html", null, true);
echo "
</label>
";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['opt2'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 3925
echo " </div>
</div>
";
}
// line 3928
echo "
\t\t\t\t\t\t<!-- 1: 施工見積(通常) → 幅/奥行/高さ/素材/カラーは上部の共通ブロックで表示済み -->
\t\t\t\t\t\t";
// line 3930
if ((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 3930, $this->source); })()), "SaleType", [], "any", false, false, false, 3930), "id", [], "any", false, false, false, 3930) == 1)) {
// line 3931
echo "\t\t\t\t\t\t";
}
// line 3932
echo "
\t\t\t\t\t\t<!-- 2: 施工見積(補助金・窓) 複数タイプ追加対応 (2026-05) -->
\t\t\t\t\t\t";
// line 3934
if ((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 3934, $this->source); })()), "SaleType", [], "any", false, false, false, 3934), "id", [], "any", false, false, false, 3934) == 2)) {
// line 3935
echo "
\t\t\t\t\t\t\t";
// line 3939
echo "
\t\t\t\t\t\t\t";
// line 3943
echo "\t\t\t\t\t\t\t<style>
\t\t\t\t\t\t\t\t.ec-productRole__profile {
\t\t\t\t\t\t\t\t\toverflow: visible !important;
\t\t\t\t\t\t\t\t\tmax-height: none !important;
\t\t\t\t\t\t\t\t\theight: auto !important;
\t\t\t\t\t\t\t\t}
\t\t\t\t\t\t\t</style>
\t\t\t\t\t\t\t";
// line 3952
echo "\t\t\t\t\t\t\t";
$context["housing_default"] = _twig_default_filter($this->extensions['Plugin\ProductField\Twig\Extension\EccubeExtension']->getProduct_field(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 3952, $this->source); })()), "id", [], "any", false, false, false, 3952), "住宅区分"), "戸建");
// line 3953
echo "\t\t\t\t\t\t\t<div class=\"card mt-3 mb-3\">
\t\t\t\t\t\t\t <div class=\"card-header\" style=\"background:#fff3cd;color:#333;\">
\t\t\t\t\t\t\t <strong>お住まいの種別を選択</strong>
\t\t\t\t\t\t\t <small class=\"ms-2 text-muted\">補助金単価が変わります</small>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t <div class=\"card-body p-2\">
\t\t\t\t\t\t\t <div class=\"opt-btn-group\" id=\"window-housing-type-group\">
\t\t\t\t\t\t\t <label class=\"opt-btn\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"window_housing_type\" value=\"戸建\"
\t\t\t\t\t\t\t ";
// line 3962
if (((isset($context["housing_default"]) || array_key_exists("housing_default", $context) ? $context["housing_default"] : (function () { throw new RuntimeError('Variable "housing_default" does not exist.', 3962, $this->source); })()) != "集合住宅")) {
echo "checked";
}
echo ">
\t\t\t\t\t\t\t 戸建住宅<small class=\"d-block text-muted\">(延床240㎡以下の非住宅含む)</small>
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t <label class=\"opt-btn\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"window_housing_type\" value=\"集合住宅\"
\t\t\t\t\t\t\t ";
// line 3967
if (((isset($context["housing_default"]) || array_key_exists("housing_default", $context) ? $context["housing_default"] : (function () { throw new RuntimeError('Variable "housing_default" does not exist.', 3967, $this->source); })()) == "集合住宅")) {
echo "checked";
}
echo ">
\t\t\t\t\t\t\t 集合住宅<small class=\"d-block text-muted\">(低層・中高層/240㎡超の非住宅)</small>
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t<div class=\"card mt-3 mb-3\">
\t\t\t\t\t\t\t <div class=\"card-header\" style=\"background:#fff3cd;color:#333;\">
\t\t\t\t\t\t\t <strong>窓タイプを選択(複数追加可・最大 20)</strong>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t <div class=\"card-body p-2\">
\t\t\t\t\t\t\t ";
// line 3980
echo "\t\t\t\t\t\t\t <p class=\"subsidy-eligibility-note\">※先進的窓リノベ2026の補助金は、各窓の補助金額の<strong>合計が5万円以上</strong>で適用されます。各窓ごとの補助金額は下に常時表示しています。</p>
\t\t\t\t\t\t\t <div id=\"window-types-container\"><!-- 動的に窓タイプブロックが追加される --></div>
\t\t\t\t\t\t\t <div class=\"text-center mt-2\">
\t\t\t\t\t\t\t <button type=\"button\" id=\"btn-add-window-type\" class=\"btn btn-outline-primary btn-sm\" onclick=\"addWindowType();\">+ 窓タイプを追加</button>
\t\t\t\t\t\t\t <div class=\"small text-muted mt-1\">最大 20 タイプまで追加できます</div>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t";
// line 3990
echo "\t\t\t\t\t\t\t<template id=\"window-type-template\">
\t\t\t\t\t\t\t <div class=\"window-type-block\" data-type-idx=\"__IDX__\" style=\"border:1px solid #ddd;border-radius:6px;padding:10px;margin-bottom:10px;background:#fafafa;\">
\t\t\t\t\t\t\t <div class=\"d-flex justify-content-between align-items-center mb-2\">
\t\t\t\t\t\t\t <strong>窓タイプ <span class=\"wt-num\">__IDX__</span></strong>
\t\t\t\t\t\t\t <button type=\"button\" class=\"btn btn-sm btn-outline-danger btn-remove-window-type\" onclick=\"removeWindowType(this);\">× 削除</button>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t ";
// line 3998
echo "\t\t\t\t\t\t\t ";
if ((((isset($context["p_option1"]) || array_key_exists("p_option1", $context) ? $context["p_option1"] : (function () { throw new RuntimeError('Variable "p_option1" does not exist.', 3998, $this->source); })()) && twig_length_filter($this->env, (isset($context["p_option1"]) || array_key_exists("p_option1", $context) ? $context["p_option1"] : (function () { throw new RuntimeError('Variable "p_option1" does not exist.', 3998, $this->source); })()))) && (twig_join_filter((isset($context["p_option1"]) || array_key_exists("p_option1", $context) ? $context["p_option1"] : (function () { throw new RuntimeError('Variable "p_option1" does not exist.', 3998, $this->source); })())) != ""))) {
// line 3999
echo "\t\t\t\t\t\t\t <div class=\"form-group mt-2 pb-2\" style=\"border-bottom:1px dashed rgba(0,0,0,.1)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">窓タイプ</div>
\t\t\t\t\t\t\t <div class=\"opt-btn-group\">
\t\t\t\t\t\t\t ";
// line 4002
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["p_option1"]) || array_key_exists("p_option1", $context) ? $context["p_option1"] : (function () { throw new RuntimeError('Variable "p_option1" does not exist.', 4002, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["v"]) {
if ($context["v"]) {
// line 4003
echo "\t\t\t\t\t\t\t <label class=\"opt-btn\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"wt_subtype___IDX__\" value=\"";
// line 4004
echo twig_escape_filter($this->env, $context["v"], "html", null, true);
echo "\" data-axis=\"subtype\" onchange=\"onWindowTypeAxisChange(this);\">
\t\t\t\t\t\t\t ";
// line 4005
echo twig_escape_filter($this->env, $context["v"], "html", null, true);
echo "
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t ";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['v'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 4008
echo "\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t ";
}
// line 4011
echo "
\t\t\t\t\t\t\t ";
// line 4013
echo "\t\t\t\t\t\t\t ";
if ((((isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 4013, $this->source); })()) && twig_length_filter($this->env, (isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 4013, $this->source); })()))) && (twig_join_filter((isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 4013, $this->source); })())) != ""))) {
// line 4014
echo "\t\t\t\t\t\t\t <div class=\"form-group mt-2 pb-2\" style=\"border-bottom:1px dashed rgba(0,0,0,.1)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">幅</div>
\t\t\t\t\t\t\t <div class=\"input-group\" style=\"max-width:240px;\">
\t\t\t\t\t\t\t <input type=\"number\" name=\"wt_pw___IDX__\" class=\"form-control\" min=\"100\" step=\"10\"
\t\t\t\t\t\t\t placeholder=\"例 1750\" data-axis=\"pw\" data-unit=\"mm\"
\t\t\t\t\t\t\t oninput=\"onWindowTypeAxisChange(this);\">
\t\t\t\t\t\t\t <span class=\"input-group-text\">mm</span>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t <small class=\"text-muted\">商品の対応幅: 〜";
// line 4022
echo twig_escape_filter($this->env, _twig_default_filter(twig_last($this->env, (isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 4022, $this->source); })())), ""), "html", null, true);
echo "(";
echo twig_escape_filter($this->env, twig_length_filter($this->env, (isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 4022, $this->source); })())), "html", null, true);
echo " 段階の価格帯から自動選択)</small>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t ";
}
// line 4025
echo "
\t\t\t\t\t\t\t ";
// line 4027
echo "\t\t\t\t\t\t\t ";
if ((((isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 4027, $this->source); })()) && twig_length_filter($this->env, (isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 4027, $this->source); })()))) && (twig_join_filter((isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 4027, $this->source); })())) != ""))) {
// line 4028
echo "\t\t\t\t\t\t\t <div class=\"form-group mt-2 pb-2\" style=\"border-bottom:1px dashed rgba(0,0,0,.1)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">高さ</div>
\t\t\t\t\t\t\t <div class=\"input-group\" style=\"max-width:240px;\">
\t\t\t\t\t\t\t <input type=\"number\" name=\"wt_ph___IDX__\" class=\"form-control\" min=\"100\" step=\"10\"
\t\t\t\t\t\t\t placeholder=\"例 1200\" data-axis=\"ph\" data-unit=\"mm\"
\t\t\t\t\t\t\t oninput=\"onWindowTypeAxisChange(this);\">
\t\t\t\t\t\t\t <span class=\"input-group-text\">mm</span>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t <small class=\"text-muted\">商品の対応高さ: 〜";
// line 4036
echo twig_escape_filter($this->env, _twig_default_filter(twig_last($this->env, (isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 4036, $this->source); })())), ""), "html", null, true);
echo "(";
echo twig_escape_filter($this->env, twig_length_filter($this->env, (isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 4036, $this->source); })())), "html", null, true);
echo " 段階の価格帯から自動選択)</small>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t ";
}
// line 4039
echo "
\t\t\t\t\t\t\t ";
// line 4041
echo "\t\t\t\t\t\t\t ";
if ((((isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 4041, $this->source); })()) && twig_length_filter($this->env, (isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 4041, $this->source); })()))) && (twig_join_filter((isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 4041, $this->source); })())) != ""))) {
// line 4042
echo "\t\t\t\t\t\t\t <div class=\"form-group mt-2 pb-2\" style=\"border-bottom:1px dashed rgba(0,0,0,.1)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">ガラスタイプ</div>
\t\t\t\t\t\t\t ";
// line 4046
echo "\t\t\t\t\t\t\t <div class=\"opt-btn-group no-hscroll\">
\t\t\t\t\t\t\t ";
// line 4047
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 4047, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["v"]) {
if ($context["v"]) {
// line 4048
echo "\t\t\t\t\t\t\t <label class=\"opt-btn\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"wt_pm___IDX__\" value=\"";
// line 4049
echo twig_escape_filter($this->env, $context["v"], "html", null, true);
echo "\" data-axis=\"pm\" onchange=\"onWindowTypeAxisChange(this);\">
\t\t\t\t\t\t\t ";
// line 4050
echo twig_escape_filter($this->env, $context["v"], "html", null, true);
echo "
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t ";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['v'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 4053
echo "\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t <small class=\"text-muted\">「<span style=\"color:#2e7d32;font-weight:bold;\">補助金対象</span>」が付いたガラスは、先進的窓リノベ補助金の対象です。</small>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t ";
}
// line 4057
echo "
\t\t\t\t\t\t\t ";
// line 4059
echo "\t\t\t\t\t\t\t ";
if (((isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 4059, $this->source); })()) && twig_length_filter($this->env, (isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 4059, $this->source); })())))) {
// line 4060
echo "\t\t\t\t\t\t\t <div class=\"form-group mt-2 pb-2\" style=\"border-bottom:1px dashed rgba(0,0,0,.1)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">窓枠カラー</div>
\t\t\t\t\t\t\t <div class=\"opt-btn-group\">
\t\t\t\t\t\t\t ";
// line 4063
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 4063, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["cc"]) {
if (($context["cc"] && twig_get_attribute($this->env, $this->source, $context["cc"], "name", [], "array", false, false, false, 4063))) {
// line 4064
echo "\t\t\t\t\t\t\t ";
$context["has_img"] = (twig_get_attribute($this->env, $this->source, $context["cc"], "img", [], "array", true, true, false, 4064) && !twig_test_empty(twig_get_attribute($this->env, $this->source, $context["cc"], "img", [], "array", false, false, false, 4064)));
// line 4065
echo "\t\t\t\t\t\t\t <label class=\"opt-btn";
if ((isset($context["has_img"]) || array_key_exists("has_img", $context) ? $context["has_img"] : (function () { throw new RuntimeError('Variable "has_img" does not exist.', 4065, $this->source); })())) {
echo " opt-btn--with-image";
}
echo "\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"wt_pc___IDX__\" value=\"";
// line 4066
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["cc"], "name", [], "array", false, false, false, 4066), "html", null, true);
echo "\" data-axis=\"pc\" onchange=\"onWindowTypeAxisChange(this);\">
\t\t\t\t\t\t\t ";
// line 4067
if ((isset($context["has_img"]) || array_key_exists("has_img", $context) ? $context["has_img"] : (function () { throw new RuntimeError('Variable "has_img" does not exist.', 4067, $this->source); })())) {
// line 4068
echo "\t\t\t\t\t\t\t <img src=\"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["cc"], "img", [], "array", false, false, false, 4068), "html", null, true);
echo "\" alt=\"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["cc"], "name", [], "array", false, false, false, 4068), "html", null, true);
echo "\" class=\"opt-btn__img\"
\t\t\t\t\t\t\t onerror=\"this.parentNode.classList.remove('opt-btn--with-image'); this.remove();\">
\t\t\t\t\t\t\t <span class=\"opt-btn__name\">";
// line 4070
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["cc"], "name", [], "array", false, false, false, 4070), "html", null, true);
echo "</span>
\t\t\t\t\t\t\t ";
} else {
// line 4072
echo "\t\t\t\t\t\t\t ";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["cc"], "name", [], "array", false, false, false, 4072), "html", null, true);
echo "
\t\t\t\t\t\t\t ";
}
// line 4074
echo "\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t ";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['cc'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 4076
echo "\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t ";
}
// line 4079
echo "
\t\t\t\t\t\t\t ";
// line 4081
echo "\t\t\t\t\t\t\t <div class=\"form-group row mt-2 align-items-center\">
\t\t\t\t\t\t\t <label class=\"col-4 col-form-label\">セット数</label>
\t\t\t\t\t\t\t <div class=\"col-4\">
\t\t\t\t\t\t\t <div class=\"input-group\">
\t\t\t\t\t\t\t <input type=\"number\" name=\"wt_setqty___IDX__\" class=\"form-control wt-input-setqty\" value=\"1\" min=\"1\" max=\"99\" data-axis=\"setqty\" onchange=\"onWindowTypeAxisChange(this);\">
\t\t\t\t\t\t\t <span class=\"input-group-text\">セット</span>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t <div class=\"col-4 text-end\">
\t\t\t\t\t\t\t <span class=\"wt-subsidy-label\">補助金額</span><br><span class=\"wt-subsidy-amount\">―</span> <span class=\"wt-subsidy-label\">円</span>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</template>
\t\t\t\t\t\t\t";
// line 4097
echo "\t\t\t\t\t\t\t<script>
\t\t\t\t\t\t\t(function() {
\t\t\t\t\t\t\t\tvar MAX_WINDOW_TYPES = 20;
\t\t\t\t\t\t\t\tfunction addWindowType() {
\t\t\t\t\t\t\t\t\tvar container = document.getElementById('window-types-container');
\t\t\t\t\t\t\t\t\tif (!container) return;
\t\t\t\t\t\t\t\t\tvar existing = container.querySelectorAll('.window-type-block');
\t\t\t\t\t\t\t\t\tif (existing.length >= MAX_WINDOW_TYPES) return;
\t\t\t\t\t\t\t\t\tvar newIdx = existing.length + 1;
\t\t\t\t\t\t\t\t\tvar tpl = document.getElementById('window-type-template');
\t\t\t\t\t\t\t\t\tif (!tpl) return;
\t\t\t\t\t\t\t\t\t// <template> の innerHTML を取り出して __IDX__ を新規連番に置換し、要素化して append.
\t\t\t\t\t\t\t\t\tvar html = tpl.innerHTML.replace(/__IDX__/g, String(newIdx));
\t\t\t\t\t\t\t\t\tvar wrapper = document.createElement('div');
\t\t\t\t\t\t\t\t\twrapper.innerHTML = html.trim();
\t\t\t\t\t\t\t\t\tvar block = wrapper.firstChild;
\t\t\t\t\t\t\t\t\tcontainer.appendChild(block);
\t\t\t\t\t\t\t\t\tdecorateSubsidyGlass(block);
\t\t\t\t\t\t\t\t\tupdateRemoveButtonVisibility();
\t\t\t\t\t\t\t\t\tif (typeof recalcAll === 'function') recalcAll();
\t\t\t\t\t\t\t\t}
\t\t\t\t\t\t\t\t// 補助金対象ガラスの選択肢に「補助金対象」バッジ + 緑枠を付与する.
\t\t\t\t\t\t\t\t// 判定は calc script 側の window.glassYieldsSubsidy に委譲 (ロジック二重化を避ける)。
\t\t\t\t\t\t\t\tfunction decorateSubsidyGlass(block) {
\t\t\t\t\t\t\t\t\tif (!block || typeof window.glassYieldsSubsidy !== 'function') return;
\t\t\t\t\t\t\t\t\tvar radios = block.querySelectorAll('input[data-axis=\"pm\"]');
\t\t\t\t\t\t\t\t\tradios.forEach(function(inp) {
\t\t\t\t\t\t\t\t\t\tvar label = inp.closest('.opt-btn');
\t\t\t\t\t\t\t\t\t\tif (!label || label.querySelector('.opt-btn__subsidy-badge')) return;
\t\t\t\t\t\t\t\t\t\tif (window.glassYieldsSubsidy(inp.value)) {
\t\t\t\t\t\t\t\t\t\t\tlabel.classList.add('opt-btn--subsidy');
\t\t\t\t\t\t\t\t\t\t\tvar badge = document.createElement('span');
\t\t\t\t\t\t\t\t\t\t\tbadge.className = 'opt-btn__subsidy-badge';
\t\t\t\t\t\t\t\t\t\t\tbadge.textContent = '補助金対象';
\t\t\t\t\t\t\t\t\t\t\tlabel.appendChild(badge);
\t\t\t\t\t\t\t\t\t\t}
\t\t\t\t\t\t\t\t\t});
\t\t\t\t\t\t\t\t}
\t\t\t\t\t\t\t\tfunction removeWindowType(btn) {
\t\t\t\t\t\t\t\t\tvar block = btn.closest('.window-type-block');
\t\t\t\t\t\t\t\t\tif (!block) return;
\t\t\t\t\t\t\t\t\tblock.remove();
\t\t\t\t\t\t\t\t\treindexBlocks();
\t\t\t\t\t\t\t\t\tupdateRemoveButtonVisibility();
\t\t\t\t\t\t\t\t\tif (typeof recalcAll === 'function') recalcAll();
\t\t\t\t\t\t\t\t}
\t\t\t\t\t\t\t\tfunction updateRemoveButtonVisibility() {
\t\t\t\t\t\t\t\t\tvar blocks = document.querySelectorAll('#window-types-container .window-type-block');
\t\t\t\t\t\t\t\t\tblocks.forEach(function(b) {
\t\t\t\t\t\t\t\t\t\tvar btn = b.querySelector('.btn-remove-window-type');
\t\t\t\t\t\t\t\t\t\tif (btn) btn.style.display = blocks.length > 1 ? '' : 'none';
\t\t\t\t\t\t\t\t\t});
\t\t\t\t\t\t\t\t}
\t\t\t\t\t\t\t\tfunction reindexBlocks() {
\t\t\t\t\t\t\t\t\t// ブロック削除後に 1 から振り直し. input[name] の末尾 _N も書き換える.
\t\t\t\t\t\t\t\t\tvar blocks = document.querySelectorAll('#window-types-container .window-type-block');
\t\t\t\t\t\t\t\t\tblocks.forEach(function(b, i) {
\t\t\t\t\t\t\t\t\t\tvar n = i + 1;
\t\t\t\t\t\t\t\t\t\tb.setAttribute('data-type-idx', String(n));
\t\t\t\t\t\t\t\t\t\tvar numSpan = b.querySelector('.wt-num');
\t\t\t\t\t\t\t\t\t\tif (numSpan) numSpan.textContent = String(n);
\t\t\t\t\t\t\t\t\t\tb.querySelectorAll('input[name]').forEach(function(inp) {
\t\t\t\t\t\t\t\t\t\t\tinp.name = inp.name.replace(/_\\d+\$/, '_' + n);
\t\t\t\t\t\t\t\t\t\t});
\t\t\t\t\t\t\t\t\t});
\t\t\t\t\t\t\t\t}
\t\t\t\t\t\t\t\t// 軸変更イベント. recalcAll が定義されていれば再計算 (task 2 で実装).
\t\t\t\t\t\t\t\twindow.onWindowTypeAxisChange = function() {
\t\t\t\t\t\t\t\t\tif (typeof recalcAll === 'function') recalcAll();
\t\t\t\t\t\t\t\t};
\t\t\t\t\t\t\t\twindow.addWindowType = addWindowType;
\t\t\t\t\t\t\t\twindow.removeWindowType = removeWindowType;
\t\t\t\t\t\t\t\t// 隠し radio(opacity:0/pointer-events:none) を label で包む opt-btn は iOS で初回タップの
\t\t\t\t\t\t\t\t// change が不発になりやすい。窓タイプ/住宅区分は label に onclick が無く change 依存だった
\t\t\t\t\t\t\t\t// ため「2回タッチ/選択できない」が発生。click は確実に発火するので委譲 click で選択状態・
\t\t\t\t\t\t\t\t// is-selected・再計算を行う(JSで複製される窓タイプにも委譲で対応)。
\t\t\t\t\t\t\t\tdocument.addEventListener('click', function(ev) {
\t\t\t\t\t\t\t\t\tif (!ev.target || !ev.target.closest) return;
\t\t\t\t\t\t\t\t\tvar label = ev.target.closest('.opt-btn');
\t\t\t\t\t\t\t\t\tif (!label) return;
\t\t\t\t\t\t\t\t\tif (!label.closest('#window-types-container') && !label.closest('#window-housing-type-group')) return;
\t\t\t\t\t\t\t\t\tvar input = label.querySelector('input[type=\"radio\"]');
\t\t\t\t\t\t\t\t\tif (!input || input.disabled) return;
\t\t\t\t\t\t\t\t\tinput.checked = true;
\t\t\t\t\t\t\t\t\tvar nm = input.getAttribute('name');
\t\t\t\t\t\t\t\t\tif (nm) {
\t\t\t\t\t\t\t\t\t\tdocument.querySelectorAll('input[name=\"' + nm + '\"]').forEach(function(i) {
\t\t\t\t\t\t\t\t\t\t\tvar l = i.closest('.opt-btn');
\t\t\t\t\t\t\t\t\t\t\tif (l) l.classList.toggle('is-selected', i.checked);
\t\t\t\t\t\t\t\t\t\t});
\t\t\t\t\t\t\t\t\t}
\t\t\t\t\t\t\t\t\tif (typeof recalcAll === 'function') recalcAll();
\t\t\t\t\t\t\t\t});
\t\t\t\t\t\t\t\t// 初期表示で 1 ブロック追加 + 住宅区分ラジオの change で再計算.
\t\t\t\t\t\t\t\tdocument.addEventListener('DOMContentLoaded', function() {
\t\t\t\t\t\t\t\t\tif (document.querySelector('#window-types-container')) {
\t\t\t\t\t\t\t\t\t\taddWindowType();
\t\t\t\t\t\t\t\t\t}
\t\t\t\t\t\t\t\t\tvar housingInputs = document.querySelectorAll('input[name=\"window_housing_type\"]');
\t\t\t\t\t\t\t\t\tvar syncHousingSelectedClass = function() {
\t\t\t\t\t\t\t\t\t\thousingInputs.forEach(function(el) {
\t\t\t\t\t\t\t\t\t\t\tvar lbl = el.closest('.opt-btn');
\t\t\t\t\t\t\t\t\t\t\tif (!lbl) return;
\t\t\t\t\t\t\t\t\t\t\tif (el.checked) lbl.classList.add('is-selected');
\t\t\t\t\t\t\t\t\t\t\telse lbl.classList.remove('is-selected');
\t\t\t\t\t\t\t\t\t\t});
\t\t\t\t\t\t\t\t\t};
\t\t\t\t\t\t\t\t\tsyncHousingSelectedClass();
\t\t\t\t\t\t\t\t\thousingInputs.forEach(function(el) {
\t\t\t\t\t\t\t\t\t\tel.addEventListener('change', function() {
\t\t\t\t\t\t\t\t\t\t\tsyncHousingSelectedClass();
\t\t\t\t\t\t\t\t\t\t\tif (typeof recalcAll === 'function') recalcAll();
\t\t\t\t\t\t\t\t\t\t});
\t\t\t\t\t\t\t\t\t});
\t\t\t\t\t\t\t\t});
\t\t\t\t\t\t\t})();
\t\t\t\t\t\t\t</script>
\t\t\t\t\t\t";
}
// line 4225
echo "
\t\t\t\t\t\t<!-- 3: 施工見積(物置・ゴミステーション) -->
\t\t\t\t\t\t";
// line 4227
if ((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 4227, $this->source); })()), "SaleType", [], "any", false, false, false, 4227), "id", [], "any", false, false, false, 4227) == 3)) {
// line 4228
echo "
\t\t\t\t\t\t\t";
// line 4230
echo "\t\t\t\t\t\t\t";
if ((((isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 4230, $this->source); })()) && twig_length_filter($this->env, (isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 4230, $this->source); })()))) && (twig_join_filter((isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 4230, $this->source); })())) != ""))) {
// line 4231
echo "\t\t\t\t\t\t\t<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">幅";
// line 4232
if (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4232, $this->source); })()) && twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4232, $this->source); })()), "pw", [], "any", false, false, false, 4232))) {
echo ": <span>";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4232, $this->source); })()), "pw", [], "any", false, false, false, 4232), "html", null, true);
echo "</span>";
}
echo "</div>
\t\t\t\t\t\t\t <div class=\"opt-btn-group\">
\t\t\t\t\t\t\t ";
// line 4234
$context["idx"] = 0;
// line 4235
echo "\t\t\t\t\t\t\t ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 4235, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["pw_val"]) {
if ($context["pw_val"]) {
$context["idx"] = ((isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 4235, $this->source); })()) + 1);
// line 4236
echo "\t\t\t\t\t\t\t <label class=\"opt-btn";
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4236, $this->source); })()) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4236, $this->source); })()), "pw", [], "any", false, false, false, 4236) == $context["pw_val"])) || (twig_length_filter($this->env, (isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 4236, $this->source); })())) == 1))) {
echo " is-selected";
}
echo "\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('pw','pw3_";
// line 4237
echo twig_escape_filter($this->env, (isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 4237, $this->source); })()), "html", null, true);
echo "');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"pw\" id=\"pw3_";
// line 4238
echo twig_escape_filter($this->env, (isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 4238, $this->source); })()), "html", null, true);
echo "\" value=\"";
echo twig_escape_filter($this->env, $context["pw_val"], "html", null, true);
echo "\"
\t\t\t\t\t\t\t ";
// line 4239
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4239, $this->source); })()) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4239, $this->source); })()), "pw", [], "any", false, false, false, 4239) == $context["pw_val"])) || (twig_length_filter($this->env, (isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 4239, $this->source); })())) == 1))) {
echo "checked";
}
echo ">
\t\t\t\t\t\t\t ";
// line 4240
echo twig_escape_filter($this->env, $context["pw_val"], "html", null, true);
echo "
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t ";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['pw_val'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 4243
echo "\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t";
}
// line 4246
echo "
\t\t\t\t\t\t\t";
// line 4247
if ((((isset($context["p_d"]) || array_key_exists("p_d", $context) ? $context["p_d"] : (function () { throw new RuntimeError('Variable "p_d" does not exist.', 4247, $this->source); })()) && twig_length_filter($this->env, (isset($context["p_d"]) || array_key_exists("p_d", $context) ? $context["p_d"] : (function () { throw new RuntimeError('Variable "p_d" does not exist.', 4247, $this->source); })()))) && (twig_join_filter((isset($context["p_d"]) || array_key_exists("p_d", $context) ? $context["p_d"] : (function () { throw new RuntimeError('Variable "p_d" does not exist.', 4247, $this->source); })())) != ""))) {
// line 4248
echo "\t\t\t\t\t\t\t<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">奥行き";
// line 4249
if (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4249, $this->source); })()) && twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4249, $this->source); })()), "pd", [], "any", false, false, false, 4249))) {
echo ": <span>";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4249, $this->source); })()), "pd", [], "any", false, false, false, 4249), "html", null, true);
echo "</span>";
}
echo "</div>
\t\t\t\t\t\t\t <div class=\"opt-btn-group\">
\t\t\t\t\t\t\t ";
// line 4251
$context["idx"] = 0;
// line 4252
echo "\t\t\t\t\t\t\t ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["p_d"]) || array_key_exists("p_d", $context) ? $context["p_d"] : (function () { throw new RuntimeError('Variable "p_d" does not exist.', 4252, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["pd_val"]) {
if ($context["pd_val"]) {
$context["idx"] = ((isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 4252, $this->source); })()) + 1);
// line 4253
echo "\t\t\t\t\t\t\t <label class=\"opt-btn";
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4253, $this->source); })()) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4253, $this->source); })()), "pd", [], "any", false, false, false, 4253) == $context["pd_val"])) || (twig_length_filter($this->env, (isset($context["p_d"]) || array_key_exists("p_d", $context) ? $context["p_d"] : (function () { throw new RuntimeError('Variable "p_d" does not exist.', 4253, $this->source); })())) == 1))) {
echo " is-selected";
}
echo "\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('pd','pd3_";
// line 4254
echo twig_escape_filter($this->env, (isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 4254, $this->source); })()), "html", null, true);
echo "');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"pd\" id=\"pd3_";
// line 4255
echo twig_escape_filter($this->env, (isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 4255, $this->source); })()), "html", null, true);
echo "\" value=\"";
echo twig_escape_filter($this->env, $context["pd_val"], "html", null, true);
echo "\"
\t\t\t\t\t\t\t ";
// line 4256
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4256, $this->source); })()) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4256, $this->source); })()), "pd", [], "any", false, false, false, 4256) == $context["pd_val"])) || (twig_length_filter($this->env, (isset($context["p_d"]) || array_key_exists("p_d", $context) ? $context["p_d"] : (function () { throw new RuntimeError('Variable "p_d" does not exist.', 4256, $this->source); })())) == 1))) {
echo "checked";
}
echo ">
\t\t\t\t\t\t\t ";
// line 4257
echo twig_escape_filter($this->env, $context["pd_val"], "html", null, true);
echo "
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t ";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['pd_val'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 4260
echo "\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t";
}
// line 4263
echo "
\t\t\t\t\t\t\t";
// line 4264
if ((((isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 4264, $this->source); })()) && twig_length_filter($this->env, (isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 4264, $this->source); })()))) && (twig_join_filter((isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 4264, $this->source); })())) != ""))) {
// line 4265
echo "\t\t\t\t\t\t\t<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">高さ";
// line 4266
if (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4266, $this->source); })()) && twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4266, $this->source); })()), "ph", [], "any", false, false, false, 4266))) {
echo ": <span>";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4266, $this->source); })()), "ph", [], "any", false, false, false, 4266), "html", null, true);
echo "</span>";
}
echo "</div>
\t\t\t\t\t\t\t <div class=\"opt-btn-group\">
\t\t\t\t\t\t\t ";
// line 4268
$context["idx"] = 0;
// line 4269
echo "\t\t\t\t\t\t\t ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 4269, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["ph_val"]) {
if ($context["ph_val"]) {
$context["idx"] = ((isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 4269, $this->source); })()) + 1);
// line 4270
echo "\t\t\t\t\t\t\t <label class=\"opt-btn";
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4270, $this->source); })()) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4270, $this->source); })()), "ph", [], "any", false, false, false, 4270) == $context["ph_val"])) || (twig_length_filter($this->env, (isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 4270, $this->source); })())) == 1))) {
echo " is-selected";
}
echo "\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('ph','ph3_";
// line 4271
echo twig_escape_filter($this->env, (isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 4271, $this->source); })()), "html", null, true);
echo "');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"ph\" id=\"ph3_";
// line 4272
echo twig_escape_filter($this->env, (isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 4272, $this->source); })()), "html", null, true);
echo "\" value=\"";
echo twig_escape_filter($this->env, $context["ph_val"], "html", null, true);
echo "\"
\t\t\t\t\t\t\t ";
// line 4273
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4273, $this->source); })()) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4273, $this->source); })()), "ph", [], "any", false, false, false, 4273) == $context["ph_val"])) || (twig_length_filter($this->env, (isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 4273, $this->source); })())) == 1))) {
echo "checked";
}
echo ">
\t\t\t\t\t\t\t ";
// line 4274
echo twig_escape_filter($this->env, $context["ph_val"], "html", null, true);
echo "
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t ";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['ph_val'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 4277
echo "\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t";
}
// line 4280
echo "
\t\t\t\t\t\t\t";
// line 4282
echo "\t\t\t\t\t\t\t";
if ((((isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 4282, $this->source); })()) && twig_length_filter($this->env, (isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 4282, $this->source); })()))) && (twig_join_filter((isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 4282, $this->source); })())) != ""))) {
// line 4283
echo "\t\t\t\t\t\t\t<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">棚タイプ <small class=\"text-muted\">(間仕切り仕様)</small>";
// line 4284
if (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4284, $this->source); })()) && twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4284, $this->source); })()), "pm", [], "any", false, false, false, 4284))) {
echo ": <span>";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4284, $this->source); })()), "pm", [], "any", false, false, false, 4284), "html", null, true);
echo "</span>";
}
echo "</div>
\t\t\t\t\t\t\t <div class=\"opt-btn-group\">
\t\t\t\t\t\t\t ";
// line 4286
$context["idx"] = 0;
// line 4287
echo "\t\t\t\t\t\t\t ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 4287, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["pm_val"]) {
if ($context["pm_val"]) {
$context["idx"] = ((isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 4287, $this->source); })()) + 1);
// line 4288
echo "\t\t\t\t\t\t\t <label class=\"opt-btn";
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4288, $this->source); })()) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4288, $this->source); })()), "pm", [], "any", false, false, false, 4288) == $context["pm_val"])) || (twig_length_filter($this->env, (isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 4288, $this->source); })())) == 1))) {
echo " is-selected";
}
echo "\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('pm','pm3_";
// line 4289
echo twig_escape_filter($this->env, (isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 4289, $this->source); })()), "html", null, true);
echo "');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"pm\" id=\"pm3_";
// line 4290
echo twig_escape_filter($this->env, (isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 4290, $this->source); })()), "html", null, true);
echo "\" value=\"";
echo twig_escape_filter($this->env, $context["pm_val"], "html", null, true);
echo "\"
\t\t\t\t\t\t\t ";
// line 4291
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4291, $this->source); })()) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4291, $this->source); })()), "pm", [], "any", false, false, false, 4291) == $context["pm_val"])) || (twig_length_filter($this->env, (isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 4291, $this->source); })())) == 1))) {
echo "checked";
}
echo ">
\t\t\t\t\t\t\t ";
// line 4292
echo twig_escape_filter($this->env, $context["pm_val"], "html", null, true);
echo "
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t ";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['pm_val'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 4295
echo "\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t";
}
// line 4298
echo "
\t\t\t\t\t\t\t";
// line 4300
echo "\t\t\t\t\t\t\t";
if ((((isset($context["p_option1"]) || array_key_exists("p_option1", $context) ? $context["p_option1"] : (function () { throw new RuntimeError('Variable "p_option1" does not exist.', 4300, $this->source); })()) && twig_length_filter($this->env, (isset($context["p_option1"]) || array_key_exists("p_option1", $context) ? $context["p_option1"] : (function () { throw new RuntimeError('Variable "p_option1" does not exist.', 4300, $this->source); })()))) && (twig_join_filter((isset($context["p_option1"]) || array_key_exists("p_option1", $context) ? $context["p_option1"] : (function () { throw new RuntimeError('Variable "p_option1" does not exist.', 4300, $this->source); })())) != ""))) {
// line 4301
echo "\t\t\t\t\t\t\t<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">";
// line 4302
echo twig_escape_filter($this->env, (isset($context["option1_label"]) || array_key_exists("option1_label", $context) ? $context["option1_label"] : (function () { throw new RuntimeError('Variable "option1_label" does not exist.', 4302, $this->source); })()), "html", null, true);
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4302, $this->source); })()) && twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "option1", [], "any", true, true, false, 4302)) && twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4302, $this->source); })()), "option1", [], "any", false, false, false, 4302))) {
echo ": <span>";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4302, $this->source); })()), "option1", [], "any", false, false, false, 4302), "html", null, true);
echo "</span>";
}
echo "</div>
\t\t\t\t\t\t\t <div class=\"opt-btn-group\">
\t\t\t\t\t\t\t ";
// line 4304
$context["idx"] = 0;
// line 4305
echo "\t\t\t\t\t\t\t ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["p_option1"]) || array_key_exists("p_option1", $context) ? $context["p_option1"] : (function () { throw new RuntimeError('Variable "p_option1" does not exist.', 4305, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["opt1_val"]) {
if ($context["opt1_val"]) {
$context["idx"] = ((isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 4305, $this->source); })()) + 1);
// line 4306
echo "\t\t\t\t\t\t\t <label class=\"opt-btn";
if (((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4306, $this->source); })()) && twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "option1", [], "any", true, true, false, 4306)) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4306, $this->source); })()), "option1", [], "any", false, false, false, 4306) == $context["opt1_val"])) || (twig_length_filter($this->env, (isset($context["p_option1"]) || array_key_exists("p_option1", $context) ? $context["p_option1"] : (function () { throw new RuntimeError('Variable "p_option1" does not exist.', 4306, $this->source); })())) == 1))) {
echo " is-selected";
}
echo "\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('option1','option1_3_";
// line 4307
echo twig_escape_filter($this->env, (isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 4307, $this->source); })()), "html", null, true);
echo "');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"option1\" id=\"option1_3_";
// line 4308
echo twig_escape_filter($this->env, (isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 4308, $this->source); })()), "html", null, true);
echo "\" value=\"";
echo twig_escape_filter($this->env, $context["opt1_val"], "html", null, true);
echo "\"
\t\t\t\t\t\t\t ";
// line 4309
if (((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4309, $this->source); })()) && twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "option1", [], "any", true, true, false, 4309)) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4309, $this->source); })()), "option1", [], "any", false, false, false, 4309) == $context["opt1_val"])) || (twig_length_filter($this->env, (isset($context["p_option1"]) || array_key_exists("p_option1", $context) ? $context["p_option1"] : (function () { throw new RuntimeError('Variable "p_option1" does not exist.', 4309, $this->source); })())) == 1))) {
echo "checked";
}
echo ">
\t\t\t\t\t\t\t ";
// line 4310
echo twig_escape_filter($this->env, $context["opt1_val"], "html", null, true);
echo "
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t ";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['opt1_val'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 4313
echo "\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t";
}
// line 4316
echo "
\t\t\t\t\t\t\t";
// line 4318
echo "\t\t\t\t\t\t\t";
if (((isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 4318, $this->source); })()) && twig_length_filter($this->env, (isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 4318, $this->source); })())))) {
// line 4319
echo "\t\t\t\t\t\t\t<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">カラー";
// line 4320
if (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4320, $this->source); })()) && twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4320, $this->source); })()), "pc", [], "any", false, false, false, 4320))) {
echo ": <span>";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4320, $this->source); })()), "pc", [], "any", false, false, false, 4320), "html", null, true);
echo "</span>";
}
echo "</div>
\t\t\t\t\t\t\t <div class=\"opt-btn-group\">
\t\t\t\t\t\t\t ";
// line 4322
$context["idx"] = 0;
// line 4323
echo "\t\t\t\t\t\t\t ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 4323, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["cc"]) {
if (($context["cc"] && twig_get_attribute($this->env, $this->source, $context["cc"], "name", [], "array", false, false, false, 4323))) {
$context["idx"] = ((isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 4323, $this->source); })()) + 1);
// line 4324
echo "\t\t\t\t\t\t\t <label class=\"opt-btn";
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4324, $this->source); })()) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4324, $this->source); })()), "pc", [], "any", false, false, false, 4324) == twig_get_attribute($this->env, $this->source, $context["cc"], "name", [], "array", false, false, false, 4324))) || (twig_length_filter($this->env, (isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 4324, $this->source); })())) == 1))) {
echo " is-selected";
}
echo "\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('pc','cc3_";
// line 4325
echo twig_escape_filter($this->env, (isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 4325, $this->source); })()), "html", null, true);
echo "');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"color3\" id=\"cc3_";
// line 4326
echo twig_escape_filter($this->env, (isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 4326, $this->source); })()), "html", null, true);
echo "\" value=\"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["cc"], "name", [], "array", false, false, false, 4326), "html", null, true);
echo "\"
\t\t\t\t\t\t\t ";
// line 4327
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4327, $this->source); })()) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4327, $this->source); })()), "pc", [], "any", false, false, false, 4327) == twig_get_attribute($this->env, $this->source, $context["cc"], "name", [], "array", false, false, false, 4327))) || (twig_length_filter($this->env, (isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 4327, $this->source); })())) == 1))) {
echo "checked";
}
echo ">
\t\t\t\t\t\t\t ";
// line 4328
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["cc"], "name", [], "array", false, false, false, 4328), "html", null, true);
echo "
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t ";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['cc'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 4331
echo "\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t";
}
// line 4334
echo "
\t\t\t\t\t\t\t";
// line 4336
echo "\t\t\t\t\t\t\t<div class=\"form-group row mt-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <label class=\"col-4 col-form-label\">台数</label>
\t\t\t\t\t\t\t <div class=\"col-4\">
\t\t\t\t\t\t\t <div class=\"input-group mb-3\">
\t\t\t\t\t\t\t <input type=\"number\" name=\"daisu\" id=\"daisu\" class=\"form-control\" value=\"";
// line 4340
echo twig_escape_filter($this->env, ((twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "daisu", [], "any", true, true, false, 4340)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "daisu", [], "any", false, false, false, 4340), "1")) : ("1")), "html", null, true);
echo "\" min=\"1\" max=\"10\" onchange=\"mitsumori_simulation('daisu','daisu');\">
\t\t\t\t\t\t\t <span class=\"input-group-text\">台</span>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t <div class=\"col-4\">
\t\t\t\t\t\t\t <button type=\"button\" class=\"btn btn-info\" onclick=\"daisu(+1);\">+</button>
\t\t\t\t\t\t\t <button type=\"button\" class=\"btn btn-danger\" onclick=\"daisu(-1);\">ー</button>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t";
}
// line 4351
echo "
\t\t\t\t\t\t<!-- 4: 施工見積(フェンス・組み立て式) -->
\t\t\t\t\t\t";
// line 4353
if ((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 4353, $this->source); })()), "SaleType", [], "any", false, false, false, 4353), "id", [], "any", false, false, false, 4353) == 4)) {
// line 4354
echo "
\t\t\t\t\t\t\t";
// line 4356
echo "\t\t\t\t\t\t\t<div class=\"form-group row mt-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <label class=\"col-4 col-form-label\">枚数</label>
\t\t\t\t\t\t\t <div class=\"col-4 mb-3\">
\t\t\t\t\t\t\t <div class=\"input-group\">
\t\t\t\t\t\t\t <input type=\"number\" name=\"maisu\" id=\"maisu\" class=\"form-control\" value=\"";
// line 4360
echo twig_escape_filter($this->env, ((twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "maisu", [], "any", true, true, false, 4360)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "maisu", [], "any", false, false, false, 4360), "3")) : ("3")), "html", null, true);
echo "\" min=\"3\" max=\"20\" onchange=\"if(parseInt(this.value)<3)this.value=3; mitsumori_simulation('maisu','maisu');\">
\t\t\t\t\t\t\t <span class=\"input-group-text\">枚</span>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t <div class=\"col-4\">
\t\t\t\t\t\t\t <button type=\"button\" class=\"btn btn-info\" onclick=\"maisu(+1);\">+</button>
\t\t\t\t\t\t\t <button type=\"button\" class=\"btn btn-danger\" onclick=\"maisu(-1);\">ー</button>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t";
}
// line 4371
echo "
\t\t\t\t\t\t<!-- 5: 施工見積(ウッドデッキ・タイルデッキ) -->
\t\t\t\t\t\t";
// line 4373
if ((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 4373, $this->source); })()), "SaleType", [], "any", false, false, false, 4373), "id", [], "any", false, false, false, 4373) == 5)) {
// line 4374
echo "
\t\t\t\t\t\t\t";
// line 4376
echo "\t\t\t\t\t\t\t<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">ステップ</div>
\t\t\t\t\t\t\t <div class=\"opt-btn-group\">
\t\t\t\t\t\t\t ";
// line 4379
$context["step_yes_checked"] = (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4379, $this->source); })()) && twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "deck_step", [], "any", true, true, false, 4379)) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4379, $this->source); })()), "deck_step", [], "any", false, false, false, 4379) == "必要"));
// line 4380
echo "\t\t\t\t\t\t\t ";
$context["step_no_checked"] = ((( !(isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4380, $this->source); })()) || !twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "deck_step", [], "any", true, true, false, 4380)) || (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4380, $this->source); })()), "deck_step", [], "any", false, false, false, 4380) == "不要")) || !twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4380, $this->source); })()), "deck_step", [], "any", false, false, false, 4380));
// line 4381
echo "\t\t\t\t\t\t\t <label class=\"opt-btn";
if ((isset($context["step_yes_checked"]) || array_key_exists("step_yes_checked", $context) ? $context["step_yes_checked"] : (function () { throw new RuntimeError('Variable "step_yes_checked" does not exist.', 4381, $this->source); })())) {
echo " is-selected";
}
echo "\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('op0','deck_step_yes');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"deck_step\" id=\"deck_step_yes\" value=\"必要\"
\t\t\t\t\t\t\t ";
// line 4384
if ((isset($context["step_yes_checked"]) || array_key_exists("step_yes_checked", $context) ? $context["step_yes_checked"] : (function () { throw new RuntimeError('Variable "step_yes_checked" does not exist.', 4384, $this->source); })())) {
echo "checked";
}
echo ">
\t\t\t\t\t\t\t 必要
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t <label class=\"opt-btn";
// line 4387
if ((isset($context["step_no_checked"]) || array_key_exists("step_no_checked", $context) ? $context["step_no_checked"] : (function () { throw new RuntimeError('Variable "step_no_checked" does not exist.', 4387, $this->source); })())) {
echo " is-selected";
}
echo "\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('op0','deck_step_no');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"deck_step\" id=\"deck_step_no\" value=\"不要\"
\t\t\t\t\t\t\t ";
// line 4390
if ((isset($context["step_no_checked"]) || array_key_exists("step_no_checked", $context) ? $context["step_no_checked"] : (function () { throw new RuntimeError('Variable "step_no_checked" does not exist.', 4390, $this->source); })())) {
echo "checked";
}
echo ">
\t\t\t\t\t\t\t 不要
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t <div class=\"opt-survey-note-wd-step\" style=\"font-size:12px;color:#c00;margin-top:6px;";
// line 4394
if ( !(isset($context["step_yes_checked"]) || array_key_exists("step_yes_checked", $context) ? $context["step_yes_checked"] : (function () { throw new RuntimeError('Variable "step_yes_checked" does not exist.', 4394, $this->source); })())) {
echo "display:none;";
}
echo "\">
\t\t\t\t\t\t\t ※ 現場調査後に正式お見積もりさせていただきます。
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t";
// line 4400
echo "\t\t\t\t\t\t\t<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">デッキフェンス</div>
\t\t\t\t\t\t\t <div class=\"opt-btn-group\">
\t\t\t\t\t\t\t ";
// line 4403
$context["fence_yes_checked"] = (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4403, $this->source); })()) && twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "deck_fence", [], "any", true, true, false, 4403)) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4403, $this->source); })()), "deck_fence", [], "any", false, false, false, 4403) == "必要"));
// line 4404
echo "\t\t\t\t\t\t\t ";
$context["fence_no_checked"] = ((( !(isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4404, $this->source); })()) || !twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "deck_fence", [], "any", true, true, false, 4404)) || (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4404, $this->source); })()), "deck_fence", [], "any", false, false, false, 4404) == "不要")) || !twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4404, $this->source); })()), "deck_fence", [], "any", false, false, false, 4404));
// line 4405
echo "\t\t\t\t\t\t\t <label class=\"opt-btn";
if ((isset($context["fence_yes_checked"]) || array_key_exists("fence_yes_checked", $context) ? $context["fence_yes_checked"] : (function () { throw new RuntimeError('Variable "fence_yes_checked" does not exist.', 4405, $this->source); })())) {
echo " is-selected";
}
echo "\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('op1','deck_fence_yes');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"deck_fence\" id=\"deck_fence_yes\" value=\"必要\"
\t\t\t\t\t\t\t ";
// line 4408
if ((isset($context["fence_yes_checked"]) || array_key_exists("fence_yes_checked", $context) ? $context["fence_yes_checked"] : (function () { throw new RuntimeError('Variable "fence_yes_checked" does not exist.', 4408, $this->source); })())) {
echo "checked";
}
echo ">
\t\t\t\t\t\t\t 必要
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t <label class=\"opt-btn";
// line 4411
if ((isset($context["fence_no_checked"]) || array_key_exists("fence_no_checked", $context) ? $context["fence_no_checked"] : (function () { throw new RuntimeError('Variable "fence_no_checked" does not exist.', 4411, $this->source); })())) {
echo " is-selected";
}
echo "\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('op1','deck_fence_no');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"deck_fence\" id=\"deck_fence_no\" value=\"不要\"
\t\t\t\t\t\t\t ";
// line 4414
if ((isset($context["fence_no_checked"]) || array_key_exists("fence_no_checked", $context) ? $context["fence_no_checked"] : (function () { throw new RuntimeError('Variable "fence_no_checked" does not exist.', 4414, $this->source); })())) {
echo "checked";
}
echo ">
\t\t\t\t\t\t\t 不要
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t <div class=\"opt-survey-note-wd-fence\" style=\"font-size:12px;color:#c00;margin-top:6px;";
// line 4418
if ( !(isset($context["fence_yes_checked"]) || array_key_exists("fence_yes_checked", $context) ? $context["fence_yes_checked"] : (function () { throw new RuntimeError('Variable "fence_yes_checked" does not exist.', 4418, $this->source); })())) {
echo "display:none;";
}
echo "\">
\t\t\t\t\t\t\t ※ 現場調査後に正式お見積もりさせていただきます。
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t";
}
// line 4424
echo "
\t\t\t\t\t\t<!-- 6: 施工見積(芝生・枚数・数量買い) -->
\t\t\t\t\t\t";
// line 4426
if ((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 4426, $this->source); })()), "SaleType", [], "any", false, false, false, 4426), "id", [], "any", false, false, false, 4426) == 6)) {
// line 4427
echo "
\t\t\t\t\t\t\t";
// line 4429
echo "\t\t\t\t\t\t\t";
if ((((isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 4429, $this->source); })()) && twig_length_filter($this->env, (isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 4429, $this->source); })()))) && (twig_join_filter((isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 4429, $this->source); })())) != ""))) {
// line 4430
echo "\t\t\t\t\t\t\t<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">規格";
// line 4431
if (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4431, $this->source); })()) && twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4431, $this->source); })()), "pm", [], "any", false, false, false, 4431))) {
echo ": <span>";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4431, $this->source); })()), "pm", [], "any", false, false, false, 4431), "html", null, true);
echo "</span>";
}
echo "</div>
\t\t\t\t\t\t\t <div class=\"opt-btn-group\">
\t\t\t\t\t\t\t ";
// line 4433
$context["idx"] = 0;
// line 4434
echo "\t\t\t\t\t\t\t ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 4434, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["pm_val"]) {
if ($context["pm_val"]) {
$context["idx"] = ((isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 4434, $this->source); })()) + 1);
// line 4435
echo "\t\t\t\t\t\t\t <label class=\"opt-btn";
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4435, $this->source); })()) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4435, $this->source); })()), "pm", [], "any", false, false, false, 4435) == $context["pm_val"])) || (twig_length_filter($this->env, (isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 4435, $this->source); })())) == 1))) {
echo " is-selected";
}
echo "\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('pm','pm6_";
// line 4436
echo twig_escape_filter($this->env, (isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 4436, $this->source); })()), "html", null, true);
echo "');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"pm\" id=\"pm6_";
// line 4437
echo twig_escape_filter($this->env, (isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 4437, $this->source); })()), "html", null, true);
echo "\" value=\"";
echo twig_escape_filter($this->env, $context["pm_val"], "html", null, true);
echo "\"
\t\t\t\t\t\t\t ";
// line 4438
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4438, $this->source); })()) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4438, $this->source); })()), "pm", [], "any", false, false, false, 4438) == $context["pm_val"])) || (twig_length_filter($this->env, (isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 4438, $this->source); })())) == 1))) {
echo "checked";
}
echo ">
\t\t\t\t\t\t\t ";
// line 4439
echo twig_escape_filter($this->env, $context["pm_val"], "html", null, true);
echo "
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t ";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['pm_val'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 4442
echo "\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t";
}
// line 4445
echo "
\t\t\t\t\t\t\t";
// line 4448
echo "\t\t\t\t\t\t\t";
if ((((isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 4448, $this->source); })()) && twig_length_filter($this->env, (isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 4448, $this->source); })()))) && (twig_join_filter((isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 4448, $this->source); })())) != ""))) {
// line 4449
echo "\t\t\t\t\t\t\t<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">芝の幅";
// line 4450
if (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4450, $this->source); })()) && twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4450, $this->source); })()), "pw", [], "any", false, false, false, 4450))) {
echo ": <span>";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4450, $this->source); })()), "pw", [], "any", false, false, false, 4450), "html", null, true);
echo "</span>";
}
echo "</div>
\t\t\t\t\t\t\t <div class=\"opt-btn-group\">
\t\t\t\t\t\t\t ";
// line 4452
$context["idx"] = 0;
// line 4453
echo "\t\t\t\t\t\t\t ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 4453, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["pw_val"]) {
if ($context["pw_val"]) {
$context["idx"] = ((isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 4453, $this->source); })()) + 1);
// line 4454
echo "\t\t\t\t\t\t\t <label class=\"opt-btn";
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4454, $this->source); })()) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4454, $this->source); })()), "pw", [], "any", false, false, false, 4454) == $context["pw_val"])) || (twig_length_filter($this->env, (isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 4454, $this->source); })())) == 1))) {
echo " is-selected";
}
echo "\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('pw','pw6_";
// line 4455
echo twig_escape_filter($this->env, (isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 4455, $this->source); })()), "html", null, true);
echo "');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"pw\" id=\"pw6_";
// line 4456
echo twig_escape_filter($this->env, (isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 4456, $this->source); })()), "html", null, true);
echo "\" value=\"";
echo twig_escape_filter($this->env, $context["pw_val"], "html", null, true);
echo "\"
\t\t\t\t\t\t\t ";
// line 4457
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4457, $this->source); })()) && (twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4457, $this->source); })()), "pw", [], "any", false, false, false, 4457) == $context["pw_val"])) || (twig_length_filter($this->env, (isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 4457, $this->source); })())) == 1))) {
echo "checked";
}
echo ">
\t\t\t\t\t\t\t ";
// line 4458
echo twig_escape_filter($this->env, $context["pw_val"], "html", null, true);
echo "
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t ";
}
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['pw_val'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 4461
echo "\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t";
}
// line 4464
echo "
\t\t\t\t\t\t\t";
// line 4466
echo "\t\t\t\t\t\t\t";
$context["_roll_h"] = (((array_key_exists("p_h", $context) && twig_length_filter($this->env, (isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 4466, $this->source); })())))) ? (twig_first($this->env, (isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 4466, $this->source); })()))) : (""));
// line 4467
echo "\t\t\t\t\t\t\t";
if ((isset($context["_roll_h"]) || array_key_exists("_roll_h", $context) ? $context["_roll_h"] : (function () { throw new RuntimeError('Variable "_roll_h" does not exist.', 4467, $this->source); })())) {
// line 4468
echo "\t\t\t\t\t\t\t<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">1ロールの長さ:<span style=\"font-weight:bold;\">";
// line 4469
if (twig_in_filter("cm", (isset($context["_roll_h"]) || array_key_exists("_roll_h", $context) ? $context["_roll_h"] : (function () { throw new RuntimeError('Variable "_roll_h" does not exist.', 4469, $this->source); })()))) {
echo twig_escape_filter($this->env, (twig_trim_filter(twig_replace_filter((isset($context["_roll_h"]) || array_key_exists("_roll_h", $context) ? $context["_roll_h"] : (function () { throw new RuntimeError('Variable "_roll_h" does not exist.', 4469, $this->source); })()), ["cm" => "", "," => ""])) / 100), "html", null, true);
echo "m";
} else {
echo twig_escape_filter($this->env, (isset($context["_roll_h"]) || array_key_exists("_roll_h", $context) ? $context["_roll_h"] : (function () { throw new RuntimeError('Variable "_roll_h" does not exist.', 4469, $this->source); })()), "html", null, true);
}
echo "</span></div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t";
}
// line 4472
echo "
\t\t\t\t\t\t\t";
// line 4475
echo "\t\t\t\t\t\t\t<div class=\"form-group row mt-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <label class=\"col-4 col-form-label\">施工サイズ</label>
\t\t\t\t\t\t\t <div class=\"col-8\">
\t\t\t\t\t\t\t <div class=\"input-group\">
\t\t\t\t\t\t\t <input type=\"number\" name=\"tf_len\" id=\"tf_len\"
\t\t\t\t\t\t\t class=\"form-control\"
\t\t\t\t\t\t\t value=\"";
// line 4481
echo twig_escape_filter($this->env, ((twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "tf_len", [], "any", true, true, false, 4481)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "tf_len", [], "any", false, false, false, 4481), "")) : ("")), "html", null, true);
echo "\"
\t\t\t\t\t\t\t placeholder=\"縦\" min=\"0.1\" step=\"0.1\"
\t\t\t\t\t\t\t onchange=\"mitsumori_simulation('tf_len','tf_len');\">
\t\t\t\t\t\t\t <span class=\"input-group-text\">m ×</span>
\t\t\t\t\t\t\t <input type=\"number\" name=\"tf_wid\" id=\"tf_wid\"
\t\t\t\t\t\t\t class=\"form-control\"
\t\t\t\t\t\t\t value=\"";
// line 4487
echo twig_escape_filter($this->env, ((twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "tf_wid", [], "any", true, true, false, 4487)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "tf_wid", [], "any", false, false, false, 4487), "")) : ("")), "html", null, true);
echo "\"
\t\t\t\t\t\t\t placeholder=\"横\" min=\"0.1\" step=\"0.1\"
\t\t\t\t\t\t\t onchange=\"mitsumori_simulation('tf_wid','tf_wid');\">
\t\t\t\t\t\t\t <span class=\"input-group-text\">m</span>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t ";
// line 4493
echo "\t\t\t\t\t\t\t <input type=\"hidden\" name=\"area\" id=\"area\" value=\"";
echo twig_escape_filter($this->env, ((twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "area", [], "any", true, true, false, 4493)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "area", [], "any", false, false, false, 4493), "")) : ("")), "html", null, true);
echo "\">
\t\t\t\t\t\t\t ";
// line 4496
echo "\t\t\t\t\t\t\t <div style=\"margin-top:10px;display:inline-block;background:#fff3cd;border:1px solid #ffe69c;border-radius:6px;padding:8px 14px;font-size:16px;color:#c00;font-weight:bold;\">
\t\t\t\t\t\t\t 必要枚数:<input type=\"number\" name=\"tf_qty\" id=\"tf_qty\"
\t\t\t\t\t\t\t value=\"";
// line 4498
echo twig_escape_filter($this->env, ((twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "tf_qty", [], "any", true, true, false, 4498)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "tf_qty", [], "any", false, false, false, 4498), "1")) : ("1")), "html", null, true);
echo "\" min=\"1\" step=\"1\"
\t\t\t\t\t\t\t style=\"width:80px;font-size:22px;font-weight:bold;color:#c00;text-align:right;border:1px solid #ffe69c;border-radius:4px;padding:2px 6px;\"
\t\t\t\t\t\t\t onchange=\"mitsumori_simulation('tf_qty','tf_qty');\"> 枚
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t <div style=\"margin-top:6px;font-size:12px;color:#666;\">※ 施工サイズを入力すると必要枚数を自動計算します。サイズが分からない場合は枚数を直接ご指定ください。</div>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t";
}
// line 4507
echo "
\t\t\t\t\t\t<!-- 7: 施工見積(数量買い・基本工事費固定) -->
\t\t\t\t\t\t";
// line 4509
if ((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 4509, $this->source); })()), "SaleType", [], "any", false, false, false, 4509), "id", [], "any", false, false, false, 4509) == 7)) {
// line 4510
echo "\t\t\t\t\t\t\t";
// line 4511
echo "\t\t\t\t\t\t\t<div class=\"form-group row mt-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <label class=\"col-4 col-form-label\">個数</label>
\t\t\t\t\t\t\t <div class=\"col-4\">
\t\t\t\t\t\t\t <div class=\"input-group mb-3\">
\t\t\t\t\t\t\t <input type=\"number\" name=\"suuryou\" id=\"suuryou\" class=\"form-control\"
\t\t\t\t\t\t\t value=\"";
// line 4516
echo twig_escape_filter($this->env, ((twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "suuryou", [], "any", true, true, false, 4516)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "suuryou", [], "any", false, false, false, 4516), "1")) : ("1")), "html", null, true);
echo "\" min=\"1\" max=\"100\"
\t\t\t\t\t\t\t onchange=\"mitsumori_simulation('suuryou','suuryou');\">
\t\t\t\t\t\t\t <span class=\"input-group-text\">個</span>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t <div class=\"col-4\">
\t\t\t\t\t\t\t <button type=\"button\" class=\"btn btn-info\" onclick=\"suuryou(+1);\">+</button>
\t\t\t\t\t\t\t <button type=\"button\" class=\"btn btn-danger\" onclick=\"suuryou(-1);\">ー</button>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t";
}
// line 4527
echo "
\t\t\t\t\t\t<!-- 9: 商品のみ購入 -->
\t\t\t\t\t\t";
// line 4529
if ((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 4529, $this->source); })()), "SaleType", [], "any", false, false, false, 4529), "id", [], "any", false, false, false, 4529) == 9)) {
// line 4530
echo "\t\t\t\t\t\t\t<div class=\"form-group row mt-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <label class=\"col-4 col-form-label\">数量</label>
\t\t\t\t\t\t\t <div class=\"col-4\">
\t\t\t\t\t\t\t <div class=\"input-group mb-3\">
\t\t\t\t\t\t\t <input type=\"number\" name=\"quantity_only\" id=\"quantity_only\" class=\"form-control\" value=\"1\" min=\"1\" onchange=\"\$('#quantity').val(this.value);\">
\t\t\t\t\t\t\t <span class=\"input-group-text\">個</span>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t <div class=\"col-4\">
\t\t\t\t\t\t\t <button type=\"button\" class=\"btn btn-info\" onclick=\"quantityOnly(+1);\">+</button>
\t\t\t\t\t\t\t <button type=\"button\" class=\"btn btn-danger\" onclick=\"quantityOnly(-1);\">ー</button>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t";
}
// line 4544
echo "
\t\t\t\t\t <div class=\"row\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\"><label class=\"col-12 col-form-label\">取り付け工事のご希望に関してお答えください。</label></div>
\t\t\t\t\t\t";
// line 4552
echo "\t\t\t\t\t\t";
$context["is_gs"] = false;
// line 4553
echo "\t\t\t\t\t\t";
$context["is_cg"] = false;
// line 4554
echo "\t\t\t\t\t\t";
if ( !twig_test_empty(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 4554, $this->source); })()), "ProductCategories", [], "any", false, false, false, 4554))) {
// line 4555
echo "\t\t\t\t\t\t\t";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 4555, $this->source); })()), "ProductCategories", [], "any", false, false, false, 4555));
foreach ($context['_seq'] as $context["_key"] => $context["ProductCategory"]) {
// line 4556
echo "\t\t\t\t\t\t\t\t";
if ((twig_get_attribute($this->env, $this->source, $context["ProductCategory"], "category_id", [], "any", false, false, false, 4556) == 27)) {
$context["is_gs"] = true;
}
// line 4557
echo "\t\t\t\t\t\t\t\t";
if ((twig_get_attribute($this->env, $this->source, $context["ProductCategory"], "category_id", [], "any", false, false, false, 4557) == 9)) {
$context["is_cg"] = true;
}
// line 4558
echo "\t\t\t\t\t\t\t";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['ProductCategory'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 4559
echo "\t\t\t\t\t\t";
}
// line 4560
echo "\t\t\t\t\t\t";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable(range(0, 10));
foreach ($context['_seq'] as $context["_key"] => $context["i"]) {
// line 4561
echo "\t\t\t\t\t\t\t";
if (((isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 4561, $this->source); })()) && (twig_length_filter($this->env, (isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 4561, $this->source); })())) >= ($context["i"] + 1)))) {
// line 4562
echo "\t\t\t\t\t\t\t";
if (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 4562, $this->source); })()), $context["i"], [], "array", false, false, false, 4562), "name", [], "array", false, false, false, 4562)) {
// line 4563
echo "\t\t\t\t\t\t\t";
$context["hide_opt"] = false;
// line 4564
echo "\t\t\t\t\t\t\t";
if (((isset($context["is_gs"]) || array_key_exists("is_gs", $context) ? $context["is_gs"] : (function () { throw new RuntimeError('Variable "is_gs" does not exist.', 4564, $this->source); })()) && (preg_match("/撤去/", twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 4564, $this->source); })()), $context["i"], [], "array", false, false, false, 4564), "name", [], "array", false, false, false, 4564)) || preg_match("/残土/", twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 4564, $this->source); })()), $context["i"], [], "array", false, false, false, 4564), "name", [], "array", false, false, false, 4564))))) {
// line 4565
echo "\t\t\t\t\t\t\t\t";
$context["hide_opt"] = true;
// line 4566
echo "\t\t\t\t\t\t\t";
}
// line 4567
echo "\t\t\t\t\t\t\t";
if (((isset($context["is_cg"]) || array_key_exists("is_cg", $context) ? $context["is_cg"] : (function () { throw new RuntimeError('Variable "is_cg" does not exist.', 4567, $this->source); })()) && preg_match("/残土/", twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 4567, $this->source); })()), $context["i"], [], "array", false, false, false, 4567), "name", [], "array", false, false, false, 4567)))) {
// line 4568
echo "\t\t\t\t\t\t\t\t";
$context["hide_opt"] = true;
// line 4569
echo "\t\t\t\t\t\t\t";
}
// line 4570
echo "\t\t\t\t\t\t\t";
if ( !(isset($context["hide_opt"]) || array_key_exists("hide_opt", $context) ? $context["hide_opt"] : (function () { throw new RuntimeError('Variable "hide_opt" does not exist.', 4570, $this->source); })())) {
// line 4571
echo "\t\t\t\t\t\t\t";
// line 4573
echo "\t\t\t\t\t\t\t";
$context["is_removal_unknown"] = (((((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["op"] ?? null), $context["i"], [], "array", false, true, false, 4573), "price", [], "array", true, true, false, 4573)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["op"] ?? null), $context["i"], [], "array", false, true, false, 4573), "price", [], "array", false, false, false, 4573), 0)) : (0)) == 0) || (((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["op"] ?? null), $context["i"], [], "array", false, true, false, 4573), "price", [], "array", true, true, false, 4573)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["op"] ?? null), $context["i"], [], "array", false, true, false, 4573), "price", [], "array", false, false, false, 4573), "0")) : ("0")) == "0")) && ((preg_match("/解体/", twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, // line 4574
(isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 4574, $this->source); })()), $context["i"], [], "array", false, false, false, 4574), "name", [], "array", false, false, false, 4574)) || preg_match("/撤去/", twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 4574, $this->source); })()), $context["i"], [], "array", false, false, false, 4574), "name", [], "array", false, false, false, 4574))) || preg_match("/設置場所/", twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 4574, $this->source); })()), $context["i"], [], "array", false, false, false, 4574), "name", [], "array", false, false, false, 4574))));
// line 4575
echo "\t\t\t\t\t\t\t";
// line 4576
echo "\t\t\t\t\t\t\t";
$context["is_tf_kouji"] = ((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 4576, $this->source); })()), "SaleType", [], "any", false, false, false, 4576), "id", [], "any", false, false, false, 4576) == 6) && preg_match("/取り付け工事/", twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 4576, $this->source); })()), $context["i"], [], "array", false, false, false, 4576), "name", [], "array", false, false, false, 4576)));
// line 4577
echo "\t\t\t\t\t\t\t<div class=\"form-group mt-3 pb-3\" data-op-idx=\"";
echo twig_escape_filter($this->env, $context["i"], "html", null, true);
echo "\" data-op-name=\"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 4577, $this->source); })()), $context["i"], [], "array", false, false, false, 4577), "name", [], "array", false, false, false, 4577), "html_attr");
echo "\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">";
// line 4579
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 4579, $this->source); })()), $context["i"], [], "array", false, false, false, 4579), "name", [], "array", false, false, false, 4579), "html", null, true);
if (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4579, $this->source); })()) && twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4579, $this->source); })()), "op", [], "any", false, false, false, 4579), $context["i"], [], "array", false, false, false, 4579))) {
echo ": <span>";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4579, $this->source); })()), "op", [], "any", false, false, false, 4579), $context["i"], [], "array", false, false, false, 4579), "html", null, true);
echo "</span>";
}
echo "</div>
\t\t\t\t\t\t\t ";
// line 4580
if (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 4580, $this->source); })()), $context["i"], [], "array", false, false, false, 4580), "comment", [], "array", false, false, false, 4580)) {
echo "<div class=\"opt-comment\" style=\"font-size:12px;color:#666;margin:4px 0 6px;\">";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 4580, $this->source); })()), $context["i"], [], "array", false, false, false, 4580), "comment", [], "array", false, false, false, 4580), "html", null, true);
echo "</div>";
}
// line 4581
echo "\t\t\t\t\t\t\t <div class=\"opt-btn-group\">
\t\t\t\t\t\t\t ";
// line 4584
echo "\t\t\t\t\t\t\t <label class=\"opt-btn";
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4584, $this->source); })()) && (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4584, $this->source); })()), "op", [], "any", false, false, false, 4584), $context["i"], [], "array", false, false, false, 4584) == twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 4584, $this->source); })()), $context["i"], [], "array", false, false, false, 4584), "on", [], "array", false, false, false, 4584))) || !twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 4584, $this->source); })()), $context["i"], [], "array", false, false, false, 4584), "off", [], "array", false, false, false, 4584))) {
echo " is-selected";
}
echo "\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('op";
// line 4585
echo twig_escape_filter($this->env, $context["i"], "html", null, true);
echo "','op";
echo twig_escape_filter($this->env, $context["i"], "html", null, true);
echo "_1');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"op";
// line 4586
echo twig_escape_filter($this->env, $context["i"], "html", null, true);
echo "\" id=\"op";
echo twig_escape_filter($this->env, $context["i"], "html", null, true);
echo "_1\" value=\"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 4586, $this->source); })()), $context["i"], [], "array", false, false, false, 4586), "on", [], "array", false, false, false, 4586), "html", null, true);
echo "\" ";
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4586, $this->source); })()) && (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4586, $this->source); })()), "op", [], "any", false, false, false, 4586), $context["i"], [], "array", false, false, false, 4586) == twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 4586, $this->source); })()), $context["i"], [], "array", false, false, false, 4586), "on", [], "array", false, false, false, 4586))) || !twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 4586, $this->source); })()), $context["i"], [], "array", false, false, false, 4586), "off", [], "array", false, false, false, 4586))) {
echo "checked";
}
echo ">
\t\t\t\t\t\t\t ";
// line 4587
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 4587, $this->source); })()), $context["i"], [], "array", false, false, false, 4587), "on", [], "array", false, false, false, 4587), "html", null, true);
echo "
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t ";
// line 4589
if (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 4589, $this->source); })()), $context["i"], [], "array", false, false, false, 4589), "off", [], "array", false, false, false, 4589)) {
// line 4590
echo "\t\t\t\t\t\t\t <label class=\"opt-btn";
if (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4590, $this->source); })()) && (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4590, $this->source); })()), "op", [], "any", false, false, false, 4590), $context["i"], [], "array", false, false, false, 4590) == twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 4590, $this->source); })()), $context["i"], [], "array", false, false, false, 4590), "off", [], "array", false, false, false, 4590)))) {
echo " is-selected";
}
echo "\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('op";
// line 4591
echo twig_escape_filter($this->env, $context["i"], "html", null, true);
echo "','op";
echo twig_escape_filter($this->env, $context["i"], "html", null, true);
echo "_2');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"op";
// line 4592
echo twig_escape_filter($this->env, $context["i"], "html", null, true);
echo "\" id=\"op";
echo twig_escape_filter($this->env, $context["i"], "html", null, true);
echo "_2\" value=\"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 4592, $this->source); })()), $context["i"], [], "array", false, false, false, 4592), "off", [], "array", false, false, false, 4592), "html", null, true);
echo "\" ";
if (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4592, $this->source); })()) && (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4592, $this->source); })()), "op", [], "any", false, false, false, 4592), $context["i"], [], "array", false, false, false, 4592) == twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 4592, $this->source); })()), $context["i"], [], "array", false, false, false, 4592), "off", [], "array", false, false, false, 4592)))) {
echo "checked";
}
echo ">
\t\t\t\t\t\t\t ";
// line 4593
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 4593, $this->source); })()), $context["i"], [], "array", false, false, false, 4593), "off", [], "array", false, false, false, 4593), "html", null, true);
echo "
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t ";
}
// line 4596
echo "\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t ";
// line 4597
if (((isset($context["is_removal_unknown"]) || array_key_exists("is_removal_unknown", $context) ? $context["is_removal_unknown"] : (function () { throw new RuntimeError('Variable "is_removal_unknown" does not exist.', 4597, $this->source); })()) || (isset($context["is_tf_kouji"]) || array_key_exists("is_tf_kouji", $context) ? $context["is_tf_kouji"] : (function () { throw new RuntimeError('Variable "is_tf_kouji" does not exist.', 4597, $this->source); })()))) {
// line 4598
echo "\t\t\t\t\t\t\t <div class=\"opt-survey-note\" data-op-idx=\"";
echo twig_escape_filter($this->env, $context["i"], "html", null, true);
echo "\" style=\"font-size:12px;color:#c00;margin-top:6px;";
if ( !((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4598, $this->source); })()) && (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4598, $this->source); })()), "op", [], "any", false, false, false, 4598), $context["i"], [], "array", false, false, false, 4598) == twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 4598, $this->source); })()), $context["i"], [], "array", false, false, false, 4598), "on", [], "array", false, false, false, 4598)))) {
echo "display:none;";
}
echo "\">
\t\t\t\t\t\t\t ※ 現場調査後に正式お見積もりさせていただきます。
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t ";
}
// line 4602
echo "\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t";
}
// line 4604
echo "\t\t\t\t\t\t\t";
}
// line 4605
echo "\t\t\t\t\t\t\t";
}
// line 4606
echo "\t\t\t\t\t\t";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['i'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 4607
echo "
\t\t\t\t\t\t";
// line 4611
echo "\t\t\t\t\t\t";
if ((((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 4611, $this->source); })()), "SaleType", [], "any", false, false, false, 4611), "id", [], "any", false, false, false, 4611) == 4) && (isset($context["oi"]) || array_key_exists("oi", $context) ? $context["oi"] : (function () { throw new RuntimeError('Variable "oi" does not exist.', 4611, $this->source); })())) && twig_get_attribute($this->env, $this->source, (isset($context["oi"]) || array_key_exists("oi", $context) ? $context["oi"] : (function () { throw new RuntimeError('Variable "oi" does not exist.', 4611, $this->source); })()), "fe_block", [], "any", false, false, false, 4611))) {
// line 4612
echo "\t\t\t\t\t\t<div id=\"fe-block-options\" class=\"form-group mt-3 pb-3\" style=\"display:none;border-bottom:1px solid rgba(0,0,0,.125)\"></div>
\t\t\t\t\t\t";
}
// line 4614
echo "
\t\t\t\t\t\t";
// line 4617
echo "\t\t\t\t\t\t<div id=\"tg-options\" class=\"tg-options-container col-12\"></div>
\t\t\t\t\t </div>
\t\t\t\t\t <!-- /.card-body -->
\t\t\t\t\t</div>
<form action=\"";
// line 4624
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("product_add_cart", ["id" => twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 4624, $this->source); })()), "id", [], "any", false, false, false, 4624)]), "html", null, true);
echo "\" method=\"post\" id=\"form1\" name=\"form1\">
";
// line 4625
if (twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 4625, $this->source); })()), "stock_find", [], "any", false, false, false, 4625)) {
// line 4626
echo " <div class=\"ec-productRole__actions\">
";
// line 4627
if (twig_get_attribute($this->env, $this->source, ($context["form"] ?? null), "classcategory_id1", [], "any", true, true, false, 4627)) {
// line 4628
echo " <div class=\"ec-select\">
";
// line 4629
echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 4629, $this->source); })()), "classcategory_id1", [], "any", false, false, false, 4629), 'row');
echo "
";
// line 4630
echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 4630, $this->source); })()), "classcategory_id1", [], "any", false, false, false, 4630), 'errors');
echo "
</div>
";
// line 4632
if (twig_get_attribute($this->env, $this->source, ($context["form"] ?? null), "classcategory_id2", [], "any", true, true, false, 4632)) {
// line 4633
echo " <div class=\"ec-select\">
";
// line 4634
echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 4634, $this->source); })()), "classcategory_id2", [], "any", false, false, false, 4634), 'row');
echo "
";
// line 4635
echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 4635, $this->source); })()), "classcategory_id2", [], "any", false, false, false, 4635), 'errors');
echo "
</div>
";
}
// line 4638
echo " ";
}
// line 4639
echo " <div class=\"ec-numberInput\">
";
// line 4640
echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 4640, $this->source); })()), "quantity", [], "any", false, false, false, 4640), 'widget', ["type" => "hidden"]);
echo "
";
// line 4641
echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock(twig_get_attribute($this->env, $this->source, (isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 4641, $this->source); })()), "quantity", [], "any", false, false, false, 4641), 'errors');
echo "
</div>
</div>
";
} else {
// line 4646
echo " <div class=\"ec-productRole__btn\">
<button type=\"button\" class=\"ec-blockBtn--action\" disabled=\"disabled\">
";
// line 4648
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("ただいま品切れ中です。"), "html", null, true);
echo "
</button>
</div>
";
}
// line 4652
echo " <div class=\"ec-productRole__btn mt-3\">
<button type=\"submit\" id=\"cart_btn\" class=\"ec-blockBtn--action add-cart\">カートに入れる</button>
</div>
";
// line 4655
echo $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->searchAndRenderBlock((isset($context["form"]) || array_key_exists("form", $context) ? $context["form"] : (function () { throw new RuntimeError('Variable "form" does not exist.', 4655, $this->source); })()), 'rest');
echo "
</form>
<div class=\"ec-modal add-cart-modal\">
<div class=\"ec-modal-overlay\">
<div class=\"ec-modal-wrap add-cart-modal__wrap\">
<span class=\"ec-modal-close\"><span class=\"ec-icon\"><img src=\"";
// line 4660
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("assets/icon/cross-dark.svg"), "html", null, true);
echo "\" alt=\"\"/></span></span>
<div id=\"ec-modal-header\" class=\"text-center add-cart-modal__header\">";
// line 4661
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("カートに追加しました。"), "html", null, true);
echo "</div>
<div class=\"ec-modal-box add-cart-modal__box\">
<div class=\"ec-role add-cart-modal__actions\">
<a href=\"";
// line 4664
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("cart");
echo "\" class=\"ec-inlineBtn--action add-cart-modal__primary\">";
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("カートに進む"), "html", null, true);
echo "</a>
<span class=\"ec-inlineBtn--cancel add-cart-modal__secondary\">";
// line 4665
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("商品検索を続ける"), "html", null, true);
echo "</span>
</div>
</div>
</div>
</div>
</div>
<div class=\"ec-productRole__description\">";
// line 4671
echo twig_nl2br(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 4671, $this->source); })()), "description_detail", [], "any", false, false, false, 4671));
echo "
</div>
";
// line 4675
echo " <div class=\"ec-productRole__share\">
<ul class=\"ec-share\">
<li class=\"ec-share__item\">
<a href=\"https://twitter.com/share?url=";
// line 4678
echo twig_escape_filter($this->env, twig_urlencode_filter(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 4678, $this->source); })()), "request", [], "any", false, false, false, 4678), "uri", [], "any", false, false, false, 4678)), "html", null, true);
echo "&text=";
echo twig_escape_filter($this->env, twig_urlencode_filter(twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 4678, $this->source); })()), "name", [], "any", false, false, false, 4678)), "html", null, true);
echo "\" class=\"ec-share__link ec-share__link--twitter\" target=\"_blank\" rel=\"noreferrer noopener\">
<i class=\"fab fa-twitter\"></i>
</a>
</li>
<li class=\"ec-share__item\">
<a href=\"https://www.facebook.com/sharer/sharer.php?u=";
// line 4683
echo twig_escape_filter($this->env, twig_urlencode_filter(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 4683, $this->source); })()), "request", [], "any", false, false, false, 4683), "uri", [], "any", false, false, false, 4683)), "html", null, true);
echo "\" class=\"ec-share__link ec-share__link--facebook\" target=\"_blank\" rel=\"noreferrer noopener\">
<i class=\"fab fa-facebook-f\"></i>
</a>
</li>
<li class=\"ec-share__item\">
<a href=\"https://social-plugins.line.me/lineit/share?url=";
// line 4688
echo twig_escape_filter($this->env, twig_urlencode_filter(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 4688, $this->source); })()), "request", [], "any", false, false, false, 4688), "uri", [], "any", false, false, false, 4688)), "html", null, true);
echo "\" class=\"ec-share__link ec-share__link--line\" target=\"_blank\" rel=\"noreferrer noopener\">
<i class=\"fab fa-line\"></i>
</a>
</li>
</ul>
</div>
</div>
\t\t\t\t";
// line 4696
echo "\t\t\t\t<div id=\"sp-mitsumori-bar\">
\t\t\t\t <div class=\"sp-bar__pricewrap\">
\t\t\t\t <div class=\"sp-bar__label\">合計(工事費・税抜)</div>
\t\t\t\t <div class=\"sp-bar__price\" id=\"sp-mitsumori-price\">---円</div>
\t\t\t\t </div>
\t\t\t\t <button type=\"button\" class=\"sp-bar__detail-btn\"
\t\t\t\t onclick=\"openSpMitsumoriDetail();\" title=\"お見積りの詳細(内訳)を表示\">
\t\t\t\t <i class=\"far fa-file-alt\"></i>
\t\t\t\t <span>詳細</span>
\t\t\t\t </button>
\t\t\t\t <button type=\"button\" class=\"sp-bar__btn\"
\t\t\t\t onclick=\"document.getElementById('cart_btn2') && document.getElementById('cart_btn2').click();\">
\t\t\t\t <i class=\"fas fa-shopping-cart\"></i>
\t\t\t\t <span class=\"sp-bar__btn-label\">カートへ</span>
\t\t\t\t ";
// line 4710
$context["spTotalQty"] = $this->extensions['Eccube\Twig\Extension\CartServiceExtension']->get_carts_total_quantity();
// line 4711
echo "\t\t\t\t ";
if (((isset($context["spTotalQty"]) || array_key_exists("spTotalQty", $context) ? $context["spTotalQty"] : (function () { throw new RuntimeError('Variable "spTotalQty" does not exist.', 4711, $this->source); })()) > 0)) {
// line 4712
echo "\t\t\t\t <span class=\"sp-bar__cart-badge\">";
echo twig_escape_filter($this->env, twig_number_format_filter($this->env, (isset($context["spTotalQty"]) || array_key_exists("spTotalQty", $context) ? $context["spTotalQty"] : (function () { throw new RuntimeError('Variable "spTotalQty" does not exist.', 4712, $this->source); })())), "html", null, true);
echo "</span>
\t\t\t\t ";
}
// line 4714
echo "\t\t\t\t </button>
\t\t\t\t <a href=\"";
// line 4715
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("homepage");
echo "\" class=\"sp-bar__home-btn\" title=\"トップページへ\">
\t\t\t\t <i class=\"fas fa-home\"></i>
\t\t\t\t </a>
\t\t\t\t</div>
\t\t\t\t";
// line 4721
echo "\t\t\t\t";
// line 4723
echo "\t\t\t\t<div id=\"sp-mitsumori-detail\" class=\"sp-detail-sheet\" aria-hidden=\"true\">
\t\t\t\t <div class=\"sp-detail-sheet__overlay\" onclick=\"closeSpMitsumoriDetail();\"></div>
\t\t\t\t <div class=\"sp-detail-sheet__panel\" role=\"dialog\" aria-label=\"お見積りの詳細\">
\t\t\t\t <div class=\"sp-detail-sheet__header\">
\t\t\t\t <span class=\"sp-detail-sheet__title\">お見積りの詳細</span>
\t\t\t\t <button type=\"button\" class=\"sp-detail-sheet__close\" onclick=\"closeSpMitsumoriDetail();\" aria-label=\"閉じる\">×</button>
\t\t\t\t </div>
\t\t\t\t <div class=\"sp-detail-sheet__body\" id=\"sp-detail-body\"></div>
\t\t\t\t <div class=\"sp-detail-sheet__footer\">
\t\t\t\t <button type=\"button\" class=\"sp-detail-sheet__invoice\"
\t\t\t\t onclick=\"closeSpMitsumoriDetail(); document.getElementById('mitsumori_btn') && document.getElementById('mitsumori_btn').click();\">見積書を表示</button>
\t\t\t\t <button type=\"button\" class=\"sp-detail-sheet__cart\"
\t\t\t\t onclick=\"closeSpMitsumoriDetail(); document.getElementById('cart_btn2') && document.getElementById('cart_btn2').click();\">カートに入れる</button>
\t\t\t\t </div>
\t\t\t\t </div>
\t\t\t\t</div>
\t\t\t\t<div class=\"card col-12 collapsed-card sticky-top float-right mitsumori-card-pc\">
\t\t\t\t\t<div class=\"card-header\">
\t\t\t\t\t <h3 class=\"card-title\">現在のお見積り額</h3>
\t\t\t\t\t <div class=\"card-tools\">
\t\t\t\t\t <span class=\"float-left\" id=\"mitsumori_message\">";
// line 4744
echo twig_escape_filter($this->env, ((twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "mitsumori_goukei", [], "any", true, true, false, 4744)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "mitsumori_goukei", [], "any", false, false, false, 4744), "---円")) : ("---円")), "html", null, true);
echo "</span>
\t\t\t\t\t <button type=\"button\" class=\"btn btn-tool btn-mitsumori-toggle\" data-card-widget=\"collapse\" title=\"詳細を表示\">
\t\t\t\t\t <span class=\"toggle-icon\">▼ 詳細</span>
\t\t\t\t\t </button>
\t\t\t\t\t </div>
\t\t\t\t\t</div>
\t\t\t\t\t<div class=\"card-body p-0\">
\t\t\t\t\t <ul class=\"nav nav-pills flex-column\">
\t\t\t\t\t <li class=\"nav-item active\">
\t\t\t\t\t <a class=\"nav-link\">
\t\t\t\t\t <i class=\"far fa-file-alt\"></i> 合計(工事費・税抜)
\t\t\t\t\t <span class=\"float-right\" id=\"mitsumori_goukei\">";
// line 4755
echo twig_escape_filter($this->env, ((twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "mitsumori_goukei", [], "any", true, true, false, 4755)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "mitsumori_goukei", [], "any", false, false, false, 4755), "---円")) : ("---円")), "html", null, true);
echo "</span>
\t\t\t\t\t </a>
\t\t\t\t\t </li>
\t\t\t\t\t <li class=\"nav-item active\">
\t\t\t\t\t <a class=\"nav-link\">
\t\t\t\t\t <i class=\"far fa-file-alt\"></i> 商品価格
\t\t\t\t\t <span class=\"float-right\" id=\"mitsumori_price\">";
// line 4761
echo twig_escape_filter($this->env, ((twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "mitsumori_price", [], "any", true, true, false, 4761)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "mitsumori_price", [], "any", false, false, false, 4761), "---円")) : ("---円")), "html", null, true);
echo "</span>
\t\t\t\t\t </a>
\t\t\t\t\t </li>
\t\t\t\t\t ";
// line 4765
echo "\t\t\t\t\t ";
if ((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 4765, $this->source); })()), "SaleType", [], "any", false, false, false, 4765), "id", [], "any", false, false, false, 4765) != 2)) {
// line 4766
echo "\t\t\t\t\t <li class=\"nav-item\">
\t\t\t\t\t <a class=\"nav-link\">
\t\t\t\t\t <i class=\"far fa-file-alt\"></i> カタログ価格
\t\t\t\t\t <span class=\"float-right\" id=\"maker_price\">";
// line 4769
echo twig_escape_filter($this->env, ((twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "maker_price", [], "any", true, true, false, 4769)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "maker_price", [], "any", false, false, false, 4769), "---円")) : ("---円")), "html", null, true);
echo "</span>
\t\t\t\t\t </a>
\t\t\t\t\t </li>
\t\t\t\t\t ";
} else {
// line 4773
echo "\t\t\t\t\t ";
// line 4774
echo "\t\t\t\t\t <span id=\"maker_price\" style=\"display:none;\">---円</span>
\t\t\t\t\t ";
}
// line 4776
echo "\t\t\t\t\t <li class=\"nav-item\">
\t\t\t\t\t <a class=\"nav-link\">
\t\t\t\t\t <i class=\"far fa-file-alt\"></i>
\t\t\t\t\t ";
// line 4779
if ((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 4779, $this->source); })()), "SaleType", [], "any", false, false, false, 4779), "id", [], "any", false, false, false, 4779) == 2)) {
echo "補助金(割引額)";
} else {
echo "お値引き";
}
// line 4780
echo "\t\t\t\t\t <span class=\"float-right\" id=\"mitsumori_off\">";
echo twig_escape_filter($this->env, ((twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "mitsumori_off", [], "any", true, true, false, 4780)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "mitsumori_off", [], "any", false, false, false, 4780), "---円")) : ("---円")), "html", null, true);
echo "</span>
\t\t\t\t\t </a>
\t\t\t\t\t </li>
\t\t\t\t\t ";
// line 4784
echo "\t\t\t\t\t ";
if ((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 4784, $this->source); })()), "SaleType", [], "any", false, false, false, 4784), "id", [], "any", false, false, false, 4784) == 2)) {
// line 4785
echo "\t\t\t\t\t <li class=\"nav-item\">
\t\t\t\t\t <div style=\"padding:4px 12px 8px;color:#6c757d;font-size:11px;line-height:1.4;\">
\t\t\t\t\t ※当店が補助金事業者として申請代行し、契約代金に充当します
\t\t\t\t\t </div>
\t\t\t\t\t </li>
\t\t\t\t\t ";
}
// line 4791
echo "\t\t\t\t\t <li class=\"nav-item\">
\t\t\t\t\t <a class=\"nav-link\">
\t\t\t\t\t <i class=\"far fa-file-alt\"></i> 基本工事費
\t\t\t\t\t <span class=\"float-right\" id=\"mitsumori_ct\">";
// line 4794
echo twig_escape_filter($this->env, ((twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "mitsumori_ct", [], "any", true, true, false, 4794)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "mitsumori_ct", [], "any", false, false, false, 4794), "---円")) : ("---円")), "html", null, true);
echo "</span>
\t\t\t\t\t </a>
\t\t\t\t\t </li>
\t\t\t\t\t ";
// line 4798
echo "\t\t\t\t\t <li class=\"nav-item\" id=\"mitsumori_steelroof_row\" style=\"display:none;\">
\t\t\t\t\t <a class=\"nav-link\">
\t\t\t\t\t <i class=\"far fa-file-alt\"></i> スチール折板
\t\t\t\t\t <span class=\"float-right\" id=\"mitsumori_steelroof\">";
// line 4801
echo twig_escape_filter($this->env, ((twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "mitsumori_steelroof", [], "any", true, true, false, 4801)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "mitsumori_steelroof", [], "any", false, false, false, 4801), "---円")) : ("---円")), "html", null, true);
echo "</span>
\t\t\t\t\t </a>
\t\t\t\t\t </li>
\t\t\t\t\t <li class=\"nav-item\">
\t\t\t\t\t <a class=\"nav-link\">
\t\t\t\t\t <i class=\"far fa-file-alt\"></i> 施工オプション
\t\t\t\t\t <span class=\"float-right\"id=\"mitsumori_option\">";
// line 4807
echo twig_escape_filter($this->env, ((twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "mitsumori_option", [], "any", true, true, false, 4807)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "mitsumori_option", [], "any", false, false, false, 4807), "---円")) : ("---円")), "html", null, true);
echo "</span>
\t\t\t\t\t </a>
\t\t\t\t\t </li>
\t\t\t\t\t </ul>
\t\t\t\t\t</div>
\t\t\t\t\t<div class=\"card-footer\">
\t\t <button type=\"button\" id=\"mitsumori_btn\" class=\"btn btn-info\" data-toggle=\"modal\" data-target=\"#modal-mitsumori\">
\t\t 見積書表示
\t\t </button>
<button type=\"submit\" id=\"cart_btn2\" class=\"btn btn-info add-cart\">カートに入れる</button>
\t\t\t\t\t</div>
\t\t\t\t</div>
</div>
</div>
</div>
<div class=\"modal\" id=\"modal-mitsumori\">
<div class=\"modal-dialog modal-mitsumori\" style=\"max-width:1000px\">
<div class=\"modal-content\">
<div class=\"modal-header\">
<h4 class=\"modal-title\">お見積書</h4>
<button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\">
<span aria-hidden=\"true\">×</span>
</button>
</div>
<div class=\"modal-body\">
\t\t\t<div class=\"invoice p-3 mb-5\" style=\"max-width:1000px; margin:auto;\">
\t\t\t <!-- title row -->
\t\t\t <div class=\"row\">
\t\t\t <div class=\"col-12\">
\t\t\t <h2>概算お見積書
\t\t\t <small class=\"float-right\" style=\"font-size:14px;\">発行日: <span id=\"mitsumori_issue_date\">---</span></small>
\t\t\t </h2>
\t\t\t </div>
\t\t\t <!-- /.col -->
\t\t\t </div>
\t\t\t <!-- info row -->
\t\t\t <div class=\"row invoice-info\">
\t\t\t <div class=\"col-sm-8 invoice-col\">
\t\t\t <h3>お客様</h3>
\t\t\t <span>下記の通り、お見積もり申し上げます。</span>
\t\t\t <br />
\t\t\t <br / >
\t\t\t <br />
\t\t\t <h2>お見積金額: <span id=\"mitsumori_kei\">";
// line 4854
echo twig_escape_filter($this->env, ((twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "mitsumori_goukei", [], "any", true, true, false, 4854)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "mitsumori_goukei", [], "any", false, false, false, 4854), "---円")) : ("---円")), "html", null, true);
echo "</span></h2>
\t\t\t <span>
\t\t\t <br/>
\t\t\t <br/>
\t\t\t <br/>
\t\t\t <br/>
\t\t\t </span>
\t\t\t </div>
\t\t\t <div class=\"col-sm-4 invoice-col\">
\t\t\t <p>
\t\t\t <img alt=\"\" src=\"/html/user_data/js/images/logo.png\" style=\"width: 260px; max-width: 100%; max-height: 10mm;\">
\t\t\t </p>
\t\t\t <p>有限会社プラス</p>
\t\t\t <p>〒400-0334</p>
\t\t\t <p>山梨県南アルプス市藤田1450番地2</p>
\t\t\t <p>TEL: 055-284-6480</p>
\t\t\t <img alt=\"\" src=\"/html/user_data/js/images/seal.svg\" style=\"z-index: 2; position: absolute; width: 21mm; left: 58mm; top: 36mm;\">
\t\t\t </div>
\t\t\t <!-- /.col -->
\t\t\t <!-- /.col -->
\t\t\t </div>
\t\t\t <!-- /.row -->
\t\t\t <!-- Table row -->
\t\t\t <div class=\"row\">
\t\t\t <div class=\"col-12 table-responsive\">
\t\t\t <table class=\"table table-striped\">
\t\t\t <thead>
\t\t\t <tr>
\t\t\t <th>項目</th>
\t\t\t <th>数量</th>
\t\t\t <th>単位</th>
\t\t\t <th>単価</th>
\t\t\t <th>小計</th>
\t\t\t </tr>
\t\t\t </thead>
\t\t\t <tbody>
\t\t\t <tr>
\t\t\t <td id=\"mitsumori_item_name\">";
// line 4891
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, (isset($context["Product"]) || array_key_exists("Product", $context) ? $context["Product"] : (function () { throw new RuntimeError('Variable "Product" does not exist.', 4891, $this->source); })()), "name", [], "any", false, false, false, 4891), "html", null, true);
echo "</td>
\t\t\t <td>1</td>
\t\t\t <td>式</td>
\t\t\t <td id=\"mitsumori_price_01\">---</td>
\t\t\t <td id=\"mitsumori_price_02\">---</td>
\t\t\t </tr>
\t\t\t <tr>
\t\t\t <td>基本工事費</td>
\t\t\t <td>1</td>
\t\t\t <td>式</td>
\t\t\t <td id=\"mitsumori_ct_01\">---</td>
\t\t\t <td id=\"mitsumori_ct_02\">---</td>
\t\t\t </tr>
\t\t\t <tr>
\t\t\t <td>残土・ガラ処理</td>
\t\t\t <td>1</td>
\t\t\t <td>式</td>
\t\t\t <td>0円</td>
\t\t\t <td></td>
\t\t\t </tr>
\t\t\t <tr>
\t\t\t <td> </td>
\t\t\t <td></td>
\t\t\t <td></td>
\t\t\t <td></td>
\t\t\t <td></td>
\t\t\t </tr>
\t\t\t </tbody>
\t\t\t </table>
\t\t\t </div>
\t\t\t <!-- /.col -->
\t\t\t </div>
\t\t\t <!-- /.row -->
\t\t\t <div class=\"row\">
\t\t\t <!-- accepted payments column -->
\t\t\t <div class=\"col-6\">
\t\t\t <p class=\"lead\">お支払い方法</p>
\t\t\t <p class=\"text-muted well well-sm shadow-none\" style=\"margin-top: 10px;\">銀行振込、クレジットカード決済、PAYPAY決済
\t\t\t <br>銀行振込:山梨中央銀行 白根支店 普通口座 391402
\t\t\t <br>※商品代金と工事代金の総額が金100万円(税込)を超える場合、着手金として代金の半額をご契約後お支払いいただきます。
\t\t\t </p>
\t\t\t </div>
\t\t\t <!-- /.col -->
\t\t\t <div class=\"col-6\">
\t\t\t <div class=\"table-responsive\">
\t\t\t <table class=\"table\">
\t\t\t <tbody>
\t\t\t <tr>
\t\t\t <th style=\"width:50%\">小計:</th>
\t\t\t <td id=\"mitsumori_shoukei\">---</td>
\t\t\t </tr>
\t\t\t <tr>
\t\t\t <th>消費税 (10%)</th>
\t\t\t <td id=\"mitsumori_tax\">---</td>
\t\t\t </tr>
\t\t\t <tr>
\t\t\t <th>合計:</th>
\t\t\t <td id=\"mitsumori_goukei_02\">---</td>
\t\t\t </tr>
\t\t\t </tbody>
\t\t\t </table>
\t\t\t </div>
\t\t\t </div>
\t\t\t <!-- /.col -->
\t\t\t </div>
\t\t\t <!-- /.row -->
\t\t\t</div>
</div>
<div class=\"modal-footer justify-content-between\">
\t\t\t ";
// line 4961
echo "\t\t\t <form method=\"post\" action=\"";
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getUrl("mitsumori_pdf");
echo "\" target=\"_blank\" id=\"pdf_download_form\">
\t\t\t <input type=\"hidden\" name=\"_token\" value=\"";
// line 4962
echo twig_escape_filter($this->env, $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->renderCsrfToken("mitsumori_pdf"), "html", null, true);
echo "\">
\t\t\t <input type=\"hidden\" name=\"mitsumori_json\" id=\"pdf_mitsumori_json\">
\t\t\t <button type=\"submit\" class=\"btn btn-primary float-right\" style=\"margin-right: 5px;\" onclick=\"syncPdfJson();\">
\t\t\t <i class=\"fas fa-download\"></i>PDF出力
\t\t\t </button>
\t\t\t </form>
<button type=\"submit\" id=\"cart_btn3\" class=\"btn btn-info add-cart\">カートに入れる</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<!-- Image zoom modal: custom lightweight lightbox (no CDN dependency) -->
<div id=\"img-modal\" role=\"dialog\" aria-modal=\"true\" aria-label=\"画像拡大\">
<button id=\"img-modal__close\" aria-label=\"閉じる\">×</button>
<button id=\"img-modal__prev\" aria-label=\"前の画像\">❮</button>
<img id=\"img-modal__img\" src=\"\" alt=\"\">
<button id=\"img-modal__next\" aria-label=\"次の画像\">❯</button>
</div>
<style>
#img-modal {
display: none;
position: fixed;
inset: 0;
z-index: 9999;
background: rgba(0,0,0,0.88);
align-items: center;
justify-content: center;
cursor: zoom-out;
}
#img-modal.is-open { display: flex; }
#img-modal__img {
max-width: 92vw;
max-height: 88vh;
object-fit: contain;
border-radius: 4px;
cursor: default;
user-select: none;
touch-action: pinch-zoom;
display: block;
}
#img-modal__close {
position: absolute;
top: 14px;
right: 18px;
font-size: 38px;
color: #fff;
cursor: pointer;
background: none;
border: none;
padding: 0;
line-height: 1;
z-index: 1;
opacity: 0.85;
}
#img-modal__close:hover { opacity: 1; }
#img-modal__prev,
#img-modal__next {
position: absolute;
top: 50%;
transform: translateY(-50%);
font-size: 36px;
color: #fff;
cursor: pointer;
background: rgba(0,0,0,0.32);
border: none;
padding: 10px 16px;
line-height: 1;
border-radius: 6px;
z-index: 1;
opacity: 0.8;
user-select: none;
}
#img-modal__prev:hover, #img-modal__next:hover { opacity: 1; }
#img-modal__prev { left: 12px; }
#img-modal__next { right: 12px; }
@media (max-width: 767px) {
#img-modal__prev, #img-modal__next { font-size: 28px; padding: 8px 12px; }
}
</style>
<script>
(function(){
var images = [];
var current = 0;
// Collect original (non-cloned) slide images at click time.
// After Slick init, slides are wrapped in .slick-slide; clones have .slick-cloned.
function collectImages() {
images = [];
var \$slides = \$('.item_visual .slick-slide:not(.slick-cloned)');
if (!\$slides.length) {
// Slick not yet initialized (fallback)
\$slides = \$('.item_visual .slide-item');
}
\$slides.each(function() {
var \$a = \$(this).find('a.js-zoom');
if (\$a.length) {
images.push({ src: \$a.attr('href'), alt: \$a.find('img').attr('alt') || '' });
}
});
}
function showImage(idx) {
current = ((idx % images.length) + images.length) % images.length;
\$('#img-modal__img').attr({ src: images[current].src, alt: images[current].alt });
}
function openModal(href) {
collectImages();
if (!images.length) return;
var idx = 0;
for (var i = 0; i < images.length; i++) {
if (images[i].src === href) { idx = i; break; }
}
showImage(idx);
\$('#img-modal').addClass('is-open');
\$('body').css('overflow', 'hidden');
}
function closeModal() {
\$('#img-modal').removeClass('is-open');
\$('body').css('overflow', '');
}
// Click handler: works for both original and Slick-cloned anchors
\$(document).on('click', '.item_visual a.js-zoom', function(e) {
e.preventDefault();
openModal(\$(this).attr('href'));
});
// Close on backdrop click
\$('#img-modal').on('click', function(e) {
if (e.target === this) closeModal();
});
\$('#img-modal__close').on('click', closeModal);
\$('#img-modal__prev').on('click', function(e) { e.stopPropagation(); showImage(current - 1); });
\$('#img-modal__next').on('click', function(e) { e.stopPropagation(); showImage(current + 1); });
// Keyboard navigation
\$(document).on('keydown', function(e) {
if (!\$('#img-modal').hasClass('is-open')) return;
if (e.key === 'Escape') closeModal();
if (e.key === 'ArrowLeft') showImage(current - 1);
if (e.key === 'ArrowRight') showImage(current + 1);
});
// Touch swipe (horizontal only)
var _tx = 0;
var \$modal = document.getElementById('img-modal');
\$modal.addEventListener('touchstart', function(e) {
_tx = e.changedTouches[0].clientX;
}, { passive: true });
\$modal.addEventListener('touchend', function(e) {
var dx = e.changedTouches[0].clientX - _tx;
if (Math.abs(dx) > 48) {
dx < 0 ? showImage(current + 1) : showImage(current - 1);
}
}, { passive: true });
})();
</script>
";
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
}
public function getTemplateName()
{
return "Product/detail.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 7518 => 4962, 7513 => 4961, 7441 => 4891, 7401 => 4854, 7351 => 4807, 7342 => 4801, 7337 => 4798, 7331 => 4794, 7326 => 4791, 7318 => 4785, 7315 => 4784, 7308 => 4780, 7302 => 4779, 7297 => 4776, 7293 => 4774, 7291 => 4773, 7284 => 4769, 7279 => 4766, 7276 => 4765, 7270 => 4761, 7261 => 4755, 7247 => 4744, 7224 => 4723, 7222 => 4721, 7214 => 4715, 7211 => 4714, 7205 => 4712, 7202 => 4711, 7200 => 4710, 7184 => 4696, 7174 => 4688, 7166 => 4683, 7156 => 4678, 7151 => 4675, 7145 => 4671, 7136 => 4665, 7130 => 4664, 7124 => 4661, 7120 => 4660, 7112 => 4655, 7107 => 4652, 7100 => 4648, 7096 => 4646, 7088 => 4641, 7084 => 4640, 7081 => 4639, 7078 => 4638, 7072 => 4635, 7068 => 4634, 7065 => 4633, 7063 => 4632, 7058 => 4630, 7054 => 4629, 7051 => 4628, 7049 => 4627, 7046 => 4626, 7044 => 4625, 7040 => 4624, 7031 => 4617, 7028 => 4614, 7024 => 4612, 7021 => 4611, 7018 => 4607, 7012 => 4606, 7009 => 4605, 7006 => 4604, 7002 => 4602, 6990 => 4598, 6988 => 4597, 6985 => 4596, 6979 => 4593, 6967 => 4592, 6961 => 4591, 6954 => 4590, 6952 => 4589, 6947 => 4587, 6935 => 4586, 6929 => 4585, 6922 => 4584, 6919 => 4581, 6913 => 4580, 6904 => 4579, 6896 => 4577, 6893 => 4576, 6891 => 4575, 6889 => 4574, 6887 => 4573, 6885 => 4571, 6882 => 4570, 6879 => 4569, 6876 => 4568, 6873 => 4567, 6870 => 4566, 6867 => 4565, 6864 => 4564, 6861 => 4563, 6858 => 4562, 6855 => 4561, 6850 => 4560, 6847 => 4559, 6841 => 4558, 6836 => 4557, 6831 => 4556, 6826 => 4555, 6823 => 4554, 6820 => 4553, 6817 => 4552, 6810 => 4544, 6794 => 4530, 6792 => 4529, 6788 => 4527, 6774 => 4516, 6767 => 4511, 6765 => 4510, 6763 => 4509, 6759 => 4507, 6747 => 4498, 6743 => 4496, 6738 => 4493, 6730 => 4487, 6721 => 4481, 6713 => 4475, 6710 => 4472, 6699 => 4469, 6696 => 4468, 6693 => 4467, 6690 => 4466, 6687 => 4464, 6682 => 4461, 6672 => 4458, 6666 => 4457, 6660 => 4456, 6656 => 4455, 6649 => 4454, 6642 => 4453, 6640 => 4452, 6631 => 4450, 6628 => 4449, 6625 => 4448, 6622 => 4445, 6617 => 4442, 6607 => 4439, 6601 => 4438, 6595 => 4437, 6591 => 4436, 6584 => 4435, 6577 => 4434, 6575 => 4433, 6566 => 4431, 6563 => 4430, 6560 => 4429, 6557 => 4427, 6555 => 4426, 6551 => 4424, 6540 => 4418, 6531 => 4414, 6523 => 4411, 6515 => 4408, 6506 => 4405, 6503 => 4404, 6501 => 4403, 6496 => 4400, 6486 => 4394, 6477 => 4390, 6469 => 4387, 6461 => 4384, 6452 => 4381, 6449 => 4380, 6447 => 4379, 6442 => 4376, 6439 => 4374, 6437 => 4373, 6433 => 4371, 6419 => 4360, 6413 => 4356, 6410 => 4354, 6408 => 4353, 6404 => 4351, 6390 => 4340, 6384 => 4336, 6381 => 4334, 6376 => 4331, 6366 => 4328, 6360 => 4327, 6354 => 4326, 6350 => 4325, 6343 => 4324, 6336 => 4323, 6334 => 4322, 6325 => 4320, 6322 => 4319, 6319 => 4318, 6316 => 4316, 6311 => 4313, 6301 => 4310, 6295 => 4309, 6289 => 4308, 6285 => 4307, 6278 => 4306, 6271 => 4305, 6269 => 4304, 6259 => 4302, 6256 => 4301, 6253 => 4300, 6250 => 4298, 6245 => 4295, 6235 => 4292, 6229 => 4291, 6223 => 4290, 6219 => 4289, 6212 => 4288, 6205 => 4287, 6203 => 4286, 6194 => 4284, 6191 => 4283, 6188 => 4282, 6185 => 4280, 6180 => 4277, 6170 => 4274, 6164 => 4273, 6158 => 4272, 6154 => 4271, 6147 => 4270, 6140 => 4269, 6138 => 4268, 6129 => 4266, 6126 => 4265, 6124 => 4264, 6121 => 4263, 6116 => 4260, 6106 => 4257, 6100 => 4256, 6094 => 4255, 6090 => 4254, 6083 => 4253, 6076 => 4252, 6074 => 4251, 6065 => 4249, 6062 => 4248, 6060 => 4247, 6057 => 4246, 6052 => 4243, 6042 => 4240, 6036 => 4239, 6030 => 4238, 6026 => 4237, 6019 => 4236, 6012 => 4235, 6010 => 4234, 6001 => 4232, 5998 => 4231, 5995 => 4230, 5992 => 4228, 5990 => 4227, 5986 => 4225, 5856 => 4097, 5839 => 4081, 5836 => 4079, 5831 => 4076, 5823 => 4074, 5817 => 4072, 5812 => 4070, 5804 => 4068, 5802 => 4067, 5798 => 4066, 5791 => 4065, 5788 => 4064, 5783 => 4063, 5778 => 4060, 5775 => 4059, 5772 => 4057, 5766 => 4053, 5756 => 4050, 5752 => 4049, 5749 => 4048, 5744 => 4047, 5741 => 4046, 5737 => 4042, 5734 => 4041, 5731 => 4039, 5723 => 4036, 5713 => 4028, 5710 => 4027, 5707 => 4025, 5699 => 4022, 5689 => 4014, 5686 => 4013, 5683 => 4011, 5678 => 4008, 5668 => 4005, 5664 => 4004, 5661 => 4003, 5656 => 4002, 5651 => 3999, 5648 => 3998, 5639 => 3990, 5628 => 3980, 5611 => 3967, 5601 => 3962, 5590 => 3953, 5587 => 3952, 5577 => 3943, 5574 => 3939, 5571 => 3935, 5569 => 3934, 5565 => 3932, 5562 => 3931, 5560 => 3930, 5556 => 3928, 5551 => 3925, 5541 => 3922, 5535 => 3921, 5529 => 3920, 5525 => 3919, 5518 => 3918, 5511 => 3917, 5509 => 3916, 5499 => 3914, 5496 => 3913, 5493 => 3912, 5490 => 3910, 5485 => 3907, 5475 => 3904, 5469 => 3903, 5463 => 3902, 5459 => 3901, 5452 => 3900, 5445 => 3899, 5443 => 3898, 5433 => 3896, 5430 => 3895, 5427 => 3894, 5424 => 3889, 5419 => 3886, 5409 => 3883, 5403 => 3882, 5397 => 3881, 5393 => 3880, 5386 => 3879, 5379 => 3878, 5377 => 3877, 5363 => 3875, 5360 => 3874, 5357 => 3873, 5354 => 3871, 5349 => 3868, 5339 => 3865, 5333 => 3864, 5327 => 3863, 5323 => 3862, 5316 => 3861, 5309 => 3860, 5307 => 3859, 5298 => 3857, 5295 => 3856, 5292 => 3855, 5289 => 3852, 5284 => 3849, 5274 => 3846, 5268 => 3845, 5262 => 3844, 5258 => 3843, 5251 => 3842, 5244 => 3841, 5242 => 3840, 5233 => 3838, 5230 => 3837, 5228 => 3836, 5225 => 3835, 5220 => 3832, 5210 => 3829, 5204 => 3828, 5198 => 3827, 5194 => 3826, 5187 => 3825, 5180 => 3824, 5178 => 3823, 5169 => 3821, 5166 => 3820, 5163 => 3819, 5160 => 3814, 5155 => 3811, 5147 => 3809, 5141 => 3807, 5136 => 3805, 5128 => 3803, 5126 => 3802, 5120 => 3801, 5114 => 3800, 5110 => 3799, 5100 => 3798, 5097 => 3797, 5090 => 3796, 5088 => 3795, 5079 => 3793, 5076 => 3792, 5073 => 3791, 5070 => 3789, 5066 => 3787, 5063 => 3786, 5061 => 3784, 5060 => 3783, 5059 => 3782, 5058 => 3781, 5057 => 3780, 5056 => 3779, 5055 => 3778, 5054 => 3777, 5052 => 3776, 5049 => 3775, 5043 => 3774, 5040 => 3773, 5035 => 3772, 5030 => 3771, 5025 => 3770, 5022 => 3769, 5019 => 3768, 5014 => 3767, 5011 => 3766, 5008 => 3765, 5005 => 3764, 4999 => 3763, 4994 => 3762, 4989 => 3761, 4984 => 3760, 4981 => 3759, 4978 => 3758, 4975 => 3757, 4971 => 3748, 4967 => 3746, 4963 => 3744, 4954 => 3741, 4945 => 3740, 4941 => 3739, 4938 => 3738, 4936 => 3737, 4932 => 3735, 4923 => 3732, 4919 => 3731, 4915 => 3730, 4905 => 3728, 4901 => 3727, 4898 => 3726, 4896 => 3725, 4894 => 3724, 4885 => 3723, 4882 => 3722, 4879 => 3721, 4876 => 3719, 4872 => 3717, 4868 => 3715, 4859 => 3712, 4850 => 3711, 4846 => 3710, 4843 => 3709, 4839 => 3707, 4830 => 3704, 4823 => 3700, 4819 => 3699, 4809 => 3697, 4805 => 3696, 4802 => 3695, 4800 => 3694, 4791 => 3693, 4788 => 3692, 4785 => 3691, 4782 => 3689, 4778 => 3687, 4774 => 3685, 4765 => 3682, 4756 => 3681, 4752 => 3680, 4749 => 3679, 4745 => 3677, 4736 => 3674, 4729 => 3670, 4725 => 3669, 4715 => 3667, 4711 => 3666, 4708 => 3665, 4706 => 3664, 4697 => 3663, 4694 => 3662, 4691 => 3661, 4688 => 3659, 4684 => 3657, 4680 => 3655, 4671 => 3652, 4662 => 3651, 4658 => 3650, 4655 => 3649, 4653 => 3648, 4649 => 3646, 4640 => 3643, 4633 => 3639, 4629 => 3638, 4619 => 3636, 4615 => 3635, 4612 => 3634, 4610 => 3633, 4608 => 3632, 4599 => 3631, 4596 => 3630, 4593 => 3629, 4590 => 3627, 4586 => 3625, 4583 => 3624, 4581 => 3623, 4580 => 3622, 4579 => 3621, 4577 => 3620, 4574 => 3619, 4571 => 3618, 4568 => 3617, 4565 => 3616, 4562 => 3615, 4559 => 3614, 4556 => 3613, 4553 => 3612, 4551 => 3611, 4549 => 3610, 4540 => 3603, 4532 => 3598, 4529 => 3597, 4526 => 3596, 4523 => 3594, 4518 => 3591, 4511 => 3587, 4506 => 3584, 4504 => 3583, 4501 => 3582, 4490 => 3579, 4486 => 3578, 4483 => 3577, 4479 => 3576, 4472 => 3572, 4468 => 3570, 4465 => 3569, 4462 => 3568, 4456 => 3562, 4449 => 3557, 4437 => 3554, 4434 => 3553, 4431 => 3552, 4428 => 3550, 4417 => 3548, 4413 => 3547, 4410 => 3546, 4407 => 3544, 4400 => 3540, 4397 => 3539, 4394 => 3538, 4385 => 3534, 4382 => 3533, 4375 => 3529, 4372 => 3528, 4370 => 3527, 4367 => 3526, 4363 => 3523, 4361 => 3522, 4357 => 3520, 4351 => 3519, 4346 => 3516, 4331 => 3514, 4322 => 3513, 4305 => 3512, 4301 => 3510, 4298 => 3509, 4294 => 3508, 4291 => 3507, 4288 => 3506, 4285 => 3505, 4272 => 3494, 4258 => 3482, 4252 => 3477, 4233 => 3475, 4216 => 3474, 4212 => 3472, 4201 => 3470, 4178 => 3466, 4172 => 3465, 4169 => 3464, 4151 => 3463, 4148 => 3462, 4144 => 3460, 4136 => 3456, 4128 => 3452, 4126 => 3451, 4123 => 3450, 4121 => 3449, 4111 => 3442, 4099 => 3435, 4094 => 3433, 4090 => 3431, 4084 => 3426, 4081 => 3425, 4073 => 3424, 4068 => 3423, 4065 => 3422, 4060 => 3421, 4053 => 3420, 4050 => 3419, 4047 => 3418, 4045 => 3416, 4042 => 3415, 4036 => 3414, 4031 => 3413, 4026 => 3412, 4021 => 3411, 4014 => 3410, 4008 => 3409, 4003 => 3408, 4000 => 3407, 3997 => 3406, 3995 => 3404, 3992 => 3403, 3990 => 3400, 3987 => 3399, 3984 => 3398, 3982 => 3397, 3972 => 3396, 3956 => 3389, 3952 => 3388, 3948 => 3387, 3944 => 3386, 3940 => 3384, 3934 => 3382, 3932 => 3381, 3927 => 3380, 3924 => 3379, 3914 => 3377, 3900 => 3375, 3892 => 3374, 3874 => 3373, 3869 => 3371, 3739 => 3248, 3731 => 3247, 3667 => 3186, 3534 => 3056, 3530 => 3055, 3526 => 3054, 3522 => 3052, 3519 => 3051, 3511 => 3050, 3506 => 3049, 3503 => 3048, 3498 => 3047, 3491 => 3046, 3488 => 3045, 3485 => 3044, 3472 => 3031, 3304 => 2865, 3301 => 2864, 3288 => 2863, 3285 => 2862, 3283 => 2861, 3280 => 2860, 3277 => 2859, 3264 => 2858, 3261 => 2857, 3258 => 2856, 3255 => 2854, 3252 => 2853, 3239 => 2852, 3236 => 2851, 3234 => 2850, 3231 => 2849, 3228 => 2848, 3215 => 2847, 3212 => 2846, 3210 => 2845, 3207 => 2844, 3204 => 2843, 3191 => 2842, 3188 => 2841, 3186 => 2840, 3183 => 2839, 3180 => 2838, 3167 => 2837, 3164 => 2836, 3162 => 2835, 3159 => 2834, 3156 => 2833, 3143 => 2832, 3140 => 2831, 3137 => 2830, 3134 => 2829, 3120 => 2828, 3117 => 2827, 3104 => 2826, 3101 => 2825, 3098 => 2824, 2995 => 2720, 2546 => 2274, 2157 => 1888, 2126 => 1860, 2113 => 1850, 2084 => 1824, 2080 => 1823, 2072 => 1818, 1611 => 1359, 1608 => 1358, 1602 => 1357, 1597 => 1356, 1592 => 1355, 1586 => 1354, 1580 => 1353, 1575 => 1352, 1572 => 1351, 1569 => 1350, 1566 => 1349, 1561 => 1346, 1548 => 1336, 1534 => 1325, 1506 => 1302, 1500 => 1301, 1494 => 1300, 1488 => 1299, 1482 => 1298, 1476 => 1297, 1470 => 1296, 1464 => 1295, 1458 => 1294, 1452 => 1293, 1446 => 1292, 1440 => 1291, 1434 => 1290, 1427 => 1288, 1421 => 1287, 1415 => 1286, 1409 => 1285, 1403 => 1284, 1383 => 1267, 1373 => 1260, 1343 => 1233, 1331 => 1223, 1322 => 1217, 1318 => 1215, 1316 => 1214, 1313 => 1213, 1304 => 1207, 1300 => 1205, 1298 => 1204, 1226 => 1134, 1218 => 1132, 1216 => 1131, 1211 => 1129, 1208 => 1128, 1206 => 1127, 1192 => 1116, 1188 => 1114, 1178 => 1113, 73 => 16, 63 => 15, 52 => 11, 50 => 13, 37 => 11,);
}
public function getSourceContext()
{
return new Source("{#
This file is part of EC-CUBE
Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved.
http://www.ec-cube.co.jp/
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
#}
{% extends 'default_frame.twig' %}
{% set body_class = 'product_page' %}
{% block stylesheet %}
<style>
.slick-slider {
margin-bottom: 10px;
\t\t\tmargin-top: -20px;
}
.slick-dots {
position: absolute;
bottom: -45px;
display: block;
width: 100%;
padding: 0;
list-style: none;
text-align: center;
}
.slick-dots li {
position: relative;
display: inline-block;
width: 20px;
height: 20px;
margin: 0 5px;
padding: 0;
cursor: pointer;
}
.slick-dots li button {
font-size: 0;
line-height: 0;
display: block;
width: 20px;
height: 20px;
padding: 5px;
cursor: pointer;
color: transparent;
border: 0;
outline: none;
background: transparent;
}
.slick-dots li button:hover,
.slick-dots li button:focus {
outline: none;
}
.slick-dots li button:hover:before,
.slick-dots li button:focus:before {
opacity: 1;
}
.slick-dots li button:before {
content: \" \";
line-height: 20px;
position: absolute;
top: 0;
left: 0;
width: 12px;
height: 12px;
text-align: center;
opacity: .25;
background-color: black;
border-radius: 50%;
}
.slick-dots li.slick-active button:before {
opacity: .75;
background-color: black;
}
.slick-dots li button.thumbnail img {
width: 0;
height: 0;
}
</style>
<link rel=\"stylesheet\" href=\"/html/user_data/js/style.css\">
<link rel=\"stylesheet\" href=\"/html/plugins/icheck-bootstrap/icheck-bootstrap.min.css\">
<style>
/* Show zoom cursor on product images to hint click-to-expand */
.item_visual .slide-item a { display: block; cursor: zoom-in; }
</style>
<style>
/* ============================================
商品詳細グリッド: 画像50% / 内容50%(均等)
============================================ */
@media (min-width: 768px) {
body.product_page .ec-grid2 {
display: flex;
align-items: flex-start;
}
body.product_page .ec-grid2 .ec-grid2__cell {
width: 50%;
flex: 0 0 50%;
min-width: 0;
}
body.product_page .ec-grid2 .ec-grid2__cell2 {
width: 50%;
flex: 0 0 50%;
min-width: 0;
}
}
/* ============================================
商品説明欄内のHTMLが画面幅を突き抜けないように
============================================ */
body.product_page .ec-productRole__description {
min-width: 0;
overflow-wrap: break-word;
word-break: break-word;
}
body.product_page .ec-productRole__description img,
body.product_page .ec-productRole__description table,
body.product_page .ec-productRole__description iframe,
body.product_page .ec-productRole__description video {
max-width: 100% !important;
height: auto;
}
body.product_page .ec-productRole__description table {
display: block;
overflow-x: auto;
-webkit-overflow-scrolling: touch;
}
/* ============================================
構成セット内容 (機能門柱など、セット構成を持つ商品)
============================================ */
body.product_page .ec-productRole__setItems {
min-width: 0;
margin-bottom: 16px;
}
body.product_page .ec-productRole__setItems .set-items-table {
width: 100%;
border-collapse: collapse;
table-layout: fixed;
}
body.product_page .ec-productRole__setItems .set-items-table th,
body.product_page .ec-productRole__setItems .set-items-table td {
padding: 8px 4px;
border-bottom: 1px solid #e8e8e8;
font-size: 14px;
font-weight: normal;
overflow-wrap: break-word;
word-break: break-word;
vertical-align: top;
}
body.product_page .ec-productRole__setItems .set-items-table th {
text-align: left;
}
body.product_page .ec-productRole__setItems .set-items-table td {
text-align: right;
white-space: nowrap;
width: 30%;
}
body.product_page .ec-productRole__setItems .set-items-table tfoot th,
body.product_page .ec-productRole__setItems .set-items-table tfoot td {
border-top: 2px solid #333;
border-bottom: none;
font-weight: bold;
}
/* ============================================
スマホ用 見積金額 下部固定バー
============================================ */
#sp-mitsumori-bar {
display: none;
}
/* ============================================
スマホ用 お見積りの詳細 ボトムシート
============================================ */
.sp-detail-sheet { display: none; }
.sp-detail-sheet.is-open {
display: block;
position: fixed;
top: 0; left: 0; right: 0; bottom: 0;
z-index: 2000;
}
.sp-detail-sheet__overlay {
position: absolute;
top: 0; left: 0; right: 0; bottom: 0;
background: rgba(0,0,0,0.45);
}
.sp-detail-sheet__panel {
position: absolute;
left: 0; right: 0; bottom: 0;
background: #fff;
border-radius: 14px 14px 0 0;
max-height: 82vh;
display: flex;
flex-direction: column;
box-shadow: 0 -4px 20px rgba(0,0,0,0.25);
padding-bottom: env(safe-area-inset-bottom);
animation: spSheetUp 0.22s ease-out;
}
@keyframes spSheetUp {
from { transform: translateY(100%); }
to { transform: translateY(0); }
}
.sp-detail-sheet__header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 14px 16px;
border-bottom: 1px solid #eee;
flex: 0 0 auto;
}
.sp-detail-sheet__title { font-size: 16px; font-weight: bold; color: #333; }
.sp-detail-sheet__close {
background: none;
border: none;
font-size: 26px;
line-height: 1;
color: #888;
cursor: pointer;
padding: 0 4px;
}
.sp-detail-sheet__body {
overflow-y: auto;
-webkit-overflow-scrolling: touch;
padding: 4px 0;
flex: 1 1 auto;
}
.sp-detail-sheet__body ul { list-style: none; margin: 0; padding: 0; }
.sp-detail-sheet__body li { border-bottom: 1px solid #f2f2f2; }
.sp-detail-sheet__body .nav-link {
display: flex;
align-items: center;
justify-content: space-between;
padding: 12px 16px;
color: #333;
font-size: 14px;
}
.sp-detail-sheet__body .nav-link .float-right {
float: none !important;
font-weight: bold;
white-space: nowrap;
margin-left: auto;
}
.sp-detail-sheet__footer {
display: flex;
gap: 8px;
padding: 12px 16px 16px;
border-top: 1px solid #eee;
flex: 0 0 auto;
}
.sp-detail-sheet__footer button {
flex: 1 1 auto;
padding: 12px;
border-radius: 8px;
font-size: 14px;
font-weight: bold;
cursor: pointer;
}
.sp-detail-sheet__invoice {
background: #fff;
border: 1px solid #17a2b8;
color: #17a2b8;
}
.sp-detail-sheet__cart {
background: #c00;
border: 1px solid #c00;
color: #fff;
}
/* ============================================
商品タイプ選択 共通スタイル
============================================ */
/* セクションラベル */
.rp-section-label {
font-size: 14px;
font-weight: bold;
color: #333;
margin-bottom: 10px;
}
.rp-section-label span {
font-weight: normal;
color: #c00;
}
/* ---- 1. 画像付きカード ---- */
.rp-card-group {
display: flex;
flex-wrap: wrap;
gap: 8px;
margin-bottom: 4px;
}
.rp-card {
position: relative;
cursor: pointer;
touch-action: manipulation; /* drop iOS 300ms tap delay (#15) */
-webkit-tap-highlight-color: rgba(0,0,0,0);
/* iOS Safari: prevent the first tap from being consumed as a text
selection (\"字だけ青くなる\" = selection highlight) which forced a
2nd tap to actually switch the option (#15). */
-webkit-user-select: none; -moz-user-select: none; user-select: none;
-webkit-touch-callout: none;
width: 110px;
border: 2px solid #ddd;
border-radius: 10px;
overflow: hidden;
transition: border-color 0.2s, box-shadow 0.2s;
background: #fff;
text-decoration: none;
color: #333;
display: block;
}
/* Gate :hover behind real hover-capable pointers. On iOS Safari a
:hover rule that changes appearance makes the first tap apply the
hover state and suppresses the click, so the option chip needed a
second tap to fire its onclick (is-selected + price update). */
@media (hover: hover) and (pointer: fine) {
.rp-card:hover {
border-color: #999;
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
}
.rp-card.is-selected {
border-color: #1a6fcf;
box-shadow: 0 2px 10px rgba(26,111,207,0.25);
}
/* visually-hidden instead of display:none. A label wrapping a
display:none radio fires its tap unreliably on iOS Safari (first tap
often ignored -> \"2回タッチ\"). Keeping the input in the layout but
invisible makes the first tap register. */
.rp-card input[type=\"radio\"] {
position: absolute; opacity: 0; width: 1px; height: 1px;
margin: 0; pointer-events: none;
}
.rp-card__image {
width: 100%;
aspect-ratio: 1 / 1;
object-fit: cover;
display: block;
background: #f5f5f5;
}
.rp-card__placeholder {
width: 100%;
aspect-ratio: 1 / 1;
background: #f0f0f0;
display: flex;
align-items: center;
justify-content: center;
color: #bbb;
font-size: 24px;
}
.rp-card__name {
display: block;
padding: 5px 5px;
font-size: 11px;
color: #333;
text-align: center;
line-height: 1.4;
word-break: break-all;
}
.rp-card.is-selected .rp-card__name { color: #1a6fcf; font-weight: bold; }
.rp-card.is-selected::after {
content: \"✓\";
position: absolute;
top: 3px; right: 6px;
color: #1a6fcf;
font-size: 13px;
font-weight: bold;
}
/* ---- 2. ボタン式ラジオ(画像なし・8個以内)---- */
.rp-btn-group {
display: flex;
flex-wrap: wrap;
gap: 8px;
margin-bottom: 4px;
max-width: 100%;
min-width: 0;
}
.rp-btn {
cursor: pointer;
touch-action: manipulation; /* drop iOS 300ms tap delay (#15) */
-webkit-tap-highlight-color: rgba(0,0,0,0);
/* iOS Safari: block first-tap text selection so 1 tap switches (#15) */
-webkit-user-select: none; -moz-user-select: none; user-select: none;
-webkit-touch-callout: none;
padding: 8px 14px;
border: 2px solid #ddd;
border-radius: 10px;
font-size: 13px;
color: #333;
background: #fff;
transition: border-color 0.2s, background 0.2s;
white-space: normal;
max-width: 100%;
overflow-wrap: anywhere;
text-decoration: none;
}
@media (hover: hover) and (pointer: fine) {
.rp-btn:hover { border-color: #999; }
}
.rp-btn.is-selected {
border-color: #1a6fcf;
color: #1a6fcf;
font-weight: bold;
background: #f0f6ff;
}
.rp-btn input[type=\"radio\"] {
position: absolute; opacity: 0; width: 1px; height: 1px;
margin: 0; pointer-events: none;
}
/* iOS Safari \"2回タッチ\" fix for the type-selection link chips.
The global theme stylesheet ships an ungated `a:hover{color:#296292}`
(paired with `a{color:#337ab7;text-decoration:underline}`). Because
.rp-btn / .rp-card are real <a> links, iOS Safari applies that hover
colour on the FIRST tap — the chip text turns blue (#296292, the
reported \"字だけ青くなる\") — and treats the tap as a hover, swallowing
the navigation so a 2nd tap was needed. The local .rp-*:hover rules
are already gated behind (hover:hover), but this inherited global
rule was not. Pin the hover/active colour to the base/selected colour
so tapping produces no visual change and the first tap navigates
immediately. Higher specificity (0,2,0 / 0,3,0) overrides a:hover. */
.rp-btn:hover,
.rp-btn:active { color: #333; text-decoration: none; }
.rp-btn.is-selected:hover,
.rp-btn.is-selected:active { color: #1a6fcf; text-decoration: none; }
.rp-card:hover,
.rp-card:active { color: #333; text-decoration: none; }
.rp-card:hover .rp-card__name,
.rp-card:active .rp-card__name { color: #333; }
.rp-card.is-selected:hover .rp-card__name,
.rp-card.is-selected:active .rp-card__name { color: #1a6fcf; }
/* ---- 選択肢が多い場合: 縦3段に収めて横スクロール(顧客要望「3列くらいで横スクロール」)---- */
/* grid-auto-flow:column + 3行固定 → 選択肢が縦に最大3段、超過分は右へ伸び横スクロールで閲覧 */
.rp-btn-group.is-scroll,
.opt-btn-group.is-scroll {
display: grid;
grid-auto-flow: column;
grid-template-rows: repeat(3, auto);
grid-auto-columns: max-content;
justify-content: start;
align-items: start;
gap: 8px;
overflow-x: auto;
overflow-y: hidden;
-webkit-overflow-scrolling: touch;
scrollbar-width: thin;
/* 上下に余白を確保して、行の枠線が overflow クリップ/スクロールバーに
切り取られないようにする(「文字列が長いと下枠が消える」対策)。 */
padding: 2px 0 12px;
}
/* is-scroll(横スクロール)内では選択肢を折り返さず単一行に固定する。
折り返すと行高が不揃いになり overflow-y:hidden で下枠が切れるため、
長い選択肢は折り返さず横スクロールで見せる(本来の設計意図)。 */
.rp-btn-group.is-scroll .rp-btn,
.rp-btn-group.is-scroll .opt-btn,
.opt-btn-group.is-scroll .rp-btn,
.opt-btn-group.is-scroll .opt-btn {
white-space: nowrap;
word-break: normal;
overflow-wrap: normal;
}
/* ただし画像付き選択肢(カラースウォッチ等)は max-width で幅が固定されるため、
nowrap にすると名称がボックス外へはみ出して隣の選択肢と重なる。
画像付きは常に折り返し可(名称は画像の下に収める)。 */
.rp-btn-group.is-scroll .opt-btn--with-image,
.opt-btn-group.is-scroll .opt-btn--with-image,
.rp-btn-group.is-scroll .opt-btn--with-image .opt-btn__name,
.opt-btn-group.is-scroll .opt-btn--with-image .opt-btn__name {
white-space: normal;
word-break: break-word;
overflow-wrap: anywhere;
}
.rp-btn-group.is-scroll::-webkit-scrollbar,
.opt-btn-group.is-scroll::-webkit-scrollbar {
height: 6px;
}
.rp-btn-group.is-scroll::-webkit-scrollbar-thumb,
.opt-btn-group.is-scroll::-webkit-scrollbar-thumb {
background: #c0c0c0;
border-radius: 3px;
}
/* ---- 3. プルダウン(画像なし・9個以上)---- */
.rp-select-wrap {
margin-bottom: 4px;
}
.rp-select {
width: 100%;
max-width: 420px;
padding: 8px 12px;
border: 2px solid #ddd;
border-radius: 10px;
font-size: 13px;
color: #333;
background: #fff;
appearance: none;
background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E\");
background-repeat: no-repeat;
background-position: right 12px center;
cursor: pointer;
}
.rp-select:focus {
outline: none;
border-color: #1a6fcf;
}
/* ---- オプション選択ボタン(枠線ラジオ)---- */
.opt-btn-group {
display: flex;
flex-wrap: wrap;
gap: 8px;
padding: 6px 0;
max-width: 100%;
min-width: 0;
}
.opt-btn {
cursor: pointer;
touch-action: manipulation; /* drop iOS 300ms tap delay (#15) */
-webkit-tap-highlight-color: rgba(0,0,0,0);
/* iOS Safari: block first-tap text selection so 1 tap switches (#15) */
-webkit-user-select: none; -moz-user-select: none; user-select: none;
-webkit-touch-callout: none;
padding: 7px 14px;
border: 2px solid #ddd;
border-radius: 10px;
font-size: 13px;
color: #333;
background: #fff;
transition: border-color 0.2s, background 0.2s;
white-space: normal;
max-width: 100%;
overflow-wrap: anywhere;
text-decoration: none;
}
@media (hover: hover) and (pointer: fine) {
.opt-btn:hover { border-color: #999; }
}
.opt-btn.is-selected {
border-color: #1a6fcf;
color: #1a6fcf;
font-weight: bold;
background: #f0f6ff;
}
.opt-btn input[type=\"radio\"] {
position: absolute; opacity: 0; width: 1px; height: 1px;
margin: 0; pointer-events: none;
}
/* opt-btn with color swatch image. The label still works as a
radio target — clicking the image checks the input. The text
label stays under the image so users can still read the name. */
.opt-btn--with-image {
padding: 4px 6px 6px;
white-space: normal;
text-align: center;
display: inline-flex;
flex-direction: column;
align-items: center;
min-width: 96px;
max-width: 140px;
}
.opt-btn--with-image .opt-btn__img {
display: block;
width: 88px;
height: 66px;
object-fit: cover;
border-radius: 6px;
margin-bottom: 4px;
background: #f5f5f5;
}
.opt-btn--with-image .opt-btn__name {
display: block;
font-size: 11px;
line-height: 1.3;
color: inherit;
}
.opt-btn--with-image.is-selected .opt-btn__img {
outline: 2px solid #1a6fcf;
outline-offset: 1px;
}
/* sale_type=2 (内窓) 補助金対象ガラスの強調表示.
補助金が出る性能区分 (真空断熱 / Low-E複層 等) のガラス選択肢に
緑枠 + 「補助金対象」バッジを付け、選択前から判別できるようにする。 */
.opt-btn--subsidy {
border-color: #2e7d32;
}
.opt-btn--subsidy.is-selected {
border-color: #1a6fcf;
}
.opt-btn__subsidy-badge {
display: inline-block;
margin-left: 6px;
padding: 1px 6px;
border-radius: 6px;
background: #2e7d32;
color: #fff;
font-size: 11px;
font-weight: bold;
white-space: nowrap;
}
/* 補助金額・適用可否の強調 (顧客要望: もっと目立つ色とフォントに).
各窓の補助金額は緑・太字・拡大、適用条件ノートは緑の枠付きボックスにする。 */
.wt-subsidy-label {
color: #2e7d32;
font-weight: bold;
font-size: 12px;
}
.wt-subsidy-amount {
color: #2e7d32;
font-weight: bold;
font-size: 18px;
line-height: 1.2;
}
.subsidy-eligibility-note {
color: #1b5e20;
font-weight: bold;
font-size: 12.5px;
line-height: 1.5;
background: #eafaf0;
border: 1px solid #b7e4c7;
border-radius: 6px;
padding: 8px 10px;
margin-bottom: 10px;
}
.subsidy-eligibility-note strong {
color: #c0392b; /* 「合計が5万円以上」を赤で強調 */
}
/* ============================================
施工エリア案内
============================================ */
.ec-areaNotice {
margin: 16px 0;
padding: 16px 20px;
background: #f8f9fa;
border-left: 4px solid #1a6fcf;
border-radius: 0 8px 8px 0;
}
.ec-areaNotice__inner {
display: flex;
align-items: flex-start;
gap: 12px;
}
.ec-areaNotice__icon {
font-size: 22px;
line-height: 1;
flex-shrink: 0;
margin-top: 2px;
}
.ec-areaNotice__body {
flex: 1;
}
.ec-areaNotice__title {
font-size: 13px;
font-weight: bold;
color: #1a6fcf;
margin: 0 0 6px;
}
.ec-areaNotice__text {
font-size: 13px;
color: #444;
line-height: 1.7;
margin: 0;
}
.ec-areaNotice__text strong {
color: #222;
}
.ec-areaNotice__link {
display: inline-block;
margin-top: 8px;
font-size: 12px;
color: #1a6fcf;
text-decoration: underline;
}
.ec-areaNotice__link:hover {
color: #0d4fa0;
}
/* ============================================
SNSシェア + ブランド名 タイトル行
============================================ */
.ec-productRole__titleRow {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
margin-bottom: 4px;
}
.ec-productRole__titleRow .ec-headingTitle {
margin: 0;
flex: 1;
font-size: 18px;
}
.ec-share-inline {
display: flex;
align-items: center;
gap: 8px;
flex-shrink: 0;
}
@media (max-width: 767px) {
/* maker_area の float を解除して独立表示 */
#maker_area {
float: none !important;
width: auto !important;
height: auto !important;
display: block;
margin-bottom: 4px;
}
/* タイトル行: 商品名が全幅を占有しSNSは右寄せ下段 */
.ec-productRole__titleRow {
flex-wrap: wrap;
clear: both;
}
.ec-productRole__titleRow .ec-headingTitle {
flex: 1 1 100%;
font-size: 16px;
}
.ec-share-inline {
flex: 0 0 auto;
margin-left: auto;
}
}
.ec-share-inline a {
display: flex;
align-items: center;
justify-content: center;
width: 32px;
height: 32px;
border-radius: 50%;
font-size: 15px;
color: #fff;
text-decoration: none;
transition: opacity 0.2s;
}
.ec-share-inline a:hover { opacity: 0.8; }
.ec-share-inline .share-twitter { background: #000; }
.ec-share-inline .share-facebook { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.ec-share-inline .share-line { background: #06c755; }
/* description_detail下のシェアブロックはPC/スマホ共通で非表示(タイトル行に移動) */
.ec-productRole__share { display: none; }
/* ============================================
PC用: 現在のお見積り額カード強調
============================================ */
@media (min-width: 768px) {
.mitsumori-card-pc {
border: 2px solid #1a6fcf !important;
border-radius: 10px !important;
box-shadow: 0 4px 16px rgba(26,111,207,0.18) !important;
margin-top: 20px;
overflow: hidden;
background: linear-gradient(135deg, #1a6fcf, #0d4fa0) !important;
}
.mitsumori-card-pc .card-header {
background: linear-gradient(135deg, #1a6fcf, #0d4fa0) !important;
color: #fff !important;
padding: 14px 16px !important;
border-bottom: none !important;
}
.mitsumori-card-pc .card-title {
color: #fff !important;
font-size: 15px !important;
font-weight: bold !important;
margin: 0 !important;
}
.mitsumori-card-pc #mitsumori_message {
font-size: 22px !important;
font-weight: bold !important;
color: #fff !important;
}
.mitsumori-card-pc .btn-tool {
color: #fff !important;
}
/* 合計行を大きく強調 */
.mitsumori-card-pc .nav-item:first-child .nav-link {
font-size: 16px !important;
font-weight: bold !important;
color: #c00 !important;
background: #fff8f8 !important;
padding: 12px 16px !important;
}
.mitsumori-card-pc .nav-item:first-child #mitsumori_goukei {
font-size: 20px !important;
font-weight: bold !important;
color: #c00 !important;
}
/* card-body(明細リスト)を白背景に */
.mitsumori-card-pc .card-body {
background: #fff !important;
}
.mitsumori-card-pc .card-footer {
background: #f8faff !important;
border-top: 1px solid #dce8fb !important;
padding: 12px 16px !important;
}
}
@media (max-width: 767px) {
/* スマホでは現在のお見積り額カードの強調スタイルをすべてリセット */
.mitsumori-card-pc {
border: none !important;
border-radius: 0 !important;
box-shadow: none !important;
margin-top: 0 !important;
overflow: visible !important;
background: none !important;
/* sticky-top(position:sticky / z-index:1020) を解除。
そのままだと最下部で #sp-mitsumori-bar(z-index:1000) の上に
重なり、合計バーと文字が被るため通常フローへ戻す。 */
position: static !important;
z-index: auto !important;
}
.mitsumori-card-pc .card-header {
background: none !important;
color: inherit !important;
padding: inherit !important;
border-bottom: inherit !important;
}
.mitsumori-card-pc .card-title { color: inherit !important; }
.mitsumori-card-pc #mitsumori_message { font-size: inherit !important; color: inherit !important; }
.mitsumori-card-pc .btn-tool { color: inherit !important; }
/* 折りたたみトグルボタン */
.btn-mitsumori-toggle {
background: none !important;
border: 1px solid #aaa !important;
border-radius: 4px !important;
padding: 2px 8px !important;
font-size: 12px !important;
color: #333 !important;
line-height: 1.4 !important;
}
.btn-mitsumori-toggle .toggle-icon {
display: inline-block;
transition: transform 0.2s;
}
/* 展開状態: ▼→▲ */
.card:not(.collapsed-card) .btn-mitsumori-toggle .toggle-icon::before {
content: \"▲ 閉じる\";
}
.card:not(.collapsed-card) .btn-mitsumori-toggle .toggle-icon {
display: none;
}
.card:not(.collapsed-card) .btn-mitsumori-toggle::after {
content: \"▲ 閉じる\";
font-size: 12px;
}
.mitsumori-card-pc .nav-item:first-child .nav-link {
font-size: inherit !important;
color: inherit !important;
background: none !important;
padding: inherit !important;
}
.mitsumori-card-pc .nav-item:first-child #mitsumori_goukei {
font-size: inherit !important;
color: inherit !important;
}
.mitsumori-card-pc .card-footer {
background: none !important;
border-top: inherit !important;
padding: inherit !important;
}
/* 横スクロール禁止 */
body, html {
overflow-x: hidden;
max-width: 100vw;
}
/* ボタンの折り返しを許可(nowrapが原因で横スクロール発生するため) */
.opt-btn,
.rp-btn {
white-space: normal;
word-break: break-all;
}
/* エリア案内: スマホでコンパクト */
.ec-areaNotice {
margin: 8px 0;
padding: 8px 10px;
border-left-width: 3px;
cursor: pointer;
}
.ec-areaNotice__inner {
flex-direction: row;
gap: 8px;
align-items: flex-start;
}
.ec-areaNotice__icon { font-size: 15px; }
/* タイトル行: 展開トグル */
.ec-areaNotice__title {
font-size: 11px;
margin-bottom: 3px;
display: flex;
justify-content: space-between;
align-items: center;
}
.ec-areaNotice__title::after {
content: \"▼\";
font-size: 9px;
color: #888;
margin-left: 6px;
transition: transform 0.2s;
}
.ec-areaNotice.is-open .ec-areaNotice__title::after {
transform: rotate(180deg);
}
/* 折りたたみ対象: 閉じた状態では非表示 */
.ec-areaNotice__detail {
display: none;
}
.ec-areaNotice.is-open .ec-areaNotice__detail {
display: block;
}
.ec-areaNotice__text { font-size: 11px; line-height: 1.5; }
.ec-areaNotice__text br { display: none; }
.ec-areaNotice__link { font-size: 11px; margin-top: 3px; }
.rp-card { width: calc(33.333% - 6px); min-width: 80px; }
#sp-mitsumori-bar {
display: flex;
position: fixed;
bottom: 0;
left: 0;
right: 0;
z-index: 1000;
background: #fff;
border-top: 2px solid #e0e0e0;
box-shadow: 0 -2px 8px rgba(0,0,0,0.12);
align-items: center;
padding: 8px 10px calc(8px + env(safe-area-inset-bottom)) 10px;
gap: 8px;
}
#sp-mitsumori-bar .sp-bar__label {
font-size: 11px;
color: #666;
white-space: nowrap;
}
/* 価格ラッパ: 合計金額は最重要のため常に全桁表示する(縮小・省略しない)。
幅が足りない場合は下のボタン側を縮める(flex 配分でボタンが先に縮む)。 */
#sp-mitsumori-bar .sp-bar__pricewrap {
flex: 0 0 auto;
min-width: 0;
}
#sp-mitsumori-bar .sp-bar__price {
font-size: 18px;
font-weight: bold;
color: #c00;
white-space: nowrap;
}
#sp-mitsumori-bar .sp-bar__btn {
font-size: 12px;
padding: 8px 12px;
background: #333;
color: #fff;
border: none;
border-radius: 6px;
white-space: nowrap;
cursor: pointer;
position: relative;
display: inline-flex;
align-items: center;
gap: 6px;
flex: 1 1 auto;
min-width: 0;
justify-content: center;
}
#sp-mitsumori-bar .sp-bar__btn i {
font-size: 14px;
flex: 0 0 auto;
}
/* お見積りの詳細(内訳)を開くボタン。価格・カートボタンを圧迫しないよう
最小幅のアイコン+短ラベルにし、幅不足時も縮まない固定幅で維持する。 */
#sp-mitsumori-bar .sp-bar__detail-btn {
display: inline-flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 2px;
flex: 0 0 auto;
padding: 4px 8px;
background: #fff;
color: #c00;
border: 1px solid #c00;
border-radius: 6px;
font-size: 10px;
font-weight: bold;
line-height: 1.1;
white-space: nowrap;
cursor: pointer;
}
#sp-mitsumori-bar .sp-bar__detail-btn i { font-size: 15px; }
/* 幅が足りないときはボタンの文字を省略し、価格と数字を守る。 */
#sp-mitsumori-bar .sp-bar__btn-label {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
#sp-mitsumori-bar .sp-bar__cart-badge {
position: absolute;
top: -6px;
right: -6px;
background: #c00;
color: #fff;
border-radius: 50%;
min-width: 16px;
height: 16px;
font-size: 10px;
line-height: 16px;
padding: 0 4px;
font-weight: bold;
}
#sp-mitsumori-bar .sp-bar__home-btn {
display: inline-flex;
align-items: center;
justify-content: center;
width: 36px;
height: 36px;
flex: 0 0 auto;
border: 1px solid #ccc;
border-radius: 6px;
background: #fff;
color: #333;
text-decoration: none;
cursor: pointer;
}
#sp-mitsumori-bar .sp-bar__home-btn i {
font-size: 16px;
}
#sp-mitsumori-bar .sp-bar__home-btn:hover {
background: #f0f0f0;
}
/* 下部バーの高さ分ページ下部にpaddingを追加 (iOS safe-area 込み) */
body {
padding-bottom: calc(80px + env(safe-area-inset-bottom));
}
}
/* ============================================
カート追加モーダル: 縦並び中央配置
============================================ */
.add-cart-modal__wrap {
text-align: center;
}
.add-cart-modal__header {
font-size: 16px;
margin: 20px 0 24px;
text-align: center;
}
.add-cart-modal__actions {
display: flex;
flex-direction: column;
align-items: center;
gap: 16px;
padding: 0 20px 20px;
}
.add-cart-modal__primary {
display: inline-block;
width: 80%;
max-width: 320px;
padding: 14px 20px;
font-size: 15px;
font-weight: bold;
text-align: center;
background: #d9534f;
color: #fff !important;
border-radius: 6px;
text-decoration: none;
cursor: pointer;
}
.add-cart-modal__primary:hover {
background: #c9302c;
color: #fff !important;
text-decoration: none;
}
.add-cart-modal__secondary {
display: inline-block;
padding: 6px 14px;
font-size: 12px;
color: #666;
border: 1px solid #ccc;
border-radius: 4px;
background: #fff;
cursor: pointer;
}
.add-cart-modal__secondary:hover {
background: #f0f0f0;
color: #333;
}
@media (max-width: 767px) {
.add-cart-modal__actions {
gap: 20px;
}
}
</style>
{% endblock %}
{% block javascript %}
<script>
eccube.classCategories = {{ class_categories_as_json(Product)|raw }};
// 規格2に選択肢を割り当てる。
function fnSetClassCategories(form, classcat_id2_selected) {
var \$form = \$(form);
var product_id = \$form.find('input[name=product_id]').val();
var \$sele1 = \$form.find('select[name=classcategory_id1]');
var \$sele2 = \$form.find('select[name=classcategory_id2]');
eccube.setClassCategories(\$form, product_id, \$sele1, \$sele2, classcat_id2_selected);
}
{% if form.classcategory_id2 is defined %}
fnSetClassCategories(
\$('#form1'), {{ form.classcategory_id2.vars.value|json_encode|raw }}
);
{% elseif form.classcategory_id1 is defined %}
eccube.checkStock(\$('#form1'), {{ Product.id }}, {{ form.classcategory_id1.vars.value|json_encode|raw }}, null);
{% endif %}
</script>
<script>
\$(function() {
// bfcache無効化
\$(window).bind('pageshow', function(event) {
if (event.originalEvent.persisted) {
location.reload(true);
}
});
// Core Web Vital の Cumulative Layout Shift(CLS)対策のため
// img タグに width, height が付与されている.
// 630px 未満の画面サイズでは縦横比が壊れるための対策
// see https://github.com/EC-CUBE/ec-cube/pull/5023
\$('.ec-grid2__cell').hide();
var removeSize = function () {
\$('.slide-item').height('');
\$('.slide-item img')
.removeAttr('width')
.removeAttr('height')
.removeAttr('style');
};
var slickInitial = function(slick) {
\$('.ec-grid2__cell').fadeIn(1500);
var baseHeight = \$(slick.target).height();
var baseWidth = \$(slick.target).width();
var rate = baseWidth / baseHeight;
\t\t\t\tif(baseHeight * rate < 400){
\t \$('.slide-item').height(baseHeight * rate); // 余白を削除する
\t\t\t\t}else{
\t \$('.slide-item').height(400); // 余白を削除する
\t\t\t\t}
// transform を使用することでCLSの影響を受けないようにする
\$('.slide-item img')
.css(
{
'transform-origin': 'top left',
'transform': 'scaleY(' + rate + ')',
'transition': 'transform .1s'
}
);
// 正しいサイズに近くなったら属性を解除する
setTimeout(removeSize, 500);
};
\$('.item_visual').on('init', slickInitial);
// リサイズ時は CLS の影響を受けないため属性を解除する
\$(window).resize(removeSize);
\$('.item_visual').slick({
dots: false,
arrows: true,
responsive: [{
breakpoint: 768,
settings: {
dots: true,
\t\tarrows: false
}
}]
});
\$('.slideThumb').on('click', function() {
var index = \$(this).attr('data-index');
\$('.item_visual').slick('slickGoTo', index, false);
})
});
</script>
<script>
\$(function() {
\$('.add-cart').on('click', function(event) {
{% if form.classcategory_id1 is defined %}
// 規格1フォームの必須チェック
if (\$('#classcategory_id1').val() == '__unselected' || \$('#classcategory_id1').val() == '') {
\$('#classcategory_id1')[0].setCustomValidity('{{ '項目が選択されていません'|trans }}');
return true;
} else {
\$('#classcategory_id1')[0].setCustomValidity('');
}
{% endif %}
{% if form.classcategory_id2 is defined %}
// 規格2フォームの必須チェック
if (\$('#classcategory_id2').val() == '__unselected' || \$('#classcategory_id2').val() == '') {
\$('#classcategory_id2')[0].setCustomValidity('{{ '項目が選択されていません'|trans }}');
return true;
} else {
\$('#classcategory_id2')[0].setCustomValidity('');
}
{% endif %}
// タイプ2: カート送信直前に set_count を quantity に同期
if(\$('#set_count').length){
var _sc = parseInt(\$('#set_count').val()) || 1;
\$('#quantity').val(_sc);
\$('input[name=\"quantity\"]').val(_sc);
}
// 個数フォームのチェック
if (\$('#quantity').val() < 1) {
\$('#quantity')[0].setCustomValidity('{{ '1以上で入力してください。'|trans }}');
return true;
} else {
\$('#quantity')[0].setCustomValidity('');
}
event.preventDefault();
\$form = \$('#form1');
\$.ajax({
url: \$form.attr('action'),
type: \$form.attr('method'),
data: \$form.serialize(),
dataType: 'json',
beforeSend: function(xhr, settings) {
// Buttonを無効にする
\$('.add-cart').prop('disabled', true);
}
}).done(function(data) {
// レスポンス内のメッセージをalertで表示
\$.each(data.messages, function() {
\$('#ec-modal-header').text(this);
});
\$('.ec-modal').show()
// カートブロックを更新する
\$.ajax({
url: \"{{ url('block_cart') }}\",
type: 'GET',
dataType: 'html'
}).done(function(html) {
\$('.ec-headerRole__cart').html(html);
});
}).fail(function(data) {
alert('{{ 'カートへの追加に失敗しました。'|trans }}');
}).always(function(data) {
// Buttonを有効にする
\$('.add-cart').prop('disabled', false);
});
});
});
\$('.ec-modal-wrap').on('click', function(e) {
// モーダル内の処理は外側にバブリングさせない
e.stopPropagation();
});
\$('.ec-modal-overlay, .ec-modal, .ec-modal-close, .ec-inlineBtn--cancel').on('click', function() {
\$('.ec-modal').hide()
});
\t\tvar pw = \"{% if mitsumori_json %}{{ mitsumori_json.pw }}{% endif %}\";
\t\tvar pd = \"{% if mitsumori_json %}{{ mitsumori_json.pd }}{% endif %}\";
\t\tvar ph = \"{% if mitsumori_json %}{{ mitsumori_json.ph }}{% endif %}\";
\t\tvar pm = \"{% if mitsumori_json %}{{ mitsumori_json.pm }}{% endif %}\";
\t\tvar pc = \"{% if mitsumori_json %}{{ mitsumori_json.pc }}{% endif %}\";
\t\t// option1 / option2: カテゴリ別 option 軸 (um: タイプ=subtype, fe: ct_up 等)
\t\tvar option1 = \"{% if mitsumori_json and mitsumori_json.option1 is defined %}{{ mitsumori_json.option1 }}{% endif %}\";
\t\tvar option2 = \"{% if mitsumori_json and mitsumori_json.option2 is defined %}{{ mitsumori_json.option2 }}{% endif %}\";
\t\tvar op0 = \"{% if mitsumori_json %}{{ mitsumori_json.op[0] }}{% endif %}\";
\t\tvar op1 = \"{% if mitsumori_json %}{{ mitsumori_json.op[1] }}{% endif %}\";
\t\tvar op2 = \"{% if mitsumori_json %}{{ mitsumori_json.op[2] }}{% endif %}\";
\t\tvar op3 = \"{% if mitsumori_json %}{{ mitsumori_json.op[3] }}{% endif %}\";
\t\tvar op4 = \"{% if mitsumori_json %}{{ mitsumori_json.op[4] }}{% endif %}\";
\t\tvar op5 = \"{% if mitsumori_json %}{{ mitsumori_json.op[5] }}{% endif %}\";
\t\tvar op6 = \"{% if mitsumori_json %}{{ mitsumori_json.op[6] }}{% endif %}\";
\t\tvar op7 = \"{% if mitsumori_json %}{{ mitsumori_json.op[7] }}{% endif %}\";
\t\tvar op8 = \"{% if mitsumori_json %}{{ mitsumori_json.op[8] }}{% endif %}\";
\t\tvar op9 = \"{% if mitsumori_json %}{{ mitsumori_json.op[9] }}{% endif %}\";
\t\tvar op10 = \"{% if mitsumori_json %}{{ mitsumori_json.op[10] }}{% endif %}\";
\t\tconst formatter = new Intl.NumberFormat('ja-JP');
\t\t// ============================================================
\t\t// free_area 1 エントリのスキーマ(11 キー固定)
\t\t// ============================================================
\t\t// w : 幅 (string, 例 \"239.9cm\" / tf は \"1m\")
\t\t// d : 奥行
\t\t// h : 高さ (tf はロール長 \"10m\")
\t\t// m : 素材
\t\t// c : カラー
\t\t// price : 販売価格 (税抜、amount=1 ベース)
\t\t// unit_price : 商品 per-unit 増分 (税抜、AMOUNT_CATEGORIES のみ)
\t\t// maker_price : メーカー価格 (税抜)
\t\t// ct : 基本工事費 (税抜、amount=1 ベース)
\t\t// option1 : fe → ct_up / その他カテゴリ → category-specific
\t\t// option2 : um → ct_up / その他カテゴリ → category-specific
\t\t//
\t\t// ct4 (設置場所) / ct5 (撤去) / ct6 (残土) は option_area 側で扱う.
\t\t// ============================================================
\t\t// 施工オプション定義(option_area)— 各エントリ {name, comment, on, off, price}
\t\tvar op_data = {{ op_json|default('[]')|raw }};
\t\t// option_item_area:
\t\t// tg 用 — block 別オプション差額表
\t\t// { axis_labels: {F:'床材',front:'前面型',side1:'右側面型',side2:'左側面型'},
\t\t// blocks: { 'W_label|D_label': { F:[{idx,label,diff},...], front:[...], side1:[...], side2:[...] }, ... } }
\t\t// fe (sale_type=4) 用 — ブロックの種類×段数の差額表 (fe_block キー)
\t\t// { fe_block: { depends_on_name: '...', depends_on_value: '...',
\t\t// title: '...', default_key: '...',
\t\t// choices: [{key,label,price}, ...] } }
\t\t// 該当しないカテゴリでは fe_block は null. axis_labels/blocks は空.
\t\tvar oi_data = {{ oi_json|default('{\"axis_labels\":{},\"blocks\":{},\"fe_block\":null}')|raw }};
\t\t// 選択中の tg オプション差額 (axis -> selected choice_idx). ラジオ click で更新される.
\t\tvar oi_selected = { F: 1, front: 1, side1: 1, side2: 1 };
\t\t// 選択中の fe ブロック種類×段数 (key 文字列). 既定は oi_data.fe_block.default_key.
\t\tvar fe_block_selected = (oi_data && oi_data.fe_block && oi_data.fe_block.default_key) || '';
\t\t// sale_type ID(mtb_sale_type の id。本サイトでの意味は次の通り):
\t\t// 1 通常 / 2 補助金窓 / 3 物置 / 4 フェンス / 5 デッキ / 6 芝生 / 9 商品のみ
\t\tvar SALE_TYPE_ID = {{ ProductClass.SaleType.id }};
\t\t{# option1 / option2 ラベルをカテゴリ別に決定 (sh=31, rd=43, mo=15) — 以降の UI / JS 両方で使用 #}
\t\t{% set option1_label = 'オプション1' %}
\t\t{% set option2_label = 'オプション2' %}
\t\t{% if Product.ProductCategories is not empty %}
\t\t\t{% for pcat in Product.ProductCategories %}
\t\t\t\t{% if pcat.category_id == 31 %}{% set option1_label = 'サイズプリセット' %}{% set option2_label = '駆動方式' %}{% endif %}
\t\t\t\t{% if pcat.category_id == 43 %}{% set option1_label = 'ランマ' %}{% set option2_label = 'タイプ' %}{% endif %}
\t\t\t\t{% if pcat.category_id == 15 %}{% set option1_label = '棚タイプ' %}{% endif %}
\t\t\t\t{% if pcat.category_id == 17 %}{% set option1_label = '窓タイプ' %}{% endif %}
\t\t\t{% endfor %}
\t\t{% endif %}
\t\t// 消費税率(pp.price/pp.ct/op_data.price は scraper が税抜で保存しているため、
\t\t// calcGoukei 出口で 1+TAX_RATE を掛けて税込 mitsumori_goukei にする)
\t\tvar TAX_RATE = 0.10;
\t\tfunction toIncTax(v) { return Math.round(v * (1 + TAX_RATE)); }
\t\t/**
\t\t * tg 用 block 別オプション差額の集計.
\t\t * 現選択 (W, D) から block key を作り、oi_data.blocks[blockKey] を取得.
\t\t * 各 axis (F/front/side1/side2) で oi_selected[axis] の choice の diff を合計.
\t\t * 戻り値: { total: 差額合計(税抜), items: [{name, label, diff}, ...] }
\t\t * block が無い (tg 以外 / 該当 (W,D) が未取得) なら total=0.
\t\t */
\t\tfunction collectOptionItems(curW, curD) {
\t\t\tvar result = { total: 0, items: [] };
\t\t\tif (!oi_data || !oi_data.blocks) return result;
\t\t\tvar blockKey = (curW || '') + '|' + (curD || '');
\t\t\tvar block = oi_data.blocks[blockKey];
\t\t\tif (!block) return result;
\t\t\tvar axes = ['F', 'front', 'side1', 'side2'];
\t\t\tfor (var i = 0; i < axes.length; i++) {
\t\t\t\tvar axis = axes[i];
\t\t\t\tvar choices = block[axis];
\t\t\t\tif (!choices || !choices.length) continue;
\t\t\t\tvar idx = oi_selected[axis] || 1;
\t\t\t\tvar pick = null;
\t\t\t\tfor (var j = 0; j < choices.length; j++) {
\t\t\t\t\tif (parseInt(choices[j].idx) === parseInt(idx)) { pick = choices[j]; break; }
\t\t\t\t}
\t\t\t\tif (!pick) pick = choices[0];
\t\t\t\tvar diff = parseInt(pick.diff) || 0;
\t\t\t\tresult.total += diff;
\t\t\t\tresult.items.push({
\t\t\t\t\tname: oi_data.axis_labels[axis] || axis,
\t\t\t\t\tlabel: pick.label,
\t\t\t\t\tdiff: diff,
\t\t\t\t});
\t\t\t}
\t\t\treturn result;
\t\t}
\t\t/**
\t\t * tg ラジオ群を block 別に DOM へ描画する.
\t\t * W/D が確定したら現 block の 4 軸 (F/front/side1/side2) ラジオを #tg-options 要素に出す.
\t\t * block が空なら #tg-options を空にする.
\t\t */
\t\tfunction renderOptionItemRadios(curW, curD) {
\t\t\tvar \$box = \$('#tg-options');
\t\t\tif (!\$box.length) return;
\t\t\t\$box.empty();
\t\t\tif (!oi_data || !oi_data.blocks) return;
\t\t\tvar blockKey = (curW || '') + '|' + (curD || '');
\t\t\tvar block = oi_data.blocks[blockKey];
\t\t\tif (!block) return;
\t\t\tvar axes = ['F', 'front', 'side1', 'side2'];
\t\t\taxes.forEach(function(axis) {
\t\t\t\tvar choices = block[axis];
\t\t\t\tif (!choices || !choices.length) return;
\t\t\t\tvar axisLabel = (oi_data.axis_labels && oi_data.axis_labels[axis]) || axis;
\t\t\t\tvar \$section = \$('<div class=\"form-group tg-axis\"></div>');
\t\t\t\t\$section.append('<p class=\"rp-section-label\"><strong>' + axisLabel + '</strong>: <span class=\"tg-axis-selected\"></span></p>');
\t\t\t\t// 他オプション(opt-btn)と統一したボタン型 UI で描画(縦積み・長ラベル折返し).
\t\t\t\tvar \$list = \$('<div class=\"opt-btn-group no-hscroll\" style=\"flex-direction:column;align-items:stretch;\"></div>');
\t\t\t\tchoices.forEach(function(ch, i) {
\t\t\t\t\tvar inputId = 'tg_' + axis + '_' + ch.idx;
\t\t\t\t\tvar name = 'tg_' + axis;
\t\t\t\t\tvar isSel = (parseInt(ch.idx) === parseInt(oi_selected[axis] || 1));
\t\t\t\t\tvar diffTxt = ch.diff > 0 ? '+' + formatter.format(ch.diff) + '円' : (ch.diff < 0 ? formatter.format(ch.diff) + '円' : '±0');
\t\t\t\t\t\$list.append(
\t\t\t\t\t\t'<label class=\"opt-btn' + (isSel ? ' is-selected' : '') + '\" style=\"text-align:left;display:flex;align-items:center;flex-wrap:wrap;\">' +
\t\t\t\t\t\t'<input type=\"radio\" name=\"' + name + '\" id=\"' + inputId + '\" value=\"' + ch.idx + '\" data-axis=\"' + axis + '\"' + (isSel ? ' checked' : '') + '>' +
\t\t\t\t\t\tch.label + '<span class=\"tg-diff\">(' + diffTxt + ')</span></label>'
\t\t\t\t\t);
\t\t\t\t});
\t\t\t\t\$section.append(\$list);
\t\t\t\t\$box.append(\$section);
\t\t\t});
\t\t\t// ラジオ選択で oi_selected 更新 + is-selected 付替え → 再計算
\t\t\t\$box.off('change.tg').on('change.tg', 'input[type=\"radio\"][data-axis]', function() {
\t\t\t\tvar axis = \$(this).data('axis');
\t\t\t\toi_selected[axis] = parseInt(\$(this).val()) || 1;
\t\t\t\t\$(this).closest('.opt-btn-group').find('label.opt-btn').removeClass('is-selected');
\t\t\t\t\$(this).closest('label.opt-btn').addClass('is-selected');
\t\t\t\tmitsumori_simulation('refresh', '');
\t\t\t});
\t\t\tupdateOptionItemSelectedLabels();
\t\t}
\t\tfunction updateOptionItemSelectedLabels() {
\t\t\t\$('#tg-options .tg-axis').each(function() {
\t\t\t\tvar \$sel = \$(this).find('input[type=\"radio\"]:checked');
\t\t\t\tif (!\$sel.length) return;
\t\t\t\tvar label = \$sel.parent().contents().filter(function() { return this.nodeType === 3; }).text().trim();
\t\t\t\t\$(this).find('.tg-axis-selected').text(label);
\t\t\t});
\t\t}
\t\t// =========================================================
\t\t// fe (sale_type=4) ブロック種類×段数 サブ UI
\t\t// =========================================================
\t\t/**
\t\t * fe_block の親オプション (= op_data 内の「ご希望のフェンス設置方法」 entry)
\t\t * を name でルックアップし、その index を返す. 見つからなければ -1.
\t\t * fe_block.depends_on_name が設定されていればそれで照合.
\t\t * 未設定なら 'ご希望のフェンス設置方法' を含む name にフォールバック.
\t\t */
\t\tfunction findFeBlockParentOpIndex() {
\t\t\tif (!oi_data || !oi_data.fe_block) return -1;
\t\t\tvar needle = oi_data.fe_block.depends_on_name || 'ご希望のフェンス設置方法';
\t\t\tfor (var i = 0; i < op_data.length; i++) {
\t\t\t\tif (!op_data[i] || !op_data[i].name) continue;
\t\t\t\tif (op_data[i].name.indexOf(needle) >= 0) return i;
\t\t\t}
\t\t\treturn -1;
\t\t}
\t\t/**
\t\t * fe_block の現在の選択値の price (税抜) と choice 内容を集計.
\t\t * 親オプション (= 'ご希望のフェンス設置方法') が depends_on_value を選んでいる
\t\t * ときだけ加算する. それ以外 (既存ブロック側 / 親未選択) は price=0.
\t\t * 戻り値: { price: 0|N, choice: {key,label,price}|null, active: bool }
\t\t */
\t\tfunction collectFeBlock() {
\t\t\tvar result = { price: 0, choice: null, active: false };
\t\t\tif (SALE_TYPE_ID !== 4) return result;
\t\t\tif (!oi_data || !oi_data.fe_block) return result;
\t\t\tif (!oi_data.fe_block.choices || !oi_data.fe_block.choices.length) return result;
\t\t\tvar parentIdx = findFeBlockParentOpIndex();
\t\t\tif (parentIdx < 0) return result;
\t\t\tvar ops = [op0,op1,op2,op3,op4,op5,op6,op7,op8,op9,op10];
\t\t\tvar parentSel = ops[parentIdx];
\t\t\tvar triggerValue = oi_data.fe_block.depends_on_value || '新規にブロック積みを行う';
\t\t\tif (parentSel !== triggerValue) return result; // 親が新規ブロック積み以外なら無加算
\t\t\tresult.active = true;
\t\t\tvar choices = oi_data.fe_block.choices;
\t\t\tvar pick = null;
\t\t\tfor (var j = 0; j < choices.length; j++) {
\t\t\t\tif (choices[j].key === fe_block_selected) { pick = choices[j]; break; }
\t\t\t}
\t\t\tif (!pick) pick = choices[0];
\t\t\tresult.choice = pick;
\t\t\tresult.price = parseInt(pick.price) || 0;
\t\t\treturn result;
\t\t}
\t\t/**
\t\t * fe_block ラジオ群を #fe-block-options 要素に描画する.
\t\t * active=false (親が「新規にブロック積み」以外) のときは非表示.
\t\t */
\t\tfunction renderFeBlockRadios() {
\t\t\tvar \$box = \$('#fe-block-options');
\t\t\tif (!\$box.length) return;
\t\t\tif (!oi_data || !oi_data.fe_block || !oi_data.fe_block.choices) {
\t\t\t\t\$box.empty().hide();
\t\t\t\treturn;
\t\t\t}
\t\t\tvar parentIdx = findFeBlockParentOpIndex();
\t\t\tif (parentIdx < 0) {
\t\t\t\t\$box.empty().hide();
\t\t\t\treturn;
\t\t\t}
\t\t\tvar ops = [op0,op1,op2,op3,op4,op5,op6,op7,op8,op9,op10];
\t\t\tvar triggerValue = oi_data.fe_block.depends_on_value || '新規にブロック積みを行う';
\t\t\tvar visible = (ops[parentIdx] === triggerValue);
\t\t\tif (!visible) {
\t\t\t\t\$box.hide();
\t\t\t\treturn;
\t\t\t}
\t\t\tvar fb = oi_data.fe_block;
\t\t\t\$box.empty();
\t\t\tvar \$title = \$('<p class=\"rp-section-label\"><strong>' + (fb.title || 'ブロックの種類と段数') + '</strong></p>');
\t\t\t\$box.append(\$title);
\t\t\t// 他オプション群と同じ .opt-btn-group / .opt-btn 形式で描画.
\t\t\t// 生の <label><input type=radio> ... 形式だと CSS 定義が無く
\t\t\t// ラベル折り返し・縦ズレ・隣接 opt-btn との間隔不揃いが発生する.
\t\t\tvar \$list = \$('<div class=\"opt-btn-group no-hscroll\" style=\"flex-direction:column;align-items:stretch;\"></div>');
\t\t\tfb.choices.forEach(function(ch) {
\t\t\t\tvar inputId = 'fe_block_' + ch.key;
\t\t\t\tvar isSel = (ch.key === fe_block_selected);
\t\t\t\tvar checked = isSel ? ' checked' : '';
\t\t\t\tvar selCls = isSel ? ' is-selected' : '';
\t\t\t\t// 選択肢ラベルには価格を表示しない(差額は合計金額側でのみ反映)。
\t\t\t\t\$list.append(
\t\t\t\t\t'<label class=\"opt-btn' + selCls + '\" style=\"text-align:left;display:flex;align-items:center;flex-wrap:wrap;\">' +
\t\t\t\t\t'<input type=\"radio\" name=\"fe_block\" id=\"' + inputId + '\" value=\"' + ch.key + '\"' + checked + '>' +
\t\t\t\t\t'<span class=\"fe-block-label\">' + ch.label + '</span>' +
\t\t\t\t\t'</label>'
\t\t\t\t);
\t\t\t});
\t\t\t\$box.append(\$list);
\t\t\t\$box.show();
\t\t\t\$box.off('change.fe_block').on('change.fe_block', 'input[type=\"radio\"][name=\"fe_block\"]', function() {
\t\t\t\tfe_block_selected = \$(this).val();
\t\t\t\t// is-selected 切替 (opt-btn 形式共通)
\t\t\t\t\$box.find('label.opt-btn').removeClass('is-selected');
\t\t\t\t\$(this).closest('label.opt-btn').addClass('is-selected');
\t\t\t\tmitsumori_simulation('refresh', '');
\t\t\t});
\t\t}
\t\t/**
\t\t * fe (sale_type=4) で op_data エントリの連動表示制御.
\t\t * 親「ご希望のフェンス設置方法」の選択値に応じて、
\t\t * - 「既存ブロックに穴空け工事が必要ですか?」 entry を表示/非表示
\t\t * 切替の trigger は親選択値の文字列で判定 (entry index にハードコードしない).
\t\t */
\t\tfunction updateFeOpConditionalVisibility() {
\t\t\tif (SALE_TYPE_ID !== 4) return;
\t\t\tvar parentIdx = findFeBlockParentOpIndex();
\t\t\tif (parentIdx < 0) return;
\t\t\tvar ops = [op0,op1,op2,op3,op4,op5,op6,op7,op8,op9,op10];
\t\t\tvar parentSel = ops[parentIdx];
\t\t\t// 親が「既存ブロックに設置する」 (= off 側) のとき穴空け entry を表示
\t\t\tvar triggerOffValue = (op_data[parentIdx] && op_data[parentIdx].off) || '既存ブロックに設置する';
\t\t\t\$('div[data-op-name]').each(function() {
\t\t\t\tvar n = \$(this).attr('data-op-name') || '';
\t\t\t\tif (n.indexOf('穴空け') >= 0) {
\t\t\t\t\tif (parentSel === triggerOffValue) {
\t\t\t\t\t\t\$(this).show();
\t\t\t\t\t} else {
\t\t\t\t\t\t\$(this).hide();
\t\t\t\t\t}
\t\t\t\t}
\t\t\t});
\t\t}
\t\t/**
\t\t * 選択中の施工オプションを集計し、ON選択分の price を合計する.
\t\t * 戻り値: { total: 合計金額, items: [{name, value, price}, ...] }
\t\t */
\t\tfunction collectOptions() {
\t\t\tvar ops = [op0,op1,op2,op3,op4,op5,op6,op7,op8,op9,op10];
\t\t\tvar total = 0;
\t\t\tvar items = [];
\t\t\tfor (var i = 0; i < ops.length; i++) {
\t\t\t\tif (!op_data[i] || !op_data[i].name) continue;
\t\t\t\tvar sel = ops[i];
\t\t\t\tif (!sel) continue;
\t\t\t\tvar price = parseInt(op_data[i].price) || 0;
\t\t\t\t// 「ON」選択時のみ加算(OFF や「不要」「商品購入のみ」は加算しない)
\t\t\t\tvar isOn = (sel === op_data[i].on);
\t\t\t\titems.push({
\t\t\t\t\tname: op_data[i].name,
\t\t\t\t\tvalue: sel,
\t\t\t\t\tprice: isOn ? price : 0,
\t\t\t\t\ton: op_data[i].on,
\t\t\t\t\toff: op_data[i].off,
\t\t\t\t});
\t\t\t\tif (isOn) total += price;
\t\t\t}
\t\t\t// fe (sale_type=4) のブロック種類×段数 分を items / total に統合.
\t\t\t// 親オプション「ご希望のフェンス設置方法」 が 「新規にブロック積みを行う」 のとき
\t\t\t// だけ加算される (collectFeBlock 内で判定済み).
\t\t\tvar fb = collectFeBlock();
\t\t\tif (fb.active && fb.choice) {
\t\t\t\titems.push({
\t\t\t\t\tname: (oi_data.fe_block && oi_data.fe_block.title) || 'ブロックの種類と段数',
\t\t\t\t\tvalue: fb.choice.label,
\t\t\t\t\tprice: fb.price,
\t\t\t\t\ton: fb.choice.label,
\t\t\t\t\toff: '',
\t\t\t\t});
\t\t\t\ttotal += fb.price;
\t\t\t}
\t\t\treturn { total: total, items: items };
\t\t}
\t\t/**
\t\t * free_area 1 エントリ ({w,d,h,m,c,price,unit_price,maker_price,ct,option1,option2})
\t\t * から sale_type 別に最終金額を算出する.
\t\t *
\t\t * 計算式(amount=1 ベース、出口で × 1.10 税込化):
\t\t * 1 通常 : price + ct + option_sum
\t\t * 2 補助金窓 : price × set_count + (ct + (set_count-1) × option2) + option_sum
\t\t * 3 物置 : (price + ct) × daisu + option_sum
\t\t * 4 フェンス : price + (maisu-1) × unit_price
\t\t * + ct + max(0, maisu-3) × option1
\t\t * + option_sum (maisu >= 3)
\t\t * 5 デッキ : price + ct + option_sum (area は表示用、計算非関与)
\t\t * 6 芝生 : price × ceil(area / (w_m × h_m)) + ct + option_sum
\t\t * 9 商品のみ : price のみ(カート quantity 倍で総額)
\t\t *
\t\t * fe では option1 を ct_up、um では option2 を ct_up として転用.
\t\t * tf では w / h にロール幅・長さが格納されており parseLen で数値抽出.
\t\t *
\t\t * @param {Object} pp free_area の 1 行(matrix エントリ)
\t\t * @param {number} optionTotal collectOptions().total
\t\t * @param {Object} ctx UI 入力 {set_count, daisu, maisu, area, quantityOnly, ...}
\t\t * @returns {Object} {goukei, price, ct, opt, qty} すべて税込整数
\t\t */
\t\tfunction calcGoukei(pp, optionTotal, ctx) {
\t\t\tvar basePrice = parseInt(pp.price) || 0;
\t\t\tvar baseCt = parseInt(pp.ct) || 0;
\t\t\tvar unitPrice = parseInt(pp.unit_price) || 0;
\t\t\tvar optSum = optionTotal;
\t\t\tvar price = basePrice;
\t\t\tvar ct = baseCt;
\t\t\tvar steelRoof = 0; // cp 折半屋根(スチール折板 = option1, ex-shop同額)
\t\t\tvar qty = 1;
\t\t\tvar goukei = 0;
\t\t\t// 「商品購入のみ」選択時は工事費・オプションをゼロにする(任意 sale_type で適用)
\t\t\tvar ops = [op0,op1,op2,op3,op4,op5,op6,op7,op8,op9,op10];
\t\t\tvar purchaseOnly = ops.some(function(v){ return v === '商品購入のみ'; });
\t\t\tif (purchaseOnly) {
\t\t\t\tbaseCt = 0;
\t\t\t\tct = 0;
\t\t\t\toptSum = 0;
\t\t\t}
\t\t\tswitch (SALE_TYPE_ID) {
\t\t\t\tcase 2: { // 補助金・窓 (シンプル表引き方式 2026-05-)
\t\t\t\t\t// 2026-05 仕様簡素化: 枚数軸を廃止し、subtype に枚数を内包.
\t\t\t\t\t// pp.price / pp.ct は (W, H, ガラス, subtype) の単一価格.
\t\t\t\t\t// 複数枚をまとめて買う場合はカート quantity で表現.
\t\t\t\t\tqty = 1;
\t\t\t\t\tprice = basePrice;
\t\t\t\t\tct = baseCt;
\t\t\t\t\tgoukei = price + ct + optSum;
\t\t\t\t\tbreak;
\t\t\t\t}
\t\t\t\tcase 3: { // 物置・ゴミステーション
\t\t\t\t\tqty = Math.max(1, parseInt(ctx.daisu) || 1);
\t\t\t\t\tprice = basePrice * qty;
\t\t\t\t\tct = baseCt * qty;
\t\t\t\t\tgoukei = price + ct + optSum;
\t\t\t\t\tbreak;
\t\t\t\t}
\t\t\t\tcase 4: { // フェンス・組み立て式(maisu ≥ 3、base_amount = 3)
\t\t\t\t\t// scraper は amount=3 を base にしているので pp.price = price(3),
\t\t\t\t\t// pp.unit_price = price(4) - price(3).
\t\t\t\t\tqty = Math.max(3, parseInt(ctx.maisu) || 3);
\t\t\t\t\tprice = basePrice + (qty - 3) * unitPrice;
\t\t\t\t\t// option1 が ct_up (4枚目以降の増分). 未設定なら ct 固定動作
\t\t\t\t\tvar ctUp1 = parseInt(pp.option1) || 0;
\t\t\t\t\tct = baseCt + Math.max(0, qty - 3) * ctUp1;
\t\t\t\t\t// fe_block(ブロック積み段数): collectOptions が base(3枚分)を optSum に
\t\t\t\t\t// 算入済み. ブロック費も本体同様に枚数連動するため、4枚目以降は 1枚毎に
\t\t\t\t\t// choice.unit_price(= block(4)-block(3)) を加算する.
\t\t\t\t\t// (顧客指摘「何枚施工でも増える金額が同じ」の是正。unit_price 未設定の
\t\t\t\t\t// 旧データでは +0 で従来動作。)
\t\t\t\t\tif (!purchaseOnly) {
\t\t\t\t\t\tvar fbC = collectFeBlock();
\t\t\t\t\t\tif (fbC.active && fbC.choice) {
\t\t\t\t\t\t\toptSum += Math.max(0, qty - 3) * (parseInt(fbC.choice.unit_price) || 0);
\t\t\t\t\t\t}
\t\t\t\t\t}
\t\t\t\t\tgoukei = price + ct + optSum;
\t\t\t\t\tbreak;
\t\t\t\t}
\t\t\t\tcase 5: { // ウッドデッキ・タイルデッキ
\t\t\t\t\t// area は担当者向けの参考値として保持(計算には使わない)
\t\t\t\t\tqty = 1;
\t\t\t\t\tgoukei = basePrice + baseCt + optSum;
\t\t\t\t\tprice = basePrice;
\t\t\t\t\tct = baseCt;
\t\t\t\t\tbreak;
\t\t\t\t}
\t\t\t\tcase 6: { // 芝生・人工芝(ロール単位)
\t\t\t\t\t// pp.w \"1m\", pp.h \"10m\" から数値抽出
\t\t\t\t\tvar w_m = parseLen(pp.w);
\t\t\t\t\tvar h_m = parseLen(pp.h);
\t\t\t\t\tvar rollSize = w_m * h_m;
\t\t\t\t\tif (!rollSize || rollSize <= 0) rollSize = 1;
\t\t\t\t\t// 施工サイズ(面積)があれば必要枚数を自動算出。無ければ直接指定の枚数を使う。
\t\t\t\t\tvar area = parseFloat(ctx.area) || 0;
\t\t\t\t\tif (area > 0) {
\t\t\t\t\t\tqty = Math.max(1, Math.ceil(area / rollSize));
\t\t\t\t\t} else {
\t\t\t\t\t\tqty = Math.max(1, parseInt(ctx.tf_qty) || 1);
\t\t\t\t\t}
\t\t\t\t\tprice = basePrice * qty;
\t\t\t\t\tct = baseCt;
\t\t\t\t\tgoukei = price + ct + optSum;
\t\t\t\t\tbreak;
\t\t\t\t}
\t\t\t\tcase 7: { // 数量買い・基本工事費固定(gf ガーデンファニチャー / st 石材)
\t\t\t\t\tqty = Math.max(1, parseInt(ctx.suuryou) || 1);
\t\t\t\t\tprice = basePrice * qty;
\t\t\t\t\tct = baseCt; // ct は固定(数量に依らない)
\t\t\t\t\tgoukei = price + ct + optSum;
\t\t\t\t\tbreak;
\t\t\t\t}
\t\t\t\tcase 9: { // 商品のみ購入
\t\t\t\t\t// カート側で quantity × unit price するため goukei は単品価格
\t\t\t\t\tqty = parseInt(ctx.quantityOnly) || 1;
\t\t\t\t\tprice = basePrice;
\t\t\t\t\tct = 0;
\t\t\t\t\toptSum = 0;
\t\t\t\t\tgoukei = price;
\t\t\t\t\tbreak;
\t\t\t\t}
\t\t\t\tdefault: { // 1: 通常(カーポート等、matrix 選択のみ)
\t\t\t\t\tqty = 1;
\t\t\t\t\t// cp 折半屋根(スチール折板 = option1, ex-shop同額)を工事費として加算。
\t\t\t\t\t// 非折板/他カテゴリは option1='' or 非数値 → 0。
\t\t\t\t\tsteelRoof = purchaseOnly ? 0 : (parseInt(pp.option1) || 0);
\t\t\t\t\tgoukei = basePrice + baseCt + steelRoof + optSum;
\t\t\t\t\tbreak;
\t\t\t\t}
\t\t\t}
\t\t\t// 出口で税込化(pp.price/pp.ct/op_data.price はすべて税抜で保存されている前提)
\t\t\t// 税込は請求額(mitsumori_json)・見積書・PDF 用。税抜(*Exc)は詳細ページの表示専用。
\t\t\treturn {
\t\t\t\tgoukei: toIncTax(goukei),
\t\t\t\tprice: toIncTax(price),
\t\t\t\tct: toIncTax(ct),
\t\t\t\tsteelRoof: toIncTax(steelRoof),
\t\t\t\topt: toIncTax(optSum),
\t\t\t\tgoukeiExc: goukei,
\t\t\t\tpriceExc: price,
\t\t\t\tctExc: ct,
\t\t\t\tsteelRoofExc: steelRoof,
\t\t\t\toptExc: optSum,
\t\t\t\tqty: qty,
\t\t\t};
\t\t}
\t\t/**
\t\t * 寸法文字列から「メートル単位の数値」を抽出する.
\t\t *
\t\t * 単位は m / cm / mm を認識し、いずれも m 単位に正規化して返す.
\t\t * 単位が無い場合は m 単位とみなす(旧 tf データ \"1m\" \"10m\" との互換).
\t\t * 数値が見つからない場合は 0 を返す(呼び出し側で fallback).
\t\t *
\t\t * 例:
\t\t * \"1m\" → 1
\t\t * \"100cm\" → 1 (2026-06 以降の m → cm 正規化に対応)
\t\t * \"200cm\" → 2
\t\t * \"5.5m\" → 5.5
\t\t * \"1000mm\" → 1
\t\t * \"\" → 0
\t\t */
\t\tfunction parseLen(s) {
\t\t\tif (!s) return 0;
\t\t\tvar str = String(s);
\t\t\tvar m = str.match(/(\\d+(?:\\.\\d+)?)\\s*(mm|cm|m)?/i);
\t\t\tif (!m) return 0;
\t\t\tvar n = parseFloat(m[1]);
\t\t\tif (isNaN(n)) return 0;
\t\t\tvar unit = (m[2] || 'm').toLowerCase();
\t\t\tif (unit === 'cm') return n / 100;
\t\t\tif (unit === 'mm') return n / 1000;
\t\t\treturn n; // 'm' or no unit
\t\t}
\t\t// pp は autoSelectFirstColor 等からも参照するので global にする
\t\tvar pp = {{ pp|raw }};
\t\t// sale_type=2 の幅 / 高さ ladder (Twig p_w / p_h を JS で参照するため).
\t\t// 入力 mm 値を pp の幅・高さバケット文字列にマッピングする際の元データ.
\t\t// p_w / p_h は連想配列で来ることがあるため Object.values で配列化する.
\t\tvar PP_W_LADDER = Object.values({{ p_w|default({})|json_encode|raw }} || {});
\t\tvar PP_H_LADDER = Object.values({{ p_h|default({})|json_encode|raw }} || {});
\t\t/* ============================================================
\t\t sale_type=2 (補助金窓) 専用: 複数タイプ集計 & 補助金計算
\t\t ============================================================
\t\t - 入力 UI: #window-types-container 配下の .window-type-block
\t\t - 補助金根拠: 先進的窓リノベ2026事業
\t\t https://window-renovation2026.env.go.jp/construction/inner-window.html
\t\t - 価格軸: (subtype, w, h, glass, color) で pp を lookup
\t\t - 1 商品 = 1 明細 にまとめ、内訳 JSON を別途保存予定 (cart 連携は後続タスク)
\t\t ============================================================ */
\t\t// 補助金マトリクス: [住宅区分][性能][サイズ区分] → 1 箇所あたり金額 (税抜・端数なし)
\t\tvar WINDOW_SUBSIDY_MATRIX = {
\t\t\tdetached: { // 戸建住宅・延床240㎡以下の非住宅
\t\t\t\tP: { G: 140000, L: 89000, M: 58000, S: 36000 },
\t\t\t\tS: { G: 76000, L: 52000, M: 34000, S: 22000 }
\t\t\t},
\t\t\tapartment: { // 低層・中高層集合住宅・240㎡超の非住宅
\t\t\t\tP: { G: 152000, L: 98000, M: 64000, S: 40000 },
\t\t\t\tS: { G: 83000, L: 57000, M: 37000, S: 24000 }
\t\t\t}
\t\t};
\t\t// 住宅区分: 画面 UI (input[name=\"window_housing_type\"]) から取得する.
\t\t// 既定値は PFC meta_key=\"住宅区分\" を fallback (未設定なら '戸建').
\t\tvar HOUSING_TYPE_DEFAULT = {{ getProduct_field(Product.id, '住宅区分')|default('戸建')|json_encode|raw }};
\t\tfunction getCurrentHousingKey() {
\t\t\tvar el = document.querySelector('input[name=\"window_housing_type\"]:checked');
\t\t\tvar v = el ? el.value : HOUSING_TYPE_DEFAULT;
\t\t\treturn (v === '集合住宅') ? 'apartment' : 'detached';
\t\t}
\t\t// 商品シリーズ自動判定 (Product.name から)
\t\t// 根拠カタログ: YKK AP「ウチリモ」XAAAA-H26-067-1 (2026.04), 同「LiteU」XAAAA-H16-088-2,
\t\t// 三協アルミ「プラメイクEII」0142_STJ1931L, LIXIL「インプラス」(既知)
\t\tvar PRODUCT_NAME_RAW = {{ Product.name|default('')|json_encode|raw }};
\t\tfunction detectProductSeries(name) {
\t\t\tif (!name) return null;
\t\t\tif (/ウチリモ/.test(name)) return 'uchirimo';
\t\t\tif (/プラマード\\s*U/i.test(name)) return 'pramado_u';
\t\t\tif (/インプラス/.test(name)) return 'inplus';
\t\t\tif (/プラメイク\\s*EII|プラメイクEII/i.test(name)) return 'plamake_eii';
\t\t\tif (/LiteU/i.test(name)) return 'lite_u';
\t\t\treturn null;
\t\t}
\t\t// シリーズ上限グレード:
\t\t// 'P' = SS/P まで到達可能 (真空断熱ガラス採用シリーズ)
\t\t// 'S' = Low-E 複層止まり (真空断熱ガラスのラインなし)
\t\t// null = 単板のみ → 補助金対象外
\t\tvar SERIES_GRADE_CAP = {
\t\t\tuchirimo: 'P',
\t\t\tpramado_u: 'P',
\t\t\tinplus: 'S',
\t\t\tplamake_eii: 'S',
\t\t\tlite_u: null
\t\t};
\t\tvar DETECTED_SERIES = detectProductSeries(PRODUCT_NAME_RAW);
\t\tvar SERIES_GRADE_CAP_VAL = (DETECTED_SERIES !== null && Object.prototype.hasOwnProperty.call(SERIES_GRADE_CAP, DETECTED_SERIES))
\t\t\t? SERIES_GRADE_CAP[DETECTED_SERIES]
\t\t\t: undefined;
\t\t// 商品単位グレード上限 (PFC `meta_key=補助金グレード上限` で個別上書き)
\t\t// 値: 'P' / 'SS' / 'S' / '対象外' / '無' / 'NONE' / 空文字 (未指定)
\t\tvar PRODUCT_GRADE_CAP_RAW = {{ getProduct_field(Product.id, '補助金グレード上限')|default('')|json_encode|raw }};
\t\tfunction normalizeGradeCap(v) {
\t\t\tif (v === null || v === undefined || v === '') return undefined;
\t\t\tvar s = String(v).trim().toUpperCase();
\t\t\tif (s === 'NONE' || s === '対象外' || s === '無') return null;
\t\t\tif (s === 'P' || s === 'SS') return 'P';
\t\t\tif (s === 'S') return 'S';
\t\t\treturn undefined;
\t\t}
\t\tvar PRODUCT_GRADE_CAP = normalizeGradeCap(PRODUCT_GRADE_CAP_RAW);
\t\t// 窓種 (subtype = option1) ごとのグレード上限.
\t\t// 根拠: YKK AP「ウチリモ」業務用 (XAAAA-H26-067-1) の窓種別ラインナップで
\t\t// 真空ガラス (Glavenir) の設定有無を確認:
\t\t// 引違い窓 (2/3/4枚建) / 浴室仕様 引違い窓 / FIX窓 → P 到達可能
\t\t// 内開き窓 (居室/浴室) / 開き窓テラス / テラスドア類 → 真空ガラスなし → S 止まり
\t\tfunction detectSubtypeGradeCap(subtype) {
\t\t\tif (!subtype) return undefined;
\t\t\tvar s = String(subtype);
\t\t\tif (/内開|開き窓テラス|テラスドア|開き戸/.test(s)) return 'S';
\t\t\treturn undefined;
\t\t}
\t\t// クリップ: 強さは 'P' > 'S' > null (対象外). cap=null は強制対象外, cap=undefined は無効化なし.
\t\tfunction clipGradeBy(grade, cap) {
\t\t\tif (cap === undefined) return grade;
\t\t\tif (cap === null) return null;
\t\t\tif (grade === null) return null;
\t\t\tif (cap === 'S' && grade === 'P') return 'S';
\t\t\treturn grade;
\t\t}
\t\t// D-2/D-3: 一部の窓種は Low-E に「アルゴンガス入り」が必須で、ガス無は補助対象外.
\t\t// - 浴室仕様 (ウチリモ): Low-E は Ar入のみ S、Ar無は対象外
\t\t// - インプラス 開き窓 / テラスドア: Low-E複層 ガス有のみ S、ガス無は対象外
\t\t// ※ 引違い窓・FIX窓・(非浴室)内開き窓は従来どおり Ar 有無を問わない.
\t\t// server 側 WindowSubsidyCalculator の subtypeRequiresArgon / glassHasArgon /
\t\t// applyArgonRequirement と完全一致させること.
\t\tfunction subtypeRequiresArgon(series, subtype) {
\t\t\tvar s = String(subtype || '');
\t\t\tif (/浴室/.test(s)) return true;
\t\t\tif (series === 'inplus' && (/テラスドア/.test(s) || (/開き窓/.test(s) && !/内開き/.test(s)))) return true;
\t\t\treturn false;
\t\t}
\t\tfunction glassHasArgon(glassName) {
\t\t\treturn /アルゴンガス入り/.test(String(glassName || ''));
\t\t}
\t\tfunction applyArgonRequirement(grade, glassName, subtype) {
\t\t\tif (grade === null) return null;
\t\t\t// 真空(P)等 Low-E 以外はこの規則の対象外 (真空はガス不要).
\t\t\tif (!/Low-?E/i.test(String(glassName || ''))) return grade;
\t\t\tif (subtypeRequiresArgon(DETECTED_SERIES, subtype) && !glassHasArgon(glassName)) return null;
\t\t\treturn grade;
\t\t}
\t\tfunction finalizeGlassGrade(raw, subtype, glassName) {
\t\t\tvar g = clipGradeBy(raw, SERIES_GRADE_CAP_VAL);
\t\t\tg = clipGradeBy(g, detectSubtypeGradeCap(subtype));
\t\t\tg = clipGradeBy(g, PRODUCT_GRADE_CAP);
\t\t\tg = applyArgonRequirement(g, glassName, subtype);
\t\t\treturn g;
\t\t}
\t\t/**
\t\t * ガラスタイプ名から性能区分 'P' (SS, Uw≤1.1) / 'S' (Uw≤1.5) / null を判別.
\t\t * null = 補助対象外.
\t\t *
\t\t * 根拠: YKK AP「ウチリモ 内窓」業務用カタログ (XAAAA-H26-069-1) で
\t\t * P (SS) は真空断熱ガラスのみ、Low-E はアルゴン入りでも S 止まり、
\t\t * Low-E ガス無 + 型ガラス / フロストは 2026年4月で対象外、
\t\t * が確認できた。アルゴン入り Low-E を P 判定する旧ルールは誤りだった。
\t\t *
\t\t * シリーズによっては P がそもそも存在しない (LIXIL インプラスは S 一律)
\t\t * ため、最終的には PFC で商品単位の上限を上書きできる仕組みが必要。
\t\t */
\t\tfunction detectGlassPerformance(glassName) {
\t\t\tif (!glassName) return null;
\t\t\tvar n = String(glassName);
\t\t\t// 補助対象外: 単板 / 和紙調 / 防音 / 防犯 / 型ガラス・フロスト (Low-E ガス無の型は 2026/4 で対象外)
\t\t\tif (/単ガラス|単板|和紙調|防音|防犯|複層\\/型|型ガラス|フロスト/.test(n)) return null;
\t\t\t// P (SS): 真空断熱ガラスのみ
\t\t\tif (/真空断熱/.test(n)) return 'P';
\t\t\t// S: Low-E 系のみ (アルゴン入りでも S 止まり)
\t\t\tif (/Low-?E/i.test(n)) return 'S';
\t\t\t// 一般複層 / ブラインドイン複層 / 複層強化 など Low-E 無しの複層は補助対象外
\t\t\treturn null;
\t\t}
\t\t/**
\t\t * 幅 mm × 高さ mm からサイズ区分 'G' (≥4.0㎡) / 'L' (2.8-3.9) / 'M' (1.6-2.7) / 'S' (0.2-1.5) / null.
\t\t * null = 補助対象外 (0.2㎡ 未満).
\t\t */
\t\tfunction detectSizeClass(w_mm, h_mm) {
\t\t\tvar w = parseFloat(w_mm) || 0;
\t\t\tvar h = parseFloat(h_mm) || 0;
\t\t\tif (w <= 0 || h <= 0) return null;
\t\t\tvar area = (w * h) / 1000000.0;
\t\t\tif (area < 0.2) return null;
\t\t\tif (area < 1.6) return 'S';
\t\t\tif (area < 2.8) return 'M';
\t\t\tif (area < 4.0) return 'L';
\t\t\treturn 'G';
\t\t}
\t\tfunction lookupSubsidyAmount(performance, sizeClass) {
\t\t\tif (!performance || !sizeClass) return 0;
\t\t\tvar t = WINDOW_SUBSIDY_MATRIX[getCurrentHousingKey()];
\t\t\tif (!t || !t[performance]) return 0;
\t\t\treturn t[performance][sizeClass] || 0;
\t\t}
\t\t/**
\t\t * mm 入力値を ladder バケット文字列に変換する.
\t\t * bucketizeMm(1750, [\"100cm まで\",\"150cm まで\",\"200cm まで\",\"300cm まで\"]) → \"200cm まで\"
\t\t * - 入力が空 or 0 のときはそのまま返す (未入力扱い)
\t\t * - 入力がラダー最大を超えるときは最大バケットを返す (= 価格上限の保護)
\t\t * - 入力文字列が既にラダーラベルそのものなら無変換 (互換のため)
\t\t */
\t\tfunction bucketizeMm(input, ladder) {
\t\t\tif (!input && input !== 0) return '';
\t\t\tif (!ladder || ladder.length === 0) return input;
\t\t\tvar s = String(input).trim();
\t\t\tif (s === '') return '';
\t\t\tif (ladder.indexOf(s) >= 0) return s;
\t\t\tvar mm = parseMm(s);
\t\t\tif (mm <= 0) return s;
\t\t\tvar withMax = ladder.map(function(b) { return { label: b, max: parseMm(b) }; });
\t\t\twithMax.sort(function(a, b) { return a.max - b.max; });
\t\t\tfor (var i = 0; i < withMax.length; i++) {
\t\t\t\tif (mm <= withMax[i].max) return withMax[i].label;
\t\t\t}
\t\t\treturn withMax[withMax.length - 1].label;
\t\t}
\t\t/**
\t\t * pp 配列から該当 1 行を返す. 完全一致優先、見つからなければ最初の候補.
\t\t * 軸: subtype (option1) / w / h / m / c. axisMatch は既存ロジックと同じ.
\t\t * sale_type=2 では pw_val / ph_val に mm 数値が来るため、内部で bucketizeMm
\t\t * を通してから既存マッチングに渡す.
\t\t */
\t\tfunction lookupPpRow(subtype, pw_val, ph_val, pm_val, pc_val) {
\t\t\tif (!pp || pp.length === 0) return null;
\t\t\tvar pw_bucket = bucketizeMm(pw_val, PP_W_LADDER);
\t\t\tvar ph_bucket = bucketizeMm(ph_val, PP_H_LADDER);
\t\t\tvar axMatch = function(input, value) {
\t\t\t\treturn input == value || input === '指定なし' || value === '' || value == null;
\t\t\t};
\t\t\tvar colMatch = function(input, value) {
\t\t\t\tif (axMatch(input, value)) return true;
\t\t\t\tif (typeof value === 'string' && value.indexOf('/') !== -1 && input) {
\t\t\t\t\treturn value.split('/').some(function(s) { return s.trim() === input; });
\t\t\t\t}
\t\t\t\treturn false;
\t\t\t};
\t\t\tvar candidates = pp.filter(function(el) {
\t\t\t\treturn axMatch(pw_bucket, el.w)
\t\t\t\t\t&& axMatch(ph_bucket, el.h)
\t\t\t\t\t&& axMatch(pm_val, el.m)
\t\t\t\t\t&& axMatch(subtype, el.option1);
\t\t\t});
\t\t\tfor (var i = 0; i < candidates.length; i++) {
\t\t\t\tif (colMatch(pc_val, candidates[i].c)) return candidates[i];
\t\t\t}
\t\t\treturn candidates[0] || null;
\t\t}
\t\t/**
\t\t * \"1000mm\" / \"200cm\" / \"1.0m\" / 単位なし → mm に正規化して返す.
\t\t * UI 上の「200cm まで」等の文字列をそのまま渡せるようにする.
\t\t */
\t\tfunction parseMm(s) {
\t\t\tif (!s) return 0;
\t\t\tvar str = String(s);
\t\t\tvar m = str.match(/(\\d+(?:\\.\\d+)?)/);
\t\t\tif (!m) return 0;
\t\t\tvar num = parseFloat(m[1]);
\t\t\tif (/mm/i.test(str)) return num;
\t\t\tif (/cm/i.test(str)) return num * 10;
\t\t\tif (/(^|\\d)\\s*m(\$|\\W)/i.test(str)) return num * 1000;
\t\t\treturn num;
\t\t}
\t\t/**
\t\t * 1 タイプブロックから入力を読み、pp lookup → 単価・補助金額を計算して返す.
\t\t * incomplete=true: 軸のどれかが未選択 → 計算しない (UI で「未選択」を示すため).
\t\t */
\t\tfunction collectWindowTypeRow(block) {
\t\t\tvar get = function(axis) {
\t\t\t\t// radio / checkbox は :checked、それ以外 (number/text) は値そのまま.
\t\t\t\tvar radio = block.querySelector('input[data-axis=\"' + axis + '\"]:checked');
\t\t\t\tif (radio) return radio.value;
\t\t\t\tvar any = block.querySelector('input[data-axis=\"' + axis + '\"]');
\t\t\t\tif (!any) return '';
\t\t\t\tif (any.type === 'radio' || any.type === 'checkbox') return '';
\t\t\t\treturn (any.value || '').trim();
\t\t\t};
\t\t\tvar setqtyEl = block.querySelector('input[data-axis=\"setqty\"]');
\t\t\tvar subtype = get('subtype');
\t\t\tvar pw_val = get('pw');
\t\t\tvar ph_val = get('ph');
\t\t\tvar pm_val = get('pm');
\t\t\tvar pc_val = get('pc');
\t\t\tvar setqty = setqtyEl ? Math.max(1, parseInt(setqtyEl.value) || 1) : 1;
\t\t\tvar row = {
\t\t\t\tsubtype: subtype, pw: pw_val, ph: ph_val, pm: pm_val, pc: pc_val, setqty: setqty,
\t\t\t\tunit_price_exc: 0, unit_ct_exc: 0, subsidy: 0,
\t\t\t\tsize_class: null, glass_perf: null,
\t\t\t\tincomplete: false
\t\t\t};
\t\t\t// p_option1 / p_w / p_h / p_m / color のいずれかが商品データに無いときは未選択でも完了扱いにする.
\t\t\t// (例: 商品によっては subtype が無い場合がある)
\t\t\tvar hasSubtype = !!block.querySelector('input[data-axis=\"subtype\"]');
\t\t\tvar hasPw = !!block.querySelector('input[data-axis=\"pw\"]');
\t\t\tvar hasPh = !!block.querySelector('input[data-axis=\"ph\"]');
\t\t\tvar hasPm = !!block.querySelector('input[data-axis=\"pm\"]');
\t\t\tvar hasPc = !!block.querySelector('input[data-axis=\"pc\"]');
\t\t\tif ((hasSubtype && !subtype) || (hasPw && !pw_val) || (hasPh && !ph_val)
\t\t\t || (hasPm && !pm_val) || (hasPc && !pc_val)) {
\t\t\t\trow.incomplete = true;
\t\t\t\treturn row;
\t\t\t}
\t\t\tvar ppRow = lookupPpRow(subtype, pw_val, ph_val, pm_val, pc_val);
\t\t\tif (ppRow) {
\t\t\t\trow.unit_price_exc = parseInt(ppRow.price) || 0;
\t\t\t\trow.unit_ct_exc = parseInt(ppRow.ct) || 0;
\t\t\t}
\t\t\t// ガラス名検出 → シリーズ上限 → subtype 上限 → 商品上限 の順で min クリップ.
\t\t\t// 例: LiteU (SERIES_GRADE_CAP_VAL=null) は Low-E でも null に落ちて補助対象外.
\t\t\t// 例: ウチリモの「内開き窓」subtype は真空ガラスでも S に落ちる.
\t\t\trow.glass_perf = finalizeGlassGrade(detectGlassPerformance(pm_val), subtype, pm_val);
\t\t\trow.size_class = detectSizeClass(parseMm(pw_val), parseMm(ph_val));
\t\t\trow.subsidy = lookupSubsidyAmount(row.glass_perf, row.size_class);
\t\t\treturn row;
\t\t}
\t\t/**
\t\t * sale_type=2 用集計: 全タイプから合計を出し DOM 更新.
\t\t * 計算式 (税抜→税込で出口で 1.10 倍):
\t\t * 商品金額 = Σ(各タイプ単価 × set_qty)
\t\t * 基本工事費 = 1 回分 (各タイプ pp.ct のうち最初に得た非ゼロ値)
\t\t * 補助金合計 = Σ(各タイプ補助金 × set_qty)
\t\t * 実質支払額 = (商品+ct+option) 税込 - 補助金合計
\t\t */
\t\tfunction recalcAllForSaleType2() {
\t\t\tif (typeof SALE_TYPE_ID === 'undefined' || SALE_TYPE_ID != 2) return;
\t\t\tif (!pp || pp.length === 0) {
\t\t\t\t\$('#mitsumori_message').text('価格データ準備中');
\t\t\t\t\$('#mitsumori_btn').hide();
\t\t\t\t['#mitsumori_goukei','#mitsumori_off','#mitsumori_price','#maker_price',
\t\t\t\t '#mitsumori_ct','#mitsumori_option','#mitsumori_kei','#mitsumori_shoukei','#mitsumori_tax']
\t\t\t\t .forEach(function(s){ \$(s).text('---円'); });
\t\t\t\treturn;
\t\t\t}
\t\t\tvar blocks = document.querySelectorAll('#window-types-container .window-type-block');
\t\t\tif (blocks.length === 0) return;
\t\t\tvar rows = [];
\t\t\tvar hasIncomplete = false;
\t\t\tvar baseCt = 0;
\t\t\tvar hasAnyPriced = false;
\t\t\tblocks.forEach(function(b) {
\t\t\t\tvar r = collectWindowTypeRow(b);
\t\t\t\trows.push({ block: b, row: r });
\t\t\t\tif (r.incomplete) hasIncomplete = true;
\t\t\t\tif (r.unit_ct_exc > 0 && baseCt === 0) baseCt = r.unit_ct_exc;
\t\t\t\tif (r.unit_price_exc > 0) hasAnyPriced = true;
\t\t\t\tvar subSpan = b.querySelector('.wt-subsidy-amount');
\t\t\t\tif (subSpan) subSpan.textContent = r.incomplete ? '―' : Math.round(r.subsidy * r.setqty).toLocaleString();
\t\t\t});
\t\t\tif (hasIncomplete || !hasAnyPriced) {
\t\t\t\t\$('#mitsumori_message').text('窓タイプを選択してください');
\t\t\t\t\$('#mitsumori_btn').hide();
\t\t\t\treturn;
\t\t\t}
\t\t\tvar ops = [op0,op1,op2,op3,op4,op5,op6,op7,op8,op9,op10];
\t\t\tvar purchaseOnly = ops.some(function(v){ return v === '商品購入のみ'; });
\t\t\tvar sumPriceExc = 0, sumSubsidy = 0, totalPanes = 0;
\t\t\trows.forEach(function(item) {
\t\t\t\tvar r = item.row;
\t\t\t\tsumPriceExc += r.unit_price_exc * r.setqty;
\t\t\t\tsumSubsidy += r.subsidy * r.setqty;
\t\t\t\tif (r.unit_price_exc > 0) totalPanes += r.setqty;
\t\t\t});
\t\t\t// 内窓 工事費(顧客最終回答): 1枚目 22,000円 + 2枚目以降 1枚あたり +5,000円(税込表示額)。
\t\t\t// 既存パイプライン整合のため税抜(ctExc)も用意(税行 taxAmt 用)。商品購入のみは 0。
\t\t\tvar WINDOW_CT_BASE = 22000, WINDOW_CT_ADD = 5000;
\t\t\tvar ctIncTarget = purchaseOnly ? 0 : (WINDOW_CT_BASE + Math.max(0, totalPanes - 1) * WINDOW_CT_ADD);
\t\t\tvar ctExc = purchaseOnly ? 0 : Math.round(ctIncTarget / (1 + TAX_RATE));
\t\t\tvar optExc = purchaseOnly ? 0 : (collectOptions().total || 0);
\t\t\tvar sumPriceInc = Math.round(sumPriceExc * (1 + TAX_RATE));
\t\t\tvar ctInc = ctIncTarget;
\t\t\tvar optInc = Math.round(optExc * (1 + TAX_RATE));
\t\t\tvar goukeiInc = sumPriceInc + ctInc + optInc;
\t\t\t// 窓リノベ2026 申請条件:
\t\t\t// - 補助金合計 ≥ 50,000 円 (5 万円未満は申請不可 → 還元 0 円扱い)
\t\t\t// - 1 戸あたり上限 1,000,000 円 (住宅・非住宅240㎡以下)
\t\t\t// ※ 非住宅 240㎡超の 10,000,000 円上限は対象外 (商品設計時に別扱い想定)
\t\t\tvar SUBSIDY_MIN_AMOUNT = 50000;
\t\t\tvar SUBSIDY_MAX_PER_UNIT = 1000000;
\t\t\tvar subsidyRawSum = sumSubsidy;
\t\t\tvar subsidyEligible = subsidyRawSum >= SUBSIDY_MIN_AMOUNT;
\t\t\tvar subsidyAmt = 0;
\t\t\tvar subsidyNote = '';
\t\t\tif (subsidyEligible) {
\t\t\t\tif (subsidyRawSum > SUBSIDY_MAX_PER_UNIT) {
\t\t\t\t\tsubsidyAmt = SUBSIDY_MAX_PER_UNIT;
\t\t\t\t\tsubsidyNote = '※補助上限 ' + SUBSIDY_MAX_PER_UNIT.toLocaleString()
\t\t\t\t\t\t+ '円 超過分は控除対象外(補助金合計 ' + subsidyRawSum.toLocaleString() + '円)';
\t\t\t\t} else {
\t\t\t\t\tsubsidyAmt = subsidyRawSum;
\t\t\t\t\tsubsidyNote = '※補助金合計 ' + subsidyRawSum.toLocaleString()
\t\t\t\t\t\t+ '円(5万円以上)が適用されます';
\t\t\t\t}
\t\t\t} else if (subsidyRawSum > 0) {
\t\t\t\t// (b) per-window 補助金額は常時表示。合計5万円以上で適用される旨と
\t\t\t\t// あといくらで適用かを明示する(閾値 SUBSIDY_MIN_AMOUNT は据え置き)。
\t\t\t\tvar subsidyShort = SUBSIDY_MIN_AMOUNT - subsidyRawSum;
\t\t\t\tsubsidyNote = '※補助金は各窓の補助金額の合計が5万円以上で適用されます'
\t\t\t\t\t+ '(現在の合計 ' + subsidyRawSum.toLocaleString() + '円 / あと '
\t\t\t\t\t+ subsidyShort.toLocaleString() + '円で適用)';
\t\t\t} else if (SERIES_GRADE_CAP_VAL === null) {
\t\t\t\t// LiteU 等の単板構成シリーズ: グレード判定で必ず null になる
\t\t\t\tsubsidyNote = '※本商品は補助金(先進的窓リノベ2026事業)対象外です';
\t\t\t} else if (PRODUCT_GRADE_CAP === null) {
\t\t\t\tsubsidyNote = '※本商品は補助金対象外として登録されています';
\t\t\t}
\t\t\tvar implementedInc = Math.max(0, goukeiInc - subsidyAmt);
\t\t\tvar taxAmt = Math.round((sumPriceExc + ctExc + optExc) * TAX_RATE);
\t\t\t// 詳細ページの見積カード/ヘッダー/SPバーは税抜表示に統一.
\t\t\t// 見積書(#mitsumori_kei)・実質支払額(#mitsumori_shoukei)・税額・json は税込のまま (請求額不変).
\t\t\tvar goukeiExc = sumPriceExc + ctExc + optExc;
\t\t\t\$('#mitsumori_message').text(subsidyNote);
\t\t\t\$('#mitsumori_btn').show();
\t\t\t\$('#mitsumori_goukei').text(goukeiExc.toLocaleString() + '円');
\t\t\t\$('#mitsumori_price').text(sumPriceExc.toLocaleString() + '円');
\t\t\t\$('#mitsumori_ct').text(ctExc.toLocaleString() + '円');
\t\t\t\$('#mitsumori_option').text(optExc.toLocaleString() + '円');
\t\t\t\$('#mitsumori_off').text((subsidyAmt > 0 ? '-' : '') + subsidyAmt.toLocaleString() + '円');
\t\t\t\$('#maker_price').text('---円'); // 補助金窓では未使用
\t\t\t\$('#mitsumori_kei').text(goukeiInc.toLocaleString() + '円');
\t\t\t\$('#mitsumori_shoukei').text(implementedInc.toLocaleString() + '円');
\t\t\t\$('#mitsumori_tax').text(taxAmt.toLocaleString() + '円');
\t\t\t// 内訳を mitsumori_json に詰めて hidden input にセット (PDF / カート連携用)
\t\t\tvar window_types = rows.map(function(item) {
\t\t\t\tvar r = item.row;
\t\t\t\t// 幅 / 高さは数値入力 (mm) が来るので \"1750mm\" 形式で保存する.
\t\t\t\t// 古い radio 由来の \"200cm まで\" 形式が来た場合はそのまま保存して互換.
\t\t\t\tvar w_mm = parseMm(r.pw);
\t\t\t\tvar h_mm = parseMm(r.ph);
\t\t\t\tvar w_save = (w_mm > 0 && /^\\s*\\d+(?:\\.\\d+)?\\s*\$/.test(String(r.pw))) ? (w_mm + 'mm') : r.pw;
\t\t\t\tvar h_save = (h_mm > 0 && /^\\s*\\d+(?:\\.\\d+)?\\s*\$/.test(String(r.ph))) ? (h_mm + 'mm') : r.ph;
\t\t\t\treturn {
\t\t\t\t\tsubtype: r.subtype,
\t\t\t\t\tw: w_save,
\t\t\t\t\th: h_save,
\t\t\t\t\tglass: r.pm,
\t\t\t\t\tcolor: r.pc,
\t\t\t\t\tsetqty: r.setqty,
\t\t\t\t\tunit_price_inc: Math.round(r.unit_price_exc * (1 + TAX_RATE)),
\t\t\t\t\tline_total_inc: Math.round(r.unit_price_exc * r.setqty * (1 + TAX_RATE)),
\t\t\t\t\tsize_class: r.size_class,
\t\t\t\t\tglass_perf: r.glass_perf,
\t\t\t\t\tsubsidy_unit: r.subsidy,
\t\t\t\t\tsubsidy_total: r.subsidy * r.setqty
\t\t\t\t};
\t\t\t});
\t\t\tvar opCalc2 = collectOptions();
\t\t\tvar mitsumori_json = {
\t\t\t\t\"mitsumori_goukei\": goukeiInc.toLocaleString() + '円',
\t\t\t\t\"mitsumori_price\": sumPriceInc.toLocaleString() + '円',
\t\t\t\t\"mitsumori_ct\": ctInc.toLocaleString() + '円',
\t\t\t\t\"mitsumori_option\": optInc.toLocaleString() + '円',
\t\t\t\t\"mitsumori_off\": (subsidyAmt > 0 ? '-' : '') + subsidyAmt.toLocaleString() + '円',
\t\t\t\t\"maker_price\": '---円',
\t\t\t\t\"product_id\": {{ Product.id }},
\t\t\t\t\"sale_type\": SALE_TYPE_ID,
\t\t\t\t\"housing_key\": getCurrentHousingKey(),
\t\t\t\t\"series_key\": DETECTED_SERIES,
\t\t\t\t\"series_grade_cap\": (SERIES_GRADE_CAP_VAL === undefined) ? null : SERIES_GRADE_CAP_VAL,
\t\t\t\t\"product_grade_cap\":(PRODUCT_GRADE_CAP === undefined) ? null : PRODUCT_GRADE_CAP,
\t\t\t\t\"window_types\": window_types,
\t\t\t\t\"subsidy_total\": subsidyAmt,
\t\t\t\t\"subsidy_raw\": subsidyRawSum,
\t\t\t\t\"subsidy_eligible\": subsidyEligible,
\t\t\t\t\"subsidy_note\": subsidyNote,
\t\t\t\t\"op_items\": opCalc2.items
\t\t\t};
\t\t\t\$('#mitsumori_json').val(JSON.stringify(mitsumori_json));
\t\t\trenderWindowTypesModalRows(window_types, subsidyAmt);
\t\t}
\t\t/**
\t\t * sale_type=2 用: 見積モーダル明細テーブルを window_types で動的展開.
\t\t * - 既存の商品名行 (1 行目) は hide() し、各タイプ行を上に挿入
\t\t * - 基本工事費行はそのまま (#mitsumori_ct_01 / _02 が更新されている)
\t\t * - 補助金 (割引額) 行を末尾に追加
\t\t * - 既存の renderOptionDetailRows と共存できるよう class で区別
\t\t */
\t\tfunction renderWindowTypesModalRows(window_types, subsidyAmt) {
\t\t\tvar \$tbody = \$('.modal-mitsumori table tbody');
\t\t\tif (!\$tbody.length) return;
\t\t\t// 既存の動的行を全削除 (opt-row は既存実装、wt-row / wt-subsidy-row は今回追加)
\t\t\t\$tbody.find('tr.wt-row, tr.wt-subsidy-row').remove();
\t\t\tvar \$itemRow = \$tbody.find('tr').first();
\t\t\tvar fmt = new Intl.NumberFormat('ja-JP');
\t\t\tif (!window_types || window_types.length === 0) {
\t\t\t\t// 集計対象なし → 商品名行を表示に戻す
\t\t\t\t\$itemRow.show();
\t\t\t\treturn;
\t\t\t}
\t\t\twindow_types.forEach(function(wt, i) {
\t\t\t\tvar label = '窓タイプ' + (i + 1) + ':'
\t\t\t\t\t+ (wt.subtype || '') + ' / '
\t\t\t\t\t+ (wt.w || '') + '×' + (wt.h || '') + ' / '
\t\t\t\t\t+ (wt.glass || '') + ' / '
\t\t\t\t\t+ (wt.color || '');
\t\t\t\tvar \$tr = \$('<tr class=\"wt-row\"></tr>')
\t\t\t\t\t.append('<td>' + label + '</td>')
\t\t\t\t\t.append('<td>' + wt.setqty + '</td>')
\t\t\t\t\t.append('<td>セット</td>')
\t\t\t\t\t.append('<td>' + fmt.format(wt.unit_price_inc) + '円</td>')
\t\t\t\t\t.append('<td>' + fmt.format(wt.line_total_inc) + '円</td>');
\t\t\t\t\$itemRow.before(\$tr);
\t\t\t});
\t\t\t// 元の商品名行は複数タイプに置換されたので非表示
\t\t\t\$itemRow.hide();
\t\t\t// 補助金(割引額)行を末尾に追加
\t\t\tif (subsidyAmt > 0) {
\t\t\t\tvar \$subRow = \$('<tr class=\"wt-subsidy-row\"></tr>')
\t\t\t\t\t.append('<td>補助金(割引額)</td>')
\t\t\t\t\t.append('<td>1</td>')
\t\t\t\t\t.append('<td>式</td>')
\t\t\t\t\t.append('<td>-' + fmt.format(subsidyAmt) + '円</td>')
\t\t\t\t\t.append('<td>-' + fmt.format(subsidyAmt) + '円</td>');
\t\t\t\t\$tbody.append(\$subRow);
\t\t\t}
\t\t}
\t\t// 公開: onWindowTypeAxisChange (UI 骨格 task 1) からも呼ばれる
\t\twindow.recalcAll = recalcAllForSaleType2;
\t\t// 公開: ガラス選択肢が補助金対象か (窓タイプブロック生成時のバッジ判定に使う).
\t\t// subtype は P→S に落とすことはあっても null にはしないため、性能区分の
\t\t// 対象/対象外は subtype に依存しない。ここでは series/product 上限のみ適用し、
\t\t// finalizeGlassGrade が null でなければ「補助金対象ガラス」と判定する。
\t\twindow.glassYieldsSubsidy = function(glassName) {
\t\t\tif (!glassName) return false;
\t\t\treturn finalizeGlassGrade(detectGlassPerformance(glassName), '', glassName) !== null;
\t\t};
\t\tfunction mitsumori_simulation(type , value_id){
\t\t\t// sale_type=2 (補助金窓) は複数タイプ集計 UI に統合済み. 既存 mitsumori_simulation は使わない.
\t\t\tif (typeof SALE_TYPE_ID !== 'undefined' && SALE_TYPE_ID == 2) {
\t\t\t\t// type/value_id が op\\d+ (施工オプション) の場合はグローバル変数を先に更新
\t\t\t\tif (type && /^op\\d+\$/.test(type) && value_id) {
\t\t\t\t\tvar v = \$('#'+value_id).val();
\t\t\t\t\tif (type === 'op0') op0 = v;
\t\t\t\t\tif (type === 'op1') op1 = v;
\t\t\t\t\tif (type === 'op2') op2 = v;
\t\t\t\t\tif (type === 'op3') op3 = v;
\t\t\t\t\tif (type === 'op4') op4 = v;
\t\t\t\t\tif (type === 'op5') op5 = v;
\t\t\t\t\tif (type === 'op6') op6 = v;
\t\t\t\t\tif (type === 'op7') op7 = v;
\t\t\t\t\tif (type === 'op8') op8 = v;
\t\t\t\t\tif (type === 'op9') op9 = v;
\t\t\t\t\tif (type === 'op10') op10 = v;
\t\t\t\t}
\t\t\t\trecalcAllForSaleType2();
\t\t\t\treturn;
\t\t\t}
\t\t\t// 価格データ未登録 (pp 行 0 件) の商品は axis 入力に依存せず
\t\t\t// 「価格データ準備中」を表示して終了する.
\t\t\t// (例: scrape 未対象の新規商品 — um のウチリモ 7487/7488 等)
\t\t\tif (!pp || pp.length === 0) {
\t\t\t\t\$('#mitsumori_message').text(\"価格データ準備中\");
\t\t\t\t\$('#mitsumori_btn').hide();
\t\t\t\t\$('#mitsumori_goukei').text(\"---円\");
\t\t\t\t\$('#mitsumori_off').text(\"---円\");
\t\t\t\t\$('#mitsumori_price').text(\"---円\");
\t\t\t\t\$('#maker_price').text(\"---円\");
\t\t\t\t\$('#mitsumori_ct').text(\"---円\");
\t\t\t\t\$('#mitsumori_steelroof_row').hide();
\t\t\t\t\$('#mitsumori_option').text(\"---円\");
\t\t\t\t\$('#mitsumori_kei').text(\"---円\");
\t\t\t\t\$('#mitsumori_shoukei').text(\"---円\");
\t\t\t\t\$('#mitsumori_tax').text(\"---円\");
\t\t\t\treturn;
\t\t\t}
\t\t\tif(type == \"pw\"){
\t\t\t\tpw = \$('#'+value_id).val();
\t\t\t}
\t\t\tif(type == \"pd\"){
\t\t\t\tpd = \$('#'+value_id).val();
\t\t\t}
\t\t\tif(type == \"ph\"){
\t\t\t\tph = \$('#'+value_id).val();
\t\t\t}
\t\t\tif(type == \"pm\"){
\t\t\t\tpm = \$('#'+value_id).val();
\t\t\t}
\t\t\tif(type == \"pc\"){
\t\t\t\tpc = \$('#'+value_id).val();
\t\t\t}
\t\t\tif(type == \"option1\"){
\t\t\t\toption1 = \$('#'+value_id).val();
\t\t\t}
\t\t\tif(type == \"option2\"){
\t\t\t\toption2 = \$('#'+value_id).val();
\t\t\t}
\t\t\tif(type == \"op0\"){ op0 = \$('#'+value_id).val(); }
\t\t\tif(type == \"op1\"){ op1 = \$('#'+value_id).val(); }
\t\t\tif(type == \"op2\"){ op2 = \$('#'+value_id).val(); }
\t\t\tif(type == \"op3\"){ op3 = \$('#'+value_id).val(); }
\t\t\tif(type == \"op4\"){ op4 = \$('#'+value_id).val(); }
\t\t\tif(type == \"op5\"){ op5 = \$('#'+value_id).val(); }
\t\t\tif(type == \"op6\"){ op6 = \$('#'+value_id).val(); }
\t\t\tif(type == \"op7\"){ op7 = \$('#'+value_id).val(); }
\t\t\tif(type == \"op8\"){ op8 = \$('#'+value_id).val(); }
\t\t\tif(type == \"op9\"){ op9 = \$('#'+value_id).val(); }
\t\t\tif(type == \"op10\"){ op10 = \$('#'+value_id).val(); }
\t\t\t// op0 が「商品購入のみ」のとき、他のオプション (op1..op10) を disable 化.
\t\t\t// 価格計算側 (calcGoukei の purchaseOnly 分岐) は既にゼロ化しているが、
\t\t\t// UI で選択可能に見えるとユーザーが混乱するため radio を完全に無効化する.
\t\t\t(function applyPurchaseOnlyUI() {
\t\t\t\tvar isPurchaseOnly = (op0 === '商品購入のみ');
\t\t\t\tfor (var k = 1; k <= 10; k++) {
\t\t\t\t\tvar \$inputs = \$('input[name=\"op' + k + '\"]');
\t\t\t\t\tif (\$inputs.length === 0) continue;
\t\t\t\t\t\$inputs.prop('disabled', isPurchaseOnly);
\t\t\t\t\tvar \$group = \$inputs.first().closest('.form-group');
\t\t\t\t\t\$group.css({
\t\t\t\t\t\t'opacity': isPurchaseOnly ? '0.4' : '1',
\t\t\t\t\t\t'pointer-events': isPurchaseOnly ? 'none' : 'auto'
\t\t\t\t\t});
\t\t\t\t}
\t\t\t})();
\t\t\t// 全 type 共通: 該当 radio を checked にし、ボタンの is-selected を付け替え + ラベル更新.
\t\t\t// value_id が指定されていて、対応する DOM 要素が opt-btn 配下にあれば適用する.
\t\t\t// (icheck-danger 形式から opt-btn 形式に統一した際、option1/option2/pw/pd/ph/pm/pc 等の
\t\t\t// クリックで is-selected が更新されない不具合があったため、op\\d+ 限定の処理を一般化)
\t\t\tif (value_id) {
\t\t\t\tvar \$clicked = \$('#' + value_id);
\t\t\t\tif (\$clicked.length && \$clicked.closest('.opt-btn').length) {
\t\t\t\t\t\$clicked.prop('checked', true);
\t\t\t\t\tvar groupName = \$clicked.attr('name');
\t\t\t\t\t\$('input[name=\"' + groupName + '\"]').closest('.opt-btn').removeClass('is-selected');
\t\t\t\t\t\$clicked.closest('.opt-btn').addClass('is-selected');
\t\t\t\t\tvar \$group = \$clicked.closest('.form-group');
\t\t\t\t\tvar \$label = \$group.find('.rp-section-label');
\t\t\t\t\tif (\$label.length) {
\t\t\t\t\t\tvar labelText = \$label.text().split(':')[0].trim();
\t\t\t\t\t\t\$label.html(labelText + ': <span>' + \$clicked.val() + '</span>');
\t\t\t\t\t}
\t\t\t\t\t// op_data の price=0 & 解体/撤去/設置場所 オプションの場合、ON 選択時に「現場調査後に正式お見積もり」文言を表示.
\t\t\t\t\t// (twig 側で is_removal_unknown ブロックを描画済み。display 切替のみ JS で行う)
\t\t\t\t\tif (/^op\\d+\$/.test(type)) {
\t\t\t\t\t\tvar opIdx = type.replace('op', '');
\t\t\t\t\t\tvar opEntry = op_data[parseInt(opIdx)];
\t\t\t\t\t\tif (opEntry) {
\t\t\t\t\t\t\tvar \$note = \$group.find('.opt-survey-note[data-op-idx=\"' + opIdx + '\"]');
\t\t\t\t\t\t\tif (\$note.length) {
\t\t\t\t\t\t\t\tvar isOn = (\$clicked.val() === opEntry.on);
\t\t\t\t\t\t\t\t\$note.toggle(isOn);
\t\t\t\t\t\t\t}
\t\t\t\t\t\t}
\t\t\t\t\t\t// wd (sale_type=5) のステップ / デッキフェンス用の注記もここで切替.
\t\t\t\t\t\t// ステップ → deck_step (op0 だが op_data 範囲外), 必要 選択時に表示.
\t\t\t\t\t\tvar radioName = \$clicked.attr('name');
\t\t\t\t\t\tif (radioName === 'deck_step') {
\t\t\t\t\t\t\t\$group.find('.opt-survey-note-wd-step').toggle(\$clicked.val() === '必要');
\t\t\t\t\t\t} else if (radioName === 'deck_fence') {
\t\t\t\t\t\t\t\$group.find('.opt-survey-note-wd-fence').toggle(\$clicked.val() === '必要');
\t\t\t\t\t\t}
\t\t\t\t\t}
\t\t\t\t}
\t\t\t}
\t\t\t// 必須項目チェックは sale_type 1 系(カーポート/物置/フェンスなど価格マトリクス必要)に限定
\t\t\tvar requireMatrix = (SALE_TYPE_ID == 1 || SALE_TYPE_ID == 2 || SALE_TYPE_ID == 3 || SALE_TYPE_ID == 4 || SALE_TYPE_ID == 5 || SALE_TYPE_ID == 6 || SALE_TYPE_ID == 7 || SALE_TYPE_ID == 9);
\t\t\t// sale_type=3 (物置・ゴミステーション・照明 等) では「素材」を選択肢として扱わない.
\t\t\t// - mo/gs/sy は m が \"指定なし\" など名目的にしか入っていない
\t\t\t// - sl は m が空のままで matrix に行が来る
\t\t\t// そのため pm の必須チェックを sale_type=3 でスキップする。
\t\t\tvar pmRequired = (SALE_TYPE_ID != 3);
\t\t\tif (requireMatrix) {
\t\t\t\tif(pmRequired && pm == \"\"){
\t\t\t\t\t\$('#mitsumori_message').text(\"素材を選択してください\");
\t\t\t\t}
\t\t\t\tif(ph == \"\"){
\t\t\t\t\t\$('#mitsumori_message').text(\"高さを選択してください\");
\t\t\t\t}
\t\t\t\tif(pd == \"\"){
\t\t\t\t\t\$('#mitsumori_message').text(\"奥行きを選択してください\");
\t\t\t\t}
\t\t\t\tif(pw == \"\"){
\t\t\t\t\t\$('#mitsumori_message').text(\"幅を選択してください\");
\t\t\t\t}
\t\t\t\tif(pc == \"\"){
\t\t\t\t\t\$('#mitsumori_message').text(\"カラーを選択してください\");
\t\t\t\t\t\$('#mitsumori_btn').hide();
\t\t\t\t\t\$('#mitsumori_goukei').text(\"---円\");
\t\t\t\t\t\$('#mitsumori_off').text(\"---円\");
\t\t\t\t\t\$('#mitsumori_price').text(\"---円\");
\t\t\t\t\t\$('#maker_price').text(\"---円\");
\t\t\t\t\t\$('#mitsumori_ct').text(\"---円\");
\t\t\t\t\$('#mitsumori_steelroof_row').hide();
\t\t\t\t\t\$('#mitsumori_option').text(\"---円\");
\t\t\t\t}
\t\t\t}
\t\t\tif(pw != \"\" && pd != \"\" && ph != \"\" && (!pmRequired || pm != \"\") && pc != \"\"){
\t\t\t\t\$('#mitsumori_btn').show();
\t\t\t\t// 入力コンテキスト(sale_type 別パラメータ)
\t\t\t\tvar ctx = {
\t\t\t\t\tset_count: parseInt(\$('#set_count').val()) || 1,
\t\t\t\t\tdaisu: parseInt(\$('#daisu').val()) || 1,
\t\t\t\t\tmaisu: parseInt(\$('#maisu').val()) || 3,
\t\t\t\t\tsuuryou: parseInt(\$('#suuryou').val()) || 1,
\t\t\t\t\tarea: (function(){
\t\t\t\t\t\t// tf(人工芝): 施工サイズ 縦(m)×横(m) から面積を算出し #area に反映.
\t\t\t\t\t\tvar L = parseFloat(\$('#tf_len').val()) || 0;
\t\t\t\t\t\tvar W = parseFloat(\$('#tf_wid').val()) || 0;
\t\t\t\t\t\tif (L > 0 && W > 0) { var a = L * W; \$('#area').val(a); return a; }
\t\t\t\t\t\treturn parseFloat(\$('#area').val()) || 0;
\t\t\t\t\t})(),
\t\t\t\t\ttf_len: parseFloat(\$('#tf_len').val()) || 0,
\t\t\t\t\ttf_wid: parseFloat(\$('#tf_wid').val()) || 0,
\t\t\t\t\ttf_qty: parseInt(\$('#tf_qty').val()) || 1,
\t\t\t\t\tquantityOnly: parseInt(\$('#quantity_only').val())|| 1,
\t\t\t\t\tmado_w: \$('#mado_w').val() || '',
\t\t\t\t\tmado_h: \$('#mado_h').val() || '',
\t\t\t\t\tmado_type: \$('input[name=mado_type]:checked').val() || '',
\t\t\t\t\tglass_type: \$('input[name=glass_type]:checked').val() || '',
\t\t\t\t\tdeck_step: \$('input[name=deck_step]:checked').val() || '',
\t\t\t\t\tdeck_fence: \$('input[name=deck_fence]:checked').val() || '',
\t\t\t\t};
\t\t\t\t// 施工オプション集計(残土処理を含む)
\t\t\t\tvar opCalc = collectOptions();
\t\t\t\tvar pp_matched = false;
\t\t\t\t// 各軸の汎用 axisMatch:
\t\t\t\t// user 選択 == matrix 値 / user \"指定なし\" / matrix 値が空
\t\t\t\tvar axisMatch = function(input, value){
\t\t\t\t return input == value || input == \"指定なし\" || value === \"\" || value == null;
\t\t\t\t};
\t\t\t\t// 色専用マッチャー: scraper のデータ形式に合わせて拡張する
\t\t\t\t// 1. 完全一致 / \"指定なし\" / 値が空 → 真 (axisMatch と同じ)
\t\t\t\t// 2. matrix 値が \"色1/色2/色3\" の形 (同価格グループ) → split して user 選択が含まれれば真
\t\t\t\t// scraper のロジック (scraper_price.py L765-779):
\t\t\t\t// 全色同価格 → c=\"\"、価格違いグループあり → 各 group を \"/\" 結合した色名で 1 行
\t\t\t\tvar colorMatch = function(input, value){
\t\t\t\t if (axisMatch(input, value)) return true;
\t\t\t\t if (typeof value === 'string' && value.indexOf('/') !== -1 && input) {
\t\t\t\t var parts = value.split('/');
\t\t\t\t for (var idx = 0; idx < parts.length; idx++) {
\t\t\t\t if (parts[idx].trim() === input) return true;
\t\t\t\t }
\t\t\t\t }
\t\t\t\t return false;
\t\t\t\t};
\t\t\t\t// 他軸 (w/d/h/m + option1/option2) でマッチする pp 行を抽出.
\t\t\t\t// option1/option2 は um の subtype 等で使われる. axisMatch は free_area 側が
\t\t\t\t// 空のとき真を返すので、um 以外のカテゴリ (option 軸を使わない) でも影響なし.
\t\t\t\tvar candidates = pp.filter(function(el){
\t\t\t\t return axisMatch(pw, el.w) && axisMatch(pd, el.d) && axisMatch(ph, el.h) && axisMatch(pm, el.m)
\t\t\t\t && axisMatch(option1, el.option1) && axisMatch(option2, el.option2);
\t\t\t\t});
\t\t\t\t// フォールバック: 全軸一致が 0 件のときに限り option1/option2 を無視して再マッチ。
\t\t\t\t// 玄関ドア等で option1(なし/ランマ付き)・option2(◯◯タイプ) が pm(開き方) から
\t\t\t\t// 導出可能な冗長軸で、未選択だと全軸 AND 一致を満たせず価格が出ない事象の救済。
\t\t\t\t// pm/幅/奥行/高さ は従来どおり一致を要求するため通常商品の価格選択に影響しない。
\t\t\t\tif (candidates.length === 0) {
\t\t\t\t candidates = pp.filter(function(el){
\t\t\t\t return axisMatch(pw, el.w) && axisMatch(pd, el.d) && axisMatch(ph, el.h) && axisMatch(pm, el.m);
\t\t\t\t });
\t\t\t\t}
\t\t\t\tvar picked = null;
\t\t\t\t// 優先 1: 色も含めて完全一致 (\"色1/色2\" 形式の split match を含む)
\t\t\t\tfor (var ii = 0; ii < candidates.length; ii++) {
\t\t\t\t if (colorMatch(pc, candidates[ii].c)) { picked = candidates[ii]; break; }
\t\t\t\t}
\t\t\t\t// 優先 2: 完全一致なし & user の pc が候補のどの c 値にも該当しない (= 命名違い等)
\t\t\t\t// かつ候補全行で price が一致する場合は、色軸を実質無視して先頭行を採用.
\t\t\t\t// 例 id=3353: pp.c は \"ステンカラー+...\" 6種だが price は全て同じなので
\t\t\t\t// SM(スミ) を選んでも安全に最初の行の価格を返せる.
\t\t\t\tif (!picked && candidates.length > 0) {
\t\t\t\t var ppCsInCand = candidates.map(function(r){ return r.c || ''; });
\t\t\t\t var pcAbsent = (pc !== '' && pc !== '指定なし' && ppCsInCand.indexOf(pc) === -1
\t\t\t\t && ppCsInCand.every(function(v){ return v.indexOf('/') === -1 || v.split('/').map(function(s){return s.trim();}).indexOf(pc) === -1; }));
\t\t\t\t if (pcAbsent) {
\t\t\t\t var uniqPrices = new Set();
\t\t\t\t candidates.forEach(function(r){ uniqPrices.add(String(r.price)); });
\t\t\t\t if (uniqPrices.size === 1) {
\t\t\t\t // 全候補同価格 → 色軸を wildcard 扱いで OK
\t\t\t\t picked = candidates[0];
\t\t\t\t }
\t\t\t\t // 価格が異なる場合は意図的に picked=null のまま「対応しておりません」.
\t\t\t\t }
\t\t\t\t}
\t\t\t\t// 請求額・見積書・PDF 用の税込値 (表示は税抜だが json は税込で不変).
\t\t\t\t// 未マッチ時は '---円' のまま送る.
\t\t\t\tvar jGoukei = '---円', jGoukei02 = '---円', jPrice = '---円',
\t\t\t\t jMaker = '---円', jOff = '---円', jCt = '---円', jOption = '---円';
\t\t\t\tpp.forEach((el) => {
\t\t\t\t if (el === picked) {
\t\t\t\t\tpp_matched = true;
\t\t\t\t\t// tg block-keyed オプション差額を集計 (tg 以外は total=0)
\t\t\t\t\tvar oiCalc = collectOptionItems(el.w || '', el.d || '');
\t\t\t\t\t// tg ブロックに合わせてラジオを再描画 (tg 以外は no-op)
\t\t\t\t\trenderOptionItemRadios(el.w || '', el.d || '');
\t\t\t\t\t// fe ブロックの種類×段数 サブ radio (fe 以外/未設定は no-op)
\t\t\t\t\trenderFeBlockRadios();
\t\t\t\t\t// fe ご希望のフェンス設置方法 — 「既存ブロックに穴空け」 entry の連動表示
\t\t\t\t\tupdateFeOpConditionalVisibility();
\t\t\t\t\tvar calc = calcGoukei(el, opCalc.total, ctx);
\t\t\t\t\tvar goukei = calc.goukei; // 税込 (請求額・見積書・PDF 用)
\t\t\t\t\tvar price = calc.price; // 税込
\t\t\t\t\tvar ct = calc.ct; // 税込
\t\t\t\t\tvar optionSum = calc.opt; // 税込
\t\t\t\t\tvar goukeiExc = calc.goukeiExc; // 税抜 (詳細ページ表示専用)
\t\t\t\t\tvar priceExc = calc.priceExc; // 税抜
\t\t\t\t\tvar ctExc = calc.ctExc; // 税抜
\t\t\t\t\tvar optionExc = calc.optExc; // 税抜
\t\t\t\t\t// tf(人工芝): 必要枚数入力へ算出結果を反映(施工サイズ入力時は上書き、
\t\t\t\t\t// 直接指定時は同値なので実質変化なし。要素が無い sale_type では no-op)
\t\t\t\t\tvar \$tfQty = \$('#tf_qty');
\t\t\t\t\tif (\$tfQty.length) \$tfQty.val(calc.qty || 1);
\t\t\t\t\t// オプション差額は税抜 → 税込に変換して合計に加算
\t\t\t\t\tvar oiIncTax = toIncTax(oiCalc.total);
\t\t\t\t\tgoukei += oiIncTax;
\t\t\t\t\tprice += oiIncTax; // 差額は本体価格扱いとして mitsumori_price にも加算
\t\t\t\t\tgoukeiExc += oiCalc.total; // 税抜側にも同じ差額を加算
\t\t\t\t\tpriceExc += oiCalc.total;
\t\t\t\t\t// maker_price も scraper が税抜で保存しているため税込に変換
\t\t\t\tvar makerPrice = toIncTax(parseInt(el.maker_price) || 0); // 税込
\t\t\t\t\tvar makerPriceExc = parseInt(el.maker_price) || 0; // 税抜
\t\t\t\t\t// 表示 (詳細ページの見積カード/ヘッダー/SPバー) は税抜に統一.
\t\t\t\t\t\$('#mitsumori_message').text(formatter.format(goukeiExc) + \"円\");
\t\t\t\t\t\$('#mitsumori_goukei').text(formatter.format(goukeiExc) + \"円\");
\t\t\t\t\t\$('#mitsumori_off').text(formatter.format(priceExc - makerPriceExc) + \"円\");
\t\t\t\t\t\$('#mitsumori_price').text(formatter.format(priceExc) + \"円\");
\t\t\t\t\t\$('#maker_price').text(formatter.format(makerPriceExc) + \"円\");
\t\t\t\t\t\$('#mitsumori_ct').text(formatter.format(ctExc) + \"円\");
\t\t\t\t\t\$('#mitsumori_option').text(formatter.format(optionExc) + \"円\");
\t\t\t\t\t// スチール折板(折半屋根 = option1): cp 折板のみ非ゼロ。工事費内に別行表示。
\t\t\t\t\tvar steelRoofExc = calc.steelRoofExc || 0;
\t\t\t\t\tif (steelRoofExc > 0) { \$('#mitsumori_steelroof_row').show(); \$('#mitsumori_steelroof').text(formatter.format(steelRoofExc) + \"円\"); }
\t\t\t\t\telse { \$('#mitsumori_steelroof_row').hide(); }
\t\t\t\t\t// 見積書モーダルは正式帳票のため税込のまま (請求額と一致).
\t\t\t\t\t\$('#mitsumori_kei').text(formatter.format(goukei) + \"円\");
\t\t\t\t\t\$('#mitsumori_price_01').text(formatter.format(price) + \"円\");
\t\t\t\t\t\$('#mitsumori_price_02').text(formatter.format(price) + \"円\");
\t\t\t\t\t\$('#mitsumori_ct_01').text(formatter.format(ct) + \"円\");
\t\t\t\t\t\$('#mitsumori_ct_02').text(formatter.format(ct) + \"円\");
\t\t\t\t\t\$('#mitsumori_goukei_02').text(formatter.format(goukei) + \"円\");
\t\t\t\t\tvar shoukei = goukei / 1.1;
\t\t\t\t\tvar tax = parseInt(goukei - shoukei);
\t\t\t\t\t\$('#mitsumori_shoukei').text(formatter.format(parseInt(shoukei)) + \"円\");
\t\t\t\t\t\$('#mitsumori_tax').text(formatter.format(tax) + \"円\");
\t\t\t\t\t// 請求額・PDF 用 json は税込を保持 (表示 DOM が税抜でも請求額は不変).
\t\t\t\t\tjGoukei = formatter.format(goukei) + \"円\";
\t\t\t\t\tjGoukei02 = formatter.format(goukei) + \"円\";
\t\t\t\t\tjPrice = formatter.format(price) + \"円\";
\t\t\t\t\tjMaker = formatter.format(makerPrice) + \"円\";
\t\t\t\t\tjOff = formatter.format(price - makerPrice) + \"円\";
\t\t\t\t\tjCt = formatter.format(ct) + \"円\";
\t\t\t\t\tjOption = formatter.format(optionSum) + \"円\";
\t\t\t\t\t// PDF 明細用:オプション内訳テーブルを差し込む (施工オプション + tg block オプション)
\t\t\t\t\trenderOptionDetailRows(opCalc.items.concat(oiCalc.items.map(function(it){
\t\t\t\t\t\treturn { name: it.name, value: it.label, price: it.diff };
\t\t\t\t\t})));
\t\t\t\t }
\t\t\t\t});
\t\t\t\tif (!pp_matched) {
\t\t\t\t\t\$('#mitsumori_message').text(\"この組み合わせは対応しておりません\");
\t\t\t\t\t\$('#mitsumori_btn').hide();
\t\t\t\t\t\$('#mitsumori_goukei').text(\"---円\");
\t\t\t\t\t\$('#mitsumori_off').text(\"---円\");
\t\t\t\t\t\$('#mitsumori_price').text(\"---円\");
\t\t\t\t\t\$('#maker_price').text(\"---円\");
\t\t\t\t\t\$('#mitsumori_ct').text(\"---円\");
\t\t\t\t\$('#mitsumori_steelroof_row').hide();
\t\t\t\t\t\$('#mitsumori_option').text(\"---円\");
\t\t\t\t\t\$('#mitsumori_kei').text(\"---円\");
\t\t\t\t\t\$('#mitsumori_shoukei').text(\"---円\");
\t\t\t\t\t\$('#mitsumori_tax').text(\"---円\");
\t\t\t\t}
\t\t\t\t// mitsumori_json: バック側に送信する見積データ
\t\t\t\tvar mitsumori_json = { \"mitsumori_goukei\": jGoukei,
\t\t\t\t\t\t\t\t\t\t\"mitsumori_goukei_02\": jGoukei02,
\t\t\t\t\t\t\t\t\t\t\"mitsumori_price\": jPrice,
\t\t\t\t\t\t\t\t\t\t\"maker_price\": jMaker,
\t\t\t\t\t\t\t\t\t\t\"mitsumori_off\": jOff,
\t\t\t\t\t\t\t\t\t\t\"mitsumori_ct\": jCt,
\t\t\t\t\t\t\t\t\t\t\"mitsumori_option\": jOption,
\t\t\t\t\t\t\t\t\t\t\"product_id\": {{ Product.id }},
\t\t\t\t\t\t\t\t\t\t\"sale_type\": SALE_TYPE_ID,
\t\t\t\t\t\t\t\t\t\t\"pw\": pw,
\t\t\t\t\t\t\t\t\t\t\"pd\": pd,
\t\t\t\t\t\t\t\t\t\t\"ph\": ph,
\t\t\t\t\t\t\t\t\t\t\"pm\": pm,
\t\t\t\t\t\t\t\t\t\t\"pc\": pc,
\t\t\t\t\t\t\t\t\t\t\"op\": [op0,op1,op2,op3,op4,op5,op6,op7,op8,op9,op10],
\t\t\t\t\t\t\t\t\t\t\"op_items\": opCalc.items,
\t\t\t\t\t\t\t\t\t\t\"mado_w\": ctx.mado_w,
\t\t\t\t\t\t\t\t\t\t\"mado_h\": ctx.mado_h,
\t\t\t\t\t\t\t\t\t\t\"mado_type\": ctx.mado_type,
\t\t\t\t\t\t\t\t\t\t\"glass_type\": ctx.glass_type,
\t\t\t\t\t\t\t\t\t\t\"set_count\": ctx.set_count,
\t\t\t\t\t\t\t\t\t\t\"daisu\": ctx.daisu,
\t\t\t\t\t\t\t\t\t\t\"maisu\": ctx.maisu,
\t\t\t\t\t\t\t\t\t\t\"suuryou\": ctx.suuryou,
\t\t\t\t\t\t\t\t\t\t\"area\": ctx.area,
\t\t\t\t\t\t\t\t\t\t\"tf_len\": ctx.tf_len,
\t\t\t\t\t\t\t\t\t\t\"tf_wid\": ctx.tf_wid,
\t\t\t\t\t\t\t\t\t\t\"tf_qty\": \$('#tf_qty').val(),
\t\t\t\t\t\t\t\t\t\t\"deck_step\": ctx.deck_step,
\t\t\t\t\t\t\t\t\t\t\"deck_fence\": ctx.deck_fence };
\t\t\t\t\$('#mitsumori_json').val(JSON.stringify(mitsumori_json));
\t\t\t}
\t\t}
\t\t// PDF/モーダル明細の動的差し替え(基本工事費の次にオプション行を追加)
\t\tfunction renderOptionDetailRows(items) {
\t\t\tvar \$tbody = \$('.modal-mitsumori table tbody');
\t\t\tif (!\$tbody.length) return;
\t\t\t\$tbody.find('tr.opt-row').remove();
\t\t\tvar anchorRow = \$tbody.find('tr').filter(function(){
\t\t\t\treturn \$(this).find('td:first').text().indexOf('残土') !== -1
\t\t\t\t\t|| \$(this).find('td:first').text().indexOf('基本工事費') !== -1;
\t\t\t}).last();
\t\t\titems.forEach(function(it){
\t\t\t\tif (!it.name || !it.value) return;
\t\t\t\tvar priceTxt = it.price > 0
\t\t\t\t\t? formatter.format(it.price) + '円'
\t\t\t\t\t: '0円';
\t\t\t\tvar \$tr = \$('<tr class=\"opt-row\"></tr>')
\t\t\t\t\t.append('<td>' + it.name + ':' + it.value + '</td>')
\t\t\t\t\t.append('<td>1</td>')
\t\t\t\t\t.append('<td>式</td>')
\t\t\t\t\t.append('<td>' + priceTxt + '</td>')
\t\t\t\t\t.append('<td>' + (it.price > 0 ? formatter.format(it.price) + '円' : '') + '</td>');
\t\t\t\tif (anchorRow.length) {
\t\t\t\t\tanchorRow.after(\$tr);
\t\t\t\t\tanchorRow = \$tr;
\t\t\t\t} else {
\t\t\t\t\t\$tbody.append(\$tr);
\t\t\t\t}
\t\t\t});
\t\t}
\t\t// 見積書モーダルを開く直前に、右側「現在のお見積り額」パネルの表示値を
\t\t// モーダル内の対応 ID にコピーして金額の食い違いを防ぐ。
\t\t// pw/pd/ph/pm が未選択で mitsumori_simulation の full update に到達しない場合でも、
\t\t// パネル側の値(HTML 静的初期値 or 直近の simulation 結果)が modal にも反映される。
\t\tfunction syncMitsumoriModalFromPanel() {
\t\t\t// 見積カード表示は税抜だが、見積書モーダルは正式帳票として税込で出す.
\t\t\t// 請求と一致する税込値は hidden #mitsumori_json (税込のまま構築) から取得する.
\t\t\tvar mj = {};
\t\t\ttry { mj = JSON.parse(\$('#mitsumori_json').val() || '{}') || {}; } catch (e) { mj = {}; }
\t\t\tvar goukeiText = mj.mitsumori_goukei || '---円';
\t\t\tvar priceText = mj.mitsumori_price || '---円';
\t\t\tvar ctText = mj.mitsumori_ct || '---円';
\t\t\t\$('#mitsumori_kei').text(goukeiText);
\t\t\t\$('#mitsumori_price_01').text(priceText);
\t\t\t\$('#mitsumori_price_02').text(priceText);
\t\t\t\$('#mitsumori_ct_01').text(ctText);
\t\t\t\$('#mitsumori_ct_02').text(ctText);
\t\t\t\$('#mitsumori_goukei_02').text(goukeiText);
\t\t\t// 小計 / 消費税 は税込 goukei から逆算
\t\t\tvar num = parseInt(String(goukeiText).replace(/[^\\d-]/g, ''), 10);
\t\t\tif (!isNaN(num) && num > 0) {
\t\t\t\tvar shoukei = Math.round(num / 1.1);
\t\t\t\tvar tax = num - shoukei;
\t\t\t\t\$('#mitsumori_shoukei').text(formatter.format(shoukei) + '円');
\t\t\t\t\$('#mitsumori_tax').text(formatter.format(tax) + '円');
\t\t\t} else {
\t\t\t\t\$('#mitsumori_shoukei').text('---円');
\t\t\t\t\$('#mitsumori_tax').text('---円');
\t\t\t}
\t\t}
\t\t\$(document).on('show.bs.modal', '#modal-mitsumori', function () {
\t\t\t// 発行日を表示時点の当日日付に設定(固定ダミー日付の残置防止)
\t\t\tvar _now = new Date();
\t\t\tvar _issue = _now.getFullYear() + '/' +
\t\t\t\t('0' + (_now.getMonth() + 1)).slice(-2) + '/' +
\t\t\t\t('0' + _now.getDate()).slice(-2);
\t\t\t\$('#mitsumori_issue_date').text(_issue);
\t\t\tsyncMitsumoriModalFromPanel();
\t\t});
{# pc の auto-init: pw/pd/ph/pm と同じく p_c(matrix 派生)の length==1 or 全空で「指定なし」化.
search_word(color) が空の「複合色」型商品で pc が空のまま放置されて
「カラーを選択してください」固定になるバグの修正.
search_word に登録された name があれば優先採用. #}
{% if p_c and (p_c|length == 1 or p_c|join == \"\") %}
pc = \"指定なし\";
{% for pc_val in p_c %}{% if pc_val %} pc = \"{{ pc_val }}\"; {% endif %}{% endfor %}
{% if color and color|length == 1 %}
{% for cc in color %}{% if cc and cc['name'] %} pc = \"{{ cc['name'] }}\"; {% endif %}{% endfor %}
{% endif %}
{% elseif color and color|length == 1 %}
pc = \"指定なし\";
\t\t\t{% for cc in color %}{% if cc and cc['name'] %} pc = \"{{ cc['name'] }}\"; {% endif %}{% endfor %}
\t\t{% endif %}
{% if p_w and (p_w|length == 1 or p_w|join == \"\") %}
pw = \"指定なし\";
\t\t\t{% for pw in p_w %}{% if pw %} pw = \"{{ pw }}\"; {% endif %}{% endfor %}
\t\t{% endif %}
{% if p_d and (p_d|length == 1 or p_d|join == \"\") %}
pd = \"指定なし\";
\t\t\t{% for pd in p_d %}{% if pd %} pd = \"{{ pd }}\"; {% endif %}{% endfor %}
\t\t{% endif %}
{% if p_h and (p_h|length == 1 or p_h|join == \"\") %}
ph = \"指定なし\";
\t\t\t{% for ph in p_h %}{% if ph %} ph = \"{{ ph }}\"; {% endif %}{% endfor %}
\t\t{% endif %}
{% if p_m and (p_m|length == 1 or p_m|join == \"\") %}
pm = \"指定なし\";
\t\t\t{% for pm in p_m %}{% if pm %} pm = \"{{ pm }}\"; {% endif %}{% endfor %}
\t\t{% endif %}
{# p_option1 / p_option2 の auto-init: length==1 or 全空で JS 変数を埋める #}
{% if p_option1 and (p_option1|length == 1 or p_option1|join == \"\") %}
option1 = \"\";
\t\t\t{% for opt1 in p_option1 %}{% if opt1 %} option1 = \"{{ opt1|e('js') }}\"; {% endif %}{% endfor %}
\t\t{% endif %}
{% if p_option2 and (p_option2|length == 1 or p_option2|join == \"\") %}
option2 = \"\";
\t\t\t{% for opt2 in p_option2 %}{% if opt2 %} option2 = \"{{ opt2|e('js') }}\"; {% endif %}{% endfor %}
\t\t{% endif %}
\t\t// カラー radio が複数あるとき初期チェックが無いと「カラーを選択してください」固定になるので、
\t\t// 何もチェックされていなければ「最初の radio」を選択する。
\t\t// sale_type≠3 は name=\"color\", sale_type=3 は name=\"color3\".
\t\t//
\t\t// 注意:
\t\t// ・search_word(= radio の値)と pp.c(= matrix の色軸)は別の命名体系のケースがある
\t\t// (例 id=3353: radio=\"SM(スミ)\" / pp.c=\"ステンカラー+セピアブラウン\")
\t\t// ・pp.c に合わせて radio を選ぼうとしても文字列一致しないので無意味。
\t\t// ・単純に「先頭の radio」を選ぶ実装に戻し、マッチング側で命名体系違いを吸収する
\t\t// (pc が pp.c のどの値にもマッチしないときは色軸を wildcard 扱いにする)。
\t\t// ・.rp-section-label のテキストも忘れずに同期する(古い session 値が残ると
\t\t// \"ステンカラー+セピアブラウン\" のような表示と実際の radio が食い違う)。
\t\t(function autoSelectFirstColor(){
\t\t\tvar groups = ['color', 'color3'];
\t\t\tfor (var gi = 0; gi < groups.length; gi++) {
\t\t\t\tvar name = groups[gi];
\t\t\t\tvar nodes = document.querySelectorAll('input[type=\"radio\"][name=\"' + name + '\"]');
\t\t\t\tif (nodes.length === 0) continue;
\t\t\t\tvar anyChecked = false;
\t\t\t\tfor (var i = 0; i < nodes.length; i++) {
\t\t\t\t\tif (nodes[i].checked) { anyChecked = true; break; }
\t\t\t\t}
\t\t\t\tif (anyChecked) continue;
\t\t\t\tvar target = nodes[0];
\t\t\t\ttarget.checked = true;
\t\t\t\tpc = target.value;
\t\t\t\t// opt-btn の is-selected を付け替え
\t\t\t\tvar lbl = target.closest('.opt-btn');
\t\t\t\tif (lbl) {
\t\t\t\t\tvar sib = lbl.parentNode ? lbl.parentNode.querySelectorAll('.opt-btn') : [];
\t\t\t\t\tfor (var k = 0; k < sib.length; k++) sib[k].classList.remove('is-selected');
\t\t\t\t\tlbl.classList.add('is-selected');
\t\t\t\t}
\t\t\t\t// 「カラー: <name>」表示の同期(古い mitsumori_json.pc が残らないように)
\t\t\t\tvar grp = (lbl && lbl.closest('.form-group')) || (target.closest('.form-group'));
\t\t\t\tif (grp) {
\t\t\t\t\tvar section = grp.querySelector('.rp-section-label');
\t\t\t\t\tif (section) {
\t\t\t\t\t\tvar labelHead = section.textContent.split(':')[0].trim();
\t\t\t\t\t\tsection.innerHTML = labelHead + ': <span>' + target.value + '</span>';
\t\t\t\t\t}
\t\t\t\t}
\t\t\t}
\t\t})();
\t\t// option1 / option2 / pw / pd / ph / pm (matrix 軸の radio 群) も同様に
\t\t// 「どれもチェックされていなければ先頭を選ぶ」を適用する.
\t\t// sale_type=2 の窓タイプ等で「初期表示時に一番初めの選択肢が選択されていない」事象を解消.
\t\t(function autoSelectFirstMatrixAxis(){
\t\t\tvar axes = [
\t\t\t\t{ name: 'pw', jsVar: 'pw' },
\t\t\t\t{ name: 'pd', jsVar: 'pd' },
\t\t\t\t{ name: 'ph', jsVar: 'ph' },
\t\t\t\t{ name: 'pm', jsVar: 'pm' },
\t\t\t\t{ name: 'glass_type', jsVar: 'pm' },
\t\t\t\t{ name: 'option1', jsVar: 'option1' },
\t\t\t\t{ name: 'option2', jsVar: 'option2' }
\t\t\t];
\t\t\tfor (var ai = 0; ai < axes.length; ai++) {
\t\t\t\tvar ax = axes[ai];
\t\t\t\tvar nodes = document.querySelectorAll('input[type=\"radio\"][name=\"' + ax.name + '\"]');
\t\t\t\tif (nodes.length === 0) continue;
\t\t\t\tvar anyChecked = false;
\t\t\t\tfor (var i = 0; i < nodes.length; i++) {
\t\t\t\t\tif (nodes[i].checked) { anyChecked = true; break; }
\t\t\t\t}
\t\t\t\tif (anyChecked) continue;
\t\t\t\tvar target = nodes[0];
\t\t\t\ttarget.checked = true;
\t\t\t\t// グローバル JS 変数も埋める
\t\t\t\tif (ax.jsVar === 'pw') pw = target.value;
\t\t\t\telse if (ax.jsVar === 'pd') pd = target.value;
\t\t\t\telse if (ax.jsVar === 'ph') ph = target.value;
\t\t\t\telse if (ax.jsVar === 'pm') pm = target.value;
\t\t\t\telse if (ax.jsVar === 'option1') option1 = target.value;
\t\t\t\telse if (ax.jsVar === 'option2') option2 = target.value;
\t\t\t\tvar lbl = target.closest('.opt-btn');
\t\t\t\tif (lbl) {
\t\t\t\t\tvar sib = lbl.parentNode ? lbl.parentNode.querySelectorAll('.opt-btn') : [];
\t\t\t\t\tfor (var k = 0; k < sib.length; k++) sib[k].classList.remove('is-selected');
\t\t\t\t\tlbl.classList.add('is-selected');
\t\t\t\t}
\t\t\t\tvar grp = (lbl && lbl.closest('.form-group')) || (target.closest('.form-group'));
\t\t\t\tif (grp) {
\t\t\t\t\tvar section = grp.querySelector('.rp-section-label');
\t\t\t\t\tif (section) {
\t\t\t\t\t\tvar labelHead = section.textContent.split(':')[0].trim();
\t\t\t\t\t\tsection.innerHTML = labelHead + ': <span>' + target.value + '</span>';
\t\t\t\t\t}
\t\t\t\t}
\t\t\t}
\t\t})();
\t\t// 取付/設置工事トグル(off 値が「商品購入のみ」のオプション)は、新規アクセス時に
\t\t// どちらの radio も未チェックのため初期価格が「商品購入のみ」= 基本工事費抜きになる。
\t\t// 顧客要望(#10)に合わせ、未選択時は「工事も希望する」(on 側) を初期選択し、
\t\t// 初期表示を基本工事費込みの最安値に統一する(色・寸法軸の先頭自動選択と同型)。
\t\t// ・判定キーは calcGoukei / applyPurchaseOnlyUI と同じ定数「商品購入のみ」。
\t\t// ・別用途で op{n} を流用する商品(ウッドデッキ deck_step 等)は radio 値に
\t\t// 「商品購入のみ」を含まないため対象外(既存挙動を壊さない)。
\t\t// ・mitsumori_json 復元やユーザー操作で既に選択済みなら尊重する。
\t\t(function autoSelectFirstInstall(){
\t\t\tfor (var i = 0; i <= 10; i++) {
\t\t\t\tvar nodes = document.querySelectorAll('input[type=\"radio\"][name=\"op' + i + '\"]');
\t\t\t\tif (nodes.length === 0) continue;
\t\t\t\t// このグループが「商品購入のみ」を off に持つ工事トグルか判定し、
\t\t\t\t// 「商品購入のみ」でない側 (= 工事希望 on) を取得する。
\t\t\t\tvar hasPurchaseOnly = false;
\t\t\t\tvar onNode = null;
\t\t\t\tfor (var j = 0; j < nodes.length; j++) {
\t\t\t\t\tif (nodes[j].value === '商品購入のみ') hasPurchaseOnly = true;
\t\t\t\t\telse if (!onNode) onNode = nodes[j];
\t\t\t\t}
\t\t\t\tif (!hasPurchaseOnly || !onNode) continue;
\t\t\t\tvar anyChecked = false;
\t\t\t\tfor (var k = 0; k < nodes.length; k++) {
\t\t\t\t\tif (nodes[k].checked) { anyChecked = true; break; }
\t\t\t\t}
\t\t\t\tif (anyChecked) continue;
\t\t\t\tonNode.checked = true;
\t\t\t\t// グローバル op 変数を on 値で埋める(calcGoukei の purchaseOnly 判定が参照)
\t\t\t\tswitch (i) {
\t\t\t\t\tcase 0: op0 = onNode.value; break;
\t\t\t\t\tcase 1: op1 = onNode.value; break;
\t\t\t\t\tcase 2: op2 = onNode.value; break;
\t\t\t\t\tcase 3: op3 = onNode.value; break;
\t\t\t\t\tcase 4: op4 = onNode.value; break;
\t\t\t\t\tcase 5: op5 = onNode.value; break;
\t\t\t\t\tcase 6: op6 = onNode.value; break;
\t\t\t\t\tcase 7: op7 = onNode.value; break;
\t\t\t\t\tcase 8: op8 = onNode.value; break;
\t\t\t\t\tcase 9: op9 = onNode.value; break;
\t\t\t\t\tcase 10: op10 = onNode.value; break;
\t\t\t\t}
\t\t\t\t// opt-btn の is-selected を付け替え
\t\t\t\tvar lbl = onNode.closest('.opt-btn');
\t\t\t\tif (lbl) {
\t\t\t\t\tvar sib = lbl.parentNode ? lbl.parentNode.querySelectorAll('.opt-btn') : [];
\t\t\t\t\tfor (var s = 0; s < sib.length; s++) sib[s].classList.remove('is-selected');
\t\t\t\t\tlbl.classList.add('is-selected');
\t\t\t\t}
\t\t\t\t// rp-section-label 表示同期 + 現地調査文言(is_removal_unknown / is_tf_kouji)を on 表示に
\t\t\t\tvar grp = (lbl && lbl.closest('.form-group')) || onNode.closest('.form-group');
\t\t\t\tif (grp) {
\t\t\t\t\tvar section = grp.querySelector('.rp-section-label');
\t\t\t\t\tif (section) {
\t\t\t\t\t\tvar labelHead = section.textContent.split(':')[0].trim();
\t\t\t\t\t\tsection.innerHTML = labelHead + ': <span>' + onNode.value + '</span>';
\t\t\t\t\t}
\t\t\t\t\tvar note = grp.querySelector('.opt-survey-note[data-op-idx=\"' + i + '\"]');
\t\t\t\t\tif (note) note.style.display = '';
\t\t\t\t}
\t\t\t}
\t\t})();
\t\t// ページ読み込み時: 見積金額が「合計」になっているため、カート数量は基本1
\t\t// sale_type=9(商品のみ購入)だけ通常 EC として数量を引き継ぐ
\t\t(function initQuantityByType(){
\t\t\tvar saleType = {{ ProductClass.SaleType.id }};
\t\t\tif (saleType == 9 && \$('#quantity_only').length) {
\t\t\t\t\$('#quantity').val(parseInt(\$('#quantity_only').val()) || 1);
\t\t\t} else {
\t\t\t\t\$('#quantity').val(1);
\t\t\t\t\$('input[name=\"quantity\"]').val(1);
\t\t\t}
\t\t})();
\t\t// type → ラベルのプレフィックス文字列
\t\t{# 屋根軸ラベル: pm(素材)の値が屋根パネル材(ポリカ/折板/波板/熱線 等)なら、
\t\t 材質が複数種→「屋根材」/ 同一材質で色違い→「屋根材の色」。屋根でない素材(デッキ材・
\t\t ドア開き方・数量・色 等)は「素材」のまま。カテゴリ一括ではなく値の中身で判定する。 #}
\t\t{% set pm_is_roof = false %}
\t\t{% set pm_stems = [] %}
\t\t{% if p_m %}{% for v in p_m %}{% if v %}
\t\t\t{% if v matches '/ポリカ|折板|波板|熱線|ふきポリ|アルミ形材屋根|スチール折板/' %}{% set pm_is_roof = true %}{% endif %}
\t\t\t{% set pm_stem = (v|split('(')|first)|split('(')|first|trim %}
\t\t\t{% if pm_stem not in pm_stems %}{% set pm_stems = pm_stems|merge([pm_stem]) %}{% endif %}
\t\t{% endif %}{% endfor %}{% endif %}
\t\t{% set pm_label = pm_is_roof ? ((pm_stems|length >= 2) ? '屋根材' : '屋根材の色') : '素材' %}
\t\t// option1/option2 のラベルは category 依存 (rd: ランマ/タイプ, sh: サイズプリセット/駆動方式 等).
\t\t// PHP から渡された option1_label / option2_label を埋め込み、JS 側でラベル更新に使う.
\t\tvar optLabelMap = {pc:'カラー', pw:'幅', pd:'奥行き', ph:'高さ', pm:'{{ pm_label|e('js') }}',
\t\t option1: '{{ option1_label|default('オプション1')|e('js') }}',
\t\t option2: '{{ option2_label|default('オプション2')|e('js') }}'};
\t\t// type → input[name]
\t\tvar optNameMap = {pc:'color', pw:'pw', pd:'pd', ph:'ph', pm:'pm',
\t\t option1: 'option1', option2: 'option2'};
\t\t// opt-btn用: 値を直接受け取るラッパー
\t\tfunction mitsumori_simulation_val(type, value) {
\t\t\tif (type === 'pc') pc = value;
\t\t\tif (type === 'pw') pw = value;
\t\t\tif (type === 'pd') pd = value;
\t\t\tif (type === 'ph') ph = value;
\t\t\tif (type === 'pm') pm = value;
\t\t\tif (type === 'option1') option1 = value;
\t\t\tif (type === 'option2') option2 = value;
\t\t\t// is-selected クラスを同グループ内で付け替え
\t\t\tvar inputName = optNameMap[type];
\t\t\tif (inputName) {
\t\t\t\tvar \$btns = \$('input[name=\"' + inputName + '\"]').closest('.opt-btn');
\t\t\t\t\$btns.removeClass('is-selected');
\t\t\t\t\$btns.filter(function(){
\t\t\t\t\treturn \$(this).find('input').val() === value;
\t\t\t\t}).addClass('is-selected');
\t\t\t}
\t\t\t// ラベル行の選択値テキストを更新(例: 「カラー: ブラック」)
\t\t\tvar labelPrefix = optLabelMap[type];
\t\t\tif (labelPrefix) {
\t\t\t\t// 対象のrp-section-labelを特定(input[name]を含む親を遡る)
\t\t\t\tvar \$group = \$('input[name=\"' + inputName + '\"]').first().closest('.form-group');
\t\t\t\tvar \$label = \$group.find('.rp-section-label');
\t\t\t\t\$label.html(labelPrefix + ': <span>' + value + '</span>');
\t\t\t}
\t\t\t// simulation本体を呼ぶ(value_idは空でOK、グローバル変数を使う)
\t\t\tmitsumori_simulation('', '');
\t\t}
\t\tmitsumori_simulation(\"\",\"\");
\t\t// ボタン群: 親幅を超える、または3行以上になる場合は is-scroll を付与し
\t\t// 縦3段グリッド+横スクロール表示にする(顧客要望「3列くらいで横スクロール」)
\t\tfunction applyBtnGroupScroll() {
\t\t\t\$('.rp-btn-group, .opt-btn-group').each(function() {
\t\t\t\tvar \$group = \$(this);
\t\t\t\t\$group.removeClass('is-scroll');
\t\t\t\t// 意図的な縦リスト(no-hscroll / flex-direction:column)は横スクロール化しない。
\t\t\t\t// フェンス fe_block の縦6行(A-2)や内窓(sale_type=2)の長いガラス名(A-3)が
\t\t\t\t// 3行以上/幅超過で is-scroll 化され、列崩れ・左見切れを起こすのを防ぐ。
\t\t\t\tif (\$group.hasClass('no-hscroll') || \$group.css('flex-direction') === 'column') return;
\t\t\t\tvar \$items = \$group.children();
\t\t\t\tif (\$items.length === 0) return;
\t\t\t\tvar parentWidth = \$group.parent().width() || \$group.width();
\t\t\t\tvar totalWidth = 0;
\t\t\t\tvar gap = parseInt(\$group.css('gap'), 10) || 8;
\t\t\t\t\$items.each(function() {
\t\t\t\t\ttotalWidth += this.offsetWidth + gap;
\t\t\t\t});
\t\t\t\t// 単一ボタンが親幅を超える、もしくは合計幅が親幅を超える → 横スクロール化
\t\t\t\tvar anyTooWide = false;
\t\t\t\t\$items.each(function() {
\t\t\t\t\tif (this.offsetWidth > parentWidth) { anyTooWide = true; return false; }
\t\t\t\t});
\t\t\t\t// 折り返し時の行数も計測
\t\t\t\tvar tops = {};
\t\t\t\t\$items.each(function() { tops[this.offsetTop] = true; });
\t\t\t\tvar rowCount = Object.keys(tops).length;
\t\t\t\tif (anyTooWide || totalWidth > parentWidth * 2 || rowCount >= 3) {
\t\t\t\t\t\$group.addClass('is-scroll');
\t\t\t\t}
\t\t\t});
\t\t}
\t\tapplyBtnGroupScroll();
\t\t\$(window).on('resize', function() {
\t\t\tclearTimeout(window._btnScrollTimer);
\t\t\twindow._btnScrollTimer = setTimeout(applyBtnGroupScroll, 150);
\t\t});
\t\t// iOS Safari 1-tap fix (#15 再発): is-scroll の横スクロールコンテナ内タップや
\t\t// 継承された a:hover により、初回タップが hover / スクロール判定に吸われ「2 回
\t\t// タッチ」が必要になる。touch 端末では touchend で 1 回目に選択 / 遷移を確定し、
\t\t// 後続のゴーストクリックを preventDefault で抑止する(二重発火なし)。指が動いた
\t\t// 場合はスクロール操作とみなし何もしない。デスクトップは従来の click のまま。
\t\t(function oneTapSelectFix(){
\t\t\tif (!('ontouchstart' in window)) return;
\t\t\tvar moved = false, sx = 0, sy = 0;
\t\t\tdocument.addEventListener('touchstart', function(e){
\t\t\t\tmoved = false;
\t\t\t\tvar t = e.touches && e.touches[0];
\t\t\t\tif (t) { sx = t.clientX; sy = t.clientY; }
\t\t\t}, { passive: true });
\t\t\tdocument.addEventListener('touchmove', function(e){
\t\t\t\tvar t = e.touches && e.touches[0];
\t\t\t\tif (t && (Math.abs(t.clientX - sx) > 8 || Math.abs(t.clientY - sy) > 8)) moved = true;
\t\t\t}, { passive: true });
\t\t\tdocument.addEventListener('touchend', function(e){
\t\t\t\tif (moved) return;
\t\t\t\tvar el = (e.target && e.target.closest) ? e.target.closest('.opt-btn, .rp-btn, .rp-card') : null;
\t\t\t\tif (!el) return;
\t\t\t\t// 窓タイプ / 住宅区分は専用の委譲 click ハンドラを持つため除外.
\t\t\t\tif (el.closest('#window-types-container') || el.closest('#window-housing-type-group')) return;
\t\t\t\te.preventDefault(); // 遅延ゴーストクリックを抑止し二重処理を防ぐ
\t\t\t\tif (el.tagName === 'A' && el.href) { window.location.href = el.href; return; }
\t\t\t\tel.click(); // label→radio チェック + inline onclick / change を 1 回だけ発火
\t\t\t}, { passive: false });
\t\t})();
\t\t// onload: 見積金額が確定している場合は「工事費込み価格」表示を一致させる
\t\t(function syncPrice02Display() {
\t\t\tvar goukeiEl = document.getElementById('mitsumori_goukei');
\t\t\tvar displayEl = document.getElementById('price02-display');
\t\t\tif (!goukeiEl || !displayEl) return;
\t\t\tvar goukeiText = goukeiEl.textContent.trim();
\t\t\t// ---円(未確定)の場合は書き換えない
\t\t\tif (goukeiText && goukeiText !== '---円') {
\t\t\t\tdisplayEl.textContent = goukeiText;
\t\t\t}
\t\t\t// 以降の変更にも追従: mitsumori_goukei を監視
\t\t\tnew MutationObserver(function() {
\t\t\t\tvar text = goukeiEl.textContent.trim();
\t\t\t\tif (text && text !== '---円') {
\t\t\t\t\tdisplayEl.textContent = text;
\t\t\t\t}
\t\t\t}).observe(goukeiEl, { childList: true, subtree: true, characterData: true });
\t\t})();
\t\tfunction contact_form(product_id){
\t\t\t\$('#form1').attr('action', '{{ url('contact', {product:Product.id}) }}');
\t\t\t\$('#form1').submit();
\t\t}
\t\t// maisu / madoset は下部の新しい関数定義を使用
\t\tfunction heibei(bei){
\t\t\t\$('#heibei').val(parseInt(\$('#heibei').val()) + bei);
\t\t\tif(parseInt(\$('#heibei').val()) < 1){ \$('#heibei').val(1); }
\t\t\tif(parseInt(\$('#heibei').val()) > 100){ \$('#heibei').val(100); }
\t\t\t// goukei に既に枚数を含むため、カート数量は1で固定
\t\t\t\$('#quantity').val(1);
\t\t\tmitsumori_simulation('heibei','heibei');
\t\t}
\t\tfunction daisu(dai){
\t\t\t\$('#daisu').val(parseInt(\$('#daisu').val()) + dai);
\t\t\tif(parseInt(\$('#daisu').val()) < 1){ \$('#daisu').val(1); }
\t\t\tif(parseInt(\$('#daisu').val()) > 10){ \$('#daisu').val(10); }
\t\t\t\$('#quantity').val(1);
\t\t\tmitsumori_simulation('daisu','daisu');
\t\t}
\t\t// sale_type=7(数量買い・基本工事費固定)用:個数入力
\t\tfunction suuryou(n){
\t\t\t\$('#suuryou').val(parseInt(\$('#suuryou').val()) + n);
\t\t\tif(parseInt(\$('#suuryou').val()) < 1){ \$('#suuryou').val(1); }
\t\t\tif(parseInt(\$('#suuryou').val()) > 100){ \$('#suuryou').val(100); }
\t\t\t\$('#quantity').val(1);
\t\t\tmitsumori_simulation('suuryou','suuryou');
\t\t}
\t\tfunction maisu(mai){
\t\t\t\$('#maisu').val(parseInt(\$('#maisu').val()) + mai);
\t\t\t// sale_type=4 (フェンス) は3枚未満不可、6 (芝生) は1枚から
\t\t\tvar minMai = (SALE_TYPE_ID == 4) ? 3 : 1;
\t\t\tif(parseInt(\$('#maisu').val()) < minMai){ \$('#maisu').val(minMai); }
\t\t\tif(parseInt(\$('#maisu').val()) > 100){ \$('#maisu').val(100); }
\t\t\t\$('#quantity').val(1);
\t\t\tmitsumori_simulation('maisu','maisu');
\t\t}
\t\t// タイプ2: セット数プルダウン連動
\t\tfunction madosetSelect(val){
\t\t\tvar v = parseInt(val);
\t\t\tif(v < 1) v = 1;
\t\t\tif(v > 20) v = 20;
\t\t\t\$('#set_count').val(v);
\t\t\t\$('#quantity').val(1);
\t\t\t\$('input[name=\"quantity\"]').val(1);
\t\t\tmitsumori_simulation('set','set_count');
\t\t}
\t\t// タイプ2: ±ボタン版(後方互換)
\t\tfunction madoset(mai){
\t\t\tvar current = parseInt(\$('#set_count').val()) || 1;
\t\t\tvar next = current + mai;
\t\t\tif(next < 1) next = 1;
\t\t\tif(next > 20) next = 20;
\t\t\t\$('#set_count').val(next);
\t\t\tmadosetSelect(next);
\t\t}
\t\t// タイプ5: ステップ・フェンス選択値を mitsumori_json に保存するためのグローバル変数
\t\tvar deck_step = \"{% if mitsumori_json and mitsumori_json.deck_step is defined %}{{ mitsumori_json.deck_step|default('不要') }}{% else %}不要{% endif %}\";
\t\tvar deck_fence = \"{% if mitsumori_json and mitsumori_json.deck_fence is defined %}{{ mitsumori_json.deck_fence|default('不要') }}{% else %}不要{% endif %}\";
\t\t// PDF出力: モーダルの mitsumori_json をフォームに同期してから送信
\t\tfunction syncPdfJson(){
\t\t\tvar jsonVal = \$('#mitsumori_json').val();
\t\t\t\$('#pdf_mitsumori_json').val(jsonVal);
\t\t}
\t\t// タイプ9: 商品のみ購入
\t\tfunction quantityOnly(val){
\t\t\tvar current = parseInt(\$('#quantity_only').val()) || 1;
\t\t\tvar next = current + val;
\t\t\tif(next < 1) next = 1;
\t\t\t\$('#quantity_only').val(next);
\t\t\t\$('#quantity').val(next);
\t\t}
// ===== スマホ用下部固定バーへの金額同期 =====
// mitsumori_message と mitsumori_goukei を監視して下部バーを更新
(function() {
var msgTarget = document.getElementById('mitsumori_message');
var goukeiTarget = document.getElementById('mitsumori_goukei');
var spPrice = document.getElementById('sp-mitsumori-price');
var spBtn = document.querySelector('#sp-mitsumori-bar .sp-bar__btn');
if (!spPrice || !spBtn) return;
function syncBar() {
var msg = msgTarget ? msgTarget.textContent : '';
var goukei = goukeiTarget ? goukeiTarget.textContent : '---円';
// メッセージが「〇〇を選択してください」の場合はメッセージを表示しボタンを非表示
if (msg.indexOf('選択してください') !== -1) {
spPrice.textContent = msg;
spPrice.style.fontSize = '13px';
spPrice.style.color = '#888';
spBtn.style.display = 'none';
} else {
// 価格確定時はボタンを表示
spPrice.textContent = goukei;
spPrice.style.fontSize = '18px';
spPrice.style.color = '#c00';
spBtn.style.display = 'block';
}
}
// 初期値を同期
syncBar();
// mitsumori_message の変化を監視
if (msgTarget) {
new MutationObserver(syncBar).observe(
msgTarget, { childList: true, subtree: true, characterData: true }
);
}
// mitsumori_goukei の変化も監視
if (goukeiTarget) {
new MutationObserver(syncBar).observe(
goukeiTarget, { childList: true, subtree: true, characterData: true }
);
}
})();
// ===== スマホ用 お見積りの詳細 ボトムシート 開閉 =====
// 現在の内訳カード(.mitsumori-card-pc .card-body)を複製して表示する。
// 価格計算ロジックには触れず、その時点で表示中の内訳をそのまま見せる。
// window に直接ぶら下げてスコープに依存せず onclick から呼べるようにする。
window.openSpMitsumoriDetail = function () {
var sheet = document.getElementById('sp-mitsumori-detail');
var body = document.getElementById('sp-detail-body');
var src = document.querySelector('.mitsumori-card-pc .card-body');
if (!sheet || !body) return;
body.innerHTML = '';
if (src) {
// 複製し、重複 id を避けるため clone 側の id を除去する
var clone = src.cloneNode(true);
var ided = clone.querySelectorAll('[id]');
for (var i = 0; i < ided.length; i++) { ided[i].removeAttribute('id'); }
body.appendChild(clone);
}
sheet.classList.add('is-open');
sheet.setAttribute('aria-hidden', 'false');
document.body.style.overflow = 'hidden';
};
window.closeSpMitsumoriDetail = function () {
var sheet = document.getElementById('sp-mitsumori-detail');
if (!sheet) return;
sheet.classList.remove('is-open');
sheet.setAttribute('aria-hidden', 'true');
document.body.style.overflow = '';
};
// ===== 現在のお見積り額: 折りたたみトグルボタンのテキスト切り替え =====
(function() {
var card = document.querySelector('.mitsumori-card-pc');
var btn = document.querySelector('.btn-mitsumori-toggle .toggle-icon');
if (!card || !btn) return;
// MutationObserverでcollapsed-cardクラスの変化を監視
new MutationObserver(function() {
if (card.classList.contains('collapsed-card')) {
btn.textContent = '▼ 詳細';
} else {
btn.textContent = '▲ 閉じる';
}
}).observe(card, { attributes: true, attributeFilter: ['class'] });
})();
// ===== エリア案内: スマホのみタップで展開 =====
(function() {
var notice = document.querySelector('.ec-areaNotice');
if (!notice) return;
notice.addEventListener('click', function(e) {
if (window.innerWidth > 767) return;
// リンククリック時は展開/折りたたみせずリンク遷移
if (e.target.tagName === 'A') return;
notice.classList.toggle('is-open');
});
})();
</script>
<script type=\"application/ld+json\">
{
\"@context\": \"https://schema.org/\",
\"@type\": \"Product\",
\"name\": \"{{ Product.name }}\",
\"image\": [
{% for img in Product.ProductImage %}
\"{{ app.request.schemeAndHttpHost }}{{ asset(img, 'save_image') }}\"{% if not loop.last %},{% endif %}
{% else %}
\"{{ app.request.schemeAndHttpHost }}{{ asset(''|no_image_product, 'save_image') }}\"
{% endfor %}
],
\"description\": \"{{ Product.description_list | default(Product.description_detail) | replace({'\\n': '', '\\r': ''}) | slice(0,300) }}\",
{% if Product.code_min %}
\"sku\": \"{{ Product.code_min }}\",
{% endif %}
\"offers\": {
\"@type\": \"Offer\",
\"url\": \"{{ url('product_detail', {'id': Product.id}) }}\",
\"priceCurrency\": \"{{ eccube_config.currency }}\",
\"price\": {{ Product.getPrice02IncTaxMin ? Product.getPrice02IncTaxMin : 0}},
\"availability\": \"{{ Product.stock_find ? \"InStock\" : \"OutOfStock\" }}\"
}
}
</script>
{% endblock %}
{% block main %}
{# option1 / option2 ラベルをカテゴリ別に決定 (sh=31, rd=43, mo=15) - block scope のため main 側でも再定義 #}
{% set option1_label = 'オプション1' %}
{% set option2_label = 'オプション2' %}
{# rd(玄関ドア, cat43) は素材(m)が開き方+ランマを内包し option1(ランマ)/option2(タイプ) が
完全な冗長軸のため、素材のみ「開き方」として表示し option1/option2 の選択 UI は抑制する。
価格マッチングは m + カラーで一意に決まり、未選択 option は fallback が無視するため影響なし。 #}
{% set is_cat43 = false %}
{# cp(カーポート, cat7): option1 は折半屋根(スチール折板)価格の運搬に使うため、選択UIは抑制する。
価格は寸法で一意に決まり、未選択 option は fallback が無視するため影響なし(cat43 と同型)。 #}
{% set is_cp = false %}
{% if Product.ProductCategories is not empty %}
{% for pcat in Product.ProductCategories %}
{% if pcat.category_id == 31 %}{% set option1_label = 'サイズプリセット' %}{% set option2_label = '駆動方式' %}{% endif %}
{% if pcat.category_id == 43 %}{% set option1_label = 'ランマ' %}{% set option2_label = 'タイプ' %}{% set is_cat43 = true %}{% endif %}
{% if pcat.category_id == 15 %}{% set option1_label = '棚タイプ' %}{% endif %}
{% if pcat.category_id == 17 %}{% set option1_label = '窓タイプ' %}{% endif %}
{% if pcat.category_id == 7 %}{% set is_cp = true %}{% endif %}
{% endfor %}
{% endif %}
{# pm(素材)軸ラベル: 屋根パネル材なら屋根材/屋根材の色、それ以外は素材。javascript block と
同一ロジック (block scope のため main 側でも再定義)。判定は値の中身で行う。 #}
{% set pm_is_roof = false %}
{% set pm_stems = [] %}
{% if p_m %}{% for v in p_m %}{% if v %}
{% if v matches '/ポリカ|折板|波板|熱線|ふきポリ|アルミ形材屋根|スチール折板/' %}{% set pm_is_roof = true %}{% endif %}
{% set pm_stem = (v|split('(')|first)|split('(')|first|trim %}
{% if pm_stem not in pm_stems %}{% set pm_stems = pm_stems|merge([pm_stem]) %}{% endif %}
{% endif %}{% endfor %}{% endif %}
{% set pm_label = pm_is_roof ? ((pm_stems|length >= 2) ? '屋根材' : '屋根材の色') : '素材' %}
<div class=\"ec-productRole\" style=\"margin-top:20px;\">
<div class=\"ec-grid2\">
<div class=\"ec-grid2__cell\">
<div class=\"ec-sliderItemRole\">
\t {# 商品名 + ブランド名 + SNSシェア #}
\t <div class=\"ec-productRole__title\">
\t <div class=\"ec-productRole__titleRow\">
\t <h2 class=\"ec-headingTitle\">{{ Product.name }}</h2>
\t <div class=\"ec-share-inline\">
\t <a href=\"https://twitter.com/share?url={{ app.request.uri|url_encode }}&text={{ Product.name|url_encode }}\"
\t class=\"share-twitter\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"Xでシェア\">
\t <svg viewBox=\"0 0 24 24\" style=\"width:15px;height:15px;fill:#fff;\"><path d=\"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-4.714-6.231-5.401 6.231H2.74l7.73-8.835L1.254 2.25H8.08l4.254 5.622L18.244 2.25zm-1.161 17.52h1.833L7.084 4.126H5.117z\"/></svg>
\t </a>
\t <a href=\"https://www.instagram.com/\" class=\"share-facebook\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"Instagram\">
\t <svg viewBox=\"0 0 24 24\" style=\"width:15px;height:15px;fill:#fff;\"><path d=\"M12 2.163c3.204 0 3.584.012 4.85.07 3.252.148 4.771 1.691 4.919 4.919.058 1.265.069 1.645.069 4.849 0 3.205-.012 3.584-.069 4.849-.149 3.225-1.664 4.771-4.919 4.919-1.266.058-1.644.07-4.85.07-3.204 0-3.584-.012-4.849-.07-3.26-.149-4.771-1.699-4.919-4.92-.058-1.265-.07-1.644-.07-4.849 0-3.204.013-3.583.07-4.849.149-3.227 1.664-4.771 4.919-4.919 1.266-.057 1.645-.069 4.849-.069zM12 0C8.741 0 8.333.014 7.053.072 2.695.272.273 2.69.073 7.052.014 8.333 0 8.741 0 12c0 3.259.014 3.668.072 4.948.2 4.358 2.618 6.78 6.98 6.98C8.333 23.986 8.741 24 12 24c3.259 0 3.668-.014 4.948-.072 4.354-.2 6.782-2.618 6.979-6.98.059-1.28.073-1.689.073-4.948 0-3.259-.014-3.667-.072-4.947-.196-4.354-2.617-6.78-6.979-6.98C15.668.014 15.259 0 12 0zm0 5.838a6.162 6.162 0 100 12.324 6.162 6.162 0 000-12.324zM12 16a4 4 0 110-8 4 4 0 010 8zm6.406-11.845a1.44 1.44 0 100 2.881 1.44 1.44 0 000-2.881z\"/></svg>
\t </a>
\t <a href=\"https://social-plugins.line.me/lineit/share?url={{ app.request.uri|url_encode }}\"
\t class=\"share-line\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"LINEでシェア\">
\t <i class=\"fab fa-line\"></i>
\t </a>
\t </div>
\t </div>
\t </div>
{% if BaseInfo.option_favorite_product %}
<div style=\"position:relative;top: 20px;left: 10px;z-index:100;\">
\t\t\t\t\t\t{% if is_favorite == false %}
<form action=\"{{ url('product_add_favorite', {id:Product.id}) }}\" method=\"post\">
<button type=\"submit\" id=\"favorite\" class=\"favorite\">♡</button>
</form>
{% else %}
<form action=\"{{ url('product_add_favorite', {id:Product.id}) }}\" method=\"post\">
<button type=\"submit\" id=\"favorite\" class=\"favorite\" style=\"color:red;\">♥</button>
</form>
{% endif %}
</div>
{% endif %}
<div class=\"item_visual\">
{% for ProductImage in Product.ProductImage %}
<div class=\"slide-item\">
<a class=\"js-zoom\" href=\"{{ asset(ProductImage, 'save_image') }}\" aria-label=\"{{ loop.first ? Product.name : '' }}\">
<img src=\"{{ asset(ProductImage, 'save_image') }}\" alt=\"{{ loop.first ? Product.name : '' }}\" width=\"550\" height=\"550\" style=\"max-height: 400px;\"{% if loop.index > 1 %} loading=\"lazy\"{% endif %}>
</a>
</div>
{% else %}
<div class=\"slide-item\"><img src=\"{{ asset(''|no_image_product, 'save_image') }}\" alt=\"{{ Product.name }}\" width=\"550\" height=\"550\" style=\"max-height: 400px;\"></div>
{% endfor %}
</div>
<div class=\"item_nav\">
{% for ProductImage in Product.ProductImage %}
<div class=\"slideThumb\" data-index=\"{{ loop.index0 }}\"><img src=\"{{ asset(ProductImage, 'save_image') }}\" alt=\"\" width=\"80\" height=\"80\" loading=\"lazy\"></div>
{% endfor %}
</div>
</div>
{# ===== 施工エリア案内(見積シミュレーションの下)===== #}
<div class=\"ec-areaNotice\" style=\"margin-top:16px;margin-right:10px;\">
<div class=\"ec-areaNotice__inner\">
<div class=\"ec-areaNotice__icon\">📍</div>
<div class=\"ec-areaNotice__body\">
<p class=\"ec-areaNotice__title\">施工対応エリアについて</p>
<div class=\"ec-areaNotice__detail\">
<p class=\"ec-areaNotice__text\">
当店の施工サービスは、<strong>山梨県全域</strong>および<br>
<strong>諏訪エリア(諏訪市・岡谷市・茅野市・諏訪郡)</strong>を対象としております。<br>
上記エリア外のお客様には、商品のみのご購入が可能でございます。<br>
ご不明な点がございましたら、お気軽にお問い合わせください。
</p>
<a class=\"ec-areaNotice__link\" href=\"{{ url('contact') }}\">エリア外のお客様・ご相談はこちら →</a>
</div>
</div>
</div>
</div>
</div>
<div class=\"ec-grid2__cell2\">
<div class=\"ec-productRole__profile\" >
{# 関連カテゴリ (DIY=21 / 石材=28 / 照明=44 は非表示要件のため除外) #}
{% set hidden_cat_ids = [21, 28, 44] %}
{% if Product.ProductCategories is not empty %}
<div class=\"ec-productRole__category\" style=\"padding:10px 0;\">
{% for ProductCategory in Product.ProductCategories %}
{% if ProductCategory.Category.id not in hidden_cat_ids %}
<ul>
<li>
{% for Category in ProductCategory.Category.path %}
<a href=\"{{ url('product_list') }}?category_id={{ Category.id }}\">{{ Category.name }}</a> {%- if loop.last == false %}
<span>></span>{% endif -%}
{% endfor %}
</li>
</ul>
{% endif %}
{% endfor %}
</div>
{% endif %}
{# 販売価格 #}
<div class=\"ec-productRole__price\">
\t\t\t\t\t\t<span style=\"color:black;font-size:15px;\">工事費込み価格</span>
{# 表示は税抜に統一 (2026-08). 請求額は不変で見積書/PDF/カート/受注は税込のまま. #}
{% if Product.hasProductClass -%}
{% if Product.getPrice02Min == Product.getPrice02Max %}
<div class=\"ec-price\">
<span id=\"price02-display\" class=\"ec-price__price price02-default\">{{ Product.getPrice02Min|price }}</span>
<span class=\"ec-price__tax\">(税抜)~</span>
</div>
{% else %}
<div class=\"ec-price\">
<span id=\"price02-display\" class=\"ec-price__price price02-default\">{{ Product.getPrice02Min|price }} ~ {{ Product.getPrice02Max|price }}</span>
<span class=\"ec-price__tax\">(税抜)</span>
</div>
{% endif %}
{% else %}
<div class=\"ec-price\">
<span id=\"price02-display\" class=\"ec-price__price\">{{ Product.getPrice02Min|price }}</span>
<span class=\"ec-price__tax\">(税抜)~</span>
</div>
{% endif %}
</div>
{# タグ #}
<ul class=\"ec-productRole__tags\">
{% for Tag in Product.Tags %}
<li class=\"ec-productRole__tag tag_{{ Tag.id }}\">{{ Tag }}</li>
{% endfor %}
</ul>
{# 商品コード #}
{% if Product.code_min is not empty %}
<div class=\"ec-productRole__code\">
{{ '商品コード'|trans }}: <span class=\"product-code-default\">{{ Product.code_min }}{% if Product.code_min != Product.code_max %} ~ {{ Product.code_max }}{% endif %}</span>
</div>
{% endif %}
<div class=\"ec-productRole__description\">
\t\t\t\t <div class=\"ec-rectHeading\">
\t\t\t\t <h4>製品情報</h4>
\t\t\t\t </div>
\t\t\t\t\t\t{{ Product.sales_infomation|raw|nl2br }}
</div>
{# 構成セット内容 (機能門柱など): list_spec に JSON が入っている商品のみ表示.
単体商品や他カテゴリは従来どおりの平文が入っているため json_decode は
null を返し、このブロックごとスキップされる. #}
{% set SetItems = Product.list_spec|json_decode %}
{% if SetItems and SetItems.items is defined and SetItems.items is not empty %}
<div class=\"ec-productRole__setItems\">
<div class=\"ec-rectHeading\">
<h4>{{ SetItems.title|default('この商品の構成セット内容(メーカーカタログ価格)') }}</h4>
</div>
<table class=\"set-items-table\">
<tbody>
{% for SetItem in SetItems.items %}
<tr>
<th>{{ SetItem.name }}</th>
<td>{% if SetItem.price is not empty %}{{ SetItem.price|price }}{% endif %}</td>
</tr>
{% endfor %}
</tbody>
{% if SetItems.total is not empty %}
<tfoot>
<tr>
<th>構成セット価格(メーカーカタログ価格)</th>
<td>{{ SetItems.total|price }}</td>
</tr>
</tfoot>
{% endif %}
</table>
</div>
{% endif %}
{# メーカーカタログリンク: 公式メーカードメインのみ表示. ex-shop.net ホストのPDFは情報源露出防止のため非表示 (B案) #}
{% if Product.maker_url is not empty and 'ex-shop.net' not in Product.maker_url %}
<div class=\"ec-productRole__catalog\" style=\"margin:8px 0;\">
<a href=\"{{ Product.maker_url }}\" target=\"_blank\" rel=\"noopener noreferrer\">
<i class=\"far fa-file-alt\"></i> この商品のメーカーカタログを見る
</a>
</div>
{% endif %}
\t\t\t\t\t<div class=\"card card-danger\" style=\"clear:both;margin:1px;\">
\t\t\t\t\t <div class=\"card-header\">
\t\t\t\t\t <h3 class=\"card-title\">見積シミュレーション</h3>
\t\t\t\t\t </div>
\t\t\t\t\t <div class=\"card-body p-2\">
{% set related_image = getProduct_field(Product.id,\"related_image\") %}
{# related_image は配列: [\"1段目画像あり\",\"2段目画像あり\",\"3段目画像あり\"] のうち該当するものが格納 #}
{% set img1 = related_image and (\"1段目画像あり\" in related_image) %}
{% set img2 = related_image and (\"2段目画像あり\" in related_image) %}
{% set img3 = related_image and (\"3段目画像あり\" in related_image) %}
{% set img4 = related_image and (\"4段目画像あり\" in related_image) %}
\t\t\t\t\t {% set type1 = getProduct_field(Product.id,\"related_name1\") %}
\t\t\t\t\t\t{% set type2 = getProduct_field(Product.id,\"related_name2\") %}
\t\t\t\t\t\t{% set type3 = getProduct_field(Product.id,\"related_name3\") %}
\t\t\t\t\t\t{% set type4 = getProduct_field(Product.id,\"related_name4\") %}
\t\t\t\t\t\t{% set hasRelated = (type1 and related_product1 and related_product1|length)
\t\t\t\t\t\t or (type2 and related_product2 and related_product2|length)
\t\t\t\t\t\t or (type3 and related_product3 and related_product3|length)
\t\t\t\t\t\t or (type4 and related_product4 and related_product4|length) %}
\t\t\t\t\t\t{% if hasRelated %}
\t\t\t\t\t\t <div class=\"row\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\"><label class=\"col-12 col-form-label\">この商品のタイプを選択してください。</label></div>
\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t{# ===== 1段目 ===== #}
\t\t\t\t\t\t{% if type1 and related_product1 and related_product1|length %}
\t\t\t\t\t\t<div class=\"form-group mt-3 pb-3\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t <div class=\"rp-section-label\">{{ type1 }}{% if img1 and base_select1 %}: <span>{{ base_select1 }}</span>{% endif %}</div>
\t\t\t\t\t\t {% if img1 %}
\t\t\t\t\t\t {# --- 画像付きカード --- #}
\t\t\t\t\t\t <div class=\"rp-card-group\">
\t\t\t\t\t\t {% for rp_id, rp_name in related_product1 %}
\t\t\t\t\t\t <a class=\"rp-card{% if base_select1 == rp_name %} is-selected{% endif %}\" href=\"/products/detail/{{ rp_id }}\">
\t\t\t\t\t\t <img class=\"rp-card__image\"
\t\t\t\t\t\t src=\"{{ (related_image_obj[rp_id] is defined and related_image_obj[rp_id]) ? asset(related_image_obj[rp_id], 'save_image') : asset(''|no_image_product, 'save_image') }}\"
\t\t\t\t\t\t alt=\"{{ rp_name }}\"
\t\t\t\t\t\t width=\"120\" height=\"120\" loading=\"lazy\"
\t\t\t\t\t\t onerror=\"this.style.display='none';this.nextElementSibling.style.display='flex';\">
\t\t\t\t\t\t <div class=\"rp-card__placeholder\" style=\"display:none;\">📦</div>
\t\t\t\t\t\t <span class=\"rp-card__name\">{{ rp_name }}</span>
\t\t\t\t\t\t </a>
\t\t\t\t\t\t {% endfor %}
\t\t\t\t\t\t </div>
\t\t\t\t\t\t {% else %}
\t\t\t\t\t\t {# --- ボタン式ラジオ --- #}
\t\t\t\t\t\t <div class=\"rp-btn-group\">
\t\t\t\t\t\t {% for rp_id, rp_name in related_product1 %}
\t\t\t\t\t\t <a class=\"rp-btn{% if base_select1 == rp_name %} is-selected{% endif %}\" href=\"/products/detail/{{ rp_id }}\">
\t\t\t\t\t\t {{ rp_name }}
\t\t\t\t\t\t </a>
\t\t\t\t\t\t {% endfor %}
\t\t\t\t\t\t </div>
\t\t\t\t\t\t {% endif %}
\t\t\t\t\t\t</div>
\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t{# ===== 2段目 ===== #}
\t\t\t\t\t\t{% if type2 and related_product2 and related_product2|length %}
\t\t\t\t\t\t<div class=\"form-group mt-3 pb-3\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t <div class=\"rp-section-label\">{{ type2 }}{% if img2 and base_select2 %}: <span>{{ base_select2 }}</span>{% endif %}</div>
\t\t\t\t\t\t {% if img2 %}
\t\t\t\t\t\t <div class=\"rp-card-group\">
\t\t\t\t\t\t {% for rp_id, rp_name in related_product2 %}
\t\t\t\t\t\t <a class=\"rp-card{% if base_select2 == rp_name %} is-selected{% endif %}\" href=\"/products/detail/{{ rp_id }}\">
\t\t\t\t\t\t <img class=\"rp-card__image\"
\t\t\t\t\t\t src=\"{{ (related_image_obj[rp_id] is defined and related_image_obj[rp_id]) ? asset(related_image_obj[rp_id], 'save_image') : asset(''|no_image_product, 'save_image') }}\"
\t\t\t\t\t\t alt=\"{{ rp_name }}\"
\t\t\t\t\t\t width=\"120\" height=\"120\" loading=\"lazy\"
\t\t\t\t\t\t onerror=\"this.style.display='none';this.nextElementSibling.style.display='flex';\">
\t\t\t\t\t\t <div class=\"rp-card__placeholder\" style=\"display:none;\">📦</div>
\t\t\t\t\t\t <span class=\"rp-card__name\">{{ rp_name }}</span>
\t\t\t\t\t\t </a>
\t\t\t\t\t\t {% endfor %}
\t\t\t\t\t\t </div>
\t\t\t\t\t\t {% else %}
\t\t\t\t\t\t <div class=\"rp-btn-group\">
\t\t\t\t\t\t {% for rp_id, rp_name in related_product2 %}
\t\t\t\t\t\t <a class=\"rp-btn{% if base_select2 == rp_name %} is-selected{% endif %}\" href=\"/products/detail/{{ rp_id }}\">
\t\t\t\t\t\t {{ rp_name }}
\t\t\t\t\t\t </a>
\t\t\t\t\t\t {% endfor %}
\t\t\t\t\t\t </div>
\t\t\t\t\t\t {% endif %}
\t\t\t\t\t\t</div>
\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t{# ===== 3段目 ===== #}
\t\t\t\t\t\t{% if type3 and related_product3 and related_product3|length %}
\t\t\t\t\t\t<div class=\"form-group mt-3 pb-3\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t <div class=\"rp-section-label\">{{ type3 }}{% if img3 and base_select3 %}: <span>{{ base_select3 }}</span>{% endif %}</div>
\t\t\t\t\t\t {% if img3 %}
\t\t\t\t\t\t <div class=\"rp-card-group\">
\t\t\t\t\t\t {% for rp_id, rp_name in related_product3 %}
\t\t\t\t\t\t <a class=\"rp-card{% if base_select3 == rp_name %} is-selected{% endif %}\" href=\"/products/detail/{{ rp_id }}\">
\t\t\t\t\t\t <img class=\"rp-card__image\"
\t\t\t\t\t\t src=\"{{ (related_image_obj[rp_id] is defined and related_image_obj[rp_id]) ? asset(related_image_obj[rp_id], 'save_image') : asset(''|no_image_product, 'save_image') }}\"
\t\t\t\t\t\t alt=\"{{ rp_name }}\"
\t\t\t\t\t\t width=\"120\" height=\"120\" loading=\"lazy\"
\t\t\t\t\t\t onerror=\"this.style.display='none';this.nextElementSibling.style.display='flex';\">
\t\t\t\t\t\t <div class=\"rp-card__placeholder\" style=\"display:none;\">📦</div>
\t\t\t\t\t\t <span class=\"rp-card__name\">{{ rp_name }}</span>
\t\t\t\t\t\t </a>
\t\t\t\t\t\t {% endfor %}
\t\t\t\t\t\t </div>
\t\t\t\t\t\t {% else %}
\t\t\t\t\t\t <div class=\"rp-btn-group\">
\t\t\t\t\t\t {% for rp_id, rp_name in related_product3 %}
\t\t\t\t\t\t <a class=\"rp-btn{% if base_select3 == rp_name %} is-selected{% endif %}\" href=\"/products/detail/{{ rp_id }}\">
\t\t\t\t\t\t {{ rp_name }}
\t\t\t\t\t\t </a>
\t\t\t\t\t\t {% endfor %}
\t\t\t\t\t\t </div>
\t\t\t\t\t\t {% endif %}
\t\t\t\t\t\t</div>
\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t{# ===== 4段目 ===== #}
\t\t\t\t\t\t{% if type4 and related_product4 and related_product4|length %}
\t\t\t\t\t\t<div class=\"form-group mt-3 pb-3\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t <div class=\"rp-section-label\">{{ type4 }}{% if img4 and base_select4 %}: <span>{{ base_select4 }}</span>{% endif %}</div>
\t\t\t\t\t\t {% if img4 %}
\t\t\t\t\t\t {# --- 画像付きカード --- #}
\t\t\t\t\t\t <div class=\"rp-card-group\">
\t\t\t\t\t\t {% for rp_id, rp_name in related_product4 %}
\t\t\t\t\t\t <a class=\"rp-card{% if base_select4 == rp_name %} is-selected{% endif %}\" href=\"/products/detail/{{ rp_id }}\">
\t\t\t\t\t\t <img class=\"rp-card__image\"
\t\t\t\t\t\t src=\"{{ (related_image_obj[rp_id] is defined and related_image_obj[rp_id]) ? asset(related_image_obj[rp_id], 'save_image') : asset(''|no_image_product, 'save_image') }}\"
\t\t\t\t\t\t alt=\"{{ rp_name }}\" width=\"120\" height=\"120\" loading=\"lazy\">
\t\t\t\t\t\t <span class=\"rp-card__label\">{{ rp_name }}</span>
\t\t\t\t\t\t </a>
\t\t\t\t\t\t {% endfor %}
\t\t\t\t\t\t </div>
\t\t\t\t\t\t {% else %}
\t\t\t\t\t\t {# --- ボタン式ラジオ --- #}
\t\t\t\t\t\t <div class=\"rp-btn-group\">
\t\t\t\t\t\t {% for rp_id, rp_name in related_product4 %}
\t\t\t\t\t\t <a class=\"rp-btn{% if base_select4 == rp_name %} is-selected{% endif %}\" href=\"/products/detail/{{ rp_id }}\">
\t\t\t\t\t\t {{ rp_name }}
\t\t\t\t\t\t </a>
\t\t\t\t\t\t {% endfor %}
\t\t\t\t\t\t </div>
\t\t\t\t\t\t {% endif %}
\t\t\t\t\t\t</div>
\t\t\t\t\t\t{% endif %}
\t\t\t\t\t {# ガレージ等で全オプション空のときに見出しのみ表示される事象を回避.
\t\t\t\t\t 色 / 寸法 / 素材 / option1/2 / op_data いずれかに「描画される」要素がある場合のみ
\t\t\t\t\t 「この商品のオプションを選択してください。」見出しを表示する.
\t\t\t\t\t op_data は cg=9 で「残土」 / gs=27 で「撤去」「残土」を後段ループで
\t\t\t\t\t hide するため、単純な op|length > 0 では「見出しだけ残る」事象が
\t\t\t\t\t wh / cg の一部商品で発生していた. 描画される entry を事前カウントする. #}
\t\t\t\t\t {% set is_gs_h = false %}
\t\t\t\t\t {% set is_cg_h = false %}
\t\t\t\t\t {% if Product.ProductCategories is not empty %}
\t\t\t\t\t {% for pc_h in Product.ProductCategories %}
\t\t\t\t\t {% if pc_h.category_id == 27 %}{% set is_gs_h = true %}{% endif %}
\t\t\t\t\t {% if pc_h.category_id == 9 %}{% set is_cg_h = true %}{% endif %}
\t\t\t\t\t {% endfor %}
\t\t\t\t\t {% endif %}
\t\t\t\t\t {% set visible_op_count = 0 %}
\t\t\t\t\t {% if op and op|length %}
\t\t\t\t\t {% for opi in op %}
\t\t\t\t\t {% if opi['name'] %}
\t\t\t\t\t {% set _hide_h = false %}
\t\t\t\t\t {% if is_gs_h and (opi['name'] matches '/撤去/' or opi['name'] matches '/残土/') %}{% set _hide_h = true %}{% endif %}
\t\t\t\t\t {% if is_cg_h and opi['name'] matches '/残土/' %}{% set _hide_h = true %}{% endif %}
\t\t\t\t\t {% if not _hide_h %}{% set visible_op_count = visible_op_count + 1 %}{% endif %}
\t\t\t\t\t {% endif %}
\t\t\t\t\t {% endfor %}
\t\t\t\t\t {% endif %}
\t\t\t\t\t {% set has_any_option =
\t\t\t\t\t (color and color|length and ProductClass.SaleType.id != 3)
\t\t\t\t\t or (p_w and p_w|length and p_w|join != \"\")
\t\t\t\t\t or (p_d and p_d|length and p_d|join != \"\")
\t\t\t\t\t or (p_h and p_h|length and p_h|join != \"\")
\t\t\t\t\t or (p_m and p_m|length and p_m|join != \"\")
\t\t\t\t\t or (p_option1 and p_option1|length and p_option1|join != \"\")
\t\t\t\t\t or (p_option2 and p_option2|length and p_option2|join != \"\")
\t\t\t\t\t or ProductClass.SaleType.id in [2, 5, 6, 7, 9]
\t\t\t\t\t %}
\t\t\t\t\t {% if has_any_option %}
\t\t\t\t\t <div class=\"row\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\"><label class=\"col-12 col-form-label\">この商品のオプションを選択してください。</label></div>
\t\t\t\t\t {% endif %}
{# sale_type=2 (補助金窓) はタイプごとに個別カラー選択するため共通カラーは非表示 #}
{% if color and color|length and ProductClass.SaleType.id != 3 and ProductClass.SaleType.id != 2 %}
<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
<div class=\"rp-section-label\">カラー{% if mitsumori_json and mitsumori_json.pc %}: <span>{{ mitsumori_json.pc }}</span>{% endif %}</div>
<div class=\"opt-btn-group\">
{% set idx = 0 %}
{% for cc in color %}{% if cc and cc['name'] %}{% set idx = idx + 1 %}
{% set has_img = cc['img'] is defined and cc['img'] is not empty %}
<label class=\"opt-btn{% if has_img %} opt-btn--with-image{% endif %}{% if (mitsumori_json and mitsumori_json.pc == cc['name']) or color|length == 1 %} is-selected{% endif %}\"
onclick=\"mitsumori_simulation_val('pc', '{{ cc['name']|e('js') }}');\">
<input type=\"radio\" name=\"color\" id=\"cc_{{ idx }}\" value=\"{{ cc['name'] }}\"
{% if (mitsumori_json and mitsumori_json.pc == cc['name']) or color|length == 1 %}checked{% endif %}>
{% if has_img %}
<img src=\"{{ cc['img'] }}\" alt=\"{{ cc['name'] }}\" class=\"opt-btn__img\"
onerror=\"this.parentNode.classList.remove('opt-btn--with-image'); this.remove();\">
<span class=\"opt-btn__name\">{{ cc['name'] }}</span>
{% else %}
{{ cc['name'] }}
{% endif %}
</label>
{% endif %}{% endfor %}
</div>
</div>
{% endif %}
{# sale_type=2 (補助金窓) はタイプごとに個別幅選択するため共通幅は非表示.
tf (人工芝, sale_type=6) は専用の「芝の幅」+「施工サイズ」UI を下部に持つため、
汎用の 幅/奥行/高さ は描画しない (両方出すと name=\"pw\"/\"ph\" が重複し、
片方を選ぶともう片方の選択が外れる顧客指摘あり). #}
{% if p_w and p_w|length and p_w|join != \"\" and ProductClass.SaleType.id not in [2, 3, 6] %}
<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
<div class=\"rp-section-label\">幅{% if mitsumori_json and mitsumori_json.pw %}: <span>{{ mitsumori_json.pw }}</span>{% endif %}</div>
<div class=\"opt-btn-group\">
{% set idx = 0 %}
{% for pw in p_w %}{% if pw %}{% set idx = idx + 1 %}
<label class=\"opt-btn{% if (mitsumori_json and mitsumori_json.pw == pw) or p_w|length == 1 %} is-selected{% endif %}\"
onclick=\"mitsumori_simulation_val('pw', '{{ pw|e('js') }}');\">
<input type=\"radio\" name=\"pw\" id=\"pw_{{ idx }}\" value=\"{{ pw }}\"
{% if (mitsumori_json and mitsumori_json.pw == pw) or p_w|length == 1 %}checked{% endif %}>
{{ pw }}
</label>
{% endif %}{% endfor %}
</div>
</div>
{% endif %}
{% if p_d and p_d|length and p_d|join != \"\" and ProductClass.SaleType.id not in [3, 6] %}
<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
<div class=\"rp-section-label\">奥行き{% if mitsumori_json and mitsumori_json.pd %}: <span>{{ mitsumori_json.pd }}</span>{% endif %}</div>
<div class=\"opt-btn-group\">
{% set idx = 0 %}
{% for pd in p_d %}{% if pd %}{% set idx = idx + 1 %}
<label class=\"opt-btn{% if (mitsumori_json and mitsumori_json.pd == pd) or p_d|length == 1 %} is-selected{% endif %}\"
onclick=\"mitsumori_simulation_val('pd', '{{ pd|e('js') }}');\">
<input type=\"radio\" name=\"pd\" id=\"pd_{{ idx }}\" value=\"{{ pd }}\"
{% if (mitsumori_json and mitsumori_json.pd == pd) or p_d|length == 1 %}checked{% endif %}>
{{ pd }}
</label>
{% endif %}{% endfor %}
</div>
</div>
{% endif %}
{# sale_type=2 (補助金窓) はタイプごとに個別高さ選択するため共通高さは非表示.
sale_type=6 (人工芝) は専用 UI なので汎用高さは描画しない. #}
{% if p_h and p_h|length and p_h|join != \"\" and ProductClass.SaleType.id not in [2, 3, 6] %}
<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
<div class=\"rp-section-label\">高さ{% if mitsumori_json and mitsumori_json.ph %}: <span>{{ mitsumori_json.ph }}</span>{% endif %}</div>
<div class=\"opt-btn-group\">
{% set idx = 0 %}
{% for ph in p_h %}{% if ph %}{% set idx = idx + 1 %}
<label class=\"opt-btn{% if (mitsumori_json and mitsumori_json.ph == ph) or p_h|length == 1 %} is-selected{% endif %}\"
onclick=\"mitsumori_simulation_val('ph', '{{ ph|e('js') }}');\">
<input type=\"radio\" name=\"ph\" id=\"ph_{{ idx }}\" value=\"{{ ph }}\"
{% if (mitsumori_json and mitsumori_json.ph == ph) or p_h|length == 1 %}checked{% endif %}>
{{ ph }}
</label>
{% endif %}{% endfor %}
</div>
</div>
{% endif %}
{# sale_type=2 (補助金窓) はタイプごとに個別ガラス選択するため共通素材は非表示 #}
{% if p_m and p_m|length and p_m|join != \"\" and ProductClass.SaleType.id != 3 and ProductClass.SaleType.id != 2 %}
<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
<div class=\"rp-section-label\">{% if is_cat43 %}開き方{% else %}{{ pm_label }}{% endif %}{% if mitsumori_json and mitsumori_json.pm %}: <span>{{ mitsumori_json.pm }}</span>{% endif %}</div>
<div class=\"opt-btn-group\">
{% set idx = 0 %}
{% for pm in p_m %}{% if pm %}{% set idx = idx + 1 %}
<label class=\"opt-btn{% if (mitsumori_json and mitsumori_json.pm == pm) or p_m|length == 1 %} is-selected{% endif %}\"
onclick=\"mitsumori_simulation_val('pm', '{{ pm|e('js') }}');\">
<input type=\"radio\" name=\"pm\" id=\"pm_{{ idx }}\" value=\"{{ pm }}\"
{% if (mitsumori_json and mitsumori_json.pm == pm) or p_m|length == 1 %}checked{% endif %}>
{{ pm }}
</label>
{% endif %}{% endfor %}
</div>
</div>
{% endif %}
{# option1 (sale_type 2 は専用 UI が下にあるため除外 / sale_type 3 は下部ブロックで描画 /
sale_type 4 = fe・ts は option1 が ct_unit_price (枚数増分の工事費単価) で
ユーザー選択肢ではなく計算用の内部値のため radio として表示しない. 値は
上の auto-init (p_option1|length == 1) で JS の option1 変数に埋め込み済み) #}
{% if p_option1 and p_option1|length and p_option1|join != \"\" and ProductClass.SaleType.id != 2 and ProductClass.SaleType.id != 3 and ProductClass.SaleType.id != 4 and not is_cat43 and not is_cp %}
<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
<div class=\"rp-section-label\">{{ option1_label }}{% if mitsumori_json and mitsumori_json.option1 is defined and mitsumori_json.option1 %}: <span>{{ mitsumori_json.option1 }}</span>{% endif %}</div>
<div class=\"opt-btn-group\">
{% set idx = 0 %}
{% for opt1 in p_option1 %}{% if opt1 %}{% set idx = idx + 1 %}
<label class=\"opt-btn{% if (mitsumori_json and mitsumori_json.option1 is defined and mitsumori_json.option1 == opt1) or p_option1|length == 1 %} is-selected{% endif %}\"
onclick=\"mitsumori_simulation_val('option1', '{{ opt1|e('js') }}');\">
<input type=\"radio\" name=\"option1\" id=\"option1_{{ idx }}\" value=\"{{ opt1 }}\"
{% if (mitsumori_json and mitsumori_json.option1 is defined and mitsumori_json.option1 == opt1) or p_option1|length == 1 %}checked{% endif %}>
{{ opt1 }}
</label>
{% endif %}{% endfor %}
</div>
</div>
{% endif %}
{# option2 #}
{% if p_option2 and p_option2|length and p_option2|join != \"\" and ProductClass.SaleType.id != 2 and ProductClass.SaleType.id != 3 and not is_cat43 %}
<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
<div class=\"rp-section-label\">{{ option2_label }}{% if mitsumori_json and mitsumori_json.option2 is defined and mitsumori_json.option2 %}: <span>{{ mitsumori_json.option2 }}</span>{% endif %}</div>
<div class=\"opt-btn-group\">
{% set idx = 0 %}
{% for opt2 in p_option2 %}{% if opt2 %}{% set idx = idx + 1 %}
<label class=\"opt-btn{% if (mitsumori_json and mitsumori_json.option2 is defined and mitsumori_json.option2 == opt2) or p_option2|length == 1 %} is-selected{% endif %}\"
onclick=\"mitsumori_simulation_val('option2', '{{ opt2|e('js') }}');\">
<input type=\"radio\" name=\"option2\" id=\"option2_{{ idx }}\" value=\"{{ opt2 }}\"
{% if (mitsumori_json and mitsumori_json.option2 is defined and mitsumori_json.option2 == opt2) or p_option2|length == 1 %}checked{% endif %}>
{{ opt2 }}
</label>
{% endif %}{% endfor %}
</div>
</div>
{% endif %}
\t\t\t\t\t\t<!-- 1: 施工見積(通常) → 幅/奥行/高さ/素材/カラーは上部の共通ブロックで表示済み -->
\t\t\t\t\t\t{% if ProductClass.SaleType.id == 1 %}
\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t<!-- 2: 施工見積(補助金・窓) 複数タイプ追加対応 (2026-05) -->
\t\t\t\t\t\t{% if ProductClass.SaleType.id == 2 %}
\t\t\t\t\t\t\t{# 2026-05 改修: ex-shop プラメイク方式に倣い、1 商品で
\t\t\t\t\t\t\t 複数の「窓タイプ」(subtype × 幅 × 高さ × ガラス × カラー × セット数)
\t\t\t\t\t\t\t を追加できる UI に変更. 各タイプは内訳 JSON として 1 明細にまとめる. #}
\t\t\t\t\t\t\t{# ec-productRole__profile は標準テンプレで height:600px / overflow:auto
\t\t\t\t\t\t\t が当たっており、複数タイプ追加カードが内部スクロールに押し込まれて
\t\t\t\t\t\t\t 見えない. sale_type=2 のときだけ縦方向に伸ばす. #}
\t\t\t\t\t\t\t<style>
\t\t\t\t\t\t\t\t.ec-productRole__profile {
\t\t\t\t\t\t\t\t\toverflow: visible !important;
\t\t\t\t\t\t\t\t\tmax-height: none !important;
\t\t\t\t\t\t\t\t\theight: auto !important;
\t\t\t\t\t\t\t\t}
\t\t\t\t\t\t\t</style>
\t\t\t\t\t\t\t{# 住宅区分 UI: 補助金単価が戸建 / 集合住宅で異なるためお客様に申告いただく. #}
\t\t\t\t\t\t\t{% set housing_default = getProduct_field(Product.id, '住宅区分')|default('戸建') %}
\t\t\t\t\t\t\t<div class=\"card mt-3 mb-3\">
\t\t\t\t\t\t\t <div class=\"card-header\" style=\"background:#fff3cd;color:#333;\">
\t\t\t\t\t\t\t <strong>お住まいの種別を選択</strong>
\t\t\t\t\t\t\t <small class=\"ms-2 text-muted\">補助金単価が変わります</small>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t <div class=\"card-body p-2\">
\t\t\t\t\t\t\t <div class=\"opt-btn-group\" id=\"window-housing-type-group\">
\t\t\t\t\t\t\t <label class=\"opt-btn\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"window_housing_type\" value=\"戸建\"
\t\t\t\t\t\t\t {% if housing_default != '集合住宅' %}checked{% endif %}>
\t\t\t\t\t\t\t 戸建住宅<small class=\"d-block text-muted\">(延床240㎡以下の非住宅含む)</small>
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t <label class=\"opt-btn\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"window_housing_type\" value=\"集合住宅\"
\t\t\t\t\t\t\t {% if housing_default == '集合住宅' %}checked{% endif %}>
\t\t\t\t\t\t\t 集合住宅<small class=\"d-block text-muted\">(低層・中高層/240㎡超の非住宅)</small>
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t<div class=\"card mt-3 mb-3\">
\t\t\t\t\t\t\t <div class=\"card-header\" style=\"background:#fff3cd;color:#333;\">
\t\t\t\t\t\t\t <strong>窓タイプを選択(複数追加可・最大 20)</strong>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t <div class=\"card-body p-2\">
\t\t\t\t\t\t\t {# (b) 補助金5万円要件の常設明示。各窓の補助金額はブロック内に常時表示。 #}
\t\t\t\t\t\t\t <p class=\"subsidy-eligibility-note\">※先進的窓リノベ2026の補助金は、各窓の補助金額の<strong>合計が5万円以上</strong>で適用されます。各窓ごとの補助金額は下に常時表示しています。</p>
\t\t\t\t\t\t\t <div id=\"window-types-container\"><!-- 動的に窓タイプブロックが追加される --></div>
\t\t\t\t\t\t\t <div class=\"text-center mt-2\">
\t\t\t\t\t\t\t <button type=\"button\" id=\"btn-add-window-type\" class=\"btn btn-outline-primary btn-sm\" onclick=\"addWindowType();\">+ 窓タイプを追加</button>
\t\t\t\t\t\t\t <div class=\"small text-muted mt-1\">最大 20 タイプまで追加できます</div>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t{# 窓タイプブロックのテンプレート. __IDX__ を JS で連番に置換して clone する. #}
\t\t\t\t\t\t\t<template id=\"window-type-template\">
\t\t\t\t\t\t\t <div class=\"window-type-block\" data-type-idx=\"__IDX__\" style=\"border:1px solid #ddd;border-radius:6px;padding:10px;margin-bottom:10px;background:#fafafa;\">
\t\t\t\t\t\t\t <div class=\"d-flex justify-content-between align-items-center mb-2\">
\t\t\t\t\t\t\t <strong>窓タイプ <span class=\"wt-num\">__IDX__</span></strong>
\t\t\t\t\t\t\t <button type=\"button\" class=\"btn btn-sm btn-outline-danger btn-remove-window-type\" onclick=\"removeWindowType(this);\">× 削除</button>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t {# 窓タイプ (subtype) #}
\t\t\t\t\t\t\t {% if p_option1 and p_option1|length and p_option1|join != \"\" %}
\t\t\t\t\t\t\t <div class=\"form-group mt-2 pb-2\" style=\"border-bottom:1px dashed rgba(0,0,0,.1)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">窓タイプ</div>
\t\t\t\t\t\t\t <div class=\"opt-btn-group\">
\t\t\t\t\t\t\t {% for v in p_option1 %}{% if v %}
\t\t\t\t\t\t\t <label class=\"opt-btn\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"wt_subtype___IDX__\" value=\"{{ v }}\" data-axis=\"subtype\" onchange=\"onWindowTypeAxisChange(this);\">
\t\t\t\t\t\t\t {{ v }}
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t {% endif %}{% endfor %}
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t {% endif %}
\t\t\t\t\t\t\t {# 幅 (mm 直接入力) #}
\t\t\t\t\t\t\t {% if p_w and p_w|length and p_w|join != \"\" %}
\t\t\t\t\t\t\t <div class=\"form-group mt-2 pb-2\" style=\"border-bottom:1px dashed rgba(0,0,0,.1)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">幅</div>
\t\t\t\t\t\t\t <div class=\"input-group\" style=\"max-width:240px;\">
\t\t\t\t\t\t\t <input type=\"number\" name=\"wt_pw___IDX__\" class=\"form-control\" min=\"100\" step=\"10\"
\t\t\t\t\t\t\t placeholder=\"例 1750\" data-axis=\"pw\" data-unit=\"mm\"
\t\t\t\t\t\t\t oninput=\"onWindowTypeAxisChange(this);\">
\t\t\t\t\t\t\t <span class=\"input-group-text\">mm</span>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t <small class=\"text-muted\">商品の対応幅: 〜{{ (p_w|last)|default('') }}({{ p_w|length }} 段階の価格帯から自動選択)</small>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t {% endif %}
\t\t\t\t\t\t\t {# 高さ (mm 直接入力) #}
\t\t\t\t\t\t\t {% if p_h and p_h|length and p_h|join != \"\" %}
\t\t\t\t\t\t\t <div class=\"form-group mt-2 pb-2\" style=\"border-bottom:1px dashed rgba(0,0,0,.1)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">高さ</div>
\t\t\t\t\t\t\t <div class=\"input-group\" style=\"max-width:240px;\">
\t\t\t\t\t\t\t <input type=\"number\" name=\"wt_ph___IDX__\" class=\"form-control\" min=\"100\" step=\"10\"
\t\t\t\t\t\t\t placeholder=\"例 1200\" data-axis=\"ph\" data-unit=\"mm\"
\t\t\t\t\t\t\t oninput=\"onWindowTypeAxisChange(this);\">
\t\t\t\t\t\t\t <span class=\"input-group-text\">mm</span>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t <small class=\"text-muted\">商品の対応高さ: 〜{{ (p_h|last)|default('') }}({{ p_h|length }} 段階の価格帯から自動選択)</small>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t {% endif %}
\t\t\t\t\t\t\t {# ガラスタイプ #}
\t\t\t\t\t\t\t {% if p_m and p_m|length and p_m|join != \"\" %}
\t\t\t\t\t\t\t <div class=\"form-group mt-2 pb-2\" style=\"border-bottom:1px dashed rgba(0,0,0,.1)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">ガラスタイプ</div>
\t\t\t\t\t\t\t {# A-3: 内窓ガラス名は長い(例 ~449px)。横スクロール(is-scroll)化すると
\t\t\t\t\t\t\t 左が見切れるため no-hscroll で縦積み+折り返し表示に固定する。 #}
\t\t\t\t\t\t\t <div class=\"opt-btn-group no-hscroll\">
\t\t\t\t\t\t\t {% for v in p_m %}{% if v %}
\t\t\t\t\t\t\t <label class=\"opt-btn\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"wt_pm___IDX__\" value=\"{{ v }}\" data-axis=\"pm\" onchange=\"onWindowTypeAxisChange(this);\">
\t\t\t\t\t\t\t {{ v }}
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t {% endif %}{% endfor %}
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t <small class=\"text-muted\">「<span style=\"color:#2e7d32;font-weight:bold;\">補助金対象</span>」が付いたガラスは、先進的窓リノベ補助金の対象です。</small>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t {% endif %}
\t\t\t\t\t\t\t {# 窓枠カラー #}
\t\t\t\t\t\t\t {% if color and color|length %}
\t\t\t\t\t\t\t <div class=\"form-group mt-2 pb-2\" style=\"border-bottom:1px dashed rgba(0,0,0,.1)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">窓枠カラー</div>
\t\t\t\t\t\t\t <div class=\"opt-btn-group\">
\t\t\t\t\t\t\t {% for cc in color %}{% if cc and cc['name'] %}
\t\t\t\t\t\t\t {% set has_img = cc['img'] is defined and cc['img'] is not empty %}
\t\t\t\t\t\t\t <label class=\"opt-btn{% if has_img %} opt-btn--with-image{% endif %}\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"wt_pc___IDX__\" value=\"{{ cc['name'] }}\" data-axis=\"pc\" onchange=\"onWindowTypeAxisChange(this);\">
\t\t\t\t\t\t\t {% if has_img %}
\t\t\t\t\t\t\t <img src=\"{{ cc['img'] }}\" alt=\"{{ cc['name'] }}\" class=\"opt-btn__img\"
\t\t\t\t\t\t\t onerror=\"this.parentNode.classList.remove('opt-btn--with-image'); this.remove();\">
\t\t\t\t\t\t\t <span class=\"opt-btn__name\">{{ cc['name'] }}</span>
\t\t\t\t\t\t\t {% else %}
\t\t\t\t\t\t\t {{ cc['name'] }}
\t\t\t\t\t\t\t {% endif %}
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t {% endif %}{% endfor %}
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t {% endif %}
\t\t\t\t\t\t\t {# セット数 + タイプごとの補助金額表示 (補助金は task 2 で実計算) #}
\t\t\t\t\t\t\t <div class=\"form-group row mt-2 align-items-center\">
\t\t\t\t\t\t\t <label class=\"col-4 col-form-label\">セット数</label>
\t\t\t\t\t\t\t <div class=\"col-4\">
\t\t\t\t\t\t\t <div class=\"input-group\">
\t\t\t\t\t\t\t <input type=\"number\" name=\"wt_setqty___IDX__\" class=\"form-control wt-input-setqty\" value=\"1\" min=\"1\" max=\"99\" data-axis=\"setqty\" onchange=\"onWindowTypeAxisChange(this);\">
\t\t\t\t\t\t\t <span class=\"input-group-text\">セット</span>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t <div class=\"col-4 text-end\">
\t\t\t\t\t\t\t <span class=\"wt-subsidy-label\">補助金額</span><br><span class=\"wt-subsidy-amount\">―</span> <span class=\"wt-subsidy-label\">円</span>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</template>
\t\t\t\t\t\t\t{# 複数タイプ管理 JS. addWindowType / removeWindowType / 再番号付け. #}
\t\t\t\t\t\t\t<script>
\t\t\t\t\t\t\t(function() {
\t\t\t\t\t\t\t\tvar MAX_WINDOW_TYPES = 20;
\t\t\t\t\t\t\t\tfunction addWindowType() {
\t\t\t\t\t\t\t\t\tvar container = document.getElementById('window-types-container');
\t\t\t\t\t\t\t\t\tif (!container) return;
\t\t\t\t\t\t\t\t\tvar existing = container.querySelectorAll('.window-type-block');
\t\t\t\t\t\t\t\t\tif (existing.length >= MAX_WINDOW_TYPES) return;
\t\t\t\t\t\t\t\t\tvar newIdx = existing.length + 1;
\t\t\t\t\t\t\t\t\tvar tpl = document.getElementById('window-type-template');
\t\t\t\t\t\t\t\t\tif (!tpl) return;
\t\t\t\t\t\t\t\t\t// <template> の innerHTML を取り出して __IDX__ を新規連番に置換し、要素化して append.
\t\t\t\t\t\t\t\t\tvar html = tpl.innerHTML.replace(/__IDX__/g, String(newIdx));
\t\t\t\t\t\t\t\t\tvar wrapper = document.createElement('div');
\t\t\t\t\t\t\t\t\twrapper.innerHTML = html.trim();
\t\t\t\t\t\t\t\t\tvar block = wrapper.firstChild;
\t\t\t\t\t\t\t\t\tcontainer.appendChild(block);
\t\t\t\t\t\t\t\t\tdecorateSubsidyGlass(block);
\t\t\t\t\t\t\t\t\tupdateRemoveButtonVisibility();
\t\t\t\t\t\t\t\t\tif (typeof recalcAll === 'function') recalcAll();
\t\t\t\t\t\t\t\t}
\t\t\t\t\t\t\t\t// 補助金対象ガラスの選択肢に「補助金対象」バッジ + 緑枠を付与する.
\t\t\t\t\t\t\t\t// 判定は calc script 側の window.glassYieldsSubsidy に委譲 (ロジック二重化を避ける)。
\t\t\t\t\t\t\t\tfunction decorateSubsidyGlass(block) {
\t\t\t\t\t\t\t\t\tif (!block || typeof window.glassYieldsSubsidy !== 'function') return;
\t\t\t\t\t\t\t\t\tvar radios = block.querySelectorAll('input[data-axis=\"pm\"]');
\t\t\t\t\t\t\t\t\tradios.forEach(function(inp) {
\t\t\t\t\t\t\t\t\t\tvar label = inp.closest('.opt-btn');
\t\t\t\t\t\t\t\t\t\tif (!label || label.querySelector('.opt-btn__subsidy-badge')) return;
\t\t\t\t\t\t\t\t\t\tif (window.glassYieldsSubsidy(inp.value)) {
\t\t\t\t\t\t\t\t\t\t\tlabel.classList.add('opt-btn--subsidy');
\t\t\t\t\t\t\t\t\t\t\tvar badge = document.createElement('span');
\t\t\t\t\t\t\t\t\t\t\tbadge.className = 'opt-btn__subsidy-badge';
\t\t\t\t\t\t\t\t\t\t\tbadge.textContent = '補助金対象';
\t\t\t\t\t\t\t\t\t\t\tlabel.appendChild(badge);
\t\t\t\t\t\t\t\t\t\t}
\t\t\t\t\t\t\t\t\t});
\t\t\t\t\t\t\t\t}
\t\t\t\t\t\t\t\tfunction removeWindowType(btn) {
\t\t\t\t\t\t\t\t\tvar block = btn.closest('.window-type-block');
\t\t\t\t\t\t\t\t\tif (!block) return;
\t\t\t\t\t\t\t\t\tblock.remove();
\t\t\t\t\t\t\t\t\treindexBlocks();
\t\t\t\t\t\t\t\t\tupdateRemoveButtonVisibility();
\t\t\t\t\t\t\t\t\tif (typeof recalcAll === 'function') recalcAll();
\t\t\t\t\t\t\t\t}
\t\t\t\t\t\t\t\tfunction updateRemoveButtonVisibility() {
\t\t\t\t\t\t\t\t\tvar blocks = document.querySelectorAll('#window-types-container .window-type-block');
\t\t\t\t\t\t\t\t\tblocks.forEach(function(b) {
\t\t\t\t\t\t\t\t\t\tvar btn = b.querySelector('.btn-remove-window-type');
\t\t\t\t\t\t\t\t\t\tif (btn) btn.style.display = blocks.length > 1 ? '' : 'none';
\t\t\t\t\t\t\t\t\t});
\t\t\t\t\t\t\t\t}
\t\t\t\t\t\t\t\tfunction reindexBlocks() {
\t\t\t\t\t\t\t\t\t// ブロック削除後に 1 から振り直し. input[name] の末尾 _N も書き換える.
\t\t\t\t\t\t\t\t\tvar blocks = document.querySelectorAll('#window-types-container .window-type-block');
\t\t\t\t\t\t\t\t\tblocks.forEach(function(b, i) {
\t\t\t\t\t\t\t\t\t\tvar n = i + 1;
\t\t\t\t\t\t\t\t\t\tb.setAttribute('data-type-idx', String(n));
\t\t\t\t\t\t\t\t\t\tvar numSpan = b.querySelector('.wt-num');
\t\t\t\t\t\t\t\t\t\tif (numSpan) numSpan.textContent = String(n);
\t\t\t\t\t\t\t\t\t\tb.querySelectorAll('input[name]').forEach(function(inp) {
\t\t\t\t\t\t\t\t\t\t\tinp.name = inp.name.replace(/_\\d+\$/, '_' + n);
\t\t\t\t\t\t\t\t\t\t});
\t\t\t\t\t\t\t\t\t});
\t\t\t\t\t\t\t\t}
\t\t\t\t\t\t\t\t// 軸変更イベント. recalcAll が定義されていれば再計算 (task 2 で実装).
\t\t\t\t\t\t\t\twindow.onWindowTypeAxisChange = function() {
\t\t\t\t\t\t\t\t\tif (typeof recalcAll === 'function') recalcAll();
\t\t\t\t\t\t\t\t};
\t\t\t\t\t\t\t\twindow.addWindowType = addWindowType;
\t\t\t\t\t\t\t\twindow.removeWindowType = removeWindowType;
\t\t\t\t\t\t\t\t// 隠し radio(opacity:0/pointer-events:none) を label で包む opt-btn は iOS で初回タップの
\t\t\t\t\t\t\t\t// change が不発になりやすい。窓タイプ/住宅区分は label に onclick が無く change 依存だった
\t\t\t\t\t\t\t\t// ため「2回タッチ/選択できない」が発生。click は確実に発火するので委譲 click で選択状態・
\t\t\t\t\t\t\t\t// is-selected・再計算を行う(JSで複製される窓タイプにも委譲で対応)。
\t\t\t\t\t\t\t\tdocument.addEventListener('click', function(ev) {
\t\t\t\t\t\t\t\t\tif (!ev.target || !ev.target.closest) return;
\t\t\t\t\t\t\t\t\tvar label = ev.target.closest('.opt-btn');
\t\t\t\t\t\t\t\t\tif (!label) return;
\t\t\t\t\t\t\t\t\tif (!label.closest('#window-types-container') && !label.closest('#window-housing-type-group')) return;
\t\t\t\t\t\t\t\t\tvar input = label.querySelector('input[type=\"radio\"]');
\t\t\t\t\t\t\t\t\tif (!input || input.disabled) return;
\t\t\t\t\t\t\t\t\tinput.checked = true;
\t\t\t\t\t\t\t\t\tvar nm = input.getAttribute('name');
\t\t\t\t\t\t\t\t\tif (nm) {
\t\t\t\t\t\t\t\t\t\tdocument.querySelectorAll('input[name=\"' + nm + '\"]').forEach(function(i) {
\t\t\t\t\t\t\t\t\t\t\tvar l = i.closest('.opt-btn');
\t\t\t\t\t\t\t\t\t\t\tif (l) l.classList.toggle('is-selected', i.checked);
\t\t\t\t\t\t\t\t\t\t});
\t\t\t\t\t\t\t\t\t}
\t\t\t\t\t\t\t\t\tif (typeof recalcAll === 'function') recalcAll();
\t\t\t\t\t\t\t\t});
\t\t\t\t\t\t\t\t// 初期表示で 1 ブロック追加 + 住宅区分ラジオの change で再計算.
\t\t\t\t\t\t\t\tdocument.addEventListener('DOMContentLoaded', function() {
\t\t\t\t\t\t\t\t\tif (document.querySelector('#window-types-container')) {
\t\t\t\t\t\t\t\t\t\taddWindowType();
\t\t\t\t\t\t\t\t\t}
\t\t\t\t\t\t\t\t\tvar housingInputs = document.querySelectorAll('input[name=\"window_housing_type\"]');
\t\t\t\t\t\t\t\t\tvar syncHousingSelectedClass = function() {
\t\t\t\t\t\t\t\t\t\thousingInputs.forEach(function(el) {
\t\t\t\t\t\t\t\t\t\t\tvar lbl = el.closest('.opt-btn');
\t\t\t\t\t\t\t\t\t\t\tif (!lbl) return;
\t\t\t\t\t\t\t\t\t\t\tif (el.checked) lbl.classList.add('is-selected');
\t\t\t\t\t\t\t\t\t\t\telse lbl.classList.remove('is-selected');
\t\t\t\t\t\t\t\t\t\t});
\t\t\t\t\t\t\t\t\t};
\t\t\t\t\t\t\t\t\tsyncHousingSelectedClass();
\t\t\t\t\t\t\t\t\thousingInputs.forEach(function(el) {
\t\t\t\t\t\t\t\t\t\tel.addEventListener('change', function() {
\t\t\t\t\t\t\t\t\t\t\tsyncHousingSelectedClass();
\t\t\t\t\t\t\t\t\t\t\tif (typeof recalcAll === 'function') recalcAll();
\t\t\t\t\t\t\t\t\t\t});
\t\t\t\t\t\t\t\t\t});
\t\t\t\t\t\t\t\t});
\t\t\t\t\t\t\t})();
\t\t\t\t\t\t\t</script>
\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t<!-- 3: 施工見積(物置・ゴミステーション) -->
\t\t\t\t\t\t{% if ProductClass.SaleType.id == 3 %}
\t\t\t\t\t\t\t{# 幅・奥行き・高さ(p_w/p_d/p_h からボタン型ラジオ生成) #}
\t\t\t\t\t\t\t{% if p_w and p_w|length and p_w|join != \"\" %}
\t\t\t\t\t\t\t<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">幅{% if mitsumori_json and mitsumori_json.pw %}: <span>{{ mitsumori_json.pw }}</span>{% endif %}</div>
\t\t\t\t\t\t\t <div class=\"opt-btn-group\">
\t\t\t\t\t\t\t {% set idx = 0 %}
\t\t\t\t\t\t\t {% for pw_val in p_w %}{% if pw_val %}{% set idx = idx + 1 %}
\t\t\t\t\t\t\t <label class=\"opt-btn{% if (mitsumori_json and mitsumori_json.pw == pw_val) or p_w|length == 1 %} is-selected{% endif %}\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('pw','pw3_{{ idx }}');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"pw\" id=\"pw3_{{ idx }}\" value=\"{{ pw_val }}\"
\t\t\t\t\t\t\t {% if (mitsumori_json and mitsumori_json.pw == pw_val) or p_w|length == 1 %}checked{% endif %}>
\t\t\t\t\t\t\t {{ pw_val }}
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t {% endif %}{% endfor %}
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t\t{% if p_d and p_d|length and p_d|join != \"\" %}
\t\t\t\t\t\t\t<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">奥行き{% if mitsumori_json and mitsumori_json.pd %}: <span>{{ mitsumori_json.pd }}</span>{% endif %}</div>
\t\t\t\t\t\t\t <div class=\"opt-btn-group\">
\t\t\t\t\t\t\t {% set idx = 0 %}
\t\t\t\t\t\t\t {% for pd_val in p_d %}{% if pd_val %}{% set idx = idx + 1 %}
\t\t\t\t\t\t\t <label class=\"opt-btn{% if (mitsumori_json and mitsumori_json.pd == pd_val) or p_d|length == 1 %} is-selected{% endif %}\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('pd','pd3_{{ idx }}');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"pd\" id=\"pd3_{{ idx }}\" value=\"{{ pd_val }}\"
\t\t\t\t\t\t\t {% if (mitsumori_json and mitsumori_json.pd == pd_val) or p_d|length == 1 %}checked{% endif %}>
\t\t\t\t\t\t\t {{ pd_val }}
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t {% endif %}{% endfor %}
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t\t{% if p_h and p_h|length and p_h|join != \"\" %}
\t\t\t\t\t\t\t<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">高さ{% if mitsumori_json and mitsumori_json.ph %}: <span>{{ mitsumori_json.ph }}</span>{% endif %}</div>
\t\t\t\t\t\t\t <div class=\"opt-btn-group\">
\t\t\t\t\t\t\t {% set idx = 0 %}
\t\t\t\t\t\t\t {% for ph_val in p_h %}{% if ph_val %}{% set idx = idx + 1 %}
\t\t\t\t\t\t\t <label class=\"opt-btn{% if (mitsumori_json and mitsumori_json.ph == ph_val) or p_h|length == 1 %} is-selected{% endif %}\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('ph','ph3_{{ idx }}');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"ph\" id=\"ph3_{{ idx }}\" value=\"{{ ph_val }}\"
\t\t\t\t\t\t\t {% if (mitsumori_json and mitsumori_json.ph == ph_val) or p_h|length == 1 %}checked{% endif %}>
\t\t\t\t\t\t\t {{ ph_val }}
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t {% endif %}{% endfor %}
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t\t{# 棚タイプ(p_m データから選択肢を生成) #}
\t\t\t\t\t\t\t{% if p_m and p_m|length and p_m|join != \"\" %}
\t\t\t\t\t\t\t<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">棚タイプ <small class=\"text-muted\">(間仕切り仕様)</small>{% if mitsumori_json and mitsumori_json.pm %}: <span>{{ mitsumori_json.pm }}</span>{% endif %}</div>
\t\t\t\t\t\t\t <div class=\"opt-btn-group\">
\t\t\t\t\t\t\t {% set idx = 0 %}
\t\t\t\t\t\t\t {% for pm_val in p_m %}{% if pm_val %}{% set idx = idx + 1 %}
\t\t\t\t\t\t\t <label class=\"opt-btn{% if (mitsumori_json and mitsumori_json.pm == pm_val) or p_m|length == 1 %} is-selected{% endif %}\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('pm','pm3_{{ idx }}');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"pm\" id=\"pm3_{{ idx }}\" value=\"{{ pm_val }}\"
\t\t\t\t\t\t\t {% if (mitsumori_json and mitsumori_json.pm == pm_val) or p_m|length == 1 %}checked{% endif %}>
\t\t\t\t\t\t\t {{ pm_val }}
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t {% endif %}{% endfor %}
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t\t{# option1 (mo の 棚タイプ 等、p_option1 データから選択肢を生成) #}
\t\t\t\t\t\t\t{% if p_option1 and p_option1|length and p_option1|join != \"\" %}
\t\t\t\t\t\t\t<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">{{ option1_label }}{% if mitsumori_json and mitsumori_json.option1 is defined and mitsumori_json.option1 %}: <span>{{ mitsumori_json.option1 }}</span>{% endif %}</div>
\t\t\t\t\t\t\t <div class=\"opt-btn-group\">
\t\t\t\t\t\t\t {% set idx = 0 %}
\t\t\t\t\t\t\t {% for opt1_val in p_option1 %}{% if opt1_val %}{% set idx = idx + 1 %}
\t\t\t\t\t\t\t <label class=\"opt-btn{% if (mitsumori_json and mitsumori_json.option1 is defined and mitsumori_json.option1 == opt1_val) or p_option1|length == 1 %} is-selected{% endif %}\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('option1','option1_3_{{ idx }}');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"option1\" id=\"option1_3_{{ idx }}\" value=\"{{ opt1_val }}\"
\t\t\t\t\t\t\t {% if (mitsumori_json and mitsumori_json.option1 is defined and mitsumori_json.option1 == opt1_val) or p_option1|length == 1 %}checked{% endif %}>
\t\t\t\t\t\t\t {{ opt1_val }}
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t {% endif %}{% endfor %}
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t\t{# カラー(共通の color データ使用) #}
\t\t\t\t\t\t\t{% if color and color|length %}
\t\t\t\t\t\t\t<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">カラー{% if mitsumori_json and mitsumori_json.pc %}: <span>{{ mitsumori_json.pc }}</span>{% endif %}</div>
\t\t\t\t\t\t\t <div class=\"opt-btn-group\">
\t\t\t\t\t\t\t {% set idx = 0 %}
\t\t\t\t\t\t\t {% for cc in color %}{% if cc and cc['name'] %}{% set idx = idx + 1 %}
\t\t\t\t\t\t\t <label class=\"opt-btn{% if (mitsumori_json and mitsumori_json.pc == cc['name']) or color|length == 1 %} is-selected{% endif %}\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('pc','cc3_{{ idx }}');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"color3\" id=\"cc3_{{ idx }}\" value=\"{{ cc['name'] }}\"
\t\t\t\t\t\t\t {% if (mitsumori_json and mitsumori_json.pc == cc['name']) or color|length == 1 %}checked{% endif %}>
\t\t\t\t\t\t\t {{ cc['name'] }}
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t {% endif %}{% endfor %}
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t\t{# 台数 #}
\t\t\t\t\t\t\t<div class=\"form-group row mt-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <label class=\"col-4 col-form-label\">台数</label>
\t\t\t\t\t\t\t <div class=\"col-4\">
\t\t\t\t\t\t\t <div class=\"input-group mb-3\">
\t\t\t\t\t\t\t <input type=\"number\" name=\"daisu\" id=\"daisu\" class=\"form-control\" value=\"{{ mitsumori_json.daisu|default('1') }}\" min=\"1\" max=\"10\" onchange=\"mitsumori_simulation('daisu','daisu');\">
\t\t\t\t\t\t\t <span class=\"input-group-text\">台</span>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t <div class=\"col-4\">
\t\t\t\t\t\t\t <button type=\"button\" class=\"btn btn-info\" onclick=\"daisu(+1);\">+</button>
\t\t\t\t\t\t\t <button type=\"button\" class=\"btn btn-danger\" onclick=\"daisu(-1);\">ー</button>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t<!-- 4: 施工見積(フェンス・組み立て式) -->
\t\t\t\t\t\t{% if ProductClass.SaleType.id == 4 %}
\t\t\t\t\t\t\t{# 枚数 #}
\t\t\t\t\t\t\t<div class=\"form-group row mt-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <label class=\"col-4 col-form-label\">枚数</label>
\t\t\t\t\t\t\t <div class=\"col-4 mb-3\">
\t\t\t\t\t\t\t <div class=\"input-group\">
\t\t\t\t\t\t\t <input type=\"number\" name=\"maisu\" id=\"maisu\" class=\"form-control\" value=\"{{ mitsumori_json.maisu|default('3') }}\" min=\"3\" max=\"20\" onchange=\"if(parseInt(this.value)<3)this.value=3; mitsumori_simulation('maisu','maisu');\">
\t\t\t\t\t\t\t <span class=\"input-group-text\">枚</span>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t <div class=\"col-4\">
\t\t\t\t\t\t\t <button type=\"button\" class=\"btn btn-info\" onclick=\"maisu(+1);\">+</button>
\t\t\t\t\t\t\t <button type=\"button\" class=\"btn btn-danger\" onclick=\"maisu(-1);\">ー</button>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t<!-- 5: 施工見積(ウッドデッキ・タイルデッキ) -->
\t\t\t\t\t\t{% if ProductClass.SaleType.id == 5 %}
\t\t\t\t\t\t\t{# ステップの有無 #}
\t\t\t\t\t\t\t<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">ステップ</div>
\t\t\t\t\t\t\t <div class=\"opt-btn-group\">
\t\t\t\t\t\t\t {% set step_yes_checked = (mitsumori_json and mitsumori_json.deck_step is defined and mitsumori_json.deck_step == '必要') %}
\t\t\t\t\t\t\t {% set step_no_checked = (not mitsumori_json or mitsumori_json.deck_step is not defined or mitsumori_json.deck_step == '不要' or not mitsumori_json.deck_step) %}
\t\t\t\t\t\t\t <label class=\"opt-btn{% if step_yes_checked %} is-selected{% endif %}\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('op0','deck_step_yes');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"deck_step\" id=\"deck_step_yes\" value=\"必要\"
\t\t\t\t\t\t\t {% if step_yes_checked %}checked{% endif %}>
\t\t\t\t\t\t\t 必要
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t <label class=\"opt-btn{% if step_no_checked %} is-selected{% endif %}\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('op0','deck_step_no');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"deck_step\" id=\"deck_step_no\" value=\"不要\"
\t\t\t\t\t\t\t {% if step_no_checked %}checked{% endif %}>
\t\t\t\t\t\t\t 不要
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t <div class=\"opt-survey-note-wd-step\" style=\"font-size:12px;color:#c00;margin-top:6px;{% if not step_yes_checked %}display:none;{% endif %}\">
\t\t\t\t\t\t\t ※ 現場調査後に正式お見積もりさせていただきます。
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t{# ウッドデッキフェンスの有無 #}
\t\t\t\t\t\t\t<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">デッキフェンス</div>
\t\t\t\t\t\t\t <div class=\"opt-btn-group\">
\t\t\t\t\t\t\t {% set fence_yes_checked = (mitsumori_json and mitsumori_json.deck_fence is defined and mitsumori_json.deck_fence == '必要') %}
\t\t\t\t\t\t\t {% set fence_no_checked = (not mitsumori_json or mitsumori_json.deck_fence is not defined or mitsumori_json.deck_fence == '不要' or not mitsumori_json.deck_fence) %}
\t\t\t\t\t\t\t <label class=\"opt-btn{% if fence_yes_checked %} is-selected{% endif %}\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('op1','deck_fence_yes');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"deck_fence\" id=\"deck_fence_yes\" value=\"必要\"
\t\t\t\t\t\t\t {% if fence_yes_checked %}checked{% endif %}>
\t\t\t\t\t\t\t 必要
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t <label class=\"opt-btn{% if fence_no_checked %} is-selected{% endif %}\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('op1','deck_fence_no');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"deck_fence\" id=\"deck_fence_no\" value=\"不要\"
\t\t\t\t\t\t\t {% if fence_no_checked %}checked{% endif %}>
\t\t\t\t\t\t\t 不要
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t <div class=\"opt-survey-note-wd-fence\" style=\"font-size:12px;color:#c00;margin-top:6px;{% if not fence_yes_checked %}display:none;{% endif %}\">
\t\t\t\t\t\t\t ※ 現場調査後に正式お見積もりさせていただきます。
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t<!-- 6: 施工見積(芝生・枚数・数量買い) -->
\t\t\t\t\t\t{% if ProductClass.SaleType.id == 6 %}
\t\t\t\t\t\t\t{# 規格(p_m データ → 素材から抽出) #}
\t\t\t\t\t\t\t{% if p_m and p_m|length and p_m|join != \"\" %}
\t\t\t\t\t\t\t<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">規格{% if mitsumori_json and mitsumori_json.pm %}: <span>{{ mitsumori_json.pm }}</span>{% endif %}</div>
\t\t\t\t\t\t\t <div class=\"opt-btn-group\">
\t\t\t\t\t\t\t {% set idx = 0 %}
\t\t\t\t\t\t\t {% for pm_val in p_m %}{% if pm_val %}{% set idx = idx + 1 %}
\t\t\t\t\t\t\t <label class=\"opt-btn{% if (mitsumori_json and mitsumori_json.pm == pm_val) or p_m|length == 1 %} is-selected{% endif %}\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('pm','pm6_{{ idx }}');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"pm\" id=\"pm6_{{ idx }}\" value=\"{{ pm_val }}\"
\t\t\t\t\t\t\t {% if (mitsumori_json and mitsumori_json.pm == pm_val) or p_m|length == 1 %}checked{% endif %}>
\t\t\t\t\t\t\t {{ pm_val }}
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t {% endif %}{% endfor %}
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t\t{# 芝の幅(p_w = ロール幅。free_area の w。例 100cm/200cm = 1m/2m 幅。
\t\t\t\t\t\t\t h はロール長(例 1000cm=10m)で固定のため UI には出さない)。 #}
\t\t\t\t\t\t\t{% if p_w and p_w|length and p_w|join != \"\" %}
\t\t\t\t\t\t\t<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">芝の幅{% if mitsumori_json and mitsumori_json.pw %}: <span>{{ mitsumori_json.pw }}</span>{% endif %}</div>
\t\t\t\t\t\t\t <div class=\"opt-btn-group\">
\t\t\t\t\t\t\t {% set idx = 0 %}
\t\t\t\t\t\t\t {% for pw_val in p_w %}{% if pw_val %}{% set idx = idx + 1 %}
\t\t\t\t\t\t\t <label class=\"opt-btn{% if (mitsumori_json and mitsumori_json.pw == pw_val) or p_w|length == 1 %} is-selected{% endif %}\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('pw','pw6_{{ idx }}');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"pw\" id=\"pw6_{{ idx }}\" value=\"{{ pw_val }}\"
\t\t\t\t\t\t\t {% if (mitsumori_json and mitsumori_json.pw == pw_val) or p_w|length == 1 %}checked{% endif %}>
\t\t\t\t\t\t\t {{ pw_val }}
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t {% endif %}{% endfor %}
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t\t{# 1ロールの長さ表記(顧客要望 #10)。h はロール長 (例 1000cm=10m) で固定のため選択ではなく表示のみ。 #}
\t\t\t\t\t\t\t{% set _roll_h = (p_h is defined and p_h|length) ? (p_h|first) : '' %}
\t\t\t\t\t\t\t{% if _roll_h %}
\t\t\t\t\t\t\t<div class=\"form-group mt-3 pb-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">1ロールの長さ:<span style=\"font-weight:bold;\">{% if 'cm' in _roll_h %}{{ (_roll_h|replace({'cm':'', ',':''})|trim) / 100 }}m{% else %}{{ _roll_h }}{% endif %}</span></div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t\t{# 施工サイズ(縦 × 横、m 入力)→ 必要枚数を自動算出して表示.
\t\t\t\t\t\t\t 面積=縦×横 を #area に流し込み、case 6 の qty=ceil(area/ロール面積) を流用. #}
\t\t\t\t\t\t\t<div class=\"form-group row mt-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <label class=\"col-4 col-form-label\">施工サイズ</label>
\t\t\t\t\t\t\t <div class=\"col-8\">
\t\t\t\t\t\t\t <div class=\"input-group\">
\t\t\t\t\t\t\t <input type=\"number\" name=\"tf_len\" id=\"tf_len\"
\t\t\t\t\t\t\t class=\"form-control\"
\t\t\t\t\t\t\t value=\"{{ mitsumori_json.tf_len|default('') }}\"
\t\t\t\t\t\t\t placeholder=\"縦\" min=\"0.1\" step=\"0.1\"
\t\t\t\t\t\t\t onchange=\"mitsumori_simulation('tf_len','tf_len');\">
\t\t\t\t\t\t\t <span class=\"input-group-text\">m ×</span>
\t\t\t\t\t\t\t <input type=\"number\" name=\"tf_wid\" id=\"tf_wid\"
\t\t\t\t\t\t\t class=\"form-control\"
\t\t\t\t\t\t\t value=\"{{ mitsumori_json.tf_wid|default('') }}\"
\t\t\t\t\t\t\t placeholder=\"横\" min=\"0.1\" step=\"0.1\"
\t\t\t\t\t\t\t onchange=\"mitsumori_simulation('tf_wid','tf_wid');\">
\t\t\t\t\t\t\t <span class=\"input-group-text\">m</span>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t {# area は内部計算用に保持(縦×横を JS で書き込む) #}
\t\t\t\t\t\t\t <input type=\"hidden\" name=\"area\" id=\"area\" value=\"{{ mitsumori_json.area|default('') }}\">
\t\t\t\t\t\t\t {# 必要枚数は直接入力も可能。施工サイズ入力時は自動算出して上書きする。
\t\t\t\t\t\t\t 施工サイズ未入力でも、ここで枚数だけ指定してカートに入れられる。 #}
\t\t\t\t\t\t\t <div style=\"margin-top:10px;display:inline-block;background:#fff3cd;border:1px solid #ffe69c;border-radius:6px;padding:8px 14px;font-size:16px;color:#c00;font-weight:bold;\">
\t\t\t\t\t\t\t 必要枚数:<input type=\"number\" name=\"tf_qty\" id=\"tf_qty\"
\t\t\t\t\t\t\t value=\"{{ mitsumori_json.tf_qty|default('1') }}\" min=\"1\" step=\"1\"
\t\t\t\t\t\t\t style=\"width:80px;font-size:22px;font-weight:bold;color:#c00;text-align:right;border:1px solid #ffe69c;border-radius:4px;padding:2px 6px;\"
\t\t\t\t\t\t\t onchange=\"mitsumori_simulation('tf_qty','tf_qty');\"> 枚
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t <div style=\"margin-top:6px;font-size:12px;color:#666;\">※ 施工サイズを入力すると必要枚数を自動計算します。サイズが分からない場合は枚数を直接ご指定ください。</div>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t<!-- 7: 施工見積(数量買い・基本工事費固定) -->
\t\t\t\t\t\t{% if ProductClass.SaleType.id == 7 %}
\t\t\t\t\t\t\t{# 個数(物置の daisu と同形式、単位は「個」) #}
\t\t\t\t\t\t\t<div class=\"form-group row mt-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <label class=\"col-4 col-form-label\">個数</label>
\t\t\t\t\t\t\t <div class=\"col-4\">
\t\t\t\t\t\t\t <div class=\"input-group mb-3\">
\t\t\t\t\t\t\t <input type=\"number\" name=\"suuryou\" id=\"suuryou\" class=\"form-control\"
\t\t\t\t\t\t\t value=\"{{ mitsumori_json.suuryou|default('1') }}\" min=\"1\" max=\"100\"
\t\t\t\t\t\t\t onchange=\"mitsumori_simulation('suuryou','suuryou');\">
\t\t\t\t\t\t\t <span class=\"input-group-text\">個</span>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t <div class=\"col-4\">
\t\t\t\t\t\t\t <button type=\"button\" class=\"btn btn-info\" onclick=\"suuryou(+1);\">+</button>
\t\t\t\t\t\t\t <button type=\"button\" class=\"btn btn-danger\" onclick=\"suuryou(-1);\">ー</button>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t<!-- 9: 商品のみ購入 -->
\t\t\t\t\t\t{% if ProductClass.SaleType.id == 9 %}
\t\t\t\t\t\t\t<div class=\"form-group row mt-2\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <label class=\"col-4 col-form-label\">数量</label>
\t\t\t\t\t\t\t <div class=\"col-4\">
\t\t\t\t\t\t\t <div class=\"input-group mb-3\">
\t\t\t\t\t\t\t <input type=\"number\" name=\"quantity_only\" id=\"quantity_only\" class=\"form-control\" value=\"1\" min=\"1\" onchange=\"\$('#quantity').val(this.value);\">
\t\t\t\t\t\t\t <span class=\"input-group-text\">個</span>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t <div class=\"col-4\">
\t\t\t\t\t\t\t <button type=\"button\" class=\"btn btn-info\" onclick=\"quantityOnly(+1);\">+</button>
\t\t\t\t\t\t\t <button type=\"button\" class=\"btn btn-danger\" onclick=\"quantityOnly(-1);\">ー</button>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t{% endif %}
\t\t\t\t\t <div class=\"row\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\"><label class=\"col-12 col-form-label\">取り付け工事のご希望に関してお答えください。</label></div>
\t\t\t\t\t\t{# gs (ゴミステーション, category id=27) では「撤去対応」「残土・ガラ処理」は ex-shop に存在しないため非表示
\t\t\t\t\t\t cg (カーゲート, category id=9) では「残土・ガラ処理」分は撤去金額側に内包済みのため非表示
\t\t\t\t\t\t (撤去オプション自体は残す) #}
\t\t\t\t\t\t{% set is_gs = false %}
\t\t\t\t\t\t{% set is_cg = false %}
\t\t\t\t\t\t{% if Product.ProductCategories is not empty %}
\t\t\t\t\t\t\t{% for ProductCategory in Product.ProductCategories %}
\t\t\t\t\t\t\t\t{% if ProductCategory.category_id == 27 %}{% set is_gs = true %}{% endif %}
\t\t\t\t\t\t\t\t{% if ProductCategory.category_id == 9 %}{% set is_cg = true %}{% endif %}
\t\t\t\t\t\t\t{% endfor %}
\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t{% for i in 0..10 %}
\t\t\t\t\t\t\t{% if op and op|length >= i+1 %}
\t\t\t\t\t\t\t{% if op[i]['name'] %}
\t\t\t\t\t\t\t{% set hide_opt = false %}
\t\t\t\t\t\t\t{% if is_gs and (op[i]['name'] matches '/撤去/' or op[i]['name'] matches '/残土/') %}
\t\t\t\t\t\t\t\t{% set hide_opt = true %}
\t\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t\t{% if is_cg and op[i]['name'] matches '/残土/' %}
\t\t\t\t\t\t\t\t{% set hide_opt = true %}
\t\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t\t{% if not hide_opt %}
\t\t\t\t\t\t\t{# price=0 で「解体」「撤去」「設置場所」(wd 等で API 差額未提供) を含むオプションは
\t\t\t\t\t\t\t 選択時に「現場調査後に正式お見積もり」文言を出す. #}
\t\t\t\t\t\t\t{% set is_removal_unknown = (op[i]['price']|default(0) == 0 or op[i]['price']|default('0') == '0')
\t\t\t\t\t\t\t and (op[i]['name'] matches '/解体/' or op[i]['name'] matches '/撤去/' or op[i]['name'] matches '/設置場所/') %}
\t\t\t\t\t\t\t{# tf (人工芝, sale_type=6): ex-shop に施工価格がないため「取り付け工事も希望する」選択時に現地調査文言を表示 #}
\t\t\t\t\t\t\t{% set is_tf_kouji = (ProductClass.SaleType.id == 6 and op[i]['name'] matches '/取り付け工事/') %}
\t\t\t\t\t\t\t<div class=\"form-group mt-3 pb-3\" data-op-idx=\"{{ i }}\" data-op-name=\"{{ op[i]['name']|e('html_attr') }}\" style=\"border-bottom:1px solid rgba(0,0,0,.125)\">
\t\t\t\t\t\t\t <div class=\"rp-section-label\">{{ op[i]['name'] }}{% if mitsumori_json and mitsumori_json.op[i] %}: <span>{{ mitsumori_json.op[i] }}</span>{% endif %}</div>
\t\t\t\t\t\t\t {% if op[i]['comment'] %}<div class=\"opt-comment\" style=\"font-size:12px;color:#666;margin:4px 0 6px;\">{{ op[i]['comment'] }}</div>{% endif %}
\t\t\t\t\t\t\t <div class=\"opt-btn-group\">
\t\t\t\t\t\t\t {# off が空 (= ex-shop に選択肢が 1 つしかない基礎施工等) のときは on 側を
\t\t\t\t\t\t\t 既定選択にして 2 個目の空ラジオを描画しない. #}
\t\t\t\t\t\t\t <label class=\"opt-btn{% if (mitsumori_json and mitsumori_json.op[i] == op[i]['on']) or not op[i]['off'] %} is-selected{% endif %}\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('op{{ i }}','op{{ i }}_1');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"op{{ i }}\" id=\"op{{ i }}_1\" value=\"{{ op[i]['on'] }}\" {% if (mitsumori_json and mitsumori_json.op[i] == op[i]['on']) or not op[i]['off'] %}checked{% endif %}>
\t\t\t\t\t\t\t {{ op[i]['on'] }}
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t {% if op[i]['off'] %}
\t\t\t\t\t\t\t <label class=\"opt-btn{% if mitsumori_json and mitsumori_json.op[i] == op[i]['off'] %} is-selected{% endif %}\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('op{{ i }}','op{{ i }}_2');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"op{{ i }}\" id=\"op{{ i }}_2\" value=\"{{ op[i]['off'] }}\" {% if mitsumori_json and mitsumori_json.op[i] == op[i]['off'] %}checked{% endif %}>
\t\t\t\t\t\t\t {{ op[i]['off'] }}
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t {% endif %}
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t {% if is_removal_unknown or is_tf_kouji %}
\t\t\t\t\t\t\t <div class=\"opt-survey-note\" data-op-idx=\"{{ i }}\" style=\"font-size:12px;color:#c00;margin-top:6px;{% if not (mitsumori_json and mitsumori_json.op[i] == op[i]['on']) %}display:none;{% endif %}\">
\t\t\t\t\t\t\t ※ 現場調査後に正式お見積もりさせていただきます。
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t {% endif %}
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t{% endfor %}
\t\t\t\t\t\t{# fe (sale_type=4) ブロックの種類×段数 サブ UI コンテナ.
\t\t\t\t\t\t 親オプション「ご希望のフェンス設置方法」 = 「新規にブロック積みを行う」
\t\t\t\t\t\t を選択したときだけ JS (renderFeBlockRadios) で表示される. #}
\t\t\t\t\t\t{% if ProductClass.SaleType.id == 4 and oi and oi.fe_block %}
\t\t\t\t\t\t<div id=\"fe-block-options\" class=\"form-group mt-3 pb-3\" style=\"display:none;border-bottom:1px solid rgba(0,0,0,.125)\"></div>
\t\t\t\t\t\t{% endif %}
\t\t\t\t\t\t{# tg カテゴリ用: block 別オプション差額ラジオ (W/D 確定後に JS が動的描画).
\t\t\t\t\t\t 他オプションと同じ列(card-body 内・カートボタンより前)に表示する. #}
\t\t\t\t\t\t<div id=\"tg-options\" class=\"tg-options-container col-12\"></div>
\t\t\t\t\t </div>
\t\t\t\t\t <!-- /.card-body -->
\t\t\t\t\t</div>
<form action=\"{{ url('product_add_cart', {id:Product.id}) }}\" method=\"post\" id=\"form1\" name=\"form1\">
{% if Product.stock_find %}
<div class=\"ec-productRole__actions\">
{% if form.classcategory_id1 is defined %}
<div class=\"ec-select\">
{{ form_row(form.classcategory_id1) }}
{{ form_errors(form.classcategory_id1) }}
</div>
{% if form.classcategory_id2 is defined %}
<div class=\"ec-select\">
{{ form_row(form.classcategory_id2) }}
{{ form_errors(form.classcategory_id2) }}
</div>
{% endif %}
{% endif %}
<div class=\"ec-numberInput\">
{{ form_widget(form.quantity, { type: 'hidden' }) }}
{{ form_errors(form.quantity) }}
</div>
</div>
{% else %}
<div class=\"ec-productRole__btn\">
<button type=\"button\" class=\"ec-blockBtn--action\" disabled=\"disabled\">
{{ 'ただいま品切れ中です。'|trans }}
</button>
</div>
{% endif %}
<div class=\"ec-productRole__btn mt-3\">
<button type=\"submit\" id=\"cart_btn\" class=\"ec-blockBtn--action add-cart\">カートに入れる</button>
</div>
{{ form_rest(form) }}
</form>
<div class=\"ec-modal add-cart-modal\">
<div class=\"ec-modal-overlay\">
<div class=\"ec-modal-wrap add-cart-modal__wrap\">
<span class=\"ec-modal-close\"><span class=\"ec-icon\"><img src=\"{{ asset('assets/icon/cross-dark.svg') }}\" alt=\"\"/></span></span>
<div id=\"ec-modal-header\" class=\"text-center add-cart-modal__header\">{{ 'カートに追加しました。'|trans }}</div>
<div class=\"ec-modal-box add-cart-modal__box\">
<div class=\"ec-role add-cart-modal__actions\">
<a href=\"{{ url('cart') }}\" class=\"ec-inlineBtn--action add-cart-modal__primary\">{{ 'カートに進む'|trans }}</a>
<span class=\"ec-inlineBtn--cancel add-cart-modal__secondary\">{{ '商品検索を続ける'|trans }}</span>
</div>
</div>
</div>
</div>
</div>
<div class=\"ec-productRole__description\">{{ Product.description_detail|raw|nl2br }}
</div>
{# SNSシェア #}
<div class=\"ec-productRole__share\">
<ul class=\"ec-share\">
<li class=\"ec-share__item\">
<a href=\"https://twitter.com/share?url={{ app.request.uri|url_encode }}&text={{ Product.name|url_encode }}\" class=\"ec-share__link ec-share__link--twitter\" target=\"_blank\" rel=\"noreferrer noopener\">
<i class=\"fab fa-twitter\"></i>
</a>
</li>
<li class=\"ec-share__item\">
<a href=\"https://www.facebook.com/sharer/sharer.php?u={{ app.request.uri|url_encode }}\" class=\"ec-share__link ec-share__link--facebook\" target=\"_blank\" rel=\"noreferrer noopener\">
<i class=\"fab fa-facebook-f\"></i>
</a>
</li>
<li class=\"ec-share__item\">
<a href=\"https://social-plugins.line.me/lineit/share?url={{ app.request.uri|url_encode }}\" class=\"ec-share__link ec-share__link--line\" target=\"_blank\" rel=\"noreferrer noopener\">
<i class=\"fab fa-line\"></i>
</a>
</li>
</ul>
</div>
</div>
\t\t\t\t{# ===== スマホ用 見積金額 下部固定バー ===== #}
\t\t\t\t<div id=\"sp-mitsumori-bar\">
\t\t\t\t <div class=\"sp-bar__pricewrap\">
\t\t\t\t <div class=\"sp-bar__label\">合計(工事費・税抜)</div>
\t\t\t\t <div class=\"sp-bar__price\" id=\"sp-mitsumori-price\">---円</div>
\t\t\t\t </div>
\t\t\t\t <button type=\"button\" class=\"sp-bar__detail-btn\"
\t\t\t\t onclick=\"openSpMitsumoriDetail();\" title=\"お見積りの詳細(内訳)を表示\">
\t\t\t\t <i class=\"far fa-file-alt\"></i>
\t\t\t\t <span>詳細</span>
\t\t\t\t </button>
\t\t\t\t <button type=\"button\" class=\"sp-bar__btn\"
\t\t\t\t onclick=\"document.getElementById('cart_btn2') && document.getElementById('cart_btn2').click();\">
\t\t\t\t <i class=\"fas fa-shopping-cart\"></i>
\t\t\t\t <span class=\"sp-bar__btn-label\">カートへ</span>
\t\t\t\t {% set spTotalQty = get_carts_total_quantity() %}
\t\t\t\t {% if spTotalQty > 0 %}
\t\t\t\t <span class=\"sp-bar__cart-badge\">{{ spTotalQty|number_format }}</span>
\t\t\t\t {% endif %}
\t\t\t\t </button>
\t\t\t\t <a href=\"{{ url('homepage') }}\" class=\"sp-bar__home-btn\" title=\"トップページへ\">
\t\t\t\t <i class=\"fas fa-home\"></i>
\t\t\t\t </a>
\t\t\t\t</div>
\t\t\t\t{# ===== スマホ用 お見積りの詳細 ボトムシート ===== #}
\t\t\t\t{# タップ時に現在の内訳カード(.mitsumori-card-pc)の中身を複製して表示する。
\t\t\t\t 価格計算には触れず、ライブ同期済みの表示値をそのまま見せる方式。 #}
\t\t\t\t<div id=\"sp-mitsumori-detail\" class=\"sp-detail-sheet\" aria-hidden=\"true\">
\t\t\t\t <div class=\"sp-detail-sheet__overlay\" onclick=\"closeSpMitsumoriDetail();\"></div>
\t\t\t\t <div class=\"sp-detail-sheet__panel\" role=\"dialog\" aria-label=\"お見積りの詳細\">
\t\t\t\t <div class=\"sp-detail-sheet__header\">
\t\t\t\t <span class=\"sp-detail-sheet__title\">お見積りの詳細</span>
\t\t\t\t <button type=\"button\" class=\"sp-detail-sheet__close\" onclick=\"closeSpMitsumoriDetail();\" aria-label=\"閉じる\">×</button>
\t\t\t\t </div>
\t\t\t\t <div class=\"sp-detail-sheet__body\" id=\"sp-detail-body\"></div>
\t\t\t\t <div class=\"sp-detail-sheet__footer\">
\t\t\t\t <button type=\"button\" class=\"sp-detail-sheet__invoice\"
\t\t\t\t onclick=\"closeSpMitsumoriDetail(); document.getElementById('mitsumori_btn') && document.getElementById('mitsumori_btn').click();\">見積書を表示</button>
\t\t\t\t <button type=\"button\" class=\"sp-detail-sheet__cart\"
\t\t\t\t onclick=\"closeSpMitsumoriDetail(); document.getElementById('cart_btn2') && document.getElementById('cart_btn2').click();\">カートに入れる</button>
\t\t\t\t </div>
\t\t\t\t </div>
\t\t\t\t</div>
\t\t\t\t<div class=\"card col-12 collapsed-card sticky-top float-right mitsumori-card-pc\">
\t\t\t\t\t<div class=\"card-header\">
\t\t\t\t\t <h3 class=\"card-title\">現在のお見積り額</h3>
\t\t\t\t\t <div class=\"card-tools\">
\t\t\t\t\t <span class=\"float-left\" id=\"mitsumori_message\">{{ mitsumori_json.mitsumori_goukei|default('---円') }}</span>
\t\t\t\t\t <button type=\"button\" class=\"btn btn-tool btn-mitsumori-toggle\" data-card-widget=\"collapse\" title=\"詳細を表示\">
\t\t\t\t\t <span class=\"toggle-icon\">▼ 詳細</span>
\t\t\t\t\t </button>
\t\t\t\t\t </div>
\t\t\t\t\t</div>
\t\t\t\t\t<div class=\"card-body p-0\">
\t\t\t\t\t <ul class=\"nav nav-pills flex-column\">
\t\t\t\t\t <li class=\"nav-item active\">
\t\t\t\t\t <a class=\"nav-link\">
\t\t\t\t\t <i class=\"far fa-file-alt\"></i> 合計(工事費・税抜)
\t\t\t\t\t <span class=\"float-right\" id=\"mitsumori_goukei\">{{ mitsumori_json.mitsumori_goukei|default('---円') }}</span>
\t\t\t\t\t </a>
\t\t\t\t\t </li>
\t\t\t\t\t <li class=\"nav-item active\">
\t\t\t\t\t <a class=\"nav-link\">
\t\t\t\t\t <i class=\"far fa-file-alt\"></i> 商品価格
\t\t\t\t\t <span class=\"float-right\" id=\"mitsumori_price\">{{ mitsumori_json.mitsumori_price|default('---円') }}</span>
\t\t\t\t\t </a>
\t\t\t\t\t </li>
\t\t\t\t\t {# sale_type=2 (補助金窓) ではカタログ価格軸を使わないので非表示. JS 側で #maker_price には \"---円\" を入れる. #}
\t\t\t\t\t {% if ProductClass.SaleType.id != 2 %}
\t\t\t\t\t <li class=\"nav-item\">
\t\t\t\t\t <a class=\"nav-link\">
\t\t\t\t\t <i class=\"far fa-file-alt\"></i> カタログ価格
\t\t\t\t\t <span class=\"float-right\" id=\"maker_price\">{{ mitsumori_json.maker_price|default('---円') }}</span>
\t\t\t\t\t </a>
\t\t\t\t\t </li>
\t\t\t\t\t {% else %}
\t\t\t\t\t {# sale_type=2 でも JS が #maker_price を参照するので hidden で残す #}
\t\t\t\t\t <span id=\"maker_price\" style=\"display:none;\">---円</span>
\t\t\t\t\t {% endif %}
\t\t\t\t\t <li class=\"nav-item\">
\t\t\t\t\t <a class=\"nav-link\">
\t\t\t\t\t <i class=\"far fa-file-alt\"></i>
\t\t\t\t\t {% if ProductClass.SaleType.id == 2 %}補助金(割引額){% else %}お値引き{% endif %}
\t\t\t\t\t <span class=\"float-right\" id=\"mitsumori_off\">{{ mitsumori_json.mitsumori_off|default('---円') }}</span>
\t\t\t\t\t </a>
\t\t\t\t\t </li>
\t\t\t\t\t {# 補助金窓のみ: 当店が申請代行する旨を補助金行の直下に小さく表示 (消費者の手続き勘違い防止) #}
\t\t\t\t\t {% if ProductClass.SaleType.id == 2 %}
\t\t\t\t\t <li class=\"nav-item\">
\t\t\t\t\t <div style=\"padding:4px 12px 8px;color:#6c757d;font-size:11px;line-height:1.4;\">
\t\t\t\t\t ※当店が補助金事業者として申請代行し、契約代金に充当します
\t\t\t\t\t </div>
\t\t\t\t\t </li>
\t\t\t\t\t {% endif %}
\t\t\t\t\t <li class=\"nav-item\">
\t\t\t\t\t <a class=\"nav-link\">
\t\t\t\t\t <i class=\"far fa-file-alt\"></i> 基本工事費
\t\t\t\t\t <span class=\"float-right\" id=\"mitsumori_ct\">{{ mitsumori_json.mitsumori_ct|default('---円') }}</span>
\t\t\t\t\t </a>
\t\t\t\t\t </li>
\t\t\t\t\t {# スチール折板(折半屋根): cp 折板のみ JS が表示。ex-shop と同じく工事費内の別行。 #}
\t\t\t\t\t <li class=\"nav-item\" id=\"mitsumori_steelroof_row\" style=\"display:none;\">
\t\t\t\t\t <a class=\"nav-link\">
\t\t\t\t\t <i class=\"far fa-file-alt\"></i> スチール折板
\t\t\t\t\t <span class=\"float-right\" id=\"mitsumori_steelroof\">{{ mitsumori_json.mitsumori_steelroof|default('---円') }}</span>
\t\t\t\t\t </a>
\t\t\t\t\t </li>
\t\t\t\t\t <li class=\"nav-item\">
\t\t\t\t\t <a class=\"nav-link\">
\t\t\t\t\t <i class=\"far fa-file-alt\"></i> 施工オプション
\t\t\t\t\t <span class=\"float-right\"id=\"mitsumori_option\">{{ mitsumori_json.mitsumori_option|default('---円') }}</span>
\t\t\t\t\t </a>
\t\t\t\t\t </li>
\t\t\t\t\t </ul>
\t\t\t\t\t</div>
\t\t\t\t\t<div class=\"card-footer\">
\t\t <button type=\"button\" id=\"mitsumori_btn\" class=\"btn btn-info\" data-toggle=\"modal\" data-target=\"#modal-mitsumori\">
\t\t 見積書表示
\t\t </button>
<button type=\"submit\" id=\"cart_btn2\" class=\"btn btn-info add-cart\">カートに入れる</button>
\t\t\t\t\t</div>
\t\t\t\t</div>
</div>
</div>
</div>
<div class=\"modal\" id=\"modal-mitsumori\">
<div class=\"modal-dialog modal-mitsumori\" style=\"max-width:1000px\">
<div class=\"modal-content\">
<div class=\"modal-header\">
<h4 class=\"modal-title\">お見積書</h4>
<button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\">
<span aria-hidden=\"true\">×</span>
</button>
</div>
<div class=\"modal-body\">
\t\t\t<div class=\"invoice p-3 mb-5\" style=\"max-width:1000px; margin:auto;\">
\t\t\t <!-- title row -->
\t\t\t <div class=\"row\">
\t\t\t <div class=\"col-12\">
\t\t\t <h2>概算お見積書
\t\t\t <small class=\"float-right\" style=\"font-size:14px;\">発行日: <span id=\"mitsumori_issue_date\">---</span></small>
\t\t\t </h2>
\t\t\t </div>
\t\t\t <!-- /.col -->
\t\t\t </div>
\t\t\t <!-- info row -->
\t\t\t <div class=\"row invoice-info\">
\t\t\t <div class=\"col-sm-8 invoice-col\">
\t\t\t <h3>お客様</h3>
\t\t\t <span>下記の通り、お見積もり申し上げます。</span>
\t\t\t <br />
\t\t\t <br / >
\t\t\t <br />
\t\t\t <h2>お見積金額: <span id=\"mitsumori_kei\">{{ mitsumori_json.mitsumori_goukei|default('---円') }}</span></h2>
\t\t\t <span>
\t\t\t <br/>
\t\t\t <br/>
\t\t\t <br/>
\t\t\t <br/>
\t\t\t </span>
\t\t\t </div>
\t\t\t <div class=\"col-sm-4 invoice-col\">
\t\t\t <p>
\t\t\t <img alt=\"\" src=\"/html/user_data/js/images/logo.png\" style=\"width: 260px; max-width: 100%; max-height: 10mm;\">
\t\t\t </p>
\t\t\t <p>有限会社プラス</p>
\t\t\t <p>〒400-0334</p>
\t\t\t <p>山梨県南アルプス市藤田1450番地2</p>
\t\t\t <p>TEL: 055-284-6480</p>
\t\t\t <img alt=\"\" src=\"/html/user_data/js/images/seal.svg\" style=\"z-index: 2; position: absolute; width: 21mm; left: 58mm; top: 36mm;\">
\t\t\t </div>
\t\t\t <!-- /.col -->
\t\t\t <!-- /.col -->
\t\t\t </div>
\t\t\t <!-- /.row -->
\t\t\t <!-- Table row -->
\t\t\t <div class=\"row\">
\t\t\t <div class=\"col-12 table-responsive\">
\t\t\t <table class=\"table table-striped\">
\t\t\t <thead>
\t\t\t <tr>
\t\t\t <th>項目</th>
\t\t\t <th>数量</th>
\t\t\t <th>単位</th>
\t\t\t <th>単価</th>
\t\t\t <th>小計</th>
\t\t\t </tr>
\t\t\t </thead>
\t\t\t <tbody>
\t\t\t <tr>
\t\t\t <td id=\"mitsumori_item_name\">{{ Product.name }}</td>
\t\t\t <td>1</td>
\t\t\t <td>式</td>
\t\t\t <td id=\"mitsumori_price_01\">---</td>
\t\t\t <td id=\"mitsumori_price_02\">---</td>
\t\t\t </tr>
\t\t\t <tr>
\t\t\t <td>基本工事費</td>
\t\t\t <td>1</td>
\t\t\t <td>式</td>
\t\t\t <td id=\"mitsumori_ct_01\">---</td>
\t\t\t <td id=\"mitsumori_ct_02\">---</td>
\t\t\t </tr>
\t\t\t <tr>
\t\t\t <td>残土・ガラ処理</td>
\t\t\t <td>1</td>
\t\t\t <td>式</td>
\t\t\t <td>0円</td>
\t\t\t <td></td>
\t\t\t </tr>
\t\t\t <tr>
\t\t\t <td> </td>
\t\t\t <td></td>
\t\t\t <td></td>
\t\t\t <td></td>
\t\t\t <td></td>
\t\t\t </tr>
\t\t\t </tbody>
\t\t\t </table>
\t\t\t </div>
\t\t\t <!-- /.col -->
\t\t\t </div>
\t\t\t <!-- /.row -->
\t\t\t <div class=\"row\">
\t\t\t <!-- accepted payments column -->
\t\t\t <div class=\"col-6\">
\t\t\t <p class=\"lead\">お支払い方法</p>
\t\t\t <p class=\"text-muted well well-sm shadow-none\" style=\"margin-top: 10px;\">銀行振込、クレジットカード決済、PAYPAY決済
\t\t\t <br>銀行振込:山梨中央銀行 白根支店 普通口座 391402
\t\t\t <br>※商品代金と工事代金の総額が金100万円(税込)を超える場合、着手金として代金の半額をご契約後お支払いいただきます。
\t\t\t </p>
\t\t\t </div>
\t\t\t <!-- /.col -->
\t\t\t <div class=\"col-6\">
\t\t\t <div class=\"table-responsive\">
\t\t\t <table class=\"table\">
\t\t\t <tbody>
\t\t\t <tr>
\t\t\t <th style=\"width:50%\">小計:</th>
\t\t\t <td id=\"mitsumori_shoukei\">---</td>
\t\t\t </tr>
\t\t\t <tr>
\t\t\t <th>消費税 (10%)</th>
\t\t\t <td id=\"mitsumori_tax\">---</td>
\t\t\t </tr>
\t\t\t <tr>
\t\t\t <th>合計:</th>
\t\t\t <td id=\"mitsumori_goukei_02\">---</td>
\t\t\t </tr>
\t\t\t </tbody>
\t\t\t </table>
\t\t\t </div>
\t\t\t </div>
\t\t\t <!-- /.col -->
\t\t\t </div>
\t\t\t <!-- /.row -->
\t\t\t</div>
</div>
<div class=\"modal-footer justify-content-between\">
\t\t\t {# PDF出力: mitsumori_json を POST して PDF ダウンロード #}
\t\t\t <form method=\"post\" action=\"{{ url('mitsumori_pdf') }}\" target=\"_blank\" id=\"pdf_download_form\">
\t\t\t <input type=\"hidden\" name=\"_token\" value=\"{{ csrf_token('mitsumori_pdf') }}\">
\t\t\t <input type=\"hidden\" name=\"mitsumori_json\" id=\"pdf_mitsumori_json\">
\t\t\t <button type=\"submit\" class=\"btn btn-primary float-right\" style=\"margin-right: 5px;\" onclick=\"syncPdfJson();\">
\t\t\t <i class=\"fas fa-download\"></i>PDF出力
\t\t\t </button>
\t\t\t </form>
<button type=\"submit\" id=\"cart_btn3\" class=\"btn btn-info add-cart\">カートに入れる</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
<!-- Image zoom modal: custom lightweight lightbox (no CDN dependency) -->
<div id=\"img-modal\" role=\"dialog\" aria-modal=\"true\" aria-label=\"画像拡大\">
<button id=\"img-modal__close\" aria-label=\"閉じる\">×</button>
<button id=\"img-modal__prev\" aria-label=\"前の画像\">❮</button>
<img id=\"img-modal__img\" src=\"\" alt=\"\">
<button id=\"img-modal__next\" aria-label=\"次の画像\">❯</button>
</div>
<style>
#img-modal {
display: none;
position: fixed;
inset: 0;
z-index: 9999;
background: rgba(0,0,0,0.88);
align-items: center;
justify-content: center;
cursor: zoom-out;
}
#img-modal.is-open { display: flex; }
#img-modal__img {
max-width: 92vw;
max-height: 88vh;
object-fit: contain;
border-radius: 4px;
cursor: default;
user-select: none;
touch-action: pinch-zoom;
display: block;
}
#img-modal__close {
position: absolute;
top: 14px;
right: 18px;
font-size: 38px;
color: #fff;
cursor: pointer;
background: none;
border: none;
padding: 0;
line-height: 1;
z-index: 1;
opacity: 0.85;
}
#img-modal__close:hover { opacity: 1; }
#img-modal__prev,
#img-modal__next {
position: absolute;
top: 50%;
transform: translateY(-50%);
font-size: 36px;
color: #fff;
cursor: pointer;
background: rgba(0,0,0,0.32);
border: none;
padding: 10px 16px;
line-height: 1;
border-radius: 6px;
z-index: 1;
opacity: 0.8;
user-select: none;
}
#img-modal__prev:hover, #img-modal__next:hover { opacity: 1; }
#img-modal__prev { left: 12px; }
#img-modal__next { right: 12px; }
@media (max-width: 767px) {
#img-modal__prev, #img-modal__next { font-size: 28px; padding: 8px 12px; }
}
</style>
<script>
(function(){
var images = [];
var current = 0;
// Collect original (non-cloned) slide images at click time.
// After Slick init, slides are wrapped in .slick-slide; clones have .slick-cloned.
function collectImages() {
images = [];
var \$slides = \$('.item_visual .slick-slide:not(.slick-cloned)');
if (!\$slides.length) {
// Slick not yet initialized (fallback)
\$slides = \$('.item_visual .slide-item');
}
\$slides.each(function() {
var \$a = \$(this).find('a.js-zoom');
if (\$a.length) {
images.push({ src: \$a.attr('href'), alt: \$a.find('img').attr('alt') || '' });
}
});
}
function showImage(idx) {
current = ((idx % images.length) + images.length) % images.length;
\$('#img-modal__img').attr({ src: images[current].src, alt: images[current].alt });
}
function openModal(href) {
collectImages();
if (!images.length) return;
var idx = 0;
for (var i = 0; i < images.length; i++) {
if (images[i].src === href) { idx = i; break; }
}
showImage(idx);
\$('#img-modal').addClass('is-open');
\$('body').css('overflow', 'hidden');
}
function closeModal() {
\$('#img-modal').removeClass('is-open');
\$('body').css('overflow', '');
}
// Click handler: works for both original and Slick-cloned anchors
\$(document).on('click', '.item_visual a.js-zoom', function(e) {
e.preventDefault();
openModal(\$(this).attr('href'));
});
// Close on backdrop click
\$('#img-modal').on('click', function(e) {
if (e.target === this) closeModal();
});
\$('#img-modal__close').on('click', closeModal);
\$('#img-modal__prev').on('click', function(e) { e.stopPropagation(); showImage(current - 1); });
\$('#img-modal__next').on('click', function(e) { e.stopPropagation(); showImage(current + 1); });
// Keyboard navigation
\$(document).on('keydown', function(e) {
if (!\$('#img-modal').hasClass('is-open')) return;
if (e.key === 'Escape') closeModal();
if (e.key === 'ArrowLeft') showImage(current - 1);
if (e.key === 'ArrowRight') showImage(current + 1);
});
// Touch swipe (horizontal only)
var _tx = 0;
var \$modal = document.getElementById('img-modal');
\$modal.addEventListener('touchstart', function(e) {
_tx = e.changedTouches[0].clientX;
}, { passive: true });
\$modal.addEventListener('touchend', function(e) {
var dx = e.changedTouches[0].clientX - _tx;
if (Math.abs(dx) > 48) {
dx < 0 ? showImage(current + 1) : showImage(current - 1);
}
}, { passive: true });
})();
</script>
{% endblock %}
", "Product/detail.twig", "/home/xs538259/exterior-plus.jp/public_html/app/template/default/Product/detail.twig");
}
}