@hhgtech/hhg-components 1.21.85 → 1.21.87

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/build/babyGrowth.js +1 -1
  2. package/build/components/molecules/pillCarousel/index.d.ts +2 -1
  3. package/build/components/organisms/pregnancyWeightGainChart/index.d.ts +3 -1
  4. package/build/components.js +1 -1
  5. package/build/esm/babyGrowth.js +1 -1
  6. package/build/esm/components.js +1 -1
  7. package/build/esm/index-00262df6.js +1 -0
  8. package/build/esm/index-1010794b.js +1 -0
  9. package/build/esm/index-129f52d4.js +1 -0
  10. package/build/esm/index-509de1e7.js +1 -0
  11. package/build/esm/index-6e8b940a.js +1 -0
  12. package/build/esm/index-80bee14c.js +1 -0
  13. package/build/esm/index-dd4f46cd.js +1 -0
  14. package/build/esm/index-e9896017.js +1 -0
  15. package/build/esm/index.js +1 -1
  16. package/build/esm/index.styled-9ccca63b.js +1 -0
  17. package/build/esm/mantine.js +1 -1
  18. package/build/esm/navigation.js +1 -1
  19. package/build/esm/pwg.js +1 -1
  20. package/build/esm/together.js +1 -1
  21. package/build/esm/types-6ad6d4c9.js +1 -0
  22. package/build/esm/utils-13b25141.js +1 -0
  23. package/build/index-1dd7c311.js +1 -0
  24. package/build/index-6cfb17f6.js +1 -0
  25. package/build/index-88b15787.js +1 -0
  26. package/build/index-953fc456.js +1 -0
  27. package/build/index-ac20567b.js +1 -0
  28. package/build/index-ae77acec.js +1 -0
  29. package/build/index-c76c6e27.js +1 -0
  30. package/build/index-e640a891.js +1 -0
  31. package/build/index.js +1 -1
  32. package/build/index.styled-05afa7e7.js +1 -0
  33. package/build/mantine.js +1 -1
  34. package/build/navigation.js +1 -1
  35. package/build/pwg.js +1 -1
  36. package/build/together.js +1 -1
  37. package/build/types-a931f8cc.js +1 -0
  38. package/build/utils-ae703992.js +1 -0
  39. package/package.json +2 -3
  40. package/build/esm/index-0f2ac9f2.js +0 -1
  41. package/build/esm/index-182c57d1.js +0 -1
  42. package/build/esm/index-2058993e.js +0 -1
  43. package/build/esm/index-276d754d.js +0 -1
  44. package/build/esm/index-ab34085c.js +0 -1
  45. package/build/esm/index-eced25ed.js +0 -1
  46. package/build/esm/index-fdce1dc1.js +0 -1
  47. package/build/esm/types-c751a7fb.js +0 -1
  48. package/build/index-0db09db1.js +0 -1
  49. package/build/index-46eab25f.js +0 -1
  50. package/build/index-76dc603c.js +0 -1
  51. package/build/index-91ac4f65.js +0 -1
  52. package/build/index-a8d5c663.js +0 -1
  53. package/build/index-aae60289.js +0 -1
  54. package/build/index-ebcffc91.js +0 -1
  55. package/build/types-a556493e.js +0 -1
