(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[55582],{155582:(e,o,l)=>{l.d(o,{Z:()=>T});var s=l(667294),t=l(6637);var i=l(512465),n=l(898781),r=l(19121),a=l(349700),c=l(129274),_=l(966113),d=l(883119),h=l(785893);const u=_.K_+"?source=block_dialogue";function f(e){return e.map((({full_name:e})=>e))}const m=function({users:e,onClose:o,onSubmit:l}){const s=(0,n.ZP)(),t=(0,h.jsx)("strong",{children:(0,i.Z)(f(e),s)},"userlist");return(0,h.jsxs)("form",{method:"post",children:[(0,h.jsxs)(d.xu,{padding:8,children:[(0,h.jsx)(d.xv,{children:(0,a.nk)(s.bt("If you block {{ users }}, you won’t be able to follow each other or interact with each other’s Pins.", "If you block {{ users }}, you won’t be able to follow each other or interact with each other’s Pins.", "description of blocking users", undefined, true),{users:t})}),(0,h.jsx)("br",{}),(0,h.jsx)("br",{}),(0,h.jsx)(d.xv,{children:(0,h.jsx)(d.rU,{display:"inlineBlock",href:u,underline:"hover",children:s.bt("Learn more", "Learn more", "link to learn more about blocking", undefined, true)})})]}),(0,h.jsx)(d.xu,{padding:2,children:(0,h.jsxs)(d.kC,{alignItems:"stretch",justifyContent:"end",gap:{row:1,column:0},children:[(0,h.jsx)(d.zx,{fullWidth:!0,onClick:o,text:s.bt("Cancel", "Cancel", "UserBlock.Cancel", undefined, true)}),(0,h.jsx)(d.zx,{fullWidth:!0,color:"red",onClick:()=>{l()},text:s.bt("Block", "Block", "UserBlock.Submit", undefined, true),type:"submit"})]})})]})};var p=l(174798);const g=({flagReason:e,flagType:o,onClose:l,selectedReason:u,status:g,users:k})=>{const x=(0,n.ZP)(),[P,b]=(0,s.useState)({}),{setModalTitle:A,setStatus:z}=(0,c.d)(),w=(0,r.Z)(),{id:T}=w.isAuth?w:{},j=k.filter((({id:e})=>P[e])),C=j.length>0;(0,s.useEffect)((()=>{(()=>{let e;[p.qb.SUBMITTED,p.qb.PROCESSING].includes(g)?e=x.nbt(["Block this person?", "Block these people?"], j.length, "BlockAndUnfollow", true):o===p.Vm.CONVERSATION&&(e=g===p.qb.COMPLETED?(0,a.nk)(x.bt("You’ve blocked {{usernames}}", "You’ve blocked {{usernames}}", "BlockAndUnfollow", undefined, true),{usernames:(0,i.Z)(f(j),x).join("")}).join(""):x.bt("Thanks for your report", "Thanks for your report", "BlockAndUnfollow", undefined, true)),A(e)})()}),[g]),(0,s.useEffect)((()=>{z(C?p.qb.SELECTED:p.qb.STARTED)}),[P]);const v=k.filter((({id:e})=>e!==T)),y=[p.qb.STARTED,p.qb.COMPLETED].includes(g);return(0,h.jsx)("form",{method:"post",children:[p.qb.SUBMITTED,p.qb.PROCESSING].includes(g)?(0,h.jsx)(m,{onClose:()=>{z(p.qb.SELECTED)},onSubmit:()=>(z(p.qb.PROCESSING),Promise.all(Object.keys(P).filter((e=>P[e])).map((e=>function(e){return t.Z.create("UserBlockResource",{blocked_user_id:e}).callCreate().then((()=>{}),(()=>{}))}(e)))).finally((()=>{z(p.qb.COMPLETED)}))),users:j}):(0,h.jsxs)(d.xu,{padding:8,children:[(0,h.jsx)(d.xu,{children:g!==p.qb.COMPLETED?(()=>{let o;"harassingOther"===u?o=(0,a.nk)(x.bt("We remove content that identifies and attacks private people because we consider it to be bullying. We also don’t allow content that reveals someone’s personally identifiable information. Find out more about our {{ communityGuidelines }}.", "We remove content that identifies and attacks private people because we consider it to be bullying. We also don’t allow content that reveal someone’s personally identifiable information. Learn more about our {{ communityGuidelines }}.", "confirmation message after reporting harassment", undefined, true),{communityGuidelines:(0,h.jsx)(d.rU,{display:"inlineBlock",href:_.Ms,underline:"hover",children:x.bt("Community Guidelines", "Community Guidelines", "link to community guidelines for harassment", undefined, true)},"policyLink")}):"harassingPublicFigure"===u?o=x.bt("Please note that we won’t necessarily take down stuff that attacks public figures.", "Please note that we won’t necessarily take down stuff that attacks public figures.", "message shown after reporting harrassment", undefined, true):"harassingFriend"===u?o=x.bt("Before we can review this Pin, we need to hear from the person who’s being harassed. Please ask your friend to report this Pin to us.", "Before we can review this Pin, we need to hear from the person who’s being harassed. Please have your friend report this Pin to us.", "message shown after reporting harrassment", undefined, true):["spam","policies","hurtfulContent"].includes(e)&&(o=x.bt("We’ll have a look at this Pin and delete it if it goes against our policies.", "We’ll take a look at this Pin and delete it if it goes against our policies.", "confirmation message after reporting a pin", undefined, true));const l=x.nbt(["You can also block this person.", "You can also block these people."], v.length, "description to block people", true);return(0,h.jsxs)(s.Fragment,{children:[o&&(0,h.jsx)(d.xu,{marginBottom:8,children:(0,h.jsx)(d.xv,{children:o})}),(0,h.jsx)(d.xu,{marginBottom:8,children:(0,h.jsx)(d.xv,{children:l})}),(0,h.jsx)(d.xu,{marginBottom:8,children:v.map((({id:e,full_name:o})=>(0,h.jsx)(d.XZ,{id:"blockPinner"+e,checked:Boolean(P[e]),label:(0,a.nk)(x.bt("Block {{ pinnerName }}", "Block {{ pinnerName }}", "BlockAndUnfollow", undefined, true),{pinnerName:o}).join(""),onChange:({checked:o})=>{b({...P,[e]:o})},helperText:x.bt("You won’t be able to send each other messages or interact with each other’s Pins.", "You won’t be able to send each other messages or interact with each other’s Pins.", "BlockAndUnfollow", undefined, true)},e)))})]})})():C&&(0,h.jsx)(d.xu,{marginBottom:8,children:(0,h.jsx)(d.xv,{children:x.bt("You won’t be able to follow each other or interact with each other’s Pins.", "You won’t be able to follow each other or interact with each other’s pins.", "BlockAndUnfollow", undefined, true)},"blockingConfirmation")})}),(0,h.jsxs)(d.xu,{children:[g!==p.qb.COMPLETED&&(0,h.jsx)(d.xu,{marginBottom:8,children:(0,h.jsx)(d.xv,{size:"100",children:(0,a.nk)(x.bt("Learn more about {{ linkToTopic }}", "Learn more about {{ linkToTopic }}", "BlockAndUnfollow", undefined, true),{linkToTopic:(0,h.jsx)(d.rU,{display:"inlineBlock",href:_.K_,underline:"hover",children:x.bt("blocking", "blocking", "BlockAndUnfollow", undefined, true)},"policyLink")})})}),(0,h.jsx)(d.xu,{children:(0,h.jsx)(d.zx,{fullWidth:!0,color:"red",onClick:y?l:()=>{b(P),z(p.qb.SUBMITTED)},text:y?x.bt("Done", "Done", "Block.Complete", undefined, true):x.bt("Block", "Block", "BlockAndUnfollow", undefined, true)})})]})]})})};function k({flagOptions:e,flow:o,handleClose:l,handleNext:s,selectedReason:t,showPrimaryAction:i,submitButton:r}){const a=(0,n.ZP)();if(o===p.Zw.REPORT){var c;if(p.qb.PROCESSING===status||null!==(c=e.getFlagOption(t))&&void 0!==c&&c.isTerminalReason)return r;if(i)return(0,h.jsx)(d.zx,{fullWidth:!0,color:"red",disabled:void 0===t,onClick:s,text:a.bt("Next", "Next", "go to the next view in the report flow", undefined, true)})}else if(o===p.Zw.END)return(0,h.jsx)(d.zx,{fullWidth:!0,color:"red",onClick:l,text:a.bt("Got it", "Got it", "confirm reporting flow is done & close modal", undefined, true)});return null}var x=l(121151);function P({flow:e,flagReason:o}){const l=(0,n.ZP)();if(e===p.Zw.REPORT){if("attacks"===o)return(0,h.jsx)(d.xv,{size:"100",children:(0,a.nk)(l.bt("Learn more about our {{ linkToTopic }}", "Learn more about our {{ linkToTopic }}", "footer link to learn more about community guidelines", undefined, true),{linkToTopic:(0,h.jsx)(d.rU,{target:"blank",href:_.Ms,children:(0,h.jsx)(d.xv,{inline:!0,color:"error",size:"100",weight:"bold",children:l.bt("Community Guidelines", "Community Guidelines", "name of footer link to community guidelines", undefined, true)})},"policyLink")})});if("policies"===o)return(0,h.jsxs)("p",{children:[(0,h.jsx)(d.xv,{size:"100",children:(0,a.nk)(l.bt("Learn about {{ linkToTopic }}", "Learn about {{ linkToTopic }}", "footer link to learn more about a topic", undefined, true),{linkToTopic:(0,h.jsx)(d.rU,{target:"blank",href:_.Ms+"#sub-section-adult-content",children:(0,h.jsx)(d.xv,{inline:!0,color:"error",size:"100",children:l.bt("our nudity policies", "our nudity policies", "name of footer link to policy", undefined, true)})},"policyLink")})}),(0,h.jsx)(d.xv,{size:"100",children:(0,a.nk)(l.bt("Learn about {{ linkToTopic }}", "Learn about {{ linkToTopic }}", "footer link to learn more about a topic", undefined, true),{linkToTopic:(0,h.jsx)(d.rU,{target:"blank",href:_.Ms+"#sub-section-dangerous-goods-and-activities",children:(0,h.jsx)(d.xv,{inline:!0,color:"error",size:"100",children:l.bt("our policies on hurtful content", "our policies on hurtful content", "name of footer link to policy", undefined, true)})},"policyLink")})}),(0,h.jsx)(d.xv,{size:"100",children:(0,a.nk)(l.bt("Learn about {{ linkToTopic }}", "Learn about {{ linkToTopic }}", "footer link to learn more about a topic", undefined, true),{linkToTopic:(0,h.jsx)(d.rU,{target:"blank",href:_.Ms+"#sub-section-violence",children:(0,h.jsx)(d.xv,{inline:!0,color:"error",size:"100",children:l.bt("our policies on gore", "our policies on gore", "name of footer link to policy", undefined, true)})},"policyLink")})})]});if("spam"===o||void 0===o)return(0,h.jsx)(d.xv,{size:"100",children:(0,a.nk)(l.bt("Learn about {{ linkToTopic }}", "Learn about {{ linkToTopic }}", "footer link to learn more about a topic", undefined, true),{linkToTopic:(0,h.jsx)(d.rU,{target:"blank",href:_.Ms,children:(0,h.jsx)(d.xv,{inline:!0,color:"error",size:"100",weight:"bold",children:"spam"===o?l.bt("our spam policies", "our spam policies", "name of footer link to policy", undefined, true):l.bt("our policies", "our policies", "name of footer link to policy", undefined, true)})},"policyLink")})})}return null}function b({arrayOfData:e,handleSelectReason:o,selectedReason:l}){const s=(0,n.ZP)();return(0,h.jsx)(d.xu,{padding:2,children:(0,h.jsx)(d.FX,{id:"flag-option-radio-group",legend:s.bt("Flag legends", "Flag legends", "flag_legend", undefined, true),legendDisplay:"hidden",children:e.map(((e,s)=>{const{condition:t}=e;return void 0===t||t?function(e,o,l,s){const{text:t,value:i,category:n}=e;return(0,h.jsx)(d.xu,{paddingY:2,children:(0,h.jsx)(d.FX.RadioButton,{checked:l===i,id:i,onChange:({checked:e})=>o(e,i,n),name:"flagReason",value:i,label:t})},s)}(e,o,l,s):null}))})})}class A{constructor(e){this.config=e,this.configMap=function(e){const o={};for(const l in e)e[l].forEach((e=>{const s=e.value;if(Object.prototype.hasOwnProperty.call(o,s))throw new Error("Duplicate key in FlagOptions config: "+s);o[s]={...e,parentOption:l}}));return o}(e)}getFlagOption(e){return e?this.configMap[e]:null}renderFlagLabels(e){const{flagReason:o,onSelectReason:l,selectedReason:s}=e;return(0,h.jsx)(b,{arrayOfData:this.config[o],handleSelectReason:l,selectedReason:s})}}function z(e,o,l){return o in e?Object.defineProperty(e,o,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[o]=l,e}class w extends s.Component{constructor(...e){super(...e),z(this,"flagOptions",new A(this.props.flagOptionsConfig)),z(this,"renderContent",(()=>{const{content:e,flow:o,onSelectReason:l,selectedReason:s}=this.props;return e||(o===p.Zw.REPORT?this.flagOptions.renderFlagLabels({flagReason:this.props.flagReason||"__default",onSelectReason:l,selectedReason:s}):o===p.Zw.END?(0,h.jsx)(d.xv,{children:this.props.i18n.bt("We’ll use your feedback to make your Pinterest experience better.", "We’ll use your feedback to make your Pinterest experience better.", "final message in reporting flow", undefined, true)}):void 0)}))}componentDidUpdate(e){const{flow:o,onCompletedReport:l,onCompletedBlock:s}=e;if(this.props.flow!==o)switch(o){case p.Zw.REPORT:l&&l();break;case p.Zw.BLOCK:s&&s()}}render(){const{accessibilityModalLabel:e,flagType:o,flow:l,status:s,modalTitle:t,onClose:i,selectedReason:n,submitButton:r,flagReason:a,showPrimaryAction:c,users:_}=this.props;return(0,h.jsx)(x.ZP,{accessibilityModalLabel:e,heading:t,onDismiss:i,size:"md",footer:l!==p.Zw.BLOCK?(0,h.jsxs)(d.kC,{alignItems:"center",justifyContent:"start",children:[(0,h.jsx)(d.xu,{flex:"grow",children:(0,h.jsx)(P,{flagReason:a,flow:l})}),(0,h.jsx)(d.xu,{padding:1,children:l===p.Zw.REPORT?(0,h.jsx)(d.zx,{fullWidth:!0,onClick:void 0===a?this.props.onClose:()=>{var e,o;null===(e=(o=this.props).onRevert)||void 0===e||e.call(o)},text:void 0===a?this.props.i18n.bt("Cancel", "Cancel", "cancel form", undefined, true):this.props.i18n.bt("Back", "Back", "previous step in a form", undefined, true)}):null}),(0,h.jsx)(d.xu,{padding:1,children:(0,h.jsx)(k,{flagOptions:this.flagOptions,flow:l,handleClose:this.props.onClose,handleNext:()=>{var e,o;null===(e=(o=this.props).onNext)||void 0===e||e.call(o)},selectedReason:n,showPrimaryAction:!!c,submitButton:r})})]}):void 0,children:(0,h.jsx)(d.xu,{children:l===p.Zw.BLOCK?(0,h.jsx)(g,{flagReason:a,flagType:o,onClose:i,selectedReason:n,status:s,users:_}):this.renderContent()})})}}function T(e){const o=(0,n.ZP)();return(0,h.jsx)(w,{...e,i18n:o})}},129274:(e,o,l)=>{l.d(o,{N:()=>c,d:()=>a});var s=l(667294),t=l(425288),i=l(174798),n=l(785893);const{Provider:r,useHook:a}=(0,t.Z)("Flag"),c=({children:e})=>{const[o,l]=(0,s.useState)(),[t,a]=(0,s.useState)(i.Zw.REPORT),[c,_]=(0,s.useState)(i.qb.STARTED),[d,h]=(0,s.useState)(),[u,f]=(0,s.useState)(),m=(0,s.useMemo)((()=>({flagReason:u,flow:t,status:c,selectedReason:d,modalTitle:o,setFlagReason:f,setFlow:a,setModalTitle:l,setStatus:_,setSelectedReason:h})),[o,t,c,d,u]);return(0,n.jsx)(r,{value:m,children:e})}},174798:(e,o,l)=>{l.d(o,{Vm:()=>i,Zw:()=>s,qb:()=>t});const s={REPORT:"REPORT",BLOCK:"BLOCK",END:"END"},t={STARTED:"STARTED",SELECTED:"SELECTED",SUBMITTED:"SUBMITTED",PROCESSING:"PROCESSING",COMPLETED:"COMPLETED"},i={CONVERSATION:"CONVERSATION",DID_IT:"DID_IT"}},512465:(e,o,l)=>{l.d(o,{Z:()=>_,w:()=>d});var s=l(349700);const t=e=>e.bt("{{ first }}", "{{ first }}", "Generic message that lists 1 item", undefined, true),i=e=>e.bt("{{ first }} and {{ second }}", "{{ first }} and {{ second }}", "Generic message that lists 2 items", undefined, true),n=e=>e.bt("{{ first }}, {{ second }} and {{ third }}", "{{ first }}, {{ second }} and {{ third }}", "Generic message that lists 3 items", undefined, true),r=e=>e.bt("{{ first }}, {{ second }}, {{ third }} and {{ fourth }}", "{{ first }}, {{ second }}, {{ third }} and {{ fourth }}", "Generic message that lists 4 items", undefined, true),a=e=>e.bt("{{ first }}, {{ second }}, {{ third }}, {{ fourth }} and {{ fifth }}", "{{ first }}, {{ second }}, {{ third }}, {{ fourth }} and {{ fifth }}", "Generic message that lists 5 items", undefined, true),c=e=>e.bt("{{ first }}, {{ second }}, {{ third }}, {{ fourth }}, {{ fifth }} and {{ sixth }}", "{{ first }}, {{ second }}, {{ third }}, {{ fourth }}, {{ fifth }} and {{ sixth }}", "Generic message that lists 6 items", undefined, true);function _(e,o){const l={first:e[0],second:e[1],third:e[2],fourth:e[3],fifth:e[4],sixth:e[5],remaining:e.length-5};switch(e.length){case 0:return[];case 1:return(0,s.nk)(t(o),l);case 2:return(0,s.nk)(i(o),l);case 3:return(0,s.nk)(n(o),l);case 4:return(0,s.nk)(r(o),l);case 5:return(0,s.nk)(a(o),l);case 6:return(0,s.nk)(c(o),l);default:return(0,s.nk)((e=>e.bt("{{ first }}, {{ second }}, {{ third }}, {{ fourth }}, {{ fifth }} and {{ remaining }} others", "{{ first }}, {{ second }}, {{ third }}, {{ fourth }}, {{ fifth }} and {{ remaining }} others", "Generic message that lists more than 6 items", undefined, true))(o),l)}}function d(e,o){const l={first:e[0],second:e[1],third:e[2],fourth:e[3],fifth:e[4],sixth:e[5],seventh:e[6],remaining:e.length-6};switch(e.length){case 0:return[];case 1:return(0,s.nk)(t(o),l);case 2:return(0,s.nk)(i(o),l);case 3:return(0,s.nk)(n(o),l);case 4:return(0,s.nk)(r(o),l);case 5:return(0,s.nk)(a(o),l);case 6:return(0,s.nk)(c(o),l);case 7:return(0,s.nk)((e=>e.bt("{{ first }}, {{ second }}, {{ third }}, {{ fourth }}, {{ fifth }}, {{ sixth }} and {{ seventh }}", "{{ first }}, {{ second }}, {{ third }}, {{ fourth }}, {{ fifth }}, {{ sixth }} and {{ seventh }}", "Generic message that lists 7 items", undefined, true))(o),l);default:return(0,s.nk)((e=>e.bt("{{ first }}, {{ second }}, {{ third }}, {{ fourth }}, {{ fifth }}, {{ sixth }} and {{ remaining }} others", "{{ first }}, {{ second }}, {{ third }}, {{ fourth }}, {{ fifth }}, {{ sixth }} and {{ remaining }} others", "Generic message that lists more than 7 items", undefined, true))(o),l)}}}}]);
//# sourceMappingURL=https://sm.pinimg.com/webapp/55582.en_AU-0931a5d78cd65bc3.mjs.map