o
    tBh                     @   sJ   d dl Z d dlZejd  dk rd dlmZ nd dlmZ dZdddZdS )	    N   )urlparsez[a-z0-9][a-z0-9-]*[a-z0-9]myshopify.comc                 C   sz   t | pd  }||vrd|vr|dj|d7 }tdd|}tdj|d}tdjtt	|d	|j
r;|j
S d S )
N .z	.{domain})domainz	https?://zhttp://{hostname})hostnamez	{h}\.{d}$)hd)strlowerstripformatresubr   matchHOSTNAME_PATTERNescapenetloc)shop_domainmyshopify_domainnameuri r   m/var/www/html/riverr-enterprise-integrations-main/venv/lib/python3.10/site-packages/shopify/utils/shop_url.pysanitize_shop_domain   s   r   )r   )r   sysversion_infor   urllib.parser   r   r   r   r   r   <module>   s    