@@ -0,0 +1 @@
1
+ "use strict";var e=require("./tslib.es6-e6f346c4.js"),t=require("./utils-df758048.js"),r=require("styled-components"),o=require("./cookieHelper-612b90fa.js"),a=require("slugify"),n=require("string-format"),i=require("react");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s,c,u=l(r),_=l(a),p=l(n),d=l(i),E=u.default.div(s||(s=e.__makeTemplateObject(["\n position: fixed;\n left: 50%;\n\n padding: 0 16px 32px;\n background-color: ",";\n border-radius: 6px;\n box-shadow: 0px 4px 8px ",";\n transform: translate(-50%, -50%);\n transition: all 0.5s ease-in-out;\n visibility: hidden;\n\n &[data-open='true'] {\n z-index: 200;\n top: 50%;\n opacity: 1;\n visibility: visible;\n }\n\n &[data-open='false'] {\n top: -50%;\n }\n\n &[data-type='lead'] {\n width: 332px;\n height: 460px;\n\n div {\n top: -15px;\n right: -15px;\n }\n }\n\n &[data-type='form'] {\n width: 496px;\n height: 548px;\n "," {\n width: 340px;\n }\n }\n\n &[data-type='confirm'] {\n "," {\n width: calc(100% - 32px);\n }\n "," {\n width: 100%;\n max-width: 407px;\n }\n }\n\n .popup-content {\n position: relative;\n z-index: 111;\n height: 100%;\n padding: 16px;\n }\n\n .close-button {\n position: absolute;\n top: 16px;\n right: 0;\n cursor: pointer;\n\n img {\n width: 100%;\n height: 100%;\n border-radius: 50%;\n }\n }\n"],["\n position: fixed;\n left: 50%;\n\n padding: 0 16px 32px;\n background-color: ",";\n border-radius: 6px;\n box-shadow: 0px 4px 8px ",";\n transform: translate(-50%, -50%);\n transition: all 0.5s ease-in-out;\n visibility: hidden;\n\n &[data-open='true'] {\n z-index: 200;\n top: 50%;\n opacity: 1;\n visibility: visible;\n }\n\n &[data-open='false'] {\n top: -50%;\n }\n\n &[data-type='lead'] {\n width: 332px;\n height: 460px;\n\n div {\n top: -15px;\n right: -15px;\n }\n }\n\n &[data-type='form'] {\n width: 496px;\n height: 548px;\n "," {\n width: 340px;\n }\n }\n\n &[data-type='confirm'] {\n "," {\n width: calc(100% - 32px);\n }\n "," {\n width: 100%;\n max-width: 407px;\n }\n }\n\n .popup-content {\n position: relative;\n z-index: 111;\n height: 100%;\n padding: 16px;\n }\n\n .close-button {\n position: absolute;\n top: 16px;\n right: 0;\n cursor: pointer;\n\n img {\n width: 100%;\n height: 100%;\n border-radius: 50%;\n }\n }\n"])),(function(e){return e.theme.colors.white}),(function(e){return e.theme.colors.gray200}),t.MediaQueries.mbDown,t.MediaQueries.mbDown,t.MediaQueries.mbUp),T=u.default.div(c||(c=e.__makeTemplateObject(["\n position: fixed;\n z-index: 110;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n align-items: center;\n background: rgba(38, 38, 38, 0.3);\n\n &[data-open='false'] {\n display: none;\n }\n"],["\n position: fixed;\n z-index: 110;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n align-items: center;\n background: rgba(38, 38, 38, 0.3);\n\n &[data-open='false'] {\n display: none;\n }\n"]))),h="DD/MM/YYYY",m="/images/avatar.jpg",A="/images/default-image.jpg",g={DUE_DATE:"DUE_DATE",BMI:"BMI",BMR:"BMR",OVULATION:"OVULATION",IFRAME:"IFRAME",PWG:"PWG",THR:"THR"},b={"id-ID":{"kalkulator-bmi":g.BMI,"kebutuhan-kalori":g.BMR,"kalkulator-hari-perkiraan-lahir":g.DUE_DATE,"kalkulator-masa-subur-2":g.OVULATION,"kalkulator-kenaikan-berat-badan-ibu-hamil":g.PWG,"kalkulator-detak-jantung-saat-olahraga":g.THR},"ms-MY":{"kalkulator-bmi":g.BMI,"kalkulator-bmr":g.BMR,"kalkulator-tarikh-bersalin":g.DUE_DATE,"kalkulator-kesuburan":g.OVULATION,"kalkulator-tambah-berat-badan-hamil":g.PWG,"target-heart-rate-calculator":g.THR},"vi-VN":{"cach-tinh-chi-so-bmi":g.BMI,"tinh-chi-so-bmr":g.BMR,"cong-cu-tinh-ngay-du-sinh":g.DUE_DATE,"tinh-ngay-rung-trung":g.OVULATION,"cong-cu-tinh-can-nang-khi-mang-thai":g.PWG,"cong-cu-do-nhip-tim":g.THR},"zh-TW":{"bmi-calculator":g.BMI,"bmr-calculator":g.BMR,"due-date-calculator":g.DUE_DATE,"ovulation-calculator":g.OVULATION,"pregnancy-weight-gain-calculator":g.PWG,"target-heart-rate-calculator":g.THR},"en-PH":{"bmi-calculator":g.BMI,"bmr-calculator":g.BMR,"due-date-calculator":g.DUE_DATE,"ovulation-calculator":g.OVULATION,"pregnancy-weight-gain-calculator":g.PWG,"target-heart-rate-calculator":g.THR},"th-TH":{"เครื่องคำนวณหา-ค่าดัชนี":g.BMI,"เครื่องคำนวณอัตราการเผาผลาญพลังงาน-bmr":g.BMR,"เครื่องมือคำนวณกำหนดคลอด":g.DUE_DATE,"เครื่องคำนวณการตกไข่-ovulation-calculat":g.OVULATION,"เครื่องคำนวณน้ำหนักตัว":g.PWG,"เครื่องวัดอัตราการเต้น":g.THR},"hi-IN":{"bmi-calculator-en":g.BMI,"bmi-calculator":g.BMI,"bmr-calculator":g.BMR,"delivery-date-calculator":g.DUE_DATE,"ovulation-calculator":g.OVULATION,"pregnancy-weight-gain-calculator":g.PWG,"target-heart-rate-calculator":g.THR},"km-KH":{"គណនា-bmi":g.BMI,"គណនា-bmr":g.BMR,"គណនាថ្ងៃសម្រាលកូន":g.DUE_DATE,"គណនាថ្ងៃមេជីវិតញីទុំធ្លាក់":g.OVULATION,"គណនាទម្ងន់ស្ត្រីពពោះ":g.PWG,"គណនារកចង្វាក់បេះដូងល្អ":g.THR},"my-MM":{"bmi-calculator":g.BMI,"bmr-calculator":g.BMR,"due-date-calendar":g.DUE_DATE,"ovulation-calculator":g.OVULATION,"pregnaancy-weight-calculator":g.PWG,"target-heartrate":g.THR,"pregnancy-weight-calculator":g.PWG,"target-heart-rate":g.THR}},O="hhg_user_token",v="together_admin_token",I={report_scam:{label:"morePopover.report.scam",reportReasonText:"morePopover.report.scam"},report_sex:{label:"morePopover.report.sex",reportReasonText:"morePopover.report.sex"},report_offensive:{label:"morePopover.report.offensive",reportReasonText:"morePopover.report.offensive"},report_violence:{label:"morePopover.report.violence",reportReasonText:"morePopover.report.violence"},report_prohibited:{label:"morePopover.report.prohibited",reportReasonText:"morePopover.report.prohibited"},report_spam:{label:"morePopover.report.spam",reportReasonText:"morePopover.report.spam"},report_falseNews:{label:"morePopover.report.falseNews",reportReasonText:"morePopover.report.falseNews"},report_other:{label:"morePopover.report.other",reportReasonText:"morePopover.report.other"}},L={"en-PH":{ALL:"all",HOSPITAL:"hospital",SERVICE:"service",DOCTOR:"doctor",SEARCH:"search",SPECIALTIES:"specialties",CURRENT:"current-location"},"vi-VN":{ALL:"tat-ca",HOSPITAL:"benh-vien",SERVICE:"dich-vu",DOCTOR:"bac-si",SEARCH:"tim-kiem",SPECIALTIES:"chuyen-khoa",CURRENT:"vi-tri-hien-tai"},"id-ID":{ALL:"semua",HOSPITAL:"rumah-sakit",SERVICE:"layanan",DOCTOR:"dokter",SEARCH:"cari",SPECIALTIES:"spesialisasi",CURRENT:"posisi-saya-saat-ini"}},f=Object.freeze({__proto__:null,POST_DATE_FORMAT:"dd/MM/yyyy",NORMAL_DATE_FORMAT:"YYYY-MM-DD",DUE_DATE_FORMAT:h,DEFAULT_AVATAR_IMG:m,DEFAULT_RESULT_IMG:"/images/default.png",DEFAULT_IMG:A,BMI_LEVELS:["underweight","healthy","overweight","obese_level_1","obese_level_2"],BMR_LEVELS:["low","normal","high"],CORAL_TOKEN_COOKE:"coral_together_user_token",HEALTH_TOOL_TYPE:g,LOCALE_HEALTH_TOOLS:b,BEARER_TOKEN_COOKIE:O,TOGETHER_DISCLAIMER_COOKIE:"hhg_together_disclaimer",BEARER_ADMIN_TOKEN_COOKIE:v,Z_INDEX:{adBlock:48,articleAdContainer:47,headerContainerHome:99,headerContainerPopup:200,headerContainerPopupSUbLevel:300,menuSearchInputPopup:5,menuSearchInputDisplayIcon:6,menuSearchPopup:200},BmrActiveLevels:[{value:"sedentary",icon:"bmr-sedentary",name:"bmr.activeLevel.sedentary",description:"bmr.activeLevel.sedentary.description"},{value:"lightly-active",icon:"bmr-light",name:"bmr.activeLevel.lightlyActive",description:"bmr.activeLevel.lightlyActive.description"},{value:"moderately-active",icon:"bmr-moderately",name:"bmr.activeLevel.moderatelyActive",description:"bmr.activeLevel.moderatelyActive.description"},{value:"intensely-active",icon:"bmr-intensively",name:"bmr.activeLevel.intenselyActive",description:"bmr.activeLevel.intenselyActive.description"},{value:"extremely-active",icon:"bmr-extremely",name:"bmr.activeLevel.extremelyActive",description:"bmr.activeLevel.extremelyActive.description"}],LEAD_CAMPAIGN_CODE:"lmoct7xfr5sv4fv",LEAD_TOKEN_COOKIE:"hhg-id",GA_TOKEN_COOKIE:"_ga",GOOGLE_CALENDAR_AUTH_CLIENT_ID:"1038242799566-esoq4ij201ve5qfp266nbca44scpo3c6.apps.googleusercontent.com",FIND_CARE_IFRAME_URL:"https://www.appsheet.com/start/4ba34ebe-3cb6-4c16-8dd4-d074025a5bb6#appName=DependentDropdowns-2711103&group=%5B%5D&page=card&sort=%5B%5D&table=Menu&view=Menu",REPORT_REASON_MAP:I,MB_SOCIAL_LINKS:{LINKEDIN:"https://www.linkedin.com/company/hello-health-group/",FACEBOOK:"https://www.facebook.com/marry.baby.vn",INSTAGRAM:"https://www.instagram.com/marrybaby.vn/",TWITTER:"",YOUTUBE:"https://www.youtube.com/channel/UCeZybTkY1VzJ3N7LvPGdKbg",ZALO:"http://zalo.me/806483414530291942"},INTERNAL_ROLES:["admin","moderator","local-admin"],EXTERNAL_ROLES:["ambassador","expert","sponsor","guide","influencer"],INTERNAL_PROFILE_ROLES:["moderator","local-admin"],EXTERNAL_PROFILE_ROLES:["expert","ambassador","sponsor"],RoleDataMap:{moderator:{text:"Moderator",fid:"cardAuthor.moderator",background:"#fe921d"},admin:{text:"Admin",fid:"cardAuthor.admin",background:"#2b62cd"},"local-admin":{text:"Local admin",fid:"cardAuthor.localAdmin",background:"#2b62cd"},expert:{text:"Expert",fid:"cardAuthor.expert",background:"#ff6f4d"},sponsor:{text:"Sponsor",fid:"cardAuthor.sponsor",background:"#00c7e6"},ambassador:{text:"Ambassador",fid:"cardAuthor.ambassador",background:"#00CB8A"}},MAX_IMAGE_UPLOADS:20,LOCALISED_SLUGS:L}),w={BASE_API_PATH:"/",PROFILE:"profile?website_url={website_url}",SEARCH_USER:"profile/search?website_url={website_url}&name={name}",FETCH_PREVIEW:"fetch/preview?website_url={website_url}",FETCH_POST_OR_TOPIC:"fetch/{slug}?website_url={website_url}&community_slug={communitySlug}",POST:{LIST:"post?website_url={website_url}&slug={slug}&pin={pin}&page={page}&community_id={communityId}&topic_id={topicId}&sort_by={sort}&id={id}",DETAIL_BY_ID_OR_SLUG:"post/{idSlug}?website_url={website_url}",CREATE:"post/create?website_url={website_url}",LIKE:"post/{id}/like?website_url={website_url}",DELETE:"post/{id}/delete?website_url={website_url}",REPORT:"post/{id}/report?website_url={website_url}",UPDATE:"post/{id}/update?website_url={website_url}",FOLLOW:"post/{id}/follow?website_url={website_url}",CREATE_ARTICLE_COMMENT:"article-comment/create?website_url={website_url}"},COMMENT:{LIST:"comment?website_url={website_url}&post_id={postId}&page={page}&sort_by={sort}&items_per_page={perPage}&_without_reply={withoutReply}",CREATE:"comment/create?website_url={website_url}",REPLY:"comment/reply?website_url={website_url}",DELETE:"comment/{id}/delete?website_url={website_url}",LIKE:"comment/{id}/like?website_url={website_url}",UNLIKE:"comment/{id}/unlike?website_url={website_url}",IMAGE_UPLOAD:"comment/image/upload?website_url={website_url}"},COMMUNITY:{LIST:"community?website_url={website_url}&page={page}",DETAIL_BY_ID_OR_SLUG:"community/{idSlug}?website_url={website_url}",JOIN:"community/join?website_url={website_url}",LEAVE:"community/leave?website_url={website_url}"},TOPIC:{LIST:"topic?website_url={website_url}&community_slug={communitySlug}&community_id={communityId}&page={page}",DETAIL_BY_ID_OR_SLUG:"topic/{idSlug}?website_url={website_url}&community_slug={communitySlug}&community_id={communityId}",HEALTH_TOOLS:"tools?topic_id={topicId}&website_url={website_url}",SUBOTS:"subots?topic_id={topicId}&website_url={website_url}",SUGGESTED_POSTS:"suggested-posts?topic_id={topicId}&website_url={website_url}&page={page}",JOIN:"topic/join?website_url={website_url}",LEAVE:"topic/leave?website_url={website_url}"},BOOKMARK:{LIST:"bookmark?user_id={userId}&website_url={website_url}",CREATE:"bookmark/create?website_url={website_url}",DELETE:"bookmark/delete?website_url={website_url}"},UPLOAD_IMAGE:"auth/comment/image/upload?website_url={website_url}",GET_DUE_DATE_INFO:"health-tools/due-date-calculator/info"},R=function(e,t){if("string"!=typeof e)throw new TypeError("argument str must be a string");var r={},o=(t||{}).decode||x,a=0;for(;a<e.length;){var n=e.indexOf("=",a);if(-1===n)break;var i=e.indexOf(";",a);if(-1===i)i=e.length;else if(i<n){a=e.lastIndexOf(";",n-1)+1;continue}var l=e.slice(a,n).trim();if(void 0===r[l]){var s=e.slice(n+1,i).trim();34===s.charCodeAt(0)&&(s=s.slice(1,-1)),r[l]=G(s,o)}a=i+1}return r},S=function(e,t,r){var o=r||{},a=o.encode||P;if("function"!=typeof a)throw new TypeError("option encode is invalid");if(!D.test(e))throw new TypeError("argument name is invalid");var n=a(t);if(n&&!D.test(n))throw new TypeError("argument val is invalid");var i=e+"="+n;if(null!=o.maxAge){var l=o.maxAge-0;if(isNaN(l)||!isFinite(l))throw new TypeError("option maxAge is invalid");i+="; Max-Age="+Math.floor(l)}if(o.domain){if(!D.test(o.domain))throw new TypeError("option domain is invalid");i+="; Domain="+o.domain}if(o.path){if(!D.test(o.path))throw new TypeError("option path is invalid");i+="; Path="+o.path}if(o.expires){var s=o.expires;if(!function(e){return"[object Date]"===y.call(e)||e instanceof Date}(s)||isNaN(s.valueOf()))throw new TypeError("option expires is invalid");i+="; Expires="+s.toUTCString()}o.httpOnly&&(i+="; HttpOnly");o.secure&&(i+="; Secure");if(o.priority){switch("string"==typeof o.priority?o.priority.toLowerCase():o.priority){case"low":i+="; Priority=Low";break;case"medium":i+="; Priority=Medium";break;case"high":i+="; Priority=High";break;default:throw new TypeError("option priority is invalid")}}if(o.sameSite){switch("string"==typeof o.sameSite?o.sameSite.toLowerCase():o.sameSite){case!0:i+="; SameSite=Strict";break;case"lax":i+="; SameSite=Lax";break;case"strict":i+="; SameSite=Strict";break;case"none":i+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return i},y=Object.prototype.toString,D=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function x(e){return-1!==e.indexOf("%")?decodeURIComponent(e):e}function P(e){return encodeURIComponent(e)}function G(e,t){try{return t(e)}catch(t){return e}}var C={parse:R,serialize:S},N={locale:"vi-VN",env:{isMarryBaby:!1,togetherBasePath:"/community"},router:{basePath:"",asPath:"/"}},M=i.createContext({data:N,action:{pushNotifications:function(e){return e},sanitizeFunction:function(e){return e}}});exports.GlobalData=N;var k={"vi-VN":"hellobacsi.com","id-ID":"hellosehat.com","ms-MY":"hellodoktor.com","km-KH":"hellokrupet.com","en-PH":"hellodoctor.com.ph","th-TH":"hellokhunmor.com","my-MM":"hellosayarwon.com","zh-TW":"helloyishi.com.tw","hi-IN":"helloswasthya.com"},U={"vi-VN":"marrybaby.vn"},H=process.env.NEXT_PUBLIC_DEPLOY_LOCALE||"vi-VN",B=function(e){var t=exports.GlobalData.env.isMarryBaby;return"https://".concat(t?U[e]:k[e])},F=function(e){var t=e.indexOf("?");return t>=0?e.slice(0,t+1)+e.slice(t+1).replace(/[^=&]+=(&|$)/g,"").replace(/&$/,""):e},V=function(e){var t=exports.GlobalData.env.isMarryBaby;if("undefined"!=typeof window)return window.location.origin;var r="staging"===process.env.NEXT_PUBLIC_DEPLOY_ENV;return"development"===process.env.NEXT_PUBLIC_DEPLOY_ENV?"http://localhost:3000":"https://".concat(r?t?"fe.":"discover.":t?"www.":"").concat(k[e])},K=function(t,r,o){var a="";o&&(a=Object.keys(o).map((function(e){return e+"="+o[e]})).join("&"));var n=((null===exports.GlobalData||void 0===exports.GlobalData?void 0:exports.GlobalData.env)||{}).togetherBaseApiUrl,i=void 0===n?"":n,l=p.default(t,e.__assign(e.__assign({},(null==r?void 0:r._locale)?{website_url:B(String(r._locale))}:{}),r));return l+="".concat(l.includes("?")?"&":"?").concat(a),i+"api/v1/"+F(l)},Y=function(e){return(null==e?void 0:e.data)&&(e.data instanceof FormData?e.body=e.data:"object"==typeof e.data&&(e.body=JSON.stringify(e.data)),delete e.data),e},W=function(t,r,o,a){return void 0===a&&(a=!1),e.__awaiter(void 0,void 0,void 0,(function(){var n,i,l,s,c;return e.__generator(this,(function(u){switch(u.label){case 0:return u.trys.push([0,2,,3]),[4,fetch(a?t:(_=t,encodeURI(_).replace(/%5B/g,"[").replace(/%5D/g,"]")),e.__assign(e.__assign({method:r},Y(o)),{headers:e.__assign({},null==o?void 0:o.headers)})).then((function(e){return e.json()}))];case 1:return(n=u.sent())?[2,n]:[3,3];case 2:return i=u.sent(),console.log(i),console.log({url:t,status:null===(l=null==i?void 0:i.response)||void 0===l?void 0:l.status,statusText:null===(s=null==i?void 0:i.response)||void 0===s?void 0:s.statusText}),[2,(null===(c=null==i?void 0:i.response)||void 0===c?void 0:c.data)||null];case 3:return[2,null]}var _}))}))},j=function(t,r,a,n){return e.__awaiter(void 0,void 0,void 0,(function(){var i,l,s,c;return e.__generator(this,(function(u){switch(u.label){case 0:return u.trys.push([0,3,,4]),i=C.parse(n||""),l=i[O],(s=l||o.getCookie(O))&&s.length?[4,fetch(t,e.__assign(e.__assign({method:r},Y(a)),{headers:e.__assign({Authorization:"Bearer "+s},null==a?void 0:a.headers)})).then((function(e){return e.json()}))]:[3,2];case 1:if(c=u.sent())return[2,c];u.label=2;case 2:return[3,4];case 3:return u.sent(),[2,null];case 4:return[2,null]}}))}))};function z(e,t,r){var o=new RegExp("([?&])"+t+"=.*?(&|$)","i"),a=-1!==e.indexOf("?")?"&":"?";return e.match(o)?e.replace(o,"$1"+t+"="+r+"$2"):e+a+t+"="+r}var X=function(e,t,r,o){return r&&t?"".concat(r,"-").concat(t):"".concat(_.default(e||"",{lower:!0,locale:o||H}),"-").concat(t)};exports.ADMIN_PATHS={SEARCH_USER:"admin/profile/search?website_url={website_url}&name={name}",COMMENT:{IMAGE_UPLOAD:"admin/comment/image/upload?website_url={website_url}"}},exports.BEARER_TOKEN_COOKIE=O,exports.CARE_PATHS={GET_DOCTOR_INFO:"api/doctors/{doctorId}?site={website_url}",GET_HOSPITAL_INFO:"api/hospital/branch/{hospital_branch_id}?site={website_url}"},exports.DEFAULT_AVATAR_IMG=m,exports.DEFAULT_IMG=A,exports.DISCOVER_PATHS={BASE_API_PATH:"/",GET_SEARCH_ARTICLES:"search?s={keyword}&page={page}",GET_ALL_CATEGORIES:"categories?type=all",GET_HOMEPAGE_POSTS:"home/trending-post?type={type}",GET_HOMEPAGE_LATEST_POSTS:"articles?page=1&_islatest=1",GET_ARTICLE_DETAIL:"article/{slug}?skip_ids={skipIds}&_isrelated={isRelated}",GET_CATEGORY_DETAIL:"category/{slug}",GET_CATEGORY_OR_ARTICLE_DETAIL:"fetch/{fullSlug}",GET_PREVIEW_ARTICLE:"fetch/{fullSlug}?preview_nonce={nonce}&preview=true",GET_ARTICLE_OF_CATEGORY:"articles?category_id={categoryId}&page={currentPage}",GET_PAGE_STATIC:"page/{slug}",GET_ALL_HEALTH_TOOLS:"healthtools",GET_ALL_MARRYBABY_HEALTH_TOOLS:"health-tools",GET_HEALTH_TOOLS_BY_CATEGORY:"healthtools?_hasgroup=1",GET_AUTHOR:"author/{slug}",GET_ALL_EXPERTS:"experts",GET_ALL_EXPERTS_PAGING:"experts?page={page}",GET_EXPERT:"expert/{slug}",GET_EXPERT_POST:"expert/article?page={page}",POST_ARTICLE_FEEDBACK:"article/feedback/{id}",GET_AZ_DRUGS:"category/a-z/{category}",GET_HOMEPAGE_MEDICAL_REVIEWED:"home/medical-reviewed",GET_ARTICLES_BY_IDS:"articles?ids={ids}",GET_ARTICLE_OF_CATEGORY_NO_EXPLAINERS:"articles?category_id={categoryId}&page={currentPage}&skip_ids={ids}",GET_EXPERT_OF_CATEGORY:"category/expert/?id={id}",GET_DUE_DATE_INFO:"health-tools/due-date-calculator/info",GET_DUE_DATE_ALL_WEEKS:"health-tools/due-date-calculator/all",GET_DUE_DATE_SUGGESTED_ARTICLES:"health-tools/due-date-calculator/result?from_week={from}&to_week={to}",GET_PROFILE:"user/profile",GET_ADMIN_PROFILE:"GET_ADMIN_PROFILE",GET_FEATURE:"feature",POST_NEW_FEATURE:"feature/update",CREATE_BOOKMARK:"bookmark/create",DELETE_BOOKMARK:"bookmark/delete",DELETE_ALL_BOOKMARK:"bookmark/delete-all",GET_ALL_BOOKMARK:"bookmark",SSO_USER_PROFILE:"user",SSO_USER_BOOKMARKS:"user/bookmarks",SSO_USER_PASSWORD:"user/settings/password",SSO_USER_EMAIL:"user/settings/update-email",SSO_CLOSE_ACCOUNT:"user/settings/close-account",SSO_HELP:"user/settings/help",GET_HEALTH_TOOL_OVULATION_INFO:"health-tools/ovulation-calculator/info",GET_HEALTH_TOOL_OVULATION_SUGGESTED_ARTICLES:"health-tools/ovulation-calculator/result?method={method}",GET_HEALTH_TOOL_BMI_INFO:"health-tools/bmi-calculator/info",GET_HEALTH_TOOL_BMI_RESULT:"health-tools/bmi-calculator/result?gender={gender}&bmi={bmi}&age={age}",GET_HEALTH_TOOL_BMR_INFO:"health-tools/bmr-calculator/info",GET_HEALTH_TOOL_BMR_RESULT:"health-tools/bmr-calculator/result?kcals={kcals}&gender={gender}&age={age}",GET_HEALTH_TOOL_PWG_INFO:"health-tools/preweight-gain-calculator/info",GET_HEALTH_TOOL_THR_INFO:"health-tools/target-heart-rate/info",GET_HEALTH_TOOL_BABY_GROWTH_INFO:"health-tools/baby-growth-tracking/info",POST_UPDATE_LOCATION:"tracking/geo/",GET_SIDIS_DUE_DATE:"frontend/tools/due_date",GET_SIDIS_OVULATION:"frontend/tools/ovulation",GET_SIDIS_BMI:"frontend/tools/bmi",GET_SIDIS_BMR:"frontend/tools/bmr",POST_LOGOUT:"user/logout",OVULATION_CREATE_EVENT:"ovulation/event?method={method}&day={day}&cycle={cycle}&period={period}&token={token}&user_id={user_id}",GET_ALL_SPOTLIGHT:"spotlights?per_page={perPage}&order_by={orderBy}",SSO_UPDATE_FIRST_TIME_BOOKMARK:"bookmark/update-first-time",POST_COMMENT_NOTIFICATION:"comment/notification",GET_ABOUT_US_DATA:"about",POST_LEAD_IMPRESSION:"campaign/{campaignCode}/impression",POST_LEAD_POPUP_EXIT:"campaign/{campaignCode}/popup_exit",POST_LEAD_LEAD:"campaign/{campaignCode}/lead",POST_SSO_VERIFY_TOKEN:"verify-id-token",GET_LANDING_PAGE_FIRST_NODE:"landing_page/bot",GET_LANDING_PAGE_NEXT_NODE:"landing_page/messages",POST_LANDING_PAGE_IMPRESSION:"landing_page/impressions",POST_LANDING_PAGE_CLICK:"landing_page/clicks",FETCH_URL_DATA:"preview",GET_SPOTLIGHT_LANDING:"spotlight/{slug}",GET_FOOTER_INFO:"footer",CHECK_SSO_EMAIL:"member/check-email",GET_HOMEPAGE_SITEWIDE_BANNER:"home/sitewide-banner",GET_DYNAMIC_FOOTER:"menu/footer",GET_EXPERTS:"experts?page={page}&number={perPage}&s={search}",GET_EXPERT_BY_ID:"expert/{id}"},exports.DUE_DATE_FORMAT=h,exports.DefaultComponentGlobalContextData=N,exports.HEALTH_TOOL_TYPE=g,exports.MAX_IMAGE_UPLOADS=20,exports.PATHS=w,exports.REPORT_REASON_MAP=I,exports.StyledPopup=E,exports.StyledPopupWrapper=T,exports.TogetherComponentGlobalContext=M,exports.TogetherComponentGlobalContextProvider=function(e){var t=e.locale,r=void 0===t?"vi-VN":t,o=e.children,a=e.userInfo,n=e.router,l=e.env,s=void 0===l?{isMarryBaby:!1,togetherBasePath:"/community"}:l,c=e.sanitizeFunction,u=void 0===c?function(e){return e}:c,_=e.pushNotifications,p=void 0===_?function(){return!1}:_,E=i.useState(),T=E[0],h=E[1];return exports.GlobalData={userInfo:a,locale:r,togetherUserId:T,router:n,env:s},i.useEffect((function(){(null==a?void 0:a.id)&&j(K(w.PROFILE,{_locale:r}),"GET").then((function(e){var t;h(null===(t=null==e?void 0:e.data)||void 0===t?void 0:t.id)}))}),[null==a?void 0:a.id]),d.default.createElement(M.Provider,{value:{data:{userInfo:a,locale:r,togetherUserId:T,router:n,env:s},action:{pushNotifications:p,sanitizeFunction:u}}},o)},exports.callApi=W,exports.callApiWithAdminAuth=function(t,r,a,n){return e.__awaiter(void 0,void 0,void 0,(function(){var i,l,s,c;return e.__generator(this,(function(u){switch(u.label){case 0:return u.trys.push([0,3,,4]),i=C.parse(n||""),l=i[v],(s=l||o.getCookie(v))&&s.length?[4,fetch(t,e.__assign(e.__assign({method:r},Y(a)),{headers:e.__assign({Authorization:"Bearer "+s},null==a?void 0:a.headers)})).then((function(e){return e.json()}))]:[3,2];case 1:if(c=u.sent())return[2,c];u.label=2;case 2:return[3,4];case 3:return u.sent(),[2,null];case 4:return[2,null]}}))}))},exports.callApiWithAuth=j,exports.callApiWithOptionalAuth=function(t,r,a,n){return void 0===r&&(r="GET"),e.__awaiter(void 0,void 0,void 0,(function(){var i,l,s,c,u,_,p,d,E,T,h,m,A,g;return e.__generator(this,(function(b){switch(b.label){case 0:if(b.trys.push([0,7,,8]),i="string"==typeof t?t:t.url,l="string"==typeof t?t:t.backupUrl,s=C.parse(n||""),c=s[O],!(u=c||o.getCookie(O))||!u.length)return[3,5];b.label=1;case 1:return b.trys.push([1,3,,4]),[4,fetch(i,e.__assign(e.__assign({method:r},Y(a)),{headers:e.__assign({Authorization:"Bearer "+u},null==a?void 0:a.headers)})).then((function(e){return e.json()}))];case 2:return _=b.sent(),(null===(E=null==_?void 0:_.messages)||void 0===E?void 0:E.find((function(e){return"Unauthenticated"===(null==e?void 0:e.toLowerCase())})))?[2,W(l||i,r,a)]:_?[2,_]:[3,4];case 3:return p=b.sent(),console.log({status:null===(T=null==p?void 0:p.response)||void 0===T?void 0:T.status,statusText:null===(h=null==p?void 0:p.response)||void 0===h?void 0:h.statusText}),[2,W(l||i,r,a)];case 4:return[3,6];case 5:return[2,W(l||i,r,a)];case 6:return[3,8];case 7:return d=b.sent(),console.log({status:null===(m=null==d?void 0:d.response)||void 0===m?void 0:m.status,statusText:null===(A=null==d?void 0:d.response)||void 0===A?void 0:A.statusText}),[2,(null===(g=null==d?void 0:d.response)||void 0===g?void 0:g.data)||null];case 8:return[2,null]}}))}))},exports.constants=f,exports.domainLocales=k,exports.getApiPath=K,exports.getCareDoctorUrl=function(e){var t,r=e.name,o=e.id,a=e.locale;return"/care/".concat(null===(t=L[a||"vi-VN"])||void 0===t?void 0:t.DOCTOR,"/").concat(X(r,o))},exports.getCareHospitalUrl=function(e){var t,r=e.name,o=e.id,a=e.slug,n=e.locale;return"/care/".concat(null===(t=L[n||"vi-VN"])||void 0===t?void 0:t.HOSPITAL,"/").concat(X(r,o,a))},exports.getCarePath=function(t,r){var o=((null===exports.GlobalData||void 0===exports.GlobalData?void 0:exports.GlobalData.env)||{}).careBaseApiUrl;return((void 0===o?"":o)||"https://service-health-care.hellohealthgroup.com/")+F(p.default(t,e.__assign({},r)))},exports.getCurrentBaseUrl=V,exports.getCurrentHref=function(e,t,r){return"undefined"!=typeof window?window.location.href:"".concat(V(e)).concat(t).concat(r)},exports.getDiscoverApiPath=function(t,r){var o=((null===exports.GlobalData||void 0===exports.GlobalData?void 0:exports.GlobalData.env)||{}).discoverBaseApiUrl;return(void 0===o?"":o)+"wp-json/api/"+F(p.default(t,e.__assign({},r)))},exports.getUrlToSignUp=function(e,t,r){void 0===r&&(r="/community");var o=e||("undefined"!=typeof window?window.location.href:"/"),a="undefined"!=typeof window?window.location.origin:"";return a||e&&(e.startsWith("http://")||e.startsWith("https://"))&&(a=e.split("/").slice(0,3).join("/")),function(e,t){var r=exports.GlobalData.env.publicSSO,o=e||window.location.href;return t&&Object.keys(t).map((function(e){z(o,e,t[e])})),z(o,"source","communities"),r?"".concat(r,"?returnUrl=").concat(encodeURIComponent(o.toString())):o}("".concat(a).concat(r,"/on-boarding?return=").concat(encodeURIComponent(o)),t)};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hhgtech/hhg-components",
3
- "version": "1.21.85",
3
+ "version": "1.21.87",
4
4
  "main": "build/index.js",
5
5
  "module": "build/esm/index.js",
6
6
  "files": [
@@ -9,7 +9,7 @@
9
9
  "types": "build/index.d.ts",
10
10
  "description": "Hello Health Group common components",
11
11
  "scripts": {
12
- "build": "npx rimraf build && rollup -c",
12
+ "build": "rm -rf build && rollup -c",
13
13
  "test": "jest",
14
14
  "test:watch": "jest --watch",
15
15
  "test:update:snapshot": "jest --updateSnapshot",
@@ -133,7 +133,6 @@
133
133
  "react-is": "^18.2.0",
134
134
  "react-loading-skeleton": "^3.1.0",
135
135
  "react-range": "^1.8.3",
136
- "rimraf": "^3.0.2",
137
136
  "rollup": "^2.34.2",
138
137
  "rollup-plugin-copy": "^3.3.0",
139
138
  "rollup-plugin-peer-deps-external": "^2.2.4",
@@ -1 +0,0 @@
1
- import{a as e,c as n,_ as r}from"./tslib.es6-44f7e5ec.js";import t,{useState as a,useEffect as o,createContext as i,useContext as l,useRef as u}from"react";import{createEmotionCache as s,FileInput as c,NumberInput as d,PasswordInput as m,TextInput as f}from"@mantine/core";import{useDebouncedValue as v,useResizeObserver as p}from"@mantine/hooks";import{L as Y}from"./Locale-69030fff.js";import{CommonGAssets as h}from"./gAssets.js";import{Carousel as g}from"@mantine/carousel";import M from"styled-components";var D,y=300,C=s({key:"mantine",prepend:!1}),F=((D={})[Y.Vietnam]={dateFormat:"DD/MM/YYYY",separator:","},D[Y.Cambodia]={dateFormat:"DD/MM/YYYY",separator:"."},D[Y.India]={dateFormat:"DD/MM/YYYY",separator:"."},D[Y.Indonesia]={dateFormat:"DD/MM/YYYY",separator:","},D[Y.Malaysia]={dateFormat:"DD/MM/YYYY",separator:"."},D[Y.Thailand]={dateFormat:"DD/MM/YYYY",separator:"."},D[Y.Taiwan]={dateFormat:"YYYY/MM/DD",separator:","},D[Y.PhilippinesTagalog]={dateFormat:"MM/DD/YYYY",separator:"."},D[Y.PhilippinesEnglish]={dateFormat:"MM/DD/YYYY",separator:"."},D[Y.Myanmar]={dateFormat:"DD/MM/YYYY",separator:","},D),b=h.getAssetPath("EyeVisible.svg"),E=h.getAssetPath("EyeHidden.svg"),S=function(r){var i=r.value,l=r.onChange,u=n(r,["value","onChange"]),s=a(i||""),c=s[0],d=s[1],m=v(c,y)[0];return o((function(){null==l||l(m)}),[m]),o((function(){d(i)}),[i]),t.createElement(f,e({size:"md",onChange:function(e){return d(e.currentTarget.value)},value:c},u))};S.File=function(n){return t.createElement(c,e({size:"md"},n))},S.Password=function(r){var i=r.value,l=r.onChange,u=n(r,["value","onChange"]),s=a(i||""),c=s[0],d=s[1],f=v(c,y)[0];return o((function(){null==l||l(f)}),[f]),o((function(){d(i)}),[i]),t.createElement(m,e({size:"md",onChange:function(e){return d(e.currentTarget.value)},visibilityToggleIcon:function(e){var n=e.reveal,r=e.size;return n?t.createElement("img",{src:b,width:r}):t.createElement("img",{src:E,width:r})},styles:{rightSection:{pointerEvents:"initial"}},value:c},u))},S.Number=function(r){var i=r.value,l=r.onChange,u=n(r,["value","onChange"]),s=a(i||0),c=s[0],m=s[1],f=v(c,y)[0];return o((function(){null==l||l(f)}),[f]),o((function(){m(i)}),[i]),t.createElement(d,e({size:"md",stepHoldDelay:500,stepHoldInterval:function(e){return Math.max(1e3/Math.pow(e,2),25)},onChange:m,hideControls:!0,min:0,formatter:function(e){return 0===Number(e)?"":e||""},removeTrailingZeros:!0,value:c},u))};var I,x=M(g.Slide)(I||(I=r([""],[""]))),k=i({}),T=function(e,n){return e>=n?e-n:e},w=function(r){var i=r.children,l=r.blurFromCenter,s=r.blurFromIndex,c=r.blurLength,d=void 0===c?3:c,m=r.maxBlurOpacity,f=void 0===m?.5:m,v=r.onSlideChange,Y=n(r,["children","blurFromCenter","blurFromIndex","blurLength","maxBlurOpacity","onSlideChange"]),h=p(),M=h[0],D=h[1],y=u(null),C=a(0),F=C[0],b=C[1],E=function(){var e,n,r,t=null===(e=null==y?void 0:y.current)||void 0===e?void 0:e.selectedScrollSnap();b(t);var a=(null===(n=null==y?void 0:y.current)||void 0===n?void 0:n.slideNodes())||[],o=a.length,i=(null===(r=null==y?void 0:y.current)||void 0===r?void 0:r.slidesInView()).length,u=Math.floor(i/2),c=l?s+d-1:u,m=t+c,v=m===o?0:m>o?m-o:m,p=t-c,Y=p<0?o+p:p>0?t-c:0,h=Array(2*c+1).fill("").map((function(e,n){return T(Y+n,o)}));a.map((function(e,n){if(n===t?e.classList.add("center-slide"):e.classList.remove("center-slide"),-1!==h.indexOf(n))for(var r=f/d,a=0;a<d;a++){if(n===T(Y+a,o)||n===(l=o,(i=v-a)<0?l+i:i)){e.style.opacity=String((a+1)*r);break}e.style.opacity="1"}else e.style.opacity="0";var i,l}))},S={getEmblaApi:function(e){y.current=e},onSlideChange:function(e){E(),null==v||v(e)}};return o((function(){(null==y?void 0:y.current)&&E()}),[D]),t.createElement(k.Provider,{value:{slider:null==y?void 0:y.current,centerSlide:F}},t.createElement(g,e({ref:M,slideSize:"auto",containScroll:"trimSnaps"},S,Y,{loop:!0}),"function"==typeof i?i(F):i))};w.Slide=function(r){var i=r.children,s=r.onClick,c=n(r,["children","onClick"]),d=l(k).slider,m=u(),f=u(""),v=a(0),p=v[0],Y=v[1];return o((function(){f.current=String(Math.round(1e4*Math.random()))}),[]),o((function(){var e=(null==d?void 0:d.slideNodes())||[];Y(e.findIndex((function(e){return e.dataset.key===f.current})))}),[d]),t.createElement(x,e({ref:m,"data-key":f.current,"data-index":p},c),t.createElement("div",{onClick:function(){null==d||d.scrollTo(p),null==s||s(p)}},i))};export{w as C,y as D,S as I,F as a,C as e};
@@ -1 +0,0 @@
1
- import{a as e}from"./tslib.es6-44f7e5ec.js";import t,{forwardRef as r}from"react";var a=r((function(r,a){return t.createElement("circle",e({},r,{ref:a}),t.createElement("animate",{attributeName:"r",values:"4;8;4",dur:"2s",begin:"0s",repeatCount:"indefinite"}))}));export{a as C};
@@ -1 +0,0 @@
1
- import n from"react";import{_ as e,a as o}from"./tslib.es6-44f7e5ec.js";import t from"styled-components";import{u as a}from"./useTranslations-b3eb31ef.js";var r,i,d,l,p,s,u,c,b=t.hr(r||(r=e(["\n border-width: 1px;\n border-color: ",";\n border-style: ",";\n"],["\n border-width: 1px;\n border-color: ",";\n border-style: ",";\n"])),(function(n){return n.theme.colors.neutral200}),(function(n){return n.dividerType})),x=function(e){var o=e.type,t=void 0===o?"solid":o,a=e.className,r=e.style;return n.createElement(b,{style:r,className:a,"data-diver-type":t,dividerType:t})},g=t.div(i||(i=e(["\n display: inline-block;\n height: 1rem;\n flex-shrink: 0;\n padding: 0 0.5rem;\n margin-left: 4px;\n border-radius: 1rem;\n color: white;\n font-size: 8px;\n font-weight: 600;\n line-height: 1rem;\n &[data-label-type='admin'] {\n background: ",";\n }\n &[data-label-type='local admin'] {\n background: ",";\n }\n &[data-label-type='ambassador'] {\n background: ",";\n }\n &[data-label-type='expert'] {\n background: ",";\n }\n &[data-label-type='moderator'] {\n background: ",";\n }\n &[data-label-type='sponsor'] {\n background: ",";\n }\n &[data-label-type='guide'] {\n background: ",";\n }\n &[data-label-type='influencer'] {\n background: ",";\n }\n"],["\n display: inline-block;\n height: 1rem;\n flex-shrink: 0;\n padding: 0 0.5rem;\n margin-left: 4px;\n border-radius: 1rem;\n color: white;\n font-size: 8px;\n font-weight: 600;\n line-height: 1rem;\n &[data-label-type='admin'] {\n background: ",";\n }\n &[data-label-type='local admin'] {\n background: ",";\n }\n &[data-label-type='ambassador'] {\n background: ",";\n }\n &[data-label-type='expert'] {\n background: ",";\n }\n &[data-label-type='moderator'] {\n background: ",";\n }\n &[data-label-type='sponsor'] {\n background: ",";\n }\n &[data-label-type='guide'] {\n background: ",";\n }\n &[data-label-type='influencer'] {\n background: ",";\n }\n"])),(function(n){return n.theme.colors.blue800}),(function(n){return n.theme.colors.blue800}),(function(n){return n.theme.colors.green400}),(function(n){return n.theme.colors.red400}),(function(n){return n.theme.colors.yellow800}),(function(n){return n.theme.colors.teal400}),(function(n){return n.theme.colors.teal400}),(function(n){return n.theme.colors.teal400})),h={admin:"cardAuthor.admin",moderator:"cardAuthor.moderator",ambassador:"cardAuthor.ambassador",expert:"cardAuthor.expert",sponsor:"cardAuthor.sponsor",guide:"cardAuthor.guide",influencer:"cardAuthor.influencer"},m=function(e){var o=e.role,t=e.title,r=a().t,i=o?function(n){return["admin","moderator","ambassador","expert","sponsor","guide","influencer"].find((function(e){return e===n}))}(o):"";return i&&h[i]?n.createElement(g,{"data-label-type":i},t||r(h[i])):null},f=t.div(d||(d=e(["\n --dropdown-padding: 12px 18px 12px 16px;\n position: relative;\n box-sizing: border-box;\n border: 1px solid ",";\n background: url(\"data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23595959' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A\")\n no-repeat;\n background-position: right 16px center;\n border-radius: 6px;\n\n &[data-disabled='true'],\n :disabled {\n background-color: #f2f2f2;\n cursor: not-allowed;\n }\n\n &[data-size='sm'] {\n font-size: 13px;\n line-height: 20px;\n }\n &[data-size='md'] {\n font-size: 14px;\n line-height: 21px;\n }\n &[data-size='lg'] {\n font-size: 16px;\n line-height: 24px;\n }\n\n &[data-has-icons='true'] {\n border: none;\n background: ",";\n\n img,\n svg {\n display: inline-block;\n max-width: 16px;\n margin-right: 6px;\n }\n\n span {\n display: inline-block;\n vertical-align: middle;\n }\n\n &:hover {\n box-shadow: none;\n }\n > div {\n position: relative;\n display: flex;\n width: 100%;\n box-sizing: border-box;\n align-items: center;\n }\n > div::after {\n position: absolute;\n top: 50%;\n right: 12px;\n width: 10px;\n height: 8px;\n background-image: url(\"data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23595959' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A\");\n background-repeat: no-repeat;\n content: '';\n transform: translateY(-50%);\n }\n }\n\n &:hover {\n box-shadow: 0 0 2px 2px ",";\n }\n\n &[data-is-native='true'] {\n padding: var(--dropdown-padding);\n line-height: 24px;\n\n &:focus {\n box-shadow: 0px 0px 2px 2px ",";\n }\n }\n"],["\n --dropdown-padding: 12px 18px 12px 16px;\n position: relative;\n box-sizing: border-box;\n border: 1px solid ",";\n background: url(\"data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23595959' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A\")\n no-repeat;\n background-position: right 16px center;\n border-radius: 6px;\n\n &[data-disabled='true'],\n :disabled {\n background-color: #f2f2f2;\n cursor: not-allowed;\n }\n\n &[data-size='sm'] {\n font-size: 13px;\n line-height: 20px;\n }\n &[data-size='md'] {\n font-size: 14px;\n line-height: 21px;\n }\n &[data-size='lg'] {\n font-size: 16px;\n line-height: 24px;\n }\n\n &[data-has-icons='true'] {\n border: none;\n background: ",";\n\n img,\n svg {\n display: inline-block;\n max-width: 16px;\n margin-right: 6px;\n }\n\n span {\n display: inline-block;\n vertical-align: middle;\n }\n\n &:hover {\n box-shadow: none;\n }\n > div {\n position: relative;\n display: flex;\n width: 100%;\n box-sizing: border-box;\n align-items: center;\n }\n > div::after {\n position: absolute;\n top: 50%;\n right: 12px;\n width: 10px;\n height: 8px;\n background-image: url(\"data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%23595959' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E%0A\");\n background-repeat: no-repeat;\n content: '';\n transform: translateY(-50%);\n }\n }\n\n &:hover {\n box-shadow: 0 0 2px 2px ",";\n }\n\n &[data-is-native='true'] {\n padding: var(--dropdown-padding);\n line-height: 24px;\n\n &:focus {\n box-shadow: 0px 0px 2px 2px ",";\n }\n }\n"])),(function(n){return n.theme.colors.gray200}),(function(n){return n.theme.colors.gray100}),(function(n){return n.theme.colors.blue200}),(function(n){return n.theme.colors.blue200})),v=t.div(l||(l=e(["\n padding: var(--dropdown-padding);\n cursor: pointer;\n\n &.with-label {\n padding-top: 34px;\n padding-bottom: 12px;\n }\n &[data-dropdown-open] {\n padding: 11px 15px 11px 15px;\n border: 1px solid ",";\n border-radius: 6px;\n box-shadow: 0 0 2px 2px ",";\n }\n"],["\n padding: var(--dropdown-padding);\n cursor: pointer;\n\n &.with-label {\n padding-top: 34px;\n padding-bottom: 12px;\n }\n &[data-dropdown-open] {\n padding: 11px 15px 11px 15px;\n border: 1px solid ",";\n border-radius: 6px;\n box-shadow: 0 0 2px 2px ",";\n }\n"])),(function(n){return n.theme.colors.primaryBase}),(function(n){return n.theme.colors.blue200})),w=t.ul(p||(p=e(["\n position: absolute;\n top: 100%;\n right: 0;\n left: 0;\n display: block;\n margin-top: 4px;\n background: ",";\n border-radius: 6px;\n box-shadow: -1px 1px 2px rgba(67, 70, 74, 0.0001), -2px 2px 5px rgba(67, 86, 100, 0.123689);\n cursor: pointer;\n\n &[data-has-icons='true'] {\n border: 1px solid ",";\n background: white;\n box-shadow: none;\n filter: drop-shadow(0px 10px 16px rgba(0, 0, 0, 0.04));\n }\n"],["\n position: absolute;\n top: 100%;\n right: 0;\n left: 0;\n display: block;\n margin-top: 4px;\n background: ",";\n border-radius: 6px;\n box-shadow: -1px 1px 2px rgba(67, 70, 74, 0.0001), -2px 2px 5px rgba(67, 86, 100, 0.123689);\n cursor: pointer;\n\n &[data-has-icons='true'] {\n border: 1px solid ",";\n background: white;\n box-shadow: none;\n filter: drop-shadow(0px 10px 16px rgba(0, 0, 0, 0.04));\n }\n"])),(function(n){return n.theme.colors.white}),(function(n){return n.theme.colors.gray200})),k=t.li(s||(s=e(["\n display: flex;\n padding: 12px 18px 12px 16px;\n &[data-disabled='true'] {\n cursor: not-allowed;\n color: #bfbfbf;\n & > * {\n pointer-events: none;\n }\n }\n &:hover,\n :active {\n background: ",";\n }\n"],["\n display: flex;\n padding: 12px 18px 12px 16px;\n &[data-disabled='true'] {\n cursor: not-allowed;\n color: #bfbfbf;\n & > * {\n pointer-events: none;\n }\n }\n &:hover,\n :active {\n background: ",";\n }\n"])),(function(n){return n.theme.colors.gray100})),y=t.div(u||(u=e(["\n max-width: 16px;\n margin-right: 8px;\n"],["\n max-width: 16px;\n margin-right: 8px;\n"]))),E=t.div(c||(c=e(["\n position: absolute;\n top: 12px;\n left: 16px;\n pointer-events: none;\n"],["\n position: absolute;\n top: 12px;\n left: 16px;\n pointer-events: none;\n"]))),z=function(e){var t=e.className,a=e.value,r=e.options,i=e.onChange,d=void 0===i?function(){}:i,l=e.id,p=e.placeholderIcon,s=e.placeholder,u=e.style,c=e.size,b=void 0===c?"lg":c,x=e.groupedWithLabel,g=e.disabled,h=e.dropdownLabelTrackingAttributes,m=void 0===h?{}:h,z=e.isNativeSelect,C=void 0!==z&&z,A=n.useState(!1),L=A[0],j=A[1],B=function(){return!g&&j(!L)};return C?n.createElement(f,{as:"select","data-is-native":"true",value:(null==a?void 0:a.value)||void 0,disabled:g,onChange:function(n){if("string"==typeof n.target.value){var e=r.find((function(e){return e.value===n.target.value}));e&&d(e)}}},s&&n.createElement("option",{value:s,disabled:!0,selected:!0},s),r.map((function(e){return n.createElement("option",{key:"".concat(l,"-").concat(e.value),value:e.value,disabled:!!e.disabled&&e.disabled},e.label)}))):n.createElement(f,{className:t,"data-dropdown-open":L||void 0,"data-size":b,id:l,"data-has-icons":!!p,style:u,onBlur:function(){return j(!1)},tabIndex:0,"data-disabled":g},!!x&&n.createElement(E,null,x),n.createElement(v,o({onClick:B,className:x&&"with-label"},m),p," ",n.createElement("span",null,a&&a.value?a.label:s)),L&&n.createElement(w,{onClick:B,"data-has-icons":!!p},r.map((function(e){return n.createElement(k,{key:"".concat(l,"-").concat(e.value),"data-selected":a&&a.value===e.value||void 0,onClick:function(){return!e.disabled&&!g&&(null==d?void 0:d(e))},"data-disabled":!!e.disabled&&e.disabled},e.icon&&n.createElement(y,null,e.icon),e.label)}))))};export{m as A,x as D,z as a};