<commit_before><template>
    <div class="carousel-3d-container" :style="{height: this.slideHeight + 'px'}">
        <div class="carousel-3d-slider" :style="{width: this.slideWidth + 'px', height: this.slideHeight + 'px'}">
            <slot></slot>
        </div>
        <controls v-if="controlsVisible" :next-html="controlsNextHtml" :prev-html="controlsPrevHtml"
                  :width="controlsWidth" :height="controlsHeight"></controls>
    </div>
</template>

<script>
    import autoplay from './mixins/autoplay'
    import Controls from './Controls.vue'
    import Slide from './Slide.vue'

    const noop = () => {
    }

    export default {
        name: 'carousel3d',
        components: {
            Controls,
            Slide
        },
        props: {
            count: {
                type: [Number, String],
                default: 0
            },
            perspective: {
                type: [Number, String],
                default: 35
            },
            display: {
                type: [Number, String],
                default: 5
            },
            loop: {
                type: Boolean,
                default: true
            },
            animationSpeed: {
                type: [Number, String],
                default: 500
            },
            dir: {
                type: String,
                default: 'rtl'
            },
            width: {
                type: [Number, String],
                default: 360
            },
            height: {
                type: [Number, String],
                default: 270
            },
            border: {
                type: [Number, String],
                default: 1
            },
            space: {
                type: [Number, String],
                default: 'auto'
            },
            startIndex: {
                type: [Number, String],
                default: 0
            },
            clickable: {
                type: Boolean,
                default: true
            },
            disable3d: {
                type: Boolean,
                default: false
            },
            minSwipeDistance: {
                type: Number,
                default: 10
            },
            inverseScaling: {
                type: [Number, String],
                default: 300
            },
            controlsVisible: {
                type: Boolean,
                default: false
            },
            controlsPrevHtml: {
                type: String,
                default: '&lsaquo;'
            },
            controlsNextHtml: {
                type: String,
                default: '&rsaquo;'
            },
            controlsWidth: {
                type: [String, Number],
                default: 50
            },
            controlsHeight: {
                type: [String, Number],
                default: 50
            },
            onLastSlide: {
                type: Function,
                default: noop
            },
            onSlideChange: {
                type: Function,
                default: noop
            },
            bias: {
                type: String,
                default: 'left'
            }
        },
        data () {
            return {
                viewport: 0,
                currentIndex: 0,
                total: 0,
                lock: false,
                dragOffset: 0,
                dragStartX: 0,
                mousedown: false,
                zIndex: 998
            }
        },
        mixins: [
            autoplay
        ],
        watch: {
            count () {
                this.computeData()
            }
        },
        computed: {
            isLastSlide () {
                return this.currentIndex === this.total - 1
            },
            isFirstSlide () {
                return this.currentIndex === 0
            },
            isNextPossible () {
                return !(!this.loop && this.isLastSlide)
            },
            isPrevPossible () {
                return !(!this.loop && this.isFirstSlide)
            },
            slideWidth () {
                const vw = this.viewport
                const sw = parseInt(this.width) + (parseInt(this.border, 10) * 2)

                return vw < sw ? vw : sw
            },
            slideHeight () {
                const sw = parseInt(this.width, 10) + (parseInt(this.border, 10) * 2)
                const sh = parseInt(parseInt(this.height) + (this.border * 2), 10)
                const ar = this.calculateAspectRatio(sw, sh)

                return this.slideWidth / ar
            },
            visible () {
                const v = (this.display > this.total) ? this.total : this.display
                return v
            },
            hasHiddenSlides () {
                return this.total > this.visible
            },
            leftIndices () {
                let n = (this.visible - 1) / 2

                n = (this.bias.toLowerCase() === 'left' ? Math.ceil(n) : Math.floor(n))

                const indices = []

                for (let m = 1; m <= n; m++) {
                    indices.push((this.dir === 'ltr')
                        ? (this.currentIndex + m) % (this.total)
                        : (this.currentIndex - m) % (this.total))
                }

                return indices
            },
            rightIndices () {
                let n = (this.visible - 1) / 2
                console.log(this.bias)
                n = (this.bias.toLowerCase() === 'right' ? Math.ceil(n) : Math.floor(n))
                const indices = []

                for (let m = 1; m <= n; m++) {
                    indices.push((this.dir === 'ltr')
                        ? (this.currentIndex - m) % (this.total)
                        : (this.currentIndex + m) % (this.total))
                }
<commit_msg>remove console log<commit_after><template>
    <div class="carousel-3d-container" :style="{height: this.slideHeight + 'px'}">
        <div class="carousel-3d-slider" :style="{width: this.slideWidth + 'px', height: this.slideHeight + 'px'}">
            <slot></slot>
        </div>
        <controls v-if="controlsVisible" :next-html="controlsNextHtml" :prev-html="controlsPrevHtml"
                  :width="controlsWidth" :height="controlsHeight"></controls>
    </div>
</template>

<script>
    import autoplay from './mixins/autoplay'
    import Controls from './Controls.vue'
    import Slide from './Slide.vue'

    const noop = () => {
    }

    export default {
        name: 'carousel3d',
        components: {
            Controls,
            Slide
        },
        props: {
            count: {
                type: [Number, String],
                default: 0
            },
            perspective: {
                type: [Number, String],
                default: 35
            },
            display: {
                type: [Number, String],
                default: 5
            },
            loop: {
                type: Boolean,
                default: true
            },
            animationSpeed: {
                type: [Number, String],
                default: 500
            },
            dir: {
                type: String,
                default: 'rtl'
            },
            width: {
                type: [Number, String],
                default: 360
            },
            height: {
                type: [Number, String],
                default: 270
            },
            border: {
                type: [Number, String],
                default: 1
            },
            space: {
                type: [Number, String],
                default: 'auto'
            },
            startIndex: {
                type: [Number, String],
                default: 0
            },
            clickable: {
                type: Boolean,
                default: true
            },
            disable3d: {
                type: Boolean,
                default: false
            },
            minSwipeDistance: {
                type: Number,
                default: 10
            },
            inverseScaling: {
                type: [Number, String],
                default: 300
            },
            controlsVisible: {
                type: Boolean,
                default: false
            },
            controlsPrevHtml: {
                type: String,
                default: '&lsaquo;'
            },
            controlsNextHtml: {
                type: String,
                default: '&rsaquo;'
            },
            controlsWidth: {
                type: [String, Number],
                default: 50
            },
            controlsHeight: {
                type: [String, Number],
                default: 50
            },
            onLastSlide: {
                type: Function,
                default: noop
            },
            onSlideChange: {
                type: Function,
                default: noop
            },
            bias: {
                type: String,
                default: 'left'
            }
        },
        data () {
            return {
                viewport: 0,
                currentIndex: 0,
                total: 0,
                lock: false,
                dragOffset: 0,
                dragStartX: 0,
                mousedown: false,
                zIndex: 998
            }
        },
        mixins: [
            autoplay
        ],
        watch: {
            count () {
                this.computeData()
            }
        },
        computed: {
            isLastSlide () {
                return this.currentIndex === this.total - 1
            },
            isFirstSlide () {
                return this.currentIndex === 0
            },
            isNextPossible () {
                return !(!this.loop && this.isLastSlide)
            },
            isPrevPossible () {
                return !(!this.loop && this.isFirstSlide)
            },
            slideWidth () {
                const vw = this.viewport
                const sw = parseInt(this.width) + (parseInt(this.border, 10) * 2)

                return vw < sw ? vw : sw
            },
            slideHeight () {
                const sw = parseInt(this.width, 10) + (parseInt(this.border, 10) * 2)
                const sh = parseInt(parseInt(this.height) + (this.border * 2), 10)
                const ar = this.calculateAspectRatio(sw, sh)

                return this.slideWidth / ar
            },
            visible () {
                const v = (this.display > this.total) ? this.total : this.display
                return v
            },
            hasHiddenSlides () {
                return this.total > this.visible
            },
            leftIndices () {
                let n = (this.visible - 1) / 2

                n = (this.bias.toLowerCase() === 'left' ? Math.ceil(n) : Math.floor(n))

                const indices = []

                for (let m = 1; m <= n; m++) {
                    indices.push((this.dir === 'ltr')
                        ? (this.currentIndex + m) % (this.total)
                        : (this.currentIndex - m) % (this.total))
                }

                return indices
            },
            rightIndices () {
                let n = (this.visible - 1) / 2

                n = (this.bias.toLowerCase() === 'right' ? Math.ceil(n) : Math.floor(n))
                const indices = []

                for (let m = 1; m <= n; m++) {
                    indices.push((this.dir === 'ltr')
                        ? (this.currentIndex - m) % (this.total)
                        : (this.currentIndex + m) % (this.total))
                }

{'fraction_non_alphanumeric': 0.11108267212695162, 'fraction_numerical': 0.009384864772630322, 'mean_word_length': 0.9225848778087584, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7014149', 'n_tokens_mistral': 3143, 'n_tokens_neox': 2856, 'n_words': 647}