71801-96b5bfabad66e7fe.js 13 KB

12
  1. (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[71801],{73756:function(e,n,r){"use strict";var t=r(57611),i=r(67597),a=r(62103),o=r(19175),c=r(10117),u=r(87739),l=function(e){var n=e.queryKey,r=e.render,i=e.renderError,l=e.initialData,s=e.loading,d=void 0===s?function(){return(0,t.jsx)(c.Z,{})}:s,f=e.fetcher,m=void 0===f?u._i:f,p=e.showSpinnerOnRevalidate,v=void 0===p||p,_=e.onFetchSuccess,h=(0,a.Z)(n,(function(){return m(n).then((function(e){return null===_||void 0===_||_(e),Promise.resolve(e)})).catch((function(e){return Promise.reject(e)}))}),{fallbackData:l}),x=h.data,b=h.error,C=h.isValidating,Z=h.mutate;if(v?C:C&&!x)return d();if(b){if(i){var g=i(b);if("undefined"!==typeof g)return g}return(0,t.jsx)(o.Z,{onRetryClicked:function(){Z()},error:b})}return r(x)};n.Z=(0,i.memo)(l)},19175:function(e,n,r){"use strict";r.d(n,{Z:function(){return m}});var t,i=r(57611),a=r(67597),o=r(61395),c=r(36284),u=r.n(c),l=r(85494);function s(){return s=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var r=arguments[n];for(var t in r)({}).hasOwnProperty.call(r,t)&&(e[t]=r[t])}return e},s.apply(null,arguments)}var d=function(e){return a.createElement("svg",s({width:15,height:15,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),t||(t=a.createElement("path",{d:"M1.85 7.5c0-2.835 2.21-5.65 5.65-5.65 2.778 0 4.152 2.056 4.737 3.15H10.5a.5.5 0 0 0 0 1h3a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-1 0v1.813C12.296 3.071 10.666.85 7.5.85 3.437.85.85 4.185.85 7.5c0 3.315 2.587 6.65 6.65 6.65 1.944 0 3.562-.77 4.714-1.942a6.77 6.77 0 0 0 1.428-2.167.5.5 0 1 0-.925-.38 5.77 5.77 0 0 1-1.216 1.846c-.971.99-2.336 1.643-4.001 1.643-3.44 0-5.65-2.815-5.65-5.65Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})))},f=r(87739),m=function(e){var n=e.onRetryClicked,r=e.error,t=(0,o.Z)("common").t;return(0,i.jsxs)("div",{className:u().container,children:[(0,i.jsx)("p",{className:u().text,children:r.message!==f.yH?t("error.general"):t("error.offline")}),(0,i.jsx)(l.ZP,{prefix:(0,i.jsx)(d,{}),size:l.qE.Small,type:l.L$.Secondary,onClick:n,children:t("retry")})]})}},71801:function(e,n,r){"use strict";r.r(n),r.d(n,{filterReciters:function(){return y}});var t=r(57611),i=r(67597),a=r(21594),o=r(19418),c=r(15129),u=r(61395),l=r(71506),s=r.n(l),d=r(73756),f=r(56539),m=r(80941),p=r(39747),v=r(81787),_=r(42366),h=r(18054),x=r(27967),b=r(12195),C=r(82427),Z=r(70356),g=r(89773),y=function(e,n){var r=new o.Z(e,{keys:["name","languageName","translatedName.name","qirat.name","style.name"],threshold:.3}).search(n).map((function(e){return e.item}));return r.length||(0,b.Dy)({query:n,source:h.Z.TranslationSettingsDrawer}),r};n.default=function(){var e=(0,u.Z)("common"),n=e.lang,r=e.t,o=(0,v.Z)(),l=o.isLoading,h=o.actions.onXstateSettingsChange,R=(0,c.useRouter)(),j=(0,i.useState)(""),E=j[0],I=j[1],k=(0,i.useContext)(C.c),w=(0,a.v)(k,(function(e){return e.context.reciterId}));return(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:s().searchInputContainer,children:(0,t.jsx)(p.Z,{isLoading:l,children:(0,t.jsx)(f.ZP,{prefix:(0,t.jsx)(_.Z,{}),id:"translations-search",value:E,onChange:I,placeholder:r("settings.search-reciter"),fixedWidth:!1,containerClassName:s().input})})}),(0,t.jsx)(d.Z,{queryKey:(0,x.jL)(n),render:function(e){var n=E?y(e.reciters,E):e.reciters;return(0,t.jsx)(m.Z.Root,{label:"reciter",orientation:m.E.Vertical,value:w.toString(),onChange:function(n){return function(e,n){if(e){var r=n.find((function(n){return n.id===Number(e)}));(0,b.u8)("selected_reciter",r.id),R.query[g.Z.Reciter]=String(r.id),R.push(R,void 0,{shallow:!0});var t=w;h("reciter",r.id,(function(){return k.send({type:"CHANGE_RECITER",reciterId:Number(e)})}),(function(){return k.send({type:"CHANGE_RECITER",reciterId:t})}),Z.Z.AUDIO)}}(n,e.reciters)},children:n.sort((function(e,n){return e.name+e.id>n.name+n.id?1:-1})).map((function(e){var n=e.id.toString();return(0,t.jsxs)("div",{className:s().reciter,children:[(0,t.jsx)(m.Z.Item,{value:n,id:n}),(0,t.jsxs)("label",{htmlFor:n,className:s().reciterLabel,children:[e.translatedName.name,"Murattal"!==e.style.name&&(0,t.jsx)("span",{className:s().recitationStyle,children:e.style.name})]})]},n)}))})}})]})}},56539:function(e,n,r){"use strict";r.d(n,{Jf:function(){return a},fz:function(){return t}});var t,i,a,o=r(45361),c=r(57044),u=r(57611),l=r(67597),s=r(37014),d=r.n(s),f=r(85494),m=r(90724),p=r.n(m),v=r(43172);!function(e){e.Small="small",e.Medium="medium",e.Large="large"}(t||(t={})),function(e){e.Error="error",e.Warning="warning",e.Success="success"}(i||(i={})),function(e){e.Default="default",e.Main="main"}(a||(a={}));n.ZP=function(e){var n=e.id,r=e.name,s=e.label,m=e.placeholder,_=e.size,h=void 0===_?t.Medium:_,x=e.fixedWidth,b=void 0===x||x,C=e.disabled,Z=void 0!==C&&C,g=e.clearable,y=void 0!==g&&g,R=e.type,j=e.variant,E=e.prefix,I=e.suffix,k=e.onClearClicked,w=e.onChange,N=e.onKeyDown,S=e.inputMode,q=e.value,L=void 0===q?"":q,D=e.shouldFlipOnRTL,M=void 0===D||D,V=e.containerClassName,W=e.htmlType,P=e.isRequired,F=e.inputRef,G=(0,l.useState)(L),T=G[0],z=G[1];(0,l.useEffect)((function(){z(L)}),[L]);var B,O;return(0,u.jsxs)(u.Fragment,{children:[s&&(0,u.jsx)("p",{className:p().label,children:s}),(0,u.jsxs)("div",{className:d()(p().container,V,(B={},(0,o.Z)(B,p().smallContainer,h===t.Small),(0,o.Z)(B,p().mediumContainer,h===t.Medium),(0,o.Z)(B,p().largeContainer,h===t.Large),(0,o.Z)(B,p().fixedWidth,b),(0,o.Z)(B,p().disabled,Z),(0,o.Z)(B,p().error,R===i.Error),(0,o.Z)(B,p().success,R===i.Success),(0,o.Z)(B,p().warning,R===i.Warning),(0,o.Z)(B,p().main,j===a.Main),B)),children:[E&&(0,u.jsx)("div",{className:d()(p().prefix,p().prefixSuffixContainer),children:E}),(0,u.jsx)("input",(0,c.Z)({className:d()(p().input,(O={},(0,o.Z)(O,p().error,R===i.Error),(0,o.Z)(O,p().success,R===i.Success),(0,o.Z)(O,p().warning,R===i.Warning),(0,o.Z)(O,p().rtlInput,M),O)),type:W,required:P,dir:"auto",id:n,ref:F,disabled:Z,onChange:function(e){var n=e.target.value;z(n),w&&w(n)},value:T,onKeyDown:N,inputMode:S},m&&{placeholder:m},r&&{name:r})),y?(0,u.jsx)(u.Fragment,{children:T&&(0,u.jsx)("div",{className:p().clearContainer,children:(0,u.jsx)(f.ZP,{shape:f.jL.Circle,variant:f.Wu.Ghost,size:f.qE.Small,onClick:k,children:(0,u.jsx)(v.Z,{})})})}):(0,u.jsx)(u.Fragment,{children:I&&(0,u.jsx)("div",{className:d()(p().suffix,p().prefixSuffixContainer),children:I})})]})]})}},80941:function(e,n,r){"use strict";r.d(n,{E:function(){return _.j},Z:function(){return x}});var t=r(45361),i=r(57044),a=r(16946),o=r(96151),c=r(57611),u=(r(67597),r(37014)),l=r.n(u),s=r(50664),d=r(25184),f=r.n(d),m=function(e){var n=e.className,r=e.indicatorClassName,t=(0,o.Z)(e,["className","indicatorClassName"]);return(0,c.jsx)(s.ck,(0,a.Z)((0,i.Z)({className:l()(f().radioItem,n)},t),{children:(0,c.jsx)(s.z$,{className:l()(f().indicator,r)})}))},p=r(30808),v=r.n(p),_=r(97204),h=function(e){var n=e.items,r=e.disabled,u=void 0!==r&&r,s=(0,o.Z)(e,["items","disabled"]);return(0,c.jsx)(_.Z,(0,a.Z)((0,i.Z)({},s),{children:n.map((function(e){var n=!0===u||!0===e.disabled;return(0,c.jsxs)("div",{className:v().radioItemContainer,children:[(0,c.jsx)(m,{value:e.value,id:e.id,disabled:n,required:e.required||!1}),(0,c.jsx)("label",{htmlFor:e.id,className:l()(v().label,(0,t.Z)({},v().disabled,n)),children:e.label})]},e.id)}))}))};h.Root=_.Z,h.Item=m;var x=h},97204:function(e,n,r){"use strict";r.d(n,{j:function(){return t}});var t,i=r(57044),a=r(16946),o=r(57611),c=(r(67597),r(50664)),u=r(37014),l=r.n(u),s=r(4811),d=r.n(s),f=r(22209);!function(e){e.Horizontal="horizontal",e.Vertical="vertical"}(t||(t={}));n.Z=function(e){var n=e.className,r=e.label,u=e.orientation,s=void 0===u?t.Vertical:u,m=e.onChange,p=e.defaultValue,v=e.value,_=e.name,h=e.required,x=e.children,b=(0,f.Z)();return(0,o.jsx)(c.fC,(0,a.Z)((0,i.Z)({className:l()(d().container,n),dir:b,"aria-label":r,orientation:s},m&&{onValueChange:m},p&&{defaultValue:p},v&&{value:v},_&&{name:_},h&&{required:h}),{children:x}))}},36284:function(e){e.exports={container:"Error_container__1m9XV",text:"Error_text__yg4kD"}},71506:function(e){e.exports={reciter:"ReciterSelectionBody_reciter__UiTm4",reciterLabel:"ReciterSelectionBody_reciterLabel__IjlJw",recitationStyle:"ReciterSelectionBody_recitationStyle__vWjKD",searchInputContainer:"ReciterSelectionBody_searchInputContainer__YIeoq",input:"ReciterSelectionBody_input___SxR_"}},90724:function(e){e.exports={container:"Input_container__5BNOH",fixedWidth:"Input_fixedWidth__MZoNx",disabled:"Input_disabled__AFA4l",error:"Input_error__cfc8q",success:"Input_success__qb_Ue",warning:"Input_warning__KwRSJ",main:"Input_main__K4bVL",input:"Input_input__za7E9",rtlInput:"Input_rtlInput__8Yg1Q",smallContainer:"Input_smallContainer__bxyYT",mediumContainer:"Input_mediumContainer__jEOpT",largeContainer:"Input_largeContainer__yafZ8",label:"Input_label__loZWW",clearContainer:"Input_clearContainer__3LxT4",prefixSuffixContainer:"Input_prefixSuffixContainer__n84F6",prefix:"Input_prefix__jYhnp",suffix:"Input_suffix__v_BvR"}},25184:function(e){e.exports={indicator:"Item_indicator__x6BoJ",radioItem:"Item_radioItem__DEP6h"}},30808:function(e){e.exports={radioItemContainer:"RadioGroup_radioItemContainer__Zpb6v",label:"RadioGroup_label__h0v1C",disabled:"RadioGroup_disabled__aU243"}},4811:function(e){e.exports={container:"Root_container__FbYRt"}},50664:function(e,n,r){"use strict";r.d(n,{ck:function(){return P},fC:function(){return W},z$:function(){return F}});var t=r(57384),i=r(67597),a=r(90149),o=r(71641),c=r(61544),u=r(4300),l=r(46531),s=r(82305),d=r(4460),f=r(81319),m=r(10810),p=r(8591);const v="Radio",[_,h]=(0,c.b)(v),[x,b]=_(v),C=(0,i.forwardRef)(((e,n)=>{const{__scopeRadio:r,name:c,checked:l=!1,required:s,disabled:d,value:f="on",onCheck:m,...p}=e,[v,_]=(0,i.useState)(null),h=(0,o.e)(n,(e=>_(e))),b=(0,i.useRef)(!1),C=!v||Boolean(v.closest("form"));return(0,i.createElement)(x,{scope:r,checked:l,disabled:d},(0,i.createElement)(u.WV.button,(0,t.Z)({type:"button",role:"radio","aria-checked":l,"data-state":R(l),"data-disabled":d?"":void 0,disabled:d,value:f},p,{ref:h,onClick:(0,a.M)(e.onClick,(e=>{l||null===m||void 0===m||m(),C&&(b.current=e.isPropagationStopped(),b.current||e.stopPropagation())}))})),C&&(0,i.createElement)(y,{control:v,bubbles:!b.current,name:c,value:f,checked:l,required:s,disabled:d,style:{transform:"translateX(-100%)"}}))})),Z="RadioIndicator",g=(0,i.forwardRef)(((e,n)=>{const{__scopeRadio:r,forceMount:a,...o}=e,c=b(Z,r);return(0,i.createElement)(p.z,{present:a||c.checked},(0,i.createElement)(u.WV.span,(0,t.Z)({"data-state":R(c.checked),"data-disabled":c.disabled?"":void 0},o,{ref:n})))})),y=e=>{const{control:n,checked:r,bubbles:a=!0,...o}=e,c=(0,i.useRef)(null),u=(0,m.D)(r),l=(0,f.t)(n);return(0,i.useEffect)((()=>{const e=c.current,n=window.HTMLInputElement.prototype,t=Object.getOwnPropertyDescriptor(n,"checked").set;if(u!==r&&t){const n=new Event("click",{bubbles:a});t.call(e,r),e.dispatchEvent(n)}}),[u,r,a]),(0,i.createElement)("input",(0,t.Z)({type:"radio","aria-hidden":!0,defaultChecked:r},o,{tabIndex:-1,ref:c,style:{...e.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}}))};function R(e){return e?"checked":"unchecked"}const j=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],E="RadioGroup",[I,k]=(0,c.b)(E,[l.Pc,h]),w=(0,l.Pc)(),N=h(),[S,q]=I(E),L=(0,i.forwardRef)(((e,n)=>{const{__scopeRadioGroup:r,name:a,defaultValue:o,value:c,required:f=!1,disabled:m=!1,orientation:p,dir:v,loop:_=!0,onValueChange:h,...x}=e,b=w(r),C=(0,d.gm)(v),[Z,g]=(0,s.T)({prop:c,defaultProp:o,onChange:h});return(0,i.createElement)(S,{scope:r,name:a,required:f,disabled:m,value:Z,onValueChange:g},(0,i.createElement)(l.fC,(0,t.Z)({asChild:!0},b,{orientation:p,dir:C,loop:_}),(0,i.createElement)(u.WV.div,(0,t.Z)({role:"radiogroup","aria-required":f,"aria-orientation":p,"data-disabled":m?"":void 0,dir:C},x,{ref:n}))))})),D="RadioGroupItem",M=(0,i.forwardRef)(((e,n)=>{const{__scopeRadioGroup:r,disabled:c,...u}=e,s=q(D,r),d=s.disabled||c,f=w(r),m=N(r),p=(0,i.useRef)(null),v=(0,o.e)(n,p),_=s.value===u.value,h=(0,i.useRef)(!1);return(0,i.useEffect)((()=>{const e=e=>{j.includes(e.key)&&(h.current=!0)},n=()=>h.current=!1;return document.addEventListener("keydown",e),document.addEventListener("keyup",n),()=>{document.removeEventListener("keydown",e),document.removeEventListener("keyup",n)}}),[]),(0,i.createElement)(l.ck,(0,t.Z)({asChild:!0},f,{focusable:!d,active:_}),(0,i.createElement)(C,(0,t.Z)({disabled:d,required:s.required,checked:_},m,u,{name:s.name,ref:v,onCheck:()=>s.onValueChange(u.value),onKeyDown:(0,a.M)((e=>{"Enter"===e.key&&e.preventDefault()})),onFocus:(0,a.M)(u.onFocus,(()=>{var e;h.current&&(null===(e=p.current)||void 0===e||e.click())}))})))})),V=(0,i.forwardRef)(((e,n)=>{const{__scopeRadioGroup:r,...a}=e,o=N(r);return(0,i.createElement)(g,(0,t.Z)({},o,a,{ref:n}))})),W=L,P=M,F=V},10810:function(e,n,r){"use strict";r.d(n,{D:function(){return i}});var t=r(67597);function i(e){const n=(0,t.useRef)({value:e,previous:e});return(0,t.useMemo)((()=>(n.current.value!==e&&(n.current.previous=n.current.value,n.current.value=e),n.current.previous)),[e])}}}]);
  2. //# sourceMappingURL=71801-96b5bfabad66e7fe.js.map