{"version":3,"file":"check-RTuHeYxa.js","sources":["../../../app/javascript/utils/cookies.js","../../../app/javascript/components/ui/DelayModal.vue","../../../app/assets/icons/cached/expand_less.svg","../../../app/assets/icons/cached/download.svg","../../../app/javascript/components/auction/auctionBatchesContext.js","../../../app/assets/icons/cached/check.svg"],"sourcesContent":["/* Based on CookieManager.js | v1.1.2 |\n * https://github.com/Gigabyte5671/CookieManager\n */\n\nconst domains = {\n development: \"\",\n staging: \"ratsap.com.br\",\n production: \"erural.net\",\n};\n\nconst domainName = domains[import.meta.env.VITE_RAILS_ENV];\n\nconst setCookie = (cookieName, cookieValue, lifespanInSeconds) => {\n let d = new Date();\n d.setTime(d.getTime() + lifespanInSeconds * 1000);\n let expires = d.toUTCString();\n\n return (document.cookie = `${cookieName}=${cookieValue};expires=${expires};path=/;domain=${domainName};SameSite=Strict;`);\n};\n\nconst getCookie = (cookieName) => {\n let name = `${cookieName}=`;\n let cookieArray = document.cookie.split(\";\");\n\n for (let i = 0; i < cookieArray.length; i++) {\n let cookie = cookieArray[i];\n\n while (cookie.charAt(0) == \" \") {\n cookie = cookie.substring(1);\n }\n\n if (cookie.indexOf(name) == 0) {\n return cookie.substring(name.length, cookie.length);\n }\n }\n return null;\n};\n\nconst checkCookie = (cookieName) => {\n return !!cookieName && document.cookie.includes(`${cookieName}=`);\n};\n\nconst clearCookie = (cookieName) => {\n setCookie(cookieName, \"\", -1);\n};\n\nexport { setCookie, getCookie, checkCookie, clearCookie };\n","\n\n\n","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n xmlns: \"http://www.w3.org/2000/svg\",\n height: \"24\",\n viewBox: \"0 0 24 24\",\n width: \"24\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"path\", {\n d: \"M0 0h24v24H0V0z\",\n fill: \"none\"\n}, null, -1)\nconst _hoisted_3 = /*#__PURE__*/_createElementVNode(\"path\", { d: \"M11.29 8.71L6.7 13.3c-.39.39-.39 1.02 0 1.41.39.39 1.02.39 1.41 0L12 10.83l3.88 3.88c.39.39 1.02.39 1.41 0 .39-.39.39-1.02 0-1.41L12.7 8.71c-.38-.39-1.02-.39-1.41 0z\" }, null, -1)\nconst _hoisted_4 = [\n _hoisted_2,\n _hoisted_3\n]\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, _hoisted_4))\n}\nexport default { render: render }","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n xmlns: \"http://www.w3.org/2000/svg\",\n height: \"24\",\n viewBox: \"0 0 24 24\",\n width: \"24\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"path\", {\n d: \"M0 0h24v24H0V0z\",\n fill: \"none\"\n}, null, -1)\nconst _hoisted_3 = /*#__PURE__*/_createElementVNode(\"path\", { d: \"M16.59 9H15V4c0-.55-.45-1-1-1h-4c-.55 0-1 .45-1 1v5H7.41c-.89 0-1.34 1.08-.71 1.71l4.59 4.59c.39.39 1.02.39 1.41 0l4.59-4.59c.63-.63.19-1.71-.7-1.71zM5 19c0 .55.45 1 1 1h12c.55 0 1-.45 1-1s-.45-1-1-1H6c-.55 0-1 .45-1 1z\" }, null, -1)\nconst _hoisted_4 = [\n _hoisted_2,\n _hoisted_3\n]\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, _hoisted_4))\n}\nexport default { render: render }","import { reactive, ref, watch } from \"vue\";\nimport api from \"services/api\";\nimport { auctions_search_batches_url } from \"utils/routes\";\n\nconst requestBatches = ref([]);\nconst page = ref(1);\nconst hasMore = ref(true);\nconst isLoading = ref(false);\nconst auctionUrlFriendly = ref({});\n\nconst bottomSheetState = reactive({\n isActive: false,\n chosenOrdination: \"Padrão\",\n ordinationTypes: [\n { type: \"batch_number\", name: \"Padrão\", active: true },\n { type: \"highest_price\", name: \"Maior preço\", active: false },\n { type: \"lowest_price\", name: \"Menor preço\", active: false },\n { type: \"highest_iabcz\", name: \"Maior iABCZ\", active: false },\n { type: \"highest_age\", name: \"Maior idade\", active: false },\n { type: \"lowest_age\", name: \"Menor idade\", active: false },\n ],\n});\n\nwatch(bottomSheetState, () => {\n const ordination = bottomSheetState.ordinationTypes.find((o) => o.active);\n bottomSheetState.chosenOrdination = ordination.name;\n});\n\nconst toggleActive = () => {\n bottomSheetState.isActive = !bottomSheetState.isActive;\n};\n\nconst seeMore = (mixpanelData) => {\n mixpanel.track(\"Event - More Products Clicked\", mixpanelData);\n\n page.value++;\n\n const currentOrdination = bottomSheetState.ordinationTypes.find(\n (o) => o.active == true,\n );\n\n api\n .get(\n auctions_search_batches_url({\n url_friendly: auctionUrlFriendly.value,\n page: page.value,\n ordination_type: currentOrdination.type,\n }),\n )\n .then((response) => {\n requestBatches.value.push(...response.data);\n\n if (response.data.length < 30) {\n hasMore.value = false;\n }\n });\n};\n\nconst changeOrdination = (ordination) => {\n let type = ordination.type;\n\n if (!ordination.active) {\n bottomSheetState.ordinationTypes.forEach((o) => (o.active = false));\n ordination.active = true;\n } else {\n ordination.active = false;\n bottomSheetState.ordinationTypes.forEach(\n (o) => o.type == \"batch_number\" && (o.active = true),\n );\n type = \"batch_number\";\n }\n\n if (!hasMore.value) {\n sortBatches(type);\n } else {\n getSortedBatches(type);\n }\n\n toggleActive();\n};\n\nconst sortBatches = (type) => {\n requestBatches.value.sort((a, b) => {\n switch (type) {\n case \"highest_price\":\n return b.list_view.price_per_animal - a.list_view.price_per_animal;\n case \"lowest_price\":\n return a.list_view.price_per_animal - b.list_view.price_per_animal;\n case \"highest_iabcz\":\n return b.list_view.highest_zebu_index - a.list_view.highest_zebu_index;\n case \"lowest_age\":\n return (\n a.list_view.highest_age_in_months - b.list_view.highest_age_in_months\n );\n case \"highest_age\":\n return (\n b.list_view.highest_age_in_months - a.list_view.highest_age_in_months\n );\n default:\n return a.list_view.number - b.list_view.number;\n }\n });\n};\n\nconst getSortedBatches = (type) => {\n page.value = page.value > 1 ? 1 : page.value;\n isLoading.value = true;\n\n api\n .get(\n auctions_search_batches_url({\n url_friendly: auctionUrlFriendly.value,\n page: page.value,\n ordination_type: type,\n }),\n )\n .then((response) => {\n requestBatches.value = response.data;\n\n if (response.data.length < 30) {\n hasMore.value = false;\n }\n\n isLoading.value = false;\n });\n};\n\nexport {\n requestBatches,\n bottomSheetState,\n toggleActive,\n seeMore,\n hasMore,\n isLoading,\n changeOrdination,\n auctionUrlFriendly,\n};\n","import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n xmlns: \"http://www.w3.org/2000/svg\",\n height: \"24\",\n viewBox: \"0 0 24 24\",\n width: \"24\"\n}\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"path\", {\n d: \"M0 0h24v24H0V0z\",\n fill: \"none\"\n}, null, -1)\nconst _hoisted_3 = /*#__PURE__*/_createElementVNode(\"path\", { d: \"M9 16.17L5.53 12.7c-.39-.39-1.02-.39-1.41 0-.39.39-.39 1.02 0 1.41l4.18 4.18c.39.39 1.02.39 1.41 0L20.29 7.71c.39-.39.39-1.02 0-1.41-.39-.39-1.02-.39-1.41 0L9 16.17z\" }, null, -1)\nconst _hoisted_4 = [\n _hoisted_2,\n _hoisted_3\n]\n\nexport function render(_ctx, _cache) {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, _hoisted_4))\n}\nexport default { render: render }"],"names":["domains","domainName","setCookie","cookieName","cookieValue","lifespanInSeconds","d","expires","checkCookie","_sfc_main","props","mixpanelProps","visible","ref","onMounted","_hoisted_2","$setup","$props","_createElementBlock","_normalizeClass","_createElementVNode","_hoisted_1","args","_hoisted_3","_hoisted_4","render","_ctx","_cache","_openBlock","ExpandLessIcon","DownloadIcon","requestBatches","page","hasMore","isLoading","auctionUrlFriendly","bottomSheetState","reactive","watch","ordination","o","toggleActive","seeMore","mixpanelData","currentOrdination","api","auctions_search_batches_url","response","changeOrdination","type","getSortedBatches","sortBatches","a","b","CheckIcon"],"mappings":"2IAIA,MAAMA,EAAU,CACd,YAAa,GACb,QAAS,gBACT,WAAY,YACd,EAEMC,EAAaD,EAAQ,WAErBE,EAAY,CAACC,EAAYC,EAAaC,IAAsB,CAC5D,IAAAC,MAAQ,KACZA,EAAE,QAAQA,EAAE,QAAQ,EAAID,EAAoB,GAAI,EAC5C,IAAAE,EAAUD,EAAE,cAER,OAAA,SAAS,OAAS,GAAGH,CAAU,IAAIC,CAAW,YAAYG,CAAO,kBAAkBN,CAAU,mBACvG,EAoBMO,EAAeL,GACZ,CAAC,CAACA,GAAc,SAAS,OAAO,SAAS,GAAGA,CAAU,GAAG,ECV7DM,EAAU,CACb,MAAO,CACL,KAAM,OACN,QAAS,OACT,QAAS,OACT,MAAO,OACP,QAAS,OACV,EACD,MAAMC,EAAO,CACX,GAAIA,EAAM,QAAS,OAEnB,MAAMC,EAAgB,CACpB,MAAS,SAAS,MAClB,WAAYD,EAAM,QAClB,WAAYA,EAAM,SAGdE,EAAUC,EAAI,EAAK,EACzB,OAAAC,EAAU,IAAM,CACd,WAAW,IAAM,CACfF,EAAQ,MAAQ,CAACJ,EAAY,aAAa,EAC1C,SAAS,MAAM,yBAA0BG,CAAa,CACxD,EAAGD,EAAM,MAAQ,GAAI,CACvB,CAAC,EAoBM,CACL,QAAAE,EACA,cApBoB,IAAM,CAC1B,SAAS,MAAM,uBAAwBD,CAAa,EAEpDT,EAAU,cAAe,GAAM,EAAI,GAAK,EAAE,EAC1CU,EAAQ,MAAQ,IAiBhB,WAdiB,IAAM,CACvBV,EAAU,cAAe,GAAM,EAAI,GAAK,EAAE,EAE1C,WAAW,IAAM,OAAO,KAAKQ,EAAM,QAAS,QAAQ,EAAE,QAAS,GAAG,EAElE,SAAS,MAAM,4BAA6BC,EAAe,IAAM,CAC/DC,EAAQ,MAAQ,GAChB,OAAO,KAAKF,EAAM,QAAS,QAAQ,EAA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