//go:build !no_gotd_slices
// +build !no_gotd_slices

// Code generated by gotdgen, DO NOT EDIT.

package tg

import (
	
	
	
	
	

	

	
	
	
	
)

// No-op definition for keeping imports.
var (
	_ = bin.Buffer{}
	_ = context.Background()
	_ = fmt.Stringer(nil)
	_ = strings.Builder{}
	_ = errors.Is
	_ = multierr.AppendInto
	_ = sort.Ints
	_ = tdp.Format
	_ = tgerr.Error{}
	_ = tdjson.Encoder{}
)

// VideoSizeClassArray is adapter for slice of VideoSizeClass.
type VideoSizeClassArray []VideoSizeClass

// Sort sorts slice of VideoSizeClass.
func ( VideoSizeClassArray) ( func(,  VideoSizeClass) bool) VideoSizeClassArray {
	sort.Slice(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// SortStable sorts slice of VideoSizeClass.
func ( VideoSizeClassArray) ( func(,  VideoSizeClass) bool) VideoSizeClassArray {
	sort.SliceStable(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// Retain filters in-place slice of VideoSizeClass.
func ( VideoSizeClassArray) ( func( VideoSizeClass) bool) VideoSizeClassArray {
	 := 0
	for ,  := range  {
		if () {
			[] = 
			++
		}
	}
	 = [:]

	return 
}

// First returns first element of slice (if exists).
func ( VideoSizeClassArray) () ( VideoSizeClass,  bool) {
	if len() < 1 {
		return
	}
	return [0], true
}

// Last returns last element of slice (if exists).
func ( VideoSizeClassArray) () ( VideoSizeClass,  bool) {
	if len() < 1 {
		return
	}
	return [len()-1], true
}

// PopFirst returns first element of slice (if exists) and deletes it.
func ( *VideoSizeClassArray) () ( VideoSizeClass,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [0]

	// Delete by index from SliceTricks.
	copy([0:], [1:])
	var  VideoSizeClass
	[len()-1] = 
	 = [:len()-1]
	* = 

	return , true
}

// Pop returns last element of slice (if exists) and deletes it.
func ( *VideoSizeClassArray) () ( VideoSizeClass,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [len()-1]
	 = [:len()-1]
	* = 

	return , true
}

// AsVideoSize returns copy with only VideoSize constructors.
func ( VideoSizeClassArray) () ( VideoSizeArray) {
	for ,  := range  {
		,  := .(*VideoSize)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsVideoSizeEmojiMarkup returns copy with only VideoSizeEmojiMarkup constructors.
func ( VideoSizeClassArray) () ( VideoSizeEmojiMarkupArray) {
	for ,  := range  {
		,  := .(*VideoSizeEmojiMarkup)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// AsVideoSizeStickerMarkup returns copy with only VideoSizeStickerMarkup constructors.
func ( VideoSizeClassArray) () ( VideoSizeStickerMarkupArray) {
	for ,  := range  {
		,  := .(*VideoSizeStickerMarkup)
		if ! {
			continue
		}
		 = append(, *)
	}

	return 
}

// VideoSizeArray is adapter for slice of VideoSize.
type VideoSizeArray []VideoSize

// Sort sorts slice of VideoSize.
func ( VideoSizeArray) ( func(,  VideoSize) bool) VideoSizeArray {
	sort.Slice(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// SortStable sorts slice of VideoSize.
func ( VideoSizeArray) ( func(,  VideoSize) bool) VideoSizeArray {
	sort.SliceStable(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// Retain filters in-place slice of VideoSize.
func ( VideoSizeArray) ( func( VideoSize) bool) VideoSizeArray {
	 := 0
	for ,  := range  {
		if () {
			[] = 
			++
		}
	}
	 = [:]

	return 
}

// First returns first element of slice (if exists).
func ( VideoSizeArray) () ( VideoSize,  bool) {
	if len() < 1 {
		return
	}
	return [0], true
}

// Last returns last element of slice (if exists).
func ( VideoSizeArray) () ( VideoSize,  bool) {
	if len() < 1 {
		return
	}
	return [len()-1], true
}

// PopFirst returns first element of slice (if exists) and deletes it.
func ( *VideoSizeArray) () ( VideoSize,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [0]

	// Delete by index from SliceTricks.
	copy([0:], [1:])
	var  VideoSize
	[len()-1] = 
	 = [:len()-1]
	* = 

	return , true
}

// Pop returns last element of slice (if exists) and deletes it.
func ( *VideoSizeArray) () ( VideoSize,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [len()-1]
	 = [:len()-1]
	* = 

	return , true
}

// VideoSizeEmojiMarkupArray is adapter for slice of VideoSizeEmojiMarkup.
type VideoSizeEmojiMarkupArray []VideoSizeEmojiMarkup

// Sort sorts slice of VideoSizeEmojiMarkup.
func ( VideoSizeEmojiMarkupArray) ( func(,  VideoSizeEmojiMarkup) bool) VideoSizeEmojiMarkupArray {
	sort.Slice(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// SortStable sorts slice of VideoSizeEmojiMarkup.
func ( VideoSizeEmojiMarkupArray) ( func(,  VideoSizeEmojiMarkup) bool) VideoSizeEmojiMarkupArray {
	sort.SliceStable(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// Retain filters in-place slice of VideoSizeEmojiMarkup.
func ( VideoSizeEmojiMarkupArray) ( func( VideoSizeEmojiMarkup) bool) VideoSizeEmojiMarkupArray {
	 := 0
	for ,  := range  {
		if () {
			[] = 
			++
		}
	}
	 = [:]

	return 
}

// First returns first element of slice (if exists).
func ( VideoSizeEmojiMarkupArray) () ( VideoSizeEmojiMarkup,  bool) {
	if len() < 1 {
		return
	}
	return [0], true
}

// Last returns last element of slice (if exists).
func ( VideoSizeEmojiMarkupArray) () ( VideoSizeEmojiMarkup,  bool) {
	if len() < 1 {
		return
	}
	return [len()-1], true
}

// PopFirst returns first element of slice (if exists) and deletes it.
func ( *VideoSizeEmojiMarkupArray) () ( VideoSizeEmojiMarkup,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [0]

	// Delete by index from SliceTricks.
	copy([0:], [1:])
	var  VideoSizeEmojiMarkup
	[len()-1] = 
	 = [:len()-1]
	* = 

	return , true
}

// Pop returns last element of slice (if exists) and deletes it.
func ( *VideoSizeEmojiMarkupArray) () ( VideoSizeEmojiMarkup,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [len()-1]
	 = [:len()-1]
	* = 

	return , true
}

// VideoSizeStickerMarkupArray is adapter for slice of VideoSizeStickerMarkup.
type VideoSizeStickerMarkupArray []VideoSizeStickerMarkup

// Sort sorts slice of VideoSizeStickerMarkup.
func ( VideoSizeStickerMarkupArray) ( func(,  VideoSizeStickerMarkup) bool) VideoSizeStickerMarkupArray {
	sort.Slice(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// SortStable sorts slice of VideoSizeStickerMarkup.
func ( VideoSizeStickerMarkupArray) ( func(,  VideoSizeStickerMarkup) bool) VideoSizeStickerMarkupArray {
	sort.SliceStable(, func(,  int) bool {
		return ([], [])
	})
	return 
}

// Retain filters in-place slice of VideoSizeStickerMarkup.
func ( VideoSizeStickerMarkupArray) ( func( VideoSizeStickerMarkup) bool) VideoSizeStickerMarkupArray {
	 := 0
	for ,  := range  {
		if () {
			[] = 
			++
		}
	}
	 = [:]

	return 
}

// First returns first element of slice (if exists).
func ( VideoSizeStickerMarkupArray) () ( VideoSizeStickerMarkup,  bool) {
	if len() < 1 {
		return
	}
	return [0], true
}

// Last returns last element of slice (if exists).
func ( VideoSizeStickerMarkupArray) () ( VideoSizeStickerMarkup,  bool) {
	if len() < 1 {
		return
	}
	return [len()-1], true
}

// PopFirst returns first element of slice (if exists) and deletes it.
func ( *VideoSizeStickerMarkupArray) () ( VideoSizeStickerMarkup,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [0]

	// Delete by index from SliceTricks.
	copy([0:], [1:])
	var  VideoSizeStickerMarkup
	[len()-1] = 
	 = [:len()-1]
	* = 

	return , true
}

// Pop returns last element of slice (if exists) and deletes it.
func ( *VideoSizeStickerMarkupArray) () ( VideoSizeStickerMarkup,  bool) {
	if  == nil || len(*) < 1 {
		return
	}

	 := *
	 = [len()-1]
	 = [:len()-1]
	* = 

	return , true
}