@php
    $type = $type ?? 'for-sale';
    if($item->mansion_id!=null){
    $mansion = $item->getMansion();
    }
    if (!function_exists('convertLimitString')){
        function convertLimitString($item, $limit = 40, $type = 'memo'){
            if($type == 'memo'){
                $text = html_entity_decode($item->memo_business);
            } elseif ($type == 'catchcopy'){
                $text = html_entity_decode($item->catchcopy);
            }
//            {!!strlen($item->memo_business) > 40 ? mb_substr($item->memo_business, 0, 40,"UTF-8") : $item->memo_business!!}
            $txtLength =  mb_strlen($text, 'utf8');
            if($txtLength > $limit){
                return  htmlentities(mb_substr($text,0,$limit,"UTF-8"));
            }
            return $text;
        }
    }
@endphp

@php
    $dataLand = $item;
    if ($mansion = $item->getMansion())
    $dataLand = $mansion;
@endphp
<style>
    .list-inline li {
        display: inline-block !important;
    }

    .list-inline li:first-child {
        max-width: 40%
    }

    .p-detail-main-sheet__shop-address span {
        //max-width: 78%;
        //float: right;
    }
</style>
<div class="p-detail-main-sheet p-detail-main origin-content theme theme-1">
    <div class="justify-content-between">
        @include('business.objects.projects.image-print-small',['point_recommend_full'=>false])
        @include('business.objects.projects.detail-print')
        <div class="clear"></div>
    </div>
    @include('business.objects.projects.shop-print')
</div>

<div
    class="main-content p-detail-main-sheet p-detail-main new-content @if($item->vertical === 1){{ 'vertical' }}@else {{ 'horizontal' }}@endif @if($item->sheet_file_type === 1) {{ 'sheet-1' }} @endif">
    <div data-vertical="{{ $item->vertical }}"
         class="justify-content-between preview-image-board-container print-preview-theme" id="print-preview-theme">
        <div class="header-content" id="header-content">
            <div class="header-content-stamp">
                <img class="stamp1">
            </div>

            {{--            company 3 case --}}
            @if(auth()->user()->company_id == 3)
                @if($item->is_home)
                    {{--                    check type house--}}
                    @if(in_array($item->property, [4, 5]))
                        @if($item->property_sub === \App\Models\MstPropertyType::NEW)
                            @include('business.objects.projects.print.header-logo.house-header-new-print')
                        @else
                            @include('business.objects.projects.print.header-logo.house-header-old-print')
                        @endif
                    @endif
                    {{--                    end of check type house--}}
                @elseif($item->is_land)
                    @include('business.objects.projects.print.header-logo.land-header-print')
                @elseif($item->is_room)
                    @include('business.objects.projects.print.header-logo.room-header-print')
                @endif
            @else
                @if($item->is_home)
                    {{--                    check type house--}}
                    @if($item->property_sub === \App\Models\MstPropertyType::NEW)
                        @include('business.objects.projects.print.header-logo.standard-company.house-header-new-std')
                    @else
                        @include('business.objects.projects.print.header-logo.standard-company.house-header-old-std')
                    @endif
                    {{--                    end of check type house--}}
                @elseif($item->is_land)
                    @include('business.objects.projects.print.header-logo.standard-company.land-header-std')
                @elseif($item->is_room)
                    @include('business.objects.projects.print.header-logo.standard-company.room-header-std')
                @endif
            @endif


            <div class="header-content-info">
                <div class="header-content-info--sub">
                    @if($item->status == 4)
                        <span class="p-detail-main-sheet__left-name__icon-status">契約済</span>
                    @elseif($item->status == 5)
                        <span class="p-detail-main-sheet__left-name__icon-status">売りやめ</span>
                    @endif
                    <span><b>{{$item->article_name}}</b></span>
                </div>
                <div class="sub-info">
                    <div class="subinfo-txt pl-0">
                        <span><b>{{$item->getSheetCopy2(25)}}</b></span>
                    </div>
                    <div class="subinfo-num">
                        @if($item->status != 4 and $item->status != 5)
                            <b><span>
                                    <span>{{number_format($item->price, 0, ",", ",")}}</span>
                                    <span class="suffix">万円</span>
                                </span>
                                <span class="suffix">{{getDescriptionTax($item->tax)}}</span>
                            </b>
                        @endif
                    </div>
                </div>
            </div>
        </div>

        <div class="sheet-content">
            @include('business.objects.projects.image-print-large')
            @if($item->is_home)
                @include('business.objects.projects.print.detail-house')
                @include('business.objects.projects.print.detail-house-small')
            @elseif($item->is_land)
                @include('business.objects.projects.print.detail-land')
                @include('business.objects.projects.print.detail-land-small')
            @elseif($item->is_room)
                @include('business.objects.projects.print.detail-room')
                @include('business.objects.projects.print.detail-room-small')
            @endif
        </div>

        <div class="clear"></div>
        <div class="header-content-stamp-2">
            <img class="stamp2">
        </div>
        <div class="header-content-stamp-3">
            <img class="stamp3">
        </div>
    </div>
    @include('business.objects.projects.shop-print-large')
</div>




