<?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_da5ad31feda8695d41b76c2e300641cf69fccce492d7fb053b687f2a0b3adb3c 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;
}
/* ============================================
スマホ用 見積金額 下部固定バー
============================================ */
#sp-mitsumori-bar {
display: none;
}
/* ============================================
商品タイプ選択 共通スタイル
============================================ */
/* セクションラベル */
.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);
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);
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;
}
.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);
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;
}
/* ============================================
施工エリア案内
============================================ */
.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__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 908
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 909
echo "
<script>
eccube.classCategories = ";
// line 911
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.', 911, $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 922
if (twig_get_attribute($this->env, $this->source, ($context["form"] ?? null), "classcategory_id2", [], "any", true, true, false, 922)) {
// line 923
echo " fnSetClassCategories(
\$('#form1'), ";
// line 924
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.', 924, $this->source); })()), "classcategory_id2", [], "any", false, false, false, 924), "vars", [], "any", false, false, false, 924), "value", [], "any", false, false, false, 924));
echo "
);
";
} elseif (twig_get_attribute($this->env, $this->source, // line 926
($context["form"] ?? null), "classcategory_id1", [], "any", true, true, false, 926)) {
// line 927
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.', 927, $this->source); })()), "id", [], "any", false, false, false, 927), "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.', 927, $this->source); })()), "classcategory_id1", [], "any", false, false, false, 927), "vars", [], "any", false, false, false, 927), "value", [], "any", false, false, false, 927));
echo ", null);
";
}
// line 929
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 999
if (twig_get_attribute($this->env, $this->source, ($context["form"] ?? null), "classcategory_id1", [], "any", true, true, false, 999)) {
// line 1000
echo " // 規格1フォームの必須チェック
if (\$('#classcategory_id1').val() == '__unselected' || \$('#classcategory_id1').val() == '') {
\$('#classcategory_id1')[0].setCustomValidity('";
// line 1002
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 1008
echo "
";
// line 1009
if (twig_get_attribute($this->env, $this->source, ($context["form"] ?? null), "classcategory_id2", [], "any", true, true, false, 1009)) {
// line 1010
echo " // 規格2フォームの必須チェック
if (\$('#classcategory_id2').val() == '__unselected' || \$('#classcategory_id2').val() == '') {
\$('#classcategory_id2')[0].setCustomValidity('";
// line 1012
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 1018
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 1028
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 1055
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 1062
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 1079
if ((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1079, $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.', 1079, $this->source); })()), "pw", [], "any", false, false, false, 1079), "html", null, true);
}
echo "\";
\t\tvar pd = \"";
// line 1080
if ((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1080, $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.', 1080, $this->source); })()), "pd", [], "any", false, false, false, 1080), "html", null, true);
}
echo "\";
\t\tvar ph = \"";
// line 1081
if ((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1081, $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.', 1081, $this->source); })()), "ph", [], "any", false, false, false, 1081), "html", null, true);
}
echo "\";
\t\tvar pm = \"";
// line 1082
if ((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1082, $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.', 1082, $this->source); })()), "pm", [], "any", false, false, false, 1082), "html", null, true);
}
echo "\";
\t\tvar pc = \"";
// line 1083
if ((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1083, $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.', 1083, $this->source); })()), "pc", [], "any", false, false, false, 1083), "html", null, true);
}
echo "\";
\t\t// option1 / option2: カテゴリ別 option 軸 (um: タイプ=subtype, fe: ct_up 等)
\t\tvar option1 = \"";
// line 1085
if (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1085, $this->source); })()) && twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "option1", [], "any", true, true, false, 1085))) {
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.', 1085, $this->source); })()), "option1", [], "any", false, false, false, 1085), "html", null, true);
}
echo "\";
\t\tvar option2 = \"";
// line 1086
if (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1086, $this->source); })()) && twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "option2", [], "any", true, true, false, 1086))) {
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.', 1086, $this->source); })()), "option2", [], "any", false, false, false, 1086), "html", null, true);
}
echo "\";
\t\tvar op0 = \"";
// line 1087
if ((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1087, $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.', 1087, $this->source); })()), "op", [], "any", false, false, false, 1087), 0, [], "array", false, false, false, 1087), "html", null, true);
}
echo "\";
\t\tvar op1 = \"";
// line 1088
if ((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1088, $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.', 1088, $this->source); })()), "op", [], "any", false, false, false, 1088), 1, [], "array", false, false, false, 1088), "html", null, true);
}
echo "\";
\t\tvar op2 = \"";
// line 1089
if ((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1089, $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.', 1089, $this->source); })()), "op", [], "any", false, false, false, 1089), 2, [], "array", false, false, false, 1089), "html", null, true);
}
echo "\";
\t\tvar op3 = \"";
// line 1090
if ((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1090, $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.', 1090, $this->source); })()), "op", [], "any", false, false, false, 1090), 3, [], "array", false, false, false, 1090), "html", null, true);
}
echo "\";
\t\tvar op4 = \"";
// line 1091
if ((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1091, $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.', 1091, $this->source); })()), "op", [], "any", false, false, false, 1091), 4, [], "array", false, false, false, 1091), "html", null, true);
}
echo "\";
\t\tvar op5 = \"";
// line 1092
if ((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1092, $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.', 1092, $this->source); })()), "op", [], "any", false, false, false, 1092), 5, [], "array", false, false, false, 1092), "html", null, true);
}
echo "\";
\t\tvar op6 = \"";
// line 1093
if ((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1093, $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.', 1093, $this->source); })()), "op", [], "any", false, false, false, 1093), 6, [], "array", false, false, false, 1093), "html", null, true);
}
echo "\";
\t\tvar op7 = \"";
// line 1094
if ((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1094, $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.', 1094, $this->source); })()), "op", [], "any", false, false, false, 1094), 7, [], "array", false, false, false, 1094), "html", null, true);
}
echo "\";
\t\tvar op8 = \"";
// line 1095
if ((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1095, $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.', 1095, $this->source); })()), "op", [], "any", false, false, false, 1095), 8, [], "array", false, false, false, 1095), "html", null, true);
}
echo "\";
\t\tvar op9 = \"";
// line 1096
if ((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1096, $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.', 1096, $this->source); })()), "op", [], "any", false, false, false, 1096), 9, [], "array", false, false, false, 1096), "html", null, true);
}
echo "\";
\t\tvar op10 = \"";
// line 1097
if ((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 1097, $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.', 1097, $this->source); })()), "op", [], "any", false, false, false, 1097), 10, [], "array", false, false, false, 1097), "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 1120
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.', 1120, $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 1131
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.', 1131, $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 1141
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.', 1141, $this->source); })()), "SaleType", [], "any", false, false, false, 1141), "id", [], "any", false, false, false, 1141), "html", null, true);
echo ";
\t\t";
// line 1144
echo "\t\t";
$context["option1_label"] = "オプション1";
// line 1145
echo "\t\t";
$context["option2_label"] = "オプション2";
// line 1146
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.', 1146, $this->source); })()), "ProductCategories", [], "any", false, false, false, 1146))) {
// line 1147
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.', 1147, $this->source); })()), "ProductCategories", [], "any", false, false, false, 1147));
foreach ($context['_seq'] as $context["_key"] => $context["pcat"]) {
// line 1148
echo "\t\t\t\t";
if ((twig_get_attribute($this->env, $this->source, $context["pcat"], "category_id", [], "any", false, false, false, 1148) == 31)) {
$context["option1_label"] = "サイズプリセット";
$context["option2_label"] = "駆動方式";
}
// line 1149
echo "\t\t\t\t";
if ((twig_get_attribute($this->env, $this->source, $context["pcat"], "category_id", [], "any", false, false, false, 1149) == 43)) {
$context["option1_label"] = "ランマ";
$context["option2_label"] = "タイプ";
}
// line 1150
echo "\t\t\t\t";
if ((twig_get_attribute($this->env, $this->source, $context["pcat"], "category_id", [], "any", false, false, false, 1150) == 15)) {
$context["option1_label"] = "棚タイプ";
}
// line 1151
echo "\t\t\t\t";
if ((twig_get_attribute($this->env, $this->source, $context["pcat"], "category_id", [], "any", false, false, false, 1151) == 17)) {
$context["option1_label"] = "窓タイプ";
}
// line 1152
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 1153
echo "\t\t";
}
// line 1154
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\tvar \$list = \$('<div class=\"tg-choice-list\"></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 checked = (parseInt(ch.idx) === parseInt(oi_selected[axis] || 1)) ? ' checked' : '';
\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=\"tg-choice\"><input type=\"radio\" name=\"' + name + '\" id=\"' + inputId + '\" value=\"' + ch.idx + '\" data-axis=\"' + axis + '\"' + 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// ラジオ click で oi_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\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\" 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\tvar priceTxt = (parseInt(ch.price) || 0) > 0
\t\t\t\t\t? ' <span class=\"fe-block-price\" style=\"margin-left:6px;color:#666;font-size:12px;white-space:nowrap;\">(+' + formatter.format(toIncTax(parseInt(ch.price))) + '円 税込)</span>'
\t\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\tpriceTxt +
\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 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\tgoukei = basePrice + baseCt + 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\treturn {
\t\t\t\tgoukei: toIncTax(goukei),
\t\t\t\tprice: toIncTax(price),
\t\t\t\tct: toIncTax(ct),
\t\t\t\topt: toIncTax(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 1601
echo (isset($context["pp"]) || array_key_exists("pp", $context) ? $context["pp"] : (function () { throw new RuntimeError('Variable "pp" does not exist.', 1601, $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 1606
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.', 1606, $this->source); })()), [])) : ([])));
echo " || {});
\t\tvar PP_H_LADDER = Object.values(";
// line 1607
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.', 1607, $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 1633
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.', 1633, $this->source); })()), "id", [], "any", false, false, false, 1633), "住宅区分"), "戸建"));
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 1643
echo json_encode(((twig_get_attribute($this->env, $this->source, ($context["Product"] ?? null), "name", [], "any", true, true, false, 1643)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["Product"] ?? null), "name", [], "any", false, false, false, 1643), "")) : ("")));
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 1671
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.', 1671, $this->source); })()), "id", [], "any", false, false, false, 1671), "補助金グレード上限"), ""));
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\tfunction finalizeGlassGrade(raw, subtype) {
\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\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);
\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}
\t\t\t} else if (subsidyRawSum > 0) {
\t\t\t\tsubsidyNote = '※補助金合計が 5 万円未満のため申請対象外です('
\t\t\t\t\t+ subsidyRawSum.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\$('#mitsumori_message').text(subsidyNote);
\t\t\t\$('#mitsumori_btn').show();
\t\t\t\$('#mitsumori_goukei').text(goukeiInc.toLocaleString() + '円');
\t\t\t\$('#mitsumori_price').text(sumPriceInc.toLocaleString() + '円');
\t\t\t\$('#mitsumori_ct').text(ctInc.toLocaleString() + '円');
\t\t\t\$('#mitsumori_option').text(optInc.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 2025
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.', 2025, $this->source); })()), "id", [], "any", false, false, false, 2025), "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), '') !== 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_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\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\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;
\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\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\t// maker_price も scraper が税抜で保存しているため税込に変換
\t\t\t\tvar makerPrice = toIncTax(parseInt(el.maker_price) || 0);
\t\t\t\t\t\$('#mitsumori_message').text(formatter.format(goukei) + \"円\");
\t\t\t\t\t\$('#mitsumori_goukei').text(formatter.format(goukei) + \"円\");
\t\t\t\t\t\$('#mitsumori_off').text(formatter.format(price - makerPrice) + \"円\");
\t\t\t\t\t\$('#mitsumori_price').text(formatter.format(price) + \"円\");
\t\t\t\t\t\$('#maker_price').text(formatter.format(makerPrice) + \"円\");
\t\t\t\t\t\$('#mitsumori_ct').text(formatter.format(ct) + \"円\");
\t\t\t\t\t\$('#mitsumori_option').text(formatter.format(optionSum) + \"円\");
\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 明細用:オプション内訳テーブルを差し込む (施工オプション + 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\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\": \$('#mitsumori_goukei').text(),
\t\t\t\t\t\t\t\t\t\t\"mitsumori_goukei_02\": \$('#mitsumori_goukei_02').text(),
\t\t\t\t\t\t\t\t\t\t\"mitsumori_price\": \$('#mitsumori_price').text(),
\t\t\t\t\t\t\t\t\t\t\"maker_price\": \$('#maker_price').text(),
\t\t\t\t\t\t\t\t\t\t\"mitsumori_off\": \$('#mitsumori_off').text(),
\t\t\t\t\t\t\t\t\t\t\"mitsumori_ct\": \$('#mitsumori_ct').text(),
\t\t\t\t\t\t\t\t\t\t\"mitsumori_option\": \$('#mitsumori_option').text(),
\t\t\t\t\t\t\t\t\t\t\"product_id\": ";
// line 2442
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.', 2442, $this->source); })()), "id", [], "any", false, false, false, 2442), "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\tvar goukeiText = \$('#mitsumori_goukei').text();
\t\t\tvar priceText = \$('#mitsumori_price').text();
\t\t\tvar ctText = \$('#mitsumori_ct').text();
\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(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\tsyncMitsumoriModalFromPanel();
\t\t});
";
// line 2536
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.', 2536, $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.', 2536, $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.', 2536, $this->source); })())) == "")))) {
// line 2537
echo " pc = \"指定なし\";
";
// line 2538
$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.', 2538, $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 2539
echo " ";
if (((isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 2539, $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.', 2539, $this->source); })())) == 1))) {
// line 2540
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.', 2540, $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, 2540))) {
echo " pc = \"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["cc"], "name", [], "array", false, false, false, 2540), "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 2541
echo " ";
}
// line 2542
echo " ";
} elseif (((isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 2542, $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.', 2542, $this->source); })())) == 1))) {
// line 2543
echo " pc = \"指定なし\";
\t\t\t";
// line 2544
$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.', 2544, $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, 2544))) {
echo " pc = \"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["cc"], "name", [], "array", false, false, false, 2544), "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 2545
echo "\t\t";
}
// line 2546
echo "
";
// line 2547
if (((isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 2547, $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.', 2547, $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.', 2547, $this->source); })())) == "")))) {
// line 2548
echo " pw = \"指定なし\";
\t\t\t";
// line 2549
$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.', 2549, $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 2550
echo "\t\t";
}
// line 2551
echo "
";
// line 2552
if (((isset($context["p_d"]) || array_key_exists("p_d", $context) ? $context["p_d"] : (function () { throw new RuntimeError('Variable "p_d" does not exist.', 2552, $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.', 2552, $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.', 2552, $this->source); })())) == "")))) {
// line 2553
echo " pd = \"指定なし\";
\t\t\t";
// line 2554
$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.', 2554, $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 2555
echo "\t\t";
}
// line 2556
echo "
";
// line 2557
if (((isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 2557, $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.', 2557, $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.', 2557, $this->source); })())) == "")))) {
// line 2558
echo " ph = \"指定なし\";
\t\t\t";
// line 2559
$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.', 2559, $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 2560
echo "\t\t";
}
// line 2561
echo "
";
// line 2562
if (((isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 2562, $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.', 2562, $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.', 2562, $this->source); })())) == "")))) {
// line 2563
echo " pm = \"指定なし\";
\t\t\t";
// line 2564
$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.', 2564, $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 2565
echo "\t\t";
}
// line 2566
echo "
";
// line 2568
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.', 2568, $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.', 2568, $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.', 2568, $this->source); })())) == "")))) {
// line 2569
echo " option1 = \"\";
\t\t\t";
// line 2570
$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.', 2570, $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 2571
echo "\t\t";
}
// line 2572
echo "
";
// line 2573
if (((isset($context["p_option2"]) || array_key_exists("p_option2", $context) ? $context["p_option2"] : (function () { throw new RuntimeError('Variable "p_option2" does not exist.', 2573, $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.', 2573, $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.', 2573, $this->source); })())) == "")))) {
// line 2574
echo " option2 = \"\";
\t\t\t";
// line 2575
$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.', 2575, $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 2576
echo "\t\t";
}
// line 2577
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 2743
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.', 2743, $this->source); })()), "SaleType", [], "any", false, false, false, 2743), "id", [], "any", false, false, false, 2743), "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// option1/option2 のラベルは category 依存 (rd: ランマ/タイプ, sh: サイズプリセット/駆動方式 等).
\t\t// PHP から渡された option1_label / option2_label を埋め込み、JS 側でラベル更新に使う.
\t\tvar optLabelMap = {pc:'カラー', pw:'幅', pd:'奥行き', ph:'高さ', pm:'素材',
\t\t option1: '";
// line 2756
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.', 2756, $this->source); })()), "オプション1")) : ("オプション1")), "js"), "html", null, true);
echo "',
\t\t option2: '";
// line 2757
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.', 2757, $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\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// 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 2854
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.', 2854, $this->source); })()), "id", [], "any", false, false, false, 2854)]), "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 2915
if (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 2915, $this->source); })()) && twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "deck_step", [], "any", true, true, false, 2915))) {
echo twig_escape_filter($this->env, ((twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "deck_step", [], "any", true, true, false, 2915)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "deck_step", [], "any", false, false, false, 2915), "不要")) : ("不要")), "html", null, true);
} else {
echo "不要";
}
echo "\";
\t\tvar deck_fence = \"";
// line 2916
if (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 2916, $this->source); })()) && twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "deck_fence", [], "any", true, true, false, 2916))) {
echo twig_escape_filter($this->env, ((twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "deck_fence", [], "any", true, true, false, 2916)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "deck_fence", [], "any", false, false, false, 2916), "不要")) : ("不要")), "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 }
);
}
})();
// ===== 現在のお見積り額: 折りたたみトグルボタンのテキスト切り替え =====
(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 3010
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.', 3010, $this->source); })()), "name", [], "any", false, false, false, 3010), "html", null, true);
echo "\",
\"image\": [
";
// line 3012
$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.', 3012, $this->source); })()), "ProductImage", [], "any", false, false, false, 3012));
$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 3013
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.', 3013, $this->source); })()), "request", [], "any", false, false, false, 3013), "schemeAndHttpHost", [], "any", false, false, false, 3013), "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, 3013)) {
echo ",";
}
// line 3014
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 3016
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.', 3016, $this->source); })()), "request", [], "any", false, false, false, 3016), "schemeAndHttpHost", [], "any", false, false, false, 3016), "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 3018
echo " ],
\"description\": \"";
// line 3019
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, 3019)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["Product"] ?? null), "description_list", [], "any", false, false, false, 3019), 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.', 3019, $this->source); })()), "description_detail", [], "any", false, false, false, 3019))) : (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.', 3019, $this->source); })()), "description_detail", [], "any", false, false, false, 3019))), ["
" => "", "
" => ""]), 0, 300), "html", null, true);
echo "\",
";
// line 3020
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.', 3020, $this->source); })()), "code_min", [], "any", false, false, false, 3020)) {
// line 3021
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.', 3021, $this->source); })()), "code_min", [], "any", false, false, false, 3021), "html", null, true);
echo "\",
";
}
// line 3023
echo " \"offers\": {
\"@type\": \"Offer\",
\"url\": \"";
// line 3025
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.', 3025, $this->source); })()), "id", [], "any", false, false, false, 3025)]), "html", null, true);
echo "\",
\"priceCurrency\": \"";
// line 3026
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.', 3026, $this->source); })()), "currency", [], "any", false, false, false, 3026), "html", null, true);
echo "\",
\"price\": ";
// line 3027
((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.', 3027, $this->source); })()), "getPrice02IncTaxMin", [], "any", false, false, false, 3027)) ? (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.', 3027, $this->source); })()), "getPrice02IncTaxMin", [], "any", false, false, false, 3027), "html", null, true))) : (print (0)));
echo ",
\"availability\": \"";
// line 3028
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.', 3028, $this->source); })()), "stock_find", [], "any", false, false, false, 3028)) ? ("InStock") : ("OutOfStock"));
echo "\"
}
}
</script>
";
$__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);
$__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);
}
// line 3035
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 3036
echo " ";
// line 3037
echo " ";
$context["option1_label"] = "オプション1";
// line 3038
echo " ";
$context["option2_label"] = "オプション2";
// line 3039
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.', 3039, $this->source); })()), "ProductCategories", [], "any", false, false, false, 3039))) {
// line 3040
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.', 3040, $this->source); })()), "ProductCategories", [], "any", false, false, false, 3040));
foreach ($context['_seq'] as $context["_key"] => $context["pcat"]) {
// line 3041
echo " ";
if ((twig_get_attribute($this->env, $this->source, $context["pcat"], "category_id", [], "any", false, false, false, 3041) == 31)) {
$context["option1_label"] = "サイズプリセット";
$context["option2_label"] = "駆動方式";
}
// line 3042
echo " ";
if ((twig_get_attribute($this->env, $this->source, $context["pcat"], "category_id", [], "any", false, false, false, 3042) == 43)) {
$context["option1_label"] = "ランマ";
$context["option2_label"] = "タイプ";
}
// line 3043
echo " ";
if ((twig_get_attribute($this->env, $this->source, $context["pcat"], "category_id", [], "any", false, false, false, 3043) == 15)) {
$context["option1_label"] = "棚タイプ";
}
// line 3044
echo " ";
if ((twig_get_attribute($this->env, $this->source, $context["pcat"], "category_id", [], "any", false, false, false, 3044) == 17)) {
$context["option1_label"] = "窓タイプ";
}
// line 3045
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 3046
echo " ";
}
// line 3047
echo " <div class=\"ec-productRole\" style=\"margin-top:20px;\">
<div class=\"ec-grid2\">
<div class=\"ec-grid2__cell\">
<div class=\"ec-sliderItemRole\">
\t ";
// line 3052
echo "\t <div class=\"ec-productRole__title\">
\t <div class=\"ec-productRole__titleRow\">
\t <h2 class=\"ec-headingTitle\">";
// line 3054
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.', 3054, $this->source); })()), "name", [], "any", false, false, false, 3054), "html", null, true);
echo "</h2>
\t <div class=\"ec-share-inline\">
\t <a href=\"https://twitter.com/share?url=";
// line 3056
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.', 3056, $this->source); })()), "request", [], "any", false, false, false, 3056), "uri", [], "any", false, false, false, 3056)), "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.', 3056, $this->source); })()), "name", [], "any", false, false, false, 3056)), "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 3063
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.', 3063, $this->source); })()), "request", [], "any", false, false, false, 3063), "uri", [], "any", false, false, false, 3063)), "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 3070
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.', 3070, $this->source); })()), "option_favorite_product", [], "any", false, false, false, 3070)) {
// line 3071
echo " <div style=\"position:relative;top: 20px;left: 10px;z-index:100;\">
\t\t\t\t\t\t";
// line 3072
if (((isset($context["is_favorite"]) || array_key_exists("is_favorite", $context) ? $context["is_favorite"] : (function () { throw new RuntimeError('Variable "is_favorite" does not exist.', 3072, $this->source); })()) == false)) {
// line 3073
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.', 3073, $this->source); })()), "id", [], "any", false, false, false, 3073)]), "html", null, true);
echo "\" method=\"post\">
<button type=\"submit\" id=\"favorite\" class=\"favorite\">♡</button>
</form>
";
} else {
// line 3077
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.', 3077, $this->source); })()), "id", [], "any", false, false, false, 3077)]), "html", null, true);
echo "\" method=\"post\">
<button type=\"submit\" id=\"favorite\" class=\"favorite\" style=\"color:red;\">♥</button>
</form>
";
}
// line 3081
echo " </div>
";
}
// line 3083
echo " <div class=\"item_visual\">
";
// line 3084
$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.', 3084, $this->source); })()), "ProductImage", [], "any", false, false, false, 3084));
$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 3085
echo " <div class=\"slide-item\">
<a class=\"js-zoom\" href=\"";
// line 3086
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, 3086)) ? (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.', 3086, $this->source); })()), "name", [], "any", false, false, false, 3086), "html", null, true))) : (print ("")));
echo "\">
<img src=\"";
// line 3087
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, 3087)) ? (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.', 3087, $this->source); })()), "name", [], "any", false, false, false, 3087), "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, 3087) > 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 3091
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.', 3091, $this->source); })()), "name", [], "any", false, false, false, 3091), "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 3093
echo " </div>
<div class=\"item_nav\">
";
// line 3095
$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.', 3095, $this->source); })()), "ProductImage", [], "any", false, false, false, 3095));
$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 3096
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, 3096), "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 3098
echo " </div>
</div>
";
// line 3103
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 3115
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 3126
echo " ";
$context["hidden_cat_ids"] = [0 => 21, 1 => 28, 2 => 44];
// line 3127
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.', 3127, $this->source); })()), "ProductCategories", [], "any", false, false, false, 3127))) {
// line 3128
echo " <div class=\"ec-productRole__category\" style=\"padding:10px 0;\">
";
// line 3129
$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.', 3129, $this->source); })()), "ProductCategories", [], "any", false, false, false, 3129));
foreach ($context['_seq'] as $context["_key"] => $context["ProductCategory"]) {
// line 3130
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, 3130), "id", [], "any", false, false, false, 3130), (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.', 3130, $this->source); })()))) {
// line 3131
echo " <ul>
<li>
";
// line 3133
$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, 3133), "path", [], "any", false, false, false, 3133));
$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 3134
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, 3134), "html", null, true);
echo "\">";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["Category"], "name", [], "any", false, false, false, 3134), "html", null, true);
echo "</a>";
if ((twig_get_attribute($this->env, $this->source, $context["loop"], "last", [], "any", false, false, false, 3134) == false)) {
// line 3135
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 3137
echo " </li>
</ul>
";
}
// line 3140
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 3141
echo " </div>
";
}
// line 3143
echo " ";
// line 3144
echo " <div class=\"ec-productRole__price\">
\t\t\t\t\t\t<span style=\"color:black;font-size:15px;\">工事費込み価格</span>
";
// line 3146
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.', 3146, $this->source); })()), "hasProductClass", [], "any", false, false, false, 3146)) {
// line 3147
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.', 3147, $this->source); })()), "getPrice02IncTaxMin", [], "any", false, false, false, 3147) == 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.', 3147, $this->source); })()), "getPrice02IncTaxMax", [], "any", false, false, false, 3147))) {
// line 3148
echo " <div class=\"ec-price\">
<span id=\"price02-display\" class=\"ec-price__price price02-default\">";
// line 3149
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.', 3149, $this->source); })()), "getPrice02IncTaxMin", [], "any", false, false, false, 3149)), "html", null, true);
echo "</span>
<span class=\"ec-price__tax\">(";
// line 3150
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("税込"), "html", null, true);
echo ")~</span>
</div>
";
} else {
// line 3153
echo " <div class=\"ec-price\">
<span id=\"price02-display\" class=\"ec-price__price price02-default\">";
// line 3154
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.', 3154, $this->source); })()), "getPrice02IncTaxMin", [], "any", false, false, false, 3154)), "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.', 3154, $this->source); })()), "getPrice02IncTaxMax", [], "any", false, false, false, 3154)), "html", null, true);
echo "</span>
<span class=\"ec-price__tax\">(";
// line 3155
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("税込"), "html", null, true);
echo ")</span>
</div>
";
}
// line 3158
echo " ";
} else {
// line 3159
echo " <div class=\"ec-price\">
<span id=\"price02-display\" class=\"ec-price__price\">";
// line 3160
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.', 3160, $this->source); })()), "getPrice02IncTaxMin", [], "any", false, false, false, 3160)), "html", null, true);
echo "</span>
<span class=\"ec-price__tax\">(";
// line 3161
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("税込"), "html", null, true);
echo ")~</span>
</div>
";
}
// line 3164
echo " </div>
";
// line 3166
echo " <ul class=\"ec-productRole__tags\">
";
// line 3167
$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.', 3167, $this->source); })()), "Tags", [], "any", false, false, false, 3167));
foreach ($context['_seq'] as $context["_key"] => $context["Tag"]) {
// line 3168
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, 3168), "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 3170
echo " </ul>
";
// line 3172
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.', 3172, $this->source); })()), "code_min", [], "any", false, false, false, 3172))) {
// line 3173
echo " <div class=\"ec-productRole__code\">
";
// line 3174
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.', 3174, $this->source); })()), "code_min", [], "any", false, false, false, 3174), "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.', 3174, $this->source); })()), "code_min", [], "any", false, false, false, 3174) != 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.', 3174, $this->source); })()), "code_max", [], "any", false, false, false, 3174))) {
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.', 3174, $this->source); })()), "code_max", [], "any", false, false, false, 3174), "html", null, true);
}
echo "</span>
</div>
";
}
// line 3177
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 3182
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.', 3182, $this->source); })()), "sales_infomation", [], "any", false, false, false, 3182));
echo "
</div>
\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 3191
$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.', 3191, $this->source); })()), "id", [], "any", false, false, false, 3191), "related_image");
// line 3192
echo " ";
// line 3193
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.', 3193, $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.', 3193, $this->source); })())));
// line 3194
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.', 3194, $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.', 3194, $this->source); })())));
// line 3195
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.', 3195, $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.', 3195, $this->source); })())));
// line 3196
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.', 3196, $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.', 3196, $this->source); })())));
// line 3197
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.', 3197, $this->source); })()), "id", [], "any", false, false, false, 3197), "related_name1");
// line 3198
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.', 3198, $this->source); })()), "id", [], "any", false, false, false, 3198), "related_name2");
// line 3199
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.', 3199, $this->source); })()), "id", [], "any", false, false, false, 3199), "related_name3");
// line 3200
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.', 3200, $this->source); })()), "id", [], "any", false, false, false, 3200), "related_name4");
// line 3201
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.', 3201, $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.', 3201, $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.', 3201, $this->source); })()))) || (( // line 3202
(isset($context["type2"]) || array_key_exists("type2", $context) ? $context["type2"] : (function () { throw new RuntimeError('Variable "type2" does not exist.', 3202, $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.', 3202, $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.', 3202, $this->source); })())))) || (( // line 3203
(isset($context["type3"]) || array_key_exists("type3", $context) ? $context["type3"] : (function () { throw new RuntimeError('Variable "type3" does not exist.', 3203, $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.', 3203, $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.', 3203, $this->source); })())))) || (( // line 3204
(isset($context["type4"]) || array_key_exists("type4", $context) ? $context["type4"] : (function () { throw new RuntimeError('Variable "type4" does not exist.', 3204, $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.', 3204, $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.', 3204, $this->source); })()))));
// line 3205
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.', 3205, $this->source); })())) {
// line 3206
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 3208
echo "
\t\t\t\t\t\t";
// line 3210
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.', 3210, $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.', 3210, $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.', 3210, $this->source); })())))) {
// line 3211
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 3212
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.', 3212, $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.', 3212, $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.', 3212, $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.', 3212, $this->source); })()), "html", null, true);
echo "</span>";
}
echo "</div>
\t\t\t\t\t\t ";
// line 3213
if ((isset($context["img1"]) || array_key_exists("img1", $context) ? $context["img1"] : (function () { throw new RuntimeError('Variable "img1" does not exist.', 3213, $this->source); })())) {
// line 3214
echo "\t\t\t\t\t\t ";
// line 3215
echo "\t\t\t\t\t\t <div class=\"rp-card-group\">
\t\t\t\t\t\t ";
// line 3216
$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.', 3216, $this->source); })()));
foreach ($context['_seq'] as $context["rp_id"] => $context["rp_name"]) {
// line 3217
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.', 3217, $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 3219
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, 3219) && 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.', 3219, $this->source); })()), $context["rp_id"], [], "array", false, false, false, 3219))) ? ($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.', 3219, $this->source); })()), $context["rp_id"], [], "array", false, false, false, 3219), "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 3220
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 3224
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 3227
echo "\t\t\t\t\t\t </div>
\t\t\t\t\t\t ";
} else {
// line 3229
echo "\t\t\t\t\t\t ";
// line 3230
echo "\t\t\t\t\t\t <div class=\"rp-btn-group\">
\t\t\t\t\t\t ";
// line 3231
$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.', 3231, $this->source); })()));
foreach ($context['_seq'] as $context["rp_id"] => $context["rp_name"]) {
// line 3232
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.', 3232, $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 3233
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 3236
echo "\t\t\t\t\t\t </div>
\t\t\t\t\t\t ";
}
// line 3238
echo "\t\t\t\t\t\t</div>
\t\t\t\t\t\t";
}
// line 3240
echo "
\t\t\t\t\t\t";
// line 3242
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.', 3242, $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.', 3242, $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.', 3242, $this->source); })())))) {
// line 3243
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 3244
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.', 3244, $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.', 3244, $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.', 3244, $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.', 3244, $this->source); })()), "html", null, true);
echo "</span>";
}
echo "</div>
\t\t\t\t\t\t ";
// line 3245
if ((isset($context["img2"]) || array_key_exists("img2", $context) ? $context["img2"] : (function () { throw new RuntimeError('Variable "img2" does not exist.', 3245, $this->source); })())) {
// line 3246
echo "\t\t\t\t\t\t <div class=\"rp-card-group\">
\t\t\t\t\t\t ";
// line 3247
$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.', 3247, $this->source); })()));
foreach ($context['_seq'] as $context["rp_id"] => $context["rp_name"]) {
// line 3248
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.', 3248, $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 3250
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, 3250) && 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.', 3250, $this->source); })()), $context["rp_id"], [], "array", false, false, false, 3250))) ? ($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.', 3250, $this->source); })()), $context["rp_id"], [], "array", false, false, false, 3250), "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 3251
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 3255
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 3258
echo "\t\t\t\t\t\t </div>
\t\t\t\t\t\t ";
} else {
// line 3260
echo "\t\t\t\t\t\t <div class=\"rp-btn-group\">
\t\t\t\t\t\t ";
// line 3261
$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.', 3261, $this->source); })()));
foreach ($context['_seq'] as $context["rp_id"] => $context["rp_name"]) {
// line 3262
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.', 3262, $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 3263
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 3266
echo "\t\t\t\t\t\t </div>
\t\t\t\t\t\t ";
}
// line 3268
echo "\t\t\t\t\t\t</div>
\t\t\t\t\t\t";
}
// line 3270
echo "
\t\t\t\t\t\t";
// line 3272
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.', 3272, $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.', 3272, $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.', 3272, $this->source); })())))) {
// line 3273
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 3274
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.', 3274, $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.', 3274, $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.', 3274, $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.', 3274, $this->source); })()), "html", null, true);
echo "</span>";
}
echo "</div>
\t\t\t\t\t\t ";
// line 3275
if ((isset($context["img3"]) || array_key_exists("img3", $context) ? $context["img3"] : (function () { throw new RuntimeError('Variable "img3" does not exist.', 3275, $this->source); })())) {
// line 3276
echo "\t\t\t\t\t\t <div class=\"rp-card-group\">
\t\t\t\t\t\t ";
// line 3277
$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.', 3277, $this->source); })()));
foreach ($context['_seq'] as $context["rp_id"] => $context["rp_name"]) {
// line 3278
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.', 3278, $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 3280
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, 3280) && 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.', 3280, $this->source); })()), $context["rp_id"], [], "array", false, false, false, 3280))) ? ($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.', 3280, $this->source); })()), $context["rp_id"], [], "array", false, false, false, 3280), "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 3281
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 3285
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 3288
echo "\t\t\t\t\t\t </div>
\t\t\t\t\t\t ";
} else {
// line 3290
echo "\t\t\t\t\t\t <div class=\"rp-btn-group\">
\t\t\t\t\t\t ";
// line 3291
$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.', 3291, $this->source); })()));
foreach ($context['_seq'] as $context["rp_id"] => $context["rp_name"]) {
// line 3292
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.', 3292, $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 3293
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 3296
echo "\t\t\t\t\t\t </div>
\t\t\t\t\t\t ";
}
// line 3298
echo "\t\t\t\t\t\t</div>
\t\t\t\t\t\t";
}
// line 3300
echo "
\t\t\t\t\t\t";
// line 3302
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.', 3302, $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.', 3302, $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.', 3302, $this->source); })())))) {
// line 3303
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 3304
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.', 3304, $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.', 3304, $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.', 3304, $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.', 3304, $this->source); })()), "html", null, true);
echo "</span>";
}
echo "</div>
\t\t\t\t\t\t ";
// line 3305
if ((isset($context["img4"]) || array_key_exists("img4", $context) ? $context["img4"] : (function () { throw new RuntimeError('Variable "img4" does not exist.', 3305, $this->source); })())) {
// line 3306
echo "\t\t\t\t\t\t ";
// line 3307
echo "\t\t\t\t\t\t <div class=\"rp-card-group\">
\t\t\t\t\t\t ";
// line 3308
$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.', 3308, $this->source); })()));
foreach ($context['_seq'] as $context["rp_id"] => $context["rp_name"]) {
// line 3309
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.', 3309, $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 3311
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, 3311) && 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.', 3311, $this->source); })()), $context["rp_id"], [], "array", false, false, false, 3311))) ? ($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.', 3311, $this->source); })()), $context["rp_id"], [], "array", false, false, false, 3311), "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 3312
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 3313
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 3316
echo "\t\t\t\t\t\t </div>
\t\t\t\t\t\t ";
} else {
// line 3318
echo "\t\t\t\t\t\t ";
// line 3319
echo "\t\t\t\t\t\t <div class=\"rp-btn-group\">
\t\t\t\t\t\t ";
// line 3320
$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.', 3320, $this->source); })()));
foreach ($context['_seq'] as $context["rp_id"] => $context["rp_name"]) {
// line 3321
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.', 3321, $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 3322
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 3325
echo "\t\t\t\t\t\t </div>
\t\t\t\t\t\t ";
}
// line 3327
echo "\t\t\t\t\t\t</div>
\t\t\t\t\t\t";
}
// line 3329
echo "
\t\t\t\t\t ";
// line 3338
echo "\t\t\t\t\t ";
$context["is_gs_h"] = false;
// line 3339
echo "\t\t\t\t\t ";
$context["is_cg_h"] = false;
// line 3340
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.', 3340, $this->source); })()), "ProductCategories", [], "any", false, false, false, 3340))) {
// line 3341
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.', 3341, $this->source); })()), "ProductCategories", [], "any", false, false, false, 3341));
foreach ($context['_seq'] as $context["_key"] => $context["pc_h"]) {
// line 3342
echo "\t\t\t\t\t ";
if ((twig_get_attribute($this->env, $this->source, $context["pc_h"], "category_id", [], "any", false, false, false, 3342) == 27)) {
$context["is_gs_h"] = true;
}
// line 3343
echo "\t\t\t\t\t ";
if ((twig_get_attribute($this->env, $this->source, $context["pc_h"], "category_id", [], "any", false, false, false, 3343) == 9)) {
$context["is_cg_h"] = true;
}
// line 3344
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 3345
echo "\t\t\t\t\t ";
}
// line 3346
echo "\t\t\t\t\t ";
$context["visible_op_count"] = 0;
// line 3347
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.', 3347, $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.', 3347, $this->source); })())))) {
// line 3348
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.', 3348, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["opi"]) {
// line 3349
echo "\t\t\t\t\t ";
if (twig_get_attribute($this->env, $this->source, $context["opi"], "name", [], "array", false, false, false, 3349)) {
// line 3350
echo "\t\t\t\t\t ";
$context["_hide_h"] = false;
// line 3351
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.', 3351, $this->source); })()) && (preg_match("/撤去/", twig_get_attribute($this->env, $this->source, $context["opi"], "name", [], "array", false, false, false, 3351)) || preg_match("/残土/", twig_get_attribute($this->env, $this->source, $context["opi"], "name", [], "array", false, false, false, 3351))))) {
$context["_hide_h"] = true;
}
// line 3352
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.', 3352, $this->source); })()) && preg_match("/残土/", twig_get_attribute($this->env, $this->source, $context["opi"], "name", [], "array", false, false, false, 3352)))) {
$context["_hide_h"] = true;
}
// line 3353
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.', 3353, $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.', 3353, $this->source); })()) + 1);
}
// line 3354
echo "\t\t\t\t\t ";
}
// line 3355
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 3356
echo "\t\t\t\t\t ";
}
// line 3357
echo "\t\t\t\t\t ";
$context["has_any_option"] = ((((((((( // line 3358
(isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 3358, $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.', 3358, $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.', 3358, $this->source); })()), "SaleType", [], "any", false, false, false, 3358), "id", [], "any", false, false, false, 3358) != 3)) || (( // line 3359
(isset($context["p_w"]) || array_key_exists("p_w", $context) ? $context["p_w"] : (function () { throw new RuntimeError('Variable "p_w" does not exist.', 3359, $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.', 3359, $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.', 3359, $this->source); })())) != ""))) || (( // line 3360
(isset($context["p_d"]) || array_key_exists("p_d", $context) ? $context["p_d"] : (function () { throw new RuntimeError('Variable "p_d" does not exist.', 3360, $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.', 3360, $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.', 3360, $this->source); })())) != ""))) || (( // line 3361
(isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 3361, $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.', 3361, $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.', 3361, $this->source); })())) != ""))) || (( // line 3362
(isset($context["p_m"]) || array_key_exists("p_m", $context) ? $context["p_m"] : (function () { throw new RuntimeError('Variable "p_m" does not exist.', 3362, $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.', 3362, $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.', 3362, $this->source); })())) != ""))) || (( // line 3363
(isset($context["p_option1"]) || array_key_exists("p_option1", $context) ? $context["p_option1"] : (function () { throw new RuntimeError('Variable "p_option1" does not exist.', 3363, $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.', 3363, $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.', 3363, $this->source); })())) != ""))) || (( // line 3364
(isset($context["p_option2"]) || array_key_exists("p_option2", $context) ? $context["p_option2"] : (function () { throw new RuntimeError('Variable "p_option2" does not exist.', 3364, $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.', 3364, $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.', 3364, $this->source); })())) != ""))) || twig_in_filter(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, // line 3365
(isset($context["ProductClass"]) || array_key_exists("ProductClass", $context) ? $context["ProductClass"] : (function () { throw new RuntimeError('Variable "ProductClass" does not exist.', 3365, $this->source); })()), "SaleType", [], "any", false, false, false, 3365), "id", [], "any", false, false, false, 3365), [0 => 2, 1 => 5, 2 => 6, 3 => 7, 4 => 9]));
// line 3367
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.', 3367, $this->source); })())) {
// line 3368
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 3370
echo "
";
// line 3372
echo " ";
if (((((isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 3372, $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.', 3372, $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.', 3372, $this->source); })()), "SaleType", [], "any", false, false, false, 3372), "id", [], "any", false, false, false, 3372) != 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.', 3372, $this->source); })()), "SaleType", [], "any", false, false, false, 3372), "id", [], "any", false, false, false, 3372) != 2))) {
// line 3373
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 3374
if (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3374, $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.', 3374, $this->source); })()), "pc", [], "any", false, false, false, 3374))) {
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.', 3374, $this->source); })()), "pc", [], "any", false, false, false, 3374), "html", null, true);
echo "</span>";
}
echo "</div>
<div class=\"opt-btn-group\">
";
// line 3376
$context["idx"] = 0;
// line 3377
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.', 3377, $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, 3377))) {
$context["idx"] = ((isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 3377, $this->source); })()) + 1);
// line 3378
echo " ";
$context["has_img"] = (twig_get_attribute($this->env, $this->source, $context["cc"], "img", [], "array", true, true, false, 3378) && !twig_test_empty(twig_get_attribute($this->env, $this->source, $context["cc"], "img", [], "array", false, false, false, 3378)));
// line 3379
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.', 3379, $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.', 3379, $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.', 3379, $this->source); })()), "pc", [], "any", false, false, false, 3379) == twig_get_attribute($this->env, $this->source, $context["cc"], "name", [], "array", false, false, false, 3379))) || (twig_length_filter($this->env, (isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 3379, $this->source); })())) == 1))) {
echo " is-selected";
}
echo "\"
onclick=\"mitsumori_simulation_val('pc', '";
// line 3380
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, 3380), "js"), "html", null, true);
echo "');\">
<input type=\"radio\" name=\"color\" id=\"cc_";
// line 3381
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.', 3381, $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, 3381), "html", null, true);
echo "\"
";
// line 3382
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3382, $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.', 3382, $this->source); })()), "pc", [], "any", false, false, false, 3382) == twig_get_attribute($this->env, $this->source, $context["cc"], "name", [], "array", false, false, false, 3382))) || (twig_length_filter($this->env, (isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 3382, $this->source); })())) == 1))) {
echo "checked";
}
echo ">
";
// line 3383
if ((isset($context["has_img"]) || array_key_exists("has_img", $context) ? $context["has_img"] : (function () { throw new RuntimeError('Variable "has_img" does not exist.', 3383, $this->source); })())) {
// line 3384
echo " <img src=\"";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["cc"], "img", [], "array", false, false, false, 3384), "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, 3384), "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 3386
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["cc"], "name", [], "array", false, false, false, 3386), "html", null, true);
echo "</span>
";
} else {
// line 3388
echo " ";
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["cc"], "name", [], "array", false, false, false, 3388), "html", null, true);
echo "
";
}
// line 3390
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 3392
echo " </div>
</div>
";
}
// line 3395
echo "
";
// line 3400
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.', 3400, $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.', 3400, $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.', 3400, $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.', 3400, $this->source); })()), "SaleType", [], "any", false, false, false, 3400), "id", [], "any", false, false, false, 3400), [0 => 2, 1 => 3, 2 => 6]))) {
// line 3401
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 3402
if (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3402, $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.', 3402, $this->source); })()), "pw", [], "any", false, false, false, 3402))) {
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.', 3402, $this->source); })()), "pw", [], "any", false, false, false, 3402), "html", null, true);
echo "</span>";
}
echo "</div>
<div class=\"opt-btn-group\">
";
// line 3404
$context["idx"] = 0;
// line 3405
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.', 3405, $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.', 3405, $this->source); })()) + 1);
// line 3406
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.', 3406, $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.', 3406, $this->source); })()), "pw", [], "any", false, false, false, 3406) == $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.', 3406, $this->source); })())) == 1))) {
echo " is-selected";
}
echo "\"
onclick=\"mitsumori_simulation_val('pw', '";
// line 3407
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 3408
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.', 3408, $this->source); })()), "html", null, true);
echo "\" value=\"";
echo twig_escape_filter($this->env, $context["pw"], "html", null, true);
echo "\"
";
// line 3409
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3409, $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.', 3409, $this->source); })()), "pw", [], "any", false, false, false, 3409) == $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.', 3409, $this->source); })())) == 1))) {
echo "checked";
}
echo ">
";
// line 3410
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 3413
echo " </div>
</div>
";
}
// line 3416
echo "
";
// line 3417
if (((((isset($context["p_d"]) || array_key_exists("p_d", $context) ? $context["p_d"] : (function () { throw new RuntimeError('Variable "p_d" does not exist.', 3417, $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.', 3417, $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.', 3417, $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.', 3417, $this->source); })()), "SaleType", [], "any", false, false, false, 3417), "id", [], "any", false, false, false, 3417), [0 => 3, 1 => 6]))) {
// line 3418
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 3419
if (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3419, $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.', 3419, $this->source); })()), "pd", [], "any", false, false, false, 3419))) {
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.', 3419, $this->source); })()), "pd", [], "any", false, false, false, 3419), "html", null, true);
echo "</span>";
}
echo "</div>
<div class=\"opt-btn-group\">
";
// line 3421
$context["idx"] = 0;
// line 3422
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.', 3422, $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.', 3422, $this->source); })()) + 1);
// line 3423
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.', 3423, $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.', 3423, $this->source); })()), "pd", [], "any", false, false, false, 3423) == $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.', 3423, $this->source); })())) == 1))) {
echo " is-selected";
}
echo "\"
onclick=\"mitsumori_simulation_val('pd', '";
// line 3424
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 3425
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.', 3425, $this->source); })()), "html", null, true);
echo "\" value=\"";
echo twig_escape_filter($this->env, $context["pd"], "html", null, true);
echo "\"
";
// line 3426
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3426, $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.', 3426, $this->source); })()), "pd", [], "any", false, false, false, 3426) == $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.', 3426, $this->source); })())) == 1))) {
echo "checked";
}
echo ">
";
// line 3427
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 3430
echo " </div>
</div>
";
}
// line 3433
echo "
";
// line 3436
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.', 3436, $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.', 3436, $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.', 3436, $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.', 3436, $this->source); })()), "SaleType", [], "any", false, false, false, 3436), "id", [], "any", false, false, false, 3436), [0 => 2, 1 => 3, 2 => 6]))) {
// line 3437
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 3438
if (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3438, $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.', 3438, $this->source); })()), "ph", [], "any", false, false, false, 3438))) {
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.', 3438, $this->source); })()), "ph", [], "any", false, false, false, 3438), "html", null, true);
echo "</span>";
}
echo "</div>
<div class=\"opt-btn-group\">
";
// line 3440
$context["idx"] = 0;
// line 3441
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.', 3441, $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.', 3441, $this->source); })()) + 1);
// line 3442
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.', 3442, $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.', 3442, $this->source); })()), "ph", [], "any", false, false, false, 3442) == $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.', 3442, $this->source); })())) == 1))) {
echo " is-selected";
}
echo "\"
onclick=\"mitsumori_simulation_val('ph', '";
// line 3443
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 3444
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.', 3444, $this->source); })()), "html", null, true);
echo "\" value=\"";
echo twig_escape_filter($this->env, $context["ph"], "html", null, true);
echo "\"
";
// line 3445
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3445, $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.', 3445, $this->source); })()), "ph", [], "any", false, false, false, 3445) == $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.', 3445, $this->source); })())) == 1))) {
echo "checked";
}
echo ">
";
// line 3446
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 3449
echo " </div>
</div>
";
}
// line 3452
echo "
";
// line 3454
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.', 3454, $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.', 3454, $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.', 3454, $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.', 3454, $this->source); })()), "SaleType", [], "any", false, false, false, 3454), "id", [], "any", false, false, false, 3454) != 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.', 3454, $this->source); })()), "SaleType", [], "any", false, false, false, 3454), "id", [], "any", false, false, false, 3454) != 2))) {
// line 3455
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 3456
if (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3456, $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.', 3456, $this->source); })()), "pm", [], "any", false, false, false, 3456))) {
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.', 3456, $this->source); })()), "pm", [], "any", false, false, false, 3456), "html", null, true);
echo "</span>";
}
echo "</div>
<div class=\"opt-btn-group\">
";
// line 3458
$context["idx"] = 0;
// line 3459
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.', 3459, $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.', 3459, $this->source); })()) + 1);
// line 3460
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.', 3460, $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.', 3460, $this->source); })()), "pm", [], "any", false, false, false, 3460) == $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.', 3460, $this->source); })())) == 1))) {
echo " is-selected";
}
echo "\"
onclick=\"mitsumori_simulation_val('pm', '";
// line 3461
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 3462
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.', 3462, $this->source); })()), "html", null, true);
echo "\" value=\"";
echo twig_escape_filter($this->env, $context["pm"], "html", null, true);
echo "\"
";
// line 3463
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3463, $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.', 3463, $this->source); })()), "pm", [], "any", false, false, false, 3463) == $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.', 3463, $this->source); })())) == 1))) {
echo "checked";
}
echo ">
";
// line 3464
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 3467
echo " </div>
</div>
";
}
// line 3470
echo "
";
// line 3475
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.', 3475, $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.', 3475, $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.', 3475, $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.', 3475, $this->source); })()), "SaleType", [], "any", false, false, false, 3475), "id", [], "any", false, false, false, 3475) != 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.', 3475, $this->source); })()), "SaleType", [], "any", false, false, false, 3475), "id", [], "any", false, false, false, 3475) != 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.', 3475, $this->source); })()), "SaleType", [], "any", false, false, false, 3475), "id", [], "any", false, false, false, 3475) != 4))) {
// line 3476
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 3477
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.', 3477, $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.', 3477, $this->source); })()) && twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "option1", [], "any", true, true, false, 3477)) && 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.', 3477, $this->source); })()), "option1", [], "any", false, false, false, 3477))) {
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.', 3477, $this->source); })()), "option1", [], "any", false, false, false, 3477), "html", null, true);
echo "</span>";
}
echo "</div>
<div class=\"opt-btn-group\">
";
// line 3479
$context["idx"] = 0;
// line 3480
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.', 3480, $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.', 3480, $this->source); })()) + 1);
// line 3481
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.', 3481, $this->source); })()) && twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "option1", [], "any", true, true, false, 3481)) && (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.', 3481, $this->source); })()), "option1", [], "any", false, false, false, 3481) == $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.', 3481, $this->source); })())) == 1))) {
echo " is-selected";
}
echo "\"
onclick=\"mitsumori_simulation_val('option1', '";
// line 3482
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 3483
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.', 3483, $this->source); })()), "html", null, true);
echo "\" value=\"";
echo twig_escape_filter($this->env, $context["opt1"], "html", null, true);
echo "\"
";
// line 3484
if (((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3484, $this->source); })()) && twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "option1", [], "any", true, true, false, 3484)) && (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.', 3484, $this->source); })()), "option1", [], "any", false, false, false, 3484) == $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.', 3484, $this->source); })())) == 1))) {
echo "checked";
}
echo ">
";
// line 3485
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 3488
echo " </div>
</div>
";
}
// line 3491
echo "
";
// line 3493
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.', 3493, $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.', 3493, $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.', 3493, $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.', 3493, $this->source); })()), "SaleType", [], "any", false, false, false, 3493), "id", [], "any", false, false, false, 3493) != 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.', 3493, $this->source); })()), "SaleType", [], "any", false, false, false, 3493), "id", [], "any", false, false, false, 3493) != 3))) {
// line 3494
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 3495
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.', 3495, $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.', 3495, $this->source); })()) && twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "option2", [], "any", true, true, false, 3495)) && 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.', 3495, $this->source); })()), "option2", [], "any", false, false, false, 3495))) {
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.', 3495, $this->source); })()), "option2", [], "any", false, false, false, 3495), "html", null, true);
echo "</span>";
}
echo "</div>
<div class=\"opt-btn-group\">
";
// line 3497
$context["idx"] = 0;
// line 3498
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.', 3498, $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.', 3498, $this->source); })()) + 1);
// line 3499
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.', 3499, $this->source); })()) && twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "option2", [], "any", true, true, false, 3499)) && (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.', 3499, $this->source); })()), "option2", [], "any", false, false, false, 3499) == $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.', 3499, $this->source); })())) == 1))) {
echo " is-selected";
}
echo "\"
onclick=\"mitsumori_simulation_val('option2', '";
// line 3500
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 3501
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.', 3501, $this->source); })()), "html", null, true);
echo "\" value=\"";
echo twig_escape_filter($this->env, $context["opt2"], "html", null, true);
echo "\"
";
// line 3502
if (((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3502, $this->source); })()) && twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "option2", [], "any", true, true, false, 3502)) && (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.', 3502, $this->source); })()), "option2", [], "any", false, false, false, 3502) == $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.', 3502, $this->source); })())) == 1))) {
echo "checked";
}
echo ">
";
// line 3503
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 3506
echo " </div>
</div>
";
}
// line 3509
echo "
\t\t\t\t\t\t<!-- 1: 施工見積(通常) → 幅/奥行/高さ/素材/カラーは上部の共通ブロックで表示済み -->
\t\t\t\t\t\t";
// line 3511
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.', 3511, $this->source); })()), "SaleType", [], "any", false, false, false, 3511), "id", [], "any", false, false, false, 3511) == 1)) {
// line 3512
echo "\t\t\t\t\t\t";
}
// line 3513
echo "
\t\t\t\t\t\t<!-- 2: 施工見積(補助金・窓) 複数タイプ追加対応 (2026-05) -->
\t\t\t\t\t\t";
// line 3515
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.', 3515, $this->source); })()), "SaleType", [], "any", false, false, false, 3515), "id", [], "any", false, false, false, 3515) == 2)) {
// line 3516
echo "
\t\t\t\t\t\t\t";
// line 3520
echo "
\t\t\t\t\t\t\t";
// line 3524
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 3533
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.', 3533, $this->source); })()), "id", [], "any", false, false, false, 3533), "住宅区分"), "戸建");
// line 3534
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 3543
if (((isset($context["housing_default"]) || array_key_exists("housing_default", $context) ? $context["housing_default"] : (function () { throw new RuntimeError('Variable "housing_default" does not exist.', 3543, $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 3548
if (((isset($context["housing_default"]) || array_key_exists("housing_default", $context) ? $context["housing_default"] : (function () { throw new RuntimeError('Variable "housing_default" does not exist.', 3548, $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 <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 3569
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 3577
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.', 3577, $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.', 3577, $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.', 3577, $this->source); })())) != ""))) {
// line 3578
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 3581
$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.', 3581, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["v"]) {
if ($context["v"]) {
// line 3582
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 3583
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 3584
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 3587
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 3590
echo "
\t\t\t\t\t\t\t ";
// line 3592
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.', 3592, $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.', 3592, $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.', 3592, $this->source); })())) != ""))) {
// line 3593
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 3601
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.', 3601, $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.', 3601, $this->source); })())), "html", null, true);
echo " 段階の価格帯から自動選択)</small>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t ";
}
// line 3604
echo "
\t\t\t\t\t\t\t ";
// line 3606
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.', 3606, $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.', 3606, $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.', 3606, $this->source); })())) != ""))) {
// line 3607
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 3615
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.', 3615, $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.', 3615, $this->source); })())), "html", null, true);
echo " 段階の価格帯から自動選択)</small>
\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t ";
}
// line 3618
echo "
\t\t\t\t\t\t\t ";
// line 3620
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.', 3620, $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.', 3620, $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.', 3620, $this->source); })())) != ""))) {
// line 3621
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 3624
$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.', 3624, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["v"]) {
if ($context["v"]) {
// line 3625
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 3626
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 3627
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 3630
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 3634
echo "
\t\t\t\t\t\t\t ";
// line 3636
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.', 3636, $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.', 3636, $this->source); })())))) {
// line 3637
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 3640
$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.', 3640, $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, 3640))) {
// line 3641
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, 3641) && !twig_test_empty(twig_get_attribute($this->env, $this->source, $context["cc"], "img", [], "array", false, false, false, 3641)));
// line 3642
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.', 3642, $this->source); })())) {
echo " opt-btn--with-image";
}
echo "\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"wt_pc___IDX__\" value=\"";
// line 3643
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["cc"], "name", [], "array", false, false, false, 3643), "html", null, true);
echo "\" data-axis=\"pc\" onchange=\"onWindowTypeAxisChange(this);\">
\t\t\t\t\t\t\t ";
// line 3644
if ((isset($context["has_img"]) || array_key_exists("has_img", $context) ? $context["has_img"] : (function () { throw new RuntimeError('Variable "has_img" does not exist.', 3644, $this->source); })())) {
// line 3645
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, 3645), "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, 3645), "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 3647
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["cc"], "name", [], "array", false, false, false, 3647), "html", null, true);
echo "</span>
\t\t\t\t\t\t\t ";
} else {
// line 3649
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, 3649), "html", null, true);
echo "
\t\t\t\t\t\t\t ";
}
// line 3651
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 3653
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 3656
echo "
\t\t\t\t\t\t\t ";
// line 3658
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 <small class=\"text-muted\">補助金額<br><span class=\"wt-subsidy-amount\">―</span> 円</small>
\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 3674
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 3802
echo "
\t\t\t\t\t\t<!-- 3: 施工見積(物置・ゴミステーション) -->
\t\t\t\t\t\t";
// line 3804
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.', 3804, $this->source); })()), "SaleType", [], "any", false, false, false, 3804), "id", [], "any", false, false, false, 3804) == 3)) {
// line 3805
echo "
\t\t\t\t\t\t\t";
// line 3807
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.', 3807, $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.', 3807, $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.', 3807, $this->source); })())) != ""))) {
// line 3808
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 3809
if (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3809, $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.', 3809, $this->source); })()), "pw", [], "any", false, false, false, 3809))) {
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.', 3809, $this->source); })()), "pw", [], "any", false, false, false, 3809), "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 3811
$context["idx"] = 0;
// line 3812
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.', 3812, $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.', 3812, $this->source); })()) + 1);
// line 3813
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.', 3813, $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.', 3813, $this->source); })()), "pw", [], "any", false, false, false, 3813) == $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.', 3813, $this->source); })())) == 1))) {
echo " is-selected";
}
echo "\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('pw','pw3_";
// line 3814
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.', 3814, $this->source); })()), "html", null, true);
echo "');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"pw\" id=\"pw3_";
// line 3815
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.', 3815, $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 3816
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3816, $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.', 3816, $this->source); })()), "pw", [], "any", false, false, false, 3816) == $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.', 3816, $this->source); })())) == 1))) {
echo "checked";
}
echo ">
\t\t\t\t\t\t\t ";
// line 3817
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 3820
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 3823
echo "
\t\t\t\t\t\t\t";
// line 3824
if ((((isset($context["p_d"]) || array_key_exists("p_d", $context) ? $context["p_d"] : (function () { throw new RuntimeError('Variable "p_d" does not exist.', 3824, $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.', 3824, $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.', 3824, $this->source); })())) != ""))) {
// line 3825
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 3826
if (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3826, $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.', 3826, $this->source); })()), "pd", [], "any", false, false, false, 3826))) {
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.', 3826, $this->source); })()), "pd", [], "any", false, false, false, 3826), "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 3828
$context["idx"] = 0;
// line 3829
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.', 3829, $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.', 3829, $this->source); })()) + 1);
// line 3830
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.', 3830, $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.', 3830, $this->source); })()), "pd", [], "any", false, false, false, 3830) == $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.', 3830, $this->source); })())) == 1))) {
echo " is-selected";
}
echo "\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('pd','pd3_";
// line 3831
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.', 3831, $this->source); })()), "html", null, true);
echo "');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"pd\" id=\"pd3_";
// line 3832
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.', 3832, $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 3833
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3833, $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.', 3833, $this->source); })()), "pd", [], "any", false, false, false, 3833) == $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.', 3833, $this->source); })())) == 1))) {
echo "checked";
}
echo ">
\t\t\t\t\t\t\t ";
// line 3834
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 3837
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 3840
echo "
\t\t\t\t\t\t\t";
// line 3841
if ((((isset($context["p_h"]) || array_key_exists("p_h", $context) ? $context["p_h"] : (function () { throw new RuntimeError('Variable "p_h" does not exist.', 3841, $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.', 3841, $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.', 3841, $this->source); })())) != ""))) {
// line 3842
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 3843
if (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3843, $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.', 3843, $this->source); })()), "ph", [], "any", false, false, false, 3843))) {
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.', 3843, $this->source); })()), "ph", [], "any", false, false, false, 3843), "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 3845
$context["idx"] = 0;
// line 3846
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.', 3846, $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.', 3846, $this->source); })()) + 1);
// line 3847
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.', 3847, $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.', 3847, $this->source); })()), "ph", [], "any", false, false, false, 3847) == $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.', 3847, $this->source); })())) == 1))) {
echo " is-selected";
}
echo "\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('ph','ph3_";
// line 3848
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.', 3848, $this->source); })()), "html", null, true);
echo "');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"ph\" id=\"ph3_";
// line 3849
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.', 3849, $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 3850
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3850, $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.', 3850, $this->source); })()), "ph", [], "any", false, false, false, 3850) == $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.', 3850, $this->source); })())) == 1))) {
echo "checked";
}
echo ">
\t\t\t\t\t\t\t ";
// line 3851
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 3854
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 3857
echo "
\t\t\t\t\t\t\t";
// line 3859
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.', 3859, $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.', 3859, $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.', 3859, $this->source); })())) != ""))) {
// line 3860
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 3861
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); })()), "pm", [], "any", false, false, false, 3861))) {
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.', 3861, $this->source); })()), "pm", [], "any", false, false, false, 3861), "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 3863
$context["idx"] = 0;
// line 3864
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.', 3864, $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.', 3864, $this->source); })()) + 1);
// line 3865
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.', 3865, $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.', 3865, $this->source); })()), "pm", [], "any", false, false, false, 3865) == $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.', 3865, $this->source); })())) == 1))) {
echo " is-selected";
}
echo "\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('pm','pm3_";
// line 3866
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.', 3866, $this->source); })()), "html", null, true);
echo "');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"pm\" id=\"pm3_";
// line 3867
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.', 3867, $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 3868
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3868, $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.', 3868, $this->source); })()), "pm", [], "any", false, false, false, 3868) == $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.', 3868, $this->source); })())) == 1))) {
echo "checked";
}
echo ">
\t\t\t\t\t\t\t ";
// line 3869
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 3872
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 3875
echo "
\t\t\t\t\t\t\t";
// line 3877
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.', 3877, $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.', 3877, $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.', 3877, $this->source); })())) != ""))) {
// line 3878
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 3879
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.', 3879, $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.', 3879, $this->source); })()) && twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "option1", [], "any", true, true, false, 3879)) && 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); })()), "option1", [], "any", false, false, false, 3879))) {
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.', 3879, $this->source); })()), "option1", [], "any", false, false, false, 3879), "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 3881
$context["idx"] = 0;
// line 3882
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.', 3882, $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.', 3882, $this->source); })()) + 1);
// line 3883
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.', 3883, $this->source); })()) && twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "option1", [], "any", true, true, false, 3883)) && (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.', 3883, $this->source); })()), "option1", [], "any", false, false, false, 3883) == $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.', 3883, $this->source); })())) == 1))) {
echo " is-selected";
}
echo "\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('option1','option1_3_";
// line 3884
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.', 3884, $this->source); })()), "html", null, true);
echo "');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"option1\" id=\"option1_3_";
// line 3885
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.', 3885, $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 3886
if (((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3886, $this->source); })()) && twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "option1", [], "any", true, true, false, 3886)) && (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.', 3886, $this->source); })()), "option1", [], "any", false, false, false, 3886) == $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.', 3886, $this->source); })())) == 1))) {
echo "checked";
}
echo ">
\t\t\t\t\t\t\t ";
// line 3887
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 3890
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 3893
echo "
\t\t\t\t\t\t\t";
// line 3895
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.', 3895, $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.', 3895, $this->source); })())))) {
// line 3896
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 3897
if (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3897, $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.', 3897, $this->source); })()), "pc", [], "any", false, false, false, 3897))) {
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.', 3897, $this->source); })()), "pc", [], "any", false, false, false, 3897), "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 3899
$context["idx"] = 0;
// line 3900
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.', 3900, $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, 3900))) {
$context["idx"] = ((isset($context["idx"]) || array_key_exists("idx", $context) ? $context["idx"] : (function () { throw new RuntimeError('Variable "idx" does not exist.', 3900, $this->source); })()) + 1);
// line 3901
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.', 3901, $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.', 3901, $this->source); })()), "pc", [], "any", false, false, false, 3901) == twig_get_attribute($this->env, $this->source, $context["cc"], "name", [], "array", false, false, false, 3901))) || (twig_length_filter($this->env, (isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 3901, $this->source); })())) == 1))) {
echo " is-selected";
}
echo "\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('pc','cc3_";
// 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 "');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"color3\" id=\"cc3_";
// line 3903
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.', 3903, $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, 3903), "html", null, true);
echo "\"
\t\t\t\t\t\t\t ";
// line 3904
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 3904, $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.', 3904, $this->source); })()), "pc", [], "any", false, false, false, 3904) == twig_get_attribute($this->env, $this->source, $context["cc"], "name", [], "array", false, false, false, 3904))) || (twig_length_filter($this->env, (isset($context["color"]) || array_key_exists("color", $context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.', 3904, $this->source); })())) == 1))) {
echo "checked";
}
echo ">
\t\t\t\t\t\t\t ";
// line 3905
echo twig_escape_filter($this->env, twig_get_attribute($this->env, $this->source, $context["cc"], "name", [], "array", false, false, false, 3905), "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 3908
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 3911
echo "
\t\t\t\t\t\t\t";
// line 3913
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 3917
echo twig_escape_filter($this->env, ((twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "daisu", [], "any", true, true, false, 3917)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "daisu", [], "any", false, false, false, 3917), "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 3928
echo "
\t\t\t\t\t\t<!-- 4: 施工見積(フェンス・組み立て式) -->
\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) == 4)) {
// line 3931
echo "
\t\t\t\t\t\t\t";
// line 3933
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 3937
echo twig_escape_filter($this->env, ((twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "maisu", [], "any", true, true, false, 3937)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "maisu", [], "any", false, false, false, 3937), "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 3948
echo "
\t\t\t\t\t\t<!-- 5: 施工見積(ウッドデッキ・タイルデッキ) -->
\t\t\t\t\t\t";
// line 3950
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.', 3950, $this->source); })()), "SaleType", [], "any", false, false, false, 3950), "id", [], "any", false, false, false, 3950) == 5)) {
// line 3951
echo "
\t\t\t\t\t\t\t";
// line 3953
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 3956
$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.', 3956, $this->source); })()) && twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "deck_step", [], "any", true, true, false, 3956)) && (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.', 3956, $this->source); })()), "deck_step", [], "any", false, false, false, 3956) == "必要"));
// line 3957
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.', 3957, $this->source); })()) || !twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "deck_step", [], "any", true, true, false, 3957)) || (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.', 3957, $this->source); })()), "deck_step", [], "any", false, false, false, 3957) == "不要")) || !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.', 3957, $this->source); })()), "deck_step", [], "any", false, false, false, 3957));
// line 3958
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.', 3958, $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 3961
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.', 3961, $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 3964
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.', 3964, $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 3967
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.', 3967, $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 3971
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.', 3971, $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 3977
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 3980
$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.', 3980, $this->source); })()) && twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "deck_fence", [], "any", true, true, false, 3980)) && (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.', 3980, $this->source); })()), "deck_fence", [], "any", false, false, false, 3980) == "必要"));
// line 3981
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.', 3981, $this->source); })()) || !twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "deck_fence", [], "any", true, true, false, 3981)) || (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.', 3981, $this->source); })()), "deck_fence", [], "any", false, false, false, 3981) == "不要")) || !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.', 3981, $this->source); })()), "deck_fence", [], "any", false, false, false, 3981));
// line 3982
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.', 3982, $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 3985
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.', 3985, $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 3988
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.', 3988, $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 3991
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.', 3991, $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 3995
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.', 3995, $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 4001
echo "
\t\t\t\t\t\t<!-- 6: 施工見積(芝生・枚数・数量買い) -->
\t\t\t\t\t\t";
// line 4003
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.', 4003, $this->source); })()), "SaleType", [], "any", false, false, false, 4003), "id", [], "any", false, false, false, 4003) == 6)) {
// line 4004
echo "
\t\t\t\t\t\t\t";
// line 4006
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.', 4006, $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.', 4006, $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.', 4006, $this->source); })())) != ""))) {
// line 4007
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 4008
if (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4008, $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.', 4008, $this->source); })()), "pm", [], "any", false, false, false, 4008))) {
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.', 4008, $this->source); })()), "pm", [], "any", false, false, false, 4008), "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 4010
$context["idx"] = 0;
// line 4011
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.', 4011, $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.', 4011, $this->source); })()) + 1);
// line 4012
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.', 4012, $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.', 4012, $this->source); })()), "pm", [], "any", false, false, false, 4012) == $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.', 4012, $this->source); })())) == 1))) {
echo " is-selected";
}
echo "\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('pm','pm6_";
// line 4013
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.', 4013, $this->source); })()), "html", null, true);
echo "');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"pm\" id=\"pm6_";
// line 4014
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.', 4014, $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 4015
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4015, $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.', 4015, $this->source); })()), "pm", [], "any", false, false, false, 4015) == $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.', 4015, $this->source); })())) == 1))) {
echo "checked";
}
echo ">
\t\t\t\t\t\t\t ";
// line 4016
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 4019
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 4022
echo "
\t\t\t\t\t\t\t";
// line 4025
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.', 4025, $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.', 4025, $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.', 4025, $this->source); })())) != ""))) {
// line 4026
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 4027
if (((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4027, $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.', 4027, $this->source); })()), "pw", [], "any", false, false, false, 4027))) {
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.', 4027, $this->source); })()), "pw", [], "any", false, false, false, 4027), "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 4029
$context["idx"] = 0;
// line 4030
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.', 4030, $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.', 4030, $this->source); })()) + 1);
// line 4031
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.', 4031, $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.', 4031, $this->source); })()), "pw", [], "any", false, false, false, 4031) == $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.', 4031, $this->source); })())) == 1))) {
echo " is-selected";
}
echo "\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('pw','pw6_";
// line 4032
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.', 4032, $this->source); })()), "html", null, true);
echo "');\">
\t\t\t\t\t\t\t <input type=\"radio\" name=\"pw\" id=\"pw6_";
// line 4033
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.', 4033, $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 4034
if ((((isset($context["mitsumori_json"]) || array_key_exists("mitsumori_json", $context) ? $context["mitsumori_json"] : (function () { throw new RuntimeError('Variable "mitsumori_json" does not exist.', 4034, $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.', 4034, $this->source); })()), "pw", [], "any", false, false, false, 4034) == $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.', 4034, $this->source); })())) == 1))) {
echo "checked";
}
echo ">
\t\t\t\t\t\t\t ";
// line 4035
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 4038
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 4041
echo "
\t\t\t\t\t\t\t";
// line 4043
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.', 4043, $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.', 4043, $this->source); })()))) : (""));
// line 4044
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.', 4044, $this->source); })())) {
// line 4045
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 4046
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.', 4046, $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.', 4046, $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.', 4046, $this->source); })()), "html", null, true);
}
echo "</span></div>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t";
}
// line 4049
echo "
\t\t\t\t\t\t\t";
// line 4052
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 4058
echo twig_escape_filter($this->env, ((twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "tf_len", [], "any", true, true, false, 4058)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "tf_len", [], "any", false, false, false, 4058), "")) : ("")), "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 4064
echo twig_escape_filter($this->env, ((twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "tf_wid", [], "any", true, true, false, 4064)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "tf_wid", [], "any", false, false, false, 4064), "")) : ("")), "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 4070
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, 4070)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "area", [], "any", false, false, false, 4070), "")) : ("")), "html", null, true);
echo "\">
\t\t\t\t\t\t\t ";
// line 4073
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 4075
echo twig_escape_filter($this->env, ((twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "tf_qty", [], "any", true, true, false, 4075)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "tf_qty", [], "any", false, false, false, 4075), "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 4084
echo "
\t\t\t\t\t\t<!-- 7: 施工見積(数量買い・基本工事費固定) -->
\t\t\t\t\t\t";
// line 4086
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.', 4086, $this->source); })()), "SaleType", [], "any", false, false, false, 4086), "id", [], "any", false, false, false, 4086) == 7)) {
// line 4087
echo "\t\t\t\t\t\t\t";
// line 4088
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 4093
echo twig_escape_filter($this->env, ((twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "suuryou", [], "any", true, true, false, 4093)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["mitsumori_json"] ?? null), "suuryou", [], "any", false, false, false, 4093), "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 4104
echo "
\t\t\t\t\t\t<!-- 9: 商品のみ購入 -->
\t\t\t\t\t\t";
// line 4106
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.', 4106, $this->source); })()), "SaleType", [], "any", false, false, false, 4106), "id", [], "any", false, false, false, 4106) == 9)) {
// line 4107
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 4121
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 4129
echo "\t\t\t\t\t\t";
$context["is_gs"] = false;
// line 4130
echo "\t\t\t\t\t\t";
$context["is_cg"] = false;
// line 4131
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.', 4131, $this->source); })()), "ProductCategories", [], "any", false, false, false, 4131))) {
// line 4132
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.', 4132, $this->source); })()), "ProductCategories", [], "any", false, false, false, 4132));
foreach ($context['_seq'] as $context["_key"] => $context["ProductCategory"]) {
// line 4133
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, 4133) == 27)) {
$context["is_gs"] = true;
}
// line 4134
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, 4134) == 9)) {
$context["is_cg"] = true;
}
// line 4135
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 4136
echo "\t\t\t\t\t\t";
}
// line 4137
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 4138
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.', 4138, $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.', 4138, $this->source); })())) >= ($context["i"] + 1)))) {
// line 4139
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.', 4139, $this->source); })()), $context["i"], [], "array", false, false, false, 4139), "name", [], "array", false, false, false, 4139)) {
// line 4140
echo "\t\t\t\t\t\t\t";
$context["hide_opt"] = false;
// line 4141
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.', 4141, $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.', 4141, $this->source); })()), $context["i"], [], "array", false, false, false, 4141), "name", [], "array", false, false, false, 4141)) || 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.', 4141, $this->source); })()), $context["i"], [], "array", false, false, false, 4141), "name", [], "array", false, false, false, 4141))))) {
// line 4142
echo "\t\t\t\t\t\t\t\t";
$context["hide_opt"] = true;
// line 4143
echo "\t\t\t\t\t\t\t";
}
// line 4144
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.', 4144, $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.', 4144, $this->source); })()), $context["i"], [], "array", false, false, false, 4144), "name", [], "array", false, false, false, 4144)))) {
// line 4145
echo "\t\t\t\t\t\t\t\t";
$context["hide_opt"] = true;
// line 4146
echo "\t\t\t\t\t\t\t";
}
// line 4147
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.', 4147, $this->source); })())) {
// line 4148
echo "\t\t\t\t\t\t\t";
// line 4150
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, 4150), "price", [], "array", true, true, false, 4150)) ? (_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, 4150), "price", [], "array", false, false, false, 4150), 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, 4150), "price", [], "array", true, true, false, 4150)) ? (_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, 4150), "price", [], "array", false, false, false, 4150), "0")) : ("0")) == "0")) && ((preg_match("/解体/", twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, // line 4151
(isset($context["op"]) || array_key_exists("op", $context) ? $context["op"] : (function () { throw new RuntimeError('Variable "op" does not exist.', 4151, $this->source); })()), $context["i"], [], "array", false, false, false, 4151), "name", [], "array", false, false, false, 4151)) || 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.', 4151, $this->source); })()), $context["i"], [], "array", false, false, false, 4151), "name", [], "array", false, false, false, 4151))) || 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.', 4151, $this->source); })()), $context["i"], [], "array", false, false, false, 4151), "name", [], "array", false, false, false, 4151))));
// line 4152
echo "\t\t\t\t\t\t\t";
// line 4153
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.', 4153, $this->source); })()), "SaleType", [], "any", false, false, false, 4153), "id", [], "any", false, false, false, 4153) == 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.', 4153, $this->source); })()), $context["i"], [], "array", false, false, false, 4153), "name", [], "array", false, false, false, 4153)));
// line 4154
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.', 4154, $this->source); })()), $context["i"], [], "array", false, false, false, 4154), "name", [], "array", false, false, false, 4154), "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 4156
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.', 4156, $this->source); })()), $context["i"], [], "array", false, false, false, 4156), "name", [], "array", false, false, false, 4156), "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.', 4156, $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.', 4156, $this->source); })()), "op", [], "any", false, false, false, 4156), $context["i"], [], "array", false, false, false, 4156))) {
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.', 4156, $this->source); })()), "op", [], "any", false, false, false, 4156), $context["i"], [], "array", false, false, false, 4156), "html", null, true);
echo "</span>";
}
echo "</div>
\t\t\t\t\t\t\t ";
// line 4157
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.', 4157, $this->source); })()), $context["i"], [], "array", false, false, false, 4157), "comment", [], "array", false, false, false, 4157)) {
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.', 4157, $this->source); })()), $context["i"], [], "array", false, false, false, 4157), "comment", [], "array", false, false, false, 4157), "html", null, true);
echo "</div>";
}
// line 4158
echo "\t\t\t\t\t\t\t <div class=\"opt-btn-group\">
\t\t\t\t\t\t\t ";
// line 4161
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.', 4161, $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.', 4161, $this->source); })()), "op", [], "any", false, false, false, 4161), $context["i"], [], "array", false, false, false, 4161) == 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.', 4161, $this->source); })()), $context["i"], [], "array", false, false, false, 4161), "on", [], "array", false, false, false, 4161))) || !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.', 4161, $this->source); })()), $context["i"], [], "array", false, false, false, 4161), "off", [], "array", false, false, false, 4161))) {
echo " is-selected";
}
echo "\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('op";
// line 4162
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 4163
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.', 4163, $this->source); })()), $context["i"], [], "array", false, false, false, 4163), "on", [], "array", false, false, false, 4163), "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.', 4163, $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.', 4163, $this->source); })()), "op", [], "any", false, false, false, 4163), $context["i"], [], "array", false, false, false, 4163) == 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.', 4163, $this->source); })()), $context["i"], [], "array", false, false, false, 4163), "on", [], "array", false, false, false, 4163))) || !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.', 4163, $this->source); })()), $context["i"], [], "array", false, false, false, 4163), "off", [], "array", false, false, false, 4163))) {
echo "checked";
}
echo ">
\t\t\t\t\t\t\t ";
// line 4164
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.', 4164, $this->source); })()), $context["i"], [], "array", false, false, false, 4164), "on", [], "array", false, false, false, 4164), "html", null, true);
echo "
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t ";
// line 4166
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.', 4166, $this->source); })()), $context["i"], [], "array", false, false, false, 4166), "off", [], "array", false, false, false, 4166)) {
// line 4167
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.', 4167, $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.', 4167, $this->source); })()), "op", [], "any", false, false, false, 4167), $context["i"], [], "array", false, false, false, 4167) == 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.', 4167, $this->source); })()), $context["i"], [], "array", false, false, false, 4167), "off", [], "array", false, false, false, 4167)))) {
echo " is-selected";
}
echo "\"
\t\t\t\t\t\t\t onclick=\"mitsumori_simulation('op";
// line 4168
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 4169
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.', 4169, $this->source); })()), $context["i"], [], "array", false, false, false, 4169), "off", [], "array", false, false, false, 4169), "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.', 4169, $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.', 4169, $this->source); })()), "op", [], "any", false, false, false, 4169), $context["i"], [], "array", false, false, false, 4169) == 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.', 4169, $this->source); })()), $context["i"], [], "array", false, false, false, 4169), "off", [], "array", false, false, false, 4169)))) {
echo "checked";
}
echo ">
\t\t\t\t\t\t\t ";
// line 4170
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.', 4170, $this->source); })()), $context["i"], [], "array", false, false, false, 4170), "off", [], "array", false, false, false, 4170), "html", null, true);
echo "
\t\t\t\t\t\t\t </label>
\t\t\t\t\t\t\t ";
}
// line 4173
echo "\t\t\t\t\t\t\t </div>
\t\t\t\t\t\t\t ";
// line 4174
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.', 4174, $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.', 4174, $this->source); })()))) {
// line 4175
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.', 4175, $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.', 4175, $this->source); })()), "op", [], "any", false, false, false, 4175), $context["i"], [], "array", false, false, false, 4175) == 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.', 4175, $this->source); })()), $context["i"], [], "array", false, false, false, 4175), "on", [], "array", false, false, false, 4175)))) {
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 4179
echo "\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t";
}
// line 4181
echo "\t\t\t\t\t\t\t";
}
// line 4182
echo "\t\t\t\t\t\t\t";
}
// line 4183
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 4184
echo "
\t\t\t\t\t\t";
// line 4188
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.', 4188, $this->source); })()), "SaleType", [], "any", false, false, false, 4188), "id", [], "any", false, false, false, 4188) == 4) && (isset($context["oi"]) || array_key_exists("oi", $context) ? $context["oi"] : (function () { throw new RuntimeError('Variable "oi" does not exist.', 4188, $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.', 4188, $this->source); })()), "fe_block", [], "any", false, false, false, 4188))) {
// line 4189
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 4191
echo "
\t\t\t\t\t </div>
\t\t\t\t\t <!-- /.card-body -->
\t\t\t\t\t</div>
<form action=\"";
// line 4197
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.', 4197, $this->source); })()), "id", [], "any", false, false, false, 4197)]), "html", null, true);
echo "\" method=\"post\" id=\"form1\" name=\"form1\">
";
// line 4198
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.', 4198, $this->source); })()), "stock_find", [], "any", false, false, false, 4198)) {
// line 4199
echo " <div class=\"ec-productRole__actions\">
";
// line 4200
if (twig_get_attribute($this->env, $this->source, ($context["form"] ?? null), "classcategory_id1", [], "any", true, true, false, 4200)) {
// line 4201
echo " <div class=\"ec-select\">
";
// line 4202
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.', 4202, $this->source); })()), "classcategory_id1", [], "any", false, false, false, 4202), 'row');
echo "
";
// line 4203
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.', 4203, $this->source); })()), "classcategory_id1", [], "any", false, false, false, 4203), 'errors');
echo "
</div>
";
// line 4205
if (twig_get_attribute($this->env, $this->source, ($context["form"] ?? null), "classcategory_id2", [], "any", true, true, false, 4205)) {
// line 4206
echo " <div class=\"ec-select\">
";
// line 4207
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.', 4207, $this->source); })()), "classcategory_id2", [], "any", false, false, false, 4207), 'row');
echo "
";
// line 4208
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.', 4208, $this->source); })()), "classcategory_id2", [], "any", false, false, false, 4208), 'errors');
echo "
</div>
";
}
// line 4211
echo " ";
}
// line 4212
echo " <div class=\"ec-numberInput\">
";
// line 4213
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.', 4213, $this->source); })()), "quantity", [], "any", false, false, false, 4213), 'widget', ["type" => "hidden"]);
echo "
";
// line 4214
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.', 4214, $this->source); })()), "quantity", [], "any", false, false, false, 4214), 'errors');
echo "
</div>
</div>
";
} else {
// line 4219
echo " <div class=\"ec-productRole__btn\">
<button type=\"button\" class=\"ec-blockBtn--action\" disabled=\"disabled\">
";
// line 4221
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("ただいま品切れ中です。"), "html", null, true);
echo "
</button>
</div>
";
}
// line 4225
echo " <div class=\"ec-productRole__btn mt-3\">
<button type=\"submit\" id=\"cart_btn\" class=\"ec-blockBtn--action add-cart\">カートに入れる</button>
</div>
";
// line 4228
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.', 4228, $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 4233
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 4234
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 4237
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 4238
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 4244
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.', 4244, $this->source); })()), "description_detail", [], "any", false, false, false, 4244));
echo "
</div>
";
// line 4248
echo " <div class=\"ec-productRole__share\">
<ul class=\"ec-share\">
<li class=\"ec-share__item\">
<a href=\"https://twitter.com/share?url=";
// line 4251
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.', 4251, $this->source); })()), "request", [], "any", false, false, false, 4251), "uri", [], "any", false, false, false, 4251)), "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.', 4251, $this->source); })()), "name", [], "any", false, false, false, 4251)), "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 4256
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.', 4256, $this->source); })()), "request", [], "any", false, false, false, 4256), "uri", [], "any", false, false, false, 4256)), "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 4261
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.', 4261, $this->source); })()), "request", [], "any", false, false, false, 4261), "uri", [], "any", false, false, false, 4261)), "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 4269
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__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 4278
$context["spTotalQty"] = $this->extensions['Eccube\Twig\Extension\CartServiceExtension']->get_carts_total_quantity();
// line 4279
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.', 4279, $this->source); })()) > 0)) {
// line 4280
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.', 4280, $this->source); })())), "html", null, true);
echo "</span>
\t\t\t\t ";
}
// line 4282
echo "\t\t\t\t </button>
\t\t\t\t <a href=\"";
// line 4283
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 4289
echo "\t\t\t\t<div id=\"tg-options\" class=\"tg-options-container col-12\"></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\">395000円</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\">395,000円</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\">307,008円</span>
\t\t\t\t\t </a>
\t\t\t\t\t </li>
\t\t\t\t\t ";
// line 4316
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.', 4316, $this->source); })()), "SaleType", [], "any", false, false, false, 4316), "id", [], "any", false, false, false, 4316) != 2)) {
// line 4317
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\">479,700円</span>
\t\t\t\t\t </a>
\t\t\t\t\t </li>
\t\t\t\t\t ";
} else {
// line 4324
echo "\t\t\t\t\t ";
// line 4325
echo "\t\t\t\t\t <span id=\"maker_price\" style=\"display:none;\">---円</span>
\t\t\t\t\t ";
}
// line 4327
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 4330
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.', 4330, $this->source); })()), "SaleType", [], "any", false, false, false, 4330), "id", [], "any", false, false, false, 4330) == 2)) {
echo "補助金(割引額)";
} else {
echo "お値引き";
}
// line 4331
echo "\t\t\t\t\t <span class=\"float-right\" id=\"mitsumori_off\">-172,692円</span>
\t\t\t\t\t </a>
\t\t\t\t\t </li>
\t\t\t\t\t ";
// line 4335
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.', 4335, $this->source); })()), "SaleType", [], "any", false, false, false, 4335), "id", [], "any", false, false, false, 4335) == 2)) {
// line 4336
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 4342
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\">53,250円</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\">6,297円</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;\">発行日: 2025/03/14</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\">399,080円</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 4435
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.', 4435, $this->source); })()), "name", [], "any", false, false, false, 4435), "html", null, true);
echo "</td>
\t\t\t <td>1</td>
\t\t\t <td>式</td>
\t\t\t <td id=\"mitsumori_price_01\">352,800</td>
\t\t\t <td id=\"mitsumori_price_02\">352,800</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\">10,000</td>
\t\t\t <td id=\"mitsumori_ct_02\">10,000</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\">362,800</td>
\t\t\t </tr>
\t\t\t <tr>
\t\t\t <th>消費税 (10%)</th>
\t\t\t <td id=\"mitsumori_tax\">36,280</td>
\t\t\t </tr>
\t\t\t <tr>
\t\t\t <th>合計:</th>
\t\t\t <td id=\"mitsumori_goukei_02\">399,080</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 4505
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 4506
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 ( 6928 => 4506, 6923 => 4505, 6851 => 4435, 6756 => 4342, 6748 => 4336, 6745 => 4335, 6740 => 4331, 6734 => 4330, 6729 => 4327, 6725 => 4325, 6723 => 4324, 6714 => 4317, 6711 => 4316, 6683 => 4289, 6675 => 4283, 6672 => 4282, 6666 => 4280, 6663 => 4279, 6661 => 4278, 6650 => 4269, 6640 => 4261, 6632 => 4256, 6622 => 4251, 6617 => 4248, 6611 => 4244, 6602 => 4238, 6596 => 4237, 6590 => 4234, 6586 => 4233, 6578 => 4228, 6573 => 4225, 6566 => 4221, 6562 => 4219, 6554 => 4214, 6550 => 4213, 6547 => 4212, 6544 => 4211, 6538 => 4208, 6534 => 4207, 6531 => 4206, 6529 => 4205, 6524 => 4203, 6520 => 4202, 6517 => 4201, 6515 => 4200, 6512 => 4199, 6510 => 4198, 6506 => 4197, 6498 => 4191, 6494 => 4189, 6491 => 4188, 6488 => 4184, 6482 => 4183, 6479 => 4182, 6476 => 4181, 6472 => 4179, 6460 => 4175, 6458 => 4174, 6455 => 4173, 6449 => 4170, 6437 => 4169, 6431 => 4168, 6424 => 4167, 6422 => 4166, 6417 => 4164, 6405 => 4163, 6399 => 4162, 6392 => 4161, 6389 => 4158, 6383 => 4157, 6374 => 4156, 6366 => 4154, 6363 => 4153, 6361 => 4152, 6359 => 4151, 6357 => 4150, 6355 => 4148, 6352 => 4147, 6349 => 4146, 6346 => 4145, 6343 => 4144, 6340 => 4143, 6337 => 4142, 6334 => 4141, 6331 => 4140, 6328 => 4139, 6325 => 4138, 6320 => 4137, 6317 => 4136, 6311 => 4135, 6306 => 4134, 6301 => 4133, 6296 => 4132, 6293 => 4131, 6290 => 4130, 6287 => 4129, 6280 => 4121, 6264 => 4107, 6262 => 4106, 6258 => 4104, 6244 => 4093, 6237 => 4088, 6235 => 4087, 6233 => 4086, 6229 => 4084, 6217 => 4075, 6213 => 4073, 6208 => 4070, 6200 => 4064, 6191 => 4058, 6183 => 4052, 6180 => 4049, 6169 => 4046, 6166 => 4045, 6163 => 4044, 6160 => 4043, 6157 => 4041, 6152 => 4038, 6142 => 4035, 6136 => 4034, 6130 => 4033, 6126 => 4032, 6119 => 4031, 6112 => 4030, 6110 => 4029, 6101 => 4027, 6098 => 4026, 6095 => 4025, 6092 => 4022, 6087 => 4019, 6077 => 4016, 6071 => 4015, 6065 => 4014, 6061 => 4013, 6054 => 4012, 6047 => 4011, 6045 => 4010, 6036 => 4008, 6033 => 4007, 6030 => 4006, 6027 => 4004, 6025 => 4003, 6021 => 4001, 6010 => 3995, 6001 => 3991, 5993 => 3988, 5985 => 3985, 5976 => 3982, 5973 => 3981, 5971 => 3980, 5966 => 3977, 5956 => 3971, 5947 => 3967, 5939 => 3964, 5931 => 3961, 5922 => 3958, 5919 => 3957, 5917 => 3956, 5912 => 3953, 5909 => 3951, 5907 => 3950, 5903 => 3948, 5889 => 3937, 5883 => 3933, 5880 => 3931, 5878 => 3930, 5874 => 3928, 5860 => 3917, 5854 => 3913, 5851 => 3911, 5846 => 3908, 5836 => 3905, 5830 => 3904, 5824 => 3903, 5820 => 3902, 5813 => 3901, 5806 => 3900, 5804 => 3899, 5795 => 3897, 5792 => 3896, 5789 => 3895, 5786 => 3893, 5781 => 3890, 5771 => 3887, 5765 => 3886, 5759 => 3885, 5755 => 3884, 5748 => 3883, 5741 => 3882, 5739 => 3881, 5729 => 3879, 5726 => 3878, 5723 => 3877, 5720 => 3875, 5715 => 3872, 5705 => 3869, 5699 => 3868, 5693 => 3867, 5689 => 3866, 5682 => 3865, 5675 => 3864, 5673 => 3863, 5664 => 3861, 5661 => 3860, 5658 => 3859, 5655 => 3857, 5650 => 3854, 5640 => 3851, 5634 => 3850, 5628 => 3849, 5624 => 3848, 5617 => 3847, 5610 => 3846, 5608 => 3845, 5599 => 3843, 5596 => 3842, 5594 => 3841, 5591 => 3840, 5586 => 3837, 5576 => 3834, 5570 => 3833, 5564 => 3832, 5560 => 3831, 5553 => 3830, 5546 => 3829, 5544 => 3828, 5535 => 3826, 5532 => 3825, 5530 => 3824, 5527 => 3823, 5522 => 3820, 5512 => 3817, 5506 => 3816, 5500 => 3815, 5496 => 3814, 5489 => 3813, 5482 => 3812, 5480 => 3811, 5471 => 3809, 5468 => 3808, 5465 => 3807, 5462 => 3805, 5460 => 3804, 5456 => 3802, 5326 => 3674, 5309 => 3658, 5306 => 3656, 5301 => 3653, 5293 => 3651, 5287 => 3649, 5282 => 3647, 5274 => 3645, 5272 => 3644, 5268 => 3643, 5261 => 3642, 5258 => 3641, 5253 => 3640, 5248 => 3637, 5245 => 3636, 5242 => 3634, 5236 => 3630, 5226 => 3627, 5222 => 3626, 5219 => 3625, 5214 => 3624, 5209 => 3621, 5206 => 3620, 5203 => 3618, 5195 => 3615, 5185 => 3607, 5182 => 3606, 5179 => 3604, 5171 => 3601, 5161 => 3593, 5158 => 3592, 5155 => 3590, 5150 => 3587, 5140 => 3584, 5136 => 3583, 5133 => 3582, 5128 => 3581, 5123 => 3578, 5120 => 3577, 5111 => 3569, 5086 => 3548, 5076 => 3543, 5065 => 3534, 5062 => 3533, 5052 => 3524, 5049 => 3520, 5046 => 3516, 5044 => 3515, 5040 => 3513, 5037 => 3512, 5035 => 3511, 5031 => 3509, 5026 => 3506, 5016 => 3503, 5010 => 3502, 5004 => 3501, 5000 => 3500, 4993 => 3499, 4986 => 3498, 4984 => 3497, 4974 => 3495, 4971 => 3494, 4968 => 3493, 4965 => 3491, 4960 => 3488, 4950 => 3485, 4944 => 3484, 4938 => 3483, 4934 => 3482, 4927 => 3481, 4920 => 3480, 4918 => 3479, 4908 => 3477, 4905 => 3476, 4902 => 3475, 4899 => 3470, 4894 => 3467, 4884 => 3464, 4878 => 3463, 4872 => 3462, 4868 => 3461, 4861 => 3460, 4854 => 3459, 4852 => 3458, 4843 => 3456, 4840 => 3455, 4837 => 3454, 4834 => 3452, 4829 => 3449, 4819 => 3446, 4813 => 3445, 4807 => 3444, 4803 => 3443, 4796 => 3442, 4789 => 3441, 4787 => 3440, 4778 => 3438, 4775 => 3437, 4772 => 3436, 4769 => 3433, 4764 => 3430, 4754 => 3427, 4748 => 3426, 4742 => 3425, 4738 => 3424, 4731 => 3423, 4724 => 3422, 4722 => 3421, 4713 => 3419, 4710 => 3418, 4708 => 3417, 4705 => 3416, 4700 => 3413, 4690 => 3410, 4684 => 3409, 4678 => 3408, 4674 => 3407, 4667 => 3406, 4660 => 3405, 4658 => 3404, 4649 => 3402, 4646 => 3401, 4643 => 3400, 4640 => 3395, 4635 => 3392, 4627 => 3390, 4621 => 3388, 4616 => 3386, 4608 => 3384, 4606 => 3383, 4600 => 3382, 4594 => 3381, 4590 => 3380, 4580 => 3379, 4577 => 3378, 4570 => 3377, 4568 => 3376, 4559 => 3374, 4556 => 3373, 4553 => 3372, 4550 => 3370, 4546 => 3368, 4543 => 3367, 4541 => 3365, 4540 => 3364, 4539 => 3363, 4538 => 3362, 4537 => 3361, 4536 => 3360, 4535 => 3359, 4534 => 3358, 4532 => 3357, 4529 => 3356, 4523 => 3355, 4520 => 3354, 4515 => 3353, 4510 => 3352, 4505 => 3351, 4502 => 3350, 4499 => 3349, 4494 => 3348, 4491 => 3347, 4488 => 3346, 4485 => 3345, 4479 => 3344, 4474 => 3343, 4469 => 3342, 4464 => 3341, 4461 => 3340, 4458 => 3339, 4455 => 3338, 4451 => 3329, 4447 => 3327, 4443 => 3325, 4434 => 3322, 4425 => 3321, 4421 => 3320, 4418 => 3319, 4416 => 3318, 4412 => 3316, 4403 => 3313, 4399 => 3312, 4395 => 3311, 4385 => 3309, 4381 => 3308, 4378 => 3307, 4376 => 3306, 4374 => 3305, 4365 => 3304, 4362 => 3303, 4359 => 3302, 4356 => 3300, 4352 => 3298, 4348 => 3296, 4339 => 3293, 4330 => 3292, 4326 => 3291, 4323 => 3290, 4319 => 3288, 4310 => 3285, 4303 => 3281, 4299 => 3280, 4289 => 3278, 4285 => 3277, 4282 => 3276, 4280 => 3275, 4271 => 3274, 4268 => 3273, 4265 => 3272, 4262 => 3270, 4258 => 3268, 4254 => 3266, 4245 => 3263, 4236 => 3262, 4232 => 3261, 4229 => 3260, 4225 => 3258, 4216 => 3255, 4209 => 3251, 4205 => 3250, 4195 => 3248, 4191 => 3247, 4188 => 3246, 4186 => 3245, 4177 => 3244, 4174 => 3243, 4171 => 3242, 4168 => 3240, 4164 => 3238, 4160 => 3236, 4151 => 3233, 4142 => 3232, 4138 => 3231, 4135 => 3230, 4133 => 3229, 4129 => 3227, 4120 => 3224, 4113 => 3220, 4109 => 3219, 4099 => 3217, 4095 => 3216, 4092 => 3215, 4090 => 3214, 4088 => 3213, 4079 => 3212, 4076 => 3211, 4073 => 3210, 4070 => 3208, 4066 => 3206, 4063 => 3205, 4061 => 3204, 4060 => 3203, 4059 => 3202, 4057 => 3201, 4054 => 3200, 4051 => 3199, 4048 => 3198, 4045 => 3197, 4042 => 3196, 4039 => 3195, 4036 => 3194, 4033 => 3193, 4031 => 3192, 4029 => 3191, 4017 => 3182, 4010 => 3177, 3998 => 3174, 3995 => 3173, 3992 => 3172, 3989 => 3170, 3978 => 3168, 3974 => 3167, 3971 => 3166, 3968 => 3164, 3962 => 3161, 3958 => 3160, 3955 => 3159, 3952 => 3158, 3946 => 3155, 3940 => 3154, 3937 => 3153, 3931 => 3150, 3927 => 3149, 3924 => 3148, 3922 => 3147, 3920 => 3146, 3916 => 3144, 3914 => 3143, 3910 => 3141, 3904 => 3140, 3899 => 3137, 3884 => 3135, 3875 => 3134, 3858 => 3133, 3854 => 3131, 3851 => 3130, 3847 => 3129, 3844 => 3128, 3841 => 3127, 3838 => 3126, 3825 => 3115, 3811 => 3103, 3805 => 3098, 3786 => 3096, 3769 => 3095, 3765 => 3093, 3754 => 3091, 3731 => 3087, 3725 => 3086, 3722 => 3085, 3704 => 3084, 3701 => 3083, 3697 => 3081, 3689 => 3077, 3681 => 3073, 3679 => 3072, 3676 => 3071, 3674 => 3070, 3664 => 3063, 3652 => 3056, 3647 => 3054, 3643 => 3052, 3637 => 3047, 3634 => 3046, 3628 => 3045, 3623 => 3044, 3618 => 3043, 3612 => 3042, 3606 => 3041, 3601 => 3040, 3598 => 3039, 3595 => 3038, 3592 => 3037, 3590 => 3036, 3580 => 3035, 3564 => 3028, 3560 => 3027, 3556 => 3026, 3552 => 3025, 3548 => 3023, 3542 => 3021, 3540 => 3020, 3535 => 3019, 3532 => 3018, 3522 => 3016, 3508 => 3014, 3500 => 3013, 3482 => 3012, 3477 => 3010, 3376 => 2916, 3368 => 2915, 3304 => 2854, 3204 => 2757, 3200 => 2756, 3184 => 2743, 3016 => 2577, 3013 => 2576, 3000 => 2575, 2997 => 2574, 2995 => 2573, 2992 => 2572, 2989 => 2571, 2976 => 2570, 2973 => 2569, 2970 => 2568, 2967 => 2566, 2964 => 2565, 2951 => 2564, 2948 => 2563, 2946 => 2562, 2943 => 2561, 2940 => 2560, 2927 => 2559, 2924 => 2558, 2922 => 2557, 2919 => 2556, 2916 => 2555, 2903 => 2554, 2900 => 2553, 2898 => 2552, 2895 => 2551, 2892 => 2550, 2879 => 2549, 2876 => 2548, 2874 => 2547, 2871 => 2546, 2868 => 2545, 2855 => 2544, 2852 => 2543, 2849 => 2542, 2846 => 2541, 2832 => 2540, 2829 => 2539, 2816 => 2538, 2813 => 2537, 2810 => 2536, 2717 => 2442, 2297 => 2025, 1940 => 1671, 1909 => 1643, 1896 => 1633, 1867 => 1607, 1863 => 1606, 1855 => 1601, 1406 => 1154, 1403 => 1153, 1397 => 1152, 1392 => 1151, 1387 => 1150, 1381 => 1149, 1375 => 1148, 1370 => 1147, 1367 => 1146, 1364 => 1145, 1361 => 1144, 1356 => 1141, 1343 => 1131, 1329 => 1120, 1301 => 1097, 1295 => 1096, 1289 => 1095, 1283 => 1094, 1277 => 1093, 1271 => 1092, 1265 => 1091, 1259 => 1090, 1253 => 1089, 1247 => 1088, 1241 => 1087, 1235 => 1086, 1229 => 1085, 1222 => 1083, 1216 => 1082, 1210 => 1081, 1204 => 1080, 1198 => 1079, 1178 => 1062, 1168 => 1055, 1138 => 1028, 1126 => 1018, 1117 => 1012, 1113 => 1010, 1111 => 1009, 1108 => 1008, 1099 => 1002, 1095 => 1000, 1093 => 999, 1021 => 929, 1013 => 927, 1011 => 926, 1006 => 924, 1003 => 923, 1001 => 922, 987 => 911, 983 => 909, 973 => 908, 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;
}
/* ============================================
スマホ用 見積金額 下部固定バー
============================================ */
#sp-mitsumori-bar {
display: none;
}
/* ============================================
商品タイプ選択 共通スタイル
============================================ */
/* セクションラベル */
.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);
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);
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;
}
.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);
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;
}
/* ============================================
施工エリア案内
============================================ */
.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__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\tvar \$list = \$('<div class=\"tg-choice-list\"></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 checked = (parseInt(ch.idx) === parseInt(oi_selected[axis] || 1)) ? ' checked' : '';
\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=\"tg-choice\"><input type=\"radio\" name=\"' + name + '\" id=\"' + inputId + '\" value=\"' + ch.idx + '\" data-axis=\"' + axis + '\"' + 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// ラジオ click で oi_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\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\" 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\tvar priceTxt = (parseInt(ch.price) || 0) > 0
\t\t\t\t\t? ' <span class=\"fe-block-price\" style=\"margin-left:6px;color:#666;font-size:12px;white-space:nowrap;\">(+' + formatter.format(toIncTax(parseInt(ch.price))) + '円 税込)</span>'
\t\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\tpriceTxt +
\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 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\tgoukei = basePrice + baseCt + 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\treturn {
\t\t\t\tgoukei: toIncTax(goukei),
\t\t\t\tprice: toIncTax(price),
\t\t\t\tct: toIncTax(ct),
\t\t\t\topt: toIncTax(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\tfunction finalizeGlassGrade(raw, subtype) {
\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\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);
\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}
\t\t\t} else if (subsidyRawSum > 0) {
\t\t\t\tsubsidyNote = '※補助金合計が 5 万円未満のため申請対象外です('
\t\t\t\t\t+ subsidyRawSum.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\$('#mitsumori_message').text(subsidyNote);
\t\t\t\$('#mitsumori_btn').show();
\t\t\t\$('#mitsumori_goukei').text(goukeiInc.toLocaleString() + '円');
\t\t\t\$('#mitsumori_price').text(sumPriceInc.toLocaleString() + '円');
\t\t\t\$('#mitsumori_ct').text(ctInc.toLocaleString() + '円');
\t\t\t\$('#mitsumori_option').text(optInc.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), '') !== 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_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\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\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;
\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\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\t// maker_price も scraper が税抜で保存しているため税込に変換
\t\t\t\tvar makerPrice = toIncTax(parseInt(el.maker_price) || 0);
\t\t\t\t\t\$('#mitsumori_message').text(formatter.format(goukei) + \"円\");
\t\t\t\t\t\$('#mitsumori_goukei').text(formatter.format(goukei) + \"円\");
\t\t\t\t\t\$('#mitsumori_off').text(formatter.format(price - makerPrice) + \"円\");
\t\t\t\t\t\$('#mitsumori_price').text(formatter.format(price) + \"円\");
\t\t\t\t\t\$('#maker_price').text(formatter.format(makerPrice) + \"円\");
\t\t\t\t\t\$('#mitsumori_ct').text(formatter.format(ct) + \"円\");
\t\t\t\t\t\$('#mitsumori_option').text(formatter.format(optionSum) + \"円\");
\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 明細用:オプション内訳テーブルを差し込む (施工オプション + 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\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\": \$('#mitsumori_goukei').text(),
\t\t\t\t\t\t\t\t\t\t\"mitsumori_goukei_02\": \$('#mitsumori_goukei_02').text(),
\t\t\t\t\t\t\t\t\t\t\"mitsumori_price\": \$('#mitsumori_price').text(),
\t\t\t\t\t\t\t\t\t\t\"maker_price\": \$('#maker_price').text(),
\t\t\t\t\t\t\t\t\t\t\"mitsumori_off\": \$('#mitsumori_off').text(),
\t\t\t\t\t\t\t\t\t\t\"mitsumori_ct\": \$('#mitsumori_ct').text(),
\t\t\t\t\t\t\t\t\t\t\"mitsumori_option\": \$('#mitsumori_option').text(),
\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\tvar goukeiText = \$('#mitsumori_goukei').text();
\t\t\tvar priceText = \$('#mitsumori_price').text();
\t\t\tvar ctText = \$('#mitsumori_ct').text();
\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(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\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// option1/option2 のラベルは category 依存 (rd: ランマ/タイプ, sh: サイズプリセット/駆動方式 等).
\t\t// PHP から渡された option1_label / option2_label を埋め込み、JS 側でラベル更新に使う.
\t\tvar optLabelMap = {pc:'カラー', pw:'幅', pd:'奥行き', ph:'高さ', pm:'素材',
\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\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// 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 }
);
}
})();
// ===== 現在のお見積り額: 折りたたみトグルボタンのテキスト切り替え =====
(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' %}
{% 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 = 'タイプ' %}{% endif %}
{% if pcat.category_id == 15 %}{% set option1_label = '棚タイプ' %}{% endif %}
{% if pcat.category_id == 17 %}{% set option1_label = '窓タイプ' %}{% endif %}
{% endfor %}
{% endif %}
<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>
{% if Product.hasProductClass -%}
{% if Product.getPrice02IncTaxMin == Product.getPrice02IncTaxMax %}
<div class=\"ec-price\">
<span id=\"price02-display\" class=\"ec-price__price price02-default\">{{ Product.getPrice02IncTaxMin|price }}</span>
<span class=\"ec-price__tax\">({{ '税込'|trans }})~</span>
</div>
{% else %}
<div class=\"ec-price\">
<span id=\"price02-display\" class=\"ec-price__price price02-default\">{{ Product.getPrice02IncTaxMin|price }} ~ {{ Product.getPrice02IncTaxMax|price }}</span>
<span class=\"ec-price__tax\">({{ '税込'|trans }})</span>
</div>
{% endif %}
{% else %}
<div class=\"ec-price\">
<span id=\"price02-display\" class=\"ec-price__price\">{{ Product.getPrice02IncTaxMin|price }}</span>
<span class=\"ec-price__tax\">({{ '税込'|trans }})~</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>
\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 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 %}
<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 %}
<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 <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 <div class=\"opt-btn-group\">
\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 <small class=\"text-muted\">補助金額<br><span class=\"wt-subsidy-amount\">―</span> 円</small>
\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 </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__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{# tg カテゴリ用: block 別オプション差額ラジオ (W/D 確定後に JS が動的描画) #}
\t\t\t\t<div id=\"tg-options\" class=\"tg-options-container col-12\"></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\">395000円</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\">395,000円</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\">307,008円</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\">479,700円</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\">-172,692円</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\">53,250円</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\">6,297円</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;\">発行日: 2025/03/14</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\">399,080円</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\">352,800</td>
\t\t\t <td id=\"mitsumori_price_02\">352,800</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\">10,000</td>
\t\t\t <td id=\"mitsumori_ct_02\">10,000</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\">362,800</td>
\t\t\t </tr>
\t\t\t <tr>
\t\t\t <th>消費税 (10%)</th>
\t\t\t <td id=\"mitsumori_tax\">36,280</td>
\t\t\t </tr>
\t\t\t <tr>
\t\t\t <th>合計:</th>
\t\t\t <td id=\"mitsumori_goukei_02\">399,080</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");
}
}