PageSourceSearch

https://indiancaucus.org/_next/static/chunks/pages/dashboard/diya-37e8641e9e4ace60.js

js indiancaucus.org collected 2026-09-24 14:28:48 UTC 13,073 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1424],{42372:(e,t,i)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/dashboard/diya",function(){return i(92468)}])},72552:()=>{},72784:(e,t,i)=>{"use strict";var n=i(65364);i(72552);var s=i(14232),r=function(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}(s),a=void 0!==n&&n.env&&!0,o=function(e){return"[object String]"===Object.prototype.toString.call(e)},d=function(){function e(e){var t=void 0===e?{}:e,i=t.name,n=void 0===i?"stylesheet":i,s=t.optimizeForSpeed,r=void 0===s?a:s;l(o(n),"`name` must be a string"),this._name=n,this._deletedRulePlaceholder="#"+n+"-deleted-rule____{}",l("boolean"==typeof r,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=r,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0;var d=document.querySelector('meta[property="csp-nonce"]');this._nonce=d?d.getAttribute("content"):null}var t,i=e.prototype;return i.setOptimizeForSpeed=function(e){l("boolean"==typeof e,"`setOptimizeForSpeed` accepts a boolean"),l(0===this._rulesCount,"optimizeForSpeed cannot be when rules have already been inserted"),this.flush(),this._optimizeForSpeed=e,this.inject()},i.isOptimizeForSpeed=function(){return this._optimizeForSpeed},i.inject=function(){var e=this;if(l(!this._injected,"sheet already injected"),this._injected=!0,this._optimizeForSpeed){this._tags[0]=this.makeStyleTag(this._name),this._optimizeForSpeed="insertRule"in this.getSheet(),this._optimizeForSpeed||(a||console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode."),this.flush(),this._injected=!0);return}this._serverSheet={cssRules:[],insertRule:function(t,i){return"number"==typeof i?e._serverSheet.cssRules[i]={cssText:t}:e._serverSheet.cssRules.push({cssText:t}),i},deleteRule:function(t){e._serverSheet.cssRules[t]=null}}},i.getSheetForTag=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]},i.getSheet=function(){return this.getSheetForTag(this._tags[this._tags.length-1])},i.insertRule=function(e,t){if(l(o(e),"`insertRule` accepts only strings"),this._optimizeForSpeed){var i=this.getSheet();"number"!=typeof t&&(t=i.cssRules.length);try{i.insertRule(e,t)}catch(t){return a||console.warn("StyleSheet: illegal rule: \n\n"+e+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),-1}}else{var n=this._tags[t];this._tags.push(this.makeStyleTag(this._name,e,n))}return this._rulesCount++},i.replaceRule=function(e,t){if(this._optimizeForSpeed){var i=this.getSheet();if(t.trim()||(t=this._deletedRulePlaceholder),!i.cssRules[e])return e;i.deleteRule(e);try{i.insertRule(t,e)}catch(n){a||console.warn("StyleSheet: illegal rule: \n\n"+t+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),i.insertRule(this._deletedRulePlaceholder,e)}}else{var n=this._tags[e];l(n,"old rule at index `"+e+"` not found"),n.textContent=t}return e},i.deleteRule=function(e){if(this._optimizeForSpeed)this.replaceRule(e,"");else{var t=this._tags[e];l(t,"rule at index `"+e+"` not found"),t.parentNode.removeChild(t),this._tags[e]=null}},i.flush=function(){this._injected=!1,this._rulesCount=0,this._tags.forEac
1h(function(e){return e&&e.parentNode.removeChild(e)}),this._tags=[]},i.cssRules=function(){var e=this;return this._tags.reduce(function(t,i){return i?t=t.concat(Array.prototype.map.call(e.getSheetForTag(i).cssRules,function(t){return t.cssText===e._deletedRulePlaceholder?null:t})):t.push(null),t},[])},i.makeStyleTag=function(e,t,i){t&&l(o(t),"makeStyleTag accepts only strings as second parameter");var n=document.createElement("style");this._nonce&&n.setAttribute("nonce",this._nonce),n.type="text/css",n.setAttribute("data-"+e,""),t&&n.appendChild(document.createTextNode(t));var s=document.head||document.getElementsByTagName("head")[0];return i?s.insertBefore(n,i):s.appendChild(n),n},t=[{key:"length",get:function(){return this._rulesCount}}],function(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(e.prototype,t),e}();function l(e,t){if(!e)throw Error("StyleSheet: "+t+".")}var c=function(e){for(var t=5381,i=e.length;i;)t=33*t^e.charCodeAt(--i);return t>>>0},h={};function u(e,t){if(!t)return"jsx-"+e;var i=String(t),n=e+i;return h[n]||(h[n]="jsx-"+c(e+"-"+i)),h[n]}function m(e,t){var i=e+t;return h[i]||(h[i]=t.replace(/__jsx-style-dynamic-selector/g,e)),h[i]}var p=function(){function e(e){var t=void 0===e?{}:e,i=t.styleSheet,n=void 0===i?null:i,s=t.optimizeForSpeed,r=void 0!==s&&s;this._sheet=n||new d({name:"styled-jsx",optimizeForSpeed:r}),this._sheet.inject(),n&&"boolean"==typeof r&&(this._sheet.setOptimizeForSpeed(r),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer=void 0,this._indices={},this._instancesCounts={}}var t=e.prototype;return t.add=function(e){var t=this;void 0===this._optimizeForSpeed&&(this._optimizeForSpeed=Array.isArray(e.children),this._sheet.setOptimizeForSpeed(this._optimizeForSpeed),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer||(this._fromServer=this.selectFromServer(),this._instancesCounts=Object.keys(this._fromServer).reduce(function(e,t){return e[t]=0,e},{}));var i=this.getIdAndRules(e),n=i.styleId,s=i.rules;if(n in this._instancesCounts){this._instancesCounts[n]+=1;return}var r=s.map(function(e){return t._sheet.insertRule(e)}).filter(function(e){return -1!==e});this._indices[n]=r,this._instancesCounts[n]=1},t.remove=function(e){var t=this,i=this.getIdAndRules(e).styleId;if(function(e,t){if(!e)throw Error("StyleSheetRegistry: "+t+".")}(i in this._instancesCounts,"styleId: `"+i+"` not found"),this._instancesCounts[i]-=1,this._instancesCounts[i]<1){var n=this._fromServer&&this._fromServer[i];n?(n.parentNode.removeChild(n),delete this._fromServer[i]):(this._indices[i].forEac
1h(function(e){return t._sheet.deleteRule(e)}),delete this._indices[i]),delete this._instancesCounts[i]}},t.update=function(e,t){this.add(t),this.remove(e)},t.flush=function(){this._sheet.flush(),this._sheet.inject(),this._fromServer=void 0,this._indices={},this._instancesCounts={}},t.cssRules=function(){var e=this,t=this._fromServer?Object.keys(this._fromServer).map(function(t){return[t,e._fromServer[t]]}):[],i=this._sheet.cssRules();return t.concat(Object.keys(this._indices).map(function(t){return[t,e._indices[t].map(function(e){return i[e].cssText}).join(e._optimizeForSpeed?"":"\n")]}).filter(function(e){return!!e[1]}))},t.styles=function(e){var t,i;return t=this.cssRules(),void 0===(i=e)&&(i={}),t.map(function(e){var t=e[0],n=e[1];return r.default.createElement("style",{id:"__"+t,key:"__"+t,nonce:i.nonce?i.nonce:void 0,dangerouslySetInnerHTML:{__html:n}})})},t.getIdAndRules=function(e){var t=e.children,i=e.dynamic,n=e.id;if(i){var s=u(n,i);return{styleId:s,rules:Array.isArray(t)?t.map(function(e){return m(s,e)}):[m(s,t)]}}return{styleId:u(n),rules:Array.isArray(t)?t:[t]}},t.selectFromServer=function(){return Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]')).reduce(function(e,t){return e[t.id.slice(2)]=t,e},{})},e}(),f=s.createContext(null);f.displayName="StyleSheetContext";var y=r.default.useInsertionEffect||r.default.useLayoutEffect,x=new p;function g(e){var t=x||s.useContext(f);return t&&y(function(){return t.add(e),function(){t.remove(e)}},[e.id,String(e.dynamic)]),null}g.dynamic=function(e){return e.map(function(e){return u(e[0],e[1])}).join(" ")},t.style=g},75961:(e,t,i)=>{"use strict";e.exports=i(72784).style},92468:(e,t,i)=>{"use strict";i.r(t),i.d(t,{default:()=>l});var n=i(37876),s=i(14232),r=i(48230),a=i.n(r),o=i(90030);let d=e=>`$${((e||0)/100).toLocaleString("en-US",{minimumFractionDigits:0,maximumFractionDigits:0})}`;function l(){let[e,t]=(0,s.useState)(null),[i,r]=(0,s.useState)(""),[l,c]=(0,s.useState)(0);function h(){fetch("/api/admin/diya-campaign").then(e=>e.json()).then(t).catch(()=>{})}async function u(e){c(e.id);try{(await fetch("/api/admin/diya-campaign",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:e.id,hidden:!e.hidden})})).ok&&h()}finally{c(0)}}(0,s.useEffect)(()=>{h()},[]);let m=e?.stats,p=m?.goalCents?Math.min(100,Math.round(m.raisedCents/m.goalCents*100)):null,f=i.trim().toLowerCase(),y=(e?.donations||[]).filter(e=>!f||[e.dedication,e.name,d(e.amountCents)].some(e=>(e||"").toLowerCase().includes(f)));return(0,n.jsx)(o.Ay,{title:"Light a Diya",children:(0,n.jsxs)("div",{className:"max-w-6xl",children:[(0,n.jsxs)("p",{className:"text-gray-500 dark:text-white/60 text-sm mb-4",children:["The community Diya Wall campaign — totals and dedication moderation. Edit the goal/title/blurb under ",(0,n.jsx)(a(),{href:"/dashboard/campaigns",className:"text-[#F26644] font-semibold underline",children:"Campaigns"}),". Lives on the app home and the public ",(0,n.jsx)(a(),{href:"/diya-wall",className:"text-[#F26644] font-semibold underline",children:"/diya-wall"})," page."]}),m?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"grid grid-cols-3 gap-3 mb-1",children:[["On the wall",m.wallLit],["Paid gifts",m.gifts],["Raised",d(m.raisedCents)]].map(([e,t])=>
1(0,n.jsxs)("div",{className:"bg-white dark:bg-white/4 rounded-2xl border border-gray-100 dark:border-white/10 shadow-xs p-4 text-center",children:[(0,n.jsx)("p",{className:"text-2xl font-extrabold text-gray-900 dark:text-white tabular-nums",children:t}),(0,n.jsx)("p",{className:"text-gray-500 dark:text-white/60 text-[10px] font-semibold uppercase tracking-wide mt-0.5",children:e})]},e))}),(0,n.jsxs)("p",{className:"text-gray-400 dark:text-white/40 text-[11px] mb-4 px-1",children:["“On the wall” = ",m.diyas," paid + ",m.starterSeed," starter + volunteer-hour diyas (matches the public wall number exactly)."]}),(0,n.jsxs)("div",{className:"bg-white dark:bg-white/4 rounded-2xl border border-gray-100 dark:border-white/10 shadow-xs p-4 mb-5",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,n.jsxs)("span",{className:"font-bold text-gray-900 dark:text-white",children:[d(m.raisedCents)," of ",d(m.goalCents)]}),null!=p&&(0,n.jsxs)("span",{className:"text-gray-400 dark:text-white/40",children:[p,"%"]})]}),(0,n.jsx)("div",{className:"h-2 rounded-full bg-orange-100 overflow-hidden mt-2",children:(0,n.jsx)("div",{className:"h-full",style:{width:`${p||0}%`,background:"linear-gradient(to right,#c9752b,#ffca1f)"}})}),(0,n.jsxs)("p",{className:"text-gray-400 dark:text-white/40 text-[11px] mt-2",children:["$11 per diya (set in code). ",m.starterSeed," founding starter diyas + curated names show until 10 real gifts arrive, then auto-hide."]})]}),(0,n.jsx)("p",{className:"text-xs font-bold text-gray-400 dark:text-white/40 uppercase tracking-widest mb-2",children:"Dedications"}),e.donations.length>0&&(0,n.jsxs)("div",{className:"flex-1 min-w-0 relative mb-2",children:[(0,n.jsxs)("svg",{className:"absolute left-3.5 top-1/2 -translate-y-1/2 text-gray-400 dark:text-white/40",width:"15",height:"15",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:[(0,n.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,n.jsx)("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),(0,n.jsx)("input",{type:"text",placeholder:"Search…",value:i,onChange:e=>r(e.target.value),className:"w-full bg-white dark:bg-white/4 border border-gray-200 dark:border-white/10 rounded-xl pl-9 pr-4 py-2.5 text-sm focus:outline-hidden focus:ring-2 focus:ring-[#F26644]/20 focus:border-[#F26644] transition-all shadow-xs dark:text-white dark:placeholder-white/30"})]}),0===e.donations.length?(0,n.jsx)("p",{className:"text-gray-400 dark:text-white/40 text-sm",children:"No gifts yet."}):(0,n.jsx)("div",{className:"space-y-2",children:y.map(e=>{let t;return(0,n.jsxs)("div",{className:`bg-white dark:bg-white/4 roun
1ded-2xl border border-gray-100 dark:border-white/10 shadow-xs p-4 flex items-start justify-between gap-3 ${e.hidden?"opacity-60":""}`,children:[(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("p",{className:"font-bold text-gray-900 dark:text-white text-sm truncate",children:e.dedication||(e.anonymous?"(anonymous)":e.name||"—")}),(0,n.jsxs)("p",{className:"text-gray-400 dark:text-white/40 text-[11px] mt-0.5",children:[e.diyas," diya",1===e.diyas?"":"s"," \xb7 ",d(e.amountCents),e.name&&!e.anonymous?` \xb7 ${e.name}`:e.anonymous?" \xb7 anonymous":""," \xb7 ",(t=e.createdAt)?new Date(t).toLocaleDateString("en-US",{timeZone:"America/New_York",month:"short",day:"numeric"}):"",e.hidden?" \xb7 hidden":""]})]}),(e.dedication||e.name)&&!e.anonymous&&(0,n.jsx)("button",{onClick:()=>u(e),disabled:l===e.id,className:`text-xs font-bold shrink-0 ${e.hidden?"text-[#2e9664]":"text-gray-400 dark:text-white/40 hover:text-red-500"}`,children:e.hidden?"Show":"Hide"})]},e.id)})})]}):(0,n.jsx)("p",{className:"text-gray-400 dark:text-white/40 text-sm py-8 text-center",children:"Loading…"})]})})}}},e=>{e.O(0,[8230,6475,30,636,6593,8792],()=>e(e.s=42372)),_N_E=e.O()}]);

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.