{"version":3,"file":"frontend-block-entries.js","mappings":"CAOgC,WACzB,MAAuBA,OAAOC,SAA5BC,EAAQ,WAAEC,EAAM,SAClBC,EAAS,IAAIC,gBAAgBF,GAC7BG,EAAiBF,EAAOG,WAO9B,GALAH,EAAOI,OAAO,YACdJ,EAAOI,OAAO,gBACdJ,EAAOI,OAAO,mBAGVF,IAAmBF,EAAOG,WAA9B,CAIA,IAAIE,EAAMP,EAENE,EAAOG,aACVE,GAAO,WAAIL,EAAOG,aAGnBG,QAAQC,UAAU,KAAM,GAAIF,EAR5B,CASD,CAEAG,GAMAC,SAASC,iBAAiB,mBAAmB,SAACC,GAC7C,IAAMC,EAAUD,EAAcE,OAAOD,OAC/BE,EAAOL,SAASM,cAAc,qBAAcH,IAE7CE,EAAKC,cAAc,8BAKxBD,EAAKE,YAAYF,EAAKG,WAAU,GACjC","sources":["webpack://gp-entry-blocks/./js/src/frontend/block-entries.ts"],"sourcesContent":["/**\n * Removes query params such as duplicate_entry, delete_entry, and _wpnonce from the URL to prevent\n * re-duplication from happening if a page is refreshed.\n *\n * We chose this route over a wp_redirect() to improve page speed. POST is still on the table as it might work better\n * with aggressive caching, but comes with the trade-off of still getting a browser confirmation dialog on refresh.\n */\nconst removeActionQueryParams = () => {\n\tconst { pathname, search } = window.location;\n\tconst params = new URLSearchParams(search);\n\tconst existingParams = params.toString();\n\n\tparams.delete('_wpnonce');\n\tparams.delete('delete_entry');\n\tparams.delete('duplicate_entry');\n\n\t// Only push state if we actually removed a param.\n\tif (existingParams === params.toString()) {\n\t\treturn;\n\t}\n\n\tlet url = pathname;\n\n\tif (params.toString()) {\n\t\turl += `?${params.toString()}`;\n\t}\n\n\thistory.pushState(null, '', url);\n};\n\nremoveActionQueryParams();\n\n/**\n * GF 2.9 compatibility for Filters Block. This bypasses ensureValidHandler()'s addition of a submit\n * event handler that forces the form to submit with the button that Gravity Forms expects.\n */\ndocument.addEventListener('gform/post_init', (event) => {\n\tconst formId = (event as any).detail.formId;\n\tconst form = document.querySelector(`form#gform_${formId}`);\n\n\tif (!form.querySelector('button.gpeb_clear_filters')) {\n\t\treturn;\n\t}\n\n\t// Clone the form to remove the submit event handler.\n\tform.replaceWith(form.cloneNode(true));\n});\n"],"names":["window","location","pathname","search","params","URLSearchParams","existingParams","toString","delete","url","history","pushState","removeActionQueryParams","document","addEventListener","event","formId","detail","form","querySelector","replaceWith","cloneNode"],"sourceRoot":""}