1var Yo=Object.defineProperty,$o=Object.defineProperties;var Zo=Object.getOwnPropertyDescriptors;var go=Object.getOwnPropertySymbols;var Jo=Object.prototype.hasOwnProperty,Qo=Object.prototype.propertyIsEnumerable;var fo=(o,i,n)=>i in o?Yo(o,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[i]=n,Co=(o,i)=>{for(var n in i||(i={}))Jo.call(i,n)&&fo(o,n,i[n]);if(go)for(var n of go(i))Qo.call(i,n)&&fo(o,n,i[n]);return o},bo=(o,i)=>$o(o,Zo(i));import{_ as e,a as t}from"./_virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-B177jzqY.js";import{A as qo}from"./ArrowBack-Db3TjviE.js";import{c6 as Xo,cm as ge,s as te,iP as en,cS as He,bP as y,bS as a,bT as $,bR as M,l as z,jG as on,j as le,jH as nn,a as Le,jI as tn,F as ze,jJ as Te,dx as Y,jK as Ve,bM as De,iS as jo,iT as yo,g$ as So,dy as oe,cK as an,i as rn,bW as ko,cQ as dn,bY as sn,cG as ln,cI as cn,iR as pn,v as Eo,ch as mn,gJ as hn}from"./index-C8DIms-h.js";import{a as N,c as Se,r as un,b as G,e as ue}from"./_virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react__loadShare__.js-ClGO9exV.js";import{d as wo,k as gn}from"./_virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react_mf_2_router_mf_2_dom__loadShare__.js-CK4j7iSY.js";import{A as fn,e as Io,W as je,f as xo,t as Cn}from"./Layout-bCGixQba.js";import{P as bn,w as yn,u as En,W as xn,n as Ao,S as vn,s as jn,a as Sn,b as kn,c as wn}from"./useWebViewHasLoaded-DJlEBO_T.js";import{j as In,K as An,i as Mo,M as Mn}from"./Appbar-CdqiVhJM.js";import{I as Pn}from"./index-BRb-vGx1.js";import{A as Bn,a as Tn,d as Wn}from"./index.esm-BNoxB-cU.js";import{I as Gn}from"./index.esm-C-9-vkKh.js";import{u as Rn}from"./BucketCreate-W2j7i5fC.js";import{u as ae}from"./index-B6UHHHHX.js";import{G as q}from"./Grid-C0JuSV3X.js";import{T as Po}from"./TextField-XHezjr4a.js";import{I as Bo}from"./PasswordVisibilityAdornment-Bsoiby26.js";import{v as Ln,C as Dn}from"./MediaShareCreate-BiFB7eqO.js";import{M as Be}from"./Stack-QTrU5DBN.js";import{D as vo}from"./Divider-D0Q2hE10.js";import{F as Nn,S as To}from"./Select-C0o-DiOk.js";import{L as ve}from"./Link-CF_mY1kC.js";import{L as ee}from"./List-g65CIM25.js";import{L as D}from"./ListItem-Bac8ygTt.js";import{C as _n}from"./FormControlLabel-DDOXog2C.js";import{C as On}from"./CheckCircle-CEvPgtb7.js";import{_ as Un}from"./inviteUrl-BPL9TqJF.js";import{d as Fn}from"./_virtual_mf___mfe_internal__host__mf_owner__1__loadShare___mf_0_unleash_mf_1_proxy_mf_2_client_mf_2_react__loadShare__.js-BdtqsXmB.js";import{u as Kn}from"./useCheckoutPlan-BrhITF5I.js";import{C as Hn}from"./Container-HzNH3NAu.js";import{a as zn}from"./CloudDownloadOutlined-QqXI5ZLk.js";import{a as Vn}from"./moment-BQKGOo7b.js";import{C as Yn}from"./Card-CsgkyxjA.js";import"./__virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react__loadShare__.js_commonjs-proxy-D_fXcg40.js";import"./virtualExposes-_ivNhQLP.js";import"./remoteEntry-uboCqDRT.js";import"./preload-helper-s0Msbe4-.js";import"./index-DM2295YJ.js";import"./_virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-_fD68H2V.js";import"./__virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react_mf_2_dom__loadShare__.js_commonjs-proxy-BYnSnx8j.js";import"./_virtual_mf___mfe_internal__host__mf_owner__1__loadShare__react_mf_2_dom__loadShare__.js-ckyQG2Wp.js";import"./groupsyChrome-CLCFmWEd.js";import"./index-C-9SF67q.js";import"./Popper-Dy4hrUxg.js";import"./useBucket-BIB0F6cO.js";import"./useSelectedMedia-moNafvFD.js";import"./AlbumDelete-C9KLfwcA.js";import"./Close-CS8X6lPR.js";import"./en-US-CcscABQy.js";import"./albumCacheLinks-COyuqQrC.js";import"./index-CKJ3iTdM.js";import"./useBucketMediaUpload-CDHeH3K-.js";import"./index--eSQkUPx.js";import"./placeholders-BhfK6KrI.js";import"./useAnalytics-Bqtss9LT.js";import"./ListItemButton-CSZvALOV.js";import"./ListItemText--jWI7Cah.js";import"./useBucketMediaFavoriteCacheUpdate-JcQ4Mztc.js";import"./Dialog-DJadggB1.js";import"./DialogContent-BYgwep7Q.js";import"./DialogActions-FWBMDTDu.js";import"./Chip-ATUcrM8H.js";import"./formatDistanceToNow-uO2sKiQN.js";import"./Avatar-DO4rlweQ.js";import"./DialogTitle-CXgQtTsT.js";import"./DialogContentText-BuA64lWT.js";import"./ShoppingCartOutlined-B9P3wYA5.js";import"./Skeleton-CHHkEUB-.js";import"./useCoverImage-LxxClbdl.js";import"./coverImageProcessor-BxMTeS1Q.js";import"./MediaDetails-DGfbi8nE.js";import"./formatBytes-jRUNT9z8.js";import"./CheckCircleOutline-CinuUtlN.js";import"./useBucketMediaMove-BQjlNRvH.js";import"./logger-YHhloPCO.js";import"./SettingsMenu-DW5epDzy.js";import"./getInitials-DL7R944W.js";import"./useProfilePlan-CFYSgKgo.js";import"./UpsellModal-C_O-36_D.js";import"./useStartPlusCheckout-Cfk75TzO.js";import"./PaymentModal-BKpq6xP1.js";import"./useSubscriptionCreate-C7gk3Ixu.js";import"./index-CwMG8eoe.js";import"./StyledFormAlert-CPss5llY.js";import"./StyledFormDivider-CsAJDStv.js";import"./Autocomplete-DrFlT9WD.js";import"./useDownloadGate-BU14gIxS.js";import"./useBucketList-Dp_j2Qaf.js";import"./Videocam-DFmQbUqM.js";import"./FilterAndSort-DXPKXNHS.js";import"./mediaSortOptions-w2yTjTeV.js";import"./__vite-browser-external-D7Ct-6yo.js";import"./ImageOutlined-BE8VU1zz.js";import"./Menu-S9skcw_y.js";import"./groupCapUpsell-C7pFxje8.js";import"./getThemeProps-CWzAk5Hy.js";import"./useThemeProps-BR0W8aGA.js";import"./isMuiElement-ByswdNQJ.js";import"./groupsy-logo-white-C4_zM7ld.js";import"./X-9gRLxPhC.js";import"./dividerClasses-DKoWjx9h.js";const $n=Xo(e("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6"}));function Zn(o,i,n){if(i[o])return new bn(o,i[o],n)}function Jn(){return yn(Zn,arguments)}const Wo=[{name:"United States",code:"US",phoneCode:"+1",flagEmoji:"ðºð¸"},{name:"Afghanistan",code:"AF",phoneCode:"+93",flagEmoji:"ð¦ð«"},{name:"Aland Islands",code:"AX",phoneCode:"+358",flagEmoji:"ð¦ð½"},{name:"Albania",code:"AL",phoneCode:"+355",flagEmoji:"ð¦ð±"},{name:"Algeria",code:"DZ",phoneCode:"+213",flagEmoji:"ð©ð¿"},{name:"AmericanSamoa",code:"AS",phoneCode:"+1684",flagEmoji:"ð¦ð¸"},{name:"Andorra",code:"AD",phoneCode:"+376",flagEmoji:"ð¦ð©"},{name:"Angola",code:"AO",phoneCode:"+244",flagEmoji:"ð¦ð´"},{name:"Anguilla",code:"AI",phoneCode:"+1264",flagEmoji:"ð¦ð®"},{name:"Antarctica",code:"AQ",phoneCode:"+672",flagEmoji:"ð¦ð¶"},{name:"Antigua and Barbuda",code:"AG",phoneCode:"+1268",flagEmoji:"ð¦ð¬"},{name:"Argentina",code:"AR",phoneCode:"+54",flagEmoji:"ð¦ð·"},{name:"Armenia",code:"AM",phoneCode:"+374",flagEmoji:"ð¦ð²"},{name:"Aruba",code:"AW",phoneCode:"+297",flagEmoji:"ð¦ð¼"},{name:"Australia",code:"AU",phoneCode:"+61",flagEmoji:"ð¦ðº"},{name:"Austria",code:"AT",phoneCode:"+43",flagEmoji:"ð¦ð¹"},{name:"Azerbaijan",code:"AZ",phoneCode:"+994",flagEmoji:"ð¦ð¿"},{name:"Bahamas",code:"BS",phoneCode:"+1242",flagEmoji:"ð§ð¸"},{name:"Bahrain",code:"BH",phoneCode:"+973",flagEmoji:"ð§ð"},{name:"Bangladesh",code:"BD",phoneCode:"+880",flagEmoji:"ð§ð©"},{name:"Barbados",code:"BB",phoneCode:"+1246",flagEmoji:"ð§ð§"},{name:"Belarus",code:"BY",phoneCode:"+375",flagEmoji:"ð§ð¾"},{name:"Belgium",code:"BE",phoneCode:"+32",flagEmoji:"ð§ðª"},{name:"Belize",code:"BZ",phoneCode:"+501",flagEmoji:"ð§ð¿"},{name:"Benin",code:"BJ",phoneCode:"+229",flagEmoji:"ð§ð¯"},{name:"Bermuda",code:"BM",phoneCode:"+1441",flagEmoji:"ð§ð²"},{name:"Bhutan",code:"BT",phoneCode:"+975",flagEmoji:"ð§ð¹"},{name:"Bolivia, Plurinational State of",code:"BO",phoneCode:"+591",flagEmoji:"ð§ð´"},{name:"Bosnia and Herzegovina",code:"BA",phoneCode:"+387",flagEmoji:"ð§ð¦"},{name:"Botswana",code:"BW",phoneCode:"+267",flagEmoji:"ð§ð¼"},{name:"Brazil",code:"BR",phoneCode:"+55",flagEmoji:"ð§ð·"},{name:"British Indian Ocean Territory",code:"IO",phoneCode:"+246",flagEmoji:"ð®ð´"},{name:"Brunei Darussalam",code:"BN",phoneCode:"+673",flagEmoji:"ð§ð³"},{name:"Bulgaria",code:"BG",phoneCode:"+359",flagEmoji:"ð§ð¬"},{name:"Burkina Faso",code:"BF",phoneCode:"+226",flagEmoji:"ð§ð«"},{name:"Burundi",code:"BI",phoneCode:"+257",flagEmoji:"ð§ð®"},{name:"Cambodia",code:"KH",phoneCode:"+855",flagEmoji:"ð°ð"},{name:"Cameroon",code:"CM",phoneCode:"+237",flagEmoji:"ð¨ð²"},{name:"Canada",code:"CA",phoneCode:"+1",flagEmoji:"ð¨ð¦"},{name:"Cape Verde",code:"CV",phoneCode:"+238",flagEmoji:"ð¨ð»"},{name:"Cayman Islands",code:"KY",phoneCode:"+345",flagEmoji:"ð°ð¾"},{name:"Central African Republic",code:"CF",phoneCode:"+236",flagEmoji:"ð¨ð«"},{name:"Chad",code:"TD",phoneCode:"+235",flagEmoji:"ð¹ð©"},{name:"Chile",code:"CL",phoneCode:"+56",flagEmoji:"ð¨ð±"},{name:"China",code:"CN",phoneCode:"+86",flagEmoji:"ð¨ð³"},{name:"Christmas Island",code:"CX",phoneCode:"+61",flagEmoji:"ð¨ð½"},{name:"Cocos (Keeling) Islands",code:"CC",phoneCode:"+61",flagEmoji:"ð¨ð¨"},{name:"Colombia",code:"CO",phoneCode:"+57",flagEmoji:"ð¨ð´"},{name:"Comoros",code:"KM",phoneCode:"+269",flagEmoji:"ð°ð²"},{name:"Congo",code:"CG",phoneCode:"+242",flagEmoji:"ð¨ð¬"},{name:"Congo, The Democratic Republic of the Congo",code:"CD",phoneCode:"+243",flagEmoji:"ð¨ð©"},{name:"Cook Islands",code:"CK",phoneCode:"+682",flagEmoji:"ð¨ð°"},{name:"Costa Rica",code:"CR",phoneCode:"+506",flagEmoji:"ð¨ð·"},{name:"Cote d'Ivoire",code:"CI",phoneCode:"+225",flagEmoji:"ð¨ð®"},{name:"Croatia",code:"HR",phoneCode:"+385",flagEmoji:"ðð·"},{name:"Cuba",code:"CU",phoneCode:"+53",flagEmoji:"ð¨ðº"},{name:"Cyprus",code:"CY",phoneCode:"+357",flagEmoji:"ð¨ð¾"},{name:"Czech Republic",code:"CZ",phoneCode:"+420",flagEmoji:"ð¨ð¿"},{name:"Denmark",code:"DK",phoneCode:"+45",flagEmoji:"ð©ð°"},{name:"Djibouti",code:"DJ",phoneCode:"+253",flagEmoji:"ð©ð¯"}
1,{name:"Dominica",code:"DM",phoneCode:"+1767",flagEmoji:"ð©ð²"},{name:"Dominican Republic",code:"DO",phoneCode:"+1849",flagEmoji:"ð©ð´"},{name:"Ecuador",code:"EC",phoneCode:"+593",flagEmoji:"ðªð¨"},{name:"Egypt",code:"EG",phoneCode:"+20",flagEmoji:"ðªð¬"},{name:"El Salvador",code:"SV",phoneCode:"+503",flagEmoji:"ð¸ð»"},{name:"Equatorial Guinea",code:"GQ",phoneCode:"+240",flagEmoji:"ð¬ð¶"},{name:"Eritrea",code:"ER",phoneCode:"+291",flagEmoji:"ðªð·"},{name:"Estonia",code:"EE",phoneCode:"+372",flagEmoji:"ðªðª"},{name:"Ethiopia",code:"ET",phoneCode:"+251",flagEmoji:"ðªð¹"},{name:"Falkland Islands (Malvinas)",code:"FK",phoneCode:"+500",flagEmoji:"ð«ð°"},{name:"Faroe Islands",code:"FO",phoneCode:"+298",flagEmoji:"ð«ð´"},{name:"Fiji",code:"FJ",phoneCode:"+679",flagEmoji:"ð«ð¯"},{name:"Finland",code:"FI",phoneCode:"+358",flagEmoji:"ð«ð®"},{name:"France",code:"FR",phoneCode:"+33",flagEmoji:"ð«ð·"},{name:"French Guiana",code:"GF",phoneCode:"+594",flagEmoji:"ð¬ð«"},{name:"French Polynesia",code:"PF",phoneCode:"+689",flagEmoji:"ðµð«"},{name:"Gabon",code:"GA",phoneCode:"+241",flagEmoji:"ð¬ð¦"},{name:"Gambia",code:"GM",phoneCode:"+220",flagEmoji:"ð¬ð²"},{name:"Georgia",code:"GE",phoneCode:"+995",flagEmoji:"ð¬ðª"},{name:"Germany",code:"DE",phoneCode:"+49",flagEmoji:"ð©ðª"},{name:"Ghana",code:"GH",phoneCode:"+233",flagEmoji:"ð¬ð"},{name:"Gibraltar",code:"GI",phoneCode:"+350",flagEmoji:"ð¬ð®"},{name:"Greece",code:"GR",phoneCode:"+30",flagEmoji:"ð¬ð·"},{name:"Greenland",code:"GL",phoneCode:"+299",flagEmoji:"ð¬ð±"},{name:"Grenada",code:"GD",phoneCode:"+1473",flagEmoji:"ð¬ð©"},{name:"Guadeloupe",code:"GP",phoneCode:"+590",flagEmoji:"ð¬ðµ"},{name:"Guam",code:"GU",phoneCode:"+1671",flagEmoji:"ð¬ðº"},{name:"Guatemala",code:"GT",phoneCode:"+502",flagEmoji:"ð¬ð¹"},{name:"Guernsey",code:"GG",phoneCode:"+44",flagEmoji:"ð¬ð¬"},{name:"Guinea",code:"GN",phoneCode:"+224",flagEmoji:"ð¬ð³"},{name:"Guinea-Bissau",code:"GW",phoneCode:"+245",flagEmoji:"ð¬ð¼"},{name:"Guyana",code:"GY",phoneCode:"+595",flagEmoji:"ð¬ð¾"},{name:"Haiti",code:"HT",phoneCode:"+509",flagEmoji:"ðð¹"},{name:"Holy See (Vatican City State)",code:"VA",phoneCode:"+379",flagEmoji:"ð»ð¦"},{name:"Honduras",code:"HN",phoneCode:"+504",flagEmoji:"ðð³"},{name:"Hong Kong",code:"HK",phoneCode:"+852",flagEmoji:"ðð°"},{name:"Hungary",code:"HU",phoneCode:"+36",flagEmoji:"ððº"},{name:"Iceland",code:"IS",phoneCode:"+354",flagEmoji:"ð®ð¸"},{name:"India",code:"IN",phoneCode:"+91",flagEmoji:"ð®ð³"},{name:"Indonesia",code:"ID",phoneCode:"+62",flagEmoji:"ð®ð©"},{name:"Iran, Islamic Republic of Persian Gulf",code:"IR",phoneCode:"+98",flagEmoji:"ð®ð·"},{name:"Iraq",code:"IQ",phoneCode:"+964",flagEmoji:"ð®ð·"},{name:"Ireland",code:"IE",phoneCode:"+353",flagEmoji:"ð®ðª"},{name:"Isle of Man",code:"IM",phoneCode:"+44",flagEmoji:"ð®ð²"},{name:"Israel",code:"IL",phoneCode:"+972",flagEmoji:"ð®ð±"},{name:"Italy",code:"IT",phoneCode:"+39",flagEmoji:"ð®ð¹"},{name:"Jamaica",code:"JM",phoneCode:"+1876",flagEmoji:"ð¯ð²"},{name:"Japan",code:"JP",phoneCode:"+81",flagEmoji:"ð¯ðµ"},{name:"Jersey",code:"JE",phoneCode:"+44",flagEmoji:"ð¯ðª"},{name:"Jordan",code:"JO",phoneCode:"+962",flagEmoji:"ð¯ð´"},{name:"Kazakhstan",code:"KZ",phoneCode:"+77",flagEmoji:"ð°ð¿"},{name:"Kenya",code:"KE",phoneCode:"+254",flagEmoji:"ð°ðª"},{name:"Kiribati",code:"KI",phoneCode:"+686",flagEmoji:"ð°ð®"},{name:"Korea, Democratic People's Republic of Korea",code:"KP",phoneCode:"+850",flagEmoji:"ð°ðµ"},{name:"Korea, Republic of South Korea",code:"KR",phoneCode:"+82",flagEmoji:"ð°ð·"},{name:"Kuwait",code:"KW",phoneCode:"+965",flagEmoji:"ð°ð¼"},{name:"Kyrgyzstan",code:"KG",phoneCode:"+996",flagEmoji:"ð°ð¬"},{name:"Laos",code:"LA",phoneCode:"+856",flagEmoji:"ð±ð¦"},{name:"Latvia",code:"LV",phoneCode:"+371",flagEmoji:"ð±ð»"},{name:"Lebanon",code:"LB",phoneCode:"+961",flagEmoji:"ð±ð§"},{name:"Lesotho",code:"LS",phoneCode:"+266",flagEmoji:"ð±ð¸"},{name:"Liberia",code:"LR",phoneCode:"+231",flagEmoji:"ð±ð·"},{name:"Libyan Arab Jamahiriya",code:"LY",phoneCode:"+218",flagEmoji:"ð±ð¾"},{name:"Liechtenstein",code:"LI",phoneCode:"+423",flagEmoji:"ð±ð®"},{name:"Lithuania",code:"LT",phoneCode:"+370",flagEmoji:"ð±ð¹"},{name:"Luxembourg",code:"LU",phoneCode:"+352",flagEmoji:"ð±ðº"},{name:"Macao",code:"MO",phoneCode:"+853",flagEmoji:"ð²ð´"},{name:"Macedonia",code:"MK",phoneCode:"+389",flagEmoji:"ð²ð°"},{name:"Madagascar",code:"MG",phoneCode:"+261",flagEmoji:"ð²ð¬"},{name:"Malawi",code:"MW",phoneCode:"+265",flagEmoji:"ð²ð¼"},{name:"Malaysia",code:"MY",phoneCode:"+60",flagEmoji:"ð²ð¾"},{name:"Maldives",code:"MV",phoneCode:"+960",flagEmoji:"ð²ð»"},{name:"Mali",code:"ML",phoneCode:"+223",flagEmoji:"ð²ð±"},{name:"Malta",code:"MT",phoneCode:"+356",flagEmoji:"ð²ð¹"},{name:"Marshall Islands",code:"MH",phoneCode:"+692",flagEmoji:"ð²ð"},{name:"Martinique",code:"MQ",phoneCode:"+596",flagEmoji:"ð²ð¶"},{name:"Mauritania",code:"MR",phoneCode:"+222",flagEmoji:"ð²ð·"},{name:"Mauritius",code:"MU",phoneCode:"+230",flagEmoji:"ð²ðº"},{name:"Mayotte",code:"YT",phoneCode:"+262",flagEmoji:"ð¾ð¹"},{name:"Mexico",code:"MX",phoneCode:"+52",flagEmoji:"ð²ð½"},{name:"Micronesia, Federated States of Micronesia",code:"FM",phoneCode:"+691",flagEmoji:"ð«ð²"},{name:"Moldova",code:"MD",phoneCode:"+373",flagEmoji:"ð²ð©"},{name:"Monaco",code:"MC",phoneCode:"+377",flagEmoji:"ð²ð¨"},{name:"Mongolia",code:"MN",phoneCode:"+976",flagEmoji:"ð²ð³"},{name:"Montenegro",code:"ME",phoneCode:"+382",flagEmoji:"ð²ðª"},{name:"Montserrat",code:"MS",phoneCode:"+1664",flagEmoji:"ð²ð¸"},{name:"Morocco",code:"MA",phoneCode:"+212",flagEmoji:"ð²ð¦"},{name:"Mozambique",code:"MZ",phoneCode:"+258",flagEmoji:"ð²ð¿"},{name:"Myanmar",code:"MM",phoneCode:"+95",flagEmoji:"ð²ð²"},{name:"Namibia",code:"NA",phoneCode:"+264",flagEmoji:"ð³ð¦"},{name:"Nauru",code:"NR",phoneCode:"+674",flagEmoji:"ð³ð·"},{name:"Nepal",code:"NP",phoneCode:"+977",flagEmoji:"ð³ðµ"},{name:"Netherlands",code:"NL",phoneCode:"+31",flagEmoji:"ð³ð±"},{name:"Netherlands Antilles",code:"AN",phoneCode:"+599",flagEmoji:"ð§ð¶"},{name:"New Caledonia",code:"NC",phoneCode:"+687",flagEmoji:"ð³ð¨"},{name:"New Zealand",code:"NZ",phoneCode:"+64",flagEmoji:"ð³ð¿"},{name:"Nicaragua",code:"NI",phoneCode:"+505",flagEmoji:"ð³ð®"},{name:"Niger",code:"NE",phoneCode:"+227",flagEmoji:"ð³ðª"}
1,{name:"Nigeria",code:"NG",phoneCode:"+234",flagEmoji:"ð³ð¬"},{name:"Niue",code:"NU",phoneCode:"+683",flagEmoji:"ð³ðº"},{name:"Norfolk Island",code:"NF",phoneCode:"+672",flagEmoji:"ð³ð«"},{name:"Northern Mariana Islands",code:"MP",phoneCode:"+1670",flagEmoji:"ð²ðµ"},{name:"Norway",code:"NO",phoneCode:"+47",flagEmoji:"ð³ð´"},{name:"Oman",code:"OM",phoneCode:"+968",flagEmoji:"ð´ð²"},{name:"Pakistan",code:"PK",phoneCode:"+92",flagEmoji:"ðµð°"},{name:"Palau",code:"PW",phoneCode:"+680",flagEmoji:"ðµð¼"},{name:"Palestinian Territory, Occupied",code:"PS",phoneCode:"+970",flagEmoji:"ðµð¸"},{name:"Panama",code:"PA",phoneCode:"+507",flagEmoji:"ðµð¦"},{name:"Papua New Guinea",code:"PG",phoneCode:"+675",flagEmoji:"ðµð¬"},{name:"Paraguay",code:"PY",phoneCode:"+595",flagEmoji:"ðµð¾"},{name:"Peru",code:"PE",phoneCode:"+51",flagEmoji:"ðµðª"},{name:"Philippines",code:"PH",phoneCode:"+63",flagEmoji:"ðµð"},{name:"Pitcairn",code:"PN",phoneCode:"+872",flagEmoji:"ðµð³"},{name:"Poland",code:"PL",phoneCode:"+48",flagEmoji:"ðµð±"},{name:"Portugal",code:"PT",phoneCode:"+351",flagEmoji:"ðµð¹"},{name:"Puerto Rico",code:"PR",phoneCode:"+1939",flagEmoji:"ðµð·"},{name:"Qatar",code:"QA",phoneCode:"+974",flagEmoji:"ð¶ð¦"},{name:"Reunion",code:"RE",phoneCode:"+262",flagEmoji:"ð·ðª"},{name:"Romania",code:"RO",phoneCode:"+40",flagEmoji:"ð·ð´"},{name:"Russia",code:"RU",phoneCode:"+7",flagEmoji:"ð·ðº"},{name:"Rwanda",code:"RW",phoneCode:"+250",flagEmoji:"ð·ð¼"},{name:"Saint Barthelemy",code:"BL",phoneCode:"+590",flagEmoji:"ð§ð±"},{name:"Saint Helena, Ascension and Tristan Da Cunha",code:"SH",phoneCode:"+290",flagEmoji:"ð¸ð"},{name:"Saint Kitts and Nevis",code:"KN",phoneCode:"+1869",flagEmoji:"ð°ð³"},{name:"Saint Lucia",code:"LC",phoneCode:"+1758",flagEmoji:"ð±ð¨"},{name:"Saint Martin",code:"MF",phoneCode:"+590",flagEmoji:"ð²ð«"},{name:"Saint Pierre and Miquelon",code:"PM",phoneCode:"+508",flagEmoji:"ðµð²"},{name:"Saint Vincent and the Grenadines",code:"VC",phoneCode:"+1784",flagEmoji:"ð»ð¨"},{name:"Samoa",code:"WS",phoneCode:"+685",flagEmoji:"ð¼ð¸"},{name:"San Marino",code:"SM",phoneCode:"+378",flagEmoji:"ð¸ð²"},{name:"Sao Tome and Principe",code:"ST",phoneCode:"+239",flagEmoji:"ð¸ð¹"},{name:"Saudi Arabia",code:"SA",phoneCode:"+966",flagEmoji:"ð¸ð¦"},{name:"Senegal",code:"SN",phoneCode:"+221",flagEmoji:"ð¸ð³"},{name:"Serbia",code:"RS",phoneCode:"+381",flagEmoji:"ð·ð¸"},{name:"Seychelles",code:"SC",phoneCode:"+248",flagEmoji:"ð¸ð¨"},{name:"Sierra Leone",code:"SL",phoneCode:"+232",flagEmoji:"ð¸ð±"},{name:"Singapore",code:"SG",phoneCode:"+65",flagEmoji:"ð¸ð¬"},{name:"Slovakia",code:"SK",phoneCode:"+421",flagEmoji:"ð¸ð°"},{name:"Slovenia",code:"SI",phoneCode:"+386",flagEmoji:"ð¸ð®"},{name:"Solomon Islands",code:"SB",phoneCode:"+677",flagEmoji:"ð¸ð§"},{name:"Somalia",code:"SO",phoneCode:"+252",flagEmoji:"ð¸ð´"},{name:"South Africa",code:"ZA",phoneCode:"+27",flagEmoji:"ð¿ð¦"},{name:"South Georgia and the South Sandwich Islands",code:"GS",phoneCode:"+500",flagEmoji:"ð¬ð¸"},{name:"South Sudan",code:"SS",phoneCode:"+211",flagEmoji:"ð¸ð¸"},{name:"Spain",code:"ES",phoneCode:"+34",flagEmoji:"ðªð¸"},{name:"Sri Lanka",code:"LK",phoneCode:"+94",flagEmoji:"ð±ð°"},{name:"Sudan",code:"SD",phoneCode:"+249",flagEmoji:"ð¸ð©"},{name:"Suriname",code:"SR",phoneCode:"+597",flagEmoji:"ð¸ð·"},{name:"Svalbard and Jan Mayen",code:"SJ",phoneCode:"+47",flagEmoji:"ð¸ð¯"},{name:"Swaziland",code:"SZ",phoneCode:"+268",flagEmoji:"ð¸ð¿"},{name:"Sweden",code:"SE",phoneCode:"+46",flagEmoji:"ð¸ðª"},{name:"Switzerland",code:"CH",phoneCode:"+41",flagEmoji:"ð¨ð"},{name:"Syrian Arab Republic",code:"SY",phoneCode:"+963",flagEmoji:"ð¸ð¾"},{name:"Taiwan",code:"TW",phoneCode:"+886",flagEmoji:"ð¹ð¼"},{name:"Tajikistan",code:"TJ",phoneCode:"+992",flagEmoji:"ð¹ð¯"},{name:"Tanzania, United Republic of Tanzania",code:"TZ",phoneCode:"+255",flagEmoji:"ð¹ð¿"},{name:"Thailand",code:"TH",phoneCode:"+66",flagEmoji:"ð¹ð"},{name:"Timor-Leste",code:"TL",phoneCode:"+670",flagEmoji:"ð¹ð±"},{name:"Togo",code:"TG",phoneCode:"+228",flagEmoji:"ð¹ð¬"},{name:"Tokelau",code:"TK",phoneCode:"+690",flagEmoji:"ð¹ð°"},{name:"Tonga",code:"TO",phoneCode:"+676",flagEmoji:"ð¹ð´"},{name:"Trinidad and Tobago",code:"TT",phoneCode:"+1868",flagEmoji:"ð¹ð¹"},{name:"Tunisia",code:"TN",phoneCode:"+216",flagEmoji:"ð¹ð³"},{name:"Turkey",code:"TR",phoneCode:"+90",flagEmoji:"ð¹ð·"},{name:"Turkmenistan",code:"TM",phoneCode:"+993",flagEmoji:"ð¹ð²"},{name:"Turks and Caicos Islands",code:"TC",phoneCode:"+1649",flagEmoji:"ð¹ð¨"},{name:"Tuvalu",code:"TV",phoneCode:"+688",flagEmoji:"ð¹ð»"}
1,{name:"Uganda",code:"UG",phoneCode:"+256",flagEmoji:"ðºð¬"},{name:"Ukraine",code:"UA",phoneCode:"+380",flagEmoji:"ðºð¦"},{name:"United Arab Emirates",code:"AE",phoneCode:"+971",flagEmoji:"ð¦ðª"},{name:"United Kingdom",code:"GB",phoneCode:"+44",flagEmoji:"ð¬ð§"},{name:"Uruguay",code:"UY",phoneCode:"+598",flagEmoji:"ðºð¾"},{name:"Uzbekistan",code:"UZ",phoneCode:"+998",flagEmoji:"ðºð¿"},{name:"Vanuatu",code:"VU",phoneCode:"+678",flagEmoji:"ð»ðº"},{name:"Venezuela, Bolivarian Republic of Venezuela",code:"VE",phoneCode:"+58",flagEmoji:"ð»ðª"},{name:"Vietnam",code:"VN",phoneCode:"+84",flagEmoji:"ð»ð³"},{name:"Virgin Islands, British",code:"VG",phoneCode:"+1284",flagEmoji:"ð»ð¬"},{name:"Virgin Islands, U.S.",code:"VI",phoneCode:"+1340",flagEmoji:"ð»ð®"},{name:"Wallis and Futuna",code:"WF",phoneCode:"+681",flagEmoji:"ð¼ð«"},{name:"Yemen",code:"YE",phoneCode:"+967",flagEmoji:"ð¾ðª"},{name:"Zambia",code:"ZM",phoneCode:"+260",flagEmoji:"ð¿ð²"},{name:"Zimbabwe",code:"ZW",phoneCode:"+263",flagEmoji:"ð¿ð¼"}],Ne=Wo.map(o=>"".concat(o.flagEmoji," ").concat(o.name," ").concat(o.phoneCode)),Go=new Map;Ne.forEach(o=>{Go.set(o,o.substring(o.indexOf(" ")+1))});const Ke=Ne[0],Qn=Wo.reduce((o,i,n)=>(o[Ne[n]]=i,o),{}),Ro=o=>Qn[o]||{name:"Unknown",code:"XX",phoneCode:"+00",flagEmoji:"ð³ï¸"},We=91,Ge=150,qn=M(y)(({theme:o})=>({[o.breakpoints.down("sm")]:{marginBottom:32,height:"".concat(Ge-32,"px")},display:"flex",width:"100%",height:We,padding:0,margin:0})),Xn=M(y)(({theme:o})=>({display:"flex",flex:1,flexDirection:"column",width:"100%",[o.breakpoints.up("sm")]:{flexDirection:"row"}})),et=M(y)(({items:o,shouldShowScrollbar:i,theme:n})=>i?{[n.breakpoints.down("sm")]:{height:Ge*o},height:We*o,overflowY:"auto",overflowX:"hidden","&:hover":{overflowY:"auto",overflowX:"hidden"},"&::-webkit-scrollbar":{width:"8px"},"&::-webkit-scrollbar-thumb":{backgroundColor:"#888",borderRadius:"4px"},"&::-webkit-scrollbar-thumb:hover":{backgroundColor:"#555"}}:{[n.breakpoints.down("sm")]:{height:Ge*o},height:We*o,overflowY:"auto",overflowX:"hidden"}),ot=M(y)(({theme:o})=>({flex:1,margin:0,marginLeft:o.spacing(0),marginBottom:o.spacing(1),padding:0})),nt=M(Nn)(()=>({minWidth:150})),tt=M(a)(()=>({color:"#000",fontSize:"14px",fontStyle:"normal",fontWeight:600})),at=M(To,{shouldForwardProp:o=>o!=="isSelected"})(({isSelected:o,theme:i})=>({[i.breakpoints.up("sm")]:{fontSize:16,width:"200px"},width:"100%",padding:0,margin:0,fontSize:14,fontWeight:"600",borderRadius:"4px",color:o?"#fff":"#1C47CB",backgroundColor:o?"#1C47CB":void 0,"& .MuiSelect-icon":{color:o?"#fff":"#1C47CB"},"& .MuiSelect-select":{padding:"14px 16px"},"& .MuiOutlinedInput-notchedOutline":{borderColor:"#1C47CB"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:"#1C47CB"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:"#1C47CB"},"&:disabled":{color:"primary.main"}}));function it(){const o=ge();return t(y,{sx:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",color:o.palette.grey[500],"&:disabled":{color:o.palette.grey[500]}},children:[e(He,{color:"text.disabled",size:14,sx:{mr:1,color:o.palette.grey[500]}}),"Creating bucket..."]})}function Lo({groupId:o,groupName:i,upsertMap:n,removeFromMap:m,buckets:l}){const[f,h]=N("Select a bucket"),{mutation:r,loading:d}=Rn(),I="create-bucket-".concat(o),j=g=>{const u=l==null?void 0:l.find(x=>x.id===g);return u?u.title:"Select a Bucket"},E=()=>{d||r({variables:{data:{title:i||"New Bucket",description:"Bucket for ".concat(i||"WhatsApp Group")}}}).then(g=>{var x;const u=(x=g.data)==null?void 0:x.bucketCreate;u&&(h(u.id),n(o,u.id,i))}).catch(g=>{z.error("Error creating bucket:",g)})},s=g=>{if(g.target.value===I){E();return}const u=g.target.value;u!=="Select a bucket"?(h(u),n(o,u,i)):(h("Select a bucket"),m(o))},k=Se(()=>l==null?void 0:l.some(g=>g.title===i),[l,i]);return e(nt,{children:t(at,{isSelected:f!=="Select a bucket"&&!d,value:f,onChange:s,renderValue:d?it:j,IconComponent:An,disabled:d,children:[e(Be,{value:"Select a bucket","aria-label":"Select no bucket",datatype:"select-no-bucket",children:"Select a bucket"},"Select a bucket"),!k&&e(vo,{sx:{width:"90%",mx:"auto"}}),!k&&t(Be,{value:I,"aria-label":"Create bucket for ".concat(i),"data-testid":"create-bucket-".concat(i,"-select"),sx:{maxWidth:"300px",textWrap:"wrap"},children:[e(fn,{sx:{mr:1,color:"#1C47CB"}}),'Create new "',i,'" Bucket']},I),!k&&e(vo,{sx:{width:"90%",mx:"auto"}}),l==null?void 0:l.map(g=>e(Be,{value:g.id,"aria-label":"Select bucket for ".concat(g.title),"data-testid":"".concat(g.id,"-bucket-select"),sx:{maxWidth:"300px",textWrap:"wrap"},children:g.title},g.id))]})})}const rt=un(({index:o,data:i})=>{const{width:n,whatsAppGroupRows:m,upsertMap:l,removeFromMap:f,buckets:h}=i,r=m[o],{requestGroupAvatar:d,groupAvatar:I}=En({integrationId:r.integrationId,groupId:r.groupId});return e(Pn,{as:"div",onChange:E=>{E&&(d==null||d())},children:t(qn,{sx:{width:n},children:[e(xn,{src:I}),t(Xn,{children:[t(ot,{children:[e(a,{variant:"subtitle1",style:{fontWeight:600,color:"#101828",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",textOverflow:"ellipsis"},children:r.title}),t(a,{variant:"body2",sx:{color:"#727c8c"},children:[r.memberCount," members"]})]}),e(Lo,{groupId:r.groupId,groupName:r.title,upsertMap:l,removeFromMap:f,buckets:h})]})]},r.groupId)},r.groupId)},Wn);function dt({buckets:o,removeFromMap:i,upsertMap:n,whatsAppIntegration:m,clearErrors:l}){const f=ge(),h=ae(f.breakpoints.down("md")),r=ae(f.breakpoints.down("sm")),[d,I]=N(""),{data:j,loading:E,refetch:s}=te(en,{skip:!(m!=null&&m.id),variables:{integrationId:m.id}}),k=Se(()=>{var v;return((v=j==null?void 0:j.whatsAppGroups)==null?void 0:v.items)||[]},[j]),C=Se(()=>{const v=d.toLowerCase();return v===""?k:k.filter(R=>R.title.toLowerCase().includes(v))},[k,d]),g=k.length>0,u=v=>{I(v.target.value)},x=()=>{l(),s().then(()=>{z.info("WhatsApp Groups refetched successfully")}).catch(v=>{z.error("Error refetching WhatsApp Groups:",v)})},U=()=>{I("")},B=C.length>10,w=v=>!!C[v],c=()=>{};if(E)return e(q,{container:!0,justifyContent:"center",alignContent:"center",children:e(He,{})});if(k.length===0)return e(q,{container:!0,justifyContent:"center",children:t(y,{justifyContent:"center",sx:{width:"100%"},children:[e(a,{variant:"h6",align:"center",children:"You do not have any WhatsApp groups."}),e(a,{variant:"body1",align:"center",children:"Please create a WhatsApp group and try again before you can connect your WhatsApp Groups to your buckets."}),e(y,{justifyContent:"center",display:"flex",sx:{width:"100%"},children:e($,{variant:"contained",size:"small",onClick:x,children:"Refetch WhatsApp Groups"})})]})});const T=r?Ge:We;return t("form",{children:[e(a,{variant:h?"h5":"h4",component:"h1",align:"center",sx:{fontWeight:"bold",color:"#101828",mb:2},children:"Choose Group Chats to Connect to Your Buckets"}),e(a,{variant:h?"body2":"body1",align:"center",sx:{color:"#727c8c",maxWidth:"36rem",mx:"auto",mb:5},children:"Select which group chats you'd like to save photos and videos from and set a bucket destination. We'll save everything that has already been shared as well as anything new going forward."}),g&&t(q,{size:12,paddingBottom:1,flexDirection:r?"column":"row",container:!0,justifyContent:r?void 0:"space-between",marginBottom:r?2:4,children:[t(q,{flexDirection:"row",flex:r?12:2,display:"flex",children:[e(Po,{sx:{width:r?"100%":"320px",fontSize:r?"12px":void 0},id:"search-whatsapp-groups",placeholder:"Search your WhatsApp Groups",value:d,onChange:u,variant:"outlined",InputProps:{endAdornment:e(Bo,{position:"end",children:e(In,{fontSize:"small",htmlColor:"#000"})}),sx:{borderRadius:"100px","& .MuiOutlinedInput-notchedOutline":{borderRadius:"100px"}}},size:"small"}),d.length>0&&e($,{sx:{marginLeft:1},variant:"text",onClick:U,startIcon:e(Ln,{fontSize:"small"}),children:"Clear"})]}),d.length>0&&t(tt,{variant:"body2",sx:{color:"#000",textAlign:"left",mt:1},children:["Showing ",C.length," Results of ",k.length]})]}),e(et,{"data-testid":"whatsapp-groups-list",shouldShowScrollbar:B,items:C.length,children:e(Bn,{children:({height:v,width:H})=>!H||!v?e("div",{}
1):e(Gn,{isItemLoaded:w,itemCount:C.length,loadMoreItems:c,children:({ref:R,onItemsRendered:F})=>e(Tn,{ref:R,onItemsRendered:F,itemData:{whatsAppGroupRows:C,upsertMap:n,removeFromMap:i,buckets:o,width:H,integrationId:m==null?void 0:m.id},width:H,itemCount:C.length,itemSize:T,height:C.length*T,layout:"vertical",children:rt})})})})]})}Lo.defaultProps={groupName:""};const Ye={captions:on.Captions},$e=()=>{var o;(o=le().currentUser)==null||o.getIdToken().catch(i=>{z.error("Error refreshing token:",i)})};function Re(o,i){G(()=>{const n=setInterval(o,i);return()=>clearInterval(n)},[o,i])}const Do=M(a)({fontSize:"36px",fontStyle:"normal",paddingBottom:"12px",fontWeight:800,lineHeight:"normal",textAlign:"center",minWidth:"70%"}),Ue=M(Do)({display:"inline"});function st({integrationAccountId:o,goToNextStep:i,refetchUserProfile:n,addError:m}){const[l,f]=N(0),h=ue(m);h.current=m;const r=te(nn,{skip:!o,variables:{id:o}}),{data:d,error:I}=r;G(()=>{var E;I&&(((E=I.message)==null?void 0:E.toLowerCase())==="failed to fetch"?h.current("LoadingGroupsNetworkError",!0):h.current("LoadingGroupsError"))},[I]),G(()=>((d==null?void 0:d.integrationAccount.status)==="PENDING"?r==null||r.startPolling(1e3):((d==null?void 0:d.integrationAccount.status)==="PROCESSING"||(d==null?void 0:d.integrationAccount.status)==="ACTIVE")&&d.integrationAccount.id&&(r==null||r.stopPolling(),n(),i()),()=>{r==null||r.stopPolling()}),[d==null?void 0:d.integrationAccount.status,d==null?void 0:d.integrationAccount.id,i,r,n]);const j=()=>{f(E=>E<3?E+1:0)};return Re($e,6e4),Re(j,500),o?t(y,{paddingBottom:20,display:"flex",flexDirection:"column",alignItems:"center",children:[e(y,{display:"flex",flexDirection:"row",justifyContent:"center",alignContent:"center",children:t(Do,{children:["Loading your groups",e(Ue,{style:{opacity:"".concat(l>0?1:0)},children:"."}),e(Ue,{style:{opacity:"".concat(l>1?1:0)},children:"."}),e(Ue,{style:{opacity:"".concat(l>2?1:0)},children:"."})]})}),e(a,{children:"This may take a few minutes. Please keep this window open."})]}):null}function Ze(){var f;const[o,i]=Le(tn),n=i.loading&&i.called,m=((f=i.data)==null?void 0:f.integrationAccountCreate)||void 0,{error:l}=i;return{loading:n,mutation:o,response:m,error:l}}function lt({fields:o,cancel:i,goToNextStep:n,phoneNumber:m,updatePermission:l,addError:f}){const h=ze(),r=ge(),d=ae(r.breakpoints.down("sm")),{mutation:I,loading:j}=Ze(),{trackWhatsAppEvent:E}=Io(),s=C=>{var u;const g=C.target.checked;E(je.CAPTION_PERMISSIONS_CHECKBOX_CLICKED,{permission_granted:g,step_number:xo.SETUP_STEPS.PERMISSIONS,user_id:(u=le().currentUser)==null?void 0:u.uid}),l("captions",g)};return t("form",{onSubmit:async C=>{var U;if(C.preventDefault(),j)return;const g=Object.keys(o).filter(B=>o[B]);o.captions&&E(je.CAPTION_PERMISSIONS_GRANTED,{step_number:xo.SETUP_STEPS.PERMISSIONS,user_id:(U=le().currentUser)==null?void 0:U.uid});const x=g.map(B=>Ye[B]);await I({variables:{grantAccess:!0,externalIntegrationId:m,integrationType:Y.Whatsapp,integrationConnectionType:d?Te.PairingCode:Te.QrCode,permissions:x},onCompleted:B=>{h.writeFragment({fragment:Ve,id:"IntegrationAccountCreateResult:".concat(m),data:B.integrationAccountCreate}),n()},onError:B=>{f("LinkingAccountError"),z.error(B)}})},style:{display:"flex",flexDirection:"column",alignItems:"center",width:"100%"},children:[e(a,{width:"80%",variant:d?"pb.display.medium":"pb.display.large",children:"We value your privacy."}),e(a,{variant:"pb.body.responsive",paddingY:1,children:"In order to sync your photos, you will need to grant us access to parts of your WhatsApp account. You'll always know what we use, why it's needed, and how your privacy stays protected."}),e(y,{display:"flex",flexDirection:"row",flex:1,width:"100%",paddingTop:d?0:2,paddingBottom:d?3:6,children:t(y,{display:"flex",flexDirection:"column",flex:1,alignItems:"start",children:[e(a,{fontSize:18,fontStyle:"normal",fontWeight:800,paddingY:2,children:'By clicking "Allow", you are permitting Photobucket to:'}),t("div",{style:{width:"100%",border:"1px solid #B0B8C5",borderRadius:"8px",padding:"15px 14px",height:206,overflowY:"scroll"},children:[e(a,{align:"left",variant:d?"pb.display.small":"pb.display.medium",gutterBottom:!0,children:"Photobucket WhatsApp Integration â Terms of Use Supplement"}),e(a,{variant:"subtitle1",gutterBottom:!0,children:"Effective as of June 17, 2025"}),t(a,{align:"left",variant:"pb.body.responsive",paragraph:!0,children:['This Terms of Use Supplement ("Supplement") applies in addition to the ',e(ve,{href:"https://photobucket.com/legal/terms-of-service",target:"_blank",rel:"noopener",children:"Photobucket Terms of Use"}),' and governs your use of the optional integration between your Photobucket account and one or more WhatsApp groups (the "Integration). By enabling the Integration, you agree to the terms below.']}),e(a,{align:"left",fontWeight:"700",variant:"pb.body.responsive",component:"h2",gutterBottom:!0,children:"1. Overview of Integration"}),e(a,{align:"left",variant:"pb.body.responsive",paragraph:!0,children:"The Integration allows you to automatically upload photos and videos shared within a WhatsApp group into your designated shared album(s) on Photobucket."}),e(a,{align:"left",variant:"pb.body.responsive",fontWeight:"700",component:"h2",gutterBottom:!0,children:"2. Permissions and Data Access"}),e(a,{align:"left",variant:"pb.body.responsive",paragraph:!0,children:"By connecting your WhatsApp group to your Photobucket account, you are expressly authorizing Photobucket to:"}),t(ee,{sx:{listStyleType:"disc",pl:4},children:[e(D,{sx:{display:"list-item"},children:t(a,{align:"left",variant:"pb.body.responsive",children:[e("strong",{children:"Upload Media:"})," Access and upload your WhatsApp group's shared photos and videos into your designated Photobucket album."]})}),t(D,{sx:{display:"list-item"},children:[t(a,{align:"left",variant:"pb.body.responsive",children:[e("strong",{children:"Historical Media Import:"})," If you connect an existing WhatsApp group, we may upload up to 3 years of historical images and videos."]}),e(ee,{sx:{listStyleType:"circle",pl:4},children:e(D,{sx:{display:"list-item"},children:e(a,{align:"left",variant:"pb.body.responsive",children:"If you wish to avoid historical uploads, we recommend creating and connecting a new WhatsApp group instead."})})})]}),e(D,{sx:{display:"list-item"},children:t(a,{align:"left",variant:"pb.body.responsive",children:[e("strong",{children:"Comments & Reactions:"})," With your explicit consent, access and upload comments and reactions to photos and videos."]})}),t(D,{sx:{display:"list-item"},children:[t(a,{align:"left",variant:"pb.body.responsive",children:[e("strong",{children:"Group Member Details:"})," Access and use the names (including pseudonyms) and mobile numbers of members of your WhatsApp group in order to:"]}),t(ee,{sx:{listStyleType:"circle",pl:4},children:[e(D,{sx:{display:"list-item"},children:e(a,{align:"left",variant:"pb.body.responsive",children:"Tag their shared content within your Photobucket account;"})}),e(D,{sx:{display:"list-item"},children:e(a,{align:"left",variant:"pb.body.responsive",children:"Send them notifications about the shared album and other marketing communications."})})]})]}),e(D,{sx:{display:"list-item"},children:t(a,{align:"left",variant:"pb.body.responsive",children:[e("strong",{children:"Chat History Access:"})," Access your WhatsApp group's chat history only to identify and extract media-related comments and reactions. We do not upload, store, or use nonâmediaârelated text communications from your chat history."]})})]}),e(a,{fontWeight:"700",align:"left",variant:"pb.body.responsive",component:"h2",gutterBottom:!0,children:"3. Consent Responsibilities"}),t(ee,{sx:{listStyleType:"disc",pl:4},children:[e(D,{sx:{display:"list-item"},children:e(a,{align:"left",variant:"pb.body.responsive",children:"You agree to obtain the consent of all members of your WhatsApp group before enabling the Integration and uploading their shared photos or videos into your Photobucket album."})}),e(D,{sx:{display:"list-item"},children:e(a,{align:"left",variant:"pb.body.responsive",children:"You are solely responsible for ensuring compliance with applicable intellectual property and privacy laws and group member rights regarding their content."})})]}),e(a,{fontWeight:"700",align:"left",variant:"pb.body.responsive",component:"h2",gutterBottom:!0,children:"4. Revocation of Access"}),t(ee,{sx:{listStyleType:"disc",pl:4},children:[e(D,{sx:{display:"list-item"},children:e(a,{align:"left",variant:"pb.body.responsive",children:"You may revoke the Integration at any time through your Photobucket account settings."})}),e(D,{sx:{display:"list-item"},children:e(a,{align:"left",variant:"pb.body.responsive",children:"Once disconnected, no additional media will be uploaded, but previously uploaded content will remain in the designated Photobucket album unless manually deleted."})})]}),e(a,{fontWeight:"700",align:"left",variant:"pb.body.responsive",component:"h2",gutterBottom:!0,children:"5. Data Handling"}),t(ee,{sx:{listStyleType:"disc",pl:4},children:[e(D,{sx:{display:"list-item"},children:t(a,{align:"left",variant:"pb.body.responsive",children:["All collected data is handled in accordance with our ",e(ve,{href:"https://photobucket.com/legal/privacy-policy",target:"_blank",rel:"noopener",children:"Privacy Policy"}),", our ",e(ve,{href:"https://photobucket.com/legal/biometric-information-privacy-policy",target:"_blank",rel:"noopener",children:"Biometric Information Privacy Policy"}),", our ",e(ve,{href:"https://photobucket.com/legal/copyright-policy",target:"_blank",rel:"noopener",children:"Copyright and IP Policy"})," and applicable law."]})}),e(D,{sx:{display:"list-item"},children:e(a,{align:"left",variant:"pb.body.responsive",children:"Photobucket does not sell, rent, or share WhatsApp group member nonâmediaârelated information with third parties, except as required for service delivery or legal compliance."})})]}),e(a,{align:"left",variant:"pb.body.responsive",paragraph:!0,sx:{mt:2},children:'By clicking "Allow" when prompted or enabling the Integration, you acknowledge and agree to the above terms.'}),t(a,{align:"left",variant:"pb.body.responsive",paragraph:!0,children:["If you have any questions about this Integration or these terms, please contact us at ",e(ve,{href:"mailto:[email protected]",children:"[email protected]"}),"."]})]})]})}),t(y,{flex:1,width:"100%",paddingTop:d?0:2,children:[e(a,{align:"left",variant:d?"pb.headline.large":"pb.display.medium",children:"Optional:"}),t(y,{display:"flex",flexDirection:"row",children:[e(_n,{checked:o.captions,onChange:s,style:{paddingLeft:0}}),e(a,{alignSelf:"center",align:"left",variant:d?"pb.title.small":"pb.title.large",children:"I would like to grant Photobucket access to captions on photos and videos"})]})]}),t(y,{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:2,alignSelf:"stretch",paddingTop:2,paddingBottom:4,children:[e($,{onClick:i,variant:"outlined",sx:{borderRadius:"80px",flex:1,maxWidth:"25%"},disableElevation:!0,children:"Cancel"}),e($,{variant:"contained",type:"submit",color:"primary",sx:{borderRadius:"80px",flex:1,maxWidth:"25%"},disabled:j,disableElevation:!0,children:"Allow"})]})]})}const ct={AC:"40123",AD:"312345",AE:"501234567",AF:"701234567",AG:"2684641234",AI:"2642351234",AL:"672123456",AM:"77123456",AO:"923123456",AR:"91123456789",AS:"6847331234",AT:"664123456",AU:"412345678",AW:"5601234",AX:"412345678",AZ:"401234567",BA:"61123456",BB:"2462501234",BD:"1812345678",BE:"470123456",BF:"70123456",BG:"43012345",BH:"36001234",BI:"79561234",BJ:"0195123456",BL:"690001234",BM:"4413701234",BN:"7123456",BO:"71234567",BQ:"3181234",BR:"11961234567",BS:"2423591234",BT:"17123456",BW:"71123456",BY:"294911911",BZ:"6221234",CA:"5062345678",CC:"412345678",CD:"991234567",CF:"70012345",CG:"061234567",CH:"781234567",CI:"0123456789",CK:"71234",CL:"221234567",CM:"671234567",CN:"13123456789",CO:"3211234567",CR:"83123456",CU:"51234567",CV:"9911234",CW:"95181234",CX:"412345678",CY:"96123456",CZ:"601123456",DE:"15123456789",DJ:"77831001",DK:"34412345",DM:"7672251234",DO:"8092345678",DZ:"551234567",EC:"991234567",EE:"51234567",EG:"1001234567",EH:"650123456",ER:"7123456",ES:"612345678",ET:"911234567",FI:"412345678",FJ:"7012345",FK:"51234",FM:"3501234",FO:"211234",FR:"612345678",GA:"06031234",GB:"7400123456",GD:"4734031234",GE:"555123456",GF:"694201234",GG:"7781123456",GH:"231234567",GI:"57123456",GL:"221234",GM:"3012345",GN:"601123456",GP:"690001234",GQ:"222123456",GR:"6912345678",GT:"51234567",GU:"6713001234",GW:"955012345",GY:"6091234",HK:"51234567",HN:"91234567",HR:"921234567",HT:"34101234",HU:"201234567",ID:"812345678",IE:"850123456",IL:"502345678",IM:"7924123456",IN:"8123456789",IO:"3801234",IQ:"7912345678",IR:"9123456789",IS:"6111234",IT:"3123456789",JE:"7797712345",JM:"8762101234",JO:"790123456",JP:"9012345678",KE:"712123456",KG:"700123456",KH:"91234567",KI:"72001234",KM:"3212345",KN:"8697652917",KP:"1921234567",KR:"1020000000",KW:"50012345",KY:"3453231234",KZ:"7710009998",LA:"2023123456",LB:"71123456",LC:"7582845678",LI:"660234567",LK:"712345678",LR:"770123456",LS:"50123456",LT:"61234567",LU:"628123456",LV:"21234567",LY:"912345678",MA:"650123456",MC:"612345678",MD:"62112345",ME:"67622901",MF:"690001234",MG:"321234567",MH:"2351234",MK:"72345678",ML:"65012345",MM:"92123456",MN:"88123456",MO:"66123456",MP:"6702345678",MQ:"696201234",MR:"22123456",MS:"6644923456",MT:"96961234",MU:"52512345",MV:"7712345",MW:"991234567",MX:"2221234567",MY:"123456789",MZ:"821234567",NA:"811234567",NC:"751234",NE:"93123456",NF:"381234",NG:"8021234567",NI:"81234567",NL:"612345678",NO:"40612345",NP:"9841234567",NR:"5551234",NU:"8884012",NZ:"211234567",OM:"92123456",PA:"61234567",PE:"912345678",PF:"87123456",PG:"70123456",PH:"9051234567",PK:"3012345678",PL:"512345678",PM:"551234",PR:"7872345678",PS:"599123456",PT:"912345678",PW:"6201234",PY:"961456789",QA:"33123456",RE:"692123456",RO:"712034567",RS:"601234567",RU:"9123456789",RW:"720123456",SA:"512345678",SB:"7421234",SC:"2510123",SD:"911231234",SE:"701234567",SG:"81234567",SH:"51234",SI:"31234567",SJ:"41234567",SK:"912123456",SL:"25123456",SM:"66661212",SN:"701234567",SO:"71123456",SR:"7412345",SS:"977123456",ST:"9812345",SV:"70123456",SX:"7215205678",SY:"944567890",SZ:"76123456",TA:"8999",TC:"6492311234",TD:"63012345",TG:"90112345",TH:"812345678",TJ:"917123456",TK:"7290",TL:"77212345",TM:"66123456",TN:"20123456",TO:"7715123",TR:"5012345678",TT:"8682911234",TV:"901234",TW:"912345678",TZ:"621234567",UA:"501234567",UG:"712345678",US:"2015550123",UY:"94231234",UZ:"912345678",VA:"3123456789",VC:"7844301234",VE:"4121234567",VG:"2843001234",VI:"3406421234",VN:"912345678",VU:"5912345",WF:"821234",WS:"7212345",XK:"43201234",YE:"712345678",YT:"639012345",ZA:"711234567",ZM:"955123456",ZW:"712345678"},pt=M(y)(({theme:o})=>({margin:"0 auto",marginBottom:o.spacing(4)})),mt=M($)(({theme:o})=>({backgroundColor:"#1c47cb",color:"white",padding:"12px",width:"100%",marginTop:o.spacing(2),borderRadius:o.spacing(3),"&:hover":{backgroundColor:"#1a3eb8"}})),ht=M("div")(({theme:o})=>
1({position:"relative",[o.breakpoints.down("md")]:{display:"none",width:0},[o.breakpoints.up("lg")]:{width:500,height:"500px"}})),ut=M("img")(({theme:o})=>({position:"absolute",[o.breakpoints.down("md")]:{display:"none",width:0},[o.breakpoints.up("lg")]:{marginTop:-550,marginLeft:-35},pointerEvents:"none"}));function gt({phoneNumber:o,setPhoneNumber:i,goToNextStep:n,phoneCodeOption:m,setPhoneCodeOption:l}){const f=ge(),[h,r]=N(!1),d=Ro(m),{phoneCode:I,code:j}=d,E=I+o,s=ae(f.breakpoints.down("sm")),k=()=>"".concat(d.flagEmoji," ").concat(I),C=ae(f.breakpoints.up("lg")),g=()=>{const c=Ao(E,j);return!!(c!=null&&c.isValid())},u=c=>{const T=c.target.value;l(T)},x=c=>{const v=c.target.value.replace(/[^0-9\s]/g,"");v!==o&&r(!1),i(v)},U=c=>{g()||(z.error("Invalid phone number:",E),r(!0))},B=async c=>{if(c.preventDefault(),!g()){z.error("Invalid phone number:",E),r(!0);return}n()},w=Se(()=>{var c;return(c=Jn(j,ct))==null?void 0:c.formatNational()},[j]);return t("form",{onSubmit:B,style:{width:"100%",display:"flex",flexDirection:"row",justifyContent:"".concat(C?"":"center")},children:[t(y,{display:"flex",flexDirection:"column",children:[e(a,{mb:s?2:4,variant:s?"pb.display.medium":"pb.display.large",id:"phone-setup-heading","aria-label":"Main heading","data-testid":"phone-setup-heading",children:"We Now Integrate with WhatsApp"}),e(a,{mb:s?3.5:7,variant:"pb.body.responsive",id:"description","aria-label":"Description","data-testid":"description",children:"Link your WhatsApp account and automatically save photos and videos from any groups you want to your Photobucket account."}),t(pt,{id:"phone-input-container","aria-labelledby":"phone-input-label","data-testid":"phone-input-container",children:[e(a,{variant:s?"pb.headline.large":"pb.display.medium",mb:s?3:4,id:"phone-input-label","aria-label":"Phone input label","data-testid":"phone-input-label",children:"Enter your WhatsApp number to get started:"}),e(y,{display:"flex",justifyContent:"center",children:e(Po,{fullWidth:!0,id:"phone-input",label:"WhatsApp Number",variant:"outlined",value:o,onChange:x,onBlur:U,placeholder:w,error:h,helperText:h?"Invalid phone number. Please check and try again.":"",InputProps:{startAdornment:e(Bo,{position:"start",children:e(To,{defaultValue:Ke,displayEmpty:!0,value:m,onChange:u,sx:{display:"flex",alignItems:"center",".MuiSelect-select":{display:"flex",alignItems:"center",gap:.5},fontSize:"20px",fontWeight:600},variant:"standard",disableUnderline:!0,MenuProps:{PaperProps:{sx:{maxHeight:500}}},renderValue:k,id:"phone-code-select","aria-label":"Phone code select","data-testid":"phone-code-select",children:Ne.map(c=>{const T=Go.get(c);return e(Be,{value:c,children:t(y,{sx:{display:"flex",alignItems:"center",gap:.5},children:[e(a,{sx:{position:"absolute",top:0,left:0,opacity:0,zIndex:0},variant:"caption",children:T}),e(a,{variant:"caption",children:c})]})},c)})})})},inputProps:{"data-testid":"phone-input",sx:{fontSize:"20px",fontWeight:600}},sx:{maxWidth:"450px","& .MuiOutlinedInput-root":{"& fieldset":{borderColor:"#dfdfdf"}}},"aria-describedby":"phone-input-helper-text"})}),e(mt,{variant:"contained",disableElevation:!0,disabled:!g(),type:"submit",id:"get-started-button","aria-label":"Get started button","data-testid":"get-started-button",children:"Get Started"})]})]}),C&&e(ht,{id:"illustration-container","aria-label":"Illustration of devices showing integration","data-testid":"illustration-container",children:e(ut,{src:"https://content.photobucket.com/img/whatsapp/horizontal_devices.png",alt:"Devices showing Photobucket and WhatsApp integration",id:"illustration-image","data-testid":"illustration-image"})})]})}function ft({integrationId:o}){var j,E;const{isWebview:i}=Mo(),n=wo(),m=te(De),l=te(jo,{variables:{limit:40,page:1,integrationId:o}}),f=(E=(j=l.data)==null?void 0:j.bucketIntegrationMappingsList.items)!=null?E:[],h=f.length,r=f.filter(s=>s.status===yo.Active||s.status===yo.Failed).length;return G(()=>h===0?()=>{}:r===h?l.stopPolling():(l.startPolling(2500),()=>{l.stopPolling()}),[l,r,h]),e(q,{children:t(y,{sx:{pb:6},flexDirection:"column",display:"flex",alignItems:"center",justifyContent:"center",children:[e(y,{sx:{display:"flex",justifyContent:"center"},children:e(On,{htmlColor:"#099250",fontSize:"large"})}),e(a,{variant:"pb.display.large",component:"h1",align:"center",gutterBottom:!0,children:"Success!"}),e(a,{variant:"body1",align:"center",color:"text.secondary",sx:{maxWidth:500,mx:"auto",mb:4},children:"You've linked these group chats to Buckets. Now we'll download all of your photos and videos from these group chats. Feel free to navigate away as this process happens."}),t(y,{sx:{display:"flex",flexDirection:{xs:"column",sm:"row"},justifyContent:"center",gap:2,mb:6},children:[e($,{variant:"outlined",color:"primary",style:{borderRadius:"80px"},sx:{minWidth:{xs:"100%",sm:"auto"},whiteSpace:"nowrap"},onClick:()=>{i?n("/integrations/manage",{replace:!0}):window.location.href="/integrations/manage"},children:"Go to WhatsApp Integration Page"}),e($,{variant:"contained",disableElevation:!0,color:"primary",style:{borderRadius:"80px"},sx:{minWidth:{xs:"100%",sm:"auto"},whiteSpace:"nowrap"},onClick:()=>
1{var k,C;const s=(C=(k=m.data)==null?void 0:k.userProfile)==null?void 0:C.currentBucketId;if(i){window.open("photobucket://BucketNavigation/Bucket","_blank","noopener,noreferrer");return}if(s){window.location.href="/bucket/".concat(s);return}window.location.href="/"},children:"Go to Photobucket Home"})]}),e(ee,{style:{width:"100%"},children:f.map(s=>{var k,C,g,u;return e(vn,{bucketId:(C=(k=s==null?void 0:s.bucket)==null?void 0:k.id)!=null?C:"",bucketTitle:((g=s.bucket)==null?void 0:g.title)||"Unknown Bucket",whatsAppGroupName:s.metadata.groupTitle,status:jn(s.status),numberOfMembers:s.metadata.memberCount,groupId:s.id,onOpenChangeBucketModal:void 0,avatarUrl:((u=s.metadata)==null?void 0:u.groupIconUrl)||""},s.id)})})]})})}const Fe=290,Ct=M("img")(({theme:o})=>({[o.breakpoints.up("md")]:{marginTop:-85,marginLeft:45},width:"293px"})),bt=M("div")(({theme:o})=>({[o.breakpoints.up("md")]:{display:"flex",width:"50%"}})),yt=M(ee)(()=>({width:"100%",display:"flex",flexDirection:"column",fontSize:"18px"})),Pe=M(D)(()=>({display:"flex"})),Et=M("div")(()=>({position:"relative",width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"flex-start"}));function xt({phoneNumber:o,permissions:i,setIntegrationAccountIdParameter:n,goToNextStep:m,addError:l,lastEvaluatedIntegrationId:f,setLastEvaluatedIntegrationId:h}){const d=ze().readFragment({fragment:Ve,fragmentName:"IntegrationAccountCreateResultFragment",id:"IntegrationAccountCreateResult:".concat(o)}),[I]=Le(So,{onError:w=>{z.error("Error deleting integration account:",w)}}),{mutation:j,loading:E,response:s=d}=Ze(),k=i.map(w=>Ye[w]),C=ue(k),g=ue(j),u=te(De,{notifyOnNetworkStatusChange:!0}),{data:x,startPolling:U,stopPolling:B}=u;return G(()=>{var T,v,H,R,F,ie;if(!((v=(T=u.data)==null?void 0:T.userProfile)!=null&&v.integrations))return;let w=(H=u.data.userProfile.integrations)!=null?H:[];w=w.filter(W=>(W==null?void 0:W.integrationType)===Y.Whatsapp),w=w.slice().sort((W,Q)=>{const fe=new Date((W==null?void 0:W.createdAt)||0).getTime();return new Date((Q==null?void 0:Q.createdAt)||0).getTime()-fe});const c=(R=w==null?void 0:w[0])!=null?R:null;if(c&&c.status===oe.Failed&&f!==c.id){const W=(ie=(F=c==null?void 0:c.metadata)==null?void 0:F.deactivationReason)!=null?ie:"LinkingAccountError";I({variables:{integrationId:c.id},update:Q=>{Q.evict({id:"Integration:".concat(c.id)})}}),l(W),h(c.id)}},[u.data,f,I,l,h]),G(()=>{const w=setInterval(async()=>{await g.current({variables:{externalIntegrationId:o,permissions:C.current,integrationType:Y.Whatsapp,integrationConnectionType:Te.QrCode,grantAccess:!0},onError:c=>{z.error("Error creating integration account:",c),l("LinkingAccountError")}})},3e4);return()=>clearInterval(w)},[o,l]),G(()=>{var T;const w=((T=x==null?void 0:x.userProfile)==null?void 0:T.integrations)||[],c=w==null?void 0:w.find(v=>(v==null?void 0:v.integrationType)===Y.Whatsapp);return c!=null&&c.id&&(c==null?void 0:c.integrationType)===Y.Whatsapp&&[oe.Active,oe.Pending,oe.Processing].includes(c.status)?(B(),n(c.id),m()):(U(1e3),n(null)),()=>{B()}},[m,n,x,U,B]),Re($e,6e4),t("form",{"aria-labelledby":"main-heading","data-testid":"add-us-form",children:[e(a,{id:"main-heading",variant:"h3",align:"center",color:"text.primary",gutterBottom:!0,sx:{mb:6,fontWeight:800,fontSize:"36px",letterSpacing:"0%"},"data-testid":"main-heading",children:"Next, open WhatsApp on your phone."}),t(q,{container:!0,children:[e(q,{size:{xs:12,md:6},children:t(yt,{disablePadding:!0,"aria-label":"Steps to link WhatsApp","data-testid":"steps-list",children:[t(Pe,{"data-testid":"step-1",children:[e(a,{variant:"body1",sx:{mr:1.5,color:"text.primary",fontWeight:500},"aria-hidden":"true",children:"1."}),e(a,{variant:"body1",sx:{fontWeight:500},children:"Open WhatsApp on your phone"})]}),t(Pe,{"data-testid":"step-2",children:[e(a,{variant:"body1",sx:{mr:1.5,color:"text.primary",fontWeight:500},"aria-hidden":"true",children:"2."}),t(a,{variant:"body1",sx:{fontWeight:500},children:["Tap ",e("strong",{children:'"Menu"'})," ",e(Mn,{sx:{fontSize:"20px",backgroundColor:"#E1E1E1",borderRadius:"2px",border:"4px #E1E1E1 solid",verticalAlign:"middle"}})," ","on Android, or ",e("strong",{children:'"Settings"'})," ",e($n,{sx:{fontSize:"20px",backgroundColor:"#E1E1E1",borderRadius:"2px",border:"4px #E1E1E1 solid",verticalAlign:"middle"}})," ","on iPhone"]})]}),t(Pe,{"data-testid":"step-3",children:[e(a,{variant:"body1",sx:{mr:1.5,color:"text.primary",fontWeight:500},"aria-hidden":"true",children:"3."}),t(a,{variant:"body1",sx:{fontWeight:500},children:["Tap ",e("strong",{children:'"Linked devices"'})," and the ",e("strong",{children:'"Link a device"'})]})]}),t(Pe,{"data-testid":"step-4",children:[e(a,{variant:"body1",sx:{mr:1.5,color:"text.primary",fontWeight:500},"aria-hidden":"true",children:"4."}),e(a,{variant:"body1",sx:{fontWeight:500},children:"Point your phone at this screen and scan the QR code"})]})]})}),e(q,{size:{xs:12,md:6},children:t(Et,{"data-testid":"qr-code-container",style:{minWidth:Fe,minHeight:Fe},children:[(E||!(s!=null&&s.qrCode))&&e(an,{}),!E&&(s==null?void 0:s.qrCode)&&e(Un,{value:s==null?void 0:s.qrCode,style:{height:"auto",width:Fe}})]})}),e(q,{size:12,children:e(bt,{"data-testid":"illustration-container",children:e(Ct,{src:"https://content.photobucket.com/img/whatsapp/qr
1-helper.png",alt:"Laptop with QR code on it","data-testid":"illustration-image"})})})]})]})}function vt({phoneNumber:o,permissions:i,reset:n,setIntegrationAccountIdParameter:m,goToNextStep:l,addError:f,lastEvaluatedIntegrationId:h,setLastEvaluatedIntegrationId:r}){var L,Ae;const{createAlert:d}=rn(),j=ze().readFragment({fragment:Ve,fragmentName:"IntegrationAccountCreateResultFragment",id:"IntegrationAccountCreateResult:".concat(o)}),[E,s]=N((L=j==null?void 0:j.durationSec)!=null?L:160),[k]=Le(So,{onError:P=>{z.error("Error deleting integration account:",P)}}),{mutation:C,loading:g,response:u=j}=Ze(),x=(Ae=u==null?void 0:u.code)!=null?Ae:" ",U=i.map(P=>Ye[P]),B=ue(U),w=ue(C),c=x,T=()=>{navigator.clipboard.writeText(x.replace("-","")),d("Verification code copied to clipboard.","success")},v=()=>{T(),window.open("https://wa.me/","_blank","noopener,noreferrer")},H=()=>{n()},R=te(De,{notifyOnNetworkStatusChange:!0}),{data:F,startPolling:ie,stopPolling:W}=R;G(()=>{var Z,J,X,Ce,be,re;if(!((J=(Z=R.data)==null?void 0:Z.userProfile)!=null&&J.integrations))return;let P=(X=R.data.userProfile.integrations)!=null?X:[];P=P.filter(K=>(K==null?void 0:K.integrationType)===Y.Whatsapp),P=P.slice().sort((K,de)=>{const _e=new Date((K==null?void 0:K.createdAt)||0).getTime();return new Date((de==null?void 0:de.createdAt)||0).getTime()-_e});const A=(Ce=P==null?void 0:P[0])!=null?Ce:null;if(A&&A.status===oe.Failed&&h!==A.id){const K=(re=(be=A==null?void 0:A.metadata)==null?void 0:be.deactivationReason)!=null?re:"LinkingAccountError";k({variables:{integrationId:A.id},update:de=>{de.evict({id:"Integration:".concat(A.id)})}}),f(K),r(A.id)}},[R.data,h,k,f,r]),G(()=>{const P=setInterval(async()=>{var Z,J,X;const A=await w.current({variables:{externalIntegrationId:o,permissions:B.current,integrationType:Y.Whatsapp,integrationConnectionType:Te.PairingCode,grantAccess:!0},onError:Ce=>{f("LinkingAccountError")}});s((X=(J=(Z=A.data)==null?void 0:Z.integrationAccountCreate)==null?void 0:J.durationSec)!=null?X:160)},16e4);return()=>clearInterval(P)},[o,f]),G(()=>{var Z;const P=((Z=F==null?void 0:F.userProfile)==null?void 0:Z.integrations)||[],A=P==null?void 0:P.find(J=>(J==null?void 0:J.integrationType)===Y.Whatsapp);return A!=null&&A.id&&(A==null?void 0:A.integrationType)===Y.Whatsapp&&[oe.Active,oe.Pending,oe.Processing].includes(A.status)?(W(),m(A.id),l()):(ie(1e3),m(null)),()=>{W()}},[l,m,F,ie,W]),Re($e,6e4),G(()=>{if(E<=0)return()=>{};const P=setInterval(()=>{s(A=>A-1)},1e3);return()=>clearInterval(P)},[E]);const Q=Math.floor(E/60),fe=E%60,pe="".concat(Q,":").concat(fe.toString().padStart(2,"0"));return t("form",{"aria-labelledby":"main-heading","data-testid":"add-us-form",style:{paddingBottom:"174px"},children:[e(a,{id:"main-heading",variant:"h3",align:"center",color:"text.primary",gutterBottom:!0,sx:{mb:6,fontWeight:800,fontSize:"36px",letterSpacing:"0%"},"data-testid":"main-heading",children:"Enter Code in WhatsApp"}),t(a,{children:["Linking WhatsApp account ",t("strong",{children:["+",o]})," (",e(a,{onClick:H,component:"span",style:{cursor:"pointer",fontWeight:"600",fontSize:"12px",color:"#1C47CB"},children:"Edit"}),")"]}),t("div",{style:{backgroundColor:"#F6F6F6",padding:"16px",border:"1px solid #35E8B1",borderRadius:4,marginTop:"20px",marginBottom:"10px"},children:[e("div",{style:{position:"relative",width:"100%",height:"100%",display:"flex",alignItems:"center"},children:e(ko,{onClick:T,sx:{position:"absolute",right:-3,top:0},children:e(Dn,{sx:{fontSize:"24px",color:"#1C47CB"}})})}),e(a,{textAlign:"center",fontSize:24,letterSpacing:12,fontWeight:800,"data-testid":"verification-code",children:c})]}),t(a,{variant:"body1",align:"left",sx:{color:"#29344A"},children:["Code expires in: ",e("strong",{children:pe})]}),t("ol",{style:{paddingLeft:16,fontSize:"16px",color:"#101828"},children:[e("li",{style:{marginBottom:16},children:"Open WhatsApp on your phone."}),e("li",{style:{marginBottom:16},children:"Tap âMenuâ on Android, or âSettingsâ on iPhone."}),e("li",{style:{marginBottom:16},children:"Tap âLinked devicesâ and then âLink device.â"}),e("li",{style:{marginBottom:16},children:"Tap âLink with phone number insteadâ and enter this code on your phone."})]}),e($,{fullWidth:!0,sx:{mt:3,borderRadius:"80px",fontSize:16},variant:"outlined",color:"primary",onClick:v,disabled:g,"data-testid":"open-whatsapp",children:"Copy Code & Open WhatsApp"})]})}function jt({phoneNumber:o,permissions:i,setIntegrationAccountIdParameter:n,goToNextStep:m,addError:l,lastEvaluatedIntegrationId:f,setLastEvaluatedIntegrationId:h,reset:r}){return dn.isMobile?e(vt,{phoneNumber:o,permissions:i,setIntegrationAccountIdParameter:n,goToNextStep:m,addError:l,lastEvaluatedIntegrationId:f,setLastEvaluatedIntegrationId:h,reset:r}):e(xt,{phoneNumber:o,permissions:i,setIntegrationAccountIdParameter:n,goToNextStep:m,addError:l,lastEvaluatedIntegrationId:f,setLastEvaluatedIntegrationId:h})}const St=M("div")(({theme:o})=>
1({position:"relative",[o.breakpoints.down("md")]:{display:"none",width:0},[o.breakpoints.up("lg")]:{width:500,height:"500px"}})),kt=M("img")(({theme:o})=>({position:"absolute",[o.breakpoints.down("md")]:{display:"none",width:0},[o.breakpoints.up("lg")]:{marginTop:-550,marginLeft:-35},pointerEvents:"none"}));function wt(){const o=ge(),i=ae(o.breakpoints.down("sm")),n=ae(o.breakpoints.up("lg")),m=wo(),l=Fn("usePlansV2"),{pricing:f}=Kn(),h=l?"Integrating with WhatsApp requires the Plus planâ unlock for just $".concat(f.monthlyPrice,"/month"):"Integrating with WhatsApp requires a Group Buckets subscriptionâ unlock for just $8/month",r=()=>{m("/settings#membership")};return t(y,{style:{width:"100%",display:"flex",flexDirection:"row",justifyContent:"".concat(n?"":"center")},children:[t(y,{display:"flex",flexDirection:"column",children:[e(a,{mb:i?2:4,variant:i?"pb.display.medium":"pb.display.large",id:"phone-setup-heading","aria-label":"Main heading","data-testid":"phone-setup-heading",children:"Upgrade to link your WhatsApp Account"}),e(a,{variant:"pb.body.responsive",id:"description","aria-label":"Description","data-testid":"description",children:"Link your WhatsApp account to automatically save photos and videos from your Group chats to your Photobucket account."}),t(y,{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",bgcolor:o.palette.customViolet[50],border:1,borderColor:o.palette.primary.main,borderRadius:2,margin:5,children:[e(a,{variant:"pb.body.responsive",fontWeight:900,sx:{mb:3.5,width:"80%",mt:5},children:h}),e($,{variant:"contained",color:"primary",onClick:r,sx:{mb:5,display:"flex",flexDirection:"row",gap:"4px",width:"70%",borderRadius:"40px",boxShadow:"none"},children:"Upgrade Now"})]})]}),n&&e(St,{id:"illustration-container","aria-label":"Illustration of devices showing integration","data-testid":"illustration-container",children:e(kt,{src:"https://content.photobucket.com/img/whatsapp/horizontal_devices.png",alt:"Devices showing Photobucket and WhatsApp integration",id:"illustration-image","data-testid":"illustration-image"})})]})}const It=40,At=M(y)(({theme:o})=>({minHeight:"100vh",backgroundColor:"#e6fcf5",[o.breakpoints.up("sm")]:{padding:o.spacing(2)},paddingBottom:o.spacing(10)})),No=M(Yn)(({theme:o})=>({maxWidth:"1200px",margin:"0 auto",borderRadius:"16px",boxShadow:"0px 4px 10px rgba(0, 0, 0, 0.05)",[o.breakpoints.up("sm")]:{minHeight:"680px"}})),Mt=M(No)(({theme:o})=>({[o.breakpoints.up("sm")]:{padding:[o.spacing(6),o.spacing(6),0,o.spacing(6)]},[o.breakpoints.down("sm")]:{padding:[o.spacing(6),o.spacing(2)]},"&:last-child":{paddingBottom:0}})),Pt=M(y)({display:"flex",justifyContent:"center",alignItems:"center",gap:"8px",marginBottom:"12px"}),ce=-1,ne=0,ke=1,we=2,Ie=3,V=4,se=5,Bt=o=>{switch(o){case ce:return ce;case ne:return ke;case ke:return we;case we:return Ie;case Ie:return V;case V:return se;default:return ne}},Tt=o=>{switch(o){case ce:return ce;case ke:return ne;case we:return ke;case Ie:return we;case V:return Ie;case se:return V;default:return ne}};function Ii(){var Qe,qe,Xe,eo,oo,no,to,ao,io,ro,so,lo,co,po;const o=ge(),{isWebview:i}=Mo(),[n,m]=N(ne),[l]=sn(jo,{fetchPolicy:"no-cache"}),{redirectToBucket:f}=ln(),[h,r]=N(null),[d,I]=N(null),[j,E]=N(null),{trackWhatsAppEvent:s,startSetupSession:k,getSessionId:C}=Io(),[g]=N(Date.now()),u=te(De);G(()=>{if(!u.data)return;(async()=>{var O,Ee,xe,mo,ho,uo;const{data:b}=u,S=(Ee=(O=b==null?void 0:b.userProfile)==null?void 0:O.integrations)==null?void 0:Ee.find(he=>(he==null?void 0:he.integrationType)===Y.Whatsapp);if((mo=(xe=b==null?void 0:b.userProfile)==null?void 0:xe.plan)!=null&&mo.is_whatsapp_enabled||m(ce),!!S)try{((uo=(ho=(await l({variables:{integrationId:S.id,limit:40,page:1}})).data)==null?void 0:ho.bucketIntegrationMappingsList.items)!=null?uo:[]).length>0&&(window.location.href="/integrations/manage")}catch(he){z.error("Error fetching original mappings:",he)}})()},[u.data,l,u]);const x=te(cn,{variables:{userId:(Qe=le().currentUser)==null?void 0:Qe.uid},skip:!((qe=le().currentUser)!=null&&qe.uid)});G(()=>{x.error&&z.error("Error fetching buckets",x.error)},[x.error]);const U=ue(x.fetchMore),[B,w]=N(""),[c,T]=N(Ke),[v,H]=N({captions:!0}),[R,F]=N(new Map),[ie,W]=N(new Map),[Q,fe]=Le(pn,{variables:{integrationId:h,mappings:Array.from(R).map(([p,b])=>({externalId:p,bucketId:b}))}}),pe=fe.loading,L=(no=(oo=(eo=(Xe=u.data)==null?void 0:Xe.userProfile)==null?void 0:eo.integrations)==null?void 0:oo.find(p=>(p==null?void 0:p.integrationType)===Y.Whatsapp))!=null?no:null,Ae=R
1o(c),{phoneCode:P,code:A}=Ae,Z=P+B,X=((ao=(to=Ao(Z,A))==null?void 0:to.formatInternational())!=null?ao:"").replace(/[+\s]/g,""),Ce=()=>{u.refetch()},be=()=>{w(""),T(Ke),r(null),H({captions:!0}),F(new Map),W(new Map),m(ne)},re=(p,b)=>{I(wn[p]),b||be()},K=()=>{I(null)},de=()=>{},_e=p=>{T(p)},Me=Object.keys(v).filter(p=>v[p]),ye=ae(o.breakpoints.down("sm")),_o=p=>{r(p)},me=Eo.debounce(()=>{const p=Bt(n);K(),m(p)},2e3),Je=()=>{var b,S;const p=(S=(b=u==null?void 0:u.data)==null?void 0:b.userProfile)==null?void 0:S.currentBucketId;p?f(p):window.location.href="/buckets"},Oo=Eo.debounce(()=>{if(n===ne||n===ce){Je();return}const p=Tt(n);m(p)},200),Uo=()=>{window.history.back()},Fo=(p,b,S)=>{F(_=>{const O=new Map(_);return O.set(p,b),O}),S&&W(_=>{const O=new Map(_);return O.set(p,S),O})},Ko=p=>{F(b=>{const S=new Map(b);return S.delete(p),S}),W(b=>{const S=new Map(b);return S.delete(p),S})},Ho=async()=>{try{await Q(),Array.from(R).forEach(([p,b])=>{const S={integration_id:h||"",bucket_id:b,connection_source:"setup_flow",is_reconnection:!1,session_id:C()},_=ie.get(p);_&&(S.group_name=_),s(je.BUCKET_CONNECTED,S)}),K(),me()}catch(p){re("CreatingBucketIntegrationsError")}},Oe=R.size,zo=(p,b)=>{H(S=>bo(Co({},S),{[p]:b}))};mn(()=>{k(),(L==null?void 0:L.status)==="ACTIVE"&&L.id&&(m(V),r(L.id))}),G(()=>{const b=["phone_verification","terms_permissions","qr_code","loading_groups","choose_groups","success"][n]||"unknown";s(je.SETUP_STEP_VIEWED,{step_number:n+1,step_name:b,session_id:C()})},[n,s,C]),G(()=>{if((L==null?void 0:L.status)==="ACTIVE"&&L.id&&n===V){const p=Math.floor((Date.now()-g)/1e3);s(je.ACCOUNT_LINKED,{integration_id:L.id,permissions_granted:Me,setup_duration_seconds:p,session_id:C()})}},[L,n,Me,g,s,C]),G(()=>{var S,_,O,Ee,xe;const p=(_=(S=x.data)==null?void 0:S.bucketsByUserId)==null?void 0:_.nextToken,b=(Ee=(O=x.previousData)==null?void 0:O.bucketsByUserId)==null?void 0:Ee.nextToken;!p||p===b||U.current({variables:{userId:(xe=le().currentUser)==null?void 0:xe.uid,nextToken:p}})},[(ro=(io=x.data)==null?void 0:io.bucketsByUserId)==null?void 0:ro.nextToken,(lo=(so=x.previousData)==null?void 0:so.bucketsByUserId)==null?void 0:lo.nextToken]);const Vo=Se(()=>{var p,b,S;return((S=(b=(p=x.data)==null?void 0:p.bucketsByUserId)==null?void 0:b.items)!=null?S:[]).filter(_=>{var O;return(_==null?void 0:_.ownerId)===((O=le().currentUser)==null?void 0:O.uid)})},[(po=(co=x.data)==null?void 0:co.bucketsByUserId)==null?void 0:po.items]);return Sn(),t(Cn,{suppressAppBarUnderGroupsyHeader:!0,children:[e(At,{children:t(Hn,{maxWidth:"lg",id:"phone-setup-form","aria-labelledby":"phone-setup-heading","data-testid":"phone-setup-form",sx:{marginBottom:"60px"},children:[n!==V&&!i&&e(y,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:3},id:"header-container","aria-label":"Header with back button and logo","data-testid":"header-container",children:t(ko,{onClick:n===se?Je:Oo,sx:{color:"#1c47cb",display:"flex",alignItems:"center"},href:"#",id:"back-button","aria-label":"Go back","data-testid":"back-button",children:[e(qo,{fontSize:"small"}),e(a,{variant:"body1",sx:{ml:.5,fontWeight:500},children:n===se?"Go to Photobucket Home":"Back"})]})}),n!==V&&i&&e(y,{sx:{height:It,mb:3}}),t(No,{id:"main-content-card",elevation:0,"aria-labelledby":"phone-setup-heading","data-testid":"main-content-card",sx:{marginTop:n===V?2:void 0},children:[d&&e(y,{sx:{backgroundColor:"#F2B8B5",paddingTop:o.spacing(1),paddingBottom:o.spacing(1),paddingLeft:o.spacing(2),paddingRight:o.spacing(2)},children:t(a,{variant:"body1",sx:{mb:2,textAlign:"center"},id:"integration-error-message","aria-label":"integration error message","data-testid":"integration-error-message",children:[e("b",{children:"Oops!"})," ",d," If you need support, please"," ",e(gn,{style:{color:"#000"},to:"https://support.photobucket.com/hc/en-us",onClick:de,children:"contact our Member Engagement Team for help."})]})}),t(Mt,{children:[n!==se&&t(Pt,{id:"logo-container","aria-label":"Logo and WhatsApp icon","data-testid":"logo-container",children:[e(y,{sx:{position:"relative",height:40,width:40},children:e(hn,{"data-testid":"loading-logomark",width:"40px"})}),e(a,{variant:"h6",sx:{color:"#727C8C"},children:"+"}),e(kn,{width:40,height:40})]}),n!==se&&e(a,{variant:"pb.display.small",align:"center",sx:{color:"#727C8C",mb:3},id:"subtitle","aria-label":"Subtitle","data-testid":"subtitle",children:"Link your WhatsApp"}),n===ce&&e(wt,{}),n===ne&&e(gt,{goToNextStep:me,phoneNumber:B,setPhoneNumber:w,setPhoneCodeOption:_e,phoneCodeOption:c}),n===ke&&e(lt,{fields:v,cancel:Uo,goToNextStep:me,phoneNumber:X,updatePermission:zo,addError:re}),n===we&&e(jt,{phoneNumber:X,permissions:Me,setIntegrationAccountIdParameter:_o,lastEvaluatedIntegrationId:j,setLastEvaluatedIntegrationId:E,goToNextStep:me,addError:re,reset:be}),n===Ie&&e(st,{integrationAccountId:h,goToNextStep:me,refetchUserProfile:Ce,addError:re}),n===V&&e(dt,{buckets:Vo,clearErrors:K,upsertMap:(p,b,S)=>Fo(p,b,S),removeFromMap:Ko,whatsAppIntegration:L}),n===se&&e(ft,{integrationId:h!=null?h:""})]})]})]})}),n===V&&e(y,{sx:{flexGrow:1,bottom:0,position:"fixed",width:"100%",boxShadow:"0px 0px 12px 8px #00000014"},children:e(zn,{position:"static",sx:{backgroundColor:"#ffffff",padding:ye?"0 16px":"0 64px"},children:t(Vn,{sx:{justifyContent:"space-between"},children:[t(a,{variant:"body1",sx:{color:"#101828",fontWeight:500},children:[Oe," chat",Oe===1?"":"s"," linked"]}),t(y,{sx:{display:"flex",gap:2},children:[e($,{variant:"outlined","aria-label":"Skip linking WhatsApp groups","data-testid":"skip-button",onClick:me,sx:{borderColor:"#1967d2",color:"#1967d2",borderRadius:28,paddingLeft:ye?"20px":"81px",paddingRight:ye?"20px":"81px",fontWeight:500},children:"Skip"}),e($,{variant:"contained","aria-label":"Save WhatsApp group selections","data-testid":"save-button",disabled:Oe===0||!h||pe,onClick:Ho,startIcon:pe?e(He,{size:16,color:"inherit"}):void 0,sx:{backgroundColor:"#1967d2",color:"#ffffff",borderRadius:28,paddingLeft:ye?"20px":"81px",paddingRight:ye?"20px":"81px",fontWeight:500,boxShadow:"none","&:hover":{backgroundColor:"#1658b3"}},children:pe?"Saving...":"Save"})]})]})})})]})}export{Ii as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.