{"version":3,"sources":["projects.js"],"names":["filterBtn","document","getElementById","filterText","querySelector","filterItems","filterCount","getElementsByClassName","addEventListener","e","preventDefault","classList","remove","style","display","add","innerText","allTagsCount","length","tagAll","children","decodedUri","decodeURI","location","href","replaceAll","tags","substring","indexOf","split","updateURI","word","regex","RegExp","regexResult","exec","beginning","index","includes","splice","push","join"],"mappings":";;AAAA,IAAMA,YAAYC,SAASC,cAAT,cAAlB;AACA,IAAMC,aAAaF,SAASG,aAAT,gBAAnB;AACA,IAAMC,cAAcJ,SAASG,aAAT,iBAApB;AACA,IAAME,cAAcL,SAASM,sBAAT,CAAgC,YAAhC,EAA8C,CAA9C,CAApB;AACA;;AAEAP,UAAUQ,gBAAV,UAAoC,UAACC,CAAD,EAAO;AACvCA,MAAEC,cAAF;AACAP,eAAWQ,SAAX,CAAqBC,MAArB;AACA,QAAIP,YAAYQ,KAAZ,CAAkBC,OAAlB,KAA8B,MAA9B,IAAwC,CAACT,YAAYQ,KAAZ,CAAkBC,OAA/D,EAAwE;AACpET,oBAAYQ,KAAZ,CAAkBC,OAAlB,GAA4B,MAA5B;AACAX,mBAAWQ,SAAX,CAAqBC,MAArB;AACAN,oBAAYK,SAAZ,CAAsBI,GAAtB,CAA0B,gBAA1B;AACH,KAJD,MAIO;AACHV,oBAAYQ,KAAZ,CAAkBC,OAAlB,GAA4B,MAA5B;AACAX,mBAAWQ,SAAX,CAAqBI,GAArB;AACAT,oBAAYK,SAAZ,CAAsBC,MAAtB,CAA6B,gBAA7B;AACH;AACD,QAAG,CAACN,YAAYU,SAAhB,EAA0B;AACtBV,oBAAYK,SAAZ,CAAsBI,GAAtB,CAA0B,gBAA1B;AACH;AACJ,CAfD;;AAiBA,IAAME,eAAehB,SAASM,sBAAT,CAAgC,aAAhC,EAA+CW,MAApE;AACA,IAAMC,SAASlB,SAASM,sBAAT,CAAgC,aAAhC,EAA+C,CAA/C,EAAkDa,QAAlD,CAA2D,CAA3D,EAA8DJ,SAA7E;AACA,IAAIK,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R,MAAL,IAAeD,eAAe,CAA9B,IAAmC,CAACS,KAAKY,QAAL,CAAcnB,MAAd,CAAtD,CAAJ,EAAkF;AAC9EI,qBAASC,IAAT,GAAgBH,WAAWM,SAAX,CAAqB,CAArB,EAAwBN,WAAWO,OAAX,CAAmB,MAAnB,IAA6B,CAArD,CAAhB;AACA;AACH;AACJ;AACD,QAAIP,WAAWO,OAAX,CAAmB,MAAnB,KAA8B,CAAC,CAAnC,EAAsC;AAClCL,iBAASC,IAAT,GAAgBH,aAAa,QAAb,GAAwBU,IAAxC;AACH,KAFD,MAGK;AACDR,iBAASC,IAAT,GAAgBH,WAAWM,SAAX,CAAqB,CAArB,EAAwBN,WAAWO,OAAX,CAAmB,MAAnB,IAA6B,CAArD,IAA0DF,KAAKe,IAAL,CAAU,GAAV,CAA1E;AACH;AACJ","file":"projects.js","sourcesContent":["const filterBtn = document.getElementById(`filter-btn`);\r\nconst filterText = document.querySelector(`.filter-text`);\r\nconst filterItems = document.querySelector(`.filter-items`);\r\nconst filterCount = document.getElementsByClassName('filter-pin')[0];\r\n// Open and close btn filter mob. ver.\r\n\r\nfilterBtn.addEventListener(`click`, (e) => {\r\n e.preventDefault();\r\n filterText.classList.remove(`filter-text__hidden`);\r\n if (filterItems.style.display === \"none\" || !filterItems.style.display) {\r\n filterItems.style.display = \"flex\";\r\n filterText.classList.remove(`display-hidden`);\r\n filterCount.classList.add('display-hidden');\r\n } else {\r\n filterItems.style.display = \"none\";\r\n filterText.classList.add(`filter-text__hidden`);\r\n filterCount.classList.remove('display-hidden');\r\n }\r\n if(!filterCount.innerText){\r\n filterCount.classList.add('display-hidden');\r\n }\r\n});\r\n\r\nconst allTagsCount = document.getElementsByClassName('filter-item').length;\r\nconst tagAll = document.getElementsByClassName('filter-item')[0].children[0].innerText;\r\nlet decodedUri = decodeURI(location.href);\r\ndecodedUri = decodedUri.replaceAll(\" \", \"+\");\r\nconst tags = decodedUri.substring(decodedUri.indexOf(\"tags\") + 5).split(\"+\");\r\n\r\n\r\nif(tags.length >= 1 && decodedUri.indexOf(\"tags\") !== -1){\r\n filterCount.classList.remove('display-hidden');\r\n filterCount.innerText = tags.length;\r\n} else {\r\n filterCount.classList.add('display-hidden');\r\n}\r\n\r\nfunction updateURI(word)\r\n{\r\n const regex = RegExp('pageToGet=[0-9]+', 'g');\r\n const regexResult = regex.exec(decodedUri);\r\n if (regexResult) {\r\n const beginning = decodedUri.substring(0, regexResult.index - 1)\r\n decodedUri = beginning + \"?tags=\";\r\n }\r\n\r\n word = word.replaceAll(\" \", \"_\");\r\n if (tags.includes(word)) {\r\n tags.splice(tags.indexOf(word), 1);\r\n if (tags.length == 0) {\r\n location.href = decodedUri.substring(0, decodedUri.indexOf(\"tags\") - 1);\r\n return;\r\n }\r\n }\r\n else {\r\n tags.push(word);\r\n if (word == tagAll | (tags.length == allTagsCount - 1 && !tags.includes(tagAll))) {\r\n location.href = decodedUri.substring(0, decodedUri.indexOf(\"tags\") - 1);\r\n return;\r\n }\r\n }\r\n if (decodedUri.indexOf(\"tags\") == -1) {\r\n location.href = decodedUri + \"?tags=\" + word;\r\n }\r\n else {\r\n location.href = decodedUri.substring(0, decodedUri.indexOf(\"tags\") + 5) + tags.join(\"+\");\r\n }\r\n}"]}